/* ============================================================
   星屑手帖 · 设计系统
   配色直接取自参考图：纸面 #FFF6EA / 蜜桃 #F6A27E / 暖褐墨 #5A4242
   / 米驼 #DEC6BA / 灰蓝面板 #D2D2D2
   ============================================================ */

/* ---------- 1. 重置 ---------- */
*,
*::before,
*::after { box-sizing: border-box; }

html {
  -webkit-text-size-adjust: 100%;
  scroll-behavior: smooth;
  scroll-padding-top: 96px;
  /* 全局兜底：任何意外的横向溢出都不允许出现。
     用 clip 而不是 hidden —— clip 不创建滚动容器，不会破坏 position: sticky。 */
  overflow-x: clip;
}

body {
  margin: 0;
  font-family: var(--font-body);
  font-size: var(--fs-base);
  line-height: var(--lh-base);
  color: var(--ink);
  background: var(--paper);
  overflow-x: hidden;
  min-height: 100vh;
  text-rendering: optimizeLegibility;
  -webkit-font-smoothing: antialiased;
}

img, svg, video { max-width: 100%; height: auto; display: block; }
/* 作者样式里的 display 会盖过 UA 的 [hidden]，这里强制兜住 */
[hidden] { display: none !important; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
ul, ol { margin: 0; padding: 0; list-style: none; }
h1, h2, h3, h4, h5, h6, p, figure, blockquote, dl, dd { margin: 0; }
input, textarea, select { font: inherit; color: inherit; }
:focus-visible {
  outline: 2px dashed var(--accent-text);
  outline-offset: 3px;
  border-radius: 4px;
}
::selection { background: var(--accent-soft); color: var(--ink-strong); }

/* ---------- 2. 设计变量 ---------- */
:root {
  /* 纸与墨 */
  --paper: #FFF7EC;
  --paper-deep: #FBEEDE;
  --card: #FFFDF9;
  --card-2: #FDF6EE;
  --ink-strong: #3E3130;
  --ink: #4A3B38;
  --ink-2: #6E5B54;
  --ink-3: #9A857B;
  --line: rgba(90, 66, 66, 0.14);
  --line-strong: rgba(90, 66, 66, 0.28);
  --grid: rgba(214, 190, 170, 0.5);
  --panel: #D3D5DA;
  --panel-2: #C6C9D0;
  --tan: #DEC6BA;
  --shadow-sm: 0 2px 6px rgba(140, 108, 92, 0.10);
  --shadow: 0 10px 24px -12px rgba(130, 98, 82, 0.35), 0 2px 6px rgba(140, 108, 92, 0.10);
  --shadow-lg: 0 26px 60px -26px rgba(126, 92, 76, 0.45), 0 4px 12px rgba(140, 108, 92, 0.12);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.8);

  /* 字体 */
  --font-display: 'Playfair Display', 'Noto Serif SC', Georgia, 'Songti SC', 'SimSun', serif;
  --font-hand: 'Yomogi', 'Noto Serif SC', 'Kaiti SC', cursive, serif;
  --font-body: -apple-system, BlinkMacSystemFont, 'Segoe UI Variable Text', 'Segoe UI',
    'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Noto Sans SC', sans-serif;
  --font-mono: 'JetBrains Mono', ui-monospace, SFMono-Regular, Menlo, Consolas, 'Courier New', monospace;

  /* 字号与行高 */
  --fs-base: 16.5px;
  --lh-base: 1.85;
  --fs-sm: 0.86rem;
  --fs-xs: 0.76rem;
  --fs-lg: 1.12rem;
  --fs-h1: clamp(2.1rem, 5.4vw, 3.5rem);
  --fs-h2: clamp(1.5rem, 3vw, 2.05rem);
  --fs-h3: clamp(1.2rem, 2.1vw, 1.45rem);

  /* 版心与节奏 */
  --wrap: 1140px;
  --wrap-narrow: 760px;
  --gap: 26px;
  --radius-sm: 10px;
  --radius: 18px;
  --radius-lg: 26px;
  --hdr-h: 74px;
}

/* 主题色（4 套，取自参考图） */
:root,
[data-accent='peach'] {
  --accent: #F6A27E;
  --accent-deep: #D9724A;
  --accent-text: #B85632;
  --accent-soft: #FBD9C7;
  --accent-tint: #FDF0E7;
  --accent-contrast: #4A3B38;
}
[data-accent='coral'] {
  --accent: #EE8A72;
  --accent-deep: #CF6046;
  --accent-text: #AE4B33;
  --accent-soft: #F9D2C8;
  --accent-tint: #FCEFEA;
  --accent-contrast: #4A3B38;
}
[data-accent='apricot'] {
  --accent: #E9B27C;
  --accent-deep: #C68A45;
  --accent-text: #A26D2E;
  --accent-soft: #F6E2C8;
  --accent-tint: #FCF4E7;
  --accent-contrast: #4A3B38;
}
[data-accent='lilac'] {
  --accent: #B79FD4;
  --accent-deep: #8F71BC;
  --accent-text: #77589F;
  --accent-soft: #E4D9F2;
  --accent-tint: #F4EFFA;
  --accent-contrast: #3E3350;
}

