:root {
  --bg: #020309;
  --panel: rgba(7, 11, 17, 0.76);
  --panel-strong: rgba(9, 14, 21, 0.92);
  --line: rgba(188, 210, 235, 0.18);
  --line-hot: rgba(247, 163, 79, 0.5);
  --text: #eef6ff;
  --muted: #9aadc2;
  --amber: #f7a34f;
  --cyan: #57d7ff;
  --green: #8ef0bf;
  --red: #ff6b6b;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family:
    "Microsoft YaHei UI",
    "Microsoft YaHei",
    "PingFang SC",
    system-ui,
    sans-serif;
}

body {
  overflow: hidden;
}

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

button,
input,
select {
  transition:
    border-color 150ms ease,
    background 150ms ease,
    color 150ms ease,
    box-shadow 150ms ease,
    transform 120ms ease,
    opacity 150ms ease;
}

button:not(:disabled):hover {
  border-color: rgba(247, 163, 79, 0.72);
  box-shadow: 0 0 0 1px rgba(247, 163, 79, 0.12), 0 10px 28px rgba(0, 0, 0, 0.24);
  transform: translateY(-1px);
}

button:not(:disabled):active {
  transform: translateY(1px) scale(0.99);
  box-shadow: 0 0 0 1px rgba(247, 163, 79, 0.2);
}

button:focus-visible,
input:focus-visible,
select:focus-visible,
.view-pad:focus-visible {
  outline: 2px solid rgba(87, 215, 255, 0.86);
  outline-offset: 2px;
}

.showcase-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  width: 100vw;
  height: 100vh;
  background: #020309;
}

.director-panel {
  position: relative;
  z-index: 5;
  height: 100vh;
  overflow-y: auto;
  padding: 24px 22px;
  border-right: 1px solid var(--line);
  background: rgba(5, 8, 13, 0.96);
  box-shadow: 28px 0 70px rgba(0, 0, 0, 0.35);
}

.brand {
  display: flex;
  gap: 10px;
  align-items: center;
  margin-bottom: 22px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  flex: none;
  border-radius: 50%;
  border: 1px solid rgba(255, 219, 160, 0.62);
  background:
    radial-gradient(circle at 32% 24%, #ffdba0 0 7%, #f7a34f 28%, #7a431f 66%, #141923 100%);
  box-shadow: 0 0 24px rgba(247, 163, 79, 0.28);
}

.kicker {
  color: var(--amber);
  font-size: 12px;
  font-weight: 850;
  letter-spacing: 0;
}

.brand h1 {
  margin: 2px 0 0;
  max-width: 260px;
  font-size: 17px;
  line-height: 1.18;
}

.mode-tabs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 7px;
  margin-bottom: 18px;
}

.mode-tab,
.primary-button {
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(13, 22, 33, 0.72);
  color: #c4d4e7;
}

.mode-tab.active,
.primary-button {
  color: #061018;
  background: var(--amber);
  border-color: var(--amber);
  font-weight: 850;
}

.control-section,
.readout,
.evidence-panel {
  border-top: 1px solid var(--line);
  padding-top: 16px;
  margin-top: 16px;
}

.mode-panel {
  display: none;
}

.mode-panel.active {
  display: block;
}

label {
  display: block;
  margin-bottom: 14px;
  color: #dce9f8;
  font-size: 13px;
  font-weight: 760;
}

input,
select {
  width: 100%;
  height: 39px;
  margin-top: 7px;
  border: 1px solid rgba(188, 210, 235, 0.2);
  border-radius: 8px;
  background: rgba(2, 5, 10, 0.86);
  color: var(--text);
  padding: 0 10px;
  outline: none;
}

input[type="range"] {
  padding: 0;
  accent-color: var(--amber);
}

.control-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.launch-card {
  display: grid;
  gap: 4px;
  margin: 0 0 14px;
  padding: 11px 12px;
  border: 1px solid rgba(87, 215, 255, 0.24);
  border-radius: 8px;
  background:
    radial-gradient(circle at 90% 18%, rgba(87, 215, 255, 0.12), transparent 34%),
    rgba(8, 13, 20, 0.62);
}

.launch-card span {
  color: var(--cyan);
  font-size: 12px;
  font-weight: 900;
}

.launch-card strong {
  color: var(--text);
  font-size: 15px;
  line-height: 1.2;
}

