/* ============================================================
   style.css — THE FRONTEND REVIEW
   ------------------------------------------------------------
   结构：变量 → 基础 → 骨架屏 → 导航 → 首屏 → 首页模块
         → 归档 → 阅读器 → 作品/搜索/灯箱 → 页脚 → 响应式
   ============================================================ */

/* ============================================================
   1. 设计变量
   ============================================================ */
:root {
  /* 字体
     serif：思源宋体（本站自托管，见 fonts/noto-serif-sc/fonts.css）。
     本机没装、Web 字体也没加载出来时再依次降级到系统宋体，保证"纸刊"气质不丢。
     sans：UI 正文。Windows 上优先 YaHei UI（字面比老雅黑舒展），
     华为/小米设备上的 HarmonyOS Sans / MiSans 更精致，排在其前面。 */
  --font-serif: "Huiwen Ming Chaoti", "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
  --font-sans: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "HarmonyOS Sans SC", "MiSans", "Microsoft YaHei UI", "Microsoft YaHei", sans-serif;
  --font-mono: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;

  /* 色彩：纸张本白 / 墨黑 / 一点砖红 */
  --bg-color: #f8f7f3;
  --bg-rgb: 248, 247, 243;
  --text-main: #1a1817;
  --text-secondary: #4a4741;
  --text-muted: #6b6559;
  --accent: #a03e34;
  /* 压在 --accent 上的前景色。深色主题把 accent 提亮成 #e85d4a 之后，
     白字只有 3.45:1（不达 AA），必须换成深墨色才有 5.1:1。 */
  --accent-ink: #ffffff;
  --border-color: #e1dfd8;
  --hairline: rgba(26, 24, 23, 0.08);
  --card-bg: #fdfcf9;
  --dark-bg: #141310;
  --dark-text: #d8d3c7;

  /* 页脚纵深（参考"质感纵深版"）：光晕 / 水印 / 文字阶
     纸白主题下页脚仍是深色块，光晕带一点砖红的暖 */
  --footer-glow: rgba(176, 58, 46, 0.07);
  --footer-wm-c: #f0e6df;
  --footer-wm-o: 0.028;
  --footer-logo: #f7f2ec;
  --footer-muted: #9c968a;
  --footer-faint: #8a8479;
  --footer-hair: rgba(255, 255, 255, 0.08);

  --radius-sm: 4px;
  --radius-md: 8px;
  --radius-lg: 12px;
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);

  /* 统一封面占位：所有文章 / 作品在没有真实配图时都引用同一张灰度图。
     真正的一张图（assets/cover.svg），不再是 CSS 渐变仿的"假图"。
     后端返回 cover 字段后，data.js 里换掉 PLACEHOLDER_COVER 即可全站生效。 */
  --ph-cover: url("assets/cover.svg");

  /* 代码块：纸面上的代码页 */
  --code-bg: #f7f5ef;
  --code-bar: #f1eee6;
  --code-fg: #2b2926;
  --code-muted: #8a8479;
  --tok-string: #2f6b4f;
  --tok-keyword: #a03e34;
  --tok-number: #8a5a2b;
  --tok-fn: #3f5d7a;
  --tok-tag: #9c3b30;
  --tok-attr: #7a5c1e;

  /* 热力图浮起的染色层：浅色底已接近白，提亮只会烧成白块，
     改用半透明黑压暗成"带阴影的浮雕"；深色底才用半透明白提亮。
     系数让覆盖后的像素亮度与旧版 brightness() 基本一致 */
  --hm-tint: rgba(0, 0, 0, 0.55);
  --hm-ka: 0.18; --hm-kb: 0.42; --hm-kc: 0.16;
  --hm-glow: rgba(160, 62, 52, 0.55);

  --header-h: 72px;
  accent-color: var(--accent);
  color-scheme: light;
}

/* 字型切换：只覆盖 --font-serif，标题、正文、引用一起变。
   data-font 由 theme-boot.js 写在 <html> 上，默认「明朝」不写属性（保留汇文明朝体）。 */
html[data-font="song"] {
  --font-serif: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", Georgia, serif;
}
html[data-font="hei"] {
  --font-serif: var(--font-sans);
}

[data-theme="dark"] {
  --bg-color: #121311;
  --bg-rgb: 18, 19, 17;
  --text-main: #f2efe9;
  --text-secondary: #c9c3b6;
  --text-muted: #a8a294;
  --accent: #d95c4c;
  --accent-ink: #141310;
  --border-color: #2f2c28;
  --hairline: rgba(255, 255, 255, 0.08);
  --card-bg: #1b1b19;
  --dark-bg: #0a0a08;
  --dark-text: #a8a294;
  --hm-tint: rgba(255, 255, 255, 0.35);
  --hm-ka: 0.12; --hm-kb: 0.29; --hm-kc: 0.10;
  --hm-glow: rgba(217, 92, 76, 0.55);
  color-scheme: dark;

  /* 页脚纵深：暗色下换成珊瑚暖光，水印更淡一档 */
  --footer-glow: rgba(217, 92, 76, 0.055);
  --footer-wm-o: 0.02;

  /* 暗色下同一张图会略亮，压一层深色叠加即可，不必再准备第二张 */
  --ph-cover: url("assets/cover.svg");

  --code-bg: #171614;
  --code-bar: #1c1b18;
  --code-fg: #d8d3c7;
  --code-muted: #6f6a60;
  --tok-string: #8fbf9f;
  --tok-keyword: #e8877a;
  --tok-number: #d8a97a;
  --tok-fn: #8fb4d9;
  --tok-tag: #e8877a;
  --tok-attr: #d9c58a;
}

/* ============================================================
   1.1 配色板（data-palette）
   ------------------------------------------------------------
   主题配色文档里的两套调色板。frost 是深色、minimal 是浅色，
   都已由引导脚本同时设好 data-theme，所以这两块只覆盖色板差异；
   写在暗色块之后，同优先级下后定义者生效。
   ============================================================ */

/* 雨夜 · 蓝灰：#10141d 雨夜蓝灰底 / #333c50 暗影藏青 / #5d6b80 雾灰蓝
              / #8fb6d9 雨夜蓝 / #c3cfe0 晨雾蓝 */
[data-palette="frost"] {
  --bg-color: #10141d;
  --bg-rgb: 16, 20, 29;
  --text-main: #c3cfe0;
  --text-secondary: #8ea2bd;
  --text-muted: #7c8ba3;
  --accent: #8fb6d9;
  --accent-ink: #10141d;
  --border-color: #232a38;
  --hairline: rgba(143, 182, 217, 0.10);
  --card-bg: #161b26;
  --dark-bg: #0b0f16;
  --dark-text: #7c8ba3;
  --hm-tint: rgba(255, 255, 255, 0.35);
  --hm-ka: 0.12; --hm-kb: 0.29; --hm-kc: 0.10;
  --hm-glow: rgba(143, 182, 217, 0.55);
  color-scheme: dark;

  --code-bg: #12161f;
  --code-bar: #171c27;
  --code-fg: #c3cfe0;
  --code-muted: #5d6b80;
  --tok-string: #8fd0b8;
  --tok-keyword: #8fb6d9;
  --tok-number: #e8c89a;
  --tok-fn: #9fb8dd;
  --tok-tag: #c4a8e8;
  --tok-attr: #8fb6d9;

  /* "在播"指示灯也走冰霜蓝（热力图色阶在 .about-teaser 处单独覆盖） */
  --live-dot: #8fb6d9;

  /* 页脚纵深：冰霜蓝冷光 */
  --footer-glow: rgba(143, 182, 217, 0.09);
  --footer-wm-c: #dfe6ef;
  --footer-wm-o: 0.02;
  --footer-logo: #e3eaf2;
  --footer-muted: #8395ad;
  --footer-faint: #71829a;
  --footer-hair: rgba(190, 203, 220, 0.08);
}

/* 清冷简约：#EBEBEB 极浅灰白 / #91918F 暖中灰 / #707072 中性灰
              / #504E4F 深灰 / #313131 极深灰（无彩度，强调色就是墨本身） */
[data-palette="minimal"] {
  --bg-color: #EBEBEB;
  --bg-rgb: 235, 235, 235;
  --text-main: #313131;
  --text-secondary: #504e4f;
  /* 参考图给的是 #707072，但它在 --card-bg (#f6f6f5) 与 --bg-color (#EBEBEB)
     上只有 4.07:1，压着小字号标签（11–12.5px）会低于 WCAG AA 的 4.5:1 要求。
     压暗到 #626264 后：卡面上 5.30:1 / 页面底色 5.05:1，仍在中性灰的色阶里。 */
  --text-muted: #626264;
  --accent: #313131;
  --accent-ink: #EBEBEB;
  --border-color: #d9d9d7;
  --hairline: rgba(49, 49, 49, 0.10);
  --card-bg: #f6f6f5;
  --dark-bg: #e2e2e0;
  --dark-text: #707072;
  --hm-tint: rgba(0, 0, 0, 0.55);
  --hm-ka: 0.18; --hm-kb: 0.42; --hm-kc: 0.16;
  --hm-glow: rgba(49, 49, 49, 0.55);
  color-scheme: light;

  --code-bg: #e4e4e2;
  --code-bar: #dedede;
  --code-fg: #313131;
  --code-muted: #91918f;
  --tok-string: #50514b;
  --tok-keyword: #313131;
  --tok-number: #6b5d3f;
  --tok-fn: #46505c;
  --tok-tag: #4b4340;
  --tok-attr: #5d5344;

  /* 无彩度版热力图：灰阶三级 */
  --tz-glow: rgba(49, 49, 49, 0.25);
  --tz-grid1: rgba(49, 49, 49, 0.30);
  --tz-grid2: rgba(49, 49, 49, 0.62);
  --tz-grid3: #313131;

  /* 「在线」指示灯也用墨灰：这一套的前提就是没有彩度，
     信号绿压 4.07:1 的灰底只有 1.15:1，基本看不见。 */
  --live-dot: #626264;

  /* 页脚纵深：minimal 是浅底页脚（参考件的灰紫暮色思路）——
     墨色水印 + 中性灰光晕，噪点换 multiply */
  --footer-glow: rgba(49, 49, 49, 0.07);
  --footer-wm-c: #313131;
  --footer-wm-o: 0.035;
  --footer-logo: #221c28;
  --footer-muted: #626264;
  --footer-faint: #707072;
  --footer-hair: rgba(49, 49, 49, 0.12);
}

/* 噪点纹理在灰底上会显脏，minimal 换成更淡的一层 */
[data-palette="minimal"] body {
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.02'/%3E%3C/svg%3E");
}

/* ============================================================
   2. 基础
   ============================================================ */
* { margin: 0; padding: 0; box-sizing: border-box; }
[hidden] { display: none !important; }

/* 首屏防闪：脚本按 hash 切到目标视图之前，先藏住首页模块。
   用 visibility 而不是 display，保留占位，切换时不会二次跳动 */
html:not(.route-ready) #view-home,
html:not(.route-ready) .fullscreen-hero { visibility: hidden; }

html {
  background: var(--bg-color);
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
  scrollbar-gutter: stable;
}

body {
  font-family: var(--font-sans);
  background-color: var(--bg-color);
  /* 纸张噪点纹理 */
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)' opacity='0.04'/%3E%3C/svg%3E");
  color: var(--text-main);
  line-height: 1.6;
  /* 不加 antialiased：Windows 1x 屏上灰度抗锯齿会把细字重糊成发虚的灰线，
     让浏览器走默认的次像素渲染（ClearType），正文更黑更清晰。 */
  transition: background-color 0.4s ease, color 0.4s ease;
}

/* 弹窗打开时锁滚动（用 class，方便多个弹窗叠加时用计数器管理） */
body.no-scroll { overflow: hidden; overscroll-behavior: none; }

a { text-decoration: none; color: inherit; transition: color 0.2s; }
a:hover { color: var(--accent); }
ul, ol { list-style: none; }
img { display: block; max-width: 100%; height: auto; }

/* 所有可能出现"封面/头图"的容器：在 JS 赋值之前就先显示统一占位图，
   避免骨架期出现一块空黑；实际 cover 由 JS 用 background-image 覆盖。 */
.hero-feature,
.article-cover,
.project-hero-image,
.hero-display-cover {
  background-image: var(--ph-cover);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}

/* 长英文单词 / 无空格串（如 "Supercalifragilistic…"）在窄列里会把网格撑破：
   实测 200 字无空格标题能让文档横向溢出 939px。这里统一兜住。 */
h1, h2, h3, h4, h5, h6,
.hero-caption h2, .idx-title, .brief-title, .arc-title, .related-card h4,
.work-title, .sr-title, .ac-cat,
.friend-head strong, .as-label {
  overflow-wrap: anywhere;
  word-break: break-word;
}
/* 网格/弹性子项默认 min-width:auto，长内容会把轨道顶穿；显式归零 */
.mag-grid > *, .article-index > *, .briefs-col, .article-main,
.related-grid > *, .work-rows > *, .arc-list > li {
  min-width: 0;
}
button {
  font-family: inherit; font-size: inherit; line-height: inherit;
  color: inherit; cursor: pointer; border: none; background: none;
  -webkit-tap-highlight-color: transparent;
}
input, textarea { font-family: inherit; }

::selection { background: rgba(176, 58, 46, 0.16); }

/* 统一焦点样式：键盘可见，鼠标不显示 */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 3px; }
:focus:not(:focus-visible) { outline: none; }

/* 数字等宽，避免切换时跳动 */
.time, .filter-count, .archive-date, .reader-percent,
.work-no, .work-views, .work-plate-cap b, .archive-read, .tag-count { font-variant-numeric: tabular-nums; }

/* 仅供读屏 */
.sr-only {
  position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0 0 0 0); clip-path: inset(50%); white-space: nowrap;
}

/* 跳过导航 */
.skip-link {
  position: fixed; top: -100px; left: 16px; z-index: 10001;
  padding: 12px 20px; border-radius: 0 0 6px 6px;
  background: var(--text-main); color: var(--bg-color);
  font-weight: 700; font-size: 14px;
  transition: top 0.2s ease;
}
.skip-link:focus { top: 0; color: var(--bg-color); }

/* 通用空状态 */
.empty-hint {
  padding: 40px 20px; text-align: center;
  color: var(--text-muted); font-size: 14px;
  grid-column: 1 / -1;
}

/* ============================================================
   3. 骨架屏
   ============================================================ */
.skeleton {
  background: linear-gradient(90deg, var(--border-color) 25%, var(--card-bg) 50%, var(--border-color) 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius-sm);
}
@keyframes shimmer { 0% { background-position: 200% 0; } 100% { background-position: -200% 0; } }
.skeleton-text { height: 14px; margin-bottom: 8px; width: 100%; }
.skeleton-title { height: 20px; margin-bottom: 12px; width: 80%; }
.skeleton-cover { width: 100%; height: 200px; border-radius: var(--radius-md); }
.skeleton-row { padding: 14px 0 14px 16px; border-bottom: 1px solid var(--border-color); }

/* ============================================================
   4. 顶部导航
   ============================================================ */
.minimal-header {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--header-h);
  background: rgba(var(--bg-rgb), 0.85);
  -webkit-backdrop-filter: blur(12px);
  backdrop-filter: blur(12px);
  z-index: 1000;
  border-bottom: 1px solid var(--hairline);
  transition: background 0.3s ease;
}

.header-inner {
  max-width: 1440px; margin: 0 auto; padding: 0 40px;
  height: 100%;
  display: flex; justify-content: space-between; align-items: center;
  position: relative;
}

.brand {
  font-family: var(--font-serif);
  font-size: 22px; font-weight: 700;
  color: var(--text-main); letter-spacing: -0.02em;
}

.main-nav {
  position: absolute; left: 50%; transform: translateX(-50%);
  display: flex; gap: 36px;
}
.main-nav .site-nav-link {
  font-family: var(--font-serif);
  font-size: 15px; font-weight: 600;
  color: var(--text-secondary);
  position: relative;
  transition: color 0.2s;
}
.main-nav .site-nav-link:hover,
.main-nav .site-nav-link.active { color: var(--text-main); }
.main-nav .site-nav-link::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: -4px;
  height: 1px; background: currentColor;
  transform: scaleX(0); transform-origin: right;
  transition: transform 0.35s var(--ease-out);
}
.main-nav .site-nav-link:hover::after,
.main-nav .site-nav-link.active::after { transform: scaleX(1); transform-origin: left; }

.header-actions { display: flex; align-items: center; gap: 14px; }

