/* ==========================================================================
   运维知识库 —— 主题样式（Oamc-Team）
   纯手写 CSS，不依赖任何框架。深色为默认，右上角可切浅色。
   ========================================================================== */

/* ---------- 设计变量 ---------- */
:root {
  color-scheme: dark;

  --bg: #060a13;
  --bg-2: #0a1120;
  --surface: rgba(255, 255, 255, .04);
  --surface-2: rgba(255, 255, 255, .07);
  --surface-solid: #0c1524;

  --line: rgba(255, 255, 255, .08);
  --line-2: rgba(255, 255, 255, .16);

  --ink: #eaf0fb;
  --ink-2: #c2cde0;
  --muted: #8695b0;

  --accent: #6ea8fe;
  --accent-2: #3fe0c5;
  --accent-ink: #ffffff;
  --accent-soft: rgba(110, 168, 254, .14);
  --accent-line: rgba(110, 168, 254, .38);

  --code-bg: #080e1b;
  --code-inline-bg: rgba(110, 168, 254, .13);
  --code-inline-ink: #a9c8ff;

  --topbar: rgba(6, 10, 19, .72);
  --shadow: 0 30px 70px rgba(2, 6, 16, .55);
  --glow: 0 10px 34px rgba(78, 130, 255, .28);

  --hero-ink-1: #ffffff;
  --hero-ink-2: #9db9ff;

  --danger: #ff6b81;
  --warn: #f5b544;

  --radius: 14px;
  --radius-lg: 22px;

  --mono: ui-monospace, SFMono-Regular, "Cascadia Mono", Consolas, "Liberation Mono", monospace;
  --sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
          "PingFang SC", "Noto Sans SC", sans-serif;
}

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

  --bg: #f3f6fc;
  --bg-2: #ffffff;
  --surface: rgba(255, 255, 255, .82);
  --surface-2: #ffffff;
  --surface-solid: #ffffff;

  --line: rgba(16, 32, 64, .10);
  --line-2: rgba(16, 32, 64, .18);

  --ink: #0f172a;
  --ink-2: #33415c;
  --muted: #667085;

  --accent: #3563e9;
  --accent-2: #0d9488;
  --accent-ink: #ffffff;
  --accent-soft: rgba(53, 99, 233, .10);
  --accent-line: rgba(53, 99, 233, .35);

  --code-inline-bg: rgba(53, 99, 233, .09);
  --code-inline-ink: #2b4fa8;

  --topbar: rgba(243, 246, 252, .82);
  --shadow: 0 24px 60px rgba(16, 32, 64, .12);
  --glow: 0 10px 30px rgba(53, 99, 233, .20);

  --hero-ink-1: #0b1220;
  --hero-ink-2: #3563e9;
}

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

html { scroll-behavior: smooth; }

body {
  margin: 0;
  padding: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font: 16px/1.7 var(--sans);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

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

code, pre, kbd { font-family: var(--mono); }

::selection { background: var(--accent-soft); color: var(--ink); }

/* 极光背景 */
body::before {
  content: "";
  position: fixed;
  inset: -30% -10% auto -10%;
  height: 120vh;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(50% 42% at 18% 4%, rgba(84, 120, 255, .30), transparent 62%),
    radial-gradient(44% 38% at 82% 8%, rgba(34, 211, 238, .18), transparent 62%),
    radial-gradient(40% 36% at 55% 34%, rgba(155, 92, 255, .13), transparent 64%);
  filter: blur(24px);
  animation: aurora 26s ease-in-out infinite alternate;
}

/* 网格纹理 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, .028) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, .028) 1px, transparent 1px);
  background-size: 46px 46px;
  -webkit-mask-image: radial-gradient(72% 52% at 50% 0%, #000 0%, transparent 100%);
  mask-image: radial-gradient(72% 52% at 50% 0%, #000 0%, transparent 100%);
}

[data-theme="light"] body::before { opacity: .55; }
[data-theme="light"] body::after {
  background-image:
    linear-gradient(rgba(16, 32, 64, .045) 1px, transparent 1px),
    linear-gradient(90deg, rgba(16, 32, 64, .045) 1px, transparent 1px);
}

@keyframes aurora {
  0%   { transform: translate3d(0, 0, 0) scale(1); }
  50%  { transform: translate3d(-3%, 2%, 0) scale(1.06); }
  100% { transform: translate3d(2%, -2%, 0) scale(1.02); }
}

/* 阅读进度条 */
.progress {
  position: fixed;
  top: 0;
  left: 0;
  z-index: 60;
  width: 0;
  height: 2px;
  background: linear-gradient(90deg, var(--accent), var(--accent-2));
  box-shadow: 0 0 12px var(--accent);
  transition: width .1s linear;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: sticky;
  top: 0;
  z-index: 50;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 560px) minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  height: 62px;
  padding: 0 24px;
  background: var(--topbar);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  transition: box-shadow .25s ease, border-color .25s ease;
}
.topbar.scrolled {
  box-shadow: 0 12px 40px rgba(0, 0, 0, .35);
  border-bottom-color: var(--line-2);
}

/* 首页：顶栏融进背景，滚动后才是玻璃条 */
.topbar-wide {
  background: transparent;
  border-bottom-color: transparent;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  transition: background .25s ease, border-color .25s ease, box-shadow .25s ease;
}
.topbar-wide.scrolled {
  background: var(--topbar);
  border-bottom-color: var(--line);
  backdrop-filter: blur(18px) saturate(150%);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
}

.topbar-mid {
  display: flex;
  justify-content: center;
  align-items: center;
  min-width: 0;
}

.brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--ink);
  font-weight: 700;
  font-size: 15.5px;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand:hover { color: var(--ink); }

.brand-mark {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  border-radius: 10px;
  background: linear-gradient(140deg, #7db0ff, #4c7bfa 55%, #2fd8c4);
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .45);
  flex: none;
  transition: transform .22s cubic-bezier(.2, .7, .3, 1), box-shadow .22s;
}
.brand-mark svg { display: block; width: 22px; height: 22px; }
.brand:hover .brand-mark {
  transform: rotate(-8deg) scale(1.06);
  box-shadow: 0 12px 30px rgba(78, 130, 255, .45), inset 0 1px 0 rgba(255, 255, 255, .5);
}

