/* 自托管 Inter（仅拉丁子集，约 72KB）。
   中文字符不在子集内，会自动落到 PingFang SC / 微软雅黑，
   所以数字和英文用 Inter，中文保持系统字体——这是通用做法。 */
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("/static/fonts/inter-latin-400-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 500;
  font-display: swap;
  src: url("/static/fonts/inter-latin-500-normal.woff2") format("woff2");
}
@font-face {
  font-family: "Inter";
  font-style: normal;
  font-weight: 600;
  font-display: swap;
  src: url("/static/fonts/inter-latin-600-normal.woff2") format("woff2");
}

/* ============================================================
   设计系统
   参考 transitions.dev / beautifului.dev 的设计语言：
   - 边框用 inset box-shadow 画（4%~8% 不透明度），不用实心 border
   - 阴影分层且极轻，不做发光
   - 主按钮是纯黑白，强调色只留给链接
   - 动效统一走 --ease-smooth-out，时长按 --duration-* 分级
   - 所有前景色均已核对 WCAG AA（正文 >= 4.5:1）
   ============================================================ */

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

:root {
  color-scheme: dark;

  --bg:             #08090a;
  --surface:        #0e1012;
  --surface-hover:  #131618;
  --stage:          #0a0c0d;

  --text:           #f2f3f5;   /* 17.95:1 */
  --text-muted:     #a1a7b3;   /*  8.25:1 */
  --text-subtle:    #7d848f;   /*  5.28:1 */

  --accent:         #8ab4f8;   /*  9.46:1 */
  --accent-quiet:   rgba(138, 180, 248, 0.12);

  --ok:             #4ade80;
  --warn:           #fbbf24;

  --ring:           rgba(255, 255, 255, 0.08);
  --ring-strong:    rgba(255, 255, 255, 0.14);
  --ring-inset:     rgba(255, 255, 255, 0.06);

  --btn-primary-bg:   #fafafa;
  --btn-primary-text: #08090a;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.4);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.32), 0 1px 2px rgba(0, 0, 0, 0.24);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.44), 0 2px 6px rgba(0, 0, 0, 0.28);

  --duration-micro: 80ms;
  --duration-quick: 150ms;
  --duration-fast:  250ms;
  --duration-slow:  400ms;
  --ease-smooth-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-bounce:     cubic-bezier(0.34, 1.36, 0.64, 1);

  --r-sm: 8px;
  --r-md: 12px;
  --r-lg: 16px;
  --r-xl: 20px;
  --r-pill: 999px;

  --maxw: 1080px;
  --font-sans: "Inter", -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: "Roboto Mono", ui-monospace, SFMono-Regular, "JetBrains Mono", Menlo, Consolas, monospace;
}

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

  --bg:             #fdfdfd;
  --surface:        #ffffff;
  --surface-hover:  #fbfbfb;
  --stage:          #f9f9f9;

  --text:           #0d0d0d;   /* 19.11:1 */
  --text-muted:     #6c6c6c;   /*  5.16:1 */
  --text-subtle:    #5f5f5f;   /*  6.28:1 */

  --accent:         #1a56db;   /*  6.08:1 */
  --accent-quiet:   rgba(26, 86, 219, 0.08);

  --ok:             #15803d;
  --warn:           #a16207;

  --ring:           rgba(0, 0, 0, 0.07);
  --ring-strong:    rgba(0, 0, 0, 0.13);
  --ring-inset:     rgba(0, 0, 0, 0.05);

  --btn-primary-bg:   #0d0d0d;
  --btn-primary-text: #ffffff;

  --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-md: 0 2px 8px rgba(0, 0, 0, 0.05), 0 1px 2px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 8px 28px rgba(0, 0, 0, 0.07), 0 2px 6px rgba(0, 0, 0, 0.04);
}

/* ---------- base ---------- */

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

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.65;
  letter-spacing: -0.006em;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  font-feature-settings: "cv02", "cv03", "cv04", "cv11";
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

a { color: inherit; text-decoration: none; }
h1, h2, h3, h4 { margin: 0; font-weight: 600; line-height: 1.22; letter-spacing: -0.022em; }
p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font-family: inherit; }

::selection { background: var(--accent-quiet); }

:focus-visible {
  outline: 2px solid var(--accent);
  outline-offset: 2px;
  border-radius: var(--r-sm);
}

/* 全屏布局：不再用 max-width 收窄居中，只留响应式左右内边距 */
.container { width: 100%; max-width: none; margin: 0; padding: 0 clamp(20px, 3.2vw, 64px); }
/* 长文仍然限宽——1920px 下一行 200 个字符没法读。但左对齐，不再居中 */
.narrow { max-width: 860px; }
.center { text-align: center; }
.muted { color: var(--text-muted); }
.empty { color: var(--text-muted); font-size: 14.5px; }

.mono { font-family: var(--font-mono); font-size: 12.5px; letter-spacing: 0; }

/* ---------- header ---------- */

/* 顶栏不用 backdrop-filter：sticky + backdrop-filter 在滚动时
   每帧都要重采样背后内容，是"闪屏"的典型来源。改成实底色。 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg);
  box-shadow: inset 0 -1px 0 0 var(--ring);
}

.header-inner { display: flex; align-items: center; gap: 20px; height: 58px; }

.brand { display: flex; align-items: center; gap: 8px; font-weight: 600; font-size: 14.5px; }
.brand-avatar {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  /* img 上必须用非 inset 的 ring，inset 会被图片盖住 */
  box-shadow: 0 0 0 1px var(--ring-strong);
}

.nav { display: flex; gap: 2px; margin-left: auto; }
.nav-link {
  padding: 6px 12px;
  border-radius: var(--r-sm);
  font-size: 13.5px;
  color: var(--text-muted);
  transition: color var(--duration-quick) var(--ease-smooth-out),
              background var(--duration-quick) var(--ease-smooth-out);
}
.nav-link:hover { color: var(--text); background: var(--surface-hover); }

.header-actions { display: flex; gap: 6px; margin-left: 6px; }

.icon-btn {
  width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  border: none;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: 13px;
  box-shadow: inset 0 0 0 1px var(--ring);
  transition: color var(--duration-quick) var(--ease-smooth-out),
              box-shadow var(--duration-quick) var(--ease-smooth-out),
              background var(--duration-quick) var(--ease-smooth-out);
}
.icon-btn:hover {
  color: var(--text);
  background: var(--surface-hover);
  box-shadow: inset 0 0 0 1px var(--ring-strong);
}

/* ---------- hero ---------- */

.hero { padding: 108px 0 76px; }
.hero .container { display: flex; flex-direction: column; align-items: flex-start; }

.eyebrow {
  font-family: var(--font-mono);
  font-size: 12px;
  letter-spacing: 0.04em;
  color: var(--text-muted);
  margin-bottom: 22px;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 5px 12px;
  border-radius: var(--r-pill);
  box-shadow: inset 0 0 0 1px var(--ring);
}
.eyebrow::before {
  content: "";
  width: 5px; height: 5px;
  border-radius: 50%;
  background: var(--ok);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--ok) 18%, transparent);
}
a.eyebrow { transition: color var(--duration-quick) var(--ease-smooth-out),
                        box-shadow var(--duration-quick) var(--ease-smooth-out); }
a.eyebrow:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--ring-strong); }

.hero-title {
  font-size: clamp(32px, 5.2vw, 54px);
  font-weight: 640;
  letter-spacing: -0.035em;
  line-height: 1.12;
  margin-bottom: 20px;
  max-width: 16em;
  text-wrap: balance;
}

.hero-sub {
  font-size: 16.5px;
  line-height: 1.7;
  color: var(--text-muted);
  max-width: 34em;
  text-wrap: pretty;
}

.actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 34px; }

.btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 20px;
  border: none;
  border-radius: var(--r-pill);
  font-size: 14px;
  font-weight: 500;
  color: var(--text);
  background: transparent;
  box-shadow: inset 0 0 0 1px var(--ring);
  cursor: pointer;
  transition: transform var(--duration-fast) var(--ease-smooth-out),
              box-shadow var(--duration-quick) var(--ease-smooth-out),
              background var(--duration-quick) var(--ease-smooth-out);
}
.btn:hover { background: var(--surface-hover); box-shadow: inset 0 0 0 1px var(--ring-strong); }
.btn:active { transform: scale(0.975); }

.btn-primary {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  font-weight: 550;
  box-shadow: var(--shadow-sm);
}
.btn-primary:hover {
  background: var(--btn-primary-bg);
  box-shadow: var(--shadow-md);
  transform: translateY(-1px);
}
.btn-primary:active { transform: translateY(0) scale(0.975); }

/* ---------- stats ---------- */

.stats {
  display: flex;
  gap: 0;
  margin-top: 52px;
  padding-top: 32px;
  box-shadow: inset 0 1px 0 0 var(--ring);
  width: 100%;
  max-width: 560px;
}
.stat {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  padding: 0 16px;
}
.stat + .stat { box-shadow: inset 1px 0 0 0 var(--ring); }
.stat strong {
  font-family: var(--font-mono);
  font-size: 22px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.stat span { font-size: 12.5px; color: var(--text-subtle); }

/* ---------- sections ---------- */

.site-main { flex: 1; }
.section { padding: 76px 0; }

.section-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 30px;
}
.section-head-left { display: flex; align-items: baseline; gap: 12px; }
.section-num {
  font-family: var(--font-mono);
  font-size: 12px;
  color: var(--text-subtle);
  padding-top: 2px;
}
.section-title { font-size: 19px; letter-spacing: -0.02em; }

