/* ==========================================================================
   STAGE-01 · DMX 舞台光影实验室 (v2)
   一屏沉浸式「上画幅 + 下精简精密控台条」
   UI 仅三色：黑 (#0A0A0A / #000)、白 (#FAF6EE)、蜂蜜金 (#E3A008)
   3px 黑框仅做最外层结构与控台分割，内部克制留白
   ========================================================================== */

:root {
  --st-black: #0a0a0a;
  --st-panel: #101010;
  --st-surface: #171717;
  --st-white: #faf6ee;
  --st-muted: rgba(250, 246, 238, 0.56);
  --st-faint: rgba(250, 246, 238, 0.13);
  --st-gold: #e3a008;
  --st-mono: "Space Mono", ui-monospace, SFMono-Regular, Menlo, monospace;
}

/* ---------- 首页 #projects 三格入口适配 ---------- */
.entry-grid.three {
  grid-template-columns: repeat(3, 1fr);
}
@media (max-width: 860px) {
  .entry-grid.three {
    grid-template-columns: 1fr;
  }
}
.entry-card.stage {
  background: var(--st-black);
  color: var(--st-white);
}
.entry-card.stage .k {
  background: var(--st-gold);
  color: #000;
}
.entry-card.stage h3 {
  color: var(--st-white);
}
.entry-card.stage p {
  color: rgba(250, 246, 238, 0.78);
}
.entry-card.stage .go {
  background: var(--st-white);
  color: #000;
}

/* ---------- 首页极简暗场追光预告入口 (#stage) ---------- */
.stage-teaser {
  position: relative;
  border: 3px solid #000;
  box-shadow: var(--shadow-lg);
  background: var(--st-black);
  color: var(--st-white);
  overflow: hidden;
  padding: 48px 44px;
  cursor: pointer;
  --spot-x: 68%;
  --spot-y: 44%;
}
.stage-teaser::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    420px circle at var(--spot-x) var(--spot-y),
    rgba(227, 160, 8, 0.22) 0%,
    rgba(227, 160, 8, 0.05) 42%,
    rgba(10, 10, 10, 0.92) 78%
  );
  pointer-events: none;
}
.stage-teaser-in {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 36px;
  align-items: center;
}
.stage-teaser-no {
  font-family: var(--st-mono);
  font-size: 12px;
  letter-spacing: 0.16em;
  color: var(--st-gold);
  margin-bottom: 14px;
}
.stage-teaser h3 {
  font-size: clamp(26px, 3.4vw, 38px);
  font-weight: 900;
  color: var(--st-white);
  line-height: 1.15;
  margin: 0 0 12px;
}
.stage-teaser p {
  color: var(--st-muted);
  font-size: 15px;
  line-height: 1.75;
  margin: 0 0 24px;
  max-width: 34em;
}
.stage-teaser-cta {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  background: var(--st-gold);
  color: #000;
  font-weight: 900;
  font-size: 15px;
  padding: 12px 22px;
  text-decoration: none;
  border: none;
  min-height: 46px;
  transition: transform 0.22s cubic-bezier(0.16, 1, 0.3, 1);
}
.stage-teaser-cta:hover {
  transform: translateY(-2px);
}
.stage-teaser-preview {
  position: relative;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #050505;
}
.stage-teaser-preview img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(0.76) contrast(1.06);
  transition: filter 0.6s cubic-bezier(0.16, 1, 0.3, 1), transform 0.8s cubic-bezier(0.16, 1, 0.3, 1);
}
.stage-teaser:hover .stage-teaser-preview img {
  filter: brightness(0.92) contrast(1.08);
  transform: scale(1.02);
}
.stage-teaser-preview::after {
  content: "MOVE CURSOR · FOLLOWSPOT";
  position: absolute;
  right: 12px;
  bottom: 10px;
  font-family: var(--st-mono);
  font-size: 10px;
  letter-spacing: 0.14em;
  color: rgba(250, 246, 238, 0.62);
}
@media (max-width: 820px) {
  .stage-teaser {
    padding: 32px 22px;
  }
  .stage-teaser-in {
    grid-template-columns: 1fr;
    gap: 22px;
  }
}

/* ---------- 独立详情页 #view-stage ---------- */
#view-stage {
  padding-bottom: 48px;
}
#view-stage .detail-top {
  padding: 10px 0 8px;
}

/* 舞台实验室主容器：清除全局 section padding，3px 黑框仅作外框 */
section.stage-shell {
  padding: 0;
  margin-top: 4px;
  border: 3px solid #000;
  box-shadow: var(--shadow-lg);
  background: var(--st-black);
  color: var(--st-white);
  overflow: hidden;
}

