/* ---------- 页眉：暖灰撕纸，浮在白色页面上 ---------- */

.site-header {
  position: relative;
  isolation: isolate;
  align-items: center;
  border-bottom: 0;
  padding-block: clamp(24px, 2.8vw, 38px) clamp(30px, 3.4vw, 46px);
}

.header-paper,
.header-edge,
.header-shadow {
  position: absolute;
  left: 50%;
  top: 0;
  bottom: 0;
  width: 100vw;
  transform: translateX(-50%);
  pointer-events: none;
  clip-path: var(--torn);
}

/* 暖灰纸面：淡淡的暖色渐变 + 纸纹 */
.header-paper {
  background:
    radial-gradient(90% 70% at 18% 0%, rgba(255, 255, 255, .9), transparent 62%),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='240' height='240'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='4' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/><feComponentTransfer><feFuncA type='linear' slope='.22'/></feComponentTransfer></filter><rect width='240' height='240' fill='%23ffffff' filter='url(%23n)'/></svg>"),
    linear-gradient(#ffffff, #f7f3e9);
  background-blend-mode: normal, multiply, normal;
  z-index: -1;
}

/* 撕口露出的纸芯，比纸面更浅 */
.header-edge {
  background: linear-gradient(#fbf8f0, #e9e3d3);
  transform: translate(-50%, 14px);
  z-index: -2;
}

/* 撕口下面的影子 */
.header-shadow {
  background: rgba(58, 50, 34, .28);
  filter: blur(4px);
  transform: translate(-50%, 20px);
  z-index: -3;
}

/* 页眉文字：黑字，交互时变橘黄 */
.site-header .brand-name,
.site-header .brand-en,
.site-header .nav a {
  color: #111111;
  text-shadow: 0 1px 0 rgba(255, 255, 255, .55);
}

.site-header .brand:hover .brand-name,
.site-header .brand:hover .brand-en,
.site-header .nav a:hover,
.site-header .nav a[aria-current="page"] {
  color: var(--strip-hot);
}

.site-header .nav a[aria-current="page"] {
  border-bottom-color: currentColor;
}

.site-header :focus-visible {
  outline-color: #111111;
}

/* ---------- 自托管字体（Barlow = DIN 近似；Chelsea Market = 手写标签） ---------- */

@font-face {
  font-family: 'Huiwen Mincho';
  src: url('../fonts/huiwen-mincho.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'HuaKang Yuan W3';
  src: url('../fonts/huakang-yuan-w3.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
@font-face {
  font-family: 'FZ LanTing Kan Hei';
  src: url('../fonts/fz-lanting-kanhei.woff') format('woff');
  font-weight: 400;
  font-style: normal;
  font-display: swap;
}
/* florrrrrz — portfolio
   定稿主题：paper（米白纸感、衬线、细边框）。
   另一套 minimal（纯白无框）的变量留在下面，把 <html data-theme="minimal">
   改一下就能整体切换，不用动任何结构。 */

:root {
  --serif: "HuaKang Yuan W3", "Iowan Old Style", "Palatino Linotype", Palatino,
           "Book Antiqua", Georgia, "FZ LanTing Kan Hei", "Songti SC", "STSong",
           "Noto Serif CJK SC", serif;
  --sans: "Huiwen Mincho", "FZ LanTing Kan Hei", "Helvetica Neue", -apple-system,
          BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  --maxw: 1280px;
  --pad: clamp(20px, 4vw, 56px);
  --ease: cubic-bezier(.22, .61, .36, 1);
}

:root,
:root[data-theme="paper"] {
  --bg: #d3cdc0;
  --bg-2: #f4f4f2;
  --ink: #000000;
  --strip-hot: #f8802e;
  --torn: polygon(0% 0%, 0.00% 76.77%, 0.59% 78.87%, 1.18% 78.39%, 1.76% 76.48%, 2.35% 77.25%, 2.94% 75.23%, 3.53% 73.76%, 4.12% 82.53%, 4.71% 78.22%, 5.29% 78.43%, 5.88% 75.70%, 6.47% 73.95%, 7.06% 78.42%, 7.65% 74.24%, 8.24% 75.11%, 8.82% 75.64%, 9.41% 75.81%, 10.00% 78.53%, 10.59% 79.74%, 11.18% 78.08%, 11.76% 76.77%, 12.35% 78.11%, 12.94% 79.46%, 13.53% 80.97%, 14.12% 77.46%, 14.71% 79.30%, 15.29% 80.96%, 15.88% 77.80%, 16.47% 78.92%, 17.06% 76.40%, 17.65% 78.79%, 18.24% 76.46%, 18.82% 74.69%, 19.41% 76.77%, 20.00% 77.12%, 20.59% 75.60%, 21.18% 74.22%, 21.76% 73.16%, 22.35% 72.86%, 22.94% 76.28%, 23.53% 75.54%, 24.12% 74.56%, 24.71% 76.94%, 25.29% 75.04%, 25.88% 74.21%, 26.47% 76.30%, 27.06% 75.52%, 27.65% 73.97%, 28.24% 73.58%, 28.82% 73.92%, 29.41% 76.99%, 30.00% 77.35%, 30.59% 75.73%, 31.18% 78.05%, 31.76% 76.55%, 32.35% 77.83%, 32.94% 76.14%, 33.53% 78.21%, 34.12% 77.50%, 34.71% 75.14%, 35.29% 74.41%, 35.88% 73.97%, 36.47% 75.28%, 37.06% 74.20%, 37.65% 72.92%, 38.24% 74.34%, 38.82% 75.64%, 39.41% 78.02%, 40.00% 75.42%, 40.59% 75.60%, 41.18% 74.44%, 41.76% 75.50%, 42.35% 75.26%, 42.94% 78.05%, 43.53% 78.68%, 44.12% 79.55%, 44.71% 78.59%, 45.29% 85.91%, 45.88% 79.34%, 46.47% 77.82%, 47.06% 75.55%, 47.65% 77.09%, 48.24% 78.20%, 48.82% 79.28%, 49.41% 77.93%, 50.00% 79.59%, 50.59% 78.47%, 51.18% 79.80%, 51.76% 79.62%, 52.35% 79.28%, 52.94% 76.63%, 53.53% 79.10%, 54.12% 79.61%, 54.71% 80.01%, 55.29% 78.88%, 55.88% 76.35%, 56.47% 74.28%, 57.06% 74.95%, 57.65% 76.48%, 58.24% 77.17%, 58.82% 80.16%, 59.41% 77.10%, 60.00% 75.49%, 60.59% 76.68%, 61.18% 78.65%, 61.76% 78.98%, 62.35% 78.10%, 62.94% 79.78%, 63.53% 78.45%, 64.12% 77.16%, 64.71% 77.10%, 65.29% 78.74%, 65.88% 80.42%, 66.47% 77.87%, 67.06% 76.55%, 67.65% 76.26%, 68.24% 76.44%, 68.82% 78.22%, 69.41% 77.65%, 70.00% 75.22%, 70.59% 73.52%, 71.18% 74.83%, 71.76% 80.38%, 72.35% 82.99%, 72.94% 75.50%, 73.53% 73.75%, 74.12% 74.40%, 74.71% 75.87%, 75.29% 78.39%, 75.88% 76.56%, 76.47% 80.03%, 77.06% 76.69%, 77.65% 75.68%, 78.24% 77.00%, 78.82% 77.55%, 79.41% 76.88%, 80.00% 78.87%, 80.59% 80.42%, 81.18% 77.69%, 81.76% 78.10%, 82.35% 77.20%, 82.94% 78.96%, 83.53% 80.55%, 84.12% 80.28%, 84.71% 80.43%, 85.29% 80.15%, 85.88% 77.89%, 86.47% 79.95%, 87.06% 79.30%, 87.65% 77.79%, 88.24% 79.28%, 88.82% 76.64%, 89.41% 76.98%, 90.00% 83.16%, 90.59% 74.85%, 91.18% 73.88%, 91.76% 76.14%, 92.35% 74.69%, 92.94% 76.41%, 93.53% 77.49%, 94.12% 77.31%, 94.71% 75.24%, 95.29% 75.86%, 95.88% 77.28%, 96.47% 77.31%, 97.06% 77.51%, 97.65% 76.80%, 98.24% 78.78%, 98.82% 79.96%, 99.41% 79.25%, 100.00% 77.18%, 100% 0%);
  --muted: #4a463c;
  --rule: rgba(0, 0, 0, .18);
  --frame: rgba(0, 0, 0, .24);
  --card-bg: #ffffff;
  --accent: #000000;
  --lb-bg: rgba(0, 0, 0, .94);
  --shadow: none;
  --nav-transform: uppercase;
  --nav-track: .17em;
  --card-align: center;
  --card-ratio: 16 / 9;
  --card-title-font: var(--serif);
  --card-title-size: 18.5px;
  --card-title-track: .01em;
  --card-title-transform: none;
  --card-border: 1px solid var(--frame);
}

:root[data-theme="minimal"] {
  --bg: #ffffff;
  --bg-2: #f2f2f0;
  --ink: #101010;
  --muted: #767676;
  --rule: rgba(0, 0, 0, .12);
  --frame: transparent;
  --card-bg: #f1f1ef;
  --accent: #101010;
  --lb-bg: rgba(8, 8, 8, .96);
  --shadow: none;
  --nav-transform: uppercase;
  --nav-track: .14em;
  --card-align: left;
  --card-ratio: 3 / 2;
  --card-title-font: var(--sans);
  --card-title-size: 11.5px;
  --card-title-track: .13em;
  --card-title-transform: uppercase;
  --card-border: 0;
}

* { box-sizing: border-box; }

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

body {
  margin: 0;
  min-height: 100vh;
  background-color: #cfc9bc;
  background-image:
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='300' height='300'><filter id='f'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='3' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/><feComponentTransfer><feFuncA type='linear' slope='.10'/></feComponentTransfer></filter><rect width='300' height='300' fill='%23000' filter='url(%23f)'/></svg>"),
    url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='900' height='900'><filter id='c'><feTurbulence type='fractalNoise' baseFrequency='.006 .012' numOctaves='3' seed='4' stitchTiles='stitch'/><feColorMatrix type='saturate' values='0'/><feComponentTransfer><feFuncA type='linear' slope='.07'/></feComponentTransfer></filter><rect width='900' height='900' fill='%23000' filter='url(%23c)'/></svg>"),
    linear-gradient(180deg, #ddd8cc 0%, #d3cdc0 45%, #c6bfb0 100%);
  background-repeat: repeat, repeat, no-repeat;
  background-size: auto, auto, 100% 100%;

  color: var(--ink);
  font-family: var(--serif);
  font-size: 16px;
  line-height: 1.7;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

img, video, iframe { display: block; max-width: 100%; }
a { color: inherit; }
button { font: inherit; color: inherit; }

::selection { background: var(--ink); color: var(--bg); }

/* 键盘可达性 */
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
.card:focus-visible, .work:focus-visible { outline-offset: 5px; }
.skip-link {
  position: absolute; left: 14px; top: -80px; z-index: 200;
  background: var(--ink); color: var(--bg); text-decoration: none;
  font-family: var(--sans); font-size: 15px; letter-spacing: .08em;
  padding: 9px 16px; transition: top .18s var(--ease);
}
.skip-link:focus { top: 14px; }

.wrap {
  max-width: var(--maxw);
  margin: 0 auto;
  padding-inline: var(--pad);
}

/* ---------- header ---------- */

.site-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: clamp(16px, 3vw, 40px);
  padding-block: clamp(24px, 2.8vw, 38px) clamp(20px, 2.4vw, 30px);
  border-bottom: 0;
}

.brand-h1 { margin: 0; font-size: inherit; font-weight: inherit; line-height: inherit; }
.brand { text-decoration: none; display: block; }
.brand-name {
  font-family: var(--sans);  /* 汇文明朝体：中英同一套字形 */
  font-weight: 300;
  font-size: clamp(21px, 2vw, 27px);
  line-height: 1;
  letter-spacing: .02em;
}
.brand-en {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 14px;
  letter-spacing: .1em;
  text-transform: uppercase;
  margin-left: .9em;
  color: var(--muted);
  white-space: nowrap;
}

.tagline {
  margin: 9px 0 0;
  font-size: 12.5px;
  max-width: 32em;
  color: var(--muted);
  letter-spacing: .03em;
}

.nav {
  display: flex;
  gap: clamp(18px, 2.4vw, 38px);
  font-family: var(--sans);
  font-weight: 400;
  font-size: 18px;
  letter-spacing: .08em;
  text-transform: var(--nav-transform);
  padding-top: 6px;
  white-space: nowrap;
}
.nav a {
  display: inline-block;
  padding-block: 11px;
  text-decoration: none;
  color: var(--ink);
  opacity: .78;
  transition: opacity .2s var(--ease);
}
.nav a:hover { opacity: 1; }
.nav a[aria-current="page"] {
  opacity: 1;
  color: var(--accent);
  text-decoration: underline;
  text-decoration-thickness: 1px;
  text-underline-offset: 5px;
}

.visually-hidden {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden;
  clip-path: inset(50%);
  white-space: nowrap;
  border: 0;
}

/* ---------- page lead ---------- */

.lead {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px 24px;
  padding-block: clamp(18px, 2.2vw, 28px) 0;
  font-size: 12px;
  color: var(--muted);
}
.lead p { margin: 0; max-width: 82ch; }
.lead-count {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 13.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  white-space: nowrap;
}

/* ---------- project grid ---------- */

.grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(30px, 3.4vw, 52px) clamp(20px, 2.6vw, 38px);
  padding-block: clamp(28px, 3.2vw, 46px) clamp(46px, 6vw, 84px);
}

.card {
  display: block;
  text-decoration: none;
  opacity: 0;
  transform: translateY(10px);
  animation: rise .62s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 45ms);
}

@keyframes rise {
  to { opacity: 1; transform: none; }
}

.card-media {
  position: relative;
  overflow: hidden;
  background: transparent;   /* 让带透明底的封面直接透出纸面 */
  border: var(--card-border);
}
.card-media--plain { border: 0; }
.card-media img {
  width: 100%;
  aspect-ratio: var(--card-ratio);
  object-fit: cover;
  transition: transform .9s var(--ease), opacity .35s var(--ease);
}
.card:hover .card-media img,
.card:focus-visible .card-media img {
  transform: scale(1.022);
  opacity: .94;
}

.card-cap {
  margin-top: 14px;
  text-align: var(--card-align);
}
.card-title {
  margin: 0;
  font-family: var(--card-title-font);
  font-size: var(--card-title-size);
  font-weight: 400;
  letter-spacing: var(--card-title-track);
  text-transform: var(--card-title-transform);
  line-height: 1.35;
}
.card-meta {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--muted);
}
:root[data-theme="minimal"] .card-meta { margin-top: 3px; opacity: .85; }

.card:hover .card-title { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- project page ---------- */

.proj {
  max-width: 760px;
  margin-inline: auto;
  padding-block: clamp(26px, 3.4vw, 46px) 0;
}
.proj-head { max-width: none; }
.proj-title {
  margin: 0;
  font-size: clamp(28px, 4.6vw, 54px);
  font-weight: 400;
  line-height: 1.1;
  letter-spacing: -.015em;
}
.proj-title-en {
  display: block;
  margin-top: 8px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 21px;
  letter-spacing: .06em;
  text-transform: uppercase;
  color: var(--ink);
}
.proj-meta {
  margin: 18px 0 0;
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .04em;
  text-transform: uppercase;
  color: var(--muted);
}
.proj-lead {
  margin: 20px 0 0;
  max-width: 62ch;
  font-size: clamp(16px, 1.35vw, 17.5px);
  line-height: 1.95;
}
/* 多段简介：第二段起不重复上间距 */
.proj-lead + .proj-lead { margin-top: .9em; }

.proj-film {
  display: block;
  box-shadow: 0 14px 22px -10px rgba(30, 24, 10, .42);
  width: 100%;
  aspect-ratio: 16 / 9;
  margin-block: clamp(28px, 3.6vw, 46px) 0;
  background: #000;
  border: 1px solid var(--frame);
}

/* 图片墙：单栏，一张接一张，保留各自比例 */
.wall {
  column-count: 1;
  margin-block: clamp(34px, 4.4vw, 62px);
}
.wall-item {
  margin: 0 0 clamp(30px, 3.6vw, 52px);
  break-inside: avoid;
  page-break-inside: avoid;
}
.wall-item img, .wall-item video { max-height: 86vh; width: auto; max-width: 100%; margin-inline: auto; display: block; }
/* 左一大 + 右两小竖排（边长对齐）：列宽按图片比例反解，见 design-notes */
.wall-stack {
  display: grid;
  grid-template-columns: calc((100% - 10px) * 630 / 910) calc((100% - 10px) * 280 / 910);
  gap: 10px;
  width: min(920px, calc(100vw - 48px));
  margin-left: calc(50% - min(460px, (100vw - 48px) / 2));
  margin-bottom: clamp(30px, 3.6vw, 52px);
  align-items: stretch;
}
.wall-stack--mixed {
  grid-template-columns: calc((100% - 10px) * 721.5 / 910) calc((100% - 10px) * 188.5 / 910);
}
.wall-stack > .wall-item,
.wall-stack-col > .wall-item { margin: 0; }
.wall-stack-col { display: grid; grid-template-rows: auto auto; align-content: start; gap: 10px; }
.wall-stack img { width: 100%; height: auto; max-height: none; display: block; }
.wall-stack .wall-btn { width: 100%; }

/* 单图成行时图片必须铺满该行宽度（原图小于栏宽时也不缩小） */
.wall-item--wide img,
.wall-row--wide img { width: 100%; height: auto; }

/* 项目简介右上角的小图 */
.proj-intro-art {
  float: right;
  width: clamp(170px, 34%, 290px);
  margin: 6px 0 14px 26px;
}
.proj-intro-art img {
  width: 100%; height: auto; display: block;
}
.proj-intro-art .wall-cap { margin-top: 7px; }
.proj-head::after { content: ""; display: table; clear: both; }

@media (max-width: 640px) {
  .proj-intro-art { float: none; width: 100%; margin: 14px 0 18px; }
}

/* 图片墙的分段标题 */
.wall-section {
  margin: 56px 0 20px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--rule);
  font-family: var(--font-ui);
  font-size: 12px;
  font-weight: 400;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  color: var(--muted);
  scroll-margin-top: 24px;
}
.wall > .wall-section:first-child { margin-top: 0; }

/* 单图成行、但要和成对行一样宽 */
.wall-item--wide {
  width: min(920px, calc(100vw - 48px));
  margin-left: calc(50% - min(460px, (100vw - 48px) / 2));
  margin-right: 0;
}

.wall-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(14px, 1.6vw, 22px);
  align-items: stretch;
  margin-bottom: clamp(30px, 3.6vw, 52px);
}
/* 同排两张图比例不同时，让图注落在同一条基线上 */
.wall-row .wall-item { display: flex; flex-direction: column; margin-bottom: 0; }

/* 一高一矮两张并排时：按高度对齐，整体可以比文字栏更宽 */
.wall-row--fit {
  display: flex;
  justify-content: center;
  align-items: flex-end;
  width: min(920px, calc(100vw - 48px));
  margin-left: calc(50% - min(460px, (100vw - 48px) / 2));
}
.wall-row--fit .wall-item { flex: 0 0 auto; }
.wall-row--fit .wall-btn { width: auto; }

/* 作品里的循环动图（GIF 转 mp4）：同图片一样吃满宽度 */
.wall-btn video {
  display: block;
  width: 100%;
  height: auto;
  background: #000;
}

.wall-btn img { height: clamp(220px, 29vw, 420px); width: auto; max-width: 100%; max-height: none; }
.wall-row--fit .wall-cap { margin-top: 12px; padding-top: 0; }

/* 同比例的一对整体放宽，与 fit 行同宽（920）保持左边线一致 */
.wall-row--wide {
  width: min(920px, calc(100vw - 48px));
  margin-left: calc(50% - min(460px, (100vw - 48px) / 2));
}
.wall-row .wall-cap { margin-top: auto; padding-top: 12px; }

.wall-btn {
  display: block;
  width: 100%;
  padding: 0;
  border: 0;
  background: transparent;
  cursor: zoom-in;
  position: relative;
  overflow: visible;   /* 让图片的投影能画到框外 */
}
.wall-btn.is-full img { max-height: none; }


.wall-btn img {
  display: block;
  width: auto;
  max-width: 100%;
  height: auto;
  max-height: 88vh;
  object-fit: contain;
  margin: 0 auto;
  box-shadow: 0 14px 22px -10px rgba(30, 24, 10, .42);
  transition: box-shadow .55s var(--ease);
}
.wall-btn:hover img {
  box-shadow: 0 34px 46px -20px rgba(30, 24, 10, .55);
}

/* 超宽长条图：图片突破栏宽居中，图注仍对齐文字栏 */
.wall-item--bleed .wall-btn { overflow: visible; }
.wall-item--bleed .wall-btn img,
.wall-item--bleed .wall-btn:hover img {
  width: min(1160px, calc(100vw - 48px));
  max-width: none;
  max-height: none;
  margin-left: calc(50% - min(580px, (100vw - 48px) / 2));
  transform: none;
}
.wall-item--bleed .wall-btn:hover img { box-shadow: 0 34px 46px -20px rgba(30, 24, 10, .55); }
.wall-cap {
  margin-top: 9px;
  font-family: var(--sans);
  font-weight: 400;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
  letter-spacing: .02em;
}

.play-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  pointer-events: none;
}
.play-badge::before {
  content: "";
  width: 54px;
  height: 54px;
  border-radius: 50%;
  background: rgba(250, 248, 242, .9);
  box-shadow: 0 4px 22px rgba(0, 0, 0, .18);
  transition: transform .35s var(--ease);
}
.play-badge::after {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  border-left: 13px solid rgba(23, 21, 15, .85);
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  margin-left: 4px;
}
.wall-btn:hover .play-badge::before { transform: scale(1.08); }

/* ---------- credits ---------- */

.credits {
  border-top: 1px solid var(--rule);
  padding-block: 22px 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0 clamp(24px, 4vw, 60px);
  max-width: 860px;
}
.credits.is-single { grid-template-columns: minmax(0, 1fr); max-width: 700px; }
.credits-row {
  display: grid;
  grid-template-columns: 9.5em minmax(0, 1fr);
  gap: 12px;
  padding-block: 7px;
  border-bottom: 1px solid var(--rule);
  font-size: 14px;
}
.credits-row dt {
  font-family: var(--sans);
  font-size: 11.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: var(--muted);
  padding-top: 4px;
}
.credits-row dd { margin: 0; }
.fest-note { color: var(--muted); font-size: 13px; margin-left: 8px; }
.fest-note::before { content: "— "; }

/* ---------- pager ---------- */

.pager {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 20px;
  border-top: 1px solid var(--rule);
  margin-top: clamp(44px, 5vw, 72px);
  padding-block: 24px clamp(40px, 5vw, 64px);
  max-width: 860px;
}
.pager a {
  text-decoration: none;
  display: block;
  padding-block: 6px;
}
.pager .next { text-align: right; }
.pager-label {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 12px;
  letter-spacing: .14em;
  text-transform: uppercase;
  color: var(--muted);
}
.pager-title {
  display: block;
  margin-top: 7px;
  font-size: 19px;
  letter-spacing: -.01em;
}
.pager a:hover .pager-title { text-decoration: underline; text-underline-offset: 5px; }
.pager .empty { pointer-events: none; opacity: 0; }

/* ---------- other works：分类首页 ---------- */
.cat-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: clamp(24px, 3vw, 44px) clamp(20px, 2.6vw, 40px);
  margin-top: clamp(30px, 4vw, 54px);
}
.cat-card {
  display: block;
  text-decoration: none;
  color: inherit;
  opacity: 0;
  transform: translateY(10px);
  animation: rise .6s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 70ms);
  cursor: url("../img/cursor-arrow.svg") 60 60, pointer;
}
.cat-cover {
  overflow: hidden;
  background: transparent;
}
.cat-cover img {
  display: block;
  width: 100%;
  aspect-ratio: 3 / 2;
  object-fit: cover;
  object-position: center;
  transition: transform .9s var(--ease);
}
.cat-card:hover .cat-cover img { transform: scale(1.02); }
.cat-cover.is-blank {
  display: grid;
  place-items: center;
  aspect-ratio: 3 / 2;
  border: 1px dashed var(--rule);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--muted);
  text-align: center;
}
.cat-cover.is-blank span { display: grid; gap: 4px; }
.cat-cover.is-blank span span {
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: .16em;
  text-transform: uppercase;
  opacity: .7;
}
.cat-cap { margin-top: 12px; }
.cat-name {
  margin: 0;
  font-family: var(--cjk);
  font-weight: 400;
  font-size: clamp(17px, 1.7vw, 21px);
  line-height: 1.4;
}
.cat-en {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.cat-meta {
  margin: 7px 0 0;
  font-size: 12.5px;
  line-height: 1.6;
  color: var(--muted);
}

/* ---------- other works：分类详情 ---------- */
.cat-back {
  margin: clamp(24px, 3vw, 40px) 0 0;
  font-family: var(--serif);
  font-size: 11px;
  letter-spacing: .12em;
  text-transform: uppercase;
}
.cat-back a { text-decoration: none; color: var(--muted); }
.cat-back a:hover { color: var(--accent); }
.cat-title {
  margin: 14px 0 0;
  font-family: var(--cjk);
  font-weight: 400;
  font-size: clamp(22px, 2.4vw, 30px);
  line-height: 1.3;
}
.cat-note {
  margin: 10px 0 0;
  font-size: 13px;
  color: var(--muted);
}
.cat-empty {
  margin: clamp(30px, 4vw, 56px) 0;
  color: var(--muted);
  font-size: 14px;
}
@media (max-width: 640px) {
  .cat-grid { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- other works：纵向条目 ---------- */
.works-list {
  display: block;
  margin-top: clamp(26px, 3.4vw, 46px);
}
.work-entry {
  margin: 0 0 clamp(58px, 7vw, 96px);
  opacity: 0;
  transform: translateY(10px);
  animation: rise .62s var(--ease) forwards;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.work-head {
  max-width: 760px;
  margin-bottom: clamp(14px, 1.6vw, 20px);
}
.work-entry-title {
  margin: 0;
  font-family: var(--cjk);
  font-weight: 400;
  font-size: clamp(16px, 1.5vw, 19px);
  line-height: 1.4;
  letter-spacing: .02em;
}
.work-entry-en {
  display: block;
  margin-top: 4px;
  font-family: var(--serif);
  font-size: 10.5px;
  letter-spacing: .16em;
  text-transform: uppercase;
  color: var(--muted);
}
.work-entry-meta {
  margin: 7px 0 0;
  font-family: var(--ui);
  font-size: 11px;
  letter-spacing: .06em;
  color: var(--muted);
}
/* 手工作品是抠图（透明 WebP），矩形投影会露底，这里去掉投影、只做轻微放大 */
.work-entry .wall-btn img {
  box-shadow: none;
}
.work-entry .wall-btn:hover img,
.work-entry .wall-btn:focus-visible img {
  box-shadow: none;
  transform: scale(1.015);
}
.wall-row--grid {
  display: grid;
  gap: 10px;
  width: min(920px, calc(100vw - 48px));
  margin-left: calc(50% - min(460px, (100vw - 48px) / 2));
  align-items: start;
}
.wall-row--cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.wall-row--cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.wall-row--cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.wall-row--grid .wall-item { width: 100%; margin: 0; }
/* 按百分比宽度排的一排（每张用 pct 指定宽度，高度由比例自然一致） */
.wall-row--pct {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  width: min(920px, calc(100vw - 48px));
  margin-left: calc(50% - min(460px, (100vw - 48px) / 2));
}
.wall-row--pct .wall-item { margin: 0; }
.wall-row--pct .wall-btn img { width: 100%; height: auto; }
.wall-row--grid .wall-btn img { width: 100%; height: auto; }

.work-entry-note {
  margin: 8px 0 0;
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--muted);
}
@media (max-width: 640px) {
  .work-entry-title { font-size: 16px; }
  .wall-row.wall-row--grid { width: auto; margin-left: 0; }
  .wall-row.wall-row--pct { display: block; width: auto; margin-left: 0; }
  .wall-row.wall-row--pct .wall-item { width: 100%; }
  .wall-row.wall-row--pct .wall-item + .wall-item { margin-top: 10px; }
  .wall-row.wall-row--cols-3,
  .wall-row.wall-row--cols-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

/* ---------- about ---------- */

.about { padding-block: clamp(30px, 4vw, 52px) 0; }
.about-intro {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
  gap: clamp(24px, 3.4vw, 56px);
  align-items: start;
}
.about-tail { margin-top: clamp(38px, 5vw, 68px); max-width: 880px; }
.portrait { border: 1px solid var(--frame); background: var(--card-bg); width: 100%; }
.portrait img { display: block; width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
:root[data-theme="minimal"] .portrait { border: 0; }

.about-body { max-width: 68ch; margin-top: clamp(24px, 3.2vw, 40px); }
.about-body p { margin: 0 0 1.15em; font-size: clamp(15.5px, 1.3vw, 17px); line-height: 1.95; }
.about-body p:first-child { font-size: clamp(17px, 1.6vw, 20px); line-height: 1.8; }

.about-block { margin-top: clamp(32px, 4vw, 52px); max-width: 880px; }
.about-block.is-narrow { max-width: 700px; }
.section-label + .credits { border-top: 0; padding-top: 0; }
.section-label {
  font-family: var(--sans);
  font-weight: 400;
  font-size: 14.5px;
  letter-spacing: .1em;
  text-transform: uppercase;
  color: #2b2b2b;
  margin: 0 0 14px;
  padding-bottom: 8px;
  border-bottom: 1px solid var(--rule);
}

.cv-list { list-style: none; margin: 0; padding: 0; font-size: 14.5px; }
.cv-list li {
  display: grid;
  grid-template-columns: 5.4em minmax(0, 1fr);
  gap: 14px;
  padding-block: 6px;
  border-bottom: 1px solid var(--rule);
}
.cv-list.is-stack li { grid-template-columns: 6.5em minmax(0, 1fr); align-items: start; }
.cv-list.is-stack .desc { color: var(--ink); }
.cv-list.is-stack .desc em { font-style: normal; color: var(--muted); }
.cv-list .yr { font-family: var(--sans);
  font-weight: 400; font-size: 12.5px; letter-spacing: .04em; color: var(--muted); padding-top: 4px; }

.contact-list { list-style: none; margin: 0; padding: 0; font-size: 14.5px; }
.contact-list li { display: flex; gap: 14px; padding-block: 6px; }
.contact-list .k { font-family: var(--sans);
  font-weight: 400; font-size: 12.5px; letter-spacing: .08em; text-transform: uppercase; color: var(--muted); flex: 0 0 8.6em; padding-top: 4px; }
.contact-list a { text-decoration: none; border-bottom: 1px solid var(--rule); padding-bottom: 1px; }
.contact-list a:hover { border-color: var(--ink); }

/* ---------- other works ---------- */

.works-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  align-items: start;
  gap: clamp(26px, 3vw, 44px) clamp(16px, 2vw, 28px);
  padding-block: clamp(26px, 3vw, 42px) clamp(46px, 6vw, 84px);
}
.work.is-text { cursor: default; }
.work.is-text .card-media {
  display: grid;
  place-items: center;
  aspect-ratio: 1 / 1;
  background: none;
  border: 1px dashed var(--rule);
}
.work-noimg {
  display: grid;
  gap: 6px;
  justify-items: center;
  font-family: var(--serif);
  font-size: 15px;
  letter-spacing: .1em;
  color: var(--muted);
}
.work-noimg span {
  font-family: var(--sans);
  font-size: 10px;
  letter-spacing: .26em;
  text-transform: uppercase;
  color: var(--rule);
}
.work {
  border: 0;
  padding: 0;
  background: none;
  cursor: zoom-in;
  text-align: left;
  display: block;
}
.work .card-media img { aspect-ratio: 1 / 1; object-fit: cover; }
.work-cap { margin-top: 10px; }
.work-title { margin: 0; font-size: 14px; line-height: 1.35; }
.work-meta {
  margin: 4px 0 0;
  font-family: var(--serif);
  font-size: 12px;
  letter-spacing: .04em;
  color: var(--muted);
}
.work:hover .card-title, .work:hover .work-title { text-decoration: underline; text-underline-offset: 4px; }

/* ---------- footer ---------- */

.site-footer {
  border-top: 1px solid var(--rule);
  padding-block: 24px clamp(34px, 4vw, 54px);
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  justify-content: space-between;
  gap: 14px 28px;
  font-family: var(--sans);
  font-size: 12.5px;
  letter-spacing: .04em;
  color: var(--muted);
}
.site-footer a { text-decoration: none; color: var(--muted); }
.site-footer a:hover { color: var(--ink); }
.foot-links { display: flex; flex-wrap: wrap; gap: 16px; align-items: center; }
.foot-links > a { padding-block: 9px; }
.contact-list dd a { padding-block: 4px; display: inline-block; }
.theme-switch {
  display: inline-flex;
  border: 1px solid var(--rule);
  border-radius: 999px;
  overflow: hidden;
}
.theme-switch button {
  min-height: 32px;
  border: 0;
  background: none;
  padding: 5px 11px;
  font-size: 10.5px;
  letter-spacing: .08em;
  cursor: pointer;
  color: var(--muted);
}
.theme-switch button[aria-pressed="true"] { background: var(--ink); color: var(--bg); }

/* ---------- lightbox ---------- */

.lb {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: var(--lb-bg);
  display: none;
  padding: clamp(16px, 4vw, 48px);
  grid-template-rows: 1fr auto;
  gap: 14px;
  opacity: 0;
  transition: opacity .25s var(--ease);
}
.lb[open], .lb.is-open { display: grid; opacity: 1; }
.lb-stage {
  display: grid;
  place-items: center;
  min-height: 0;
  position: relative;
}
.lb-stage img,
.lb-stage video,
.lb-stage iframe {
  max-width: min(94vw, 1500px);
  max-height: calc(100vh - 190px);
  width: auto;
  height: auto;
  object-fit: contain;
  background: #000;
}
.lb-stage iframe { width: min(94vw, 1200px); height: min(64vh, 675px); }
.lb-bar {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 16px;
  color: rgba(250, 248, 242, .82);
  font-family: var(--sans);
  font-size: 15px;
  letter-spacing: .03em;
}
.lb-cap { max-width: 70ch; }
.lb-count { opacity: .6; font-variant-numeric: tabular-nums; }
.lb-close, .lb-prev, .lb-next {
  position: absolute;
  border: 0;
  background: none;
  color: rgba(250, 248, 242, .8);
  cursor: pointer;
  font-size: 15px;
  letter-spacing: .1em;
  padding: 10px;
}
.lb-close { top: 10px; right: 10px; z-index: 2; }
.lb-prev { left: 6px; top: 50%; transform: translateY(-50%); }
.lb-next { right: 6px; top: 50%; transform: translateY(-50%); }
.lb-prev:hover, .lb-next:hover, .lb-close:hover { color: #fff; }

/* ---------- states ---------- */

.state {
  padding-block: 80px 120px;
  color: var(--muted);
  font-size: 14px;
  max-width: 60ch;
}
.state-title { margin: 0 0 12px; font-family: var(--serif); font-size: clamp(24px, 3vw, 34px); line-height: 1.3; color: var(--ink); }
.state-note { margin: 0; }
.state-note a, .state a { color: var(--ink); text-decoration: none; border-bottom: 1px solid var(--rule); }
.state-note a:hover { border-color: var(--ink); }
.state code {
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace;
  font-size: 12.5px;
  background: var(--bg-2);
  padding: 2px 6px;
  border-radius: 3px;
}

/* ---------- responsive ---------- */

@media (max-width: 1024px) {
  .works-grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}

@media (max-width: 720px) {
  body { font-size: 15.5px; }
  .grid { grid-template-columns: minmax(0, 1fr); }
  .works-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .wall-row { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .wall-item--wide { width: auto; margin-left: 0; }
  .wall-stack { grid-template-columns: 1fr; width: auto; margin-left: 0; }
  .wall-stack-col { grid-template-rows: auto auto; }
  .wall-section { margin-top: 44px; }
  .wall-row--fit { display: block; width: auto; margin-left: 0; }
  .wall-row--wide { width: auto; margin-left: 0; }
  .wall-row--fit .wall-btn { width: 100%; }
  .wall-row--fit .wall-btn img { height: auto; width: 100%; max-height: 88vh; }
  .wall-row .wall-item { margin-bottom: clamp(30px, 3.6vw, 52px); }
  .wall-row .wall-cap { margin-top: 0; }
  .site-header { flex-wrap: wrap; padding-bottom: 40px; }
  .nav { padding-top: 0; }

  .cv-list.is-stack li { grid-template-columns: minmax(0, 1fr); gap: 4px; }
  .cv-list.is-stack .yr { padding-top: 0; }
  .credits { grid-template-columns: minmax(0, 1fr); }
  .credits-row { grid-template-columns: 8em minmax(0, 1fr); }
  .about-intro { grid-template-columns: minmax(0, 1fr); gap: 20px; }
  .portrait { max-width: 150px; }
  .lb { padding: 12px; }
  .lb-stage img, .lb-stage video { max-height: calc(100vh - 160px); }
  .lb-prev { left: -2px; } .lb-next { right: -2px; }
}

@media (prefers-reduced-motion: reduce) {
  * { animation-duration: .001ms !important; transition-duration: .001ms !important; }
  .card { opacity: 1; transform: none; }
}

/* 项目页底部的外链（如即梦画布） */
.proj-links {
  list-style: none;
  margin: clamp(26px, 3.2vw, 40px) 0 0;
  padding: 0;
  font-size: 15px;
  line-height: 1.9;
}
.proj-links a {
  display: inline-block;
  padding: 13px 20px;
  color: var(--ink);
  text-decoration: none;
  background: #ffffff;
  border: 1px solid var(--frame);
  box-shadow: 0 8px 18px -10px rgba(30, 24, 10, .45);
  transition: color .3s var(--ease), box-shadow .3s var(--ease), transform .3s var(--ease);
}
.proj-links a:hover {
  color: var(--strip-hot);
  transform: translateY(-2px);
  box-shadow: 0 14px 24px -12px rgba(30, 24, 10, .5);
}

/* ---------- 项目封面的黄圈箭头光标（学 oliverjeffers.com） ---------- */

.card {
  cursor: url("../img/cursor-arrow.svg") 60 60, pointer;
}

/* 触屏 / 不支持 SVG 光标的环境退回普通指针 */
@media (pointer: coarse) {
  .card { cursor: pointer; }
}