.more {
  font-size: 13.5px;
  color: var(--text-muted);
  transition: color var(--duration-quick) var(--ease-smooth-out);
}
.more:hover { color: var(--accent); }

.page-title { font-size: 34px; letter-spacing: -0.03em; margin-bottom: 12px; }
.page-sub { color: var(--text-muted); margin-bottom: 34px; max-width: 40em; font-size: 15px; }
.sub-title {
  font-size: 15px;
  margin: 46px 0 16px;
  padding-top: 28px;
  box-shadow: inset 0 1px 0 0 var(--ring);
  color: var(--text);
}

/* ---------- project cards ---------- */


.card {
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--ring-inset), inset 0 -1px 0 0 var(--ring);
  transition: transform var(--duration-fast) var(--ease-smooth-out),
              box-shadow var(--duration-fast) var(--ease-smooth-out);
}
.card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--ring-strong), inset 0 -1px 0 0 var(--ring);
}

.card-cat {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-subtle);
}

.status {
  font-size: 11px;
  font-weight: 500;
  padding: 2px 9px;
  border-radius: var(--r-pill);
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px currentColor;
  opacity: 0.9;
}
.status-active { color: var(--ok); }
.status-wip { color: var(--warn); }
.status-archived { color: var(--text-subtle); }

.card-body { display: flex; flex-direction: column; flex: 1; padding: 20px; }

.card-title { font-size: 16.5px; margin-bottom: 6px; letter-spacing: -0.018em; }
.card-tagline { font-size: 13.5px; color: var(--text-muted); line-height: 1.6; }
.card-desc {
  font-size: 13px;
  color: var(--text-subtle);
  line-height: 1.7;
  margin-top: 12px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tags { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 16px; }
.tag {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 8px;
  border-radius: var(--r-sm);
  color: var(--text-muted);
  background: var(--stage);
  box-shadow: inset 0 0 0 1px var(--ring-inset);
}

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: auto;
  padding-top: 18px;
}
.card-links { display: flex; align-items: center; gap: 14px; }
.link-primary { font-size: 13px; font-weight: 500; color: var(--accent); }
.link-primary:hover { text-decoration: underline; text-underline-offset: 3px; }
.link-ghost { font-size: 13px; color: var(--text-muted); transition: color var(--duration-quick) var(--ease-smooth-out); }
.link-ghost:hover { color: var(--text); }
.link-muted { font-size: 12.5px; color: var(--text-subtle); }
.card-year { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-subtle); }

/* ---------- filters ---------- */

.filters { display: flex; flex-wrap: wrap; gap: 7px; margin-bottom: 14px; }
.chip {
  font-size: 13px;
  padding: 6px 14px;
  border: none;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--ring);
  transition: color var(--duration-quick) var(--ease-smooth-out),
              background var(--duration-quick) var(--ease-smooth-out),
              box-shadow var(--duration-quick) var(--ease-smooth-out);
}
.chip:hover { color: var(--text); background: var(--surface-hover); box-shadow: inset 0 0 0 1px var(--ring-strong); }
.chip-active {
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  box-shadow: var(--shadow-sm);
}
.chip-active:hover { background: var(--btn-primary-bg); color: var(--btn-primary-text); }

.result-count { font-family: var(--font-mono); font-size: 12px; color: var(--text-subtle); margin-bottom: 22px; }

/* ---------- post list ---------- */

.post-list { display: flex; flex-direction: column; }
.post-item { box-shadow: inset 0 -1px 0 0 var(--ring); }
.post-item:first-child { box-shadow: inset 0 1px 0 0 var(--ring), inset 0 -1px 0 0 var(--ring); }
.post-link {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 4px 20px;
  padding: 20px 12px;
  margin: 0 -12px;
  border-radius: var(--r-md);
  transition: background var(--duration-quick) var(--ease-smooth-out);
}
.post-link:hover { background: var(--surface-hover); }
.post-date { font-family: var(--font-mono); font-size: 12px; color: var(--text-subtle); padding-top: 3px; }
.post-title { grid-column: 2; font-size: 15.5px; font-weight: 550; letter-spacing: -0.015em; transition: color var(--duration-quick) var(--ease-smooth-out); }
.post-link:hover .post-title { color: var(--accent); }
.post-summary { grid-column: 2; font-size: 13.5px; color: var(--text-muted); line-height: 1.6; }
.post-meta { grid-column: 2; font-family: var(--font-mono); font-size: 11.5px; color: var(--text-subtle); margin-top: 3px; }

.back { display: inline-block; font-size: 13px; color: var(--text-muted); margin-bottom: 24px; transition: color var(--duration-quick) var(--ease-smooth-out); }
.back:hover { color: var(--accent); }
.post-h1 { font-size: 34px; letter-spacing: -0.03em; line-height: 1.2; margin-bottom: 14px; }
.post-info { font-family: var(--font-mono); font-size: 12px; color: var(--text-subtle); margin-bottom: 40px; }

/* ---------- prose ---------- */

.prose { font-size: 15.5px; line-height: 1.8; color: var(--text); }
.prose p { margin: 0 0 22px; }
.prose h2 { font-size: 20px; margin: 46px 0 16px; letter-spacing: -0.02em; }
.prose h3 { font-size: 16.5px; margin: 34px 0 12px; }
.prose ul, .prose ol { margin: 0 0 22px; padding-left: 22px; list-style: revert; }
.prose li { margin-bottom: 7px; }
.prose a { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.prose code {
  font-family: var(--font-mono);
  font-size: 12.5px;
  padding: 2px 6px;
  border-radius: 6px;
  background: var(--stage);
  box-shadow: inset 0 0 0 1px var(--ring-inset);
}
.prose pre {
  background: var(--stage);
  border-radius: var(--r-md);
  padding: 18px 20px;
  overflow-x: auto;
  margin: 0 0 24px;
  box-shadow: inset 0 0 0 1px var(--ring-inset);
}
.prose pre code { background: none; box-shadow: none; padding: 0; font-size: 12.5px; line-height: 1.75; }
.prose blockquote {
  margin: 0 0 24px;
  padding: 2px 0 2px 18px;
  box-shadow: inset 2px 0 0 0 var(--ring-strong);
  color: var(--text-muted);
}
.prose hr { border: none; height: 1px; background: var(--ring); margin: 40px 0; }
.prose table { width: 100%; border-collapse: collapse; margin-bottom: 24px; font-size: 13.5px; }
.prose th, .prose td { padding: 10px 14px; text-align: left; box-shadow: inset 0 -1px 0 0 var(--ring); }
.prose th { font-weight: 550; color: var(--text); background: var(--stage); }
.prose img { max-width: 100%; height: auto; border-radius: var(--r-md); }

/* ---------- contact ---------- */

.contact-list { display: flex; flex-direction: column; }
.contact-list li {
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  padding: 13px 0;
  font-size: 14.5px;
  box-shadow: inset 0 -1px 0 0 var(--ring);
}
.contact-key { font-family: var(--font-mono); font-size: 12px; color: var(--text-subtle); padding-top: 3px; }
.contact-list a { color: var(--accent); }
.contact-list a:hover { text-decoration: underline; text-underline-offset: 3px; }

/* 页脚已移除；主内容区自己撑满视口高度 */
.site-main { min-height: calc(100vh - 58px); }

/* ---------- 卡片纹理封面 ----------
   没有项目截图时，用分类色相生成一层极淡的点阵 + 斜向渐晕。
   色相由分类名 crc32 决定，同一分类永远同色，新分类自动获得新色。 */
.card-cover {
  position: relative;
  height: 92px;
  overflow: hidden;
  background-color: hsl(var(--hue, 220) 44% 48% / 0.10);
  background-image:
    radial-gradient(circle at 1px 1px, hsl(var(--hue, 220) 58% 64% / 0.30) 1px, transparent 1.4px),
    linear-gradient(135deg, hsl(var(--hue, 220) 58% 56% / 0.22), transparent 64%);
  background-size: 13px 13px, 100% 100%;
  box-shadow: inset 0 -1px 0 0 var(--ring-inset);
}

/* 分类与状态压在纹理之上，省掉单独一条 stage，避免标题前堆两层装饰 */
.card-cover-top {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 16px;
}

/* 水印字符完整落在封面内，不再被裁掉 */
.card-glyph {
  position: absolute;
  right: 14px;
  bottom: 6px;
  font-family: var(--font-mono);
  font-size: 44px;
  font-weight: 600;
  line-height: 1;
  color: hsl(var(--hue, 220) 62% 66% / 0.20);
  user-select: none;
  pointer-events: none;
}

/* 纹理上直接放状态药丸会糊，给它垫一层底色 */
.card-cover .status {
  background: color-mix(in srgb, var(--bg) 88%, transparent);
}

html[data-theme="light"] .card-cover { background-color: hsl(var(--hue, 220) 58% 52% / 0.08); }
html[data-theme="light"] .card-glyph { color: hsl(var(--hue, 220) 58% 42% / 0.16); }

/* ---------- 网格：铺满全宽，最多 4 列 ----------
   列数越宽越多，但封顶 4 列——再多卡片就窄得放不下简介了。
   每个断点都配套「末行补位」规则，避免最后一行右边留空洞。 */
.grid { display: grid; gap: 16px; grid-template-columns: 1fr; }

@media (min-width: 640px) {
  .grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid > .card:last-child:nth-child(2n+1) { grid-column: span 2; }
}

@media (min-width: 1024px) {
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .grid > .card:last-child:nth-child(2n+1) { grid-column: auto; }
  .grid > .card:last-child:nth-child(3n+1) { grid-column: span 3; }
  .grid > .card:last-child:nth-child(3n+2) { grid-column: span 2; }
}

@media (min-width: 1500px) {
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .grid > .card:last-child:nth-child(3n+1),
  .grid > .card:last-child:nth-child(3n+2) { grid-column: auto; }
  .grid > .card:last-child:nth-child(4n+1) { grid-column: span 4; }
  .grid > .card:last-child:nth-child(4n+2) { grid-column: span 3; }
  .grid > .card:last-child:nth-child(4n+3) { grid-column: span 2; }
}

/* ---------- 入场动效 ---------- */

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

.hero-eyebrow-anim,
.hero-title,
.hero-sub,
.actions,
.stats { animation: rise var(--duration-slow) var(--ease-smooth-out) both; }
.hero-title { animation-delay: 40ms; }
.hero-sub { animation-delay: 80ms; }
.actions { animation-delay: 120ms; }
.stats { animation-delay: 180ms; }

.grid .card { animation: rise var(--duration-slow) var(--ease-smooth-out) both; }
.grid .card:nth-child(1) { animation-delay: 0ms; }
.grid .card:nth-child(2) { animation-delay: 50ms; }
.grid .card:nth-child(3) { animation-delay: 100ms; }
.grid .card:nth-child(4) { animation-delay: 150ms; }
.grid .card:nth-child(5) { animation-delay: 200ms; }
.grid .card:nth-child(6) { animation-delay: 250ms; }
.grid .card:nth-child(n+7) { animation-delay: 300ms; }

.post-item { animation: rise var(--duration-slow) var(--ease-smooth-out) both; }
.post-item:nth-child(1) { animation-delay: 0ms; }
.post-item:nth-child(2) { animation-delay: 50ms; }
.post-item:nth-child(3) { animation-delay: 100ms; }
.post-item:nth-child(n+4) { animation-delay: 150ms; }

@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: 0.01ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.01ms !important;
  }
}

