/*!
 * app.css — 小恐龙短剧
 * 一套样式同时覆盖桌面与移动；用 html[data-layout] 区分形态
 * 暗色影音风：视频内容最大化，界面退到背景
 *
 * 兼容说明：
 *   - 所有新属性都写"先兜底后现代"两行（老内核忽略不认识的那行）
 *   - 关键交互不依赖 :has() / :is() / clamp 单位，避免老内核白屏
 *   - 安全区用 env()，并用前置值兜底
 */

/* ============================================================
 * 变量
 * ========================================================== */

:root {
  --bg: #0b0b10;
  --bg-2: #101018;
  --surface: #16161f;
  --surface-2: #1d1d29;
  --surface-3: #262634;
  --line: rgba(255, 255, 255, .09);
  --line-2: rgba(255, 255, 255, .18);
  --text: #f3f4f8;
  --sub: #a1a6bb;
  --dim: #6d7288;
  --brand: #ff2c55;
  --brand-2: #ff6a3d;
  --ok: #26c281;
  --warn: #f5a524;
  --radius: 14px;
  --radius-sm: 10px;
  --radius-lg: 20px;
  --shadow: 0 12px 34px rgba(0, 0, 0, .5);
  --shadow-sm: 0 4px 14px rgba(0, 0, 0, .35);
  --ease: cubic-bezier(.22, .61, .36, 1);
  /* 先给 0 兜底，再读安全区。
     注意：JS 启动后会用行内值覆盖这两个变量（见 core.js 的 syncSafeArea）——
     因为部分安卓浏览器（vivo 等）在普通标签页里也会把状态栏高度报成安全区，
     直接信 env() 会让页面顶部凭空多出一块空白。 */
  --sat: 0px;
  --sab: 0px;
  --sat: env(safe-area-inset-top, 0px);
  --sab: env(safe-area-inset-bottom, 0px);
  --app-h: 100vh;
  --topbar-h: 58px;
}

/* ============================================================
 * 基础重置
 * ========================================================== */

*, *::before, *::after { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  min-height: 100%;
}

html { -webkit-text-size-adjust: 100%; text-size-adjust: 100%; }

body {
  background: var(--bg);
  color: var(--text);
  font: 15px/1.55 -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
        "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior-y: none;
}

[hidden] { display: none !important; }
html.no-scroll, html.no-scroll body { overflow: hidden; }

h1, h2, h3, h4, p, figure { margin: 0; }
button { font: inherit; color: inherit; background: none; border: 0; padding: 0; cursor: pointer; }
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
input, button, textarea, select { font-family: inherit; }
input[type="search"]::-webkit-search-cancel-button { display: none; }

:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

::selection { background: rgba(255, 44, 85, .3); }

/* 滚动条：桌面细条，移动端隐藏 */
::-webkit-scrollbar { width: 9px; height: 9px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255, 255, 255, .14); border-radius: 9px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255, 255, 255, .24); }

.ico { display: block; flex: none; }

/* ============================================================
 * 首屏骨架
 * ========================================================== */

.boot {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  z-index: 200;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  background: radial-gradient(120% 80% at 50% 0%, #1a1420 0%, var(--bg) 60%);
  transition: opacity .3s var(--ease);
}
.boot.is-off { opacity: 0; pointer-events: none; }

.boot-logo {
  width: 74px; height: 74px;
  border-radius: 22px;
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-2) 100%);
  box-shadow: 0 14px 40px rgba(255, 44, 85, .35);
  display: flex; align-items: center; justify-content: center;
  animation: bootPulse 1.8s var(--ease) infinite;
}
@keyframes bootPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.06); }
}
.boot-play {
  width: 0; height: 0;
  margin-left: 5px;
  border-style: solid;
  border-width: 13px 0 13px 21px;
  border-color: transparent transparent transparent #fff;
}
.boot-name { font-size: 19px; font-weight: 700; letter-spacing: 3px; }
.boot-bar {
  width: 168px; height: 3px;
  border-radius: 3px;
  background: rgba(255, 255, 255, .1);
  overflow: hidden;
}
.boot-bar > i {
  display: block; width: 40%; height: 100%; border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  animation: bootSlide 1.15s var(--ease) infinite;
}
@keyframes bootSlide {
  0% { transform: translateX(-105%); }
  100% { transform: translateX(255%); }
}
.boot-hint { font-size: 13px; color: var(--dim); max-width: 82%; text-align: center; }
.boot-hint.is-error { color: var(--warn); line-height: 1.7; }

.noscript {
  position: fixed; left: 16px; right: 16px; top: 24px; z-index: 300;
  padding: 14px 18px; border-radius: var(--radius);
  background: #2a1d1d; color: #ffd9d9; border: 1px solid rgba(255, 120, 120, .3);
}

/* ============================================================
 * 通用控件
 * ========================================================== */

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  height: 36px;
  padding: 0 16px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  font-size: 14px;
  white-space: nowrap;
  transition: background .18s var(--ease), transform .12s var(--ease), border-color .18s var(--ease);
}
.btn:hover { background: var(--surface-3); }
.btn:active { transform: scale(.97); }
.btn[disabled] { opacity: .55; cursor: default; }
.btn-primary {
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  border-color: transparent;
  color: #fff;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(255, 44, 85, .28);
}
.btn-primary:hover { filter: brightness(1.06); background: linear-gradient(135deg, var(--brand), var(--brand-2)); }
.btn-ghost { background: transparent; border-color: var(--line-2); }
.btn-ghost:hover { background: rgba(255, 255, 255, .07); }
.btn-danger { background: rgba(255, 44, 85, .14); border-color: rgba(255, 44, 85, .4); color: #ff8fa5; }
.btn-danger:hover { background: rgba(255, 44, 85, .22); }
.btn-block { width: 100%; }
.btn.is-busy { opacity: .6; pointer-events: none; }

.link-btn {
  font-size: 13px;
  color: var(--sub);
  transition: color .16s var(--ease);
}
.link-btn:hover { color: var(--brand); }

.icon-btn {
  width: 30px; height: 30px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: var(--dim);
  transition: background .16s var(--ease), color .16s var(--ease);
}
.icon-btn:hover { background: rgba(255, 255, 255, .08); color: var(--text); }

.chip {
  display: inline-block;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--surface-2);
  border: 1px solid var(--line);
  font-size: 13px;
  color: var(--sub);
  transition: all .16s var(--ease);
}
.chip:hover { color: var(--text); background: var(--surface-3); }
.chip.is-on {
  background: rgba(255, 44, 85, .16);
  border-color: rgba(255, 44, 85, .5);
  color: #ff8ba1;
  font-weight: 600;
}