.icon-btn {
  display: flex; align-items: center; justify-content: center;
  width: 32px; height: 32px; border-radius: 50%;
  font-size: 12px; font-weight: 700;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.icon-btn:hover { color: var(--text-main); }
.icon-btn svg { width: 18px; height: 18px; }

/* --- 配色选择器：三套主题的弹出面板（微缩预览 + 选中态） --- */
.palette-menu { position: relative; }
.palette-pop {
  position: absolute; top: calc(100% + 12px); right: 0;
  z-index: 9000;
  width: 300px;
  padding: 14px 12px 12px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 24px 48px -18px rgba(0, 0, 0, 0.4), 0 4px 14px -6px rgba(0, 0, 0, 0.22);
  transform-origin: top right;
  /* hidden 属性一摘掉，入场动画自动重播 */
  animation: pp-in 0.26s cubic-bezier(0.22, 1, 0.36, 1);
}
@keyframes pp-in {
  from { opacity: 0; transform: translateY(-6px) scale(0.97); }
}
.pp-head {
  display: flex; justify-content: space-between; align-items: baseline;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.3em;
  text-transform: uppercase; color: var(--text-muted);
  padding: 2px 10px 10px;
  border-bottom: 1px solid var(--hairline);
  margin-bottom: 8px;
}
.pp-head span { letter-spacing: 0.2em; opacity: 0.7; }

/* 面板标题：比分区小标题更实一点，一眼看出这是「设置」而不是某一组选项 */
.pp-title {
  font-size: 10px; letter-spacing: 0.26em; color: var(--text-main);
  padding-bottom: 12px;
}
.pp-sep {
  height: 1px; margin: 10px 2px 4px;
  background: var(--border-color); opacity: 0.75;
}
.pp-reset {
  width: 100%; margin-top: 4px; padding: 8px 0;
  border: 0; border-radius: 8px; background: transparent;
  color: var(--text-muted); font-size: 11.5px; letter-spacing: 0.04em;
  cursor: pointer; transition: color 0.2s, background 0.2s;
}
.pp-reset:hover { color: var(--accent); background: var(--hairline); }
.pp-opt {
  display: grid; grid-template-columns: 46px 1fr auto;
  align-items: center; gap: 12px;
  width: 100%; padding: 9px 10px;
  border: 0; border-radius: 10px;
  background: none; text-align: left;
  cursor: pointer; position: relative;
  transition: background-color 0.2s ease;
}
.pp-opt:hover { background: var(--hairline); }

/* 字型选择：三个按钮各自用对应字体渲染，点之前就能看出差别 */
.pp-fonts {
  display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px;
  padding: 2px 10px 12px;
}
.pp-font {
  padding: 9px 0; border: 1px solid var(--border-color); border-radius: 8px;
  background: transparent; color: var(--text-secondary);
  font-size: 13px; line-height: 1.2; cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.pp-font[data-font="ming"] { font-family: "Huiwen Ming Chaoti", "Noto Serif SC", serif; }
.pp-font[data-font="song"] { font-family: "Noto Serif SC", "Songti SC", serif; }
.pp-font[data-font="hei"] { font-family: var(--font-sans); }
.pp-font:hover { border-color: var(--text-muted); color: var(--text-main); }
.pp-font[aria-pressed="true"] {
  border-color: var(--accent); color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}
/* 阅读区：左边一行小标签，右边两格开关，比整块按钮省一半高度 */
.pp-row {
  display: grid; grid-template-columns: 30px 1fr; gap: 8px; align-items: center;
  padding: 0 10px 7px;
}
.pp-row:last-of-type { padding-bottom: 11px; }
.pp-row-label {
  font-family: var(--font-mono); font-size: 10px; letter-spacing: 0.08em;
  color: var(--text-muted);
}
.pp-seg { display: grid; grid-template-columns: repeat(2, 1fr); gap: 6px; }
.pp-seg .pp-font { padding: 6px 0; font-size: 12px; }
.pp-opt:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
/* 选中态：左缘 2px 强调色条 + 行底色 */
.pp-opt[aria-checked="true"] { background: var(--hairline); }
.pp-opt[aria-checked="true"]::after {
  content: ""; position: absolute; left: 0; top: 22%; bottom: 22%;
  width: 2px; border-radius: 2px;
  background: var(--accent);
}
/* 微缩主题预览：底色 + 点缀小灯 + 两行"文字"，一眼看出这套主题长什么样 */
.pp-view {
  width: 46px; height: 32px; border-radius: 6px; flex: none;
  background: var(--pv-bg);
  padding: 6px 8px;
  display: flex; flex-direction: column; justify-content: center; gap: 4px;
  overflow: hidden;
}
.pp-view .pp-dot {
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--pv-accent);
  box-shadow: 0 0 5px var(--pv-accent);
  margin-bottom: 1px;
}
.pp-view .pp-line {
  height: 2.5px; border-radius: 2px;
  width: 100%; background: var(--pv-ink); opacity: 0.75;
}
.pp-view .pp-line.short { width: 62%; opacity: 0.45; }
.pp-txt b {
  display: block;
  font-family: var(--font-serif); font-size: 13.5px; font-weight: 600;
  color: var(--text-secondary);
  transition: color 0.2s;
}
.pp-txt small {
  display: block; margin-top: 3px;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.14em;
  text-transform: uppercase; color: var(--text-muted);
}
.pp-mark {
  font-size: 12px; color: var(--accent);
  opacity: 0; transform: scale(0.5);
  transition: opacity 0.25s, transform 0.3s var(--ease-spring);
}
.pp-opt[aria-checked="true"] .pp-txt b { color: var(--text-main); }
.pp-opt[aria-checked="true"] .pp-mark { opacity: 1; transform: scale(1); }

/* --- 移动端导航抽屉 ---
   宽屏主导航就在页头，不需要汉堡按钮，所以默认隐藏；
   <768px 时 .main-nav 被 display:none，必须由这个抽屉接手导航。 */
.nav-toggle { display: none; }

.mobile-nav {
  position: fixed; inset: 0; z-index: 9500;
  display: flex; justify-content: flex-end;
  background: rgba(20, 19, 16, 0.42);
  backdrop-filter: blur(3px);
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.24s var(--ease-out), visibility 0s linear 0.24s;
}
.mobile-nav.active {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 0.24s var(--ease-out), visibility 0s;
}
.mobile-nav-panel {
  width: min(84vw, 320px); height: 100%;
  background: var(--card-bg);
  border-left: 1px solid var(--border-color);
  display: flex; flex-direction: column;
  padding: 20px 22px calc(20px + env(safe-area-inset-bottom, 0px));
  transform: translateX(100%);
  transition: transform 0.26s var(--ease-out);
  overflow-y: auto;
}
.mobile-nav.active .mobile-nav-panel { transform: translateX(0); }

.mobile-nav-head {
  display: flex; align-items: center; justify-content: space-between;
  padding-bottom: 18px; margin-bottom: 6px;
  border-bottom: 1px solid var(--border-color);
}
.mobile-nav-brand {
  font-family: var(--font-serif); font-size: 18px; font-weight: 700;
  letter-spacing: -0.01em;
}
.mobile-nav-close { font-size: 15px; }

.mobile-nav-links { display: flex; flex-direction: column; }
.mobile-nav-link {
  font-family: var(--font-serif);
  font-size: 19px; font-weight: 600;
  color: var(--text-main);
  padding: 15px 2px;
  border-bottom: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: space-between;
}
.mobile-nav-link::after { content: "→"; font-size: 14px; color: var(--text-muted); opacity: 0; transition: opacity 0.2s, transform 0.2s; transform: translateX(-4px); }
.mobile-nav-link:hover::after,
.mobile-nav-link.active::after { opacity: 1; transform: translateX(0); }
.mobile-nav-link.active { color: var(--accent); }

.mobile-nav-foot {
  margin-top: auto; padding-top: 22px;
  display: flex; gap: 18px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-muted);
}
.mobile-nav-foot a:hover { color: var(--accent); }

@media (max-width: 768px) {
  .nav-toggle { display: flex; }
}

/* .theme-icon / .lang-switch 已随「日/月图标切换」一起下线：
   主题开关现在是配色菜单（.palette-menu / #palette-btn），index.html 里
   已经没有 .theme-icon、.lang-switch 节点，规则整块删除。 */

/* ============================================================
   5. 全屏报头（杂志封面）
   ------------------------------------------------------------
   三行结构：刊头信息条 / 刊名 / 数据条。中间那行吃掉剩余高度，
   刊名在它里面垂直居中——所以「空」被分配到了字的四周，而不是堆在页面底部。
   第二行末尾接一条拉到右边缘的横线，把「BLOG」右边的缺口封住：
   杂志报头就是这么处理短标题的。
   ============================================================ */
.fullscreen-hero {
  /* 页头是 fixed 不占文档流：补上它的高度，hero 底边正好落在第一屏底边 */
  position: relative;
  /* 上限 880：1080 高的屏幕上留 200px 让下面那张焦点文章露一角，
     这是「下面还有东西」最直接的提示；矮屏则照常占满一屏。 */
  min-height: min(100vh, 880px);
  min-height: min(100svh, 880px);
  padding: calc(var(--header-h) + 20px) 0 0;
  display: flex;
  overflow: hidden;
  isolation: isolate;
  /* 与「本期聚焦」的分界：粗黑线，和侧栏头部的粗线同一套编辑语言 */
  border-bottom: 2px solid var(--text-main);
}

/* --- 印版规矩线：12 列暗网格 --- */
.hero-plate {
  position: absolute;
  inset: -6% -3%;
  z-index: -1;
  pointer-events: none;
  will-change: transform;
}
.hero-plate-inner {
  position: absolute;
  inset: 0;
  background-image: linear-gradient(to right, var(--hairline) 0 1px, transparent 1px);
  background-size: calc(100% / 12) 100%;
  opacity: 0.6;
  -webkit-mask-image: radial-gradient(120% 88% at 50% 44%, #000 0%, rgba(0, 0, 0, 0.5) 48%, transparent 84%);
  mask-image: radial-gradient(120% 88% at 50% 44%, #000 0%, rgba(0, 0, 0, 0.5) 48%, transparent 84%);
}

.hero-frame {
  position: relative;
  width: 100%;
  max-width: 1440px;
  /* 与 .header-inner / .mag-grid 完全同一套盒子：1440 上限 + 40 内边距，
     三者的内容左线才对得齐（以前只有 hero 把 40px 加在外层，错开 40px）。 */
  padding: 0 40px;
  margin: 0 auto;
  display: grid;
  grid-template-rows: auto minmax(0, 1fr) auto;
  padding-bottom: 26px;
}

/* --- 刊头信息条 --- */
.hero-meta {
  display: flex;
  align-items: center;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-muted);
  white-space: nowrap;
}
.hm { display: inline-flex; align-items: baseline; gap: 5px; }
.hm-k { opacity: 0.5; }
.hm-v { color: var(--text-secondary); font-variant-numeric: tabular-nums; }
.hm-rule {
  align-self: center;
  width: 1px; height: 10px;
  margin: 0 16px;
  background: var(--border-color);
}
.hm-spacer { flex: 1; min-width: 12px; }
.hm-clock { gap: 8px; }
.hm-clock em { font-style: normal; opacity: 0.45; letter-spacing: 0.1em; }
.hm-dot {
  align-self: center;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
}

/* --- 刊名 --- */
.hero-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-height: 0;
  padding: clamp(26px, 5.5vh, 68px) 0;
}
.hero-title {
  display: flex;
  flex-direction: column;
  font-family: var(--font-serif);
  font-weight: 900;
  font-size: clamp(38px, 9.2vw, 150px);
  line-height: 0.9;
  letter-spacing: -0.035em;
  text-transform: uppercase;
  color: var(--text-main);
}
.ht-line { display: flex; align-items: flex-end; min-width: 0; }
.ht-in { display: block; min-width: 0; }
.ht-txt { display: block; }
/* 贴基线的一条横线，从刊名右侧拉满到容器右边缘 */
.ht-tail {
  flex: 1 1 auto;
  min-width: 32px;
  height: 3px;
  margin-left: 0.26em;
  margin-bottom: 0.22em;
  background: var(--text-main);
  transform-origin: left center;
}

.hero-sub {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 28px;
  flex-wrap: wrap;
  margin-top: clamp(18px, 3.4vh, 36px);
}
.hero-lede {
  position: relative;
  padding-left: 44px;
  font-family: var(--font-serif);
  font-size: clamp(14px, 1.15vw, 17px);
  font-weight: 600;
  letter-spacing: 0.16em;
  color: var(--text-secondary);
  text-wrap: pretty;
}
/* 副标题前的一小段砖红短线：报头里的「引题」记号 */
.hero-lede::before {
  content: "";
  position: absolute; left: 0; top: 50%;
  width: 30px; height: 1px;
  background: var(--accent);
}
.hero-note {
  font-size: 12.5px;
  line-height: 1.85;
  color: var(--text-muted);
  text-align: right;
  letter-spacing: 0.02em;
}

/* --- 数据条 --- */
.hero-foot {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  flex-wrap: wrap;
  padding-top: 16px;
  border-top: 1px solid var(--hairline);
}
.hero-stats { display: flex; align-items: flex-end; }
.hst {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding-right: 30px;
  margin-right: 30px;
  border-right: 1px solid var(--hairline);
}
.hst:last-child { border-right: 0; padding-right: 0; margin-right: 0; }
.hst dt {
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
}
.hst dd {
  font-family: var(--font-serif);
  font-size: clamp(22px, 2.1vw, 30px);
  font-weight: 700;
  line-height: 1;
  letter-spacing: -0.01em;
  font-variant-numeric: tabular-nums;
}

.hero-scroll {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 8px 0 2px;
  font-family: var(--font-mono);
  font-size: 11px;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--text-muted);
  transition: color 0.2s;
}
.hero-scroll svg { width: 15px; height: 15px; transition: transform 0.34s var(--ease-out); }
.hero-scroll:hover { color: var(--accent); }
.hero-scroll:hover svg { transform: translateY(4px); }

/* --- 入场：CSS 自己跑，不依赖脚本。
       用 clip-path 从下往上揭开，不影响布局，也就不需要给行高留 padding。--- */
@media (prefers-reduced-motion: no-preference) {
  .hero-meta > *,
  .hero-foot > * {
    opacity: 0;
    animation: heroFade 0.6s var(--ease-out) both;
  }
  .hero-meta > *:nth-child(1) { animation-delay: 0.10s; }
  .hero-meta > *:nth-child(2) { animation-delay: 0.16s; }
  .hero-meta > *:nth-child(3) { animation-delay: 0.20s; }
  .hero-meta > *:nth-child(4) { animation-delay: 0.24s; }
  .hero-meta > *:nth-child(5) { animation-delay: 0.28s; }
  .hero-meta > *:nth-child(7) { animation-delay: 0.34s; }
  .hero-foot > *:nth-child(1) { animation-delay: 0.62s; }
  .hero-foot > *:nth-child(2) { animation-delay: 0.72s; }

  .ht-txt {
    clip-path: inset(-18% -4% 104% -4%);
    animation: heroRise 0.95s var(--ease-out) both;
  }
  .ht-line:nth-child(1) .ht-txt { animation-delay: 0.14s; }
  .ht-line:nth-child(2) .ht-txt { animation-delay: 0.26s; }

  .ht-tail {
    transform: scaleX(0);
    animation: heroRule 0.9s var(--ease-out) 0.5s both;
  }

  .hero-sub > * {
    opacity: 0;
    animation: heroFade 0.7s var(--ease-out) 0.5s both;
  }
  .hero-sub > *:nth-child(2) { animation-delay: 0.6s; }

  .hm-dot { animation: hmPulse 2.6s ease-out infinite; }
}

@keyframes heroFade {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes heroRise {
  from { clip-path: inset(-18% -4% 104% -4%); transform: translateY(0.1em); }
  to { clip-path: inset(-18% -4% -18% -4%); transform: none; }
}
@keyframes heroRule {
  from { transform: scaleX(0); }
  to { transform: scaleX(1); }
}
@keyframes hmPulse {
  0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); }
  70% { box-shadow: 0 0 0 7px transparent; }
  100% { box-shadow: 0 0 0 0 transparent; }
}

/* --- 首屏窄屏：刊名缩小、横线收起、数据条换行 --- */
@media (max-width: 900px) {
  .hero-frame { padding: 0 28px; }
  .hero-note { display: none; }
  .hero-lede { padding-left: 34px; }
  .hero-lede::before { width: 22px; }
}
@media (max-width: 620px) {
  /* 手机上不再占满一屏：整块收成一张「卡片式封面」，
     一屏之内就能看到下面的焦点文章，不至于滑一大段空白才见到内容。 */
  .fullscreen-hero { min-height: 0; padding: calc(var(--header-h) + 14px) 0 0; }
  .hero-frame { padding: 0 20px; }
  .hero-frame { padding-bottom: 18px; }
  .hero-body { padding: 40px 0 44px; }
  .hero-title { font-size: clamp(24px, 9.2vw, 44px); line-height: 1.02; }
  .ht-tail { display: none; }
  .hero-meta { font-size: 11px; letter-spacing: 0.1em; }
  .hm-rule { margin: 0 9px; }
  .hm-clock em { display: none; }
  .hero-sub { margin-top: 18px; }
  .hero-lede { font-size: 13.5px; letter-spacing: 0.1em; }
  .hero-stats { width: 100%; }
  .hst { flex: 1; padding-right: 14px; margin-right: 14px; }
  .hst dd { font-size: 22px; }
  .hero-foot { padding-top: 14px; }
}

/* ============================================================
   6. 分类筛选（位于「本期聚焦」侧栏头部）
   ============================================================ */
.filter-chips {
  display: flex; gap: 6px;
  flex-wrap: wrap;
}
.filter-chip {
  font-size: 12.5px; font-weight: 600;
  padding: 5px 12px; border-radius: 99px;
  color: var(--text-muted); white-space: nowrap;
  transition: color 0.2s, background-color 0.2s;
}
.filter-chip:hover { color: var(--text-main); background: var(--border-color); }
.filter-chip.active { background: var(--text-main); color: var(--bg-color); }
.filter-count {
  font-family: var(--font-serif); font-style: italic;
  font-size: 12px; color: var(--text-muted);
  white-space: nowrap; flex: none;
}

.magazine-container { max-width: 1440px; margin: 0 auto; padding: 0 40px; }

/* ============================================================
   7. 首页网格
   ============================================================ */
.mag-grid {
  display: grid;
  grid-template-columns: repeat(12, 1fr);
  gap: 40px;
  padding: 40px 40px 80px;
  min-height: 600px;
  max-width: 1440px;
  margin: 0 auto;
}

/* ---- 焦点大图 ----
   封面本身已经是排版好的版面（标题、期号、栏线都在图里），再往上叠一层标题
   会和图里的字重影。所以改成「图 + 图下说明」：上方是版面，下方是说明块，
   两种封面（照片 / 排版）都能用同一套排版，也不会出现白字压在浅底上看不清。 */
