/* ============================================================
   知行录 · 博客 —— 前台样式
   品牌延续工作台：纸面底 + 钴蓝 #243FEF + 星标
   Space Grotesk / Noto Sans SC；明暗双主题均按 WCAG AA 校对比度
   JS 动效（GSAP）只使用 transform / opacity；CSS 过渡只承担 hover / 主题切换等轻反馈
   ============================================================ */

@font-face {
  font-family: 'Space Grotesk';
  src: url('/fonts/space-grotesk-latin-wght-normal.woff2') format('woff2-variations');
  font-weight: 300 700;
  font-style: normal;
  font-display: swap;
}

:root {
  /* 浅色（默认）：纸面底 */
  --bg: #FAFAF7;
  --bg-soft: #F2F2EE;
  --card: #FFFFFF;
  --ink: #16181D;      /* 正文 15.9:1 */
  --ink-2: #4D525A;    /* 次级 7.6:1 */
  --ink-3: #6E7480;    /* 弱化 4.7:1 */
  --line: rgba(22, 24, 29, .13);
  --hairline: rgba(22, 24, 29, .07);
  --accent: #243FEF;
  --accent-press: #1A31C8;
  --accent-tint: #E9EDFF;
  --accent-wash: rgba(36, 63, 239, .08); /* 悬浮淡填充（按钮/导航 hover 铺底） */
  --accent-mute: rgba(36, 63, 239, .45); /* 次级 accent 线，仅装饰性指示条使用 */
  --on-accent: #FFFFFF;
  --code-bg: #16181D;
  --code-head: rgba(255, 255, 255, .05);
  --code-ink: #E8EAF0;
  --code-mut: #9AA2AF;
  --shadow: 0 1px 2px rgba(22, 24, 29, .04), 0 10px 30px -18px rgba(22, 24, 29, .18);
  --shadow-hover: 0 16px 36px -16px rgba(36, 63, 239, .28), 0 2px 6px rgba(36, 63, 239, .06);
  --header-bg: rgba(250, 250, 247, .86);
  --font-disp: 'Space Grotesk', 'Noto Sans SC Variable', 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei', sans-serif;
  --font-body: 'Space Grotesk', 'Noto Sans SC Variable', 'PingFang SC', 'HarmonyOS Sans SC', 'Microsoft YaHei', sans-serif;
  --font-mono: ui-monospace, 'SF Mono', 'JetBrains Mono', Consolas, 'Courier New', monospace;
  --ease: cubic-bezier(.22, .7, .25, 1);
  color-scheme: light; /* 原生控件（滚动条/输入框等）按浅色渲染 */
}

[data-theme='dark'] {
  /* 深色：近黑底 + 亮钴蓝（浅色蓝在深底对比度不足，故提亮） */
  color-scheme: dark; /* 原生控件按深色渲染 */
  --bg: #0F1115;
  --bg-soft: #14171C;
  --card: #171A20;
  --ink: #E9EBF1;      /* 正文 14.9:1 */
  --ink-2: #B4BAC6;    /* 次级 8.9:1 */
  --ink-3: #8E95A3;    /* 弱化 6.2:1 */
  --line: rgba(233, 235, 241, .16);
  --hairline: rgba(233, 235, 241, .07);
  --accent: #93A8FF;
  --accent-press: #ACBCFF;
  --accent-tint: rgba(147, 168, 255, .16);
  --accent-wash: rgba(147, 168, 255, .12); /* 暗色悬浮淡填充：亮蓝低透明，icon/文字压其上 ≥6:1 */
  --accent-mute: rgba(147, 168, 255, .52); /* 暗色次级指示条，对深底 ≈3.1:1（非文本） */
  --on-accent: #0B0E14;
  --code-bg: #0B0D11;
  --code-head: rgba(255, 255, 255, .04);
  --code-ink: #DDE2EA;
  --code-mut: #7E8794;
  --shadow: 0 1px 2px rgba(0, 0, 0, .3), 0 10px 30px -18px rgba(0, 0, 0, .55);
  --shadow-hover: 0 16px 36px -16px rgba(147, 168, 255, .30), 0 2px 6px rgba(147, 168, 255, .08);
  --header-bg: rgba(15, 17, 21, .86);
}

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

html { scroll-behavior: smooth; }