.launch-card em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
  font-weight: 760;
}

.button-row {
  margin-top: 18px;
}

.primary-button {
  width: 100%;
}

.readout {
  display: grid;
  gap: 14px;
}

.readout div,
.metric,
.scene-hud div {
  display: grid;
  gap: 5px;
}

.readout span,
.metric span,
.scene-hud span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
}

.readout strong,
.metric strong,
.scene-hud strong {
  color: var(--text);
  font-size: 20px;
  line-height: 1.18;
}

.evidence-panel {
  padding-bottom: 12px;
}

.panel-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}

.panel-heading span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 850;
}

.panel-heading strong {
  color: var(--amber);
}

.candidate-list {
  display: grid;
  gap: 8px;
}

.candidate-empty {
  min-height: 92px;
  display: grid;
  place-items: center;
  color: var(--muted);
  text-align: center;
  line-height: 1.55;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(8, 13, 20, 0.58);
}

.candidate-row {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  width: 100%;
  padding: 10px 11px;
  text-align: left;
  border: 1px solid rgba(188, 210, 235, 0.15);
  border-radius: 8px;
  background: rgba(8, 13, 20, 0.58);
  color: var(--text);
}

.candidate-row:hover {
  border-color: rgba(87, 215, 255, 0.44);
  background: rgba(12, 22, 32, 0.82);
}

.candidate-row:active {
  border-color: rgba(247, 163, 79, 0.7);
  background: rgba(18, 24, 28, 0.88);
}

.candidate-row strong {
  display: block;
  color: var(--text);
  font-size: 14px;
}

.candidate-row span {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.candidate-score {
  color: var(--green);
  font-weight: 900;
}

.candidate-score b,
.candidate-score small {
  display: block;
  text-align: right;
}

.candidate-score small {
  margin-top: 3px;
  color: var(--amber);
  font-size: 11px;
}

.window-row span + span {
  margin-top: 2px;
}

.cinema-stage {
  position: relative;
  min-width: 0;
  height: 100vh;
  overflow: hidden;
  background:
    radial-gradient(circle at 54% 42%, rgba(247, 163, 79, 0.08), transparent 24%),
    linear-gradient(180deg, #040711 0%, #020309 100%);
}

#sceneCanvas {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
}

.loading-overlay {
  position: absolute;
  z-index: 8;
  left: 50%;
  top: 46%;
  width: min(430px, calc(100% - 80px));
  transform: translate(-50%, -50%) scale(0.98);
  opacity: 0;
  pointer-events: none;
  transition: opacity 160ms ease, transform 160ms ease;
}

.loading-overlay div {
  display: grid;
  gap: 8px;
  padding: 18px 20px;
  border: 1px solid rgba(247, 163, 79, 0.42);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(247, 163, 79, 0.2), rgba(5, 9, 15, 0.9) 48%),
    rgba(5, 9, 15, 0.9);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.42), 0 0 38px rgba(247, 163, 79, 0.18);
}

.loading-overlay strong {
  color: #ffb65e;
  font-size: 20px;
  font-weight: 900;
}

.loading-overlay span {
  color: #c9d9ea;
  font-size: 13px;
  line-height: 1.55;
  font-weight: 760;
}

