/* ═══════════════════════════════════════════════════════════
   周易学习站 · 视觉系统 v2
   暗色墨韵主题 + 发光描边 + 朱砂点缀 + 动效
   保留 v1 全部类名以兼容既有页面
   ═══════════════════════════════════════════════════════════ */

:root {
  /* 底色：深墨宣纸 */
  --paper: #14100c;
  --paper2: #1e1811;
  --paper3: #272019;
  --ink: #f0e6d2;
  --muted: #a89madd;
  --muted: #a2937c;
  --line: rgba(212, 175, 110, .18);
  --line-strong: rgba(212, 175, 110, .34);
  --seal: #d4462f;
  --gold: #d4a34a;
  --gold-bright: #f0c76a;
  --jade: #4a9d84;
  --violet: #8b7fd4;
  --dark: #0d0a07;
  --shadow: 0 20px 60px rgba(0, 0, 0, .5);
  --glow: 0 0 0 1px rgba(212, 163, 74, .22), 0 0 28px rgba(212, 163, 74, .1);
  --glow-strong: 0 0 0 1px rgba(212, 163, 74, .5), 0 0 44px rgba(212, 163, 74, .22);
  --radius: 20px;
  --font-serif: "Songti SC", "STSong", "Noto Serif CJK SC", Georgia, serif;
  --font-sans: -apple-system, "PingFang SC", "Helvetica Neue", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }

html {
  scroll-behavior: smooth;
  scroll-padding-top: 84px;
}

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--font-serif);
  line-height: 1.8;
  overflow-x: hidden;
}

/* ── 背景层：网格 + 双色辉光 + 粒子画布 ── */
.ink-bg {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: -2;
  background:
    radial-gradient(ellipse 90% 60% at 15% 0%, rgba(212, 163, 74, .16), transparent 60%),
    radial-gradient(ellipse 70% 50% at 92% 8%, rgba(74, 157, 132, .12), transparent 60%),
    radial-gradient(ellipse 80% 70% at 50% 100%, rgba(139, 127, 212, .09), transparent 60%),
    linear-gradient(90deg, rgba(212, 163, 74, .035) 1px, transparent 1px),
    linear-gradient(rgba(212, 163, 74, .03) 1px, transparent 1px);
  background-size: auto, auto, auto, 40px 40px, 40px 40px;
}

#inkCanvas {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: -1;
}

/* ── 顶栏 ── */
.site-header {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #120e0a 0%, #2a1f14 45%, #4a3418 78%, #6b4c1e 100%);
  border-bottom: 1px solid var(--line);
}

.site-header::after {
  content: "易";
  position: absolute;
  right: 5%;
  top: -60px;
  font-size: 280px;
  opacity: .06;
  font-weight: 900;
  color: var(--gold-bright);
  pointer-events: none;
  animation: breathe 7s ease-in-out infinite;
}

@keyframes breathe {
  0%, 100% { transform: scale(1) rotate(0deg); opacity: .06; }
  50% { transform: scale(1.05) rotate(-3deg); opacity: .1; }
}

.top-nav {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
  justify-content: center;
  padding: 14px 16px;
  border-bottom: 1px solid rgba(212, 175, 110, .12);
  backdrop-filter: blur(10px);
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(14, 11, 8, .82);
}

.top-nav a {
  color: #e8dcc4;
  text-decoration: none;
  padding: 7px 15px;
  border: 1px solid rgba(212, 175, 110, .2);
  border-radius: 999px;
  font-size: 14px;
  font-family: var(--font-sans);
  transition: .28s cubic-bezier(.22, 1, .36, 1);
  position: relative;
}

.top-nav a:hover {
  background: rgba(212, 163, 74, .14);
  border-color: var(--gold);
  color: var(--gold-bright);
  transform: translateY(-2px);
}

.top-nav a.active {
  background: linear-gradient(135deg, var(--gold), #b8862f);
  border-color: var(--gold-bright);
  color: #1a1309;
  font-weight: 600;
  box-shadow: 0 0 22px rgba(212, 163, 74, .35);
}

.top-nav a.is-current {
  border-color: var(--gold);
  color: var(--gold-bright);
}

/* 滚动进度条 */
.scroll-progress {
  position: absolute;
  left: 0;
  top: 0;
  height: 2px;
  width: 0;
  background: linear-gradient(90deg, var(--seal), var(--gold), var(--jade));
  box-shadow: 0 0 12px rgba(212, 163, 74, .6);
  z-index: 50;
  transition: width .1s linear;
}

/* ── Hero ── */
.hero {
  max-width: 1180px;
  margin: 0 auto;
  padding: 84px 22px 96px;
  position: relative;
}

.hero.compact { padding: 52px 22px 66px; }

.eyebrow {
  letter-spacing: .3em;
  color: var(--gold);
  font-size: 13px;
  font-family: var(--font-sans);
  text-transform: uppercase;
}

.hero h1 {
  font-size: clamp(34px, 6vw, 74px);
  line-height: 1.08;
  margin: 10px 0 20px;
  background: linear-gradient(120deg, #fff6e2 10%, var(--gold-bright) 55%, var(--gold) 90%);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  animation: titleIn .9s cubic-bezier(.22, 1, .36, 1) both;
}

@keyframes titleIn {
  /* 只用 opacity + transform。原先 from 里还有 filter: blur(6px)，
     Chrome 会把元素提为合成层且结束后仍保留 blur(0px)，
     与 background-clip: text 一起会导致标题渲染成一团模糊的渐变块、
     文字完全看不清。宁可少一点模糊入场。 */
  from { opacity: 0; transform: translateY(26px); }
  to { opacity: 1; transform: none; }
}

.hero-subtitle {
  max-width: 780px;
  font-size: 18px;
  color: #c9bb9f;
  animation: titleIn .9s .15s cubic-bezier(.22, 1, .36, 1) both;
}

.hero-actions {
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  margin-top: 32px;
}

/* ── 按钮 ── */
.btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid var(--gold);
  border-radius: 999px;
  padding: 12px 22px;
  background: linear-gradient(135deg, var(--gold), #a8741f);
  color: #191208;
  text-decoration: none;
  cursor: pointer;
  font-weight: 600;
  font-family: var(--font-sans);
  position: relative;
  overflow: hidden;
  transition: .3s cubic-bezier(.22, 1, .36, 1);
}

.btn::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(120deg, transparent 30%, rgba(255, 255, 255, .45), transparent 70%);
  transform: translateX(-120%);
  transition: transform .7s;
}

.btn:hover {
  transform: translateY(-3px);
  box-shadow: 0 12px 34px rgba(212, 163, 74, .34);
}

.btn:hover::after { transform: translateX(120%); }

.btn.secondary {
  background: rgba(212, 163, 74, .08);
  border-color: var(--line-strong);
  color: var(--gold-bright);
}

.btn.secondary:hover {
  background: rgba(212, 163, 74, .16);
  border-color: var(--gold);
  box-shadow: 0 12px 34px rgba(212, 163, 74, .18);
}

.btn:active { transform: translateY(-1px) scale(.98); }

/* ── 布局 ── */
.page-shell {
  max-width: 1180px;
  margin: 0 auto;
  padding: 40px 20px 90px;
}

.section { margin: 40px 0; }

.section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 22px;
}

.section-title::before {
  content: "";
  width: 5px;
  height: 34px;
  background: linear-gradient(180deg, var(--seal), var(--gold));
  border-radius: 3px;
  box-shadow: 0 0 14px rgba(212, 70, 47, .5);
}

.section-title h2 {
  font-size: clamp(21px, 2.6vw, 29px);
  margin: 0;
  letter-spacing: .04em;
}

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  gap: 18px;
}