.article-link { display: block; cursor: pointer; }
.hero-block {
  grid-column: span 8;
  display: flex; flex-direction: column; gap: 20px;
  min-width: 0;
  cursor: pointer;
  transition: transform 0.3s ease;
}
@media (hover: hover) and (pointer: fine) {
  .hero-block:hover { transform: translateY(-3px); }
}
.hero-block:focus-visible { outline-offset: 6px; }
.hero-feature {
  position: relative;
  min-height: 460px;
  flex: 1;
  border-radius: var(--radius-sm);
  overflow: hidden;
  background-color: #1a1816;
  background-size: cover; background-position: center;
  transition: background 0.6s ease;
}
@media (hover: hover) and (pointer: fine) {
  .hero-block:hover .hero-feature { background-size: cover; }
}
.hero-feature:focus-visible { outline-offset: 4px; }

.hero-caption { position: relative; z-index: 2; transition: opacity 0.24s ease; padding-right: 8px; }
.hero-inner.fade-out { opacity: 0; }
.hero-caption .meta {
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.2em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 10px;
}
.hero-caption h2 {
  font-family: var(--font-serif);
  font-size: clamp(24px, 2.6vw, 34px);
  line-height: 1.2; font-weight: 600;
  letter-spacing: -0.01em;
  margin: 0 0 10px;
  color: var(--text-main);
}
.hero-caption p {
  font-family: var(--font-serif);
  font-size: 15px; line-height: 1.65;
  color: var(--text-soft);
  max-width: 640px; margin: 0 0 10px;
}
.hero-caption .byline { font-size: 12px; color: var(--text-muted); }

.hero-progress-container {
  position: absolute; bottom: 0; left: 0; right: 0;
  height: 4px; background: rgba(255, 255, 255, 0.15);
  z-index: 3;
}
.hero-progress-bar {
  height: 100%; width: 0%;
  background: var(--accent);
  box-shadow: 0 0 8px rgba(176, 58, 46, 0.6);
}
.hero-progress-bar.running { animation: progressAnim 6s linear forwards; }
.hero-progress-bar.paused { animation-play-state: paused; }
@keyframes progressAnim { from { width: 0%; } to { width: 100%; } }

/* ---- 侧栏 ---- */
.briefs-col { grid-column: span 4; display: flex; flex-direction: column; min-width: 0; }
/* 头部放筛选 chips 与汇总数，替代原来的本地搜索框 */
.briefs-header {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px; flex-wrap: wrap;
  border-bottom: 2px solid var(--text-main);
  padding-bottom: 12px; margin-bottom: 16px;
}

.brief-list-container {
  flex: 1;
  /* 时长必须与 app.js 里 180ms 的换内容时机对齐，否则会在半透明状态完成替换，看起来像动画失效 */
  transition: opacity 0.18s ease;
  display: flex; flex-direction: column;
  min-height: 400px; max-height: 520px;
  overflow-y: auto;
}
.brief-list-container::-webkit-scrollbar { width: 4px; }
.brief-list-container::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
.brief-list-container.fade-out { opacity: 0; }

.brief-item {
  display: flex; flex-direction: column; justify-content: center;
  position: relative;
  padding: 14px 0 14px 16px;
  border-bottom: 1px solid var(--border-color);
  cursor: pointer; width: 100%; text-align: left;
  transition: background-color 0.2s;
}
.brief-item:last-child { border-bottom: none; }
.brief-item::before {
  content: ""; position: absolute; left: 0; top: 14px; bottom: 14px;
  width: 3px; background: var(--accent); opacity: 0;
  transition: opacity 0.2s;
}
.brief-item.active::before { opacity: 1; }
.brief-item .category {
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--accent); margin-bottom: 4px;
}
.brief-item .brief-title {
  font-family: var(--font-serif);
  font-size: 16px; line-height: 1.3; font-weight: 600;
  margin-bottom: 4px;
  transition: color 0.2s;
}
.brief-item.active .brief-title { color: var(--accent); }
.brief-item .time { font-size: 11px; color: var(--text-muted); }

/* ============================================================
   7.5 首页个人展示区 + 文章页侧栏数据卡
   暖炭底、1px 细线分节，砖红只出现在徽章与链接上。
   ============================================================ */
/* 栅格内的通栏细分隔线：分隔线占一个 grid row，靠行距与上下模块呼吸 */
.grid-rule {
  grid-column: 1 / -1;
  height: 1px;
  background: var(--hairline);
}

/* ---- 首页个人展示区：参考「霓虹红 · 工程网格」的内容结构 ----
   但不再做成一块更黑的卡片贴在页面上，而是去掉容器壳直接
   融入页面背景：无边框、无底色，颜色全部走站点 token，随主题适配 */
.about-teaser {
  --tz-glow: rgba(232, 93, 74, 0.35);
  /* 方块色阶用实色阶梯，别用高透明度——大方块上淡粉会显得没数据 */
  --tz-grid1: rgba(176, 58, 46, 0.28);
  --tz-grid2: rgba(176, 58, 46, 0.62);
  --tz-grid3: #b03a2e;
  /* 与右侧「正在」竖栏组成 8 + 4；竖栏内容被后台清空时由 JS 加 .solo 独占整行 */
  grid-column: span 8;
  position: relative;
  overflow: hidden;
  color: var(--text-main);
}
.about-teaser.solo { grid-column: span 12; }
.about-teaser > * { position: relative; z-index: 1; }

.tz-watermark {
  position: absolute; top: -14px; right: 26px;
  font-family: Georgia, var(--font-serif);
  font-size: 104px; font-weight: 600;
  /* 融入背景后水印随主题换色 */
  color: rgba(0, 0, 0, 0.03);
  letter-spacing: -3px; white-space: nowrap;
  pointer-events: none; user-select: none;
  z-index: 0;
}
[data-theme="dark"] .tz-watermark { color: rgba(255, 255, 255, 0.02); }
/* 暗色下把方块提亮，和 --accent 的暗色版本保持同一档 */
[data-theme="dark"] .about-teaser {
  --tz-grid1: rgba(232, 93, 74, 0.30);
  --tz-grid2: rgba(232, 93, 74, 0.66);
  --tz-grid3: #e85d4a;
}

/* 调色板的热力图色阶：与上面这条同优先级、写在它后面，否则会被遮住 */
[data-palette="frost"] .about-teaser {
  --tz-glow: rgba(156, 178, 232, 0.35);
  --tz-grid1: rgba(156, 178, 232, 0.30);
  --tz-grid2: rgba(156, 178, 232, 0.66);
  --tz-grid3: #8fb6d9;
}
[data-palette="minimal"] .about-teaser {
  --tz-glow: rgba(49, 49, 49, 0.25);
  --tz-grid1: rgba(49, 49, 49, 0.30);
  --tz-grid2: rgba(49, 49, 49, 0.62);
  --tz-grid3: #313131;
}

.tz-head {
  display: flex; justify-content: space-between; align-items: flex-start;
  gap: 24px; margin-bottom: 26px;
}
.tz-left { display: flex; gap: 24px; align-items: center; min-width: 0; }
.tz-avatar {
  flex: none; width: 86px; height: 86px; border-radius: 50%;
  border: 1px solid var(--border-color);
  display: grid; place-items: center;
  font-family: var(--font-serif); font-size: 40px;
  color: var(--text-main); background: var(--card-bg);
}
/* 后台传了头像就铺满圆形，字母让位（保留在 DOM 里给读屏和加载失败兜底） */
.tz-avatar.has-photo,
.author-avatar.has-photo {
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
}
.tz-avatar.has-photo { color: transparent; }

.tz-info { min-width: 0; }
.tz-name {
  display: flex; align-items: center; gap: 10px;
  font-family: var(--font-serif); font-size: 30px; font-weight: 600;
}
.tz-name svg { width: 20px; height: 20px; fill: var(--accent); flex: none; }
.tz-subtitle {
  color: var(--text-muted); font-size: 12.5px;
  margin-top: 7px; letter-spacing: 1px;
}
.tz-tags {
  display: flex; gap: 10px; align-items: center; flex-wrap: wrap;
  margin-top: 14px; font-size: 11.5px; color: var(--text-muted);
}
.tz-tag {
  border: 1px solid var(--border-color);
  padding: 5px 11px; border-radius: 6px;
  color: var(--text-main); text-decoration: none;
  transition: border-color 0.2s, color 0.2s;
}
.tz-tag:hover { border-color: var(--accent); color: var(--accent); }

.tz-timepanel { flex: none; text-align: right; }
.tz-fig {
  font-size: 11px; color: var(--text-muted);
  letter-spacing: 2px; margin-bottom: 8px; text-transform: uppercase;
}
.tz-live {
  font-family: var(--font-mono, monospace);
  font-size: 26px; font-weight: 700;
  font-variant-numeric: tabular-nums; color: var(--text-main);
}
.tz-status {
  display: flex; justify-content: flex-end; align-items: center; gap: 6px;
  margin-top: 8px; font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px;
}
.tz-dot {
  width: 6px; height: 6px; border-radius: 50%;
  /* 默认跟强调色走。以前只在 frost 里覆盖 --live-dot，另外三套配色就落到
     硬编码的信号绿 #00ff41 —— 在 minimal 的 #EBEBEB 底上只有 1.15:1，
     等于一颗看不见的绿点，还破坏「无彩度」的前提。 */
  background: var(--live-dot, var(--accent));
  box-shadow: 0 0 8px var(--live-dot, var(--accent));
}

/* 分隔线：向右渐隐 */
.tz-divider {
  height: 1px; margin: 22px 0;
  background: linear-gradient(90deg, var(--border-color) 0%, transparent 100%);
}

/* 数据区：左圆点热力 + 右竖栏 */
.tz-dash { display: flex; gap: 28px; }
.tz-chart { flex: 1; min-width: 0; }
.tz-dashhead {
  display: flex; justify-content: space-between;
  font-size: 11px; color: var(--text-muted);
  margin-bottom: 16px; letter-spacing: 1px; text-transform: uppercase;
}
/* 月份标签按所在列定位，跟着 JS 算出来的 24 周窗口走 */
.tz-months {
  position: relative;
  height: 14px;
  margin-left: 22px;          /* 对齐星期标签列之后的网格左边缘 */
  margin-bottom: 8px;
  font-size: 11px; color: var(--text-muted);
}
.tz-months span { position: absolute; top: 0; white-space: nowrap; }
.tz-cal { display: flex; gap: 8px; }
.tz-weekdays {
  display: flex; flex-direction: column; justify-content: space-between;
  width: 14px; flex: none; padding-top: 2px;
  font-size: 9.5px; color: var(--text-muted);
}
/* 方块像素点阵：24 列 × 7 行，4px 缝、2px 圆角，格子和图例都是方的 */
.tz-grid {
  display: grid; flex: 1;
  grid-template-rows: repeat(7, 1fr);
  grid-auto-flow: column;
  grid-auto-columns: 1fr;
  gap: 4px;
}
.tz-cell {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 2px;
  background: var(--border-color);
  transition: transform 0.12s ease, filter 0.12s ease;
}
.tz-cell:hover { transform: scale(1.2); z-index: 5; filter: brightness(1.25); }
/* ---- 热力图动效（fx.js initHeatmapMotion）----
   一粒数据 = 一块可被"顶起"的方形浮雕。JS 只写三个 0..1 变量，
   表现全交给 CSS：抬升位移 / 投影 / 顶面高光 / 主题色描边 / 扫光。
   hm-in 负责入场；入场后只有真正活跃的格子才挂 hm-hot（带 paint 开销的
   抬升 / 投影 / 描边 / 高光），静止的 168 格不背任何渲染成本。 */
.js-hm .tz-cell {
  --hm-lift: 0;    /* 指针弹簧抬升 */
  --hm-flash: 0;   /* 点击涟漪闪光 */
  --hm-wave: 0;    /* 空闲扫光 */
  opacity: 0;
  transform: scale(0.14) translateY(11px);
  transition:
    opacity 0.42s ease,
    transform 0.58s cubic-bezier(0.22, 1, 0.36, 1),
    background-color 0.3s ease;
  transition-delay: var(--hm-delay, 0ms);
}
.js-hm .tz-cell.hm-in { opacity: 1; transform: none; }
/* 入场结束后不再给全部 168 格挂 filter / box-shadow / 伪元素 */
.js-hm .tz-cell.hm-live { transition: background-color 0.3s ease; }
/* 只有活跃的格子才承担 paint：JS 按状态增删 hm-hot。
   性能约定：不用 filter、不用带模糊的 box-shadow、不用渐变伪元素——
   每帧只改 transform（合成）与一层纯色覆盖的 opacity（一次纯色 fill）。
   投影改成硬边的"像素块侧面"，无模糊、无变量，只在挂 class 时绘制一次。 */
.js-hm .tz-cell.hm-hot {
  transform:
    translateY(calc(var(--hm-lift) * -7px - var(--hm-flash) * 3px))
    scale(calc(1 + var(--hm-lift) * 0.34 + var(--hm-flash) * 0.12));
  /* 投影高度与描边宽度随强度渐变（纯数值、无模糊、无颜色解析）：
     抬起越明显侧面越厚，涟漪扫过才浮出一圈主题色细边 */
  box-shadow:
    0 calc(var(--hm-lift) * 4px) 0 rgba(0, 0, 0, 0.22),
    0 0 0 calc((max(0, var(--hm-flash) - 0.18) * 1.3
      + var(--hm-wave) * 0.3 + var(--hm-lift) * 0.2) * 1px) var(--hm-glow);
}
/* 明暗染色：纯色覆盖层。浅色压暗成浮雕、深色提亮，幅度与旧 filter 等价 */
.js-hm .tz-cell.hm-hot::after {
  content: '';
  position: absolute; inset: 0; border-radius: inherit; pointer-events: none;
  background: var(--hm-tint);
  opacity: calc(var(--hm-lift) * var(--hm-ka)
    + max(0, var(--hm-flash) - 0.12) * var(--hm-kb)
    + var(--hm-wave) * var(--hm-kc));
}
.tz-cell[data-level="1"] { background: var(--tz-grid1); }
.tz-cell[data-level="2"] { background: var(--tz-grid2); }
.tz-cell[data-level="3"] { background: var(--tz-grid3); }
.tz-legend {
  display: flex; justify-content: space-between; align-items: center;
  margin-top: 18px; font-size: 11.5px; color: var(--text-muted);
}
.tz-legendcolors { display: flex; align-items: center; gap: 6px; }
.tz-legendcolors i { display: block; width: 12px; height: 12px; border-radius: 2px; }
.tz-legendcolors i[data-lv="0"] { background: var(--border-color); }
.tz-legendcolors i[data-lv="1"] { background: var(--tz-grid1); }
.tz-legendcolors i[data-lv="2"] { background: var(--tz-grid2); }
.tz-legendcolors i[data-lv="3"] { background: var(--tz-grid3); }

.tz-side {
  flex: none; width: 184px;
  border-left: 1px dashed var(--border-color);
  padding-left: 28px;
  display: flex; flex-direction: column; justify-content: center;
  gap: 22px;
}
/* 运行天数：大号等宽数字替代原来的进度环 */
.tz-days { text-align: center; }
.tz-days-label {
  font-size: 11px; color: var(--text-muted);
  text-transform: uppercase; letter-spacing: 1px; margin-bottom: 12px;
}
.tz-days-num {
  font-family: var(--font-mono, monospace);
  font-size: 44px; font-weight: 700; line-height: 1;
  color: var(--accent);
  text-shadow: 0 0 24px var(--tz-glow);
  font-variant-numeric: tabular-nums;
}
.tz-days-num small {
  font-size: 13px; font-weight: 500;
  color: var(--text-main); margin-left: 6px;
  text-shadow: none;
}
.tz-days-since {
  margin-top: 10px; font-size: 11.5px;
  color: var(--text-muted); font-variant-numeric: tabular-nums;
}
.tz-streak { text-align: center; }
.tz-streak p {
  font-size: 11px; color: var(--text-muted); margin-bottom: 5px;
  text-transform: uppercase; letter-spacing: 1px;
}
.tz-streak h4 { font-size: 15px; font-weight: 700; font-variant-numeric: tabular-nums; }
.tz-streak h4 b { color: var(--accent); }

/* 提示条跟随主题，不再是暗色页面里刺眼的白底黑字 */
.tz-tooltip {
  position: absolute;
  background: var(--card-bg);
  color: var(--text-main);
  border: 1px solid var(--border-color);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
  padding: 5px 9px; border-radius: 6px;
  font-size: 10.5px; font-weight: 500; letter-spacing: 0.02em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
  pointer-events: none; opacity: 0; z-index: 60;
  transform: translate(-50%, -100%) translateY(-13px);
  transition: opacity 0.18s ease 0.1s;
}
.tz-tooltip.show { opacity: 1; }
.tz-tooltip::after {
  content: ''; position: absolute; bottom: -5px; left: 50%; margin-left: -5px;
  border-width: 5px 5px 0; border-style: solid;
  border-color: var(--card-bg) transparent transparent transparent;
}

.tz-foot { display: flex; justify-content: space-between; align-items: center; gap: 16px; }
.tz-footleft { display: flex; align-items: center; min-width: 0; }
.tz-greet {
  font-family: var(--font-serif); font-style: italic;
  font-size: 20px; color: var(--accent); margin-right: 20px; white-space: nowrap;
}
.tz-motto {
  color: var(--text-muted); font-size: 13px;
  border-left: 1px solid var(--border-color); padding-left: 20px;
}
.tz-aboutlink {
  flex: none; color: var(--text-muted); text-decoration: none;
  font-size: 12.5px; display: flex; align-items: center; gap: 8px;
  transition: color 0.2s, transform 0.2s;
}
.tz-aboutlink:hover { color: var(--text-main); transform: translateX(4px); }

