@charset "utf-8";
/* ══════════════════════════════════════════════════════════════════════════
   DSHDev · v4 「壁纸与窗口」

   两层结构：
     壁纸层（A）  .wallpaper        全站同一图层，默认渐变，可换壁纸图（config.canvas.wallpaper）
     装饰层（B）  .field            气泡 / 光斑，唯一动效层
     窗口层（C）  .window           三层结构：backdrop（材质）+ sheen（反射）+ content
     图章（D）    .seal
     鼠标（E）    .cursor-* / .particles

   两套材质程序**各自独立、互不引用**（《总要求》v4 §4）：
     §6  liquidglass —— 折射层（SVG 位移场）+ 反射层（指针驱动）+ 模糊层
     §7  paper       —— 纸面层（暖白 + 纤维）+ 无反射层
   窗口骨架只定义几何，材质由 data-surface 选择哪一套程序来画。
   ══════════════════════════════════════════════════════════════════════════ */

/* ══════════════════════════ 1. 骨架 token（几何 / 排版 / 品牌） ══════════════════════════ */

:root {
  color-scheme: light;

  --brand: #5b7cfa;
  --brand-2: #8b6cf7;
  --brand-3: #ff7ab8;
  --seal: #e8566a;
  --brand-soft: #eef1ff;
  --brand-glow: rgba(91, 124, 250, 0.45);

  --fg: #1c1f2b;
  --fg-soft: #3a3f52;
  --muted: #5d6275;
  --muted-2: #4a4f63;
  --line: #e6e2d9;
  --line-strong: #d2ccbf;
  --sunken: #f0eee7;

  --nav-h: 70px;
  --p: 0;
  --hero-w: 1100px;
  --measure: 43rem;
  --pad: clamp(20px, 3.4vw, 48px);
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 24px;
  --gutter: clamp(16px, 4vw, 32px);

  --sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Hiragino Sans GB", "Microsoft YaHei", system-ui, sans-serif;
  --display: ui-rounded, "SF Pro Rounded", "Rounded Mplus 1c", "Varela Round",
    "PingFang SC", "Microsoft YaHei", -apple-system, sans-serif;
  --serif: "Songti SC", "Noto Serif SC", Georgia, serif;
  --mono: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;

  --ease: cubic-bezier(0.2, 0.8, 0.2, 1);
  --spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* 壁纸（A）：同一图层，可被 config.canvas.wallpaper 替换 */
  --wallpaper-img: none;
  /* 白天 / 夜间可分别指定自定义壁纸（site.json 的 canvas.wallpaper / wallpaperDark） */
  --wallpaper-img: var(--wallpaper-img-day, none);
  --wallpaper-image:
    radial-gradient(46% 58% at 12% 6%, rgba(133, 99, 250, 0.52), transparent 64%),
    radial-gradient(44% 54% at 92% 10%, rgba(255, 110, 178, 0.46), transparent 64%),
    radial-gradient(60% 62% at 50% 108%, rgba(84, 118, 255, 0.4), transparent 66%),
    radial-gradient(38% 44% at 76% 62%, rgba(255, 198, 108, 0.38), transparent 64%),
    repeating-linear-gradient(104deg, rgba(255, 255, 255, 0.055) 0 2px, rgba(255, 255, 255, 0) 2px 46px),
    linear-gradient(165deg, #eef1ff 0%, #fdeef6 54%, #fff6e9 100%);

  /* 装饰（B） */
  --bubble-glow: rgba(255, 252, 240, 0.72);
  --bubble-glow-mid: rgba(255, 232, 204, 0.26);
  --glint-ink: rgba(255, 255, 255, 0.92);
}

[data-theme="dark"] {
  color-scheme: dark;
  --wallpaper-img: var(--wallpaper-img-night, none);
  --fg: #eef0f7;
  --fg-soft: #d6d9e4;
  --muted: #9aa0b5;
  --muted-2: #c3c8d8;
  --line: #2b2f40;
  --line-strong: #3d4256;
  --sunken: #202636;
  --brand: #8ea3ff;
  --brand-2: #a894ff;
  --brand-3: #ff94c8;
  --brand-soft: #242a3d;
  --seal: #ff7a8a;
  --brand-glow: rgba(142, 163, 255, 0.4);
  --wallpaper-image:
    radial-gradient(50% 60% at 10% 4%, rgba(133, 99, 250, 0.34), transparent 64%),
    radial-gradient(46% 56% at 94% 8%, rgba(255, 110, 178, 0.26), transparent 64%),
    radial-gradient(62% 64% at 50% 108%, rgba(84, 118, 255, 0.3), transparent 66%),
    repeating-linear-gradient(104deg, rgba(255, 255, 255, 0.035) 0 2px, rgba(255, 255, 255, 0) 2px 52px),
    linear-gradient(165deg, #0c1020 0%, #141028 56%, #1a1028 100%);
  --bubble-glow: rgba(160, 134, 255, 0.38);
  --bubble-glow-mid: rgba(255, 122, 184, 0.16);
  --glint-ink: rgba(255, 255, 255, 0.7);
}

/* ══════════════════════════ 2. 基础 ══════════════════════════ */

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

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  background: var(--sunken);
}

html.is-locked {
  overflow: hidden;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: var(--sans);
  font-size: 16px;
  line-height: 1.65;
  color: var(--fg);
  background: transparent;
  overflow-x: hidden;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img,
svg {
  max-width: 100%;
}

img {
  height: auto;
}

h1,
h2,
h3,
h4 {
  margin: 0;
  font-weight: 700;
  line-height: 1.3;
  letter-spacing: -0.01em;
}

p,
ul,
ol,
figure,
blockquote {
  margin: 0;
}

ul,
ol {
  padding: 0;
  list-style: none;
}

a {
  color: inherit;
}

button {
  font: inherit;
  color: inherit;
}

mark {
  background: rgba(255, 220, 120, 0.55);
  color: inherit;
  border-radius: 3px;
  padding: 0 0.15em;
}

::selection {
  background: rgba(139, 108, 247, 0.24);
}

:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
  border-radius: 6px;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

.skip {
  position: fixed;
  top: 8px;
  left: 8px;
  z-index: 300;
  padding: 10px 16px;
  border-radius: 999px;
  background: var(--fg);
  color: #fff;
  font-size: 0.85rem;
  text-decoration: none;
  opacity: 0;
  clip-path: inset(50%);
  pointer-events: none;
  transition: opacity 120ms var(--ease);
}

.skip:focus-visible {
  opacity: 1;
  clip-path: none;
  pointer-events: auto;
}

.lg-defs {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
}

.shell {
  width: 100%;
  max-width: 76rem;
  margin: 0 auto;
  padding: 0 var(--gutter);
}

.link {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-color: rgba(91, 126, 250, 0.35);
  text-underline-offset: 3px;
}

/* ══════════════════════════ 3. 壁纸层（A） ══════════════════════════ */

/*
 * 壁纸与窗口的折射层使用**完全相同**的绘制声明 + background-attachment: fixed，
 * 因此折射层复制的就是元素背后那块壁纸，像素级对齐（真折射的前提）。
 */
.wallpaper,
[data-surface="glass"] .window__backdrop {
  background-image: var(--wallpaper-img), var(--wallpaper-image);
  background-size: cover, auto;
  background-position: center, center;
  background-repeat: no-repeat, no-repeat;
  background-attachment: fixed, fixed;
}

.wallpaper {
  position: fixed;
  inset: 0;
  z-index: -2;
  pointer-events: none;
}

.wallpaper__veil {
  position: absolute;
  inset: 0;
  transition: background-color 320ms var(--ease);
}

/* ══════════════════════════ 4. 装饰层（B） ══════════════════════════ */

.field {
  position: fixed;
  inset: 0;
  z-index: -1;
  overflow: hidden;
  pointer-events: none;
  transition: opacity 320ms var(--ease);
}

.glint {
  position: absolute;
  width: 3px;
  height: 3px;
  border-radius: 50%;
  background: var(--glint-ink);
  box-shadow: 0 0 12px 3px var(--glint-ink);
  opacity: 0.4;
}

.glint--a {
  top: 22%;
  right: 18%;
}

.glint--b {
  top: 64%;
  left: 10%;
  width: 2px;
  height: 2px;
}

/* 背景里的漂浮光团：没有硬边，只有一团渐隐的柔光 */
.bubble {
  position: absolute;
  bottom: -12vmax;
  border-radius: 50%;
  background: radial-gradient(circle, var(--bubble-glow) 0%, var(--bubble-glow-mid) 46%, transparent 92%);
  filter: blur(3px);
  opacity: 0;
  will-change: transform, opacity;
}

.bubble--a {
  width: 96px;
  height: 96px;
  left: 8%;
}

.bubble--b {
  width: 56px;
  height: 56px;
  left: 46%;
}

.bubble--c {
  width: 72px;
  height: 72px;
  right: 14%;
}

/* ══════════════════════════ 5. 窗口骨架（几何，与材质无关） ══════════════════════════ */

.window {
  position: relative;
  isolation: isolate;
  display: block;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid transparent;
  text-decoration: none;
  color: inherit;
  transition: border-radius 320ms var(--ease), border-color 320ms var(--ease),
    box-shadow 320ms var(--ease), transform 200ms var(--ease);
}

.window__backdrop,
.window__sheen {
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
}

.window__backdrop {
  z-index: 0;
  transition: opacity 320ms var(--ease), filter 320ms var(--ease);
}

/* 光学引擎画布：由 /glass/lens.js 插入，画在材质层的位置 */
.window__lens {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: block;
  width: 100%;
  height: 100%;
  border-radius: inherit;
  pointer-events: none;
}

.window__sheen {
  z-index: 1;
  transition: opacity 320ms var(--ease);
}

.window__content {
  position: relative;
  z-index: 2;
  display: block;
}

/* ══════════════════════════ 6. 材质程序 · liquidglass ══════════════════════════ */

[data-surface="glass"] {
  --lg-tint: rgba(255, 255, 255, 0.17);
  --lg-tint-strong: rgba(255, 255, 255, 0.28);
  --lg-edge: rgba(255, 255, 255, 0.55);
  --lg-specular: inset 0 1.5px 0 rgba(255, 255, 255, 0.9),
    inset 0 -12px 26px -20px rgba(255, 255, 255, 0.65),
    inset 0 -1px 0 rgba(255, 255, 255, 0.16);
  --lg-shadow: 0 12px 32px -12px rgba(31, 38, 60, 0.35);
  --lg-shadow-lift: 0 20px 48px -18px rgba(31, 38, 60, 0.42);
  --lg-blur: 16px;
  --lg-sat: 172%;
  --lg-grain-op: 0.05;
  --lg-grain-mix: multiply;
  --lg-grain-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .34 0 0 0 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)'/%3E%3C/svg%3E");
  --lg-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.1), rgba(255, 255, 255, 0));
  --lg-ink: #1c1f2b;
}

[data-theme="dark"][data-surface="glass"] {
  --lg-tint: rgba(30, 35, 54, 0.44);
  --lg-tint-strong: rgba(30, 35, 54, 0.58);
  --lg-edge: rgba(255, 255, 255, 0.16);
  --lg-specular: inset 0 1.5px 0 rgba(255, 255, 255, 0.26),
    inset 0 -12px 26px -20px rgba(255, 255, 255, 0.16),
    inset 0 -1px 0 rgba(0, 0, 0, 0.24);
  --lg-shadow: 0 12px 32px -12px rgba(0, 0, 0, 0.55);
  --lg-shadow-lift: 0 20px 48px -18px rgba(0, 0, 0, 0.62);
  --lg-grain-op: 0.06;
  --lg-grain-mix: screen;
  --lg-grain-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='g'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 .3 0 0 0 0'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23g)'/%3E%3C/svg%3E");
  --lg-sheen: linear-gradient(180deg, rgba(255, 255, 255, 0.06), rgba(255, 255, 255, 0));
}

[data-surface="glass"] .window {
  border-color: var(--lg-edge);
  box-shadow: var(--lg-specular), var(--lg-shadow);
}

/* 折射层：壁纸副本 + 位移场（固定背景才真折射） */
[data-surface="glass"] .window__backdrop {
  opacity: 0.92;
  filter: blur(var(--lg-blur)) saturate(var(--lg-sat));
}

