/* 字体都在 /fonts/fonts.css 里自托管，系统字体只作加载前的兜底 */
:root {
  --paper: #e9ebe6;      /* 青白宣纸 */
  --paper-2: #dfe2dc;
  --ink: #26282a;        /* 墨 */
  --ink-soft: #62665f;   /* 淡墨 */
  --rule: #c5c9c1;
  --cinnabar: #9e2b25;   /* 朱砂，庚帖与印章 */
  --cinnabar-deep: #7e1f1b;
  --gold: #d6b87a;       /* 泥金，用在红帖上 */
  --gold-deep: #b8975a;  /* 泥金在浅底上的版本，用于详批边框 */
  --cream: #f4e6cf;      /* 红帖上的字 */
  --celadon: #3f6b60;    /* 青，交互与焦点 */

  --serif: "Noto Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --brush: "Gengtie Brush", "Ma Shan Zheng", "STKaiti", "Kaiti SC", "KaiTi", var(--serif);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--serif);
  font-size: 17px;
  line-height: 1.85;
}

[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--celadon); outline-offset: 3px; }
button { font: inherit; cursor: pointer; }

/* ---------- 顶栏 ---------- */

.topbar { border-bottom: 1px solid var(--rule); }
.topbar-inner {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: stretch;
  gap: 28px;
}

.brand {
  font-family: var(--brush);
  font-size: 22px;
  line-height: 1;
  letter-spacing: .15em;
  color: var(--cream);
  background: var(--cinnabar);
  text-decoration: none;
  padding: 14px 10px 12px 12px;
  align-self: flex-start;
}

nav { display: flex; gap: 24px; }
nav a {
  display: flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-soft);
  text-decoration: none;
  font-size: 16px;
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
  padding-top: 3px;
}
nav a:hover { color: var(--ink); }
nav a[aria-current="page"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--cinnabar); }


/* ---------- 主体 ---------- */

main {
  flex: 1 0 auto;
  width: 100%;
  max-width: 760px;
  margin: 0 auto;
  padding: 48px 20px 40px;
}

h1 {
  font-weight: 600;
  font-size: clamp(30px, 7vw, 42px);
  line-height: 1.35;
  letter-spacing: .02em;
  margin: 0 0 16px;
}

.lede {
  color: var(--ink-soft);
  margin: 0 0 32px;
  max-width: 34em;
}

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


label, legend {
  display: block;
  font-size: 14px;
  color: var(--ink-soft);
  margin-bottom: 6px;
  padding: 0;
}

input[type="date"], input[type="time"] {
  width: 100%;
  font: inherit;
  font-size: 18px;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  padding: 6px 0;
  border-radius: 0;
  min-height: 44px;
}
input[type="time"]:disabled { opacity: .35; }

/* 出生日期：公历 / 农历 */
.date-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 6px; }
.date-head label { margin: 0; }
.cal-toggle { display: flex; border: 1px solid var(--rule); }
.cal-toggle button {
  border: 0;
  background: transparent;
  color: var(--ink-soft);
  font-size: 13px;
  padding: 2px 12px;
  line-height: 1.7;
}
.cal-toggle button[aria-pressed="true"] { background: var(--ink); color: var(--paper); }
.picker-trigger {
  display: block;
  width: 100%;
  min-height: 44px;
  padding: 6px 28px 6px 0;
  font: inherit;
  font-size: 18px;
  text-align: left;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--rule);
  border-radius: 0;
  position: relative;
}
.picker-trigger::after {
  content: "";
  position: absolute;
  right: 6px;
  top: 50%;
  width: 7px;
  height: 7px;
  border-right: 1.5px solid var(--ink-soft);
  border-bottom: 1.5px solid var(--ink-soft);
  transform: translateY(-70%) rotate(45deg);
}
.picker-trigger.is-empty { color: var(--ink-soft); }
.picker-trigger:hover { border-bottom-color: var(--ink); }
.picker-trigger:disabled { opacity: .35; cursor: not-allowed; }

label.check {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 8px 0 0;
  cursor: pointer;
}
label.check input { accent-color: var(--celadon); margin: 0; }


.primary {
  display: inline-block;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: .06em;
  color: #f7ebd6;
  background: var(--cinnabar);
  border: 0;
  padding: 12px 32px;
  text-decoration: none;
  line-height: 1.6;
}
.primary:hover { background: var(--cinnabar-deep); }
.primary:disabled { opacity: .6; cursor: progress; }

.ghost {
  background: transparent;
  border: 1px solid var(--ink);
  color: var(--ink);
  padding: 10px 26px;
  font-size: 16px;
}
.ghost:hover { background: var(--ink); color: var(--paper); }

.form-error {
  grid-column: 1 / -1;
  color: var(--cinnabar);
  margin: 0;
  min-height: 1em;
  font-size: 15px;
}

.form-error { text-align: right; }

/* ---------- 庚帖 ---------- */

.result { margin-top: 56px; }

.chart-meta {
  text-align: center;
  color: var(--ink-soft);
  font-size: 15px;
  margin: 0 0 14px;
  letter-spacing: .06em;
}

.gengtie {
  background: var(--cinnabar);
  color: var(--gold);
  padding: 34px 18px 28px;
  display: flex;
  flex-direction: row;           /* 从左到右：年 月 日 时 */
  justify-content: center;
  gap: clamp(8px, 4vw, 40px);
  box-shadow: inset 0 0 0 6px var(--cinnabar), inset 0 0 0 7px rgba(214, 184, 122, .55);
}

.pillar {
  display: flex;
  flex-direction: column;
  align-items: center;
  width: clamp(64px, 18vw, 96px);
  text-align: center;
}

.pillar-name {
  writing-mode: vertical-rl;
  font-size: 13px;
  letter-spacing: .4em;
  color: rgba(244, 230, 207, .72);
  margin-bottom: 10px;
  height: 3.4em;
}

.shishen { font-size: 13px; color: var(--cream); min-height: 1.6em; }

.gz {
  font-family: var(--brush);
  font-size: clamp(40px, 11vw, 60px);
  line-height: 1.12;
  color: #f7e9cd;
}
.gz-zhi { position: relative; }
.pillar.day .gz-zhi::after {
  content: "";
  position: absolute;
  inset: 4% -8%;
  border: 1.5px solid var(--gold);
  border-radius: 50%;
}

.hide { margin-top: 8px; font-size: 12.5px; line-height: 1.6; min-height: 4.8em; color: rgba(244, 230, 207, .78); } /* 藏干最多三行，统一占位保证各柱对齐 */
.hide b { font-weight: 600; color: var(--cream); }

.nayin {
  writing-mode: vertical-rl;
  margin-top: 12px;
  font-size: 13px;
  letter-spacing: .25em;
  color: var(--gold);
}

.palace-tag { font-size: 12px; line-height: 1.6; height: 1.6em; color: var(--gold); margin-top: 4px; } /* 每柱都占这一行，只有日柱有字 */
.pillar.missing .gz { color: rgba(247, 233, 205, .28); }

.chart-note { font-size: 14px; color: var(--ink-soft); margin: 12px 0 0; text-align: center; }

/* 紧凑版：合婚时两张并排 */
.chart-pair {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
}
.chart-pair figure { margin: 0; min-width: 0; }
.chart-pair figcaption {
  font-size: 15px;
  text-align: center;
  margin-bottom: 8px;
  letter-spacing: .1em;
}
.compact .chart-meta { font-size: 13px; margin-bottom: 8px; }
.compact .gengtie { padding: 22px 8px 18px; gap: 6px; }
.compact .pillar { width: 25%; max-width: 72px; }
.compact .pillar-name { font-size: 12px; margin-bottom: 6px; }
.compact .shishen { font-size: 12px; }
.compact .gz { font-size: clamp(30px, 7vw, 42px); }
.compact .hide { font-size: 11.5px; }
.compact .nayin { font-size: 12px; }
.compact .chart-note { display: none; }

/* 墨迹渐显：唯一的入场动画，从年柱到时柱依次写出 */
@media (prefers-reduced-motion: no-preference) {
  .gengtie.reveal .pillar {
    animation: ink-in .9s cubic-bezier(.2, .7, .2, 1) both;
    animation-delay: calc(var(--i) * 180ms + 120ms);
  }
  @keyframes ink-in {
    from { opacity: 0; filter: blur(6px); transform: translateY(-6px); }
    to   { opacity: 1; filter: blur(0); transform: none; }
  }
}

