/* ============================================================
   微积分 · 一部由问题写成的历史
   一场以数学家原始问题为索引的微积分导读
   设计：纸面 + 普鲁士蓝铜版刻线
   ============================================================ */

/* ---------- 字体：本地自托管，按实际用字子集化 ---------- */
@font-face {
  font-family: "Atlas Serif";
  src: url("fonts/serif-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atlas Serif";
  src: url("fonts/serif-700.woff2") format("woff2");
  font-weight: 700;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atlas Sans";
  src: url("fonts/sans-400.woff2") format("woff2");
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: "Atlas Sans";
  src: url("fonts/sans-600.woff2") format("woff2");
  font-weight: 600;
  font-style: normal;
  font-display: swap;
}

/* ---------- 设计变量 ---------- */
:root {
  --paper: #faf7f0;
  --paper-2: #f1ece0;
  --paper-3: #e6e0d1;
  --panel: #f7f3e9;
  --ink: #16140f;
  --ink-2: #555044;
  --ink-3: #8a8375;
  --prussian: #17395c;
  --prussian-ink: #0e2438;
  --field: #14202b;
  --field-ink: #ece6d8;
  --field-ink-2: #9aa8b3;
  --accent-line: #17395c;
  --fig-fill: rgba(23, 57, 92, 0.07);
  --fig-fill-2: rgba(23, 57, 92, 0.16);

  --serif: "Atlas Serif", "Songti SC", "Noto Serif CJK SC", "Source Han Serif SC", serif;
  --sans: "Atlas Sans", "PingFang SC", "Noto Sans CJK SC", "Source Han Sans SC", system-ui, sans-serif;

  --wrap: 1240px;
  --gutter: clamp(20px, 5vw, 64px);
  --measure: 40rem;

  --ease: cubic-bezier(0.16, 1, 0.3, 1);
}

/* ---------- 基础 ---------- */
*,
*::before,
*::after {
  box-sizing: border-box;
}

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

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--sans);
  font-size: 17px;
  line-height: 1.85;
  font-feature-settings: "tnum" 0;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--prussian);
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.22em;
  text-decoration-color: rgba(23, 57, 92, 0.35);
}

a:hover {
  text-decoration-color: var(--prussian);
}

::selection {
  background: rgba(23, 57, 92, 0.16);
}

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

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: var(--gutter);
}

.narrow {
  max-width: 46rem;
}

/* ---------- 顶部导航 ---------- */
.nav {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--paper);
  box-shadow: 0 14px 24px -26px rgba(22, 20, 15, 0.85); /* taste-skill-ignore 固定导航条是允许有阴影的真实浮层 */
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding-block: 15px;
}

.nav-brand {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.02rem;
  letter-spacing: 0.01em;
  color: var(--ink);
  text-decoration: none;
  white-space: nowrap;
}

.nav-brand span {
  color: var(--ink-3);
  font-weight: 400;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: clamp(14px, 2.2vw, 30px);
  font-size: 0.92rem;
}

.nav-links a {
  color: var(--ink-2);
  text-decoration: none;
  white-space: nowrap;
}

.nav-links a:hover,
.nav-links a[aria-current="page"] {
  color: var(--prussian);
}

.nav-progress {
  position: absolute;
  left: 0;
  bottom: 0;
  height: 3px;
  width: 0;
  background: var(--prussian);
}

/* ---------- 首页：开篇 ---------- */
.hero {
  padding-block: clamp(48px, 8vw, 104px) clamp(56px, 8vw, 112px);
}

.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.02fr) minmax(0, 0.98fr);
  gap: clamp(32px, 5vw, 72px);
  align-items: end;
}

.hero-line {
  font-family: var(--serif);
  font-size: 1rem;
  color: var(--ink-2);
  margin: 0 0 clamp(18px, 2.4vw, 30px);
  max-width: 26ch;
}

