/* =========================================================
   LonelyHorse — 极简克制
   暗色（默认）：暖黑纸底，赭石赤陶只作强调，不做发光
   亮色：暖纸底 + 墨字 + 分层阴影
   层次来自：底色差（bg → bg-elev → bg-raised）+ 1px 描边 + 投影，
   不使用装饰性渐变或彩色光晕
   CSP：style-src 'self'，本文件是唯一外链样式，模板内不得出现 style=""
   ========================================================= */

:root {
  color-scheme: dark;

  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", Roboto, Helvetica, Arial, sans-serif;
  --font-mono: ui-monospace, SFMono-Regular, Menlo, Consolas, "Liberation Mono", monospace;

  --bg: #0a0908;
  --bg-elev: #100e0b;
  /* 抬升面：只给真正需要“浮起来”的卡片/纸面用，列表项不再铺满整页卡片 */
  --bg-raised: #17130e;
  --fg: #ebe5dc;
  /* 强调字色：正文加粗专用，比正文亮一档，暗色下才不会“糊”成一片 */
  --fg-strong: #fffdf8;
  --fg-muted: #a49a8d;
  --fg-faint: #7f766a;
  --border: rgba(255, 244, 229, 0.08);
  --border-strong: rgba(255, 244, 229, 0.16);
  /* 赭石赤陶：暖纸底上的唯一彩色，只用于链接、按钮、焦点与小状态点 */
  --accent: #d98a5f;
  --accent-soft: rgba(217, 138, 95, 0.10);
  /* 竖线 / 轨道用的低饱和陶色：只做结构提示，不做装饰 */
  --accent-line: rgba(217, 138, 95, 0.34);
  --accent-ink: #1a0e07;
  --grid: rgba(255, 244, 229, 0.022);
  --nav-bg: rgba(10, 9, 8, 0.72);

  --shadow-1: 0 1px 2px rgba(0, 0, 0, 0.5), 0 4px 12px rgba(0, 0, 0, 0.35);
  --shadow-2: 0 1px 2px rgba(0, 0, 0, 0.5), 0 16px 40px rgba(0, 0, 0, 0.5);
  --shadow-3: 0 2px 6px rgba(0, 0, 0, 0.55), 0 34px 74px rgba(0, 0, 0, 0.62);
  --nav-shadow: 0 16px 40px -26px rgba(0, 0, 0, 0.95);

  --radius: 8px;
  --radius-sm: 6px;
  /* 内容栏宽度随视口等比缩放：屏幕越大/浏览器缩得越小，栏越宽，
     避免固定 820px 在宽屏或缩放后缩成“孤零零一条窄柱” */
  --maxw: clamp(720px, 60vw, 960px);
  --maxw-wide: 1040px;
  /* 编辑页要左右双栏，单独放宽，不影响前台阅读宽度 */
  --maxw-editor: 1180px;
}

/* 亮色：暖纸底（偏米的纸色）而不是冷灰。
   赭石赤陶与纸色同属暖色系，靠明度差拉开层级，不需要彩色光晕。 */
html[data-theme="light"] {
  color-scheme: light;

  --bg: #f4f1e9;
  --bg-elev: #faf7f0;
  --bg-raised: #fffdf8;
  --fg: #1e1c18;
  --fg-strong: #0b0a07;
  --fg-muted: #57534a;
  --fg-faint: #6f6a60;
  --border: rgba(46, 40, 30, 0.12);
  --border-strong: rgba(46, 40, 30, 0.24);
  --accent: #9c4a2f;
  --accent-soft: rgba(156, 74, 47, 0.07);
  --accent-line: rgba(156, 74, 47, 0.28);
  --accent-ink: #fffdf8;
  --grid: rgba(46, 40, 30, 0.022);
  --nav-bg: rgba(244, 241, 233, 0.80);

  --shadow-1: 0 1px 2px rgba(56, 48, 32, 0.06), 0 4px 12px rgba(56, 48, 32, 0.06);
  --shadow-2: 0 2px 4px rgba(56, 48, 32, 0.07), 0 16px 36px rgba(56, 48, 32, 0.10);
  --shadow-3: 0 3px 8px rgba(56, 48, 32, 0.08), 0 28px 60px rgba(56, 48, 32, 0.14);
  --nav-shadow: 0 16px 40px -30px rgba(56, 48, 32, 0.30);
}

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

html {
  -webkit-text-size-adjust: 100%;
  /* 画布也染成主题底色：平板/手机上浏览器工具栏收起、页面回弹、
     或合成层与可视视口错位时，露出来的画布默认是纯白 */
  background-color: var(--bg);
  /* 关掉“下拉回弹 / 横向回弹”，避免拖动页面时露出画布 */
  overscroll-behavior: none;
}

body {
  margin: 0;
  min-height: 100vh;
  min-height: 100dvh;
  /* 纵向 flex：nav 在上、footer 在下、main 撑满中间，
     内容短时页脚也贴底，不会悬在半空留一大片空白 */
  display: flex;
  flex-direction: column;
  font-family: var(--font-sans);
  font-size: 16px;
  line-height: 1.7;
  color: var(--fg);
  background-color: var(--bg);
  /* 氛围层：44px 细网格。网格压到几乎不可见，
     只负责给页面一点“机器面板”的质感；不用径向渐变光晕，
     全部静态绘制，刻意不用 background-attachment: fixed（整页每帧重绘 → 卡） */
  background-image:
    linear-gradient(var(--grid) 1px, transparent 1px),
    linear-gradient(90deg, var(--grid) 1px, transparent 1px);
  background-size: 44px 44px, 44px 44px;
  background-repeat: repeat, repeat;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

/* 选中文本用强调色：全站唯一允许“大面积陶色”的瞬间 */
::selection {
  background: var(--accent);
  color: var(--accent-ink);
}

/* 滚动条同一套语言：细、暗，悬停才露出陶色 */
* { scrollbar-width: thin; scrollbar-color: var(--border-strong) transparent; }
::-webkit-scrollbar { width: 10px; height: 10px; }
::-webkit-scrollbar-thumb {
  background: var(--border-strong);
  background-clip: padding-box;
  border: 3px solid transparent;
  border-radius: 999px;
}
::-webkit-scrollbar-thumb:hover { background-color: var(--accent-line); }

h1, h2, h3 {
  line-height: 1.28;
  font-weight: 600;
  letter-spacing: -0.01em;
  /* 标题默认不发光：只在真正的“展示级标题”上点灯，否则处处发光 = 处处不亮 */
  text-wrap: balance;
}

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

img { max-width: 100%; height: auto; }

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

/* ---------- 布局 ---------- */
.container {
  width: 100%;
  max-width: var(--maxw);
  margin: 0 auto;
  padding: 40px 24px 96px;
}

/* 主内容加左右发丝线：宽屏上不再是一条窄柱子孤零零飘在黑底里 */
main.container {
  flex: 1 0 auto;
  padding: 46px 40px 104px;
  border-left: 1px solid var(--border);
  border-right: 1px solid var(--border);
}

/* ---------- 页脚 ---------- */
.site-footer {
  flex: 0 0 auto;
  border-top: 1px solid var(--border);
  background: var(--bg-elev);
}
.site-footer .container {
  max-width: var(--maxw-wide);
  display: flex;
  align-items: center;
  gap: 14px;
  padding-top: 22px;
  padding-bottom: 22px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  letter-spacing: 0.04em;
  color: var(--fg-faint);
}
.site-footer .brand-mark {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--fg-muted);
}
.brand-mark-logo {
  width: 18px;
  height: 18px;
  flex: 0 0 auto;
}

