:root {
  color-scheme: dark;
  --bg: #111217;
  --panel: #181a22;
  --border: #2c2e39;
  --text: #f4f3f8;
  --subtle: #aeafbd;
  --accent: #bdadff;
  font: 1rem/1.55 "DM Sans", system-ui, -apple-system, "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
}
* { box-sizing: border-box; }
body { margin: 0; }
[hidden] { display: none !important; }
.theater { width: min(100% - 3rem, 70rem); margin: 0 auto 3rem; }
.top, .sync { display: flex; align-items: center; justify-content: space-between; gap: 1rem; }
.top { justify-content: flex-end; padding: 1.25rem 0 .65rem; }
h2, p { margin: 0; }
h2 { font-size: 1.025rem; }
.signal { color: var(--subtle); font-size: .875rem; display: flex; align-items: center; gap: .5rem; }
#signal-dot { width: .48rem; height: .48rem; background: #77798a; border-radius: 50%; }
#signal-dot.active { background: #a2dfb5; box-shadow: 0 0 .75rem #a2dfb555; }
.player { background: #09090d; border: 1px solid var(--border); border-radius: 1rem; overflow: hidden; }
.screen { display: grid; place-items: center; aspect-ratio: 16 / 9; position: relative; max-height: 67vh; }
video { display: block; width: 100%; height: 100%; position: absolute; inset: 0; object-fit: contain; }
.empty { display: grid; justify-items: center; gap: .85rem; color: #dbd9e4; position: relative; text-align: center; padding: 1.25rem; }
.screen-icon { width: 3.65rem; height: 3.65rem; display: grid; place-items: center; color: var(--accent); border: 1px solid #51476e; border-radius: 50%; background: #211b30; }
.screen-icon span { padding-left: .2rem; }
.control-bar { background: #14151b; padding: .6rem .9rem .55rem; }
.timeline, .controls, .volume { display: flex; align-items: center; gap: .6rem; }
.timeline { margin-bottom: .35rem; }
input[type=range] { accent-color: var(--accent); min-width: 0; }
#seek { flex: 1; margin: 0; }
.volume input { width: clamp(2.3rem, 10vw, 5.5rem); }
.spacer { flex: 1; }
button, select { border: 0; border-radius: .55rem; font: inherit; color: inherit; background: transparent; cursor: pointer; min-height: 2.45rem; }
button { padding: 0 .7rem; }
button:hover:enabled, select:hover:enabled { background: #272630; }
button:disabled, select:disabled, input:disabled { cursor: default; opacity: .55; }
button:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
.live { color: #f2adad; font-weight: 650; font-size: .85rem; }
.live::before { content: "●"; margin-right: .32rem; font-size: .66rem; }
.live.behind { color: var(--subtle); }
.quality { position: relative; }
.quality::after { content: ""; position: absolute; top: 45%; right: .7rem; width: .38rem; height: .38rem; border: solid var(--subtle); border-width: 0 1.5px 1.5px 0; transform: rotate(45deg); pointer-events: none; }
select { appearance: none; background: #20212b; padding: 0 1.7rem 0 .65rem; font-size: .875rem; }
.expand-icon { display: block; width: 1rem; height: 1rem; border: 1.5px solid currentColor; position: relative; }
.expand-icon::after, .expand-icon::before { content: ""; position: absolute; inset: -2px 4px; background: #14151b; }
.expand-icon::before { inset: 4px -2px; }
.sync { margin-top: 1rem; padding: .95rem 1.15rem; border: 1px solid var(--border); background: var(--panel); border-radius: .85rem; }
.sync p, .notice { color: var(--subtle); font-size: .875rem; }
.accent { color: #181329; background: var(--accent); font-weight: 650; white-space: nowrap; }
.accent:hover:enabled { color: #181329; background: #d2c7ff; }
.accent[aria-pressed=true] { color: #e1d9ff; background: #34294e; }
.notice { margin-top: .7rem; }
.player.full-view { position: relative; width: 100%; height: 100%; background: #000; border: 0; border-radius: 0; }
.player::backdrop { background: #000; }
.full-view .screen { width: 100%; height: 100%; max-height: none; aspect-ratio: auto; touch-action: manipulation; }
.full-view .screen:focus { outline: 0; }
.full-view .empty { display: none; }
.full-view .control-bar {
  position: absolute;
  inset: auto 0 0;
  padding: 1rem max(1rem, env(safe-area-inset-right)) max(.75rem, env(safe-area-inset-bottom)) max(1rem, env(safe-area-inset-left));
  background: linear-gradient(transparent, #000d 60%, #000f);
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
  transition: opacity .16s ease;
}
.full-view.tools-visible .control-bar { opacity: 1; visibility: visible; pointer-events: auto; }
.full-view .controls { gap: .45rem; }
body.immersive { overflow: hidden; }
.immersive .player.full-view { position: fixed; inset: 0; z-index: 1; }
@media (prefers-reduced-motion: reduce) {
  .full-view .control-bar { transition: none; }
}
@media (max-width: 600px), (max-height: 500px) and (pointer: coarse) {
  .theater { width: 100%; }
  .top, .control-bar, .sync, .notice {
    padding-left: max(.75rem, env(safe-area-inset-left));
    padding-right: max(.75rem, env(safe-area-inset-right));
  }
  .top { padding-top: max(.75rem, env(safe-area-inset-top)); }
  .player { border-inline: 0; border-radius: 0; }
  .sync { padding-block: .8rem; gap: .6rem; border-inline: 0; border-radius: 0; }
}
@media (pointer: coarse) {
  button, select { min-height: 44px; }
  button { min-width: 44px; }
  #seek { height: 36px; }
  .volume input { display: none; }
}