[data-surface="glass"] .window[data-mode="refract"] .window__backdrop {
  filter: url(#lg-refract);
}

/* 滚动中降级为模糊近似（位移场每帧重算是灾难） */
[data-surface="glass"].is-scrolling .window[data-mode="refract"] .window__backdrop {
  filter: blur(calc(var(--lg-blur) * 1.6)) saturate(var(--lg-sat));
}

/* 反射层：tint + 指针驱动的 specular + 纸纹水印 */
[data-surface="glass"] .window__sheen {
  background-image: var(--lg-sheen);
  background-color: var(--lg-tint);
  -webkit-backdrop-filter: blur(2px) saturate(var(--lg-sat));
  backdrop-filter: blur(2px) saturate(var(--lg-sat));
}

/* 光源反射：位置 (--sx,--sy) 与强度 (--li) 由 /glass/worker.js 算，主线程只写变量 */
[data-surface="glass"] .window__sheen::before {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background: radial-gradient(
    circle at var(--sx, 28%) var(--sy, 10%),
    rgba(255, 255, 255, 0.6),
    rgba(255, 255, 255, 0.12) 42%,
    transparent 62%
  );
  opacity: var(--li, 0.55);
  transition: opacity 220ms var(--ease);
  pointer-events: none;
}

[data-surface="glass"] .window__sheen::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: var(--lg-grain-img);
  background-size: 180px 180px;
  opacity: var(--lg-grain-op);
  mix-blend-mode: var(--lg-grain-mix);
  pointer-events: none;
}

/* 柔光 / 轻量窗口：只有 tint 与高光边，不叠 backdrop */
[data-surface="glass"] .window[data-mode="soft"] .window__backdrop {
  opacity: 0;
}

[data-surface="glass"] .window[data-mode="soft"] .window__sheen {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  background-color: var(--lg-tint-strong);
}

/* 照片壁纸：柔光窗口的 tint 提一档，正文才压得住照片的亮度 */
[data-wallpaper="image"][data-surface="glass"] .window[data-mode="soft"] .window__sheen {
  background-color: rgba(250, 250, 252, 0.72);
}

[data-theme="dark"][data-wallpaper="image"][data-surface="glass"] .window[data-mode="soft"] .window__sheen {
  background-color: rgba(18, 22, 34, 0.72);
}

/* 页头背后的内容会滚动，用 blur 近似而不是位移场 */
[data-surface="glass"] .window[data-mode="blur"] .window__backdrop {
  opacity: 0;
}

[data-lens-ready] .window__backdrop {
  opacity: 0;
}

[data-surface="glass"] .window[data-mode="lens"] .window__sheen {
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
}

[data-surface="glass"] .window[data-mode="blur"] .window__sheen {
  -webkit-backdrop-filter: blur(20px) saturate(170%);
  backdrop-filter: blur(20px) saturate(170%);
}

/* ══════════════════════════ 7. 材质程序 · paper（v5 起冻结，只修 bug 不再加效果） ══════════════════════════ */

[data-surface="paper"] {
  --pp-paper: #fdfcf9;
  --pp-paper-2: #f8f6f1;
  --pp-line: #e6e1d8;
  --pp-grain-op: 0.5;
  --pp-grain-mix: multiply;
  --pp-grain-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7 .9' numOctaves='2' seed='23' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0 0 0 0 0 0 0 0 0 0 0 .07 0 0 0 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23p)'/%3E%3C/svg%3E");
  --pp-veil: rgba(247, 246, 242, 0.86);
  --pp-ink: #1c1f2b;
}

[data-theme="dark"][data-surface="paper"] {
  --pp-paper: #1b1f2b;
  --pp-paper-2: #171a24;
  --pp-line: #2f3446;
  --pp-grain-op: 0.09;
  --pp-grain-mix: screen;
  --pp-grain-img: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='p'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.7 .9' numOctaves='2' seed='23' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1 0 0 0 0 1 0 0 0 0 1 .09 0 0 0 0'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23p)'/%3E%3C/svg%3E");
  --pp-veil: rgba(20, 23, 32, 0.9);
}

/* 纸是独立美工：暖白面 + 纤维，没有折射、没有反射层 */
[data-surface="paper"] .window {
  border-color: var(--pp-line);
  box-shadow: none;
}

[data-surface="paper"] .window__backdrop {
  background-color: var(--pp-paper);
  background-image: var(--pp-grain-img);
  background-size: 200px 200px;
  background-position: var(--pp-pos, 0 0);
  opacity: 1;
}

[data-surface="paper"] .window__sheen {
  display: none;
}

/* 纸的壁纸处理：把壁纸压成一层淡淡的水印（同一图层，只是浓度） */
[data-surface="paper"] .wallpaper__veil {
  background-color: var(--pp-veil);
}

[data-theme="dark"] .wallpaper__veil {
  background-color: rgba(10, 12, 20, 0.28);
}

/* 自定义图片壁纸：压一层底色，别让正文直接压在照片纹理上 */
[data-wallpaper="image"][data-surface="glass"] .wallpaper__veil {
  /* 照片壁纸压得更实一些，保证正文与标题在照片上仍然可读 */
  background-color: rgba(248, 249, 251, 0.66);
}

[data-theme="dark"][data-wallpaper="image"][data-surface="glass"] .wallpaper__veil {
  background-color: rgba(10, 12, 20, 0.46);
}

[data-wallpaper="image"][data-surface="paper"] .wallpaper__veil {
  background-color: rgba(250, 249, 245, 0.88);
}

[data-theme="dark"][data-wallpaper="image"][data-surface="paper"] .wallpaper__veil {
  background-color: rgba(16, 19, 28, 0.92);
}

/* ══════════════════════════ 8. 页头 ══════════════════════════ */

.topbar {
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 12px var(--gutter) 0;
}

.topbar__inner {
  position: relative;
  display: block;
  max-width: 76rem;
  margin: 0 auto;
}

.window--nav {
  border-radius: 999px;
}

.window--nav > .window__content {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 6px 8px 6px 16px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  text-decoration: none;
  color: var(--fg);
  flex: none;
}

.brand__avatar {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  border: 1px solid rgba(255, 255, 255, 0.6);
  box-shadow: 0 1px 3px rgba(31, 38, 60, 0.18);
}

[data-theme="dark"] .brand__avatar {
  border-color: rgba(255, 255, 255, 0.22);
}

.brand__text {
  display: grid;
  line-height: 1.05;
}

.brand__name {
  font-family: var(--display);
  font-size: 1.02rem;
  font-weight: 800;
  letter-spacing: 0.01em;
}

.brand__sub {
  font-size: 0.66rem;
  letter-spacing: 0.16em;
  color: var(--muted);
}

.brand__sub::after {
  content: "";
  display: inline-block;
  width: 0.34em;
  height: 0.8em;
  margin-left: 0.22em;
  vertical-align: -0.06em;
  background: var(--seal);
  opacity: 0.85;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 2px;
  margin-left: 6px;
}

.nav-links a {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.87rem;
  color: var(--fg-soft);
  text-decoration: none;
  transition: background-color 180ms var(--ease), color 180ms var(--ease);
}

.nav-links a:hover {
  background: rgba(255, 255, 255, 0.45);
  color: var(--fg);
}

[data-surface="paper"] .nav-links a:hover {
  background: var(--sunken);
}

.nav-links a.is-active {
  background: rgba(255, 255, 255, 0.62);
  color: var(--fg);
  font-weight: 600;
  box-shadow: var(--lg-specular), 0 2px 10px -4px rgba(31, 38, 60, 0.25);
}

[data-surface="paper"] .nav-links a.is-active {
  background: #fff;
  box-shadow: 0 1px 2px rgba(31, 38, 60, 0.06);
}

[data-theme="dark"][data-surface="paper"] .nav-links a.is-active {
  background: #2b3142;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

.nav-search {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-left: 4px;
  padding: 0 9px 0 10px;
  height: 34px;
  border-radius: 999px;
  border: 1px solid transparent;
  background: rgba(255, 255, 255, 0.34);
  transition: background-color 180ms var(--ease), border-color 180ms var(--ease);
}

[data-surface="paper"] .nav-search {
  background: var(--sunken);
}

[data-theme="dark"] .window--nav .window__sheen {
  background-color: rgba(14, 18, 30, 0.74);
}

[data-theme="dark"] .nav-links a.is-active {
  background: rgba(255, 255, 255, 0.14);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08);
}

[data-theme="dark"] .nav-search {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"] .nav-search:focus-within {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.24);
}

.nav-search:focus-within {
  background: rgba(255, 255, 255, 0.66);
  border-color: rgba(255, 255, 255, 0.75);
}

[data-surface="paper"] .nav-search:focus-within {
  background: #fff;
  border-color: var(--pp-line);
}

.nav-search__ico {
  color: var(--muted);
  line-height: 1;
  display: block;
}

.nav-search__ico svg {
  width: 14px;
  height: 14px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
}

.nav-search input {
  width: 92px;
  border: 0;
  background: none;
  outline: none;
  font: inherit;
  font-size: 0.82rem;
  color: var(--fg);
  transition: width 200ms var(--ease);
}

.nav-search input::placeholder {
  color: var(--muted);
}

.nav-search:focus-within input {
  width: 178px;
}

.nav-search__kbd {
  font: 600 0.62rem/1 var(--mono);
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 5px;
  padding: 2px 5px;
}

.nav-search__panel {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 70;
  width: min(440px, calc(100vw - 24px));
  max-height: min(62vh, 520px);
  overflow: auto;
  padding: 6px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.74);
  -webkit-backdrop-filter: blur(24px) saturate(180%);
  backdrop-filter: blur(24px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: var(--lg-specular), var(--lg-shadow-lift);
}

[data-surface="paper"] .nav-search__panel {
  background: var(--pp-paper);
  border-color: var(--pp-line);
}

.nav-search__list {
  display: grid;
  gap: 2px;
}

.nav-search__list a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 1px 10px;
  padding: 9px 11px;
  border-radius: 10px;
  text-decoration: none;
}

.nav-search__list a:hover,
.nav-search__list a:focus-visible {
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .nav-search__list a:hover {
  background: rgba(255, 255, 255, 0.07);
}

.nav-search__title {
  font-size: 0.88rem;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-search__sum {
  grid-column: 1;
  font-size: 0.75rem;
  color: var(--muted-2);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.nav-search__rel {
  grid-row: span 2;
  align-self: center;
  font-size: 0.64rem;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 7px;
}

.nav-search__rel.is-strong {
  color: var(--brand-2);
  border-color: var(--brand-2);
}

.nav-search__empty,
.nav-search__hint {
  padding: 10px 12px;
  font-size: 0.76rem;
  color: var(--muted);
}

.nav-search__hint {
  margin-top: 4px;
  border-top: 1px solid var(--line);
}

.nav-actions {
  display: none;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

/* 材质 + 明暗 合并成一枚玻璃控件，里面两个浮雕小圆钮 */
.nav-controls {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
  padding: 3px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.52);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.62);
}

[data-surface="paper"] .nav-controls {
  background: var(--sunken);
  border-color: var(--pp-line);
  box-shadow: none;
}

.icon-btn {
  position: relative;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.6);
  color: var(--fg-soft);
  cursor: pointer;
  box-shadow: 0 1px 2px rgba(31, 38, 60, 0.1), inset 0 1px 0 rgba(255, 255, 255, 0.9);
  transition: transform 160ms var(--spring), background-color 180ms var(--ease);
}

[data-theme="dark"] .icon-btn {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.16);
  color: var(--fg);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.38);
}

[data-surface="paper"] .icon-btn {
  background: #fff;
  border-color: var(--pp-line);
  box-shadow: 0 1px 2px rgba(31, 38, 60, 0.08);
}

[data-surface="paper"][data-theme="dark"] .icon-btn {
  background: #242938;
  border-color: #33394c;
}

.icon-btn:hover {
  transform: translateY(-1px);
}

/* 鼠标悬停/按下时的液态高光（取自 liquid-glass-react 的 overlay 层） */
.icon-btn::after,
.nav-search::after,
.window--btn::after {
  content: "";
  position: absolute;
  inset: 0;
  border-radius: inherit;
  background-image: radial-gradient(circle at 50% 0%, rgba(255, 255, 255, 1) 0%, rgba(255, 255, 255, 0) 100%);
  mix-blend-mode: overlay;
  opacity: 0;
  pointer-events: none;
  transition: opacity 200ms var(--ease);
}

.icon-btn:hover::after,
.nav-search:hover::after,
.window--btn:hover::after, .window--btn:focus-visible::after {
  opacity: 0.4;
}

.icon-btn:active::after,
.window--btn:active::after {
  opacity: 0.8;
}

