*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
  width: 100%;
  height: 100%;
  overflow: hidden;
  overscroll-behavior: none;
  background: #050609;
  color: #f4f6fb;
  font-family: 'Segoe UI Variable Display', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei UI', system-ui, -apple-system, sans-serif;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
  user-select: none;
  -webkit-user-select: none;
}

button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
a { color: inherit; text-decoration: none; }

/* ================= 全屏单页无界画布 (100vw x 100dvh) ================= */
.viewport {
  position: fixed;
  inset: 0;
  width: 100vw;
  height: 100vh;
  height: 100dvh;
  overflow: hidden;
  cursor: grab;
  touch-action: none;
  background: #050609 url('../assets/scenes/01-sanctuary.jpg') center / cover no-repeat;
}
.viewport.is-dragging { cursor: grabbing; }

#scene-gl {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  z-index: 0;
}

.vignette {
  position: absolute;
  inset: 0;
  z-index: 20;
  pointer-events: none;
  background:
    radial-gradient(50vw 44vh at 14% 88%, rgba(4, 6, 13, 0.88) 0%, rgba(4, 6, 13, 0.48) 56%, transparent 100%),
    linear-gradient(180deg, rgba(4, 6, 11, 0.42) 0%, rgba(4, 6, 11, 0) 20%, rgba(4, 6, 11, 0) 76%, rgba(4, 6, 11, 0.84) 100%);
}

/* ================= 第四幕：统一角度 3D 倾斜错落工作台矩阵 ================= */
.iso-viewport {
  position: fixed;
  inset: 0;
  z-index: 12;
  perspective: 2100px;
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  will-change: opacity, transform;
}

.iso-rig {
  position: absolute;
  left: 53%;
  top: 46%;
  width: min(1260px, 88vw);
  height: min(740px, 80vh);
  transform-style: preserve-3d;
  transform: translate(-50%, -50%) rotateX(21deg) rotateY(-23deg) rotateZ(9.5deg);
  will-change: transform;
}

.iso-grid-plane {
  position: absolute;
  inset: -8% -6%;
  border-radius: 32px;
  transform: translateZ(-55px);
  background-image:
    linear-gradient(rgba(243, 207, 133, 0.055) 1px, transparent 1px),
    linear-gradient(90deg, rgba(162, 142, 255, 0.055) 1px, transparent 1px);
  background-size: 48px 48px;
  mask-image: radial-gradient(ellipse 76% 72% at 50% 50%, #000 30%, transparent 95%);
  -webkit-mask-image: radial-gradient(ellipse 76% 72% at 50% 50%, #000 30%, transparent 95%);
}

.iso-slab {
  position: absolute;
  border-radius: 16px;
  overflow: hidden;
  background: rgba(12, 16, 28, 0.9);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  box-shadow:
    -3px 4px 0 rgba(255, 255, 255, 0.14),
    -28px 38px 72px rgba(0, 0, 0, 0.86),
    inset 0 1px 0 rgba(255, 255, 255, 0.32);
  transform-style: preserve-3d;
  line-height: 1.5;
}

.iso-slab::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(125deg, rgba(255, 255, 255, 0.1) 0%, rgba(255, 255, 255, 0.02) 34%, transparent 65%);
  pointer-events: none;
}

.slab-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 7px 13px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(255, 255, 255, 0.04);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.03em;
  color: rgba(245, 248, 255, 0.95);
}
.slab-dot {
  display: inline-flex;
  align-items: center;
  gap: 7px;
}
.slab-dot::before {
  content: "";
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #f3cf85;
  box-shadow: 0 0 8px #f3cf85;
}
.slab-badge {
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 10px;
  font-weight: 750;
  background: rgba(243, 207, 133, 0.18);
  border: 1px solid rgba(243, 207, 133, 0.48);
  color: #fae2af;
}
.slab-badge--violet {
  background: rgba(152, 128, 255, 0.22);
  border-color: rgba(168, 148, 255, 0.52);
  color: #e6e0ff;
}
.slab-badge--mint {
  background: rgba(66, 220, 154, 0.18);
  border-color: rgba(66, 220, 154, 0.48);
  color: #96f5c8;
}

