/* ============================================================
   玄机阁 · Design System
   东方新中式 × 现代产品界面
   ============================================================ */

:root {
  /* 底色与墨色 */
  --bg: #f4f5f0;
  --bg-soft: #eef0e9;
  --surface: #ffffff;
  --surface-soft: #fafbf7;
  --ink: #14181b;
  --ink-2: #4e565b;
  --ink-3: #8b9297;
  --line: #e4e6df;
  --line-2: #d7dacf;

  /* 主色 */
  --red: #b93a2b;
  --red-2: #c94a34;
  --red-soft: #fbece8;
  --jade: #1f6b58;
  --jade-soft: #eaf3ee;
  --gold: #b8892f;
  --gold-soft: #faf2e0;
  --indigo: #2b4a78;
  --indigo-soft: #ebeff7;

  /* 五行 */
  --wood: #3e8a58;
  --wood-soft: #eaf3ec;
  --fire: #c34c34;
  --fire-soft: #fbebe7;
  --earth: #a9803a;
  --earth-soft: #f6efe1;
  --metal: #7d878c;
  --metal-soft: #eef0f1;
  --water: #2c679b;
  --water-soft: #e8f0f7;

  /* 阴影 */
  --sh-1: 0 1px 2px rgba(20, 24, 27, .05), 0 2px 10px rgba(20, 24, 27, .04);
  --sh-2: 0 1px 2px rgba(20, 24, 27, .04), 0 18px 40px -26px rgba(20, 24, 27, .38);
  --sh-3: 0 2px 6px rgba(20, 24, 27, .05), 0 34px 70px -34px rgba(20, 24, 27, .4);

  /* 圆角 */
  --r-xs: 8px;
  --r-sm: 12px;
  --r-md: 16px;
  --r-lg: 22px;
  --r-xl: 28px;

  --f-display: "Songti SC", "STSong", "SimSun", "Noto Serif SC", "Source Han Serif SC", serif;
  --f-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --f-num: "Helvetica Neue", "Segoe UI", Arial, sans-serif;

  --ease: cubic-bezier(.22, .61, .36, 1);
}

* { box-sizing: border-box; }

[hidden] { display: none !important; }

html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }

body {
  margin: 0;
  background-color: var(--bg);
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='0.045'/%3E%3C/svg%3E");
  color: var(--ink);
  font-family: var(--f-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4, p, dl, dd, figure { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
a { color: inherit; text-decoration: none; }
img, svg, canvas { display: block; max-width: 100%; }
b, strong { font-weight: 600; }
::selection { background: var(--red-soft); color: var(--red); }

:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
  border-radius: 4px;
}

.skip-link {
  position: absolute;
  left: 16px;
  top: -60px;
  z-index: 200;
  padding: 10px 18px;
  background: var(--ink);
  color: #fff;
  border-radius: var(--r-sm);
  font-size: 13px;
  transition: top .2s;
}
.skip-link:focus { top: 14px; }

.container {
  width: min(1200px, 100% - 48px);
  margin-inline: auto;
}

/* ============ 通用元件 ============ */

.btn {
  --btn-bg: var(--surface);
  --btn-fg: var(--ink);
  --btn-bd: var(--line-2);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 20px;
  border: 1px solid var(--btn-bd);
  border-radius: 12px;
  background: var(--btn-bg);
  color: var(--btn-fg);
  font-size: 14.5px;
  font-weight: 500;
  letter-spacing: .01em;
  line-height: 1.2;
  cursor: pointer;
  white-space: nowrap;
  transition: transform .18s var(--ease), box-shadow .18s var(--ease), background .18s var(--ease), border-color .18s var(--ease), color .18s var(--ease);
}
.btn:hover { transform: translateY(-1px); box-shadow: var(--sh-2); }
.btn:active { transform: translateY(0); box-shadow: var(--sh-1); }
.btn svg { width: 17px; height: 17px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }

.btn-primary {
  --btn-bg: linear-gradient(140deg, #c1472f 0%, #a9301f 100%);
  --btn-fg: #fff;
  --btn-bd: transparent;
  box-shadow: 0 1px 2px rgba(140, 42, 28, .28), 0 10px 24px -14px rgba(140, 42, 28, .8);
}
.btn-primary:hover { box-shadow: 0 2px 4px rgba(140, 42, 28, .24), 0 18px 32px -16px rgba(140, 42, 28, .8); }
.btn-soft { --btn-bg: var(--jade-soft); --btn-fg: var(--jade); --btn-bd: transparent; }
.btn-ghost { --btn-bg: transparent; --btn-fg: var(--ink-2); --btn-bd: var(--line-2); }
.btn-ghost:hover { --btn-fg: var(--ink); --btn-bg: var(--surface); }
.btn-ink { --btn-bg: var(--ink); --btn-fg: #fff; --btn-bd: transparent; }
.btn-sm { padding: 9px 15px; font-size: 13.5px; border-radius: 10px; }
.btn-lg { padding: 15px 28px; font-size: 16px; border-radius: 14px; }
.btn-block { width: 100%; }
.btn[disabled] { opacity: .55; pointer-events: none; }

.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 12px;
  color: var(--ink-2);
  white-space: nowrap;
}
.pill--red { background: var(--red-soft); border-color: rgba(185, 58, 43, .16); color: var(--red); }
.pill--jade { background: var(--jade-soft); border-color: rgba(31, 107, 88, .14); color: var(--jade); }
.pill--gold { background: var(--gold-soft); border-color: rgba(184, 137, 47, .2); color: var(--gold); }

.seal {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 8px;
  background: linear-gradient(145deg, #c4472f, #a62f1f);
  color: #fff;
  font-family: var(--f-display);
  font-size: 18px;
  line-height: 1;
  box-shadow: 0 2px 6px rgba(150, 45, 30, .28);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 12px;
  letter-spacing: .22em;
  color: var(--ink-3);
  text-transform: uppercase;
}
.eyebrow::before {
  content: "";
  width: 22px;
  height: 1px;
  background: var(--red);
  opacity: .7;
}

.section { padding: clamp(56px, 7vw, 92px) 0; }
.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 32px;
  margin-bottom: clamp(24px, 3.4vw, 40px);
}
.section-head h2 {
  font-family: var(--f-display);
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.3;
  letter-spacing: .01em;
  margin-top: 12px;
  font-weight: 600;
}
.section-head .lead {
  margin-top: 10px;
  max-width: 38em;
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.85;
}
.section-head .more {
  flex: none;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13.5px;
  color: var(--ink-2);
  padding-bottom: 4px;
  border-bottom: 1px solid transparent;
  transition: color .18s, border-color .18s;
}
.section-head .more:hover { color: var(--red); border-color: currentColor; }
.section-head .more svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }

/* 五行色调 */
.el-木 { --el: var(--wood); --el-soft: var(--wood-soft); }
.el-火 { --el: var(--fire); --el-soft: var(--fire-soft); }
.el-土 { --el: var(--earth); --el-soft: var(--earth-soft); }
.el-金 { --el: var(--metal); --el-soft: var(--metal-soft); }
.el-水 { --el: var(--water); --el-soft: var(--water-soft); }

.el-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--el-soft, var(--surface-soft));
  color: var(--el, var(--ink-2));
  font-size: 12px;
  line-height: 1.6;
  white-space: nowrap;
}
.el-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--el, var(--ink-3));
}

/* ============ 导航 ============ */

.shell { min-height: 100vh; display: flex; flex-direction: column; }

