:root {
  --ink: #2b2620;
  --ink-soft: #5b5347;
  --paper: #f7f3ea;
  --paper-2: #efe7d6;
  --line: #d8cdb6;
  --accent: #8a5a2b;
  --accent-2: #a9743b;
  --wood: #4e8d5b;
  --fire: #c8502f;
  --earth: #b08a3e;
  --metal: #9aa0a6;
  --water: #3d7fb3;
  --gold: #b8862f;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  background: var(--paper);
  color: var(--ink);
  line-height: 1.7;
}
.page { max-width: 880px; margin: 0 auto; padding: 24px 18px 60px; }

.hero { text-align: center; padding: 28px 0 18px; border-bottom: 2px solid var(--line); }
.hero h1 { font-size: 34px; letter-spacing: 6px; margin: 0 0 8px; color: var(--accent); }
.subtitle { margin: 0; color: var(--ink-soft); letter-spacing: 2px; }
.classics { margin: 10px 0 0; font-size: 13px; color: var(--accent-2); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 22px;
  margin-top: 22px;
  box-shadow: 0 2px 10px rgba(120, 90, 40, 0.06);
}

.form-card { display: grid; gap: 16px; }
.form-row { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; }
.form-row > label { width: 150px; flex-shrink: 0; font-weight: 600; }
.form-row > label small { font-weight: 400; color: var(--ink-soft); font-size: 12px; }
.form-row input[type="date"], .form-row input[type="time"], .form-row select {
  padding: 9px 12px; border: 1px solid var(--line); border-radius: 8px;
  font-size: 15px; font-family: inherit; background: var(--paper);
}
.radio-group { display: flex; gap: 18px; }
.radio { width: auto !important; font-weight: 400 !important; display: flex; align-items: center; gap: 6px; }
.hint { color: var(--accent-2); font-size: 13px; }

.btn-primary {
  margin-top: 6px; padding: 12px 28px; border: none; border-radius: 8px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #fff; font-size: 16px; letter-spacing: 4px; cursor: pointer;
  font-family: inherit; transition: filter .2s;
}
.btn-primary:hover { filter: brightness(1.08); }

.result { margin-top: 22px; }
.hidden { display: none; }

.section { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 20px 22px; margin-bottom: 18px; }
.section h2 { margin: 0 0 14px; font-size: 19px; color: var(--accent); border-left: 4px solid var(--accent); padding-left: 10px; letter-spacing: 2px; }
.src { font-size: 12px; color: var(--accent-2); margin-left: 8px; font-weight: 400; }

/* 四柱表 */
.pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; }
.pillar { text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 12px 6px; background: var(--paper); }
.pillar .label { font-size: 13px; color: var(--ink-soft); }
.pillar .ganzhi { font-size: 26px; letter-spacing: 2px; margin: 6px 0; }
.pillar .meta { font-size: 12px; color: var(--ink-soft); }
.pillar .shishen { font-size: 12px; color: var(--accent); margin-top: 4px; }

