/* =========================================================
   长景·易经 — 深黑 / 暗金 / 青玉
   纯静态样式，无外网字体与图标依赖
   ========================================================= */

/* ---------- 1. 设计变量 ---------- */
:root {
  --bg: #05060a;
  --bg-2: #0b0d14;
  --bg-3: #10131c;
  --silver: #b3c0cd;
  --silver-light: #d8e0e8;
  --silver-dim: #79848f;
  --jade: #5fb3a1;
  --jade-dim: rgba(95, 179, 161, 0.5);
  --ink: #e0e5ea;
  --ink-soft: #a2adb8;
  --muted: #6e7883;
  --line: rgba(196, 208, 220, 0.10);
  --line-strong: rgba(196, 208, 220, 0.22);
  --card: rgba(18, 20, 28, 0.72);
  --card-2: rgba(24, 26, 36, 0.86);

  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif;
  --font-sans: "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;

  --radius: 14px;
  --radius-sm: 9px;
  --header-h: 66px;
  --maxw: 1180px;
}

/* ---------- 2. 基础重置 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  min-height: 100vh;
  color: var(--ink);
  background:
    radial-gradient(1200px 800px at 50% -10%, #141826 0%, transparent 60%),
    radial-gradient(900px 600px at 85% 20%, rgba(196, 208, 220, 0.045) 0%, transparent 60%),
    linear-gradient(180deg, var(--bg) 0%, var(--bg-2) 55%, #070910 100%);
  background-attachment: fixed;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

h1, h2, h3, h4 {
  margin: 0;
  font-family: var(--font-serif);
  font-weight: 600;
  line-height: 1.35;
  letter-spacing: 0.04em;
}

p {
  margin: 0;
}

a {
  color: inherit;
  text-decoration: none;
}

button {
  font: inherit;
  color: inherit;
  background: none;
  border: 0;
  cursor: pointer;
}

ul, ol {
  margin: 0;
  padding: 0;
  list-style: none;
}

dl, dd, dt {
  margin: 0;
}

::selection {
  background: rgba(196, 208, 220, 0.18);
  color: #fff;
}

:focus-visible {
  outline: 1px solid var(--silver);
  outline-offset: 3px;
}

code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.9em;
  color: var(--silver-light);
  background: rgba(196, 208, 220, 0.065);
  padding: 1px 5px;
  border-radius: 4px;
}

/* ---------- 3. 背景层 ---------- */
#starfield {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: 0.9;
}

.aurora {
  position: fixed;
  z-index: 0;
  border-radius: 50%;
  pointer-events: none;
  filter: blur(90px);
}

.aurora--silver {
  width: 46vw;
  height: 46vw;
  top: -18vw;
  right: -10vw;
  background: radial-gradient(circle, rgba(196, 208, 220, 0.1), transparent 70%);
}

.aurora--jade {
  width: 40vw;
  height: 40vw;
  bottom: -16vw;
  left: -12vw;
  background: radial-gradient(circle, rgba(95, 179, 161, 0.11), transparent 70%);
}

.site-header,
.app,
.site-footer {
  position: relative;
  z-index: 2;
}

/* ---------- 4. 顶栏 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(5, 6, 10, 0.72);
  -webkit-backdrop-filter: blur(14px);
  backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(196, 208, 220, 0.075);
}

.site-header__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  height: var(--header-h);
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 11px;
}

.brand__seal {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border: 1px solid var(--line-strong);
  border-radius: 6px;
  color: var(--silver-light);
  font-family: var(--font-serif);
  font-size: 17px;
  background: linear-gradient(145deg, rgba(196, 208, 220, 0.1), rgba(196, 208, 220, 0.014));
  box-shadow: 0 0 16px rgba(196, 208, 220, 0.075) inset;
}

.brand__text {
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.brand__dot {
  color: var(--silver);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav__link {
  position: relative;
  padding: 8px 14px;
  font-size: 14px;
  letter-spacing: 0.12em;
  color: var(--muted);
  border-radius: 999px;
  transition: color 0.25s ease, background 0.25s ease;
}

.site-nav__link:hover {
  color: var(--ink);
  background: rgba(196, 208, 220, 0.045);
}

.site-nav__link.is-active {
  color: var(--silver-light);
}

.site-nav__link.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 1px;
  width: 16px;
  height: 1px;
  transform: translateX(-50%);
  background: var(--silver);
  box-shadow: 0 0 8px rgba(196, 208, 220, 0.55);
}

/* ---------- 5. 通用布局 ---------- */
.app {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 0 24px 80px;
  min-height: calc(100vh - var(--header-h) - 140px);
}

.page {
  animation: pageIn 0.55s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

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

/* ---------- 6. 首页 Hero ---------- */
.hero {
  padding: 84px 0 64px;
  text-align: center;
  position: relative;
}

.hero__eyebrow {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  font-size: 12px;
  letter-spacing: 0.42em;
  color: var(--silver);
  text-indent: 0.42em;
}

.hero__rule {
  display: block;
  width: 42px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line-strong));
}

.hero__rule:last-child {
  background: linear-gradient(270deg, transparent, var(--line-strong));
}

.hero__title {
  margin: 18px 0 0;
  font-size: clamp(46px, 8vw, 82px);
  font-weight: 600;
  letter-spacing: 0.14em;
  text-indent: 0.14em;
  background: linear-gradient(175deg, #c8d2dc 8%, var(--silver) 48%, #75808c 96%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 0 60px rgba(196, 208, 220, 0.12);
}

.hero__sep {
  color: var(--silver-dim);
  font-weight: 300;
}

.hero__sub {
  margin-top: 14px;
  font-family: var(--font-serif);
  font-size: clamp(15px, 2.4vw, 19px);
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--ink-soft);
}

.hero__desc {
  max-width: 560px;
  margin: 22px auto 0;
  font-size: 14.5px;
  line-height: 2;
  color: var(--muted);
}

.hero__actions {
  margin-top: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
}

.hero__hint {
  margin-top: 18px;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: rgba(140, 150, 162, 0.55);
}

.hero__links {
  margin: 44px auto 0;
  max-width: 720px;
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.hero__link {
  flex: 1 1 180px;
  min-width: 0;
  display: block;
  padding: 15px 17px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.014);
  text-decoration: none;
  transition: border-color 0.25s, background 0.25s;
}

.hero__link b {
  display: block;
  font-family: var(--font-serif);
  font-size: 15px;
  font-weight: 500;
  letter-spacing: 0.1em;
  color: var(--ink);
  transition: color 0.25s;
}

.hero__link span {
  display: block;
  margin-top: 7px;
  font-size: 12px;
  line-height: 1.75;
  color: rgba(140, 150, 162, 0.72);
}

.hero__link:hover {
  border-color: rgba(95, 179, 161, 0.42);
  background: rgba(95, 179, 161, 0.05);
}

.hero__link:hover b {
  color: var(--jade);
}

/* ---------- 7. 按钮 ---------- */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 9px;
  height: 46px;
  padding: 0 26px;
  border-radius: 999px;
  font-size: 14.5px;
  letter-spacing: 0.16em;
  text-indent: 0.16em;
  white-space: nowrap;
  transition: transform 0.25s ease, box-shadow 0.3s ease, border-color 0.3s ease, color 0.25s ease;
}

.btn .icon {
  width: 18px;
  height: 18px;
  flex: none;
}

.btn--primary {
  color: #0e1520;
  font-weight: 600;
  background: linear-gradient(150deg, #c3cdd8 0%, var(--silver) 46%, #8593a0 100%);
  box-shadow: 0 6px 26px rgba(196, 208, 220, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.22);
}

.btn--primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 10px 34px rgba(196, 208, 220, 0.24), inset 0 1px 0 rgba(255, 255, 255, 0.4);
}

.btn--ghost {
  color: var(--ink-soft);
  border: 1px solid var(--line-strong);
  background: rgba(196, 208, 220, 0.021);
}

.btn--ghost:hover {
  color: var(--silver-light);
  border-color: rgba(196, 208, 220, 0.42);
  transform: translateY(-2px);
}

.btn--muted {
  border-color: rgba(140, 150, 162, 0.18);
  color: var(--muted);
}

.btn--small {
  height: 36px;
  padding: 0 18px;
  font-size: 13px;
  border: 1px solid var(--line-strong);
  color: var(--silver-light);
  background: rgba(196, 208, 220, 0.04);
}

.btn--small:hover {
  background: rgba(196, 208, 220, 0.09);
}

.btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
  transform: none;
  box-shadow: none;
}

/* ---------- 8. 首页目录 ---------- */
.catalog {
  padding-top: 16px;
  scroll-margin-top: calc(var(--header-h) + 20px);
}

.section-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  padding-bottom: 18px;
  margin-bottom: 26px;
  border-bottom: 1px solid var(--line);
}

.section-head h2 {
  font-size: 24px;
  letter-spacing: 0.18em;
  color: var(--ink);
}

.section-sub {
  margin-top: 6px;
  font-size: 12.5px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.tabs {
  display: inline-flex;
  padding: 4px;
  gap: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(10, 12, 18, 0.7);
}

.tab {
  padding: 7px 16px;
  border-radius: 999px;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--muted);
  transition: color 0.25s ease, background 0.25s ease;
}

.tab span {
  margin-left: 4px;
  font-size: 11px;
  opacity: 0.6;
}

.tab:hover {
  color: var(--ink);
}

.tab.is-active {
  color: #0e1520;
  background: linear-gradient(150deg, #dce4ec, var(--silver));
  box-shadow: 0 2px 12px rgba(196, 208, 220, 0.18);
}

.tab.is-active span {
  opacity: 0.75;
}

/* ---------- 9. 卦卡片宫格 ---------- */
.gua-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
}

