/* ==========================================================================
   帧 · 动效选片室 (FRAME ATELIER V4)
   Ground-Up Spatial Redesign — Left Curatorial Rail + Living Cinema Showcase
   + Borderless Exhibition Grid + Hover-Scrub Case Flipper + Contact Sheet Theater
   ========================================================================== */

:root {
  --font-serif: 'Noto Serif SC', 'Source Han Serif SC', 'Songti SC', 'STSong', Georgia, serif;
  --font-sans: 'Noto Sans SC', 'PingFang SC', 'Segoe UI', 'Microsoft YaHei UI', system-ui, sans-serif;
  --font-mono: 'Source Code Pro', 'SFMono-Regular', Consolas, ui-monospace, monospace;
  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --rail-w: 268px;
}

/* Signature Default: Darkroom Cinema Obsidian */
[data-surface="darkroom"] {
  --bg: #08090C;
  --rail-bg: #0C0D11;
  --surface: #12141A;
  --surface-2: #181B23;
  --surface-3: #222631;
  --plinth: #101218;
  --stage: #050608;
  --border: rgba(255, 248, 238, 0.085);
  --border-strong: rgba(255, 248, 238, 0.18);
  --text: #F5F1E9;
  --text-2: #A6A39B;
  --text-3: #6C6B66;
  --accent: #E65A3D;
  --accent-hover: #F26B4F;
  --accent-soft: rgba(230, 90, 61, 0.14);
  --accent-ink: #FFFDF8;
  --gold: #D1B284;
  --light-btn-bg: #F5F1E9;
  --light-btn-ink: #090A0D;
  --glass-bg: rgba(255, 255, 255, 0.07);
  --glass-hover: rgba(255, 255, 255, 0.14);
  --scrim: rgba(3, 4, 7, 0.84);
  --ambient-opacity: 0.28;
  --showcase-fade: linear-gradient(180deg, rgba(8, 9, 12, 0.22) 0%, rgba(8, 9, 12, 0.78) 72%, #08090C 100%);
}

/* Optional Archival Gallery Paper Surface */
[data-surface="paper"] {
  --bg: #F3EFE7;
  --rail-bg: #EAE4D9;
  --surface: #FAF8F3;
  --surface-2: #EFEAE0;
  --surface-3: #E3DDD1;
  --plinth: #E6E0D5;
  --stage: #141518;
  --border: rgba(24, 22, 19, 0.11);
  --border-strong: rgba(24, 22, 19, 0.24);
  --text: #181614;
  --text-2: #58534B;
  --text-3: #878075;
  --accent: #BD3824;
  --accent-hover: #A42D1B;
  --accent-soft: rgba(189, 56, 36, 0.1);
  --accent-ink: #FAF8F3;
  --gold: #8C6A3D;
  --light-btn-bg: #181614;
  --light-btn-ink: #FAF8F3;
  --glass-bg: rgba(24, 22, 19, 0.06);
  --glass-hover: rgba(24, 22, 19, 0.12);
  --scrim: rgba(18, 17, 15, 0.72);
  --ambient-opacity: 0.16;
  --showcase-fade: linear-gradient(180deg, rgba(243, 239, 231, 0.55) 0%, rgba(243, 239, 231, 0.86) 72%, #F3EFE7 100%);
}

/* ---------- Base ---------- */
*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-text-size-adjust: 100%; }
body {
  margin: 0;
  font-family: var(--font-sans);
  font-size: 13.5px;
  line-height: 1.55;
  color: var(--text);
  background: var(--bg);
  min-height: 100vh;
  overflow-x: clip;
  -webkit-font-smoothing: antialiased;
}
img, video, svg { display: block; max-width: 100%; }
button, input, select, textarea { font: inherit; color: inherit; }
button { background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
[hidden] { display: none !important; }

.sr-only {
  position: absolute; width: 1px; height: 1px; margin: -1px; overflow: hidden;
  clip: rect(0, 0, 0, 0); white-space: nowrap;
}
.skip-link {
  position: fixed; left: -9999px; top: 8px; z-index: 999;
  padding: 8px 14px; background: var(--accent); color: var(--accent-ink); border-radius: 6px;
}
.skip-link:focus { left: 12px; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.ico {
  width: 15px; height: 15px; flex: 0 0 auto;
  fill: none; stroke: currentColor; stroke-width: 1.8;
  stroke-linecap: round; stroke-linejoin: round;
}
.ico-fill { width: 13px; height: 13px; flex: 0 0 auto; fill: currentColor; }
.flex-1 { flex: 1 1 0; }

/* ---------- Buttons ---------- */
.btn-atelier {
  display: inline-flex; align-items: center; justify-content: center; gap: 7px;
  height: 38px; padding: 0 16px;
  border-radius: 7px;
  font-size: 13px; font-weight: 600; white-space: nowrap;
  transition: transform 0.18s var(--ease), background-color 0.18s, border-color 0.18s, color 0.18s;
}
.btn-atelier:hover:not(:disabled) { transform: translateY(-1px); }
.btn-atelier:disabled { opacity: 0.38; pointer-events: none; }
.btn-sm { height: 32px; padding: 0 12px; font-size: 12.5px; }

.btn-atelier-light { background: var(--light-btn-bg); color: var(--light-btn-ink); }
.btn-atelier-accent { background: var(--accent); color: var(--accent-ink); }
.btn-atelier-accent:hover { background: var(--accent-hover); }
.btn-atelier-glass {
  background: var(--glass-bg); color: var(--text);
  border: 1px solid var(--border-strong);
  backdrop-filter: blur(12px);
}
.btn-atelier-glass:hover { background: var(--glass-hover); }
.btn-atelier-outline {
  background: var(--surface); color: var(--text);
  border: 1px solid var(--border-strong);
}
.btn-atelier-outline:hover { background: var(--surface-2); }
.btn-atelier-outline[aria-pressed="true"] {
  border-color: var(--accent); background: var(--accent-soft);
}
.btn-atelier-outline[aria-pressed="true"] .ico { stroke: var(--accent); }

/* ==========================================================================
   MASTER 2-ZONE SPATIAL ARCHITECTURE (Left Fixed Rail + Right Gallery Canvas)
   ========================================================================== */
.atelier-shell {
  display: grid;
  grid-template-columns: var(--rail-w) minmax(0, 1fr);
  min-height: 100vh;
}

/* ---------- LEFT CURATORIAL RAIL ---------- */
.curator-rail {
  position: sticky; top: 0; height: 100vh;
  background: var(--rail-bg);
  border-right: 1px solid var(--border);
  display: flex; flex-direction: column;
  z-index: 45;
  min-width: 0;
}
.rail-scroll {
  flex: 1 1 auto;
  overflow-y: auto;
  padding: 15px 15px 12px;
  display: flex; flex-direction: column; gap: 13px;
  scrollbar-width: thin;
  scrollbar-color: var(--border-strong) transparent;
}

/* Brand Lockup with Architectural Seal */
.rail-brand {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
}
.brand-lockup { display: inline-flex; align-items: center; gap: 11px; }
.brand-seal {
  width: 34px; height: 34px;
  border-radius: 6px;
  background: var(--accent);
  color: var(--accent-ink);
  font-family: var(--font-serif);
  font-size: 18px; font-weight: 700;
  display: grid; place-items: center;
  box-shadow: 0 4px 14px rgba(230, 90, 61, 0.3);
  flex: 0 0 auto;
}
.brand-titles { display: flex; flex-direction: column; line-height: 1.15; }
.brand-titles strong {
  font-family: var(--font-serif);
  font-size: 16px; font-weight: 700; letter-spacing: 0.04em;
}
.brand-titles small {
  font-family: var(--font-mono);
  font-size: 9.5px; letter-spacing: 0.14em; color: var(--text-3);
  margin-top: 2px;
}
.rail-close-mobile {
  display: none; width: 30px; height: 30px; border-radius: 6px;
  border: 1px solid var(--border); font-size: 18px; color: var(--text-2);
}

/* Command Palette Trigger inside Rail */
.cmd-trigger {
  width: 100%; height: 36px; padding: 0 10px;
  border-radius: 7px;
  border: 1px solid var(--border-strong);
  background: var(--surface);
  color: var(--text-3);
  display: flex; align-items: center; gap: 8px;
  font-size: 12px; text-align: left;
  transition: border-color 0.16s, color 0.16s;
}
.cmd-trigger:hover { border-color: var(--accent); color: var(--text); }
.cmd-trigger span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-trigger kbd {
  font-family: var(--font-mono); font-size: 10.5px;
  padding: 1px 5px; border-radius: 4px;
  border: 1px solid var(--border); color: var(--text-3);
}

/* Rail Sections */
.rail-section { display: flex; flex-direction: column; gap: 8px; }
.rail-label-row { display: flex; align-items: center; justify-content: space-between; }
.rail-label {
  font-family: var(--font-mono);
  font-size: 10px; font-weight: 600;
  letter-spacing: 0.12em; color: var(--text-3);
}
.rail-reset-link { font-size: 11px; color: var(--accent); font-weight: 600; }
.rail-reset-link:hover { text-decoration: underline; }

/* Sculptural Dual-Channel Mode Cards */
.mode-cards { display: grid; gap: 7px; }
.mode-card {
  position: relative;
  text-align: left;
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: var(--surface);
  transition: all 0.2s var(--ease);
}
.mode-card:hover { border-color: var(--border-strong); }
.mode-card[aria-selected="true"] {
  border-color: var(--accent);
  background: linear-gradient(135deg, var(--accent-soft), var(--surface));
}
.mode-card[aria-selected="true"]::before {
  content: ''; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px;
  border-radius: 0 3px 3px 0; background: var(--accent);
}
.mode-card-top { display: flex; align-items: center; gap: 7px; }
.mode-num { font-family: var(--font-mono); font-size: 10.5px; color: var(--gold); font-weight: 700; }
.mode-name { font-family: var(--font-serif); font-size: 14.5px; font-weight: 700; }
.mode-badge {
  margin-left: auto;
  font-family: var(--font-mono); font-size: 11px; font-weight: 600;
  padding: 1px 6px; border-radius: 999px;
  background: var(--surface-2); color: var(--text-2);
}
.mode-card[aria-selected="true"] .mode-badge { background: var(--accent); color: var(--accent-ink); }
.mode-sub { margin: 3px 0 0 21px; font-size: 11px; color: var(--text-2); }

/* Vertical Scannable Taxonomy List */
.tax-list { display: flex; flex-direction: column; gap: 2px; }
.tax-item {
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: 4.5px 9px;
  border-radius: 6px;
  font-size: 12.5px; color: var(--text-2);
  text-align: left;
  transition: all 0.15s;
}
.tax-item:hover { background: var(--surface-2); color: var(--text); }
.tax-item[aria-pressed="true"] {
  background: var(--surface-2); color: var(--text); font-weight: 600;
  box-shadow: inset 2px 0 0 var(--accent);
}
.tax-item-count { font-family: var(--font-mono); font-size: 11px; color: var(--text-3); }
.tax-item[aria-pressed="true"] .tax-item-count { color: var(--accent); }

/* Secondary Taxonomy: Motion Mechanics Tags OR Physical Aspect Ratio Diagrams */
.kinetics-wrap { display: flex; flex-wrap: wrap; gap: 5px; }
.kin-chip {
  padding: 4px 9px; border-radius: 5px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 11.5px; color: var(--text-2);
  transition: all 0.15s;
}
.kin-chip:hover { border-color: var(--border-strong); color: var(--text); }
.kin-chip[aria-pressed="true"] {
  border-color: var(--accent); background: var(--accent-soft); color: var(--text); font-weight: 600;
}

/* Physical Canvas Aspect Ratio Mini-Diagrams (Layout Cases) */
.aspect-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 5px; }
.aspect-btn {
  display: flex; align-items: center; gap: 7px;
  padding: 6px 8px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 11.5px; color: var(--text-2); text-align: left;
  transition: all 0.15s; min-width: 0;
}
.aspect-btn:hover { border-color: var(--border-strong); color: var(--text); }
.aspect-btn[aria-pressed="true"] {
  border-color: var(--accent); background: var(--accent-soft); color: var(--text); font-weight: 600;
}
.aspect-icon-slot {
  width: 20px; height: 15px; display: grid; place-items: center; flex: 0 0 auto;
}
.aspect-glyph {
  border: 1.5px solid currentColor; border-radius: 1.5px; opacity: 0.78;
}
.aspect-btn[aria-pressed="true"] .aspect-glyph { border-color: var(--accent); opacity: 1; }
.ag-16-9 { width: 17px; height: 10px; }
.ag-4-3  { width: 14px; height: 11px; }
.ag-a4   { width: 10px; height: 14px; }
.ag-wide { width: 19px; height: 6px; }
.ag-sq   { width: 12px; height: 12px; }
.ag-vert { width: 10px; height: 13px; }
.aspect-btn span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; flex: 1; }
.aspect-btn small { font-family: var(--font-mono); font-size: 10px; opacity: 0.65; }

/* Slot Capacity Matrix & Fresh Toggle */
.slot-matrix { display: flex; flex-wrap: wrap; gap: 5px; }
.slot-chip {
  padding: 3px 8px; border-radius: 5px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 11.5px; color: var(--text-2);
}
.slot-chip[aria-pressed="true"] {
  background: var(--light-btn-bg); color: var(--light-btn-ink); border-color: var(--light-btn-bg); font-weight: 600;
}
.fresh-switch {
  display: flex; align-items: center; gap: 8px;
  padding: 7px 10px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 12px; color: var(--text-2);
  transition: all 0.15s;
}
.fresh-switch[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--text); font-weight: 600; }
.fresh-indicator { width: 7px; height: 7px; border-radius: 50%; background: var(--text-3); }
.fresh-switch[aria-pressed="true"] .fresh-indicator { background: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft); }
.fresh-switch small { margin-left: auto; font-family: var(--font-mono); font-size: 11px; opacity: 0.7; }

