/* 课蒸馏 · 纸与墨
   色板取自 PaperEcho 的 INK：纸面、焦墨、单一朱红。
   直角、细线、零投影；层次靠墨色与留白，动效只走 transform / opacity。 */

:root {
  --paper: #F4F1EA;
  --paper-2: #E7E1D4;
  --paper-3: #DBD4C5;
  --ink: #0A0A0A;
  --ink-2: #4A4A48;
  --ink-3: #68625A;
  --accent: #C0432A;
  --accent-text: #A8371F;
  --on-accent: #FFFFFF;
  --hair: rgba(10, 10, 10, .14);
  --hair-2: rgba(10, 10, 10, .30);
  /* 控件边界：input / 未勾选 checkbox / 线框按钮，对纸面 >=3:1（装饰线仍用 --hair-2） */
  --hair-control: rgba(10, 10, 10, .48);

  --ink-block: #0E0E0D;
  --on-block: #F4F1EA;
  --on-block-2: #C9C4B9;
  --on-block-3: #9A9488;
  --hair-block: rgba(244, 241, 234, .18);
  --accent-on-block: #E2603F;
  --on-accent-block: #0E0E0D;

  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
          "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", system-ui, sans-serif;
  --serif: "KD Serif", "Songti SC", "Source Han Serif SC", "Noto Serif SC", ui-serif, Georgia, serif;
  --mono: ui-monospace, "SF Mono", "JetBrains Mono", Menlo, Consolas, monospace;

  --maxw: 1160px;
  --gutter: clamp(20px, 5vw, 64px);
  --step: clamp(72px, 9vw, 128px);
  --ease: cubic-bezier(.22, .61, .36, 1);
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --dur: 220ms;
}

:root[data-theme="dark"] {
  --paper: #0C0C0C;
  --paper-2: #1A1918;
  --paper-3: #242320;
  --ink: #F2F0EA;
  --ink-2: #B9B5AC;
  --ink-3: #918C84;
  --accent: #E76B4A;
  --accent-text: #E76B4A;
  --on-accent: #0C0C0C;
  --hair: rgba(242, 240, 234, .14);
  --hair-2: rgba(242, 240, 234, .30);
  --hair-control: rgba(242, 240, 234, .48);

  --ink-block: #F2F0EA;
  --on-block: #0C0C0C;
  --on-block-2: #4A4A48;
  --on-block-3: #68625A;
  --hair-block: rgba(12, 12, 12, .18);
  --accent-on-block: #A8371F;
  --on-accent-block: #F4F1EA;
}

@font-face {
  font-family: "KD Serif";
  src: url("assets/fonts/keliuzheng-serif.woff2?v=2") format("woff2");
  font-style: normal;
  font-weight: 400;
  font-display: swap;
}

:root { color-scheme: light; }
:root[data-theme="dark"] { color-scheme: dark; }

*, *::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: 16px;
  line-height: 1.8;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
::selection { background: var(--ink); color: var(--paper); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; }
h1, h2, h3, p, dl, dd, dt, ul, ol, li, figure, blockquote { margin: 0; }
ul, ol { padding: 0; list-style: none; }
img, svg { display: block; max-width: 100%; }
[hidden] { display: none !important; }

.mono { font-family: var(--mono); font-variant-numeric: tabular-nums; }
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; border: 0;
}
.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.skip {
  position: absolute; top: 0; left: var(--gutter); z-index: 90;
  padding: 10px 16px; background: var(--ink); color: var(--paper);
  clip-path: inset(50%); transform: translateY(-200%);
}
.skip:focus { clip-path: none; transform: none; }

/* 阅读进度 */
.read-progress {
  position: fixed; inset: 0 0 auto; height: 2px; z-index: 80;
  pointer-events: none;
}
.read-progress span {
  display: block; height: 100%; background: var(--accent);
  transform: scaleX(0); transform-origin: left center;
}