.hero h1 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2.5rem, 6.1vw, 4.7rem);
  line-height: 1.06;
  letter-spacing: -0.02em;
  margin: 0 0 clamp(20px, 2.6vw, 30px);
  text-wrap: balance;
}

.hero-sub {
  font-size: clamp(1.02rem, 1.35vw, 1.18rem);
  line-height: 1.75;
  color: var(--ink-2);
  max-width: 34ch;
  margin: 0 0 clamp(26px, 3vw, 38px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px 26px;
}

.btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 14px 26px;
  background: var(--prussian);
  color: var(--paper);
  font-family: var(--sans);
  font-size: 0.98rem;
  font-weight: 600;
  text-decoration: none;
  transition: transform 260ms var(--ease), background-color 200ms linear;
}

.btn:hover {
  background: var(--prussian-ink);
  transform: translateY(-2px);
}

.btn-quiet {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--ink);
  font-size: 0.98rem;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.28em;
  text-decoration-color: rgba(22, 20, 15, 0.3);
}

.btn-quiet:hover {
  text-decoration-color: var(--ink);
}

.hero-figure {
  position: relative;
  margin: 0;
}

.hero-figure svg {
  display: block;
  width: 100%;
  height: auto;
}

.narrow-only {
  display: none;
}

.hero-caption {
  font-size: 0.84rem;
  line-height: 1.6;
  color: var(--ink-3);
  max-width: 34ch;
  margin: 14px 0 0;
}

/* ---------- 通用小节 ---------- */
.section {
  padding-block: clamp(64px, 9vw, 132px);
}

.section-tight {
  padding-block: clamp(48px, 6vw, 88px);
}

.field-dark {
  background: var(--field);
  color: var(--field-ink);
}

.field-dark a {
  color: var(--field-ink);
  text-decoration-color: rgba(236, 230, 216, 0.4);
}

.field-tone {
  background: var(--paper-2);
}

h2.section-head {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.75rem, 3.4vw, 2.7rem);
  line-height: 1.16;
  letter-spacing: -0.015em;
  margin: 0 0 clamp(18px, 2.2vw, 26px);
  max-width: 22ch;
}

.section-intro {
  font-size: clamp(1rem, 1.25vw, 1.1rem);
  line-height: 1.8;
  color: var(--ink-2);
  max-width: 42ch;
  margin: 0 0 clamp(34px, 4.5vw, 56px);
}

.field-dark .section-intro {
  color: var(--field-ink-2);
}

/* ---------- 首页：方法说明（三栏错落） ---------- */
.method-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 64px);
  align-items: start;
}

.method-statement {
  font-family: var(--serif);
  font-size: clamp(1.35rem, 2.1vw, 1.72rem);
  line-height: 1.6;
  margin: 0 0 26px;
  max-width: 30ch;
}

.method-body p {
  margin: 0 0 1.1em;
  max-width: 40ch;
  color: var(--ink-2);
}

.method-body p strong {
  color: var(--ink);
  font-weight: 600;
}

/* ---------- 人物索引（交互） ---------- */
.index-figure {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(0, 1fr);
  gap: clamp(28px, 4vw, 60px);
  align-items: start;
}

.people-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  margin: 0 0 8px;
  padding: 0;
  list-style: none;
}

.people-list button {
  font: inherit;
  font-size: 0.95rem;
  color: var(--field-ink);
  background: transparent;
  border: 0;
  padding: 7px 14px;
  cursor: pointer;
  transition: background-color 200ms linear, color 200ms linear, transform 220ms var(--ease);
}

.people-list button:hover {
  background: rgba(236, 230, 216, 0.14);
  transform: translateY(-1px);
}

.people-list button[aria-pressed="true"] {
  background: var(--field-ink);
  color: var(--field);
}

.people-list .era {
  font-family: var(--serif);
  font-size: 0.82rem;
  color: var(--field-ink-2);
  align-self: center;
  padding-inline: 6px 2px;
  width: 100%;
  margin-top: 14px;
}