body {
  font-family: var(--font-body);
  background: var(--bg);
  color: var(--ink);
  line-height: 1.7;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
  min-height: 100vh;
  display: flex;
  flex-direction: column;
  /* 主题切换的颜色过渡由 .theme-switching 窗口期统一驱动，非切换态不挂常驻过渡 */
}

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

a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
img { max-width: 100%; }
svg { display: block; }

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

.shell { width: 100%; max-width: 760px; margin: 0 auto; padding: 0 20px; }

/* ============ 阅读进度条 ============ */
.progress-bar {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 100;
  pointer-events: none;
}

/* ============ 页头 ============ */
.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: var(--header-bg);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--hairline);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 60px;
}

.brand { display: flex; align-items: center; gap: 10px; }
.brand-mark { width: 19px; height: 19px; color: var(--accent); transition: transform .5s var(--ease); }
.brand:hover .brand-mark { transform: rotate(90deg); }
.brand-name {
  font-family: var(--font-disp);
  font-weight: 700;
  font-size: 17px;
  letter-spacing: -.01em;
  white-space: nowrap;
}
.brand-name i { font-style: normal; color: var(--ink-3); margin: 0 4px; font-weight: 400; }

.theme-toggle {
  display: grid;
  place-items: center;
  width: 34px; height: 34px;
  border-radius: 9px;
  color: var(--ink-2);
  border: 1px solid var(--hairline);
  background: var(--card);
  transition: color .2s, border-color .2s, background-color .2s, transform .2s var(--ease);
}
/* 悬浮三重信号（图标色/描边/accent 淡填充），明暗各自经变量校准对比度 */
.theme-toggle:hover {
  color: var(--accent);
  border-color: var(--accent);
  background: var(--accent-wash);
}
.theme-toggle:active { transform: scale(.92); }
.theme-toggle svg { width: 17px; height: 17px; transition: transform .16s var(--ease); }
.theme-toggle:hover svg { transform: rotate(12deg) scale(1.08); }

[data-theme='light'] .icon-moon { display: none; }
[data-theme='dark'] .icon-sun { display: none; }

/* ============ 主区 ============ */
#app { flex: 1; padding-top: 40px; padding-bottom: 72px; }

/* ---------- 首页头部 ---------- */
.hero { margin-bottom: 30px; }
.hero-title {
  font-family: var(--font-disp);
  font-size: 27px;
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.3;
}
.hero-sub { margin-top: 7px; color: var(--ink-2); font-size: 14.5px; }
.hero-stats { margin-top: 12px; color: var(--ink-3); font-size: 12.5px; font-family: var(--font-mono); letter-spacing: .02em; }
.hero-stats a { color: inherit; border-bottom: 1px solid var(--line); }
.hero-stats a:hover { color: var(--accent); border-color: var(--accent); }

/* ---------- 工具栏：搜索 + 标签 ---------- */
.toolbar { display: flex; flex-direction: column; gap: 12px; margin-bottom: 26px; }