/* ---------- responsive ---------- */

@media (max-width: 760px) {
  .container { padding: 0 18px; }
  .hero { padding: 72px 0 56px; }
  .hero-sub { font-size: 15.5px; }
  .stats { margin-top: 48px; max-width: none; }
  .stat { padding: 0 10px; }
  .stat strong { font-size: 19px; }
  .section { padding: 56px 0; }
  .grid { grid-template-columns: 1fr; gap: 14px; }
  .nav { gap: 0; }
  .nav-link { padding: 6px 9px; font-size: 13px; }
  .post-link { grid-template-columns: 1fr; gap: 3px; }
  .post-date, .post-title, .post-summary, .post-meta { grid-column: 1; }
  .brand-text { display: none; }
  .page-title { font-size: 28px; }
  .post-h1 { font-size: 27px; }
}
/* ============================================================
   文档站布局
   三栏：左侧目录树 / 中间正文 / 右侧页内目录
   侧栏和页内目录都 sticky，正文独立滚动
   ============================================================ */

.header-inner--full {
  gap: 16px;
  height: 58px;
  padding: 0 clamp(20px, 3.2vw, 64px);
  max-width: none;
  margin: 0;
}

/* 顶栏搜索框 */
.search-form {
  position: relative;
  flex: 0 1 300px;
  margin-left: 8px;
  min-width: 0;
}
.search-icon {
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--text-subtle);
  pointer-events: none;
}
.search-input {
  width: 100%;
  height: 34px;
  padding: 0 12px 0 32px;
  font-family: inherit;
  font-size: 13.5px;
  color: var(--text);
  background: var(--stage);
  border: none;
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px var(--ring);
  transition: box-shadow var(--duration-quick) var(--ease-smooth-out);
  -webkit-appearance: none;
}
.search-input::placeholder { color: var(--text-subtle); }
.search-input:focus {
  outline: none;
  box-shadow: inset 0 0 0 1px var(--accent);
}

.nav-link.is-active { color: var(--text); background: var(--surface-hover); }

/* ---------- 三栏骨架 ---------- */
.docs-shell {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr) 216px;
  align-items: start;
}
.docs-shell:has(.docs-toc:empty) { grid-template-columns: 320px minmax(0, 1fr); }
.docs-shell:has(.docs-toc:empty) .docs-toc { display: none; }

.docs-sidebar {
  position: sticky;
  top: 58px;
  height: calc(100vh - 58px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 22px 14px 64px clamp(20px, 3.2vw, 64px);
  box-shadow: inset -1px 0 0 0 var(--ring);
}
.docs-sidebar-inner { min-height: 100%; }

.docs-main { min-width: 0; padding: 40px clamp(24px, 3vw, 56px) 96px; }
/* 在中间栏里居中：左对齐会让正文贴在左边、右边空出一大片 */
.docs-article { max-width: 980px; margin: 0 auto; }

.docs-toc {
  position: sticky;
  top: 58px;
  max-height: calc(100vh - 58px);
  overflow-y: auto;
  padding: 40px 24px 64px 8px;
}
.toc-title {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-subtle);
  margin-bottom: 12px;
}
.toc-list { display: flex; flex-direction: column; gap: 2px; }
.toc-item a {
  display: block;
  padding: 3px 0;
  font-size: 12.5px;
  line-height: 1.5;
  color: var(--text-subtle);
  transition: color var(--duration-quick) var(--ease-smooth-out);
}
.toc-item a:hover { color: var(--text); }
.toc-item a.is-active {
  color: var(--accent);
  font-weight: 500;
}
.toc-level-3 a { padding-left: 12px; }

/* ---------- 目录树 ----------
   折叠用 JS 控制显隐，不用 <details>：浏览器会隐藏 details 里
   summary 之外的一切，链接放在外面就会被一起藏掉。 */
.doc-tree { display: flex; flex-direction: column; gap: 1px; }
.doc-children { padding-left: 18px; }
.doc-children[hidden] { display: none; }

.doc-row { display: flex; align-items: center; gap: 2px; }

.doc-caret {
  flex: none;
  width: 16px;
  height: 16px;
  padding: 0;
  border: none;
  background: transparent;
  cursor: pointer;
  display: grid;
  place-items: center;
  border-radius: 4px;
  transition: background var(--duration-quick) var(--ease-smooth-out);
}
.doc-caret:hover { background: var(--surface-hover); }
.doc-caret::before {
  content: "";
  width: 5px;
  height: 5px;
  border-right: 1.5px solid var(--text-subtle);
  border-bottom: 1.5px solid var(--text-subtle);
  transform: rotate(-45deg);
  transition: transform var(--duration-quick) var(--ease-smooth-out);
}
.doc-caret.is-open::before { transform: rotate(45deg); }

.doc-link {
  flex: 1;
  min-width: 0;
  display: block;
  padding: 5px 8px;
  border-radius: var(--r-sm);
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-muted);
  /* 中文标题普遍偏长，单行省略会让 "RockyLinux 安…" 这种根本认不出是哪篇。
     允许折成两行，超过才截。 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  transition: color var(--duration-quick) var(--ease-smooth-out),
              background var(--duration-quick) var(--ease-smooth-out);
}
.doc-link:hover { color: var(--text); background: var(--surface-hover); }
.doc-link.is-active {
  color: var(--accent);
  background: var(--accent-quiet);
  font-weight: 500;
}
/* 叶子节点缩进对齐到有 caret 的兄弟项文字位置 */
.doc-leaf { margin-left: 18px; }

/* ---------- 正文 ---------- */
.crumbs {
  display: flex;
  align-items: center;
  gap: 7px;
  flex-wrap: wrap;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-subtle);
  margin-bottom: 22px;
}
.crumbs a { color: var(--text-subtle); transition: color var(--duration-quick) var(--ease-smooth-out); }
.crumbs a:hover { color: var(--accent); }
.crumb-sep { opacity: 0.5; }
.crumb-current { color: var(--text-muted); }

.docs-article .prose { font-size: 15px; }
.docs-article .prose h1 {
  font-size: 30px;
  letter-spacing: -0.028em;
  margin: 0 0 24px;
  padding-bottom: 0;
}
.docs-article .prose h2 {
  font-size: 19px;
  margin: 44px 0 14px;
  padding-top: 20px;
  box-shadow: inset 0 1px 0 0 var(--ring);
}
.docs-article .prose h3 { font-size: 16px; margin: 30px 0 10px; }
.docs-article .prose h4 { font-size: 14.5px; margin: 24px 0 8px; color: var(--text-muted); }
/* 文档里代码块很多，给它一点"可复制块"的存在感 */
.docs-article .prose pre {
  padding: 16px 18px;
  background: var(--stage);
  box-shadow: inset 0 0 0 1px var(--ring-inset), inset 3px 0 0 0 var(--accent-quiet);
}
.docs-article .prose ul, .docs-article .prose ol { padding-left: 20px; }
.docs-article .prose li > ul, .docs-article .prose li > ol { margin-top: 6px; }
.docs-article .prose img {
  border-radius: var(--r-md);
  box-shadow: 0 0 0 1px var(--ring);
  background: var(--stage);
}