.icon-btn svg {
  width: 15px;
  height: 15px;
  display: block;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 当前状态决定显示哪个图标（不靠 JS 换字） */
.ico {
  display: none;
}

[data-surface="glass"] .ico--drop,
[data-surface="paper"] .ico--paper,
[data-theme="light"] .ico--moon,
[data-theme="dark"] .ico--sun {
  display: block;
}

html:not(.js) [data-theme-toggle],
html:not(.js) [data-surface-toggle] {
  display: none;
}

.nav-toggle {
  position: absolute;
  width: 1px;
  height: 1px;
  margin: 0;
  opacity: 0.001;
  pointer-events: none;
}

.burger {
  display: none;
  align-content: center;
  gap: 3px;
  margin: 0;
  cursor: pointer;
}

.burger span:not(.sr-only) {
  display: block;
  width: 13px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
}

.nav-toggle:focus-visible ~ .topbar__inner .burger {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* 菜单打开时三道杠变成 × */
.burger span {
  transition: transform 200ms var(--ease), opacity 160ms var(--ease);
}

.nav-toggle:checked ~ .topbar__inner .burger span:nth-child(1) {
  transform: translateY(5px) rotate(45deg);
}

.nav-toggle:checked ~ .topbar__inner .burger span:nth-child(2) {
  opacity: 0;
}

.nav-toggle:checked ~ .topbar__inner .burger span:nth-child(3) {
  transform: translateY(-5px) rotate(-45deg);
}

.nav-panel,
.nav-scrim {
  display: none;
}

/* 阅读进度：滚动驱动，零 JS */
.progress {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 3px;
  height: 2px;
  border-radius: 2px;
  overflow: hidden;
  display: none;
}

.progress i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--seal);
  transform: scaleX(0);
  transform-origin: 0 50%;
}

[data-page="post"] .progress {
  display: block;
}

@supports (animation-timeline: scroll()) {
  .progress i {
    animation: grow-x linear both;
    animation-timeline: scroll(root);
  }
}

@supports not (animation-timeline: scroll()) {
  [data-page="post"] .progress {
    display: none;
  }
}

/* ══════════════════════════ 9. 首页 Hero：完整 → 玻璃 ══════════════════════════ */

.hero {
  /* --p：0 = 整屏大图，1 = 与正文等宽的玻璃卡片（由 app.js 写在 <html> 上）
     静息高度直接取浏览器窗口（dvh），不再额外加导航高度：
     这样名片、按钮的底部内边距都只对着窗口量，不会因为导航高度变化而跑偏 */
  --hh: 100dvh;
  width: 100vw;
  margin-left: calc(50% - 50vw);
  margin-bottom: 26px;
  padding-inline: calc((100vw - var(--hero-w)) / 2 * var(--p));
}

.hero__window {
  min-height: calc(var(--hh) - (var(--hh) - 460px) * var(--p));
  border-radius: calc(var(--radius-lg) * var(--p));
  display: grid;
  border-color: transparent;
  box-shadow: none;
}

/* 材质层随进度淡入 */
.hero__window > .window__sheen {
  opacity: var(--p);
}

.hero__window > .window__backdrop {
  opacity: calc(var(--p) * 0.92);
}

/* 边框 + 投影用伪元素淡入（border/box-shadow 无法直接插值） */
.hero__window::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  border-radius: inherit;
  border: 1px solid var(--lg-edge);
  box-shadow: var(--lg-specular), var(--lg-shadow);
  opacity: var(--p);
  pointer-events: none;
}

/* 光学引擎接管背景后，隐藏同款 <img>，避免两层叠着 */
.hero__window[data-lens-ready] .hero__media img[data-lens-dup] {
  opacity: 0;
}

[data-surface="paper"] html.is-scrolled [data-page="home"] .hero__window {
  border-color: var(--pp-line);
  box-shadow: none;
}

.hero__window > .window__content {
  position: relative;
  display: grid;
  min-height: inherit;
}

.hero__media {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 42%;
}

.hero__veil {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(12, 10, 24, 0.22) 0%, rgba(12, 10, 24, 0) 26%),
    linear-gradient(90deg, rgba(12, 10, 24, 0.6) 0%, rgba(12, 10, 24, 0.34) 34%, rgba(12, 10, 24, 0.06) 62%, rgba(12, 10, 24, 0) 78%),
    linear-gradient(0deg, rgba(12, 10, 24, 0.66) 0%, rgba(12, 10, 24, 0.28) 26%, rgba(12, 10, 24, 0) 58%);
}

[data-surface="paper"] .hero__veil {
  /* 纸模式没有玻璃折射，但 Hero 上仍是白字，需要足够的暗角才读得出来 */
  background:
    linear-gradient(180deg, rgba(12, 10, 24, 0.34) 0%, rgba(12, 10, 24, 0) 24%),
    linear-gradient(0deg, rgba(12, 10, 24, 0.8) 0%, rgba(12, 10, 24, 0.5) 34%, rgba(12, 10, 24, 0.14) 66%, rgba(12, 10, 24, 0) 84%);
}

.hero__body {
  position: relative;
  z-index: 2;
  align-self: end;
  max-width: 64rem;
  /* 底部内边距从窗口底量起：静息态按钮落在窗口底部上方一段 */
  padding: clamp(90px, 16vh, 180px) clamp(20px, 5vw, 64px)
    calc(clamp(40px, 6vh, 64px) - 14px * var(--p));
  color: #fff;
}

.hero__eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.82);
  text-shadow: 0 1px 12px rgba(10, 8, 24, 0.5);
}

.hero__title {
  margin: 12px 0 14px;
  font-family: var(--display);
  font-size: calc(clamp(2rem, 1.2rem + 3.4vw, 3.4rem) - 0.7rem * var(--p));
  line-height: 1.14;
  letter-spacing: -0.02em;
  text-shadow: 0 2px 24px rgba(10, 8, 24, 0.45);
}

.hero__lede {
  max-width: 40rem;
  font-size: calc(clamp(0.92rem, 0.85rem + 0.3vw, 1.02rem) - 0.02rem * var(--p));
  line-height: 1.78;
  color: rgba(255, 255, 255, 0.9);
  text-shadow: 0 1px 16px rgba(10, 8, 24, 0.55);
}

.hero__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero__card {
  color: #fff;
  opacity: calc(1 - var(--p) * 1.1);
  transform: translateY(calc(-14px * var(--p)));
  position: absolute;
  right: clamp(16px, 4vw, 48px);
  /* 静息态：名片底边 = 浏览器窗口底部 - 一段留白（直接按窗口量，不跟 Hero 的高度走）。
     Hero 内容比窗口高时（窗口很矮 / 页面被放大）再兜一层：底边至少离窗口底部 24px，
     保证整张名片留在首屏内。 */
  bottom: calc(clamp(16px, 4vh, 40px));
  bottom: max(
    calc(clamp(16px, 4vh, 40px)),
    calc(100% - 100dvh + 24px)
  );
  z-index: 3;
  width: 17rem;
  border-radius: var(--radius);
  padding: 14px 16px 12px;
  text-align: center;
}

.hero__card > .window__sheen {
  background-color: rgba(14, 18, 30, 0.46);
}

[data-surface="paper"] .hero__card > .window__sheen {
  display: none;
}

[data-surface="paper"] .hero__card > .window__backdrop {
  background-color: var(--pp-paper);
  background-image: var(--pp-grain-img);
}

[data-surface="paper"] .hero__card {
  color: var(--fg);
}

[data-surface="paper"] .hero__card .hero__id span,
[data-surface="paper"] .hero__card .hero__stats,
[data-surface="paper"] .hero__card .social span {
  color: var(--muted);
}

[data-surface="paper"] .hero__card .hero__stats time {
  color: var(--fg);
}

[data-surface="paper"] .hero__card .avatar {
  border-color: var(--pp-line);
}

.hero__card > .window__content {
  display: grid;
  justify-items: center;
  gap: 1px;
}

.hero__card .hero__id span,
.hero__card .hero__stats {
  color: rgba(255, 255, 255, 0.86);
}

.hero__card .hero__stats time {
  color: #fff;
}

/* 小玻璃片（标签 / 社交）：尺寸与原来一致，材质走凸面光学 + 粉紫固有色 */
.window.chip {
  display: inline-flex;
  zoom: 0.8;               /* 整体 0.8×：尺寸、间距、阴影一起缩，风格与颜色不变 */
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.34);
  color: #fff;
  box-shadow: 0 4px 12px -6px rgba(10, 14, 26, 0.38), 0 14px 28px -16px rgba(10, 14, 26, 0.42);
  transition: transform 180ms var(--spring), box-shadow 200ms var(--ease);
}

.window.chip:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px -6px rgba(10, 14, 26, 0.45), 0 18px 34px -16px rgba(10, 14, 26, 0.46);
}

.window.chip > .window__content {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  font-size: 0.77rem;
  text-decoration: none;
  color: inherit;
  white-space: nowrap;
}

.window.chip--social > .window__content {
  padding: 7px 15px;
  font-size: 0.82rem;
}

/* 标签：更小的整体缩放，但字号单独放大，高度控制在原来的 1.1 倍 */
.window.chip--tag {
  zoom: 0.64;
}

.window.chip--tag > .window__content {
  /* 字号 0.9×（1.33 → 1.2rem），靠内边距把高度保持在 31px */
  font-size: 1.2rem;
  line-height: 1;
  padding: 8px 14px;
}

/* 旧的 .social 规则（白填充 + 品牌渐变描边）不该再叠在小玻璃片上 */
.window.chip.social {
  padding: 0;
  background: none;
  border-color: rgba(255, 255, 255, 0.34);
}

/* 玻璃模式：社交片跟着卡片走——浅卡配深字，深卡配白字 */
[data-surface="glass"] .window.chip--social {
  color: var(--fg);
}

[data-theme="dark"][data-surface="glass"] .window.chip--social,
[data-surface="glass"] .hero__card .window.chip--social {
  color: #fff;
}

/* 光学没挂上时的兜底：粉紫渐变（只在玻璃材质） */
[data-surface="glass"] .window.chip > .window__backdrop {
  background-image: linear-gradient(120deg, rgba(120, 62, 158, 0.86), rgba(86, 62, 190, 0.86));
}

[data-theme="dark"][data-surface="glass"] .window.chip > .window__backdrop {
  background-image: linear-gradient(120deg, rgba(96, 44, 128, 0.9), rgba(66, 50, 166, 0.9));
}

/* 社交片：不挂画布，底色跟着所在卡片走（浅卡浅片、深卡深片） */
[data-surface="glass"] .window.chip--social > .window__backdrop {
  background-image: none;
  background-color: rgba(250, 250, 252, 0.92);
  opacity: 1;
}

[data-theme="dark"][data-surface="glass"] .window.chip--social > .window__backdrop {
  background-image: none;
  background-color: rgba(30, 34, 50, 0.9);
}

[data-surface="glass"] .hero__card .window.chip--social > .window__backdrop {
  background-image: none;
  background-color: rgba(20, 24, 36, 0.86);
}

/* 标签片：同样贴卡片；透明度沿用 0.9 左右 */
[data-surface="glass"] .window.chip--tag > .window__backdrop {
  background-image: none;
  background-color: rgba(250, 250, 252, 0.92);
  opacity: 1;
}

[data-theme="dark"][data-surface="glass"] .window.chip--tag > .window__backdrop {
  background-image: none;
  background-color: rgba(30, 34, 50, 0.9);
}

[data-surface="glass"] .window.chip--tag {
  color: var(--fg);
}

[data-theme="dark"][data-surface="glass"] .window.chip--tag {
  color: #fff;
}

/* 悬停：文字给一个明确的高亮色 */
[data-surface="glass"] .window.chip--tag:hover {
  color: var(--brand-2);
}

[data-surface="glass"] .window.chip--tag:hover b {
  color: inherit;
  opacity: 0.9;
}

[data-theme="dark"][data-surface="glass"] .window.chip--tag:hover {
  color: var(--brand-3);
}

.window.chip {
  transition: transform 180ms var(--spring), box-shadow 200ms var(--ease), color 160ms var(--ease);
}

.window.chip > .window__sheen {
  background-color: rgba(0, 0, 0, 0);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, 0.26), rgba(255, 255, 255, 0) 56%);
}

.window.chip b {
  font-size: 0.9em;
  opacity: 0.7;
  font-weight: 600;
  margin-left: 2px;
}

/* 纸材质：三张卡片（标签 / 在这些地方找我 / 彭兆轩）上的按钮统一成纸片 */
[data-surface="paper"] .window.chip {
  color: var(--fg);
  border-color: var(--pp-line);
  box-shadow: 0 1px 2px rgba(31, 38, 60, 0.06);
}

[data-surface="paper"] .window.chip > .window__backdrop {
  background-color: var(--pp-paper-2);
  background-image: var(--pp-grain-img);
  background-size: 200px 200px;
  background-position: var(--pp-pos, 0 0);
  opacity: 1;
}

[data-surface="paper"] .window.chip b {
  opacity: 0.55;
}

