/* 他山 L · desk 幕。无 JS：两组卡片平铺成网格，标题在上。
   :root.js：单屏，深色双半屏擦除（z -2，在拖影之下）+ 5 轨 3 角虚线装饰 + 双弧画廊（z5）+ 全屏查看器（dialog 顶层）。
   卡面是自绘线稿“照片”：深底 + 一处柔光，A 组偏暖、B 组偏冷，颜色取自 core 令牌的实际值。 */
#scene-desk .dk-defs { position: absolute; width: 0; height: 0; overflow: hidden; }
#scene-desk .dk-wrap { position: relative; padding: 32px clamp(16px, 3vw, 40px) 48px; --dk-half: 0px; }
#scene-desk .dk-wipe, #scene-desk .dk-orn { display: none; }
#scene-desk .dk-gal { display: flex; flex-direction: column; }
#scene-desk .dk-title { order: -1; margin: 0 0 8px; font: 600 .76rem/1.2 var(--font-mono); letter-spacing: .18em; color: var(--muted); white-space: nowrap; }
#scene-desk .dk-tw i { display: inline-block; width: 2.6em; height: 1px; margin: 0 .8em; vertical-align: middle; background: currentColor; opacity: .6; }
#scene-desk .dk-label { display: flex; align-items: baseline; gap: 10px; margin: 24px 0 12px; }
#scene-desk .dk-label span { font: 740 clamp(1.45rem, 2vw, 2.15rem)/1 var(--font-display); color: var(--text); letter-spacing: 0; }
#scene-desk .dk-label small { font: 600 .62rem/1.4 var(--font-mono); letter-spacing: .12em; color: var(--muted); }
#scene-desk .dk-track { display: flex; flex-wrap: wrap; gap: 16px; }
#scene-desk .dk-card { position: relative; display: block; width: min(100%, 248px); padding: 0; border: 0; background: none; color: var(--text); text-align: left; font: inherit; -webkit-tap-highlight-color: transparent; }
#scene-desk .dk-row.is-a { --glow: #f3d8d0; }
#scene-desk .dk-row.is-b { --glow: #d3d5ce; }
#scene-desk .dk-face, #scene-desk .dk-v-face { position: relative; display: block; aspect-ratio: 360 / 344; overflow: hidden; border-radius: 9.5%; color: #f0f1ed;
  background: radial-gradient(110% 85% at var(--gx, 50%) var(--gy, 40%), color-mix(in srgb, var(--glow) 24%, transparent), transparent 64%), linear-gradient(160deg, #242622, #121210 78%); }
#scene-desk .dk-face svg, #scene-desk .dk-v-face svg { display: block; width: 100%; height: 100%; fill: none; stroke: currentColor; stroke-width: 1.6; stroke-linecap: round; stroke-linejoin: round; stroke-opacity: .82; }
#scene-desk .dk-dim { position: absolute; inset: 0; background: #050505; opacity: 0; pointer-events: none; }
#scene-desk .dk-cap { display: block; padding: 8px 2px 0; }
#scene-desk .dk-cap b { display: block; font: 650 .95rem/1.35 var(--font-display); }
#scene-desk .dk-desc { display: block; margin-top: 2px; font-size: .8rem; line-height: 1.5; color: var(--muted); }

/* ── JS：单屏舞台 ── */
:root.js #scene-desk .dk-wrap { height: calc(100vh - var(--header-h)); height: calc(100dvh - var(--header-h)); padding: 0; overflow: hidden; user-select: none; -webkit-user-select: none; }
:root.js #scene-desk .dk-wrap[data-vis="dark"] { --text: #f0f1ed; --muted: #a5a79f; --line: rgba(240, 241, 237, .16); --line-strong: rgba(240, 241, 237, .42); --accent: #f06449; }
:root.js #scene-desk .dk-wipe { display: block; position: absolute; inset: 0; z-index: -2; pointer-events: none; }
#scene-desk .dk-up, #scene-desk .dk-lo { position: absolute; left: 0; width: 100%; height: 50%; background-color: #121210; transform: translateX(var(--from));
  background-image: linear-gradient(to right, rgba(242, 241, 235, .075) 1px, transparent 1px), linear-gradient(to bottom, rgba(242, 241, 235, .075) 1px, transparent 1px);
  background-size: var(--grid) var(--grid); }
