/* 机会与成长指南 · 阅读优先的知识库
   视觉方向：极简、浅色、单色系（近黑 + 灰阶）、大留白；面板用半透明磨砂
   （液态玻璃），分隔用发丝细线，控件用胶囊圆角。装饰克制，正文优先。 */

:root {
  /* 颜色 */
  --bg: #ffffff;
  --canvas: #fbfbfd;
  --ink: #1d1d1f;
  --ink-2: #4d4d52;
  --muted: #86868b;
  --line: rgba(0, 0, 0, 0.08);
  --line-strong: rgba(0, 0, 0, 0.16);
  --surface: rgba(120, 120, 128, 0.06);
  --surface-2: rgba(120, 120, 128, 0.11);
  --glass: rgba(255, 255, 255, 0.62);
  --glass-strong: rgba(255, 255, 255, 0.78);
  --accent: #0066cc;
  --accent-soft: rgba(0, 102, 204, 0.08);
  --warn: #6b4a00;
  --warn-soft: rgba(255, 179, 0, 0.10);
  --warn-line: rgba(255, 179, 0, 0.28);

  /* 形状 */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-lg: 18px;
  --pill: 999px;

  /* 布局 */
  --sidebar-w: 272px;
  --toc-w: 216px;
  --gutter: 36px;
  --sheet-gap: 14px;   /* 悬浮侧栏与窗口边缘的距离 */

  --blur: saturate(180%) blur(24px);

  --font: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro SC", "PingFang SC",
          "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", Roboto, sans-serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, "Liberation Mono", monospace;
  --read-size: 17px;
  /* 标题阶梯：正文 17 → 条目内 17.5 → 条目内小节 20 → 条目标题 23 → 分组 27 → 文档标题 36 */
  --fs-h1: 36px;
  --fs-h2: 27px;
  --fs-entry: 23px;
  --fs-h3: 20px;
  --fs-h4: 17.5px;
  --shadow-panel: 0 1px 2px rgba(0, 0, 0, 0.03), 0 10px 30px rgba(0, 0, 0, 0.05);
  --shadow-sheet: 0 2px 6px rgba(0, 0, 0, 0.04), 0 18px 48px rgba(0, 0, 0, 0.09);
}

* { box-sizing: border-box; }

/* 导航与锚点一律瞬移（跳转式）。不要改回 smooth：正文很长，平滑滚动会让人以为页面在「滑」 */
html { -webkit-text-size-adjust: 100%; scroll-behavior: auto; }

body {
  margin: 0;
  background-color: var(--canvas);
  background-image:
    radial-gradient(1100px 520px at 18% -8%, #ffffff 0%, rgba(255, 255, 255, 0) 62%),
    radial-gradient(900px 520px at 100% 0%, #f4f6f9 0%, rgba(244, 246, 249, 0) 58%);
  background-attachment: fixed;
  color: var(--ink);
  font-family: var(--font);
  font-size: 15.5px;
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

a { color: var(--accent); text-decoration: none; }
a:hover { text-decoration: underline; text-underline-offset: 3px; }

:focus-visible { outline: 2px solid rgba(0, 102, 204, 0.55); outline-offset: 2px; border-radius: 6px; }

.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;
}
.skip-link {
  position: absolute; left: -9999px; top: 0; z-index: 100;
  background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 0 0 var(--radius) 0;
}
.skip-link:focus { left: 0; top: 0; }

/* ================================================================ 动效
   原则：短、轻、有方向感。位移不超过 6px，时长 0.14–0.3s，
   统一缓动；只动 transform / opacity / height，不动布局属性。 */

:root {
  --ease: cubic-bezier(.32, .72, 0, 1);
  /* 切换视图的「跳转」动效：要短到像一跳，不能像滑动（旧的 .22s + 错开延时已被读者否掉） */
  --dur-jump: .12s;
  --dur-fast: .14s;
  --dur: .22s;
  --dur-slow: .3s;
}
html { interpolate-size: allow-keywords; }   /* 让 height: 0 → auto 可动画 */

@keyframes oh-fade-up {
  from { opacity: 0; transform: translateY(6px); }
  to { opacity: 1; transform: none; }
}
@keyframes oh-fade-in {
  from { opacity: 0; }
  to { opacity: 1; }
}
@keyframes oh-reveal {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: none; }
}

/* 切换视图：短促的「跳转」动效——一次极快的轻微上浮（120ms、无错开延时），
   作用是提示「内容换了」，但不像旧版那样有 220ms 的滑动过程与逐块延时。
   滚动仍然是瞬移（见 html 上的 scroll-behavior: auto）。 */
@keyframes oh-jump {
  from { opacity: 0; transform: translateY(3px); }
  to { opacity: 1; transform: none; }
}
.main > * { animation: oh-jump var(--dur-jump) var(--ease) both; }

/* 首屏挂载时先关掉过渡，避免展开的目录"抽"一下 */
.no-anim, .no-anim * { transition: none !important; animation: none !important; }

/* ================================================================ 左侧目录
   悬浮的磨砂面板：与窗口留出 14px 边距，圆角 18px，背后内容透过毛玻璃。 */

.sidebar {
  position: fixed; top: var(--sheet-gap); left: var(--sheet-gap); bottom: var(--sheet-gap);
  width: var(--sidebar-w); z-index: 40;
  /* overflow: clip（而不是 hidden）：hidden 仍可被 JS 通过 scrollTop 滚动，
     会把整块侧栏（含标题）顶走 —— 用 clip 从根上杜绝「菜单一会在上面一会在下面」 */
  display: flex; flex-direction: column; overflow: clip;
  background: var(--glass);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  border: 1px solid rgba(255, 255, 255, 0.7);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sheet);
  transition: transform var(--dur-slow) var(--ease);
}
@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .sidebar { background: #f7f7f9; }
}