.gua-card {
  position: relative;
  display: grid;
  grid-template-columns: auto 1fr;
  grid-template-areas:
    "symbol name"
    "symbol full"
    "meta meta";
  align-items: center;
  column-gap: 12px;
  padding: 18px 16px 15px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    linear-gradient(160deg, rgba(255, 255, 255, 0.035), transparent 42%),
    var(--card);
  box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
  animation: cardIn 0.6s cubic-bezier(0.2, 0.7, 0.2, 1) both;
  transition: transform 0.35s cubic-bezier(0.2, 0.7, 0.2, 1),
              border-color 0.35s ease,
              box-shadow 0.35s ease;
}

@keyframes cardIn {
  from {
    opacity: 0;
    transform: translateY(18px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 微光扫过 */
.gua-card::after {
  content: "";
  position: absolute;
  inset: -20%;
  background: linear-gradient(115deg,
    transparent 32%,
    rgba(196, 208, 220, 0.1) 48%,
    rgba(232, 207, 149, 0.06) 54%,
    transparent 68%);
  transform: translateX(-130%);
  transition: transform 0.85s ease;
  pointer-events: none;
}

.gua-card:hover,
.gua-card:focus-visible {
  transform: translateY(-5px);
  border-color: rgba(196, 208, 220, 0.3);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.42), 0 0 0 1px rgba(196, 208, 220, 0.052),
              0 0 40px rgba(196, 208, 220, 0.052);
}

.gua-card:hover::after,
.gua-card:focus-visible::after {
  transform: translateX(130%);
}

.gua-card__no {
  position: absolute;
  top: 12px;
  right: 16px;
  font-family: var(--font-serif);
  font-size: 12px;
  letter-spacing: 0.1em;
  color: rgba(196, 208, 220, 0.28);
}

.gua-card__symbol {
  grid-area: symbol;
  font-family: var(--font-serif);
  font-size: 40px;
  line-height: 1;
  color: var(--silver-light);
  text-shadow: 0 0 22px rgba(196, 208, 220, 0.2);
  transition: text-shadow 0.35s ease, transform 0.35s ease;
}

.gua-card:hover .gua-card__symbol {
  text-shadow: 0 0 30px rgba(196, 208, 220, 0.38);
  transform: translateY(-1px);
}

.gua-card__name {
  grid-area: name;
  align-self: end;
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.gua-card__full {
  grid-area: full;
  align-self: start;
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--muted);
}

.gua-card__meta {
  grid-area: meta;
  margin-top: 13px;
  padding-top: 10px;
  border-top: 1px dashed rgba(196, 208, 220, 0.09);
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: rgba(140, 150, 162, 0.62);
}

/* ---------- 10. 详情页 ---------- */
.detail-page {
  padding-top: 30px;
}

.crumbs {
  margin-bottom: 26px;
  font-size: 13px;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.crumbs a {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 0;
  transition: color 0.25s ease;
}

.crumbs a:hover {
  color: var(--silver-light);
}

.crumbs .icon {
  width: 14px;
  height: 14px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 46px;
  align-items: start;
}

.detail-aside {
  position: sticky;
  top: calc(var(--header-h) + 26px);
}

.aside-card {
  padding: 28px 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(120% 90% at 50% 0%, rgba(196, 208, 220, 0.052), transparent 60%),
    var(--card);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.3);
}

.hex-figure {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 22px 8px;
  margin-bottom: 22px;
  border-top: 1px solid rgba(196, 208, 220, 0.065);
  border-bottom: 1px solid rgba(196, 208, 220, 0.065);
}

.hex-row {
  display: flex;
  justify-content: center;
  gap: 16%;
  height: 12px;
}

.hex-bar {
  display: block;
  flex: 1 1 auto;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #64707c, #dce4ec 50%, #64707c);
  box-shadow: 0 0 12px rgba(196, 208, 220, 0.23);
  transform-origin: center;
  animation: drawLine 0.55s cubic-bezier(0.25, 0.8, 0.25, 1) both;
  animation-delay: var(--delay, 0s);
}

.hex-bar--half {
  flex: 0 0 42%;
}

.hex-bar--ghost {
  background: transparent;
  border: 1px dashed rgba(196, 208, 220, 0.12);
  box-shadow: none;
  animation: none;
}

@keyframes drawLine {
  0% {
    transform: scaleX(0);
    opacity: 0;
    filter: brightness(2.2);
  }
  60% {
    opacity: 1;
  }
  100% {
    transform: scaleX(1);
    opacity: 1;
    filter: brightness(1);
  }
}

.aside-title {
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.aside-title h1 {
  font-size: 40px;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.aside-symbol {
  font-size: 22px;
  color: var(--silver);
  opacity: 0.8;
}

.aside-full {
  margin-top: 4px;
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.24em;
  color: var(--silver-light);
}

.aside-index {
  margin-top: 10px;
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--muted);
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}

.tag {
  padding: 4px 12px;
  border: 1px solid rgba(95, 179, 161, 0.32);
  border-radius: 999px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: #8fd2c2;
  background: rgba(95, 179, 161, 0.06);
}

.tri-list {
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px dashed rgba(196, 208, 220, 0.1);
}

.tri-row {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 6px 0;
  font-size: 13px;
}

.tri-row dt {
  color: var(--muted);
  letter-spacing: 0.14em;
}

.tri-row dd {
  color: var(--ink-soft);
  font-family: var(--font-serif);
  letter-spacing: 0.12em;
}

/* 文本块 */
.detail-main {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

.text-block {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  overflow: hidden;
  transition: border-color 0.3s ease;
}

.text-block:hover {
  border-color: rgba(196, 208, 220, 0.18);
}

.text-block__head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 24px;
  cursor: pointer;
  list-style: none;
  user-select: none;
}

.text-block__head::-webkit-details-marker {
  display: none;
}

.text-block__head--static {
  cursor: default;
}

.text-block__head h2 {
  font-size: 17px;
  letter-spacing: 0.2em;
  color: var(--silver-light);
}

.text-block__tag {
  padding: 2px 9px;
  border: 1px solid rgba(196, 208, 220, 0.2);
  border-radius: 4px;
  font-size: 10.5px;
  letter-spacing: 0.14em;
  color: rgba(196, 208, 220, 0.55);
}

.text-block__tag--jade {
  border-color: rgba(95, 179, 161, 0.34);
  color: rgba(143, 210, 194, 0.9);
}

.text-block__chev {
  position: relative;
  width: 12px;
  height: 12px;
  margin-left: auto;
  flex: none;
}

.text-block__chev::before,
.text-block__chev::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--silver-dim);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.text-block__chev::after {
  transform: rotate(90deg);
}

.text-block[open] .text-block__chev::after {
  transform: rotate(0deg);
  opacity: 0;
}

.text-block__body {
  padding: 0 24px 24px;
  animation: bodyIn 0.35s ease both;
}

@keyframes bodyIn {
  from {
    opacity: 0;
    transform: translateY(-4px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

.classic {
  font-family: var(--font-serif);
  font-size: 18px;
  line-height: 2.05;
  letter-spacing: 0.08em;
  color: #d6dde4;
  text-align: justify;
}

.classic--empty {
  color: var(--muted);
  font-size: 15px;
}

.prose {
  font-size: 15px;
  line-height: 2.05;
  color: var(--ink-soft);
  text-align: justify;
}

.block-hint {
  margin-top: 12px;
  font-size: 12.5px;
  color: rgba(140, 150, 162, 0.85);
}

.reading {
  position: relative;
  margin-top: 18px;
  padding: 14px 18px 14px 20px;
  border-left: 2px solid rgba(95, 179, 161, 0.55);
  border-radius: 0 8px 8px 0;
  background: linear-gradient(90deg, rgba(95, 179, 161, 0.07), rgba(95, 179, 161, 0.015));
}

.reading__label {
  display: inline-block;
  margin-bottom: 4px;
  font-size: 11px;
  letter-spacing: 0.28em;
  color: rgba(143, 210, 194, 0.9);
}

.reading p {
  font-size: 14.5px;
  line-height: 2;
  color: var(--ink-soft);
  text-align: justify;
}

/* 六爻列表 */
.lines-section {
  margin-top: 30px;
}

.lines-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 14px;
}

.lines-head h2 {
  font-size: 20px;
  letter-spacing: 0.2em;
  color: var(--ink);
}

.lines-hint {
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.line-list {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  background: rgba(16, 18, 26, 0.6);
}

.line-item + .line-item {
  border-top: 1px solid rgba(196, 208, 220, 0.065);
}

.line-head {
  display: flex;
  align-items: center;
  gap: 14px;
  width: 100%;
  padding: 16px 20px;
  text-align: left;
  transition: background 0.25s ease;
}

.line-head:hover {
  background: rgba(196, 208, 220, 0.034);
}

.line-item.is-open .line-head {
  background: rgba(196, 208, 220, 0.045);
}

.line-glyph {
  display: flex;
  gap: 6px;
  width: 34px;
  flex: none;
}

.line-glyph i {
  display: block;
  flex: 1;
  height: 6px;
  border-radius: 1px;
  background: linear-gradient(90deg, #75808c, #bcc6d1, #75808c);
}

.line-glyph.is-yin {
  gap: 12px;
}

.line-pos {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: none;
  min-width: 44px;
  white-space: nowrap;
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.08em;
  color: var(--silver-light);
}

.line-text {
  flex: 1;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.04em;
  color: var(--ink-soft);
}

.line-plus {
  position: relative;
  width: 12px;
  height: 12px;
  flex: none;
}

.line-plus::before,
.line-plus::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 0;
  width: 100%;
  height: 1px;
  background: var(--silver-dim);
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.line-plus::after {
  transform: rotate(90deg);
}

.line-item.is-open .line-plus::after {
  transform: rotate(0deg);
  opacity: 0;
}

.line-body {
  display: none;
  padding: 4px 20px 20px 68px;
}

.line-item.is-open .line-body {
  display: block;
  animation: bodyIn 0.35s ease both;
}

.line-xiang {
  margin-top: 12px;
  font-size: 13.5px;
  line-height: 1.9;
  color: rgba(140, 150, 162, 0.95);
}

.line-xiang__label {
  margin-right: 10px;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: var(--silver-dim);
}

.line-badge {
  margin-left: 6px;
  padding: 1px 7px;
  border: 1px solid rgba(196, 208, 220, 0.18);
  border-radius: 3px;
  font-size: 10px;
  letter-spacing: 0.12em;
  color: rgba(196, 208, 220, 0.52);
}

/* 上一卦 / 下一卦 */
.gua-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 34px;
}

.pager-card {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  transition: border-color 0.3s ease, transform 0.3s ease, background 0.3s ease;
}

.pager-card:hover {
  border-color: rgba(196, 208, 220, 0.28);
  background: rgba(196, 208, 220, 0.034);
  transform: translateY(-3px);
}

.pager-card--next {
  text-align: right;
}

.pager-card__label {
  font-size: 11px;
  letter-spacing: 0.22em;
  color: var(--muted);
}

.pager-card__name {
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 0.1em;
  color: var(--silver-light);
}

/* ---------- 11. 起卦页 ---------- */
.divine-page {
  max-width: 920px;
  margin: 0 auto;
  padding-top: 54px;
}

.page-head {
  text-align: center;
  margin-bottom: 34px;
}

.page-head__eyebrow {
  font-size: 12px;
  letter-spacing: 0.4em;
  text-indent: 0.4em;
  color: var(--silver);
}

.page-head__title {
  margin-top: 12px;
  font-size: clamp(34px, 6vw, 46px);
  letter-spacing: 0.2em;
  text-indent: 0.2em;
  color: var(--ink);
}

.page-head__desc {
  margin-top: 12px;
  font-size: 13.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
}

.divine-panel {
  padding: 34px clamp(18px, 4vw, 40px) 30px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    radial-gradient(110% 70% at 50% 0%, rgba(196, 208, 220, 0.045), transparent 62%),
    rgba(14, 16, 23, 0.78);
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
}



/* 铜钱 */
.coin-tray {
  display: flex;
  justify-content: center;
  gap: clamp(18px, 5vw, 42px);
  padding: 12px 0 26px;
  perspective: 900px;
}





.coin {
  width: clamp(64px, 14vw, 86px);
  height: clamp(64px, 14vw, 86px);
  border-radius: 50%;
  transform-style: preserve-3d;
}





.coin__inner {
  position: relative;
  width: 100%;
  height: 100%;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background:
    radial-gradient(circle at 32% 28%, #f6e5b8 0%, #d9b976 34%, #a8883f 68%, #6f5726 100%);
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.45),
    inset 0 0 0 3px rgba(60, 44, 12, 0.35),
    inset 0 0 18px rgba(255, 240, 200, 0.35);
  transform-style: preserve-3d;
}





/* 铜钱方孔 */
.coin__inner::before {
  content: "";
  position: absolute;
  width: 30%;
  height: 30%;
  background: #14110a;
  border-radius: 3px;
  box-shadow: inset 0 0 6px rgba(0, 0, 0, 0.9), 0 0 0 2px rgba(90, 68, 26, 0.55);
}





.coin__char {
  position: relative;
  z-index: 1;
  font-family: var(--font-serif);
  font-size: clamp(13px, 2.6vw, 16px);
  letter-spacing: 0;
  color: #2b2108;
  text-shadow: 0 1px 0 rgba(255, 245, 215, 0.5);
  transform: translateY(38%);
}





.coin.is-yang .coin__inner {
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.45),
    0 0 26px rgba(200, 164, 92, 0.4),
    inset 0 0 0 3px rgba(60, 44, 12, 0.35),
    inset 0 0 18px rgba(255, 240, 200, 0.45);
}





.coin.is-yin .coin__inner {
  box-shadow:
    0 10px 24px rgba(0, 0, 0, 0.45),
    0 0 24px rgba(95, 179, 161, 0.3),
    inset 0 0 0 3px rgba(24, 52, 46, 0.4),
    inset 0 0 18px rgba(210, 240, 232, 0.25);
}





.coin.is-flipping .coin__inner {
  animation: coinFlip 0.85s cubic-bezier(0.35, 0.1, 0.3, 1) both;
}



@keyframes coinFlip {
  0% {
    transform: rotateY(0deg) rotateX(0deg) translateY(0);
  }
  35% {
    transform: rotateY(420deg) rotateX(180deg) translateY(-16px) scale(1.06);
  }
  70% {
    transform: rotateY(880deg) rotateX(340deg) translateY(-6px) scale(1.02);
  }
  100% {
    transform: rotateY(1080deg) rotateX(360deg) translateY(0) scale(1);
  }
}

/* 掷钱状态 */
.throw-bar {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.throw-status {
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: 13px;
  letter-spacing: 0.12em;
}

.throw-status__label {
  color: var(--silver-light);
  font-family: var(--font-serif);
  font-size: 15px;
  letter-spacing: 0.14em;
}

.throw-status__count {
  color: var(--muted);
  font-size: 12px;
}

.steps {
  display: flex;
  gap: 9px;
}

.step-dot {
  width: 26px;
  height: 3px;
  border-radius: 2px;
  background: rgba(196, 208, 220, 0.1);
  transition: background 0.35s ease, box-shadow 0.35s ease;
}

.step-dot.is-done {
  background: var(--silver);
  box-shadow: 0 0 10px rgba(196, 208, 220, 0.38);
}

.step-dot.is-current {
  background: rgba(95, 179, 161, 0.8);
  box-shadow: 0 0 10px rgba(95, 179, 161, 0.5);
}

.divine-actions {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 34px;
}

.divine-board {
  display: grid;
  grid-template-columns: minmax(0, 0.85fr) minmax(0, 1.15fr);
  gap: 26px;
  padding-top: 26px;
  border-top: 1px solid rgba(196, 208, 220, 0.075);
}

.board-title {
  font-size: 15px;
  letter-spacing: 0.2em;
  color: var(--ink);
  margin-bottom: 16px;
}

.board-title span {
  margin-left: 8px;
  font-family: var(--font-sans);
  font-size: 11px;
  letter-spacing: 0.12em;
  color: var(--muted);
}

/* 卦象预览 */
.pv-hex {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 20px 18px;
  border: 1px solid rgba(196, 208, 220, 0.09);
  border-radius: var(--radius-sm);
  background: rgba(8, 10, 15, 0.6);
}

.pv-row {
  display: grid;
  grid-template-columns: 22px minmax(0, 1fr) 20px;
  align-items: center;
  gap: 10px;
  height: 14px;
}

.pv-slot {
  font-family: var(--font-serif);
  font-size: 11px;
  color: rgba(140, 150, 162, 0.52);
  text-align: center;
}

.pv-bars {
  display: flex;
  gap: 14%;
  height: 100%;
}

.pv-bar {
  flex: 1;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, #75808c, #dce4ec 50%, #75808c);
  box-shadow: 0 0 10px rgba(196, 208, 220, 0.2);
  animation: barGrow 0.45s cubic-bezier(0.2, 0.8, 0.2, 1) both;
}

.pv-bar--half {
  flex: 0 0 43%;
}

.pv-bar--ghost {
  background: transparent;
  border: 1px dashed rgba(196, 208, 220, 0.1);
  box-shadow: none;
  animation: none;
}

@keyframes barGrow {
  from {
    transform: scaleX(0.2);
    opacity: 0;
  }
  to {
    transform: scaleX(1);
    opacity: 1;
  }
}

.pv-row.is-moving .pv-bar {
  background: linear-gradient(90deg, #3f8f80, #8fd2c2 50%, #3f8f80);
  box-shadow: 0 0 12px rgba(95, 179, 161, 0.45);
}

.pv-mark {
  font-size: 12px;
  color: var(--jade);
  text-align: center;
}

.pv-legend {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px 12px;
  margin-top: 14px;
  font-size: 11.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
}

.dot--yang {
  background: var(--silver);
}

.dot--yin {
  background: var(--jade);
}

.pv-legend__move {
  color: var(--jade);
}

/* 结果 */
.board-hint {
  display: grid;
  place-items: center;
  min-height: 210px;
  padding: 24px;
  border: 1px dashed rgba(196, 208, 220, 0.1);
  border-radius: var(--radius-sm);
  text-align: center;
  font-size: 13px;
  letter-spacing: 0.06em;
  color: rgba(140, 150, 162, 0.55);
}

.result-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.result-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 22px 16px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(100% 80% at 50% 0%, rgba(196, 208, 220, 0.058), transparent 70%),
    var(--card-2);
  text-align: center;
  animation: cardIn 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}

.result-card--changed {
  background:
    radial-gradient(100% 80% at 50% 0%, rgba(95, 179, 161, 0.1), transparent 70%),
    var(--card-2);
  border-color: rgba(95, 179, 161, 0.22);
}

.result-card__badge {
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 10.5px;
  letter-spacing: 0.2em;
  color: rgba(196, 208, 220, 0.62);
  border: 1px solid rgba(196, 208, 220, 0.2);
}

.result-card--changed .result-card__badge {
  color: rgba(143, 210, 194, 0.95);
  border-color: rgba(95, 179, 161, 0.36);
}

.result-card__symbol {
  font-family: var(--font-serif);
  font-size: 42px;
  line-height: 1.1;
  color: var(--silver-light);
  text-shadow: 0 0 20px rgba(196, 208, 220, 0.2);
}

.result-card--changed .result-card__symbol {
  color: #9adccd;
  text-shadow: 0 0 20px rgba(95, 179, 161, 0.3);
}

.result-card h3 {
  font-size: 20px;
  letter-spacing: 0.14em;
  color: var(--ink);
}

.result-card h3 small {
  display: block;
  margin-top: 2px;
  font-family: var(--font-sans);
  font-size: 11.5px;
  font-weight: 400;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.result-card__hint {
  font-size: 11.5px;
  color: var(--muted);
}

.result-note {
  margin-top: 14px;
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--muted);
  text-align: center;
}

/* 断卦取用 */
.duan {
  margin-top: 26px;
  padding: 20px 20px 18px;
  border: 1px solid rgba(196, 208, 220, 0.09);
  border-radius: var(--radius);
  background: rgba(12, 16, 24, 0.5);
}

.duan__title {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 10px;
  font-size: 13.5px;
  letter-spacing: 0.14em;
  color: var(--jade);
  margin-bottom: 12px;
}

.duan__title span {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  font-weight: 400;
}

.duan__rule {
  font-size: 13px;
  line-height: 1.95;
  color: var(--ink);
  padding-bottom: 12px;
  border-bottom: 1px dashed rgba(196, 208, 220, 0.1);
  margin-bottom: 14px;
}

.duan__list {
  display: grid;
  gap: 14px;
}

.duan__item {
  padding-left: 14px;
  border-left: 2px solid rgba(95, 179, 161, 0.35);
}

.duan__label {
  display: block;
  font-size: 12.5px;
  letter-spacing: 0.08em;
  color: var(--silver-light);
  margin-bottom: 5px;
}

.duan__text {
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--ink);
  margin-bottom: 5px;
}

.duan__reading {
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-soft);
}

.duan__note {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px dashed rgba(196, 208, 220, 0.1);
  font-size: 12px;
  line-height: 1.9;
  color: var(--muted);
}

/* 起卦说明 */
.method {
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid rgba(196, 208, 220, 0.075);
}

.method__title {
  font-size: 14px;
  letter-spacing: 0.22em;
  color: var(--silver-light);
  margin-bottom: 12px;
}

.method__list {
  counter-reset: method;
  display: grid;
  gap: 8px;
}

.method__list li {
  position: relative;
  padding-left: 26px;
  font-size: 13px;
  line-height: 1.9;
  color: var(--ink-soft);
  counter-increment: method;
}

.method__list li::before {
  content: counter(method);
  position: absolute;
  left: 0;
  top: 4px;
  width: 17px;
  height: 17px;
  display: grid;
  place-items: center;
  border: 1px solid rgba(196, 208, 220, 0.2);
  border-radius: 50%;
  font-size: 10px;
  color: var(--silver);
}

.method__note {
  margin-top: 14px;
  font-size: 12px;
  line-height: 1.9;
  color: rgba(140, 150, 162, 0.85);
}


/* ---------- 十翼导读 ---------- */
.wings-page .wings {
  max-width: 860px;
  margin: 0 auto;
  display: grid;
  gap: 22px;
}

.wing {
  padding: 26px 28px 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
}

.wing__head {
  padding-bottom: 14px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
}

.wing__name {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
  font-family: var(--font-serif);
  font-size: 21px;
  letter-spacing: 0.06em;
  color: var(--silver-light);
  margin-bottom: 7px;
}

.wing__alias {
  font-family: var(--font-sans);
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 400;
}

.wing__scope {
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--jade);
}

.wing__body {
  font-size: 14px;
  line-height: 2.05;
  color: var(--ink-soft);
  text-indent: 2em;
}

.wing__quotes {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px dashed var(--line);
  display: grid;
  gap: 14px;
}

.wing__quote {
  padding-left: 14px;
  border-left: 2px solid var(--jade-dim);
}

.wing__quote-text {
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--ink);
  margin-bottom: 4px;
}

.wing__quote-note {
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--muted);
}

