/* ════════════════════════════════════════════════════════════
   命主 BAZI MASTER · bazi-cn
   视觉体系搬自 bazi-master DESIGN_TOKENS.md (V8.5)
   改动:① 字体改为国内可用方案 ② 加动效 ③ 去 SaaS 化
   ════════════════════════════════════════════════════════════ */

:root {
  /* 品牌主色 */
  --zen-bg:         #F9F7F2;
  --zen-ink:        #2c2c2c;
  --zen-red:        #BC2D2D;
  --zen-red-dark:   #a02424;
  --zen-gold:       #B8860B;
  --zen-gold-light: #D4AF37;
  --zen-paper:      #ffffff;
  --zen-paper-deep: #EFEBE0;
  --zen-gold-pale:  #FDF5E4;
  --zen-border:     #dcd9d1;

  /* 五行色(严格不可改) */
  --element-wood:  #4A7C59;
  --element-fire:  #C74B4B;
  --element-earth: #B8860B;
  --element-metal: #8B8B8B;
  --element-water: #4A6FA5;

  --zen-text-muted:       #888;
  --zen-text-light:       #999;
  --zen-text-placeholder: #aaa;

  /* 字体 —— 国内方案:
     · --font-seal 只用于「命主」和天干地支等少量大字,走子集化衬线
     · 正文用系统字体栈(苹方/雅黑),零加载、不会回落到 SimSun */
  --font-main: "Georgia", "Times New Roman", var(--font-cjk), serif;
  --font-ui:   -apple-system, BlinkMacSystemFont, "PingFang SC", "HarmonyOS Sans SC",
               "Microsoft YaHei UI", "Microsoft YaHei", "Source Han Sans SC", sans-serif;
  --font-cjk:  "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-seal: "Songti SC", "SimSun", "Noto Serif SC", serif;
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font-ui);
  font-size: 16px;
  line-height: 1.9;
  color: var(--zen-ink);
  /* 原项目的暗纹在主内容压白底时才好看;这里内容直接坐在底色上,
     纹理会变成方格纸。改用极淡的双向渐晕,保留"纸"的温度但不抢戏。 */
  background-color: var(--zen-bg);
  background-image:
    radial-gradient(circle at 15% 6%,  rgba(188,45,45,.030), transparent 46%),
    radial-gradient(circle at 85% 94%, rgba(184,134,11,.038), transparent 48%);
  background-attachment: fixed;
  min-height: 100vh;
}

.wrap { max-width: 680px; margin: 0 auto; padding: 0 22px; }
.wrap-wide { max-width: 900px; margin: 0 auto; padding: 0 22px; }

/* ── 动效基建 ── */
@keyframes fadeUp { from { opacity:0; transform:translateY(14px);} to { opacity:1; transform:none; } }
@keyframes fadeIn { from { opacity:0 } to { opacity:1 } }
@keyframes drawLine { from { transform:scaleX(0) } to { transform:scaleX(1) } }

.reveal { opacity: 0; }
.reveal.in { animation: fadeUp .75s cubic-bezier(.22,.8,.3,1) forwards; }
.reveal.d1 { animation-delay: .10s } .reveal.d2 { animation-delay: .20s }
.reveal.d3 { animation-delay: .30s } .reveal.d4 { animation-delay: .40s }
.reveal.d5 { animation-delay: .50s } .reveal.d6 { animation-delay: .60s }

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.in { opacity: 1; animation: none !important; }
  html { scroll-behavior: auto; }
}

/* ── 顶栏 ── */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 22px 0; border-bottom: 1px solid rgba(220,217,209,.7);
}
.brand-inline { display: flex; align-items: baseline; gap: 9px; text-decoration: none; }
.brand-inline .cn {
  font-family: var(--font-seal); font-size: 20px; color: var(--zen-red);
  letter-spacing: 3px; font-weight: 600;
}
.brand-inline .en {
  font-size: 12px; color: var(--zen-ink); letter-spacing: .22em; text-transform: uppercase;
}
.topbar nav a {
  font-size: 13px; color: var(--zen-text-muted); text-decoration: none;
  letter-spacing: .1em; margin-left: 20px;
}
.topbar nav a:hover { color: var(--zen-red); }