.site-nav {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(244, 245, 240, .82);
  backdrop-filter: blur(14px) saturate(1.4);
  border-bottom: 1px solid transparent;
  transition: border-color .25s, background .25s, box-shadow .25s;
}
.site-nav.is-stuck {
  border-color: var(--line);
  background: rgba(250, 251, 247, .9);
  box-shadow: 0 8px 24px -18px rgba(20, 24, 27, .5);
}
.nav-inner {
  height: 70px;
  display: flex;
  align-items: center;
  gap: 28px;
}
.brand { display: inline-flex; align-items: center; gap: 10px; flex: none; }
.brand-seal {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(150deg, #c4482f, #a62f1f);
  color: #fff;
  font-family: var(--f-display);
  font-size: 20px;
  line-height: 1;
  box-shadow: 0 3px 10px -2px rgba(150, 45, 30, .5), inset 0 1px 0 rgba(255, 255, 255, .18);
}
.brand-text strong {
  display: block;
  font-family: var(--f-display);
  font-size: 19px;
  letter-spacing: .16em;
  line-height: 1.1;
  font-weight: 600;
}
.brand-text em {
  display: block;
  font-style: normal;
  font-family: var(--f-num);
  font-size: 8.5px;
  letter-spacing: .34em;
  color: var(--ink-3);
  margin-top: 3px;
}

.nav-menu { display: flex; align-items: center; gap: 4px; margin-left: 12px; }
.nav-menu a {
  position: relative;
  padding: 8px 13px;
  border-radius: 9px;
  font-size: 14px;
  color: var(--ink-2);
  transition: color .18s, background .18s;
}
.nav-menu a:hover { color: var(--ink); background: rgba(20, 24, 27, .04); }
.nav-menu a.is-active { color: var(--ink); font-weight: 500; }
.nav-menu a.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 4px;
  height: 4px;
  border-radius: 50%;
  background: var(--red);
  transform: translateX(-50%);
}

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 10px; }

/* ============ 页面容器 ============ */

.view { flex: 1; min-height: 60vh; }
.page { animation: pageIn .5s var(--ease) both; }
.page-head {
  padding: clamp(28px, 4vw, 52px) 0 clamp(18px, 2.4vw, 28px);
}
.page-head h1 {
  font-family: var(--f-display);
  font-size: clamp(28px, 3.8vw, 44px);
  line-height: 1.25;
  letter-spacing: .01em;
  margin-top: 14px;
  font-weight: 600;
}
.page-head .lead {
  margin-top: 14px;
  max-width: 46em;
  color: var(--ink-2);
  font-size: 15.5px;
  line-height: 1.85;
}

@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ============ 首页 · Hero ============ */

.hero {
  position: relative;
  padding: clamp(32px, 5vw, 64px) 0 clamp(28px, 4vw, 48px);
  overflow: hidden;
}
.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(6px);
}
.hero::before {
  width: 620px; height: 620px;
  right: -180px; top: -260px;
  background: radial-gradient(circle, rgba(31, 107, 88, .1), transparent 66%);
}
.hero::after {
  width: 520px; height: 520px;
  left: -220px; bottom: -280px;
  background: radial-gradient(circle, rgba(184, 137, 47, .13), transparent 66%);
}
.hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1.04fr) minmax(0, .96fr);
  gap: clamp(28px, 4.4vw, 60px);
  align-items: center;
}
.hero h1 {
  font-family: var(--f-display);
  font-size: clamp(34px, 4.7vw, 60px);
  line-height: 1.2;
  letter-spacing: .015em;
  font-weight: 600;
  margin-top: 18px;
}
.hero h1 em {
  font-style: normal;
  color: var(--red);
  background-image: linear-gradient(180deg, transparent 58%, rgba(184, 137, 47, .45) 55%, rgba(184, 137, 47, .45) 96%, transparent 94%);
  padding: 0 .04em;
}
.hero-lead {
  margin-top: 18px;
  max-width: 33em;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.9;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 26px; }
.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 22px;
  margin-top: 22px;
  font-size: 12.5px;
  color: var(--ink-3);
}
.hero-meta span { display: inline-flex; align-items: center; gap: 6px; }
.hero-meta b { font-family: var(--f-num); font-weight: 600; color: var(--ink-2); font-variant-numeric: tabular-nums; }

/* 快捷排盘 */
.quick {
  margin-top: 30px;
  padding: 16px;
  background: rgba(255, 255, 255, .86);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-2);
  backdrop-filter: blur(8px);
}
.quick-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  font-size: 12.5px;
  color: var(--ink-3);
  margin-bottom: 12px;
  letter-spacing: .04em;
}
.quick-title b { color: var(--ink); font-size: 13px; font-weight: 600; letter-spacing: .02em; }
.quick-grid {
  display: grid;
  grid-template-columns: 1.3fr 1.1fr .9fr auto;
  gap: 10px;
  align-items: end;
}
.quick-field { display: grid; gap: 6px; min-width: 0; }
.quick-field > span { font-size: 11px; color: var(--ink-3); letter-spacing: .06em; }

/* 今日天时 */
.today-card {
  position: relative;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-xl);
  box-shadow: var(--sh-3);
  animation: floatIn .8s var(--ease) both;
}
.today-card::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: linear-gradient(160deg, rgba(31, 107, 88, .05), transparent 46%);
  pointer-events: none;
}
.today-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
}
.today-head h2 {
  font-family: var(--f-display);
  font-size: 20px;
  letter-spacing: .06em;
  font-weight: 600;
}
.today-head p { margin-top: 4px; font-size: 12px; color: var(--ink-3); }
.today-date {
  text-align: right;
  font-family: var(--f-num);
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.6;
}
.today-date b { display: block; font-family: var(--f-display); font-size: 26px; color: var(--ink); letter-spacing: .04em; }

.today-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.today-col {
  display: grid;
  justify-items: center;
  gap: 6px;
  padding: 12px 4px 10px;
  border-radius: var(--r-md);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  transition: background .2s, transform .2s;
}
.today-col:hover { background: #fff; transform: translateY(-2px); }
.today-col > span { font-size: 10.5px; letter-spacing: .16em; color: var(--ink-3); }
.today-col .gan,
.today-col .zhi {
  font-family: var(--f-display);
  font-size: 27px;
  line-height: 1.12;
  color: var(--el, var(--ink));
}
.today-col .zhi { opacity: .82; font-size: 24px; }
.today-col .dot { width: 14px; height: 3px; border-radius: 2px; background: var(--el, var(--line)); opacity: .55; }

.term-bar { margin-top: 18px; }
.term-bar-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  font-size: 11.5px;
  color: var(--ink-3);
  margin-bottom: 8px;
}
.term-bar-head b { color: var(--ink-2); font-weight: 500; }
.term-track {
  height: 5px;
  border-radius: 4px;
  background: var(--bg-soft);
  overflow: hidden;
}
.term-track i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--jade), #3f8f74);
}
.today-yiji {
  display: flex;
  gap: 8px;
  margin-top: 16px;
  flex-wrap: wrap;
  align-items: center;
  font-size: 12px;
  color: var(--ink-3);
}
.today-yiji .tag-y {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--jade-soft);
  color: var(--jade);
  font-size: 12px;
}
.today-yiji .tag-j {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--red-soft);
  color: var(--red);
  font-size: 12px;
}
.today-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 18px;
  padding-top: 14px;
  border-top: 1px dashed var(--line-2);
  font-size: 12.5px;
  color: var(--ink-3);
}
.today-foot a { color: var(--red); display: inline-flex; align-items: center; gap: 5px; }
.today-foot a svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }

@keyframes floatIn {
  from { opacity: 0; transform: translateY(18px) scale(.985); }
  to { opacity: 1; transform: none; }
}

