/* 安心命理 · 全新前端样式(桌面优先,平板/手机自适应) */
:root {
  --bg: #f6f4ee;
  --panel: #fffdf9;
  --line: #e4dbcd;
  --ink: #26231e;
  --muted: #8a8175;
  --brand: #2f716d;
  --brand-ink: #1f4e4a;
  --accent: #d99a3f;
  --danger: #b13a31;
  --good: #247a4b;
  --wood: #238d3c;
  --fire: #c52e2b;
  --earth: #9a763a;
  --metal: #d99632;
  --water: #2379ba;
  --radius: 10px;
  --shadow: 0 10px 32px rgba(30, 26, 18, .08);
}
* { box-sizing: border-box; }
/* 关键规则:hidden 属性必须压过任何 display 声明(否则 .modal 等的 display:grid 会让 hidden 失效) */
[hidden] { display: none !important; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font: 15px/1.6 "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  background: var(--bg);
  color: var(--ink);
}
.sr-only {
  position: absolute; width: 1px; height: 1px; overflow: hidden;
  clip: rect(0 0 0 0); white-space: nowrap;
}
.muted { color: var(--muted); font-size: 13px; }

/* 顶栏 */
.topbar {
  position: sticky; top: 0; z-index: 30;
  background: rgba(255, 253, 249, .95);
  backdrop-filter: blur(6px);
  border-bottom: 1px solid var(--line);
}
.topbar-inner {
  max-width: 1280px; margin: 0 auto; padding: 0 20px;
  height: 60px; display: flex; align-items: center; gap: 22px;
}
.brand { display: flex; align-items: center; gap: 9px; font-weight: 800; font-size: 18px; }
.brand-mark {
  width: 30px; height: 30px; border-radius: 50%;
  background: var(--brand); color: #fff;
  display: grid; place-items: center; font-size: 15px;
}
.topnav { display: flex; gap: 18px; flex: 1; flex-wrap: wrap; }
.topnav a { color: var(--muted); text-decoration: none; font-size: 14px; }
.topnav a:hover { color: var(--brand); }
.user-actions { display: flex; gap: 10px; align-items: center; }
.tier-badge {
  border-radius: 999px; padding: 4px 12px; font-size: 12px; font-weight: 800;
  background: #f1eadf; color: #806b4f; white-space: nowrap;
}
.tier-badge.vip { background: #2f716d; color: #fff; }
.tier-badge.free { background: #e7f2ed; color: var(--brand); }

/* 按钮 */
.btn {
  border: 0; border-radius: 8px; padding: 8px 14px; font: inherit; font-size: 14px;
  font-weight: 700; cursor: pointer; transition: transform .15s, box-shadow .15s;
}
.btn:hover { transform: translateY(-1px); }
.btn:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.btn.primary { background: var(--brand); color: #fff; }
.btn.ghost { background: #fff; border: 1px solid #d8cebf; color: #6c6257; }
.btn.big { padding: 11px 22px; font-size: 15px; }
.btn.wide { width: 100%; }
.btn[disabled] { opacity: .55; cursor: wait; transform: none; }

/* 布局 */
.page { max-width: 1280px; margin: 22px auto 60px; padding: 0 20px; display: grid; gap: 18px; }
.layout { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 18px; align-items: start; }
.main-col { display: grid; gap: 18px; min-width: 0; }
.side-col {
  display: grid; gap: 18px; position: sticky; top: 76px;
  align-content: start;
  max-height: calc(100vh - 92px); overflow-y: auto; /* 侧栏高于视口时内部滚动,避免底部够不到 */
}
.card {
  background: var(--panel); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow);
  min-width: 0; /* 关键:grid 子项默认 min-width:auto,会被宽表格撑破并盖住侧栏 */
  overflow: hidden;
}
.card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.card-head h2 { margin: 0; font-size: 19px; }

/* 输入区 */
.birth-form { display: flex; flex-wrap: wrap; gap: 10px; align-items: end; }
.field { display: grid; gap: 3px; }
.field > span { color: var(--muted); font-size: 12px; }
.field input, .field select {
  height: 40px; border: 1px solid #ded4c5; border-radius: 8px; background: #fff;
  padding: 0 10px; font: inherit; font-weight: 700; color: var(--ink); min-width: 74px;
}
.field.inline { grid-auto-flow: column; align-items: center; gap: 7px; }
.field.inline input, .field.inline select { height: 34px; min-width: 86px; }
.chips { display: flex; gap: 7px; border: 0; padding: 0; margin: 0; }
.chip {
  border-radius: 999px; padding: 9px 13px; border: 1px solid #ded4c5; background: #fff;
  color: #6b6257; font-size: 13px; cursor: pointer; font: inherit;
}
.chip.active { background: rgba(47,113,109,.12); color: var(--brand); border-color: rgba(47,113,109,.4); font-weight: 700; }
.form-actions { display: flex; gap: 10px; margin-left: auto; }
.place-field select { min-width: 132px; }
.place-picker-trigger {
  height: 40px; min-width: 156px; max-width: 260px; border: 1px solid #ded4c5; border-radius: 8px;
  background: #fff; padding: 0 10px; color: var(--ink); font: inherit; font-weight: 700;
  cursor: pointer; text-align: left; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.place-picker-trigger:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }
.tz-echo {
  margin: 10px 0 0; border-radius: 8px; background: #f2f7f3;
  border: 1px solid rgba(47,113,109,.2); color: #33483d;
  padding: 8px 12px; font-size: 12.5px; line-height: 1.55;
}

/* 出生地弹窗 */
.place-dialog { width: min(92vw, 430px); padding: 24px; border-radius: 18px; }
.place-modal-head { display: grid; grid-template-columns: 1fr auto; align-items: center; gap: 12px; }
.place-tabs {
  justify-self: center; display: inline-flex; gap: 0; padding: 2px; border: 1px solid #ded4c5;
  border-radius: 999px; background: #fff;
}
.place-tabs .tab {
  margin: 0; min-width: 86px; padding: 7px 18px; background: transparent; border-radius: 999px;
}
.place-tabs .tab.active { background: #b99a5a; color: #fff; }
.modal-x {
  width: 34px; height: 34px; border: 0; background: transparent; color: #8d857a;
  font-size: 30px; line-height: 1; cursor: pointer;
}
.place-search { display: block; margin-top: 14px; }
.place-search input {
  width: 100%; height: 38px; border: 1px solid #ded4c5; border-radius: 999px;
  padding: 0 14px; font: inherit; background: #fff;
}
.place-columns {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px;
  margin-top: 12px; border-top: 1px solid #eee8df; padding-top: 10px;
}
.place-columns.two { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.place-columns.searching { grid-template-columns: 1fr; }
.place-columns h4 {
  margin: 0 0 7px; text-align: center; font-size: 13px; color: #4c463f;
}
.place-list {
  height: 206px; overflow-y: auto; display: grid; align-content: start; gap: 4px;
  scrollbar-width: thin; scrollbar-color: #d7cdbf transparent;
}
.place-list button {
  min-height: 34px; border: 0; border-radius: 6px; background: transparent; color: #8d857a;
  padding: 6px 8px; font: inherit; font-weight: 650; cursor: pointer;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.place-list button:hover { background: #f5f0e8; color: var(--ink); }
.place-list button.active {
  background: #f0f0f0; color: var(--ink); font-size: 18px; font-weight: 800;
}
.place-list .subtle { color: #aaa39a; font-size: 12px; font-weight: 600; }
.place-footnote { text-align: center; margin: 8px 0 12px; }

/* 排盘表 */
.pan-scroll { overflow-x: auto; max-width: 100%; }
.pan-table {
  border-collapse: collapse; min-width: 860px; width: 100%;
  table-layout: fixed; /* 关键:固定布局,四柱与流转列等宽,神煞多的列不再吃掉全部宽度 */
}
.pan-table col.c-label { width: 56px; }
.pan-table th, .pan-table td {
  border: 1px solid #eee5d8; text-align: center; padding: 9px 5px; background: #fff;
  vertical-align: middle; line-height: 1.4; overflow-wrap: break-word;
}
.pan-table th { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.shensha-cell { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.pan-table th { background: #faf7f0; color: #80766a; font-size: 13px; }
.pan-table td.row-label { background: #faf7f0; color: #a57c45; font-size: 13px; font-weight: 700; white-space: nowrap; }
.pan-table .flow-col { background: #fbfbf7; }
.gan-char, .zhi-char { font-size: 26px; font-weight: 800; }
.ten-label { font-size: 13px; font-weight: 700; }
.wood { color: var(--wood); } .fire { color: var(--fire); } .earth { color: var(--earth); }
.metal { color: var(--metal); } .water { color: var(--water); }
.hidden-stems { display: grid; gap: 2px; font-size: 12px; }
.hidden-stems em { font-style: normal; color: #6f665c; margin-left: 3px; }
.tag {
  display: inline-block; border-radius: 999px; padding: 1px 8px; margin: 1px;
  font-size: 12px; font-weight: 700;
}
.tag.pos { background: #e8f4ed; color: var(--good); }
.tag.neg { background: #f9e8e5; color: var(--danger); }
.tag.mid { background: #f6eddf; color: #9a7136; }
.tag.empty { background: #f3eee7; color: #b3aaa0; font-weight: 600; }
.flow-note { margin-top: 10px; color: var(--muted); font-size: 12px; }

/* 合婚 */
.pair-form { margin-bottom: 10px; }
#pairResult { display: grid; gap: 10px; margin-top: 12px; }
.pair-result-card {
  display: grid; grid-template-columns: 150px minmax(0, 1fr); gap: 12px;
  border: 1px solid rgba(47,113,109,.22); border-radius: 8px; background: #f2f7f3;
  padding: 12px;
}
.pair-score {
  display: grid; gap: 2px; align-content: center; border-right: 1px solid rgba(47,113,109,.18);
  padding-right: 10px;
}
.pair-score span { color: var(--muted); font-size: 12px; }
.pair-score strong { color: var(--brand); font-size: 22px; line-height: 1.25; }
.pair-score b { color: #8f713d; font-size: 14px; }
.pair-summary p { margin: 0 0 6px; }
.pair-grid ul { margin: 6px 0 0; padding-left: 18px; }

/* 大运流年流月 */
.tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 12px; }
.tab {
  border: 0; border-radius: 999px; padding: 7px 14px; background: #f0eadf; color: #766d62;
  font: inherit; font-size: 13px; cursor: pointer;
}
.tab.active { background: var(--brand); color: #fff; font-weight: 700; }
.cycle-shell { position: relative; padding: 0 26px; }
.cycle-row {
  display: flex; gap: 8px; overflow-x: auto; padding-bottom: 10px;
  scroll-snap-type: x proximity; scroll-behavior: smooth;
  scrollbar-width: thin; scrollbar-color: #c9bda9 #f1ebe0; /* Firefox 常显细滚动条 */
}
/* WebKit 常显细滚动条(macOS 默认隐藏,内容被截断时用户无感知) */
.cycle-row::-webkit-scrollbar { height: 8px; }
.cycle-row::-webkit-scrollbar-track { background: #f1ebe0; border-radius: 999px; }
.cycle-row::-webkit-scrollbar-thumb { background: #c9bda9; border-radius: 999px; }
.cycle-row::-webkit-scrollbar-thumb:hover { background: #a99878; }
.cycle-arrow {
  position: absolute; top: 50%; transform: translateY(-60%);
  width: 26px; height: 44px; border: 1px solid var(--line); border-radius: 8px;
  background: #fffdf9; color: #6c6257; font-size: 18px; font-weight: 700;
  cursor: pointer; z-index: 2; display: grid; place-items: center; padding: 0;
}
.cycle-arrow:hover { color: var(--brand); border-color: rgba(47,113,109,.45); }
.cycle-arrow.prev { left: -4px; }
.cycle-arrow.next { right: -4px; }
.cycle-card {
  min-width: 96px; border: 1px solid #eee5d8; border-radius: 9px; background: #fff;
  padding: 10px 8px; text-align: center; cursor: pointer; font: inherit;
  display: grid; gap: 3px; transition: transform .15s, border-color .15s;
  scroll-snap-align: start;
}
.cycle-card:hover { transform: translateY(-2px); border-color: rgba(47,113,109,.4); }
.cycle-card.active { background: var(--brand); border-color: var(--brand); }
.cycle-card.active * { color: #fff !important; }
/* 选中态徽章:浅色底会让白字看不清,改半透明白底保证对比度 */
.cycle-card.active .level-pill,
.cycle-card.active .level-pill.good,
.cycle-card.active .level-pill.bad {
  background: rgba(255, 255, 255, .24);
  color: #fff !important;
}
.cycle-card .gz { font-size: 19px; font-weight: 800; }
.cycle-card .meta { color: var(--muted); font-size: 12px; }
.cycle-card .ten { color: #c1842d; font-size: 12px; font-weight: 700; }
.level-pill {
  display: inline-block; border-radius: 999px; padding: 1px 8px; font-size: 11px; font-weight: 800;
  background: #f5eddf; color: #8f713d;
}
.level-pill.good { background: #e8f4ed; color: var(--good); }
.level-pill.bad { background: #f8e6e2; color: var(--danger); }

/* 趋势 */
.trend-tools { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; margin-bottom: 10px; }
.trend-shell { position: relative; }
#trendSvg { width: 100%; height: auto; display: block; background: #20251f; border-radius: 10px; }
.trend-tooltip {
  position: absolute; z-index: 5; pointer-events: none; max-width: 240px;
  background: rgba(24,26,20,.95); color: #fff8ec; border-radius: 8px;
  padding: 9px 11px; font-size: 12px; line-height: 1.5; box-shadow: 0 14px 36px rgba(0,0,0,.3);
}
.trend-tooltip b { color: #f6c66d; display: block; margin-bottom: 3px; }
.insight-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 8px; margin-top: 12px; }
.insight-card {
  border: 1px solid #e7dece; border-radius: 8px; background: #fffdf8; padding: 10px;
  display: grid; gap: 3px;
}
.insight-card b { color: #85672d; font-size: 12px; }
.insight-card strong { font-size: 16px; }
.insight-card span { color: var(--muted); font-size: 12px; }
.insight-summary {
  grid-column: 1 / -1; border: 1px solid rgba(47,113,109,.22); border-radius: 8px;
  background: #f2f7f3; color: #33483d; padding: 10px 12px; font-size: 13px;
}

/* 日历 */
.cal-tools { display: flex; gap: 12px; align-items: center; justify-content: space-between; flex-wrap: wrap; margin-bottom: 12px; }
.calendar-period-echo {
  min-height: 22px;
  margin: -2px 0 10px;
  color: #52635d;
  font-size: 13px;
  line-height: 1.55;
}
.calendar-period-echo .boundary-note { color: #9a6428; font-weight: 650; }
.cal-nav { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.btn.small { padding: 6px 11px; font-size: 13px; }
.cal-legend { display: flex; gap: 12px; color: var(--muted); font-size: 12px; }
.cal-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cal-legend .dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
/* 单列布局:日历格全宽在上,当日详情全宽在下 */
.cal-layout { display: grid; grid-template-columns: 1fr; gap: 16px; align-items: start; }
/* 详情面板内部自适应多列,避免单列过长 */
.flow-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); gap: 8px; }
.cal-weekdays { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; text-align: center; color: var(--muted); font-size: 12px; font-weight: 700; margin-bottom: 6px; }
.cal-weekdays span:first-child, .cal-weekdays span:last-child { color: #b08b62; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 6px; }
/* 等级配色(与图例一致) */
.lv-great { background: #1e7a4a; }
.lv-good { background: #57a374; }
.lv-neutral { background: #d9b96a; }
.lv-bad { background: #d98a63; }
.lv-worse { background: #bf4a3e; }
.cal-day {
  position: relative; min-height: 76px; border: 1px solid #eadfce; border-radius: 8px;
  background: #fff; padding: 6px 9px 11px; text-align: left; cursor: pointer; font: inherit;
  display: grid; gap: 2px; align-content: start; overflow: hidden;
  transition: transform .15s, border-color .15s, box-shadow .15s;
}
.cal-day:hover { transform: translateY(-1px); border-color: rgba(47,113,109,.4); box-shadow: 0 4px 12px rgba(30,26,18,.08); }
.cal-day .cal-top { display: flex; justify-content: space-between; align-items: baseline; gap: 4px; }
.cal-day .cal-top b { font-size: 15px; font-weight: 800; }
.cal-score { font-size: 12px; font-weight: 800; }
.cal-lv { font-size: 11px; font-weight: 700; }
.cal-score.lv-great, .cal-score.lv-good, .cal-lv.lv-great, .cal-lv.lv-good { background: none; color: #1e7a4a; }
.cal-score.lv-neutral, .cal-lv.lv-neutral { background: none; color: #a5822f; }
.cal-score.lv-bad, .cal-score.lv-worse, .cal-lv.lv-bad, .cal-lv.lv-worse { background: none; color: #bf4a3e; }
.cal-gz { font-size: 11px; color: #8a8175; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cal-bar { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; }
.cal-day.today { border-color: var(--brand); border-style: dashed; }
.cal-day.active { background: var(--brand); border-color: var(--brand); }
.cal-day.active .cal-top b, .cal-day.active .cal-score, .cal-day.active .cal-gz, .cal-day.active .cal-lv { color: #fff; }
.cal-empty { min-height: 76px; }
.cal-detail { border: 1px solid #eadfce; border-radius: 9px; background: #fff; padding: 14px; display: grid; gap: 11px; }
.cal-detail h3 { margin: 0; font-size: 17px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.cal-detail .flow-line { border-radius: 8px; background: #fbf7ef; padding: 8px 10px; font-size: 13px; }
.cal-detail .flow-line b { color: var(--brand); margin-right: 6px; }
.yi-ji { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.yi-ji p { margin: 0; border-radius: 8px; padding: 8px 10px; font-size: 12px; }
.yi-ji .yi { background: #edf6f0; color: #276c47; }
.yi-ji .ji { background: #faeae5; color: #a94136; }
.shichen-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(250px, 1fr)); gap: 8px; align-items: start; }
.shichen-item { border: 1px solid #eadfce; border-radius: 8px; padding: 8px 10px; background: #fffdf9; font-size: 12px; display: grid; gap: 4px; }
.shichen-item .head { display: flex; justify-content: space-between; gap: 8px; font-weight: 700; font-size: 13px; }
.shichen-item .head em { font-style: normal; color: var(--muted); font-weight: 600; font-size: 11px; }
.topic-chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.topic-chip {
  border: 1px solid #eadfce; border-radius: 999px; background: #fffdf9; font: inherit;
  font-size: 12px; padding: 4px 10px; cursor: pointer;
}
.topic-chip.active { background: rgba(47,113,109,.12); border-color: rgba(47,113,109,.45); color: var(--brand); font-weight: 700; }

/* 综合解析 */
.core-line { display: grid; grid-template-columns: 72px 1fr; gap: 8px; padding: 7px 0; border-bottom: 1px dashed #ece2d2; font-size: 13px; }
.core-line:last-child { border-bottom: 0; }
.core-line > span { color: #9b7a4d; font-weight: 700; }
.core-line b { font-size: 14px; }
.core-line em { display: block; font-style: normal; color: #5f766e; font-size: 12px; }
.zonglun { margin-top: 10px; border-top: 1px solid #eee3d4; padding-top: 9px; font-size: 13px; color: #4f4840; }
.zonglun b { color: var(--brand); display: block; margin-bottom: 4px; }
.history-item { border-bottom: 1px dashed #ece2d2; padding: 8px 0 10px; font-size: 13px; }
.history-item:last-child { border-bottom: 0; }
.history-item b { color: var(--brand-ink); }
/* 回验标注 */
.fb-row { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: 7px; }
.fb-chip, .fb-note-toggle {
  border: 1px solid #ded4c5; border-radius: 999px; background: #fff; font: inherit;
  font-size: 12px; padding: 3px 10px; cursor: pointer; color: #6b6257;
}
.fb-chip:hover, .fb-note-toggle:hover { border-color: rgba(47,113,109,.45); color: var(--brand); }
.fb-chip.active.v-hit { background: #e6f3ec; border-color: #247a4b; color: #1e7a4a; font-weight: 700; }
.fb-chip.active.v-partial { background: #f6eddf; border-color: #b08b3a; color: #8e713e; font-weight: 700; }
.fb-chip.active.v-miss { background: #f9e6e1; border-color: #b13a31; color: #b13a31; font-weight: 700; }
.fb-note-toggle { border-style: dashed; }
.fb-saved { color: var(--brand); font-size: 11px; font-weight: 700; }
.fb-note { margin-top: 7px; display: grid; gap: 6px; }
.fb-note textarea {
  width: 100%; min-height: 56px; border: 1px solid #ded4c5; border-radius: 8px;
  padding: 8px 10px; font: inherit; font-size: 12px; resize: vertical; background: #fffdf9;
}
.fb-footnote { margin: 10px 0 0; font-size: 11px; }
.vip-benefits { margin: 0 0 12px; padding-left: 20px; color: #5f574e; font-size: 13px; display: grid; gap: 5px; }

/* VIP 专业报告 */
.pro-locked { text-align: center; padding: 28px 16px; display: grid; gap: 14px; justify-items: center; color: #5f574e; }
.pro-summary-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 10px; margin-bottom: 14px; }
.pro-summary-card { border: 1px solid #e6ddcf; border-radius: 8px; background: #fff; padding: 12px; font-size: 13px; }
.pro-summary-card h4 { margin: 0 0 6px; font-size: 14px; color: var(--brand); }
.topic-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(320px, 1fr)); gap: 12px; }
.topic-card { border: 1px solid #e6ddcf; border-radius: 9px; background: #fff; padding: 14px; display: grid; gap: 9px; }
.topic-card h4 { margin: 0; font-size: 16px; display: flex; justify-content: space-between; align-items: center; gap: 8px; }
.topic-score { border-radius: 999px; padding: 3px 9px; background: #edf5f1; color: var(--brand); font-size: 12px; font-weight: 800; white-space: nowrap; }
.topic-section { border-top: 1px solid #efe6d8; padding-top: 8px; font-size: 13px; }
.topic-section.natal-basis { border-top: 0; background: #fbf8f1; border-radius: 8px; padding: 9px 11px; }
.topic-section.natal-basis > b { color: #8a6d37; }
.topic-section.natal-basis .natal-line { margin: 4px 0 6px; color: #4f4840; }
.topic-section.natal-basis ul { list-style: none; padding: 0; }
.topic-section.natal-basis li b { color: var(--brand); margin-right: 6px; font-weight: 700; }
.topic-section b { color: var(--brand); display: block; margin-bottom: 4px; font-size: 13px; }
.topic-section ul { margin: 0; padding-left: 18px; color: #60574e; font-size: 12px; display: grid; gap: 3px; }
.timing-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.timing-row span { border-radius: 7px; background: #faf6ee; padding: 7px; font-size: 12px; color: #655c52; }
.timing-row b { display: block; color: #8e6d37; margin-bottom: 2px; }
.window-list { display: flex; flex-wrap: wrap; gap: 6px; }
.window-list button {
  border: 1px solid #eadfce; border-radius: 7px; background: #f9f5ec; font: inherit;
  font-size: 12px; padding: 6px 8px; text-align: left; cursor: pointer; color: #645b50;
}
.window-list button:hover { border-color: rgba(47,113,109,.45); color: var(--brand); }

/* 骨架屏 */
.skeleton-wrap { display: grid; gap: 14px; }
.skeleton-text { margin: 0; text-align: center; color: var(--brand); font-weight: 700; font-size: 15px; }
.skeleton-grid { display: grid; grid-template-columns: 2fr 1fr; gap: 14px; }
.skeleton-card { border-radius: var(--radius); min-height: 130px; }
.skeleton-card.tall { grid-column: 1 / -1; min-height: 220px; }
.shimmer {
  background: linear-gradient(100deg, #efe9dd 40%, #faf6ec 50%, #efe9dd 60%);
  background-size: 200% 100%;
  animation: shimmer 1.3s infinite linear;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* 画像与本年指引 */
.portrait-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(260px, 1fr)); gap: 12px; }
.portrait-card { border: 1px solid #e6ddcf; border-radius: 9px; background: #fff; padding: 13px; font-size: 13px; display: grid; gap: 7px; align-content: start; }
.portrait-card h4 { margin: 0; font-size: 15px; color: var(--brand); display: flex; align-items: center; gap: 8px; }
.portrait-card h4 .badge { border-radius: 999px; background: #f1eadf; color: #8a6d37; font-size: 11px; padding: 2px 8px; font-weight: 800; }
.portrait-card p { margin: 0; color: #5f574e; line-height: 1.6; }
.portrait-card ul { margin: 0; padding-left: 18px; color: #60574e; display: grid; gap: 4px; font-size: 12.5px; }
.lucky-row { display: flex; flex-wrap: wrap; gap: 6px; }
.lucky-row .tag { font-weight: 600; }

/* 综合解析:五行能量 + 十神统计 + 三宫 + 合冲 */
.wx-bars { display: grid; gap: 5px; margin-top: 10px; }
.wx-bar-row { display: grid; grid-template-columns: 16px 1fr 68px; gap: 8px; align-items: center; font-size: 12px; }
.wx-track { height: 10px; border-radius: 999px; background: #f1ebe0; overflow: hidden; }
.wx-fill { display: block; height: 100%; border-radius: 999px; }
.wx-fill.wood { background: var(--wood); } .wx-fill.fire { background: var(--fire); }
.wx-fill.earth { background: var(--earth); } .wx-fill.metal { background: var(--metal); }
.wx-fill.water { background: var(--water); }
.wx-flag { font-size: 11px; font-weight: 800; }
.wx-flag.yong { color: var(--good); } .wx-flag.ji { color: var(--danger); }
.shishen-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 8px; }
.interaction-tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 4px; }

/* 择日:本月吉日条 */
.cal-best-days {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  border: 1px solid rgba(47,113,109,.22); border-radius: 9px;
  background: #f2f7f3; padding: 9px 12px; margin-bottom: 12px; font-size: 13px; color: #33483d;
}
.cal-best-days button {
  border: 1px solid rgba(47,113,109,.35); border-radius: 999px; background: #fff;
  font: inherit; font-size: 12px; font-weight: 700; padding: 4px 11px; cursor: pointer; color: var(--brand);
}
.cal-best-days button:hover { background: var(--brand); color: #fff; }
.cal-day.best { box-shadow: inset 0 0 0 2px rgba(47,113,109,.55); }

/* 空态/模态/Toast */
.empty-state { text-align: center; padding: 60px 20px; color: #5f574e; }
.empty-state h2 { font-size: 24px; margin-bottom: 8px; }
.modal {
  position: fixed; inset: 0; z-index: 50; background: rgba(20,22,17,.38);
  display: grid; place-items: center; padding: 20px;
}
.dialog {
  width: min(430px, 100%); background: var(--panel); border: 1px solid #dfd4c4;
  border-radius: 12px; box-shadow: 0 26px 80px rgba(0,0,0,.3); padding: 20px;
  display: grid; gap: 12px;
}
.dialog h3 { margin: 0; font-size: 19px; }
.dialog .field input { width: 100%; }
.dialog-actions { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.dialog-actions .spacer { flex: 1; }
.form-error { margin: 0; color: var(--danger); font-size: 13px; }
.plan-grid { display: grid; gap: 10px; }
.plan-card {
  border: 1px solid #e4dacb; border-radius: 10px; padding: 14px; background: #fff;
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
}
.plan-card b { font-size: 16px; }
.plan-card .price { color: var(--danger); font-weight: 800; font-size: 18px; }
.plan-card .price small { color: var(--muted); font-weight: 600; }
.toast {
  position: fixed; right: 24px; bottom: 24px; z-index: 60; max-width: 320px;
  background: #181a16; color: #fff8ec; border-radius: 9px; padding: 12px 14px;
  font-size: 13px; box-shadow: 0 18px 42px rgba(0,0,0,.28);
  opacity: 0; transform: translateY(8px); pointer-events: none;
  transition: opacity .2s, transform .2s;
}
.toast.show { opacity: 1; transform: translateY(0); }
.footer { text-align: center; color: var(--muted); font-size: 12px; padding: 24px 16px 40px; }

/* 响应式 */
@media (max-width: 1080px) {
  .layout { grid-template-columns: 1fr; }
  .side-col { position: static; max-height: none; overflow: visible; }
}
@media (max-width: 640px) {
  .topbar-inner { flex-wrap: wrap; height: auto; padding: 10px 14px; }
  .topnav { order: 3; width: 100%; }
  .form-actions { margin-left: 0; width: 100%; }
  .btn.big { flex: 1; }
}
