:root {
  /* 方案 A「书院风」（web/design/variant-a.html 选定稿，2026-10-03 移植）：
     宣纸底 + 墨色正文 + 朱砂印章红点睛，标题与干支用宋体。红色全页不超过三处。 */
  --ink: #28221b;
  --ink-soft: #6f6455;
  --ink-faint: #9c9080;
  --paper: #f6f1e7;
  --paper-raised: #fffdf7;
  --line: #e2d7c4;
  --line-strong: #c9b99f;
  --accent: #a83a2c;
  --accent-deep: #8c2f23;
  --accent-soft: #f3e4de;
  --warn: #9a6a2f;
  --danger: #a33a2e;
  --serif: "Songti SC", "STSong", "Noto Serif SC", "SimSun", serif;

  --mu: #4a7c59;
  --huo: #b5443a;
  --tu: #a8823f;
  --jin: #8a8578;
  --shui: #3f6b8f;

  --radius: 10px;
  --shadow: 0 1px 2px rgba(60, 45, 30, 0.05), 0 6px 18px rgba(60, 45, 30, 0.05);
}

@media (prefers-color-scheme: dark) {
  :root {
    --ink: #ebe4d9;
    --ink-soft: #b3a897;
    --ink-faint: #857a6b;
    --paper: #1a1714;
    --paper-raised: #232019;
    --line: #3a342b;
    --line-strong: #4d453a;
    --accent: #d47868;
    --accent-deep: #e08a76;
    --accent-soft: #352420;
    --warn: #d0a05a;
    --danger: #d9705f;

    --mu: #7aab8a;
    --huo: #d9705f;
    --tu: #c9a765;
    --jin: #a8a396;
    --shui: #7ba3c4;

    --shadow: 0 1px 2px rgba(0, 0, 0, 0.3), 0 6px 18px rgba(0, 0, 0, 0.25);
  }
}

* { box-sizing: border-box; }

/* hidden 属性靠 UA 样式的 display:none 生效，任何作者写的 display 都会盖过它。
   本项目 .check 是 display:flex，所以必须在这里补一条，否则 hidden 形同虚设。 */
[hidden] { display: none !important; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font: 16px/1.75 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Noto Sans SC", sans-serif;
  -webkit-text-size-adjust: 100%;
}

.wrap {
  max-width: 680px;
  margin: 0 auto;
  padding: 28px 20px 72px;
}

/* 品牌位：印章 + 字标。印章用 ::before 凭空生成，HTML 不用动。 */
.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: 0.26em;
  color: var(--ink-faint);
  margin-bottom: 6px;
}

.brand::before {
  content: "索";
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 7px;
  background: var(--accent);
  color: #fdf6ee;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: var(--serif);
  font-size: 17px;
  letter-spacing: 0;
  box-shadow: 0 1px 3px rgba(140, 47, 35, 0.3);
}

h1 {
  font-family: var(--serif);
  font-size: 25px;
  line-height: 1.45;
  margin: 0 0 6px;
  font-weight: 700;
  letter-spacing: 0.04em;
}

.sub {
  color: var(--ink-soft);
  font-size: 14px;
  margin: 0 0 28px;
}

/* ---------- 表单 ---------- */

.field { margin-bottom: 22px; }

.field > label {
  display: block;
  font-size: 13px;
  color: var(--ink-soft);
  margin-bottom: 8px;
  letter-spacing: 0.04em;
}

.segmented {
  display: flex;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--paper-raised);
}

.segmented button {
  flex: 1;
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  padding: 11px 8px;
  font: inherit;
  font-size: 15px;
  cursor: pointer;
  border-right: 1px solid var(--line);
}

.segmented button:last-child { border-right: 0; }
.segmented button[aria-pressed="true"] {
  background: var(--ink);
  color: var(--paper);
  font-weight: 500;
}

input[type="date"],
input[type="time"],
input[type="text"],
select {
  width: 100%;
  padding: 11px 13px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  appearance: none;
}

input:focus, select:focus, button:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 1px;
}

.row { display: flex; gap: 10px; }
.row > * { flex: 1; min-width: 0; }

