/* ==========================================================================
   MickerBook Reference — Warm Ink
   沿用 MickerBook 主站 token（暖纸底 / 赭石主色 / 蓝绿 Agent 色），
   不引入第二套视觉系统，也不做通用 AI 站的霓虹渐变。
   ========================================================================== */

:root {
  --canvas: #f6f2ea;
  --surface: #ffffff;
  --surface-2: #f1ebe1;
  --surface-3: #efe7da;
  --text-1: #1c1917;
  --text-2: #6b655b;
  --text-3: #938876;
  --accent: #b45309;
  --accent-strong: #8a3f07;
  --accent-soft: color-mix(in oklab, #b45309 10%, transparent);
  --link: #9a4a08;
  --agent: #0e7c8c;
  --agent-soft: color-mix(in oklab, #0e7c8c 10%, transparent);
  --success: #3f7a4e;
  --warning: #a16207;
  --danger: #b3261e;
  --danger-soft: color-mix(in oklab, #b3261e 8%, transparent);
  --border: #d8d0c0;
  --border-soft: color-mix(in oklab, #d8d0c0 55%, transparent);
  --ring: #b45309;
  --shadow-card: 0 1px 2px #2a1c0f14, 0 8px 24px #2a1c0f0d;
  --shadow-pop: 0 12px 32px #2a1c0f1f;
  --radius: 0.625rem;
  --r-sm: calc(var(--radius) - 4px);
  --r-md: calc(var(--radius) - 2px);
  --r-lg: var(--radius);
  --r-xl: calc(var(--radius) + 4px);
  --r-2xl: calc(var(--radius) + 8px);
  --wrap: 1080px;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Source Han Sans SC", "Noto Sans SC", sans-serif;
  --font-serif: "Georgia", "Songti SC", "Source Han Serif SC", "Noto Serif SC", serif;
  --font-mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
}

[data-theme='dark'] {
  --canvas: #16140f;
  --surface: #1e1b16;
  --surface-2: #26231e;
  --surface-3: #2c2822;
  --text-1: #ece7de;
  --text-2: #a39e93;
  --text-3: #857f74;
  --accent: #e29a5f;
  --accent-strong: #f0b782;
  --accent-soft: color-mix(in oklab, #e29a5f 14%, transparent);
  --link: #e8b27c;
  --agent: #7fd4dc;
  --agent-soft: color-mix(in oklab, #7fd4dc 12%, transparent);
  --success: #8faf93;
  --warning: #d9c07a;
  --danger: #e0655f;
  --danger-soft: color-mix(in oklab, #e0655f 12%, transparent);
  --border: #3b352b;
  --border-soft: color-mix(in oklab, #3b352b 70%, transparent);
  --ring: #e29a5f;
  --shadow-card: 0 1px 0 #00000059, 0 10px 28px #00000038;
  --shadow-pop: 0 16px 44px #00000066;
  color-scheme: dark;
}

/* --------------------------------------------------------------- reset */

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 5rem;
  overflow-x: clip;
}

body {
  margin: 0;
  min-width: 0;
  overflow-x: clip;
  background: var(--canvas);
  color: var(--text-1);
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
}

a {
  color: var(--link);
  text-decoration: none;
  text-underline-offset: 3px;
}

a:hover {
  text-decoration: underline;
}

h1,
h2,
h3 {
  line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 0;
}

p {
  margin: 0 0 0.85em;
}

code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-sm);
  padding: 0.1em 0.36em;
}

kbd {
  font-family: var(--font-mono);
  font-size: 0.75em;
  background: var(--surface);
  border: 1px solid var(--border);
  border-bottom-width: 2px;
  border-radius: 4px;
  padding: 0.1em 0.35em;
  color: var(--text-2);
}

:focus-visible {
  outline: 2px solid var(--ring);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

.ic {
  width: 1.05em;
  height: 1.05em;
  flex: none;
  vertical-align: -0.15em;
}

.dim {
  color: var(--text-2);
  font-weight: 400;
}

.ext {
  font-size: 0.8em;
  opacity: 0.7;
  margin-left: 0.15em;
}

.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin: 0 auto;
  padding: 0 20px;
}

.skip {
  position: absolute;
  left: -9999px;
}

.skip:focus {
  left: 12px;
  top: 12px;
  z-index: 60;
  background: var(--surface);
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
}

/* ---------------------------------------------------------------- head */

.site-head {
  position: sticky;
  top: 0;
  z-index: 40;
  background: color-mix(in oklab, var(--canvas) 88%, transparent);
  backdrop-filter: saturate(140%) blur(10px);
  border-bottom: 1px solid var(--border-soft);
}

.head-inner {
  display: flex;
  align-items: center;
  gap: 18px;
  height: 60px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--text-1);
  font-weight: 600;
  min-height: 44px;
}

.brand:hover {
  text-decoration: none;
}

.brand-mark {
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  background: var(--accent);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  box-shadow: 0 2px 8px color-mix(in oklab, var(--accent) 30%, transparent);
}

[data-theme='dark'] .brand-mark {
  color: #2a1a0c;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text b {
  font-size: 15px;
}

.brand-text i {
  font-style: normal;
  font-size: 10.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--text-3);
}

.nav {
  display: flex;
  gap: 4px;
  margin-left: auto;
}

.nav-link {
  padding: 6px 11px;
  border-radius: var(--r-md);
  color: var(--text-2);
  font-size: 14px;
}

.nav-link:hover {
  background: var(--surface-2);
  color: var(--text-1);
  text-decoration: none;
}

.nav-link[aria-current='page'] {
  color: var(--accent);
  background: var(--accent-soft);
  font-weight: 600;
}

.head-actions {
  display: flex;
  gap: 6px;
}

.btn-icon {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 44px;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--text-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background 150ms ease-out, color 150ms ease-out;
}

.btn-icon:hover {
  background: var(--surface-2);
  color: var(--text-1);
}

.kbd-hint {
  display: none;
}

.only-dark {
  display: none;
}

[data-theme='dark'] .only-dark {
  display: inline-flex;
}

[data-theme='dark'] .only-light {
  display: none;
}

@media (min-width: 720px) {
  .kbd-hint {
    display: inline-flex;
    gap: 4px;
    align-items: center;
  }
}

/* ------------------------------------------------------------- buttons */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border-radius: var(--r-lg);
  border: 1px solid transparent;
  font: inherit;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: background 160ms ease-out, transform 160ms ease-out, border-color 160ms ease-out;
}

.btn:hover {
  text-decoration: none;
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 10px color-mix(in oklab, var(--accent) 26%, transparent);
}

[data-theme='dark'] .btn-primary {
  color: #2a1a0c;
}

.btn-primary:hover {
  background: var(--accent-strong);
}

.btn-ghost {
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-1);
}

.btn-ghost:hover {
  background: var(--surface-2);
}

.btn-small {
  min-height: 44px;
  padding: 0 12px;
  font-size: 13px;
  background: var(--surface);
  border-color: var(--border);
  color: var(--text-2);
}

.btn-small:hover {
  color: var(--text-1);
  background: var(--surface-2);
}

/* ---------------------------------------------------------------- hero */

.hero {
  padding: 64px 20px 40px;
  max-width: var(--wrap);
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(260px, 0.85fr);
  gap: 32px 46px;
  align-items: center;
}

.hero-copy {
  min-width: 0;
}

.hero-art {
  margin: 0;
  min-width: 0;
}

.hero-art img {
  display: block;
  width: 100%;
  height: auto;
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-card);
}

