/* KnowYours 知己 · 五行水墨设计系统（与 design/wuxing-ink.tokens.json 同步） */
:root {
  --linen: #EEE8DE;
  --linen-light: #F5F1EA;
  --linen-deep: #E4E0D6;
  --mist: #AAB5BE;
  --mist-light: #C4CBD1;
  --lead: #6A6C73;
  --ink: #3F454B;
  --divider: #D8D3C9;
  --surface: #F5F1EA;
  --surface-2: #FBF8F3;
  --text: #3F454B;
  --text-2: #6A6C73;
  --shadow: 0 12px 36px rgba(63, 69, 75, .07);
  --jin: #D4AF37; --mu: #6FAF7B; --shui: #4A6FA5; --huo: #E4573D; --tu: #C2A26E;
  --lu: #4E7C59; --quan: #506070; --ke: #D4AF37; --ji: #B3402A;
  --pos: #4E7C59; --neu: #7C858C; --cau: #B3402A;
}

body.dark {
  --linen: #2E3338;
  --linen-light: #3C4248;
  --linen-deep: #474E55;
  --mist: #7C858C;
  --mist-light: #B9C0C6;
  --lead: #B9C0C6;
  --ink: #EEE8DE;
  --divider: #555C63;
  --surface: #3C4248;
  --surface-2: #343A40;
  --text: #EEE8DE;
  --text-2: #B9C0C6;
  --shadow: 0 12px 36px rgba(0, 0, 0, .22);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--linen);
  color: var(--text);
  font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin-top: 0; }
.hidden { display: none !important; }

/* ── 顶栏 ── */
.topbar {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 28px;
  padding: 12px clamp(18px, 4vw, 56px);
  background: color-mix(in srgb, var(--linen) 92%, transparent);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--divider);
}
.brand { display: flex; align-items: center; gap: 11px; flex-shrink: 0; }
.brand-mark {
  width: 38px; height: 38px; display: grid; place-items: center;
  border-radius: 11px; background: var(--lead); color: #fff;
  font-size: 19px; font-weight: 600; font-family: "Songti SC", "SimSun", serif;
}
.brand-text { display: flex; flex-direction: column; line-height: 1.2; }
.brand-text strong { font-size: 17px; letter-spacing: .06em; }
.brand-text small { font-size: 11px; color: var(--text-2); letter-spacing: .18em; }
.nav { display: flex; gap: 22px; margin-left: auto; font-size: 14px; color: var(--text-2); }
.nav a:hover { color: var(--text); }
.topbar-right { display: flex; align-items: center; gap: 12px; margin-left: auto; }
.icon-btn {
  width: 34px; height: 34px; border-radius: 50%; border: 1px solid var(--divider);
  background: var(--surface); font-size: 17px; line-height: 1;
}
.icon-btn:hover { border-color: var(--lead); }
.wallet {
  display: flex; align-items: center; gap: 8px; padding: 5px 6px 5px 13px;
  border: 1px solid var(--divider); border-radius: 999px; background: var(--surface);
  font-size: 12px; color: var(--text-2); white-space: nowrap;
}
.wallet b { color: var(--text); font-size: 15px; font-variant-numeric: tabular-nums; }
.wallet button {
  border: 0; border-radius: 999px; padding: 5px 11px;
  background: var(--lead); color: #fff; font-size: 12px;
}
.wallet button:hover { filter: brightness(1.1); }
.demo-banner {
  padding: 8px clamp(18px, 4vw, 56px); font-size: 12.5px;
  background: color-mix(in srgb, var(--jin) 14%, var(--linen));
  color: var(--text); border-bottom: 1px solid var(--divider);
}
.demo-banner strong { font-weight: 600; }
.demo-banner .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--jin); margin-right: 8px; vertical-align: middle; }

main { max-width: 1240px; margin: 0 auto; padding: 0 clamp(18px, 4vw, 56px) 60px; }
.eyebrow { font-size: 11px; letter-spacing: .24em; color: var(--text-2); text-transform: uppercase; margin-bottom: 12px; }