/* Workspace inside Rail (Favorites + Live Compare Box) */
.rail-workspace { padding-top: 10px; border-top: 1px solid var(--border); }
.ws-row {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 10px; border-radius: 7px;
  border: 1px solid var(--border); background: var(--surface);
  font-size: 12.5px; color: var(--text-2);
  transition: all 0.16s;
}
.ws-row:hover { border-color: var(--border-strong); color: var(--text); }
.ws-row[aria-pressed="true"] { border-color: var(--accent); background: var(--accent-soft); color: var(--text); font-weight: 600; }
.ws-row[aria-pressed="true"] .ico { fill: var(--accent); stroke: var(--accent); }
.ws-count { margin-left: auto; font-family: var(--font-mono); font-size: 11.5px; }

.rail-compare-box {
  padding: 10px; border-radius: 8px;
  border: 1px solid var(--border); background: var(--surface);
  display: flex; flex-direction: column; gap: 8px;
}
.rc-head { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; }
.rc-title { font-weight: 600; color: var(--text); }
.rc-num { font-family: var(--font-mono); color: var(--gold); font-weight: 600; }
.rc-slots { display: grid; gap: 5px; }
.rc-slot {
  display: flex; align-items: center; gap: 7px;
  padding: 4px 6px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--border);
  font-size: 11.5px; min-height: 30px;
}
.rc-slot.is-empty {
  border-style: dashed; color: var(--text-3); justify-content: center; font-size: 11px;
}
.rc-slot img { width: 36px; height: 21px; object-fit: cover; border-radius: 2px; flex: 0 0 auto; }
.rc-slot span { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.rc-rm { color: var(--text-3); padding: 0 4px; font-size: 14px; }
.rc-rm:hover { color: var(--accent); }
.rc-go { height: 32px; font-size: 12px; width: 100%; }

/* Rail Footer */
.rail-foot {
  padding: 12px 16px 14px;
  border-top: 1px solid var(--border);
  display: flex; flex-direction: column; gap: 9px;
}
.surface-toggle {
  display: grid; grid-template-columns: 1fr 1fr; gap: 3px;
  padding: 3px; border-radius: 7px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.sf-btn {
  padding: 5px 8px; border-radius: 5px;
  font-size: 11.5px; font-weight: 500; color: var(--text-2);
  transition: all 0.16s;
}
.sf-btn[aria-pressed="true"] {
  background: var(--light-btn-bg); color: var(--light-btn-ink); font-weight: 600;
}
.rail-credits {
  display: flex; align-items: center; justify-content: center; gap: 8px;
  font-size: 11px; color: var(--text-3);
}
.rail-credits a:hover { color: var(--text); }

/* ==========================================================================
   RIGHT EXHIBITION CANVAS
   ========================================================================== */
.exhibition-main { min-width: 0; display: flex; flex-direction: column; }
.mobile-bar { display: none; }

/* ---------- LIVING CINEMA & 3-SLIDE EDITORIAL SHOWCASE ---------- */
.showcase-stage {
  position: relative;
  overflow: hidden;
  padding: 34px 40px 30px;
  border-bottom: 1px solid var(--border);
}
.showcase-ambient {
  position: absolute; inset: -30px; z-index: 0; pointer-events: none; overflow: hidden;
}
.showcase-ambient img {
  width: 100%; height: 100%; object-fit: cover;
  filter: blur(64px) saturate(145%);
  opacity: var(--ambient-opacity);
  transform: scale(1.15);
  transition: opacity 0.4s ease;
}
.showcase-ambient::after {
  content: ''; position: absolute; inset: 0;
  background: var(--showcase-fade);
}

.showcase-grid {
  position: relative; z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(380px, 1.05fr);
  gap: 38px;
  align-items: center;
  max-width: 1320px;
}

.showcase-copy { display: flex; flex-direction: column; gap: 14px; min-width: 0; }
.sc-kicker {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  font-family: var(--font-mono); font-size: 11px; letter-spacing: 0.1em;
}
.sc-tag { color: var(--gold); font-weight: 700; }
.sc-dot { width: 4px; height: 4px; border-radius: 50%; background: var(--accent); }
.sc-subtag { color: var(--text-2); letter-spacing: 0.04em; }

.sc-title {
  margin: 0;
  font-family: var(--font-serif);
  font-size: clamp(30px, 3.3vw, 46px);
  font-weight: 700; line-height: 1.12; letter-spacing: 0.01em;
}
.sc-desc {
  margin: 0;
  font-size: 14px; color: var(--text-2); line-height: 1.65;
  max-width: 56ch;
}
.sc-cta-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin-top: 2px; }

/* Minimal Reel Switcher inside Showcase */
.sc-reel-bar {
  display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px;
  margin-top: 6px; padding-top: 12px;
  border-top: 1px solid var(--border);
  max-width: 460px;
}
.reel-tab {
  display: inline-flex; align-items: center; gap: 7px;
  padding: 5px 9px; border-radius: 6px;
  border: 1px solid transparent;
  color: var(--text-3); font-size: 12px; min-width: 0;
  transition: all 0.18s;
}
.reel-tab span:last-child { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.reel-tab:hover { color: var(--text); background: var(--glass-bg); }
.reel-tab[aria-pressed="true"] {
  color: var(--text); font-weight: 600;
  background: var(--glass-bg); border-color: var(--border-strong);
}
.reel-tab-num { font-family: var(--font-mono); font-size: 10.5px; color: var(--gold); }

/* Right Visual Viewport: Live Cinema Frame */
.showcase-viewport { min-width: 0; }
.sc-cinema-frame {
  position: relative;
  width: 100%; aspect-ratio: 16 / 9;
  border-radius: 10px;
  overflow: hidden;
  background: #040507;
  border: 1px solid var(--border-strong);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
}
.sc-cinema-frame video,
.sc-cinema-frame img {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
}
.sc-cinema-frame video { z-index: 2; opacity: 0; transition: opacity 0.45s ease; }
.sc-cinema-frame video.is-playing { opacity: 1; }
.sc-cinema-frame img { z-index: 1; }

.sc-expand-hint {
  position: absolute; right: 14px; bottom: 14px; z-index: 4;
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 13px; border-radius: 999px;
  background: rgba(9, 10, 14, 0.78); color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  font-size: 12px; font-weight: 600;
  transition: all 0.18s;
}
.sc-expand-hint:hover { background: var(--accent); border-color: var(--accent); transform: scale(1.03); }

/* Cases Mode: 3-Slide Architectural Fanned Spread Stage */
.sc-spread-stage { width: 100%; aspect-ratio: 16 / 9; position: relative; }
.spread-click {
  position: relative; width: 100%; height: 100%; display: block;
}
.spread-sheet {
  margin: 0; position: absolute;
  border-radius: 6px; overflow: hidden;
  background: #14161B;
  border: 1px solid rgba(255, 255, 255, 0.14);
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.42);
  transition: transform 0.45s var(--ease), box-shadow 0.45s var(--ease);
}
.spread-sheet img { width: 100%; height: 100%; object-fit: contain; background: #14161B; }
.sheet-front {
  width: 78%; aspect-ratio: 16 / 9;
  left: 11%; top: 9%; z-index: 3;
}
.sheet-back-left {
  width: 64%; aspect-ratio: 16 / 9;
  left: 0; top: 18%; z-index: 1;
  transform: rotate(-4.8deg); opacity: 0.78;
}
.sheet-back-right {
  width: 64%; aspect-ratio: 16 / 9;
  right: 0; top: 16%; z-index: 2;
  transform: rotate(4.2deg); opacity: 0.84;
}
.spread-click:hover .sheet-front { transform: translateY(-4px) scale(1.015); }
.spread-click:hover .sheet-back-left { transform: translateX(-12px) rotate(-6.8deg); opacity: 0.92; }
.spread-click:hover .sheet-back-right { transform: translateX(12px) rotate(6.4deg); opacity: 0.95; }

.spread-pill {
  position: absolute; left: 50%; bottom: 4px; transform: translateX(-50%); z-index: 5;
  padding: 6px 14px; border-radius: 999px;
  background: rgba(9, 10, 14, 0.84); color: #F5F1E9;
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  font-size: 12px; font-weight: 500; white-space: nowrap;
}

/* ---------- GALLERY CONTROL RIBBON ---------- */
.gallery-bar {
  position: sticky; top: 0; z-index: 30;
  padding: 14px 40px;
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid var(--border);
}
.gb-left { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; min-width: 0; }
.gb-heading {
  margin: 0; font-family: var(--font-serif);
  font-size: 19px; font-weight: 700;
}
.gb-count {
  font-family: var(--font-mono); font-size: 12px; font-weight: 700;
  color: var(--gold);
}
.gb-active-chips { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.active-chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 2px 9px; border-radius: 999px;
  background: var(--accent-soft); border: 1px solid var(--accent);
  color: var(--text); font-size: 11.5px; font-weight: 500;
}
.active-chip button { font-size: 13px; color: var(--accent); margin-left: 2px; }

.gb-right { display: flex; align-items: center; gap: 10px; flex: 0 0 auto; }
.gb-tip { font-size: 11.5px; color: var(--text-3); }

.density-switch {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px; border-radius: 7px;
  background: var(--surface); border: 1px solid var(--border);
}
.den-btn {
  width: 26px; height: 24px; border-radius: 4px;
  display: grid; place-items: center; color: var(--text-3);
  transition: all 0.14s;
}
.den-btn svg { width: 14px; height: 14px; }
.den-btn:hover { color: var(--text); }
.den-btn[aria-pressed="true"] { background: var(--light-btn-bg); color: var(--light-btn-ink); }

.gb-sort select {
  height: 32px; padding: 0 10px;
  border-radius: 7px; border: 1px solid var(--border);
  background: var(--surface); color: var(--text); font-size: 12px; cursor: pointer;
}
[data-surface="darkroom"] select option { background: #14161D; color: #F5F1E9; }

/* Cross-Channel Instant Discovery Strip */
.cross-strip {
  margin: 14px 40px 0;
  padding: 10px 16px; border-radius: 8px;
  border: 1px solid var(--accent); background: var(--accent-soft);
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
}
.cross-strip-badge {
  padding: 2px 8px; border-radius: 4px;
  background: var(--accent); color: var(--accent-ink);
  font-size: 11px; font-weight: 700;
}
.cross-strip-msg { font-size: 12.5px; }
.cross-strip-btns { margin-left: auto; display: flex; align-items: center; gap: 7px; flex-wrap: wrap; }
.cs-chip {
  padding: 4px 10px; border-radius: 5px;
  background: var(--surface); border: 1px solid var(--border-strong);
  font-size: 12px; transition: all 0.15s;
}
.cs-chip:hover { border-color: var(--accent); color: var(--accent); }

/* ==========================================================================
   BORDERLESS EXHIBITION GALLERY GRID (Artwork-First!)
   ========================================================================== */
.gallery-wrap { padding: 26px 40px 56px; flex: 1 1 auto; display: flex; flex-direction: column; }

.exhibit-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 30px 24px;
}
[data-density="2"] .exhibit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 36px 28px; }
[data-density="4"] .exhibit-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 24px 18px; }

