/* ============================================================
   剧库 - 现代化响应式前端
   移动优先 (Mobile First) · 桌面双栏 · 深色/浅色自适应
   ============================================================ */

/* ---------- 主题变量 ---------- */
:root {
  color-scheme: light dark;
  --bg: #f4f6fb;
  --panel: #ffffff;
  --panel-2: #f8fafc;
  --text: #1a2233;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand-strong: #1d4ed8;
  --brand-soft: rgba(37, 99, 235, 0.12);
  --success: #16a34a;
  --success-soft: rgba(22, 163, 74, 0.12);
  --danger: #dc2626;
  --danger-soft: rgba(220, 38, 38, 0.12);
  --warning: #d97706;
  --warning-soft: rgba(217, 119, 6, 0.12);
  --shadow-sm: 0 1px 3px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 6px 16px rgba(15, 23, 42, 0.12);
  --shadow-lg: 0 12px 28px rgba(15, 23, 42, 0.18);
  --radius: 12px;
  --radius-sm: 8px;
  --radius-lg: 16px;
  --header-h: 56px;
  --font: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

@media (prefers-color-scheme: dark) {
  :root {
    --bg: #0f1520;
    --panel: #1a2230;
    --panel-2: #141b28;
    --text: #e8edf5;
    --muted: #94a3b8;
    --line: #2b3547;
    --brand: #3b82f6;
    --brand-strong: #2563eb;
    --brand-soft: rgba(59, 130, 246, 0.16);
    --success: #22c55e;
    --success-soft: rgba(34, 197, 94, 0.16);
    --danger: #ef4444;
    --danger-soft: rgba(239, 68, 68, 0.16);
    --warning: #f59e0b;
    --warning-soft: rgba(245, 158, 11, 0.16);
    --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.4);
    --shadow-md: 0 6px 16px rgba(0, 0, 0, 0.5);
    --shadow-lg: 0 12px 28px rgba(0, 0, 0, 0.6);
  }
}

/* ---------- 基础重置 ---------- */
* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; }
body {
  min-height: 100vh;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  background: var(--bg);
  color: var(--text);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.45;
  -webkit-tap-highlight-color: transparent;
  overscroll-behavior: none;
}

/* ---------- 通用控件 ---------- */
input, select, button {
  font: inherit;
  max-width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 10px;
  background: var(--panel);
  color: var(--text);
}
input[type="checkbox"] { accent-color: var(--brand); width: 17px; height: 17px; flex: none; }
button { cursor: pointer; }
button:disabled { opacity: 0.5; cursor: not-allowed; }
button:focus-visible, input:focus-visible, select:focus-visible, summary:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 8px 12px;
  background: var(--panel);
  color: var(--text);
  font-weight: 500;
  white-space: nowrap;
  transition: background 0.15s, border-color 0.15s, transform 0.1s;
}
.btn:active { transform: scale(0.97); }
.btn-primary { background: var(--brand); border-color: var(--brand); color: #fff; }
.btn-secondary { background: var(--panel); color: var(--text); border-color: var(--line); }
.btn-ghost { background: transparent; color: var(--text); border-color: transparent; }
.btn-danger { background: var(--danger); border-color: var(--danger); color: #fff; }
.btn-success { background: var(--success); border-color: var(--success); color: #fff; }
.btn-sm { padding: 5px 9px; font-size: 12px; border-radius: 6px; }
.btn-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  background: #fff;
  color: var(--brand);
  border-radius: 999px;
}
.btn-primary .btn-badge { background: #fff; color: var(--brand); }

/* ---------- 顶部导航 ---------- */
.app-header {
  flex: none;
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 0 14px;
  height: var(--header-h);
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  z-index: 50;
  box-shadow: var(--shadow-sm);
}
.header-left { display: flex; align-items: center; gap: 10px; min-width: 0; }
.brand { display: flex; align-items: center; gap: 6px; }
.brand-icon { font-size: 20px; }
.brand-title { font-size: 17px; font-weight: 700; letter-spacing: 0.3px; }
.header-right { display: flex; align-items: center; gap: 6px; margin-left: auto; }
.header-right .btn { padding: 7px 10px; }
.header-right .btn .icon { font-size: 15px; }
.header-right .btn .btn-text { font-size: 13px; }

/* 移动端 Tab 切换 */
.nav-tabs { display: none; }
.nav-tab {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 13px;
  font-weight: 500;
}
.nav-tab.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.tab-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  font-size: 11px;
  font-weight: 700;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
}
.nav-tab.active .tab-badge { background: rgba(255, 255, 255, 0.25); color: #fff; }
.tab-badge.warning { background: var(--warning-soft); color: var(--warning); }
.nav-tab.active .tab-badge.warning { background: rgba(255, 255, 255, 0.25); color: #fff; }

/* ---------- 主布局 ---------- */
.app-main {
  flex: 1;
  min-height: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 0;
  padding: 0;
  overflow: hidden;
}

.panel {
  min-height: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  background: var(--panel);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
}

/* ---------- 任务/历史 选项卡切换 ---------- */
.right-panel-tabs {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  border-bottom: 1px solid var(--line);
  padding-bottom: 8px;
}

.panel-tab-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  border: 1px solid transparent;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.2s ease;
}

.panel-tab-btn:hover {
  color: var(--text);
  background: var(--line);
}

.panel-tab-btn.active {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: rgba(59, 130, 246, 0.3);
}

/* 播放历史板块样式 */
.history-view {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
}

.history-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 14px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  flex: none;
}

.history-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 12px 14px;
}

.history-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.history-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, transform 0.15s ease;
}

.history-card:hover {
  border-color: var(--brand);
  box-shadow: var(--shadow-sm);
  transform: translateY(-1px);
}

.history-main {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 1;
  min-width: 0;
  cursor: pointer;
}

.history-cover-wrap {
  width: 48px;
  height: 64px;
  border-radius: 4px;
  overflow: hidden;
  background: var(--line);
  flex: none;
  position: relative;
}

.history-cover-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-cover-placeholder {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  background: var(--line);
}

.history-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  flex: 1;
  min-width: 0;
}

.history-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.history-progress-text {
  font-size: 12px;
  color: var(--muted);
}

.history-progress-bar-bg {
  width: 100%;
  max-width: 220px;
  height: 4px;
  background: rgba(0, 0, 0, 0.08);
  border-radius: 2px;
  overflow: hidden;
  margin-top: 2px;
}

@media (prefers-color-scheme: dark) {
  .history-progress-bar-bg {
    background: rgba(255, 255, 255, 0.15);
  }
}

.history-progress-bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 2px;
}

.history-time-ago {
  font-size: 11px;
  color: var(--muted);
  opacity: 0.8;
}

.history-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: none;
}

.btn-resume-play {
  padding: 6px 12px;
  font-size: 12px;
  font-weight: 600;
}

.history-empty-tip {
  text-align: center;
  padding: 40px 16px;
  color: var(--muted);
}
.history-empty-icon {
  font-size: 40px;
  margin-bottom: 10px;
}

/* ---------- 剧库面板 ---------- */
.panel-library { display: flex; }

.filter-bar {
  flex: none;
  padding: 10px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
  
  z-index: 40;
  box-shadow: var(--shadow-sm);
}
.filter-row { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; }
.main-filter-row { display: flex; align-items: center; gap: 8px; }