/* ── 首页 ── */
.hero {
  display: grid; grid-template-columns: 1.05fr .95fr; gap: 40px; align-items: center;
  padding: clamp(42px, 7vw, 88px) 0 clamp(36px, 5vw, 64px);
}
.hero h1 {
  font-family: "Songti SC", "SimSun", "STSong", serif;
  font-size: clamp(42px, 6vw, 68px); line-height: 1.18; font-weight: 500;
  letter-spacing: .04em; margin: 0 0 22px;
}
.hero h1 em { font-style: normal; color: var(--lead); }
.lead { color: var(--text-2); font-size: 15px; line-height: 1.9; margin-bottom: 28px; }
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 36px; }
.btn {
  border: 1px solid var(--divider); border-radius: 10px; background: var(--surface);
  padding: 11px 22px; font-size: 14px; font-weight: 500; transition: .2s ease;
}
.btn:hover { transform: translateY(-1px); border-color: var(--lead); }
.btn.primary { background: var(--ink); color: var(--linen); border-color: var(--ink); }
.btn.primary:hover { filter: brightness(1.18); }
.btn.ghost { background: transparent; }
.btn.small { padding: 8px 15px; font-size: 13px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none; }
.hero-points { list-style: none; padding: 0; margin: 0; display: grid; gap: 11px; }
.hero-points li { display: flex; gap: 12px; align-items: baseline; font-size: 13px; color: var(--text-2); }
.hero-points span { font-size: 11px; color: var(--lead); font-variant-numeric: tabular-nums; letter-spacing: .1em; }

/* ── 五行动效 ── */
.wuxing-stage { display: flex; flex-direction: column; align-items: center; }
.wuxing-stage svg { width: min(100%, 420px); height: auto; overflow: visible; }
.outer-ring { fill: none; stroke: var(--divider); stroke-width: 1; }
.sheng-ring {
  fill: none; stroke: var(--mist); stroke-width: 1.5; stroke-dasharray: 5 9;
  transform-origin: 200px 200px; animation: ringRotate 16s linear infinite;
  opacity: .75;
}
@keyframes ringRotate { to { transform: rotate(360deg); } }
.sheng-lines line, .ke-lines line { stroke-width: 2.5; stroke-linecap: round; fill: none; }
.sheng-lines line { stroke-dasharray: 10 12; opacity: .9; }
.sheng-lines { animation: phaseSheng 8s linear infinite; }
.ke-lines { animation: phaseKe 8s linear infinite; }
.ke-lines line { stroke: var(--lead); stroke-dasharray: 6 8; opacity: .55; }
@keyframes phaseSheng { 0%, 60% { opacity: 1; } 65%, 97% { opacity: 0; } 100% { opacity: 1; } }
@keyframes phaseKe { 0%, 60% { opacity: 0; } 65%, 97% { opacity: 1; } 100% { opacity: 0; } }
.sheng-flow { animation: flowDash 2s linear infinite; }
@keyframes flowDash { to { stroke-dashoffset: -44; } }
.wx-node circle.halo { opacity: .16; animation: haloPulse 8s ease-in-out infinite; }
@keyframes haloPulse { 0%, 100% { opacity: .1; } 50% { opacity: .3; } }
.wx-node circle.core { stroke: var(--linen); stroke-width: 3; }
.wx-node text { font-size: 27px; font-family: "Songti SC", "SimSun", serif; font-weight: 600; text-anchor: middle; dominant-baseline: central; }
.center-disc { fill: var(--surface-2); stroke: var(--divider); stroke-width: 1; filter: drop-shadow(0 6px 16px rgba(63,69,75,.08)); }
.center-word { font-size: 22px; font-family: "Songti SC", "SimSun", serif; fill: var(--text); letter-spacing: .1em; }
.sheng-word { animation: phaseSheng 8s linear infinite; }
.ke-word { animation: phaseKe 8s linear infinite; }
.center-sub { font-size: 11px; fill: var(--text-2); letter-spacing: .08em; }
.phase-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--mu); margin-right: 8px; }
.stage-caption { font-size: 12px; color: var(--text-2); letter-spacing: .08em; }
@media (prefers-reduced-motion: reduce) {
  .sheng-ring, .sheng-flow, .wx-node circle.halo, .sheng-lines, .ke-lines, .sheng-word, .ke-word { animation: none !important; }
  .ke-lines, .ke-word { opacity: 0; }
  .sheng-lines, .sheng-word { opacity: 1; }
}