/* 顶栏 */
.site-head {
  position: sticky; top: 0; z-index: 50;
  background: var(--paper);
  border-bottom: 1px solid transparent;
  transition: border-color var(--dur) var(--ease);
}
.site-head.is-scrolled { border-bottom-color: var(--hair); }
.head-in { display: flex; align-items: center; gap: 30px; min-height: 66px; }
/* 触控热区 ≥44px：只加纵向 padding，视觉位置不变（30 + 2×7） */
.brand { display: flex; align-items: center; gap: 10px; flex: none; padding-block: 7px; }
.seal {
  position: relative; width: 30px; height: 30px;
  display: grid; place-items: center; flex: none;
  background: var(--accent); color: var(--on-accent);
  font-family: var(--serif); font-size: 18px; line-height: 1;
  user-select: none;
}
.seal::before { content: ""; position: absolute; inset: 3px; border: 1px solid currentColor; opacity: .48; }
.brand-en {
  color: var(--ink); font-family: var(--serif); font-size: 18px;
  letter-spacing: -.01em; line-height: 1.1;
}
.brand-cn {
  color: var(--ink-3); font-size: 11px; line-height: 1.3; letter-spacing: .14em;
}
.nav { display: flex; gap: 26px; margin-left: auto; color: var(--ink-2); font-size: 14px; }
.nav a { position: relative; padding: 6px 0; }
.nav a::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px;
  background: var(--accent); transform: scaleX(0); transform-origin: left center;
  transition: transform var(--dur) var(--ease);
}
.nav a:hover { color: var(--ink); }
.nav a.is-active { color: var(--ink); }
.nav a.is-active::after { transform: scaleX(1); }
.head-actions { display: flex; align-items: center; gap: 6px; }
.theme {
  min-height: 44px; min-width: 44px; padding: 0 12px; border: 1px solid transparent;
  background: none; color: var(--ink-2); font-size: 13px; cursor: pointer;
  transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.theme:hover { color: var(--ink); border-color: var(--hair-2); }

/* 按钮 */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  min-height: 46px; padding: 0 22px;
  border: 1px solid transparent; background: none;
  color: var(--ink); font-size: 14px; font-weight: 500; letter-spacing: .01em;
  cursor: pointer; text-align: center;
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease),
              border-color var(--dur) var(--ease), transform 150ms var(--ease);
}
.btn:hover { text-decoration: none; transform: translateY(-1px); }
.btn:active { transform: translateY(0) scale(.995); }
.btn:disabled { opacity: .35; cursor: not-allowed; transform: none; }
.btn-solid { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.btn-solid:hover { background: var(--accent); border-color: var(--accent); color: var(--on-accent); }
.btn-line { border-color: var(--hair-control); color: var(--ink); }
.btn-line:hover { border-color: var(--accent); color: var(--accent-text); }
.btn-small { min-height: 36px; padding: 0 14px; font-size: 13px; }
.btn-lg { min-height: 54px; padding: 0 26px; font-size: 15px; }
.btn-note { font-family: var(--mono); font-size: 11px; font-weight: 400; opacity: .62; }
/* hover 底色变朱红时，半透明小字会掉到 2.6:1，hover 态恢复满不透明（白/墨对朱红均 >=5:1） */
.btn-solid:hover .btn-note { opacity: 1; }
.text-btn {
  display: inline-flex; align-items: center;
  min-height: 44px; padding: 0 11px; margin: -10px -11px;
  border: 0; background: none; color: var(--ink-3); font-size: 13px;
  cursor: pointer; text-decoration: underline; text-underline-offset: .28em;
  text-decoration-color: var(--hair-2); text-decoration-thickness: 1px;
  transition: color var(--dur) var(--ease), text-decoration-color var(--dur) var(--ease);
}
.text-btn:hover { color: var(--ink); text-decoration-color: var(--ink); }

/* 首屏 */
.hero {
  display: grid; grid-template-columns: minmax(0, 1.06fr) minmax(0, .94fr);
  gap: clamp(36px, 6vw, 88px); align-items: center;
  padding-top: clamp(56px, 9vw, 106px);
  padding-bottom: clamp(64px, 8vw, 104px);
}
.hero-copy { max-width: 600px; }
.hero h1 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(44px, 6.4vw, 86px); line-height: 1.08;
  letter-spacing: -.02em; text-wrap: balance;
}
.hero h1 .end { color: var(--accent); }
.hero-lead {
  margin-top: 24px; max-width: 30em;
  color: var(--ink-2); font-size: clamp(16px, 1.5vw, 18px); line-height: 1.85;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 34px; }
