:root {
  --ink-black: #0c0a09;
  --ink-panel: rgba(16, 13, 12, 0.72);
  --paper-warm: #e9decb;
  --sand-gold: #c9a675;
  --cinnabar: #b5382e;
  --cinnabar-bright: #e04d3c;
  --muted: rgba(233, 222, 203, 0.62);
  --border-subtle: rgba(201, 166, 117, 0.22);
}

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

html, body {
  width: 100%;
  height: 100%;
  background: #060505;
  color: var(--paper-warm);
  font-family: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  overflow: hidden;
}

.app {
  width: 100vw;
  height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, #181310 0%, #050404 100%);
}

.stage-wrap {
  position: relative;
  width: min(100vw, calc(100vh * 16 / 9));
  height: min(100vh, calc(100vw * 9 / 16));
  background: #0b0908;
  box-shadow: 0 24px 90px rgba(0, 0, 0, 0.85), 0 0 0 1px rgba(201, 166, 117, 0.14);
  overflow: hidden;
}

.stage-wrap:fullscreen {
  width: 100vw;
  height: 100vh;
  box-shadow: none;
}

#mv-canvas {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: contain;
}

/* 开场浮层 */
.start-overlay {
  position: absolute;
  inset: 0;
  z-index: 30;
  display: flex;
  align-items: center;
  justify-content: center;
  background: radial-gradient(circle at center, rgba(16, 12, 10, 0.42) 0%, rgba(7, 6, 5, 0.82) 100%);
  backdrop-filter: blur(4px);
  transition: opacity 0.65s ease, visibility 0.65s ease;
}

.start-overlay.hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.start-card {
  text-align: center;
  padding: 40px 56px;
  border-radius: 12px;
  background: linear-gradient(180deg, rgba(24, 19, 16, 0.84) 0%, rgba(12, 10, 9, 0.92) 100%);
  border: 1px solid rgba(201, 166, 117, 0.28);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.7);
  max-width: 90%;
}

.seal-badge {
  display: inline-block;
  padding: 4px 12px;
  margin-bottom: 14px;
  font-size: 12px;
  letter-spacing: 0.28em;
  color: #f7e6df;
  background: var(--cinnabar);
  border: 1px solid rgba(255, 220, 200, 0.35);
  border-radius: 3px;
}

.start-title {
  font-family: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', serif;
  font-size: clamp(44px, 6vw, 72px);
  font-weight: 400;
  letter-spacing: 0.2em;
  color: var(--paper-warm);
  text-shadow: 0 6px 24px rgba(0, 0, 0, 0.8);
  margin-bottom: 8px;
}

.start-sub {
  font-size: 14px;
  letter-spacing: 0.16em;
  color: var(--sand-gold);
  margin-bottom: 28px;
}

.start-actions {
  display: flex;
  gap: 14px;
  justify-content: center;
  flex-wrap: wrap;
  margin-bottom: 20px;
}

.btn-primary,
.btn-ghost {
  cursor: pointer;
  font-family: inherit;
  font-size: 14px;
  letter-spacing: 0.1em;
  padding: 12px 26px;
  border-radius: 999px;
  transition: all 0.25s ease;
}

.btn-primary {
  background: linear-gradient(135deg, #c23f34 0%, #8c221b 100%);
  color: #fff6ee;
  border: 1px solid rgba(255, 180, 160, 0.35);
  box-shadow: 0 8px 24px rgba(181, 56, 46, 0.42);
}

.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(224, 77, 60, 0.55);
}

.btn-ghost {
  background: rgba(201, 166, 117, 0.12);
  color: var(--paper-warm);
  border: 1px solid rgba(201, 166, 117, 0.38);
}

.btn-ghost:hover {
  background: rgba(201, 166, 117, 0.24);
  transform: translateY(-1px);
}

.start-hint {
  font-size: 12px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

/* 自动隐藏 HUD */
.hud-auto-hide {
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.stage-wrap.hud-hidden .hud-top {
  opacity: 0;
  transform: translateY(-12px);
  pointer-events: none;
}

.stage-wrap.hud-hidden .hud-bottom {
  opacity: 0;
  transform: translateY(16px);
  pointer-events: none;
}

.stage-wrap.hud-hidden {
  cursor: none;
}

/* 顶部栏 */
.hud-top {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 18px 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(8, 6, 5, 0.72) 0%, rgba(8, 6, 5, 0) 100%);
}

.scene-pill {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 14px;
  border-radius: 999px;
  background: rgba(18, 14, 12, 0.65);
  border: 1px solid var(--border-subtle);
  backdrop-filter: blur(8px);
  font-size: 13px;
  letter-spacing: 0.12em;
  color: var(--paper-warm);
}

.scene-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--cinnabar-bright);
  box-shadow: 0 0 10px var(--cinnabar-bright);
}