/* ── 面板 / 表单 ── */
.panel { background: var(--surface); border: 1px solid var(--divider); border-radius: 18px; padding: clamp(22px, 3.5vw, 36px); box-shadow: var(--shadow); }
.section-head { display: flex; justify-content: space-between; gap: 28px; align-items: end; margin-bottom: 26px; }
.section-head h2, .result-head h2 { font-family: "Songti SC", "SimSun", serif; font-size: 27px; font-weight: 500; margin: 0; }
.section-note { max-width: 420px; font-size: 12.5px; color: var(--text-2); margin: 0; line-height: 1.75; }
.birth-form { display: grid; grid-template-columns: repeat(5, minmax(0, 1fr)) auto; gap: 14px; align-items: end; }
.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > span { font-size: 12px; color: var(--text-2); }
.field i { font-style: normal; opacity: .7; font-size: 11px; }
.field input, .field select {
  width: 100%; height: 42px; padding: 0 11px; border-radius: 9px;
  border: 1px solid var(--divider); background: var(--surface-2); font-size: 14px;
}
.field input:focus, .field select:focus { outline: 2px solid var(--mist); outline-offset: 1px; }
.birth-form .submit { height: 42px; white-space: nowrap; }
.hint { font-size: 12px; color: var(--text-2); margin: 18px 0 0; }
.hint.error { color: var(--ji); }

/* ── 结果 ── */
.result { padding-top: 46px; scroll-margin-top: 72px; }
#report-body { scroll-margin-top: 72px; }
.result-head { display: flex; justify-content: space-between; gap: 24px; align-items: center; margin-bottom: 22px; flex-wrap: wrap; }
.subject-line { margin: 7px 0 0; font-size: 13px; color: var(--text-2); }
.consistency { display: flex; align-items: center; gap: 12px; padding: 11px 16px; border-radius: 12px; border: 1px solid var(--divider); background: var(--surface); font-size: 12.5px; }
.consistency .badge { padding: 3px 10px; border-radius: 999px; font-size: 11px; font-weight: 600; }
.consistency .ok { background: color-mix(in srgb, var(--pos) 16%, transparent); color: var(--pos); }
.consistency .bad { background: color-mix(in srgb, var(--ji) 16%, transparent); color: var(--ji); }
.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--divider); margin-bottom: 26px; overflow-x: auto; }
.tab { border: 0; background: transparent; padding: 12px 19px; font-size: 14px; color: var(--text-2); border-bottom: 2px solid transparent; white-space: nowrap; }
.tab:hover { color: var(--text); }
.tab.active { color: var(--text); border-bottom-color: var(--lead); font-weight: 600; }
.pane-title { font-size: 16px; font-weight: 600; margin: 0 0 18px; display: flex; gap: 12px; align-items: baseline; flex-wrap: wrap; }
.pane-title small { font-weight: 400; font-size: 12px; color: var(--text-2); }

