:root {
  --bg: #05060c;
  --ink: #e8ecf7;
  --muted: #8b93ab;
  --line: rgba(255, 255, 255, 0.12);
  --glass: rgba(12, 16, 28, 0.72);
  --cyan: #6ee7ff;
  --violet: #b388ff;
  --pink: #ff7ab8;
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--ink);
  font: 14px/1.5 "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, "Segoe UI", sans-serif;
  overflow: hidden;
  overscroll-behavior: none;
}

#stage {
  position: fixed;
  inset: 0;
  width: 100%;
  height: 100%;
  display: block;
  touch-action: none;
  cursor: crosshair;
}

/* ---------- 左上角标题 ---------- */

.brand {
  position: fixed;
  top: 22px;
  left: 24px;
  display: flex;
  gap: 12px;
  align-items: center;
  pointer-events: none;
}

.brand__dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan), var(--violet) 60%, var(--pink));
  box-shadow: 0 0 18px rgba(110, 231, 255, 0.8);
  animation: pulse 2.6s ease-in-out infinite;
}

@keyframes pulse {
  0%, 100% { transform: scale(1); opacity: 1; }
  50% { transform: scale(1.35); opacity: 0.65; }
}

.brand h1 {
  margin: 0;
  font-size: 20px;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  font-weight: 700;
}

.brand p {
  margin: 2px 0 0;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.04em;
}

/* ---------- 右上角数据 ---------- */

.hud {
  position: fixed;
  top: 22px;
  right: 24px;
  display: grid;
  grid-auto-flow: column;
  gap: 18px;
  padding: 10px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: var(--glass);
  backdrop-filter: blur(14px) saturate(1.2);
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}

.hud div { display: grid; gap: 2px; text-align: right; }
.hud span { font-size: 10px; letter-spacing: 0.16em; color: var(--muted); text-transform: uppercase; }
.hud b { font-size: 15px; font-weight: 600; }

/* ---------- 控制台 ---------- */

.panel {
  position: fixed;
  left: 24px;
  bottom: 24px;
  width: 306px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--glass);
  backdrop-filter: blur(18px) saturate(1.25);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.55);
  overflow: hidden;
  transition: width 0.24s ease;
}

.panel__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}

.panel__head strong { font-size: 12px; letter-spacing: 0.18em; color: var(--muted); text-transform: uppercase; }

.panel__body {
  display: grid;
  gap: 12px;
  padding: 14px;
  max-height: 60vh;
  overflow: auto;
}

.panel.collapsed .panel__body { display: none; }

.ctl { display: grid; gap: 6px; font-size: 12px; color: var(--muted); }
.ctl span { display: flex; justify-content: space-between; }
.ctl b { color: var(--ink); font-variant-numeric: tabular-nums; }

input[type="range"] {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--cyan), var(--violet), var(--pink));
  outline: none;
}

input[type="range"]::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 16px;
  height: 16px;
  border-radius: 50%;
  background: #0b0f1a;
  border: 2px solid #fff;
  box-shadow: 0 0 10px rgba(110, 231, 255, 0.7);
  cursor: pointer;
}

input[type="range"]::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #0b0f1a;
  border: 2px solid #fff;
  cursor: pointer;
}

.buttons { display: flex; flex-wrap: wrap; gap: 8px; }

button {
  flex: 1 1 auto;
  min-width: 88px;
  padding: 9px 10px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: rgba(255, 255, 255, 0.05);
  color: var(--ink);
  font: inherit;
  font-size: 12px;
  cursor: pointer;
  transition: transform 0.12s ease, background 0.18s ease, border-color 0.18s ease;
}

button:hover { background: rgba(255, 255, 255, 0.12); transform: translateY(-1px); }
button:active { transform: translateY(0) scale(0.98); }

button.primary {
  background: linear-gradient(135deg, rgba(110, 231, 255, 0.28), rgba(179, 136, 255, 0.28));
  border-color: rgba(110, 231, 255, 0.5);
}

button.on {
  border-color: rgba(255, 122, 184, 0.6);
  background: rgba(255, 122, 184, 0.2);
}

button.icon {
  flex: 0 0 auto;
  min-width: 30px;
  padding: 2px 8px;
  border-radius: 9px;
  line-height: 1.2;
}

.hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.7;
  color: rgba(139, 147, 171, 0.85);
}

/* ---------- 提示条 ---------- */

.toast {
  position: fixed;
  left: 50%;
  bottom: 30px;
  translate: -50% 0;
  padding: 9px 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--glass);
  backdrop-filter: blur(12px);
  font-size: 12px;
  opacity: 0;
  transition: opacity 0.25s ease, translate 0.25s ease;
  pointer-events: none;
}

.toast.show { opacity: 1; translate: -50% -8px; }

@media (max-width: 720px) {
  .brand { top: 14px; left: 14px; }
  .brand p { display: none; }
  .hud { top: 14px; right: 14px; gap: 12px; padding: 8px 12px; }
  .hud div:nth-child(3) { display: none; }
  .panel { left: 12px; right: 12px; bottom: 12px; width: auto; }
  .panel__body { max-height: 46vh; }
  .toast { bottom: 12px; }
}
