/* ============ 八字人生解读 — 墨色金印主题 ============ */
:root {
  --bg: #171310;
  --card: #221a13;
  --card-2: #2a2017;
  --line: rgba(211, 176, 106, 0.22);
  --text: #ece2cd;
  --muted: #a8947a;
  --gold: #d3b06a;
  --gold-deep: #a97f3a;
  --red: #c0392b;
  --red-deep: #8e2a20;
  --green: #7fb069;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

html { -webkit-text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* 背景光晕 */
.bg-glow {
  position: fixed;
  border-radius: 50%;
  filter: blur(90px);
  opacity: 0.16;
  pointer-events: none;
  z-index: 0;
}
.bg-glow-1 { width: 420px; height: 420px; background: #8a5a20; top: -120px; left: -120px; }
.bg-glow-2 { width: 380px; height: 380px; background: #7a2a1e; bottom: -140px; right: -100px; }

.page {
  position: relative;
  z-index: 1;
  max-width: 680px;
  margin: 0 auto;
  padding: 20px 16px 48px;
}

.hidden { display: none !important; }

/* ---------- 头部 ---------- */
.header { padding: 18px 6px 26px; text-align: center; }
.brand { display: flex; align-items: center; justify-content: center; gap: 14px; }
.brand-seal {
  width: 54px; height: 54px;
  background: linear-gradient(145deg, #b03a2b, #8e2a20);
  color: #f5e6c8;
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 30px;
  line-height: 54px;
  border-radius: 10px;
  box-shadow: 0 4px 14px rgba(176, 58, 43, 0.35), inset 0 0 0 2px rgba(245, 230, 200, 0.25);
}
.brand h1 {
  font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: 26px;
  letter-spacing: 3px;
  color: var(--gold);
  text-align: left;
}
.brand-sub { color: var(--muted); font-size: 12px; margin-top: 4px; text-align: left; }

/* ---------- 卡片 ---------- */
.card {
  background: linear-gradient(160deg, var(--card), #1e1710);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px 16px;
  margin-bottom: 16px;
  box-shadow: 0 8px 24px rgba(0, 0, 0, 0.35);
}
.card-title {
  font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: 20px;
  letter-spacing: 2px;
  color: var(--gold);
  margin-bottom: 12px;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* ---------- 表单 ---------- */
.field { display: block; margin-bottom: 14px; }
.field-row { display: flex; gap: 12px; }
.field-row .field { flex: 1; }
.label { display: block; color: var(--muted); font-size: 13px; margin-bottom: 6px; }
.muted { color: var(--muted); font-weight: normal; font-size: 11px; }

input[type="text"], select {
  width: 100%;
  background: #191310;
  border: 1px solid var(--line);
  border-radius: 9px;
  color: var(--text);
  padding: 11px 12px;
  font-size: 15px;
  outline: none;
  appearance: none;
  -webkit-appearance: none;
}
input[type="text"]:focus, select:focus { border-color: var(--gold); }
select {
  background-image: linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px;
  background-repeat: no-repeat;
}

.triple { display: grid; grid-template-columns: 1.4fr 1fr 1fr; gap: 8px; }

.seg { display: flex; background: #191310; border: 1px solid var(--line); border-radius: 9px; padding: 3px; }
.seg-btn {
  flex: 1;
  background: transparent;
  border: none;
  color: var(--muted);
  padding: 9px 0;
  font-size: 14px;
  border-radius: 7px;
  cursor: pointer;
  transition: all 0.15s;
}
.seg-btn.active { background: linear-gradient(135deg, #c9a45c, #a97f3a); color: #1a1208; font-weight: 600; }

.form-note, .chart-note { color: var(--muted); font-size: 11px; margin-top: 10px; line-height: 1.6; }
.form-error { color: #e07a6a; font-size: 13px; margin-top: 10px; }

/* ---------- 按钮 ---------- */
.btn {
  border: none;
  border-radius: 10px;
  cursor: pointer;
  font-size: 16px;
  font-family: inherit;
  transition: transform 0.1s, filter 0.15s;
}
.btn:active { transform: scale(0.98); }
.btn-block { display: block; width: 100%; padding: 13px; }
.btn-primary {
  background: linear-gradient(135deg, #d3b06a, #a97f3a);
  color: #1c1308;
  font-weight: 700;
  letter-spacing: 2px;
  box-shadow: 0 6px 18px rgba(211, 176, 106, 0.25);
}
.btn-primary:hover { filter: brightness(1.08); }
.btn-ghost {
  background: transparent;
  border: 1px solid var(--line);
  color: var(--muted);
  padding: 8px 14px;
  font-size: 13px;
  flex-shrink: 0;
}
.btn-test {
  display: block;
  width: 100%;
  margin-top: 10px;
  padding: 9px;
  background: transparent;
  color: var(--muted);
  font-size: 12px;
  text-decoration: underline;
}

/* ---------- 命盘 ---------- */
.chart-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; margin-bottom: 12px; }
.chart-meta { color: var(--muted); font-size: 13px; line-height: 1.6; }

.bazi-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-bottom: 14px;
}
.pillar {
  background: #191310;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 10px 6px;
  text-align: center;
}
.pillar.day-master { border-color: rgba(211, 176, 106, 0.75); background: #221a10; box-shadow: 0 0 14px rgba(211, 176, 106, 0.12); }
.pillar .pl-label { font-size: 11px; color: var(--muted); margin-bottom: 6px; }
.pillar .pl-ten { font-size: 11px; color: var(--gold); height: 15px; }
.pillar .pl-gan {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 34px;
  line-height: 1.1;
  margin: 2px 0;
}
.pillar .pl-zhi {
  font-family: "STKaiti", "KaiTi", serif;
  font-size: 24px;
  color: var(--muted);
}
.pillar .pl-cang { font-size: 10px; color: var(--muted); margin-top: 4px; min-height: 14px; }
.wx-0 { color: #8fbf7c; }
.wx-1 { color: #e07a4f; }
.wx-2 { color: #d3b06a; }
.wx-3 { color: #d8dbd3; }
.wx-4 { color: #7fb0cf; }

.wuxing-bars { display: flex; flex-direction: column; gap: 7px; margin-bottom: 14px; }
.wx-row { display: flex; align-items: center; gap: 10px; }
.wx-name { width: 34px; font-family: "STKaiti", "KaiTi", serif; font-size: 14px; }
.wx-track { flex: 1; height: 10px; background: #191310; border-radius: 5px; overflow: hidden; }
.wx-fill { height: 100%; border-radius: 5px; transition: width 0.6s ease; }
.wx-0-fill { background: linear-gradient(90deg, #5f8f4c, #8fbf7c); }
.wx-1-fill { background: linear-gradient(90deg, #a54a28, #e07a4f); }
.wx-2-fill { background: linear-gradient(90deg, #8a6a35, #d3b06a); }
.wx-3-fill { background: linear-gradient(90deg, #8b8f88, #d8dbd3); }
.wx-4-fill { background: linear-gradient(90deg, #3f6f8f, #7fb0cf); }
.wx-val { width: 30px; text-align: right; font-size: 12px; color: var(--muted); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  background: #1c1610;
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 12px;
  padding: 5px 11px;
  border-radius: 999px;
}
.chip b { color: var(--gold); font-weight: 600; }

/* ---------- 段落 / 时间线 ---------- */
.paragraphs p {
  color: #d9cdb4;
  font-size: 15px;
  line-height: 1.85;
  margin-bottom: 10px;
  text-align: justify;
}
.timeline { position: relative; padding-left: 4px; }
.tl-item {
  border-left: 2px solid rgba(211, 176, 106, 0.35);
  padding: 0 0 16px 16px;
  position: relative;
}
.tl-item:last-child { padding-bottom: 0; }
.tl-item::before {
  content: "";
  position: absolute;
  left: -6px;
  top: 5px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--gold);
  box-shadow: 0 0 8px rgba(211, 176, 106, 0.6);
}
.tl-year { color: var(--gold); font-family: "STKaiti", "KaiTi", serif; font-size: 16px; margin-bottom: 4px; }
.tl-year small { color: var(--muted); font-size: 11px; margin-left: 6px; }
.tl-text { color: #d9cdb4; font-size: 14px; line-height: 1.75; text-align: justify; }
.tl-text b { color: #efdfc0; }

/* ---------- 徽标 ---------- */
.badge { font-size: 11px; padding: 2px 8px; border-radius: 999px; font-weight: normal; letter-spacing: 0; }
.badge-free { background: rgba(127, 176, 105, 0.15); color: #9cc98b; border: 1px solid rgba(127, 176, 105, 0.4); }
.badge-paid { background: rgba(211, 176, 106, 0.15); color: var(--gold); border: 1px solid rgba(211, 176, 106, 0.4); }

/* ---------- 付费墙 ---------- */
.paywall {
  text-align: center;
  background: linear-gradient(160deg, #241b12, #1c1610);
  border: 1px dashed rgba(211, 176, 106, 0.45);
  padding: 26px 18px;
}
.paywall-lock { font-size: 30px; margin-bottom: 6px; }
.paywall-title {
  font-family: "STKaiti", "KaiTi", "Noto Serif SC", serif;
  font-size: 21px;
  color: var(--gold);
  letter-spacing: 2px;
  margin-bottom: 14px;
}
.paywall-list { text-align: left; margin-bottom: 16px; }
.pw-item {
  display: flex;
  align-items: center;
  gap: 10px;
  background: #191310;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 11px 13px;
  margin-bottom: 8px;
}
.pw-item .pw-ico { font-size: 18px; }
.pw-item .pw-name { color: var(--text); font-size: 15px; font-family: "STKaiti", "KaiTi", serif; }
.pw-item .pw-teaser {
  flex: 1;
  color: var(--muted);
  font-size: 12px;
  filter: blur(3.5px);
  user-select: none;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
.pw-item .pw-lock { color: var(--gold); font-size: 13px; flex-shrink: 0; }
.paywall-tip { color: var(--muted); font-size: 12px; margin-bottom: 16px; }
.paywall-note { color: var(--muted); font-size: 11px; margin-top: 12px; }

/* ---------- 大运表 ---------- */
.dayun-start { color: #d9cdb4; font-size: 14px; margin-bottom: 12px; }
.dayun-table { display: flex; flex-direction: column; gap: 8px; }
.dy-row {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 10px;
  align-items: center;
  background: #191310;
  border: 1px solid var(--line);
  border-radius: 9px;
  padding: 10px 13px;
}
.dy-row.current { border-color: rgba(211, 176, 106, 0.75); box-shadow: 0 0 12px rgba(211, 176, 106, 0.12); }
.dy-gz { font-family: "STKaiti", "KaiTi", serif; font-size: 18px; color: var(--gold); text-align: center; }
.dy-gz small { display: block; font-size: 10px; color: var(--muted); font-family: sans-serif; }
.dy-body .dy-age { font-size: 11px; color: var(--muted); margin-bottom: 2px; }
.dy-body .dy-ten { font-size: 13px; color: var(--text); }
.dy-body .dy-theme { font-size: 12px; color: #b9a988; margin-top: 2px; }

/* ---------- 弹窗 ---------- */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.72);
  z-index: 50;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal {
  background: linear-gradient(160deg, #241c14, #1c1610);
  border: 1px solid rgba(211, 176, 106, 0.45);
  border-radius: 16px;
  width: 100%;
  max-width: 400px;
  padding: 22px 20px;
  text-align: center;
  animation: pop 0.22s ease;
  max-height: 90vh;
  overflow-y: auto;
}
@keyframes pop { from { transform: scale(0.94); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.modal-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.modal-head h3 { font-family: "STKaiti", "KaiTi", serif; color: var(--gold); font-size: 20px; letter-spacing: 2px; }
.modal-close {
  background: none; border: none;
  color: var(--muted); font-size: 26px;
  cursor: pointer; line-height: 1;
}
.modal-price { color: var(--text); font-size: 15px; margin-bottom: 14px; }
.modal-price span { color: var(--red); font-size: 34px; font-weight: 700; font-family: Georgia, serif; }
.modal-price small { color: var(--muted); font-size: 12px; margin-left: 4px; }

.pay-tabs { display: flex; gap: 8px; margin-bottom: 14px; }
.pay-tab {
  flex: 1;
  background: #191310;
  border: 1px solid var(--line);
  color: var(--muted);
  border-radius: 9px;
  padding: 9px 0;
  cursor: pointer;
  font-size: 14px;
}
.pay-tab.active { border-color: var(--gold); color: var(--gold); font-weight: 600; }

.qr-box {
  width: 210px;
  height: 210px;
  margin: 0 auto 12px;
  background: #fff;
  border-radius: 10px;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.qr-box img { width: 100%; height: 100%; object-fit: contain; }
.qr-placeholder {
  color: #8a7a5e;
  font-size: 13px;
  line-height: 1.7;
  text-align: center;
  padding: 14px;
}
.qr-tip { color: var(--text); font-size: 14px; margin-bottom: 14px; }
.qr-note { color: var(--muted); font-size: 11px; margin-top: 12px; line-height: 1.6; }

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 60px;
  transform: translateX(-50%);
  background: rgba(211, 176, 106, 0.95);
  color: #1c1308;
  font-size: 14px;
  font-weight: 600;
  padding: 10px 22px;
  border-radius: 999px;
  z-index: 100;
  box-shadow: 0 6px 20px rgba(0, 0, 0, 0.4);
  animation: pop 0.2s ease;
}

/* ---------- 页脚 ---------- */
.footer { text-align: center; padding: 26px 10px 10px; }
.footer p { color: #6f6150; font-size: 11px; line-height: 1.7; }
.footer-brand { margin-top: 8px; }

/* ---------- 桌面 ---------- */
@media (min-width: 720px) {
  .page { padding-top: 34px; }
  .card { padding: 22px 24px; }
  .bazi-grid { gap: 12px; }
  .pillar { padding: 14px 8px; }
}