.wings__note {
  max-width: 860px;
  margin: 26px auto 0;
  font-size: 12px;
  line-height: 1.9;
  color: rgba(140, 150, 162, 0.85);
}

/* ---------- 术语表 ---------- */
.terms-page .term-group {
  max-width: 900px;
  margin: 0 auto 34px;
}

.term-group__title {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--font-serif);
  font-size: 18px;
  letter-spacing: 0.1em;
  color: var(--silver-light);
  margin-bottom: 8px;
}

.term-group__count {
  font-family: var(--font-sans);
  font-size: 11.5px;
  color: var(--muted);
  font-weight: 400;
}

.term-group__desc {
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--muted);
  margin-bottom: 16px;
}

.term-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.term-card {
  display: block;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: var(--card);
  transition: border-color 0.25s, transform 0.25s, background 0.25s;
}

.term-card:hover,
.term-card:focus-visible {
  border-color: var(--jade-dim);
  background: var(--card-2);
  transform: translateY(-2px);
}

.term-card__term {
  display: block;
  font-family: var(--font-serif);
  font-size: 15.5px;
  letter-spacing: 0.05em;
  color: var(--silver-light);
  margin-bottom: 5px;
}

.term-card__brief {
  display: block;
  font-size: 12px;
  line-height: 1.75;
  color: var(--muted);
}