/* 视图模式切换胶囊 */
.view-mode-toggle {
  display: inline-flex;
  align-items: center;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 2px;
  gap: 2px;
  flex-shrink: 0;
}
.view-toggle-btn {
  background: transparent;
  border: none;
  color: var(--muted);
  width: 30px;
  height: 30px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  cursor: pointer;
  font-size: 15px;
  line-height: 1;
  transition: all 0.15s;
}
.view-toggle-btn:hover { color: var(--text); background: rgba(255, 255, 255, 0.05); }
.view-toggle-btn.active {
  background: var(--panel);
  color: var(--brand);
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

.search-box {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  padding: 7px 9px;
  background: var(--panel);
}
.search-icon { font-size: 13px; color: var(--muted); flex: none; }
.search-box input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  padding: 5px 2px;
  font-size: 13px;
}
.search-box input:focus { outline: none; }
.clear-btn {
  border: none;
  background: transparent;
  color: var(--muted);
  font-size: 13px;
  padding: 2px 6px;
  cursor: pointer;
  display: none;
}

.select-wrapper { position: relative; }
.select-wrapper select {
  appearance: none;
  padding: 8px 26px 8px 10px;
  font-size: 13px;
  border-radius: var(--radius-sm);
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  cursor: pointer;
}
.select-wrapper::after {
  content: "▾";
  position: absolute;
  right: 9px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 11px;
  color: var(--muted);
  pointer-events: none;
}

/* 分类胶囊横向滑动 */
.channel-pills-scroll {
  display: flex;
  gap: 7px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 0;
  margin-top: 6px;
}
.channel-pills-scroll::-webkit-scrollbar { display: none; }
.channel-pill {
  flex: none;
  padding: 5px 12px;
  border-radius: 999px;
  border: 1px solid var(--line);
  background: var(--panel);
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  transition: all 0.15s;
}
.channel-pill.active { background: var(--brand); border-color: var(--brand); color: #fff; }
.rank-pill {
  font-weight: 500;
  border-color: rgba(255, 255, 255, 0.12);
}
.rank-pill.active {
  background: linear-gradient(135deg, #f59e0b, #ea580c);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 2px 8px rgba(234, 88, 12, 0.35);
}

/* 排行榜勋章 (🥇 1 / 🥈 2 / 🥉 3 / TOP N) */
.poster-rank-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  z-index: 3;
  padding: 1px 6px;
  border-radius: 4px;
  font-size: 10px;
  font-weight: 700;
  color: #fff;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  line-height: 1.3;
}
.poster-rank-badge.rank-1 {
  background: linear-gradient(135deg, #f59e0b, #d97706);
  border-color: #fde68a;
  box-shadow: 0 2px 6px rgba(217, 119, 6, 0.5);
}
.poster-rank-badge.rank-2 {
  background: linear-gradient(135deg, #94a3b8, #64748b);
  border-color: #f1f5f9;
  box-shadow: 0 2px 6px rgba(100, 116, 139, 0.4);
}
.poster-rank-badge.rank-3 {
  background: linear-gradient(135deg, #b45309, #78350f);
  border-color: #fcd34d;
  box-shadow: 0 2px 6px rgba(120, 53, 15, 0.4);
}

/* 热度/播放量/评分标签 */
.poster-hot-badge {
  position: absolute;
  bottom: 22px;
  left: 4px;
  z-index: 2;
  padding: 1px 5px;
  border-radius: 3px;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
  backdrop-filter: blur(2px);
  border: 1px solid rgba(255, 255, 255, 0.15);
  line-height: 1.2;
}

.batch-control-row { margin-top: 6px; }
.stats-text { display: flex; flex-direction: column; gap: 1px; font-size: 12px; color: var(--muted); }
.stats-text #dramaCount { font-weight: 600; color: var(--text); }
.update-time { font-size: 11px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.batch-btns { display: flex; align-items: center; gap: 6px; margin-left: auto; flex-wrap: wrap; }

/* ---------- 卡片网格 ---------- */
.library-container {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 8px 10px;
}

/* 模式一：网格视图（自适应多列，海报比例紧凑不突兀） */
.cards-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
  gap: 8px 6px;
}

.card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  overflow: hidden;
  background: var(--panel);
  cursor: pointer;
  transition: transform 0.12s, box-shadow 0.12s, border-color 0.12s;
  position: relative;
  display: flex;
  flex-direction: column;
}
.card:active { transform: scale(0.98); }
.card.selected { border-color: var(--brand); box-shadow: 0 0 0 2px var(--brand-soft); }

/* 海报正中央醒目播放圆圈 - 已去除 */
.poster-play-btn {
  display: none !important;
}

.badge-online-stream {
  position: absolute;
  left: 4px;
  bottom: 4px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  background: rgba(37, 99, 235, 0.9);
  border-radius: 4px;
  backdrop-filter: blur(2px);
  z-index: 2;
  cursor: pointer;
}
.poster {
  position: relative;
  aspect-ratio: 1 / 1.32;
  max-height: 125px;
  background: linear-gradient(135deg, var(--panel-2), var(--line));
  overflow: hidden;
  flex-shrink: 0;
}
.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  loading: lazy;
  decoding: async;
}
.poster .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  color: var(--muted);
  background: linear-gradient(135deg, var(--panel-2), var(--line));
}
.poster-badge {
  position: absolute;
  top: 4px;
  left: 4px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.6);
  border-radius: 4px;
  backdrop-filter: blur(2px);
  z-index: 2;
}
.poster-badge[data-source="huangguo"] { background: rgba(217, 119, 6, 0.85); }
.poster-badge[data-source="huangdou"] { background: rgba(220, 38, 38, 0.85); }
.poster-badge[data-source="hongguo"] { background: rgba(37, 99, 235, 0.85); }

/* 集数角标 */
.episode-badge {
  position: absolute;
  right: 4px;
  bottom: 4px;
  padding: 1px 5px;
  font-size: 9px;
  font-weight: 600;
  color: #fff;
  background: rgba(0, 0, 0, 0.65);
  border-radius: 4px;
  backdrop-filter: blur(2px);
  z-index: 2;
}

/* 勾选圈（触控友好，精致轻巧） */
.check-circle {
  position: absolute;
  top: 4px;
  right: 4px;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 1.5px solid rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  color: #fff;
  z-index: 3;
  transition: all 0.15s;
}
.card.selected .check-circle {
  background: var(--brand);
  border-color: var(--brand);
}
.check-circle::after {
  content: "✓";
  opacity: 0;
  transform: scale(0.5);
  transition: all 0.15s;
}
.card.selected .check-circle::after { opacity: 1; transform: scale(1); }

/* 卡片正文 */
.card-body {
  padding: 5px 6px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}