.search { width: 100%; }
.search input {
  width: 100%;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  transition: border-color .18s, box-shadow .18s, background .18s;
}
.search input::placeholder { color: var(--muted); }
.search input:focus {
  outline: none;
  background: var(--surface-2);
  border-color: var(--accent-line);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.actions { display: flex; align-items: center; gap: 8px; justify-self: end; }
.actions form { display: inline; margin: 0; }

.icon-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 34px;
  padding: 0 11px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .18s, background .18s, color .18s;
}
.icon-btn:hover {
  color: var(--ink);
  border-color: var(--line-2);
  background: var(--surface-2);
}
.icon-btn .ic { width: 16px; height: 16px; }
.icon-btn kbd {
  padding: 1px 5px;
  border: 1px solid var(--line-2);
  border-radius: 5px;
  color: var(--muted);
  font-size: 11px;
  line-height: 1.5;
}

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  height: 36px;
  padding: 0 16px;
  border: 1px solid transparent;
  border-radius: 10px;
  background: linear-gradient(180deg, #7db0ff, #4c7bfa);
  color: var(--accent-ink);
  font: inherit;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  white-space: nowrap;
  box-shadow: var(--glow), inset 0 1px 0 rgba(255, 255, 255, .35);
  transition: transform .16s ease, box-shadow .2s ease, filter .2s ease;
}
.btn:hover {
  color: var(--accent-ink);
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 14px 34px rgba(78, 130, 255, .4), inset 0 1px 0 rgba(255, 255, 255, .4);
}
.btn:active { transform: translateY(0); }

.btn.ghost {
  background: var(--surface);
  color: var(--ink-2);
  border-color: var(--line);
  box-shadow: none;
}
.btn.ghost:hover {
  color: var(--ink);
  background: var(--surface-2);
  border-color: var(--line-2);
  box-shadow: none;
}

.btn.small { height: 28px; padding: 0 10px; font-size: 13px; }

.btn.danger {
  background: linear-gradient(180deg, #ff7d90, #e5484d);
  box-shadow: 0 10px 26px rgba(229, 72, 77, .3);
}

/* ---------- 布局 ---------- */
.layout {
  display: grid;
  grid-template-columns: 264px minmax(0, 1fr);
  gap: 36px;
  max-width: 1264px;
  margin: 0 auto;
  padding: 32px 24px 88px;
}

.layout.wide {
  grid-template-columns: minmax(0, 1fr);
  max-width: 1080px;
  padding-top: 40px;
}
.content-wide { max-width: none; }

.content { min-width: 0; max-width: 860px; }
.content.content-wide { max-width: none; }

/* ---------- 侧栏 ---------- */
.sidebar {
  position: sticky;
  top: 86px;
  align-self: start;
  max-height: calc(100vh - 110px);
  overflow: auto;
  padding: 4px 6px 8px 0;
  font-size: 14px;
  scrollbar-width: thin;
  scrollbar-color: var(--line-2) transparent;
}
.sidebar::-webkit-scrollbar { width: 6px; }
.sidebar::-webkit-scrollbar-thumb {
  background: var(--line-2);
  border-radius: 99px;
}

.sidebar-head {
  margin-bottom: 12px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.tree { list-style: none; margin: 0; padding: 0; }
.tree .tree {
  margin-left: 10px;
  padding-left: 10px;
  border-left: 1px solid var(--line);
}
.tree li { margin: 1px 0; }

.tree a {
  display: block;
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: background .15s, color .15s;
}
.tree a:hover {
  background: var(--surface);
  color: var(--ink);
}
.tree a.active {
  background: var(--accent-soft);
  color: var(--accent);
  font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}

.tree-home {
  display: block;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink);
  font-weight: 600;
  transition: background .15s;
}
.tree-home:hover { background: var(--surface); color: var(--ink); }
.tree-home::before {
  content: "⌂";
  display: inline-block;
  width: 16px;
  color: var(--muted);
  font-weight: 400;
}

.tree-quick {
  display: block;
  margin-bottom: 14px;
  padding: 6px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  transition: background .15s, color .15s;
}
.tree-quick:hover { background: var(--surface); color: var(--ink); }
.tree-quick::before {
  content: "⌕";
  display: inline-block;
  width: 16px;
  color: var(--muted);
}

.tree summary {
  display: flex;
  align-items: center;
  padding: 5px 10px;
  border-radius: 8px;
  color: var(--ink-2);
  cursor: pointer;
  list-style: none;
  transition: background .15s, color .15s;
}
.tree summary::-webkit-details-marker { display: none; }
.tree summary::before {
  content: "";
  width: 5px;
  height: 5px;
  margin-right: 9px;
  border-right: 1.5px solid var(--muted);
  border-bottom: 1.5px solid var(--muted);
  transform: rotate(-45deg);
  transition: transform .16s;
  flex: none;
}
.tree details[open] > summary::before { transform: rotate(45deg); }
.tree summary:hover { background: var(--surface); color: var(--ink); }
.tree summary a { padding: 0; background: none; }

/* ---------- 欢迎页 Hero ---------- */
.hero {
  position: relative;
  padding: 64px 52px 44px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .06), rgba(255, 255, 255, .015)),
    var(--bg-2);
  overflow: hidden;
  box-shadow: var(--shadow);
}
[data-theme="light"] .hero {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .95), rgba(255, 255, 255, .7)),
    var(--bg-2);
}

/* 顶部一道渐隐的高光 */
.hero::before {
  content: "";
  position: absolute;
  inset: -1px -1px auto -1px;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent-line), transparent);
}
/* 右上角的柔光球 */
.hero::after {
  content: "";
  position: absolute;
  top: -160px;
  right: -120px;
  width: 420px;
  height: 420px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(110, 168, 254, .28), transparent 65%);
  filter: blur(20px);
  pointer-events: none;
}

.hero-kicker {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 16px;
  padding: 4px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .06em;
}
.hero-kicker::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent-2);
  box-shadow: 0 0 10px var(--accent-2);
}

.hero-title {
  position: relative;
  margin: 0;
  font-size: clamp(34px, 4.6vw, 58px);
  line-height: 1.1;
  letter-spacing: -.03em;
  background: linear-gradient(180deg, var(--hero-ink-1) 30%, var(--hero-ink-2));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-lead {
  position: relative;
  white-space: pre-line;
  margin: 18px 0 0;
  max-width: 560px;
  color: var(--ink-2);
  font-size: 16px;
  line-height: 1.8;
}

.hero-search {
  position: relative;
  display: flex;
  gap: 10px;
  max-width: 540px;
  margin: 32px 0 0;
}
.hero-search .field { position: relative; flex: 1; }
.hero-search .field-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  color: var(--muted);
  pointer-events: none;
}
.hero-search .field-icon .ic { width: 18px; height: 18px; }