/* ---------- 后台页头（admin-head） ----------
   与前台 masthead 同一套“左标题 / 右元信息”结构，
   但用 eyebrow + 计数胶囊替代原来那条突兀的彩色下划线。 */
.admin-page { max-width: var(--maxw-wide); }
.admin-head {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  padding: 0 0 18px;
  margin: 0 0 26px;
  border-bottom: 1px solid var(--border-strong);
}
.admin-eyebrow {
  margin: 0 0 8px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--accent);
}
.admin-head h1 {
  margin: 0;
  font-size: clamp(1.6rem, 3.6vw, 2.1rem);
  letter-spacing: -0.025em;
}
.admin-head-side {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 2px;
}
.admin-count {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 11px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  color: var(--fg-muted);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
  white-space: nowrap;
}
.admin-count::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- 公开页页头（masthead） ----------
   左：标题 + 一句站点自述；右：窄小的 mono 元信息。
   底部用更亮的通栏细线收口，和下方日志列表的轨道同一条“结构语言”。 */
.masthead {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  padding: 0 0 22px;
  margin: 0 0 6px;
  border-bottom: 1px solid var(--border-strong);
}
.masthead h1 {
  margin: 0;
  font-size: clamp(2rem, 4.8vw, 2.8rem);
  font-weight: 600;
  letter-spacing: -0.03em;
  line-height: 1.04;
}
.masthead-sub {
  margin: 12px 0 0;
  max-width: 46ch;
  color: var(--fg-muted);
  font-size: 1rem;
}
.masthead-meta {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 4px;
  font-family: var(--font-mono);
  font-size: 0.78rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--fg-faint);
  white-space: nowrap;
}
/* 一个小小的“在线”信号点：页面里唯一常驻的陶色标记 */
.masthead-meta::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* ---------- 顶部导航 ---------- */
.site-nav {
  position: sticky;
  top: 0;
  z-index: 20;
  flex: 0 0 auto;
  /* 半透明 + 背景模糊：让下面滚过的内容隐约透上来，导航才像“浮着的一层”而不是贴死的色块 */
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(18px) saturate(150%);
  backdrop-filter: blur(18px) saturate(150%);
  border-bottom: 1px solid var(--border);
}
.site-nav .container {
  max-width: var(--maxw-wide);
  display: flex;
  align-items: center;
  gap: 2px;
  padding-top: 14px;
  padding-bottom: 14px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  /* 品牌名不参与压缩、不换行：否则窄屏上会被后面三个导航项挤成两行 */
  flex: 0 0 auto;
  white-space: nowrap;
  font-weight: 600;
  color: var(--fg);
  margin-right: 18px;
  text-decoration: none;
}
.brand-logo {
  width: 26px;
  height: 26px;
  flex: 0 0 auto;
}
.brand:hover { color: var(--accent); text-decoration: none; }

.navlink {
  color: var(--fg-muted);
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  font-size: 0.95rem;
  /* 中文链接两字宽，一旦允许换行就会竖排成“博/客”，必须锁死 */
  white-space: nowrap;
  transition: color 0.15s ease, background 0.15s ease;
}
.navlink:hover {
  color: var(--fg);
  background: var(--accent-soft);
  text-decoration: none;
}
.spacer { margin-left: auto; }

.theme-toggle {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  background: transparent;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  font-size: 15px;
  cursor: pointer;
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--border-strong);
  background: var(--accent-soft);
}

/* 与 theme-toggle 同规格的方形图标链接（后台入口） */
.nav-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  color: var(--fg-muted);
  transition: color 0.15s ease, border-color 0.15s ease, background 0.15s ease;
}
.nav-icon:hover {
  color: var(--accent);
  border-color: var(--border-strong);
  background: var(--accent-soft);
  text-decoration: none;
}
.nav-icon svg { display: block; }

/* ---------- 浮动返回按钮 ----------
   固定定位 = 无论页面多长、滚到哪里都钉在右上角。
   刻意与导航错开（top 大于导航高度），避免压住主题切换 / 后台入口。 */
.back-fab {
  position: fixed;
  top: 78px;
  right: 26px;
  z-index: 30;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 38px;
  padding: 0 15px 0 12px;
  font: inherit;
  font-size: 0.88rem;
  font-weight: 500;
  color: var(--fg);
  background: var(--bg-elev);
  border: 1px solid var(--border-strong);
  border-radius: 999px;
  /* 与卡片同一套“抬起来”语言：顶面受光边 + 三级投影 */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    var(--shadow-3);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease,
    border-color 0.18s ease, color 0.18s ease;
}
.back-fab:hover {
  transform: translateY(-3px);
  color: var(--accent);
  border-color: var(--accent);
  /* 悬停时再补一圈强调光晕，着重点更明确 */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    var(--shadow-3),
    0 0 0 4px var(--accent-soft);
}
.back-fab:active { transform: translateY(-1px); }
.back-fab:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.back-fab svg { display: block; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 36px;
  padding: 0 14px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  font: inherit;
  font-size: 0.94rem;
  font-weight: 500;
  color: var(--accent-ink);
  background: var(--accent);
  text-decoration: none;
  /* 按钮文字一律不折行：窄屏上“存草稿”曾被挤成“存草/稿” */
  white-space: nowrap;
  cursor: pointer;
  transition: filter 0.15s ease, background 0.15s ease, border-color 0.15s ease;
}
.btn:hover { filter: brightness(1.08); text-decoration: none; }
.btn:active { filter: brightness(0.94); }

.btn-ghost {
  color: var(--fg);
  background: transparent;
  border-color: var(--border);
}
.btn-ghost:hover { background: var(--accent-soft); border-color: var(--border-strong); }

