/* B2W Studio：界面只用黑白灰，颜色来自作品本身。例外只有一个：影院灯箱素材自带的白光、不锈钢和暖光灯泡（见 SPEC.md 第 2 节）。 */
@font-face { font-family: "Archivo"; src: url("fonts/Archivo-VF.woff2") format("woff2"); font-weight: 100 900; font-stretch: 62% 125%; font-display: swap; }
:root {
  --black: #000; --white: #fff; --mute-on-white: #5c5c5c; --mute-on-black: #a8a8a8;
  --line-on-white: #d6d6d6; --line-on-black: #333; --sunk: #f2f2f2;
  --display: "Archivo", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --body: "Archivo", "PingFang SC", "Microsoft YaHei", "Noto Sans SC", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Consolas, "Microsoft YaHei", monospace;
  --gutter: clamp(16px, 3.2vw, 48px);
  --theater: #0a0908;
}
* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; scroll-behavior: smooth; scroll-padding-top: 56px; }
body { margin: 0; background: var(--white); color: var(--black); font-family: var(--body); font-size: 16px; line-height: 1.75; }
a { color: inherit; }
img, video { display: block; max-width: 100%; }
h1, h2, h3, h4 { margin: 0; line-height: 1.15; font-weight: 800; text-wrap: balance; }
p { margin: 0; }
:focus-visible { outline: 2px solid currentColor; outline-offset: 3px; }
.dark :focus-visible, .bar :focus-visible { outline-color: var(--white); }
.skip { position: absolute; left: -999px; top: 8px; background: var(--white); color: var(--black); padding: 8px 12px; z-index: 30; }
.skip:focus { left: 8px; }

/* 顶栏：全站一条黑 */
.bar { position: sticky; top: 0; z-index: 20; height: 56px; background: var(--black); color: var(--white); display: flex; align-items: center; justify-content: space-between; padding-inline: var(--gutter); }
.bar .home { display: flex; align-items: center; gap: 10px; text-decoration: none; }
.bar .home img { height: 26px; width: auto; }
.bar .home span { font-weight: 500; font-size: 13px; letter-spacing: .14em; }
.bar nav { display: flex; gap: clamp(14px, 2.4vw, 32px); font-size: 14px; }
.bar nav a { text-decoration: none; padding-block: 6px; border-bottom: 1px solid transparent; }
.bar nav a:hover, .bar nav a[aria-current] { border-bottom-color: var(--white); }

/* 开场 */
.hero { position: relative; background: var(--black); color: var(--white); height: calc(100vh - 56px); height: calc(100svh - 56px); min-height: 420px; overflow: hidden; display: grid; place-items: center; }
.hero video, .hero .still { width: 100%; height: 100%; object-fit: contain; }
.hero .still { display: none; padding: 0 20vw; }
.hero.static video { display: none; }
.hero.static .still { display: block; }
.hero .foot { position: absolute; left: var(--gutter); right: var(--gutter); bottom: 24px; display: flex; justify-content: space-between; gap: 24px; align-items: flex-end; font-size: 14px; color: var(--mute-on-black); }
.hero .foot b { color: var(--white); font-weight: 500; }
.hero .foot a { color: var(--white); text-decoration: none; border-bottom: 1px solid var(--white); white-space: nowrap; }
@media (max-aspect-ratio: 1/1) { .hero video { position: absolute; left: 50%; top: 50%; width: 125vw; height: auto; max-width: none; transform: translate(-50%, -50%); } .hero .still { padding: 0 8vw; } }

/* 通用段落 */
.sec { padding: clamp(56px, 8vw, 112px) var(--gutter); }
.sec.dark { background: var(--black); color: var(--white); }
.big { font-family: var(--display); font-weight: 800; font-stretch: 125%; font-size: clamp(40px, 8vw, 112px); line-height: 1; letter-spacing: -.01em; }
.big sup { font-size: .22em; font-weight: 500; font-stretch: 100%; vertical-align: top; position: relative; top: .5em; margin-left: .4em; letter-spacing: 0; }
.lead { font-size: clamp(20px, 2.6vw, 34px); line-height: 1.35; font-weight: 600; max-width: 22em; }