.exhibit {
  display: flex; flex-direction: column; gap: 10px; min-width: 0;
}

/* Pure Visual Media Plinth */
.ex-stage {
  position: relative;
  border-radius: 8px;
  overflow: hidden;
  background: var(--plinth);
  aspect-ratio: 16 / 9;
  transition: transform 0.28s var(--ease), box-shadow 0.28s var(--ease);
}
.exhibit:hover .ex-stage {
  transform: translateY(-3px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.34);
}
[data-surface="paper"] .exhibit:hover .ex-stage {
  box-shadow: 0 16px 34px rgba(24, 22, 19, 0.14);
}

.ex-open-btn {
  position: relative; display: flex; align-items: center; justify-content: center;
  width: 100%; height: 100%; padding: 0; overflow: hidden;
}
.ex-open-btn img,
.ex-open-btn video {
  position: absolute; inset: 0;
  width: 100%; height: 100%; object-fit: cover;
  transition: transform 0.55s var(--ease), opacity 0.24s ease;
}
.exhibit:hover .ex-open-btn img.is-bleed { transform: scale(1.028); }

/* Non-16:9 Special Physical Formats Floating Cleanly on Gallery Plinth (ZERO CROP!) */
.ex-open-btn.is-plinth { padding: 12px; }
.ex-open-btn.is-plinth img {
  position: relative; inset: auto;
  max-width: 100%; max-height: 100%;
  width: auto; height: auto;
  object-fit: contain;
  border-radius: 2px;
  box-shadow: 0 10px 28px rgba(0, 0, 0, 0.28);
}
.ex-open-btn.is-plinth.is-banner img { width: 100%; height: auto; }
.ex-open-btn.is-widescreen img { object-fit: contain; }