.btn-danger {
  color: #ff6b6b;
  background: transparent;
  border-color: rgba(255, 107, 107, 0.35);
}
.btn-danger:hover { background: rgba(255, 107, 107, 0.12); border-color: rgba(255, 107, 107, 0.6); }
html[data-theme="light"] .btn-danger { color: #c0392b; border-color: rgba(192, 57, 43, 0.35); }
html[data-theme="light"] .btn-danger:hover { background: rgba(192, 57, 43, 0.10); border-color: rgba(192, 57, 43, 0.6); }

.btn-sm { height: 30px; padding: 0 10px; font-size: 0.86rem; }

/* ---------- 文章列表：时间轴 / 日志轨道 ----------
   刻意放弃“一叠同规格圆角卡片”：日期在左栏，中间一条轨道串起节点，
   标题与摘要回到页面平面上。层次感来自结构（栏 / 轨道 / 内容），
   而不是给每张卡都加同样的阴影。 */
.log-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.log-item + .log-item { border-top: 1px solid var(--border); }

.log-entry {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 74px 26px minmax(0, 1fr);
  column-gap: 20px;
  padding: 24px 0;
  color: inherit;
  text-decoration: none;
}
/* 悬停时整行铺一层极淡的陶色：像终端里光标扫过的一行 */
.log-entry::before {
  content: "";
  position: absolute;
  inset: 0 -14px;
  z-index: -1;
  border-radius: var(--radius);
  background: transparent;
  transition: background 0.2s ease;
}
.log-entry:hover::before { background: var(--accent-soft); }
.log-entry:hover { text-decoration: none; }

.log-date {
  justify-self: end;
  padding-top: 4px;
  font-family: var(--font-mono);
  font-size: 0.76rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.02em;
  color: var(--fg-faint);
  transition: color 0.2s ease;
}
.log-entry:hover .log-date { color: var(--fg-muted); }

/* 轨道：贯穿整行的一条竖线，节点落在轨道上 */
.log-rail { position: relative; }
.log-rail::before {
  content: "";
  position: absolute;
  top: 0;
  bottom: 0;
  left: 50%;
  width: 1px;
  background: var(--border-strong);
  transform: translateX(-50%);
}
.log-node {
  position: absolute;
  top: 8px;
  left: 50%;
  width: 7px;
  height: 7px;
  margin-left: -3.5px;
  border-radius: 50%;
  background: var(--bg);
  border: 1px solid var(--border-strong);
  transition: background 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.log-entry:hover .log-node {
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

.log-body { min-width: 0; }
.log-title {
  margin: 0;
  font-size: 1.08rem;
  font-weight: 600;
  line-height: 1.45;
  color: var(--fg);
  transition: color 0.2s ease;
}
.log-entry:hover .log-title { color: var(--accent); }
.log-summary {
  margin: 6px 0 0;
  max-width: 62ch;
  color: var(--fg-muted);
  font-size: 0.94rem;
  line-height: 1.6;
}

/* 首篇：唯一的大字号条目，给列表一个明确的视觉入口 */
.log-item.is-lead .log-entry { padding: 32px 0 36px; }
.log-item.is-lead .log-title {
  font-size: clamp(1.45rem, 3vw, 1.9rem);
  line-height: 1.35;
  letter-spacing: -0.02em;
}
.log-item.is-lead .log-summary { margin-top: 10px; font-size: 1rem; }
.log-item.is-lead .log-node {
  top: 14px;
  background: var(--accent);
  border-color: var(--accent);
  box-shadow: 0 0 0 4px var(--accent-soft);
}

/* 一次编排好的入场：条目依次浮起，仅此一处，不在每张卡片上重复 */
@keyframes log-in {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
.log-item {
  animation: log-in 0.5s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.log-item:nth-child(1) { animation-delay: 0.04s; }
.log-item:nth-child(2) { animation-delay: 0.10s; }
.log-item:nth-child(3) { animation-delay: 0.16s; }
.log-item:nth-child(4) { animation-delay: 0.22s; }
.log-item:nth-child(5) { animation-delay: 0.28s; }
.log-item:nth-child(n + 6) { animation-delay: 0.32s; }

/* 空列表：给一个安静的、可理解的占位，而不是一行灰字 */
.empty {
  margin: 34px 0 0;
  padding: 30px 24px;
  text-align: center;
  color: var(--fg-muted);
  border: 1px dashed var(--border-strong);
  border-radius: var(--radius);
}
.empty p { margin: 0; }
.empty .btn { margin-top: 14px; }

/* ---------- 正文排版 ---------- */
.prose {
  /* 长文行高比全站略大：行距是阅读体验里最便宜、收益最高的一档 */
  line-height: 1.85;
}
/* 首尾元素不额外撑高容器，保证文章卡片上下留白均匀 */
.prose > :first-child { margin-top: 0; }
.prose > :last-child { margin-bottom: 0; }

.prose h1 { font-size: clamp(1.5rem, 3.6vw, 2rem); margin: 0 0 0.4em; }
.prose h2 {
  margin: 2.2em 0 0.9em;
  padding-bottom: 0.4em;
  font-size: 1.3rem;
  /* 二级标题加一条底边：切分章节，比单纯放大字号更易扫读 */
  border-bottom: 1px solid var(--border);
}
.prose h3 { margin: 1.8em 0 0.7em; font-size: 1.1rem; }
/* 三级标题用短竖线提示层级，避免再加一条横线与 h2 抢视觉 */
.prose h3::before {
  content: "";
  display: inline-block;
  width: 3px;
  height: 0.95em;
  margin-right: 9px;
  border-radius: 2px;
  background: var(--accent);
  vertical-align: -0.08em;
}
.prose p { margin: 1.05em 0; }

/* 加粗：中文系统字体大多没有真正的半粗字重，700 之外再提亮一档字色，
   关键词才能在暗色背景上真正“跳”出来 */
.prose strong {
  font-weight: 700;
  color: var(--fg-strong);
}

.prose a {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  transition: color 0.15s ease;
}
.prose a:hover { text-decoration-thickness: 2px; }

.prose ul, .prose ol { padding-left: 1.5em; }
.prose li { margin: 0.4em 0; }
/* 列表符号用强调色：比默认灰点更清晰，又不至于整段染色 */
.prose li::marker { color: var(--accent); }
.prose ul ul, .prose ol ol, .prose ul ol, .prose ol ul { margin: 0.3em 0; }
/* 任务列表：复选框与文字基线对齐，勾选态跟随主题色 */
.prose li > input[type="checkbox"] {
  margin: 0 8px 0 0;
  accent-color: var(--accent);
  vertical-align: -0.1em;
}

/* 代码块：比正文卡片更深的底色，一眼与叙述文字区分开 */
.prose pre {
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 0.9rem;
  line-height: 1.6;
  tab-size: 4;
}
.prose code { font-family: var(--font-mono); font-size: 0.9em; }
.prose :not(pre) > code {
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 4px;
  padding: 2px 6px;
}

/* 引用块：左侧强调竖线 + 淡底色，让“引用”与普通段落有块级区分 */
.prose blockquote {
  margin: 1.4em 0;
  padding: 12px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  background: var(--accent-soft);
  color: var(--fg-muted);
}

/* 分隔线：居中的一小段实线，像排版里的“断句”，
   不做两端渐隐（渐隐在纸面上会显脏） */
.prose hr {
  border: 0;
  width: 64px;
  height: 1px;
  margin: 3em auto;
  background: var(--border-strong);
}

.prose img {
  display: block;
  margin: 1.6em auto;
  border-radius: var(--radius);
  border: 1px solid var(--border);
}
/* 正文内表格：外层容器负责横向滚动（窄屏不顶宽），表格本身保持 table 布局
   —— display:block 会打散列宽，让每列缩成文字宽度 */
.prose .table-wrap { margin: 1.4em 0; }
.prose table { margin: 0; }
.prose .ta-center { text-align: center; }
.prose .ta-right { text-align: right; }

/* ---------- 关于页：正文 + 右侧事实栏 ----------
   短文不再塞进一张大白卡里（那会让“test”这种一句话显得空荡），
   而是让正文直接落在页面平面上，用一条左侧竖线做结构提示。 */
.about-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 232px;
  gap: 48px;
  align-items: start;
  margin-top: 34px;
}
.about-body {
  position: relative;
  min-width: 0;
  padding-left: 26px;
}
.about-body::before {
  content: "";
  position: absolute;
  top: 6px;
  bottom: 6px;
  left: 0;
  width: 1px;
  background: var(--accent-line);
}
.about-side {
  position: sticky;
  top: 92px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.about-facts {
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border-strong);
}
.about-fact {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 13px 2px;
  border-bottom: 1px solid var(--border);
}
.about-fact dt {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.about-fact dd {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 1.55rem;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  color: var(--accent);
}
.about-fact dd span {
  margin-left: 2px;
  font-size: 0.72rem;
  font-weight: 400;
  color: var(--fg-faint);
  text-shadow: none;
}
.about-updated {
  margin: 0;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  line-height: 1.7;
  color: var(--fg-faint);
}

/* 文章末尾的元信息：正文之外的一条收口线 */
.article-foot {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin: 36px 40px 0;
  padding-top: 18px;
  border-top: 1px solid var(--border);
  font-family: var(--font-mono);
  font-size: 0.76rem;
  letter-spacing: 0.02em;
  color: var(--fg-faint);
}
.article-foot a { color: var(--fg-muted); }
.article-foot a:hover { color: var(--accent); }
.article-foot .spacer { margin-left: auto; }

/* 子页面顶部返回行：统一间距，避免与页头贴太近 */
.back-row { margin: 0 0 22px; }
.back-row .navlink { font-size: 0.9rem; }

/* ---------- 文章编辑页：撰写 / 预览 双栏工作台 ---------- */
.admin-editor-page { max-width: var(--maxw-editor); }

.editor {
  display: grid;
  /* 左栏略宽：输入区是主战场，预览只做校对 */
  grid-template-columns: minmax(0, 1.06fr) minmax(0, 0.94fr);
  gap: 16px;
  align-items: start;
}

/* 两栏共用同一条“仪表条”：左撰写、右预览，像同一台机器的两块面板。
   用比栏体略深的底色做分隔，不加渐变洗染 */
.editor-strip {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 16px;
  border-bottom: 1px solid var(--border-strong);
  background: var(--bg);
}
.editor-strip-label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
/* 状态灯：条带左侧的小陶点，和文章页 kicker 同一枚 */
.editor-strip-label::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
}
/* 字数 / 渲染状态：等宽数字，不跟随标题的等宽大写 */
.editor-meta,
.editor-preview-status {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0;
  text-transform: none;
  color: var(--fg-faint);
}

/* 左栏：竖向一条流。面板自身不滚，交给整页滚 —— 长文时视线不会锁死在小窗里 */
.editor-main {
  display: flex;
  flex-direction: column;
  min-width: 0;
  /* 裁掉条带洗染在圆角外的直角 */
  overflow: hidden;
}
.editor-main-body {
  padding: 20px 22px 22px;
  /* 字段序号：每个字段前挂一个 01/02 编号，表单读起来像一份规格表 */
  counter-reset: field;
}

.field-row {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr);
  gap: 16px;
  /* 两个标签行数不一致时，让下方输入框底部对齐 */
  align-items: end;
  /* 标题 / slug 与下面的摘要、正文之间用一条细线切段 */
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
}

/* 字段间距统一由 .field 控制，避免与 form p 的默认 16px 叠加 */
.editor-main .field { margin: 0 0 18px; }
.editor-main .field:last-child { margin-bottom: 0; }
.field-row .field { margin-bottom: 0; }
.editor-main .field-summary {
  padding-bottom: 18px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

/* 字段标签：降一档字号 + 前置编号，和正文输入内容拉开层级 */
.editor-main .field > label {
  display: flex;
  align-items: baseline;
  gap: 9px;
  margin-bottom: 9px;
  font-size: 0.8rem;
  font-weight: 600;
  letter-spacing: 0.02em;
  color: var(--fg-muted);
}
.editor-main .field > label::before {
  counter-increment: field;
  content: counter(field, decimal-leading-zero);
  font-family: var(--font-mono);
  font-size: 0.68rem;
  font-weight: 500;
  letter-spacing: 0.08em;
  color: var(--accent);
}

/* 标题是这块面板的视觉主角：大一号、加粗、字距收紧，底色抬到纸面一级 */
.editor-main input#title {
  padding: 11px 13px;
  font-size: 1.18rem;
  font-weight: 600;
  letter-spacing: -0.015em;
  background: var(--bg-raised);
  border-color: var(--border-strong);
}
/* slug 是给机器看的：等宽 + 降一档对比度，不跟标题抢注意力 */
.editor-main input#slug {
  font-family: var(--font-mono);
  font-size: 0.86rem;
  color: var(--fg-muted);
}
.editor-main textarea#summary {
  min-height: 64px;
  font-family: var(--font-sans);
  font-size: 0.95rem;
  line-height: 1.7;
}

/* 正文：撑足高度，长文不用在一个小窗口里来回滚 */
.editor-main textarea#content_md {
  min-height: 54vh;
  padding: 16px;
  font-size: 0.9rem;
  line-height: 1.8;
  tab-size: 2;
  /* 输入框是独立滚动容器：滚到首/尾后不把滚动链给页面 */
  overscroll-behavior: contain;
  /* 滚动条出现/消失时预留宽度，避免正文左右抖动 */
  scrollbar-gutter: stable;
}
.editor-main input::placeholder,
.editor-main textarea::placeholder { color: var(--fg-faint); opacity: 1; }