/* 作品筛选 */
.works-head { display: flex; flex-wrap: wrap; justify-content: space-between; align-items: flex-end; gap: 24px; margin-bottom: clamp(28px, 4vw, 48px); }
.filter { display: flex; flex-wrap: wrap; gap: 4px 18px; font-size: 15px; }
.filter button { font: inherit; background: none; border: 0; border-bottom: 2px solid transparent; padding: 6px 0; cursor: pointer; color: var(--mute-on-white); }
.filter button:hover { color: var(--black); }
.filter button[aria-pressed="true"] { color: var(--black); border-bottom-color: var(--black); font-weight: 700; }

/* 作品瀑布流：保持原比例，不裁切 */
.grid { column-count: 3; column-gap: clamp(14px, 2vw, 28px); }
@media (max-width: 1000px) { .grid { column-count: 2; } }
@media (max-width: 480px) { .grid { column-count: 1; } }
.card { display: block; break-inside: avoid; text-decoration: none; margin-bottom: clamp(28px, 3.4vw, 48px); }
.card[hidden] { display: none; }
.card .media { display: block; position: relative; background: var(--black); overflow: hidden; }
.card img, .card video { width: 100%; height: 100%; object-fit: cover; }
.card video { position: absolute; inset: 0; opacity: 0; transition: opacity .18s linear; }
.card.playing video { opacity: 1; }
.card h3 { font-size: 18px; margin-top: 12px; font-weight: 700; }
.card:hover h3 { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.card .meta { font-size: 13px; color: var(--mute-on-white); margin-top: 2px; display: flex; flex-wrap: wrap; gap: 0 10px; align-items: baseline; }
.tag { display: inline-block; font-size: 12px; line-height: 1.5; border: 1px solid currentColor; padding: 0 6px; white-space: nowrap; }

/* 怎么做 */
.how-grid { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); }
@media (max-width: 800px) { .how-grid { grid-template-columns: minmax(0, 1fr); } }
.rows { list-style: none; margin: 0; padding: 0; border-top: 1px solid var(--line-on-white); }
.dark .rows { border-top-color: var(--line-on-black); }
.rows li { border-bottom: 1px solid var(--line-on-white); }
.dark .rows li { border-bottom-color: var(--line-on-black); }
.rows a { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 4px 16px; padding: 16px 0; text-decoration: none; }
.rows b { font-size: 18px; font-weight: 700; }
.rows span { color: var(--mute-on-white); font-size: 14px; grid-column: 1; }
.dark .rows span { color: var(--mute-on-black); }
.rows i { grid-column: 2; grid-row: 1 / span 2; align-self: center; font-style: normal; transition: transform .18s ease; }
.rows a:hover i { transform: translateX(6px); }
.rows a:hover b { text-decoration: underline; text-underline-offset: 4px; }
.sub { font-size: 14px; letter-spacing: .08em; margin: 0 0 18px; font-weight: 500; }
.dark .sub { color: var(--mute-on-black); }
.two { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: clamp(32px, 6vw, 96px); }
@media (max-width: 800px) { .two { grid-template-columns: minmax(0, 1fr); } }
.dark .lead + p { color: var(--mute-on-black); margin-top: 20px; max-width: 34em; }

/* 页脚 */
.foot-logo { background: var(--white); padding: clamp(32px, 6vw, 72px) var(--gutter) 0; }
.foot-logo video, .foot-logo img { width: min(1100px, 100%); margin-inline: auto; }
.foot-logo.static video { display: none; }
.foot-logo img { display: none; }
.foot-logo.static img { display: block; padding: 8% 12%; }
.colophon { border-top: 1px solid var(--line-on-white); margin: 0 var(--gutter); padding: 24px 0 40px; font-size: 13px; color: var(--mute-on-white); display: grid; grid-template-columns: minmax(0, 2fr) minmax(0, 1fr); gap: 24px; }
.colophon p { max-width: 46em; }
.colophon .r { text-align: right; }
@media (max-width: 700px) { .colophon { grid-template-columns: minmax(0, 1fr); } .colophon .r { text-align: left; } }