/* Whisper-Minimal Timecode / Aspect Micro-Label */
.ex-corner-pill {
  position: absolute; right: 10px; bottom: 10px; z-index: 3;
  padding: 2px 7px; border-radius: 4px;
  background: rgba(8, 9, 12, 0.72); color: #F5F1E9;
  font-family: var(--font-mono); font-size: 10.5px;
  backdrop-filter: blur(6px);
  pointer-events: none;
}

/* Hover Floating Glass Action Bar (Zero Resting Clutter!) */
.ex-hover-bar {
  position: absolute; right: 10px; top: 10px; z-index: 4;
  display: flex; align-items: center; gap: 5px;
  opacity: 0; transform: translateY(-4px);
  transition: opacity 0.18s ease, transform 0.18s var(--ease);
}
.exhibit:hover .ex-hover-bar,
.exhibit:focus-within .ex-hover-bar,
.ex-hover-bar.has-active { opacity: 1; transform: translateY(0); }

.ex-fab {
  height: 28px; padding: 0 9px; border-radius: 6px;
  display: inline-flex; align-items: center; gap: 4px;
  background: rgba(10, 11, 15, 0.8); color: #F5F1E9;
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(10px);
  font-size: 11px; font-weight: 500;
  transition: all 0.15s;
}
.ex-fab:hover { background: #F5F1E9; color: #090A0D; }
.ex-fab[aria-pressed="true"] { background: var(--accent); color: #FFF; border-color: var(--accent); }
.ex-fab .ico { width: 13px; height: 13px; }

/* SIGNATURE INTERACTION: Hover-Scrub Page Flipper Bar for Layout Cases */
.scrub-rail {
  position: absolute; left: 10px; right: 10px; bottom: 8px; z-index: 4;
  display: flex; gap: 4px;
  opacity: 0; pointer-events: none;
  transition: opacity 0.18s ease;
}
.exhibit:hover .scrub-rail { opacity: 1; }
.scrub-seg {
  flex: 1; height: 3px; border-radius: 2px;
  background: rgba(255, 255, 255, 0.28);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.5);
  transition: background-color 0.12s;
}
.scrub-seg.is-on { background: var(--accent); }
.scrub-page-pill {
  position: absolute; left: 10px; bottom: 16px; z-index: 4;
  padding: 2px 7px; border-radius: 4px;
  background: rgba(8, 9, 12, 0.82); color: #F5F1E9;
  font-family: var(--font-mono); font-size: 10.5px;
  opacity: 0; pointer-events: none; transition: opacity 0.16s;
}
.exhibit.is-scrubbing .scrub-page-pill { opacity: 1; }

/* Pure Editorial Gallery Caption Underneath */
.ex-caption {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 10px;
  padding: 0 2px;
}
.ex-cap-left { display: flex; flex-direction: column; gap: 2px; min-width: 0; }
.ex-title-line { display: flex; align-items: baseline; gap: 8px; flex-wrap: wrap; }
.ex-code { font-family: var(--font-mono); font-size: 11px; font-weight: 700; color: var(--gold); }
.ex-name {
  font-family: var(--font-serif); font-size: 15.5px; font-weight: 700;
  color: var(--text); text-align: left;
  transition: color 0.15s;
}
.exhibit:hover .ex-name { color: var(--accent); }
.ex-fresh-pill {
  font-family: var(--font-sans); font-size: 10px; font-weight: 600;
  padding: 1px 6px; border-radius: 4px;
  background: var(--accent-soft); color: var(--accent);
}
.ex-subline {
  font-size: 11.5px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ex-cap-right {
  display: inline-flex; align-items: center; gap: 4px; flex: 0 0 auto; margin-top: 2px;
}
.ex-motion-dot {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 10.5px; color: var(--text-2);
  padding: 2px 6px; border-radius: 4px; background: var(--surface); border: 1px solid var(--border);
}
.ex-motion-dot::before { content: ''; width: 5px; height: 5px; border-radius: 50%; background: #10B981; }
.ex-touch-btn {
  display: none; width: 28px; height: 28px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface); color: var(--text-2);
  place-items: center;
}
.ex-touch-btn[aria-pressed="true"] { border-color: var(--accent); color: var(--accent); background: var(--accent-soft); }

/* Empty & Footer */
.empty-canvas {
  margin: 48px auto; text-align: center; max-width: 440px;
}
.empty-glyph { font-size: 36px; color: var(--text-3); margin-bottom: 10px; }
.empty-canvas h3 { margin: 0 0 8px; font-family: var(--font-serif); font-size: 20px; }
.empty-canvas p { margin: 0 0 20px; color: var(--text-2); }
.empty-btns { display: flex; justify-content: center; gap: 10px; flex-wrap: wrap; }

.canvas-footer {
  margin-top: auto; padding-top: 44px;
  border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 16px; flex-wrap: wrap;
  font-size: 12px; color: var(--text-3);
}
.cf-links { display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.cf-links a:hover, .cf-links button:hover { color: var(--text); }

/* ==========================================================================
   MODAL 1: SPOTLIGHT COMMAND PALETTE
   ========================================================================== */
dialog.atelier-dialog {
  padding: 0; border: 0; background: transparent;
  max-width: none; max-height: none; color: var(--text); overflow: visible;
}
dialog.atelier-dialog::backdrop {
  background: var(--scrim);
  backdrop-filter: blur(10px);
}
dialog.dialog-cmd { width: min(680px, calc(100vw - 24px)); margin-top: 8vh; }
.cmd-box {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 14px; overflow: hidden;
  box-shadow: 0 32px 96px rgba(0, 0, 0, 0.65);
  display: flex; flex-direction: column; max-height: 76vh;
}
.cmd-input-row {
  display: flex; align-items: center; gap: 10px;
  padding: 14px 16px; border-bottom: 1px solid var(--border);
}
.cmd-input-row input {
  flex: 1; background: transparent; border: 0; outline: none;
  font-size: 15px; color: var(--text);
}
.cmd-input-row input::placeholder { color: var(--text-3); }
.cmd-clear-btn { font-size: 12px; color: var(--text-3); padding: 4px 8px; }
.cmd-esc-btn {
  font-family: var(--font-mono); font-size: 11px;
  padding: 3px 7px; border-radius: 5px;
  border: 1px solid var(--border); color: var(--text-3);
}

.cmd-quick-tags {
  display: flex; align-items: center; gap: 6px; flex-wrap: wrap;
  padding: 10px 16px; border-bottom: 1px solid var(--border);
  font-size: 11.5px; color: var(--text-3);
}
.cmd-quick-tags button {
  padding: 3px 9px; border-radius: 999px;
  background: var(--surface-2); border: 1px solid var(--border);
  color: var(--text-2); font-size: 11.5px;
}
.cmd-quick-tags button:hover { border-color: var(--accent); color: var(--text); }

.cmd-results { overflow-y: auto; padding: 10px 12px; display: flex; flex-direction: column; gap: 12px; }
.cmd-group-title {
  font-family: var(--font-mono); font-size: 10.5px; letter-spacing: 0.1em;
  color: var(--text-3); padding: 2px 6px 6px;
}
.cmd-item {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 7px 8px; border-radius: 8px; text-align: left;
  transition: background-color 0.12s;
}
.cmd-item:hover, .cmd-item.is-selected { background: var(--surface-2); }
.cmd-item.is-selected { box-shadow: inset 2px 0 0 var(--accent); }
.cmd-thumb {
  width: 64px; height: 36px; border-radius: 4px; overflow: hidden;
  background: var(--plinth); flex: 0 0 auto; display: grid; place-items: center;
}
.cmd-thumb img { width: 100%; height: 100%; object-fit: contain; }
.cmd-item-info { flex: 1; min-width: 0; }
.cmd-item-title { font-size: 13.5px; font-weight: 600; display: flex; align-items: center; gap: 7px; }
.cmd-item-code { font-family: var(--font-mono); font-size: 11px; color: var(--gold); }
.cmd-item-sub { font-size: 11.5px; color: var(--text-3); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.cmd-item-badge {
  font-size: 10.5px; padding: 2px 7px; border-radius: 4px;
  background: var(--surface-3); color: var(--text-2); white-space: nowrap;
}
.cmd-empty { padding: 28px; text-align: center; color: var(--text-3); }

.cmd-foot {
  padding: 10px 16px; border-top: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  font-size: 11.5px; color: var(--text-3); background: var(--surface-2);
}
.cmd-foot kbd {
  font-family: var(--font-mono); font-size: 10px;
  padding: 1px 4px; border-radius: 3px; border: 1px solid var(--border-strong);
  margin: 0 2px;
}
.cmd-apply-filter { color: var(--accent); font-weight: 600; font-size: 12px; }

/* ==========================================================================
   MODAL 2: EDGE-TO-EDGE IMMERSIVE SCREENING THEATER
   ========================================================================== */
dialog.dialog-theater { width: min(1420px, calc(100vw - 28px)); }
.theater-shell {
  height: min(900px, calc(100vh - 28px));
  background: var(--surface);
  border: 1px solid var(--border-strong);
  border-radius: 12px;
  overflow: hidden;
  display: flex; flex-direction: column;
  box-shadow: 0 36px 110px rgba(0, 0, 0, 0.72);
}

.th-topbar {
  padding: 10px 16px;
  border-bottom: 1px solid var(--border);
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  flex: 0 0 auto; background: var(--surface);
}
.th-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.th-code-pill {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  padding: 3px 8px; border-radius: 5px;
  background: var(--surface-2); border: 1px solid var(--border-strong); color: var(--gold);
  white-space: nowrap;
}
.th-breadcrumb { font-size: 12.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.th-mode-seg {
  display: inline-flex; align-items: center; gap: 2px;
  padding: 3px; border-radius: 8px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.th-seg-btn {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 12px; border-radius: 6px;
  font-size: 12.5px; font-weight: 500; color: var(--text-2);
  transition: all 0.16s;
}
.th-seg-btn:hover { color: var(--text); }
.th-seg-btn[aria-pressed="true"] { background: var(--light-btn-bg); color: var(--light-btn-ink); font-weight: 600; }
.th-seg-btn small { font-family: var(--font-mono); font-size: 10.5px; opacity: 0.78; }

.th-right { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.th-pos { font-family: var(--font-mono); font-size: 11.5px; color: var(--text-3); padding: 0 4px; }
.th-icon-btn {
  width: 32px; height: 32px; border-radius: 6px;
  border: 1px solid var(--border); background: var(--surface-2); color: var(--text-2);
  display: inline-grid; place-items: center;
  transition: all 0.15s;
}
.th-icon-btn:hover:not(:disabled) { color: var(--text); border-color: var(--border-strong); }
.th-icon-btn:disabled { opacity: 0.3; cursor: not-allowed; }
.th-icon-btn[aria-pressed="false"] { opacity: 0.6; }

/* Theater Body */
.th-body {
  flex: 1 1 auto; min-height: 0;
  display: grid; grid-template-columns: minmax(0, 1fr) 368px;
  transition: grid-template-columns 0.25s var(--ease);
}
.th-body.inspector-hidden { grid-template-columns: minmax(0, 1fr) 0px; }
.th-body.inspector-hidden .th-inspector { display: none; }

.th-stage {
  background: var(--stage);
  display: flex; flex-direction: column;
  min-width: 0; min-height: 0;
  border-right: 1px solid var(--border);
}
.th-pane { flex: 1 1 auto; min-height: 0; display: flex; flex-direction: column; }

.th-media-well {
  position: relative; flex: 1 1 auto; min-height: 0;
  display: grid; place-items: center; padding: 14px;
  background: #040507;
}
.th-media-well video { max-width: 100%; max-height: 100%; width: 100%; height: 100%; object-fit: contain; }

.th-slide-well {
  position: relative; flex: 1 1 auto; min-height: 0;
  display: flex; align-items: center; justify-content: center;
  padding: 18px 58px;
  background: #07080B;
}
.well-frame {
  width: 100%; height: 100%;
  display: flex; align-items: center; justify-content: center; position: relative;
}
.well-frame img {
  max-width: 100%; max-height: 100%; width: auto; height: auto;
  object-fit: contain; border-radius: 3px;
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.65);
}
.well-arrow {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(255, 255, 255, 0.1); color: #FFF;
  border: 1px solid rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px); z-index: 4;
}
.well-arrow:hover:not(:disabled) { background: rgba(255, 255, 255, 0.22); }
.well-arrow:disabled { opacity: 0.22; cursor: not-allowed; }
.well-prev { left: 12px; }
.well-next { right: 12px; }

.th-media-error {
  position: absolute; inset: 0;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 12px;
  background: rgba(7, 8, 11, 0.92); color: #EAE6DE;
}

.th-stage-footer {
  padding: 10px 16px;
  background: #0D0F14; color: #DDD9D0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  font-size: 12px;
}
.tsf-group { display: flex; align-items: center; gap: 10px; min-width: 0; flex-wrap: wrap; }
.tsf-slide-info { flex: 1 1 240px; flex-wrap: nowrap; }
.tsf-counter {
  font-family: var(--font-mono); font-size: 11.5px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px; background: rgba(255, 255, 255, 0.12); color: #FFF;
  white-space: nowrap;
}
.tsf-title { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #D4D0C7; }
.tsf-label { font-family: var(--font-mono); font-size: 11px; color: #8F8C85; }
.tsf-badge-live {
  font-size: 11px; font-weight: 600; padding: 2px 8px; border-radius: 4px;
  background: rgba(230, 90, 61, 0.22); color: #F5917A;
}
.tsf-pills { display: inline-flex; gap: 4px; }
.tsf-pill, .tsf-link {
  padding: 3px 9px; border-radius: 5px;
  border: 1px solid rgba(255, 255, 255, 0.16); background: rgba(255, 255, 255, 0.04);
  color: #E2DFD7; font-size: 11.5px; white-space: nowrap;
}
.tsf-pill:hover, .tsf-link:hover { background: rgba(255, 255, 255, 0.14); color: #FFF; }
.tsf-pill[aria-pressed="true"] { background: #F5F1E9; color: #090A0D; border-color: #F5F1E9; font-weight: 600; }

/* Interactive Filmstrip Rail */
.th-filmstrip-rail {
  padding: 10px 14px; background: #07080B;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}
.th-filmstrip {
  display: flex; align-items: center; gap: 8px;
  overflow-x: auto; padding-bottom: 2px;
  scrollbar-width: thin; scrollbar-color: rgba(255, 255, 255, 0.25) transparent;
}
.film-card {
  position: relative; flex: 0 0 auto;
  height: 54px; min-width: 54px; max-width: 112px;
  padding: 3px; border-radius: 5px;
  border: 2px solid transparent; background: #14161D;
  display: flex; align-items: center; justify-content: center;
  opacity: 0.6; transition: all 0.15s;
}
.film-card:hover { opacity: 0.92; border-color: rgba(255, 255, 255, 0.28); }
.film-card[aria-current="true"] { opacity: 1; border-color: var(--accent); }
.film-card img { max-width: 100%; max-height: 100%; object-fit: contain; }
.film-card span {
  position: absolute; left: 4px; bottom: 4px;
  font-family: var(--font-mono); font-size: 9.5px; font-weight: 700;
  padding: 0 4px; border-radius: 3px; background: rgba(0, 0, 0, 0.8); color: #FFF;
}

/* Contact Sheet (全景页览) */
.th-pane-sheet { overflow-y: auto; padding: 20px; background: #090A0E; }
.sheet-grid {
  display: grid; grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); gap: 16px;
}
.sheet-tile {
  display: flex; flex-direction: column; gap: 6px; text-align: left;
  padding: 8px; border-radius: 7px;
  background: #12141B; border: 1.5px solid rgba(255, 255, 255, 0.08);
  transition: all 0.16s;
}
.sheet-tile:hover { border-color: rgba(255, 255, 255, 0.3); transform: translateY(-2px); }
.sheet-tile[aria-current="true"] { border-color: var(--accent); }
.sheet-tile-img {
  width: 100%; aspect-ratio: 16 / 10; background: #08090C; border-radius: 4px;
  display: flex; align-items: center; justify-content: center; overflow: hidden; padding: 4px;
}
.sheet-tile-img img { max-width: 100%; max-height: 100%; object-fit: contain; }
.sheet-tile-cap {
  font-size: 11.5px; color: #CFCBC2;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sheet-tile-cap b { font-family: var(--font-mono); color: var(--gold); margin-right: 5px; }

/* Right Inspector Panel */
.th-inspector {
  padding: 20px;
  overflow-y: auto;
  display: flex; flex-direction: column; gap: 15px;
  background: var(--surface);
}
.insp-meta-line { display: flex; align-items: center; gap: 7px; font-size: 11.5px; color: var(--text-3); margin-bottom: 5px; }
.insp-code { font-family: var(--font-mono); font-weight: 700; color: var(--gold); }
.insp-fresh { padding: 1px 6px; border-radius: 4px; background: var(--accent-soft); color: var(--accent); font-weight: 600; font-size: 10.5px; }
.insp-title { margin: 0 0 7px; font-family: var(--font-serif); font-size: 22px; font-weight: 700; line-height: 1.25; }
.insp-desc { margin: 0; font-size: 13px; color: var(--text-2); line-height: 1.6; }

/* Unambiguous Edition Selector */
.insp-edition {
  padding: 12px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  display: flex; flex-direction: column; gap: 8px;
}
.ie-head { display: flex; align-items: baseline; justify-content: space-between; gap: 6px; }
.ie-head strong { font-size: 12.5px; }
.ie-head span { font-size: 10.5px; color: var(--text-3); }
.ie-cards { display: grid; gap: 6px; }
.ie-card {
  text-align: left; padding: 9px 10px; border-radius: 7px;
  border: 1.5px solid var(--border); background: var(--surface);
  transition: all 0.15s;
}
.ie-card:hover:not(:disabled) { border-color: var(--border-strong); }
.ie-card[aria-checked="true"] { border-color: var(--accent); background: var(--accent-soft); }
.ie-card:disabled { opacity: 0.4; cursor: not-allowed; }
.ie-top { display: flex; align-items: center; gap: 7px; margin-bottom: 2px; }
.ie-top strong { font-size: 12.5px; }
.ie-dot { width: 13px; height: 13px; border-radius: 50%; border: 1.5px solid var(--text-3); position: relative; flex: 0 0 auto; }
.ie-card[aria-checked="true"] .ie-dot { border-color: var(--accent); }
.ie-card[aria-checked="true"] .ie-dot::after { content: ''; position: absolute; inset: 3px; border-radius: 50%; background: var(--accent); }
.ie-default { margin-left: auto; font-size: 10px; font-weight: 700; padding: 1px 6px; border-radius: 999px; background: var(--accent); color: var(--accent-ink); }
.ie-card p { margin: 0; font-size: 11px; color: var(--text-2); padding-left: 20px; line-height: 1.4; }

/* Skill Prompt Box */
.insp-prompt-box {
  padding: 12px; border-radius: 9px;
  background: var(--surface-2); border: 1px solid var(--border-strong);
  display: flex; flex-direction: column; gap: 9px;
}
.ipb-head { display: flex; align-items: center; justify-content: space-between; font-size: 11.5px; }
.ipb-head span { color: var(--text-2); font-weight: 600; }
.ipb-head strong { color: var(--accent); font-size: 11px; }
.ipb-code {
  margin: 0; padding: 9px 10px; border-radius: 6px;
  background: var(--surface); border: 1px solid var(--border);
  font-family: var(--font-mono); font-size: 11.5px; line-height: 1.55;
  overflow-wrap: anywhere; word-break: normal;
}
.ipb-copy { width: 100%; height: 40px; }
.ipb-manual { display: flex; flex-direction: column; gap: 5px; font-size: 11px; color: var(--accent); }
.ipb-manual textarea {
  width: 100%; padding: 7px; border-radius: 6px;
  border: 1px solid var(--accent); background: var(--surface); font-family: var(--font-mono); font-size: 11.5px;
}

.insp-actions { display: flex; gap: 8px; }

.insp-specs { margin: 0; display: grid; grid-template-columns: 1fr 1fr; gap: 7px; }
.insp-spec-cell {
  padding: 7px 9px; border-radius: 6px;
  background: var(--surface-2); border: 1px solid var(--border);
}
.insp-spec-cell dt { font-size: 10.5px; color: var(--text-3); margin-bottom: 1px; }
.insp-spec-cell dd { margin: 0; font-size: 12px; font-weight: 600; }
.insp-change {
  margin: 0; padding: 8px 10px; border-radius: 6px;
  background: var(--surface-2); border-left: 2px solid var(--accent);
  font-size: 11.5px; color: var(--text-2);
}
.insp-source { font-size: 11.5px; color: var(--text-3); }
.insp-source a { color: var(--text-2); text-decoration: underline; text-underline-offset: 3px; }
.insp-local-decks {
  padding: 10px 12px; border-radius: 8px;
  background: var(--surface-2); border: 1px dashed var(--border-strong);
  display: flex; flex-direction: column; gap: 7px;
}
.insp-local-head { font-size: 11px; color: var(--text-3); font-family: var(--font-mono); letter-spacing: 0.06em; }
.insp-local-links { display: flex; flex-wrap: wrap; gap: 6px; }
.insp-local-link {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 5px 10px; border-radius: 6px;
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: 11.5px; font-weight: 600; color: var(--text);
  transition: border-color 0.15s, color 0.15s;
}
.insp-local-link:hover { border-color: var(--accent); color: var(--accent); }

/* ==========================================================================
   MODAL 3: DUAL-SCREEN COMPARE WORKBENCH
   ========================================================================== */
dialog.dialog-compare { width: min(1200px, calc(100vw - 28px)); }
.cmp-shell {
  background: var(--surface); border: 1px solid var(--border-strong);
  border-radius: 12px; overflow: hidden;
  max-height: calc(100vh - 28px); display: flex; flex-direction: column;
  box-shadow: 0 36px 100px rgba(0, 0, 0, 0.72);
}
.cmp-heading { margin: 0; font-family: var(--font-serif); font-size: 16px; }
.cmp-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; background: var(--border); overflow-y: auto; }
.cmp-pane { background: var(--surface); padding: 16px 18px; display: flex; flex-direction: column; gap: 10px; }
.cmp-pane-top { display: flex; align-items: center; gap: 9px; }
.cmp-slot-tag {
  font-family: var(--font-mono); font-size: 11px; font-weight: 700;
  padding: 2px 7px; border-radius: 4px; background: var(--accent-soft); color: var(--accent);
}
.cmp-pane-top select {
  flex: 1; height: 34px; padding: 0 10px; border-radius: 6px;
  border: 1px solid var(--border-strong); background: var(--surface-2); font-size: 13px; font-weight: 600;
}
.cmp-video-well {
  aspect-ratio: 16 / 9; background: #040507; border-radius: 7px; overflow: hidden;
}
.cmp-video-well video { width: 100%; height: 100%; object-fit: contain; }
.cmp-tags { display: flex; gap: 6px; flex-wrap: wrap; }
.cmp-tag { font-size: 11px; padding: 2px 8px; border-radius: 4px; background: var(--surface-2); border: 1px solid var(--border); color: var(--text-2); }
.cmp-desc { margin: 0; font-size: 12.5px; color: var(--text-2); min-height: 36px; }
.cmp-pick-btn { width: 100%; }

/* Toast */
.atelier-toast {
  position: fixed; left: 50%; bottom: 26px; z-index: 99;
  transform: translate(-50%, 14px); opacity: 0; pointer-events: none;
  padding: 9px 18px; border-radius: 999px;
  background: #14161D; color: #F5F1E9;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 36px rgba(0, 0, 0, 0.44);
  font-size: 13px; font-weight: 500;
  transition: all 0.22s var(--ease);
}
.atelier-toast.shown { opacity: 1; transform: translate(-50%, 0); }

.mobile-compare-pill { display: none; }

/* ==========================================================================
   RESPONSIVE TABLET & MOBILE (<= 1024px & 390x844 Native App Experience)
   ========================================================================== */
@media (max-width: 1120px) {
  .showcase-stage { padding: 26px 26px 24px; }
  .gallery-bar { padding: 12px 26px; }
  .gallery-wrap { padding: 22px 26px 48px; }
  .exhibit-grid, [data-density="4"] .exhibit-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 960px) {
  .atelier-shell { grid-template-columns: 1fr; }
  .curator-rail {
    position: fixed; left: 0; top: 0; bottom: 0; width: min(310px, 86vw);
    transform: translateX(-105%); transition: transform 0.26s var(--ease);
    box-shadow: 24px 0 64px rgba(0, 0, 0, 0.55);
  }
  .curator-rail.is-open { transform: translateX(0); }
  .rail-close-mobile { display: grid; place-items: center; }
  .rail-scrim {
    position: fixed; inset: 0; z-index: 42;
    background: var(--scrim); backdrop-filter: blur(4px);
  }

  /* Native Mobile Sticky Top Bar */
  .mobile-bar {
    display: flex; flex-direction: column; gap: 8px;
    position: sticky; top: 0; z-index: 35;
    padding: 10px 14px 8px;
    background: color-mix(in srgb, var(--bg) 92%, transparent);
    backdrop-filter: blur(16px);
    border-bottom: 1px solid var(--border);
  }
  .mb-row-1 { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
  .mb-menu-btn, .mb-icon-btn {
    width: 34px; height: 34px; border-radius: 7px;
    border: 1px solid var(--border); background: var(--surface);
    display: grid; place-items: center; color: var(--text);
  }
  .mb-brand { display: inline-flex; align-items: center; gap: 7px; font-family: var(--font-serif); font-size: 16px; font-weight: 700; }
  .mb-brand strong {
    width: 24px; height: 24px; border-radius: 5px;
    background: var(--accent); color: var(--accent-ink);
    display: inline-grid; place-items: center; font-size: 13px;
  }
  .mb-actions { display: flex; gap: 6px; }

  .mb-row-2 { display: flex; align-items: center; gap: 8px; }
  .mb-ch-pill {
    flex: 1; display: grid; grid-template-columns: 1fr 1fr; gap: 3px;
    padding: 3px; border-radius: 8px; background: var(--surface-2); border: 1px solid var(--border);
  }
  .mb-ch-btn {
    padding: 6px 8px; border-radius: 6px; font-size: 12.5px; font-weight: 500; color: var(--text-2);
  }
  .mb-ch-btn[aria-selected="true"] { background: var(--light-btn-bg); color: var(--light-btn-ink); font-weight: 700; }
  .mb-ch-btn small { font-family: var(--font-mono); font-size: 10.5px; opacity: 0.72; margin-left: 3px; }
  .mb-filter-pill {
    height: 35px; padding: 0 12px; border-radius: 8px;
    border: 1px solid var(--border); background: var(--surface);
    font-size: 12.5px; font-weight: 500; display: inline-flex; align-items: center; gap: 5px;
  }
  .mb-filter-pill small {
    min-width: 17px; height: 17px; border-radius: 999px;
    background: var(--accent); color: var(--accent-ink);
    font-family: var(--font-mono); font-size: 10px; display: inline-grid; place-items: center;
  }

  .mb-chip-strip {
    display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px;
  }
  .mb-chip-strip::-webkit-scrollbar { display: none; }
  .mb-chip {
    flex: 0 0 auto; padding: 4px 10px; border-radius: 999px;
    border: 1px solid var(--border); background: var(--surface);
    font-size: 12px; color: var(--text-2);
  }
  .mb-chip[aria-pressed="true"] { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); font-weight: 600; }

  /* Compact Mobile Showcase so Real Gallery Cards Sit High Above the Fold! */
  .showcase-stage { padding: 14px 14px 12px; }
  .showcase-grid {
    grid-template-columns: 118px minmax(0, 1fr);
    gap: 12px; align-items: center;
  }
  .showcase-viewport { order: -1; }
  .sc-desc, .sc-reel-bar, #sc-copy-btn, .sc-expand-hint, .spread-pill, .sheet-back-left, .sheet-back-right { display: none !important; }
  .showcase-copy { gap: 5px; }
  .sc-kicker { font-size: 10px; gap: 5px; }
  .sc-subtag, .sc-dot { display: none; }
  .sc-title { font-size: 18px; }
  .sc-cta-row { margin-top: 2px; }
  .sc-cta-row .btn-atelier { height: 28px; padding: 0 10px; font-size: 11.5px; }
  .sheet-front { width: 100%; left: 0; top: 0; }
  .sc-spread-stage { aspect-ratio: 16 / 9; }

  .gallery-bar { position: static; padding: 10px 14px; }
  .gb-heading { font-size: 16px; }
  .gb-tip, .density-switch { display: none; }
  .gallery-wrap { padding: 12px 14px 80px; }
  .exhibit-grid, [data-density="2"] .exhibit-grid, [data-density="4"] .exhibit-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px 10px;
  }
  .ex-hover-bar, .scrub-rail, .ex-motion-dot { display: none !important; }
  .ex-touch-btn { display: inline-grid; }
  .ex-name { font-size: 13.5px; }
  .ex-subline { font-size: 10.5px; }
  .ex-open-btn.is-plinth { padding: 7px; }
  .cross-strip { margin: 10px 14px 0; padding: 9px 12px; }

  /* Mobile Floating Compare Pill */
  .mobile-compare-pill {
    position: fixed; left: 50%; bottom: 14px; transform: translateX(-50%); z-index: 38;
    display: inline-flex; align-items: center; gap: 10px;
    padding: 7px 12px; border-radius: 999px;
    background: #14161D; color: #F5F1E9;
    border: 1px solid rgba(230, 90, 61, 0.5);
    box-shadow: 0 12px 32px rgba(0, 0, 0, 0.5);
    font-size: 12px;
  }
  .mcp-go {
    padding: 4px 10px; border-radius: 999px; background: var(--accent); color: #FFF; font-weight: 600;
  }
  .mcp-go:disabled { opacity: 0.4; }
  .mcp-clear { font-size: 16px; color: #A6A39B; }

  /* Mobile Fullscreen Theater */
  dialog.dialog-theater, dialog.dialog-compare { width: calc(100vw - 10px); }
  .theater-shell { height: calc(100vh - 14px); }
  .th-topbar { flex-wrap: wrap; padding: 8px 10px; gap: 8px; }
  .th-mode-seg { order: 3; width: 100%; display: grid; grid-template-columns: repeat(3, 1fr); }
  .th-seg-btn { justify-content: center; padding: 6px 4px; font-size: 11.5px; }
  #th-toggle-inspector { display: none; }
  .th-body { display: flex !important; flex-direction: column; overflow-y: auto; }
  .th-stage { border-right: 0; border-bottom: 1px solid var(--border); flex: 0 0 auto; height: auto; }
  .th-pane { flex: 0 0 auto; }
  .th-media-well { min-height: 220px; padding: 8px; }
  .th-slide-well { height: 245px; min-height: 245px; flex: 0 0 auto; padding: 10px 38px; }
  .well-arrow { width: 30px; height: 30px; }
  .th-inspector { padding: 14px; overflow: visible; flex: 0 0 auto; }
  .insp-title { font-size: 19px; }
  .tsf-label { display: none; }
  .film-card { height: 44px; min-width: 44px; }
  .sheet-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .cmp-grid { grid-template-columns: 1fr; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    transition-duration: 0.01ms !important;
    animation-duration: 0.01ms !important;
    scroll-behavior: auto !important;
  }
}