.hero-kicker {
  display: inline-block;
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--agent);
  background: var(--agent-soft);
  border-radius: 999px;
  padding: 5px 12px;
  margin: 0 0 20px;
}

.hero h1 {
  font-size: clamp(30px, 5.4vw, 50px);
  font-weight: 700;
  letter-spacing: -0.025em;
  margin-bottom: 18px;
}

.hero h1 em {
  font-style: normal;
  color: var(--accent);
  position: relative;
  white-space: normal;
}

.hero h1 em::after {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0.06em;
  height: 0.32em;
  background: color-mix(in oklab, var(--accent) 18%, transparent);
  border-radius: 2px;
  z-index: -1;
}

.hero-sub {
  font-size: 17px;
  color: var(--text-2);
  max-width: 62ch;
  margin-bottom: 26px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-stat {
  grid-column: 1 / -1;
  display: flex;
  flex-wrap: wrap;
  gap: 28px;
  margin: 40px 0 0;
  padding-top: 26px;
  border-top: 1px solid var(--border-soft);
}

.hero-stat div {
  display: flex;
  flex-direction: column;
}

.hero-stat dt {
  font-size: 27px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
}

.hero-stat dd {
  margin: 0;
  font-size: 13px;
  color: var(--text-2);
}

/* ---------------------------------------------------------------- band */

.band {
  padding: 44px 20px;
  border-top: 1px solid var(--border-soft);
}

.band-head {
  margin-bottom: 26px;
  max-width: 66ch;
}

.band-head h2 {
  font-size: clamp(21px, 2.9vw, 28px);
  font-weight: 700;
  margin-bottom: 8px;
}

.band-head p {
  color: var(--text-2);
  margin: 0;
}

/* ------------------------------------------------------------ diff grid */

.diff-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
}

.diff-card {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 22px 20px 18px;
  box-shadow: var(--shadow-card);
}

.diff-card.accent {
  border-color: color-mix(in oklab, var(--accent) 42%, var(--border));
  background: linear-gradient(180deg, var(--accent-soft), transparent 46%), var(--surface);
}

.diff-tag {
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 8px;
  background: var(--surface-2);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  margin-bottom: 12px;
}

.diff-card.accent .diff-tag {
  background: var(--accent);
  color: #fff;
}

[data-theme='dark'] .diff-card.accent .diff-tag {
  color: #2a1a0c;
}

.diff-card h3 {
  font-size: 16.5px;
  margin-bottom: 8px;
}

.diff-card p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-2);
}

/* ---------------------------------------------------------- level list */

.lv-list {
  list-style: none;
  margin: 0 0 24px;
  padding: 0;
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
  counter-reset: lv;
}

.lv-item {
  display: flex;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
}

.lv-num {
  flex: none;
  width: 24px;
  height: 24px;
  display: grid;
  place-items: center;
  border-radius: 7px;
  background: var(--surface-2);
  color: var(--accent);
  font-size: 12.5px;
  font-weight: 700;
}

.lv-item b {
  font-size: 15px;
}

.lv-item p {
  margin: 2px 0 0;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.55;
}

.lv-badge {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  font-size: 12px;
  font-weight: 600;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--surface-2);
  color: var(--text-2);
  border: 1px solid var(--border-soft);
  white-space: nowrap;
}

.lv-badge::before {
  content: '';
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: currentColor;
  opacity: 0.75;
}

.lv-concept {
  color: var(--text-3);
}

.lv-impl {
  color: var(--agent);
  background: var(--agent-soft);
}

.lv-test {
  color: var(--warning);
  background: color-mix(in oklab, var(--warning) 12%, transparent);
}

.lv-runtime {
  color: var(--accent);
  background: var(--accent-soft);
}

.lv-mainpath {
  color: var(--success);
  background: color-mix(in oklab, var(--success) 12%, transparent);
}

.lv-prod {
  color: var(--danger);
  background: var(--danger-soft);
}

/* ------------------------------------------------------- cards & chips */

.cat-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.cat-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 20px;
  color: inherit;
  box-shadow: var(--shadow-card);
  transition: transform 170ms ease-out, border-color 170ms ease-out, box-shadow 170ms ease-out;
}

.cat-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--accent) 40%, var(--border));
  box-shadow: var(--shadow-pop);
}

.cat-top {
  display: flex;
  align-items: center;
  gap: 9px;
}

.cat-ic {
  width: 20px;
  height: 20px;
  color: var(--accent);
}

.cat-top h3 {
  font-size: 17px;
  margin: 0;
}

.cat-n {
  margin-left: auto;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-2);
  background: var(--surface-2);
  border-radius: 999px;
  padding: 2px 9px;
  font-variant-numeric: tabular-nums;
}

.cat-card > p {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
}

.chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.chip {
  display: inline-flex;
  align-items: center;
  min-height: 44px;
  font: inherit;
  font-size: 12.5px;
  padding: 4px 10px;
  cursor: pointer;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--text-2);
}

.chip:hover {
  text-decoration: none;
  background: var(--accent-soft);
  color: var(--accent);
  border-color: color-mix(in oklab, var(--accent) 35%, transparent);
}

.cat-more {
  margin-top: auto;
  font-size: 13px;
  font-weight: 600;
  color: var(--accent);
  display: inline-flex;
  align-items: center;
  gap: 5px;
}

.feat-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(290px, 1fr));
}

.ent-card {
  display: flex;
  flex-direction: column;
  gap: 7px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px;
  color: inherit;
  transition: transform 170ms ease-out, border-color 170ms ease-out;
}

.ent-card:hover {
  text-decoration: none;
  transform: translateY(-2px);
  border-color: color-mix(in oklab, var(--accent) 40%, var(--border));
}

.ent-card-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.ent-card-top h3 {
  font-size: 17px;
  margin: 0;
}

.ent-en {
  font-size: 12px;
  color: var(--text-3);
  font-family: var(--font-mono);
}

.ent-plain {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 14px;
  color: var(--accent);
  line-height: 1.55;
}

.ent-one {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
}

.ent-card .lv-badge {
  align-self: flex-start;
  margin-top: 4px;
}

/* -------------------------------------------------------- page heading */

.crumb {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 13px;
  color: var(--text-2);
  padding: 22px 0 0;
  flex-wrap: wrap;
}

.crumb a {
  color: var(--text-2);
}

.crumb b {
  color: var(--text-1);
  font-weight: 600;
}

.page-head {
  display: flex;
  gap: 16px;
  align-items: flex-start;
  padding: 20px 0 28px;
}

.page-head-ic {
  flex: none;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: var(--r-lg);
  background: var(--accent-soft);
  color: var(--accent);
}

.page-head-ic .ic {
  width: 22px;
  height: 22px;
}

.page-head h1 {
  font-size: clamp(24px, 4vw, 34px);
  font-weight: 700;
  margin-bottom: 8px;
}

.page-head p {
  margin: 0 0 4px;
  color: var(--text-2);
  max-width: 68ch;
}

.jump {
  margin-bottom: 26px;
}

/* -------------------------------------------------------------- entry */

.entry-wrap {
  max-width: 820px;
}

.entry {
  padding: 8px 0 20px;
}

.entry-head {
  padding-bottom: 22px;
  border-bottom: 1px solid var(--border-soft);
  margin-bottom: 26px;
}

.entry-title-row {
  display: flex;
  align-items: baseline;
  gap: 12px;
  flex-wrap: wrap;
}

.entry-title-row h1 {
  font-size: clamp(28px, 5vw, 40px);
  font-weight: 700;
  letter-spacing: -0.02em;
}

.entry-en {
  font-family: var(--font-mono);
  font-size: 15px;
  color: var(--text-3);
}

.alias {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--text-2);
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  align-items: center;
}

.alias span {
  background: var(--surface-2);
  border-radius: 5px;
  padding: 1px 7px;
}

.entry-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
  align-items: center;
}

.tag {
  display: inline-flex;
  min-height: 44px;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  color: var(--text-2);
}

.tag:hover {
  text-decoration: none;
  color: var(--accent);
  border-color: color-mix(in oklab, var(--accent) 40%, var(--border));
}

.tag-btn {
  cursor: pointer;
  font-family: inherit;
}

/* 「你可能会这么说」——本站的入口手法 */
.say-card {
  background: linear-gradient(180deg, var(--accent-soft), transparent 60%), var(--surface);
  border: 1px solid color-mix(in oklab, var(--accent) 34%, var(--border));
  border-radius: var(--r-2xl);
  padding: 22px 24px;
  margin-bottom: 28px;
}

.say-label {
  font-size: 11.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--accent);
}

.say-text {
  font-family: var(--font-serif);
  font-size: clamp(18px, 2.8vw, 22px);
  line-height: 1.6;
  margin: 8px 0 0;
  color: var(--text-1);
}

.say-arrow {
  font-size: 12.5px;
  color: var(--text-2);
  margin: 14px 0 10px;
  letter-spacing: 0.02em;
}

.say-answer {
  margin: 0 0 6px;
  font-size: 19px;
}

.say-answer b {
  font-weight: 700;
}

.say-answer i {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 14px;
  color: var(--text-3);
  margin-left: 6px;
}

.say-one {
  margin: 0;
  font-size: 15.5px;
  color: var(--text-1);
}

.prose {
  font-size: 16.5px;
  line-height: 1.85;
}

.prose p {
  margin: 0 0 1.1em;
}

.sec {
  margin: 34px 0;
  scroll-margin-top: 5rem;
}

.sec > h2 {
  font-size: 19px;
  font-weight: 700;
  margin-bottom: 14px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.sec > h2 .ic {
  width: 18px;
  height: 18px;
  color: var(--accent);
}

.sec-note {
  font-size: 12.5px;
  font-weight: 500;
  color: var(--text-3);
  font-family: var(--font-mono);
}

.sec-lead {
  font-size: 14.5px;
  color: var(--text-2);
  margin-bottom: 14px;
}

/* demo */
.demo {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 26px 22px;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  background-image: radial-gradient(color-mix(in oklab, var(--border) 60%, transparent) 1px, transparent 1px);
  background-size: 14px 14px;
}

.demo-note {
  font-size: 13.5px;
  color: var(--text-2);
  margin: 10px 0 0;
}

/* anatomy */
.anatomy {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 10px;
}

.anatomy li {
  display: flex;
  gap: 12px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
}

.anatomy .num {
  flex: none;
  width: 22px;
  height: 22px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
}

[data-theme='dark'] .anatomy .num {
  color: #2a1a0c;
}

.anatomy b {
  font-size: 15px;
}

.anatomy i {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-3);
}

.anatomy p {
  margin: 3px 0 0;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}

/* variants */
.vars {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.var-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 14px 16px;
}

.var-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 5px;
}