/* 深色模式：把暖褐纸面翻成夜色，但保留蜜桃糖色 */
[data-theme='dark'] {
  --paper: #221B19;
  --paper-deep: #1B1514;
  --card: #2C2422;
  --card-2: #332A27;
  --ink-strong: #FBF1E6;
  --ink: #F0E2D6;
  --ink-2: #CDBBAF;
  --ink-3: #9E8B80;
  --line: rgba(255, 240, 226, 0.13);
  --line-strong: rgba(255, 240, 226, 0.26);
  --grid: rgba(255, 240, 226, 0.055);
  --panel: #3A3339;
  --panel-2: #453D43;
  --tan: #6B5348;
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, 0.3);
  --shadow: 0 12px 28px -14px rgba(0, 0, 0, 0.7);
  --shadow-lg: 0 30px 70px -30px rgba(0, 0, 0, 0.85);
  --shadow-inset: inset 0 1px 0 rgba(255, 255, 255, 0.06);
  --accent-text: #F8B999;
}
[data-theme='dark'][data-accent='coral'] { --accent-text: #F5A48E; }
[data-theme='dark'][data-accent='apricot'] { --accent-text: #F0C795; }
[data-theme='dark'][data-accent='lilac'] { --accent-text: #CDB8E6; }
[data-theme='dark'] .bg-paper { opacity: 0.5; }
[data-theme='dark'] .post-card-cover img,
[data-theme='dark'] .gallery-item img { filter: saturate(0.92) brightness(0.92); }

/* 阅读密度 */
[data-density='compact'] { --lh-base: 1.7; --gap: 20px; }

/* ---------- 3. 背景装饰（论文纸网格 + 蜜桃色块） ---------- */
.bg-paper {
  position: fixed;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  overflow: hidden; /* 装饰色块永远不允许制造横向滚动 */
  background-image:
    linear-gradient(to right, var(--grid) 1px, transparent 1px),
    linear-gradient(to bottom, var(--grid) 1px, transparent 1px);
  background-size: 28px 28px;
  background-position: center top;
}
.bg-paper::after {
  content: '';
  position: absolute;
  inset: 0;
  background: radial-gradient(120% 80% at 50% -10%, transparent 40%, var(--paper) 100%);
  opacity: 0.85;
}
.bg-blob {
  position: absolute;
  border-radius: 50%;
  filter: blur(0.5px);
  opacity: 0.5;
}
.bg-blob-1 { width: 34vw; height: 34vw; top: -10vw; right: -8vw; background: var(--accent-soft); }
.bg-blob-2 { width: 20vw; height: 20vw; top: 42vh; left: -9vw; background: var(--accent-tint); }
.bg-blob-3 { width: 26vw; height: 26vw; bottom: -8vw; right: 12vw; background: var(--accent-soft); opacity: 0.32; }

/* ---------- 4. 通用布局 ---------- */
.wrap {
  width: 100%;
  max-width: var(--wrap);
  margin-inline: auto;
  padding-inline: clamp(18px, 4vw, 34px);
}
.site-main { display: block; padding-bottom: 80px; }
.section { margin-block: clamp(52px, 8vw, 88px); }
.grid { display: grid; gap: var(--gap); }
.grid-2 { grid-template-columns: repeat(auto-fit, minmax(300px, 1fr)); }
.grid-3 { grid-template-columns: repeat(auto-fill, minmax(290px, 1fr)); }
.grid-auto { grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); }
.stack > * + * { margin-top: 1.1rem; }
.center { text-align: center; }

.skip-link {
  position: fixed;
  top: -60px;
  left: 16px;
  z-index: 200;
  padding: 10px 16px;
  background: var(--accent);
  color: var(--accent-contrast);
  border-radius: 0 0 var(--radius-sm) var(--radius-sm);
  transition: top 0.2s;
}
.skip-link:focus { top: 0; }

/* ---------- 5. 页头 ---------- */
.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: color-mix(in srgb, var(--paper) 82%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  -webkit-backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid transparent;
  transition: border-color 0.25s, background 0.25s, box-shadow 0.25s;
}
.site-header.is-stuck {
  border-bottom-color: var(--line);
  box-shadow: 0 8px 24px -20px rgba(126, 92, 76, 0.6);
}
.hdr-inner {
  min-height: var(--hdr-h);
  display: flex;
  align-items: center;
  gap: 18px;
}
.brand { display: flex; align-items: center; gap: 12px; flex: 0 1 auto; min-width: 0; }
.brand-avatar {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 2px solid var(--card);
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}
.brand:hover .brand-avatar { transform: rotate(-8deg) scale(1.06); }
.brand-text { display: flex; flex-direction: column; line-height: 1.15; min-width: 0; }
.brand-title {
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 1.22rem;
  letter-spacing: 0.04em;
  color: var(--ink-strong);
  /* 站名很长时允许收缩并省略，而不是把页头撑破 */
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.brand-short { display: none; }
.brand-en {
  font-family: var(--font-hand);
  font-size: 0.72rem;
  color: var(--accent-text);
  letter-spacing: 0.06em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.nav { margin-left: auto; }
.nav-list { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; }
.nav-link {
  display: inline-block;
  padding: 8px 12px;
  border-radius: 999px;
  font-size: 0.95rem;
  color: var(--ink-2);
  position: relative;
  transition: color 0.2s, background 0.2s;
  white-space: nowrap;
}
.nav-link:hover { color: var(--accent-text); background: var(--accent-tint); }
.nav-link.is-active { color: var(--accent-contrast); background: var(--accent); font-weight: 600; }
.nav-link.is-active::after {
  content: '';
  position: absolute;
  inset: auto 12px 4px;
  height: 2px;
  background: var(--accent-contrast);
  opacity: 0.35;
  border-radius: 2px;
}
.nav-foot { display: none; }
.hdr-actions { display: flex; align-items: center; gap: 6px; flex: none; }
/* 站名比较长时（英文名）在中等屏幕上压缩导航，避免换行把页头撑高 */
@media (max-width: 1140px) {
  .brand-title { font-size: 1.02rem; letter-spacing: 0.01em; }
  .brand-avatar { width: 40px; height: 40px; }
  .nav-link { padding: 7px 9px; font-size: 0.9rem; }
  .icon-btn { width: 36px; height: 36px; }
}
.icon-btn {
  width: 40px;
  height: 40px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: var(--ink-2);
  border: 1px solid transparent;
  transition: background 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.icon-btn:hover { background: var(--card); color: var(--accent-text); border-color: var(--line); transform: translateY(-2px); }
.icon-btn .icon { width: 21px; height: 21px; }
.icon-btn .icon-close { display: none; }
.icon-sm { width: 17px; height: 17px; }
.accent-dot {
  width: 18px;
  height: 18px;
  border-radius: 50%;
  background: var(--accent);
  border: 2px solid var(--card);
  box-shadow: 0 0 0 1px var(--line);
  display: block;
}
.i-moon { display: none; }
[data-theme='dark'] .i-sun { display: none; }
[data-theme='dark'] .i-moon { display: block; }
.nav-toggle { display: none; }

/* ---------- 6. 缎带（参考图右上角标签） ---------- */
.ribbon {
  position: fixed;
  top: calc(var(--hdr-h) - 6px);
  right: clamp(14px, 4vw, 56px);
  z-index: 70;
  width: 46px;
  pointer-events: none;
  filter: drop-shadow(0 8px 14px rgba(126, 92, 76, 0.22));
}
.ribbon-inner {
  display: block;
  writing-mode: vertical-rl;
  text-orientation: mixed;
  font-family: var(--font-display);
  font-style: italic;
  font-size: 1.02rem;
  letter-spacing: 0.22em;
  color: var(--ink-2);
  background: var(--card);
  border: 1px solid var(--line);
  border-top: 0;
  padding: 16px 0 14px;
  text-align: center;
  clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 88%, 0 100%);
  -webkit-clip-path: polygon(0 0, 100% 0, 100% 100%, 50% 88%, 0 100%);
}

/* ---------- 7. 回顶部 / 进度条 / 提示 ---------- */
.reading-progress {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  z-index: 100;
  background: transparent;
}
.reading-progress span {
  display: block;
  height: 100%;
  width: 0;
  background: linear-gradient(90deg, var(--accent), var(--accent-deep));
  transition: width 0.1s linear;
}
.totop {
  position: fixed;
  right: clamp(16px, 3vw, 34px);
  bottom: 28px;
  z-index: 85;
  width: 46px;
  height: 46px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  color: var(--ink-2);
  transition: transform 0.25s, color 0.25s, opacity 0.25s;
}
.totop:hover { transform: translateY(-4px); color: var(--accent-text); }
.totop .icon { width: 20px; height: 20px; }
.toast {
  position: fixed;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%) translateY(10px);
  z-index: 150;
  padding: 11px 22px;
  border-radius: 999px;
  background: var(--ink-strong);
  color: var(--paper);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transition: opacity 0.25s, transform 0.25s;
}
.toast.is-in { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 8. 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 12px 24px;
  border-radius: 999px;
  font-size: 0.96rem;
  font-weight: 600;
  letter-spacing: 0.01em;
  border: 1px solid transparent;
  transition: transform 0.22s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.22s, background 0.22s, color 0.22s;
  will-change: transform;
}
.btn:hover { transform: translateY(-2px); }
.btn:active { transform: translateY(0); }
.btn-primary {
  background: var(--accent);
  color: var(--accent-contrast);
  box-shadow: var(--shadow);
}
.btn-primary:hover { background: var(--accent-deep); color: #FFFDF9; }
.btn-ghost {
  background: var(--card);
  color: var(--ink);
  border-color: var(--line-strong);
  box-shadow: var(--shadow-sm);
}
.btn-ghost:hover { border-color: var(--accent); color: var(--accent-text); }
.btn-small { padding: 8px 16px; font-size: var(--fs-sm); }
.btn-block { width: 100%; }
.btn[disabled] { opacity: 0.55; pointer-events: none; }

/* ---------- 9. 首页首屏 ---------- */
.hero {
  position: relative;
  padding-block: clamp(40px, 7vw, 78px) clamp(20px, 4vw, 40px);
}
.hero-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(0, 0.92fr);
  gap: clamp(24px, 4vw, 54px);
  align-items: center;
}
.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  font-family: var(--font-hand);
  font-size: 0.82rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-text);
  padding: 5px 14px;
  border: 1px dashed var(--accent);
  border-radius: 999px;
  background: var(--accent-tint);
}
.hero-title {
  font-family: var(--font-display);
  font-size: var(--fs-h1);
  line-height: 1.06;
  letter-spacing: 0.01em;
  color: var(--ink-strong);
  margin-block: 18px 8px;
  font-weight: 700;
}
.hero-title .line { display: block; }
.hero-title .line:last-child {
  color: var(--accent-text);
  font-style: italic;
  padding-left: 0.12em;
}
.hero-title .line:last-child::after {
  content: '';
  display: block;
  width: 4.2em;
  height: 10px;
  margin-top: 6px;
  background: var(--accent-soft);
  border-radius: 999px;
  clip-path: polygon(0 40%, 100% 0, 100% 60%, 0 100%);
}
.hero-lead {
  max-width: 34em;
  color: var(--ink-2);
  font-size: var(--fs-lg);
  margin-bottom: 26px;
}
.hero-actions { display: flex; flex-wrap: wrap; gap: 12px; align-items: center; }
.hero-stats {
  display: flex;
  gap: 26px;
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px dashed var(--line-strong);
}
.hero-stat { display: flex; flex-direction: column; }
.hero-stat-num {
  font-family: var(--font-display);
  font-size: 1.7rem;
  font-weight: 700;
  color: var(--accent-text);
  line-height: 1.1;
}
.hero-stat-label { font-size: var(--fs-xs); color: var(--ink-3); letter-spacing: 0.1em; }

/* 首屏拼贴画（对应参考图的人物位置） */
.hero-art {
  position: relative;
  aspect-ratio: 4 / 5;
  border-radius: var(--radius-lg);
  isolation: isolate;
}
.hero-art-panel {
  position: absolute;
  inset: 8% 4% 12% 6%;
  background: var(--panel);
  border-radius: var(--radius-lg);
  transform: rotate(-5deg);
  box-shadow: var(--shadow-lg);
  opacity: 0.92;
}
.hero-art-card {
  position: absolute;
  inset: 0 8% 6% 0;
  border-radius: var(--radius-lg);
  overflow: hidden;
  border: 6px solid var(--card);
  box-shadow: var(--shadow-lg);
  transform: rotate(2.5deg);
  background: var(--card);
}
.hero-art-card img { width: 100%; height: 100%; object-fit: cover; }
.hero-art-title {
  position: absolute;
  left: -4%;
  bottom: 11%;
  z-index: 3;
  font-family: var(--font-display);
  font-style: italic;
  font-weight: 700;
  font-size: clamp(1.9rem, 4.4vw, 3rem);
  white-space: nowrap;
  color: var(--accent);
  text-shadow: 3px 3px 0 var(--card), 6px 6px 0 rgba(126, 92, 76, 0.16);
  transform: rotate(-6deg);
  pointer-events: none;
}
.hero-art-badge {
  position: absolute;
  right: -2%;
  bottom: -2%;
  z-index: 4;
  width: 108px;
  height: 108px;
  display: grid;
  place-items: center;
  text-align: center;
  padding: 12px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  font-family: var(--font-hand);
  font-size: 0.72rem;
  line-height: 1.35;
  box-shadow: var(--shadow);
  transform: rotate(9deg);
}
.hero-art-tag {
  position: absolute;
  right: 2%;
  top: 4%;
  z-index: 4;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 6px 14px;
  font-size: var(--fs-xs);
  letter-spacing: 0.14em;
  font-family: var(--font-hand);
  color: var(--ink-2);
  box-shadow: var(--shadow-sm);
  transform: rotate(-4deg);
}
.star-deco {
  position: absolute;
  color: var(--accent);
  opacity: 0.75;
  pointer-events: none;
  animation: twinkle 4.5s ease-in-out infinite;
}
.star-deco svg { width: 100%; height: 100%; }
.star-a { width: 30px; height: 30px; top: 6%; left: 2%; }
.star-b { width: 18px; height: 18px; top: 32%; right: 6%; animation-delay: 1.2s; }
.star-c { width: 24px; height: 24px; bottom: 12%; left: 8%; animation-delay: 2.1s; }

/* ---------- 10. 区块标题 ---------- */
.section-head {
  display: flex;
  align-items: flex-end;
  gap: 16px;
  flex-wrap: wrap;
  margin-bottom: 26px;
  padding-bottom: 14px;
  position: relative;
}
.section-head::after {
  content: '';
  position: absolute;
  left: 0;
  bottom: 0;
  width: 100%;
  height: 1px;
  background: linear-gradient(90deg, var(--line-strong), transparent 70%);
}
.section-kicker {
  flex-basis: 100%;
  font-family: var(--font-hand);
  font-size: 0.78rem;
  letter-spacing: 0.26em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 4px;
}
.section-title {
  font-family: var(--font-display);
  font-size: var(--fs-h2);
  font-weight: 700;
  color: var(--ink-strong);
  line-height: 1.2;
}
.section-title::before {
  content: '✦';
  color: var(--accent);
  font-size: 0.7em;
  margin-right: 0.5em;
  vertical-align: 0.12em;
}
.section-more {
  margin-left: auto;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--card);
  transition: color 0.2s, border-color 0.2s, transform 0.2s;
}
.section-more:hover { color: var(--accent-text); border-color: var(--accent); transform: translateX(3px); }