.sidebar-head {
  display: flex; align-items: flex-start; gap: 8px;
  padding: 16px 16px 14px;
  border-bottom: 1px solid var(--line);
}
.brand { display: flex; flex-direction: column; gap: 3px; min-width: 0; color: var(--ink); }
.brand:hover { text-decoration: none; }
.brand-title { font-size: 15px; font-weight: 600; letter-spacing: -0.01em; line-height: 1.3; }
.brand-sub { font-size: 11px; color: var(--muted); line-height: 1.45; }

.icon-btn {
  font: inherit; color: var(--ink-2); cursor: pointer;
  background: transparent; border: 1px solid transparent; border-radius: var(--pill);
  padding: 4px 8px; line-height: 1.2;
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease,
              transform var(--dur-fast) var(--ease);
}
.icon-btn:hover { background: var(--surface); }
.icon-btn:active { transform: scale(.94); }
.sidebar-close { display: none; font-size: 17px; }
.sidebar-backdrop { display: none; }

/* 目录树：行高 28–30px，缩进四级阶梯，计数右对齐成列 */
.nav-tree {
  flex: 1 1 auto; overflow-y: auto; overscroll-behavior: contain;
  padding: 10px 10px 22px;
}
.nav-tree::-webkit-scrollbar { width: 8px; }
.nav-tree::-webkit-scrollbar-thumb { background: rgba(0, 0, 0, 0.14); border-radius: var(--pill); }
.nav-tree::-webkit-scrollbar-track { background: transparent; }

.nav-group-block { margin: 0; padding: 0; }
.nav-group-block + .nav-group-block { margin-top: 5px; padding-top: 5px; border-top: 1px solid var(--line); }

.nav-item { list-style: none; }
.nav-children {
  list-style: none; margin: 0; padding: 0;
  height: 0; overflow: hidden; visibility: hidden;
  transition: height var(--dur) var(--ease), visibility var(--dur) step-end;
}
.nav-item.open > .nav-children {
  height: auto; visibility: visible;
  transition: height var(--dur) var(--ease), visibility 0s;
}

.nav-row {
  display: flex; align-items: center; min-height: 28px;
  padding-right: 8px; border-radius: var(--radius-sm);
  transition: background var(--dur-fast) ease;
}
.nav-row:hover { background: var(--surface); }

.nav-toggle {
  flex: 0 0 16px; width: 16px; height: 16px; margin: 0 4px 0 2px; padding: 0;
  background: none; border: 0; cursor: pointer; position: relative;
}
.nav-toggle::before {
  content: ""; position: absolute; left: 4px; top: 4px;
  border-left: 4.5px solid var(--muted); border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transition: transform var(--dur) var(--ease);
}
.nav-item.open > .nav-row > .nav-toggle::before { transform: rotate(90deg) translateX(1px); }
.nav-dot { flex: 0 0 16px; margin: 0 4px 0 2px; }