[data-theme="dark"][data-surface="paper"] .window.chip {
  color: var(--fg);
  border-color: #33394c;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

[data-theme="dark"][data-surface="paper"] .window.chip > .window__backdrop {
  background-color: #2b3142;
  background-image: var(--pp-grain-img);
}

.hero__card .social {
  color: #fff;
  background: linear-gradient(rgba(255, 255, 255, 0.16), rgba(255, 255, 255, 0.16)) padding-box,
    linear-gradient(120deg, rgba(255, 255, 255, 0.6), rgba(255, 255, 255, 0.2)) border-box;
}

/* Hero 永远压在照片 + 暗角上：纸模式也别套纸的白底，否则白字白底 */
[data-surface="paper"] .hero .window--btn > .window__backdrop {
  opacity: 1;
  background-color: rgba(18, 22, 34, 0.42);
  background-image: none;
}

[data-surface="paper"] .hero .window--btn > .window__content {
  color: #fff;
}

[data-surface="paper"] .hero .window--btn:hover > .window__backdrop {
  background-color: rgba(18, 22, 34, 0.56);
}

[data-surface="paper"] .hero__card .social {
  color: var(--fg);
}

.hero__card .social span {
  color: rgba(255, 255, 255, 0.6);
}

.hero__card .avatar {
  width: 54px;
  height: 54px;
  margin: 0 0 8px;
}

.avatar {
  display: block;
  border-radius: 50%;
  border: 3px solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 22px -10px rgba(31, 38, 60, 0.5);
  object-fit: cover;
}

.hero__id {
  display: grid;
  gap: 1px;
  margin: 8px 0 6px;
}

.hero__id strong {
  font-family: var(--display);
  font-size: 1.02rem;
}

.hero__id span {
  font-size: 0.76rem;
  color: var(--muted);
}

.hero__stats {
  font-size: 0.7rem;
  line-height: 1.6;
  color: var(--muted);
  font-family: var(--mono);
  margin-bottom: 10px;
}

.hero__stats time {
  color: var(--fg-soft);
}

/* ══════════════════════════ 10. 按钮（窗口的复用实例） ══════════════════════════ */

.window--btn {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  cursor: pointer;
  border: 1px solid transparent;
  background: none;
  font-size: 0.86rem;
  font-weight: 600;
  line-height: 1.2;
  /* 卡片式阴影：近处深、远处淡，对四周有压暗作用 */
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 6px 16px -6px rgba(10, 14, 26, 0.45),
    0 18px 40px -18px rgba(10, 14, 26, 0.5);
  transition: transform 200ms var(--spring), box-shadow 200ms var(--ease);
}

.window--btn:hover {
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.1), 0 8px 20px -6px rgba(10, 14, 26, 0.5),
    0 24px 50px -20px rgba(10, 14, 26, 0.55);
}

/* 光学按钮更透：白纱降到极淡，靠阴影和高光立住 */
.window--btn[data-mode="lens"] {
  border-color: rgba(255, 255, 255, 0.24);
}

.window--btn[data-mode="lens"] > .window__sheen {
  background: none;
}

/* 固有色透明后，白字压在亮背景上要靠投影立住（只影响文字，不改按钮颜色） */
.hero .window--btn[data-mode="lens"] > .window__content {
  text-shadow: 0 1px 10px rgba(8, 10, 18, 0.55), 0 1px 2px rgba(8, 10, 18, 0.4);
}

/*
 * 首页这三个按钮：夜间与日间完全同一套渲染。
 * 它们的材质只由着色器 + 固定的浅色参数决定，不读主题 token：
 * 这里再把可能被主题覆盖的表面属性钉死，避免以后改主题时漂移。
 */
[data-theme="dark"] .hero .window--btn[data-mode="lens"] {
  border-color: rgba(255, 255, 255, 0.24);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, 0.06), 0 6px 16px -6px rgba(10, 14, 26, 0.45),
    0 18px 40px -18px rgba(10, 14, 26, 0.5);
  color: #fff;
}

[data-theme="dark"] .hero .window--btn[data-mode="lens"] > .window__sheen {
  background: none;
}

[data-theme="dark"] .hero .window--btn[data-mode="lens"] > .window__content {
  color: #fff;
  text-shadow: 0 1px 10px rgba(8, 10, 18, 0.55), 0 1px 2px rgba(8, 10, 18, 0.4);
}

.window--btn > .window__content {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
}

.window--primary .window__sheen {
  background-color: var(--brand);
  background-image: linear-gradient(120deg, rgba(255, 255, 255, 0.18), transparent 60%);
}

[data-surface="glass"] .window.window--primary {
  border-color: rgba(255, 255, 255, 0.35);
}

[data-surface="glass"] .window.window--primary .window__sheen {
  background-color: var(--brand);
  background-image: linear-gradient(120deg, rgba(255, 255, 255, 0.2), transparent 62%);
}

[data-surface="glass"] .window--primary .window__content {
  color: #fff;
}

[data-surface="paper"] .window--primary .window__backdrop {
  background-color: var(--brand);
  background-image: none;
}

[data-surface="paper"] .window--primary .window__content {
  color: #fff;
}

.window--btn:hover {
  transform: translateY(-2px);
}

.btn__ico {
  font-size: 0.8em;
  opacity: 0.85;
}

/* ══════════════════════════ 11. 布局与卡片 ══════════════════════════ */

/* 首页：主内容上移一个导航高度，让 Hero 从视口顶端开始，导航浮在它上面 */
[data-page="home"] .shell {
  margin-top: calc(var(--nav-h) * -1 * (1 - var(--p)));
}

.layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 17rem;
  gap: 20px;
  align-items: start;
  margin-bottom: 40px;
}

.col-main,
.col-side {
  display: grid;
  gap: 20px;
  min-width: 0;
}

.card {
  border-radius: var(--radius);
}

.card > .window__content {
  padding: 22px;
}

.card__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.card__head h2 {
  font-family: var(--display);
  font-size: 1.02rem;
  letter-spacing: 0.01em;
}

.card__more {
  font-size: 0.76rem;
  color: var(--muted);
  text-decoration: none;
  white-space: nowrap;
}

a.card__more:hover {
  color: var(--brand);
}

.card__lede {
  margin: -6px 0 16px;
  font-size: 0.84rem;
  line-height: 1.65;
  color: var(--muted-2);
  max-width: 36rem;
}

.card__more-line {
  margin-top: 10px;
  text-align: right;
  font-size: 0.8rem;
}

.card__more-line a {
  color: var(--brand);
  text-decoration: none;
}

.card__back {
  padding: 14px 4px 2px;
}

.card--lost {
  max-width: 40rem;
  margin: 40px auto 60px;
  text-align: center;
}

.card--lost > .window__content {
  padding: clamp(30px, 6vw, 60px);
}

/* ══════════════════════════ 12. 文章卡与列表 ══════════════════════════ */

.card--featured {
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
}

.card--featured > .window__content {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: 18px;
  padding: 12px;
}

.featured__media {
  display: block;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16 / 10;
  background: var(--sunken);
}

.featured__media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 600ms var(--ease);
}

.featured__fallback {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  background: radial-gradient(70% 90% at 20% 10%, rgba(139, 108, 247, 0.5), transparent 70%),
    radial-gradient(60% 80% at 90% 20%, rgba(255, 122, 184, 0.45), transparent 70%),
    linear-gradient(150deg, #c9c2f7, #f7c8dd 60%, #ffe1bf);
}

.featured__body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 8px 10px 12px 2px;
}

.featured__title {
  font-family: var(--display);
  font-size: 1.24rem;
  line-height: 1.35;
}

.featured__title a {
  text-decoration: none;
  background: linear-gradient(var(--fg), var(--fg)) no-repeat 0 100% / 0 1px;
  transition: background-size 260ms var(--ease), color 200ms var(--ease);
}

.featured__title a:hover {
  color: var(--brand-2);
  background-size: 100% 1px;
}

.featured__sum {
  font-size: 0.86rem;
  line-height: 1.65;
  color: var(--muted-2);
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.featured__meta {
  font-size: 0.74rem;
  color: var(--muted);
  font-family: var(--mono);
}

.post-list {
  display: grid;
  gap: 2px;
}

.post-item {
  position: relative;
  border-radius: 14px;
  transition: background-color 180ms var(--ease), transform 180ms var(--ease);
}

.post-item::before {
  content: "";
  position: absolute;
  left: 5px;
  top: 14px;
  bottom: 14px;
  width: 3px;
  border-radius: 3px;
  background: var(--seal);
  opacity: 0;
  transition: opacity 180ms var(--ease);
}

.post-item a {
  display: grid;
  grid-template-columns: 3.9rem minmax(0, 1fr);
  gap: 2px 14px;
  padding: 12px 14px 13px 16px;
  border-radius: inherit;
  text-decoration: none;
}

.pi-date {
  grid-row: span 2;
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
  padding-top: 0.28em;
}

.pi-title {
  font-size: 0.97rem;
  font-weight: 600;
  color: var(--fg);
}

.pi-sum {
  font-size: 0.82rem;
  line-height: 1.55;
  color: var(--muted-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.pi-meta {
  grid-column: 2;
  font-size: 0.72rem;
  color: var(--muted);
  font-family: var(--mono);
}

/* ══════════════════════════ 13. 侧栏 ══════════════════════════ */

.card--profile {
  text-align: center;
}

.card--profile > .window__content {
  padding: 24px 20px 20px;
}

.profile__avatar {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.9);
  box-shadow: 0 8px 20px -12px rgba(31, 38, 60, 0.5);
  object-fit: cover;
  margin: 0 auto 12px;
}

.profile__name {
  font-family: var(--display);
  font-size: 1.06rem;
  font-weight: 700;
}

.profile__role {
  font-size: 0.75rem;
  letter-spacing: 0.08em;
  color: var(--brand-2);
  margin-top: 2px;
}

.profile__bio {
  margin: 12px 0 16px;
  font-size: 0.82rem;
  line-height: 1.7;
  color: var(--muted-2);
}

.tagcloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 5px 11px;
  border-radius: 999px;
  font-size: 0.77rem;
  text-decoration: none;
  color: var(--fg-soft);
  background: rgba(255, 255, 255, 0.34);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: color 180ms var(--ease), border-color 180ms var(--ease), transform 200ms var(--spring);
}

[data-surface="paper"] .tag {
  background: var(--sunken);
  border-color: var(--pp-line);
}

.tag b {
  font-family: var(--mono);
  font-size: 0.66rem;
  font-weight: 400;
  color: var(--muted);
}

.tag:hover {
  color: var(--brand);
  border-color: var(--brand);
}

.recent-list {
  display: grid;
  gap: 10px;
}

.recent-list a {
  display: grid;
  gap: 2px;
  text-decoration: none;
  font-size: 0.83rem;
  color: var(--fg-soft);
  line-height: 1.5;
}

.recent-list time {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}

.recent-list a:hover {
  color: var(--brand);
}

.card--signature {
  text-align: center;
}

.card--signature > .window__content {
  padding: 26px 22px;
}

.sig__quote {
  font-family: var(--serif);
  font-size: 1.05rem;
  line-height: 1.7;
  color: var(--fg-soft);
}

.sig__by {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 12px;
  font-size: 0.72rem;
  letter-spacing: 0.1em;
  color: var(--muted);
}

.atom-url {
  margin: 0 0 10px;
  padding: 8px 10px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.05);
  font-family: var(--mono);
  font-size: 0.72rem;
  overflow-x: auto;
}

[data-theme="dark"] .atom-url {
  background: rgba(255, 255, 255, 0.06);
}

.atom-links {
  display: flex;
  gap: 14px;
  font-size: 0.78rem;
}

.atom-links a {
  color: var(--brand);
  text-decoration: none;
}

/* ══════════════════════════ 14. 项目 / 相册预告 / 社交 ══════════════════════════ */

.proj-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
  gap: 12px;
}

.card--proj > .window__content,
.card--proj-lg > .window__content {
  padding: 16px;
  display: grid;
  gap: 8px;
  align-content: start;
}

/* 项目图标：统一为命令行图标，跟随文字颜色 */
.proj__ico {
  width: 1.6rem;
  height: 1.6rem;
  color: inherit;
  opacity: 0.9;
}

.proj__ico svg {
  width: 100%;
  height: 100%;
  display: block;
}

.proj__body h3 {
  font-family: var(--display);
  font-size: 0.95rem;
  margin-bottom: 6px;
}

.proj__body p {
  font-size: 0.79rem;
  line-height: 1.6;
  color: var(--muted-2);
}

.proj__stack,
.proj__links {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 10px;
}

.proj__stack li {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 0.68rem;
  font-family: var(--mono);
  color: var(--muted);
  background: rgba(0, 0, 0, 0.05);
}

[data-theme="dark"] .proj__stack li {
  background: rgba(255, 255, 255, 0.07);
}

.proj__links li a {
  font-size: 0.75rem;
  color: var(--brand);
  text-decoration: none;
}