/* ---------- 11. 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.3s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.3s, border-color 0.3s;
}
.post-card { overflow: hidden; position: relative; display: flex; flex-direction: column; }
.post-card::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  pointer-events: none;
  box-shadow: var(--shadow-inset);
}
.post-card:hover { transform: translateY(-6px) rotate(-0.5deg); box-shadow: var(--shadow-lg); border-color: var(--line-strong); }
/* 整卡可点：标题链接用伪元素铺满卡片，卡片内部的标签链接再抬到上层 */
.post-card-link { color: inherit; }
.post-card-link::after { content: ''; position: absolute; inset: 0; z-index: 1; border-radius: inherit; }
.post-card-cover { position: relative; display: block; flex: none; aspect-ratio: 3 / 2; overflow: hidden; background: var(--card-2); }
.post-card-cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 0.5s cubic-bezier(0.22, 1, 0.36, 1); }
.post-card:hover .post-card-cover img { transform: scale(1.045); }
.post-card-cat {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--card);
  border: 1px solid var(--line);
  color: var(--accent-text);
  font-size: var(--fs-xs);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}
.post-card-body { display: flex; flex-direction: column; gap: 9px; padding: 18px 20px 22px; flex: 1; }
.post-card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  letter-spacing: 0.04em;
}
.dot { width: 3px; height: 3px; border-radius: 50%; background: currentColor; opacity: 0.6; }
.post-card-title {
  font-family: var(--font-display);
  font-size: 1.28rem;
  font-weight: 700;
  line-height: 1.4;
  color: var(--ink-strong);
  transition: color 0.2s;
}
.post-card:hover .post-card-title { color: var(--accent-text); }
.post-card-summary { font-size: 0.93rem; color: var(--ink-2); line-height: 1.7; }
.post-card-tags { position: relative; z-index: 2; display: flex; flex-wrap: wrap; gap: 6px; margin-top: auto; padding-top: 6px; }
.post-card--featured { grid-column: 1 / -1; flex-direction: row; }
.post-card--featured .post-card-cover { flex: 1 1 52%; aspect-ratio: 16 / 10; }
.post-card--featured .post-card-body { flex: 1 1 48%; justify-content: center; padding: 28px 30px; }
.post-card--featured .post-card-title { font-size: clamp(1.4rem, 2.6vw, 1.9rem); }

