:root {
  --gold: #e5b25c;
  --gold2: #f6d99b;
  --cream: #f2e6cf;
  --ink: #03070b;
  --ui: rgba(242, 230, 207, 0.82);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  height: 100%;
  background: var(--ink);
  color: var(--cream);
  font-family: "Noto Sans SC", "Source Han Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}

#stage {
  position: fixed;
  inset: 0;
  display: grid;
  place-items: center;
  background: #03070b;
  overflow: hidden;
}

#film {
  width: min(100vw, 177.7778vh);
  height: auto;
  aspect-ratio: 16 / 9;
  display: block;
  background: #03070b;
}

/* ---------- 顶栏 ---------- */
.topbar {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  padding: clamp(16px, 2.2vw, 34px) clamp(18px, 3vw, 46px);
  background: linear-gradient(to bottom, rgba(3, 7, 11, 0.72), rgba(3, 7, 11, 0));
  pointer-events: none;
  transition: opacity 0.5s ease;
}
.topbar > * { pointer-events: auto; }
.brand { display: flex; flex-direction: column; gap: 5px; }
.brand-cn {
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  font-size: clamp(13px, 1.05vw, 17px);
  letter-spacing: 0.18em;
  color: rgba(242, 230, 207, 0.9);
}
.brand-en {
  font-size: clamp(8px, 0.62vw, 10px);
  letter-spacing: 0.32em;
  color: rgba(229, 178, 92, 0.58);
}
.ghost {
  appearance: none;
  border: 1px solid rgba(229, 178, 92, 0.35);
  background: rgba(8, 14, 20, 0.4);
  color: rgba(242, 230, 207, 0.8);
  font: inherit;
  font-size: 12px;
  letter-spacing: 0.16em;
  padding: 9px 15px;
  border-radius: 2px;
  cursor: pointer;
  transition: border-color 0.25s, color 0.25s, background 0.25s;
}
.ghost:hover { border-color: rgba(229, 178, 92, 0.8); color: var(--gold2); background: rgba(12, 20, 28, 0.7); }

/* ---------- 遮罩 / 大播放键 ---------- */
#veil {
  position: absolute;
  inset: 0;
  background: radial-gradient(ellipse at center, rgba(3, 7, 11, 0.12) 0%, rgba(3, 7, 11, 0.42) 100%);
  pointer-events: none;
  transition: opacity 0.6s ease;
}
#veil.hidden { opacity: 0; }

.big-play {
  position: absolute;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  background: none;
  border: 0;
  color: var(--cream);
  cursor: pointer;
  letter-spacing: 0.34em;
  font-size: 11px;
  transition: opacity 0.45s ease, transform 0.45s ease;
}
.big-play svg { width: clamp(64px, 7vw, 96px); height: auto; overflow: visible; }
.big-play circle {
  fill: rgba(8, 14, 20, 0.45);
  stroke: rgba(229, 178, 92, 0.8);
  stroke-width: 1.1;
  transition: fill 0.3s, stroke 0.3s;
}
.big-play path { fill: var(--gold2); transform: translateX(2px); }
.big-play:hover circle { fill: rgba(229, 178, 92, 0.16); stroke: var(--gold2); }
.big-play:hover { transform: scale(1.04); }
.big-play.hidden { opacity: 0; pointer-events: none; transform: scale(0.94); }

/* ---------- 控制栏 ---------- */
.controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  gap: clamp(10px, 1.4vw, 20px);
  padding: clamp(18px, 2.6vw, 40px) clamp(18px, 3vw, 46px) clamp(14px, 2vw, 28px);
  background: linear-gradient(to top, rgba(3, 7, 11, 0.92), rgba(3, 7, 11, 0));
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.4s ease, transform 0.4s ease;
}
body.ui-awake .controls,
body:not(.is-playing) .controls { opacity: 1; transform: none; }

.icon {
  appearance: none;
  border: 0;
  background: none;
  color: rgba(242, 230, 207, 0.85);
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  cursor: pointer;
  border-radius: 50%;
  transition: color 0.2s, background 0.2s;
  flex: 0 0 auto;
}
.icon:hover { color: var(--gold2); background: rgba(229, 178, 92, 0.1); }
.icon svg { width: 20px; height: 20px; fill: currentColor; }
.icon .i-pause, .icon .i-mute { display: none; }
.icon.is-playing .i-play { display: none; }
.icon.is-playing .i-pause { display: block; }
.icon.muted .i-sound { display: none; }
.icon.muted .i-mute { display: block; }