.card-title {
  font-size: 11.5px;
  font-weight: 600;
  line-height: 1.35;
  color: var(--text);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.card-meta {
  font-size: 10px;
  color: var(--muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.card-desc {
  display: none;
}
.card-tags { display: none; }

.card-title-row {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}
.badge-downloaded-tag {
  flex-shrink: 0;
  font-size: 9px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 3px;
  background: var(--success-soft);
  color: var(--success);
  border: 1px solid var(--success);
  line-height: 1.2;
}

/* 快捷操作底栏 */
.card-action-bar {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 3px 5px 5px;
}
.btn-quick-play {
  flex: 1;
  padding: 4px 0;
  font-size: 10.5px;
  font-weight: 600;
  border-radius: 4px;
  border: 1px solid rgba(37, 99, 235, 0.4);
  background: rgba(37, 99, 235, 0.12);
  color: #3b82f6;
  cursor: pointer;
  transition: all 0.12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  min-width: 0;
}
.btn-quick-play:hover {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
}
.btn-quick-dl {
  width: 24px;
  height: 23px;
  padding: 0;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--muted);
  cursor: pointer;
  transition: all 0.12s;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}
.btn-quick-dl:hover {
  background: var(--panel);
  color: var(--text);
  border-color: var(--text);
}

/* ============================================================
   模式二：极简高效列表视图（横向行式布局，海报占比降至 10%）
   ============================================================ */
.cards-grid.view-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cards-grid.view-list .card {
  flex-direction: row;
  align-items: center;
  height: 62px;
  padding: 5px 8px 5px 6px;
  gap: 8px;
  border-radius: var(--radius-sm);
  transition: all 0.15s ease;
}
.cards-grid.view-list .card:hover {
  border-color: var(--border-hover);
  background: var(--panel-2);
}
.cards-grid.view-list .card.selected {
  background: rgba(37, 99, 235, 0.09);
  border-color: var(--brand);
}
/* 列表模式下的微缩海报：宽度仅 40px，高 52px，彻底避免封面过大 */
.cards-grid.view-list .poster {
  width: 38px;
  height: 50px;
  max-height: 50px;
  aspect-ratio: auto;
  border-radius: 4px;
  flex-shrink: 0;
}
.cards-grid.view-list .poster .check-circle,
.cards-grid.view-list .poster .episode-badge,
.cards-grid.view-list .poster .poster-badge,
.cards-grid.view-list .poster .badge-playable {
  display: none !important;
}

/* 列表模式主体内容 */
.cards-grid.view-list .card-body {
  padding: 0;
  justify-content: center;
  gap: 2px;
  overflow: hidden;
}
.cards-grid.view-list .card-title {
  font-size: 12.5px;
  font-weight: 600;
}
.cards-grid.view-list .card-meta {
  font-size: 11px;
  margin: 0;
  color: var(--muted);
}
.cards-grid.view-list .card-tags {
  display: flex;
  gap: 3px;
  margin: 0;
}
.cards-grid.view-list .card-tags .tag {
  font-size: 9.5px;
  padding: 0 4px;
  border-radius: 3px;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
}

/* 列表模式右侧操作区与勾选圈 */
.cards-grid.view-list .card-action-bar {
  margin-top: 0;
  padding: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
}
.cards-grid.view-list .btn-quick-play {
  flex: none;
  width: auto;
  padding: 4px 10px;
  font-size: 11.5px;
  font-weight: 600;
  background: var(--brand);
  color: #fff;
  border: none;
  border-radius: 4px;
}
.cards-grid.view-list .btn-quick-dl {
  width: 26px;
  height: 25px;
  padding: 0;
  font-size: 12px;
}
.cards-grid.view-list .check-circle {
  position: static;
  width: 22px;
  height: 22px;
  flex-shrink: 0;
  border: 1.5px solid var(--border);
  background: var(--panel-2);
  display: inline-flex;
}
.cards-grid.view-list .card.selected .check-circle {
  background: var(--brand);
  border-color: var(--brand);
}
.card-tags .tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
  white-space: nowrap;
}

/* 加载更多指示器 */
.load-more-sentinel {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 18px 0;
  color: var(--muted);
  font-size: 12px;
}
.loading-spinner {
  width: 18px;
  height: 18px;
  border: 2px solid var(--line);
  border-top-color: var(--brand);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* 空状态 */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  padding: 40px 20px;
  color: var(--muted);
  font-size: 13px;
}
.empty-state .empty-icon { font-size: 40px; }

/* ---------- 移动端吸底操作栏 ---------- */
.mobile-bottom-bar {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 100;
  display: none;
  background: var(--panel);
  border-top: 1px solid var(--line);
  box-shadow: var(--shadow-lg);
  padding: 10px 14px;
  transform: translateY(0);
  transition: transform 0.2s;
}
.mobile-bottom-bar.show { display: flex; }
.bottom-bar-content {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-wrap: wrap;
}
.bottom-selection-info { font-size: 13px; color: var(--text); font-weight: 500; }
.bottom-selection-info b { color: var(--brand); font-size: 15px; }
.bottom-actions { display: flex; align-items: center; gap: 8px; margin-left: auto; }

/* ---------- 详情弹窗 ---------- */
.modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 200;
  background: rgba(0, 0, 0, 0.55);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 16px;
  backdrop-filter: blur(2px);
}
.modal-card {
  background: var(--panel);
  border-radius: var(--radius-lg);
  max-width: 420px;
  width: 100%;
  max-height: 88vh;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  box-shadow: var(--shadow-lg);
  border: 1px solid var(--line);
  position: relative;
}
.modal-close-btn {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 30px;
  height: 30px;
  border-radius: 50%;
  border: none;
  background: var(--panel-2);
  color: var(--muted);
  font-size: 14px;
  cursor: pointer;
  z-index: 5;
}
.modal-body { padding: 0; }

/* 详情内容 */
.detail-hero {
  position: relative;
  width: 100%;
  aspect-ratio: 3 / 4;
  max-height: 320px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--panel-2), var(--line));
}
.detail-hero img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.detail-hero .poster-badge { top: 10px; left: 10px; font-size: 12px; }
.detail-hero .episode-badge { right: 10px; bottom: 10px; font-size: 12px; }
.detail-body { padding: 16px 18px; }
.detail-title { font-size: 18px; font-weight: 700; line-height: 1.35; color: var(--text); }
.detail-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.detail-meta .meta-chip {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
}
.detail-desc {
  margin-top: 10px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--muted);
  white-space: pre-wrap;
  word-break: break-word;
}
.detail-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 10px; }
.detail-tags .tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 6px;
  background: var(--brand-soft);
  color: var(--brand);
}
.detail-actions {
  display: flex;
  gap: 8px;
  margin-top: 14px;
  flex-wrap: wrap;
}
.detail-actions .btn { flex: 1; min-width: 120px; }

