/* =========================================================
   Martica · 彭梦淼  作品集网站
   视觉基调延续原稿：瑞士网格 / 超粗压缩标题 / 红色强调
   1. Tokens   2. Reset   3. Helpers   4. Loader   5. Cursor
   6. Nav      7. Hero    8. Ticker    9. Section 10. About
   11. Works  12. Chapters 13. Archive 14. Deck  15. Contact
   ========================================================= */

/* ---------- 1. Tokens ---------- */
:root {
  --paper: #f1efea;
  --paper-2: #e7e4dd;
  --ink: #0c0c0d;
  --ink-2: #46464a;
  --ink-3: #8b8b90;
  --line: rgba(12, 12, 13, .14);
  --accent: #e1251b;
  --card: #fbfaf7;

  --ff-display: 'Anton', 'Haettenschweiler', 'Arial Narrow', Impact, sans-serif;
  --ff-sans: 'Inter', 'Noto Sans SC', 'PingFang SC', 'Microsoft YaHei', system-ui, sans-serif;
  --ff-mono: 'JetBrains Mono', ui-monospace, Consolas, monospace;

  --gut: clamp(18px, 4vw, 64px);
  --maxw: 1680px;
  --ease: cubic-bezier(.16, 1, .3, 1);
  --ease-io: cubic-bezier(.7, 0, .3, 1);
  --nav-h: 68px;
}

[data-theme='dark'] {
  --paper: #0b0b0c;
  --paper-2: #141416;
  --ink: #f1efea;
  --ink-2: #a8a8ad;
  --ink-3: #6a6a70;
  --line: rgba(241, 239, 234, .16);
  --card: #141416;
}

/* ---------- 2. Reset ---------- */
*, *::before, *::after { box-sizing: border-box; }

html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }

body {
  margin: 0;
  background: var(--paper);
  color: var(--ink);
  font-family: var(--ff-sans);
  font-size: 15px;
  line-height: 1.7;
  overflow-x: hidden;
  transition: background .6s var(--ease), color .6s var(--ease);
}

body.is-locked { overflow: hidden; }

h1, h2, h3, h4, p, figure, blockquote, dl, dd { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
::selection { background: var(--accent); color: #fff; }

/* ---------- 3. Helpers ---------- */
.wrap {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
}

/* 锚点跳转时给固定导航留出空间 */
section[id], main[id] { scroll-margin-top: calc(var(--nav-h) + 12px); }

.mono {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--ink-3);
}

/* ---------- 中文断行优化 ----------
   中文可以在任意两个字之间断行，默认排版很容易出现两种难受的情况：
   1) 末行只剩一两个字（「…智能硬件系 / 统。」）
   2) 把一个词拆到两行（「…可持续材料相 / 关的合作。」）
   pretty  让浏览器回避过短的末行，用于长段落；
   balance 让各行长度尽量均衡，用于三四行以内的短段落。
   两者都是渐进增强：老浏览器不支持时按原样排版，不会出问题。 */
body { text-wrap: pretty; }

.sec__aside,
.viz__note,
.chgroup__desc,
.pipe__desc,
.tl__sum,
.about__lead,
.work__cn,
.contact__hint,
.dl__d,
.bar__cn,
.hero__role,
.stat__l,
.about__credo,
.tl__pd { text-wrap: balance; }

/* 防孤字用的尾部保护段（由 JS 注入，见 main.js 的 noWidow） */
.nw { white-space: nowrap; }

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

/* 纸张颗粒 */
.grain {
  position: fixed;
  inset: -50%;
  z-index: 9000;
  pointer-events: none;
  opacity: .3;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='180' height='180' filter='url(%23n)' opacity='.4'/%3E%3C/svg%3E");
  mix-blend-mode: multiply;
  animation: grainShift 1.1s steps(3) infinite;
}

[data-theme='dark'] .grain { mix-blend-mode: screen; opacity: .16; }

@keyframes grainShift {
  0%   { transform: translate(0, 0); }
  33%  { transform: translate(-2%, 1.5%); }
  66%  { transform: translate(1.5%, -1%); }
  100% { transform: translate(0, 0); }
}

/* 入场动画 */
.rise {
  opacity: 0;
  transform: translateY(38px);
  transition: opacity .9s var(--ease), transform 1s var(--ease);
  transition-delay: var(--d, 0ms);
}

.rise.is-in { opacity: 1; transform: none; }

.clip {
  clip-path: inset(0 0 100% 0);
  transition: clip-path 1.1s var(--ease);
  transition-delay: var(--d, 0ms);
}

.clip.is-in { clip-path: inset(0 0 0 0); }

/* 按钮 */
.btn {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 13px 24px;
  border: 1px solid var(--ink);
  border-radius: 999px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  overflow: hidden;
  isolation: isolate;
  transition: color .4s var(--ease);
}

.btn > span { position: relative; z-index: 2; }

.btn::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: var(--ink);
  transform: translateY(101%);
  transition: transform .55s var(--ease);
}

.btn:hover { color: var(--paper); }
.btn:hover::before { transform: translateY(0); }

.btn--solid { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn--solid::before { background: var(--ink); }
.btn--solid:hover { color: #fff; }

.btn__arrow { transition: transform .45s var(--ease); }
.btn:hover .btn__arrow { transform: translateX(5px); }

.iconbtn {
  width: 38px; height: 38px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--ff-mono);
  font-size: 12px;
  transition: background .35s var(--ease), color .35s, border-color .35s, transform .35s var(--ease);
}

.iconbtn:hover {
  background: var(--ink);
  color: var(--paper);
  border-color: var(--ink);
  transform: translateY(-2px);
}

/* ---------- 4. Loader ---------- */
.loader {
  position: fixed;
  inset: 0;
  z-index: 9500;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  grid-template-rows: 1fr auto;
  padding: var(--gut);
  transition: transform 1s var(--ease-io), opacity .35s linear .6s;
}

.loader.is-done { transform: translateY(-101%); opacity: 0; pointer-events: none; }

.loader__center { display: flex; align-items: center; justify-content: center; overflow: hidden; }

.loader__word {
  font-family: var(--ff-display);
  font-size: clamp(44px, 12.5vw, 210px);
  line-height: .82;
  text-transform: uppercase;
  display: flex;
}

.loader__word span {
  display: inline-block;
  transform: translateY(105%);
  animation: loadUp .9s var(--ease) forwards;
}

@keyframes loadUp { to { transform: translateY(0); } }

.loader__foot {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .55);
}

.loader__pct {
  font-family: var(--ff-display);
  font-size: clamp(32px, 6.5vw, 84px);
  color: var(--paper);
  line-height: 1;
}

.loader__bar {
  position: absolute;
  left: 0; bottom: 0;
  height: 3px; width: 0;
  background: var(--accent);
  transition: width .3s linear;
}

/* ---------- 5. Cursor ---------- */
.cursor {
  position: fixed;
  top: 0; left: 0;
  z-index: 9200;
  pointer-events: none;
  mix-blend-mode: difference;
}

.cursor__dot, .cursor__ring {
  position: absolute;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  will-change: transform;
}