.hint {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-top: 7px;
  line-height: 1.6;
}

.check {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 14px;
  color: var(--ink-soft);
  cursor: pointer;
  user-select: none;
}

.check input { width: 17px; height: 17px; accent-color: var(--accent); }

/* 一页只应有一个 .submit（实心主按钮），其余操作走 .actions 的描边次级按钮 */
.submit {
  width: 100%;
  padding: 14px;
  font-family: var(--serif);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: #fdf6ee;
  background: var(--accent);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: 6px;
}

.submit:disabled { opacity: 0.5; cursor: default; }

/* 次级动作（如「生成分享图」）：与 .submit 同尺寸但描边不实心。
   一页只有一个实心主按钮，付费 CTA 不能被获客按钮抢视觉重量。 */
.submit-ghost {
  width: 100%;
  padding: 13px;
  font: inherit;
  font-size: 15px;
  letter-spacing: 0.06em;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
  margin-top: 6px;
}

.submit-ghost:disabled { opacity: 0.5; cursor: default; }

.notice {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--ink-faint);
}

.alert {
  background: var(--accent-soft);
  border-left: 3px solid var(--warn);
  border-radius: 6px;
  padding: 12px 14px;
  font-size: 14px;
  color: var(--ink);
  margin-bottom: 20px;
  line-height: 1.65;
}

/* ---------- 命书 ---------- */

.card {
  background: var(--paper-raised);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px;
  margin-bottom: 18px;
  box-shadow: var(--shadow);
}