/* ── 水墨圆印 ── */
.zen-circle-bg {
  position: absolute; top: 40px; left: 50%; transform: translateX(-50%);
  width: 600px; height: 600px; border-radius: 50%;
  border: 1px solid rgba(44,44,44,.05);
  background-color: rgba(188,45,45,.02);
  pointer-events: none; z-index: 0;
}
@media (max-width: 800px) { .zen-circle-bg { width: 330px; height: 330px; } }

/* ── 首屏(紧凑:计算器直接上首屏) ── */
.hero-compact { position: relative; padding: 40px 0 10px; }
.hero-compact > * { position: relative; z-index: 10; }
.hero-compact .wrap { position: relative; z-index: 10; }

.hero-claim {
  font-family: var(--font-main); font-size: 30px; line-height: 1.55;
  margin: 0 auto 12px; max-width: 15em; color: var(--zen-ink);
  text-align: center; font-weight: 600; letter-spacing: 1px;
  animation: fadeUp .7s cubic-bezier(.22,.8,.3,1) both;
}
.hero-claim b { color: var(--zen-red); }
.hero-sub {
  font-size: 15px; color: var(--zen-text-muted); margin: 0 auto 30px;
  text-align: center; max-width: 26em; line-height: 1.85;
  animation: fadeUp .7s cubic-bezier(.22,.8,.3,1) .12s both;
}
.form-card { animation: fadeUp .7s cubic-bezier(.22,.8,.3,1) .22s both; }
.form-note {
  text-align: center; font-size: 12.5px; color: var(--zen-text-light);
  margin: 16px 0 0; line-height: 1.7;
}
.section-tight { padding-top: 26px; }

/* ── 按钮 ── */
.zen-btn, .zen-btn-primary {
  display: inline-block; border-radius: 0; cursor: pointer;
  font-family: var(--font-ui); font-size: 16px; letter-spacing: .18em;
  padding: 15px 44px; transition: all .35s ease; text-decoration: none;
}
.zen-btn { background: transparent; border: 1.5px solid var(--zen-ink); color: var(--zen-ink); }
.zen-btn:hover { background: var(--zen-ink); color: var(--zen-bg); }
.zen-btn-primary {
  background: linear-gradient(135deg, var(--zen-red) 0%, var(--zen-red-dark) 100%);
  color: #fff; border: none; box-shadow: 0 4px 18px rgba(188,45,45,.24);
}
.zen-btn-primary:hover { box-shadow: 0 7px 24px rgba(188,45,45,.34); transform: translateY(-1px); }
.btn-row { display: flex; gap: 14px; justify-content: center; flex-wrap: wrap; }

.scroll-hint {
  margin-top: 46px; font-size: 13px; color: var(--zen-text-light); letter-spacing: .1em;
}

/* ── 分节 ── */
.section { padding: 62px 0; }
.section + .section { border-top: 1px solid rgba(220,217,209,.6); }
.sec-label {
  font-size: 11px; letter-spacing: .26em; text-transform: uppercase;
  color: var(--zen-gold); text-align: center; margin-bottom: 14px;
}
.sec-title {
  font-family: var(--font-main); font-size: 30px; text-align: center;
  margin: 0 0 12px; letter-spacing: 2px; font-weight: 600;
}
.sec-intro {
  text-align: center; color: var(--zen-text-muted); max-width: 26em;
  margin: 0 auto 40px; font-size: 15.5px;
}

/* ── 卡片 ── */
.zen-card {
  background: rgba(255,255,255,.6); backdrop-filter: blur(4px);
  border: 1px solid rgba(44,44,44,.1); padding: 30px 26px;
  box-shadow: 0 10px 30px rgba(44,44,44,.05);
}
.zen-result-card {
  background: #fff; border: 1px solid rgba(0,0,0,.08); padding: 26px 22px;
  box-shadow: 0 6px 22px rgba(44,44,44,.05); margin-bottom: 18px;
}
.zen-result-card > h3 {
  font-family: var(--font-ui); font-size: 11px; letter-spacing: .16em;
  text-transform: uppercase; color: var(--zen-ink); font-weight: 600; margin: 0 0 4px;
}
.zen-result-card > .rc-hint {
  font-size: 12.5px; color: var(--zen-text-muted); margin: 0 0 18px; line-height: 1.6;
}