.people-panel {
  background: rgba(236, 230, 216, 0.06);
  padding: clamp(24px, 3vw, 38px);
  min-height: 340px;
}

.panel-year {
  font-family: var(--serif);
  font-size: clamp(2.4rem, 4.4vw, 3.4rem);
  line-height: 1;
  color: var(--field-ink-2);
  margin: 0 0 10px;
  letter-spacing: -0.03em;
}

.panel-name {
  font-family: var(--serif);
  font-size: clamp(1.4rem, 2.2vw, 1.85rem);
  line-height: 1.3;
  margin: 0 0 6px;
  color: var(--field-ink);
}

.panel-what {
  font-size: 0.92rem;
  color: var(--field-ink-2);
  margin: 0 0 18px;
}

.panel-question {
  font-size: 1.02rem;
  line-height: 1.8;
  color: var(--field-ink);
  margin: 0 0 20px;
  max-width: 34ch;
}

.panel-link {
  font-size: 0.95rem;
  font-weight: 600;
  color: var(--field-ink);
}

/* ---------- 主页课程列表 ---------- */
.course-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

.course-row {
  display: grid;
  grid-template-columns: minmax(0, 15rem) minmax(0, 1fr) 11rem;
  gap: clamp(18px, 3vw, 44px);
  align-items: baseline;
  padding: clamp(24px, 3vw, 36px) clamp(10px, 1.4vw, 20px);
  text-decoration: none;
  color: inherit;
  transition: background-color 240ms linear;
}

.course-row:hover {
  background: var(--paper-2);
}

.course-row .c-name {
  font-family: var(--serif);
  font-size: clamp(1.42rem, 2.5vw, 2.05rem);
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: -0.01em;
}

.course-row .c-desc {
  font-size: 0.98rem;
  line-height: 1.82;
  color: var(--ink-2);
  max-width: 44ch;
}

.course-row .c-meta {
  font-size: 0.86rem;
  line-height: 1.75;
  color: var(--ink-3);
  text-align: right;
  white-space: nowrap;
}

/* 待写书架 */
.shelf {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: clamp(16px, 2.4vw, 32px);
}

.shelf li {
  font-size: 0.94rem;
  line-height: 1.7;
  color: var(--field-ink-2);
}

.shelf strong {
  display: block;
  font-family: var(--serif);
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--field-ink);
  margin-bottom: 4px;
}

@media (max-width: 1080px) {
  .course-row {
    grid-template-columns: minmax(0, 1fr);
    row-gap: 8px;
  }

  .course-row .c-meta {
    text-align: left;
  }
}

/* ---------- 章节地图 ---------- */
.chapter-map {
  margin: 0;
  padding: 0;
  list-style: none;
}

.chapter-row {
  display: grid;
  grid-template-columns: 7rem minmax(0, 1.2fr) minmax(0, 1fr) 12rem;
  gap: clamp(12px, 2vw, 32px);
  align-items: baseline;
  padding-block: clamp(20px, 2.4vw, 30px);
  text-decoration: none;
  color: inherit;
  transition: background-color 240ms linear;
}

.chapter-row:hover {
  background: var(--paper-2);
}

.chapter-row .row-num {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--ink-3);
}

.chapter-row .row-title {
  font-family: var(--serif);
  font-size: clamp(1.15rem, 1.7vw, 1.42rem);
  line-height: 1.4;
  font-weight: 700;
}

.chapter-row .row-question {
  font-size: 0.95rem;
  line-height: 1.7;
  color: var(--ink-2);
}

.chapter-row .row-who {
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--ink-3);
  text-align: right;
}

/* ---------- 三条路线 ---------- */
.routes {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: clamp(20px, 3vw, 40px);
}

.route h3 {
  font-family: var(--serif);
  font-size: 1.25rem;
  margin: 0 0 10px;
  line-height: 1.4;
}