/* ── 命盘 4×4 ── */
.chart-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); grid-template-rows: repeat(4, minmax(132px, auto));
  gap: 6px; background: var(--divider); border: 1px solid var(--divider); border-radius: 12px; overflow: hidden;
}
.palace { background: var(--surface-2); padding: 9px 10px; display: flex; flex-direction: column; min-width: 0; position: relative; }
.palace.is-ming { box-shadow: inset 0 0 0 2px var(--accent, var(--lead)); }
.palace.is-daxian { background: color-mix(in srgb, var(--mist) 14%, var(--surface-2)); }
.palace-top { display: flex; justify-content: space-between; align-items: center; gap: 4px; margin-bottom: 6px; }
.palace-name { font-size: 13px; font-weight: 700; letter-spacing: .04em; white-space: nowrap; }
.palace-branch { font-size: 11px; color: var(--text-2); white-space: nowrap; }
.palace-tags { display: flex; gap: 3px; }
.mini-tag { font-size: 9px; padding: 1px 5px; border-radius: 4px; background: var(--lead); color: #fff; line-height: 1.5; }
.mini-tag.dx { background: var(--mist); color: var(--ink); }
.stars-major { display: flex; flex-wrap: wrap; gap: 4px 7px; margin-bottom: 5px; }
.star-chip { font-size: 12.5px; font-weight: 600; white-space: nowrap; }
.star-chip .bright { font-size: 10px; font-weight: 400; margin-left: 1px; }
.sihua { font-size: 9px; border-radius: 3px; padding: 0 3px; margin-left: 2px; vertical-align: 1px; color: #fff; }
.stars-aux { font-size: 10.5px; color: var(--text-2); line-height: 1.55; word-break: break-all; }
.palace-foot { margin-top: auto; padding-top: 5px; font-size: 10px; color: var(--text-2); display: flex; justify-content: space-between; gap: 4px; }
.palace-empty { font-size: 11px; color: var(--text-2); font-style: italic; }
.center-palace {
  grid-row: 2 / span 2; grid-column: 2 / span 2;
  background: var(--linen-deep); padding: 18px clamp(14px, 2.2vw, 26px);
  display: flex; flex-direction: column; justify-content: center; gap: 9px;
}
.center-palace h4 { margin: 0; font-family: "Songti SC", "SimSun", serif; font-size: 22px; font-weight: 500; }
.center-meta { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 4px 14px; font-size: 11.5px; color: var(--text-2); }
.center-meta b { color: var(--text); font-weight: 600; }
.center-pillars { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 3px; }
.center-pillars span { border: 1px solid var(--divider); background: var(--surface-2); border-radius: 7px; padding: 4px 9px; font-size: 12px; letter-spacing: .05em; }
.center-sub { font-size: 11px; color: var(--text-2); border-top: 1px dashed var(--divider); padding-top: 8px; margin-top: 2px; }
.chart-legend { display: flex; flex-wrap: wrap; gap: 10px 20px; font-size: 11.5px; color: var(--text-2); margin-top: 14px; }
.chart-legend i { display: inline-block; width: 9px; height: 9px; border-radius: 2px; margin-right: 5px; vertical-align: -1px; }

/* ── 八字 ── */
.pillar-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.pillar-card { background: var(--surface); border: 1px solid var(--divider); border-radius: 12px; padding: 16px; text-align: center; }
.pillar-card .pos { font-size: 11px; color: var(--text-2); letter-spacing: .12em; }
.pillar-card .gz { font-family: "Songti SC", "SimSun", serif; font-size: 32px; line-height: 1.4; letter-spacing: .1em; }
.pillar-card .ss { font-size: 12px; color: var(--lead); }
.pillar-card .extra { font-size: 11px; color: var(--text-2); margin-top: 8px; line-height: 1.6; }
.bazi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin-top: 16px; }
.bazi-box { background: var(--surface); border: 1px solid var(--divider); border-radius: 12px; padding: 18px; }
.bazi-box h4 { margin: 0 0 12px; font-size: 14px; }
.wx-bar { display: flex; align-items: center; gap: 9px; margin: 7px 0; font-size: 12px; }
.wx-bar .name { width: 18px; }
.wx-bar .track { flex: 1; height: 7px; border-radius: 99px; background: var(--linen-deep); overflow: hidden; }
.wx-bar .fill { height: 100%; border-radius: 99px; }
.wx-bar .num { width: 16px; text-align: right; color: var(--text-2); font-variant-numeric: tabular-nums; }
.kv { display: flex; justify-content: space-between; gap: 12px; font-size: 12.5px; padding: 5px 0; border-bottom: 1px dashed var(--divider); }
.kv:last-child { border-bottom: 0; }
.kv span { color: var(--text-2); }
.kv b { font-weight: 600; text-align: right; }

/* ── 报告 ── */
.report-bar { display: flex; align-items: center; justify-content: space-between; gap: 14px; flex-wrap: wrap; margin-bottom: 20px; }
.kind-buttons { display: flex; gap: 9px; flex-wrap: wrap; }
.kind-btn { border: 1px solid var(--divider); background: var(--surface); border-radius: 10px; padding: 9px 15px; text-align: left; line-height: 1.35; }
.kind-btn:hover { border-color: var(--lead); }
.kind-btn.active { border-color: var(--ink); box-shadow: inset 0 0 0 1px var(--ink); }
.kind-btn b { display: block; font-size: 13.5px; font-weight: 600; }
.kind-btn small { font-size: 11px; color: var(--text-2); }
.kind-btn .cost { color: var(--ji); }
.kind-btn.unlocked .cost { color: var(--pos); }
.placeholder { text-align: center; padding: 60px 20px; border: 1px dashed var(--divider); border-radius: 14px; color: var(--text-2); }
.placeholder-mark { width: 54px; height: 54px; margin: 0 auto 16px; border-radius: 50%; display: grid; place-items: center; background: var(--linen-deep); font-family: "Songti SC", serif; font-size: 24px; color: var(--lead); }
.placeholder h3 { color: var(--text); font-family: "Songti SC", serif; font-weight: 500; }
.report-head { background: var(--surface); border: 1px solid var(--divider); border-radius: 14px; padding: 22px 24px; margin-bottom: 18px; }
.report-head h3 { font-family: "Songti SC", "SimSun", serif; font-size: 24px; font-weight: 500; margin: 0 0 6px; }
.report-head .sub { font-size: 12.5px; color: var(--text-2); }
.report-head .meta { display: flex; flex-wrap: wrap; gap: 8px 18px; margin-top: 14px; font-size: 12px; color: var(--text-2); }
.report-head .meta b { color: var(--text); }
.audit-strip { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px; }
.audit-strip span { font-size: 11px; padding: 3px 9px; border-radius: 99px; background: var(--linen-deep); color: var(--text-2); }
.section-card { background: var(--surface); border: 1px solid var(--divider); border-radius: 14px; padding: 20px 22px; margin-bottom: 14px; }
.section-head-row { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; flex-wrap: wrap; }
.section-glyph { width: 38px; height: 38px; border-radius: 10px; display: grid; place-items: center; background: var(--linen-deep); font-family: "Songti SC", serif; font-size: 21px; }
.section-card h4 { margin: 0; font-size: 16px; }
.section-card .sub { font-size: 11.5px; color: var(--text-2); }
.st-tag { font-size: 11px; padding: 3px 10px; border-radius: 99px; margin-left: auto; white-space: nowrap; }
.st-agreed { background: color-mix(in srgb, var(--pos) 16%, transparent); color: var(--pos); }
.st-divergent { background: color-mix(in srgb, var(--ji) 14%, transparent); color: var(--ji); }
.st-single { background: color-mix(in srgb, var(--jin) 18%, transparent); color: var(--ink); }
.st-empty { background: var(--linen-deep); color: var(--text-2); }
.reader-note { font-size: 11.5px; color: var(--text-2); margin: 6px 0 14px; }
.claim { border-left: 3px solid var(--divider); padding: 12px 0 12px 15px; margin: 10px 0; }
.claim.both { border-left-color: var(--pos); }
.claim.ziwei { border-left-color: var(--shui); }
.claim.bazi { border-left-color: var(--tu); }
.claim-title { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; margin-bottom: 6px; }
.src-tag { font-size: 10.5px; padding: 2px 8px; border-radius: 5px; color: #fff; }
.src-both { background: var(--pos); } .src-ziwei { background: var(--shui); } .src-bazi { background: var(--tu); }
.pol { font-size: 10.5px; padding: 2px 8px; border-radius: 5px; background: var(--linen-deep); color: var(--text-2); }
.claim-title b { font-size: 14px; }
.claim p { margin: 0 0 6px; font-size: 13.5px; line-height: 1.85; }
.claim .advice { color: var(--text-2); font-size: 12.5px; }
.claim details { margin-top: 7px; }
.claim summary { cursor: pointer; font-size: 11.5px; color: var(--text-2); }
.claim details ul { margin: 7px 0 0; padding-left: 18px; font-size: 11.5px; color: var(--text-2); }
.empty-text { font-size: 13px; color: var(--text-2); background: var(--surface-2); border-radius: 8px; padding: 12px 14px; }
.report-notes { background: var(--surface); border: 1px solid var(--divider); border-radius: 14px; padding: 18px 22px; margin-top: 18px; font-size: 12.5px; color: var(--text-2); }
.report-notes h4 { color: var(--text); font-size: 14px; margin: 0 0 10px; }
.report-notes p { margin: 0 0 8px; line-height: 1.8; }
.report-notes ul { margin: 0 0 10px; padding-left: 18px; }

/* ── 问答 ── */
.qa-box { background: var(--surface); border: 1px solid var(--divider); border-radius: 14px; padding: 22px; }
.qa-note { font-size: 12.5px; color: var(--text-2); line-height: 1.8; margin-bottom: 16px; }
.qa-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.qa-chips button { border: 1px solid var(--divider); background: var(--surface-2); border-radius: 99px; padding: 6px 14px; font-size: 12.5px; }
.qa-chips button:hover { border-color: var(--lead); }
.qa-input-row { display: flex; gap: 9px; }
.qa-input-row input { flex: 1; min-width: 0; height: 40px; padding: 0 13px; border: 1px solid var(--divider); border-radius: 9px; background: var(--surface-2); }
.qa-answer { margin-top: 18px; padding: 16px 18px; border-radius: 10px; background: var(--linen-deep); font-size: 13.5px; line-height: 1.85; }
.qa-answer .qa-q { font-size: 12px; color: var(--text-2); margin-bottom: 8px; }
.qa-answer .qa-src { font-size: 11px; color: var(--text-2); margin-top: 10px; }

/* ── AI 解读 ── */
.qa-sub { margin: 28px 0 12px; font-size: 15px; color: var(--text); display: flex; gap: 10px; align-items: baseline; }
.qa-sub small { font-size: 11.5px; font-weight: 400; color: var(--text-2); }
.ai-box { border-color: var(--lead); }
.ai-controls { display: flex; flex-wrap: wrap; gap: 12px; margin-bottom: 14px; }
.ai-controls label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; color: var(--text-2); }
.ai-controls [hidden] { display: none !important; }
.ai-controls select, .ai-settings input {
  height: 38px; padding: 0 11px; border: 1px solid var(--divider); border-radius: 9px;
  background: var(--surface-2); color: var(--text); font-size: 13px; min-width: 220px;
}
.ai-settings { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--divider); font-size: 12.5px; color: var(--text-2); }
.ai-settings summary { cursor: pointer; user-select: none; }
.ai-settings-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin: 12px 0 8px; }
.ai-settings-grid label { display: flex; flex-direction: column; gap: 6px; font-size: 12px; }
.ai-settings-grid input { min-width: 0; width: 100%; }
.ai-settings .hint { font-size: 11.5px; line-height: 1.8; margin: 4px 0 0; }
.ai-settings code { font-size: 11px; background: var(--surface-2); padding: 1px 5px; border-radius: 4px; }
.ai-answer { margin-top: 18px; padding: 18px 20px; border-radius: 12px; background: var(--linen-deep); border: 1px solid var(--divider); }
.ai-answer-head { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin-bottom: 14px; }
.ai-badge { font-size: 11px; padding: 3px 9px; border-radius: 99px; border: 1px solid var(--divider); color: var(--text-2); }
.ai-badge.live { border-color: var(--lead); color: var(--text); }
.ai-badge.fallback { border-color: #c47a58; color: #a4542f; }
.ai-para { padding: 12px 0; border-top: 1px dashed var(--divider); font-size: 13.5px; line-height: 1.9; }
.ai-para:first-of-type { border-top: 0; }
.ai-para-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; flex-wrap: wrap; }
.ai-dim-tag { font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 5px; background: var(--surface-2); border: 1px solid var(--divider); }
.ai-cites { display: flex; flex-wrap: wrap; gap: 5px; }
.ai-cite { font-size: 10.5px; color: var(--text-2); border: 1px solid var(--divider); border-radius: 4px; padding: 1px 6px; font-family: ui-monospace, Consolas, monospace; }
.ai-disclaimer { margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--divider); font-size: 11.5px; line-height: 1.8; color: var(--text-2); }
.ai-meta { margin-top: 8px; font-size: 11px; color: var(--text-2); }
.ai-reasons { margin-top: 8px; font-size: 11.5px; color: #a4542f; line-height: 1.7; }

/* ── 页脚 / toast ── */
.footer { margin-top: 64px; padding-top: 26px; border-top: 1px solid var(--divider); font-size: 12px; color: var(--text-2); }
.footer > div { display: flex; gap: 14px; align-items: baseline; margin-bottom: 10px; }
.footer strong { color: var(--text); font-size: 14px; }
.footer p { max-width: 820px; line-height: 1.8; }
.footer-small { opacity: .75; }
.toast {
  position: fixed; left: 50%; bottom: 30px; transform: translate(-50%, 16px);
  background: var(--ink); color: var(--linen); padding: 11px 20px; border-radius: 10px;
  font-size: 13px; box-shadow: 0 10px 30px rgba(0,0,0,.18); opacity: 0; pointer-events: none;
  transition: .25s ease; z-index: 80; max-width: 90vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ── 响应式 ── */
@media (max-width: 1020px) {
  .birth-form { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .birth-form .submit { grid-column: span 3; }
  .hero { gap: 24px; }
}
@media (max-width: 820px) {
  .hero { grid-template-columns: 1fr; padding-top: 42px; }
  .wuxing-stage { order: -1; }
  .wuxing-stage svg { width: min(78%, 320px); }
  .nav { display: none; }
  .section-head { flex-direction: column; align-items: start; }
  .chart-grid { grid-template-rows: repeat(4, minmax(112px, auto)); }
  .palace { padding: 7px; }
  .star-chip { font-size: 11.5px; }
  .bazi-grid { grid-template-columns: 1fr; }
}
@media (max-width: 600px) {
  .topbar { gap: 10px; padding: 10px 16px; }
  .brand-text small, .wallet span { display: none; }
  .birth-form { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .birth-form .submit { grid-column: span 2; }
  .chart-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 3px; }
  .palace-name { font-size: 11px; }
  .palace-branch { font-size: 9.5px; }
  .stars-aux { font-size: 9px; }
  .center-palace { padding: 10px; }
  .center-palace h4 { font-size: 16px; }
  .center-meta { font-size: 10px; grid-template-columns: 1fr; gap: 1px; }
  .center-pillars span { font-size: 10px; padding: 3px 5px; }
  .pillar-row { grid-template-columns: repeat(2, 1fr); }
  .section-card { padding: 16px; }
  .ai-settings-grid { grid-template-columns: 1fr; }
  .ai-controls label { width: 100%; }
  .ai-controls select { min-width: 0; width: 100%; }
  .ai-answer { padding: 14px; }
}

@media print {
  .topbar, .demo-banner, .tabs, .report-bar, .qa-box, .footer, .chart-legend, #toast { display: none !important; }
  main { max-width: none; padding: 0; }
  .tabpane, #result { display: block !important; }
  #pane-chart, #pane-bazi, #pane-qa { display: none !important; }
  .section-card, .report-head { break-inside: avoid; box-shadow: none; }
  body { background: #fff; }
}
