:root {
  --bg: #1f2326;
  --bg-2: #282a2d;
  --bg-3: #353a3e;
  --bg-4: #3f4245;
  --text: #eeeeee;
  --muted: #a3a9ad;
  --faint: #6d7377;
  --accent: #e5a00d;
  --accent-ink: #1a1500;
  --error: #ff7b7b;
  --radius: 10px;
  --sidebar-w: 240px;
  --player-h: 92px;
  --shadow: 0 10px 30px rgba(0,0,0,.45);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; }
input, textarea, pre, code, video::cue { -webkit-user-select: text; user-select: text; }
a, button, input[type=range], .card-item, .ch, .ep, .poster, .drop, .seasons button, .vp, .vp * { -webkit-touch-callout: none; touch-action: manipulation; }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
button:focus-visible, a:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }
img, svg { -webkit-user-drag: none; user-drag: none; pointer-events: inherit; }
.poster img, .mthumb img, .p-cover, .hero .cover img { pointer-events: none; }
html, body { margin: 0; height: 100%; }
body {
  font-family: system-ui, -apple-system, "Segoe UI", Roboto, "Helvetica Neue", sans-serif;
  background: var(--bg); color: var(--text);
  -webkit-font-smoothing: antialiased;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }
svg { width: 22px; height: 22px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
img { display: block; }
[hidden] { display: none !important; }
::selection { background: var(--accent); color: var(--accent-ink); }

/* ---------- brand ---------- */
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; font-size: 1.25rem; letter-spacing: .01em; }
.brand-mark { width: 22px; height: 24px; background: var(--accent); flex: 0 0 auto;
  clip-path: polygon(8% 2%, 100% 50%, 8% 98%); }
.brand { white-space: nowrap; }

/* ---------- gate ---------- */
body.gate { display: flex; flex-direction: column; align-items: center; justify-content: center; min-height: 100dvh; padding: 24px 16px; background: var(--bg); }
.gate-screen { width: 100%; max-width: 380px; display: flex; flex-direction: column; align-items: center; gap: 28px; animation: rise .45s ease-out both; }
.gate-brand { display: flex; flex-direction: column; align-items: center; text-align: center; gap: 6px; }
.gate-brand .brand-mark.big { width: 56px; height: 60px; margin-bottom: 10px; }
.gate-brand h1 { margin: 0; font-size: 1.7rem; font-weight: 700; letter-spacing: .01em; }
.gate-brand p { margin: 0; color: var(--muted); }
.gate-form { width: 100%; }
.code-row { display: flex; gap: 10px; align-items: stretch; }
.code-row input[type=password] { flex: 1; min-width: 0; height: 56px; padding: 0 18px; font-size: 1.15rem; letter-spacing: .18em; color: var(--text);
  background: var(--bg-2); border: 1px solid var(--bg-4); border-radius: 12px; outline: none; transition: border-color .15s, box-shadow .15s; }
.code-row input[type=password]::placeholder { letter-spacing: 0; color: var(--faint); }
.code-row input[type=password]:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(229,160,13,.2); }
.code-row input.shake { animation: shake .35s; border-color: var(--error); }
.enter-btn { flex: 0 0 56px; width: 56px; height: 56px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; transition: filter .15s, transform .1s; }
.enter-btn svg { width: 26px; height: 26px; stroke-width: 2.5; }
.enter-btn:hover { filter: brightness(1.08); }
.enter-btn:active { transform: scale(.96); }
.gate .error { color: var(--error); font-size: .95rem; min-height: 1.3em; margin: 12px 0 0; text-align: center; }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: none; } }
@keyframes shake { 0%,100% { transform: translateX(0); } 20%,60% { transform: translateX(-6px); } 40%,80% { transform: translateX(6px); } }

/* ---------- buttons ---------- */
.btn { display: inline-flex; align-items: center; gap: 8px; padding: 11px 18px; border-radius: var(--radius);
  font-weight: 600; background: var(--bg-4); transition: filter .15s, transform .1s; }
