:root {
  --bg: #070708;
  --bg-elev: #141416;
  --line: rgba(255, 255, 255, 0.1);
  --text: #f6f4f1;
  --muted: #a39e96;
  --red: #ff2a2a;
  --red-deep: #c8102e;
  --star: #ffc53d;
  --like: #ff2d78;
  --shadow: 0 18px 40px rgba(0, 0, 0, 0.35);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
[hidden] { display: none !important; }

html, body {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  font-family: "SF Pro Text", "Segoe UI", Tahoma, sans-serif;
}

body { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
body.player-page, body.admin-page { padding-bottom: 24px; }
a { color: inherit; text-decoration: none; }
button, input, select { font: inherit; color: inherit; touch-action: manipulation; }
img { max-width: 100%; display: block; }
a:focus-visible, button:focus-visible, input:focus-visible, select:focus-visible {
  outline: 2px solid var(--red);
  outline-offset: 2px;
}

.wrap { width: min(1120px, calc(100% - 32px)); margin: 0 auto; }

.topbar {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 16px 0 8px;
}
.brand { display: flex; align-items: center; gap: 10px; font-weight: 700; letter-spacing: 0.02em; }
.brand img { width: 36px; height: 36px; border-radius: 50%; object-fit: cover; }
.desk-nav { display: none; gap: 18px; }
.desk-nav a { display: flex; align-items: center; min-height: 36px; color: var(--muted); }
.desk-nav a.active { color: var(--text); box-shadow: inset 0 -2px 0 var(--red); }
.top-tools { grid-column: 3; display: flex; align-items: center; justify-content: flex-end; justify-self: end; gap: 8px; }
.lang { display: flex; align-items: center; }
.lang select {
  appearance: none;
  -webkit-appearance: none;
  -webkit-tap-highlight-color: transparent;
  field-sizing: content;
  height: 30px;
  margin: 0;
  padding: 0 12px 0 30px;
  border: 0;
  border-radius: 999px;
  background: rgba(255,255,255,.08) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath fill='%23cfcac3' d='M12 2a10 10 0 1 0 0 20 10 10 0 0 0 0-20Zm6.9 6h-3a15.7 15.7 0 0 0-1.4-3.6A8 8 0 0 1 18.9 8ZM12 4a14 14 0 0 1 1.9 4h-3.8A14 14 0 0 1 12 4ZM4.3 14a8.2 8.2 0 0 1 0-4h3.4a16.5 16.5 0 0 0 0 4H4.3Zm.8 2h3a15.7 15.7 0 0 0 1.4 3.6A8 8 0 0 1 5.1 16Zm3-8h-3a8 8 0 0 1 4.4-3.6A15.7 15.7 0 0 0 8.1 8ZM12 20a14 14 0 0 1-1.9-4h3.8A14 14 0 0 1 12 20Zm2.3-6H9.7a14.7 14.7 0 0 1 0-4h4.6a14.7 14.7 0 0 1 0 4Zm.2 5.6a15.7 15.7 0 0 0 1.4-3.6h3a8 8 0 0 1-4.4 3.6Zm1.8-5.6a16.5 16.5 0 0 0 0-4h3.4a8.2 8.2 0 0 1 0 4h-3.4Z'/%3E%3C/svg%3E") 10px center / 14px 14px no-repeat;
  color: var(--text);
  font-size: 13px;
  line-height: 30px;
  cursor: pointer;
  outline: none;
}
[dir="rtl"] .lang select { padding: 0 30px 0 12px; background-position: right 10px center; }
.lang select:focus-visible { box-shadow: 0 0 0 1px rgba(255,255,255,.35); }
.field select, .modal-card select {
  height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #111;
}

.page-head { padding: 18px 0 14px; }
.page-head h1 { font-size: clamp(28px, 5vw, 42px); letter-spacing: -0.03em; }
.page-head p { max-width: 46rem; margin-top: 8px; color: var(--muted); line-height: 1.5; }

.chip-row { display: flex; align-items: center; justify-content: flex-end; gap: 8px; margin: 8px 0 18px; }
.chips { display: flex; gap: 8px; overflow-x: auto; scrollbar-width: none; flex: 1; min-width: 0; mask-image: linear-gradient(to right, #000 calc(100% - 28px), transparent); }
[dir="rtl"] .chips { mask-image: linear-gradient(to left, #000 calc(100% - 28px), transparent); }
.chips::-webkit-scrollbar { display: none; }
.chip, .icon-round {
  flex: 0 0 auto;
  height: 36px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: transparent;
  color: var(--text);
  cursor: pointer;
}
.chip.active { background: #fff; color: #111; border-color: #fff; }
.icon-round { width: 36px; padding: 0; display: grid; place-items: center; }
.top-search {
  display: none; align-items: center; gap: 8px; width: 260px; height: 36px; padding: 0 14px;
  border: 1px solid rgba(255,255,255,.1); border-radius: 999px; background: #1a1a1e;
  color: var(--muted); font: inherit; font-size: 14px; text-align: start; cursor: pointer;
  transition: border-color .15s, background .15s, color .15s;
}
.top-search:hover { border-color: rgba(255,255,255,.22); background: #212126; color: var(--text); }
.top-search svg { width: 18px; height: 18px; flex: none; }
.top-search span { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-entry {
  display: none; align-items: center; gap: 10px; width: 100%; height: 42px; margin: 4px 0 6px; padding: 0 6px 0 14px;
  border: 1px solid rgba(255,255,255,.08); border-radius: 999px; background: #1a1a1e;
  color: var(--muted); font: inherit; font-size: 14px; text-align: start; cursor: pointer;
}
.search-entry > svg { width: 20px; height: 20px; flex: none; }
.search-entry-hint { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.search-entry-go {
  position: relative; flex: none; padding: 0 10px 0 12px;
  color: rgba(255,255,255,.88); font-size: 14px; font-weight: 500;
}
.search-entry-go::before {
  content: ""; position: absolute; inset-inline-start: 0; top: 50%; width: 1px; height: 14px;
  transform: translateY(-50%); background: rgba(255,255,255,.16);
}
@media (max-width: 899px) {
  .search-entry { display: flex; }
}
.chip-row:has(> .chips[hidden]) { display: none; }
.chip-row:has(> .chips[hidden]) + .shows { margin-top: 10px; }
.icon-btn svg, .icon-round svg { width: 18px; height: 18px; display: block; }

.shows { display: grid; grid-template-columns: 1fr 1fr; gap: 18px 12px; }
.show-poster {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 18px;
  overflow: hidden;
  background: #1b1b1f center/cover no-repeat;
}
.show-poster .shade { display: none; }
.fav-badge {
  position: absolute; top: 8px; inset-inline-end: 8px; z-index: 1;
  width: 22px; height: 22px; color: var(--star);
  filter: drop-shadow(0 1px 2px rgba(0,0,0,.6));
}
.fav-badge svg { display: block; width: 100%; height: 100%; }
.show-meta { display: flex; justify-content: space-between; align-items: center; gap: 8px; margin-top: 8px; color: var(--muted); font-size: 12px; }
.show-meta > span:first-child { min-width: 0; }
.show-meta strong {
  display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2;
  color: var(--text); font-size: 14px; line-height: 1.3;
}
.show-meta b { display: block; margin-top: 4px; font-weight: 500; }

@view-transition { navigation: auto; }
::view-transition-old(root), ::view-transition-new(root) { animation-duration: .18s; }
::view-transition-group(tab-ind) { animation-duration: .3s; animation-timing-function: cubic-bezier(.3,1.2,.5,1); }
.tabbar {
  position: fixed; left: 50%; bottom: calc(16px + env(safe-area-inset-bottom)); z-index: 5;
  transform: translateX(-50%);
  display: grid; grid-template-columns: 1fr 1fr; padding: 4px;
  width: min(300px, 75%);
  border-radius: 999px;
  background: linear-gradient(180deg, rgba(255,255,255,.14), rgba(255,255,255,.05));
  -webkit-backdrop-filter: blur(24px) saturate(1.8); backdrop-filter: blur(24px) saturate(1.8);
  box-shadow:
    inset 0 1px 0 rgba(255,255,255,.22),
    inset 0 0 0 1px rgba(255,255,255,.08),
    0 16px 36px rgba(0,0,0,.55);
}
.tab-ind {
  position: absolute; top: 4px; bottom: 4px; inset-inline-start: 4px; width: calc(50% - 4px);
  border-radius: 999px;
  background: rgba(255,255,255,.18);
  box-shadow: inset 0 1px 0 rgba(255,255,255,.28);
  view-transition-name: tab-ind;
  pointer-events: none;
  transition: transform .34s cubic-bezier(.3,1.25,.5,1);
}
.tabbar a { -webkit-tap-highlight-color: transparent; }
.view-in { animation: view-in .26s ease-out; }
.tabbar:has(a:nth-of-type(2).active) .tab-ind { transform: translateX(100%); }
[dir="rtl"] .tabbar:has(a:nth-of-type(2).active) .tab-ind { transform: translateX(-100%); }
.tabbar:not(:has(a.active)) .tab-ind { display: none; }
.tabbar a {
  position: relative; z-index: 1;
  display: grid; place-items: center; height: 40px; border-radius: 999px;
  color: rgba(255,255,255,.6); font-size: 14px; font-weight: 600; letter-spacing: .02em;
  transition: color .25s ease;
}
.tabbar a.active { color: #fff; }
.tabbar [data-nav="discover"] span:empty::before { content: "Discover"; }
.tabbar [data-nav="library"] span:empty::before { content: "Me"; }
html[lang="zh"] .tabbar [data-nav="discover"] span:empty::before { content: "发现"; }
html[lang="zh"] .tabbar [data-nav="library"] span:empty::before { content: "我的"; }
html[lang="ar"] .tabbar [data-nav="discover"] span:empty::before { content: "اكتشف"; }
html[lang="ar"] .tabbar [data-nav="library"] span:empty::before { content: "صفحتي"; }
body.player-page .tabbar { display: none; }

.toast {
  position: fixed; left: 50%; bottom: calc(80px + env(safe-area-inset-bottom));
  transform: translateX(-50%); z-index: 30;
  width: max-content; max-width: min(420px, calc(100vw - 32px));
  padding: 10px 16px; border-radius: 20px; text-align: center; line-height: 1.4;
  background: #fff; color: #111; font-size: 14px;
}
.toast[hidden] { display: none; }
html.in-instagram .toast { bottom: calc(108px + env(safe-area-inset-bottom)); }

.back-link { display: inline-flex; align-items: center; min-width: 36px; min-height: 36px; margin: 4px 0 16px; color: var(--text); }
.detail-head { display: grid; grid-template-columns: 168px minmax(0, 1fr); gap: 24px; align-items: start; margin-bottom: 8px; }
.detail-cover { width: 168px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 16px; background: #1b1b1f; }
.detail-cover.is-empty { display: block; }
.kicker { color: var(--muted); font-size: 12px; letter-spacing: .08em; }
.detail-copy h1 { margin: 6px 0; font-size: clamp(28px, 4vw, 44px); }
.meta-line { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: 13px; }
.actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 16px 0; }
.primary, .secondary {
  height: 46px; padding: 0 16px; border-radius: 12px; border: 0; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center; gap: 8px;
  white-space: nowrap; flex: 0 0 auto;
}
.primary { background: var(--red); color: #fff; min-width: 160px; }
.secondary { background: #222; color: #fff; }
.star-btn svg, .like-btn svg { width: 20px; height: 20px; flex: none; }
.star-btn.on svg { color: var(--star); }
.like-btn.on svg { color: var(--like); }
.pop { animation: pop .4s cubic-bezier(.3,1.6,.5,1); }
.unpop { animation: unpop .3s ease-out; }
.account {
  display: flex; flex-wrap: wrap; align-items: center; gap: 10px 16px;
  margin: 14px 0 6px; padding: 14px 16px; border: 1px solid var(--line); border-radius: 16px; background: var(--bg-elev);
}
.account-who { display: flex; align-items: center; gap: 12px; flex: 1 1 200px; min-width: 0; }
.account-who > span { display: grid; gap: 3px; min-width: 0; }
.account-who strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
.account-who small { color: var(--muted); font-size: 12px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
[dir="rtl"] .account-who small { text-align: right; }
.account-avatar {
  flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 50%;
  object-fit: cover; background: #2a2a30; color: var(--text); font-weight: 700;
}
.page-head .account-note { flex: 1 1 100%; order: 3; margin: 0; color: var(--muted); font-size: 13px; line-height: 1.5; }
.account-btn { height: 40px; font-size: 14px; }
.page-head .account-btn { min-width: 0; }
.account-btn:disabled { opacity: .6; cursor: default; }
.login-card { width: min(380px, 100%); }
.login-options { display: grid; gap: 10px; }
.login-option {
  display: flex; align-items: center; justify-content: center; gap: 10px; height: 48px; padding: 0 16px;
  border: 1px solid var(--line); border-radius: 12px; background: #fff; color: #1f1f1f;
  font-size: 15px; font-weight: 600; cursor: pointer;
}
.login-option .ico-google { width: 20px; height: 20px; flex: none; }
.login-option:disabled { opacity: .45; cursor: default; }
.login-note { margin-top: 12px; color: var(--muted); font-size: 13px; line-height: 1.5; }
.tabs { display: flex; gap: 18px; border-bottom: 1px solid var(--line); margin: 8px 0 14px; }
.tabs button { height: 42px; border: 0; background: transparent; color: var(--muted); cursor: pointer; }
.tabs button.active { color: #fff; box-shadow: inset 0 -2px 0 var(--red); }
.groups { display: flex; gap: 8px; margin-bottom: 12px; }
.ep-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; width: min(440px, 100%); }
.ep {
  display: grid; place-items: center; min-width: 0; height: 44px;
  border-radius: 10px; border: 1px solid var(--line); background: #16161a; cursor: pointer;
  font-variant-numeric: tabular-nums;
}
.ep.active { border-color: var(--red); color: var(--red); }
.about p { color: var(--muted); line-height: 1.6; }

.player-column { width: min(400px, 100%); margin: 0 auto; }
.player-top { display: flex; align-items: center; gap: 12px; padding: 8px 0 12px; color: var(--muted); font-size: 14px; min-width: 0; }
.player-top a { display: flex; align-items: center; flex: 0 0 auto; min-height: 36px; }
.player-top strong { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.pwa-banner {
  display: flex; flex-wrap: wrap; justify-content: space-between; gap: 12px; align-items: center;
  margin-bottom: 10px; padding: 10px 12px; border-radius: 12px; background: #1a1a1f; color: var(--muted); font-size: 13px;
}
.pwa-banner { margin: 8px 0 14px; }
.pwa-banner > div { min-width: 0; }
.stage-video { position: relative; background: #000; border-radius: 16px; overflow: hidden; }
.stage-video video {
  position: relative; z-index: 0; display: block; width: 100%; height: auto;
  aspect-ratio: 9 / 16; background: #000; object-fit: contain;
}
.fs-ui { display: none; }
.controls, .end-card { z-index: 2; transform: translateZ(0); }
.stage-video.is-full {
  position: fixed; inset: 0; z-index: 40; width: 100%; height: 100%; height: 100dvh;
  border-radius: 0; display: flex; align-items: center; justify-content: center; background: #000;
}
.stage-video.is-full video { width: 100%; height: 100%; max-height: 100%; aspect-ratio: auto; object-fit: contain; }
.stage-video.is-full .controls { padding-bottom: calc(12px + env(safe-area-inset-bottom)); }
html.in-instagram .stage-video.is-full .controls { padding-bottom: calc(72px + env(safe-area-inset-bottom)); }
body.stage-full { overflow: hidden; }
html.in-instagram { overflow-x: clip; }
html.in-instagram body { padding-bottom: calc(128px + env(safe-area-inset-bottom)); }
html.in-instagram body.player-page { padding-bottom: calc(96px + env(safe-area-inset-bottom)); }
.center-play {
  position: absolute; top: 50%; left: 50%; z-index: 2;
  width: 72px; height: 72px; margin: 0; transform: translate(-50%, -50%);
  display: grid; place-items: center;
  border: 1px solid rgba(255,255,255,.5); border-radius: 50%; background: rgba(255,255,255,.24); color: #fff; cursor: pointer;
  -webkit-backdrop-filter: blur(12px); backdrop-filter: blur(12px);
  box-shadow: 0 6px 24px rgba(0,0,0,.45);
}
.controls {
  position: absolute; inset-inline: 0; bottom: 0; direction: ltr;
  padding: 28px 12px 12px; background: linear-gradient(180deg, transparent, rgba(0,0,0,.8));
}
.control-row, .time-row { display: flex; align-items: center; gap: 8px; }
.time-row { color: #fff; font-size: 12px; font-variant-numeric: tabular-nums; }
.controls button, .text-btn {
  height: 36px; padding: 0 10px; border: 0; border-radius: 10px; background: rgba(255,255,255,.12); color: #fff; cursor: pointer;
}
.controls button svg, .center-play svg { width: 18px; height: 18px; display: block; }
.center-play svg { width: 32px; height: 32px; margin: 0 0 0 4px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.35)); }
.unmute-tip {
  position: absolute; top: 12px; inset-inline-start: 12px; z-index: 3;
  display: flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px 0 10px;
  border: 0; border-radius: 999px; background: rgba(0,0,0,.55); color: #fff;
  font: inherit; font-size: 13px; font-weight: 500; cursor: pointer;
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  animation: unmute-in .25s ease-out;
}
.unmute-tip svg { width: 18px; height: 18px; flex: none; }
@keyframes unmute-in { from { opacity: 0; transform: translateY(-4px); } }
.next-wide {
  display: flex; align-items: center; justify-content: center;
  width: 100%; height: 44px; margin: 12px 0; border: 0; border-radius: 12px;
  background: #222; color: #fff; cursor: pointer;
}
input[type="range"] { flex: 1; height: 36px; accent-color: var(--red); }
.watch-panel { margin-top: 16px; }
.watch-panel h2 { font-size: 22px; line-height: 1.25; }
.watch-summary, .shortcut-hint { display: none; }
.series-link { display: flex; align-items: center; gap: 12px; margin-top: 6px; padding: 8px; margin-inline: -8px; border-radius: 14px; color: var(--text); }
a.series-link[href]:hover { background: #16161a; }
.series-cover { flex: 0 0 auto; width: 54px; aspect-ratio: 9 / 16; object-fit: cover; border-radius: 8px; background: #1b1b1f; }
.series-copy { flex: 1; min-width: 0; }
.series-copy h2 { overflow: hidden; display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 2; }
.series-copy .meta-line { margin-top: 4px; }
.series-link .chevron { flex: 0 0 auto; color: var(--muted); font-size: 22px; line-height: 1; }
[dir="rtl"] .series-link .chevron { transform: scaleX(-1); }
.end-card {
  position: absolute; inset: 0; display: grid; align-content: center; justify-items: center; gap: 10px;
  padding: 24px; text-align: center; background: rgba(0,0,0,.72);
}
.end-card[hidden] { display: none; }
.end-card .primary { min-width: 220px; }
.linkish { border: 0; background: transparent; color: var(--muted); cursor: pointer; }

.empty { padding: 64px 0; color: var(--muted); text-align: center; }
.empty p { margin-top: 10px; }
.empty a { color: var(--text); text-decoration: underline; text-underline-offset: 3px; }
.shows-sm { grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px 8px; }
.shows-sm .show-poster { border-radius: 10px; }
.shows-sm .show-meta { margin-top: 6px; font-size: 11px; }
.shows-sm .show-meta strong { font-size: 13px; }
.shows-sm .show-meta b { margin-top: 2px; }

.search-page {
  position: fixed; inset: 0; z-index: 25; display: flex; flex-direction: column;
  background: var(--bg); animation: search-in .2s ease-out;
}
.search-page[hidden] { display: none; }
.search-bar {
  display: flex; align-items: center; gap: 6px; width: 100%; max-width: 760px; margin: 0 auto;
  padding: calc(10px + env(safe-area-inset-top)) max(10px, env(safe-area-inset-right)) 8px max(6px, env(safe-area-inset-left));
}
.search-back { display: grid; place-items: center; width: 38px; height: 40px; flex: none; border: 0; background: none; color: #fff; cursor: pointer; }
.search-back svg { width: 24px; height: 24px; }
[dir="rtl"] .search-back svg { transform: scaleX(-1); }
.search-field {
  display: flex; align-items: center; gap: 8px; flex: 1 1 auto; min-width: 0; height: 40px; padding: 0 12px;
  border: 1px solid transparent; border-radius: 999px; background: #1c1c20; transition: border-color .2s ease;
}
.search-field:focus-within { border-color: rgba(255,42,42,.55); }
.search-field > svg { width: 18px; height: 18px; flex: none; color: var(--muted); }
.search-field input { flex: 1 1 auto; min-width: 0; height: 100%; border: 0; background: none; color: #fff; font: inherit; font-size: 16px; outline: none; }
.search-field input::-webkit-search-cancel-button { -webkit-appearance: none; display: none; }
.search-clear { display: grid; place-items: center; width: 20px; height: 20px; flex: none; border: 0; border-radius: 50%; background: #4a4a50; color: #111; cursor: pointer; }
.search-clear[hidden] { display: none; }
.search-clear svg { width: 14px; height: 14px; }
.search-go { flex: none; height: 40px; padding: 0 8px; border: 0; background: none; color: #fff; font-size: 15px; font-weight: 600; cursor: pointer; }
.search-body {
  flex: 1 1 auto; overflow-y: auto; -webkit-overflow-scrolling: touch; width: 100%; max-width: 760px; margin: 0 auto;
  padding: 4px max(16px, env(safe-area-inset-right)) calc(24px + env(safe-area-inset-bottom)) max(16px, env(safe-area-inset-left));
}
.search-sec { margin-top: 14px; }
.search-sec-head { display: flex; align-items: center; justify-content: space-between; min-height: 32px; margin-bottom: 10px; }
.search-sec-head h2 { font-size: 16px; }
.search-sec-head button { display: grid; place-items: center; width: 32px; height: 32px; border: 0; background: none; color: var(--muted); cursor: pointer; }
.search-sec-head button svg { width: 18px; height: 18px; }
.search-tags { display: flex; flex-wrap: wrap; gap: 10px; }
.search-tags button {
  max-width: 100%; height: 32px; padding: 0 14px; border: 0; border-radius: 999px; background: #1c1c20;
  color: #ddd; font-size: 13px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer;
}
.hot-list { list-style: none; display: grid; grid-template-columns: minmax(0, 1fr); gap: 2px; }
.hot-list a { display: flex; align-items: center; gap: 12px; min-height: 44px; }
.hot-rank { width: 22px; flex: none; text-align: center; color: var(--muted); font-size: 17px; font-weight: 800; font-style: italic; }
.hot-list li:nth-child(1) .hot-rank { color: #ff2a2a; }
.hot-list li:nth-child(2) .hot-rank { color: #ff6a2a; }
.hot-list li:nth-child(3) .hot-rank { color: #ffb02a; }
.hot-list strong { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 15px; font-weight: 500; }
.hot-meta { flex: none; color: var(--muted); font-size: 12px; }
.result-list { display: grid; gap: 18px; margin-top: 8px; }
.result { display: flex; gap: 12px; }
.result-cover { width: 84px; flex: none; aspect-ratio: 3 / 4; border-radius: 10px; background: #1b1b1f center/cover no-repeat; }
.result-copy { display: flex; flex-direction: column; gap: 6px; min-width: 0; padding-top: 2px; }
.result-copy strong { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; font-size: 16px; line-height: 1.3; }
.result-copy mark { background: none; color: var(--red); }
.result-meta { color: var(--muted); font-size: 12px; }
.result-sum { display: -webkit-box; overflow: hidden; -webkit-box-orient: vertical; -webkit-line-clamp: 2; color: rgba(255,255,255,.7); font-size: 13px; line-height: 1.45; }
.pwa-banner strong { display: block; color: var(--text); }
.pwa-actions { display: flex; gap: 8px; }

.icon-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 40px; height: 40px; padding: 0; border: 0; background: transparent; color: #fff; cursor: pointer;
}
.upload-btn, .ghost {
  height: 36px; padding: 0 14px; border: 0; border-radius: 999px; font-size: 13px; cursor: pointer;
}
.upload-btn { background: linear-gradient(145deg, var(--red), #fb7185); color: #fff; }
.ghost { background: transparent; border: 1px solid var(--line); color: var(--muted); }
body.modal-open { overflow: hidden; }
.modal[hidden] { display: none; }
.modal { position: fixed; inset: 0; z-index: 20; display: grid; place-items: center; padding: 24px; }
.modal-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.62); }
.modal-card {
  position: relative; width: min(520px, 100%); max-height: calc(100vh - 48px); overflow: auto;
  padding: 22px; border: 1px solid var(--line); border-radius: 18px; background: var(--bg-elev);
}
.modal-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 16px; }
.modal-x { width: 36px; height: 36px; border: 0; background: transparent; color: var(--muted); font-size: 24px; cursor: pointer; }
.modal-card label { display: block; margin-bottom: 12px; color: var(--muted); font-size: 12px; }
.modal-card input, .modal-card textarea, .modal-card select {
  display: block; width: 100%; margin-top: 6px; padding: 10px 12px;
  border: 1px solid var(--line); border-radius: 10px; background: #0b0b0f;
}
.modal-card select { height: auto; border-radius: 10px; }
.field-hint { display: block; margin-top: 6px; color: var(--muted); font-size: 11px; }
.check { display: flex; align-items: center; gap: 8px; margin: 8px 0 12px; }
.check input { width: auto; margin: 0; }
.modal-actions { display: flex; justify-content: flex-end; gap: 10px; }
.modal-actions a.ghost { display: inline-flex; align-items: center; }
.gate-card { width: min(360px, 100%); }
.modal-head .lang { display: flex; margin: 0; }
.upload-status { min-height: 1.4em; margin: 4px 0 10px; color: var(--muted); font-size: 13px; }
.upload-status[data-state="err"] { color: #fb7185; }
.admin-page .hero { padding: 8px 0 16px; }
.admin-page .hero h1 { font-size: 28px; }
.admin-page .hero p { color: var(--muted); }
.admin-list { display: grid; gap: 8px; }
.admin-card {
  display: grid; grid-template-columns: 48px minmax(0, 1fr) max-content; gap: 12px; align-items: center;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 14px; background: var(--bg-elev);
}
.admin-cover { width: 48px; height: 64px; border-radius: 8px; background: #1a1a22 center/cover no-repeat; }
.admin-cover.is-empty { display: flex; align-items: center; justify-content: center; color: #6b6570; }
.admin-main h3, .admin-main > p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-main > p, .admin-meta { color: var(--muted); font-size: 12px; }
.admin-meta { display: flex; gap: 8px; margin-top: 5px; overflow: hidden; }
.admin-extra { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.admin-actions { display: flex; gap: 8px; }
.admin-actions .ghost { display: inline-flex; align-items: center; justify-content: center; }
.admin-actions .ghost.is-off { opacity: .32; pointer-events: none; }
.status { padding: 2px 8px; border-radius: 999px; background: rgba(255,255,255,.08); }
.status-waiting { color: #e8c27a; }
.status-processing { color: #93c5fd; }
.status-done { color: #86efac; }
.status-failed, .danger { color: #fb7185; }
.status-live { color: #fda4af; }

@media (min-width: 900px) {
  body { padding-bottom: 32px; }
  .desk-nav { display: flex; }
  .top-search { display: flex; }
  .tabbar { display: none; }
  .shows { grid-template-columns: repeat(4, 1fr); }
  .shows-sm { grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 20px 14px; }
  .account { flex-wrap: nowrap; }
  .account-who { flex: 0 1 auto; }
  .page-head .account-note { flex: 1 1 auto; order: 0; }
  .page-head .account-btn { margin-inline-start: auto; flex: none; }
  .player-column {
    display: grid; width: min(1040px, 100%); gap: 40px; justify-content: center; align-items: start;
    grid-template-columns: minmax(0, min(460px, calc((100vh - 150px) * 9 / 16))) minmax(320px, 400px);
  }
  .player-column > .pwa-banner { grid-column: 1 / -1; margin: 0; }
  .watch-panel { margin-top: 56px; }
  .watch-panel h2 { font-size: 26px; }
  .series-cover { width: 64px; }
  .watch-summary {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 4; overflow: hidden;
    margin-top: 12px; color: var(--muted); font-size: 14px; line-height: 1.6;
  }
  .next-wide { margin: 18px 0 16px; }
  .ep-grid { width: 100%; }
  .shortcut-hint {
    display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 8px 16px;
    margin-top: 4px; padding-top: 16px; border-top: 1px solid var(--line);
    list-style: none; color: var(--muted); font-size: 12px;
  }
  .shortcut-hint li { display: flex; align-items: center; gap: 8px; min-width: 0; }
  .shortcut-hint kbd {
    flex: 0 0 auto; min-width: 26px; padding: 2px 6px; border: 1px solid var(--line); border-radius: 6px;
    background: #16161a; color: var(--text); font: inherit; font-size: 11px; text-align: center;
  }
  .controls button:hover, .next-wide:hover, .secondary:hover, .ep:hover { background-color: #2b2b31; }
  .controls button:hover { background-color: rgba(255,255,255,.22); }
}
@media (min-width: 900px) {
  .m-only, .sheet { display: none !important; }
}
@media (max-width: 899px) {
  body.player-page, html.in-instagram body.player-page { padding: 0; overflow: hidden; background: #000; }
  body.player-page .topbar, .player-top, .watch-panel { display: none; }
  .stage-video { --edge-start: env(safe-area-inset-left, 0px); --edge-end: env(safe-area-inset-right, 0px); }
  [dir="rtl"] .stage-video { --edge-start: env(safe-area-inset-right, 0px); --edge-end: env(safe-area-inset-left, 0px); }
  body.player-page .wrap, .player-column { width: 100%; }
  .stage-video {
    --bar-h: calc(84px + env(safe-area-inset-bottom));
    position: fixed; inset: 0; z-index: 1; height: 100vh; height: 100dvh; border-radius: 0;
  }
  .stage-video video {
    position: absolute; top: 0; inset-inline: 0; width: 100%; height: calc(100% - var(--bar-h)); aspect-ratio: auto; object-fit: cover;
  }
  .stage-video .center-play { top: calc((100% - var(--bar-h)) / 2); }
  .stage-video .unmute-tip { top: calc(58px + env(safe-area-inset-top)); }
  .stage-video.is-full .unmute-tip { top: calc(64px + env(safe-area-inset-top)); }
  .stage-video video.swap-up { animation: swap-up .28s ease-out; }
  .stage-video video.swap-down { animation: swap-down .28s ease-out; }
  .stage-video { touch-action: pan-x; }
  .stage-video .drag-move { transform: translate3d(0, var(--drag, 0px), 0); }
  .stage-video.drag-anim .drag-move, .stage-video.drag-anim .swipe-peek { transition: transform .26s cubic-bezier(.2, .8, .2, 1); }
  .stage-video.dragging .center-play, .stage-video.dragging .controls { opacity: 0; }
  .swipe-peek {
    position: absolute; inset: 0 0 var(--bar-h) 0; z-index: 1; display: none; background: #000 center / cover no-repeat;
  }
  .swipe-peek.on { display: block; }
  .swipe-peek.fade { opacity: 0; transition: opacity .25s ease; }
  .stage-video::before, .stage-video::after { content: ""; position: absolute; inset-inline: 0; z-index: 1; pointer-events: none; }
  .stage-video::before { top: 0; height: 120px; background: linear-gradient(rgba(0,0,0,.55), transparent); }
  .stage-video::after { bottom: var(--bar-h); height: 36%; background: linear-gradient(transparent, rgba(0,0,0,.72)); }
  .end-card { z-index: 3; }
  .control-row { display: none; }
  .controls {
    z-index: 3; inset-inline: 0; bottom: calc(var(--bar-h) - 9px); padding: 0 calc(8px + env(safe-area-inset-right, 0px)) 0 calc(8px + env(safe-area-inset-left, 0px)); background: none;
  }
  .controls input[type="range"], .fs-progress input[type="range"] {
    -webkit-appearance: none; appearance: none; display: block; width: 100%; height: 18px; margin: 0; background: transparent;
  }
  .controls input[type="range"]::-webkit-slider-runnable-track, .fs-progress input[type="range"]::-webkit-slider-runnable-track {
    height: 2px; border-radius: 1px;
    background: linear-gradient(to right, #fff var(--p, 0%), rgba(255,255,255,.28) var(--p, 0%));
  }
  .controls input[type="range"]::-webkit-slider-thumb, .fs-progress input[type="range"]::-webkit-slider-thumb {
    -webkit-appearance: none; width: 8px; height: 8px; margin-top: -3px; border: 0; border-radius: 50%; background: #fff;
    transition: transform .15s ease;
  }
  .controls input[type="range"]:active::-webkit-slider-thumb, .fs-progress input[type="range"]:active::-webkit-slider-thumb { transform: scale(1.6); }
  .controls input[type="range"]::-moz-range-track, .fs-progress input[type="range"]::-moz-range-track { height: 2px; border-radius: 1px; background: rgba(255,255,255,.28); }
  .controls input[type="range"]::-moz-range-progress, .fs-progress input[type="range"]::-moz-range-progress { height: 2px; border-radius: 1px; background: #fff; }
  .controls input[type="range"]::-moz-range-thumb, .fs-progress input[type="range"]::-moz-range-thumb { width: 8px; height: 8px; border: 0; border-radius: 50%; background: #fff; }

  .m-top {
    position: absolute; top: 0; inset-inline: 0; z-index: 2;
    display: flex; align-items: center; gap: 4px;
    padding: calc(6px + env(safe-area-inset-top)) calc(8px + env(safe-area-inset-right, 0px)) 6px calc(8px + env(safe-area-inset-left, 0px));
  }
  .m-back { display: grid; place-items: center; width: 40px; height: 40px; color: #fff; }
  .m-back svg { width: 24px; height: 24px; }
  [dir="rtl"] .m-back svg { transform: scaleX(-1); }
  .m-ep { color: #fff; font-size: 15px; font-weight: 600; text-shadow: 0 1px 2px rgba(0,0,0,.5); }

  .m-rail {
    position: absolute; inset-inline-end: calc(6px + var(--edge-end)); bottom: calc(var(--bar-h) + 70px); z-index: 2;
    display: grid; gap: 14px; justify-items: center;
  }
  .m-rail button {
    display: grid; justify-items: center; gap: 4px; width: 60px; padding: 0; border: 0; background: none;
    color: #fff; font-size: 11px; cursor: pointer; text-shadow: 0 1px 2px rgba(0,0,0,.6);
  }
  .m-rail svg { width: 32px; height: 32px; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
  .m-rail #rail-fav.on svg { color: var(--star); }
  .m-rail #rail-like.on svg { color: var(--like); }
  .m-rail span { display: block; height: 14px; line-height: 14px; white-space: nowrap; }

  .m-info {
    position: absolute; inset-inline-start: calc(14px + var(--edge-start)); inset-inline-end: calc(78px + var(--edge-end)); bottom: calc(var(--bar-h) + 22px); z-index: 2;
    color: #fff; text-shadow: 0 1px 2px rgba(0,0,0,.6);
  }
  .m-title { display: inline-block; max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 17px; font-weight: 700; }
  .m-title span { color: rgba(255,255,255,.75); }
  .m-summary {
    display: flex; gap: 6px; min-width: 0; white-space: nowrap;
    margin-top: 6px; color: rgba(255,255,255,.88); font-size: 13px; line-height: 1.45;
  }
  .m-summary b, .m-summary > span { flex: 0 0 auto; }
  .m-summary b { font-weight: 600; }
  .m-summary .m-sum-text { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; }

  .m-bar {
    position: absolute; inset-inline: 0; bottom: 0; z-index: 2;
    display: flex; align-items: center; gap: 8px; width: 100%;
    height: var(--bar-h);
    padding: 0 calc(16px + env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom) calc(16px + env(safe-area-inset-left, 0px));
    border: 0; background: #000;
    color: #fff; font-size: 14px; text-align: start; cursor: pointer;
  }
  .m-bar svg { width: 18px; height: 18px; flex: 0 0 auto; }
  .m-bar span:first-of-type { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
  .m-bar-go { color: var(--muted); font-size: 20px; line-height: 1; }
  [dir="rtl"] .m-bar-go { transform: scaleX(-1); }

  .player-column > .pwa-banner { position: fixed; top: calc(54px + env(safe-area-inset-top)); inset-inline: 12px; z-index: 4; margin: 0; background: rgba(26,26,31,.96); }

  .sheet { position: fixed; inset: 0; z-index: 25; }
  .sheet-backdrop { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
  .sheet-panel {
    position: absolute; inset-inline: 0; bottom: 0; max-height: 72vh; max-height: 72dvh; overflow: auto;
    padding: 14px 16px calc(16px + env(safe-area-inset-bottom)); border-radius: 18px 18px 0 0;
    background: #141416; animation: sheet-up .22s ease-out;
  }
  .sheet-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 12px; }
  .sheet-head > div { min-width: 0; }
  .sheet-head strong { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
  .sheet-head span { color: var(--muted); font-size: 12px; }
  .sheet .groups { overflow-x: auto; scrollbar-width: none; }
  .sheet-grid { grid-template-columns: repeat(6, minmax(0, 1fr)); width: 100%; }
  .sheet-grid .ep { height: 42px; }

  .stage-video.is-landscape video { object-fit: contain; }
  .m-full { display: none; }
  .stage-video.is-landscape .m-full {
    position: absolute; z-index: 2; inset-inline: 0; width: max-content; margin-inline: auto;
    top: calc((100% - var(--bar-h)) / 2 + 50vw * var(--vr, .5625) + 16px);
    display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px;
    border: 1px solid rgba(255,255,255,.35); border-radius: 999px; background: rgba(0,0,0,.35);
    color: #fff; font-size: 13px; cursor: pointer;
  }
  .m-full svg { width: 16px; height: 16px; }

  .stage-video.is-full { --bar-h: 0px; }
  .stage-video.is-full .m-only { display: none !important; }
  .stage-video.is-full::before, .stage-video.is-full::after { display: none; }
  .stage-video.is-full video { height: 100%; object-fit: contain; }
  .stage-video.is-full .controls {
    bottom: 0; padding: 28px calc(16px + env(safe-area-inset-right, 0px)) calc(12px + env(safe-area-inset-bottom)) calc(16px + env(safe-area-inset-left, 0px));
    background: linear-gradient(180deg, transparent, rgba(0,0,0,.7));
  }
  .stage-video.is-full .controls { display: none; }

  .stage-video.is-full .fs-ui { display: block; position: absolute; inset: 0; z-index: 3; pointer-events: none; color: #fff; }
  .fs-ui > * { pointer-events: auto; }
  .fs-top, .fs-bottom { position: absolute; inset-inline: 0; transition: opacity .25s ease; }
  .stage-video.fs-idle .fs-top, .stage-video.fs-idle .fs-bottom { opacity: 0; pointer-events: none; }
  .fs-top {
    top: 0; display: flex; align-items: center; gap: 6px;
    padding: 10px max(16px, env(safe-area-inset-right, 0px)) 36px max(10px, env(safe-area-inset-left, 0px));
    background: linear-gradient(rgba(0,0,0,.65), transparent);
  }
  .fs-top button, .fs-row button {
    display: inline-flex; align-items: center; justify-content: center; gap: 6px;
    min-width: 40px; height: 40px; padding: 0 8px; border: 0; background: none;
    color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
    text-shadow: 0 1px 2px rgba(0,0,0,.5);
  }
  .fs-top button svg, .fs-row button svg { width: 24px; height: 24px; flex: none; filter: drop-shadow(0 1px 2px rgba(0,0,0,.5)); }
  .fs-row button:disabled { opacity: .35; }
  [dir="rtl"] #fs-back svg { transform: scaleX(-1); }
  .fs-title { display: flex; align-items: baseline; gap: 10px; flex: 1 1 auto; min-width: 0; }
  .fs-title strong { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: 16px; }
  .fs-title span { flex: none; color: rgba(255,255,255,.75); font-size: 13px; }
  .fs-actions { display: flex; gap: 2px; }
  #fs-fav.on svg { color: var(--star); }
  #fs-like.on svg { color: var(--like); }
  .fs-bottom {
    bottom: 0;
    padding: 36px max(20px, env(safe-area-inset-right, 0px)) calc(6px + env(safe-area-inset-bottom)) max(20px, env(safe-area-inset-left, 0px));
    background: linear-gradient(transparent, rgba(0,0,0,.7));
  }
  .fs-progress { display: flex; align-items: center; gap: 12px; direction: ltr; font-size: 12px; font-variant-numeric: tabular-nums; }
  .fs-progress input { flex: 1 1 auto; min-width: 0; }
  .fs-row { display: flex; align-items: center; gap: 4px; margin-inline: -8px; direction: ltr; }
  .fs-spacer { flex: 1 1 auto; }
  .fs-scrim { position: absolute; inset: 0; background: rgba(0,0,0,.25); }
  .fs-panel {
    position: absolute; top: 0; bottom: 0; right: 0; width: min(400px, 46%); overflow-y: auto;
    padding: 18px max(18px, env(safe-area-inset-right, 0px)) 18px 18px;
    background: rgba(14,14,16,.94); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px);
    animation: fs-panel-in .22s ease-out;
  }
  [dir="rtl"] .fs-panel { right: auto; left: 0; padding: 18px 18px 18px max(18px, env(safe-area-inset-left, 0px)); animation-name: fs-panel-in-rtl; }
  .fs-panel-head { margin-bottom: 12px; font-size: 15px; }
  .fs-panel .groups { overflow-x: auto; scrollbar-width: none; }
  .fs-panel .ep-grid { grid-template-columns: repeat(5, minmax(0, 1fr)); width: 100%; }
  .fs-panel .ep { height: 40px; }
}
@media (max-width: 899px) and (orientation: portrait) {
  .stage-video.is-full.rotate {
    inset: auto; top: 0; left: 0; width: 100vh; width: 100dvh; height: 100vw;
    transform-origin: top left; transform: rotate(90deg) translateY(-100%);
  }
}
@keyframes swap-up { from { transform: translateY(16%); opacity: .25; } }
@keyframes swap-down { from { transform: translateY(-16%); opacity: .25; } }
@keyframes pop { 0% { transform: scale(.6); } 45% { transform: scale(1.3); } 100% { transform: scale(1); } }
@keyframes unpop { 0% { transform: scale(1); } 40% { transform: scale(.7); } 100% { transform: scale(1); } }
@keyframes fs-panel-in { from { transform: translateX(100%); } }
@keyframes fs-panel-in-rtl { from { transform: translateX(-100%); } }
@keyframes search-in { from { opacity: 0; transform: translateY(12px); } }
@keyframes view-in { from { opacity: 0; transform: translateY(8px); } }
@keyframes sheet-up { from { transform: translateY(100%); } }
@media (max-width: 720px) {
  .detail-head { grid-template-columns: 112px minmax(0, 1fr); gap: 14px; }
  .detail-cover { width: 112px; border-radius: 12px; }
  .admin-card { grid-template-columns: 48px minmax(0, 1fr); }
  .admin-actions { grid-column: 1 / -1; }
}