/* 右栏：钉在视口里的“渲染屏”。固定高度 + 内部滚动，
   页面往下翻时预览始终完整可见，而不是跟着一起被推出屏幕 */
.editor-side {
  position: sticky;
  top: 76px;
  display: flex;
  flex-direction: column;
  height: calc(100vh - 96px);
  height: calc(100dvh - 96px);
  min-width: 0;
  overflow: hidden;
}
/* 只有预览内容自己滚：滚到尽头也不会把整页带着上移。
   这一层是“桌面”：比纸暗一档 + 四周留白，让纸张浮起来 */
.editor-preview-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 16px 16px 20px;
  background: var(--bg);
}

/* 纸张：一张独立的纸。层次全部来自底色差 + 1px 描边 + 投影，
   顶部只留一道 2px 陶色脊线做身份标识，不用任何渐变或光晕 */
.editor-preview-doc {
  display: flex;
  flex-direction: column;
  min-height: 100%;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-top: 2px solid var(--accent);
  border-radius: 3px;
  box-shadow: var(--shadow-1);
  overflow: hidden;
}

/* 预览文档 = 文章页的等比缩小版：复用 .article-head / .prose 语言 */
.editor-preview-doc .article-head {
  padding: 24px 26px 20px;
  background: transparent;
  border-bottom: 1px solid var(--border-strong);
}
.editor-preview-doc .article-eyebrow { margin-bottom: 12px; font-size: 0.66rem; }
/* slug 是 URL，不是大写标签：恢复小写 + 收一点字距 */
.editor-preview-slug {
  letter-spacing: 0.06em;
  text-transform: none;
  word-break: break-all;
}
.editor-preview-doc h1 {
  font-size: 1.5rem;
  line-height: 1.24;
  letter-spacing: -0.025em;
  color: var(--fg-strong);
  text-shadow: none;
  /* 超长标题在预览里最多两行，避免把正文顶出屏幕 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
/* 摘要当导语用：比正文大一档、色阶降一档，和标题形成中间层 */
.editor-preview-doc .article-summary {
  margin-top: 12px;
  font-size: 0.92rem;
  line-height: 1.7;
  color: var(--fg-muted);
}
/* 正文撑满纸张剩余高度，短内容也保持一整张纸的形状 */
.editor-preview-body {
  flex: 1 1 auto;
  padding: 22px 26px 36px;
  font-size: 0.94rem;
  line-height: 1.85;
}
.editor-preview-body > :first-child { margin-top: 0; }
/* 空态：纸面上的一条虚线提示，说明这里会落内容，而不是一片死白 */
.editor-preview-empty {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 180px;
  margin: 0;
  padding: 28px 20px;
  text-align: center;
  font-size: 0.86rem;
  letter-spacing: 0.04em;
  color: var(--fg-faint);
  background: var(--bg);
  border: 1px dashed var(--border-strong);
  border-radius: 2px;
}

/* 底部操作条：与导航共用同一块半透明材质，滚动时悬浮在内容之上 */
.editor-actions {
  grid-column: 1 / -1;
  position: sticky;
  bottom: 12px;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px 9px 16px;
  background: var(--nav-bg);
  -webkit-backdrop-filter: blur(16px) saturate(140%);
  backdrop-filter: blur(16px) saturate(140%);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-2);
}
.editor-actions-hint { font-family: var(--font-mono); font-size: 0.76rem; }