/* ---------- 排盘详情 ---------- */

.detail { margin-top: 36px; }
.detail dl { margin: 0; }
.detail .row {
  display: grid;
  grid-template-columns: 5.5em 1fr;
  gap: 16px;
  padding: 10px 0;
}
.detail dt { color: var(--ink-soft); font-size: 15px; }
.detail dd { margin: 0; }

.wx-bars { display: grid; gap: 4px; max-width: 360px; }
.wx-bar { display: grid; grid-template-columns: 1.4em 1fr 1.4em; gap: 10px; align-items: center; font-size: 15px; }
.wx-bar i { display: block; height: 8px; background: var(--paper-2); }
.wx-bar i b { display: block; height: 100%; background: var(--ink); }
.wx-bar.zero i b { background: transparent; }

.dayun { display: flex; flex-wrap: wrap; gap: 6px 18px; }
.dayun span { white-space: nowrap; }
.dayun b { font-family: var(--brush); font-weight: 400; font-size: 21px; margin-right: 4px; }
.dayun small { color: var(--ink-soft); font-size: 13px; }

.upsell {
  margin-top: 40px;
  padding: 24px 24px 26px;
  border: 1px solid var(--cinnabar);
  outline: 1px solid var(--cinnabar);
  outline-offset: 3px;
}
.upsell p { margin: 0 0 14px; color: var(--ink-soft); font-size: 15.5px; }
.upsell .upsell-title { color: var(--ink); font-size: 21px; font-weight: 600; margin-bottom: 6px; }

/* ---------- 支付弹窗 ---------- */

.modal {
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;  /* 不用 inset，照顾老内核浏览器 */
  z-index: 100;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(38, 40, 42, .45);
}
.modal-box {
  width: min(420px, 100%);
  padding: 28px 28px 24px;
  background: var(--paper);
  color: var(--ink);
  box-shadow: 0 0 0 1px var(--ink), 0 20px 50px rgba(38, 40, 42, .25);
}
body.modal-open { overflow: hidden; }
.pay-title { margin: 0; font-size: 15px; color: var(--ink-soft); letter-spacing: .1em; }
.pay-amount { margin: 2px 0 18px; font-size: 40px; font-weight: 600; color: var(--cinnabar); line-height: 1.3; }
.pay-summary { margin: 0 0 16px; border-top: 1px solid var(--rule); }
.pay-summary div { display: grid; grid-template-columns: 3.5em 1fr; gap: 12px; padding: 8px 0; border-bottom: 1px solid var(--rule); font-size: 15px; }
.pay-summary dt { color: var(--ink-soft); }
.pay-summary dd { margin: 0; }
.pay-note { font-size: 13.5px; color: var(--ink-soft); margin: 0 0 20px; }
.pay-actions { display: flex; justify-content: flex-end; gap: 12px; }
.pay-actions .primary { padding: 10px 26px; }

/* ---------- 等待 ---------- */

.report { margin-top: 48px; }
.pending { text-align: center; color: var(--ink-soft); }
.pending p { margin: 0 0 12px; font-size: 16px; letter-spacing: .1em; }
.ink-line { width: 160px; height: 2px; margin: 0 auto; background: var(--rule); overflow: hidden; }
.ink-line span { display: block; height: 100%; width: 40%; background: var(--ink); }
@media (prefers-reduced-motion: no-preference) {
  .ink-line span { animation: brush 1.8s ease-in-out infinite; }
  @keyframes brush { from { transform: translateX(-100%); } to { transform: translateX(260%); } }
}
.report-error { color: var(--cinnabar); text-align: center; }

/* ---------- 报告 ---------- */

.demo-note {
  margin: 0 0 28px;
  padding: 12px 16px;
  border: 1px solid var(--gold-deep); box-shadow: inset 0 0 0 3px #efeee6, inset 0 0 0 4px rgba(184, 151, 90, .4); background: #efeee6;
  font-size: 14.5px;
  color: var(--ink-soft);
}

.verdict {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px;
  align-items: start;
  padding-bottom: 12px;
}

.seal {
  width: 112px;
  height: 112px;
  border: 3px solid var(--cinnabar);
  outline: 1px solid var(--cinnabar);
  outline-offset: 3px;
  color: var(--cinnabar);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: rotate(-3deg);
}
.seal-num { font-family: var(--brush); font-size: 54px; line-height: 1; }
.seal-label { font-size: 12px; letter-spacing: .2em; margin-top: 6px; }

.verdict-text { font-size: clamp(22px, 5vw, 27px); font-weight: 600; line-height: 1.5; margin: 0 0 12px; }
.score-reason { margin: 0; color: var(--ink-soft); font-size: 15.5px; }

.block { padding: 28px 0 8px; }

h3 {
  font-size: 15px;
  font-weight: 600;
  color: var(--cinnabar);
  letter-spacing: .15em;
  margin: 0 0 14px;
}

.dims { list-style: none; margin: 0; padding: 0; }
.dims li {
  display: grid;
  grid-template-columns: 5.5em 2.2em 1fr;
  gap: 14px;
  align-items: baseline;
  padding: 12px 0;
}
.dims li:first-child { border-top: 0; padding-top: 0; }
.dim-name { font-weight: 600; }
.dim-level {
  font-family: var(--brush);
  font-size: 20px;
  width: 1.5em;
  height: 1.5em;
  line-height: 1.5em;
  text-align: center;
  border: 1.5px solid currentColor;
}
.dim-level.l-上 { color: var(--cinnabar); }
.dim-level.l-中 { color: var(--celadon); }
.dim-level.l-下 { color: var(--ink-soft); }
.dims p { margin: 0; font-size: 16px; }

.dyn-summary { margin: 0 0 20px; }
.facts { margin: 0; display: grid; gap: 10px; }
.facts div { display: grid; grid-template-columns: 2em 1fr; gap: 12px; }
.facts dt { color: var(--cinnabar); font-family: var(--brush); font-size: 20px; line-height: 1.5; }
.facts dd { margin: 0; }

.timeline { list-style: none; margin: 0; padding: 0; }
.timeline li {
  display: grid;
  grid-template-columns: 6.2em 1fr;
  gap: 16px;
  padding: 14px 0;
}
.timeline li:first-child { border-top: 0; padding-top: 0; }
.tl-year { line-height: 1.3; }
.tl-year b { display: block; font-size: 24px; font-weight: 600; }
.tl-year span { font-family: var(--brush); font-size: 19px; color: var(--ink-soft); }
.tl-strength {
  display: inline-block;
  font-size: 12.5px;
  border: 1px solid currentColor;
  padding: 0 6px;
  margin-right: 8px;
  line-height: 1.6;
  vertical-align: 1px;
}
.tl-strength.s-强 { color: var(--cinnabar); }
.tl-strength.s-中 { color: var(--celadon); }
.tl-strength.s-弱 { color: var(--ink-soft); }
.timeline p { margin: 0; }


.basis { padding: 24px 0; }
.basis summary { cursor: pointer; color: var(--celadon); font-size: 15px; }
.basis-body { font-size: 15px; color: var(--ink-soft); padding-top: 12px; }
.basis-body p { margin: 0 0 8px; }
.basis-body b { color: var(--ink); font-weight: 600; }

.again { margin-top: 32px; }

.site-footer {
  width: 100%;
  max-width: 760px;
  margin: 40px auto 0;
  padding: 16px 20px 20px;
  border-top: 1px solid var(--rule);
  font-size: 13px;
  color: var(--ink-soft);
}
.site-footer p { margin: 0; }

/* ---------- 窄屏 ---------- */

@media (max-width: 600px) {
  .topbar-inner { padding: 0 16px; gap: 18px; }
  nav { gap: 18px; }
  nav a { font-size: 15px; }
  main { padding: 32px 16px 32px; }
  .site-footer { padding: 14px 16px 18px; }
  .gengtie { padding: 26px 8px 22px; }
  .hide { font-size: 11.5px; }
  .chart-pair { grid-template-columns: 1fr; gap: 28px; }
  .compact .gz { font-size: 40px; }
  .verdict { grid-template-columns: 1fr; gap: 20px; }
  .seal { width: 96px; height: 96px; }
  .seal-num { font-size: 46px; }
  .dims li { grid-template-columns: 2.2em 1fr; }
  .dim-name { grid-column: 1 / -1; }
    .timeline li { grid-template-columns: 5em 1fr; gap: 12px; }
}