.hero-search input {
  width: 100%;
  height: 50px;
  padding: 0 18px 0 46px;
  border: 1px solid var(--line-2);
  border-radius: 12px;
  background: rgba(0, 0, 0, .22);
  color: var(--ink);
  font: inherit;
  font-size: 15px;
  transition: border-color .18s, box-shadow .18s;
}
[data-theme="light"] .hero-search input { background: #fff; }
.hero-search input::placeholder { color: var(--muted); }
.hero-search input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft), 0 0 30px rgba(110, 168, 254, .18);
}
.hero-search .btn { height: 50px; padding: 0 26px; border-radius: 12px; }

.hero-stats {
  position: relative;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 26px;
  color: var(--muted);
  font-size: 13px;
}
.hero-stats span {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.hero-stats b {
  color: var(--ink);
  font-weight: 600;
  font-variant-numeric: tabular-nums;
}

.dot {
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--line-2);
  flex: none;
}
.hero-stats .dot { display: none; }

.hero-actions { position: relative; display: flex; gap: 10px; margin-top: 28px; }

/* 右侧装饰用的「配置窗口」 */
.hero-art {
  position: absolute;
  top: 50%;
  right: 40px;
  width: 300px;
  pointer-events: none;
  animation: float 9s ease-in-out infinite;
}
.hero-art-window {
  border: 1px solid rgba(255, 255, 255, .12);
  border-radius: 14px;
  background: rgba(7, 12, 24, .78);
  box-shadow: 0 30px 70px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  transform: rotate(-1.6deg);
  overflow: hidden;
}
[data-theme="light"] .hero-art-window {
  box-shadow: 0 22px 48px rgba(16, 32, 64, .16), inset 0 1px 0 rgba(255, 255, 255, .07);
}
.hero-art-bar {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 12px;
  border-bottom: 1px solid rgba(255, 255, 255, .07);
}
.hero-art-bar i {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: rgba(255, 255, 255, .18);
}
.hero-art-bar i:first-child { background: #ff6b6b66; }
.hero-art-bar i:nth-child(2) { background: #ffd16666; }
.hero-art-bar i:nth-child(3) { background: #4ade8066; }
.hero-art-bar span {
  margin-left: auto;
  color: #7c8ba6;
  font-family: var(--mono);
  font-size: 10.5px;
}
.hero-art-window pre {
  margin: 0;
  padding: 14px 16px 16px;
  overflow: hidden;
  color: #c7d5ea;
  font-size: 11.5px;
  line-height: 1.85;
}
.hero-art-window .c { color: #5d6f8c; }
.hero-art-window .p { color: var(--accent-2); }

@keyframes float {
  0%, 100% { transform: translateY(-50%); }
  50%      { transform: translateY(calc(-50% - 9px)); }
}

@media (max-width: 1180px) {
  .hero-art { display: none; }
}

/* ---------- 通用分区 ---------- */
.section { margin-top: 52px; }
.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 18px;
}
.section-head h2 {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
}
.section-note { color: var(--muted); font-size: 12.5px; }

/* ---------- 分类卡片 ---------- */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 14px;
}

/* 紧凑分类卡：图标 + 名称 + 篇数 */
.card-sm {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 13px 16px;
  color: var(--ink);
}
.card-sm .card-icon {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}
.card-sm .card-icon .ic { width: 17px; height: 17px; }
.card-sm .card-name { font-size: 14.5px; font-weight: 600; }
.card-sm .card-count { padding: 1px 8px; font-size: 11px; }

.card {
  position: relative;
  margin: 0;
  padding: 18px 18px 15px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  overflow: hidden;
  transition: transform .22s cubic-bezier(.2, .7, .3, 1), border-color .22s, box-shadow .22s;
}
.card::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  padding: 1px;
  background: linear-gradient(135deg, var(--accent-line), transparent 45%);
  -webkit-mask: linear-gradient(#000 0 0) content-box, linear-gradient(#000 0 0);
  -webkit-mask-composite: xor;
  mask-composite: exclude;
  opacity: 0;
  transition: opacity .22s;
  pointer-events: none;
}
.card:hover {
  transform: translateY(-3px);
  border-color: transparent;
  box-shadow: 0 20px 44px rgba(3, 10, 26, .45);
}
.card:hover::before { opacity: 1; }

.card-title {
  display: flex;
  align-items: center;
  gap: 11px;
  color: var(--ink);
  font-size: 15.5px;
  font-weight: 600;
}
.card-title:hover { color: var(--ink); }

.card-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 11px;
  background: linear-gradient(140deg, rgba(110, 168, 254, .28), rgba(63, 224, 197, .14));
  color: #a8c9ff;
  flex: none;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .09);
}
[data-theme="light"] .card-icon { color: var(--accent); }
.card-icon .ic { width: 19px; height: 19px; }

.card-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.card-count {
  margin-left: auto;
  padding: 2px 9px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--muted);
  font-size: 11.5px;
  font-weight: 500;
  flex: none;
  font-variant-numeric: tabular-nums;
}

.card-links {
  list-style: none;
  margin: 14px 0 0;
  padding: 12px 0 0;
  border-top: 1px dashed var(--line);
  font-size: 13.5px;
}
.card-links li { margin: 6px 0; }
.card-links a {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  white-space: normal;
  line-height: 1.55;
  color: var(--ink-2);
  transition: color .15s, transform .15s;
}
.card-links a:hover {
  color: var(--accent);
  transform: translateX(2px);
}

.card-empty {
  margin: 14px 0 0;
  padding-top: 12px;
  border-top: 1px dashed var(--line);
  color: var(--muted);
  font-size: 13px;
}