/* 子节点卡片 */
.doc-children-list { margin-top: 56px; }
.doc-section-title {
  font-size: 13px;
  font-family: var(--font-mono);
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-subtle);
  font-weight: 500;
  margin-bottom: 14px;
}
.doc-child-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 10px;
}
.doc-child {
  display: flex;
  flex-direction: column;
  gap: 4px;
  padding: 14px 16px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--ring-inset);
  transition: transform var(--duration-fast) var(--ease-smooth-out),
              box-shadow var(--duration-fast) var(--ease-smooth-out);
}
.doc-child:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--ring-strong);
}
.doc-child-title { font-size: 14px; font-weight: 500; }
.doc-child:hover .doc-child-title { color: var(--accent); }
.doc-child-sum {
  font-size: 12.5px;
  color: var(--text-subtle);
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 上下篇 */
.doc-pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 56px;
  padding-top: 28px;
  box-shadow: inset 0 1px 0 0 var(--ring);
}
.pager-item {
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 13px 16px;
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px var(--ring);
  transition: box-shadow var(--duration-quick) var(--ease-smooth-out),
              background var(--duration-quick) var(--ease-smooth-out);
}
.pager-item:hover { background: var(--surface-hover); box-shadow: inset 0 0 0 1px var(--ring-strong); }
.pager-next { grid-column: 2; text-align: right; }
.pager-label { font-family: var(--font-mono); font-size: 11px; color: var(--text-subtle); }
.pager-title { font-size: 13.5px; color: var(--text-muted); }
.pager-item:hover .pager-title { color: var(--accent); }

/* ---------- 搜索结果 ---------- */
.search-title { font-size: 26px; letter-spacing: -0.025em; margin-bottom: 8px; }
.search-count { font-size: 13px; color: var(--text-subtle); margin-bottom: 28px; }
.search-results { display: flex; flex-direction: column; gap: 4px; }
.search-result {
  padding: 16px 18px;
  border-radius: var(--r-md);
  box-shadow: inset 0 0 0 1px var(--ring-inset);
  transition: box-shadow var(--duration-quick) var(--ease-smooth-out),
              background var(--duration-quick) var(--ease-smooth-out);
}
.search-result:hover { background: var(--surface-hover); box-shadow: inset 0 0 0 1px var(--ring-strong); }
.search-result-title { font-size: 15px; font-weight: 500; }
.search-result:hover .search-result-title { color: var(--accent); }
.search-hit {
  margin-left: 8px;
  font-family: var(--font-mono);
  font-size: 10.5px;
  padding: 2px 7px;
  border-radius: var(--r-pill);
  color: var(--ok);
  box-shadow: inset 0 0 0 1px currentColor;
  vertical-align: middle;
}
.search-result-path {
  display: block;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-subtle);
  margin: 4px 0 8px;
}
.search-result-snippet { font-size: 13.5px; color: var(--text-muted); line-height: 1.65; }

.empty-cmd {
  font-family: var(--font-mono);
  font-size: 13px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--stage);
  box-shadow: inset 0 0 0 1px var(--ring-inset);
  overflow-x: auto;
}

/* ---------- 移动端：侧栏抽屉 ---------- */
.sidebar-toggle {
  display: none;
  position: fixed;
  left: 16px;
  bottom: 20px;
  z-index: 60;
  width: 42px;
  height: 42px;
  border: none;
  border-radius: var(--r-pill);
  background: var(--btn-primary-bg);
  color: var(--btn-primary-text);
  box-shadow: var(--shadow-lg);
  cursor: pointer;
  font-size: 15px;
}

@media (max-width: 1180px) {
  .docs-shell, .docs-shell:has(.docs-toc:empty) { grid-template-columns: 260px minmax(0, 1fr); }
  .docs-toc { display: none; }
}

@media (max-width: 880px) {
  .header-inner--full { height: auto; padding: 10px 18px; flex-wrap: wrap; gap: 10px; }
  .search-form { order: 3; flex: 1 1 100%; margin-left: 0; }
  .nav { margin-left: auto; }

  .docs-shell, .docs-shell:has(.docs-toc:empty) { grid-template-columns: minmax(0, 1fr); }

  .docs-sidebar {
    position: fixed;
    top: 0;
    left: 0;
    bottom: 0;
    width: 300px;
    max-width: 86vw;
    height: 100vh;
    z-index: 70;
    background: var(--bg);
    box-shadow: var(--shadow-lg), inset -1px 0 0 0 var(--ring);
    padding: 24px 16px 48px 20px;
    transform: translateX(-102%);
    transition: transform var(--duration-fast) var(--ease-smooth-out);
  }
  .docs-sidebar.is-open { transform: none; }
  .docs-main { padding: 28px 18px 80px; }
  .sidebar-toggle { display: grid; place-items: center; }
  .doc-pager { grid-template-columns: 1fr; }
  .pager-next { grid-column: 1; text-align: left; }
}
/* 本节目录：按 README 的 ## 分组展示 */
.doc-child-groups { display: flex; flex-direction: column; gap: 26px; }
.doc-child-group-name {
  font-size: 12.5px;
  font-weight: 550;
  color: var(--text-muted);
  margin-bottom: 10px;
  padding-bottom: 8px;
  box-shadow: inset 0 -1px 0 0 var(--ring);
  display: flex;
  align-items: center;
  gap: 8px;
}
.doc-child-group-name::before {
  content: "";
  width: 3px;
  height: 12px;
  border-radius: 2px;
  background: var(--accent);
  opacity: 0.7;
}
.doc-child-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-subtle);
  font-weight: 400;
}
/* ============================================================
   站点首页（文档库总览）
   ============================================================ */

.home-head { padding-bottom: 12px; }
.home-eyebrow {
  font-family: var(--font-mono);
  font-size: 11.5px;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  color: var(--accent);
  margin-bottom: 14px;
}
.home-title {
  font-size: 34px;
  letter-spacing: -0.03em;
  margin-bottom: 12px;
}
.home-sub {
  font-size: 15px;
  color: var(--text-muted);
  max-width: 46em;
  line-height: 1.7;
}

.home-stats {
  display: flex;
  gap: 0;
  margin-top: 30px;
  padding-top: 24px;
  box-shadow: inset 0 1px 0 0 var(--ring);
}
.home-stat {
  flex: 1;
  max-width: 190px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding-right: 24px;
}
.home-stat + .home-stat { padding-left: 24px; box-shadow: inset 1px 0 0 0 var(--ring); }
.home-stat strong {
  font-family: var(--font-mono);
  font-size: 26px;
  font-weight: 500;
  letter-spacing: -0.02em;
}
.home-stat span { font-size: 12.5px; color: var(--text-subtle); }

.home-section { margin-top: 56px; }

.home-list { display: flex; flex-direction: column; }
.home-item { box-shadow: inset 0 -1px 0 0 var(--ring); }
.home-item:first-child { box-shadow: inset 0 1px 0 0 var(--ring), inset 0 -1px 0 0 var(--ring); }

.home-link {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 16px;
  padding: 13px 12px;
  margin: 0 -12px;
  border-radius: var(--r-md);
  transition: background var(--duration-quick) var(--ease-smooth-out);
}
.home-link:hover { background: var(--surface-hover); }

.home-date, .home-views {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-subtle);
}
.home-views { color: var(--accent); }

.home-item-title {
  font-size: 14.5px;
  font-weight: 500;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color var(--duration-quick) var(--ease-smooth-out);
}
.home-link:hover .home-item-title { color: var(--accent); }

.home-item-path {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-subtle);
  max-width: 320px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.domain-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.domain-card {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 16px 18px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--ring-inset);
  transition: transform var(--duration-fast) var(--ease-smooth-out),
              box-shadow var(--duration-fast) var(--ease-smooth-out);
}
.domain-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--ring-strong);
}
.domain-name { font-size: 15px; font-weight: 550; letter-spacing: -0.015em; }
.domain-card:hover .domain-name { color: var(--accent); }
.domain-sum {
  font-size: 12.5px;
  color: var(--text-subtle);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.domain-count {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-subtle);
  margin-top: 4px;
}

@media (max-width: 880px) {
  .home-title { font-size: 26px; }
  .home-stats { flex-wrap: wrap; gap: 16px 0; }
  .home-stat { max-width: none; min-width: 33%; }
  .home-link { grid-template-columns: 1fr; gap: 3px; padding: 14px 12px; }
  .home-item-path { max-width: none; }
  .domain-grid { grid-template-columns: 1fr; }
}
/* ============================================================
   运维终端美学
   内容全是 shell 命令和排查过程，所以整站刻意往"命令行工具"上靠：
   终端窗口、tree 连接线、状态栏、代码块工具条。
   ============================================================ */