/* 未保存提示：一枚呼吸的陶点，比一行字更安静 */
.editor-dirty {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.74rem;
  color: var(--accent);
}
/* display:inline-flex 会覆盖 hidden 的默认隐藏，必须显式补回 */
.editor-dirty[hidden] { display: none; }
.editor-dirty-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  animation: dirtyPulse 1.6s ease-in-out infinite;
}
@keyframes dirtyPulse {
  0%, 100% { opacity: 1; transform: scale(1); }
  50% { opacity: 0.4; transform: scale(0.78); }
}

/* 手机上没有 Ctrl/⌘ 可用，快捷键提示纯占位：隐掉它，把整行宽度让给两个保存按钮 */
@media (max-width: 640px) {
  .editor-actions-hint { display: none; }
  .editor-actions .btn { flex: 1; }
}

/* 窄屏收起双栏：预览排到表单下方，不再吸附、不再固定高度 */
@media (max-width: 1000px) {
  .editor { grid-template-columns: minmax(0, 1fr); }
  .editor-side {
    position: static;
    height: auto;
  }
  .editor-preview-scroll { max-height: 46vh; }
  .field-row {
    grid-template-columns: minmax(0, 1fr);
    gap: 0;
  }
}

/* ---------- 后台首页：入口清单 ----------
   放弃「一格格等大卡片」：四张卡必有一张落单，且每张卡只有两行字时
   留白显得空洞。改为按分组罗列的清单行——序号、标题、说明、箭头各占
   一列，悬停时整行铺淡陶色并浮出左侧强调竖线，从“卡片堆”变成“控制台目录”。 */
.hub-section + .hub-section { margin-top: 30px; }
.hub-label {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.18em;
  color: var(--fg-faint);
}
.hub-label::after {
  content: "";
  flex: 1;
  height: 1px;
  background: var(--border);
}

.hub-list {
  list-style: none;
  margin: 0;
  padding: 0;
  border-top: 1px solid var(--border);
}
.hub-list > li + li { border-top: 1px solid var(--border); }

.hub-row {
  position: relative;
  isolation: isolate;
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) auto;
  align-items: center;
  column-gap: 16px;
  padding: 17px 14px;
  color: inherit;
  text-decoration: none;
}
/* 悬停底色比行本身长出一截，像终端里光标扫过的一行 */
.hub-row::before {
  content: "";
  position: absolute;
  inset: 0 -10px;
  z-index: -1;
  border-radius: var(--radius);
  background: transparent;
  transition: background 0.18s ease;
}
.hub-row:hover::before { background: var(--accent-soft); }
.hub-row:hover { text-decoration: none; }
/* 左侧强调竖线：只有悬停那一行才长出来 */
.hub-row::after {
  content: "";
  position: absolute;
  left: -10px;
  top: 50%;
  width: 2px;
  height: 0;
  border-radius: 2px;
  background: var(--accent);
  transform: translateY(-50%);
  transition: height 0.22s ease;
}
.hub-row:hover::after { height: 58%; }

.hub-idx {
  font-family: var(--font-mono);
  font-size: 0.74rem;
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.06em;
  color: var(--fg-faint);
  transition: color 0.18s ease;
}
.hub-row:hover .hub-idx { color: var(--accent); }

.hub-text {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.hub-title {
  font-size: 1rem;
  font-weight: 600;
  letter-spacing: -0.01em;
  transition: color 0.18s ease;
}
.hub-row:hover .hub-title { color: var(--accent); }
.hub-desc {
  font-size: 0.875rem;
  line-height: 1.5;
  color: var(--fg-muted);
}

.hub-go {
  font-family: var(--font-mono);
  font-size: 0.85rem;
  color: var(--fg-faint);
  transition: color 0.18s ease, transform 0.18s ease;
}
.hub-row:hover .hub-go { color: var(--accent); transform: translateX(4px); }

/* 会话区：一条收口的细线 + 右侧按钮，不再是一整块空面板 */
.hub-session {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px 20px;
  margin-top: 36px;
  padding-top: 18px;
  border-top: 1px solid var(--border-strong);
}
.hub-session-title {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 600;
}
.hub-session-desc {
  margin: 4px 0 0;
  font-size: 0.86rem;
  color: var(--fg-muted);
}

/* ---------- 面板（表格 / 表单 / 登录卡） ---------- */
.panel {
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.panel-pad { padding: 22px 24px; }

/* ---------- 文章详情：一张“纸”而不是一块白板 ----------
   层次来自：顶部一段实心脊线 + 头部色差 + 顶部受光边 + 柔和投影。
   不用渐变洗染——纸面要干净，层次交给明度和描边。 */
.article {
  position: relative;
  padding: 0 0 40px;
  background: var(--bg-raised);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius);
  /* 目录已改为 position: fixed 并移出卡片（见 .toc），卡片自身不再需要 overflow 裁剪；
     保持注释提醒：若将来在卡片内放 sticky 元素，祖先不得带 overflow（§20.7.7）。 */
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.06),
    var(--shadow-3);
}
/* 顶部脊线：一段 64px 的实心陶色短条，比通栏渐变更像印刷标记 */
.article::before {
  content: "";
  position: absolute;
  top: 0;
  left: 40px;
  width: 64px;
  height: 3px;
  background: var(--accent);
}
html[data-theme="light"] .article {
  box-shadow:
    inset 0 1px 0 #fffdf8,
    var(--shadow-3);
}