.slab-back-stage {
  left: -4%;
  top: -2%;
  width: 48%;
  aspect-ratio: 16 / 9.5;
  transform: translateZ(-20px);
  opacity: 0.84;
  border-color: rgba(255, 255, 255, 0.18);
}
.slab-back-stage img {
  width: 100%;
  height: calc(100% - 30px);
  object-fit: cover;
  display: block;
}

.slab-main-studio {
  left: 14%;
  top: 7%;
  width: 66%;
  aspect-ratio: 16 / 9.5;
  transform: translateZ(35px);
  border-color: rgba(243, 207, 133, 0.45);
  box-shadow:
    -4px 5px 0 rgba(243, 207, 133, 0.24),
    -38px 52px 95px rgba(0, 0, 0, 0.9),
    0 0 85px rgba(118, 96, 240, 0.24),
    inset 0 1px 0 rgba(255, 255, 255, 0.38);
  display: flex;
  flex-direction: column;
}
.main-canvas-wrap {
  position: relative;
  flex: 1;
  min-height: 0;
  background: #080a11;
  overflow: hidden;
}
.main-canvas-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
#studio-live-fx {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.slab-ai-layers {
  left: -3%;
  top: 23%;
  width: 28%;
  transform: translateZ(95px);
  border-color: rgba(168, 148, 255, 0.52);
}
.layers-stack {
  padding: 10px 12px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.l-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 6px 10px;
  border-radius: 9px;
  background: rgba(255, 255, 255, 0.05);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 11px;
}
.l-row.is-hot {
  background: linear-gradient(90deg, rgba(152, 128, 255, 0.28), rgba(243, 207, 133, 0.14));
  border-color: rgba(243, 207, 133, 0.55);
  transform: translateX(5px);
}
.l-title { display: inline-flex; align-items: center; gap: 7px; font-weight: 650; }
.l-dot { width: 9px; height: 9px; border-radius: 3px; }
.l-val { font-family: Consolas, monospace; font-size: 10px; color: #f3cf85; }

.slab-shaders {
  right: -4%;
  top: 4%;
  width: 34%;
  aspect-ratio: 16 / 10;
  transform: translateZ(90px);
  border-color: rgba(243, 207, 133, 0.52);
  display: flex;
  flex-direction: column;
}
.shaders-view { position: relative; flex: 1; overflow: hidden; }
.shaders-view img {
  width: 124%;
  height: 130%;
  object-fit: cover;
  object-position: -42px -28px;
  display: block;
  filter: contrast(1.08) brightness(1.06);
}
.shader-glow-sel {
  position: absolute;
  right: 15%;
  top: 17%;
  width: 29%;
  height: 45%;
  border-radius: 8px;
  border: 1.5px solid #f3cf85;
  box-shadow: 0 0 20px rgba(243, 207, 133, 0.65), inset 0 0 12px rgba(243, 207, 133, 0.24);
  animation: pulseSel 2.4s ease-in-out infinite;
}
@keyframes pulseSel {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.04); opacity: 0.68; }
}