/* ---------- 终端窗口 ---------- */
.term {
  margin-top: 34px;
  border-radius: var(--r-lg);
  background: var(--stage);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--ring);
  overflow: hidden;
}
.term-bar {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  background: color-mix(in srgb, var(--text) 4%, transparent);
  box-shadow: inset 0 -1px 0 0 var(--ring);
}
.term-dots { display: flex; gap: 6px; }
.term-dots i {
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--ring-strong);
}
.term-dots i:first-child { background: #ff5f57; }
.term-dots i:nth-child(2) { background: #febc2e; }
.term-dots i:nth-child(3) { background: #28c840; }
.term-title {
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-subtle);
}

.term-body {
  padding: 16px 18px 18px;
  font-family: var(--font-mono);
  font-size: 12.5px;
  line-height: 1.85;
  overflow-x: auto;
}
.term-line { margin: 0; white-space: pre; color: var(--text-muted); }
.term-prompt { color: var(--ok); margin-right: 8px; }
.term-out { color: var(--text-subtle); }
.term-branch { color: var(--text-subtle); margin-right: 8px; }
.term-name { color: var(--text); }
.term-count { color: var(--accent); margin-left: 10px; }
.term-desc { color: var(--text-subtle); margin-left: 12px; }
.term-sum { margin-top: 6px; color: var(--text-muted); }
.term-caret {
  display: inline-block;
  width: 7px;
  height: 14px;
  background: var(--text);
  vertical-align: -2px;
  animation: term-blink 1.1s step-end infinite;
}
@keyframes term-blink {
  0%, 50% { opacity: 1; }
  50.01%, 100% { opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .term-caret { animation: none; }
}
@media (max-width: 880px) {
  .term-desc { display: none; }
  .term-body { font-size: 11.5px; }
}

/* ---------- 顶栏搜索：命令行风格 ---------- */
.search-form::before {
  content: "\276F";
  position: absolute;
  left: 11px;
  top: 50%;
  transform: translateY(-50%);
  color: var(--ok);
  font-family: var(--font-mono);
  font-size: 12px;
  pointer-events: none;
}
.search-form .search-icon { display: none; }
.search-input {
  padding-left: 26px;
  font-family: var(--font-mono);
  font-size: 12.5px;
}
.search-key {
  position: absolute;
  right: 8px;
  top: 50%;
  transform: translateY(-50%);
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-subtle);
  padding: 2px 6px;
  border-radius: 5px;
  box-shadow: inset 0 0 0 1px var(--ring);
  pointer-events: none;
}

/* ---------- 侧边栏：tree 连接线 ---------- */
.doc-children {
  position: relative;
  padding-left: 20px;
}
/* 这一层的竖直引导线 */
.doc-children::before {
  content: "";
  position: absolute;
  left: 7px;
  top: 2px;
  bottom: 12px;
  width: 1px;
  background: var(--ring);
}
.doc-children > li { position: relative; }
/* 每一项前面的横线，形成 ├── 效果 */
.doc-children > li::before {
  content: "";
  position: absolute;
  left: -13px;
  top: 15px;
  width: 10px;
  height: 1px;
  background: var(--ring);
}
/* 最后一项的竖线截断，形成 └── 效果 */
.doc-children > li:last-child::after {
  content: "";
  position: absolute;
  left: -13px;
  top: 16px;
  bottom: 0;
  width: 1px;
  background: var(--bg);
}

/* ---------- 代码块工具条 ---------- */
.code-block { position: relative; margin: 0 0 24px; }
/* 用 .prose 前缀把优先级提到和 .docs-article .prose pre 同级，
   靠"后面出现"取胜，否则 padding-top 会被覆盖，工具条压住第一行代码 */
.prose .code-block pre {
  margin: 0;
  padding: 38px 18px 16px;
  border-radius: var(--r-md);
}
.code-bar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 10px 0 14px;
  border-radius: var(--r-md) var(--r-md) 0 0;
  box-shadow: inset 0 -1px 0 0 var(--ring);
  background: color-mix(in srgb, var(--text) 3%, transparent);
}
.code-lang {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.05em;
  text-transform: uppercase;
  color: var(--text-subtle);
}
.code-copy {
  font-family: var(--font-mono);
  font-size: 11px;
  padding: 3px 9px;
  border: none;
  border-radius: 6px;
  background: transparent;
  color: var(--text-subtle);
  cursor: pointer;
  box-shadow: inset 0 0 0 1px var(--ring);
  transition: color var(--duration-quick) var(--ease-smooth-out),
              box-shadow var(--duration-quick) var(--ease-smooth-out);
}
.code-copy:hover { color: var(--text); box-shadow: inset 0 0 0 1px var(--ring-strong); }
.code-copy.is-done { color: var(--ok); box-shadow: inset 0 0 0 1px currentColor; }

/* ---------- 文档页脚状态栏（vim / tmux 风格） ---------- */
.doc-status {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: 40px;
  padding: 7px 12px;
  border-radius: var(--r-sm);
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-subtle);
  background: color-mix(in srgb, var(--text) 5%, transparent);
  box-shadow: inset 0 0 0 1px var(--ring);
  overflow: hidden;
}
.status-mode {
  flex: none;
  padding: 1px 8px;
  border-radius: 4px;
  background: var(--accent);
  color: var(--btn-primary-text);
  font-weight: 600;
  letter-spacing: 0.06em;
}
.status-path { color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.status-spacer { flex: 1; }
.status-meta { flex: none; }

/* ---------- 404：shell 报错 ---------- */
.shell-error {
  margin-top: 28px;
  padding: 20px 22px;
  border-radius: var(--r-md);
  background: var(--stage);
  box-shadow: inset 0 0 0 1px var(--ring);
  font-family: var(--font-mono);
  font-size: 13px;
  line-height: 1.9;
  overflow-x: auto;
}
.shell-error .term-prompt { color: var(--ok); }
.shell-error .err { color: #ff6b6b; }
html[data-theme="light"] .shell-error .err { color: #c92a2a; }
/* ============================================================
   背景纹理与领域图标
   ============================================================ */

/* 全站点阵纹理，从顶部往下淡出。
   放在 html 上做底色、body 透明，body::before 才能用负 z-index
   压在内容下面又盖住底色。 */
/* 页面底色（画布）比面板色再深/浅一档，正文面板才有浮起来的感觉。
   --bg 保留给面板，--canvas 专用于画布。 */
:root { --canvas: #07080c; }
html[data-theme="light"] { --canvas: #eef1f6; }

html {
  background-color: var(--canvas);
  background-image:
    radial-gradient(ellipse 120% 70% at 50% -5%, color-mix(in srgb, var(--accent) 8%, transparent), transparent 70%);
}
body { background: transparent; }

/* 全局背景改为中性的蓝紫光晕，避免旧机柜照片的荧光绿色干扰内容。 */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
  background:
    radial-gradient(ellipse 58% 42% at 78% 4%, rgba(95, 112, 210, .15), transparent 72%),
    radial-gradient(ellipse 52% 48% at 12% 48%, rgba(98, 67, 154, .1), transparent 78%),
    linear-gradient(145deg, rgba(7,8,12,.98), rgba(12,14,22,.9));
}
html[data-theme="light"] body::before {
  background:
    radial-gradient(ellipse 60% 44% at 78% 4%, rgba(95, 112, 210, .11), transparent 72%),
    radial-gradient(ellipse 48% 44% at 12% 48%, rgba(98, 67, 154, .07), transparent 78%),
    linear-gradient(145deg, #f7f8fb, #edf0f6);
}

/* 全局背景第二层：点阵。铺满整个视口，不再只在顶部 */
body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  background-image: radial-gradient(circle at 1px 1px, var(--ring) 1px, transparent 0);
  background-size: 26px 26px;
  opacity: 0.9;
  -webkit-mask-image: radial-gradient(ellipse 150% 90% at 50% 0%, #000 8%, transparent 88%);
  mask-image: radial-gradient(ellipse 150% 90% at 50% 0%, #000 8%, transparent 88%);
}
html[data-theme="light"] body::after { opacity: 1; }
html[data-theme="light"] {
  --ring: rgba(0, 0, 0, 0.09);
}

/* 顶栏用实色 --bg（body 透明 + 背景照片，半透明会露出照片边缘） */

/* ---------- 领域卡片 ---------- */
.domain-card {
  position: relative;
  overflow: hidden;
  gap: 8px;
}
.domain-card::before {
  content: "";
  position: absolute;
  inset: 0;
  pointer-events: none;
  background: linear-gradient(135deg, hsl(var(--hue, 220) 60% 55% / 0.13), transparent 62%);
  opacity: 0;
  transition: opacity var(--duration-fast) var(--ease-smooth-out);
}
.domain-card:hover::before { opacity: 1; }

.domain-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.domain-icon {
  width: 20px;
  height: 20px;
  flex: none;
  color: hsl(var(--hue, 220) 62% 68%);
  transition: transform var(--duration-fast) var(--ease-smooth-out);
}
html[data-theme="light"] .domain-icon { color: hsl(var(--hue, 220) 52% 45%); }
.domain-card:hover .domain-icon { transform: scale(1.08); }

.domain-name {
  flex: 1;
  min-width: 0;
  font-size: 15px;
  font-weight: 550;
  letter-spacing: -0.015em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.domain-count {
  flex: none;
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--text-subtle);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  box-shadow: inset 0 0 0 1px var(--ring);
}
.domain-sum { padding-left: 30px; }

/* ---------- 首页列表项加一条色相指示 ---------- */
.home-link { position: relative; }
.home-link::before {
  content: "";
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%) scaleY(0);
  width: 2px;
  height: 18px;
  border-radius: 2px;
  background: var(--accent);
  transition: transform var(--duration-quick) var(--ease-smooth-out);
}
.home-link:hover::before { transform: translateY(-50%) scaleY(1); }
/* ---------- 首页主视觉：抽象网络拓扑 ----------
   自己生成的 SVG（tools/make_hero.py），不是照片：
   运维站的主视觉就该是节点和连线，用照片跑题且有版权风险。 */
/* 图层顺序：底图照片 -> 压暗层 -> 拓扑线 -> 内容。
   压暗层是必须的：照片亮部会吃掉标题的对比度。 */
/* 首页去掉中间栏的左右内边距，主视觉才能铺满整栏 */
.docs-main--home { padding-left: 0; padding-right: 0; }

.home-hero {
  position: relative;
  padding: 56px clamp(24px, 3vw, 56px) 10px;
  background-image: var(--hero-image, none);
  background-size: cover;
  background-position: center 42%;
  background-repeat: no-repeat;
  border-radius: 0 0 var(--r-lg) var(--r-lg);
}
/* 照片铺满，但里面的文字仍然限宽，保持和正文一样的阅读宽度 */
.home-hero-inner { position: relative; z-index: 1; max-width: 980px; margin: 0 auto; }

.home-body { padding: 0 clamp(24px, 3vw, 56px); }
.home-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  /* 两层：横向压暗保证标题对比度（换图也不会翻车），纵向淡出接回页面底色 */
  background:
    linear-gradient(
      to right,
      color-mix(in srgb, var(--bg) 78%, transparent) 0%,
      color-mix(in srgb, var(--bg) 34%, transparent) 46%,
      transparent 72%
    ),
    linear-gradient(
      to bottom,
      color-mix(in srgb, var(--bg) 30%, transparent) 0%,
      color-mix(in srgb, var(--bg) 66%, transparent) 44%,
      color-mix(in srgb, var(--bg) 94%, transparent) 80%,
      var(--bg) 100%
    );
  border-radius: var(--r-lg);
}
.home-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  opacity: 0.4;
  background: url("/static/bg-topology-dark.svg") center top / contain no-repeat;
  -webkit-mask-image: linear-gradient(to bottom, #000 20%, transparent 88%);
  mask-image: linear-gradient(to bottom, #000 20%, transparent 88%);
}


/* 浅色主题下照片会顶掉深色文字的对比度，压得更狠一些 */
html[data-theme="light"] .home-hero::before {
  background:
    linear-gradient(
      to right,
      color-mix(in srgb, var(--bg) 90%, transparent) 0%,
      color-mix(in srgb, var(--bg) 74%, transparent) 48%,
      color-mix(in srgb, var(--bg) 40%, transparent) 78%
    ),
    linear-gradient(
      to bottom,
      color-mix(in srgb, var(--bg) 72%, transparent) 0%,
      color-mix(in srgb, var(--bg) 90%, transparent) 46%,
      var(--bg) 88%
    );
}
html[data-theme="light"] .home-hero::after { background-image: url("/static/bg-topology-light.svg"); opacity: 0.55; }

@media (max-width: 880px) {
  .home-hero { padding-top: 36px; background-position: center 28%; }
}
/* ============================================================
   搜索即时下拉
   输入即出结果，不用回车跳页。方向键选择，回车进入。
   ============================================================ */

.search-panel {
  position: absolute;
  top: calc(100% + 8px);
  left: 0;
  /* 比输入框宽：300px 里面标题会挤成三行没法扫 */
  right: auto;
  width: max(100%, 430px);
  z-index: 80;
  max-height: min(62vh, 470px);
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 6px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-lg), inset 0 0 0 1px var(--ring-strong);
}

/* 首页统计数字变化时的提示：闪一下再回到常态 */
@keyframes stat-bump {
  0%   { color: var(--accent); }
  100% { color: var(--text); }
}
.home-stat strong.is-bumped { animation: stat-bump 900ms var(--ease-smooth-out); }
@media (prefers-reduced-motion: reduce) {
  .home-stat strong.is-bumped { animation: none; }
}

/* ============================================================
   线上项目卡片
   和「领域」卡片同源，但多了两样东西：域名上的在线指示点，
   以及终端风格的等宽域名——一看就知道是能点进去的真站点。
   ============================================================ */
.live-grid {
  display: grid;
  /* 用 auto-fit 而不是 auto-fill：卡片少的时候（比如现在只有 2 个）
     auto-fill 会保留空轨道，右边留一块空白；auto-fit 会把轨道收掉，
     卡片均分整行。卡片变多时两者表现一致。 */
  grid-template-columns: repeat(auto-fit, minmax(280px, 1fr));
  gap: 12px;
}

.live-card {
  display: flex;
  flex-direction: column;
  gap: 9px;
  padding: 16px 18px 15px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--ring-inset);
  transition: transform var(--duration-fast) var(--ease-smooth-out),
              box-shadow var(--duration-fast) var(--ease-smooth-out);
}
.live-card:hover {
  transform: translateY(-1px);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--ring-strong);
}

.live-head {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

/* 在线指示点：点本身是实的，动效只是向外扩散的光环 */
.live-dot {
  flex: none;
  width: 6px;
  height: 6px;
  border-radius: var(--r-pill);
  background: var(--ok);
  animation: live-pulse 2.4s var(--ease-smooth-out) infinite;
}
@keyframes live-pulse {
  0%   { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0.45); }
  70%  { box-shadow: 0 0 0 7px rgba(74, 222, 128, 0); }
  100% { box-shadow: 0 0 0 0 rgba(74, 222, 128, 0); }
}
@media (prefers-reduced-motion: reduce) {
  .live-dot { animation: none; box-shadow: 0 0 0 3px rgba(74, 222, 128, 0.16); }
}

.live-host {
  min-width: 0;
  font-family: var(--font-mono);
  font-size: 11.5px;
  color: var(--text-subtle);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.live-cat {
  flex: none;
  margin-left: auto;
  font-size: 11px;
  color: var(--text-subtle);
  padding: 2px 8px;
  border-radius: var(--r-pill);
  box-shadow: inset 0 0 0 1px var(--ring);
}

.live-name {
  font-size: 15.5px;
  font-weight: 550;
  letter-spacing: -0.015em;
  transition: color var(--duration-quick) var(--ease-smooth-out);
}
.live-card:hover .live-name { color: var(--accent); }

.live-tagline {
  font-size: 12.5px;
  color: var(--text-subtle);
  line-height: 1.55;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.live-tech { display: flex; flex-wrap: wrap; gap: 6px; }
.live-tech > span {
  font-family: var(--font-mono);
  font-size: 10.5px;
  line-height: 1.6;
  color: var(--text-subtle);
  padding: 1px 7px;
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px var(--ring);
  white-space: nowrap;
}

/* margin-top:auto 把这一行顶到卡片底部，同一行里多张卡才对得齐 */
.live-go {
  margin-top: auto;
  padding-top: 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12.5px;
  color: var(--accent);
}

@media (max-width: 880px) {
  .live-grid { grid-template-columns: 1fr; }
}

/* ============================================================
   首页索引 v2
   首页首先解决“去哪里”和“怎么找”，装饰退到信息层级之后。
   ============================================================ */
.index-wrap {
  width: min(100%, 1180px);
  margin: 0 auto;
  padding: 44px clamp(24px, 3vw, 56px) 96px;
}

.index-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.4fr) minmax(300px, 0.72fr);
  min-height: 440px;
  overflow: hidden;
  border-radius: var(--r-lg);
  background: var(--surface);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--ring-inset);
}

.index-intro {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(36px, 5vw, 68px);
}

.index-kicker,
.index-section-kicker {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: 0.12em;
  color: var(--text-subtle);
}
.index-kicker { margin-bottom: 22px; }
.index-kicker span { color: var(--accent); margin-right: 7px; }

.index-intro h1 {
  max-width: 650px;
  margin: 0;
  font-size: clamp(34px, 4vw, 56px);
  line-height: 1.08;
  letter-spacing: -0.045em;
}

.index-lead {
  max-width: 590px;
  margin: 18px 0 0;
  color: var(--text-muted);
  font-size: 15px;
  line-height: 1.75;
}

.index-search {
  display: grid;
  grid-template-columns: 20px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  width: min(100%, 620px);
  margin-top: 34px;
  padding: 7px 8px 7px 16px;
  border-radius: var(--r-pill);
  color: var(--text-subtle);
  background: var(--stage);
  box-shadow: inset 0 0 0 1px var(--ring-strong), var(--shadow-sm);
  transition: box-shadow var(--duration-quick) var(--ease-smooth-out);
}
.index-search:focus-within {
  box-shadow: inset 0 0 0 1px var(--accent), 0 0 0 3px color-mix(in srgb, var(--accent) 12%, transparent);
}
.index-search svg { width: 18px; height: 18px; }
.index-search input {
  min-width: 0;
  border: 0;
  outline: 0;
  color: var(--text);
  background: transparent;
  font: inherit;
  font-size: 14px;
}
.index-search input::placeholder { color: var(--text-subtle); }
.index-search button {
  border: 0;
  border-radius: var(--r-pill);
  padding: 9px 17px;
  color: var(--btn-primary-text);
  background: var(--btn-primary-bg);
  font: inherit;
  font-size: 12.5px;
  font-weight: 600;
  cursor: pointer;
}

.index-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 24px;
  margin-top: 22px;
  font-size: 12px;
  color: var(--text-subtle);
}
.index-stats span { white-space: nowrap; }
.index-stats strong {
  color: var(--text);
  font-family: var(--font-mono);
  font-size: 12.5px;
  font-weight: 500;
}