.route p {
  font-size: 0.96rem;
  line-height: 1.8;
  color: var(--field-ink-2);
  margin: 0 0 14px;
  max-width: 30ch;
}

.route .route-chapters {
  font-size: 0.9rem;
  color: var(--field-ink-2);
  line-height: 1.8;
}

.route .route-chapters a {
  text-decoration-color: rgba(236, 230, 216, 0.35);
}

/* ---------- 约定 ---------- */
.conventions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: clamp(20px, 3vw, 44px);
}

.convention h3 {
  font-family: var(--serif);
  font-size: 1.1rem;
  margin: 0 0 8px;
}

.convention p {
  margin: 0;
  font-size: 0.95rem;
  line-height: 1.8;
  color: var(--ink-2);
}

/* ---------- 页脚 ---------- */
.footer {
  padding-block: clamp(56px, 7vw, 96px) clamp(28px, 4vw, 48px);
}

.footer-mark {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2rem, 6.4vw, 5.4rem);
  line-height: 1;
  letter-spacing: -0.03em;
  margin: 0 0 clamp(26px, 3vw, 40px);
  color: var(--field-ink);
}

.footer-cols {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: clamp(20px, 3vw, 48px);
  font-size: 0.9rem;
  line-height: 1.8;
  color: var(--field-ink-2);
}

.footer-cols p {
  margin: 0 0 0.6em;
  max-width: 40ch;
}

/* ============================================================
   章节页
   ============================================================ */
.chapter {
  padding-block: clamp(28px, 4vw, 52px) clamp(40px, 6vw, 72px);
}

.ch-label {
  font-family: var(--serif);
  font-size: 0.95rem;
  color: var(--ink-3);
  margin: 0 0 14px;
  display: flex;
  gap: 14px;
  align-items: baseline;
}

.ch-label .ch-era {
  color: var(--ink-3);
}

.ch-title {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(2rem, 4.6vw, 3.5rem);
  line-height: 1.12;
  letter-spacing: -0.02em;
  margin: 0 0 clamp(18px, 2.2vw, 26px);
  max-width: 24ch;
}

.ch-deck {
  font-size: clamp(1.02rem, 1.35vw, 1.16rem);
  line-height: 1.82;
  color: var(--ink-2);
  max-width: 44ch;
  margin: 0;
}

.ch-hero-band {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(28px, 4vw, 60px);
  align-items: end;
  padding-bottom: clamp(28px, 4vw, 48px);
}

.ch-hero-band:not(:has(> figure)) {
  grid-template-columns: minmax(0, 1fr);
}

.ch-hero-band:not(:has(> figure)) .ch-deck {
  max-width: 50ch;
}

.ch-hero-band:not(:has(> figure)) .ch-meta {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  max-width: 54rem;
}

.ch-meta {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 14px 20px;
  padding-top: 18px;
  margin-top: 26px;
}

.ch-meta div {
  font-size: 0.88rem;
  line-height: 1.6;
  color: var(--ink-2);
}

.ch-meta strong {
  display: block;
  font-family: var(--serif);
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--ink);
  margin-bottom: 2px;
}

/* 章内双栏：左轨道 + 正文 */
.ch-body {
  display: grid;
  grid-template-columns: 13.5rem minmax(0, 1fr);
  gap: clamp(24px, 4vw, 72px);
  align-items: start;
  padding-block: clamp(32px, 5vw, 64px);
}

.rail {
  position: sticky;
  top: 84px;
  font-size: 0.88rem;
  line-height: 1.65;
  color: var(--ink-2);
}

.rail-title {
  font-family: var(--serif);
  font-size: 0.9rem;
  font-weight: 700;
  color: var(--ink);
  margin: 0 0 10px;
}

.rail ol,
.rail ul {
  margin: 0 0 22px;
  padding-left: 1.1em;
}

.rail li {
  margin-bottom: 6px;
}

