:root {
  --bg: #0b0b10;
  --panel: #14141c;
  --line: #262633;
  --text: #f4f4f8;
  --muted: #9a9aae;
  --accent: #ff4d6d;
  color-scheme: dark;
}
* { box-sizing: border-box; }
html, body { margin: 0; background: var(--bg); color: var(--text); font: 15px/1.5 Inter, system-ui, -apple-system, sans-serif; }
a { color: inherit; }
.top { display: flex; align-items: center; gap: 16px; padding: 18px clamp(16px, 4vw, 48px); border-bottom: 1px solid var(--line); }
.brand { display: flex; align-items: center; gap: 10px; font-weight: 800; letter-spacing: -0.02em; font-size: 19px; text-decoration: none; }
.logo { width: 26px; height: 26px; border-radius: 8px; background: var(--accent); position: relative; }
.logo::after { content: ""; position: absolute; left: 10px; top: 7px; border-left: 9px solid #fff; border-top: 6px solid transparent; border-bottom: 6px solid transparent; }
.tag { color: var(--muted); font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.home { padding: 0 clamp(16px, 4vw, 48px) 64px; }
.hero { padding: 64px 0 40px; max-width: 720px; }
.hero h1 { font-size: clamp(36px, 6vw, 64px); line-height: 1.02; letter-spacing: -0.04em; margin: 0 0 16px; }
.hero p { color: var(--muted); font-size: 17px; margin: 0; }
.row-title { font-size: 14px; text-transform: uppercase; letter-spacing: 0.12em; color: var(--muted); font-weight: 600; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 20px; }
.card { text-decoration: none; display: block; border-radius: 14px; overflow: hidden; background: var(--panel); border: 1px solid var(--line); transition: transform .2s, border-color .2s; }
.card:hover { transform: translateY(-3px); border-color: #3a3a4c; }
.poster { aspect-ratio: 16 / 9; background: #222 center / cover; position: relative; }
.badge { position: absolute; top: 10px; left: 10px; background: var(--accent); color: #fff; font-weight: 700; font-size: 11px; padding: 3px 8px; border-radius: 999px; }
.meta { padding: 12px 14px 14px; }
.title { font-weight: 700; line-height: 1.3; }
.sub { color: var(--muted); font-size: 13px; margin-top: 4px; }
.foot { color: var(--muted); font-size: 12px; padding: 24px clamp(16px, 4vw, 48px); border-top: 1px solid var(--line); }

.stage { max-width: 1180px; margin: 0 auto; padding: 24px clamp(16px, 3vw, 32px) 64px; }
.player { background: #000; border-radius: 16px; overflow: hidden; border: 1px solid var(--line); }
.player:fullscreen { border-radius: 0; display: flex; flex-direction: column; justify-content: center; }
.player:fullscreen .screen { flex: 1; aspect-ratio: auto; }
.screen { position: relative; aspect-ratio: 16 / 9; background: #000; }
.screen iframe { position: absolute; inset: 0; width: 100%; height: 100%; border: 0; }
.cover { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; background: radial-gradient(ellipse at center, rgba(0,0,0,.35), rgba(0,0,0,.75)); font-weight: 600; }
.cover[hidden] { display: none; }
.big-play { width: 76px; height: 76px; border-radius: 50%; border: 0; background: var(--accent); cursor: pointer; display: grid; place-items: center; box-shadow: 0 10px 40px rgba(255, 77, 109, .45); transition: transform .15s; }
.big-play:hover { transform: scale(1.06); }
.big-play svg { width: 34px; height: 34px; fill: #fff; margin-left: 4px; }
/* English sits above the burned-in Chinese line */
.line { position: absolute; left: 50%; bottom: 21%; transform: translateX(-50%); max-width: 86%; text-align: center; pointer-events: none;
  font-weight: 700; font-size: clamp(14px, 2.5vw, 30px); line-height: 1.25; color: #fff; padding: .15em .5em; border-radius: 8px;
  background: rgba(8, 8, 12, .55); opacity: 0; transition: opacity .08s; text-shadow: 0 1px 2px #000; }
.line.on { opacity: 1; }
.bar { display: flex; align-items: center; gap: 12px; padding: 10px 14px; background: var(--panel); flex-wrap: wrap; }
.icon { width: 36px; height: 36px; border-radius: 10px; border: 0; background: transparent; color: var(--text); cursor: pointer; display: grid; place-items: center; }
.icon:hover { background: #22222e; }
.icon svg { width: 22px; height: 22px; fill: currentColor; }
.time { font-variant-numeric: tabular-nums; color: var(--muted); font-size: 13px; }
#seek { flex: 1; min-width: 120px; accent-color: var(--accent); }
.sync { display: flex; align-items: center; gap: 6px; font-size: 12px; color: var(--muted); }
.sync button { border: 1px solid var(--line); background: #1b1b25; color: var(--text); border-radius: 8px; padding: 4px 8px; font: inherit; cursor: pointer; }
.sync button:hover { border-color: #3a3a4c; }
.hint { color: var(--muted); font-size: 13px; margin: 12px 2px 0; }
.about { margin-top: 28px; }
.about h1 { font-size: clamp(24px, 3.4vw, 34px); letter-spacing: -0.03em; margin: 0; line-height: 1.15; }
.zh { color: var(--muted); margin-top: 6px; }
.about p { color: #c9c9d6; max-width: 760px; }
.eps { display: flex; flex-wrap: wrap; gap: 8px; margin: 16px 0; }
.eps a { text-decoration: none; padding: 7px 12px; border-radius: 999px; border: 1px solid var(--line); font-size: 13px; }
.eps a.on { background: var(--accent); border-color: var(--accent); color: #fff; font-weight: 600; }
.credit { font-size: 12px; color: var(--muted) !important; }
@media (max-width: 640px) { .sync span { display: none; } .tag { display: none; } }

/* sign-in */
.gate { min-height: calc(100vh - 70px); display: grid; place-items: center; padding: 24px; }
.gate[hidden], .home[hidden] { display: none; }
.gate-card { width: min(380px, 100%); background: var(--panel); border: 1px solid var(--line); border-radius: 18px; padding: 32px; display: flex; flex-direction: column; gap: 12px; align-items: stretch; text-align: center; }
.gate-card h1 { margin: 6px 0 0; letter-spacing: -0.03em; }
.gate-card p { margin: 0 0 8px; color: var(--muted); }
.logo.big { width: 48px; height: 48px; border-radius: 14px; align-self: center; }
.logo.big::after { left: 18px; top: 14px; border-left-width: 16px; border-top-width: 10px; border-bottom-width: 10px; }
.gate-card input { background: #0e0e14; border: 1px solid var(--line); color: var(--text); border-radius: 10px; padding: 12px 14px; font: inherit; }
.gate-card input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.gate-card button { background: var(--accent); color: #fff; border: 0; border-radius: 10px; padding: 12px; font: inherit; font-weight: 700; cursor: pointer; }
.err { color: #ff8095; font-size: 13px; min-height: 18px; }

/* player */
.player video { width: 100%; display: block; aspect-ratio: 16 / 9; background: #000; }
.player .plyr { --plyr-color-main: var(--accent); --plyr-font-family: Inter, system-ui, sans-serif; --plyr-captions-background: rgba(8, 8, 12, .6);
  --plyr-captions-text-color: #fff; --plyr-font-size-captions-large: 26px; --plyr-font-size-captions-medium: 20px; --plyr-font-size-captions-small: 15px;
  --plyr-range-thumb-height: 14px; --plyr-range-track-height: 6px; --plyr-tooltip-background: #14141c; --plyr-tooltip-color: #fff; border-radius: 16px; }
/* English under the burned-in Chinese line, same look as the burned-in version */
.en-line { position: absolute; z-index: 2; transform: translateY(-50%); text-align: center; white-space: nowrap; pointer-events: none;
  font-family: "Helvetica Neue", Helvetica, Arial, sans-serif; font-weight: 500; line-height: 1.1; color: #fff;
  -webkit-text-stroke: .045em #343434; paint-order: stroke fill; text-shadow: 0 .05em .14em rgba(0, 0, 0, .6); }
/* black strip under the picture for the English line (8.5% of the picture height = 4.78% of the width) */
.player .plyr__video-wrapper { padding-bottom: 54px; background: #000; }
.player .plyr--video .plyr__controls { background: #000; padding: 6px 10px; }
/* full screen (browser full screen, Safari's, and Plyr's fill-the-window mode): video fills the screen, picture letterboxed */
.player .plyr:fullscreen .plyr__video-wrapper, .player .plyr:-webkit-full-screen .plyr__video-wrapper,
.player .plyr--fullscreen-active .plyr__video-wrapper, .player .plyr--fullscreen-fallback .plyr__video-wrapper { padding-bottom: 0; height: 100%; }
.player .plyr:fullscreen video, .player .plyr:-webkit-full-screen video,
.player .plyr--fullscreen-active video, .player .plyr--fullscreen-fallback video { aspect-ratio: auto; width: 100%; height: 100%; object-fit: contain; }
.player .plyr:fullscreen .plyr__controls, .player .plyr:-webkit-full-screen .plyr__controls, .player .plyr--fullscreen-fallback .plyr__controls { background: linear-gradient(transparent, rgba(0,0,0,.75)); }
.player .plyr--fullscreen-active, .player .plyr--fullscreen-fallback { border-radius: 0; }

/* header auth links (pages only, accounts not built yet) */
.auth { margin-left: auto; display: flex; align-items: center; gap: 8px; flex-shrink: 0; }
.auth a { text-decoration: none; font-size: 14px; font-weight: 600; padding: 7px 12px; border-radius: 10px; color: var(--muted); }
.auth a:hover { color: var(--text); }
.auth a.btn { background: var(--accent); color: #fff; }
.gate-card .small { font-size: 13px; color: var(--muted); text-align: right; text-decoration: none; }
.gate-card .alt { font-size: 14px; color: var(--muted); margin-top: 4px; }
.gate-card .alt a { color: var(--text); font-weight: 600; }
.soon { font-size: 13px; color: #ffd0d9; background: rgba(255, 77, 109, .12); border: 1px solid rgba(255, 77, 109, .35); border-radius: 10px; padding: 10px 12px; }
.soon[hidden] { display: none; }

/* continue watching */
#resume { margin: 0 0 36px; }
#resume[hidden] { display: none; }
.resume { display: flex; gap: 16px; align-items: center; text-decoration: none; background: var(--panel); border: 1px solid var(--line);
  border-radius: 16px; padding: 12px; max-width: 560px; transition: border-color .2s, transform .2s; }
.resume:hover { border-color: #3a3a4c; transform: translateY(-2px); }
.resume-thumb { flex: 0 0 168px; aspect-ratio: 16 / 9; border-radius: 10px; background: #222 center / cover; display: grid; place-items: center; }
.resume-play { width: 42px; height: 42px; border-radius: 50%; background: var(--accent); position: relative; box-shadow: 0 6px 24px rgba(255, 77, 109, .45); }
.resume-play::after { content: ""; position: absolute; left: 16px; top: 12px; border-left: 14px solid #fff; border-top: 9px solid transparent; border-bottom: 9px solid transparent; }
.resume-meta { min-width: 0; flex: 1; }
.resume-k { font-size: 12px; text-transform: uppercase; letter-spacing: .12em; color: var(--accent); font-weight: 700; }
.resume-title { font-weight: 700; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.resume-sub { color: var(--muted); font-size: 13px; margin-top: 2px; }
.resume-bar { height: 4px; background: #2a2a36; border-radius: 4px; margin-top: 10px; overflow: hidden; }
.resume-bar i { display: block; height: 100%; background: var(--accent); }
@media (max-width: 520px) { .resume-thumb { flex-basis: 112px; } }

/* paste a link */
.paste { display: flex; gap: 10px; max-width: 720px; margin: 0 0 10px; }
.paste input { flex: 1; min-width: 0; background: var(--panel); border: 1px solid var(--line); color: var(--text); border-radius: 12px;
  padding: 14px 16px; font: inherit; font-size: 16px; }
.paste input:focus { outline: 2px solid var(--accent); outline-offset: 1px; }
.paste button { background: var(--accent); color: #fff; border: 0; border-radius: 12px; padding: 0 20px; font: inherit; font-weight: 700; cursor: pointer; white-space: nowrap; }
.paste-msg { color: var(--muted); font-size: 14px; min-height: 20px; margin-bottom: 28px; max-width: 720px; }
#queue { margin-bottom: 32px; }
#queue[hidden] { display: none; }
.queue-list { display: grid; gap: 8px; max-width: 720px; }
.qitem { display: flex; justify-content: space-between; gap: 12px; padding: 12px 14px; border: 1px solid var(--line); border-radius: 12px;
  background: var(--panel); text-decoration: none; }
.qitem .qt { font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.qitem .qs { color: var(--muted); font-size: 13px; white-space: nowrap; }
.qitem.on { border-color: var(--accent); }
.qitem.on .qs { color: var(--accent); font-weight: 700; }
@media (max-width: 520px) { .paste { flex-direction: column; } .paste button { padding: 14px; } }

.en-note { position: absolute; z-index: 3; top: 12px; right: 12px; font-size: 12px; font-weight: 600; color: #fff; background: rgba(8, 8, 12, .6);
  padding: 5px 10px; border-radius: 999px; pointer-events: none; }
.en-note:empty { display: none; }

/* TikTok-style speed zones (invisible) and the speed badge */
.speed-zone { position: absolute; z-index: 2; -webkit-tap-highlight-color: transparent; touch-action: manipulation; user-select: none; -webkit-user-select: none; -webkit-touch-callout: none; }
.speed-badge { position: absolute; z-index: 4; top: 14px; left: 50%; transform: translateX(-50%); pointer-events: none; font-weight: 800; font-size: 15px;
  color: #fff; background: rgba(8, 8, 12, .62); padding: 6px 14px; border-radius: 999px; letter-spacing: .02em; }
.speed-badge:empty { display: none; }

.eps a.soon { opacity: .55; cursor: default; }