/* 标签 */
.tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 3px 11px;
  border-radius: 999px;
  background: var(--accent-tint);
  border: 1px solid color-mix(in srgb, var(--accent) 35%, transparent);
  color: var(--accent-text);
  font-size: var(--fs-xs);
  transition: background 0.2s, color 0.2s, transform 0.2s;
}
.tag:hover { background: var(--accent); color: var(--accent-contrast); transform: translateY(-2px); }
.tag-count { opacity: 0.7; font-size: 0.9em; }
.tag-cloud { display: flex; flex-wrap: wrap; gap: 10px; }
.tag-cloud .tag { font-size: 0.9rem; padding: 7px 16px; }
.tag-pill-lg { padding: 10px 20px; font-size: 1rem; }

/* ---------- 12. 文章列表工具条 ---------- */
.list-toolbar {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
  padding: 16px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 30px;
  position: sticky;
  top: calc(var(--hdr-h) + 10px);
  z-index: 20;
}
.filter-input {
  flex: 1 1 220px;
  min-width: 0;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.filter-input:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); outline: none; }
.filter-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.filter-chip {
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  background: var(--card-2);
  transition: all 0.2s;
}
.filter-chip:hover { border-color: var(--accent); color: var(--accent-text); }
.filter-chip.is-active { background: var(--accent); color: var(--accent-contrast); border-color: transparent; font-weight: 600; }
.filter-count { font-size: var(--fs-xs); color: var(--ink-3); margin-left: auto; }

/* ---------- 13. 分页 ---------- */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-top: 42px;
}
.page-items { display: flex; gap: 6px; }
.page-item,
.page-nav {
  min-width: 40px;
  height: 40px;
  padding-inline: 14px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  transition: all 0.2s;
}
.page-item:hover,
.page-nav:hover { border-color: var(--accent); color: var(--accent-text); transform: translateY(-2px); }
.page-item.is-current { background: var(--accent); color: var(--accent-contrast); border-color: transparent; font-weight: 700; }
.page-nav.is-disabled { opacity: 0.4; pointer-events: none; }
.page-gap { color: var(--ink-3); align-self: center; }

/* ---------- 14. 文章页 ---------- */
.article-head {
  padding-block: clamp(30px, 5vw, 56px) 22px;
  max-width: var(--wrap-narrow);
  margin-inline: auto;
}
.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 16px; }
.article-title {
  font-family: var(--font-display);
  font-size: clamp(1.8rem, 4.4vw, 2.9rem);
  line-height: 1.24;
  font-weight: 700;
  color: var(--ink-strong);
  margin-bottom: 18px;
}
.article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  font-size: var(--fs-sm);
  color: var(--ink-3);
  padding-bottom: 20px;
  border-bottom: 1px dashed var(--line-strong);
}
.article-meta span { display: inline-flex; align-items: center; gap: 6px; }
.article-meta .icon { width: 16px; height: 16px; opacity: 0.8; }
.article-cover {
  max-width: var(--wrap-narrow);
  margin: 0 auto 34px;
  border-radius: var(--radius);
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}
.article-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 40px;
}
.article-layout.has-toc { grid-template-columns: minmax(0, 1fr) 248px; }
.article-main { min-width: 0; max-width: var(--wrap-narrow); margin-inline: auto; width: 100%; }

/* 正文排版 */
.prose { font-size: 1.03rem; color: var(--ink); }
.prose > * + * { margin-top: 1.25em; }
.prose h2,
.prose h3,
.prose h4 {
  font-family: var(--font-display);
  color: var(--ink-strong);
  line-height: 1.35;
  scroll-margin-top: 100px;
  position: relative;
}
.prose h2 {
  font-size: 1.6rem;
  margin-top: 2.4em;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--line);
}
.prose h2::before {
  content: '';
  position: absolute;
  left: -18px;
  top: 0.34em;
  width: 8px;
  height: 8px;
  background: var(--accent);
  transform: rotate(45deg);
  border-radius: 2px;
}
.prose h3 { font-size: 1.3rem; margin-top: 2em; }
.prose h4 { font-size: 1.1rem; margin-top: 1.7em; color: var(--ink-2); }
.heading-anchor .anchor {
  position: absolute;
  left: -1.4em;
  top: 0;
  opacity: 0;
  color: var(--accent);
  font-weight: 400;
  transition: opacity 0.2s;
}
.prose h2:hover .anchor,
.prose h3:hover .anchor,
.prose h4:hover .anchor { opacity: 0.7; }
.prose p { line-height: var(--lh-base); }
.prose a:not(.tag) {
  color: var(--accent-text);
  border-bottom: 1px solid color-mix(in srgb, var(--accent) 55%, transparent);
  transition: background 0.2s, border-color 0.2s;
}
.prose a:not(.tag):hover { background: var(--accent-tint); border-bottom-color: var(--accent-deep); }
.prose ul,
.prose ol { padding-left: 1.35em; }
.prose ul > li { list-style: none; position: relative; }
.prose ul > li::before {
  content: '✦';
  position: absolute;
  left: -1.2em;
  top: 0.06em;
  color: var(--accent);
  font-size: 0.72em;
}
.prose ol { list-style: decimal; }
.prose ol > li::marker { color: var(--accent-text); font-weight: 700; }
.prose li + li { margin-top: 0.5em; }
.prose .task-list { padding-left: 0.2em; }
.prose .task-item { display: flex; align-items: flex-start; gap: 8px; }
.prose .task-item::before { content: none; }
.task-box { width: 17px; height: 17px; margin-top: 5px; accent-color: var(--accent-deep); flex: none; }
.prose blockquote {
  padding: 16px 22px;
  border-left: 4px solid var(--accent);
  background: var(--accent-tint);
  border-radius: 0 var(--radius-sm) var(--radius-sm) 0;
  color: var(--ink-2);
  font-style: italic;
}
.prose blockquote p { margin: 0; }
.prose blockquote p + p { margin-top: 0.7em; }
.prose hr.rule {
  border: 0;
  height: 22px;
  margin-block: 2.6em;
  background: no-repeat center/70% 100%
    url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 400 22'%3E%3Cpath d='M0 11h150M250 11h150' stroke='%23DEC6BA' stroke-width='2' stroke-dasharray='6 7'/%3E%3Cpath d='M200 2l3.4 7 7 1.6-7 1.6-3.4 7-3.4-7-7-1.6 7-1.6z' fill='%23F6A27E'/%3E%3C/svg%3E");
}
.prose code {
  font-family: var(--font-mono);
  font-size: 0.88em;
  background: var(--accent-tint);
  color: var(--accent-text);
  padding: 2px 6px;
  border-radius: 5px;
  border: 1px solid color-mix(in srgb, var(--accent) 22%, transparent);
}
.prose mark { background: var(--accent-soft); color: var(--ink-strong); padding: 0 4px; border-radius: 4px; }
.prose kbd {
  font-family: var(--font-mono);
  font-size: 0.8em;
  padding: 2px 7px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  border-bottom-width: 3px;
  background: var(--card);
}
.prose img { border-radius: var(--radius-sm); }
.figure { margin-block: 1.8em; }
.figure figcaption {
  text-align: center;
  font-size: var(--fs-xs);
  color: var(--ink-3);
  margin-top: 10px;
  font-family: var(--font-hand);
  letter-spacing: 0.04em;
}
.table-wrap { overflow-x: auto; border: 1px solid var(--line); border-radius: var(--radius-sm); }
.prose table { width: 100%; border-collapse: collapse; font-size: 0.94rem; }
.prose th,
.prose td { padding: 10px 14px; border-bottom: 1px solid var(--line); }
.prose thead th { background: var(--card-2); font-weight: 700; color: var(--ink-strong); }
.prose tbody tr:last-child td { border-bottom: 0; }
.prose tbody tr:hover { background: var(--accent-tint); }