.index-map {
  display: flex;
  flex-direction: column;
  min-width: 0;
  padding: 24px;
  background: var(--stage);
  box-shadow: inset 1px 0 0 0 var(--ring);
}
.index-map-head {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding: 0 10px 15px;
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: 0.08em;
  color: var(--text-subtle);
  box-shadow: inset 0 -1px 0 0 var(--ring);
}
.index-map ol { flex: 1; display: flex; flex-direction: column; justify-content: center; }
.index-map ol,
.index-list { margin: 0; padding: 0; list-style: none; }
.index-map li { box-shadow: inset 0 -1px 0 0 var(--ring); }
.index-map li:last-child { box-shadow: none; }
.index-map a {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto 18px;
  align-items: center;
  gap: 8px;
  padding: 11px 10px;
  border-radius: var(--r-sm);
  transition: background var(--duration-quick) var(--ease-smooth-out);
}
.index-map a:hover { background: var(--surface-hover); }
.index-map-num,
.index-map-count {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-subtle);
}
.index-map-name {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13.5px;
  font-weight: 500;
}
.index-map-arrow {
  color: var(--text-subtle);
  transform: translate(-2px, 2px);
  opacity: 0;
  transition: opacity var(--duration-quick) var(--ease-smooth-out),
              transform var(--duration-quick) var(--ease-smooth-out);
}
.index-map a:hover .index-map-name { color: var(--accent); }
.index-map a:hover .index-map-arrow { opacity: 1; transform: none; }