/* ---------- 下载任务面板 ---------- */
.panel-tasks { display: none; }
.tasks-head {
  flex: none;
  padding: 10px 12px;
  background: var(--panel);
  border-bottom: 1px solid var(--line);
}
.tasks-title-row { display: flex; align-items: center; gap: 8px; }
.tasks-title-row h2 { font-size: 16px; margin: 0; font-weight: 700; }
.badge-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  background: var(--brand-soft);
  color: var(--brand);
  border-radius: 999px;
}
.tasks-quick-actions { display: flex; gap: 6px; margin-left: auto; }
.task-error-tip { color: var(--danger); font-size: 12px; margin-top: 4px; }
.merge-option { display: flex; align-items: center; gap: 6px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.checkbox-label { display: flex; align-items: center; gap: 6px; cursor: pointer; font-size: 12px; color: var(--muted); }

.tasks-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  scrollbar-gutter: stable;
  padding: 10px 12px;
}
/* 存储概览卡片 */
.storage-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 10px 14px;
  margin-bottom: 12px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-size: 12px;
}
.storage-main {
  display: flex;
  align-items: center;
  gap: 14px;
  flex: 1;
  flex-wrap: wrap;
}
.storage-stat {
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.storage-tag {
  font-size: 11px;
  color: var(--muted);
}
.storage-num {
  font-size: 13px;
  font-weight: 700;
  color: var(--text);
}
.storage-divider {
  width: 1px;
  height: 24px;
  background: var(--line);
}
.storage-bar-box {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 140px;
}
.storage-bar-track {
  flex: 1;
  height: 7px;
  background: var(--line);
  border-radius: 4px;
  overflow: hidden;
}
.storage-bar-fill {
  height: 100%;
  background: var(--brand);
  border-radius: 4px;
  transition: width 0.3s ease;
}
.storage-percent {
  font-size: 11px;
  color: var(--muted);
  white-space: nowrap;
}

.task-groups { display: flex; flex-direction: column; gap: 10px; }

.task-group {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
}
.task-group-head {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 11px;
  cursor: pointer;
  background: var(--panel-2);
}
.group-select-checkbox {
  width: 16px;
  height: 16px;
  cursor: pointer;
  accent-color: var(--brand);
}
.task-group-title { flex: 1; min-width: 0; font-size: 13px; font-weight: 600; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.task-group-size {
  font-size: 11px;
  font-weight: 600;
  color: var(--brand);
  background: rgba(var(--brand-rgb, 16, 185, 129), 0.1);
  padding: 2px 6px;
  border-radius: 4px;
  white-space: nowrap;
}
.task-group-status { font-size: 11px; color: var(--muted); white-space: nowrap; }
.task-group-toggle { font-size: 12px; color: var(--muted); transition: transform 0.15s; }
.task-group.open .task-group-toggle { transform: rotate(90deg); }

.task-group-body { display: none; }
.task-group.open .task-group-body { display: block; }
.task-episode {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 7px 10px;
  border-top: 1px solid var(--line);
  font-size: 12px;
}
.task-episode-checkbox {
  accent-color: var(--brand);
}
.task-episode .ep-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; color: var(--text); }
.task-episode .ep-size {
  font-size: 11px;
  color: var(--muted);
  background: var(--panel-2);
  padding: 1px 5px;
  border-radius: 3px;
  white-space: nowrap;
}
.task-episode .ep-status { font-size: 11px; color: var(--muted); white-space: nowrap; }
.task-episode .ep-progress { font-size: 11px; color: var(--brand); font-weight: 600; white-space: nowrap; }

/* 单集操作按钮组 */
.ep-actions {
  display: flex;
  align-items: center;
  gap: 4px;
}
.ep-btn {
  padding: 2px 7px;
  font-size: 11px;
  border-radius: 4px;
  border: 1px solid var(--line);
  background: var(--panel-2);
  color: var(--text);
  cursor: pointer;
  transition: all 0.15s;
  white-space: nowrap;
}
.ep-btn:hover {
  background: var(--line);
  border-color: var(--text-muted);
}
.ep-btn-danger {
  color: #ef4444;
}
.ep-btn-danger:hover {
  background: rgba(239, 68, 68, 0.1);
  border-color: #ef4444;
}
.ep-btn-success {
  color: var(--brand);
}
.ep-btn-success:hover {
  background: rgba(16, 185, 129, 0.1);
  border-color: var(--brand);
}
.ep-progress-wrap {
  padding: 0 10px 6px 10px;
}

/* 进度条 */
.progress-track {
  height: 6px;
  border-radius: 3px;
  background: var(--line);
  overflow: hidden;
  margin-top: 4px;
}
.progress-track > span {
  display: block;
  height: 100%;
  background: var(--brand);
  transition: width 0.3s;
}

/* 任务组操作 */
.task-group-actions {
  display: flex;
  gap: 6px;
  padding: 6px 10px;
  border-top: 1px solid var(--line);
  flex-wrap: wrap;
}
.task-group-actions .btn { flex: none; }

/* ---------- 设置弹窗 ---------- */
.settings-dialog {
  border: none;
  border-radius: var(--radius-lg);
  background: var(--panel);
  color: var(--text);
  width: min(92vw, 560px);
  max-height: 88vh;
  padding: 0;
  box-shadow: var(--shadow-lg);
}
.settings-dialog::backdrop { background: rgba(0, 0, 0, 0.5); }
.settings-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--line);
  position: sticky;
  top: 0;
  background: var(--panel);
  z-index: 2;
}
.settings-header h2 { font-size: 17px; margin: 0; font-weight: 700; }
.settings-body { padding: 16px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.form-group { display: flex; flex-direction: column; gap: 5px; margin-bottom: 12px; }
.form-group label { font-size: 12px; color: var(--muted); font-weight: 500; }
.form-group input, .form-group select { font-size: 13px; }
.form-hint { font-size: 11px; color: var(--muted); }
.input-with-btn { display: flex; gap: 6px; align-items: center; }
.input-with-btn input { flex: 1; min-width: 0; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.manual-proxy-group { display: none; }
.settings-actions { display: flex; align-items: center; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.status-msg { font-size: 12px; color: var(--muted); }
.source-status-box { margin-top: 16px; }
.source-status-box h4 { font-size: 13px; margin: 0 0 8px; color: var(--muted); }
.source-tags { display: flex; flex-wrap: wrap; gap: 6px; }
.source-tags .source-tag {
  font-size: 11px;
  padding: 3px 9px;
  border-radius: 999px;
  background: var(--panel-2);
  color: var(--muted);
  border: 1px solid var(--line);
}
.source-tags .source-tag.ok { background: var(--success-soft); color: var(--success); border-color: var(--success); }
.source-tags .source-tag.fail { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }

/* ---------- Toast ---------- */
.toast-container {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  background: var(--panel);
  color: var(--text);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: var(--shadow-lg);
  padding: 10px 16px;
  font-size: 13px;
  max-width: 90vw;
  text-align: center;
  transition: opacity 0.2s;
}
.toast-container.error { background: var(--danger-soft); color: var(--danger); border-color: var(--danger); }
.toast-container.success { background: var(--success-soft); color: var(--success); border-color: var(--success); }

/* ============================================================
   响应式断点
   ============================================================ */

/* 平板/桌面（宽度 > 960px）：双栏工作台 */
@media (min-width: 961px) {
  .app-main {
    grid-template-columns: minmax(0, 1.15fr) minmax(420px, 1fr);
    gap: 14px;
    padding: 14px;
  }
  .panel-library, .panel-tasks { display: flex; }
  .nav-tabs { display: none; }
  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(115px, 1fr)); gap: 10px 8px; }
  
  .mobile-bottom-bar { display: none; }
  .form-grid { grid-template-columns: repeat(2, 1fr); }
}

/* 手机/窄屏（宽度 <= 960px）：单栏 Tab 切换 */
@media (max-width: 960px) {
  .app-header { height: 52px; padding: 0 10px; }
  .brand-title { font-size: 15px; }
  .header-right .btn .btn-text { display: none; }
  .header-right .btn { padding: 7px 9px; }
  .header-right .btn .icon { font-size: 16px; }

  .nav-tabs { display: flex; gap: 6px; }
  .nav-tab { padding: 6px 10px; font-size: 12px; }

  .app-main {
    display: flex;
    flex-direction: column;
    min-height: 0;
    overflow: hidden;
  }
  .panel {
    border-radius: 0;
    border: none;
    flex: 1;
    min-height: 0;
    height: 100%;
    overflow: hidden;
  }
  .panel-library { display: flex; }
  .panel-tasks { display: none; }

  
  .main-filter-row { flex-wrap: nowrap; gap: 6px; }
  .search-box { flex: 1; min-width: 0; }
  .select-wrapper select { max-width: 95px; }

  .cards-grid { grid-template-columns: repeat(auto-fill, minmax(90px, 1fr)); gap: 7px 6px; }
  .card-title { font-size: 11.5px; }
  .card-meta { font-size: 10px; }
  .card-desc { display: none; }
  .card-tags { display: none; }

  .batch-btns .btn { padding: 5px 8px; font-size: 11px; }
  .batch-btns .btn-badge { font-size: 10px; min-width: 16px; height: 16px; }

  .mobile-bottom-bar { display: flex; }
  .mobile-bottom-bar.show { display: flex; }
  .bottom-bar-content { flex-wrap: nowrap; }
  .bottom-selection-info { font-size: 12px; }
  .bottom-actions .btn { padding: 7px 10px; font-size: 12px; }

  .modal-card { max-width: 100%; border-radius: 0; }
  .detail-hero { max-height: 260px; }
  .detail-title { font-size: 16px; }
  .detail-desc { font-size: 12px; }
  .detail-actions .btn { flex: 1; }

  .tasks-head { padding: 8px 10px; }
  .tasks-scroll { padding: 8px 10px; }
  .task-group-title { font-size: 12px; }
  .task-episode { font-size: 11px; }
  .form-grid { grid-template-columns: 1fr; }
  .settings-dialog { width: 100%; max-height: 92vh; border-radius: 0; }
}

/* 超窄屏（<= 340px）：紧凑双列 */
@media (max-width: 340px) {
  .cards-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px; }
  .card-title { font-size: 11px; }
  .card-meta { font-size: 9.5px; }
}

