:root {
  color-scheme: dark;
  --ground: #101014;
  --surface: #18181e;
  --raised: #222229;
  --line: #2b2b34;
  --text: #f4f3f7;
  --muted: #a3a1af;
  --quiet: #74727f;
  --accent: #ff536f;
  --accent-bg: #392029;
  --top: 72px;
  --nav: 66px;
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Noto Sans CJK SC", sans-serif;
  font-size: 14px;
  background: var(--ground);
  color: var(--text);
  -webkit-tap-highlight-color: transparent;
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
button, input, select { font: inherit; }
button { cursor: pointer; color: inherit; border: 0; background: none; }
button:disabled { cursor: default; opacity: .45; }
button:focus-visible, input:focus-visible, select:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; }
[hidden] { display: none !important; }
h1, h2, h3, p { margin: 0; }
i[data-icon], svg { display: inline-block; width: 20px; height: 20px; flex: none; vertical-align: middle; }
.shell { min-height: 100dvh; }
.sidebar {
  position: fixed; inset: 0 auto 0 0; width: 188px; display: flex; flex-direction: column;
  background: #16161b; border-right: 1px solid #26262e; padding: 24px 14px 18px; z-index: 4;
}
.brand { display: flex; align-items: center; gap: 10px; padding: 3px 5px; text-align: left; font-size: 15px; font-weight: 750; }
.brand img, .mobile-mark { border-radius: 8px; }
.side-nav { display: grid; gap: 6px; margin-top: 37px; }
.nav-button { display: flex; align-items: center; gap: 12px; min-height: 43px; border-radius: 9px; padding: 0 11px; color: var(--muted); text-align: left; white-space: nowrap; }
.nav-button[aria-current="page"] { color: #ff8094; background: var(--accent-bg); font-weight: 650; }
@media (hover: hover) {
  .nav-button:hover, .icon-button:hover, .chip:hover, .surface-button:hover { background-color: #ffffff13; color: var(--text); }
  .nav-button[aria-current="page"]:hover, .chip[aria-pressed=true]:hover { background-color: var(--accent-bg); color: #ff96a7; }
}
.sidebar-foot { margin-top: auto; display: flex; align-items: center; gap: 8px; padding: 8px; color: var(--quiet); font-size: 12px; }
.sidebar-foot span { width: 6px; height: 6px; border-radius: 50%; background: #7bbba4; }
.main { margin-left: 188px; }
.topbar {
  height: var(--top); position: sticky; top: 0; z-index: 3; display: flex; align-items: center; justify-content: space-between;
  gap: 10px; padding: 0 28px; background: var(--ground); border-bottom: 1px solid #ffffff08;
}
.heading { display: flex; align-items: center; gap: 8px; min-width: 0; }
h1 { font-size: 22px; letter-spacing: -.035em; white-space: nowrap; }
.mobile-mark, .bottom-nav { display: none; }
.chips { display: flex; gap: 6px; align-items: center; flex-wrap: wrap; }
.topbar .chips { position: absolute; left: 50%; transform: translateX(-50%); flex-wrap: nowrap; background: #1b1b21; border-radius: 999px; padding: 4px; }
.chip { font-size: 13px; white-space: nowrap; min-height: 33px; padding: 0 13px; border-radius: 999px; color: var(--muted); background: var(--surface); }
.topbar .chip { background: transparent; }
.chip[aria-pressed=true], .topbar .chip[aria-pressed=true] { color: #ff8b9e; background: var(--accent-bg); font-weight: 650; }
.icon-button { display: inline-grid; place-items: center; width: 38px; height: 38px; border-radius: 8px; padding: 0; flex: none; color: inherit; }
.theater {
  display: grid; grid-template-columns: minmax(0, 1fr); min-height: 440px;
  height: calc(100dvh - var(--top)); padding: 14px 28px 22px;
}
.stage {
  position: relative; isolation: isolate; background: #09090b; min-height: 0; overflow: hidden;
  border-radius: 15px; border: 1px solid #ffffff13; touch-action: pan-x pinch-zoom;
}
#video, .backdrop, .stage-gradient, #danmaku { position: absolute; inset: 0; width: 100%; height: 100%; }
#video { object-fit: contain; background: transparent; }
.backdrop {
  background: radial-gradient(ellipse at 50% 32%, #39252f 0%, #20181f 36%, #09090b 76%);
  background-position: center; background-size: cover; overflow: hidden;
}
.backdrop img { width: 100%; height: 100%; object-fit: contain; }
.backdrop.with-cover::after { content: ""; position: absolute; inset: 0; background-color: #0002; }
.stage-gradient { pointer-events: none; background: linear-gradient(180deg, #0008, transparent 22%, transparent 57%, #000d 96%); }
.stage-top { position: absolute; left: 16px; right: 16px; top: 13px; display: flex; gap: 7px; align-items: center; pointer-events: none; }
.stage-top button { pointer-events: auto; }
#stage-count { margin-left: auto; color: #fff; font-size: 11px; border-radius: 99px; background: #0b0b10a8; padding: 6px 9px; font-variant-numeric: tabular-nums; }
#stage-count:empty { display: none; }
.stage-meta { position: absolute; bottom: 71px; left: 18px; right: 83px; max-width: 435px; color: white; text-shadow: 0 1px 3px #000c; }
.stage-title { display: flex; gap: 6px 8px; flex-wrap: wrap; align-items: baseline; }
#drama-title { display: block; font-size: clamp(17px, 2.1vw, 24px); text-align: left; font-weight: 760; letter-spacing: -.035em; padding: 0; line-height: 1.35; overflow-wrap: anywhere; }
.episode-label { margin-top: 7px; color: #e4e2e7; font-size: 12px; }
#drama-description { overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; font-size: 12px; line-height: 1.55; color: #dfdce4; margin-top: 7px; }
.rail { position: absolute; right: 14px; bottom: 77px; display: grid; gap: 10px; }
.rail-button { display: grid; justify-items: center; align-content: center; gap: 3px; width: 44px; min-height: 49px; color: #fff; filter: drop-shadow(0 1px 3px #000c); }
.rail-button i, .rail-button svg { width: 25px; height: 25px; }
.rail-button span { font-size: 11px; }
.rail-button[aria-pressed=true] { color: #ff859b; }
.controls { position: absolute; inset: auto 12px 6px; }
#seek {
  display: block; width: 100%; height: 18px; margin: 0; accent-color: #fff; cursor: pointer;
  -webkit-appearance: none; appearance: none; background: transparent;
}
#seek::-webkit-slider-runnable-track { height: 3px; border-radius: 5px; background: linear-gradient(to right, white var(--played,0%), #ffffff4d var(--played,0%)); }
#seek::-webkit-slider-thumb { -webkit-appearance: none; width: 11px; height: 11px; margin-top: -4px; border-radius: 99px; background: #fff; }
#seek::-moz-range-track { height: 3px; background: #ffffff4d; border-radius: 5px; }
#seek::-moz-range-progress { height: 3px; background: #fff; }
#seek::-moz-range-thumb { border: none; }
.control-row { height: 38px; display: flex; align-items: center; gap: 4px; font-size: 12px; }
.control-row .icon-button { width: 34px; height: 35px; }
#time { color: #e6e4ec; white-space: nowrap; font-size: 11px; font-variant-numeric: tabular-nums; }
.control-spacer { flex: 1; }
.text-control, .select-wrap select { padding: 5px 6px; color: #e6e4ec; border-radius: 5px; background: transparent; white-space: nowrap; min-height: 32px; }
.text-control[aria-pressed=false] { color: #a4a2ac; text-decoration: line-through; }
.select-wrap select { appearance: none; border: 0; cursor: pointer; }
.select-wrap option { background: var(--surface); color: var(--text); }
.center-play { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); width: 64px; height: 64px; display: grid; place-items: center; border-radius: 50%; color: white; background: #15151daa; box-shadow: 0 4px 24px #0006; }
.center-play svg { width: 29px; height: 29px; fill: white; }
.player-message { position: absolute; left: 50%; top: 47%; transform: translate(-50%, -50%); width: max-content; max-width: min(82%, 340px); display: flex; align-items: center; justify-content: center; flex-wrap: wrap; gap: 8px; background: #15151ce8; color: #e7e3eb; padding: 10px 15px; border-radius: 10px; font-size: 12px; box-shadow: 0 4px 28px #0005; text-align: center; }
.player-message.error { min-width: min(82%, 260px); }
.player-message a { color: inherit; text-decoration: none; }
.spinner { display: inline-block; width: 14px; height: 14px; border: 2px solid #ffffff25; border-top-color: #ff8197; border-radius: 50%; animation: turn .8s linear infinite; }
@keyframes turn { to { transform: rotate(360deg); } }
#danmaku { overflow: hidden; height: 48%; pointer-events: none; }
.bullet { position: absolute; left: 0; top: var(--lane); color: white; font-weight: 600; white-space: nowrap; font-size: clamp(14px, 1.8vw, 20px); text-shadow: 0 1px 3px #000, 0 0 4px #000; will-change: transform; }
.catalog { padding: 23px 28px 50px; max-width: 1500px; margin-inline: auto; }
.catalog-head { margin-bottom: 18px; display: grid; gap: 13px; }
#search-form { display: flex; align-items: center; gap: 8px; width: min(100%, 480px); padding: 5px 5px 5px 13px; background: var(--surface); border: 1px solid var(--line); border-radius: 10px; color: var(--quiet); }
#query { min-width: 60px; flex: 1; min-height: 33px; color: var(--text); background: none; border: 0; outline-offset: 2px; font-size: 16px; }
#search-form button, .primary { color: #15080c; background: #ff8096; border-radius: 8px; padding: 8px 13px; font-weight: 700; }
.catalog-options { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; }
.filter-panel { width: 100%; padding: 12px; border: 1px solid var(--line); border-radius: 12px; display: grid; gap: 12px; background: var(--surface); }
.filter-panel legend { padding: 0 5px; transform: translateY(4px); color: var(--muted); font-size: 12px; }
.filter-row { display: grid; grid-template-columns: 72px 1fr; align-items: start; gap: 6px; }
.filter-row > span { font-size: 12px; padding-top: 9px; color: var(--muted); }
.filter-panel .chip { background: var(--raised); }
.filter-panel .chip[aria-pressed=true] { background: var(--accent-bg); }
.cards { display: grid; grid-template-columns: repeat(auto-fill,minmax(145px,1fr)); align-items: start; gap: 23px 14px; }
.card { min-width: 0; padding: 0; text-align: left; color: var(--text); }
.cover { overflow: hidden; position: relative; border-radius: 10px; background: radial-gradient(ellipse at top,#46343e,#211e27 58%,#1b1b21); }
.card .cover { aspect-ratio: 3/4; border: 1px solid #ffffff10; display: grid; place-items: center; color: #b5a7b766; }
.cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.card .cover:has(svg) img { position: absolute; inset: 0; }
.cover-meta { position: absolute; inset: auto 0 0; background: linear-gradient(transparent, #000a); padding: 15px 7px 7px; display: flex; align-items: end; justify-content: space-between; gap: 5px; font-size: 10px; color: #fff; text-shadow: 0 1px 2px #000; }
.card h3 { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; margin: 7px 0 4px; font-size: 13px; }
.card p { color: var(--muted); font-size: 11px; min-height: 1.1em; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.card-status { position: absolute; left: 6px; top: 7px; }
.badges { display: inline-flex; flex-wrap: wrap; gap: 5px; text-shadow: none; }
.badge { padding: 3px 6px; border-radius: 4px; font-size: 10px; font-weight: 700; color: #dcfff0; background: #1c644f; white-space: nowrap; }
.badge.hot { color: #fff0d9; background: #9a461d; }
.card .score { color: #ffbb64; }
#catalog-status, .empty { color: var(--muted); padding: 24px 4px; display: flex; justify-content: center; align-items: center; gap: 8px; text-align: center; flex-wrap: wrap; }
#catalog-status:empty { display: none; }
#sentinel { height: 1px; }
.surface-button { border-radius: 7px; background: #ffffff16; padding: 7px 11px; font-size: 12px; color: inherit; }
dialog { color: var(--text); background: #17171d; border: 1px solid var(--line); border-radius: 16px; padding: 0; overflow: hidden; }
dialog[open] { display: flex; flex-direction: column; }
dialog::backdrop { background: #000b; }
.detail-dialog { width: min(740px, calc(100vw - 28px)); max-height: 85dvh; }
.comments-dialog { width: min(430px, calc(100vw - 24px)); height: min(72dvh, 740px); margin: auto 14px auto auto; }
.dialog-header { display: flex; align-items: center; justify-content: space-between; padding: 7px 14px; border-bottom: 1px solid var(--line); flex: none; }
.dialog-header h2 { font-size: 15px; }
.dialog-scroll { overflow: auto; overscroll-behavior: contain; scrollbar-width: none; padding: 14px; min-height: 0; }
.detail-banner { display: flex; gap: 13px; align-items: flex-start; padding: 0 0 17px; }
.detail-banner .cover { width: clamp(70px, 23vw, 114px); aspect-ratio: 3/4; flex: none; }
.detail-banner h3 { font-size: 19px; }
.detail-banner p { color: var(--muted); line-height: 1.6; margin: 7px 0; font-size: 12px; }
.detail-banner .description { display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden; }
.detail-actions { display: flex; flex-wrap: wrap; gap: 7px; align-items: center; }
.detail-tabs { display: flex; flex-wrap: wrap; gap: 7px; border-top: 1px solid var(--line); padding: 12px 0; }
.episode-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(64px, 1fr)); gap: 8px; }
.episode-grid button { background: var(--raised); min-height: 40px; border-radius: 7px; }
.episode-grid button.current { background: var(--accent-bg); color: #ff8097; }
.comment { display: grid; grid-template-columns: 35px 1fr auto; gap: 9px; padding-block: 10px; }
.comment .cover { height: 33px; border-radius: 50%; }
.comment-name, .comment-time, .comment-likes { font-size: 12px; color: var(--muted); }
.comment-text { margin-block: 4px 6px; white-space: pre-wrap; overflow-wrap: anywhere; line-height: 1.48; }
.comment-time button { color: var(--muted); text-decoration: underline; margin-left: 5px; padding: 0 4px; }
.reply-list { margin: 8px 0 0 3px; border-left: 1px solid var(--line); padding-left: 9px; }
.reply-list .comment { grid-template-columns: 26px 1fr auto; }
.reply-list .cover { height: 25px; }
#toast { position: fixed; bottom: calc(23px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 6; background: #292932; padding: 9px 15px; border-radius: 8px; text-align: center; max-width: 86vw; box-shadow: 0 6px 18px #0007; }
@media (max-width: 1030px) {
  .sidebar { width: 151px; }
  .main { margin-left: 151px; }
  .theater { padding-inline: 16px; }
  .topbar, .catalog { padding-inline: 16px; }
}
@media (max-width: 640px) {
  :root { --top: 55px; --nav: 58px; }
  .sidebar { display: none; }
  .main { margin: 0; padding-top: env(safe-area-inset-top); }
  .topbar { padding-inline: 11px; height: var(--top); top: env(safe-area-inset-top); }
  h1 { font-size: 16px; }
  .topbar .chips { left: auto; transform: none; position: static; gap: 1px; padding: 3px; }
  .topbar .chip { padding-inline: 8px; font-size: 12px; min-height: 27px; }
  .mobile-mark { display: block; border-radius: 5px; }
  .bottom-nav { position: fixed; z-index: 4; inset: auto 0 0; display: grid; grid-template-columns: repeat(6,1fr); background: #101014; border-top: 1px solid var(--line); padding-bottom: env(safe-area-inset-bottom); }
  .bottom-nav .nav-button { height: var(--nav); font-size: 10px; padding: 0; justify-content: center; flex-direction: column; gap: 4px; border-radius: 0; }
  .bottom-nav .nav-button[aria-current="page"] { background: transparent; }
  .theater { min-height: 280px; padding: 0; height: calc(100dvh - var(--top) - var(--nav) - env(safe-area-inset-bottom) - env(safe-area-inset-top)); }
  .stage { border: none; border-radius: 0; }
  .stage-top { inset: 8px 8px auto; }
  .stage-meta { left: 12px; right: 62px; bottom: 68px; }
  #drama-description { -webkit-line-clamp: 1; }
  .rail { right: 7px; bottom: 73px; gap: 5px; }
  .controls { inset-inline: 7px; }
  .control-row { gap: 1px; }
  .control-row .icon-button { width: 31px; }
  .catalog { padding: 12px 11px calc(72px + env(safe-area-inset-bottom)); }
  .cards { gap: 16px 8px; grid-template-columns: repeat(3,minmax(0,1fr)); }
  .card h3 { font-size: 12px; margin-top: 5px; }
  .filter-row { grid-template-columns: 1fr; gap: 3px; }
  .filter-row > span { padding: 0; }
  .filter-panel .chip { padding-inline: 9px; min-height: 31px; }
  .comments-dialog { margin: auto 0 0; max-width: none; width: 100%; height: 51dvh; border-radius: 15px 15px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  .detail-dialog { margin: auto 0 0; max-width: none; width: 100%; max-height: 91dvh; border-radius: 15px 15px 0 0; padding-bottom: env(safe-area-inset-bottom); }
  #toast { bottom: calc(68px + env(safe-area-inset-bottom)); }
}
@media (max-width: 355px) {
  .mobile-mark { display: none; }
}
@media (prefers-reduced-motion: reduce) {
  .spinner { animation-duration: 2s; }
}

/* Films share the H5 navigation and colors, with a separate landscape player. */
.film-intro { margin: 4px 0 24px; }
.film-intro h2 { font-size: 28px; letter-spacing: -.04em; }
.film-intro p, .film-heading p { color: var(--muted); margin-top: 10px; line-height: 1.7; }
.film-search { display: flex; gap: 10px; margin-bottom: 26px; }
.film-search input { min-width: 0; flex: 1; border: 1px solid var(--line); border-radius: 10px; background: var(--surface); color: var(--text); padding: 12px 15px; }
.film-card { min-width: 0; padding: 0; text-align: left; }
.film-card .cover { aspect-ratio: 2/3; border-radius: 12px; overflow: hidden; background: var(--surface); }
.film-card .cover img { width: 100%; height: 100%; object-fit: cover; }
.film-card h3 { font-size: 15px; margin: 12px 0 6px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.film-card p { font-size: 12px; color: var(--muted); line-height: 1.6; }
.film-status { padding: 30px 0; text-align: center; color: var(--muted); line-height: 1.8; }
.film-more { display: block; margin: 0 auto 24px; }
.film-heading { margin: 22px 0; }
.film-heading p { max-width: 900px; }
.film-toolbar { display: flex; align-items: center; flex-wrap: wrap; gap: 12px; margin: 16px 0; }
.film-toolbar select { padding: 9px; color: var(--text); background: var(--raised); border: 1px solid var(--line); border-radius: 8px; max-width: 65%; }
.film-screen { aspect-ratio: 16/9; background: #050506; border: 1px solid var(--line); border-radius: 12px; overflow: hidden; }
.film-screen iframe { display: block; width: 100%; height: 100%; border: 0; }
.film-start { height: 100%; display: flex; align-items: center; justify-content: center; flex-direction: column; gap: 22px; padding: 20px; text-align: center; }
.film-play { background: var(--accent-bg); color: #ff96a7; }
.film-notice { color: var(--muted); font-size: 12px; line-height: 1.8; margin: 18px 0 28px; }
.film-episodes { display: grid; grid-template-columns: repeat(auto-fill,minmax(100px,1fr)); gap: 10px; margin: 16px 0 28px; max-height: 360px; overflow: auto; padding: 3px; }
.film-episodes [aria-pressed=true] { background: var(--accent-bg); color: #ff96a7; }
@media(max-width: 520px) { .film-search { flex-wrap: wrap; } .film-search input { flex-basis: 100%; } .film-intro h2 { font-size: 23px; } .film-start h3 { font-size: 14px; } }
.film-card .cover { display: grid; place-items: center; }
.film-card .cover img { position: absolute; inset: 0; }
