/* ============================================================================
   东方诗意主题 · 宣纸为纸 / 松烟为墨 / 朱砂点睛 / 留白为境
   ----------------------------------------------------------------------------
   设计原则（2026-11 视觉升级 · 水墨意境）：
   1. 纸面从冷灰网格转为暖宣纸，纹理更柔、留白更多——回到「纸」的隐喻。
   2. Hero 由纯色夜空改为真实水墨山水（公有领域藏品），配暗墨蒙版保证可读。
   3. 保留 --hue 辐角流转与色环交互：色相仍随 θ 变化，但降低饱和、提亮，
      使之接近矿物颜料（石青、石绿、赭石、朱砂）而非荧光色。
   4. 朱砂印章 / 竖排题款 / 淡墨分隔线——东方排版语汇，克制使用。
   5. 演算室（.theater/.vault）维持深色墨底，作为「砚台」保持对比与专注。
   全部为覆盖层，独立于上方规则；删除本段即可回到原设计。
   ============================================================================ */

:root {
  /* —— 宣纸与松烟 —— */
  --paper: #F7F3EA;              /* 宣纸暖白（原冷灰 #F1F4F9） */
  --paper-grid: rgba(60, 52, 42, 0.045);
  --paper-raise: #FFFCF5;        /* 托起的纸 */
  --ink: #2B2620;                /* 松烟墨（原冷蓝 #16213A） */
  --ink-soft: #5C5448;
  --ink-faint: #938879;
  --line: rgba(43, 38, 32, 0.20);
  --line-soft: rgba(43, 38, 32, 0.11);

  /* —— 墨池：演算室保持深墨，略带暖调 —— */
  --vault: #141A1E;
  --vault-2: #1C2429;
  --vault-line: rgba(214, 205, 188, 0.14);
  --vault-text: #D8D2C4;

  /* —— 矿物颜料色相：保留 --hue 流转，但更沉静高级 —— */
  --accent: hsl(var(--hue) 42% 40%);
  --accent-deep: hsl(var(--hue) 46% 30%);
  --accent-soft: hsl(var(--hue) 40% 90%);
  --accent-wash: hsl(var(--hue) 38% 95%);

  /* —— 朱砂（印章 / 点睛，固定色不随 θ 变） —— */
  --cinnabar: #A83224;
  --cinnabar-deep: #8A2519;
  --gold: #9A7B3F;

  --shadow-card: 0 14px 34px rgba(63, 52, 38, 0.11);
}

/* 正文纸面：宣纸纤维 + 极淡帘纹，去掉冷色网格的科技感 */
body {
  background-color: var(--paper);
  background-image:
    radial-gradient(1100px 460px at 50% -180px, hsl(var(--hue) 32% 90% / 0.5), transparent 72%),
    url("../img/grain.svg"),
    linear-gradient(var(--paper-grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--paper-grid) 1px, transparent 1px);
  background-size: auto, 180px 180px, 32px 32px, 32px 32px;
  background-repeat: no-repeat, repeat, repeat, repeat;
}
::selection { background: hsl(var(--hue) 40% 86%); }

/* 导航：宣纸半透，朱砂悬停 */
.site-nav { background: rgba(247, 243, 234, 0.86); }
.nav-links a:hover { background: var(--accent-wash); }
.nav-links a.active { color: var(--accent-deep); background: var(--accent-soft); }
.nav-links .sec { color: var(--accent-deep); opacity: 0.8; }

/* ---------- Hero：水墨山水 + 暗墨蒙版 ---------- */
.hero {
  padding: 104px 24px 116px;
  color: #F6F1E6;
  background:
    linear-gradient(90deg, rgba(14, 19, 23, 0.90) 0%, rgba(16, 21, 25, 0.72) 38%, rgba(18, 24, 28, 0.42) 68%, rgba(14, 19, 23, 0.58) 100%),
    linear-gradient(180deg, rgba(16, 21, 25, 0.45) 0%, transparent 30%, transparent 72%, rgba(14, 19, 23, 0.75) 100%),
    url("../img/ink/hero-mist.webp") center 46% / cover no-repeat;
  border-bottom: 1px solid rgba(168, 50, 36, 0.5);
}
/* Hero 内容区与正文 .page 共用同一条居中基准线（内容宽 1032px） */
.hero-grid {
  max-width: 1032px;
  margin: 0 auto;
}

/* 域着色光晕减弱并移到底部，避免盖住山水 */
.hero::before {
  background: conic-gradient(
    from calc(var(--hue) * 1deg + 24deg) at 84% 78%,
    hsl(0 50% 50% / 0.10), hsl(60 50% 50% / 0.09), hsl(120 50% 50% / 0.08),
    hsl(180 50% 50% / 0.10), hsl(240 50% 50% / 0.09), hsl(300 50% 50% / 0.08),
    hsl(0 50% 50% / 0.10));
  filter: blur(52px);
  opacity: 0.7;
}
.hero::after { opacity: 0.28; }