.search-box { position: relative; }
.search-box svg {
  position: absolute; left: 13px; top: 50%;
  width: 15px; height: 15px;
  transform: translateY(-50%);
  color: var(--ink-3);
  pointer-events: none;
}
.search-input {
  width: 100%;
  height: 42px;
  padding: 0 38px;
  font: inherit;
  font-size: 14px;
  color: var(--ink);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 11px;
  transition: border-color .2s, box-shadow .2s;
}
.search-input::placeholder { color: var(--ink-3); }
.search-input:focus {
  outline: none;
  border-color: var(--accent);
  box-shadow: 0 0 0 3px var(--accent-tint);
}
.search-clear {
  position: absolute; right: 6px; top: 50%;
  transform: translateY(-50%);
  width: 28px; height: 28px;
  display: none;
  place-items: center;
  border-radius: 8px;
  color: var(--ink-3);
  font-size: 15px;
  line-height: 1;
  transition: color .15s, background-color .15s;
}
.search-clear:hover { color: var(--ink); background: var(--bg-soft); }
.search-box.has-value .search-clear { display: grid; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  height: 30px;
  padding: 0 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: 12.5px;
  transition: color .18s, border-color .18s, background-color .18s, transform .18s var(--ease);
}
.chip:hover { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.chip[aria-pressed='true'] {
  background: var(--accent);
  border-color: var(--accent);
  color: var(--on-accent);
}
.chip-count { font-family: var(--font-mono); font-size: 10.5px; opacity: .72; }
.chips-empty { color: var(--ink-3); font-size: 12.5px; }

/* ---------- 文章卡片 ---------- */
.post-list { display: flex; flex-direction: column; gap: 14px; }

.card {
  display: block;
  padding: 20px 22px 18px;
  background: var(--card);
  border: 1px solid var(--hairline);
  border-radius: 14px;
  box-shadow: var(--shadow);
  transition: transform .2s var(--ease), border-color .2s, box-shadow .2s;
  will-change: transform;
}
/* 悬浮与键盘聚焦同一反馈：抬升 + 带色 tint 阴影（不用纯黑阴影） */
.card:hover, .card:focus-within {
  transform: translateY(-3px);
  border-color: var(--line);
  box-shadow: var(--shadow-hover);
}

.card-title {
  font-family: var(--font-disp);
  font-size: 17.5px;
  font-weight: 700;
  line-height: 1.45;
  letter-spacing: -.01em;
  transition: color .2s;
}
.card:hover .card-title, .card:focus-within .card-title { color: var(--accent); }

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 7px;
  color: var(--ink-3);
  font-size: 12.5px;
  font-family: var(--font-mono);
  letter-spacing: .02em;
}
.card-meta .dot { color: var(--line); }

.card-summary {
  margin-top: 10px;
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.75;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 13px; }
.tag {
  padding: 2px 9px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 11.5px;
  line-height: 1.7;
}
.card .tag { color: var(--ink-2); background: var(--bg-soft); }
.card:hover .tag, .card:focus-within .tag { color: var(--accent); background: var(--accent-tint); }

/* ---------- 骨架屏（微光用 transform 实现） ---------- */
.sk { position: relative; overflow: hidden; background: var(--bg-soft); border-radius: 6px; }
.sk::after {
  content: '';
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, var(--hairline), transparent);
  animation: sk-sweep 1.3s infinite;
}
@keyframes sk-sweep { to { transform: translateX(100%); } }

.card--skeleton { pointer-events: none; }
.sk-line { height: 14px; }
.sk-title { height: 19px; width: 62%; margin-bottom: 12px; }
.sk-meta { width: 34%; height: 11px; margin-bottom: 14px; }
.sk-text { width: 92%; margin-bottom: 8px; }
.sk-text:last-child { width: 55%; }
.sk-tags { display: flex; gap: 6px; margin-top: 14px; }
.sk-pill { width: 52px; height: 20px; border-radius: 999px; }

.state-block { padding: 64px 20px; text-align: center; color: var(--ink-3); }
.state-icon { width: 42px; height: 42px; margin: 0 auto 16px; color: var(--line); }
.state-title { font-family: var(--font-disp); font-size: 16.5px; font-weight: 700; color: var(--ink-2); }
.state-sub { margin-top: 7px; font-size: 13.5px; }
.state-action {
  display: inline-block;
  margin-top: 18px;
  padding: 8px 18px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--on-accent);
  font-size: 13px;
  font-weight: 500;
  transition: background-color .2s, transform .2s var(--ease);
}
.state-action:hover { background: var(--accent-press); transform: translateY(-1px); }

/* ---------- 分页 ---------- */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  margin-top: 30px;
}
.pager-btn {
  height: 34px;
  padding: 0 16px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: 13px;
  transition: color .18s, border-color .18s, transform .18s var(--ease), opacity .18s;
}
.pager-btn:hover:not(:disabled) { color: var(--accent); border-color: var(--accent); transform: translateY(-1px); }
.pager-btn:disabled { opacity: .38; cursor: not-allowed; }
.pager-info { color: var(--ink-3); font-size: 12.5px; font-family: var(--font-mono); letter-spacing: .03em; }
.pager-info b { color: var(--ink-2); font-weight: 600; }

/* ============ 文章详情 ============ */
.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--ink-3);
  font-size: 13px;
  margin-bottom: 26px;
  transition: color .2s, transform .2s var(--ease);
}
.back-link svg { width: 14px; height: 14px; }
.back-link:hover { color: var(--accent); transform: translateX(-2px); }