/* 任务操作按钮容器 */
.task-ops { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }

/* ==========================================================================
   🎬 在线播放器 (Drama Player) 沉浸式样式
   ========================================================================== */

.player-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 9999;
  background-color: #000;
  display: flex;
  justify-content: center;
  align-items: center;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}

.player-wrapper {
  position: relative;
  width: 100%;
  height: 100%;
  max-width: 1200px;
  display: flex;
  flex-direction: column;
  background-color: #000;
}

/* 顶部信息栏 */
.player-header {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  height: 56px;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.75) 0%, rgba(0, 0, 0, 0.3) 60%, rgba(0, 0, 0, 0) 100%);
  pointer-events: auto;
  transition: opacity 0.3s cubic-bezier(0.4, 0, 0.2, 1), transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), visibility 0.3s cubic-bezier(0.4, 0, 0.2, 1);
  visibility: visible;
  opacity: 1;
}

.player-header.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(-12px) !important;
}

.player-header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
  flex-shrink: 0;
}

.player-header-btn {
  background: rgba(0, 0, 0, 0.35);
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #f1f5f9;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  font-size: 14px;
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.15s ease;
  user-select: none;
}

.player-header-btn:hover {
  background: rgba(255, 255, 255, 0.2);
  border-color: rgba(255, 255, 255, 0.35);
  transform: scale(1.08);
}

.player-header-btn:active {
  transform: scale(0.95);
  background: rgba(255, 255, 255, 0.3);
}

.player-header-btn.close-btn:hover {
  background: rgba(239, 68, 68, 0.3);
  border-color: rgba(239, 68, 68, 0.5);
  color: #fff;
}

.player-title-info {
  flex: 1;
  min-width: 0;
  margin-right: 16px;
  display: flex;
  align-items: center;
}

/* 顶部标题与画质微标 */
.player-title-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.player-quality-tag {
  font-size: 10px;
  padding: 1px 6px;
  border-radius: 4px;
  line-height: 1.3;
  font-weight: 600;
  white-space: nowrap;
}
.player-quality-tag.online {
  background: rgba(59, 130, 246, 0.25);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.4);
}
.player-quality-tag.local {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.4);
}

.player-main-title {
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-sub-title {
  color: #bbb;
  font-size: 12px;
  white-space: nowrap;
}

/* 视频播放主体舞台 */
.player-stage {
  flex: 1;
  position: relative;
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  background-color: #000;
  overflow: hidden;
}

.player-stage video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background-color: #000;
}

/* 在线流动态解析加载中蒙层 */
.player-loading-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.8);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  z-index: 15;
  color: #fff;
  font-size: 13px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}

/* 手势提示层 */
.player-gesture-overlay {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10;
}

.speed-indicator {
  position: absolute;
  top: 70px;
  background: rgba(0, 0, 0, 0.75);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #f59e0b;
  font-size: 14px;
  font-weight: bold;
  padding: 6px 14px;
  border-radius: 20px;
  box-shadow: 0 4px 12px rgba(0,0,0,0.5);
  animation: pulseIndicator 1s infinite alternate;
}

.seek-indicator {
  background: rgba(0, 0, 0, 0.8);
  color: #fff;
  font-size: 20px;
  font-weight: bold;
  padding: 12px 24px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.2);
}

@keyframes pulseIndicator {
  from { opacity: 0.8; transform: scale(0.98); }
  to { opacity: 1; transform: scale(1.02); }
}

/* 自动下一集悬浮卡片 */
.auto-next-overlay {
  position: absolute;
  bottom: 80px;
  right: 20px;
  z-index: 25;
  background: rgba(26, 28, 35, 0.95);
  border: 1px solid rgba(255, 255, 255, 0.15);
  box-shadow: 0 8px 24px rgba(0,0,0,0.6);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  border-radius: 12px;
  padding: 14px 18px;
  color: #fff;
}
.auto-next-card p {
  margin: 0 0 10px 0;
  font-size: 14px;
  font-weight: 500;
}
.auto-next-actions {
  display: flex;
  gap: 10px;
  justify-content: flex-end;
}

/* 底部控制栏 */
.player-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  z-index: 20;
  padding: 10px 16px env(safe-area-inset-bottom, 12px);
  background: linear-gradient(to top, rgba(0,0,0,0.9), rgba(0,0,0,0));
  display: flex;
  flex-direction: column;
  gap: 6px;
  transition: opacity 0.3s ease, transform 0.3s ease;
}

/* 进度条 */
.progress-bar-container {
  position: relative;
  width: 100%;
  height: 18px;
  display: flex;
  align-items: center;
  cursor: pointer;
  touch-action: none;
}

.progress-bar-container::before {
  content: '';
  position: absolute;
  left: 0;
  right: 0;
  height: 4px;
  background-color: rgba(255, 255, 255, 0.25);
  border-radius: 2px;
  transition: height 0.15s;
}

.player-controls:hover .progress-bar-container::before,
.progress-bar-container:active::before {
  height: 6px;
}

.progress-buffer {
  position: absolute;
  left: 0;
  height: 4px;
  width: 0%;
  background-color: rgba(255, 255, 255, 0.4);
  border-radius: 2px;
  pointer-events: none;
}