.index-section { margin-top: 72px; }
.index-section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 20px;
}
.index-section-head h2 {
  margin: 5px 0 0;
  font-size: 23px;
  letter-spacing: -0.025em;
}
.index-section-head > p {
  margin: 0 0 2px;
  font-size: 12.5px;
  color: var(--text-subtle);
}
.index-section-head--compact { margin-bottom: 14px; }

.index-domain-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}
.index-domain-card {
  position: relative;
  display: flex;
  min-height: 220px;
  flex-direction: column;
  padding: 22px;
  overflow: hidden;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--ring-inset);
  transition: transform var(--duration-fast) var(--ease-smooth-out),
              box-shadow var(--duration-fast) var(--ease-smooth-out);
}
.index-domain-card::before {
  content: "";
  position: absolute;
  inset: 0 auto 0 0;
  width: 3px;
  background: hsl(var(--hue, 220) 62% 62%);
  opacity: 0.75;
  transform: scaleY(0.28);
  transform-origin: bottom;
  transition: transform var(--duration-fast) var(--ease-smooth-out);
}
.index-domain-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-md), inset 0 0 0 1px var(--ring-strong);
}
.index-domain-card:hover::before { transform: scaleY(1); }
.index-domain-top { display: flex; justify-content: space-between; align-items: center; }
.index-domain-icon {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 10px;
  color: hsl(var(--hue, 220) 64% 68%);
  background: color-mix(in srgb, hsl(var(--hue, 220) 64% 60%) 10%, transparent);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, hsl(var(--hue, 220) 64% 60%) 24%, transparent);
}
.index-domain-icon .domain-icon { width: 19px; height: 19px; }
.index-domain-meta {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--text-subtle);
}
.index-domain-card > strong {
  margin-top: 20px;
  font-size: 19px;
  letter-spacing: -0.025em;
}
.index-domain-summary {
  margin-top: 7px;
  font-size: 12.5px;
  color: var(--text-subtle);
  line-height: 1.55;
}
.index-domain-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}
.index-domain-tags > span {
  max-width: 150px;
  padding: 3px 8px;
  overflow: hidden;
  border-radius: var(--r-pill);
  color: var(--text-subtle);
  font-size: 10.5px;
  text-overflow: ellipsis;
  white-space: nowrap;
  box-shadow: inset 0 0 0 1px var(--ring);
}
.index-domain-go {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: auto;
  padding-top: 18px;
  color: var(--text-muted);
  font-size: 12px;
}
.index-domain-go i {
  font-style: normal;
  transition: transform var(--duration-quick) var(--ease-smooth-out);
}
.index-domain-card:hover .index-domain-go { color: var(--accent); }
.index-domain-card:hover .index-domain-go i { transform: translateX(3px); }

.index-feed-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 36px;
}
.index-list {
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: inset 0 0 0 1px var(--ring-inset);
  overflow: hidden;
}
.index-list li { box-shadow: inset 0 -1px 0 0 var(--ring); }
.index-list li:last-child { box-shadow: none; }
.index-list a {
  display: grid;
  grid-template-columns: 28px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 13px 14px;
  transition: background var(--duration-quick) var(--ease-smooth-out);
}
.index-list a:hover { background: var(--surface-hover); }
.index-list-rank {
  font-family: var(--font-mono);
  font-size: 10px;
  color: var(--text-subtle);
}
.index-list-body { min-width: 0; }
.index-list-body strong,
.index-list-body small { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.index-list-body strong { font-size: 13px; font-weight: 500; }
.index-list a:hover .index-list-body strong { color: var(--accent); }
.index-list-body small {
  margin-top: 3px;
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-subtle);
}
.index-list time,
.index-list-views {
  font-family: var(--font-mono);
  font-size: 9.5px;
  color: var(--text-subtle);
  white-space: nowrap;
}

.index-projects { padding-top: 8px; }

@media (max-width: 1180px) {
  .index-hero { grid-template-columns: minmax(0, 1.15fr) minmax(270px, 0.75fr); }
  .index-intro { padding: 42px; }
}