.card h2 {
  font-family: var(--serif);
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.14em;
  color: var(--ink);
  margin: 0 0 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.card h2::before {
  content: "";
  flex: none;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 2px;
}

.card p { margin: 0 0 12px; }
.card p:last-child { margin-bottom: 0; }

.lead {
  font-family: var(--serif);
  font-size: 20px;
  font-weight: 700;
  line-height: 1.85;
  letter-spacing: 0.05em;
  margin: 0;
  text-align: center;
  padding: 6px 0;
}

.pillars {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  table-layout: fixed;
}

.pillars th, .pillars td {
  padding: 11px 4px;
  text-align: center;
  border-bottom: 1px solid var(--line);
  /* 中文默认可在任意字间断行，「丁火、己土」会被拆成「丁火、己 / 土」。
     keep-all 只在标点处断，藏干这类紧凑词才不会被切碎。 */
  word-break: keep-all;
  overflow-wrap: break-word;
}

.pillars th {
  font-weight: 400;
  font-size: 12.5px;
  color: var(--ink-faint);
  letter-spacing: 0.1em;
  border-bottom: 1px solid var(--line-strong);
}

.pillars td.label {
  font-size: 12.5px;
  color: var(--ink-faint);
  text-align: left;
  padding-left: 0;
  width: 46px;
}

.pillars .gz {
  font-family: var(--serif);
  font-size: 29px;
  font-weight: 700;
  letter-spacing: 0.08em;
  line-height: 1.35;
}

/* 日柱是整张盘的主角 —— 干支标朱砂红。每行首格是行标签（td.label / 空 th），
   所以日柱在第 4 格。 */
.pillars td:nth-child(4) .gz {
  color: var(--accent);
}

.pillars tr:last-child td { border-bottom: 0; }

.wuxing { display: flex; gap: 8px; margin-top: 4px; }

.wx {
  flex: 1;
  text-align: center;
  padding: 10px 2px 8px;
  border-radius: 8px;
  background: var(--paper);
  border: 1px solid var(--line);
}

.wx .name { font-size: 13px; letter-spacing: 0.1em; }
.wx .n { font-family: var(--serif); font-size: 20px; font-weight: 700; line-height: 1.3; font-variant-numeric: tabular-nums; }
.wx .bar { height: 3px; border-radius: 2px; margin: 5px 6px 0; background: var(--line); }
.wx .bar > i { display: block; height: 100%; border-radius: 2px; }
.wx[data-w="木"] .bar > i { background: var(--mu); }
.wx[data-w="火"] .bar > i { background: var(--huo); }
.wx[data-w="土"] .bar > i { background: var(--tu); }
.wx[data-w="金"] .bar > i { background: var(--jin); }
.wx[data-w="水"] .bar > i { background: var(--shui); }
.wx.empty { opacity: 0.55; }

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 14px;
  font-size: 13px;
  color: var(--ink-soft);
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.meta b { font-weight: 500; color: var(--ink); }

.conf {
  display: inline-block;
  font-size: 11.5px;
  padding: 1.5px 8px;
  border-radius: 20px;
  letter-spacing: 0.06em;
  vertical-align: 1px;
  margin-left: 7px;
  border: 1px solid;
}

.conf[data-c="高"] { color: var(--mu); border-color: color-mix(in srgb, var(--mu) 40%, transparent); }
.conf[data-c="中"] { color: var(--tu); border-color: color-mix(in srgb, var(--tu) 40%, transparent); }
.conf[data-c="低"] { color: var(--ink-faint); border-color: var(--line-strong); }

.topic {
  font-weight: 600;
  font-size: 14.5px;
  color: var(--ink);
  letter-spacing: 0.03em;
  margin-bottom: 6px;
}

.src {
  font-size: 12.5px;
  color: var(--ink-faint);
  margin-top: 9px;
  line-height: 1.6;
}

.views { display: flex; flex-direction: column; gap: 10px; }

.view {
  background: var(--paper);
  border-radius: 8px;
  padding: 11px 13px;
  font-size: 14px;
}

.view .school {
  font-size: 12.5px;
  color: var(--accent);
  letter-spacing: 0.08em;
  display: block;
  margin-bottom: 3px;
}

.calib {
  border-left: 2px solid var(--line-strong);
  padding-left: 15px;
  margin-bottom: 17px;
}

.calib:last-child { margin-bottom: 0; }
.calib .when { font-size: 13px; color: var(--ink-faint); margin-bottom: 3px; }
.calib .when b { color: var(--accent); font-weight: 500; }

.caveat {
  font-size: 13.5px;
  color: var(--warn);
  line-height: 1.7;
  margin-bottom: 10px;
  padding-left: 15px;
  position: relative;
}

.caveat:last-child { margin-bottom: 0; }
.caveat::before { content: "·"; position: absolute; left: 5px; }

.disclaimer {
  font-size: 12.5px;
  color: var(--ink-faint);
  line-height: 1.75;
  text-align: center;
  padding: 8px 6px 0;
}

.badge {
  display: inline-block;
  font-size: 11.5px;
  padding: 2px 9px;
  border-radius: 20px;
  background: var(--accent-soft);
  color: var(--accent);
  letter-spacing: 0.05em;
  margin-bottom: 16px;
}

.actions { display: flex; gap: 10px; margin-bottom: 22px; }

.actions a, .actions button {
  flex: 1;
  text-align: center;
  padding: 11px;
  font: inherit;
  font-size: 14.5px;
  border-radius: var(--radius);
  border: 1px solid var(--line-strong);
  background: var(--paper-raised);
  color: var(--ink);
  text-decoration: none;
  cursor: pointer;
}

details.card > summary {
  cursor: pointer;
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 0.06em;
  list-style: none;
}

details.card > summary::-webkit-details-marker { display: none; }
details.card > summary::after { content: " ▾"; }
details.card[open] > summary::after { content: " ▴"; }
details.card > summary + * { margin-top: 16px; }

.dl { font-size: 14px; }
.dl div { display: flex; gap: 14px; padding: 8px 0; border-bottom: 1px solid var(--line); }
.dl div:last-child { border-bottom: 0; }
.dl dt { color: var(--ink-faint); min-width: 76px; font-size: 13px; }
.dl dd { margin: 0; flex: 1; }

@media (max-width: 400px) {
  .pillars .gz { font-size: 25px; }
  .card { padding: 18px 16px; }
  .lead { font-size: 18px; }
}

/* ---------- 分享图浮层 ---------- */
.overlay {
  position: fixed;
  inset: 0;
  /* 全不透明：浅色按钮在深色遮罩上即使只透 6% 也很扎眼，看着像布局坏了。
     分享图查看器不需要「看到背后」的信息，做实最干净。 */
  background: #1a140f;
  display: flex;
  /* flex-start 而非 center：内容比屏幕高时，center 会把顶部切掉且滚不到 */
  align-items: flex-start;
  justify-content: center;
  padding: 24px;
  z-index: 50;
  overflow-y: auto;
}

/* 内容不高时 margin:auto 自动居中，高了则从顶部排并可滚动 */
.overlay-body { margin: auto; max-width: 420px; width: 100%; text-align: center; }

.share-img {
  width: 100%;
  border-radius: 12px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.4);
  display: block;
}