.slab-timeline-ws {
  left: 28%;
  right: -2%;
  bottom: 2%;
  height: 22%;
  min-height: 132px;
  transform: translateZ(82px);
  border-color: rgba(255, 255, 255, 0.28);
  display: grid;
  grid-template-columns: 1.05fr 1.2fr;
}
.tl-pane { border-right: 1px solid rgba(255, 255, 255, 0.1); display: flex; flex-direction: column; }
.tl-tracks {
  position: relative;
  flex: 1;
  padding: 6px 12px;
  display: flex;
  flex-direction: column;
  justify-content: space-around;
  overflow: hidden;
}
.tl-line-row {
  display: grid;
  grid-template-columns: 64px 1fr;
  align-items: center;
  gap: 8px;
  font-size: 10.5px;
  color: rgba(224, 232, 248, 0.86);
}
.tl-groove { position: relative; height: 9px; border-radius: 999px; background: rgba(255, 255, 255, 0.06); }
.tl-clip { position: absolute; top: 1px; bottom: 1px; border-radius: 999px; }
.tl-key {
  position: absolute;
  top: 50%;
  width: 6px;
  height: 6px;
  background: #fff;
  transform: translate(-50%, -50%) rotate(45deg);
  box-shadow: 0 0 6px #f3cf85;
}
.tl-cursor {
  position: absolute;
  top: 0; bottom: 0;
  left: 80px;
  width: 1.5px;
  background: #f3cf85;
  box-shadow: 0 0 10px #f3cf85;
  animation: moveCursor 5s linear infinite;
}
@keyframes moveCursor {
  0% { left: 82px; }
  100% { left: calc(100% - 14px); }
}

.ws-pane { display: flex; flex-direction: column; min-width: 0; }
.ws-gallery { position: relative; flex: 1; overflow: hidden; }
.ws-gallery img {
  width: 108%;
  height: 390%;
  object-fit: cover;
  object-position: center bottom;
  position: absolute;
  left: -4%;
  bottom: -3px;
  filter: saturate(1.1);
}

.slab-rig-card {
  left: 5%;
  top: 52%;
  width: 26%;
  transform: translateZ(145px);
  border-color: rgba(243, 207, 133, 0.55);
}
.rig-inner {
  padding: 9px 12px;
  display: grid;
  grid-template-columns: 72px 1fr;
  align-items: center;
  gap: 10px;
}
.rig-orb {
  width: 72px;
  height: 72px;
  border-radius: 11px;
  background: radial-gradient(circle at 50% 35%, rgba(152, 126, 255, 0.35), rgba(8, 11, 20, 0.94));
  border: 1px solid rgba(162, 142, 255, 0.4);
  display: grid;
  place-items: center;
}
.rig-svg { width: 60px; height: 60px; animation: rigWave 3s ease-in-out infinite; }
@keyframes rigWave {
  0%, 100% { transform: translateY(0) rotate(0deg); }
  50% { transform: translateY(-3px) rotate(2deg); }
}
.rig-pills { display: flex; flex-wrap: wrap; gap: 5px; }
.r-tag {
  padding: 3px 8px;
  border-radius: 6px;
  font-size: 10px;
  background: rgba(255, 255, 255, 0.07);
  border: 1px solid rgba(255, 255, 255, 0.14);
  color: rgba(238, 242, 252, 0.92);
}
.r-tag.is-lit {
  background: rgba(243, 207, 133, 0.18);
  border-color: rgba(243, 207, 133, 0.5);
  color: #fae2af;
}

.slab-audio-card {
  right: -3%;
  top: 46%;
  width: 27%;
  transform: translateZ(150px);
  border-color: rgba(66, 220, 154, 0.5);
}
.audio-inner { padding: 9px 13px 10px; display: flex; flex-direction: column; gap: 6px; }
.spec-bars { height: 32px; display: flex; align-items: flex-end; gap: 3px; }
.spec-bars i {
  flex: 1;
  border-radius: 2px 2px 0 0;
  background: linear-gradient(180deg, #fae2af 0%, #dfa94e 52%, #8e6cf0 100%);
  height: 40%;
}
.audio-foot { display: flex; justify-content: space-between; font-size: 10px; color: rgba(218, 228, 244, 0.84); }

/* ================= 固定顶栏 ================= */
.top-bar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: 70px;
  padding: 0 42px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}
.top-bar > * { pointer-events: auto; }

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 750;
  font-size: 17.5px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: #ffffff;
}
.brand img { display: block; }