.nav-label {
  flex: 1 1 auto; min-width: 0; padding: 3px 0;
  color: var(--ink-2); font-size: 13px; line-height: 1.45; overflow-wrap: break-word;
  transition: color var(--dur-fast) ease;
}
.nav-label:hover { text-decoration: none; color: var(--ink); }
.nav-label.static { color: var(--ink-2); }
.nav-label.clickable { cursor: pointer; }
.nav-count {
  flex: 0 0 auto; min-width: 22px; margin-left: 8px; text-align: right;
  font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums;
}

/* 缩进阶梯：一级 10 / 二级 22 / 三级 36 / 四级以上 50 */
.nav-l1 > .nav-row { min-height: 30px; margin-top: 2px; padding-left: 10px; }
.nav-l1 > .nav-row > .nav-label { font-size: 14px; font-weight: 600; color: var(--ink); letter-spacing: -0.01em; }
.nav-l2 > .nav-row { min-height: 28px; padding-left: 22px; }
.nav-l2 > .nav-row > .nav-label { font-size: 13px; font-weight: 590; color: var(--ink); }
.nav-l3 > .nav-row { min-height: 28px; padding-left: 36px; }
.nav-l3 > .nav-row > .nav-label { font-size: 13px; color: var(--ink-2); }
.nav-l4 > .nav-row, .nav-l5 > .nav-row { min-height: 27px; padding-left: 50px; }
.nav-l4 > .nav-row > .nav-label,
.nav-l5 > .nav-row > .nav-label { font-size: 12.5px; color: var(--muted); }

/* 当前页：浅灰胶囊 + 加粗（单色，不用彩色块） */
.nav-row.active { background: var(--surface-2); }
.nav-row.active > .nav-label,
.nav-row.active > .nav-label.static { color: var(--ink); font-weight: 600; }
.nav-row.active:hover { background: var(--surface-2); }

.shell {
  margin-left: calc(var(--sidebar-w) + var(--sheet-gap) * 2); min-width: 0;
  transition: margin-left var(--dur-slow) var(--ease);
}

/* 首屏前先按上次的选择收起，避免闪一下 */
.pre-collapsed .sidebar { transform: translateX(calc(-100% - var(--sheet-gap) * 2)); }
.pre-collapsed .shell { margin-left: 0; }
body.nav-collapsed .sidebar { transform: translateX(calc(-100% - var(--sheet-gap) * 2)); }
body.nav-collapsed .shell { margin-left: 0; }

/* 顶栏上的折叠按钮（三条线图标） */
.nav-collapse { flex: 0 0 auto; padding: 7px 8px; }
.nav-collapse .bars,
.nav-collapse .bars::before,
.nav-collapse .bars::after {
  display: block; width: 14px; height: 1.5px; background: var(--ink-2); content: "";
  border-radius: var(--pill);
}
.nav-collapse .bars { position: relative; }
.nav-collapse .bars::before { position: absolute; top: -4.5px; }
.nav-collapse .bars::after { position: absolute; top: 4.5px; }

/* ================================================================ 顶栏（毛玻璃） */

.topbar {
  position: sticky; top: 0; z-index: 30;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur);
  backdrop-filter: var(--blur);
  box-shadow: inset 0 -1px 0 var(--line);
}
@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .topbar { background: #fff; }
}
.topbar-inner {
  max-width: 1240px; margin: 0 auto; padding: 12px var(--gutter);
  display: flex; align-items: center; gap: 14px;
}