/* 两张庚帖等高 */
.chart-pair figure, .chart-pair .chart { display: flex; flex-direction: column; }
.chart-pair .chart, .chart-pair .gengtie { flex: 1; }

/* ---------- 紫微命盘 ---------- */

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

.ziwei-section { margin-top: 48px; }
.section-title {
  font-size: 22px;
  font-weight: 600;
  margin: 0 0 6px;
  padding-top: 20px;
}
.zw-note { margin: 0 0 16px; font-size: 13.5px; }

.zw-scroll { overflow-x: auto; margin: 0 -4px; padding: 4px; }
.zw-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, auto);
  border-top: 1px solid var(--ink);
  border-left: 1px solid var(--ink);
  min-width: 340px;
  background: #eef0eb;
}
.zw-cell, .zw-center {
  border-right: 1px solid var(--ink);
  border-bottom: 1px solid var(--ink);
  padding: 6px 7px 5px;
  min-height: 132px;
  display: flex;
  flex-direction: column;
  font-size: 12px;
  line-height: 1.45;
  position: relative;
}
.zw-cell.is-now { background: var(--paper-2); }
.zw-cell.is-ming { box-shadow: inset 0 0 0 2px var(--ink); }
.zw-cell.is-fuqi { box-shadow: inset 0 0 0 2px var(--cinnabar); }

.zw-head { display: flex; justify-content: space-between; align-items: center; }
.zw-head b { font-size: 13px; }
.is-fuqi .zw-head b { color: var(--cinnabar); }
.zw-shen { font-size: 11px; color: var(--paper); background: var(--ink); padding: 0 3px; line-height: 1.4; }

.zw-major { display: flex; flex-direction: column; margin: 4px 0 3px; }
.zw-star { font-family: var(--brush); font-size: 18px; line-height: 1.25; color: var(--ink); white-space: nowrap; }
.zw-star small { font-family: var(--serif); font-size: 10.5px; color: var(--ink-soft); margin-left: 1px; }
.zw-empty { color: var(--ink-soft); font-size: 12px; }

.zw-minor { display: flex; flex-wrap: wrap; gap: 0 6px; }
.zw-lucky { color: var(--celadon); white-space: nowrap; }
.zw-sha { color: var(--ink-soft); white-space: nowrap; }
.zw-lucky small, .zw-sha small { display: none; }

.sh {
  font-style: normal;
  font-family: var(--serif);
  font-size: 10.5px;
  line-height: 1;
  color: var(--cream);
  background: var(--cinnabar);
  padding: 1px 2px;
  margin-left: 2px;
  vertical-align: 2px;
}
.sh-忌 { background: var(--ink); }
.sh-科 { background: var(--celadon); }

.zw-foot { margin-top: auto; display: flex; justify-content: space-between; color: var(--ink-soft); font-size: 11px; padding-top: 4px; }
.zw-gz { font-family: var(--brush); font-size: 14px; color: var(--ink); }

.zw-center {
  grid-row: 2 / 4;
  grid-column: 2 / 4;
  align-items: center;
  justify-content: center;
  text-align: center;
  gap: 6px;
  background: var(--paper);
}
.zw-ju { font-family: var(--brush); font-size: 28px; color: var(--cinnabar); margin: 0; line-height: 1.2; }
.zw-center dl { margin: 0; display: grid; gap: 2px; font-size: 13px; }
.zw-center dl div { display: flex; gap: 8px; justify-content: center; }
.zw-center dt { color: var(--ink-soft); }
.zw-center dd { margin: 0; }
.zw-sihua { margin: 4px 0 0; display: flex; gap: 8px; flex-wrap: wrap; justify-content: center; font-size: 13px; }

.fuqi-read { margin-top: 28px; }
.fuqi-read p { margin: 0 0 8px; font-size: 16px; }
.fuqi-read b { color: var(--ink); }

.pt-title { margin-top: 32px; }
.patterns { list-style: none; margin: 0; padding: 0; }
.patterns li { padding: 12px 0; }
.patterns li:first-child { border-top: 0; padding-top: 0; }
.pt-head { display: flex; align-items: baseline; gap: 10px; }
.pt-head b { font-size: 17px; }
.pt-level { font-size: 12px; border: 1px solid currentColor; padding: 0 5px; line-height: 1.6; }
.pt-excellent, .pt-good { color: var(--cinnabar); }
.pt-neutral { color: var(--celadon); }
.pt-caution { color: var(--ink-soft); }
.patterns p { margin: 6px 0 0; font-size: 15.5px; }
.patterns .pt-src { font-size: 13px; color: var(--ink-soft); margin-top: 2px; }

@media (max-width: 600px) {
  .zw-cell, .zw-center { padding: 4px 4px 3px; min-height: 118px; font-size: 11px; }
  .zw-head b { font-size: 12px; }
  .zw-star { font-size: 15px; }
  .zw-star small { font-size: 9.5px; }
  .zw-ju { font-size: 22px; }
  .zw-center dl { font-size: 12px; }
  .zw-sihua { font-size: 12px; gap: 4px; }
}

/* ---------- 命盘详批 ---------- */

.reading-section { margin-top: 48px; }

.locked {
  margin: 16px 4px 0;
  padding: 22px 24px 22px;
  background: #efeee6;
  border: 1px solid var(--gold-deep);
  outline: 1px solid var(--gold-deep);
  outline-offset: 4px;
}
.locked-lede { margin: 0 0 12px; color: var(--ink-soft); font-size: 15.5px; }
.locked-list { list-style: none; margin: 0 0 20px; padding: 0; }
.locked-list li {
  display: grid;
  grid-template-columns: 5em 1fr;
  gap: 12px;
  padding: 8px 0;
  font-size: 15.5px;
}
.locked-list li:first-child { border-top: 0; }
.locked-list b { font-weight: 600; }
.locked-list span { color: var(--ink-soft); }
.locked .form-error { margin-top: 10px; }

#readingPending { margin: 32px 0; }

.reading { margin-top: 12px; }
.rd-title { font-size: clamp(22px, 5vw, 27px); font-weight: 600; line-height: 1.5; margin: 0 0 12px; }

.rd-overview { margin: 0 0 8px; }

.domains { margin-top: 8px; }
.domain { padding: 24px 0 8px; }
.domain-head { display: flex; align-items: center; gap: 12px; margin-bottom: 10px; }
.domain-head h3 { margin: 0; font-size: 20px; color: var(--ink); letter-spacing: .1em; }
.domain-text { margin: 0 0 12px; }
.domain-extra { margin: 0 0 6px; display: grid; grid-template-columns: 5em 1fr; gap: 12px; font-size: 16px; }
.domain-extra b { color: var(--ink-soft); font-weight: 400; font-size: 15px; }
.domain-advice { margin: 12px 0 0; padding: 10px 14px; border: 1px solid var(--gold-deep); box-shadow: inset 0 0 0 3px #efeee6, inset 0 0 0 4px rgba(184, 151, 90, .4); background: #efeee6; font-size: 16px; }
.domain-advice:empty { display: none; }

.liunian { list-style: none; margin: 0; padding: 0; }
.liunian li { padding: 14px 0; }
.liunian li:first-child { border-top: 0; padding-top: 0; }
.ln-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 8px; }
.ln-head b { font-size: 26px; font-weight: 600; }
.ln-gz { font-family: var(--brush); font-size: 22px; color: var(--ink-soft); }
.ln-key { font-size: 13px; color: var(--cinnabar); border: 1px solid currentColor; padding: 0 6px; line-height: 1.6; }
.liunian dl { margin: 0; display: grid; gap: 4px; }
.liunian dl div { display: grid; grid-template-columns: 3em 1fr; gap: 12px; font-size: 16px; }
.liunian dt { color: var(--ink-soft); font-size: 15px; }
.liunian dd { margin: 0; }

.rd-advice { margin: 0; padding-left: 1.1em; }
.rd-advice li { margin-bottom: 10px; }
.rd-advice li::marker { color: var(--cinnabar); }