.article-head {
  padding: 36px 40px 26px;
  background: var(--bg-raised);
  border-bottom: 1px solid var(--border);
}
.article-eyebrow {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin: 0 0 18px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.article-kicker {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  color: var(--accent);
}
.article-kicker::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.article-eyebrow time { font-variant-numeric: tabular-nums; }
.article-head h1 {
  margin: 0;
  font-size: clamp(1.85rem, 4.4vw, 2.55rem);
  line-height: 1.2;
  letter-spacing: -0.03em;
}
.article-summary {
  margin: 14px 0 0;
  max-width: 58ch;
  color: var(--fg-muted);
  font-size: 1.02rem;
  line-height: 1.7;
}
.article-body { min-width: 0; padding: 32px 40px 4px; }

/* ---------- 文章目录（TOC） ----------
   挂载在页面右侧留白里（position: fixed，脱离文档流），不占正文栏宽。
   扁平清单：缩进即层级；当前节用陶色淡染标记。 */
.toc { display: none; min-width: 0; }

/* ≥1300px 时容器两侧留白才 ≥250px，目录才能完整落在正文卡片之外 */
@media (min-width: 1300px) {
  .toc:not(:empty) {
    display: flex;
    flex-direction: column;
    position: fixed;
    /* 让开右上角 back-fab（top:78 + 高 38 + 12 余量）；scroll-margin-top 仍是 96，互不影响 */
    top: 128px;
    /* 贴着内容栏右缘：借容器 40px 内边距的空间，缝隙收紧到约 12px */
    left: calc(50vw + var(--maxw) / 2 - 28px);
    width: 230px;
    max-height: calc(100vh - 160px);
    max-height: calc(100dvh - 160px);
    /* 与正文卡片同一材质：抬升面 + 亮描边 + 圆角 + 投影，右挂载钉住 */
    padding: 16px 10px 12px 6px;
    background: var(--bg-raised);
    border: 1px solid var(--border-strong);
    border-radius: var(--radius);
    box-shadow: var(--shadow-2);
  }
  /* 缩小版的正文脊线：与 .article::before 同一笔印刷标记 */
  .toc:not(:empty)::before {
    content: "";
    position: absolute;
    top: 0;
    left: 26px;
    width: 40px;
    height: 3px;
    background: var(--accent);
  }
}

/* 栏目标题：陶点 + mono 小字，与全站 kicker 同一语言 */
.toc-title {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 0 0 10px;
  font-family: var(--font-mono);
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  color: var(--fg-faint);
}
.toc-title::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* 滚动区：装订线由这里的 20px padding 提供，
   折叠钮负左移后仍落在 padding 盒内，不会成为横向可滚动溢出 */
.toc-scroll {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  scrollbar-width: thin;                        /* 长目录需要可见的滚动位置 */
  padding-left: 20px;
  padding-right: 4px;
  padding-bottom: 4px;
}

.toc-nav ol { list-style: none; margin: 0; padding: 0; }
/* 缩进即层级：不画竖线、不画轨道 */
.toc-nav ol ol { padding-left: 14px; }
.toc-nav li { position: relative; margin: 0; }
/* 等宽字体清单：与 eyebrow / 页脚元信息同一语言 */
.toc-nav { font-family: var(--font-mono); }

/* 锚点用「负 margin + 等值 padding」让文字左缘对齐 x=0，
   同时给当前节的淡染底色留出 8px 的内缩空间 */
.toc-nav a {
  display: block;
  margin: 0 -8px;
  padding: 3px 8px;
  font-size: 0.74rem;
  line-height: 1.5;
  color: var(--fg-muted);
  text-decoration: none;
  border-radius: var(--radius-sm);
  /* 长英文标题（无空格）允许断行，否则会把滚动区撑出横向滚动条 */
  overflow-wrap: break-word;
  transition: color 0.15s ease, background 0.15s ease;
}
.toc-nav a:hover { color: var(--fg); text-decoration: none; }
.toc-nav a[aria-current="true"] {
  color: var(--accent);
  background: var(--accent-soft);
}

/* 折叠钮：平时隐身，悬停或聚焦才浮现；折叠后保持可见，否则找不到展开入口 */
.toc-toggle {
  position: absolute;
  left: -20px;
  top: 4px;
  width: 14px;
  height: 14px;
  padding: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: 0;
  color: var(--fg-faint);
  font-family: var(--font-mono);
  font-size: 0.66rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.15s ease, color 0.15s ease, transform 0.18s ease;
}
.toc-toggle::before { content: "▾"; }
.toc-nav li:hover > .toc-toggle,
.toc-toggle:focus-visible { opacity: 1; }
.toc-toggle:hover { color: var(--accent); }
.toc-nav li.is-collapsed > .toc-toggle { transform: rotate(-90deg); opacity: 1; }
.toc-nav li.is-collapsed > ol { display: none; }

/* 锚点偏移：吸顶导航会盖住跳到的标题。
   这三行取代 JS 平滑滚动与 JS 更新 hash（§20.5.3） */
.article-body h2,
.article-body h3,
.article-body h4 { scroll-margin-top: 96px; }
html { scroll-behavior: smooth; }
@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } }

/* ---------- 表格 ---------- */
.table-wrap { overflow-x: auto; }
table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
th, td { padding: 11px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th {
  font-size: 0.8rem;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.06em;
  color: var(--fg-muted);
}
tbody tr:last-child td { border-bottom: 0; }
tbody tr { transition: background 0.15s ease; }
tbody tr:hover { background: var(--accent-soft); }
td .btn + .btn { margin-left: 8px; }

/* ---------- 后台表格：内容化的一行 = 标题 + slug + 状态 + 时间 ----------
   合并掉原来独立的 Slug 列，把“这是什么 / 在什么状态 / 什么时候动过”
   压进一条可扫读的行，右侧操作列固定右对齐。 */
.admin-panel {
  overflow: auto;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
}
.admin-table { min-width: 560px; }
.admin-table thead th {
  padding: 12px 20px;
  background: var(--bg);
  border-bottom: 1px solid var(--border-strong);
  font-family: var(--font-mono);
  font-size: 0.7rem;
  font-weight: 500;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.admin-table td { padding: 15px 20px; border-bottom: 1px solid var(--border); }
.admin-table tbody tr:last-child td { border-bottom: 0; }
.cell-title {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}
.cell-title-main {
  font-weight: 600;
  color: var(--fg);
  /* 长标题最多两行，超出省略，避免把行高撑爆 */
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-clamp: 2;
  overflow: hidden;
}
.cell-title-sub {
  font-family: var(--font-mono);
  font-size: 0.76rem;
  color: var(--fg-faint);
}
.cell-time {
  font-family: var(--font-mono);
  font-size: 0.8rem;
  font-variant-numeric: tabular-nums;
  color: var(--fg-muted);
  white-space: nowrap;
}
.col-actions, .cell-actions { text-align: right; white-space: nowrap; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.02em;
  white-space: nowrap;
  border: 1px solid var(--border);
  border-radius: 999px;
  color: var(--fg-muted);
}
.badge::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: currentColor;
}
.badge.is-live {
  color: var(--accent);
  background: var(--accent-soft);
  border-color: var(--accent-line);
}
.badge.is-draft { color: var(--fg-faint); background: transparent; }

/* ---------- 表单 ---------- */
label { display: block; margin-bottom: 6px; font-weight: 500; font-size: 0.94rem; }
input[type="text"], input[type="password"], input[type="search"], input[type="url"], input[type="number"], select, textarea {
  width: 100%;
  padding: 9px 12px;
  font: inherit;
  font-size: 0.95rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
input:focus, textarea:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
textarea { resize: vertical; min-height: 120px; font-family: var(--font-mono); font-size: 0.9rem; }
select { cursor: pointer; }
input[type="file"] { width: 100%; font: inherit; font-size: 0.9rem; color: var(--fg-muted); }
input[type="file"]::file-selector-button {
  margin-right: 12px;
  padding: 7px 14px;
  font: inherit;
  font-size: 0.9rem;
  color: var(--fg);
  background: var(--bg);
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: border-color 0.15s ease;
}
input[type="file"]::file-selector-button:hover { border-color: var(--accent); }
.field-hint { display: block; margin-top: 6px; font-size: 0.86rem; }
.checkbox-row label { display: inline-flex; align-items: center; gap: 8px; font-weight: 400; min-height: 28px; }
.checkbox-row input[type="checkbox"] { width: auto; }
form p { margin: 0 0 16px; }

/* ---------- 提示条 ---------- */
.notice {
  border: 1px solid var(--border);
  border-left: 2px solid var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-sm);
  padding: 10px 14px;
  margin: 0 0 20px;
  font-size: 0.94rem;
}
.notice[role="alert"] {
  border-left-color: #ff6b6b;
  background: rgba(255, 107, 107, 0.10);
  color: #ffb3b3;
}
html[data-theme="light"] .notice[role="alert"] { color: #a32013; }

/* ---------- 登录页 / 错误页 ---------- */
.center-page {
  flex: 1 0 auto;
  display: grid;
  place-items: center;
  padding: 24px;
  /* 不另铺背景：让 body 的网格 + 微光透上来，全站氛围统一 */
}
.auth-card {
  width: 100%;
  max-width: 380px;
  padding: 30px 30px 24px;
  /* 与文章卡片同一语言：停在抬升面 + 更亮描边 + 顶面受光边 + 投影 */
  background: var(--bg-elev);
  border-color: var(--border-strong);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.07),
    var(--shadow-2);
}
html[data-theme="light"] .auth-card {
  background: #ffffff;
  box-shadow:
    inset 0 1px 0 #ffffff,
    var(--shadow-2);
}
.auth-head { margin-bottom: 22px; }
.auth-brand {
  display: block;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--accent);
}
.auth-head h1 { margin: 8px 0 0; font-size: 1.35rem; }
.btn-block { width: 100%; }
.auth-actions { margin-bottom: 0; }
.auth-foot { margin: 18px 0 0; text-align: center; font-size: 0.85rem; }
.error-code {
  font-family: var(--font-mono);
  font-size: clamp(2.6rem, 10vw, 4rem);
  font-weight: 600;
  margin: 0 0 8px;
  color: var(--accent);
}