.var-head b {
  font-size: 15px;
}

.var-head i {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
}

.var-item p {
  margin: 0;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}

.var-when {
  margin-top: 6px !important;
  font-size: 13px !important;
  color: var(--agent) !important;
}

/* confusions */
.confs {
  display: grid;
  gap: 10px;
}

.conf-item {
  background: var(--surface);
  border: 1px solid var(--border);
  border-left: 3px solid var(--agent);
  border-radius: var(--r-lg);
  padding: 14px 16px;
}

.conf-head {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
  margin-bottom: 6px;
}

.conf-head b {
  font-size: 15px;
}

.conf-head i {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
}

.neq {
  color: var(--agent);
  font-weight: 700;
}

.conf-item p {
  margin: 0;
  font-size: 14.5px;
  color: var(--text-2);
}

.conf-link {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 13px;
  font-weight: 600;
  margin-top: 8px;
  color: var(--agent);
}

/* scenes */
.scenes {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.scene-item {
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-lg);
  padding: 14px 16px;
}

.scene-item b {
  font-size: 14.5px;
}

.scene-item p {
  margin: 4px 0 0;
  font-size: 14px;
  color: var(--text-2);
  line-height: 1.6;
}

/* ask block */
.sec-ask .ask-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.ask-box {
  position: relative;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  overflow: hidden;
}

.ask-box pre {
  margin: 0;
  padding: 18px 18px 14px;
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.75;
  white-space: pre-wrap;
  word-break: break-word;
  color: var(--text-1);
}

.ask-box .btn-small {
  margin: 0 14px 14px;
}

/* verify block —— 招牌区块 */
.sec-verify {
  background: linear-gradient(180deg, var(--accent-soft), transparent 32%), var(--surface);
  border: 1px solid color-mix(in oklab, var(--accent) 36%, var(--border));
  border-radius: var(--r-2xl);
  padding: 24px;
}

.verify-grid {
  display: grid;
  gap: 14px;
  grid-template-columns: repeat(auto-fit, minmax(255px, 1fr));
}

.verify-col h3 {
  font-size: 14.5px;
  margin-bottom: 10px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.verify-ok h3 {
  color: var(--success);
}

.verify-trap h3 {
  color: var(--danger);
}

.verify-trap h3 .ic {
  width: 16px;
  height: 16px;
}

.check-list,
.trap-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.check-list li,
.trap-list li {
  position: relative;
  padding-left: 26px;
  font-size: 14.5px;
  line-height: 1.65;
}

.check-list li::before {
  content: '';
  position: absolute;
  left: 2px;
  top: 0.5em;
  width: 11px;
  height: 6px;
  border-left: 2px solid var(--success);
  border-bottom: 2px solid var(--success);
  transform: rotate(-45deg);
}

.trap-list li::before {
  content: '✕';
  position: absolute;
  left: 3px;
  top: 0;
  color: var(--danger);
  font-size: 13px;
  font-weight: 700;
}

/* quiz */
.quiz {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 18px 20px;
}

.quiz-q {
  font-size: 15.5px;
  font-weight: 600;
  margin-bottom: 14px;
}

.quiz-opts {
  display: grid;
  gap: 8px;
}

.quiz-opt {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  text-align: left;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--canvas);
  font: inherit;
  font-size: 14.5px;
  color: var(--text-1);
  cursor: pointer;
  transition: border-color 150ms ease-out, background 150ms ease-out;
}

.quiz-opt:hover {
  border-color: var(--accent);
}

.quiz-key {
  flex: none;
  width: 21px;
  height: 21px;
  display: grid;
  place-items: center;
  border-radius: 6px;
  background: var(--surface-2);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-2);
}

.quiz-opt[data-state='right'] {
  border-color: var(--success);
  background: color-mix(in oklab, var(--success) 10%, transparent);
}

.quiz-opt[data-state='right'] .quiz-key {
  background: var(--success);
  color: #fff;
}

.quiz-opt[data-state='wrong'] {
  border-color: var(--danger);
  background: var(--danger-soft);
}

.quiz-opt[data-state='wrong'] .quiz-key {
  background: var(--danger);
  color: #fff;
}

.quiz-why {
  margin: 14px 0 0;
  padding: 12px 14px;
  background: var(--surface-2);
  border-radius: var(--r-lg);
  font-size: 14.5px;
  color: var(--text-1);
}

/* sources */
.srcs {
  display: grid;
  gap: 8px;
  grid-template-columns: repeat(auto-fit, minmax(240px, 1fr));
}

.src-link {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text-1);
}

.src-link:hover {
  text-decoration: none;
  border-color: var(--accent);
}

.src-link b {
  font-size: 14.5px;
  font-weight: 600;
}

.src-link span {
  font-size: 12px;
  color: var(--text-3);
}

/* pager */
.pager {
  display: flex;
  gap: 12px;
  justify-content: space-between;
  padding: 24px 0 60px;
  border-top: 1px solid var(--border-soft);
}

.pager a {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 13px 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text-1);
  max-width: 46%;
}

.pager a:hover {
  text-decoration: none;
  border-color: var(--accent);
}

.pager span {
  font-size: 12px;
  color: var(--text-3);
}

.pager b {
  font-size: 14.5px;
}

.pager-next {
  text-align: right;
  margin-left: auto;
}

.md-src {
  position: absolute;
  left: -9999px;
}

/* -------------------------------------------------------------- all list */

.all-block {
  margin-bottom: 34px;
}

.all-block h2 {
  font-size: 18px;
  display: flex;
  align-items: center;
  gap: 8px;
  padding-bottom: 10px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--border-soft);
  scroll-margin-top: 5rem;
}

.all-block h2 .ic {
  color: var(--accent);
}

.all-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 6px;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
}

.all-list a {
  display: flex;
  align-items: baseline;
  min-width: 0;
  min-height: 44px;
  overflow: hidden;
  gap: 8px;
  padding: 9px 12px;
  border-radius: var(--r-md);
  color: var(--text-1);
  border: 1px solid transparent;
}

.all-list a:hover {
  text-decoration: none;
  background: var(--surface);
  border-color: var(--border);
}