/* ---------- 单条术语 ---------- */
.crumb {
  max-width: 760px;
  margin: 0 auto 22px;
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.crumb a {
  color: var(--jade);
}

.crumb span {
  margin: 0 8px;
  opacity: 0.5;
}

.crumb em {
  font-style: normal;
  color: var(--silver-dim);
}

.term-page .term-head {
  max-width: 760px;
  margin: 0 auto 26px;
  padding-bottom: 18px;
  border-bottom: 1px solid var(--line);
}

.term-head__title {
  font-family: var(--font-serif);
  font-size: 32px;
  letter-spacing: 0.1em;
  color: var(--silver-light);
  margin-bottom: 10px;
}

.term-head__brief {
  font-size: 13.5px;
  line-height: 1.9;
  color: var(--jade);
}

.term-body {
  max-width: 760px;
  margin: 0 auto;
}

.term-body__text {
  font-size: 15px;
  line-height: 2.15;
  color: var(--ink-soft);
  text-indent: 2em;
}

.term-example {
  margin-top: 24px;
  padding: 18px 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(12, 16, 24, 0.5);
}

.term-example__label {
  display: block;
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: var(--jade);
  margin-bottom: 9px;
}

.term-example__text {
  font-family: var(--font-serif);
  font-size: 14.5px;
  line-height: 2;
  color: var(--ink);
}

.term-siblings {
  max-width: 760px;
  margin: 36px auto 0;
  padding-top: 22px;
  border-top: 1px solid var(--line);
}

.term-siblings__title {
  font-size: 12px;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin-bottom: 14px;
}

.term-siblings__list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.term-chip {
  padding: 6px 13px;
  border: 1px solid var(--line-strong);
  border-radius: 999px;
  font-size: 12.5px;
  color: var(--silver);
  transition: border-color 0.25s, color 0.25s;
}

.term-chip:hover,
.term-chip:focus-visible {
  border-color: var(--jade-dim);
  color: var(--jade);
}


/* ---------- 起卦方法切换 / 大衍过场 ---------- */
.method-switch {
  display: flex;
  width: -moz-fit-content;
  width: fit-content;
  gap: 4px;
  padding: 4px;
  margin: 0 auto 22px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(12, 16, 24, 0.6);
}

.method-switch__btn {
  padding: 8px 20px;
  border: 0;
  border-radius: 999px;
  font-family: inherit;
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: transparent;
  cursor: pointer;
  transition: color 0.25s, background 0.25s;
}

.method-switch__btn:hover {
  color: var(--silver);
}

.method-switch__btn.is-active {
  color: var(--bg);
  background: var(--jade);
}

.dayan-trace {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 14px;
  flex-wrap: wrap;
  min-height: 62px;
  padding: 18px 20px;
  margin-bottom: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(12, 16, 24, 0.5);
}

.dayan-trace__step {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--jade);
}

.dayan-trace__calc {
  font-family: var(--font-serif);
  font-size: 14px;
  letter-spacing: 0.02em;
  color: var(--ink-soft);
}

.method__extra {
  margin-top: 12px;
  padding: 12px 14px;
  border-left: 2px solid var(--jade-dim);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: rgba(95, 179, 161, 0.05);
  font-size: 12.5px;
  line-height: 1.9;
  color: var(--ink-soft);
}

/* hidden 属性优先于 display: grid */
[hidden] {
  display: none !important;
}

/* ---------- 11.5 检索 ---------- */

.search-box {
  margin: 26px 0 0;
}

.search-box__label {
  display: block;
  margin-bottom: 9px;
  font-size: 11.5px;
  letter-spacing: 0.24em;
  color: var(--muted);
}

.search-box__field {
  position: relative;
  display: flex;
  align-items: center;
  max-width: 520px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.015);
  transition: border-color 0.25s, background 0.25s;
}

.search-box__field:focus-within {
  border-color: rgba(95, 179, 161, 0.46);
  background: rgba(95, 179, 161, 0.035);
}

.search-box__icon {
  flex: none;
  width: 17px;
  height: 17px;
  margin-left: 15px;
  color: var(--muted);
  opacity: 0.75;
}

.search-box__input {
  flex: 1 1 auto;
  min-width: 0;
  padding: 12px 14px 12px 11px;
  border: none;
  background: transparent;
  color: var(--ink);
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.03em;
}

.search-box__input:focus {
  outline: none;
}

.search-box__input::placeholder {
  color: rgba(140, 150, 162, 0.45);
}

.search-box__input::-webkit-search-cancel-button {
  -webkit-appearance: none;
  appearance: none;
}

.search-box__clear {
  flex: none;
  width: 26px;
  height: 26px;
  margin-right: 9px;
  padding: 0;
  border: none;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.06);
  color: var(--muted);
  font-size: 16px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s, color 0.2s;
}

