:root {
  color-scheme: dark;
  --page: #101012;
  --header: #101012;
  --red: #ff3b61;
  --red-hover: #e72c50;
  --focus: #ff93a8;
  --mint: #a3d6c2;
  --mint-text: #b3d7c7;
  --quality-text: #d9eee5;
  --quality-border: #73877c;
  --quality-bg: #07140d;
  --surface: #19191d;
  --muted: #a3a3ad;
  --line: #2c2c32;
  --text: #f5f5f7;
  --active-text: #ff7993;
  --active-border: #a9314c;
  --active-bg: #351821;
}
:root[data-theme="2"] {
  --page: #0d1118;
  --header: #0d1118;
  --red: #39a8ff;
  --red-hover: #1883d4;
  --focus: #8ccfff;
  --mint: #a7dff4;
  --mint-text: #b7e3f1;
  --quality-text: #dff7ff;
  --quality-border: #3f748f;
  --quality-bg: #08212e;
  --surface: #141b26;
  --muted: #9aa9b8;
  --line: #293544;
  --text: #edf5ff;
  --active-text: #66c8ff;
  --active-border: #1f75aa;
  --active-bg: #0e2a3a;
}
:root[data-theme="3"] {
  --page: #16121a;
  --header: #16121a;
  --red: #c084ff;
  --red-hover: #a45fe0;
  --focus: #edc6ff;
  --mint: #e2c4ff;
  --mint-text: #e5ccf7;
  --quality-text: #f8e9ff;
  --quality-border: #8969a0;
  --quality-bg: #25152f;
  --surface: #211b29;
  --muted: #b8adbe;
  --line: #3a3044;
  --text: #fcf6ff;
  --active-text: #d2a1ff;
  --active-border: #7546a0;
  --active-bg: #2c1c3a;
}
* { box-sizing: border-box; letter-spacing: 0; }
body { margin: 0; background: var(--page); color: var(--text); font: 14px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans", Arial, sans-serif; }
button, input, select { font: inherit; }
button, select, a, input { -webkit-tap-highlight-color: transparent; }
button, a, select { touch-action: manipulation; }
button { cursor: pointer; color: inherit; }
button:disabled { opacity: .35; cursor: not-allowed; }
a { color: inherit; text-decoration: none; }
button, input, select { accent-color: var(--red); }
:focus-visible { outline: 2px solid var(--focus); outline-offset: 4px; }
[hidden] { display: none !important; }
.site-header { height: 72px; padding: 0 max(24px, calc((100% - 1200px) / 2)); display: flex; align-items: center; justify-content: space-between; gap: 16px; border-bottom: 1px solid var(--line); background: var(--header); }
.brand { display: flex; align-items: center; gap: 10px; font-size: 21px; font-weight: 750; white-space: nowrap; }
.brand > i { color: var(--red); font-size: 25px; }
.brand-ai { font-size: 12px; color: var(--mint); font-weight: 600; vertical-align: super; }
.language-control, .dialog-language { display: flex; align-items: center; gap: 9px; color: var(--muted); }
.language-control select, .dialog-language select { min-height: 36px; max-width: 140px; color: var(--text); border: 1px solid var(--line); background: var(--surface); border-radius: 5px; padding: 5px 9px; cursor: pointer; }
.page-shell { max-width: 1248px; margin: auto; padding: 0 24px 36px; }
.breadcrumbs { display: flex; align-items: center; gap: 12px; min-height: 58px; padding: 12px 0; color: var(--muted); font-size: 12px; }
.breadcrumbs > i { font-size: 8px; flex: 0 0 auto; }
.breadcrumbs > a { flex: 0 0 auto; }
.breadcrumbs > span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.watch-layout { display: grid; grid-template-columns: minmax(0, 1fr) 360px; gap: 36px; align-items: start; }
.player-stage { position: relative; background: #000; width: 100%; height: min(76svh, 780px); min-height: 420px; overflow: hidden; isolation: isolate; }
.player-stage video { display: block; width: 100%; height: 100%; object-fit: contain; cursor: pointer; }
.player-top { position: absolute; top: 18px; left: 20px; right: 20px; display: flex; justify-content: space-between; align-items: center; pointer-events: none; transition: opacity .2s; }
.episode-badge { font-size: 12px; font-weight: 600; padding: 5px 10px; border-radius: 4px; background: #0a0a0acd; }
.quality-badge { font-size: 10px; font-weight: 700; color: var(--quality-text); border: 1px solid var(--quality-border); padding: 0 5px; border-radius: 3px; background: var(--quality-bg); }
.center-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); display: grid; place-items: center; width: 66px; height: 66px; border-radius: 50%; border: 1px solid #ffffff4a; background: #141416bc; font-size: 23px; backdrop-filter: blur(8px); transition: background .2s, opacity .2s; }
.center-play:hover { background: var(--red); }
.center-play i { margin-left: 4px; }
.player-stage:not(.paused) .center-play, .player-stage.is-error .center-play, .player-stage.is-buffering .center-play { opacity: 0; pointer-events: none; visibility: hidden; }
.buffering { position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none; }
.spinner { display: inline-block; width: 32px; height: 32px; border: 2px solid #ffffff30; border-top-color: var(--red); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }
.player-controls { position: absolute; bottom: 0; left: 0; right: 0; padding: 44px 16px 12px; background: linear-gradient(transparent, #000d); transition: opacity .2s; }
.player-stage.controls-hidden:not(.paused) .player-controls, .player-stage.controls-hidden:not(.paused) .player-top { opacity: 0; pointer-events: none; }
.control-row { display: flex; align-items: center; gap: 4px; width: 100%; min-height: 42px; }
.tool-button { position: relative; flex: 0 0 auto; width: 36px; height: 36px; display: inline-grid; place-items: center; border: 0; border-radius: 5px; background: transparent; font-size: 15px; }
.tool-button:hover:not(:disabled) { background: #ffffff16; }
.tool-button[data-tooltip]:hover::after { content: attr(data-tooltip); position: absolute; z-index: 5; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%); width: max-content; max-width: 160px; padding: 5px 9px; border-radius: 4px; background: #25252b; font: 11px/1.4 -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif; text-align: center; white-space: normal; pointer-events: none; }
.control-row > .tool-button:first-child::after { left: 0; transform: none; }
.control-row > .tool-button:last-child::after { left: auto; right: 0; transform: none; }
.skip-number { position: absolute; top: 13px; left: 12px; font-size: 8px; font-weight: 700; line-height: 1; }
.time-display { display: flex; gap: 5px; font-size: 11px; font-variant-numeric: tabular-nums; white-space: nowrap; min-width: 75px; margin-right: auto; }
.time-divider, #duration { color: #b6b6bf; }
.volume-control { display: flex; align-items: center; }
.volume-control input { width: 64px; height: 4px; margin: 0 5px; cursor: pointer; }
.speed-select { width: 58px; min-height: 34px; font-size: 11px; border: 0; border-radius: 4px; padding: 3px; background: #202023; cursor: pointer; }
.seek-bar { --played: 0%; --buffered: 0%; display: block; appearance: none; width: 100%; height: 4px; margin: 0 0 10px; border-radius: 3px; background: linear-gradient(to right, var(--red) 0 var(--played), #ffffff75 var(--played) var(--buffered), #ffffff38 var(--buffered) 100%); cursor: pointer; }
.seek-bar::-webkit-slider-thumb { appearance: none; height: 12px; width: 12px; border-radius: 50%; background: #fff; border: none; box-shadow: 0 1px 6px #0005; }
.seek-bar::-moz-range-thumb { height: 12px; width: 12px; border: none; border-radius: 50%; background: #fff; }
.playback-error { position: absolute; inset: 0; z-index: 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 14px; padding: 28px; text-align: center; background: #08080beb; }
.playback-error > i { font-size: 30px; color: var(--red); }
.playback-error p { max-width: 320px; margin: 0; }
.drama-info { min-width: 0; padding: 10px 0; }
.detail-eyebrow { display: flex; align-items: center; gap: 8px; color: #b3d7c7; font-size: 12px; margin-bottom: 12px; }
.status-dot { width: 6px; height: 6px; background: #a3d6c2; border-radius: 50%; }
.drama-title { font-size: 25px; line-height: 1.3; margin: 0 0 18px; font-weight: 700; overflow-wrap: anywhere; }
.drama-desc { color: var(--muted); font-size: 13px; line-height: 1.85; margin: 0; overflow-wrap: anywhere; }
.action-bar { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); border-top: 1px solid var(--line); border-bottom: 1px solid var(--line); margin: 26px 0; padding: 18px 0; }
.action-item { border: none; border-radius: 5px; background: none; padding: 8px 4px; display: flex; flex-direction: column; align-items: center; gap: 4px; min-width: 0; }
.action-item + .action-item { border-left: 1px solid var(--line); border-radius: 0; }
.action-item i { font-size: 19px; margin-bottom: 5px; color: #d2d2db; }
.action-item > span:last-child { font-size: 11px; line-height: 1.5; color: var(--muted); overflow-wrap: anywhere; }
.action-count { font-size: 15px; font-weight: 600; font-variant-numeric: tabular-nums; }
.action-item:hover i, .action-item[aria-pressed="true"] i { color: var(--red); }
.episode-header { display: flex; align-items: center; gap: 10px; margin-bottom: 14px; }
.episode-header h2 { font-size: 15px; margin: 0; }
.episode-header > span { font-size: 12px; color: var(--muted); }
.episode-navigation { display: flex; margin-left: auto; }
.episode-navigation .tool-button { width: 30px; height: 30px; font-size: 12px; }
.episode-list { display: grid; grid-template-columns: repeat(auto-fill, minmax(49px, 1fr)); gap: 8px; max-height: 300px; overflow-y: auto; padding: 3px; scrollbar-color: #44444b transparent; scrollbar-width: thin; }
.episode-item { min-width: 0; width: 100%; height: 48px; background: #1e1e23; color: #c0c0ca; border: 1px solid transparent; border-radius: 5px; font-size: 14px; font-variant-numeric: tabular-nums; }
.episode-item:hover { background: #2a2a30; color: #fff; }
.episode-item.active { color: var(--active-text); border-color: var(--active-border); background: var(--active-bg); font-weight: 700; }
.empty-state { min-height: 55svh; display: flex; flex-direction: column; justify-content: center; align-items: center; gap: 16px; padding: 36px 16px; text-align: center; }
.empty-state h1 { font-size: 23px; margin: 4px 0 0; }
.empty-state p { color: var(--muted); max-width: 420px; margin: 0; }
.empty-icon { font-size: 42px; color: #72727d; margin-bottom: 8px; }
.primary-button, .secondary-button { display: inline-flex; justify-content: center; align-items: center; gap: 8px; min-height: 42px; max-width: 100%; padding: 10px 18px; border-radius: 5px; border: 1px solid transparent; font-size: 13px; line-height: 1.4; font-weight: 600; text-align: center; overflow-wrap: anywhere; }
.primary-button { background: var(--red); color: white; }
.primary-button:hover { background: var(--red-hover); }
.secondary-button { background: #24242b; border-color: #3b3b43; }
dialog { width: min(420px, calc(100% - 32px)); padding: 26px; background: #1a1a20; color: var(--text); border: 1px solid #393941; border-radius: 8px; box-shadow: 0 24px 90px #0008; overflow-wrap: anywhere; max-height: calc(100svh - 40px); }
dialog::backdrop { background: #000b; backdrop-filter: blur(6px); }
dialog h2 { font-size: 20px; line-height: 1.4; margin: 14px 0 10px; }
dialog p { color: var(--muted); font-size: 13px; line-height: 1.7; margin: 0 0 20px; }
.dialog-heading { display: flex; align-items: center; justify-content: space-between; gap: 12px; }
.dialog-heading h2 { margin: 0; }
.dialog-icon { color: var(--red); font-size: 24px; }
.dialog-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; flex-wrap: wrap; }
.dialog-actions > * { flex: 1 1 120px; }
.safari-dialog .dialog-icon { color: var(--red); }
.player-stage:fullscreen { width: 100%; height: 100%; min-height: 0; }
.player-stage:fullscreen .player-controls { padding-left: 24px; padding-right: 24px; }
@media (max-width: 1050px) {
  .watch-layout { grid-template-columns: minmax(0, 1fr) 320px; gap: 26px; }
  .volume-control input { display: none; }
  .pip-button { display: none; }
  .drama-title { font-size: 22px; }
}
@media (max-width: 760px) {
  .site-header { height: 60px; padding: 0 16px; }
  .brand { font-size: 19px; gap: 8px; }
  .brand > i { font-size: 22px; }
  .language-control { gap: 6px; }
  .language-control select { max-width: 108px; font-size: 12px; }
  .page-shell { padding: 0 0 28px; }
  .breadcrumbs { padding: 10px 16px; min-height: 44px; }
  .watch-layout { display: block; }
  .player-stage { min-height: 340px; height: min(69svh, 680px); }
  .player-top { top: 14px; left: 16px; right: 16px; }
  .player-controls { padding: 40px 12px 10px; }
  .drama-info { padding: 24px 20px 0; }
  .drama-title { font-size: 22px; }
  .drama-desc { font-size: 13px; }
  .action-bar { margin: 22px 0; }
  .episode-list { grid-template-columns: repeat(auto-fill, minmax(48px, 1fr)); }
  .control-row { gap: 2px; }
  .tool-button { width: 34px; height: 38px; }
  .skip-number { left: 11px; top: 14px; }
  .time-display { min-width: 70px; font-size: 10px; gap: 4px; }
  .speed-select { width: 51px; }
  .empty-state { min-height: 65svh; }
}
@media (max-width: 350px) {
  .skip-button { display: none; }
  .brand { font-size: 17px; }
  .site-header { gap: 8px; padding: 0 12px; }
  .language-control > i { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
  .spinner { animation-duration: 1.8s; }
}