.progress-current {
  position: absolute;
  left: 0;
  height: 4px;
  width: 0%;
  background-color: var(--primary, #3b82f6);
  border-radius: 2px;
  pointer-events: none;
}

.player-controls:hover .progress-buffer,
.player-controls:hover .progress-current,
.progress-bar-container:active .progress-buffer,
.progress-bar-container:active .progress-current {
  height: 6px;
}

.progress-handle {
  position: absolute;
  left: 0%;
  top: 50%;
  width: 12px;
  height: 12px;
  background-color: #fff;
  border-radius: 50%;
  transform: translate(-50%, -50%);
  box-shadow: 0 0 6px rgba(0,0,0,0.5);
  pointer-events: none;
  transition: transform 0.1s ease;
}

.progress-bar-container:active .progress-handle,
.player-controls:hover .progress-handle {
  transform: translate(-50%, -50%) scale(1.3);
}

/* 底部功能按钮 */
.control-bottom-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.controls-left, .controls-right {
  display: flex;
  align-items: center;
  gap: 12px;
}

/* 音量控制组件 */
.volume-control-group {
  display: flex;
  align-items: center;
  position: relative;
}

.volume-slider-wrapper {
  width: 0;
  opacity: 0;
  overflow: hidden;
  display: flex;
  align-items: center;
  transition: width 0.25s ease, opacity 0.25s ease, margin 0.25s ease;
  margin-left: 0;
}

/* 电脑端鼠标悬停或激活时平滑展开音量条 */
.volume-control-group:hover .volume-slider-wrapper,
.volume-control-group:focus-within .volume-slider-wrapper,
.volume-control-group.active .volume-slider-wrapper {
  width: 80px;
  opacity: 1;
  margin-left: 4px;
}

.volume-slider {
  -webkit-appearance: none;
  appearance: none;
  width: 100%;
  height: 4px;
  border-radius: 2px;
  background: rgba(255, 255, 255, 0.3);
  outline: none;
  cursor: pointer;
  accent-color: var(--primary, #3b82f6);
}

.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
  transition: transform 0.15s ease;
}

.volume-slider::-webkit-slider-thumb:hover {
  transform: scale(1.2);
}

.volume-slider::-moz-range-thumb {
  width: 12px;
  height: 12px;
  border: none;
  border-radius: 50%;
  background: #ffffff;
  cursor: pointer;
  box-shadow: 0 0 4px rgba(0, 0, 0, 0.5);
}

.ctrl-btn {
  background: transparent;
  border: none;
  color: #fff;
  font-size: 18px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 6px;
  border-radius: 6px;
  transition: color 0.15s, background-color 0.15s;
}
.ctrl-btn:hover {
  background-color: rgba(255,255,255,0.15);
}
.ctrl-btn:active {
  background-color: rgba(255,255,255,0.25);
}

.main-play-btn {
  font-size: 22px;
  width: 36px;
  height: 36px;
}

.text-btn {
  font-size: 13px;
  font-weight: bold;
  padding: 4px 8px;
  border: 1px solid rgba(255, 255, 255, 0.3);
  border-radius: 14px;
}

.time-display {
  color: #ccc;
  font-size: 12px;
  font-variant-numeric: tabular-nums;
  margin-left: 4px;
}

/* 选集抽屉 */
.playlist-drawer {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  background: rgba(18, 20, 26, 0.95);
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 16px 16px 0 0;
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 16px;
  max-height: 60%;
  display: flex;
  flex-direction: column;
  z-index: 30;
  box-shadow: 0 -8px 30px rgba(0,0,0,0.7);
  animation: slideUpDrawer 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}

@keyframes slideUpDrawer {
  from { transform: translateY(100%); }
  to { transform: translateY(0); }
}

.playlist-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 14px;
}

.playlist-header h3 {
  margin: 0;
  color: #fff;
  font-size: 15px;
  font-weight: 600;
}

.drawer-close-btn {
  background: transparent;
  border: none;
  color: #999;
  font-size: 18px;
  cursor: pointer;
  padding: 4px;
}
.drawer-close-btn:hover {
  color: #fff;
}

.playlist-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 8px;
  overflow-y: auto;
  padding-bottom: 16px;
  max-height: 300px;
}

.playlist-ep-btn {
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
  color: #e5e7eb;
  padding: 8px 4px;
  border-radius: 8px;
  font-size: 12px;
  cursor: pointer;
  text-align: center;
  transition: all 0.15s ease;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
}

.playlist-ep-btn .ep-num {
  font-weight: 500;
}
.playlist-ep-btn .ep-tag {
  font-size: 9px;
  padding: 0 4px;
  border-radius: 3px;
}
.playlist-ep-btn .ep-tag.local {
  background: rgba(16, 185, 129, 0.25);
  color: #34d399;
}
.playlist-ep-btn .ep-tag.online {
  background: rgba(59, 130, 246, 0.25);
  color: #93c5fd;
}

.playlist-ep-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.25);
}

.playlist-ep-btn.active {
  background: var(--primary, #3b82f6);
  border-color: var(--primary, #3b82f6);
  color: #fff;
  font-weight: bold;
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.4);
}

/* ---------- 详情弹窗：全剧分集网格大厅 ---------- */
.detail-ep-section {
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid var(--line);
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.detail-ep-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.detail-ep-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
}
.detail-ep-total {
  font-size: 11px;
  color: var(--muted);
}
.detail-ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
  gap: 6px;
  max-height: 190px;
  overflow-y: auto;
  padding: 2px;
}
.detail-ep-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  background: var(--panel-2);
  border: 1px solid var(--line);
  border-radius: 6px;
  padding: 6px 2px;
  cursor: pointer;
  transition: all 0.12s;
}
.detail-ep-item:hover {
  border-color: var(--brand);
  background: rgba(37, 99, 235, 0.12);
}
.detail-ep-num {
  font-size: 11px;
  font-weight: 500;
  color: var(--text);
}
.detail-ep-badge {
  font-size: 9px;
  padding: 0 4px;
  border-radius: 2px;
}
.detail-ep-badge.local {
  background: var(--success-soft);
  color: var(--success);
}
.detail-ep-badge.online {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
}
.detail-ep-loading, .detail-ep-empty {
  grid-column: 1 / -1;
  text-align: center;
  padding: 18px 0;
  color: var(--muted);
  font-size: 12px;
}

/* 界面中新增的播放入口样式 */
.btn-play-action {
  background: linear-gradient(135deg, #10b981, #059669);
  color: #fff;
  border: none;
  border-radius: 6px;
  padding: 4px 10px;
  font-size: 12px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(16, 185, 129, 0.3);
}

.btn-play-action:hover {
  filter: brightness(1.1);
  transform: translateY(-1px);
}
.btn-play-action:active {
  transform: translateY(0);
}

/* 剧库卡片上的可播放徽标 */
.badge-playable {
  background: linear-gradient(135deg, #10b981, #059669);
  color: white;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  display: inline-flex;
  align-items: center;
  gap: 2px;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
  backdrop-filter: blur(4px);
}

/* 控制条显隐过渡 */
.player-header, .player-controls {
  transition: opacity 0.35s ease, transform 0.35s ease, visibility 0.35s ease;
  visibility: visible;
  opacity: 1;
}

.player-header.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(-10px);
}

.player-controls.is-hidden {
  opacity: 0 !important;
  visibility: hidden !important;
  pointer-events: none !important;
  transform: translateY(10px);
}

/* 合集卡片与全片展示 */
.merge-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 8px;
  border-radius: 9999px;
  font-size: 11px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
}
.merge-tag-success {
  background: rgba(16, 185, 129, 0.15);
  color: #10b981;
  border: 1px solid rgba(16, 185, 129, 0.3);
}
.merge-tag-running {
  background: rgba(59, 130, 246, 0.15);
  color: #3b82f6;
  border: 1px solid rgba(59, 130, 246, 0.3);
  animation: pulse 1.5s infinite;
}
.merge-tag-failed {
  background: rgba(239, 68, 68, 0.15);
  color: #ef4444;
  border: 1px solid rgba(239, 68, 68, 0.3);
}

.merged-file-card {
  margin: 10px 12px 14px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.95) 0%, rgba(15, 23, 42, 0.95) 100%);
  border: 1px solid rgba(16, 185, 129, 0.35);
  border-radius: 10px;
  padding: 12px 14px;
  display: flex;
  flex-direction: column;
  gap: 10px;
  box-shadow: 0 4px 12px rgba(0, 0, 0, 0.25);
}

@media (min-width: 640px) {
  .merged-file-card {
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
  }
}

.merged-file-info {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.merged-file-icon {
  font-size: 26px;
  flex-shrink: 0;
  width: 44px;
  height: 44px;
  border-radius: 8px;
  background: rgba(16, 185, 129, 0.12);
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid rgba(16, 185, 129, 0.2);
}

.merged-file-details {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
}

.merged-file-name {
  font-size: 14px;
  font-weight: 600;
  color: #f1f5f9;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  display: flex;
  align-items: center;
  gap: 8px;
}

.merged-file-pill {
  font-size: 10px;
  font-weight: 600;
  background: #10b981;
  color: #0f172a;
  padding: 1px 6px;
  border-radius: 4px;
}

.merged-file-meta {
  font-size: 12px;
  color: #94a3b8;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.merged-file-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.merged-progress-bar {
  width: 100%;
  height: 6px;
  background: rgba(255, 255, 255, 0.1);
  border-radius: 3px;
  overflow: hidden;
  margin-top: 4px;
}

.merged-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #3b82f6, #60a5fa);
  transition: width 0.3s ease;
}