.search { position: relative; flex: 1 1 auto; max-width: 520px; }
.search::before {
  content: ""; position: absolute; left: 16px; top: 50%;
  width: 11px; height: 11px; margin-top: -7px;
  border: 1.6px solid var(--muted); border-radius: 50%;
  pointer-events: none;
}
.search::after {
  content: ""; position: absolute; left: 26px; top: 50%;
  width: 5px; height: 1.6px; margin-top: 2px;
  background: var(--muted); transform: rotate(45deg);
  border-radius: var(--pill); pointer-events: none;
}
.search input {
  width: 100%; padding: 10px 40px 10px 36px;
  font: inherit; font-size: 14.5px; color: var(--ink);
  background: var(--surface); border: 1px solid transparent; border-radius: var(--pill);
  outline: none; -webkit-appearance: none; appearance: none;
  transition: background .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.search input::placeholder { color: var(--muted); }
.search input::-webkit-search-cancel-button { -webkit-appearance: none; }
.search input:focus {
  background: #fff; border-color: var(--line);
  box-shadow: 0 0 0 4px rgba(0, 0, 0, 0.04);
}
.search .hint {
  position: absolute; right: 12px; top: 50%; transform: translateY(-50%);
  font-family: var(--mono); font-size: 11px; color: var(--muted);
  border: 1px solid var(--line); border-radius: 6px; padding: 1px 5px; background: #fff;
}
.topnav { display: flex; gap: 20px; font-size: 13.5px; margin-left: auto; }
.topnav a { color: var(--ink-2); }
.topnav a:hover { color: var(--ink); text-decoration: none; }

/* ================================================================ 布局 */

.layout {
  max-width: 1240px; margin: 0 auto; padding: 0 var(--gutter) 80px;
  display: grid; grid-template-columns: minmax(0, 44rem) var(--toc-w);
  /* 正文靠左、页内目录贴右：中间留出足够呼吸空间，页面不挤 */
  justify-content: space-between; gap: 72px; align-items: start;
}
/* 无页内目录的页面（筛选页）保留同样的栅格，保证左边缘与正文页对齐 */
.main { padding: 44px 0 40px; min-width: 0; }
.toc {
  position: sticky; top: 68px; max-height: calc(100vh - 96px); overflow-y: auto;
  scrollbar-width: none;
  padding: 48px 0 40px;
}
.toc::-webkit-scrollbar { display: none; }

/* ---------------------------------------------------------------- 页内目录 */

.toc-title {
  font-size: 11px; font-weight: 600; color: var(--muted);
  letter-spacing: .06em; margin: 0 0 12px; text-transform: uppercase;
}
.toc-list { list-style: none; margin: 0; padding: 0; }
.toc-list li { margin: 0; }
.toc-list a {
  display: block; padding: 4px 0 4px 12px; font-size: 12.5px; line-height: 1.5;
  color: var(--ink-2); border-left: 2px solid var(--line);
  transition: color var(--dur-fast) ease, border-left-color var(--dur-fast) ease;
}
.toc-list a:hover { color: var(--ink); text-decoration: none; border-left-color: var(--line-strong); }
.toc-list a.active { color: var(--ink); font-weight: 600; border-left-color: var(--ink); }
.toc-list .lvl-3 a { padding-left: 24px; font-size: 12px; color: var(--muted); }

/* ================================================================ 正文 */

.doc { max-width: none; }
.doc-header { margin-bottom: 32px; padding-bottom: 26px; border-bottom: 1px solid var(--line); }
.doc-header h1 {
  font-size: var(--fs-h1); line-height: 1.14; letter-spacing: -0.022em;
  font-weight: 700; margin: 0 0 14px;
}
.doc-summary {
  color: var(--ink-2); margin: 0 0 18px; font-size: 16.5px;
  line-height: 1.7; letter-spacing: -0.005em;
}
.doc-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 8px; align-items: center; font-size: 12px; }
.doc-source { font-size: 12px; color: var(--muted); }

.notice {
  margin: 22px 0; padding: 14px 18px; font-size: 14.5px; line-height: 1.7;
  border-radius: 14px; background: var(--warn-soft);
  border: 1px solid var(--warn-line); color: var(--warn);
}

.doc p, .doc li { font-size: var(--read-size); }
/* 层级：h1 文档标题 > 章节分组 h2 > 条目标题 h3 > 条目内 h2 > 条目内 h3/h4 > 正文 */
.doc h2 {
  font-size: var(--fs-h2); line-height: 1.3; letter-spacing: -0.02em; font-weight: 700;
  margin: 60px 0 18px; padding-top: 24px; border-top: 1px solid var(--line);
}
/* 条目内部的 ## 是「条目标题下的一小节」，比条目标题小一档，也不带分组分隔线 */
.doc .entry h2 {
  font-size: var(--fs-h3); line-height: 1.4; letter-spacing: -0.016em; font-weight: 680;
  margin: 34px 0 12px; padding-top: 0; border-top: 0;
}
.doc-header + * > h2:first-child, .doc > h2:first-child { border-top: 0; padding-top: 0; margin-top: 36px; }
.doc h3 { font-size: var(--fs-h3); letter-spacing: -0.014em; margin: 32px 0 10px; font-weight: 650; }
.doc h4 { font-size: var(--fs-h4); margin: 26px 0 8px; color: var(--ink); font-weight: 650; }
.doc p { margin: 0 0 18px; line-height: 1.78; }
.doc ul, .doc ol { margin: 0 0 18px; padding-left: 1.35em; }
.doc li { margin: 7px 0; line-height: 1.75; }
.doc li > ul, .doc li > ol { margin: 7px 0 5px; }
.doc blockquote {
  margin: 22px 0; padding: 3px 0 3px 18px; border-left: 2px solid var(--line-strong);
  color: var(--ink-2); font-size: var(--read-size); line-height: 1.75;
}
.doc blockquote p { margin: 8px 0; font-size: inherit; }
.doc hr { border: 0; border-top: 1px solid var(--line); margin: 40px 0; }
.doc code {
  font-family: var(--mono); font-size: .87em; background: var(--surface);
  padding: 2px 6px; border-radius: 6px;
}
.doc pre {
  background: var(--surface); border: 0; border-radius: var(--radius);
  padding: 16px 18px; overflow-x: auto; font-size: 13px; line-height: 1.65;
}
.doc pre code { background: none; padding: 0; }