/* 顶部极简状态栏 */
.stage-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
  padding: 7px 24px;
  border-bottom: 1px solid var(--st-faint);
  flex-wrap: wrap;
}
.stage-id {
  display: flex;
  align-items: center;
  gap: 10px;
  font-family: var(--st-mono);
  font-size: 11px;
  letter-spacing: 0.14em;
  color: var(--st-muted);
}
.stage-dot {
  width: 7px;
  height: 7px;
  background: var(--st-gold);
  display: inline-block;
  transition: opacity 0.4s ease;
}
.stage-shell.is-blackout .stage-dot {
  opacity: 0.15;
}

/* 4 个 CUE 缩成一行小号数字 tab，单屏只亮 1 个 */
.stage-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
}
.stage-tab {
  appearance: none;
  background: transparent;
  color: var(--st-muted);
  border: 1px solid transparent;
  font-family: var(--st-mono);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.12em;
  padding: 6px 13px;
  min-height: 36px;
  cursor: pointer;
  transition: color 0.25s cubic-bezier(0.16, 1, 0.3, 1),
    background 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.stage-tab:hover {
  color: var(--st-white);
}
.stage-tab.is-active {
  color: #000;
  background: var(--st-gold);
  border-color: var(--st-gold);
}

.stage-tc {
  font-family: var(--st-mono);
  font-size: 11.5px;
  letter-spacing: 0.12em;
  color: var(--st-muted);
  font-variant-numeric: tabular-nums;
}

/* ---------- 舞台画幅区（居中 16:9，四周深暗黑场即负空间，一屏内可见） ---------- */
.stage-viewport-wrap {
  padding: 14px 36px 12px;
  background: #060606;
  display: flex;
  flex-direction: column;
  align-items: center;
}
.stage-viewport {
  position: relative;
  width: min(100%, 540px, calc(34vh * 16 / 9));
  aspect-ratio: 16 / 9;
  background: #030303;
  overflow: hidden;
  cursor: crosshair;
  touch-action: none;
  user-select: none;
}

/* 真实资产层：滞后光影浮现 */
.stage-media-layer {
  position: absolute;
  inset: 0;
  background: #030303;
  transition: opacity 0.68s cubic-bezier(0.16, 1, 0.3, 1);
  will-change: opacity, filter;
}
.stage-media-layer.is-fading {
  opacity: 0 !important;
  transition: opacity 0.42s cubic-bezier(0.4, 0, 0.2, 1);
}
.stage-media-layer img,
.stage-media-layer video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.stage-media-layer [hidden] {
  display: none !important;
}

/* 统一舞台光影与微尘 Canvas 层 */
.stage-light-canvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 3;
}

/* 极克制胶片微颗粒层 */
.stage-grain {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 4;
  opacity: 0.045;
  background-image: radial-gradient(rgba(250, 246, 238, 0.8) 0.5px, transparent 0.5px);
  background-size: 3px 3px;
  mix-blend-mode: overlay;
}