/* ── 卡片：毛玻璃 + 描边光晕 ── */
.card {
  background: linear-gradient(160deg, rgba(38, 32, 25, .92), rgba(24, 19, 14, .92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 24px;
  box-shadow: var(--shadow);
  position: relative;
  overflow: hidden;
  transition: .4s cubic-bezier(.22, 1, .36, 1);
  backdrop-filter: blur(12px);
}

.card::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(420px 180px at var(--mx, 50%) var(--my, 0%), rgba(212, 163, 74, .13), transparent 70%);
  opacity: 0;
  transition: opacity .4s;
  pointer-events: none;
}

.card:hover {
  border-color: var(--line-strong);
  transform: translateY(-4px);
  box-shadow: var(--glow), var(--shadow);
}

.card:hover::before { opacity: 1; }

.card h3 {
  margin: 0 0 10px;
  font-size: 21px;
  color: var(--gold-bright);
  position: relative;
}

.card h3::after {
  content: "";
  display: block;
  width: 34px;
  height: 2px;
  margin-top: 8px;
  background: linear-gradient(90deg, var(--seal), transparent);
}

.muted { color: var(--muted); }

.tag {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  padding: 3px 11px;
  background: rgba(212, 163, 74, .1);
  color: var(--gold-bright);
  font-size: 12px;
  margin: 3px;
  font-family: var(--font-sans);
}

.pill-row { display: flex; gap: 8px; flex-wrap: wrap; }

.callout {
  border-left: 4px solid var(--gold);
  background: linear-gradient(100deg, rgba(212, 163, 74, .13), rgba(212, 163, 74, .03));
  padding: 20px 24px;
  border-radius: 14px;
  margin: 20px 0;
  color: #ddd0b6;
}

.callout b { color: var(--gold-bright); }
.warning { border-left-color: var(--seal); }

.diagram { display: flex; gap: 18px; align-items: center; flex-wrap: wrap; }
.trigram-svg rect, .hex-svg rect { fill: #e8d9b8; }
.trigram-tile { text-align: center; }
.big-symbol { font-size: 44px; line-height: 1; color: var(--gold); margin: 8px 0; }

/* ── 先后天八卦方位图 ── */
.bagua-maps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
  gap: 20px;
  margin: 26px 0;
}

.bagua-map-card {
  background: linear-gradient(160deg, rgba(38, 32, 25, .9), rgba(22, 18, 13, .9));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 22px 20px 18px;
  text-align: center;
  transition: .4s cubic-bezier(.22, 1, .36, 1);
}

.bagua-map-card:hover {
  border-color: var(--line-strong);
  box-shadow: var(--glow);
}

.bagua-map-card h3 {
  margin: 0 0 4px;
  font-size: 19px;
  color: var(--gold-bright);
}

.bagua-map-card h3::after {
  margin-left: auto;
  margin-right: auto;
  background: linear-gradient(90deg, transparent, var(--seal), transparent);
}

.bm-note {
  font-size: 12px;
  color: var(--muted);
  margin: 0 0 10px;
  font-family: var(--font-sans);
}

.bagua-map {
  width: 100%;
  height: auto;
  max-width: 360px;
  display: block;
  margin: 0 auto;
}

.bagua-map .bm-sym { font-size: 26px; font-family: var(--font-serif); }
.bagua-map .bm-name { font-size: 15px; fill: #e8dcc4; font-family: var(--font-serif); }
.bagua-map .bm-dir { font-size: 11px; fill: var(--muted); font-family: var(--font-sans); }
.bagua-map .bm-center { font-size: 17px; font-weight: 600; fill: var(--gold-bright); font-family: var(--font-serif); }
.bagua-map .bm-center-sub { font-size: 11px; fill: var(--muted); font-family: var(--font-sans); }
.bagua-map .bm-compass { font-size: 12px; fill: rgba(212, 163, 74, .55); font-family: var(--font-sans); }

/* ── 时间线 ── */
.timeline { counter-reset: step; }

.timeline-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 18px;
  margin: 16px 0;
  align-items: start;
}

/* 序号圆圈必须留在网格流内。
   .timeline-item 同时带有 .card 类，而 .card::before 设了
   position:absolute / inset:0 / opacity:0，会污染此处伪元素，
   导致圆圈脱离文档流、文字被挤进 54px 的第一列。
   以下三条显式覆盖，缺一不可。 */
.timeline-item::before {
  position: static;
  inset: auto;
  opacity: 1;
  counter-increment: step;
  content: counter(step);
  width: 44px;
  height: 44px;
  margin-top: 2px;
  background: linear-gradient(135deg, var(--gold), #a8741f);
  color: #191208;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-weight: 700;
  font-family: var(--font-sans);
  box-shadow: 0 0 20px rgba(212, 163, 74, .35);
}

/* timeline 卡片不需要鼠标跟随光晕，子项允许收缩避免溢出 */
.timeline-item.card > div { min-width: 0; }

/* ── 手风琴 ── */
.accordion {
  border: 1px solid var(--line);
  border-radius: 16px;
  overflow: hidden;
  background: rgba(30, 25, 19, .8);
  margin: 12px 0;
  transition: .3s;
}

.accordion[open] { border-color: var(--line-strong); box-shadow: var(--glow); }

.accordion summary {
  cursor: pointer;
  padding: 16px 20px;
  font-weight: 600;
  color: var(--gold-bright);
  list-style: none;
  position: relative;
  padding-left: 40px;
  transition: .25s;
}

.accordion summary::-webkit-details-marker { display: none; }

.accordion summary::before {
  content: "+";
  position: absolute;
  left: 18px;
  color: var(--seal);
  font-size: 20px;
  line-height: 1.2;
  transition: transform .3s;
}

.accordion[open] summary::before { transform: rotate(45deg); }

.accordion summary:hover { background: rgba(212, 163, 74, .07); }

.accordion .content {
  padding: 0 20px 20px;
  color: var(--muted);
  animation: fadeUp .35s cubic-bezier(.22, 1, .36, 1);
}

@keyframes fadeUp {
  from { opacity: 0; transform: translateY(-6px); }
  to { opacity: 1; transform: none; }
}

/* ── 搜索面板 ── */
.search-panel {
  position: sticky;
  top: 62px;
  z-index: 30;
  background: rgba(20, 16, 12, .9);
  backdrop-filter: blur(14px);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
  margin-bottom: 26px;
}

.search-row {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, minmax(120px, .5fr));
  gap: 10px;
}

.search-row input, .search-row select {
  width: 100%;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(13, 10, 7, .8);
  color: var(--ink);
  font-size: 15px;
  font-family: var(--font-sans);
  transition: .25s;
}

.search-row input:focus, .search-row select:focus {
  outline: none;
  border-color: var(--gold);
  box-shadow: 0 0 0 3px rgba(212, 163, 74, .16);
}

/* ── 卦卡 ── */
.hex-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(268px, 1fr));
  gap: 18px;
}

.hex-card {
  background: linear-gradient(160deg, rgba(38, 32, 25, .9), rgba(22, 18, 13, .9));
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  box-shadow: var(--shadow);
  transition: .4s cubic-bezier(.22, 1, .36, 1);
  position: relative;
  overflow: hidden;
  backdrop-filter: blur(10px);
}

.hex-card:hover {
  transform: translateY(-6px) scale(1.012);
  border-color: var(--gold);
  box-shadow: var(--glow-strong), var(--shadow);
}

.hex-head { display: flex; gap: 14px; align-items: center; position: relative; z-index: 1; }

.hex-svg {
  width: 74px;
  height: 96px;
  flex: none;
  background: linear-gradient(160deg, rgba(212, 163, 74, .12), rgba(13, 10, 7, .5));
  border-radius: 14px;
  padding: 8px;
  border: 1px solid var(--line);
  transition: .4s;
}

.hex-card:hover .hex-svg {
  border-color: var(--gold);
  box-shadow: 0 0 22px rgba(212, 163, 74, .28);
}

.hex-name {
  font-size: 28px;
  font-weight: 700;
  color: var(--gold-bright);
  line-height: 1.15;
}

.hex-meta { font-size: 13px; color: var(--muted); font-family: var(--font-sans); }
.hex-body { margin-top: 12px; position: relative; z-index: 1; }
.empty { display: none; text-align: center; padding: 48px; color: var(--muted); }

/* 粒子消散画布 */
.fx-dust {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 2;
}

/* ── 学习计划 ── */
.week {
  display: grid;
  grid-template-columns: 90px 1fr;
  gap: 14px;
  align-items: start;
}

.checklist label {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 8px 0;
  cursor: pointer;
}

.checklist input[type="checkbox"] {
  appearance: none;
  width: 19px;
  height: 19px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  background: rgba(13, 10, 7, .6);
  cursor: pointer;
  position: relative;
  flex: none;
  margin-top: 3px;
  transition: .25s;
}

.checklist input[type="checkbox"]:checked {
  background: linear-gradient(135deg, var(--gold), #a8741f);
  border-color: var(--gold);
  box-shadow: 0 0 12px rgba(212, 163, 74, .45);
}

.checklist input[type="checkbox"]:checked::after {
  content: "";
  position: absolute;
  left: 6px;
  top: 2px;
  width: 5px;
  height: 10px;
  border: solid #191208;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}

.checklist label:has(input:checked) { color: var(--muted); text-decoration: line-through; }

.progress-wrap {
  height: 12px;
  background: rgba(13, 10, 7, .8);
  border-radius: 99px;
  overflow: hidden;
  border: 1px solid var(--line);
}

.progress-bar {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--jade), var(--gold), var(--seal));
  box-shadow: 0 0 16px rgba(212, 163, 74, .5);
  transition: width .5s cubic-bezier(.22, 1, .36, 1);
}

/* ── 表格 ── */
.table { width: 100%; border-collapse: collapse; background: rgba(30, 25, 19, .8); border-radius: 16px; overflow: hidden; }
.table th, .table td { border: 1px solid var(--line); padding: 12px; text-align: left; }
.table th { background: rgba(212, 163, 74, .14); color: var(--gold-bright); font-weight: 600; }
.table tbody tr { transition: .2s; }
.table tbody tr:hover { background: rgba(212, 163, 74, .07); }

.site-footer {
  text-align: center;
  padding: 32px;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 14px;
}

/* ── 滚动揭示 ── */
[data-reveal] {
  opacity: 0;
  transform: translateY(28px);
  transition: opacity .75s cubic-bezier(.22, 1, .36, 1) var(--reveal-delay, 0ms),
              transform .75s cubic-bezier(.22, 1, .36, 1) var(--reveal-delay, 0ms);
}

[data-reveal].is-revealed { opacity: 1; transform: none; }

[data-reveal="left"] { transform: translateX(-34px); }
[data-reveal="right"] { transform: translateX(34px); }
[data-reveal="zoom"] { transform: scale(.94); }
[data-reveal="left"].is-revealed, [data-reveal="right"].is-revealed, [data-reveal="zoom"].is-revealed { transform: none; }

/* ── 详情页 ── */
.detail-hero {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 26px;
  align-items: start;
  margin-bottom: 34px;
}

.detail-hexagram { display: flex; gap: 18px; align-items: center; }

.detail-hex-svg {
  width: 118px;
  height: 154px;
  background: linear-gradient(160deg, rgba(212, 163, 74, .14), rgba(13, 10, 7, .6));
  border-radius: 18px;
  padding: 12px;
  border: 1px solid var(--line-strong);
  box-shadow: var(--glow);
}

.detail-hex-name { font-size: 40px; font-weight: 700; color: var(--gold-bright); }
.detail-hex-name rt { font-size: 15px; color: var(--muted); font-family: var(--font-sans); }
.detail-hex-meta { font-size: 14px; color: var(--muted); margin: 6px 0 10px; }

.detail-classical {
  font-size: 17px;
  line-height: 2.1;
  color: #f4ead6;
  padding: 16px 20px;
  background: rgba(13, 10, 7, .5);
  border-left: 3px solid var(--seal);
  border-radius: 0 12px 12px 0;
  margin: 12px 0;
}

.detail-sidelist {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
  margin: 16px 0;
}

.detail-sidelist dt {
  color: var(--gold-bright);
  font-weight: 600;
  margin-bottom: 4px;
}

.detail-sidelist dd { margin: 0; color: var(--muted); font-size: 15px; }

/* 逐字注解 */
.ann {
  position: relative;
  border-bottom: 1px dotted var(--gold);
  color: var(--gold-bright);
  cursor: help;
}

.ann-tip {
  position: absolute;
  bottom: 135%;
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  background: #2a231a;
  color: #f4ead6;
  border: 1px solid var(--line-strong);
  border-radius: 10px;
  padding: 9px 13px;
  font-size: 13px;
  font-family: var(--font-sans);
  white-space: normal;
  width: max-content;
  max-width: 280px;
  opacity: 0;
  pointer-events: none;
  transition: .25s;
  z-index: 20;
  box-shadow: 0 12px 34px rgba(0, 0, 0, .6);
  line-height: 1.6;
}

.ann:hover .ann-tip { opacity: 1; transform: translateX(-50%) translateY(0); }