.proj__status {
  justify-self: start;
  font-size: 0.68rem;
  font-family: var(--mono);
  color: var(--brand-2);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 2px 9px;
}

.proj-list {
  display: grid;
  gap: 14px;
  max-width: 58rem;
  margin-inline: auto;
}

.card--proj-lg > .window__content {
  grid-template-columns: auto minmax(0, 1fr) auto;
  gap: 18px;
  padding: 20px 22px;
  align-items: start;
}

.card--proj-lg .proj__ico {
  width: 2rem;
  height: 2rem;
}

.card--proj-lg .proj__status {
  align-self: start;
}

.teasers {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
}

.teaser {
  display: block;
  border-radius: 12px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--sunken);
}

.teaser img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms var(--ease);
}

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

.social {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 0.82rem;
  text-decoration: none;
  color: var(--fg-soft);
  border: 1px solid transparent;
  background: linear-gradient(rgba(255, 255, 255, 0.55), rgba(255, 255, 255, 0.55)) padding-box,
    linear-gradient(120deg, var(--brand), var(--brand-2) 55%, var(--brand-3)) border-box;
  transition: transform 200ms var(--spring), color 180ms var(--ease);
}

[data-surface="paper"] .social {
  background: linear-gradient(var(--pp-paper), var(--pp-paper)) padding-box,
    linear-gradient(120deg, var(--brand), var(--brand-2) 55%, var(--brand-3)) border-box;
}

/* 暗色：浅底浅字读不出来，改成深色填充 + 品牌色只留描边 */
[data-theme="dark"] .social {
  color: var(--fg);
  background: linear-gradient(rgba(22, 26, 38, 0.74), rgba(22, 26, 38, 0.74)) padding-box,
    linear-gradient(120deg, var(--brand), var(--brand-2) 55%, var(--brand-3)) border-box;
}

[data-theme="dark"] .social span {
  color: rgba(255, 255, 255, 0.78);
}

[data-theme="dark"] .social:hover {
  background: linear-gradient(rgba(32, 38, 54, 0.9), rgba(32, 38, 54, 0.9)) padding-box,
    linear-gradient(120deg, var(--brand), var(--brand-2) 55%, var(--brand-3)) border-box;
}

.social span {
  font-size: 0.7rem;
  color: var(--muted);
}

.socials--tight {
  justify-content: center;
}

.socials--tight .social {
  padding: 6px 12px;
  font-size: 0.76rem;
}

/* ══════════════════════════ 15. 阅读页 ══════════════════════════ */

.article-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  max-width: calc(var(--measure) + 2 * var(--pad));
  margin: 22px auto 16px;
  transition: padding 260ms var(--ease);
}

.pill {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 0.8rem;
  text-decoration: none;
  color: var(--fg-soft);
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: color 180ms var(--ease), border-color 180ms var(--ease);
}

[data-surface="paper"] .pill {
  background: var(--pp-paper);
  border-color: var(--pp-line);
}

.pill:hover {
  color: var(--brand);
  border-color: var(--brand);
}

.pill--ghost {
  background: transparent;
  border-color: transparent;
  color: var(--muted);
}

.article-layout {
  display: grid;
  grid-template-columns: minmax(0, calc(var(--measure) + 2 * var(--pad)));
  gap: 0;
  justify-content: center;
  align-items: start;
  margin-bottom: 36px;
  transition: padding 260ms var(--ease);
}

/* 没有目录的页面（关于 / 友链）：单栏居中，并与导航拉开一点距离 */
.article-layout--solo {
  margin-top: 26px;
}

.article {
  border-radius: var(--radius-lg);
  min-width: 0;
}

.article > .window__content {
  padding: var(--pad);
}

.article__cover {
  margin: calc(-1 * var(--pad)) calc(-1 * var(--pad)) clamp(20px, 3vw, 30px);
  aspect-ratio: 21 / 9;
  overflow: hidden;
  background: var(--sunken);
}

.article__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.article__head {
  margin-bottom: clamp(22px, 3vw, 34px);
}

.article__title {
  margin: 12px 0 14px;
  font-family: var(--display);
  font-size: clamp(1.65rem, 1.2rem + 1.6vw, 2.1rem);
  line-height: 1.3;
  letter-spacing: -0.015em;
  overflow-wrap: anywhere;
}

.article__lede {
  font-size: 0.96rem;
  line-height: 1.75;
  color: var(--muted-2);
  padding-left: 14px;
  border-left: 2px solid var(--line-strong);
}

.article__foot {
  margin-top: 2.6em;
  padding-top: 1.6em;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 14px;
}

.article__sign {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 0.78rem;
  color: var(--muted);
  font-family: var(--mono);
}

.kicker {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  font-size: 0.74rem;
  letter-spacing: 0.06em;
  color: var(--muted);
}

.pills {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.pill-tag {
  display: inline-block;
  padding: 4px 11px;
  border-radius: 999px;
  font-size: 0.75rem;
  text-decoration: none;
  color: var(--fg-soft);
  background: rgba(0, 0, 0, 0.05);
  transition: color 180ms var(--ease), background-color 180ms var(--ease);
}

[data-theme="dark"] .pill-tag {
  background: rgba(255, 255, 255, 0.08);
}

.pill-tag:hover {
  color: #fff;
  background: var(--brand);
}

.postnav {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  max-width: 60rem;
  margin: 0 auto 28px;
}

.postnav__card {
  display: grid;
  gap: 4px;
  padding: 16px 18px;
  border-radius: var(--radius);
  text-decoration: none;
  background: rgba(255, 255, 255, 0.5);
  border: 1px solid rgba(255, 255, 255, 0.6);
  transition: transform 200ms var(--ease), border-color 200ms var(--ease);
}

[data-surface="paper"] .postnav__card {
  background: var(--pp-paper);
  border-color: var(--pp-line);
}

.postnav__card:hover {
  border-color: var(--brand);
}

.postnav__card.is-empty {
  opacity: 0.55;
}

.postnav__dir {
  font-size: 0.7rem;
  letter-spacing: 0.12em;
  color: var(--muted);
}

.postnav__title {
  font-size: 0.9rem;
  font-weight: 600;
  line-height: 1.45;
}

.postnav__date {
  font-family: var(--mono);
  font-size: 0.7rem;
  color: var(--muted);
}

.related {
  max-width: 60rem;
  margin: 0 auto 28px;
  padding: 0 4px;
}

.related h2 {
  font-family: var(--display);
  font-size: 0.95rem;
  margin-bottom: 10px;
}

.related ul {
  display: grid;
  gap: 6px;
}

.related li {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  font-size: 0.85rem;
}

.related a {
  text-decoration: none;
  color: var(--fg-soft);
}

.related a:hover {
  color: var(--brand);
}

.related time {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
}

.to-top {
  max-width: 60rem;
  margin: 0 auto 44px;
  text-align: center;
}

/* ══════════════════════════ 16. 正文排印 ══════════════════════════ */

.prose {
  font-size: 1.02rem;
  line-height: 1.78;
  color: var(--fg);
  overflow-wrap: break-word;
}

.prose > * + * {
  margin-top: 1.15em;
}

.prose p {
  margin: 0;
}

.prose h2 {
  margin: 2.2em 0 0.7em;
  font-family: var(--display);
  font-size: 1.32rem;
  line-height: 1.45;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--line);
  scroll-margin-top: 92px;
}

.prose h3 {
  margin: 1.9em 0 0.6em;
  font-size: 1.1rem;
  scroll-margin-top: 92px;
}

.prose h4,
.prose h5,
.prose h6 {
  margin: 1.6em 0 0.5em;
  font-size: 1rem;
  scroll-margin-top: 92px;
}

.prose h2 + *,
.prose h3 + *,
.prose h4 + *,
.prose h5 + *,
.prose h6 + * {
  margin-top: 0;
}

.prose a {
  color: var(--brand);
  text-decoration: underline;
  text-decoration-color: rgba(91, 126, 250, 0.34);
  text-underline-offset: 3px;
  transition: text-decoration-color 180ms var(--ease);
}

.prose a:hover {
  text-decoration-color: currentColor;
}

[data-theme="dark"] .prose a {
  text-decoration-color: rgba(142, 163, 255, 0.45);
}

.prose strong {
  font-weight: 650;
}

.prose ul,
.prose ol {
  padding-left: 1.35em;
  margin: 0;
}

.prose li {
  margin: 0.28em 0;
}

.prose ul li {
  list-style: disc;
}

.prose ol li {
  list-style: decimal;
}

.prose li::marker {
  color: var(--brand-2);
}

.prose ul ul,
.prose ol ol,
.prose ul ol,
.prose ol ul {
  margin: 0.25em 0;
}

.prose .task-list {
  padding-left: 0;
}

.prose .task-list li.task {
  list-style: none;
}

.prose .task-list li.task label {
  display: flex;
  align-items: flex-start;
  gap: 8px;
}

.prose .task-list li.task:has(input:checked) {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
}

.prose .task-list input[type="checkbox"] {
  margin-top: 0.42em;
  accent-color: var(--brand);
  width: 0.95em;
  height: 0.95em;
}

.prose .task-list .is-done {
  color: var(--muted);
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
}

.prose s,
.prose del {
  text-decoration: line-through;
  text-decoration-color: var(--line-strong);
  color: var(--muted-2);
}

.prose blockquote {
  padding: 0.2em 0 0.2em 1.1em;
  border-left: 2px solid var(--brand-2);
  color: var(--muted-2);
}

.prose blockquote cite {
  display: block;
  margin-top: 0.5em;
  font-size: 0.85em;
  color: var(--muted);
  font-style: normal;
}

.prose blockquote p + p {
  margin-top: 0.8em;
}

/* callout（Obsidian 知识块） */
.callout {
  margin: 1.5em 0;
  padding: 14px 16px;
  border-radius: 10px;
  border-left: 3px solid var(--brand);
  background: rgba(91, 124, 250, 0.07);
}

.callout__title {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 0.86rem;
  font-weight: 650;
  letter-spacing: 0.02em;
  color: var(--brand);
  margin-bottom: 6px;
}

.callout__body > * + * {
  margin-top: 0.7em;
}

.callout--warning,
.callout--danger,
.callout--fail,
.callout--bug {
  border-left-color: var(--seal);
  background: rgba(232, 86, 106, 0.08);
}

.callout--warning .callout__title,
.callout--danger .callout__title,
.callout--fail .callout__title,
.callout--bug .callout__title {
  color: var(--seal);
}

.callout--tip,
.callout--success {
  border-left-color: var(--brand-3);
  background: rgba(255, 122, 184, 0.1);
}

.callout--tip .callout__title,
.callout--success .callout__title {
  color: #d64d8e;
}

[data-theme="dark"] .callout--tip .callout__title,
[data-theme="dark"] .callout--success .callout__title {
  color: var(--brand-3);
}

.callout--info,
.callout--example,
.callout--quote,
.callout--important {
  border-left-color: var(--brand-2);
  background: rgba(139, 108, 247, 0.09);
}

.callout--info .callout__title,
.callout--example .callout__title,
.callout--quote .callout__title,
.callout--important .callout__title {
  color: var(--brand-2);
}

/* 脚注 */
.footnotes {
  margin-top: 2.6em;
  padding-top: 1.2em;
  border-top: 1px solid var(--line);
  font-size: 0.88rem;
  color: var(--muted-2);
}

.footnotes__title {
  font-size: 0.9rem !important;
  border: 0 !important;
  margin: 0 0 0.8em !important;
  padding: 0 !important;
  color: var(--fg);
}

.footnotes ol {
  padding-left: 1.4em;
  display: grid;
  gap: 6px;
}

.footnotes li {
  list-style: decimal;
}

.footnotes a {
  color: var(--brand);
  text-decoration: none;
}

.fn-ref a {
  text-decoration: none;
  font-size: 0.78em;
  padding: 0 0.1em;
}

/* 内链（未解析引用） */
.wikilink {
  color: var(--muted);
  font-style: italic;
  border-bottom: 1px dashed var(--line-strong);
  cursor: help;
}

.prose code {
  padding: 0.12em 0.35em;
  border-radius: 4px;
  background: rgba(0, 0, 0, 0.055);
  font-family: var(--mono);
  font-size: 0.87em;
}

[data-theme="dark"] .prose code {
  background: rgba(255, 255, 255, 0.08);
}

.prose pre {
  padding: 16px 18px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.045);
  border: 1px solid var(--line);
  overflow-x: auto;
  line-height: 1.6;
  font-size: 0.84rem;
}

[data-theme="dark"] .prose pre {
  background: rgba(255, 255, 255, 0.05);
}

.prose pre code {
  padding: 0;
  background: none;
  font-size: inherit;
}

.prose img {
  border-radius: 10px;
}

