:root {
  color-scheme: dark;
  font-family: "Microsoft YaHei UI", "Segoe UI", sans-serif;
  --bg: #0c0f0f;
  --panel: #121616;
  --surface: #191e1e;
  --line: #293130;
  --text: #f1f5f3;
  --muted: #89938f;
  --green: #3ddc97;
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; min-width: 320px; min-height: 100%; background: var(--bg); color: var(--text); }
button, input { font: inherit; }
button { color: inherit; }

.topbar {
  height: 68px;
  padding: 0 28px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--line);
  background: #101313;
}
.brand { display: flex; align-items: center; gap: 11px; }
.brand-mark { width: 34px; height: 34px; display: grid; place-items: center; border-radius: 6px; background: var(--green); color: #07130e; font-weight: 900; }
.brand div { display: grid; gap: 2px; }
.brand strong { font-size: 15px; }
.brand div span { color: var(--muted); font-size: 9px; letter-spacing: 1.2px; }
.status { display: flex; align-items: center; gap: 8px; color: #a9b4b0; font-size: 11px; }
.status i { width: 7px; height: 7px; border-radius: 50%; background: var(--green); box-shadow: 0 0 0 4px rgba(61,220,151,.12); }

.layout { min-height: calc(100vh - 68px); display: block; }
.playlist { min-width: 0; padding: 27px 19px; border-right: 1px solid var(--line); background: var(--panel); }
.playlist-heading { display: flex; align-items: center; justify-content: space-between; padding: 0 2px 17px; border-bottom: 1px solid var(--line); }
.playlist-heading p, .video-heading p { margin: 0 0 5px; color: var(--green); font-size: 9px; font-weight: 800; letter-spacing: 1.3px; }
.playlist-heading h1 { margin: 0; font-size: 21px; letter-spacing: 0; }
.playlist-heading > span { min-width: 28px; height: 24px; padding: 0 8px; display: grid; place-items: center; border: 1px solid var(--line); border-radius: 5px; color: var(--muted); font-size: 11px; }
.video-list { display: grid; gap: 7px; margin-top: 12px; max-height: calc(100vh - 160px); overflow-y: auto; }
.video-item { width: 100%; min-width: 0; display: grid; grid-template-columns: 42px minmax(0, 1fr); align-items: center; gap: 10px; padding: 8px; border: 1px solid transparent; border-radius: 6px; background: transparent; text-align: left; cursor: pointer; }
.video-item:hover { background: #191e1e; }
.video-item.active { border-color: #326b53; background: #17241e; }
.video-icon { width: 42px; height: 34px; display: grid; place-items: center; border-radius: 4px; background: #282e2d; color: #aeb8b4; font-size: 11px; }
.video-copy { min-width: 0; display: grid; gap: 4px; }
.video-copy strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 11px; letter-spacing: 0; }
.video-copy span { color: var(--muted); font-size: 9px; }
.empty-list { padding-top: 58px; display: grid; justify-items: center; gap: 9px; color: var(--muted); }
.empty-list > span { font-size: 25px; color: #505a57; }
.empty-list strong { font-size: 11px; font-weight: 500; }

.viewer { min-width: 0; min-height: calc(100vh - 68px); padding: 36px; display: grid; place-items: center; }
.empty-viewer { display: grid; justify-items: center; gap: 16px; color: var(--muted); }
.empty-viewer > span { width: 66px; height: 66px; padding-left: 4px; display: grid; place-items: center; border: 1px solid #34413c; border-radius: 50%; color: var(--green); background: #141a17; }
.empty-viewer h2 { margin: 0; font-size: 15px; font-weight: 600; }
.player-view { width: min(1050px, 100%); }
.video-heading { margin-bottom: 18px; }
.video-heading h2 { margin: 0; overflow-wrap: anywhere; font-size: 20px; letter-spacing: 0; }
.player-shell { position: relative; width: 100%; aspect-ratio: 16 / 9; overflow: hidden; border: 1px solid #252c2a; border-radius: 7px; background: #040606; }
#player { width: 100%; height: 100%; display: block; object-fit: contain; background: #040606; }
.gesture-layer { position: absolute; inset: 0; z-index: 1; touch-action: manipulation; }
.fullscreen-info { position: absolute; z-index: 4; left: 20px; top: 18px; max-width: calc(100% - 40px); display: flex; align-items: baseline; gap: 10px; padding: 10px 13px; background: rgba(5,8,7,.72); opacity: 0; transform: translateY(-8px); pointer-events: none; transition: .18s; }
.fullscreen-info.show { opacity: 1; transform: translateY(0); }
.fullscreen-info span { color: #d8dfdc; font-size: 13px; font-weight: 600; white-space: nowrap; }
.fullscreen-info strong { overflow-wrap: anywhere; font-size: 17px; letter-spacing: 0; }
.center-play { position: absolute; z-index: 4; left: 50%; top: calc(50% - 24px); width: 64px; height: 64px; padding: 0 0 0 4px; transform: translate(-50%, -50%); border: 1px solid rgba(255,255,255,.36); border-radius: 50%; background: rgba(10,12,12,.84); color: white; box-shadow: 0 8px 24px rgba(0,0,0,.32); font-size: 22px; cursor: pointer; transition: opacity .15s, transform .15s; -webkit-tap-highlight-color: transparent; }
.center-play:active { transform: translate(-50%, -50%) scale(.96); }
.center-play.playing { opacity: 0; pointer-events: none; }
.loading { position: absolute; z-index: 2; inset: 0 0 55px; display: grid; place-items: center; padding-top: 92px; pointer-events: none; background: #080a0a; color: var(--muted); font-size: 11px; }
.controls { position: absolute; z-index: 6; left: 0; right: 0; bottom: 0; height: 55px; padding: 0 14px; display: flex; align-items: center; gap: 8px; border-top: 1px solid #272e2c; background: rgba(13,16,15,.96); }
.control-button { position: relative; width: 31px; height: 32px; flex: 0 0 31px; padding: 0; border: 0; background: transparent; cursor: pointer; font-size: 13px; }
.control-button:hover { color: var(--green); }
.fullscreen-button { display: none; font-size: 18px; line-height: 1; }
.player-shell:fullscreen, .player-shell:-webkit-full-screen { width: 100vw; height: 100vh; border: 0; border-radius: 0; }
.player-shell:fullscreen .fullscreen-button, .player-shell:-webkit-full-screen .fullscreen-button { display: block; }
.player-shell.fullscreen-active .gesture-layer { z-index: 5; }
.player-shell.fullscreen-active .center-play { display: none; }
.player-shell.fullscreen-active .controls { opacity: 0; transform: translateY(100%); pointer-events: none; transition: opacity .2s, transform .2s; }
.player-shell.fullscreen-active.fullscreen-ui-visible .controls { opacity: 1; transform: translateY(0); pointer-events: auto; }
.time { width: 40px; flex: 0 0 40px; color: #adb7b3; font: 10px Consolas, monospace; text-align: center; }
.timeline-shell { position: relative; min-width: 70px; height: 28px; flex: 1; display: flex; align-items: center; }
.timeline-base, .watched-bar, .played-bar { position: absolute; left: 0; height: 3px; border-radius: 3px; pointer-events: none; }
.timeline-base { right: 0; background: #333a38; }
.watched-bar { width: 0; background: #376b54; }
.played-bar { width: 0; background: var(--green); }
#timeline { position: relative; z-index: 2; width: 100%; height: 28px; margin: 0; opacity: 0; cursor: pointer; }
.rate { padding: 3px 6px; border-radius: 4px; background: #242a28; color: #aab4b0; font-size: 9px; }
.seek-notice { height: 0; margin-top: 0; overflow: hidden; padding: 0 12px; border: 1px solid transparent; border-radius: 5px; opacity: 0; background: #332b1c; color: #f0d18c; font-size: 10px; transition: .2s; }
.seek-notice.show { height: 34px; margin-top: 8px; padding: 9px 12px; border-color: #594829; opacity: 1; }
.toast { position: fixed; right: 20px; bottom: 20px; max-width: 320px; padding: 11px 14px; border-radius: 5px; background: #ffe8e4; color: #481712; box-shadow: 0 12px 30px rgba(0,0,0,.32); font-size: 11px; opacity: 0; transform: translateY(10px); pointer-events: none; transition: .2s; }
.toast.show { opacity: 1; transform: translateY(0); }

@media (max-width: 720px) {
  .topbar { padding: 0 16px; }
  .layout { grid-template-columns: 1fr; }
  .viewer { padding: 24px 13px 36px; place-items: start center; }
  .video-heading h2 { font-size: 16px; }
  .controls { padding: 0 7px; gap: 4px; }
  .time { width: 34px; flex-basis: 34px; font-size: 9px; }
  .rate { display: none; }
  .fullscreen-button { display: block; }
}