.table-wrap {
  overflow-x: auto; margin: 0 0 26px;
  border: 1px solid var(--line); border-radius: var(--radius);
}
.doc table { border-collapse: collapse; width: 100%; font-size: 14px; }
.doc th, .doc td {
  border: 0; border-bottom: 1px solid var(--line);
  padding: 11px 14px; text-align: left; vertical-align: top; line-height: 1.6;
}
.doc table tr:last-child > * { border-bottom: 0; }
.doc th { background: transparent; font-weight: 600; font-size: 12.5px; color: var(--muted); }
.doc td { font-size: 14px; }

/* 正文内的链接：长段落里可辨认，不做彩色块 */
.doc p a, .doc li a, .doc td a, .doc blockquote a {
  text-decoration: underline;
  text-decoration-color: rgba(0, 102, 204, 0.35);
  text-underline-offset: 3px;
}
.doc p a:hover, .doc li a:hover, .doc td a:hover, .doc blockquote a:hover {
  text-decoration-color: var(--accent);
}

/* ---------------------------------------------------------------- 条目 */

.entry { margin: 0 0 44px; scroll-margin-top: 84px; }
.entry > h3 {
  font-size: var(--fs-entry); line-height: 1.4; letter-spacing: -0.018em; font-weight: 700;
  margin: 48px 0 14px; padding-left: 16px; border-left: 3px solid var(--ink);
}
.entry.highlight > h3 { background: var(--surface); border-radius: 0 var(--radius-sm) var(--radius-sm) 0; }