@media (max-width: 900px) {
  .tz-dash { flex-direction: column; }
  .tz-side {
    width: auto; border-left: none; border-top: 1px dashed var(--border-color);
    padding: 20px 0 0; flex-direction: row; justify-content: space-around; align-items: center;
  }
  .tz-watermark { font-size: 64px; top: -8px; }
}
@media (max-width: 680px) {
  /* 已融入背景，不再有卡的内外边距 */
  .tz-head { flex-direction: column; }
  .tz-timepanel { width: 100%; text-align: left; }
  .tz-status { justify-content: flex-start; }
  .tz-avatar { width: 64px; height: 64px; font-size: 30px; }
  .tz-name { font-size: 24px; }
  .tz-live { font-size: 20px; }
  .tz-foot { flex-direction: column; align-items: flex-start; }
  .tz-footleft { flex-direction: column; align-items: flex-start; gap: 10px; }
  .tz-motto { border-left: none; padding-left: 0; }
}

/* ---- 模块统计 pill 与作品卡角标 ---- */
.module-stat {
  font-size: 11px; font-variant-numeric: tabular-nums;
  color: var(--text-muted);
  padding: 4px 12px; border: 1px solid var(--border-color);
  border-radius: 99px; white-space: nowrap;
  text-transform: none; letter-spacing: 0;
  transition: border-color 0.25s, color 0.25s;
}
.module-stat:hover { border-color: var(--accent); color: var(--accent); }
/* ---- 文章页侧栏：目录下方的本篇数据，同一套卡片语言 ---- */
/* ---- 文章页侧栏 · 本篇数据（融入式，无卡片壳，随主题 token） ---- */
.article-stat-card {
  margin-top: 30px; padding-top: 20px;
  border-top: 1px solid var(--border-color);
}
.as-label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 14px;
}
.as-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.as-cell {
  padding: 10px 12px;
  border: 1px solid var(--border-color); border-radius: 10px;
  background: var(--card-bg);
  transition: border-color 0.3s;
}
.as-cell:hover { border-color: var(--accent); }
.as-cell b {
  display: block;
  font-family: var(--font-mono); font-size: 16px; font-weight: 600;
  color: var(--text-main); font-variant-numeric: tabular-nums;
}
.as-cell small {
  display: block; margin-top: 3px;
  font-size: 10px; color: var(--text-muted); letter-spacing: 0.08em;
}
/* 全站阅读量分布轴：每根小柱 = 一篇文章，高度映射阅读量，当前篇点亮 */
.as-axis {
  display: flex; align-items: flex-end; justify-content: space-between;
  gap: 3px; height: 44px; margin-top: 16px; padding: 0 2px;
}
.as-bar {
  width: 6px; border-radius: 2px 2px 0 0;
  background: var(--border-color);
  transform: scaleY(0.25); transform-origin: bottom;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1), background-color 0.4s, box-shadow 0.4s;
}
.article-stat-card.is-in .as-bar { transform: scaleY(1); }
.as-bar:hover { background: var(--text-muted); }
.as-bar.is-cur {
  background: var(--accent);
  box-shadow: 0 0 10px color-mix(in srgb, var(--accent) 45%, transparent);
}
.as-cap {
  display: flex; justify-content: space-between; gap: 8px;
  margin-top: 8px;
  font-family: var(--font-mono); font-size: 9.5px; letter-spacing: 0.06em;
  color: var(--text-muted);
}

@media (prefers-reduced-motion: reduce) {
  .js-hm .tz-cell,
  .js-hm .tz-cell.hm-live,
  .js-hm .tz-cell.hm-hot { opacity: 1; transform: none; filter: none; box-shadow: none; }
  .js-hm .tz-cell.hm-hot::before,
  .js-hm .tz-cell.hm-hot::after { display: none; }
  .tz-cell, .article-stat-card, .as-bar,
  .tz-tag, .tz-aboutlink { transition: none !important; animation: none !important; }
  .article-stat-card.is-in .as-bar { transform: scaleY(1); }
  .tz-cell:hover, .article-stat-card:hover { transform: none; }
}

/* ---- 个性化设置里手动关掉动效（html[data-motion="off"]）----
   与系统级 prefers-reduced-motion 分开：这是用户在面板里的选择。
   用「几乎为零的时长」而不是 animation:none —— 带 both 填充的入场动画
   会直接落到终态，不会把 opacity:0 的内容永远留在原地。 */
html[data-motion="off"] *,
html[data-motion="off"] *::before,
html[data-motion="off"] *::after {
  animation-duration: 0.01ms !important;
  animation-delay: 0ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: 0.01ms !important;
  transition-delay: 0ms !important;
  scroll-behavior: auto !important;
}
/* 已经挂上入场初始态的节点直接显形 */
html[data-motion="off"] .js-reveal .fade-in { opacity: 1; transform: none; }
html[data-motion="off"] .js-hm .tz-cell { opacity: 1; transform: none; }

/* ============================================================
   8. 作品展示
   ============================================================ */
.showcase-section { grid-column: span 12; margin-top: 20px; }

.module-header {
  display: flex; justify-content: space-between; align-items: flex-end;
  border-bottom: 1px solid var(--hairline);
  padding-bottom: 16px; margin-bottom: 24px;
  position: relative;
}
.module-header::after {
  content: ""; position: absolute; left: 0; bottom: -1px;
  width: 48px; height: 2px; background: var(--accent);
}
/* 章节标题：HTML 用的是裸 h3，之前只写了 .module-heading，规则从未命中 */
.module-header .module-heading,
.module-header h3 {
  font-family: var(--font-serif);
  font-size: 22px; font-weight: 600; line-height: 1.3;
}
.module-header h3 .module-count {
  font-family: var(--font-mono);
  font-size: 12px; font-style: normal; font-weight: 500;
  color: var(--text-muted);
  letter-spacing: 0.08em;
  margin-left: 10px;
  vertical-align: 0.2em;
}
.module-header span {
  font-size: 11px; letter-spacing: 0.15em;
  color: var(--text-muted); text-transform: uppercase;
}