.rail a {
  color: var(--ink-2);
  text-decoration: none;
}

.rail a:hover {
  color: var(--prussian);
  text-decoration: underline;
  text-underline-offset: 0.2em;
}

.rail-who {
  color: var(--ink-3);
  font-size: 0.86rem;
  line-height: 1.7;
}

/* 正文排版 */
.prose {
  max-width: var(--measure);
  font-size: 1.02rem;
}

.prose > *:first-child {
  margin-top: 0;
}

.prose p {
  margin: 0 0 1.05em;
  line-height: 1.95;
}

.prose h2 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: clamp(1.42rem, 2.3vw, 1.78rem);
  line-height: 1.35;
  letter-spacing: -0.01em;
  margin: clamp(44px, 5vw, 64px) 0 18px;
  max-width: 26ch;
  scroll-margin-top: 88px;
}

.prose h3 {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.14rem;
  line-height: 1.5;
  margin: 34px 0 10px;
  max-width: 30ch;
}

.prose .lead {
  font-size: 1.12rem;
  line-height: 1.9;
  color: var(--ink);
  margin-bottom: 1.2em;
}

.prose strong {
  font-weight: 600;
}

.prose em {
  font-style: normal;
  color: var(--prussian);
}

.prose ul,
.prose ol {
  margin: 0 0 1.1em;
  padding-left: 1.35em;
}

.prose li {
  margin-bottom: 0.45em;
  line-height: 1.9;
}

.prose blockquote {
  margin: 30px 0;
  padding: 0;
  font-family: var(--serif);
  font-size: 1.16rem;
  line-height: 1.78;
  color: var(--ink);
  max-width: 32ch;
}

.prose blockquote footer {
  display: block;
  font-family: var(--sans);
  font-size: 0.85rem;
  color: var(--ink-3);
  margin-top: 10px;
}

/* 数学公式 */
.katex {
  font-size: 1.03em;
}

.katex-display {
  margin: 1.5em 0;
  overflow-x: auto;
  overflow-y: hidden;
  padding-block: 2px;
}

/* 定理 / 定义 */
.theorem {
  background: var(--panel);
  padding: clamp(20px, 2.6vw, 30px) clamp(20px, 2.8vw, 34px);
  margin: 34px 0;
}

.theorem + .theorem {
  margin-top: 22px;
}

.theorem > p:not(.theorem-label) {
  max-width: 36rem;
}

.theorem-label {
  font-family: var(--serif);
  font-weight: 700;
  color: var(--prussian);
  margin: 0 0 8px;
  font-size: 0.98rem;
}

.theorem p:last-child {
  margin-bottom: 0;
}

.proof {
  margin: 18px 0 30px;
  padding-left: clamp(14px, 2vw, 26px);
  border-left: 4px solid var(--paper-3);
}

.proof::before {
  content: "证明";
  display: block;
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--ink-3);
  margin-bottom: 6px;
}

.proof p:last-child {
  margin-bottom: 0;
}

/* 折叠块：边角料、补充证明、历史旁注 */
.fold {
  margin: 24px 0;
  background: var(--panel);
}

.fold summary {
  cursor: pointer;
  padding: 14px 20px;
  font-family: var(--serif);
  font-size: 0.98rem;
  font-weight: 700;
  color: var(--prussian);
  list-style: none;
}

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

.fold summary::before {
  content: "展开 ";
  font-family: var(--sans);
  font-weight: 400;
  font-size: 0.85rem;
  color: var(--ink-3);
}

.fold[open] summary::before {
  content: "收起 ";
}

.fold summary:hover {
  color: var(--prussian-ink);
}

.fold > p,
.fold > ul,
.fold > ol,
.fold > blockquote {
  margin: 0 0 0.9em;
  padding-inline: 20px;
  font-size: 0.95rem;
  line-height: 1.85;
  color: var(--ink-2);
  max-width: 38rem;
}