.all-list b {
  font-size: 14.5px;
  flex: none;
}

.all-list i {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
  flex: 0 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.all-list span {
  font-size: 13px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ------------------------------------------------------------- doc page */

.doc-wrap {
  max-width: 760px;
}

.doc-prose h2 {
  font-size: 21px;
  margin: 38px 0 12px;
  padding-top: 6px;
  scroll-margin-top: 5rem;
}

.doc-prose blockquote {
  margin: 22px 0;
  padding: 16px 20px;
  background: var(--surface);
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--r-lg) var(--r-lg) 0;
  font-family: var(--font-serif);
  font-size: 17px;
  line-height: 1.7;
}

.doc-prose blockquote p:last-child {
  margin-bottom: 0;
}

.doc-ol,
.doc-ul {
  padding-left: 1.3em;
  display: grid;
  gap: 9px;
  margin: 0 0 1.2em;
}

.doc-ol li,
.doc-ul li {
  line-height: 1.75;
}

.doc-ol li::marker {
  color: var(--accent);
  font-weight: 700;
}

.table-wrap {
  overflow-x: auto;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  margin: 0 0 1.4em;
  background: var(--surface);
}

table {
  border-collapse: collapse;
  width: 100%;
  font-size: 14.5px;
}

th,
td {
  text-align: left;
  padding: 11px 14px;
  border-bottom: 1px solid var(--border-soft);
  vertical-align: top;
}

th {
  background: var(--surface-2);
  font-size: 13px;
  font-weight: 700;
  white-space: nowrap;
}

tbody tr:last-child td {
  border-bottom: 0;
}

/* ---------------------------------------------------------------- 404 */

.notfound {
  padding: 90px 20px;
  text-align: center;
  max-width: 620px;
}

.notfound h1 {
  font-size: 30px;
  margin-bottom: 12px;
}

.notfound p {
  color: var(--text-2);
  margin-bottom: 24px;
}

.notfound .hero-actions {
  justify-content: center;
}

/* --------------------------------------------------------------- search */

.search-modal {
  position: fixed;
  inset: 0;
  z-index: 80;
  background: color-mix(in oklab, #1c1917 46%, transparent);
  backdrop-filter: blur(3px);
  padding: 12vh 16px 16px;
  display: flex;
  justify-content: center;
  align-items: flex-start;
}

.search-modal[hidden] {
  display: none;
}

.search-panel {
  width: 100%;
  max-width: 620px;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-pop);
  overflow: hidden;
  animation: pop 160ms ease-out;
}

@keyframes pop {
  from {
    opacity: 0;
    transform: translateY(-6px);
  }
}

.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--border-soft);
  color: var(--text-3);
}

.search-bar input {
  flex: 1;
  min-width: 0;
  border: 0;
  background: transparent;
  font: inherit;
  font-size: 16px;
  color: var(--text-1);
  outline: none;
}

.search-close {
  min-width: 44px;
  min-height: 44px;
  border: 1px solid var(--border);
  background: var(--surface-2);
  border-radius: 6px;
  font: inherit;
  font-size: 11.5px;
  color: var(--text-2);
  padding: 3px 8px;
  cursor: pointer;
}

.search-results {
  max-height: min(58vh, 460px);
  overflow-y: auto;
  padding: 8px;
}

.search-tip,
.search-empty {
  margin: 0;
  padding: 22px 12px;
  font-size: 14px;
  color: var(--text-2);
  text-align: center;
}

.sr-item {
  display: block;
  padding: 11px 13px;
  border-radius: var(--r-lg);
  color: var(--text-1);
}

.sr-item:hover,
.sr-item[data-active='1'] {
  text-decoration: none;
  background: var(--surface-2);
}

.sr-top {
  display: flex;
  align-items: baseline;
  gap: 8px;
  flex-wrap: wrap;
}

.sr-top b {
  font-size: 15px;
}

.sr-top i {
  font-style: normal;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-3);
}

.sr-cat {
  margin-left: auto;
  font-size: 11px;
  color: var(--text-2);
  background: var(--surface-3);
  border-radius: 999px;
  padding: 1px 8px;
}

.sr-one {
  margin: 2px 0 0;
  font-size: 13px;
  color: var(--text-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sr-hit {
  background: color-mix(in oklab, var(--accent) 22%, transparent);
  border-radius: 3px;
  padding: 0 1px;
}

/* ---------------------------------------------------------------- foot */

.site-foot {
  border-top: 1px solid var(--border-soft);
  background: var(--surface-2);
  padding: 40px 0 26px;
  margin-top: 40px;
}

.foot-inner {
  display: grid;
  gap: 26px;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
}

.foot-col {
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 14px;
}

.foot-col b {
  font-size: 14.5px;
  margin-bottom: 4px;
}

.foot-col p {
  margin: 0;
  color: var(--text-2);
}

.foot-col a {
  color: var(--text-2);
  font-size: 13.5px;
}

.foot-legal {
  margin-top: 26px;
  padding-top: 18px;
  border-top: 1px solid var(--border-soft);
  font-size: 12.5px;
  color: var(--text-3);
}

/* ---------------------------------------------------------------- misc */

/* ==========================================================================
   Demo Kit —— 词条示例只允许用这套 .dk-* 类，保证 100+ 条目的示例风格统一，
   也避免每条词条各写一套内联样式。
   ========================================================================== */

.dk-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.dk-col {
  display: flex;
  flex-direction: column;
  gap: 10px;
  width: 100%;
  max-width: 320px;
}

.dk-panel {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  padding: 16px;
  width: 100%;
  max-width: 340px;
  box-shadow: var(--shadow-card);
}

.dk-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 4px;
}

.dk-text {
  font-size: 13.5px;
  color: var(--text-2);
  margin: 0 0 12px;
  line-height: 1.6;
}

.dk-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 44px;
  padding: 0 15px;
  border-radius: var(--r-md);
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-1);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: background 150ms ease-out, border-color 150ms ease-out;
}

.dk-btn:hover {
  background: var(--surface-2);
}

.dk-btn--primary {
  background: var(--accent);
  border-color: transparent;
  color: #fff;
}

