:root {
  color-scheme: dark;
}

html,
body {
  margin: 0;
  min-height: 100%;
  font-family:
    "PingFang SC", "Microsoft YaHei", "Noto Sans SC", Inter, ui-sans-serif, system-ui, -apple-system,
    BlinkMacSystemFont, "Segoe UI", sans-serif;
}

button,
input {
  font: inherit;
}

button {
  min-width: 0;
  line-height: 1;
  transition:
    background 160ms ease,
    border-color 160ms ease,
    transform 160ms ease;
}

button:active {
  transform: translateY(1px);
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid rgba(15, 23, 42, 0.38);
  outline-offset: 2px;
}

.stage {
  background: #0b0f14;
}

.stage canvas {
  display: block;
  width: 100%;
  height: 100%;
}

.controls-panel {
  transition:
    width 180ms ease,
    padding 180ms ease;
}

.panel-body {
  max-height: 720px;
  overflow: hidden;
  opacity: 1;
  transition:
    max-height 220ms ease,
    opacity 160ms ease,
    transform 180ms ease;
}

.controls-panel.is-collapsed {
  width: min(260px, calc(100vw - 32px));
}

.controls-panel.is-collapsed .panel-body {
  max-height: 0;
  opacity: 0;
  pointer-events: none;
  transform: translateY(-4px);
}

.control-row input[type="range"],
#audioProgress,
#audioVolume {
  width: 100%;
  height: 6px;
  border-radius: 999px;
  appearance: none;
  background: #cbd5e1;
  outline: none;
}

.control-row input[type="range"]::-webkit-slider-thumb,
#audioProgress::-webkit-slider-thumb,
#audioVolume::-webkit-slider-thumb {
  width: 16px;
  height: 16px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  appearance: none;
  background: #0f172a;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.24);
}

.control-row input[type="range"]::-moz-range-thumb,
#audioProgress::-moz-range-thumb,
#audioVolume::-moz-range-thumb {
  width: 14px;
  height: 14px;
  border: 2px solid #ffffff;
  border-radius: 999px;
  background: #0f172a;
  box-shadow: 0 2px 7px rgba(15, 23, 42, 0.24);
}

.switch-row input {
  width: 18px;
  height: 18px;
  accent-color: #0f172a;
}

.audio-player audio {
  display: none;
}

.drop-overlay {
  position: absolute;
  z-index: 20;
  inset: 16px;
  display: grid;
  place-items: center;
  border: 2px dashed rgba(255, 255, 255, 0.72);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.5);
  color: #ffffff;
  font-size: clamp(24px, 4vw, 56px);
  font-weight: 650;
  letter-spacing: 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(0.99);
  transition:
    opacity 160ms ease,
    transform 160ms ease;
}

.dragging .drop-overlay {
  opacity: 1;
  transform: scale(1);
}

.loading-overlay {
  position: absolute;
  z-index: 12;
  left: 50%;
  top: 50%;
  display: none;
  align-items: center;
  gap: 10px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 6px;
  background: rgba(15, 23, 42, 0.88);
  color: #ffffff;
  padding: 12px 16px;
  transform: translate(-50%, -50%);
  backdrop-filter: blur(12px);
}

.loading-overlay.is-visible {
  display: flex;
}

.loading-overlay[hidden] {
  display: none !important;
}

.loader {
  width: 16px;
  height: 16px;
  border: 2px solid rgba(255, 255, 255, 0.28);
  border-top-color: #ffffff;
  border-radius: 50%;
  animation: spin 900ms linear infinite;
}

@keyframes spin {
  to {
    transform: rotate(360deg);
  }
}

@media (max-width: 760px) {
  .controls-panel.is-collapsed {
    width: 100%;
  }
}