/* 作品页 */
.screen { background: var(--black); padding: clamp(0px, 2vw, 32px) var(--gutter); display: grid; place-items: center; }
.screen video { aspect-ratio: var(--ar, 16 / 9); width: min(100%, calc((100vh - 120px) * var(--arn, 1.7778))); width: min(100%, calc((100svh - 120px) * var(--arn, 1.7778))); height: auto; background: var(--black); object-fit: contain; }
.info { padding: clamp(32px, 5vw, 64px) var(--gutter); display: grid; grid-template-columns: minmax(0, 5fr) minmax(0, 6fr); gap: clamp(28px, 6vw, 96px); }
@media (max-width: 800px) { .info { grid-template-columns: minmax(0, 1fr); } }
.info h1 { font-size: clamp(30px, 4.6vw, 60px); font-weight: 800; }
.info .en { font-stretch: 125%; font-weight: 500; font-size: 15px; color: var(--mute-on-white); margin-top: 10px; }
.facts { margin: 24px 0 0; display: grid; grid-template-columns: auto minmax(0, 1fr); gap: 4px 20px; font-size: 14px; }
.facts dt { color: var(--mute-on-white); }
.facts dd { margin: 0; }
.body > * + * { margin-top: 28px; }
.body .summary { font-size: clamp(18px, 2vw, 24px); line-height: 1.5; font-weight: 600; }
.body h2 { font-size: 13px; letter-spacing: .08em; font-weight: 600; margin-bottom: 8px; color: var(--mute-on-white); }
.body ul { margin: 0; padding-left: 1.1em; }
.note { border: 2px solid var(--black); padding: 16px 18px; }
.note h2 { color: var(--black); font-weight: 800; }
.more a { display: inline-block; margin-right: 18px; }
.parts { display: grid; gap: clamp(24px, 4vw, 48px); padding: clamp(24px, 4vw, 48px) var(--gutter); background: var(--black); color: var(--white); }
.parts figure { margin: 0; }
.parts video { max-height: 82vh; margin-inline: auto; background: var(--black); width: auto; }
.parts figcaption { text-align: center; font-size: 14px; color: var(--mute-on-black); margin-top: 10px; }
.pager { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); border-top: 1px solid var(--line-on-white); }
.pager a { padding: 24px var(--gutter); text-decoration: none; font-weight: 700; font-size: clamp(16px, 2vw, 22px); }
.pager a:hover { background: var(--black); color: var(--white); }
.pager a small { display: block; font-weight: 400; font-size: 13px; opacity: .65; }
.pager a + a { text-align: right; border-left: 1px solid var(--line-on-white); }

.info.first { padding-bottom: clamp(24px, 3vw, 40px); }