.btn:hover { filter: brightness(1.12); }
.btn:active { transform: scale(.98); }
.btn.primary { background: var(--accent); color: var(--accent-ink); }
.btn.primary svg { fill: currentColor; stroke: none; }
.btn.ghost { background: transparent; border: 1px solid var(--bg-4); color: var(--muted); }
.icon-btn { display: inline-grid; place-items: center; width: 40px; height: 40px; border-radius: 50%; color: var(--muted); transition: background .15s, color .15s; }
.icon-btn:hover { background: rgba(255,255,255,.08); color: var(--text); }
.pill { padding: 5px 10px; border-radius: 999px; background: var(--bg-4); font-size: .8rem; font-weight: 600; color: var(--muted); min-width: 44px; }
.pill:hover { color: var(--text); }

/* ---------- layout ---------- */
.app-body { overflow: hidden; }
.app { display: flex; height: 100dvh; }
.app-body.has-player .app { height: calc(100dvh - var(--player-h)); }

.sidebar { width: var(--sidebar-w); flex: 0 0 auto; background: var(--bg-2); display: flex; flex-direction: column; padding: 20px 14px; gap: 10px; border-right: 1px solid rgba(0,0,0,.3); }
.sidebar .brand { padding: 6px 10px 18px; font-size: 1.15rem; }
.nav { display: flex; flex-direction: column; gap: 2px; flex: 1; }
.nav-label { font-size: .7rem; text-transform: uppercase; letter-spacing: .12em; color: var(--faint); padding: 18px 12px 6px; }
.nav a, .nav-btn { display: flex; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; color: var(--muted); font-weight: 500; width: 100%; text-align: left; }
.nav a:hover, .nav-btn:hover { background: rgba(255,255,255,.06); color: var(--text); }
.nav a.active { background: var(--bg-4); color: var(--text); }
.nav a.active svg { color: var(--accent); }
.nav-footer { margin: 0; }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; gap: 12px; padding: 14px 28px; }
.menu-btn { display: none; }
.search { position: relative; flex: 1; max-width: 420px; }
.search svg { position: absolute; left: 12px; top: 50%; transform: translateY(-50%); width: 18px; height: 18px; color: var(--faint); }
.search input { width: 100%; padding: 10px 12px 10px 40px; border-radius: 999px; background: var(--bg-2); border: 1px solid transparent; color: var(--text); font-size: .95rem; outline: none; }
.search input:focus { border-color: var(--bg-4); background: var(--bg-3); outline: none; }
.view { flex: 1; overflow-y: auto; padding: 8px 28px 40px; scroll-behavior: smooth; }

/* ---------- sections / grids ---------- */
h1.page { font-size: 1.7rem; margin: 10px 0 20px; font-weight: 700; display: flex; align-items: center; gap: 12px; }
h1.page svg { width: 26px; height: 26px; color: var(--accent); flex: 0 0 auto; }
.section-head h2 svg { width: 20px; height: 20px; color: var(--accent); vertical-align: -4px; margin-right: 8px; }
.section { margin-bottom: 36px; }
.section-head { display: flex; align-items: baseline; justify-content: space-between; margin-bottom: 12px; }
.section-head h2 { font-size: 1.15rem; margin: 0; font-weight: 650; }
.section-head a { color: var(--muted); font-size: .9rem; }
.section-head a:hover { color: var(--accent); }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 22px 18px; }
.row { display: grid; grid-auto-flow: column; grid-auto-columns: 160px; gap: 18px; overflow-x: auto; padding-bottom: 8px; scrollbar-width: thin; }