/* ---------- 时间线 ---------- */
.timeline {
  position: relative;
  list-style: none;
  margin: 0;
  padding: 0 0 0 6px;
  border-left: 1px solid var(--line);
}
.timeline li {
  position: relative;
  display: flex;
  gap: 16px;
  padding: 8px 0 8px 22px;
  font-size: 14px;
}
.timeline li::before {
  content: "";
  position: absolute;
  left: -4.5px;
  top: 16px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--bg);
  border: 1.5px solid var(--accent);
  box-shadow: 0 0 12px var(--accent);
}
.timeline-date {
  min-width: 88px;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.timeline-subject { color: var(--ink-2); }

/* ---------- 正文 ---------- */
.doc-head {
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 6px;
}
.doc-title {
  margin: 0;
  font-size: 30px;
  line-height: 1.25;
  letter-spacing: -.02em;
}
.doc-meta {
  display: flex;
  gap: 14px;
  margin-bottom: 20px;
  font-size: 12.5px;
  color: var(--muted);
}
.doc-meta a { color: var(--muted); transition: color .15s; }
.doc-meta a:hover { color: var(--accent); }

.doc-body { font-size: 15.5px; color: var(--ink-2); }
.doc-body h1 {
  margin: 36px 0 14px;
  font-size: 26px;
  color: var(--ink);
  letter-spacing: -.01em;
}
.doc-body h2 {
  margin: 40px 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  font-size: 20px;
  color: var(--ink);
  letter-spacing: -.01em;
}
.doc-body h3 { margin: 28px 0 10px; font-size: 17px; color: var(--ink); }
.doc-body h4 { margin: 22px 0 8px; font-size: 15px; color: var(--ink-2); }

.doc-body p { margin: 14px 0; }
.doc-body ul, .doc-body ol { padding-left: 24px; }
.doc-body li { margin: 6px 0; }
.doc-body li::marker { color: var(--muted); }

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

.doc-body a { border-bottom: 1px solid transparent; transition: border-color .15s; }
.doc-body a:hover { border-bottom-color: var(--accent-line); }

.doc-body blockquote {
  margin: 20px 0;
  padding: 12px 18px;
  border-left: 2px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--accent-soft);
  color: var(--ink);
}
.doc-body blockquote p { margin: 0; }

.doc-body table {
  width: 100%;
  margin: 20px 0;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  font-size: 14.5px;
}
.doc-body th, .doc-body td {
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  text-align: left;
  vertical-align: top;
}
.doc-body th {
  background: var(--surface);
  color: var(--ink);
  font-weight: 600;
  font-size: 13.5px;
}
.doc-body tr:last-child td { border-bottom: 0; }
.doc-body tr:nth-child(even) td { background: rgba(255, 255, 255, .015); }
[data-theme="light"] .doc-body tr:nth-child(even) td { background: rgba(16, 32, 64, .02); }

.doc-body img {
  max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
}

.doc-body :not(pre) > code {
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--code-inline-bg);
  color: var(--code-inline-ink);
  font-size: .89em;
}

.doc-body pre {
  position: relative;
  margin: 20px 0;
  padding: 16px 18px;
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--code-bg);
  color: #dbe4f5;
  font-size: 13.5px;
  line-height: 1.65;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .04);
}
.doc-body pre code {
  background: none;
  color: inherit;
  padding: 0;
  font-size: inherit;
}
.doc-body pre .copy {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 3px 9px;
  border: 1px solid rgba(255, 255, 255, .16);
  border-radius: 7px;
  background: rgba(255, 255, 255, .07);
  color: #b9c6dc;
  font: inherit;
  font-size: 11.5px;
  cursor: pointer;
  opacity: 0;
  transition: opacity .15s, background .15s;
}
.doc-body pre:hover .copy { opacity: 1; }
.doc-body pre .copy:hover { background: rgba(255, 255, 255, .16); }

/* admonition */
.admonition {
  margin: 20px 0;
  padding: 14px 18px;
  border: 1px solid rgba(245, 181, 68, .28);
  border-left: 2px solid var(--warn);
  border-radius: 0 12px 12px 0;
  background: rgba(245, 181, 68, .07);
}
.admonition-title {
  margin: 0 0 6px;
  color: var(--warn);
  font-size: 13.5px;
  font-weight: 600;
}
.admonition p { margin: 0; }
.admonition p + p { margin-top: 8px; }

/* ---------- 目录 ---------- */
.toc {
  margin: 0 0 26px;
  padding: 12px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
  font-size: 13.5px;
}
.toc summary {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .08em;
  text-transform: uppercase;
  cursor: pointer;
  list-style: none;
}
.toc summary::-webkit-details-marker { display: none; }
.toc summary::before {
  content: "▸";
  display: inline-block;
  margin-right: 8px;
  transition: transform .16s;
}
.toc details[open] > summary::before,
.toc[open] > summary::before { transform: rotate(90deg); }
.toc ul { margin: 10px 0 0; padding-left: 18px; }
.toc ul ul { padding-left: 16px; }
.toc a { color: var(--ink-2); }
.toc a:hover { color: var(--accent); }

/* ---------- 首页最近更新（正文页底部） ---------- */
.recent { margin-top: 56px; }
.recent h2 {
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .1em;
  text-transform: uppercase;
}
.recent ul { list-style: none; margin: 0; padding: 0; }
.recent li {
  display: flex;
  gap: 14px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
  font-size: 14px;
  color: var(--ink-2);
}
.recent .date {
  color: var(--muted);
  font-family: var(--mono);
  font-size: 12.5px;
}

/* ---------- 搜索结果 ---------- */
.results { list-style: none; margin: 20px 0; padding: 0; }
.results li {
  padding: 16px 0;
  border-bottom: 1px solid var(--line);
}
.result-title { font-size: 16px; font-weight: 600; color: var(--ink); }
.result-title:hover { color: var(--accent); }
.result-snippet {
  margin: 8px 0;
  color: var(--ink-2);
  font-size: 14px;
  word-break: break-word;
}
.result-path {
  color: var(--muted);
  font-size: 12px;
}
.result-path::before {
  content: "→ ";
  color: var(--accent);
}

/* ---------- 历史 ---------- */
.history {
  width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  font-size: 14px;
}
.history th, .history td {
  padding: 10px 16px;
  border-bottom: 1px solid var(--line);
  text-align: left;
}
.history th {
  background: var(--surface);
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .06em;
  text-transform: uppercase;
}
.history tr:last-child td { border-bottom: 0; }
.history code { color: var(--accent); }

/* ---------- 编辑器 ---------- */
.editor-head {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}
.editor-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.hint { color: var(--muted); font-size: 13.5px; }
.hint code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--code-inline-bg);
  color: var(--code-inline-ink);
}

.toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.toolbar button {
  padding: 5px 11px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.toolbar button:hover {
  color: var(--ink);
  border-color: var(--line-2);
  background: var(--surface-2);
}

.editor-panes { display: grid; grid-template-columns: 1fr; gap: 12px; }
.editor-panes.split { grid-template-columns: 1fr 1fr; }

#body {
  width: 100%;
  min-height: 62vh;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--code-bg);
  color: #dbe4f5;
  font-family: var(--mono);
  font-size: 13.5px;
  line-height: 1.7;
  resize: vertical;
  tab-size: 4;
  transition: border-color .18s, box-shadow .18s;
}
#body:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.preview {
  min-height: 62vh;
  max-height: 76vh;
  overflow: auto;
  padding: 16px 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.preview-label {
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--line);
  color: var(--muted);
  font-size: 11.5px;
  letter-spacing: .08em;
  text-transform: uppercase;
}
.hidden { display: none !important; }

/* ---------- 附件 ---------- */
.attachments {
  margin-top: 44px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}
.attachments h2 { margin: 0 0 6px; font-size: 17px; }
.upload-form {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  margin: 14px 0;
}
.upload-form input[type="file"] {
  padding: 8px 10px;
  border: 1px dashed var(--line-2);
  border-radius: 10px;
  background: var(--surface);
  color: var(--muted);
  font: inherit;
  font-size: 13px;
}
.file-list { list-style: none; margin: 14px 0; padding: 0; font-size: 14px; }
.file-list li {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
  border-bottom: 1px dashed var(--line);
}
.file-list li a { color: var(--ink-2); }
.file-list li a:hover { color: var(--accent); }
.file-list li .btn { margin-left: auto; }

.danger-zone {
  margin-top: 52px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

/* ---------- 表单 ---------- */
.stack {
  display: flex;
  flex-direction: column;
  gap: 16px;
  max-width: 520px;
}
.stack label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: var(--ink-2);
  font-size: 13.5px;
}
.stack input[type="text"],
.stack input[type="password"] {
  height: 40px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
  transition: border-color .18s, box-shadow .18s;
}
.stack input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}
.stack .btn { align-self: flex-start; height: 40px; }

.login-box {
  max-width: 430px;
  margin: 56px auto;
  padding: 32px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  box-shadow: var(--shadow);
}

/* ---------- 提示条 ---------- */
.flashes { margin-bottom: 20px; }
.flash {
  margin-bottom: 8px;
  padding: 11px 16px;
  border: 1px solid var(--accent-line);
  border-left: 2px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--accent-soft);
  color: var(--ink);
  font-size: 14px;
}

/* ---------- 空状态 ---------- */
.empty-state {
  padding: 32px;
  border: 1px dashed var(--line-2);
  border-radius: 16px;
  background: var(--surface);
  color: var(--muted);
  font-size: 14px;
}
.empty-state p { margin: 0; }
.empty-state code {
  padding: 1px 6px;
  border-radius: 5px;
  background: var(--code-inline-bg);
  color: var(--code-inline-ink);
}

/* ---------- 页脚 ---------- */
.site-foot {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  max-width: 1264px;
  margin: 0 auto;
  padding: 0 24px 48px;
  color: var(--muted);
  font-size: 12px;
  opacity: .8;
}

/* ---------- 命令面板 ---------- */
.palette {
  position: fixed;
  inset: 0;
  z-index: 100;
  display: flex;
  justify-content: center;
  align-items: flex-start;
  padding: 12vh 20px 20px;
  background: rgba(3, 7, 16, .62);
  backdrop-filter: blur(8px);
  -webkit-backdrop-filter: blur(8px);
}
.palette[hidden] { display: none; }

.palette-box {
  width: min(620px, 100%);
  border: 1px solid var(--line-2);
  border-radius: 16px;
  background: var(--surface-solid);
  box-shadow: 0 40px 100px rgba(0, 0, 0, .6);
  overflow: hidden;
  animation: pop .18s cubic-bezier(.2, .8, .3, 1);
}
@keyframes pop {
  from { opacity: 0; transform: translateY(-8px) scale(.985); }
  to   { opacity: 1; transform: none; }
}

.palette-input {
  width: 100%;
  padding: 18px 20px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 15.5px;
  outline: none;
}
.palette-input::placeholder { color: var(--muted); }

.palette-list {
  max-height: 52vh;
  overflow: auto;
  padding: 8px;
}
.palette-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 12px;
  border-radius: 9px;
  color: var(--ink-2);
  font-size: 14px;
  cursor: pointer;
}
.palette-item.active {
  background: var(--accent-soft);
  color: var(--ink);
}
.palette-item .slug {
  margin-left: auto;
  color: var(--muted);
  font-family: var(--mono);
  font-size: 11.5px;
}
.palette-empty {
  padding: 22px 12px;
  color: var(--muted);
  font-size: 13.5px;
  text-align: center;
}
.palette-foot {
  display: flex;
  gap: 18px;
  padding: 10px 20px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  font-size: 12px;
}
.palette-foot kbd {
  padding: 1px 5px;
  margin-right: 3px;
  border: 1px solid var(--line-2);
  border-radius: 4px;
  font-size: 11px;
}

/* ---------- 入场动画 ---------- */
html.js .reveal {
  opacity: 0;
  transform: translateY(10px);
  transition: opacity .3s ease, transform .3s cubic-bezier(.2, .7, .3, 1);
}
html.js .reveal.in { opacity: 1; transform: none; }

/* 主题切换按钮：深色显示太阳，浅色显示月亮 */
[data-theme="dark"] .ic-moon { display: none; }
[data-theme="light"] .ic-sun { display: none; }
.ic-sun, .ic-moon { display: inline-flex; }

/* ---------- 响应式 ---------- */
@media (max-width: 960px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
    gap: 22px;
    padding: 20px 16px 64px;
  }
  .layout.wide { grid-template-columns: minmax(0, 1fr); }
  .sidebar { position: static; max-height: none; order: -1; }
  .editor-panes.split { grid-template-columns: 1fr; }
  .topbar {
    grid-template-columns: minmax(0, 1fr) auto;
    height: auto;
    padding: 10px 16px;
    gap: 10px;
  }
  .brand { min-width: 0; }
  .topbar-mid { grid-column: 1 / -1; justify-content: stretch; }
  .search { width: 100%; }
  .actions { justify-self: end; flex-wrap: wrap; justify-content: flex-end; }
  .doc-title { font-size: 24px; }
  .hero { padding: 38px 22px 30px; border-radius: 18px; }
  .hero-title { font-size: 34px; }
  .hero-lead { font-size: 14.5px; max-width: none; }
  .hero-search { max-width: none; flex-wrap: wrap; }
  .hero-search .field { flex-basis: 100%; }
  .hero-search .btn { width: 100%; }
  .section { margin-top: 40px; }
  .card-grid { grid-template-columns: minmax(0, 1fr); }
  .timeline-date { min-width: 78px; }
  .site-foot { flex-wrap: wrap; }
  .icon-btn kbd { display: none; }
}

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  body::before { animation: none; }
  html.js .reveal { opacity: 1; transform: none; transition: none; }
  .btn, .card, .card-links a { transition: none; }
  .palette-box { animation: none; }
  .hero-art { animation: none; }
}