.share-tip {
  color: #e8e0d4;
  font-size: 13px;
  line-height: 1.7;
  margin: 16px 0 14px;
}

.overlay-close {
  width: 100%;
  padding: 12px;
  font: inherit;
  font-size: 15px;
  color: var(--ink);
  background: var(--paper-raised);
  border: 0;
  border-radius: var(--radius);
  cursor: pointer;
}

/* ---------- 付费墙 ---------- */

.paywall {
  border-color: var(--line-strong);
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--paper-raised) 62%);
}

.paywall-lead {
  color: var(--ink-soft);
  font-size: 15px;
  margin-bottom: 18px;
}

.paywall-list {
  margin: 6px 0 22px;
  padding: 0;
  list-style: none;
}

.paywall-list li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 9px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.paywall-list li::before {
  content: "·";
  position: absolute;
  left: 5px;
  color: var(--accent);
}

.paywall-note {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-faint);
  text-align: center;
}

/* ---------- 单格解读 ---------- */

.topic-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin: 4px 0 18px;
}

.topic-btn {
  padding: 11px 6px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}

.topic-btn:hover { border-color: var(--accent); }
.topic-btn:disabled { opacity: 0.55; cursor: default; }

.topic[data-locked="true"] .topic-btn {
  opacity: 0.42;
  filter: grayscale(0.5);
}

.topic-lead {
  color: var(--ink-soft);
  font-size: 14.5px;
  margin-bottom: 16px;
}

.topic-out:empty { display: none; }

.topic-loading,
.topic-lock,
.topic-error {
  font-size: 14px;
  line-height: 1.7;
  padding: 14px 16px;
  border-radius: var(--radius);
  margin: 0;
}

.topic-loading { color: var(--ink-faint); background: var(--paper); }
.topic-lock { color: var(--ink-faint); background: var(--paper); }
.topic-error { color: var(--danger); background: var(--accent-soft); }

.topic-result {
  margin-top: 4px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.topic-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.topic-tag {
  font-size: 12.5px;
  letter-spacing: 0.04em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
}

.topic-headline {
  font-size: 17px;
  line-height: 1.55;
  margin: 0 0 12px;
}

.topic-text {
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink-soft);
  margin: 0 0 18px;
}

.topic-cols { display: grid; gap: 18px; }

.topic-col h4 {
  font-size: 13px;
  letter-spacing: 0.06em;
  margin: 0 0 10px;
  color: var(--ink-faint);
}

.topic-item {
  position: relative;
  padding-left: 18px;
  margin-bottom: 12px;
  font-size: 14.5px;
  line-height: 1.75;
  color: var(--ink-soft);
}

.topic-item::before {
  position: absolute;
  left: 4px;
  top: 0;
}

.topic-col.fav .topic-item::before { content: "＋"; color: var(--mu); }
.topic-col.cau .topic-item::before { content: "－"; color: var(--warn); }

.topic-note:empty { display: none; }
.topic-note > .topic-lock { margin: 0 0 4px; }

/* 选项多到一行放不下时换行（「给谁算」有六项） */
.segmented.wrap { flex-wrap: wrap; }
.segmented.wrap button { flex: 1 1 30%; }

/* ---------- 问题库 ---------- */

.q-groups { display: grid; gap: 18px; margin-bottom: 16px; }

.q-domain {
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--accent);
  margin: 0 0 8px;
}

.q-list { display: grid; gap: 7px; }

.q-btn {
  position: relative;
  width: 100%;
  padding: 12px 14px;
  text-align: left;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}