/* ── 三卡特性 ── */
.feat-grid { display: grid; grid-template-columns: 1fr; gap: 16px; }
@media (min-width: 720px) { .feat-grid { grid-template-columns: repeat(3,1fr); } }
.feat { padding: 26px 22px; background: rgba(255,255,255,.55); border: 1px solid rgba(44,44,44,.08); }
.feat .k { font-size: 11px; letter-spacing: .18em; color: var(--zen-gold); text-transform: uppercase; }
.feat h3 { font-family: var(--font-main); font-size: 20px; margin: 10px 0 8px; font-weight: 600; }
.feat p { margin: 0; font-size: 15px; color: #5a5a5a; line-height: 1.85; }

/* ── 四步流程 ── */
.steps { display: grid; gap: 2px; background: var(--zen-border); border: 1px solid var(--zen-border); }
@media (min-width: 720px) { .steps { grid-template-columns: repeat(4,1fr); } }
.step { background: var(--zen-bg); padding: 26px 20px; text-align: center; }
.step .n {
  font-family: var(--font-main); font-size: 34px; color: var(--zen-gold-light);
  line-height: 1; margin-bottom: 10px;
}
.step h4 { margin: 0 0 6px; font-size: 16px; letter-spacing: 1px; }
.step p { margin: 0; font-size: 14px; color: var(--zen-text-muted); line-height: 1.7; }

/* ── 引述 / 强主张 ── */
.claim-box {
  border-left: 2px solid var(--zen-red); padding: 4px 0 4px 22px;
  margin: 34px auto; max-width: 34em;
}
.claim-box p { margin: 0 0 10px; font-size: 16.5px; line-height: 1.95; }
.claim-box p:last-child { margin-bottom: 0; }
.claim-box b { color: var(--zen-red); }

/* ── 表单:下划线式,不用圆角框 ── */
.form-grid { display: grid; gap: 22px; }
@media (min-width: 640px) { .form-grid.two { grid-template-columns: 1fr 1fr; } }
.zen-field > label {
  display: block; font-family: var(--font-ui); font-size: 11px;
  letter-spacing: .12em; text-transform: uppercase; color: var(--zen-text-muted);
  margin-bottom: 4px;
}
.zen-input {
  width: 100%; padding: 11px 0; border: none; border-bottom: 2px solid #e0e0e0;
  background: transparent; font-family: var(--font-main); font-size: 17px;
  color: var(--zen-ink); border-radius: 0; transition: all .3s ease; appearance: none;
}
.zen-input:focus {
  outline: none; border-bottom-color: var(--zen-ink); background: rgba(255,255,255,.5);
}
select.zen-input { background-image: none; }

.seg { display: grid; grid-template-columns: 1fr 1fr; gap: 0; border: 1.5px solid var(--zen-border); }
.seg input { position: absolute; opacity: 0; pointer-events: none; }
.seg label {
  text-align: center; padding: 11px 0; font-size: 15px; letter-spacing: 4px;
  cursor: pointer; transition: all .25s ease; color: var(--zen-text-muted);
}
.seg input:checked + label { background: var(--zen-ink); color: var(--zen-bg); }

/* ── 命盘 ── */
#result { display: none; }
#result.on { display: block; }

.pillars { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; }
.pillar {
  background: var(--zen-paper-deep); border: 1px solid var(--zen-border);
  border-radius: 0; padding: 12px 3px; text-align: center;
  display: flex; flex-direction: column; gap: 5px;
}
.pillar.day { background: var(--zen-gold-pale); border-color: var(--zen-gold); }
.pillar .pos { font-size: 11px; color: var(--zen-text-muted); letter-spacing: .06em; }
.pillar .ch  { font-family: var(--font-seal); font-size: 27px; line-height: 1; font-weight: 600; }
.pillar .sm  { font-size: 11px; color: var(--zen-ink); }
.pillar .div { border-top: 1px solid var(--zen-border); margin: 1px 0; }
.pillar .mut { font-size: 11px; color: var(--zen-text-muted); }

.e-wood{color:var(--element-wood)} .e-fire{color:var(--element-fire)}
.e-earth{color:var(--element-earth)} .e-metal{color:var(--element-metal)}
.e-water{color:var(--element-water)}

/* 事实表 */
.facts { margin-top: 18px; border-top: 1px solid var(--zen-border); padding-top: 14px; }
.fact { display: flex; gap: 14px; font-size: 14.5px; padding: 6px 0; margin: 0; }
.fact dt { color: var(--zen-text-muted); flex: 0 0 84px; font-size: 13px; }
.fact dd { margin: 0; flex: 1; }

/* 五行条 */
.wx-row { display: flex; align-items: center; gap: 11px; margin: 9px 0; font-size: 14px; }
.wx-row .nm { flex: 0 0 26px; font-family: var(--font-seal); font-size: 17px; }
.wx-row .bar { flex: 1; height: 9px; background: var(--zen-paper-deep); overflow: hidden; }
.wx-row .bar i { display: block; height: 100%; width: 0; transition: width 1s cubic-bezier(.22,.8,.3,1); }
.wx-row .n { flex: 0 0 30px; text-align: right; color: var(--zen-text-muted); font-size: 13px; }

/* 大运 */
.dayun { display: flex; gap: 5px; overflow-x: auto; padding-bottom: 6px; }
.dy {
  flex: 0 0 auto; min-width: 62px; text-align: center; padding: 9px 6px;
  background: var(--zen-paper-deep); border: 1px solid var(--zen-border);
}
.dy.now { background: var(--zen-gold-pale); border-color: var(--zen-gold); }
.dy .gz { font-family: var(--font-seal); font-size: 17px; font-weight: 600; }
.dy .yr { font-size: 10.5px; color: var(--zen-text-muted); }

/* ── 时柱临界告警(杀手锏) ── */
.tz-alert {
  border: 1px solid var(--zen-red); background: #fff;
  padding: 22px 22px; margin-bottom: 18px;
  box-shadow: 0 6px 22px rgba(188,45,45,.08);
}
.tz-alert .tag {
  display: inline-block; background: var(--zen-red); color: #fff;
  font-size: 11px; letter-spacing: .16em; padding: 3px 10px; margin-bottom: 12px;
}
.tz-alert h3 { font-family: var(--font-main); font-size: 20px; margin: 0 0 10px; font-weight: 600; }
.tz-alert p { margin: 0 0 10px; font-size: 15px; line-height: 1.85; }
.tz-alert p:last-child { margin-bottom: 0; }
.tz-flip {
  display: flex; align-items: center; justify-content: center; gap: 16px;
  margin: 16px 0; font-family: var(--font-seal); font-size: 24px; font-weight: 600;
}
.tz-flip .was { color: var(--zen-text-placeholder); text-decoration: line-through; }
.tz-flip .arr { font-size: 16px; color: var(--zen-text-muted); }
.tz-flip .now { color: var(--zen-red); }

/* ── 付费出口 ── */
.offer {
  border: 1px solid var(--zen-gold); background: linear-gradient(180deg,#fffdf6,#fdf7e8);
  padding: 34px 26px; text-align: center;
}
.offer .k { font-size: 11px; letter-spacing: .24em; color: var(--zen-gold); text-transform: uppercase; }
.offer h3 { font-family: var(--font-main); font-size: 26px; margin: 12px 0 6px; font-weight: 600; }
.offer .price { font-family: var(--font-main); font-size: 46px; color: var(--zen-red); margin: 14px 0 4px; }
.offer .price small { font-size: 16px; color: var(--zen-text-muted); }
.offer ul { list-style: none; padding: 0; margin: 18px auto 22px; text-align: left; max-width: 24em; }
.offer li { position: relative; padding: 5px 0 5px 20px; font-size: 15px; line-height: 1.8; }
.offer li::before { content: "—"; position: absolute; left: 0; color: var(--zen-gold); }
.offer .fine { font-size: 12.5px; color: var(--zen-text-muted); margin: 12px 0 0; }

/* ── 页脚 ── */
footer { padding: 44px 0 56px; text-align: center; border-top: 1px solid rgba(220,217,209,.6); }
footer .fb { margin-bottom: 14px; }
footer .disc { font-size: 12.5px; color: var(--zen-text-light); line-height: 1.9; max-width: 30em; margin: 0 auto; }
footer .cr { font-size: 12px; color: var(--zen-text-placeholder); margin-top: 16px; }

@media (max-width: 420px) {
  .logo-cn { font-size: 60px; letter-spacing: 10px; text-indent: 10px; }
  .hero-claim { font-size: 21px; }
  .sec-title { font-size: 25px; }
  .pillar .ch { font-size: 23px; }
}

/* ── 合规说明 ── */
.notice {
  border: 1px solid var(--zen-border); background: rgba(255,255,255,.5);
  padding: 26px 24px;
}
.notice-h {
  font-size: 12px; letter-spacing: .16em; text-transform: uppercase;
  color: var(--zen-gold); margin: 0 0 14px;
}
.notice p { margin: 0 0 12px; font-size: 13.5px; line-height: 1.95; color: #6a6a6a; }
.notice p:last-child { margin-bottom: 0; }
.notice b { color: #4a4a4a; font-weight: 600; }

/* ── 免费简批 ── */
#free-reading { min-height: 44px; }
.fr-text { font-size: 15.5px; line-height: 2.05; color: #454545; }
.fr-text h4 {
  font-family: var(--font-main); font-size: 17px; margin: 18px 0 6px;
  color: var(--zen-ink); font-weight: 600;
}
.fr-text h4:first-child { margin-top: 0; }
.fr-text p { margin: 0 0 12px; }
.fr-loading { display: flex; align-items: center; gap: 10px; color: var(--zen-text-muted); font-size: 14px; }
.fr-dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--zen-red);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 0%,100%{opacity:.25;transform:scale(.8)} 50%{opacity:1;transform:scale(1)} }
.fr-err { font-size: 14px; color: var(--zen-red); }

/* ═══ 合婚页 ═══ */
.side-head {
  font-size: 12px; letter-spacing: .2em; color: var(--zen-gold);
  text-transform: uppercase; margin: 0 0 16px; padding-bottom: 8px;
  border-bottom: 1px solid var(--zen-border);
}

.score-card { text-align: center; padding: 32px 22px 26px; border-color: var(--zen-gold); }
.score-num {
  font-family: var(--font-main); font-size: 82px; line-height: 1;
  color: var(--zen-red); font-weight: 600; letter-spacing: 1px;
}
.score-level {
  font-family: var(--font-main); font-size: 23px; letter-spacing: 7px;
  margin-top: 12px; color: var(--zen-ink);
}
.stars { font-size: 17px; color: var(--zen-gold); letter-spacing: 5px; margin-top: 8px; }
.score-pair { font-size: 14px; color: var(--zen-text-muted); margin-top: 14px; }

.mini-chart { padding: 16px 0; }
.mini-chart + .mini-chart { border-top: 1px solid var(--zen-border); }
.mc-head { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 6px; }
.mc-name { font-size: 16px; letter-spacing: 1px; }
.mc-tag { font-size: 13px; color: var(--zen-text-muted); }
.mc-row { display: grid; grid-template-columns: repeat(4,1fr); gap: 5px; margin: 12px 0 9px; }
.mp {
  text-align: center; padding: 9px 0; background: var(--zen-paper-deep);
  border: 1px solid var(--zen-border); line-height: 1.3;
}
.mp.day { background: var(--zen-gold-pale); border-color: var(--zen-gold); }
.mp b { display: block; font-family: var(--font-seal); font-size: 20px; font-weight: 600; }
.mc-foot { font-size: 13px; color: var(--zen-text-muted); }

.dim { padding: 16px 0; }
.dim + .dim { border-top: 1px solid var(--zen-border); }
.dim-top { display: flex; justify-content: space-between; align-items: baseline; }
.dim-name { font-size: 16px; letter-spacing: 1px; }
.dim-score { font-family: var(--font-main); font-size: 22px; font-weight: 600; color: var(--zen-red); }
.dim-score i { font-size: 13px; font-style: normal; color: var(--zen-text-muted); font-weight: 400; }
.dim-bar { height: 6px; background: var(--zen-paper-deep); overflow: hidden; margin: 9px 0 10px; }
.dim-bar i {
  display: block; height: 100%; width: 0; background: var(--zen-red);
  transition: width 1s cubic-bezier(.22,.8,.3,1);
}
.dim.is-locked .dim-bar i { background: var(--zen-text-placeholder); }
.dim-desc { margin: 0; font-size: 15px; color: #5a5a5a; line-height: 1.9; }
.dim-desc.locked { color: var(--zen-text-light); }
.dim-desc.locked::after { content: "　🔒"; font-size: 12px; }