.cursor__dot { width: 7px; height: 7px; background: #fff; transition: opacity .3s; }

.cursor__ring {
  width: 36px; height: 36px;
  border: 1px solid rgba(255, 255, 255, .7);
  transition: width .35s var(--ease), height .35s var(--ease), background .35s var(--ease);
}

.cursor.is-hot .cursor__ring { width: 84px; height: 84px; background: rgba(255, 255, 255, .12); }
.cursor.is-hot .cursor__dot { opacity: 0; }

.cursor__label {
  position: absolute;
  transform: translate(-50%, -50%);
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: #fff;
  opacity: 0;
  transition: opacity .25s;
  white-space: nowrap;
}

.cursor.is-hot .cursor__label { opacity: 1; }

@media (hover: none), (max-width: 900px) { .cursor { display: none; } }

/* ---------- 6. Nav ---------- */
.nav {
  position: fixed;
  top: 0; left: 0; right: 0;
  z-index: 8000;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  background: var(--paper);
  background: color-mix(in srgb, var(--paper) 78%, transparent);
  border-bottom: 1px solid transparent;
  transition: border-color .4s, transform .5s var(--ease);
}

.nav.is-stuck { border-bottom-color: var(--line); }
.nav.is-hidden { transform: translateY(-100%); }

.nav__in {
  width: 100%;
  max-width: var(--maxw);
  margin-inline: auto;
  padding-inline: var(--gut);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.nav__brand {
  display: flex;
  align-items: baseline;
  gap: 10px;
  font-family: var(--ff-display);
  font-size: 20px;
  text-transform: uppercase;
}

.nav__brand small {
  font-family: var(--ff-sans);
  font-size: 11px;
  font-weight: 500;
  letter-spacing: .1em;
  color: var(--ink-3);
}

.nav__menu { display: flex; gap: clamp(14px, 2vw, 34px); align-items: center; }

.nav__link {
  position: relative;
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 6px 0;
  color: var(--ink-2);
  transition: color .3s;
}

.nav__link::after {
  content: '';
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 1px;
  background: currentColor;
  transform: scaleX(0);
  transform-origin: left;
  transition: transform .45s var(--ease);
}

.nav__link:hover, .nav__link.is-active { color: var(--ink); }
.nav__link:hover::after, .nav__link.is-active::after { transform: scaleX(1); }

.nav__side { display: flex; align-items: center; gap: 12px; }

.nav__prog {
  position: absolute;
  left: 0; bottom: -1px;
  height: 2px; width: 0;
  background: var(--accent);
}

@media (max-width: 900px) { .nav__menu { display: none; } }

/* ---------- 7. Hero ---------- */
.hero {
  position: relative;
  min-height: 100svh;
  padding-top: calc(var(--nav-h) + 3vh);
  padding-bottom: 7vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  overflow: hidden;
}

.hero__grid {
  position: absolute;
  inset: 0;
  pointer-events: none;
  opacity: .55;
  background-image:
    linear-gradient(to right, var(--line) 1px, transparent 1px),
    linear-gradient(to bottom, var(--line) 1px, transparent 1px);
  background-size: 8.333% 25%;
  -webkit-mask-image: radial-gradient(circle at 50% 45%, #000 18%, transparent 76%);
  mask-image: radial-gradient(circle at 50% 45%, #000 18%, transparent 76%);
}

.hero__in { position: relative; z-index: 1; }

.hero__top {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 20px;
  padding-bottom: 2.2vh;
  border-bottom: 1px solid var(--line);
}

.hero__role {
  font-family: var(--ff-mono);
  font-size: clamp(10px, 1vw, 12px);
  letter-spacing: .2em;
  text-transform: uppercase;
}

.hero__role b { color: var(--accent); }

.hero__title { position: relative; padding-block: clamp(10px, 2.2vh, 30px); }

.hero__line {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  overflow: hidden;
}

.hero__line + .hero__line { margin-top: -.05em; }

.hero__char {
  font-family: var(--ff-display);
  font-size: clamp(50px, 15.2vw, 262px);
  line-height: .84;
  text-transform: uppercase;
  display: inline-block;
  transform: translateY(110%);
  /* 入场 transform 带 stagger 延迟，hover 变色不延迟 */
  transition: transform 1.15s var(--ease) var(--d, 0ms), color .4s ease 0s;
}

body.is-ready .hero__char { transform: translateY(0); }
.hero__char.is-accent { color: var(--accent); }
.hero__char:hover { color: var(--accent); }

.hero__sub {
  display: grid;
  grid-template-columns: 1.05fr 1fr;
  gap: clamp(20px, 4vw, 70px);
  align-items: start;
  padding-top: clamp(14px, 2.4vh, 28px);
  border-top: 1px solid var(--line);
}

.hero__cn {
  font-family: var(--ff-display);
  font-size: clamp(21px, 3vw, 50px);
  line-height: 1.04;
  letter-spacing: .02em;
}

.hero__cn span { color: var(--accent); }
.hero__desc { max-width: 46ch; color: var(--ink-2); font-size: clamp(13px, 1.05vw, 15px); }
.hero__cta { display: flex; flex-wrap: wrap; gap: 12px; margin-top: 18px; }

.hero__scroll {
  position: absolute;
  left: 50%; bottom: 14px;
  transform: translateX(-50%);
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  z-index: 1;
}

.hero__scroll i {
  display: block;
  width: 1px; height: 40px;
  background: linear-gradient(to bottom, var(--ink), transparent);
  animation: dropLine 1.9s var(--ease-io) infinite;
  transform-origin: top;
}

@keyframes dropLine {
  0%   { transform: scaleY(0); opacity: 0; }
  40%  { transform: scaleY(1); opacity: 1; }
  100% { transform: scaleY(1) translateY(40px); opacity: 0; }
}

@media (max-width: 900px) {
  .hero__sub { grid-template-columns: 1fr; }
  .hero__scroll { display: none; }
}

/* ---------- 8. Ticker ---------- */
.ticker {
  border-block: 1px solid var(--line);
  background: var(--ink);
  color: var(--paper);
  overflow: hidden;
  padding-block: 13px;
  display: flex;
}

.ticker__track {
  display: flex;
  flex: 0 0 auto;
  align-items: center;
  animation: tickerRun 36s linear infinite;
  will-change: transform;
}

.ticker:hover .ticker__track { animation-play-state: paused; }

.ticker__item {
  font-family: var(--ff-display);
  font-size: clamp(19px, 2.5vw, 40px);
  text-transform: uppercase;
  white-space: nowrap;
  display: flex;
  align-items: center;
  gap: 34px;
  padding-right: 34px;
}

.ticker__item i {
  display: block;
  width: 11px; height: 11px;
  background: var(--accent);
  border-radius: 50%;
  flex: 0 0 auto;
}

@keyframes tickerRun { to { transform: translateX(-50%); } }

.ticker--rev .ticker__track { animation-direction: reverse; }

/* ---------- 9. Section head ---------- */
.sec { padding-block: clamp(66px, 10.5vh, 148px); }
.sec--tight { padding-block: clamp(44px, 7vh, 96px); }

.sec__head {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: clamp(14px, 3vw, 40px);
  align-items: end;
  padding-bottom: clamp(22px, 4vh, 50px);
  border-bottom: 1px solid var(--line);
}

.sec__no {
  font-family: var(--ff-display);
  font-size: clamp(28px, 3.8vw, 58px);
  line-height: .8;
  color: transparent;
  -webkit-text-stroke: 1px var(--ink-3);
}

.sec__title {
  font-family: var(--ff-display);
  font-size: clamp(32px, 6.2vw, 112px);
  line-height: .88;
  text-transform: uppercase;
}

.sec__title small {
  display: block;
  font-family: var(--ff-sans);
  font-weight: 600;
  font-size: clamp(11px, 1.05vw, 14px);
  letter-spacing: .22em;
  color: var(--ink-3);
  margin-bottom: 10px;
}

/* 用 em 而不是 ch 限宽：ch 是数字「0」的宽度，用来量中文会偏窄，
   短句会被无谓地挤成两行。23em ≈ 23 个汉字，够短句排一行。 */
.sec__aside { max-width: 23em; font-size: 13px; color: var(--ink-2); text-align: right; }

@media (max-width: 900px) {
  .sec__head { grid-template-columns: auto 1fr; }
  .sec__aside { grid-column: 1 / -1; text-align: left; max-width: none; }
}

/* ---------- 10. About ---------- */
.about__grid {
  display: grid;
  grid-template-columns: minmax(200px, 290px) 1fr;
  gap: clamp(24px, 4vw, 68px);
  padding-top: clamp(28px, 5.5vh, 66px);
}

/* 个人照片：常态即彩色。悬停时取景框展开 + 斜向光扫 + 一道扫描线，
   鼠标位置带动照片轻微 3D 倾斜（倾斜量由 JS 写入 .portrait__media 的 transform） */
.about__portrait {
  position: relative;
  align-self: start;
  perspective: 900px;
}

.portrait__media {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  transform-style: preserve-3d;
  transition: box-shadow .6s var(--ease), border-color .6s var(--ease);
  will-change: transform;
}

.about__portrait:hover .portrait__media {
  border-color: var(--accent);
  box-shadow: 0 26px 62px rgba(0, 0, 0, .24);
}

.portrait__media img {
  width: 100%;
  transition: transform 1.2s var(--ease);
}

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

/* 斜向光扫 */
.portrait__sheen {
  position: absolute;
  inset: -35% -65%;
  z-index: 2;
  pointer-events: none;
  opacity: 0;
  transform: translateX(-70%);
  background: linear-gradient(104deg,
    transparent 40%,
    rgba(255, 255, 255, .42) 47%,
    rgba(255, 255, 255, .8) 50.5%,
    rgba(255, 255, 255, .42) 54%,
    transparent 61%);
  transition: opacity .3s;
}

.about__portrait:hover .portrait__sheen {
  opacity: 1;
  animation: portraitSheen 1.15s var(--ease-io);
}

@keyframes portraitSheen {
  from { transform: translateX(-70%); }
  to   { transform: translateX(70%); }
}

/* 扫描线 */
.portrait__scan {
  position: absolute;
  top: 0; left: 0; right: 0;
  height: 2px;
  z-index: 3;
  pointer-events: none;
  opacity: 0;
  background: var(--accent);
  box-shadow: 0 0 20px 3px rgba(225, 37, 27, .6);
}

.about__portrait:hover .portrait__scan { animation: portraitScan 1.7s var(--ease-io) .08s; }

@keyframes portraitScan {
  0%   { opacity: 0; top: 0; }
  12%  { opacity: .92; }
  86%  { opacity: .92; }
  100% { opacity: 0; top: 100%; }
}

/* 四角取景框 */
.portrait__corner {
  position: absolute;
  width: 17px; height: 17px;
  z-index: 4;
  pointer-events: none;
  border: 0 solid var(--accent);
  opacity: 0;
  transition: opacity .4s var(--ease), transform .55s var(--ease);
}

.portrait__corner--tl { top: 9px;    left: 9px;    border-top-width: 2px;    border-left-width: 2px;  transform: translate(7px, 7px); }
.portrait__corner--tr { top: 9px;    right: 9px;   border-top-width: 2px;    border-right-width: 2px; transform: translate(-7px, 7px); }
.portrait__corner--bl { bottom: 9px; left: 9px;    border-bottom-width: 2px; border-left-width: 2px;  transform: translate(7px, -7px); }
.portrait__corner--br { bottom: 9px; right: 9px;   border-bottom-width: 2px; border-right-width: 2px; transform: translate(-7px, -7px); }

.about__portrait:hover .portrait__corner { opacity: 1; transform: none; }

/* 关闭动效时只留静态彩色照片 */
.no-motion .portrait__sheen,
.no-motion .portrait__scan { display: none; }
.no-motion .about__portrait:hover .portrait__media img { transform: none; }

.about__badge {
  position: absolute;
  left: 0; bottom: 0;
  z-index: 5;
  background: var(--accent);
  color: #fff;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  padding: 8px 14px;
}

.about__body { display: grid; gap: clamp(26px, 4vh, 46px); }

.about__lead {
  font-family: var(--ff-display);
  font-size: clamp(21px, 2.8vw, 44px);
  line-height: 1.08;
  letter-spacing: .01em;
}

.about__lead em { font-style: normal; color: var(--accent); }

.about__text {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
  gap: clamp(18px, 2.4vw, 40px);
  color: var(--ink-2);
  font-size: 13.5px;
}

.dl {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(220px, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
}

.dl__item {
  background: var(--paper);
  padding: 20px;
  display: grid;
  gap: 6px;
  align-content: start;
  transition: background .4s var(--ease);
}

.dl__item:hover { background: var(--card); }

.dl__k {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.dl__v { font-weight: 600; font-size: 14px; }
.dl__d { font-size: 12.5px; color: var(--ink-2); line-height: 1.62; }

/* 基本信息共 6 项：固定列数排成 3×2，避免 auto-fit 排成 5+1 后留出空灰格 */
.dl--facts { grid-template-columns: repeat(3, minmax(0, 1fr)); }
@media (max-width: 900px) { .dl--facts { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 560px) { .dl--facts { grid-template-columns: 1fr; } }

.skills { display: grid; grid-template-columns: repeat(auto-fit, minmax(270px, 1fr)); gap: clamp(20px, 3vw, 46px); }

.skills__t {
  font-family: var(--ff-display);
  font-size: 19px;
  text-transform: uppercase;
  padding-bottom: 12px;
  margin-bottom: 16px;
  border-bottom: 1px solid var(--line);
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
}

.skills__t span { font-family: var(--ff-mono); font-size: 10px; letter-spacing: .16em; color: var(--ink-3); }

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

.chip {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 7px 14px 7px 7px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 500;
  transition: background .35s var(--ease), color .35s, border-color .35s, transform .35s var(--ease);
}

.chip b {
  width: 24px; height: 24px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--ff-mono);
  font-size: 9.5px;
  font-weight: 400;
  transition: background .35s, color .35s;
}

.chip:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: translateY(-3px); }
.chip:hover b { background: var(--accent); color: #fff; }

.stats {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
  gap: 1px;
  background: var(--line);
  border-block: 1px solid var(--line);
}

.stat { background: var(--paper); padding: clamp(20px, 3vw, 34px) 20px; display: grid; gap: 4px; }

.stat__n { font-family: var(--ff-display); font-size: clamp(36px, 5.4vw, 84px); line-height: .84; }
.stat__n i { font-style: normal; color: var(--accent); }
.stat__l { font-family: var(--ff-mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: var(--ink-3); }

@media (max-width: 900px) {
  .about__grid { grid-template-columns: 1fr; }
  .about__portrait { max-width: 280px; }
}

/* 窄屏下 auto-fit 会让 3 张方向卡 / 4 个统计项换行后留出空的灰格子，
   这里固定列数，避免出现看起来像缺内容的空位 */
@media (max-width: 760px) {
  .dl { grid-template-columns: 1fr; }
  .stats { grid-template-columns: repeat(2, 1fr); }
}

/* ---------- 11. Works ---------- */
.works { border-top: 1px solid var(--line); }

.work {
  position: relative;
  display: grid;
  /* 标签列用 auto 按内容取宽：固定宽度时「UI / UX / Vibe Coding」这类长标签
     会溢出并压到右侧的箭头按钮上 */
  grid-template-columns: 70px minmax(0, 1.5fr) minmax(0, 1fr) auto 52px;
  gap: clamp(10px, 2vw, 28px);
  align-items: center;
  width: 100%;
  padding: clamp(16px, 2.9vh, 32px) 0;
  border-bottom: 1px solid var(--line);
  text-align: left;
  overflow: hidden;
  transition: color .4s var(--ease);
}

.work::before {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 0;
  background: var(--proj, var(--accent));
  transform: translateY(101%);
  transition: transform .6s var(--ease);
}

.work:hover::before, .work:focus-visible::before { transform: translateY(0); }
.work > * { position: relative; z-index: 1; }
.work:hover, .work:focus-visible { color: #fff; }

.work__no {
  font-family: var(--ff-mono);
  font-size: 11px;
  letter-spacing: .14em;
  color: var(--ink-3);
  transition: color .4s;
  padding-left: 2px;
}

.work:hover .work__no { color: rgba(255, 255, 255, .72); }

/* 项目英文名一律单行。长名（如 CITYLAYEREXPRESS）按字符数 --nl 反算字号收窄，
   而不是折行——折行会把整行高度顶开、破坏列表节奏 */
.work__name {
  font-family: var(--ff-display);
  font-size: clamp(23px, min(4.2vw, calc(62vw / var(--nl, 8))), 74px);
  line-height: .92;
  text-transform: uppercase;
  transition: transform .6s var(--ease);
  white-space: nowrap;
  word-break: normal;
  overflow: hidden;
  text-overflow: clip;
}

.work:hover .work__name { transform: translateX(14px); }

.work__cn { font-size: 13px; color: var(--ink-2); transition: color .4s, transform .6s var(--ease); }
.work:hover .work__cn { color: rgba(255, 255, 255, .84); transform: translateX(14px); }

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

.work__tag {
  font-family: var(--ff-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--ink-3);
  transition: border-color .4s, color .4s;
  white-space: nowrap;
}

.work:hover .work__tag { border-color: rgba(255, 255, 255, .45); color: rgba(255, 255, 255, .9); }

.work__go {
  justify-self: end;
  width: 44px; height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  flex: 0 0 auto;
  transition: background .45s var(--ease), border-color .45s, color .45s, transform .45s var(--ease);
}

.work:hover .work__go { background: #fff; border-color: #fff; color: var(--ink); transform: rotate(45deg); }

@media (max-width: 1100px) {
  .work { grid-template-columns: 52px minmax(0, 1fr) 44px; }
  .work__cn { grid-column: 2 / 3; }
  .work__tags { display: none; }
}

/* 悬停预览 */
.peek {
  position: fixed;
  top: 0; left: 0;
  z-index: 7000;
  width: clamp(210px, 23vw, 380px);
  aspect-ratio: 16 / 9;
  pointer-events: none;
  overflow: hidden;
  box-shadow: 0 30px 70px rgba(0, 0, 0, .32);
  opacity: 0;
  transform: translate(-50%, -50%) scale(.86);
  transition: opacity .38s var(--ease), transform .5s var(--ease);
  will-change: transform;
}

.peek.is-on { opacity: 1; transform: translate(-50%, -50%) scale(1); }
.peek img { width: 100%; height: 100%; object-fit: cover; }

@media (hover: none), (max-width: 1100px) { .peek { display: none; } }

/* ---------- 12. 章节分组（Work 内） ---------- */
.chgroup {
  position: relative;
  display: grid;
  grid-template-columns: minmax(0, 340px) minmax(0, 1fr);
  gap: clamp(20px, 3.4vw, 62px);
  align-items: start;
  padding-block: clamp(28px, 5vh, 66px);
  border-bottom: 1px solid var(--line);
}

.chgroup:last-child { border-bottom: 0; }

.chgroup__head {
  position: sticky;
  top: calc(var(--nav-h) + 24px);
  display: grid;
  gap: 9px;
}

.chgroup__no {
  font-family: var(--ff-display);
  font-size: clamp(46px, 7.2vw, 132px);
  /* Anton 的字形高度大于行框，行高压得太紧会和下面的标题叠字 */
  line-height: .92;
  margin-bottom: 2px;
  color: transparent;
  -webkit-text-stroke: 1px var(--ink-3);
  transition: color .6s var(--ease), -webkit-text-stroke-color .6s;
}

.chgroup:hover .chgroup__no {
  color: var(--proj, var(--accent));
  -webkit-text-stroke-color: transparent;
}

.chgroup__en {
  font-family: var(--ff-display);
  font-size: clamp(20px, 2.3vw, 34px);
  line-height: .98;
  text-transform: uppercase;
}

.chgroup__cn {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.chgroup__desc {
  font-size: 12.5px;
  line-height: 1.66;
  color: var(--ink-2);
  max-width: 34ch;
}

.chgroup__cover {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-top: 8px;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  transition: border-color .45s var(--ease);
}

.chgroup__cover:hover, .chgroup__cover:focus-visible { border-color: var(--proj, var(--accent)); }
.chgroup__cover img { width: 100%; height: 100%; object-fit: cover; transition: transform 1.1s var(--ease); }
.chgroup__cover:hover img { transform: scale(1.06); }

.chgroup__coverlab {
  position: absolute;
  inset: auto 0 0 0;
  padding: 28px 12px 11px;
  background: linear-gradient(to top, rgba(0, 0, 0, .86), transparent);
  color: #fff;
  font-family: var(--ff-mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  transform: translateY(101%);
  transition: transform .5s var(--ease);
}

.chgroup__cover:hover .chgroup__coverlab,
.chgroup__cover:focus-visible .chgroup__coverlab { transform: none; }
.chgroup__coverlab i { font-style: normal; }

.chgroup__list { border-top: 1px solid var(--line); }
.chgroup__list .work:last-child { border-bottom: 0; }
.chgroup__list .work { grid-template-columns: 54px minmax(0, 1.35fr) minmax(0, 1fr) auto 46px; }
.chgroup__list .work__name { font-size: clamp(19px, min(3vw, calc(41vw / var(--nl, 8))), 50px); }

@media (max-width: 1100px) {
  .chgroup__list .work { grid-template-columns: 46px minmax(0, 1fr) 42px; }
  /* 窄屏名字列变宽，可放宽字号上限 */
  .chgroup__list .work__name { font-size: clamp(19px, min(5.4vw, calc(74vw / var(--nl, 8))), 50px); }
}

/* ---------- 线上版本入口（项目行下方的外链按钮）----------
   项目列表里其余行都是纯文字，这一行必须一眼看出「能点」：
   做成实心胶囊，inline-grid 收成内容宽度并左对齐。
   底色用 --ink（深浅主题自动反色），保证文字对比度足够。 */
.livelink {
  display: inline-grid;
  grid-template-columns: auto auto auto auto;
  align-items: center;
  gap: 14px;
  margin: 16px 0 20px;
  padding: 12px 16px 12px 18px;
  border-radius: 999px;
  background: var(--ink);
  color: var(--paper);
  box-shadow: 0 10px 24px -16px var(--ink);
  transition: transform .35s var(--ease), box-shadow .35s var(--ease);
}

.livelink:hover,
.livelink:focus-visible {
  transform: translateY(-2px);
  box-shadow: 0 16px 30px -14px var(--proj, var(--accent));
}

.livelink__k {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--paper);
  opacity: .68;
  white-space: nowrap;
  padding-right: 14px;
  border-right: 1px solid currentColor;
}

/* 项目色小圆点，兼作「在线」状态指示 */
.livelink__k i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--proj, var(--accent));
  flex: none;
}

/* 网址永远单行，不折行 */
.livelink__v {
  font-family: var(--ff-mono);
  font-size: clamp(12px, 1.05vw, 15px);
  font-weight: 500;
  letter-spacing: .02em;
  color: var(--paper);
  white-space: nowrap;
  word-break: normal;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  text-decoration-color: color-mix(in srgb, var(--paper) 55%, transparent);
}

.livelink__cta {
  font-family: var(--ff-mono);
  font-size: 9.5px;
  letter-spacing: .16em;
  color: var(--paper);
  opacity: .6;
  white-space: nowrap;
}

.livelink__go {
  justify-self: end;
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--proj, var(--accent));
  display: grid;
  place-items: center;
  font-size: 11px;
  color: #fff;
  transition: transform .35s var(--ease), filter .35s;
}

.livelink:hover .livelink__go {
  transform: translate(2px, -2px);
  filter: brightness(1.15);
}

@media (max-width: 1100px) {
  /* 中窄屏先收掉「点击打开」，优先保住网址单行 */
  .livelink { grid-template-columns: auto auto auto; }
  .livelink__cta { display: none; }
}

@media (max-width: 620px) {
  /* 窄屏把标签移到上一行，让网址独占整行，避免被压缩换行 */
  .livelink {
    grid-template-columns: minmax(0, 1fr) auto;
    row-gap: 5px;
    padding: 12px 14px 12px 16px;
    border-radius: 20px;
  }
  .livelink__k {
    grid-column: 1 / -1;
    border-right: 0;
    padding-right: 0;
  }
  .livelink__v { grid-column: 1; font-size: 12px; }
}

@media (max-width: 1000px) {
  .chgroup { grid-template-columns: 1fr; gap: 22px; }
  .chgroup__head { position: static; }
  .chgroup__cover { max-width: 460px; }
}

/* ---------- 13. Archive / 原稿检索 ---------- */
.filterbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px 24px;
}

.gridcount { flex: 0 0 auto; color: var(--ink-3); }
.gridcount b { font-weight: 400; color: var(--ink); }
.gridcount span { color: var(--ink-3); }


.filters {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: clamp(20px, 3.5vh, 40px) 0;
}

.filter {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  padding: 8px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--ink-2);
  transition: background .35s var(--ease), color .35s, border-color .35s;
}

.filter:hover { border-color: var(--ink); color: var(--ink); }
.filter.is-on { background: var(--ink); border-color: var(--ink); color: var(--paper); }

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 300px), 1fr));
  gap: clamp(10px, 1.4vw, 20px);
}

/* 检索态：更密的排布，视觉重量低于 Work，读起来像索引而不是第二个画廊 */
.grid--index {
  grid-template-columns: repeat(auto-fill, minmax(min(100%, 208px), 1fr));
  gap: clamp(8px, 1vw, 13px);
}

.card {
  position: relative;
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--card);
  opacity: 0;
  transform: translateY(28px) scale(.98);
  transition: opacity .8s var(--ease), transform .9s var(--ease);
  transition-delay: var(--d, 0ms);
}