/* ---------- 幕布（首页 Dashboard） ----------
   一块“整机面板”：四角框线 + 顶部状态栏 + 中心光环。
   入场分四级依次浮起；拖动时由 JS 写入 --drag(0~1)，
   内容随之上浮淡出，形成“把幕布拉起来”的视差。 */
.curtain {
  /* 不再用 position:fixed：平板浏览器的可视视口会随工具栏位移，
     fixed 幕布会被锚在偏移过的视口上，顶部漏一条白带。
     改成 body（flex 纵向、min-height:100dvh）里的正常子项，
     尺寸完全由文档流决定，不依赖视口锚点 */
  position: relative;
  z-index: 100;
  width: 100%;
  flex: 1 1 auto;
  min-height: 100vh;
  min-height: 100dvh;
  display: grid;
  place-items: center;
  /* 提前上合成层：拖动只走 GPU 合成，不触发重排/重绘 */
  transform: translate3d(0, 0, 0);
  will-change: transform;
  backface-visibility: hidden;
  touch-action: none;
  cursor: grab;
  user-select: none;
  overflow: hidden;
  transition: transform 0.8s cubic-bezier(0.16, 0.84, 0.24, 1);
  /* 平涂底色：幕布的层次交给角框、虚线环与字号，不靠渐变洗染 */
  background: var(--bg);
  /* 关键：动画元素上不放 box-shadow。全屏 + 大模糊投影会每帧重新栅格化，必卡 */
  border-bottom: 1px solid var(--border-strong);
}
.curtain.is-dragging { transition: none; cursor: grabbing; }
.curtain.is-dragging .curtain-grip { animation: none; }
.curtain.is-open { transform: translate3d(0, -100%, 0); }

/* 顶部状态栏：唯一的常驻信息行，像设备前面板上的电源指示灯 */
.curtain-status {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 18px 24px;
  font-family: var(--font-mono);
  font-size: 0.7rem;
  letter-spacing: 0.18em;
  text-transform: uppercase;
  color: var(--fg-faint);
}
.curtain-status-right {
  margin-left: auto;
  letter-spacing: 0.1em;
  color: var(--fg-faint);
}
.status-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
  animation: pulse 2.8s ease-in-out infinite;
}

/* 四角框线：只画 1px 的角，像取景框，克制但不空 */
.curtain-frame {
  position: absolute;
  inset: 24px;
  pointer-events: none;
}
.curtain-frame span {
  position: absolute;
  width: 20px;
  height: 20px;
  border: 1px solid var(--border-strong);
}
.curtain-frame span:nth-child(1) { top: 0; left: 0; border-right: 0; border-bottom: 0; }
.curtain-frame span:nth-child(2) { top: 0; right: 0; border-left: 0; border-bottom: 0; }
.curtain-frame span:nth-child(3) { bottom: 0; left: 0; border-right: 0; border-top: 0; }
.curtain-frame span:nth-child(4) { bottom: 0; right: 0; border-left: 0; border-top: 0; }

/* 内容层：拖动时整体上浮 + 淡出（--drag 由 app.js 写入） */
.curtain-inner {
  position: relative;
  text-align: center;
  padding: 24px;
  opacity: calc(1 - var(--drag, 0) * 0.85);
  transform: translate3d(0, calc(var(--drag, 0) * -46px), 0)
    scale(calc(1 - var(--drag, 0) * 0.035));
  transition: opacity 0.35s ease, transform 0.5s cubic-bezier(0.16, 0.84, 0.24, 1);
}
.curtain.is-dragging .curtain-inner { transition: none; }
.curtain.is-open .curtain-inner {
  opacity: 0;
  transform: translate3d(0, -60px, 0) scale(0.96);
}

/* 光环：一圈虚线慢转 + 内侧柔光，给 logo 一个“设备待机”的场 */
.curtain-mark {
  position: relative;
  width: clamp(124px, 17vw, 172px);
  margin: 0 auto 28px;
  aspect-ratio: 1;
  display: grid;
  place-items: center;
}
.curtain-halo {
  position: absolute;
  inset: -28%;
  border-radius: 50%;
}
.curtain-halo::before,
.curtain-halo::after {
  content: "";
  position: absolute;
  border-radius: 50%;
}
.curtain-halo::before {
  inset: 0;
  border: 1px dashed var(--accent-line);
  animation: ring-spin 72s linear infinite;
}
.curtain-halo::after {
  inset: 13%;
  border: 1px solid var(--border);
}
.curtain-logo {
  position: relative;
  display: block;
  width: 72%;
  height: auto;
}

.curtain-title {
  margin: 0;
  font-size: clamp(2.05rem, 7vw, 3.5rem);
  font-weight: 600;
  line-height: 1.06;
  /* 两词之间已经有空格，再拉大字距只会变成一堆散开的字母 */
  letter-spacing: 0.005em;
}
.curtain-tagline {
  margin: 14px 0 0;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.3em;
  text-transform: uppercase;
  color: var(--fg-muted);
}
/* 标语下方一道实心短线，收住文字重心 */
.curtain-tagline::after {
  content: "";
  display: block;
  width: 52px;
  height: 1px;
  margin: 20px auto 0;
  background: var(--accent);
}
.curtain-hint {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 34px;
  padding: 7px 15px;
  font-size: 0.8rem;
  color: var(--fg-faint);
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.curtain-hint::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}

/* 底部拉手：一根自上而下的细线——只暗示“可以往上拉”，不抢内容。 */
.curtain-grip {
  position: absolute;
  bottom: 7vh;
  left: 50%;
  width: 1px;
  height: 54px;
  margin-left: -0.5px;
  background: var(--border-strong);
  animation: bob 3.4s ease-in-out infinite;
}

/* 入场：标识 → 标题 → 标语 → 提示，四级依次浮起 */
@keyframes curtain-rise {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
.curtain-mark,
.curtain-title,
.curtain-tagline,
.curtain-hint {
  animation: curtain-rise 0.7s cubic-bezier(0.2, 0.7, 0.2, 1) both;
}
.curtain-mark { animation-delay: 0.06s; }
.curtain-title { animation-delay: 0.18s; }
.curtain-tagline { animation-delay: 0.28s; }
.curtain-hint { animation-delay: 0.38s; }

@keyframes bob { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-6px); } }
@keyframes ring-spin { to { transform: rotate(360deg); } }
@keyframes pulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.35; }
}