.hero-eyebrow { color: #C9B9A6; letter-spacing: 5px; }
.hero-eyebrow::before { background: linear-gradient(90deg, var(--cinnabar), transparent); }
.hero-title {
  color: #FBF6EA;
  font-size: clamp(72px, 11vw, 132px);
  letter-spacing: 0.04em;
  line-height: 1.02;
  text-shadow: 0 4px 40px rgba(0, 0, 0, 0.6), 0 1px 0 rgba(255, 245, 225, 0.15);
}
.hero-title .accent-dot {
  color: var(--cinnabar);
  text-shadow: 0 0 28px rgba(168, 50, 36, 0.55);
}
.hero-formula {
  color: #E4D9C4;
  font-size: 19px;
  letter-spacing: 1px;
  padding-left: 2px;
  border-left: 2px solid var(--cinnabar);
  margin: 22px 0 0 2px;
  padding-left: 16px;
}
/* 导语：比说明文字更大更亮，作为首屏二级信息焦点 */
.hero-lead {
  color: #E0D5C2;
  font-size: clamp(16px, 1.5vw, 18px);
  line-height: 1.95;
  max-width: 42em;
  margin-top: 26px;
  text-shadow: 0 2px 12px rgba(0, 0, 0, 0.4);
}
.hero-lead .math { color: #FBF6EA; }
.hero-sub { color: #ADA494; font-size: 14.5px; line-height: 1.85; margin-top: 14px; max-width: 40em; }
.hero-sub strong, .hero-sub b { color: #FBF6EA; }
.hero-sub em { color: hsl(var(--hue) 52% 75%); }
/* 规模数字：带细分隔与发光，成为独立的信息层级 */
.hero-stats {
  color: #9A9182;
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(214, 205, 188, 0.18);
  gap: 30px;
}
.hero-stats b {
  color: hsl(var(--hue) 55% 76%);
  font-size: 22px;
  text-shadow: 0 0 24px hsl(var(--hue) 50% 55% / 0.4);
  margin-right: 6px;
}

/* Hero 印章：竖排朱砂小印 */
.hero-copy { position: relative; }
.hero-seal {
  position: absolute;
  top: -6px;
  right: -6px;
  writing-mode: vertical-rl;
  font-family: var(--f-kai);
  font-size: 15px;
  letter-spacing: 3px;
  line-height: 1.15;
  color: #F6E9E4;
  background: var(--cinnabar);
  padding: 12px 7px 10px;
  border: 1px solid rgba(255, 235, 228, 0.55);
  box-shadow: 0 4px 18px rgba(120, 30, 20, 0.4);
  border-radius: 2px;
  opacity: 0.94;
  transform: rotate(2deg);
  pointer-events: none;
}
@media (max-width: 900px) { .hero-seal { display: none; } }

/* Hero 按钮：朱砂主按钮 + 墨底幽灵按钮 */
.hero .btn {
  background: var(--cinnabar);
  border-color: #C04A38;
  box-shadow: 0 8px 26px -8px rgba(168, 50, 36, 0.6);
}
.hero .btn:hover:not(:disabled) {
  background: var(--cinnabar-deep);
  box-shadow: 0 10px 32px -8px rgba(168, 50, 36, 0.75);
}
.hero .btn--ghost {
  background: rgba(24, 30, 34, 0.5);
  color: #DDD4C4;
  border-color: rgba(214, 205, 188, 0.35);
}
.hero .btn--ghost:hover:not(:disabled) {
  background: rgba(40, 48, 52, 0.72);
  color: #FBF6EA;
  border-color: hsl(var(--hue) 42% 62%);
}

/* 色环画布：外发光收敛，更似一枚玉璧 */
.hero-stage canvas {
  border-radius: 50%;
  box-shadow:
    0 0 0 1px rgba(214, 205, 188, 0.18),
    0 0 70px -14px hsl(var(--hue) 45% 50% / 0.42),
    0 30px 60px -22px rgba(6, 10, 12, 0.85);
}

/* ---------- 章头：淡墨分隔线 + 朱砂章序 ---------- */
.board { margin: 96px auto 24px; }
.board-head { border-bottom: 1px solid var(--line); padding-left: 16px; }
.board-head::after { opacity: 0.5; }
.board-sec { color: var(--cinnabar); font-size: 27px; }
.board-title { letter-spacing: 0.05em; }
.board-new {
  background: var(--cinnabar);
  color: #FBF0E8;
}
.board[data-formula]::before { color: hsl(var(--hue) 32% 40% / 0.06); }
.board-desc { color: var(--ink-soft); }

/* 章头左侧朱砂短竖（题款感） */
.board-head::before {
  content: "";
  position: absolute;
  left: -2px;
  top: 4px;
  bottom: 6px;
  width: 3px;
  background: var(--cinnabar);
  border-radius: 2px;
}

/* ---------- 模块卡片：宣纸卡 + 朱砂顶线 ---------- */
.card {
  background: var(--paper-raise);
  border: 1px solid var(--line-soft);
  border-top: 2px solid hsl(var(--hue) 38% 42%);
  box-shadow: 0 2px 10px rgba(63, 52, 38, 0.04);
}
.card::before { background: linear-gradient(90deg, transparent 8%, var(--cinnabar) 50%, transparent 92%); }
.card::after { background: radial-gradient(circle, hsl(var(--hue) 45% 55% / 0.09), transparent 70%); }
.card:hover { border-color: hsl(var(--hue) 34% 62%); border-top-color: var(--cinnabar); }
.card-tag { color: hsl(var(--hue) 34% 32%); background: hsl(var(--hue) 36% 93%); border-color: hsl(var(--hue) 30% 84%); }
.card-title { letter-spacing: 0.03em; }
.card-desc { color: var(--ink-soft); }
.card-go { color: var(--accent-deep); }
.card:hover .card-go { color: var(--cinnabar); }

/* 定理卡：保持金色左边线，纸面更暖 */
.theorem { background: var(--paper-raise); border-left-color: var(--gold); }
.theorem::before { color: var(--gold); }

/* 引用 / 题跋 */
blockquote { border-left-color: var(--cinnabar); background: hsl(var(--hue) 28% 94%); }

/* ---------- 页脚：深墨 + 水墨横卷 ---------- */
.site-footer {
  border-top: 2px solid rgba(168, 50, 36, 0.55);
  background:
    linear-gradient(180deg, rgba(20, 26, 30, 0.94), rgba(12, 17, 20, 0.97)),
    url("../img/ink/banner-autumn.webp") right -60px top 10px / 760px no-repeat,
    linear-gradient(180deg, #171D21, #0E1316);
}
.footer-brand .mark { color: hsl(var(--hue) 50% 70%); }
.footer-base { border-top-color: var(--vault-line); }

/* ---------- 阅读进度条：朱砂 ---------- */
.read-progress {
  background: linear-gradient(90deg, var(--cinnabar), #D9604A);
  box-shadow: 0 1px 10px rgba(168, 50, 36, 0.4);
}

/* ---------- 首页章节横幅：水墨意象带（每章不同裁切） ---------- */
.section-ink {
  position: relative;
  height: 132px;
  margin: 0 0 26px;
  border-radius: var(--radius-panel);
  overflow: hidden;
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.section-ink img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 38%;
  filter: saturate(0.78) contrast(0.98);
}
.section-ink::after {
  content: attr(data-caption);
  position: absolute;
  left: 24px;
  bottom: 12px;
  font-family: var(--f-kai);
  font-size: 15px;
  letter-spacing: 4px;
  color: #F4EDE0;
  text-shadow: 0 1px 8px rgba(20, 16, 12, 0.8);
}
.section-ink::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(18, 22, 25, 0.55), transparent 62%);
}
@media (max-width: 640px) {
  .section-ink { height: 92px; }
  .section-ink::after { font-size: 13px; left: 16px; bottom: 8px; }
  .hero { padding: 60px 20px 72px; }
}

/* 演算室（砚台）：深色区保留原样，仅细调边框暖度 */
.theater { border-color: var(--vault-line); }
.theater-head { background: linear-gradient(180deg, #1A2227, var(--vault)); }

/* ---------- 品牌标记：朱砂印章 ----------
   导航与页脚的 .mark 由纯文本 ℂ 改为印章图，与 favicon 一致。
   用伪元素承载背景图，原文本缩进隐藏（保留 DOM 文本利于 SEO / 无 CSS 回退）。 */
/* 品牌容器统一为「垂直居中」的 flex：
   原 .brand 用 align-items:baseline，会把印章按文字基线对齐而整体下沉约 18px；
   vertical-align 对 flex 子项无效，故改用 center 并对页脚同样建立 flex 上下文。 */
.brand, .footer-brand {
  display: inline-flex;
  align-items: center;
  font-family: var(--f-display);
  font-weight: 600;
}
.brand { gap: 8px; }
.footer-brand { gap: 8px; }

.brand .mark, .footer-brand .mark {
  position: relative;
  display: inline-block;
  flex: none;
  width: 24px;
  height: 24px;
  overflow: hidden;
  font-size: 0;              /* 隐藏文字 ℂ，保留可访问文本 */
  line-height: 0;
  color: transparent;
  background: none;
  transition: transform 0.2s ease;
}
.brand .mark::before, .footer-brand .mark::before {
  content: "";
  position: absolute;
  inset: 0;
  background: url("../../favicon.svg") center / contain no-repeat;
}
.brand:hover .mark { transform: rotate(-6deg); }


/* ---------- 导航适配：扩展至 §15 后 17 项改用两行网格 ----------
   单行 flex 在 1080px 内容区里已容纳不下 17 项（曾被压成竖排/横向溢出）。
   改为「品牌跨两行 + 导航两行网格」，字号恢复舒适值而非无限压缩。 */
@media (min-width: 1024px) {
  .nav-inner {
    display: grid;
    grid-template-columns: 130px minmax(0, 1fr);
    grid-template-rows: auto auto;
    align-items: center;
    column-gap: 20px;
    row-gap: 1px;
    padding-block: 8px;
  }
  .nav-inner > .brand { grid-column: 1; grid-row: 1 / 3; font-size: 19px; gap: 6px; }
  .nav-toggle { grid-column: 2; }
  /* 搜索按钮脱离 grid 流：nav-inner 是两列网格（品牌+导航），
     作为普通 grid item 会被挤到第三行。绝对定位到右上角，视觉稳定。 */
  .nav-search-btn {
    position: absolute;
    top: 50%; right: max(24px, calc((100vw - var(--w-page)) / 2 + 24px));
    transform: translateY(-50%);
  }
  .nav-links {
    grid-column: 2;
    grid-row: 1 / 3;
    display: grid;
    grid-template-columns: repeat(9, max-content);
    column-gap: 6px;
    row-gap: 0;
    margin-left: 0;
    justify-content: start;
  }
  .nav-links li { min-width: 0; }
  .nav-links a {
    white-space: nowrap;
    padding: 3px 5px;
    font-size: 12px;
    letter-spacing: 0;
  }
  .nav-links .sec { font-size: 10.5px; margin-right: 3px; }
}

/* ---------- 页脚排版优化：对齐 / 间距 / 层级 / 换行 ----------
   原三列 2fr 1fr 1fr + align-items:stretch 导致：
   ① 品牌列 486px 仅用 317px；② 章节列 13 项单列高达 397px，拉高整页脚；
   ③ 精选列 5 项下方留白 276px；④ 平板端第三列孤立在左下。
   优化：按内容收缩列宽、按内容高度对齐、长链接列改双列网格、平板重排。 */
.footer-inner {
  align-items: start;
  grid-template-columns: minmax(220px, 0.95fr) minmax(260px, 1.1fr) minmax(200px, 0.85fr);
  column-gap: 34px;
  row-gap: 36px;
  padding-block: 44px 36px;
}
.footer-inner > div:first-child { padding-top: 2px; }
.footer-note { margin-top: 12px; max-width: 38ch; line-height: 1.7; }

/* 层级：栏目标题加细分隔线，与链接列表拉开距离 */
.footer-col h4 {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--vault-line);
}
.footer-col a { padding: 4px 0; }

/* 换行：长链接列改双列网格，13 项高度减半 */
.footer-col ul {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  column-gap: 16px;
  row-gap: 0;
}

/* 平板：品牌区跨满宽，两个导航列并排，消除孤立第三列 */
@media (max-width: 900px) {
  .footer-inner { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .footer-inner > div:first-child { grid-column: 1 / -1; }
  .footer-note { max-width: 58ch; }
}

/* 手机：单列堆叠，链接仍双列以压缩纵向高度 */
@media (max-width: 640px) {
  .footer-inner {
    grid-template-columns: 1fr;
    row-gap: 28px;
    padding-block: 32px 28px;
  }
  .footer-col ul { column-gap: 12px; }
  .footer-col a { font-size: 13.5px; }
}

/* ============================================================
   视觉深化层：氛围 / 层级 / 节奏 / 质感
   纯装饰性增强，不改变任何功能元素的尺寸与交互区域。
   ============================================================ */

/* 首屏眉题：前置朱砂短划，强化起始感 */
.hero-eyebrow { display: inline-flex; align-items: center; gap: 10px; }
.hero-eyebrow::after {
  content: "";
  width: 46px;
  height: 1px;
  background: linear-gradient(90deg, var(--cinnabar), transparent);
  opacity: 0.75;
}

/* 色环外圈：细刻度环，增玉璧质感（pointer-events:none 不影响拖动） */
.hero-stage { position: relative; }
.hero-stage::before {
  content: "";
  position: absolute;
  inset: -14px;
  border-radius: 50%;
  border: 1px dashed rgba(214, 205, 188, 0.16);
  pointer-events: none;
}
.hero-stage::after {
  content: "";
  position: absolute;
  inset: -26px;
  border-radius: 50%;
  border: 1px solid rgba(214, 205, 188, 0.06);
  pointer-events: none;
}

/* 章头标题确保在装饰线之上 */
.board-head > .board-title { position: relative; z-index: 1; }

/* 卡片：极淡纸纹（radial 点阵，避免 SVG 网格在浅底上过重） */
.card {
  background-image: radial-gradient(circle at 1px 1px, hsl(var(--hue) 20% 40% / 0.035) 1px, transparent 0);
  background-size: 22px 22px;
}
.card::after {
  transition: transform 0.35s ease, opacity 0.35s ease;
  opacity: 0.7;
}
.card:hover::after { transform: scale(1.8); opacity: 1; }
.card:hover {
  box-shadow: 0 16px 40px -16px hsl(var(--hue) 30% 30% / 0.35), 0 0 0 1px hsl(var(--hue) 45% 70% / 0.35);
}

/* 窄屏收起章头曲线水印，避免与标题重叠 */
@media (max-width: 640px) {
  .board[data-formula] > .board-head::after { display: none; }
  .hero-stage::before, .hero-stage::after { inset: -8px; }
  /* 眉题收起尾部短线并减小字距，避免「数学」被挤到第二行 */
  .hero-eyebrow { letter-spacing: 2.5px; font-size: 12px; }
  .hero-eyebrow::after { display: none; }
}

/* ---------- 学习路径：延伸阅读引导条 ----------
   对所有章节首页与模块页的 .related 统一升级，纯装饰，不改结构与链接。 */
.related {
  position: relative;
  margin: 36px 0 16px;
  padding: 16px 20px 16px 26px;
  background: linear-gradient(90deg, hsl(var(--hue) 24% 92% / 0.6), transparent 85%);
  border-left: 3px solid hsl(var(--hue) 45% 52% / 0.65);
  border-radius: 0 var(--radius-panel) var(--radius-panel) 0;
  line-height: 1.8;
}
.related::before {
  content: "延 伸 阅 读";
  display: block;
  font-family: var(--f-kai);
  font-size: 11px;
  letter-spacing: 3px;
  color: hsl(var(--hue) 38% 42%);
  margin-bottom: 6px;
  opacity: 0.85;
}
.related a { text-decoration-thickness: 1px; text-underline-offset: 3px; }
.related a:hover { color: var(--cinnabar); }

@media (max-width: 640px) {
  .related { padding: 14px 16px 14px 20px; margin-top: 28px; font-size: 14px; }
  .related::before { letter-spacing: 2px; }
}

/* ---------- 首页学习路径导览 ---------- */
.learning-path {
  margin: 64px auto 0;
  padding: 26px 30px 24px;
  background: linear-gradient(135deg, hsl(40 30% 97%), hsl(38 24% 94%));
  border: 1px solid var(--line-soft);
  border-top: 3px solid var(--cinnabar);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-card);
}
.lp-head { display: flex; align-items: center; gap: 16px; margin-bottom: 20px; }
.lp-mark {
  flex: none;
  display: grid; place-items: center;
  width: 42px; height: 42px;
  font-family: var(--f-kai); font-size: 22px;
  color: #FBF0E8; background: var(--cinnabar);
  border-radius: 3px;
  box-shadow: 0 3px 12px -3px rgba(168, 50, 36, 0.5);
}
.lp-head h2 { margin: 0 0 3px; font-size: 19px; letter-spacing: 1px; color: var(--ink); }
.lp-head p { margin: 0; font-size: 12.5px; color: var(--ink-soft); }
.lp-lines { list-style: none; margin: 0; padding: 0; display: grid; grid-template-columns: repeat(2, 1fr); gap: 12px 26px; }
.lp-line {
  display: flex; align-items: center; flex-wrap: wrap; gap: 7px;
  padding: 12px 0;
  border-top: 1px dashed var(--line);
}
.lp-label {
  flex: none;
  font-family: var(--f-kai); font-size: 12px; letter-spacing: 2px;
  color: #FBF0E8; background: hsl(var(--hue, 222) 30% 40%);
  padding: 4px 9px; border-radius: 2px; margin-right: 4px;
}
.lp-line:nth-child(1) .lp-label { background: #3E5A8A; }
.lp-line:nth-child(2) .lp-label { background: #2F6E63; }
.lp-line:nth-child(3) .lp-label { background: #6E5A8A; }
.lp-line:nth-child(4) .lp-label { background: var(--cinnabar); }
.lp-line a {
  font-size: 13px; color: var(--ink);
  text-decoration: none;
  padding: 4px 9px;
  border: 1px solid var(--line-soft);
  border-radius: 20px;
  background: var(--paper-raise);
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease, transform var(--dur-fast) ease;
}
.lp-line a:hover { color: var(--cinnabar); border-color: var(--cinnabar); transform: translateY(-2px); }

@media (max-width: 760px) {
  .learning-path { margin-top: 40px; padding: 20px 18px; }
  .lp-lines { grid-template-columns: 1fr; gap: 0; }
  .lp-line { padding: 12px 0; }
  .lp-head h2 { font-size: 17px; }
}

/* ============================================================
   微课程组件：预测 / 自测（纯静态教学闭环）
   复用 --hue / 宣纸 / 朱砂变量；不引入任何新资源。
   ============================================================ */
.micro {
  position: relative;
  margin: 28px 0;
  padding: 20px 24px 22px;
  background: linear-gradient(135deg, hsl(var(--hue) 22% 96%), hsl(var(--hue) 18% 93%));
  border: 1px solid var(--line-soft);
  border-left: 3px solid hsl(var(--hue) 48% 48%);
  border-radius: var(--radius-panel);
}
.micro[data-kind="predict"] { border-left-style: dashed; }
.micro-head { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; flex-wrap: wrap; }
.micro-badge {
  font-family: var(--f-kai); font-size: 12px; letter-spacing: 2px;
  color: #FBF0E8; background: hsl(var(--hue) 42% 40%);
  padding: 5px 11px; border-radius: 2px;
}
.micro[data-kind="check"] .micro-badge { background: var(--cinnabar); }
.micro-title { font-size: 12.5px; color: var(--ink-faint); }
.micro-q { margin: 0 0 14px; font-size: 15.5px; line-height: 1.7; color: var(--ink); font-weight: 500; }
.micro-options { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; }
.micro-option {
  text-align: left;
  font-family: inherit; font-size: 14px; line-height: 1.5;
  color: var(--ink); background: var(--paper-raise);
  border: 1px solid var(--line-soft); border-radius: 6px;
  padding: 10px 13px; cursor: pointer;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease, transform 0.12s ease;
}
.micro-option:hover:not(:disabled) { border-color: hsl(var(--hue) 48% 52%); transform: translateY(-1px); }
.micro-option:focus-visible { outline: 2px solid hsl(var(--hue) 55% 50%); outline-offset: 2px; }
.micro-option:disabled { cursor: default; opacity: 0.92; }
.micro-option.is-correct { background: hsl(150 45% 92%); border-color: hsl(150 45% 45%); color: hsl(150 55% 28%); }
.micro-option.is-wrong { background: hsl(0 45% 94%); border-color: hsl(0 50% 55%); color: hsl(0 55% 40%); }
.micro-feedback { margin-top: 14px; font-size: 13.5px; line-height: 1.7; color: var(--ink-soft); }
.micro-feedback:empty { display: none; }
.micro-feedback b { color: var(--ink); }
.micro-feedback.is-pending { padding: 10px 14px; background: hsl(var(--hue) 20% 91%); border-radius: 5px; }
.micro-feedback.is-right { padding: 10px 14px; background: hsl(150 40% 92%); border-left: 3px solid hsl(150 45% 45%); border-radius: 3px; }
.micro-feedback.is-wrong { padding: 10px 14px; background: hsl(0 38% 95%); border-left: 3px solid hsl(0 50% 55%); border-radius: 3px; }
.micro-retry {
  display: inline-block; margin-left: 10px;
  font-family: inherit; font-size: 12px; color: var(--cinnabar);
  background: none; border: 1px solid var(--cinnabar);
  border-radius: 4px; padding: 3px 10px; cursor: pointer;
}
.micro-retry:hover { background: var(--cinnabar); color: #FBF0E8; }
@media (max-width: 640px) {
  .micro { padding: 16px 16px 18px; margin: 22px 0; }
  .micro-options { grid-template-columns: 1fr; }
  .micro-q { font-size: 14.5px; }
}

/* ============================================================
   数学大图景：按思想而非章节组织的横切页面
   ============================================================ */
.bigpicture { --hue: 288; }

.bp-hero {
  position: relative;
  margin: 40px 0 64px;
  padding: 56px 48px 50px;
  background:
    linear-gradient(120deg, rgba(30, 26, 44, 0.94), rgba(44, 34, 58, 0.86)),
    url("img/ink/hero-mist.webp") center 40% / cover no-repeat;
  border-bottom: 3px solid var(--cinnabar);
  border-radius: var(--radius-panel);
  color: #F6F1E6;
  overflow: hidden;
}
.bp-seal {
  position: absolute; top: 30px; right: 38px;
  writing-mode: vertical-rl;
  font-family: var(--f-kai); font-size: 18px; letter-spacing: 6px;
  color: #FBEDE6; background: var(--cinnabar);
  padding: 14px 9px; border: 1px solid rgba(255,235,228,0.5);
  box-shadow: 0 4px 18px -4px rgba(120,30,20,0.6);
  transform: rotate(3deg); opacity: 0.95;
}
.bp-eyebrow { color: #C9B9A6; letter-spacing: 6px; font-size: 12px; margin: 0 0 10px; }
.bp-title {
  color: #FBF6EA; font-family: var(--f-kai);
  font-size: clamp(40px, 6vw, 72px); letter-spacing: 0.06em;
  margin: 0 0 24px; line-height: 1.1;
  text-shadow: 0 3px 30px rgba(0,0,0,0.5);
}
.bp-title .accent-dot { color: var(--cinnabar); }
.bp-lead { max-width: 46em; font-size: 17px; line-height: 2; color: #E0D5C2; margin: 0; }
.bp-lead strong { color: #FBF6EA; }
.bp-lead em { color: hsl(45 70% 72%); font-style: normal; }
.bp-note { margin: 20px 0 0; font-size: 13px; color: #A99F8E; }

.bp-thread {
  margin: 0 0 72px;
  padding: 34px 38px 36px;
  background: var(--paper-raise);
  border: 1px solid var(--line-soft);
  border-left: 4px solid hsl(var(--thread-hue) 52% 52%);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-card);
}
.bp-thread-head { display: flex; align-items: center; gap: 18px; margin-bottom: 18px; }
.bp-num {
  font-family: var(--f-math); font-size: 40px; line-height: 1;
  color: hsl(var(--thread-hue) 48% 55%); opacity: 0.5;
}
.bp-sub { margin: 0 0 2px; font-size: 11px; letter-spacing: 3px; color: hsl(var(--thread-hue) 40% 45%); }
.bp-thread-title {
  margin: 0; font-family: var(--f-kai);
  font-size: clamp(28px, 4vw, 40px); letter-spacing: 4px; color: var(--ink);
}
.bp-thread-lead { font-size: 16.5px; line-height: 1.85; color: var(--ink); margin: 0 0 14px; font-weight: 500; }
.bp-insight {
  font-size: 14.5px; line-height: 2; color: var(--ink-soft);
  padding: 4px 0 4px 18px;
  border-left: 2px solid hsl(var(--thread-hue) 40% 70%);
  margin: 0 0 26px;
}
.bp-links { display: flex; flex-wrap: wrap; gap: 10px; }
.bp-link {
  display: inline-flex; align-items: center; gap: 8px;
  font-size: 13.5px; color: var(--ink); text-decoration: none;
  background: hsl(var(--thread-hue) 20% 96%);
  border: 1px solid hsl(var(--thread-hue) 30% 82%);
  border-radius: 22px; padding: 8px 13px;
  transition: transform var(--dur-fast) ease, border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.bp-link:hover {
  transform: translateY(-2px);
  background: hsl(var(--thread-hue) 32% 92%);
  border-color: hsl(var(--thread-hue) 48% 55%);
}
.bp-dot { width: 6px; height: 6px; border-radius: 50%; background: hsl(var(--thread-hue) 52% 52%); flex: none; }
.bp-arrow { color: hsl(var(--thread-hue) 45% 50%); font-size: 12px; }

.bp-closing {
  margin: 20px 0 64px;
  padding: 40px 44px;
  text-align: center;
  background: linear-gradient(135deg, hsl(288 24% 96%), hsl(40 30% 96%));
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-panel);
}
.bp-closing h2 { font-family: var(--f-kai); font-size: 30px; letter-spacing: 3px; margin: 0 0 18px; color: var(--ink); }
.bp-closing p { max-width: 40em; margin: 0 auto; font-size: 15.5px; line-height: 2; color: var(--ink-soft); }
.bp-closing strong { color: var(--ink); }
.bp-back { margin-top: 28px; }

@media (max-width: 720px) {
  .bp-hero { padding: 40px 24px 36px; margin: 24px 0 40px; }
  .bp-seal { display: none; }
  .bp-lead { font-size: 15px; }
  .bp-thread { padding: 24px 20px 26px; margin-bottom: 44px; }
  .bp-insight { padding-left: 12px; }
  .bp-links { gap: 8px; }
  .bp-closing { padding: 30px 22px; }
}

/* 首页大图景入口横幅 */
.bp-teaser {
  margin: 56px auto 0;
  padding: 0;
  background: linear-gradient(100deg, hsl(288 30% 20%), hsl(288 28% 30%));
  border-bottom: 3px solid var(--cinnabar);
  border-radius: var(--radius-panel);
  box-shadow: var(--shadow-card);
  overflow: hidden;
}
.bp-teaser-inner { display: flex; align-items: center; gap: 24px; padding: 30px 36px; }
.bp-teaser-mark {
  flex: none; display: grid; place-items: center;
  width: 58px; height: 58px;
  font-family: var(--f-kai); font-size: 30px; color: #FBEDE6;
  background: var(--cinnabar); border: 1px solid rgba(255,235,228,0.5);
  border-radius: 3px; box-shadow: 0 4px 16px -4px rgba(120,30,20,0.6);
}
.bp-teaser-copy { flex: 1; }
.bp-teaser-eyebrow { margin: 0 0 4px; font-size: 11px; letter-spacing: 4px; color: #B9AFC6; }
.bp-teaser h2 { margin: 0 0 6px; font-family: var(--f-kai); font-size: 26px; letter-spacing: 3px; color: #FBF6EA; }
.bp-teaser-copy p:last-child { margin: 0; font-size: 13.5px; line-height: 1.7; color: #CFC5DA; }
.bp-teaser .btn { flex: none; background: var(--cinnabar); border-color: #C04A38; }
@media (max-width: 640px) {
  .bp-teaser-inner { flex-wrap: wrap; gap: 16px; padding: 22px 20px; }
  .bp-teaser-mark { width: 46px; height: 46px; font-size: 24px; }
  .bp-teaser h2 { font-size: 21px; }
  .bp-teaser .btn { width: 100%; }
}

/* ============================================================
   现实映照组件：把抽象概念钉到真实事物上（纯静态，零图片）
   ============================================================ */
.reality {
  position: relative;
  margin: 26px 0;
  padding: 20px 24px 22px;
  background: linear-gradient(120deg, hsl(165 28% 95%), hsl(160 20% 92%));
  border: 1px solid hsl(160 28% 80%);
  border-radius: var(--radius-panel);
  box-shadow: 0 2px 10px rgba(40, 80, 70, 0.04);
  overflow: hidden;
}
.reality::before {
  content: ""; position: absolute; top: -30px; right: -30px;
  width: 110px; height: 110px; border-radius: 50%;
  background: radial-gradient(circle, hsl(160 40% 55% / 0.12), transparent 70%);
  pointer-events: none;
}
.reality-badge { display: flex; align-items: center; gap: 10px; margin-bottom: 12px; }
.reality-icon {
  display: grid; place-items: center;
  width: 30px; height: 30px; flex: none;
  font-family: var(--f-math); font-size: 17px;
  color: #F6FBF8; background: hsl(162 42% 38%);
  border-radius: 50%;
  box-shadow: 0 2px 8px -2px hsl(162 42% 30% / 0.5);
}
.reality-label {
  font-family: var(--f-kai); font-size: 12px; letter-spacing: 3px;
  color: hsl(162 42% 32%);
}
.reality-lead {
  margin: 0 0 14px; font-size: 15.5px; line-height: 1.85;
  color: var(--ink); font-weight: 500;
}
.reality-scenes { display: flex; flex-wrap: wrap; gap: 8px; }
.reality-scene {
  font-size: 12.5px; line-height: 1.5;
  color: hsl(162 45% 28%);
  background: hsl(160 30% 97%);
  border: 1px solid hsl(160 30% 82%);
  border-radius: 4px;
  padding: 6px 10px;
}
@media (max-width: 640px) {
  .reality { padding: 16px 16px 18px; margin: 22px 0; }
  .reality-lead { font-size: 14.5px; }
  .reality-scene { font-size: 12px; }
}

/* ============================================================
   参数快照分享按钮
   ============================================================ */
[data-snapshot-button] { margin: 18px 0 4px; }
.snap-btn {
  font-family: inherit;
  font-size: 13.5px;
  color: var(--cinnabar);
  background: hsl(8 40% 97%);
  border: 1px solid hsl(8 45% 78%);
  border-radius: 6px;
  padding: 9px 16px;
  cursor: pointer;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease, transform 0.12s ease;
}
.snap-btn:hover { background: hsl(8 45% 94%); border-color: var(--cinnabar); transform: translateY(-1px); }
.snap-btn:focus-visible { outline: 2px solid var(--cinnabar); outline-offset: 2px; }
.snap-btn.is-done { color: #2E7D5B; background: hsl(150 40% 94%); border-color: hsl(150 45% 65%); }

/* ============================================================
   中国风点睛元素 · 回纹 / 卷次 / 闲章 / 压角章 / 竖排题款
   —— 沿用宣纸·松烟·朱砂·留白体系，新增传统符号但不改布局骨架
   ============================================================ */

/* ① 回纹分隔：章头下方的雷纹带（用 board::after，不占用 board-head::before 的朱砂短竖） */
.board[data-formula]::after {
  content: "";
  position: absolute;
  top: 58px;
  left: 16px;
  width: min(300px, 55%);
  height: 16px;
  background: url("../img/leiwen.svg") left center / contain no-repeat;
  opacity: 0.9;
  pointer-events: none;
}
@media (max-width: 640px) {
  .board[data-formula]::after { top: 52px; width: 170px; height: 12px; }
}

/* ② 卷次题款：标题右侧的「卷一/卷二…」，水平小楷并虚线分隔 */
.juan {
  font-family: var(--f-kai);
  font-size: 14px;
  letter-spacing: 3px;
  color: var(--ink-faint);
  white-space: nowrap;
  padding-left: 14px;
  border-left: 1px solid var(--line);
  align-self: center;
}
@media (max-width: 640px) { .juan { font-size: 12px; padding-left: 10px; letter-spacing: 1px; } }

/* ③ Hero 闲章：与「複數」名章形成书画传统里的名章+闲章 */
.hero-xianczhang {
  position: absolute;
  right: 4%;
  bottom: 8%;
  writing-mode: vertical-rl;
  font-family: var(--f-kai);
  font-size: 13px;
  letter-spacing: 5px;
  line-height: 1.2;
  color: rgba(246, 233, 228, 0.9);
  background: var(--cinnabar);
  padding: 14px 8px 12px;
  border: 1px solid rgba(255, 235, 228, 0.5);
  border-radius: 2px;
  box-shadow: 0 4px 18px rgba(120, 30, 20, 0.4);
  opacity: 0.88;
  transform: rotate(-3deg);
  pointer-events: none;
}
@media (max-width: 900px) { .hero-xianczhang { display: none; } }

/* ④ 页脚压角章：落款感的小印 */
.footer-seal {
  display: inline-grid;
  place-items: center;
  vertical-align: middle;
  width: 30px;
  height: 30px;
  margin-left: 10px;
  font-family: var(--f-kai);
  font-size: 13px;
  line-height: 1;
  color: #F6E9E4;
  background: var(--cinnabar);
  border: 1px solid rgba(255, 235, 228, 0.55);
  border-radius: 2px;
  transform: rotate(4deg);
  box-shadow: 0 2px 8px rgba(120, 30, 20, 0.3);
}
.footer-seal span { writing-mode: vertical-rl; letter-spacing: 0; }

/* ⑤ 竖排题款：水墨横幅的 caption 移到右下，如立轴题跋 */
.section-ink::after {
  left: auto;
  right: 22px;
  bottom: 16px;
  writing-mode: vertical-rl;
  letter-spacing: 6px;
  font-size: 14px;
  padding-left: 8px;
  border-left: 1px solid rgba(244, 237, 224, 0.45);
}
@media (max-width: 640px) {
  .section-ink::after { right: 12px; bottom: 12px; font-size: 12px; }
}

/* ============================================================
   全站搜索 · 宣纸面板 / 朱砂高亮（零依赖，风格沿用设计令牌）
   ============================================================ */
.nav-search-btn {
  /* 紧跟 .nav-links 之后：由 nav-links 的 margin-left:auto 把它带到右侧控制区。
     自身不再用 auto margin，避免与 nav-links 竞争导致换行时掉到第二行。 */
  margin-left: 2px;
  margin-right: 2px;
  flex: 0 0 auto;
  width: 34px; height: 34px;
  display: grid; place-items: center;
  background: transparent;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  color: var(--ink-soft);
  font-family: var(--f-kai);
  font-size: 20px;
  line-height: 1;
  cursor: pointer;
  transition: color var(--dur-fast) ease, border-color var(--dur-fast) ease, background-color var(--dur-fast) ease;
}
.nav-search-btn:hover { color: var(--cinnabar); border-color: var(--cinnabar); background: var(--paper-raise); }
body.fs-search-open { overflow: hidden; }

.fs-search-panel { position: fixed; inset: 0; z-index: 200; display: none; }
.fs-search-panel.open { display: block; }
.fs-search-backdrop { position: absolute; inset: 0; background: rgba(28, 24, 20, 0.55); }
.fs-search-box {
  position: relative;
  width: min(640px, calc(100vw - 32px));
  max-height: min(70vh, 620px);
  margin: 12vh auto 0;
  display: flex; flex-direction: column;
  background: var(--paper-raise);
  border: 1px solid var(--line);
  border-radius: var(--radius-panel);
  box-shadow: 0 24px 64px rgba(43, 38, 32, 0.28);
  overflow: hidden;
}
.fs-search-field { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line-soft); }
.fs-search-icon { font-family: var(--f-kai); font-size: 24px; color: var(--cinnabar); line-height: 1; }
.fs-search-field input {
  flex: 1; min-width: 0;
  font-family: var(--f-body); font-size: 16px;
  color: var(--ink); background: transparent;
  border: 0; outline: none;
}
.fs-search-field input::placeholder { color: var(--ink-faint); }
.fs-search-close {
  border: 0; background: transparent;
  color: var(--ink-faint); font-size: 24px; line-height: 1;
  cursor: pointer; padding: 0 4px;
}
.fs-search-close:hover { color: var(--cinnabar); }
.fs-search-meta {
  display: flex; justify-content: space-between; align-items: center;
  gap: 10px; padding: 8px 16px;
  font-size: 12px; color: var(--ink-faint);
  border-bottom: 1px solid var(--line-soft);
}
.fs-search-hint { font-family: var(--f-mono); font-size: 11px; }
.fs-search-list { list-style: none; margin: 0; padding: 6px; overflow-y: auto; }
.fs-search-list li {
  position: relative;
  padding: 10px 12px 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  border-left: 2px solid transparent;
}
.fs-search-list li.active, .fs-search-list li:hover {
  background: var(--accent-wash);
  border-left-color: var(--cinnabar);
}
.fs-search-badge {
  display: inline-block;
  font-family: var(--f-kai); font-size: 11px;
  color: var(--cinnabar);
  background: rgba(168, 50, 36, 0.08);
  border-radius: 2px;
  padding: 1px 6px;
  margin-right: 8px;
}
.fs-search-title { font-size: 14px; color: var(--ink); font-weight: 500; }
.fs-search-desc { display: block; font-size: 12px; color: var(--ink-soft); margin-top: 3px; line-height: 1.5; }
.fs-search-empty { text-align: center; color: var(--ink-faint); padding: 24px !important; cursor: default !important; }
@media (max-width: 640px) {
  .fs-search-box { margin-top: 6vh; width: calc(100vw - 18px); max-height: 82vh; }
  .fs-search-hint { display: none; }
  .nav-search-btn { margin-right: 6px; }
}