.stage-hud-hint {
  position: absolute;
  left: 14px;
  bottom: 11px;
  z-index: 5;
  font-family: var(--st-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: rgba(250, 246, 238, 0.44);
  pointer-events: none;
}
.stage-hud-mode {
  position: absolute;
  right: 14px;
  bottom: 11px;
  z-index: 5;
  font-family: var(--st-mono);
  font-size: 9.5px;
  letter-spacing: 0.14em;
  color: var(--st-gold);
  opacity: 0.85;
  pointer-events: none;
}

/* ---------- 情绪文案条（两档字号：大号编号 + 小字情绪句与技术标） ---------- */
.stage-caption-row {
  width: min(100%, 540px, calc(34vh * 16 / 9));
  margin-top: 8px;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}
.stage-cue-head {
  display: flex;
  align-items: baseline;
  gap: 14px;
}
.stage-cue-num {
  font-family: "Archivo Black", var(--st-mono);
  font-size: clamp(30px, 3.6vw, 40px);
  line-height: 0.9;
  color: var(--st-gold);
  letter-spacing: -0.02em;
}
.stage-cue-copy {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.stage-cue-mood {
  font-size: 14.5px;
  font-weight: 500;
  color: var(--st-white);
  letter-spacing: 0.04em;
  line-height: 1.4;
  margin: 0;
  transition: opacity 0.55s cubic-bezier(0.16, 1, 0.3, 1);
}
.stage-cue-spec {
  font-family: var(--st-mono);
  font-size: 11px;
  color: var(--st-muted);
  letter-spacing: 0.08em;
  margin: 0;
}

/* GO 自动演出进度细线 */
.stage-progress-track {
  width: min(100%, 540px, calc(34vh * 16 / 9));
  height: 2px;
  background: var(--st-faint);
  margin-top: 7px;
  overflow: hidden;
}
.stage-progress-fill {
  height: 100%;
  width: 0%;
  background: var(--st-gold);
  transition: width 0.08s linear;
}

/* ---------- 下方横向精简精密控台条（一屏内可见，不抢画幅） ---------- */
.stage-desk {
  border-top: 3px solid #000;
  background: var(--st-panel);
  padding: 12px 28px 14px;
  display: grid;
  grid-template-columns: 1.15fr 0.85fr;
  gap: 24px;
  align-items: center;
}

/* 4 根短行程精密垂直推子 */
.stage-faders {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
}
.fader-col {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
}
.fader-readout {
  font-family: var(--st-mono);
  font-size: 10.5px;
  color: var(--st-white);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.05em;
  min-height: 14px;
}
.fader-track-wrap {
  position: relative;
  width: 44px;
  height: 54px;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: ns-resize;
  touch-action: none;
  outline: none;
}
.fader-track-wrap:focus-visible .fader-thumb {
  outline: 2px solid var(--st-gold);
  outline-offset: 2px;
}
.fader-slot {
  position: relative;
  width: 4px;
  height: 44px;
  background: #040404;
  box-shadow: inset 0 0 0 1px rgba(250, 246, 238, 0.16);
}
.fader-fill {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  height: 50%;
  background: var(--st-gold);
  opacity: 0.88;
  pointer-events: none;
}
.fader-thumb {
  position: absolute;
  left: 50%;
  bottom: 50%;
  transform: translate(-50%, 50%);
  width: 28px;
  height: 12px;
  background: var(--st-white);
  border: 2px solid #000;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
}
.fader-thumb::after {
  content: "";
  width: 12px;
  height: 2px;
  background: #000;
}
.fader-col.is-dragging .fader-thumb {
  background: var(--st-gold);
}
.fader-label {
  font-family: var(--st-mono);
  font-size: 9.5px;
  font-weight: 700;
  letter-spacing: 0.1em;
  color: var(--st-muted);
  text-align: center;
}
.fader-sub {
  display: none;
}

/* 右侧紧凑控制区：3 键横排 + 遥测行 */
.stage-actions {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
}
.stage-btn-stack {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.st-btn {
  appearance: none;
  width: 100%;
  min-height: 44px;
  padding: 6px 10px;
  background: var(--st-surface);
  color: var(--st-white);
  border: 1px solid var(--st-faint);
  font-family: var(--st-mono);
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: 0.08em;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  transition: background 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    color 0.22s cubic-bezier(0.16, 1, 0.3, 1),
    border-color 0.22s ease;
}
.st-btn:hover {
  border-color: rgba(250, 246, 238, 0.42);
}
.st-btn.is-active {
  background: var(--st-gold);
  color: #000;
  border-color: var(--st-gold);
}
.st-btn .st-state {
  font-size: 10px;
  opacity: 0.78;
}
.st-btn.is-active .st-state {
  opacity: 1;
}

.stage-telemetry {
  border-top: 1px solid var(--st-faint);
  padding-top: 10px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  font-family: var(--st-mono);
  font-size: 9.5px;
  color: var(--st-muted);
  font-variant-numeric: tabular-nums;
}
.stage-telemetry b {
  display: block;
  color: var(--st-white);
  font-size: 11px;
  margin-top: 2px;
  white-space: nowrap;
}

/* ---------- 幕后工程说明（克制三栏，位于折叠线下方不抢首屏） ---------- */
.stage-notes {
  margin-top: 32px;
  border: 3px solid #000;
  background: #fff;
  box-shadow: var(--shadow);
  padding: 26px 30px;
}
.stage-notes h3 {
  font-size: 18px;
  margin-bottom: 14px;
}
.stage-notes-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
}
.stage-note-item b {
  display: block;
  font-family: var(--st-mono);
  font-size: 12px;
  letter-spacing: 0.08em;
  margin-bottom: 6px;
}
.stage-note-item p {
  margin: 0;
  font-size: 14px;
  color: #222;
  line-height: 1.7;
}

@media (max-width: 860px) {
  .stage-bar {
    padding: 12px 16px;
  }
  .stage-viewport-wrap {
    padding: 18px 14px 16px;
  }
  .stage-viewport,
  .stage-caption-row,
  .stage-progress-track {
    width: 100%;
  }
  .stage-desk {
    grid-template-columns: 1fr;
    padding: 20px 16px 24px;
    gap: 20px;
  }
  .stage-faders {
    gap: 8px;
  }
  .fader-track-wrap {
    height: 92px;
  }
  .fader-slot {
    height: 78px;
  }
  .st-btn {
    min-height: 44px;
  }
  .stage-telemetry {
    grid-template-columns: 1fr 1fr;
  }
  .stage-notes {
    padding: 20px 18px;
  }
  .stage-notes-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .nav-in {
    flex-wrap: nowrap;
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
    scrollbar-width: none;
    padding: 8px 14px;
  }
  .nav-in::-webkit-scrollbar {
    display: none;
  }
}