.showcase-type-filter { display: flex; gap: 8px; margin-bottom: 24px; flex-wrap: wrap; }
.showcase-type-btn {
  font-size: 12px; padding: 6px 14px; border-radius: 99px;
  border: 1px solid var(--border-color); color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.showcase-type-btn:hover { border-color: var(--accent); color: var(--accent); }
.showcase-type-btn.active { background: var(--text-main); color: var(--bg-color); border-color: var(--text-main); }

/* ---- 作品台账：目录在左，图版在右 ----
   三列卡片墙是全站最后一块模板残留。改成文章目录同款台账行：
   平时只有字（编号 / 标题+技术签 / 一句话 / 浏览数），悬停哪行，
   右侧图版换哪张图。图版带相纸式纸边，像印刷样张。 */
.work-index {
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(300px, 400px);
  gap: 52px; align-items: start;
}
.work-rows { display: flex; flex-direction: column; min-width: 0; }
.work-row {
  position: relative;
  display: grid; grid-template-columns: 44px minmax(0, 1fr) auto;
  gap: 16px; align-items: baseline;
  padding: 24px 0;
  border-top: 1px solid var(--border-color);
  color: inherit; text-decoration: none; cursor: pointer;
}
.work-row:first-child { border-top: 2px solid var(--text-main); }
.work-no {
  font-family: var(--font-serif); font-size: 15px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.work-main { min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.work-title {
  font-family: var(--font-serif); font-size: 19px; font-weight: 700;
  line-height: 1.4;
  overflow-wrap: anywhere; word-break: break-word;
  transition: color 0.16s ease;
}
/* 技术签跟在标题后：与文章目录的「分类注脚」同一处理 */
.work-tag {
  margin-left: 12px;
  font-size: 11px; font-weight: 800; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--accent);
}
.work-desc {
  font-size: 13.5px; color: var(--text-muted); line-height: 1.65;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.work-views {
  font-size: 12px; color: var(--text-muted); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* 缩略图只在触屏/窄屏出现；桌面端的图由图版承担 */
.work-thumb { display: none; }

/* 悬停：与文章目录同一语言（左缘砖红短线 + 标题转朱红） */
@media (hover: hover) and (pointer: fine) {
  .work-row::before {
    content: ""; position: absolute; left: -18px; top: 26px; bottom: 26px;
    width: 2px; background: var(--accent);
    transform: scaleY(0); transform-origin: top;
    transition: transform 0.18s var(--ease-out);
  }
  .work-row:hover::before { transform: scaleY(1); }
  .work-row:hover .work-title { color: var(--accent); }
}
.work-row:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }

/* 图版：1px 线 + 10px 纸边，4:3 图，下面一行编号与标题 */
.work-plate { position: sticky; top: 96px; margin: 0; }
.work-plate-imgbox {
  display: block; padding: 10px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
}
.work-plate-img {
  display: block; width: 100%;
  aspect-ratio: 4 / 3; object-fit: cover;
  transition: opacity 0.18s ease;
}
.work-plate-img.swapping { opacity: 0; }
.work-plate-cap {
  display: flex; gap: 12px; align-items: baseline;
  padding: 10px 2px 0;
}
.work-plate-cap b {
  font-family: var(--font-serif); font-size: 15px;
  color: var(--accent); font-variant-numeric: tabular-nums;
}
.work-plate-cap span {
  font-size: 12px; color: var(--text-muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

@media (max-width: 960px) {
  .work-index { grid-template-columns: 1fr; gap: 26px; }
  .work-plate { display: none; }
  /* 无 hover 可用：缩略图直接进行内。网格自动放置会把 img 排到文字后面，
     改用 flex + order 稳排「图 | 文 | 数」 */
  .work-row { display: flex; gap: 14px; align-items: flex-start; }
  .work-no { display: none; }
  .work-thumb {
    display: block; order: -1; flex: 0 0 auto;
    width: 72px; height: 54px; object-fit: cover;
    border: 1px solid var(--border-color);
  }
  .work-main { flex: 1; min-width: 0; }
  .work-views { margin-left: auto; align-self: center; }
}

/* 分页并进模块头部右侧，不再单独占一行 */
.module-header-right { display: flex; align-items: center; gap: 18px; }
.page-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: center;
  font-size: 14px;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.page-btn:hover:not(:disabled) {
  background: var(--text-main); color: var(--bg-color); border-color: var(--text-main);
}
.page-btn:disabled { opacity: 0.3; cursor: not-allowed; }

/* ============================================================
   9. 作者 / 标签
   ============================================================ */
/* 模块头部自带下划线和砖红短线，这里不再叠第二条分隔线，改用留白分节 */

/* ---- 「正在」：一本台账 ----
   内容来自后台「站点设置 → 正在 / NOW」；标题为空的那条整条隐藏。
   上一版是三张等高卡，4 列宽里每张 150px 高、内容只占 70px，上下各留 40px 空白，
   三条加起来还有 28px 卡间距——空是结构造成的，不是字号问题。
   这一版取消卡片壳：一条页眉 + 三条编号记录，用发丝线分节，和左侧无框名片区同语言。
   顺带解决旧问题：只剩 1~2 条时不再有被拉长到 522px 的空盒子。 */
.now-col {
  grid-column: span 4;
  display: flex;
  min-width: 0;
}
.now-panel {
  display: flex; flex-direction: column;
  flex: 1 1 auto;
  width: 100%;
  min-width: 0;
}
/* 不足三条：不再撑满竖栏高度，按内容收口，空白留在栏外而不是盒子内 */
.now-col.is-partial .now-panel { flex: 0 0 auto; }

.now-head {
  display: flex; align-items: center; gap: 12px;
  padding-bottom: 14px;
  border-bottom: 1px solid var(--hairline);
}
.now-heading {
  margin: 0;
  font-family: var(--font-serif);
  font-size: 16px; font-weight: 600;
  letter-spacing: 0.2em;
}
.now-head-rule { flex: 1 1 auto; height: 1px; background: var(--hairline); }
.now-head-en {
  font-family: var(--font-mono);
  font-size: 9.5px; letter-spacing: 0.3em;
  color: var(--text-muted);
}
/* 页眉右端的小红点：表示这一栏是"活着"的，带一圈呼吸扩散 */
.now-live {
  position: relative; flex: none;
  width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent);
  margin-right: 3px;
}
.now-live::after {
  content: ""; position: absolute; inset: -4px;
  border-radius: 50%;
  border: 1px solid var(--accent);
  opacity: 0.45;
}

/* 底部收口：这一条与左侧名片区底边同高，台账才算"画完" */
.now-panel-body {
  display: flex; flex-direction: column; flex: 1 1 auto;
  border-bottom: 1px solid var(--hairline);
}
.now-row {
  position: relative;
  flex: 1 1 0;
  min-height: 108px;
  /* 与右侧印记的间距做成变量：引导虚线要用同一个值做负边距，才刚好顶到圈边 */
  --now-gap: 16px;
  display: flex; align-items: center; gap: var(--now-gap);
  padding: 20px 0;
}
.now-row + .now-row { border-top: 1px solid var(--hairline); }
/* 悬停时长出一条砖红细线，和归档行 / 焦点列表同一个语言 */
.now-row::before {
  content: "";
  position: absolute; left: -12px; top: 50%;
  width: 2px; height: 0;
  background: var(--accent);
  transform: translateY(-50%);
  transition: height 0.28s var(--ease-out);
}

.now-body { flex: 1 1 auto; min-width: 0; }
.now-kicker { display: flex; align-items: baseline; gap: 8px; margin: 0 0 7px; }
/* 目录式引导点：把编号标签牵到右端印记，像纸刊目录的虚线。
   负右边距抵消 .now-row 的 16px 间隙，让点线正好顶到圆圈左缘 */
.now-kicker::after {
  content: "";
  flex: 1 1 auto;
  min-width: 12px;
  height: 1px;
  margin-left: 10px;
  margin-right: calc(-1 * var(--now-gap));
  align-self: center;
  background-image: linear-gradient(90deg, var(--border-color) 0 2px, transparent 2px 5px);
  background-size: 5px 1px;
}
.now-index {
  font-family: var(--font-mono);
  font-size: 11px; letter-spacing: 0.06em;
  color: var(--accent);
  font-weight: 500;
}
.now-label { font-size: 11px; letter-spacing: 0.18em; color: var(--text-muted); }
.now-title {
  margin: 0 0 6px;
  font-family: var(--font-serif);
  font-size: 19px; font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; line-clamp: 2;
  -webkit-box-orient: vertical; overflow: hidden;
}
.now-meta { margin: 0; font-size: 12.5px; line-height: 1.55; color: var(--text-muted); }

/* 右端印记：一枚 36px 细线圈，鼠标悬停时圈与图标一起转砖红 */
.now-mark {
  flex: none;
  width: 36px; height: 36px; border-radius: 50%;
  border: 1px solid var(--border-color);
  display: grid; place-items: center;
  color: var(--text-muted);
  transition: border-color 0.25s, color 0.25s;
}
.now-icon { width: 15px; height: 15px; }

@media (hover: hover) and (pointer: fine) {
  .now-row:hover::before { height: 56%; }
  .now-row:hover .now-mark { border-color: var(--accent); color: var(--accent); }
}

/* 正在听：四条跳动的均衡器柱，暗示"在播" */
.now-eq { display: flex; align-items: flex-end; justify-content: center; gap: 2.5px; height: 16px; }
.now-eq i {
  width: 2px; height: 16px;
  background: var(--accent);
  border-radius: 1px;
  transform-origin: 50% 100%;
  animation: now-eq 1.15s ease-in-out infinite;
}
.now-eq i:nth-child(1) { height: 9px; }
.now-eq i:nth-child(2) { height: 16px; animation-delay: 0.16s; }
.now-eq i:nth-child(3) { height: 12px; animation-delay: 0.32s; }
.now-eq i:nth-child(4) { height: 7px; animation-delay: 0.48s; }
@keyframes now-eq {
  0%, 100% { transform: scaleY(0.45); }
  50% { transform: scaleY(1); }
}

/* 数据回来、摘掉 hidden 的那一刻三条依次落位 */
@media (prefers-reduced-motion: no-preference) {
  .now-col:not([hidden]) .now-row { animation: now-in 0.5s var(--ease-out) both; }
  .now-col:not([hidden]) .now-row:nth-child(2) { animation-delay: 0.07s; }
  .now-col:not([hidden]) .now-row:nth-child(3) { animation-delay: 0.14s; }
  .now-live::after { animation: now-pulse 2.6s var(--ease-out) infinite; }
}
@keyframes now-in {
  from { opacity: 0; transform: translateY(8px); }
  to { opacity: 1; transform: none; }
}
@keyframes now-pulse {
  0% { transform: scale(0.6); opacity: 0.55; }
  70%, 100% { transform: scale(1.5); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .now-eq i { animation: none; }
  .now-live::after { animation: none; opacity: 0.35; }
  .now-row::before { transition: none; }
}

.about-wrapper {
  display: grid; grid-template-columns: 1fr 1fr; gap: 32px;
  margin-top: 44px; align-items: stretch;
}

/* 作者卡：纵向布局，正文在上、社交按钮沉底，和右侧标签卡同高时不留大片空白 */
.author-card-horizontal {
  display: flex; flex-direction: column; justify-content: space-between;
  gap: 24px;
  padding: 32px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.05);
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s, border-color 0.2s;
}
.author-card-horizontal:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.14);
}
.author-card-main { display: flex; align-items: flex-start; gap: 24px; }
.author-avatar-wrap { position: relative; flex: none; }
.author-avatar {
  width: 96px; height: 96px; border-radius: 50%;
  background: linear-gradient(135deg, #7a2a20, #b03a2e);
  border: 4px solid var(--bg-color);
  position: relative; z-index: 1;
  box-shadow: 0 4px 12px rgba(176, 58, 46, 0.28);
}
.author-avatar-wrap::before {
  content: ""; position: absolute; inset: -8px; border-radius: 50%;
  background: linear-gradient(120deg, rgba(176, 58, 46, 0.12), rgba(138, 90, 43, 0.12));
  z-index: 0;
}
.author-info { flex: 1; min-width: 0; }
.author-info h3 { font-family: var(--font-serif); font-size: 22px; margin-bottom: 4px; }
.author-info .role {
  font-size: 12px; font-weight: 700; color: var(--accent);
  letter-spacing: 0.1em; text-transform: uppercase; margin-bottom: 12px;
}
.author-info .bio { font-size: 13.5px; color: var(--text-muted); line-height: 1.8; margin-bottom: 0; }

.author-social { display: flex; gap: 16px; margin-top: auto; }
.author-social a {
  position: relative;
  width: 40px; height: 40px; border-radius: 50%;
  border: 1px solid var(--border-color);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: bold;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
/* 视觉尺寸不变，扩大触控热区到 52×52 */
.author-social a::after {
  content: ""; position: absolute; inset: -6px; border-radius: 50%;
}
.author-social a:hover {
  background: var(--text-main); color: var(--bg-color);
  border-color: var(--text-main);
  transform: translateY(-2px) scale(1.04);
}

.tag-cloud-card {
  padding: 32px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  display: flex; flex-direction: column; justify-content: center;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s, border-color 0.2s;
}
.tag-cloud-card:hover {
  transform: translateY(-2px);
  border-color: var(--accent);
  box-shadow: 0 8px 24px -8px rgba(0, 0, 0, 0.14);
}
.tag-cloud-card h3 {
  font-size: 12px; font-weight: 800;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 20px;
}
.tag-list { display: flex; flex-wrap: wrap; gap: 12px; }

/* 标签胶囊：首页云 / 归档 / 文章底部共用 */
.tag-chip {
  font-family: var(--font-serif); font-size: 14px;
  padding: 8px 16px;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  border-radius: 6px;
  display: inline-flex; align-items: center; gap: 8px;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s, transform 0.2s;
}
.tag-chip:hover {
  background: var(--accent); color: var(--accent-ink);
  border-color: var(--accent); transform: translateY(-2px);
}
.tag-chip .tag-count {
  font-family: var(--font-sans); font-size: 11.5px; font-weight: 700;
  line-height: 1.5;
  color: var(--text-muted);
  /* 用描边色做底，深浅两个主题下都能和标签底分开，避免读成「CSS3」 */
  background: var(--border-color);
  padding: 1px 7px; border-radius: 99px;
}
.tag-chip:hover .tag-count {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
}

/* ============================================================
   10. 归档页
   ============================================================ */
.archive-page { max-width: 1440px; margin: 0 auto; padding: calc(var(--header-h) + 24px) 40px 80px; }
.archive-title { font-family: var(--font-serif); font-size: clamp(28px, 4vw, 40px); margin-bottom: 8px; }
.archive-subtitle { color: var(--text-muted); font-size: 13px; margin-bottom: 32px; }
/* 标签栏：文章页 #articles-filter 与归档页 #archive-tag-bar 共用。
   以前这里自带一条 1px 下边框，往下 40px 又是年份头部的 2px 粗线，
   两条线挤在一起读成"没对齐的双线"。分隔交给年份那条粗线，这里去掉。 */
.archive-tag-bar {
  display: flex; flex-wrap: wrap; row-gap: 10px; column-gap: 8px;
  margin-bottom: 32px;
}
.archive-tag-btn {
  font-size: 13px; padding: 6px 14px; border-radius: 99px;
  border: 1px solid var(--border-color); color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.archive-tag-btn:hover { border-color: var(--accent); color: var(--accent); }
.archive-tag-btn.active { background: var(--text-main); color: var(--bg-color); border-color: var(--text-main); }

.archive-month { margin-bottom: 40px; }
.archive-month-title {
  font-family: var(--font-serif); font-size: 20px; font-weight: 700;
  padding-bottom: 12px; border-bottom: 2px solid var(--text-main);
  margin-bottom: 4px;
}
.archive-item {
  display: flex; align-items: baseline; gap: 20px;
  padding: 16px 0;
  border-bottom: 1px solid var(--border-color);
  transition: padding-left 0.2s ease;
}
.archive-item:hover { padding-left: 8px; }
.archive-item:hover .archive-item-title { color: var(--accent); }
.archive-date { font-family: var(--font-serif); font-size: 13px; color: var(--text-muted); flex: none; width: 56px; }
.archive-item-main { flex: 1; min-width: 0; }
.archive-item-title {
  display: block;
  font-family: var(--font-serif); font-size: 17px; font-weight: 600;
  margin-bottom: 4px; transition: color 0.2s;
}
.archive-item .excerpt { display: block; font-size: 13px; color: var(--text-muted); line-height: 1.6; }
.archive-item .cat {
  display: block;
  font-size: 11px; font-weight: 800; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 2px;
}
.archive-read { font-size: 12px; color: var(--text-muted); flex: none; }
.archive-empty { padding: 60px 20px; text-align: center; color: var(--text-muted); }

/* 归档：年 / 月 两级紧凑索引 */
.arc-year { margin-bottom: 48px; }
.arc-year-head {
  display: flex; align-items: baseline; gap: 14px;
  padding-bottom: 14px; margin-bottom: 6px;
  border-bottom: 2px solid var(--text-main);
}
.arc-year-head h3 {
  font-family: var(--font-serif); font-size: 28px; font-weight: 700;
  letter-spacing: 0.02em; margin: 0;
}
.arc-year-head span { font-size: 12px; color: var(--text-muted); }

.arc-month { display: grid; grid-template-columns: 64px minmax(0, 1fr); }
.arc-month-label {
  font-family: var(--font-serif); font-size: 13px; color: var(--text-muted);
  padding: 15px 0 0 2px;
}
.arc-list { list-style: none; margin: 0; padding: 0; }
.arc-row {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 56px 62px 66px 56px;
  gap: 14px; align-items: baseline;
  padding: 14px 8px 14px 0;
  border-bottom: 1px solid var(--border-color);
  color: inherit;
  transition: background-color 0.18s;
}
.arc-row:hover { background: var(--card-bg); }
.arc-row:hover .arc-title { color: var(--accent); }
.arc-day { font-family: var(--font-mono); font-size: 12px; color: var(--text-muted); }
.arc-title { font-family: var(--font-serif); font-size: 15.5px; line-height: 1.5; }
.arc-cat, .arc-read { font-size: 12px; color: var(--text-muted); }
.arc-stat { font-size: 12px; color: var(--text-muted); text-align: right; white-space: nowrap; }

/* 文章页工具条：搜索左、排序右（对应骨架稿 .toolbar 的 space-between） */
.articles-toolbar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap;
  margin-bottom: 18px;
}
.articles-search {
  /* 上限 600px：以前 flex:1 直接拉到 1136px，搜索框比卡片墙还宽，
     排序按钮被甩到屏幕另一头，两者读起来不再是一组控件 */
  flex: 1 1 260px; min-width: 200px; max-width: 600px;
  display: flex; align-items: center; gap: 10px;
  height: 44px; padding: 0 16px;
  border: 1px solid var(--border-color); border-radius: 99px;
  background: var(--card-bg);
  transition: border-color 0.2s;
}
.articles-search:focus-within { border-color: var(--accent); }
.articles-search svg { width: 16px; height: 16px; color: var(--text-muted); flex: none; }
.articles-search input {
  flex: 1; min-width: 0; border: none; background: transparent; outline: none;
  font-family: var(--font-sans); font-size: 16px; color: var(--text-main);
}
.articles-search input::placeholder { color: var(--text-muted); }

.articles-sort { display: flex; gap: 6px; flex: none; }
.sort-btn {
  font-size: 13px; padding: 7px 14px; border-radius: 99px;
  border: 1px solid var(--border-color); color: var(--text-muted);
  transition: color 0.2s, border-color 0.2s, background-color 0.2s;
}
.sort-btn:hover { border-color: var(--accent); color: var(--accent); }
.sort-btn.active { background: var(--text-main); color: var(--bg-color); border-color: var(--text-main); }

/* 卡片与按钮上的统计数字 */
.ac-stats { display: flex; gap: 12px; }
.ac-stats i { font-style: normal; margin-right: 3px; opacity: 0.7; }
.like-btn b { font-weight: 700; margin-left: 2px; }

/* ============================================================
   10.5 文章页 / 关于页
   ============================================================ */
.article-index {
  display: flex; flex-direction: column;
}

/* 分页：文章多了以后必须有，否则一次渲染几百张卡片 */.pagination {
  display: flex; justify-content: center; align-items: center;
  gap: 6px; margin-top: 40px; flex-wrap: wrap;
}
.pagination[hidden] { display: none; }
.page-num, .page-arrow {
  min-width: 40px; height: 40px; padding: 0 12px;
  display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid var(--border-color); border-radius: var(--radius-md);
  background: var(--card-bg); color: var(--text-secondary);
  font-size: 14px; font-variant-numeric: tabular-nums;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.page-num:hover, .page-arrow:hover:not(:disabled) {
  border-color: var(--accent); color: var(--accent);
}
.page-num[aria-current="page"] {
  background: var(--text-main); color: var(--bg-color); border-color: var(--text-main);
  font-weight: 700;
}
.page-arrow:disabled { opacity: 0.35; cursor: not-allowed; }
.page-ellipsis { color: var(--text-muted); padding: 0 4px; }
.pagination-info { font-size: 12px; color: var(--text-muted); margin-left: 8px; }

/* 404 */
.notfound { text-align: center; padding: 80px 20px 120px; }
.notfound-code {
  font-family: var(--font-serif); font-weight: 900;
  font-size: clamp(80px, 18vw, 180px); line-height: 1;
  color: var(--accent); opacity: 0.18;
  letter-spacing: -0.04em; margin-bottom: -0.18em;
  font-variant-numeric: lining-nums;
}
.notfound .archive-title { margin-bottom: 10px; }
.notfound-actions { display: flex; gap: 10px; justify-content: center; margin-top: 28px; flex-wrap: wrap; }
.notfound-btn {
  padding: 10px 22px; border-radius: 99px;
  border: 1px solid var(--border-color); background: var(--card-bg);
  color: var(--text-secondary); font-size: 14px; font-weight: 600;
  transition: border-color 0.2s, color 0.2s, background-color 0.2s;
}
.notfound-btn:hover { border-color: var(--accent); color: var(--accent); }
.notfound-btn.is-primary {
  background: var(--text-main); color: var(--bg-color); border-color: var(--text-main);
}
.notfound-btn.is-primary:hover { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

@media (max-width: 768px) {
  .pagination { margin-top: 28px; gap: 4px; }
  .page-num, .page-arrow { min-width: 36px; height: 36px; padding: 0 10px; font-size: 13px; }
  .pagination-info { display: none; }
}
/* ---- 目录式索引 ----
   三列等宽卡片墙是最像模板的一块：六张卡结构一模一样，读者只能靠位置找重点。
   改成报纸目录：首条 lead 通栏、压一条 2px 栏线，其余单列行靠 1px 发丝线分层，
   层级只靠字号与留白，不再用容器包起来。 */
.idx-lead {
  display: block; padding: 30px 0 34px;
  border-top: 2px solid var(--text-main);
  color: inherit; text-decoration: none;
}
.idx-kicker {
  font-size: 11px; font-weight: 800; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--accent);
}
.idx-lead h3 {
  font-family: var(--font-serif); font-weight: 700;
  font-size: clamp(24px, 2.6vw, 34px); line-height: 1.3;
  letter-spacing: -0.01em;
  margin: 14px 0 10px;
  overflow-wrap: anywhere; word-break: break-word;
}
.idx-lead p {
  font-size: 15px; line-height: 1.75; color: var(--text-soft);
  max-width: 40em; margin: 0 0 16px;
}
.idx-meta {
  display: flex; flex-wrap: wrap; gap: 16px;
  font-size: 12px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.idx-row {
  position: relative;
  display: grid; grid-template-columns: 76px minmax(0, 1fr) auto;
  gap: 18px; align-items: baseline;
  padding: 20px 0;
  border-top: 1px solid var(--border-color);
  color: inherit; text-decoration: none;
}
.idx-date {
  font-size: 13px; color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}
.idx-title {
  font-family: var(--font-serif); font-size: 17px; font-weight: 700;
  line-height: 1.5; margin: 0;
  overflow-wrap: anywhere; word-break: break-word;
  transition: color 0.16s ease;
}
/* 分类与置顶跟在标题后面：目录里它们是"注脚"，不是另一行 */
.idx-cat {
  margin-left: 12px;
  font-family: var(--sans, sans-serif);
  font-size: 11px; font-weight: 800; letter-spacing: 0.15em;
  text-transform: uppercase; color: var(--accent);
}
.idx-pin {
  display: inline-block; margin-right: 10px; padding: 1px 6px;
  font-size: 10px; font-weight: 800; letter-spacing: 0.1em; line-height: 1.6;
  font-family: var(--sans, sans-serif);
  color: var(--accent); border: 1px solid var(--accent); border-radius: 3px;
  transform: translateY(-2px);
}
.idx-side {
  font-size: 12px; color: var(--text-muted); white-space: nowrap;
  font-variant-numeric: tabular-nums;
}
/* 悬停 / 键盘游标：标题转朱红 + 左缘长出一条砖红短线（与归档行 .arc-row 同一语言）。
   ::before 不关在 hover 查询里：j/k 移动的 .kbd-active 也要能点亮它 */
.idx-row::before {
  content: ""; position: absolute; left: -18px; top: 22px; bottom: 22px;
  width: 2px; background: var(--accent);
  transform: scaleY(0); transform-origin: top;
  transition: transform 0.18s var(--ease-out);
}
@media (hover: hover) and (pointer: fine) {
  .idx-row:hover::before { transform: scaleY(1); }
  .idx-row:hover .idx-title, .idx-lead:hover h3 { color: var(--accent); }
}
.idx-row.kbd-active::before { transform: scaleY(1); }
.idx-row.kbd-active .idx-title, .idx-lead.kbd-active h3 { color: var(--accent); }
.idx-lead.kbd-active { border-top-color: var(--accent); }
.idx-lead:focus-visible, .idx-row:focus-visible {
  outline: 2px solid var(--accent); outline-offset: 4px;
}
@media (max-width: 720px) {
  .idx-row { grid-template-columns: minmax(0, 1fr); gap: 8px; }
  .idx-date { order: 2; }
  .idx-side { order: 3; white-space: normal; }
  .idx-row::before { display: none; }
}

/* 关于页：导语自管行宽，双列与联系区吃满整幅版心。
   以前整页卡在 max-width:900px，而外层版心是 1345px —— 右侧留出一条
   从头贯到尾的 445px 空带，双列卡片只占左半边，读起来像没做完。 */
.about-page { max-width: none; }
.about-lead {
  font-family: var(--font-serif);
  font-size: clamp(17px, 1.7vw, 20px); line-height: 1.95;
  color: var(--text-main);
  /* 导语自己限行宽（约 34 个汉字）：整幅版心撑到 1345px 后，
     一行 40+ 字读起来太累，骨架稿也是让引言窄于双列 */
  max-width: 34em;
  margin-bottom: 20px;
}
.about-contact {
  margin-top: 44px; padding-top: 30px; padding-bottom: 8px;
  border-top: 1px solid var(--border-color);
}
.about-contact h3 { font-family: var(--font-serif); font-size: 18px; margin-bottom: 10px; }
.about-contact p { font-size: 14px; color: var(--text-secondary); line-height: 1.9; max-width: 60em; }
.about-contact a { color: var(--accent); border-bottom: 1px solid currentColor; }

/* 友链页：两列卡片（骨架稿 .friends-grid），24px 块间距 */
.friend-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px; }
.friend-card {
  display: flex; align-items: flex-start; gap: 18px;
  padding: 24px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  background: var(--card-bg);
  color: inherit; text-decoration: none;
  transition: transform 0.2s var(--ease-out), border-color 0.2s;
}
.friend-card:hover { transform: translateY(-2px); border-color: var(--accent); }
.friend-card:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* 头像 44 → 60：44 的一团字在 664px 宽的卡里太小，读不成"头像" */
.friend-avatar {
  flex: none; width: 60px; height: 60px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-family: var(--font-serif); font-size: 24px; font-weight: 700;
  background: var(--text-main); color: var(--bg-color);
}
.friend-body { display: flex; flex-direction: column; gap: 7px; min-width: 0; }
.friend-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.friend-head strong { font-family: var(--font-serif); font-size: 16px; font-weight: 700; }
.friend-head em {
  font-style: normal; font-size: 11px; letter-spacing: 0.12em;
  text-transform: uppercase; color: var(--text-muted);
  border: 1px solid var(--border-color); border-radius: 99px; padding: 1px 8px;
}
.friend-desc { font-size: 13px; color: var(--text-muted); line-height: 1.7; }
.friend-url { font-family: var(--font-mono); font-size: 11.5px; color: var(--accent); }
.friend-note {
  margin-top: 44px; padding-top: 32px;
  border-top: 1px solid var(--border-color);
}
.friend-note h3 { font-family: var(--font-serif); font-size: 18px; margin-bottom: 10px; }
.friend-note p { font-size: 14px; color: var(--text-secondary); line-height: 1.9; max-width: 60em; }
.friend-note a { color: var(--accent); border-bottom: 1px solid currentColor; }

/* ============================================================
   11. 文章详情页：左正文 / 右目录
   ============================================================ */
.article-page {
  /* 与页头、归档、页脚同一套栅格：1440 外框 + 40 内边距 */
  max-width: 1440px; margin: 0 auto;
  padding: calc(var(--header-h) + 32px) 40px 96px;
}
.article-progress-bar {
  position: fixed; top: var(--header-h); left: 0; right: 0; height: 3px;
  background: var(--accent); transform: scaleX(0); transform-origin: 0 50%;
  z-index: 60; pointer-events: none;
}
.article-page-grid {
  display: grid;
  /* 正文加宽到 900，目录保持 280；gap 是下限，宽屏时由 space-between 分配 */
  grid-template-columns: minmax(0, 900px) 280px;
  gap: 48px;
  justify-content: space-between;
  align-items: start;
}
.article-main { min-width: 0; }
.article-back {
  display: inline-block; padding: 6px 0; margin-bottom: 16px;
  font-size: 13px; color: var(--text-muted);
  transition: color 0.2s;
}
.article-back:hover { color: var(--accent); }
/* 默认 780：约 43 字/行，中文回扫错行的舒适上限；窄档 660 在宽度面板里 */
.article-page .article-content { max-width: 780px; margin: 0; }
.article-page .reader-category { display: inline-block; margin-bottom: 16px; }

.article-aside { position: sticky; top: calc(var(--header-h) + 30px); }
.article-aside[aria-hidden="true"] { display: none; }
.article-page-grid:has(.article-aside[aria-hidden="true"]) { grid-template-columns: minmax(0, 1fr); }
.article-aside-inner {
  max-height: calc(100dvh - var(--header-h) - 60px);
  max-height: calc(100vh - var(--header-h) - 60px);
  overflow-y: auto; padding-right: 6px;
}
.aside-head {
  display: flex; align-items: baseline; justify-content: space-between; gap: 10px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--border-color);
}
.aside-head .toc-title { margin: 0; }
.reader-percent {
  font-family: var(--font-mono); font-size: 11px;
  color: var(--text-muted); font-variant-numeric: tabular-nums;
}
/* 目录头下的细进度线：随滚动填充，和阅读进度同一数据源 */
.aside-progress {
  height: 2px; margin-top: 10px;
  background: var(--border-color); border-radius: 2px;
  overflow: hidden;
}
.aside-progress i {
  display: block; height: 100%; width: 0;
  background: var(--accent);
  transition: width 0.15s linear;
}
.aside-tools {
  display: flex; align-items: center; gap: 8px;
  margin-top: 26px;
  padding-top: 16px; border-top: 1px solid var(--border-color);
}
/* 字号 −/+ 合成胶囊对 */
.at-pair {
  display: flex; border: 1px solid var(--border-color);
  border-radius: 99px; overflow: hidden; flex: none;
}
.at-pair .reader-ctrl-btn {
  width: 44px; height: 34px; border-radius: 0; border: 0;
  background: transparent;
}
.at-pair .reader-ctrl-btn + .reader-ctrl-btn { border-left: 1px solid var(--border-color); }
.at-pair .reader-ctrl-btn:hover { transform: none; border-radius: 0; }
/* 栏宽切换：独立圆钮 */
.at-icon { width: 34px; height: 34px; flex: none; }
/* 返回列表：语义化文字钮，靠右 */
.at-back {
  margin-left: auto;
  border: 0; background: none; cursor: pointer;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.08em;
  color: var(--text-muted);
  display: inline-flex; align-items: center;
  transition: color 0.25s;
}
.at-back:hover { color: var(--accent); }

/* ============================================================
   11. 阅读器
   ============================================================ */
.reader-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(18, 16, 15, 0.85);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.4s ease, visibility 0s linear 0.4s;
}
.reader-overlay.active {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 0.4s ease, visibility 0s;
}

.reader-container {
  background: var(--bg-color); color: var(--text-main);
  width: 100%; max-width: 1040px;
  height: 92vh; height: 92dvh;
  border-radius: var(--radius-lg);
  overflow: hidden; position: relative;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.6);
  transform: translateY(30px) scale(0.98);
  transition: transform 0.4s var(--ease-out);
  display: flex; flex-direction: column;
}
.reader-overlay.active .reader-container { transform: translateY(0) scale(1); }

/* 进度条：scaleX 只走合成层 */
.reader-progress-bar {
  position: absolute; top: 0; left: 0;
  width: 100%; height: 3px;
  background: var(--accent);
  transform: scaleX(0); transform-origin: 0 50%;
  z-index: 10;
}

.reader-header {
  position: absolute; top: 0; left: 0; right: 0;
  height: 60px; padding: 0 24px;
  display: flex; justify-content: space-between; align-items: center;
  /* 滚动时正文会从按钮下方穿过，需要更长的实色段加背景模糊，否则文字和控件叠在一起 */
  background: linear-gradient(to bottom, var(--bg-color) 72%, transparent);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  z-index: 5;
}
.reader-header-left { display: flex; align-items: center; gap: 12px; }
.reader-header-right { display: flex; align-items: center; gap: 8px; }

.reader-category {
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--accent); background: var(--card-bg);
  padding: 4px 12px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-color);
}
.reader-percent { font-family: var(--font-serif); font-size: 12px; color: var(--text-muted); min-width: 36px; }