[data-theme='dark'] .dk-btn--primary {
  color: #2a1a0c;
}

.dk-btn--primary:hover {
  background: var(--accent-strong);
}

.dk-btn--text {
  border-color: transparent;
  background: transparent;
  color: var(--link);
  padding: 0 6px;
}

.dk-btn--danger {
  background: var(--danger);
  border-color: transparent;
  color: #fff;
}

.dk-btn--agent {
  background: var(--agent);
  border-color: transparent;
  color: #fff;
}

[data-theme='dark'] .dk-btn--agent,
[data-theme='dark'] .dk-btn--danger {
  color: #16140f;
}

.dk-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

.dk-btn--full {
  width: 100%;
}

.dk-field {
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.dk-label {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--text-2);
}

.dk-input {
  min-height: 40px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  background: var(--canvas);
  color: var(--text-1);
  font: inherit;
  font-size: 14px;
  width: 100%;
}

.dk-input:focus {
  outline: 2px solid var(--ring);
  outline-offset: 1px;
}

.dk-hint {
  font-size: 12px;
  color: var(--text-3);
}

.dk-err {
  font-size: 12px;
  color: var(--danger);
}

.dk-badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 11.5px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  color: var(--text-2);
}

.dk-badge--ok {
  color: var(--success);
  background: color-mix(in oklab, var(--success) 12%, transparent);
}

.dk-badge--warn {
  color: var(--warning);
  background: color-mix(in oklab, var(--warning) 14%, transparent);
}

.dk-badge--bad {
  color: var(--danger);
  background: var(--danger-soft);
}

.dk-badge--agent {
  color: var(--agent);
  background: var(--agent-soft);
}

.dk-code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.7;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  padding: 10px 12px;
  margin: 0;
  white-space: pre-wrap;
  word-break: break-word;
  width: 100%;
  color: var(--text-1);
}

.dk-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 100%;
  padding: 8px 12px;
  background: var(--surface-2);
  border: 1px solid var(--border-soft);
  border-radius: var(--r-md);
  font-size: 13px;
  color: var(--text-2);
}

.dk-tabs {
  display: inline-flex;
  gap: 2px;
  padding: 3px;
  background: var(--surface-2);
  border-radius: var(--r-md);
  border: 1px solid var(--border-soft);
}

.dk-tab {
  min-height: 44px;
  padding: 5px 12px;
  border-radius: var(--r-sm);
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  background: transparent;
  border: 0;
  font-family: inherit;
  cursor: pointer;
}

.dk-tab[aria-selected='true'] {
  background: var(--surface);
  color: var(--text-1);
  box-shadow: 0 1px 3px #2a1c0f1a;
}

.dk-avatar {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--agent-soft);
  color: var(--agent);
  font-size: 13px;
  font-weight: 700;
  flex: none;
}

.dk-skel {
  height: 12px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--surface-2), var(--surface-3), var(--surface-2));
  background-size: 200% 100%;
  animation: dkshine 1.4s linear infinite;
}

@keyframes dkshine {
  to {
    background-position: -200% 0;
  }
}

.dk-progress {
  width: 100%;
  height: 7px;
  border-radius: 999px;
  background: var(--surface-2);
  overflow: hidden;
}

.dk-progress > i {
  display: block;
  height: 100%;
  background: var(--accent);
  border-radius: 999px;
}

.dk-flow {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  color: var(--text-2);
}

.dk-step {
  padding: 5px 11px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--border);
  font-weight: 600;
  color: var(--text-1);
  font-size: 12.5px;
}

.dk-arrow {
  color: var(--text-3);
}

.dk-split {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  width: 100%;
}

.dk-split > div {
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-md);
  padding: 12px 14px;
  font-size: 13.5px;
}

.dk-split b {
  display: block;
  margin-bottom: 4px;
  font-size: 13px;
}

.dk-bad {
  border-color: color-mix(in oklab, var(--danger) 40%, var(--border)) !important;
  background: var(--danger-soft) !important;
}

.dk-good {
  border-color: color-mix(in oklab, var(--success) 40%, var(--border)) !important;
  background: color-mix(in oklab, var(--success) 8%, transparent) !important;
}

.toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 90;
  background: var(--text-1);
  color: var(--canvas);
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 999px;
  box-shadow: var(--shadow-pop);
  animation: pop 160ms ease-out;
}

/* ------------------------------------------------ learning product loop */

.hero-mini {
  margin: 18px 0 0;
  font-size: 12.5px;
  color: var(--text-3);
}

.steps-band {
  padding-top: 30px;
}

.steps {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
  gap: 12px;
}

.step-item {
  min-width: 0;
  display: flex;
  gap: 12px;
  align-items: flex-start;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  padding: 16px;
}

.step-num {
  flex: none;
  width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--accent);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
}

[data-theme='dark'] .step-num {
  color: #2a1a0c;
}

.step-item b {
  font-size: 15px;
}

.step-item p {
  margin: 4px 0 0;
  font-size: 13.5px;
  color: var(--text-2);
  line-height: 1.6;
}

.fold {
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  background: var(--surface);
  padding: 18px 22px;
}

.fold summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  cursor: pointer;
  list-style: none;
  min-height: 44px;
}

.fold summary::-webkit-details-marker {
  display: none;
}

.fold summary h2 {
  font-size: 19px;
  margin: 0;
}

.fold-hint {
  flex: none;
  font-size: 12px;
  color: var(--text-3);
}

.fold-lead {
  color: var(--text-2);
  margin: 6px 0 18px;
}

.fold .lv-list {
  margin-bottom: 16px;
}

.tag-time {
  color: var(--text-3);
  font-weight: 500;
}

.rel-grid {
  display: grid;
  gap: 10px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr));
}

.rel-card {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 15px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text-1);
}

.rel-card:hover {
  text-decoration: none;
  border-color: color-mix(in oklab, var(--accent) 45%, var(--border));
}

.rel-card b {
  font-size: 15px;
}

.rel-card span {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.55;
}

.verify-copy {
  margin: 0 0 14px;
}

.search-group {
  padding: 6px 8px;
}