/* ---------- 标签 / 置顶 / 标签页 ---------- */
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 6px 0 22px;
}
.tag-chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 11px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 12.5px;
  transition: border-color .15s, color .15s, background .15s;
}
.tag-chip:hover {
  color: var(--accent);
  border-color: var(--accent-line);
  background: var(--accent-soft);
}
.tag-chip span { color: var(--muted); font-size: 11px; }
.tag-chip.draft {
  color: var(--warn);
  border-color: rgba(245, 181, 68, .35);
  background: rgba(245, 181, 68, .08);
}
.tag-chip.pin {
  color: var(--accent-2);
  border-color: rgba(63, 224, 197, .32);
  background: rgba(63, 224, 197, .08);
}

.tag-cloud { display: flex; flex-wrap: wrap; gap: 8px; }

.pin-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
  gap: 12px;
}
.pin {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  transition: border-color .18s, background .18s, transform .18s;
}
.pin:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-2px);
}
.pin-title { color: var(--ink); font-size: 14.5px; font-weight: 600; }
.pin:hover .pin-title { color: var(--accent); }
.pin-tags { color: var(--muted); font-size: 12px; }

.page-list { list-style: none; margin: 18px 0; padding: 0; }
.page-list li { padding: 11px 0; border-bottom: 1px dashed var(--line); }
.page-list a { color: var(--ink-2); font-size: 15px; }
.page-list a:hover { color: var(--accent); }

.editor-tags { margin: 8px 0 0; }

/* ?still：截图/打印时跳过入场动画 */
html.still .reveal { opacity: 1; transform: none; transition: none; }
html.still body::before { animation: none; }

/* ---------- 标签：云 + 索引页 ---------- */
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 10px 20px;
}
.tag-item {
  color: var(--ink-2);
  font-size: 15px;
  line-height: 1.5;
  transition: color .15s;
}
.tag-item .tag-hash { color: var(--muted); font-weight: 400; }
.tag-item sup {
  margin-left: 3px;
  color: var(--muted);
  font-size: .62em;
  font-variant-numeric: tabular-nums;
}
.tag-item:hover,
.tag-item:hover .tag-hash { color: var(--accent); }
.tag-item.s1 { font-size: 14px; }
.tag-item.s2 { font-size: 17.5px; }
.tag-item.s3 { font-size: 21px; }

.tag-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(238px, 1fr));
  gap: 12px;
  margin-top: 18px;
}
.tag-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  min-width: 0;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: linear-gradient(180deg, var(--surface-2), var(--surface));
  transition: border-color .16s, background .16s, transform .16s;
}
.tag-card:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  transform: translateY(-2px);
}
.tag-card-head { display: flex; align-items: baseline; gap: 8px; }
.tag-card-name { color: var(--ink); font-size: 15px; font-weight: 600; }
.tag-card:hover .tag-card-name { color: var(--accent); }
.tag-card-count {
  margin-left: auto;
  color: var(--muted);
  font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.tag-card-pages {
  color: var(--muted);
  font-size: 12.5px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 最近更新 + 标签 并排 ---------- */
.home-split {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 30px 48px;
  align-items: start;
  margin-top: 52px;
}
.home-split .section { margin-top: 0; }

@media (max-width: 960px) {
  .home-split { grid-template-columns: minmax(0, 1fr); gap: 36px; }
}

/* ==========================================================================
   动效
   ========================================================================== */

@keyframes rise {
  from { opacity: 0; transform: translateY(14px); }
  to   { opacity: 1; transform: none; }
}

/* 首屏元素依次浮起 */
.hero > .hero-kicker { animation: rise .32s cubic-bezier(.2, .7, .3, 1) .02s backwards; }
.hero > .hero-title  { animation: rise .34s cubic-bezier(.2, .7, .3, 1) .06s backwards; }
.hero > .hero-lead   { animation: rise .34s cubic-bezier(.2, .7, .3, 1) .10s backwards; }
.hero > .hero-search { animation: rise .34s cubic-bezier(.2, .7, .3, 1) .14s backwards; }
.hero > .hero-stats  { animation: rise .34s cubic-bezier(.2, .7, .3, 1) .18s backwards; }

/* 卡片滚进视野时依次出现 */
.section.in .card,
.section.in .pin {
  animation: rise .3s cubic-bezier(.2, .7, .3, 1) backwards;
  animation-delay: calc(var(--i, 0) * 30ms);
}

/* 正文整体淡入 */
.doc { animation: rise .26s ease .02s backwards; }

/* 卡片图标悬停微转 */
.card-icon { transition: transform .25s cubic-bezier(.2, .7, .3, 1); }
.card:hover .card-icon { transform: rotate(-6deg) scale(1.08); }

/* 正文链接：下划线从左侧展开 */
.doc-body a {
  border-bottom: 0;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: background-size .25s ease;
}
.doc-body a:hover { background-size: 100% 1px; }

/* 侧栏条目悬停轻微右移 */
.tree a, .tree summary { transition: background .15s, color .15s, transform .15s; }
.tree a:hover, .tree summary:hover { transform: translateX(2px); }
.tree a.active:hover { transform: none; }

/* 按钮按下 */
.btn:active { transform: scale(.98); }

/* 回到顶部 */
.to-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 40;
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 50%;
  background: var(--surface-solid);
  color: var(--ink-2);
  font-size: 16px;
  cursor: pointer;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  box-shadow: var(--shadow);
  transition: opacity .25s ease, transform .25s ease, color .2s, border-color .2s;
}
.to-top.show { opacity: 1; transform: none; pointer-events: auto; }
.to-top:hover { color: var(--accent); border-color: var(--accent-line); }

@media (max-width: 960px) {
  .to-top { right: 16px; bottom: 16px; width: 38px; height: 38px; }
}

/* 截图模式和减少动效时全部关掉 */
html.still .hero > *,
html.still .section.in .card,
html.still .section.in .pin,
html.still .doc,
html.still .to-top { animation: none; }

@media (prefers-reduced-motion: reduce) {
  .hero > .hero-kicker, .hero > .hero-title, .hero > .hero-lead,
  .hero > .hero-search, .hero > .hero-stats,
  .section.in .card, .section.in .pin, .doc { animation: none; }
  .doc-body a { transition: none; }
  .tree a, .tree summary { transition: none; }
  .tree a:hover, .tree summary:hover { transform: none; }
}

/* ---------- 首页粒子背景 ---------- */
.hero-particles {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  opacity: .85;
}

/* ---------- 命令速查 ---------- */
[hidden] { display: none !important; }

.cheat-bar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 18px 0 4px;
}
.cheat-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 2px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
}
.cheat-tab {
  padding: 6px 14px;
  border: 0;
  border-radius: 999px;
  background: transparent;
  color: var(--muted);
  font: inherit;
  font-size: 13px;
  cursor: pointer;
  transition: background .15s, color .15s;
}
.cheat-tab:hover { color: var(--ink); }
.cheat-tab.is-on { background: var(--accent-soft); color: var(--accent); }