.seg {
  display: inline-flex;
  padding: 3px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
}
.seg-btn {
  padding: 5px 14px;
  border-radius: 999px;
  font-size: 13px;
  color: var(--sub);
  transition: all .16s var(--ease);
}
.seg-btn.is-on { background: var(--surface-3); color: var(--text); font-weight: 600; }

.switch {
  position: relative;
  width: 46px; height: 27px;
  border-radius: 999px;
  background: var(--surface-3);
  border: 1px solid var(--line);
  transition: background .2s var(--ease);
  flex: none;
}
.switch > i {
  position: absolute; left: 3px; top: 2px;
  width: 21px; height: 21px;
  border-radius: 50%;
  background: #8b8fa3;
  transition: transform .2s var(--ease), background .2s var(--ease);
}
.switch.is-on { background: rgba(255, 44, 85, .28); border-color: rgba(255, 44, 85, .5); }
.switch.is-on > i { transform: translateX(19px); background: var(--brand); }

.fi-tag {
  display: inline-block;
  padding: 2px 9px;
  margin: 0 6px 6px 0;
  border-radius: 6px;
  background: rgba(255, 255, 255, .1);
  font-size: 12px;
  color: rgba(255, 255, 255, .82);
}

/* 骨架屏与加载 */
.sk {
  background: linear-gradient(100deg, #191922 30%, #23232f 45%, #191922 60%);
  background-size: 400% 100%;
  animation: sk 1.35s ease-in-out infinite;
}
@keyframes sk {
  0% { background-position: 100% 0; }
  100% { background-position: 0 0; }
}
.sk-line { height: 12px; border-radius: 6px; margin-top: 10px; }
.sk-line--short { width: 55%; }

.spinner {
  display: inline-flex;
  gap: 6px;
  align-items: center;
}
.spinner > i {
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--brand);
  opacity: .35;
  animation: dot 1s var(--ease) infinite;
}
.spinner > i:nth-child(2) { animation-delay: .16s; }
.spinner > i:nth-child(3) { animation-delay: .32s; }
@keyframes dot {
  0%, 100% { opacity: .3; transform: translateY(0); }
  40% { opacity: 1; transform: translateY(-5px); }
}

.state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 66px 22px;
  text-align: center;
  color: var(--sub);
}
.state-ico { color: var(--dim); }
.state-text { font-size: 14px; max-width: 460px; }
.state--error .state-text { color: #ff9aae; }

.track { height: 4px; border-radius: 4px; background: rgba(255, 255, 255, .16); }
.track > i { display: block; height: 100%; border-radius: 4px; background: var(--brand); }

.row-center { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }
.muted-line { color: var(--dim); font-size: 13px; line-height: 1.8; }
.warn-line { color: var(--warn); font-size: 13px; line-height: 1.7; margin-bottom: 6px; }
.foot-note { color: var(--dim); font-size: 12px; text-align: center; padding: 22px 8px 40px; line-height: 1.9; }
code {
  font-family: ui-monospace, Menlo, Consolas, monospace;
  font-size: 12px;
  padding: 1px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, .08);
  color: #c8ccdd;
}

/* ============================================================
 * Toast / 网络条 / 遮罩
 * ========================================================== */

.toast {
  position: fixed;
  left: 50%;
  bottom: calc(96px + var(--sab));
  z-index: 90;
  transform: translate(-50%, 14px);
  max-width: 78vw;
  padding: 10px 20px;
  border-radius: 999px;
  background: rgba(20, 20, 28, .94);
  border: 1px solid var(--line-2);
  box-shadow: var(--shadow);
  font-size: 13.5px;
  color: #fff;
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s var(--ease), transform .22s var(--ease), visibility .22s;
  pointer-events: none;
  text-align: center;
  line-height: 1.5;
}
.toast.is-on { opacity: 1; visibility: visible; transform: translate(-50%, 0); }

.mask {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  z-index: 60;
  background: rgba(0, 0, 0, .58);
  opacity: 0;
  visibility: hidden;
  transition: opacity .22s var(--ease), visibility .22s;
  -webkit-backdrop-filter: blur(2px);
  backdrop-filter: blur(2px);
}
.mask.is-on { opacity: 1; visibility: visible; }

/* ============================================================
 * 弹层 / 对话框
 * ========================================================== */

.sheet {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 70;
  display: flex;
  justify-content: center;
  pointer-events: none;
}
.sheet.is-on { pointer-events: auto; }

.sheet-panel {
  width: 100%;
  max-width: 560px;
  max-height: 76vh;
  max-height: 76dvh;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border: 1px solid var(--line);
  border-bottom: 0;
  border-radius: var(--radius-lg) var(--radius-lg) 0 0;
  box-shadow: 0 -14px 40px rgba(0, 0, 0, .55);
  transform: translateY(102%);
  transition: transform .28s var(--ease);
  padding-bottom: var(--sab);
}
.sheet.is-on .sheet-panel { transform: translateY(0); }

