/* 法律讲义：当代案牍（T2）+ Lucide 离线图标 · 视觉 P2 2026-07-24 */

/* F2：本地子集（SimSun 标题 / YaHei 正文），离线可用 */
@font-face {
  font-family: "Law Display";
  src: url("fonts/LawDisplay.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Law Sans";
  src: url("fonts/LawSans.woff2") format("woff2");
  font-weight: 400 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* 暖墨 / 宣纸 — 去掉冷藏青 */
  --ink: #2a241c;
  --muted: #6b6358;
  --paper: #faf6ee;
  --canvas: #efe8dc;
  --line: #ddd2c2;
  --navy: #2c261e;          /* 结构深色：暖墨褐，不再用海军蓝 */
  --ink-deep: #1c1814;      /* 侧栏底：近黑暖墨 */
  --shell: #241f19;         /* 侧栏主色 */
  --shell-text: #f3ebe0;
  --shell-muted: rgba(243, 235, 224, .62);
  --blue: #3d6b62;
  --blue-soft: #eaf3f0;
  --teal: #3a6b5c;
  --teal-soft: #eaf4ef;
  --gold: #a07a28;
  --gold-soft: #f5ecd4;
  --accent: #9a7420;
  --accent-soft: #f5ecd4;
  --seal: #a33b2b;
  --red: #a94442;
  --red-soft: #fff0ee;
  --purple: #6b4f7a;
  --purple-soft: #f4eff9;
  --page-accent: var(--accent);
  --shadow: 0 1px 0 rgba(42, 36, 28, .06), 0 12px 28px rgba(42, 36, 28, .07);
  --radius: 8px;
  --sidebar-w: 268px;
  --text-base: 15px;
  --text-lead: 1.75;
  --sans: "Law Sans", "Microsoft YaHei", "PingFang SC", "Noto Sans SC", sans-serif;
  --display: "Law Display", "SimSun", "Songti SC", "Noto Serif SC", serif;
  --latin: Georgia, "Times New Roman", serif;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
html.booting-layout { scroll-behavior: auto !important; }
/* The source pages are progressive-enhancement fallbacks. Hold that
   unenhanced shell off-screen until app.js has finished the structural pass;
   this removes the old-layout flash when switching subjects. */
html.js:not(.app-ready) body > .site-shell,
html.js:not(.app-ready) body > .back-top {
  visibility: hidden;
}
html.js:not(.app-ready) body { background: #211b16; }
html.js.app-ready body > .site-shell,
html.js.app-ready body > .back-top {
  visibility: visible;
}
body {
  margin: 0;
  color: var(--ink);
  background: var(--canvas);
  font-family: var(--sans);
  font-size: var(--text-base);
  line-height: var(--text-lead);
}
body.type-md {
  --text-base: 15px;
  --text-lead: 1.75;
}
body.type-lg {
  --text-base: 17px;
  --text-lead: 1.78;
}
body.type-xl {
  --text-base: 19px;
  --text-lead: 1.8;
}
body.type-lg .sidebar,
body.type-xl .sidebar {
  font-size: calc(var(--text-base) * 0.9);
}
body.type-lg .hero h1 { font-size: clamp(30px, 4.8vw, 54px); }
body.type-xl .hero h1 { font-size: clamp(32px, 5vw, 56px); }
body.type-lg .legacy-body > h2.section,
body.type-xl .legacy-body > h2.section {
  font-size: calc(1em + 2px);
}
body.type-lg .mind-map__items,
body.type-xl .mind-map__items {
  font-size: 0.95em;
}
a { color: var(--blue); }
a:focus-visible, button:focus-visible, input:focus-visible, summary:focus-visible {
  outline: 3px solid #d4a84b;
  outline-offset: 3px;
}
button, input { font: inherit; }

/* —— 科目弱 accent（C2） —— */
body.subject-xingfa { --page-accent: #7A3030; }
body.subject-minfa { --page-accent: #2F5D50; }
body.subject-xianfa { --page-accent: #8B3A2A; }
body.subject-xingzhengfa { --page-accent: #3D5A80; }
body.subject-zonghe { --page-accent: #5C4B6A; }
body.is-index { --page-accent: var(--accent); }

/* Lucide icon shell */
.icon {
  width: 1.1em;
  height: 1.1em;
  display: inline-block;
  vertical-align: -0.15em;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.75;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex: 0 0 auto;
}
.icon-lg { width: 1.35em; height: 1.35em; }
.icon-xl { width: 1.7em; height: 1.7em; }

.site-shell { min-height: 100vh; }

/* —— 侧栏：暖墨砚台，非冷藏青 —— */
.sidebar {
  position: fixed;
  inset: 0 auto 0 0;
  z-index: 20;
  width: var(--sidebar-w);
  overflow-y: auto;
  color: var(--shell-text);
  background:
    linear-gradient(165deg, rgba(196, 160, 90, .07), transparent 42%),
    linear-gradient(180deg, #2a241c 0%, var(--shell) 38%, var(--ink-deep) 100%);
  box-shadow: 8px 0 28px rgba(28, 24, 18, .18);
  border-right: 1px solid rgba(221, 210, 194, .12);
}
.sidebar::before {
  content: "";
  position: absolute;
  left: 0; top: 0; right: 0;
  height: 3px;
  background: linear-gradient(90deg, var(--page-accent), color-mix(in srgb, var(--page-accent) 40%, #c4a05a));
  z-index: 1;
}
.sidebar-header {
  padding: 25px 22px 20px;
  border-bottom: 1px solid rgba(243, 235, 224, .1);
}
.brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  color: #d4b56a;
  font-size: 11px;
  letter-spacing: .18em;
  font-weight: 700;
  font-family: var(--latin);
}
.brand-mark .icon {
  width: 24px;
  height: 24px;
  padding: 4px;
  border: 1px solid rgba(212, 181, 106, .5);
  border-radius: 50%;
}
.sidebar-title {
  margin: 14px 0 3px;
  color: #faf6ee;
  font: 700 22px/1.3 var(--display);
  letter-spacing: .06em;
}

.sr-only {
  position: absolute !important;
  width: 1px !important;
  height: 1px !important;
  padding: 0 !important;
  margin: -1px !important;
  overflow: hidden !important;
  clip: rect(0, 0, 0, 0) !important;
  white-space: nowrap !important;
  border: 0 !important;
}
.sidebar small {
  color: var(--shell-muted);
  font-size: 12px;
}
.nav-subject {
  padding: 14px 22px 8px;
  color: #d4b56a;
  font-size: 11px;
  letter-spacing: .15em;
}
.nav-list {
  list-style: none;
  padding: 0 12px 18px;
  margin: 0;
}
.nav-list a {
  display: block;
  padding: 7px 11px;
  color: rgba(243, 235, 224, .78);
  text-decoration: none;
  border-radius: 6px;
  font-size: 13px;
  line-height: 1.45;
  border-left: 2px solid transparent;
  transition: background .15s, color .15s, border-color .15s;
}
.nav-list a:hover {
  color: #faf6ee;
  background: rgba(243, 235, 224, .08);
}
.nav-list a.active {
  color: #faf6ee;
  background: rgba(196, 160, 90, .14);
  border-left-color: var(--page-accent);
}
.nav-list .nav-chapter a {
  margin-top: 4px;
  color: #faf6ee;
  font-weight: 700;
}
.nav-list .nav-section a {
  padding-left: 24px;
  color: rgba(243, 235, 224, .62);
  font-size: 12px;
}

/* 侧栏章折叠 */
.nav-group {
  margin: 2px 0 6px;
  border-radius: 8px;
}
.nav-group-head {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-radius: 6px;
}
.nav-group-head > a {
  flex: 1;
  min-width: 0;
  color: #faf6ee !important;
  font-weight: 700;
  margin-top: 2px;
}
.nav-group-toggle {
  flex: 0 0 auto;
  display: grid;
  place-items: center;
  width: 32px;
  margin: 2px 2px 2px 0;
  padding: 0;
  color: rgba(243, 235, 224, .55);
  background: transparent;
  border: 0;
  border-radius: 6px;
  cursor: pointer;
}
.nav-group-toggle:hover {
  color: #faf6ee;
  background: rgba(243, 235, 224, .08);
}
.nav-group-toggle .icon {
  width: 14px;
  height: 14px;
  transition: transform .18s ease;
}
.nav-group.is-collapsed .nav-group-toggle .icon {
  transform: rotate(-90deg);
}
.nav-group-body {
  overflow: hidden;
  max-height: 2000px;
  transition: max-height .22s ease, opacity .18s ease;
  opacity: 1;
  list-style: none;
  margin: 0;
  padding: 0 0 4px;
}
.nav-group-body .nav-section a {
  padding-left: 22px;
}
.nav-group.is-collapsed .nav-group-body {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
}
body.reduce-motion .nav-group-body,
body.reduce-motion .nav-group-toggle .icon {
  transition: none;
}

.main {
  min-height: 100vh;
  margin-left: var(--sidebar-w);
}

/* 阅读进度条 */
.reading-progress {
  position: fixed;
  top: 0;
  left: var(--sidebar-w);
  right: 0;
  z-index: 30;
  height: 3px;
  pointer-events: none;
  background: transparent;
}
.reading-progress > span {
  display: block;
  height: 100%;
  width: 0%;
  background: linear-gradient(90deg, var(--page-accent), color-mix(in srgb, var(--page-accent) 55%, #d4b56a));
  box-shadow: 0 0 8px color-mix(in srgb, var(--page-accent) 45%, transparent);
  transition: width .08s linear;
}
body.is-index .reading-progress { left: var(--sidebar-w); }
body.reduce-motion .reading-progress > span { transition: none; }
@media (max-width: 900px) {
  .reading-progress { left: 0; }
}

/* —— 顶栏：宣纸浅暖，非冷灰青 —— */
.topbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 56px;
  padding: 10px clamp(16px, 3vw, 40px);
  background: rgba(250, 246, 238, .92);
  border-bottom: 1px solid rgba(221, 210, 194, .95);
  box-shadow: 0 1px 0 rgba(42, 36, 28, .03);
  backdrop-filter: blur(14px);
}
.menu-toggle {
  display: none;
  border: 0;
  border-radius: 8px;
  width: 40px;
  height: 40px;
  place-items: center;
  color: #faf6ee;
  background: var(--shell);
  cursor: pointer;
}
.menu-toggle .icon { width: 20px; height: 20px; }
.subject-links { display: flex; gap: 6px; flex-wrap: wrap; }
.subject-links a {
  padding: 5px 10px;
  color: var(--muted);
  border-radius: 6px;
  font-size: 12px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: color .15s, background .15s, border-color .15s;
}
.subject-links a:hover {
  color: var(--ink);
  background: rgba(255,255,255,.75);
}
.subject-links a.current {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
  box-shadow: 0 1px 0 rgba(42, 36, 28, .04);
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 10px;
}
.reduce-motion-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 10px;
  color: var(--muted);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  cursor: pointer;
  white-space: nowrap;
}
.reduce-motion-btn[aria-pressed="true"] {
  color: var(--ink);
  border-color: var(--page-accent);
  background: var(--accent-soft);
}
.reduce-motion-btn .icon { width: 14px; height: 14px; }

/* 字号三档 */
.type-scale {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 6px;
}
.type-scale button {
  min-width: 28px;
  height: 28px;
  padding: 0 7px;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  line-height: 1;
}
.type-scale button:hover {
  color: var(--ink);
  background: var(--accent-soft);
}
.type-scale button[aria-pressed="true"] {
  color: var(--ink);
  background: var(--accent-soft);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--page-accent) 45%, var(--line));
}
.type-scale .type-label {
  display: none;
  padding: 0 4px 0 6px;
  color: var(--muted);
  font-size: 11px;
}

/* 题组 → 本章答案 */
.practice-answer-jump {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 4px 8px;
  color: var(--gold);
  background: #fffaf0;
  border: 1px solid #e6d6a8;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.practice-answer-jump:hover {
  background: var(--gold-soft);
  color: #7a5810;
}
.practice-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  color: var(--gold);
  font-weight: 800;
  flex-wrap: wrap;
}
.answer-index {
  scroll-margin-top: 0;
}
.answer-index.is-flash {
  outline: 2px solid var(--page-accent);
  outline-offset: 3px;
}
.search {
  position: relative;
  width: min(280px, 36vw);
}
.search .icon {
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  width: 15px;
  height: 15px;
  color: var(--muted);
  pointer-events: none;
}
.search input {
  width: 100%;
  padding: 8px 12px 8px 34px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.search input[type="search"]::-webkit-search-decoration,
.search input[type="search"]::-webkit-search-cancel-button,
.search input[type="search"]::-webkit-search-results-button,
.search input[type="search"]::-webkit-search-results-decoration { display: none; }

/* —— 版心 L-B + 纸面 —— */
.content {
  width: min(100% - 48px, 1180px);
  margin: 0 auto;
  padding: 28px 0 80px;
}
body:not(.is-index) .content {
  background: var(--paper);
  border-radius: 12px;
  box-shadow: var(--shadow);
  border: 1px solid rgba(212, 220, 226, .65);
  padding: 0 0 56px;
  margin-top: 18px;
  margin-bottom: 40px;
  overflow: hidden;
}
body:not(.is-index) .content > :not(.hero) {
  padding-left: clamp(18px, 3.2vw, 40px);
  padding-right: clamp(18px, 3.2vw, 40px);
}
body:not(.is-index) .content > .hero {
  margin: 0;
  border-radius: 0;
  border-bottom: 3px solid var(--page-accent);
}

/* 段落限行长 */
.legacy-body > p,
.prose,
.section > p,
.subsection > p,
.lead-definition {
  max-width: 48em;
}

/* —— Hero：总览展厅 / 科目短碑 —— */
.hero {
  position: relative;
  padding: clamp(28px, 5vw, 56px);
  overflow: hidden;
  color: #faf6ee;
  background:
    radial-gradient(ellipse 80% 60% at var(--mx, 72%) var(--my, 30%), rgba(196, 160, 90, .16), transparent 55%),
    linear-gradient(155deg, #1a1612 0%, #2a241c 46%, #3a3228 100%);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  isolation: isolate;
}
.hero-ink {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  z-index: 0;
  pointer-events: none;
  opacity: .55;
}
.hero-sculpture {
  position: absolute;
  right: 2%;
  bottom: -8%;
  z-index: 0;
  margin: 0;
  color: rgba(255,255,255,.07);
  font: 700 clamp(140px, 28vw, 280px)/.85 var(--display);
  letter-spacing: -.04em;
  user-select: none;
  pointer-events: none;
  transform: translate3d(0, calc(var(--parallax-y, 0) * 1px), 0);
  text-shadow: 0 0 40px rgba(0,0,0,.15);
  transition: opacity .4s;
}
body.reduce-motion .hero-sculpture {
  transform: none;
}
.seal {
  position: absolute;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  color: var(--seal);
  border: 2px solid currentColor;
  border-radius: 3px;
  font: 700 22px/1 var(--display);
  letter-spacing: .12em;
  background: rgba(163, 59, 43, .08);
  box-shadow: inset 0 0 0 1px rgba(163, 59, 43, .25);
  transform: rotate(-8deg);
  pointer-events: none;
}
.seal--hero {
  right: clamp(18px, 4vw, 48px);
  top: clamp(18px, 4vw, 40px);
}
.seal--subject {
  width: 40px;
  height: 40px;
  font-size: 17px;
  right: 18px;
  top: 16px;
  color: var(--page-accent);
  border-color: var(--page-accent);
  background: color-mix(in srgb, var(--page-accent) 12%, transparent);
  box-shadow: none;
  opacity: .85;
}
.hero > *:not(.hero-ink):not(.hero-sculpture):not(.seal):not(.hero-grid) {
  position: relative;
  z-index: 1;
}
/* 默认伪元素「法」：科目页保留弱底字；总览用 .hero-sculpture 替代 */
.hero::after {
  content: "法";
  position: absolute;
  right: 4%;
  bottom: -28px;
  z-index: 0;
  color: rgba(255,255,255,.05);
  font: 180px/1 var(--display);
  pointer-events: none;
}
body.is-index .hero::after { content: none; }
body:not(.is-index) .hero {
  min-height: 0;
  padding: clamp(26px, 4vw, 40px) clamp(22px, 3vw, 36px);
}
body:not(.is-index) .hero.hero--entered {
  animation: hero-enter .55s ease both;
}
@keyframes hero-enter {
  from { opacity: .55; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
body.reduce-motion .hero.hero--entered {
  animation: none;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: #d4b56a;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: .18em;
  font-family: var(--latin);
}
.hero h1 {
  max-width: 720px;
  margin: 14px 0 12px;
  font: 700 clamp(28px, 4.6vw, 52px)/1.22 var(--display);
  letter-spacing: .04em;
}
body.is-index .hero {
  min-height: min(72vh, 620px);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: clamp(36px, 6vw, 72px);
  border-radius: 12px;
}
body.is-index .hero h1 {
  max-width: 16em;
  font-size: clamp(32px, 5.2vw, 56px);
}
.hero p {
  max-width: 42em;
  margin: 0;
  color: rgba(250, 246, 238, .74);
  line-height: 1.7;
}
.hero-stats {
  display: flex;
  gap: 28px;
  margin-top: 26px;
  flex-wrap: wrap;
}
.hero-stat strong {
  display: block;
  color: #d4b56a;
  font: 700 24px/1.2 var(--latin);
  font-variant-numeric: tabular-nums;
}
.hero-stat span {
  color: rgba(250, 246, 238, .62);
  font-size: 12px;
}
.orbit-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 18px;
}
.orbit-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 10px;
  border-radius: 999px;
  color: rgba(250, 246, 238, .84);
  background: rgba(250, 246, 238, .08);
  border: 1px solid rgba(212, 181, 106, .22);
  font-size: 12px;
}

/* 旧 marquee：隐藏（W2） */
.marquee-rail { display: none !important; }

/* —— 章节 —— */
.chapter {
  margin-top: 48px;
  scroll-margin-top: 0;
}
.chapter-heading {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--navy);
}
.chapter-index {
  flex: 0 0 auto;
  color: var(--page-accent);
  font: 700 28px/1 var(--display);
}
body.is-index .chapter-heading .chapter-index {
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .12em;
  color: var(--muted);
  font-family: var(--latin);
  padding-top: 8px;
}
.chapter h2 {
  margin: 0;
  color: var(--navy);
  font: 700 clamp(22px, 2.8vw, 30px)/1.35 var(--display);
}
.chapter-lead {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 48em;
}
.legacy-body > h2.section {
  margin: 36px 0 16px;
  padding: 12px 16px;
  color: #faf6ee;
  background: linear-gradient(90deg, #2a241c, #3d342a);
  border-radius: 8px;
  font: 700 20px/1.5 var(--display);
  scroll-margin-top: 0;
  box-shadow: 0 4px 14px rgba(42, 36, 28, .1);
  border-left: 4px solid var(--page-accent);
}
.legacy-body > h3 {
  margin: 26px 0 10px;
  padding: 8px 0 8px 14px;
  color: var(--navy);
  font: 700 18px/1.5 var(--display);
  border-left: 4px solid var(--teal);
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, #f3ecdf, transparent);
}
.legacy-body > h4 {
  margin: 18px 0 8px;
  padding: 4px 0 4px 12px;
  color: var(--blue);
  font-size: 15px;
  font-weight: 700;
  border-left: 3px solid #9fc5cc;
}
.legacy-body > p { margin: 8px 0; }

.legacy-body .content-list,
.extension-body .content-list,
.practice-body .content-list {
  list-style: none;
  margin: 10px 0;
  padding: 0;
}
.legacy-body .content-list > li,
.extension-body .content-list > li,
.practice-body .content-list > li {
  position: relative;
  margin: 0;
  padding: 6px 4px 6px 0;
  border-bottom: none;
  line-height: 1.6;
}
.legacy-body .content-list > li.main-item {
  margin-top: 8px;
  padding-top: 10px;
  border-top: 1px solid rgba(212, 220, 226, .7);
  font-weight: 600;
  color: var(--navy);
}
.legacy-body .content-list > li.main-item:first-child {
  border-top: 0;
  margin-top: 0;
  padding-top: 6px;
}
.legacy-body .content-list > li.sub-item {
  margin-left: 1.1em;
  padding-left: 10px;
  color: #3a4f58;
  font-size: .97em;
  border-left: 2px solid rgba(212, 220, 226, .8);
}
.legacy-body .content-list > li.main-item > .item-label {
  color: var(--teal);
  margin-right: .35em;
}
.legacy-body .def-block {
  margin: 14px 0;
  padding: 12px 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 0 8px 8px 0;
}
.legacy-body .def-title {
  margin: 0 0 6px;
  color: var(--navy);
  font-weight: 800;
  font-size: 15px;
}
.legacy-body .def-body p {
  margin: 0;
  color: #3a4f58;
}
.legacy-body .def-body p + p { margin-top: 6px; }
.section { margin: 28px 0; scroll-margin-top: 0; }
.section h3 {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin: 0 0 12px;
  color: var(--navy);
  font: 700 20px/1.5 var(--display);
}
.section h3::before {
  content: "";
  width: 4px;
  height: 18px;
  flex: 0 0 auto;
  background: var(--page-accent, var(--teal));
  border-radius: 2px;
}
.subsection { margin: 20px 0; }
.subsection h4 { margin: 0 0 8px; color: var(--blue); font-size: 16px; }
.prose { margin: 8px 0; }
.prose + .prose { margin-top: 4px; }
.lead-definition {
  padding: 14px 16px;
  color: #274655;
  background: var(--blue-soft);
  border-left: 4px solid var(--blue);
  border-radius: 0 8px 8px 0;
}
ul, ol { padding-left: 1.6em; }
li + li { margin-top: 0; }
strong { color: var(--navy); }
.legacy-body .outline-block {
  margin: 12px 0 16px;
  padding: 4px 0 4px 14px;
  border-left: 2px solid #d5e4e8;
}
.legacy-body .outline-block p { margin: 6px 0; }

.callout {
  margin: 16px 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-left: 4px solid var(--teal);
  border-radius: 0 8px 8px 0;
  background: #fff;
}
.callout-title {
  display: flex;
  align-items: center;
  gap: 7px;
  margin-bottom: 5px;
  color: var(--teal);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: .06em;
}
.subject-links a.current { box-shadow: inset 0 -2px 0 var(--page-accent), 0 1px 0 rgba(42,36,28,.04); }
.callout.tip {
  border-left-color: var(--gold);
  background: var(--gold-soft);
}
.callout.tip .callout-title { color: var(--gold); }
.extension {
  margin: 16px 0;
  padding: 15px 17px;
  border: 1px dashed #79aab1;
  border-left: 4px solid var(--blue);
  border-radius: 0 8px 8px 0;
  background: var(--blue-soft);
}
.extension.sichuan {
  border-color: #d8aa61;
  border-left-color: var(--gold);
  background: #fff8e9;
}
.extension-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--blue);
  font-weight: 800;
}
.sichuan .extension-title { color: var(--gold); }
.extension-body > :first-child { margin-top: 0; }
.extension-body > :last-child { margin-bottom: 0; }
.extension-body p,
.extension-body li { color: var(--ink); }
.extension-body .content-list { margin: 8px 0; }
.extension-body .options { margin: 8px 0 0; padding-left: 1.2em; }
.extension-body .options li { margin: 4px 0; }
.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 7px;
  border-radius: 4px;
  color: #fff;
  background: var(--blue);
  font-size: 11px;
  line-height: 1.5;
}
.sichuan .badge { background: var(--gold); }
.memory {
  padding: 12px 14px;
  color: #5e3d79;
  background: var(--purple-soft);
  border-left: 4px solid var(--purple);
  border-radius: 0 8px 8px 0;
}
.memory::before {
  content: "记忆线索　";
  font-weight: 800;
}

.diagram { display: grid; gap: 10px; margin: 18px 0; }
.diagram.four { grid-template-columns: repeat(4, 1fr); }
.diagram.three { grid-template-columns: repeat(3, 1fr); }
.diagram-card {
  position: relative;
  padding: 14px;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--teal);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(23,50,77,.04);
}
.diagram-card > .icon {
  width: 20px;
  height: 20px;
  margin-bottom: 8px;
  color: var(--teal);
}
.diagram-card strong {
  display: block;
  margin-bottom: 4px;
  color: var(--teal);
}
.flow {
  display: flex;
  align-items: stretch;
  gap: 26px;
  margin: 18px 0;
}
.flow-step {
  position: relative;
  flex: 1;
  padding: 14px;
  text-align: center;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.flow-step:not(:last-child)::after {
  content: "";
  position: absolute;
  right: -20px;
  top: 50%;
  width: 12px;
  height: 12px;
  border-right: 2px solid var(--gold);
  border-top: 2px solid var(--gold);
  transform: translateY(-50%) rotate(45deg);
}
.flow-step strong {
  display: block;
  color: var(--navy);
}

/* 导图 */
.mind-map {
  --map-accent: var(--teal);
  --map-soft: var(--teal-soft);
  margin: 20px 0 24px;
  padding: 0;
  overflow: hidden;
  background: #fff;
  border: 1px solid var(--line);
  border-top: 3px solid var(--map-accent);
  border-radius: 8px;
  box-shadow: 0 6px 18px rgba(23, 50, 77, .05);
}
.mind-map--subject {
  --map-accent: var(--gold);
  --map-soft: var(--gold-soft);
  margin-top: 28px;
}
.mind-map--chapter {
  --map-accent: var(--blue);
  --map-soft: var(--blue-soft);
}
.mind-map--section {
  margin: 14px 0 20px;
  border-top-width: 3px;
  box-shadow: 0 4px 12px rgba(23, 50, 77, .04);
}
.mind-map__caption {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 9px 14px;
  color: var(--map-accent);
  background: var(--map-soft);
  border-bottom: 1px solid var(--line);
  font-size: 12px;
  font-weight: 800;
}
.mind-map__canvas {
  display: grid;
  grid-template-columns: minmax(112px, .72fr) minmax(0, 3.5fr);
  align-items: stretch;
  gap: 34px;
  padding: 18px;
}
.mind-map__root {
  position: relative;
  display: grid;
  place-items: center;
  min-height: 100%;
  padding: 14px 12px;
  color: #fff;
  background: var(--map-accent);
  border-radius: 6px;
  text-align: center;
  font-weight: 800;
  line-height: 1.5;
}
.mind-map__root::after {
  content: "";
  position: absolute;
  left: 100%;
  top: 50%;
  width: 35px;
  border-top: 2px solid #9fb8bf;
}
.mind-map__branches {
  position: relative;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 14px;
}
.mind-map__branches::before {
  content: "";
  position: absolute;
  right: calc(100% + 16px);
  top: 11%;
  bottom: 11%;
  border-left: 2px solid #9fb8bf;
}
.mind-map__branch {
  position: relative;
  min-width: 0;
  padding: 10px 12px 9px;
  background: #fbfdfd;
  border: 1px solid var(--line);
  border-left: 3px solid var(--map-accent);
  border-radius: 0 6px 6px 0;
}
.mind-map__branch::before {
  content: "";
  position: absolute;
  right: 100%;
  top: 22px;
  width: 18px;
  border-top: 2px solid #9fb8bf;
}
.mind-map__branch-title {
  display: block;
  margin-bottom: 5px;
  color: var(--map-accent);
  font-size: 14px;
}
.mind-map__items {
  margin: 0;
  padding-left: 1.25em;
  color: #3a4f58;
  font-size: 13px;
  line-height: 1.55;
}
.mind-map__items li + li { margin-top: 3px; }
.mind-map__items li::marker { color: var(--map-accent); }
.mind-map--section .mind-map__branches { grid-template-columns: repeat(auto-fit, minmax(210px, 1fr)); }
.mind-map--chapter .mind-map__branches { grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); }
.mind-map--subject .mind-map__branches { grid-template-columns: repeat(auto-fit, minmax(230px, 1fr)); }
.mind-map--subject .mind-map__canvas {
  grid-template-columns: minmax(140px, .8fr) minmax(0, 4fr);
  padding: 20px;
}
.mind-map--subject .mind-map__branch { padding: 12px 14px; }
.mind-map--chapter .mind-map__branch-title { font-size: 15px; }
.mind-map--section .mind-map__canvas {
  grid-template-columns: minmax(105px, .68fr) minmax(0, 3.7fr);
  gap: 28px;
  padding: 14px;
}
.mind-map--section .mind-map__root::after { width: 29px; }
.mind-map--section .mind-map__branches::before { right: calc(100% + 13px); }
.mind-map--section .mind-map__branch { padding: 8px 10px; }
.mind-map--section .mind-map__branch::before { width: 15px; top: 19px; }

/* 每科一张完整知识总图：无损聚合现役节级导图 */
.unified-map {
  --map-accent: var(--page-accent, var(--gold));
  margin: 30px 0 44px;
  overflow: hidden;
  background: color-mix(in srgb, var(--paper) 94%, #fff);
  border: 1px solid var(--line);
  border-top: 4px solid var(--map-accent);
  border-radius: 8px;
  box-shadow: 0 12px 32px rgba(43, 36, 28, .08);
}
.unified-map__toolbar {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 22px 24px;
  background: linear-gradient(90deg, color-mix(in srgb, var(--map-accent) 9%, transparent), transparent 58%), #fff;
  border-bottom: 1px solid var(--line);
}
.unified-map__heading { display: flex; align-items: flex-start; gap: 14px; min-width: 0; }
.unified-map__icon {
  display: grid; place-items: center; flex: 0 0 auto;
  width: 38px; height: 38px;
  color: var(--map-accent);
  background: color-mix(in srgb, var(--map-accent) 10%, #fff);
  border: 1px solid color-mix(in srgb, var(--map-accent) 25%, var(--line));
  border-radius: 6px;
}
.unified-map__eyebrow { color: var(--map-accent); font-size: 10px; font-weight: 800; letter-spacing: .16em; }
.unified-map__heading h2 {
  margin: 3px 0 4px; color: var(--ink);
  font: 700 clamp(24px, 3vw, 36px)/1.25 var(--display); letter-spacing: 0;
}
.unified-map__heading p { max-width: 48em; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.65; }
.unified-map__actions { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.unified-map__count { color: var(--muted); font-size: 12px; white-space: nowrap; }
.unified-map__toggle {
  display: inline-flex; align-items: center; gap: 6px; min-height: 34px;
  padding: 6px 10px; color: var(--map-accent); background: #fff;
  border: 1px solid color-mix(in srgb, var(--map-accent) 28%, var(--line));
  border-radius: 6px; cursor: pointer;
}
.unified-map__toggle:hover { background: color-mix(in srgb, var(--map-accent) 7%, #fff); }
.unified-map__tree { display: grid; gap: 12px; padding: 18px; }
.unified-map__chapter { overflow: clip; background: rgba(255,255,255,.72); border: 1px solid var(--line); border-radius: 7px; }
.unified-map__chapter > summary {
  display: grid; grid-template-columns: 38px minmax(0, 1fr) auto auto;
  align-items: center; gap: 12px; min-height: 52px;
  padding: 8px 14px 8px 10px; color: var(--ink);
  background: color-mix(in srgb, var(--map-accent) 6%, #fff);
  cursor: pointer; list-style: none;
  font-family: var(--display); font-size: 17px; font-weight: 700;
}
.unified-map__chapter > summary::-webkit-details-marker { display: none; }
.unified-map__chapter > summary::after { content: "+"; color: var(--map-accent); font: 400 20px/1 var(--sans); }
.unified-map__chapter[open] > summary::after { content: "−"; }
.unified-map__chapter-no {
  display: grid; place-items: center; width: 32px; height: 32px;
  color: #fff; background: var(--map-accent); border-radius: 4px;
  font: 700 12px/1 var(--sans); font-variant-numeric: tabular-nums;
}
.unified-map__chapter-count { color: var(--muted); font: 500 11px/1.4 var(--sans); white-space: nowrap; }
.unified-map__topics { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; padding: 12px; }
.unified-map__topic {
  min-width: 0; overflow: hidden; background: #fff;
  border: 1px solid var(--line); border-left: 3px solid var(--map-accent); border-radius: 0 6px 6px 0;
}
.unified-map__topic-head {
  display: grid; grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center; gap: 8px; padding: 10px 11px;
  background: color-mix(in srgb, var(--map-accent) 4%, #fff); border-bottom: 1px solid var(--line);
}
.unified-map__topic-no { color: var(--map-accent); font-size: 11px; font-weight: 800; font-variant-numeric: tabular-nums; }
.unified-map__topic h3 { margin: 0; color: var(--ink); font: 700 15px/1.45 var(--display); letter-spacing: 0; }
.unified-map__source-link { color: var(--muted); font-size: 10px; text-decoration: none; white-space: nowrap; }
.unified-map__source-link:hover { color: var(--map-accent); }
.unified-map__branches { display: grid; grid-template-columns: 1fr; gap: 8px; padding: 10px; }
.unified-map__branches::before, .unified-map__branches .mind-map__branch::before { display: none; }
.unified-map__branches .mind-map__branch {
  padding: 9px 10px; background: color-mix(in srgb, var(--canvas) 38%, #fff);
  border-left-width: 2px; border-left-color: var(--map-accent);
}
.unified-map__branches .mind-map__branch-title { color: var(--map-accent); font-size: 13px; }
.unified-map__branches .mind-map__items { font-size: 12px; line-height: 1.58; }
.unified-map__source-note {
  margin: 0; padding: 10px 18px; color: var(--muted);
  background: rgba(255,255,255,.55); border-top: 1px solid var(--line); font-size: 11px;
}
/* 原节图默认展开；点击标题可收起正文画布，避免滚动时出现空白图壳。 */
.mind-map--source-detail {
  max-height: none;
  opacity: 1;
  overflow: visible;
}
.mind-map--source-detail .mind-map__canvas {
  display: grid;
  visibility: visible;
}
.mind-map--source-detail:not(.is-open) {
  max-height: 52px;
  opacity: .86;
  overflow: hidden;
}
.mind-map--source-detail:not(.is-open) .mind-map__canvas {
  display: none;
  visibility: hidden;
}
.mind-map--source-detail.is-open {
  max-height: none;
  opacity: 1;
}
.mind-map--source-detail.is-open .mind-map__canvas {
  display: grid;
  visibility: visible;
}
.mind-map--source-detail .mind-map__caption {
  cursor: pointer;
  user-select: none;
}
.mind-map--source-detail .mind-map__caption::after {
  content: "收起";
  float: right;
  color: var(--muted);
  font: 600 11px/1.5 var(--sans);
}
.mind-map--source-detail:not(.is-open) .mind-map__caption::after { content: "展开"; }

@media (max-width: 820px) {
  .unified-map__toolbar { align-items: flex-start; flex-direction: column; }
  .unified-map__actions { width: 100%; justify-content: space-between; }
  .unified-map__topics { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .unified-map { margin: 20px -2px 32px; }
  .unified-map__toolbar { padding: 17px 15px; }
  .unified-map__icon { width: 34px; height: 34px; }
  .unified-map__heading h2 { font-size: 24px; }
  .unified-map__count { display: none; }
  .unified-map__tree { padding: 10px; }
  .unified-map__chapter > summary { grid-template-columns: 34px minmax(0, 1fr) auto; padding-right: 10px; font-size: 15px; }
  .unified-map__chapter-count { display: none; }
  .unified-map__topics { padding: 8px; }
  .unified-map__topic-head { grid-template-columns: auto minmax(0, 1fr); }
  .unified-map__source-link { grid-column: 2; }
}

.table-wrap {
  overflow-x: auto;
  margin: 16px 0;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
}
.source-table caption {
  padding: 10px 13px;
  color: var(--navy);
  background: var(--blue-soft);
  border-bottom: 1px solid var(--line);
  text-align: left;
  font-weight: 800;
}
table {
  width: 100%;
  min-width: 580px;
  border-collapse: collapse;
}
th, td {
  padding: 10px 13px;
  text-align: left;
  vertical-align: top;
  border-bottom: 1px solid var(--line);
}
th {
  color: var(--ink);
  background: #f3ecdf;
  font-weight: 700;
  border-bottom: 2px solid var(--line);
}
tr:last-child td { border-bottom: 0; }
tbody tr:nth-child(even) { background: #faf7f1; }

/* —— 章末一屏复盘卡 —— */
.chapter-review {
  margin: 30px 0 0;
  overflow: hidden;
  background: rgba(255, 253, 248, .96);
  border: 1px solid var(--line);
  border-top: 4px solid var(--page-accent);
  border-radius: 9px;
  box-shadow: 0 10px 24px rgba(42, 36, 28, .06);
  scroll-margin-top: 0;
}
.review-heading {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: flex-start;
  padding: 17px 19px 15px;
  background:
    linear-gradient(105deg, color-mix(in srgb, var(--page-accent) 8%, transparent), transparent 46%),
    #f8f2e8;
  border-bottom: 1px solid var(--line);
}
.review-kicker {
  margin-bottom: 3px;
  color: var(--page-accent);
  font: 700 10px/1.3 var(--latin);
  letter-spacing: .16em;
}
.review-heading h3 {
  margin: 0;
  color: var(--ink);
  font: 700 23px/1.35 var(--display);
}
.review-heading p {
  margin: 5px 0 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.6;
}
.review-badge {
  flex: 0 0 auto;
  padding: 4px 9px;
  color: var(--page-accent);
  background: rgba(255,255,255,.68);
  border: 1px solid color-mix(in srgb, var(--page-accent) 35%, var(--line));
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
}
.review-table { background: rgba(255,255,255,.7); }
.review-row {
  display: grid;
  grid-template-columns: 154px minmax(0, 1fr);
  border-bottom: 1px solid var(--line);
}
.review-row:last-child { border-bottom: 0; }
.review-label {
  padding: 13px 14px;
  color: var(--ink);
  background: #f4eee4;
  border-right: 1px solid var(--line);
  font-weight: 750;
  line-height: 1.55;
}
.review-value { min-width: 0; padding: 10px 15px 12px; }
.review-list {
  margin: 0;
  padding-left: 1.25em;
}
.review-list li { margin: 2px 0; line-height: 1.65; }
.review-list li::marker { color: var(--page-accent); }
.review-source {
  display: block;
  margin-top: 7px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}
.review-source a {
  color: var(--page-accent);
  text-decoration: none;
  border-bottom: 1px dotted color-mix(in srgb, var(--page-accent) 55%, transparent);
}
.review-source a:hover { border-bottom-style: solid; }
.review-intro {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}
.review-comparisons { display: grid; gap: 11px; }
.review-comparison {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: #fffdf9;
}
.review-comparison h4 {
  margin: 0;
  padding: 9px 11px;
  color: var(--ink);
  background: color-mix(in srgb, var(--page-accent) 7%, #f7f1e7);
  border-bottom: 1px solid var(--line);
  font-size: 14px;
}
.review-compare-wrap { overflow-x: auto; }
.review-compare-table {
  min-width: 660px;
  font-size: 12px;
  line-height: 1.55;
}
.review-compare-table th,
.review-compare-table td { padding: 8px 10px; }
.review-compare-table thead th {
  color: var(--muted);
  background: #fbf7f0;
  border-bottom-width: 1px;
  font-size: 11px;
}
.review-compare-table tbody th {
  width: 112px;
  color: var(--page-accent);
  background: #faf6ef;
  font-weight: 750;
}
.review-comparison > .review-source,
.review-note { margin: 7px 11px 9px; }
.review-note {
  color: var(--muted);
  font-size: 11px;
  line-height: 1.55;
}

.question-list { margin: 10px 0; padding-left: 0; }
.question-item {
  margin: 0;
  padding: 7px 10px;
  border-bottom: 1px dashed var(--line);
}

.practice {
  margin: 22px 0;
  padding: 16px;
  background: #fff;
  border: 1px solid #e6d6a8;
  border-top: 3px solid var(--gold);
  border-radius: 8px;
  box-shadow: 0 5px 14px rgba(122, 92, 25, .05);
}
.practice-heading {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
  color: var(--gold);
  font-weight: 800;
  flex-wrap: wrap;
}
.practice-heading > span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.practice-heading button:not(.practice-answer-jump) {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 9px;
  color: var(--gold);
  background: #fff;
  border: 1px solid #dec88d;
  border-radius: 6px;
  cursor: pointer;
}
.practice-body > :first-child { margin-top: 0; }
.practice-body > :last-child { margin-bottom: 0; }
.practice-body p,
.practice-body li { color: var(--ink); }
.practice-body .content-list { margin: 8px 0; }
.practice-body .options {
  margin: 8px 0 0;
  padding-left: 1.2em;
  list-style: none;
}
.practice-body .options li {
  margin: 6px 0;
  padding: 6px 10px;
  background: #fffaf0;
  border: 1px solid #f0e2b8;
  border-radius: 6px;
}
.answer-index {
  border-top-color: var(--navy);
  border-color: #d5dee3;
  scroll-margin-top: 0;
}
.answer-index .practice-heading { color: var(--navy); }
.answer-index.is-flash {
  box-shadow: 0 0 0 2px var(--page-accent);
}
/* 下沉到题旁的答案（自章末索引克隆） */
.practice details.answer.answer--sunk {
  margin-top: 10px;
}
.practice details.answer.answer--sunk > summary {
  font-size: 0.95em;
}
.practice--promoted {
  margin-top: 14px;
  border-left: 3px solid var(--gold);
}
.promoted-note {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 12px;
}
.answer-index[data-sunk="1"] .practice-heading span::after {
  content: "（题旁已同步，可对照）";
  margin-left: 8px;
  color: var(--muted);
  font-weight: 600;
  font-size: 12px;
}
.answer-index { margin-top: 28px; }
.question {
  padding: 14px 0;
  border-top: 1px solid var(--line);
}
.question:first-of-type { border-top: 0; }
.question-number {
  color: var(--navy);
  font-weight: 800;
}
.options {
  margin: 7px 0 0;
  padding-left: 1.5em;
  list-style: none;
}
.options li { margin: 3px 0; }
.options li::first-letter {
  color: var(--blue);
  font-weight: 700;
}
details.answer {
  margin-top: 12px;
  padding: 8px 11px;
  background: var(--teal-soft);
  border-radius: 6px;
}
details.answer summary {
  display: flex;
  align-items: center;
  gap: 7px;
  color: var(--teal);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
details.answer summary::-webkit-details-marker { display: none; }
.answer-body {
  padding: 8px 4px 2px;
  color: #315a57;
}

/* —— 总览：书脊式科目入口 G2 —— */
.spine-rail {
  display: flex;
  gap: 12px;
  margin-top: 24px;
  overflow-x: auto;
  padding: 8px 2px 16px;
  scroll-snap-type: x proximity;
}
.spine-card {
  flex: 0 0 auto;
  width: min(168px, 42vw);
  min-height: 240px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 18px 14px;
  color: var(--ink);
  text-decoration: none;
  background: #fff;
  border: 1px solid var(--line);
  border-left: 5px solid var(--spine, var(--page-accent));
  border-radius: 4px 8px 8px 4px;
  box-shadow: var(--shadow);
  scroll-snap-align: start;
  transition: transform .2s, box-shadow .2s;
  position: relative;
  overflow: hidden;
}
.spine-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: linear-gradient(180deg, transparent, rgba(0,0,0,.06), transparent);
}
.spine-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 36px rgba(21, 42, 64, .12);
}
.spine-card[data-subject="xingfa"] { --spine: #7A3030; }
.spine-card[data-subject="minfa"] { --spine: #2F5D50; }
.spine-card[data-subject="xianfa"] { --spine: #8B3A2A; }
.spine-card[data-subject="xingzhengfa"] { --spine: #3D5A80; }
.spine-card[data-subject="zonghe"] { --spine: #5C4B6A; }
.spine-kicker {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
  color: var(--spine);
}
.spine-title {
  margin: 12px 0 8px;
  font: 700 26px/1.25 var(--display);
  color: var(--navy);
  writing-mode: horizontal-tb;
}
.spine-meta {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
  line-height: 1.55;
}
.spine-go {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-top: 14px;
  color: var(--spine);
  font-size: 12px;
  font-weight: 700;
}

/* 兼容旧 subject-grid（若残留） */
.subject-grid {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 14px;
  margin-top: 24px;
}
.subject-card {
  display: block;
  padding: 20px;
  color: var(--ink);
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  text-decoration: none;
  transition: transform .18s, box-shadow .18s;
}
.subject-card:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}
.subject-card .card-icon {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  margin-bottom: 10px;
  border-radius: 8px;
  color: var(--teal);
  background: var(--teal-soft);
}
.subject-card .card-icon .icon {
  width: 18px;
  height: 18px;
}
.subject-card .card-kicker {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  color: var(--gold);
  font-size: 11px;
  font-weight: 800;
  letter-spacing: .08em;
}
.subject-card h2 {
  margin: 7px 0;
  color: var(--navy);
  font: 700 22px/1.35 var(--display);
}
.subject-card p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}
.subject-card.ready { border-top: 3px solid var(--teal); }
.subject-card.waiting { border-top: 3px solid var(--line); }
.status {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 14px;
  padding: 2px 7px;
  border-radius: 4px;
  color: #fff;
  background: var(--teal);
  font-size: 11px;
}
.waiting .status {
  color: var(--muted);
  background: #edf1f3;
}

/* 读法笺注 K1 */
.reading-note {
  margin-top: 20px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(21,42,64,.04);
}
.reading-note .diagram { margin-top: 12px; }
.reading-note .chapter-heading {
  border-bottom: 0;
  padding-bottom: 0;
}

.footer {
  margin-top: 48px;
  padding: 20px clamp(18px, 3vw, 40px) 0;
  color: var(--muted);
  border-top: 1px solid var(--line);
  font-size: 12px;
}
body:not(.is-index) .footer {
  margin-left: clamp(18px, 3.2vw, 40px);
  margin-right: clamp(18px, 3.2vw, 40px);
}

.back-top {
  position: fixed;
  right: 22px;
  bottom: 22px;
  z-index: 12;
  display: none;
  place-items: center;
  width: 40px;
  height: 40px;
  color: #faf6ee;
  background: var(--shell);
  border: 0;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: var(--shadow);
  border-top: 2px solid var(--page-accent);
}
.back-top .icon {
  width: 18px;
  height: 18px;
}
.back-top.show { display: grid; }

.search-empty {
  display: none;
  margin: 24px 0;
  padding: 25px;
  color: var(--muted);
  text-align: center;
  background: #fff;
  border-radius: 8px;
}

.reveal,
.reveal.is-visible {
  opacity: 1 !important;
  transform: none !important;
  transition: none !important;
}

/* —— 动效降级 —— */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .01ms !important;
  }
  html { scroll-behavior: auto; }
  .hero-sculpture { transform: none !important; }
}
body.reduce-motion *,
body.reduce-motion *::before,
body.reduce-motion *::after {
  animation-duration: .01ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .01ms !important;
}
body.reduce-motion { scroll-behavior: auto; }
html.reduce-motion { scroll-behavior: auto; }
body.reduce-motion .hero-ink { opacity: .22; }

@media (max-width: 900px) {
  .sidebar {
    transform: translateX(-100%);
    transition: transform .2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .main { margin-left: 0; }
  .menu-toggle { display: grid; }
  .subject-links { display: none; }
  .search { width: min(220px, 42vw); }
  .topbar { padding: 10px 14px; }
  .content {
    width: min(100% - 24px, 760px);
    padding-top: 20px;
  }
  body:not(.is-index) .content { margin-top: 12px; }
  .reduce-motion-btn span.label { display: none; }
}

@media (max-width: 640px) {
  body { font-size: 14px; }
  .hero { padding: 24px 20px; }
  body.is-index .hero { min-height: 58vh; }
  .hero h1 { font-size: 28px; }
  .hero-sculpture { font-size: 120px; right: -4%; }
  .hero-stats {
    gap: 16px;
    flex-wrap: wrap;
  }
  .chapter { margin-top: 36px; }
  .chapter-heading { gap: 10px; }
  .chapter-index { font-size: 22px; }
  .review-heading { padding: 14px; }
  .review-heading h3 { font-size: 20px; }
  .review-row { grid-template-columns: 1fr; }
  .review-label {
    padding: 8px 12px;
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }
  .review-value { padding: 9px 12px 12px; }
  .review-compare-table { min-width: 580px; }
  .section h3 { font-size: 18px; }
  .diagram.four,
  .diagram.three,
  .subject-grid { grid-template-columns: 1fr; }
  .spine-rail {
    flex-direction: column;
    overflow: visible;
  }
  .spine-card {
    width: 100%;
    min-height: 0;
    flex-direction: row;
    align-items: center;
    gap: 14px;
  }
  .spine-title { margin: 0; font-size: 20px; }
  .spine-go { margin-top: 0; margin-left: auto; }
  .flow { display: grid; gap: 10px; }
  .flow-step:not(:last-child)::after {
    right: auto;
    left: 50%;
    top: auto;
    bottom: -18px;
    transform: translateX(-50%) rotate(135deg);
  }
  .flow-step { margin-bottom: 13px; }
  .mind-map__canvas,
  .mind-map--subject .mind-map__canvas,
  .mind-map--section .mind-map__canvas {
    grid-template-columns: 1fr;
    gap: 14px;
    padding: 13px;
  }
  .mind-map__root { min-height: auto; }
  .mind-map__root::after {
    left: 50%;
    top: 100%;
    width: 0;
    height: 15px;
    border-top: 0;
    border-left: 2px solid #9fb8bf;
  }
  .mind-map__branches { grid-template-columns: 1fr; }
  .mind-map__branches::before,
  .mind-map__branch::before { display: none; }
  .mind-map--subject { margin-top: 20px; }
  .mind-map--section { margin: 12px 0 18px; }
  .search {
    margin-left: 0;
    width: 100%;
  }
  .topbar { flex-wrap: wrap; }
  .topbar-actions { width: 100%; }
}

@media print {
  body { background: #fff; }
  .sidebar,
  .topbar,
  .back-top,
  .search,
  .marquee-rail,
  .hero-ink,
  .hero-sculpture,
  .seal,
  .reduce-motion-btn,
  .reading-progress,
  .nav-group-toggle,
  .type-scale,
  .practice-answer-jump,
  .unified-map__actions,
  .unified-map__source-link,
  .mind-map--source-detail { display: none !important; }
  .unified-map { box-shadow: none; break-inside: auto; }
  .unified-map__chapter { break-inside: auto; }
  .unified-map__chapter > summary { break-after: avoid; }
  .unified-map__topics { display: block; }
  .unified-map__topic { margin-bottom: 10px; break-inside: avoid; }
  .main { margin-left: 0; }
  .content {
    width: 100%;
    padding: 0;
    box-shadow: none;
    border: 0;
    background: #fff;
  }
  .hero,
  .diagram-card,
  .mind-map,
  .mind-map__branch,
  .callout,
  .extension,
  .practice,
  .spine-card {
    box-shadow: none;
    break-inside: avoid;
  }
  .mind-map__canvas { gap: 18px; }
  .mind-map__branches { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .mind-map__caption,
  .mind-map__root,
  .mind-map__branch {
    print-color-adjust: exact;
    -webkit-print-color-adjust: exact;
  }
  details.answer { display: block; }
  details.answer > summary { display: none; }
  .answer-body { padding-top: 0; }
}

/* —— 第一阶段壳层精修：移动抽屉、阅读宽度与渐进导图 —— */
:root {
  --topbar-offset: 84px;
  --gold-ink: #7a5810;
}

html {
  scroll-padding-top: var(--topbar-offset);
  scrollbar-gutter: stable;
}

.site-shell,
.main {
  min-height: 100dvh;
}
.site-shell { overflow-x: clip; }

.skip-link {
  position: fixed;
  left: 16px;
  top: 10px;
  z-index: 100;
  padding: 9px 13px;
  color: #fff;
  background: var(--ink-deep);
  border: 2px solid #d4b56a;
  border-radius: 6px;
  text-decoration: none;
  transform: translateY(-160%);
  transition: transform .16s ease;
}
.skip-link:focus { transform: translateY(0); }

:where(a, button, input, summary):focus-visible {
  outline: 2px solid var(--gold-ink);
  outline-offset: 2px;
  box-shadow: 0 0 0 4px #f5ecd4;
}

.sidebar-backdrop,
.sidebar-close,
.mobile-subject-links {
  display: none;
}

.search-control {
  position: relative;
  display: flex;
  align-items: flex-start;
  min-width: 0;
}
.search-control > .search { min-width: 0; }
.search-control .search input { padding-right: 42px; }
.search-clear {
  position: absolute;
  top: 50%;
  right: 7px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  color: var(--muted);
  background: transparent;
  border: 0;
  border-radius: 5px;
  transform: translateY(-50%);
  cursor: pointer;
}
.search-clear:hover { color: var(--ink); background: var(--canvas); }
.search-clear[hidden],
.search-status[hidden] { display: none; }
.search-clear .icon { width: 15px; height: 15px; }
.search-status {
  position: absolute;
  left: 10px;
  top: calc(100% + 3px);
  color: var(--muted);
  font-size: 11px;
  line-height: 1.3;
  white-space: nowrap;
}
.search-control:has(.search-status:not([hidden])) { padding-bottom: 16px; }

body.sidebar-open { overflow: hidden; }
.sidebar-close {
  align-items: center;
  justify-content: center;
  gap: 5px;
  min-width: 40px;
  min-height: 40px;
  padding: 5px 8px;
  color: var(--shell-text);
  background: rgba(243, 235, 224, .08);
  border: 1px solid rgba(243, 235, 224, .18);
  border-radius: 6px;
  cursor: pointer;
}
.sidebar-close .icon { width: 16px; height: 16px; }
.sidebar-close span { font-size: 11px; }

.hero.hero--entered {
  animation: hero-enter-readable .55s ease both;
}
@keyframes hero-enter-readable {
  from { opacity: 1; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
/* 科目页恢复右下角「法」字视觉签名。 */
body:not(.is-index) .hero::after { content: "法"; }

:where(.legacy-body > p,
  .legacy-body > .content-list,
  .legacy-body .content-list > li,
  .extension-body > p,
  .extension-body > .content-list,
  .practice-body > p,
  .practice-body > .content-list,
  .callout > p) {
  max-width: 72ch;
}
.legacy-body .content-list > li.main-item { font-weight: 400; }
.legacy-body .content-list > li.main-item > .item-label,
.legacy-body .content-list > li .item-label { font-weight: 700; }
.practice-heading,
.practice-answer-jump,
.spine-kicker,
.subject-card .card-kicker,
.callout-title { color: var(--gold-ink); }
.sichuan .extension-title { color: var(--gold-ink); }
.sichuan .badge { background: var(--gold-ink); }
body:not(.is-index) .legacy-body > h2.section {
  color: var(--navy);
  background: transparent;
  border: 0;
  border-left: 4px solid var(--page-accent);
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  box-shadow: none;
}
body:not(.is-index) .content { border-color: var(--line); }
body:not(.is-index) .content > .footer { padding-left: 0; padding-right: 0; }
body.is-index .hero { min-height: min(62vh, 560px); }
body.is-index .chapter-heading .chapter-index {
  font-family: var(--sans);
  font-size: 12px;
  letter-spacing: .06em;
}

details.answer summary .icon { transition: transform .18s ease; }
details.answer[open] summary .icon { transform: rotate(180deg); }

.unified-map__overview {
  margin: 12px 18px 0;
  border: 1px solid var(--line);
  border-radius: 7px;
  background: rgba(255,255,255,.7);
}
.unified-map__overview > summary {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 11px 14px;
  color: var(--ink);
  background: color-mix(in srgb, var(--map-accent, var(--page-accent)) 7%, #fff);
  cursor: pointer;
  font-weight: 700;
  list-style: none;
}
.unified-map__overview > summary::-webkit-details-marker { display: none; }
.unified-map__overview-hint { color: var(--muted); font-size: 11px; font-weight: 500; }
.unified-map__overview > .mind-map__branches {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 8px;
  padding: 10px;
}
.unified-map__overview .mind-map__branch,
.unified-map__branches .mind-map__branch { border-left-color: var(--line); }
.unified-map__overview .mind-map__branch-title,
.unified-map__branches .mind-map__branch-title { color: var(--ink); }
.unified-map__skip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 10px;
  color: var(--ink);
  background: color-mix(in srgb, var(--map-accent, var(--page-accent)) 7%, #fff);
  border: 1px solid var(--line);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 700;
  text-decoration: none;
  white-space: nowrap;
}
.unified-map__source-link {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 8px;
  color: var(--page-accent);
  border: 1px solid color-mix(in srgb, var(--page-accent) 24%, var(--line));
  border-radius: 5px;
  font-size: 11px;
}

.review-value,
.review-comparison,
.review-compare-wrap { min-width: 0; max-width: 100%; }

@media (max-width: 1100px) {
  .sidebar {
    z-index: 60;
    width: min(320px, 86vw);
    padding-top: env(safe-area-inset-top);
    transform: translateX(-105%);
    transition: transform .2s ease;
  }
  .sidebar.open { transform: translateX(0); }
  .sidebar-header { position: relative; padding-right: 68px; }
  .sidebar-close { display: inline-flex; position: absolute; right: 14px; top: 18px; }
  .sidebar-backdrop {
    position: fixed;
    inset: 0;
    z-index: 50;
    display: block;
    width: 100%;
    height: 100%;
    padding: 0;
    background: rgba(28, 24, 20, .48);
    border: 0;
    cursor: pointer;
  }
  .sidebar-backdrop[hidden] { display: none; }
  .main { margin-left: 0; }
  .menu-toggle {
    display: grid;
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
  }
  .subject-links { display: none; }
  .mobile-subject-links {
    display: flex;
    flex: 1 1 auto;
    min-width: 0;
    gap: 4px;
    overflow-x: auto;
    scrollbar-width: thin;
    white-space: nowrap;
  }
  .mobile-subject-links a {
    flex: 0 0 auto;
    min-height: 40px;
    display: inline-flex;
    align-items: center;
    padding: 5px 10px;
    color: var(--muted);
    border-radius: 6px;
    font-size: 12px;
    text-decoration: none;
  }
  .mobile-subject-links a.current {
    color: var(--ink);
    background: #fff;
    box-shadow: inset 0 -2px 0 var(--page-accent);
  }
  .topbar {
    display: grid;
    grid-template-columns: 44px minmax(0, 1fr);
    align-items: center;
    gap: 8px;
    padding: 8px 14px;
  }
  .topbar-actions {
    grid-column: 1 / -1;
    width: auto;
    min-width: 0;
    margin-left: 0;
    flex-wrap: wrap;
  }
  .topbar-actions .search-control { flex: 1 0 100%; width: 100%; order: -1; }
  .search-control .search { width: 100%; }
  .reduce-motion-btn,
  .type-scale button { min-height: 44px; }
  .nav-list a { min-height: 44px; display: flex; align-items: center; }
  .nav-group-toggle { width: 44px; min-height: 44px; }
  .content { width: min(calc(100% - 32px), 900px); }
  .back-top {
    right: calc(16px + env(safe-area-inset-right));
    bottom: calc(16px + env(safe-area-inset-bottom));
  }
}

@media (max-width: 640px) {
  :root { --text-base: 16px; --topbar-offset: 116px; }
  body.type-md { --text-base: 16px; }
  body.type-lg { --text-base: 17px; }
  body.type-xl { --text-base: 19px; }
  body { font-size: var(--text-base); line-height: 1.8; }
  .topbar { padding-top: calc(8px + env(safe-area-inset-top)); }
  .mobile-subject-links { order: 2; }
  .topbar-actions { order: 3; }
  .topbar-actions .search-control { min-height: 42px; }
  .search input { padding-top: 10px; padding-bottom: 10px; }
  .search-clear { width: 40px; height: 40px; right: 2px; }
  .search-status { left: 8px; }
  body.is-index .hero {
    min-height: 52vh;
    padding: 28px 20px;
  }
  body.is-index .hero h1 {
    max-width: 18ch;
    font-size: clamp(28px, 8vw, 40px);
    letter-spacing: 0;
    text-wrap: balance;
  }
  body:not(.is-index) .hero { padding: 26px 20px; }
  .hero h1 {
    max-width: 18ch;
    font-size: clamp(26px, 7.5vw, 34px);
    letter-spacing: 0;
    text-wrap: balance;
  }
  .hero p { max-width: 100%; font-size: 15px; line-height: 1.75; }
  .seal--hero { width: 40px; height: 40px; font-size: 18px; }
  .hero-stats { gap: 14px 18px; }
  .spine-card { min-height: 64px; }
  .unified-map__branches .mind-map__items,
  .mind-map__items { font-size: 13px; line-height: 1.65; }
  .unified-map__overview { margin-left: 10px; margin-right: 10px; }
  .unified-map__overview > .mind-map__branches { grid-template-columns: 1fr; }
  .table-wrap { position: relative; }
  .table-wrap::after {
    content: "左右滑动查看更多";
    position: absolute;
    right: 8px;
    bottom: 7px;
    padding: 2px 6px;
    color: var(--muted);
    background: rgba(250,246,238,.92);
    border: 1px solid var(--line);
    border-radius: 4px;
    font-size: 10px;
    pointer-events: none;
  }
  .mind-map--source-detail .mind-map__caption::after { font-size: 10px; }
  .unified-map__source-link { min-height: 40px; }
}

/* —— 总览展厅升级：墨线知识地图 —— */
body.is-index .content {
  width: min(100% - 32px, 1360px);
  padding-top: 16px;
}
body.is-index .hero--atlas {
  display: grid;
  grid-template-columns: minmax(0, 1.06fr) minmax(300px, .94fr);
  grid-template-rows: minmax(0, 1fr) auto;
  gap: clamp(24px, 4vw, 60px);
  min-height: clamp(520px, 68vh, 720px);
  padding: clamp(32px, 5vw, 70px);
  border-radius: 2px 20px 2px 20px;
  background:
    radial-gradient(ellipse 55% 78% at 82% 44%, rgba(196,160,90,.16), transparent 68%),
    linear-gradient(145deg, #17130f 0%, #272019 48%, #3b3025 100%);
}
.hero--atlas .hero-grid {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .35;
  background-image:
    linear-gradient(rgba(243,235,224,.08) 1px, transparent 1px),
    linear-gradient(90deg, rgba(243,235,224,.08) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(135deg, transparent 0%, #000 24%, #000 72%, transparent 100%);
}
.hero--atlas .hero-copy {
  position: relative;
  z-index: 2;
  align-self: center;
  max-width: 680px;
}
.hero--atlas .eyebrow {
  margin-bottom: 22px;
  color: #d4b56a;
  letter-spacing: .2em;
}
.hero--atlas h1 {
  max-width: 10ch;
  margin: 0;
  color: #faf6ee;
  font-size: clamp(48px, 6.6vw, 104px);
  line-height: .98;
  letter-spacing: -.055em;
  text-wrap: balance;
}
.hero--atlas h1 span { display: block; }
.hero--atlas h1 .hero-title-emphasis {
  margin-left: clamp(18px, 4vw, 70px);
  color: #d9b86d;
  text-shadow: 0 0 28px rgba(212,181,106,.16);
}
.hero--atlas p {
  max-width: 46em;
  margin: 28px 0 0;
  color: rgba(250,246,238,.68);
  font-size: clamp(14px, 1.3vw, 17px);
  line-height: 1.85;
}
.hero-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 18px 24px;
  margin-top: 34px;
}
.hero-enter {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  min-height: 42px;
  padding: 8px 0 9px;
  color: #f3d78d;
  border-bottom: 1px solid rgba(243,215,141,.75);
  font-weight: 800;
  text-decoration: none;
  transition: color .25s ease, border-color .25s ease, transform .25s ease;
}
.hero-enter .icon { width: 17px; height: 17px; transition: transform .25s ease; }
.hero-enter:hover,
.hero-enter:focus-visible { color: #fff4cf; border-color: #fff4cf; transform: translateX(4px); }
.hero-enter:hover .icon,
.hero-enter:focus-visible .icon { transform: translateY(3px); }
.hero-note {
  color: rgba(250,246,238,.48);
  font-size: 11px;
  letter-spacing: .04em;
}
.atlas-stage {
  position: relative;
  z-index: 1;
  display: grid;
  place-items: center;
  align-self: stretch;
  min-height: 360px;
  isolation: isolate;
  transform: translate3d(var(--atlas-shift-x, 0px), var(--atlas-shift-y, 0px), 0);
  transition: transform .24s ease-out;
}
.atlas-stage::before {
  content: "";
  position: absolute;
  width: min(34vw, 440px);
  aspect-ratio: 1;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(212,181,106,.13), transparent 66%);
  filter: blur(2px);
  opacity: .8;
}
.atlas-ring {
  position: absolute;
  display: block;
  aspect-ratio: 1;
  border: 1px solid rgba(212,181,106,.38);
  border-radius: 50%;
  transform: rotate(-16deg);
  pointer-events: none;
}
.atlas-ring--outer {
  width: min(34vw, 440px);
  border-style: dashed;
  opacity: .52;
  animation: atlas-orbit 26s linear infinite;
}
.atlas-ring--inner {
  width: min(22vw, 288px);
  border-color: rgba(243,235,224,.2);
  transform: rotate(28deg) scaleY(.72);
  animation: atlas-orbit-reverse 19s linear infinite;
}
.atlas-axis {
  position: absolute;
  width: min(39vw, 500px);
  border-top: 1px solid rgba(243,235,224,.2);
  transform-origin: center;
  pointer-events: none;
}
.atlas-axis--one { transform: rotate(34deg); }
.atlas-axis--two { transform: rotate(-52deg); border-color: rgba(212,181,106,.32); }
.atlas-node {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: rgba(250,246,238,.86);
  background: rgba(36,31,25,.72);
  border: 1px solid color-mix(in srgb, var(--node-color) 64%, rgba(243,235,224,.35));
  border-radius: 50%;
  font: 700 18px/1 var(--display);
  box-shadow: 0 0 0 6px rgba(250,246,238,.025), 0 12px 28px rgba(0,0,0,.2);
  transition: transform .5s cubic-bezier(.2,.8,.2,1), background .35s ease, color .35s ease;
}
.atlas-node::after {
  content: "";
  position: absolute;
  inset: -5px;
  border: 1px solid color-mix(in srgb, var(--node-color) 42%, transparent);
  border-radius: inherit;
  opacity: .55;
}
.atlas-node--xingfa { --node-color: #b15b57; top: 13%; left: 17%; }
.atlas-node--minfa { --node-color: #6ba18c; top: 27%; right: 8%; }
.atlas-node--xianfa { --node-color: #c47762; bottom: 17%; right: 17%; }
.atlas-node--xingzhengfa { --node-color: #7897c0; bottom: 8%; left: 22%; }
.atlas-node--zonghe { --node-color: #9b80b0; top: 48%; left: 1%; }
.atlas-stage-label {
  position: absolute;
  right: 4%;
  bottom: 5%;
  color: rgba(250,246,238,.42);
  font: 11px/1.4 var(--sans);
  letter-spacing: .12em;
  writing-mode: vertical-rl;
}
@keyframes atlas-orbit {
  to { transform: rotate(344deg); }
}
@keyframes atlas-orbit-reverse {
  to { transform: rotate(-332deg) scaleY(.72); }
}
body.is-index .hero--atlas .hero-sculpture {
  right: -1%;
  bottom: -16%;
  color: rgba(255,255,255,.075);
  font-size: clamp(190px, 31vw, 430px);
  text-shadow: 0 0 48px rgba(0,0,0,.2), 0 0 18px rgba(212,181,106,.08);
}
.hero-footer {
  position: relative;
  z-index: 2;
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: end;
  gap: 24px;
  padding-top: 18px;
  border-top: 1px solid rgba(243,235,224,.17);
}
.hero-footer .orbit-meta,
.hero-footer .hero-stats { margin-top: 0; }
.hero-footer .hero-stats { justify-content: center; }
.hero-scroll {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: rgba(250,246,238,.62);
  font-size: 11px;
  text-decoration: none;
  white-space: nowrap;
  transition: color .2s ease, transform .2s ease;
}
.hero-scroll .icon { width: 15px; height: 15px; }
.hero-scroll:hover,
.hero-scroll:focus-visible { color: #f3d78d; transform: translateY(3px); }

body.is-index .chapter--atlas {
  position: relative;
  margin-top: clamp(76px, 11vw, 150px);
}
body.is-index .chapter--atlas::before {
  content: "";
  position: absolute;
  left: 7px;
  top: -84px;
  height: 58px;
  border-left: 1px solid var(--line);
}
body.is-index .chapter--atlas .chapter-heading {
  align-items: end;
  padding-bottom: 22px;
  border-bottom-color: color-mix(in srgb, var(--ink) 34%, var(--line));
}
body.is-index .chapter--atlas .chapter-index {
  writing-mode: vertical-rl;
  transform: rotate(180deg);
  padding: 0;
  color: var(--page-accent);
  font: 700 12px/1.2 var(--sans);
  letter-spacing: .16em;
}
body.is-index .spine-rail {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0;
  margin-top: 30px;
  padding: 12px 0 30px;
  overflow: visible;
}
body.is-index .spine-card {
  width: auto;
  min-height: 300px;
  justify-content: flex-start;
  gap: 18px;
  padding: 22px 20px 18px;
  border: 0;
  border-left: 1px solid var(--line);
  border-radius: 0;
  background: linear-gradient(180deg, rgba(255,255,255,.72), rgba(255,255,255,.2));
  box-shadow: none;
  transform: none;
  transition: transform .45s cubic-bezier(.2,.8,.2,1), background .35s ease, box-shadow .35s ease;
}
body.is-index .spine-card:last-child { border-right: 1px solid var(--line); }
body.is-index .spine-card::before {
  width: 100%;
  height: 3px;
  inset: 0 0 auto;
  background: var(--spine);
  opacity: .7;
}
body.is-index .spine-card::after {
  content: "";
  position: absolute;
  left: 20px;
  right: 20px;
  bottom: 0;
  border-bottom: 1px solid var(--line);
  opacity: .75;
}
body.is-index .spine-card:hover,
body.is-index .spine-card:focus-visible {
  z-index: 2;
  transform: translateY(-10px);
  background: linear-gradient(180deg, #fff, color-mix(in srgb, var(--spine) 7%, #fff));
  box-shadow: 0 18px 34px rgba(42,36,28,.1);
}
.spine-glyph {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  color: var(--spine);
  border: 1px solid color-mix(in srgb, var(--spine) 45%, var(--line));
  border-radius: 50%;
  font: 700 27px/1 var(--display);
  transition: transform .45s cubic-bezier(.2,.8,.2,1), background .3s ease;
}
body.is-index .spine-card:hover .spine-glyph,
body.is-index .spine-card:focus-visible .spine-glyph { transform: rotate(-8deg) scale(1.08); background: color-mix(in srgb, var(--spine) 10%, #fff); }
.spine-copy { position: relative; z-index: 1; }
body.is-index .spine-title { margin: 0 0 10px; font-size: clamp(24px, 2.2vw, 34px); }
body.is-index .spine-meta { max-width: 15ch; }
body.is-index .spine-go { margin-top: auto; }
.reading-note--atlas {
  position: relative;
  padding: 0 0 8px;
  background: transparent;
  border: 0;
  box-shadow: none;
}
.reading-note--atlas .chapter-heading { border-bottom: 0; }
.reading-note--atlas .diagram-card {
  border: 0;
  border-top: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  transition: background .25s ease, transform .25s ease;
}
.reading-note--atlas .diagram-card:hover { transform: translateY(-4px); background: rgba(255,255,255,.65); }

body.is-index[data-atlas-focus="xingfa"] .atlas-node--xingfa,
body.is-index[data-atlas-focus="minfa"] .atlas-node--minfa,
body.is-index[data-atlas-focus="xianfa"] .atlas-node--xianfa,
body.is-index[data-atlas-focus="xingzhengfa"] .atlas-node--xingzhengfa,
body.is-index[data-atlas-focus="zonghe"] .atlas-node--zonghe {
  color: #fff;
  background: color-mix(in srgb, var(--node-color) 48%, #241f19);
  transform: scale(1.35);
}
body.reduce-motion .atlas-stage { transform: none; transition: none; }
body.is-index.atlas-ready [data-atlas-reveal] {
  opacity: .18;
  transform: translateY(18px);
  transition: opacity .7s ease, transform .7s cubic-bezier(.2,.8,.2,1);
}
body.is-index.atlas-ready [data-atlas-reveal].is-atlas-visible {
  opacity: 1;
  transform: none;
}

@media (max-width: 980px) {
  body.is-index .hero--atlas { grid-template-columns: minmax(0, 1fr) minmax(250px, .8fr); }
  body.is-index .spine-rail { display: flex; overflow-x: auto; padding-bottom: 24px; }
  body.is-index .spine-card { width: clamp(180px, 27vw, 220px); flex: 0 0 auto; }
}
@media (max-width: 640px) {
  body.is-index .content { width: min(100% - 20px, 560px); padding-top: 10px; }
  body.is-index .hero--atlas {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto;
    gap: 18px;
    min-height: 0;
    padding: 32px 22px 24px;
    border-radius: 2px 14px 2px 14px;
  }
  .hero--atlas .eyebrow { margin-bottom: 16px; }
  .hero--atlas h1 { max-width: 9ch; font-size: clamp(39px, 12vw, 62px); }
  .hero--atlas h1 .hero-title-emphasis { margin-left: 16px; }
  .hero--atlas p { margin-top: 20px; font-size: 14px; }
  .hero-actions { margin-top: 24px; gap: 12px 18px; }
  .hero-note { font-size: 10px; }
  .atlas-stage { min-height: 230px; order: 2; }
  .atlas-ring--outer { width: 250px; }
  .atlas-ring--inner { width: 165px; }
  .atlas-axis { width: 285px; }
  .atlas-node { width: 34px; height: 34px; font-size: 15px; }
  .atlas-stage-label { right: 0; bottom: 3%; font-size: 10px; }
  body.is-index .hero--atlas .hero-sculpture { right: -9%; bottom: -19%; font-size: 190px; }
  .hero-footer { grid-template-columns: 1fr; gap: 16px; padding-top: 14px; }
  .hero-footer .hero-stats { justify-content: space-between; gap: 12px; }
  .hero-footer .hero-stat strong { font-size: 20px; }
  .hero-scroll { justify-self: start; }
  body.is-index .chapter--atlas { margin-top: 74px; }
  body.is-index .chapter--atlas::before { top: -56px; height: 36px; }
  body.is-index .chapter--atlas .chapter-heading { align-items: flex-start; }
  body.is-index .chapter--atlas .chapter-index { writing-mode: horizontal-tb; transform: none; padding-top: 6px; }
  body.is-index .spine-rail { display: grid; gap: 8px; margin-top: 20px; padding: 8px 0 18px; }
  body.is-index .spine-card,
  body.is-index .spine-card:last-child {
    width: 100%;
    min-height: 100px;
    flex-direction: row;
    align-items: center;
    gap: 14px;
    padding: 15px 14px;
    border: 0;
    border-top: 1px solid var(--line);
    border-bottom: 0;
  }
  body.is-index .spine-card::after { left: 14px; right: 14px; }
  body.is-index .spine-glyph { width: 42px; height: 42px; flex: 0 0 auto; font-size: 22px; }
  body.is-index .spine-title { margin: 0 0 3px; font-size: 23px; }
  body.is-index .spine-meta { max-width: none; font-size: 11px; }
  body.is-index .spine-go { margin-left: auto; }
  .reading-note--atlas .diagram-card:hover { transform: none; }
}

/* —— 科目页试制：短碑 + 章节轨 —— */
body.subject-atlas-page .content { overflow: visible; }
body.subject-atlas-page .hero--subject-atlas {
  display: block;
  min-height: 360px;
  padding: clamp(34px, 5vw, 58px) clamp(24px, 4vw, 54px);
  border-radius: 11px 11px 0 0;
  background:
    radial-gradient(ellipse 56% 90% at var(--mx, 88%) var(--my, 30%), color-mix(in srgb, var(--page-accent) 22%, transparent), transparent 68%),
    linear-gradient(145deg, #1c1513 0%, #2a211d 56%, #3a2b27 100%);
}
body.subject-atlas-page .hero--subject-atlas::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: .28;
  background-image: linear-gradient(90deg, color-mix(in srgb, var(--page-accent) 26%, transparent) 1px, transparent 1px);
  background-size: 96px 100%;
  mask-image: linear-gradient(90deg, #000, transparent 78%);
  transform-origin: center;
  will-change: transform, opacity;
  animation: subject-grid-drift 13s ease-in-out infinite alternate;
}
body.subject-atlas-page .hero--subject-atlas::after {
  will-change: transform;
  animation: subject-law-drift 8s ease-in-out infinite alternate;
}
body.subject-atlas-page .hero--subject-atlas .seal--subject {
  will-change: transform, opacity;
  animation: subject-seal-drift 6.5s ease-in-out infinite alternate;
}
@keyframes subject-grid-drift {
  from { opacity: .20; transform: translate3d(-1.2%, 0, 0) scale(1.015); }
  to { opacity: .34; transform: translate3d(1.2%, 0, 0) scale(1.035); }
}
@keyframes subject-law-drift {
  from { transform: translate3d(0, 7px, 0); }
  to { transform: translate3d(-9px, -2px, 0); }
}
@keyframes subject-seal-drift {
  from { opacity: .70; transform: rotate(-8deg) translate3d(0, 0, 0); }
  to { opacity: .94; transform: rotate(-5deg) translate3d(-2px, 3px, 0); }
}
body.reduce-motion .hero--subject-atlas::before,
body.reduce-motion .hero--subject-atlas::after,
body.reduce-motion .hero--subject-atlas .seal--subject {
  animation: none !important;
  transform: none !important;
}
.subject-hero-copy {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(150px, 190px);
  grid-template-rows: auto auto auto;
  column-gap: clamp(28px, 5vw, 72px);
  align-items: end;
}
.subject-hero-copy > .eyebrow,
.subject-hero-copy > h1,
.subject-hero-copy > p { grid-column: 1; }
.subject-hero-copy > .eyebrow { margin-bottom: 14px; }
.subject-hero-copy > h1 {
  max-width: 13ch;
  margin: 0;
  color: #faf6ee;
  font-size: clamp(36px, 4.5vw, 66px);
  line-height: 1.05;
  letter-spacing: -.045em;
}
.subject-hero-copy > p {
  max-width: 52em;
  margin: 18px 0 0;
  color: rgba(250,246,238,.68);
  font-size: 14px;
  line-height: 1.75;
}
.subject-hero-copy > .hero-stats {
  grid-column: 2;
  grid-row: 1 / 4;
  display: grid;
  align-self: stretch;
  align-content: end;
  gap: 0;
  margin: 0;
  padding-left: 22px;
  border-left: 1px solid color-mix(in srgb, var(--page-accent) 64%, rgba(243,235,224,.2));
}
.subject-hero-copy > .hero-stats .hero-stat {
  padding: 12px 0 12px 2px;
  border-top: 1px solid rgba(243,235,224,.16);
}
.subject-hero-copy > .hero-stats .hero-stat:last-child { border-bottom: 1px solid rgba(243,235,224,.16); }
.subject-hero-copy > .hero-stats .hero-stat strong { color: color-mix(in srgb, var(--page-accent) 65%, #f3d78d); font-size: 28px; }
.subject-hero-copy > .hero-stats .hero-stat span { color: rgba(250,246,238,.55); }
.subject-chapter-ribbon {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: minmax(150px, .32fr) minmax(0, 1fr);
  align-items: stretch;
  gap: 18px;
  margin: 0;
  padding: 10px clamp(18px, 3.2vw, 40px);
  background: rgba(250,246,238,.94);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 20px rgba(42,36,28,.07);
  backdrop-filter: blur(14px);
}
.subject-chapter-ribbon__lead {
  display: grid;
  grid-template-columns: auto auto;
  align-content: center;
  gap: 4px 7px;
  color: var(--page-accent);
  font-size: 11px;
  letter-spacing: .08em;
}
.subject-chapter-ribbon__lead .icon { width: 16px; height: 16px; grid-row: span 2; align-self: center; }
.subject-chapter-ribbon__lead strong {
  grid-column: 2;
  color: var(--ink);
  font: 700 14px/1.35 var(--display);
  letter-spacing: 0;
}
.subject-chapter-ribbon ol {
  display: grid;
  grid-template-columns: repeat(var(--subject-chapter-count, 4), minmax(0, 1fr));
  gap: 0;
  list-style: none;
  margin: 0;
  padding: 0;
}
.subject-chapter-ribbon li { min-width: 0; }
.subject-chapter-ribbon a {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  min-height: 42px;
  padding: 5px 12px;
  color: var(--muted);
  border-left: 1px solid var(--line);
  text-decoration: none;
  transition: color .2s ease, background .2s ease, border-color .2s ease;
}
.subject-chapter-ribbon a:hover,
.subject-chapter-ribbon a:focus-visible,
.subject-chapter-ribbon a[aria-current="location"] {
  color: var(--ink);
  background: color-mix(in srgb, var(--page-accent) 8%, transparent);
  border-left-color: var(--page-accent);
}
.subject-chapter-ribbon__no { color: var(--page-accent); font: 700 11px/1 var(--latin); }
.subject-chapter-ribbon__title { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 700 13px/1.35 var(--display); }
.subject-chapter-ribbon__count { color: var(--muted); font-size: 10px; white-space: nowrap; }
body.subject-atlas-page .unified-map { margin-top: 28px; }
body.subject-atlas-page .chapter--subject-story {
  position: relative;
  transition: border-color .35s ease;
}
body.subject-atlas-page .chapter--subject-story::before {
  content: attr(data-chapter-ordinal);
  position: absolute;
  right: clamp(18px, 3vw, 42px);
  top: 6px;
  color: color-mix(in srgb, var(--page-accent) 16%, transparent);
  font: 700 clamp(48px, 8vw, 110px)/1 var(--latin);
  pointer-events: none;
}
body.subject-atlas-page .chapter--subject-story.is-subject-active > .chapter-heading {
  border-bottom-color: var(--page-accent);
}
body.subject-atlas-page.subject-story-ready .chapter--subject-story:not(.is-subject-seen) > .chapter-heading,
body.subject-atlas-page.subject-story-ready .chapter--subject-story:not(.is-subject-seen) > .mind-map--chapter {
  opacity: 1;
  transform: none;
  transition: none;
}
body.subject-atlas-page.subject-story-ready .chapter--subject-story.is-subject-seen > .chapter-heading,
body.subject-atlas-page.subject-story-ready .chapter--subject-story.is-subject-seen > .mind-map--chapter {
  opacity: 1;
  transform: none;
}

/* 科目页首帧保持稳定：环境动效只作用于材质层，不移动整块内容。 */
body:not(.is-index) .hero.hero--entered {
  animation: none;
  transform: none;
}

@media (max-width: 760px) {
  body.subject-atlas-page .hero--subject-atlas { min-height: 0; padding: 30px 20px 28px; }
  .subject-hero-copy { grid-template-columns: 1fr; grid-template-rows: auto; gap: 0; }
  .subject-hero-copy > .hero-stats {
    grid-column: 1;
    grid-row: auto;
    grid-template-columns: repeat(var(--subject-stat-count, 3), minmax(0, 1fr));
    margin-top: 22px;
    padding: 12px 0 0;
    border-top: 1px solid color-mix(in srgb, var(--page-accent) 64%, rgba(243,235,224,.2));
    border-left: 0;
  }
  .subject-hero-copy > .hero-stats .hero-stat { padding: 8px 10px 4px 0; border-top: 0; }
  .subject-hero-copy > .hero-stats .hero-stat + .hero-stat { padding-left: 10px; border-left: 1px solid rgba(243,235,224,.16); }
  .subject-hero-copy > .hero-stats .hero-stat:last-child { border-bottom: 0; }
  .subject-hero-copy > .hero-stats .hero-stat strong { font-size: 22px; }
  .subject-chapter-ribbon { display: block; padding: 10px 14px 8px; }
  .subject-chapter-ribbon__lead { margin-bottom: 8px; }
  .subject-chapter-ribbon ol { display: flex; overflow-x: auto; scroll-snap-type: x proximity; }
  .subject-chapter-ribbon li { flex: 0 0 180px; scroll-snap-align: start; }
  .subject-chapter-ribbon a { min-height: 46px; }
  body.subject-atlas-page .chapter--subject-story::before { right: 12px; top: 2px; font-size: 52px; }
}

@media (max-width: 900px) and (min-width: 761px) {
  .subject-chapter-ribbon { display: block; padding: 10px 18px 8px; }
  .subject-chapter-ribbon__lead { margin-bottom: 8px; }
  .subject-chapter-ribbon ol { display: flex; overflow-x: auto; scroll-snap-type: x proximity; }
  .subject-chapter-ribbon li { flex: 0 0 180px; scroll-snap-align: start; }
  .subject-chapter-ribbon a { min-height: 46px; }
}

@media print {
  html { scroll-padding-top: 0; }
  .skip-link,
  .sidebar-backdrop,
  .sidebar-close,
  .mobile-subject-links,
  .search-clear,
  .search-status { display: none !important; }
  .hero {
    color: #1c1814 !important;
    background: #fff !important;
    border: 1px solid #999 !important;
  }
  .hero h1,
  .hero p,
  .hero-stat span { color: #1c1814 !important; }
  .eyebrow,
  .hero-stat strong { color: #7a5810 !important; }
  details.unified-map__chapter,
  details.unified-map__chapter:not([open]) { max-height: none !important; display: block !important; opacity: 1 !important; }
  .mind-map--source-detail .mind-map__canvas { display: grid !important; visibility: visible !important; }
  .unified-map__chapter > summary::after { display: none !important; }
  details.unified-map__chapter:not([open]) > .unified-map__topics,
  details.unified-map__overview:not([open]) > .mind-map__branches { display: block !important; }
  .unified-map__topics { display: block !important; }
  .answer-body { display: block !important; padding-top: 0; }
  .table-wrap { overflow: visible !important; }
  table { min-width: 0 !important; }
}

/* —— 法域换卷：科目之间唯一的跨页签名动效 —— */
.domain-transition {
  --transition-accent: var(--page-accent, #9a7420);
  --domain-enter-x: 102%;
  --domain-exit-x: -102%;
  --domain-content-enter-x: 30px;
  --domain-content-exit-x: -22px;
  position: fixed;
  inset: 0;
  z-index: 2147483000;
  width: 100%;
  height: 100%;
  height: 100dvh;
  overflow: hidden;
  overflow: clip;
  color: #f7f0e5;
  background: transparent;
  visibility: hidden;
  opacity: 1;
  pointer-events: none;
  isolation: isolate;
  contain: strict;
}

html.domain-transition-out,
html.domain-transition-in {
  overflow: hidden;
}
html.domain-transition-out body,
html.domain-transition-in body {
  overscroll-behavior: none;
  touch-action: none;
}

.domain-transition[data-transition-direction="back"] {
  --domain-enter-x: -102%;
  --domain-exit-x: 102%;
  --domain-content-enter-x: -30px;
  --domain-content-exit-x: 22px;
}

.domain-transition.is-active,
.domain-transition.is-revealing,
html.js.domain-transition-in:not(.app-ready) body > .domain-transition {
  visibility: visible;
}

.domain-transition.is-active { pointer-events: auto; }
html.domain-transition-in .domain-transition { pointer-events: none; }

.domain-transition__sheet {
  position: absolute;
  inset: -2px;
  transform: translate3d(var(--domain-enter-x), 0, 0);
  transform-origin: center;
  backface-visibility: hidden;
  will-change: transform;
  transition-property: transform;
  transition-timing-function: cubic-bezier(.76, 0, .24, 1);
}

.domain-transition__sheet--accent,
.domain-transition__sheet--back {
  z-index: 1;
  background: var(--transition-accent);
  transition-duration: 400ms;
  transition-delay: 0ms;
}

.domain-transition__sheet--paper,
.domain-transition__sheet--middle {
  z-index: 2;
  background: #f7f0e5;
  transition-duration: 430ms;
  transition-delay: 42ms;
}

.domain-transition__sheet--ink,
.domain-transition__sheet--front {
  z-index: 3;
  overflow: hidden;
  background: #211b16;
  box-shadow: -18px 0 40px rgba(28, 22, 17, .24);
  transition-duration: 455ms;
  transition-delay: 82ms;
}

.domain-transition[data-transition-direction="back"] .domain-transition__sheet--ink,
.domain-transition[data-transition-direction="back"] .domain-transition__sheet--front {
  box-shadow: 18px 0 40px rgba(28, 22, 17, .24);
}

.domain-transition__sheet--ink::before,
.domain-transition__sheet--front::before,
.domain-transition__sheet--ink::after,
.domain-transition__sheet--front::after {
  content: "";
  position: absolute;
  pointer-events: none;
}

.domain-transition__sheet--ink::before,
.domain-transition__sheet--front::before {
  top: 8vh;
  bottom: 8vh;
  right: clamp(34px, 8vw, 132px);
  width: 1px;
  background: rgba(247, 240, 229, .18);
}

.domain-transition[data-transition-direction="back"] .domain-transition__sheet--ink::before,
.domain-transition[data-transition-direction="back"] .domain-transition__sheet--front::before {
  right: auto;
  left: clamp(34px, 8vw, 132px);
}

.domain-transition__sheet--ink::after,
.domain-transition__sheet--front::after {
  top: clamp(72px, 15vh, 150px);
  left: clamp(30px, 6vw, 104px);
  right: clamp(30px, 6vw, 104px);
  height: 1px;
  background: var(--transition-accent);
  opacity: .7;
}

.domain-transition.is-active .domain-transition__sheet {
  transform: translate3d(0, 0, 0);
}

.domain-transition.is-revealing:not(.is-active) .domain-transition__sheet {
  transform: translate3d(var(--domain-exit-x), 0, 0);
}

.domain-transition.is-revealing:not(.is-active) .domain-transition__sheet--ink,
.domain-transition.is-revealing:not(.is-active) .domain-transition__sheet--front {
  transition-duration: 440ms;
  transition-delay: 0ms;
}

.domain-transition.is-revealing:not(.is-active) .domain-transition__sheet--paper,
.domain-transition.is-revealing:not(.is-active) .domain-transition__sheet--middle {
  transition-duration: 450ms;
  transition-delay: 54ms;
}

.domain-transition.is-revealing:not(.is-active) .domain-transition__sheet--accent,
.domain-transition.is-revealing:not(.is-active) .domain-transition__sheet--back {
  transition-duration: 470ms;
  transition-delay: 108ms;
}

/* A stored transition is painted before app-ready, so the new page never
   exposes the canvas between documents. */
html.domain-transition-in .domain-transition.is-active.is-revealing .domain-transition__sheet,
html.js.domain-transition-in:not(.app-ready) .domain-transition.is-active .domain-transition__sheet {
  transform: translate3d(0, 0, 0);
  transition: none;
}

.domain-transition__content,
.domain-transition__identity {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  grid-template-columns: minmax(280px, 1.05fr) minmax(260px, .72fr);
  grid-template-rows: auto auto auto auto;
  align-content: center;
  align-items: center;
  column-gap: clamp(42px, 8vw, 140px);
  width: min(calc(100% - 12vw), 1240px);
  height: 100%;
  margin: 0 auto;
  padding-block: clamp(74px, 12vh, 132px);
  opacity: 0;
  transform: translate3d(var(--domain-content-enter-x), 0, 0);
  will-change: opacity, transform;
  transition:
    opacity 180ms linear 285ms,
    transform 340ms cubic-bezier(.22, 1, .36, 1) 220ms;
}

.domain-transition.is-active .domain-transition__content,
.domain-transition.is-active .domain-transition__identity {
  opacity: 1;
  transform: translate3d(0, 0, 0);
}

.domain-transition.is-revealing:not(.is-active) .domain-transition__content,
.domain-transition.is-revealing:not(.is-active) .domain-transition__identity {
  opacity: 0;
  transform: translate3d(var(--domain-content-exit-x), 0, 0);
  transition-delay: 0ms;
  transition-duration: 130ms, 260ms;
}

.domain-transition__glyph {
  grid-column: 1;
  grid-row: 1 / -1;
  justify-self: start;
  color: rgba(247, 240, 229, .075);
  font: 700 420px/.72 var(--display);
  letter-spacing: 0;
  white-space: nowrap;
  user-select: none;
  -webkit-text-stroke: 1px rgba(247, 240, 229, .14);
}

.domain-transition__icon {
  grid-column: 2;
  grid-row: 1;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  margin-bottom: clamp(24px, 4vh, 44px);
  color: #f7f0e5;
  border: 1px solid var(--transition-accent);
}

.domain-transition__icon .icon,
svg.domain-transition__icon {
  width: 23px;
  height: 23px;
  stroke-width: 1.5;
}

.domain-transition__name {
  grid-column: 2;
  grid-row: 2;
  max-width: 8ch;
  color: #f7f0e5;
  font: 700 104px/.92 var(--display);
  letter-spacing: 0;
  text-wrap: balance;
}

.domain-transition__index {
  grid-column: 2;
  grid-row: 3;
  margin-top: clamp(18px, 3vh, 32px);
  color: rgba(247, 240, 229, .56);
  font: 700 11px/1.4 var(--sans);
  letter-spacing: 0;
}

.domain-transition__rule {
  grid-column: 2;
  grid-row: 4;
  width: min(100%, 360px);
  height: 1px;
  margin-top: clamp(22px, 4vh, 44px);
  background: var(--transition-accent);
  transform: scaleX(0);
  transform-origin: left center;
  transition: transform 320ms cubic-bezier(.22, 1, .36, 1) 250ms;
}

.domain-transition[data-transition-direction="back"] .domain-transition__rule {
  transform-origin: right center;
}

.domain-transition.is-active .domain-transition__rule { transform: scaleX(1); }
.domain-transition.is-revealing:not(.is-active) .domain-transition__rule {
  transform: scaleX(0);
  transition-delay: 0ms;
  transition-duration: 150ms;
}

@media (max-width: 1024px) and (min-width: 641px) {
  .domain-transition__glyph { font-size: 340px; }
  .domain-transition__name { font-size: 84px; }
}

@media (max-width: 640px) {
  .domain-transition__sheet--paper,
  .domain-transition__sheet--middle { display: none; }

  .domain-transition__sheet--accent,
  .domain-transition__sheet--back {
    transition-duration: 300ms;
  }

  .domain-transition__sheet--ink,
  .domain-transition__sheet--front {
    transition-duration: 350ms;
    transition-delay: 40ms;
    box-shadow: none;
  }

  .domain-transition.is-revealing:not(.is-active) .domain-transition__sheet--ink,
  .domain-transition.is-revealing:not(.is-active) .domain-transition__sheet--front {
    transition-duration: 340ms;
  }

  .domain-transition.is-revealing:not(.is-active) .domain-transition__sheet--accent,
  .domain-transition.is-revealing:not(.is-active) .domain-transition__sheet--back {
    transition-duration: 360ms;
    transition-delay: 54ms;
  }

  .domain-transition__sheet--ink::before,
  .domain-transition__sheet--front::before { display: none; }

  .domain-transition__sheet--ink::after,
  .domain-transition__sheet--front::after {
    top: 72px;
    left: 22px;
    right: 22px;
  }

  .domain-transition__content,
  .domain-transition__identity {
    grid-template-columns: 1fr;
    grid-template-rows: auto auto auto auto;
    align-content: center;
    width: calc(100% - 44px);
    padding-block: 86px 54px;
  }

  .domain-transition__glyph {
    position: absolute;
    top: 50%;
    right: -8vw;
    z-index: 0;
    font-size: 270px;
    transform: translateY(-50%);
  }

  .domain-transition__icon,
  .domain-transition__name,
  .domain-transition__index,
  .domain-transition__rule {
    position: relative;
    z-index: 1;
    grid-column: 1;
  }

  .domain-transition__icon { grid-row: 1; width: 46px; height: 46px; margin-bottom: 28px; }
  .domain-transition__name { grid-row: 2; font-size: 68px; }
  .domain-transition__index { grid-row: 3; }
  .domain-transition__rule { grid-row: 4; width: min(68vw, 280px); }
}

@media (max-height: 520px) {
  .domain-transition__content,
  .domain-transition__identity { padding-block: 24px; }
  .domain-transition__glyph { font-size: 270px; }
  .domain-transition__name { font-size: 68px; }
  .domain-transition__icon { width: 44px; height: 44px; margin-bottom: 14px; }
  .domain-transition__index { margin-top: 10px; }
  .domain-transition__rule { margin-top: 14px; }
}

@media (max-width: 640px) and (max-height: 520px) {
  .domain-transition__content,
  .domain-transition__identity { padding-block: 18px; }
  .domain-transition__glyph { font-size: 210px; }
  .domain-transition__name { font-size: 52px; }
  .domain-transition__icon { width: 40px; height: 40px; margin-bottom: 12px; }
}

@media (prefers-reduced-motion: reduce) {
  .domain-transition {
    background: #211b16;
    opacity: 0;
    transition: opacity 120ms linear, visibility 0s linear 120ms !important;
  }
  .domain-transition.is-active {
    visibility: visible;
    opacity: 1;
    transition-delay: 0ms !important;
  }
  .domain-transition.is-revealing:not(.is-active) {
    visibility: visible;
    opacity: 0;
  }
  .domain-transition__sheet {
    transform: none !important;
    transition: none !important;
  }
  .domain-transition__sheet--accent,
  .domain-transition__sheet--back,
  .domain-transition__sheet--paper,
  .domain-transition__sheet--middle { display: none !important; }
  .domain-transition__content,
  .domain-transition__identity {
    transform: none !important;
    transition: opacity 120ms linear !important;
  }
  .domain-transition__rule { transform: none !important; transition: none !important; }
}

body.reduce-motion .domain-transition,
html.reduce-motion .domain-transition {
  background: #211b16;
  opacity: 0;
  transition: opacity 120ms linear, visibility 0s linear 120ms !important;
}
body.reduce-motion .domain-transition.is-active,
html.reduce-motion .domain-transition.is-active {
  visibility: visible;
  opacity: 1;
  transition-delay: 0ms !important;
}
body.reduce-motion .domain-transition.is-revealing:not(.is-active),
html.reduce-motion .domain-transition.is-revealing:not(.is-active) {
  visibility: visible;
  opacity: 0;
}
body.reduce-motion .domain-transition__sheet,
html.reduce-motion .domain-transition__sheet {
  transform: none !important;
  transition: none !important;
}
body.reduce-motion :is(.domain-transition__sheet--accent, .domain-transition__sheet--back, .domain-transition__sheet--paper, .domain-transition__sheet--middle),
html.reduce-motion :is(.domain-transition__sheet--accent, .domain-transition__sheet--back, .domain-transition__sheet--paper, .domain-transition__sheet--middle) {
  display: none !important;
}
body.reduce-motion :is(.domain-transition__content, .domain-transition__identity),
html.reduce-motion :is(.domain-transition__content, .domain-transition__identity) {
  transform: none !important;
  transition: opacity 120ms linear !important;
}
body.reduce-motion .domain-transition__rule,
html.reduce-motion .domain-transition__rule {
  transform: none !important;
  transition: none !important;
}

@media print {
  .domain-transition { display: none !important; }
}