/* ============ Bento ============ */

.bento {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 16px;
}
.b-card {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  overflow: hidden;
  transition: transform .22s var(--ease), box-shadow .22s var(--ease), border-color .22s;
}
.b-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--line-2); }
.b-card--chart { grid-column: span 6; }
.b-card--hepan { grid-column: span 3; }
.b-card--lot { grid-column: span 3; }
.b-card--learn { grid-column: span 4; }
.b-card--case { grid-column: span 4; }
.b-card--stat { grid-column: span 4; }

.b-icon {
  width: 38px; height: 38px;
  display: grid; place-items: center;
  border-radius: 11px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.b-icon svg { width: 19px; height: 19px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.b-card h3 {
  font-family: var(--f-display);
  font-size: 20px;
  letter-spacing: .04em;
  font-weight: 600;
}
.b-card p { font-size: 13.5px; line-height: 1.8; color: var(--ink-2); }
.b-card .b-link {
  margin-top: auto;
  padding-top: 6px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--red);
}
.b-card .b-link svg { width: 14px; height: 14px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.b-card--chart .b-icon { background: var(--red-soft); border-color: rgba(185, 58, 43, .12); color: var(--red); }

/* 迷你命盘 */
.mini-chart {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin: 6px 0 0;
}
.mini-col {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 12px 4px;
  border-radius: 12px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.mini-col span { font-size: 10px; color: var(--ink-3); letter-spacing: .1em; }
.mini-col b {
  font-family: var(--f-display);
  font-size: 20px;
  line-height: 1.2;
  color: var(--el, var(--ink));
  font-weight: 600;
}
.mini-col i { font-style: normal; font-family: var(--f-display); font-size: 17px; color: var(--el, var(--ink-2)); opacity: .8; }
.mini-foot {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
  font-size: 11.5px;
  color: var(--ink-3);
}

/* 合盘卡视觉 */
.duo {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin: 4px 0 2px;
}
.duo-ring {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-display);
  font-size: 17px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
}
.duo-ring--a { color: var(--jade); background: var(--jade-soft); }
.duo-ring--b { color: var(--indigo); background: var(--indigo-soft); }
.duo-line { flex: 1; height: 1px; background: repeating-linear-gradient(90deg, var(--line-2) 0 4px, transparent 4px 8px); }
.duo-score {
  display: inline-flex;
  align-items: baseline;
  gap: 3px;
  font-family: var(--f-num);
  font-size: 12px;
  color: var(--ink-3);
}
.duo-score b { font-size: 19px; color: var(--ink); font-weight: 600; }

/* 签卡视觉 */
.lot-mini {
  position: relative;
  margin-top: 2px;
  padding: 14px 14px 12px;
  border-radius: 14px;
  background: linear-gradient(160deg, #fdf8ec, #fbf1dd);
  border: 1px solid rgba(184, 137, 47, .2);
}
.lot-mini p {
  font-family: var(--f-display);
  font-size: 14px;
  line-height: 1.85;
  color: #6b5124;
  letter-spacing: .04em;
}
.lot-mini span {
  display: block;
  margin-top: 8px;
  font-size: 11px;
  letter-spacing: .14em;
  color: #a9803a;
}

/* 数据卡 */
.stat-row { display: flex; gap: 26px; margin-top: 4px; }
.stat-item b {
  display: block;
  font-family: var(--f-num);
  font-size: 26px;
  font-weight: 600;
  letter-spacing: -.01em;
  font-variant-numeric: tabular-nums;
}
.stat-item span { font-size: 11.5px; color: var(--ink-3); letter-spacing: .04em; }

.wx-stack-wrap { margin-top: auto; padding-top: 16px; }
.wx-stack-title { font-size: 11px; letter-spacing: .1em; color: var(--ink-3); margin-bottom: 9px; }
.wx-stack { display: flex; gap: 3px; height: 9px; border-radius: 5px; overflow: hidden; }
.wx-stack i { display: block; height: 100%; background: var(--el); opacity: .8; border-radius: 2px; }
.wx-stack-legend { display: flex; flex-wrap: wrap; gap: 4px 12px; margin-top: 10px; font-size: 11px; color: var(--ink-3); }
.wx-stack-legend span { display: inline-flex; align-items: center; gap: 5px; }

.lesson-mini { display: grid; gap: 0; margin-top: 2px; }
.lesson-mini li {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 13px;
  color: var(--ink-2);
}
.lesson-mini li:last-child { border-bottom: none; }
.lesson-mini b { font-family: var(--f-num); font-size: 11px; color: var(--ink-3); font-weight: 500; }
.lesson-mini em { margin-left: auto; font-style: normal; font-size: 11px; color: var(--ink-3); }

/* ============ 案例 ============ */

.case-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}
.case-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.case-card:hover { transform: translateY(-3px); box-shadow: var(--sh-2); border-color: var(--line-2); }
.case-top { display: flex; align-items: center; gap: 10px; }
.case-avatar {
  width: 40px; height: 40px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-display);
  font-size: 17px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--ink-2);
  flex: none;
}
.case-name { font-family: var(--f-display); font-size: 17px; letter-spacing: .04em; font-weight: 600; }
.case-sub { font-size: 11.5px; color: var(--ink-3); margin-top: 2px; }
.case-pillars {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}
.case-pillars div {
  display: grid;
  justify-items: center;
  gap: 2px;
}
.case-pillars b {
  font-family: var(--f-display);
  font-size: 19px;
  line-height: 1.2;
  color: var(--el, var(--ink));
  font-weight: 600;
}
.case-pillars span { font-size: 9.5px; color: var(--ink-3); letter-spacing: .06em; }
.case-note {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.8;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ============ 课程 ============ */

.learn-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 28px;
  align-items: start;
}
.cat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}
.cat-tabs button {
  padding: 8px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-2);
  background: var(--surface);
  font-size: 13.5px;
  color: var(--ink-2);
  cursor: pointer;
  transition: all .18s var(--ease);
}
.cat-tabs button:hover { border-color: var(--ink-3); color: var(--ink); }
.cat-tabs button.is-on {
  background: var(--ink);
  border-color: var(--ink);
  color: #fff;
}
.lesson-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 14px; }
.lesson-card {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  cursor: pointer;
  transition: transform .2s var(--ease), box-shadow .2s var(--ease), border-color .2s;
}
.lesson-card:hover { transform: translateY(-2px); box-shadow: var(--sh-2); border-color: var(--line-2); }
.lesson-meta { display: flex; align-items: center; gap: 8px; font-size: 11px; color: var(--ink-3); }
.lesson-card h3 { font-family: var(--f-display); font-size: 17.5px; letter-spacing: .03em; font-weight: 600; }
.lesson-card p { font-size: 13px; line-height: 1.8; color: var(--ink-2); }
.lesson-card .lesson-foot {
  margin-top: auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11.5px;
  color: var(--ink-3);
  padding-top: 6px;
}
.lesson-card .lesson-foot span { display: inline-flex; align-items: center; gap: 4px; }
.lesson-card .lesson-foot svg { width: 13px; height: 13px; fill: none; stroke: currentColor; stroke-width: 1.8; }

.learn-aside { position: sticky; top: 92px; display: grid; gap: 16px; }
.aside-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
}
.aside-card h3 { font-size: 14px; font-weight: 600; margin-bottom: 14px; letter-spacing: .04em; }
.progress-line {
  height: 6px;
  border-radius: 4px;
  background: var(--bg-soft);
  overflow: hidden;
  margin: 10px 0 8px;
}
.progress-line i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--red), #d3705c); }
.aside-note { font-size: 12px; line-height: 1.8; color: var(--ink-3); }