.card.is-in { opacity: 1; transform: none; }
.card.is-out { display: none; }

.card img {
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform 1.1s var(--ease), filter .5s;
}

.card:hover img { transform: scale(1.07); }

.card__no {
  position: absolute;
  top: 10px; left: 10px;
  z-index: 2;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .1em;
  padding: 3px 8px;
  background: var(--paper);
  color: var(--ink);
  border-radius: 2px;
}

.card__info {
  position: absolute;
  inset: auto 0 0 0;
  z-index: 2;
  padding: 30px 12px 12px;
  background: linear-gradient(to top, rgba(0, 0, 0, .86), transparent);
  color: #fff;
  transform: translateY(101%);
  transition: transform .55s var(--ease);
}

.card:hover .card__info { transform: none; }
.card__t { font-size: 13px; font-weight: 600; }
.card__s { font-family: var(--ff-mono); font-size: 9.5px; letter-spacing: .14em; text-transform: uppercase; color: rgba(255, 255, 255, .68); }

.more { display: flex; justify-content: center; padding-top: clamp(26px, 4vh, 48px); }

/* ---------- 14. Deck viewer ---------- */
.deck {
  position: fixed;
  inset: 0;
  z-index: 9100;
  background: var(--paper);
  display: grid;
  grid-template-rows: auto 1fr auto;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
  transition: opacity .5s var(--ease), transform .6s var(--ease), visibility .5s;
}