.search-group > b {
  display: block;
  font-size: 12px;
  color: var(--text-3);
  padding: 6px 6px 2px;
}

.revisit-streak strong {
  display: block;
  font-size: 38px;
  line-height: 1;
  color: var(--agent);
}

.revisit-streak p {
  margin: 6px 0 0;
  color: var(--text-2);
  font-size: 13px;
}

/* 移动端底部导航 */
.tabbar {
  display: none;
}

@media (max-width: 720px) {
  .tabbar {
    position: fixed;
    left: 0;
    right: 0;
    bottom: 0;
    z-index: 60;
    display: flex;
    background: color-mix(in oklab, var(--surface) 92%, transparent);
    backdrop-filter: blur(10px);
    border-top: 1px solid var(--border-soft);
    padding-bottom: env(safe-area-inset-bottom);
  }

  .tabbar-item {
    flex: 1;
    min-height: 56px;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 2px;
    border: 0;
    background: transparent;
    font: inherit;
    font-size: 11px;
    color: var(--text-2);
    cursor: pointer;
  }

  .tabbar-item .ic {
    width: 20px;
    height: 20px;
  }

  .tabbar-item[aria-current='page'],
  .tabbar-item:hover {
    color: var(--accent);
    text-decoration: none;
  }
}

/* 速览模式：只看结论和验收要点 */
.entry.snapshot .prose,
.entry.snapshot #demo,
.entry.snapshot #anatomy,
.entry.snapshot #variants,
.entry.snapshot #confusions,
.entry.snapshot #scenes,
.entry.snapshot #ask,
.entry.snapshot #quiz,
.entry.snapshot #links,
.entry.snapshot .pager {
  display: none;
}

.entry.snapshot::before {
  content: '⚡ 速览模式：只看结论和验收要点，点「完整阅读」看全文';
  display: block;
  margin: 0 0 20px;
  padding: 10px 14px;
  border: 1px dashed color-mix(in oklab, var(--accent) 50%, var(--border));
  border-radius: var(--r-md);
  background: var(--accent-soft);
  font-size: 13px;
  color: var(--accent-strong);
}

/* 学习地图：节点 + 连线 */
.route-map {
  display: grid;
  gap: 10px;
  margin: 0 0 18px;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 200px), 1fr));
  counter-reset: rnode;
}

.route-node {
  position: relative;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 14px 14px 46px;
  border: 1px solid var(--border);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--text-1);
  transition: border-color 150ms ease-out, transform 150ms ease-out;
}

.route-node:hover {
  text-decoration: none;
  border-color: color-mix(in oklab, var(--accent) 45%, var(--border));
  transform: translateY(-1px);
}

.route-node-dot {
  position: absolute;
  left: 12px;
  top: 14px;
  width: 26px;
  height: 26px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--canvas);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
}

.route-node b {
  font-size: 14.5px;
}

.route-node small {
  font-size: 12px;
  color: var(--text-2);
  line-height: 1.5;
}

.route-node.is-done {
  border-color: color-mix(in oklab, var(--success) 45%, var(--border));
}

.route-node.is-done .route-node-dot {
  color: #fff;
  background: var(--success);
  border-color: var(--success);
}

.route-node.is-done .route-node-dot::after {
  content: '✓';
  font-size: 0;
}

.route-node.is-done .route-node-dot {
  font-size: 0;
}

.route-node.is-done .route-node-dot::after {
  font-size: 12px;
}

.route-node.is-quiz::after {
  content: '已测验';
  position: absolute;
  right: 10px;
  top: 10px;
  font-size: 10px;
  font-weight: 600;
  color: var(--agent);
  background: var(--agent-soft);
  border-radius: 999px;
  padding: 2px 7px;
}

/* 徽章 */
.badges {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--surface);
  color: var(--text-2);
}

.badge.got {
  border-color: color-mix(in oklab, var(--accent) 45%, var(--border));
  background: var(--accent-soft);
  color: var(--accent-strong);
}

.favorite-btn.is-active,
.practice-actions .is-active {
  color: var(--accent);
  border-color: color-mix(in oklab, var(--accent) 55%, var(--border));
  background: var(--accent-soft);
}

.favorite-btn.is-active .ic {
  fill: currentColor;
}

.revisit {
  padding-top: 34px;
}

.revisit-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 230px), 1fr));
  gap: 14px;
}

.revisit-empty,
.revisit-card {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
  padding: 18px;
}

.revisit-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  gap: 4px;
  color: var(--text-2);
}

.revisit-empty b {
  color: var(--text-1);
}

.revisit-card h3 {
  display: flex;
  justify-content: space-between;
  margin-bottom: 10px;
  font-size: 15px;
}

.revisit-card h3 span {
  color: var(--text-3);
  font-weight: 500;
}

.revisit-item {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid var(--border-soft);
  color: var(--text-1);
}

.revisit-item:hover {
  text-decoration: none;
  color: var(--accent);
}

.revisit-item span {
  flex: none;
  font-size: 11.5px;
  color: var(--text-3);
}

.revisit-progress strong {
  display: block;
  font-size: 38px;
  line-height: 1;
  color: var(--accent);
}

.revisit-progress p {
  margin: 6px 0 14px;
  color: var(--text-2);
  font-size: 13px;
}

.learn-wrap,
.practice-wrap {
  padding-bottom: 60px;
}

.route-grid {
  display: grid;
  gap: 24px;
}

.route-card {
  display: grid;
  grid-template-columns: minmax(240px, 0.72fr) minmax(0, 1.28fr);
  overflow: hidden;
  background: var(--surface);
  border: 1px solid var(--border);
  border-radius: var(--r-2xl);
  box-shadow: var(--shadow-card);
}

.route-art {
  width: 100%;
  height: 100%;
  min-height: 260px;
  object-fit: cover;
  background: var(--surface-2);
}

.route-body {
  min-width: 0;
  padding: 26px;
}