.fold > p:last-child,
.fold > ul:last-child,
.fold > ol:last-child {
  padding-bottom: 16px;
  margin-bottom: 0;
}

/* 例题 */
.example {
  margin: 34px 0;
}

.example-head {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1rem;
  color: var(--ink);
  margin: 0 0 8px;
}

.example-head span {
  color: var(--prussian);
}

.solution {
  margin-top: 10px;
  padding-top: 6px;
  font-size: 0.99rem;
}

.solution::before {
  content: "解";
  font-family: var(--serif);
  color: var(--prussian);
  font-weight: 700;
  margin-right: 0.5em;
}

/* 历史档案（深色色块） */
.archive {
  background: var(--field);
  color: var(--field-ink);
  padding: clamp(28px, 4vw, 48px) clamp(24px, 3.6vw, 44px);
  margin: clamp(40px, 5vw, 58px) 0;
}

.archive .archive-when {
  font-family: var(--serif);
  font-size: 0.9rem;
  color: var(--field-ink-2);
  margin: 0 0 6px;
}

.archive h3 {
  font-family: var(--serif);
  font-size: clamp(1.24rem, 1.9vw, 1.5rem);
  line-height: 1.4;
  margin: 0 0 14px;
  color: var(--field-ink);
  max-width: 24ch;
}

.archive p {
  color: var(--field-ink);
  font-size: 0.99rem;
  line-height: 1.88;
  margin: 0 0 0.9em;
  max-width: 40ch;
}

.archive p:last-child {
  margin-bottom: 0;
}

.archive a {
  color: var(--field-ink);
}

.archive .archive-quote {
  font-family: var(--serif);
  font-size: 1.14rem;
  line-height: 1.75;
  color: var(--field-ink);
  margin: 0 0 12px;
}

.archive .archive-source {
  font-size: 0.85rem;
  color: var(--field-ink-2);
  margin: 0;
}

/* 图 */
.figure {
  margin: clamp(28px, 3.4vw, 44px) 0;
}

@media (min-width: 1080px) {
  .figure {
    width: min(50rem, calc(100% + 8.5rem));
  }
}

.figure svg {
  display: block;
  width: 100%;
  height: auto;
  background: transparent;
}

.figcaption {
  font-size: 0.85rem;
  line-height: 1.7;
  color: var(--ink-3);
  margin: 12px 0 0;
  max-width: 44ch;
}

.figcaption b {
  color: var(--ink-2);
  font-weight: 600;
}

.figure-plate {
  background: var(--paper-2);
  padding: clamp(16px, 2.4vw, 30px);
}

/* 关键想法 */
.keyidea {
  margin: 30px 0;
  padding-left: clamp(14px, 2vw, 26px);
  border-left: 6px solid var(--prussian);
}

.keyidea p {
  font-family: var(--serif);
  font-size: 1.1rem;
  line-height: 1.75;
  margin: 0;
  max-width: 34ch;
}

/* 习题 */
.exercises {
  margin-top: clamp(40px, 5vw, 60px);
}

.ex-group {
  margin: 0 0 34px;
}

.ex-group-head {
  font-family: var(--serif);
  font-weight: 700;
  font-size: 1.02rem;
  margin: 0 0 6px;
  display: flex;
  align-items: baseline;
  gap: 10px;
}

.ex-group-head span {
  font-family: var(--sans);
  font-size: 0.84rem;
  font-weight: 400;
  color: var(--ink-3);
}

.ex {
  margin: 0 0 14px;
  padding-left: 2.1em;
  text-indent: -2.1em;
  line-height: 1.9;
}

.ex .ex-num {
  display: inline-block;
  width: 2.1em;
  text-indent: 0;
  color: var(--ink-3);
  font-family: var(--serif);
}

.answer {
  margin: 6px 0 0 2.1em;
  text-indent: 0;
  font-size: 0.94rem;
  color: var(--ink-2);
}