.post-head { margin-bottom: 34px; }
.post-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.post-tags a {
  padding: 2px 10px;
  border-radius: 999px;
  background: var(--accent-tint);
  color: var(--accent);
  font-size: 11.5px;
  transition: background-color .2s, color .2s;
}
.post-tags a:hover { background: var(--accent); color: var(--on-accent); }

.post-title {
  font-family: var(--font-disp);
  font-size: 27px;
  font-weight: 700;
  line-height: 1.4;
  letter-spacing: -.01em;
  text-wrap: balance;
}
.post-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 15px;
  padding-bottom: 20px;
  color: var(--ink-3);
  font-size: 12.5px;
  font-family: var(--font-mono);
  letter-spacing: .02em;
  border-bottom: 1px solid var(--hairline);
}
.post-meta .dot { color: var(--line); }

/* ---------- 详情布局（宽屏右侧目录） ---------- */
.post-layout { position: relative; }

/* ---------- 正文排版 ---------- */
.post-content { font-size: 15.5px; line-height: 1.9; color: var(--ink); overflow-wrap: break-word; }
.post-content > * + * { margin-top: 1.05em; }

/* h1 兜底：正文里以 `# ` 开头的 Markdown 理论上已在渲染后由 app.js 降级为 h2，
   此处兜底防止降级逻辑未跑时 h1 以浏览器默认 2em 裸奔、层级倒挂 */
.post-content h1, .post-content h2, .post-content h3 {
  font-family: var(--font-disp);
  font-weight: 700;
  letter-spacing: -.01em;
  line-height: 1.45;
  scroll-margin-top: 84px;
}
.post-content h1, .post-content h2 {
  font-size: 21px;
  margin-top: 2.1em;
  padding-left: 14px;
  position: relative;
}
.post-content h1::before, .post-content h2::before {
  content: '';
  position: absolute;
  left: 0; top: .18em;
  width: 4px; height: 1em;
  border-radius: 2px;
  background: var(--accent);
}
/* h2 竖条一次性 scroll-reveal：JS 用 IntersectionObserver 挂 data-reveal，
   进入视口加 .is-revealed 后竖条自上而下生长（仅 transform，触发一次即止）；
   无 JS / 无 IO / reduced-motion 时由降级规则静态完整显示 */
.post-content h2[data-reveal]::before {
  transform: scaleY(0);
  transform-origin: 50% 0;
  transition: transform .4s var(--ease);
}
.post-content h2[data-reveal].is-revealed::before { transform: scaleY(1); }
.post-content h3 { font-size: 17.5px; margin-top: 1.8em; }

.post-content p { color: var(--ink); }

.post-content a {
  color: var(--accent);
  text-decoration: underline;
  text-decoration-color: var(--accent-tint);
  text-decoration-thickness: 2px;
  text-underline-offset: 3px;
  transition: text-decoration-color .2s;
}
.post-content a:hover { text-decoration-color: var(--accent); }

.post-content strong { font-weight: 700; }

.post-content ul, .post-content ol { padding-left: 1.5em; }
.post-content li { margin-top: .4em; }
.post-content li::marker { color: var(--accent); }

.post-content blockquote {
  padding: 12px 18px;
  border-left: 3px solid var(--accent);
  border-radius: 0 10px 10px 0;
  background: var(--bg-soft);
  color: var(--ink-2);
}
.post-content blockquote p { margin: 0; }
.post-content blockquote > * + * { margin-top: .6em; }

.post-content hr { border: 0; border-top: 1px solid var(--hairline); margin: 2em 0; }

.post-content img {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: 10px;
  border: 1px solid var(--hairline);
  margin: 1.2em auto;
}

/* 行内代码 */
.post-content code:not(pre code) {
  font-family: var(--font-mono);
  font-size: .86em;
  padding: 2px 6px;
  border-radius: 5px;
  background: var(--bg-soft);
  border: 1px solid var(--hairline);
  color: var(--accent);
}

