:root {
  color-scheme: dark;
  --bg: #111116;
  --panel: #19191f;
  --panel-2: #202027;
  --line: rgba(255,255,255,.085);
  --text: #f5f2f4;
  --muted: #a6a0a9;
  --soft: #77717b;
  --berry: #f16a8a;
  --berry-2: #bd5579;
  --gold: #e7c28a;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  min-width: 320px;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(ellipse at 75% -10%, rgba(158,65,102,.18), transparent 34rem),
    radial-gradient(ellipse at -10% 40%, rgba(105,69,118,.09), transparent 30rem),
    var(--bg);
}
button, input { font: inherit; }
button { color: inherit; }
.app-shell { width: min(1280px, calc(100% - 56px)); margin: 0 auto; }
.topbar { display:flex; align-items:center; gap:28px; min-height:82px; border-bottom:1px solid var(--line); }
.brand { display:flex; align-items:center; gap:11px; min-width:160px; color:var(--text); text-decoration:none; }
.brand-name { font-size:22px; font-weight:780; letter-spacing:.04em; }
.brand-mark { width:29px; height:29px; position:relative; display:inline-flex; align-items:center; justify-content:center; gap:2px; transform:rotate(-12deg); }
.brand-mark i { display:block; width:8px; height:15px; border-radius:8px 8px 7px 7px; background:linear-gradient(145deg,#ff9aac,#d64f78); transform:rotate(18deg); box-shadow:0 3px 12px rgba(232,84,125,.2); }
.brand-mark i:nth-child(2) { height:18px; margin-top:-5px; background:linear-gradient(145deg,#ffb0bb,#e56b83); }
.brand-mark i:nth-child(3) { background:linear-gradient(145deg,#d95b83,#a94270); }
.search-box { height:43px; max-width:520px; flex:1; display:flex; align-items:center; gap:10px; padding:0 6px 0 15px; border:1px solid var(--line); border-radius:13px; background:rgba(255,255,255,.045); transition:border-color .2s,background .2s; }
.search-box:focus-within { border-color:rgba(241,106,138,.55); background:rgba(255,255,255,.065); }
.search-icon { color:var(--muted); font-size:25px; line-height:1; transform:rotate(-20deg); }
.search-box input { flex:1 1 auto; min-width:0; width:100%; border:0; outline:0; color:var(--text); background:transparent; font-size:14px; }
.search-box input::placeholder { color:#817a85; }
.search-box button { flex:0 0 auto; min-width:64px; height:31px; padding:0 12px; border:0; border-radius:9px; background:#bd5579; color:white; cursor:pointer; font-size:13px; font-weight:650; line-height:1; white-space:nowrap; writing-mode:horizontal-tb; text-orientation:mixed; }
.lan-pill { display:flex; align-items:center; gap:8px; color:#c6bec7; white-space:nowrap; font-size:12px; }
.lan-pill span,.eyebrow-dot { width:7px; height:7px; display:inline-block; background:#83d5ae; border-radius:50%; box-shadow:0 0 10px rgba(131,213,174,.5); }
.main-nav { display:flex; gap:31px; height:57px; align-items:center; border-bottom:1px solid var(--line); overflow-x:auto; scrollbar-width:none; }
.main-nav::-webkit-scrollbar { display:none; }
.nav-item { position:relative; height:100%; flex:none; border:0; padding:0 2px; background:transparent; color:var(--muted); cursor:pointer; font-size:14px; transition:color .2s; }
.nav-item:hover,.nav-item.active { color:var(--text); }
.nav-item.active { font-weight:700; }
.nav-item.active::after { content:""; position:absolute; left:0; right:0; bottom:-1px; height:2px; background:var(--berry); border-radius:2px; }
main { min-height:65vh; }
.welcome { min-height:232px; margin:29px 0 35px; padding:34px 42px; position:relative; overflow:hidden; display:flex; align-items:center; border:1px solid rgba(255,255,255,.07); border-radius:22px; background:linear-gradient(105deg,#38202d 0%,#2b202d 48%,#1e1c27 100%); box-shadow:0 20px 60px rgba(0,0,0,.16); }
.welcome::after { content:""; position:absolute; inset:0; background:linear-gradient(90deg,rgba(0,0,0,.1),transparent 66%); pointer-events:none; }
.welcome-copy { position:relative; z-index:1; }
.eyebrow { display:flex; align-items:center; gap:9px; color:#e2b1be; letter-spacing:.16em; font-size:9px; font-weight:750; }
.eyebrow-dot { width:5px; height:5px; background:#f18ca4; box-shadow:none; }
.welcome h1 { margin:15px 0 8px; font-size:clamp(31px,4vw,46px); letter-spacing:-.055em; line-height:1.13; font-weight:760; }
.welcome h1 em { color:#f18ba4; font-style:normal; }
.welcome p { margin:0; color:#c0afb9; font-size:14px; }
.welcome-art { position:absolute; right:10%; top:50%; width:220px; height:220px; transform:translateY(-50%); }
.art-orbit { position:absolute; border:1px solid rgba(244,160,183,.22); border-radius:50%; transform:rotate(-25deg); }
.orbit-one { inset:10px 0; }
.orbit-two { inset:31px -10px; transform:rotate(38deg); border-color:rgba(238,186,201,.15); }
.art-berry { position:absolute; inset:52px 66px; display:grid; place-items:center; border-radius:43% 48% 49% 43%; transform:rotate(-13deg); color:#ffe1e7; font-size:44px; font-weight:800; background:linear-gradient(145deg,#f08ba6,#a53f70); box-shadow:0 13px 44px rgba(191,67,112,.4),inset 5px 7px 16px rgba(255,255,255,.2); }
.art-spark { position:absolute; color:#ffcfb9; }
.spark-one { top:20px; right:24px; font-size:22px; }
.spark-two { bottom:20px; left:24px; font-size:17px; }
.section-heading { display:flex; justify-content:space-between; align-items:end; gap:20px; margin-bottom:19px; }
.section-kicker { color:var(--berry); font-size:11px; font-weight:700; letter-spacing:.12em; }
.section-heading h2 { margin:6px 0 5px; font-size:25px; letter-spacing:-.04em; }
.section-heading p { margin:0; color:var(--muted); font-size:13px; }
.subtle-button { display:flex; align-items:center; gap:8px; padding:9px 12px; border:1px solid var(--line); border-radius:10px; background:rgba(255,255,255,.035); color:#c6bdc7; cursor:pointer; font-size:13px; }
.subtle-button:hover { border-color:rgba(241,106,138,.4); color:#fff; }
.filter-tags { display:flex; flex-direction:column; gap:9px; margin:-4px 0 15px; }
.filter-tags[hidden] { display:none; }
.filter-row { display:flex; align-items:center; gap:10px; min-width:0; }
.filter-label { flex:none; width:42px; color:var(--soft); font-size:11px; font-weight:650; }
.filter-list { display:flex; align-items:center; gap:7px; min-width:0; max-width:100%; overflow-x:auto; padding:2px 1px 5px; scrollbar-width:thin; scrollbar-color:rgba(241,106,138,.3) transparent; }
.filter-tag { flex:none; border:1px solid var(--line); border-radius:999px; padding:7px 13px; background:rgba(255,255,255,.035); color:#c9c1cc; cursor:pointer; white-space:nowrap; font-size:12px; line-height:1.2; transition:background .15s,border-color .15s,color .15s; }
.filter-tag:hover { border-color:rgba(241,106,138,.45); color:#fff; }
.filter-tag.active { border-color:rgba(241,106,138,.55); background:rgba(241,106,138,.16); color:#ffd7e1; box-shadow:inset 0 0 0 1px rgba(241,106,138,.08); }
.status { min-height:21px; margin:0 0 13px; color:var(--soft); font-size:12px; }
.status.error { color:#f19aa9; }
.series-grid { display:grid; grid-template-columns:repeat(6,minmax(0,1fr)); gap:24px 17px; }
.series-card { min-width:0; cursor:pointer; }
.poster-wrap { aspect-ratio:3/4; position:relative; overflow:hidden; border-radius:12px; background:linear-gradient(145deg,#302832,#24242d); box-shadow:0 9px 22px rgba(0,0,0,.2); }
.poster-wrap img { width:100%; height:100%; display:block; object-fit:cover; transition:transform .35s,filter .35s; }
.series-card:hover .poster-wrap img { transform:scale(1.045); filter:brightness(1.08); }
.poster-placeholder { height:100%; display:grid; place-items:center; color:rgba(255,255,255,.45); font-size:32px; background:radial-gradient(circle at 55% 35%,rgba(238,130,162,.27),transparent 55%),linear-gradient(145deg,#38303b,#24242d); }
.poster-tag { position:absolute; left:8px; top:8px; padding:4px 7px; border:1px solid rgba(255,255,255,.16); border-radius:6px; color:#fff; background:rgba(17,17,22,.65); backdrop-filter:blur(8px); font-size:10px; }
.poster-progress { position:absolute; left:8px; right:8px; bottom:8px; height:3px; border-radius:4px; background:rgba(255,255,255,.35); overflow:hidden; }
.poster-progress span { display:block; width:32%; height:100%; background:#ee839f; }
.card-title { margin:10px 0 4px; overflow:hidden; color:#eee8ed; font-size:13px; line-height:1.45; font-weight:650; text-overflow:ellipsis; white-space:nowrap; }
.card-meta { color:#8d8691; font-size:11px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.feature-card { margin:0 0 23px; padding:17px; border:1px solid var(--line); border-radius:16px; background:linear-gradient(100deg,rgba(177,80,115,.12),rgba(255,255,255,.025)); }
.feature-inner { display:flex; gap:18px; align-items:center; }
.feature-inner img { width:74px; height:98px; object-fit:cover; border-radius:9px; }
.feature-text { min-width:0; }
.feature-label { color:var(--gold); font-size:10px; letter-spacing:.12em; }
.feature-text h3 { margin:7px 0 5px; font-size:18px; }
.feature-text p { margin:0; color:var(--muted); font-size:12px; }
.load-more-wrap { display:flex; flex-direction:column; align-items:center; gap:12px; padding:23px 0 35px; }
.pagination-tag { max-width:100%; padding:7px 12px; border:1px solid rgba(255,255,255,.09); border-radius:999px; background:rgba(255,255,255,.035); color:#a9a1ac; text-align:center; font-size:11px; }
.pagination-tag[hidden] { display:none; }
.load-more { padding:11px 24px; border:1px solid rgba(241,106,138,.35); border-radius:11px; background:rgba(241,106,138,.09); color:#f3b0c0; cursor:pointer; font-size:13px; }
.load-more:disabled { opacity:.5; cursor:wait; }
.empty-state { grid-column:1/-1; min-height:160px; display:grid; place-items:center; border:1px dashed var(--line); border-radius:14px; color:var(--muted); font-size:13px; }
.footer { display:flex; justify-content:space-between; gap:16px; padding:24px 0 34px; border-top:1px solid var(--line); color:#77717b; font-size:11px; }
.footer b { color:#c7a4b0; font-weight:600; }
.detail-dialog { width:min(760px,calc(100% - 28px)); max-height:min(88vh,850px); padding:0; border:1px solid rgba(255,255,255,.13); border-radius:18px; color:var(--text); background:#19191f; box-shadow:0 30px 100px rgba(0,0,0,.65); }
.detail-dialog::backdrop { background:rgba(5,5,9,.78); backdrop-filter:blur(5px); }
.dialog-close {
  -webkit-appearance: none;
  appearance: none;
  position: sticky;
  float: right;
  top: 12px;
  z-index: 3;
  margin: 12px 12px -45px 0;
  display: grid;
  place-items: center;
  box-sizing: border-box;
  flex: none;
  width: 34px;
  min-width: 34px;
  height: 34px;
  min-height: 34px;
  padding: 0;
  border: 1px solid rgba(241,106,138,.72);
  border-radius: 50%;
  color: #f5f2f4;
  background: rgba(20,20,25,.8);
  font-size: 0;
  line-height: 1;
  text-align: center;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.dialog-close::before,
.dialog-close::after {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 13px;
  height: 1.5px;
  border-radius: 2px;
  background: currentColor;
  transform: translate(-50%, -50%) rotate(45deg);
  pointer-events: none;
}
.dialog-close::after {
  transform: translate(-50%, -50%) rotate(-45deg);
}
.dialog-close:focus,
.dialog-close:focus-visible {
  outline: none;
  border-color: #f16a8a;
}
.detail-content { padding:25px; }
.detail-hero { display:flex; gap:22px; padding:8px 0 22px; }
.detail-hero img { width:130px; height:174px; flex:none; object-fit:cover; border-radius:11px; }
.detail-copy { min-width:0; padding:7px 0; }
.detail-copy h2 { margin:0 0 9px; font-size:24px; line-height:1.25; }
.detail-copy p { color:var(--muted); font-size:13px; line-height:1.7; }
.detail-meta { color:#d8a6b4; font-size:12px; }
.episode-heading { margin:8px 0 12px; font-size:15px; }
.episode-grid { display:grid; grid-template-columns:repeat(8,minmax(0,1fr)); gap:8px; }
.episode-chip { min-height:40px; border:1px solid var(--line); border-radius:8px; background:rgba(255,255,255,.035); color:#d9d2dc; cursor:pointer; font-size:12px; }
.episode-chip:disabled { opacity:.5; cursor:not-allowed; }
.player-note { margin-top:18px; padding:13px 15px; border-radius:10px; color:#bcb2bd; background:rgba(255,255,255,.045); font-size:12px; line-height:1.6; }
.toast { position:fixed; z-index:20; left:50%; bottom:24px; transform:translate(-50%,15px); max-width:calc(100% - 32px); padding:11px 16px; border:1px solid var(--line); border-radius:11px; opacity:0; pointer-events:none; color:#f1eaf0; background:#28242c; box-shadow:0 10px 30px rgba(0,0,0,.4); font-size:12px; transition:opacity .2s,transform .2s; }
.toast.show { opacity:1; transform:translate(-50%,0); }
@media (max-width:1050px) { .series-grid { grid-template-columns:repeat(5,minmax(0,1fr)); } .welcome-art { right:5%; } }
@media (max-width:760px) {
  .app-shell { width:calc(100% - 32px); }
  .topbar { min-height:68px; gap:13px; flex-wrap:wrap; padding:13px 0; }
  .brand { min-width:0; }
  .brand-name { font-size:20px; }
  .search-box { order:3; flex-basis:100%; max-width:none; }
  .lan-pill { margin-left:auto; font-size:11px; }
  .main-nav { height:52px; gap:25px; }
  .welcome { min-height:185px; margin:20px 0 28px; padding:26px 24px; border-radius:17px; }
  .welcome-art { width:150px; height:150px; right:-7px; opacity:.78; }
  .art-berry { inset:37px 47px; font-size:31px; }
  .welcome h1 { max-width:245px; font-size:33px; }
  .welcome p { max-width:240px; font-size:12px; line-height:1.65; }
  .eyebrow { font-size:8px; letter-spacing:.1em; }
  .section-heading h2 { font-size:22px; }
  .section-heading p { max-width:250px; font-size:12px; }
  .filter-row { align-items:flex-start; gap:7px; }
  .filter-label { width:35px; padding-top:8px; font-size:10px; }
  .filter-list { flex:1; }
  .filter-tag { padding:7px 11px; font-size:11px; }
  .series-grid { grid-template-columns:repeat(3,minmax(0,1fr)); gap:20px 12px; }
  .poster-wrap { border-radius:9px; }
  .card-title { margin-top:8px; font-size:12px; }
  .card-meta { font-size:10px; }
  .footer { flex-direction:column; gap:8px; }
  .detail-content { padding:20px 17px; }
  .detail-hero { gap:14px; }
  .detail-hero img { width:100px; height:134px; }
  .detail-copy h2 { font-size:19px; }
  .episode-grid { grid-template-columns:repeat(5,minmax(0,1fr)); }
}
@media (max-width:390px) {
  .app-shell { width:calc(100% - 24px); }
  .welcome-art { right:-26px; opacity:.55; }
  .welcome-copy { max-width:90%; }
  .series-grid { gap:17px 9px; }
}

.favorite-tag { left:auto; right:8px; }
.detail-placeholder { width:100px; height:134px; border-radius:10px; flex:none; }

.playback-panel { margin:0 0 22px; padding:13px; border:1px solid rgba(241,106,138,.22); border-radius:14px; background:rgba(0,0,0,.28); }
.playback-panel[hidden] { display:none; }
.player-toolbar { display:flex; align-items:center; gap:12px; min-height:34px; margin-bottom:10px; color:#eee4eb; font-size:12px; }
.player-toolbar > span { flex:1; min-width:0; overflow:hidden; white-space:nowrap; text-overflow:ellipsis; font-weight:650; }
.quality-control { display:flex; align-items:center; gap:7px; color:var(--muted); white-space:nowrap; }
.quality-control select { max-width:130px; padding:6px 8px; border:1px solid var(--line); border-radius:8px; color:var(--text); background:#24222a; font-size:11px; }
.player-close { padding:6px 10px; border:1px solid var(--line); border-radius:8px; color:#d7cbd3; background:rgba(255,255,255,.045); cursor:pointer; font-size:11px; }
#web-player { display:block; width:100%; max-height:min(58vh,560px); aspect-ratio:16/9; border-radius:10px; background:#050507; object-fit:contain; }
.playback-status { padding:9px 2px 0; color:#b9adb8; font-size:11px; line-height:1.55; }
.episode-chip:not(:disabled):hover { border-color:rgba(241,106,138,.45); color:#fff; background:rgba(241,106,138,.1); }
.episode-chip:disabled { opacity:.4; cursor:not-allowed; }
@media (max-width:520px) {
  .playback-panel { margin-left:-5px; margin-right:-5px; padding:9px; }
  .player-toolbar { flex-wrap:wrap; }
  .player-toolbar > span { flex-basis:100%; }
  .quality-control { margin-left:auto; }
  #web-player { max-height:48vh; }
}

.player-toolbar { flex-wrap:wrap; }
.player-action { padding:6px 10px; border:1px solid rgba(241,106,138,.32); border-radius:8px; color:#ffd9e2; background:rgba(241,106,138,.1); cursor:pointer; font-size:11px; white-space:nowrap; }
.player-action:disabled,.player-nav button:disabled { opacity:.35; cursor:not-allowed; }
.player-stage { position:relative; overflow:hidden; border-radius:10px; background:#050507; touch-action:pan-y; }
#web-player { display:block; width:100%; max-height:min(58vh,560px); aspect-ratio:16/9; border-radius:10px; background:#050507; object-fit:contain; }
.player-stage:fullscreen { width:100vw; height:100vh; display:grid; place-items:center; border-radius:0; background:#000; }
.player-stage:fullscreen #web-player { width:100%; height:100%; max-height:100vh; aspect-ratio:auto; }
.swipe-hint { position:absolute; left:50%; bottom:12px; transform:translateX(-50%); padding:5px 9px; border-radius:20px; color:rgba(255,255,255,.58); background:rgba(0,0,0,.42); font-size:10px; pointer-events:none; opacity:.9; }
.player-nav { display:flex; justify-content:space-between; gap:10px; padding-top:9px; }
.player-nav[hidden] { display:none !important; }
.player-nav button { min-width:96px; padding:7px 14px; border:1px solid var(--line); border-radius:8px; color:#d8cbd4; background:rgba(255,255,255,.04); cursor:pointer; font-size:11px; }
.cast-dialog { width:min(440px,calc(100% - 28px)); }
.cast-dialog-content { display:grid; gap:9px; }
.cast-device { width:100%; display:flex; align-items:center; gap:12px; padding:13px; border:1px solid var(--line); border-radius:11px; color:var(--text); text-align:left; background:rgba(255,255,255,.035); cursor:pointer; }
.cast-device:disabled { opacity:.5; }
.cast-device.sending { border-color:rgba(241,106,138,.6); }
.cast-tv-icon { width:34px; height:34px; display:grid; place-items:center; border-radius:9px; color:#f4a6bb; background:rgba(241,106,138,.12); font-size:20px; }
.cast-device span:nth-child(2) { min-width:0; flex:1; display:grid; gap:4px; }
.cast-device strong { font-size:13px; }
.cast-device small { color:var(--muted); font-size:10px; }
.cast-chevron { color:var(--muted); font-size:20px; }
.cast-empty { padding:18px 12px; color:var(--muted); font-size:13px; line-height:1.7; }
.episode-chip.playing { border-color:var(--berry); color:#ffdbe4; background:rgba(241,106,138,.14); }
@media (max-width:520px) {
  .player-toolbar { gap:7px; }
  .quality-control select { max-width:90px; }
  .player-action,.player-close { padding:6px 8px; }
  .player-nav button { min-width:0; flex:1; }
}

#playback-panel:fullscreen, #playback-panel:-webkit-full-screen, #playback-panel.manual-fullscreen {
  position:fixed; inset:0; z-index:9999; width:100vw; height:100dvh; max-height:100dvh;
  margin:0; padding:12px; display:flex; flex-direction:column; justify-content:center;
  overflow:auto; border:0; border-radius:0; background:#050507;
}
#playback-panel:fullscreen .player-stage, #playback-panel:-webkit-full-screen .player-stage, #playback-panel.manual-fullscreen .player-stage {
  flex:1; min-height:0; display:flex; align-items:center; justify-content:center;
}
#playback-panel:fullscreen #web-player, #playback-panel:-webkit-full-screen #web-player, #playback-panel.manual-fullscreen #web-player {
  width:100%; max-height:calc(100dvh - 185px); aspect-ratio:16/9;
}
#playback-panel:fullscreen .player-toolbar, #playback-panel:-webkit-full-screen .player-toolbar, #playback-panel.manual-fullscreen .player-toolbar { flex:none; }
#playback-panel:fullscreen .player-nav, #playback-panel:-webkit-full-screen .player-nav, #playback-panel.manual-fullscreen .player-nav { flex:none; }
#web-player:fullscreen, #web-player:-webkit-full-screen {
  width:100vw; height:100dvh; max-height:none; aspect-ratio:auto; border-radius:0; object-fit:contain; background:#000;
}
#player-stage { touch-action:pan-x; }


/* Multi-season selector, matching 开心果’s selectable season chips. */
.season-section { margin:0 0 22px; padding:14px; border:1px solid rgba(241,106,138,.22); border-radius:14px; background:rgba(241,106,138,.045); }
.season-section[hidden] { display:none; }
.season-header { display:flex; align-items:center; justify-content:space-between; gap:12px; margin-bottom:12px; }
.season-heading { margin:0; font-size:15px; }
.season-list { display:flex; flex-wrap:wrap; gap:8px; }
.season-chip { display:inline-flex; align-items:center; justify-content:center; gap:7px; min-height:39px; padding:7px 12px; border:1px solid var(--line); border-radius:9px; color:#ded4dd; background:rgba(255,255,255,.035); cursor:pointer; font-size:12px; }
.season-chip small { color:var(--muted); font-size:10px; }
.season-chip.active { border-color:rgba(241,106,138,.75); color:#ffe1e8; background:rgba(241,106,138,.15); box-shadow:inset 0 0 0 1px rgba(241,106,138,.08); }
.season-chip:disabled { opacity:.42; cursor:not-allowed; }
.season-loading,.season-load-error { align-self:center; color:var(--muted); font-size:12px; }
.season-retry { padding:6px 10px; border:1px solid var(--line); border-radius:8px; background:rgba(255,255,255,.04); cursor:pointer; font-size:11px; }
@media (max-width:520px) { .season-section { margin-left:-2px; margin-right:-2px; padding:11px; } .season-chip { min-height:37px; padding:7px 10px; } }

.topbar-actions .lan-pill { margin-left:0; }


/* Web fullscreen: keep the controls inside the modal and avoid the browser Fullscreen API. */
#detail-dialog.player-web-fullscreen {
  position:fixed; inset:0; width:100vw; max-width:none; height:100vh; height:100dvh;
  max-height:none; margin:0; padding:0; border:0; border-radius:0; overflow:hidden;
  box-sizing:border-box; background:#050507;
}
#detail-dialog.player-web-fullscreen::backdrop { background:#050507; backdrop-filter:none; }
#detail-dialog.player-web-fullscreen .detail-content {
  position:relative; width:100%; height:100%; min-height:0; max-height:100%; padding:0; overflow:hidden;
}
#detail-dialog.player-web-fullscreen .dialog-close { display:none; }
#playback-panel.web-fullscreen {
  position:absolute; inset:0; z-index:5; width:100%; height:100%; max-height:100%; min-height:0;
  margin:0; padding:max(8px,env(safe-area-inset-top)) max(8px,env(safe-area-inset-right))
    max(8px,env(safe-area-inset-bottom)) max(8px,env(safe-area-inset-left));
  display:flex; flex-direction:column; justify-content:center; overflow:hidden;
  border:0; border-radius:0; background:#050507; box-sizing:border-box;
}
#playback-panel.web-fullscreen .player-toolbar {
  position:absolute; z-index:8; top:0; left:0; right:0; flex:0 0 auto; gap:7px;
  margin:0; padding:calc(env(safe-area-inset-top) + 8px) calc(env(safe-area-inset-right) + 12px) 12px calc(env(safe-area-inset-left) + 12px);
  background:linear-gradient(180deg,rgba(0,0,0,.82),rgba(0,0,0,.48) 76%,transparent);
  backdrop-filter:blur(10px); box-sizing:border-box;
  opacity:0; visibility:hidden; pointer-events:none; transform:translateY(-10px);
  transition:opacity .18s ease,transform .18s ease,visibility .18s;
}
#playback-panel.web-fullscreen.player-controls-visible .player-toolbar {
  opacity:1; visibility:visible; pointer-events:auto; transform:translateY(0);
}
#playback-panel.web-fullscreen .player-toolbar > span { flex:1 1 150px; min-width:0; }
#playback-panel.web-fullscreen .player-stage {
  flex:1 1 auto; min-height:0; min-width:0; width:100%;
  display:flex; align-items:center; justify-content:center; border-radius:0;
}
#playback-panel.web-fullscreen #web-player {
  width:100%; height:100%; max-height:none; aspect-ratio:auto; border-radius:0; object-fit:contain;
}
#playback-panel.web-fullscreen .player-nav, #playback-panel.web-fullscreen .player-nav[hidden] { display:none !important; }
#playback-panel.web-fullscreen .playback-status { display:none; }
#playback-panel.web-fullscreen #web-player::-webkit-media-controls-fullscreen-button { display:none; }
@media (orientation:landscape) and (max-height:500px) {
  #playback-panel.web-fullscreen { padding:4px max(8px,env(safe-area-inset-right)) 4px max(8px,env(safe-area-inset-left)); }
  #playback-panel.web-fullscreen .player-toolbar { gap:5px; padding:calc(env(safe-area-inset-top) + 6px) calc(env(safe-area-inset-right) + 8px) 8px calc(env(safe-area-inset-left) + 8px); }
  #playback-panel.web-fullscreen .player-toolbar > span { flex-basis:120px; }
  #playback-panel.web-fullscreen .player-nav { padding-top:3px; }
  #playback-panel.web-fullscreen .playback-status { display:none; }
}


/* Add-to-home-screen / install entry */
.topbar-actions { display:flex; align-items:center; gap:9px; flex:none; }
.install-button {
  flex:none; padding:8px 11px; border:1px solid rgba(241,106,138,.34); border-radius:10px;
  color:#ffdce5; background:rgba(241,106,138,.10); cursor:pointer; font-size:12px; white-space:nowrap;
}
.install-button:hover { background:rgba(241,106,138,.17); }
.install-dialog { width:min(520px,calc(100% - 28px)); }
.install-dialog-content h2 { margin:0 0 14px; font-size:21px; }
.install-steps { display:grid; gap:12px; padding-left:23px; color:#e2d9e1; font-size:14px; line-height:1.7; }
.install-note { padding:12px 14px; border-radius:10px; background:rgba(255,255,255,.045); color:var(--muted); font-size:12px; line-height:1.7; }
body { padding-top:env(safe-area-inset-top); }

/* Hold-to-boost is deliberately separate from the user's selected playback speed. */
.hold-speed-button { -webkit-user-select:none; user-select:none; -webkit-touch-callout:none; touch-action:none; }
.hold-speed-button.holding { border-color:#ff93ac; color:#fff; background:#b8436c; box-shadow:0 0 0 3px rgba(241,106,138,.18); }
.player-speed-indicator {
  position:absolute; z-index:4; left:50%; top:50%; transform:translate(-50%,-50%);
  padding:10px 16px; border:1px solid rgba(255,255,255,.2); border-radius:99px;
  color:#fff; background:rgba(20,13,21,.78); box-shadow:0 8px 30px rgba(0,0,0,.35);
  font-size:14px; font-weight:750; pointer-events:none;
}
.player-speed-indicator[hidden], .pip-hold-speed[hidden] { display:none !important; }
.pip-hold-speed {
  position:fixed; z-index:10002; right:max(14px,env(safe-area-inset-right));
  bottom:max(18px,env(safe-area-inset-bottom)); min-height:46px; padding:10px 16px;
  border:1px solid rgba(255,255,255,.28); border-radius:999px; color:#fff;
  background:rgba(184,67,108,.96); box-shadow:0 8px 28px rgba(0,0,0,.45);
  font-size:13px; font-weight:750; cursor:pointer;
}
@media (max-width:760px) {
  .topbar-actions { flex:1 1 auto; justify-content:flex-end; flex-wrap:wrap; gap:6px; }
  .topbar-actions .lan-pill { display:none; }
}
@media (max-width:520px) {
  .topbar-actions { gap:6px; }
  .install-button { padding:7px 9px; font-size:11px; }
}

.player-action.unavailable { opacity:.58; border-style:dashed; cursor:help; }


/* Cloudflare Lite does not expose N1 resident-cache controls. */
.settings-form[hidden], .settings-form { display: none !important; }


/* Compact Cloudflare deployment guide available directly from the homepage. */
.settings-button {
  flex:none; padding:8px 11px; border:1px solid var(--line); border-radius:10px;
  color:var(--text); background:rgba(255,255,255,.035); cursor:pointer; font-size:12px; white-space:nowrap;
}
.settings-button:hover { border-color:rgba(241,106,138,.42); background:rgba(241,106,138,.08); }
.settings-dialog .detail-content { max-height:min(82vh,780px); overflow:auto; }
.deployment-guide { display:grid; gap:15px; color:var(--text); font-size:13px; line-height:1.72; }
.deployment-guide p { margin:0; }
.deployment-guide h3 { margin:0 0 8px; font-size:14px; }
.deployment-guide .guide-intro { color:#f2dce4; }
.deployment-guide .guide-steps { display:grid; gap:7px; margin:0; padding-left:22px; }
.deployment-guide code { padding:1px 4px; border:1px solid rgba(255,255,255,.10); border-radius:5px; color:#ffe2e9; background:rgba(255,255,255,.045); overflow-wrap:anywhere; }
.deployment-guide a { color:#ff9eb4; text-decoration:underline; text-underline-offset:3px; }
.deployment-guide .guide-section { display:grid; gap:5px; }
.deployment-guide .guide-links { display:flex; flex-wrap:wrap; gap:8px; }
.deployment-guide .guide-note { padding:10px 12px; border:1px solid rgba(255,255,255,.09); border-radius:9px; color:var(--muted); font-size:11px; }
@media (max-width:520px) {
  .settings-button { padding:7px 8px; font-size:11px; }
  .deployment-guide { gap:12px; font-size:12px; }
  .deployment-guide h3 { font-size:13px; }
  .deployment-guide .guide-note { overflow-wrap:anywhere; }
}


/* In-app DEBUG viewer */
.debug-button {
  display:inline-flex; align-items:center; gap:7px; padding:8px 11px;
  border:1px solid rgba(231,194,138,.32); border-radius:10px;
  color:#f0d7ad; background:rgba(231,194,138,.075); cursor:pointer;
  white-space:nowrap; font-size:12px; font-weight:700; letter-spacing:.02em;
}
.debug-button:hover { border-color:rgba(231,194,138,.65); background:rgba(231,194,138,.14); }
.debug-button span {
  min-width:18px; padding:2px 5px; border-radius:999px;
  color:#18151a; background:#e7c28a; text-align:center; font-size:10px; line-height:1.2;
}
.debug-dialog { width:min(1000px,calc(100% - 28px)); max-height:90vh; }
.debug-dialog .detail-content { padding:24px; }
.debug-heading { display:flex; align-items:flex-start; justify-content:space-between; gap:18px; margin:4px 0 15px; }
.debug-heading h2 { margin:5px 0 6px; font-size:22px; }
.debug-heading p { margin:0; }
.debug-runtime-badge {
  flex:none; padding:7px 10px; border:1px solid rgba(131,213,174,.3);
  border-radius:999px; color:#9ddfbe; background:rgba(131,213,174,.08); font-size:11px;
}
.debug-runtime-badge.error { color:#ff9ead; border-color:rgba(241,106,138,.4); background:rgba(241,106,138,.1); }
.debug-summary {
  padding:10px 12px; border:1px solid var(--line); border-radius:10px;
  color:#c9c1cc; background:rgba(255,255,255,.035); font-size:11px; line-height:1.8;
}
.debug-actions { display:flex; flex-wrap:wrap; gap:8px; margin:13px 0 8px; }
.debug-actions button { padding:8px 11px; font-size:11px; }
.debug-privacy { margin:0 0 10px; color:#89818d; font-size:10px; line-height:1.6; }
.debug-output {
  min-height:240px; max-height:52vh; overflow:auto; margin:0; padding:13px;
  border:1px solid rgba(255,255,255,.09); border-radius:10px;
  color:#c9d9cd; background:#0d1110; font:11px/1.65 ui-monospace,SFMono-Regular,Consolas,monospace;
  white-space:pre-wrap; overflow-wrap:anywhere; tab-size:2;
}
@media (max-width:760px) {
  .debug-button { padding:7px 8px; font-size:10px; }
  .debug-button span { min-width:16px; }
  .debug-dialog .detail-content { padding:20px 15px; }
  .debug-heading { flex-direction:column; gap:10px; }
  .debug-heading h2 { font-size:19px; }
  .debug-summary { font-size:10px; }
  .debug-actions { gap:6px; }
  .debug-actions button { padding:7px 9px; font-size:10px; }
  .debug-output { min-height:220px; max-height:55vh; padding:10px; font-size:10px; }
}