.cheat-search {
  flex: 1;
  min-width: 220px;
  height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}
.cheat-search:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.cheat-section { margin-top: 34px; }
.cheat-section-head {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.cheat-section-head h2 { font-size: 17px; }
.cheat-count { color: var(--muted); font-size: 12px; }

.cheat-group { margin-top: 18px; }
.cheat-group h3 {
  margin: 0 0 4px;
  color: var(--muted);
  font-size: 12.5px;
  font-weight: 600;
  letter-spacing: .02em;
}

.cheat-row {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  width: 100%;
  padding: 9px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--ink);
  font: inherit;
  text-align: left;
  cursor: pointer;
  transition: background .12s;
}
.cheat-row:hover { background: var(--surface); }
.cheat-row.is-copied { background: var(--accent-soft); }
.cheat-cmd {
  color: var(--accent);
  font-family: var(--mono);
  font-size: 13px;
  overflow-wrap: anywhere;
}
.cheat-desc { color: var(--muted); font-size: 13px; }

.cheat-empty { margin-top: 26px; }
.cheat-toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  z-index: 60;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--ink);
  font-size: 13px;
  box-shadow: var(--shadow);
  transform: translateX(-50%);
  animation: rise .2s ease both;
}

@media (max-width: 720px) {
  .cheat-row { grid-template-columns: minmax(0, 1fr); gap: 2px; padding: 10px 12px; }
  .cheat-desc { font-size: 12.5px; }
}

/* 首页顶栏中间的快捷入口 */
.topbar-quick {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 8px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font-size: 13.5px;
  transition: border-color .18s, color .18s, background .18s;
}
.topbar-quick::before {
  content: "⌕";
  color: var(--muted);
  font-size: 15px;
}
.topbar-quick:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}
.topbar-quick:hover::before { color: var(--accent); }

/* ---------- 搜索：命中高亮、分类筛选、耗时 ---------- */
mark {
  padding: 0 2px;
  border-radius: 3px;
  background: rgba(110, 168, 254, .28);
  color: var(--ink);
}
[data-theme="light"] mark { background: rgba(58, 122, 214, .18); }

.search-cost {
  margin-left: 8px;
  color: var(--muted);
  font-size: 12px;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 0 4px;
}
.filter-chip {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 6px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  font-size: 13px;
  transition: border-color .15s, color .15s, background .15s;
}
.filter-chip span {
  color: var(--muted);
  font-size: 11.5px;
  font-variant-numeric: tabular-nums;
}
.filter-chip:hover { border-color: var(--accent-line); color: var(--accent); }
.filter-chip.is-on {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}
.filter-chip.is-on span { color: var(--accent); }

/* ---------- 后台：搜索面板 ---------- */
.search-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}
.mini-head {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 600;
  letter-spacing: .02em;
}
@media (max-width: 720px) {
  .search-split { grid-template-columns: 1fr; gap: 16px; }
}

/* ---------- 后台：内容体检 ---------- */
.health-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 12px;
  margin-bottom: 18px;
}
.health-tile {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.health-tile b {
  display: block;
  color: var(--ink);
  font-size: 22px;
  line-height: 1.2;
  font-variant-numeric: tabular-nums;
}
.health-tile span { color: var(--muted); font-size: 12.5px; }
.health-tile.is-bad { border-color: rgba(240, 163, 94, .45); }
.health-tile.is-bad b { color: #f0a35e; }

/* ---------- 登录：验证码 ---------- */
.captcha-line {
  display: flex;
  align-items: center;
  gap: 10px;
}
.captcha-line b {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font-family: var(--mono);
  font-size: 17px;
  letter-spacing: 3px;
  font-weight: 600;
}
.captcha-eq { color: var(--muted); }
.captcha-line input {
  flex: 1;
  min-width: 0;
  height: 40px;
  padding: 0 13px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
}
.captcha-line input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* ---------- 后台：登录安全 ---------- */
.security-row {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
}
.security-row:last-child { border-bottom: 0; }
.security-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.security-text b { font-size: 14px; }
.security-text .dim { font-size: 12.5px; }
.security-actions { display: flex; gap: 8px; flex: none; }
.security-setup {
  margin-top: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface);
}
.security-setup p { margin: 0 0 8px; font-size: 13px; }
.security-setup .secret,
.security-setup .otp-uri {
  display: block;
  margin-bottom: 10px;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--bg-2);
  font-family: var(--mono);
  font-size: 12.5px;
  word-break: break-all;
}
.security-setup .inline-form {
  display: flex;
  gap: 8px;
  margin-top: 6px;
}
.security-setup .inline-form input {
  flex: 1;
  min-width: 0;
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 9px;
  background: var(--surface);
  color: var(--ink);
  font: inherit;
  font-size: 14px;
}

/* ==========================================================================
   手机适配（≤720px）
   ========================================================================== */