#scene-desk .dk-up { top: 0; --from: -101%; }
#scene-desk .dk-lo { bottom: 0; --from: 101%; background-position: 0 calc(-1 * var(--dk-half)); }
#scene-desk .dk-up.is-in, #scene-desk .dk-lo.is-in { transform: none; }
#scene-desk .dk-up::after, #scene-desk .dk-lo::after { content: ""; position: absolute; top: 0; bottom: 0; width: 1px; background: #f06449; opacity: .62; }
#scene-desk .dk-up::after { right: -1px; }
#scene-desk .dk-lo::after { left: -1px; }
:root.js #scene-desk .dk-orn { display: block; z-index: -2; color: #f06449; }
#scene-desk .dk-orn .orn-x, #scene-desk .dk-orn .orn-y { opacity: .44; }
#scene-desk .dk-o1 { top: 12px; left: 6%; width: 28%; animation-duration: 1.3s; }
#scene-desk .dk-o2 { bottom: 12px; right: 8%; width: 32%; animation-duration: 1.5s; animation-direction: reverse; }
#scene-desk .dk-o3 { left: 14px; top: 18%; height: 30%; animation-duration: 1.7s; }
#scene-desk .dk-o4 { right: 14px; bottom: 16%; height: 34%; animation-duration: 1.2s; animation-direction: reverse; }
#scene-desk .dk-o5 { top: calc(50% - 1px); right: 3%; width: 10%; }
#scene-desk .dk-c1 { top: 26px; left: 26px; border-width: 2px 0 0 2px; }
#scene-desk .dk-c2 { bottom: 26px; right: 26px; border-width: 0 2px 2px 0; animation-delay: -1.1s; }
#scene-desk .dk-c3 { top: 26px; right: 26px; border-width: 2px 2px 0 0; animation-delay: -2.2s; }
/* 画廊：两行各 52% 高，在 50% 处收拢；卡片由 desk.js 逐帧摆到弧上。中线 z4 < 卡 z5 < 字 z6（gal 内部层级）。 */
:root.js #scene-desk .dk-gal { position: absolute; inset: 0; z-index: 5; isolation: isolate; display: block; }
:root.js #scene-desk .dk-gal::before { content: ""; position: absolute; left: 0; right: 0; top: 50%; height: 1px; z-index: 4; background: var(--line); transition: background-color 420ms var(--ease); }
:root.js #scene-desk .dk-row { position: absolute; left: 0; right: 0; height: 52%; z-index: 5; touch-action: pan-y; cursor: grab; }
:root.js #scene-desk .dk-row.is-a { top: -2%; }
:root.js #scene-desk .dk-row.is-b { bottom: -2%; }
:root.js #scene-desk .dk-wrap.is-drag .dk-row { cursor: grabbing; }
:root.js #scene-desk .dk-track { position: absolute; inset: 0; display: block; }
:root.js #scene-desk .dk-card { position: absolute; left: 50%; top: 50%; width: var(--cw, 300px); height: var(--ch, 286px); margin: calc(var(--ch, 286px) / -2) 0 0 calc(var(--cw, 300px) / -2);
  border-radius: 9.5%; cursor: inherit; will-change: transform; outline-offset: 6px; }
:root.js #scene-desk .dk-card:focus-visible { outline: 2px solid #f06449; }
:root.js #scene-desk .dk-face { width: 100%; height: 100%; aspect-ratio: auto; transform: perspective(var(--pv, 500px)) rotateX(var(--rx, 0deg)) rotateY(var(--ry, 0deg)); }
:root.js #scene-desk .dk-cap { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
:root.js #scene-desk .dk-desc { display: none; }
:root.js #scene-desk .dk-title { position: absolute; left: 50%; top: 50%; z-index: 6; margin: 0; padding: 4px 14px; transform: translate(-50%, -50%);
  font-size: clamp(.64rem, .82vw, .76rem); color: var(--muted); }
:root.js #scene-desk .dk-label { position: absolute; left: clamp(18px, 3.4vw, 52px); z-index: 6; margin: 0; flex-direction: column; gap: 4px; pointer-events: none; }
:root.js #scene-desk .is-a .dk-label { bottom: 35px; }
:root.js #scene-desk .is-b .dk-label { top: 60px; }
:root.js #scene-desk .dk-title, :root.js #scene-desk .dk-label { opacity: 0; transition: opacity 420ms var(--ease) 180ms, color 920ms var(--ease) 0ms; }
:root.js #scene-desk .dk-label span, :root.js #scene-desk .dk-label small { transition: color 920ms var(--ease); }
:root.js #scene-desk .dk-wrap.is-lit .dk-title, :root.js #scene-desk .dk-wrap.is-lit .dk-label { opacity: 1; }
:root.js #scene-desk .dk-wrap.is-out .dk-title, :root.js #scene-desk .dk-wrap.is-out .dk-label { opacity: 0; transition-delay: 0ms, 0ms; }
:root.js #scene-desk .dk-wrap[data-vis="light"] .dk-label span, :root.js #scene-desk .dk-wrap[data-vis="light"] .dk-label small { transition-delay: 520ms; }
:root.js #scene-desk .dk-wrap[data-vis="light"] .dk-title { transition-delay: 180ms, 520ms; }