.sheet-grip {
  width: 42px; height: 4px;
  border-radius: 4px;
  background: var(--line-2);
  margin: 9px auto 3px;
  flex: none;
}
.sheet-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 16px 10px;
  border-bottom: 1px solid var(--line);
  flex: none;
}
.sheet-title {
  font-size: 15.5px;
  font-weight: 600;
  flex: 1;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.sheet-actions { display: flex; gap: 8px; flex: none; }
.sheet-action {
  font-size: 12.5px;
  color: var(--brand);
  padding: 5px 11px;
  border-radius: 999px;
  background: rgba(255, 44, 85, .12);
}
.sheet-x {
  width: 30px; height: 30px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: var(--sub);
  flex: none;
}
.sheet-x:hover { background: rgba(255, 255, 255, .08); color: var(--text); }

.sheet-body {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding: 14px 16px calc(18px + var(--sab));
}
.sheet-status.is-error .sheet-status-ico { color: var(--warn); }
.sheet-status p { line-height: 1.8; font-size: 13.5px; }

.opt-list { display: flex; flex-direction: column; gap: 2px; }
.opt-row {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 13px 10px;
  border-radius: var(--radius-sm);
  text-align: left;
  transition: background .15s var(--ease);
}
.opt-row:hover { background: rgba(255, 255, 255, .05); }
.opt-text { font-size: 14.5px; }
.opt-row.is-current .opt-text { color: var(--brand); font-weight: 600; }
.opt-note { font-size: 12px; color: var(--dim); margin-left: auto; }
.opt-check { color: var(--brand); flex: none; margin-left: auto; }
.opt-row.is-current .opt-note { margin-left: auto; }

.epgrid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(88px, 1fr));
  gap: 9px;
}
.epcell {
  position: relative;
  min-height: 46px;
  padding: 8px 6px;
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  border: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  transition: all .15s var(--ease);
  overflow: hidden;
}
.epcell:hover { background: var(--surface-3); }
.epcell-no { font-size: 13.5px; font-weight: 600; }
.epcell-t {
  font-size: 11px;
  color: var(--dim);
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.epcell.is-current {
  background: rgba(255, 44, 85, .16);
  border-color: rgba(255, 44, 85, .55);
}
.epcell.is-current .epcell-no { color: var(--brand); }
.epcell.is-current .epcell-t { color: #ff96aa; }

/* 预取状态点（右上角）：实心绿 = 已备好、点开即播；半透明呼吸 = 正在取 */
.epcell-dot {
  position: absolute;
  top: 6px;
  right: 6px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: none;
}
.epcell.is-pre .epcell-dot {
  display: block;
  background: #2ee08a;
  box-shadow: 0 0 6px rgba(46, 224, 138, .85);
}
.epcell.is-loading .epcell-dot {
  display: block;
  background: #2ee08a;
  animation: epPulse 1s ease-in-out infinite;
}
@keyframes epPulse {
  0%, 100% { opacity: .22; transform: scale(.8); }
  50% { opacity: .85; transform: scale(1.05); }
}
.eplegend {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-bottom: 10px;
  font-size: 12px;
  color: var(--dim);
}
.eplegend-dot {
  flex: none;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #2ee08a;
  box-shadow: 0 0 6px rgba(46, 224, 138, .85);
}

.sheet-desc-text { font-size: 14px; line-height: 1.85; color: #d6d9e6; margin-bottom: 16px; }

.dialog {
  position: fixed;
  left: 0; top: 0; right: 0; bottom: 0;
  z-index: 80;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  opacity: 0;
  visibility: hidden;
  transition: opacity .2s var(--ease), visibility .2s;
}
.dialog.is-on { opacity: 1; visibility: visible; }
.dialog-box {
  width: 100%;
  max-width: 400px;
  padding: 22px;
  border-radius: var(--radius-lg);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  transform: scale(.94);
  transition: transform .2s var(--ease);
}
.dialog.is-on .dialog-box { transform: scale(1); }
.dialog-title { font-size: 16.5px; font-weight: 600; margin-bottom: 9px; }
.dialog-text { font-size: 13.5px; color: var(--sub); line-height: 1.8; margin-bottom: 20px; }
.dialog-row { display: flex; gap: 10px; justify-content: flex-end; }

/* ============================================================
 * 桌面顶栏
 * ========================================================== */

.topbar {
  position: sticky;
  top: 0;
  z-index: 30;
  background: rgba(11, 11, 16, .86);
  border-bottom: 1px solid var(--line);
  -webkit-backdrop-filter: blur(14px) saturate(160%);
  backdrop-filter: blur(14px) saturate(160%);
}
.tb-inner {
  max-width: 1400px;
  margin: 0 auto;
  height: var(--topbar-h);
  padding: 0 22px;
  display: flex;
  align-items: center;
  gap: 20px;
}
.tb-logo {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 17px;
  letter-spacing: .5px;
  flex: none;
  white-space: nowrap;
}
.tb-logo b { color: var(--brand); font-weight: 700; }
/* 站点 logo 就是 favicon.ico 本身（站点根目录那一份，浏览器已经缓存过） */
.logo-img {
  width: 28px; height: 28px;
  border-radius: 50%;
  object-fit: cover;
  flex: none;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .35);
}
.tb-tabs { display: flex; gap: 4px; flex: none; }
.tb-tab {
  padding: 7px 15px;
  border-radius: 999px;
  font-size: 14.5px;
  color: var(--sub);
  transition: all .16s var(--ease);
}
.tb-tab:hover { color: var(--text); background: rgba(255, 255, 255, .06); }
.tb-tab.is-on { color: #fff; background: rgba(255, 44, 85, .18); font-weight: 600; }
.tb-tab--plain { color: var(--sub); }
.tb-right { display: flex; gap: 8px; flex: none; margin-left: auto; }

.tb-search {
  position: relative;
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
  padding: 0 4px 0 36px;
  height: 38px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  transition: border-color .18s var(--ease), background .18s var(--ease);
}
.tb-search:focus-within { border-color: rgba(255, 44, 85, .55); background: var(--surface-2); }
.tb-search-ico {
  position: absolute;
  left: 13px; top: 50%;
  width: 15px; height: 15px;
  margin-top: -8px;
  border: 2px solid var(--dim);
  border-radius: 50%;
}
.tb-search-ico::after {
  content: "";
  position: absolute;
  right: -5px; bottom: -4px;
  width: 7px; height: 2px;
  background: var(--dim);
  transform: rotate(45deg);
}
.tb-search input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 14px;
}
.tb-search input::placeholder { color: var(--dim); }
.tb-search-btn {
  height: 30px;
  padding: 0 15px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-size: 13.5px;
  font-weight: 600;
  flex: none;
}

/* ============================================================
 * 页面骨架
 * ========================================================== */

.stage { display: block; }
.page {
  max-width: 1400px;
  margin: 0 auto;
  padding: 26px 22px 60px;
}
.page-search { padding-top: 30px; }

.sec-head {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
  margin-bottom: 20px;
}
.sec-title {
  display: flex;
  align-items: center;
  gap: 9px;
  font-size: 21px;
  font-weight: 700;
  letter-spacing: .3px;
}
.sec-dot {
  width: 5px; height: 21px;
  border-radius: 3px;
  background: linear-gradient(180deg, var(--brand), var(--brand-2));
  flex: none;
}
.sec-right { display: flex; align-items: center; gap: 10px; margin-left: auto; flex-wrap: wrap; }

.list-foot {
  padding: 26px 0 10px;
  text-align: center;
  font-size: 13px;
  color: var(--dim);
}

/* ============================================================
 * 卡片网格
 * ========================================================== */

.grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(184px, 1fr));
  gap: 22px 16px;
}
.grid--mini { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px 12px; }