.deck.is-open { opacity: 1; visibility: visible; transform: none; }

.deck__bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  padding: 14px var(--gut);
  border-bottom: 1px solid var(--line);
  min-height: 66px;
}

.deck__meta { display: flex; align-items: center; gap: 14px; min-width: 0; }

.deck__chip {
  flex: 0 0 auto;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .16em;
  padding: 5px 10px;
  background: var(--proj, var(--accent));
  color: #fff;
  border-radius: 2px;
}

.deck__titles { min-width: 0; }

.deck__title {
  font-family: var(--ff-display);
  font-size: clamp(17px, 2.1vw, 30px);
  line-height: 1;
  text-transform: uppercase;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.deck__sub {
  font-size: 11.5px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 图集顶栏的线上版本入口：单行不折行 */
.deck__live {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
  padding: 6px 12px;
  border: 1px solid var(--proj, var(--accent));
  border-radius: 999px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .06em;
  color: var(--proj, var(--accent));
  white-space: nowrap;
  transition: background .35s var(--ease), color .35s;
}

.deck__live[hidden] { display: none; }
.deck__live:hover { background: var(--proj, var(--accent)); color: #fff; }
.deck__live i { font-style: normal; }

@media (max-width: 900px) { .deck__live span { display: none; } }

.deck__tools { display: flex; align-items: center; gap: 8px; flex: 0 0 auto; }

.deck__count { font-family: var(--ff-mono); font-size: 11px; letter-spacing: .1em; min-width: 62px; text-align: center; }
.deck__count b { font-weight: 400; }
.deck__count i { font-style: normal; color: var(--ink-3); }

.deck__stage {
  display: flex;
  overflow-x: auto;
  overflow-y: hidden;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
  overscroll-behavior-x: contain;
  cursor: grab;
  /* --stage-h 由 JS 按「视口 − 顶部信息条 − 底部缩略图条」实测下发。
     写成确定的像素高度，百分比链才不会退化成 auto —— 否则 <img> 的
     width/height 属性会以 16:9 接管尺寸，把页面顶出可视区被上下横幅裁掉。 */
  height: var(--stage-h, 100%);
  min-height: 0;
}

.deck__stage::-webkit-scrollbar { display: none; }
.deck__stage.is-drag { cursor: grabbing; scroll-snap-type: none; }

.deck__slide {
  flex: 0 0 100%;
  scroll-snap-align: center;
  display: grid;
  place-items: center;
  padding: clamp(10px, 1.8vw, 30px);
  min-width: 0;
  height: 100%;
  overflow: hidden;
}

/* 不再强制 16/9：图框铺满可用区域，图片用 object-fit: contain 完整显示。
   这样无论视口多矮，页面都不会被顶部信息条和底部缩略图条裁切。 */
.deck__figure {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: min(100%, 1500px);
  min-height: 0;
  overflow: hidden;
  transition: transform .8s var(--ease), opacity .6s;
  transform: scale(.955);
  opacity: .35;
}

.deck__slide.is-cur .deck__figure { transform: none; opacity: 1; }

/* 绝对定位铺满图框：避免 <img> 作为普通流/网格子元素时，
   百分比高度与 auto 轨道互相依赖，导致浏览器退回用 width/height
   属性的 16:9 固有比例算高度，把图顶出可视区。 */
.deck__figure img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  /* 阴影贴合图片实际边界，而不是铺满的图框 */
  filter: drop-shadow(0 12px 34px rgba(0, 0, 0, .2));
  transition: transform .7s var(--ease);
  transform-origin: var(--ox, 50%) var(--oy, 50%);
}

[data-theme='dark'] .deck__figure img { filter: drop-shadow(0 12px 34px rgba(0, 0, 0, .6)); }

.deck__figure.is-zoom { cursor: zoom-out; }
.deck__figure.is-zoom img { transform: scale(2.1); }

.deck__cap {
  position: absolute;
  left: 0; bottom: 0;
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 7px 12px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--ff-mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  opacity: 0;
  transform: translateY(100%);
  transition: opacity .4s, transform .5s var(--ease);
}

.deck__slide.is-cur .deck__figure:hover .deck__cap { opacity: 1; transform: none; }

.deck__foot {
  border-top: 1px solid var(--line);
  padding: 10px var(--gut) 14px;
  display: grid;
  gap: 10px;
}

.deck__rail {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  scrollbar-width: none;
  padding-bottom: 2px;
}

.deck__rail::-webkit-scrollbar { display: none; }

.deck__thumb {
  flex: 0 0 auto;
  width: clamp(74px, 8vw, 118px);
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  overflow: hidden;
  opacity: .42;
  filter: grayscale(1);
  transition: opacity .4s, filter .4s, border-color .4s, transform .4s var(--ease);
}

.deck__thumb img { width: 100%; height: 100%; object-fit: cover; }
.deck__thumb:hover { opacity: .8; filter: none; transform: translateY(-3px); }
.deck__thumb.is-cur { opacity: 1; filter: none; border-color: var(--proj, var(--accent)); }

.deck__hint {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 18px;
  font-family: var(--ff-mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.deck__hint kbd {
  font-family: inherit;
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 1px 5px;
  margin-right: 4px;
}

.deck__prog { height: 2px; background: var(--line); }
.deck__prog i { display: block; height: 100%; width: 0; background: var(--proj, var(--accent)); transition: width .4s var(--ease); }

@media (max-width: 720px) {
  .deck__sub { display: none; }
  .deck__hint { display: none; }
}

/* 矮屏（笔记本横屏 / 手机横屏）：压缩上下横幅，把高度尽量让给页面本身 */
@media (max-height: 720px) {
  .deck__bar { min-height: 0; padding-block: 8px; }
  .deck__title { font-size: clamp(15px, 1.7vw, 22px); }
  .deck__sub { display: none; }
  .deck__foot { padding-block: 7px 9px; gap: 7px; }
  .deck__hint { display: none; }
  .deck__thumb { width: clamp(58px, 6vw, 84px); }
  .deck__slide { padding: 8px 10px; }
}

@media (max-height: 540px) {
  .deck__rail { display: none; }
  .deck__slide { padding: 6px 8px; }
}

/* ---------- 15. Contact / Footer ---------- */
.contact { background: var(--ink); color: var(--paper); position: relative; overflow: hidden; }
.contact .mono, .contact .sec__aside { color: rgba(241, 239, 234, .56); }
.contact .sec__no { -webkit-text-stroke-color: rgba(241, 239, 234, .4); }
.contact .sec__head { border-bottom-color: rgba(241, 239, 234, .18); }
.contact .sec__title small { color: rgba(241, 239, 234, .5); }

/* 邮箱：始终单行，字号由 JS 按容器宽度算出（--mail-fs），不再折行也不再占满整屏 */
.contact__big {
  display: block;
  padding-block: clamp(16px, 2.6vh, 34px);
  transition: color .4s;
  overflow: hidden;
}

.contact__mail {
  display: inline-block;
  font-family: var(--ff-display);
  font-size: var(--mail-fs, clamp(26px, 7.2vw, 104px));
  line-height: 1.04;
  letter-spacing: .005em;
  text-transform: none;
  white-space: nowrap;
  word-break: normal;
}

.contact__big:hover { color: var(--accent); }

.contact__hint {
  color: rgba(241, 239, 234, .45);
  padding-bottom: clamp(18px, 3vh, 34px);
}

.contact__rows {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(224px, 1fr));
  gap: 1px;
  background: rgba(241, 239, 234, .18);
  border: 1px solid rgba(241, 239, 234, .18);
}

.crow {
  background: var(--ink);
  padding: 20px;
  display: grid;
  gap: 6px;
  text-align: left;
  position: relative;
  transition: background .4s var(--ease);
}

.crow:hover { background: #1a1a1c; }
.crow__k { font-family: var(--ff-mono); font-size: 10px; letter-spacing: .18em; text-transform: uppercase; color: rgba(241, 239, 234, .5); }
.crow__v { font-size: 15px; font-weight: 600; word-break: normal; white-space: nowrap; }

.crow__hint {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--accent);
  opacity: 0;
  transition: opacity .35s;
}

.crow:hover .crow__hint { opacity: 1; }
.crow.is-copied .crow__hint { opacity: 1; color: #7ddc7d; }

.foot {
  border-top: 1px solid rgba(241, 239, 234, .18);
  padding-block: 22px;
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: rgba(241, 239, 234, .5);
}

.toast {
  position: fixed;
  left: 50%; bottom: 28px;
  z-index: 9300;
  transform: translate(-50%, 20px);
  background: var(--accent);
  color: #fff;
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  padding: 11px 20px;
  border-radius: 999px;
  opacity: 0;
  pointer-events: none;
  transition: opacity .35s, transform .45s var(--ease);
}

.toast.is-on { opacity: 1; transform: translate(-50%, 0); }

.totop {
  position: fixed;
  right: 18px; bottom: 18px;
  z-index: 7500;
  width: 46px; height: 46px;
  border-radius: 50%;
  background: var(--ink);
  color: var(--paper);
  display: grid;
  place-items: center;
  opacity: 0;
  transform: translateY(14px);
  pointer-events: none;
  transition: opacity .4s, transform .5s var(--ease), background .3s;
}

.totop.is-on { opacity: 1; transform: none; pointer-events: auto; }
.totop:hover { background: var(--accent); }

/* =========================================================
   16. 可视化区块（About 内）
   Fig.01 实习时间线 / Fig.02 阶段×工具链 / Fig.03 方向分布
   ========================================================= */

.about__credo {
  font-size: 13.5px;
  line-height: 1.75;
  color: var(--ink-2);
  padding-left: 16px;
  border-left: 2px solid var(--accent);
}

.viz { padding-top: clamp(46px, 8vh, 104px); }

.viz__head {
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 4px clamp(14px, 2.4vw, 30px);
  align-items: baseline;
  padding-bottom: clamp(18px, 3vh, 34px);
  border-bottom: 1px solid var(--line);
}

.viz__no { color: var(--accent); }

.viz__title {
  font-family: var(--ff-display);
  font-size: clamp(21px, 2.6vw, 40px);
  line-height: 1;
  text-transform: uppercase;
  display: flex;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 12px;
}

.viz__title small {
  font-family: var(--ff-mono);
  font-size: 10.5px;
  letter-spacing: .18em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.viz__note {
  grid-column: 2;
  font-size: 12.5px;
  color: var(--ink-2);
  max-width: 62ch;
}

@media (max-width: 700px) {
  .viz__head { grid-template-columns: 1fr; }
  .viz__note { grid-column: 1; }
}

/* ---------- Fig.01 时间线 ---------- */
.tl { position: relative; padding-top: clamp(20px, 3.4vh, 40px); }

.tl__item {
  position: relative;
  display: grid;
  grid-template-columns: 132px 34px minmax(0, 1fr);
  gap: 0 clamp(10px, 1.6vw, 22px);
  padding-bottom: clamp(18px, 3vh, 34px);
}

/* 竖轴：灰底 + 随滚动填充的强调色 */
.tl__item::before {
  content: '';
  position: absolute;
  top: 6px; bottom: 0;
  left: calc(132px + clamp(10px, 1.6vw, 22px) + 16px);
  width: 1px;
  background: var(--line);
}

.tl__item:last-child::before { bottom: auto; height: 26px; }

.tl__date {
  grid-column: 1;
  text-align: right;
  padding-top: 2px;
  display: grid;
  gap: 2px;
  justify-items: end;
}

.tl__y {
  font-family: var(--ff-display);
  font-size: clamp(19px, 1.9vw, 28px);
  line-height: 1;
}

.tl__range {
  font-family: var(--ff-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  color: var(--ink-3);
  white-space: nowrap;
}

.tl__node {
  grid-column: 2;
  position: relative;
  z-index: 1;
  justify-self: center;
  width: 15px; height: 15px;
  margin-top: 6px;
  border-radius: 50%;
  border: 2px solid var(--ink);
  background: var(--paper);
  transition: background .4s var(--ease), border-color .4s, transform .4s var(--ease);
}

.tl__item.is-open .tl__node,
.tl__item:hover .tl__node {
  background: var(--proj, var(--accent));
  border-color: var(--proj, var(--accent));
  transform: scale(1.28);
}

.tl__card {
  grid-column: 3;
  border: 1px solid var(--line);
  background: var(--paper);
  transition: border-color .4s var(--ease), background .4s;
}

.tl__item.is-open .tl__card { border-color: var(--proj, var(--accent)); background: var(--card); }

.tl__btn {
  width: 100%;
  text-align: left;
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 6px 16px;
  padding: clamp(14px, 2vw, 20px);
  align-items: center;
}

.tl__org {
  font-size: clamp(15px, 1.5vw, 19px);
  font-weight: 700;
  letter-spacing: .01em;
}

.tl__org span { font-weight: 400; font-size: 11.5px; color: var(--ink-3); margin-left: 8px; }

.tl__role {
  grid-row: 2;
  grid-column: 1;
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--proj, var(--accent));
}

.tl__sum { grid-row: 3; grid-column: 1 / -1; font-size: 13px; color: var(--ink-2); margin-top: 4px; }

.tl__plus {
  grid-row: 1 / span 2;
  grid-column: 2;
  width: 32px; height: 32px;
  border: 1px solid var(--line);
  border-radius: 50%;
  display: grid;
  place-items: center;
  font-family: var(--ff-mono);
  font-size: 15px;
  color: var(--ink-2);
  transition: transform .45s var(--ease), background .4s, color .4s, border-color .4s;
}

.tl__btn:hover .tl__plus { background: var(--ink); color: var(--paper); border-color: var(--ink); }
.tl__item.is-open .tl__plus { transform: rotate(45deg); background: var(--proj, var(--accent)); border-color: var(--proj, var(--accent)); color: #fff; }

.tl__body {
  max-height: 0;
  overflow: hidden;
  transition: max-height .6s var(--ease);
}

.tl__inner {
  padding: 0 clamp(14px, 2vw, 20px) clamp(14px, 2vw, 20px);
  border-top: 1px solid var(--line);
  margin-top: 2px;
  padding-top: 15px;
  display: grid;
  gap: 13px;
}

.tl__point { display: grid; grid-template-columns: 18px minmax(0, 1fr); gap: 4px 10px; }

.tl__point i {
  grid-row: 1 / span 2;
  width: 7px; height: 7px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--proj, var(--accent));
}

.tl__pt { font-size: 13.5px; font-weight: 600; }
.tl__pd { grid-column: 2; font-size: 12.5px; line-height: 1.7; color: var(--ink-2); }

.tl__tags { display: flex; flex-wrap: wrap; gap: 6px; padding-top: 2px; }

.tl__tag {
  font-family: var(--ff-mono);
  font-size: 9.5px;
  letter-spacing: .12em;
  text-transform: uppercase;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 4px 10px;
  color: var(--ink-3);
}

@media (max-width: 760px) {
  .tl__item { grid-template-columns: 20px minmax(0, 1fr); gap: 0 14px; }
  .tl__item::before { left: 9px; }
  .tl__node { grid-column: 1; grid-row: 1; justify-self: start; margin-left: 2px; }
  .tl__date { grid-column: 2; grid-row: 1; text-align: left; justify-items: start; padding-bottom: 8px; }
  .tl__card { grid-column: 2; grid-row: 2; }
  .tl__y { font-size: 17px; }
}

/* ---------- Fig.02 阶段 × 工具链 ---------- */
.pipe {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: clamp(20px, 3.4vh, 40px);
}

.pipe__step {
  position: relative;
  background: var(--paper);
  padding: clamp(15px, 1.6vw, 21px) clamp(12px, 1.2vw, 17px);
  display: grid;
  gap: 8px;
  align-content: start;
  transition: background .4s var(--ease), opacity .4s var(--ease);
}

.pipe:hover .pipe__step { opacity: .42; }
.pipe:hover .pipe__step:hover { opacity: 1; background: var(--card); }

.pipe__no {
  font-family: var(--ff-display);
  font-size: clamp(26px, 2.8vw, 42px);
  line-height: .82;
  color: transparent;
  -webkit-text-stroke: 1px var(--ink-3);
  transition: color .45s var(--ease), -webkit-text-stroke-color .45s;
}

.pipe__step:hover .pipe__no { color: var(--accent); -webkit-text-stroke-color: transparent; }

.pipe__cn { font-size: 14.5px; font-weight: 700; }

.pipe__en {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  margin-top: -5px;
}

.pipe__desc { font-size: 12px; line-height: 1.65; color: var(--ink-2); }

.pipe__tools { display: flex; flex-wrap: wrap; gap: 5px; padding-top: 4px; }

.tchip {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 4px 10px 4px 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 11px;
  font-weight: 500;
  white-space: nowrap;
  transition: background .3s var(--ease), color .3s, border-color .3s, transform .3s var(--ease);
}

.tchip b {
  width: 19px; height: 19px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-family: var(--ff-mono);
  font-size: 8px;
  font-weight: 400;
  transition: background .3s, color .3s;
}

.tchip--base b { background: var(--ink); color: var(--paper); }
.tchip--aigc b { border: 1px solid var(--ink-3); color: var(--ink-2); }
.tchip:hover { background: var(--ink); color: var(--paper); border-color: var(--ink); transform: translateY(-2px); }
.tchip:hover b { background: var(--accent); color: #fff; border-color: var(--accent); }

.pipe__legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 20px;
  padding-top: 14px;
  font-family: var(--ff-mono);
  font-size: 9.5px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
}

.pipe__legend span { display: inline-flex; align-items: center; gap: 7px; }
.pipe__legend i { width: 12px; height: 12px; border-radius: 50%; }
.pipe__legend i.is-base { background: var(--ink); }
.pipe__legend i.is-aigc { border: 1px solid var(--ink-3); }

@media (max-width: 1180px) { .pipe { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (max-width: 720px) { .pipe { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 460px) { .pipe { grid-template-columns: 1fr; } }

/* ---------- Fig.03 方向分布 ---------- */
.bars {
  display: grid;
  gap: 1px;
  background: var(--line);
  border: 1px solid var(--line);
  margin-top: clamp(20px, 3.4vh, 40px);
}

.bar {
  background: var(--paper);
  display: grid;
  grid-template-columns: 44px minmax(0, 220px) minmax(0, 1fr) auto;
  align-items: center;
  gap: clamp(10px, 1.6vw, 22px);
  padding: clamp(13px, 1.7vw, 19px) clamp(14px, 1.8vw, 22px);
  transition: background .4s var(--ease);
}

.bar:hover { background: var(--card); }

.bar__no {
  font-family: var(--ff-display);
  font-size: clamp(19px, 2vw, 28px);
  line-height: 1;
  color: var(--proj, var(--accent));
}

.bar__name { display: grid; gap: 1px; min-width: 0; }
.bar__cn { font-size: 14px; font-weight: 600; }

.bar__en {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--ink-3);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.bar__track {
  position: relative;
  height: 12px;
  background: var(--paper-2);
  overflow: hidden;
}

.bar__fill {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  background: var(--proj, var(--accent));
  transition: width 1.15s var(--ease);
  transition-delay: var(--d, 0ms);
}

.bar__val {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .12em;
  text-transform: uppercase;
  color: var(--ink-3);
  white-space: nowrap;
  text-align: right;
}

.bar__val b { font-family: var(--ff-display); font-size: 17px; color: var(--ink); letter-spacing: 0; margin-right: 3px; }

@media (max-width: 860px) {
  .bar { grid-template-columns: 34px minmax(0, 1fr) auto; }
  .bar__track { grid-column: 1 / -1; grid-row: 2; }
}

/* ---------- 无障碍 / 降级 ---------- */
@media (prefers-reduced-motion: reduce) {
  html { scroll-behavior: auto; }
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
  .rise, .card, .clip { opacity: 1 !important; transform: none !important; clip-path: none !important; }
  .hero__char { transform: none !important; }
  .grain { display: none; }
}

/* ?motion=0 手动关闭动效 */
html.no-motion { scroll-behavior: auto; }

html.no-motion *,
html.no-motion *::before,
html.no-motion *::after {
  animation-duration: .001ms !important;
  animation-iteration-count: 1 !important;
  transition-duration: .001ms !important;
}

html.no-motion .rise,
html.no-motion .card,
html.no-motion .clip { opacity: 1 !important; transform: none !important; clip-path: none !important; }
html.no-motion .hero__char { transform: none !important; }
html.no-motion .grain { display: none; }

.noscript {
  padding: 90px var(--gut);
  text-align: center;
  font-size: 14px;
}

/* =========================================================
   14b. Deck 改为「一览 + 焦点流」
   原来是左右翻页看 PPT：一次只能看一页，还得一直点。
   现在点开项目先给一屏一览（每个项目只有 2~8 页，一屏放得下），
   点某一页原地放大平移进焦点流，往下滚一页页看。
   这是一处改动、七个项目同时受益，不新增任何素材。
   ========================================================= */

/* 一览与舞台叠在同一个网格格子里（.deck 是 bar / 1fr / foot 三行），
   否则新插进来的元素会把行数撑乱。 */
.deck__over,
.deck__stage { grid-row: 2; grid-column: 1; min-height: 0; }

/* ---------- 模式切换 ---------- */
.deck__over {
  position: relative;
  overflow-y: auto;
  overscroll-behavior-y: contain;
  scrollbar-width: none;
  opacity: 0;
  pointer-events: none;
  transition: opacity .45s var(--ease);
}

.deck__over::-webkit-scrollbar { display: none; }

.deck.is-over .deck__over { opacity: 1; pointer-events: auto; }
.deck.is-over .deck__stage { opacity: 0; pointer-events: none; }
.deck.is-flow .deck__stage { opacity: 1; }

.deck__stage { transition: opacity .4s var(--ease); }

/* 在一览里就不需要「回一览」和上下翻页 */
.deck.is-over .deck__over-btn,
.deck.is-over .deck__count,
.deck.is-over [data-deck="prev"],
.deck.is-over [data-deck="next"] { display: none; }

.deck.is-over .deck__rail,
.deck.is-over .deck__prog,
.deck.is-over .deck__hint { display: none; }

.deck.is-over .deck__foot { padding-block: 8px; }

/* ---------- 项目色渗透：八个项目八种底 ---------- */
.deck__wash {
  position: absolute;
  inset: 0;
  z-index: 0;
  pointer-events: none;
  background:
    radial-gradient(58% 46% at 14% 6%,
      color-mix(in srgb, var(--proj, var(--accent)) 16%, transparent), transparent 72%),
    radial-gradient(50% 42% at 88% 92%,
      color-mix(in srgb, var(--proj, var(--accent)) 12%, transparent), transparent 74%);
}

.deck__overin {
  position: relative;
  z-index: 1;
  padding: clamp(14px, 2.6vh, 30px) var(--gut) clamp(20px, 4vh, 44px);
}

.deck__overlab {
  font-family: var(--ff-mono);
  font-size: 10px;
  letter-spacing: .2em;
  text-transform: uppercase;
  color: var(--ink-3);
  padding-bottom: clamp(12px, 2vh, 22px);
}

.deck__overlab b { color: var(--proj, var(--accent)); font-weight: 500; }

/* ---------- 一览网格 ---------- */
.deck__grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(clamp(190px, 22vw, 340px), 1fr));
  gap: clamp(10px, 1.6vw, 24px);
  perspective: 1400px;
}

.deck__cell {
  position: relative;
  aspect-ratio: 16 / 9;
  border: 1px solid var(--line);
  background: var(--paper-2, rgba(0, 0, 0, .04));
  overflow: hidden;
  cursor: pointer;
  text-align: left;
  /* 错拍落位：按栅格顺序一张张进场，像发牌铺开 */
  opacity: 0;
  transform: translateY(26px) scale(.96);
  transition:
    opacity .6s var(--ease), transform .7s var(--ease),
    border-color .35s, box-shadow .45s var(--ease);
  transition-delay: calc(var(--i, 0) * 55ms);
  will-change: transform;
}

.deck.is-over .deck__cell { opacity: 1; }

/* 指针视差：鼠标在一览上移动，卡片按自身深度层做轻微倾斜与位移。
   --gx/--gy 由 JS 一帧写一次在 .deck__grid 上，--z 是每张的深度系数。 */
.deck.is-over .deck__cell {
  transform:
    rotateY(calc(var(--gx, 0) * 4.5deg))
    rotateX(calc(var(--gy, 0) * -4.5deg))
    translate3d(calc(var(--gx, 0) * var(--z, 1) * 9px),
                calc(var(--gy, 0) * var(--z, 1) * 7px), 0);
}

.deck__cell:hover,
.deck__cell:focus-visible {
  border-color: var(--proj, var(--accent));
  box-shadow: 0 18px 40px rgba(0, 0, 0, .16);
  z-index: 2;
}

.deck.is-over .deck__cell:hover {
  transform:
    rotateY(calc(var(--gx, 0) * 4.5deg))
    rotateX(calc(var(--gy, 0) * -4.5deg))
    translate3d(calc(var(--gx, 0) * var(--z, 1) * 9px),
                calc(var(--gy, 0) * var(--z, 1) * 7px), 0)
    scale(1.03);
}

/* 一览里用 contain 看全版式 —— 也让转场时和焦点流的显示方式一致，
   放大平移过去不会出现裁切跳变 */
.deck__cell img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: contain;
  padding: 4px;
}

.deck__cellno {
  position: absolute;
  left: 0; top: 0;
  z-index: 2;
  padding: 5px 9px;
  background: var(--ink);
  color: var(--paper);
  font-family: var(--ff-mono);
  font-size: 9.5px;
  letter-spacing: .14em;
}

.deck__celltxt {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 2;
  padding: 22px 10px 8px;
  background: linear-gradient(to top, rgba(0, 0, 0, .8), transparent);
  color: #fff;
  display: grid;
  gap: 2px;
  opacity: 0;
  transition: opacity .35s var(--ease);
}

.deck__cell:hover .deck__celltxt,
.deck__cell:focus-visible .deck__celltxt { opacity: 1; }

.deck__celltxt b { font-size: 12.5px; font-weight: 600; }

.deck__celltxt span {
  font-family: var(--ff-mono);
  font-size: 9px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, .7);
}

/* ---------- 焦点流：舞台改成纵向 ---------- */
.deck__stage {
  flex-direction: column;
  overflow-x: hidden;
  overflow-y: auto;
  scroll-snap-type: y proximity;
  overscroll-behavior-x: auto;
  overscroll-behavior-y: contain;
}

.deck__slide {
  position: relative;
  flex: 0 0 var(--stage-h, 100%);
  height: var(--stage-h, 100%);
  scroll-snap-align: center;
}

/* 当前页实、前后页退到后面并加景深 —— 焦点在页与页之间转移 */
.deck__figure {
  transform: scale(.9);
  opacity: .26;
  filter: blur(2.5px);
  transition:
    transform .8s var(--ease), opacity .6s var(--ease), filter .6s var(--ease);
}

.deck__slide.is-cur .deck__figure { transform: none; opacity: 1; filter: none; }

/* ---------- 巨大页码：纯排版，零素材 ---------- */
.deck__no {
  position: absolute;
  left: clamp(4px, 1.6vw, 34px);
  top: 50%;
  z-index: 0;
  display: grid;
  gap: 8px;
  pointer-events: none;
  color: var(--proj, var(--accent));
  opacity: 0;
  transform: translateY(-50%) translateX(-28px);
  transition: opacity .7s var(--ease), transform .9s var(--ease);
}

.deck__slide.is-cur .deck__no { opacity: .13; transform: translateY(-50%); }

.deck__no b {
  font-family: var(--ff-display);
  font-size: clamp(78px, 19vw, 300px);
  font-weight: 400;
  line-height: .8;
  letter-spacing: -.02em;
}

.deck__no s {
  text-decoration: none;
  font-family: var(--ff-mono);
  font-size: clamp(10px, 1.1vw, 15px);
  letter-spacing: .24em;
  text-transform: uppercase;
  padding-left: .3em;
}

/* 图框要压在页码之上 */
.deck__slide .deck__figure { z-index: 1; }

/* ---------- 一览 → 焦点流 的原页放大转场 ---------- */
.deck__flip {
  position: fixed;
  left: 0; top: 0;
  z-index: 9150;
  object-fit: contain;
  pointer-events: none;
  opacity: 0;
  transform-origin: top left;
  will-change: transform;
}

.deck__flip.is-fly { opacity: 1; }

/* 飞行期间把落点那张藏起来，避免出现两张 */
.deck.is-flip .deck__slide.is-cur .deck__figure { opacity: 0; filter: none; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .deck__grid { grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); }
  .deck__no b { font-size: clamp(56px, 26vw, 150px); }
  .deck__no { opacity: 0; }
  .deck__slide.is-cur .deck__no { opacity: .1; }
}

@media (max-height: 720px) {
  .deck__overin { padding-block: 10px 16px; }
}

/* ---------- 降级 ---------- */
.no-motion .deck__cell,
.no-motion .deck.is-over .deck__cell {
  opacity: 1;
  transform: none;
  transition: none;
}

.no-motion .deck__figure { transform: none; opacity: 1; filter: none; }
.no-motion .deck__no { opacity: .12; transform: translateY(-50%); }
.no-motion .deck__flip { display: none; }

@media (prefers-reduced-motion: reduce) {
  .deck__cell { opacity: 1; transform: none; transition: none; }
  .deck__figure { transform: none; opacity: 1; filter: none; }
  .deck__no { opacity: .12; transform: translateY(-50%); }
  .deck__flip { display: none; }
}

/* =========================================================
   14c. 一览的排布修正
   第一版用 auto-fill 铺格子，5 页会排成 4+1，下面空掉三分之二屏。
   改成 flex 换行 + 居中：列数由 JS 按页数下发，末行不满也居中，
   内容比一屏矮时整体垂直居中，不再出现大片空白。
   ========================================================= */
.deck__over { display: flex; }

.deck__overin {
  flex: 1 1 auto;
  min-height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.deck__grid {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  align-content: center;
  /* gap 参与列宽计算，所以单独存一份 */
  --gap: clamp(10px, 1.6vw, 24px);
  gap: var(--gap);
  grid-template-columns: none;
}

.deck__cell {
  flex: 0 0 calc((100% - (var(--cols, 3) - 1) * var(--gap)) / var(--cols, 3));
  /* 缩略图原生 1000px 宽，单张再大就该换 full 了（srcset 已备好） */
  max-width: 560px;
}

@media (max-width: 720px) {
  .deck__cell { flex-basis: calc((100% - var(--gap)) / 2); max-width: none; }
}

@media (max-width: 460px) {
  .deck__cell { flex-basis: 100%; }
}

/* =========================================================
   14d. 一览改用 12 栏 grid system
   上一版是等宽 flex 换行：5 页会排成 3+2，末行那张孤零零地吊在下面。
   现在每一行的卡片跨度加起来正好 12 栏 —— 行内等宽所以齐平无缝，
   行与行的卡片数不同（2 张 / 3 张），大小自然有变化。
   行数少时整块撑满可用高度；行数多了才让它滚。
   ========================================================= */
.deck__overin { display: flex; flex-direction: column; min-height: 100%; }

.deck__grid {
  display: grid;
  grid-template-columns: repeat(12, minmax(0, 1fr));
  grid-auto-flow: row;
  gap: var(--gap);
  align-content: stretch;
  justify-content: stretch;
  /* 覆盖上一版的 flex 设定 */
  flex-wrap: nowrap;
}

.deck__cell {
  /* 跨几栏由 JS 按当前行的卡片数下发；同一行内一律等宽，所以不会错位 */
  grid-column: span var(--span, 4);
  flex: none;
  max-width: none;
  aspect-ratio: auto;
}

/* 原稿页全部是 16:9，所以格子也锁死 16:9 —— 图正好填满格子，
   不会像行高等分那样在格子里留出空带。
   行高由格子自己的比例决定，整块高度则靠 JS 选行方案去贴合一屏。 */
.deck__cell {
  aspect-ratio: 16 / 9;
  background: color-mix(in srgb, var(--proj, var(--accent)) 5%, var(--paper));
}

/* 内容比一屏矮就整块居中，比一屏高就正常往下滚 */
.deck__grid { align-content: center; }
.deck__grid.is-scroll { align-content: start; }

@media (max-width: 720px) {
  /* 窄屏不玩跨栏：一行两张，最后一张单数时占满 */
  .deck__grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .deck__cell { grid-column: span 1 !important; aspect-ratio: 16 / 9; }
  .deck__grid.is-fill { grid-template-rows: none; flex: 0 0 auto; }
}

@media (max-width: 460px) {
  .deck__grid { grid-template-columns: 1fr; }
}

/* =========================================================
   14e. 修：内容超高时顶部被顶栏挡住且滚不回来
   之前对一览做了垂直居中。居中在内容比容器高的时候有个经典副作用：
   起始边的溢出会被裁掉、也滚不到 —— 表现就是第一行藏在顶栏后面，
   连「一览 · 0X 页」那行说明都一起被顶出去。
   所以默认一律靠上，只有 JS 实测装得下才加 is-short 居中。
   ========================================================= */
.deck__overin { justify-content: flex-start; }
.deck__grid { align-content: start; }

.deck__over.is-short .deck__overin { justify-content: center; }
.deck__over.is-short .deck__grid { align-content: center; }

/* 顶栏是实心的，内容滚到它下面时要有个收口，不然文字会贴着栏底 */
.deck__overin { padding-top: clamp(14px, 2.6vh, 30px); }

/* =========================================================
   手机端修正
   1. 跑马灯是装饰件，在窄屏上宽 3341px、超出视口两千多，
      读不出内容只添乱，小屏直接收掉。
   2. 图集顶栏的工具按钮在窄屏容易挤成两行，压一压间距。
   ========================================================= */
@media (max-width: 720px) {
  .ticker { display: none; }

  .deck__bar { gap: 8px; padding-inline: 12px; }
  .deck__tools { gap: 4px; }
  .deck__count { min-width: 48px; font-size: 10px; }
}