.prose hr {
  border: 0;
  border-top: 1px solid var(--line);
  margin: 2.4em 0;
}

.prose .table-wrap {
  overflow-x: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
}

.prose table {
  width: 100%;
  border-collapse: collapse;
  font-size: 0.86rem;
  min-width: 22rem;
}

.prose th,
.prose td {
  padding: 9px 13px;
  text-align: left;
  border-bottom: 1px solid var(--line);
}

.prose thead th {
  background: rgba(0, 0, 0, 0.045);
  font-weight: 600;
  white-space: nowrap;
}

[data-theme="dark"] .prose thead th {
  background: rgba(255, 255, 255, 0.06);
}

.prose tbody tr:last-child td {
  border-bottom: 0;
}

/* ══════════════════════════ 17. 目录（玻璃面板 / 左侧箭头 / 边缘提示） ══════════════════════════ */

/*
 * 宽屏：目录是一块贴在右缘的玻璃面板，位置在导航之下、文章之上。
 * 打开时把文章往左推；收起后文章居中，点右侧空白处或边缘的 ‹ 再唤出。
 */
.toc-panel {
  position: fixed;
  top: calc(var(--nav-h) + 14px);
  right: var(--gutter);
  z-index: 50;
  width: 16rem;
  max-height: calc(100dvh - var(--nav-h) - 32px);
  display: flex;
  flex-direction: column;
  padding: 10px 8px 10px 10px;
  border-radius: var(--radius);
  background: rgba(255, 255, 255, 0.52);
  -webkit-backdrop-filter: blur(26px) saturate(180%);
  backdrop-filter: blur(26px) saturate(180%);
  border: 1px solid rgba(255, 255, 255, 0.62);
  box-shadow: var(--lg-specular), var(--lg-shadow);
  transition: transform 260ms var(--ease), opacity 200ms var(--ease);
}

[data-theme="dark"] .toc-panel {
  background: rgba(30, 35, 52, 0.62);
  border-color: rgba(255, 255, 255, 0.14);
}

[data-surface="paper"] .toc-panel {
  background: var(--pp-paper);
  border-color: var(--pp-line);
}

html:not(.toc-open) .toc-panel {
  transform: translateX(calc(100% + 20px));
  opacity: 0;
  pointer-events: none;
}

/* 收起按钮：面板左上角，44×44 的触控友好尺寸 */
.toc-collapse {
  flex: none;
  width: 38px;
  height: 38px;
  margin: 0 0 8px 2px;
  border: 0;
  border-radius: 12px;
  font-size: 1.15rem;
  background: rgba(255, 255, 255, 0.5);
  color: var(--fg-soft);
  line-height: 1;
  cursor: pointer;
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.8), 0 1px 2px rgba(31, 38, 60, 0.08);
  transition: background-color 160ms var(--ease), transform 160ms var(--spring);
}

.toc-collapse:hover {
  background: rgba(255, 255, 255, 0.8);
  transform: translateX(-2px);
}

[data-surface="paper"] .toc-collapse {
  background: var(--sunken);
  box-shadow: none;
}

.toc {
  flex: 1;
  min-height: 0;
  overflow: auto;
  scrollbar-width: thin;
  font-size: 0.84rem;
  padding-right: 2px;
}

.toc__head {
  font-size: 0.68rem;
  letter-spacing: 0.18em;
  color: var(--muted);
  margin: 0 0 8px 26px;
}

.toc ol {
  display: grid;
  gap: 1px;
  padding-left: 0;
}

.toc li {
  position: relative;
  display: block;
}

/* 一行 = 标记列 + 文字列 */
.toc__item > a {
  display: flex;
  align-items: baseline;
  gap: 4px;
  padding: 5px 8px 5px 26px;
  border-radius: 8px;
  color: var(--muted-2);
  text-decoration: none;
  line-height: 1.45;
  transition: color 160ms var(--ease), background-color 160ms var(--ease);
}

.toc__item > a:hover {
  background: rgba(255, 255, 255, 0.5);
  color: var(--fg);
}

[data-surface="paper"] .toc__item > a:hover {
  background: var(--sunken);
}

.toc__item > a.is-current {
  color: var(--fg);
  font-weight: 600;
  background: rgba(255, 255, 255, 0.66);
  box-shadow: inset 2px 0 0 var(--seal);
}

[data-surface="paper"] .toc__item > a.is-current {
  background: var(--sunken);
}

[data-theme="dark"] .toc__item > a.is-current {
  background: rgba(255, 255, 255, 0.14);
}

[data-theme="dark"][data-surface="paper"] .toc__item > a.is-current {
  background: #2b3142;
}

/* 左侧标记：有子级是箭头，没有是圆点 */
.toc__arrow {
  position: absolute;
  left: 2px;
  top: 5px;
  width: 20px;
  height: 20px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 6px;
  background: none;
  color: var(--muted);
  cursor: pointer;
  transition: color 160ms var(--ease);
}

.toc__arrow:hover {
  color: var(--fg);
}

.toc__arrow > span {
  width: 0;
  height: 0;
  border-left: 5px solid currentColor;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  transform: rotate(90deg);
  transition: transform 180ms var(--ease);
}

.toc__arrow[aria-expanded="false"] > span {
  transform: rotate(0deg);
}

.toc__dot {
  position: absolute;
  left: 9px;
  top: 12px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--line-strong);
}

.toc li.is-collapsed > ol {
  display: none;
}

/* 层级缩进 */
.toc__item--l3 > a { padding-left: 38px; }
.toc__item--l3 > .toc__arrow { left: 14px; }
.toc__item--l3 > .toc__dot { left: 21px; }

.toc__item--l4 > a { padding-left: 50px; font-size: 0.96em; }
.toc__item--l4 > .toc__arrow { left: 26px; }
.toc__item--l4 > .toc__dot { left: 33px; }

.toc__item--l5 > a,
.toc__item--l6 > a { padding-left: 62px; font-size: 0.93em; opacity: 0.88; }
.toc__item--l5 > .toc__arrow,
.toc__item--l6 > .toc__arrow { left: 38px; }
.toc__item--l5 > .toc__dot,
.toc__item--l6 > .toc__dot { left: 45px; }

/* 右边缘的 ‹ 提示：宽屏与窄屏同一个 */
.toc-edge {
  position: fixed;
  right: 0;
  top: 50%;
  z-index: 52;
  width: 30px;
  height: 64px;
  padding: 0;
  transform: translateY(-50%);
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-right: 0;
  border-radius: 14px 0 0 14px;
  background: rgba(255, 255, 255, 0.52);
  -webkit-backdrop-filter: blur(16px) saturate(170%);
  backdrop-filter: blur(16px) saturate(170%);
  box-shadow: var(--lg-specular), -6px 0 18px -12px rgba(31, 38, 60, 0.5);
  color: var(--muted);
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  transition: opacity 200ms var(--ease), transform 200ms var(--spring);
}

[data-surface="paper"] .toc-edge {
  background: var(--pp-paper);
  border-color: var(--pp-line);
}

.toc-edge:hover {
  transform: translateY(-50%) translateX(-3px);
  color: var(--fg);
}

html.toc-open .toc-edge {
  opacity: 0;
  pointer-events: none;
}

/* 右侧空白：点一下就唤出目录（只在收起时存在） */
.toc-catch {
  position: fixed;
  top: calc(var(--nav-h) + 8px);
  right: 0;
  bottom: 0;
  width: max(150px, calc((100vw - var(--measure) - 2 * var(--pad)) / 2 - 6px));
  z-index: 45;
  cursor: pointer;
}

html.toc-open .toc-catch {
  display: none;
}

/* 宽屏：目录打开时把文章往左推，收起时居中 */
@media (min-width: 1181px) {
  html.toc-open .article-layout {
    padding-right: calc(16rem + 30px);
  }

  html.toc-open .article-top {
    padding-right: calc(16rem + 30px);
  }
}

/* 窄屏：目录变成贴右的抽屉，不改文章位置 */
@media (max-width: 1180px) {
  .toc-panel {
    top: calc(var(--nav-h) + 10px);
    right: 8px;
    width: min(19rem, 82vw);
    max-height: calc(100dvh - var(--nav-h) - 26px);
  }

  .toc-catch {
    display: none;
  }
}

/* ══════════════════════════ 18. 列表页 / 标签 / 归档 / 分页 ══════════════════════════ */

.page-head {
  padding: 26px 4px 20px;
  max-width: 58rem;
  margin-inline: auto;
}

.page-title {
  font-family: var(--display);
  font-size: clamp(1.6rem, 1.2rem + 1.4vw, 2.1rem);
  letter-spacing: -0.02em;
}

.page-lede {
  margin-top: 8px;
  font-size: 0.88rem;
  color: var(--muted-2);
  line-height: 1.7;
  max-width: 40rem;
}

.page-note {
  margin-top: 8px;
  font-size: 0.76rem;
  color: var(--muted);
  font-family: var(--mono);
}

[data-page="posts"] .card,
[data-page="tags"] .card,
[data-page="archives"] .card,
[data-page="gallery"] .shots {
  max-width: 58rem;
  margin-inline: auto;
}

.search-row {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 14px;
}

.search {
  position: relative;
  flex: 1;
  display: block;
}

.search input {
  width: 100%;
  padding: 11px 40px 11px 15px;
  border-radius: 999px;
  border: 1px solid var(--line);
  /* 不再用接近纯白的高亮底，改成和卡片同族的浅一档 */
  background: rgba(255, 255, 255, 0.34);
  color: var(--fg);
  font: inherit;
  font-size: 0.85rem;
  transition: border-color 180ms var(--ease), background-color 180ms var(--ease),
    box-shadow 180ms var(--ease);
}

[data-surface="paper"] .search input {
  background: var(--pp-paper-2);
}

[data-theme="dark"] .search input {
  background: rgba(255, 255, 255, 0.06);
  border-color: rgba(255, 255, 255, 0.14);
}

.search input::placeholder {
  color: var(--muted);
}

.search:hover input {
  background: rgba(255, 255, 255, 0.46);
  border-color: var(--line-strong);
}

[data-theme="dark"] .search:hover input {
  background: rgba(255, 255, 255, 0.1);
  border-color: rgba(255, 255, 255, 0.22);
}

.search input:focus {
  outline: none;
  border-color: var(--brand);
  background: rgba(255, 255, 255, 0.56);
  box-shadow: 0 0 0 3px rgba(91, 124, 250, 0.16);
}

[data-theme="dark"] .search input:focus {
  background: rgba(255, 255, 255, 0.12);
  border-color: var(--brand);
  box-shadow: 0 0 0 3px rgba(142, 163, 255, 0.18);
}

.search__ico {
  position: absolute;
  right: 15px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 0.9rem;
  opacity: 0.55;
  pointer-events: none;
}

.search-hint {
  font-size: 0.76rem;
  color: var(--muted);
  font-family: var(--mono);
  white-space: nowrap;
}

.tagcloud--filter {
  margin-bottom: 10px;
}

.empty {
  padding: 28px 6px;
  text-align: center;
  font-size: 0.86rem;
  color: var(--muted-2);
}

.tag-rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
  gap: 10px;
}

.tag-row a {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  align-items: baseline;
  gap: 4px 10px;
  padding: 14px 16px;
  border-radius: 14px;
  text-decoration: none;
  font-size: 0.9rem;
  background: rgba(255, 255, 255, 0.32);
  border: 1px solid rgba(255, 255, 255, 0.5);
  transition: border-color 160ms var(--ease), transform 160ms var(--ease);
}

[data-surface="paper"] .tag-row a {
  background: var(--sunken);
  border-color: var(--pp-line);
}

.tag-row a:hover {
  border-color: var(--brand);
  transform: translateY(-2px);
}

.tag-row__name {
  font-family: var(--mono);
  color: var(--fg-soft);
  font-size: 0.94rem;
}

.tag-row__count {
  font-size: 0.72rem;
  color: var(--muted);
}

.tag-row__bar {
  grid-column: 1 / -1;
  display: block;
  height: 3px;
  margin-top: 8px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.07);
  overflow: hidden;
}

.tag-row__bar i {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2) 60%, var(--brand-3));
}

.year + .year {
  margin-top: 30px;
}

.year__title {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--display);
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.year__title small {
  font-family: var(--mono);
  font-size: 0.7rem;
  font-weight: 400;
  color: var(--muted);
}

.year__list {
  display: grid;
  gap: 2px;
}

.year__list li {
  display: grid;
  grid-template-columns: 4rem minmax(0, 1fr) auto;
  gap: 12px;
  align-items: baseline;
  padding: 8px 6px;
  border-radius: 8px;
  font-size: 0.88rem;
  transition: background-color 160ms var(--ease);
}

.year__list time {
  font-family: var(--mono);
  font-size: 0.74rem;
  color: var(--muted);
}