.top-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  font-size: 13.5px;
  color: rgba(235, 240, 250, 0.72);
}
.top-nav button {
  position: relative;
  padding: 6px 2px;
  transition: color 0.22s ease;
}
.top-nav button:hover { color: #ffffff; }
.top-nav button.is-active {
  color: #ffffff;
  font-weight: 650;
}
.top-nav button.is-active::after {
  content: "";
  position: absolute;
  left: 0; right: 0; bottom: -2px;
  height: 2px;
  border-radius: 2px;
  background: #f0ca7d;
}

.top-cta {
  display: inline-flex;
  align-items: center;
  height: 36px;
  padding: 0 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.94);
  color: #090c14;
  font-size: 12.5px;
  font-weight: 750;
  box-shadow: 0 4px 18px rgba(0, 0, 0, 0.3);
  transition: transform 0.18s ease, background 0.18s ease;
}
.top-cta:hover { transform: translateY(-1px); background: #ffffff; }

/* ================= 左右固定推镜按钮 ================= */
.nav-arrow {
  position: fixed;
  top: 50%;
  transform: translateY(-50%);
  z-index: 40;
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(10, 14, 24, 0.45);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.86);
  display: grid;
  place-items: center;
  transition: all 0.22s ease;
}
.nav-arrow:hover {
  background: rgba(255, 255, 255, 0.18);
  border-color: rgba(255, 255, 255, 0.4);
  color: #ffffff;
  transform: translateY(-50%) scale(1.06);
}
.nav-arrow--prev { left: 20px; }
.nav-arrow--next { right: 20px; }
.nav-arrow svg {
  width: 18px;
  height: 18px;
  stroke: currentColor;
  stroke-width: 2;
  fill: none;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* ================= 左下角固定黄金信息锚点 ================= */
.fixed-stage-hud {
  position: fixed;
  left: 42px;
  bottom: 90px;
  z-index: 35;
  max-width: 560px;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  pointer-events: none;
}
.fixed-stage-hud a,
.fixed-stage-hud button {
  pointer-events: auto;
}

.hud-copy {
  transition: opacity 0.26s ease, transform 0.32s cubic-bezier(0.22, 1, 0.36, 1), filter 0.26s ease;
  will-change: opacity, transform, filter;
}
.hud-copy.is-switching {
  opacity: 0;
  transform: translateX(-10px);
  filter: blur(4px);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 9px;
  padding: 6px 15px;
  border-radius: 999px;
  background: rgba(12, 16, 28, 0.65);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  color: rgba(255, 255, 255, 0.94);
  margin-bottom: 16px;
}
.eyebrow i {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #edc472;
  box-shadow: 0 0 10px #edc472;
}

.title {
  font-size: clamp(32px, 4.1vw, 58px);
  line-height: 1.11;
  font-weight: 800;
  letter-spacing: -0.025em;
  background: linear-gradient(180deg, #ffffff 30%, rgba(230, 236, 248, 0.88) 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  text-shadow: 0 18px 46px rgba(0, 0, 0, 0.6);
  margin-bottom: 14px;
}

.desc {
  font-size: clamp(14px, 1.18vw, 16.5px);
  line-height: 1.7;
  color: rgba(234, 240, 250, 0.88);
  max-width: 520px;
  min-height: 3.4em;
  margin-bottom: 24px;
  text-shadow: 0 2px 16px rgba(0, 0, 0, 0.78);
}

.fixed-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

.btn-gold {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  height: 50px;
  padding: 0 28px;
  border-radius: 999px;
  background: linear-gradient(180deg, #f3cf85 0%, #dfa94e 100%);
  color: #171208;
  font-weight: 750;
  font-size: 14.5px;
  letter-spacing: 0.01em;
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.75),
    0 12px 36px rgba(223, 169, 78, 0.38);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}
.btn-gold:hover {
  transform: translateY(-2px);
  box-shadow:
    inset 0 1px 0 rgba(255, 255, 255, 0.88),
    0 16px 44px rgba(223, 169, 78, 0.52);
}

.btn-glass {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 50px;
  padding: 0 24px;
  border-radius: 999px;
  background: rgba(14, 18, 30, 0.56);
  backdrop-filter: blur(20px) saturate(140%);
  -webkit-backdrop-filter: blur(20px) saturate(140%);
  border: 1px solid rgba(255, 255, 255, 0.24);
  color: #ffffff;
  font-weight: 600;
  font-size: 14px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}
.btn-glass:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.38);
  transform: translateY(-2px);
}

