/* =========================================================
   Portfolio — Swiss / International Typographic Style
   ========================================================= */

/* ---------- Fonts ---------- */
/* 字体文件随网站一起存放在 assets/fonts（与参考稿相同的文件），不依赖外部字体服务
   英文标题 / 大数字：TeX Gyre Adventor Bold；正文：Switzer Regular / Medium / Bold */
@font-face {
  font-family: "TeX Gyre Adventor";
  font-style: normal;
  font-weight: 700;
  font-display: swap;
  src: url("../fonts/texgyreadventor-bold.woff2") format("woff2"), url("../fonts/texgyreadventor-bold.otf") format("opentype");
}
@font-face {
  font-family: "TeX Gyre Adventor";
  font-style: normal;
  font-weight: 400;
  font-display: swap;
  src: url("../fonts/texgyreadventor-regular.woff2") format("woff2"), url("../fonts/texgyreadventor-regular.otf") format("opentype");
}
@font-face {
  font-family: "Switzer";
  font-style: normal;
  font-weight: 400;
  font-display: block;
  src: url("../fonts/switzer-regular.woff2") format("woff2");
}
@font-face {
  font-family: "Switzer";
  font-style: normal;
  font-weight: 500;
  font-display: block;
  src: url("../fonts/switzer-medium.woff2") format("woff2");
}
@font-face {
  font-family: "Switzer";
  font-style: normal;
  font-weight: 700;
  font-display: block;
  src: url("../fonts/switzer-bold.woff2") format("woff2");
}

/* ---------- Tokens ---------- */
:root {
  /* 9 级灰阶：#f5f5f7 → #1d1d1f 线性插值（每级 R/G/B 各 -27） */
  --gray-0: #f5f5f7; /* 基础浅色 */
  --gray-1: #dadadc;
  --gray-2: #bfbfc1;
  --gray-3: #a4a4a6;
  --gray-4: #89898b;
  --gray-5: #6e6e70;
  --gray-6: #535355;
  --gray-7: #38383a;
  --gray-8: #1d1d1f; /* 基础深色 */

  /* 重点色：仅用于选中文本、键盘焦点等极少数交互 */
  --accent: #0000ff;

  /* 语义 */
  --bg: var(--gray-0);
  --fg: var(--gray-8);
  --fg-muted: var(--gray-5);
  --line: #dedee1; /* 分隔线（与参考稿一致） */
  /* 内容页顶栏的液态玻璃：底色浓度、顶边高光、表面光泽、下沿折射高光 */
  --glass-tint: 25%;
  --glass-hi: rgba(255, 255, 255, 0.75);
  --glass-sheen: rgba(255, 255, 255, 0.45);
  --glass-edge: rgba(255, 255, 255, 0.9);
  --on-accent: #f5f5f7; /* 特殊蓝上的文字（选中文本） */

  /* 反色大面积：菜单、悬停的首页卡片、转场大图底色——深色模式下仍保持深色 */
  --inv-bg: #1d1d1f;
  --inv-fg: #f5f5f7;
  --inv-fg-2: #dadadc;  /* 反色面上的分类小字 */
  --inv-fg-3: #bcbcc0;  /* 反色面上的概述 */
  --inv-muted: #6e6e70; /* 菜单未选中项、菜单编号 */
  /* 固定色：压在图片上的文字、图片上的渐变，不随主题变化 */
  --paper: #f5f5f7;
  --ink: #1d1d1f;
  --shadow: 29, 29, 31; /* 阴影颜色（rgb 分量） */

  /* 字体栈 */
  --font-system: system-ui, -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
                 "Microsoft YaHei", "Noto Sans CJK SC", "Source Han Sans SC", sans-serif;
  --font-adventor: "TeX Gyre Adventor", "Switzer", "Helvetica Neue", Arial, sans-serif;
  --font-switzer: "Switzer", "Helvetica Neue", Helvetica, Arial, sans-serif;

  /* 当前语言下使用的字体（由 html[lang] 切换） */
  --font-display: var(--font-adventor); /* 大标题、大数字 */
  --font-text: var(--font-switzer);     /* 正文及其余内容 */
  --weight-display: 700;
  --weight-text: 400;
  --weight-strong: 700;
  --tracking-display: -0.02em;

  /* 字号层级（桌面 >900px；中等屏与手机的差异见文末断点） */
  --fs-hero: clamp(56px, 9vw, 152px);       /* 内页大标题 */
  --fs-title-zh: clamp(24px, 2.4vw, 40px);  /* 中文项目标题：随窗口 24–40（与参考稿一致） */
  --fs-title-en: clamp(26px, 2.4vw, 40px);  /* 英文项目标题：随窗口 26–40（与参考稿一致） */
  --fs-title: var(--fs-title-en);
  --fs-num: 30px;          /* 项目编号 01–04 */
  --fs-brand: 15px;        /* Seth / Qihao Shu */
  --fs-lang: 11px;         /* 中文 / EN 切换 */
  --fs-menu: clamp(48px, 8vw, 128px); /* 展开菜单：首页 / 个人 */
  --fs-menu-index: 10px;   /* 菜单辅助编号 */
  --fs-label: 9px;         /* 项目分类小字 */
  --fs-summary: 12px;      /* 项目概述 */
  --fs-cta: 10px;          /* 查看项目 */
  --fs-back: 12px;         /* 返回首页 */
  --fs-footer-meta: 9px;   /* 页脚左侧：精选作品 */
  --fs-footer-note: 10px;  /* 页脚中间：项目示意 */
  --fs-body: 14px;         /* 内页正文（待内容确定） */

  /* 间距 */
  --gutter: clamp(16px, 2.25vw, 48px);
  --header-h: 64px;  /* 顶栏（≤900px 为 56px） */
  --index-h: clamp(72px, 7vw, 140px);     /* 卡片内编号行 */
  --footer-h: 52px;   /* 首页底栏 */

  /* 动效 */
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.6s;
}

/* 深色模式：<head> 脚本在首帧前写入 data-theme（已保存的选择 > 系统设置）。
   灰阶整体镜像（#f5f5f7 ↔ #1d1d1f），所有引用 --gray-N 的文字、分隔线、小面积反色块自动翻转；
   菜单、悬停卡片等大面积反色面用 --inv-*，在深色模式下改为略抬高的深灰，不会整屏变白 */
:root { color-scheme: light; }
:root[data-theme="dark"] {
  color-scheme: dark;
  --gray-0: #1d1d1f;
  --gray-1: #38383a;
  --gray-2: #535355;
  --gray-3: #6e6e70;
  --gray-4: #89898b;
  --gray-5: #a4a4a6;
  --gray-6: #bfbfc1;
  --gray-7: #dadadc;
  --gray-8: #f5f5f7;
  --accent: #6e78ff;   /* 纯蓝在深底上对比度只有 2:1，提亮到 4.6:1，保持同一色相 */
  --on-accent: #1d1d1f;
  --line: #343435;     /* 与浅色分隔线镜像 */
  --glass-tint: 25%;
  --glass-hi: rgba(255, 255, 255, 0.12);
  --glass-sheen: rgba(255, 255, 255, 0.05);
  --glass-edge: rgba(255, 255, 255, 0.16);
  --inv-bg: #2a2a2c;
  --inv-muted: #7c7c7e;
  --shadow: 0, 0, 0;
}

/* 中文：使用访问者系统自带字体，标题与数字用粗体 */
:root[lang="zh-CN"] {
  --font-display: var(--font-system);
  --font-text: var(--font-system);
  --tracking-display: 0;
  --fs-title: var(--fs-title-zh);
}

/* ---------- 语言切换：只显示当前语言的文本 ---------- */
:root[lang="en"] [lang="zh-CN"],
:root[lang="zh-CN"] [lang="en"] { display: none !important; }

/* ---------- Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg);
  color: var(--fg);
  font-family: var(--font-text);
  font-weight: var(--weight-text);
  font-size: var(--fs-body);
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  text-wrap: pretty; /* 全站默认：避免末行孤字；已单独写了 balance 的标题等照旧（不支持的浏览器退回普通换行） */
}
img { display: block; max-width: 100%; }
a { color: inherit; text-decoration: none; }
h1, h2, h3, p { margin: 0; }
ul { margin: 0; padding: 0; list-style: none; }
button { font: inherit; color: inherit; }
strong, b { font-weight: var(--weight-strong); }

::selection { background: var(--accent); color: var(--on-accent); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 标题 / 大数字通用样式 */
.display {
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-display);
}

/* 小号类别标签 */
.label {
  font-size: var(--fs-label);
  letter-spacing: 0.14em;
  line-height: 1;
  color: var(--gray-4);
}

/* ---------- Header / Menu ---------- */
/* 全宽顶栏：左侧署名，右侧语言切换与菜单 */
.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  height: var(--header-h);
  display: flex;
  align-items: center;
  gap: clamp(24px, 3vw, 56px);
  padding: 0 var(--gutter);
  background: var(--bg);
  color: var(--fg);
  border-bottom: 1px solid var(--line);
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease), box-shadow 0.5s var(--ease);
}
/* 所有页面的顶栏：渐变模糊（参考 Instagram 顶部）。上沿最模糊，往下逐级减弱，到下沿完全清晰；
   没有下沿分隔线、光泽和高光，只有一层从上往下变淡的底色，保证文字可读。
   模糊由 main.js 插入的 6 层（.header-blur > i）叠成：每层模糊加倍（0.5 → 16px），各自只在一段高度上显示、
   与相邻层交叠过渡。单层模糊配渐变遮罩会在中段同时看到清晰与模糊两份画面（重影），逐级叠加则没有 */
.site-header {
  /* 底色整条均匀地加深（原来从 45% 线性淡到 0，按钮所在的中段只剩约 22%，图片经过时淡色的“中文”和图标会被吃掉）：
     上半段保持约 50%，过了按钮再缓缓淡出，配合下面的渐变模糊，像一层磨砂玻璃 */
  background: linear-gradient(to bottom,
    color-mix(in srgb, var(--bg) 52%, transparent) 0%, color-mix(in srgb, var(--bg) 50%, transparent) 40%,
    color-mix(in srgb, var(--bg) 42%, transparent) 60%, color-mix(in srgb, var(--bg) 27%, transparent) 75%,
    color-mix(in srgb, var(--bg) 11%, transparent) 90%, color-mix(in srgb, var(--bg) 0%, transparent) 100%);
  /* 渐变铺满到透明下边框的下沿：默认只铺到边框以内，最后 1px 会重复渐变的第一行（最浓的底色），图片经过时看到一条亮线 */
  background-origin: border-box;
  border-bottom-color: transparent;
}
.header-blur {
  position: absolute;
  inset: 0 0 -1px; /* 盖住顶栏下沿那 1px（透明的边框），否则那一行没有模糊，看起来像一条线 */
  z-index: -1;
  pointer-events: none;
}
.header-blur i {
  position: absolute;
  inset: 0;
  pointer-events: none;
  -webkit-backdrop-filter: blur(var(--b));
  backdrop-filter: blur(var(--b));
  -webkit-mask-image: var(--m);
  mask-image: var(--m);
}
/* 署名和按钮明确排在模糊层之上：6 层带遮罩的背景模糊在部分浏览器里会被当成盖在按钮上的一层，
   只剩按钮下沿一小块能点到 */
.site-header > :not(.header-blur) { position: relative; z-index: 1; }
.header-blur i:nth-child(1) { --b: 0.5px; --m: linear-gradient(to top, transparent 0.00%, #000 14.29%, #000 28.57%, transparent 42.86%); }
.header-blur i:nth-child(2) { --b: 1px; --m: linear-gradient(to top, transparent 14.29%, #000 28.57%, #000 42.86%, transparent 57.14%); }
.header-blur i:nth-child(3) { --b: 2px; --m: linear-gradient(to top, transparent 28.57%, #000 42.86%, #000 57.14%, transparent 71.43%); }
.header-blur i:nth-child(4) { --b: 4px; --m: linear-gradient(to top, transparent 42.86%, #000 57.14%, #000 71.43%, transparent 85.71%); }
.header-blur i:nth-child(5) { --b: 8px; --m: linear-gradient(to top, transparent 57.14%, #000 71.43%, #000 85.71%, transparent 100.00%); }
.header-blur i:nth-child(6) { --b: 16px; --m: linear-gradient(to top, transparent 71.43%, #000 85.71%); }
/* 首页的底栏：整块均匀模糊。卡片悬停时，卡片下沿的弥散光透进底栏 */
.home .home-footer {
  background: color-mix(in srgb, var(--bg) var(--glass-tint), transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
}
/* 不支持背景模糊的浏览器：退回不透明底色，保证可读 */
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .site-header, .home .home-footer { background: var(--bg); }
  .header-blur { display: none; }
}
.menu-open .site-header { background: transparent; color: var(--inv-fg); border-color: transparent; }

/* 署名：默认 Seth，悬停时上滑切换为 Qihao Shu */
.brand {
  display: grid;
  overflow: hidden;
  font-family: var(--font-switzer);
  font-weight: var(--weight-strong);
  font-size: var(--fs-brand);
  line-height: 1.2;
  white-space: nowrap;
}
.brand > span {
  grid-area: 1 / 1;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}
.brand .name-full { transform: translateY(100%); opacity: 0; }
.brand:hover .name-short,
.brand:focus-visible .name-short { transform: translateY(-100%); opacity: 0; }
.brand:hover .name-full,
.brand:focus-visible .name-full { transform: none; opacity: 1; }

/* 语言切换：当前语言加粗并加下划线 */
.lang-toggle {
  margin-left: auto;
  padding: 4px 0;
  border: 0;
  background: none;
  cursor: var(--cur-tap);
  display: flex;
  align-items: baseline;
  gap: 12px;
  font-size: var(--fs-lang);
  line-height: 1.2;
}
.lang-toggle [data-code] {
  opacity: 0.55;
  text-decoration: underline transparent;
  text-decoration-thickness: 1.5px;
  text-underline-offset: 8px;
  transition: opacity 0.3s, text-decoration-color 0.3s;
}
.lang-toggle .sep { opacity: 0.3; }
.lang-toggle [data-code="zh-CN"] { font-family: var(--font-system); }
.lang-toggle [data-code="en"] { font-family: var(--font-switzer); }
:root[lang="zh-CN"] .lang-toggle [data-code="zh-CN"],
:root[lang="en"] .lang-toggle [data-code="en"] {
  opacity: 1;
  font-weight: var(--weight-strong);
  text-decoration-color: currentColor;
}

/* 菜单图标：两条线，打开时变为 × */
.menu-toggle {
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  cursor: var(--cur-tap);
  display: grid;
  align-content: center;
  gap: 6px;
}
.menu-toggle span {
  display: block;
  height: 1.5px;
  width: 24px;
  margin-left: auto;
  background: currentColor;
  transition: transform var(--dur) var(--ease);
}
.menu-open .menu-toggle span:nth-child(1) { transform: translateY(3.75px) rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { transform: translateY(-3.75px) rotate(-45deg); }

.menu {
  position: fixed;
  inset: 0;
  z-index: 15;
  background: var(--inv-bg);
  color: var(--inv-fg);
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  padding: var(--header-h) 0 var(--gutter);
  clip-path: inset(0 0 100% 0);
  transition: clip-path 0.8s var(--ease);
}
.menu-open .menu { clip-path: inset(0 0 0 0); }
.menu ul { grid-column: 1 / -1; display: grid; grid-template-columns: repeat(4, 1fr); }
.menu li { padding: 0 var(--gutter); }
.menu a {
  display: block;
  font-family: var(--font-text);
  font-weight: var(--weight-strong);
  font-size: var(--fs-menu);
  line-height: 1;
  color: var(--inv-muted);
  transition: color 0.3s;
}
.menu a:hover, .menu a[aria-current="page"] { color: var(--inv-fg); }
.menu small {
  display: block;
  margin-bottom: 16px;
  font-family: var(--font-switzer);
  font-size: var(--fs-menu-index);
  letter-spacing: 0.08em;
  color: var(--inv-muted);
}

/* ---------- Index label (— 01) ---------- */
.index {
  display: flex;
  align-items: center;
  gap: 16px;
  font-size: var(--fs-num);
  line-height: 1;
}
.index::before {
  content: "";
  flex: none;
  width: clamp(20px, 1.5vw, 32px);
  height: 1.5px;
  background: currentColor;
  transition: width var(--dur) var(--ease);
}

/* =========================================================
   Home — 4 列项目
   ========================================================= */
.projects {
  display: grid;
  grid-template-columns: repeat(4, minmax(320px, 1fr)); /* 卡片最窄 320px，放不下时横向滑动 */
  height: calc(100vh - var(--header-h) - var(--footer-h));
  height: calc(100svh - var(--header-h) - var(--footer-h));
  min-height: 520px;
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-snap-type: x proximity;
  scrollbar-width: none;
}
.projects::-webkit-scrollbar { display: none; }
.project { scroll-snap-align: start; }

.project {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-rows: var(--index-h) 1fr auto;
  background: var(--gray-0);
  color: var(--gray-8);
  transition: background-color var(--dur) var(--ease), color var(--dur) var(--ease);
  isolation: isolate;
}
.project + .project { border-left: 1px solid var(--line); } /* 卡片间细分隔线 */

/* 左侧短线 + 对齐卡片右上角的编号 */
.project .index {
  align-self: center;
  justify-content: space-between;
  padding: 0 var(--gutter);
}

/* 图片区：比卡片略宽（左右各溢出 6%），占卡片高度 12%–70%；两张图叠放 */
.project-media {
  position: absolute;
  top: 12%;
  left: -6%;
  width: 112%;
  height: 58%;
  z-index: -1;
  pointer-events: none;
  transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.project-media :is(img, canvas) {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  transition: opacity 0.4s, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
}
.project-media .img-hover {
  opacity: 0;
  transform: translateY(14px);
}

/* 01：作品图铺满整张卡片；默认去色，悬停恢复彩色；上下渐变保证文字可读 */
.project.is-cover .project-media { inset: 0; width: 100%; height: 100%; }
/* 模糊会往上晕出卡片上沿一截（01 的图上沿很亮）：平时被顶栏盖住，从内容页返回、卡片升起时顶栏是透明的，
   这截就露出来，顶栏恢复后又被切掉，看起来是一条白边在闪。只裁掉上边（其他三边不动） */
.project.is-cover .project-media { clip-path: inset(0 -100vw -100vh -100vw); }
.project.is-cover .project-media :is(img, canvas) { object-fit: cover; transform: scale(1); }
.project.is-cover .project-media .img-default { filter: saturate(0); }
/* 02：默认图与展开图里的同一画面重合，展开时作品不跳位。以展开图为准：展开图照常铺满，默认图按展开图摆放。
   两张图都随卡片高度缩放（cqh = 卡片高的 1%），数值由两张图比对得出：
   展开图 2880×1619 缩到 96.2%、左移 876px、下移 1px 即与默认图 1500×1560 重合。
   放大 4% 的基点设在卡片中心，两张图一起放大时保持重合 */
.project-media.align-hover { container-type: size; }
.align-hover .img-default {
  inset: auto; top: -0.06cqh; left: calc(50% - 32.7cqh);
  width: auto; max-width: none; height: 100.16cqh; transform-origin: 32.7cqh 50.06cqh;
}
/* 03：默认图就是展开图正中按整高裁出的一块（1500×1560，宽 = 高 × 0.9615），两张图同高、水平居中即重合 */
.align-hover.is-center .img-default {
  top: 0; left: calc(50% - 48.08cqh);
  height: 100cqh; transform-origin: 48.08cqh 50cqh;
}
/* 04：反过来以默认图为准——默认图在卡片里居中、按整高铺满（卡片默认状态就是这张图本身的取景），
   展开图跟着它摆。2026-11-17 换图后重新比对（亮度相关，r = 0.966）：展开图（缩到 2880×1620）里的产品，
   相当于默认图（1500×1560）放大 1.036 倍、右移 662px、下移 2px。两张图各自铺满整高时的显示比例略有出入，
   所以展开图高度取 100.24cqh（而不是 100cqh），左边缘在默认图左边缘再左 40.96cqh（= 50% − 89.04cqh），上沿 −0.12cqh；
   放大 4% 都以卡片中心为基点 */
.project-media.align-default { container-type: size; }
.align-default .img-default,
.align-default .img-hover { inset: auto; top: 0; width: auto; max-width: none; height: 100cqh; }
.align-default .img-default { left: calc(50% - 48.08cqh); transform-origin: 48.08cqh 50cqh; }
.align-default .img-hover { top: -0.12cqh; height: 100.24cqh; left: calc(50% - 89.04cqh); transform-origin: 89.04cqh 50.12cqh; }
.project.is-cover .project-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--card-edge), linear-gradient(to bottom, color-mix(in srgb, var(--bg) 85%, transparent), color-mix(in srgb, var(--bg) 0%, transparent) 20%,
              color-mix(in srgb, var(--bg) 0%, transparent) 55%, color-mix(in srgb, var(--bg) 95%, transparent) 100%);
  transition: opacity var(--dur) var(--ease);
}
/* 卡片默认状态的左缘渐变：从页面底色（浅色模式为白、深色模式为深色）向右淡出，
   把相邻两张卡片的图片隔开，避免连成一片；悬停 / 展开时随 ::after 一起淡出 */
.project { --card-edge: linear-gradient(to right, var(--bg) 0%, var(--bg) 6%, color-mix(in srgb, var(--bg) 88%, transparent) 12%,
  color-mix(in srgb, var(--bg) 66%, transparent) 19%, color-mix(in srgb, var(--bg) 40%, transparent) 27%,
  color-mix(in srgb, var(--bg) 18%, transparent) 35%, color-mix(in srgb, var(--bg) 5%, transparent) 42%,
  color-mix(in srgb, var(--bg) 0%, transparent) 48%); }
@media (max-width: 540px) { .project { --card-edge: linear-gradient(transparent, transparent); } } /* 手机纵向堆叠，左缘就是屏幕边，不需要 */
/* 示意卡片（线稿占位图）：图片区比卡片左右各宽 6%，渐变层对齐到卡片左缘（6/112 ≈ 5.36%） */
.project:not(.is-cover) .project-media::after {
  content: "";
  position: absolute;
  top: 0; bottom: 0; left: 5.36%; width: 89.29%;
  background: var(--card-edge);
  transition: opacity var(--dur) var(--ease);
}
:where(body:not(.cards-tap)) .project:not(.is-cover):hover .project-media::after,
.project:not(.is-cover):focus-visible .project-media::after,
.project:not(.is-cover).is-active .project-media::after { opacity: 0; }
.project.is-cover .project-media::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(to bottom, rgba(29, 29, 31, 0.8), rgba(29, 29, 31, 0) 20%,
              rgba(29, 29, 31, 0) 48%, rgba(29, 29, 31, 0.96) 100%);
  opacity: 0;
  transition: opacity var(--dur) var(--ease);
}

.project-text {
  grid-row: 3;
  padding: 0 var(--gutter) clamp(28px, 3vw, 64px);
}
.project-label { margin-bottom: clamp(14px, 1.2vw, 24px); transition: color var(--dur) var(--ease); }
.project-title {
  font-size: var(--fs-title);
  line-height: 1.15;
}

/* 悬停展开：概述 + 查看项目；用 grid 0fr→1fr 展开，标题随之上移 */
.project-more {
  display: grid;
  grid-template-rows: 0fr;
  transition: grid-template-rows var(--dur) var(--ease);
}
.project-more > div {
  overflow: hidden;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform var(--dur) var(--ease);
}
.project-summary {
  max-width: 24em;
  padding-top: clamp(20px, 1.8vw, 36px);
  font-size: var(--fs-summary);
  line-height: 2;
  color: var(--inv-fg-3);
}
.project-cta {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  margin-top: clamp(24px, 2.4vw, 48px);
  font-size: var(--fs-cta);
  letter-spacing: 0.06em;
}

/* ---------- 悬停 / 键盘焦点 ---------- */
:where(body:not(.cards-tap)) .project:hover,
.project:focus-visible {
  background: var(--inv-bg);
  color: var(--inv-fg);
  outline-offset: -2px;
}
:where(body:not(.cards-tap)) .project:hover .project-label,
.project:focus-visible .project-label { color: var(--inv-fg-2); }
:where(body:not(.cards-tap)) .project:hover .index::before,
.project:focus-visible .index::before { width: clamp(32px, 2.5vw, 48px); }
:where(body:not(.cards-tap)) .project:hover .project-media,
.project:focus-visible .project-media { transform: translateY(-30px) scale(1.04); }
:where(body:not(.cards-tap)) .project:hover .img-default,
.project:focus-visible .img-default { opacity: 0; transform: translateY(-14px); }
:where(body:not(.cards-tap)) .project:hover .img-hover,
.project:focus-visible .img-hover { opacity: 1; transform: none; }
/* 01 悬停：图片区不位移，只把作品图轻微放大；渐变换成深色 */
:where(body:not(.cards-tap)) .project.is-cover:hover .project-media,
.project.is-cover:focus-visible .project-media { transform: none; }
:where(body:not(.cards-tap)) .project.is-cover:hover .project-media :is(img, canvas),
.project.is-cover:focus-visible .project-media :is(img, canvas) { transform: scale(1.04); }
:where(body:not(.cards-tap)) .project.is-cover:hover .project-media::after,
.project.is-cover:focus-visible .project-media::after { opacity: 0; }
:where(body:not(.cards-tap)) .project.is-cover:hover .project-media::before,
.project.is-cover:focus-visible .project-media::before { opacity: 1; }
:where(body:not(.cards-tap)) .project:hover .project-more,
.project:focus-visible .project-more { grid-template-rows: 1fr; }
:where(body:not(.cards-tap)) .project:hover .project-more > div,
.project:focus-visible .project-more > div { opacity: 1; transform: none; transition-delay: 0.1s; }

/* ---------- 首页底栏 ---------- */
.home-footer {
  position: relative;
  z-index: 14; /* 盖在卡片弥散光（13）之上，光从玻璃后面透出来；低于菜单（15），菜单展开时盖住底栏 */
  height: var(--footer-h);
  display: grid;
  grid-template-columns: 1fr auto 1fr;
  align-items: center;
  gap: 24px;
  padding: 0 var(--gutter);
  border-top: 1px solid var(--line);
  color: var(--gray-5);
}
.footer-meta { font-size: var(--fs-footer-meta); letter-spacing: 0.04em; }
.footer-note { font-size: var(--fs-footer-note); }
.footer-status { justify-self: end; text-align: right; } /* 底栏右侧：说明网站还在更新 */

/* =========================================================
   内页（项目内容页 / 个人页）— 结构待定
   ========================================================= */
.page {
  min-height: calc(100vh - var(--header-h));
  min-height: calc(100svh - var(--header-h));
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-template-rows: auto auto 1fr;
}
.back-link {
  grid-column: 1 / -1;
  grid-row: 1;
  justify-self: start;
  display: inline-flex;
  gap: 8px;
  padding: 24px var(--gutter) 0;
  font-size: var(--fs-back);
  color: var(--gray-5);
  transition: color 0.3s;
}
.back-link:hover { color: var(--fg); }
.page-head {
  grid-column: 1 / -1;
  grid-row: 2;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  align-items: end;
  padding: clamp(48px, 14vh, 200px) 0 48px;
  border-bottom: 1px solid var(--line);
}
.page-head .index { grid-column: 1; padding: 0 var(--gutter) 0.2em; }
.page-head h1 {
  grid-column: 2 / -1;
  padding: 0 var(--gutter);
  font-size: var(--fs-hero);
  line-height: 0.95;
}
.page-body {
  grid-column: 2 / -1;
  grid-row: 3;
  padding: 48px var(--gutter);
  color: var(--gray-4);
  font-size: var(--fs-body);
}

/* ---------- Responsive ---------- */
/* 中等屏（541–900）：保持与全屏一致的单行布局，卡片定宽并溢出右侧，横向滑动浏览 */
@media (max-width: 900px) {
  :root { --fs-title-zh: 32px; --fs-title-en: 26px; --header-h: 56px; }
  .projects { grid-template-columns: repeat(4, max(320px, 42vw)); }
  .menu, .menu ul { grid-template-columns: 1fr; }
  .menu li { margin-top: 24px; }
}
/* 手机（≤540）：纵向堆叠 */
@media (max-width: 540px) {
  :root {
    --fs-title-zh: 38px;
    --fs-title-en: 38px;
    --fs-num: 32px;
    --fs-footer-meta: 8px;
    --fs-footer-note: 9px;
  }
  .projects { grid-template-columns: 1fr; height: auto; overflow-x: visible; scroll-snap-type: none; }
  .project { height: calc(100vh - var(--header-h)); height: calc(100svh - var(--header-h)); min-height: 600px; }
  .project + .project { border-left: 0; border-top: 0; } /* 卡片之间不画横线 */
  .project:not(.is-cover) .project-media { top: 8%; height: 50%; } /* 概述常显，图片区上移避让文字 */
  .home-footer { height: auto; grid-template-columns: 1fr; gap: 4px; padding-block: 20px; }
  .page, .page-head { grid-template-columns: 1fr; }
  .page-head h1, .page-body { grid-column: 1; }
  .page-head .index { margin-bottom: 24px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition-duration: 0.01ms !important; }
}

/* =========================================================
   项目内容页（案例研究）— 由 tools/build_case_study.py 生成
   左侧粘性栏：章节编号 + 眉题；右侧 9 列正文
   ========================================================= */
.cs-main {
  --cs-gap: clamp(16px, 1.7vw, 24px);
  --cs-section-space: clamp(112px, 13vw, 184px); /* 章节与上一章之间（2026-12 加大，层级更分明） */
  --cs-max: 1440px;
}
.cs-main .back-link { display: inline-flex; padding-top: 24px; }

/* ---------- 栏位（2026-12）：宽屏（≥1200px）把网格细分成 24 列，左侧章节栏 4 列（原 6 列的宽度减三分之一）；
   正文文字栏以页面中线为轴向两边各加宽半列（原第 7–18 列 → 第 6–19 列，左右对称），
   媒体区跟着左边一起往左挪半列、右边仍到页边。901–1199px 的中等屏仍用原来的 12 列：3 + 9，文字 6 列。
   章节、概述、项目过程开关都从这几个变量取栏位 ---------- */
.cs-main {
  --cs-cols: 12; --cs-body-cols: 9;
  --cs-rail: 1 / 4; --cs-start: 4; --cs-text: 1 / 7; --cs-text-end: 10;
  --cs-sub: 4 / 8; --cs-meta: 9 / 13;
}
@media (min-width: 1200px) {
  .cs-main {
    --cs-cols: 24; --cs-body-cols: 19;
    --cs-rail: 1 / 5; --cs-start: 6; --cs-text: 1 / 15; --cs-text-end: 20;
    --cs-sub: 6 / 14; --cs-meta: 16 / 25;
  }
}

/* ---------- 开篇（2026-12 重排）：编号 + 大标题；隔一段（约一个标题字高）后是副标题和项目信息，
   各压一道细线（同章节的左右两段线），项目信息是竖排的规格表；再往下是导语，
   和正文同一条文字栏，第一段略放大作引子；导语之后接开头大图 ---------- */
.cs-intro {
  max-width: var(--cs-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(var(--cs-cols), 1fr);
  column-gap: var(--cs-gap);
}
.cs-cover {
  grid-column: 1 / -1;
  display: grid;
  /* 标题区（第一行）高度固定，按 chichisong（两行标题）的版面算：上方留白 + 两行标题 + 到细线的间距；
     所以四个项目的副标题和项目信息都在同一高度。标题在这一区里上下居中；更长的标题放不下时这一行自动变高 */
  --cs-t: clamp(72px, 12vw, 200px);
  --cs-t-lh: 0.92;
  grid-template-columns: repeat(var(--cs-cols), 1fr);
  grid-template-rows: minmax(calc(clamp(40px, 8vh, 112px) + 2 * var(--cs-t-lh) * var(--cs-t) + clamp(56px, 10.8vw, 160px)), auto) auto;
  column-gap: var(--cs-gap);
}
:root[lang="zh-CN"] .cs-cover { --cs-t-lh: 1.08; }
.cs-intro .cs-intro-rail { grid-column: var(--cs-rail); grid-row: 1; align-self: start; margin-top: clamp(40px, 8vh, 112px); } /* 01：与章节左栏同格式 */
.cs-title {
  grid-column: var(--cs-start) / -1;
  grid-row: 1;
  align-self: center;
  /* 下边距比上边距多 44px（返回链接那一行的高度）：居中的基准从顶栏下沿算起，而不是从封面顶上 */
  margin: 56px 0 100px;
  font-size: calc(var(--cs-t) * var(--cs-t-scale, 1));
  line-height: 0.92;
}
/* 单个短词的标题（Win-Win、Sealbox）放大一些，在标题区里撑得住；标题区高度仍按 --cs-t 算，副标题和项目信息的位置不变 */
.cs-main[data-project="win-win"] .cs-title,
.cs-main[data-project="sealbox"] .cs-title { --cs-t-scale: 1.4; }
/* Silent Support 和 chichisong 一样排两行：标题只取最窄宽度，在空格处折行 */
.cs-main[data-project="silent-support"] .cs-title { justify-self: start; width: min-content; }
.cs-subtitle, .cs-meta { grid-row: 2; align-self: start; margin: 0; }
.cs-subtitle {
  grid-column: var(--cs-sub);
  padding: 20px 2em 0 0;
  border-top: 1px solid var(--line);
  font-size: clamp(20px, 1.9vw, 30px);
  line-height: 1.3;
  color: var(--gray-6);
}
:root[lang="en"] .cs-subtitle { font-style: italic; }
/* 中文：汉字字面撑满整个字框，0.92 的行高下两行标题上下贴在一起（如“chichisong / 官网”），行高放松 */
:root[lang="zh-CN"] .cs-title { line-height: 1.08; }
/* Silent Support（04）的标题全是英文字母：中文模式下的 1.08 行高是给汉字留的，两行字母会显得很空，改用英文版的行高，视觉上与 chichisong（02）标题的行距一致 */
:root[lang="zh-CN"] .cs-main[data-project="silent-support"] .cs-title { line-height: 0.92; padding-bottom: 0.08em; }
:root[lang="zh-CN"] .cs-subtitle { line-height: 1.45; }
/* 项目信息：一份竖排的规格表（左小标签、右内容），不再是横排的表格行 */
.cs-meta {
  grid-column: var(--cs-meta);
  padding-top: 20px;
  border-top: 1px solid var(--line);
  display: grid;
  gap: 12px;
}
.cs-meta > div { display: grid; grid-template-columns: minmax(6.5em, 1fr) 2.6fr; column-gap: var(--cs-gap); align-items: baseline; }
.cs-meta dt { margin: 0; font-weight: 500; }
.cs-meta dd { margin: 0; font-size: 14px; line-height: 1.5; }
/* 导语：与正文同一条文字栏 */
.cs-lede {
  grid-column: var(--cs-start) / var(--cs-text-end);
  margin-top: clamp(64px, 8vw, 120px);
  font-size: 17px; /* 与正文同字号 */
  line-height: 1.65;
  color: var(--gray-7);
}
:root[lang="zh-CN"] .cs-lede { font-size: 16px; line-height: 1.85; }
.cs-lede p { margin: 0 0 1em; }
/* 第一段略放大，作引子 */
.cs-lede p:first-child { margin-bottom: clamp(36px, 3.6vw, 56px); font-size: clamp(18px, 1.45vw, 21px); line-height: 1.6; color: var(--fg); }
:root[lang="zh-CN"] .cs-lede p:first-child { font-size: clamp(17px, 1.3vw, 19px); line-height: 1.8; }
.cs-intro .cs-note { grid-column: var(--cs-start) / var(--cs-text-end); margin-top: 8px; }
.cs-intro > :last-child { margin-bottom: clamp(48px, 6vw, 88px); }

/* 通栏大图 */
.cs-hero { margin: 0; }
.cs-hero .media-frame { width: 100%; }
.cs-hero .media-ph { padding: var(--gutter); }
.cs-section + .cs-hero { margin-top: var(--cs-section-space); } /* 章节末尾的通栏图 */
/* 章节中间的通栏图：上下间距和章节里的配图相当，而不是章节之间的大间距 */
:root { --cs-mid-space: clamp(32px, 3.5vw, 48px); }
.cs-section + .cs-hero.is-mid { margin-top: var(--cs-mid-space); }

/* ---------- 章节 ---------- */
.cs-section {
  max-width: var(--cs-max);
  margin: 0 auto;
  padding: var(--cs-section-space) var(--gutter) 0;
  display: grid;
  grid-template-columns: repeat(var(--cs-cols), 1fr);
  column-gap: var(--cs-gap);
}
.cs-rail,
.cs-body { border-top: 1px solid var(--line); padding-top: 20px; }
.cs-section > .cs-body { padding-top: clamp(40px, 4.4vw, 64px); } /* 章节标题与自己的内容之间加大 */
/* 章节中间的通栏图之后接着的正文：和章节同样的栏位，但没有左栏和分隔线（不算新章节） */
.cs-section-cont {
  max-width: var(--cs-max);
  margin: 0 auto;
  padding: var(--cs-mid-space) var(--gutter) 0;
  display: grid;
  grid-template-columns: repeat(var(--cs-cols), 1fr);
  column-gap: var(--cs-gap);
}
.cs-section-cont > .cs-body { border-top: 0; padding-top: 0; }
.cs-rail {
  grid-column: var(--cs-rail);
  align-self: start;
  position: sticky;
  top: calc(var(--header-h) + 24px);
  display: flex;
  flex-direction: column;
  gap: 12px;
}
.cs-num { font-size: var(--fs-num); line-height: 1; }
.cs-eyebrow { font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gray-5); line-height: 1.4; font-weight: 500; }
.cs-body {
  grid-column: var(--cs-start) / -1;
  display: grid;
  grid-template-columns: repeat(var(--cs-body-cols), 1fr);
  column-gap: var(--cs-gap);
  align-content: start;
}
.cs-body > * { grid-column: var(--cs-text); } /* 文字栏：中等屏 9 列里占 6 列，宽屏 19 列里占 14 列（以页面中线左右对称） */

.cs-h2 {
  margin: 0 0 clamp(24px, 2.5vw, 40px);
  font-size: clamp(30px, 3vw, 44px);
  line-height: 1.12;
}
.cs-body p,
.cs-split-text p {
  margin: 0 0 1em;
  font-size: 17px;
  line-height: 1.65;
  color: var(--gray-7);
}
/* :where() 不增加优先级，让引语、陈述、卡片等组件的字号能覆盖它 */
:where(:root[lang="zh-CN"]) .cs-body p,
:where(:root[lang="zh-CN"]) .cs-split-text p { font-size: 16px; line-height: 1.85; }
.cs-body a,
.cs-intro a { text-decoration: underline; text-underline-offset: 3px; text-decoration-thickness: 1px; }
.cs-h3 {
  margin: clamp(40px, 4vw, 56px) 0 12px;
  font-size: clamp(19px, 1.5vw, 23px);
  font-weight: var(--weight-strong);
  line-height: 1.3;
}
.cs-h2 + .cs-h3 { margin-top: 0; }
/* 小标题下的一句点题（文档里整行斜体）：灰色，英文斜体，同概述副标题 */
.cs-body p.cs-h3-sub { color: var(--gray-5); }
:root[lang="en"] .cs-body p.cs-h3-sub { font-style: italic; }
.cs-body p.cs-emphasis {
  margin: 32px 0;
  font-size: clamp(20px, 1.7vw, 26px);
  line-height: 1.4;
  color: var(--fg);
}
.cs-body p.cs-emphasis strong { font-weight: var(--weight-strong); }
/* 正文段落里的重点句：不加底色等装饰，只靠字重和唯一的强调色区分（与引言关键词同一套语言）。
   进入视野时（main.js 加 .is-in）文字由半透明的前景色（浅色模式半透明黑、深色模式半透明白）被特殊蓝从左往右刷成蓝色；背景不按行克隆（slice），
   整句连成一条，一行接一行刷过去。没有动画时直接是蓝字 */
.cs-body > p:not(.cs-emphasis) > strong {
  color: var(--accent);
  font-weight: var(--weight-strong);
}
.cs-body > p:not(.cs-emphasis) > strong.is-armed {
  -webkit-text-fill-color: transparent;
  background: linear-gradient(90deg, var(--accent) 50%, color-mix(in srgb, var(--fg) 30%, transparent) 50%) 100% 0 / 200% 100% no-repeat;
  padding: 0.15em 0 0.25em; /* 同引言：扩大背景区域，下伸部分不被裁掉 */
  -webkit-background-clip: text;
  background-clip: text;
}
.cs-body > p:not(.cs-emphasis) > strong.is-armed.is-in {
  background-position: 0 0;
  transition: background-position 1.6s cubic-bezier(0.83, 0, 0.17, 1) 0.15s; /* 慢—快—慢，同引言 */
}
.cs-note { font-size: 13px; color: var(--gray-5); }
.cs-note::before { content: "↗ "; }
/* 正文列表（文档里以「- 」开头的连续几行）：字号、颜色同正文段落，用一道短横线代替圆点 */
.cs-list { margin: 0 0 1.2em; padding: 0; list-style: none; }
.cs-list li {
  position: relative;
  margin: 0 0 0.6em;
  padding-left: 1.4em;
  font-size: 17px;
  line-height: 1.65;
  color: var(--gray-7);
}
.cs-list li::before {
  content: "";
  position: absolute;
  left: 0;
  top: 0.82em;
  width: 0.7em;
  border-top: 1px solid var(--gray-5);
}
.cs-list li strong { color: var(--fg); font-weight: var(--weight-strong); }
:where(:root[lang="zh-CN"]) .cs-list li { font-size: 16px; line-height: 1.85; }
:where(:root[lang="zh-CN"]) .cs-list li::before { top: 0.92em; }

/* ---------- 图片 ---------- */
.cs-figure { margin: 32px 0; }
.cs-body > .cs-figure.is-wide,
.cs-body > .cs-figure.is-zoom { grid-column: 1 / -1; }
.media-frame {
  position: relative;
  overflow: hidden;
  background: var(--gray-1);
}
.media-frame img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.media-frame.is-loaded img { opacity: 1; }
.media-frame.is-loaded .media-ph { display: none; }
/* 占位：显示图片 ID、比例与内容说明，等待放入实际图片 */
.media-ph {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 6px;
  padding: clamp(14px, 1.6vw, 24px);
  background:
    repeating-linear-gradient(135deg, transparent 0 11px, color-mix(in srgb, var(--fg) 4%, transparent) 11px 12px),
    var(--gray-1);
  font-family: var(--font-switzer);
  color: var(--gray-6);
}
.ph-id { font-size: 13px; font-weight: var(--weight-strong); letter-spacing: 0.06em; color: var(--gray-8); }
.ph-meta, .ph-zoom { font-size: 11px; letter-spacing: 0.04em; }
.ph-shows { max-width: 56ch; font-size: 12px; line-height: 1.5; font-family: var(--font-text); }
.cs-figure figcaption {
  margin-top: 12px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--gray-5);
}
:root[lang="en"] .cs-figure figcaption { font-style: italic; }
.cs-tag { display: block; margin-bottom: 8px; font-size: 11px; letter-spacing: 0.14em; text-transform: uppercase; color: var(--gray-5); }

/* ---------- 光标：附带的图标（assets/img/cursors，深浅两套，外圈反色描边；原图在 source-assets/cursors） ----------
   单击（全站原来是手指的地方）、双击（查看器里的图片上）、展开（内容页可放大的图）、收起（查看器里图片以外）。
   支持 image-set 的浏览器用 1x / 2x 两张，否则用单张；图片载不出来时退回系统光标 */
:root {
  --cur-tap: url(../img/cursors/tap-dark.png) 11 8, pointer;
  --cur-double: url(../img/cursors/double-dark.png) 11 8, pointer;
  --cur-expand: url(../img/cursors/expand-light.png) 14 14, zoom-in;
  --cur-collapse: url(../img/cursors/collapse-light.png) 14 14, zoom-out;
}
:root[data-theme="dark"] {
  --cur-tap: url(../img/cursors/tap-dark.png) 11 8, pointer;
  --cur-double: url(../img/cursors/double-dark.png) 11 8, pointer;
  --cur-expand: url(../img/cursors/expand-dark.png) 14 14, zoom-in;
  --cur-collapse: url(../img/cursors/collapse-dark.png) 14 14, zoom-out;
}
@supports (cursor: image-set(url("x.png") 1x) 1 1, auto) {
  :root {
    --cur-tap: image-set(url(../img/cursors/tap-dark.png) 1x, url(../img/cursors/tap-dark@2x.png) 2x) 11 8, pointer;
    --cur-double: image-set(url(../img/cursors/double-dark.png) 1x, url(../img/cursors/double-dark@2x.png) 2x) 11 8, pointer;
    --cur-expand: image-set(url(../img/cursors/expand-light.png) 1x, url(../img/cursors/expand-light@2x.png) 2x) 14 14, zoom-in;
    --cur-collapse: image-set(url(../img/cursors/collapse-light.png) 1x, url(../img/cursors/collapse-light@2x.png) 2x) 14 14, zoom-out;
  }
  :root[data-theme="dark"] {
    --cur-tap: image-set(url(../img/cursors/tap-dark.png) 1x, url(../img/cursors/tap-dark@2x.png) 2x) 11 8, pointer;
    --cur-double: image-set(url(../img/cursors/double-dark.png) 1x, url(../img/cursors/double-dark@2x.png) 2x) 11 8, pointer;
    --cur-expand: image-set(url(../img/cursors/expand-dark.png) 1x, url(../img/cursors/expand-dark@2x.png) 2x) 14 14, zoom-in;
    --cur-collapse: image-set(url(../img/cursors/collapse-dark.png) 1x, url(../img/cursors/collapse-dark@2x.png) 2x) 14 14, zoom-out;
  }
}
:where(a[href]) { cursor: var(--cur-tap); }

/* ---------- 图片查看器：点击内容页图片放大，可滚轮 / 双指缩放、拖拽移动，点旁边区域或按 Esc 关闭（main.js） ---------- */
.case-page .media-frame.is-loaded:not(.has-video) { cursor: var(--cur-expand); }
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 100;
  touch-action: none; /* 捏合、拖拽都交给脚本，不让浏览器缩放或滚动整页 */
  overscroll-behavior: contain;
  cursor: var(--cur-collapse);
}
.lightbox-bg {
  position: absolute;
  inset: 0;
  /* 半透明 + 模糊：放大时还能隐约看到后面的页面，知道自己仍在原来的位置 */
  background: color-mix(in srgb, var(--bg) 55%, transparent);
  -webkit-backdrop-filter: blur(14px) saturate(140%);
  backdrop-filter: blur(14px) saturate(140%);
}
.lightbox img {
  position: absolute;
  max-width: none;
  transform-origin: 0 0;
  cursor: grab;
  user-select: none;
  -webkit-user-drag: none;
  /* 不加 will-change: transform：加了浏览器只按 1 倍栅格化一次，放大后是把这张位图拉伸，会糊；
     去掉后每次缩放按当前倍数重新绘制，放大也清晰（开 / 关动画期间浏览器仍会自动走合成层） */
  box-shadow: 0 12px 48px rgba(var(--shadow), 0.18);
}
.lightbox.is-dragging img { cursor: grabbing; }
/* 每张图一层铺满屏幕的 slide：图集里左右两层露出相邻大图的边缘（缩小、调淡），点一下切过去 */
.lightbox-slide { position: absolute; inset: 0; pointer-events: none; transform-origin: 50% 50%; }
.lightbox-slide img { pointer-events: auto; }
.lightbox-slide.is-side img { cursor: var(--cur-tap); }
/* 有鼠标时主图本身就用「双击」光标：脚本的判断还没跟上（刚切图、指针没动）时也不会露出手掌 */
@media (hover: hover) and (pointer: fine) { .lightbox-slide:not(.is-side) img { cursor: var(--cur-double); } }
/* 分块缩放（OpenSeadragon）：铺满查看器，画好第一屏后淡入盖住下面的图片 */
.lightbox-dzi { position: absolute; inset: 0; opacity: 0; transition: opacity 0.3s ease; cursor: grab; }
/* 分块图层铺满查看器：有鼠标时默认是「收起」光标（图片外点一下关闭），在图片上由 has-hint 换成「双击」 */
@media (hover: hover) and (pointer: fine) { .lightbox-dzi, .lightbox-dzi * { cursor: var(--cur-collapse); } }
.lightbox-dzi.is-ready { opacity: 1; }
.lightbox-dzi:active { cursor: grabbing; }
/* 光标提示（main.js 的 cursorHint，只在有鼠标的设备上）：指针在图片上时换成「双击」光标（提示双击放大 / 还原），
   代替原来的手掌；按住照样可以拖。两边的预览、按钮和图片以外的地方仍是各自的光标 */
.lightbox.has-hint, .lightbox.has-hint * { cursor: var(--cur-double) !important; }
.lightbox.has-side, .lightbox.has-side * { cursor: var(--cur-tap) !important; } /* 分块层盖住的两边预览上 */
/* 第一次见到「双击」光标时跟在光标右边的小字（main.js 的 cursorHint；看过一次就不再出现） */
.lightbox-dbl {
  position: absolute; left: 0; top: 0; z-index: 5;
  pointer-events: none; white-space: nowrap;
  font-family: var(--font-text); font-size: var(--fs-summary); font-weight: 400; line-height: 1; /* 正文字体，字号同首页概述等辅助文字 */
  color: var(--ink); /* 和白底黑边的光标一样不分深浅模式：深色字 + 浅色光晕，压在图上也看得清 */
  text-shadow: 0 0 3px var(--paper), 0 0 6px var(--paper), 0 0 10px var(--paper);
  opacity: 0; transition: opacity 0.3s var(--ease);
}
.lightbox-dbl.is-on { opacity: 0.6; }
@media (prefers-reduced-motion: reduce) { .lightbox-dbl { transition: none; } }
.lightbox-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  color: var(--fg);
  cursor: var(--cur-tap);
  transition: background-color 0.2s;
}
.lightbox-close:hover { background: color-mix(in srgb, var(--fg) 16%, transparent); }
.lightbox-close:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }
.lightbox-close svg { width: 14px; height: 14px; stroke: currentColor; stroke-width: 1.5; fill: none; }
/* 横滑图集的上一张 / 下一张：左右两侧垂直居中，和关闭按钮同一套圆形底 */
.lightbox-nav {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  margin-top: -24px;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: color-mix(in srgb, var(--fg) 8%, transparent);
  color: var(--fg);
  cursor: var(--cur-tap);
  transition: background-color 0.2s, opacity 0.2s;
}
.lightbox-nav.is-prev { left: 16px; }
.lightbox-nav.is-next { right: 16px; }
.lightbox-nav:hover:not(:disabled) { background: color-mix(in srgb, var(--fg) 16%, transparent); }
.lightbox-nav:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }
.lightbox-nav:disabled { opacity: 0.3; cursor: default; }
.lightbox-nav svg { width: 20px; height: 20px; fill: currentColor; }
.lightbox-nav.is-prev svg { margin-left: 5px; } /* 图标本身偏左，挪回视觉居中 */

/* 左文右图 */
.cs-body > .cs-split {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: 5fr 7fr;
  gap: var(--cs-gap);
  align-items: center; /* 左栏（小标题 + 正文，构建时收进 .cs-split-text）与右图上下居中对齐（2026-11-22） */
  margin: 16px 0 48px; /* 2026-11-22 由 8px 0 24px 加大：相邻两组左文右图之间多留一点 */
}
.cs-split .cs-figure { margin: 0; }
/* 左栏对准图片本身的中心，不算下方的图注：分成上下两行，图片在第一行、图注在第二行（图注所在的 figure 用 subgrid 跨两行），
   左栏只占第一行、在其中上下居中。不支持 subgrid 的浏览器照旧与整块图（含图注）居中 */
@supports (grid-template-rows: subgrid) {
  .cs-body > .cs-split { grid-template-rows: auto auto; row-gap: 0; }
  .cs-split > .cs-split-text { grid-row: 1; }
  .cs-split > .cs-figure { grid-row: 1 / span 2; display: grid; grid-template-rows: subgrid; row-gap: 0; }
}
@media (max-width: 900px) { /* 单栏（上文下图）时不分行 */
  .cs-body > .cs-split { grid-template-rows: none; row-gap: var(--cs-gap); }
  .cs-split > .cs-split-text, .cs-split > .cs-figure { grid-row: auto; }
  .cs-split > .cs-figure { display: block; }
}
.cs-split-text > .cs-h3 { margin-top: 0; }
.cs-split-text > :last-child { margin-bottom: 0; }

/* 并排 / 前后对比 / 横滑 */
.cs-body > .cs-group { grid-column: 1 / -1; display: grid; gap: var(--cs-gap); margin: 32px 0; align-items: start; }
.cs-group.is-pair { grid-template-columns: 1fr 1fr; }
.cs-group.is-before-after { grid-template-columns: 1fr auto 1fr; align-items: center; }
.cs-group.is-carousel {
  grid-auto-flow: column; grid-auto-columns: 62%;
  overflow-x: auto; scroll-snap-type: x mandatory; overscroll-behavior-x: contain;
  scrollbar-width: none; /* 滚动条换成下方的编号与箭头 */
  margin-bottom: 4px;
}
.cs-group.is-carousel::-webkit-scrollbar { display: none; }
.cs-group.is-carousel .cs-figure { scroll-snap-align: start; }
/* 横滑图集下方的控制条（main.js 生成）：左边「01 / 03」，右边上一张 / 下一张。不加分隔线，紧跟图注，
   读作图集的一部分；编号用展示字体（同章节编号），左右两端分别与图片左沿、右沿对齐 */
.cs-body > .cs-carousel-nav {
  grid-column: 1 / -1;
  display: flex; align-items: center; justify-content: space-between;
  margin: 0 0 32px;
}
.cs-carousel-count { font-size: 15px; font-variant-numeric: tabular-nums; color: var(--fg); }
.cs-carousel-count span { color: var(--gray-5); }
.cs-carousel-btns { display: flex; gap: 4px; margin-right: -10px; } /* 箭头字形在 40px 按钮里居中，右侧留出 10px：抵掉，→ 与图片右沿齐平 */
.cs-carousel-btns button {
  width: 40px; height: 40px; display: grid; place-items: center;
  padding: 0; border: 0; background: none; cursor: var(--cur-tap);
  font: inherit; font-size: 20px; line-height: 1; color: var(--fg);
  transition: color 0.2s var(--ease);
}
.cs-carousel-btns button svg { display: block; width: 1em; height: 1em; }
.cs-carousel-btns button:first-child svg { transform: scaleX(-1); } /* 上一张：同一个箭头水平翻转 */
.cs-carousel-btns button:hover { color: var(--accent); }
.cs-carousel-btns button:disabled { color: var(--gray-4); cursor: default; }
.cs-carousel-btns button:focus-visible { outline: 1px solid var(--fg); outline-offset: -4px; }
.cs-group .cs-figure { margin: 0; }
.cs-arrow { font-size: 24px; color: var(--gray-5); }
.cs-arrow { display: inline-flex; align-items: center; justify-content: center; }
.cs-arrow svg { display: block; width: 1em; height: 1em; }

/* ---------- 卡片 / 数据 / 陈述 / 引语 ---------- */
.cs-body > .cs-cards,
.cs-body > .cs-stats,
.cs-body > .cs-statement { grid-column: 1 / -1; }
.cs-cards {
  margin: 32px 0;
  padding: 0;
  list-style: none;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  border-top: 1px solid var(--line);
  border-left: 1px solid var(--line);
}
/* 正好 4 张卡片时排成 2 × 2，不在三列里剩下孤零零一张；:where 不加优先级，窄屏的两列 / 一列照常生效 */
.cs-cards:where(:has(> li:nth-child(4):last-child)) { grid-template-columns: repeat(2, 1fr); }
.cs-card {
  padding: clamp(18px, 1.8vw, 28px);
  border-right: 1px solid var(--line);
  border-bottom: 1px solid var(--line);
}
/* 编号卡片：数字栏涂黑，用标题字体 */
.cs-cards.is-numbered .cs-card { padding: 0; display: flex; flex-direction: column; }
.cs-card-num {
  display: block;
  padding: 14px clamp(18px, 1.8vw, 28px) 12px;
  background: var(--gray-8);
  color: var(--gray-0);
  font-size: clamp(28px, 2.4vw, 40px);
  line-height: 1;
}
.cs-cards.is-numbered .cs-card-body { padding: clamp(18px, 1.8vw, 28px); }
.cs-card h4 { margin: 0 0 10px; font-size: 15px; font-weight: var(--weight-strong); line-height: 1.35; }
.cs-body .cs-card p { margin: 0; font-size: 14px; line-height: 1.6; color: var(--gray-6); }
.cs-stats {
  margin: 40px 0 0;
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(min(100%, 180px), 1fr));
  gap: var(--cs-gap);
}
.cs-body > .cs-stats:not(:last-child) { margin-bottom: 40px; } /* 数据后面还有正文时留出间距 */
/* 正好 6 个数据时排成 3 × 2，不让最后一个单独落到下一行 */
@media (min-width: 541px) { .cs-stats:has(> li:nth-child(6):last-child) { grid-template-columns: repeat(3, 1fr); } }
.cs-stats li { padding-top: 16px; border-top: 1px solid var(--gray-8); display: flex; flex-direction: column; gap: 8px; }
.cs-stat-num { font-size: clamp(48px, 5vw, 80px); line-height: 1; }
.cs-stat-label { font-size: 13px; color: var(--gray-5); }
.cs-body p.cs-statement {
  margin: 32px 0;
  padding: clamp(28px, 3vw, 48px) 0;
  border-top: 1px solid var(--gray-8);
  border-bottom: 1px solid var(--gray-8);
  font-size: clamp(24px, 2.4vw, 38px);
  line-height: 1.3;
  color: var(--fg);
}
/* 引语：大字号标题字体，关键词用重点色，其余灰色 */
.cs-body > .cs-quote { grid-column: 1 / -1; }
.cs-quote {
  margin: clamp(40px, 5vw, 72px) 0 0;
  padding: clamp(40px, 5vw, 72px) 0;
  border-top: 1px solid var(--gray-8);
  border-bottom: 1px solid var(--gray-8);
}
.cs-body .cs-quote p {
  margin: 0;
  max-width: 18em;
  font-family: var(--font-display);
  font-weight: var(--weight-display);
  letter-spacing: var(--tracking-display);
  font-size: clamp(30px, 3.6vw, 60px);
  line-height: 1.18;
  color: var(--gray-4);
  text-wrap: balance;
}
.cs-body .cs-quote p strong { color: var(--accent); } /* 关键词用重点色 */
/* 中文引言只在标点处换行，分句保持完整（不会剩一个「位：」单独落到下一行）；分句比一行还长时才在字间断开 */
@media (min-width: 541px) { :root[lang="zh-CN"] .cs-body .cs-quote p { word-break: keep-all; overflow-wrap: anywhere; text-wrap: balance; } }
/* 手机上一行放不下整个分句，按字照常换行，只避免最后一行剩一两个字 */
@media (max-width: 540px) { :root[lang="zh-CN"] .cs-body .cs-quote p { text-wrap: pretty; } }
.cs-quote cite {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-top: clamp(24px, 2.5vw, 36px);
  font-size: 12px;
  font-style: normal;
  line-height: 1.5;
  color: var(--gray-5);
}
.cs-quote cite::before { content: ""; flex: none; width: 24px; height: 1px; background: var(--gray-3); }

/* ---------- 项目过程：默认折叠，概述之后直接接方案；折叠处只留一行展开按钮 ---------- */
.cs-process-bar {
  max-width: var(--cs-max);
  margin: 0 auto;
  padding: var(--cs-section-space) var(--gutter) 0;
  display: grid;
  grid-template-columns: repeat(var(--cs-cols), 1fr);
  column-gap: var(--cs-gap);
}
/* 展开按钮：同 Back to index 的用法，展开 / 收起图标在左、一行小字在右，按钮只占内容宽度；
   按钮滚到屏幕中间时折叠的章节紧贴按钮下方往上渐显探出一截（main.js），
   图标的两道 V 形同时张开，像把内容拉出来；展开后两道 V 形各自翻转成收起图标，滚到中间时向内合拢 */
.cs-process-toggle {
  grid-column: var(--cs-start) / -1;
  position: relative;
  z-index: 1;
  justify-self: start;
  display: inline-flex;
  align-items: center;
  gap: 4px; /* 加上图标右侧留白，视觉约 8px，与 Back to index 一致 */
  margin: 0;
  padding: 4px 0;
  border: 0;
  background: transparent;
  color: var(--fg);
  font: inherit;
  text-align: left;
  cursor: var(--cur-tap);
}
.cs-process-text {
  font-size: 12px;
  font-weight: 500;
  line-height: 1;
  letter-spacing: 0.02em;
  text-transform: uppercase;
  white-space: nowrap;
  transition: color 0.3s;
}
.cs-process-toggle[aria-expanded="true"] .cs-process-show,
.cs-process-toggle[aria-expanded="false"] .cs-process-hide { display: none; }
/* 文字动效与 Back to index 同款：平时无下划线，激活时逐字母滚动、下划线从左往右展开；
   按钮滚到屏幕中间时由脚本加在整块上（is-hover，与探出同步），鼠标悬停在按钮上时也会播放 */
.cs-process-show,
.cs-process-hide {
  padding-bottom: 4px;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: background-size 0.4s var(--ease);
}
.cs-process.is-hover .cs-process-show,
.cs-process.is-hover .cs-process-hide,
.cs-process-toggle:hover .cs-process-show,
.cs-process-toggle:hover .cs-process-hide,
.cs-process-toggle:focus-visible .cs-process-show,
.cs-process-toggle:focus-visible .cs-process-hide { background-size: 100% 1px; }
.cs-process-toggle .c { display: inline-block; vertical-align: top; overflow: hidden; line-height: 1.2; }
.cs-process-toggle .c-roll {
  display: inline-block;
  position: relative;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
  transition-delay: calc(var(--i) * 22ms);
}
.cs-process-toggle .c-roll::after { content: attr(data-ch); position: absolute; left: 0; top: 100%; }
.cs-process.is-hover .cs-process-toggle .c-roll,
.cs-process-toggle:hover .c-roll,
.cs-process-toggle:focus-visible .c-roll { transform: translateY(-100%); }
@media (prefers-reduced-motion: reduce) {
  .cs-process-show, .cs-process-hide, .cs-process-toggle .c-roll { transition: none; }
  .cs-process.is-hover .cs-process-toggle .c-roll, .cs-process-toggle:focus-visible .c-roll { transform: none; }
}
.cs-process-toggle:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; }
.cs-process-toggle:active .cs-process-text { color: var(--accent); }
/* 图形左边沿与正文列对齐（viewBox 左侧留白约 6/24） */
.cs-process-icon { flex: none; width: 18px; height: 18px; margin-left: -4.5px; fill: currentColor; overflow: visible; }
.cs-process-icon path {
  transform-box: fill-box;
  transform-origin: center;
  transition: transform 0.6s linear(0, 0.2 7%, 0.53 16%, 0.83 27%, 0.98 37%, 1.035 46%, 1.04 52%, 1.02 63%, 1.003 76%, 0.998 88%, 1);
}
.cs-process.is-hover .cs-process-chev-up { transform: translateY(-2.5px); }
.cs-process.is-hover .cs-process-chev-down { transform: translateY(2.5px); }
.cs-process-toggle[aria-expanded="true"] path { transform: scaleY(-1); }
.cs-process.is-hover .cs-process-toggle[aria-expanded="true"] .cs-process-chev-up { transform: translateY(2px) scaleY(-1); }
.cs-process.is-hover .cs-process-toggle[aria-expanded="true"] .cs-process-chev-down { transform: translateY(-2px) scaleY(-1); }
@media (prefers-reduced-motion: reduce) { .cs-process-icon path { transition: none; } }
/* 渐隐的起止位置注册成长度，收起到探出高度时才能连续地从「底边 64px」过渡到探出的那套渐隐（不支持时直接跳变） */
@property --fa { syntax: '<length-percentage>'; inherits: false; initial-value: 0px; }
@property --fb { syntax: '<length-percentage>'; inherits: false; initial-value: 0px; }
/* 探出与展开 / 收起动画中：内容底边柔和地渐隐 */
.cs-process-content.is-peeking,
.cs-process-content.is-animating {
  overflow: clip;
  -webkit-mask-image: linear-gradient(to bottom, #000 calc(100% - 64px), transparent);
  mask-image: linear-gradient(to bottom, #000 calc(100% - 64px), transparent);
}
.cs-process-content.is-peeking { cursor: var(--cur-tap); }
/* 探出时的渐隐：在 A → B 之间按 S 形（余弦）曲线从不透明过渡到透明，开头和结尾都缓，没有生硬的边。
   A / B 由 main.js 设为第一章标题第一行的中间 / 正文第二行再往下大半行（过渡拉长，标题下沿微淡，正文第一行由浅到无）；
   量不到时默认是下沿 72px */
.cs-process-content.is-peeking,
.cs-process-content.is-animating.to-peek {
  --fa: var(--peek-fade-a, calc(100% - 72px));
  --fb: var(--peek-fade-b, 100%);
  --fade: linear-gradient(to bottom,
    #000 var(--fa),
    rgba(0, 0, 0, 0.9) calc(var(--fa) + (var(--fb) - var(--fa)) * 0.2),
    rgba(0, 0, 0, 0.65) calc(var(--fa) + (var(--fb) - var(--fa)) * 0.4),
    rgba(0, 0, 0, 0.35) calc(var(--fa) + (var(--fb) - var(--fa)) * 0.6),
    rgba(0, 0, 0, 0.1) calc(var(--fa) + (var(--fb) - var(--fa)) * 0.8),
    transparent var(--fb));
  -webkit-mask-image: var(--fade);
  mask-image: var(--fade);
}
/* 探出时只露出第一章：其余章节不参与排版，探出 / 缩回的每一帧不必重排整段 02–10（也不会提前加载它们的图片） */
.cs-process-content.is-peeking > :not(:first-child) { display: none; }
/* 引导紧贴它下面的章节，读起来是它的前导：折叠时是方案，展开时是 02。
   间距随展开 / 收起一起过渡（时长与高度动画一致），不会在动画结束时跳一下 */
.cs-process + .cs-section {
  padding-top: clamp(16px, 1.6vw, 22px);
  transition: padding-top 0.5s cubic-bezier(0.22, 1, 0.36, 1);
}
.cs-process.is-open + .cs-section { padding-top: var(--cs-section-space); transition-duration: 0.7s; }
.cs-process-content > .cs-section:first-child { padding-top: clamp(16px, 1.6vw, 22px); }
@media (prefers-reduced-motion: reduce) { .cs-process + .cs-section { transition: none; } }
/* ---------- 内容页响应式 ---------- */
@media (max-width: 900px) {
  .cs-intro, .cs-section, .cs-section-cont, .cs-process-bar { grid-template-columns: 1fr; }
  .cs-intro > *, .cs-section > *, .cs-section-cont > *, .cs-process-bar > * { grid-column: 1 / -1; }
  /* 手机 / 中等屏：封面单栏；底部留出章节胶囊（.cs-dock）的位置，项目信息不被它压住 */
  .cs-cover { grid-template-columns: 1fr; grid-template-rows: none; padding-top: clamp(32px, 6vh, 64px); }
  .cs-cover > *, .cs-intro .cs-intro-rail { grid-column: 1 / -1; }
  .cs-intro .cs-intro-rail { grid-row: 1; margin: 0 0 24px; }
  .cs-title { grid-row: 2; align-self: start; margin: 0; }
  .cs-subtitle { grid-row: 3; margin-top: clamp(40px, 9vw, 72px); padding-right: 0; }
  .cs-meta { grid-row: 4; margin-top: 28px; padding-top: 0; border-top: 0; grid-template-columns: 1fr 1fr; gap: 20px var(--cs-gap); }
  .cs-meta > div { display: block; }
  .cs-meta dt { margin-bottom: 8px; }
  .cs-intro .cs-note, .cs-lede { grid-column: 1 / -1; }
  .cs-rail { position: static; flex-direction: row; align-items: baseline; gap: 16px; }
  .cs-body, .cs-section > .cs-body { border-top: 0; padding-top: 32px; grid-template-columns: 1fr; }
  .cs-body > * { grid-column: 1 / -1; }
  .cs-body > .cs-split { grid-template-columns: 1fr; }
  .cs-cards { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 540px) {
  .cs-group.is-pair { grid-template-columns: 1fr; }
  .cs-group.is-before-after { grid-template-columns: 1fr; }
  .cs-arrow { transform: rotate(90deg); justify-self: center; }
  .cs-group.is-carousel { grid-auto-columns: 85%; }
  .cs-meta { grid-template-columns: 1fr; gap: 12px; }
  .cs-cover { --cs-t: clamp(44px, 15vw, 72px); } /* 手机：72px 时「chichisong」比屏幕还宽，会把整页撑出横向滚动 */
  .cs-meta > div { display: grid; } /* 手机：回到左标签、右内容的竖排规格表 */
  .cs-meta dt { margin: 0; }
  .cs-cards { grid-template-columns: 1fr; }
}

/* ---------- 章节索引（桌面端）：当前章节完整显示，已读章节压扁成一行叠在上方 ---------- */
.cs-index { display: none; }
/* 顶栏到章节导航的距离 = 每行压扁章节的高度（含分隔线）；脚本也读取这个值 */
:root { --cs-index-gap: 32px; }
@media (min-width: 901px) {
  /* 原章节栏只保留顶部分隔线，内容交给固定的章节索引显示 */
  .has-cs-index .cs-rail { position: static; }
  /* 只隐藏已进入导航的章节（当前与已读）；尚未到达的章节左栏照常显示，随页面滚上来 */
  .has-cs-index .cs-rail.is-indexed > * { visibility: hidden; }
  .has-cs-index .cs-rail.is-indexed { border-top-color: transparent; } /* 分隔线由导航自己的线代替 */
  .has-cs-index .cs-index {
    display: block;
    position: fixed;
    z-index: 5;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s;
  }
  .has-cs-index .cs-index.is-on { opacity: 1; pointer-events: auto; }
  /* 通栏大图经过时：脚本用遮罩只藏起和大图重叠的那一段；整个导航都被盖住时也不响应点击 */
  .has-cs-index .cs-index.is-on.is-over-hero { pointer-events: none; }
}
.cs-index-item[hidden] { display: none; } /* 折叠的项目过程章节 */
.cs-index-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  margin: 0;
  padding: 4px 0; /* 压扁行高 24px（含分隔线），与导航距顶栏的间距一致 */
  border: 0;
  border-top: 1px solid var(--line);
  background: transparent;
  color: var(--gray-5);
  text-align: left;
  cursor: var(--cur-tap);
  overflow: hidden;
  transition: padding 0.5s var(--ease), color 0.3s;
}
.cs-index-num {
  font-size: 15px;
  line-height: 1;
  transition: font-size 0.5s var(--ease);
}
.cs-index-eyebrow {
  font-size: 10px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  line-height: 1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
/* 悬停：黑色背景从鼠标进来的那条边（上 / 下）展开，文字被黑色盖住的部分变为白色；
   移开时朝鼠标离开的那条边收成一条线再淡出（main.js 的 fillHover） */
.cs-index-fill {
  position: absolute;
  top: 0;
  bottom: 0;
  left: -10px;
  right: 0;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 4px 0 4px 10px;
  background: var(--gray-8);
  color: var(--gray-0);
  clip-path: inset(0 0 100% 0);
  pointer-events: none;
}
.cs-index-item.is-past:focus-visible .cs-index-fill { clip-path: inset(0 0 0 0); }
.cs-index-item.is-current .cs-index-fill { display: none; }

/* 压扁行：按字形实测让数字与眉题看起来一样大、上下居中，行高 = --cs-index-gap（32px）
   英文：Adventor 数字大写高 0.75em、Switzer 大写高 0.69em，故数字 8.75px ≈ 眉题 9.5px（字形高约 6.6px）；
         Adventor 在行高 1 时字形偏下约 0.1em，上移校正
   中文：系统字体数字字形高 0.72em、汉字约 0.93em，故数字 11.5px ≈ 汉字 9px（字形高约 8.3px） */
/* 压扁行的数字字号；行内上下留白按「行高 − 分隔线 − 最高的字号」平分 */
:root { --cs-past-num: 10px; }
:root[lang="zh-CN"] { --cs-past-num: 13px; }
.cs-index-item.is-past { padding: calc((var(--cs-index-gap) - 1px - var(--cs-past-num)) / 2) 0; }
.cs-index-item.is-past .cs-index-fill { padding: calc((var(--cs-index-gap) - 1px - var(--cs-past-num)) / 2) 0 calc((var(--cs-index-gap) - 1px - var(--cs-past-num)) / 2) 10px; }
.cs-index-item.is-past .cs-index-num { font-size: var(--cs-past-num); transform: translateY(0.13em); } /* 按字形实测：数字墨迹中心与眉题对齐（原 -0.1em 偏高约 2px） */
.cs-index-item.is-past .cs-index-eyebrow { font-size: 9.5px; }
:root[lang="zh-CN"] .cs-index-item.is-past .cs-index-num { transform: translateY(-0.03em); }
:root[lang="zh-CN"] .cs-index-item.is-past .cs-index-eyebrow { font-size: 9px; }
/* 当前章节：与原章节栏相同的完整样式 */
.cs-index-item.is-current {
  flex-direction: column;
  align-items: flex-start;
  gap: 12px;
  padding: 20px 0 16px;
  color: var(--fg);
  cursor: default;
}
.cs-index-item.is-current .cs-index-num { font-size: var(--fs-num); }
.cs-index-item.is-current .cs-index-eyebrow { font-size: 11px; color: var(--gray-5); font-weight: 500; }
.cs-index-item.is-future { display: none; }
/* 「收起项目过程」行：压扁行样式，图标代替编号。编号位里放一个隐形的「01」撑出同样宽度，文字与各行眉题对齐；
   图标居中叠在编号位上，布局高度与数字相同（不改变行高），图形放大到约 12px */
/* 编号的字形校正位移不用于图标（中英文的 is-past 规则都要盖过） */
:root .cs-index-item.cs-index-hide.is-past .cs-index-num { position: relative; transform: none; }
.cs-index-ghost { visibility: hidden; }
.cs-index-hide .cs-process-icon {
  /* 图形中心与上下各行编号（01 / 02）的中心对齐 */
  position: absolute; left: 50%; top: 50%;
  width: var(--cs-past-num); height: var(--cs-past-num); margin: 0;
  transform: translate(-50%, -50%) scale(1.25);
}
/* 过程展开时是「收起」，图标上下翻转；折叠时是「显示」（.is-show），图标保持原样 */
.cs-index-hide .cs-process-icon path { transform: scaleY(-1); transition: none; }
.cs-index-hide.is-show .cs-process-icon path { transform: none; }

/* =========================================================
   首页：按参考稿（homepage-source）校准的静态布局与字体
   ========================================================= */
/* 顶栏 */
.site-header { gap: 0; padding: 0 32px; } /* 左右边距与首页底栏（32px）对齐 */
/* 首页：顶栏下方的分隔线由卡片的上边线提供（与参考稿一致） */
/* 保留 1px 透明下边框（不是 0）：内容页的顶栏有这 1px，两页盒子一样高，从首页进内容页时顶栏文字不会差 0.5px 跳一下 */
.home .site-header { border-bottom: 1px solid transparent; }
/* .home .project { border-top: 1px solid var(--line); }  顶栏下方的分割线：已按要求去掉（试看效果） */
.lang-toggle { gap: 7px; margin-right: 20px; padding: 0; font-family: var(--font-switzer); font-size: 11px; line-height: normal; }
.brand { line-height: 1.5; }
.lang-toggle [data-code] {
  padding: 8px 3px;
  opacity: 1;
  color: var(--gray-5); /* 未选中的语言：原 gray-4 压在图片上容易看不清，提高一档（浅色 / 深色模式都更醒目） */
  font-weight: 400;
  text-decoration: none;
  text-underline-offset: 5px;
}
.lang-toggle .sep { opacity: 1; color: var(--gray-2); }
:root[lang="zh-CN"] .lang-toggle [data-code="zh-CN"],
:root[lang="en"] .lang-toggle [data-code="en"] {
  color: currentColor;
  font-weight: 700;
  text-decoration: underline;
  text-decoration-thickness: auto;
}
.menu-toggle {
  width: 40px;
  height: 40px;
  margin-right: -11px; /* 图标（18px）居中在 40px 的按钮里、离按钮右沿 11px：往外挪 11px，让图标右沿和底栏右沿（日照地球）对齐 */
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  gap: 5px;
}
.menu-toggle span { width: 18px; height: 1px; margin: 0; }
.menu-open .menu-toggle span { width: 26px; }
.menu-open .menu-toggle span:nth-child(1) { transform: translateY(3px) rotate(45deg); }
.menu-open .menu-toggle span:nth-child(2) { transform: translateY(-3px) rotate(-45deg); }

/* 卡片：编号与文字绝对定位，与参考稿相同的边距 */
.projects { min-height: 620px; }
.project { display: block; }
/* 分隔线画在每张卡片右侧（最后一张除外），卡片内容不因线宽右移 */
.project + .project { border-left: 0; }
.project { border-right: 1px solid var(--line); }
.project:last-child { border-right: 0; }
.project .index {
  position: absolute;
  top: 30px;
  left: 32px;
  right: 32px;
  max-width: none;
  padding: 0;
  z-index: 2;
  font-size: 30px;
  line-height: normal;
  letter-spacing: -0.06em;
}
:root[lang="zh-CN"] .project .index { letter-spacing: -0.03em; }
.project .index::before,
:where(body:not(.cards-tap)) .project:hover .index::before,
.project:focus-visible .index::before { width: 20px; height: 1px; }
.project-text { position: absolute; left: 32px; right: 28px; bottom: 40px; padding: 0; }
.project-label {
  margin: 0 0 13px;
  font-size: 9px;
  letter-spacing: 1.5px;
  line-height: normal;
  color: var(--gray-4);
}
.project-title { line-height: 1.15; letter-spacing: -0.04em; }
:root[lang="zh-CN"] .project-title { line-height: 1.3; letter-spacing: -0.03em; }
.project-summary {
  max-width: 36em; /* 填满卡片左右边距（到 ~1960px 宽屏仍与标题、箭头右缘齐平，超宽屏才收束行长） */
  padding-top: 17px;
  font-size: 12px;
  line-height: 1.9;
  color: var(--inv-fg-3);
}
.project-cta { margin-top: 0; padding-top: 23px; font-size: 10px; letter-spacing: 1px; }
/* 触屏：首次点按展开概述（与悬停相同），再次点按进入项目 */
.project.is-active { background: var(--inv-bg); color: var(--inv-fg); }
.project.is-active .project-label { color: var(--inv-fg-2); }
.project.is-active .project-media { transform: translateY(-30px) scale(1.04); }
.project.is-active .img-default { opacity: 0; transform: translateY(-14px); }
.project.is-active .img-hover { opacity: 1; transform: none; }
.project.is-active .project-more { grid-template-rows: 1fr; }
.project.is-active .project-more > div { opacity: 1; transform: none; }
.project.is-cover.is-active .project-media { transform: none; }
.project.is-cover.is-active .project-media :is(img, canvas) { transform: scale(1.04); }
.project.is-cover.is-active .project-media::after { opacity: 0; }
.project.is-cover.is-active .project-media::before { opacity: 1; }

/* 底栏：无分隔线，左侧大写小字，中间说明居中 */
.home-footer { border-top: 0; padding: 0 32px; color: color-mix(in srgb, var(--gray-5) 78%, var(--gray-4)); } /* #747477 */
.footer-meta, .footer-note { white-space: nowrap; }
.footer-meta { font-size: 9px; letter-spacing: 1px; line-height: normal; }
.footer-note { font-size: 10px; letter-spacing: 0.5px; line-height: normal; }

@media (min-width: 1600px) {
  .project:not(.is-cover) .project-media { top: 14%; height: 60%; }
  .project-text { bottom: 60px; }
}
@media (max-width: 900px) {
  .site-header { padding: 0 24px; }
  .projects { height: auto; }
  .project .index { left: 24px; right: 24px; }
  .project-text { left: 24px; }
  .home-footer { padding: 0 24px; }
}
/* 旧版平板横滑布局：新版轮播（body.home-carousel，≥541px）接管后不再用；只在脚本没运行时作为退路 */
@media (min-width: 541px) and (max-width: 900px) {
  body:not(.home-carousel) .projects { grid-template-columns: repeat(4, minmax(320px, 1fr)); }
  body:not(.home-carousel) .project { height: 640px; }
}
@media (max-width: 540px) {
  .lang-toggle { margin-right: 14px; }
  body.home .projects { margin-top: calc(-1 * var(--header-h)); } /* 卡片顶到屏幕最上沿，透进渐变模糊顶栏（同项目页沉浸感） */
  .projects { grid-template-columns: 1fr; }
  .project { border-right: 0; }
  .project { height: 100vh; height: 100svh; min-height: 600px; }
  .project:not(.is-cover) .project-media { top: 9%; height: 61%; }
  .project .index { top: calc(var(--header-h) + 20px); font-size: 32px; }
  .project-text { bottom: 32px; }
  .home-footer {
    height: var(--footer-h);
    display: flex;
    justify-content: space-between;
    gap: 12px;
    padding-block: 0;
  }
  .home-footer > span:empty { display: none; } /* 只剩左右两段，分居两端 */
  .footer-meta { font-size: 8px; }
  .footer-note { font-size: 9px; }
}

/* 首页进度刻度：对应 4 张卡片，卡片展开（桌面悬停 / 键盘聚焦，触屏点按或滚到中线）时对应的那一道展开。
   是「章节导航胶囊」（style.css「13.」）的变体：去掉胶囊的背景（玻璃、描边、阴影），只留刻度的设计——
   平时是 4 道细刻度；平时当前卡片那一道只是换成这张卡片的重点色（长度不变）；鼠标悬停在这组刻度上、或手指按住 / 拖拽时，选中的那一道才展开成一块圆角块，里面写 P01 / P02 / P03 / P04（文字由模糊变清晰），
   块的颜色用对应卡片的重点色（也就是弥散光的颜色，--dot-ac），字色按底色深浅取黑或白；邻近的刻度按远近略微变高变亮（鱼眼）。
   桌面在底栏正中，从左往右；手机（≤540）改为屏幕右侧中央、从上到下的一组（.is-side），刻度横着，块向左展开。
   每个刻度是一个按钮：可见的细刻度 3px，点击区域向四周各多出约 5px。按钮里的 .cd-dot 由 main.js 生成；
   --a（沿排列方向的尺寸）、--c（垂直方向的尺寸）、--o（亮度）由 main.js 按远近写在按钮上，展开那一道的尺寸在这里 */
.card-dots { display: flex; align-items: center; justify-content: center; gap: 11px; touch-action: none; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
.card-dots button {
  position: relative;
  flex: none;
  display: block;
  width: var(--a, 3px);
  height: 22px;
  padding: 0;
  border: 0;
  background: none;
  cursor: var(--cur-tap);
  -webkit-tap-highlight-color: transparent;
  transition: width 0.5s var(--ease-out);
}
.card-dots button::after { content: ""; position: absolute; inset: -14px -5px; } /* 点击区域 */
.card-dots .cd-dot {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: var(--c, 13px);
  transform: translateY(-50%);
  border-radius: 2.5px;
  background: var(--fg);
  opacity: var(--o, 0.24);
  overflow: hidden;
  font-style: normal;
  transition: height 0.4s var(--ease-out), opacity 0.35s var(--ease), border-radius 0.4s var(--ease-out), background-color 0.35s var(--ease);
}
.card-dots .cd-label {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-text);
  font-size: 11px;
  font-weight: 500; /* Switzer 只有 400 / 500 / 700 三档，写 600 会落到粗体，看着发圆 */
  line-height: 1;
  letter-spacing: 0.06em;
  -webkit-font-smoothing: antialiased;
  font-variant-numeric: tabular-nums;
  color: var(--ink, #fff);
  white-space: nowrap;
  opacity: 0;
  filter: blur(3px);
  transition: opacity 0.14s ease, filter 0.14s ease;
}
.card-dots button:hover .cd-dot { opacity: 0.5; }
/* 当前卡片那一道（平时）：长度不变，只换成这张卡片的重点色（--ac，main.js 写在按钮上） */
.card-dots button.is-on .cd-dot { background: rgb(var(--ac, var(--fg-rgb, 29, 29, 31))); opacity: 1; }
/* 展开的那一道（鼠标悬停在这组刻度上 / 手指按住）：重点色的圆角块 + 标签 */
.card-dots button.is-pick { --a: 38px; --c: 22px; }
.card-dots button.is-pick .cd-dot { background: rgb(var(--ac, var(--fg-rgb, 29, 29, 31))); border-radius: 8px; opacity: 1; }
.card-dots button.is-pick .cd-label { opacity: 1; filter: none; transition: opacity 0.26s ease 0.12s, filter 0.3s ease 0.12s; }
.card-dots button:focus-visible { outline: 1px solid var(--fg); outline-offset: 6px; border-radius: 4px; }
.card-dots.is-side { display: none; }
@media (max-width: 540px) {
  .home-footer .card-dots { display: none; }
  .card-dots.is-side {
    display: flex;
    flex-direction: column;
    align-items: flex-end;
    gap: 11px;
    position: fixed;
    right: 8px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 14; /* 在卡片之上、菜单（15）之下 */
  }
  /* 竖排：刻度横着，沿排列方向（竖直）的尺寸是 --a，水平方向的长度是 --c；块向左展开，贴右边 */
  .card-dots.is-side button { width: 44px; height: var(--a, 3px); transition: height 0.5s var(--ease-out); }
  .card-dots.is-side button::after { inset: -5px -8px -5px -14px; }
  .card-dots.is-side .cd-dot { left: auto; right: 0; top: 0; bottom: 0; height: auto; width: var(--c, 13px); transform: none; transition: width 0.4s var(--ease-out), opacity 0.35s var(--ease), border-radius 0.4s var(--ease-out), background-color 0.35s var(--ease); }
  .card-dots.is-side button.is-pick { --a: 22px; --c: 38px; }
  /* 压在展开后的深色卡片上：用浅色 */
  .card-dots.is-side .cd-dot { background: var(--inv-fg); }
  .card-dots.is-side button.is-on .cd-dot, .card-dots.is-side button.is-pick .cd-dot { background: rgb(var(--ac, 255, 255, 255)); }
}
@media (prefers-reduced-motion: reduce) {
  .card-dots button, .card-dots .cd-dot, .card-dots .cd-label { transition: none !important; }
  .card-dots .cd-label { filter: none; }
}

/* =========================================================
   首页署名「Seth」待机动画：逐字碰撞后回弹
   动画帧由 main.js 的物理模拟生成（弹簧 + 软接触碰撞），这里只把字母设为可单独移动
   ========================================================= */
.brand .letter { display: inline-block; }

/* =========================================================
   首页卡片悬停阴影：卡片像被抬离纸面，向两侧投下阴影
   阴影画在一个透明的「阴影层」上，由脚本对齐到悬停的卡片。
   透明元素的阴影只出现在它的边框之外，所以只会落在相邻卡片上，
   不会被相邻卡片遮住，也不会被卡片列表的滚动区域裁掉。
   光源设定在屏幕正上方：四层由实到虚的阴影叠加，近处深、远处淡，接近真实投影。
   悬停时阴影从「贴地」的小而淡，过渡到「悬空」的大而柔，与图片放大同一节奏。
   ========================================================= */
.card-shadow {
  position: fixed;
  z-index: 25;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.4s ease;
}
/* 两套阴影各画在一层上，悬停时只交叉淡化透明度（只合成、不重画）；以前是过渡 box-shadow 本身，
   每帧都要重画一整屏高的大模糊阴影 */
.card-shadow::before,
.card-shadow::after {
  content: "";
  position: absolute;
  inset: 0;
}
.card-shadow::before {
  box-shadow:
    0 1px 1px rgba(var(--shadow), 0.04),
    0 2px 4px rgba(var(--shadow), 0.04),
    0 4px 8px rgba(var(--shadow), 0.04),
    0 8px 16px rgba(var(--shadow), 0.04);
}
.card-shadow::after {
  opacity: 0;
  transition: opacity 0.6s cubic-bezier(0.2, 0.7, 0.2, 1);
  box-shadow:
    0 2px 4px rgba(var(--shadow), 0.2),
    0 8px 18px rgba(var(--shadow), 0.24),
    0 20px 44px rgba(var(--shadow), 0.28),
    0 40px 96px rgba(var(--shadow), 0.34);
}
.card-shadow.is-on { opacity: 1; }
.card-shadow.is-on::after { opacity: 1; }
/* 只保留左右阴影：在卡片上下边缘处把阴影层裁平（上下被顶栏和底栏挡住） */
.card-shadow { clip-path: inset(0 -160px); }
@media (prefers-reduced-motion: reduce) {
  .card-shadow, .card-shadow::after { transition: none; }
}
.menu-open .card-shadow { opacity: 0; }
/* 入场转场期间（首页还在从底部升起）卡片在移动，固定定位的阴影层 / 光层跟不上，会偏到底栏上：先不显示 */
html[data-enter] .card-shadow,
html[data-enter] .card-glow { opacity: 0 !important; }

/* =========================================================
   首页卡片悬停：玻璃弥散光
   卡片上下边缘的颜色（由 main.js 从卡片当前显示的图片边缘取色）向上透进顶栏、向下透进底栏，
   在两块玻璃后面化开。光层在顶栏 / 底栏之下、与卡片同宽（只在卡片正上方 / 正下方），不会盖住卡片本身。
   随鼠标视差：光斑跟图片一起左右轻移，鼠标靠近哪条边，哪边的光更亮
   ========================================================= */
.card-glow {
  position: fixed;
  z-index: 13; /* 低于底栏（14）与菜单（15） */
  overflow: hidden; /* 模糊不渗进卡片 */
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.5s ease;
}
.card-glow.is-on {
  opacity: 1;
  /* 出现得慢：先几乎不亮、卡片展开完（约 0.6s）后才明显起来；收起仍按上面的 0.5s（2026-11-09 由 1.4s 加快到 1.1s） */
  transition: opacity 1.1s cubic-bezier(0.7, 0, 0.35, 1);
}
/* 光层自己就要是柔和的，不依赖顶栏 / 底栏的模糊再糊一遍：
   · 顶栏改为渐变模糊后下沿几乎不模糊，只剩光层自身的模糊，光贴着卡片的那一段像一整块；所以上方的光模糊加大
   · 底栏整块模糊会把光层左右的裁切边往外抹开 10–20px，溢出卡片；所以两层都在左右两端（卡片宽度以内）平滑渐隐 */
.card-glow {
  --glow-blur: 16px;
  --glow-sides: linear-gradient(to right, transparent 0, rgba(0, 0, 0, 0.35) 24px, rgba(0, 0, 0, 0.75) 52px, #000 80px,
    #000 calc(100% - 80px), rgba(0, 0, 0, 0.75) calc(100% - 52px), rgba(0, 0, 0, 0.35) calc(100% - 24px), transparent 100%);
  -webkit-mask-image: var(--glow-sides);
  mask-image: var(--glow-sides);
}
.card-glow.is-top { --glow-blur: 26px; }
.card-glow i {
  position: absolute;
  left: -40px;
  right: -40px;
  background: var(--glow);
  filter: blur(var(--glow-blur)) saturate(1.9) brightness(1.08);
  translate: calc(var(--px, 0) * -14px) 0;
  transition: translate 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.6s ease;
}
/* 光贴着卡片边缘最亮，离开卡片逐渐散开 */
.card-glow.is-top i {
  bottom: -24px;
  height: 100%;
  -webkit-mask-image: linear-gradient(to top, #000 35%, transparent);
  mask-image: linear-gradient(to top, #000 35%, transparent);
  opacity: calc(var(--glow-a, 0.6) * (1.05 - var(--py, 0) * 0.3));
}
.card-glow.is-bottom i {
  top: -24px;
  height: 100%;
  /* 下方的光：实心段更长、整体再加强 1.4 倍（图片下缘多为暗色，按亮度取的光本来就偏弱） */
  -webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent);
  mask-image: linear-gradient(to bottom, #000 50%, transparent);
  opacity: calc(var(--glow-a, 0.6) * 1.4 * (1.05 + var(--py, 0) * 0.3));
}
/* Siri 式律动：光层（i）里 5 团光（b）沿卡片边缘排开，各自上下伸缩、明暗呼吸，节奏互相错开（2.9–5.1s），
   交叠处融成一片。颜色只用卡片重点色 --ac（及提亮的 --ac-l）和白 / 浅灰 / 深灰。
   每团光自己模糊一次，动画只动 transform 和 opacity，交给合成器；光层不显示时暂停。
   光层 i 本身不再画渐变、不再模糊（否则里面的光团一动，整层模糊每帧都要重算） */
.card-glow i { background: none; filter: none; isolation: isolate; }
.card-glow b {
  position: absolute;
  width: 40%;
  height: 150%;
  border-radius: 50%;
  --bk: 0.55; /* 每层的模糊倍数：底光最糊、光带次之、光芯最清楚 */
  filter: blur(calc(var(--glow-blur) * var(--bk)));
  animation: 4s ease-in-out infinite alternate both;
  animation-play-state: paused;
  will-change: transform, opacity;
}
.card-glow.is-on b { animation-play-state: running; }
/* 上方的光团贴着卡片上沿（光层底边）往上涨；下方的贴着卡片下沿往下涨 */
.card-glow.is-top b { bottom: -75%; transform-origin: 50% 100%; }
.card-glow.is-bottom b { top: -75%; transform-origin: 50% 0; }
/* 试用（main.js 的 FOOTER_WIDE）：铺满整条底栏的光改为贴着屏幕下沿，从底部向上透出、往上渐隐 */
.card-glow.is-bottom.is-wide i {
  top: auto;
  bottom: -26px; /* 光层大半压在屏幕外，只露出贴边的一条细光带 */
  -webkit-mask-image: linear-gradient(to top, #000 50%, transparent);
  mask-image: linear-gradient(to top, #000 50%, transparent);
  /* 渐隐遮罩只铺一次：默认会在光层之外重复，光在顶栏 / 底栏靠卡片的那一段又亮起来、到卡片边缘被截断，形成一道分界 */
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.card-glow.is-bottom.is-wide b { top: auto; bottom: -75%; transform-origin: 50% 100%; }
/* 同理，铺满顶栏的光贴着屏幕上沿，从顶部向下透出、往下渐隐 */
.card-glow.is-top.is-wide i {
  bottom: auto;
  top: -26px;
  -webkit-mask-image: linear-gradient(to bottom, #000 50%, transparent);
  mask-image: linear-gradient(to bottom, #000 50%, transparent);
  /* 渐隐遮罩只铺一次：默认会在光层之外重复，光在顶栏 / 底栏靠卡片的那一段又亮起来、到卡片边缘被截断，形成一道分界 */
  -webkit-mask-repeat: no-repeat;
  mask-repeat: no-repeat;
}
.card-glow.is-top.is-wide b { bottom: auto; top: -75%; transform-origin: 50% 0; }
/* 参考 Siri 灵动岛：光分三层，深浅分明
   · 底光（1）：很宽、很糊、很淡的一层，慢慢呼吸，给整条光带打底
   · 光带（2–5）：两头尖的扁长光带，模糊较小、边缘较清楚；左右来回滑动、互相穿插，同时上下伸缩。
     深色模式下光带之间按「滤色」叠加，交叠处自动变亮，像几条彩带交错
   · 光芯（6–7）：窄而亮的提亮色，跟着光带交叠处快一点地闪动，是整团光最亮的地方
   颜色仍只用重点色 --ac（提亮 --ac-l、偏灰 --ac-s）和浅灰 */
.card-glow b:nth-child(1) { left: 0; width: 100%; --bk: 1.6;
  background: radial-gradient(closest-side, rgba(var(--ac-s), 0.45), rgba(var(--ac-s), 0.18) 60%, rgba(var(--ac-s), 0));
  animation-name: siri-haze; animation-duration: 6.4s; }
.card-glow b:nth-child(2) { left: 4%;  width: 42%; background: radial-gradient(closest-side, rgba(var(--ac), 0.95), rgba(var(--ac), 0.7) 45%, rgba(var(--ac), 0)); animation-name: siri-1; animation-duration: 4.6s; }
.card-glow b:nth-child(3) { left: 30%; width: 36%; background: radial-gradient(closest-side, rgba(var(--ac-l), 0.85), rgba(var(--ac-l), 0.5) 45%, rgba(var(--ac-l), 0)); animation-name: siri-2; animation-duration: 3.8s; animation-delay: -1.4s; }
.card-glow b:nth-child(4) { left: 54%; width: 42%; background: radial-gradient(closest-side, rgba(var(--ac), 0.9), rgba(var(--ac), 0.65) 45%, rgba(var(--ac), 0)); animation-name: siri-3; animation-duration: 5.2s; animation-delay: -2.6s; }
.card-glow b:nth-child(5) { left: 18%; width: 50%; background: radial-gradient(closest-side, rgba(var(--ac-s), 0.8), rgba(var(--ac-s), 0.4) 45%, rgba(var(--ac-s), 0)); animation-name: siri-4; animation-duration: 4.2s; animation-delay: -0.8s; }
.card-glow b:nth-child(6) { left: 28%; width: 16%; height: 110%; --bk: 0.4;
  background: radial-gradient(closest-side, rgba(var(--ac-l), 1), rgba(var(--ac-l), 0.6) 50%, rgba(var(--ac-l), 0));
  animation-name: siri-core-1; animation-duration: 2.6s; }
.card-glow b:nth-child(7) { left: 58%; width: 14%; height: 110%; --bk: 0.4;
  background: radial-gradient(closest-side, rgba(255, 255, 255, 0.85), rgba(var(--ac-l), 0.5) 50%, rgba(var(--ac-l), 0));
  animation-name: siri-core-2; animation-duration: 3.1s; animation-delay: -1.3s; }
.card-glow.is-top.is-wide b:nth-child(n+6) { top: -55%; }
.card-glow.is-bottom.is-wide b:nth-child(n+6) { bottom: -55%; }
:root[data-theme="dark"] .card-glow b:nth-child(n+2) { mix-blend-mode: screen; }
/* 光带：左右滑动 + 上下伸缩（以贴边的那条边为基点），两头被横向拉长时更尖、更扁 */
@keyframes siri-haze {
  0%   { transform: scale(0.92, 0.8); opacity: 0.6; }
  100% { transform: scale(1.04, 1.15); opacity: 1; }
}
@keyframes siri-1 {
  0%   { transform: translateX(-6%) scale(0.85, 0.55); opacity: 0.6; }
  45%  { transform: translateX(22%) scale(1.15, 1.25); opacity: 1; }
  100% { transform: translateX(8%) scale(0.95, 0.75); opacity: 0.8; }
}
@keyframes siri-2 {
  0%   { transform: translateX(30%) scale(1.1, 1.1); opacity: 0.5; }
  55%  { transform: translateX(-25%) scale(0.8, 0.6); opacity: 0.95; }
  100% { transform: translateX(10%) scale(1.2, 1.3); opacity: 0.65; }
}
@keyframes siri-3 {
  0%   { transform: translateX(8%) scale(0.9, 0.7); opacity: 0.95; }
  50%  { transform: translateX(-24%) scale(1.2, 1.35); opacity: 0.6; }
  100% { transform: translateX(-4%) scale(0.85, 0.6); opacity: 1; }
}
@keyframes siri-4 {
  0%   { transform: translateX(-18%) scale(0.9, 0.5); opacity: 0.3; }
  50%  { transform: translateX(26%) scale(1.1, 1.1); opacity: 0.85; }
  100% { transform: translateX(0) scale(0.95, 0.8); opacity: 0.45; }
}
/* 光芯：幅度更大、节奏更快，在光带交叠处一亮一暗 */
@keyframes siri-core-1 {
  0%   { transform: translateX(-40%) scale(0.6, 0.5); opacity: 0.2; }
  50%  { transform: translateX(60%) scale(1.3, 1.2); opacity: 1; }
  100% { transform: translateX(120%) scale(0.8, 0.7); opacity: 0.35; }
}
@keyframes siri-core-2 {
  0%   { transform: translateX(80%) scale(1.1, 1); opacity: 0.9; }
  50%  { transform: translateX(-30%) scale(0.6, 0.55); opacity: 0.25; }
  100% { transform: translateX(-90%) scale(1.25, 1.15); opacity: 0.8; }
}
/* 浅色模式：亮色光叠在 #f5f5f7 上几乎看不出。改为正片叠底（光色直接染进浅底），
   并提饱和、略压暗、加大不透明度，让肉眼上的明显程度接近深色模式 */
:root:not([data-theme="dark"]) .card-glow { mix-blend-mode: multiply; }
/* 单张卡片要更亮更显眼时（卡片上 data-glow-light-a > 1，如 02）：正片叠底下亮色反而更淡，改为普通叠加，光色本身的亮度直接显出来 */
:root:not([data-theme="dark"]) .card-glow.is-bright { mix-blend-mode: normal; }
/* 不透明度已到顶（再乘也被截在 1），要更明显只能让光色更浓：再提饱和、压暗，正片叠底后在浅底上染得更深 */
/* 浅色模式：形状、位置、大小、模糊、律动完全沿用深色模式（贴着卡片边缘一窄条、两端柔和地没入卡片，像波浪），
   只换颜色——正片叠底下白色看不见、浅色只染一层薄色，所以提亮的那团改用重点色本色、偏白的打底改用柔和色，
   再整体提饱和、压暗，让光带与浅底的反差接近深色模式里光带与深底的反差 */
:root:not([data-theme="dark"]) .card-glow b { filter: blur(calc(var(--glow-blur) * var(--bk))) saturate(1.3); }
/* 浅色模式（正片叠底）：白色看不见，光带都改用饱和拉满、亮度取中的鲜艳色 --ac-v（main.js 的 vivid()）；
   光芯用最浓的 --ac-v，交叠处颜色最深，就是浅底上的「最亮处」；底光用柔和色 --ac-s 打一层薄底 */
:root:not([data-theme="dark"]) .card-glow b:nth-child(1) { background: radial-gradient(closest-side, rgba(var(--ac-s), 0.4), rgba(var(--ac-s), 0.15) 60%, rgba(var(--ac-s), 0)); }
:root:not([data-theme="dark"]) .card-glow b:nth-child(2),
:root:not([data-theme="dark"]) .card-glow b:nth-child(4) { background: radial-gradient(closest-side, rgba(var(--ac-v), 0.95), rgba(var(--ac-v), 0.75) 45%, rgba(var(--ac-v), 0)); }
:root:not([data-theme="dark"]) .card-glow b:nth-child(3) { background: radial-gradient(closest-side, rgba(var(--ac-v), 0.7), rgba(var(--ac-v), 0.4) 50%, rgba(var(--ac-v), 0)); }
:root:not([data-theme="dark"]) .card-glow b:nth-child(5) { background: radial-gradient(closest-side, rgba(var(--ac-s), 0.6), rgba(var(--ac-s), 0.3) 50%, rgba(var(--ac-s), 0)); }
:root:not([data-theme="dark"]) .card-glow b:nth-child(6),
:root:not([data-theme="dark"]) .card-glow b:nth-child(7) { background: radial-gradient(closest-side, rgba(var(--ac-v), 1), rgba(var(--ac-v), 0.7) 50%, rgba(var(--ac-v), 0)); }
:root:not([data-theme="dark"]) .card-glow.is-top i { opacity: calc(var(--glow-a, 0.6) * var(--glow-la, 1) * 1.6 * (1.05 - var(--py, 0) * 0.3)); }
:root:not([data-theme="dark"]) .card-glow.is-bottom i { opacity: calc(var(--glow-a, 0.6) * var(--glow-la, 1) * 1.6 * 1.4 * (1.05 + var(--py, 0) * 0.3)); }

/* 离场：点卡片后光层先淡出（不在点击那一帧突然消失）；跳转前（vt-expand）再和阴影层一样彻底移出渲染，
   否则浏览器会放弃跨页视图过渡 */
.is-leaving .card-glow.is-on { opacity: 0; transition: opacity 0.4s ease; }
.vt-expand .card-glow,
.menu-open .card-glow { display: none; }
@media (prefers-reduced-motion: reduce) {
  .card-glow, .card-glow i { transition: none; }
  .card-glow b { animation: none; }
}

/* 卡片副标题（分类小字）与首页底栏：Regular → Medium，粗一号 */
.project-label,
.footer-meta,
.footer-note { font-weight: 500; }

/* 署名悬停：先让 Seth 整体向右移出并消失，完全消失后 Qihao Shu（特殊蓝）再从左侧移入，停在 Seth 原来的位置；
   移开时反过来：Qihao Shu 先向左退出，再让 Seth 回来。
   离场的名字边移动边变淡、逐渐加速离开（透明度跟随位移，后段才明显变淡；0.2s），
   入场的名字在离场结束后才开始，并减速停稳（0.3s）。全程约 0.5s。
   过渡写在「目标状态」上：悬停时用 :hover 里的设置，移开时用默认状态里的设置。
   两个名字叠放在同一格，署名区域 overflow: hidden，移出格子的部分自动被裁掉 */
/* 裁切区域向右放宽 32px：Seth 能滑得更远才被切掉 */
.brand { --brand-extend: 32px; padding-right: var(--brand-extend); margin-right: calc(-1 * var(--brand-extend)); }
.brand > span { clip-path: none; }
.brand .name-short {
  transform: translateX(0);
  opacity: 1;
  transition: transform 0.3s var(--ease) 0.2s, opacity 0.24s ease 0.2s;   /* 回来：等 Qihao Shu 退完 */
}
.brand .name-full {
  transform: translateX(-100%);
  opacity: 0;
  color: var(--accent);
  transition: transform 0.2s cubic-bezier(0.4, 0, 1, 1), opacity 0.1s linear 0.4s; /* 不透明地滑出，入场名字快完全出来时才变淡 */ /* 退出：立即、加速 */
}
.brand:hover .name-short,
.brand:focus-visible .name-short {
  transform: translateX(calc(100% + var(--brand-extend)));
  opacity: 0;
  transition: transform 0.2s cubic-bezier(0.4, 0, 1, 1), opacity 0.1s linear 0.4s; /* 不透明地滑出，入场名字快完全出来时才变淡 */ /* 离开：立即、加速 */
}
.brand:hover .name-full,
.brand:focus-visible .name-full {
  transform: translateX(0);
  opacity: 1;
  transition: transform 0.3s var(--ease) 0.2s, opacity 0.24s ease 0.2s;   /* 进入：等 Seth 消失 */
}

/* 首页卡片悬停：编号左侧的短横线绕中心顺时针转半圈，移开时转回原位 */
.project .index::before {
  transform: rotate(0deg);
  transition: transform 0.6s var(--ease);
}
:where(body:not(.cards-tap)) .project:hover .index::before,
.project:focus-visible .index::before,
.project.is-active .index::before { transform: rotate(180deg); }
@media (prefers-reduced-motion: reduce) {
  .project .index::before { transition: none; }
}

/* 首页卡片小标题（分类）颜色加深一档：#89898c → gray-5 #6e6e70（悬停的深色卡片上仍用浅灰） */
.project-label { color: var(--gray-5); }
/* 悬停（深色卡片）时小标题提亮：#a4a4a6 → gray-1 #dadadc，压在作品图上也能看清 */
:where(body:not(.cards-tap)) .project:hover .project-label,
.project:focus-visible .project-label,
.project.is-active .project-label { color: var(--inv-fg-2); }

/* 还没完成的项目卡片：编号行左侧短线后面加「// 建设中」小字，样式同底栏右侧的「// 网站建设中」；
   完成的卡片（01）不加，两类卡片一眼能分开 */
.card-status {
  margin-right: auto;
  font-family: var(--font-text);
  font-size: 10px;
  font-weight: 500;
  letter-spacing: 0.5px;
  line-height: normal;
  white-space: nowrap;
  color: var(--gray-5);
  transition: color var(--dur) var(--ease);
}
:where(body:not(.cards-tap)) .project:hover .card-status,
.project:focus-visible .card-status,
.project.is-active .card-status { color: var(--inv-fg-2); }

/* 01 悬停的深色渐变遮罩：文字所在的下半部加深，下沿加深到不透明的 #1d1d1f（深色模式的页面底色）；
   上段（0–27%）上沿的浓度由 --cover-top 决定：浅色模式 50%；深色模式 100%，上沿与顶栏的页面底色完全一致、看不出卡片边界 */
.project.is-cover { --cover-top: 0.5; }
:root[data-theme="dark"] .project.is-cover { --cover-top: 1; --cover-90: 0.97; --cover-95: 1; } /* 深色下最后一段提前到 100%，卡片下沿与底栏同色 */
/* 深色模式：01 卡片上下沿在任何时候都与页面底色融为一体。
   悬停时默认遮罩（::after）淡出、悬停遮罩（::before）淡入，两层交叉淡变的中途各只剩一半，
   上下沿就会透出图片、出现一道分层。所以直接给图片区本身加上下渐隐（不随悬停变化），
   边缘露出的是卡片底色——底色也固定为页面底色（悬停默认会换成 --inv-bg，深色下比页面底色亮一级）。
   展开动画时（is-expanding）去掉，大图边缘不被裁 */
/* 深色模式悬停遮罩的上段改为与默认遮罩（::after）相同：85% → 20% 处淡没，悬停前后上方渐隐的位置齐平
   （以前上沿 100%、缓出到 27%，实心段更长，渐隐看起来比默认低一截；上下沿与底色融合已由下面的图片区渐隐保证） */
:root[data-theme="dark"] .project.is-cover .project-media::before {
  background: linear-gradient(to bottom,
    rgba(29, 29, 31, 0.85) 0%, rgba(29, 29, 31, 0) 20%,
    rgba(29, 29, 31, 0) 30%, rgba(29, 29, 31, 0.03) 35%, rgba(29, 29, 31, 0.1) 40%,
    rgba(29, 29, 31, 0.19) 45%, rgba(29, 29, 31, 0.32) 50%, rgba(29, 29, 31, 0.46) 55%,
    rgba(29, 29, 31, 0.58) 60%, rgba(29, 29, 31, 0.67) 65%, rgba(29, 29, 31, 0.73) 71%,
    rgba(29, 29, 31, 0.77) 80%, rgba(29, 29, 31, 0.82) 85%, rgba(29, 29, 31, 0.97) 90%,
    rgba(29, 29, 31, 1) 95%, rgba(29, 29, 31, 1) 100%);
}
:root[data-theme="dark"] .project.is-cover:not(.is-expanding) { background: var(--bg); }
:root[data-theme="dark"] .project.is-cover:not(.is-expanding) .project-media {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 8%, #000 92%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 8%, #000 92%, transparent 100%);
}
.project.is-cover .project-media::before {
  /* 缓入缓出的多段过渡，避免线性渐变在起止处出现明显的“折痕” */
  background: linear-gradient(to bottom,
    rgba(29, 29, 31, var(--cover-top)) 0%, rgba(29, 29, 31, calc(var(--cover-top) * 0.98)) 3%, rgba(29, 29, 31, calc(var(--cover-top) * 0.9)) 6%,
    rgba(29, 29, 31, calc(var(--cover-top) * 0.72)) 9%, rgba(29, 29, 31, calc(var(--cover-top) * 0.5)) 12%, rgba(29, 29, 31, calc(var(--cover-top) * 0.32)) 15%,
    rgba(29, 29, 31, calc(var(--cover-top) * 0.16)) 18%, rgba(29, 29, 31, calc(var(--cover-top) * 0.06)) 21%, rgba(29, 29, 31, calc(var(--cover-top) * 0.01)) 24%, rgba(29, 29, 31, 0) 27%,
    rgba(29, 29, 31, 0) 30%, rgba(29, 29, 31, 0.03) 35%, rgba(29, 29, 31, 0.1) 40%,
    rgba(29, 29, 31, 0.19) 45%, rgba(29, 29, 31, 0.32) 50%, rgba(29, 29, 31, 0.46) 55%,
    rgba(29, 29, 31, 0.58) 60%, rgba(29, 29, 31, 0.67) 65%, rgba(29, 29, 31, 0.73) 71%,
    rgba(29, 29, 31, 0.77) 80%, rgba(29, 29, 31, 0.82) 85%, rgba(29, 29, 31, var(--cover-90, 0.9)) 90%,
    rgba(29, 29, 31, var(--cover-95, 0.97)) 95%, rgba(29, 29, 31, 1) 100%);
}
/* 移动端（≤540px）沿用桌面端同款 18 段缓入缓出曲线 + 图片层上下渐隐遮罩，并改用主题背景色（--bg），
   让深浅色下图片上下沿都柔和融入网页空间；写在深色模式规则之后，确保深浅两套主题都生效 */
@media (max-width: 540px) {
  :root body.home .project.is-cover.is-active { background: var(--bg); color: var(--fg); }
  :root body.home .project.is-cover.is-active .project-label { color: var(--gray-5); }
  :root body.home .project.is-cover.is-active .project-summary { color: var(--gray-6); }
  :root body.home .project.is-cover:not(.is-expanding) .project-media {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 10%, #000 90%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0, #000 10%, #000 90%, transparent 100%);
  }
  :root body.home .project.is-cover .project-media::before {
    background: linear-gradient(to bottom,
      var(--bg) 0%, color-mix(in srgb, var(--bg) 98%, transparent) 3%, color-mix(in srgb, var(--bg) 90%, transparent) 6%,
      color-mix(in srgb, var(--bg) 72%, transparent) 9%, color-mix(in srgb, var(--bg) 50%, transparent) 12%, color-mix(in srgb, var(--bg) 32%, transparent) 15%,
      color-mix(in srgb, var(--bg) 16%, transparent) 18%, color-mix(in srgb, var(--bg) 6%, transparent) 21%, color-mix(in srgb, var(--bg) 1%, transparent) 24%, transparent 27%,
      transparent 30%, color-mix(in srgb, var(--bg) 3%, transparent) 35%, color-mix(in srgb, var(--bg) 10%, transparent) 40%,
      color-mix(in srgb, var(--bg) 19%, transparent) 45%, color-mix(in srgb, var(--bg) 32%, transparent) 50%, color-mix(in srgb, var(--bg) 46%, transparent) 55%,
      color-mix(in srgb, var(--bg) 58%, transparent) 60%, color-mix(in srgb, var(--bg) 67%, transparent) 65%, color-mix(in srgb, var(--bg) 73%, transparent) 71%,
      color-mix(in srgb, var(--bg) 77%, transparent) 80%, color-mix(in srgb, var(--bg) 82%, transparent) 85%, color-mix(in srgb, var(--bg) 95%, transparent) 90%,
      color-mix(in srgb, var(--bg) 99%, transparent) 95%, var(--bg) 100%);
  }
}

/* 01 悬停：卡片上下两段渐变模糊，只在靠近上下沿的一窄段，越靠近边缘越模糊。
   做法同顶栏（.header-blur）：main.js 在图片层里插入 8 层背景模糊，各自只在一段高度上显示、与相邻层交叠过渡；
   叠在图片之上、深色遮罩（::before）之下。
   · 下段 65–100%：5 层 1 → 16px（第 1–5 层）
   · 上段 0–8%：3 层 1 / 2 / 4px，范围更窄、强度更低（第 6–8 层）
   淡入淡出不能用 opacity：背景模糊的层在半透明时取不到下面的图片，整段动画里都没有模糊、到不透明才突然出现。
   所以改为过渡模糊半径本身（0 → 目标值），与遮罩同时出现 */
.media-blur {
  position: absolute;
  inset: 0;
  pointer-events: none;
}
.media-blur i {
  position: absolute;
  inset: 0;
  -webkit-backdrop-filter: blur(0);
  backdrop-filter: blur(0);
  -webkit-mask-image: var(--m);
  mask-image: var(--m);
  transition: backdrop-filter var(--dur) var(--ease), -webkit-backdrop-filter var(--dur) var(--ease);
}
/* 每一层只铺在自己露出的那条窄带上（top / height），遮罩按窄带重新换算——看起来与整张铺满加遮罩完全相同，
   但背景模糊只算这一条：悬停切换时两张卡片 16 层同时过渡模糊半径，整张铺满时每帧要对整张卡片模糊 16 次，会掉帧 */
.media-blur i:nth-child(1) { --b: 1px;  top: 65%; bottom: 25%; --m: linear-gradient(to bottom, transparent 0, #000 30%, #000 70%, transparent 100%); }
.media-blur i:nth-child(2) { --b: 2px;  top: 71%; bottom: 19%; --m: linear-gradient(to bottom, transparent 0, #000 30%, #000 70%, transparent 100%); }
.media-blur i:nth-child(3) { --b: 4px;  top: 77%; bottom: 13%; --m: linear-gradient(to bottom, transparent 0, #000 30%, #000 70%, transparent 100%); }
.media-blur i:nth-child(4) { --b: 8px;  top: 83%; bottom: 6%;  --m: linear-gradient(to bottom, transparent 0, #000 27.27%, #000 72.73%, transparent 100%); }
.media-blur i:nth-child(5) { --b: 16px; top: 90%; bottom: 0;   --m: linear-gradient(to bottom, transparent 0, #000 40%, #000 100%); }
.media-blur i:nth-child(6) { --b: 4px;  top: 0;   bottom: 96%; --m: linear-gradient(to bottom, #000 0%, #000 50%, transparent 100%); }
.media-blur i:nth-child(7) { --b: 2px;  top: 1%;  bottom: 94%; --m: linear-gradient(to bottom, transparent 0, #000 40%, #000 70%, transparent 100%); }
.media-blur i:nth-child(8) { --b: 1px;  top: 4%;  bottom: 92%; --m: linear-gradient(to bottom, transparent 0, #000 37.5%, #000 62.5%, transparent 100%); }
:where(body:not(.cards-tap)) .project.is-cover:hover .media-blur i,
.project.is-cover:focus-visible .media-blur i,
.project.is-cover.is-active .media-blur i { -webkit-backdrop-filter: blur(var(--b)); backdrop-filter: blur(var(--b)); }
/* 不悬停时不放这 8 层：背景模糊层哪怕半径为 0，在入场 / 返回首页动画中和刚结束的一小段里都会取不到完整的底图，
   在 02、04 等卡片下段显出一块灰影。悬停（或展开）时才放出来；入场动画期间一律不放。
   代价：预画好的图片（.is-hbaked）准备好之前的头一两秒里悬停，模糊直接出现、没有渐入；之后由预画的图片负责，不受影响 */
:where(body:not(.cards-tap)) .project:not(:hover):not(:focus-visible):not(.is-active) .media-blur,
html[data-intro] .media-blur, html[data-enter] .media-blur, html.menu-handoff .media-blur { display: none; }


/* 悬停下划线：从左往右展开（菜单项、返回首页、语言切换） */
.menu a > span,
.back-link > span[lang],
.lang-toggle [data-code] {
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 0 1px;
  transition: background-size 0.4s var(--ease), color 0.3s;
}
.menu a > span { padding-bottom: 0.06em; background-size: 0 0.05em; }
.menu a:hover > span, .menu a:focus-visible > span { background-size: 100% 0.05em; }
.back-link:hover > span[lang],
.lang-toggle [data-code]:hover { background-size: 100% 1px; }
/* 当前语言原本用 text-decoration 下划线，改成同一种，常驻展开 */
.lang-toggle [data-code] { padding: 0 0 4px; margin: 8px 3px; }
:root[lang="zh-CN"] .lang-toggle [data-code="zh-CN"],
:root[lang="en"] .lang-toggle [data-code="en"] { text-decoration: none; background-size: 100% 1px; }

/* 点击菜单项：文字闪一下特殊蓝，再跳转 */
@keyframes menu-flash {
  0%, 60% { color: var(--accent); }
  100% { color: var(--inv-fg); }
}
.menu a.is-flash { animation: menu-flash 0.35s steps(1, end) forwards; }
@media (prefers-reduced-motion: reduce) {
  .menu a > span, .back-link > span[lang], .lang-toggle [data-code] { transition: none; }
  .menu a.is-flash { animation: none; color: var(--accent); }
}

/* 菜单跳转交接：目标页首帧直接显示展开的菜单（无过渡），随后由 main.js 播放收起动画 */
.menu-handoff .menu { clip-path: inset(0 0 0 0); transition: none; }
.menu-handoff .site-header { background: transparent; color: var(--inv-fg); border-color: transparent; transition: none; }
.menu-handoff .menu-toggle span { width: 26px; transition: none; }
.menu-handoff .menu-toggle span:nth-child(1) { transform: translateY(3px) rotate(45deg); }
.menu-handoff .menu-toggle span:nth-child(2) { transform: translateY(-3px) rotate(-45deg); }

/* 菜单收起中：导航栏保持透明，让菜单下边缘扫过；main.js 在边缘进入导航栏时移除，文字随之渐变回深色 */
.menu-closing .site-header { background: transparent; color: var(--inv-fg); border-color: transparent; transition: none; }
/* 顶栏需要透明的状态（菜单打开 / 收起、菜单跳转、蓝色转场）：去掉玻璃的模糊与高光，不糊住后面的菜单 */
.menu-open .site-header, .menu-handoff .site-header, .menu-closing .site-header,
.is-leaving-blue .site-header { -webkit-backdrop-filter: none; backdrop-filter: none; box-shadow: none; }
.menu-open .site-header::before, .menu-open .site-header::after,
.menu-handoff .site-header::before, .menu-handoff .site-header::after,
.menu-closing .site-header::before, .menu-closing .site-header::after,
.is-leaving-blue .site-header::before, .is-leaving-blue .site-header::after { display: none; }
/* 同上：这些状态下顶栏透明，渐变模糊层也撤掉 */
.menu-open .header-blur, .menu-handoff .header-blur, .menu-closing .header-blur,
.is-leaving-blue .header-blur { display: none; }
/* 收起用缓入缓出：避免 ease-out 尾段在导航栏位置慢慢爬行（看起来像卡住） */
body:not(.menu-open) .menu { transition: clip-path 0.7s cubic-bezier(0.65, 0, 0.35, 1); }

/* 菜单图标悬停：线条变深、变粗、间距拉开（菜单展开时不生效） */
body:not(.menu-open):not(.menu-closing) .menu-toggle span {
  background: var(--gray-6);
  transition: transform 0.3s var(--ease), height 0.3s var(--ease), background-color 0.3s;
}
body:not(.menu-open):not(.menu-closing) .menu-toggle:hover span,
body:not(.menu-open):not(.menu-closing) .menu-toggle:focus-visible span { background: var(--gray-8); height: 1.5px; }
body:not(.menu-open):not(.menu-closing) .menu-toggle:hover span:nth-child(1),
body:not(.menu-open):not(.menu-closing) .menu-toggle:focus-visible span:nth-child(1) { transform: translateY(-1.5px); }
body:not(.menu-open):not(.menu-closing) .menu-toggle:hover span:nth-child(2),
body:not(.menu-open):not(.menu-closing) .menu-toggle:focus-visible span:nth-child(2) { transform: translateY(1.5px); }

/* 内容页正文里的超链接：悬停时文字与下划线渐变为特殊蓝 */
.case-page main a:not([class]) {
  transition: color 0.25s ease, text-decoration-color 0.25s ease;
}
.case-page main a:not([class]):hover,
.case-page main a:not([class]):focus-visible { color: var(--accent); text-decoration-color: var(--accent); }

/* 进入视野动画（main.js 加 is-armed 后才生效，脚本失效时直接显示最终状态） */
.cs-quote.is-armed p strong { color: inherit; transition: color 0.8s var(--ease); }
.cs-quote.is-in p strong { color: var(--accent); }
.cs-quote.is-in p strong:nth-of-type(1) { transition-delay: 0.3s; }
.cs-quote.is-in p strong:nth-of-type(2) { transition-delay: 0.7s; }
.cs-stat-num { font-variant-numeric: tabular-nums; }
/* 离开视野复位时直接变回灰色，不播放反向过渡 */
.cs-quote.is-armed:not(.is-in) p strong { transition: none; }

.cs-quote.is-in p strong { transition: none; }

/* 内容页正文链接：悬停时按单词依次从下方淡入（逐词级联），同时变为特殊蓝
   单词包成 inline-block 后 text-decoration 画不到子元素上，下划线改用背景线 */
.case-page main a.split-link {
  text-decoration: none;
  background-image: linear-gradient(currentColor, currentColor);
  background-repeat: no-repeat;
  background-position: 0 calc(100% - 0.02em);
  background-size: 100% 1px;
}
.split-link .w { display: inline-block; }
@keyframes link-word-up {
  from { opacity: 0; transform: translateY(0.45em); }
  to { opacity: 1; transform: none; }
}
.split-link.is-playing .w {
  animation: link-word-up 0.45s cubic-bezier(0.22, 1, 0.36, 1) both;
  animation-delay: calc(var(--i) * 70ms);
}
@media (prefers-reduced-motion: reduce) {
  .split-link.is-playing .w { animation: none; }
}
.case-page main a.split-link { transition: color 0.25s ease; }
.case-page main a.split-link:hover,
.case-page main a.split-link:focus-visible { color: var(--accent); }

/* 正文链接逐字母滚动：.c 是遮罩（上下裁切），.c-roll 内含原字母和下方的副本（::after） */
.split-link .w { display: inline-block; white-space: nowrap; }
.split-link .c {
  display: inline-block;
  overflow: hidden;
  vertical-align: top;
}
.split-link .c-roll {
  display: inline-block;
  position: relative;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
  /* 移开时也按顺序依次回位 */
  transition-delay: calc(var(--i) * 22ms);
}
.split-link .c-roll::after {
  content: attr(data-ch);
  position: absolute;
  left: 0;
  top: 100%;
}
.split-link:hover .c-roll,
.split-link:focus-visible .c-roll { transform: translateY(-100%); }
.split-link.is-playing .w { animation: none; }
@media (prefers-reduced-motion: reduce) {
  .split-link .c-roll { transition: none; }
  .split-link:hover .c-roll, .split-link:focus-visible .c-roll { transform: none; }
}
/* 遮罩收窄到文字本身的高度（下边界即下划线位置），滚动的字母不再穿过下划线；
   1lh 为行高，1.235em 为 Switzer 的字身高度（实测 17px 字号时 21px） */
.split-link .c { clip-path: inset(calc((1lh - 1.235em) / 2) 0); }

/* 署名悬停改为逐字母滚动（与正文链接相同）：Seth 的字母依次向上滚出，
   Qihao Shu（特殊蓝）的字母依次从下方滚入；移开时按同样顺序滚回。
   两个名字仍叠放在同一格，本身不再整体平移或淡出 */
.brand .name-short,
.brand .name-full,
.brand:hover .name-short,
.brand:focus-visible .name-short,
.brand:hover .name-full,
.brand:focus-visible .name-full { transform: none; opacity: 1; transition: none; }
.brand .letter { display: inline-block; overflow: hidden; vertical-align: top; }
.brand .c-roll {
  display: inline-block;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
  transition-delay: calc(var(--i) * 22ms);
}
.brand .name-full .c-roll { transform: translateY(105%); }
/* 脚本把字母拆好、加上 is-split 之前（新页面的头几帧，如从首页卡片展开进入时），Qihao Shu 还没有被藏到下方，
   会和 Seth 叠在一起：先整个隐藏。脚本没运行时也只显示 Seth */
.brand:not(.is-split) .name-full { visibility: hidden; }
.brand.is-idle-roll .name-short .c-roll { transform: translateY(-105%); } /* is-idle-roll：脚本每隔一段时间自动加上，播放 Seth → Qihao Shu */
.brand.is-idle-roll .name-full .c-roll { transform: none; }
/* 桌面 / 平板：待机切换时「Hi」留着不动，Qihao Shu 排在它后面（右外边距抵消，署名占的宽度不变）；手机没有 Hi，不适用 */
@media (min-width: 541px) {
  .brand .name-full { margin-left: var(--w-hi, 17.6px); margin-right: calc(-1 * var(--w-hi, 17.6px)); }
  .brand.is-idle-roll .name-short .letter-hi .c-roll { transform: none; }
}
/* 换页接力（main.js resume）：摆到当时的位置时不播过渡，下一帧撤掉 */
.brand.is-resume .c-roll,
.brand.is-resume ~ .brand-hand,
.brand.is-resume ~ .brand-hand .bh-roll { transition: none !important; }
@media (prefers-reduced-motion: reduce) {
  .brand .c-roll { transition: none; }
}
/* 署名区（.brand-zone）：署名 + 右侧的挥手手掌 + 悬停出现的联系方式
   手掌的横向位置由脚本量出两个名字的宽度（--w-short / --w-full），切到 Qihao Shu 时跟着滑到新名字后面 */
.brand-zone { display: flex; align-items: center; }
.brand-hand {
  position: absolute;
  left: calc(var(--w-short, 47.9px) + 7px);
  top: 50%;
  width: 18px;
  height: 18px;
  margin-top: -9px;
  pointer-events: none;
  clip-path: inset(-10px); /* 平时多留一圈，挥手时不被裁；悬停时收到图标本身大小，作为滚出的遮罩 */
  /* 变回 Seth：等 Qihao Shu 的最后一个字母滚走后才向左移，免得穿过还没消失的字母 */
  transition: left 0.4s cubic-bezier(0.65, 0, 0.35, 1) 0.5s, clip-path 0s 0.7s;
  /* 弹簧（欠阻尼）：字母滚走后手掌被拉向左边，略过头再弹回、触底停稳；不支持 linear() 的浏览器用上一行 */
  transition: left 0.9s linear(0, 0.101, 0.339, 0.627, 0.87, 1.0, 1.091, 1.133, 1.14, 1.123, 1.091, 1.056, 1.028, 1.008, 0.996, 0.992, 0.994, 1.0, 1.006, 1.008, 1.008, 1.006, 1.003, 1.001, 1) 0.5s, clip-path 0s 1.4s;
}
/* 手掌像一个字母一样滚出 / 滚入：与 Seth 的逐字母滚动同曲线，排在最后一个字母之后 */
.bh-roll {
  display: block;
  width: 100%;
  height: 100%;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1) 0.15s;
}
.brand-hand svg { display: block; width: 100%; height: 100%; transform-origin: 46% 86%; } /* 以掌根为中心 */
.brand.is-idle-roll ~ .brand-hand { left: calc(var(--w-full, 91px) + 7px); transition: left 0.45s cubic-bezier(0.65, 0, 0.35, 1), clip-path 0s 0.7s; } /* 切到 Qihao Shu：立即右移 */
.brand.is-idle-roll ~ .brand-hand svg { animation: brand-wave 0.95s cubic-bezier(0.37, 0, 0.63, 1) 0.55s both; }
/* 挥手两下：左右各摆两次，在切回 Seth 之前停稳 */
@keyframes brand-wave {
  0%   { transform: rotate(0) scale(1); }
  10%  { transform: rotate(-8deg) scale(1); }       /* 起手：快速回收 */
  30%  { transform: rotate(24deg) scale(1.1); }     /* 第一下 */
  52%  { transform: rotate(-14deg) scale(1.05); }
  72%  { transform: rotate(16deg) scale(1.06); }    /* 第二下 */
  88%  { transform: rotate(-3deg) scale(1.01); }    /* 余波：很快稳住 */
  100% { transform: rotate(0) scale(1); }
}

/* 手机宽度（≤540）：署名组件撤回到原来的样子——只有 Seth，没有「Hi」和手掌；
   悬停 / 点按时 Seth 滚成 Qihao Shu（待机时脚本也按原节奏自动播放同一动画）。联系方式放在菜单里 */
@media (max-width: 540px) {
  .brand .letter-hi, .brand-hand { display: none; }
  .brand:hover .name-short .c-roll,
  .brand:focus-visible .name-short .c-roll { transform: translateY(-105%); }
  .brand:hover .name-full .c-roll,
  .brand:focus-visible .name-full .c-roll { transform: none; }
}

/* 联系方式：默认隐藏，仅在能悬停且够宽的屏幕上，悬停（或键盘聚焦）署名区时出现；
   Seth 逐字母向上滚出，LinkedIn 与邮箱依次从下方滚入。放在原位上，不推挤右侧按钮 */
.brand-contact { display: none; }
@media (hover: hover) and (min-width: 720px) {
  .brand-contact {
    position: absolute;
    left: 0;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 26px;
    white-space: nowrap;
    font-family: var(--font-switzer);
    font-weight: var(--weight-strong);
    font-size: var(--fs-brand);
    line-height: 1.5;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s 0.5s;          /* 收回时等滚动结束再隐藏 */
  }
  .brand-zone:hover .brand-contact,
  .brand-zone.is-kbd .brand-contact { visibility: visible; pointer-events: auto; transition-delay: 0s; }
  .brand-zone:hover .brand .name-short .c-roll,
  .brand-zone.is-kbd .brand .name-short .c-roll { transform: translateY(-105%); }
  .brand-zone:hover .brand-hand,
  .brand-zone.is-kbd .brand-hand { clip-path: inset(0); transition: left 0s, clip-path 0s; }
  .brand-zone:hover .bh-roll,
  .brand-zone.is-kbd .bh-roll { transform: translateY(-105%); }
  /* 正在显示 Qihao Shu 时悬停：手掌留在它后面的原位上滚出（脚本在滚出期间加 is-hold-hand），不先跳回 Seth 的位置；挥手动画也接着播完，不突然复位 */
  .brand-zone.is-hold-hand .brand-hand { left: calc(var(--w-full, 91px) + 7px); }
  .brand-zone.is-hold-hand .brand-hand svg { animation: brand-wave 0.95s cubic-bezier(0.37, 0, 0.63, 1) 0.55s both; }

  .bc-item {
    display: inline-flex;
    padding: 0;
    border: 0;
    background: none;
    color: inherit;
    font: inherit;
    cursor: pointer;
    transition: color 0.25s var(--ease);
  }
  .bc-mask { display: inline-flex; overflow: hidden; padding-block: 4px; margin-block: -4px; }
  .bc-roll {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    transform: translateY(115%);
    transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
  }
  .brand-zone:hover .bc-roll,
  .brand-zone.is-kbd .bc-roll { transform: none; transition-delay: calc(0.12s + var(--i) * 0.08s); }
  .bc-item:hover, .bc-item:focus-visible { color: var(--accent); }
  .bc-item:focus-visible { outline: 0; }
  .bc-icon { position: relative; display: grid; width: 18px; height: 18px; overflow: hidden; flex: none; }
  .bc-icon svg, .bc-i { display: block; width: 18px; height: 18px; }
  .bc-i { grid-area: 1 / 1; transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1); }
  .bc-i-copy, .bc-i-check { transform: translateY(110%); }
  /* 邮箱：悬停时信封换成复制图标，点击后换成对勾 */
  .bc-mail:hover .bc-i-mail, .bc-mail:focus-visible .bc-i-mail { transform: translateY(-110%); }
  .bc-mail:hover .bc-i-copy, .bc-mail:focus-visible .bc-i-copy { transform: none; }
  .bc-mail.is-copied .bc-i-mail, .bc-mail.is-copied .bc-i-copy { transform: translateY(-110%); }
  .bc-mail.is-copied .bc-i-check { transform: none; }
  .bc-label { display: grid; overflow: hidden; padding-block: 4px; margin-block: -4px; text-align: left; }
  .bc-text, .bc-done { grid-area: 1 / 1; transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1); }
  .bc-done { transform: translateY(110%); }
  .bc-arr { display: inline-flex; width: 16px; height: 16px; margin-left: -2px; align-self: center; flex: none; transition: transform 0.4s var(--ease); }
  .bc-arr svg { display: block; width: 16px; height: 16px; }
  .bc-linkedin:hover .bc-arr, .bc-linkedin:focus-visible .bc-arr { transform: translate(2px, -2px); }
  .bc-mail.is-copied { color: var(--accent); }
  .bc-mail.is-copied .bc-text { transform: translateY(-110%); }
  .bc-mail.is-copied .bc-done { transform: none; }
}
@media (prefers-reduced-motion: reduce) {
  .brand-hand, .bh-roll, .bc-roll, .bc-i, .bc-text, .bc-done { transition: none; }
  .brand.is-idle-roll ~ .brand-hand svg { animation: none; }
}
/* 署名上下各放宽 4px 的裁切空间，待机摆动时字母顶部不被 .brand 的 overflow 裁掉（不影响布局） */
.brand { padding-block: 4px; margin-block: -4px; }

/* 菜单选项逐字母滚动：遮罩下边界停在下划线上方，不越过下划线 */
.menu a > span[lang] { white-space: nowrap; }
.menu a .c {
  display: inline-block;
  vertical-align: top;
  clip-path: inset(-0.2em 0 0 0);
}
.menu a .c-roll {
  display: inline-block;
  position: relative;
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
  transition-delay: calc(var(--i) * 30ms);
}
.menu a .c-roll::after { content: attr(data-ch); position: absolute; left: 0; top: 120%; }
.menu a:hover .c-roll,
.menu a:focus-visible .c-roll { transform: translateY(-120%); }
@media (prefers-reduced-motion: reduce) {
  .menu a .c-roll { transition: none; }
  .menu a:hover .c-roll, .menu a:focus-visible .c-roll { transform: none; }
}

/* 首页卡片悬停 1：背景图视差——图片随鼠标位置朝反方向轻移（--px / --py 由 main.js 写入，范围 -1…1）
   用独立的 translate 属性，不影响原有的 transform（上移、放大） */
.project-media :is(img, canvas) {
  translate: calc(var(--px, 0) * -8px) calc(var(--py, 0) * -10px); /* 01 封面悬停放大 4%，图片区宽 432px 时左右各多出约 8.6px，横向位移（-8px）不超过它，否则卡片两侧会露出底色 */
  transition: opacity 0.4s, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), translate 0.9s cubic-bezier(0.2, 0.7, 0.2, 1);
}

/* 首页卡片悬停 1.5：光泽——像卡片被轻轻转动时表面掠过的一道反光（参考 Apple TV 视差海报、全息卡片的 glare）。
   一整片宽而柔的斜向反光横贯整张卡片，鼠标位置当作卡片的倾斜角：鼠标移动时反光随之扫过卡片；
   只有转到某个角度附近才亮起，离开就淡没（亮度 --gl 与位置 --gs 由 main.js 按鼠标位置算出）。
   放在图片区最上面（盖过图片和上下渐变，仍在文字之下），提亮叠加；只动 translate / opacity，交给合成器 */
.card-gloss {
  position: absolute;
  inset: 0;
  z-index: 2;
  overflow: hidden;
  pointer-events: none;
  mix-blend-mode: screen;
  opacity: 0;
  transition: opacity 0.4s ease;
}
:where(body:not(.cards-tap)) .project:hover .card-gloss { opacity: 1; }
/* 反光强度上限：浅色底上提亮叠加还算融洽；深色页面里一片白光显得突兀，压到很淡 */
.card-gloss { --gloss-k: 0.7; } /* 2026-11-23 由 0.88 减弱 */
/* 反光在卡片上下沿渐隐：反光是滤色叠加，会把上下沿已压到页面底色的遮罩提亮，卡片边缘与顶栏 / 底栏之间又出现一道分界 */
.card-gloss {
  -webkit-mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 80%, transparent 100%);
  mask-image: linear-gradient(to bottom, transparent 0, #000 14%, #000 80%, transparent 100%);
}
:root[data-theme="dark"] .card-gloss { --gloss-k: 0.31; } /* 2026-11-23 由 0.385 减弱 */
.project.is-expanding .card-gloss { opacity: 0; transition-duration: 0.12s; }
.card-gloss::before {
  content: "";
  position: absolute;
  inset: -10% -60%;
  /* 一整片宽而柔的反光：中间最亮，往两侧按缓入缓出的曲线慢慢淡没，没有硬边、不成细线 */
  background: linear-gradient(110deg,
    rgba(255, 255, 255, 0) 26%,
    rgba(255, 255, 255, 0.02) 31%,
    rgba(255, 255, 255, 0.07) 36%,
    rgba(255, 255, 255, 0.15) 41%,
    rgba(255, 255, 255, 0.24) 46%,
    rgba(255, 255, 255, 0.28) 50%,
    rgba(255, 255, 255, 0.24) 54%,
    rgba(255, 255, 255, 0.15) 59%,
    rgba(255, 255, 255, 0.07) 64%,
    rgba(255, 255, 255, 0.02) 69%,
    rgba(255, 255, 255, 0) 74%);
  translate: calc(var(--gs, 0) * -40%) 0;
  opacity: calc(var(--gl, 0) * var(--gloss-k));
  transition: translate 0.35s cubic-bezier(0.2, 0.7, 0.2, 1), opacity 0.35s ease;
}

/* 首页卡片悬停 2：副标题和标题保持不动，正文 → View project 依次从下方淡入 */
@keyframes card-text-in {
  from { opacity: 0; transform: translateY(14px); }
  to { opacity: 1; transform: none; }
}
:where(body:not(.cards-tap)) .project:hover .project-more > div,
.project:focus-visible .project-more > div,
.project.is-active .project-more > div { opacity: 1; transform: none; transition: none; }
:where(body:not(.cards-tap)) .project:hover :is(.project-summary, .project-cta),
.project:focus-visible :is(.project-summary, .project-cta),
.project.is-active :is(.project-summary, .project-cta) {
  animation: card-text-in 0.6s var(--ease) both;
}
:where(body:not(.cards-tap)) .project:hover .project-summary,
.project:focus-visible .project-summary,
.project.is-active .project-summary { animation-delay: 0.35s; }
:where(body:not(.cards-tap)) .project:hover .project-cta,
.project:focus-visible .project-cta,
.project.is-active .project-cta { animation-delay: 0.65s; }
@media (prefers-reduced-motion: reduce) {
  .project-media :is(img, canvas) { translate: none; }
  .project :is(.project-label, .project-title, .project-summary, .project-cta) { animation: none !important; }
}

/* ==========================================================================
   页面转场
   expand（首页卡片 → 内容页）：卡片向两侧展开铺满 → 内容页从底部探出一截，左下角逐词升起项目名；
     向下滚动 / 点击后整页升起；在页顶向上滚动又回到探出状态
   focus（Back to index / 顶栏「首页 / 个人」/ 项目下拉，2026-12）：顶栏不动，其下一整面底色幕布淡入盖住当前页 → 新页幕布淡去、main 从稍远处贴近（main.js）
   层级（顶 → 底）：顶栏 → 页面内容 → 项目名 / 渐变 / 大图（或蓝色遮罩） → 上一页
   ========================================================================== */
/* 离场层（插在顶栏之下、当前页内容之上） */
.page-wipe,
.page-expand {
  position: fixed;
  z-index: 19;
  pointer-events: none;
}
.page-wipe { inset: 0; background: var(--accent); transform: translateY(100%); }
/* 卡片展开：展开层是全屏大小的外框，用 transform 从卡片的矩形放大到全屏，里层（.page-expand-inner）反向缩放抵消，
   画面不被拉伸；大图再用 transform 从卡片里的样子缩放 / 移动到全屏的样子（main.js）。全程只有 transform，由 GPU 合成。
   以前先是逐帧改 left / top / width / height（每帧整屏重排），后来是 clip-path（每帧主线程重画，会落后于两侧阴影条） */
.page-expand { overflow: hidden; background: var(--inv-bg); transform-origin: 0 0; }
.page-expand-inner { position: absolute; inset: 0; transform-origin: 0 0; }
/* 从 01 卡片展开（深浅色模式）：展开层一开始带着与卡片相同的上下渐隐（按展开层自身高度的 8%，起点即卡片高度的 8%），
   随展开曲线逐渐收没，展开完成时没有渐隐、与内容页衔接（--fe 由 main.js 的 expandCard 动画驱动） */
@property --fe { syntax: '<percentage>'; inherits: false; initial-value: 0%; }
/* 从 01 卡片展开：展开层盖一层与卡片悬停遮罩（::before）完全相同的深色渐变，点击那一帧接替卡片上的遮罩，
   再随展开曲线淡出；展开层自带的底部渐变（.page-expand-inner::after，与内容页衔接）同时从 0 淡入，
   两者此消彼长，下半张不会叠两层而突然变暗（main.js）。浅色上沿 50%；深色与默认遮罩齐平（85% → 20%） */
.page-expand.is-shaded::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 1;
  pointer-events: none;
  background: linear-gradient(to bottom, rgba(29, 29, 31, 0.5) 0%, rgba(29, 29, 31, 0.49) 3%, rgba(29, 29, 31, 0.45) 6%, rgba(29, 29, 31, 0.36) 9%, rgba(29, 29, 31, 0.25) 12%, rgba(29, 29, 31, 0.16) 15%, rgba(29, 29, 31, 0.08) 18%, rgba(29, 29, 31, 0.03) 21%, rgba(29, 29, 31, 0.005) 24%, rgba(29, 29, 31, 0.0) 27%,
    rgba(29, 29, 31, 0) 30%, rgba(29, 29, 31, 0.03) 35%, rgba(29, 29, 31, 0.1) 40%, rgba(29, 29, 31, 0.19) 45%, rgba(29, 29, 31, 0.32) 50%, rgba(29, 29, 31, 0.46) 55%, rgba(29, 29, 31, 0.58) 60%, rgba(29, 29, 31, 0.67) 65%, rgba(29, 29, 31, 0.73) 71%, rgba(29, 29, 31, 0.77) 80%, rgba(29, 29, 31, 0.82) 85%, rgba(29, 29, 31, 0.9) 90%, rgba(29, 29, 31, 0.97) 95%, rgba(29, 29, 31, 1) 100%);
}
:root[data-theme="dark"] .page-expand.is-shaded::before {
  background: linear-gradient(to bottom, rgba(29, 29, 31, 0.85) 0%, rgba(29, 29, 31, 0) 20%,
    rgba(29, 29, 31, 0) 30%, rgba(29, 29, 31, 0.03) 35%, rgba(29, 29, 31, 0.1) 40%, rgba(29, 29, 31, 0.19) 45%, rgba(29, 29, 31, 0.32) 50%, rgba(29, 29, 31, 0.46) 55%, rgba(29, 29, 31, 0.58) 60%, rgba(29, 29, 31, 0.67) 65%, rgba(29, 29, 31, 0.73) 71%, rgba(29, 29, 31, 0.77) 80%, rgba(29, 29, 31, 0.82) 85%, rgba(29, 29, 31, 0.97) 90%, rgba(29, 29, 31, 1) 95%, rgba(29, 29, 31, 1) 100%);
}
/* 桌面轮播：用卡片 ::before 当前的渐变（main.js 写入 --shade-bg），深浅色都一样 */
:root .page-expand.is-shaded[style*="--shade-bg"]::before { background: var(--shade-bg); }
.page-expand.is-faded, .page-expand-edge.is-faded {
  /* 与卡片上下渐隐同一条曲线（--f 的 0 / .18 / .38 / .58 / .78 / 1 档），--fe 是渐隐带占展开层高度的百分比，由 main.js 驱动、随展开收没 */
  --fm: linear-gradient(to bottom, transparent 0, rgba(0, 0, 0, 0.12) calc(var(--fe) * 0.18), rgba(0, 0, 0, 0.34) calc(var(--fe) * 0.38),
    rgba(0, 0, 0, 0.62) calc(var(--fe) * 0.58), rgba(0, 0, 0, 0.86) calc(var(--fe) * 0.78), #000 var(--fe),
    #000 calc(100% - var(--fe)), rgba(0, 0, 0, 0.86) calc(100% - var(--fe) * 0.78), rgba(0, 0, 0, 0.62) calc(100% - var(--fe) * 0.58),
    rgba(0, 0, 0, 0.34) calc(100% - var(--fe) * 0.38), rgba(0, 0, 0, 0.12) calc(100% - var(--fe) * 0.18), transparent 100%);
  -webkit-mask-image: var(--fm);
  mask-image: var(--fm);
}
.page-expand img { position: absolute; inset: 0; width: 100%; height: 100%; transform-origin: 50% 50%; }
.page-expand-blur { position: absolute; inset: 0; transform-origin: 50% 50%; pointer-events: none; }
/* 展开层左右两侧的阴影：各一条透明的竖条，阴影只画一次、只往外侧露出，展开时随裁切边缘左右移动（只做位移，不重画） */
.page-expand-edge {
  position: fixed;
  z-index: 18;
  width: 560px; /* 容器：中间 200px 是阴影条（<i>），左右各留 180px 给外溢的阴影，免得上下渐隐遮罩把阴影切掉 */
  pointer-events: none;
  transform-origin: 0 0;
  will-change: transform;
}
.page-expand-edge > i {
  position: absolute;
  left: 180px;
  top: 0;
  bottom: 0;
  width: 200px;
  box-shadow:
    0 2px 4px rgba(var(--shadow), 0.2),
    0 8px 18px rgba(var(--shadow), 0.24),
    0 20px 44px rgba(var(--shadow), 0.28),
    0 40px 96px rgba(var(--shadow), 0.34);
}
.page-expand-edge.is-left > i { clip-path: inset(0 0 0 -160px); }
.page-expand-edge.is-right > i { clip-path: inset(0 -160px 0 0); }
.vt-expand .page-expand-edge { display: none; } /* 跳转前移出渲染（此时已在屏幕外），不给跨页过渡添变数 */
/* 离场时把卡片阴影层彻底移出渲染（不只是透明）：它在场时浏览器会放弃跨页视图过渡，
   导致桌面端点卡片展开后跳到内容页时闪一下 */
.is-leaving .card-shadow,
.vt-expand .card-shadow,
.menu-open .card-shadow { display: none; } /* 阴影层（25）高于菜单（15） */
/* 点卡片展开时，大图铺到屏幕底部、从底栏下面经过：底栏改为不透明的页面底色、关掉玻璃，
   不再透出模糊的大图；与随后内容页底部探出的那一条同色 */
/* 底栏点下去后往下收出屏幕（main.js）：收到屏幕外的那段会把页面撑高、能滚动，离场期间锁住 */
body.home.is-leaving { overflow: hidden; }
/* 退远离场（is-receding）不用这一套：底栏照常是玻璃，只跟着淡出 */
.home.is-leaving:not(.is-receding) .home-footer {
  z-index: 20; /* 平时在菜单之下（14）；展开时回到展开层（19）之上，大图从底栏下面经过 */
  background: var(--bg);
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  transition: none;
}
.is-leaving-blue .site-header { background: transparent; border-color: transparent; transition: none; }
/* 离场时顶栏始终排在展开中的卡片（20）之上：顶栏是一直存在的，不被转场的任何一层盖到 */
body.is-leaving .site-header { z-index: 22; }
/* 内容页升起（探出 → 完整页）时，顶栏由透出大图的玻璃逐渐变为页面底色（enter-solid 由 main.js 在升到完整页时加、退回探出时去掉；
   从卡片进入后，探出 / 窄条 / 升起途中顶栏一律是纯页面底色；升到完整页（enter-full）后换成渐变模糊玻璃，
   由内容页顶上的白条（见文件末尾）负责在页顶时看起来仍是纯色）。
   底色写在 background-color 上，叠在原来的渐变玻璃下面，渐变是半透明的底色色，所以结果就是纯页面底色 */
/* 退回（项目页降下去）时也同速：背景色按整页下降的节奏慢慢退成透明玻璃，不在页面刚一动就立刻变透明 */
html[data-enter="expand"] .site-header {
  transition-duration: 0.9s, 0.4s, 0.4s;
  transition-timing-function: cubic-bezier(0.65, 0, 0.35, 1), var(--ease), var(--ease);
}
/* 展开大图的一瞬间顶栏的模糊不能变：首页平时（glass-calm）把顶栏的背景模糊关了、算进了光团里，
   离场时大图盖到顶栏后面，新页面的顶栏却是带模糊的，交接那一帧模糊突然变了。离场时就把模糊开着 */
html.glass-calm body.home.is-leaving .header-blur { display: block; }
html[data-enter]:not(.enter-full):not(.menu-handoff):not(.menu-closing) body:not(.menu-open):not(.menu-closing):not(.menu-handoff):not(.is-leaving-blue) .site-header {
  background-color: var(--bg);
  /* 与整页上升（0.9 秒、缓入缓出）同步：升到窄条的位置时刚好完全变色 */
  transition-duration: 0s, 0.4s, 0.4s; /* 变回纯色必须立刻：内容页一往下退（enter-full 撤掉、白条随之消失），顶栏不能有哪怕 0.2 秒的半透明，否则会闪一下大图 */
  transition-timing-function: var(--ease), var(--ease), var(--ease);
}
/* 从首页点卡片的那一刻起顶栏就是纯色（不再是半透明玻璃），一路保持到完整内容页 */
body.home.is-leaving:not(.is-leaving-plain):not(.is-leaving-blue):not(.menu-open) .site-header {
  background-color: var(--bg);
  transition: background-color 0.25s var(--ease), color 0.4s var(--ease), border-color 0.4s var(--ease);
}
/* 纯色顶栏下方的投影（2026-12）：不是顶栏自己的 box-shadow，而是单独一层（main.js 的 .hdr-shadow），
   排在通栏大图之上、内容页之下——内容页盖在上面时就把影子遮住，影子只落在大图上。
   投影是一段从顶栏下沿往下的深色渐变，贴近顶栏处最深、逐渐消散（多档过渡，边缘柔和） */
.hdr-shadow {
  position: fixed; left: 0; right: 0; top: 0;
  height: calc(var(--header-h) + 150px);
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(to bottom,
    transparent 0, transparent var(--header-h),
    rgba(0, 0, 0, 0.55) var(--header-h),
    rgba(0, 0, 0, 0.42) calc(var(--header-h) + 14px),
    rgba(0, 0, 0, 0.27) calc(var(--header-h) + 36px),
    rgba(0, 0, 0, 0.14) calc(var(--header-h) + 66px),
    rgba(0, 0, 0, 0.05) calc(var(--header-h) + 105px),
    rgba(0, 0, 0, 0) 100%);
  transition: opacity 0.5s var(--ease);
}
/* 内容页：大图（0）之上、内容页（2）之下。从首页展开过来时一开始就是满的（与首页展开末尾一致）；离开时随转场淡去 */
body.case-page .hdr-shadow { z-index: 1; }
html[data-enter]:not(.enter-full):not(.menu-handoff):not(.menu-closing) body.case-page:not(.menu-open):not(.is-leaving):not(.is-leaving-blue) .hdr-shadow { opacity: 1; }
/* 首页：展开层（19）、卡片（20）之上，顶栏（22）之下；展开接近尾声才显现 */
body.home .hdr-shadow { z-index: 21; }
body.home.is-leaving:not(.cards-tap):not(.is-leaving-plain):not(.is-leaving-blue) .hdr-shadow { opacity: 1; transition: opacity 0.4s var(--ease) 0.5s; }
@media (prefers-reduced-motion: reduce) { .hdr-shadow { transition: none !important; } }
/* 展开时：卡片整张提到展开层（19）之上，只藏起卡片里的两张图（展开层里同一位置是同一张图），
   文字、编号和图上的上下渐变留在大图之上慢慢淡出——不会在点击的那一帧突然消失，让画面像跳了一下。
   卡片自己的底色和左侧分隔线去掉，露出下面的展开层 */
.project.is-expanding { z-index: 20; background: transparent; border-color: transparent; transition: none; }
.project.is-expanding .project-media :is(img, canvas) { visibility: hidden; }
/* 整个图片区（含里面的各层画布、渐变 ::before / ::after、光泽）点下去就藏起来：卡片这时排在展开层之上（20 > 19），
   图片区里任何一层还露着，都会在卡片原位的顶部留下一块和大图对不上的色块（偶发：比如画好的模糊图恰好在这时重画、
   或上沿的浅色渐变还没淡完）。展开层里同一位置就是同一张图，所以直接藏起来看不出差别 */
.project.is-expanding .project-media { visibility: hidden; }
/* 轮播里的景深图 / 默认图 / 模糊图自己带 visibility: visible !important，盖过上面的「藏起来」——展开时它们会以灰阶的样子在大图中间露出一块方形（有四周的羽化余量）；
   这里用更高的优先级一并藏起 */
body.home.home-carousel .project.is-expanding .project-media :is(img, canvas) { visibility: hidden !important; }
/* 01 悬停时的渐变模糊（8 层背景模糊）：卡片提到展开层之上后，它会去模糊下面正在变化的大图——
   在卡片原位留下一块模糊的残影，而且每帧重算 8 层模糊，展开动画严重掉帧。点下去就撤掉 */
.project.is-expanding .media-blur { display: none; }
/* 图上的渐变：::after 是常驻的浅色上下渐变，::before 是 01 悬停时的深色遮罩（选择器要写到与悬停规则同级才盖得过）。
   它们只盖在卡片原位，大图一往外扩，原位就比外面暗一块；所以要在大图几乎还没动的前 0.12s 内淡完
   （展开曲线起步慢，这时大图边缘才往外走了几十像素），文字不在乎边界，仍慢慢淡出 */
.project.is-expanding .project-media::after { opacity: 0; transition: opacity 0.12s ease-out; }
/* 卡片顶部那条 48px 的底色渐变（.project::after，悬停时隐藏）：展开中鼠标若移出这张卡片，悬停失效，它会淡回来，
   而这时卡片排在展开层之上，就在卡片原位的顶上压出一块底色渐变（偶发）。展开中一直藏着 */
.project.is-expanding::after { opacity: 0; transition: none; }
/* 01 的悬停遮罩：展开层盖着一模一样的遮罩（.page-expand.is-shaded::before），同一帧交接、立刻撤掉；
   卡片在展开层之上（z-index 20 > 19），以前 0.12s 淡出的那几帧两层遮罩叠在一起，点击瞬间整张图暗一下 */
.project.is-cover.is-expanding .project-media::before { opacity: 0; transition: none; }
.project.is-expanding .project-text,
.project.is-expanding .index { opacity: 0; transition: opacity 0.4s ease; }

/* 入场：<head> 的脚本在首帧前加上 data-enter，内容先藏在屏幕下方 */
html[data-enter="expand"] main,
html[data-enter="expand"] .home-footer {
  position: relative;
  z-index: 2;
  background: var(--bg);
  transform: translateY(100vh);
}
html[data-enter="expand"] main { min-height: calc(100vh - var(--header-h)); }
/* focus（回到首页）：首帧前先把玻璃后面的内容藏起，main.js 再让它从远处由糊变清地靠近；顶栏、底栏一开始就在。
   expand（内容页探出 / 窄条）不能切换 html 的 overflow：浏览器会沿用「页面不可滚动」的旧判断，
   完全升起后不挪动鼠标就滚不动；改由 main.js 拦截滚动 */
/* 幕布：一整面页面底色，在顶栏（20）之下、其余一切之上。离场时由 main.js 生成 .page-veil 淡入；
   到达页首帧就由 body::after 盖着，main.js 再让它淡去 */
.page-veil,
html[data-enter="focus"] body::after {
  content: "";
  position: fixed;
  inset: 0;
  z-index: 19;
  background: var(--bg);
  pointer-events: none;
}
/* 兜底：脚本没能运行时 4 秒后幕布自己淡去（脚本的动画排在 CSS 动画之上，正常时盖过它，也早在 4 秒前就撤掉了 data-enter） */
html[data-enter="focus"] body::after { animation: enter-veil-safety 0.4s ease 4s forwards; }
@keyframes enter-veil-safety { to { opacity: 0; } }
/* expand：导航栏以下铺大图，下半部加深色渐变，内容页上沿带一道阴影 */
html[data-enter="expand"] main { box-shadow: 0 -24px 60px rgba(var(--shadow), 0.18); transition: box-shadow 0.5s ease; }
/* 升到完整内容页时，内容页上沿向上的阴影淡出：完整页的上沿紧贴顶栏，渐变模糊的顶栏下沿几乎透明，
   阴影会透出来，像顶栏下面多了一道灰边。退回大图时阴影再淡入 */
html[data-enter="expand"].enter-rising main { box-shadow: 0 -24px 60px rgba(var(--shadow), 0); }
/* 入场接管滚动期间关掉 macOS 的弹性回弹：在页顶继续上滑时整页（连同粘性顶栏）会被往下拉，
   透明的顶栏看起来像被拉伸了 */
html[data-enter] { overscroll-behavior-y: none; }
html[data-enter="expand"] body::before,
html[data-enter="expand"] body::after {
  content: "";
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
}
html[data-enter="expand"] body::before {
  top: 0;
  z-index: 0;
  background: var(--enter-img, none) center / var(--enter-fit, cover) no-repeat,
    var(--enter-ph, none) center / var(--enter-fit, cover) no-repeat,
    var(--inv-bg);
}
html[data-enter="expand"] body::after {
  height: 60vh;
  z-index: 0;
  background: linear-gradient(to bottom, rgba(29, 29, 31, 0), rgba(29, 29, 31, 0.45) 45%, rgba(29, 29, 31, 0.85));
}
/* 探出条上方：左下角项目名（字号沿用首页卡片标题 .project-title）、右下角项目编号（沿用卡片编号字号），
   底边贴着探出的内容页；每段从遮罩下方依次升起 */
.enter-head {
  position: fixed;
  z-index: 1;
  left: 32px;
  right: 32px;
  bottom: calc(var(--enter-peek, 150px) + 16px);
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  color: var(--paper);
  pointer-events: none;
}
.enter-title { margin: 0; flex: 1 1 auto; min-width: 0; }
.enter-head { gap: 16px; }
.enter-num { flex: none; white-space: nowrap; font-size: 30px; line-height: 1; letter-spacing: -0.06em; } /* 窄屏下不能被标题挤成竖排（0 / 2） */
.enter-head .tw-word { display: inline-block; white-space: nowrap; } /* 西文单词不在字母中间折行 */
.enter-head .tw { display: inline-block; overflow: hidden; vertical-align: top; padding-bottom: 0.08em; margin-bottom: -0.08em; }
.enter-head .tw-in { display: inline-block; transform: translateY(110%); filter: blur(8px); } /* 升起时同时从虚变清 */
@media (max-width: 900px) { .enter-head { left: 24px; right: 24px; } }

/* 跨页视图过渡（仅卡片展开 → 内容页，其余由脚本跳过）：新页面直接盖上旧快照，不再藏起来等大图解码后淡入。
   浏览器有时取不到旧页面的快照（空白），新页面藏着的那段时间整屏就只剩白色底，闪一下白；
   新页首帧本来就是铺满的深色底 + 垫底缩略图（body::before），直接显示即可，大图解码好再盖上去 */
@view-transition { navigation: auto; }
/* 浏览器默认让新旧快照以 plus-lighter（亮度相加）叠加做交叉淡化：两张几乎相同的大图叠在一起
   会瞬间变亮，看起来像大图「刷新」了一下。改为普通叠加，新页面直接盖在旧快照上淡入 */
::view-transition-old(root),
::view-transition-new(root) { mix-blend-mode: normal; }
::view-transition-old(root) { animation: none; }
::view-transition-new(root) { animation: none; }


/* 1：展开中的卡片大图也带同样的底部渐变（贴着大图下沿，展开结束时与内容页上的渐变完全重合） */
.page-expand-inner::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 60vh;
  background: linear-gradient(to bottom, rgba(29, 29, 31, 0), rgba(29, 29, 31, 0.45) 45%, rgba(29, 29, 31, 0.85));
  pointer-events: none;
}
/* 4：内容页还在位移（探出 / 升降中）时，固定定位的章节导航会相对 main 错位；
   这段时间改为显示章节左栏自身的编号，导航等完全升起后再接管（页顶时两者位置相同） */
/* 入场中（含底色幕布 focus）main 带着位移 / 缩放，固定定位的章节导航会以 main 为参照、整体往下偏一个顶栏高度，
   动画结束时再跳回原位：入场期间一律先藏起导航，左栏照常显示 */
html[data-enter]:not(.enter-full) .cs-index { display: none !important; }
html[data-enter]:not(.enter-full) .cs-rail.is-indexed > * { visibility: visible !important; }
html[data-enter]:not(.enter-full) .cs-rail.is-indexed { border-top-color: var(--line) !important; }

/* Back to index：文字逐字母滚动（箭头不动），遮罩收窄到字身高度，不越过下划线；点击后变为特殊蓝 */
.back-link > span[lang] { white-space: nowrap; }
.back-link .c {
  display: inline-block;
  vertical-align: top;
  clip-path: inset(calc((1lh - 1.235em) / 2) 0);
}
.back-link .c-roll {
  display: inline-block;
  position: relative;
  transition: transform 0.45s cubic-bezier(0.65, 0, 0.35, 1);
  transition-delay: calc(var(--i) * 22ms);
}
.back-link .c-roll::after { content: attr(data-ch); position: absolute; left: 0; top: 100%; }
.back-link:hover .c-roll,
.back-link:focus-visible .c-roll { transform: translateY(-100%); }
.back-link.is-clicked,
.back-link.is-clicked:hover { color: var(--accent); }
@media (prefers-reduced-motion: reduce) {
  .back-link .c-roll { transition: none; }
  .back-link:hover .c-roll, .back-link:focus-visible .c-roll { transform: none; }
}

/* 章节导航点击：黑底变为特殊蓝（颜色立即切换），随后往下收成一条线淡出（main.js）；收起后鼠标还在上面也不再展开，直到移开 */
.cs-index-item.is-pressed .cs-index-fill { background: var(--accent); }
/* 手机上点卡片：白色遮罩代替大图展开 */
.page-wipe.is-white { background: var(--gray-0); }

/* 移动端菜单（2026-11-23 起）：和桌面端一致，只有当前所在的页面是白色（aria-current），其余为灰色；点击时仍闪一下特殊蓝。
   （原来手机上两个选项常显白色） */
/* 从白色遮罩进入内容页：大图与渐变首帧先藏在屏幕下方，由 main.js 与内容页一起升起 */
html[data-enter-rise] body::before,
html[data-enter-rise] body::after { transform: translateY(100vh); }

/* 内容页入场的大图（真正的 <img>，与 body::before 的背景图位置完全重合；渐变 body::after 画在它上面） */
.enter-img {
  position: fixed;
  z-index: 0;
  top: 0;
  left: 0;
  width: 100%;
  height: 100vh;
  object-fit: var(--enter-fit, cover);
  object-position: center;
  /* 大图还没画出来的那几帧，先露出垫在下面的缩略图（main.js 的 thumb()），不再是一块深色底 */
  background: var(--inv-bg) var(--enter-ph, none) center / var(--enter-fit, cover) no-repeat;
  pointer-events: none;
}
html[data-enter-rise] .enter-img { transform: translateY(100vh); }
html:not([data-enter="expand"]) .enter-img { display: none; }

/* 内容页分块显现：进入视野时从下往上淡入（类名由 main.js 加上；脚本失效时内容照常显示） */
.reveal {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.reveal.is-revealed { opacity: 1; transform: none; }

/* HMW 句子打字动效：字先占好位置（透明），逐个显示；光标贴在最后一个显示的字右侧，不占排版空间 */
.cs-statement .tw-word { white-space: nowrap; }
.cs-statement.is-typing-ready .tc { opacity: 0; position: relative; }
.cs-statement.is-typing-ready .tc.is-on { opacity: 1; }
.cs-statement .tc.is-cur::after {
  content: "";
  position: absolute;
  top: 0.12em;
  bottom: 0.08em;
  right: -0.08em;
  width: 2px;
  background: var(--accent);
}
.cs-statement .tc.is-cur.is-done::after { animation: caret-blink 0.8s steps(1) 2; }
@keyframes caret-blink { 50% { opacity: 0; } }
/* 逗号处停顿：光标快闪一下 */
.cs-statement .tc.is-cur.is-pause::after { animation: caret-blink 0.4s steps(1) 1; }
/* 图片类组件：从更低处升起并由 94% 放大到原尺寸，过程更慢，显现更明显 */
.reveal.reveal-media {
  transform: translateY(96px) scale(0.94);
  transform-origin: 50% 100%;
  transition-duration: 1.3s, 1.3s;
}
.reveal.reveal-media.is-revealed { transform: none; }


/* 引言关键词：取消模糊，改为蓝色从左往右「刷」过去盖住灰字（背景渐变裁切到文字上，滑动背景位置）。
   仍按 main.js 写在元素上的延迟依次触发；放在最后，覆盖上面的模糊动画 */
.cs-quote.is-armed p strong {
  filter: none;
  color: var(--accent);
  -webkit-text-fill-color: transparent;
  background: linear-gradient(90deg, var(--accent) 50%, var(--gray-4) 50%) 100% 0 / 200% 100% no-repeat;
  /* 背景只画在元素框内，g、p 的下伸部分会超出框外被裁掉；上下加内边距扩大背景区域（行内元素的上下内边距不影响排版） */
  padding: 0.15em 0 0.25em;
  -webkit-background-clip: text;
  background-clip: text;
  transition: none;
}
.cs-quote.is-armed.is-in p strong { animation: quote-wipe 0.75s cubic-bezier(0.83, 0, 0.17, 1) both; } /* 慢—快—慢 */
@keyframes quote-wipe {
  from { background-position: 100% 0; }
  to { background-position: 0 0; }
}

/* 中文引言不限制行宽：18em 只够 18 个汉字，会在逗号后提前换行；改为和英文一样排到最右边再换行 */
:root[lang="zh-CN"] .cs-body .cs-quote p { max-width: none; }

/* 移动端菜单：编号移到同一行的屏幕右侧（与选项文字垂直居中），选项之间更紧凑，整体靠下 */
@media (max-width: 540px) {
  .menu { padding-bottom: 32px; }
  /* 编号：Switzer 12px，与选项文字的基线（底部）对齐；
     每项下方常显一条贯穿整行的细线（手机没有悬停，原来悬停才出现的文字下划线隐藏） */
  .menu li {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    margin-top: 12px;
    padding-bottom: 10px;
    position: relative;
  }
  /* 细线只在文字到编号之间（两侧留出页边距），半透明白、0.5px */
  .menu li::after {
    content: "";
    position: absolute;
    left: var(--gutter);
    right: var(--gutter);
    bottom: 0;
    height: 0.5px;
    background: color-mix(in srgb, var(--inv-fg) 35%, transparent);
  }
  .menu li small { order: 2; margin: 0; font-family: var(--font-switzer); font-weight: 400; font-size: 12px; letter-spacing: 0.08em; }
  .menu a > span, .menu a:hover > span, .menu a:focus-visible > span { background-size: 0 0; }
}

/* 菜单里的联系方式（LinkedIn + 可复制的邮箱）：顶栏悬停版用不了的屏幕（手机、平板、触屏）才显示，放在选项列表下方 */
.menu .menu-contact { display: none; }
@media (max-width: 719px), (hover: none) {
  .menu { align-content: end; }
  .menu .menu-contact {
    grid-column: 1 / -1;
    display: flex;
    flex-wrap: wrap;
    gap: 12px 24px;
    padding: 26px var(--gutter) 0;
  }
  .menu .mc-item {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 0;
    border: 0;
    background: none;
    color: var(--inv-muted);
    font-family: var(--font-switzer);
    font-weight: var(--weight-strong);
    font-size: 14px;
    line-height: 1.5;
    text-align: left;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
    transition: color 0.3s;
  }
  .menu .mc-item:hover, .menu .mc-item:active, .menu .mc-item:focus-visible { color: var(--inv-fg); }
  .menu .mc-icon { display: grid; width: 18px; height: 18px; flex: none; }
  .menu .mc-icon svg { display: block; width: 18px; height: 18px; }
  .menu .mc-icon > span { grid-area: 1 / 1; }
  .menu .mc-arr { display: inline-flex; width: 16px; height: 16px; margin-left: -4px; flex: none; }
  .menu .mc-arr svg { display: block; width: 16px; height: 16px; }
  /* 邮箱：图标 / 文字各占固定位置（文字与「已复制」叠在同一格，宽度不变、不会换行）。点按后：邮件图标换成复制图标，邮箱换成「已复制」 */
  .menu .mc-mail { display: inline-grid; grid-template-columns: 18px auto; column-gap: 8px; align-items: center; }
  .menu .mc-mail .mc-text, .menu .mc-mail .mc-done { grid-column: 2; grid-row: 1; white-space: nowrap; }
  .menu .mc-i-copy, .menu .mc-done { visibility: hidden; }
  .menu .mc-mail.is-copied { color: var(--accent); }
  .menu .mc-mail.is-copied .mc-i-mail, .menu .mc-mail.is-copied .mc-text { visibility: hidden; }
  .menu .mc-mail.is-copied .mc-i-copy, .menu .mc-mail.is-copied .mc-done { visibility: visible; }
}

/* 首页卡片默认状态：顶部一小段由页面底色渐变到透明，让卡片上沿与页面背景融为一体（悬停 / 点开后淡出） */
.project::after {
  content: "";
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 48px;
  z-index: 1; /* 在图片之上、编号之下 */
  background: linear-gradient(to bottom, var(--bg), color-mix(in srgb, var(--bg) 0%, transparent));
  pointer-events: none;
  transition: opacity var(--dur) var(--ease);
}
:where(body:not(.cards-tap)) .project:hover::after,
.project:focus-visible::after,
.project.is-active::after { opacity: 0; }

/* 移动端首页卡片显现：分上下两段，各自进入窗口时触发（main.js 加 is-top-in / is-text-in）——
   上半部分（编号 + 图片）按内容页图片的效果升起并由 86% 放大；下半部分（分类 + 标题）按内容页文字的效果升起 */
.project.card-reveal .project-media,
.project.card-reveal .index {
  opacity: 0;
  transform: translateY(96px) scale(0.86);
  transform-origin: 50% 100%;
  transition: opacity 1.3s cubic-bezier(0.16, 1, 0.3, 1), transform 1.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.project.card-reveal .project-text {
  opacity: 0;
  transform: translateY(40px);
  transition: opacity 0.9s cubic-bezier(0.16, 1, 0.3, 1), transform 0.9s cubic-bezier(0.16, 1, 0.3, 1);
}
.project.card-reveal.is-top-in .project-media,
.project.card-reveal.is-top-in .index,
.project.card-reveal.is-text-in .project-text { opacity: 1; transform: none; }

/* 开篇通栏视频：与图片同样铺满画框；视频就绪后盖在封面图之上。
   四边各多出 1px（画框会裁掉）：画框高度是小数像素时，边上会漏出一条画框的浅色底，深色视频下沿看着像一道白边 */
.media-frame video {
  position: absolute;
  inset: -1px;
  width: calc(100% + 2px);
  height: calc(100% + 2px);
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.media-frame.has-video video { opacity: 1; }

/* =========================================================
   深色模式：开关与少量只在深色下需要的调整（色值见文件开头的 data-theme="dark"）
   ========================================================= */
/* 开关：浅色显示太阳、深色显示月亮（Material Symbols light_mode / dark_mode）；颜色与菜单图标一致，悬停加深 */
.theme-toggle {
  flex: none;
  width: 32px;
  height: 40px;
  padding: 0;
  border: 0;
  background: none;
  cursor: var(--cur-tap);
  display: grid;
  place-items: center;
  color: var(--gray-6);
  transition: color 0.3s;
}
.theme-toggle:hover, .theme-toggle:focus-visible { color: var(--fg); }
.menu-open .theme-toggle, .menu-handoff .theme-toggle, .menu-closing .theme-toggle { color: inherit; }
/* 遮罩：两个图标叠在同一格，切换时像署名的逐字母滚动一样在遮罩里上下交替 */
.theme-toggle .tt-mask {
  position: relative;
  display: grid;
  width: 20px;
  height: 20px;
  overflow: hidden;
}
.theme-toggle .tt-icon {
  grid-area: 1 / 1;
  display: grid;
  place-items: center;
}
.theme-toggle svg {
  display: block;
  width: 16px;
  height: 16px;
  transition: transform 0.6s var(--ease);
}
/* 切换动画：日落月升。离场的图标加速向上滚出并转走（0.4s），
   入场的图标稍等一拍后从下方转着升起、减速停稳（0.6s）；切回浅色时按相反方向回滚。
   过渡写在目标状态上：入场用入场节奏，离场用离场节奏 */
.theme-toggle .tt-sun,
:root[data-theme="dark"] .theme-toggle .tt-moon {
  transform: none;
  opacity: 1;
  transition: transform 0.6s cubic-bezier(0.22, 1, 0.36, 1) 0.12s, opacity 0.3s ease 0.12s;
}
:root[data-theme="dark"] .theme-toggle .tt-sun {
  transform: translateY(-140%) rotate(90deg) scale(0.6);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.55, 0, 1, 0.45), opacity 0.4s ease-in;
}
.theme-toggle .tt-moon {
  transform: translateY(140%) rotate(-90deg) scale(0.6);
  opacity: 0;
  transition: transform 0.4s cubic-bezier(0.55, 0, 1, 0.45), opacity 0.4s ease-in;
}
/* 悬停：太阳的光芒转动 45°，月亮微微侧倾 */
.theme-toggle:hover .tt-sun svg, .theme-toggle:focus-visible .tt-sun svg { transform: rotate(45deg); }
.theme-toggle:hover .tt-moon svg, .theme-toggle:focus-visible .tt-moon svg { transform: rotate(-20deg); }
@media (prefers-reduced-motion: reduce) {
  .theme-toggle .tt-icon, .theme-toggle svg { transition: none !important; }
}
.lang-toggle { margin-right: 10px; }
@media (max-width: 540px) { .lang-toggle { margin-right: 6px; } }

/* 切换主题：新配色像菜单一样从上往下盖下来（同一节奏 0.8s）；浏览器不支持视图过渡时直接切换 */
html.vt-theme::view-transition-old(root) { animation: none; }
html.vt-theme::view-transition-new(root) { animation: theme-wipe 0.8s var(--ease) both; }
@keyframes theme-wipe {
  from { clip-path: inset(0 0 100% 0); }
  to { clip-path: inset(0 0 0 0); }
}

/* 首页 02–04 的默认线稿是为浅底画的，深色下反相；悬停图本来就是深底版本，不动 */
:root[data-theme="dark"] .project:not(.is-cover) .img-default { filter: invert(1); }

/* 01 封面卡片底部：深色下作品图的亮部会透过 95% 的底色遮罩，卡片下沿与底栏之间出现一道分界。
   参考顶部的渐变，底部改为缓入缓出地加深到 100% 页面底色，卡片下沿与卡片外完全同色（悬停时照常淡出） */
:root[data-theme="dark"] .project.is-cover .project-media::after {
  background: var(--card-edge), linear-gradient(to bottom,
    color-mix(in srgb, var(--bg) 85%, transparent) 0%, color-mix(in srgb, var(--bg) 0%, transparent) 20%,
    color-mix(in srgb, var(--bg) 0%, transparent) 50%, color-mix(in srgb, var(--bg) 8%, transparent) 56%,
    color-mix(in srgb, var(--bg) 24%, transparent) 62%, color-mix(in srgb, var(--bg) 46%, transparent) 68%,
    color-mix(in srgb, var(--bg) 68%, transparent) 75%, color-mix(in srgb, var(--bg) 85%, transparent) 83%,
    color-mix(in srgb, var(--bg) 96%, transparent) 92%, var(--bg) 100%);
}

/* =========================================================
   开篇视频控制条：暂停 / 进度条（可拖动）/ 时间 / 全屏
   桌面端鼠标悬停画面时从下方浮出，触屏点一下画面出现（main.js 加 vc-on，3 秒后收起）；暂停时常显。
   底部一层很淡的深色渐变 + 白色控件：画面无论是浅底、蓝色转场还是深色段落都看得清，也不会给画面蒙上一层白雾
   ========================================================= */
.vc {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 48px var(--gutter) 16px;
  /* 缓入缓出的多段渐变，顶端不会出现明显的折痕 */
  background: linear-gradient(to top, rgba(0, 0, 0, 0.42) 0%, rgba(0, 0, 0, 0.34) 20%, rgba(0, 0, 0, 0.22) 42%,
              rgba(0, 0, 0, 0.11) 64%, rgba(0, 0, 0, 0.04) 84%, rgba(0, 0, 0, 0) 100%);
  color: #f5f5f7;
  opacity: 0;
  transform: translateY(10px);
  pointer-events: none;
  transition: opacity 0.35s ease, transform 0.6s var(--ease);
}
/* 视频画框的底色跟随视频本身（浅底版 / 深底版）：加载前、缩放显现时的边缘与全屏时的四周都与画面同色 */
.media-frame { --vc-bg: #f5f5f7; }
.media-frame.is-video-dark { --vc-bg: #1d1d1f; }
.media-frame.is-video { background: var(--vc-bg); }
/* 要放视频时不显示封面图（片头第 70 帧）和占位：视频从第 0 帧（与底色同色）开始，先露出封面会在开播时跳回空白、像闪了一下 */
.media-frame.is-video img,
.media-frame.is-video .media-ph { visibility: hidden; }
.media-frame:not(.has-video) .vc { display: none; }
/* 控件自带一层很小的投影：落在浅色画面上也能分清，不必把整条渐变加深 */
.vc > * { filter: drop-shadow(0 1px 2px rgba(0, 0, 0, 0.35)); }
@media (hover: hover) {
  .media-frame:hover .vc { opacity: 1; transform: none; pointer-events: auto; }
  .media-frame.has-video { cursor: var(--cur-tap); }
}
.media-frame:focus-within .vc,
.media-frame.vc-on .vc,
.media-frame.is-held .vc,
.media-frame.is-seeking .vc { opacity: 1; transform: none; pointer-events: auto; }

.vc-btn {
  flex: none;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: inherit;
  cursor: var(--cur-tap);
  display: grid;
  place-items: center;
}
.vc-btn svg { width: 16px; height: 16px; fill: currentColor; transition: transform 0.4s var(--ease); }
.vc-btn:hover svg, .vc-btn:focus-visible svg { transform: scale(1.12); }
.vc-speed svg { width: 24px; height: 24px; }
.vc-speed { opacity: 0.7; transition: opacity 0.25s ease, color 0.25s ease; }
.vc-speed:hover, .is-fast .vc-speed { opacity: 1; }
.vc-speed { width: 28px; height: 28px; margin: 2px; border-radius: 50%; transition: opacity 0.25s ease, background-color 0.25s ease, color 0.25s ease; }
.is-fast .vc-speed { background: var(--paper); color: var(--ink); } /* 2× 开着时：白色圆圈，图标反成深色 */
.vc-full svg { fill: none; stroke: currentColor; stroke-width: 1.5; }
.vc-i-play, .vc-i-exit { display: none; }
.is-paused .vc-i-play, .is-fullscreen .vc-i-exit { display: inline; }
.is-paused .vc-i-pause, .is-fullscreen .vc-i-enter { display: none; }

/* 进度条：1px 细线，悬停 / 拖动时加粗到 3px，已播放部分变蓝（深底上用提亮的蓝 #6e78ff，纯蓝看不清） */
.vc-track {
  position: relative;
  flex: 1;
  height: 24px;
  cursor: var(--cur-tap);
  touch-action: none;
}
.vc-track::before,
.vc-fill {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 50%;
  height: 1px;
  margin-top: -0.5px;
  transition: height 0.3s var(--ease), margin-top 0.3s var(--ease), background-color 0.3s;
}
.vc-track::before { background: rgba(245, 245, 247, 0.32); }
.vc-fill { background: currentColor; transform-origin: 0 50%; transform: scaleX(0); }
.vc-track:hover::before, .vc-track:hover .vc-fill, .vc-track:focus-visible::before, .vc-track:focus-visible .vc-fill,
.is-seeking .vc-track::before, .is-seeking .vc-fill { height: 3px; margin-top: -1.5px; }
.vc-track:hover .vc-fill, .vc-track:focus-visible .vc-fill, .is-seeking .vc-fill { background: #6e78ff; }
.vc-time {
  flex: none;
  min-width: 8ch;
  font-family: var(--font-switzer);
  font-size: 11px;
  letter-spacing: 0.04em;
  font-variant-numeric: tabular-nums;
  text-align: right;
}

/* 全屏：整段画面完整显示（不裁切），四周补底色 */
.media-frame:fullscreen { background: var(--vc-bg); }
.media-frame:fullscreen video, .media-frame:fullscreen img { object-fit: contain; }

/* 切换主题时，新一版视频加载好后在旧视频上淡入 */
.media-frame.has-video video.is-swapping { opacity: 0; }

@media (max-width: 540px) {
  .vc { gap: 4px; padding: 36px 12px 6px; }
  .vc-time { font-size: 10px; }
}
@media (prefers-reduced-motion: reduce) {
  .vc { transition: none; transform: none; }
}


/* =========================================================
   升级 2026-11：材质、景深、标注、排版（分析与取舍见 docs/design-upgrade-2026-11.md）
   全部新增规则集中在这一段，删掉这一段（和 main.js 末尾同名的一段）即回到升级前。
   方向：保留国际瑞士主义的网格与克制；把「隔着介质看东西」（磨砂玻璃、景深）和
   「图纸上的标注」（刻度、编号、构造线）两件事做实，而不是照搬参考图的画面。
   ========================================================= */
:root {
  /* 动效令牌：新增动效只用这三条曲线、三档时长（旧动效按眼睛调过，不动） */
  --ease-out: cubic-bezier(0.16, 1, 0.3, 1);      /* 进场：起步快、慢慢停 */
  --ease-in-out: cubic-bezier(0.65, 0, 0.35, 1);  /* 位置切换 */
  --dur-1: 0.3s; --dur-2: 0.6s; --dur-3: 1.1s;
  /* 颗粒：一张 220px 的噪点（深色小点、透明底），铺在玻璃面上；深色面上反相成浅色小点 */
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 0  0 0 0 0 0  0 0 0 0 0  1.6 0 0 0 -0.52'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23n%29'/%3E%3C/svg%3E");
  /* 浅色小点的同一张噪点，直接用在深色面上。原来是把深色小点整层反相（filter: invert），菜单展开时
     每一帧都要对整屏做一次滤镜，动画会掉帧 */
  --grain-light: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='220' height='220'%3E%3Cfilter id='n' x='0' y='0' width='100%25' height='100%25'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='3' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 1  0 0 0 0 1  0 0 0 0 1  1.6 0 0 0 -0.52'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url%28%23n%29'/%3E%3C/svg%3E");
  --grain-a: 0.065;
}
:root[data-theme="dark"] { --grain-a: 0.07; }

/* ---------- 1. 材质：玻璃上的颗粒 ----------
   参考图里的磨砂玻璃都带细颗粒，所以看起来是一块真的介质；原来的模糊是干净的数字模糊。
   颗粒是静止的一张图（不做动画），只铺在大图查看器的背景和菜单上。
   顶栏和首页底栏不加：顶栏的底色是跟着模糊一起从上往下淡出的，压在页面底色上应该看不出来，
   加了颗粒整条顶栏就显出一块颜色；首页的顶栏、底栏还要和卡片上下沿的底色无缝接在一起 */
.lightbox-bg::after,
.menu::after {
  content: "";
  position: absolute;
  inset: 0;
  background: var(--grain) 0 0 / 220px 220px;
  opacity: var(--grain-a);
  pointer-events: none;
}
.menu::after { z-index: -1; background-image: var(--grain-light); opacity: 0.07; } /* 菜单在深浅两种模式下都是深色面 */
/* 菜单展开 / 收起是裁切动画：单独成层，每一帧只重画菜单自己，不牵连下面的页面 */
.menu { will-change: clip-path; }
:root[data-theme="dark"] .lightbox-bg::after { background-image: var(--grain-light); }

/* ---------- 2. 景深：首页悬停一张卡片，其余三张退到玻璃后面 ----------
   原来只有被悬停的卡片「变近」（变彩色、变清晰）；现在其余卡片同时略微失焦、变淡，
   远近关系由一组对比说清楚。只在有鼠标的宽屏上生效 */
@media (hover: hover) and (min-width: 901px) {
  .projects .project-media { transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.7s var(--ease), opacity 0.7s var(--ease); }
  .projects .project-text,
  .projects .project > .index { transition: opacity 0.7s var(--ease); }
  body:not(.cards-tap) .projects:has(.project:hover, .project.is-active) .project:not(:hover):not(.is-active):not(.is-expanding) .project-media { opacity: 0.7; }
  /* 「更远」的那段模糊：不逐帧改模糊半径，换成预先模糊好的一组（.img-far）淡入、原来那组淡出（见「2b」） */
  body:not(.cards-tap) .projects:has(.project:hover, .project.is-active) .project:not(:hover):not(.is-active):not(.is-expanding) .project-media .img-default:not(.img-far) { opacity: 0; transition: opacity 0.7s var(--ease), var(--img-tt); }
  body:not(.cards-tap) .projects:has(.project:hover, .project.is-active) .project:not(:hover):not(.is-active):not(.is-expanding) .project-media .img-far { opacity: 1; transition: opacity 0.7s var(--ease), var(--img-tt); }
  body:not(.cards-tap) .projects:has(.project:hover, .project.is-active) .project:not(:hover):not(.is-active):not(.is-expanding) .project-text,
  body:not(.cards-tap) .projects:has(.project:hover, .project.is-active) .project:not(:hover):not(.is-active):not(.is-expanding) > .index { opacity: 0.45; }
}
/* 触屏（手机、平板，没有悬停）：展开的那张卡片是「近处」，其余卡片同样略微失焦、变淡。
   手机上卡片纵向堆叠、停稳的那张自动展开（夹在两张之间时都不展开，也就都是清晰的）。
   还没显现的卡片（.card-reveal）不参与，免得盖掉它的起始状态 */
body.cards-tap .projects .project:not(.card-reveal) .project-media { transition: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.7s var(--ease), opacity 0.7s var(--ease); }
body.cards-tap .projects .project:not(.card-reveal) .project-text,
body.cards-tap .projects .project:not(.card-reveal) > .index { transition: opacity 0.7s var(--ease); }
body.cards-tap .projects:has(.project.is-active) .project:not(.is-active):not(.is-expanding):not(.card-reveal:not(.is-top-in)) .project-media { opacity: 0.7; }
body.cards-tap .projects:has(.project.is-active) .project:not(.is-active):not(.is-expanding):not(.card-reveal:not(.is-top-in)) .project-media .img-default:not(.img-far) { opacity: 0; transition: opacity 0.7s var(--ease), var(--img-tt); }
body.cards-tap .projects:has(.project.is-active) .project:not(.is-active):not(.is-expanding):not(.card-reveal:not(.is-top-in)) .project-media .img-far { opacity: 1; transition: opacity 0.7s var(--ease), var(--img-tt); }
body.cards-tap .projects:has(.project.is-active) .project:not(.is-active):not(.is-expanding):not(.card-reveal:not(.is-text-in)) .project-text,
body.cards-tap .projects:has(.project.is-active) .project:not(.is-active):not(.is-expanding):not(.card-reveal:not(.is-top-in)) > .index { opacity: 0.45; }
/* 手机（≤540）首页：上下滑动吸附到卡片。每次滑动只走一张（scroll-snap-stop），卡片上沿停在顶栏下沿；
   页尾的底栏按下沿吸附，仍然滑得到。home-snap 由 main.js 加在 html 上（只有首页有）。
   配套的展开逻辑在 main.js：停稳才展开，夹在两张之间都不展开 */
@media (max-width: 540px) {
  html.home-snap { scroll-snap-type: y mandatory; scroll-padding-top: 0; }
  html.home-snap .project { scroll-snap-align: start; scroll-snap-stop: always; }
  html.home-snap .home-footer { scroll-snap-align: end; }
  html.home-snap[data-enter] { scroll-snap-type: none; } /* 页面入场转场期间不吸附 */
}

/* ---------- 2b. 距离感：首页卡片默认隔着一块磨砂玻璃 ----------
   参考图里的东西贴着玻璃的那一块看得清，离玻璃远的地方化开。做法：默认图叠四层（main.js 复制出三层），
   模糊半径由 --far 决定，每层只留自己的一圈，逐级过渡，不会出现清晰和模糊两份画面叠在一起的重影：
   · 近层 .img-near：几乎清晰（0.5px），焦点附近一圈（贴着玻璃的地方）
   · 中层 .img-mid：2.9px（2026-11-22 由 3.4px 略减，保持和外层拉开层次）
   · 外层 .img-mid2：3.4px（2026-11-22 由 7px 逐次略减）
   · 底层（原图）：5.5px，是「离得最远」的边角（2026-11-22 由 11px 逐次略减）
   调过三版：第一版 0.6 / 4 / 12px 三层、清晰的一圈很小，太朦胧；第二版 0 / 1.5 / 3.5 / 7px、清晰范围占一半，
   又太清楚、没有距离感；第三版取中间（0.3 / 2.5 / 5.5 / 9.5px）仍偏清楚；现在接近第一版，但保留四级过渡。焦点位置按图片自身算，--fx / --fy 可逐张调。
   四张卡片模糊程度相同（一样远）；悬停时默认图整组淡出、换成清晰的彩色图（拉近），其余卡片在这之上再整体模糊（更远） */
/* 其余卡片「更远」时加的那一段模糊（--more）加在每张图自己身上，不加在整个图片层上：
   整层模糊会让图片层贴着卡片边的地方变半透明，露出下面的卡片底色——浅色模式下卡片底色比页面底色深，
   接缝处就冒出一条暗边。
   原来是把每张图的模糊半径从 --far 过渡到 --far + 5px：来回切换卡片时，三张卡片 × 四层图每一帧都要重新模糊，
   掉帧严重。现在 main.js 把四层再复制一组（.img-far，模糊固定多 5px），「变远」只是两组之间交叉淡入淡出，
   模糊不再变化、只动不透明度，交给合成器；终点画面与原来相同。.img-far 不显示时不绘制，平时不增加负担 */
.projects .project-media .img-default {
  transition: opacity 0.4s, transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), translate 0.9s cubic-bezier(0.2, 0.7, 0.2, 1), filter 0.7s var(--ease);
}
.projects .project-media .img-default { --far: 5.5px; filter: blur(calc(var(--far) + var(--more, 0px))); }
/* 两组同时、同节奏地交叉淡入淡出（变远 0.7s 缓动，与图片层变淡同步；回来 0.4s，与原图淡入同步），
   两边的时长、曲线必须一致，中途的透明度加起来才正好是 1。
   画好的那两张（.img-pair，见「2c」）用「相加」的方式叠在一起，中途正好是两张图按比例混合，
   04 这种透明底的线稿也不会中途变淡。（试过错开时间切换：先盖上模糊的再撤掉清楚的，过渡分成两段，看起来顿一下） */
.projects { --img-tt: transform 0.6s cubic-bezier(0.2, 0.7, 0.2, 1), translate 0.9s cubic-bezier(0.2, 0.7, 0.2, 1); }
.projects .project-media .img-far { --more: 5px; opacity: 0; transition: opacity 0.4s, var(--img-tt); }
:where(body:not(.cards-tap)) .project:hover .project-media .img-far,
.project:focus-visible .project-media .img-far,
.project.is-active .project-media .img-far { transition: opacity 0.4s, var(--img-tt); } /* 变成悬停的那张：直接淡出，不等 */
.projects .project.is-cover .project-media .img-default { filter: saturate(0) blur(calc(var(--far) + var(--more, 0px))); }
:root[data-theme="dark"] .projects .project:not(.is-cover) .img-default { filter: invert(1) blur(calc(var(--far) + var(--more, 0px))); }
.projects .project-media .img-mid2 {
  --far: 3.4px;
  -webkit-mask-image: radial-gradient(ellipse 82% 74% at var(--fx, 50%) var(--fy, 48%), #000 36%, transparent 100%);
  mask-image: radial-gradient(ellipse 82% 74% at var(--fx, 50%) var(--fy, 48%), #000 36%, transparent 100%);
}
.projects .project-media .img-mid {
  --far: 2.9px;
  -webkit-mask-image: radial-gradient(ellipse 63% 57% at var(--fx, 50%) var(--fy, 48%), #000 32%, transparent 100%);
  mask-image: radial-gradient(ellipse 63% 57% at var(--fx, 50%) var(--fy, 48%), #000 32%, transparent 100%);
}
.projects .project-media .img-near {
  --far: 0.5px;
  -webkit-mask-image: radial-gradient(ellipse 38% 34% at var(--fx, 50%) var(--fy, 48%), #000 21%, transparent 100%);
  mask-image: radial-gradient(ellipse 38% 34% at var(--fx, 50%) var(--fy, 48%), #000 21%, transparent 100%);
}

/* ---------- 2c. 预先画好的模糊（2026-11-16 减负） ----------
   上面的四层（和「更远」的四层）、01–03 悬停时上下沿的 8 层背景模糊（.media-blur），都是浏览器每次重画时现场算的模糊。
   鼠标一动（视差、放大），这些层就要整张重新模糊，显卡来不及，会掉帧、出现没画完的横条、图片一闪。
   main.js 在图片加载后把它们一次性画到画布（canvas）上，画好就换上，画面与原来相同。
   画布直接放进页面，不转成图片文件（转 PNG 一张要 1 秒多），所以上面凡是写给 img 的规则都同时写给 canvas：
   · .img-baked：默认图四层叠好的结果；.img-baked.img-far：「更远」那一组
   · .img-hblur：悬停图上下沿分段模糊好的一张透明底图片，盖在悬停图上，随悬停淡入
   画好之前、浏览器不支持画布滤镜时，仍用上面的实时模糊 */
/* 原来的图藏起来用 visibility 而不是 display: none：藏着也要能量出尺寸，换模式换图重画时（04）要按它的尺寸画；
   visibility: hidden 的元素不绘制，负担和 display: none 差不多 */
.project-media.is-baked .img-default:not(.img-baked) { visibility: hidden; }
.projects .project-media .img-baked { filter: none !important; -webkit-mask-image: none !important; mask-image: none !important; }
.project-media.is-hbaked .media-blur { display: none; }
/* 默认和「更远」两张画好的图装在同一个隔离的小组里，按「相加」叠在一起（plus-lighter，浏览器自带的页面过渡也这样做）：
   交叉淡入淡出时 a 份 + (1 − a) 份，正好是两张图的混合，透明的地方不会变淡；不支持的浏览器照常叠放 */
.img-pair { position: absolute; inset: 0; isolation: isolate; pointer-events: none; }
@supports (mix-blend-mode: plus-lighter) {
  .img-pair > .img-baked { mix-blend-mode: plus-lighter; }
}
/* 上下沿模糊：悬停时比悬停图晚一点淡入（原来是模糊半径从 0 慢慢变大）；移开时先收掉 */
.projects .project-media .img-hblur { transition: opacity 0.25s, var(--img-tt); }
:where(body:not(.cards-tap)) .project.is-cover:hover .project-media .img-hblur,
.project.is-cover:focus-visible .project-media .img-hblur,
.project.is-cover.is-active .project-media .img-hblur { transition: opacity 0.45s var(--ease) 0.15s, var(--img-tt); }

/* 菜单打开时，卡片的失焦 / 复原不做过渡：鼠标从卡片移到菜单按钮，卡片正好在做 0.7 秒的模糊过渡
   （每张卡片里叠着四层带模糊的图，过渡时每一帧都要重算），和菜单展开撞在一起会掉帧。菜单马上盖住卡片，直接到位看不出来 */
.menu-open .projects .project-media,
.menu-open .projects .project-media :is(img, canvas),
.menu-open .projects .project-text,
.menu-open .projects .project > .index { transition: none !important; } /* 要压过触屏那几条更具体的过渡规则 */

/* ---------- 3. 对焦式显现：内容进入视野时，从失焦变清晰 ----------
   原来是从下往上淡入；现在加一段由模糊到清晰（像从玻璃后面走到玻璃前），位移不变。
   图片类失焦略重、对焦略慢。模糊很轻、收得比位移快：快速浏览时一屏里同时有好几块在显现，
   模糊重了会抢眼（原来文字 6px / 图片 14px，按反馈减到 2px / 5px） */
.reveal { filter: blur(4px); /* 2026-11-23 由 2px 加强 */ transition: opacity 0.9s var(--ease-out), transform 0.9s var(--ease-out), filter 0.5s var(--ease-out); }
.reveal.is-revealed { filter: blur(0); }
.reveal.reveal-media { filter: blur(8px); /* 2026-11-23 由 5px 加强 */ transition-duration: 1.3s, 1.3s, 0.7s; }
.reveal.reveal-media.is-revealed { filter: blur(0); }
/* 从首页卡片进来、整页正在升起 / 落下（还没升到完整页）时，显现不带模糊：
   整页在移动的同时，开篇的大标题等大块文字还要逐帧重算模糊，GPU 吃不消，升起过程会掉帧。只淡入 + 上浮，页面升到完整页之后恢复原样 */
html[data-enter="expand"]:not(.enter-full) .reveal { filter: none !important; }

/* ---------- 4. 构造线：章节顶部的细线像画图一样从左画到右 ----------
   （html.js-lines 由 main.js 加上；脚本失效或减少动态效果时，线照常直接显示）
   一笔画过整行：先画左侧编号栏上方那一段，接着画正文上方那一段，一共约 1.4 秒。
   章节顶部进到屏幕下沿以上 14% 才起笔，不会在屏幕最下面一闪就画完 */
.js-lines .cs-section > .cs-rail,
.js-lines .cs-stats li {
  border-top-color: transparent;
  background-image: linear-gradient(var(--rule, var(--line)), var(--rule, var(--line)));
  background-repeat: no-repeat;
  background-origin: border-box;
  background-position: 0 0;
  background-size: 0% 1px;
}
.js-lines .cs-section > .cs-rail { transition: background-size 0.45s cubic-bezier(0.5, 0, 0.9, 0.6); }
.js-lines .cs-section.is-drawn > .cs-rail,
.js-lines .cs-stats.is-in li { background-size: 100% 1px; }
/* 正文上方那一段只在宽屏有（≤900 时编号栏在正文上面，正文上方本来就没有线） */
@media (min-width: 901px) {
  .js-lines .cs-section > .cs-body {
    border-top-color: transparent;
    background-image: linear-gradient(var(--line), var(--line));
    background-repeat: no-repeat;
    background-origin: border-box;
    background-position: 0 0;
    background-size: 0% 1px;
    transition: background-size 1s cubic-bezier(0.2, 0.6, 0.2, 1) 0.42s;
  }
  .js-lines .cs-section.is-drawn > .cs-body { background-size: 100% 1px; }
}
/* 已收进章节导航的章节：左栏上方这段线由导航自己的线代替（同 .cs-rail.is-indexed 的边框），画出来的线也要藏起来，
   否则接替后这条线还跟着正文往上走，从导航里穿过去，看起来像第 08 章的分隔线分出了一条 */
@media (min-width: 901px) {
  .has-cs-index.js-lines .cs-section > .cs-rail.is-indexed { background-image: none; }
}
html[data-enter]:not(.enter-full).js-lines .cs-section > .cs-rail.is-indexed { background-image: linear-gradient(var(--line), var(--line)); }
@media (max-width: 900px) {
  .js-lines .cs-section > .cs-rail { transition: background-size 1.2s var(--ease-in-out); }
}
/* 数据组件：整块先淡入（约 0.3 秒看得清），每一项上方的线随后逐项画出，和数字跳动的节奏一致 */
.js-lines .cs-stats li { --rule: var(--gray-8); transition: background-size 1.1s var(--ease-in-out) 0.3s; }
.js-lines .cs-stats li:nth-child(2) { transition-delay: 0.48s; }
.js-lines .cs-stats li:nth-child(3) { transition-delay: 0.66s; }
.js-lines .cs-stats li:nth-child(4) { transition-delay: 0.84s; }
.js-lines .cs-stats li:nth-child(5) { transition-delay: 1.02s; }
.js-lines .cs-stats li:nth-child(6) { transition-delay: 1.2s; }
.js-lines .cs-stats li:nth-child(n+7) { transition-delay: 1.38s; }

/* ---------- 5. 图号：图注前自动编号 Fig.01、Fig.02 … ----------
   每个语言版本各自从 01 数起；只有带图注的图才编号。编号由 main.js 按页面顺序写进
   data-fig（折叠着的章节也算在内，所以展开 / 收起时号码不会变） */
.cs-figure figcaption[data-fig]::before {
  content: "Fig." attr(data-fig);
  margin-right: 0.9em;
  font-style: normal;
  font-weight: 500;
  font-size: 11px;
  letter-spacing: 0.1em;
  font-variant-numeric: tabular-nums;
  color: var(--gray-7);
}

/* ---------- 6. 阅读标尺：内容页右缘的一根刻度线 ----------
   每个章节一道刻度，实线随阅读进度往下长，旁边一个三位数读数（000–100）。
   颜色直接用页面的文字色（深色模式浅、浅色模式深）。窄屏（≤900）不显示（main.js 生成） */
.read-rule {
  position: fixed;
  top: calc(var(--header-h) + 20px);
  bottom: 20px;
  right: 8px;
  width: 9px;
  z-index: 12;
  pointer-events: none;
  color: var(--fg);
  opacity: 0;
  transition: opacity 0.6s var(--ease);
}
.read-rule.is-on { opacity: 1; }
.read-rule::before { content: ""; position: absolute; top: 0; bottom: 0; right: 0; width: 1px; background: currentColor; opacity: 0.22; }
.rr-fill { position: absolute; top: 0; bottom: 0; right: 0; width: 1px; background: currentColor; transform-origin: 50% 0; transform: scaleY(var(--p, 0)); }
/* 当前章节那一段（从章节的刻度到读数的位置）画成 2px：探出的刻度和下面的进度连成一笔，
   一眼看得出「现在读的这一章从哪里开始、读到了哪里」 */
.rr-seg { position: absolute; right: -0.5px; width: 2px; top: calc(var(--c, 0) * 100%); height: calc((var(--p, 0) - var(--c, 0)) * 100%); background: currentColor; }
.rr-tick { position: absolute; right: 0; width: 5px; height: 1px; background: currentColor; opacity: 0.4; transition: width 0.45s var(--ease-out), height 0.45s var(--ease-out), margin 0.45s var(--ease-out), opacity 0.4s var(--ease); }
.rr-tick.is-past { opacity: 1; }
/* 当前章节的刻度：探出到读数的位置（12px），并加粗到 2px（原来 9px / 1px，不仔细看分辨不出） */
.rr-tick.is-cur { width: 12px; height: 2px; margin-top: -0.5px; opacity: 1; }
.rr-read {
  position: absolute;
  right: 12px;
  top: 0;
  transform: translateY(calc(var(--y, 0px) - 50%));
  font-family: var(--font-switzer);
  font-size: 9px;
  font-weight: 500;
  letter-spacing: 0.12em;
  font-variant-numeric: tabular-nums;
  line-height: 1;
  writing-mode: vertical-rl;
}
/* 滑块：鼠标移到标尺一带（右缘 30px 宽）时出现，停在当前进度上；可以按住拖动，也可以点标尺上任意位置跳过去。
   标尺没显示（页顶、页尾导航）时不接收鼠标 */
.rr-hit { position: absolute; top: -10px; bottom: -10px; right: -8px; width: 30px; cursor: grab; }
.read-rule.is-on .rr-hit { pointer-events: auto; }
.read-rule.is-drag .rr-hit { cursor: grabbing; }
.rr-thumb {
  position: absolute; right: 6px; top: 10px; width: 5px; height: 34px; margin-top: -17px;
  background: currentColor;
  transform: translateY(var(--y, 0px)) scaleX(0.2);
  opacity: 0;
  transition: opacity 0.25s var(--ease), transform 0.3s var(--ease-out);
}
.rr-hit:hover .rr-thumb, .read-rule.is-drag .rr-thumb { opacity: 1; transform: translateY(var(--y, 0px)) scaleX(1); }
.read-rule.is-drag .rr-thumb { transition: opacity 0.25s var(--ease); }
/* 滑块出现时读数往左让开一点 */
.rr-read { transition: margin 0.3s var(--ease-out); }
.rr-hit:hover ~ .rr-read, .read-rule:has(.rr-hit:hover) .rr-read, .read-rule.is-drag .rr-read { margin-right: 4px; }
@media (max-width: 900px) { .read-rule { display: none; } }
/* 有标尺的页面（宽屏）隐藏浏览器自带的滚动条：进度只由标尺表示，仍然可以用滚轮、触控板、键盘和标尺上的滑块滚动 */
@media (min-width: 901px) {
  html.has-read-rule { scrollbar-width: none; }
  html.has-read-rule::-webkit-scrollbar { display: none; }
}
/* 菜单打开时、入场转场还没升到完整页时不显示。从首页卡片进来的页面，data-enter 整个访问期间都在，
   升到完整页后由 enter-full 标记——所以这里要排除 enter-full，否则从卡片进来就一直看不到标尺 */
.menu-open .read-rule, html[data-enter]:not(.enter-full) .read-rule { opacity: 0; }

/* ---------- 7. 平面的体积：可放大的图，悬停时外框轻微放大，并落下一层柔和的投影 ----------
   投影按模式分两档：深色底上同样的黑影几乎看不见，所以深色模式更深、更大 */
:root { --frame-lift: 0 24px 48px -20px rgba(var(--shadow), 0.3), 0 4px 12px -4px rgba(var(--shadow), 0.1); }
/* 深色档同样往下落、两侧几乎不出边（负扩展把影子收在图片底下），向下最多约 35px，
   落在横滑图集让出的空间以内，不会被裁成直边 */
:root[data-theme="dark"] { --frame-lift: 0 32px 56px -24px rgba(0, 0, 0, 1), 0 12px 28px -10px rgba(0, 0, 0, 0.85), 0 3px 8px -2px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(245, 245, 247, 0.07); }
@media (hover: hover) {
  .case-page .cs-figure:not(.is-hero) > .media-frame.is-loaded:not(.has-video) {
    transition: transform 0.5s var(--ease-out), box-shadow 0.5s var(--ease-out);
  }
  /* 外框放大时是一个新的层，会盖在图注上；图注也设为定位元素，排在它后面，投影就落在文字下面 */
  .case-page .cs-figure:not(.is-hero) > figcaption { position: relative; }
  .case-page .cs-figure:not(.is-hero) > .media-frame.is-loaded:not(.has-video):hover {
    transform: scale(1.015);
    box-shadow: var(--frame-lift);
  }
  /* 横滑图集是滚动容器，会把超出的部分裁掉：上下各让出一段内边距（用负外边距抵掉，排版位置不变），
     放大和投影都落在这段空间里；左右不加（否则会多露出相邻的图），改为从左边放大，最左那张不越过图集左沿 */
  .case-page .cs-body > .cs-group.is-carousel { padding: 16px 0 44px; margin-top: 16px; margin-bottom: -40px; }
  .case-page .cs-group.is-carousel .cs-figure > .media-frame { transform-origin: 0 50%; }
  /* 两边顶屏的通栏图（.cs-hero）：外框已经贴着屏幕边，不放大外框，只放大框里的图片；
     投影仍落在外框上（同一个 --frame-lift），左右在屏幕外，看得到的是上下两边 */
  .case-page .cs-hero > .media-frame.is-loaded:not(.has-video) { transition: box-shadow 0.5s var(--ease-out); }
  .case-page .cs-hero > .media-frame.is-loaded:not(.has-video) img { transition: opacity 0.6s var(--ease), transform 0.5s var(--ease-out); }
  .case-page .cs-hero > .media-frame.is-loaded:not(.has-video):hover { box-shadow: var(--frame-lift); z-index: 1; }
  .case-page .cs-hero > .media-frame.is-loaded:not(.has-video):hover img { transform: scale(1.015); }
  /* 「项目过程」收起（只探出开头）和展开动画时会裁边，这时不放大 */
  .case-page .cs-process-content:is(.is-peeking, .is-animating) .cs-figure > .media-frame.is-loaded:not(.has-video):hover { transform: none; box-shadow: none; }
}
@media (hover: hover) and (prefers-reduced-motion: reduce) {
  .case-page .cs-figure:not(.is-hero) > .media-frame.is-loaded:not(.has-video) { transition: none; }
  .case-page .cs-figure:not(.is-hero) > .media-frame.is-loaded:not(.has-video):hover { transform: none; }
  .case-page .cs-hero > .media-frame.is-loaded:not(.has-video) img { transition: opacity 0.6s var(--ease); }
  .case-page .cs-hero > .media-frame.is-loaded:not(.has-video):hover img { transform: none; }
}

/* ---------- 8. 排版细节 ---------- */
/* 标题、图注各行长度均衡，不留孤字；正文避免最后一行只剩一两个字 */
.cs-h2, .cs-h3, .cs-subtitle, .project-title, .cs-card h4, .cs-adj-name { text-wrap: balance; }
/* 图注不做均衡：两行的短图注被平分会在句子中间断行（手机上最明显），改为正常排满、只避免末行孤字 */
.cs-body p, .cs-lede p, .project-summary, .cs-card p, .cs-stat-label, .cs-figure figcaption { text-wrap: pretty; }
/* 编号一律等宽数字：01–13 上下对齐，切换时不左右跳 */
.index, .cs-num, .cs-card-num, .cs-next-title, .cs-eyebrow, .footer-meta { font-variant-numeric: tabular-nums; }

/* ---------- 9. 进入动画：直接打开或刷新首页时播放（2026-12 重做） ----------
   ① 屏幕正中「Hi + 称呼」：称呼由慢到快轮换（从下方糊着滚进、向上糊着滚走），最后减速停在 Seth；
   ② 右边冒出手掌，快速挥两下；③ 整句先微微放大蓄力，再缩小飞到左上角，与顶栏署名逐像素重合后换成真的署名；
   ④ 顶栏 / 底栏的文字和图标以左上角为起点，按距离由近及远依次由糊变清显出（沿离开左上角的方向滑出一点）；
   ⑤ 快显完时切到 data-intro="in"：主卡 → 相邻侧卡 → 边缘卡依次对焦（见「桌面端进入动画」），播完进入停稳的主卡状态。
   <head> 里的小脚本在首帧前给 html 加 data-intro="load"，main.js 里同名的一段负责推进；
   点击、空格、Enter 或 Esc 可以跳过。从内容页返回首页（有自己的转场）、开启「减少动态效果」时不播放。
   手机（≤540）不播放：<head> 的小脚本在手机宽度下不加 data-intro */
/* 顶栏是一直存在的：从站内进入首页（短版，data-intro-short）时它不参与显出，一直在原位；只有直接打开 / 刷新的完整版才依次显出 */
html[data-intro]:not([data-intro-short]) :is(.site-header .brand-zone, .site-header .header-nav .hn-item, .site-header .header-right > *):not(.ii-in),
html[data-intro] :is(.home-footer > *, .card-dots.is-side):not(.ii-in) {
  opacity: 0 !important;
  filter: blur(8px);
  translate: var(--ii-tx, -8px) var(--ii-ty, -6px);
  pointer-events: none;
}
html[data-intro] .ii-in {
  transition: opacity 0.9s var(--ease-out), filter 0.9s var(--ease-out), translate 1.1s var(--ease-out) !important;
  transition-delay: var(--ii-d, 0s) !important;
}
html[data-intro] .ii-in.ii-now { transition: none !important; } /* 署名：大字落定的那一帧直接换上，不再淡入 */
/* 整段进入动画里卡片都不接收鼠标：:hover 不会命中，悬停的放大、换图、反光等效果都不会提前出现 */
html[data-intro] .projects,
html[data-intro] .projects .project { pointer-events: none !important; } /* 卡片上有轮播脚本直接写的 pointer-events: auto，要连卡片一起关 */
@keyframes intro-fade { from { opacity: 0; } }

/* 编号：先藏着，对焦阶段浮现 */
html[data-intro] .projects .project > .index {
  opacity: 0;
  transform: translateY(14px);
  filter: blur(6px);
  transition: opacity 1.4s var(--ease), transform 1.4s var(--ease), filter 1.4s var(--ease);
}
html[data-intro] .projects .project.intro-on > .index { opacity: 1; transform: none; filter: blur(0); }

/* 名字那一层（main.js 生成，播完移除）：.ii-fly 负责飞向左上角（以屏幕左上角为原点缩放），
   .ii-line 按最后的「Hi Seth ✋」整句居中，位置只定一次（Hi 不随称呼移动）。字体、字重、字距与顶栏署名一致，只是字号放大 */
.intro { position: fixed; inset: 0; z-index: 30; pointer-events: none; }
.ii-fly { position: absolute; left: 0; top: 0; transform-origin: 0 0; will-change: transform; }
.ii-line {
  position: absolute;
  left: 0;
  top: 0;
  display: flex;
  align-items: center;
  white-space: nowrap;
  font-family: var(--font-display); /* 脚本会换成顶栏署名实际用的字体、字重与字距 */
  font-weight: var(--weight-strong);
  line-height: 1.2;
  color: var(--fg);
}
.ii-line:not(.is-on) { visibility: hidden; } /* 等字体到位、排好版再出现 */
.ii-hi { display: inline-block; }
/* 称呼的滚筒：.ii-win 是比一行略高的窗口，上下边缘渐隐；称呼在里面逐帧上移，运动模糊也加在窗口上 */
.ii-slot { position: relative; display: inline-block; height: 1.2em; }
.ii-win {
  position: absolute;
  left: -0.3em;
  right: -0.5em;
  top: -0.5em;
  bottom: -0.5em;
  -webkit-mask-image: linear-gradient(to bottom, transparent, #000 0.42em, #000 calc(100% - 0.42em), transparent);
  mask-image: linear-gradient(to bottom, transparent, #000 0.42em, #000 calc(100% - 0.42em), transparent);
}
.ii-w { position: absolute; left: 0.3em; top: 0.5em; color: var(--fg-muted); will-change: transform; } /* 滚动中的称呼淡一档 */
.ii-w.is-seth { color: var(--accent); transition: color 0.3s var(--ease-out); } /* Seth 一出现是网页蓝；准备缩向左上角时（.is-fly）换回 --fg，与顶栏署名同色 */
.ii-line.is-fly .ii-w.is-seth, .ii-w.is-seth.is-black { color: var(--fg); }
.ii-w.is-seth.is-black { transition: none; }
/* Seth 蓝 → 黑的过渡层（main.js sethToBlack 生成）：几条高度带叠在字上，每条带里蓝、黑两份字各自模糊 */
.ii-fx { position: absolute; display: block; pointer-events: none; } /* 位置与大小由脚本按字的尺寸设（比字大一圈，给模糊留地方） */
.ii-fx-st, .ii-fx-l { position: absolute; inset: 0; display: block; }
.ii-fx-t { position: absolute; white-space: nowrap; }
.ii-fx-blue { color: var(--accent); }
.ii-fx-black { color: var(--fg); }
.ii-defs { position: absolute; width: 0; height: 0; }
.ii-hand { position: absolute; opacity: 0; color: var(--fg); }
.ii-hand svg { display: block; width: 100%; height: 100%; transform-origin: 46% 86%; } /* 以掌根为中心挥手 */

@media (prefers-reduced-motion: reduce) {
  .reveal, .reveal.reveal-media { filter: none; }
  .projects .project-media { filter: none !important; }
  .read-rule, .rr-tick { transition: none; }
}

/* ---------- 10. 首页减负：顶栏 / 底栏的玻璃（2026-11-16） ----------
   电脑上首页不上下滚动，顶栏和底栏后面只有页面底色和卡片的弥散光；弥散光一直在律动，
   玻璃的背景模糊（顶栏 6 层、底栏 1 层，都是整屏宽）每一帧都得跟着重算。
   这时（main.js 加 html.glass-calm）去掉这两块玻璃的背景模糊，改为把玻璃那一道模糊直接算进光团自己的模糊里
   （光团各自只模糊一次、动画只动位置和透明度，不用每帧重算），看起来一样柔和。
   页面能上下滚动（手机、很矮的窗口，卡片会滑到玻璃后面）时照常用玻璃 */
html.glass-calm body.home .header-blur { display: none; }
html.glass-calm body.home .home-footer { -webkit-backdrop-filter: none; backdrop-filter: none; }
/* 两道模糊叠在一起约等于 √(a² + b²)：顶栏的光最亮处贴着顶栏下沿，那里玻璃很清楚，只补一点；底栏是整块 16px */
html.glass-calm .card-glow.is-top { --glass: 4px; }
html.glass-calm .card-glow.is-bottom { --glass: 16px; }
html.glass-calm .card-glow b {
  filter: blur(calc(var(--glow-blur) * var(--bk) + var(--glass) * 0.5));
  filter: blur(hypot(calc(var(--glow-blur) * var(--bk)), var(--glass)));
}
html.glass-calm:not([data-theme="dark"]) .card-glow b {
  filter: blur(calc(var(--glow-blur) * var(--bk) + var(--glass) * 0.5)) saturate(1.3);
  filter: blur(hypot(calc(var(--glow-blur) * var(--bk)), var(--glass))) saturate(1.3);
}

/* ---------- 11. 雪室场景（2026-11-16；前一版「雪夜」存在 git 标记 backup/snow-night-scene）：首页左下角的图标 ----------
   点图标：首页内容退远、变模糊、消失，只留图标（原来的动画）；这时画面贴着房间最里面那面发光的墙，接着摄像机往后退，
   堆着雪的房间从屏幕四边进到画面里。鼠标扫过雪面把雪推开、点一下把雪炸开；右下角的图标开关那面墙的光；
   再点左下角的图标：摄像机推回墙上，首页按原来的动画回来。
   画面由 assets/js/snow-scene.js 画在一张画布上，这里只管：两个图标、首页退远 / 回来的过渡。
   状态都写在 html 上：snow-live = 场景在场（含进出的过渡）；snow-on = 首页已退远；
   snow-night = 场景已经显出来，图标换成压在画面上的浅色（名字沿用前一版） */
/* 入口（2026-11-22 改为拨动开关）：一条细边的胶囊轨道，左端「房子」（首页）、右端「雪花」（雪室），
   一颗反色的圆钮在两端之间滑动；圆钮停在哪端，哪端的图标就是当前所在处（压在圆钮上、反色显示），另一端的图标淡着提示可去处。
   颜色全部取自色阶：轨道线 --line、圆钮 --fg、圆钮上的图标 --bg（深浅模式自动翻转）、另一端 --fg-muted；
   切换：圆钮带一点回弹滑过去（与原入口图标落下时同一条弹性曲线），雪花滑到位时顺势转过两个瓣（120°）。
   悬停：圆钮朝另一端拉长一点。进了雪室压在画面上时换成 --paper / --ink；
   房子在雪室时换成线框版（.st-home-line），在首页时是实心版 */
.snow-toggle {
  --st-w: 52px;
  --st-grow: 6px;                                          /* 悬停时圆钮朝另一端拉长的长度 */
  --st-h: 28px;
  --st-pad: 3px;
  --st-k: calc(var(--st-h) - var(--st-pad) * 2);
  --st-x: calc(var(--st-w) - var(--st-h));
  --st-pop: cubic-bezier(0.34, 1.5, 0.64, 1);
  justify-self: start;
  position: relative;
  box-sizing: border-box;
  width: var(--st-w);
  height: var(--st-h);
  margin: 0;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--fg-muted);
  cursor: var(--cur-tap);
  transition: border-color 0.3s var(--ease), background-color 0.3s var(--ease), opacity 0.5s var(--ease);
}
.snow-toggle .st-knob {
  position: absolute;
  --st-l0: calc(var(--st-pad) - 1px);                     /* 圆钮离轨道内沿的距离 */
  top: var(--st-l0);
  left: var(--st-l0);
  right: calc(var(--st-l0) + var(--st-x));
  height: var(--st-k);
  border-radius: 999px;
  background: var(--fg);
  box-shadow: 0 1px 2px rgba(0,0,0,.12), 0 2px 6px -2px rgba(0,0,0,.18);
  transition: left 0.55s var(--st-pop), right 0.55s var(--st-pop), background-color 0.3s var(--ease);
  /* 圆钮用左右两条边定位：滑动时两边一起走；悬停拉长时只动朝向另一端的那条边，另一条不动——
     以前用「变宽 + 位移」两个各自回弹的值相加，在雪室那端右沿会抖 */
}
.snow-toggle[aria-pressed="true"] .st-knob { left: calc(var(--st-l0) + var(--st-x)); right: var(--st-l0); }
.snow-toggle .st-icon {
  position: absolute;
  top: 50%;
  width: 14px;
  height: 14px;
  margin-top: -7px;
  fill: currentColor;
  overflow: visible;
  transition: color 0.3s var(--ease) 0.12s;
}
/* 两个图标各自对准圆钮停下时的中心 */
.snow-toggle .st-home { left: calc(var(--st-pad) - 1px + var(--st-k) / 2 - 7px); }
.snow-toggle .st-man { left: calc(var(--st-pad) - 1px + var(--st-x) + var(--st-k) / 2 - 7px); }
.snow-toggle[aria-pressed="false"] .st-home,
.snow-toggle[aria-pressed="true"] .st-man { color: var(--bg); }
.snow-toggle .st-home-line, .snow-toggle[aria-pressed="true"] .st-home-fill { display: none; }
.snow-toggle[aria-pressed="true"] .st-home-line { display: inline; }
.snow-toggle .st-body { transform-box: view-box; transform-origin: 50% 50%; transition: transform 0.7s var(--ease-out); }
.snow-toggle[aria-pressed="true"] .st-body { transform: rotate(120deg); transition: transform 0.8s var(--ease-out) 0.1s; }
.snow-light svg { position: relative; width: 20px; height: 20px; overflow: visible; }
.snow-light:focus-visible { outline: 1px solid currentColor; outline-offset: 0; }
.snow-toggle:focus-visible { outline: 1px solid var(--fg); outline-offset: 2px; }
@media (hover: hover) {
  /* 圆钮朝另一端拉长：在左端时往右伸，在右端时往左伸（左沿跟着左移、右沿不动） */
  .snow-toggle[aria-pressed="false"]:hover .st-knob { right: calc(var(--st-l0) + var(--st-x) - var(--st-grow)); }
  .snow-toggle[aria-pressed="true"]:hover .st-knob { left: calc(var(--st-l0) + var(--st-x) - var(--st-grow)); }
}
/* 压在雪室画面上：轨道线用很淡的浅色（和首页边框的默认状态一样不显眼），圆钮浅色、上面的图标深色；
   房子淡着（半透明，和首页时淡着的雪花一样）。悬停时只拉长圆钮，边框和未选中的图标都不变。
   开关的位置跟按钮的 aria-pressed 走（点下去立刻切换），不等场景进出的动画 */
html.snow-night .snow-toggle { border-color: color-mix(in srgb, var(--paper) 22%, transparent); color: var(--paper); }
html.snow-night .snow-toggle .st-knob { background: var(--paper); box-shadow: 0 0 6px color-mix(in srgb, var(--ink) 35%, transparent); }
html.snow-night .snow-toggle[aria-pressed="true"] .st-man,
html.snow-night .snow-toggle[aria-pressed="false"] .st-home { color: var(--ink); }
html.snow-night .snow-toggle[aria-pressed="true"] .st-home,
html.snow-night .snow-toggle[aria-pressed="false"] .st-man { opacity: 0.5; } /* 未选中的一端淡着；离开雪室时开关先切回房子，画面淡出前雪花也是淡的 */
html.snow-night .snow-toggle .st-home { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--ink) 45%, transparent)); transition: color 0.3s var(--ease) 0.12s, opacity 0.3s var(--ease) 0.12s; }
html.snow-night .snow-toggle:focus-visible { outline-color: var(--paper); }
.snow-light { color: var(--paper); opacity: 0.74; }
.snow-light svg { filter: drop-shadow(0 0 3px color-mix(in srgb, var(--ink) 45%, transparent)); }

/* 首页退远：先缩向屏幕正中（远离），紧接着变模糊，最后淡掉；回来时倒着走一遍。
   两侧的卡片先走，中间两张明显晚一拍（2026-11-16 加大了这个错开，去和回一样明显）。缩放的基点由脚本写在卡片上（--snow-ox / --snow-oy）。
   曲线：去的时候起步像有阻力、慢，中间快，快到头再慢下来；回来的时候起步慢、中间快，最后像碰到阻力一样慢慢停稳。
   下面第一条是「回来」用的过渡（回到没有 snow-on 的状态时生效）：先显出来，再边对焦边放大回原位 */
html.snow-live, html.snow-live body { overflow: hidden; }
html.snow-live body.home .projects { pointer-events: none; }
html.snow-live body.home .projects .project,
html.snow-live body.home .site-header,
html.snow-live body.home .home-footer > :not(.snow-toggle) {
  transition: transform 1.55s cubic-bezier(0.55, 0, 0.1, 1) var(--sd, 0s), filter 1.25s cubic-bezier(0.55, 0, 0.1, 1) var(--sd, 0s),
    opacity 0.8s var(--ease-in-out) var(--sd, 0s), border-right-color 0.25s ease;
}
html.snow-live body.home .projects .project { transform-origin: var(--snow-ox, 50%) var(--snow-oy, 50%); }
/* 减负：进出期间这几块各自单独成层，缩放、模糊、淡出都交给显卡合成，不用每帧重画卡片里的内容 */
html.snow-live body.home .projects .project,
html.snow-live body.home .site-header { will-change: transform, filter, opacity; }
/* 深色模式下卡片一缩放，卡片边上会亮出一条白线：封面图那一层（.img-pair）最外一圈像素，在卡片位置落到半个像素上时
   会从盖在它上面的底色渐变旁边漏出来。进出期间把这一层的左边裁掉 1px、上下各裁 2px——这三边本来就被底色渐变盖着，
   裁掉看不出变化，所以整段过程一直裁着、不需要渐进。右边原先不裁（怕接缝跳）；但 01 的图片右沿很亮，进出刚开始、底色渐变还没盖严时，它最外一列会在 01|02 的缝上亮成一条白线（第二次录屏逐帧看到），所以现在右边也裁 1px，缝上那条分隔线同时淡掉，两边一起收 */
html.snow-live body.home .projects .project .img-pair { clip-path: inset(2px 1px 2px 1px); }
/* 卡片之间那条 1px 分隔线（border-right）：卡片一缩放 / 一模糊，它就落在半个像素上，一会儿亮一会儿灭（录屏里 01|02、02|03 两条缝闪白）。
   进出期间让它先淡掉，整段都不画；首页完全回到原位、这一段撤掉时它再回来（此时已经静止，不会闪） */
html.snow-live body.home .projects .project:not(:last-child) { border-right-color: transparent; }
html.snow-live body.home .card-dots.is-side { transition: opacity 0.6s var(--ease-in-out); }
html.snow-on body.home .projects .project,
html.snow-on body.home .site-header,
html.snow-on body.home .home-footer > :not(.snow-toggle) {
  opacity: 0;
  transform: scale(0.9);
  filter: blur(12px);
  pointer-events: none;
  /* 「去」用的过渡 */
  transition: transform 1.5s cubic-bezier(0.7, 0, 0.25, 1) var(--sd, 0s), filter 1.3s cubic-bezier(0.7, 0, 0.25, 1) calc(var(--sd, 0s) + 0.12s),
    opacity 1.05s var(--ease-in-out) calc(var(--sd, 0s) + 0.3s), border-right-color 0.25s ease;
}
html.snow-on body.home .card-dots.is-side { opacity: 0; pointer-events: none; }
/* 铺满封面的卡片（尤其 01）图片四边比页面底色深：卡片一缩小，四周露出的底色比卡片边缘亮，深色模式下像一圈白光。
   所以退远时让卡片四边先化进底色（盖一层往里渐隐的底色边），和露出来的底色接上；回来时等卡片基本到位再撤掉 */
html.snow-live body.home:not(.home-carousel) .projects .project.is-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 3;
  pointer-events: none;
  box-shadow: inset 0 0 56px 26px var(--bg);
  opacity: 0;
  transition: opacity 0.5s var(--ease-in-out) calc(var(--sd, 0s) + 0.9s);
}
html.snow-on body.home:not(.home-carousel) .projects .project.is-cover::before { opacity: 1; transition: opacity 0.3s var(--ease-in-out) var(--sd, 0s); }
/* 卡片背后的弥散光：整个进出过程都收起（很快淡掉），等首页完全回到原位、这一层撤掉以后才重新亮。
   原来首页一开始回来它就亮了，而卡片这时还缩着、虚着，光就从卡片的边上和下沿露出来（深色模式下是一圈白光） */
html.snow-live .card-glow { opacity: 0 !important; transition: opacity 0.9s var(--ease-in-out) 0.1s !important; }
/* 减负：收起以后让它停下，不和场景抢每一帧的时间 */
html.snow-on .card-glow, html.snow-on .card-glow * { animation-play-state: paused !important; }
/* 底栏的玻璃让开：场景铺满整屏，图标直接压在画面上。底栏本身不再挡鼠标（雪一直堆到屏幕下沿，那里也要能扫到），只有图标能点 */
html.snow-live body.home .home-footer { background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
html.snow-on body.home .home-footer { pointer-events: none; }
html.snow-on body.home .home-footer .snow-toggle { pointer-events: auto; }

/* 个人页入场（2026-12-04）：先是左上的身份句、观点句、版权依次从下往上浮现；接着下方三栏信息；最后右边三张照片依次「由糊变清」地从下往上浮现。
   只用 animation + backwards（开始前藏着、播完就撤，不留任何样式，不和悬停 / 雪室退远的过渡打架）；每块的起点时间写在 --ab-d。
   菜单交接（从别的页用菜单进来、菜单还盖着）期间先暂停，菜单收完再开始 */
.ab-id { display: block; }
@keyframes ab-rise { from { opacity: 0; transform: translateY(var(--ab-dy, 28px)); filter: blur(var(--ab-bl, 0px)); } }
.ab-id, .ab-soft, .ab-copy, .ab-block, .ab-item {
  animation: ab-rise 1s var(--ease-out) var(--ab-d, 0s) backwards;
}
.ab-id { --ab-d: 0.1s; } .ab-soft { --ab-d: 0.25s; } .ab-copy { --ab-d: 0.4s; }
.ab-block:nth-child(1) { --ab-d: 0.8s; } .ab-block:nth-child(2) { --ab-d: 0.92s; } .ab-block:nth-child(3) { --ab-d: 1.04s; }
.ab-item { --ab-dy: 56px; --ab-bl: 14px; animation-duration: 1.2s; }
.ab-item:nth-child(1) { --ab-d: 1.3s; } .ab-item:nth-child(2) { --ab-d: 1.48s; } .ab-item:nth-child(3) { --ab-d: 1.66s; }
@media (max-width: 900px) { /* 手机：第一屏是观点句、版权、照片条，照片紧跟着出来；身份句和信息在屏幕下面 */
  .ab-item:nth-child(1) { --ab-d: 0.55s; } .ab-item:nth-child(2) { --ab-d: 0.7s; } .ab-item:nth-child(3) { --ab-d: 0.85s; }
}
html.menu-handoff .ab-id, html.menu-handoff .ab-soft, html.menu-handoff .ab-copy, html.menu-handoff .ab-block, html.menu-handoff .ab-item { animation-play-state: paused; }
@media (prefers-reduced-motion: reduce) { .ab-id, .ab-soft, .ab-copy, .ab-block, .ab-item { animation: none; } }

/* 个人页进出雪室：和首页同一套动作（四周的内容先走、中间的标题晚 0.3 秒；先缩向屏幕正中，接着变糊，最后淡掉；回来时倒着走）。
   退远的是个人页的几块内容：标题声明、照片、三栏小字，加上顶栏和底栏里除入口以外的东西。缩放的基点和错拍由脚本写在各块上（--snow-ox / --snow-oy / --sd） */
html.snow-live body.about .ab-head,
html.snow-live body.about .ab-photo,
html.snow-live body.about .ab-block,
html.snow-live body.about .site-header,
html.snow-live body.about .home-footer > :not(.snow-toggle) {
  transition: transform 1.55s cubic-bezier(0.55, 0, 0.1, 1) var(--sd, 0s), filter 1.25s cubic-bezier(0.55, 0, 0.1, 1) var(--sd, 0s),
    opacity 0.8s var(--ease-in-out) var(--sd, 0s);
  will-change: transform, filter, opacity;
}
html.snow-live body.about .ab-head, html.snow-live body.about .ab-photo, html.snow-live body.about .ab-block { transform-origin: var(--snow-ox, 50%) var(--snow-oy, 50%); }
html.snow-live body.about .ab { pointer-events: none; }
html.snow-on body.about .ab-head,
html.snow-on body.about .ab-photo,
html.snow-on body.about .ab-block,
html.snow-on body.about .site-header,
html.snow-on body.about .home-footer > :not(.snow-toggle) {
  opacity: 0;
  transform: scale(0.9);
  filter: blur(12px);
  pointer-events: none;
  transition: transform 1.5s cubic-bezier(0.7, 0, 0.25, 1) var(--sd, 0s), filter 1.3s cubic-bezier(0.7, 0, 0.25, 1) calc(var(--sd, 0s) + 0.12s),
    opacity 1.05s var(--ease-in-out) calc(var(--sd, 0s) + 0.3s);
}
/* 底栏在个人页是排在页尾的（不像首页那样一直贴着屏幕底）：进出期间把它钉在屏幕下沿，场景才能铺满整屏、入口图标才在原来的位置；
   能点到入口时底栏本来就贴着屏幕下沿，所以钉住不会跳。页面总高度用 padding 补回去，滚动位置不变 */
html.snow-live body.about { padding-bottom: var(--footer-h); }
html.snow-live body.about .ab-footer { position: fixed; left: 0; right: 0; bottom: 0; background: transparent; -webkit-backdrop-filter: none; backdrop-filter: none; }
html.snow-on body.about .ab-footer { pointer-events: none; }
html.snow-on body.about .ab-footer .snow-toggle { pointer-events: auto; }
@media (prefers-reduced-motion: reduce) {
  html.snow-live body.about .ab-head, html.snow-live body.about .ab-photo, html.snow-live body.about .ab-block,
  html.snow-live body.about .site-header, html.snow-live body.about .home-footer > :not(.snow-toggle) { transition: opacity 0.3s linear; will-change: auto; }
  html.snow-on body.about .ab-head, html.snow-on body.about .ab-photo, html.snow-on body.about .ab-block,
  html.snow-on body.about .site-header, html.snow-on body.about .home-footer > :not(.snow-toggle) { transform: none; filter: none; transition: opacity 0.3s linear; }
}

/* 场景这一层：和底栏同一层级、排在底栏前面，所以底栏里的图标在它上面 */
.snow { position: fixed; inset: 0; z-index: 14; overflow: hidden; touch-action: none; -webkit-user-select: none; user-select: none; }
.snow[hidden] { display: none; }
.snow.is-out { pointer-events: none; }
.snow.is-grab .snow-canvas { cursor: grabbing; } /* 手里抓着雪球（在滚，或者举着） */
.snow-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; opacity: 0; }
/* 灯的开关：右下角，和入口图标左右对称（位置由脚本按入口图标的位置写入）。场景显出来后才出现，退回时先收起。
   图标是 Material Symbols 的 lightbulb：关着是线条款，开着是实心款 */
.snow-light {
  position: absolute;
  right: 24px;
  top: auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  cursor: var(--cur-tap);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0s 0.4s;
}
html.snow-night .snow:not(.is-out) .snow-light { opacity: 0.74; visibility: visible; transition: opacity 0.4s var(--ease), visibility 0s; }
html.snow-night .snow:not(.is-out) .snow-light:hover,
html.snow-night .snow:not(.is-out) .snow-light:focus-visible,
html.snow-night .snow:not(.is-out) .snow-light.is-on { opacity: 1; }
.snow-light path { fill: currentColor; transition: opacity 0.25s var(--ease); }
.snow-light .sl-on { opacity: 0; }
.snow-light.is-on .sl-on { opacity: 1; }
.snow-light.is-on .sl-off { opacity: 0; }
.snow-light svg { transition: transform 0.35s var(--ease-out); }
/* 灯泡周围的光晕：开着时有一圈柔光；悬停时亮一些（关着时悬停是一点预告的微光）、灯泡略微抬起；
   打开的一瞬间光晕骤然涨开、再落回常亮的大小 */
.snow-light::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  width: 26px;
  height: 26px;
  margin: -16px 0 0 -13px; /* 圆心对着灯泡的玻璃泡，不是整个图标的正中 */
  border-radius: 50%;
  background: radial-gradient(circle, color-mix(in srgb, var(--paper) 80%, transparent) 0%, color-mix(in srgb, var(--paper) 26%, transparent) 38%, transparent 70%);
  opacity: 0;
  transform: scale(0.6);
  transition: opacity 0.35s var(--ease), transform 0.45s var(--ease-out);
  pointer-events: none;
}
.snow-light.is-on::before { opacity: 0.5; transform: scale(1.5); }
@media (hover: hover) {
  .snow-light:hover svg { transform: translateY(-1px) scale(1.06); }
  .snow-light:hover::before { opacity: 0.22; transform: scale(1.15); }
  .snow-light.is-on:hover::before { opacity: 0.72; transform: scale(1.9); }
}
.snow-light.is-burst::before { animation: snow-burst 0.9s var(--ease-out); }
@keyframes snow-burst {
  0% { opacity: 0; transform: scale(0.3); }
  14% { opacity: 1; transform: scale(3.6); }
  100% { opacity: 0.5; transform: scale(1.5); }
}
/* 长按时指针处的一圈进度：很淡，转满就抓起雪（或举起雪球）。时长由脚本写在 --ms 上 */
.snow-ring { position: absolute; width: 32px; height: 32px; margin: -16px 0 0 -16px; pointer-events: none; opacity: 0; }
.snow-ring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.snow-ring circle {
  fill: none;
  stroke: var(--paper);
  stroke-width: 1.5;
  stroke-linecap: round;
  stroke-dasharray: 81.7;
  stroke-dashoffset: 81.7;
  filter: drop-shadow(0 0 2px color-mix(in srgb, var(--ink) 40%, transparent));
}
.snow-ring.is-on { opacity: 0.5; }
.snow-ring.is-on circle { animation: snow-ring var(--ms, 300ms) linear forwards; }
@keyframes snow-ring { to { stroke-dashoffset: 0; } }
/* 初次引导「长按」（2026-11-22，snow-scene.js 的 holdUpdate）：进来一阵还没长按过，鼠标在雪面上时跟着光标——
   光标下一个圆从中心慢慢填满（和长按进度圈同样大小、同样的浅色），右边一行淡淡的「长按」，写法同图片查看器的「双击」 */
.snow-holdtip { position: absolute; left: 0; top: 0; pointer-events: none; opacity: 0; transition: opacity 0.4s var(--ease); }
.snow-holdtip.is-on { opacity: 1; }
.snow-holdtip i {
  position: absolute; left: -16px; top: -16px; width: 32px; height: 32px; border-radius: 50%;
  box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--paper) 40%, transparent), 0 0 2px color-mix(in srgb, var(--ink) 30%, transparent);
}
.snow-holdtip i::after {
  content: ""; position: absolute; inset: 0; border-radius: 50%;
  background: var(--paper); opacity: 0; transform: scale(0);
}
.snow-holdtip.is-on i::after { animation: snow-holdfill 2.2s var(--ease-out) infinite; }
@keyframes snow-holdfill {
  0% { opacity: 0.32; transform: scale(0); }
  60% { opacity: 0.32; transform: scale(1); }
  100% { opacity: 0; transform: scale(1); }
}
.snow-holdtip > span {
  position: absolute; left: 24px; top: 4px; white-space: nowrap;
  font-family: var(--font-text); font-size: var(--fs-summary); font-weight: 400; line-height: 1;
  color: var(--paper);
  text-shadow: 0 0 3px color-mix(in srgb, var(--ink) 60%, transparent), 0 0 8px color-mix(in srgb, var(--ink) 40%, transparent);
  opacity: 0.6;
}
/* 「长按」提示时的光标（2026-11-22）：Material Symbols 的 touch_long，按压点（同心弧的圆心）对准指针；
   和图片查看器的「单击」「双击」光标一样 28px、不分深浅模式，统一白底黑边（颜色同 --paper / --ink，写在图里不能用变量） */
.snow.is-holdtip, .snow.is-holdtip .snow-canvas { cursor: url("data:image/svg+xml,<svg xmlns='http://www.w3.org/2000/svg' width='28' height='28' viewBox='-1.7 -3.4 28.2 28.2'><path d='M8.58,0.76q2.34,0 3.98,1.64t1.64,3.98q0,0.77-0.2,1.49T13.44,9.22l-1.03-0.6q0.29-0.5 0.45-1.07t0.16-1.17q0-1.85-1.29-3.14T8.58,1.95T5.44,3.24T4.15,6.38q0,0.61 0.15,1.17T4.74,8.61L3.71,9.19Q3.34,8.58 3.15,7.87T2.96,6.38q0-2.34 1.64-3.98T8.58,0.76Zm0,2.43q1.32,0 2.26,0.93t0.93,2.25q0,0.46-0.11,0.85T11.32,8L10.28,7.4q0.13-0.22 0.2-0.48t0.07-0.53q0-0.82-0.59-1.41T8.560,4.38q-0.84,0-1.42,0.59T6.56,6.38q0,0.27 0.08,0.53T6.83,7.4L5.8,8Q5.59,7.630 5.49,7.23T5.39,6.38q0-1.32 0.92-2.26T8.58,3.19ZM10.82,21.5q-0.76,0-1.43-0.32T8.26,20.26l-5.09-6.6l0.37-0.39q0.37-0.4 0.9-0.48t0.98,0.2L7.85,14.3V6.38q0-0.32 0.22-0.53T8.6,5.63T9.14,5.85T9.36,6.38v4.88h7.43q1.13,0 1.92,0.79t0.79,1.92v3.77q0,1.55-1.1,2.65t-2.66,1.1H10.82Z' fill='%23f5f5f7' stroke='%231d1d1f' stroke-width='1.5' stroke-linejoin='round' paint-order='stroke'/></svg>") 10 10, auto; }
/* 触屏（没有光标）：提示固定在雪面前方正中，图标画在圆上，字在右边 */
.snow-holdtip svg { display: none; position: absolute; left: -10px; top: -10px; width: 28px; height: 28px; overflow: visible; }
.snow-holdtip.is-touch svg { display: block; }
.snow-holdtip svg path { fill: var(--paper); stroke: var(--ink); stroke-width: 1.5; stroke-linejoin: round; paint-order: stroke; }
.snow-holdtip.is-touch > span { left: 26px; top: 5px; }
@media (prefers-reduced-motion: reduce) {
  .snow-holdtip { transition: none; }
  .snow-holdtip.is-on i::after { animation: none; opacity: 0.22; transform: scale(0.6); }
}
/* 玩法说明：灯泡左边的 info 图标，悬停、聚焦或点一下，上方出现几行很短的说明 */
.snow-info {
  position: absolute;
  right: 58px;
  top: auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--paper);
  cursor: default; /* 悬停不换鼠标的样子 */
  visibility: hidden;
  transition: visibility 0s 0.4s;
}
/* 淡入淡出只做在图标上：按钮自己不能带半透明，否则里面的磨砂面板 / 气泡（backdrop-filter）会取不到背景，刚出现时磨砂是空的 */
.snow-info > svg { opacity: 0; position: relative; width: 20px; height: 20px; fill: currentColor; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--ink) 45%, transparent)); transition: opacity 0.4s var(--ease), transform 0.35s var(--ease-out); }
.snow-info:focus-visible { outline: 1px solid currentColor; outline-offset: 0; }
html.snow-night .snow:not(.is-out) .snow-info { visibility: visible; transition: visibility 0s; }
html.snow-night .snow:not(.is-out) .snow-info > svg { opacity: 0.74; }
html.snow-night .snow:not(.is-out) .snow-info:hover > svg,
html.snow-night .snow:not(.is-out) .snow-info:focus-visible > svg,
html.snow-night .snow:not(.is-out) .snow-info.is-open > svg { opacity: 1; }
/* 说明面板：和网站别处一样的写法——一条细线起头，「// 标题」小字，每行是编号（标题字体）+ 大写小标签 + 一句话；
   底是一层很淡的磨砂（和顶栏、底栏的玻璃同一个路数），没有圆角和描边。打开时细线从左画到右，各行依次浮现 */
.snow-tips {
  position: absolute;
  right: -34px;
  bottom: calc(100% + 14px);
  display: grid;
  gap: 9px;
  padding: 14px 18px 16px 16px;
  background: color-mix(in srgb, var(--ink) 34%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: var(--paper);
  font-family: var(--font-text);
  font-size: 11px;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
  cursor: default;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.3s var(--ease), visibility 0s 0.3s;
}
.snow-tips::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: color-mix(in srgb, var(--paper) 55%, transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.85s var(--ease-in-out); /* 起步慢一点（2026-11-17），整体也略慢 */
}
.snow-tips .st-head { margin-bottom: 3px; font-size: 10px; letter-spacing: 0.5px; opacity: 0.6; }
.snow-tips .st-adv { margin-top: 8px; padding-top: 13px; border-top: 1px solid color-mix(in srgb, var(--paper) 22%, transparent); margin-bottom: 0; } /* 进阶操作（08、09）：隔一道细线，自己一个小标题 */
.snow-tips .st-row {
  display: grid;
  grid-template-columns: 20px 24.8em 1fr;
  align-items: baseline;
  gap: 10px;
  opacity: 0;
  transform: translateY(5px);
  transition: opacity 0.4s var(--ease), transform 0.5s var(--ease-out);
}
:root[lang="zh-CN"] .snow-tips .st-row { grid-template-columns: 20px 17em 1fr; }
.snow-tips i { font-family: var(--font-display); font-style: normal; font-size: 10px; font-variant-numeric: tabular-nums; letter-spacing: -0.02em; opacity: 0.5; }
.snow-tips b { font-size: var(--fs-label); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.72; }
:root[lang="zh-CN"] .snow-tips b { font-size: 10px; letter-spacing: 0.08em; }
@media (hover: none) { .snow-tips .st-row.is-keys, .snow-tips .st-adv { display: none; } } /* 触屏没有键盘这一条 */
.snow-info:is(.is-open, :focus-visible) .snow-tips { opacity: 1; visibility: visible; transition: opacity 0.3s var(--ease), visibility 0s; }
.snow-info:is(.is-open, :focus-visible) .snow-tips::before { transform: none; }
.snow-info:is(.is-open, :focus-visible) .st-row { opacity: 1; transform: none; }
@media (hover: hover) {
  .snow-info:hover > svg { transform: translateY(-1px) scale(1.06); }
  .snow-info:hover .snow-tips { opacity: 1; visibility: visible; transition: opacity 0.3s var(--ease), visibility 0s; }
  .snow-info:hover .snow-tips::before { transform: none; }
  .snow-info:hover .st-row { opacity: 1; transform: none; }
}
.snow-tips .st-row:nth-child(3) { transition-delay: 0.04s; }
.snow-tips .st-row:nth-child(4) { transition-delay: 0.08s; }
.snow-tips .st-row:nth-child(5) { transition-delay: 0.12s; }
.snow-tips .st-row:nth-child(6) { transition-delay: 0.16s; }
.snow-tips .st-row:nth-child(7) { transition-delay: 0.20s; }
.snow-tips .st-row:nth-child(8) { transition-delay: 0.24s; }
.snow-tips .st-row:nth-child(9) { transition-delay: 0.28s; }
.snow-tips .st-row:nth-child(10) { transition-delay: 0.32s; }
.snow-tips .st-row:nth-child(11) { transition-delay: 0.36s; }
/* 做过的那几条（2026-11-22）：变淡，编号换成一个细线勾 */
.snow-info:is(.is-open, :focus-visible) .st-row.is-done { opacity: 0.5; }
@media (hover: hover) { .snow-info:hover .st-row.is-done { opacity: 0.5; } }
.snow-tips .st-row.is-done i { position: relative; color: transparent; }
.snow-tips .st-row.is-done i::after {
  content: ""; position: absolute; left: 1px; top: 50%; width: 7px; height: 3.5px;
  border-left: 1px solid var(--paper); border-bottom: 1px solid var(--paper);
  transform: translateY(-75%) rotate(-45deg);
}
/* 右下角按钮的小标签（2026-11-25，11-26 改成气泡）：悬停（或键盘聚焦）时，从按钮上方浮出一个小气泡说明它是干什么的；
   磨砂底、圆角，正下方一个倒三角指着图标；出现时从下往上渐显，移开立刻收起。
   info 图标自己的那个（.snow-howto）是初次引导：进来玩了一阵还没试过几种玩法时自己浮出来、不等悬停，悬停 / 打开说明后收起，不再出现 */
.snow-tip {
  --tip-bg: color-mix(in srgb, var(--ink) 34%, transparent); /* 浅色模式：和 info 玩法面板的底一致 */
  position: absolute; left: 50%; bottom: calc(100% + 11px);
  padding: 7px 11px;
  border-radius: 8px;
  background: var(--tip-bg);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  color: var(--paper); white-space: nowrap; pointer-events: none;
  font-family: var(--font-text); font-size: var(--fs-label); font-weight: 500; line-height: 1;
  letter-spacing: 0.14em; text-transform: uppercase; text-align: center;
  opacity: 0; visibility: hidden;
  transform: translate(-50%, 8px);
  transition: opacity 0.2s var(--ease), transform 0.25s var(--ease), visibility 0s 0.25s;
}
:root[lang="zh-CN"] .snow-tip { font-size: 10px; letter-spacing: 0.08em; }
/* 深色模式：和玩法面板一样的底在深色背景下看不见，所以多叠 12% 的 --paper，字带一点暗影 */
:root[data-theme="dark"] .snow-tip {
  --tip-bg: color-mix(in srgb, var(--paper) 12%, color-mix(in srgb, var(--ink) 34%, transparent));
  text-shadow: 0 0 6px color-mix(in srgb, var(--ink) 45%, transparent);
}
.snow-tip::after { /* 正下方的倒三角 */
  content: ""; position: absolute; left: 50%; top: 100%; width: 12px; height: 6px; margin-left: -6px;
  background: var(--tip-bg);
  -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
  clip-path: polygon(0 0, 100% 0, 50% 100%);
}
/* 浮出：一悬停就开始，整个气泡从下往上渐显 */
.snow-light:focus-visible > .snow-tip, .snow-reset:focus-visible > .snow-tip, .snow-share-btn:focus-visible ~ .snow-tip,
.snow-info.has-howto > .snow-howto {
  opacity: 1; visibility: visible; transform: translate(-50%, 0);
  transition: opacity 0.3s var(--ease), transform 0.4s var(--ease-out), visibility 0s;
}
@media (hover: hover) {
  .snow-light:hover > .snow-tip, .snow-reset:hover > .snow-tip, .snow-share-btn:hover ~ .snow-tip {
    opacity: 1; visibility: visible; transform: translate(-50%, 0);
    transition: opacity 0.3s var(--ease), transform 0.4s var(--ease-out), visibility 0s;
  }
}
.snow-share.is-open > .snow-tip { display: none; } /* 分享面板开着时不再出标签 */
.snow-info:is(.is-open, :focus-visible, .is-hush) > .snow-howto { opacity: 0; visibility: hidden; transition: opacity 0.15s, visibility 0s 0.15s; }
.snow-light .t-lit { display: none; }
.snow-light.is-on .t-lit { display: inline; }
.snow-light.is-on .t-dark { display: none; }
/* info 图标：平时是线框款，引导气泡出现时换实心款 */
.snow-info > svg .si-fill { display: none; }
.snow-info.has-howto > svg .si-fill { display: inline; }
.snow-info.has-howto > svg .si-line { display: none; }
@media (prefers-reduced-motion: reduce) {
  .snow-tip { transform: translate(-50%, 0); transition: opacity 0.2s, visibility 0s !important; }
}
/* ---------- 雪室：分享（2026-11-17）----------
   右下角 info 左边的分享图标。点它：选一个雪球或雪人（指着的那一组亮起冰蓝光）→ 起名 → 生成链接（复制、打开）。
   面板和玩法说明同一个写法：一条细线起头、「// 分享」小字、磨砂底、没有圆角和描边 */
.snow-share {
  position: absolute;
  right: 92px;
  top: auto;
  width: 38px;
  height: 32px;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0s 0.4s;
}
html.snow-night .snow:not(.is-out) .snow-share { opacity: 1; visibility: visible; transition: opacity 0.4s var(--ease), visibility 0s; }
.snow-share-btn {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  background: none;
  color: var(--paper);
  cursor: var(--cur-tap);
  opacity: 0.74;
  transition: opacity 0.3s var(--ease);
}
.snow-share-btn svg { width: 20px; height: 20px; overflow: visible; fill: currentColor; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--ink) 45%, transparent)); }
.snow-share-btn .sh-box { transform-origin: 12px 15px; transition: transform 0.4s var(--ease-out); }
.snow-share-btn .sh-arrow { transition: transform 0.45s var(--ease-out); }
.snow-share-btn:active .sh-box { transform: scale(0.94); }
.snow-share-btn:hover, .snow-share-btn:focus-visible, .snow-share.is-open .snow-share-btn { opacity: 1; }
@media (hover: hover) {
  .snow-share-btn:hover .sh-arrow { transform: translateY(-2.2px); } /* 悬停：箭头从盒子里往上探出一点 */
}
.snow-share.is-open .sh-arrow { transform: translateY(-1.4px); }
/* 点击：箭头飞出去，再从盒子底下升回来 */
.snow-share-btn.is-go .sh-arrow { animation: sh-fly 0.7s var(--ease-in-out); }
@keyframes sh-fly {
  0% { transform: translateY(0); opacity: 1; }
  42% { transform: translateY(-11px); opacity: 0; }
  43% { transform: translateY(9px); opacity: 0; }
  100% { transform: translateY(0); opacity: 1; }
}
.snow-share-btn:focus-visible { outline: 1px solid currentColor; outline-offset: 0; }
/* 选雪人时：鼠标是手指，提示是在「挑」 */
.snow.is-sharing .snow-canvas { cursor: var(--cur-tap); }
.snow-share-panel {
  position: absolute;
  right: -68px; /* 右沿和灯泡对齐，和玩法说明一样 */
  bottom: calc(100% + 14px);
  display: grid;
  gap: 12px;
  width: 300px;
  padding: 14px 18px 16px 16px;
  background: color-mix(in srgb, var(--ink) 34%, transparent);
  -webkit-backdrop-filter: blur(16px);
  backdrop-filter: blur(16px);
  color: var(--paper);
  font-family: var(--font-text);
  font-size: 12px;
  line-height: 1.45;
  text-align: left;
  opacity: 0;
  visibility: hidden;
  transform: translateY(6px);
  transition: opacity 0.3s var(--ease), transform 0.45s var(--ease-out), visibility 0s 0.3s;
}
.snow-share.is-open .snow-share-panel { opacity: 1; visibility: visible; transform: none; transition: opacity 0.3s var(--ease), transform 0.45s var(--ease-out), visibility 0s; }
.snow-share-panel::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 1px;
  background: color-mix(in srgb, var(--paper) 55%, transparent);
  transform: scaleX(0);
  transform-origin: left;
  transition: transform 0.85s var(--ease-in-out);
}
.snow-share.is-open .snow-share-panel::before { transform: none; }
.snow-share-panel .ss-head { font-size: 10px; letter-spacing: 0.5px; opacity: 0.6; }
.snow-share-panel p { margin: 0; opacity: 0.85; }
.snow-share-panel :is(.ss-pick, .ss-none, .ss-form, .ss-done) { display: none; }
.snow-share-panel.is-pick .ss-pick, .snow-share-panel.is-none .ss-none { display: block; }
.snow-share-panel.is-form .ss-form, .snow-share-panel.is-done .ss-done { display: grid; }
.snow-share-panel .ss-form { gap: 14px; }
.snow-share-panel label { display: grid; gap: 6px; }
.snow-share-panel b { font-size: var(--fs-label); font-weight: 500; letter-spacing: 0.14em; text-transform: uppercase; opacity: 0.72; }
:root[lang="zh-CN"] .snow-share-panel b { font-size: 10px; letter-spacing: 0.08em; }
.snow-share-panel input {
  width: 100%;
  padding: 4px 0 6px;
  border: 0;
  border-bottom: 1px solid color-mix(in srgb, var(--paper) 40%, transparent);
  border-radius: 0;
  background: none;
  color: var(--paper);
  font: inherit;
  font-size: 15px;
  outline: none;
  transition: border-color 0.3s var(--ease);
}
.snow-share-panel input:focus { border-bottom-color: var(--paper); }
.snow-share-panel .ss-url { font-size: 11px; opacity: 0.85; text-overflow: ellipsis; }
.snow-share-panel .ss-done { gap: 12px; }
.snow-share-panel .ss-acts { display: flex; justify-content: space-between; align-items: center; }
/* 按钮：大写小字 + 箭头，和首页卡片的「查看项目」一个路数 */
.snow-share-panel :is(.ss-go, .ss-copy, .ss-open, .ss-close) {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  justify-self: start;
  padding: 2px 0;
  border: 0;
  background: none;
  color: var(--paper);
  font: inherit;
  font-size: var(--fs-cta);
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: var(--cur-tap);
  opacity: 0.85;
  transition: opacity 0.3s var(--ease);
}
.snow-share-panel :is(.ss-go, .ss-copy, .ss-open, .ss-close):hover,
.snow-share-panel :is(.ss-go, .ss-copy, .ss-open, .ss-close):focus-visible { opacity: 1; }
.snow-share-panel :is(.ss-go, .ss-copy, .ss-open, .ss-close):focus-visible { outline: 1px solid currentColor; outline-offset: 2px; }
.snow-share-panel i { font-style: normal; transition: transform 0.35s var(--ease-out); }
.snow-share-panel .ss-go i { display: inline-flex; vertical-align: middle; }
.snow-share-panel .ss-go i svg { display: block; width: 1.25em; height: 1.25em; }
.snow-share-panel :is(.ss-go, .ss-open):hover i { transform: translateX(3px); }
.snow-share-panel .ss-close { justify-self: start; opacity: 0.55; }
.snow-share-panel .ss-copy-b { display: none; }
.snow-share-panel.is-copied .ss-copy-a { display: none; }
.snow-share-panel.is-copied .ss-copy-b { display: inline; }
@media (max-width: 540px) { .snow-share-panel { width: min(300px, calc(100vw - 32px)); } }
/* ---------- 雪室：重置（2026-11-17）----------
   右下角、分享图标左边。点一下：雪面从最低处整体涌起、涨到最高处，再落回刚进来时的样子 */
.snow-reset {
  position: absolute;
  right: 126px;
  top: auto;
  display: grid;
  place-items: center;
  width: 38px;
  height: 32px;
  padding: 0;
  border: 0;
  background: none;
  color: var(--paper);
  cursor: var(--cur-tap);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.4s var(--ease), visibility 0s 0.4s;
}
.snow-reset svg { width: 20px; height: 20px; fill: currentColor; filter: drop-shadow(0 0 3px color-mix(in srgb, var(--ink) 45%, transparent)); transition: transform 0.5s var(--ease-out); }
html.snow-night .snow:not(.is-out) .snow-reset { opacity: 0.74; visibility: visible; transition: opacity 0.4s var(--ease), visibility 0s; }
html.snow-night .snow:not(.is-out) .snow-reset:hover,
html.snow-night .snow:not(.is-out) .snow-reset:focus-visible { opacity: 1; }
.snow-reset:focus-visible { outline: 1px solid currentColor; outline-offset: 0; }
@media (hover: hover) {
  .snow-reset:hover svg { transform: rotate(70deg); } /* 悬停：箭头顺着转一小段，移开时转回 */
}
.snow-reset.is-go svg { animation: snow-reset-spin 1.1s var(--ease-in-out); } /* 点击：整圈转一周 */
@keyframes snow-reset-spin { from { transform: rotate(0deg); } to { transform: rotate(360deg); } }
@media (prefers-reduced-motion: reduce) {
  .snow-reset, .snow-reset svg, .snow-share-btn .sh-box, .snow-share-btn .sh-arrow { transition: none; }
  .snow-reset.is-go svg, .snow-share-btn.is-go .sh-arrow { animation: none; }
}
@media (prefers-reduced-motion: reduce) {
  .snow-info, .snow-info > svg, .snow-tips, .snow-tips::before, .snow-tips .st-row { transition: none; }
  .snow-ring.is-on circle { animation-duration: 1ms; }
  html.snow-live body.home .projects .project,
  html.snow-live body.home .site-header,
  html.snow-live body.home .home-footer > :not(.snow-toggle) { transition: opacity 0.3s ease !important; }
  html.snow-on body.home .projects .project,
  html.snow-on body.home .site-header,
  html.snow-on body.home .home-footer > :not(.snow-toggle) { transform: none; filter: none; }
  .snow-toggle .st-knob, .snow-toggle .st-icon, .snow-toggle .st-body, .snow-light, .snow-light path, .snow-light svg, .snow-light::before { transition: none; }
  .snow-share, .snow-share-panel, .snow-share-panel::before, .snow-share-panel > * { transition: none !important; }
  .snow-light.is-burst::before { animation: none; }
  .snow-light:hover svg { transform: none; }
}

/* ---------- 分享页 share.html（2026-11-17）----------
   雪室里分享出来的雪人：左边是可以拖动旋转、缩放的三维画面，右边是名字、几个雪球、日期、复制链接 / 下载卡片图，
   最下面是回作品集的入口（和内容页页尾「上一个 / 下一个」同一个写法：小字标签 → 带短横线的大字 → 一行小字）。
   排版沿用内页的四栏和细线；颜色全用色阶，深浅模式自动跟着变 */
.share-card {
  grid-column: 1 / -1;
  grid-row: 2 / -1;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  margin-top: 24px;
  border-top: 1px solid var(--line);
}
.share-stage {
  grid-column: 1 / 3;
  position: relative;
  min-height: clamp(420px, calc(100svh - var(--header-h) - 110px), 900px);
  border-right: 1px solid var(--line);
}
.share-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  cursor: grab;
  touch-action: none;
  outline: none;
  opacity: 0;
  transition: opacity 0.9s var(--ease);
}
.share-card.is-ready .share-canvas { opacity: 1; }
.share-card.is-grab .share-canvas { cursor: grabbing; }
.share-canvas:focus-visible { outline: 1px solid var(--gray-4); outline-offset: -8px; }
.share-tip { position: absolute; left: var(--gutter); bottom: 22px; margin: 0; color: var(--gray-5); letter-spacing: 0.08em; pointer-events: none; }
.share-fallback { position: absolute; inset: 0; display: grid; place-items: center; margin: 0; padding: var(--gutter); color: var(--gray-4); font-size: var(--fs-body); text-align: center; }
.share-fallback[hidden] { display: none; }
.share-card.no-gl .share-tip { display: none; }
.share-info {
  grid-column: 3 / -1;
  display: flex;
  flex-direction: column;
  gap: 28px;
  min-width: 0;
  padding: clamp(32px, 7vh, 88px) var(--gutter) 0;
}
.share-kicker { margin: 0; }
.share-name {
  margin: 0;
  font-size: clamp(44px, 5.6vw, 104px);
  line-height: 0.98;
  overflow-wrap: anywhere;
}
.share-meta { display: flex; gap: clamp(32px, 4vw, 64px); margin: 0; }
.share-meta div { display: grid; gap: 10px; }
.share-meta dd { margin: 0; font-size: var(--fs-num); line-height: 1; font-variant-numeric: tabular-nums; }
.share-note { max-width: 34em; margin: 0; color: var(--gray-4); font-size: var(--fs-summary); line-height: 1.7; }
.share-actions { display: flex; flex-wrap: wrap; gap: 12px 32px; }
.share-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 0 0 6px;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: none;
  color: var(--fg);
  font: inherit;
  font-size: var(--fs-cta);
  letter-spacing: 1px;
  text-transform: uppercase;
  cursor: var(--cur-tap);
  transition: border-color 0.3s var(--ease);
}
.share-btn:hover, .share-btn:focus-visible { border-bottom-color: var(--fg); }
.share-btn:focus-visible { outline: 1px solid var(--gray-4); outline-offset: 4px; }
.share-btn[hidden] { display: none; }
.share-btn i { font-style: normal; transition: transform 0.35s var(--ease-out); }
.share-btn:hover i { transform: translateY(2px); }
.share-btn .sb-b { display: none; }
.share-btn.is-done .sb-a { display: none; }
.share-btn.is-done .sb-b { display: inline; }
.share-visit {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin: auto calc(var(--gutter) * -1) 0;
  padding: 28px var(--gutter) clamp(32px, 4vw, 56px);
  border-top: 1px solid var(--line);
  transition: background-color 0.4s var(--ease), color 0.4s var(--ease);
}
.share-visit-title { display: flex; align-items: center; justify-content: space-between; font-size: clamp(40px, 4.4vw, 72px); line-height: 1; }
.share-visit-title .index { font-size: inherit; gap: clamp(16px, 2vw, 32px); }
.share-visit:hover .index::before, .share-visit:focus-visible .index::before { width: clamp(40px, 4vw, 72px); }
.share-visit-arrow { font-size: 0.5em; transition: transform 0.4s var(--ease-out); }
.share-visit:hover .share-visit-arrow { transform: translate(4px, -4px); }
.share-visit-name { color: var(--gray-4); font-size: clamp(15px, 1.2vw, 19px); }
.share-visit:focus-visible { outline: 1px solid var(--gray-4); outline-offset: -4px; }
/* 链接坏了：只留一段说明和回首页 */
.share-broken { grid-column: 1 / -1; margin: 0; padding: 48px var(--gutter); color: var(--gray-4); font-size: var(--fs-body); }
.share-broken[hidden] { display: none; }
.share-card.is-broken .share-stage, .share-card.is-broken .share-info { display: none; }
@media (max-width: 900px) {
  .share-card { grid-template-columns: 1fr; }
  .share-stage { grid-column: 1; min-height: min(62svh, 560px); border-right: 0; border-bottom: 1px solid var(--line); }
  .share-info { grid-column: 1; padding-top: 36px; }
  .share-visit { margin-top: 24px; }
}
@media (prefers-reduced-motion: reduce) {
  .share-canvas, .share-btn i, .share-visit-arrow, .share-visit { transition: none; }
}

/* ---------- 13. 移动端章节导航（2026-11-17） ----------
   内容页（≤900，单栏、没有左栏章节索引时）屏幕下方居中的一条深色胶囊，里面一排小刻度，每个章节一道。
   平时只有当前章节那一道略高、略亮；按住 / 轻点胶囊展开：刻度之间拉开，手指（鼠标）附近的刻度按远近放大变亮
   （像 Dock 的鱼眼），正对的那一道先变成一块浅色圆角块，停留片刻后展开成白色标签，写着「编号 章节名」（文字由模糊变清晰）；
   在刻度上滑动，块跟着移动，松手就跳到那一章；收起时一切回到小刻度。半透明磨砂玻璃（背景模糊），颜色取页面语义色（--bg / --fg），深浅模式自动相反：深色模式深色玻璃配浅色刻度，浅色模式浅色玻璃配深色刻度。
   每一道刻度和标签的尺寸、亮度由 main.js 写成 --w / --h / --o / --r，这里只负责过渡。DOM 由 main.js 生成 */
.cs-dock { display: none; }
@media (max-width: 900px) {
  .case-page .cs-dock {
    display: flex;
    position: fixed;
    left: 0; right: 0;
    bottom: calc(14px + env(safe-area-inset-bottom, 0px));
    z-index: 13; /* 低于菜单（15）与顶栏（20） */
    justify-content: center;
    pointer-events: none;
    opacity: 0;
    transform: translateY(14px);
    transition: opacity 0.4s var(--ease), transform 0.6s var(--ease-out);
  }
  .case-page .cs-dock.is-on { opacity: 1; transform: none; }
  .menu-open .cs-dock, html[data-enter]:not(.enter-full) .cs-dock { opacity: 0 !important; pointer-events: none !important; }
}
.cs-dock-pill {
  --gap: 8px;
  display: flex;
  align-items: center;
  gap: var(--gap);
  height: 44px;
  padding: 0 18px;
  max-width: calc(100vw - 24px);
  border-radius: 999px;
  /* 半透明 + 背景模糊（磨砂玻璃）；颜色全取页面的语义色，深浅模式自动相反：
     深色模式是深色玻璃、浅色刻度、浅色标签块；浅色模式是浅色玻璃、深色刻度、深色标签块 */
  background: color-mix(in srgb, var(--bg) 58%, transparent);
  -webkit-backdrop-filter: blur(4px) saturate(130%);
  backdrop-filter: blur(4px) saturate(130%);
  /* 一圈极淡的边托出轮廓，再叠柔和的两层阴影：近处淡而小、远处大而虚 */
  box-shadow:
    inset 0 0 0 1px color-mix(in srgb, var(--fg) 10%, transparent),
    0 2px 8px rgba(var(--shadow), 0.10),
    0 14px 34px -10px rgba(var(--shadow), 0.30);
  pointer-events: auto;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  -webkit-touch-callout: none;
  transition: gap 0.5s var(--ease-out);
}
.cs-dock.is-open .cs-dock-pill { --gap: var(--gap-open, 15px); }
.cs-dock-item {
  position: relative;
  flex: none;
  display: block;
  width: var(--w, 3px);
  height: 44px;
  -webkit-tap-highlight-color: transparent;
  -webkit-user-drag: none; user-drag: none;
  touch-action: none;
  transition: width 0.56s var(--ease-out); /* 离开的那块缩得慢一点：手指划过时新旧两块同时在场（录屏里就是这样） */
}
.cs-dock-item.is-sel { transition-duration: 0.36s; }
.cs-dock:not(.is-open) .cs-dock-item { pointer-events: none; } /* 收起时整条胶囊只当一个按钮：轻点展开，不直接跳转 */
.cs-dock-item:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; border-radius: 8px; }
.cs-dock-dot {
  position: absolute;
  left: 0; right: 0;
  top: 50%;
  height: var(--h, 13px);
  transform: translateY(-50%);
  border-radius: var(--r, 2.5px);
  font-style: normal; /* i 元素默认斜体，标签会跟着歪 */
  background: var(--fg);
  opacity: var(--o, 0.24);
  overflow: hidden;
  transition: height 0.5s var(--ease-out), opacity 0.4s var(--ease), border-radius 0.5s var(--ease-out);
}
.cs-dock-item.is-sel .cs-dock-dot { transition-duration: 0.32s, 0.3s, 0.32s; }
.cs-dock-label {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  font-family: var(--font-text);
  font-size: 12px;
  font-weight: 500; /* Switzer 只有 400 / 500 / 700 三档：写 600 会落到粗体，小字号下发圆 */
  line-height: 1;
  letter-spacing: 0.04em;
  -webkit-font-smoothing: antialiased;
  white-space: nowrap;
  font-variant-numeric: tabular-nums;
  color: var(--bg);
  opacity: 0;
  filter: blur(4px);
  transition: opacity 0.14s ease, filter 0.14s ease;
}
.cs-dock-item.is-label .cs-dock-label { opacity: 1; filter: none; transition: opacity 0.26s ease 0.06s, filter 0.3s ease 0.06s; }
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .cs-dock-pill { background: var(--bg); } /* 不支持背景模糊：退回不透明底色 */
}
@media (prefers-reduced-motion: reduce) {
  .cs-dock, .cs-dock-pill, .cs-dock-item, .cs-dock-dot, .cs-dock-label { transition: none !important; }
  .cs-dock-label { filter: none; }
}

/* 拖拽选择后松手的平滑滚动（main.js 的 __glideTo）期间暂停页面的 scroll-snap，免得吸附和逐帧滚动打架 */
html.is-gliding, html.is-gliding.home-snap { scroll-snap-type: none !important; }

/* ---------- 15. 菜单里的项目入口（2026-11-20） ----------
   展开菜单后，鼠标悬停（或键盘聚焦）在「首页 / Index」上时，它上方从下往上依次探出四个项目的入口：
   左边一个小编号 P01–P04（同菜单的 00 / 01 编号），右边项目名（菜单的字体和字重，小一号）；悬停变亮、下划线从左往右展开，
   点击同菜单其他项：闪一下特殊蓝再跳转。只在有鼠标的宽屏上出现（窄屏菜单是竖排，不做）。DOM 由 main.js 生成 */
.menu .menu-sub { display: none; } /* 要写到 .menu .menu-sub：项目入口也是 ul，会被 .menu ul 的 display: grid 盖掉，窄屏上就露出来了 */
@media (hover: hover) and (min-width: 901px) {
  .menu li.has-sub { position: relative; }
  .menu .menu-sub {
    display: grid;
    grid-template-columns: max-content; /* 盖掉 .menu ul 的四列：项目入口竖着一行一个 */
    grid-column: auto;
    gap: 14px;
    position: absolute;
    left: var(--gutter);
    right: var(--gutter);
    bottom: 100%;
    padding-bottom: 36px; /* 和 Index 之间的距离；也是鼠标从 Index 往上移时不会断开悬停的一段 */
    pointer-events: none;
  }
  .menu .menu-sub li { padding: 0; }
  .menu .menu-sub a {
    display: flex;
    align-items: baseline;
    gap: 16px;
    font-size: clamp(18px, 1.7vw, 26px);
    line-height: 1.15;
    letter-spacing: -0.01em;
    white-space: nowrap;
    opacity: 0;
    translate: 0 14px;
    transition: opacity 0.3s var(--ease), translate 0.45s var(--ease-out), color 0.3s;
    transition-delay: 0s;
  }
  .menu .menu-sub small { margin: 0; flex: none; width: 3.2em; font-weight: 400; } /* 编号写在链接里会继承链接的粗体，改回和 00 / 01 一样的常规字重；字号、字体本来就同为 --fs-menu-index、Switzer */
  .menu li.has-sub:hover .menu-sub, .menu li.has-sub:focus-within .menu-sub { pointer-events: auto; }
  .menu li.has-sub:hover .menu-sub a, .menu li.has-sub:focus-within .menu-sub a {
    opacity: 1;
    translate: 0 0;
    transition-delay: calc(var(--i) * 45ms);
  }
  .menu .menu-sub a:hover, .menu .menu-sub a:focus-visible { color: var(--inv-fg); }
  .menu .menu-sub a[aria-current="page"] { color: var(--inv-fg); }
  .menu .menu-sub a[aria-current="page"] > span { background-size: 100% 0.05em; } /* 当前项目：高亮之外常显下划线（同悬停时的下划线） */
  /* 在项目内容页里（li.is-here）：项目入口常显。打开菜单时，Index / About 随菜单的幕布先出现，
     幕布快拉完（约 0.55 秒）后项目入口再从下往上依次探出（离 Index 最近的 P04 先出来）；收起菜单时直接淡出 */
  .menu-open .menu li.has-sub.is-here .menu-sub { pointer-events: auto; }
  .menu-open .menu li.has-sub.is-here .menu-sub a {
    opacity: 1;
    translate: 0 0;
    transition: opacity 0.4s var(--ease), translate 0.6s var(--ease-out), color 0.3s;
    transition-delay: calc(0.55s + var(--i) * 70ms), calc(0.55s + var(--i) * 70ms), 0s;
  }
  /* 悬停 Index 时已经显示着，不再重播延迟 */
  .menu-open .menu li.has-sub.is-here:hover .menu-sub a { transition-delay: 0s; }
  /* 菜单交接（新页面先以展开的菜单出现再收起）：和上一页的菜单一致，直接显示，不播动画 */
  .menu-handoff .menu li.has-sub.is-here .menu-sub a { opacity: 1; translate: 0 0; transition: none; }
}
/* 窄屏 / 触屏（没有悬停，或宽度 ≤900 菜单是竖排）：项目入口常显在「首页」上方，一行一个、比主选项小；
   编号在右侧（同手机菜单的 00 / 01）。打开菜单时主选项随幕布先出现，约 0.55 秒后项目入口从下往上依次探出；
   当前所在的项目高亮并常显下划线 */
@media (max-width: 900px), (hover: none) {
  .menu li.has-sub { flex-wrap: wrap; }
  .menu .menu-sub {
    display: block;
    flex: 0 0 100%;
    margin: 0 0 18px;
    padding: 0;
  }
  .menu .menu-sub li { display: block; margin: 0; padding: 0; }
  .menu .menu-sub li::after { display: none; }
  .menu .menu-sub a {
    display: flex;
    align-items: baseline;
    justify-content: space-between;
    gap: 16px;
    padding: 7px 0;
    font-size: 22px;
    line-height: 1.2;
    letter-spacing: -0.01em;
    opacity: 0;
    translate: 0 12px;
    transition: opacity 0.25s var(--ease), translate 0.3s var(--ease), color 0.3s;
  }
  .menu .menu-sub small { order: 2; margin: 0; font-family: var(--font-switzer); font-weight: 400; font-size: 12px; letter-spacing: 0.08em; }
  .menu-open .menu .menu-sub a, .menu-handoff .menu .menu-sub a {
    opacity: 1;
    translate: 0 0;
    transition: opacity 0.4s var(--ease), translate 0.6s var(--ease-out), color 0.3s;
    transition-delay: calc(0.55s + var(--i) * 70ms), calc(0.55s + var(--i) * 70ms), 0s;
  }
  .menu-handoff .menu .menu-sub a { transition: none; }
  .menu .menu-sub a[aria-current="page"] { color: var(--inv-fg); }
  .menu .menu-sub a[aria-current="page"] > span { background-size: 100% 0.05em; }
}
/* 菜单收起、跳页后的菜单交接时：项目入口原本显示着的，保持显示到幕布收完，不提前消失、也不重播出现动画。
   · menu-sub-keep：上一页点菜单项跳过来时项目入口是显示着的（main.js）
   · menu-closing + is-here / 窄屏：在项目页里（或窄屏上）收起菜单 */
@media (hover: hover) and (min-width: 901px) {
  .menu-sub-keep .menu li.has-sub .menu-sub a,
  .menu-closing .menu li.has-sub.is-here .menu-sub a { opacity: 1; translate: 0 0; transition: none; }
}
@media (max-width: 900px), (hover: none) {
  .menu-sub-keep .menu .menu-sub a,
  .menu-closing .menu .menu-sub a { opacity: 1; translate: 0 0; transition: none; }
}
@media (prefers-reduced-motion: reduce) {
  .menu .menu-sub a { translate: none !important; transition: none !important; }
}

/* 首页刚进入时的悬停保护（main.js 末尾）：入场动画结束时鼠标停着的那张卡片先不展开，移出后才恢复悬停 */
html.hover-hold .projects .project { pointer-events: none; }

/* ---------- 16. 滚动图（2026-11-24）：一张柱状图固定在屏幕上，几段文字滚过去，滚到哪一段，图就换成哪一段的数据 ----------
   结构由 tools/build_case_study.py 的 [STEPS] 生成：.cs-scrolly > .cs-scrolly-chart（固定的图）+ .cs-scrolly-steps（每段文字 + 自带一张静态小图）。
   视觉沿用 Win-Win 配图：虚化的健身房照片上浮一块磨砂纸面板，柱子是便利贴（重点项按顺序紫 / 粉 / 黄，其余灰），数字写在便利贴里、名称在右侧。
   配图在深色模式下也是浅色，所以图里用固定的浅色（--paper / --ink），不随主题翻转。
   脚本给 .cs-scrolly 加 .is-live：桌面左图右文，手机图固定在顶栏下方、文字从下面滚过；不锁定页面滚动。
   要求减少动态效果、脚本没运行时不加 .is-live：每段文字下面直接显示它自己的静态小图 */
.cs-body > .cs-scrolly { grid-column: 1 / -1; margin: clamp(32px, 4vw, 56px) 0; }
.cs-scrolly-chart { display: none; }
.cs-scrolly-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(40px, 5vw, 64px); }
.cs-step { max-width: 680px; }
.cs-step-num { display: block; font-size: var(--fs-num); line-height: 1; color: var(--gray-4); }
.cs-step-title { margin: 14px 0 10px; font-size: clamp(19px, 1.5vw, 23px); font-weight: var(--weight-strong); line-height: 1.3; }
.cs-step > p { margin: 0; font-size: 17px; line-height: 1.65; color: var(--gray-7); text-wrap: pretty; }
:where(:root[lang="zh-CN"]) .cs-step > p { font-size: 16px; line-height: 1.85; }
.cs-step-chart { margin-top: 24px; }

/* 图：照片画框 + 磨砂纸面板 */
.cs-chart { --note-1: #b16bfa; --note-2: #fca3ea; --note-3: #fafa86; --note-0: #d6d6da;
  position: relative; padding: clamp(18px, 3vw, 40px); border-radius: 28px; background: #e6e6e9 center / cover; overflow: hidden; }
.cs-main[data-project="win-win"] .cs-chart { background-image: url("../projects/p01/P01-SCROLLY-BG.jpg"); }
.cs-chart-panel { position: relative; padding: 26px 28px 22px; border-radius: 22px; color: var(--ink);
  background: color-mix(in srgb, var(--paper) 84%, transparent);
  -webkit-backdrop-filter: blur(16px) saturate(1.05); backdrop-filter: blur(16px) saturate(1.05);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.55), 0 26px 52px -18px rgba(29,29,31,0.26), 0 8px 16px -8px rgba(29,29,31,0.10); }
.cs-scrolly .cs-bars-q { margin: 0 0 22px; padding: 0 56px; text-align: center; font-size: 18px; line-height: 1.4; font-weight: var(--weight-strong); color: var(--ink); }
.cs-bars { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
/* 交互时改用每行的下边距（行收起时边距一起收），数据少的一组图会跟着变矮，不留空白 */
.cs-scrolly.is-live .cs-scrolly-chart .cs-bars { display: block; }
.cs-scrolly.is-live .cs-scrolly-chart .cs-bars li { height: var(--row-h, 44px); max-height: var(--row-h, 44px); margin-bottom: var(--row-gap, 14px); overflow: visible; line-height: 1.15; }
/* 每行高度固定（名称最多两行）：换数据时名称折行数变化也不会让柱子上下跳 */
.cs-scrolly.is-live .cs-scrolly-chart .cs-bars .lb { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cs-scrolly.is-live .cs-scrolly-chart .cs-bars li.is-off { max-height: 0; margin-bottom: 0; }
.cs-bars li { --i: 0; display: flex; align-items: center; gap: 14px; min-width: 0; color: #6e6e70; font-size: 15px; line-height: 1.3; }
.cs-bars li:nth-child(2) { --i: 1; } .cs-bars li:nth-child(3) { --i: 2; } .cs-bars li:nth-child(4) { --i: 3; }
.cs-bars li:nth-child(5) { --i: 4; } .cs-bars li:nth-child(6) { --i: 5; } .cs-bars li:nth-child(7) { --i: 6; } .cs-bars li:nth-child(8) { --i: 7; }
/* 便利贴：宽度按数值，最长一张占行宽的六成；上缘一道浅光、下面一层贴纸的投影 */
.cs-bars .bar { position: relative; flex: none; width: calc(var(--v) / var(--max) * 60%); min-width: 40px; height: 34px; border-radius: 3px;
  background: var(--note, var(--note-0));
  box-shadow: 0 10px 14px -10px rgba(29,29,31,0.40), 0 1px 2px rgba(29,29,31,0.10); }
.cs-bars .bar i { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, rgba(255,255,255,0.38), rgba(255,255,255,0) 45%); }
.cs-bars .val { position: absolute; left: 11px; top: 50%; transform: translateY(-50%); font: 700 15px/1 var(--font-text); font-variant-numeric: tabular-nums; color: #6e6e70; }
.cs-bars .lb { min-width: 0; }
.cs-bars li.is-key { color: var(--ink); font-weight: 500; }
.cs-bars li.c1 { --note: var(--note-1); } .cs-bars li.c1 .val { color: #fff; }
.cs-bars li.c2 { --note: var(--note-2); } .cs-bars li.c3 { --note: var(--note-3); }
.cs-bars li.is-key .val { color: var(--ink); } .cs-bars li.c1 .val { color: #fff; }
.cs-scrolly .cs-bars-unit { margin: 18px 0 0; font-size: 12px; line-height: 1.5; color: #89898b; }
.cs-scrolly-dots { display: none; }

/* 交互（桌面与手机共用的部分） */
.cs-scrolly.is-live .cs-scrolly-chart { display: block; position: sticky; z-index: 2; }
.cs-scrolly.is-live .cs-step-chart { display: none; }
.cs-scrolly.is-live .cs-scrolly-steps { gap: 0; }
.cs-scrolly.is-live .cs-step { display: flex; flex-direction: column; opacity: 0.22; transform: translateY(14px);
  transition: opacity var(--dur-2) var(--ease-out), transform var(--dur-2) var(--ease-out); }
.cs-scrolly.is-live .cs-step.is-active { opacity: 1; transform: none; }
.cs-scrolly.is-live .cs-scrolly-dots { display: flex; gap: 7px; list-style: none; margin: 0; padding: 0; position: absolute; right: 24px; top: 20px; }
.cs-scrolly-dots li { width: 6px; height: 6px; border-radius: 50%; background: rgba(29,29,31,0.16); transition: background-color var(--dur-1) ease, width var(--dur-1) var(--ease-out); }
.cs-scrolly-dots li.is-on { width: 16px; border-radius: 3px; background: var(--note-1); }
/* 换数据：便利贴依次（每张晚 60ms）从旧长度伸到新长度、换颜色；多出来的行淡出收起（不加位移或旋转，避免切换时抖动） */
.cs-scrolly.is-live .cs-bars li { transition: opacity 0.35s var(--ease-out), color 0.35s ease, max-height 0.5s var(--ease-out), margin-bottom 0.5s var(--ease-out); }
.cs-scrolly.is-live .cs-bars .bar { transition: width 0.7s var(--ease-out) calc(var(--i) * 60ms), background-color 0.5s ease calc(var(--i) * 60ms); }
.cs-scrolly.is-live .cs-bars li.is-off { opacity: 0; }
.cs-scrolly.is-live .cs-bars li.is-off .bar { width: 0; min-width: 0; }
/* 问题和名称先往上淡出，换好再落回 */
.cs-scrolly-chart .cs-bars-q, .cs-scrolly-chart .lb { transition: opacity 0.18s ease, transform 0.18s ease; }
.cs-scrolly-chart .cs-chart.is-swap .cs-bars-q, .cs-scrolly-chart .cs-chart.is-swap .lb { opacity: 0; transform: translateY(-6px); }

@media (min-width: 901px) {
  .cs-scrolly.is-live { display: grid; grid-template-columns: minmax(0, 1.45fr) minmax(0, 1fr); column-gap: clamp(40px, 5vw, 88px); align-items: start; }
  .cs-scrolly.is-live .cs-scrolly-chart { top: calc(var(--header-h) + (100vh - var(--header-h) - 500px) / 2); }
  .cs-scrolly.is-live .cs-chart-panel { padding: 52px 34px 26px; }
  .cs-scrolly.is-live .cs-bars { --row-gap: 14px; }
  .cs-scrolly.is-live .cs-bars .bar { height: 40px; }
  .cs-scrolly.is-live .cs-bars li { font-size: 16px; }
  .cs-scrolly.is-live .cs-bars .val { font-size: 16px; left: 13px; }
  .cs-scrolly.is-live .cs-step { min-height: 78vh; justify-content: center; }
  .cs-scrolly.is-live .cs-step-title { font-size: clamp(22px, 1.9vw, 30px); line-height: 1.25; }
  .cs-scrolly.is-live .cs-step-num { font-size: clamp(40px, 3.4vw, 56px); }
  .cs-scrolly.is-live .cs-step:first-child { min-height: 64vh; justify-content: flex-start; padding-top: 90px; }
}
/* 手机：图固定在顶栏下方，文字在图下面一段一段滚过（每段占大半屏），经过图下方那块区域时换数据 */
@media (max-width: 900px) {
  /* 图上方到顶栏之间铺一条页面底色，下缘渐隐：滚过去的文字不会从缝里露出来 */
  .cs-scrolly.is-live .cs-scrolly-chart { top: var(--header-h); margin: 0 calc(var(--gutter) * -0.25); padding: 8px 0 18px;
    background: linear-gradient(var(--bg) calc(100% - 18px), color-mix(in srgb, var(--bg) 0%, transparent)); }
  .cs-scrolly.is-live .cs-chart { padding: 12px; border-radius: 22px; }
  .cs-scrolly.is-live .cs-chart-panel { padding: 34px 16px 14px; border-radius: 16px; }
  .cs-scrolly.is-live .cs-bars-q { margin-bottom: 14px; font-size: 15px; padding: 0 8px; }
  .cs-scrolly.is-live .cs-bars { --row-gap: 8px; --row-h: 30px; }
  .cs-scrolly.is-live .cs-bars li { font-size: 13px; gap: 10px; }
  .cs-scrolly.is-live .cs-bars .bar { height: 26px; min-width: 32px; width: calc(var(--v) / var(--max) * 52%); }
  .cs-scrolly.is-live .cs-bars .val { font-size: 13px; left: 8px; }
  .cs-scrolly.is-live .cs-scrolly-chart .cs-bars-unit { margin-top: 10px; font-size: 11px; }
  .cs-scrolly.is-live .cs-scrolly-dots { right: 16px; top: 14px; }
  .cs-scrolly.is-live .cs-step { min-height: 62vh; padding-top: 32px; }
  .cs-scrolly.is-live .cs-step:last-child { min-height: 52vh; }
}
@media (prefers-reduced-motion: reduce) {
  .cs-scrolly .cs-step, .cs-scrolly .cs-bars li, .cs-scrolly .cs-bars .bar, .cs-scrolly-chart * { transition: none !important; animation: none !important; }
}

/* 菜单主选项文字按字母拆分后会失去字距微调（kerning），拆分前后宽度差 1–2px，跳页交接时整排选项会轻微抖动；
   统一关掉字距微调，拆分前后排版一致 */
.menu > ul > li > a > span[lang] { font-kerning: none; }

/* ---------- 17. 滚动流程（2026-11-26）：整块滚到屏幕上就固定住，手机里自动连着播放几段原型录屏，步骤文字跟着切换 ----------
   结构由 tools/build_case_study.py 的 [FLOW] 生成：.cs-flow > .cs-flow-pin（固定的一屏）> .cs-flow-stage（手机 + 进度条）
   + .cs-flow-side（.cs-flow-steps 步骤列表）。
   脚本给 .cs-flow 加 .is-live：.cs-flow 比一屏高出一段（--flow-run，按录屏总时长设定），这段距离里 .cs-flow-pin 固定在顶栏下方；
   固定住后录屏按原速自己播；上下滚动直接控制播放进度（滚动擦洗，倒着滚就是倒放，手机中央浮出淡淡的快进 / 回退图标），步骤和进度条跟着切换；也可点步骤、进度条某一格跳转。
   手机外框在深浅两种模式下都用深色，屏幕里的画面不随主题翻转。
   要求减少动态效果、脚本没运行时不加 .is-live：不固定、不放录屏，每一步文字下面排出这一步的 Figma 静帧 */
.cs-body > .cs-flow { grid-column: 1 / -1; margin: clamp(24px, 3vw, 40px) 0 clamp(16px, 2vw, 32px); --flow-accent: #b16bfa; }
.cs-flow-stage { display: none; }
.cs-flow-steps { list-style: none; margin: 0; padding: 0; display: grid; gap: clamp(36px, 4vw, 56px); }
.cs-flow-num { display: block; font-size: var(--fs-num); line-height: 1; color: var(--gray-4); }
.cs-flow-num i { font-style: normal; font-size: 0.5em; margin-left: 0.2em; color: var(--gray-3); }
.cs-flow-title { margin: 14px 0 10px; font-size: clamp(19px, 1.5vw, 23px); font-weight: var(--weight-strong); line-height: 1.3; }
.cs-flow-jump { all: unset; cursor: default; }
.cs-flow-body > p { margin: 0; max-width: 34em; font-size: 17px; line-height: 1.65; color: var(--gray-7); text-wrap: pretty; }
:where(:root[lang="zh-CN"]) .cs-flow-body > p { font-size: 16px; line-height: 1.85; }
/* 静帧：默认不显示（也就不下载）；减少动态效果、脚本没运行（页面里的 noscript 样式）时才排出来 */
.cs-flow-thumbs { display: none; gap: 10px; margin-top: 20px; overflow-x: auto; scrollbar-width: none; padding-bottom: 4px; }
.cs-flow-thumbs::-webkit-scrollbar { display: none; }
.cs-flow-thumbs img { flex: 0 0 auto; width: clamp(92px, 11vw, 132px); height: auto; border-radius: 12px; border: 1px solid var(--line); }

/* 手机外框：深色边框；屏幕按 Figma 画板比例，录屏里自带灵动岛 */
.cs-flow-phone { --ph: min(72vh, 700px); position: relative; height: var(--ph); aspect-ratio: 452 / 952; margin: 0 auto;
  padding: calc(var(--ph) * 0.0105); border-radius: calc(var(--ph) * 0.068); background: #121214;
  box-shadow: 0 0 0 1px rgba(255,255,255,0.08) inset, 0 0 0 1px rgba(0,0,0,0.12), 0 40px 80px -36px rgba(0,0,0,0.45), 0 14px 28px -16px rgba(0,0,0,0.22); }
:root[data-theme="dark"] .cs-flow-phone { box-shadow: 0 0 0 1px rgba(255,255,255,0.10) inset, 0 0 0 1px rgba(255,255,255,0.16), 0 40px 80px -36px rgba(0,0,0,0.7); }
.cs-flow-screen { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: calc(var(--ph) * 0.058); background: #f3f3f1; }
.cs-flow-vid { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; opacity: 0; transition: opacity 0.3s var(--ease-out); }
.cs-flow-vid.is-on { opacity: 1; z-index: 2; }
/* 手机下方的三段进度条：只在手机屏显示（桌面端进度在每步文字左边） */
.cs-flow-bar { display: none; list-style: none; gap: 6px; width: calc(var(--ph, 600px) * 0.46); margin: 10px auto 0; padding: 0; }
.cs-flow-bar li { flex: 1; }
.cs-flow-seg { all: unset; display: block; position: relative; width: 100%; padding: 8px 0; cursor: pointer; }
.cs-flow-seg::before { content: ""; display: block; height: 3px; border-radius: 3px; background: var(--gray-2); }
.cs-flow-seg i { position: absolute; left: 0; right: 0; top: 50%; height: 3px; translate: 0 -50%; border-radius: 3px;
  background: var(--seg); transform-origin: 0 50%; transform: scaleX(var(--p, 0)); }
.cs-flow-bar li:nth-child(1) { --seg: #f2e14b; }
.cs-flow-bar li:nth-child(2) { --seg: #fca3ea; }
.cs-flow-bar li:nth-child(3) { --seg: #b16bfa; }
.cs-flow-seg:focus-visible { outline: 2px solid var(--flow-accent); outline-offset: 2px; border-radius: 4px; }
/* 滚动控制播放时，手机中央浮出很淡的快进 / 回退图标（脚本加 .is-fwd / .is-back） */
.cs-flow-seek { position: absolute; inset: 0; z-index: 3; display: grid; place-items: center; pointer-events: none; }
.cs-flow-seek .sk { grid-area: 1 / 1; display: flex; flex-direction: column; align-items: center; gap: 2px; color: #1d1d1f; opacity: 0; transform: scale(0.92); transition: opacity 0.35s var(--ease-out), transform 0.35s var(--ease-out); }
.cs-flow-seek .sk svg { width: calc(var(--ph, 600px) * 0.14); height: auto; }
.cs-flow-seek.is-fwd .sk-fwd, .cs-flow-seek.is-back .sk-back { opacity: 0.3; transform: none; }
/* 两个三角轮流变浅，像在一下一下往前 / 往后跳 */
.cs-flow-seek.is-fwd .sk-fwd path.a, .cs-flow-seek.is-back .sk-back path.a { animation-play-state: running; }
.cs-flow-seek.is-fwd .sk-fwd path.b, .cs-flow-seek.is-back .sk-back path.b { animation-play-state: running; }
/* 动画一直挂着、只在显示时运行：消失时停在当前明暗，不会跳回，淡出才顺 */
.cs-flow-seek .sk path { animation: cs-flow-beat 0.7s ease-in-out infinite alternate; animation-play-state: paused; }
.cs-flow-seek .sk path.b { animation-direction: alternate-reverse; }
@keyframes cs-flow-beat { from { opacity: 1; } to { opacity: 0.2; } }

.cs-flow.is-live { height: calc(var(--flow-pin, 100vh - var(--header-h)) + var(--flow-run, 150vh)); } /* --flow-run 由脚本按三段录屏的总时长设定；手机屏 --flow-pin 由脚本按实际内容高度设定 */
.cs-flow.is-live .cs-flow-pin { position: sticky; top: var(--header-h); height: calc(100vh - var(--header-h)); }
.cs-flow.is-live .cs-flow-stage { display: block; }
.cs-flow.is-live .cs-flow-steps { gap: 0; }
.cs-flow.is-live .cs-flow-step { opacity: 0.32; transition: opacity 0.45s var(--ease-out); }
.cs-flow.is-live .cs-flow-step.is-active { opacity: 1; }
/* 只有当前一步展开说明文字，其余收成「编号 + 标题」 */
.cs-flow.is-live .cs-flow-body { display: grid; grid-template-rows: 0fr; transition: grid-template-rows 0.5s var(--ease-out); }
.cs-flow.is-live .cs-flow-body > p { overflow: hidden; min-height: 0; }
.cs-flow.is-live .cs-flow-step.is-active .cs-flow-body { grid-template-rows: 1fr; }
/* 步骤能点的意符：整行像一张浅底卡片，悬停加底色、标题后面出现播放三角；当前一步带一条该段颜色的竖线 */
.cs-flow-go { display: none; }
.cs-flow.is-live .cs-flow-step { position: relative; border-radius: 14px; cursor: pointer;
  transition: opacity 0.45s var(--ease-out), background-color 0.25s ease; }
.cs-flow.is-live .cs-flow-step:hover { opacity: 0.85; background: var(--gray-1); }
.cs-flow.is-live .cs-flow-step.is-active:hover { opacity: 1; background: transparent; }
.cs-flow.is-live .cs-flow-step::before, .cs-flow.is-live .cs-flow-step::after { content: ""; position: absolute; left: 0; top: 18px; bottom: 18px; width: 3px; border-radius: 3px; }
.cs-flow.is-live .cs-flow-step::before { background: var(--gray-1); } /* 进度条的底 */
.cs-flow.is-live .cs-flow-step::after { bottom: auto; height: calc((100% - 36px) * var(--p, 0)); background: var(--seg, var(--flow-accent)); filter: drop-shadow(0 5px 5px rgba(0,0,0,0.22)); clip-path: inset(0 0 -14px 0); } /* 进度：随录屏播放位置往下填（脚本写 --p）；不用缩放，阴影才不会跟着被压扁 */
.cs-flow.is-live .cs-flow-step:nth-child(1) { --seg: #f2e14b; }
.cs-flow.is-live .cs-flow-step:nth-child(2) { --seg: #fca3ea; }
.cs-flow.is-live .cs-flow-step:nth-child(3) { --seg: #b16bfa; }
.cs-flow.is-live .cs-flow-jump { cursor: pointer; display: flex; align-items: flex-end; justify-content: space-between; gap: 12px; width: 100%; text-align: left; }
.cs-flow.is-live .cs-flow-go { display: inline-block; flex: 0 0 auto; width: 28px; height: 28px; margin-left: auto; margin-bottom: -2px; color: var(--gray-4);
  transition: color 0.25s ease; }
.cs-flow-go .f { display: none; }
.cs-flow.is-live .cs-flow-step:hover .cs-flow-go { color: var(--fg); }
.cs-flow.is-live .cs-flow-step:hover .cs-flow-go .f { display: block; }
.cs-flow.is-live .cs-flow-step:hover .cs-flow-go .o { display: none; }
.cs-flow.is-live .cs-flow-step.is-active .cs-flow-go { display: none; }
.cs-flow.is-live .cs-flow-jump:focus-visible { outline: 2px solid var(--flow-accent); outline-offset: 3px; border-radius: 2px; }

/* 桌面：左手机、右步骤；快进键在步骤下面（介绍的左下方） */
@media (min-width: 901px) {
  .cs-flow.is-live .cs-flow-pin { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: clamp(40px, 5vw, 88px); align-items: center; }
  .cs-flow.is-live .cs-flow-side { display: flex; flex-direction: column; align-items: flex-start; }
  .cs-flow.is-live .cs-flow-step { padding: 14px 18px 14px 22px; margin-left: -22px; }
  .cs-flow.is-live .cs-flow-num { font-size: clamp(30px, 2.6vw, 44px); }
  .cs-flow.is-live .cs-flow-title { margin: 8px 0 0; font-size: clamp(20px, 1.7vw, 27px); line-height: 1.25; }
  .cs-flow.is-live .cs-flow-body > p { padding-top: 10px; }
}
/* 手机屏：手机在上，下面只显示当前一步；快进键放在当前一步编号的右侧 */
@media (max-width: 900px) {
  .cs-flow { --ph-m: min(44svh, 420px); }
  .cs-flow.is-live .cs-flow-pin { display: flex; flex-direction: column; padding-top: 10px; height: auto; }
  .cs-flow.is-live .cs-flow-phone { --ph: var(--ph-m); }
  .cs-flow.is-live .cs-flow-side { position: relative; margin-top: 20px; }
  .cs-flow.is-live .cs-flow-step { display: none; }
  .cs-flow.is-live .cs-flow-step.is-active { display: block; animation: cs-flow-in 0.45s var(--ease-out); }
  .cs-flow.is-live .cs-flow-title { margin: 10px 0 12px; } /* 字号同内容页其他小标题和正文 */
  .cs-flow.is-live .cs-flow-body > p { padding-top: 0; line-height: 1.8; }
  .cs-flow.is-live .cs-flow-num { font-size: 22px; }
  /* 手机屏只显示当前一步：不要卡片底色、左侧色条和缩进（色条会压住文字） */
  .cs-flow.is-live .cs-flow-step { padding: 0; margin: 0; border-radius: 0; cursor: default; }
  .cs-flow.is-live .cs-flow-step::before, .cs-flow.is-live .cs-flow-step::after { display: none; }
  .cs-flow.is-live .cs-flow-bar { display: flex; margin-top: 12px; }
  .cs-flow.is-live .cs-flow-step:hover { background: transparent; }
  .cs-flow.is-live .cs-flow-title { padding-right: 0; }
  /* 手机屏只按内容实际高度收口，不再硬撑一整屏导致下方空出一大截 */
  .cs-flow.is-live .cs-flow-side { padding-bottom: 16px; }
}
@keyframes cs-flow-in { from { opacity: 0; transform: translateY(8px); } }
@media (prefers-reduced-motion: reduce) {
  .cs-flow * { transition: none !important; animation: none !important; }
  .cs-flow-thumbs { display: flex; }
}


/* =========================================================
   升级 2026-11 · 首页右下角的时钟（2026-11-28，翻页牌）
   伦敦时间：LONDON + 时 分 秒，24 小时制。不做拟物：平涂、不加渐变和高光，颜色全取网页色阶，
   深色模式跟着翻转。结构由 main.js「右下角时钟」生成；减少动态效果时数字直接换。
   翻页牌（.is-flap）：时 / 分 / 秒三块浅灰小牌，中缝只在牌的左右两端露一小截；变化时上半张往下翻，露出新数字
   ========================================================= */
.footer-clock {
  justify-self: end;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  -webkit-user-select: none;
  user-select: none;
}
.footer-clock[hidden] { display: none; }
.fc-tz { font-family: var(--font-switzer); font-size: 9px; font-weight: 500; letter-spacing: 0.1em; }
.fc-face { display: inline-flex; align-items: center; font-family: var(--font-display); font-weight: var(--weight-display); font-variant-numeric: tabular-nums; }

/* 翻页牌 */
.is-flap .fc-face { --fp-h: 22px; gap: 3px; font-size: 13px; }
.fp-tile {
  position: relative;
  width: 26px;
  height: var(--fp-h);
  perspective: 60px;
  color: var(--fg);
}
.fp-half {
  position: absolute;
  left: 0;
  right: 0;
  height: 50%;
  overflow: hidden;
  background: color-mix(in srgb, var(--fg) 7%, var(--bg));
  -webkit-backface-visibility: hidden;
  backface-visibility: hidden;
}
.fp-half > span { display: block; height: var(--fp-h); line-height: var(--fp-h); text-align: center; }
.fp-top { top: 0; border-radius: 4px 4px 0 0; }
/* 上下两半之间那道细缝：只在牌面左右两端各露一小截，不横穿数字（整条横穿时读起来像删除线） */
.fp-tile::before, .fp-tile::after { content: ""; position: absolute; z-index: 2; top: 50%; width: 4px; height: 1px; margin-top: -0.5px; background: var(--bg); }
.fp-tile::before { left: 0; }
.fp-tile::after { right: 0; }
.fp-bot { bottom: 0; border-radius: 0 0 4px 4px; }
.fp-bot > span { margin-top: calc(var(--fp-h) / -2); }
.fp-flap-a, .fp-flap-b { display: none; }
.fp-tile.is-flipping .fp-flap-a { display: block; transform-origin: 50% 100%; animation: fp-down-a 0.22s var(--ease-in, ease-in) both; }
.fp-tile.is-flipping .fp-flap-b { display: block; transform-origin: 50% 0; animation: fp-down-b 0.22s var(--ease-out) 0.22s both; }
@keyframes fp-down-a { from { transform: rotateX(0); } to { transform: rotateX(-90deg); } }
@keyframes fp-down-b { from { transform: rotateX(90deg); } to { transform: rotateX(0); } }

@media (prefers-reduced-motion: reduce) {
  .fp-tile.is-flipping .fp-flap-a, .fp-tile.is-flipping .fp-flap-b { display: none; }
}


/* =========================================================
   2026-11 桌面端首页与顶栏重构（可整体撤回）
   · 顶栏三栏：左 Hi Seth 挥手（悬停切换 LinkedIn / Email）、中 Index / About（悬停 Index 下拉 P01–P04）、右 EN/中文 + 主题
   · 桌面端首页（≥901px）：3D 景深轮播，图 2（灰阶切换态/对焦入场）⇄ 图 1（展开态：彩色+左右阴影+弥散光+左右信息栏+底部刻度尺）
   · 手机（≤540px）与平板（541–900px）原样保留
   ========================================================= */

/* ---------- 顶栏：左侧署名沿用 main 的 .brand-zone（Gemini 版 Hi Seth / 联系入口未合并），这里只排中间导航和右侧按钮 ---------- */
.header-nav { display: none; }
.header-right {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 0;
}
.header-right .lang-toggle { margin-left: 0; }

@media (min-width: 901px) {
  .site-header {
    display: grid;
    grid-template-columns: 1fr auto 1fr;
    align-items: center;
    gap: 24px;
  }
  .header-right {
    margin-left: 0;
    justify-self: end;
  }
  .site-header > .brand-zone { justify-self: start; } /* 只占署名本身的宽度：悬停空白处不弹出联系方式 */
  .header-right .theme-toggle { margin-right: -8px; }
  .menu-toggle { display: none; }
  .menu { display: none; }

  /* 居中导航 Index / About */
  .header-nav {
    display: flex;
    align-items: center;
    justify-self: center;
    gap: 26px;
  }
  :root[lang="zh-CN"] .header-nav { gap: 24px; }
  .hn-item { position: relative; }
  .hn-link {
    display: inline-block;
    padding: 3px 0 4px;
    font-family: var(--font-text);
    font-size: 12.5px;
    font-weight: 500;
    letter-spacing: 0.025em;
    line-height: 1.2;
    color: var(--fg);
    opacity: 0.46;
    background-image: linear-gradient(currentColor, currentColor);
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0 1px;
    transition: opacity 0.3s var(--ease), background-size 0.4s var(--ease), color 0.3s var(--ease);
  }
  :root[lang="zh-CN"] .hn-link { font-family: var(--font-system); letter-spacing: 0.06em; }
  :root[lang="en"] .hn-link { font-family: var(--font-switzer); }
  .hn-link:hover,
  .hn-link:focus-visible,
  .hn-has-sub:hover > .hn-link,
  .hn-has-sub:focus-within > .hn-link {
    opacity: 0.9;
    background-size: 100% 1px;
  }
  .hn-link[aria-current="page"] {
    opacity: 1;
    font-weight: 500;
    background-size: 100% 1px;
  }
  .is-leaving-blue .hn-link { color: var(--inv-fg); }

  /* 悬停 Index：四个项目入口 P01–P04（2026-12 第四次重做：四颗小件玻璃胶囊，不再是糊在图上的裸字）。
     · 为什么改：之前是没有任何底的小字直接压在轮播图 / 内容页上，图一亮或一花就读不出来，深浅色下表现还不一样。
       现在每个入口自己是一颗平的、半透明的磨砂胶囊（材质与章节胶囊 .cs-dock-pill、首页「进入」同一家：磨砂 + 极淡描边 + 两层柔和阴影），
       文字永远落在自己的底上，浅色 / 深色下全取 --bg / --fg，自动翻转；不做大面板，只有这四颗小件
     · 排版：胶囊横排在导航正下方，以页面中线对称，和导航同一根轴；编号（P01）在前、项目名在后，同一行；字号 13px，与导航同一家人
     · 出现：像从 Index 里「舒展」出来——四颗先叠在中线附近、又糊又淡又小，随后向两侧散开并对焦（模糊 → 清晰）；内侧两颗先到，外侧后到；
       离开时一起快速收回、虚掉
     · 对焦随鼠标：指到哪一颗，它靠近玻璃——放大一点、投影抬高、底更实；其余几颗微微失焦、变淡。没有 :has 的浏览器里没有这一层，不影响使用
     · 当前所在的项目页：那一颗是反色实心的平面（--fg 底、--bg 字：深色模式下 --inv-bg 和页面底色太接近，认不出来），一眼能认出「我在这」
     · 键盘聚焦：一圈重点色的环；减少动态效果时只淡入淡出，不位移、不模糊 */
  .site-header > .header-nav { position: static; z-index: auto; } /* 让下拉以整条顶栏为参照 */
  .hn-has-sub { position: static; }
  .hn-link { position: relative; }
  .hn-sub {
    position: absolute;
    left: 50%;
    top: calc(100% - 6px);
    z-index: 1;
    display: flex;
    gap: 8px;
    margin: 0;
    padding: 0;
    list-style: none;
    translate: -50% 0;
    visibility: hidden;
    pointer-events: none;
    transition: visibility 0s 0.7s; /* 等所有胶囊收完（含起步缓冲）再真正隐藏 */
  }
  .hn-has-sub:hover .hn-sub,
  .hn-has-sub:focus-within .hn-sub {
    visibility: visible;
    pointer-events: auto; /* 只占这一排胶囊的宽度（max-content），其余空白不挡下面的卡片；胶囊之间的缝也算在内，鼠标横向移动不会断开 */
    transition: visibility 0s;
  }
  /* 隐形的触摸区：在胶囊外侧四周各多出一圈（不改胶囊大小、不可见），鼠标在胶囊之间或边缘滑偏时仍算在下拉里，不会误收 */
  .hn-sub::before { content: ""; position: absolute; inset: -12px -18px -16px; }
  .hn-sub li:nth-child(1) { --fx: 74px; --fd: 70ms; --xd: 0ms; }   /* 起点：越靠外越往中线挤，到达也越晚；收回时反过来——外侧先走、内侧后收 */
  .hn-sub li:nth-child(2) { --fx: 26px; --fd: 20ms; --xd: 60ms; }
  .hn-sub li:nth-child(3) { --fx: -26px; --fd: 20ms; --xd: 60ms; }
  .hn-sub li:nth-child(4) { --fx: -74px; --fd: 70ms; --xd: 0ms; }
  .hn-sub a {
    display: flex;
    align-items: center;
    gap: 8px;
    height: 34px;
    padding: 0 16px;
    border-radius: 999px;
    font-size: 13px;
    font-weight: 400;
    line-height: 1;
    letter-spacing: 0.01em;
    white-space: nowrap;
    color: var(--fg);
    background: color-mix(in srgb, var(--bg) 88%, transparent);
    -webkit-backdrop-filter: blur(10px) saturate(130%);
    backdrop-filter: blur(6px) saturate(130%);
    box-shadow:
      inset 0 0 0 1px color-mix(in srgb, var(--fg) 9%, transparent),
      0 1px 3px rgba(var(--shadow), 0.08),
      0 8px 20px -8px rgba(var(--shadow), 0.22);
    opacity: 0;
    filter: blur(2px);
    scale: 0.94;
    translate: var(--fx, 0px) -6px;
    /* 退出（鼠标移出）：先停 80ms（斜着滑向别处不会误收），再向中线收拢并虚掉——外侧先走、内侧后收，比出现稍快 */
    transition: opacity 0.4s var(--ease) calc(80ms + var(--xd, 0ms)),
                filter 0.45s var(--ease) calc(80ms + var(--xd, 0ms)),
                scale 0.45s var(--ease) calc(80ms + var(--xd, 0ms)),
                translate 0.5s var(--ease-in-out) calc(80ms + var(--xd, 0ms)),
                background-color 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.4s var(--ease);
  }
  :root[lang="zh-CN"] .hn-sub a { font-family: var(--font-system); letter-spacing: 0.04em; }
  :root[lang="en"] .hn-sub a { font-family: var(--font-switzer); }
  .hn-has-sub:hover .hn-sub a,
  .hn-has-sub:focus-within .hn-sub a {
    opacity: 1;
    filter: blur(0);
    scale: 1;
    translate: 0 0;
    transition: opacity 0.4s var(--ease) calc(var(--fd, 0ms) + 40ms),
                filter 0.55s var(--ease-out) calc(var(--fd, 0ms) + 40ms),
                scale 0.6s var(--ease-out) calc(var(--fd, 0ms) + 40ms),
                translate 0.65s var(--ease-out) calc(var(--fd, 0ms) + 20ms),
                background-color 0.3s var(--ease), color 0.3s var(--ease), box-shadow 0.4s var(--ease);
  }
  .hn-sub small {
    flex: none;
    font-family: var(--font-switzer);
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.06em;
    color: var(--fg-muted);
    font-variant-numeric: tabular-nums;
    transition: color 0.25s var(--ease);
  }
  .hn-sub a > span[lang] { padding: 0; background: none; }
  /* 靠近玻璃：放大一点、底更实、投影抬高 */
  .hn-sub a:hover,
  .hn-sub a:focus-visible {
    background: color-mix(in srgb, var(--bg) 95%, transparent);
    box-shadow: var(--so-rest); /* 与按压动画首尾的阴影完全一致：动画播完交还给悬停样式时不会突然变重 */
  }
  .hn-sub a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
  /* 胶囊探出的路上不接收鼠标：P02 等会从光标下方经过，否则会被当成悬停（放大、变色）。落定后（约 0.6 秒）才交还给鼠标 */
  .hn-has-sub:hover .hn-sub li,
  .hn-has-sub:focus-within .hn-sub li { pointer-events: none; animation: hs-arm 0s linear 0.6s forwards; }
  .hn-has-sub.is-picked .hn-sub li { animation: none; }
  @keyframes hs-arm { to { pointer-events: inherit; } }
  /* 悬停样式（第七版）：与首页主卡「进入」按钮同一套——胶囊背后藏着一个柔软的球，先在玻璃后浮出一团模糊的影子、玻璃被顶得微微鼓起（放大 + 投影抬高），
     球碰到玻璃后接触面从中心向四周扩散，反色（连同文字）带着柔和的边缘铺开，由糊变清；完全贴合后玻璃回落；移开时反色向中心收回。
     结构由 main.js 在每颗胶囊里补上（.hs-back 里的球、.hs-glass 里的反色文字副本和水纹），不改各页的标记。
     点击后：被点的那颗用 .is-hold 保持悬停时的样子（反色已铺满），和其余三颗一起缩回去 */
  .hn-sub a { position: relative; --so-rest: inset 0 0 0 1px color-mix(in srgb, var(--fg) 14%, transparent), 0 1px 3px rgba(var(--shadow), 0.08), 0 8px 20px -8px rgba(var(--shadow), 0.22); --so-lift: inset 0 0 0 1px color-mix(in srgb, var(--fg) 14%, transparent), 0 2px 4px rgba(var(--shadow), 0.14), 0 12px 22px -4px rgba(var(--shadow), 0.20), 0 22px 36px -12px rgba(var(--shadow), 0.30); }
  .hn-sub a > small, .hn-sub a > span[lang] { position: relative; z-index: 1; }
  .hn-sub .hs-back, .hn-sub .hs-glass { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
  .hn-sub .hs-glass { z-index: 2; }
  .hn-sub .hs-ball {
    position: absolute; left: 50%; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px;
    border-radius: 50%; background: var(--hs-ac, var(--fg)); filter: blur(6px); opacity: 0; scale: 0.4;
    transition: opacity 0.24s var(--ease), scale 0.32s var(--ease);
  }
  .hn-sub a:hover .hs-ball, .hn-sub a:focus-visible .hs-ball, .hn-sub a.is-hold .hs-ball {
    opacity: 0.4; scale: 1.5;
    transition: opacity 0.2s var(--ease) 0.016s, scale 0.36s cubic-bezier(0.22, 0.72, 0.18, 1);
  }
  .hn-sub .hs-fill {
    position: absolute; inset: 0; display: flex; align-items: center; gap: 8px; padding: 0 16px;
    color: var(--hs-fg, var(--bg)); background: var(--hs-ac, var(--fg));
    -webkit-mask-image: radial-gradient(circle closest-side, #000 52%, transparent 100%);
    mask-image: radial-gradient(circle closest-side, #000 52%, transparent 100%);
    -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat;
    -webkit-mask-position: 50% 50%; mask-position: 50% 50%;
    -webkit-mask-size: 0 0; mask-size: 0 0;
    transition: -webkit-mask-size 0.4s cubic-bezier(0.55, 0, 0.3, 1), mask-size 0.4s cubic-bezier(0.55, 0, 0.3, 1);
  }
  .hn-sub a:hover .hs-fill, .hn-sub a:focus-visible .hs-fill, .hn-sub a.is-hold .hs-fill {
    -webkit-mask-size: 440px 440px; mask-size: 440px 440px;
    transition: -webkit-mask-size 0.72s cubic-bezier(0.22, 0.72, 0.18, 1) 0.096s, mask-size 0.72s cubic-bezier(0.22, 0.72, 0.18, 1) 0.096s;
  }
  .hn-sub .hs-fill small { color: color-mix(in srgb, var(--hs-fg, var(--bg)) 62%, transparent); }
  /* 悬停色 = 各项目在首页主卡「进入」按钮上的特殊色（取首页算出的同一批颜色：深色 / 浅色各一份），字用 #1d1d1f，与「进入」按钮一致 */
  .hn-sub a { --hs-fg: #1d1d1f; }
  .hn-sub a[href$="project-01.html"] { --hs-ac: rgb(219, 138, 181); }
  .hn-sub a[href$="project-02.html"] { --hs-ac: rgb(244, 231, 113); }
  .hn-sub a[href$="project-03.html"] { --hs-ac: rgb(142, 215, 164); }
  .hn-sub a[href$="project-04.html"] { --hs-ac: rgb(132, 198, 225); }
  :root[data-theme="light"] .hn-sub a[href$="project-01.html"] { --hs-ac: rgb(235, 152, 196); }
  :root[data-theme="light"] .hn-sub a[href$="project-02.html"] { --hs-ac: rgb(246, 235, 142); }
  :root[data-theme="light"] .hn-sub a[href$="project-03.html"] { --hs-ac: rgb(152, 235, 177); }
  :root[data-theme="light"] .hn-sub a[href$="project-04.html"] { --hs-ac: rgb(152, 211, 235); }
  .hn-sub .hs-ring {
    position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px;
    border-radius: 50%; border: 1px solid color-mix(in srgb, var(--hs-ac, var(--fg)) 85%, transparent); filter: none; opacity: 0; scale: 0.2;
  }
  .hn-sub a.is-press { animation: hs-press 0.8s linear both; }
  .hn-sub a.is-ripple .hs-ring { animation: hs-ring 0.6s cubic-bezier(0.2, 0.6, 0.3, 1) both; }
  @keyframes hs-press {
    0%   { scale: 1;    box-shadow: var(--so-rest); animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1); }
    28%  { scale: 1.06; box-shadow: var(--so-lift); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
    100% { scale: 1;    box-shadow: var(--so-rest); }
  }
  @keyframes hs-ring { 0% { scale: 0.2; opacity: 0; } 14% { opacity: 0.7; } 100% { scale: 7; opacity: 0; } }
  .hn-sub a[aria-current="page"] .hs-back, .hn-sub a[aria-current="page"] .hs-glass { display: none; } /* 当前项目本来就是反色实心 */
  /* 当前所在的项目：反色实心的平面 */
  .hn-sub a[aria-current="page"] { background: color-mix(in srgb, var(--fg) 62%, transparent); color: var(--bg); box-shadow: var(--so-rest); } /* 当前项目：反色但半透（62%），不比其余的更抢眼 */
  .hn-sub a[aria-current="page"] small { color: color-mix(in srgb, var(--bg) 80%, transparent); }
  .hn-sub a[aria-current="page"]:hover small,
  .hn-sub a[aria-current="page"]:focus-visible small { color: color-mix(in srgb, var(--bg) 80%, transparent); }
  /* 当前所在的项目：不可点（main.js 拦掉跳转）、悬停没有任何反应：底 / 阴影 / 光标都不变，也不让其余几颗失焦 */
  .hn-sub a[aria-current="page"], .hn-sub a[aria-current="page"]:hover { cursor: default; }
  .hn-sub a[aria-current="page"]:hover { background: color-mix(in srgb, var(--fg) 62%, transparent); box-shadow: var(--so-rest); }
  /* 对焦随鼠标：其余的微微失焦、变淡 */
  .hn-has-sub:hover .hn-sub:has(a:not([aria-current]):hover) a:not(:hover) { filter: blur(0.5px); transition-delay: 0s; }
  .hn-has-sub:focus-within .hn-sub:has(a:focus-visible) a:not(:focus-visible) { filter: blur(0.5px); transition-delay: 0s; }
  /* 点了某一项之后（main.js 给 .hn-has-sub 加 .is-picked，并用 Web Animations 逐颗播放收起：选中的那颗靠近玻璃并散去，其余向中线收拢；
     鼠标还停在上面时 :hover 不会撤，所以这里只负责让下拉保持可见（动画播完 opacity 为 0）并且不再接收鼠标） */
  .hn-has-sub.is-picked .hn-sub { pointer-events: none; visibility: visible; transition: none; }
  .hn-has-sub.is-picked.is-here .hn-sub { pointer-events: auto; } /* 点的是当前项目（没有跳转）：容器仍接收鼠标，鼠标移出才算离开 */
  .hn-has-sub.is-picked.is-here .hn-sub a { pointer-events: none; }
  @supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
    .hn-sub a { background: var(--bg); } /* 不支持背景模糊：退回不透明底色 */
  }
  /* 悬停桥：从 Index 链接下沿接到胶囊，鼠标往下移不会断开（顶栏里下方的 6px 点击扩展见下文，这里补足到胶囊顶端） */
  .site-header .hn-has-sub > .hn-link::after { inset: 0 -14px -24px; height: auto; }
}

/* 新版首页轮播：桌面与中等屏（≥541px）都用；手机（≤540px）仍是纵向堆叠。顶栏三栏仍只在 ≥901px */
@media (min-width: 541px) {
  /* ---------- 桌面端首页：3D 景深轮播舞台（图 1 / 图 2） ---------- */
  body.home.home-carousel { overflow: hidden; }
  body.home.home-carousel .projects {
    position: relative;
    display: block;
    width: 100%;
    height: calc(100vh - var(--header-h) - var(--footer-h));
    height: calc(100svh - var(--header-h) - var(--footer-h));
    min-height: 500px;
    overflow: hidden;
    scroll-snap-type: none;
  }
  /* 进入动画缩放期间（--ii-clip 由 main.js 写入，只当标记用）：容器不再自己裁切——它一缩小，裁切框也跟着缩小，两侧的卡片会被削边。
     改由页面（视口）裁掉屏幕以外的部分；缩放结束（标记撤掉）后恢复原来的裁切。所有浏览器通用，不依赖较新的特性 */
  body.home.home-carousel .projects[style*="--ii-clip"] { overflow: visible; }
  html[data-intro] body.home { overflow-x: hidden; }
  body.home.home-carousel .project {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 20%;
    height: 100%;
    max-height: none;
    border: 0 !important;
    background: transparent;
    --card-edge: linear-gradient(transparent, transparent);
    overflow: hidden;
    backface-visibility: hidden;
    will-change: transform, opacity;
    transition: none;
    cursor: var(--cur-tap);
    /* margin 居中，留出独立 translate3d 供轮播每帧控制；雪室退远则使用独立 CSS 属性 `scale` 互不冲突 */
    transform-origin: 50% 50%;
  }
  /* 卡片之间的分割线：由脚本生成的独立细线 .stage-divider（见 main.js placeDividers），不受卡片模糊 / 透明度影响，滚动与停稳时始终可见；
     颜色取 --fg 的低透明度，深浅模式自动相反；上下两端淡出。卡片自带的左边线去掉，免得重复 */
  body.home.home-carousel .project.has-divider { border-left: 0 !important; }
  .stage-divider {
    display: none; /* 暂时删掉分割线（试看）：去掉这一行即恢复 */
    position: fixed;
    z-index: 11;
    width: 1px;
    pointer-events: none;
    background: color-mix(in srgb, var(--fg) 10%, transparent);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 14%, #000 86%, transparent 100%);
    transition: opacity 0.25s ease;
  }
  body.home.home-carousel.is-leaving .stage-divider,
  .menu-open .stage-divider,
  html.snow-on .stage-divider,
  html[data-enter] .stage-divider,
  html[data-intro] .stage-divider { opacity: 0 !important; }
  /* 上下固定物理长度（约 22% 舞台高）的柔和渐隐遮罩并做交集叠加：卡片缩矮时上下渐变向中线挤压重叠，最外侧卡片隐约可见且无矩形硬边 */
  body.home.home-carousel .project.is-cover:not(.is-expanding) {
    --f: calc(var(--stage-h, 784px) * 0.22);
    -webkit-mask-image:
      linear-gradient(to bottom,
        transparent 0px,
        rgba(0, 0, 0, 0.12) calc(var(--f) * 0.18),
        rgba(0, 0, 0, 0.34) calc(var(--f) * 0.38),
        rgba(0, 0, 0, 0.62) calc(var(--f) * 0.58),
        rgba(0, 0, 0, 0.86) calc(var(--f) * 0.78),
        #000 var(--f)),
      linear-gradient(to top,
        transparent 0px,
        rgba(0, 0, 0, 0.12) calc(var(--f) * 0.18),
        rgba(0, 0, 0, 0.34) calc(var(--f) * 0.38),
        rgba(0, 0, 0, 0.62) calc(var(--f) * 0.58),
        rgba(0, 0, 0, 0.86) calc(var(--f) * 0.78),
        #000 var(--f));
    -webkit-mask-composite: source-in;
    mask-image:
      linear-gradient(to bottom,
        transparent 0px,
        rgba(0, 0, 0, 0.12) calc(var(--f) * 0.18),
        rgba(0, 0, 0, 0.34) calc(var(--f) * 0.38),
        rgba(0, 0, 0, 0.62) calc(var(--f) * 0.58),
        rgba(0, 0, 0, 0.86) calc(var(--f) * 0.78),
        #000 var(--f)),
      linear-gradient(to top,
        transparent 0px,
        rgba(0, 0, 0, 0.12) calc(var(--f) * 0.18),
        rgba(0, 0, 0, 0.34) calc(var(--f) * 0.38),
        rgba(0, 0, 0, 0.62) calc(var(--f) * 0.58),
        rgba(0, 0, 0, 0.86) calc(var(--f) * 0.78),
        #000 var(--f));
    mask-composite: intersect;
  }
  /* 卡片上不显示文字（图 1 & 图 2 要求） */
  body.home.home-carousel .project > .index,
  body.home.home-carousel .project > .project-text { display: none !important; }
  /* 保留旧版上下渐变（::after / ::before）与边缘渐进模糊（.media-blur / .img-hblur），仅隐藏卡片顶部渐变与默认景深四层画布 */
  body.home.home-carousel .img-pair,
  body.home.home-carousel .project-media .img-near,
  body.home.home-carousel .project-media .img-mid,
  body.home.home-carousel .project-media .img-mid2,
  body.home.home-carousel .project-media .img-far { display: none !important; }

  body.home.home-carousel .project-media {
    inset: auto;
    width: var(--wide-w, 100%);
    height: var(--stage-h, 100%);
    left: calc((100% - var(--wide-w, 100%)) / 2);
    top: calc((100% - var(--stage-h, 100%)) / 2);
    z-index: 0;
    clip-path: none;
    transform: none;
    transition: none;
  }
  /* 沿用旧版 18 段缓入缓出遮罩（--bg 自动兼容深浅两套主题）；默认/切换态（图 2）显示 ::after，停稳前卡（图 1）切到 ::before */
  body.home.home-carousel .project.is-cover .project-media::after { inset: -2px; }
  body.home.home-carousel .project.is-cover .project-media::before {
    inset: -2px;
    opacity: 0;
    background: linear-gradient(to bottom,
      color-mix(in srgb, var(--bg) 85%, transparent) 0%, color-mix(in srgb, var(--bg) 0%, transparent) 20%,
      color-mix(in srgb, var(--bg) 0%, transparent) 30%, color-mix(in srgb, var(--bg) 3%, transparent) 35%,
      color-mix(in srgb, var(--bg) 10%, transparent) 40%, color-mix(in srgb, var(--bg) 19%, transparent) 45%,
      color-mix(in srgb, var(--bg) 32%, transparent) 50%, color-mix(in srgb, var(--bg) 46%, transparent) 55%,
      color-mix(in srgb, var(--bg) 58%, transparent) 60%, color-mix(in srgb, var(--bg) 67%, transparent) 65%,
      color-mix(in srgb, var(--bg) 73%, transparent) 71%, color-mix(in srgb, var(--bg) 77%, transparent) 80%,
      color-mix(in srgb, var(--bg) 82%, transparent) 85%, color-mix(in srgb, var(--bg) 97%, transparent) 90%,
      var(--bg) 95%, var(--bg) 100%);
  }
  body.home.home-carousel .project-media img.img-default {
    visibility: visible !important;
    opacity: var(--def-op, 1) !important;
    transform: none !important;
    filter: saturate(0) !important;
    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), translate 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) !important;
  }
  :root[data-theme="dark"] body.home.home-carousel .project:not(.is-cover) img.img-default {
    filter: invert(1) !important;
  }
  /* 景深图（.img-dof，main.js 画好）：中心清晰、四周模糊的灰阶图，滚动中的卡片（含主卡）用它代替原来整张清晰的默认图；
     行为与默认图一致（随距离被整张模糊的那层盖住、停稳后被彩色图换掉、跟着鼠标视差），原图留着只用来量尺寸 / 作画板 */
  body.home.home-carousel .project-media.is-dbaked img.img-default { visibility: hidden !important; }
  body.home.home-carousel .project-media canvas.img-dof {
    visibility: visible !important;
    opacity: var(--def-op, 1) !important;
    transform: none !important;
    filter: none !important;
    transition: transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), translate 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) !important;
  }
  body.home.home-carousel.is-settled .project.is-front:not(.is-expanding) canvas.img-dof {
    opacity: 0 !important;
    transform: scale(1.04) !important;
    transition: opacity 0.25s ease 0.45s, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), translate 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) !important;
  }
  body.home.home-carousel .project-media .img-hover {
    opacity: 0 !important;
    transform: scale(1) !important;
    transition: opacity 0.55s var(--ease), transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), translate 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) !important;
  }
  body.home.home-carousel .project-media .img-pblur {
    display: block;
    position: absolute;
    inset: 0;
    width: 100%;
    height: 100%;
    opacity: 0;
    transform: none !important;
    translate: none !important;
    transition: none !important;
    pointer-events: none;
  }
  /* 抑制旧版 :hover 卡片变暗 / 展开逻辑：鼠标放上任一卡片时，其他卡片不降透明度、侧卡不误触展开 */
  /* 进入动画期间不生效：否则鼠标在名字阶段扫过（卡片还藏着），这条 !important 会把卡片图片提前显出来 */
  html:not([data-intro]) body.home.home-carousel .projects:has(.project:hover, .project.is-active) .project .project-media { opacity: 1 !important; }
  body.home.home-carousel .project:hover,
  body.home.home-carousel .project:focus-visible {
    background: transparent;
    color: var(--fg);
  }
  body.home.home-carousel .project.is-cover:hover .project-media::after,
  body.home.home-carousel .project.is-cover:focus-visible .project-media::after { opacity: 1; }
  body.home.home-carousel .project.is-cover:hover .project-media::before,
  body.home.home-carousel .project.is-cover:focus-visible .project-media::before { opacity: 0; }
  /* 仅当图 1 停稳（body.is-settled）时，最前方的卡片（.is-front）恢复全彩并放大 4% 供鼠标视差 */
  body.home.home-carousel.is-settled .project.is-front:not(.is-expanding) .project-media .img-hover {
    opacity: 1 !important;
    transform: scale(1.04) !important;
  }
  body.home.home-carousel.is-settled .project.is-front:not(.is-expanding) .project-media .img-hblur {
    transition: opacity 0.45s var(--ease) 0.15s, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), translate 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) !important;
  }
  body.home.home-carousel.is-settled .project.is-front:not(.is-expanding) .img-default {
    opacity: 0 !important;
    /* 灰阶默认图在换成彩图之前也跟着放大 4%、随鼠标视差移动，与上面的彩图同一个几何：
       否则它的宽度刚好等于展开后的卡片，视差一移就在卡片两侧露出底色（深色黑边 / 浅色灰条）；也避免交叉淡变时两张图错位 */
    transform: scale(1.04) !important;
    transition: opacity 0.25s ease 0.45s, transform 0.7s cubic-bezier(0.2, 0.7, 0.2, 1), translate 0.9s cubic-bezier(0.2, 0.7, 0.2, 1) !important;
  }
  body.home.home-carousel.is-settled .project.is-cover.is-front:not(.is-expanding) .project-media::after { opacity: 0; }
  body.home.home-carousel.is-settled .project.is-cover.is-front:not(.is-expanding) .project-media::before { opacity: 1; }
  /* 上下沿渐进模糊（.media-blur 为未烘焙完成前的回退层，同样仅在图 1 前卡停稳时开启；左右外扩 4px 落在遮罩外侧） */
  body.home.home-carousel .project .media-blur { display: none; inset: 0 -4px; }
  body.home.home-carousel.is-settled .project.is-cover.is-front:not(.is-expanding) .project-media:not(.is-hbaked) .media-blur { display: block; }
  body.home.home-carousel.is-settled .project.is-cover.is-front:not(.is-expanding) .media-blur i {
    -webkit-backdrop-filter: blur(var(--b));
    backdrop-filter: blur(var(--b));
  }
  html[data-intro] body.home.home-carousel .media-blur,
  html[data-enter] body.home.home-carousel .media-blur,
  html.menu-handoff body.home.home-carousel .media-blur,
  body.home.home-carousel .project.is-expanding .media-blur { display: none !important; }
  /* 光泽高光只在前卡停稳展开后悬停时显现 */
  body.home.home-carousel .project .card-gloss { opacity: 0; }
  body.home.home-carousel.is-settled .project.is-front:not(.is-expanding):hover .card-gloss { opacity: 1; }
  body.home.home-carousel .project.is-expanding .card-gloss { opacity: 0 !important; transition-duration: 0.12s; }

  /* 展开后的前卡向左右投下阴影（位于前卡 z=10 与侧卡 z=5 之间）；左右扩出 180px 留给阴影，上下与卡片一样渐隐羽化 */
  /* 侧卡朝向中间那张的一侧：页面底色的渐变（旧版每张卡片左缘渐变的做法，改成对着中间那张）——
     像侧卡被中间那张挡住、藏进它的阴影里，补上前后层次；强度 --eg-l / --eg-r 由脚本按离中心的远近写入 */
  /* 轮播卡片不画键盘焦点框：点过 / 拖过卡片后再按方向键，浏览器会把卡片的焦点切成「键盘焦点」，全站的蓝色描边（:focus-visible）
     被两侧渐隐遮罩裁成两条竖直蓝线。首页靠方向键和底部刻度尺操作，卡片不需要这圈框 */
  body.home.home-carousel .project:focus-visible { outline: none; }
  /* 拖拽切卡：拖动期间整页显示抓手、不选中文字 */
  html.card-dragging, html.card-dragging * { cursor: grabbing !important; -webkit-user-select: none; user-select: none; }
  body.home.home-carousel .project::before,
  body.home.home-carousel .project::after {
    content: "";
    display: block;
    position: absolute;
    top: 0; bottom: 0;
    width: 36%; /* 两侧各 36%：中间约三成的卡片完全不被盖到（以前 62% 加 62% 会盖满整张，浅色下像整体在发光） */
    z-index: 1;
    pointer-events: none;
    height: auto;
    transition: none;
    background: none;
  }
  body.home.home-carousel .project::before {
    left: 0; right: auto;
    opacity: var(--eg-l, 0);
    background: linear-gradient(to right,
      var(--bg) 0%, color-mix(in srgb, var(--bg) 92%, transparent) 8%, color-mix(in srgb, var(--bg) 76%, transparent) 18%,
      color-mix(in srgb, var(--bg) 54%, transparent) 30%, color-mix(in srgb, var(--bg) 32%, transparent) 43%,
      color-mix(in srgb, var(--bg) 14%, transparent) 57%, color-mix(in srgb, var(--bg) 4%, transparent) 75%,
      color-mix(in srgb, var(--bg) 0%, transparent) 100%);
  }
  body.home.home-carousel .project::after {
    right: 0; left: auto;
    opacity: var(--eg-r, 0);
    background: linear-gradient(to left,
      var(--bg) 0%, color-mix(in srgb, var(--bg) 92%, transparent) 8%, color-mix(in srgb, var(--bg) 76%, transparent) 18%,
      color-mix(in srgb, var(--bg) 54%, transparent) 30%, color-mix(in srgb, var(--bg) 32%, transparent) 43%,
      color-mix(in srgb, var(--bg) 14%, transparent) 57%, color-mix(in srgb, var(--bg) 4%, transparent) 75%,
      color-mix(in srgb, var(--bg) 0%, transparent) 100%);
  }
  .stage-shadow {
    position: fixed;
    z-index: 9;
    pointer-events: none;
    opacity: 0;
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 88%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 12%, #000 88%, transparent 100%);
    transition: opacity 0.55s var(--ease);
  }
  .stage-shadow::before {
    content: "";
    position: absolute;
    inset: 0 181px;
    box-shadow:
      0 4px 12px rgba(var(--shadow), 0.14),
      0 14px 36px rgba(var(--shadow), 0.2),
      0 32px 84px rgba(var(--shadow), 0.26);
  }
  :root[data-theme="dark"] .stage-shadow::before {
    box-shadow:
      0 4px 12px rgba(0, 0, 0, 0.38),
      0 18px 44px rgba(0, 0, 0, 0.5),
      0 38px 96px rgba(0, 0, 0, 0.62);
  }
  /* 主卡的投影：两头窄、中间宽——
     ① 贴边的那层接触影，上下两端淡掉（只在中段），避免两头反而更深；
     ② 一团椭圆的柔影（::after）：中段向外铺得最宽，往上下两端收窄成尖，中段最浓。
     椭圆的宽度 = 元素宽度（主卡：卡片宽 + 左右各 180px；侧卡：左右各 130px）。主卡与侧卡同一套做法，侧卡整体再乘 .is-side 的不透明度 */
  .stage-shadow::before {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 34%, #000 66%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 34%, #000 66%, transparent 100%);
  }
  .stage-shadow::after {
    content: "";
    position: absolute;
    inset: 0;
    background: radial-gradient(ellipse 50% 50% at 50% 50%,
      rgba(var(--shadow), 0.30) 0%, rgba(var(--shadow), 0.30) 52%,
      rgba(var(--shadow), 0.22) 60%, rgba(var(--shadow), 0.13) 70%,
      rgba(var(--shadow), 0.06) 82%, rgba(var(--shadow), 0.015) 93%, rgba(var(--shadow), 0) 100%);
  }
  :root[data-theme="dark"] .stage-shadow::after {
    background: radial-gradient(ellipse 50% 50% at 50% 50%,
      rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.62) 52%,
      rgba(0, 0, 0, 0.46) 60%, rgba(0, 0, 0, 0.28) 70%,
      rgba(0, 0, 0, 0.12) 82%, rgba(0, 0, 0, 0.03) 93%, rgba(0, 0, 0, 0) 100%);
  }
  body.home.home-carousel.is-settled .stage-shadow.is-on { opacity: 1; }
  body.home.home-carousel.is-settled .stage-shadow.is-side.is-on { opacity: 0.6; } /* 侧卡的投影整体再减弱到 60% */
  /* 侧卡的阴影：在侧卡（z=5）之下、更远的卡片（z=3）之上。侧卡离屏幕更远，阴影不和主卡一个样式——
     更宽、更柔、更淡：大模糊半径 + 低透明度，几乎没有近处的接触影，远近关系才拉得开 */
  .stage-shadow.is-side { z-index: 4; opacity: 0; }
  .stage-shadow.is-side::after {
    background: radial-gradient(ellipse 50% 50% at 50% 50%,
      rgba(var(--shadow), 0.17) 0%, rgba(var(--shadow), 0.17) 54%,
      rgba(var(--shadow), 0.12) 62%, rgba(var(--shadow), 0.07) 72%,
      rgba(var(--shadow), 0.03) 84%, rgba(var(--shadow), 0.008) 94%, rgba(var(--shadow), 0) 100%);
  }
  :root[data-theme="dark"] .stage-shadow.is-side::after {
    background: radial-gradient(ellipse 50% 50% at 50% 50%,
      rgba(0, 0, 0, 0.36) 0%, rgba(0, 0, 0, 0.36) 54%,
      rgba(0, 0, 0, 0.26) 62%, rgba(0, 0, 0, 0.15) 72%,
      rgba(0, 0, 0, 0.06) 84%, rgba(0, 0, 0, 0.015) 94%, rgba(0, 0, 0, 0) 100%);
  }
  .stage-shadow.is-side::before {
    inset: 0 131px;
    box-shadow:
      0 6px 24px 0 rgba(var(--shadow), 0.05),
      0 12px 48px 6px rgba(var(--shadow), 0.06),
      0 18px 76px 10px rgba(var(--shadow), 0.05);
  }
  :root[data-theme="dark"] .stage-shadow.is-side::before {
    box-shadow:
      0 6px 24px 0 rgba(0, 0, 0, 0.11),
      0 12px 48px 6px rgba(0, 0, 0, 0.13),
      0 18px 76px 10px rgba(0, 0, 0, 0.11);
  }
  body.home.home-carousel.is-leaving .stage-shadow,
  .menu-open .stage-shadow,
  html.snow-on .stage-shadow,
  html[data-enter] .stage-shadow,
  html[data-intro] .stage-shadow { opacity: 0 !important; transition: opacity 0.25s ease; }

  /* 图 1 & 滚动中左右信息栏：左（年份、名称、类型，滚动时常驻并随 pos 上下滚轮切换）、右（简介，停稳后淡入） */
  .stage-info-left,
  .stage-info-right {
    position: fixed;
    top: calc(var(--header-h) + (100vh - var(--header-h) - var(--footer-h)) / 2);
    z-index: 11;
    width: clamp(112px, calc(15vw - var(--gutter) - 18px), 220px);
    pointer-events: none;
  }
  .stage-info-left {
    left: var(--gutter);
    width: clamp(128px, calc(15vw - var(--gutter) - 14px), 224px);
    height: 240px;
    overflow: hidden;
    contain: layout style;
    text-align: left;
    opacity: 1;
    transform: translateY(-50%);
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 82%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 18%, #000 82%, transparent 100%);
    transition: opacity 0.35s var(--ease), filter 0.35s var(--ease);
  }
  .stage-info-left .si-slide {
    position: absolute;
    left: 0;
    right: 0;
    top: 50%;
    will-change: transform, opacity;
  }
  .stage-info-left .si-year {
    opacity: 0;
    filter: blur(4px);
    transition: opacity 0.25s ease, filter 0.28s ease;
  }
  body.home.home-carousel.is-settled .stage-info-left .si-year {
    opacity: 0.82;
    filter: blur(0);
    transition: opacity 0.45s var(--ease) 0.08s, filter 0.5s var(--ease-out) 0.08s;
  }
  .stage-info-right {
    right: clamp(18px, 1.8vw, 28px);
    width: clamp(118px, calc(15vw - clamp(18px, 1.8vw, 28px) - 28px), 210px);
    text-align: left;
    opacity: 0;
    filter: blur(5px);
    transform: translateY(calc(-50% + 10px));
    transition: opacity 0.45s var(--ease), filter 0.5s var(--ease-out), transform 0.55s var(--ease-out);
  }
  body.home.home-carousel.is-settled .stage-info-right {
    opacity: 1;
    filter: blur(0);
    transform: translateY(-50%);
    transition-delay: 0.08s;
  }
  body.home.home-carousel.is-leaving .stage-info-left,
  body.home.home-carousel.is-leaving .stage-info-right,
  .menu-open .stage-info-left,
  .menu-open .stage-info-right,
  html.snow-on .stage-info-left,
  html.snow-on .stage-info-right,
  html[data-enter] .stage-info-left,
  html[data-enter] .stage-info-right,
  html[data-intro] .stage-info-left,
  html[data-intro] .stage-info-right {
    opacity: 0 !important;
    filter: blur(6px);
    transition: opacity 0.28s ease, filter 0.28s ease;
    transition-delay: 0s !important;
  }
  /* 进入动画收尾（html.intro-tail，约 1.8 秒）：左右信息栏不再用切换卡片时的快速淡入，
     改为跟着主卡展开、由糊变清并从下方升到位——先左栏，再右栏（「进入」按钮最后，见下方） */
  html[data-intro] .stage-info-left,
  html[data-intro] .stage-info-right { translate: 0 14px; }
  html.intro-tail .stage-info-left {
    transition: opacity 0.9s var(--ease-out) 0.15s, filter 1s var(--ease-out) 0.15s, translate 1.1s var(--ease-out) 0.15s;
  }
  html.intro-tail body.home.home-carousel.is-settled .stage-info-right {
    transition: opacity 0.9s var(--ease-out), filter 1s var(--ease-out), transform 1.1s var(--ease-out), translate 1.1s var(--ease-out);
    transition-delay: 0.4s;
  }
  .si-num {
    margin: 0 0 10px;
    font-family: var(--font-switzer);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.14em;
    line-height: 1.3;
    color: var(--fg-muted);
    font-variant-numeric: tabular-nums;
  }
  .si-year {
    margin: 0;
    font-family: var(--font-switzer);
    font-size: 11px;
    font-weight: 400;
    letter-spacing: 0.04em;
    line-height: 1.4;
    color: var(--fg-muted);
    font-variant-numeric: tabular-nums;
  }
  :root[lang="zh-CN"] .si-year { font-family: var(--font-system); letter-spacing: 0.02em; }
  .si-title {
    margin: 0 0 12px;
    font-family: var(--font-display);
    font-weight: var(--weight-display);
    letter-spacing: -0.025em;
    font-size: clamp(20px, 2.0vw, 30px);
    line-height: 1.1;
    color: var(--fg);
    text-wrap: balance;
  }
  .si-types {
    margin: 0 0 14px;
    padding-bottom: 12px;
    border-bottom: 1px solid var(--line);
    font-family: var(--font-text);
    font-size: 10px;
    font-weight: 500;
    letter-spacing: 0.1em;
    line-height: 1.65;
    color: var(--fg-muted);
  }
  :root[lang="zh-CN"] .si-types { font-family: var(--font-system); letter-spacing: 0.08em; }
  :root[lang="en"] .si-types { text-transform: uppercase; }
  .si-summary {
    margin: 0;
    font-family: var(--font-text);
    font-size: clamp(12.5px, 0.92vw, 13.5px);
    font-weight: 400;
    letter-spacing: -0.005em;
    line-height: 1.62;
    color: var(--gray-7);
    text-wrap: pretty;
    line-break: strict;
    overflow-wrap: break-word;
  }
  :root[lang="zh-CN"] .si-summary {
    font-family: var(--font-system);
    letter-spacing: 0.015em;
    line-height: 1.74;
    word-break: auto-phrase;
    text-wrap: pretty;
  }

  /* 底栏刻度尺：桌面端替换 .card-dots；主轴为对应项目编号，随标尺左右转动 */
  body.home.home-carousel .home-footer .card-dots { display: none; }
  .stage-ruler {
    position: relative;
    justify-self: center;
    width: 228px;
    height: 28px;
    overflow: hidden;
    contain: layout style;
    cursor: grab;
    touch-action: none;
    -webkit-user-select: none;
    user-select: none;
    -webkit-mask-image: linear-gradient(to right, transparent 0%, #000 18%, #000 82%, transparent 100%);
    mask-image: linear-gradient(to right, transparent 0%, #000 18%, #000 82%, transparent 100%);
  }
  .stage-ruler.is-drag { cursor: grabbing; }
  .stage-ruler:focus-visible { outline: 1px solid var(--fg); outline-offset: 4px; border-radius: 3px; }
  .sr-track {
    position: absolute;
    top: 50%;
    left: 50%;
    width: 0;
    height: 0;
    transform: translate3d(0, -50%, 0);
    will-change: transform;
    pointer-events: none;
  }
  .sr-tick {
    position: absolute;
    top: 0;
    width: 1px;
    height: 8px;
    transform: translate(-50%, -50%);
    background: var(--fg);
    opacity: 0.22;
    border-radius: 1px;
    will-change: transform, opacity;
  }
  /* 刻度尺（平面 + 对焦的语言）：编号 / 刻度的大小与明暗随离指针的远近连续变化（脚本逐帧写 transform / opacity），
     选中的编号放大、变粗、换成这张卡片的光色，切换时弹一下（overshoot），指针的上下两小截同时拉长一次 */
  .sr-num {
    position: absolute;
    top: 0;
    transform: translate(-50%, -50%);
    font-family: var(--font-adventor), var(--font-system);
    font-size: 11px;
    font-weight: 500;
    letter-spacing: 0.04em;
    line-height: 1;
    color: var(--fg);
    opacity: 0.3;
    font-variant-numeric: tabular-nums;
    will-change: transform, opacity;
    transition: color 0.35s var(--ease);
  }
  /* 粗体的基线比常规字重高约 1.5px（字体度量不同）：选中项向下补 1.5px，字重切换时数字的上下位置不跳 */
  .sr-num.is-active { font-weight: 700; translate: 0 1.5px; }
  .stage-ruler { height: 36px; }
  .sr-cursor {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 1px;
    height: 34px;
    transform: translate(-50%, -50%);
    background: transparent;
    pointer-events: none;
  }
  .sr-cursor::before,
  .sr-cursor::after {
    content: "";
    position: absolute;
    left: 50%;
    width: 2px;
    height: 5px;
    margin-left: -1px;
    border-radius: 1px;
    background: var(--fg);
    opacity: 0.26; /* 与中间那些小竖线（刻度，常态透明度 0.22 起）同色 */
  }
  .sr-cursor::before { top: 0; }
  .sr-cursor::after { bottom: 0; }

  /* 桌面端进入动画：顶栏 / 底栏显完后，卡片像从远处浮上来——由小、糊、淡到清楚（图 2），停稳进入图 1。
     节奏分三拍（层级 ii-lv0/1/2 由 main.js 按离屏幕中线的远近写在卡片上，含轮播两端的占位卡）：
     主卡先浮现 → 0.42 秒后侧卡从主卡背后向左右移出 → 0.8 秒后边缘卡从侧卡背后移出。
     卡片的图是透明的，所以移出时用 clip-path 把还藏在前一张卡背后的那部分裁掉（裁切线始终停在前一张卡的边上），
     并临时把层级排成 主卡 > 侧卡 > 边缘卡。位移用独立的 translate 属性，不干扰轮播脚本写的 transform。
     主卡对上焦就进入停稳状态（html.intro-tail 接着把侧卡、边缘卡播完） */
  html[data-intro] body.home.home-carousel .projects .project:not(:last-child) {
    background-image: none !important;
  }
  html[data-intro] body.home.home-carousel .projects .project {
    transition: none;
  }
  html[data-intro="load"] body.home.home-carousel .projects .project-media { opacity: 0 !important; } /* !important：压过各种悬停 / 选中时的透明度规则 */
  /* 卡片两侧压边的渐隐层：名字阶段先藏起来（否则屏幕中间会隐约透出卡片的轮廓），对焦时跟图片一起淡入 */
  html[data-intro="load"] body.home.home-carousel .projects .project::before,
  html[data-intro="load"] body.home.home-carousel .projects .project::after { opacity: 0; }

  body.home.home-carousel .projects .project.ii-lv0 { --ii-at: 0s; --ii-len: 1.25s; }
  body.home.home-carousel .projects .project.ii-lv1 { --ii-at: 0.42s; --ii-len: 1.1s; }
  body.home.home-carousel .projects .project.ii-lv2 { --ii-at: 0.8s; --ii-len: 1s; }
  /* 方案 B：整排卡片的大小 / 透明度由 main.js 逐帧写在 .projects 上，模糊通过 --ii-blur 加在每张卡的图片上（见 main.js 的 CARD_INTRO） */
  html[data-intro] body.home.home-carousel .projects .project.ii-b .project-media { filter: blur(var(--ii-blur, 0px)); }
  html:is([data-intro="in"], .intro-tail) body.home.home-carousel .projects .project.intro-on::before,
  html:is([data-intro="in"], .intro-tail) body.home.home-carousel .projects .project.intro-on::after {
    animation: intro-fade var(--ii-len) var(--ease-out) var(--ii-at) both;
  }
  html:is([data-intro="in"], .intro-tail) body.home.home-carousel .projects .project.intro-on .project-media {
    animation: intro-far var(--ii-len) cubic-bezier(0.16, 1, 0.3, 1) var(--ii-at) both;
    will-change: filter, opacity, transform;
  }
  /* 移出：快出、慢慢停稳（与对焦同一时长、同一起点） */
  html:is([data-intro="in"], .intro-tail) body.home.home-carousel .projects .project.ii-from-l {
    animation: intro-out-l var(--ii-len) cubic-bezier(0.22, 1, 0.36, 1) var(--ii-at) both;
  }
  html:is([data-intro="in"], .intro-tail) body.home.home-carousel .projects .project.ii-from-r {
    animation: intro-out-r var(--ii-len) cubic-bezier(0.22, 1, 0.36, 1) var(--ii-at) both;
  }
  html:is([data-intro="in"], .intro-tail) body.home.home-carousel .projects .project.ii-lv0 { z-index: 10 !important; }
  html:is([data-intro="in"], .intro-tail) body.home.home-carousel .projects .project.ii-lv1 { z-index: 6 !important; }
  html:is([data-intro="in"], .intro-tail) body.home.home-carousel .projects .project.ii-lv2 { z-index: 4 !important; }
  /* 从远处浮上来：小一圈、很糊、看不见 → 原位、清楚 */
  @keyframes intro-far {
    from { opacity: 0; filter: blur(22px); transform: scale(0.84); }
    45% { opacity: 1; }
  }
  /* ii-from-l：卡片在右侧，从左边那张卡背后向右移出；裁切的左缘随位移同步收回，始终停在前一张卡的右边上。
     外侧和上下多留一圈（负值），边缘卡自带的模糊不会被裁硬 */
  @keyframes intro-out-l {
    from { translate: -100% 0; clip-path: inset(-40px -40px -40px 100%); }
    to { translate: 0 0; clip-path: inset(-40px -40px -40px 0); }
  }
  @keyframes intro-out-r {
    from { translate: 100% 0; clip-path: inset(-40px 100% -40px -40px); }
    to { translate: 0 0; clip-path: inset(-40px 0 -40px -40px); }
  }

  /* 雪室联动：用独立 CSS `scale` 属性退远，保留「两侧先走、中间晚 0.3s」的错拍，不干扰轮播 transform */
  html.snow-live body.home.home-carousel .projects .project {
    scale: 1;
    transform-origin: 0 0; /* 卡片都定在舞台正中的左上角（left/top 50%），原点取 0 0 = 所有卡片和虚影一起朝舞台正中缩，相对位置不变、接缝不会错开 */
    will-change: scale, filter, opacity, transform;
    transition: scale 1.55s cubic-bezier(0.55, 0, 0.1, 1) 0s, /* 缩放所有卡片同时起步（错开只给透明度和对焦）：否则回来时两侧先放大、中间晚一拍，卡片之间会裂开一条缝 */
      filter 1.25s cubic-bezier(0.55, 0, 0.1, 1) var(--sd, 0s),
      opacity 0.8s var(--ease-in-out) var(--sd, 0s) !important;
  }
  html.snow-on body.home.home-carousel .projects .project {
    scale: 0.9;
    transform-origin: 0 0;
    opacity: 0 !important;
    filter: blur(12px) !important;
    transition: scale 1.5s cubic-bezier(0.7, 0, 0.25, 1) 0s,
      filter 1.3s cubic-bezier(0.7, 0, 0.25, 1) calc(var(--sd, 0s) + 0.12s),
      opacity 1.05s var(--ease-in-out) calc(var(--sd, 0s) + 0.3s) !important;
  }
}

/* 中等屏（541–900px）：两侧没有放文字的宽度（15% 屏宽不到 140px），改成卡片在上、信息在下——
   舞台让出底部一段（--si-h），左栏（编号 / 名称 / 年份）和右栏（分类 / 简介）并排放在卡片下方 */
@media (min-width: 541px) and (max-width: 900px) {
  body.home.home-carousel { --si-h: clamp(150px, 20vh, 210px); }
  body.home.home-carousel .projects {
    height: calc(100vh - var(--header-h) - var(--footer-h) - var(--si-h));
    height: calc(100svh - var(--header-h) - var(--footer-h) - var(--si-h));
    min-height: 320px;
    margin-bottom: var(--si-h); /* 让出的这段放信息栏，底栏仍在屏幕最下沿 */
  }
  .stage-info-left,
  .stage-info-right {
    top: calc(100vh - var(--footer-h) - var(--si-h) / 2);
    top: calc(100svh - var(--footer-h) - var(--si-h) / 2);
  }
  .stage-info-left { left: var(--gutter); width: calc(40vw - var(--gutter)); }
  .stage-info-right { left: 44vw; right: var(--gutter); width: auto; }
}

/* 选中卡片中下方的「进入」按钮（脚本生成，只在新版轮播里）：停稳后淡入。
   默认材质与移动端章节胶囊一致（半透明语义色 + 轻背景模糊 + 极淡描边 + 两层柔和阴影），颜色取 --bg / --fg，深浅主题自动相反；
   反色是平面的（没有高光 / 渐变）；空间感只来自对焦（模糊→清晰）、远近（放大 / 投影）和前后（球影），见 CLAUDE.md「主美术方向」。 */
.stage-open { display: none; }
@media (min-width: 541px) {
  .stage-open {
    /* 静止 / 抬起两档阴影（按压动画在两档之间过渡）：近处一圈接触影，中间一层，远处一层大而虚 */
    --so-rest:
      0 2px 8px rgba(var(--shadow), 0.10),
      0 14px 34px -10px rgba(var(--shadow), 0.30);
    --so-lift:
      0 2px 4px rgba(var(--shadow), 0.18),
      0 14px 24px -4px rgba(var(--shadow), 0.26),
      0 34px 56px -14px rgba(var(--shadow), 0.46);
    position: fixed;
    left: 50%;
    bottom: calc(var(--footer-h) + clamp(49px, 6.9vh, 77px));
    z-index: 12;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 92px;
    height: 42px;
    padding: 0 28px;
    border-radius: 999px;
    border: 0;
    background: color-mix(in srgb, var(--bg) 58%, transparent); /* 默认材质：与移动端章节胶囊（.cs-dock-pill）一致 */
    color: var(--fg);
    -webkit-backdrop-filter: blur(4px) saturate(130%);
    backdrop-filter: blur(4px) saturate(130%);
    box-shadow: var(--so-rest);
    font-family: var(--font-switzer);
    font-size: 12px;
    font-weight: 500;
    letter-spacing: 0.04em;
    -webkit-font-smoothing: antialiased;
    line-height: 1;
    white-space: nowrap;
    text-decoration: none;
    cursor: var(--cur-tap);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transform: translate(-50%, 8px);
    transition: opacity 0.35s var(--ease), transform 0.45s var(--ease-out), visibility 0s 0.35s;
  }
  :root[lang="zh-CN"] .stage-open { font-family: var(--font-system); letter-spacing: 0.3em; text-indent: 0.3em; }
  body.home.home-carousel.is-settled .stage-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    transform: translate(-50%, 0);
    transition-delay: 0.25s, 0.25s, 0s;
  }
  body.home.home-carousel.is-leaving .stage-open,
  .menu-open .stage-open,
  html.snow-on .stage-open,
  html[data-enter] .stage-open,
  html[data-intro] .stage-open { opacity: 0 !important; visibility: hidden; pointer-events: none; transition-delay: 0s !important; }
  /* 进入动画收尾：「进入」按钮在两侧信息之后、从更低处慢慢升上来 */
  html[data-intro] .stage-open { transform: translate(-50%, 18px); }
  html.intro-tail body.home.home-carousel.is-settled .stage-open {
    transition: opacity 0.8s var(--ease-out), transform 1s var(--ease-out), visibility 0s;
    transition-delay: 0.7s, 0.7s, 0s;
  }

  /* 悬停：按钮是一面有厚度的磨砂玻璃，背后藏着一个柔软的球——
     ① 球先在玻璃后面浮出一团模糊的影子，玻璃被顶得微微鼓起（放大 + 投影抬高）；
     ② 球碰到玻璃正中并继续施压：接触面从中心向四周扩散，反色（连同文字）带着柔和的边缘铺开，
        离玻璃越近越清晰——一开始是糊的，压实了才变锐利；同时带出一道水纹；
     ③ 完全贴合后，玻璃回落到原本的大小。移开时反色向中心收回，重新变糊。
     反色用玻璃层里的一份反色文字副本 + 渐变遮罩实现；放大用独立的 scale 属性，不与居中用的 transform 冲突 */
  .stage-open { outline: 0; }
  .stage-open .so-back,
  .stage-open .so-glass { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
  .stage-open .so-label { position: relative; z-index: 1; }
  .stage-open .so-glass { z-index: 2; }
  /* 玻璃后面的球：一团模糊的影子 */
  .stage-open .so-ball {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 30px;
    height: 30px;
    margin: -15px 0 0 -15px;
    border-radius: 50%;
    background: var(--fg);
    filter: blur(11px);
    opacity: 0;
    scale: 0.4;
    transition: opacity 0.24s var(--ease), scale 0.32s var(--ease);
  }
  .stage-open:hover .so-ball,
  .stage-open:focus-visible .so-ball {
    opacity: 0.5;
    scale: 1.5;
    transition: opacity 0.2s var(--ease) 0.016s, scale 0.36s cubic-bezier(0.22, 0.72, 0.18, 1);
  }
  /* 反色层：用放大的圆形渐变遮罩露出，边缘是柔和的；起步带模糊，随扩散变清晰 */
  .stage-open .so-fill {
    position: absolute;
    inset: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--open-fg, var(--bg));
    background: var(--open-ac, var(--fg)); /* 反色保持平面：不加高光、渐变、体积感；颜色是主卡的特殊色（脚本写入 --open-ac），没有时回退到 --fg */
    -webkit-mask-image: radial-gradient(circle closest-side, #000 52%, transparent 100%);
    mask-image: radial-gradient(circle closest-side, #000 52%, transparent 100%);
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: 50% 50%;
    mask-position: 50% 50%;
    -webkit-mask-size: 0 0;
    mask-size: 0 0;
    filter: blur(5px);
    transition: -webkit-mask-size 0.4s cubic-bezier(0.55, 0, 0.3, 1), mask-size 0.4s cubic-bezier(0.55, 0, 0.3, 1), filter 0.4s ease; /* 收回：略快 */
  }
  .stage-open:hover .so-fill,
  .stage-open:focus-visible .so-fill {
    -webkit-mask-size: 200px 200px;
    mask-size: 200px 200px;
    filter: blur(0);
    transition: -webkit-mask-size 0.72s cubic-bezier(0.22, 0.72, 0.18, 1) 0.096s, mask-size 0.72s cubic-bezier(0.22, 0.72, 0.18, 1) 0.096s, filter 0.56s ease 0.16s; /* 球碰到玻璃后才开始扩散，起步慢、随后越压越开 */
  }
  .stage-open .so-ring {
    position: absolute;
    left: 50%;
    top: 50%;
    width: 36px;
    height: 36px;
    margin: -18px 0 0 -18px;
    border-radius: 50%;
    border: 1px solid color-mix(in srgb, var(--open-ac, var(--fg)) 85%, transparent); /* 涟漪取与悬停色相同的颜色 */
    filter: blur(0.6px);
    opacity: 0;
    scale: 0.2;
  }
  /* 描边（与章节胶囊相同的极淡一圈）画在最上层：反色层和扫过时的中间状态都盖不住它 */
  .stage-open .so-glass::after {
    content: "";
    position: absolute;
    inset: 0;
    border-radius: inherit;
    box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 10%, transparent);
  }
  .stage-open.is-press { animation: so-press 0.8s linear both; }
  .stage-open.is-ripple .so-ring { animation: so-ring 0.6s cubic-bezier(0.2, 0.6, 0.3, 1) both; } /* 水纹只在停留片刻后才出现，快速扫过不触发 */
  @keyframes so-press {
    0%   { scale: 1;    box-shadow: var(--so-rest); animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1); }
    28%  { scale: 1.09; box-shadow: var(--so-lift); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); }
    100% { scale: 1;    box-shadow: var(--so-rest); }
  }
  @keyframes so-ring {
    0%   { scale: 0.2; opacity: 0; }
    14%  { opacity: 0.7; }
    100% { scale: 3.8; opacity: 0; }
  }
}
@media (min-width: 541px) and (max-width: 900px) {
  .stage-open { bottom: calc(var(--footer-h) + var(--si-h, 0px) + clamp(45px, 5.9vh, 67px)); }
}
@supports not ((backdrop-filter: blur(1px)) or (-webkit-backdrop-filter: blur(1px))) {
  .stage-open { background: color-mix(in srgb, var(--bg) 88%, transparent); }
}
@media (prefers-reduced-motion: reduce) {
  .stage-open, .stage-open .so-fill, .stage-open .so-ball { transition: none !important; }
  .stage-open.is-press, .stage-open.is-ripple .so-ring { animation: none !important; }
}

.img-pblur { display: none; }

@media (prefers-reduced-motion: reduce) {
  .hn-link,
  .hn-sub,
  .hn-sub a,
  .hn-sub a > span[lang],
  .stage-info-left,
  .stage-info-right,
  .stage-shadow,
  body.home.home-carousel .project-media .img-hover {
    transition: none !important;
  }
  .hn-sub a { filter: none !important; translate: none !important; scale: none !important; }
}

/* =========================================================
   顶栏文字：更克制的字体与间距，当前项不再用下划线，只靠字重 + 明暗（顶栏里不留下划线）
   · 英文导航用标题字体（TeX Gyre Adventor）；中文仍用系统字体
   · 当前项：粗 + 全亮；其余：常规 + 淡显；悬停只提亮
   ========================================================= */
@media (min-width: 901px) {
  .header-nav { gap: 34px; }
  :root[lang="zh-CN"] .header-nav { gap: 30px; }
  .hn-link,
  :root[lang="en"] .hn-link,
  :root[lang="zh-CN"] .hn-link {
    padding: 4px 0;
    font-size: 13px;
    font-weight: 400;
    line-height: 1.2;
    opacity: 0.64;
    background-image: none;
    transition: opacity 0.3s var(--ease), color 0.3s var(--ease);
  }
  :root[lang="en"] .hn-link { font-family: var(--font-display); letter-spacing: 0.01em; }
  :root[lang="zh-CN"] .hn-link { font-family: var(--font-system); letter-spacing: 0.08em; }
  .hn-link:hover,
  .hn-link:focus-visible,
  .hn-has-sub:hover > .hn-link,
  .hn-has-sub:focus-within > .hn-link { opacity: 0.85; background-size: 0 0; }
  .hn-link[aria-current="page"],
  :root[lang="en"] .hn-link[aria-current="page"],
  :root[lang="zh-CN"] .hn-link[aria-current="page"] { opacity: 1; font-weight: 700; background-size: 0 0; }
  :root[lang="zh-CN"] .hn-link[aria-current="page"] { font-weight: 600; }
}
/* 语言切换：当前语言 粗 + 全亮，另一个常规 + 淡显，无下划线 */
.site-header .lang-toggle [data-code],
:root[lang="zh-CN"] .site-header .lang-toggle [data-code="zh-CN"],
:root[lang="en"] .site-header .lang-toggle [data-code="en"] {
  background-image: none;
  background-size: 0 0;
  text-decoration: none;
  padding: 8px 3px;
  margin: 0 3px;
}
.site-header .lang-toggle [data-code] { font-weight: 400; color: var(--fg); opacity: 0.64; transition: opacity 0.3s var(--ease); }
.site-header .lang-toggle [data-code="en"] { font-family: var(--font-display); letter-spacing: 0.02em; }
.site-header .lang-toggle [data-code]:hover { opacity: 0.85; }
:root[lang="zh-CN"] .site-header .lang-toggle [data-code="zh-CN"],
:root[lang="en"] .site-header .lang-toggle [data-code="en"] { opacity: 1; font-weight: 700; color: var(--fg); }
:root[lang="zh-CN"] .site-header .lang-toggle [data-code="zh-CN"] { font-weight: 600; }
.site-header .lang-toggle .sep { color: var(--fg); opacity: 0.2; }

/* 顶栏对齐与署名字体：粗 / 常规两档字重的字体度量不同，导航项按文字基线对齐；署名（Hi Seth / Qihao Shu）改用标题字体 */
@media (min-width: 901px) {
  .header-nav { align-items: baseline; }
  .hn-item { display: flex; align-items: baseline; }
  .hn-link { display: block; line-height: 1.2; }
}
.brand { font-family: var(--font-display); letter-spacing: -0.01em; }

/* 中文界面里，署名、EN 仍用英文标题字体（中文字形回退到系统字体） */
.brand,
.site-header .lang-toggle [data-code="en"] { font-family: var(--font-adventor), var(--font-system); }
:root[lang="zh-CN"] .brand { font-family: var(--font-adventor), var(--font-system); }

/* 右侧信息栏（桌面 / 中等屏的新版轮播）：分类标签与分割线
   · 分割线：边缘卡显现后，原来的 --line 太淡，改为取 --fg 的 20%，深浅模式自动相反；
   · 分类标签：一枚枚平面小标签——细描边（--fg 24%）、4px 小圆角、等高、横向排开自动换行；
     字小而紧，英文全大写加宽字距、中文用系统字体；不加底色 / 高光，保持平面。 */
@media (min-width: 541px) {
  .si-types {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding-bottom: 16px;
    margin-bottom: 16px;
    border-bottom-color: color-mix(in srgb, var(--fg) 20%, transparent);
  }
  .si-tag {
    display: inline-flex;
    align-items: center;
    height: 22px;
    padding: 0 8px;
    border: 1px solid color-mix(in srgb, var(--fg) 24%, transparent);
    border-radius: 4px;
    font-size: 10.5px;
    font-weight: 500;
    letter-spacing: 0.08em;
    line-height: 1;
    white-space: nowrap;
    color: var(--fg);
    opacity: 0.82;
  }
  :root[lang="en"] .si-tag { letter-spacing: 0.1em; text-transform: uppercase; font-size: 9.5px; }
}

/* 顶栏选中状态的底部描边加回来，但很淡（当前项文字色的约 30%）：导航「首页 / 个人」与语言切换；字重 + 明暗的标记仍然保留 */
@media (min-width: 901px) {
  .hn-link[aria-current="page"],
  :root[lang="en"] .hn-link[aria-current="page"],
  :root[lang="zh-CN"] .hn-link[aria-current="page"] {
    background-image: linear-gradient(color-mix(in srgb, currentColor 30%, transparent), color-mix(in srgb, currentColor 30%, transparent));
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 100% 1px;
  }
}
:root[lang="zh-CN"] .site-header .lang-toggle [data-code="zh-CN"],
:root[lang="en"] .site-header .lang-toggle [data-code="en"] {
  background-image: linear-gradient(color-mix(in srgb, currentColor 30%, transparent), color-mix(in srgb, currentColor 30%, transparent));
  background-repeat: no-repeat;
  background-position: 0 100%;
  background-size: 100% 1px;
}

/* 顶栏描边对齐：语言切换的文字框与导航项取同样的高度（23.6px），描边落在同一水平线上（≥901px） */
@media (min-width: 901px) {
  .site-header .lang-toggle { align-items: center; padding: 0; }
  .site-header .lang-toggle [data-code],
  :root[lang="zh-CN"] .site-header .lang-toggle [data-code="zh-CN"],
  :root[lang="en"] .site-header .lang-toggle [data-code="en"] {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    height: 23.6px;
    padding: 4px 3px;
    line-height: 15.6px;
  }
  .site-header .lang-toggle .sep { line-height: 15.6px; }
}

/* 顶栏悬停：底部描边从左往右展开（与当前项的描边同一颜色 / 粗细：悬停项整体有 0.85 的不透明度，所以线取 35.3%，叠出来与当前项 30% 的线等色）；移开时往回收。当前项的描边常驻 */
@media (min-width: 901px) {
  .site-header .hn-link,
  :root[lang="en"] .site-header .hn-link,
  :root[lang="zh-CN"] .site-header .hn-link {
    background-image: linear-gradient(color-mix(in srgb, currentColor 35.3%, transparent), color-mix(in srgb, currentColor 35.3%, transparent));
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0 1px;
    transition: opacity 0.3s var(--ease), color 0.3s var(--ease), background-size 0.4s var(--ease);
  }
  :root[lang] .site-header .hn-link:hover,
  :root[lang] .site-header .hn-link:focus-visible,
  :root[lang] .site-header .hn-has-sub:hover > .hn-link,
  :root[lang] .site-header .hn-has-sub:focus-within > .hn-link { background-size: 100% 1px; }
  .site-header .hn-link[aria-current="page"],
  :root[lang="en"] .site-header .hn-link[aria-current="page"],
  :root[lang="zh-CN"] .site-header .hn-link[aria-current="page"] { background-size: 100% 1px; background-image: linear-gradient(color-mix(in srgb, currentColor 30%, transparent), color-mix(in srgb, currentColor 30%, transparent)); }
  .site-header .lang-toggle [data-code] {
    background-image: linear-gradient(color-mix(in srgb, currentColor 35.3%, transparent), color-mix(in srgb, currentColor 35.3%, transparent));
    background-repeat: no-repeat;
    background-position: 0 100%;
    background-size: 0 1px;
    transition: opacity 0.3s var(--ease), background-size 0.4s var(--ease);
  }
  .site-header .lang-toggle [data-code]:hover,
  .site-header .lang-toggle [data-code]:focus-visible { background-size: 100% 1px; }
  :root[lang="zh-CN"] .site-header .lang-toggle [data-code="zh-CN"],
  :root[lang="en"] .site-header .lang-toggle [data-code="en"] { background-size: 100% 1px; }
}
@media (prefers-reduced-motion: reduce) {
  .site-header .hn-link, .site-header .lang-toggle [data-code] { transition: opacity 0.01s, color 0.01s !important; }
}

/* 顶栏导航：每项取同样的盒子高度（23.6px），描边（盒子底边）才在同一水平线；文字基线的差异（英文标题字体粗 / 常规两档字体度量不同）用上下内边距单独补偿 */
@media (min-width: 901px) {
  .header-nav { align-items: center; }
  .hn-item { align-items: center; }
  .site-header .hn-link,
  :root[lang="en"] .site-header .hn-link,
  :root[lang="zh-CN"] .site-header .hn-link {
    box-sizing: border-box;
    display: flex;
    align-items: center;
    height: 23.6px;
    padding: 4px 0;
    line-height: 15.6px;
  }
}
@media (min-width: 901px) {
  /* 英文：粗体当前项的基线比常规项高约 2px，向下补 2px（盒子高度不变，描边仍在同一水平线） */
  :root[lang="en"] .site-header .hn-link[aria-current="page"] { padding: 4px 0 0; }
}

/* 项目大标题、标题数字与装饰性数字：固定用英文标题字体（TeX Gyre Adventor），中文界面也一样（汉字字形回退到系统字体） */
.si-title, .project-title, .cs-title, .cs-adj-name, .cs-next-title,
.index, .si-num, .cs-num, .cs-stat-num, .cs-card-num, .enter-head,
:root[lang="zh-CN"] .si-title, :root[lang="zh-CN"] .project-title, :root[lang="zh-CN"] .cs-title, :root[lang="zh-CN"] .cs-adj-name,
:root[lang="zh-CN"] .cs-next-title, :root[lang="zh-CN"] .index, :root[lang="zh-CN"] .si-num, :root[lang="zh-CN"] .cs-num,
:root[lang="zh-CN"] .cs-stat-num, :root[lang="zh-CN"] .cs-card-num, :root[lang="zh-CN"] .enter-head {
  font-family: var(--font-adventor), var(--font-system);
}

/* 首页左侧信息栏的年份（含「更新于 2026」里的数字）：数字用英文标题字体，汉字回退到系统字体 */
.si-year,
:root[lang="zh-CN"] .si-year { font-family: var(--font-adventor), var(--font-system); }

/* 滚动时的卡片投影（.stage-shadow.is-scroll，脚本按卡片逐张生成并随卡片移动）：
   物理推演——滚动时卡片在运动中、离「画面」更远，投影应比停稳时（卡片贴近我们）更宽、更柔、更淡：
   半影随卡片离承影面的距离变大而变宽，同时因为扩散而变浅，也没有贴边的接触影。
   性能：只用一团椭圆渐变（几乎不占重绘），不用大半径 box-shadow；位置用 transform，尺寸只在变化时写；不透明度逐帧由脚本按离中心的远近写入 */
@media (min-width: 541px) {
  .stage-shadow.is-scroll {
    display: none; /* 暂时关闭（见 main.js 的 SCROLL_SHADOWS_ON） */
    left: 0; top: 0;
    z-index: 2;
    transition: none;
    contain: paint;
    will-change: transform, opacity;
    transform-origin: 50% 50%;
    -webkit-mask-image: none;
    mask-image: none; /* 椭圆的上下两端本来就收成尖，不再套遮罩（少一层离屏合成） */
  }
  .stage-shadow.is-scroll::before { display: none; }
  .stage-shadow.is-scroll::after {
    inset: 0;
    background: radial-gradient(ellipse 50% 50% at 50% 50%,
      rgba(var(--shadow), 0.30) 0%, rgba(var(--shadow), 0.30) 46%,
      rgba(var(--shadow), 0.22) 55%, rgba(var(--shadow), 0.13) 66%,
      rgba(var(--shadow), 0.06) 80%, rgba(var(--shadow), 0.015) 92%, rgba(var(--shadow), 0) 100%);
  }
  :root[data-theme="dark"] .stage-shadow.is-scroll::after {
    background: radial-gradient(ellipse 50% 50% at 50% 50%,
      rgba(0, 0, 0, 0.62) 0%, rgba(0, 0, 0, 0.62) 46%,
      rgba(0, 0, 0, 0.46) 55%, rgba(0, 0, 0, 0.28) 66%,
      rgba(0, 0, 0, 0.12) 80%, rgba(0, 0, 0, 0.03) 92%, rgba(0, 0, 0, 0) 100%);
  }
}

/* 右下角时钟的数字：同样固定英文标题字体 */
.footer-clock .fc-face,
.footer-clock .fc-face * { font-family: var(--font-adventor), var(--font-system); }

/* 顶栏的选中 / 悬停描边：宽度收窄到与文字一致——
   · 语言切换两侧原有的 3px 内边距改成外边距（描边不再伸出文字）；
   · 字距会在最后一个字后面多留一份空隙，描边扣掉这一份（--ul-trim） */
@media (min-width: 901px) {
  .site-header .lang-toggle [data-code],
  :root[lang="zh-CN"] .site-header .lang-toggle [data-code="zh-CN"],
  :root[lang="en"] .site-header .lang-toggle [data-code="en"] { padding: 4px 0; margin: 0 3px; }
  :root[lang="zh-CN"] .site-header .hn-link { --ul-trim: 0.08em; }
  :root[lang="en"] .site-header .hn-link { --ul-trim: 0.01em; }
  :root[lang="zh-CN"] .site-header .lang-toggle [data-code] { --ul-trim: 0.04em; }
  :root[lang="en"] .site-header .lang-toggle [data-code] { --ul-trim: 0.02em; }
  :root[lang] .site-header .hn-link:hover,
  :root[lang] .site-header .hn-link:focus-visible,
  :root[lang] .site-header .hn-has-sub:hover > .hn-link,
  :root[lang] .site-header .hn-has-sub:focus-within > .hn-link,
  .site-header .hn-link[aria-current="page"],
  :root[lang="en"] .site-header .hn-link[aria-current="page"],
  :root[lang="zh-CN"] .site-header .hn-link[aria-current="page"],
  .site-header .lang-toggle [data-code]:hover,
  .site-header .lang-toggle [data-code]:focus-visible,
  :root[lang="zh-CN"] .site-header .lang-toggle [data-code="zh-CN"],
  :root[lang="en"] .site-header .lang-toggle [data-code="en"] { background-size: calc(100% - var(--ul-trim, 0px)) 1px; }
}

/* 停稳时的主卡投影加强（仅主卡；侧卡与滚动时的投影不变）：贴边接触影多保留一些高度、整体更浓，椭圆柔影的峰值也提高 */
@media (min-width: 541px) {
  .stage-shadow:not(.is-side):not(.is-scroll)::before {
    -webkit-mask-image: linear-gradient(to bottom, transparent 0%, #000 24%, #000 76%, transparent 100%);
    mask-image: linear-gradient(to bottom, transparent 0%, #000 24%, #000 76%, transparent 100%);
    box-shadow:
      0 4px 14px rgba(var(--shadow), 0.2),
      0 16px 40px rgba(var(--shadow), 0.28),
      0 34px 90px rgba(var(--shadow), 0.34);
  }
  :root[data-theme="dark"] .stage-shadow:not(.is-side):not(.is-scroll)::before {
    box-shadow:
      0 4px 14px rgba(0, 0, 0, 0.5),
      0 18px 46px rgba(0, 0, 0, 0.64),
      0 40px 100px rgba(0, 0, 0, 0.78);
  }
  .stage-shadow:not(.is-side):not(.is-scroll)::after {
    background: radial-gradient(ellipse 50% 50% at 50% 50%,
      rgba(var(--shadow), 0.42) 0%, rgba(var(--shadow), 0.42) 52%,
      rgba(var(--shadow), 0.31) 60%, rgba(var(--shadow), 0.19) 70%,
      rgba(var(--shadow), 0.09) 82%, rgba(var(--shadow), 0.025) 93%, rgba(var(--shadow), 0) 100%);
  }
  :root[data-theme="dark"] .stage-shadow:not(.is-side):not(.is-scroll)::after {
    background: radial-gradient(ellipse 50% 50% at 50% 50%,
      rgba(0, 0, 0, 0.8) 0%, rgba(0, 0, 0, 0.8) 52%,
      rgba(0, 0, 0, 0.6) 60%, rgba(0, 0, 0, 0.38) 70%,
      rgba(0, 0, 0, 0.17) 82%, rgba(0, 0, 0, 0.05) 93%, rgba(0, 0, 0, 0) 100%);
  }
}

/* 滚动投影与侧卡投影只落在卡片「外面」：把卡片所占的那一块从投影元素里抠掉（evenodd 裁切，两侧留白宽度与脚本里的 SCROLL_PAD / SIDE_PAD 一致），
   否则投影会透过半透明的卡片，把卡片里的图片整个压暗 */
@media (min-width: 541px) {
  .stage-shadow.is-scroll {
    clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0,
      170px 0, 170px 100%, calc(100% - 170px) 100%, calc(100% - 170px) 0, 170px 0);
  }
  .stage-shadow.is-side {
    clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0,
      130px 0, 130px 100%, calc(100% - 130px) 100%, calc(100% - 130px) 0, 130px 0);
  }
}

/* 停稳展开时的掉帧：主卡 / 侧卡的投影元素固定大小，位置与大小的变化只走 transform（脚本里 placeShadow / placeSideShadow）。
   主卡投影也只落在卡片外面（抠掉卡片所占的一块，左右各 180px）：展开过程中卡片的画面还没铺满时，不会再透出投影、在卡片内侧出现黑边 */
@media (min-width: 541px) {
  .stage-shadow:not(.is-scroll) { left: 0; top: 0; transform-origin: 50% 50%; will-change: transform, opacity; }
  .stage-shadow:not(.is-side):not(.is-scroll) {
    clip-path: polygon(evenodd, 0 0, 100% 0, 100% 100%, 0 100%, 0 0,
      180px 0, 180px 100%, calc(100% - 180px) 100%, calc(100% - 180px) 0, 180px 0);
  }
  /* 「进入」按钮的背景模糊会跟着下面不断变化的卡片逐帧重算：展开进行到一半时出现（延迟 0.35s） */
  body.home.home-carousel.is-settled .stage-open { transition-delay: 0.35s, 0.35s, 0s; }
}

/* 滚动时不显示任何投影：停稳才淡入，一开始滚动就立刻收掉（不再留 0.55s 的淡出尾巴） */
@media (min-width: 541px) {
  .stage-shadow:not(.is-on):not(.is-scroll) { transition: none; opacity: 0.001; } /* 0.001：肉眼不可见，但图层一直是栅格化好的（见 main.js prepShadows） */
}

/* 旧版首页（四列平铺）封存：轮播启用之前（data-boot，由 index.html 首帧前加上、main.js 撤掉）不显示卡片区与底栏 */
html[data-boot] body.home:not(.home-carousel) .projects,
html[data-boot] body.home:not(.home-carousel) .home-footer { visibility: hidden; }

/* =========================================================
   升级 2026-11 · 内容页开篇的对焦（2026-12）
   封面（标题、副标题、项目信息）随页面往下滚退到远处：慢慢糊掉、变淡、略微缩小；
   导语第一段（引言）滚进来时由糊变清。用滚动驱动的动画，不支持的浏览器（如 Firefox）保持静止；
   减少动态效果时不做
   ========================================================= */
@supports (animation-timeline: scroll()) {
  @media (prefers-reduced-motion: no-preference) {
    /* 封面（标题、副标题、项目信息）不再单独糊退：它现在是盖在大图上的玻璃，由 .cs-opening 的进度控制（见文件末尾「概述 B 方案」） */
    .cs-lede > p:first-child {
      animation: cs-lede-focus linear both;
      animation-timeline: view();
      animation-range: entry 10% entry 100%;
    }
  }
}
@keyframes cs-cover-recede {
  to { filter: blur(10px); opacity: 0.2; transform: scale(0.97); }
}
@keyframes cs-lede-focus {
  from { filter: blur(8px); opacity: 0.25; transform: translateY(16px); }
  to { filter: none; opacity: 1; transform: none; }
}


/* ---------- 升级 2026-12-02：新版轮播首页 ↔ 雪室的过场衔接 ----------
   原先进入雪室时轮播会把中间那张从展开状态弹簧收回（宽度、位置一帧帧变），卡片同时各自朝自己中心缩，
   相邻的卡片就错开、露出接缝；左右信息栏、进入按钮、阴影一下就消失。现在：
   · 轮播的布局整段冻结（main.js setSettled 在 snow-live 期间不动），只做和旧版一样的「整体朝正中退远 + 对焦 + 淡出」；
   · 信息栏、进入按钮、阴影跟着卡片一起慢慢糊掉；回来时等卡片基本到位（snow-live 撤掉）再依次淡回 */
@media (min-width: 541px) {
  html.snow-on .stage-info-left,
  html.snow-on .stage-info-right,
  html.snow-on .stage-open {
    opacity: 0 !important;
    filter: blur(10px);
    scale: 0.94;
    pointer-events: none;
    transition: opacity 0.75s var(--ease-in-out), filter 0.9s var(--ease-in-out), scale 1.1s var(--ease-in-out) !important;
    transition-delay: 0s !important;
  }
  html.snow-on .stage-open { visibility: visible; }
  /* 回来：卡片开始往回走时信息栏与按钮还藏着（回到 is-settled 的常态之前先等一等），卡片快到位时才由糊变清升回来 */
  html.snow-live:not(.snow-on) .stage-info-left,
  html.snow-live:not(.snow-on) .stage-info-right,
  html.snow-live:not(.snow-on) .stage-open {
    transition: opacity 0.8s var(--ease-out) 1.25s, filter 0.9s var(--ease-out) 1.25s, scale 1s var(--ease-out) 1.25s !important;
    transition-delay: 1.25s !important;
  }
  html.snow-on .stage-shadow { transition: opacity 1s var(--ease-in-out) 0.2s !important; }
  html.snow-live:not(.snow-on) .stage-shadow { transition: opacity 0.9s var(--ease-out) 1.3s !important; }
}
@media (prefers-reduced-motion: reduce) {
  html.snow-on .stage-info-left,
  html.snow-on .stage-info-right,
  html.snow-on .stage-open { filter: none; scale: 1; transition: opacity 0.3s ease !important; }
}

/* ---------- 顶栏 Index 左侧的图标（2026-12）：平时是「三条横线」（Index 下拉里还有项目 / 折叠章节）；
   不在首页时，悬停 Index，三条横线向上滚出、一枚「返回」箭头从下方滚入，提示此时点 Index 可以回到首页（离开时反向滚回）。
   用遮罩画（不改各页标记）：两枚图标叠在同一个 16px 的遮罩里，靠移动 mask-position 滚动，颜色、淡显都跟着文字走 ---------- */
@media (min-width: 901px) {
  .hn-has-sub > .hn-link::before {
    content: "";
    display: inline-block;
    width: 16px; height: 16px;
    flex: none;
    margin-right: 6px;
    background: currentColor;
    --hn-ico-menu: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M3.5,17.63v-1.5h17v1.5H3.5Zm0-4.88v-1.5h17v1.5H3.5Zm0-4.88V6.37h17v1.5H3.5Z'/%3E%3C/svg%3E");
    --hn-ico-back: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cg transform='matrix(-1 0 0 1 24 0)'%3E%3Cpath d='M15.85,16.65L14.78,15.6l4.6-4.6l-4.6-4.6l1.07-1.05L21.5,11l-5.65,5.65ZM2.5,18.5V15q0-1.97 1.39-3.36t3.36-1.39h6.82L10.22,6.4l1.07-1.05L16.94,11l-5.65,5.65L10.22,15.6l3.85-3.85H7.25q-1.35,0-2.3,0.95T4,15v3.5H2.5Z'/%3E%3C/g%3E%3C/svg%3E");
    -webkit-mask-image: var(--hn-ico-menu), var(--hn-ico-back);
    mask-image: var(--hn-ico-menu), var(--hn-ico-back);
    -webkit-mask-size: 16px 16px;
    mask-size: 16px 16px;
    -webkit-mask-repeat: no-repeat;
    mask-repeat: no-repeat;
    -webkit-mask-position: 0 0, 0 18px;
    mask-position: 0 0, 0 18px;
    transition: -webkit-mask-position 0.45s cubic-bezier(0.65, 0, 0.35, 1), mask-position 0.45s cubic-bezier(0.65, 0, 0.35, 1);
  }
  body:not(.home) .hn-has-sub:hover > .hn-link::before,
  body:not(.home) .hn-has-sub:focus-within > .hn-link::before {
    -webkit-mask-position: 0 -18px, 0 0;
    mask-position: 0 -18px, 0 0;
  }
}
@media (min-width: 901px) and (prefers-reduced-motion: reduce) {
  .hn-has-sub > .hn-link::before { transition: none; }
}
@media (min-width: 901px) {
  /* 描边从图标右边开始，只划在文字下面：起点右移 22px（图标 16 + 间距 6），长度里同样扣掉 */
  :root[lang] .site-header .hn-has-sub > .hn-link { background-position: 22px 100%; }
  :root[lang="zh-CN"] .site-header .hn-has-sub > .hn-link { --ul-trim: calc(0.08em + 22px); }
  :root[lang="en"] .site-header .hn-has-sub > .hn-link { --ul-trim: calc(0.01em + 22px); }
}
@media (min-width: 901px) {
  /* 图标按文字字形（大写字母 / 汉字）的视觉中心对齐，而不是按含下划线留白的整个盒子：略上移 */
  :root[lang="en"] .hn-has-sub > .hn-link::before { transform: translateY(1px); } /* 未选中：文字比选中状态高 2px，图标补回去，高度始终以选中状态为准 */
  :root[lang="en"] .hn-has-sub > .hn-link[aria-current="page"]::before { transform: translateY(-1px); }
  :root[lang="zh-CN"] .hn-has-sub > .hn-link::before { transform: translateY(-0.5px); }
}
@media (min-width: 901px) {
  /* 顶栏 Index / About 的点击范围只往下多 6px（与下拉菜单衔接），鼠标停在下划线上也能点到 */
  .site-header .hn-link { position: relative; }
  .site-header .hn-link::after { content: ""; position: absolute; inset: 0 0 -6px 0; }
}

/* ---------- 概述改进 2026-12-02（impeccable critique：F1 F2 F3 F5 F7） ----------
   F1 开篇大图的视频还没缓冲好时，画框不再是一整块空白：一道很淡的光带慢慢扫过，表示在加载（视频出现后自然消失）
   F2 项目信息（年份 / 角色 / 领域 / 状态）的标签从 9px 提到 11px、颜色加深
   F3 标题区下方的留白收紧（四个项目共用同一条公式，副标题和项目信息仍在同一高度）
   F5 导语最后一段（说明项目是什么）和第一段一样用正文色；「视频见 YouTube」做成一枚平的玻璃胶囊
   F7 导语上下的间距收紧，通栏大图更早进入视野 */
.media-frame.is-video:not(.has-video)::after {
  content: "";
  position: absolute; inset: 0;
  background: linear-gradient(100deg, transparent 35%, color-mix(in srgb, var(--fg) 6%, transparent) 50%, transparent 65%);
  background-size: 300% 100%;
  animation: cs-frame-wait 1.8s var(--ease-in-out) infinite;
  pointer-events: none;
}
@keyframes cs-frame-wait { from { background-position: 100% 0; } to { background-position: 0 0; } }
@media (prefers-reduced-motion: reduce) {
  .media-frame.is-video:not(.has-video)::after { animation: none; background: color-mix(in srgb, var(--fg) 3%, transparent); }
}

.cs-meta dt { font-size: 11px; color: var(--gray-6); }

@media (min-width: 901px) {
  .cs-cover {
    grid-template-rows: minmax(calc(clamp(40px, 8vh, 112px) + 2 * var(--cs-t-lh) * var(--cs-t) + clamp(40px, 6.4vw, 96px)), auto) auto;
  }
  .cs-title { margin-bottom: 60px; } /* 原 100px：标题在收紧后的标题区里仍然居中 */
}
.cs-lede { margin-top: clamp(80px, 9vw, 144px); } /* 信息栏与导语之间要有明显的呼吸 */
.cs-intro > :last-child { margin-bottom: clamp(32px, 4vw, 56px); }

.cs-lede p:nth-child(n+2):last-child { color: var(--fg); }
/* 说明文字：纯文字注脚，不做胶囊 / 阴影 / 悬停 / 箭头，避免被误认成可点击的按钮 */
.cs-intro .cs-note {
  justify-self: stretch;
  width: auto;
  max-width: none;
  margin-top: calc(clamp(36px, 3.6vw, 56px) - 1em); /* 上一段自带 1em 下边距；合计 = 第一段与后续段落的间距 */
  padding: 2px 0 2px 14px;
  text-wrap: pretty;
  border-left: 1px solid var(--line);
  color: var(--gray-5);
  background: none;
  box-shadow: none;
  -webkit-backdrop-filter: none;
  backdrop-filter: none;
  cursor: text;
}
.cs-intro .cs-note::before { content: none; }
.cs-intro .cs-note a { text-decoration: underline; color: inherit; }

/* 孤字：项目信息的内容折行时均衡各行（不会末行只剩一个字）；导语 / 说明末行至少两个字以上 */
.cs-meta dd { text-wrap: balance; }
.cs-lede p { text-wrap: pretty; }

/* 项目信息：每一行之间加一道极淡的分割线（与顶上那道线同色），四项一眼分得开 */
@media (min-width: 901px) {
  .cs-meta { gap: 0; padding-top: 0; }
  .cs-meta > div { padding: 14px 0; }
  .cs-meta > div:first-child { padding-top: 20px; }
  .cs-meta > div + div { border-top: 1px solid var(--line); }
}
@media (max-width: 900px) {
  .cs-meta { gap: 0 var(--cs-gap); }
  .cs-meta > div { padding: 14px 0; border-top: 1px solid var(--line); }
}

/* =========================================================
   概述 2026-12-02（定稿）：标题和项目信息直接接在开篇大图上方，不叠放、不固定、不做滚动对焦
   结构：.cs-intro > .cs-opening > .cs-opening-stage > 封面（.cs-cover：01 概述、大标题、观点句、横排四项项目信息）
         + 大图（.cs-hero）；之后是 .cs-intro-body（导语）
   （曾试过「玻璃封面盖在大图上、滚动对焦」的方案，已取消）
   ========================================================= */
.cs-intro { max-width: none; margin: 0; padding: 0; display: block; }
.cs-intro > :last-child { margin-bottom: 0; }
.cs-intro-body {
  max-width: var(--cs-max);
  margin: 0 auto;
  padding: 0 var(--gutter);
  display: grid;
  grid-template-columns: repeat(var(--cs-cols), 1fr);
  column-gap: var(--cs-gap);
}
.cs-intro-body > :last-child { margin-bottom: clamp(32px, 4vw, 56px); }
.cs-opening .cs-hero figcaption { display: none; }
.cs-opening-stage { display: flex; flex-direction: column; }
/* 视频还没缓冲好时先放封面图（它就是视频第 0 帧），视频出来后在它上面淡入，接缝看不出 */
.cs-opening .media-frame.is-video img { visibility: visible; }
.cs-opening .media-frame.is-video.is-loaded .media-ph { display: none; }

@media (min-width: 901px) {
  .cs-opening .cs-cover {
    display: flex; flex-direction: column;
    width: 100%; max-width: var(--cs-max); margin: 0 auto;
    padding: 24px var(--gutter) 0;
  }
  .cs-opening .cs-intro-rail { position: static; margin: 0; grid-column: auto; grid-row: auto; flex: none; border-top: 0; }
  .has-cs-index .cs-opening .cs-intro-rail.is-indexed > * { visibility: visible; } /* 章节导航在大图上方时是隐藏的，封面自己显示「01 概述」 */
  .cs-opening .cs-title {
    margin: clamp(20px, 3vw, 48px) 0 0; flex: none; align-self: flex-start;
    font-size: calc(var(--cs-t) * var(--cs-t-scale, 1));
  }
  .cs-opening .cs-subtitle {
    grid-column: auto; grid-row: auto; flex: none;
    margin: clamp(10px, 1.4vw, 22px) 0 0; padding: 0; border-top: 0;
    font-size: clamp(22px, 2.6vw, 42px); line-height: 1.25; color: var(--fg);
  }
  .cs-opening .cs-meta {
    grid-column: auto; grid-row: auto; flex: none; align-self: stretch;
    margin: clamp(28px, 3vw, 48px) 0 0; padding: 0;
    display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 0;
    border-top: 1px solid var(--line);
  }
  .cs-opening .cs-meta > div {
    display: block; padding: 16px clamp(12px, 1.4vw, 24px) 0 0;
    border-top: 0;
  }
  .cs-opening .cs-meta > div + div { padding-left: clamp(12px, 1.4vw, 24px); border-left: 1px solid var(--line); }
  .cs-opening .cs-meta dt { margin: 0 0 8px; }
  .cs-opening .cs-hero { margin: clamp(32px, 4vw, 64px) 0 0; }
  .cs-lede { margin-top: clamp(56px, 6vw, 96px); }
}

@media (max-width: 900px) {
  .cs-intro-body { grid-template-columns: 1fr; }
  .cs-intro-body > * { grid-column: 1 / -1; }
  .cs-opening { padding: 0 var(--gutter); }
  .cs-opening .cs-hero { margin: 32px calc(-1 * var(--gutter)) 0; }
  .cs-lede { margin-top: 40px; }
}

/* 概述封面（桌面）：去掉信息栏顶上的横线，各块之间的间距加大，更宽松 */
@media (min-width: 901px) {
  .cs-opening .cs-cover { padding-top: clamp(32px, 4vw, 64px); }
  .cs-opening .cs-title { margin-top: clamp(32px, 5vw, 80px); }
  .cs-opening .cs-subtitle { margin-top: clamp(24px, 3vw, 48px); }
  .cs-opening .cs-meta { margin-top: clamp(48px, 5.5vw, 88px); border-top: 0; }
  .cs-opening .cs-meta > div { padding-top: 4px; padding-bottom: 4px; }
  .cs-opening .cs-hero { margin-top: clamp(56px, 6vw, 96px); }
}

/* 概述封面大标题加粗（试）：大标题现在用的 TeX Gyre Adventor Bold（700）已经是已加载字体里最粗的一档，
   没有更粗的字重可选，所以先用描边把笔画加粗一点点（0.02em），看效果；更粗要另加字体文件 */
.cs-opening .cs-title { -webkit-text-stroke: 0.02em currentColor; paint-order: stroke fill; }

/* Silent Support 的封面大标题排成一行（桌面）：一行宽约 6.5 倍字号，字号随屏宽（12vw）走，放得进内容宽度；≤900px 字号按手机算，仍然排两行 */
@media (min-width: 901px) {
  .cs-main[data-project="silent-support"] .cs-opening .cs-title { width: auto; white-space: nowrap; }
}

/* Silent Support 一行标题的字号：按内容宽度算，一行占约 92%（字面宽约 6.53 倍字号），比 12vw 大一圈，和 Win-Win / Sealbox 的大标题分量更接近；
   各块之间的间距四个项目本来就一致（只有字号不同） */
@media (min-width: 901px) {
  .cs-main[data-project="silent-support"] .cs-opening .cs-title {
    font-size: calc((min(100vw, 1440px) - 2 * var(--gutter)) * 0.92 / 6.53);
  }
}

/* ---------- 从卡片进入后，升到完整内容页的顶栏（2026-12，换思路）----------
   不再靠脚本在滚动中切换顶栏的底色（快速上下滑时来不及切）。升到完整页后顶栏始终是渐变模糊玻璃；
   内容页自己在顶上多带一条顶栏高度的页面底色白条，贴在内容页上沿之上、随内容页一起滚动：
   内容页贴着顶栏时，顶栏后面就是这条白条（看起来纯色）；内容页往下滚、与顶栏分开时白条跟着滚走，
   玻璃后面是正文。往回滚到页顶，白条又跟着内容页回来，没有任何时间差 */
html[data-enter].enter-full .cs-main::before {
  content: "";
  position: absolute;
  left: 0; right: 0;
  top: calc(var(--header-h) * -1 - 2px);
  height: calc(var(--header-h) + 3px); /* 上下各多 1–2px，盖住亚像素缝（否则顶栏下沿会漏出一丝大图的颜色） */
  background: var(--bg);
  pointer-events: none;
}

/* ---------- 页尾 cs-footer ---------- */
/* 一个巨大的 Seth：上面纯黑、清晰，往下越来越糊、越来越淡，到底部几乎看不见；其余项目、首页 / 个人、联系方式放在它渐隐的下半部。
   虚化直接作用在字上（不是在字前面盖一层玻璃）：同一个词叠 5 层，每层模糊程度不同、各自只露出一条高度带，
   合起来是「近处对焦、远处失焦」。5 层都用 --fg 填色，深浅模式自动翻转。 */
.cs-footer {
  --csf-edge: calc(max(0px, (100vw - 1440px) / 2) + var(--gutter));
  position: relative;
  z-index: 2; /* 与展开进入时的 main 同层（高于 body 的大图与渐变），否则从卡片进来时大图和渐变会盖在页尾上 */
  isolation: isolate;
  overflow: hidden;
  container-type: inline-size;
  display: flex;
  flex-direction: column;
  /* 与上方内容的间距做在页尾自己的上内边距里（不用外边距）：从卡片进来的内容页后面有一张固定的大图，
     外边距那一段是透明的，大图会从那里透出来；放进页尾里，就被页尾的底色盖住 */
  --csf-gap: calc(clamp(112px, 13vw, 184px) * 1.6); /* 章节间距（--cs-section-space 只在内容区里有定义，这里写死）再放大 */
  min-height: calc(100vh + var(--csf-gap));
  min-height: calc(100svh + var(--csf-gap)); /* 间距之后，页尾正好一屏 */
  padding: calc(var(--csf-gap) + 5cqw) var(--csf-edge) 0; /* 顶部留白：字形上沿比行高高出一截，别被 overflow 削平 */
  background: var(--bg);
  color: var(--fg);
}
.cs-footer a, .cs-footer button { color: inherit; text-decoration: none; font: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
.cs-footer ul { list-style: none; margin: 0; padding: 0; }
.cs-footer a:focus-visible, .cs-footer button:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; border-radius: 4px; }

.csf-mark {
  position: relative;
  /* 盒子向左右各越过屏幕边 8cqw：模糊的光晕和遮罩的边都落在屏幕外，屏幕两侧不会出现竖向的断边 */
  margin: auto calc(var(--csf-edge) * -1 - 8cqw) 0; /* 多出来的高度留在字的上方 */
  font-family: var(--font-adventor);
  font-weight: 700;
  letter-spacing: -0.045em;
  line-height: 0.8;
  font-size: 51vw;
  font-size: 53cqw;
  text-align: center;
  white-space: nowrap;
  user-select: none; -webkit-user-select: none;
  pointer-events: none;
  /* 整体再往下淡出，最底部几乎不可见 */
  -webkit-mask-image: linear-gradient(#000 0%, #000 22%, rgba(0, 0, 0, 0.7) 48%, rgba(0, 0, 0, 0.22) 72%, transparent 92%);
  mask-image: linear-gradient(#000 0%, #000 22%, rgba(0, 0, 0, 0.7) 48%, rgba(0, 0, 0, 0.22) 72%, transparent 92%);
}
/* 7 层叠字，最清晰的在最上面。每层「从某个高度起完全不透明（直到被上一层盖住）」，上一层则在下一层起点之后渐隐：
   字的内部任何高度都至少被一层完全盖住，层与层交接处不会出现变淡的条纹；字的边缘随高度逐层变糊 */
.csf-l { display: block; position: absolute; inset: 0; padding-top: 0.12em; color: var(--fg); } /* 字顶比行高略高：每层自己留出空间，免得被渐变遮罩削平 */
.csf-l.l0 { position: relative; }
.csf-l.l0 { z-index: 10; -webkit-mask-image: linear-gradient(#000 0%, #000 16%, transparent 30%); mask-image: linear-gradient(#000 0%, #000 16%, transparent 30%); }
.csf-l.l1 { z-index: 9; filter: blur(calc(0.15 * var(--csf-bk, 1) * 1cqw)); -webkit-mask-image: linear-gradient(transparent 2%, #000 16%, #000 28%, transparent 42%); mask-image: linear-gradient(transparent 2%, #000 16%, #000 28%, transparent 42%); }
.csf-l.l2 { z-index: 8; filter: blur(calc(0.4 * var(--csf-bk, 1) * 1cqw)); -webkit-mask-image: linear-gradient(transparent 14%, #000 28%, #000 40%, transparent 54%); mask-image: linear-gradient(transparent 14%, #000 28%, #000 40%, transparent 54%); }
.csf-l.l3 { z-index: 7; filter: blur(calc(0.8 * var(--csf-bk, 1) * 1cqw)); -webkit-mask-image: linear-gradient(transparent 26%, #000 40%, #000 52%, transparent 66%); mask-image: linear-gradient(transparent 26%, #000 40%, #000 52%, transparent 66%); }
.csf-l.l4 { z-index: 6; filter: blur(calc(1.4 * var(--csf-bk, 1) * 1cqw)); -webkit-mask-image: linear-gradient(transparent 38%, #000 52%, #000 64%, transparent 78%); mask-image: linear-gradient(transparent 38%, #000 52%, #000 64%, transparent 78%); }
.csf-l.l5 { z-index: 5; filter: blur(calc(2.2 * var(--csf-bk, 1) * 1cqw)); -webkit-mask-image: linear-gradient(transparent 50%, #000 64%, #000 76%, transparent 90%); mask-image: linear-gradient(transparent 50%, #000 64%, #000 76%, transparent 90%); }
.csf-l.l6 { z-index: 4; filter: blur(calc(3.4 * var(--csf-bk, 1) * 1cqw)); -webkit-mask-image: linear-gradient(transparent 62%, #000 76%); mask-image: linear-gradient(transparent 62%, #000 76%); }
/* 滚到面前时整体由糊变清（先全部失焦，再对上焦） */
.cs-footer.is-armed .csf-mark { filter: blur(1.6cqw); opacity: 0.4; transform: translateY(4%); }
.cs-footer.is-in .csf-mark { filter: none; opacity: 1; transform: none; transition: filter 1.3s var(--ease-out), opacity 1s var(--ease-out), transform 1.5s var(--ease-out); }

/* 信息：压在巨字渐隐的下半部，三栏对齐页面左右边 */
.csf-info {
  position: relative; z-index: 1;
  margin-top: -9cqw;
  display: grid; grid-template-columns: 1.6fr 0.9fr 1.3fr; /* 项目栏宽一些，给右边的类型小字留位置 */ gap: clamp(28px, 4vw, 72px);
}
.csf-h { margin: 0 0 clamp(14px, 1.6vw, 22px); font-family: var(--font-text); font-size: 11px; font-weight: 500; line-height: 1.4; letter-spacing: 0.14em; text-transform: uppercase; color: var(--fg-muted); } /* 与内容页左栏的分类小字（.cs-eyebrow）同一规格：比内容小，但够清楚 */
.csf-proj {
  display: flex; align-items: baseline; gap: 14px; padding: 7px 0;
  font-family: var(--font-display); font-weight: var(--weight-display); letter-spacing: var(--tracking-display);
  font-size: clamp(22px, 2.2vw, 36px); line-height: 1.15;
  transition: opacity 0.4s var(--ease), filter 0.4s var(--ease);
}
.csf-proj small { font-family: var(--font-text); font-weight: 500; font-size: 11px; letter-spacing: 0.08em; color: var(--fg-muted); min-width: 2.6em; font-variant-numeric: tabular-nums; }
.csf-arr { display: inline-flex; align-self: center; opacity: 0; transform: translateX(-8px); transition: opacity 0.35s var(--ease), transform 0.5s var(--ease-out); font-family: var(--font-text); font-size: 0.7em; }
.csf-arr svg { display: block; width: 1.5em; height: 1.5em; }
/* 领英的外链箭头：与个人页 .ab-arr 同一个箭头图形（Material 的 north_east），悬停时从左滑出 */
.csf-arr.csf-ext { display: inline-flex; width: 18px; height: 18px; margin-left: -4px; font-size: inherit; }
.csf-ext svg { display: block; width: 18px; height: 18px; }
.csf-proj:hover .csf-arr, .csf-proj:focus-visible .csf-arr, .csf-link:hover .csf-arr, .csf-link:focus-visible .csf-arr { opacity: 1; transform: none; }
/* 悬停项目：项目名右边浮现项目类型的小字（浅色；先失焦再对上焦）。放不下时用省略号，不挤到旁边的栏 */
.csf-projects li { display: flex; align-items: baseline; gap: 14px; }
.csf-projects .csf-proj { flex: none; }
.csf-type {
  min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-family: var(--font-text); font-weight: 500; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase;
  color: color-mix(in srgb, var(--fg) 45%, transparent);
  opacity: 0; filter: blur(4px); transform: translateX(-8px);
  transition: opacity 0.35s var(--ease), filter 0.5s var(--ease-out), transform 0.6s var(--ease-out);
  pointer-events: none;
}
@media (hover: hover) {
  .csf-projects li:hover .csf-type { opacity: 1; filter: none; transform: none; }
}
/* 没有悬停的设备（手机、平板）：项目类型的淡字默认就显示 */
@media (hover: none), (max-width: 900px) { .csf-type { opacity: 1; filter: none; transform: none; } }
/* 手机：与桌面悬停时同样的样子——项目名后面是箭头和类型淡字（项目页页尾的项目链接才有箭头） */
@media (hover: none), (max-width: 900px) {
  .csf-projects .csf-arr { opacity: 1; transform: none; }
}
@media (prefers-reduced-motion: reduce) { .csf-type { filter: none; transform: none; } }
/* 悬停一项，其余的退远（变淡、微糊），它自己留在焦点里 */
@media (hover: hover) { .csf-info ul:hover > li:not(:hover) .csf-proj { opacity: 0.38; filter: blur(1.2px); } }
.csf-mail, .csf-link { display: flex; align-items: center; gap: 12px; width: max-content; max-width: 100%; text-align: left; padding: 7px 0; font-family: var(--font-display); font-weight: var(--weight-display); letter-spacing: var(--tracking-display); font-size: clamp(20px, 1.9vw, 30px); line-height: 1.25; overflow-wrap: anywhere; transition: color 0.3s var(--ease); }
.csf-mail:hover, .csf-mail:focus-visible, .csf-link:hover, .csf-link:focus-visible { color: var(--accent); }
/* 图标与页头「Hi Seth」悬停里的联系方式同一套：邮件 → 悬停换成复制 → 复制后换成对勾 */
.csf-icon { position: relative; display: grid; width: 18px; height: 18px; overflow: hidden; flex: none; }
.csf-i { display: block; grid-area: 1 / 1; width: 18px; height: 18px; transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1); }
.csf-i svg { display: block; width: 100%; height: 100%; }
.csf-i-copy, .csf-i-check { transform: translateY(110%); }
.csf-mail:hover .csf-i-mail, .csf-mail:focus-visible .csf-i-mail { transform: translateY(-110%); }
.csf-mail:hover .csf-i-copy, .csf-mail:focus-visible .csf-i-copy { transform: none; }
.csf-mail.is-copied .csf-i-mail, .csf-mail.is-copied .csf-i-copy { transform: translateY(-110%); }
.csf-mail.is-copied .csf-i-check { transform: none; }
.csf-mail.is-copied { color: var(--accent); }
.csf-done { display: none; font-family: var(--font-text); font-weight: 500; font-size: 11px; letter-spacing: 0.1em; text-transform: uppercase; }
.csf-mail.is-copied .csf-done { display: inline; }

/* 底栏 */
.csf-bar { position: relative; z-index: 1; display: flex; align-items: center; justify-content: space-between; gap: 16px; margin-top: clamp(36px, 4vw, 64px); padding: 18px 0 22px; border-top: 1px solid var(--line); font-size: 12px; letter-spacing: 0.04em; color: var(--fg-muted); }
.csf-top { display: inline-flex; align-items: center; gap: 12px; color: var(--fg); }
.csf-top-btn { display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 16%, transparent); transition: transform 0.5s var(--ease-out), background 0.4s var(--ease), color 0.4s var(--ease); }
.csf-top-btn svg { width: 20px; height: 20px; }
.csf-top:hover .csf-top-btn, .csf-top:focus-visible .csf-top-btn { transform: translateY(-3px); background: var(--fg); color: var(--bg); }

@media (max-width: 900px) {
  /* 手机 / 平板：顶部加分割线；信息在上，巨字挪到最底部（更大、左右几乎贴着屏幕边），再往下才是版权与回到顶部 */
  /* 分割线与章节标题上方的线同款（1px --line，左右留出页边距）；它与上一章之间保持章节间距 */
  .cs-footer { --csf-gap: clamp(112px, 13vw, 184px); padding-top: calc(var(--csf-gap) + 16px); } /* 信息自己带上下内边距，这里只留一点，让信息上下的视觉空白相等（巨字顶上本来就带一截空） */
  .cs-footer::before { content: ""; position: absolute; top: var(--csf-gap); left: var(--gutter); right: var(--gutter); height: 1px; background: var(--line); }
  .csf-info { order: 1; grid-template-columns: 1fr; gap: 36px; margin: auto 0; padding: clamp(32px, 8vw, 64px) 0; } /* 信息在分割线与巨字之间垂直居中：上下空白均分 */
  .cs-footer { --csf-bk: 1.7; } /* 手机上字小，同样的模糊量看着偏弱：放大 */
  .csf-mark { order: 2; margin: 0 calc(var(--csf-edge) * -1 - 8cqw); font-size: 54vw; font-size: 54cqw; }
  .csf-bar { order: 3; margin-top: 0; padding-bottom: calc(22px + env(safe-area-inset-bottom, 0px)); } /* 页尾在屏幕里时章节胶囊已收起，不用再留位置 */
}
@media (prefers-reduced-motion: reduce) {
  .cs-footer *, .cs-footer { transition: none !important; }
  .cs-footer .csf-mark { filter: none !important; opacity: 1 !important; transform: none !important; }
}

/* 从顶栏下拉 / 页尾的项目入口进来：新页开头先是一整面页面底色（接着离场时淡入的那层），再淡去露出整屏大图 */
html[data-enter-veil]::after {
  content: "";
  position: fixed; inset: 0;
  z-index: 18; /* 顶栏（20）之下、其余一切之上 */
  background: var(--bg);
  pointer-events: none;
  animation: enter-veil-out 0.7s cubic-bezier(0.4, 0, 0.2, 1) forwards paused; /* 等大图解码好（main.js 加 data-enter-veil-go）再淡去，不会在白屏上先把动画放完 */
}
html[data-enter-veil-go]::after { animation-play-state: running; }
/* 大图自己放大进场时，垫底只留深色（不然放大前的缩小状态背后会露出一张同样的静态大图） */
html[data-enter-veil] body::before { background: var(--inv-bg); }
@keyframes enter-veil-out { to { opacity: 0; visibility: hidden; } }

/* 刷新（个人页 / 内容页；首页和雪室有自己的刷新动画）：和从菜单进项目页时同一块页面底色幕布，开头整面是底色，再柔和淡去。
   <head> 脚本只在「刷新、且没有入场动画（data-enter）」时加 data-reload-veil；有入场动画的刷新（探出状态还原）走上面的 data-enter-veil */
html[data-reload-veil]::after {
  content: "";
  position: fixed; inset: 0;
  z-index: 18;
  background: var(--bg);
  pointer-events: none;
  animation: enter-veil-out 0.7s cubic-bezier(0.4, 0, 0.2, 1) 0.1s forwards;
}
/* 从手机菜单的项目入口出发：幕布盖过菜单（15）和顶栏（20） */
.page-veil.is-top { z-index: 40; }

@media (prefers-reduced-motion: reduce) {
  .hn-sub .hs-ball, .hn-sub .hs-fill { transition: none !important; }
  .hn-sub a.is-press, .hn-sub a.is-ripple .hs-ring { animation: none !important; }
}

/* =========================================================
   个人页（about.html）· 纯排版的个人介绍
   一整段大字声明（身份 + 观点，观点一句退成浅灰），右边一张小照片与声明顶边对齐，左下是三列安静的小字：经历 / 技能与语言 / 联系。
   没有面板、表格、分割线；层级只靠字号和灰度。照片一次一张，点一下换下一张（新图先糊后清），三张统一过一层「旧胶片」滤镜。
   底栏与首页相同（雪室开关 + 伦敦时间）。
   间距尺子：4 / 8 / 12 / 16 / 24 / 48。正文 13px / 行高 20px；小字 12px；字距只有大字声明有（-0.02em，中文为 0）。
   同一行的第一行文字（各列）落在同一条基线上：标签与内容之间固定 12px，各列内容第一行都是 20px 行高、没有额外内边距。
   ========================================================= */
.ab {
  --ab-s1: 8px; --ab-s2: 16px; --ab-s3: 24px; --ab-s4: 48px; --ab-label-gap: 12px;
  /* 旧胶片：褪一点色、略暖、黑位抬起、略软（颗粒与抬黑见 .ab-frame::before / ::after） */
  --ab-film: sepia(0.1) saturate(0.88) contrast(0.92) brightness(1.03) blur(0.3px);
  min-height: calc(100vh - var(--header-h) - var(--footer-h));
  min-height: calc(100svh - var(--header-h) - var(--footer-h));
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-template-rows: auto 1fr;
  column-gap: calc(var(--gutter) * 0.5);
  padding: clamp(32px, 6vh, 64px) var(--gutter) var(--ab-s3);
  font-size: 13px; line-height: 20px;
}
.ab-head { grid-column: 1 / 10; grid-row: 1; min-width: 0; }
.ab-statement {
  margin: 0;
  font-size: clamp(28px, 3.6vw, 60px); line-height: 1.12; letter-spacing: -0.02em;
  text-wrap: balance;
}
:root[lang="en"] .ab-statement { font-family: var(--font-adventor); }
:root[lang="zh-CN"] .ab-statement { letter-spacing: 0; line-height: 1.3; }
.ab-soft { display: block; color: var(--gray-4); text-wrap: wrap; text-wrap: pretty; } /* pretty：避免最后一行只剩一个孤字（不支持的浏览器退回普通换行） */
.ab-nb { white-space: nowrap; } /* 两个字的词不拆开到两行 */

/* 图集：靠右、与声明顶边对齐的一列。默认三张同大的灰色小图；悬停时最上面一张放大并变彩色、另外两张略缩小，日期显示在每张图下方。
   三张共用同一套「旧胶片」外观（.ab-frame）。容器不占版面高度，放大时不推动别的东西 */
.ab-photo { --ab-ease-in: cubic-bezier(0.3, 0.85, 0.3, 1); /* 缩回去：更短、先快后慢，没有回弹 */ grid-column: 10 / 13; grid-row: 1 / 3; margin: 0; align-self: start; justify-self: end; width: 100%; height: 0; position: relative; --ab-sm: clamp(80px, 11vh, 120px); --ab-big: clamp(150px, 23vh, 230px); --ab-sm2: calc(var(--ab-sm) * 0.72); }
.ab-stack { position: absolute; top: 0; right: 0; display: flex; flex-direction: column; align-items: flex-end; gap: 8px; transition: gap 0.34s var(--ab-ease-in); }
.ab-item { position: relative; width: var(--ab-sm); transition: width 0.34s var(--ab-ease-in); }
/* is-open：鼠标在图集里（脚本加）；is-active：当前悬停 / 聚焦的那一张。顺序固定，哪张被悬停哪张变大 */
.ab-stack.is-open { gap: 24px; transition: gap 0.6s var(--ease); }
.ab-stack.is-open .ab-item { width: var(--ab-sm2); transition: width 0.6s var(--ease); }
.ab-stack.is-open .ab-item.is-active { width: var(--ab-big); }
.ab-frame { --ab-fix: brightness(1); --ab-lift: 0.22; display: block; position: relative; width: 100%; aspect-ratio: 3 / 4; margin: 0; padding: 0; border: 0; background: var(--gray-1); overflow: hidden; cursor: default; isolation: isolate; }
:root[data-theme="dark"] .ab-frame { background: var(--gray-2); }
/* 第 1 张原片本来就偏亮偏暖（傍晚逆光），单独压暗、提一点对比、少抬黑，肤色才不会发白发粉 */
.ab-frame[data-i="0"] { --ab-fix: brightness(0.84) contrast(1.14) saturate(0.96); --ab-lift: 0.06; }
.ab-frame img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; filter: var(--ab-film) var(--ab-fix) grayscale(1); transition: filter 0.6s var(--ease); }
.ab-item.is-active .ab-frame img { filter: var(--ab-film) var(--ab-fix); }
/* 抬黑：用墨色做「滤色」叠一层，最黑的地方不再是纯黑（褪色胶片的特征） */
.ab-frame::before { content: ""; position: absolute; inset: 0; z-index: 1; background: var(--ink); mix-blend-mode: screen; opacity: var(--ab-lift); pointer-events: none; }
/* 颗粒：静态的细噪点，叠加模式 */
.ab-frame::after { content: ""; position: absolute; inset: 0; z-index: 2; pointer-events: none; mix-blend-mode: overlay; opacity: 0.5;
  background-size: 180px 180px;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n' x='0' y='0' width='100%' height='100%'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix type='matrix' values='0 0 0 0 0.5  0 0 0 0 0.5  0 0 0 0 0.5  1.4 1.4 1.4 0 -1.1'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>"); }
.ab-frame:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
/* 日期：每张图下方右对齐的小字，图集展开时显示；压在拉大后的间距里，不改变版面 */
.ab-date { position: absolute; right: 0; top: 100%; margin-top: 4px; font-size: 11px; line-height: 16px; color: var(--fg-muted); font-variant-numeric: tabular-nums; white-space: nowrap; opacity: 0; transition: opacity 0.35s var(--ease); pointer-events: none; }
.ab-stack.is-open .ab-item.is-active .ab-date { opacity: 1; } /* 只有选中的那张显示日期 */
/* 触屏 / 窄屏：没有悬停，图集常驻展开（脚本默认放大第一张），点哪张哪张变大；日期常显 */
@media (max-width: 900px), (hover: none) {
  .ab-photo { --ab-sm: 72px; --ab-big: min(220px, 62vw); --ab-sm2: 84px; height: auto; justify-self: start; width: 100%; margin-bottom: 20px; }
  .ab-stack { position: static; align-items: flex-start; }
  .ab-date { left: 0; right: auto; }
}

/* 三列小字，贴着左下；标签与内容之间固定 12px，各列第一行内容同一条基线 */
.ab-info { grid-column: 1 / 9; grid-row: 2; align-self: end; display: grid; grid-template-columns: 1.5fr 1fr 1fr; column-gap: clamp(16px, 2.4vw, 40px); padding-top: var(--ab-s4); }
.ab-block { min-width: 0; }
.ab-block p { margin: 0; }
.ab-h { margin: 0 0 var(--ab-label-gap); padding-bottom: var(--ab-s1); border-bottom: 1px solid var(--line); font-family: var(--font-text); font-size: 12px; font-weight: 400; line-height: 16px; color: var(--fg-muted); }
.ab-h2 { margin-top: var(--ab-s3); }
.ab-exp ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 12px; }
.ab-exp li + li { padding-top: 12px; border-top: 1px solid var(--line); }
.ab-exp li { display: grid; grid-template-columns: 9.6em minmax(0, 1fr); column-gap: var(--ab-s2); }
.ab-when { color: var(--fg-muted); font-variant-numeric: tabular-nums; white-space: nowrap; }
.ab-what { display: grid; }
.ab-what b { font-weight: 400; }
.ab-org { color: var(--fg-muted); }
.ab-contact { display: grid; align-content: start; justify-items: start; }
.ab-contact > .ab-h { justify-self: stretch; }
.ab-contact > :not(.ab-h) + :not(.ab-h) { margin-top: var(--ab-s1); }
/* 联系：三行的图标位都是 16px 宽，文字起点对齐 */
.ab-status, .ab-mail, .ab-link { display: inline-flex; align-items: center; gap: 8px; max-width: 100%; margin: 0; padding: 0; text-align: left; font-size: 13px; line-height: 20px; }
.ab-status { font-weight: 500; }
.ab-slot { flex: none; width: 16px; height: 16px; display: inline-grid; place-items: center; }
.ab-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--accent); animation: ab-pulse 2.4s var(--ease-out, ease-out) infinite; }
@keyframes ab-pulse { 0% { box-shadow: 0 0 0 0 color-mix(in srgb, var(--accent) 45%, transparent); } 70%, 100% { box-shadow: 0 0 0 8px color-mix(in srgb, var(--accent) 0%, transparent); } }
.ab-mail, .ab-link { position: relative; background: none; border: 0; cursor: pointer; transition: color 0.3s var(--ease); }
.ab-mail::before, .ab-link::before { content: ""; position: absolute; inset: -6px -4px; } /* 可点区域：高度 32px */
.ab-mail:hover, .ab-link:hover, .ab-mail:focus-visible, .ab-link:focus-visible { color: var(--accent); }
.ab-mail:focus-visible, .ab-link:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.ab-mail-text { overflow-wrap: anywhere; }
.ab-ic { position: relative; flex: none; width: 16px; height: 16px; display: inline-block; overflow: hidden; }
.ab-ic svg { display: block; width: 16px; height: 16px; }
.ab-ic-a { position: absolute; inset: 0; }
.ab-arr { display: inline-flex; width: 16px; height: 16px; margin-left: -2px; transition: transform 0.4s var(--ease); }
.ab-arr svg { display: block; width: 16px; height: 16px; }
.ab-link:hover .ab-arr { transform: translate(2px, -2px); }
/* 邮箱：图标与文字的切换沿用顶栏「Hi Seth」的做法——悬停时邮件图标上滚、换成复制图标；点击后换成对勾，邮箱文字上滚、「已复制」从下面滚进来（同一个位置，不换行） */
.ab-ic-roll { display: grid; }
.ab-i { grid-area: 1 / 1; display: block; width: 16px; height: 16px; transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1); }
.ab-i-copy, .ab-i-check { transform: translateY(110%); }
.ab-mail:hover .ab-i-mail, .ab-mail:focus-visible .ab-i-mail { transform: translateY(-110%); }
.ab-mail:hover .ab-i-copy, .ab-mail:focus-visible .ab-i-copy { transform: none; }
.ab-mail.is-copied .ab-i-mail, .ab-mail.is-copied .ab-i-copy { transform: translateY(-110%); }
.ab-mail.is-copied .ab-i-check { transform: none; }
.ab-mask { display: grid; overflow: hidden; }
.ab-mail-text, .ab-mail-done { grid-area: 1 / 1; transition: transform 0.35s cubic-bezier(0.65, 0, 0.35, 1); }
.ab-mail-done { transform: translateY(110%); font-weight: 500; }
.ab-mail.is-copied .ab-mail-text { transform: translateY(-110%); }
.ab-mail.is-copied .ab-mail-done { transform: none; }
.ab-mail.is-copied { color: var(--accent); }
/* 简历：联系栏里的一行，尺度与表格行一致（同样的 13px、同样的 --line 细线），只用网页蓝的字和图标把它从其他行里提出来。
   形状跟着表格走（直边、整栏宽）；悬停动效沿用首页「进入」：球从背后浮出 → 蓝色从中心向两侧扩散（边缘先糊后清）→ 水纹，文字随反色同步翻转 */
.ab-btn {
  position: relative; display: flex; align-items: center; justify-content: space-between; justify-self: stretch;
  height: 40px; margin-top: var(--ab-s2) !important; padding: 0; box-sizing: border-box;
  border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
  color: var(--accent); font-size: 13px; font-weight: 500; line-height: 20px;
  text-decoration: none; white-space: nowrap; cursor: var(--cur-tap, pointer); outline: 0; -webkit-font-smoothing: antialiased;
}
.ab-btn:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ab-btn .ab-btn-label { display: flex; align-items: center; justify-content: flex-start; gap: 8px; width: 100%; }
.ab-btn .ab-ic, .ab-btn .ab-ic svg { width: 16px; height: 16px; }
.ab-btn .ab-ic { overflow: hidden; }
/* 悬停：文档图标的纸面微微抬起，两行字依次擦掉、再从左到右重新写出；移开时纸面落回，字再写一遍（脚本在两个时刻各给一个类）。
   文字逐字向上滚出、同一个字的副本从下方滚入（与导航 / 署名同款，靠 .split-link 的规则），颜色保持网页蓝 */
.ab-btn .ab-ic.ab-doc { overflow: visible; }
.ab-btn .ab-doc-page { transition: transform 0.45s cubic-bezier(0.22, 0.72, 0.18, 1); }
.ab-btn:hover .ab-doc-page, .ab-btn:focus-visible .ab-doc-page { transform: translateY(-1px); }
.ab-btn .ab-doc-ln { transform-box: fill-box; transform-origin: 0 50%; }
.ab-btn.is-write .ab-doc-ln { animation: ab-doc-write 0.7s cubic-bezier(0.45, 0, 0.2, 1) both; }
.ab-btn.is-write .ab-doc-ln2 { animation-delay: 0.14s; }
.ab-btn.is-rewrite .ab-doc-ln { animation: ab-doc-write 0.5s cubic-bezier(0.45, 0, 0.2, 1) both; }
.ab-btn.is-rewrite .ab-doc-ln2 { animation-delay: 0.08s; }
@keyframes ab-doc-write { 0% { transform: scaleX(1); } 32% { transform: scaleX(0); } 100% { transform: scaleX(1); } }
@media (prefers-reduced-motion: reduce) { .ab-btn.is-write .ab-doc-ln, .ab-btn.is-rewrite .ab-doc-ln { animation: none; } .ab-btn .ab-doc-page { transition: none; } .ab-btn:hover .ab-doc-page, .ab-btn:focus-visible .ab-doc-page { transform: none; } }
.ab-copy { margin: var(--ab-s3) 0 0; font-size: 12px; line-height: 16px; color: var(--fg-muted); }

/* 底栏：沿用首页底栏（.home-footer），只有左右两项；边距与页面一致 */
.ab-footer { display: flex; align-items: center; justify-content: space-between; padding: 0 var(--gutter); }
.ab-footer .footer-clock { justify-self: auto; }

/* ≤900：单列——声明、照片、三块小字依次排下来 */
@media (max-width: 900px) {
  .ab { grid-template-columns: minmax(0, 1fr); grid-template-rows: auto; row-gap: var(--ab-s3); padding-top: var(--ab-s3); min-height: 0; }
  .ab-head, .ab-statement, .ab-photo, .ab-info { grid-column: 1; grid-row: auto; }
  .ab-statement { font-size: clamp(26px, 6.4vw, 44px); }
  .ab-info { grid-template-columns: 1fr; row-gap: var(--ab-s3); padding-top: 0; }
  .ab-copy { margin-top: var(--ab-s2); }
  /* 手机 / 平板：照片排成整行宽的一条手风琴——三张并排同高，当前那张占得宽、变彩色，点哪张哪张展开；日期在条下方 */
  .ab-photo { justify-self: stretch; width: 100%; height: auto; margin: 0 0 var(--ab-s3); }
  .ab-stack, .ab-stack.is-open { position: static; flex-direction: row; align-items: stretch; gap: 8px; height: clamp(200px, 62vw, 380px); transition: none; }
  .ab-item, .ab-stack.is-open .ab-item { width: auto; flex: 1 1 0; min-width: 0; transition: flex-grow 0.6s var(--ease); }
  .ab-stack.is-open .ab-item.is-active { width: auto; flex-grow: 2.4; }
  .ab-frame { height: 100%; aspect-ratio: auto; }
  .ab-date { left: 0; right: auto; margin-top: 8px; }
  .ab-photo { padding-bottom: 24px; }
  .ab-photo .ab-stack { margin-bottom: 0; }
}
/* ≤900：按「三屏」设计——
   第一屏：浅灰的观点句贴着顶部，版权小字与照片条收在屏幕最下沿，中间是大片留白；
   第二屏：深色的身份句在顶部，隔开一段是经历；第三屏：技能与语言，再隔开一段是联系。
   板块之间只靠大间隔和一条细线的小标签区分。
   声明里身份句在前、观点句在后；这里让声明、页头、信息区都 display: contents，所有块成为 .ab 网格的直接子项，
   再用 order 重排（观点句 → 版权 → 照片 → 身份句 → 经历 → 技能 → 联系），不动 HTML，桌面版不受影响。 */
@media (max-width: 900px) {
  .ab { padding-top: var(--ab-s3); row-gap: 0; padding-bottom: clamp(96px, 16svh, 160px); } /* 页尾留白，与开头对应 */
  .ab-head, .ab-info, .ab-statement, :root[lang="en"] .ab-statement > span[lang="en"], :root[lang="zh-CN"] .ab-statement > span[lang="zh-CN"] { display: contents; }
  .ab-statement { font-size: clamp(34px, 9.8vw, 58px); line-height: 1.1; letter-spacing: -0.02em; text-wrap: balance; }
  :root[lang="zh-CN"] .ab-statement { font-size: clamp(30px, 8.6vw, 52px); letter-spacing: 0; line-height: 1.3; } /* 中文字宽，略小一号，让「用系统思维、体验逻辑」能排成一行 */
  /* 第一屏：观点句撑满剩余高度（= 一屏 − 顶栏 − 版权 − 照片条），版权与照片条因此落在屏幕最下沿 */
  .ab-soft { order: -3; margin: 0; align-self: start;
    min-height: calc(100vh - var(--header-h) - var(--ab-s3) - clamp(220px, 66vw, 400px) - 24px - 16px - 16px - 8px);
    min-height: calc(100svh - var(--header-h) - var(--ab-s3) - clamp(220px, 66vw, 400px) - 24px - 16px - 16px - 8px); }
  .ab-head .ab-copy { order: -2; margin: 0 0 var(--ab-s2); font-size: 12px; line-height: 16px; letter-spacing: 0; font-family: var(--font-text); }
  .ab-photo { order: -1; margin: 0 0 var(--ab-s3); padding-bottom: 24px; }
  .ab-stack, .ab-stack.is-open { height: clamp(220px, 66vw, 400px); touch-action: pan-y; } /* 竖向照常滚页，横向留给左右滑动切图 */
  .ab-exp { margin-top: clamp(40px, 7svh, 64px); }
  .ab-block:nth-of-type(2) { margin-top: clamp(40px, 6svh, 56px); }
  .ab-contact { margin-top: clamp(40px, 6svh, 56px); }
  .ab-h { margin-bottom: 16px; }
  .ab-h2 { margin-top: 32px; }
}
/* ≤540：经历的日期放到标题上面（一列排），技能与语言并排，联系栏铺满 */
@media (max-width: 540px) {
  .ab { font-size: 15px; line-height: 24px; }
  .ab-exp li { grid-template-columns: 1fr; row-gap: 4px; }
  .ab-exp ul { gap: 20px; }
  .ab-exp li + li { padding-top: 20px; }
  .ab-block > p { line-height: 24px; }
  .ab-mail, .ab-link, .ab-status { min-height: 32px; font-size: 15px; line-height: 24px; }
  .ab-btn { height: 52px; font-size: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  .ab-dot { animation: none; }
  .ab-frame img, .ab-item, .ab-stack, .ab-date, .ab-i, .ab-mail-text, .ab-mail-done { transition: none; }
}


/* 顶栏状态接力（main.js navCarry）：换页后先摆成上一页的样子（不播过渡），再过渡到新状态 */
@media (min-width: 901px) {
  .header-nav.nav-carry .hn-link,
  .header-nav.nav-carry .hn-link::before { transition: none !important; }
  .hn-has-sub.is-carry-hover > .hn-link::before { -webkit-mask-position: 0 -18px, 0 0; mask-position: 0 -18px, 0 0; }
  :root[lang] .site-header .hn-has-sub.is-carry-hover > .hn-link:not([aria-current]) { opacity: 0.9; background-size: calc(100% - var(--ul-trim, 0px)) 1px; }
}

/* ===== 简历浮层（个人页「下载简历」）=====
   页面退到后面：变暗、变糊；简历像从玻璃后的远处浮到中心——由糊变清、由小变大、投影抬高。
   简历跟着鼠标倾斜，表面的光影（高光斑 + 背光侧压暗）随倾斜移动。切换语言时，旧的一张向一侧滑远、失焦，新的一张从另一侧聚焦进来。 */
.cvm { position: fixed; inset: 0; z-index: 400; visibility: hidden; pointer-events: none; transition: visibility 0s linear 0.5s; }
.cvm.is-open { visibility: visible; pointer-events: auto; transition-delay: 0s; }
.cvm[hidden] { display: none; }
.cvm-scrim {
  position: absolute; inset: 0; background: color-mix(in srgb, var(--bg) 52%, transparent);
  -webkit-backdrop-filter: blur(0px); backdrop-filter: blur(0px); opacity: 0;
  transition: opacity 0.5s var(--ease), -webkit-backdrop-filter 0.5s var(--ease), backdrop-filter 0.5s var(--ease);
}
:root[data-theme="dark"] .cvm-scrim { background: color-mix(in srgb, #000 62%, transparent); }
.cvm.is-open .cvm-scrim { opacity: 1; -webkit-backdrop-filter: blur(22px) saturate(0.9); backdrop-filter: blur(22px) saturate(0.9); }
.cvm-stage {
  --cvm-h: min(80vh, calc(100vh - 230px), 118vw);
  position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 36px;
  padding: 16px 16px 16px; box-sizing: border-box;
}
.cvm-stage > * { pointer-events: auto; }
/* 顶部：语言切换（小件玻璃控件，英文在左、中文在右） */
.cvm-tabs {
  position: relative; display: grid; grid-template-columns: 1fr 1fr; padding: 3px; border-radius: 999px; flex: none;
  background: color-mix(in srgb, var(--bg) 40%, transparent); border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); box-shadow: 0 6px 24px rgba(0,0,0,0.10);
  opacity: 0; transform: translateY(-8px); filter: blur(6px); transition: opacity 0.4s var(--ease) 0.08s, transform 0.5s var(--ease-out, var(--ease)) 0.08s, filter 0.4s var(--ease) 0.08s;
}
.cvm-pill { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc(50% - 3px); border-radius: 999px; background: var(--fg); transition: transform 0.45s cubic-bezier(0.22, 0.72, 0.18, 1); }
.cvm[data-lang="zh-CN"] .cvm-pill { transform: translateX(100%); }
.cvm-tab { position: relative; z-index: 1; min-width: 88px; height: 30px; padding: 0 16px; border: 0; background: none; border-radius: 999px; font: inherit; font-size: 13px; font-weight: 500; color: var(--fg-muted); cursor: var(--cur-tap, pointer); transition: color 0.3s var(--ease); outline: 0; }
.cvm-tab[aria-selected="true"] { color: var(--bg); }
.cvm-tab:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
/* 中间：简历 */
.cvm-deck { position: relative; flex: none; height: var(--cvm-h); aspect-ratio: 1600 / 2265; perspective: 1400px; perspective-origin: 50% 50%; }
.cvm-tilt { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateX(calc(var(--ry, 0) * -1deg)) rotateY(calc(var(--rx, 0) * 1deg)); will-change: transform; }
.cvm-sheet {
  position: absolute; inset: 0; border-radius: 3px; overflow: hidden; background: #ececef; user-select: none; -webkit-user-select: none;
  transform: translate3d(0, 28px, -260px) scale(0.9); opacity: 0; filter: blur(16px);
  box-shadow: 0 2px 4px rgba(0,0,0,0.10), 0 10px 22px rgba(0,0,0,0.12), 0 32px 64px rgba(0,0,0,0.18);
  transition: transform 0.7s cubic-bezier(0.22, 0.72, 0.18, 1), opacity 0.5s var(--ease), filter 0.6s var(--ease), box-shadow 0.7s var(--ease);
}
.cvm-sheet img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.cvm.is-open .cvm-sheet.is-current { transform: none; opacity: 1; filter: blur(0); box-shadow: 0 4px 8px rgba(0,0,0,0.10), 0 16px 32px rgba(0,0,0,0.16), 0 48px 96px rgba(0,0,0,0.26); }
/* 没被选中的一张：滑向自己那一侧、退远、失焦、淡出（英文在左、中文在右） */
.cvm.is-open .cvm-sheet.is-left { transform: translate3d(-62%, 0, -380px) rotateY(24deg) scale(0.9); }
.cvm.is-open .cvm-sheet.is-right { transform: translate3d(62%, 0, -380px) rotateY(-24deg) scale(0.9); }
.cvm.is-open .cvm-sheet:not(.is-current) { opacity: 0; filter: blur(14px); transition-duration: 0.6s; }
/* 表面光影：光直接作用在纸面上——亮处整体泛白（文字、线条一起被洗淡，强度随受光变化），背光处被压暗并蒙上一层灰雾（纸面可读性下降）。
   用正常叠色（不是柔光混合），所以亮处真的比纸本来的颜色更亮；浅色模式阴影更淡，深色模式更重 */
.cvm { --cvm-sh-a: 0.20; --cvm-haze-a: 0.38; }
:root[data-theme="dark"] .cvm { --cvm-sh-a: 0.44; --cvm-haze-a: 0.42; }
.cvm-shade, .cvm-glare { position: absolute; inset: 0; pointer-events: none; }
.cvm-shade {
  background:
    linear-gradient(calc(var(--ang, 0) * 1deg), rgba(18,22,34,0) 22%, rgba(18,22,34,calc(var(--dim, 0) * var(--cvm-sh-a))) 100%),
    linear-gradient(calc(var(--ang, 0) * 1deg), rgba(150,156,172,0) 30%, rgba(150,156,172,calc(var(--dim, 0) * var(--cvm-haze-a))) 100%);
}
.cvm-glare { background: radial-gradient(ellipse 90% 80% at var(--mx, 50%) var(--my, 30%), rgba(255,255,255,calc(0.06 + var(--lit, 0) * 0.34 + var(--max, 0) * 0.34)) 0%, rgba(255,255,255,calc(0.03 + var(--lit, 0) * 0.14 + var(--max, 0) * 0.16)) 45%, rgba(255,255,255,0) 100%); } /* 一整片大而柔的环境光，没有焦点 */

/* 底部：下载——沿用首页主卡「进入」按钮的规范：默认是一块磨砂玻璃小胶囊；悬停时背后的球浮出 → 蓝色从中心向两侧扩散（边缘先糊后清、文字同步反色）→ 水纹，同时玻璃微微鼓起 */
.cvm-dl {
  --so-rest: 0 2px 8px rgba(var(--shadow), 0.10), 0 14px 34px -10px rgba(var(--shadow), 0.30);
  --so-lift: 0 2px 4px rgba(var(--shadow), 0.18), 0 14px 24px -4px rgba(var(--shadow), 0.26), 0 34px 56px -14px rgba(var(--shadow), 0.46);
  position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 92px; height: 42px; padding: 0 28px; flex: none; border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 58%, transparent); color: var(--fg); -webkit-backdrop-filter: blur(4px) saturate(130%); backdrop-filter: blur(4px) saturate(130%);
  box-shadow: var(--so-rest); font-family: var(--font-switzer, var(--font-text)); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; line-height: 1; white-space: nowrap; text-decoration: none;
  -webkit-font-smoothing: antialiased; cursor: var(--cur-tap, pointer); outline: 0;
  opacity: 0; transform: translateY(10px); filter: blur(6px); transition: opacity 0.4s var(--ease) 0.16s, transform 0.5s var(--ease-out, var(--ease)) 0.16s, filter 0.4s var(--ease) 0.16s;
}
.cvm[data-lang="zh-CN"] .cvm-dl { font-family: var(--font-system, var(--font-text)); letter-spacing: 0.08em; text-indent: 0.08em; }
/* 下载按钮的文字跟着「正在看的简历」的语言走，而不是网站语言 */
:root[lang] .cvm[data-lang="en"] .cvm-dl [lang="en"], :root[lang] .cvm[data-lang="zh-CN"] .cvm-dl [lang="zh-CN"] { display: inline !important; }
:root[lang] .cvm[data-lang="en"] .cvm-dl [lang="zh-CN"], :root[lang] .cvm[data-lang="zh-CN"] .cvm-dl [lang="en"] { display: none !important; }
.cvm-dl .so-back, .cvm-dl .so-glass { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.cvm-dl .so-glass { z-index: 2; }
.cvm-dl .so-label, .cvm-dl .so-fill { display: flex; align-items: center; justify-content: center; gap: 8px; }
.cvm-dl .so-label { position: relative; z-index: 1; }
.cvm-dl svg { width: 16px; height: 16px; flex: none; }
.cvm-dl .so-ball { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: var(--accent); filter: blur(11px); opacity: 0; scale: 0.4; transition: opacity 0.24s var(--ease), scale 0.32s var(--ease); }
.cvm-dl:hover .so-ball, .cvm-dl:focus-visible .so-ball { opacity: 0.5; scale: 1.5; transition: opacity 0.2s var(--ease) 0.016s, scale 0.36s cubic-bezier(0.22, 0.72, 0.18, 1); }
.cvm-dl .so-fill {
  position: absolute; inset: 0; color: var(--on-accent); background: var(--accent);
  -webkit-mask-image: radial-gradient(circle closest-side, #000 52%, transparent 100%); mask-image: radial-gradient(circle closest-side, #000 52%, transparent 100%);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: 50% 50%; mask-position: 50% 50%; -webkit-mask-size: 0 0; mask-size: 0 0; filter: blur(5px);
  transition: -webkit-mask-size 0.4s cubic-bezier(0.55, 0, 0.3, 1), mask-size 0.4s cubic-bezier(0.55, 0, 0.3, 1), filter 0.4s ease;
}
.cvm-dl:hover .so-fill, .cvm-dl:focus-visible .so-fill {
  -webkit-mask-size: 420px 260px; mask-size: 420px 260px; filter: blur(0); /* 比按钮宽得多：胶囊两端也被完全填满 */
  transition: -webkit-mask-size 0.72s cubic-bezier(0.22, 0.72, 0.18, 1) 0.096s, mask-size 0.72s cubic-bezier(0.22, 0.72, 0.18, 1) 0.096s, filter 0.56s ease 0.16s;
}
.cvm-dl .so-ring { position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 85%, transparent); filter: blur(0.6px); opacity: 0; scale: 0.2; }
.cvm-dl .so-glass::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 10%, transparent); }
.cvm-dl.is-press { animation: cvm-press 0.8s linear both; }
.cvm-dl.is-ripple .so-ring { animation: cvm-ring 0.6s cubic-bezier(0.2, 0.6, 0.3, 1) both; }
@keyframes cvm-press { 0% { scale: 1; box-shadow: var(--so-rest); animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1); } 28% { scale: 1.09; box-shadow: var(--so-lift); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); } 100% { scale: 1; box-shadow: var(--so-rest); } }
@keyframes cvm-ring { 0% { scale: 0.2; opacity: 0; } 14% { opacity: 0.7; } 100% { scale: 3.8; opacity: 0; } }
.cvm.is-open .cvm-tabs, .cvm.is-open .cvm-dl { opacity: 1; transform: none; filter: blur(0); }
.cvm-close {
  position: absolute; top: 14px; right: 16px; z-index: 3; width: 40px; height: 40px; display: grid; place-items: center; border-radius: 50%;
  border: 1px solid color-mix(in srgb, var(--fg) 12%, transparent); background: color-mix(in srgb, var(--bg) 40%, transparent); color: var(--fg);
  -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); cursor: var(--cur-tap, pointer); outline: 0; opacity: 0; transition: opacity 0.4s var(--ease) 0.1s, transform 0.3s var(--ease);
}
.cvm-close svg { width: 20px; height: 20px; }
.cvm.is-open .cvm-close { opacity: 1; }
.cvm-close:hover { transform: scale(1.08); }
.cvm-close:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
html.cvm-lock { overflow: hidden; }
@media (max-width: 540px) { .cvm-stage { --cvm-h: min(68vh, calc(100vh - 250px), 104vw); gap: 28px; } .cvm.is-open .cvm-sheet.is-left { transform: translate3d(-70%, 0, -380px) rotateY(24deg) scale(0.9); } .cvm.is-open .cvm-sheet.is-right { transform: translate3d(70%, 0, -380px) rotateY(-24deg) scale(0.9); } }
@media (prefers-reduced-motion: reduce) {
  .cvm, .cvm * { transition-duration: 0.01s !important; transition-delay: 0s !important; }
  .cvm-tilt { transform: none !important; }
  .cvm-sheet, .cvm-tabs, .cvm-dl { filter: none !important; }
  .cvm-dl.is-press, .cvm-dl.is-ripple .so-ring { animation: none !important; }
}

/* 首页 ↔ 个人页互相切换时底栏不消失（2026-12）：两页共用同一个底栏（雪室开关 + 伦敦时间），
   离场的幕布（19）和到达页首帧的幕布（19）原来都盖在底栏（14）上，切换时底栏跟着淡没、再淡入。
   这两段时间里让底栏排到幕布之上（顶栏同为 20），幕布在它下面淡入 / 淡去，底栏纹丝不动；
   只有首页才有的 4 点进度条先淡出 / 到位后再淡入，免得突然冒出或消失 */
body.is-leaving-plain .home-footer,
html[data-enter="focus"] .home-footer { z-index: 20; }
body.home.is-leaving-plain .home-footer .card-dots,
html[data-enter="focus"] body.home .home-footer .card-dots { opacity: 0; transition: opacity 0.25s var(--ease); }
body.home .home-footer .card-dots { transition: opacity 0.5s var(--ease) 0.2s; }
/* 个人页 → 首页：首页的进入动画会把底栏的每一项先藏起来再依次显出，底栏因此消失一阵。
   从个人页（或反过来）切换时，head 脚本给 html 加 keep-footer：雪室开关和时钟不参与显出，一直在原位；
   只有首页独有的进度点 / 刻度表照旧跟着进入动画出现。其他入口回首页不带这个标记，进入动画不受影响 */
html.keep-footer[data-intro] .home-footer > :is(.snow-toggle, .footer-clock) {
  opacity: 1 !important; filter: none !important; translate: none !important; transition: none !important;
}
/* 个人页 → 首页：首页开头的 data-boot（轮播就位前不显示底栏）会让底栏在换页瞬间隐藏几帧，这就是回首页时的那一下闪烁；
   带 keep-footer 时底栏照常显示（卡片区仍然遮着，等轮播就位） */
html.keep-footer[data-boot] body.home:not(.home-carousel) .home-footer { visibility: visible; }
/* 首页 → 个人页：底栏中间的刻度尺是首页独有的，换页时本来在新页面出现的那一帧才突然没掉；
   离场的幕布淡入的同时让它由清变糊、淡出并略微下沉（失焦退远），和幕布同步 */
body.home.is-leaving-plain .home-footer .stage-ruler {
  opacity: 0;
  filter: blur(6px);
  translate: 0 6px;
  pointer-events: none;
  transition: opacity 0.38s var(--ease), filter 0.38s var(--ease), translate 0.42s var(--ease-out);
}
@media (prefers-reduced-motion: reduce) {
  body.home.is-leaving-plain .home-footer .stage-ruler { filter: none; translate: none; transition: opacity 0.2s ease; }
}

/* 刷新时人在雪室里：跳过首页开场和进入过程，直接进雪室（<head> 小脚本加 snow-instant，场景站稳后由脚本摘掉）。
   这段时间首页内容先藏起来（不然三维场景加载好之前会闪一下首页），过渡一律关掉，状态一步到位 */
/* 轮播里的图自己带更高优先级的 visibility: visible !important，只写 visibility 藏不住它们，所以在外层用整块透明度藏 */
html.snow-instant body:is(.home, .about) > :not(.snow):not(.home-footer) { opacity: 0 !important; visibility: hidden !important; }
/* 底栏：只留左下角的雪室入口，其余照旧藏起来（和雪室里一样） */
html.snow-instant body:is(.home, .about) > .home-footer > :not(.snow-toggle) { opacity: 0 !important; visibility: hidden !important; }
html.snow-instant *, html.snow-instant *::before, html.snow-instant *::after { transition: none !important; animation-duration: 0s !important; animation-delay: 0s !important; }
/* 幕布：和全站的底色幕布过场一样（顶栏之下、其余一切之上），首帧就盖着；雪室画好后由 snow-scene.js 让它淡去 */
html.snow-instant body::after { content: ""; position: fixed; inset: 0; z-index: 19; background: var(--bg); pointer-events: none; }

/* 个人页大字声明里的「伦敦 / London」（2026-12-03）：带下划线；悬停 / 聚焦时逐字向上滚成「雪室 / Snow room」（和全站文字链接同一种逐字滚动），
   点一下 = 点左下角的雪室入口。.c 是遮罩，里面新旧两层叠在同一格（格宽取两者较宽的，字数不同时只有多出来的那几格变宽） */
.ab-place {
  cursor: var(--cur-tap, pointer);
  position: relative; display: inline-block;
  color: var(--fg); /* 自己写明颜色：切换语言动画结束时，文字从「透明」还原，不能让这个词的颜色过渡（0.25 秒）跟着走，否则会闪一下 */
  outline: none;
  transition: color 0.25s ease;
}
/* 下划线画在字的遮罩（.c，上下裁切）外面、框的下沿再往下一点：字滚动时只在框里，碰不到它，和字也留出空隙 */
.ab-place.is-live::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0.03em; height: 1.5px;
  background: currentColor; opacity: 0.4; pointer-events: none; /* 细（1.5px）而淡：只是个提示，不抢大字的风头 */
  transition: opacity 0.25s ease;
}
:root[lang="en"] .ab-place.is-live::after { bottom: 0.1em; } /* 英文字体的字身偏高，下划线再往上一点 */
.ab-place:hover, .ab-place:focus-visible { color: var(--accent); }
.ab-place.is-live:hover::after, .ab-place.is-live:focus-visible::after { opacity: 0.7; } /* 悬停时稍微清楚一点 */ /* 悬停变网页蓝（和正文链接一样）；下划线跟着变 */
.ab-place .c {
  display: inline-grid; justify-items: start; overflow: hidden; vertical-align: top;
  clip-path: inset(0 0 0.1em 0); /* 滚动中的字在离下划线还有一小段的地方就被裁掉，不会贴着、更不会穿过下划线 */
  width: var(--w0, auto); /* 脚本量好的旧字宽；悬停时过渡到新字宽 */
  transition: width 0.5s cubic-bezier(0.65, 0, 0.35, 1); transition-delay: calc(var(--i) * 28ms);
}
.ab-place:hover .c, .ab-place:focus-visible .c { width: var(--w1, auto); }
.ab-place .c-old, .ab-place .c-new {
  grid-area: 1 / 1; display: block;
  transition: transform 0.5s cubic-bezier(0.65, 0, 0.35, 1);
  transition-delay: calc(var(--i) * 28ms); /* 移开时也按顺序依次回位 */
}
.ab-place .c-new { transform: translateY(100%); }
.ab-place:hover .c-old, .ab-place:focus-visible .c-old { transform: translateY(-100%); }
.ab-place:hover .c-new, .ab-place:focus-visible .c-new { transform: none; }
.ab-place:focus-visible { outline: 1px solid currentColor; outline-offset: 0.08em; }
@media (prefers-reduced-motion: reduce) {
  .ab-place .c, .ab-place .c-old, .ab-place .c-new { transition: none; }
}

/* 暂时隐藏雪室右下角的「保存 / 分享」按钮（2026-12-04，用户之后会完善）：整个 .snow-share 不显示；功能代码都还在。
   重置按钮的位置由脚本（layout）按分享是否隐藏来定，会自己补位。恢复时删掉这一段即可 */
.snow-share { display: none !important; }

/* 内容页概述封面（手机）：各块之间的间距放大——观点句 → 项目信息、信息栏每一行、信息栏 → 开篇大图 */
@media (max-width: 540px) {
  .cs-opening .cs-meta { margin-top: 44px; }
  .cs-opening .cs-meta > div { padding: 22px 0; }
  .cs-opening .cs-meta > div:first-child { padding-top: 22px; }
  .cs-opening .cs-hero { margin-top: 56px; }
}
/* 手机：开篇通栏大图（视频）上下的间距再加大——上方 56 → 76px，下方到导语 40 → 64px */
@media (max-width: 540px) {
  .cs-opening .cs-hero { margin-top: 76px; }
  .cs-opening ~ .cs-intro-body .cs-lede, .cs-intro-body .cs-lede { margin-top: 64px; }
}

/* ============================================================
   404 页（404.html）：把三维的雪室画成只有描边的线稿
   · 四面墙是一个细线盒子（真三维：透视 + 转动；没有地面和天花板）；盒子下面那条连续的曲线是雪面。
   · 斜着的「404」下半截插在雪里：雪面线以上清晰，线以下沿竖向被雪一层层抹开、淡掉（全在一个 SVG 里画，字、遮罩、模糊随盒子等比缩放）。
   · 整页刚好一屏、不滚动；盒子下面一句话（对齐盒子左边）+ 玻璃小按钮（对齐盒子右边，与首页「进入」同款的按压 / 水纹）。
   ============================================================ */
body.err-page { overflow: hidden; }
.err {
  height: calc(100vh - var(--header-h)); height: calc(100svh - var(--header-h)); /* 头部是 sticky，自己占一行 */
  display: flex; flex-direction: column;
  overflow: hidden; background: var(--bg); color: var(--fg);
}
.err-stage { flex: 1 1 0; min-height: 0; container-type: size; display: flex; align-items: center; justify-content: center; touch-action: pan-y; }
.err-col {
  --W: min(88cqw, 640px, calc((100cqh - 120px) / 0.66)); /* 电脑上把模型收小 */
  --H: calc(var(--W) * 0.66);
  --D: calc(var(--W) * 0.66);
  width: var(--W); display: flex; flex-direction: column; gap: clamp(22px, 4.5vh, 40px);
}
.err-persp { width: var(--W); height: var(--H); perspective: calc(var(--W) * 1.1); perspective-origin: 50% 65.65%; /* 消失点偏下，从设计稿四角连线量得：后墙顶边落在高度 24.6% 处 */ }
.err-scene { position: relative; width: 100%; height: 100%; transform-style: preserve-3d; transform-origin: 50% 50% calc(var(--D) * -0.5); will-change: transform; }
.err-frame, .err-back, .err-mid, .err-wall { position: absolute; display: block; }
.err-frame { inset: 0; border: 0.6px solid var(--fg); }
.err-back { left: 0; top: 0; width: 100%; height: 100%; transform: translateZ(calc(var(--D) * -1)); overflow: visible; }
.err-back .err-top, .err-back .err-snow, .err-mid .err-snow, .err-wall path { vector-effect: non-scaling-stroke; fill: none; stroke: var(--fg); stroke-width: 0.6; }
.err-back .err-t { fill: var(--fg); /* 实心：露出雪线以上的字纯色、边缘锐利 */ font-family: var(--font-adventor); /* 网页英文标题字体，中英文页面都用它 */ font-weight: 700; font-size: 380px; letter-spacing: 0.12em; }
.err-mid { left: 0; top: 0; width: 100%; height: 100%; overflow: visible; /* 放在深度一半处，再按透视比例放大 (P+D/2)/(P+D)=0.8125，静止时看起来与放在后墙上完全一样 */ transform-origin: 50% 65.65%; transform: translateZ(calc(var(--D) * -0.5)) scale(0.8125); }
.err-wall { overflow: visible; }
:root:not([data-theme="dark"]) .err-back .err-snow, :root:not([data-theme="dark"]) .err-mid .err-snow { stroke: #000; } /* 设计稿里压在字上的雪线是纯黑，比字（深灰）更黑一点 */
/* 字自己的上深下浅：顶端是实色，往下逐渐淡掉（埋进雪的那一截几乎看不见） */
.err-s1 { stop-color: var(--fg); stop-opacity: 1; } .err-s2 { stop-color: var(--fg); stop-opacity: 1; } .err-s3 { stop-color: var(--fg); stop-opacity: 0.9; } .err-s4 { stop-color: var(--fg); stop-opacity: 0.5; } .err-s5 { stop-color: var(--fg); stop-opacity: 0; }
.err-lines { position: absolute; left: 0; top: 0; width: 100%; height: 100%; overflow: visible; pointer-events: none; fill: none; stroke: var(--fg); stroke-width: 0.6; z-index: 2; }
.err-lines path { vector-effect: non-scaling-stroke; }
.err-js .err-wall, .err-js .err-back .err-top { display: none; }
.err-js .err-frame { border-color: transparent; }
.err-left { left: 0; top: 0; width: var(--D); height: var(--H); transform-origin: 0 50%; transform: rotateY(90deg); }
.err-right { left: calc(var(--W) - var(--D)); top: 0; width: var(--D); height: var(--H); transform-origin: 100% 50%; transform: rotateY(-90deg); }
/* 底部：一句话 + 玻璃按钮，上下排、居中（电脑和手机一样） */
.err-foot { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 18px; }
.err-msg { margin: 0; font-family: var(--font-display); font-size: clamp(16px, 1.5vw, 20px); line-height: 1.3; color: var(--fg); }
:root[lang="zh-CN"] .err-msg { font-family: var(--font-system, var(--font-text)); letter-spacing: 0.06em; }
.err-home {
  --so-rest: 0 2px 8px rgba(var(--shadow), 0.10), 0 14px 34px -10px rgba(var(--shadow), 0.30);
  --so-lift: 0 2px 4px rgba(var(--shadow), 0.18), 0 14px 24px -4px rgba(var(--shadow), 0.26), 0 34px 56px -14px rgba(var(--shadow), 0.46);
  position: relative; display: inline-flex; align-items: center; justify-content: center; min-width: 92px; height: 42px; padding: 0 28px; flex: none; border-radius: 999px;
  background: color-mix(in srgb, var(--bg) 58%, transparent); color: var(--fg); -webkit-backdrop-filter: blur(4px) saturate(130%); backdrop-filter: blur(4px) saturate(130%);
  box-shadow: var(--so-rest); font-family: var(--font-switzer, var(--font-text)); font-size: 12px; font-weight: 500; letter-spacing: 0.04em; line-height: 1; white-space: nowrap; text-decoration: none;
  -webkit-font-smoothing: antialiased; cursor: var(--cur-tap, pointer); outline: 0;
}
:root[lang="zh-CN"] .err-home { font-family: var(--font-system, var(--font-text)); letter-spacing: 0.3em; text-indent: 0.3em; }
.err-home .so-back, .err-home .so-glass { position: absolute; inset: 0; border-radius: inherit; overflow: hidden; pointer-events: none; }
.err-home .so-glass { z-index: 2; }
.err-home .so-label { position: relative; z-index: 1; }
.err-home .so-fill { position: absolute; inset: 0; display: flex; align-items: center; justify-content: center; }
.err-home .so-ball { position: absolute; left: 50%; top: 50%; width: 30px; height: 30px; margin: -15px 0 0 -15px; border-radius: 50%; background: var(--accent); filter: blur(11px); opacity: 0; scale: 0.4; transition: opacity 0.24s var(--ease), scale 0.32s var(--ease); }
.err-home:hover .so-ball, .err-home:focus-visible .so-ball { opacity: 0.5; scale: 1.5; transition: opacity 0.2s var(--ease) 0.016s, scale 0.36s cubic-bezier(0.22, 0.72, 0.18, 1); }
.err-home .so-fill {
  color: var(--on-accent, var(--bg)); background: var(--accent); /* 反色保持平面（取站点重点色，与首页「进入」随卡片换色同理） */
  -webkit-mask-image: radial-gradient(circle closest-side, #000 52%, transparent 100%); mask-image: radial-gradient(circle closest-side, #000 52%, transparent 100%);
  -webkit-mask-repeat: no-repeat; mask-repeat: no-repeat; -webkit-mask-position: 50% 50%; mask-position: 50% 50%; -webkit-mask-size: 0 0; mask-size: 0 0; filter: blur(5px);
  transition: -webkit-mask-size 0.4s cubic-bezier(0.55, 0, 0.3, 1), mask-size 0.4s cubic-bezier(0.55, 0, 0.3, 1), filter 0.4s ease;
}
.err-home:hover .so-fill, .err-home:focus-visible .so-fill {
  -webkit-mask-size: 200px 200px; mask-size: 200px 200px; filter: blur(0);
  transition: -webkit-mask-size 0.72s cubic-bezier(0.22, 0.72, 0.18, 1) 0.096s, mask-size 0.72s cubic-bezier(0.22, 0.72, 0.18, 1) 0.096s, filter 0.56s ease 0.16s;
}
.err-home .so-ring { position: absolute; left: 50%; top: 50%; width: 36px; height: 36px; margin: -18px 0 0 -18px; border-radius: 50%; border: 1px solid color-mix(in srgb, var(--accent) 85%, transparent); filter: blur(0.6px); opacity: 0; scale: 0.2; }
.err-home .so-glass::after { content: ""; position: absolute; inset: 0; border-radius: inherit; box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 10%, transparent); }
.err-home.is-press { animation: err-press 0.8s linear both; }
.err-home.is-ripple .so-ring { animation: err-ring 0.6s cubic-bezier(0.2, 0.6, 0.3, 1) both; }
.err-home:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
@keyframes err-press { 0% { scale: 1; box-shadow: var(--so-rest); animation-timing-function: cubic-bezier(0.2, 0.7, 0.2, 1); } 28% { scale: 1.09; box-shadow: var(--so-lift); animation-timing-function: cubic-bezier(0.4, 0, 0.2, 1); } 100% { scale: 1; box-shadow: var(--so-rest); } }
@keyframes err-ring { 0% { scale: 0.2; opacity: 0; } 14% { opacity: 0.7; } 100% { scale: 3.8; opacity: 0; } }
@media (max-width: 540px) {
  .err-col { --W: min(92cqw, calc((100cqh - 150px) / 0.66)); }
}
@media (prefers-reduced-motion: reduce) {
  .err-scene { transform: none !important; }
  .err-home, .err-home * { transition-duration: 0.01s !important; transition-delay: 0s !important; }
  .err-home.is-press, .err-home.is-ripple .so-ring { animation: none !important; }
}
