:root {
  --ink: #20262e;
  --ink-soft: #55606f;
  --card: rgba(255, 255, 255, 0.92);
  --card-edge: #c9d6e6;
  --stage-left: 0px;
  --stage-right: 0px;
  --stage-top: 0px;
  --stage-bottom: 0px;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #dfe7f2;
}

body {
  font-family:
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", ui-sans-serif,
    system-ui, -apple-system, "Segoe UI", sans-serif;
  color: var(--ink);
  -webkit-font-smoothing: antialiased;
  user-select: none;
}

#app {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
}

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

.hud {
  position: absolute;
  left: calc(var(--stage-left) + 30px);
  top: calc(var(--stage-top) + 28px);
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 10px 20px;
  border: 1px solid var(--card-edge);
  border-radius: 999px;
  background: var(--card);
  box-shadow: 0 8px 22px rgba(50, 80, 130, 0.14);
  backdrop-filter: blur(6px);
}

.hud__kicker {
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.16em;
  color: #2f5fbf;
}

.hud b {
  font-size: 20px;
  font-weight: 800;
}

.hud__step {
  padding-left: 12px;
  border-left: 1px solid var(--card-edge);
  font-size: 14px;
  font-weight: 700;
  color: var(--ink-soft);
}

/* 预览用的台词条：只在正常浏览时出现，录制模式下由 .is-recording 隐藏。 */
.subpreview {
  position: absolute;
  left: 50%;
  bottom: calc(var(--stage-bottom) + 150px);
  transform: translateX(-50%);
  max-width: min(1180px, 78vw);
  padding: 10px 22px;
  border-radius: 14px;
  background: rgba(24, 28, 36, 0.78);
  color: #fff;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.45;
  text-align: center;
  opacity: 0;
  transition: opacity 0.24s ease;
  pointer-events: none;
}

.subpreview.is-on {
  opacity: 1;
}

.bar {
  position: absolute;
  left: calc(var(--stage-left) + 30px);
  right: calc(var(--stage-right) + 30px);
  bottom: calc(var(--stage-bottom) + 24px);
  padding: 12px 18px 14px;
  border: 1px solid var(--card-edge);
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 12px 30px rgba(50, 80, 130, 0.16);
  backdrop-filter: blur(6px);
}

.bar__progress {
  position: relative;
  height: 6px;
  border-radius: 999px;
  background: #dde6f1;
  overflow: hidden;
}

.bar__progress span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0;
  border-radius: 999px;
  background: linear-gradient(90deg, #6f9be8, #2f5fbf);
}

.bar__row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-top: 10px;
}

.dots {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex-wrap: wrap;
}

.dots button {
  width: 22px;
  height: 8px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: #cbd8e8;
  cursor: pointer;
  transition:
    width 0.2s ease,
    background 0.2s ease;
}

.dots button.is-active {
  width: 40px;
  background: #2f5fbf;
}

.bar__controls {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.tool {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  border: 1px solid var(--card-edge);
  border-radius: 12px;
  background: #fff;
  color: var(--ink);
  cursor: pointer;
  transition:
    background 0.16s ease,
    transform 0.16s ease;
}

.tool:hover {
  background: #eef3fb;
}

.tool:active {
  transform: scale(0.95);
}

.tool svg {
  width: 20px;
  height: 20px;
  fill: none;
  stroke: currentColor;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.tool--play .icon-play {
  fill: currentColor;
  stroke-width: 1.4;
}

.tool--play .icon-play,
.tool--sound .icon-sound-off {
  display: none;
}

.tool--play.is-paused .icon-pause,
.tool--sound.is-off .icon-sound-on {
  display: none;
}

.tool--play.is-paused .icon-play,
.tool--sound.is-off .icon-sound-off {
  display: block;
}

.time {
  min-width: 96px;
  margin-left: 4px;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: var(--ink-soft);
  text-align: right;
}

.toast {
  position: absolute;
  left: 50%;
  top: calc(var(--stage-top) + 30px);
  transform: translateX(-50%);
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(32, 38, 46, 0.86);
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}

.toast.is-on {
  opacity: 1;
}

/* 录制模式：只留画面，控件、台词条、提示都不进成片。 */
.is-recording .bar,
.is-recording .toast,
.is-recording .subpreview,
.is-recording .hud {
  display: none;
}

@media (max-width: 720px) {
  .hud {
    gap: 8px;
    padding: 8px 14px;
  }

  .hud__step,
  .time {
    display: none;
  }

  .subpreview {
    bottom: calc(var(--stage-bottom) + 128px);
    font-size: 17px;
    max-width: 86vw;
  }
}