.reader-ctrl-btn {
  width: 32px; height: 32px; border-radius: 50%;
  border: 1px solid var(--border-color); background: var(--card-bg);
  display: flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 700;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.reader-ctrl-btn:hover { background: var(--text-main); color: var(--bg-color); border-color: var(--text-main); }
.reader-close {
  width: 36px; height: 36px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--card-bg); border: 1px solid var(--border-color);
  font-size: 16px;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.reader-close:hover { background: var(--text-main); color: var(--bg-color); border-color: var(--text-main); }
#reader-toc-toggle { display: none; }

.reader-layout { display: flex; flex: 1; overflow: hidden; position: relative; }

/* 目录 */
.toc-sidebar {
  width: 240px; padding: 80px 20px 40px 40px;
  border-right: 1px solid var(--border-color);
  overflow-y: auto; display: none; flex-direction: column; flex: none;
}
.toc-sidebar.active { display: flex; }
.toc-title {
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--text-muted); margin-bottom: 16px;
}
.toc-nav { display: flex; flex-direction: column; }
/* 标题/小标题分级：H2 一级靠左加粗点，H3 缩进缩字弱化；
   当前小节 = 左缘 2px 砖红线 + 加粗 + 前置圆点 */
.toc-link {
  font-size: 13.5px; color: var(--text-secondary);
  padding: 8px 0 8px 14px; cursor: pointer;
  position: relative; line-height: 1.5;
  border-left: 2px solid transparent;
  transition: color 0.25s, border-color 0.25s, padding-left 0.3s var(--ease-out);
}
.toc-link-sub { font-size: 12px; padding-left: 28px; color: var(--text-muted); }
.toc-link:hover { color: var(--text-main); }
.toc-link.active {
  color: var(--text-main); font-weight: 600;
  border-left-color: var(--accent); padding-left: 18px;
}
.toc-link.active::before {
  content: ""; position: absolute; left: 5px; top: 50%; margin-top: -2px;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent);
}
.toc-link-sub.active { font-weight: 600; }
.toc-backdrop { position: absolute; inset: 0; background: rgba(0, 0, 0, 0.45); z-index: 6; display: none; }
.toc-backdrop.show { display: block; }

/* 正文滚动区 */
.reader-scroll-area { flex: 1; overflow-y: auto; padding: 80px 60px 60px; overscroll-behavior: contain; }
.reader-scroll-area::-webkit-scrollbar { width: 8px; }
.reader-scroll-area::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }

.article-content { max-width: 640px; margin: 0 auto; transition: max-width 0.3s ease; }
.article-content h1 {
  font-family: var(--font-serif);
  font-size: clamp(30px, 4vw, 42px);
  line-height: 1.25; font-weight: 700; margin-bottom: 20px;
}
.article-content .article-meta {
  font-size: 12px; color: var(--text-muted);
  margin-bottom: 32px; padding-bottom: 24px;
  border-bottom: 1px solid var(--border-color);
  display: flex; gap: 20px; flex-wrap: wrap;
}
.article-cover {
  /* 320px 的纯色块会把首段推到首屏之外，压到 240 */
  width: 100%; height: 240px;
  border-radius: var(--radius-md);
  background-color: #23231f;
  background-size: cover; background-position: center;
  margin-bottom: 32px;
  position: relative; overflow: hidden;
}
.article-cover img {
  position: absolute; inset: 0;
  width: 100%; height: 100%;
  object-fit: cover; display: block;
}

/* 正文排版 */
.article-body { font-family: var(--font-serif); font-size: 18px; line-height: 1.9; }
.article-body p { margin-bottom: 28px; }
/* 只作用于正文直属首段：原选择器会把引用块/列表里的首段也算进去。
   不再使用浮动放大字——中文等宽字形下 3.8em 的浮动首字会占掉 1.5 行，
   导致第二行只剩两三个字，反而更难读 */
.article-body > p:first-of-type::first-letter {
  color: var(--accent); font-weight: 700;
}
.article-body h2 {
  font-family: var(--font-serif); font-size: 1.33em;
  margin: 40px 0 16px; font-weight: 700;
  scroll-margin-top: 80px;
}
.article-body h3 {
  font-family: var(--font-serif); font-size: 1.12em;
  margin: 32px 0 12px; font-weight: 700;
  scroll-margin-top: 80px;
}
.article-body blockquote {
  margin: 36px 0; padding: 20px 24px;
  background: var(--border-color);
  border-left: 4px solid var(--accent);
  border-radius: 0 6px 6px 0;
  /* 中文没有真正的斜体，浏览器合成倾斜后字形会变形、降低可读性 */
  font-style: normal; font-size: 1em;
}
.article-body blockquote p:last-child { margin-bottom: 0; }
.article-body ul, .article-body ol { margin: 0 0 28px 24px; }
.article-body ul { list-style: disc; }
.article-body ol { list-style: decimal; }
.article-body li { margin-bottom: 8px; }
.article-body img {
  max-width: 100%; border-radius: 6px;
  margin: 24px 0; cursor: zoom-in;
}
.article-body hr { border: none; border-top: 1px solid var(--border-color); margin: 40px 0; }
.article-body a {
  color: var(--accent);
  border-bottom: 1px solid currentColor;
}
.article-body table { width: 100%; border-collapse: collapse; margin: 24px 0; font-size: 0.9em; }
.article-body th, .article-body td { padding: 10px 12px; border-bottom: 1px solid var(--border-color); text-align: left; }
.article-body th { font-weight: 700; }

/* ---- 代码块：与纸媒编辑语言统一，而不是嵌一块终端 ----
   原来的深蓝紫窗口（#1e1e2e + 红黄绿三个 mac 圆点）跟全站的纸白/墨黑/砖红
   完全两套语言，像是从别的网站剪贴进来的。这里改成"印刷品里的代码页"：
   细边框、纸张底色、标题栏只留 Fig 编号与文件名、语法色取自站点色板。 */
.code-window {
  margin: 30px 0;
  border-radius: var(--radius-md);
  overflow: hidden;
  background: var(--code-bg);
  border: 1px solid var(--border-color);
  box-shadow: 0 1px 0 var(--hairline);
}
.code-titlebar {
  display: flex; align-items: center; gap: 12px;
  min-height: 40px; padding: 0 16px;
  background: var(--code-bar);
  border-bottom: 1px solid var(--border-color);
}
/* 三个小方块代替 mac 红绿灯：不再是"另一个系统"的暗示，只是栏首的装饰节拍 */
.code-dots { display: flex; gap: 4px; flex: none; }
.code-dots i {
  display: block; width: 5px; height: 5px; border-radius: 1px;
  background: var(--code-muted); opacity: 0.45;
}
.code-dots i:nth-child(3) { background: var(--accent); opacity: 0.8; }
.code-filename {
  font-family: var(--font-mono);
  font-size: 11.5px; letter-spacing: 0.04em;
  color: var(--code-muted);
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.code-copy-btn {
  margin-left: auto; flex: none;
  background: transparent; color: var(--code-muted);
  border: 1px solid var(--border-color); border-radius: var(--radius-sm);
  font-size: 11px; padding: 4px 10px; letter-spacing: 0.04em;
  font-family: var(--font-sans);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.code-copy-btn:hover { border-color: var(--accent); color: var(--accent); }
.code-copy-btn.copied { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); }

.article-body pre {
  margin: 0;
  padding: 22px 24px;
  background: transparent; color: var(--code-fg);
  border: none; border-radius: 0;
  overflow-x: auto;
  font-family: var(--font-mono);
  font-size: 0.78em; line-height: 1.8;
}
.article-body pre code { background: none; padding: 0; font-size: inherit; color: inherit; }
.article-body code {
  font-family: var(--font-mono); font-size: 0.9em;
  background: var(--border-color);
  padding: 2px 6px; border-radius: var(--radius-sm);
}

.code-footer {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px;
  min-height: 40px; padding: 0 16px;
  border-top: 1px solid var(--border-color);
  font-family: var(--font-sans); font-size: 11px;
  letter-spacing: 0.14em; text-transform: uppercase;
  color: var(--code-muted);
}
.code-badge {
  background: transparent;
  color: var(--accent);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-sm); padding: 2px 8px;
  font-size: 11px; font-weight: 700; letter-spacing: 0.14em;
}

/* 语法高亮：取自站点的砖红 / 墨绿 / 赭石，和正文同属一套印刷色 */
.tok-comment { color: var(--code-muted); font-style: italic; }
.tok-string  { color: var(--tok-string); }
.tok-keyword { color: var(--tok-keyword); font-weight: 600; }
.tok-number  { color: var(--tok-number); }
.tok-fn      { color: var(--tok-fn); }
.tok-tag     { color: var(--tok-tag); }
.tok-attr    { color: var(--tok-attr); }

.body-loading { padding: 40px 0; color: var(--text-muted); font-size: 14px; }

/* 文章底部 */
/* 系列导航：封面之下、正文之前，只在这篇属于某个系列时出现 */
.article-series {
  /* 封面自带 32px 下边距，这里收一点，别让正文被推得太远 */
  margin: -12px 0 26px;
  padding: 14px 16px;
  border: 1px solid var(--border-color);
  border-left: 2px solid var(--accent);
  border-radius: var(--radius-sm);
  background: var(--card-bg);
}
.article-series[hidden] { display: none; }
.as-series-head {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  margin: 0 0 10px; font-size: 13px; color: var(--text-muted);
}
.as-series-label {
  font-family: var(--font-mono); font-size: 10px;
  letter-spacing: 0.18em; text-transform: uppercase; color: var(--accent);
}
.as-series-head b { color: var(--text-main); font-weight: 700; }
.as-series-pos { margin-left: auto; font-variant-numeric: tabular-nums; font-size: 12px; }
.as-series-list { display: flex; flex-direction: column; gap: 6px; }
.as-series-list a {
  font-size: 13px; color: var(--text-secondary);
  text-decoration: none; line-height: 1.5;
  transition: color 0.2s;
}
.as-series-list a:hover { color: var(--accent); }

.article-tags { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 32px; }
.article-tags .tag-chip { font-size: 12px; padding: 4px 12px; border-radius: 99px; }

.article-footer {
  margin-top: 40px; padding-top: 30px;
  border-top: 1px solid var(--border-color);
  /* 两个按钮原本被 space-between 拉到 760px 两端，中间空一大截 */
  display: flex; justify-content: flex-start; align-items: center;
  flex-wrap: wrap; gap: 12px;
}
.article-actions { display: flex; gap: 10px; flex-wrap: wrap; }
.like-btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 16px;
  border: 1px solid var(--border-color); border-radius: 99px;
  font-size: 14px; font-weight: 600;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.like-btn:hover, .like-btn.active {
  background: var(--accent); color: var(--accent-ink); border-color: var(--accent);
}

/* 相关阅读 */
.related-title {
  font-family: var(--font-serif); font-size: 20px;
  margin: 48px 0 20px; padding-top: 32px;
  border-top: 1px solid var(--border-color);
}
.related-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); gap: 16px; }
.related-card {
  display: flex; flex-direction: column; gap: 6px;
  padding: 16px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius-md);
  transition: border-color 0.2s, transform 0.2s;
}
.related-card:hover { border-color: var(--accent); transform: translateY(-2px); }
.related-card .category {
  font-size: 11px; font-weight: 800;
  letter-spacing: 0.15em; text-transform: uppercase;
  color: var(--accent);
}
.related-card h4 { font-family: var(--font-serif); font-size: 15px; line-height: 1.4; }
.related-card .time { font-size: 11px; color: var(--text-muted); }

/* 上一篇 / 下一篇 */
.reader-nav {
  display: flex; justify-content: space-between;
  margin-top: 40px; padding-top: 24px;
  border-top: 1px solid var(--border-color);
  gap: 20px;
}
.reader-nav-btn {
  display: flex; flex-direction: column; gap: 4px;
  padding: 12px;
  border: 1px solid transparent; border-radius: var(--radius-md);
  transition: background-color 0.2s, border-color 0.2s;
  max-width: 45%; text-align: left;
}
.reader-nav-btn:hover { background: var(--card-bg); border-color: var(--border-color); }
.reader-nav-btn.next { text-align: right; align-items: flex-end; margin-left: auto; }
.reader-nav-label {
  font-size: 11px; color: var(--text-muted);
  letter-spacing: 0.1em; text-transform: uppercase;
}
.reader-nav-title {
  font-family: var(--font-serif); font-size: 15px; font-weight: 600;
  color: var(--text-main); line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 1; line-clamp: 1;
  -webkit-box-orient: vertical; overflow: hidden;
  transition: color 0.2s;
}
.reader-nav-btn:hover .reader-nav-title { color: var(--accent); }

/* 评论 */
.comments-section { margin-top: 48px; padding-top: 32px; border-top: 1px solid var(--border-color); }
.comments-section h3 { font-family: var(--font-serif); font-size: 20px; margin-bottom: 16px; }
.comments-placeholder {
  border: 1px dashed var(--border-color); border-radius: var(--radius-md);
  padding: 28px; text-align: center;
  color: var(--text-muted); font-size: 13px; line-height: 1.9;
}
.comments-placeholder code {
  background: var(--border-color); padding: 2px 6px; border-radius: var(--radius-sm);
  font-size: 12px; font-family: var(--font-mono);
}