/* 手册和文档 */
.doc-wrap { display: grid; grid-template-columns: 220px minmax(0, 1fr); gap: clamp(24px, 5vw, 72px); padding: clamp(32px, 5vw, 64px) var(--gutter); }
@media (max-width: 860px) { .doc-wrap { grid-template-columns: minmax(0, 1fr); } }
.toc { position: sticky; top: 80px; align-self: start; font-size: 14px; }
.toc ol { list-style: none; margin: 0; padding: 0; }
.toc a { display: block; padding: 6px 0; text-decoration: none; color: var(--mute-on-white); border-left: 2px solid transparent; padding-left: 10px; }
.toc a:hover { color: var(--black); }
.toc a[aria-current] { color: var(--black); font-weight: 700; border-left-color: var(--black); }
@media (max-width: 860px) { .toc { position: static; } .toc ol { display: flex; flex-wrap: wrap; gap: 0 14px; } .toc a { padding-left: 0; border-left: 0; } .toc a[aria-current] { text-decoration: underline; text-underline-offset: 4px; } }
.doc { max-width: 52rem; min-width: 0; }
.doc h1 { font-size: clamp(32px, 5vw, 60px); font-weight: 800; margin-bottom: 24px; }
.doc h2 { font-size: clamp(22px, 2.6vw, 30px); margin: 2.2em 0 .6em; }
.doc h3 { font-size: 18px; margin: 1.8em 0 .5em; }
.doc p { margin: .9em 0; }
.doc hr { border: 0; border-top: 1px solid var(--line-on-white); margin: 2.6em 0; }
.doc ul, .doc ol { padding-left: 1.3em; }
.doc li { margin: .3em 0; }
.doc li.task { list-style: none; margin-left: -1.3em; }
.doc li.task::before { content: "□ "; }
.doc code { font-family: var(--mono); font-size: .88em; background: var(--sunk); padding: .1em .35em; }
.doc pre { background: var(--black); color: var(--white); padding: 16px 18px; overflow-x: auto; font-size: 13.5px; line-height: 1.6; }
.doc pre code { background: none; padding: 0; color: inherit; }
.doc .tb { overflow-x: auto; margin: 1.2em 0; border-top: 2px solid var(--black); }
.doc table { border-collapse: collapse; width: 100%; font-size: 14.5px; line-height: 1.6; }
.doc th, .doc td { text-align: left; vertical-align: top; padding: 9px 14px 9px 0; border-bottom: 1px solid var(--line-on-white); }
.doc th { font-weight: 700; white-space: nowrap; }
.doc a { text-underline-offset: 3px; }

@media (prefers-reduced-motion: reduce) { html { scroll-behavior: auto; } .rows i, .card video { transition: none; } }

/* ---------- 影院灯箱 ----------
   照片级灯箱：底图是灯泡全灭的照片，.on 时每颗灯泡依次换成亮灯照片；外面一层白光光晕往外溢。
   素材在 assets/theater/，由 assets/theater.js 组装。灯箱和不锈钢是照片，不要用 CSS 重画。 */