.route-index {
  color: var(--agent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.route-body h2 {
  font-size: 24px;
  margin: 5px 0 7px;
}

.route-body > p {
  color: var(--text-2);
}

.route-progress {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 16px 0;
  color: var(--text-2);
  font-size: 13px;
}

.progress-track {
  flex: 1;
  height: 8px;
  border-radius: 99px;
  background: var(--surface-2);
  overflow: hidden;
}

.progress-track i {
  display: block;
  width: 0;
  height: 100%;
  border-radius: inherit;
  background: var(--accent);
  transition: width 220ms ease-out;
}

.route-steps {
  list-style: none;
  display: grid;
  gap: 8px;
  margin: 0 0 18px;
  padding: 0;
}

.route-steps li {
  min-width: 0;
  display: flex;
  gap: 10px;
  align-items: flex-start;
}

.route-check {
  flex: none;
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  border: 1px solid var(--border);
  background: var(--canvas);
  font-size: 12px;
  font-weight: 700;
  color: var(--text-3);
}

.route-steps li.is-done .route-check {
  color: #fff;
  background: var(--success);
  border-color: var(--success);
}

.route-steps li.is-done .route-check::after {
  content: '✓';
}

.route-steps li.is-done .route-check {
  font-size: 0;
}

.route-steps li.is-done .route-check::after {
  font-size: 13px;
}

.route-steps a {
  min-width: 0;
  display: flex;
  flex-direction: column;
  color: var(--text-1);
}

.route-steps a:hover {
  color: var(--accent);
  text-decoration: none;
}

.route-steps small {
  color: var(--text-2);
  line-height: 1.45;
}

.practice-toolbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 18px;
  padding: 18px;
  margin-bottom: 18px;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface);
}

.practice-toolbar > div:first-child {
  display: flex;
  flex-direction: column;
}

.practice-toolbar span {
  color: var(--text-2);
  font-size: 13px;
}

.practice-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.practice-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
}

.practice-item {
  min-width: 0;
  padding: 16px;
  border: 1px solid var(--border);
  border-radius: var(--r-xl);
  background: var(--surface-2);
}

.practice-item[hidden] {
  display: none;
}

.practice-meta {
  min-height: 44px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.practice-meta a {
  font-weight: 700;
  color: var(--text-1);
}

.practice-meta span {
  flex: none;
  font-size: 11px;
  color: var(--text-2);
  padding: 3px 8px;
  border-radius: 99px;
  background: var(--surface);
}

.feedback-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin: 34px 0 26px;
  padding: 18px 20px;
  border: 1px dashed color-mix(in oklab, var(--agent) 48%, var(--border));
  border-radius: var(--r-xl);
  background: var(--agent-soft);
}

.feedback-card p {
  margin: 4px 0 0;
  color: var(--text-2);
  font-size: 13px;
}

.search-count {
  margin: 0;
  padding: 7px 12px;
  color: var(--text-3);
  font-size: 12px;
}

.search-recents {
  padding: 16px;
}

.search-recents > b {
  display: block;
  margin-bottom: 8px;
  font-size: 13px;
}

.search-empty b,
.search-empty p {
  display: block;
  margin: 0 0 10px;
}

@media (max-width: 720px) {
  .wrap {
    padding-left: 16px;
    padding-right: 16px;
  }

  body {
    padding-bottom: 64px;
  }

  .head-inner {
    gap: 10px;
  }

  .nav {
    display: none;
  }

  .brand {
    min-width: 0;
  }

  .brand-text i {
    display: none;
  }

  .head-actions {
    margin-left: auto;
  }

  .hero {
    padding-top: 38px;
    grid-template-columns: minmax(0, 1fr);
    gap: 24px;
  }

  .hero h1 br {
    display: none;
  }

  .hero-art {
    max-width: 520px;
  }

  .hero-stat {
    gap: 18px 24px;
    margin-top: 10px;
  }

  .hero-stat div {
    min-width: 72px;
  }

  .page-head {
    min-width: 0;
  }

  .page-head > div:last-child,
  .entry,
  .entry-title-row,
  .entry-meta {
    min-width: 0;
  }

  .say-card,
  .sec-verify,
  .quiz,
  .practice-item {
    padding: 18px 16px;
  }

  .diff-grid,
  .lv-list,
  .cat-grid,
  .feat-grid,
  .vars,
  .scenes,
  .verify-grid,
  .srcs,
  .all-list,
  .dk-split {
    grid-template-columns: minmax(0, 1fr);
  }

  .all-list a {
    align-items: flex-start;
    flex-wrap: wrap;
  }

  .all-list span {
    flex-basis: 100%;
    white-space: normal;
  }

  .route-card,
  .practice-list {
    grid-template-columns: minmax(0, 1fr);
  }

  .route-art {
    height: auto;
    min-height: 0;
    max-height: 260px;
  }

  .route-body {
    padding: 20px 18px;
  }

  .practice-toolbar,
  .feedback-card {
    align-items: stretch;
    flex-direction: column;
  }

  .practice-actions .btn,
  .feedback-card .btn {
    width: 100%;
  }

  .search-modal {
    padding: max(12px, env(safe-area-inset-top)) 12px max(12px, env(safe-area-inset-bottom));
    align-items: flex-start;
  }

  .search-panel {
    max-height: calc(100dvh - 24px);
  }

  .search-results {
    max-height: calc(100dvh - 92px);
  }

  .pager a {
    min-width: 0;
    max-width: 48%;
  }

  .toast {
    max-width: calc(100vw - 32px);
    text-align: center;
    white-space: normal;
  }
}

@media (prefers-reduced-motion: reduce) {
  * {
    animation-duration: 0.01ms !important;
    transition-duration: 0.01ms !important;
  }

  html {
    scroll-behavior: auto;
  }
}

/* 2026-08-26 fix: 分类卡不再用 <a> 包整卡（嵌套链接会被浏览器拆散到网格外） */
.cat-card{position:relative}
.cat-card .card-stretch{position:absolute;inset:0;border-radius:var(--r-xl)}
.cat-card .card-stretch::after{content:"";position:absolute;inset:0;z-index:1}
.cat-card:hover .card-stretch::after{border-color:color-mix(in oklab, var(--accent) 40%, var(--border));border-width:1px;border-style:solid;border-radius:inherit}
.cat-card .chip,.cat-card .cat-more{position:relative;z-index:2}