.bar {
  position: relative;
  flex: 1 1 auto;
  height: 22px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}
.bar::before {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  height: 3px;
  background: rgba(242, 230, 207, 0.18);
  border-radius: 2px;
  transition: height 0.2s;
}
.bar:hover::before { height: 5px; }
.fill {
  position: absolute;
  left: 0;
  height: 3px;
  width: 0;
  background: linear-gradient(90deg, rgba(229, 178, 92, 0.55), var(--gold2));
  border-radius: 2px;
  transition: height 0.2s;
  pointer-events: none;
}
.bar:hover .fill { height: 5px; }
.marks { position: absolute; inset: 0; pointer-events: none; }
.marks i {
  position: absolute;
  top: 50%;
  width: 1px;
  height: 9px;
  margin-top: -4.5px;
  background: rgba(3, 7, 11, 0.85);
  box-shadow: 0 0 0 1px rgba(3, 7, 11, 0.3);
}
.time {
  flex: 0 0 auto;
  font-variant-numeric: tabular-nums;
  font-size: 11px;
  letter-spacing: 0.12em;
  color: rgba(242, 230, 207, 0.5);
  min-width: 92px;
  text-align: right;
}

.hint {
  position: absolute;
  bottom: clamp(58px, 6.4vw, 92px);
  left: 50%;
  transform: translateX(-50%) translateY(6px);
  font-size: 11px;
  letter-spacing: 0.18em;
  color: rgba(242, 230, 207, 0.32);
  white-space: nowrap;
  opacity: 0;
  transition: opacity 0.8s ease, transform 0.8s ease;
  pointer-events: none;
}
.hint.show { opacity: 1; transform: translateX(-50%) translateY(0); }
body.is-playing .hint { opacity: 0; }

/* ---------- 关于 ---------- */
.about {
  position: fixed;
  inset: 0;
  z-index: 20;
  display: grid;
  place-items: center;
  padding: 22px;
  background: rgba(2, 5, 8, 0.78);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
}
.about[hidden] { display: none; }
.about-card {
  position: relative;
  width: min(760px, 100%);
  max-height: 86vh;
  overflow: auto;
  padding: clamp(26px, 4vw, 54px);
  background: linear-gradient(160deg, rgba(18, 28, 36, 0.96), rgba(8, 13, 18, 0.98));
  border: 1px solid rgba(229, 178, 92, 0.28);
  box-shadow: 0 40px 120px rgba(0, 0, 0, 0.6);
}
.about-close { position: absolute; top: 16px; right: 16px; color: rgba(242, 230, 207, 0.6); }
.kicker { margin: 0 0 16px; font-size: 10px; letter-spacing: 0.4em; color: var(--gold); }
.about h1 {
  margin: 0 0 18px;
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
  font-weight: 500;
  font-size: clamp(24px, 2.6vw, 36px);
  letter-spacing: 0.04em;
  color: var(--cream);
}
.lede { margin: 0 0 26px; font-size: 14px; line-height: 2; color: rgba(242, 230, 207, 0.72); }
.about dl { margin: 0 0 24px; border-top: 1px solid rgba(229, 178, 92, 0.18); }
.about dl > div {
  display: grid;
  grid-template-columns: 62px 1fr;
  gap: 18px;
  padding: 14px 0;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
}
.about dt { font-size: 11px; letter-spacing: 0.2em; color: var(--gold); padding-top: 2px; }
.about dd { margin: 0; font-size: 13px; line-height: 1.8; color: rgba(242, 230, 207, 0.7); }
.fine { margin: 0; font-size: 11px; line-height: 1.9; color: rgba(242, 230, 207, 0.38); }

/* ---------- 导出模式 ---------- */
body.render-mode #stage { display: block; }
body.render-mode #film { width: 1920px; height: 1080px; }
body.render-mode .topbar,
body.render-mode .controls,
body.render-mode #veil,
body.render-mode #bigPlay,
body.render-mode .hint,
body.render-mode .about { display: none !important; }

@media (max-width: 700px) {
  .time { display: none; }
  .brand-en { display: none; }
  .hint { display: none; }
  .controls { gap: 8px; padding-bottom: 12px; }
  .icon { width: 34px; height: 34px; }
  .big-play span { letter-spacing: 0.24em; }
}