/* ============================================================
   12. 作品弹窗
   ============================================================ */
.project-overlay {
  position: fixed; inset: 0; z-index: 10000;
  background: rgba(18, 16, 15, 0.7);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
}
.project-overlay.active {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 0.3s ease, visibility 0s;
}
.project-modal {
  background: var(--bg-color);
  width: 100%; max-width: 1000px; max-height: 90dvh; max-height: 90vh;
  border-radius: var(--radius-lg); overflow: hidden; position: relative;
  box-shadow: 0 30px 80px -24px rgba(0, 0, 0, 0.45);
  transform: translateY(40px) scale(0.97);
  transition: transform 0.4s var(--ease-out);
  display: flex; flex-direction: column;
}
.project-overlay.active .project-modal { transform: translateY(0) scale(1); }
.project-close {
  position: absolute; top: 14px; right: 14px; z-index: 10;
  width: 34px; height: 34px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg-color);
  border: 1px solid var(--border-color);
  font-size: 14px; color: var(--text-secondary);
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.project-close:hover { border-color: var(--accent); color: var(--accent); }
.project-scroll-area { overflow-y: auto; display: flex; flex-direction: column; }

/* 封面：从 380px 的大图降成一条"书脊"，没有真实素材时它不再喧宾夺主 */
.project-hero-image {
  width: 100%; height: 168px; flex: none;
  background-size: cover; background-position: center;
  position: relative;
  border-bottom: 1px solid var(--border-color);
}
.project-hero-image::after {
  content: ""; position: absolute; inset: 0;
  background: linear-gradient(to top, rgba(10, 9, 8, 0.34), transparent 70%);
}

/* 正文：左信息 / 右参数，栏线分隔，与全站编辑语言一致 */
.project-body {
  padding: 36px 40px 40px;
  display: grid; grid-template-columns: minmax(0, 1.65fr) minmax(0, 1fr);
  gap: 0;
}
.project-main { padding-right: 36px; min-width: 0; display: flex; flex-direction: column; }
.project-kicker {
  display: flex; align-items: center; gap: 8px;
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.18em;
  text-transform: uppercase; color: var(--accent); margin-bottom: 14px;
}
.project-kicker .pk-sep { color: var(--border-color); }
.project-kicker .pk-fig { color: var(--text-muted); letter-spacing: 0.12em; }
.project-main h2 {
  font-family: var(--font-serif);
  font-size: clamp(26px, 2.6vw, 36px); line-height: 1.22;
  font-weight: 700; margin: 0 0 16px;
}
.project-lead {
  font-family: var(--font-serif);
  font-size: 16px; line-height: 1.85; color: var(--text-secondary);
  margin: 0 0 18px; max-width: 46ch;
}
/* 左栏收尾：把「类型 · 打开次数」这行贴到栏底。
   两栏内容长短不一时（摄像类没有功能清单），空白就落在中间，
   而不是在底部留出一个看起来没做完的洞。 */
.project-facts {
  display: flex; flex-wrap: wrap; gap: 8px;
  font-size: 11.5px; letter-spacing: 0.06em;
  color: var(--text-muted); padding-top: 14px;
  margin-top: auto;
  border-top: 1px solid var(--border-color);
}

/* 功能清单归到左栏正文，右栏只留参数表与按钮：
   否则左栏在导语下方会留出一大片空白，尤其是没有功能项的摄影类作品 */
.project-features-block {
  margin-top: 26px; padding-top: 22px;
  border-top: 1px solid var(--hairline);
}
.project-features-block h5 {
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-muted); margin: 0 0 12px;
}

.project-sidebar {
  border-left: 1px solid var(--border-color);
  padding-left: 36px; min-width: 0;
  display: flex; flex-direction: column; gap: 26px;
}
.project-panel h5 {
  font-size: 11.5px; font-weight: 800; letter-spacing: 0.16em;
  text-transform: uppercase; color: var(--text-muted); margin: 0 0 12px;
}
.pm-list { display: flex; flex-direction: column; }
.pm-row {
  display: flex; justify-content: space-between; align-items: baseline; gap: 14px;
  padding: 7px 0; border-bottom: 1px solid var(--hairline); font-size: 13px;
}
.pm-row:last-child { border-bottom: none; }
.pm-key { color: var(--text-muted); flex: none; }
.pm-val { font-weight: 600; text-align: right; min-width: 0; overflow-wrap: anywhere; }
.pm-features { display: flex; flex-direction: column; gap: 7px; }
.pm-features li {
  font-size: 13px; color: var(--text-secondary);
  display: flex; align-items: baseline; gap: 8px;
}
.pm-features li::before {
  content: ""; flex: none;
  width: 4px; height: 4px; border-radius: 50%;
  background: var(--accent); transform: translateY(-2px);
}
.project-links {
  display: flex; flex-direction: row; gap: 8px;
  margin-top: auto; padding-top: 6px;
}
.project-links a, .project-links button {
  flex: 1 1 0; min-width: 0;
  display: flex; align-items: center; justify-content: center; gap: 6px;
  padding: 11px 10px; border-radius: var(--radius-md);
  font-size: 13px; font-weight: 700; letter-spacing: 0.02em;
  border: 1px solid transparent;
  transition: background-color 0.2s, color 0.2s, border-color 0.2s;
}
.btn-demo { background: var(--text-main); color: var(--bg-color); }
.btn-demo:hover { background: var(--accent); color: var(--accent-ink); }
.btn-ghost {
  background: transparent; color: var(--text-muted);
  border-color: var(--border-color) !important;
}
.btn-ghost:hover { border-color: var(--accent) !important; color: var(--accent); }

@media (max-width: 768px) {
  .project-body { grid-template-columns: minmax(0, 1fr); padding: 26px 22px 30px; }
  .project-main { padding-right: 0; }
  .project-sidebar {
    border-left: none; padding-left: 0; margin-top: 26px; padding-top: 24px;
    border-top: 1px solid var(--border-color);
  }
  .project-hero-image { height: 128px; }
  .project-links { margin-top: 22px; }
}

/* ============================================================
   13. 全站搜索
   ============================================================ */
.search-overlay {
  position: fixed; inset: 0; z-index: 10005;
  background: rgba(18, 16, 15, 0.6);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 12vh 20px 20px;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.25s, visibility 0s linear 0.25s;
}
.search-overlay.active {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 0.25s, visibility 0s;
}
.search-panel {
  width: 100%; max-width: 620px;
  background: var(--card-bg);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  box-shadow: 0 30px 80px -20px rgba(0, 0, 0, 0.4);
  overflow: hidden;
  transform: translateY(-12px);
  transition: transform 0.25s;
}
.search-overlay.active .search-panel { transform: translateY(0); }
.search-input-wrap {
  display: flex; align-items: center; gap: 12px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-color);
}
.search-input-wrap svg { width: 18px; height: 18px; color: var(--text-muted); flex: none; }
.search-input-wrap input {
  flex: 1; min-width: 0;
  border: none; background: transparent; outline: none;
  font-size: 17px; color: var(--text-main); font-family: var(--font-serif);
}
.search-input-wrap input::placeholder { color: var(--text-muted); opacity: 0.7; }
.search-kbd {
  font-size: 11px; padding: 2px 8px; border-radius: var(--radius-sm);
  border: 1px solid var(--border-color); color: var(--text-muted); flex: none;
}
.search-results { max-height: 52vh; overflow-y: auto; padding: 8px; }
.search-results::-webkit-scrollbar { width: 6px; }
.search-results::-webkit-scrollbar-thumb { background: var(--border-color); border-radius: 4px; }
.search-empty { padding: 36px 20px; text-align: center; color: var(--text-muted); font-size: 14px; line-height: 1.7; }
.search-empty-sub { display: inline-block; margin-top: 6px; font-size: 12px; color: var(--text-muted); opacity: 0.75; }
/* 正文命中：meta 行放的是长摘录，允许换行、字号略小、关键字高亮沿用 mark 样式 */
.search-result.has-excerpt .sr-meta span:last-child {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.55;
}
.search-result {
  display: flex; flex-direction: column; gap: 3px;
  padding: 10px 14px; border-radius: var(--radius-md);
  cursor: pointer; width: 100%; text-align: left;
}
.search-result.active, .search-result:hover { background: var(--border-color); }
.search-result .sr-title { font-family: var(--font-serif); font-size: 15px; line-height: 1.4; }
.search-result .sr-title mark {
  background: rgba(176, 58, 46, 0.18); color: var(--accent);
  padding: 0 2px; border-radius: 2px;
}
.search-result .sr-meta { font-size: 11px; color: var(--text-muted); display: flex; gap: 12px; align-items: baseline; }
.search-result .sr-badge {
  font-weight: 700; color: var(--accent); text-transform: uppercase; letter-spacing: 0.12em;
  flex: none; white-space: nowrap;  /* 「正文」两个字不能被挤成竖排 */
}
.search-hint {
  padding: 10px 20px;
  border-top: 1px solid var(--border-color);
  font-size: 11px; color: var(--text-muted);
  display: flex; gap: 16px; flex-wrap: wrap;
}
.search-hint kbd { font-family: inherit; border: 1px solid var(--border-color); border-radius: 3px; padding: 0 4px; }

/* ============================================================
   14. 灯箱 / 回到顶部 / Toast
   ============================================================ */
.lightbox {
  position: fixed; inset: 0; z-index: 10003;
  background: rgba(0, 0, 0, 0.94);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; visibility: hidden; pointer-events: none;
  transition: opacity 0.3s ease, visibility 0s linear 0.3s;
  cursor: zoom-out;
}
.lightbox.active {
  opacity: 1; visibility: visible; pointer-events: auto;
  transition: opacity 0.3s ease, visibility 0s;
}
.lightbox-img { max-width: 92vw; max-height: 88vh; object-fit: contain; border-radius: 6px; }
.lightbox-close {
  position: absolute; top: 24px; right: 24px;
  width: 40px; height: 40px; border-radius: 50%;
  background: rgba(255, 255, 255, 0.12); color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.2);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px;
}

.back-to-top-wrap {
  position: fixed; bottom: 30px; right: 30px;
  width: 48px; height: 48px;
  cursor: pointer; z-index: 9000;
  opacity: 0; pointer-events: none;
  /* 隐藏态必须同时摘掉可见性：opacity:0 不会把元素移出 Tab 序列，
     键盘用户会停在一个完全透明的按钮上（焦点黑洞）。 */
  visibility: hidden;
  transform: translateY(20px);
  transition: opacity 0.3s var(--ease-out),
              transform 0.3s var(--ease-out),
              visibility 0s linear 0.3s;
}
.back-to-top-wrap.show {
  opacity: 1; pointer-events: auto; transform: translateY(0);
  visibility: visible;
  transition: opacity 0.3s var(--ease-out),
              transform 0.3s var(--ease-out),
              visibility 0s;
}
.back-to-top-svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.back-to-top-circle-bg { fill: var(--text-main); stroke: none; }
.back-to-top-circle-progress {
  fill: none; stroke: var(--accent); stroke-width: 4;
  stroke-linecap: round;
  stroke-dasharray: 138.2; stroke-dashoffset: 138.2;
  transition: stroke-dashoffset 0.1s linear;
}
.back-to-top-icon {
  position: absolute; inset: 0;
  display: flex; align-items: center; justify-content: center;
  color: var(--bg-color); font-size: 18px; font-weight: bold;
}

.toast-container {
  position: fixed; bottom: 100px; left: 50%;
  transform: translateX(-50%);
  z-index: 10006;
  display: flex; flex-direction: column; gap: 8px;
  pointer-events: none;
}
.toast {
  background: var(--text-main); color: var(--bg-color);
  padding: 12px 24px; border-radius: var(--radius-md);
  font-size: 14px;
  box-shadow: 0 10px 30px -10px rgba(0, 0, 0, 0.3);
  animation: toastIn 0.3s var(--ease-out);
  transition: opacity 0.3s ease, transform 0.3s ease;
}
.toast-out { opacity: 0; transform: translateY(8px); }
@keyframes toastIn {
  from { opacity: 0; transform: translateY(20px); }
  to { opacity: 1; transform: translateY(0); }
}

/* ============================================================
   15. 页脚（质感纵深版：水印 / 光晕 / 噪点 / 视差 + 品牌柱 + 三列链接）
   ============================================================ */
.mag-footer {
  position: relative;
  overflow: hidden;
  /* 页脚自身已有上内边距，外面再压 80px 会形成大片空带 */
  margin-top: 40px;
  background-color: var(--dark-bg);
  color: var(--dark-text);
  border-top: 1px solid var(--footer-hair);
  box-shadow: inset 0 1px 0 var(--footer-hair);
  transition: background-color 0.4s ease, color 0.4s ease;
}
/* 巨大水印：只露一个 "EZ"，随鼠标反向视差（fx.js 驱动），拉开空间纵深 */
.footer-watermark {
  position: absolute;
  top: -14%; right: -3%;
  font-family: Georgia, "Times New Roman", var(--font-serif);
  font-size: clamp(220px, 30vw, 460px);
  font-weight: 700;
  line-height: 1;
  color: var(--footer-wm-c);
  opacity: var(--footer-wm-o);
  pointer-events: none;
  user-select: none;
  z-index: 0;
  will-change: transform;
  transition: transform 0.25s ease-out;
}
/* 呼吸光晕：圆心跟随鼠标（--mx/--my 由 fx.js 写入），像深处有一盏灯 */
.footer-glow {
  position: absolute; inset: 0;
  pointer-events: none; z-index: 1;
  background: radial-gradient(circle 760px at var(--mx, 20%) var(--my, 82%), var(--footer-glow), transparent 65%);
  animation: footer-breathe 12s ease-in-out infinite alternate;
}
@keyframes footer-breathe {
  0% { opacity: 0.55; }
  100% { opacity: 1; }
}
/* 颗粒噪点：给深色块一点纸张的呼吸 */
.mag-footer::after {
  content: "";
  position: absolute; inset: 0;
  pointer-events: none; z-index: 10;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='fn'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='4' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23fn)'/%3E%3C/svg%3E");
  opacity: 0.05;
  mix-blend-mode: overlay;
}
[data-palette="minimal"] .mag-footer::after { mix-blend-mode: multiply; opacity: 0.04; }

.footer-inner {
  position: relative; z-index: 5;
  max-width: 1440px; margin: 0 auto;
  padding: 72px 40px 30px;
  will-change: transform;
  transition: transform 0.25s ease-out;
}
.fg-main {
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr 1fr;
  gap: 40px;
  padding-bottom: 64px;
}

.fg-brand { display: flex; flex-direction: column; align-items: flex-start; }
.fg-logo {
  font-family: var(--font-serif);
  font-size: 30px; font-weight: 700; letter-spacing: -0.01em;
  color: var(--footer-logo);
  display: inline-flex; align-items: center; gap: 12px;
  margin-bottom: 22px;
}
/* 品牌名前的小灯：整块页脚唯一“活着”的信号，颜色跟主题强调色 */
.fg-logo::before {
  content: "";
  width: 8px; height: 8px; border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 12px var(--accent);
  opacity: 0.85;
  flex: none;
}
.fg-desc {
  max-width: 30ch;
  font-size: 14px; line-height: 1.95;
  color: var(--dark-text);
}
.fg-mail {
  margin-top: 22px;
  font-family: var(--font-mono);
  font-size: 13px; letter-spacing: 0.02em;
  color: var(--footer-muted);
  transition: opacity 0.3s ease, color 0.3s ease;
}
.fg-mail:hover { opacity: 0.65; color: var(--dark-text); }

.fg-col { border-left: 1px solid var(--footer-hair); padding-left: 26px; }
.fg-col h4 {
  font-family: var(--font-mono);
  font-size: 11px; font-weight: 700;
  letter-spacing: 0.24em; text-transform: uppercase;
  color: var(--footer-faint);
  margin-bottom: 22px;
}
.fg-col ul { list-style: none; display: flex; flex-direction: column; gap: 15px; }
.fg-col a {
  position: relative;
  display: inline-block;
  font-size: 14px;
  color: var(--footer-muted);
  padding-bottom: 2px;
  transition: color 0.35s ease, transform 0.35s ease;
}
.fg-col a::after {
  content: "";
  position: absolute; left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor; opacity: 0.4;
  transform: scaleX(0); transform-origin: left;
  transition: transform 0.45s cubic-bezier(0.2, 0.8, 0.2, 1);
}
.fg-col a:hover { color: var(--dark-text); transform: translateX(4px); }
.fg-col a:hover::after { transform: scaleX(1); }

