/* ─── 紫微命盘 · 暖纸白主题 ─── */
:root {
  --bg: #f7f4ee;
  --card: #ffffff;
  --ink: #26211a;
  --tx-2: #6e6659;
  --tx-3: #a39a8a;
  --line: #e7e1d4;
  --line-soft: #efe9dd;
  --accent: #9a7b3f;
  --accent-deep: #6f5628;
  --accent-bg: #f5eddc;
  --btn-dark: #29241c;
  --serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 14px;
  line-height: 1.6;
}

/* ─── 顶栏 ─── */
.topbar {
  display: flex;
  align-items: center;
  gap: 28px;
  padding: 18px 32px;
}
.topbar nav { margin-right: 0; }

/* 顶栏右侧登录态 */
.auth-box { margin-left: auto; display: flex; align-items: center; gap: 10px; }
.auth-box .auth-name { font-size: 14px; color: var(--ink); font-weight: 600; max-width: 120px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.vip-badge {
  display: inline-block;
  background: linear-gradient(135deg, #b98a2e, #d8b46a);
  color: #fff;
  font-size: 11px;
  border-radius: 999px;
  padding: 2px 9px;
  letter-spacing: 1px;
}
.auth-btn {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 13px;
  color: var(--tx-2);
  cursor: pointer;
  font-family: inherit;
}
.auth-btn:hover { border-color: var(--accent); color: var(--accent-deep); }
.auth-btn.primary { background: var(--btn-dark); border-color: var(--btn-dark); color: #f5f1e8; }

/* 首页登录 / 注册卡 */
#auth-card .auth-tabs {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  margin-bottom: 20px;
}
#auth-card .auth-tabs button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 10px;
  padding: 9px 0;
  font-size: 14px;
  letter-spacing: 4px;
  cursor: pointer;
  font-family: inherit;
  color: var(--tx-2);
}
#auth-card .auth-tabs button.on { background: var(--btn-dark); border-color: var(--btn-dark); color: #fff; }
.auth-field { margin-bottom: 12px; }
#auth-go { width: 100%; margin-top: 4px; }
.auth-note { margin-top: 14px; line-height: 1.7; }

/* 命盘 / 合盘页的 AI 会员门禁 */
.gate-box {
  text-align: center;
  padding: 34px 20px;
  border: 1px dashed var(--line);
  border-radius: 14px;
  background: #fcfbf8;
}
.gate-box b { font-family: var(--serif); font-size: 16px; letter-spacing: 2px; color: var(--ink); }
.gate-box p { color: var(--tx-2); font-size: 13.5px; margin: 8px 0 16px; }

/* 十三维锁标 chip */
.topic-chips button.locked { color: var(--tx-3); border-style: dashed; }
.topic-chips .lock-tag {
  font-style: normal;
  font-size: 10px;
  background: #f1e8d4;
  color: #8a6d2f;
  border-radius: 4px;
  padding: 1px 5px;
  margin-left: 5px;
  vertical-align: 1px;
}

/* 会员权益页 */
.member-wrap { max-width: 860px; margin: 40px auto; display: flex; flex-direction: column; gap: 20px; }
/* 会员页 hero：深色渐变 + 金色点缀，制造「想点」的冲动感 */
.member-hero-new {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  padding: 44px 48px 38px;
  color: #f3ecdd;
  background: radial-gradient(120% 140% at 85% -10%, rgba(176, 141, 87, 0.35), transparent 55%),
              linear-gradient(150deg, #241d12 0%, #33291a 55%, #1d1710 100%);
  border: 1px solid #4a3c24;
  box-shadow: 0 18px 50px rgba(35, 26, 10, 0.28);
}
.member-hero-new::after {
  content: '';
  position: absolute;
  inset: 0;
  background: repeating-linear-gradient(115deg, transparent 0 26px, rgba(255, 255, 255, 0.025) 26px 27px);
  pointer-events: none;
}
.member-hero-new .eyebrow { color: #c9a86a; letter-spacing: 4px; font-size: 12px; }
.mh-crown { color: #e3b877; margin-bottom: 10px; }
.mh-title {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 700;
  letter-spacing: 3px;
  margin: 6px 0 10px;
  background: linear-gradient(120deg, #f5e7c8, #d9b877 60%, #b98f4e);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}
.mh-sub { color: #c9bfa8; font-size: 15px; margin: 0 0 20px; }
.mh-status { font-size: 14.5px; color: #d8cdb4; margin-bottom: 22px; }
.mh-status .mh-ok { color: #8fce9f; font-weight: 600; margin-right: 10px; }
.mh-status .mh-need { display: block; margin-top: 6px; color: #e8c98a; font-size: 15px; }
.mh-cta { display: flex; gap: 14px; flex-wrap: wrap; }
.mh-btn {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 14px 28px;
  border-radius: 12px;
  font-size: 15.5px;
  font-weight: 600;
  letter-spacing: 1px;
  text-decoration: none;
  cursor: pointer;
  font-family: inherit;
  border: 1px solid #e3b877;
  color: #241d12;
  background: linear-gradient(160deg, #f2d9a4, #d9b877 70%, #c8a05e);
  box-shadow: 0 8px 22px rgba(217, 184, 119, 0.32);
  transition: transform 0.15s, box-shadow 0.15s;
}
.mh-btn:hover { transform: translateY(-2px); box-shadow: 0 12px 30px rgba(217, 184, 119, 0.45); }
.mh-btn.ghost {
  background: transparent;
  color: #e3c98f;
  border-color: #5a4a2c;
  box-shadow: none;
}
.mh-btn.ghost:hover { border-color: #c9a86a; transform: none; }
.mh-btn.ghost.done { color: #8fce9f; border-color: #4a6a50; }
/* 权益清单 */
.benefit-list { display: flex; flex-direction: column; gap: 14px; margin-top: 6px; }
.benefit { display: flex; gap: 12px; align-items: flex-start; }
.benefit .bi-check {
  flex: none;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-top: 1px;
  color: #8fce9f;
  background: rgba(63, 122, 85, 0.14);
  border: 1px solid rgba(63, 122, 85, 0.35);
}
.benefit b { display: block; font-size: 14.5px; color: var(--ink); margin-bottom: 3px; }
.benefit span { font-size: 13px; color: var(--tx-2); line-height: 1.6; }
.member-table { width: 100%; border-collapse: collapse; font-size: 14px; }
.member-table th, .member-table td { text-align: left; padding: 11px 10px; border-bottom: 1px solid var(--line-soft); }
.member-table th { font-size: 12.5px; color: var(--tx-3); letter-spacing: 1px; }
.member-table .ok { color: #3f7a55; font-weight: 600; }
.member-table .no { color: #a39a8a; }
.member-table tr.hl td { background: rgba(217, 184, 119, 0.08); }
.brand {
  font-family: var(--serif);
  font-size: 22px;
  font-weight: 700;
  letter-spacing: 4px;
  color: var(--ink);
  text-decoration: none;
}
.topbar nav { display: flex; gap: 22px; }
.topbar nav a {
  color: var(--tx-2);
  text-decoration: none;
  font-size: 14px;
  padding-bottom: 2px;
  border-bottom: 2px solid transparent;
}
.topbar nav a.active { color: var(--ink); border-bottom-color: var(--accent); font-weight: 600; }
.topbar nav a:hover { color: var(--ink); }

main { padding: 0 32px 60px; }

/* ─── 首页 ─── */
.home-layout {
  display: grid;
  grid-template-columns: 1fr 460px;
  gap: 60px;
  align-items: start;
  padding-top: 40px;
}
@media (max-width: 1080px) { .home-layout { grid-template-columns: 1fr; gap: 32px; } }

.eyebrow {
  font-size: 12px;
  letter-spacing: 5px;
  color: var(--accent);
  margin-bottom: 14px;
  font-weight: 600;
}
.hero-title {
  font-family: var(--serif);
  font-size: 58px;
  font-weight: 700;
  letter-spacing: 6px;
  margin: 0 0 12px;
  color: var(--ink);
  line-height: 1.2;
}
@media (max-width: 1080px) { .hero-title { font-size: 40px; } }
.hero-sub { color: var(--tx-2); margin: 0 0 8px; font-size: 15px; }
.hero-sub::after { content: ""; display: block; width: 56px; height: 2px; background: var(--accent); margin-top: 22px; opacity: .55; }

/* 最近命盘 */
.recent { margin-top: 36px; max-width: 480px; }
.recent-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  color: var(--ink);
  font-weight: 600;
  margin-bottom: 6px;
}
.recent-head b { color: var(--accent); font-weight: 600; margin-left: 2px; }
.recent-head button {
  border: none;
  background: none;
  color: var(--tx-3);
  cursor: pointer;
  font-size: 13px;
}
.recent-head button:hover { color: var(--tx-2); }
.recent-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 13px 4px;
  border-bottom: 1px solid var(--line-soft);
  text-decoration: none;
  color: var(--ink);
  transition: background .15s;
}
.recent-item:hover { background: rgba(154, 123, 63, 0.05); }
.ri-main { display: flex; flex-direction: column; gap: 2px; }
.ri-main b { font-weight: 600; font-size: 14px; }
.ri-sub { color: var(--tx-3); font-size: 12px; }
.ri-arrow { color: var(--tx-3); font-size: 20px; line-height: 1; }

/* ─── 卡片 ─── */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 24px 26px;
  box-shadow: 0 1px 3px rgba(60, 50, 30, 0.04);
}
.card h2 {
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 700;
  letter-spacing: 2px;
  margin: 0 0 6px;
}
.sub { color: var(--tx-3); font-size: 12.5px; margin-bottom: 14px; }
.hint { color: var(--tx-3); font-size: 12px; }
.loading { color: var(--tx-3); padding: 40px 0; text-align: center; letter-spacing: 2px; }
.backlink { color: var(--accent-deep); text-decoration: none; font-size: 13px; }
.backlink:hover { text-decoration: underline; }

/* ─── 表单卡 ─── */
.form-card { border-radius: 20px; padding: 30px 34px; }
.form-title {
  text-align: center;
  font-family: var(--serif);
  letter-spacing: 6px;
  color: var(--ink);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 20px;
}

.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 16px 16px; }
.field { display: flex; flex-direction: column; gap: 6px; }
.field label { font-size: 13px; color: var(--tx-2); display: flex; align-items: center; justify-content: space-between; }
.field input, .field select {
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 15px;
  background: #fcfbf8;
  color: var(--ink);
  outline: none;
  width: 100%;
  font-family: inherit;
}
.field input:focus, .field select:focus { border-color: var(--accent); background: #fff; }
.field-hour { grid-column: 1 / -1; }
.date-row-field { grid-column: 1 / -1; }
.date-row { display: grid; grid-template-columns: 1fr 1fr 1fr; gap: 10px; }
.hour-row { display: grid; grid-template-columns: 1fr 110px; gap: 10px; }
.cal-seg { display: inline-flex; gap: 4px; }
.cal-seg button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12px;
  color: var(--tx-2);
  cursor: pointer;
  font-family: inherit;
}
.cal-seg button.on { background: var(--btn-dark); border-color: var(--btn-dark); color: #f5f1e8; font-weight: 600; }
.leap-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--tx-2); cursor: pointer; }
.leap-line input { accent-color: var(--accent); }
.cal-hint {
  background: var(--accent-bg);
  border: 1px solid #ead9b4;
  border-radius: 10px;
  padding: 8px 12px;
  font-size: 12.5px;
  color: var(--accent-deep);
}
.cal-hint.bad { background: #fdf1ee; border-color: #eac0b8; color: #b04a3e; }
.hour-hint {
  margin-top: 8px;
  background: var(--accent-bg);
  border: 1px solid #ead9b4;
  border-radius: 10px;
  padding: 9px 12px;
  font-size: 12.5px;
  color: var(--accent-deep);
}

.gender-seg { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.gender-seg button {
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  cursor: pointer;
  font-size: 14px;
  color: var(--tx-2);
  letter-spacing: 2px;
  transition: all .15s;
}
.gender-seg button.on {
  border-color: var(--accent);
  background: var(--accent-bg);
  color: var(--accent-deep);
  font-weight: 600;
}

.checkline {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--tx-2);
  font-size: 13px;
  margin: 14px 0 4px;
  cursor: pointer;
}
.checkline input { accent-color: var(--accent); }

.btn-primary {
  width: 100%;
  height: 48px;
  margin-top: 18px;
  border: none;
  border-radius: 24px;
  background: var(--btn-dark);
  color: #f5f1e8;
  font-size: 15px;
  letter-spacing: 2px;
  cursor: pointer;
  font-weight: 600;
  transition: opacity .15s;
}
.btn-primary:hover { opacity: 0.9; }
.btn-primary:disabled { opacity: 0.5; cursor: default; }

.btn {
  border: none;
  border-radius: 18px;
  background: var(--btn-dark);
  color: #f5f1e8;
  padding: 8px 20px;
  cursor: pointer;
  font-size: 13px;
}
.btn.ghost {
  background: none;
  border: 1px solid var(--line);
  color: var(--tx-2);
}
.btn.ghost:hover { border-color: var(--accent); color: var(--accent-deep); }
.btn:disabled { opacity: 0.5; cursor: default; }

.err {
  margin-top: 12px;
  background: #fbeae7;
  border: 1px solid #ecc8c2;
  color: #9c4436;
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 13px;
}

/* 合盘双表单：甲乙并列一排；合盘模式下表单卡占满整行 */
.duo { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
@media (max-width: 820px) { .duo { grid-template-columns: 1fr; } }
.home-layout.wide { grid-template-columns: minmax(240px, 1fr) minmax(640px, 760px); gap: 40px; }
.home-layout.wide .hero-title { font-size: 42px; }
.duo-item {
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 14px;
  background: #fcfbf8;
}
.duo-label {
  font-family: var(--serif);
  font-weight: 700;
  letter-spacing: 3px;
  margin-bottom: 10px;
  color: var(--accent-deep);
}
.duo-item .form-grid { grid-template-columns: 1fr 1fr; }

/* ─── 命盘页布局 ─── */
.board-topline {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 18px 0 4px;
}
.board-layout {
  display: grid;
  grid-template-columns: minmax(0, 500px) minmax(360px, 1fr);
  gap: 24px;
  align-items: start;
  margin-top: 8px;
  justify-content: start;
}
@media (max-width: 1180px) { .board-layout { grid-template-columns: 1fr; } }
/* 左栏（命盘/运限）最大 500px，右栏吃掉剩余宽度 */
.col-left { display: flex; flex-direction: column; gap: 20px; min-width: 0; max-width: 500px; }
.col-right { display: flex; flex-direction: column; gap: 20px; min-width: 0; }

/* ─── 命盘（浅色重绘） ─── */
.board-shell { position: relative; padding: 15px; }
.dir-hint {
  position: absolute; font-size: 10.5px; letter-spacing: 2px; color: var(--tx-3);
  line-height: 1; user-select: none; pointer-events: none;
}
.dir-hint.tl { top: 0; left: 8px; }
.dir-hint.tr { top: 0; right: 8px; }
.dir-hint.bl { bottom: 0; left: 8px; }
.dir-hint.br { bottom: 0; right: 8px; }
.board {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: repeat(4, 1fr);
  aspect-ratio: 1 / 1;
  border: 1px solid var(--line);
  border-radius: 4px;
  overflow: hidden;
  position: relative;
  background: #fffdf9;
}
.palace {
  border: 0.5px solid var(--line);
  padding: 6px 7px;
  font-size: 12px;
  position: relative;
  cursor: pointer;
  transition: background .12s;
  min-height: 88px;
  overflow: hidden;
}
.palace:hover { background: #faf6ec; }
.palace.ming { background: var(--accent-bg); }
.palace.curdx { box-shadow: inset 0 0 0 1.5px #d3b271; }
.palace.layer-ming { background: #f4e9cf; box-shadow: inset 0 0 0 1.5px var(--accent); }
.palace.sanfang { background: #eef3ea; box-shadow: inset 0 0 0 1.5px #7fa06f; }
.palace .head {
  display: flex;
  justify-content: space-between;
  color: var(--tx-2);
  font-size: 11px;
  margin-bottom: 3px;
}
.palace .pname { color: var(--accent-deep); font-weight: 600; }
.palace .layer-name { color: var(--accent); font-size: 10.5px; margin-bottom: 2px; }
.palace .stars { display: flex; flex-direction: column; gap: 1px; }
.palace .major { font-size: 12.5px; font-weight: 600; color: var(--ink); line-height: 1.45; }
.palace .major.dim { color: var(--tx-2); }
.palace .bright { color: var(--tx-3); font-weight: 400; font-size: 10.5px; }
.palace .minor { color: var(--tx-2); font-size: 11px; margin-top: 2px; line-height: 1.5; }
/* 星曜分色：吉曜（青绿）/ 煞曜（朱红）/ 杂曜（灰蓝），与导出图同一套语义色 */
.palace .minor .st { font-style: normal; margin-right: 5px; }
.palace .minor .st.lucky { color: #3f7a55; }
.palace .minor .st.sha { color: #b04a3e; }
.palace .minor .st.minor { color: #6b7a8f; }
.palace .minor .st.dim { opacity: .62; }
.palace .borrow { color: var(--tx-3); font-size: 11px; font-style: normal; }
.palace .dxage {
  position: absolute;
  right: 6px;
  bottom: 4px;
  color: var(--accent-deep);
  font-size: 10.5px;
  opacity: 0.85;
}
.palace .shen {
  position: absolute;
  left: 7px;
  bottom: 4px;
  color: var(--tx-3);
  font-size: 10px;
}

.sihua, .ls {
  display: inline-block;
  font-size: 10px;
  font-weight: 700;
  border-radius: 4px;
  padding: 0 3px;
  margin-left: 3px;
  vertical-align: 1px;
}
.sihua { background: var(--accent-bg); color: var(--accent-deep); }
.ls.禄 { background: #e2f0e5; color: #38734d; }
.ls.权 { background: #f6ecd2; color: #96691c; }
.ls.科 { background: #e1edf6; color: #38648f; }
.ls.忌 { background: #f8e2de; color: #b04a3e; }
.layer-sihua { margin-top: 3px; line-height: 1.5; }
.layer-sihua .ls { margin-left: 0; margin-right: 3px; }

.center-info {
  grid-column: 2 / 4;
  grid-row: 2 / 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  text-align: center;
  padding: 10px;
  border: 0.5px solid var(--line);
  background: #fbf8f1;
}
.center-info .zi {
  font-family: var(--serif);
  font-size: 21px;
  font-weight: 700;
  letter-spacing: 6px;
  color: var(--ink);
  margin-bottom: 4px;
}
.center-info .row { font-size: 12px; color: var(--tx-2); }
.center-info .row b { color: var(--ink); font-weight: 600; }

.patterns { margin-top: 14px; display: flex; flex-wrap: wrap; gap: 8px; }
.patterns .chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 3px 12px;
  font-size: 12px;
  color: var(--accent-deep);
  background: var(--accent-bg);
  cursor: default;
}
.patterns .chip.warn { background: #f8e2de; border-color: #ecc8c2; color: #9c4436; }

/* 飞星 SVG */
.feixing-svg { opacity: 0.9; }

/* 三方四正虚线联动 */
.sanfang-svg { opacity: 0.9; }

/* ─── 命盘页顶栏（修改生辰 + 下载） ─── */
.board-topline { flex-wrap: wrap; }
.dl-bar { display: flex; gap: 10px; margin-left: auto; }
.dl-bar .btn { padding: 6px 16px; font-size: 12.5px; }

/* ─── 运限面板 ─── */
.yx-tabs { display: flex; flex-wrap: wrap; gap: 8px; margin: 10px 0 12px; }
.yx-tabs button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 5px 16px;
  font-size: 13px;
  cursor: pointer;
  color: var(--tx-2);
  transition: all .15s;
}
.yx-tabs button.on { background: var(--btn-dark); border-color: var(--btn-dark); color: #f5f1e8; }
.yx-ctrl { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 10px; margin-bottom: 10px; }
.yx-list { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.yx-item {
  border: 1px solid var(--line);
  background: #fcfbf8;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--ink);
  text-align: left;
  line-height: 1.5;
}
.yx-item.on { border-color: var(--accent); background: var(--accent-bg); }
.yx-item .hint { display: block; }
.yx-info {
  border-top: 1px dashed var(--line);
  padding-top: 10px;
  font-size: 13px;
  color: var(--tx-2);
  line-height: 1.7;
}
.yx-info b { color: var(--ink); }

/* ─── 雷达图与十三维 ─── */
.radar-box { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.radar-box #radar { flex: 0 0 auto; }
.radar-legend {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 3px 18px;
  font-size: 13px;
  color: var(--tx-2);
  flex: 1;
  min-width: 160px;
}
.radar-legend div { white-space: nowrap; }
.radar-legend .hint { grid-column: 1 / -1; white-space: normal; }
.radar-legend b { color: var(--accent-deep); }
.topic-chips { display: flex; flex-wrap: wrap; gap: 8px; margin: 14px 0 4px; }
.topic-chips button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 4px 14px;
  font-size: 12.5px;
  cursor: pointer;
  color: var(--tx-2);
  transition: all .15s;
}
.topic-chips button:hover:not(:disabled) { border-color: var(--accent); color: var(--accent-deep); }
.topic-chips button.on { background: var(--btn-dark); border-color: var(--btn-dark); color: #f5f1e8; }
.topic-chips button:disabled { opacity: 0.4; cursor: default; }
.reading {
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.9;
  color: #3a342b;
  max-height: 420px;
  overflow-y: auto;
  padding-right: 6px;
}
.reading h4 {
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: 1px;
  color: var(--ink);
  border-left: 3px solid var(--accent);
  padding-left: 10px;
  margin: 16px 0 6px;
}
.reading b { color: var(--accent-deep); }
.reading-lic { color: var(--tx-3); font-size: 11px; margin-top: 10px; }

/* ─── 加载态：进度条 / 骨架 / 思考中 ─── */
/* 首次查询某年份要解压约 700MB 语料（10-30 秒），这段等待必须"看得见在动" */
.prog { padding: 14px 2px 8px; }
.prog-head { display: flex; align-items: center; gap: 8px; font-size: 13.5px; color: var(--ink); }
.prog-head b { font-family: var(--serif); font-weight: 600; letter-spacing: .5px; }
.prog-time { margin-left: auto; font-size: 12px; color: var(--tx-3); font-variant-numeric: tabular-nums; }
.prog-spin {
  width: 13px; height: 13px; border-radius: 50%;
  border: 2px solid var(--line);
  border-top-color: var(--accent);
  animation: prog-spin .8s linear infinite;
}
@keyframes prog-spin { to { transform: rotate(360deg); } }
.prog-bar {
  margin: 10px 0 9px;
  height: 4px;
  border-radius: 999px;
  background: var(--line-soft);
  overflow: hidden;
}
.prog-bar i {
  display: block;
  height: 100%;
  width: 4%;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--accent), #c9a961);
  transition: width .45s ease-out;
}
.prog-hint { font-size: 12px; color: var(--tx-3); line-height: 1.75; min-height: 21px; }

/* 维度 chip 骨架：13 个占位，宽度错落一点更像内容即将出现 */
.chip-sk {
  display: inline-block;
  width: 62px;
  height: 26px;
  border-radius: 999px;
  background: var(--line-soft);
  position: relative;
  overflow: hidden;
}
.chip-sk:nth-child(3n) { width: 78px; }
.chip-sk:nth-child(4n) { width: 54px; }
.chip-sk::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .8), transparent);
  animation: sk-shine 1.5s ease-in-out infinite;
}
@keyframes sk-shine { from { transform: translateX(-100%); } to { transform: translateX(100%); } }

/* AI 首字之前的思考态：呼吸圆点 + 轮播文案，替代空气泡 */
.think { display: flex; align-items: center; gap: 9px; color: var(--tx-2); font-size: 13px; line-height: 1.6; }
.think-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--accent);
  animation: think-pulse 1.2s ease-in-out infinite;
}
@keyframes think-pulse {
  0%, 100% { opacity: .32; transform: scale(.85); }
  50% { opacity: 1; transform: scale(1.18); }
}

@media (prefers-reduced-motion: reduce) {
  .prog-spin, .chip-sk::after, .think-dot { animation: none; }
  .prog-bar i { transition: none; }
}

/* ─── 聊天面板 ─── */
.chat { display: flex; flex-direction: column; }
.msgs {
  min-height: 200px;
  max-height: 480px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: 12px 0;
}
.msg { border-radius: 12px; padding: 10px 14px; max-width: 92%; font-size: 13.5px; line-height: 1.75; }
.msg.user {
  align-self: flex-end;
  background: var(--accent-bg);
  border: 1px solid #ead9b4;
  color: var(--accent-deep);
  white-space: pre-wrap;
}
.msg.assistant {
  align-self: stretch;
  background: #fcfbf8;
  border: 1px solid var(--line-soft);
  color: #3a342b;
}
.msgs h4 {
  font-family: var(--serif);
  color: var(--ink);
  font-size: 15px;
  letter-spacing: 1px;
  margin: 14px 0 6px;
  padding-left: 10px;
  border-left: 3px solid var(--accent);
}
.msgs h4:first-child { margin-top: 0; }
.msgs b { color: var(--accent-deep); font-weight: 600; }
.heming-chat .msgs p { margin: 0 0 10px; }
.msgs .empty {
  color: var(--tx-3);
  text-align: center;
  padding: 40px 0;
  letter-spacing: 1px;
}
.cursor {
  display: inline-block;
  width: 7px;
  height: 15px;
  background: var(--accent);
  vertical-align: -2px;
  margin-left: 2px;
  animation: blink 1s step-end infinite;
}
@keyframes blink { 50% { opacity: 0; } }
.preset { display: grid; grid-template-columns: 1fr; gap: 8px; margin-bottom: 10px; }
.preset button {
  border: 1px dashed var(--line);
  background: none;
  border-radius: 10px;
  padding: 7px 12px;
  font-size: 12.5px;
  color: var(--tx-2);
  cursor: pointer;
  text-align: left;
  transition: all .15s;
}
.preset button:hover { border-color: var(--accent); color: var(--accent-deep); background: var(--accent-bg); }
.inputbar { display: flex; gap: 8px; }
.inputbar input {
  flex: 1;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 13.5px;
  outline: none;
  background: #fcfbf8;
  color: var(--ink);
  font-family: inherit;
}
.inputbar input:focus { border-color: var(--accent); background: #fff; }
.heming-chat .msgs { max-height: none; min-height: 300px; }

/* ─── 右栏内容 tab（命盘分析/AI 解读、合盘详解/AI 深度解读） ─── */
.panel-tabs {
  display: flex;
  gap: 4px;
  border-bottom: 1px solid var(--line-soft);
  margin-bottom: 14px;
}
.panel-tabs button {
  border: none;
  background: none;
  color: var(--tx-2);
  padding: 8px 16px 10px;
  margin-bottom: -1px;
  font-size: 14px;
  letter-spacing: 1px;
  cursor: pointer;
  font-family: inherit;
  border-bottom: 2px solid transparent;
  transition: color .15s, border-color .15s;
}
.panel-tabs button:hover { color: var(--accent-deep); }
.panel-tabs button.on { color: var(--accent-deep); font-weight: 600; border-bottom-color: var(--accent); }

@media (max-width: 720px) {
  .topbar { padding: 14px 20px; }
  main { padding: 0 20px 40px; }
  .form-card { padding: 22px 20px; }
  .card { padding: 18px 16px; }
}

/* ─── 合盘页（OURANIC 式：左关系+评分，右详解+AI） ─── */
.rel-tabs { display: flex; gap: 8px; margin-bottom: 16px; flex-wrap: wrap; }
.rel-tabs button {
  border: 1px solid var(--line); background: #fff; color: var(--tx-2);
  border-radius: 999px; padding: 7px 18px; font-size: 13px; cursor: pointer; font-family: inherit;
}
.rel-tabs button.on { background: var(--btn-dark); border-color: var(--btn-dark); color: #f5f1e8; font-weight: 600; }

.hp-person { display: flex; align-items: center; gap: 12px; padding: 10px 0; border-bottom: 1px dashed var(--line-soft); }
.hp-person:last-of-type { border-bottom: none; }
.hp-tag {
  flex: 0 0 26px; width: 26px; height: 26px; border-radius: 8px; display: inline-flex;
  align-items: center; justify-content: center; font-size: 13px; font-weight: 700; color: #fff;
}
.hp-tag.a { background: #b04a3e; }
.hp-tag.b { background: #38648f; }
.hp-name { display: flex; flex-direction: column; gap: 2px; flex: 1; min-width: 0; }
.hp-name b { font-size: 14px; }
.hp-actions { display: flex; gap: 10px; }
.hp-actions a { color: var(--accent-deep); font-size: 13px; text-decoration: none; }
.hp-actions a:hover { text-decoration: underline; }

.hp-scores { margin-top: 14px; display: flex; flex-direction: column; gap: 9px; }
.hp-score-row { display: grid; grid-template-columns: 44px 1fr 52px; align-items: center; gap: 10px; }
.hp-score-row > span { font-size: 13px; color: var(--tx-2); }
.hp-score-row b { font-size: 13px; text-align: right; color: var(--ink); }
.dots { display: flex; gap: 5px; }
.dots .dot { width: 14px; height: 14px; border-radius: 4px; background: var(--line); }
.dots .dot.on { background: var(--accent); }
.dots .dot.blink { animation: dotBlink 1s ease-in-out infinite; }
@keyframes dotBlink {
  0%, 100% { background: var(--line); }
  50% { background: var(--accent); }
}
.dots .dot.on.pop { animation: dotPop .35s both; }
@keyframes dotPop {
  from { background: var(--line); transform: scale(0.8); }
  to { background: var(--accent); transform: scale(1); }
}
.score-wait { color: var(--tx-3); font-weight: normal !important; }

/* ─── 出生地选择器 ─── */
.city-host { position: relative; }
.city-trigger {
  width: 100%;
  height: 46px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 14px;
  font-size: 15px;
  background: #fcfbf8;
  color: var(--tx-3);
  cursor: pointer;
  font-family: inherit;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  text-align: left;
}
.city-trigger.set { color: var(--ink); }
.city-trigger .city-text { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.city-trigger:hover { border-color: var(--accent); }
.city-arrow {
  width: 8px; height: 8px;
  border-right: 2px solid var(--tx-3);
  border-bottom: 2px solid var(--tx-3);
  transform: rotate(45deg) translateY(-2px);
  flex: 0 0 auto;
}
.city-pop {
  position: absolute;
  top: calc(100% + 6px);
  left: 0;
  right: 0;
  min-width: 360px;
  z-index: 60;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(40, 30, 10, 0.14);
  padding: 12px;
}
.city-tabs { display: flex; gap: 6px; background: #f5f2ea; border-radius: 999px; padding: 3px; margin-bottom: 10px; }
.city-tabs button {
  flex: 1;
  border: none;
  background: none;
  border-radius: 999px;
  padding: 7px 0;
  font-size: 13px;
  color: var(--tx-2);
  cursor: pointer;
  font-family: inherit;
}
.city-tabs button.on { background: var(--btn-dark); color: #f5f1e8; font-weight: 600; }
.city-search {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 12px;
  font-size: 14px;
  background: #fcfbf8;
  color: var(--ink);
  outline: none;
  font-family: inherit;
  box-sizing: border-box;
}
.city-search:focus { border-color: var(--accent); background: #fff; }
.city-hot { display: flex; flex-wrap: wrap; gap: 6px; margin: 10px 0 4px; }
.city-hot .hot-label { font-size: 12px; color: var(--tx-3); align-self: center; margin-right: 2px; }
.city-hot button {
  border: 1px solid var(--line);
  background: var(--card);
  border-radius: 999px;
  padding: 5px 14px;
  font-size: 12.5px;
  color: var(--tx-2);
  cursor: pointer;
  font-family: inherit;
}
.city-hot button:hover { border-color: var(--accent); color: var(--accent-deep); }
.city-hot .city-clear { border-style: dashed; }
.city-note { font-size: 12px; color: var(--tx-3); margin: 6px 0 2px; }
.city-cols { display: grid; grid-template-columns: 1fr 1.3fr; gap: 10px; margin-top: 8px; }
.city-col { min-width: 0; }
.city-col-head { font-size: 12px; color: var(--tx-3); margin-bottom: 6px; }
.city-list {
  max-height: 240px;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
  border: 1px solid var(--line-soft);
  border-radius: 10px;
  padding: 5px;
  background: #fcfbf8;
}
.city-list button {
  border: none;
  background: none;
  text-align: left;
  border-radius: 8px;
  padding: 8px 12px;
  font-size: 14.5px;
  line-height: 20px;
  color: #26211a;
  cursor: pointer;
  font-family: inherit;
}
.city-list button:hover { background: var(--accent-bg); }
.city-list button.on { background: var(--btn-dark); color: #f7f3ea; font-weight: 600; }
.city-list .tz { float: right; font-size: 11.5px; color: var(--tx-3); }
.city-foot {
  border-top: 1px solid var(--line-soft);
  margin-top: 10px;
  padding-top: 8px;
  font-size: 11px;
  color: var(--tx-3);
}
.hp-compare-row {
  margin-top: 16px; padding-top: 12px; border-top: 1px solid var(--line-soft);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
}

.hp-headline { font-family: var(--serif); font-size: 22px; font-weight: 700; color: var(--ink); margin: 4px 0 8px; }
.hp-summary { color: var(--tx-2); font-size: 13.5px; margin-bottom: 6px; }
.hp-dim { margin-top: 20px; padding-top: 16px; border-top: 1px solid var(--line-soft); }
.hp-dim-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.hp-dim-head b { font-size: 16px; }
.hp-badge {
  background: var(--accent-bg); color: var(--accent-deep); font-size: 12.5px;
  border-radius: 999px; padding: 4px 12px; font-weight: 600; white-space: nowrap;
}
.hp-line { display: flex; gap: 10px; margin: 10px 0; }
.hp-side {
  flex: 0 0 22px; height: 22px; border-radius: 6px; display: inline-flex; align-items: center;
  justify-content: center; font-size: 12px; font-weight: 700; color: #fff; margin-top: 1px;
}
.hp-side.a { background: #b04a3e; }
.hp-side.b { background: #38648f; }
.hp-line p { margin: 0; font-size: 13.5px; line-height: 1.6; color: var(--ink); }
.hp-line-tag { color: var(--tx-3); font-size: 12px; }
.hp-detail {
  background: #faf7f0; border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 10px 14px; margin: 10px 0 0 32px; font-size: 13px;
}
.hp-detail p { margin: 6px 0 0; line-height: 1.6; color: var(--tx-2); }
.hp-chip {
  display: inline-block; font-style: normal; font-size: 12px; border-radius: 6px;
  padding: 2px 8px; margin-right: 6px; font-weight: 600;
}
.hp-chip.a { background: #f8e2de; color: #b04a3e; }
.hp-chip.b { background: #e1edf6; color: #38648f; }

/* ─── 两盘对照浮层 ─── */
#compare-overlay {
  position: fixed; inset: 0; z-index: 50; background: rgba(38, 33, 26, 0.55);
  display: flex; flex-direction: column;
}
.cmp-head {
  background: var(--card); padding: 12px 24px; display: flex; align-items: center; gap: 16px;
  border-bottom: 1px solid var(--line); box-shadow: 0 2px 12px rgba(0,0,0,.06);
}
.cmp-head b { font-size: 16px; }
.cmp-head .btn { margin-left: auto; }
.cmp-body {
  flex: 1; overflow: auto; padding: 20px 24px 40px;
  display: grid; grid-template-columns: 1fr 1fr; gap: 20px; align-items: start;
}
@media (max-width: 1180px) { .cmp-body { grid-template-columns: 1fr; } }
.cmp-side {
  background: var(--card); border-radius: 16px; padding: 16px 18px; min-width: 0;
  border: 1px solid var(--line);
}
.cmp-chart-title { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.cmp-chart-title b { font-size: 15px; }
.cmp-chart { max-width: 560px; }
.cmp-strips { margin-top: 14px; display: flex; flex-direction: column; gap: 12px; }
.cmp-strip { border-top: 1px solid var(--line-soft); padding-top: 10px; }
.cs-head { display: flex; align-items: baseline; gap: 10px; margin-bottom: 8px; }
.cs-head b { color: var(--accent-deep); font-size: 13.5px; }
.cs-cells { display: flex; flex-wrap: wrap; gap: 6px; }
.cs-cell {
  border: 1px solid var(--line); background: #fff; border-radius: 8px; cursor: pointer;
  padding: 5px 9px; min-width: 52px; text-align: center; font-family: inherit;
  display: flex; flex-direction: column; gap: 1px; align-items: center;
}
.cs-cell b { font-size: 12.5px; color: var(--ink); font-weight: 600; }
.cs-cell span { font-size: 11px; color: var(--tx-3); }
.cs-cell:hover { border-color: var(--accent); }
.cs-cell.on { border-color: var(--accent); background: var(--accent-bg); }
.cs-cell.on b { color: var(--accent-deep); }
.cs-cell.cur { border-color: #d3b271; box-shadow: inset 0 0 0 1px #d3b271; }
.cmp-info { margin-top: 12px; line-height: 1.6; color: var(--tx-2); }

/* ─── 关键洞察三卡 + 关键推导引用 ─── */
.insight-cards { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin: 14px 0 2px; }
@media (max-width: 900px) { .insight-cards { grid-template-columns: 1fr; } }
.ins-card {
  background: #fbf8f1; border: 1px solid var(--line-soft); border-radius: 12px;
  padding: 13px 15px 14px; border-left: 3px solid var(--accent); min-width: 0;
}
.ins-card.relation { border-left-color: #7fa06f; }
.ins-card.growth { border-left-color: #b04a3e; }
.ins-head { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; margin-bottom: 7px; }
.ins-head b { font-size: 14px; color: var(--ink); }
.ins-head span { font-size: 11px; color: var(--tx-3); }
.ins-card p { margin: 0; font-size: 12.8px; line-height: 1.68; color: var(--tx-2); }
.ins-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 9px; }
.ins-chips span {
  font-size: 11.5px; color: var(--accent-deep); background: var(--accent-bg);
  border-radius: 999px; padding: 2px 9px;
}
.ins-card.relation .ins-chips span { color: #3f6b34; background: #eef3ea; }
.ins-card.growth .ins-chips span { color: #9d4438; background: #f8e6e2; }

.insight-quote {
  border-left: 2px solid var(--line); padding: 2px 0 2px 14px; margin: 18px 0 4px;
}
.iq-head { font-size: 12px; color: var(--tx-3); letter-spacing: 1px; margin-bottom: 8px; }
.iq-item { margin-bottom: 10px; }
.iq-item span {
  display: inline-block; font-size: 11.5px; color: var(--accent-deep);
  border: 1px solid var(--line); border-radius: 4px; padding: 1px 7px; margin-bottom: 5px;
}
.iq-item p { margin: 0; font-size: 13px; line-height: 1.7; color: var(--ink); }

/* ─── 隐藏生辰（分享截图用） ─── */
.hide-birth #board-person,
.hide-birth .center-info .row:nth-child(2),
.hide-birth .center-info .row:nth-child(3) {
  filter: blur(5px); transition: filter .18s;
}
.hide-birth #board-person:hover,
.hide-birth .center-info .row:nth-child(2):hover,
.hide-birth .center-info .row:nth-child(3):hover { filter: blur(1.5px); }
