/* ==========================================================
   王誉衡 · 作品集  —  全站样式
   结构：tokens → base → 通用组件 → 首页 → 项目页 → 动效
   ========================================================== */

:root {
  --bg: #060607;
  --bg-2: #0d0d0f;
  --bg-3: #151518;
  --line: rgba(255, 255, 255, .12);
  --line-strong: rgba(255, 255, 255, .28);
  --text: #f2f2f0;
  --muted: #a3a3ab;
  --faint: #62626b;

  --p1: #8fb4ff;          /* 神圣巨构：冷钢蓝 */
  --p2: #ff2a6d;          /* 别关这个窗口：游戏里唯一的颜色——品红 */
  --p3: #ff4433;          /* 丧尸生存解谜：手术区的警报红 */
  --p4: #d4a05a;          /* 骰碰骰：作品集里的黄铜色 */
  --accent: #f2f2f0;

  --f-sans: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei UI", "Microsoft YaHei", "Noto Sans SC", "Source Han Sans SC", system-ui, -apple-system, "Segoe UI", Roboto, sans-serif;
  --f-display: "Bahnschrift", "DIN Condensed", "DIN Alternate", "Avenir Next Condensed", "Arial Narrow", "Helvetica Neue", var(--f-sans);
  --f-mono: "Cascadia Mono", "SFMono-Regular", ui-monospace, Consolas, monospace;

  --gutter: clamp(16px, 4vw, 56px);
  --maxw: 1320px;
  --header-h: 64px;
  --ease: cubic-bezier(.2, .7, .1, 1);
}

.theme-p1 { --accent: var(--p1); }
.theme-p2 { --accent: var(--p2); }
.theme-p3 { --accent: var(--p3); }
.theme-p4 { --accent: var(--p4); }

/* ---------- base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: var(--f-sans);
  font-size: 17px;
  line-height: 1.75;
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}
img { display: block; max-width: 100%; height: auto; }
a { color: inherit; text-decoration: none; }
p { margin: 0 0 1em; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 800; letter-spacing: -.01em; text-wrap: balance; }
.lead, .statement, .quote p, .tagline, .q, .wr-line { text-wrap: balance; }
::selection { background: var(--accent); color: #000; }

/* 中英切换：默认中文；<html data-lang="en"> 时显示英文 */
html[data-lang="en"] .zh { display: none !important; }
html:not([data-lang="en"]) .en { display: none !important; }

/* 胶片颗粒：全站一层很淡的噪点，让纯黑有质感 */
body::after {
  content: "";
  position: fixed; inset: -50%;
  pointer-events: none; z-index: 90;
  opacity: .055;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='160' height='160'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  animation: grain 1.2s steps(6) infinite;
}
@keyframes grain {
  0% { transform: translate(0, 0); } 20% { transform: translate(-3%, 2%); } 40% { transform: translate(2%, -4%); }
  60% { transform: translate(-4%, -1%); } 80% { transform: translate(3%, 3%); } 100% { transform: translate(0, 0); }
}

.wrap { width: 100%; max-width: var(--maxw); margin: 0 auto; padding: 0 var(--gutter); }
.display { font-family: var(--f-display); font-stretch: 75%; font-weight: 700; text-transform: uppercase; letter-spacing: -.005em; line-height: .88; }
.mono { font-family: var(--f-mono); letter-spacing: .04em; }
.kicker { font-family: var(--f-mono); font-size: 12px; letter-spacing: .22em; text-transform: uppercase; color: var(--muted); }
.kicker b { color: var(--accent); font-weight: 400; }
.muted { color: var(--muted); }
.accent { color: var(--accent); }