.ep-cleaned-badge {
  font-size: 11px;
  color: #64748b;
  background: rgba(100, 116, 139, 0.15);
  padding: 1px 6px;
  border-radius: 4px;
  margin-left: 6px;
}

.wasm-player-box {
  display: flex;
  align-items: center;
  justify-content: center;
  background: #000;
  pointer-events: none;
}

.wasm-player-box canvas {
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
}


/* ---------- Artplayer 现代播放器视觉定制 ---------- */
#artplayerContainer {
  width: 100% !important;
  height: 100% !important;
  background: #000;
}

.art-video-player .art-custom-ctrl-btn {
  background: none;
  border: none;
  color: #fff;
  font-size: 17px;
  cursor: pointer;
  padding: 0 6px;
  opacity: 0.85;
  transition: opacity 0.2s, transform 0.15s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.art-video-player .art-custom-ctrl-btn:hover {
  opacity: 1;
  transform: scale(1.15);
}

.art-video-player .art-custom-tag-btn {
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #f1f5f9;
  font-size: 12px;
  font-weight: 500;
  padding: 3px 10px;
  border-radius: 4px;
  cursor: pointer;
  margin: 0 4px;
  transition: background 0.2s, color 0.2s;
  display: flex;
  align-items: center;
  gap: 4px;
}
.art-video-player .art-custom-tag-btn:hover {
  background: rgba(255, 0, 122, 0.7);
  border-color: #ff007a;
  color: #fff;
}

.player-overlay .playlist-drawer {
  z-index: 1000 !important;
}
.player-overlay .auto-next-overlay {
  z-index: 1001 !important;
}

/* ==========================================================================
   🌟 站源导航、榜单双轨与多维智能筛选全新升级设计
   ========================================================================== */
.source-nav-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  scrollbar-width: none;
  padding: 4px 2px 8px 2px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.06);
  margin-bottom: 8px;
}
.source-nav-bar::-webkit-scrollbar { display: none; }

.source-nav-item {
  flex: 1;
  min-width: 140px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.04);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #94a3b8;
  cursor: pointer;
  transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
  user-select: none;
  position: relative;
  white-space: nowrap;
}
.source-nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: #f1f5f9;
  border-color: rgba(255, 255, 255, 0.16);
  transform: translateY(-1px);
}
.source-nav-item .source-icon {
  font-size: 16px;
  line-height: 1;
}
.source-nav-item .source-title {
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.3px;
}
.source-nav-item .source-badge {
  font-size: 11px;
  font-weight: 500;
  padding: 1px 6px;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.08);
  color: #cbd5e1;
  line-height: 1.2;
}

/* 站源激活专属品牌色 */
.source-nav-item.active {
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.4);
}
.source-nav-item[data-source="hongguo"].active {
  background: linear-gradient(135deg, #ef4444 0%, #b91c1c 100%);
  box-shadow: 0 4px 16px rgba(239, 68, 68, 0.35);
}
.source-nav-item[data-source="huangguo"].active {
  background: linear-gradient(135deg, #f59e0b 0%, #d97706 100%);
  box-shadow: 0 4px 16px rgba(245, 158, 11, 0.35);
}
.source-nav-item[data-source="huangdou"].active {
  background: linear-gradient(135deg, #d97706 0%, #78350f 100%);
  box-shadow: 0 4px 16px rgba(180, 83, 9, 0.35);
}
.source-nav-item[data-source=""].active {
  background: linear-gradient(135deg, #3b82f6 0%, #1d4ed8 100%);
  box-shadow: 0 4px 16px rgba(59, 130, 246, 0.35);
}
.source-nav-item.active .source-badge {
  background: rgba(255, 255, 255, 0.22);
  color: #fff;
  font-weight: 600;
}

/* 筛选轨道分组容器 */
.filter-section-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 6px;
  min-width: 0;
}
.filter-row-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
}
.filter-row-tag {
  font-size: 11px;
  font-weight: 600;
  padding: 3px 8px;
  border-radius: 4px;
  white-space: nowrap;
  letter-spacing: 0.5px;
}
.filter-row-tag.rank-tag {
  background: rgba(245, 158, 11, 0.15);
  color: #fbbf24;
  border: 1px solid rgba(245, 158, 11, 0.3);
}
.filter-row-tag.cat-tag {
  background: rgba(59, 130, 246, 0.15);
  color: #60a5fa;
  border: 1px solid rgba(59, 130, 246, 0.3);
}
.filter-row-tag.form-tag {
  background: rgba(168, 85, 247, 0.15);
  color: #c084fc;
  border: 1px solid rgba(168, 85, 247, 0.3);
}
.filter-row-tag.ep-tag {
  background: rgba(16, 185, 129, 0.15);
  color: #34d399;
  border: 1px solid rgba(16, 185, 129, 0.3);
}

.filter-section-row .channel-pills-scroll {
  flex: 1;
  min-width: 0;
  margin-top: 0;
  padding: 2px 0;
}

/* 沉浸式活动高光引导条 */
.active-filter-banner {
  margin-top: 8px;
  padding: 6px 14px;
  border-radius: 6px;
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.12) 0%, rgba(30, 41, 59, 0.6) 100%);
  border: 1px solid rgba(245, 158, 11, 0.25);
  display: flex;
  align-items: center;
  justify-content: space-between;
  animation: fadeInDown 0.25s ease;
}
@keyframes fadeInDown {
  from { opacity: 0; transform: translateY(-4px); }
  to { opacity: 1; transform: translateY(0); }
}
.banner-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}
.banner-badge {
  font-size: 12px;
  font-weight: 700;
  color: #fef08a;
  background: rgba(245, 158, 11, 0.25);
  padding: 2px 8px;
  border-radius: 4px;
  white-space: nowrap;
}
.banner-desc {
  font-size: 12px;
  color: #cbd5e1;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.banner-reset-btn {
  background: none;
  border: 1px solid rgba(255, 255, 255, 0.15);
  color: #94a3b8;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 4px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.15s;
}
.banner-reset-btn:hover {
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  border-color: rgba(255, 255, 255, 0.3);
}