.search-box__clear:hover {
  background: rgba(95, 179, 161, 0.18);
  color: var(--ink);
}

.search-summary {
  margin: 22px 0 14px;
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

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

.search-item {
  display: block;
  padding: 16px 18px 15px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.012);
  text-decoration: none;
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
}

.search-item:hover,
.search-item:focus-visible {
  border-color: rgba(95, 179, 161, 0.42);
  background: rgba(95, 179, 161, 0.04);
  transform: translateY(-1px);
  outline: none;
}

.search-item__head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 9px;
}

.search-item__symbol {
  font-size: 21px;
  line-height: 1;
  color: var(--ink-soft);
}

.search-item__name {
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 0.1em;
  color: var(--ink);
}

.search-item__full {
  font-size: 12.5px;
  letter-spacing: 0.05em;
  color: var(--muted);
}

.search-item__no {
  margin-left: auto;
  font-size: 11.5px;
  letter-spacing: 0.04em;
  color: rgba(140, 150, 162, 0.5);
}

.search-hits {
  margin: 11px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-hit {
  display: flex;
  align-items: baseline;
  gap: 9px;
  font-size: 13px;
  line-height: 1.75;
}

.search-hit__label {
  flex: none;
  min-width: 62px;
  font-size: 11px;
  letter-spacing: 0.06em;
  color: rgba(95, 179, 161, 0.72);
}

.search-hit__text {
  color: var(--ink-soft);
}

.search-empty {
  padding: 40px 0 30px;
  text-align: center;
}

.search-empty p {
  font-size: 14.5px;
  color: var(--ink-soft);
}

.search-empty__hint {
  margin-top: 10px;
  font-size: 12.5px;
  line-height: 1.9;
  color: rgba(140, 150, 162, 0.62);
}

/* ---------- 11.9 卦变关系 ---------- */

.rel-section {
  margin-top: 46px;
  padding-top: 34px;
  border-top: 1px solid var(--line);
}

.rel-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
  margin-top: 20px;
}

.rel-card {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 20px 14px 17px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.012);
  text-decoration: none;
  transition: border-color 0.25s, background 0.25s, transform 0.25s;
}

.rel-card:hover {
  border-color: rgba(95, 179, 161, 0.42);
  background: rgba(95, 179, 161, 0.045);
  transform: translateY(-2px);
}

.rel-card--self {
  border-style: dashed;
  opacity: 0.72;
}

.rel-card__kind {
  font-size: 11px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--jade);
  opacity: 0.85;
}

.rel-card__symbol {
  margin-top: 4px;
  font-size: 30px;
  line-height: 1.1;
  color: var(--ink-soft);
}

.rel-card__name {
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 0.12em;
  text-indent: 0.12em;
  color: var(--ink);
}

.rel-card__full {
  font-size: 12px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.rel-card__meta {
  font-size: 11.5px;
  letter-spacing: 0.05em;
  color: rgba(140, 150, 162, 0.6);
}

.rel-card__note {
  margin-top: 7px;
  font-size: 11.5px;
  line-height: 1.6;
  text-align: center;
  color: rgba(140, 150, 162, 0.55);
}

.rel-card__self {
  margin-top: 6px;
  font-size: 10.5px;
  letter-spacing: 0.1em;
  color: var(--jade);
  opacity: 0.8;
}

.rel-foot {
  margin-top: 16px;
  font-size: 12.5px;
  line-height: 1.9;
  color: rgba(140, 150, 162, 0.62);
}

.rel-foot a {
  color: var(--jade);
  text-decoration: none;
  border-bottom: 1px solid rgba(95, 179, 161, 0.35);
}

/* ---------- 12. 缺数据 / 404 ---------- */
.notice,
.empty-state {
  max-width: 640px;
  margin: 70px auto;
  padding: 34px 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--card);
  text-align: center;
}

.notice h2,
.empty-state h1 {
  font-size: 21px;
  letter-spacing: 0.14em;
  color: var(--silver-light);
  margin-bottom: 14px;
}

.notice p,
.empty-state p {
  font-size: 13.5px;
  line-height: 2;
  color: var(--muted);
}

.notice__hint {
  margin-top: 12px;
  color: rgba(140, 150, 162, 0.7);
}

.empty-state .btn {
  margin-top: 22px;
}

/* ---------- 13. 页脚 ---------- */
.site-footer {
  border-top: 1px solid rgba(196, 208, 220, 0.075);
  background: rgba(5, 6, 10, 0.6);
}