/* ---------- header ---------- */
.site-header {
  position: fixed; top: 0; left: 0; right: 0; z-index: 50;
  height: var(--header-h);
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  padding: 0 var(--gutter);
  transition: transform .45s var(--ease), background .3s, border-color .3s;
  border-bottom: 1px solid transparent;
}
.site-header.scrolled { background: rgba(6, 6, 7, .78); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-bottom-color: var(--line); }
.site-header.hide { transform: translateY(-100%); }
.brand { display: flex; align-items: baseline; gap: 12px; font-weight: 800; font-size: 17px; letter-spacing: .04em; white-space: nowrap; }
.brand .display { font-size: 19px; line-height: 1; letter-spacing: .08em; color: var(--muted); font-weight: 600; }
.nav { display: flex; align-items: center; gap: clamp(14px, 2.4vw, 32px); font-size: 14px; }
.nav a { position: relative; color: var(--muted); transition: color .2s; }
.nav a:hover, .nav a.active { color: var(--text); }
.nav a::after { content: ""; position: absolute; left: 0; right: 100%; bottom: -4px; height: 1px; background: var(--accent); transition: right .35s var(--ease); }
.nav a:hover::after, .nav a.active::after { right: 0; }
.lang-toggle {
  font: 600 12px/1 var(--f-mono); letter-spacing: .12em;
  color: var(--text); background: transparent; cursor: pointer;
  border: 1px solid var(--line-strong); border-radius: 999px; padding: 8px 12px;
  transition: border-color .2s, background .2s, color .2s;
}
.lang-toggle:hover { background: var(--text); color: #000; border-color: var(--text); }
@media (max-width: 640px) {
  .nav .nav-link { display: none; }
  .brand .display { display: none; }
}

/* 顶部滚动进度条（项目页） */
.progress { position: fixed; top: 0; left: 0; height: 2px; width: 100%; z-index: 60; transform-origin: 0 50%; transform: scaleX(0); background: var(--accent); }

/* ---------- buttons ---------- */
.btn {
  display: inline-flex; align-items: center; gap: 12px;
  padding: 16px 26px; border: 1px solid var(--line-strong);
  font-weight: 700; font-size: 15px; letter-spacing: .04em; line-height: 1.3;
  position: relative; overflow: hidden; isolation: isolate;
  background: rgba(0, 0, 0, .25);
  transition: color .35s var(--ease), border-color .35s;
}
.btn::before { content: ""; position: absolute; inset: 0; z-index: -1; background: var(--accent); transform: translateY(101%); transition: transform .45s var(--ease); }
.btn:hover { color: #000; border-color: var(--accent); }
.btn:hover::before { transform: translateY(0); }
.btn .arrow { transition: transform .35s var(--ease); }
.btn:hover .arrow { transform: translateX(5px); }
.btn.solid { background: var(--accent); color: #000; border-color: var(--accent); }
.btn.solid::before { background: var(--text); }
.btn small { font-weight: 400; opacity: .75; letter-spacing: 0; }
.btn-row { display: flex; flex-wrap: wrap; gap: 12px; }

/* ==========================================================
   首页
   ========================================================== */

/* 首屏：3D 纵深长廊。走廊（canvas）延伸到远处的光里，所有作品的画面悬挂在不同深度；
   鼠标移动时消失点跟着偏，向下滚动时镜头沿走廊往前推进。作品画面由下方作品目录自动生成。 */
.depth-hero { position: relative; height: 260vh; background: #000; }
.dh-sticky { position: sticky; top: 0; height: 100vh; height: 100svh; min-height: 560px; overflow: hidden; background: #000; }
.dh-canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.dh-view { position: absolute; inset: 0; perspective: 900px; perspective-origin: 50% 46%; }
.dh-world { position: absolute; left: 50%; top: 46%; width: 0; height: 0; transform-style: preserve-3d; }
.dh-panel { position: absolute; left: 0; top: 0; display: block; transform-style: preserve-3d; will-change: transform, opacity; opacity: 0; }
.dh-panel .frame { display: block; position: relative; aspect-ratio: 16 / 9; overflow: hidden; background: #111; outline: 1px solid rgba(255,255,255,.22); box-shadow: 0 50px 140px rgba(0,0,0,.75); }
.dh-panel .frame::after { content: ""; position: absolute; inset: 0; background: linear-gradient(180deg, transparent 55%, rgba(0,0,0,.45)); }
.dh-panel img { width: 100%; height: 100%; object-fit: cover; }
.dh-panel::before { content: ""; position: absolute; left: 0; top: -14px; width: 56px; height: 4px; background: var(--pc, #fff); box-shadow: 0 0 18px var(--pc, #fff); }
.dh-panel .cap { display: flex; gap: 14px; align-items: baseline; margin-top: 16px; font: 600 15px/1.3 var(--f-mono); letter-spacing: .16em; color: rgba(255,255,255,.85); text-transform: uppercase; white-space: nowrap; }
.dh-panel .cap b { color: var(--pc, #fff); }
.dh-end { position: absolute; left: 0; top: 0; white-space: nowrap; font-size: 260px; color: transparent; -webkit-text-stroke: 2px rgba(255,255,255,.55); will-change: transform; }

.dh-shade { position: absolute; inset: 0; z-index: 2; pointer-events: none; background: linear-gradient(to top, rgba(0,0,0,.92) 0%, rgba(0,0,0,.35) 32%, transparent 55%), linear-gradient(to bottom, rgba(0,0,0,.65), transparent 18%); }
.dh-front {
  position: absolute; inset: 0; z-index: 3; pointer-events: none;
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: calc(var(--header-h) + 24px) var(--gutter) clamp(28px, 6vh, 72px);
  transform-origin: 28% 78%; will-change: transform, opacity;
}
.dh-front a { pointer-events: auto; }
.dh-hud { position: absolute; z-index: 3; top: calc(var(--header-h) + 22px); left: var(--gutter); right: var(--gutter); display: flex; justify-content: space-between; gap: 16px; pointer-events: none; }
.dh-hud .kicker { color: rgba(255,255,255,.7); }
.dh-hud .depth { font-variant-numeric: tabular-nums; }

.hero-name { position: relative; }
.hero-name .cn {
  display: block;
  font-size: clamp(84px, 18vw, 320px); font-weight: 900; line-height: .86; letter-spacing: -.05em;
  color: var(--text);
  text-shadow: 0 12px 80px rgba(0,0,0,.8);
}
.hero-name .en-name {
  display: block; margin-top: .14em;
  font-size: clamp(38px, 8vw, 150px);
  color: transparent; -webkit-text-stroke: 1.5px rgba(255,255,255,.9);
  letter-spacing: .02em;
}
.hero-meta { display: flex; flex-wrap: wrap; align-items: flex-end; justify-content: space-between; gap: 24px 48px; margin-top: clamp(20px, 4vh, 44px); }
.hero-role { font-size: clamp(18px, 2.1vw, 28px); font-weight: 800; line-height: 1.4; margin: 0; }
.hero-role .slash { color: var(--muted); padding: 0 .35em; font-weight: 400; }
.hero-role .sub { display: block; font-size: 14px; font-weight: 400; color: var(--muted); margin-top: 8px; }
.scroll-cue { display: flex; align-items: center; gap: 12px; font: 12px/1 var(--f-mono); letter-spacing: .2em; color: var(--muted); text-transform: uppercase; }
.scroll-cue i { display: block; width: 1px; height: 44px; background: linear-gradient(var(--text), transparent); animation: cue 1.8s var(--ease) infinite; transform-origin: top; }
@keyframes cue { 0% { transform: scaleY(0); } 50% { transform: scaleY(1); } 100% { transform: scaleY(1); opacity: 0; } }
.hero-name .cn, .hero-name .en-name, .hero-meta, .dh-hud { animation: rise 1.2s var(--ease) both; }
.hero-name .cn { animation-delay: .5s; }
.hero-name .en-name { animation-delay: .65s; }
.hero-meta { animation-delay: .8s; }
.dh-hud { animation-delay: 1s; }
.dh-canvas, .dh-view { animation: dhIn 2.2s var(--ease) both; }
@keyframes dhIn { from { opacity: 0; transform: scale(1.25); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .depth-hero { height: auto; }
  .dh-sticky { position: relative; }
}

/* 滚动字幕带 */
.marquee { position: relative; overflow: hidden; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); padding: 20px 0; background: var(--bg); }
.marquee .track { display: flex; align-items: center; width: max-content; animation: marquee 40s linear infinite; }
.marquee span { font-size: clamp(44px, 6.4vw, 96px); padding-right: .45em; white-space: nowrap; }
.marquee .solid { color: var(--text); }
.marquee .hollow { color: transparent; -webkit-text-stroke: 1.5px var(--text); }
.marquee .dot { font-size: clamp(22px, 2.6vw, 40px); }
.marquee .dot.a { color: var(--p2); }
.marquee .dot.b { color: var(--p4); }
@keyframes marquee { to { transform: translateX(-50%); } }

/* 区块标题 */
.section { padding: clamp(80px, 13vw, 180px) 0; position: relative; }
.section-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 16px 24px; margin-bottom: clamp(36px, 6vw, 72px); }
.section-head h2 { font-size: clamp(56px, 10vw, 160px); }
.section-head .count { font-size: clamp(14px, 1.4vw, 17px); color: var(--muted); max-width: 26em; }

/* 作品目录：一行一个项目，作品再多也排得下；缩略图带透视，悬停时转正、浮起 */
.work-index { border-top: 1px solid var(--line); }
.work-row {
  --accent: var(--wk);
  position: relative; isolation: isolate;
  display: grid; grid-template-columns: clamp(64px, 9vw, 150px) minmax(0, 1fr) minmax(0, 44%);
  gap: clamp(18px, 3vw, 52px); align-items: center;
  padding: clamp(32px, 4.4vw, 64px) 0; border-bottom: 1px solid var(--line);
  perspective: 1400px;
}
.work-row::before { content: ""; position: absolute; top: 0; bottom: 0; left: calc(var(--gutter) * -1); right: calc(var(--gutter) * -1); z-index: -1; background: linear-gradient(90deg, color-mix(in srgb, var(--accent) 16%, transparent), transparent 75%); opacity: 0; transition: opacity .6s; }
.work-row:hover::before { opacity: 1; }
.wr-num { align-self: start; font-size: clamp(60px, 8.4vw, 136px); line-height: .78; color: transparent; -webkit-text-stroke: 1.5px var(--accent); transition: color .5s; }
.work-row:hover .wr-num { color: var(--accent); }
.wr-title { font-size: clamp(34px, 4.8vw, 76px); font-weight: 900; letter-spacing: -.04em; line-height: 1.02; }
.wr-title .display { display: block; font-size: .5em; color: var(--accent); margin-top: .28em; letter-spacing: 0; font-weight: 700; }
.wr-line { color: rgba(255,255,255,.82); margin: 20px 0 0; max-width: 30em; }
.wr-foot { display: flex; flex-wrap: wrap; align-items: center; gap: 12px 20px; margin-top: 24px; }
.wr-go { display: inline-flex; gap: 12px; align-items: center; font-weight: 800; letter-spacing: .06em; }
.wr-go .bar { width: 40px; height: 2px; background: var(--accent); transition: width .5s var(--ease); }
.work-row:hover .wr-go .bar { width: 96px; }
.wr-thumb {
  position: relative; margin: 0; aspect-ratio: 16 / 10; overflow: hidden; background: var(--bg-3);
  outline: 1px solid var(--line-strong);
  transform: rotateY(-18deg) rotateX(5deg) translateZ(-40px); transform-origin: 100% 50%;
  box-shadow: -40px 50px 90px rgba(0,0,0,.65);
  transition: transform .9s var(--ease), box-shadow .9s var(--ease);
}
.work-row:hover .wr-thumb { transform: rotateY(-3deg) rotateX(0) translateZ(30px); box-shadow: -50px 70px 140px rgba(0,0,0,.8); }
.wr-thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: opacity .7s, transform 1.4s var(--ease); }
.wr-thumb img + img { opacity: 0; }
.work-row:hover .wr-thumb img + img { opacity: 1; }
.work-row:hover .wr-thumb img { transform: scale(1.04); }
.wr-thumb .badge { position: absolute; left: 14px; top: 14px; z-index: 2; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; }
.tag { font: 12px/1 var(--f-mono); letter-spacing: .08em; padding: 8px 10px; border: 1px solid var(--line-strong); color: rgba(255,255,255,.88); background: rgba(0,0,0,.4); }
.badge { font: 600 12px/1 var(--f-mono); letter-spacing: .14em; color: #000; background: var(--accent); padding: 9px 11px; white-space: nowrap; }
@media (max-width: 860px) {
  .work-row { grid-template-columns: minmax(0, 1fr); gap: 18px; }
  .wr-num { font-size: 64px; }
  .wr-thumb { order: -1; transform: none; box-shadow: none; }
  .work-row:hover .wr-thumb { transform: none; box-shadow: none; }
}

/* 关于 */
.statement { font-size: clamp(30px, 4.8vw, 72px); font-weight: 900; line-height: 1.2; letter-spacing: -.03em; max-width: 19em; }
.statement em { font-style: normal; background: linear-gradient(90deg, var(--p2), var(--p4)); -webkit-background-clip: text; background-clip: text; color: transparent; }
.statement-src { margin-top: 22px; color: var(--muted); font-size: 14px; }
.about-grid { display: grid; grid-template-columns: repeat(12, 1fr); gap: clamp(36px, 4vw, 56px) 32px; margin-top: clamp(64px, 9vw, 120px); padding-top: clamp(40px, 5vw, 64px); border-top: 1px solid var(--line); }
.about-grid > * { grid-column: span 6; min-width: 0; }
.about-grid h3 { font: 400 12px/1 var(--f-mono); letter-spacing: .22em; text-transform: uppercase; color: var(--muted); margin-bottom: 20px; }
.about-grid .big { font-size: clamp(19px, 1.7vw, 23px); font-weight: 800; line-height: 1.45; margin-bottom: 14px; }
.about-grid ul { list-style: none; margin: 0; padding: 0; }
.about-grid li { padding: 13px 0; border-bottom: 1px solid var(--line); }
.about-grid li:first-child { padding-top: 0; }
.about-grid li b { display: block; font-size: 15.5px; line-height: 1.5; }
.about-grid li span { color: var(--muted); font-size: 13.5px; }
.skill-group + .skill-group { margin-top: 18px; }
.skill-group .label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip { font-size: 13px; padding: 5px 10px; border: 1px solid var(--line); color: rgba(255,255,255,.88); }
@media (max-width: 900px) { .about-grid > * { grid-column: span 12; } }

/* 联系 */
.contact { padding: clamp(90px, 14vw, 200px) 0 clamp(48px, 7vw, 96px); border-top: 1px solid var(--line); position: relative; overflow: hidden; }
.contact .kicker { margin-bottom: 26px; display: block; }
.contact h2 { font-size: clamp(56px, 12vw, 200px); line-height: .9; letter-spacing: -.04em; }
.contact .mail { text-transform: none; display: inline-block; margin-top: clamp(28px, 4vw, 48px); font-size: clamp(26px, 5vw, 76px); line-height: 1.05; word-break: break-all; position: relative; }
.contact .mail::after { content: ""; position: absolute; left: 0; right: 0; bottom: -.1em; height: 3px; background: linear-gradient(90deg, var(--p2), var(--p4)); transform: scaleX(.2); transform-origin: left; transition: transform .7s var(--ease); }
.contact .mail:hover::after { transform: scaleX(1); }
.contact-note { margin-top: 26px; color: var(--muted); font-size: 15px; }

.site-footer { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 10px 24px; padding: 26px var(--gutter); border-top: 1px solid var(--line); font-size: 13px; color: var(--faint); }
.site-footer a:hover { color: var(--muted); }
.icp:empty { display: none; }

/* ==========================================================
   项目页
   ========================================================== */

/* 首屏：满屏大图 + 电影黑边开场（黑边从中间向上下退开） */
.p-hero { position: relative; height: 100vh; height: 100svh; min-height: 660px; overflow: hidden; background: #000; }
.p-hero .bg { position: absolute; inset: 0; }
.p-hero .bg img { width: 100%; height: 100%; object-fit: cover; animation: heroIn 2.6s var(--ease) both; }
@keyframes heroIn { from { transform: scale(1.25); filter: brightness(.15); } to { transform: scale(1.06); filter: brightness(1); } }
.p-hero::after { content: ""; position: absolute; inset: 0; z-index: 1; background: linear-gradient(to top, var(--bg) 0%, rgba(6,6,7,.82) 28%, rgba(6,6,7,.2) 60%, rgba(0,0,0,.45) 100%); }
.p-hero .bars::before, .p-hero .bars::after { content: ""; position: absolute; left: 0; right: 0; height: 50%; background: #000; z-index: 3; animation: barsOpen 1.7s .1s var(--ease) both; }
.p-hero .bars::before { top: 0; transform-origin: top; }
.p-hero .bars::after { bottom: 0; transform-origin: bottom; }
@keyframes barsOpen { from { transform: scaleY(1); } to { transform: scaleY(.11); } }
.p-hero .content { position: absolute; inset: 0; z-index: 4; display: flex; flex-direction: column; justify-content: flex-end; padding: 0 var(--gutter) clamp(64px, 13vh, 150px); }
.p-hero .num-bg { position: absolute; right: calc(var(--gutter) - .04em); top: 11%; z-index: 2; font-size: clamp(170px, 31vw, 500px); color: transparent; -webkit-text-stroke: 1.5px var(--accent); opacity: .6; pointer-events: none; animation: rise 1.4s .6s var(--ease) both; }
.p-hero .kicker { margin-bottom: 20px; }
.p-hero h1 .cn { display: block; font-size: clamp(58px, 11.5vw, 200px); font-weight: 900; letter-spacing: -.05em; line-height: .92; }
.p-hero h1 .en-title { display: block; font-size: clamp(28px, 5vw, 84px); color: var(--accent); margin-top: .16em; }
.p-hero .tagline { font-size: clamp(17px, 1.7vw, 23px); max-width: 30em; margin: 26px 0 0; color: rgba(255,255,255,.9); line-height: 1.6; }
.p-hero .btn-row { margin-top: 32px; }
.p-hero .content > * { animation: rise 1.1s var(--ease) both; }
.p-hero .content > *:nth-child(1) { animation-delay: .7s; }
.p-hero .content > *:nth-child(2) { animation-delay: .85s; }
.p-hero .content > *:nth-child(3) { animation-delay: 1s; }
.p-hero .content > *:nth-child(4) { animation-delay: 1.15s; }
@keyframes rise { from { opacity: 0; transform: translateY(40px); } to { opacity: 1; transform: none; } }

/* 项目信息条 */
.meta-strip { display: grid; grid-template-columns: repeat(auto-fit, minmax(180px, 1fr)); margin: 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.meta-strip > div { padding: 22px 20px; border-left: 1px solid var(--line); }
.meta-strip > div:first-child { border-left: 0; padding-left: 0; }
.meta-strip dt { font: 11px/1 var(--f-mono); letter-spacing: .2em; color: var(--faint); text-transform: uppercase; margin-bottom: 10px; }
.meta-strip dd { margin: 0; font-size: 15px; line-height: 1.55; }
@media (max-width: 640px) { .meta-strip > div { border-left: 0; padding-left: 0; border-top: 1px solid var(--line); } .meta-strip > div:first-child { border-top: 0; } }

/* 章节导航 */
.toc { display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr)); margin-top: 48px; }
.toc a { padding: 16px 14px 16px 0; border-top: 2px solid var(--line); font-size: 14px; line-height: 1.45; color: var(--muted); transition: color .2s, border-color .3s; }
.toc a b { display: block; font-family: var(--f-display); font-stretch: 75%; font-size: 30px; line-height: 1; color: var(--text); margin-bottom: 8px; font-weight: 700; }
.toc a:hover { color: var(--text); border-color: var(--accent); }

/* 章节 */
.chapter { position: relative; padding: clamp(100px, 14vw, 200px) 0 clamp(30px, 5vw, 60px); isolation: isolate; }
.chapter-head { position: relative; margin-bottom: clamp(44px, 6vw, 84px); }
.chapter-head .big-num { position: absolute; right: -.02em; top: -.5em; font-size: clamp(170px, 30vw, 460px); color: transparent; -webkit-text-stroke: 1.5px var(--accent); opacity: .3; pointer-events: none; z-index: -1; }
.chapter-head .kicker { display: block; margin-bottom: 20px; }
.chapter-head h2 { font-size: clamp(40px, 6.6vw, 100px); letter-spacing: -.035em; max-width: 12em; }
.chapter-head .q { margin-top: 20px; font-size: clamp(16px, 1.5vw, 20px); color: var(--muted); max-width: 36em; }

.lead { font-size: clamp(22px, 2.5vw, 36px); line-height: 1.48; font-weight: 800; letter-spacing: -.015em; max-width: 25em; margin-bottom: 0; }
.lead em { font-style: normal; color: var(--accent); }
.body-cols { columns: 2 340px; column-gap: 56px; color: rgba(255,255,255,.84); }
.body-cols p { break-inside: avoid; }
.prose { max-width: 40em; color: rgba(255,255,255,.86); }
.prose b, .body-cols b { color: var(--text); }
.sub-head { font-size: clamp(26px, 2.8vw, 40px); margin: clamp(64px, 9vw, 120px) 0 30px; letter-spacing: -.025em; }
.sub-head small { display: block; font: 12px/1 var(--f-mono); letter-spacing: .2em; color: var(--accent); text-transform: uppercase; margin-bottom: 16px; font-weight: 400; }
.mt-l { margin-top: clamp(40px, 6vw, 72px); }
.mt-m { margin-top: clamp(24px, 3vw, 40px); }

/* 图片 */
figure { margin: 0; }
.fig { position: relative; overflow: hidden; background: var(--bg-3); cursor: zoom-in; }
.fig img { width: 100%; transition: transform 1.1s var(--ease); }
.fig:hover img { transform: scale(1.02); }
figcaption { font-size: 13.5px; line-height: 1.6; color: var(--muted); padding: 12px 0 0; }
figcaption b { color: var(--text); font-weight: 700; margin-right: 8px; }
.bleed { width: 100vw; margin-left: calc(50% - 50vw); }
.bleed figcaption { padding-left: var(--gutter); padding-right: var(--gutter); }
.cinema { aspect-ratio: 2.35 / 1; }
.cinema img { height: 100%; object-fit: cover; }
.grid-2 { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: clamp(14px, 2vw, 28px); }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(14px, 2vw, 24px); }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: clamp(12px, 1.6vw, 20px); }
@media (max-width: 900px) { .grid-3, .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (max-width: 600px) { .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); } }
.offset-r { margin-left: auto; width: min(100%, 80%); }
@media (max-width: 760px) { .offset-r { width: 100%; } }

/* 文字 + 图 左右排 */
.split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 7fr); gap: clamp(28px, 4vw, 64px); align-items: center; }
.split.rev { grid-template-columns: minmax(0, 7fr) minmax(0, 5fr); }
.split.rev > :first-child { order: 2; }
.split h3 { font-size: clamp(26px, 2.8vw, 40px); letter-spacing: -.025em; margin-bottom: 18px; }
.split h3 small { display: block; font: 12px/1 var(--f-mono); letter-spacing: .2em; color: var(--accent); text-transform: uppercase; margin-bottom: 16px; font-weight: 400; }
.split p { color: rgba(255,255,255,.84); }
@media (max-width: 900px) { .split, .split.rev { grid-template-columns: minmax(0, 1fr); } .split.rev > :first-child { order: 0; } }

/* 卡片 */
.cards { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 260px), 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.card { background: var(--bg); padding: clamp(24px, 2.6vw, 38px); position: relative; transition: background .35s; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.card::after { content: ""; position: absolute; left: 0; top: 0; height: 2px; width: 0; background: var(--accent); transition: width .6s var(--ease); }
.card:hover { background: var(--bg-2); }
.card:hover::after { width: 100%; }
.card .n { font-family: var(--f-display); font-stretch: 75%; font-weight: 700; font-size: 58px; line-height: .85; color: var(--accent); display: block; margin-bottom: 24px; }
.card h4 { font-size: clamp(19px, 1.7vw, 24px); margin-bottom: 12px; }
.card p { color: var(--muted); font-size: 15px; line-height: 1.72; margin: 0; }
.card p + p { margin-top: 10px; }
.card .label { font: 11px/1 var(--f-mono); letter-spacing: .18em; color: var(--accent); text-transform: uppercase; display: block; margin: 18px 0 8px; }
.card .first { font: 12px/1.4 var(--f-mono); color: var(--faint); margin-top: 18px; display: block; }

/* 大数字 */
.stats { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 210px), 1fr)); gap: clamp(36px, 4vw, 56px) 32px; }
.stat { min-width: 0; }
.stat .v { font-family: var(--f-display); font-stretch: 75%; font-weight: 700; font-size: clamp(60px, 6.4vw, 112px); line-height: .82; color: var(--accent); letter-spacing: -.01em; display: block; white-space: nowrap; }
.stats.words { grid-template-columns: repeat(auto-fit, minmax(min(100%, 250px), 1fr)); }
.stats.words .v { font-size: clamp(44px, 4.2vw, 70px); }
.stat .k { display: block; font-weight: 800; margin-top: 16px; font-size: 16px; }
.stat .d { display: block; color: var(--muted); font-size: 14px; line-height: 1.65; margin-top: 6px; }

/* 引语 */
.quote { position: relative; margin: 0; padding: clamp(30px, 4vw, 56px) 0 0 clamp(22px, 4vw, 64px); border-left: 2px solid var(--accent); }
.quote::before { content: "“"; position: absolute; left: clamp(14px, 3vw, 44px); top: -.3em; font-size: clamp(130px, 15vw, 240px); line-height: 1; color: var(--accent); opacity: .32; font-family: Georgia, serif; pointer-events: none; }
.quote p { font-size: clamp(26px, 3.6vw, 54px); font-weight: 900; line-height: 1.28; letter-spacing: -.025em; margin: 0; position: relative; }
.quote cite { display: block; margin-top: 20px; font-style: normal; color: var(--muted); font-size: 14px; }

/* 流程 / 循环 */
.flow { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 170px), 1fr)); counter-reset: f; }
.flow .step { padding: 22px 22px 22px 0; border-top: 2px solid var(--accent); position: relative; }
.flow .step + .step { padding-left: 22px; border-left: 1px solid var(--line); }
.flow .step b { display: block; font-size: 18px; margin-bottom: 8px; line-height: 1.35; }
.flow .step span { color: var(--muted); font-size: 14px; line-height: 1.6; display: block; }
.flow .step::before { counter-increment: f; content: counter(f, decimal-leading-zero); display: block; font: 12px/1 var(--f-mono); color: var(--accent); letter-spacing: .14em; margin-bottom: 14px; }
@media (max-width: 560px) { .flow .step + .step { padding-left: 0; border-left: 0; } }
.flow.stack { grid-template-columns: minmax(0, 1fr); }
.flow.stack .step { padding: 16px 0; }
.flow.stack .step + .step { padding-left: 0; border-left: 0; border-top-width: 1px; border-top-color: var(--line); }