/* 选中的榜单胶囊强化 */
.rank-pill.active {
  background: linear-gradient(135deg, #f59e0b, #d97706) !important;
  color: #fff !important;
  font-weight: 600 !important;
  box-shadow: 0 2px 10px rgba(217, 119, 6, 0.4) !important;
  border-color: transparent !important;
}

/* 移动端与紧凑屏幕响应式适配 */
@media (max-width: 768px) {
  .source-nav-bar {
    gap: 8px;
    padding: 2px 0 6px 0;
  }
  .source-nav-item {
    min-width: 110px;
    padding: 6px 10px;
    gap: 6px;
  }
  .source-nav-item .source-title {
    font-size: 12px;
  }
  .source-nav-item .source-badge {
    font-size: 10px;
    padding: 1px 4px;
  }
  .filter-section-row {
    gap: 6px;
  }
  .filter-row-tag {
    font-size: 10px;
    padding: 2px 6px;
  }
}

/* ==========================================================================
   新功能样式：弹幕系统、下一集预缓存、继续观看快捷条、联网搜索与排序增强
   ========================================================================== */

/* 1. 弹幕系统 (保证高层级、不被视频遮挡、适应全屏与各种分辨率) */
.danmaku-layer {
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  overflow: hidden;
  z-index: 35; /* 确保高于 video (z-index 10) 与 mask (z-index 20)，低于 controls (z-index 40) */
}

.danmaku-item {
  position: absolute;
  left: 100%;
  white-space: nowrap;
  font-size: 17px;
  font-weight: 700;
  color: #ffffff;
  /* 多重全向纯黑描边与外发光，确保在任何高光画面、浅色画面或复杂背景下均极致清晰，绝不被遮挡模糊 */
  text-shadow:
    1px 1px 2px rgba(0, 0, 0, 0.95),
    -1px -1px 2px rgba(0, 0, 0, 0.95),
    1px -1px 2px rgba(0, 0, 0, 0.95),
    -1px 1px 2px rgba(0, 0, 0, 0.95),
    0 0 6px rgba(0, 0, 0, 0.9),
    0 0 10px rgba(0, 0, 0, 0.7);
  will-change: transform;
  user-select: none;
  pointer-events: none;
  padding: 3px 10px;
  border-radius: 14px;
  background: rgba(0, 0, 0, 0.32);
  backdrop-filter: blur(2px);
  letter-spacing: 0.6px;
  z-index: 36;
}

@keyframes danmaku-slide {
  0% {
    transform: translateX(0);
  }
  100% {
    transform: translateX(calc(-100% - var(--danmaku-container-width, 1200px)));
  }
}

.player-header-btn.active {
  background: var(--primary, #e53935) !important;
  color: #fff !important;
  border-color: transparent !important;
}

/* 2. 预缓存控制组件 */
.prefetch-ctrl-box {
  display: flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.08);
  padding: 3px 8px;
  border-radius: 16px;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 12px;
}

.prefetch-label {
  display: flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: rgba(255, 255, 255, 0.88);
  font-weight: 500;
  user-select: none;
}

.prefetch-label input[type="checkbox"] {
  accent-color: var(--primary, #e53935);
  cursor: pointer;
}

.prefetch-status-badge {
  display: inline-block;
  font-size: 10px;
  padding: 1px 5px;
  border-radius: 8px;
  background: #2e7d32;
  color: #fff;
  font-weight: 600;
  transition: all 0.2s ease;
}

.prefetch-status-badge.loading {
  background: #f57c00;
}

/* 3. 联网搜索按钮 */
.search-box {
  position: relative;
  display: flex;
  align-items: center;
}

.online-search-btn {
  margin-left: 6px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, #1e88e5, #1565c0);
  border: none;
  border-radius: 6px;
  cursor: pointer;
  white-space: nowrap;
  transition: all 0.2s ease;
  box-shadow: 0 2px 6px rgba(21, 101, 192, 0.3);
}

.online-search-btn:hover {
  background: linear-gradient(135deg, #2196f3, #1976d2);
  transform: translateY(-1px);
  box-shadow: 0 4px 10px rgba(21, 101, 192, 0.4);
}

.online-search-btn:active {
  transform: translateY(0);
}

/* 4. 继续观看快捷提醒横幅 */
.continue-watch-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin: 12px 16px;
  padding: 10px 16px;
  background: linear-gradient(90deg, rgba(229, 57, 53, 0.15), rgba(30, 136, 229, 0.12));
  border: 1px solid rgba(229, 57, 53, 0.28);
  border-radius: 10px;
  backdrop-filter: blur(10px);
  animation: fadeIn 0.3s ease;
}

.continue-left {
  display: flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.continue-icon {
  font-size: 20px;
  flex-shrink: 0;
}

.continue-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.continue-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text, #fff);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.continue-desc {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.7);
}

.continue-right {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.continue-play-btn {
  padding: 6px 14px;
  font-size: 12px;
  font-weight: 600;
  color: #fff;
  background: var(--primary, #e53935);
  border: none;
  border-radius: 20px;
  cursor: pointer;
  transition: all 0.2s ease;
}

.continue-play-btn:hover {
  transform: scale(1.05);
  filter: brightness(1.1);
}

.continue-close-btn {
  background: transparent;
  border: none;
  color: rgba(255, 255, 255, 0.5);
  font-size: 16px;
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  line-height: 1;
}

.continue-close-btn:hover {
  color: #fff;
}

/* 5. 卡片上的继续观看进度条角标 */
.card-watch-progress {
  position: absolute;
  bottom: 0;
  left: 0;
  width: 100%;
  height: 4px;
  background: rgba(0, 0, 0, 0.5);
  z-index: 3;
}

.card-watch-bar {
  height: 100%;
  background: linear-gradient(90deg, #ff9800, #4caf50);
}

.card-watch-badge {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0, 0, 0, 0.75);
  backdrop-filter: blur(4px);
  color: #4caf50;
  font-size: 10px;
  font-weight: 600;
  padding: 2px 6px;
  border-radius: 4px;
  border: 1px solid rgba(76, 175, 80, 0.4);
  z-index: 3;
}

/* 6. 移动端局域网自适应加强 */
@media (max-width: 768px) {
  .player-wrapper {
    width: 100% !important;
    height: 100% !important;
    max-width: 100% !important;
    max-height: 100% !important;
    border-radius: 0 !important;
  }
  .search-box {
    width: 100%;
    flex-wrap: wrap;
    gap: 6px;
  }
  .online-search-btn {
    width: 100%;
    text-align: center;
    margin-left: 0;
    margin-top: 4px;
    padding: 8px;
  }
  .danmaku-item {
    font-size: 13px;
  }
}

/* ==========================================================================
   红果 APP 原生源专属三大分类高光样式 (真人剧 / 漫剧 / AI剧)
   ========================================================================== */
.channel-pill.pill-hongguo-major {
  font-weight: 700;
  border-width: 1.5px;
  box-shadow: 0 2px 6px rgba(0, 0, 0, 0.2);
  letter-spacing: 0.3px;
}

.channel-pill.pill-major-real {
  border-color: rgba(229, 57, 53, 0.45);
  background: rgba(229, 57, 53, 0.12);
  color: #ff5252;
}

.channel-pill.pill-major-real:hover,
.channel-pill.pill-major-real.active {
  background: linear-gradient(135deg, #e53935, #d32f2f) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 3px 10px rgba(229, 57, 53, 0.45);
}

.channel-pill.pill-major-comic {
  border-color: rgba(156, 39, 176, 0.45);
  background: rgba(156, 39, 176, 0.12);
  color: #ba68c8;
}

.channel-pill.pill-major-comic:hover,
.channel-pill.pill-major-comic.active {
  background: linear-gradient(135deg, #9c27b0, #7b1fa2) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 3px 10px rgba(156, 39, 176, 0.45);
}

.channel-pill.pill-major-ai {
  border-color: rgba(0, 188, 212, 0.45);
  background: rgba(0, 188, 212, 0.12);
  color: #26c6da;
}

.channel-pill.pill-major-ai:hover,
.channel-pill.pill-major-ai.active {
  background: linear-gradient(135deg, #00acc1, #00838f) !important;
  color: #fff !important;
  border-color: transparent !important;
  box-shadow: 0 3px 10px rgba(0, 188, 212, 0.45);
}

/* 红果三大专属分类卡片徽标 */
.card-genre-badge {
  position: absolute;
  top: 8px;
  right: 8px;
  font-size: 10px;
  font-weight: 700;
  padding: 2px 6px;
  border-radius: 4px;
  color: #fff;
  z-index: 2;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.4);
}

.card-genre-real {
  background: linear-gradient(135deg, #e53935, #c62828);
}

.card-genre-comic {
  background: linear-gradient(135deg, #ab47bc, #7b1fa2);
}

.card-genre-ai {
  background: linear-gradient(135deg, #00acc1, #00838f);
}