.card-item { display: block; cursor: pointer; }
.poster { position: relative; aspect-ratio: 1; border-radius: var(--radius); overflow: hidden; background: var(--bg-3); box-shadow: 0 4px 14px rgba(0,0,0,.35); transition: transform .18s, box-shadow .18s; }
.poster img { width: 100%; height: 100%; object-fit: cover; }
.poster .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--faint); }
.poster .ph svg { width: 44px; height: 44px; }
.poster .play-ov { position: absolute; inset: 0; display: grid; place-items: center; background: rgba(0,0,0,.35); opacity: 0; transition: opacity .18s; pointer-events: none; }
.poster .play-ov span { pointer-events: auto; width: 54px; height: 54px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; transition: transform .12s; }
.poster .play-ov span:hover { transform: scale(1.08); }
.poster .play-ov svg { fill: currentColor; stroke: none; width: 26px; height: 26px; margin-left: 3px; }
.card-item:hover .poster { transform: translateY(-3px) scale(1.02); box-shadow: var(--shadow); }
.card-item:hover .play-ov { opacity: 1; }
.poster .prog { position: absolute; left: 0; right: 0; bottom: 0; height: 4px; background: rgba(0,0,0,.5); }
.poster .prog i { display: block; height: 100%; background: var(--accent); }
.poster .done { position: absolute; top: 8px; right: 8px; width: 24px; height: 24px; border-radius: 50%; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center; }
.poster .done svg { width: 14px; height: 14px; stroke-width: 3; }
.card-title { margin: 10px 0 2px; font-weight: 600; font-size: .95rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-sub { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.empty { border: 1px dashed var(--bg-4); border-radius: 14px; padding: 40px 24px; text-align: center; color: var(--muted); }
.empty svg { width: 42px; height: 42px; color: var(--faint); margin-bottom: 10px; }
.empty h3 { margin: 0 0 6px; color: var(--text); }
.empty p { margin: 0; }
.empty code { background: var(--bg-2); padding: 2px 7px; border-radius: 5px; font-size: .9em; }
.loading { color: var(--muted); padding: 40px; text-align: center; }

/* ---------- detail ---------- */
.detail { position: relative; margin: -8px -28px 0; padding: 28px 28px 10px; overflow: hidden; }
.detail .bgart { position: absolute; inset: -40px; background-size: cover; background-position: center; filter: blur(40px) saturate(1.2); opacity: .35; z-index: 0; }
.detail .bgfade { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(31,35,38,.1) 0%, var(--bg) 100%); z-index: 0; }
.detail .inner { position: relative; z-index: 1; }
.back { display: inline-flex; align-items: center; gap: 4px; color: var(--muted); font-size: .9rem; margin-bottom: 18px; }
.back:hover { color: var(--text); }
.back svg { width: 18px; height: 18px; }
.hero { display: flex; gap: 30px; align-items: flex-end; }
.hero .cover { width: 240px; flex: 0 0 auto; aspect-ratio: 1; border-radius: 12px; overflow: hidden; background: var(--bg-3); box-shadow: var(--shadow); }
.hero .cover img { width: 100%; height: 100%; object-fit: cover; }
.hero .info { min-width: 0; }
.hero h1 { font-size: 2.3rem; margin: 0 0 6px; line-height: 1.1; }
.hero .by { font-size: 1.1rem; color: var(--muted); margin-bottom: 14px; }
.hero .by b { color: var(--text); font-weight: 600; }
.chips { display: flex; flex-wrap: wrap; gap: 8px 16px; color: var(--muted); font-size: .9rem; margin-bottom: 20px; }
.chips span { display: inline-flex; align-items: center; gap: 6px; }
.chips svg { width: 16px; height: 16px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; }
.resume-prog { display: flex; align-items: center; gap: 10px; color: var(--muted); font-size: .9rem; }
.resume-prog .bar { width: 160px; height: 5px; border-radius: 3px; background: var(--bg-4); overflow: hidden; }
.resume-prog.full { flex-basis: 100%; width: 100%; max-width: 560px; margin-top: 4px; }
.resume-prog.full .bar { flex: 1; width: auto; }
.resume-prog.full span { white-space: nowrap; }
.btn.primary { min-width: 128px; justify-content: center; }
.resume-prog .bar i { display: block; height: 100%; background: var(--accent); }

.desc { max-width: 820px; color: var(--muted); line-height: 1.6; margin: 24px 0 0; }
.desc.clamp { display: -webkit-box; -webkit-line-clamp: 4; -webkit-box-orient: vertical; overflow: hidden; }
.desc-toggle { color: var(--accent); font-weight: 600; font-size: .9rem; margin-top: 6px; }

.chapters { margin-top: 28px; }
.chapters h2 { font-size: 1.15rem; margin: 0 0 10px; display: flex; justify-content: space-between; align-items: baseline; }
.chapters h2 small { color: var(--muted); font-weight: 400; font-size: .9rem; }
.ch { display: grid; grid-template-columns: 40px 1fr auto; align-items: center; gap: 12px; padding: 10px 12px; border-radius: 8px; cursor: pointer; color: var(--text); }
.ch:hover { background: rgba(255,255,255,.05); }
.ch .n { color: var(--faint); font-variant-numeric: tabular-nums; text-align: center; }
.ch .t { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ch .d { color: var(--muted); font-variant-numeric: tabular-nums; font-size: .9rem; }
.ch.current { background: rgba(229,160,13,.12); }
.ch.current .t { color: var(--accent); font-weight: 600; }
.ch.played .t { color: var(--muted); }
.ch .n svg { width: 18px; height: 18px; fill: var(--accent); stroke: none; display: none; }
.ch:hover .n span { display: none; }
.ch:hover .n svg { display: inline; }
.ch .eq { display: none; align-items: flex-end; gap: 2px; height: 16px; justify-content: center; }
.ch .eq i { width: 3px; background: var(--accent); animation: eq .9s ease-in-out infinite; }
.ch .eq i:nth-child(2) { animation-delay: .2s; } .ch .eq i:nth-child(3) { animation-delay: .4s; }
.ch.current.playing .n span, .ch.current.playing .n svg { display: none; }
.ch.current.playing .n .eq { display: flex; }
.ch.current.playing:hover .n .eq { display: none; }
.ch.current.playing:hover .n svg { display: inline; }
@keyframes eq { 0%,100% { height: 4px; } 50% { height: 16px; } }

/* ---------- player ---------- */
.player { position: fixed; left: 0; right: 0; bottom: 0; height: var(--player-h); background: var(--bg-2); border-top: 1px solid rgba(0,0,0,.4);
  display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 2fr) minmax(0, 1fr); align-items: center; gap: 16px; padding: 0 20px; z-index: 50;
  box-shadow: 0 -8px 30px rgba(0,0,0,.35); }
.player[hidden] { display: none; }
.p-now { display: flex; align-items: center; gap: 12px; min-width: 0; }
.p-cover { width: 60px; height: 60px; border-radius: 6px; object-fit: cover; background: var(--bg-3); flex: 0 0 auto; }
.p-meta { min-width: 0; }
.p-title { display: block; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-title:hover { color: var(--accent); }
.p-sub { color: var(--muted); font-size: .85rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.p-center { display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.p-controls { display: flex; align-items: center; gap: 6px; }
.p-controls .icon-btn.big { width: 48px; height: 48px; background: var(--text); color: var(--bg); }
.p-controls .icon-btn.big:hover { background: #fff; transform: scale(1.04); }
.p-controls .icon-btn.big svg { fill: currentColor; stroke: none; width: 24px; height: 24px; }
.p-controls .skip { position: relative; }
.p-controls .skip b { position: absolute; font-size: .55rem; top: 50%; left: 50%; transform: translate(-50%, -40%); font-weight: 700; letter-spacing: -.02em; }
.p-controls .skip svg { width: 26px; height: 26px; }
.p-controls svg { fill: currentColor; stroke: none; }
.p-controls #btnBack svg, .p-controls #btnFwd svg { fill: none; stroke: currentColor; }
.p-scrub { display: flex; align-items: center; gap: 10px; width: 100%; max-width: 640px; color: var(--muted); font-size: .8rem; font-variant-numeric: tabular-nums; }
.p-right { display: flex; align-items: center; justify-content: flex-end; gap: 10px; min-width: 0; }
.p-remaining { color: var(--muted); font-size: .8rem; white-space: nowrap; }

input[type=range] { -webkit-appearance: none; appearance: none; height: 4px; border-radius: 2px; background: var(--bg-4); outline: none; cursor: pointer; }
input[type=range]#seek { flex: 1; background: linear-gradient(90deg, var(--accent) var(--pct, 0%), var(--bg-4) var(--pct, 0%)); }
input[type=range]#vol { width: 90px; background: linear-gradient(90deg, var(--muted) var(--pct, 100%), var(--bg-4) var(--pct, 100%)); }
input[type=range]::-webkit-slider-thumb { -webkit-appearance: none; width: 14px; height: 14px; border-radius: 50%; background: var(--text); opacity: 0; transition: opacity .15s; }
input[type=range]::-moz-range-thumb { width: 14px; height: 14px; border: 0; border-radius: 50%; background: var(--text); opacity: 0; transition: opacity .15s; }
input[type=range]:hover::-webkit-slider-thumb, input[type=range]:active::-webkit-slider-thumb { opacity: 1; }
input[type=range]:hover::-moz-range-thumb, input[type=range]:active::-moz-range-thumb { opacity: 1; }

/* ---------- responsive ---------- */
@media (max-width: 860px) {
  :root { --player-h: 128px; }
  .sidebar { position: fixed; inset: 0 auto 0 0; z-index: 60; transform: translateX(-100%); transition: transform .22s ease; box-shadow: var(--shadow); }
  .sidebar.open { transform: none; }
  .scrim { position: fixed; inset: 0; background: rgba(0,0,0,.5); z-index: 55; }
  .menu-btn { display: inline-grid; }
  .topbar { padding: 12px 16px; }
  .view { padding: 4px 16px 32px; }
  .detail { margin: -4px -16px 0; padding: 20px 16px 10px; }
  .hero { flex-direction: column; align-items: flex-start; gap: 18px; }
  .hero .cover { width: 180px; }
  .hero h1 { font-size: 1.7rem; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 16px 12px; }
  .row { grid-auto-columns: 130px; gap: 12px; }
  .player { grid-template-columns: 1fr 1fr; grid-template-rows: auto auto; padding: 10px 14px; gap: 6px 10px; }
  .p-now { grid-column: 1; grid-row: 1; }
  .p-right { grid-column: 2; grid-row: 1; }
  .p-center { grid-column: 1 / -1; grid-row: 2; }
  .p-cover { width: 44px; height: 44px; }
  input[type=range]#vol { display: none; }
  #btnMute { display: none; }
}

/* ---------- movies ---------- */
.poster.portrait { aspect-ratio: 2 / 3; }
.poster.wide { aspect-ratio: 16 / 9; }
.row.wide { grid-auto-columns: 280px; }
.badge { position: absolute; top: 8px; left: 8px; padding: 3px 7px; border-radius: 5px; font-size: .7rem; font-weight: 700; letter-spacing: .04em; background: rgba(0,0,0,.65); color: var(--text); }
.badge.warn { background: #7a4a00; color: #ffe2b0; display: inline-flex; align-items: center; gap: 4px; }
.badge.warn svg { width: 12px; height: 12px; }
.hero .cover.portrait { width: 220px; aspect-ratio: 2 / 3; }
.hero .cover.wide { width: 360px; aspect-ratio: 16 / 9; }
.tagline { color: var(--muted); font-style: italic; margin: -6px 0 14px; }
.note { display: inline-flex; align-items: center; gap: 8px; padding: 10px 14px; border-radius: var(--radius); background: rgba(229,160,13,.12); color: #f3d79a; font-size: .9rem; }
.note svg { width: 18px; height: 18px; flex: 0 0 auto; }
.note code { background: rgba(0,0,0,.3); padding: 1px 6px; border-radius: 4px; }
.pill.on { background: var(--accent); color: var(--accent-ink); }

/* ---------- video player ---------- */
.vp { position: fixed; inset: 0; background: #000; z-index: 100; display: flex; align-items: center; justify-content: center; }
.vp[hidden] { display: none; }
.vp video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.vp.idle { cursor: none; }
.vp-ui { position: absolute; inset: 0; display: flex; flex-direction: column; justify-content: space-between; pointer-events: none; transition: opacity .25s; }
.vp.idle .vp-ui { opacity: 0; }
.vp-ui > * { pointer-events: auto; }
.vp-top { display: flex; align-items: center; gap: 12px; padding: 16px 20px; background: linear-gradient(180deg, rgba(0,0,0,.7), transparent); }
.vp-top .icon-btn { color: var(--text); width: 44px; height: 44px; }
.vp-top .icon-btn svg { width: 28px; height: 28px; }
.vp-title { font-weight: 700; font-size: 1.15rem; text-shadow: 0 1px 4px rgba(0,0,0,.6); }
.vp-sub { color: var(--muted); font-size: .9rem; }
.vp-bigplay { align-self: center; width: 84px; height: 84px; border-radius: 50%; background: rgba(0,0,0,.55); border: 2px solid rgba(255,255,255,.7); color: #fff; display: grid; place-items: center; transition: transform .12s, background .15s; }
.vp-bigplay:hover { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); transform: scale(1.05); }
.vp-bigplay svg { width: 40px; height: 40px; fill: currentColor; stroke: none; margin-left: 5px; }
.vp.playing .vp-bigplay { display: none; }
.vp-bottom { padding: 10px 20px 18px; background: linear-gradient(0deg, rgba(0,0,0,.8), transparent); display: flex; flex-direction: column; gap: 6px; }
.vp-scrub { display: flex; align-items: center; gap: 12px; color: var(--text); font-size: .85rem; font-variant-numeric: tabular-nums; }
.vp-scrub input[type=range] { flex: 1; height: 5px; background: linear-gradient(90deg, var(--accent) var(--pct, 0%), rgba(255,255,255,.3) var(--pct, 0%)); }
.vp-controls { display: flex; align-items: center; gap: 6px; }
.vp-controls .icon-btn { color: var(--text); width: 44px; height: 44px; }
.vp-controls .icon-btn svg { fill: currentColor; stroke: none; width: 26px; height: 26px; }
.vp-controls #vBack svg, .vp-controls #vFwd svg, .vp-controls #vMute svg, .vp-controls #vFull svg { fill: none; stroke: currentColor; }
.vp-controls .skip { position: relative; }
.vp-controls .skip b { position: absolute; font-size: .55rem; top: 50%; left: 50%; transform: translate(-50%, -40%); font-weight: 700; }
.vp-controls #vVol { width: 90px; background: linear-gradient(90deg, #fff var(--pct, 100%), rgba(255,255,255,.3) var(--pct, 100%)); }
.vp-spacer { flex: 1; }
.vp-remain { color: var(--muted); font-size: .85rem; margin-right: 6px; }
.vp-controls .pill { background: rgba(255,255,255,.15); color: var(--text); }
.vp-controls .pill.on { background: var(--accent); color: var(--accent-ink); }
.vp-spinner { position: absolute; top: 50%; left: 50%; width: 56px; height: 56px; margin: -28px; border-radius: 50%; border: 4px solid rgba(255,255,255,.2); border-top-color: var(--accent); animation: spin .8s linear infinite; pointer-events: none; }
.vp-spinner[hidden] { display: none; }
@keyframes spin { to { transform: rotate(360deg); } }
video::cue { background: rgba(0,0,0,.6); font-size: 1.1em; }
body.vp-open { overflow: hidden; }
@media (max-width: 860px) {
  .hero .cover.wide { width: 100%; max-width: 360px; }
  .row.wide { grid-auto-columns: 220px; }
  .vp-controls #vVol, .vp-controls #vMute { display: none; }
  .vp-top { padding: 10px 12px; }
  .vp-bottom { padding: 6px 12px 12px; }
}

/* ---------- shows ---------- */
.seasons { display: flex; gap: 8px; flex-wrap: wrap; margin: 26px 0 14px; }
.seasons button { padding: 8px 14px; border-radius: 999px; background: var(--bg-3); color: var(--muted); font-weight: 600; font-size: .9rem; }
.seasons button.on { background: var(--accent); color: var(--accent-ink); }
.ep { display: grid; grid-template-columns: 200px 1fr; gap: 16px; align-items: center; padding: 10px; border-radius: 10px; cursor: pointer; }
.ep:hover { background: rgba(255,255,255,.05); }
.ep .poster { aspect-ratio: 16 / 9; border-radius: 8px; }
.ep-num { color: var(--accent); font-weight: 700; font-size: .8rem; letter-spacing: .06em; }
.ep-title { font-weight: 600; margin: 2px 0 4px; }
.ep-meta { color: var(--muted); font-size: .85rem; display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ep-meta .ok { color: var(--accent); display: inline-flex; align-items: center; gap: 4px; }
.ep-meta .ok svg { width: 14px; height: 14px; stroke-width: 3; }
.ep.current .ep-title { color: var(--accent); }
@media (max-width: 860px) { .ep { grid-template-columns: 130px 1fr; gap: 10px; } }

/* ---------- upload ---------- */
.upload-wrap { max-width: 820px; }
.drop { border: 2px dashed var(--bg-4); border-radius: 16px; padding: 44px 24px; text-align: center; color: var(--muted); cursor: pointer; transition: border-color .15s, background .15s; }
.drop:hover, .drop.over { border-color: var(--accent); background: rgba(229,160,13,.06); }
.drop svg { width: 44px; height: 44px; color: var(--faint); margin-bottom: 10px; }
.drop h3 { margin: 0 0 6px; color: var(--text); }
.drop p { margin: 0; }
.drop .file { margin-top: 14px; color: var(--text); font-weight: 600; word-break: break-all; }
.drop .file small { color: var(--muted); font-weight: 400; }
.opts { display: flex; flex-wrap: wrap; gap: 10px 22px; align-items: center; margin: 18px 0; color: var(--muted); }
.opts label { display: inline-flex; align-items: center; gap: 6px; cursor: pointer; }
.opts input { accent-color: var(--accent); }
.opts .sep { flex-basis: 100%; height: 0; }
.upbar { margin-top: 10px; }
.upbar .bar { height: 8px; border-radius: 4px; background: var(--bg-4); overflow: hidden; }
.upbar .bar i { display: block; height: 100%; background: var(--accent); transition: width .2s; }
.upbar .txt { display: flex; justify-content: space-between; color: var(--muted); font-size: .85rem; margin-top: 6px; }
.hint { color: var(--faint); font-size: .85rem; line-height: 1.5; margin-top: 14px; }
.hint code { background: var(--bg-2); padding: 1px 6px; border-radius: 4px; }
.jobs { display: grid; gap: 10px; margin-top: 10px; }
.job { background: var(--bg-2); border-radius: 12px; padding: 14px 16px; display: grid; grid-template-columns: 1fr auto; gap: 6px 12px; align-items: center; }
.job-name { font-weight: 600; word-break: break-all; }
.job-name small { color: var(--muted); font-weight: 400; margin-left: 6px; }
.job-msg { color: var(--muted); font-size: .9rem; grid-column: 1 / -1; }
.job-msg a { color: var(--accent); font-weight: 600; }
.job .bar { grid-column: 1 / -1; height: 6px; border-radius: 3px; background: var(--bg-4); overflow: hidden; }
.job .bar i { display: block; height: 100%; background: var(--accent); transition: width .3s; }
.job .bar.indet i { width: 30%; animation: indet 1.2s ease-in-out infinite; }
@keyframes indet { 0% { margin-left: -30%; } 100% { margin-left: 100%; } }
.job-actions { display: flex; gap: 6px; align-items: center; }
.state { padding: 3px 9px; border-radius: 999px; font-size: .72rem; font-weight: 700; letter-spacing: .05em; text-transform: uppercase; background: var(--bg-4); color: var(--muted); }
.state.done { background: #1f4d2a; color: #9be7a8; }
.state.error { background: #5a1f1f; color: #ffb3b3; }
.state.converting, .state.extracting, .state.organizing, .state.finalizing, .state.uploading { background: #5a4200; color: #ffd98a; }
.job pre { grid-column: 1 / -1; margin: 6px 0 0; padding: 10px; background: var(--bg); border-radius: 8px; font-size: .75rem; color: var(--muted); max-height: 220px; overflow: auto; white-space: pre-wrap; }
.btn.small { padding: 7px 12px; font-size: .85rem; }
.btn:disabled { opacity: .5; cursor: not-allowed; filter: none; }
.vp-controls #vNext svg { fill: currentColor; stroke: none; }
.upnext { position: absolute; right: 24px; bottom: 110px; background: rgba(0,0,0,.75); border: 1px solid rgba(255,255,255,.15); border-radius: 12px; padding: 12px 16px; display: flex; gap: 12px; align-items: center; z-index: 2; }
.upnext small { display: block; color: var(--muted); font-size: .75rem; text-transform: uppercase; letter-spacing: .06em; }
.upnext b { display: block; margin-top: 2px; }

/* ---------- manage: library list ---------- */
.mh { margin: 34px 0 10px; font-size: 1.15rem; display: flex; align-items: baseline; gap: 10px; }
.mh small { color: var(--muted); font-weight: 400; font-size: .85rem; }
.mlist { display: grid; gap: 8px; }
.mrow { display: grid; grid-template-columns: 56px 1fr auto; gap: 14px; align-items: center; background: var(--bg-2); border-radius: 12px; padding: 10px 14px 10px 10px; }
.mthumb { width: 56px; aspect-ratio: 1; border-radius: 6px; overflow: hidden; background: var(--bg-3); display: block; }
.mthumb.portrait { aspect-ratio: 2 / 3; }
.mthumb img { width: 100%; height: 100%; object-fit: cover; }
.minfo { min-width: 0; }
.mtitle { font-weight: 600; display: block; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.mtitle:hover { color: var(--accent); }
.mmeta { display: flex; flex-wrap: wrap; gap: 4px 12px; color: var(--muted); font-size: .85rem; margin-top: 3px; }
.mmeta .kind { color: var(--text); font-weight: 600; }
.mmeta .progt { color: var(--accent); }
.mmeta .warnt { color: #f3d79a; }
.mmeta .folder { color: var(--faint); }
.mactions { display: flex; gap: 8px; }
.btn.danger { background: #5a1f1f; color: #ffb3b3; }
.btn.danger:hover { background: #7a2626; }
.btn.danger svg { width: 16px; height: 16px; }
@media (max-width: 860px) {
  .mrow { grid-template-columns: 48px 1fr; }
  .mthumb { width: 48px; }
  .mactions { grid-column: 1 / -1; justify-content: flex-end; }
}

/* ---------- upload queue ---------- */
.queue { display: grid; gap: 6px; margin-bottom: 12px; }
.queue:empty { display: none; }
.qrow { display: grid; grid-template-columns: 22px 1fr auto 36px; gap: 10px; align-items: center; background: var(--bg-2); border-radius: 10px; padding: 8px 8px 8px 12px; }
.qrow > svg { width: 20px; height: 20px; color: var(--faint); }
.qrow.uploading > svg { color: var(--accent); }
.qname { min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.qname small { color: var(--muted); margin-left: 8px; font-weight: 400; }
.qname .qerr { color: var(--error); }
.qrow .icon-btn { width: 32px; height: 32px; }
.qrow .icon-btn svg { width: 16px; height: 16px; }
.uprow { display: flex; gap: 10px; align-items: center; }
.uprow .btn.ghost[hidden] { display: none; }