/* 横向胶片（迭代） */
.filmstrip { display: grid; grid-auto-flow: column; grid-auto-columns: minmax(320px, 34%); gap: clamp(14px, 2vw, 26px); overflow-x: auto; scroll-snap-type: x mandatory; padding-bottom: 20px; scrollbar-width: thin; scrollbar-color: var(--accent) transparent; }
.filmstrip > * { scroll-snap-align: start; }
.filmstrip::-webkit-scrollbar { height: 3px; }
.filmstrip::-webkit-scrollbar-thumb { background: var(--accent); }
@media (max-width: 760px) { .filmstrip { grid-auto-columns: 84%; } }
.frame .meta { display: flex; justify-content: space-between; gap: 10px; font: 12px/1.4 var(--f-mono); letter-spacing: .12em; color: var(--accent); padding: 16px 0 8px; text-transform: uppercase; }
.frame .meta .x { color: var(--faint); }
.frame h4 { font-size: 18px; margin-bottom: 8px; line-height: 1.4; }
.frame p { font-size: 14px; color: var(--muted); line-height: 1.68; margin: 0; }
.strip-hint { font: 12px/1 var(--f-mono); letter-spacing: .16em; color: var(--faint); text-transform: uppercase; margin-top: 10px; }

/* 改前 / 改后 */
.fixes { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 320px), 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.fix { background: var(--bg); padding: 28px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.fix .cat { font: 11px/1 var(--f-mono); letter-spacing: .18em; color: var(--accent); text-transform: uppercase; }
.fix h4 { font-size: 18px; margin: 14px 0 16px; }
.fix .before, .fix .after { font-size: 14.5px; line-height: 1.65; padding-left: 64px; position: relative; margin: 0; }
.fix .before { color: var(--muted); margin-bottom: 10px; }
.fix .before::before, .fix .after::before { position: absolute; left: 0; top: 3px; font: 10.5px/1.6 var(--f-mono); letter-spacing: .1em; }
.fix .before::before { content: "BEFORE"; color: var(--faint); }
.fix .after::before { content: "AFTER"; color: var(--accent); }

/* 关卡 */
.levels { display: grid; grid-template-columns: repeat(auto-fill, minmax(min(100%, 440px), 1fr)); gap: clamp(36px, 4vw, 56px) clamp(16px, 2vw, 28px); }
.level .lv-head { display: flex; align-items: baseline; gap: 14px; margin-top: 18px; }
.level .lv-num { font-family: var(--f-display); font-stretch: 75%; font-weight: 700; font-size: 48px; line-height: .85; color: var(--accent); }
.level h4 { font-size: 21px; }
.level h4 .display { font-size: 15px; color: var(--muted); margin-left: 8px; letter-spacing: .06em; font-weight: 600; }
.level p { margin: 10px 0 0; font-size: 14.5px; color: var(--muted); line-height: 1.68; }
.level p b { color: var(--text); font-weight: 700; }

/* 代码节选 */
.code { max-width: 100%; margin: 0; font: 13.5px/1.75 var(--f-mono); background: var(--bg-2); border: 1px solid var(--line); border-top: 2px solid var(--accent); padding: 22px 24px; overflow-x: auto; color: #d9d9dc; white-space: pre; }
.code .c { color: var(--faint); }
.code .k { color: var(--accent); }
.code-title { font: 12px/1 var(--f-mono); letter-spacing: .12em; color: var(--muted); margin-bottom: 12px; display: block; }

/* 列表 */
.ticks { list-style: none; margin: 0; padding: 0; }
.ticks li { position: relative; padding: 12px 0 12px 30px; border-bottom: 1px solid var(--line); font-size: 15.5px; line-height: 1.65; color: rgba(255,255,255,.86); }
.ticks li::before { content: ""; position: absolute; left: 0; top: 21px; width: 14px; height: 2px; background: var(--accent); }
.ticks.dim li::before { background: var(--faint); }
.col-title { font-size: 20px; margin-bottom: 16px; display: flex; align-items: center; gap: 12px; }
.col-title::before { content: ""; width: 10px; height: 10px; background: var(--accent); }
.col-title.dim::before { background: var(--faint); }
.col-title.hollow::before { background: transparent; outline: 1.5px solid var(--accent); outline-offset: -1.5px; }
.three-col { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: clamp(28px, 3.4vw, 48px); }
@media (max-width: 900px) { .three-col { grid-template-columns: minmax(0, 1fr); } }

/* 世界观 = 规则 对照 */
.maps { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 280px), 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.map { background: var(--bg); padding: 22px 24px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.map .from { font-weight: 800; font-size: 17px; }
.map .from::after { content: " →"; color: var(--accent); }
.map .to { color: var(--accent); font-weight: 700; display: block; margin: 6px 0 8px; }
.map p { margin: 0; font-size: 14px; color: var(--muted); line-height: 1.6; }

/* 改前 / 改后 拖动对比（同机位截图） */
.compare { margin: 0; }
.cmp-wrap { position: relative; overflow: hidden; aspect-ratio: 16 / 9; background: var(--bg-3); --pos: 50%; user-select: none; -webkit-user-select: none; touch-action: pan-y; }
.cmp-wrap img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.cmp-before { position: absolute; inset: 0; clip-path: inset(0 calc(100% - var(--pos)) 0 0); }
.cmp-handle { position: absolute; top: 0; bottom: 0; left: var(--pos); width: 2px; margin-left: -1px; background: var(--accent); box-shadow: 0 0 24px var(--accent); pointer-events: none; }
.cmp-handle::after { content: "◀ ▶"; position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); padding: 12px 14px; background: var(--accent); color: #000; font: 700 12px/1 var(--f-mono); letter-spacing: .1em; white-space: nowrap; }
.cmp-label { position: absolute; top: 16px; font: 11px/1 var(--f-mono); letter-spacing: .18em; text-transform: uppercase; padding: 9px 11px; background: rgba(0,0,0,.65); color: #fff; pointer-events: none; }
.cmp-label.l { left: 16px; }
.cmp-label.r { right: 16px; color: var(--accent); }
.cmp-wrap input[type=range] { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: ew-resize; }
.cmp-wrap:focus-within .cmp-handle::after { outline: 2px solid #fff; }

/* 数值调整：改前 → 改后 */
.tune { display: grid; grid-template-columns: repeat(auto-fit, minmax(min(100%, 240px), 1fr)); border-top: 1px solid var(--line); border-left: 1px solid var(--line); }
.tune > div { padding: 26px; border-right: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.tune .k { display: block; font-weight: 800; font-size: 16px; margin-bottom: 14px; }
.tune .v { display: flex; align-items: baseline; gap: 12px; font-family: var(--f-display); font-stretch: 75%; font-weight: 700; line-height: .9; white-space: nowrap; }
.tune .v s { font-size: clamp(30px, 3vw, 44px); color: var(--faint); text-decoration-thickness: 2px; }
.tune .v i { font-style: normal; color: var(--faint); font-size: 22px; }
.tune .v b { font-size: clamp(48px, 5vw, 76px); color: var(--accent); }
.tune .d { display: block; margin-top: 12px; color: var(--muted); font-size: 14px; line-height: 1.6; }

/* 灵感墙：不同比例的参考图错落排列 */
.moodboard { columns: 4 240px; column-gap: clamp(10px, 1.4vw, 18px); }
.moodboard .fig { break-inside: avoid; margin-bottom: clamp(10px, 1.4vw, 18px); }
.moodboard .fig img { filter: saturate(.9); transition: filter .6s, transform 1.1s var(--ease); }
.moodboard .fig:hover img { filter: saturate(1.1); }

/* 统一比例裁切的图 */
.fig.r32 { aspect-ratio: 3 / 2; }
.fig.r45 { aspect-ratio: 4 / 5; }
.fig.r32 img, .fig.r45 img { height: 100%; object-fit: cover; }

/* 竖幅大图配文字 */
.tall-split { display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 4vw, 72px); align-items: start; }
.tall-split .sticky-text { position: sticky; top: calc(var(--header-h) + 40px); }
@media (max-width: 900px) { .tall-split { grid-template-columns: minmax(0, 1fr); } .tall-split .sticky-text { position: static; } }

/* 横幅 CTA */
.cta-band { position: relative; overflow: hidden; isolation: isolate; padding: clamp(90px, 13vw, 180px) 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); }
.cta-band .bg { position: absolute; inset: 0; z-index: -1; }
.cta-band .bg img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.38); }
.cta-band h3 { font-size: clamp(46px, 8vw, 128px); letter-spacing: -.04em; margin-bottom: 20px; line-height: .98; }
.cta-band p { color: rgba(255,255,255,.8); max-width: 34em; }
.cta-band .btn-row { margin-top: 32px; }
.note-sm { font-size: 13px; color: var(--muted); margin-top: 16px; }

section.cta-band > .bg, a.next-proj > .bg { top: -18%; bottom: -18%; }

/* 下一个项目 */
.next-proj { position: relative; display: block; overflow: hidden; isolation: isolate; min-height: 76vh; --accent: var(--wk); }
.next-proj .bg { position: absolute; inset: 0; z-index: -2; }
.next-proj .bg img { width: 100%; height: 100%; object-fit: cover; filter: brightness(.35) grayscale(.4); transition: filter .8s, transform 1.6s var(--ease); }
.next-proj:hover .bg img { filter: brightness(.6) grayscale(0); transform: scale(1.05); }
.next-proj .inner { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: center; padding: 0 var(--gutter); }
.next-proj .kicker { margin-bottom: 22px; }
.next-proj .t { font-size: clamp(60px, 12vw, 200px); font-weight: 900; letter-spacing: -.05em; line-height: .92; }
.next-proj .t .display { display: block; font-size: .4em; color: var(--accent); margin-top: .22em; letter-spacing: 0; }
.next-proj .go { display: inline-flex; align-items: center; gap: 14px; margin-top: 34px; font-weight: 800; letter-spacing: .06em; }
.next-proj .go .bar { width: 48px; height: 2px; background: var(--accent); transition: width .5s var(--ease); }
.next-proj:hover .go .bar { width: 120px; }

/* 灯箱 */
.lightbox { position: fixed; inset: 0; z-index: 100; background: rgba(0,0,0,.95); display: flex; align-items: center; justify-content: center; padding: 4vh 3vw 7vh; opacity: 0; pointer-events: none; transition: opacity .3s; cursor: zoom-out; }
.lightbox.open { opacity: 1; pointer-events: auto; }
.lightbox img { max-width: 100%; max-height: 100%; object-fit: contain; box-shadow: 0 30px 120px rgba(0,0,0,.8); }
.lightbox .cap { position: absolute; left: 0; right: 0; bottom: 2.4vh; text-align: center; font-size: 13.5px; color: var(--muted); padding: 0 20px; }
.lightbox .close { position: absolute; top: 18px; right: 22px; font: 12px/1 var(--f-mono); letter-spacing: .2em; color: var(--muted); }

/* ---------- 入场动效 ---------- */
.js .reveal { opacity: 0; transform: translateY(56px); transition: opacity 1s var(--ease), transform 1.15s var(--ease); }
.js .reveal.in { opacity: 1; transform: none; }
.js .reveal-img { clip-path: inset(14% 0 14% 0); transition: clip-path 1.4s var(--ease); }
.js .reveal-img img { transform: scale(1.18); transition: transform 1.8s var(--ease); }
.js .reveal-img.in { clip-path: inset(0 0 0 0); }
.js .reveal-img.in img { transform: scale(1); }
.js .reveal-img.in:hover img { transform: scale(1.02); transition-duration: 1.1s; }
.js .stagger > * { opacity: 0; transform: translateY(36px); transition: opacity .9s var(--ease), transform 1s var(--ease); }
.js .stagger.in > * { opacity: 1; transform: none; }
.js .stagger.in > *:nth-child(2) { transition-delay: .08s; } .js .stagger.in > *:nth-child(3) { transition-delay: .16s; }
.js .stagger.in > *:nth-child(4) { transition-delay: .24s; } .js .stagger.in > *:nth-child(5) { transition-delay: .32s; }
.js .stagger.in > *:nth-child(6) { transition-delay: .40s; } .js .stagger.in > *:nth-child(7) { transition-delay: .48s; }
.js .stagger.in > *:nth-child(8) { transition-delay: .56s; }
.js .wipe { position: relative; }
.js .wipe::after { content: ""; position: absolute; inset: 0; background: var(--accent); transform-origin: right; transform: scaleX(0); pointer-events: none; }
.js .wipe.in::after { animation: wipe 1.1s var(--ease); }
@keyframes wipe { 0% { transform-origin: left; transform: scaleX(0); } 45% { transform-origin: left; transform: scaleX(1); } 55% { transform-origin: right; transform: scaleX(1); } 100% { transform-origin: right; transform: scaleX(0); } }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .01ms !important; scroll-behavior: auto !important; }
  .js .reveal, .js .stagger > * { opacity: 1; transform: none; }
  .js .reveal-img { clip-path: none; }
  .js .reveal-img img { transform: none; }
}