.year__list a {
  text-decoration: none;
  color: var(--fg-soft);
  line-height: 1.5;
}

.year__list a:hover {
  color: var(--brand);
}

.year__list span {
  font-size: 0.72rem;
  color: var(--muted);
  white-space: nowrap;
}

/* 分页器 */
.pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
  font-size: 0.82rem;
}

.pager ol {
  display: flex;
  align-items: center;
  gap: 4px;
}

.pager__num {
  display: grid;
  place-items: center;
  min-width: 32px;
  height: 32px;
  padding: 0 6px;
  border-radius: 10px;
  text-decoration: none;
  color: var(--fg-soft);
  border: 1px solid transparent;
  transition: background-color 160ms var(--ease), border-color 160ms var(--ease);
}

.pager__num:hover {
  border-color: var(--brand);
  color: var(--brand);
}

.pager__num.is-current {
  background: rgba(255, 255, 255, 0.7);
  border-color: rgba(255, 255, 255, 0.8);
  font-weight: 700;
  color: var(--fg);
}

[data-surface="paper"] .pager__num.is-current {
  background: var(--pp-paper);
  border-color: var(--pp-line);
}

.pager__gap {
  color: var(--muted);
  padding: 0 2px;
}

.pager__step {
  color: var(--brand);
  text-decoration: none;
  padding: 6px 8px;
  border-radius: 8px;
}

.pager__step.is-off {
  color: var(--muted);
  opacity: 0.6;
}

/* ══════════════════════════ 19. 相册页 + 灯箱 ══════════════════════════ */

.shots {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--cols, 180px), 1fr));
  gap: 12px;
  margin-bottom: 40px;
}

.shot {
  position: relative;
  display: block;
  border-radius: 14px;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: var(--sunken);
  border: 1px solid rgba(255, 255, 255, 0.5);
  box-shadow: var(--lg-specular), 0 10px 26px -18px rgba(31, 38, 60, 0.45);
  transition: transform 200ms var(--ease), box-shadow 200ms var(--ease);
}

[data-surface="paper"] .shot {
  border-color: var(--pp-line);
  box-shadow: none;
}

.shot img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 500ms var(--ease);
}

.shot__cap {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 18px 12px 9px;
  font-size: 0.76rem;
  color: #fff;
  background: linear-gradient(0deg, rgba(10, 8, 20, 0.6), transparent);
}

.shot:hover,
.shot:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 18px 36px -20px rgba(31, 38, 60, 0.55);
}

.shot:hover img {
  transform: scale(1.03);
}

/* 灯箱（DOM 由 gallery.js 建） */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 200;
  display: grid;
  grid-template-rows: minmax(0, 1fr) auto;
  opacity: 0;
  transition: opacity 200ms var(--ease);
}

.lightbox.is-open {
  opacity: 1;
}

.lightbox__scrim {
  position: absolute;
  inset: 0;
  background: rgba(10, 9, 18, 0.78);
  -webkit-backdrop-filter: blur(18px) saturate(140%);
  backdrop-filter: blur(18px) saturate(140%);
}

.lightbox__img {
  position: relative;
  z-index: 1;
  align-self: center;
  justify-self: center;
  max-width: min(92vw, 1400px);
  max-height: calc(100dvh - 190px);
  width: auto;
  height: auto;
  object-fit: contain;
  border-radius: 8px;
  box-shadow: 0 30px 80px -30px rgba(0, 0, 0, 0.8);
}

.lightbox__close,
.lightbox__nav,
.lightbox__toggle {
  position: absolute;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.28);
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  font-size: 1.1rem;
  cursor: pointer;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background-color 160ms var(--ease), opacity 160ms var(--ease);
}

.lightbox__close {
  top: 18px;
  right: 18px;
}

.lightbox__prev {
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__next {
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
}

.lightbox__toggle {
  display: none;
  bottom: 96px;
  right: 18px;
  font-size: 0.95rem;
}

.lightbox__close:hover,
.lightbox__nav:hover,
.lightbox__toggle:hover {
  background: rgba(255, 255, 255, 0.26);
}

.lightbox__nav:disabled {
  opacity: 0.32;
  cursor: default;
}

.lightbox__info {
  position: relative;
  z-index: 2;
  padding: 16px clamp(20px, 5vw, 56px) 22px;
  color: #fff;
  background: linear-gradient(0deg, rgba(10, 9, 18, 0.9), rgba(10, 9, 18, 0.55));
  display: grid;
  gap: 4px;
}

.lightbox__title {
  font-family: var(--display);
  font-size: 1.1rem;
}

.lightbox__desc {
  font-size: 0.86rem;
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
  max-width: 60rem;
}

.lightbox__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 4px;
}

.lightbox__pill {
  font-size: 0.72rem;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-variant-numeric: tabular-nums;
}

.lightbox__count {
  position: absolute;
  right: clamp(20px, 5vw, 56px);
  top: 18px;
  font-family: var(--mono);
  font-size: 0.76rem;
  color: rgba(255, 255, 255, 0.7);
}

/* ══════════════════════════ 20. 关于 / 友链 / 依赖表 / 页脚 ══════════════════════════ */

.relies {
  margin-top: 2.4em;
}

.relies h2 {
  font-family: var(--display);
  font-size: 1.32rem;
  padding-bottom: 0.3em;
  border-bottom: 1px solid var(--line);
  margin-bottom: 0.7em;
}

.relies > p {
  font-size: 0.88rem;
  color: var(--muted-2);
  margin-bottom: 1em;
}

.friend-block {
  margin: 0 0 2em;
}

.friend-block h2 {
  font-family: var(--display);
  font-size: 1.1rem;
  margin-bottom: 12px;
}

.friend-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(230px, 1fr));
  gap: 10px;
}

.friend {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 12px 14px;
  border-radius: 14px;
  text-decoration: none;
  background: rgba(0, 0, 0, 0.035);
  border: 1px solid var(--line);
  position: relative;
  transition: transform 200ms var(--ease), border-color 200ms var(--ease);
}

[data-theme="dark"] .friend {
  background: rgba(255, 255, 255, 0.05);
}

.friend:hover {
  transform: translateY(-2px);
  border-color: var(--brand);
}

.friend img {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  object-fit: cover;
  border: 1px solid var(--line);
}

.friend__body {
  display: grid;
  gap: 2px;
}

.friend__body strong {
  font-size: 0.9rem;
}

.friend__body span {
  font-size: 0.76rem;
  color: var(--muted-2);
  line-height: 1.5;
}

.friend__badge {
  position: absolute;
  top: 8px;
  right: 10px;
  font-size: 0.62rem;
  font-family: var(--mono);
  color: var(--muted);
}

.friend-rules {
  margin-top: 1.2em;
}

.foot {
  padding: 12px var(--gutter) 48px;
}

.foot__inner {
  max-width: 58rem;
  margin: 0 auto;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.4);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 22px;
  font-size: 0.78rem;
  color: var(--muted-2);
}

[data-surface="paper"] .foot__inner {
  border-top-color: var(--pp-line);
}

.foot__brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.foot__links {
  display: flex;
  gap: 14px;
  margin-left: auto;
}

.foot__links a {
  text-decoration: none;
  font-family: var(--mono);
  font-size: 0.74rem;
}

.foot__links a:hover {
  color: var(--brand);
}

.foot__note {
  flex: 1 0 100%;
  font-size: 0.7rem;
  opacity: 0.8;
}

/* 404 */
.lost__code {
  font-family: var(--display);
  font-size: clamp(3.4rem, 12vw, 6rem);
  font-weight: 800;
  line-height: 1;
  letter-spacing: -0.04em;
  background: linear-gradient(120deg, var(--brand), var(--brand-2) 55%, var(--brand-3));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  margin-bottom: 10px;
}

.lost__actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 22px;
}

.lost__meta {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-top: 26px;
  font-size: 0.76rem;
  color: var(--muted);
  font-family: var(--mono);
}

/* ══════════════════════════ 21. 图章（D） ══════════════════════════ */

/* 站点图章：青蓝色芯片图标（原来是红色方块 + 白圈） */
.seal {
  display: inline-flex;
  flex: none;
  width: 1rem;
  height: 1rem;
  color: #2aa3c8;
  vertical-align: -0.14em;
  pointer-events: none;
}

.seal svg {
  width: 100%;
  height: 100%;
  display: block;
}

[data-theme="dark"] .seal {
  color: #56c8e8;
}

/* ══════════════════════════ 22. 鼠标特效（E） ══════════════════════════ */

.cursor-glow {
  position: fixed;
  left: 0;
  top: 0;
  width: 340px;
  height: 340px;
  margin: -170px 0 0 -170px;
  border-radius: 50%;
  background: radial-gradient(circle, rgba(255, 226, 140, 0.24), rgba(255, 150, 90, 0.14) 42%, transparent 68%);
  opacity: 0;
  z-index: 9999;
  pointer-events: none;
  will-change: transform;
  transition: opacity 420ms var(--ease);
}

[data-theme="dark"] .cursor-glow {
  background: radial-gradient(circle, rgba(139, 108, 247, 0.26), rgba(255, 122, 184, 0.12) 42%, transparent 68%);
}

html.has-cursor .cursor-glow {
  opacity: 1;
}

.cursor-ripple {
  position: fixed;
  left: 0;
  top: 0;
  width: 14px;
  height: 14px;
  border-radius: 50%;
  border: 1px solid rgba(255, 240, 200, 0.9);
  background: rgba(255, 220, 140, 0.16);
  z-index: 9999;
  pointer-events: none;
  animation: ripple 460ms var(--ease) forwards;
}

/* 粒子彩蛋：一次性，不持续 */
.particles {
  position: fixed;
  left: 0;
  top: 0;
  width: 0;
  height: 0;
  z-index: 9998;
  pointer-events: none;
}

.particle {
  position: absolute;
  width: 7px;
  height: 7px;
  margin: -3.5px 0 0 -3.5px;
  border-radius: 50%;
  background: var(--seal);
  box-shadow: 0 0 10px 2px rgba(255, 190, 120, 0.75), 0 0 22px 6px rgba(255, 140, 90, 0.35);
  opacity: 0;
  animation: burst 620ms cubic-bezier(0.16, 0.8, 0.3, 1) forwards;
  animation-delay: var(--d, 0ms);
}

.particle--alt {
  background: var(--brand-3);
  box-shadow: 0 0 10px 2px rgba(255, 170, 220, 0.7), 0 0 22px 6px rgba(255, 120, 190, 0.3);
}

@media (hover: none) {
  .cursor-glow,
  .cursor-ripple {
    display: none;
  }
}

/* ══════════════════════════ 23. 动效 ══════════════════════════ */

@keyframes grow-x {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}

@keyframes float-up {
  0% { transform: translate3d(0, 0, 0); opacity: 0; }
  12% { opacity: 0.85; }
  80% { opacity: 0.5; }
  100% { transform: translate3d(3vmax, -118vh, 0); opacity: 0; }
}

@keyframes twinkle {
  0%, 100% { opacity: 0.15; transform: scale(0.85); }
  50% { opacity: 0.9; transform: scale(1.15); }
}

@keyframes blink {
  0%, 49% { opacity: 1; }
  50%, 100% { opacity: 0; }
}

@keyframes stamp {
  0% { transform: scale(1.6) rotate(-12deg); opacity: 0; }
  55% { transform: scale(0.94) rotate(-8deg); opacity: 1; }
  75% { transform: scale(1.04) rotate(-5deg); }
  100% { transform: scale(1) rotate(-4deg); opacity: 1; }
}

@keyframes rise {
  from { opacity: 0; transform: translate3d(0, 12px, 0); }
  to { opacity: 1; transform: none; }
}

@keyframes panel-in {
  from { opacity: 0; transform: translate3d(0, -8px, 0) scale(0.98); }
  to { opacity: 1; transform: none; }
}

@keyframes ripple {
  from { transform: scale(0.4); opacity: 0.85; }
  to { transform: scale(9); opacity: 0; }
}

@keyframes burst {
  0% {
    transform: translate3d(0, 0, 0) scale(1);
    opacity: 0;
  }
  12% { opacity: 1; }
  100% {
    transform: translate3d(var(--tx), var(--ty), 0) scale(0.25);
    opacity: 0;
  }
}