/* 代码块：深色块 + 语言标签 + 一键复制 */
.code-block {
  margin: 1.4em 0;
  border-radius: 11px;
  overflow: hidden;
  background: var(--code-bg);
  border: 1px solid rgba(0, 0, 0, .25);
}
.code-block-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 12px 7px 16px;
  background: var(--code-head);
}
.code-lang {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .08em;
  text-transform: uppercase;
  color: var(--code-mut);
  user-select: none;
}
.code-copy {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 3px 10px;
  border-radius: 7px;
  border: 1px solid rgba(255, 255, 255, .14);
  color: var(--code-mut);
  font-size: 11.5px;
  font-family: var(--font-mono);
  transition: color .18s, border-color .18s, background-color .18s;
}
.code-copy:hover { color: #fff; border-color: rgba(255, 255, 255, .35); background: rgba(255, 255, 255, .08); }
.code-copy.copied { color: #7EE2A8; border-color: rgba(126, 226, 168, .45); }
.code-copy svg { width: 12px; height: 12px; }

.post-content pre {
  margin: 0;
  padding: 15px 17px;
  overflow-x: auto;
  background: var(--code-bg);
  color: var(--code-ink);
  font-family: var(--font-mono);
  font-size: 13.5px;
  line-height: 1.65;
  tab-size: 2;
  -webkit-overflow-scrolling: touch;
}
.post-content pre code { font-family: inherit; background: none; padding: 0; border: 0; color: inherit; font-size: inherit; }

/* 表格 */
.table-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; margin: 1.4em 0; }
.post-content table {
  width: 100%;
  min-width: 480px;
  border-collapse: collapse;
  font-size: 13.5px;
  border: 1px solid var(--line);
  border-radius: 10px;
}
.post-content th, .post-content td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--hairline);
  text-align: left;
  vertical-align: top;
}
.post-content tr:last-child td { border-bottom: 0; }
.post-content thead th {
  background: var(--bg-soft);
  font-weight: 600;
  color: var(--ink-2);
  font-family: var(--font-mono);
  font-size: 12.5px;
  letter-spacing: .02em;
}
.post-content tbody tr { transition: background-color .15s; }
.post-content tbody tr:hover { background: var(--accent-tint); }

/* ---------- 悬浮目录 ---------- */
.toc {
  position: fixed;
  top: 108px;
  /* 正文列半宽 380px + 20px 间距，目录完全落在右侧留白区，不与正文重叠 */
  left: calc(50% + 400px);
  width: 216px;
  max-height: calc(100vh - 150px);
  overflow-y: auto;
  font-size: 12.5px;
  scrollbar-width: none;
}
.toc::-webkit-scrollbar { display: none; }
.toc-label {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  color: var(--ink-3);
  margin-bottom: 10px;
  user-select: none;
}
.toc-list { list-style: none; border-left: 2px solid var(--hairline); }
.toc-link {
  display: block;
  padding: 4px 0 4px 13px;
  margin-left: -2px;
  border-left: 2px solid transparent;
  color: var(--ink-3);
  line-height: 1.55;
  transition: color .18s, border-color .18s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
/* 悬浮：文字转 accent + 左侧指示条淡入（border-color 过渡平滑显隐，非跳变） */
.toc-link:hover { color: var(--accent); border-left-color: var(--accent-mute); }
.toc-link.active { color: var(--accent); border-left-color: var(--accent); font-weight: 600; }
.toc-link.lvl-3 { padding-left: 26px; }
.toc-empty { display: none; }

/* 目录需要 50% + 400px + 216px + 边距，1280 以下收起 */
@media (max-width: 1299px) { .toc { display: none; } }

/* ---------- 窄屏折叠目录（<1300px，标题区下方） ---------- */
.toc-details {
  margin-top: 18px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: var(--card);
}
.toc-details > summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 10px 14px;
  cursor: pointer;
  list-style: none;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  user-select: none;
  transition: color .18s;
}
.toc-details > summary::-webkit-details-marker { display: none; }
.toc-details > summary::after {
  content: '';
  flex: none;
  width: 7px;
  height: 7px;
  margin-left: 10px;
  border-right: 1.5px solid var(--ink-3);
  border-bottom: 1.5px solid var(--ink-3);
  transform: rotate(45deg); /* 收起时朝下 */
  transition: transform .2s var(--ease), border-color .18s;
}
.toc-details[open] > summary::after { transform: rotate(225deg); } /* 展开时朝上 */
.toc-details > summary:hover { color: var(--accent); }
.toc-details > summary:hover::after { border-color: var(--accent); }
.toc-details[open] > summary { box-shadow: inset 0 -1px 0 var(--hairline); }
.toc-details .toc-list { margin: 8px 13px 10px; }
/* 窄屏空间有限，目录条目允许换行而非省略号截断 */
.toc-details .toc-link { white-space: normal; overflow: visible; text-overflow: clip; }