.entry-badges { display: flex; flex-wrap: wrap; gap: 6px; margin: 0 0 16px 15px; }
.chip {
  display: inline-block; white-space: nowrap;
  font-size: 11.5px; line-height: 2; padding: 0 10px;
  border: 1px solid transparent; border-radius: var(--pill);
  background: transparent; border-color: var(--line); color: var(--ink-2);
}
.chip-evidence { background: var(--accent-soft); border-color: transparent; color: #0a5bb8; }
.chip-verified { background: transparent; border-color: transparent; color: var(--muted); padding: 0 2px; }
.chip-stale { background: var(--warn-soft); border-color: var(--warn-line); color: var(--warn); }
.chip-todo { background: transparent; border: 1px dashed var(--line-strong); color: var(--muted); }

/* 来源与更新：默认折叠，保持简洁 */
.sources-details { margin: 18px 0 6px; border-top: 1px solid var(--line); padding-top: 10px; }
.sources-details > summary {
  cursor: pointer; list-style: none; font-size: 13px; color: var(--muted);
  display: flex; align-items: center; gap: 6px; padding: 2px 0;
}
.sources-details > summary::-webkit-details-marker { display: none; }
.sources-details > summary::before { content: "▸"; font-size: 11px; transition: transform .15s ease; }
.sources-details[open] > summary::before { transform: rotate(90deg); }
.sources-details > summary:hover { color: var(--ink-2); }
.sources-body { padding-top: 6px; }
.sources-body p { font-size: 13px; color: var(--ink-2); margin: 0 0 8px; line-height: 1.7; }
.sources-body ul { margin: 0; padding-left: 1.2em; }
.sources-body li { font-size: 13px; color: var(--ink-2); margin: 4px 0; line-height: 1.7; }
.sources-body a { color: var(--ink-2); word-break: break-all; }

/* 左侧一级目录允许两行，箭头垂直居中（class 在 li.nav-item 上） */
.nav-item.nav-l1 > .nav-row { align-items: flex-start; }
.nav-item.nav-l1 > .nav-row .nav-label { white-space: normal; line-height: 1.35; padding-top: 1px; }
.nav-item.nav-l1 > .nav-row .nav-toggle { margin-top: 1px; }

/* ================================================================ 浏览与筛选 */

.browse-head { margin-bottom: 24px; }
.browse-head h1 { font-size: 30px; letter-spacing: -0.02em; font-weight: 700; margin: 0 0 10px; }
.browse-count { color: var(--muted); font-size: 13.5px; margin: 0; }

.facets {
  margin-bottom: 30px; overflow: hidden;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
}
@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .facets { background: #fff; }
}
.facet {
  display: grid; grid-template-columns: 92px 1fr; gap: 14px;
  padding: 15px 20px; border-top: 1px solid var(--line);
}
.facet:first-child { border-top: 0; }
.facet-label { font-size: 12.5px; color: var(--muted); padding-top: 6px; }
.facet-values { display: flex; flex-wrap: wrap; gap: 7px; }
.facet-chip {
  font: inherit; font-size: 13px; line-height: 2; padding: 0 13px; cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: var(--pill); color: var(--ink-2);
  transition: background var(--dur-fast) ease, border-color var(--dur-fast) ease,
              color var(--dur-fast) ease, transform var(--dur-fast) var(--ease);
}
.facet-chip:active { transform: scale(.96); }
.facet-chip:hover { border-color: var(--line-strong); }
.facet-chip[aria-pressed="true"] {
  background: var(--ink); border-color: var(--ink); color: #fff; font-weight: 550;
}
.facet-actions {
  display: flex; gap: 18px; align-items: center;
  padding: 13px 20px; border-top: 1px solid var(--line);
  font-size: 12.5px; color: var(--muted);
}
.facet-actions button {
  font: inherit; font-size: 12.5px; background: none; border: 0;
  color: var(--accent); cursor: pointer; padding: 0;
}

.results { list-style: none; margin: 0; padding: 0; }
.result { padding: 20px 0; border-top: 1px solid var(--line); }
.result:first-child { border-top: 0; padding-top: 4px; }
.result-title {
  font-size: 16.5px; font-weight: 600; letter-spacing: -0.01em; color: var(--ink);
  transition: color var(--dur-fast) ease;
}
.result-title:hover { color: var(--accent); text-decoration: none; }
.result-summary { margin: 8px 0 10px; font-size: 15px; line-height: 1.7; color: var(--ink-2); }
.result-meta { margin: 0; display: flex; flex-wrap: wrap; gap: 6px; align-items: center; font-size: 12px; color: var(--muted); }
.empty { color: var(--muted); padding: 34px 0; }

/* 搜索无结果：给出可点的常见词与兜底入口，而不是只说「没找到」 */
.empty-block { padding: 28px 0 34px; border-top: 1px solid var(--line); margin-top: 18px; }
.empty-block .empty-title { font-size: 17px; font-weight: 650; color: var(--ink); margin: 0 0 8px; }
.empty-block .empty-desc { color: var(--muted); margin: 0 0 14px; }
.empty-block .empty-hint { color: var(--muted); margin: 0 0 8px; font-size: 15px; }
.empty-block .empty-tips { list-style: none; display: flex; flex-wrap: wrap; gap: 8px; padding: 0; margin: 0 0 16px; }
.empty-block .empty-tips a {
  display: inline-block; padding: 4px 11px; border: 1px solid var(--line);
  border-radius: 999px; font-size: 14px; text-decoration: none; color: var(--ink);
}
.empty-block .empty-tips a:hover { border-color: var(--accent); color: var(--accent); }
.empty-block .empty-links { color: var(--muted); margin: 0 0 10px; }
.empty-block .empty-clear a { font-size: 15px; }

/* 首页统计：一块磨砂面板 */
.stats {
  display: flex; flex-wrap: wrap; gap: 44px; margin: 4px 0 34px; padding: 22px 24px;
  background: var(--glass-strong);
  -webkit-backdrop-filter: var(--blur); backdrop-filter: var(--blur);
  border: 1px solid var(--line); border-radius: var(--radius-lg);
  box-shadow: var(--shadow-panel);
}
@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  .stats { background: #fff; }
}
.stat { font-size: 12.5px; color: var(--muted); }
.stat b {
  display: block; font-size: 26px; line-height: 1.25; letter-spacing: -0.02em;
  color: var(--ink); font-weight: 680; font-variant-numeric: tabular-nums;
}

.doc-nav {
  display: flex; justify-content: space-between; gap: 24px;
  margin-top: 56px; padding-top: 22px; border-top: 1px solid var(--line); font-size: 14.5px;
}
.doc-nav span { color: var(--muted); }

.loading { color: var(--muted); }

/* ================================================================ 页脚 */

.footer { border-top: 1px solid var(--line); background: transparent; }
.footer-inner {
  max-width: 1240px; margin: 0 auto; padding: 26px var(--gutter) 52px;
  font-size: 12.5px; color: var(--muted); line-height: 1.85;
}
.footer-inner p { margin: 7px 0; max-width: 62em; }

/* ================================================================ 响应式 */

@media (max-width: 1240px) {
  .layout { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .toc { display: none; }
}

@media (max-width: 900px) {
  :root {
    --read-size: 16.5px; --gutter: 20px;
    --fs-h1: 28px; --fs-h2: 22px; --fs-entry: 20px; --fs-h3: 18.5px; --fs-h4: 17px;
  }

  /* 移动端：侧栏变成从左侧滑入的磨砂薄片，圆角只在右侧 */
  .sidebar {
    top: 0; bottom: 0; left: 0; width: 300px; max-width: 86vw; z-index: 60;
    height: 100dvh;
    padding-top: env(safe-area-inset-top);
    padding-bottom: env(safe-area-inset-bottom);
    padding-left: env(safe-area-inset-left);
    border-radius: 0 var(--radius-lg) var(--radius-lg) 0;
    border-left: 0;
    transform: translateX(-100%);
  }
  .shell { margin-left: 0; }
  body.nav-collapsed .sidebar { transform: translateX(-100%); }
  body.sidebar-open .sidebar { transform: translateX(0); }
  html.drawer-open, body.sidebar-open { overflow: hidden; overscroll-behavior: none; }
  .sidebar-backdrop:not([hidden]) {
    display: block; position: fixed; inset: 0; z-index: 55;
    width: 100%; height: 100%; margin: 0; padding: 0; border: 0; cursor: pointer;
    background: rgba(0, 0, 0, 0.18);
    -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px);
    animation: oh-fade-in var(--dur) ease both;
  }
  body.sidebar-open .shell { position: relative; z-index: 1; }

  /* 触控目标放大到 40px 以上 */
  .nav-row { min-height: 40px; }
  .nav-l1 > .nav-row, .nav-l2 > .nav-row, .nav-l3 > .nav-row,
  .nav-l4 > .nav-row, .nav-l5 > .nav-row { min-height: 40px; }
  .nav-label { font-size: 14.5px; }
  .nav-label { padding-top: 11px; padding-bottom: 11px; }
  .nav-toggle { flex-basis: 32px; width: 32px; height: 44px; margin: 0 4px 0 0; }
  .nav-toggle::before { left: 12px; top: 18px; }
  .nav-dot { flex-basis: 32px; margin-left: 0; }
  .nav-item.nav-l1 > .nav-row { align-items: center; }
  .nav-item.nav-l1 > .nav-row .nav-label { padding-top: 11px; padding-bottom: 11px; }
  .nav-item.nav-l1 > .nav-row .nav-toggle { margin-top: 0; }
  .nav-l1 > .nav-row > .nav-label { font-size: 15px; }
  .nav-l2 > .nav-row > .nav-label, .nav-l3 > .nav-row > .nav-label { font-size: 14.5px; }
  .nav-l4 > .nav-row > .nav-label, .nav-l5 > .nav-row > .nav-label { font-size: 14px; }

  .topbar-inner {
    display: grid; grid-template-columns: 44px minmax(0, 1fr); gap: 2px 8px;
    padding: calc(8px + env(safe-area-inset-top)) max(var(--gutter), env(safe-area-inset-right)) 6px max(var(--gutter), env(safe-area-inset-left));
  }
  /* 侧栏不再放「按条件筛选」入口，移动端由顶栏保留，避免无处可进 */
  .topnav { grid-column: 1 / -1; width: 100%; display: flex; gap: 8px; margin: 0; font-size: 13px; }
  .topnav a { flex: 1; min-height: 36px; display: flex; align-items: center; justify-content: center; white-space: nowrap; }
  .search { min-width: 0; max-width: none; }
  .search input { min-height: 44px; padding-right: 14px; font-size: 16px; }
  .search .hint { display: none; }
  .menu-btn, .nav-collapse { display: inline-block; }
  .nav-collapse, .sidebar-close { width: 44px; height: 44px; flex-shrink: 0; padding: 12px; }
  .sidebar-close { display: inline-block; margin: -7px -8px -7px auto; }
  .nav-collapse .bars { display: block; width: 14px; margin: auto; }
  .main { padding-top: 28px; }
  .doc { overflow-wrap: anywhere; }
  .doc-header { margin-bottom: 28px; }
  .doc p, .doc li { line-height: 1.85; }
  .doc pre { max-width: 100%; font-size: 12.5px; padding: 14px; }
  .doc pre code { overflow-wrap: normal; }
  .table-wrap { max-width: 100%; overscroll-behavior-x: contain; }
  .table-wrap table { min-width: 540px; }
  .doc th, .doc td { padding: 10px 12px; }
  .doc-nav a { min-height: 44px; display: flex; align-items: center; }
  .footer-inner { padding-bottom: calc(28px + env(safe-area-inset-bottom)); }
  .layout { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }
  .footer-inner { padding-left: max(var(--gutter), env(safe-area-inset-left)); padding-right: max(var(--gutter), env(safe-area-inset-right)); }

  
  .doc h2 { margin-top: 46px; }
  
  .browse-head h1 { font-size: 25px; }
  .facet { grid-template-columns: 1fr; gap: 8px; padding: 14px 16px; }
  .facet-label { padding-top: 0; }
  .doc-nav { flex-direction: column; gap: 10px; }
  .stats { gap: 28px; padding: 18px; }
}

@media (max-width: 480px) {
  :root { --gutter: 16px; --fs-h1: 27px; }
  .facet-chip { min-height: 36px; display: inline-flex; align-items: center; }
  .result-title { line-height: 1.6; }
  .entry-badges { margin-left: 0; gap: 5px; }
  .chip { white-space: normal; }
  .table-wrap::before {
    content: "左右滑动查看完整表格"; display: block; position: sticky; left: 0;
    padding: 8px 12px; font-size: 11px; color: var(--muted); border-bottom: 1px solid var(--line);
  }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-delay: 0s !important;
    transition-duration: .001ms !important;
    scroll-behavior: auto !important;
  }
}