/* 五行条 */
.wx-bar { display: flex; height: 22px; border-radius: 6px; overflow: hidden; margin: 10px 0; }
.wx-seg { display: flex; align-items: center; justify-content: center; color: #fff; font-size: 12px; }
.wx-legend { display: flex; gap: 14px; flex-wrap: wrap; font-size: 13px; }
.wx-legend span { display: inline-flex; align-items: center; gap: 5px; }
.dot { width: 11px; height: 11px; border-radius: 50%; display: inline-block; }

/* 通用文字 */
.note { background: var(--paper-2); border-radius: 8px; padding: 12px 14px; font-size: 14px; }
.kv { display: flex; gap: 10px; margin: 8px 0; font-size: 14px; }
.kv .k { color: var(--ink-soft); min-width: 92px; }
.tag { display: inline-block; background: var(--accent); color: #fff; border-radius: 6px; padding: 2px 10px; font-size: 13px; margin: 2px 4px 2px 0; }
.badge-strong { background: var(--fire); }
.badge-weak { background: var(--water); }
.badge-mid { background: var(--earth); }

.day-master { font-size: 18px; }
.day-master b { font-size: 30px; color: var(--accent); letter-spacing: 2px; }

/* 神煞 */
.sha-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.sha { border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; }
.sha .name { font-weight: 600; }
.sha .val { color: var(--accent); font-size: 18px; margin: 2px 0; }
.sha.hit { border-color: var(--wood); background: rgba(78, 141, 91, 0.08); }
.sha.hit .val { color: var(--wood); font-weight: 600; }
.sha.miss { opacity: 0.62; }
.sha.miss .val { font-size: 14px; }

/* 调候用神标签 */
.yong { display: inline-block; color: #fff; border-radius: 6px; padding: 2px 11px; font-size: 15px; font-weight: 600; letter-spacing: 1px; }
.yong-木 { background: var(--wood); }
.yong-火 { background: var(--fire); }
.yong-土 { background: var(--earth); }
.yong-金 { background: var(--metal); }
.yong-水 { background: var(--water); }

.muted { color: var(--ink-soft); font-size: 13px; }
.note.warn { background: #fbf2e2; border: 1px solid #e8c78a; color: #8a5a2b; }
.help { line-height: 1.6; margin: 2px 0 0; max-width: 720px; }

/* 大运 */
.dy-list { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 6px; }
.dy { flex: 0 0 auto; min-width: 104px; text-align: center; border: 1px solid var(--line); border-radius: 10px; padding: 10px 6px; background: var(--paper); }
.dy .gz { font-size: 20px; letter-spacing: 1px; }
.dy .age { font-size: 12px; color: var(--ink-soft); margin-top: 2px; }
.dy .dy-verdict { display: inline-block; margin-top: 5px; font-size: 12px; padding: 1px 9px; border-radius: 6px; color: #fff; }
.dy .dy-ss { font-size: 11.5px; color: var(--accent); margin-top: 4px; }
.dy-good { background: var(--wood); }
.dy-warn { background: var(--fire); }
.dy-mid { background: var(--earth); }

.dy-detail { margin-top: 14px; display: grid; gap: 12px; }
.dy-item { border: 1px solid var(--line); border-radius: 10px; padding: 12px 14px; background: var(--paper); }
.dy-item-h { font-weight: 700; color: var(--accent); margin-bottom: 5px; font-size: 14.5px; }
.dy-item-c { font-size: 13.5px; color: var(--ink-soft); line-height: 1.7; }

/* 出生地省市联动：两个下拉并排 */
.form-row select#birthProvince, .form-row select#birthCity { min-width: 130px; }

.disclaimer { margin-top: 34px; padding: 16px 18px; background: var(--paper-2); border-radius: 10px; font-size: 13px; color: var(--ink-soft); border: 1px dashed var(--line); }
.disclaimer strong { color: var(--accent); }
.disclaimer-top { margin: 0 0 14px; padding: 12px 16px; background: var(--paper-2); border: 1px solid var(--line); border-left: 4px solid var(--accent); border-radius: 8px; font-size: 13px; line-height: 1.7; color: var(--ink-soft); }
.disclaimer-top strong { color: var(--accent); }

/* 大白话翻译块：专业解读后的人话版本 */
.plain {
  margin-top: 10px;
  background: #eef5f1;
  border: 1px solid #cfe3d8;
  border-left: 4px solid var(--wood);
  border-radius: 8px;
  padding: 10px 12px;
  font-size: 14px;
  color: #36473f;
  line-height: 1.75;
}
.plain-ico { display: inline-block; font-weight: 700; color: var(--wood); margin-right: 6px; }
.plain-mini { margin-top: 6px; font-size: 12.5px; color: #4a5b52; background: #eef5f1; border-radius: 6px; padding: 5px 8px; line-height: 1.6; }

/* 四柱 · 逐柱解读 */
.pillar-int { margin-top: 12px; display: grid; gap: 10px; }
.pi-row { border: 1px solid var(--line); border-radius: 10px; padding: 11px 14px; background: var(--paper); }
.pi-row.pi-unknown { border-style: dashed; opacity: 0.85; background: #f6f1e6; }
.pi-row.pi-speculative { border-color: #e0a85a; background: #fbf3e6; }
.pi-h { font-weight: 700; color: var(--accent); font-size: 14px; margin-bottom: 4px; }
.pi-c { font-size: 13.5px; color: var(--ink-soft); line-height: 1.75; }

/* 调候用神 · 忌见（弱化警示） */
.ji-text { color: #b3543a; }
.note .ji-text, .kv .ji-text { font-weight: 500; }
@media (prefers-color-scheme: dark) {
  .ji-text { color: #e89b86; }
}

/* 综合总结卡片 */
.summary-card {
  border: 1.5px solid var(--accent);
  background: linear-gradient(180deg, #fdfbf4 0%, #fbf6ea 100%);
  box-shadow: 0 6px 22px rgba(162, 124, 70, 0.16);
}
.summary-card h2 { color: var(--accent); }
.summary-body { padding: 2px 2px 4px; }
.summary-text {
  margin: 0;
  font-size: 16px;
  line-height: 1.95;
  color: #3a2f20;
  letter-spacing: 0.2px;
  text-align: justify;
}
@media (prefers-color-scheme: dark) {
  .summary-card {
    background: linear-gradient(180deg, #2a2419 0%, #241f16 100%);
    box-shadow: 0 6px 22px rgba(0, 0, 0, 0.4);
  }
  .summary-text { color: #ece3d2; }
}

@media (max-width: 560px) {
  .form-row > label { width: 100%; }
  .pillars { grid-template-columns: repeat(2, 1fr); }
  .sha-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: 26px; letter-spacing: 3px; }
}

/* T0 扩展：六亲 / 病药 / 用神体系 */
.lq-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px; }
.lq { border: 1px solid var(--line); border-radius: 8px; padding: 12px 14px; background: #fff; }
.lq-h { font-weight: 600; margin-bottom: 4px; }
.lq-star { color: var(--accent-2); font-size: 13px; margin-bottom: 6px; }
.lq-c { font-size: 13.5px; color: var(--ink-soft); line-height: 1.65; }
.ys-list { display: grid; gap: 10px; }
.ys { border: 1px solid var(--line); border-radius: 8px; padding: 10px 14px; background: #fff; }
.ys-h { font-weight: 600; color: var(--accent); margin-bottom: 3px; }
.ys-c { font-size: 13.5px; color: var(--ink-soft); line-height: 1.65; }
.kv-list { margin: 8px 0; }
.kv-list .kv { border-left: 3px solid var(--fire); padding-left: 8px; }

@media (prefers-color-scheme: dark) {
  .lq, .ys { background: #241f16; border-color: #3a3324; }
  .lq-c, .ys-c { color: #b9ad97; }
}
@media (max-width: 560px) {
  .lq-grid { grid-template-columns: 1fr; }
}

/* 引导卡 · 术语小词典 */
.guide-card {
  border: 1.5px solid var(--accent);
  background: linear-gradient(180deg, #fdfbf4 0%, #fbf6ea 100%);
  box-shadow: 0 6px 22px rgba(162, 124, 70, 0.16);
}
.guide-card h2 { color: var(--accent); }
.glossary { margin-top: 12px; display: grid; gap: 8px; }
.gl-item {
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 12px;
  align-items: start;
  padding: 8px 12px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.gl-term {
  font-weight: 700;
  color: var(--accent);
  font-size: 14px;
  line-height: 1.5;
}
.gl-def {
  font-size: 13.5px;
  color: var(--ink-soft);
  line-height: 1.7;
}
.gl-def strong { color: var(--fire); }
@media (prefers-color-scheme: dark) {
  .guide-card { background: linear-gradient(180deg, #2a2419 0%, #241f16 100%); }
  .gl-item { background: #241f16; border-color: #3a3324; }
  .gl-def { color: #b9ad97; }
}
@media (max-width: 560px) {
  .gl-item { grid-template-columns: 1fr; gap: 2px; }
  .gl-term { font-size: 13.5px; }
}

/* ===== 五行雷达图 ===== */
.wx-radar-wrap { display: flex; justify-content: center; margin: 14px 0 4px; }
.wx-radar { max-width: 100%; height: auto; }
.radar-grid { fill: none; stroke: #e3d9c4; }
.radar-axis { stroke: #e3d9c4; }
.radar-data { fill: rgba(200, 80, 47, 0.22); stroke: #c8502f; stroke-width: 2; }
.radar-dot { fill: #c8502f; }
.radar-label { font-size: 13px; font-weight: 700; }

/* ===== 一键分享浮动按钮 ===== */
.share-fab {
  position: fixed; right: 20px; bottom: 24px; z-index: 50;
  padding: 12px 20px; border: none; border-radius: 28px;
  background: var(--accent); color: #fff; font-size: 15px; letter-spacing: 2px;
  font-family: inherit; cursor: pointer;
  box-shadow: 0 6px 18px rgba(138, 90, 43, 0.35);
  transition: transform .15s ease, background .15s ease;
}
.share-fab:hover { background: var(--accent-2); transform: translateY(-2px); }

/* ===== 分享弹卡 ===== */
.share-overlay {
  position: fixed; inset: 0; z-index: 100;
  background: rgba(40, 33, 22, 0.55);
  display: none; align-items: center; justify-content: center; padding: 20px;
}
.share-overlay.show { display: flex; }
.share-card {
  position: relative; background: #fff; border-radius: 18px; padding: 10px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.3); max-width: 400px; width: 92vw;
}
.share-close {
  position: absolute; top: 4px; right: 8px; z-index: 2;
  width: 30px; height: 30px; border: none; background: transparent;
  font-size: 24px; line-height: 1; color: #9a8f78; cursor: pointer;
}
.share-close:hover { color: var(--accent); }
.share-card-body { display: flex; justify-content: center; }
.share-card-body svg, .share-png-img { width: 100%; height: auto; max-width: 360px; border-radius: 12px; display: block; }
.share-generating { padding: 40px 0; text-align: center; color: #9a8f78; font-size: 14px; }
.share-card-qr {
  display: block;
  margin-top: 8px; padding: 0 6px;
}
.share-card-qr .qr-box {
  display: inline-block;
  vertical-align: middle;
  width: 56px; height: 56px; border-radius: 10px;
  background: #fff;
  border: 1px solid #eadfcb;
  object-fit: contain;
}
.share-card-qr .qr-text {
  display: inline-block;
  vertical-align: middle;
  margin-left: 10px;
}
.share-qr-title { font-size: 13px; font-weight: 700; color: #6b5d4a; line-height: 1.35; }
.share-qr-sub  { font-size: 13px; font-weight: 700; color: #6b5d4a; line-height: 1.35; }
.share-actions { display: flex; justify-content: center; margin-top: 10px; }
.share-save {
  padding: 9px 26px; border: none; border-radius: 22px;
  background: var(--accent); color: #fff; font-size: 14px; letter-spacing: 1px;
  font-family: inherit; cursor: pointer;
}
.share-save:hover { background: var(--accent-2); }

@media (prefers-color-scheme: dark) {
  .share-card { background: #2a2419; }
}

/* ===== 恢复板块：引导卡 / 基础信息 / 大运走势 ===== */
.guide-card {
  background: linear-gradient(180deg, #fff8ec 0%, #fffdf8 100%);
  border: 1px solid #ecd9b4; border-left: 4px solid var(--accent);
  border-radius: 12px; padding: 16px 18px; margin-bottom: 18px;
}
.guide-card .gc-title { font-weight: 700; color: #8a5a2b; font-size: 15px; margin-bottom: 6px; }
.guide-card .gc-body { font-size: 13.5px; line-height: 1.75; color: var(--ink-soft); }

.muted { color: var(--ink-soft); opacity: 0.72; font-size: 12.5px; }

.dayun { display: grid; gap: 12px; margin-bottom: 6px; }
.dayun-item {
  border: 1px solid var(--line); border-left: 4px solid var(--accent);
  border-radius: 10px; padding: 12px 14px; background: var(--paper);
}
.dy-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 8px; }
.dy-n { font-size: 12px; color: var(--ink-soft); }
.dy-gz { font-size: 22px; letter-spacing: 2px; font-weight: 700; color: var(--ink); margin: 0 2px; }
.dy-age { font-size: 12.5px; color: var(--ink-soft); }
.dy-verdict { margin-left: auto; font-size: 12px; padding: 2px 10px; border-radius: 12px; color: #fff; }
.dy-v-good { background: var(--wood); }
.dy-v-warn { background: var(--fire); }
.dy-v-mid { background: #9a8f78; }
.dy-sub { font-size: 12.5px; color: var(--accent-2); margin: 6px 0; line-height: 1.6; }
.dy-comment { font-size: 13.5px; color: var(--ink-soft); line-height: 1.7; }

@media (max-width: 480px) {
  .dy-gz { font-size: 19px; }
}

/* ===== 会员专享占位引导 ===== */
.vip-card {
  background: linear-gradient(180deg, #fff7e9 0%, #fff3da 100%);
  border: 1px solid #f0d28a; border-left: 4px solid #d9a441;
  border-radius: 14px; padding: 18px 18px 16px; margin-top: 18px;
}
.vip-title { font-weight: 800; color: #9a6b1f; font-size: 16px; margin-bottom: 8px; }
.vip-lead { font-size: 13.5px; line-height: 1.7; color: #6b5d4a; margin-bottom: 12px; }
.vip-list { list-style: none; padding: 0; margin: 0 0 14px; }
.vip-list li { font-size: 13.5px; line-height: 1.6; color: #4a4234; padding: 6px 0; border-bottom: 1px dashed #ecd9b4; display: flex; gap: 8px; align-items: baseline; }
.vip-list li:last-child { border-bottom: none; }
.vip-ic { flex: none; }
.vip-list b { color: #8a5a2b; }
.vip-btn {
  display: block; width: 100%; padding: 11px 0; border: none; border-radius: 22px;
  background: linear-gradient(90deg, #d9a441, #c8893a); color: #fff;
  font-size: 14px; font-weight: 700; letter-spacing: 1px; font-family: inherit; cursor: pointer;
}
.vip-btn:hover { filter: brightness(1.05); }
.vip-note { display: none; margin-top: 12px; padding: 12px; background: #fff; border-radius: 10px; font-size: 13px; line-height: 1.7; color: #8a5a2b; text-align: center; }
.vip-hook {
  margin-top: 12px; padding: 10px 12px; border-radius: 10px;
  background: #fff7e9; border: 1px dashed #e9cf94;
  font-size: 12.5px; color: #9a6b1f; line-height: 1.6;
}
@media (prefers-color-scheme: dark) {
  .vip-card { background: #2e2718; border-color: #5a4a2a; }
  .vip-title { color: #e9c97a; }
  .vip-lead, .vip-list li { color: #cdbfa6; }
  .vip-list b { color: #e9c97a; }
  .vip-note { background: #211c12; color: #e9c97a; }
  .vip-hook { background: #2a2416; border-color: #5a4a2a; color: #e9c97a; }
}

/* ===== 限时体验：倒计时横幅 + 过期遮罩（仅复制版 bazi-web-tmp）===== */
.expiry-banner {
  position: fixed; top: 0; left: 0; right: 0; z-index: 999;
  background: linear-gradient(90deg, #c8502f, #b08a3e);
  color: #fff; text-align: center; font-size: 13px; line-height: 1;
  padding: 9px 10px; box-shadow: 0 2px 8px rgba(0,0,0,.2);
}
.expiry-banner b { font-variant-numeric: tabular-nums; letter-spacing: .5px; }
.expired-box {
  max-width: 440px; margin: 48px auto; text-align: center;
  padding: 34px 22px; background: #fff; border-radius: 16px;
  box-shadow: 0 8px 30px rgba(0,0,0,.12);
}
.expired-emoji { font-size: 48px; }
.expired-box h2 { color: #c8502f; margin: 12px 0; font-size: 20px; }
.expired-box p { color: #555; font-size: 14px; line-height: 1.7; margin: 8px 0; }
.expired-tip { color: #888 !important; margin-top: 16px !important; }
.expired-tip a { color: #3d7fb3; text-decoration: none; font-weight: 600; }
