/* 糕糕的私人影院 — interface styles.
   Warm cinema palette. The car screens are dark; the control panel and Settings on the Mac follow the system's light/dark
   setting (.adaptive). Motion uses springs from Apple's damping/response values, sampled into CSS
   linear() curves; only transform, opacity and filter animate. */


:root {
  color-scheme: dark;
  --font: Rubik, HongLei, -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Noto Sans CJK SC', 'Microsoft YaHei', system-ui, sans-serif;
  --display: var(--font);
  --ground: #0c0b0a; --raised: #171513; --raised-2: #211e1b; --line: rgba(255, 240, 225, .09);
  --fill: rgba(255, 240, 225, .09); --fill-2: rgba(255, 240, 225, .15);
  --text: #f5efe7; --text-2: rgba(245, 239, 231, .66); --text-3: rgba(245, 239, 231, .42);
  --accent: #ff6d60; --accent-fill: #d33a30; --accent-soft: rgba(255, 109, 96, .16); --on-accent: #fff;
  --green: #3ccf84; --amber: #f2b84b; --red: #ff6d60; --blue: #5aa8ff; --teal: #3cc2c7; --gray: #8e8882;
  --lib-1: linear-gradient(140deg, #4a1814, #b8352b); --lib-2: linear-gradient(140deg, #3b2a12, #b07b2b);
  --lib-3: linear-gradient(140deg, #13302d, #2f7f6f); --lib-4: linear-gradient(140deg, #26211d, #6b5d52);
  --glow: rgba(255, 109, 96, .18);
  --shadow-sm: 0 2px 6px rgba(0, 0, 0, .28); --shadow: 0 16px 40px rgba(0, 0, 0, .42), 0 2px 6px rgba(0, 0, 0, .25);
  --r-sm: 10px; --r: 14px; --r-lg: 20px; --r-xl: 28px;
  --spring: linear(0, 0.0293, 0.099, 0.1886, 0.2852, 0.3807, 0.4703, 0.5518, 0.6239, 0.6868, 0.7407, 0.7864, 0.8249, 0.8571, 0.8837, 0.9057, 0.9237, 0.9385, 0.9505, 0.9603, 0.9681, 0.9745, 0.9796, 0.9838, 0.9871, 0.9897, 0.9918, 0.9935, 0.9949, 0.9959, 0.9968, 0.9975, 1);
  --spring-ms: 470ms;
  --spring-bounce: linear(0, 0.0274, 0.0957, 0.188, 0.2915, 0.3972, 0.499, 0.593, 0.6768, 0.7496, 0.8112, 0.8622, 0.9034, 0.936, 0.9611, 0.98, 0.9936, 1.0031, 1.0093, 1.0129, 1.0147, 1.0152, 1.0147, 1.0136, 1.0122, 1.0106, 1.009, 1.0075, 1.0061, 1.0048, 1.0037, 1.0028, 1);
  --spring-bounce-ms: 410ms;
  --spring-quick: linear(0, 0.0293, 0.0987, 0.1882, 0.2847, 0.3801, 0.4697, 0.5511, 0.6232, 0.6861, 0.74, 0.7859, 0.8244, 0.8566, 0.8833, 0.9053, 0.9234, 0.9382, 0.9503, 0.96, 0.968, 0.9744, 0.9795, 0.9837, 0.987, 0.9896, 0.9918, 0.9935, 0.9948, 0.9959, 0.9967, 0.9974, 1);
  --spring-quick-ms: 340ms;
  --ease-out: cubic-bezier(.16, 1, .3, 1);
  --press: 90ms;
  --gutter: 40px;
}
@media (prefers-color-scheme: light) {
  .adaptive {
    color-scheme: light;
    --ground: #f5f2ee; --raised: #fff; --raised-2: #ece8e3; --line: rgba(40, 30, 20, .1); --fill: rgba(40, 30, 20, .06); --fill-2: rgba(40, 30, 20, .1);
    --text: #1d1a17; --text-2: rgba(29, 26, 23, .64); --text-3: rgba(29, 26, 23, .4);
    --accent: #c8302a; --accent-fill: #c8302a; --accent-soft: rgba(200, 48, 42, .1);
    --green: #1f9d55; --amber: #b7791f; --red: #c8302a; --blue: #0a6cdc; --teal: #138a91; --gray: #8a847e;
    --shadow-sm: 0 1px 3px rgba(40, 30, 20, .1); --shadow: 0 10px 30px rgba(40, 30, 20, .1), 0 1px 3px rgba(40, 30, 20, .08);
  }
}

/* ---------- Base and browser surfaces ---------- */
* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--ground); color: var(--text); font: 17px/1.45 var(--font); -webkit-font-smoothing: antialiased; -webkit-tap-highlight-color: transparent; text-rendering: optimizeLegibility; }
:lang(zh-Hans) body, :lang(zh-Hans) .wordmark { letter-spacing: .01em; }
/* 鸿雷小纸条体 is a thin handwritten face with one weight: bold text gets a synthesized bold (Rubik is a
   variable font and never needs it), and the smallest labels are a step larger in Chinese. */