/* ---------------------------------------------------------------- 静态入口页（SEO permalink） */

.permalink-main { max-width: 44rem; margin: 0 auto; padding: 48px 24px 88px; }
.permalink-back { font-size: 13px; color: var(--muted); margin: 0 0 28px; }
.permalink-back a { color: var(--ink-2); }
.permalink-foot {
  margin-top: 48px; padding-top: 20px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted); line-height: 1.7;
}

/* 筛选页：默认只展开两维，高级条件收进「更多筛选」 */
.facet-more-row { border-top: 1px solid var(--line); padding: 10px 20px; }
.facet-more {
  font: inherit; font-size: 12.5px; color: var(--ink-2); cursor: pointer;
  background: #fff; border: 1px solid var(--line); border-radius: var(--pill);
  padding: 3px 12px;
  transition: border-color var(--dur-fast) ease, color var(--dur-fast) ease;
}
.facet-more:hover { border-color: var(--line-strong); color: var(--ink); }
.facet-active { background: rgba(120, 120, 128, 0.04); }
.facet-chip-active { background: var(--surface-2); border-color: transparent; color: var(--ink); }
.facet-chip-active:hover { border-color: transparent; background: rgba(120, 120, 128, 0.16); }

/* 图解：与正文同宽，点击可打开原图 */
.figure { margin: 26px 0 30px; }
.figure-link { display: block; }
.figure img {
  display: block; width: 100%; height: auto;
  border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff;
}
.figure figcaption {
  margin-top: 8px; font-size: 12.5px; color: var(--muted); line-height: 1.65;
}
.figure figcaption a { color: var(--ink-2); text-decoration: underline; }

/* 下载卡片：一篇文章里最多三四个，靠文字区分用途而不是靠颜色 */
.res-cards { margin: 24px 0 28px; display: grid; gap: 10px; }
.res-card {
  display: flex; gap: 14px; align-items: flex-start;
  padding: 13px 15px; border: 1px solid var(--line); border-radius: var(--radius);
  background: #fff; text-decoration: none;
  transition: border-color var(--dur-fast) ease, background var(--dur-fast) ease;
}
.res-card:hover { border-color: var(--line-strong); background: var(--surface-2); }
.res-fmt {
  flex: 0 0 auto; min-width: 46px; padding: 3px 0; text-align: center;
  font-size: 11px; letter-spacing: 0.04em; color: var(--muted);
  border: 1px solid var(--line); border-radius: 5px;
}
.res-body { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.res-name { font-size: 14px; color: var(--ink); line-height: 1.45; }
.res-desc { font-size: 13px; color: var(--ink-2); line-height: 1.6; }
.res-meta { font-size: 11.5px; color: var(--muted); }