/* 爻辞卡 */
.yao-list { display: grid; gap: 12px; }

.yao-card {
  background: linear-gradient(160deg, rgba(38, 32, 25, .85), rgba(22, 18, 13, .85));
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 16px 20px;
  transition: .35s cubic-bezier(.22, 1, .36, 1);
  position: relative;
  overflow: hidden;
}

.yao-card:hover {
  border-color: var(--line-strong);
  transform: translateX(6px);
  box-shadow: var(--glow);
}

.yao-head { display: flex; align-items: center; gap: 14px; margin-bottom: 8px; }

.yao-pos {
  display: inline-block;
  min-width: 44px;
  padding: 3px 10px;
  background: linear-gradient(135deg, var(--seal), #8f2d1c);
  color: #fff3e2;
  border-radius: 8px;
  font-size: 14px;
  text-align: center;
  font-family: var(--font-sans);
}

.yao-line { font-size: 19px; color: var(--gold); letter-spacing: 2px; }
.yao-card h3 { margin: 0 0 8px; font-size: 19px; color: var(--gold-bright); }
.yao-card p { margin: 8px 0; color: #cabda1; }
.yao-card .muted { font-size: 14px; }

.detail-nav { display: flex; gap: 12px; justify-content: center; flex-wrap: wrap; margin-top: 40px; }

/* ── 拼音标注 ── */
ruby.py { ruby-position: over; }
ruby.py rt {
  font-size: .48em;
  color: var(--gold);
  font-family: var(--font-sans);
  letter-spacing: .02em;
}

/* ── 阶梯学习路径 ── */
.stairs-scene {
  position: relative;
  min-height: 2200px;
  margin: 20px -20px 0;
  overflow: hidden;
}

.stairs-track {
  position: relative;
  width: 100%;
  max-width: 900px;
  margin: 0 auto;
  padding: 40px 20px 120px;
}

.stair {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 20px;
  align-items: center;
  margin-bottom: 26px;
  opacity: 0;
  transform: translateY(40px) scale(.97);
  transition: opacity .8s cubic-bezier(.22, 1, .36, 1), transform .8s cubic-bezier(.22, 1, .36, 1);
}

.stair.is-visible { opacity: 1; transform: none; }

.stair-step {
  position: relative;
  height: 92px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  border: 1px solid var(--line);
  background: linear-gradient(160deg, rgba(38, 32, 25, .95), rgba(20, 16, 12, .95));
  font-family: var(--font-sans);
  overflow: hidden;
  transition: .45s cubic-bezier(.22, 1, .36, 1);
}

.stair-step .step-num {
  font-size: 30px;
  font-weight: 700;
  color: var(--muted);
  transition: .45s;
}

.stair.is-done .stair-step {
  border-color: var(--gold);
  background: linear-gradient(160deg, rgba(212, 163, 74, .22), rgba(139, 106, 40, .12));
  box-shadow: 0 0 34px rgba(212, 163, 74, .26);
}

.stair.is-done .stair-step .step-num { color: var(--gold-bright); }

.stair.is-current .stair-step {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 1px var(--gold), 0 0 46px rgba(212, 163, 74, .38);
  animation: pulseStep 2.4s ease-in-out infinite;
}

@keyframes pulseStep {
  0%, 100% { box-shadow: 0 0 0 1px var(--gold), 0 0 30px rgba(212, 163, 74, .26); }
  50% { box-shadow: 0 0 0 1px var(--gold-bright), 0 0 58px rgba(212, 163, 74, .5); }
}

.stair-body {
  background: linear-gradient(160deg, rgba(38, 32, 25, .9), rgba(22, 18, 13, .9));
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 20px 24px;
  transition: .4s cubic-bezier(.22, 1, .36, 1);
}

.stair:hover .stair-body { border-color: var(--line-strong); transform: translateX(6px); }
.stair-body h3 { margin: 0 0 6px; font-size: 20px; color: var(--gold-bright); }
.stair-body p { margin: 6px 0; color: #cabda1; }

.stair-check {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  margin-top: 12px;
  padding: 8px 16px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  cursor: pointer;
  font-size: 14px;
  font-family: var(--font-sans);
  transition: .3s;
}

.stair-check:hover { border-color: var(--gold); color: var(--gold-bright); }
.stair-check input { accent-color: var(--gold); width: 16px; height: 16px; }

.stair-phase {
  position: absolute;
  left: -4px;
  top: -14px;
  padding: 3px 12px;
  border-radius: 999px;
  font-size: 12px;
  font-family: var(--font-sans);
  letter-spacing: .16em;
  background: linear-gradient(135deg, var(--seal), #8f2d1c);
  color: #fff3e2;
  z-index: 2;
}

/* 阶段分隔标题 */
.phase-header {
  margin: 60px 0 30px;
  text-align: center;
  position: relative;
}

.phase-header h2 {
  font-size: clamp(24px, 3.4vw, 36px);
  margin: 0 0 8px;
  background: linear-gradient(120deg, #fff6e2, var(--gold));
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
}

.phase-header p { color: var(--muted); margin: 0; }

/* 云雾粒子层 */
.mist-layer {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 0;
}

.mist-dot {
  position: absolute;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212, 163, 74, .3), transparent 70%);
  animation: floatUp linear infinite;
}

@keyframes floatUp {
  from { transform: translateY(0) scale(1); opacity: 0; }
  15% { opacity: .7; }
  to { transform: translateY(-420px) scale(2.4); opacity: 0; }
}

/* ── 九宫罗盘 ── */
.compass-wrap {
  display: grid;
  grid-template-columns: minmax(320px, 460px) 1fr;
  gap: 28px;
  align-items: start;
}

.compass {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 8px;
  aspect-ratio: 1;
  position: relative;
}

.compass-cell {
  border: 1px solid var(--line);
  border-radius: 14px;
  background: linear-gradient(160deg, rgba(38, 32, 25, .9), rgba(20, 16, 12, .9));
  padding: 10px 8px;
  text-align: center;
  cursor: pointer;
  transition: .38s cubic-bezier(.22, 1, .36, 1);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  position: relative;
  overflow: hidden;
}

.compass-cell:hover {
  border-color: var(--gold);
  transform: scale(1.05);
  z-index: 3;
  box-shadow: 0 0 30px rgba(212, 163, 74, .3);
}

.compass-cell.is-active {
  border-color: var(--gold-bright);
  background: linear-gradient(160deg, rgba(212, 163, 74, .26), rgba(139, 106, 40, .1));
  box-shadow: 0 0 0 1px var(--gold), 0 0 46px rgba(212, 163, 74, .34);
}

.compass-cell .c-num {
  font-size: 11px;
  color: var(--muted);
  font-family: var(--font-sans);
}

/* 洛书点阵：白点为阳数（奇），黑点为阴数（偶） */
.c-dots {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  grid-template-rows: repeat(3, 1fr);
  gap: 3px;
  width: 48px;
  height: 48px;
  margin: 7px 0 5px;
  flex: none;
}

.c-dots .dot,
.c-dots .dot-blank {
  display: block;
  width: 10px;
  height: 10px;
  margin: auto;
  border-radius: 50%;
}

.c-dots .dot {
  transition: .3s;
}

.c-dots .dot.yang {
  background: #f5ecd8;
  box-shadow: 0 0 5px rgba(245, 236, 216, .55);
}

.c-dots .dot.yin {
  background: #0b0805;
  border: 1.5px solid rgba(212, 163, 74, .9);
  box-shadow: 0 0 6px rgba(212, 163, 74, .22);
}

.compass-cell.is-active .c-dots .dot.yang {
  background: #fffaf0;
  box-shadow: 0 0 9px rgba(255, 250, 240, .85);
}

.compass-cell.is-active .c-dots .dot.yin {
  border-color: var(--gold-bright);
  box-shadow: 0 0 7px rgba(212, 163, 74, .5);
}

.compass-cell .c-sym { font-size: 28px; line-height: 1.1; color: var(--gold-bright); }

@media (max-width: 520px) {
  .c-dots { width: 32px; height: 32px; }
  .c-dots .dot, .c-dots .dot-blank { width: 6px; height: 6px; }
  .compass-cell { padding: 8px 5px; gap: 1px; }
  .compass-cell .c-num, .compass-cell .c-dir { font-size: 10px; }
  .compass-cell .c-name { font-size: 12px; }
}
.compass-cell .c-name { font-size: 13px; color: #cabda1; font-family: var(--font-sans); }
.compass-cell .c-dir { font-size: 11px; color: var(--muted); font-family: var(--font-sans); }
.compass-cell.center { background: rgba(212, 163, 74, .09); }

/* ── 五行环 ── */
.wuxing-ring {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
  position: relative;
}

.wx-node {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px 12px;
  text-align: center;
  cursor: pointer;
  transition: .4s cubic-bezier(.22, 1, .36, 1);
  background: linear-gradient(160deg, rgba(38, 32, 25, .9), rgba(20, 16, 12, .9));
  position: relative;
}

.wx-node:hover { transform: translateY(-5px) scale(1.04); }

.wx-char {
  font-size: 38px;
  font-weight: 700;
  line-height: 1.15;
}

.wx-label { font-size: 13px; color: var(--muted); margin-top: 6px; font-family: var(--font-sans); }

.wx-node.is-sheng { box-shadow: 0 0 0 1px var(--jade), 0 0 30px rgba(74, 157, 132, .3); }
.wx-node.is-ke { box-shadow: 0 0 0 1px var(--seal), 0 0 30px rgba(212, 70, 47, .3); }

/* ── 卦歌跟读 ── */
.song-panel {
  background: linear-gradient(160deg, rgba(38, 32, 25, .92), rgba(20, 16, 12, .92));
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 26px;
}

.song-lines { display: grid; gap: 8px; margin: 18px 0; }

.song-line {
  padding: 10px 16px;
  border-radius: 10px;
  border: 1px solid transparent;
  color: var(--muted);
  font-size: 17px;
  transition: .3s;
  font-family: var(--font-serif);
}

.song-line.is-current {
  color: var(--gold-bright);
  border-color: var(--gold);
  background: rgba(212, 163, 74, .12);
  text-shadow: 0 0 18px rgba(212, 163, 74, .5);
  transform: translateX(6px);
}

.song-line.is-past { color: #8d8069; }

.song-controls { display: flex; gap: 12px; align-items: center; flex-wrap: wrap; }

.song-progress {
  flex: 1;
  min-width: 180px;
  height: 6px;
  border-radius: 99px;
  background: rgba(13, 10, 7, .8);
  overflow: hidden;
  border: 1px solid var(--line);
}

.song-progress-fill {
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--jade), var(--gold));
  box-shadow: 0 0 12px rgba(212, 163, 74, .5);
  transition: width .2s linear;
}

/* ── 统计条 ── */
.stat-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap: 14px;
}

.stat {
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 18px;
  text-align: center;
  background: linear-gradient(160deg, rgba(38, 32, 25, .85), rgba(20, 16, 12, .85));
  transition: .4s;
}

.stat:hover { border-color: var(--gold); transform: translateY(-4px); box-shadow: var(--glow); }
.stat .stat-num { font-size: 32px; font-weight: 700; color: var(--gold-bright); font-family: var(--font-sans); }
.stat .stat-label { font-size: 13px; color: var(--muted); font-family: var(--font-sans); }

/* ── 资源卡 ── */
.res-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 14px; }
.res-card { display: flex; flex-direction: column; gap: 8px; }
.res-type {
  display: inline-block;
  font-size: 11px;
  padding: 2px 9px;
  border-radius: 999px;
  background: rgba(139, 127, 212, .18);
  color: #b9aef0;
  border: 1px solid rgba(139, 127, 212, .3);
  font-family: var(--font-sans);
  align-self: flex-start;
}
.res-card a { color: var(--gold-bright); text-decoration: none; border-bottom: 1px solid var(--line-strong); }
.res-card a:hover { border-color: var(--gold); }
.res-license { font-size: 12px; color: var(--muted); font-family: var(--font-sans); }

/* ── 响应式 ── */
@media (max-width: 900px) {
  .compass-wrap { grid-template-columns: 1fr; }
  .detail-hero { grid-template-columns: 1fr; }
  .wuxing-ring { grid-template-columns: repeat(3, 1fr); }
}

@media (max-width: 760px) {
  .search-row { grid-template-columns: 1fr; }
  .week { grid-template-columns: 1fr; }
  .hero { padding: 56px 18px; }
  .top-nav { justify-content: flex-start; overflow: auto; flex-wrap: nowrap; }
  .top-nav a { white-space: nowrap; }
  .stair { grid-template-columns: 64px 1fr; gap: 12px; }
  .stair-step { height: 72px; }
  .wuxing-ring { grid-template-columns: repeat(2, 1fr); }
  .search-panel { top: 56px; }
}

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

/* ═══════════════════════════════════════════════════════════
   工具页：表单 / 四柱 / 五行 / 大运
   ═══════════════════════════════════════════════════════════ */

.tool-form { display: grid; gap: 18px; }
.form-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }

.field { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.field > label {
  font-size: 12px; letter-spacing: .08em; color: var(--muted);
  font-family: var(--font-sans); text-transform: uppercase;
}
.field input, .field select {
  -webkit-appearance: none; appearance: none;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); padding: 11px 13px; font-size: 15px;
  font-family: var(--font-sans); outline: none; width: 100%;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field input:focus, .field select:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(212, 163, 74, .12);
  background: rgba(255, 255, 255, .06);
}
.field .hint { font-size: 12px; color: var(--muted); font-family: var(--font-sans); line-height: 1.5; }
.field select option { background: var(--paper2); color: var(--ink); }

/* 分段选择器 */
.seg {
  display: inline-flex; gap: 4px; padding: 4px; border-radius: 12px;
  background: rgba(255, 255, 255, .035); border: 1px solid var(--line);
}
.seg button {
  border: 0; background: transparent; color: var(--muted); cursor: pointer;
  padding: 7px 16px; border-radius: 9px; font-size: 14px;
  font-family: var(--font-sans); transition: all .2s;
}
.seg button:hover { color: var(--ink); }
.seg button.is-on {
  background: linear-gradient(135deg, var(--gold), #a8741f);
  color: #1a1206; font-weight: 600;
  box-shadow: 0 4px 14px rgba(212, 163, 74, .25);
}

.checkline {
  display: flex; align-items: center; gap: 9px; cursor: pointer;
  font-family: var(--font-sans); font-size: 14px; color: var(--muted);
}
.checkline input { width: 16px; height: 16px; accent-color: var(--gold); cursor: pointer; }

.form-actions { display: flex; gap: 12px; flex-wrap: wrap; align-items: center; }
.form-actions .btn { cursor: pointer; border: 0; }

/* 结果区 */
.result { display: none; }
.result.is-on { display: block; }

.summary-line {
  display: flex; flex-wrap: wrap; gap: 10px 18px; align-items: baseline;
  font-family: var(--font-sans); font-size: 14px; color: var(--muted);
}
.summary-line b { color: var(--gold-bright); font-weight: 600; }

/* 四柱表 */
.pillars-wrap { overflow-x: auto; -webkit-overflow-scrolling: touch; }
.pillars { width: 100%; min-width: 560px; border-collapse: separate; border-spacing: 0; }
.pillars th, .pillars td {
  padding: 12px 10px; text-align: center; border-bottom: 1px solid var(--line);
  font-family: var(--font-sans); font-size: 14px; vertical-align: middle;
}
.pillars thead th { border-bottom: 1px solid var(--line-strong); padding-bottom: 10px; }
.pillars thead .p-label { display: block; font-size: 15px; color: var(--ink); font-weight: 600; }
.pillars thead .p-scope { display: block; font-size: 11px; color: var(--muted); margin-top: 3px; letter-spacing: .04em; }
.pillars tbody th {
  text-align: right; color: var(--muted); font-weight: 400;
  font-size: 12px; letter-spacing: .06em; white-space: nowrap;
}
.pillars .gan, .pillars .zhi {
  font-family: var(--font-serif); font-size: 30px; line-height: 1.2;
  color: var(--gold-bright);
}
.pillars .el { font-size: 11px; color: var(--muted); display: block; margin-top: 2px; }
.pillars .ss { color: var(--jade); font-size: 13px; }
.pillars .day-col { background: rgba(212, 163, 74, .06); }
.pillars .hide-gan { letter-spacing: .12em; color: var(--ink); }
.pillars .na-yin { color: var(--muted); font-size: 12px; }

/* 五行分布 */
.wx-list { display: grid; gap: 10px; }
.wx-item { display: grid; grid-template-columns: 34px 1fr 46px; gap: 12px; align-items: center; }
.wx-name { font-family: var(--font-serif); font-size: 18px; color: var(--gold-bright); text-align: center; }
.wx-track { height: 10px; border-radius: 6px; background: rgba(255, 255, 255, .05); overflow: hidden; }
.wx-fill { height: 100%; border-radius: 6px; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); transition: width .6s ease; }
.wx-item.is-yong .wx-fill { background: linear-gradient(90deg, var(--jade), #7fd4b8); }
.wx-item.is-ji .wx-fill { background: linear-gradient(90deg, #8a3f34, #c9634f); }
.wx-count { font-family: var(--font-sans); font-size: 13px; color: var(--muted); text-align: right; }

/* 大运 */
.yun-track {
  display: flex; gap: 10px; overflow-x: auto; padding: 6px 2px 14px;
  -webkit-overflow-scrolling: touch; scroll-snap-type: x proximity;
}
.yun-step {
  flex: 0 0 auto; min-width: 92px; text-align: center; padding: 12px 10px;
  border: 1px solid var(--line); border-radius: 14px; background: rgba(255, 255, 255, .02);
  scroll-snap-align: start;
}
.yun-step.is-now { border-color: var(--line-strong); background: rgba(212, 163, 74, .08); box-shadow: var(--glow); }
.yun-step .gz { font-family: var(--font-serif); font-size: 22px; color: var(--gold-bright); }
.yun-step .ss { font-size: 11px; color: var(--jade); margin-top: 2px; }
.yun-step .range { font-family: var(--font-sans); font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.5; }

/* 流年 */
.liunian-list { display: flex; flex-wrap: wrap; gap: 8px; }
.liunian-chip {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  padding: 8px 12px; border-radius: 12px; border: 1px solid var(--line);
  background: rgba(255, 255, 255, .02); min-width: 66px;
}
.liunian-chip .y { font-family: var(--font-sans); font-size: 11px; color: var(--muted); }
.liunian-chip .gz { font-family: var(--font-serif); font-size: 17px; color: var(--gold-bright); }
.liunian-chip .ss { font-size: 10px; color: var(--jade); }

/* 运势评分 */
.score-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 14px; }
.score-card { padding: 14px; border-radius: 14px; border: 1px solid var(--line); background: rgba(255, 255, 255, .02); }
.score-head { display: flex; justify-content: space-between; align-items: baseline; font-family: var(--font-sans); }
.score-head .k { font-size: 13px; color: var(--muted); }
.score-head .v { font-size: 20px; color: var(--gold-bright); font-weight: 600; }
.score-track { height: 6px; border-radius: 4px; background: rgba(255, 255, 255, .06); margin: 8px 0 6px; overflow: hidden; }
.score-fill { height: 100%; border-radius: 4px; background: linear-gradient(90deg, var(--gold), var(--gold-bright)); }
.score-text { font-family: var(--font-sans); font-size: 12.5px; color: var(--muted); line-height: 1.65; }

.tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 16px; }
.tips ul { margin: 8px 0 0; padding-left: 18px; font-family: var(--font-sans); font-size: 13.5px; color: var(--muted); line-height: 1.9; }
.tips li::marker { color: var(--gold); }

@media (max-width: 640px) {
  .pillars { min-width: 480px; }
  .pillars .gan, .pillars .zhi { font-size: 24px; }
  .pillars th, .pillars td { padding: 9px 6px; font-size: 13px; }
  .field input, .field select { font-size: 16px; } /* 防 iOS 聚焦缩放 */
}

/* ═══════════════════════════════════════════════════════════
   黄历：年历网格与日详情
   ═══════════════════════════════════════════════════════════ */

.cal-toolbar { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; margin-bottom: 18px; }
.cal-toolbar .year-input {
  width: 110px; text-align: center; font-size: 20px; font-family: var(--font-serif);
  background: rgba(255, 255, 255, .035); border: 1px solid var(--line);
  border-radius: 12px; color: var(--gold-bright); padding: 8px 10px; outline: none;
}
.cal-toolbar .year-input:focus { border-color: var(--line-strong); box-shadow: 0 0 0 3px rgba(212, 163, 74, .12); }

.cal-year { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.cal-month {
  border: 1px solid var(--line); border-radius: 16px; padding: 14px;
  background: rgba(255, 255, 255, .02);
}
.cal-month h3 {
  margin: 0 0 10px; font-size: 15px; color: var(--gold-bright);
  font-family: var(--font-sans); font-weight: 600; display: flex;
  justify-content: space-between; align-items: baseline;
}
.cal-month h3 span { font-size: 11px; color: var(--muted); font-weight: 400; }

.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; margin-bottom: 4px; }
.cal-week span {
  text-align: center; font-size: 10px; color: var(--muted);
  font-family: var(--font-sans); padding: 2px 0;
}
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 2px; }

.cal-cell {
  position: relative; aspect-ratio: 1 / 1.12; border: 1px solid transparent;
  border-radius: 8px; background: transparent; cursor: pointer; padding: 3px 1px;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 1px; color: var(--ink); transition: background .15s, border-color .15s;
  font-family: var(--font-sans);
}
.cal-cell:hover { background: rgba(255, 255, 255, .06); border-color: var(--line); }
.cal-cell.is-empty { cursor: default; pointer-events: none; }
.cal-cell .d { font-size: 13px; line-height: 1; font-weight: 600; }
.cal-cell .l { font-size: 9.5px; line-height: 1.1; color: var(--muted); white-space: nowrap; transform: scale(.95); }
.cal-cell.is-weekend .d { color: var(--gold-bright); }
.cal-cell.is-jieqi { border-color: rgba(74, 157, 132, .45); }
.cal-cell.is-jieqi .l { color: var(--jade); font-weight: 600; }
.cal-cell.is-festival .l { color: var(--seal); }
.cal-cell.is-today { border-color: var(--line-strong); background: rgba(212, 163, 74, .1); box-shadow: 0 0 0 1px rgba(212, 163, 74, .25) inset; }
.cal-cell.is-selected { border-color: var(--gold-bright); background: rgba(212, 163, 74, .16); }
.cal-cell.is-bad::after {
  content: ''; position: absolute; bottom: 3px; width: 3px; height: 3px;
  border-radius: 50%; background: rgba(212, 70, 47, .7);
}
.cal-cell.is-good::after {
  content: ''; position: absolute; bottom: 3px; width: 3px; height: 3px;
  border-radius: 50%; background: rgba(74, 157, 132, .8);
}

/* 日详情 */
.day-detail { display: grid; gap: 18px; }
.day-head { display: flex; flex-wrap: wrap; gap: 10px 20px; align-items: baseline; }
.day-head .big { font-family: var(--font-serif); font-size: 30px; color: var(--gold-bright); }
.day-head .sub { font-family: var(--font-sans); font-size: 13px; color: var(--muted); }

.yiji { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; }
.yiji-col h3 { font-size: 15px; margin: 0 0 8px; }
.yiji-col.yi h3 { color: var(--jade); }
.yiji-col.ji h3 { color: var(--seal); }
.yiji-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.yiji-tag {
  padding: 4px 10px; border-radius: 999px; font-size: 12.5px;
  font-family: var(--font-sans); border: 1px solid var(--line);
  background: rgba(255, 255, 255, .03);
}
.yiji-col.yi .yiji-tag { border-color: rgba(74, 157, 132, .35); color: #9fe0cb; }
.yiji-col.ji .yiji-tag { border-color: rgba(212, 70, 47, .3); color: #e8a195; }

.kv-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 10px 20px; font-family: var(--font-sans); font-size: 13.5px;
}
.kv-grid div { display: flex; gap: 8px; }
.kv-grid .k { color: var(--muted); flex: none; min-width: 62px; }
.kv-grid .v { color: var(--ink); }

@media (max-width: 560px) {
  .cal-year { grid-template-columns: 1fr; }
  .yiji { grid-template-columns: 1fr; }
}

/* 作者样式里的 display 会覆盖 [hidden] 的 UA 规则，需显式复位 */
[hidden] { display: none !important; }

/* ═══════════════════════════════════════════════════════════
   v3 · 工具页视觉精修
   ═══════════════════════════════════════════════════════════ */

:root {
  --el-mu: #5fbfa0;
  --el-huo: #e0705a;
  --el-tu: #d9b04a;
  --el-jin: #cfc9bb;
  --el-shui: #6a9fd0;
}

/* ── 表单：分组标题与更克制的分隔 ── */
.form-group { display: grid; gap: 14px; }
.form-group + .form-group { padding-top: 18px; border-top: 1px solid var(--line); }
.form-group-title {
  font-family: var(--font-sans); font-size: 12px; letter-spacing: .14em;
  color: var(--gold); text-transform: uppercase; margin: 0;
  display: flex; align-items: center; gap: 8px;
}
.form-group-title::after {
  content: ''; flex: 1; height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent);
}

/* 分段控件更精致 */
.seg button { letter-spacing: .04em; }
.seg button.is-on { box-shadow: 0 6px 18px rgba(212, 163, 74, .28), inset 0 1px 0 rgba(255, 255, 255, .25); }

/* 主按钮 */
.btn.primary-lg {
  padding: 13px 30px; font-size: 15px; letter-spacing: .06em;
  box-shadow: 0 10px 28px rgba(212, 163, 74, .28);
}

/* ── 命盘摘要 ── */
.mingpan {
  display: grid; grid-template-columns: auto 1fr; gap: 24px;
  align-items: center; padding: 22px 24px; border-radius: 18px;
  border: 1px solid var(--line-strong);
  background:
    radial-gradient(120% 140% at 0% 0%, rgba(212, 163, 74, .14), transparent 60%),
    rgba(255, 255, 255, .02);
}
.mp-main { text-align: center; padding-right: 24px; border-right: 1px solid var(--line); }
.mp-gan {
  display: block; font-family: var(--font-serif); font-size: 62px; line-height: 1;
  color: var(--gold-bright); text-shadow: 0 0 32px rgba(212, 163, 74, .3);
}
.mp-el { font-family: var(--font-sans); font-size: 13px; color: var(--muted); letter-spacing: .1em; }
.mp-rows { display: grid; gap: 9px; font-family: var(--font-sans); font-size: 14px; }
.mp-row { display: flex; gap: 12px; align-items: baseline; }
.mp-row .k { color: var(--muted); min-width: 68px; font-size: 12.5px; letter-spacing: .05em; }
.mp-row .v { color: var(--ink); }
.mp-row .v b { color: var(--gold-bright); font-weight: 600; }
.badge {
  display: inline-block; padding: 2px 10px; border-radius: 999px;
  font-size: 12px; letter-spacing: .06em; border: 1px solid currentColor;
}
.badge.is-strong { color: #e8b45f; }
.badge.is-mid { color: #9ec3a8; }
.badge.is-weak { color: #8fa9c9; }
.chip-row { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
  padding: 2px 10px; border-radius: 999px; font-size: 12.5px;
  border: 1px solid var(--line-strong); color: var(--gold-bright);
  background: rgba(212, 163, 74, .08); font-family: var(--font-sans);
}
.chip.is-ji { border-color: rgba(212, 70, 47, .4); color: #e8a195; background: rgba(212, 70, 47, .07); }

/* ── 五行条：按元素上色 ── */
.wx-fill { background: var(--wx, var(--gold)); box-shadow: 0 0 14px color-mix(in srgb, var(--wx, #d4a34a) 45%, transparent); }
.wx-item.is-yong .wx-name { color: var(--jade); }
.wx-item.is-ji .wx-name { color: #c9634f; }
.wx-name { transition: color .3s; }

/* ── 四柱表精修 ── */
.pillars thead .p-label { font-family: var(--font-serif); letter-spacing: .08em; }
.pillars tbody tr:last-child th, .pillars tbody tr:last-child td { border-bottom: 0; }
.pillars .day-col {
  background: linear-gradient(180deg, rgba(212, 163, 74, .12), rgba(212, 163, 74, .04));
  box-shadow: inset 1px 0 0 var(--line-strong), inset -1px 0 0 var(--line-strong);
}
.pillars thead th:nth-child(4) .p-label { color: var(--gold-bright); }
.pillars .gan, .pillars .zhi { text-shadow: 0 0 22px rgba(212, 163, 74, .25); }

/* ── 大运：当前步徽章 ── */
.yun-step { position: relative; transition: transform .2s, border-color .2s; }
.yun-step:hover { transform: translateY(-2px); border-color: var(--line-strong); }
.yun-step.is-now::after {
  content: '当前'; position: absolute; top: -8px; left: 50%; transform: translateX(-50%);
  font-size: 10px; letter-spacing: .08em; padding: 1px 8px; border-radius: 999px;
  background: linear-gradient(135deg, var(--gold), #a8741f); color: #1a1206;
  font-family: var(--font-sans); white-space: nowrap;
}

/* ── 运势：分数环 ── */
.score-card { position: relative; overflow: hidden; }
.score-card::before {
  content: ''; position: absolute; inset: 0;
  background: radial-gradient(80% 100% at 100% 0%, rgba(212, 163, 74, .08), transparent 60%);
  pointer-events: none;
}
.score-head .v { font-family: var(--font-serif); }

/* ── 黄历：图例 ── */
.cal-legend {
  display: flex; flex-wrap: wrap; gap: 14px; margin-left: auto;
  font-family: var(--font-sans); font-size: 12px; color: var(--muted);
}
.cal-legend span { display: inline-flex; align-items: center; gap: 6px; }
.cal-legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }
.cal-legend .lg-jieqi { border: 1px solid rgba(74, 157, 132, .7); }
.cal-legend .lg-festival { background: rgba(212, 70, 47, .7); }
.cal-legend .lg-good { background: rgba(74, 157, 132, .8); border-radius: 50%; width: 6px; height: 6px; }
.cal-legend .lg-bad { background: rgba(212, 70, 47, .7); border-radius: 50%; width: 6px; height: 6px; }

/* ── 黄历：月卡与格子 ── */
.cal-month {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .03), rgba(255, 255, 255, .008));
  transition: border-color .25s, transform .25s;
}
.cal-month:hover { border-color: var(--line-strong); }
.cal-month h3 { padding-bottom: 8px; border-bottom: 1px solid var(--line); }
.cal-week span:first-child, .cal-week span:last-child { color: var(--gold); }

.cal-cell {
  aspect-ratio: 1 / 1.16; border-radius: 9px; gap: 2px;
  border: 1px solid rgba(212, 175, 110, .07);
  background: rgba(255, 255, 255, .012);
}
.cal-cell .d { font-size: 13.5px; font-variant-numeric: tabular-nums; }
.cal-cell .l { font-size: 9px; opacity: .82; letter-spacing: -.02em; }
.cal-cell:hover { background: rgba(212, 163, 74, .1); border-color: var(--line-strong); transform: translateY(-1px); }
.cal-cell.is-weekend .d { color: var(--gold-bright); }
.cal-cell.is-jieqi { background: rgba(74, 157, 132, .1); border-color: rgba(74, 157, 132, .45); }
.cal-cell.is-jieqi .l { color: #8fe0c4; font-weight: 600; opacity: 1; }
.cal-cell.is-festival .l { color: #ee9b8c; opacity: 1; }
.cal-cell.is-today {
  border-color: var(--gold-bright);
  box-shadow: 0 0 0 1px rgba(240, 199, 106, .35) inset, 0 0 18px rgba(212, 163, 74, .2);
  background: rgba(212, 163, 74, .14);
}
.cal-cell.is-today .d { color: var(--gold-bright); }
.cal-cell.is-selected {
  border-color: var(--gold-bright);
  background: linear-gradient(160deg, rgba(212, 163, 74, .28), rgba(212, 163, 74, .12));
}
.cal-cell.is-selected .d { color: #fff6e2; }

/* ── 黄历：日详情 ── */
.detail-head {
  display: grid; grid-template-columns: auto 1fr auto; gap: 20px;
  align-items: center; padding-bottom: 18px; margin-bottom: 18px;
  border-bottom: 1px solid var(--line);
}
.dh-date { display: flex; align-items: baseline; gap: 10px; }
.dh-date .num {
  font-family: var(--font-serif); font-size: 46px; line-height: 1;
  color: var(--gold-bright); text-shadow: 0 0 30px rgba(212, 163, 74, .28);
}
.dh-date .ym { font-family: var(--font-sans); font-size: 13px; color: var(--muted); line-height: 1.6; }
.dh-lunar { font-family: var(--font-sans); font-size: 13px; color: var(--muted); line-height: 1.9; }
.dh-lunar b { color: var(--ink); font-weight: 500; }
.dh-gz {
  text-align: right; font-family: var(--font-serif); font-size: 20px;
  color: var(--gold-bright); letter-spacing: .1em;
}
.dh-gz small { display: block; font-family: var(--font-sans); font-size: 11px; color: var(--muted); letter-spacing: .04em; margin-top: 4px; }

.day-nav { display: flex; gap: 8px; }
.btn.mini { padding: 6px 14px; font-size: 13px; border-radius: 10px; }

@media (max-width: 720px) {
  .mingpan { grid-template-columns: 1fr; gap: 16px; }
  .mp-main { padding-right: 0; padding-bottom: 14px; border-right: 0; border-bottom: 1px solid var(--line); }
  .cal-legend { margin-left: 0; width: 100%; }
  .detail-head { grid-template-columns: 1fr; gap: 10px; }
  .dh-gz { text-align: left; }
}

/* select 去掉原生外观后需自绘箭头，否则看不出可点 */
.field select {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--muted) 50%),
    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position:
    calc(100% - 17px) calc(50% + 1px),
    calc(100% - 12px) calc(50% + 1px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
}
.field select:focus {
  background-image:
    linear-gradient(45deg, transparent 50%, var(--gold) 50%),
    linear-gradient(135deg, var(--gold) 50%, transparent 50%);
}

/* ── 黄历日详情：键值区与宜忌分栏 ── */
.kv-grid {
  grid-template-columns: repeat(auto-fit, minmax(232px, 1fr));
  gap: 11px 26px;
}
.kv-grid div { align-items: baseline; }
.kv-grid .k { min-width: 66px; }
.kv-grid + .kv-grid {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px dashed var(--line);
}
.yiji { padding: 2px 0 6px; }
.yiji-col + .yiji-col { border-left: 1px solid var(--line); padding-left: 22px; }
.yiji-col h3 { letter-spacing: .06em; }

@media (max-width: 560px) {
  .yiji-col + .yiji-col { border-left: 0; padding-left: 0; }
}

/* ═══════════════════════════════════════════════════════════
   导航：分组下拉（知识学习）
   ═══════════════════════════════════════════════════════════ */

.nav-group { position: relative; display: inline-flex; }

.nav-toggle,
.top-nav button.nav-toggle {
  display: inline-flex; align-items: center; gap: 7px;
  color: #e8dcc4; background: transparent;
  padding: 7px 15px; border: 1px solid rgba(212, 175, 110, .2);
  border-radius: 999px; font-size: 14px; font-family: var(--font-sans);
  cursor: pointer; transition: .28s cubic-bezier(.22, 1, .36, 1);
  white-space: nowrap;
}
.nav-toggle:hover {
  background: rgba(212, 163, 74, .14); border-color: var(--gold);
  color: var(--gold-bright); transform: translateY(-2px);
}
.nav-toggle.active {
  background: linear-gradient(135deg, var(--gold), #b8862f);
  border-color: var(--gold-bright); color: #1a1309; font-weight: 600;
  box-shadow: 0 0 22px rgba(212, 163, 74, .35);
}
.nav-toggle .chev {
  width: 6px; height: 6px; margin-top: -3px;
  border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
  transform: rotate(45deg); transition: transform .25s;
}
.nav-group.is-open .nav-toggle .chev { transform: rotate(-135deg); margin-top: 3px; }

.nav-menu {
  position: absolute; top: calc(100% + 10px); left: 50%;
  transform: translateX(-50%) translateY(-6px);
  display: grid; grid-template-columns: repeat(2, minmax(198px, 1fr)); gap: 4px;
  padding: 12px; min-width: 430px;
  border: 1px solid var(--line-strong); border-radius: 18px;
  background: rgba(18, 14, 10, .97);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .55), 0 0 0 1px rgba(212, 163, 74, .06);
  backdrop-filter: blur(16px);
  opacity: 0; pointer-events: none; visibility: hidden;
  transition: opacity .2s ease, transform .2s ease, visibility .2s;
  z-index: 60;
}
.nav-group.is-open .nav-menu {
  opacity: 1; pointer-events: auto; visibility: visible;
  transform: translateX(-50%) translateY(0);
}

.nav-menu a {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 12px; border: 0; border-radius: 11px;
  text-decoration: none; transition: background .18s, color .18s;
}
.nav-menu a .t {
  font-size: 14px; color: var(--ink); font-family: var(--font-sans);
  display: flex; align-items: center; gap: 6px;
}
.nav-menu a .d {
  font-size: 11.5px; color: var(--muted); font-family: var(--font-sans);
  letter-spacing: .01em;
}
.nav-menu a:hover { background: rgba(212, 163, 74, .12); transform: none; }
.nav-menu a:hover .t { color: var(--gold-bright); }
.nav-menu a.is-current { background: rgba(212, 163, 74, .14); }
.nav-menu a.is-current .t { color: var(--gold-bright); }
.nav-menu a.is-current .t::before {
  content: ''; width: 4px; height: 4px; border-radius: 50%;
  background: var(--gold-bright); box-shadow: 0 0 8px var(--gold);
}

@media (max-width: 720px) {
  .nav-menu {
    left: auto; right: 0; transform: translateY(-6px);
    min-width: 0; width: min(320px, calc(100vw - 32px));
    grid-template-columns: 1fr;
  }
  .nav-group.is-open .nav-menu { transform: translateY(0); }
  .nav-menu a .d { display: none; }
}

/* 菜单改为两列分组，语义更清楚（覆盖上面的 grid 定义） */
.nav-menu { display: flex; gap: 18px; min-width: 460px; }
.nav-col { display: grid; gap: 2px; align-content: start; min-width: 206px; }
.nav-col-title {
  margin: 2px 0 6px 12px; font-size: 10.5px; letter-spacing: .16em;
  color: var(--gold); font-family: var(--font-sans); text-transform: uppercase;
}
@media (max-width: 720px) {
  .nav-menu { display: grid; grid-template-columns: 1fr; gap: 6px; }
  .nav-col { min-width: 0; }
}

/* ── 解梦页 ── */
.field textarea {
  -webkit-appearance: none; appearance: none;
  background: rgba(255, 255, 255, .035);
  border: 1px solid var(--line); border-radius: 12px;
  color: var(--ink); padding: 12px 14px; font-size: 15px;
  font-family: var(--font-sans); line-height: 1.8; outline: none;
  width: 100%; min-height: 132px; resize: vertical;
  transition: border-color .2s, box-shadow .2s, background .2s;
}
.field textarea:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 3px rgba(212, 163, 74, .12);
  background: rgba(255, 255, 255, .06);
}
.field textarea::placeholder { color: rgba(162, 147, 124, .7); }

.btn[disabled] {
  opacity: .45; cursor: not-allowed; box-shadow: none;
  filter: grayscale(.35);
}

.status-pill {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 4px 13px; border-radius: 999px; font-size: 12px;
  font-family: var(--font-sans); letter-spacing: .05em;
  border: 1px solid rgba(74, 157, 132, .45);
  color: #8fe0c4; background: rgba(74, 157, 132, .1);
}
.status-pill::before {
  content: ''; width: 6px; height: 6px; border-radius: 50%;
  background: currentColor; box-shadow: 0 0 8px currentColor;
}

.dream-steps { display: grid; gap: 12px; }
.dream-step {
  display: grid; grid-template-columns: 26px 1fr; gap: 12px;
  align-items: baseline; font-family: var(--font-sans);
}
.dream-step .n {
  font-family: var(--font-serif); font-size: 16px; color: var(--gold);
  text-align: center;
}
.dream-step .tx { font-size: 13.5px; color: var(--muted); line-height: 1.75; }
.dream-step .tx b { color: var(--ink); font-weight: 500; }

.sample-card .q {
  font-family: var(--font-serif); font-size: 18px; color: var(--gold-bright);
  margin: 6px 0 10px;
}
.sample-card .a { font-size: 14.5px; line-height: 1.9; color: var(--ink); }
.sample-card .a em { font-style: normal; color: var(--gold-bright); }
.sample-meta {
  display: flex; flex-wrap: wrap; gap: 8px; margin-top: 14px;
}

/* ── 移动端导航：不再横向滚动，改为紧凑换行 ──
   overflow:auto 会裁掉下拉菜单，且第 5 项被挤出屏幕。
   nav-group 设为 static 后，菜单以 .top-nav（sticky）为定位基准铺满一行。 */
@media (max-width: 760px) {
  .top-nav {
    justify-content: center;
    flex-wrap: wrap;
    overflow: visible;
    gap: 6px;
    padding: 10px 10px;
  }
  .top-nav > a,
  .nav-toggle {
    padding: 6px 11px;
    font-size: 13px;
  }
  .nav-toggle { gap: 5px; }

  .nav-group { position: static; }

  .nav-menu {
    left: 10px;
    right: 10px;
    top: calc(100% - 2px);
    width: auto;
    min-width: 0;
    grid-template-columns: 1fr;
    gap: 4px;
    transform: translateY(-6px);
    max-height: 62vh;
    overflow-y: auto;
  }
  .nav-group.is-open .nav-menu { transform: translateY(0); }
  .nav-menu a { padding: 9px 12px; }
  .nav-menu a .d { display: none; }
  .nav-col-title { margin: 4px 0 4px 12px; }
  .nav-col { gap: 1px; }
}

/* 菜单用不透明底：半透明会让下层标题透出来，影响阅读 */
.nav-menu { background: #151009; }

@media (max-width: 760px) {
  .nav-menu { max-height: 74vh; }
  .nav-menu a { padding: 8px 12px; }
}

/* ═══════════════════════════════════════════════════════════
   首页：双栏 Hero · 今日卡 · 模块入口 · 每日一卦
   ═══════════════════════════════════════════════════════════ */

.hero-split {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, .92fr);
  gap: 46px;
  align-items: center;
  position: relative;
  z-index: 1;
}
.hero-split h1 {
  font-size: clamp(30px, 3.6vw, 56px);
  letter-spacing: .02em;
}
.hero-split .hero-subtitle { font-size: 16.5px; max-width: 44ch; }

/* 今日卡 */
.today-card {
  border: 1px solid var(--line-strong);
  border-radius: 22px;
  padding: 22px 22px 18px;
  background:
    radial-gradient(120% 130% at 100% 0%, rgba(212, 163, 74, .16), transparent 62%),
    rgba(255, 255, 255, .025);
  box-shadow: 0 24px 60px rgba(0, 0, 0, .35), 0 0 0 1px rgba(212, 163, 74, .06);
  min-height: 220px;
}
.today-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 14px; }
.today-date {
  font-family: var(--font-serif); font-size: 36px; line-height: 1.1;
  color: var(--gold-bright); letter-spacing: .02em;
  text-shadow: 0 0 30px rgba(212, 163, 74, .25);
}
.today-sub { font-family: var(--font-sans); font-size: 12px; color: var(--muted); margin-top: 6px; }
.today-gz {
  text-align: right; font-family: var(--font-serif); font-size: 19px;
  letter-spacing: .12em; color: var(--gold-bright); line-height: 1.35;
}
.today-gz .today-sub { letter-spacing: .04em; font-family: var(--font-sans); }
.today-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.today-yiji {
  display: grid; grid-template-columns: 1fr 1fr; gap: 14px;
  margin-top: 16px; padding-top: 14px; border-top: 1px dashed var(--line);
}
.today-yiji .h {
  font-family: var(--font-sans); font-size: 11px; letter-spacing: .16em;
  margin-bottom: 6px;
}
.today-yiji .col.yi .h { color: var(--jade); }
.today-yiji .col.ji .h { color: var(--seal); }
.today-yiji .col + .col { border-left: 1px solid var(--line); padding-left: 14px; }
.today-yiji .items {
  font-family: var(--font-sans); font-size: 12.5px; line-height: 1.9;
  color: var(--ink); word-break: keep-all;
}
.today-card .go { display: inline-block; margin-top: 14px; }

.go {
  font-family: var(--font-sans); font-size: 13px; color: var(--gold-bright);
  text-decoration: none; letter-spacing: .03em;
  transition: color .2s, transform .2s;
}
.go:hover { color: #fff0cf; transform: translateX(3px); }

/* 模块入口 */
.entry-grid {
  display: grid; grid-template-columns: repeat(auto-fit, minmax(238px, 1fr));
  gap: 16px;
}
.entry-card { position: relative; overflow: hidden; padding: 22px 22px 20px; }
.entry-card .glyph {
  position: absolute; right: 10px; top: 2px;
  font-family: var(--font-serif); font-size: 82px; line-height: 1;
  color: rgba(212, 163, 74, .07); pointer-events: none; user-select: none;
}
.entry-card .tagline {
  font-family: var(--font-sans); font-size: 11.5px; letter-spacing: .16em;
  color: var(--gold); text-transform: uppercase; margin: 0 0 8px;
}
.entry-card h3 { font-size: 18px; margin: 0 0 8px; }
.entry-card p { font-size: 13.8px; color: var(--muted); line-height: 1.8; margin: 0 0 14px; }
.entry-card.is-soon { border-style: dashed; }
.entry-card.is-soon .tagline { color: var(--muted); }

/* 每日一卦 */
.hex-day {
  display: grid; grid-template-columns: auto 1fr; gap: 30px;
  align-items: center; padding: 26px 28px;
}
.hd-sym {
  font-family: var(--font-serif); font-size: 92px; line-height: 1;
  color: var(--gold-bright); text-align: center; min-width: 110px;
  text-shadow: 0 0 44px rgba(212, 163, 74, .3);
}
.hd-meta {
  font-family: var(--font-sans); font-size: 11.5px; letter-spacing: .16em;
  color: var(--gold); text-transform: uppercase; margin-bottom: 6px;
}
.hd-name { font-family: var(--font-serif); font-size: 26px; color: var(--ink); }
/* 今日一卦的两个出口：读通义（免费）/ 细解（扣 1 次） */
.hd-acts { display: flex; flex-wrap: wrap; gap: 8px; }
/* 两个都用 outline，靠色调分主次——细解是更深的服务，但别抢下方「进入卜卦」
   那颗实心金按钮的位置，否则一屏里两颗实心金按钮，谁都不突出。 */
.hd-acts .btn.is-strong {
  color: var(--gold-bright);
  border-color: rgba(212, 163, 74, .5);
  background: rgba(212, 163, 74, .09);
}

@media (max-width: 900px) {
  .hero-split { grid-template-columns: 1fr; gap: 28px; }
  .hero-split .hero-subtitle { max-width: none; }
  .today-card { min-height: 0; }
  .hex-day { grid-template-columns: 1fr; gap: 14px; text-align: center; }
  .hd-sym { font-size: 68px; min-width: 0; }
  .hd-acts { justify-content: center; }
  .today-yiji .col + .col { padding-left: 12px; }
}

.today-foot {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line);
}
.today-foot .go { margin-top: 0; }

/* Hero 内的「即将开放」入口：可点，但先说明状态 */
.btn.has-soon {
  display: inline-flex; align-items: center; gap: 7px;
  border-style: dashed;
}
.soon-tag {
  font-size: 10px; letter-spacing: .04em; padding: 1px 6px;
  border-radius: 999px; border: 1px solid rgba(212, 175, 110, .35);
  color: var(--muted); background: rgba(255, 255, 255, .04);
  font-family: var(--font-sans); white-space: nowrap;
}
.btn.has-soon:hover .soon-tag { color: var(--gold-bright); border-color: var(--line-strong); }

@media (max-width: 480px) {
  .hero-actions { gap: 10px; }
}

/* 窄屏下四个入口排成 2×2，比 3+1 更稳 */
@media (max-width: 480px) {
  .hero-actions {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
  }
  .hero-actions .btn { justify-content: center; }
}

/* 页脚条款链接（隐私政策 / 用户协议） */
.site-footer .foot-sep { margin: 0 8px; opacity: .45; }
.site-footer a { color: var(--muted); text-decoration: none; border-bottom: 1px dotted var(--line-strong); }
.site-footer a:hover { color: var(--gold); }

/* AI 生成内容标识（《人工智能生成合成内容标识办法》要求，只做一行小字） */
.ai-notice {
  margin: 14px 0 0;
  font-family: var(--font-sans);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--muted);
  opacity: .72;
  letter-spacing: .2px;
}

/* ═══════════════════════════════════════════════════════════
   移动端专项（2026-10-25）

   起因：手机上（iPhone 390pt）打开任何一页，首屏 844pt 里有 130pt 是两行导航、
   再往下 490–570pt 是 Hero 标题区，功能内容全被挤到折叠线以下。用户第一眼看到
   的只有站名和一段说明，看不到能做什么。

   目标：导航 + Hero 控制在 380pt 内，首屏至少露出一张卡或表单的前两行。
   放在文件末尾，靠顺序覆盖前面零散的 @media 规则，不改动桌面端任何值。
   ═══════════════════════════════════════════════════════════ */
@media (max-width: 760px) {

  /* 1. 顶栏：9 个入口仍是两行（横向滚动会裁掉下拉菜单），但压到约 100pt */
  .top-nav {
    gap: 5px;
    padding: 8px 8px 9px;
  }
  .top-nav > a,
  .nav-toggle {
    padding: 5px 10px;
    font-size: 12.5px;
  }
  .nav-toggle { gap: 4px; }

  /* 2. Hero：490–570pt → 约 280pt */
  .hero { padding: 26px 18px 30px; }
  .hero.compact { padding: 24px 18px 28px; }
  .hero .eyebrow {
    font-size: 11px;
    letter-spacing: .24em;
  }
  .hero h1,
  .hero-split h1 {
    font-size: 26px;
    margin: 8px 0 10px;
    /* 小屏改纯色：渐变字依赖 background-clip:text，配合合成层在部分移动端
       浏览器会整块不显示（只剩一团光）。手机上少这点渐变不影响观感。 */
    background: none;
    -webkit-background-clip: border-box;
    background-clip: border-box;
    -webkit-text-fill-color: currentColor;
    color: var(--gold-bright);
    animation: none;
  }
  .hero-subtitle,
  .hero-split .hero-subtitle {
    font-size: 14.5px;
    line-height: 1.75;
    color: #c2b399;
    animation: none;
  }
  .hero-actions {
    margin-top: 18px;
    gap: 9px;
  }
  .hero-actions .btn {
    padding: 10px 14px;
    font-size: 14px;
  }

  /* 3. 内容区：收掉多余留白，一屏能多放半张卡 */
  .page-shell { padding: 26px 16px 64px; }
  .section { margin: 28px 0; }
  .section-title { margin-bottom: 16px; gap: 10px; }
  .card { padding: 18px; border-radius: 16px; }

  /* 4. 卦列表筛选：4 个控件纵排占 340pt，首屏一张卦卡都露不出来。
        改成一排三个下拉 + 搜索框独占一行，高度降到约 190pt。 */
  .search-panel {
    padding: 12px;
    margin-bottom: 18px;
  }
  .search-row {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .search-row input { grid-column: 1 / -1; }
  .search-row input,
  .search-row select {
    padding: 10px 10px;
    font-size: 13.5px;
    border-radius: 10px;
  }
  .search-panel .muted {
    margin: 10px 0 0;
    font-size: 12.5px;
    line-height: 1.65;
  }

  /* 5. 黄历：7 列格子每格约 47pt，日期+农历两行已经很挤，别再加大字号 */
  .cal-month { padding: 10px; }
  .cal-cell { padding: 3px 0; gap: 1px; }
  .cal-cell .d { font-size: 12.5px; }
  .cal-cell .l { font-size: 8.5px; letter-spacing: 0; }

  /* 6. 拼音注音不撑行距（详情页正文注音已在 pinyin.js 里跳过长段落） */
  ruby.py rt {
    font-size: .5em;
    line-height: 1.1;
  }

  /* 7. 四柱表 480pt 宽，小屏要横向滑动；右侧压一层渐变提示「还能滑」 */
  .pillars-wrap {
    -webkit-mask-image: linear-gradient(90deg, #000 91%, rgba(0, 0, 0, .35) 100%);
    mask-image: linear-gradient(90deg, #000 91%, rgba(0, 0, 0, .35) 100%);
  }
}

/* 超窄屏（360 及以下）：再压一档，避免导航挤成三行 */
@media (max-width: 380px) {
  .top-nav > a,
  .nav-toggle {
    padding: 5px 8px;
    font-size: 12px;
  }
  .hero h1,
  .hero-split h1 { font-size: 24px; }
}

/* 移动端 6 个主按钮：2 列 × 3 行改成 3 列 × 2 行，省下约 70pt 高度。
   放在上面 480 断点之后，同特异性下后者生效。 */
@media (max-width: 760px) {
  .hero-actions {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 8px;
  }
  .hero-actions .btn { justify-content: center; }
}

/* 出生地下拉：选项是「北京（东经 116.41°）」，两列布局下每列约 168pt 会截成
   「北京（东经 11…」。小屏让它独占一行；同时把表单说明文字收紧一点。 */
@media (max-width: 760px) {
  .form-row .field-wide { grid-column: 1 / -1; }
  .field > .hint {
    font-size: 11px;
    line-height: 1.6;
  }
  .form-row { gap: 12px; }
}

/* 阶梯场景用负 margin 撑满全宽，值要跟着 .page-shell 的 padding 走，
   否则小屏会多出 4pt（394 视口里出现 398 宽的装饰层，横向溢出）。 */
@media (max-width: 760px) {
  .stairs-scene {
    margin-left: -16px;
    margin-right: -16px;
  }
}

/* 64 个卦详解页底部的「细解此卦」入口（由 scripts/inject_hex_cta.py 注入）。
   这些页面是全站最深的内容，读完卦辞爻辞后最想问的就是「这卦对我意味着什么」，
   用 serif 标题把这个问句接住，别让页面在免责声明处直接结束。 */
.hex-ask-t {
  font-family: var(--font-serif);
  font-size: 21px;
  line-height: 1.55;
  margin: 8px 0 10px;
  color: var(--ink, #2b2620);
}
@media (max-width: 760px) {
  .hex-ask-t { font-size: 18px; }
}

/* ═══════════════════════════════════════════════════════════
   八字术语解释：表格里的十神按钮 + 术语弹层
   十神是新手最大的阅读障碍——「正官」「七杀」一个个词摆在那里，
   没有入口解释就等于没有信息。所以让词本身可点。
   ═══════════════════════════════════════════════════════════ */

/* 表格里的十神：做成低调的胶囊按钮，不打断表格的阅读节奏 */
.ss-term {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--jade);
  font: inherit;
  font-size: 13px;
  padding: 1px 5px;
  margin: 0 1px;
  border-radius: 6px;
  cursor: pointer;
  line-height: 1.5;
  transition: background .16s, border-color .16s, color .16s;
}
.ss-term:hover,
.ss-term:focus-visible {
  background: rgba(74, 157, 132, .16);
  border-color: rgba(74, 157, 132, .5);
  color: #7fd3ba;
  outline: none;
}
.ss-zhi .ss-term { font-size: 12px; padding: 0 3px; }
.pillars td.ss-zhi { line-height: 1.9; }

/* 行内「这是什么」文字按钮：别做成大按钮，它只是补充阅读的入口 */
.term-link {
  appearance: none;
  border: 0;
  background: none;
  padding: 0;
  font: inherit;
  font-size: 12.5px;
  color: var(--gold);
  border-bottom: 1px dashed rgba(212, 163, 74, .45);
  cursor: pointer;
}
.term-link:hover { color: var(--gold-bright); border-bottom-color: var(--gold-bright); }

body.term-open { overflow: hidden; }

.term-modal {
  position: fixed;
  inset: 0;
  z-index: 1200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 24px 16px;
}
.term-modal[hidden] { display: none; }

.term-mask {
  position: absolute;
  inset: 0;
  background: rgba(6, 4, 2, .74);
  backdrop-filter: blur(3px);
}

.term-dialog {
  position: relative;
  width: 100%;
  max-width: 640px;
  max-height: 86vh;
  overflow-y: auto;
  background: linear-gradient(160deg, var(--paper3), var(--paper2));
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 30px 30px 24px;
  animation: termIn .22s ease-out;
}
@keyframes termIn {
  from { opacity: 0; transform: translateY(12px) scale(.985); }
  to { opacity: 1; transform: none; }
}

.term-x {
  position: absolute;
  top: 12px;
  right: 14px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: transparent;
  color: var(--muted);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
}
.term-x:hover { color: var(--ink); border-color: var(--line-strong); }

.term-kicker {
  margin: 0 0 6px;
  font-size: 12px;
  letter-spacing: .08em;
  color: var(--muted);
  font-family: var(--font-sans);
}
.term-dialog h3 {
  margin: 0 0 8px;
  font-family: var(--font-serif);
  font-size: 27px;
  color: var(--gold-bright);
  letter-spacing: .04em;
}
.term-oneline {
  margin: 0 0 18px;
  padding-bottom: 16px;
  border-bottom: 1px solid var(--line);
  font-size: 15.5px;
  line-height: 1.75;
  color: var(--ink);
}
.term-essence {
  margin: 0 0 14px;
  font-size: 14.5px;
  line-height: 1.9;
  color: #ddd0b6;
}
.term-essence b { color: var(--gold-bright); }

.term-content h4 {
  margin: 18px 0 6px;
  font-size: 13px;
  letter-spacing: .1em;
  color: var(--muted);
  font-family: var(--font-sans);
  font-weight: 500;
}

.term-list {
  margin: 0 0 4px;
  padding-left: 18px;
  font-size: 14px;
  line-height: 1.85;
  color: #ddd0b6;
}
.term-list li { margin-bottom: 2px; }

.term-rows { margin-top: 16px; display: grid; gap: 8px; }
.term-row { display: flex; gap: 12px; align-items: baseline; font-size: 13.5px; line-height: 1.75; }
.term-row .k {
  flex: 0 0 74px;
  color: var(--muted);
  font-size: 12.5px;
  letter-spacing: .03em;
  font-family: var(--font-sans);
}
.term-row .v { color: #ddd0b6; }

.term-warn {
  margin: 16px 0 0;
  padding: 12px 16px;
  border-left: 3px solid var(--gold);
  background: rgba(212, 163, 74, .07);
  border-radius: 8px;
  font-size: 13.5px;
  line-height: 1.8;
  color: #d8cab0;
}
.term-warn b { color: var(--gold-bright); }

.term-foot {
  margin: 20px 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 12.5px;
  color: var(--muted);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.term-foot .tag { margin: 0; }
.term-more {
  margin-left: auto;
  color: var(--gold-bright);
  text-decoration: none;
  border-bottom: 1px dashed rgba(240, 199, 106, .4);
}
.term-more:hover { border-bottom-style: solid; }

@media (max-width: 760px) {
  .term-modal { padding: 0; align-items: flex-end; }
  .term-dialog {
    max-height: 92vh;
    border-radius: 20px 20px 0 0;
    padding: 26px 20px 20px;
  }
  .term-dialog h3 { font-size: 23px; }
  .term-row { flex-direction: column; gap: 2px; }
  .term-row .k { flex: none; }
  .term-more { margin-left: 0; width: 100%; }
}

/* ═══════════════════════════════════════════════════════════
   术语弹层的更多入口：大运 / 流年 / 今日运势里的十神，
   以及命盘摘要卡里的喜用·忌神 chip。
   原则同上：术语是新手最大的阅读障碍，入口就放在词本身上。
   ═══════════════════════════════════════════════════════════ */

/* 大运 / 流年：原 .ss 是 div 纯文本（11px / 10px），按钮继承原字号与颜色 */
.yun-step .ss .ss-term { font-size: 11px; padding: 0 3px; color: var(--jade); }
.liunian-chip .ss .ss-term { font-size: 10px; padding: 0 2px; color: var(--jade); }

/* 今日运势头部：十神按钮别比旁边的文字大，颜色跟正文一致 */
#fortuneHead .ss-term { font-size: inherit; color: inherit; font-weight: 600; }

/* 命盘摘要卡：喜用 / 忌神的 chip 从 span 换成了 button，
   重置按钮默认样式让外观与原 chip 一致，加一个可点的提示 */
button.chip {
  appearance: none;
  font: inherit;
  cursor: pointer;
  transition: background .16s, border-color .16s, transform .16s;
}
button.chip:hover,
button.chip:focus-visible {
  background: rgba(212, 163, 74, .18);
  border-color: var(--gold-bright);
  transform: translateY(-1px);
  outline: none;
}
button.chip.is-ji:hover,
button.chip.is-ji:focus-visible {
  background: rgba(212, 70, 47, .14);
  border-color: #e8a195;
}