.loading .loading-overlay {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.center-play {
  position: absolute;
  z-index: 5;
  left: calc(50% - 92px);
  top: calc(50% - 190px);
  width: 184px;
  height: 104px;
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 7px;
  border: 1px solid rgba(255, 220, 164, 0.62);
  border-radius: 8px;
  background: rgba(247, 163, 79, 0.92);
  color: #061018;
  box-shadow: 0 18px 70px rgba(247, 163, 79, 0.34);
  font-weight: 900;
}

.center-play span {
  font-size: 30px;
  line-height: 1;
}

.is-playing .center-play,
.loading .center-play {
  opacity: 0;
  pointer-events: none;
  transform: scale(0.96);
  transition: opacity 180ms ease, transform 180ms ease;
}

.film-header {
  position: absolute;
  z-index: 3;
  top: 28px;
  left: 34px;
  right: 34px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 20px;
  pointer-events: none;
}

.film-header h2 {
  margin: 5px 0 0;
  font-size: clamp(28px, 3.2vw, 48px);
  line-height: 1.06;
  text-shadow: 0 5px 24px rgba(0, 0, 0, 0.5);
}

.film-header h2:empty {
  display: none;
}

.film-header .kicker {
  display: inline-flex;
  align-items: center;
  min-height: 32px;
  padding: 4px 12px;
  border: 1px solid rgba(247, 163, 79, 0.32);
  border-radius: 8px;
  background: rgba(5, 9, 15, 0.52);
  color: #ffb65e;
  font-size: clamp(18px, 1.45vw, 26px);
  line-height: 1;
  text-shadow: 0 0 18px rgba(247, 163, 79, 0.34);
}

.status-pill {
  min-width: 104px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(142, 240, 191, 0.46);
  border-radius: 8px;
  color: var(--green);
  background: rgba(5, 18, 14, 0.64);
  font-weight: 850;
}

.status-pill[data-tone="loading"] {
  border-color: rgba(247, 163, 79, 0.54);
  color: #ffbf70;
  background: rgba(34, 22, 8, 0.72);
}

.status-pill[data-tone="error"] {
  border-color: rgba(255, 107, 107, 0.58);
  color: #ff9a9a;
  background: rgba(34, 8, 8, 0.72);
}

.metric-strip {
  position: absolute;
  z-index: 3;
  top: 114px;
  right: 34px;
  display: grid;
  grid-template-columns: repeat(3, minmax(112px, 1fr));
  gap: 10px;
  width: min(500px, calc(100vw - 420px));
}

.metric {
  min-height: 78px;
  padding: 13px 15px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 9, 15, 0.54);
  backdrop-filter: blur(12px);
}

.metric strong {
  font-size: 20px;
}

.accel-panel {
  position: absolute;
  z-index: 3;
  top: 206px;
  right: 34px;
  width: min(500px, calc(100vw - 420px));
  padding: 16px 18px;
  border: 1px solid rgba(247, 163, 79, 0.34);
  border-radius: 8px;
  background:
    linear-gradient(135deg, rgba(247, 163, 79, 0.16), rgba(5, 9, 15, 0.64) 42%),
    rgba(5, 9, 15, 0.62);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 58px rgba(0, 0, 0, 0.28);
}

.accel-title {
  color: var(--amber);
  font-size: 13px;
  font-weight: 900;
  margin-bottom: 12px;
}

.shot-state {
  display: grid;
  gap: 4px;
  margin-bottom: 12px;
  padding: 9px 11px;
  border: 1px solid rgba(188, 210, 235, 0.13);
  border-radius: 8px;
  background: rgba(2, 5, 10, 0.36);
}

.shot-state strong {
  color: var(--text);
  font-size: 15px;
}

.shot-state span {
  color: #bfd0e4;
  font-size: 12px;
  line-height: 1.45;
}

.speed-compare {
  display: grid;
  grid-template-columns: 1fr 42px 1fr;
  gap: 10px;
  align-items: end;
}

.speed-compare span {
  display: block;
  color: var(--muted);
  font-size: 12px;
  font-weight: 760;
  margin-bottom: 5px;
}

.speed-compare strong {
  display: block;
  color: var(--text);
  font-size: 25px;
  line-height: 1.05;
}

.speed-arrow {
  color: var(--amber);
  font-size: 30px;
  line-height: 1;
  text-align: center;
  padding-bottom: 2px;
  text-shadow: 0 0 22px rgba(247, 163, 79, 0.5);
}

.boost-bar {
  height: 9px;
  margin-top: 14px;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(238, 246, 255, 0.12);
}

.boost-bar span {
  display: block;
  width: 0%;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--cyan), var(--amber), var(--green));
  box-shadow: 0 0 22px rgba(142, 240, 191, 0.45);
  transition: width 160ms linear;
}

.boost-text {
  margin-top: 9px;
  color: #dcecff;
  font-size: 13px;
  font-weight: 760;
}

.chart-panel {
  position: absolute;
  z-index: 3;
  right: 34px;
  bottom: 132px;
  width: min(410px, calc(100vw - 430px));
  height: 240px;
  border: 1px solid var(--line);
  border-radius: 8px;
  overflow: hidden;
  background: rgba(5, 9, 15, 0.54);
  backdrop-filter: blur(12px);
  opacity: 1;
  pointer-events: auto;
}

#speedCanvas {
  width: 100%;
  height: 100%;
  display: block;
}