.card { display: block; contain: content; }
.card-poster {
  position: relative;
  width: 100%;
  padding-top: 133%;
  border-radius: 12px;
  overflow: hidden;
  background: #191922;
  box-shadow: var(--shadow-sm);
  transform: translateZ(0);
  transition: transform .24s var(--ease), box-shadow .24s var(--ease);
}
@supports (aspect-ratio: 3 / 4) {
  .card-poster { padding-top: 0; aspect-ratio: 3 / 4; }
}
.card-poster img {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .4s var(--ease), opacity .3s var(--ease);
}
.card:hover .card-poster { transform: translateY(-4px); box-shadow: 0 16px 34px rgba(0, 0, 0, .55); }
.card:hover .card-poster img { transform: scale(1.05); }

.card-score {
  position: absolute;
  left: 7px; top: 7px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .55);
  color: #ffd166;
  font-size: 11.5px;
  font-weight: 700;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.card-badge {
  position: absolute;
  right: 7px; bottom: 7px;
  padding: 2px 8px;
  border-radius: 6px;
  background: rgba(0, 0, 0, .58);
  font-size: 11.5px;
  color: #eaeaf2;
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.card-watched {
  position: absolute;
  left: 7px; bottom: 7px;
  padding: 2px 7px;
  border-radius: 6px;
  background: rgba(255, 44, 85, .82);
  font-size: 11px;
  color: #fff;
}
.card-play {
  position: absolute;
  left: 50%; top: 50%;
  width: 46px; height: 46px;
  margin: -23px 0 0 -23px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .5);
  border: 1px solid rgba(255, 255, 255, .28);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  opacity: 0;
  transform: scale(.86);
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  -webkit-backdrop-filter: blur(4px);
  backdrop-filter: blur(4px);
}
.card:hover .card-play { opacity: 1; transform: scale(1); }
.card-play .ico { margin-left: 2px; }

.card-title {
  margin-top: 10px;
  font-size: 14.5px;
  font-weight: 600;
  line-height: 1.45;
  max-height: 2.9em;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.card-sub {
  margin-top: 4px;
  font-size: 12px;
  color: var(--dim);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card--sk .card-poster { background: transparent; }
.card--sk .card-poster.sk { border-radius: 12px; }

/* ============================================================
 * 搜索页
 * ========================================================== */

.search-box {
  display: flex;
  align-items: center;
  gap: 10px;
  height: 46px;
  padding: 0 6px 0 42px;
  border-radius: 999px;
  background: var(--surface);
  border: 1px solid var(--line);
  position: relative;
  max-width: 720px;
  transition: border-color .18s var(--ease);
}
.search-box:focus-within { border-color: rgba(255, 44, 85, .5); }
.search-ico { position: absolute; left: 14px; color: var(--dim); }
.search-input {
  flex: 1;
  min-width: 0;
  height: 100%;
  background: none;
  border: 0;
  outline: none;
  color: var(--text);
  font-size: 15px;
}
.search-input::placeholder { color: var(--dim); }
.search-go {
  height: 36px;
  padding: 0 20px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  color: #fff;
  font-weight: 600;
  font-size: 14px;
  flex: none;
}
.search-types { display: flex; gap: 9px; margin-top: 14px; }

.search-log { margin-top: 22px; }
.log-head {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 11px;
  font-size: 13.5px;
  color: var(--sub);
}
.chips { display: flex; flex-wrap: wrap; gap: 9px; }

.search-results { margin-top: 26px; }
.result-count { font-size: 13px; color: var(--dim); margin-bottom: 14px; }

.page-search .btn-block { margin-top: 26px; max-width: 320px; margin-left: auto; margin-right: auto; }

/* ============================================================
 * 我的
 * ========================================================== */

.page-h1 {
  font-size: 22px;
  font-weight: 700;
  margin-bottom: 18px;
  letter-spacing: .3px;
}
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  margin-bottom: 16px;
  overflow: hidden;
}
.panel-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 15px 18px;
  border-bottom: 1px solid var(--line);
}
.panel-head h3 { font-size: 15px; font-weight: 600; flex: 1; }
.panel-body { padding: 16px 18px; }