.fg-bottom {
  display: flex; justify-content: space-between; align-items: center;
  gap: 14px 24px; flex-wrap: wrap;
  padding-top: 26px;
  border-top: 1px solid var(--footer-hair);
  font-size: 12px; color: var(--footer-faint);
}
.fg-quiet {
  font-family: var(--font-serif); font-style: italic;
  font-size: 13px; letter-spacing: 0.06em;
  opacity: 0.8;
}
.fg-legal { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.fg-legal a {
  display: inline-flex; align-items: center; gap: 5px;
  color: var(--footer-faint);
  transition: color 0.25s ease;
}
.fg-legal a:hover { color: var(--dark-text); }
.f-time { font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.12em; }
.beian-icon {
  width: auto;
  height: 16px;
  display: block;
  flex: none;
}
/* ============================================================
   16. 响应式
   ============================================================ */
@media (max-width: 1200px) {
  .mag-grid { gap: 32px; padding: 32px 32px 64px; }
  .header-inner { padding: 0 32px; }
  .magazine-container { padding: 0 32px; }
  .archive-page { padding-left: 32px; padding-right: 32px; }
  .footer-inner { padding-left: 32px; padding-right: 32px; }
}

/* 正文 760 + 目录 280 放不下时折成单列。
   目录改成横向滑动条，否则一屏全是目录，正文要滑很久才出现 */
@media (max-width: 1100px) {
  /* minmax(0,1fr)：不让 nowrap 的目录把轨道撑破 */
  .article-page-grid { grid-template-columns: minmax(0, 1fr); gap: 24px; }
  .article-aside { position: static; order: -1; min-width: 0; }
  .article-aside-inner { max-height: none; overflow: visible; min-width: 0; }

  .toc-nav {
    flex-direction: row; gap: 8px;
    overflow-x: auto; overscroll-behavior-x: contain;
    border-left: none; padding-bottom: 4px;
    scrollbar-width: none;
  }
  .toc-nav::-webkit-scrollbar { display: none; }
  .toc-link {
    flex: none; white-space: nowrap;
    padding: 6px 12px;
    border: 1px solid var(--border-color);
    border-radius: 99px;
    background: var(--card-bg);
  }
  .toc-link::before { display: none; }
  .toc-link.active {
    background: var(--accent); border-color: var(--accent); color: var(--accent-ink);
  }
  .toc-link-sub { padding-left: 12px; }

  .aside-tools { margin-top: 0; padding-top: 0; border-top: none; }
  .article-content .article-meta { gap: 12px; }

  /* 侧栏折成横条后，数据块收成一行三格，轴保留 */
  .article-stat-card { margin-top: 14px; padding-top: 14px; }
  .as-grid { gap: 6px; }
  .as-cell { padding: 8px 10px; }
  .as-cell b { font-size: 14px; }
  .as-axis { height: 34px; }
}

@media (max-width: 1024px) {
  .hero-block { grid-column: span 12; }
  .hero-feature { min-height: 420px; }
  .briefs-col { grid-column: span 12; margin-top: 20px; }
  /* 焦点大图折成整行后，展示区跟着占满，右侧不再留空 */
  .about-teaser { grid-column: span 12; }
  /* 平板上「正在」折成整行，仍是竖排台账：
     三列并排会把 19px 的标题挤成三行，反而不如一条一条读。
     注意 flex 基线要从 1 改 0：竖栏在这一档不再是固定高度，
     继续用 flex:1 1 0 会把三条压成 0 高、文字叠在一起。 */
  .now-col { grid-column: span 12; }
  .now-panel { flex: 0 0 auto; }
  .now-row { flex: 0 0 auto; min-height: 0; padding: 18px 0; }
  /* 折成整行后不再需要内部滚动：否则手机上会出现"页面滚动 + 列表内滚动"的双层滚动，
     手指在列表上滑不动页面，是最典型的移动端体验事故 */
  .brief-list-container { max-height: none; min-height: 0; overflow-y: visible; }
  .about-wrapper { grid-template-columns: 1fr; }
  .article-page { padding-left: 32px; padding-right: 32px; }
  /* 页脚四列收成两列，品牌柱独占一行 */
  .fg-main { grid-template-columns: 1fr 1fr; gap: 44px 32px; }
  .fg-brand { grid-column: 1 / -1; }
  .project-body { grid-template-columns: 1fr; }
  .project-sidebar {
    border-left: none; padding-left: 0;
    border-top: 1px solid var(--border-color); padding-top: 24px;
  }
  #reader-toc-toggle { display: flex; }
  #width-toggle { display: none; }
  .toc-sidebar.active {
    position: absolute; left: 0; top: 0; bottom: 0;
    width: 280px; padding: 80px 20px 40px 24px;
    background: var(--bg-color);
    border-right: 1px solid var(--border-color);
    display: flex;
    transform: translateX(-100%);
    transition: transform 0.3s ease;
    z-index: 7;
    box-shadow: 4px 0 20px rgba(0, 0, 0, 0.15);
  }
  .toc-sidebar.mobile-open { transform: translateX(0); }
  .main-nav { gap: 24px; }
}

@media (max-width: 768px) {
  .header-inner { padding: 0 20px; }
  .main-nav { display: none; }
  /* 窄屏保证操作区不溢出：图标按钮收紧 */
  .header-actions { gap: 6px; flex: none; }
  .magazine-container { padding-left: 20px; padding-right: 20px; }
  .mag-grid { padding: 24px 20px 60px; gap: 24px; }
  .archive-page { padding-left: 20px; padding-right: 20px; }
  .article-page { padding: calc(var(--header-h) + 20px) 20px 72px; }

  /* 页脚：水印收小、去掉列边线，底栏竖排 */
  .footer-inner { padding: 56px 20px 24px; }
  .fg-main { gap: 36px 20px; }
  .fg-col { border-left: none; padding-left: 0; }
  .fg-bottom { flex-direction: column; align-items: flex-start; gap: 12px; }
  .fg-legal { flex-direction: column; align-items: flex-start; gap: 8px; }
  .fg-quiet { display: none; }

  .hero-feature { min-height: 340px; }

  /* 窄屏收起英文小标，给分页腾出位置 */
  .module-header-right { gap: 10px; }
  .module-header-right > span { display: none; }

  .friend-grid { grid-template-columns: 1fr; }
  .mag-footer-inner { grid-template-columns: 1fr; }

  .reader-container { height: 100vh; height: 100dvh; max-width: 100%; border-radius: 0; }
  .reader-scroll-area { padding: 70px 20px 40px; }
  .reader-header { padding: 0 12px; }
  /* 窄屏封面只留一条色带，别把首段顶出首屏 */
  .article-cover { height: 120px; margin-bottom: 20px; }
  .reader-percent { display: none; }
  .reader-nav-btn { max-width: 48%; }

  /* 筛选已在侧栏头部：窄屏只缩 chip，汇总数保留 */
  .filter-chip { font-size: 12px; padding: 5px 10px; }

  .archive-date { display: none; }
  .archive-read { display: none; }

  /* 归档索引：窄屏只留日期、标题、喜欢 */
  .arc-month { grid-template-columns: 1fr; }
  .arc-month-label { padding: 12px 0 4px; }
  .arc-row { grid-template-columns: 30px minmax(0, 1fr) 52px; gap: 10px; }
  .arc-cat, .arc-read, .arc-views { display: none; }

  .articles-toolbar { gap: 10px; }
  .articles-search { flex: 1 1 100%; max-width: none; }
  /* 排序按钮在窄屏不给搜索框让位，直接换行铺满一行 */
  .articles-sort { flex-wrap: wrap; }

  /* 单列后每张卡独占一行，"统一高度 236px"失去意义——
     摘要只有两行时，卡片底下会空出一大块。改回按内容高度。 */
}

@media (max-width: 600px) {
  /* 卡片内边距收紧：24px 在 335px 宽的手机上会把正文挤成窄条 */
  .friend-card { padding: 20px; gap: 14px; }
  .friend-avatar { width: 52px; height: 52px; font-size: 21px; }
  .friend-grid { gap: 16px; }
  .about-wrapper { gap: 20px; margin-top: 32px; }
  .about-contact { margin-top: 32px; padding-top: 26px; }
  .archive-tag-bar { margin-bottom: 24px; }
  .articles-search { height: 42px; }
}

@media (max-width: 480px) {
  .header-actions { gap: 8px; }
  /* 五项元信息排成整齐的两列，不留孤零零的一行 */
  .article-content .article-meta {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 8px 12px;
  }
  .author-card-main { flex-direction: column; text-align: center; }
  .author-info .bio { margin-bottom: 0; }
  .author-social { justify-content: center; }
  .project-body { padding: 24px; }
  .project-hero-image { height: 240px; }
  .article-actions { width: 100%; }
  .like-btn { flex: 1; justify-content: center; }
}

/* ============================================================
   17. 动效偏好 / 打印
   ============================================================ */
/* 滚动进场。
   旧写法是一条页面加载就跑的 CSS 动画：目标元素几乎都在首屏以下，
   等滚到那里动画早播完了，等于没有。现在由 fx.js 的 IntersectionObserver
   加 .in 触发；.js-reveal 由脚本自己打上——脚本没加载时内容默认可见，
   不会出现「整页空白」。 */
.js-reveal .fade-in {
  opacity: 0;
  transform: translateY(22px);
  transition: opacity 0.75s var(--ease-out), transform 0.75s var(--ease-out);
}
.js-reveal .fade-in.in { opacity: 1; transform: none; }

/* 卡片进场：这两个列表每次渲染都是新节点，动画自然重播，
   不需要额外的观察器 */
@media (prefers-reduced-motion: no-preference) {
  .idx-lead, .idx-row, .work-row, .friend-card {
    animation: cardIn 0.5s var(--ease-out) both;
  }
}
@keyframes cardIn {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: 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;
  }
  .js-reveal .fade-in { opacity: 1; transform: none; }
  .hero-feature:hover,
  .tag-chip:hover,
  .related-card:hover { transform: none; }
  .reader-container,
  .reader-overlay.active .reader-container { transform: none; }
}

/* 打印：只留正文 */
@media print {
  /* 打印时不该出现的交互外壳：页头、首屏、侧栏、工具条、评论、上下篇、相关、页脚、浮层。
     注意类名必须和当前 DOM 对得上（文章页已从 .reader-* 改成 #view-article / .article-aside），
     写错选择器的结果是"这些块照样被打出来"，所以下面按真实结构逐条列。 */
  .minimal-header, .fullscreen-hero, .briefs-col,
  .showcase-section, .mag-footer,
  .article-aside, .article-aside-inner,
  .aside-tools, .article-stat-card,
  .article-back, .reader-nav, .comments-section,
  .article-footer, #reader-related, .related-title, .related-grid,
  .back-to-top-wrap, .toast-container, .skip-link,
  .article-progress-bar, .article-tags,
  .search-overlay, .project-modal, .lightbox, .reader-toc-drawer { display: none !important; }

  /* 文章页在打印下要"摊平"：屏幕上是 sticky 侧栏 + 内滚容器，
     打印时必须变成普通文档流，否则内容会被裁在第一页。 */
  .article-page-grid {
    display: block !important;
    gap: 0 !important;
  }
  .article-main, #reader-scroll {
    overflow: visible !important;
    height: auto !important;
    max-height: none !important;
  }
  .article-page .article-content { max-width: none !important; }

  html, body {
    background: #fff !important;
    color: #000 !important;
    background-image: none !important;  /* 去掉纸张噪点纹理，省墨 */
  }

  /* 打印稿的抬头：标题 + 一行元信息 + 一条细线，像论文排版 */
  .article-page .article-content::before {
    content: "THE EZMARELAN BLOG";
    display: block;
    font-size: 9pt;
    letter-spacing: 3px;
    color: #666;
    border-bottom: 1px solid #ccc;
    padding-bottom: 6pt;
    margin-bottom: 14pt;
  }

  .article-content h1 {
    font-size: 22pt !important;
    line-height: 1.3 !important;
    margin: 0 0 8pt !important;
    color: #000 !important;
  }
  .article-meta {
    font-size: 9pt !important;
    color: #555 !important;
    border-bottom: 1px solid #e0e0e0;
    padding-bottom: 8pt;
    margin-bottom: 14pt !important;
    display: block !important;   /* 屏幕上可能是 flex，打印下按行内流排 */
  }
  .article-meta span { display: inline !important; margin-right: 12pt; }
  /* 阅读数/喜欢数在纸面上没有意义 */
  #reader-views, #reader-likes { display: none !important; }

  .article-cover {
    display: block !important;
    height: 120pt !important;
    margin: 0 0 14pt !important;
    background: #f2f2f2 !important;   /* 灰底代替深色图，省墨且不糊 */
    border: 1px solid #ddd;
  }

  .article-body { font-size: 10.5pt !important; line-height: 1.65 !important; color: #000 !important; }
  .article-body h2 { font-size: 14pt !important; margin: 16pt 0 6pt !important; page-break-after: avoid; }
  .article-body h3 { font-size: 12pt !important; margin: 12pt 0 5pt !important; page-break-after: avoid; }
  .article-body p { orphans: 3; widows: 3; }
  .article-body img { max-width: 100% !important; page-break-inside: avoid; }

  /* 代码块：白底黑字 + 细框，保留行号但不要深色背景 */
  .code-window { border: 1px solid #ccc !important; background: #fff !important; page-break-inside: avoid; }
  .code-titlebar, .code-footer, .code-copy-btn { display: none !important; }
  .article-body pre, .article-body code {
    background: #f7f7f7 !important;
    color: #000 !important;
    border: 1px solid #e0e0e0;
  }
  .article-body pre { white-space: pre-wrap !important; word-break: break-word; }
  .article-body .tok-keyword, .article-body .tok-string, .article-body .tok-number,
  .article-body .tok-fn, .article-body .tok-tag, .article-body .tok-attr { color: #000 !important; }

  /* 链接：正文里的外部链接把 URL 打出来，纸面上才点得到 */
  .article-body a { color: #000 !important; border-bottom: none !important; }
  .article-body a[href^="http"]::after { content: " (" attr(href) ")"; font-size: 0.82em; color: #666; }

  /* 引用块与表格的打印形态 */
  .article-body blockquote {
    border-left: 2pt solid #999 !important;
    background: none !important;
    padding-left: 10pt !important;
    color: #333 !important;
  }
  .article-body table { border-collapse: collapse; width: 100%; font-size: 9pt; }
  .article-body th, .article-body td { border: 1px solid #ccc !important; padding: 4pt 6pt !important; }

  /* 页脚统一打一条来源信息（浏览器打印页眉页脚之外的一层保障） */
  .article-page::after {
    content: "blog.lysoda.top · Ezmarelan";
    display: block;
    font-size: 8pt;
    color: #888;
    border-top: 1px solid #ddd;
    margin-top: 18pt;
    padding-top: 6pt;
  }

  @page { margin: 16mm 14mm; }
}

/* ============================================================
   窄屏适配修正（320–768px）
   ------------------------------------------------------------
   1) 搜索面板：input 是 flex 子项，默认 min-width:auto 不肯收缩，
      加上 svg + Esc 徽标，320px 下整块要 352px，右侧被裁 74px。
   2) 热力图：52 周 × 7 天的网格，光 gap 就要 255px，
      塞进 280px 的卡片必然溢出，改成横向滚动。
   （首屏标题的窄屏规则已并入第 5 节，这里的 SVG 兜底随液态标题一起删掉）
   ============================================================ */
@media (max-width: 768px) {
  /* —— 1. 搜索面板 —— */
  .search-overlay { padding: 8vh 12px 12px; }
  .search-input-wrap { padding: 14px 16px; gap: 10px; }
  .search-input-wrap svg { width: 16px; height: 16px; }
  .search-kbd { display: none; }          /* 手机没有键盘，Esc 徽标无意义且占宽 */
  .search-hint { padding: 8px 16px; gap: 10px; font-size: 11.5px; }
  .search-result { padding: 10px 10px; }
  .search-results { max-height: 60vh; }

  /* —— 2. 热力图 —— */
  .tz-cal { overflow-x: auto; overflow-y: hidden; scrollbar-width: none; -ms-overflow-style: none; }
  /* 「正在」在手机上收紧：标题降一号、留白减小，三条仍竖排 */
  .now-row { padding: 16px 0; --now-gap: 12px; }
  .now-title { font-size: 17px; }
  .now-mark { width: 32px; height: 32px; }
  .tz-cal::-webkit-scrollbar { display: none; }
  .tz-weekdays { display: none; }         /* 空间不足，隐藏星期标签 */
  .tz-grid { flex: none; grid-auto-columns: 14px; gap: 4px; }
  .tz-cell { width: 14px; height: 14px; aspect-ratio: auto; }
  .tz-months { margin-left: 0; }
}
/* ============================================================
   18. 滚动状态与细节打磨
   ------------------------------------------------------------
   这一节定义「页面在动」的四个外部信号：顶部进度线、页头浮起、
   卡片抬起、链接下划线。都写在文件末尾，靠后定义覆盖前面的同名属性。
   ============================================================ */

/* --- 阅读进度线：钉在视口最上沿 ---
   和文章页那条（fixed; top: var(--header-h)，读正文内滚容器）分工明确：
   这条读的是窗口滚动，两者不同时出现。 */
.top-progress {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 2px;
  background: var(--accent);
  transform: scaleX(0);
  transform-origin: 0 50%;
  z-index: 1100;
  pointer-events: none;
  will-change: transform;
}
html.is-article .top-progress { opacity: 0; }

/* --- 页头：滚过首屏后从「盖在纸上」变成「浮在纸上」 --- */
.minimal-header {
  transition: background 0.35s ease, box-shadow 0.35s ease, border-color 0.35s ease;
}
.scrolled .minimal-header {
  background: rgba(var(--bg-rgb), 0.94);
  box-shadow: 0 1px 0 var(--hairline), 0 14px 34px -28px rgba(0, 0, 0, 0.6);
}

/* --- 卡片：抬起时给一点投影，不然只有一条边框变色，读不出「浮起」 --- */
.friend-card {
  transition: transform 0.24s var(--ease-out), border-color 0.24s,
              box-shadow 0.32s var(--ease-out), background-color 0.24s;
}
@media (hover: hover) and (pointer: fine) {
  .friend-card:hover {
    box-shadow: 0 20px 40px -30px rgba(0, 0, 0, 0.55);
  }
}

/* --- 焦点文章：悬停时压暗一层，而不是整块位移（它太大，位移会晃） --- */
.hero-feature::before { transition: opacity 0.5s ease; }

/* --- 段落断行：中文标点不再被甩到上一行末尾 --- */
.idx-lead p,
.hero-caption p,
.about-lead,
.article-body p,
.friend-note p,
.hero-lede {
  text-wrap: pretty;
}

/* --- 归档行：悬停时左侧长出一条砖红线，和焦点列表同一个语言 --- */
.arc-row { position: relative; }
.arc-row::before {
  content: "";
  position: absolute;
  left: 0; top: 50%;
  width: 2px; height: 0;
  background: var(--accent);
  transform: translateY(-50%);
  transition: height 0.24s var(--ease-out);
}
.arc-row:hover::before { height: 68%; }