/* ---------- 无障碍 / 动效降级 ---------- */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: 0.001ms !important;
    animation-delay: 0ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: 0.001ms !important;
  }
}

/* 窄屏：日期挪到标题上方，轨道留在最左，列表仍然成一条线 */
@media (max-width: 640px) {
  .log-entry {
    grid-template-columns: 20px minmax(0, 1fr);
    column-gap: 14px;
    padding: 20px 0;
  }
  .log-date {
    grid-column: 2;
    grid-row: 1;
    justify-self: start;
    margin-bottom: 5px;
    padding-top: 0;
  }
  .log-rail { grid-column: 1; grid-row: 1 / span 2; }
  .log-body { grid-column: 2; grid-row: 2; }
  .log-node { top: 3px; }
  .log-item.is-lead .log-node { top: 3px; }
  .log-item.is-lead .log-entry { padding: 24px 0 28px; }
  .masthead { flex-direction: column; align-items: flex-start; gap: 12px; }
  .masthead-meta { margin: 0; }
  .admin-head { flex-direction: column; align-items: flex-start; gap: 14px; }
  .hub-row { grid-template-columns: 24px minmax(0, 1fr) auto; column-gap: 12px; padding: 15px 10px; }
  .hub-row::before { inset: 0 -6px; }
  .hub-row::after { left: -6px; }
  .hub-session { margin-top: 28px; }
  .about-grid { grid-template-columns: minmax(0, 1fr); gap: 28px; }
  .about-side { position: static; }
  .about-body { padding-left: 18px; }
  .curtain-status { padding: 14px 16px; font-size: 0.64rem; letter-spacing: 0.1em; }
  .curtain-status-right { display: none; }
  .curtain-frame { inset: 14px; }
}

@media (max-width: 560px) {
  .brand { margin-right: 8px; }
  .navlink { padding: 6px 8px; font-size: 0.9rem; }
  .container { padding: 28px 16px 72px; }
  main.container { padding: 30px 18px 72px; border-left: 0; border-right: 0; }
  .article { padding: 0 0 28px; }
  .article-head { padding: 26px 20px 20px; }
  .article-body { padding: 24px 20px 2px; }
  .article-foot { margin: 28px 20px 0; }
  .admin-table thead th { padding: 11px 14px; }
  .admin-table td { padding: 13px 14px; }
  /* 后台表格在窄屏放弃横向滚动：直接砍掉时间类列，
     否则“操作”列会被推到屏幕外，手机上根本点不到编辑/删除 */
  .admin-table { min-width: 0; }
  .admin-table .cell-time { display: none; }
  .site-footer .container { flex-wrap: wrap; gap: 6px 14px; }
}

/* 小屏手机（iPhone SE / 320~430）：导航只有 320px 可用，
   收紧品牌与链接的内边距，同时把点击高度抬到 34px 以上 */
@media (max-width: 430px) {
  .site-nav .container { padding-left: 12px; padding-right: 12px; gap: 0; }
  .brand { margin-right: 6px; gap: 6px; font-size: 0.9rem; padding: 4px 0; }
  .brand-logo { width: 24px; height: 24px; }
  .navlink { padding: 9px 4px; font-size: 0.84rem; }
  /* 图标按钮保持 34px：320px 下仍有约 9px 余量，没必要为了省几个像素牺牲拇指命中率 */
  .theme-toggle, .nav-icon { width: 34px; height: 34px; }
  /* “编辑 / 删除”并排时会把表格顶宽 22px：允许窄屏下换行堆叠 */
  .cell-actions { white-space: normal; }
  .cell-actions .btn + .btn { margin: 6px 0 0; }
}

/* 矮视口（手机横屏）：幕布内容按高度收缩，避免提示胶囊被裁到屏幕外 */
@media (max-height: 560px) {
  .curtain-status { padding: 10px 16px; }
  .curtain-inner { padding: 12px 24px; }
  .curtain-mark { width: clamp(84px, 22vh, 120px); margin-bottom: 14px; }
  .curtain-title { font-size: clamp(1.6rem, 5.6vh, 2.2rem); }
  .curtain-tagline { margin-top: 8px; }
  .curtain-tagline::after { margin-top: 10px; }
  .curtain-hint { margin-top: 16px; padding: 6px 13px; font-size: 0.76rem; }
  /* 内容已经贴到上下边缘，拉手细线会和提示胶囊叠在一起 */
  .curtain-grip { display: none; }
}

@media (max-width: 400px) {
  .about-fact { padding: 11px 2px; }
}

/* 视口收窄后内容栏已贴近边缘，把返回按钮收成圆形图标，避免压住正文 */
@media (max-width: 900px) {
  .back-fab {
    top: 68px;
    right: 14px;
    width: 40px;
    height: 40px;
    padding: 0;
    justify-content: center;
  }
  .back-fab-text { display: none; }
}

/* ---------- 项目卡片：机架单元 ----------
   每张卡先给一条“状态栏”（运行中 / 已归档），再给标题。
   置顶项目横跨整行并带一道左侧陶色脊线，形成清晰的强弱层级。 */
.project-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 16px;
}
.project-item { display: flex; min-width: 0; }

.project-card {
  position: relative;
  flex: 1;
  display: flex;
  flex-direction: column;
  padding: 22px 24px;
  background: var(--bg-elev);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-1);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease;
}
.project-card:hover {
  transform: translateY(-2px);
  border-color: var(--border-strong);
  box-shadow: var(--shadow-2);
}
.project-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 12px;
}
.project-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--fg-muted);
}
.project-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-soft);
}
.project-state.is-off { color: var(--fg-faint); }
.project-state.is-off::before {
  background: var(--fg-faint);
  box-shadow: none;
}
.project-featured {
  font-family: var(--font-mono);
  font-size: 0.72rem;
  letter-spacing: 0.04em;
  color: var(--accent);
}
.project-card-title {
  margin: 0;
  font-size: 1.15rem;
  letter-spacing: -0.01em;
  color: var(--fg);
  transition: color 0.2s ease;
}
.project-card:hover .project-card-title { color: var(--accent); }
.project-card-summary {
  margin: 8px 0 0;
  color: var(--fg-muted);
  font-size: 0.94rem;
  line-height: 1.6;
}
.project-tags {
  list-style: none;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin: 14px 0 0;
  padding: 0;
}
.project-tag {
  padding: 2px 8px;
  font-family: var(--font-mono);
  font-size: 0.72rem;
  color: var(--fg-muted);
  background: var(--accent-soft);
  border: 1px solid var(--border);
  border-radius: 999px;
}
.project-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  /* 链接永远贴住卡片底部，多行摘要也不会把按钮顶得参差不齐 */
  margin: auto 0 0;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}
.project-card.is-archived { opacity: 0.55; }
.project-card.is-archived:hover { transform: none; box-shadow: var(--shadow-1); }
tr.is-archived { opacity: 0.55; }

/* 置顶项目：宽屏横跨整行，左侧一道陶色脊线 */
@media (min-width: 880px) {
  .project-item.is-featured { grid-column: 1 / -1; }
  .project-item.is-featured .project-card { padding: 26px 28px; }
  .project-item.is-featured .project-card-title { font-size: 1.45rem; }
  .project-item.is-featured .project-card::before {
    content: "";
    position: absolute;
    top: 0;
    bottom: 0;
    left: 0;
    width: 3px;
    background: var(--accent);
  }
}
.back-row .btn { margin-left: 10px; }