/* 查看器：深色全屏，浅色主题下同样深色。 */
#scene-desk .dk-viewer { position: fixed; inset: 0; width: 100%; max-width: none; height: 100%; max-height: none; margin: 0; padding: 28px clamp(76px, 7vw, 136px); border: 0;
  color: #f0f1ed; background: rgba(5, 5, 5, .95); -webkit-backdrop-filter: blur(14px) saturate(88%); backdrop-filter: blur(14px) saturate(88%); overscroll-behavior: contain; }
#scene-desk .dk-viewer::backdrop { background: transparent; }
#scene-desk .dk-viewer[open] { display: grid; grid-template-columns: 46px minmax(0, 1fr) 46px; align-items: center; gap: clamp(12px, 2vw, 28px); }
#scene-desk .dk-viewer.is-a { --glow: #f3d8d0; } #scene-desk .dk-viewer.is-b { --glow: #d3d5ce; }
#scene-desk .dk-v-btn { width: 46px; height: 46px; padding: 0; border: 1px solid rgba(240, 241, 237, .42); border-radius: 50%; background: rgba(240, 241, 237, .06); color: #f0f1ed; font: 500 1.05rem/1 var(--font-mono);
  transition: background-color 200ms var(--ease), border-color 200ms var(--ease); }
#scene-desk .dk-v-btn:hover { background: rgba(240, 241, 237, .14); border-color: #f06449; }
#scene-desk .dk-v-btn:focus-visible { outline-color: #f06449; outline-offset: 3px; }
#scene-desk .dk-v-close { position: absolute; top: 18px; right: 18px; }
#scene-desk .dk-v-prev { grid-column: 1; grid-row: 1; } #scene-desk .dk-v-next { grid-column: 3; grid-row: 1; }
#scene-desk .dk-v-fig { grid-column: 2; grid-row: 1; display: flex; flex-direction: column; align-items: center; gap: 16px; margin: 0; min-width: 0; }
#scene-desk .dk-v-face { width: min(100%, calc((100vh - 220px) * 360 / 344)); width: min(100%, calc((100dvh - 220px) * 360 / 344)); max-width: 820px; border-radius: 3.2%; }
#scene-desk .dk-v-face svg { stroke-width: 1.2; }
#scene-desk .dk-v-fig figcaption { max-width: 560px; text-align: center; }
#scene-desk .dk-v-title { margin: 0; font: 680 clamp(1.1rem, 1.6vw, 1.45rem)/1.3 var(--font-display); }
#scene-desk .dk-v-desc { margin: 6px 0 0; font-size: .9rem; color: #d3d5ce; }
#scene-desk .dk-v-meta { display: flex; flex-wrap: wrap; justify-content: center; gap: 4px 16px; margin: 10px 0 0; font: 600 .66rem/1.5 var(--font-mono); letter-spacing: .1em; color: #a5a79f; }
#scene-desk .dk-v-count { color: #f06449; }

@media (max-width: 760px) {
  :root.js #scene-desk .dk-label { left: 18px; }
  #scene-desk .dk-viewer { padding: 64px 16px 20px; }
  #scene-desk .dk-viewer[open] { grid-template-columns: 1fr 1fr; grid-template-rows: minmax(0, 1fr) auto; justify-items: center; gap: 14px; }
  #scene-desk .dk-v-fig { grid-column: 1 / -1; }
  #scene-desk .dk-v-prev { grid-column: 1; grid-row: 2; justify-self: end; } #scene-desk .dk-v-next { grid-column: 2; grid-row: 2; justify-self: start; }
  #scene-desk .dk-v-face { width: min(100%, calc((100dvh - 300px) * 360 / 344)); }
}
:root[data-reduced] #scene-desk .dk-title, :root[data-reduced] #scene-desk .dk-label, :root[data-reduced] #scene-desk .dk-label *, :root[data-reduced] #scene-desk .dk-gal::before { transition: none !important; }
:root[data-reduced] #scene-desk .dk-up::after, :root[data-reduced] #scene-desk .dk-lo::after { opacity: 0; }
@media (forced-colors: active) {
  :root.js #scene-desk .dk-wipe, :root.js #scene-desk .dk-orn { display: none; }
  #scene-desk .dk-face, #scene-desk .dk-v-face { background: Canvas; color: CanvasText; border: 1px solid CanvasText; }
  #scene-desk .dk-dim { display: none; }
}