.sr { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
.lbw { position: relative; display: block; }
.lb { position: relative; display: block; width: 100%; aspect-ratio: 1536 / 630; background: url(theater/lb-off.webp) 0 0 / 100% 100%; container-type: inline-size; }
.lb .lit { position: absolute; inset: 0; background-size: 100% 100%; opacity: 0; z-index: 1; }
.lb .bulb { position: absolute; width: 7.6%; height: 34%; top: 66%; transform: translateX(-50%); background-size: calc(100% / .076) calc(100% / .34);
  opacity: 0; z-index: 2; mix-blend-mode: screen; -webkit-mask: radial-gradient(closest-side, #000 45%, transparent 100%); mask: radial-gradient(closest-side, #000 45%, transparent 100%); }
.lb .mark { position: absolute; left: 50.1%; top: 43.2%; transform: translate(-50%, -50%); height: 36%; aspect-ratio: 1409 / 1496;
  background: url(theater/b2w-mark.png) center / contain no-repeat; opacity: .95; z-index: 3; }
.lb .num { position: absolute; left: 50.1%; top: 43.2%; transform: translate(-50%, -50%); z-index: 3; font-style: normal; font-weight: 900; font-stretch: 125%;
  line-height: 1; letter-spacing: -.02em; font-size: 11.5cqw; color: #0b0b0b; }
.lbw > .bloom { position: absolute; left: -19.531%; width: 139.062%; top: -41.27%; height: 182.54%; mix-blend-mode: screen; pointer-events: none; z-index: 2; opacity: 0; }
.lbw > .bloom .hum { position: absolute; inset: 0; background: url(theater/lb-bloom.png) 0 0 / 100% 100%; animation: hum 5.5s ease-in-out infinite; }
@keyframes hum { 0%, 100% { opacity: .78; } 50% { opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .lbw > .bloom .hum { animation: none; } }

/* 首页开场：灯箱横贯整屏 + 正在上映 */
.theater { background: var(--theater); color: var(--white); padding: 8px 0 clamp(48px, 7vw, 96px); overflow: hidden; }
.theater .lb .num { display: none; }
.theater .intro { padding: clamp(8px, 2vw, 24px) var(--gutter) 0; max-width: 1300px; margin: 0 auto; }
.theater .hl { font-size: clamp(22px, 2.6vw, 34px); font-weight: 700; line-height: 1.3; }
.theater .intro p + p { font-size: 14px; color: var(--mute-on-black); margin-top: 8px; }
.now { max-width: 1300px; margin: clamp(32px, 4vw, 48px) auto 0; padding: 0 var(--gutter); }
.now .hd { font-size: 13px; letter-spacing: .35em; color: var(--mute-on-black); padding-bottom: 12px; border-bottom: 1px solid var(--line-on-black); }
.now ul { list-style: none; margin: 0; padding: 0; }
.now li a { display: flex; align-items: baseline; gap: clamp(14px, 2vw, 24px); padding: 16px 0; border-bottom: 1px solid var(--line-on-black); text-decoration: none; font-stretch: 125%; }
.now li b { font-weight: 900; font-size: clamp(18px, 1.8vw, 22px); min-width: 2.4em; color: var(--mute-on-black); }
.now li span { flex: 1; font-weight: 700; font-size: clamp(16px, 1.8vw, 22px); line-height: 1.35; }
.now li i { font-style: normal; color: var(--mute-on-black); font-size: 15px; }
.now li a:hover span { text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 2px; }
.now .all { display: inline-block; margin-top: 20px; font-size: 14px; text-decoration: none; border-bottom: 1px solid var(--white); }

/* 作品墙放进影院：深色底，每张卡片头顶一个小灯箱 */
#works.dark { background: var(--theater); }
.dark .filter button { color: var(--mute-on-black); }
.dark .filter button:hover, .dark .filter button[aria-pressed="true"] { color: var(--white); border-bottom-color: var(--white); }
.dark .card .meta { color: var(--mute-on-black); }
.card .lbw { margin-bottom: -3%; }
.card .lbw + .media { position: relative; z-index: 1; }

/* 作品页：视频上方一条灯箱 */
.marquee-top { background: var(--theater); padding: 4px 0 0; overflow: hidden; }
.marquee-top .lbw { max-width: min(640px, 88vw); margin: 0 auto; }
.marquee-top + .screen, .marquee-top + .info { border-top: 0; }
.grid.js { column-count: auto; display: flex; align-items: flex-start; gap: clamp(14px, 2vw, 28px); }
.grid.js > .gcol { flex: 1; min-width: 0; }

/* 右上角：开关灯 + 亮度（只在有灯箱的页面出现，由 theater.js 插入） */
.lightctl { position: relative; display: flex; align-items: center; gap: 4px; margin-left: clamp(4px, 1.2vw, 12px); }
.lightctl button { width: 32px; height: 32px; display: grid; place-items: center; background: none; border: 1px solid transparent; color: var(--white); cursor: pointer; padding: 0; }
.lightctl button:hover { border-color: var(--line-on-black); }
.lightctl svg { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; }
.lightctl .lc-power[aria-pressed="true"] svg path { fill: currentColor; fill-opacity: .25; }
.lightctl.off .lc-power { color: var(--mute-on-black); }
.lc-panel { position: absolute; right: 0; top: 44px; width: 248px; background: var(--black); border: 1px solid var(--line-on-black); padding: 14px 16px; display: grid; gap: 12px; z-index: 30; }
.lc-panel[hidden] { display: none; }
.lc-panel label { display: grid; grid-template-columns: 3.6em 1fr 3em; align-items: center; gap: 10px; font-size: 13px; color: var(--white); }
.lc-panel input { width: 100%; accent-color: var(--white); }
.lc-panel output { text-align: right; color: var(--mute-on-black); font-variant-numeric: tabular-nums; }
.bar nav { align-items: center; }
.bar nav a { white-space: nowrap; }
@media (max-width: 480px) {
  .bar nav { gap: 8px; font-size: 13px; }
  .lightctl { gap: 2px; }
  .lightctl button { width: 30px; }
}
@media (max-width: 360px) {
  .bar .home span { display: none; }
}


/* 卡片光晕会伸出卡片外，作品墙横向裁掉，避免手机上出现横向滚动 */
#works { overflow-x: clip; }
.card .media { transition: none; }