@media (max-width: 720px) {
  /* 顶栏：命令速查在侧栏也有，小屏先让位给内容 */
  .topbar-quick { display: none; }
  .topbar { gap: 8px; }
  .icon-btn { width: 34px; height: 34px; }

  /* 侧栏导航：限高可滚动，别把正文挤到第三屏 */
  .sidebar {
    position: static;
    order: -1;
    max-height: 42vh;
    overflow: auto;
    padding: 12px 12px 10px;
    border: 1px solid var(--line);
    border-radius: 14px;
    background: var(--surface);
    -webkit-overflow-scrolling: touch;
  }
  .sidebar-head { margin-bottom: 8px; font-size: 10.5px; }
  .tree summary, .tree a { padding: 8px 10px; }

  /* 首页分类：两列，别铺成 16 行 */
  .card-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .card-sm { padding: 11px 12px; gap: 9px; }
  .card-sm .card-icon { width: 28px; height: 28px; border-radius: 9px; }
  .card-sm .card-name { font-size: 13.5px; }
  .card-sm .card-count { display: none; }

  /* 首屏 */
  .hero { padding: 28px 18px 24px; }
  .hero-title { font-size: 30px; }
  .hero-lead { font-size: 14px; }
  .hero-stats { gap: 6px; }
  .hero-stats span, .hero-stats a { font-size: 11.5px; padding: 4px 10px; }

  /* 正文：表格和代码横向滚动，不许撑破页面 */
  .doc-body table {
    display: block;
    width: 100%;
    overflow-x: auto;
    white-space: nowrap;
  }
  .doc-body th, .doc-body td { padding: 8px 10px; font-size: 13px; }
  .doc-body pre { font-size: 12.5px; }
  .doc-body { font-size: 15px; }
  .doc-title { font-size: 22px; }

  /* 搜索与速查 */
  .filter-row { gap: 6px; }
  .filter-chip { padding: 5px 10px; font-size: 12px; }
  .cheat-tabs { width: 100%; }
  .cheat-tab { flex: 1; text-align: center; padding: 7px 8px; }
  .cheat-search { min-width: 0; }

  /* 回到顶部别挡内容 */
  .to-top { right: 14px; bottom: 14px; width: 36px; height: 36px; }
}
  /* 常看的：两列，省一屏 */
  .pin-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px; }
  .pin { padding: 11px 12px; }
  .pin-title, .pin-name { font-size: 13.5px; }
/* 顶栏：品牌和按钮同一行，搜索单独一行，别占三行 */
@media (max-width: 720px) {
  .actions { grid-row: 1; grid-column: 2; }
}

/* ---------- 文章分享 ---------- */
.share-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin: 4px 0 22px;
}
.share-label {
  color: var(--muted);
  font-size: 12px;
  margin-right: 2px;
}
.share-btn {
  padding: 5px 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s;
}
.share-btn:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
}
.share-qr {
  margin: -10px 0 22px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--surface);
  text-align: center;
}
.share-qr-box {
  display: inline-block;
  padding: 10px;
  border-radius: 10px;
  background: #fff;
  line-height: 0;
}
.share-qr-box svg { display: block; }
.share-qr p { margin: 10px 0 0; font-size: 12.5px; }
.share-toast {
  position: fixed;
  left: 50%;
  bottom: 32px;
  z-index: 80;
  padding: 10px 18px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface-solid);
  color: var(--ink);
  font-size: 13px;
  box-shadow: var(--shadow);
  transform: translate(-50%, 12px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
}
.share-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 720px) {
  .share-row { gap: 6px; }
  .share-btn { padding: 6px 11px; font-size: 12px; }
}
/* 分享按钮：和标签、按钮统一成小胶囊，带图标 */
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 12px 6px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--surface);
  color: var(--ink-2);
  font: inherit;
  font-size: 12.5px;
  line-height: 1;
  cursor: pointer;
  transition: border-color .15s, color .15s, background .15s, transform .15s;
}
.share-btn svg {
  width: 14px;
  height: 14px;
  flex: none;
  opacity: .8;
}
.share-btn:hover {
  border-color: var(--accent-line);
  background: var(--accent-soft);
  color: var(--accent);
  transform: translateY(-1px);
}
.share-btn:hover svg { opacity: 1; }
.share-label {
  color: var(--muted);
  font-size: 12px;
  letter-spacing: .02em;
}

/* ---------- 修改记录 ---------- */
.diff-stat { color: var(--muted); font-size: 12px; white-space: nowrap; }
.diff-plus { color: #4fd1a5; }
.diff-minus { color: #f08b8b; }
.history-subject { color: var(--ink-2); font-size: 13px; }
.history-link { color: var(--muted); font-size: 12.5px; }
.history-link:hover { color: var(--accent); }
.history tr.is-active { background: var(--accent-soft); }

.diff-panel {
  margin: 16px 0 26px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.diff-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 13px;
}
.diff-head b { font-family: var(--mono); font-weight: 600; }
.diff-close { margin-left: auto; color: var(--muted); font-size: 12.5px; }
.diff-close:hover { color: var(--accent); }
.diff-body {
  margin: 0;
  padding: 10px 0;
  max-height: 460px;
  overflow: auto;
  font-family: var(--mono);
  font-size: 12.5px;
  line-height: 1.65;
  background: var(--bg-2);
}
.diff-line { display: block; padding: 0 14px; white-space: pre-wrap; word-break: break-word; }
.diff-line.add { background: rgba(79, 209, 165, .12); color: #9fe8cd; }
.diff-line.del { background: rgba(240, 139, 139, .12); color: #f3b3b3; }
.diff-line.hunk { color: var(--accent); background: rgba(110, 168, 254, .08); }
.diff-line.ctx { color: var(--muted); }
[data-theme="light"] .diff-line.add { color: #1d7a5a; }
[data-theme="light"] .diff-line.del { color: #a33a3a; }
/* 修改记录：按版本列 diff */
.rev {
  margin: 0 0 18px;
  border: 1px solid var(--line);
  border-radius: 12px;
  overflow: hidden;
  background: var(--surface);
}
.rev-head {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  padding: 10px 14px;
  border-bottom: 1px solid var(--line);
  font-size: 12.5px;
}
.rev-index {
  color: var(--muted);
  font-variant-numeric: tabular-nums;
}
.rev-date { color: var(--ink-2); }
.rev-subject {
  color: var(--muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  max-width: 46ch;
}
.rev-hash {
  margin-left: auto;
  padding: 1px 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  color: var(--muted);
  font-size: 11px;
}
.rev-more summary {
  padding: 9px 14px;
  color: var(--muted);
  font-size: 12.5px;
  cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.rev-more summary:hover { color: var(--accent); }
