/* ═══════════════════════════════════════════════════════════
   WM·2026 — Explorer Cassette Deck
   透明探索风：深空石墨底、琥珀橙信号色、点阵质感
   ═══════════════════════════════════════════════════════════ */

:root {
  --bg: oklch(0.155 0.008 265);          /* 深空石墨 */
  --bg-raise: oklch(0.21 0.01 265);
  --ink: oklch(0.92 0.005 265);          /* 近白，微冷 */
  --ink-dim: oklch(0.62 0.012 265);
  --ink-faint: oklch(0.44 0.012 265);
  --signal: oklch(0.72 0.19 45);         /* 琥珀信号橙 */
  --signal-dim: oklch(0.72 0.19 45 / 0.16);
  --line: oklch(0.32 0.012 265);
  --font-display: "Michroma", "Space Grotesk", sans-serif;
  --font-body: "Space Grotesk", "PingFang SC", sans-serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

html, body {
  height: 100%;
  overflow: hidden;
  background: var(--bg);
  color: var(--ink);
  font-family: var(--font-body);
  -webkit-font-smoothing: antialiased;
}

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

/* ── HUD 通用 ── */
.hud {
  position: fixed;
  z-index: 10;
  user-select: none;
  -webkit-user-select: none;
}

.hud-top {
  top: 0; left: 0; right: 0;
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: clamp(18px, 3.5vw, 40px);
  pointer-events: none;
}
.hud-top > * { pointer-events: auto; }

.brand h1 {
  font-family: var(--font-display);
  font-size: clamp(19px, 2.4vw, 28px);
  font-weight: 400;
  letter-spacing: 0.14em;
  color: var(--ink);
}
.brand .sub {
  margin-top: 6px;
  font-size: 10px;
  letter-spacing: 0.42em;
  color: var(--ink-faint);
}

.meta { display: flex; gap: 10px; align-items: center; }

.chip {
  font-size: 10px;
  letter-spacing: 0.22em;
  color: var(--ink-dim);
  border: 1px solid var(--line);
  padding: 8px 14px;
  border-radius: 2px;
  white-space: nowrap;
}
.chip-action {
  cursor: pointer;
  color: var(--signal);
  border-color: oklch(0.72 0.19 45 / 0.4);
  transition: background 0.25s, color 0.25s;
}
.chip-action:hover { background: var(--signal-dim); }

/* ── 走带读数 ── */
.readout {
  left: clamp(18px, 3.5vw, 40px);
  bottom: clamp(96px, 14vh, 132px);
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-width: min(46vw, 420px);
}
.readout-status {
  font-family: var(--font-display);
  font-size: clamp(15px, 1.8vw, 21px);
  letter-spacing: 0.18em;
  color: var(--signal);
}
.readout-status.is-idle { color: var(--ink-dim); }
.readout-title {
  font-size: clamp(12px, 1.3vw, 14px);
  font-weight: 300;
  letter-spacing: 0.08em;
  color: var(--ink);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.readout-time {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--ink-faint);
  font-variant-numeric: tabular-nums;
}

/* ── 走带控制条 ── */
.transport {
  left: 50%;
  bottom: clamp(22px, 4vh, 36px);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px;
  background: oklch(0.19 0.01 265 / 0.92);
  border: 1px solid var(--line);
  border-radius: 6px;
}

.tbtn {
  appearance: none;
  border: 1px solid transparent;
  background: transparent;
  color: var(--ink-dim);
  width: 46px;
  height: 46px;
  border-radius: 4px;
  display: grid;
  place-items: center;
  cursor: pointer;
  transition: color 0.2s, background 0.2s, border-color 0.2s, transform 0.08s;
}
.tbtn svg { width: 20px; height: 20px; fill: currentColor; }
.tbtn:hover { color: var(--ink); background: var(--bg-raise); }
.tbtn:active, .tbtn.is-held { transform: scale(0.92); color: var(--signal); }
.tbtn.is-active { color: var(--signal); border-color: oklch(0.72 0.19 45 / 0.45); background: var(--signal-dim); }
.tbtn:focus-visible { outline: 1px solid var(--signal); outline-offset: 2px; }

.tbtn-play {
  width: 58px;
  height: 46px;
  color: var(--ink);
  border-color: var(--line);
}
.tbtn-play .ic-pause { display: none; }
.tbtn-play.is-active .ic-play { display: none; }
.tbtn-play.is-active .ic-pause { display: block; }

.vol { display: flex; align-items: center; gap: 8px; padding: 0 10px 0 6px; }
.vol-ic { width: 16px; height: 16px; fill: var(--ink-faint); flex: none; }
.vol input {
  appearance: none;
  -webkit-appearance: none;
  width: 84px;
  height: 2px;
  background: var(--line);
  border-radius: 1px;
  cursor: pointer;
}
.vol input::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 10px; height: 10px;
  border-radius: 50%;
  background: var(--signal);
}
.vol input::-moz-range-thumb {
  width: 10px; height: 10px; border: none;
  border-radius: 50%;
  background: var(--signal);
}

/* ── 底部提示 ── */
.hint {
  left: 50%;
  bottom: clamp(84px, 12vh, 104px);
  transform: translateX(-50%);
  font-size: 10px;
  letter-spacing: 0.24em;
  color: var(--ink-faint);
  white-space: nowrap;
  transition: opacity 1s;
}
.hint-key {
  color: var(--ink-dim);
  border: 1px solid var(--line);
  border-radius: 3px;
  padding: 2px 6px;
  font-size: 9px;
}

/* ── Toast ── */
.toast {
  position: fixed;
  z-index: 30;
  top: clamp(80px, 12vh, 110px);
  left: 50%;
  transform: translateX(-50%) translateY(-8px);
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--signal);
  background: oklch(0.19 0.01 265 / 0.94);
  border: 1px solid oklch(0.72 0.19 45 / 0.4);
  padding: 10px 22px;
  border-radius: 3px;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.35s, transform 0.35s;
}
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ── 拖拽遮罩 ── */
.drop-veil {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: none;
  place-items: center;
  background: oklch(0.155 0.008 265 / 0.82);
  border: 1px dashed oklch(0.72 0.19 45 / 0.6);
  font-family: var(--font-display);
  font-size: clamp(15px, 2.4vw, 24px);
  letter-spacing: 0.3em;
  color: var(--signal);
}
.drop-veil.show { display: grid; }

/* ── Loader ── */
.loader {
  position: fixed;
  inset: 0;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 22px;
  align-items: center;
  justify-content: center;
  background: var(--bg);
  font-size: 10px;
  letter-spacing: 0.4em;
  color: var(--ink-faint);
  transition: opacity 0.8s;
}
.loader.done { opacity: 0; pointer-events: none; }
.loader-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  background: var(--signal);
  animation: pulse 1.1s ease-in-out infinite;
}
@keyframes pulse { 50% { transform: scale(2.4); opacity: 0.35; } }

.nojs {
  position: fixed; inset: 0; display: grid; place-items: center;
  font-size: 14px; letter-spacing: 0.1em; color: var(--ink-dim);
}

/* ── 响应式 ── */
@media (max-width: 640px) {
  .readout { max-width: 60vw; bottom: 118px; }
  .hint { display: none; }
  .vol input { width: 56px; }
  .tbtn { width: 42px; height: 42px; }
  .tbtn-play { width: 52px; }
  .brand .sub { letter-spacing: 0.3em; }
}

@media (prefers-reduced-motion: reduce) {
  .loader-dot { animation: none; }
  .toast, .tbtn { transition: none; }
}