@media (prefers-reduced-motion: no-preference) {
  .bubble--a { animation: float-up 46s linear 2s infinite; }
  .bubble--b { animation: float-up 62s linear 12s infinite; }
  .bubble--c { animation: float-up 54s linear 24s infinite; }
  .glint--a { animation: twinkle 6s ease-in-out 1.2s infinite; }
  .glint--b { animation: twinkle 9s ease-in-out 3.4s infinite; }

  .brand .seal,
  .hero__eyebrow .seal,
  .kicker .seal {
    animation: stamp 280ms var(--spring) both;
  }

  .year__title .seal,
  .article__sign .seal,
  .sig__by .seal {
    animation: stamp 280ms var(--spring) 120ms both;
  }

  .brand__sub::after {
    animation: blink 1s steps(1) infinite;
  }

  .hero__title {
    animation: rise 500ms var(--ease) both;
  }

  .hero__lede {
    animation: rise 620ms var(--ease) 60ms both;
  }

  .nav-toggle:checked ~ .nav-panel {
    animation: panel-in 240ms var(--ease) both;
  }

  @supports (animation-timeline: view()) {
    .reveal {
      animation: rise 400ms var(--ease) both;
      animation-timeline: view();
      animation-range: entry 2% entry 26%;
    }
  }
}

@media (hover: hover) {
  .card--featured:hover {
    transform: translateY(-2px);
    box-shadow: var(--lg-specular), var(--lg-shadow-lift);
  }

  .card--featured:hover .featured__media img {
    transform: scale(1.04);
  }

  /* 悬停：只做很轻的底色 + 左侧竖条，保持在暗字可见的亮度区间 */
  .post-item:hover {
    background: rgba(28, 34, 52, 0.05);
    box-shadow: inset 0 0 0 1px rgba(28, 34, 52, 0.06);
    transform: translateX(2px);
  }

  [data-theme="dark"] .post-item:hover {
    background: rgba(255, 255, 255, 0.07);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.1);
  }

  [data-surface="paper"] .post-item:hover {
    background: rgba(28, 24, 16, 0.045);
    box-shadow: inset 0 0 0 1px rgba(28, 24, 16, 0.06);
  }

  [data-theme="dark"][data-surface="paper"] .post-item:hover {
    background: rgba(255, 255, 255, 0.06);
    box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.08);
  }

  .post-item:hover::before {
    opacity: 0.9;
  }

  .teaser:hover img {
    transform: scale(1.05);
  }

  .social:hover {
    transform: translateY(-2px);
  }

  .tag:hover {
    transform: translateY(-1px);
  }

  .postnav__card:hover {
    transform: translateY(-2px);
  }

  .year__list li:hover {
    background: rgba(255, 255, 255, 0.34);
  }

  [data-surface="paper"] .year__list li:hover {
    background: rgba(0, 0, 0, 0.035);
  }

  .card--proj:hover {
    transform: translateY(-3px);
  }
}

/* ══════════════════════════ 24. 降级 ══════════════════════════ */

/* 不支持 backdrop-filter：材质退化为近实色，几何与内容不变 */
@supports not ((backdrop-filter: blur(4px)) or (-webkit-backdrop-filter: blur(4px))) {
  [data-surface="glass"] .window__sheen {
    background-color: rgba(255, 255, 255, 0.72);
  }

  [data-theme="dark"][data-surface="glass"] .window__sheen {
    background-color: rgba(32, 36, 54, 0.86);
  }
}

@media (prefers-reduced-transparency: reduce) {
  .field {
    display: none;
  }

  [data-surface="glass"] .window__backdrop {
    opacity: 0;
  }

  [data-surface="glass"] .window__sheen {
    background-color: rgba(252, 251, 248, 0.94);
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }

  [data-theme="dark"][data-surface="glass"] .window__sheen {
    background-color: #222636;
  }

  .toc-panel,
  .toc-edge,
  .lightbox__scrim {
    -webkit-backdrop-filter: none;
    backdrop-filter: none;
  }
}

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

  .particles {
    display: none;
  }
}

@media (prefers-contrast: more) {
  .card__lede,
  .prose,
  .article__lede,
  .pi-sum {
    color: var(--fg);
  }

  [data-surface="glass"] .window {
    border-color: var(--line-strong);
  }
}

/* ══════════════════════════ 25. 断点（520 / 860 / 1180） ══════════════════════════ */

@media (max-width: 1180px) {
  .article-layout {
    grid-template-columns: minmax(0, calc(var(--measure) + 2 * var(--pad)));
    gap: 0;
  }

  .article-top {
    max-width: calc(var(--measure) + 2 * var(--pad));
  }

}

@media (max-width: 860px) {
  .layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .col-side {
    grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  }

  .col-side .card--profile,
  .col-side .card--signature {
    grid-column: 1 / -1;
  }

  .nav-links {
    display: none;
  }

  .burger {
    display: grid;
  }

  .nav-toggle:checked ~ .nav-panel {
    display: block;
  }

  .nav-panel {
    position: fixed;
    left: 12px;
    right: 12px;
    top: 76px;
    max-height: calc(100dvh - 96px);
    overflow: auto;
    padding: 10px;
    border-radius: var(--radius-lg);
    background: rgba(255, 255, 255, 0.34);
    -webkit-backdrop-filter: blur(30px) saturate(180%);
    backdrop-filter: blur(30px) saturate(180%);
    border: 1px solid rgba(255, 255, 255, 0.5);
    box-shadow: var(--lg-specular), var(--lg-shadow-lift);
    z-index: 2;
  }

  [data-surface="paper"] .nav-panel {
    background: rgba(253, 252, 249, 0.42);
    border-color: var(--pp-line);
  }

  [data-theme="dark"] .nav-panel {
    background: rgba(24, 28, 44, 0.42);
    border-color: rgba(255, 255, 255, 0.16);
  }

  [data-theme="dark"][data-surface="paper"] .nav-panel {
    background: rgba(27, 31, 43, 0.46);
  }

  .panel-links {
    display: grid;
    gap: 2px;
  }

  .panel-links a {
    display: flex;
    align-items: center;
    min-height: 46px;
    padding: 0 16px;
    border-radius: 14px;
    text-decoration: none;
    font-size: 0.95rem;
    color: var(--fg-soft);
  }

  .panel-links a.is-active {
    background: rgba(255, 255, 255, 0.6);
    color: var(--fg);
    font-weight: 600;
  }

  [data-surface="paper"] .panel-links a.is-active {
    background: var(--sunken);
  }

  .panel-foot {
    padding: 12px 16px 8px;
    font-size: 0.72rem;
    color: var(--muted);
    border-top: 1px solid var(--line);
    margin-top: 6px;
  }

  .nav-toggle:checked ~ .nav-scrim {
    display: block;
    position: fixed;
    inset: 0;
    z-index: 1;
    background: rgba(26, 21, 46, 0.3);
  }

  .topbar__inner .window--nav {
    z-index: 3;
  }

  /* 窄屏：正文区变成「标题 → 按钮 → 名片」的竖排，名片接在按钮下面 */
  .hero__window > .window__content {
    grid-template-rows: 1fr auto;
  }

  .hero__body {
    padding-top: clamp(56px, 12vh, 130px);
    padding-bottom: 14px;
  }

  .hero__card {
    position: static;
    align-self: end;
    width: auto;
    padding: 0;
    /* Hero 已经按窗口高度收好，名片底边直接贴着窗口底部留白 */
    margin: 0 clamp(20px, 5vw, 64px) 18px;
    text-align: left;
  }

  .hero__card > .window__content {
    justify-items: start;
    align-items: center;
    grid-template-columns: auto 1fr;
    text-align: left;
    column-gap: 12px;
    padding: 12px 16px;
  }

  .hero__card .avatar {
    width: 52px;
    height: 52px;
    margin: 0;
  }

  .hero__card .socials,
  .hero__stats {
    display: none;
  }

  .hero__id {
    margin: 0;
  }

  .hero__body {
    padding: clamp(90px, 18vh, 160px) clamp(20px, 5vw, 40px) 32px;
  }

  .card--featured > .window__content {
    grid-template-columns: 1fr;
    padding: 10px;
  }

  .featured__media {
    aspect-ratio: 16 / 9;
  }

  .article-top {
    margin: 16px 4px 12px;
  }
}

/* 窗口很矮（DevTools 停靠底部、页面被放大）时，完整名片塞不进首屏：
   收成「头像 + 名字」一条，配合上面的 bottom 兜底，保证整张都在屏幕内 */
@media (min-width: 861px) and (max-height: 340px) {
  .hero__card {
    padding: 10px 14px;
  }

  .hero__card > .window__content {
    grid-template-columns: auto minmax(0, 1fr);
    align-items: center;
    justify-items: start;
    column-gap: 10px;
    text-align: left;
  }

  .hero__card .avatar {
    width: 44px;
    height: 44px;
    margin: 0;
  }

  .hero__card .hero__stats,
  .hero__card .socials {
    display: none;
  }

  .hero__id {
    margin: 0;
  }
}

@media (max-width: 520px) {
  :root {
    --gutter: 12px;
    --pad: 20px;
    --nav-h: 60px;
  }

  .nav-search {
    padding: 0 8px;
  }

  .nav-search input {
    width: 58px;
    font-size: 0.78rem;
  }

  .nav-search:focus-within input {
    width: 116px;
  }

  .nav-search__kbd {
    display: none;
  }

  .nav-search__panel {
    top: calc(100% + 6px);
  }

  .topbar {
    padding-top: 8px;
  }

  .window--nav > .window__content {
    min-height: 50px;
    padding: 4px 6px 4px 12px;
  }

  .brand__sub {
    display: none;
  }

  .hero {
    margin-bottom: 18px;
  }

  /* 窄屏同样保持满屏：高度交给 --hh 变量，内容靠内边距收进一屏 */
  .hero__window {
    min-height: calc(var(--hh) - (var(--hh) - 460px) * var(--p));
  }

  .hero__title {
    font-size: clamp(1.75rem, 1.1rem + 5vw, 2.3rem);
  }

  .hero__lede br {
    display: none;
  }

  .hero__body {
    padding: clamp(76px, 16vh, 120px) 18px 26px;
  }

  .card > .window__content {
    padding: 16px;
  }

  .col-side {
    grid-template-columns: minmax(0, 1fr);
  }

  .post-item a {
    grid-template-columns: 3.1rem minmax(0, 1fr);
    gap: 1px 10px;
    padding: 11px 10px 12px 14px;
  }

  .pi-sum {
    -webkit-line-clamp: 1;
  }

  .article > .window__content {
    padding: 18px;
  }

  .article__cover {
    margin: -18px -18px 16px;
    aspect-ratio: 16 / 9;
  }

  .postnav {
    grid-template-columns: minmax(0, 1fr);
  }

  .card--proj-lg > .window__content {
    grid-template-columns: auto minmax(0, 1fr);
    padding: 14px;
  }

  .card--proj-lg .proj__status {
    grid-column: 2;
    justify-self: start;
  }

  .teasers {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .foot__links {
    margin-left: 0;
  }

  .shots {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px;
  }

  .lightbox__info {
    padding: 12px 18px 18px;
  }

  .lightbox__toggle {
    display: grid;
  }

  .lightbox__info:not(.is-open) .lightbox__desc,
  .lightbox__info:not(.is-open) .lightbox__meta {
    display: none;
  }

  .lightbox__img {
    max-height: calc(100dvh - 150px);
  }

}

/* 窄屏 + 矮窗口（横屏手机、窗口被压扁、页面放大）：
   Hero 内容会把名片顶到折线以下，收紧排版的纵向占位，让整张名片仍落在首屏内 */
@media (max-width: 860px) and (max-height: 520px) {
  .hero__body {
    padding-top: calc(var(--nav-h) + 6px);
    padding-bottom: 16px;
  }

  /* 眉标在这么矮的首屏里只会被导航压住，直接让位给标题和名片 */
  .hero__eyebrow {
    display: none;
  }

  .hero__title {
    margin: 6px 0 10px;
    font-size: clamp(1.45rem, 1rem + 4vw, 2.05rem);
  }

  .hero__lede {
    line-height: 1.6;
  }

  .hero__actions {
    margin-top: 12px;
  }
}

@media (max-width: 860px) and (max-height: 420px) {
  /* 再矮就只留标题、按钮和名片 */
  .hero__lede {
    display: none;
  }
}

/* 360px 兜底 */
@media (max-width: 380px) {
  .hero__title {
    font-size: 1.6rem;
  }

  .brand__name {
    font-size: 0.95rem;
  }

  .prose pre {
    font-size: 0.78rem;
  }

  .shots {
    grid-template-columns: minmax(0, 1fr);
  }
}

/* 打印：去掉所有材质，只留字 */
@media print {
  .wallpaper,
  .field,
  .topbar,
  .foot,
  .article-top,
  .toc-panel,
  .toc-edge,
  .toc-catch,
  .postnav,
  .related,
  .cursor-glow,
  .particles {
    display: none !important;
  }

  .window {
    border: 0;
    box-shadow: none;
  }

  .window__backdrop,
  .window__sheen {
    display: none;
  }

  body {
    color: #000;
    background: #fff;
  }
}