/* ============ 留言 ============ */

.quote-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.quote {
  padding: 22px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-1);
  display: flex;
  flex-direction: column;
  gap: 14px;
}
.quote-mark { font-family: var(--f-display); font-size: 30px; line-height: .6; color: var(--line-2); }
.quote p { font-size: 13.5px; line-height: 1.9; color: var(--ink-2); }
.quote footer { margin-top: auto; display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-3); }
.quote-avatar {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  display: grid; place-items: center;
  font-family: var(--f-display);
  font-size: 12px;
  color: var(--ink-2);
}

/* ============ CTA 横幅 ============ */

.cta-band {
  position: relative;
  overflow: hidden;
  padding: clamp(32px, 4vw, 52px);
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, #1b2420 0%, #223029 55%, #1a2b25 100%);
  color: #f3f4ee;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 24px;
  align-items: center;
}
.cta-band::before {
  content: "";
  position: absolute;
  right: -80px; top: -120px;
  width: 360px; height: 360px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(184, 137, 47, .28), transparent 68%);
}
.cta-band h2 {
  font-family: var(--f-display);
  font-size: clamp(24px, 2.8vw, 34px);
  line-height: 1.35;
  letter-spacing: .02em;
  font-weight: 600;
}
.cta-band p { margin-top: 10px; font-size: 14px; color: rgba(243, 244, 238, .68); max-width: 40em; line-height: 1.85; }
.cta-band .btn-primary { box-shadow: 0 12px 30px -16px rgba(0, 0, 0, .8); }

/* ============ 排盘页 ============ */

.paipan-top {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, .65fr);
  gap: 20px;
  align-items: start;
}
.form-card { padding: clamp(20px, 2.6vw, 30px); }
.form-card h2 { font-family: var(--f-display); font-size: 22px; letter-spacing: .04em; font-weight: 600; }
.form-card .form-sub { margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.form-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px 16px;
  margin-top: 22px;
}
.field { display: grid; gap: 7px; min-width: 0; }
.field > label { font-size: 12.5px; color: var(--ink-2); letter-spacing: .04em; display: flex; align-items: center; gap: 6px; }
.field .opt { font-size: 11px; color: var(--ink-3); }
.field-full { grid-column: 1 / -1; }
.field-err { font-size: 11.5px; color: var(--red); min-height: 0; display: none; }
.field-err.is-on { display: block; }

.input,
.select {
  width: 100%;
  height: 44px;
  padding: 0 13px;
  font-family: var(--f-sans);
  font-size: 14.5px;
  color: var(--ink);
  background: var(--surface-soft);
  border: 1px solid var(--line-2);
  border-radius: 10px;
  transition: border-color .18s, background .18s, box-shadow .18s;
  appearance: none;
}
.input::placeholder { color: var(--ink-3); }
.input:hover,
.select:hover { border-color: var(--ink-3); }
.input:focus,
.select:focus {
  outline: none;
  background: #fff;
  border-color: var(--jade);
  box-shadow: 0 0 0 3px rgba(31, 107, 88, .12);
}
.select {
  padding-right: 34px;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='8' viewBox='0 0 12 8'%3E%3Cpath d='M1 1.5L6 6.5l5-5' fill='none' stroke='%238b9297' stroke-width='1.6' stroke-linecap='round'/%3E%3C/svg%3E");
  background-repeat: no-repeat;
  background-position: right 13px center;
  cursor: pointer;
}
.field.has-error .input,
.field.has-error .select { border-color: var(--red); background: var(--red-soft); }

.seg {
  display: inline-flex;
  padding: 3px;
  gap: 2px;
  background: var(--bg-soft);
  border-radius: 10px;
  border: 1px solid var(--line);
  width: 100%;
}
.seg button {
  flex: 1;
  padding: 8px 10px;
  border: none;
  background: transparent;
  border-radius: 8px;
  font-size: 13px;
  color: var(--ink-2);
  cursor: pointer;
  transition: background .18s, color .18s, box-shadow .18s;
}
.seg button.is-on {
  background: #fff;
  color: var(--ink);
  font-weight: 500;
  box-shadow: 0 1px 3px rgba(20, 24, 27, .12);
}

.check-inline { display: inline-flex; align-items: center; gap: 8px; font-size: 12.5px; color: var(--ink-2); cursor: pointer; }
.check-inline input { position: absolute; opacity: 0; width: 1px; height: 1px; }
.check-inline i {
  width: 17px; height: 17px;
  border-radius: 5px;
  border: 1.5px solid var(--line-2);
  background: #fff;
  display: grid;
  place-items: center;
  transition: all .16s;
  flex: none;
}
.check-inline input:checked + i {
  background: var(--jade);
  border-color: var(--jade);
}
.check-inline input:checked + i::after {
  content: "";
  width: 4px; height: 8px;
  border-right: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(40deg) translateY(-1px);
}
.check-inline input:focus-visible + i { outline: 2px solid var(--red); outline-offset: 2px; }

.form-actions {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 20px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}
.form-actions .note { font-size: 11.5px; color: var(--ink-3); }

/* 侧栏 */
.side-stack { display: grid; gap: 16px; }
.side-card { padding: 20px; }
.side-card h3 { font-size: 13.5px; font-weight: 600; letter-spacing: .04em; margin-bottom: 12px; display: flex; align-items: center; gap: 8px; }
.side-card h3 svg { width: 16px; height: 16px; fill: none; stroke: var(--red); stroke-width: 1.7; }
.side-list { display: grid; gap: 10px; font-size: 13px; color: var(--ink-2); }
.side-list li { display: flex; gap: 8px; line-height: 1.75; }
.side-list li::before { content: ""; width: 4px; height: 4px; border-radius: 50%; background: var(--line-2); margin-top: 9px; flex: none; }
.today-mini { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.today-mini div { text-align: center; padding: 9px 2px; border-radius: 9px; background: var(--surface-soft); border: 1px solid var(--line); }
.today-mini span { display: block; font-size: 9.5px; color: var(--ink-3); letter-spacing: .1em; }
.today-mini b { font-family: var(--f-display); font-size: 17px; color: var(--el, var(--ink)); font-weight: 600; }

/* 结果 */
.result { margin-top: 32px; animation: pageIn .5s var(--ease) both; }
.result-head {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 18px;
}
.result-head h2 { font-family: var(--f-display); font-size: clamp(22px, 2.6vw, 30px); letter-spacing: .04em; font-weight: 600; }
.result-head .sub { margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.result-actions { display: flex; flex-wrap: wrap; gap: 8px; }

.result-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.6fr) minmax(0, 1fr);
  gap: 18px;
  align-items: start;
}
.stack { display: grid; gap: 18px; }

/* 命盘表 */
.chart-card { padding: 22px; overflow: hidden; }
.chart-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.chart-card-head h3 { font-family: var(--f-display); font-size: 18px; letter-spacing: .06em; font-weight: 600; }
.chart-wrap { overflow-x: auto; padding-bottom: 4px; }
.chart-table {
  display: grid;
  grid-template-columns: 68px repeat(4, minmax(78px, 1fr));
  min-width: 470px;
  border-top: 1px solid var(--line);
}
.chart-table > .cell {
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 4px;
  padding: 11px 6px;
  border-bottom: 1px solid var(--line);
  position: relative;
  font-size: 12px;
  color: var(--ink-2);
  text-align: center;
}
.chart-table > .cell:not(:nth-child(5n + 1))::before {
  content: "";
  position: absolute;
  left: 0; top: 12%; bottom: 12%;
  width: 1px;
  background: var(--line);
}
.chart-table > .row-label {
  justify-items: end;
  align-content: center;
  padding-right: 12px;
  font-size: 11px;
  color: var(--ink-3);
  letter-spacing: .12em;
  border-bottom: 1px solid var(--line);
}
.chart-table > .cell--head { padding-bottom: 8px; font-size: 11px; letter-spacing: .16em; color: var(--ink-3); border-bottom: none; }
.chart-table > .row-label--head { border-bottom: none; }