/* ================= 固定底栏 ================= */
.bottom-bar {
  position: fixed;
  left: 42px; right: 42px; bottom: 22px;
  z-index: 40;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  pointer-events: none;
}

.scene-dock {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px;
  border-radius: 999px;
  background: rgba(10, 13, 22, 0.72);
  backdrop-filter: blur(22px) saturate(150%);
  -webkit-backdrop-filter: blur(22px) saturate(150%);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.48);
  overflow-x: auto;
  max-width: 100%;
}

.dock-btn {
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  color: rgba(235, 240, 250, 0.72);
  white-space: nowrap;
  transition: all 0.24s cubic-bezier(0.22, 1, 0.36, 1);
}
.dock-btn:hover { color: #ffffff; }
.dock-btn.is-active {
  background: rgba(255, 255, 255, 0.95);
  color: #090c14;
  box-shadow: 0 3px 12px rgba(0, 0, 0, 0.35);
}

.swipe-status {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 11.5px;
  letter-spacing: 0.08em;
  color: rgba(235, 240, 250, 0.68);
}
.track-bar {
  width: 112px;
  height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, 0.2);
  position: relative;
  overflow: hidden;
}
.track-thumb {
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 25%;
  border-radius: 3px;
  background: #f0ca7d;
  will-change: transform;
}

/* ================= 真机实景预览浮层 ================= */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 99;
  background: rgba(4, 6, 12, 0.82);
  backdrop-filter: blur(22px);
  -webkit-backdrop-filter: blur(22px);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 32px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.28s ease;
}
.lightbox[hidden] { display: none; }
.lightbox.is-open {
  opacity: 1;
  pointer-events: auto;
}
.lb-panel {
  width: 100%;
  max-width: 980px;
  border-radius: 22px;
  overflow: hidden;
  background: rgba(14, 18, 28, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.8);
  padding: 18px;
}
.lb-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 14px;
}
.lb-tabs { display: flex; gap: 6px; flex-wrap: wrap; }
.lb-tab {
  padding: 6px 14px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  background: rgba(255, 255, 255, 0.06);
  color: #aeb8cc;
  border: 1px solid transparent;
}
.lb-tab.is-active {
  background: rgba(243, 207, 133, 0.2);
  color: #fae2af;
  border-color: rgba(243, 207, 133, 0.5);
}
.lb-close {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 16px;
}
.lb-screen {
  position: relative;
  aspect-ratio: 16 / 9;
  max-height: 64vh;
  margin: 0 auto;
  border-radius: 12px;
  overflow: hidden;
  background: #07090f;
}
.lb-screen img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.lb-screen img.is-active { opacity: 1; }

@media (max-width: 960px) {
  .top-nav, .swipe-status, .slab-ai-layers, .slab-rig-card, .slab-audio-card { display: none; }
  .top-bar { padding: 0 24px; }
  .fixed-stage-hud { left: 26px; right: 26px; bottom: 86px; }
  .bottom-bar { left: 24px; right: 24px; bottom: 18px; }
  .nav-arrow { display: none; }
  .iso-rig { top: 34%; width: 96vw; height: 52vh; }
  .slab-main-studio { left: 6%; width: 88%; }
}

@media (prefers-reduced-motion: reduce) {
  .hud-copy, .btn-gold, .btn-glass, .dock-btn { transition: none !important; }
}