/* ---------- 上一篇 / 下一篇 ---------- */
.post-neighbors {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 18px;
  margin-top: 46px;
  padding-top: 24px;
  border-top: 1px solid var(--hairline); /* 与正文排版的细线分隔一致 */
}
.neighbor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  min-width: 0; /* 允许标题在 grid 列内截断防溢出 */
  /* 常驻内边距 + 负边距抵消：hover 铺 accent 淡底时版式零位移 */
  padding: 12px 14px;
  margin: -12px -14px;
  border-radius: 12px;
  background: transparent;
  transition: background-color .2s;
}
.neighbor--prev { grid-column: 1; }
.neighbor--next { grid-column: 2; align-items: flex-end; text-align: right; }
.neighbor-dir {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--ink-3);
  transition: color .18s, transform .18s var(--ease);
}
.neighbor-title {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-family: var(--font-disp);
  font-size: 14px;
  font-weight: 600;
  line-height: 1.5;
  color: var(--ink-2);
  transition: color .18s;
}
.neighbor:hover { background: var(--accent-wash); }
.neighbor:hover .neighbor-dir, .neighbor:hover .neighbor-title { color: var(--accent); }
/* 方向小箭头随悬浮向外轻移（箭头是文本字符，随方向标签整体平移） */
.neighbor--prev:hover .neighbor-dir { transform: translateX(-2px); }
.neighbor--next:hover .neighbor-dir { transform: translateX(2px); }

/* 文章页标题下的骨架 */
.post--skeleton .sk-head { height: 26px; width: 78%; margin-bottom: 14px; }
.post--skeleton .sk-meta-l { height: 12px; width: 45%; margin-bottom: 34px; }
.post--skeleton .sk-text { height: 13px; }

/* ============ 页脚 ============ */
.site-footer { border-top: 1px solid var(--hairline); padding: 22px 0 26px; }
.footer-inner { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.footer-brand { font-family: var(--font-disp); font-weight: 700; font-size: 13px; }
.footer-brand i { font-style: normal; color: var(--ink-3); margin: 0 3px; font-weight: 400; }
.footer-sep { width: 1px; height: 12px; background: var(--line); }
.footer-note { color: var(--ink-3); font-size: 12px; }

/* ============ 响应式 ============ */
@media (max-width: 560px) {
  .shell { padding: 0 16px; }
  #app { padding-top: 28px; }
  .hero-title { font-size: 23px; }
  .post-title { font-size: 22px; }
  .card { padding: 17px 17px 15px; }
  .post-content { font-size: 15px; }
  .post-content table { min-width: 0; }
  .pager { gap: 10px; }
  /* 相邻导航单栏堆叠（桌面端按固定列号左右分栏，移动端收回自动排列） */
  .post-neighbors { grid-template-columns: 1fr; margin-top: 38px; padding-top: 20px; }
  .neighbor--prev, .neighbor--next { grid-column: auto; }
  .neighbor--next { align-items: flex-start; text-align: left; }
}

/* ============ 全局主题切换过渡（窗口期挂载） ============ */
/* setTheme（app.js）切换瞬间给 <html> 挂 .theme-switching，350ms 后移除：
   颜色类过渡只在窗口期生效 —— 非切换态零开销；首屏引导（theme.js）不挂载 → 无闪烁。
   不加 !important：让 prefers-reduced-motion 的全局 .01ms 降级（同为 important）保持更高优先级 */
.theme-switching *, .theme-switching *::before, .theme-switching *::after {
  transition:
    background-color .3s var(--ease),
    color .3s var(--ease),
    border-color .3s var(--ease),
    fill .3s var(--ease),
    stroke .3s var(--ease);
}

/* ============ 动效降级 ============ */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after { transition-duration: .01ms !important; animation-duration: .01ms !important; animation-iteration-count: 1 !important; }
  .sk::after { animation: none; }
  /* h2 竖条 reveal 降级：不依赖滚动触发，装饰条静态完整显示 */
  .post-content h2[data-reveal]::before { transform: scaleY(1); }
}