@media (max-width: 980px) {
  .index-hero { grid-template-columns: 1fr; }
  .index-map { box-shadow: inset 0 1px 0 0 var(--ring); }
  .index-map ol { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .index-map li:nth-last-child(2) { box-shadow: none; }
  .index-feed-grid { grid-template-columns: 1fr; gap: 0; }
}

@media (max-width: 680px) {
  .index-wrap { padding: 24px 16px 76px; }
  .index-intro { padding: 30px 22px; }
  .index-intro h1 { font-size: 32px; }
  .index-search { grid-template-columns: 18px minmax(0, 1fr); border-radius: var(--r-md); padding: 12px 14px; }
  .index-search button { grid-column: 1 / -1; width: 100%; }
  .index-map { padding: 18px 14px; }
  .index-map ol { grid-template-columns: 1fr; }
  .index-map li:nth-last-child(2) { box-shadow: inset 0 -1px 0 0 var(--ring); }
  .index-domain-grid { grid-template-columns: 1fr; }
  .index-domain-card { min-height: 205px; }
  .index-section { margin-top: 54px; }
  .index-section-head { align-items: flex-start; flex-direction: column; gap: 8px; }
  .index-section-head > p { display: none; }
  .index-list a { grid-template-columns: 24px minmax(0, 1fr); }
  .index-list time, .index-list-views { display: none; }
}

/* ============================================================
   文档侧栏 v3：根标题固定、领域分区、内容树逐层展开
   ============================================================ */
.doc-index-head { margin-bottom: 12px; }
.doc-index-home {
  display: flex;
  align-items: center;
  gap: 11px;
  margin: 0 0 18px;
  padding: 11px;
  border-radius: var(--r-md);
  background: color-mix(in srgb, var(--surface) 82%, transparent);
  box-shadow: inset 0 0 0 1px var(--ring-inset);
}
.doc-index-home:hover,
.doc-index-home.is-active { background: var(--surface-hover); }
.doc-index-mark {
  display: grid;
  flex: none;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: var(--accent);
  font-family: var(--font-mono);
  background: var(--accent-quiet);
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 22%, transparent);
}
.doc-index-home > span:last-child { min-width: 0; }
.doc-index-home small,
.doc-index-home strong { display: block; }
.doc-index-home small {
  margin-bottom: 2px;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 8.5px;
  letter-spacing: .1em;
}
.doc-index-home strong {
  overflow: hidden;
  color: var(--text);
  font-size: 13.5px;
  font-weight: 600;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.doc-index-label {
  display: flex;
  justify-content: space-between;
  padding: 0 7px 8px;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 9px;
  letter-spacing: .08em;
}
.doc-tree--depth-1 { gap: 5px; }
.doc-domain > .doc-row {
  min-height: 38px;
  padding: 2px 5px 2px 9px;
  border-radius: var(--r-sm);
  box-shadow: inset 0 0 0 1px transparent;
  transition: background var(--duration-quick) var(--ease-smooth-out),
              box-shadow var(--duration-quick) var(--ease-smooth-out);
}
.doc-domain > .doc-row:hover {
  background: var(--surface-hover);
  box-shadow: inset 0 0 0 1px var(--ring);
}
.doc-domain-no {
  flex: none;
  width: 25px;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 9.5px;
}
.doc-domain > .doc-row > .doc-link {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px 4px;
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 550;
}
.doc-domain > .doc-row > .doc-link:hover { background: transparent; }
.doc-link-label { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.doc-domain-size {
  flex: none;
  min-width: 22px;
  margin-left: auto;
  color: var(--text-subtle);
  font-family: var(--font-mono);
  font-size: 9px;
  font-weight: 400;
  text-align: right;
}
.doc-domain > .doc-children {
  position: relative;
  margin: 4px 0 8px 21px;
  padding-left: 13px;
}
.doc-domain > .doc-children::before {
  content: "";
  position: absolute;
  inset: 2px auto 4px 0;
  width: 1px;
  background: linear-gradient(var(--ring-strong), transparent);
}
.doc-tree--depth-2 .doc-children { padding-left: 14px; }
.doc-tree--depth-2 .doc-link,
.doc-tree--depth-3 .doc-link { font-size: 12.5px; }
.doc-tree--depth-2 .doc-leaf,
.doc-tree--depth-3 .doc-leaf { margin-left: 18px; }

/* ============================================================
   首页索引 v3：摄影背景轮播 + 独立内容地图
   ============================================================ */
.index-hero {
  position: relative;
  grid-template-columns: minmax(0, 1.35fr) minmax(280px, .65fr);
  min-height: 510px;
  isolation: isolate;
  color: #f7f7f7;
  background: #101114;
}
.index-carousel,
.index-carousel-shade { position: absolute; inset: 0; }
.index-carousel { z-index: -2; overflow: hidden; }
.index-slide {
  position: absolute;
  inset: 0;
  margin: 0;
  opacity: 0;
  transform: scale(1.025);
  transition: opacity 700ms var(--ease-smooth-out), transform 7s linear;
}
.index-slide.is-active { opacity: 1; transform: scale(1.07); }
.index-slide img {
  display: block;
  width: 55%;
  height: 100%;
  object-fit: cover;
  object-position: center 18%;
  margin-left: auto;
  filter: saturate(.82) contrast(1.04) brightness(.78);
}
.index-slide.has-image-error {
  background:
    radial-gradient(circle at 72% 22%, rgba(82,126,255,.3), transparent 28%),
    linear-gradient(135deg, #111722, #202533 58%, #15171c);
}
.index-slide:nth-child(2) img { object-position: center 16%; }
.index-slide:nth-child(3) img { object-position: center 14%; }
.index-carousel-shade {
  z-index: 2;
  background:
    linear-gradient(90deg, rgba(8, 10, 13, .96) 0%, rgba(8, 10, 13, .82) 40%, rgba(8, 10, 13, .34) 72%, rgba(8, 10, 13, .52) 100%),
    linear-gradient(0deg, rgba(8, 10, 13, .72), transparent 48%);
}
.index-intro { position: relative; z-index: 1; }
.index-hero .index-kicker,
.index-hero .index-lead,
.index-hero .index-stats { color: rgba(255,255,255,.7); }
.index-hero .index-intro h1,
.index-hero .index-stats strong { color: #fff; }
.index-hero .index-search {
  background: rgba(10,12,15,.72);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 16px 40px rgba(0,0,0,.18);
  backdrop-filter: blur(14px);
}
.index-hero .index-search input { color: #fff; }
.index-feature {
  position: relative;
  z-index: 1;
  display: flex;
  min-width: 0;
  flex-direction: column;
  justify-content: space-between;
  padding: 28px;
  background: linear-gradient(180deg, rgba(5,7,10,.12), rgba(5,7,10,.54));
  box-shadow: inset 1px 0 0 0 rgba(255,255,255,.13);
  backdrop-filter: blur(2px);
}
.index-feature-top {
  display: flex;
  justify-content: flex-end;
  gap: 16px;
  color: rgba(255,255,255,.65);
  font-family: var(--font-mono);
  font-size: 9.5px;
  letter-spacing: .09em;
}
.index-feature-top b { color: #fff; font-weight: 500; }
.index-feature-copy { position: relative; min-height: 220px; }
.index-feature-item {
  position: absolute;
  inset: auto 0 0;
  opacity: 0;
  transform: translateY(12px);
  pointer-events: none;
  transition: opacity 360ms var(--ease-smooth-out), transform 360ms var(--ease-smooth-out);
}
.index-feature-item.is-active { opacity: 1; transform: none; pointer-events: auto; }
.index-feature-item p {
  margin: 0 0 8px;
  color: rgba(255,255,255,.7);
  font-family: var(--font-mono);
  font-size: 10px;
  letter-spacing: .06em;
}
.index-feature-item h2 { margin: 0; color: #fff; font-size: 26px; letter-spacing: -.03em; }
.index-feature-item > span,
.index-feature-item > small { display: block; }
.index-feature-item > span { margin-top: 9px; color: rgba(255,255,255,.72); font-size: 11px; }
.index-feature-item > small { margin-top: 18px; color: rgba(255,255,255,.68); font-size: 11.5px; line-height: 1.65; }
.index-feature-item a {
  display: inline-flex;
  gap: 6px;
  align-items: center;
  margin-top: 18px;
  color: #fff;
  font-size: 11px;
}
.index-feature-item i { font-style: normal; transition: transform var(--duration-quick) var(--ease-smooth-out); }
.index-feature-item a:hover i { transform: translate(2px,-2px); }
.index-carousel-controls { display: grid; grid-template-columns: 30px 1fr 30px; align-items: center; gap: 10px; }
.index-carousel-controls > button {
  width: 30px;
  height: 30px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(255,255,255,.12);
  cursor: pointer;
}
.index-carousel-controls > button:hover { background: rgba(255,255,255,.22); }
.index-carousel-dots { display: flex; align-items: center; gap: 6px; }
.index-carousel-dots button {
  flex: 1;
  height: 2px;
  padding: 0;
  border: 0;
  background: rgba(255,255,255,.25);
  cursor: pointer;
}
.index-carousel-dots button.is-active { background: #fff; }
.index-map--horizontal {
  margin-top: 14px;
  padding: 18px;
  border-radius: var(--r-md);
  background: var(--surface);
  box-shadow: var(--shadow-sm), inset 0 0 0 1px var(--ring-inset);
}
.index-map--horizontal .index-map-head { padding: 0 8px 12px; }
.index-map--horizontal ol {
  display: grid;
  grid-template-columns: repeat(4, minmax(0,1fr));
}
.index-map--horizontal li { box-shadow: inset -1px -1px 0 0 var(--ring); }
.index-map--horizontal li:nth-child(4n) { box-shadow: inset 0 -1px 0 0 var(--ring); }
.index-map--horizontal li:nth-last-child(-n+4) { box-shadow: inset -1px 0 0 0 var(--ring); }
.index-map--horizontal li:last-child { box-shadow: none; }

@media (max-width: 1180px) {
  .index-hero { grid-template-columns: minmax(0, 1.15fr) minmax(260px, .65fr); }
}
@media (max-width: 1100px) {
  .index-map--horizontal ol { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .index-map--horizontal li:nth-child(4n) { box-shadow: inset -1px -1px 0 0 var(--ring); }
  .index-map--horizontal li:nth-child(2n) { box-shadow: inset 0 -1px 0 0 var(--ring); }
  .index-map--horizontal li:nth-last-child(-n+2) { box-shadow: inset -1px 0 0 0 var(--ring); }
  .index-map--horizontal li:last-child { box-shadow: none; }
}
@media (max-width: 980px) {
  .index-hero { grid-template-columns: 1fr; }
  .index-feature {
    min-height: 260px;
    box-shadow: inset 0 1px 0 0 rgba(255,255,255,.13);
  }
  .index-feature-copy { min-height: 150px; }
  .index-carousel-shade { background: linear-gradient(180deg, rgba(8,10,13,.87) 0%, rgba(8,10,13,.5) 58%, rgba(8,10,13,.76) 100%); }
  .index-map--horizontal ol { grid-template-columns: repeat(2, minmax(0,1fr)); }
  .index-map--horizontal li:nth-child(4n) { box-shadow: inset -1px -1px 0 0 var(--ring); }
  .index-map--horizontal li:nth-child(2n) { box-shadow: inset 0 -1px 0 0 var(--ring); }
  .index-map--horizontal li:nth-last-child(-n+2) { box-shadow: inset -1px 0 0 0 var(--ring); }
  .index-map--horizontal li:last-child { box-shadow: none; }
}
@media (max-width: 680px) {
  .index-hero { min-height: 690px; }
  .index-slide img { width: 100%; object-position: center 12%; opacity: .72; }
  .index-intro { padding: 34px 22px 28px; }
  .index-feature { min-height: 250px; padding: 22px; }
  .index-feature-copy { min-height: 155px; }
  .index-feature-item h2 { font-size: 23px; }
  .index-map--horizontal { padding: 15px 12px; }
  .index-map--horizontal ol { grid-template-columns: 1fr; }
  .index-map--horizontal li,
  .index-map--horizontal li:nth-child(2n),
  .index-map--horizontal li:nth-last-child(-n+2) { box-shadow: inset 0 -1px 0 0 var(--ring); }
  .index-map--horizontal li:last-child { box-shadow: none; }
}

@media (prefers-reduced-motion: reduce) {
  .index-slide,
  .index-feature-item { transition: none; }
  .index-slide.is-active { transform: none; }
}