:lang(zh-Hans) .over .s, :lang(zh-Hans) .card-sub, :lang(zh-Hans) .fan .c, :lang(zh-Hans) .room-prog, :lang(zh-Hans) .row-detail, :lang(zh-Hans) .footnote { font-size: 15px; }
[hidden] { display: none !important; }
button, input, select { font: inherit; color: inherit; letter-spacing: inherit; }
button { cursor: pointer; }
input { caret-color: var(--accent); }
::selection { background: color-mix(in srgb, var(--accent) 34%, transparent); }
:focus { outline: none; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 3px; border-radius: 8px; }
* { scrollbar-width: thin; scrollbar-color: var(--fill-2) transparent; }
.i { width: 1.2em; height: 1.2em; flex: none; display: block; }
.mono, #tCur, #tDur, .speed-num, .row-detail { font-variant-numeric: tabular-nums; }
.err { color: var(--red); margin: 10px 0 0; font-size: 15px; min-height: 0; }
.err:empty { display: none; }
.center-text { text-align: center; }

/* ---------- Screens ---------- */
.screen { position: fixed; inset: 0; overflow: auto; background: var(--ground); color: var(--text); overscroll-behavior: contain; }
.screen.center { display: grid; place-items: center; padding: 24px; }
.screen[data-enter='fade'] { animation: enter-fade 360ms var(--ease-out) both; }
.screen[data-enter='push'] { animation: enter-push var(--spring-ms) var(--spring) both; }
.screen[data-enter='back'] { animation: enter-back var(--spring-ms) var(--spring) both; }
@keyframes enter-fade { from { opacity: 0; } }
@keyframes enter-push { from { transform: translateX(32%); opacity: .3; } }
@keyframes enter-back { from { transform: translateX(-14%); opacity: .4; } }
@keyframes rise { from { opacity: 0; transform: translateY(12px); } }