@media (max-width: 600px) {
  .locked { padding: 18px 16px; }
  .locked-list li { grid-template-columns: 4.2em 1fr; }
  .domain-extra { grid-template-columns: 4.5em 1fr; }
}

.rd-keywords { font-family: var(--brush); font-size: 26px; line-height: 1.6; margin: 0 0 12px; }
.rd-keywords span { white-space: nowrap; }
.rd-keywords span + span::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 5px;
  background: var(--cinnabar);
  transform: rotate(45deg);
  vertical-align: middle;
  margin: 0 .6em;
}


/* ---------- 滚轮选择器 ---------- */

.picker {
  --row: 44px;
  position: fixed;
  top: 0; right: 0; bottom: 0; left: 0;
  z-index: 110;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  background: rgba(38, 40, 42, .45);
}
.picker-sheet {
  width: min(440px, 100%);
  background: var(--paper);
  box-shadow: 0 0 0 1px var(--ink), 0 20px 50px rgba(38, 40, 42, .25);
}
.picker-head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 8px;
  padding: 10px 12px;
  border-bottom: 1px solid var(--rule);
}
.picker-title { text-align: center; line-height: 1.4; }
.picker-title p { margin: 0; }
#pickerTitle { font-size: 13px; color: var(--ink-soft); }
.picker-preview { font-size: 16px; font-weight: 600; min-height: 1.4em; }
.picker-btn {
  border: 0;
  background: transparent;
  font-size: 16px;
  padding: 8px 10px;
  color: var(--ink-soft);
}
.picker-ok { color: var(--cinnabar); font-weight: 600; }

.picker-body { position: relative; height: calc(var(--row) * 5); }
.picker-cols { display: flex; height: 100%; }
.picker-col {
  flex: 1;
  height: 100%;
  overflow-y: auto;
  scroll-snap-type: y mandatory;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-width: none;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 32%, #000 68%, transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 32%, #000 68%, transparent);
}
.picker-col::-webkit-scrollbar { display: none; }
.picker-col:focus-visible { outline: none; background: rgba(63, 107, 96, .06); }
.picker-col ul {
  list-style: none;
  margin: 0;
  padding: calc(var(--row) * 2) 0;
}
.picker-col li {
  height: var(--row);
  line-height: var(--row);
  text-align: center;
  font-size: 18px;
  color: var(--ink-soft);
  scroll-snap-align: center;
  cursor: pointer;
  white-space: nowrap;
  -webkit-user-select: none;
  user-select: none;
}
.picker-col li[aria-selected="true"] { color: var(--ink); font-weight: 600; }
.picker-band {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(var(--row) * 2);
  height: var(--row);
  border-top: 1px solid var(--gold-deep);
  border-bottom: 1px solid var(--gold-deep);
  pointer-events: none;
}

@media (max-width: 600px) {
  .picker { align-items: flex-end; padding: 0; }
  .picker-sheet { width: 100%; box-shadow: 0 -1px 0 var(--ink); padding-bottom: env(safe-area-inset-bottom); }
  .picker-body { height: calc(var(--row) * 5); }
  .picker-col li { font-size: 17px; }
}

/* ---------- 排盘结果：标签页 ---------- */

.result-tabs { display: flex; gap: 0; border-bottom: 1px solid var(--rule); margin-bottom: 28px; }
.result-tabs button {
  border: 0;
  background: transparent;
  font-size: 17px;
  padding: 10px 22px;
  color: var(--ink-soft);
  border-bottom: 3px solid transparent;
  margin-bottom: -1px;
}
.result-tabs button[aria-selected="true"] { color: var(--ink); font-weight: 600; border-bottom-color: var(--cinnabar); }

/* ---------- 五行配色（专业排盘惯例：木绿 火红 土棕 金橙 水蓝） ---------- */