.hud-tools {
  display: flex;
  align-items: center;
  gap: 8px;
}

.tool-btn {
  cursor: pointer;
  font-family: inherit;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  background: rgba(18, 14, 12, 0.65);
  border: 1px solid rgba(255, 255, 255, 0.12);
  padding: 6px 12px;
  border-radius: 999px;
  backdrop-filter: blur(8px);
  transition: all 0.2s ease;
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.tool-btn:hover {
  color: var(--paper-warm);
  border-color: var(--sand-gold);
}

.tool-btn.active {
  color: var(--paper-warm);
  background: rgba(201, 166, 117, 0.2);
  border-color: rgba(201, 166, 117, 0.5);
}

.rec-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #e04d3c;
}

.record-btn.recording {
  color: #fff;
  background: rgba(194, 48, 38, 0.85);
  border-color: #ff8e82;
  animation: pulseRec 1.2s infinite;
}

@keyframes pulseRec {
  0%, 100% { box-shadow: 0 0 0 0 rgba(224, 77, 60, 0.6); }
  50% { box-shadow: 0 0 0 8px rgba(224, 77, 60, 0); }
}

/* 底部播放控台 */
.hud-bottom {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 20;
  padding: 26px 24px 18px;
  background: linear-gradient(0deg, rgba(7, 5, 4, 0.92) 0%, rgba(7, 5, 4, 0.68) 60%, rgba(7, 5, 4, 0) 100%);
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.chapters-bar {
  display: flex;
  gap: 6px;
  flex-wrap: nowrap;
  overflow-x: auto;
  scrollbar-width: none;
}

.chapters-bar::-webkit-scrollbar {
  display: none;
}

.chapter-chip {
  cursor: pointer;
  flex-shrink: 0;
  font-family: inherit;
  font-size: 11px;
  letter-spacing: 0.04em;
  padding: 4px 10px;
  border-radius: 999px;
  border: 1px solid rgba(201, 166, 117, 0.24);
  background: rgba(20, 16, 14, 0.6);
  color: rgba(233, 222, 203, 0.72);
  transition: all 0.2s ease;
}

.chapter-chip:hover {
  border-color: var(--sand-gold);
  color: var(--paper-warm);
}

.chapter-chip.active {
  background: rgba(181, 56, 46, 0.78);
  border-color: rgba(255, 175, 158, 0.65);
  color: #fff8f2;
}

.progress-row {
  display: flex;
  align-items: center;
  gap: 12px;
}

.time-text {
  font-family: ui-monospace, SFMono-Regular, Consolas, monospace;
  font-size: 12px;
  color: var(--muted);
  min-width: 42px;
  text-align: center;
}

.progress-track {
  position: relative;
  flex: 1;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
}

.progress-bg {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
}

.progress-markers {
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  pointer-events: none;
}

.progress-marker {
  position: absolute;
  top: -2px;
  width: 2px;
  height: 8px;
  background: rgba(201, 166, 117, 0.65);
  border-radius: 1px;
}

.progress-fill {
  position: absolute;
  left: 0;
  width: 0%;
  height: 4px;
  border-radius: 999px;
  background: linear-gradient(90deg, var(--sand-gold), var(--cinnabar-bright));
}

.progress-thumb {
  position: absolute;
  left: 0%;
  width: 12px;
  height: 12px;
  margin-left: -6px;
  border-radius: 50%;
  background: #fff5eb;
  box-shadow: 0 0 10px rgba(224, 77, 60, 0.85);
  transition: transform 0.15s ease;
}

.progress-track:hover .progress-thumb {
  transform: scale(1.25);
}

.controls-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.controls-left,
.controls-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-btn {
  cursor: pointer;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid rgba(255, 255, 255, 0.14);
  background: rgba(255, 255, 255, 0.06);
  color: var(--paper-warm);
  font-size: 13px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s ease;
}

.icon-btn:hover {
  background: rgba(201, 166, 117, 0.22);
  border-color: var(--sand-gold);
}

.icon-btn.primary-play {
  width: 38px;
  height: 38px;
  background: var(--cinnabar);
  border-color: rgba(255, 195, 180, 0.45);
}

.icon-btn.primary-play:hover {
  background: var(--cinnabar-bright);
}

.track-mini {
  display: flex;
  flex-direction: column;
  margin-left: 4px;
}

.track-name {
  font-size: 14px;
  letter-spacing: 0.14em;
  color: var(--paper-warm);
}

.track-artist {
  font-size: 11px;
  color: var(--muted);
  letter-spacing: 0.06em;
}

.vol-wrap {
  display: flex;
  align-items: center;
  gap: 8px;
}

.vol-icon {
  font-size: 13px;
  opacity: 0.8;
}

#volume-slider {
  width: 86px;
  accent-color: var(--cinnabar-bright);
  cursor: pointer;
}