/* ---------- Buttons ---------- */
.btn {
  position: relative; display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px;
  border: 0; border-radius: 12px; background: var(--fill); color: var(--text); font-weight: 600; text-decoration: none; white-space: nowrap; overflow: hidden;
  transition: transform var(--spring-quick-ms) var(--spring-quick), background-color 180ms ease, opacity 180ms ease;
}
.btn .i { width: 1.15em; height: 1.15em; }
.btn:active, .icon-btn:active, .round:active, .row-action:active, .tile:active, .wcard:active, .fan:active, .pw-go:active { transition-duration: var(--press); }
.btn:active { transform: scale(.96); }
@media (hover: hover) { .btn:hover { background: var(--fill-2); } .btn.primary:hover { background: color-mix(in srgb, var(--accent-fill) 88%, #fff); } }
.btn.primary { background: var(--accent-fill); color: var(--on-accent); }
.btn.primary:active { background: color-mix(in srgb, var(--accent-fill) 85%, #000); }
.btn.tinted { background: var(--accent-soft); color: var(--accent); }
.btn.quiet { background: var(--fill); color: var(--text); }
.btn.large { min-height: 54px; padding: 0 26px; border-radius: 14px; font-size: 18px; }
.btn.small { min-height: 34px; padding: 0 12px; border-radius: 10px; font-size: 15px; }
.btn:disabled { opacity: .5; cursor: default; }
.icon-btn {
  display: grid; place-items: center; width: 44px; height: 44px; border: 0; border-radius: 50%; background: var(--fill); color: var(--text); flex: none;
  transition: transform var(--spring-quick-ms) var(--spring-quick), background-color 180ms ease;
}
@media (hover: hover) { .icon-btn:hover { background: var(--fill-2); } }
.icon-btn:active { transform: scale(.9); }
.spinner { width: 20px; height: 20px; border-radius: 50%; border: 2.5px solid var(--fill-2); border-top-color: var(--text-2); animation: spin .8s linear infinite; flex: none; }
@keyframes spin { to { transform: rotate(360deg); } }

/* Language switch */
.lang-toggle { display: inline-flex; padding: 3px; border-radius: 11px; background: var(--fill); flex: none; }
.lang-toggle button { border: 0; background: none; color: var(--text-2); font-size: 14px; font-weight: 600; min-width: 46px; height: 32px; padding: 0 10px; border-radius: 8px; transition: background-color 200ms ease, color 200ms ease; }
.lang-toggle button[aria-pressed='true'] { background: var(--raised-2); color: var(--text); box-shadow: var(--shadow-sm); }
.corner-tools { position: absolute; top: 20px; right: 24px; }

/* ---------- Solid panels (login, notice, sheets, player cards) ---------- */
.panel { background: var(--raised); border: 1px solid var(--line); border-radius: var(--r-xl); box-shadow: var(--shadow); }
.stage { background: radial-gradient(ellipse 60% 46% at 50% -6%, var(--glow), transparent 72%), var(--ground); }
.login-card, .card { width: min(440px, 92vw); padding: 38px 34px 30px; display: grid; gap: 14px; justify-items: center; text-align: center; animation: rise 520ms var(--ease-out) both; }
.card { justify-items: stretch; text-align: left; }
.login-card h1, .card h1 { margin: 0; font-family: var(--display); font-size: 34px; line-height: 1.15; font-weight: 600; }
.login-card .sub, .card p { margin: 0; color: var(--text-2); }
.app-icon { width: 76px; height: 76px; border-radius: 19px; box-shadow: 0 10px 26px rgba(0, 0, 0, .35); margin-bottom: 4px; }
.pw-field { position: relative; width: 100%; margin-top: 8px; }
.pw-field input { width: 100%; height: 56px; border-radius: 14px; border: 1px solid var(--line); background: var(--ground); padding: 0 62px 0 18px; font-size: 18px; transition: border-color 180ms; }
.pw-field input:focus { border-color: var(--accent); }
.pw-field input::placeholder { color: var(--text-3); }
.pw-go { position: absolute; right: 8px; top: 8px; width: 40px; height: 40px; border-radius: 50%; border: 0; background: var(--accent-fill); color: #fff; display: grid; place-items: center; transition: transform var(--spring-quick-ms) var(--spring-quick); }
.pw-go:active { transform: scale(.88); }
.shake { animation: shake 420ms cubic-bezier(.36, .07, .19, .97) both; }
@keyframes shake { 15% { transform: translateX(-11px); } 30% { transform: translateX(9px); } 45% { transform: translateX(-7px); } 60% { transform: translateX(5px); } 75% { transform: translateX(-2px); } }

/* ---------- Toolbars (Mac panel) ---------- */
.toolbar {
  position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 12px; min-height: 64px; padding: 10px 24px;
  background: color-mix(in srgb, var(--ground) 78%, transparent); -webkit-backdrop-filter: blur(20px) saturate(170%); backdrop-filter: blur(20px) saturate(170%);
  box-shadow: 0 1px 0 transparent; transition: box-shadow 240ms ease;
}
.screen.scrolled .toolbar { box-shadow: 0 1px 0 var(--line); }
.toolbar-title { flex: 1; font-size: 18px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin: 0; }
.toolbar-title.center { text-align: center; }
.grouped .fade-title { opacity: 0; transform: translateY(6px); transition: opacity 200ms ease, transform var(--spring-ms) var(--spring); }
.grouped.scrolled .fade-title { opacity: 1; transform: none; }
.toolbar-actions { display: flex; align-items: center; gap: 10px; justify-content: flex-end; min-width: 120px; }
.toolbar-back { display: inline-flex; align-items: center; gap: 2px; border: 0; background: none; color: var(--accent); font-size: 17px; padding: 6px 8px 6px 0; min-width: 120px; transition: opacity 150ms; }
.toolbar-back:active { opacity: .5; transition-duration: var(--press); }
.toolbar-back .i { width: 22px; height: 22px; }

/* ---------- Grouped lists (Mac panel and Settings) ---------- */
.page { max-width: 700px; margin: 0 auto; padding: 4px 22px 72px; }
.large-title { font-family: var(--display); font-weight: 600; font-size: 38px; line-height: 1.15; letter-spacing: -0.015em; margin: 8px 4px 20px; }
.section-title { font-size: 13px; font-weight: 600; letter-spacing: .02em; color: var(--text-2); margin: 32px 18px 8px; text-transform: uppercase; }
:lang(zh-Hans) .section-title { text-transform: none; letter-spacing: .04em; }
.footnote { font-size: 13px; line-height: 1.45; color: var(--text-2); margin: 8px 18px 0; }
.footnote a { color: var(--accent); text-underline-offset: 2px; }
.footnote.intro { margin: 0 4px 8px; font-size: 15px; }
.footnote.tip { margin-top: 32px; text-align: center; }
.group { background: var(--raised); border-radius: 12px; overflow: hidden; box-shadow: 0 0 0 1px var(--line); }
.group .row { position: relative; display: flex; align-items: center; gap: 12px; min-height: 50px; padding: 8px 16px; width: 100%; border: 0; background: none; color: var(--text); text-align: left; font-size: 17px; }
.group .row + .row::before { content: ''; position: absolute; top: 0; right: 0; left: 16px; height: 1px; transform: scaleY(.5); background: var(--line); }
.group .row:has(.row-icon) + .row:has(.row-icon)::before { left: 58px; }
.row-title { flex: 1; min-width: 0; }
.row-detail { color: var(--text-2); text-align: right; }
.row-sub { display: block; color: var(--text-2); font-size: 14px; margin-top: 1px; overflow-wrap: anywhere; }
.row-icon { width: 30px; height: 30px; border-radius: 8px; flex: none; display: grid; place-items: center; background: var(--c, var(--gray)); color: #fff; }
.row-icon .i { width: 18px; height: 18px; }
.row-action { cursor: pointer; transition: background-color 200ms ease; }
.row-action:active { background: var(--fill); }
@media (hover: hover) { .row-action:hover { background: var(--fill); } }
.row-action .row-title { color: var(--accent); font-weight: 500; }
.row-action.danger .row-title { color: var(--red); }
.row-action .chevron { color: var(--text-3); width: 16px; height: 16px; }
.group .row input:not([type=radio]):not([type=checkbox]), .group .row select { flex: 1.4; min-width: 0; border: 0; background: none; text-align: right; color: var(--text-2); padding: 6px 0; font-size: 17px; }
.group .row input::placeholder { color: var(--text-3); }
.group .row input:focus { color: var(--text); }
.group .row input:focus-visible, .group .row select:focus-visible { outline: none; }
.group .row:has(input:focus-visible, select:focus-visible) { box-shadow: inset 0 0 0 2px var(--accent); }
.group .row select { appearance: none; -webkit-appearance: none; cursor: pointer; text-align-last: right; }
.url { font-weight: 600; overflow-wrap: anywhere; }
.url.muted { color: var(--text-2); font-weight: 400; }
.note { margin-top: 12px; padding: 14px 16px; border-radius: 12px; background: var(--raised); box-shadow: 0 0 0 1px var(--line); display: grid; gap: 6px; font-size: 15px; animation: rise 300ms var(--ease-out) both; }
.note.ok { background: color-mix(in srgb, var(--green) 10%, var(--raised)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--green) 40%, transparent); }
.note.bad { background: color-mix(in srgb, var(--red) 9%, var(--raised)); box-shadow: 0 0 0 1px color-mix(in srgb, var(--red) 40%, transparent); }
.note .warn { color: var(--amber); }
.note ul { margin: 0; padding-left: 20px; color: var(--text-2); }
.note a { color: var(--accent); font-weight: 600; }
.note .muted { color: var(--text-2); }
.disclosure { margin-top: 14px; }
.disclosure summary { list-style: none; cursor: pointer; color: var(--accent); font-size: 15px; padding: 6px 18px; width: fit-content; display: flex; align-items: center; gap: 4px; }
.disclosure summary::-webkit-details-marker { display: none; }
.disclosure summary .i { width: 14px; height: 14px; transition: transform var(--spring-ms) var(--spring); }
.disclosure[open] summary .i { transform: rotate(90deg); }
.disclosure-actions { margin: 10px 4px 0; }
.save-bar { margin-top: 32px; display: grid; }
.save-bar .btn { width: 100%; }

.segmented { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); background: var(--fill); border-radius: 9px; padding: 2px; min-width: 220px; }
.segmented label { position: relative; z-index: 1; cursor: pointer; }
.segmented input { position: absolute; opacity: 0; pointer-events: none; }
.segmented span { display: block; text-align: center; padding: 5px 10px; font-size: 14px; font-weight: 500; border-radius: 7px; transition: transform var(--spring-quick-ms) var(--spring-quick); }
.segmented label:active span { transform: scale(.94); transition-duration: var(--press); }
.segmented input:checked + span { font-weight: 600; }
.segmented:has(input:focus-visible) { box-shadow: 0 0 0 2px var(--accent); }
.seg-thumb { position: absolute; z-index: 0; top: 2px; bottom: 2px; left: 2px; width: calc((100% - 4px) / 3); border-radius: 7px; background: var(--raised-2);
  box-shadow: var(--shadow-sm); transform: translateX(calc(var(--seg, 0) * 100%)); transition: transform var(--spring-ms) var(--spring); }
.adaptive .seg-thumb { background: var(--raised); }
.segmented:has(input[value='720']:checked) { --seg: 1; }
.segmented:has(input[value='1080']:checked) { --seg: 2; }

/* Switches: the knob stretches while pressed and slides on a spring */
.switch, .switch-input { position: relative; flex: none; width: 51px; height: 31px; border-radius: 999px; border: 0; padding: 0; margin: 0; background: var(--fill-2); transition: background-color 240ms ease; -webkit-appearance: none; appearance: none; cursor: pointer; }
.switch .knob, .switch-input::after { content: ''; position: absolute; top: 2px; left: 2px; width: 27px; height: 27px; border-radius: 999px; background: #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .18), 0 2px 1px rgba(0, 0, 0, .06); transition: transform var(--spring-ms) var(--spring), width var(--spring-quick-ms) var(--spring-quick); }
.switch.on, .switch-input:checked { background: var(--green); }
.switch.on .knob, .switch-input:checked::after { transform: translateX(20px); }
.switch:active .knob, .switch-input:active::after { width: 33px; }
.switch.on:active .knob, .switch-input:checked:active::after { transform: translateX(14px); }
.switch.big { width: 72px; height: 42px; }
.switch.big .knob { width: 38px; height: 38px; }
.switch.big.on .knob { transform: translateX(30px); }
.switch.big:active .knob { width: 46px; }
.switch.big.on:active .knob { transform: translateX(22px); }

/* Car access card: the one place colour switches on with the state */
.hero-card { position: relative; display: flex; align-items: center; gap: 18px; padding: 20px 20px 20px 18px; border-radius: var(--r-lg); background: var(--raised); box-shadow: var(--shadow), 0 0 0 1px var(--line); overflow: hidden; }
.hero-card::before { content: ''; position: absolute; inset: 0; background: radial-gradient(90% 160% at 0% 50%, color-mix(in srgb, var(--green) 20%, transparent), transparent 62%); opacity: 0; transition: opacity 500ms ease; pointer-events: none; }
.hero-card.on::before { opacity: 1; }
.hero-glyph { position: relative; width: 60px; height: 60px; border-radius: 18px; display: grid; place-items: center; background: var(--fill); color: var(--text-2); flex: none; transition: background-color 320ms ease, color 320ms ease, transform var(--spring-bounce-ms) var(--spring-bounce); }
.hero-card.on .hero-glyph { background: var(--green); color: #fff; transform: scale(1.04); }
.hero-glyph .i { width: 34px; height: 34px; }
.hero-text { position: relative; flex: 1; min-width: 0; }
.hero-title { font-size: 21px; font-weight: 700; }
.hero-sub { color: var(--text-2); font-size: 15px; margin-top: 2px; }

/* ---------- Library (the car) ---------- */
.topbar { position: sticky; top: 0; z-index: 6; display: flex; align-items: center; gap: 14px; height: 76px; padding: 0 var(--gutter); transition: background-color 240ms ease, box-shadow 240ms ease; }
.screen.scrolled .topbar, .topbar.solid { background: color-mix(in srgb, var(--ground) 80%, transparent); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%); box-shadow: 0 1px 0 var(--line); }
.topbar-title { flex: 1; margin: 0; font-size: 24px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 12px rgba(0, 0, 0, .35); }
.search { display: flex; align-items: center; gap: 8px; height: 44px; padding: 0 14px; border-radius: 12px; background: var(--fill); color: var(--text-2); width: min(300px, 26vw); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); transition: background-color 180ms; }
.search:focus-within { background: var(--fill-2); box-shadow: 0 0 0 2px var(--accent); }
.search input { flex: 1; min-width: 0; border: 0; background: none; color: var(--text); font-size: 17px; }
.search input:focus-visible { outline: none; }
.search input::placeholder { color: var(--text-3); }
.search input::-webkit-search-cancel-button { filter: invert(1) opacity(.5); }
.topbar .icon-btn, .topbar .btn.quiet, .topbar .lang-toggle { -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); }

/* Home: the Screening room. The film in progress is shown like a lit projection screen; a blurred,
   dimmed copy of its picture is the light that fills the room behind everything (the ambient layer). */
#library > * { position: relative; z-index: 1; }
#library > .ambient, #library > .grain { position: absolute; z-index: 0; pointer-events: none; }
#library > .grain { position: fixed; } /* covers the screen at any scroll position */
#library > .topbar { position: sticky; z-index: 6; }
.ambient { inset: 0 0 auto 0; height: 1000px; overflow: hidden; opacity: 0; transition: opacity 900ms var(--ease-out); }
.ambient.on { opacity: 1; }
.ambient img { width: 100%; height: 100%; object-fit: cover; filter: blur(90px) saturate(1.35) brightness(.62); transform: scale(1.25); }
.ambient::after { content: ''; position: absolute; inset: 0; background: radial-gradient(75% 65% at 62% 30%, transparent 0%, color-mix(in srgb, var(--ground) 70%, transparent) 60%, var(--ground) 92%), linear-gradient(0deg, var(--ground) 2%, transparent 45%); }
.grain { inset: 0; opacity: .05; background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='160' height='160'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E"); }
.display { font-family: var(--display); font-weight: 600; letter-spacing: -0.02em; }
:lang(zh-Hans) .display { letter-spacing: .02em; }
.wordmark { font-weight: 400 !important; letter-spacing: .06em; } /* the brush face's own weight, never a synthesized bold */
.topbar-title.wordmark { font-size: 27px; }

.room { display: grid; grid-template-columns: minmax(360px, .85fr) 1.35fr; gap: clamp(28px, 4vw, 56px); align-items: center; padding: 18px var(--gutter) 30px; }
.room-title { font-size: clamp(44px, 5vw, 72px); line-height: 1.02; margin: 0 0 18px; text-wrap: balance; }
:lang(zh-Hans) .room-title { line-height: 1.12; }
.room-meta { color: var(--text-2); font-size: 17px; }
.room-meta b { color: var(--text); font-weight: 600; }
.room-prog { display: flex; align-items: center; gap: 14px; margin: 16px 0 26px; color: var(--text-2); font-size: 15px; }
.room-prog .bar { width: 200px; }
.room-actions { display: flex; flex-wrap: wrap; gap: 12px; }
.room-actions .btn.quiet { background: color-mix(in srgb, var(--text) 12%, transparent); }
.room > * { animation: rise 640ms var(--ease-out) both; }
.room > :last-child { animation: screen-on 900ms var(--ease-out) both; animation-delay: 80ms; }
@keyframes screen-on { from { opacity: 0; transform: scale(.97); filter: brightness(.4) blur(4px); } }
.frame-wrap { position: relative; }
.screen-frame { display: block; width: 100%; padding: 0; border: 0; position: relative; aspect-ratio: 16 / 9; border-radius: 18px; overflow: hidden; background: var(--raised);
  box-shadow: 0 50px 120px -30px rgba(0, 0, 0, .85), 0 0 0 1px rgba(255, 255, 255, .07); transition: transform var(--spring-ms) var(--spring); }
.screen-frame img { width: 100%; height: 100%; object-fit: cover; display: block; }
.screen-frame:active { transform: scale(.985); transition-duration: var(--press); }
.spill { position: absolute; left: 8%; right: 8%; bottom: -60px; height: 80px; background: radial-gradient(50% 50% at 50% 0%, var(--spill, rgba(255, 160, 110, .2)), transparent 70%); filter: blur(10px); pointer-events: none; }

.bar { height: 4px; border-radius: 2px; background: var(--fill-2); overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: inherit; background: var(--accent); }

.home { padding-bottom: 64px; }
.shelf { margin-top: 34px; }
.shelf-title { margin: 0 var(--gutter) 16px; font-size: 28px; }
.rail { display: grid; grid-auto-flow: column; grid-auto-columns: clamp(270px, 23vw, 360px); gap: 18px; overflow-x: auto; padding: 4px var(--gutter) 14px; scroll-snap-type: x proximity; scroll-padding-inline: var(--gutter); scrollbar-width: none; overscroll-behavior-x: contain; }
.rail::-webkit-scrollbar { display: none; }
.wcard, .fan, .tile { position: relative; border: 0; padding: 0; background: none; color: inherit; text-align: left; font: inherit; scroll-snap-align: start; transition: transform var(--spring-ms) var(--spring); }
.wcard:active, .fan:active, .tile:active { transform: scale(.96); }
.thumb { position: relative; overflow: hidden; border-radius: var(--r); background: var(--raised); box-shadow: 0 12px 30px rgba(0, 0, 0, .4), 0 0 0 1px var(--line); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; transition: transform 500ms var(--ease-out); }
.thumb .ph { position: absolute; inset: 0; display: grid; place-items: center; color: var(--text-3); background: radial-gradient(120% 90% at 30% 20%, var(--raised-2), var(--raised)); }
.thumb .ph .i { width: 36px; height: 36px; }
.wcard .thumb { aspect-ratio: 16 / 9; }
.wcard .thumb::after { content: ''; position: absolute; inset: 0; background: linear-gradient(0deg, rgba(8, 7, 6, .88) 0%, rgba(8, 7, 6, .22) 46%, transparent 70%); }
.over { position: absolute; left: 16px; right: 16px; bottom: 14px; z-index: 1; }
.over .t { font-weight: 650; font-size: 17px; color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.over .s { font-size: 13.5px; color: rgba(255, 255, 255, .74); margin-top: 2px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.line { position: absolute; left: 0; right: 0; bottom: 0; height: 3px; background: rgba(255, 255, 255, .18); z-index: 1; }
.line i { display: block; height: 100%; background: var(--accent); }
@media (hover: hover) and (pointer: fine) {
  .wcard:hover, .tile:hover, .fan:hover { transform: translateY(-2px); }
  .wcard:hover .thumb img, .tile:hover .thumb img { transform: scale(1.03); }
  .screen-frame:hover { transform: translateY(-2px); }
}
.fans { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 30px 28px; padding: 4px var(--gutter) 0; }
.fan .stack { position: relative; height: 196px; }
.fan .stack > * { position: absolute; bottom: 0; width: 124px; aspect-ratio: 2 / 3; border-radius: 10px; object-fit: cover; box-shadow: 0 14px 30px rgba(0, 0, 0, .55), 0 0 0 1px rgba(255, 255, 255, .06); transition: transform var(--spring-ms) var(--spring); }
.fan .stack > :nth-child(1) { left: 0; z-index: 3; }
.fan .stack > :nth-child(2) { left: 66px; z-index: 2; transform: scale(.9); transform-origin: bottom left; filter: brightness(.7); }
.fan .stack > :nth-child(3) { left: 122px; z-index: 1; transform: scale(.8); transform-origin: bottom left; filter: brightness(.48); }
@media (hover: hover) and (pointer: fine) { .fan:hover .stack > :nth-child(2) { transform: scale(.9) translateX(8px); } .fan:hover .stack > :nth-child(3) { transform: scale(.8) translateX(18px); } }
.fan .stack .blank { background: var(--lib-1); }
.fan:nth-child(4n+2) .stack .blank { background: var(--lib-2); } .fan:nth-child(4n+3) .stack .blank { background: var(--lib-3); } .fan:nth-child(4n+4) .stack .blank { background: var(--lib-4); }
.fan .n { margin-top: 14px; font-size: 19px; font-weight: 650; }
.fan .c { color: var(--text-2); font-size: 14px; }

.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(180px, 1fr)); gap: 30px 22px; padding: 8px var(--gutter) 56px; }
.grid:empty { display: none; }
.tile .thumb { aspect-ratio: 2 / 3; }
.tile .done { position: absolute; top: 10px; right: 10px; width: 28px; height: 28px; border-radius: 50%; background: var(--accent-fill); color: #fff; display: grid; place-items: center; box-shadow: var(--shadow-sm); }
.tile .done .i { width: 15px; height: 15px; }
.tile.skeleton { pointer-events: none; }
.tile.skeleton .thumb, .tile.skeleton .card-name, .tile.skeleton .card-sub { background: linear-gradient(100deg, var(--raised) 30%, var(--raised-2) 50%, var(--raised) 70%) 0 0 / 300% 100%; animation: shimmer 1.4s ease-in-out infinite; box-shadow: none; }
.tile.skeleton .card-name { height: 16px; width: 78%; border-radius: 6px; margin-top: 14px; }
.tile .card-name { margin-top: 12px; font-size: 16px; font-weight: 600; line-height: 1.3; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile .card-sub { margin-top: 3px; font-size: 13.5px; color: var(--text-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.tile.skeleton .card-sub { height: 12px; width: 42%; border-radius: 6px; margin-top: 8px; }
@keyframes shimmer { from { background-position: 100% 0; } to { background-position: 0 0; } }
.empty { color: var(--text-2); font-size: 18px; text-align: center; padding: 72px var(--gutter); margin: 0; }
.empty:empty { display: none; }

/* ---------- Connection speed sheet (slides up; drag it down to close) ---------- */
.sheet-wrap { position: fixed; inset: 0; z-index: 30; display: grid; align-items: end; justify-items: center; }
.scrim { position: absolute; inset: 0; background: rgba(0, 0, 0, .5); opacity: 0; transition: opacity 300ms ease; }
.sheet { position: relative; width: min(560px, 100vw); margin-bottom: 18px; padding: 10px 28px 26px; text-align: center; display: grid; gap: 10px; transform: translateY(calc(100% + 40px)); transition: transform var(--spring-bounce-ms) var(--spring-bounce); touch-action: none; }
.sheet-wrap.open .scrim { opacity: 1; }
.sheet-wrap.open .sheet { transform: translateY(var(--drag, 0px)); }
.sheet-wrap.dragging .sheet { transition: none; }
.grabber { width: 40px; height: 5px; border-radius: 3px; background: var(--text-3); margin: 0 auto 6px; }
.sheet h2 { margin: 4px 0 0; font-size: 22px; }
.sheet .sub { margin: 0; color: var(--text-2); font-size: 15px; }
.speed-out { padding: 18px 0 8px; }
.speed-num { font-size: 56px; font-weight: 700; letter-spacing: -0.03em; line-height: 1; }
.speed-num small { font-size: 20px; font-weight: 600; color: var(--text-2); letter-spacing: 0; margin-left: 4px; }
.speed-verdict { margin-top: 10px; color: var(--text-2); font-size: 16px; }
.speed-out.ok .speed-verdict { color: var(--green); font-weight: 600; }
.speed-out.bad .speed-verdict { color: var(--amber); font-weight: 600; }
.speed-out.pop .speed-num { animation: pop var(--spring-ms) var(--spring) both; }
@keyframes pop { from { transform: scale(.86); opacity: .3; } }
.sheet-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 8px; }

/* ---------- Player ---------- */
#player { background: #000; overflow: hidden; }
#screen { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: contain; z-index: 1; transition: opacity 400ms ease; }
.player-art.gone { opacity: 0; pointer-events: none; }
.glass { background: rgba(30, 28, 26, .55); -webkit-backdrop-filter: blur(14px) saturate(150%); backdrop-filter: blur(14px) saturate(150%); color: #fff; border: 1px solid rgba(255, 255, 255, .08); }
.status { position: absolute; z-index: 3; left: 50%; top: 50%; transform: translate(-50%, -50%); display: flex; align-items: center; gap: 12px; padding: 14px 22px; border-radius: 999px; background: rgba(20, 18, 17, .78); -webkit-backdrop-filter: blur(20px); backdrop-filter: blur(20px); color: #fff; font-size: 18px; font-weight: 600; pointer-events: none; max-width: 80vw; }
.status::before { content: ''; width: 18px; height: 18px; border-radius: 50%; border: 2.5px solid rgba(255, 255, 255, .25); border-top-color: #fff; animation: spin .8s linear infinite; flex: none; }
.status.error { border-radius: 18px; text-align: center; }
.status.error::before { display: none; }
.status:empty { display: none; }
.controls { position: absolute; z-index: 2; inset: 0; display: flex; flex-direction: column; justify-content: space-between; background: linear-gradient(rgba(0, 0, 0, .6), transparent 24%, transparent 66%, rgba(0, 0, 0, .74)); color: #fff; transition: opacity 260ms ease, visibility 0s; }
.controls.hide { opacity: 0; visibility: hidden; pointer-events: none; transition: opacity 400ms ease, visibility 0s 400ms; }
.controls .row { display: flex; align-items: center; gap: 14px; padding: 20px 28px; }
.row.top .title { flex: 1; font-size: 21px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; text-shadow: 0 1px 8px rgba(0, 0, 0, .5); }
.icon-btn.glass { width: 50px; height: 50px; }
.pill { appearance: none; -webkit-appearance: none; height: 44px; padding: 0 16px; border-radius: 999px; font-size: 16px; font-weight: 600; max-width: 26vw; text-overflow: ellipsis; background: rgba(30, 28, 26, .58); -webkit-backdrop-filter: blur(14px); backdrop-filter: blur(14px); color: #fff; border: 1px solid rgba(255, 255, 255, .1); cursor: pointer; }
.pill option { background: #1b1917; color: #fff; }
.row.mid { justify-content: center; gap: 52px; }
.round { width: 84px; height: 84px; border-radius: 50%; display: grid; place-items: center; transition: transform var(--spring-quick-ms) var(--spring-quick), background-color 180ms; }
.round .i { width: 40px; height: 40px; }
.round.big { width: 112px; height: 112px; }
.round.big .i { width: 50px; height: 50px; }
.round:active { transform: scale(.88); background: rgba(70, 66, 62, .6); }
.row.bottom { gap: 16px; padding-bottom: 26px; }
.row.bottom span { min-width: 72px; text-align: center; font-size: 16px; font-weight: 600; text-shadow: 0 1px 6px rgba(0, 0, 0, .5); }
#seek { -webkit-appearance: none; appearance: none; flex: 1; height: 44px; background: transparent; margin: 0; cursor: pointer; --p: 0%; }
#seek::-webkit-slider-runnable-track { height: 6px; border-radius: 3px; background: linear-gradient(var(--accent), var(--accent)) 0 0 / var(--p) 100% no-repeat, rgba(255, 255, 255, .28); }
#seek::-webkit-slider-thumb { -webkit-appearance: none; width: 22px; height: 22px; margin-top: -8px; border-radius: 50%; background: #fff; box-shadow: 0 2px 8px rgba(0, 0, 0, .4); transform: scale(.55); transition: transform var(--spring-quick-ms) var(--spring-quick); }
#seek:active::-webkit-slider-thumb, #seek:focus-visible::-webkit-slider-thumb { transform: scale(1); transition-duration: var(--press); }
#seek:focus-visible { outline: none; }
#seek::-moz-range-track { height: 6px; border-radius: 3px; background: rgba(255, 255, 255, .28); }
#seek::-moz-range-progress { height: 6px; border-radius: 3px; background: var(--accent); }
.resume { position: absolute; z-index: 4; left: 50%; top: 50%; transform: translate(-50%, -50%); padding: 24px; display: grid; gap: 18px; min-width: min(460px, 90vw); animation: rise 360ms var(--ease-out) both; }
.resume-title { font-family: var(--display); font-size: 26px; font-weight: 600; line-height: 1.15; text-align: center; }
.resume-actions { display: flex; gap: 12px; }
.resume-actions .btn { flex: 1; }

/* Subtitles: text drawn over the picture; they move up while the controls are showing. */
.subs { position: absolute; z-index: 2; left: 4%; right: 4%; bottom: 5%; text-align: center; pointer-events: none; font-size: clamp(22px, 3.4vw, 46px); line-height: 1.35; font-weight: 600; color: #fff; transition: bottom var(--spring-ms) var(--spring); }
.subs span { background: rgba(0, 0, 0, .62); padding: .04em .35em; border-radius: .2em; -webkit-box-decoration-break: clone; box-decoration-break: clone; }
.subs.top { bottom: auto; top: 5%; }
.controls:not(.hide) ~ .subs:not(.top) { bottom: 130px; }

/* "Next episode": the Play now button fills as the countdown runs */
.upnext { position: absolute; z-index: 4; right: 28px; bottom: 116px; width: min(420px, calc(100vw - 56px)); padding: 20px 20px 18px; display: grid; gap: 14px; border-radius: 22px; background: rgba(23, 21, 19, .92); animation: rise 420ms var(--ease-out) both; }
.un-name { font-family: var(--display); font-size: 24px; font-weight: 600; line-height: 1.15; }
.un-count { color: var(--text-2); font-size: 15px; margin-top: 2px; }
.un-actions { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.un-actions .btn { min-height: 52px; }
.sweep { position: absolute; inset: 0; background: rgba(255, 255, 255, .18); transform: scaleX(0); transform-origin: left; pointer-events: none; }
.upnext.counting .sweep { animation: sweep var(--count, 10s) linear forwards; }
@keyframes sweep { to { transform: scaleX(1); } }
#upNextPlay > :not(.sweep) { position: relative; }

/* ---------- Reduced motion, transparency, contrast ---------- */
@media (prefers-reduced-motion: reduce) {
  .screen[data-enter], .room > *, .note, .upnext, .login-card, .card, .resume { animation: enter-fade 200ms ease both !important; animation-delay: 0ms !important; }
  .wcard, .fan, .tile, .btn, .icon-btn, .round, .screen-frame, .switch .knob, .switch-input::after, .seg-thumb, .sheet, .hero-glyph, .subs, .thumb img { transition-duration: 0ms !important; }
  .wcard:hover, .tile:hover, .fan:hover, .wcard:active, .tile:active, .screen-frame:hover, .btn:active, .round:active, .hero-card.on .hero-glyph { transform: none !important; }
  .wcard:hover .thumb img, .tile:hover .thumb img { transform: none; }
  .shake, .speed-out.pop .speed-num, .tile.skeleton .thumb, .tile.skeleton .card-name, .tile.skeleton .card-sub { animation: none; }
}
@media (prefers-reduced-transparency: reduce) {
  .glass, .pill, .toolbar, .status, .search, .screen.scrolled .topbar { -webkit-backdrop-filter: none !important; backdrop-filter: none !important; }
  .toolbar, .screen.scrolled .topbar { background: var(--ground) !important; }
}
@media (prefers-contrast: more) {
  .group, .panel, .hero-card, .thumb { box-shadow: 0 0 0 1px var(--text-3); }
  .row-detail, .footnote, .section-title, .card-sub { color: var(--text); }
}
@media (max-width: 760px) {
  :root { --gutter: 16px; }
  .toolbar { padding: 10px 14px; }
  .topbar { height: auto; min-height: 64px; flex-wrap: wrap; padding-top: 10px; padding-bottom: 10px; }
  .topbar .toolbar-actions { flex: 1 1 100%; min-width: 0; }
  .search { flex: 1; min-width: 0; width: auto; }
  .topbar #teslaFs span { display: none; }
  .room { grid-template-columns: 1fr; }
  .room > :last-child { order: -1; }
  .fans { grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 22px 14px; }
  .row.mid { gap: 30px; }
  .page { padding: 4px 14px 56px; }
}