.kv { display: flex; flex-direction: column; gap: 9px; }
.kv-row { display: flex; gap: 14px; font-size: 13.5px; align-items: baseline; }
.kv-k { color: var(--dim); flex: none; min-width: 84px; }
.kv-v { color: #d9dce8; word-break: break-all; }
.kv-v.is-ok { color: var(--ok); }
.kv-v.is-bad { color: var(--warn); }

.set-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 13px 0;
  border-bottom: 1px dashed var(--line);
}
.set-row:last-child { border-bottom: 0; }
.set-left { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.set-label { font-size: 14px; }
.set-note { font-size: 12px; color: var(--dim); line-height: 1.6; }

.inline-form { display: flex; gap: 10px; margin: 12px 0 10px; align-items: center; }
.inline-form .search-input {
  height: 40px;
  padding: 0 14px;
  border-radius: 10px;
  background: var(--surface-2);
  border: 1px solid var(--line);
}

.hrow {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 9px 0;
  border-bottom: 1px solid var(--line);
}
.hrow:last-child { border-bottom: 0; }
.hrow-thumb {
  width: 54px; height: 72px;
  border-radius: 8px;
  overflow: hidden;
  background: #1d1d27;
  flex: none;
}
.hrow-thumb img { width: 100%; height: 100%; object-fit: cover; }
.hrow-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.hrow-title {
  font-size: 14px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.hrow-sub { font-size: 12px; color: var(--dim); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.hrow-bar {
  position: absolute;
  left: 0; bottom: 0;
  width: 100%; height: 2px;
  background: rgba(255, 255, 255, .08);
}
.hrow-bar > i { display: block; height: 100%; background: var(--brand); }

.panel .btn-block { margin-top: 16px; }

/* ============================================================
 * 桌面详情页
 * ========================================================== */

.page-detail {
  max-width: 1480px;
  padding-top: 22px;
}
.d-wrap {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 336px;
  gap: 22px;
  align-items: start;
}
.d-left { min-width: 0; }

.d-stage {
  position: relative;
  width: 100%;
  padding-top: 56.25%;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
}
@supports (aspect-ratio: 16 / 9) {
  .d-stage { padding-top: 0; aspect-ratio: 16 / 9; }
}
.d-video {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  background: #000;
  display: block;
}
.d-stage.is-loading .d-spin { display: flex; }
.d-center {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.d-spin { display: none; gap: 7px; }
.d-spin > i {
  width: 10px; height: 10px;
  border-radius: 50%;
  background: #fff;
  opacity: .35;
  animation: dot 1s var(--ease) infinite;
}
.d-spin > i:nth-child(2) { animation-delay: .16s; }
.d-spin > i:nth-child(3) { animation-delay: .32s; }

.d-tapplay {
  position: absolute;
  width: 66px; height: 66px;
  border-radius: 50%;
  background: rgba(0, 0, 0, .48);
  border: 1px solid rgba(255, 255, 255, .3);
  display: flex; align-items: center; justify-content: center;
  color: #fff;
  opacity: 0;
  transform: scale(.9);
  transition: opacity .22s var(--ease), transform .22s var(--ease);
}
/* 只有"没在播"时才亮出播放键。曾经这里还挂着 .is-blocked，而 is-blocked
   加上了就再没摘过，于是自动播放被拦一次之后，播放键会一直糊在画面上。 */
.d-stage:not(.is-playing) .d-tapplay { opacity: 1; transform: scale(1); }
/* is-blocked 只做"被拦下了"的提醒（显隐一概不碰，交给上面那条） */
.d-stage.is-blocked .d-tapplay { box-shadow: 0 0 0 4px rgba(255, 44, 85, .3); }

/* 出错时弹一张居中卡片，而不是铺满整个播放区 —— 整块盖住的话连控制栏都够不着。
   控制栏 z-index 更高，仍然可用。 */
.d-err {
  position: absolute;
  left: 50%; top: 50%;
  transform: translate(-50%, -50%);
  z-index: 3;
  width: 86%;
  max-width: 400px;
  /* 播放区是 16:9，窄的时候不高；卡片得能自己滚，别把按钮裁掉 */
  max-height: 94%;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 11px;
  padding: 16px 18px;
  border-radius: 14px;
  background: rgba(12, 12, 18, .95);
  border: 1px solid rgba(255, 90, 120, .32);
  box-shadow: 0 18px 44px rgba(0, 0, 0, .55);
  text-align: center;
  font-size: 13.5px;
  line-height: 1.7;
  color: #ffa9ba;
}
.d-err-msg { margin: 0; }

/* 控制栏：进度条内嵌在这一横排里（和常见桌面播放器一致），
   一横排拖起来最顺手，也不挡住画面中间的内容 */
.d-ctl {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0), rgba(0, 0, 0, .8));
  opacity: 0;
  transition: opacity .2s var(--ease);
}
.d-stage:hover .d-ctl, .d-stage.is-paused .d-ctl { opacity: 1; }
@media (hover: none) { .d-ctl { opacity: 1; } }

/* 全屏：鼠标停手 2.6 秒就把控制栏连同光标一起收起来（见 player.js 的 bindChrome）。
   这条必须排在 :hover 那条**之后** —— 全屏时 stage 铺满整屏，鼠标永远"悬停"在
   它上面，光靠 :hover 永远摘不掉控制栏。:not(.is-paused) 是为了让暂停时照样常亮，
   权重也顺带压过上面那条。收起时不接收点击，否则看不见的按钮还在吃底部的点击。 */
.d-stage.is-idle:not(.is-paused) .d-ctl { opacity: 0; pointer-events: none; }
.d-stage.is-idle:not(.is-paused) { cursor: none; }

/* 全屏时钟（时:分）：全屏之后浏览器把自己的状态栏 / 地址栏 / 任务栏都收走了，
   用户没法知道现在几点。默认藏起来（窗口模式本来就看得见系统时间），
   只有全屏时才在画面右上角露一个小牌子。显隐交给 CSS，JS 只管每分钟改字。 */
.fs-clock {
  position: absolute;
  top: 10px;
  right: 12px;
  z-index: 45;
  display: none;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  letter-spacing: .02em;
  line-height: 1.5;
  color: rgba(255, 255, 255, .92);
  background: rgba(0, 0, 0, .42);
  border: 1px solid rgba(255, 255, 255, .14);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
  pointer-events: none;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
/* 前缀版要各写一条：一条选择器里混着浏览器不认的伪类，整条规则都会被丢掉 */
:fullscreen .fs-clock { display: flex; }
:-webkit-full-screen .fs-clock { display: flex; }
:-moz-full-screen .fs-clock { display: flex; }
/* 移动端的时钟挂在顶栏里跟着排版走（横排最后一个），不绝对定位，
   免得压住右上角那个集数角标；清屏时也不参与淡出。 */
.feed-head .fs-clock {
  position: static;
  top: auto; right: auto;
  flex: none;
}

.d-btn {
  width: 34px; height: 34px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 8px;
  color: #e9ebf4;
  transition: background .15s var(--ease), color .15s var(--ease);
  flex: none;
}
.d-btn:hover { background: rgba(255, 255, 255, .16); }
.d-btn--text { width: auto; padding: 0 11px; font-size: 12.5px; font-weight: 600; }

/* 音量：喇叭 + 一条 64px 的滑块。滑块比进度条窄，别跟它抢那一行的空间 */
.d-vol { display: flex; align-items: center; gap: 6px; flex: none; }
.d-btn--vol { width: 30px; height: 30px; }
.d-vol-bar {
  position: relative;
  width: 64px; height: 24px;
  padding: 10px 0;
  cursor: pointer;
  touch-action: none;
}
.d-vol-bar::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 10px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .28);
}
.d-vol-p {
  position: absolute;
  left: 0; top: 10px;
  height: 4px; width: 0;
  border-radius: 4px;
  background: #fff;
  z-index: 1;
}
.d-vol-k {
  position: absolute;
  top: 7px; left: 0;
  width: 10px; height: 10px;
  margin-left: -5px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(0, 0, 0, .35);
  z-index: 2;
}
@media (max-width: 640px) { .d-vol-bar { width: 44px; } }

.d-info { padding: 18px 2px; }
.d-info-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; margin-bottom: 12px; }
.d-title { font-size: 23px; font-weight: 700; letter-spacing: .2px; }
.d-epnow { font-size: 13px; color: var(--brand); font-weight: 600; }
.d-info-head .btn { margin-left: auto; height: 32px; padding: 0 13px; font-size: 13px; }
.d-tags { display: flex; flex-wrap: wrap; margin-top: 2px; }
/* 作者单独一行：详情页里这是最常被找的一项 */
.d-creds { display: flex; align-items: baseline; gap: 8px; font-size: 13px; margin-bottom: 4px; }
.d-creds-k { color: var(--dim); flex: none; }
.d-creds-v { color: #d3d7e6; }
.d-abstract {
  margin-top: 12px;
  font-size: 13.8px;
  line-height: 1.9;
  color: #c3c7d6;
  max-width: 900px;
}

.d-side {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  position: sticky;
  top: calc(var(--topbar-h) + 16px);
}
.d-side-head {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
}
.d-side-head b { font-size: 15px; flex: 1; }
.d-side-sub { font-size: 12.5px; color: var(--dim); }
/* 选集：短剧动辄几十集，用网格比竖着一列好翻，每格都明写「第 N 集」 */
.d-eplist {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  max-height: 64vh;
  overflow-y: auto;
  padding: 12px;
  -webkit-overflow-scrolling: touch;
}
.d-ep {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 34px;
  padding: 0 8px;
  border-radius: 8px;
  background: var(--surface-2);
  border: 1px solid transparent;
  font-size: 12.5px;
  color: var(--sub);
  white-space: nowrap;
  overflow: hidden;
  transition: background .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease);
}
.d-ep:hover { background: var(--surface-3); color: var(--text); }
.d-ep-no { font-variant-numeric: tabular-nums; overflow: hidden; text-overflow: ellipsis; }