.scene-hud {
  position: absolute;
  z-index: 3;
  left: 34px;
  right: 480px;
  bottom: 132px;
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 10px;
  pointer-events: none;
}

.scene-hud div {
  min-width: 0;
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(5, 9, 15, 0.52);
  backdrop-filter: blur(12px);
}

.transport-bar {
  position: absolute;
  z-index: 4;
  left: 34px;
  right: 34px;
  bottom: 28px;
  display: grid;
  grid-template-columns: 190px 176px 306px 176px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 15px 16px;
  border: 1px solid rgba(188, 210, 235, 0.2);
  border-radius: 8px;
  background: rgba(4, 7, 12, 0.72);
  backdrop-filter: blur(16px);
}

.control-cluster {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  align-items: center;
}

.control-cluster span {
  grid-column: 1 / -1;
  color: #bed0e5;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.speed-option,
.camera-option {
  height: 32px;
  border: 1px solid rgba(188, 210, 235, 0.18);
  border-radius: 8px;
  background: rgba(8, 13, 20, 0.78);
  color: #dcecff;
  font-size: 12px;
  font-weight: 800;
}

.camera-option {
  white-space: nowrap;
}

.speed-option.active,
.camera-option.active {
  color: #061018;
  background: var(--cyan);
  border-color: var(--cyan);
}

.angle-control {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.angle-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: #bed0e5;
  font-size: 12px;
  font-weight: 850;
  line-height: 1;
}

.angle-top strong {
  color: var(--cyan);
  font-size: 12px;
}

.view-pad {
  position: relative;
  width: 100%;
  height: 54px;
  overflow: hidden;
  border: 1px solid rgba(188, 210, 235, 0.22);
  border-radius: 8px;
  background:
    radial-gradient(circle at 50% 50%, rgba(87, 215, 255, 0.14), transparent 34%),
    rgba(8, 13, 20, 0.78);
  cursor: crosshair;
  touch-action: none;
}

.view-pad::before,
.view-pad::after {
  content: "";
  position: absolute;
  background: rgba(238, 246, 255, 0.34);
  box-shadow: 0 0 12px rgba(87, 215, 255, 0.16);
}

.view-pad::before {
  left: 50%;
  top: 8px;
  bottom: 8px;
  width: 2px;
  transform: translateX(-1px);
}

.view-pad::after {
  left: 8px;
  right: 8px;
  top: 50%;
  height: 2px;
  transform: translateY(-1px);
}

.view-pad-knob {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 18px;
  height: 18px;
  border: 2px solid rgba(255, 236, 202, 0.82);
  border-radius: 50%;
  background: var(--amber);
  box-shadow: 0 0 22px rgba(247, 163, 79, 0.56);
  transform: translate(-50%, -50%);
}

.play-button {
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  border: 0;
  border-radius: 8px;
  background: var(--amber);
  color: #061018;
  font-weight: 900;
  box-shadow: 0 12px 38px rgba(247, 163, 79, 0.28);
}

.play-button:disabled {
  cursor: default;
  color: #c7d8ea;
  border: 1px solid rgba(188, 210, 235, 0.18);
  background: rgba(8, 13, 20, 0.78);
  box-shadow: none;
}

#playIcon {
  font-size: 20px;
  line-height: 1;
}

.timeline-wrap {
  min-width: 0;
}

.timeline-top {
  display: flex;
  justify-content: space-between;
  color: #bed0e5;
  font-size: 12px;
  font-weight: 850;
  margin-bottom: 6px;
}

.timeline-wrap input {
  height: 26px;
  margin: 0;
  padding: 0;
  border: 0;
  background: transparent;
}

.loading {
  cursor: progress;
}

@media (max-width: 1180px) {
  body {
    overflow: auto;
  }

  .showcase-shell {
    grid-template-columns: 1fr;
    height: auto;
  }

  .director-panel {
    height: auto;
  }

  .cinema-stage {
    height: 900px;
  }

  .metric-strip,
  .chart-panel,
  .accel-panel,
  .scene-hud {
    right: 24px;
    left: 24px;
    width: auto;
  }

  .scene-hud {
    right: 24px;
  }

  .transport-bar {
    grid-template-columns: 1fr 1fr;
  }

  .play-button,
  .timeline-wrap {
    grid-column: 1 / -1;
  }
}