.hero-meta { margin-top: 20px; color: var(--ink-3); font-size: 11px; letter-spacing: .04em; }
.hero-meta span { margin: 0 8px; color: var(--ink-3); }

.hero-sheet { width: 100%; max-width: 440px; justify-self: end; margin: 0; }
.sheet-wrap { position: relative; }
.sheet-wrap::before {
  content: ""; position: absolute; inset: 10px -10px -10px 10px;
  background: var(--paper-3); border: 1px solid var(--hair);
}
.sheet {
  position: relative; z-index: 1;
  padding: clamp(22px, 3vw, 30px);
  background: var(--paper-2); border: 1px solid var(--hair-2);
}
.sheet-head {
  display: flex; justify-content: space-between; gap: 12px;
  color: var(--ink-3); font-size: 11px; letter-spacing: .04em;
}
.sheet-status { color: var(--accent-text); white-space: nowrap; }
.sheet-status::before {
  content: ""; display: inline-block; width: 5px; height: 5px;
  margin-right: 6px; vertical-align: 1px; background: var(--accent);
}
.sheet h2 {
  margin-top: 26px; font-family: var(--serif); font-weight: 400;
  font-size: clamp(28px, 3vw, 36px); line-height: 1.2; letter-spacing: -.01em;
}
.sheet-sub { margin-top: 8px; color: var(--ink-3); font-size: 11px; }
.sheet-rows { margin-top: 24px; border-top: 1px solid var(--hair); }
.sheet-rows li {
  display: grid; grid-template-columns: 24px 38px minmax(0, 1fr) auto;
  align-items: baseline; gap: 8px; padding: 10px 0;
  border-bottom: 1px solid var(--hair); font-size: 12.5px;
}
.sheet-rows .no { color: var(--ink-3); font-size: 10px; }
.sheet-rows .k { color: var(--ink-3); }
.sheet-rows .v {
  min-width: 0; color: var(--ink-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.sheet-rows .t { color: var(--ink-3); font-size: 11px; }
.sheet-rows li.is-current .k,
.sheet-rows li.is-current .t { color: var(--accent-text); }
.sheet-rows li.is-current .v { color: var(--ink); }
.sheet-foot {
  display: flex; justify-content: space-between; gap: 12px;
  margin-top: 18px; color: var(--ink-3); font-size: 11px;
}
.hero-sheet figcaption {
  margin-top: 22px; color: var(--ink-3);
  font-size: 11.5px; line-height: 1.7;
}

/* 流程演示 */
.flow-band {
  padding: var(--step) 0;
  background: var(--paper-2);
  border-top: 1px solid var(--hair);
  border-bottom: 1px solid var(--hair);
  scroll-margin-top: 66px;
}
.flow-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 16px 32px; flex-wrap: wrap; margin-bottom: 30px;
}
.flow-head h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(28px, 3.4vw, 42px); line-height: 1.2; letter-spacing: -.01em;
}
.flow-head p { color: var(--ink-2); font-size: 13.5px; }
.flow-time { margin-left: 10px; color: var(--ink-3); font-size: 11px; letter-spacing: .04em; }