/* 代码块 */
.code-block {
  margin-block: 1.8em;
  border-radius: var(--radius-sm);
  overflow: hidden;
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  box-shadow: var(--shadow-sm);
}
.code-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
[data-theme='dark'] .code-head { background: #302827; }
.code-lang {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  letter-spacing: 0.1em;
  text-transform: uppercase;
  color: var(--ink-2);
}
.copy-btn {
  font-size: var(--fs-xs);
  padding: 4px 12px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-2);
  transition: all 0.2s;
}
.copy-btn:hover { background: var(--accent); color: var(--accent-contrast); border-color: transparent; }
.copy-btn.is-done { background: var(--accent-deep); color: #FFFDF9; }
.code-block pre {
  margin: 0;
  padding: 16px 18px;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.86rem;
  line-height: 1.7;
  color: var(--ink);
  background: var(--card);
  tab-size: 2;
}
[data-theme='dark'] .code-block pre { background: #241E1D; }
.code-block code { background: none; border: 0; padding: 0; color: inherit; font-size: inherit; }
.tok-key { color: #C1663C; font-weight: 600; }
.tok-str { color: #6F8F4B; }
.tok-com { color: var(--ink-3); font-style: italic; }
.tok-num { color: #8A6BB5; }
[data-theme='dark'] .tok-key { color: #F0A97F; }
[data-theme='dark'] .tok-str { color: #A9C98A; }
[data-theme='dark'] .tok-num { color: #C4A6E8; }

/* 提示块 */
.callout {
  margin-block: 1.8em;
  padding: 16px 20px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  border-left: 4px solid var(--accent);
  background: var(--card);
  box-shadow: var(--shadow-sm);
}
.callout-title {
  display: flex;
  align-items: center;
  gap: 8px;
  font-weight: 700;
  color: var(--ink-strong);
  margin-bottom: 8px;
  font-size: 0.96rem;
}
.callout-icon { color: var(--accent-text); }
.callout-body > :first-child { margin-top: 0; }
.callout-note { background: var(--accent-tint); }
.callout-tip { border-left-color: #8FAE6B; background: color-mix(in srgb, #8FAE6B 12%, var(--card)); }
.callout-tip .callout-icon { color: #6E8F4A; }
.callout-warn { border-left-color: #E0A83C; background: color-mix(in srgb, #E0A83C 13%, var(--card)); }
.callout-warn .callout-icon { color: #B5842A; }
.callout-danger { border-left-color: #D96C5A; background: color-mix(in srgb, #D96C5A 12%, var(--card)); }
.callout-danger .callout-icon { color: #C2503C; }
.callout-quote { border-left-color: var(--panel-2); background: var(--card-2); }

/* 目录 */
.toc {
  position: sticky;
  top: calc(var(--hdr-h) + 24px);
  align-self: start;
  font-size: var(--fs-sm);
  max-height: calc(100vh - var(--hdr-h) - 60px);
  overflow-y: auto;
  padding: 18px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.toc-title {
  font-family: var(--font-hand);
  font-size: 0.76rem;
  letter-spacing: 0.24em;
  text-transform: uppercase;
  color: var(--accent-text);
  margin-bottom: 12px;
}
.toc-list a {
  display: block;
  padding: 5px 10px;
  border-left: 2px solid var(--line);
  color: var(--ink-2);
  line-height: 1.5;
  transition: all 0.2s;
}
.toc-list a:hover { color: var(--accent-text); border-left-color: var(--accent); background: var(--accent-tint); }
.toc-list a.is-active { color: var(--accent-text); border-left-color: var(--accent-deep); font-weight: 600; background: var(--accent-tint); }
.toc-list .toc-3 a { padding-left: 22px; font-size: 0.92em; }
.toc-list .toc-4 a { padding-left: 34px; font-size: 0.88em; opacity: 0.85; }
.toc-back { display: none; }

/* 文章底部 */
.article-foot {
  max-width: var(--wrap-narrow);
  margin: 46px auto 0;
  display: flex;
  flex-direction: column;
  gap: 22px;
}
.article-actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.action-btn {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 9px 18px;
  border-radius: 999px;
  border: 1px solid var(--line-strong);
  background: var(--card);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  box-shadow: var(--shadow-sm);
  transition: all 0.2s;
}
.action-btn:hover { border-color: var(--accent); color: var(--accent-text); transform: translateY(-2px); }
.action-btn.is-liked { background: var(--accent); color: var(--accent-contrast); border-color: transparent; }
.action-btn .icon { width: 17px; height: 17px; }
.action-btn.is-liked .icon { fill: currentColor; }
.action-count { font-variant-numeric: tabular-nums; }
.article-neighbors { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 14px; }
.neighbor {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 16px 18px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: var(--card);
  box-shadow: var(--shadow-sm);
  transition: all 0.25s;
}
.neighbor:hover { transform: translateY(-3px); border-color: var(--accent); box-shadow: var(--shadow); }
.neighbor-label { font-size: var(--fs-xs); color: var(--ink-3); letter-spacing: 0.14em; }
.neighbor-title { font-family: var(--font-display); font-weight: 700; color: var(--ink-strong); }
.neighbor-next { text-align: right; }

/* 评论区 */
.comments {
  max-width: var(--wrap-narrow);
  margin: 40px auto 0;
  padding: 24px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.comments-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 18px; }
.comments-title { font-family: var(--font-display); font-size: 1.25rem; font-weight: 700; }
.comments-title span { color: var(--accent-text); font-size: 0.8em; }
.comment-list { display: flex; flex-direction: column; gap: 14px; }
.comment {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: var(--radius-sm);
  background: var(--card-2);
  border: 1px solid var(--line);
  animation: fadeUp 0.4s both;
}
.comment-avatar {
  width: 38px;
  height: 38px;
  flex: none;
  border-radius: 50%;
  display: grid;
  place-items: center;
  background: var(--accent-soft);
  color: var(--ink-strong);
  font-weight: 700;
  font-family: var(--font-display);
}
.comment-body { min-width: 0; flex: 1; }
.comment-meta { display: flex; gap: 10px; align-items: baseline; font-size: var(--fs-xs); color: var(--ink-3); margin-bottom: 4px; }
.comment-name { font-weight: 700; color: var(--ink); font-size: var(--fs-sm); }
.comment-text { white-space: pre-wrap; word-break: break-word; font-size: 0.95rem; }
.comment-form { display: grid; gap: 10px; margin-top: 20px; }
.comment-row { display: grid; grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); gap: 10px; }
.field {
  width: 100%;
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--card-2);
  transition: border-color 0.2s, box-shadow 0.2s;
}
.field:focus { border-color: var(--accent); box-shadow: 0 0 0 4px var(--accent-tint); outline: none; }
textarea.field { min-height: 108px; resize: vertical; }
.comment-note { font-size: var(--fs-xs); color: var(--ink-3); }
.form-msg { font-size: var(--fs-sm); padding: 8px 12px; border-radius: var(--radius-sm); display: none; }
.form-msg.is-error { display: block; background: color-mix(in srgb, #D96C5A 15%, var(--card)); color: #B5482F; }
.form-msg.is-ok { display: block; background: color-mix(in srgb, #8FAE6B 18%, var(--card)); color: #5E7C3C; }

/* ---------- 15. 说说时间线 ---------- */
.timeline { position: relative; padding-left: 34px; }
.timeline::before {
  content: '';
  position: absolute;
  left: 9px;
  top: 6px;
  bottom: 6px;
  width: 2px;
  background: repeating-linear-gradient(to bottom, var(--line-strong) 0 6px, transparent 6px 12px);
}
.moment { position: relative; animation: fadeUp 0.5s both; }
.moment + .moment { margin-top: 22px; }
.moment-dot {
  position: absolute;
  left: -30px;
  top: 20px;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--accent);
  border: 3px solid var(--paper);
  box-shadow: 0 0 0 1px var(--line-strong);
}
.moment-card {
  padding: 18px 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s, box-shadow 0.25s;
}
.moment-card:hover { transform: translateX(4px); box-shadow: var(--shadow); }
.moment-head { display: flex; align-items: center; gap: 10px; font-size: var(--fs-xs); color: var(--ink-3); margin-bottom: 8px; }
.moment-rel { color: var(--accent-text); }
.moment-mood { margin-left: auto; font-family: var(--font-hand); font-size: 0.8rem; }
.moment-body { font-size: 0.98rem; }
.moment-body p + p { margin-top: 0.7em; }
.moment-imgs { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; margin-top: 12px; }
.moment-img img { border-radius: var(--radius-sm); border: 1px solid var(--line); aspect-ratio: 4/3; object-fit: cover; width: 100%; transition: transform 0.3s; }
.moment-img:hover img { transform: scale(1.03); }
.moment-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }

/* ---------- 16. 作品 / 友链 / 相册 ---------- */
.project-card { display: flex; flex-direction: column; gap: 12px; padding: 22px; }
.project-top { display: flex; gap: 14px; align-items: flex-start; }
.project-emoji {
  width: 46px;
  height: 46px;
  flex: none;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--accent-tint);
  border: 1px solid color-mix(in srgb, var(--accent) 30%, transparent);
  font-size: 1.35rem;
}
.project-name { font-family: var(--font-display); font-size: 1.16rem; font-weight: 700; color: var(--ink-strong); }
.project-tagline { font-size: var(--fs-sm); color: var(--accent-text); font-family: var(--font-hand); }
.project-desc { font-size: 0.94rem; color: var(--ink-2); flex: 1; }
.project-stack { display: flex; flex-wrap: wrap; gap: 6px; }
.project-stack li {
  font-size: var(--fs-xs);
  padding: 3px 10px;
  border-radius: 999px;
  background: var(--card-2);
  border: 1px solid var(--line);
  color: var(--ink-2);
}
.project-links { display: flex; align-items: center; gap: 10px; margin-top: 4px; }
.project-status { margin-left: auto; font-size: var(--fs-xs); color: var(--ink-3); font-family: var(--font-hand); }

.link-card { display: flex; gap: 14px; padding: 16px; align-items: center; }
.link-card:hover { transform: translateY(-4px); box-shadow: var(--shadow); border-color: var(--line-strong); }
.link-avatar img,
.link-fallback {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  border: 2px solid var(--card);
  box-shadow: var(--shadow-sm);
  object-fit: cover;
}
.link-fallback { display: grid; place-items: center; background: var(--accent-soft); font-family: var(--font-display); font-size: 1.5rem; font-weight: 700; }
.link-body { min-width: 0; }
.link-name { display: block; font-weight: 700; color: var(--ink-strong); }
.link-desc { display: block; font-size: var(--fs-sm); color: var(--ink-3); margin-top: 2px; }

.gallery-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 18px; }
.gallery-item {
  margin: 0;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 10px 10px 12px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1), box-shadow 0.35s;
}
.gallery-item:nth-child(3n) { transform: rotate(-0.7deg); }
.gallery-item:nth-child(4n) { transform: rotate(0.9deg); }
.gallery-item:hover { transform: translateY(-6px) rotate(0deg); box-shadow: var(--shadow-lg); }
.gallery-item img { border-radius: var(--radius-sm); aspect-ratio: 4/3; object-fit: cover; width: 100%; }
.gallery-item figcaption {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  padding: 10px 4px 0;
  font-size: var(--fs-sm);
}
.gallery-caption { font-family: var(--font-hand); color: var(--ink-2); }
.gallery-item time { font-size: var(--fs-xs); color: var(--ink-3); }
.gallery-item:nth-child(5n) { grid-row: span 1; }

/* 灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 5vh 5vw;
  background: color-mix(in srgb, var(--ink-strong) 82%, transparent);
  backdrop-filter: blur(6px);
  animation: fadeIn 0.25s both;
}
.lightbox-img {
  max-width: 100%;
  max-height: 74vh;
  border-radius: var(--radius);
  border: 6px solid var(--card);
  box-shadow: var(--shadow-lg);
  animation: popIn 0.3s both;
}
.lightbox-caption { color: var(--paper); font-family: var(--font-hand); font-size: 0.9rem; }
.lightbox-close {
  position: absolute;
  top: 22px;
  right: 24px;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: var(--card);
  display: grid;
  place-items: center;
  color: var(--ink);
  box-shadow: var(--shadow);
}
.lightbox-close .icon { width: 20px; height: 20px; }

/* ---------- 17. 搜索浮层 ---------- */
.search-overlay {
  position: fixed;
  inset: 0;
  z-index: 170;
  display: flex;
  justify-content: center;
  padding: 12vh 18px 18px;
  background: color-mix(in srgb, var(--ink-strong) 45%, transparent);
  backdrop-filter: blur(5px);
  animation: fadeIn 0.2s both;
}
.search-panel {
  width: 100%;
  max-width: 620px;
  max-height: 68vh;
  display: flex;
  flex-direction: column;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  overflow: hidden;
  animation: popIn 0.28s both;
}
.search-bar { display: flex; align-items: center; gap: 12px; padding: 16px 18px; border-bottom: 1px solid var(--line); }
.search-bar .icon { width: 20px; height: 20px; color: var(--accent-text); flex: none; }
.search-input { flex: 1; border: 0; background: none; font-size: 1.05rem; outline: none; }
.search-esc {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid var(--line-strong);
  color: var(--ink-3);
}
.search-hint { padding: 10px 18px; font-size: var(--fs-xs); color: var(--ink-3); border-bottom: 1px solid var(--line); }
.search-results { list-style: none; overflow-y: auto; padding: 8px; }
.search-result a {
  display: block;
  padding: 11px 14px;
  border-radius: var(--radius-sm);
  transition: background 0.15s;
}
.search-result.is-active a,
.search-result a:hover { background: var(--accent-tint); }
.search-result-title { font-weight: 700; color: var(--ink-strong); display: flex; gap: 8px; align-items: center; }
.search-result-title .badge {
  font-size: var(--fs-xs);
  font-weight: 400;
  padding: 1px 8px;
  border-radius: 999px;
  background: var(--accent-soft);
  color: var(--accent-text);
}
.search-result-path { font-size: var(--fs-xs); color: var(--ink-3); }
.search-result-snippet { font-size: var(--fs-sm); color: var(--ink-2); margin-top: 2px; }
.search-result-snippet mark { background: var(--accent-soft); color: var(--ink-strong); border-radius: 3px; padding: 0 2px; }
.search-empty { padding: 26px 18px; text-align: center; color: var(--ink-3); font-size: var(--fs-sm); }

/* ---------- 18. 主题色气泡 ---------- */
.accent-pop {
  position: fixed;
  right: clamp(16px, 3vw, 34px);
  top: calc(var(--hdr-h) + 10px);
  z-index: 95;
  width: 230px;
  padding: 16px;
  background: var(--card);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  animation: popIn 0.22s both;
}
.accent-pop-title {
  font-family: var(--font-hand);
  font-size: 0.72rem;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 10px;
}
.accent-options { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-bottom: 16px; }
.accent-option {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  transition: all 0.2s;
}
.accent-option span { width: 16px; height: 16px; border-radius: 50%; background: var(--swatch); flex: none; }
.accent-option:hover { border-color: var(--accent); }
.accent-option.is-active { background: var(--accent-tint); border-color: var(--accent); color: var(--ink-strong); font-weight: 600; }
.density-options { display: flex; gap: 8px; }
.density-option {
  flex: 1;
  padding: 7px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  transition: all 0.2s;
}
.density-option.is-active { background: var(--accent-tint); border-color: var(--accent); color: var(--ink-strong); font-weight: 600; }

/* ---------- 19. 页脚 ---------- */
.site-footer {
  margin-top: 40px;
  padding-block: 44px 30px;
  background: var(--card-2);
  border-top: 1px solid var(--line);
  position: relative;
}
.site-footer::before {
  content: '';
  position: absolute;
  inset: 0 0 auto;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--accent), transparent);
  opacity: 0.5;
}
.footer-inner { display: grid; gap: 30px; }
.footer-brand { display: flex; align-items: center; gap: 14px; }
.footer-brand img { width: 54px; height: 54px; border-radius: 50%; border: 2px solid var(--card); box-shadow: var(--shadow-sm); }
.footer-title { font-family: var(--font-display); font-weight: 700; font-size: 1.15rem; color: var(--ink-strong); }
.footer-slogan { font-family: var(--font-hand); font-size: 0.86rem; color: var(--accent-text); }
.footer-nav { display: grid; grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 24px; }
.footer-col { display: flex; flex-direction: column; gap: 7px; font-size: var(--fs-sm); }
.footer-col a { color: var(--ink-2); transition: color 0.2s, transform 0.2s; width: fit-content; }
.footer-col a:hover { color: var(--accent-text); transform: translateX(3px); }
.footer-col-title {
  font-size: var(--fs-xs);
  letter-spacing: 0.2em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-bottom: 2px;
}
.footer-stat { color: var(--ink-2); }
.footer-social { display: flex; flex-wrap: wrap; gap: 10px; }
.social-link {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 7px 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--card);
  font-size: var(--fs-sm);
  color: var(--ink-2);
  transition: all 0.2s;
}
.social-link:hover { border-color: var(--accent); color: var(--accent-text); transform: translateY(-2px); }
.footer-bottom {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  justify-content: space-between;
  padding-top: 22px;
  border-top: 1px dashed var(--line-strong);
  font-size: var(--fs-xs);
  color: var(--ink-3);
}
.footer-made a { color: var(--accent-text); }

/* ---------- 20. 页面通用块 ---------- */
.page-head { padding-block: clamp(30px, 5vw, 54px) 26px; }
.page-title {
  font-family: var(--font-display);
  font-size: clamp(1.9rem, 4.6vw, 2.8rem);
  font-weight: 700;
  color: var(--ink-strong);
  line-height: 1.2;
}
.page-title em { color: var(--accent-text); font-style: italic; }
.page-desc { color: var(--ink-2); max-width: 46em; margin-top: 12px; }
.breadcrumbs { display: flex; gap: 8px; align-items: center; font-size: var(--fs-xs); color: var(--ink-3); margin-bottom: 12px; }
.breadcrumbs a:hover { color: var(--accent-text); }
.crumb-sep { opacity: 0.5; }
.panel {
  padding: clamp(20px, 3vw, 30px);
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.panel-tan { background: var(--accent-tint); border-color: color-mix(in srgb, var(--accent) 30%, transparent); }
.panel-title { font-family: var(--font-display); font-size: 1.2rem; font-weight: 700; margin-bottom: 10px; color: var(--ink-strong); }
.empty-state { text-align: center; padding: 60px 20px; color: var(--ink-3); }
.empty-main { font-family: var(--font-display); font-size: 1.3rem; color: var(--ink-2); }
.empty-hint { font-size: var(--fs-sm); margin-top: 6px; }
.note-hand { font-family: var(--font-hand); color: var(--accent-text); font-size: 0.9rem; }
.sticker {
  display: inline-grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 50%;
  background: var(--accent);
  color: var(--accent-contrast);
  font-family: var(--font-hand);
  font-size: 0.72rem;
  text-align: center;
  padding: 10px;
  transform: rotate(-8deg);
  box-shadow: var(--shadow);
}
.archive-year { display: flex; align-items: center; gap: 14px; margin: 34px 0 16px; }
.archive-year-num {
  font-family: var(--font-display);
  font-size: 2rem;
  font-weight: 700;
  font-style: italic;
  color: var(--accent);
}
.archive-year::after { content: ''; flex: 1; height: 1px; background: var(--line-strong); }
.archive-list { display: flex; flex-direction: column; gap: 2px; }
.archive-item { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px 14px; padding: 10px 14px; border-radius: var(--radius-sm); transition: background 0.2s; }
.archive-item:hover { background: var(--accent-tint); }
/* min-width:0 + anywhere：长网址之类的无空格文本不会把布局撑破 */
.archive-date {
  font-family: var(--font-mono);
  font-size: var(--fs-xs);
  color: var(--ink-3);
  flex: 0 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
}
.archive-title { font-weight: 600; color: var(--ink); }
.archive-item:hover .archive-title { color: var(--accent-text); }
.archive-dots { flex: 1 1 24px; min-width: 24px; border-bottom: 1px dashed var(--line); transform: translateY(-4px); }

/* ---------- 21. 动画 ---------- */
@keyframes fadeUp { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes popIn { from { opacity: 0; transform: scale(0.96) translateY(8px); } to { opacity: 1; transform: none; } }
@keyframes twinkle { 0%, 100% { opacity: 0.35; transform: scale(0.9) rotate(0); } 50% { opacity: 0.9; transform: scale(1.1) rotate(20deg); } }
@keyframes floaty { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-8px); } }

.reveal { opacity: 0; }
.reveal.is-in { animation: fadeUp 0.65s cubic-bezier(0.22, 1, 0.36, 1) both; animation-delay: calc(var(--i, 0) * 60ms); }
[data-anim='off'] .reveal { opacity: 1; animation: none; }

/* ---------- 22. 响应式 ---------- */
@media (max-width: 1040px) {
  .article-layout.has-toc { grid-template-columns: minmax(0, 1fr); }
  .toc {
    position: static;
    max-height: none;
    margin-bottom: 26px;
    order: -1;
  }
  .toc-list { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); }
}
@media (max-width: 900px) {
  .hero-grid { grid-template-columns: minmax(0, 1fr); }
  /* 注意：这里的子元素全是绝对定位，只写 max-width + auto 会让宽度塌成 0，
     必须显式给出 width，否则主视觉标题会溢出屏幕。 */
  .hero-art { width: min(100%, 420px); margin-inline: auto; aspect-ratio: 4 / 3.4; }
  .hero-art-title { font-size: 2.2rem; }
  .ribbon { display: none; }
}
@media (max-width: 900px) {
  :root { --hdr-h: 64px; }
  .nav-toggle { display: inline-grid; }
  .nav {
    position: fixed;
    inset: var(--hdr-h) 0 auto 0;
    background: var(--card);
    border-bottom: 1px solid var(--line);
    box-shadow: var(--shadow-lg);
    padding: 18px clamp(18px, 4vw, 34px) 24px;
    transform: translateY(-120%);
    transition: transform 0.35s cubic-bezier(0.22, 1, 0.36, 1);
    max-height: calc(100vh - var(--hdr-h));
    overflow-y: auto;
    border-radius: 0 0 var(--radius-lg) var(--radius-lg);
  }
  .nav.is-open { transform: translateY(0); }
  .nav-list { flex-direction: column; align-items: stretch; gap: 4px; }
  .nav-link { padding: 12px 16px; border-radius: var(--radius-sm); font-size: 1rem; }
  .nav-link.is-active::after { display: none; }
  .nav-foot { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 18px; padding-top: 16px; border-top: 1px dashed var(--line-strong); }
  body.is-nav-open { overflow: hidden; }
  .hdr-inner { gap: 10px; }
  .brand-en { display: none; }
  .post-card--featured { flex-direction: column; }
  .post-card--featured .post-card-cover { aspect-ratio: 3/2; }
  .post-card--featured .post-card-body { padding: 20px; }
  .list-toolbar { position: static; }
  .moments-timeline { padding-left: 26px; }
  .hero-stats { gap: 18px; }
  .space-hand { display: none; }
}
@media (max-width: 560px) {
  /* 站名太长时只留头像 + 缩写，避免页头被挤爆 */
  .brand-full { display: none; }
  .brand-short { display: block; }
  .brand-en { display: none; }
  .brand { gap: 9px; }
}
@media (max-width: 520px) {
  :root { --fs-base: 16px; --gap: 18px; }
  .hdr-actions { gap: 2px; }
  .icon-btn { width: 36px; height: 36px; }
  .article-meta { gap: 6px 14px; }
  .footer-bottom { flex-direction: column; }
  .accent-pop { left: 16px; right: 16px; width: auto; }
  .hero-art-badge { width: 84px; height: 84px; font-size: 0.62rem; }
  .archive-item { flex-wrap: wrap; gap: 6px; }
  .archive-dots { display: none; }
}

/* ---------- 23. 可访问性与打印 ---------- */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 0.001ms !important; animation-iteration-count: 1 !important; transition-duration: 0.001ms !important; scroll-behavior: auto !important; }
  .reveal { opacity: 1; }
}
@media print {
  .site-header, .site-footer, .totop, .ribbon, .bg-paper, .comments, .article-actions, .toc, .search-overlay, .reading-progress { display: none !important; }
  body { background: #fff; font-size: 12pt; }
  .prose a::after { content: ' (' attr(href) ')'; font-size: 0.8em; color: #666; }
  .article-layout { grid-template-columns: 1fr; }
}
.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0 0 0 0);
  white-space: nowrap;
  border: 0;
}

/* ---------- 23b. 在线发布的文章 ---------- */
.tag-online {
  background: var(--accent);
  border-color: transparent;
  color: var(--accent-contrast);
  font-weight: 700;
}
.runtime-note {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 10px 16px;
  border-radius: 999px;
  border: 1px dashed var(--accent);
  background: var(--accent-tint);
  color: var(--ink-2);
  font-size: var(--fs-sm);
  width: fit-content;
}
.runtime-note strong { color: var(--accent-text); }
[data-runtime-posts]:not([hidden]) { margin-bottom: var(--gap); }

/* ---------- 24. 留言板 ---------- */.guestbook-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 26px;
  align-items: start;
}
.guestbook-layout .comments { margin: 0; max-width: none; }
.guestbook-side { display: flex; flex-direction: column; gap: 18px; position: sticky; top: calc(var(--hdr-h) + 20px); }
.rule-list { display: flex; flex-direction: column; gap: 9px; font-size: 0.94rem; color: var(--ink-2); }
.rule-list li { position: relative; padding-left: 1.15em; }
.rule-list li::before { content: '✦'; position: absolute; left: 0; color: var(--accent); font-size: 0.75em; top: 0.35em; }
.rule-list[style*='decimal'] li { padding-left: 0; }
.rule-list[style*='decimal'] li::before { content: none; }
@media (max-width: 900px) {
  .guestbook-layout { grid-template-columns: minmax(0, 1fr); }
  .guestbook-side { position: static; }
}

/* ---------- 25. 管理后台 ---------- */
.admin-login { max-width: 520px; }
.admin-login-row { display: flex; gap: 10px; flex-wrap: wrap; }
.admin-login-row .field { flex: 1 1 200px; min-width: 0; }
.admin-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
  padding: 12px 16px;
  margin-bottom: 20px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}
.admin-badge {
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: var(--accent-contrast);
  font-size: var(--fs-xs);
  font-weight: 700;
}
.admin-bar-note { margin-left: auto; font-size: var(--fs-xs); color: var(--ink-3); }
.admin-cols { display: grid; grid-template-columns: minmax(0, 1fr) 320px; gap: 24px; align-items: start; }
.admin-editor {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: clamp(16px, 2.4vw, 24px);
}
.admin-row { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.admin-field { display: flex; flex-direction: column; gap: 5px; flex: 1 1 220px; min-width: 0; }
.admin-field-sm { flex: 0 1 160px; }
.admin-label { font-size: var(--fs-xs); letter-spacing: 0.1em; color: var(--ink-3); text-transform: uppercase; }
.admin-tabs { display: flex; align-items: center; gap: 6px; margin: 16px 0 8px; border-bottom: 1px solid var(--line); }
.admin-tab {
  padding: 8px 16px;
  border-radius: var(--radius-sm) var(--radius-sm) 0 0;
  font-size: var(--fs-sm);
  color: var(--ink-2);
  border: 1px solid transparent;
  border-bottom: 0;
  transition: all 0.2s;
}
.admin-tab:hover { color: var(--accent-text); background: var(--accent-tint); }
.admin-tab.is-active { background: var(--card-2); border-color: var(--line); color: var(--ink-strong); font-weight: 600; }
.admin-count { margin-left: auto; font-size: var(--fs-xs); color: var(--ink-3); }
.admin-body { min-height: 380px; font-family: var(--font-mono); font-size: 0.9rem; line-height: 1.75; }
.admin-preview { min-height: 380px; padding: 4px 2px; }
.admin-actions { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-top: 16px; }
.admin-danger { color: #C2503C; border-color: color-mix(in srgb, #C2503C 40%, transparent); }
.admin-danger:hover { background: color-mix(in srgb, #C2503C 12%, var(--card)); border-color: #C2503C; color: #C2503C; }
.admin-side { display: flex; flex-direction: column; gap: 18px; }
.admin-post-list { display: flex; flex-direction: column; gap: 4px; max-height: 420px; overflow-y: auto; }
.admin-post {
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 9px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  transition: all 0.2s;
}
.admin-post:hover { background: var(--accent-tint); border-color: var(--line); }
.admin-post a { font-weight: 600; color: var(--ink); }
.admin-post.is-current { background: var(--accent-tint); border-color: color-mix(in srgb, var(--accent) 45%, transparent); }
.admin-post-meta { font-size: var(--fs-xs); color: var(--ink-3); }
.admin-post-actions { display: flex; gap: 8px; font-size: var(--fs-xs); }
.admin-post-actions button { color: var(--accent-text); }
.admin-post-actions button:hover { text-decoration: underline; }
.admin-help summary { cursor: pointer; font-size: var(--fs-sm); color: var(--accent-text); }
.admin-help summary:hover { text-decoration: underline; }
@media (max-width: 1020px) {
  .admin-cols { grid-template-columns: minmax(0, 1fr); }
}