.ganzhi-big {
  position: relative;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  background: var(--el-soft);
  color: var(--el);
  font-family: var(--f-display);
  font-size: 28px;
  line-height: 1;
  font-weight: 600;
  border: 1px solid rgba(20, 24, 27, .06);
}
.ganzhi-big.is-day {
  box-shadow: 0 0 0 2px #fff, 0 0 0 3.5px var(--red);
}
.day-badge {
  position: absolute;
  top: -5px;
  right: -5px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--red);
  color: #fff;
  font-size: 9px;
  letter-spacing: .06em;
  line-height: 1.6;
}
.cell-god { font-size: 11.5px; color: var(--ink-2); letter-spacing: .02em; }
.cell-god.is-self { color: var(--red); font-weight: 500; }
.hidden-chips { display: flex; flex-wrap: wrap; gap: 3px; justify-content: center; }
.hidden-chips span {
  display: inline-flex;
  align-items: baseline;
  gap: 2px;
  padding: 1px 5px;
  border-radius: 5px;
  background: var(--el-soft);
  font-size: 10.5px;
  color: var(--el);
  line-height: 1.7;
}
.hidden-chips span i { font-style: normal; font-size: 9px; opacity: .75; }
.cell-sub { font-size: 11px; color: var(--ink-3); }
.kong-on { color: var(--red); }

/* 五行 / 日主 */
.wuxing-bars { display: grid; gap: 10px; }
.wx-row { display: grid; grid-template-columns: 34px 1fr 36px; align-items: center; gap: 10px; font-size: 12px; }
.wx-name { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-2); }
.wx-track { height: 7px; border-radius: 4px; background: var(--bg-soft); overflow: hidden; }
.wx-track i { display: block; height: 100%; border-radius: inherit; background: var(--el); opacity: .85; transition: width .8s var(--ease); }
.wx-pct { text-align: right; font-family: var(--f-num); font-size: 11.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }

.master-card {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 16px;
  align-items: center;
}
.master-char {
  width: 64px; height: 64px;
  border-radius: 18px;
  display: grid; place-items: center;
  background: var(--el-soft);
  color: var(--el);
  font-family: var(--f-display);
  font-size: 34px;
  font-weight: 600;
  border: 1px solid rgba(20, 24, 27, .07);
}
.master-card h3 { font-family: var(--f-display); font-size: 18px; letter-spacing: .04em; font-weight: 600; }
.master-card p { margin-top: 5px; font-size: 12.5px; color: var(--ink-2); line-height: 1.8; }
.master-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 12px; }