.app {
  position: relative; background: var(--paper);
  border: 1px solid var(--hair-2);
}
.app-bar {
  display: flex; align-items: center; justify-content: space-between; gap: 24px;
  min-height: 54px; padding: 0 clamp(18px, 3vw, 30px);
  border-bottom: 1px solid var(--hair);
}
.app-title { color: var(--ink-3); font-size: 11px; letter-spacing: .05em; }
.stepper { display: flex; gap: clamp(12px, 2.4vw, 28px); }
.stepper li {
  display: flex; align-items: center; gap: 7px;
  color: var(--ink-3); font-size: 11.5px; white-space: nowrap;
  transition: color var(--dur) var(--ease);
}
.stepper li span { font-family: var(--mono); font-size: 10.5px; color: var(--ink-3); }
.stepper li.is-current { color: var(--ink); }
.stepper li.is-current span { color: var(--accent-text); }
.stepper li.is-done { color: var(--ink-2); }

.app-body {
  display: flex; flex-direction: column;
  min-height: clamp(330px, 38vw, 370px);
  padding: clamp(24px, 4.2vw, 44px);
}
.panel { display: flex; flex-direction: column; flex: 1; animation: panel-in 280ms var(--ease-out); }
.panel-in {
  display: flex; flex-direction: column; flex: 1;
  width: 100%; max-width: 820px; margin: 0 auto;
}
.panel-step { color: var(--ink-3); font-size: 11px; letter-spacing: .06em; }
.panel h3 {
  margin-top: 10px; font-family: var(--serif); font-weight: 400;
  font-size: clamp(24px, 2.6vw, 32px); line-height: 1.3; letter-spacing: -.01em;
}
.panel h3:focus { outline: none; }
.panel-lead { margin-top: 10px; color: var(--ink-2); font-size: 14px; }
.panel-actions {
  display: flex; align-items: center; gap: 16px;
  margin-top: auto; padding-top: 28px;
}
.panel-actions.split { justify-content: space-between; }
@keyframes panel-in {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}

.link-form { display: flex; flex-direction: column; flex: 1; max-width: 560px; margin-top: 26px; }
.field-label { color: var(--ink-3); font-size: 11px; letter-spacing: .06em; }
.field {
  display: flex; align-items: center; min-height: 56px; margin-top: 8px;
  background: var(--paper); border: 1px solid var(--hair-control);
  transition: border-color var(--dur) var(--ease);
}
/* 输入框自身的焦点环换成外框环：留白内可见，且不会被 .field 裁掉 */
.field:focus-within { border-color: var(--ink); outline: 2px solid var(--ink); outline-offset: 2px; }
.field.has-error { border-color: var(--accent); }
.field-prefix {
  padding-left: 16px; color: var(--ink-3);
  font-family: var(--mono); font-size: 13px; user-select: none;
}
.field input {
  flex: 1; min-width: 0; padding: 14px 16px 14px 2px;
  border: 0; background: none; outline: none;
  color: var(--ink); font-family: var(--mono);
  /* iOS 对 <16px 的输入控件会在聚焦时放大页面 */
  font-size: 16px;
}
.field input::placeholder { color: var(--ink-3); }
.field-hint { margin-top: 8px; color: var(--ink-3); font-size: 11.5px; }
.field-hint.is-error { color: var(--accent-text); }