.answer summary {
  cursor: pointer;
  color: var(--prussian);
  font-size: 0.9rem;
  list-style: none;
  display: inline-block;
  text-decoration: underline;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 0.24em;
  text-decoration-color: rgba(23, 57, 92, 0.35);
}

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

.answer summary:hover {
  text-decoration-color: var(--prussian);
}

.answer[open] summary {
  margin-bottom: 6px;
}

.answer p {
  margin: 0 0 0.6em;
  line-height: 1.85;
}

/* 延伸阅读 */
.refs {
  margin: 0;
  padding-left: 1.2em;
  font-size: 0.94rem;
  line-height: 1.85;
  color: var(--ink-2);
}

.refs li {
  margin-bottom: 0.4em;
}

/* 翻页 */
.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: clamp(16px, 3vw, 40px);
  padding-block: clamp(32px, 4vw, 52px);
  max-width: var(--measure);
}

.pager-link {
  text-decoration: none;
  color: var(--ink);
  display: block;
}

.pager-link .pager-dir {
  font-size: 0.85rem;
  color: var(--ink-3);
  display: block;
  margin-bottom: 4px;
}

.pager-link .pager-title {
  font-family: var(--serif);
  font-size: 1.08rem;
  font-weight: 700;
  line-height: 1.45;
}

.pager-link:hover .pager-title {
  color: var(--prussian);
}

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

/* ---------- 动效 ---------- */
@media (prefers-reduced-motion: no-preference) {
  html.js .reveal {
    opacity: 0;
    transform: translateY(22px);
    transition: opacity 620ms var(--ease), transform 620ms var(--ease);
  }

  html.js .reveal.is-in {
    opacity: 1;
    transform: none;
  }

  html.js .reveal-2 {
    transition-delay: 90ms;
  }

  html.js .reveal-3 {
    transition-delay: 170ms;
  }

  html.js .reveal-4 {
    transition-delay: 250ms;
  }
}

@media (prefers-reduced-motion: reduce) {
  html {
    scroll-behavior: auto;
  }
}

/* ---------- 响应式 ---------- */
@media (max-width: 1080px) {
  .hero-grid,
  .method-grid,
  .index-figure,
  .ch-hero-band {
    grid-template-columns: minmax(0, 1fr);
  }

  .hero-grid {
    align-items: start;
  }

  .ch-body {
    grid-template-columns: minmax(0, 1fr);
  }

  .rail {
    position: static;
    order: -1;
    background: var(--paper-2);
    padding: 20px 22px;
  }

  .rail ol,
  .rail ul {
    margin-bottom: 16px;
  }

  .people-panel {
    min-height: 0;
  }

  .chapter-row {
    grid-template-columns: 5.6rem minmax(0, 1fr);
    row-gap: 6px;
  }

  .chapter-row .row-question {
    grid-column: 2;
  }

  .chapter-row .row-who {
    grid-column: 2;
    text-align: left;
  }

  .routes,
  .conventions,
  .footer-cols {
    grid-template-columns: minmax(0, 1fr);
  }
}

@media (max-width: 700px) {
  .wide-only {
    display: none;
  }

  .narrow-only {
    display: block;
  }

  body {
    font-size: 16px;
    line-height: 1.82;
  }

  .nav-links {
    gap: 13px;
    font-size: 0.84rem;
  }

  .nav-links a {
    font-size: 0.84rem;
  }

  .nav-links .xl {
    display: none;
  }

  .nav-brand span {
    display: none;
  }

  .ch-meta,
  .ch-hero-band:not(:has(> figure)) .ch-meta {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 20px;
  }

  .prose p {
    line-height: 1.9;
  }

  .hero h1 {
    font-size: clamp(2.1rem, 8.4vw, 2.9rem);
  }

  .pager {
    grid-template-columns: minmax(0, 1fr);
  }

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

  .figure-plate {
    padding: 12px;
  }
}