/* 预取绿点：PC 侧栏与移动弹层同一套语义 —— 实心绿=已备好，呼吸=正在取 */
.d-ep { position: relative; }
.d-ep-dot {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  display: none;
}
.d-ep.is-pre .d-ep-dot {
  display: block;
  background: #2ee08a;
  box-shadow: 0 0 6px rgba(46, 224, 138, .85);
}
.d-ep.is-loading .d-ep-dot {
  display: block;
  background: #2ee08a;
  animation: epPulse 1s ease-in-out infinite;
}
.d-ep.is-current {
  background: rgba(255, 44, 85, .16);
  border-color: rgba(255, 44, 85, .5);
  color: #ff8ba1;
  font-weight: 600;
}

/* 移动端底部导航 */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  z-index: 28;
  display: flex;
  padding-bottom: var(--sab);
  background: rgba(10, 10, 15, .92);
  border-top: 1px solid var(--line);
  -webkit-backdrop-filter: blur(16px) saturate(160%);
  backdrop-filter: blur(16px) saturate(160%);
}
.tab {
  flex: 1;
  height: 54px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  color: var(--dim);
  font-size: 10.5px;
  transition: color .16s var(--ease);
}
.tab.is-on { color: var(--brand); }
.tab:active { transform: scale(.94); }

/* ============================================================
 * 竖滑播放流（移动端核心，Swiper 驱动）
 * ========================================================== */

/* 播放层铺满整屏并盖住底栏：进去就是沉浸式的一屏一集 */
.feed-layer {
  position: fixed;
  left: 0; top: 0; right: 0;
  height: 100vh;
  height: 100dvh;
  height: var(--app-h, 100vh);
  z-index: 32;
  background: #000;
  overflow: hidden;
  opacity: 0;
  transform: translateY(3%);
  transition: opacity .26s var(--ease), transform .26s var(--ease);
}
.feed-layer.is-on { opacity: 1; transform: none; }

/* ---- Swiper 最小骨架 ----------------------------------------
   Swiper 只用 container / wrapper / slide 三个类名，这里按需只搬必需的
   几条规则，不引它整包 CSS（导航、分页、3D 那些一个都用不上）。
   ------------------------------------------------------------ */
.feed {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  overflow: hidden;
  background: #000;
  /* 整层全屏，竖向手势全交给 Swiper，别让浏览器自己滚/下拉刷新 */
  touch-action: none;
  overscroll-behavior: none;
}
/* Swiper 会在容器上补 swiper-container-vertical / -initialized 等类，
   这里把容器本身该有的几条补上（其余尺寸由 .feed 定） */
.feed.swiper-container {
  margin-left: auto;
  margin-right: auto;
  list-style: none;
  padding: 0;
}
.feed > .swiper-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  z-index: 1;
  display: flex;
  flex-direction: column;
  box-sizing: content-box;
  transition-property: transform;
  transform: translate3d(0, 0, 0);
}
.feed .swiper-slide {
  flex-shrink: 0;
  width: 100%;
  height: 100%;
  position: relative;
  transition-property: transform;
}

.fi {
  position: relative;
  width: 100%;
  height: 100%;
  overflow: hidden;
  background: #000;
  backface-visibility: hidden;
  -webkit-backface-visibility: hidden;
}

.fi-bg {
  position: absolute;
  left: -8%; top: -8%;
  width: 116%; height: 116%;
  z-index: 1;
  background-position: center;
  background-size: cover;
  filter: blur(22px) brightness(.5) saturate(1.2);
  -webkit-filter: blur(22px) brightness(.5) saturate(1.2);
  transform: scale(1.06);
  transition: opacity .45s var(--ease);
}
.fi-v {
  position: absolute;
  left: 0; top: 0;
  width: 100%; height: 100%;
  z-index: 2;
  object-fit: contain;
  background: transparent;
  display: block;
}
/* 手势层：单击唤起/暂停、左右滑调进度、长按 2 倍速都挂在这上面 */
.fi-tap { position: absolute; left: 0; top: 0; right: 0; bottom: 0; z-index: 5; }

.fi-center {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  z-index: 6;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
}
.fi-center.is-hidden { opacity: 0; visibility: hidden; transition: opacity .25s var(--ease), visibility .25s; }
.fi-spin { display: none; gap: 8px; }
.fi.is-loading .fi-spin { display: flex; }
.fi-spin > i {
  width: 11px; height: 11px;
  border-radius: 50%;
  background: #fff;
  opacity: .4;
  animation: dot 1s var(--ease) infinite;
}
.fi-spin > i:nth-child(2) { animation-delay: .16s; }
.fi-spin > i:nth-child(3) { animation-delay: .32s; }
/* 中间的播放键：最传统的那种正圆玻璃按钮 —— 半透明黑底 + 一圈细白边 +
   白色三角压一层投影。暗场、亮场都看得清，也不会像品牌贴片那样抢画面。
   之前那版是圆角方 + 品牌渐变 + 呼吸光环，压在任何画面上都太"重"，
   换成圆形之后和桌面端 .d-tapplay 也统一了。 */
.fi-tapplay {
  position: relative;
  display: none;
  width: 68px; height: 68px;
  border-radius: 50%;
  align-items: center; justify-content: center;
  color: #fff;
  background: rgba(0, 0, 0, .46);
  border: 1px solid rgba(255, 255, 255, .34);
  box-shadow: 0 6px 20px rgba(0, 0, 0, .38), inset 0 1px 0 rgba(255, 255, 255, .16);
  -webkit-backdrop-filter: blur(8px) saturate(1.2);
  backdrop-filter: blur(8px) saturate(1.2);
}
.fi-center.is-tap .fi-tapplay { display: flex; }
.fi-center.is-tap .fi-spin { display: none !important; }
/* 加载/起播阶段一律不亮这个键：那段时间画面中间只该有转圈的那三个点。
   换集时浏览器会替我们甩出一串 pause，没有这一条就会闪一下播放键。
   注意 :not(.is-tap)：自动播放被拦下时（is-loading 可能还在）得让用户点得到。 */
