:root {
  color-scheme: dark;
  --bg: #182722;
  --panel: #26372e;
  --cream: #f5f2e8;
  --muted: #b6c4b3;
  --accent: #d2ddbe;
  --border: #ffffff20;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--cream);
  background: var(--bg);
  font-synthesis: none;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
body { margin: 0; min-width: 320px; background: radial-gradient(ellipse at 80% 0, #3c4b3b80, transparent 55%), var(--bg); }
button, input, select { font: inherit; }
button, .button { display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 10px 18px; border: 1px solid var(--border); border-radius: 24px; background: #ffffff06; color: var(--cream); cursor: pointer; text-decoration: none; line-height: 1.5; }
button:disabled { opacity: .45; cursor: default; }
button:not(:disabled):hover, .button:hover { background: #ffffff12; }
button.primary, .button.primary, button[aria-pressed="true"] { background: var(--accent); color: #233525; border-color: transparent; }
button.primary:not(:disabled):hover, .button.primary:hover { background: #e1e9d1; }
input, select { min-width: 0; max-width: 100%; min-height: 46px; padding: 11px 14px; border: 1px solid #ffffff30; border-radius: 12px; background: #15251e; color: var(--cream); }
input::placeholder { color: #9fac9c; opacity: 1; }
input:focus, select:focus { border-color: var(--accent); }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 4px; }
h1, h2, h3, p { margin-top: 0; }
h1, h2, h3 { overflow-wrap: anywhere; }
h2 { font-size: 24px; font-weight: 500; line-height: 1.45; }
h3 { font-size: 17px; font-weight: 500; }
p { line-height: 1.85; overflow-wrap: anywhere; }
.site-header { max-width: 1400px; margin: auto; padding: 24px 40px; display: flex; align-items: center; gap: 24px; border-bottom: 1px solid #ffffff14; }
.brand { display: inline-flex; align-items: center; gap: 3px; text-decoration: none; flex: none; }
.brand img { width: 44px; height: 40px; object-fit: contain; }
.brand span { font: 700 29px/1 Arial, sans-serif; letter-spacing: -.045em; color: white; }
.header-caption { font-size: 12px; letter-spacing: .12em; color: var(--muted); }
.home-link { margin-left: auto; padding: 10px 0 10px 8px; font-size: 13px; text-decoration: none; white-space: nowrap; }
.home-link:hover { text-decoration: underline; text-underline-offset: 5px; }
.page { max-width: 1320px; margin: auto; padding: 0 40px 28px; }
.intro { padding: 64px 0 42px; }
.eyebrow { font-size: 10px; line-height: 1.6; letter-spacing: .18em; color: #c5d3b4; }
.intro h1 { margin: 18px 0; font-size: clamp(30px, 4vw, 48px); line-height: 1.3; letter-spacing: .06em; font-weight: 500; }
.intro-copy { font-size: 15px; color: #c9d1c3; margin-bottom: 22px; }
.service-address { display: flex; flex-wrap: wrap; align-items: center; gap: 9px; font-size: 11px; color: var(--accent); line-height: 1.6; }
.service-address > span:last-child { color: var(--muted); overflow-wrap: anywhere; }
.service-dot { width: 5px; height: 5px; border-radius: 50%; background: var(--accent); }
.panel { border: 1px solid var(--border); border-radius: 20px; background: linear-gradient(130deg, #ffffff06, #ffffff02); }
.gate { padding: 32px; max-width: 780px; }
.gate p:not(.eyebrow) { font-size: 14px; color: var(--muted); }
.actions { display: flex; gap: 12px; flex-wrap: wrap; }
.login-panel { display: grid; grid-template-columns: 1fr 1fr; gap: 64px; padding: 38px; max-width: 960px; }
.login-copy h2 { font-size: 28px; margin-bottom: 18px; }
.login-copy p:not(.eyebrow) { color: var(--muted); font-size: 14px; }
.login-copy .subtle { margin-top: 30px; font-size: 12px !important; }
.server-text { overflow-wrap: anywhere; }
.help-link { color: var(--accent); text-underline-offset: 4px; }
.login-form { display: flex; flex-direction: column; gap: 10px; }
.login-form label { font-size: 12px; color: #d3dccb; }
.login-form label:not(:first-child) { margin-top: 10px; }
.login-form .primary { margin-top: 12px; }
.subtle { color: var(--muted); font-size: 12px; line-height: 1.8; overflow-wrap: anywhere; }
.message { font-size: 13px; color: #d2ddc5; line-height: 1.8; margin: 16px 0; white-space: pre-line; overflow-wrap: anywhere; }
.message:empty, #report-message:empty { display: none; }
.message.is-error { color: #f1bba5; }
.account-bar { padding: 18px 24px; display: flex; align-items: center; justify-content: space-between; gap: 20px; }
.account-bar > div { min-width: 0; }
.account-bar p { margin: 5px 0 0; font-size: 14px; }
.account-bar button { flex-shrink: 0; font-size: 12px; }
.library-heading { display: flex; justify-content: space-between; align-items: baseline; flex-wrap: wrap; gap: 12px; margin: 36px 0 22px; }
.library-heading h2 { margin: 0; }
.library-tools { display: flex; align-items: center; justify-content: space-between; gap: 20px; margin-bottom: 24px; }
.filters { display: flex; gap: 6px; }
.filters button { font-size: 13px; padding: 9px 20px; }
.search-form { display: flex; align-items: center; gap: 6px; width: min(390px, 45%); border: 1px solid var(--border); border-radius: 28px; padding: 4px; }
.search-form input { flex: 1; width: 100%; border: 0; background: transparent; border-radius: 22px; min-height: 38px; padding: 9px 12px; font-size: 13px; }
.search-form button { flex: none; min-height: 38px; padding: 7px 18px; font-size: 12px; background: #ffffff0b; }
.film-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 26px 20px; }
.film-card { display: block; width: 100%; min-width: 0; padding: 0; border: 0; border-radius: 12px; background: none; text-align: left; }
.film-card:not(:disabled):hover { background: none; }
.poster { display: block; position: relative; width: 100%; aspect-ratio: 2 / 3; overflow: hidden; background: linear-gradient(145deg, #40584c, #253b30); border: 1px solid var(--border); border-radius: 12px; }
.poster-placeholder { position: absolute; inset: 0; display: grid; place-items: center; padding: 12px; color: #b7c6b2; font-size: 11px; letter-spacing: .12em; text-align: center; }
.poster img { position: relative; width: 100%; height: 100%; object-fit: cover; display: block; }
.film-card:hover .poster, .film-card:focus-visible .poster { border-color: #d2ddbe90; }
.film-name { display: block; font-size: 14px; font-weight: 500; line-height: 1.65; margin-top: 11px; overflow-wrap: anywhere; }
.film-meta { display: block; font-size: 11px; color: var(--muted); margin-top: 6px; line-height: 1.6; overflow-wrap: anywhere; }
.empty-state { grid-column: 1 / -1; padding: 42px 24px; border: 1px dashed var(--border); border-radius: 16px; color: var(--muted); text-align: center; font-size: 14px; }
.pager { display: flex; justify-content: center; align-items: center; gap: 20px; padding: 32px 0 8px; font-size: 12px; }
.pager button { font-size: 12px; }
.page-footer { margin-top: 50px; border-top: 1px solid #ffffff14; padding-top: 24px; font-size: 11px; color: #a0b19b; line-height: 1.9; }
.page-footer span { display: block; margin-top: 4px; }
dialog { width: min(980px, calc(100% - 48px)); max-width: none; max-height: calc(100dvh - 48px); padding: 0; border: 1px solid #ffffff30; border-radius: 22px; background: #203027; color: var(--cream); box-shadow: 0 20px 100px #0007; overflow-y: auto; overscroll-behavior: contain; scrollbar-color: #7f9282 transparent; }
dialog::backdrop { background: #08130ddb; }
body.detail-open { overflow: hidden; }
.detail-sheet { padding: 26px; }
.detail-toolbar { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 24px; }
.detail-toolbar button { font-size: 12px; }
.detail-top { display: flex; align-items: flex-start; gap: 26px; }
.detail-poster { width: 150px; flex: none; }
.detail-copy { min-width: 0; flex: 1; }
.detail-copy h2 { margin-bottom: 10px; font-size: 28px; }
.overview { font-size: 13px; color: #c8d2c2; white-space: pre-line; max-height: 220px; overflow-y: auto; }
.episodes-section, .playback-section { margin-top: 28px; padding-top: 24px; border-top: 1px solid var(--border); }
.section-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; margin-bottom: 16px; }
.section-heading h3 { margin: 0; }
.section-heading label { display: flex; align-items: center; gap: 8px; font-size: 12px; }
.section-heading select { min-height: 40px; font-size: 12px; }
.episode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; max-height: 320px; overflow-y: auto; padding: 4px; }
.episode-grid button { border-radius: 10px; padding: 11px; font-size: 12px; overflow-wrap: anywhere; text-align: left; justify-content: flex-start; }
.version-controls { display: flex; align-items: center; gap: 12px; font-size: 13px; }
.version-controls select { flex: 1; width: 100%; }
.version-controls button { flex-shrink: 0; }
#version-info { margin: 12px 0 4px; }
.playback-note { margin-bottom: 18px; }
.player-shell { border: 1px solid var(--border); border-radius: 14px; overflow: hidden; background: #102018; }
.player-heading { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 12px 16px; }
.player-heading strong { min-width: 0; font-size: 13px; font-weight: 500; overflow-wrap: anywhere; }
.player-heading button { font-size: 11px; padding: 8px 12px; flex: none; }
video { display: block; width: 100%; max-height: 65vh; aspect-ratio: 16 / 9; background: #060b08; }
video::cue { color: #fff; background-color: transparent; font-size: clamp(12px, 1.4vw, 24px); text-shadow: 0 1px 2px #000; font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif; }
.subtitle-controls { border-top: 1px solid #ffffff20; padding: 14px 16px; color: #fff; background: transparent; }
.subtitle-tools { display: flex; flex-wrap: wrap; align-items: end; gap: 10px; }
.subtitle-tools > label { display: flex; flex-direction: column; gap: 6px; min-width: 0; font-size: 11px; }
.subtitle-tools select { min-height: 40px; max-width: 280px; font-size: 12px; color: #fff; background: transparent; }
.subtitle-tools select option { color: #fff; background: #182722; }
.subtitle-tools button, .subtitle-tools .subtitle-import { min-height: 40px; padding: 8px 12px; border: 1px solid #ffffff50; border-radius: 20px; background: transparent; color: #fff; font-size: 12px; }
.subtitle-tools button[aria-pressed="true"] { border-color: #fff; background: #ffffff16; color: #fff; }
.subtitle-import { position: relative; justify-content: center; overflow: hidden; cursor: pointer; }
.subtitle-import input { position: absolute; inset: 0; width: 100%; height: 100%; opacity: 0; cursor: pointer; }
.subtitle-import:focus-within { outline: 2px solid #fff; outline-offset: 3px; }
.subtitle-controls p { margin: 10px 0 0; }
.subtitle-controls p:empty { display: none; }
.subtitle-help { opacity: .8; }
@media (max-width: 650px) { .subtitle-controls { padding: 12px; } .subtitle-tools > label:first-child { width: 100%; } .subtitle-tools select { width: 100%; max-width: 100%; } }
.sr-only, .skip-link:not(:focus) { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.skip-link:focus { position: fixed; z-index: 10; top: 8px; left: 8px; padding: 12px; background: var(--cream); color: var(--bg); }
@media (max-width: 1050px) {
  .film-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .login-panel { gap: 36px; }
}
@media (max-width: 650px) {
  .site-header { padding: 18px 20px; gap: 12px; }
  .header-caption { display: none; }
  .page { padding: 0 20px 24px; }
  .intro { padding: 38px 0 30px; }
  .intro h1 { font-size: 32px; letter-spacing: .035em; }
  .intro-copy { font-size: 13px; }
  .login-panel { grid-template-columns: 1fr; gap: 20px; padding: 24px; }
  .login-copy .subtle { margin-top: 16px; margin-bottom: 0; }
  .gate { padding: 24px; }
  .library-tools { flex-direction: column; align-items: stretch; gap: 16px; }
  .search-form { width: 100%; }
  .film-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 24px 14px; }
  .account-bar { align-items: flex-start; padding: 18px; flex-wrap: wrap; gap: 12px; }
  .library-heading h2 { font-size: 22px; }
  .pager { gap: 10px; }
  .pager button { padding: 9px 12px; }
  dialog { width: calc(100% - 16px); max-height: calc(100dvh - 16px); border-radius: 16px; }
  .detail-sheet { padding: 16px; }
  .detail-top { gap: 14px; }
  .detail-poster { width: 80px; }
  .detail-copy h2 { font-size: 21px; }
  .overview { max-height: 190px; }
  .version-controls { flex-wrap: wrap; gap: 10px; }
  .version-controls select { flex-basis: calc(100% - 50px); }
  .version-controls button { width: 100%; }
  .player-heading { padding: 10px; flex-wrap: wrap; }
  .episode-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .section-heading { flex-wrap: wrap; }
}
@media (max-width: 360px) {
  .page { padding-inline: 16px; }
  .site-header { padding-inline: 16px; }
  .login-panel, .gate { padding: 20px; }
  .intro h1 { font-size: 29px; }
}