.yong-list { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.yong-chip {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border-radius: 8px;
  background: var(--el-soft);
  color: var(--el);
  font-size: 12px;
}

/* 大运 */
.dayun-scroll {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: thin;
}
.dayun-item {
  flex: 0 0 100px;
  padding: 14px 10px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  text-align: center;
  transition: all .2s var(--ease);
}
.dayun-item:hover { background: #fff; border-color: var(--line-2); transform: translateY(-2px); }
.dayun-item.is-now {
  background: var(--red-soft);
  border-color: rgba(185, 58, 43, .28);
  box-shadow: 0 0 0 3px rgba(185, 58, 43, .07);
}
.dayun-gz { font-family: var(--f-display); font-size: 22px; letter-spacing: .04em; color: var(--ink); font-weight: 600; }
.dayun-gz span:first-child { color: var(--el); }
.dayun-age { margin-top: 6px; font-size: 11px; color: var(--ink-2); font-family: var(--f-num); }
.dayun-god { margin-top: 2px; font-size: 10.5px; color: var(--ink-3); }
.dayun-item.is-now .dayun-god { color: var(--red); }
.dayun-tag {
  display: inline-block;
  margin-top: 6px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--red);
  color: #fff;
  font-size: 9.5px;
  letter-spacing: .08em;
}

/* 流年 */
.liunian-list { display: grid; gap: 0; }
.liunian-row {
  display: grid;
  grid-template-columns: 52px 64px 62px 1fr;
  gap: 12px;
  align-items: center;
  padding: 11px 4px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.liunian-row:last-child { border-bottom: none; }
.liunian-row .yr { font-family: var(--f-num); font-size: 12.5px; color: var(--ink-3); font-variant-numeric: tabular-nums; }
.liunian-row .gz { font-family: var(--f-display); font-size: 17px; letter-spacing: .04em; font-weight: 600; }
.liunian-row .gz span:first-child { color: var(--el); }
.liunian-row .god { font-size: 12px; color: var(--ink-2); }
.liunian-row .tip { font-size: 12px; color: var(--ink-3); line-height: 1.7; }
.liunian-row.is-now { background: linear-gradient(90deg, var(--red-soft), transparent); border-radius: 8px; }
.liunian-row.is-now .yr { color: var(--red); }

/* 空态 / 提示 */
.empty {
  padding: 56px 24px;
  text-align: center;
  color: var(--ink-3);
  font-size: 13.5px;
  border: 1px dashed var(--line-2);
  border-radius: var(--r-lg);
  background: rgba(255, 255, 255, .5);
}
.empty strong { display: block; font-family: var(--f-display); font-size: 19px; color: var(--ink-2); margin-bottom: 8px; font-weight: 600; }

.note-box {
  display: flex;
  gap: 10px;
  padding: 12px 14px;
  border-radius: var(--r-sm);
  background: var(--gold-soft);
  border: 1px solid rgba(184, 137, 47, .2);
  font-size: 12px;
  line-height: 1.8;
  color: #6b5124;
}
.note-box b { flex: none; }

/* ============ 合盘 ============ */

.hepan-grid {
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  gap: 18px;
  align-items: stretch;
}
.person-card { padding: 22px; }
.person-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.person-head h3 { font-family: var(--f-display); font-size: 19px; letter-spacing: .04em; font-weight: 600; }
.person-badge {
  width: 34px; height: 34px;
  border-radius: 50%;
  display: grid; place-items: center;
  font-family: var(--f-display);
  font-size: 15px;
  background: var(--jade-soft);
  color: var(--jade);
}
.person-badge--b { background: var(--indigo-soft); color: var(--indigo); }
.vs-badge {
  align-self: center;
  width: 54px; height: 54px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--sh-2);
  font-family: var(--f-display);
  font-size: 15px;
  color: var(--ink-3);
  letter-spacing: .06em;
}

.score-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 26px;
  align-items: center;
  padding: 26px;
}
.score-ring { position: relative; width: 132px; height: 132px; }
.score-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.score-ring circle { fill: none; stroke-width: 9; stroke-linecap: round; }
.score-ring .track { stroke: var(--bg-soft); }
.score-ring .bar { stroke: url(#scoreGrad); transition: stroke-dashoffset 1s var(--ease); }
.score-num {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
}
.score-num b { font-family: var(--f-num); font-size: 34px; font-weight: 600; line-height: 1; font-variant-numeric: tabular-nums; }
.score-num span { font-size: 10.5px; color: var(--ink-3); letter-spacing: .16em; margin-top: 5px; }
.score-copy h3 { font-family: var(--f-display); font-size: 21px; letter-spacing: .03em; font-weight: 600; }
.score-copy p { margin-top: 8px; font-size: 13.5px; line-height: 1.9; color: var(--ink-2); }

.dim-grid { display: grid; gap: 14px; }
.dim-row { display: grid; grid-template-columns: 62px 1fr 34px; gap: 12px; align-items: center; font-size: 12.5px; }
.dim-track { height: 6px; border-radius: 4px; background: var(--bg-soft); overflow: hidden; }
.dim-track i { display: block; height: 100%; border-radius: inherit; background: linear-gradient(90deg, var(--jade), #4c9a7f); }
.dim-row b { font-family: var(--f-num); font-size: 12px; color: var(--ink-2); text-align: right; font-variant-numeric: tabular-nums; }

.hepan-cols { display: grid; grid-template-columns: 1fr; gap: 18px; }
.mini-person { display: grid; gap: 10px; }
.mini-person header { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.mini-pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; }
.mini-pillars div { text-align: center; padding: 8px 2px; border-radius: 9px; background: var(--surface-soft); border: 1px solid var(--line); }
.mini-pillars b { display: block; font-family: var(--f-display); font-size: 16px; color: var(--el, var(--ink)); font-weight: 600; }
.mini-pillars span { font-size: 9.5px; color: var(--ink-3); }

/* ============ 抽签 ============ */

.lot-grid {
  display: grid;
  grid-template-columns: minmax(0, .82fr) minmax(0, 1.18fr);
  gap: clamp(22px, 4vw, 48px);
  align-items: center;
}
.lot-stage {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 430px;
  padding: 26px;
  border-radius: var(--r-xl);
  background:
    radial-gradient(circle at 50% 22%, rgba(184, 137, 47, .14), transparent 62%),
    linear-gradient(180deg, #fbf8f0, #f6f1e4);
  border: 1px solid rgba(184, 137, 47, .18);
  overflow: hidden;
}
.lot-stage::before {
  content: "";
  position: absolute;
  inset: 0;
  background-image: radial-gradient(rgba(184, 137, 47, .16) 1px, transparent 1.4px);
  background-size: 14px 14px;
  opacity: .5;
  -webkit-mask-image: radial-gradient(circle at 50% 40%, #000, transparent 72%);
  mask-image: radial-gradient(circle at 50% 40%, #000, transparent 72%);
}
.tube {
  position: relative;
  width: 168px;
  height: 258px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  align-items: center;
  transform-origin: 50% 92%;
  z-index: 1;
}
.tube.is-shaking { animation: shake .72s cubic-bezier(.36, .07, .19, .97); }
.tube-sticks {
  position: absolute;
  left: 50%;
  top: 0;
  transform: translateX(-50%);
  width: 138px;
  height: 190px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  gap: 4px;
}
.tube-sticks span {
  width: 9px;
  border-radius: 4px 4px 0 0;
  background: linear-gradient(180deg, #f4e3bd, #e7d0a0);
  border: 1px solid rgba(154, 116, 45, .35);
  border-bottom: none;
  box-shadow: inset -2px 0 0 rgba(255, 255, 255, .5);
}
.tube-body {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 122px;
  border-radius: 10px 10px 20px 20px;
  background: linear-gradient(160deg, #a53526, #8d2a1d);
  border: 1px solid rgba(80, 24, 16, .5);
  box-shadow: 0 22px 34px -22px rgba(94, 31, 22, .8), inset 0 2px 0 rgba(255, 255, 255, .16);
  display: grid;
  place-items: center;
}
.tube-body::before {
  content: "";
  position: absolute;
  left: 8px; right: 8px; top: 16px;
  height: 8px;
  border-radius: 4px;
  background: linear-gradient(90deg, #d9a63f, #f0c977, #d9a63f);
  opacity: .85;
}
.tube-body strong {
  writing-mode: vertical-rl;
  font-family: var(--f-display);
  font-size: 19px;
  letter-spacing: .3em;
  color: #f7e6c4;
  padding-top: 30px;
  font-weight: 500;
}
.lot-stage-foot {
  position: absolute;
  bottom: 16px;
  left: 0; right: 0;
  text-align: center;
  font-size: 11.5px;
  color: #9b7c46;
  letter-spacing: .08em;
  z-index: 1;
}

.lot-copy h1 { margin-top: 16px; }
.lot-copy .lead { margin-top: 14px; color: var(--ink-2); font-size: 15px; line-height: 1.9; }
.lot-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 16px; align-items: center; }
.lot-hint { margin-bottom: 10px; font-size: 12px; color: var(--ink-3); letter-spacing: .04em; }
.lot-hint::before { content: ""; display: inline-block; width: 5px; height: 5px; border-radius: 50%; background: var(--gold); margin-right: 7px; vertical-align: 2px; }
.lot-count { font-size: 12px; color: var(--ink-3); }
.lot-count b { font-family: var(--f-num); color: var(--ink-2); }

.slip-card {
  position: relative;
  max-width: 566px;
  padding: 24px;
  background: linear-gradient(175deg, #fffdf7, #fdf9ef);
  border: 1px solid rgba(184, 137, 47, .26);
  border-radius: var(--r-lg);
  box-shadow: var(--sh-3);
  animation: slipIn .55s var(--ease) both;
}
@keyframes slipIn {
  from { opacity: 0; transform: translateY(14px) rotate(-.8deg); }
  to { opacity: 1; transform: none; }
}
.slip-head { display: flex; align-items: center; gap: 10px; padding-bottom: 14px; border-bottom: 1px dashed rgba(184, 137, 47, .32); }
.slip-no { font-family: var(--f-num); font-size: 12px; letter-spacing: .08em; color: #a9803a; }
.slip-title { font-family: var(--f-display); font-size: 17px; letter-spacing: .06em; color: #6b5124; font-weight: 600; }
.slip-grade {
  margin-left: auto;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  font-size: 11.5px;
  letter-spacing: .1em;
}
.slip-poem {
  display: grid;
  gap: 6px;
  margin: 18px 0;
  font-family: var(--f-display);
  font-size: 16.5px;
  line-height: 1.95;
  letter-spacing: .08em;
  color: #4a3a1d;
}
.slip-read { display: flex; gap: 10px; font-size: 13.5px; line-height: 1.85; color: #6b5124; }
.slip-read span {
  flex: none;
  width: 22px; height: 22px;
  border-radius: 6px;
  display: grid; place-items: center;
  background: rgba(184, 137, 47, .16);
  color: #a9803a;
  font-family: var(--f-display);
  font-size: 11.5px;
  margin-top: 3px;
}
.slip-advice {
  margin-top: 14px;
  padding: 12px 14px;
  border-radius: 10px;
  background: rgba(184, 137, 47, .09);
  font-size: 12.5px;
  line-height: 1.8;
  color: #6b5124;
}
.slip-advice b { color: #8a6526; font-weight: 600; }
.slip-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 18px; }

.lot-all { display: grid; grid-template-columns: repeat(6, 1fr); gap: 10px; }
.lot-chip {
  display: grid;
  gap: 2px;
  padding: 12px 8px;
  border-radius: 12px;
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  text-align: center;
  transition: all .18s var(--ease);
}
.lot-chip:hover { transform: translateY(-2px); box-shadow: var(--sh-1); border-color: var(--line-2); }
.lot-chip b { font-family: var(--f-display); font-size: 20px; color: var(--el); font-weight: 600; }
.lot-chip span { font-size: 10px; color: var(--ink-3); }
.lot-chip em { font-style: normal; font-size: 10px; color: var(--ink-2); }

/* 历史 */
.history-list { display: grid; gap: 0; }
.history-row {
  display: grid;
  grid-template-columns: 42px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 12px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.history-row:last-child { border-bottom: none; }
.history-branch {
  width: 36px; height: 36px;
  border-radius: 10px;
  display: grid; place-items: center;
  background: var(--el-soft);
  color: var(--el);
  font-family: var(--f-display);
  font-size: 17px;
}
.history-row b { font-weight: 500; }
.history-row small { display: block; color: var(--ink-3); font-size: 11px; }

/* ============ 记录 / 我的 ============ */

.record-list { display: grid; gap: 12px; }
.record-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 16px 18px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-md);
  box-shadow: var(--sh-1);
  transition: border-color .18s, box-shadow .18s;
}
.record-row:hover { border-color: var(--line-2); box-shadow: var(--sh-2); }
.record-four { display: flex; gap: 6px; flex-wrap: wrap; }
.record-four span {
  font-family: var(--f-display);
  font-size: 15px;
  padding: 4px 8px;
  border-radius: 7px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
  color: var(--el, var(--ink));
}
.record-main b { font-size: 14.5px; font-weight: 600; }
.record-main small { display: block; margin-top: 2px; color: var(--ink-3); font-size: 11.5px; }
.record-actions { display: flex; gap: 6px; }

.profile-card {
  display: flex;
  align-items: center;
  gap: 18px;
  padding: 26px;
  border-radius: var(--r-xl);
  background: linear-gradient(135deg, #1c2723, #26362f);
  color: #f2f4ee;
  position: relative;
  overflow: hidden;
}
.profile-card::after {
  content: "玄";
  position: absolute;
  right: 18px; bottom: -34px;
  font-family: var(--f-display);
  font-size: 150px;
  line-height: 1;
  color: rgba(255, 255, 255, .05);
}
.profile-avatar {
  width: 62px; height: 62px;
  border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, .1);
  border: 1px solid rgba(255, 255, 255, .18);
  font-family: var(--f-display);
  font-size: 26px;
  flex: none;
}
.profile-info h1 { font-family: var(--f-display); font-size: 24px; letter-spacing: .06em; font-weight: 600; }
.profile-info p { margin-top: 4px; font-size: 12.5px; color: rgba(242, 244, 238, .68); }
.profile-tags { display: flex; gap: 8px; margin-top: 10px; }
.profile-tags span {
  padding: 3px 9px;
  border-radius: 6px;
  background: rgba(255, 255, 255, .1);
  font-size: 11px;
  color: rgba(242, 244, 238, .82);
}
.profile-stats { margin-left: auto; display: flex; gap: 26px; position: relative; z-index: 1; }
.profile-stats b { display: block; font-family: var(--f-num); font-size: 22px; font-weight: 600; }
.profile-stats span { font-size: 11px; color: rgba(242, 244, 238, .62); }

.plan-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 16px; }
.plan-card {
  position: relative;
  padding: 24px;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--r-lg);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.plan-card.is-hl { border-color: rgba(185, 58, 43, .3); box-shadow: 0 20px 44px -30px rgba(185, 58, 43, .8); }
.plan-name { font-size: 13px; color: var(--ink-3); letter-spacing: .12em; }
.plan-price { display: flex; align-items: baseline; gap: 4px; font-family: var(--f-num); }
.plan-price b { font-size: 34px; font-weight: 600; letter-spacing: -.02em; }
.plan-price span { font-size: 12px; color: var(--ink-3); }
.plan-desc { font-size: 12.5px; color: var(--ink-2); }
.plan-list { display: grid; gap: 8px; font-size: 12.5px; color: var(--ink-2); margin-top: 4px; }
.plan-list li { display: flex; gap: 8px; align-items: flex-start; }
.plan-list li svg { width: 15px; height: 15px; flex: none; margin-top: 3px; fill: none; stroke: var(--jade); stroke-width: 2; }
.plan-card .btn { margin-top: auto; }
.plan-badge {
  position: absolute;
  top: -10px; left: 22px;
  padding: 3px 10px;
  border-radius: 6px;
  background: var(--red);
  color: #fff;
  font-size: 10.5px;
  letter-spacing: .08em;
}

.settings-list { display: grid; gap: 0; }
.settings-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 2px;
  border-bottom: 1px solid var(--line);
  font-size: 13.5px;
}
.settings-row:last-child { border-bottom: none; }
.settings-row svg { width: 17px; height: 17px; fill: none; stroke: var(--ink-3); stroke-width: 1.6; }
.settings-row span { color: var(--ink-2); }
.settings-row .val { margin-left: auto; color: var(--ink-3); font-size: 12.5px; }

/* ============ 弹窗 ============ */

.modal-mask {
  position: fixed;
  inset: 0;
  z-index: 120;
  display: grid;
  place-items: center;
  padding: 20px;
  background: rgba(16, 20, 18, .44);
  backdrop-filter: blur(6px);
  animation: fadeIn .2s ease both;
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.modal {
  position: relative;
  width: min(520px, 100%);
  max-height: 88vh;
  overflow: auto;
  padding: 26px;
  background: var(--surface);
  border-radius: var(--r-xl);
  box-shadow: 0 40px 90px -40px rgba(0, 0, 0, .6);
  animation: modalIn .3s var(--ease) both;
}
.modal--wide { width: min(720px, 100%); }
@keyframes modalIn {
  from { opacity: 0; transform: translateY(14px) scale(.98); }
  to { opacity: 1; transform: none; }
}
.modal-close {
  position: absolute;
  right: 14px; top: 14px;
  width: 32px; height: 32px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: var(--surface-soft);
  color: var(--ink-2);
  display: grid; place-items: center;
  cursor: pointer;
  transition: background .16s, color .16s;
}
.modal-close:hover { background: var(--bg-soft); color: var(--ink); }
.modal-close svg { width: 15px; height: 15px; fill: none; stroke: currentColor; stroke-width: 1.8; }
.modal h2 { font-family: var(--f-display); font-size: 23px; letter-spacing: .04em; font-weight: 600; padding-right: 40px; }
.modal .modal-sub { margin-top: 6px; font-size: 13px; color: var(--ink-3); }
.modal-body { margin-top: 18px; font-size: 14px; line-height: 1.9; color: var(--ink-2); }
.modal-body p + p { margin-top: 12px; }
.modal-foot { margin-top: 22px; display: flex; gap: 10px; justify-content: flex-end; flex-wrap: wrap; }

.auth-tabs { display: flex; gap: 6px; margin-top: 18px; padding: 3px; background: var(--bg-soft); border-radius: 10px; }
.auth-tabs button { flex: 1; padding: 8px; border: none; background: transparent; border-radius: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.auth-tabs button.is-on { background: #fff; color: var(--ink); box-shadow: 0 1px 3px rgba(20, 24, 27, .1); }
.auth-form { display: grid; gap: 12px; margin-top: 16px; }

.lesson-body h3 { font-family: var(--f-display); font-size: 17px; margin-top: 18px; letter-spacing: .03em; font-weight: 600; }
.lesson-body p { margin-top: 10px; font-size: 14px; line-height: 1.95; color: var(--ink-2); }
.lesson-figure {
  margin-top: 18px;
  padding: 16px;
  border-radius: var(--r-md);
  background: var(--surface-soft);
  border: 1px solid var(--line);
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink-2);
}
.lesson-figure b { color: var(--ink); }

.case-modal-pillars { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-top: 18px; }
.case-modal-pillars div {
  text-align: center;
  padding: 16px 6px;
  border-radius: 14px;
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.case-modal-pillars b { display: block; font-family: var(--f-display); font-size: 26px; color: var(--el); font-weight: 600; line-height: 1.25; }
.case-modal-pillars span { font-size: 10px; color: var(--ink-3); letter-spacing: .08em; }
.case-modal-gods { display: flex; gap: 6px; justify-content: center; flex-wrap: wrap; margin-top: 10px; }

/* 分享卡 */
.share-preview { display: grid; place-items: center; }
.share-preview canvas { width: 100%; max-width: 340px; border-radius: var(--r-md); border: 1px solid var(--line); }

/* ============ 吐司 ============ */

.toasts {
  position: fixed;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: min(420px, calc(100% - 32px));
  pointer-events: none;
}
.toast {
  max-width: 100%;
  padding: 11px 16px;
  border-radius: 12px;
  background: rgba(22, 30, 26, .94);
  color: #f2f4ee;
  font-size: 13px;
  line-height: 1.6;
  box-shadow: 0 16px 30px -18px rgba(0, 0, 0, .7);
  animation: toastIn .28s var(--ease) both;
  backdrop-filter: blur(8px);
}
.toast--warn { background: rgba(140, 44, 30, .96); }
.toast.is-out { animation: toastOut .24s ease forwards; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ============ 页脚 ============ */

.site-footer {
  margin-top: clamp(40px, 6vw, 80px);
  padding: clamp(36px, 5vw, 56px) 0 calc(28px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface-soft);
}
.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1.4fr;
  gap: 40px;
}
.footer-desc { margin-top: 14px; font-size: 12.5px; line-height: 1.9; color: var(--ink-3); }
.footer-links { display: grid; grid-template-columns: 1fr 1fr; gap: 24px; }
.footer-title { font-size: 11.5px; letter-spacing: .18em; color: var(--ink-3); margin-bottom: 12px; }
.footer-links a { display: block; font-size: 13px; color: var(--ink-2); padding: 4px 0; transition: color .16s; }
.footer-links a:hover { color: var(--red); }
.footer-note p { font-size: 12px; line-height: 1.9; color: var(--ink-3); }
.footer-copy { margin-top: 12px; font-family: var(--f-num); font-size: 11px; color: var(--ink-3); opacity: .8; }

/* ============ 底部标签栏（移动端） ============ */

.tabbar {
  display: none;
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 90;
  height: calc(58px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: rgba(252, 253, 249, .94);
  backdrop-filter: blur(14px);
  border-top: 1px solid var(--line);
}
.tabbar a {
  flex: 1;
  display: grid;
  justify-items: center;
  align-content: center;
  gap: 3px;
  font-size: 10.5px;
  color: var(--ink-3);
  padding-top: 6px;
}
.tabbar a svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.7; stroke-linecap: round; stroke-linejoin: round; }
.tabbar a.is-active { color: var(--red); }
.tabbar a.is-active svg { stroke: var(--red); }

/* ============ 滚动出现 ============ */

.reveal { opacity: 0; transform: translateY(14px); transition: opacity .65s var(--ease), transform .65s var(--ease); transition-delay: var(--d, 0s); }
.reveal.is-in { opacity: 1; transform: none; }

/* ============ 响应式 ============ */

@media (max-width: 1080px) {
  .nav-menu { gap: 0; margin-left: 0; }
  .nav-menu a { padding: 8px 9px; font-size: 13.5px; }
  .b-card--chart { grid-column: span 12; }
  .b-card--hepan, .b-card--lot { grid-column: span 6; }
  .b-card--learn, .b-card--case, .b-card--stat { grid-column: span 6; }
  .case-grid { grid-template-columns: repeat(2, 1fr); }
  .quote-grid { grid-template-columns: repeat(2, 1fr); }
  .paipan-top { grid-template-columns: 1fr; }
  .result-grid { grid-template-columns: 1fr; }
  .learn-layout { grid-template-columns: 1fr; }
  .learn-aside { position: static; grid-template-columns: 1fr 1fr; display: grid; }
  .plan-grid { grid-template-columns: 1fr; }
  .hepan-grid { grid-template-columns: 1fr; }
  .vs-badge { justify-self: center; }
}

@media (max-width: 900px) {
  .nav-menu { display: none; }
  .nav-actions .btn-ghost { display: none; }
  .hero-grid { grid-template-columns: 1fr; }
  .hero h1 { font-size: clamp(32px, 7.4vw, 46px); }
  .today-card { max-width: 540px; }
  .quick-grid { grid-template-columns: 1fr 1fr; }
  .quick-grid > .btn { grid-column: 1 / -1; }
  .footer-grid { grid-template-columns: 1fr 1fr; }
  .footer-note { grid-column: 1 / -1; }
}

@media (max-width: 720px) {
  .paipan-top .side-stack .side-card:nth-child(2),
  .paipan-top .side-stack .side-card:nth-child(3) { display: none; }
  .container { width: calc(100% - 32px); }
  .tabbar { display: flex; }
  .site-footer { padding-bottom: calc(84px + env(safe-area-inset-bottom)); }
  .toasts { bottom: calc(76px + env(safe-area-inset-bottom)); }
  .nav-inner { height: 62px; }
  .nav-actions .btn { padding: 8px 13px; font-size: 13px; }
  .hero { padding-top: 22px; }
  .section { padding: 44px 0; }
  .section-head { flex-direction: column; align-items: flex-start; gap: 10px; }
  .b-card--hepan, .b-card--lot, .b-card--learn, .b-card--case, .b-card--stat { grid-column: span 12; }
  .case-grid, .quote-grid, .lesson-grid { grid-template-columns: 1fr; }
  .stats, .form-grid { grid-template-columns: 1fr; }
  .field-full { grid-column: auto; }
  .lot-grid { grid-template-columns: 1fr; }
  .lot-stage { min-height: 380px; }
  .lot-all { grid-template-columns: repeat(3, 1fr); }
  .chart-table { grid-template-columns: 42px repeat(4, 1fr); min-width: 0; }
  .chart-table > .cell { padding: 9px 2px; gap: 3px; }
  .chart-table > .row-label { padding-right: 6px; font-size: 10px; letter-spacing: .04em; }
  .ganzhi-big { width: 38px; height: 38px; font-size: 20px; border-radius: 10px; }
  .day-badge { top: -4px; right: -4px; font-size: 8px; padding: 0 3px; }
  .hidden-chips span { font-size: 9px; padding: 0 3px; }
  .hidden-chips span i { display: none; }
  .cell-sub { font-size: 9.5px; }
  .cell-god { font-size: 10px; }
  .liunian-row { grid-template-columns: 46px 58px 1fr; row-gap: 2px; }
  .liunian-row .tip { grid-column: 1 / -1; }
  .learn-aside { grid-template-columns: 1fr; }
  .score-hero { grid-template-columns: 1fr; justify-items: center; text-align: center; }
  .profile-card { flex-wrap: wrap; }
  .profile-stats { margin-left: 0; width: 100%; justify-content: space-between; }
  .footer-grid { grid-template-columns: 1fr; gap: 28px; }
  .cta-band { grid-template-columns: 1fr; }
  .cta-band .btn { justify-self: start; }
  .result-actions { width: 100%; }
  .record-row { grid-template-columns: 1fr; gap: 10px; }
  .record-actions { justify-content: flex-start; }
  .modal { padding: 20px; }
}

@media (max-width: 420px) {
  .quick-grid { grid-template-columns: 1fr; }
  .today-pillars { gap: 6px; }
  .today-col .gan { font-size: 24px; }
  .today-col .zhi { font-size: 21px; }
  .dayun-item { flex-basis: 92px; }
  .lot-actions .btn { width: 100%; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .reveal { opacity: 1; transform: none; }
}