.fi.is-loading .fi-center:not(.is-tap) .fi-tapplay { display: none !important; }
/* 三角右侧留白比左侧多，往右挪一点才是视觉居中；再压一层投影，浅色画面上也看得清 */
.fi-tapplay .ico {
  margin-left: 4px;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45));
  -webkit-filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .45));
}

/* ---- 底部：标题 / 作者 / 简介 + 进度条 ---------------------- */
.fi-foot {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  z-index: 8;
  /* 右侧让出竖排按钮的宽度 */
  padding: 54px 64px calc(12px + var(--sab)) 16px;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0) 0%, rgba(0, 0, 0, .38) 42%, rgba(0, 0, 0, .82) 100%);
  transition: opacity .25s var(--ease), visibility .25s;
}
.fi-meta { pointer-events: none; }
.fi-title {
  font-size: 17.5px;
  font-weight: 700;
  line-height: 1.4;
  margin-bottom: 7px;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.fi-ep {
  display: inline-block;
  margin-left: 8px;
  padding: 2px 9px;
  border-radius: 6px;
  background: rgba(255, 44, 85, .85);
  font-size: 11.5px;
  font-weight: 600;
  vertical-align: 2px;
  color: #fff;
}
.fi-sub { display: flex; flex-wrap: wrap; }
.fi-sub .fi-tag { background: rgba(255, 255, 255, .16); }
.fi-desc {
  font-size: 13px;
  line-height: 1.6;
  color: rgba(255, 255, 255, .8);
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}

.fi-bar-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 10px;
}
.fi-time {
  flex: none;
  font-size: 11.5px;
  color: rgba(255, 255, 255, .78);
  font-variant-numeric: tabular-nums;
  text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
}

/* 进度条（移动端与桌面端共用）：触摸高度 24px、视觉只要 4px，
   手指按得准，画面也不脏。拖拽期间 Swiper 会被 swiper-no-swiping 拦住。 */
.fi-bar {
  position: relative;
  flex: 1;
  min-width: 90px;
  height: 24px;
  padding: 10px 0;
  touch-action: none;
  cursor: pointer;
}
.fi-bar::before {
  content: "";
  position: absolute;
  left: 0; right: 0; top: 10px;
  height: 4px;
  border-radius: 4px;
  background: rgba(255, 255, 255, .24);
}
.fi-bar-b, .fi-bar-p {
  position: absolute;
  left: 0; top: 10px;
  height: 4px;
  width: 0;
  border-radius: 4px;
}
.fi-bar-b { background: rgba(255, 255, 255, .42); }
.fi-bar-p {
  background: var(--brand);
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  z-index: 1;
}
.fi-bar-k {
  position: absolute;
  top: 5px;
  left: 0;
  width: 14px; height: 14px;
  margin-left: -7px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 0 0 3px rgba(255, 44, 85, .3);
  z-index: 2;
  transition: transform .16s var(--ease);
}
.fi-bar.is-drag .fi-bar-k { transform: scale(1.3); }

/* ---- 右侧竖排按钮 ------------------------------------------ */
.fi-rail {
  position: absolute;
  right: 6px;
  bottom: calc(16px + var(--sab));
  z-index: 9;
  display: flex;
  flex-direction: column;
  gap: 15px;
  align-items: center;
  transition: opacity .25s var(--ease), visibility .25s;
}
.fi-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  color: #fff;
  filter: drop-shadow(0 2px 6px rgba(0, 0, 0, .6));
  transition: transform .14s var(--ease);
}
.fi-btn:active { transform: scale(.9); }
.fi-btn-t { font-size: 11px; color: rgba(255, 255, 255, .92); }
.fi-btn.is-on { color: var(--brand); }
.fi-btn.is-on .fi-btn-t { color: var(--brand); }

/* 客户端解密进度：探测编码 → 下载 → 解密 */
.fi-dec,
.d-dec {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 9;
  min-width: 170px;
  padding: 12px 14px;
  border-radius: var(--radius-sm);
  background: rgba(10, 10, 14, .76);
  text-align: center;
  pointer-events: none;
  -webkit-transform: translate(-50%, -50%);
  transform: translate(-50%, -50%);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
}
.fi-dec[hidden],
.d-dec[hidden] { display: none; }
.fi-dec-t,
.d-dec-t {
  font-size: 12px;
  line-height: 1.4;
  color: rgba(255, 255, 255, .88);
  margin-bottom: 9px;
}
.fi-dec-bar,
.d-dec-bar {
  height: 3px;
  border-radius: 2px;
  overflow: hidden;
  background: rgba(255, 255, 255, .18);
}
.fi-dec-bar > i,
.d-dec-bar > i {
  display: block;
  height: 100%;
  width: 0;
  border-radius: 2px;
  background: var(--brand);
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  transition: width .18s linear;
}

/* 播放 3 秒后自动清屏：顶栏的按钮与剧名、竖排按钮、底部信息一起淡出，只剩画面。
   顶栏容器本身留着不淡（背景底色去掉就行），这样右上角那个「当前集/总集数」
   小牌子能原地留下来 —— 界面一收，用户至少还知道自己在看第几集。
   注意：这里不能对 .feed-head 整体用 opacity（父级 opacity 子级无法覆盖）。 */