.q-btn:hover { border-color: var(--accent); }
.q-btn[aria-disabled="true"] { opacity: 0.42; cursor: default; }
.q-btn[data-done="true"] { border-color: var(--accent); background: var(--accent-soft); }

.q-horizon {
  float: right;
  font-size: 12px;
  color: var(--ink-faint);
  margin-left: 10px;
}

.q-note {
  font-size: 13px;
  color: var(--warn);
  margin: 0 0 12px;
}

.topic-note-line {
  font-size: 13px;
  color: var(--ink-faint);
  margin: 0 0 4px;
}

/* ---------- 多命盘切换条 ---------- */

.chart-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  margin: 4px 0 18px;
  padding-bottom: 2px;
}

.chart-tab {
  flex: none;
  padding: 8px 14px;
  font: inherit;
  font-size: 13.5px;
  color: var(--ink-soft);
  background: var(--paper);
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  white-space: nowrap;
}

.chart-tab[aria-pressed="true"] {
  color: #fff;
  background: var(--accent);
  border-color: var(--accent);
}

/* ---------- 门（升舱入口） ---------- */

.door {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--accent-soft) 0%, var(--paper-raised) 60%);
}

.door-lead { color: var(--ink-soft); font-size: 14.5px; margin-bottom: 16px; }

.door-tier {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  padding-bottom: 12px;
  margin-bottom: 14px;
  border-bottom: 1px solid var(--line);
}

.door-name { font-size: 17px; font-weight: 500; color: var(--accent); }
.door-price { font-size: 15px; color: var(--ink-faint); }

.door-gains { margin: 0 0 20px; padding: 0; list-style: none; }

.door-gains li {
  position: relative;
  padding-left: 18px;
  margin-bottom: 9px;
  font-size: 14.5px;
  line-height: 1.7;
  color: var(--ink-soft);
}

.door-gains li::before { content: "＋"; position: absolute; left: 3px; color: var(--accent); }

.door-note {
  margin: 12px 0 0;
  font-size: 12.5px;
  line-height: 1.65;
  color: var(--ink-faint);
  text-align: center;
}

.birth-line {
  font-size: 13px;
  color: var(--ink-faint);
  letter-spacing: 0.02em;
  margin: -6px 0 14px;
}

/* ---------- 可对号的过去（免费层的钩子） ---------- */

.verify {
  border-color: var(--accent);
  background: linear-gradient(180deg, var(--paper-raised) 0%, var(--accent-soft) 100%);
}

.verify-lead {
  color: var(--ink-soft);
  font-size: 15px;
  line-height: 1.75;
  margin-bottom: 18px;
}

.verify-when {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}

.verify-year {
  font-size: 15px;
  font-weight: 500;
  color: var(--accent);
  letter-spacing: 0.03em;
}

.verify-age { font-size: 13px; color: var(--ink-faint); }

.verify-text {
  font-size: 16px;
  line-height: 1.85;
  color: var(--ink);
  margin: 0 0 12px;
}

.verify-ask {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.verify-q {
  font-size: 14.5px;
  color: var(--ink-soft);
  margin: 0 0 12px;
}

.verify-btns { display: flex; gap: 10px; }

.verify-btn {
  flex: 1;
  padding: 11px;
  font: inherit;
  font-size: 14.5px;
  color: var(--ink);
  background: var(--paper-raised);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  cursor: pointer;
}

.verify-btn:hover { border-color: var(--accent); color: var(--accent); }

.verify-thanks {
  font-size: 14px;
  line-height: 1.75;
  color: var(--ink-soft);
  margin: 0;
}

.verify-now {
  margin-top: 22px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.verify-now-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
}

.verify-now-label {
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--accent);
  background: var(--accent-soft);
  padding: 3px 10px;
  border-radius: 999px;
}

.verify-now-headline {
  font-size: 17px;
  line-height: 1.55;
  margin: 0 0 10px;
  color: var(--ink);
}

.verify-now-text {
  font-size: 15px;
  line-height: 1.85;
  color: var(--ink-soft);
  margin: 0 0 12px;
}