.site-footer__inner {
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 26px 24px 30px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.site-footer__note {
  font-size: 12.5px;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.site-footer__meta {
  font-family: var(--font-serif);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: rgba(196, 208, 220, 0.28);
}

.noscript {
  position: relative;
  z-index: 3;
  padding: 16px;
  text-align: center;
  color: var(--silver-light);
  background: #0b111a;
}

/* ---------- 14. 响应式 ---------- */
@media (max-width: 1100px) {
  .gua-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 16px;
  }

  .gua-card {
    column-gap: 16px;
    padding: 20px 20px 16px;
  }

  .gua-card__symbol {
    font-size: 46px;
  }

  .gua-card__name {
    font-size: 21px;
    letter-spacing: 0.14em;
  }

  .gua-card__full {
    font-size: 13px;
    letter-spacing: 0.06em;
  }

  .gua-card__meta {
    margin-top: 15px;
    padding-top: 11px;
    font-size: 11px;
    letter-spacing: 0.15em;
  }
}

@media (max-width: 1024px) {
  .detail-layout {
    grid-template-columns: 280px minmax(0, 1fr);
    gap: 30px;
  }

  .divine-board {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .gua-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .detail-layout {
    grid-template-columns: 1fr;
    gap: 26px;
  }

  .detail-aside {
    position: static;
  }

  .aside-card {
    display: grid;
    grid-template-columns: 190px minmax(0, 1fr);
    gap: 0 26px;
    align-items: center;
  }

  .hex-figure {
    margin-bottom: 0;
    border-bottom: 0;
  }

  .aside-title h1 {
    font-size: 32px;
  }

  .tri-list {
    margin-top: 14px;
    padding-top: 12px;
  }
}

@media (max-width: 640px) {
  :root {
    --header-h: 58px;
  }

  .app {
    padding: 0 16px 56px;
  }

  .site-header__inner {
    padding: 0 16px;
  }

  .brand__text {
    font-size: 16px;
    letter-spacing: 0.1em;
  }

  .site-nav__link {
    padding: 7px 10px;
    font-size: 13px;
    letter-spacing: 0.06em;
  }

  .hero {
    padding: 56px 0 44px;
  }

  .hero__desc {
    font-size: 13.5px;
    padding: 0 4px;
  }

  .hero__actions {
    flex-direction: column;
    align-items: stretch;
    padding: 0 18px;
  }

  .hero__links {
    margin-top: 34px;
    flex-direction: column;
    gap: 10px;
    padding: 0 18px;
  }

  .hero__link {
    flex: none;
    padding: 13px 15px 14px;
  }

  .btn {
    width: 100%;
  }

  .section-head {
    flex-direction: column;
    align-items: flex-start;
    gap: 14px;
  }

  .search-box__field {
    max-width: none;
  }

  .search-item__no {
    display: none;
  }

  .search-hit {
    display: block;
  }

  .search-hit__label {
    display: block;
    margin-bottom: 2px;
  }

  .rel-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }

  .rel-card {
    flex-direction: row;
    align-items: center;
    justify-content: flex-start;
    gap: 12px;
    padding: 14px 15px;
  }

  .rel-card__kind {
    order: 9;
    margin-left: auto;
    font-size: 10px;
    letter-spacing: 0.2em;
  }

  .rel-card__symbol {
    margin-top: 0;
    font-size: 24px;
  }

  .rel-card__note {
    display: none;
  }

  .gua-grid {
    grid-template-columns: 1fr;
    gap: 12px;
  }

  .gua-card {
    padding: 18px 18px 15px;
  }

  .gua-card__symbol {
    font-size: 42px;
  }

  .gua-card__name {
    font-size: 20px;
  }

  .detail-page {
    padding-top: 20px;
  }

  .aside-card {
    display: block;
    padding: 22px 20px;
  }

  .hex-figure {
    margin-bottom: 18px;
    border-bottom: 1px solid rgba(196, 208, 220, 0.065);
  }

  .text-block__head,
  .text-block__body {
    padding-left: 18px;
    padding-right: 18px;
  }

  .classic {
    font-size: 16.5px;
  }

  .line-head {
    gap: 10px;
    padding: 14px 14px;
  }

  .line-pos {
    min-width: 38px;
    font-size: 14px;
  }

  .line-body {
    padding: 4px 14px 18px 58px;
  }

  .gua-pager {
    grid-template-columns: 1fr;
  }

  .pager-card--next {
    text-align: left;
  }

  .divine-page {
    padding-top: 34px;
  }

  .divine-panel {
    padding: 24px 16px 22px;
    border-radius: 16px;
  }

  .divine-actions .btn {
    width: 100%;
  }

  .result-grid {
    grid-template-columns: 1fr;
  }

  .throw-status {
    flex-direction: column;
    align-items: center;
    gap: 2px;
  }
}

/* ---------- 15. 动效降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  *,
  *::before,
  *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0s !important;
    transition-duration: 0.001ms !important;
    scroll-behavior: auto !important;
  }

  #starfield {
    display: none;
  }
}

/* ---------- 六爻工具条（Leader 增补：展开全部/收起全部） ---------- */
.lines-head__tools {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.lines-head__tools .btn {
  white-space: nowrap;
}

@media (max-width: 640px) {
  .lines-head {
    flex-wrap: wrap;
    gap: 8px;
  }

  .lines-head__tools {
    width: 100%;
    justify-content: space-between;
  }

  .lines-head__tools .lines-hint {
    font-size: 12px;
  }
}

/* =========================================================
   开场片头（Intro）· 约 3 秒，与主页面交叉淡化衔接
   ========================================================= */
.intro {
  position: fixed;
  inset: 0;
  z-index: 9000;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at 50% 48%, #0b1018 0%, #05060a 62%);
  transition: opacity 0.9s cubic-bezier(0.4, 0, 0.2, 1);
  will-change: opacity;
}

.intro.is-out {
  opacity: 0;
  pointer-events: none;
}

.intro.is-hidden {
  display: none;
}

.intro__stage {
  display: flex;
  flex-direction: column;
  align-items: center;
  transition: transform 0.9s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.7s ease;
}

.intro.is-out .intro__stage {
  transform: translateY(-18px) scale(1.015);
  opacity: 0;
}

/* 一画：从中心向两侧展开 */
.intro__line {
  display: block;
  width: min(280px, 64vw);
  height: 3px;
  border-radius: 1px;
  background: linear-gradient(90deg, rgba(120, 132, 143, 0.15), #dce4ec 50%, rgba(120, 132, 143, 0.15));
  box-shadow: 0 0 26px rgba(196, 208, 220, 0.35);
  transform: scaleX(0);
  animation: introLine 0.9s cubic-bezier(0.22, 0.8, 0.28, 1) 0.1s forwards;
}

@keyframes introLine {
  to { transform: scaleX(1); }
}

.intro__title {
  margin-top: 30px;
  font-family: var(--font-serif);
  font-size: clamp(26px, 4.4vw, 42px);
  letter-spacing: 0.62em;
  text-indent: 0.62em;
  color: #e6eaef;
  opacity: 0;
  text-shadow: 0 0 36px rgba(196, 208, 220, 0.22);
  animation: introTitle 1.15s cubic-bezier(0.22, 0.8, 0.28, 1) 0.72s forwards;
}

@keyframes introTitle {
  from { opacity: 0; letter-spacing: 0.62em; transform: translateY(10px); }
  to { opacity: 1; letter-spacing: 0.26em; transform: translateY(0); }
}

.intro__dot {
  color: var(--silver-dim);
  margin: 0 0.08em;
}

.intro__sub {
  margin-top: 16px;
  font-size: 12px;
  letter-spacing: 0.5em;
  text-indent: 0.5em;
  color: var(--muted);
  opacity: 0;
  animation: introSub 0.9s ease 1.45s forwards;
}

@keyframes introSub {
  to { opacity: 1; }
}

/* ---------- 主页面：从模糊微缩平滑浮现，与片头交叉 ----------
   默认可见（渐进增强）：只有 body.intro-running 存在时才隐藏，
   脚本异常时不会出现空白页。 */
.app,
.site-header,
.site-footer {
  transition:
    opacity 1s cubic-bezier(0.22, 0.8, 0.28, 1),
    transform 1.05s cubic-bezier(0.22, 0.8, 0.28, 1),
    filter 0.85s cubic-bezier(0.22, 0.8, 0.28, 1);
}

body.intro-running .app,
body.intro-running .site-header,
body.intro-running .site-footer {
  opacity: 0;
  transform: translateY(12px) scale(0.994);
  filter: blur(5px);
}

/* 过渡完成后释放合成层，避免长期占用 */
body.intro-settled .app,
body.intro-settled .site-header,
body.intro-settled .site-footer {
  transition: none;
}

body.intro-running {
  overflow: hidden;
}

/* 减少动态效果：不播片头，直接显示 */
@media (prefers-reduced-motion: reduce) {
  .intro {
    display: none;
  }

  .app,
  .site-header,
  .site-footer {
    opacity: 1;
    transform: none;
    filter: none;
    transition: none;
  }
}

/* 爻线基元：三爻卦、六爻卦、八卦盘、叙事页共用 */
.yao {
  display: block;
  height: 4px;
  border-radius: 1px;
  background: linear-gradient(90deg, #75808c, #dce4ec 50%, #75808c);
}

.yao--yin {
  background: none;
  display: flex;
  gap: 8px;
}

.yao--yin::before,
.yao--yin::after {
  content: '';
  flex: 1;
  height: 4px;
  border-radius: 1px;
  background: linear-gradient(90deg, #75808c, #dce4ec 50%, #75808c);
}

/* =========================================================
   易经源流 · 滚动叙事
   ========================================================= */
.story-page {
  position: relative;
}

.story-progress {
  position: fixed;
  top: 0;
  left: 0;
  height: 2px;
  width: 0;
  z-index: 300;
  background: linear-gradient(90deg, var(--silver-dim), var(--silver-light));
  box-shadow: 0 0 12px rgba(196, 208, 220, 0.35);
  transition: width 0.1s linear;
  pointer-events: none;
}

.story-rail {
  position: fixed;
  left: 32px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 260;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.story-rail::before {
  content: '';
  position: absolute;
  left: 50%;
  top: 6px;
  bottom: 6px;
  width: 1px;
  margin-left: -0.5px;
  background: var(--line);
}

.story-rail__dot {
  position: relative;
  width: 9px;
  height: 9px;
  padding: 0;
  border: 1px solid var(--line-strong);
  border-radius: 50%;
  background: #05060a;
  cursor: pointer;
  transition: background 0.35s ease, border-color 0.35s ease, box-shadow 0.35s ease, transform 0.35s ease;
}

.story-rail__dot:hover {
  border-color: var(--silver);
}

.story-rail__dot.is-current {
  background: var(--silver-light);
  border-color: var(--silver-light);
  box-shadow: 0 0 12px rgba(196, 208, 220, 0.55);
  transform: scale(1.25);
}

.scene {
  position: relative;
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 96px 24px;
}

.scene::after {
  content: '';
  position: absolute;
  left: 50%;
  bottom: 0;
  width: 1px;
  height: 72px;
  margin-left: -0.5px;
  background: linear-gradient(to bottom, var(--line), transparent);
}

.scene:last-of-type::after {
  display: none;
}

/* .scene__inner 布局见文件末尾「源流页：图文两栏」 */

.scene--center .scene__inner {
  text-align: center;
}

.scene__kicker,
.scene__title,
.scene__prose,
.scene__visual,
.scene__caption {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.9s cubic-bezier(0.22, 0.8, 0.28, 1),
              transform 0.9s cubic-bezier(0.22, 0.8, 0.28, 1);
  transition-delay: var(--d, 0s);
}

.scene.is-in .scene__kicker,
.scene.is-in .scene__title,
.scene.is-in .scene__prose,
.scene.is-in .scene__visual,
.scene.is-in .scene__caption {
  opacity: 1;
  transform: translateY(0);
}

.scene__kicker {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 12px;
  letter-spacing: 0.34em;
  text-indent: 0.34em;
  color: var(--silver-dim);
  margin-bottom: 22px;
}

.scene__kicker::before {
  content: '';
  width: 26px;
  height: 1px;
  background: var(--line-strong);
}

.scene--center .scene__kicker::after {
  content: '';
  width: 26px;
  height: 1px;
  background: var(--line-strong);
}

.scene__title {
  font-family: var(--font-serif);
  font-size: clamp(26px, 4.4vw, 42px);
  font-weight: 400;
  letter-spacing: 0.22em;
  text-indent: 0.22em;
  color: var(--ink);
  margin-bottom: 26px;
  line-height: 1.5;
}

.scene__prose {
  font-size: 16px;
  line-height: 2.15;
  color: var(--ink-soft);
  letter-spacing: 0.03em;
}

.scene__prose p + p {
  margin-top: 18px;
}

.scene__prose em {
  font-style: normal;
  color: var(--silver);
}

.scene__visual {
  margin: 46px auto 0;
  display: flex;
  justify-content: center;
}

.scene__caption {
  margin-top: 26px;
  font-size: 12px;
  letter-spacing: 0.2em;
  color: var(--muted);
  text-align: center;
}

/* 序：脉动光点 */
.scene-pulse {
  position: relative;
  width: 120px;
  height: 120px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.scene-pulse::before,
.scene-pulse::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--line-strong);
  animation: pulseRing 4.2s ease-out infinite;
}

.scene-pulse::after {
  animation-delay: 2.1s;
}

.scene-pulse i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--silver-light);
  box-shadow: 0 0 26px rgba(196, 208, 220, 0.7);
}

@keyframes pulseRing {
  0% { transform: scale(0.35); opacity: 0; }
  30% { opacity: 0.7; }
  100% { transform: scale(1.6); opacity: 0; }
}

/* 一画开天：单爻 */
.scene-line {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.scene-line .yao {
  width: 220px;
  height: 5px;
}

.scene-line__label {
  font-size: 13px;
  letter-spacing: 0.3em;
  color: var(--muted);
}

/* 两仪 */
.scene-pair {
  display: flex;
  gap: 64px;
  flex-wrap: wrap;
  justify-content: center;
}

.scene-pair__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 16px;
}

.scene-pair__item .yao {
  width: 132px;
}

.scene-pair__name {
  font-family: var(--font-serif);
  font-size: 20px;
  letter-spacing: 0.2em;
  color: var(--ink);
}

.scene-pair__note {
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--muted);
}

/* 四象 */
.scene-four {
  display: flex;
  gap: 34px;
  flex-wrap: wrap;
  justify-content: center;
}

.scene-four__item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  padding: 22px 18px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(196, 208, 220, 0.02);
  min-width: 108px;
}

.scene-four__item .yao {
  width: 64px;
}

.scene-four__name {
  font-family: var(--font-serif);
  font-size: 16px;
  letter-spacing: 0.16em;
  color: var(--ink);
}

.scene-four__note {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.1em;
}

/* 八卦盘 */
.bagua {
  position: relative;
  width: 340px;
  height: 340px;
  flex: none;
}

.bagua__ring {
  position: absolute;
  inset: 0;
  border-radius: 50%;
  border: 1px solid var(--line);
}

.bagua__ring--inner {
  inset: 74px;
  border-color: var(--line-strong);
  border-style: dashed;
  opacity: 0.5;
}

.bagua__core {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 74px;
  height: 74px;
  margin: -37px 0 0 -37px;
  border-radius: 50%;
  background: #05060a;
  border: 1px solid var(--line-strong);
  overflow: hidden;
}

/* 太极：银白 / 深灰双色 */
.bagua__core::before {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: 50%;
  background: linear-gradient(90deg, #c3cdd8 50%, #101720 50%);
}

.bagua__core::after {
  content: '';
  position: absolute;
  left: 50%;
  top: 0;
  width: 50%;
  height: 100%;
  border-radius: 50%;
  background: radial-gradient(circle at 50% 25%, #101720 0 22%, transparent 23%),
              radial-gradient(circle at 50% 75%, #c3cdd8 0 22%, transparent 23%);
}

.bagua__item {
  position: absolute;
  left: 50%;
  top: 50%;
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 3px;
  width: 30px;
  margin: -11px 0 0 -15px;
  transition: transform 1.2s cubic-bezier(0.22, 0.8, 0.28, 1);
}

.bagua__item .yao {
  width: 24px;
  height: 3px;
}

.bagua__item .yao--yin {
  gap: 5px;
}

.bagua__item .yao--yin::before,
.bagua__item .yao--yin::after {
  height: 3px;
}

.bagua__name {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 30px;
  margin-left: -15px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 13px;
  color: var(--silver-dim);
  letter-spacing: 0;
  transition: transform 1.2s cubic-bezier(0.22, 0.8, 0.28, 1);
}

/* 六十四卦矩阵 */
.matrix64 {
  display: grid;
  grid-template-columns: repeat(8, 1fr);
  gap: 7px;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
}

.matrix64__cell {
  aspect-ratio: 1 / 1;
  display: flex;
  flex-direction: column-reverse;
  justify-content: center;
  gap: 1.5px;
  padding: 5px;
  border: 1px solid var(--line);
  border-radius: 2px;
  background: rgba(196, 208, 220, 0.015);
  opacity: 0.12;
  transform: scale(0.9);
  transition: opacity 0.5s ease, transform 0.5s ease, border-color 0.5s ease;
}

.scene.is-in .matrix64__cell {
  opacity: 1;
  transform: scale(1);
  border-color: var(--line-strong);
  transition-delay: var(--md, 0s);
}

.matrix64__cell i {
  display: block;
  height: 1.5px;
  border-radius: 1px;
  background: var(--silver-dim);
}

.matrix64__cell i.yin {
  background: linear-gradient(90deg, var(--silver-dim) 0 42%, transparent 42% 58%, var(--silver-dim) 58% 100%);
}

.matrix64__meta {
  margin-top: 22px;
  text-align: center;
  font-size: 12px;
  letter-spacing: 0.26em;
  color: var(--muted);
}

/* 叙事页 CTA */
.scene-cta {
  margin-top: 44px;
  display: flex;
  gap: 14px;
  flex-wrap: wrap;
  justify-content: center;
}

/* 史实标注 */
.story-note {
  max-width: 720px;
  margin: 0 auto;
  padding: 18px 0 18px 18px;
  border-left: 2px solid var(--line-strong);
  font-size: 12px;
  line-height: 1.95;
  color: var(--muted);
  letter-spacing: 0.02em;
  text-align: left;
}

@media (max-width: 900px) {
  .story-rail {
    display: none;
  }

  .bagua {
    width: 280px;
    height: 280px;
  }

  .bagua__ring--inner {
    inset: 62px;
  }
}

@media (max-width: 640px) {
  .site-nav {
    overflow-x: auto;
    flex-wrap: nowrap;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
  }

  .site-nav::-webkit-scrollbar {
    display: none;
  }

  .site-nav__link {
    white-space: nowrap;
  }

  .scene {
    padding: 80px 18px;
  }

  .scene__title {
    letter-spacing: 0.16em;
    text-indent: 0.16em;
  }

  .scene__prose {
    font-size: 15px;
    line-height: 2;
  }

  .scene-pair {
    gap: 34px;
  }

  .bagua {
    width: 240px;
    height: 240px;
  }

  .bagua__ring--inner {
    inset: 54px;
  }

  .intro__trigrams {
    width: 260px;
    height: 260px;
    margin: -130px 0 0 -130px;
  }

  .matrix64 {
    gap: 4px;
    max-width: 100%;
  }

  .matrix64__cell {
    padding: 3px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .intro__line--yang,
  .intro__line--yin i,
  .intro__title,
  .intro__sub,
  .intro__trigrams,
  .scene-pulse::before,
  .scene-pulse::after {
    animation: none !important;
  }

  .intro__line--yang {
    transform: scaleX(1);
    opacity: 1;
  }

  .intro__line--yin i {
    transform: scaleX(1);
    opacity: 1;
  }

  .intro__title,
  .intro__sub,
  .intro__trigrams {
    opacity: 1;
  }

  .scene__kicker,
  .scene__title,
  .scene__prose,
  .scene__visual,
  .scene__caption {
    opacity: 1;
    transform: none;
    transition: none;
  }

  .matrix64__cell {
    opacity: 1;
    transform: none;
  }

  .bagua__item,
  .bagua__name {
    transition: none;
  }
}

/* ---------- 八卦盘 / 爻线容器：补充与覆盖 ---------- */
.tri,
.bagua__lines {
  display: flex;
  flex-direction: column-reverse;
  align-items: center;
  gap: 3px;
}

.bagua__item {
  flex-direction: column;
  gap: 7px;
  width: auto;
  margin: 0;
  transform: translate(-50%, -50%) rotate(var(--a, 0deg)) translateY(-132px) rotate(calc(-1 * var(--a, 0deg)));
}

.bagua__name {
  position: static;
  width: auto;
  margin: 0;
  font-size: 12px;
  letter-spacing: 0.05em;
  color: var(--silver-dim);
}

.bagua__lines .yao {
  width: 24px;
  height: 3px;
}

.bagua__lines .yao--yin {
  gap: 5px;
}

.bagua__lines .yao--yin::before,
.bagua__lines .yao--yin::after {
  height: 3px;
}

.intro__trigram {
  margin: -5px 0 0 -9px;
}

.scene-four__item .tri {
  gap: 4px;
}

.scene-four__item .yao {
  width: 64px;
}

.scene-pair__item .tri .yao {
  width: 132px;
}

@media (max-width: 900px) {
  .bagua__item {
    transform: translate(-50%, -50%) rotate(var(--a, 0deg)) translateY(-108px) rotate(calc(-1 * var(--a, 0deg)));
  }
}

@media (max-width: 640px) {
  .bagua__item {
    transform: translate(-50%, -50%) rotate(var(--a, 0deg)) translateY(-92px) rotate(calc(-1 * var(--a, 0deg)));
  }

  .bagua__name {
    font-size: 11px;
  }
}

/* ---------- 源流页 · 新增视觉组件 ---------- */
.scene__source {
  margin-top: 20px;
  font-size: 12px;
  letter-spacing: 0.1em;
  color: var(--muted);
  opacity: 0.75;
}

.scene__source::before {
  content: '出处　';
  color: var(--silver-dim);
  opacity: 0.7;
}

/* 星图 */
.scene-stars {
  width: min(340px, 78vw);
}

.scene-stars svg {
  width: 100%;
  height: auto;
  overflow: visible;
}

.scene-stars__dot {
  fill: #d8e0e8;
  opacity: 0;
}

.scene.is-in .scene-stars__dot {
  animation: actFade 0.5s ease forwards;
}

.scene.is-in .scene-stars__dot:nth-of-type(1) { animation-delay: 0.15s; }
.scene.is-in .scene-stars__dot:nth-of-type(2) { animation-delay: 0.28s; }
.scene.is-in .scene-stars__dot:nth-of-type(3) { animation-delay: 0.41s; }
.scene.is-in .scene-stars__dot:nth-of-type(4) { animation-delay: 0.54s; }
.scene.is-in .scene-stars__dot:nth-of-type(5) { animation-delay: 0.67s; }
.scene.is-in .scene-stars__dot:nth-of-type(6) { animation-delay: 0.8s; }
.scene.is-in .scene-stars__dot:nth-of-type(7) { animation-delay: 0.93s; }

.scene-stars__line {
  fill: none;
  stroke: rgba(178, 190, 203, 0.45);
  stroke-width: 1;
  stroke-dasharray: 440;
  stroke-dashoffset: 440;
}

.scene.is-in .scene-stars__line {
  animation: lineDraw 1.8s ease 0.6s forwards;
}

.scene-stars__line--2 {
  stroke-dasharray: 110;
  stroke-dashoffset: 110;
}

.scene.is-in .scene-stars__line--2 {
  animation: lineDraw 1s ease 1.6s forwards;
}

/* 卡片组：三易 / 汉易四家 */
.scene-cards {
  display: flex;
  gap: 20px;
  flex-wrap: wrap;
  justify-content: center;
}

.scene-cards--wide {
  gap: 16px;
}

.scene-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 24px 22px;
  min-width: 116px;
  border: 1px solid var(--line);
  border-radius: 3px;
  background: rgba(196, 208, 220, 0.02);
  opacity: 0;
  transform: translateY(14px);
  transition: opacity 0.7s ease, transform 0.7s cubic-bezier(0.22, 0.8, 0.28, 1), border-color 0.4s ease;
}

.scene.is-in .scene-card {
  opacity: 1;
  transform: translateY(0);
}

.scene-card:nth-child(1) { transition-delay: 0.1s; }
.scene-card:nth-child(2) { transition-delay: 0.22s; }
.scene-card:nth-child(3) { transition-delay: 0.34s; }
.scene-card:nth-child(4) { transition-delay: 0.46s; }

.scene-card:hover {
  border-color: var(--line-strong);
}

.scene-card .tri {
  gap: 4px;
  margin-bottom: 2px;
}

.scene-card .yao {
  width: 48px;
  height: 3px;
}

.scene-card .yao--yin {
  gap: 6px;
}

.scene-card .yao--yin::before,
.scene-card .yao--yin::after {
  height: 3px;
}

.scene-card__name {
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 0.18em;
  text-indent: 0.18em;
  color: var(--ink);
}

.scene-card__note {
  font-size: 11px;
  letter-spacing: 0.06em;
  color: var(--muted);
  text-align: center;
  line-height: 1.7;
  max-width: 150px;
}

/* 384 爻点阵 */
.scene-dots {
  display: grid;
  grid-template-columns: repeat(24, 1fr);
  gap: 4px;
  width: min(440px, 82vw);
}

.scene-dots i {
  aspect-ratio: 1 / 1;
  border-radius: 50%;
  background: var(--silver-dim);
  opacity: 0;
}

.scene.is-in .scene-dots i {
  animation: dotIn 0.4s ease forwards;
  animation-delay: var(--d, 0s);
}

@keyframes dotIn {
  to { opacity: 0.55; }
}

/* 十翼 */
.scene-wings {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 10px;
  width: min(440px, 84vw);
}

.scene-wing {
  padding: 14px 6px;
  text-align: center;
  font-family: var(--font-serif);
  font-size: 13px;
  letter-spacing: 0.08em;
  color: var(--ink-soft);
  border: 1px solid var(--line);
  border-radius: 2px;
  opacity: 0;
  transform: translateY(10px);
}

.scene.is-in .scene-wing {
  animation: wingIn 0.55s cubic-bezier(0.22, 0.8, 0.28, 1) forwards;
  animation-delay: var(--d, 0s);
}

@keyframes wingIn {
  to { opacity: 1; transform: translateY(0); }
}

/* 引文卡 */
.scene-quote {
  padding: 34px 44px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  text-align: center;
  background: rgba(196, 208, 220, 0.02);
}

.scene-quote p {
  font-family: var(--font-serif);
  font-size: clamp(22px, 3.2vw, 30px);
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--ink);
}

.scene-quote span {
  display: block;
  margin-top: 16px;
  font-size: 12px;
  letter-spacing: 0.14em;
  color: var(--muted);
}

/* 简牍条 */
.scene-slips {
  display: flex;
  gap: 12px;
  justify-content: center;
  flex-wrap: wrap;
}

.scene-slip {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 150px;
  border: 1px solid var(--line-strong);
  border-radius: 2px;
  background: linear-gradient(180deg, rgba(196, 208, 220, 0.05), rgba(196, 208, 220, 0.01));
  opacity: 0;
  transform: translateY(-12px);
}

.scene.is-in .scene-slip {
  animation: slipIn 0.7s cubic-bezier(0.22, 0.8, 0.28, 1) forwards;
  animation-delay: var(--d, 0s);
}

.scene-slip i {
  writing-mode: vertical-rl;
  font-family: var(--font-serif);
  font-style: normal;
  font-size: 12px;
  letter-spacing: 0.24em;
  color: var(--ink-soft);
}

@keyframes slipIn {
  to { opacity: 1; transform: translateY(0); }
}

@media (max-width: 640px) {
  .scene-cards {
    gap: 12px;
  }

  .scene-card {
    padding: 18px 14px;
    min-width: 96px;
  }

  .scene-dots {
    grid-template-columns: repeat(16, 1fr);
    gap: 3px;
  }

  .scene-wings {
    grid-template-columns: repeat(3, 1fr);
    gap: 8px;
  }

  .scene-wing {
    padding: 11px 4px;
    font-size: 12px;
  }

  .scene-quote {
    padding: 26px 22px;
  }

  .scene-slip {
    width: 28px;
    height: 120px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .scene-stars__dot,
  .scene-stars__line,
  .scene-card,
  .scene-dots i,
  .scene-wing,
  .scene-slip {
    animation: none !important;
    opacity: 1 !important;
    transform: none !important;
    stroke-dashoffset: 0 !important;
  }
}

/* ---------- 源流页：图文两栏 + 白描人物 ---------- */
.scene__inner {
  width: 100%;
  max-width: 1080px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 292px;
  gap: 64px;
  align-items: center;
}

.scene__text {
  min-width: 0;
}

.scene__side {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 30px;
}

.figure {
  margin: 0;
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.figure__frame {
  position: relative;
  width: 100%;
  max-width: 252px;
  color: rgba(179, 192, 205, 0.7);
}

.figure__frame::before {
  content: '';
  position: absolute;
  inset: -12% -10%;
  background: radial-gradient(circle at 50% 40%, rgba(179, 192, 205, 0.075), transparent 70%);
  pointer-events: none;
}

.figure__frame svg {
  display: block;
  width: 100%;
  height: auto;
  overflow: visible;
  position: relative;
}

/* 木刻版画：进入视口后如拓印般自左向右刷出
   注意：默认必须是「可见」状态。上一版把默认设成 opacity:0 + 整块裁掉，
   一旦 IntersectionObserver 没触发（首屏没滚到、脚本报错、快速滚动），
   人物就永远不出现，整块区域是空的——这是上一版「看不见人」的直接原因。 */
.figure__frame .fig {
  opacity: 1;
  clip-path: none;
}

.scene.is-in .figure__frame .fig {
  animation: woodcutIn 1.15s cubic-bezier(0.45, 0.05, 0.25, 1) both;
}

@keyframes woodcutIn {
  from {
    clip-path: inset(0 100% 0 0);
    opacity: 0.35;
  }
  to {
    clip-path: inset(0 0 0 0);
    opacity: 1;
  }
}

/* 墨面与刻痕：让块面有版画的硬边质感，不做柔化
   关键：每个块面都描一道暗边，块面之间才有分隔，
   否则同色叠加会糊成一团，看不出头、身、袖、道具的界限。 */
.figure__frame .fig-mass > * {
  fill: #b8c4d0;
  fill-opacity: 0.82;
  stroke: #0a0d14;
  stroke-width: 2;
  stroke-linejoin: round;
}

.figure__frame .fig-cut {
  stroke: #0a0d14;
  stroke-opacity: 0.85;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
  fill: none;
}

.figure__cap {
  margin-top: 18px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  text-align: center;
}

.figure__name {
  font-family: var(--font-serif);
  font-size: 17px;
  letter-spacing: 0.3em;
  text-indent: 0.3em;
  color: var(--ink);
}

.figure__meta {
  font-size: 11px;
  line-height: 1.7;
  letter-spacing: 0.14em;
  color: var(--muted);
  max-width: 240px;
}

/* 首幕居中：单栏，人物居中置于文字之下 */
.scene--center .scene__inner {
  grid-template-columns: 1fr;
  max-width: 720px;
  justify-items: center;
  text-align: center;
}

.scene--center .figure__frame {
  max-width: 176px;
}

.scene--center .figure {
  margin-top: 6px;
}

/* 侧栏内既有 visual 时略收窄，避免过高 */
.scene__side .scene__visual {
  width: 100%;
}

.scene__side .bagua {
  margin: 0 auto;
}

@media (max-width: 960px) {
  .scene__inner {
    grid-template-columns: 1fr;
    gap: 34px;
    max-width: 720px;
  }

  .scene__side {
    order: -1;
    gap: 22px;
  }

  .figure__frame {
    max-width: 178px;
  }

  .figure__cap {
    margin-top: 14px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .figure__frame .fig {
    opacity: 1;
    clip-path: none;
    transition: none !important;
  }
}

/* ---------- 吸顶导航（Leader 增补） ---------- */
/* 说明：body 上的 overflow-x: hidden 会让 body 变成滚动容器，
   使 position: sticky 相对 body 而非视口定位，表现为「不吸顶」。
   改用 clip（不创建滚动容器），sticky 才能正常吸附视口。 */
@supports (overflow: clip) {
  body {
    overflow-x: clip;
  }
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  transition:
    opacity 1s cubic-bezier(0.22, 0.8, 0.28, 1),
    transform 1.05s cubic-bezier(0.22, 0.8, 0.28, 1),
    filter 0.85s cubic-bezier(0.22, 0.8, 0.28, 1),
    background 0.35s ease,
    box-shadow 0.4s ease,
    border-color 0.35s ease;
}

/* 已吸附：底色压深、下沿收紧，滚动时导航始终清晰可读 */
.site-header.is-stuck {
  background: rgba(6, 8, 13, 0.92);
  border-bottom-color: rgba(196, 208, 220, 0.15);
  box-shadow:
    0 16px 38px -26px rgba(0, 0, 0, 0.95),
    0 1px 0 rgba(196, 208, 220, 0.045) inset;
}

/* 导航项点击热区略放大，便于鼠标快速切换 */
.site-nav__link {
  padding: 9px 16px;
  -webkit-tap-highlight-color: transparent;
}

.site-nav__link:focus-visible {
  outline: 1px solid rgba(196, 208, 220, 0.5);
  outline-offset: 2px;
}

/* 窄屏：收紧间距，三项仍能一行排开 */
@media (max-width: 860px) {
  .site-header__inner {
    padding: 0 16px;
    gap: 10px;
  }

  .site-nav {
    gap: 2px;
  }

  .site-nav__link {
    padding: 8px 10px;
    font-size: 13px;
    letter-spacing: 0.06em;
  }
}

@media (max-width: 420px) {
  .brand__text {
    display: none;
  }
}

/* 源流页章节导航：16 节，矮屏收紧避免溢出 */
@media (max-height: 760px) {
  .story-rail {
    gap: 9px;
  }

  .story-rail__dot {
    width: 7px;
    height: 7px;
  }
}