.feed.is-clean .feed-head { background: none; }
.feed.is-clean .fh-btn,
.feed.is-clean .fh-title,
.feed.is-clean .fi-rail,
.feed.is-clean .fi-foot {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

/* 错误浮层压在 z-index 7：底部信息/进度条(8)与右侧竖排按钮(9)仍在它上面，
   出错时也能直接选集换集，而不是被一整块黑幕困住。 */
.fi-err {
  position: absolute;
  left: 0; top: 0; right: 0; bottom: 0;
  z-index: 7;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  padding: 40px 30px 170px;
  text-align: center;
  background: rgba(0, 0, 0, .5);
  background: radial-gradient(120% 68% at 50% 34%, rgba(0, 0, 0, .68), rgba(0, 0, 0, .16) 72%);
}
.fi-err-icon { color: var(--warn); }
.fi-err-msg { font-size: 13.5px; line-height: 1.75; color: #e8e9f2; max-width: 300px; }
.fi-err-row { display: flex; gap: 10px; flex-wrap: wrap; justify-content: center; }

.feed-head {
  position: absolute;
  left: 0; right: 0; top: 0;
  z-index: 40;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: calc(8px + var(--sat)) 10px 22px;
  background: linear-gradient(180deg, rgba(0, 0, 0, .62), rgba(0, 0, 0, 0));
  transition: opacity .25s var(--ease), visibility .25s;
}
.fh-btn {
  width: 36px; height: 36px;
  display: flex; align-items: center; justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, .3);
  flex: none;
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
/* 清屏时逐个淡出（父级 .feed-head 不整体透明，好让集数角标留下） */
.fh-btn, .fh-title { transition: opacity .25s var(--ease), visibility .25s; }

/* 当前集数角标：5/66。清屏后唯一留在画面上的信息 */
.fh-pos {
  flex: none;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  color: #fff;
  background: rgba(0, 0, 0, .42);
  border: 1px solid rgba(255, 255, 255, .16);
  text-shadow: 0 1px 6px rgba(0, 0, 0, .6);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
}
.fh-btn:active { transform: scale(.93); }
.fh-title {
  flex: 1;
  min-width: 0;
  font-size: 15.5px;
  font-weight: 600;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-shadow: 0 1px 8px rgba(0, 0, 0, .7);
}


/* ============================================================
 * 布局分支
 * ========================================================== */

html[data-layout="desktop"] .feed-layer { display: none !important; }

/* 桌面端顶栏已经有搜索框和「真人剧 / 漫剧」切换了，落地页里这两样就是重复的 ——
   一起收起来（之前只收了搜索框，频道切换还是两套）。
   移动端没有顶栏，页面内这两个仍是唯一入口，所以只在 desktop 下隐藏。 */
html[data-layout="desktop"] .page-search .search-box,
html[data-layout="desktop"] .page-search .search-types { display: none; }

/* 收到只剩结果列表了，页面顶部不需要再留那段间距 */
html[data-layout="desktop"] .page-search { padding-top: 20px; }

html[data-layout="mobile"] .topbar { display: none !important; }
html[data-layout="mobile"] .stage { padding-bottom: 54px; }
html[data-layout="mobile"] .page {
  padding: calc(var(--sat) + 14px) 14px 90px;
}

/* 移动端搜索框吸顶：往下翻推荐/结果时它一直在，不用滚回顶部才能改词。
   top 用 --sat（安全区）而不是 0，免得独立模式下被刘海压住；
   那条大扩散的阴影是"底色"—— 把 .page 的内边距也盖住，
   让下面的卡片从它背后滚过去，而不是从两侧露出来。 */
html[data-layout="mobile"] .page-search .search-box {
  position: -webkit-sticky;
  position: sticky;
  top: var(--sat);
  z-index: 20;
  box-shadow: 0 -16px 0 16px var(--bg), 0 12px 20px -14px rgba(0, 0, 0, .8);
}
html[data-layout="mobile"] .page-detail { display: none; }
html[data-layout="mobile"] .grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px 11px;
}
html[data-layout="mobile"] .grid--mini { grid-template-columns: repeat(3, minmax(0, 1fr)); }
html[data-layout="mobile"] .card-title { font-size: 13.5px; }
html[data-layout="mobile"] .card-play { display: none; }
html[data-layout="mobile"] .sec-title { font-size: 18px; }
html[data-layout="mobile"] .sec-right { width: 100%; }
html[data-layout="mobile"] .state { padding: 46px 18px; }
html[data-layout="mobile"] .panel-body { padding: 14px; }
html[data-layout="mobile"] .panel-head { padding: 13px 14px; }
html[data-layout="mobile"] .set-row { flex-direction: column; align-items: flex-start; gap: 9px; }
html[data-layout="mobile"] .set-row .seg, html[data-layout="mobile"] .set-row .switch { align-self: flex-end; }
html[data-layout="mobile"] .set-row .seg { align-self: stretch; justify-content: space-between; }
html[data-layout="mobile"] .set-row .seg-btn { flex: 1; text-align: center; }
html[data-layout="mobile"] .search-box { height: 44px; padding-left: 40px; }
html[data-layout="mobile"] .epgrid { grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
html[data-layout="mobile"] .sheet-panel { max-width: none; border-radius: 18px 18px 0 0; }
html[data-layout="mobile"] .toast { bottom: calc(112px + var(--sab)); }
html[data-layout="mobile"] .kv-k { min-width: 76px; }

/* 平板 / 中等宽度：详情页侧栏下移 */
@media (max-width: 1100px) {
  .d-wrap { grid-template-columns: minmax(0, 1fr); }
  .d-side { position: static; }
  .d-eplist { max-height: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }
}

@media (max-width: 720px) {
  .page { padding: 18px 14px 70px; }
  .tb-search { display: none; }
  .grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 18px 12px; }
  .d-title { font-size: 19px; }
  .d-eplist { max-height: 46vh; }
}

/* 减少动效偏好 */
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after {
    animation-duration: .001ms !important;
    animation-iteration-count: 1 !important;
    transition-duration: .001ms !important;
  }
}

/* ============================================================
 * file:// 入口提示条（直接双击 index.html 时出现）
 * ========================================================== */

.origin-tip {
  position: fixed;
  left: 50%;
  top: 14px;
  z-index: 900;
  width: min(560px, calc(100vw - 24px));
  transform: translate(-50%, -12px);
  opacity: 0;
  transition: opacity .22s var(--ease), transform .22s var(--ease);
  background: var(--surface-2);
  border: 1px solid var(--line-2);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 15px 16px 13px;
  font-size: 13.5px;
  line-height: 1.65;
  color: var(--text);
}
.origin-tip.is-on { opacity: 1; transform: translate(-50%, 0); }

.origin-tip-h {
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--warn);
  font-size: 14.5px;
  margin-bottom: 8px;
}
.origin-tip-h svg { flex: none; }
.origin-tip-h b { color: var(--text); font-weight: 600; }

.origin-tip-p { margin: 0 0 8px; color: var(--sub); }
.origin-tip-cmd {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 0 0 8px;
}
.origin-tip-cmd .origin-tip-p { margin: 0; }
.origin-tip-code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 12.5px;
  color: #ffd8a8;
  background: rgba(245, 165, 36, .12);
  border: 1px solid rgba(245, 165, 36, .32);
  border-radius: 7px;
  padding: 3px 8px;
  word-break: break-all;
  user-select: all;
}

.origin-tip-acts {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 11px;
}
.origin-tip-acts .btn { height: 30px; padding: 0 12px; font-size: 13px; }

@media (max-width: 520px) {
  .origin-tip { top: 10px; padding: 13px 13px 11px; font-size: 13px; }
  .origin-tip-acts .btn { flex: 1; }
}