:root { --wx-mu: #2e8b4a; --wx-huo: #c8322b; --wx-tu: #9a6a2c; --wx-jin: #d08400; --wx-shui: #1f5fae; }
.wx-mu { color: var(--wx-mu); }
.wx-huo { color: var(--wx-huo); }
.wx-tu { color: var(--wx-tu); }
.wx-jin { color: var(--wx-jin); }
.wx-shui { color: var(--wx-shui); }
.wx-bar i b.bg-wx-mu { background: var(--wx-mu); }
.wx-bar i b.bg-wx-huo { background: var(--wx-huo); }
.wx-bar i b.bg-wx-tu { background: var(--wx-tu); }
.wx-bar i b.bg-wx-jin { background: var(--wx-jin); }
.wx-bar i b.bg-wx-shui { background: var(--wx-shui); }

/* ---------- 专业四柱表 ---------- */

.table-scroll { overflow-x: auto; }
.pro-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 15px;
  text-align: center;
  min-width: 330px;
  background: #f1f2ee;
}
.pro-table th, .pro-table td { padding: 7px 4px; vertical-align: middle; border-bottom: 1px solid #e2e4df; }
.pro-table thead th { font-size: 15px; color: var(--ink); font-weight: 600; background: #e6e8e3; border-bottom: 0; padding: 9px 4px; }
.pro-table thead th:first-child { color: var(--ink-soft); font-weight: 400; }
.pro-table tbody th { text-align: left; padding-left: 10px; font-size: 14px; color: var(--ink-soft); font-weight: 400; white-space: nowrap; width: 3.4em; }
.pro-table tr.row-ss td { text-decoration: underline; text-decoration-color: var(--rule); text-underline-offset: 4px; }
.pro-table tr.row-gz th, .pro-table tr.row-gz td { background: #e9ebe6; border-bottom: 0; padding-top: 2px; padding-bottom: 2px; }
.pt-gz { font-family: var(--serif); font-weight: 600; font-size: 34px; line-height: 1.3; }
.pt-hide { font-size: 14px; line-height: 1.75; white-space: nowrap; }
.pt-hide span { font-weight: 600; margin-right: 2px; }
.pro-table td.is-shen { vertical-align: top; }
.pt-shen { font-size: 13px; line-height: 1.8; white-space: nowrap; }

/* 细盘表：流年、大运两列与原局之间加分隔 */
.xp-table th.is-flow, .xp-table td.is-flow { background-color: #eceadf; }
.xp-table tr.row-gz td.is-flow { background: #e4e2d4; }
.xp-table .is-sep { border-left: 2px solid var(--gold-deep); }

.info-list { margin-top: 28px; }
.info-list .row { display: grid; grid-template-columns: 5.5em 1fr; gap: 16px; padding: 8px 0; }
.info-list dt { color: var(--ink-soft); font-size: 15px; }
.info-list dd { margin: 0; }

.rel-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 6px; }
.rel-list li { font-size: 15.5px; }
.rel-tag {
  display: inline-block;
  min-width: 2.6em;
  text-align: center;
  font-size: 12px;
  border: 1px solid currentColor;
  padding: 0 4px;
  margin-right: 8px;
  line-height: 1.6;
  vertical-align: 1px;
  color: var(--ink-soft);
}
.rel-合, .rel-三合, .rel-半合, .rel-三会, .rel-暗合 { color: var(--celadon); }
.rel-冲, .rel-刑, .rel-害, .rel-破 { color: var(--cinnabar); }

/* ---------- 命局要点 / 命局定调 ---------- */

.mj { margin-top: 36px; }
.mj h3, .dingdiao h3 { margin-bottom: 4px; }
.mj-list { margin-top: 8px; }
.mj-flags { display: flex; flex-wrap: wrap; gap: 6px 10px; margin-bottom: 6px; }
.mj-flag { font-size: 13px; border: 1px solid var(--rule); padding: 0 8px; line-height: 1.8; color: var(--ink-soft); }
.mj-flag.is-yes { border-color: var(--celadon); color: var(--celadon); }
.mj-line { margin: 2px 0 0; font-size: 15.5px; }
.mj-note { margin: 10px 0 0; font-size: 13px; color: var(--ink-soft); }

.dingdiao { padding: 18px 20px 16px; margin-bottom: 28px; border: 1px solid var(--gold-deep); box-shadow: inset 0 0 0 3px #efeee6, inset 0 0 0 4px rgba(184, 151, 90, .4); background: #efeee6; }
.dingdiao .info-list { margin-top: 6px; }
.dingdiao .info-list .row:first-child { border-top: 0; }
.dd-chip { display: inline-block; font-size: 14px; border: 1px solid var(--ink-soft); padding: 0 8px; margin: 0 6px 4px 0; line-height: 1.8; color: var(--ink-soft); }
.dd-chip.is-xi { border-color: var(--cinnabar); color: var(--cinnabar); font-weight: 600; }
.dd-reason { margin: 8px 0 0; font-size: 15.5px; }


/* ---------- 细盘：大运 / 流年 / 流月 / 流日 ---------- */

.xp-rels { margin: 14px 0 0; padding: 12px 14px; background: #efeee6; border: 1px solid rgba(184, 151, 90, .5); }
.xp-rel { margin: 0 0 6px; font-size: 14.5px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; }
.xp-rel:last-child { margin-bottom: 0; }
.xp-rel b { font-weight: 600; min-width: 5.5em; }
.xp-rel-item.is-bad { color: var(--wx-huo); }
.xp-rel-item.is-good { color: var(--wx-mu); }

.xp-board { margin-top: 18px; display: grid; gap: 10px; }
.xp-row { display: grid; grid-template-columns: 34px 1fr; background: #f1f2ee; min-height: 112px; }
.xp-label {
  writing-mode: vertical-rl;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .3em;
  border-right: 1px solid #e2e4df;
}
.xp-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; scrollbar-width: thin; }
.xp-strip { display: flex; width: max-content; min-height: 100%; }
.xp-wait { padding: 16px; font-size: 14px; }
.xp-cell {
  position: relative;
  width: 58px;
  flex: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  gap: 0;
  padding: 18px 0 8px;
  font: inherit;
  color: var(--ink);
  background: transparent;
  border: 0;
  border-right: 1px solid #e2e4df;
  cursor: pointer;
}
.xp-cell:hover { background: #e9ebe6; }
.xp-cell.is-on { background: #dcded8; }
.xp-cell.is-now .xp-top { color: var(--cinnabar); font-weight: 600; }
.xp-top { font-size: 12.5px; color: var(--ink-soft); white-space: nowrap; }
.xp-g { position: relative; line-height: 1.15; }
.xp-char { font-family: var(--serif); font-weight: 600; font-size: 24px; }
.xp-g sup, .xp-g sub {
  position: absolute;
  left: 100%;
  font-size: 11px;
  font-weight: 600;
  color: var(--wx-huo);
  line-height: 1;
  margin-left: 1px;
}
.xp-g sup { top: 0; }
.xp-g sub { bottom: 2px; }
.xp-bottom { font-size: 11.5px; color: var(--ink-soft); margin-top: 3px; white-space: nowrap; }
.xp-xiao { cursor: default; color: var(--ink-soft); }
.xp-xiao:hover { background: transparent; }
.xp-xiao-text { font-size: 17px; writing-mode: vertical-rl; letter-spacing: .3em; margin: 4px 0; }

.xp-tag {
  position: absolute;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  font-size: 10.5px;
  line-height: 1.5;
  padding: 0 5px;
  color: #fff;
  white-space: nowrap;
}
.xp-tag.is-clash { background: var(--wx-huo); }
.xp-tag.is-he { background: var(--wx-mu); }
.xp-tag-inline { position: static; transform: none; display: inline-block; vertical-align: 1px; }
.xp-legend { font-size: 13px; margin: 10px 0 0; }

.xp-dayinfo { padding: 10px 14px; background: #efeee6; font-size: 14.5px; }

@media (max-width: 600px) {
  .pro-table { font-size: 13.5px; }
  .pro-table tbody th { padding-left: 6px; font-size: 12.5px; }
  .pt-gz { font-size: 28px; }
  .pt-hide { font-size: 12.5px; }
  .pt-shen { font-size: 11.5px; }
  .xp-table .pt-gz { font-size: 24px; }
  .xp-table .pt-hide { font-size: 11.5px; }
  .xp-cell { width: 52px; }
  .xp-char { font-size: 21px; }
}


/* ---------- 首页：新中式·宣纸（白卡单线金边、四角角花、宋体标签） ---------- */

:root {
  --ui: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  --gold-fill: #c29a52;
  --gold-ink: #8f6d31;
  --gold-line: #cfb27a;
}

.home-grid { display: grid; grid-template-areas: "head" "form" "offer"; }
.home-head { grid-area: head; }
.home-grid .tie-form { grid-area: form; }
.home-grid .home-offer { grid-area: offer; }
.home-title { font-size: clamp(28px, 7vw, 38px); line-height: 1.3; margin-bottom: 8px; }
.home-lede { color: var(--ink-soft); margin: 0 0 24px; font-size: 15px; }

@media (min-width: 760px) {
  .home-grid { grid-template-columns: 1fr 400px; grid-template-rows: auto 1fr; grid-template-areas: "head form" "offer form"; column-gap: 48px; }
  .home-grid .tie-form { align-self: start; }
  .home-grid .home-offer { align-self: start; }
  .home-head { padding-top: 12px; }
}
@media (min-width: 1040px) {
  .home-grid { margin: 0 -100px; grid-template-columns: 1fr 420px; column-gap: 64px; }
}

/* 标题后一枚朱砂小印，红色只在这里点缀 */
.title-seal {
  display: inline-block;
  width: 1.3em;
  height: 1.3em;
  margin-left: .15em;
  vertical-align: -.22em;
  transform: rotate(-6deg);
}
.title-seal svg { display: block; width: 100%; height: 100%; }

.tie-form {
  /* 默认金色（八字排盘）；.is-red 为朱砂红（正缘测算） */
  --tie-line: var(--gold-line);
  --tie-fill: var(--gold-fill);
  --tie-fill-hover: #b28a44;
  --tie-ink: var(--gold-ink);
  position: relative;
  font-family: var(--serif);
  background: #fffdf8;
  border: 1px solid var(--tie-line);
  padding: 26px 22px 22px;
  display: grid;
  gap: 20px;
}
.tie-form :focus-visible { outline: 2px solid var(--tie-fill); outline-offset: 2px; }
.tie-form .corner { position: absolute; width: 14px; height: 14px; border: 0 solid var(--tie-fill); pointer-events: none; }
.tie-form .tl { top: 5px; left: 5px; border-width: 1.5px 0 0 1.5px; }
.tie-form .tr { top: 5px; right: 5px; border-width: 1.5px 1.5px 0 0; }
.tie-form .bl { bottom: 5px; left: 5px; border-width: 0 0 1.5px 1.5px; }
.tie-form .br { bottom: 5px; right: 5px; border-width: 0 1.5px 1.5px 0; }

/* 性别 */
.tie-gender { margin: 0; padding: 0; border: 1px solid var(--tie-line); display: grid; grid-template-columns: 1fr 1fr; }
.tie-gender label { margin: 0; cursor: pointer; }
.tie-gender input { position: absolute; opacity: 0; }
.tie-gender span {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 6px;
  padding: 10px 0;
  font-size: 17px;
  color: var(--tie-ink);
}
.tie-gender span small { font-size: 12.5px; opacity: .85; }
.tie-gender input:checked + span { background: var(--tie-fill); color: #fff; }
.tie-gender input:focus-visible + span { outline: 2px solid var(--tie-ink); outline-offset: -3px; }

/* 日期、时间 */
.tie-field .date-head { margin-bottom: 4px; }
.tie-field .date-head label { font-size: 14.5px; color: var(--tie-ink); letter-spacing: .25em; margin: 0; }
.tie-form .cal-toggle { border: 1px solid var(--tie-line); }
.tie-form .cal-toggle button { font-size: 12.5px; padding: 1px 11px; color: var(--tie-ink); }
.tie-form .cal-toggle button[aria-pressed="true"] { background: var(--tie-fill); color: #fff; }

.tie-form .picker-trigger {
  background: transparent;
  border: 0;
  border-bottom: 1px solid var(--tie-line);
  border-radius: 0;
  padding: 10px 30px 10px 2px;
  font-size: 19px;
  color: var(--ink);
}
.tie-form .picker-trigger.is-empty { color: #a39a88; }
.tie-form .picker-trigger:hover { border-bottom-color: var(--tie-ink); }
.tie-form .picker-trigger::after { right: 6px; border-color: var(--tie-ink); }
.tie-form .picker-trigger:disabled { opacity: .45; }
.tie-form label.check { color: var(--ink-soft); margin-top: 10px; font-size: 14px; }
.tie-form label.check input { accent-color: var(--tie-fill); }

.tie-foot { display: grid; gap: 8px; margin-top: 2px; }
.tie-foot .form-error { color: var(--cinnabar); font-size: 14px; min-height: 0; text-align: left; }
.tie-foot .form-error:empty { display: none; }
.tie-submit {
  width: 100%;
  font-family: var(--serif);
  font-size: 18px;
  font-weight: 600;
  letter-spacing: .5em;
  text-indent: .5em;
  color: #fff;
  background: var(--tie-fill);
  border: 0;
  padding: 13px 0;
  transition: background .15s;
}
.tie-submit:hover { background: var(--tie-fill-hover); }
.tie-submit:disabled { opacity: .6; cursor: progress; }

.tie-form.is-red {
  --tie-line: #dba69d;
  --tie-fill: #b3281f;
  --tie-fill-hover: #97211a;
  --tie-ink: #9e2b25;
  background: #fffaf7;
}

/* 合婚：男方、女方两段，中间一枚“合”字圆印 */
.tie-person { display: grid; gap: 14px; }
.tie-who { margin: 0; font-size: 18px; font-weight: 600; color: var(--ink); display: flex; align-items: baseline; gap: 8px; }
.tie-who small { font-size: 13px; font-weight: 400; color: var(--tie-ink); letter-spacing: .2em; }
.tie-he { position: relative; height: 32px; display: grid; place-items: center; }
.tie-he::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; border-top: 1px dashed var(--tie-line); }
.tie-he span {
  position: relative;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: var(--tie-fill);
  color: #fbf1e2;
  font-family: var(--brush);
  font-size: 18px;
  line-height: 32px;
  text-align: center;
  box-shadow: 0 0 0 4px #fffaf7;
}

.home-offer { margin: 18px 0 0; font-size: 14px; color: var(--ink-soft); line-height: 1.8; }
.home-offer a { color: var(--gold-ink); }

@media (max-width: 600px) {
  .tie-form { padding: 24px 18px 20px; gap: 18px; }
}

/* ---------- 合婚：两人命盘对照、在一起之后 ---------- */

.duo { margin-top: 28px; }
.duo h3 { margin-bottom: 10px; }
.duo-table { width: 100%; border-collapse: collapse; font-size: 14.5px; background: #f1f2ee; min-width: 330px; }
.duo-table th, .duo-table td { padding: 9px 8px; border-bottom: 1px solid #e2e4df; text-align: left; vertical-align: middle; }
.duo-table thead th { background: #e6e8e3; font-weight: 600; font-size: 14px; }
.duo-table tbody th { width: 4.6em; color: var(--ink-soft); font-weight: 400; font-size: 13px; white-space: nowrap; }
.duo-bazi { display: inline-flex; gap: 8px; font-size: 18px; font-weight: 600; }
.duo-bazi > span { display: inline-flex; flex-direction: column; line-height: 1.15; }
.duo-wx { display: inline-flex; flex-wrap: wrap; gap: 2px 10px; font-size: 13.5px; }
.duo-wx i { font-style: normal; font-weight: 600; margin-right: 2px; }
.duo-wx .is-zero { opacity: .45; }
.duo-note { font-size: 12.5px; margin: 8px 0 0; }

.together { margin: 0; display: grid; gap: 14px; }
.together > div { display: grid; grid-template-columns: 3.6em 1fr; gap: 14px; }
.together dt { font-weight: 600; font-size: 15.5px; color: var(--cinnabar); display: flex; flex-direction: column; gap: 6px; }
.together dd { margin: 0; font-size: 16px; line-height: 1.85; }
.tg-trend { align-self: flex-start; font-size: 11.5px; font-weight: 400; padding: 0 6px; line-height: 1.7; border: 1px solid currentColor; }
.trend-更好 { color: var(--wx-mu); }
.trend-持平 { color: var(--gold-ink); }
.trend-需经营 { color: var(--cinnabar); }

.frictions, .suggestions { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.frictions li, .suggestions li { display: grid; grid-template-columns: 5.6em 1fr; gap: 12px; align-items: baseline; padding-bottom: 6px; }
.frictions li:last-child, .suggestions li:last-child { border-bottom: 0; padding-bottom: 0; }
.frictions b, .suggestions b { font-weight: 600; font-size: 15px; }
.frictions b { color: var(--cinnabar); }
.suggestions b { color: var(--wx-mu); }
.frictions p, .suggestions p { margin: 0; font-size: 15.5px; line-height: 1.8; }

@media (max-width: 600px) {
  .duo-table { font-size: 13px; }
  .duo-bazi { font-size: 16px; gap: 6px; }
  .frictions li, .suggestions li { grid-template-columns: 1fr; gap: 2px; }
  .together > div { grid-template-columns: 3.2em 1fr; gap: 10px; }
}

/* ---------- 推算另一半 ---------- */
.partner .verdict { grid-template-columns: 1fr; }
.keywords { display: flex; flex-wrap: wrap; gap: 8px; margin: 0 0 14px; }
.keywords span { font-size: 13.5px; color: var(--cinnabar); border: 1px solid currentColor; padding: 1px 10px; line-height: 1.8; }
.portrait > div { grid-template-columns: 4.8em 1fr; }
.meet-where { margin: 0 0 10px; font-size: 18px; font-weight: 600; color: var(--cinnabar); }
.meet-text, .together-text { margin: 0; font-size: 16px; line-height: 1.85; }
.basis-table tbody th { width: 5.6em; }
.basis-table td { line-height: 1.6; }
.partner .upsell { margin: 36px 0 28px; }
.upsell-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.upsell-actions .ghost { text-decoration: none; display: inline-block; line-height: 1.6; }
@media (max-width: 640px) {
  .portrait > div { grid-template-columns: 4.4em 1fr; }
}

/* 付费后生成失败：重新生成 */
.retry-box { text-align: center; padding: 28px 16px 8px; }
.retry-box .report-error { margin: 0 0 6px; }
.retry-note { margin: 0 0 18px; color: var(--ink-soft); font-size: 14px; }

/* ---------- 命盘详批：身强身弱、格局、运势曲线 ---------- */
.rd-sec { padding: 28px 0 8px; }
.rd-sec h3 { margin: 0 0 14px; }

.st-scale { list-style: none; margin: 0 0 18px; padding: 0; display: grid; grid-template-columns: repeat(7, 1fr); border: 1px solid var(--gold-deep); }
.st-scale li { text-align: center; font-size: 14px; padding: 8px 0; color: var(--ink-soft); border-left: 1px solid #d9ccb0; line-height: 1.4; }
.st-scale li:first-child { border-left: 0; }
.st-scale li.is-on { background: var(--cinnabar); color: #f7ebd6; font-weight: 600; }
.st-factors { list-style: none; margin: 0 0 14px; padding: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 10px 20px; }
.st-factors li { display: grid; grid-template-columns: 4.2em 1fr; gap: 8px; align-items: baseline; }
.st-factors b { font-weight: 600; font-size: 15.5px; display: inline-flex; align-items: baseline; gap: 6px; }
.st-factors i { font-style: normal; font-size: 12px; font-weight: 400; padding: 0 4px; line-height: 1.6; border: 1px solid var(--rule); color: var(--ink-soft); }
.st-factors .is-ok i { border-color: var(--celadon); color: var(--celadon); }
.st-factors p { margin: 0; font-size: 15px; line-height: 1.7; color: var(--ink-soft); }
.st-text { margin: 0; }

.gj-head { display: flex; align-items: center; gap: 14px; margin-bottom: 4px; }
.gj-name { margin: 0; font-family: var(--brush); font-size: clamp(34px, 8vw, 44px); line-height: 1.2; color: var(--ink); letter-spacing: .06em; }
.gj-status { font-size: 14px; padding: 2px 8px; border: 2px solid currentColor; transform: rotate(-4deg); letter-spacing: .1em; font-weight: 600; }
.gs-成格 { color: var(--cinnabar); }
.gs-有救 { color: var(--gold-deep); }
.gs-破格 { color: var(--ink-soft); }
.gj-base { margin: 0 0 14px; font-size: 14.5px; color: var(--ink-soft); }
.gj-image { margin: 0 0 16px; padding: 12px 16px; border: 1px solid var(--gold-deep); box-shadow: inset 0 0 0 3px #efeee6, inset 0 0 0 4px rgba(184, 151, 90, .4); background: #efeee6; font-size: 17.5px; color: var(--ink); }
.gj-image:empty { display: none; }
.gj-text { margin: 0; }

.rd-curve .curve-summary { margin: 0 0 10px; font-size: 17.5px; font-weight: 600; }
.curve { width: 100%; }
.cv-svg { display: block; overflow: visible; }
.cv-grid { stroke: #d5d8d0; stroke-dasharray: 3 4; }
.cv-line { fill: none; stroke: var(--gold-deep); stroke-width: 2.2; }
.cv-hit { fill: transparent; cursor: pointer; }
.cv-stem { stroke: transparent; stroke-width: 1; }
.cv-dot { fill: var(--paper); stroke: var(--gold-deep); stroke-width: 2; }
.cv-pt { cursor: pointer; outline: none; }
.cv-pt.is-sel .cv-stem { stroke: var(--gold-deep); stroke-dasharray: 2 3; }
.cv-pt.is-sel .cv-dot { fill: var(--gold-deep); }
.cv-pt.is-now .cv-dot { stroke: var(--cinnabar); }
.cv-pt.is-now.is-sel .cv-dot { fill: var(--cinnabar); }
.cv-pt:focus-visible .cv-dot { stroke: var(--celadon); stroke-width: 3; }
.cv-label { font-size: 12px; fill: var(--ink-soft); font-family: var(--serif); }
.cv-sub { font-size: 13px; fill: var(--ink); font-family: var(--serif); }
.cv-tag { font-size: 12px; fill: var(--ink-soft); font-family: var(--serif); }
.cv-tag.is-hi { fill: var(--gold-deep); font-weight: 600; }
.cv-now { font-size: 12px; fill: var(--cinnabar); font-weight: 600; font-family: var(--serif); }
.curve-detail { margin-top: 8px; padding: 14px 16px; border: 1px solid var(--gold-deep); box-shadow: inset 0 0 0 3px #efeee6, inset 0 0 0 4px rgba(184, 151, 90, .4); background: #efeee6; }
.cd-head { margin: 0 0 4px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 12px; font-size: 14.5px; color: var(--ink-soft); }
.cd-head b { font-size: 17px; color: var(--ink); }
.cd-score { margin-left: auto; color: var(--gold-deep); font-weight: 600; }
.cd-text { margin: 0; font-size: 16px; }
.cd-key { font-weight: 600; margin-right: 8px; color: var(--cinnabar); }
.curve-sub { margin: 26px 0 4px; font-size: 16px; font-weight: 600; color: var(--ink-soft); letter-spacing: .1em; }

.rd-message { margin: 32px 0 8px; padding: 22px 22px 20px; border: 1px solid var(--gold-deep); box-shadow: inset 0 0 0 3px #efeee6, inset 0 0 0 4px rgba(184, 151, 90, .4); background: #efeee6; }
.rd-message h3 { margin: 0 0 10px; }
.msg-text { margin: 0; font-size: 17.5px; line-height: 2; }

.locked-curve { margin: 0 0 14px; position: relative; }
.locked-curve svg { display: block; width: 100%; height: 72px; filter: blur(1.5px); opacity: .85; }
.locked-curve figcaption { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; font-size: 14px; color: var(--ink-soft); letter-spacing: .15em; }

@media (max-width: 640px) {
  .st-scale li { font-size: 12.5px; }
  .st-factors { grid-template-columns: 1fr; }
}
.rd-sec + .dingdiao { margin-top: 28px; }

/* ---------- 已购复用、保存结果 ---------- */
.reuse-note { margin: 0 0 18px; padding: 10px 14px; font-size: 15px; color: var(--celadon); border: 1px solid var(--gold-deep); box-shadow: inset 0 0 0 3px #efeee6, inset 0 0 0 4px rgba(184, 151, 90, .4); background: #efeee6; }
.save-bar { margin: 36px 0 8px; text-align: center; }
.save-title { margin: 0 0 12px; font-size: 15px; color: var(--ink-soft); letter-spacing: .1em; }
.save-btns { display: flex; justify-content: center; flex-wrap: wrap; gap: 12px; }
.save-btns .ghost { min-width: 9em; }
.save-status { margin: 10px 0 0; min-height: 1.6em; font-size: 14px; color: var(--ink-soft); }
.save-box { max-width: 460px; }
.save-img { max-height: 58vh; overflow: auto; border: 1px solid var(--rule); background: var(--paper); }
.save-img img { display: block; width: 100%; height: auto; }
.save-tip { margin: 10px 0 14px; font-size: 14px; color: var(--ink-soft); }
.save-box .pay-actions a.primary { text-decoration: none; }
.cap-head { display: flex; align-items: baseline; flex-wrap: wrap; gap: 4px 14px; padding-bottom: 14px; margin-bottom: 18px; border-bottom: 2px solid var(--cinnabar); }
.cap-head b { font-family: var(--brush); font-weight: 400; font-size: 30px; color: var(--cinnabar); }
.cap-head span { font-size: 20px; font-weight: 600; }
.cap-head small { flex-basis: 100%; font-size: 14px; color: var(--ink-soft); }
.cap-foot { margin: 28px 0 0; padding-top: 12px; border-top: 1px solid var(--rule); font-size: 13px; color: var(--ink-soft); text-align: center; }

/* ---------- 邮箱 ---------- */
.pay-email { margin: 0 0 14px; }
.pay-email label { display: flex; align-items: baseline; gap: 8px; font-size: 15px; margin-bottom: 6px; }
.pay-email small { font-size: 12.5px; color: var(--ink-soft); }
.pay-email input, .email-field input {
  width: 100%; font: inherit; font-size: 16px; padding: 9px 12px; color: var(--ink);
  background: #f4f5f1; border: 1px solid var(--rule); border-radius: 0;
}
.pay-email input:focus, .email-field input:focus { outline: 2px solid var(--celadon); outline-offset: 0; border-color: var(--celadon); }
.pay-email-error { margin: 4px 0 0; min-height: 1.2em; font-size: 13px; color: var(--cinnabar); }
.pay-email-error:empty { min-height: 0; margin: 0; }
.pay-actions { flex-wrap: wrap; }
.email-row { max-width: 440px; margin: 18px auto 0; }
.email-field { display: flex; gap: 8px; }
.email-field input { flex: 1; min-width: 0; }
.email-field .primary { padding: 9px 18px; font-size: 15px; white-space: nowrap; }

/* ---------- 紫微完整命盘 ---------- */
.zf { --h-lu: #2e8b4a; --h-quan: #8a3fa0; --h-ke: #1f5fae; --h-ji: #26282a; }
.zf-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  grid-template-rows: repeat(4, minmax(170px, auto));
  border-top: 1px solid #a7aaa2;
  border-left: 1px solid #a7aaa2;
  min-width: 348px;
  background: #eef0eb;
}
.zf-cell, .zf-center {
  border-right: 1px solid #a7aaa2;
  border-bottom: 1px solid #a7aaa2;
  padding: 4px 4px 3px;
  display: flex;
  flex-direction: column;
  min-width: 0;
  position: relative;
}
.zf-cell { cursor: pointer; outline: none; }
.zf-cell:focus-visible { box-shadow: inset 0 0 0 2px var(--celadon); }
.zf-cell.is-tri { background: #e6e3d6; }
.zf-cell.is-sel { background: #f3ead2; box-shadow: inset 0 0 0 2px var(--gold-deep); }
.zf-cell.is-dec::before, .zf-cell.is-yr::after {
  content: ''; position: absolute; left: 0; right: 0; height: 3px;
}
.zf-cell.is-dec::before { top: 0; background: var(--h-lu); }
.zf-cell.is-yr::after { bottom: 0; background: var(--h-ke); }

/* 星曜竖排，从右往左一列一颗 */
.zf-stars { display: flex; flex-direction: row-reverse; flex-wrap: wrap; align-content: flex-start; gap: 3px 1px; flex: 1; }
.zf-s { display: flex; flex-direction: column; align-items: center; line-height: 1.05; }
.zf-s b { writing-mode: vertical-rl; text-orientation: upright; letter-spacing: -.5px; font-weight: 400; }
.zf-major b { font-size: 14px; font-weight: 700; color: var(--cinnabar); }
.zf-minor b { font-size: 12px; color: var(--ink); }
.zf-adj b { font-size: 10px; color: var(--ink-soft); }
.zf-emptymark b { font-size: 11px; color: var(--ink-soft); }
.zf-br { font-style: normal; font-size: 9px; color: var(--ink-soft); line-height: 1.2; }
.zf-h {
  font-style: normal; font-size: 9.5px; line-height: 1; padding: 1px 1px; margin-top: 1px;
  color: #fff; background: var(--hc, var(--cinnabar)); border: 1px solid var(--hc, var(--cinnabar));
}
.zf-h.h-禄 { --hc: var(--h-lu); }
.zf-h.h-权 { --hc: var(--h-quan); }
.zf-h.h-科 { --hc: var(--h-ke); }
.zf-h.h-忌 { --hc: var(--h-ji); }
.zf-h.zf-hd { background: transparent; color: var(--hc); }
.zf-h.zf-hy { background: transparent; color: var(--hc); border-style: dashed; }
.zf-h.zf-self { background: transparent; color: var(--hc); border-color: transparent; font-size: 9px; padding: 0; }

.zf-flow { display: flex; flex-wrap: wrap; gap: 0 3px; font-size: 9.5px; line-height: 1.35; margin: 2px 0; }
.zf-flow .is-dec { color: var(--h-lu); }
.zf-flow .is-yr { color: var(--h-ke); }

.zf-meta { display: flex; align-items: baseline; gap: 4px; font-size: 10px; line-height: 1.4; padding-top: 2px; border-top: 1px dashed #c9ccc4; white-space: nowrap; }
.zf-meta .zf-range { margin-left: auto; }
.zf-bottom { display: flex; justify-content: space-between; align-items: end; gap: 2px; font-size: 9.5px; line-height: 1.25; color: var(--ink-soft); }
.zf-gods { display: grid; grid-template-columns: auto auto; gap: 0 2px; }
.zf-gods .zf-cs { color: var(--ink); }
.zf-dn { color: var(--h-lu); font-weight: 600; }
.zf-yn { color: var(--h-ke); font-weight: 600; }
.zf-range { color: var(--ink); }
.zf-name { display: flex; flex-direction: column; align-items: flex-end; }
.zf-name b { font-size: 12px; color: var(--ink); font-weight: 700; }
.zf-gz { font-size: 11px; color: var(--ink); }
.zf-body { font-size: 9.5px; color: #fff; background: var(--ink); padding: 0 2px; line-height: 1.4; }

.zf-center {
  grid-row: 2 / 4; grid-column: 2 / 4;
  background: var(--paper);
  align-items: center; justify-content: center; text-align: center;
  padding: 8px 6px; font-size: 12px; line-height: 1.6;
}
.zf-center p { margin: 0; }
.zf-cd { display: flex; gap: 8px; font-family: var(--brush); font-size: 21px; color: var(--ink); line-height: 1.3; margin-bottom: 2px !important; }
.zf-ju { font-weight: 600; color: var(--cinnabar); font-size: 13.5px; }
.zf-natal { display: flex; flex-wrap: wrap; justify-content: center; gap: 2px 6px; margin-top: 4px !important; }
.zf-natal span { display: inline-flex; align-items: center; gap: 1px; }
.zf-now { margin-top: 4px !important; color: var(--h-ke); font-weight: 600; }
.zf-legend { display: flex; flex-wrap: wrap; justify-content: center; align-items: center; gap: 2px 3px; margin-top: 6px !important; font-size: 10.5px; color: var(--ink-soft); }

.zf-controls { margin-top: 14px; display: grid; gap: 10px; }
.zf-row { display: flex; gap: 6px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; align-items: stretch; }
.zf-row-label { flex: none; align-self: center; font-size: 13px; color: var(--ink-soft); width: 2.4em; }
.zf-row button {
  flex: none; font-size: 13px; padding: 4px 9px; background: #eef0eb; color: var(--ink);
  border: 1px solid var(--rule); display: flex; flex-direction: column; align-items: center; line-height: 1.3;
}
.zf-row button small { font-size: 11px; color: var(--ink-soft); }
.zf-row button.is-this { border-color: var(--gold-deep); }
.zf-row button.is-on { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.zf-row button.is-on small { color: #c9ccc4; }
.zf-natal-btn { justify-self: start; font-size: 13px; padding: 4px 12px; background: transparent; border: 1px solid var(--ink); color: var(--ink); }
.zf-natal-btn.is-on { background: var(--ink); color: var(--paper); }

.zf-detail { margin-top: 16px; padding: 14px 16px; border: 1px solid var(--gold-deep); box-shadow: inset 0 0 0 3px #efeee6, inset 0 0 0 4px rgba(184, 151, 90, .4); background: #efeee6; }
.zf-detail-head { margin: 0 0 8px; display: flex; flex-wrap: wrap; align-items: baseline; gap: 4px 10px; font-size: 14px; color: var(--ink-soft); }
.zf-detail-head b { font-size: 18px; color: var(--ink); }
.zf-detail-head .zf-body { font-size: 12px; padding: 0 4px; }
.zf-detail dl { margin: 0; display: grid; gap: 4px; }
.zf-detail dl div { display: grid; grid-template-columns: 4.5em 1fr; gap: 10px; font-size: 14.5px; line-height: 1.65; }
.zf-detail dt { color: var(--ink-soft); }
.zf-detail dd { margin: 0; }

@media (max-width: 640px) {
  .zf-grid { grid-template-rows: repeat(4, minmax(160px, auto)); }
  .zf-major b { font-size: 13px; }
  .zf-minor b { font-size: 11px; }
  .zf-adj b { font-size: 9.5px; }
  .zf-cd { font-size: 18px; gap: 5px; }
  .zf-center { font-size: 11px; line-height: 1.5; }
}

/* ---------- 紫微十三宫详解 ---------- */
.zt { margin-top: 28px; }
.zt h3 { margin-bottom: 4px; }
.zt-note { font-size: 13.5px; margin: 0 0 12px; }
.zt-item { border-top: 1px solid var(--rule); }
.zt-item:last-child { border-bottom: 1px solid var(--rule); }
.zt-item summary { cursor: pointer; padding: 12px 2px; font-size: 16.5px; font-weight: 600; list-style: none; display: flex; justify-content: space-between; align-items: center; }
.zt-item summary::-webkit-details-marker { display: none; }
.zt-item summary::after { content: '展开'; font-size: 13px; font-weight: 400; color: var(--ink-soft); }
.zt-item[open] summary::after { content: '收起'; }
.zt-item[open] summary { color: var(--cinnabar); }
.zt-body { padding: 0 2px 16px; font-size: 15.5px; line-height: 1.85; }
.zt-body p { margin: 0 0 10px; }
.zt-body .zt-sub { color: var(--ink); }
.zt-h { margin: 16px 0 6px; font-size: 15.5px; color: var(--cinnabar); letter-spacing: .06em; }
.zt-h:first-child { margin-top: 4px; }

/* ---------- 扫码支付 ---------- */
.qr-box { text-align: center; }
.qr-box .pay-amount { margin-bottom: 10px; }
.qr-img { display: block; width: 200px; height: 200px; margin: 0 auto; image-rendering: pixelated; background: #fff; }
.qr-tip { margin: 12px 0 4px; font-size: 15px; }
.qr-status { margin: 0 0 16px; font-size: 13.5px; color: var(--ink-soft); }
.qr-box .pay-actions { justify-content: center; }

/* ---------- 婚书 ---------- */
.mb { margin: 0 0 36px; }
.mb-canvas { display: block; width: min(100%, 540px); height: auto; margin: 0 auto; box-shadow: 0 12px 32px rgba(38, 40, 42, .18); }
.mb-tools { max-width: 540px; margin: 16px auto 0; text-align: center; }
.mb-tip { margin: 0 0 10px; font-size: 14px; color: var(--ink-soft); }
.mb-names { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.mb-names input { font: inherit; font-size: 16px; padding: 9px 12px; color: var(--ink); background: #f4f5f1; border: 1px solid var(--rule); border-radius: 0; min-width: 0; }
.mb-names input:focus { outline: 2px solid var(--celadon); outline-offset: 0; border-color: var(--celadon); }