.pick-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 18px; }
.episodes { margin-top: 20px; border-top: 1px solid var(--hair); }
.episode {
  position: relative; display: flex; align-items: center; gap: 14px;
  min-height: 48px; padding: 8px 12px 8px 0;
  border-bottom: 1px solid var(--hair); cursor: pointer;
  transition: background var(--dur) var(--ease);
}
.episode:hover { background: var(--paper-2); }
.episode input {
  position: absolute; width: 1px; height: 1px; opacity: 0; pointer-events: none;
}
.check {
  position: relative; flex: none; width: 16px; height: 16px;
  border: 1px solid var(--hair-control);
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
.episode input:checked + .check { background: var(--ink); border-color: var(--ink); }
.episode input:checked + .check::after {
  content: ""; position: absolute; left: 5px; top: 1.5px;
  width: 4px; height: 8px;
  border: solid var(--paper); border-width: 0 1.5px 1.5px 0;
  transform: rotate(45deg);
}
.episode input:focus-visible + .check { outline: 2px solid var(--accent); outline-offset: 2px; }
.ep-no { width: 22px; color: var(--ink-3); font-size: 10.5px; }
.ep-name {
  flex: 1; min-width: 0; font-size: 14px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ep-meta { color: var(--ink-3); font-size: 11px; }
.actions-right { display: flex; align-items: center; gap: 16px; margin-left: auto; }
.sel-count { color: var(--ink-3); font-size: 11px; white-space: nowrap; }

.distill-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 20px; }
#distill-percent { color: var(--ink-2); font-size: 12px; padding-top: 6px; }
.progress { height: 3px; margin-top: 24px; background: var(--hair); overflow: hidden; }
.progress span {
  display: block; height: 100%; background: var(--accent);
  transform: scaleX(0); transform-origin: left center;
  transition: transform 320ms var(--ease);
}
.jobs { margin-top: 14px; }
.jobs li {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 8px 0; border-bottom: 1px solid var(--hair); font-size: 13px;
}
.job-name { color: var(--ink-2); min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.job-status { color: var(--ink-3); font-size: 11px; white-space: nowrap; }
.jobs li.is-running .job-name { color: var(--ink); }
.jobs li.is-running .job-status { color: var(--accent-text); }
.jobs li.is-running .job-status::before {
  content: ""; display: inline-block; width: 4px; height: 4px;
  margin-right: 6px; background: var(--accent); vertical-align: 1px;
  animation: pulse 1s ease-in-out infinite;
}
.jobs li.is-done .job-status { color: var(--ink-2); }
@keyframes pulse { 50% { opacity: .25; } }
.demo-note { margin-top: 12px; color: var(--ink-3); font-size: 11px; letter-spacing: .03em; }

.reader-head {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 12px 16px; flex-wrap: wrap;
}
.reader-head > div:first-child { min-width: 0; }
.reader-course { color: var(--ink-3); font-size: 11px; letter-spacing: .04em; }
.reader-meta { color: var(--ink-3); font-size: 11px; white-space: nowrap; padding-bottom: 5px; }
/* 多讲时的讲次选择：原生 select 保留键盘/系统选择器，只换外观 */
.reader-pick {
  position: relative; display: flex; flex-direction: column;
  flex: 0 1 300px; min-width: 0; max-width: 100%;
}
.reader-select {
  -webkit-appearance: none; appearance: none;
  width: 100%; min-width: 0; min-height: 44px; margin-top: 6px;
  padding: 0 34px 0 10px;
  border: 1px solid var(--hair-control); border-radius: 0;
  background: var(--paper); color: var(--ink);
  font-family: var(--mono); font-size: 16px; line-height: 1.4;
  text-overflow: ellipsis; cursor: pointer;
  transition: border-color var(--dur) var(--ease);
}
.reader-select:hover { border-color: var(--ink); }
.reader-pick::after {
  content: ""; position: absolute; right: 14px; bottom: 19px;
  width: 6px; height: 6px; pointer-events: none;
  border-right: 1px solid var(--ink-3); border-bottom: 1px solid var(--ink-3);
  transform: rotate(45deg);
}
.reader {
  min-width: 0; margin-top: 20px; border-top: 1px solid var(--hair);
}
.reader-tabs {
  display: flex; gap: clamp(10px, 1.8vw, 18px);
  min-width: 0; padding: 0; overflow-x: auto; overscroll-behavior-x: contain;
  scroll-padding-inline: 8px;
  border-bottom: 1px solid var(--hair); scrollbar-width: none;
}
.reader-tabs::-webkit-scrollbar { display: none; }
.reader-tabs button {
  position: relative; display: flex; align-items: center; justify-content: center; gap: 9px;
  min-height: 44px; min-width: 44px; padding: 12px 6px;
  border: 0; background: none; white-space: nowrap;
  color: var(--ink-3); font-size: 13px; text-align: left; cursor: pointer;
  transition: color var(--dur) var(--ease);
}
/* 横向滚动容器会裁掉外扩焦点环，滚到容器内才看得见 */
.reader-tabs button:focus-visible { outline-offset: -2px; }
.reader-tabs button span { font-size: 10px; color: var(--ink-3); }
.reader-tabs button:hover { color: var(--ink); }
.reader-tabs button[aria-selected="true"] { color: var(--ink); }
.reader-tabs button[aria-selected="true"]::before {
  content: ""; position: absolute; left: 0; right: 0; bottom: -1px;
  height: 2px; background: var(--accent);
}
.reader-tabs button[aria-selected="true"] span { color: var(--accent-text); }
.reader-panes { min-width: 0; min-height: 175px; padding: 20px 0 0; }
.panel[data-panel="4"] .panel-actions { margin-top: 28px; }
.pane { animation: pane-in 200ms var(--ease-out); }
.pane p { max-width: 38em; color: var(--ink-2); font-size: 14.5px; line-height: 1.9; }
.pane p + p { margin-top: 8px; }
.pane .formula {
  margin-top: 10px; padding: 10px 14px;
  background: var(--paper-2); border-left: 2px solid var(--hair-2);
  color: var(--ink); font-size: 13.5px;
}
@keyframes pane-in { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }
.stamp {
  position: relative;
  display: inline-flex; align-items: center; gap: 8px;
  margin-top: 16px; padding: 3px 0; border: 0;
  border-bottom: 1px solid var(--hair-2); background: none;
  color: var(--ink-3); font-family: var(--mono); font-size: 11px;
  cursor: pointer; transition: color var(--dur) var(--ease), border-color var(--dur) var(--ease);
}
/* 热区外扩到 44 高，视觉文字与下划线不动 */
.stamp::after { content: ""; position: absolute; inset: -9px -10px; }
.stamp::before { content: ""; width: 5px; height: 5px; background: var(--accent); }
.stamp:hover { color: var(--accent-text); border-color: var(--accent); }
.quote {
  margin-top: 14px; padding-left: 14px; border-left: 2px solid var(--accent);
  color: var(--ink-2); font-family: var(--serif); font-size: 14px; line-height: 1.85;
  animation: quote-in 200ms var(--ease-out);
}
@keyframes quote-in { from { opacity: 0; } to { opacity: 1; } }

/* 宣传片 */
.film { padding-block: var(--step); scroll-margin-top: 66px; }
.film-head {
  display: flex; align-items: baseline; justify-content: space-between;
  gap: 12px 32px; flex-wrap: wrap; margin-bottom: 24px;
}
.film-head h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(28px, 3.4vw, 42px); line-height: 1.2; letter-spacing: -.01em;
}
.film-head p { color: var(--ink-3); font-size: 11px; letter-spacing: .04em; }
.film-video {
  display: block; width: 100%; height: auto; aspect-ratio: 16 / 9;
  background: #0A0A0A; border: 1px solid var(--hair);
}

/* 下载 */
/* 只设 padding-block，左右内边距交给 .wrap，保证与正文列对齐 */
.download { padding-block: var(--step); scroll-margin-top: 66px; }
.download-card {
  display: grid; grid-template-columns: minmax(0, 1.12fr) minmax(0, .88fr);
  gap: clamp(32px, 5vw, 64px);
  padding: clamp(28px, 5vw, 56px);
  background: var(--ink-block); color: var(--on-block);
}
.download-card:focus-visible { outline-color: var(--accent-on-block); }
.download-card :focus-visible { outline-color: var(--accent-on-block); }
.download h2 {
  font-family: var(--serif); font-weight: 400;
  font-size: clamp(34px, 4.6vw, 56px); line-height: 1.15;
  letter-spacing: -.01em; color: var(--on-block);
}
.download-sub { margin-top: 14px; color: var(--on-block-2); font-size: 11px; letter-spacing: .03em; }
.download-actions { margin-top: 28px; }
.btn-paper { background: var(--on-block); color: var(--ink-block); border-color: var(--on-block); }
.btn-paper:hover { background: var(--accent-on-block); border-color: var(--accent-on-block); color: var(--on-accent-block); }
.download-side { display: flex; flex-direction: column; }
.download-facts { display: grid; grid-template-columns: 1fr 1fr; border-top: 1px solid var(--hair-block); }
.download-facts div { padding: 11px 0; border-bottom: 1px solid var(--hair-block); }
.download-facts div:nth-child(odd) { padding-right: 16px; }
.download-facts dt { color: var(--on-block-3); font-family: var(--mono); font-size: 11px; letter-spacing: .04em; }
.download-facts dd { margin-top: 2px; color: var(--on-block); font-family: var(--mono); font-size: 12px; }
.fold { border-bottom: 1px solid var(--hair-block); }
.fold summary {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 14px 0; cursor: pointer; list-style: none;
  color: var(--on-block-2); font-size: 12px;
}
.fold summary::-webkit-details-marker { display: none; }
.fold summary::after { content: "+"; color: var(--on-block-3); font-family: var(--mono); }
.fold[open] summary::after { content: "−"; }
.fold ol { margin: 0 0 16px; padding-left: 17px; list-style: decimal; color: var(--on-block-2); font-size: 12px; line-height: 1.85; }
.fold ol li + li { margin-top: 3px; }
.fold code {
  display: block; padding-bottom: 14px;
  color: var(--on-block-2); font-family: var(--mono); font-size: 11px;
  line-height: 1.7; overflow-wrap: anywhere;
}
.copy-btn { margin: 0 0 16px; padding-inline: 0; color: var(--on-block-2); text-decoration-color: var(--hair-block); }
.copy-btn:hover { color: var(--on-block); }

/* 页脚 */
.site-foot { border-top: 1px solid var(--hair); padding-block: 32px 36px; }
.foot-in { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 12px 40px; align-items: start; }
.foot-brand { display: flex; align-items: center; gap: 9px; font-family: var(--serif); font-size: 16px; }
.seal-sm { width: 22px; height: 22px; font-size: 13px; }
.seal-sm::before { inset: 2px; }
.foot-en { color: var(--ink); font-family: var(--serif); font-size: 16px; letter-spacing: -.01em; }
.foot-cn { color: var(--ink-3); font-size: 11px; letter-spacing: .14em; }
.foot-meta { color: var(--ink-3); font-size: 11px; }
.foot-links { grid-column: 2; grid-row: 1 / span 2; display: flex; gap: 20px; color: var(--ink-2); font-size: 12.5px; }
/* 触控热区 ≥44px：padding 与负 margin 等量抵消，文字位置与行距不变 */
.foot-links a { align-self: center; padding-block: 11px; margin-block: -11px; }
.foot-links a:hover { color: var(--accent-text); }
.foot-base {
  grid-column: 1 / -1; margin-top: 12px; padding-top: 14px;
  border-top: 1px solid var(--hair); color: var(--ink-3); font-size: 11px;
}

/* 提示 */
.toast {
  position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 95;
  max-width: calc(100% - 32px); padding: 10px 16px;
  background: var(--ink); color: var(--paper); font-size: 12px;
  transform: translate(-50%, 12px); opacity: 0; pointer-events: none;
  transition: opacity 200ms var(--ease), transform 200ms var(--ease);
}
.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.noscript { margin-top: 16px; color: var(--ink-3); font-size: 12px; }

/* 入场 */
.js .hero-copy > * { animation: rise .8s var(--ease-out) both; }
.js .hero-copy > :nth-child(1) { animation-delay: .04s; }
.js .hero-copy > :nth-child(2) { animation-delay: .1s; }
.js .hero-copy > :nth-child(3) { animation-delay: .16s; }
.js .hero-copy > :nth-child(4) { animation-delay: .22s; }
.js .hero-sheet { animation: sheet-in .9s .18s var(--ease-out) both; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes sheet-in { from { opacity: 0; transform: translateY(18px); } to { opacity: 1; transform: none; } }

@media (max-width: 980px) {
  .hero { grid-template-columns: 1fr; align-items: start; gap: 52px; }
  .hero-copy { max-width: 640px; }
  .hero-sheet { max-width: 520px; justify-self: start; }
  .download-card { grid-template-columns: 1fr; gap: 36px; }
}

@media (max-width: 760px) {
  .head-in { min-height: 60px; }
  /* 手机保留中英文双名，只收导航与顶栏下载按钮 */
  .nav, .head-dl { display: none; }
  .head-actions { margin-left: auto; }
  .hero { padding-top: 42px; padding-bottom: 76px; gap: 44px; }
  .hero h1 { font-size: clamp(40px, 11vw, 58px); }
  .hero-actions { flex-direction: column; align-items: stretch; }
  .hero-actions .btn { width: 100%; }
  .hero-sheet { max-width: none; }
  .sheet-wrap::before { inset: 7px -7px -7px 7px; }
  .film { padding-block: 64px; scroll-margin-top: 60px; }
  .film-head { display: block; margin-bottom: 18px; }
  .film-head p { margin-top: 6px; }
  .flow-band { padding: 64px 0 72px; scroll-margin-top: 60px; }
  .flow-head { margin-bottom: 22px; }
  .app-bar { min-height: 50px; padding: 0 16px; }
  .app-title { display: none; }
  .stepper { width: 100%; justify-content: space-between; gap: 8px; }
  .stepper li { gap: 5px; font-size: 11px; }
  .stepper li span { font-size: 9px; }
  .app-body { min-height: 340px; padding: 22px 18px; }
  .panel h3 { font-size: 25px; }
  .panel-actions { padding-top: 24px; }
  .pick-head { gap: 12px; }
  .episode { gap: 10px; }
  .ep-no { width: 18px; }
  .ep-meta { display: none; }
  .panel-actions.split { gap: 12px; }
  .reader-head { align-items: flex-start; }
  .reader-pick { flex: 1 1 100%; }
  .reader-tabs button span { display: none; }
  .reader-panes { min-height: 180px; padding: 18px 0 0; }
  .download { padding-block: 64px; scroll-margin-top: 60px; }
  .download-card { padding: 30px 22px 26px; }
  .download h2 { font-size: clamp(32px, 8vw, 44px); }
  .download-actions .btn { width: 100%; }
  .foot-in { grid-template-columns: 1fr; }
  .foot-links { grid-column: 1; grid-row: auto; margin-top: 4px; flex-wrap: wrap; gap: 14px 20px; }
  .foot-base { grid-column: 1; }
}

@media (max-width: 430px) {
  .stepper li { font-size: 11px; gap: 4px; padding-bottom: 3px; position: relative; }
  .stepper li span { display: none; }
  .stepper li.is-current::after { content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 1px; background: var(--accent); }
  .app-body { padding: 20px 16px; }
  .panel h3 { font-size: 23px; }
  .sheet-rows li { grid-template-columns: 22px 34px minmax(0, 1fr) auto; gap: 6px; font-size: 12px; }
  .sheet-rows .v { text-overflow: clip; }
  .download-card { padding: 26px 18px 24px; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 1e-05s !important;
    animation-iteration-count: 1 !important;
    transition-duration: 1e-05s !important;
  }
  .js .hero-copy > *, .js .hero-sheet { animation: none; opacity: 1; transform: none; }
}

.app { scroll-margin-top: 80px; }
