/* =============================================
   搜剧AI - 主样式文件
   Dark Theme (暗色主题)
   ============================================= */

/* === CSS Variables - Midnight Theme === */
:root {
  --bg-primary: #0b1113;
  --bg-secondary: #11191d;
  --bg-card: rgba(255,255,255,0.06);
  --bg-card-hover: rgba(255,255,255,0.1);
  --bg-nav: rgba(17, 25, 29, 0.74);
  --bg-input: rgba(255,255,255,0.06);
  --bg-input-focus: rgba(255,255,255,0.1);
  --bg-modal: rgba(0, 0, 0, 0.55);
  --bg-tag: rgba(142, 231, 242, 0.12);
  --bg-surface: rgba(255,255,255,0.06);
  --bg-surface-strong: rgba(255,255,255,0.09);
  --text-primary: rgba(255,255,255,0.9);
  --text-secondary: rgba(255,255,255,0.54);
  --text-muted: rgba(255,255,255,0.38);
  --text-title: rgba(255,255,255,0.95);
  --accent: #8ee7f2;
  --accent-hover: #67e8f9;
  --accent-dark: #00869a;
  --accent-gold: #f3c969;
  --border-color: rgba(255,255,255,0.12);
  --border-light: rgba(255,255,255,0.08);
  --border-soft: rgba(255,255,255,0.08);
  --danger: #fecaca;
  --danger-bg: rgba(239,68,68,0.12);
  --success: #a7f3d0;
  --success-bg: rgba(52,211,153,0.12);
  --warning: #fde68a;
  --warning-bg: rgba(251,191,36,0.12);
  --info: #a5f3fc;
  --info-bg: rgba(103,232,249,0.1);
  --sidebar-width: 290px;
  --sidebar-collapsed: 80px;
  --font-family: 'Inter', ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  --radius: 8px;
  --radius-lg: 12px;
  --radius-xl: 16px;
  --shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.3);
  --transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
}

/* === Light Theme === */
body.light-theme {
  --bg-primary: #f8fafc;
  --bg-secondary: #ffffff;
  --bg-card: #f1f5f9;
  --bg-card-hover: #e2e8f0;
  --bg-nav: rgba(255, 255, 255, 0.85);
  --bg-input: #f1f5f9;
  --bg-input-focus: #e2e8f0;
  --bg-modal: rgba(0, 0, 0, 0.4);
  --bg-tag: rgba(0, 134, 154, 0.1);
  --bg-surface: #f1f5f9;
  --bg-surface-strong: #e2e8f0;
  --text-primary: #0f172a;
  --text-secondary: #475569;
  --text-muted: #94a3b8;
  --text-title: #0f172a;
  --accent: #00869a;
  --accent-hover: #006b7a;
  --border-color: #e2e8f0;
  --border-light: #f1f5f9;
  --border-soft: #f1f5f9;
}

/* === Reset === */
*, *::before, *::after {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

html {
  font-size: 16px;
  scroll-behavior: smooth;
  background: var(--bg-primary);
}

body {
  font-family: var(--font-family);
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
  overflow-x: hidden;
  width: 100%;
}

a {
  color: var(--accent);
  text-decoration: none;
  transition: var(--transition);
}

a:hover {
  color: var(--accent-hover);
}

img {
  max-width: 100%;
  height: auto;
}

button {
  cursor: pointer;
  border: none;
  outline: none;
  font-family: var(--font-family);
  transition: var(--transition);
}

input, textarea {
  font-family: var(--font-family);
  outline: none;
  border: none;
}

ul, ol {
  list-style: none;
}

/* === Scrollbar === */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}

::-webkit-scrollbar-track {
  background: transparent;
}

::-webkit-scrollbar-thumb {
  background: var(--border-light);
  border-radius: 3px;
}

::-webkit-scrollbar-thumb:hover {
  background: var(--text-muted);
}

/* === Layout === */
.app-container {
  display: flex;
  min-height: 100vh;
}

/* === Sidebar === */
.sidebar {
  position: fixed;
  left: 0;
  top: 0;
  bottom: 0;
  width: var(--sidebar-width);
  background: var(--bg-secondary);
  border-right: 1px solid var(--border-light);
  z-index: 120;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
  overflow-x: hidden;
  transition: var(--transition);
}

.sidebar.collapsed {
  width: var(--sidebar-collapsed);
}

/* Sidebar Top - 用户区（水平布局） */
.sidebar-top {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 14px 12px;
  border-bottom: 1px solid var(--border-light);
}

.user-profile {
  display: flex;
  align-items: center;
  gap: 10px;
  flex: 1;
  min-width: 0;
}

.user-avatar {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: transparent;
  border: 2px solid var(--accent);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-primary);
  flex-shrink: 0;
  overflow: hidden;
}

.user-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.user-info {
  flex: 1;
  min-width: 0;
}

.user-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text-title);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
}

.user-device {
  font-size: 12px;
  color: var(--text-muted);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.sidebar-top-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.icon-btn {
  width: 34px;
  height: 34px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.icon-btn svg {
  width: 16px;
  height: 16px;
}

/* Level Card */
.level-card {
  margin: 12px 14px 10px;
  padding: 12px 14px;
  background: var(--bg-card);
  border: 1px solid rgba(142,231,242,0.18);
  border-radius: var(--radius);
}

.level-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}

.level-card-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-primary);
}

.level-card-meta {
  display: flex;
  align-items: center;
  gap: 6px;
}

.level-card-percent {
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
}

.level-card-help {
  width: 16px;
  height: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-muted);
  font-size: 11px;
  cursor: help;
}

.level-bar-bg {
  height: 4px;
  background: rgba(255,255,255,0.1);
  border-radius: 2px;
  overflow: hidden;
}

.level-bar-fill {
  height: 100%;
  background: linear-gradient(90deg, var(--accent), var(--accent-hover));
  border-radius: 2px;
  transition: width 0.5s ease;
}

.level-card-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--text-muted);
}

/* Guest Warning */
.guest-warning {
  background: var(--warning-bg);
  border: 1px solid rgba(251,191,36,0.3);
  border-radius: var(--radius);
  padding: 10px 12px;
  font-size: 12px;
  color: var(--warning);
  line-height: 1.5;
  margin-bottom: 12px;
  display: flex;
  align-items: flex-start;
  gap: 6px;
}

.guest-warning svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  margin-top: 1px;
}

/* Quick Action Buttons (4 列) */
.quick-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  padding: 0 16px 10px;
}

.quick-btn {
  position: relative;
  height: 56px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 0 4px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
  text-decoration: none;
  overflow: hidden;
  transition: var(--transition);
}

.quick-btn > span:not(.dot-badge) {
  max-width: 100%;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.quick-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--accent);
}

.quick-btn svg {
  width: 24px;
  height: 24px;
}

.dot-badge {
  position: absolute;
  top: 6px;
  right: 12px;
  width: 6px;
  height: 6px;
  background: var(--accent);
  border-radius: 50%;
}

/* 56px 快捷卡片内的未读红点 */
.quick-btn .dot-badge {
  top: 10px;
  right: 10px;
}

/* Login Button - 底部居中青色按钮 */
.login-btn {
  margin: 12px 14px 16px;
  padding: 10px 16px;
  background: var(--accent);
  color: #0b1113;
  border-radius: 6px;
  font-size: 14px;
  font-weight: 600;
  text-align: center;
  cursor: pointer;
  transition: var(--transition);
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.login-btn:hover {
  background: var(--accent-hover);
}

.login-btn svg {
  width: 16px;
  height: 16px;
}

/* Sidebar Stats - 历史/收藏 统计卡 */
.sidebar-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
  padding: 0 16px 10px;
}

.stat-item {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 2px;
  padding: 8px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text-secondary);
  text-decoration: none;
  transition: var(--transition);
}

.stat-item:hover,
.stat-item.active {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--accent);
}

.stat-item svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.stat-head {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.stat-label {
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.stat-count {
  font-size: 18px;
  font-weight: 600;
  line-height: 1.4;
  color: var(--text-primary);
}

/* Sidebar Sections */
.sidebar-section {
  padding: 10px 16px 14px;
  border-bottom: 1px solid var(--border-light);
}

.sidebar-section:last-of-type {
  border-bottom: none;
}

.sidebar-section-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 8px;
}

.section-title-main {
  display: flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
  font-size: 13px;
  font-weight: 600;
  letter-spacing: 0.03em;
  color: var(--text-primary);
}

.section-title-main > span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-title-main svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  color: var(--accent);
}

.section-count {
  flex-shrink: 0;
  background: var(--bg-input);
  border-radius: 999px;
  padding: 0 6px;
  font-size: 11px;
  line-height: 16px;
  font-weight: 600;
  color: var(--text-muted);
}

.section-more-link {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--accent);
  text-decoration: none;
}

.section-more-link:hover {
  color: var(--accent-hover);
}

/* Sidebar 列表条目 */
.sidebar-list {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.side-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  text-decoration: none;
  transition: var(--transition);
}

.side-item:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.side-item-row {
  justify-content: space-between;
}

.side-item-poster {
  width: 36px;
  height: 48px;
  flex-shrink: 0;
  object-fit: cover;
  border-radius: 4px;
  background: var(--bg-input);
}

.side-item-info {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
  flex: 1;
}

.side-item-title {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-item-sub {
  font-size: 12px;
  color: var(--text-muted);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-item-action {
  flex-shrink: 0;
  font-size: 12px;
  color: var(--text-muted);
}

.side-item:hover .side-item-action {
  color: var(--accent);
}

.sidebar-empty-text {
  padding: 10px 12px;
  background: var(--bg-card);
  border: 1px dashed var(--border-light);
  border-radius: 6px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}
/* === Collapsed-only Icons（仅收起态可见） === */
.collapsed-icons {
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 5px;
  padding: 12px 0 0;
  flex: 1;
}

.collapsed-icon-btn {
  position: relative;
  width: 56px;
  height: 56px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 14px;
  color: var(--text-secondary);
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
}

.collapsed-icon-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--text-muted);
  transform: translateY(-1px);
}

.collapsed-icon-btn svg {
  width: 22px;
  height: 22px;
}

.collapsed-icon-btn .dot-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 7px;
  height: 7px;
  background: var(--accent);
  border-radius: 50%;
}

/* 收起态：分隔线 / 品牌标记 / 公告文字按钮 */
.collapsed-divider {
  width: 32px;
  height: 1px;
  margin: 4px 0;
  flex-shrink: 0;
  background: var(--border-light);
}

.collapsed-brand-mark {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 7px;
  background: var(--accent);
  color: #0b1113;
  font-size: 13px;
  font-weight: 900;
  line-height: 1;
}

.collapsed-announce-text {
  position: relative;
  font-size: 11px;
  font-weight: 800;
  line-height: 1;
  color: var(--text-primary);
}

.collapsed-announce-text .dot-badge {
  top: -3px;
  right: -7px;
}

.collapsed-icon-btn.collapsed-login {
  margin-top: 4px;
  margin-bottom: 8px;
}

.collapsed-icon-btn.collapsed-login:hover {
  border-color: var(--accent);
  color: var(--accent);
}

/* === Main Content === */
.main-content {
  margin-left: var(--sidebar-width);
  flex: 1;
  width: 100%;
  max-width: calc(100vw - var(--sidebar-width));
  min-width: 0;
  min-height: 100vh;
  transition: var(--transition);
}

.sidebar.collapsed ~ .main-content {
  margin-left: var(--sidebar-collapsed);
  max-width: calc(100vw - var(--sidebar-collapsed));
}

/* === Content Topbar（页面顶部右侧 tab） === */
.content-topbar {
  display: flex;
  justify-content: flex-end;
  align-items: center;
  padding: 18px 32px 0;
  position: relative;
  z-index: 30;
}

.topbar-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 4px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
}

/* Mobile-only logo (默认隐藏,仅 ≤480px 显示) */
.topbar-mobile-logo {
  display: none;
}

.topbar-tab {
  position: relative;
  padding: 6px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 999px;
  text-decoration: none;
  border: 1px solid transparent;
  transition: var(--transition);
  white-space: nowrap;
  line-height: 1.2;
}

.topbar-tab:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.topbar-tab.is-active {
  color: var(--accent);
  background: rgba(142, 231, 242, 0.12);
  border-color: var(--accent);
  font-weight: 600;
}

.topbar-tab.is-active:hover {
  background: rgba(142, 231, 242, 0.18);
}

/* === Page Header === */
.page-header {
  padding: 20px 32px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.page-header-left {
  display: flex;
  align-items: center;
  gap: 16px;
}

.page-header .back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-primary);
  cursor: pointer;
  transition: var(--transition);
}

.page-header .back-btn:hover {
  background: var(--bg-card-hover);
}

.page-header .back-btn svg {
  width: 18px;
  height: 18px;
}

.page-header-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-title);
}

.page-header-actions {
  display: flex;
  gap: 8px;
}

/* === Homepage === */
.home-page {
  padding: 40px 32px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

/* Search Area */
.search-area {
  text-align: center;
  margin-bottom: 40px;
}

.search-title {
  font-size: 30px;
  font-weight: 900;
  color: var(--text-title);
  margin-bottom: 8px;
  letter-spacing: 2px;
}

.search-domain {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.search-domain a {
  color: var(--accent);
}

/* Search Box */
.search-box {
  max-width: 680px;
  margin: 0 auto;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  overflow: hidden;
  transition: var(--transition);
}

/* 搜索页内嵌搜索框（顶栏后） */
.search-box-page {
  margin-bottom: 24px;
}

.search-box:focus-within {
  border-color: var(--accent);
  background: var(--bg-input-focus);
  box-shadow: 0 0 0 3px rgba(78, 205, 196, 0.15);
}

.search-box-top {
  display: flex;
  align-items: center;
  padding: 8px 12px;
  gap: 8px;
}

.search-mode-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--bg-tag);
  border-radius: 20px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  white-space: nowrap;
}

.search-mode-btn svg {
  width: 14px;
  height: 14px;
}

.search-plus-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 30px;
  height: 30px;
  flex-shrink: 0;
  background: var(--bg-tag);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.search-plus-btn:hover {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.search-plus-btn svg {
  width: 14px;
  height: 14px;
}

.search-capability-btn {
  padding: 4px 8px;
  background: transparent;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  border-radius: 4px;
}

.search-capability-btn:hover {
  color: var(--text-primary);
}

.search-input-wrapper {
  display: flex;
  align-items: flex-end;
  padding: 8px 12px 12px;
  gap: 8px;
}

.search-input {
  flex: 1;
  background: transparent;
  color: var(--text-primary);
  font-size: 15px;
  resize: none;
  min-height: 24px;
  max-height: 120px;
  line-height: 1.5;
  border: none;
  outline: none;
}

.search-input::placeholder {
  color: var(--text-muted);
}

.search-input-actions {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-shrink: 0;
}

.voice-btn,
.send-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.voice-btn {
  background: transparent;
  color: var(--text-muted);
}

.voice-btn:hover {
  color: var(--text-primary);
  background: var(--bg-card);
}

.send-btn {
  background: var(--accent);
  color: #0b1113;
}

.send-btn:hover {
  background: var(--accent-hover);
  color: #0b1113;
}

.voice-btn svg,
.send-btn svg {
  width: 18px;
  height: 18px;
}

/* Hot Searches */
.hot-searches {
  margin-top: 20px;
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
}

.hot-search-label {
  font-size: 12px;
  color: var(--text-muted);
  display: flex;
  align-items: center;
  margin-right: 4px;
}

.hot-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.hot-tag:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
  border-color: var(--border-light);
}

.hot-tag svg {
  width: 12px;
  height: 12px;
}

/* Recommend Input */
.recommend-input {
  margin-top: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.recommend-label {
  font-size: 12px;
  color: var(--text-muted);
}

.recommend-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 12px;
  background: var(--bg-tag);
  border-radius: 20px;
  color: var(--accent);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.recommend-tag:hover {
  background: rgba(78, 205, 196, 0.25);
}

/* Section Header */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
  margin-top: 40px;
}

.section-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-title);
}

.section-subtitle {
  font-size: 13px;
  color: var(--text-muted);
  margin-top: 4px;
}

.section-more {
  font-size: 13px;
  color: var(--text-secondary);
  padding: 6px 14px;
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  background: transparent;
}

.section-more:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

/* 通用海报结果网格（搜索结果 / 收藏 / 历史等影片卡片区） */
.results-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px 16px;
}
.results-grid .movie-card {
  width: 100%;
  flex-shrink: 1;
  min-width: 0;
}
.results-grid .movie-card-poster {
  width: 100%;
  height: auto;
  aspect-ratio: 2 / 3;
}
.results-grid .movie-card-poster img {
  height: 100%;
}

/* Continue Watching Cards — 紧凑小卡片（多列网格） */
.continue-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 12px;
}

.continue-card {
  position: relative;
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: var(--transition);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
}

.continue-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--border-light);
}

.continue-card-img {
  width: 100%;
  height: 110px;
  object-fit: cover;
  display: block;
}

.continue-card-overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 8px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
}

.continue-card-title {
  font-size: 13px;
  font-weight: 700;
  color: #fff;
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.continue-card-info {
  font-size: 11px;
  color: rgba(255,255,255,0.7);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.continue-card-progress {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 10px;
  color: rgba(255,255,255,0.6);
}

.continue-card-bar {
  position: absolute;
  bottom: 0;
  left: 0;
  height: 2px;
  background: var(--accent);
  border-radius: 0 2px 0 0;
  transition: width 0.3s ease;
}

/* Drama Calendar */
.calendar-section {
  margin-top: 40px;
}

.calendar-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.calendar-header-left {
  display: flex;
  align-items: center;
  gap: 12px;
}

.calendar-icon {
  width: 24px;
  height: 24px;
  color: var(--accent);
}

.calendar-title {
  font-size: 20px;
  font-weight: 700;
  color: var(--text-title);
}

.calendar-subtitle {
  font-size: 13px;
  color: var(--text-muted);
}

.calendar-date-range {
  font-size: 13px;
  color: var(--text-secondary);
}

.calendar-date-range a {
  color: var(--accent);
}

/* Week Days */
.week-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 8px;
  margin-bottom: 24px;
}

.week-day {
  text-align: center;
  padding: 12px 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
}

.week-day:hover {
  border-color: var(--border-light);
}

.week-day.active {
  background: var(--bg-tag);
  border-color: var(--accent);
}

.week-day.active .week-day-name,
.week-day.active .week-day-date,
.week-day.active .week-day-count {
  color: var(--accent);
}

.week-day-name {
  font-size: 12px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.week-day-date {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-title);
}

.week-day-count {
  font-size: 11px;
  color: var(--text-muted);
  margin-top: 4px;
}

/* Calendar Categories */
.calendar-categories {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 18px;
  margin-bottom: 16px;
}

.calendar-category {
  min-width: 0;
}

.calendar-category-header {
  white-space: nowrap;
}

.calendar-category-name {
  white-space: nowrap;
  flex-shrink: 0;
}

.calendar-category-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

.calendar-category-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-title);
}

.calendar-category-count {
  font-size: 12px;
  color: var(--text-muted);
}

.calendar-movies-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding-bottom: 8px;
}

.calendar-movie-item {
  flex-shrink: 0;
  width: 120px;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
  transition: var(--transition);
}

.calendar-movie-item:hover {
  transform: translateY(-2px);
}

.calendar-movie-poster {
  width: 120px;
  height: 80px;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 6px;
  background: var(--bg-card);
}

.calendar-movie-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.calendar-movie-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.calendar-movie-episode {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Horizontal Scroll Section */
.scroll-section {
  position: relative;
}

.scroll-container {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  scroll-snap-type: x mandatory;
}

.scroll-container::-webkit-scrollbar {
  height: 4px;
}

.scroll-btn {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 50%;
  color: var(--text-primary);
  cursor: pointer;
  z-index: 10;
  transition: var(--transition);
}

.scroll-btn:hover {
  background: var(--bg-card-hover);
}

.scroll-btn.left {
  left: -18px;
}

.scroll-btn.right {
  right: -18px;
}

.scroll-btn svg {
  width: 16px;
  height: 16px;
}

/* Movie Cards */
.movie-card {
  flex-shrink: 0;
  width: 218px;
  scroll-snap-align: start;
  cursor: pointer;
  transition: var(--transition);
}

.movie-card:hover {
  transform: translateY(-4px);
}

.movie-card-poster {
  position: relative;
  width: 218px;
  height: 328px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 10px;
  background: var(--bg-card);
}

.movie-card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.movie-card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 3px 8px;
  background: rgba(0,0,0,0.75);
  border-radius: 4px;
  font-size: 11px;
  color: #fff;
  font-weight: 500;
}

.movie-card-badge-live {
  top: auto;
  bottom: 8px;
  left: 8px;
  background: rgba(16, 185, 129, 0.92);
}

.movie-card-heat {
  position: absolute;
  top: 8px;
  right: 8px;
  padding: 3px 8px;
  background: rgba(0,0,0,0.75);
  border-radius: 4px;
  font-size: 11px;
  color: var(--accent-gold);
  font-weight: 600;
}

.movie-card-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-bottom: 4px;
}

.movie-card-meta {
  font-size: 12px;
  color: var(--text-muted);
}

/* === Short Drama Page === */
.short-drama-page {
  padding: 20px 32px 60px;
  max-width: 500px;
  margin: 0 auto;
}

.short-drama-viewer {
  position: relative;
  width: 100%;
  aspect-ratio: 9/16;
  max-height: 75vh;
  background: #000;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 16px;
}

.short-drama-viewer img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.short-drama-poster-link {
  display: block;
  width: 100%;
  height: 100%;
  position: relative;
  transition: transform .25s ease;
}

.short-drama-poster-link:hover img {
  transform: scale(1.02);
}

.short-drama-poster-link::after {
  content: '▶ 立即播放';
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  padding: 10px 18px;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 14px;
  font-weight: 700;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  opacity: 0;
  transition: opacity .2s;
  pointer-events: none;
}

.short-drama-poster-link:hover::after {
  opacity: 1;
}

.short-drama-controls {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 20px 16px;
  background: linear-gradient(transparent, rgba(0,0,0,0.8));
}

.short-drama-nav {
  position: absolute;
  right: 16px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.short-drama-nav-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.5);
  border-radius: 50%;
  color: #fff;
  cursor: pointer;
  transition: var(--transition);
}

.short-drama-nav-btn:hover {
  background: rgba(0,0,0,0.7);
}

.short-drama-nav-btn svg {
  width: 18px;
  height: 18px;
}

.short-drama-counter {
  text-align: center;
  font-size: 12px;
  color: rgba(255,255,255,0.7);
  margin-top: 4px;
}

.short-drama-info {
  margin-bottom: 16px;
}

.short-drama-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-title);
  margin-bottom: 4px;
}

.short-drama-episode {
  font-size: 14px;
  color: var(--text-secondary);
  margin-bottom: 8px;
}

.short-drama-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.short-drama-heat {
  font-size: 12px;
  color: var(--text-muted);
  padding: 4px 10px;
  background: var(--bg-card);
  border-radius: 20px;
}

.short-drama-fav-btn {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.short-drama-fav-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.short-drama-more-btn {
  padding: 6px 14px;
  background: var(--accent);
  border-radius: 20px;
  color: #fff;
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.short-drama-more-btn:hover {
  background: var(--accent-hover);
}

/* Short Drama Progress Slider */
.short-drama-slider {
  width: 100%;
  height: 4px;
  -webkit-appearance: none;
  appearance: none;
  background: rgba(255,255,255,0.2);
  border-radius: 2px;
  outline: none;
  margin-top: 12px;
}

.short-drama-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 12px;
  height: 12px;
  background: var(--accent);
  border-radius: 50%;
  cursor: pointer;
}

/* Pagination */
.pagination {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 12px;
  margin-top: 24px;
}

.pagination-btn {
  padding: 8px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.pagination-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.pagination-btn:disabled {
  opacity: 0.4;
  cursor: not-allowed;
}

.pagination-info {
  font-size: 13px;
  color: var(--text-muted);
}

/* === History Page === */
.history-page,
.saved-page,
.sessions-page,
.search-page,
.session-page {
  padding: 20px 32px 60px;
  max-width: 900px;
  margin: 0 auto;
}

/* === Library Page（会话记录 / 历史 / 收藏 通用） === */
.library-page {
  padding: 0 24px 60px;
  max-width: 900px;
  margin: 0 auto;
}

.library-sticky-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: var(--bg-primary);
  padding-top: 4px;
}

.library-page-header {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding-top: 16px;
}

.library-page-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.library-page-header-icon {
  display: flex;
  width: 20px;
  height: 20px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  color: var(--accent);
}

.library-page-header-icon svg {
  width: 20px;
  height: 20px;
}

.library-page-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: -0.01em;
  color: var(--text-title);
}

@media (min-width: 768px) {
  .library-page-title {
    font-size: 24px;
  }
}

.library-page-header-count {
  flex-shrink: 0;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-muted);
}

.library-source-label {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

@media (max-width: 639px) {
  .library-source-label {
    display: none;
  }
}

.library-page-header-action {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  gap: 8px;
}

.library-manage-btn,
.library-clear-btn {
  height: 32px;
  padding: 0 14px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.library-manage-btn:hover:not(:disabled),
.library-clear-btn:hover:not(:disabled) {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.library-clear-btn {
  border-color: rgba(239, 68, 68, 0.3);
  background: var(--danger-bg);
  color: var(--danger);
}

.library-manage-btn.is-active {
  border-color: var(--accent);
  background: rgba(142, 231, 242, 0.14);
  color: var(--accent);
}

.library-manage-btn:disabled,
.library-clear-btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 工具栏：搜索 + 选择操作 */
.library-toolbar {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}

@media (min-width: 768px) {
  .library-toolbar {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}

.library-search {
  display: flex;
  height: 44px;
  min-width: 0;
  align-items: center;
  gap: 8px;
  padding: 0 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 999px;
  transition: var(--transition);
}

.library-search:focus-within {
  border-color: var(--accent);
}

.library-search > svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  color: var(--text-muted);
}

.library-search input {
  min-width: 0;
  flex: 1;
  background: transparent;
  font-size: 14px;
  color: var(--text-primary);
  outline: none;
}

.library-search input::placeholder {
  color: var(--text-muted);
}

.library-search-clear {
  display: none;
  width: 28px;
  height: 28px;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.library-search-clear svg {
  width: 16px;
  height: 16px;
}

.library-search-clear:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.library-search.has-value .library-search-clear {
  display: flex;
}

/* 选择操作条（管理模式） */
.library-selection {
  display: none;
  align-items: center;
  gap: 12px;
  padding: 6px 6px 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--accent);
  border-radius: 999px;
}

.sessions-page.is-managing .library-selection {
  display: flex;
}

.library-selection-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  white-space: nowrap;
}

.library-selection-count b {
  color: var(--text-primary);
}

.library-selection-delete {
  height: 32px;
  padding: 0 14px;
  border: 1px solid rgba(239, 68, 68, 0.35);
  background: var(--danger-bg);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  color: var(--danger);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
}

.library-selection-delete:hover {
  background: rgba(239, 68, 68, 0.18);
}

/* 列表区 */
.library-body {
  min-width: 0;
  padding-top: 16px;
}

.session-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.session-row-wrap {
  position: relative;
  min-width: 0;
  border-radius: var(--radius-lg);
}

.session-row-wrap.is-selected {
  box-shadow: 0 0 0 2px var(--accent);
}

.session-row {
  display: flex;
  min-width: 0;
  align-items: center;
  padding: 12px 56px 12px 16px;
  min-height: 56px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: var(--transition);
}

.session-row:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}

.session-row-texts {
  display: flex;
  flex-direction: column;
  gap: 2px;
  min-width: 0;
}

.session-row-title {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
}

.session-row-time {
  display: block;
  margin-top: 2px;
  font-size: 13px;
  color: var(--text-muted);
}

/* 右侧操作 */
.session-delete,
.session-check {
  position: absolute;
  top: 50%;
  right: 12px;
  transform: translateY(-50%);
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.session-delete {
  width: 32px;
  height: 32px;
  color: var(--text-muted);
}

.session-delete svg {
  width: 16px;
  height: 16px;
}

.session-delete:hover {
  background: var(--danger-bg);
  color: var(--danger);
}

.session-check {
  display: none;
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  background: transparent;
  color: transparent;
}

.session-check svg {
  width: 14px;
  height: 14px;
}

.sessions-page.is-managing .session-check {
  display: flex;
}

.sessions-page.is-managing .session-delete {
  display: none;
}

.session-row-wrap.is-selected .session-check {
  border-color: var(--accent);
  background: var(--accent);
  color: #0b1113;
}

.sessions-page.is-managing .session-row {
  padding-right: 52px;
  cursor: pointer;
}

/* 空态 */
.library-empty {
  margin-top: 20px;
  padding: 40px 12px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  text-align: center;
  font-size: 14px;
  color: var(--text-secondary);
}

.library-empty p:first-child {
  font-weight: 600;
  color: var(--text-primary);
}

.library-empty-desc {
  margin-top: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-muted);
}

.library-empty-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 38px;
  margin-top: 16px;
  padding: 0 20px;
  background: var(--accent);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 700;
  color: #0b1113;
  text-decoration: none;
  transition: var(--transition);
}

.library-empty-action:hover {
  background: var(--accent-hover);
}

[data-search-empty] {
  display: none;
}

.sessions-page.is-searching [data-search-empty] {
  display: block;
}

.search-page {
  max-width: 1200px;
}

.page-toolbar {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 20px;
}

.toolbar-btn {
  padding: 6px 14px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.toolbar-btn:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.toolbar-btn.danger {
  color: var(--danger);
}

.toolbar-btn.danger:hover {
  border-color: var(--danger);
}

.toolbar-search {
  flex: 1;
  max-width: 300px;
  margin-left: auto;
}

.toolbar-search input {
  width: 100%;
  padding: 8px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 13px;
  transition: var(--transition);
}

.toolbar-search input:focus {
  border-color: var(--accent);
}

.toolbar-search input::placeholder {
  color: var(--text-muted);
}

/* Filter Tabs */
.filter-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}

.filter-tab {
  padding: 6px 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 20px;
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.filter-tab:hover {
  border-color: var(--border-light);
  color: var(--text-primary);
}

.filter-tab.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
}

/* 搜索结果 - 资源站实时同步反馈条 */
.auto-collect-report {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  margin-bottom: 20px;
  padding: 10px 14px;
  background: rgba(16, 185, 129, 0.08);
  border: 1px solid rgba(16, 185, 129, 0.25);
  border-radius: 10px;
  color: var(--text-secondary);
  font-size: 13px;
  line-height: 1.6;
}
.auto-collect-report svg {
  width: 16px;
  height: 16px;
  flex-shrink: 0;
  margin-top: 2px;
  color: #10b981;
}
.auto-collect-report-text {
  flex: 1;
}
.auto-collect-report-text strong {
  color: var(--text-primary);
  font-weight: 600;
}
.auto-collect-report.is-warn {
  background: rgba(245, 158, 11, 0.07);
  border-color: rgba(245, 158, 11, 0.22);
}
.auto-collect-report.is-warn svg {
  color: #f59e0b;
}
.auto-collect-notes {
  display: block;
  margin-top: 2px;
  color: var(--text-muted);
  font-size: 12px;
  word-break: break-all;
}

/* History Items */
.history-group-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 12px;
  margin-top: 20px;
}

.history-item {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 16px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  margin-bottom: 12px;
  transition: var(--transition);
}

.history-item:hover {
  border-color: var(--border-color);
  background: var(--bg-card-hover);
}

.history-item-poster {
  width: 80px;
  height: 110px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-input);
}

.history-item-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.history-item-info {
  flex: 1;
  min-width: 0;
}

.history-item-title {
  font-size: 16px;
  font-weight: 600;
  color: var(--text-title);
  margin-bottom: 4px;
}

.history-item-meta {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 4px;
}

.history-item-type {
  font-size: 12px;
  color: var(--text-muted);
}

.history-item-progress {
  width: 200px;
  flex-shrink: 0;
}

.progress-bar-bg {
  height: 4px;
  background: var(--border-color);
  border-radius: 2px;
  overflow: hidden;
  margin-bottom: 4px;
}

.progress-bar-fill {
  height: 100%;
  background: var(--accent);
  border-radius: 2px;
  transition: width 0.3s ease;
}

.progress-text {
  font-size: 11px;
  color: var(--text-muted);
  text-align: right;
}

.history-item-actions {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
}

.continue-watch-btn {
  padding: 6px 14px;
  background: var(--accent);
  border-radius: var(--radius);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.continue-watch-btn:hover {
  background: var(--accent-hover);
}

.delete-btn {
  padding: 6px 10px;
  background: transparent;
  border: 1px solid var(--border-light);
  border-radius: 6px;
  color: var(--text-muted);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.delete-btn:hover {
  color: var(--danger);
  border-color: var(--danger);
  background: var(--danger-bg);
}

/* Empty State */
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}

.empty-state svg {
  width: 64px;
  height: 64px;
  margin-bottom: 16px;
  opacity: 0.4;
}

.empty-state p {
  font-size: 15px;
}

/* === Updates/Calendar Page === */
.updates-page {
  padding: 20px 32px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.updates-header {
  margin-bottom: 24px;
}

.updates-title {
  font-size: 24px;
  font-weight: 700;
  color: var(--text-title);
  margin-bottom: 4px;
}

.updates-subtitle {
  font-size: 14px;
  color: var(--text-muted);
  margin-bottom: 4px;
}

.updates-date-range {
  font-size: 13px;
  color: var(--text-secondary);
}

/* Category Tabs */
.category-tabs {
  display: flex;
  border-bottom: 1px solid var(--border-color);
  margin-bottom: 24px;
}

.category-tab {
  flex: 1;
  text-align: center;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  cursor: pointer;
  border-bottom: 2px solid transparent;
  transition: var(--transition);
}

.category-tab:hover {
  color: var(--text-primary);
}

.category-tab.active {
  color: var(--accent);
  border-bottom-color: var(--accent);
}

/* Updates Movie Grid */
.updates-movie-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 24px;
}

.updates-movie-item {
  display: flex;
  gap: 12px;
  cursor: pointer;
  transition: var(--transition);
}

.updates-movie-item:hover {
  transform: translateX(4px);
}

.updates-movie-poster {
  width: 60px;
  height: 80px;
  border-radius: var(--radius);
  overflow: hidden;
  flex-shrink: 0;
  background: var(--bg-card);
}

.updates-movie-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.updates-movie-info {
  flex: 1;
  min-width: 0;
}

.updates-movie-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.updates-movie-episode {
  font-size: 12px;
  color: var(--text-muted);
}

.load-more-btn {
  display: block;
  margin: 24px auto;
  padding: 10px 32px;
  background: var(--accent);
  border-radius: var(--radius);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.load-more-btn:hover {
  background: var(--accent-hover);
}

/* === Download Page === */
.download-page {
  padding: 20px 32px 60px;
  max-width: 1200px;
  margin: 0 auto;
}

.download-title {
  font-size: 32px;
  font-weight: 900;
  color: var(--text-title);
  margin-bottom: 32px;
}

.download-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(320px, 1fr));
  gap: 20px;
}

.download-card {
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  padding: 24px;
  transition: var(--transition);
}

.download-card:hover {
  border-color: var(--border-light);
}

.download-card-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.download-card-platform {
  display: flex;
  align-items: center;
  gap: 12px;
}

.download-card-icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-input);
  border-radius: var(--radius);
  color: var(--text-primary);
}

.download-card-icon svg {
  width: 22px;
  height: 22px;
}

.download-card-platform-name {
  font-size: 12px;
  color: var(--text-muted);
}

.download-card-platform-title {
  font-size: 18px;
  font-weight: 700;
  color: var(--text-title);
}

.download-card-badge {
  padding: 4px 12px;
  background: var(--bg-tag);
  border-radius: 20px;
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
}

.download-card-badge.disabled {
  background: var(--bg-card);
  color: var(--text-muted);
}

.download-card-version {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-title);
  margin-bottom: 8px;
}

.download-card-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.6;
  margin-bottom: 16px;
}

.download-card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
}

.download-tag {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 10px;
  background: var(--bg-input);
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-secondary);
}

.download-tag svg {
  width: 12px;
  height: 12px;
}

.download-card-instructions {
  background: var(--bg-input);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 16px;
}

.download-card-instructions h4 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-title);
  margin-bottom: 12px;
}

.download-card-instructions ol {
  padding-left: 20px;
  list-style: decimal;
}

.download-card-instructions li {
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 8px;
  line-height: 1.5;
}

.download-card-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  padding: 12px;
  background: var(--accent);
  border-radius: var(--radius);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}

.download-card-btn:hover {
  background: var(--accent-hover);
}

.download-card-btn:disabled {
  background: var(--bg-input);
  color: var(--text-muted);
  cursor: not-allowed;
}

.download-card-btn svg {
  width: 16px;
  height: 16px;
}

/* === Login Modal === */
.modal-overlay {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-modal);
  z-index: 1000;
  display: flex;
  align-items: center;
  justify-content: center;
  opacity: 0;
  visibility: hidden;
  transition: var(--transition);
}

.modal-overlay.active {
  opacity: 1;
  visibility: visible;
}

.modal {
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-xl);
  padding: 32px;
  width: 100%;
  max-width: 400px;
  position: relative;
  transform: translateY(20px);
  transition: var(--transition);
}

.modal-overlay.active .modal {
  transform: translateY(0);
}

/* === Scan Modal（扫一扫） === */
.scan-modal,
.notify-modal {
  max-width: 440px;
}

.scan-viewport {
  position: relative;
  width: 100%;
  aspect-ratio: 1 / 1;
  border-radius: var(--radius-xl);
  overflow: hidden;
  background: #000;
  border: 1px solid var(--border-color);
}

#scanVideo {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}

.scan-frame {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 62%;
  height: 62%;
  transform: translate(-50%, -50%);
  border-radius: 14px;
  box-shadow:
    0 0 0 1px rgba(142, 231, 242, 0.55) inset;
}

.scan-frame::before,
.scan-frame::after {
  content: '';
  position: absolute;
  width: 22px;
  height: 22px;
  border-color: var(--accent);
  border-style: solid;
}

.scan-frame::before {
  top: -1px;
  left: -1px;
  border-width: 3px 0 0 3px;
  border-radius: 10px 0 0 0;
}

.scan-frame::after {
  bottom: -1px;
  right: -1px;
  border-width: 0 3px 3px 0;
  border-radius: 0 0 10px 0;
}

.scan-status {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  padding: 8px 14px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.55);
  color: #e5e7eb;
  font-size: 13px;
  text-align: center;
  backdrop-filter: blur(4px);
}

.scan-status.error {
  color: #fca5a5;
}

.scan-result {
  margin-top: 16px;
}

.scan-result-text {
  padding: 12px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  font-size: 14px;
  color: var(--text-primary);
  word-break: break-all;
  max-height: 96px;
  overflow-y: auto;
  line-height: 1.5;
}

.scan-result-actions {
  display: flex;
  gap: 10px;
  margin-top: 12px;
}

.scan-result-actions .modal-submit {
  flex: 1;
  margin-top: 0;
}

.scan-result-actions .scan-again {
  background: var(--bg-card);
  color: var(--text-secondary);
  border: 1px solid var(--border-color);
}

.scan-result-actions .scan-again:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* === Notifications Modal（站内通知） === */
.notify-overlay {
  align-items: flex-end;
  justify-content: center;
  padding: 0;
}

.notify-modal {
  max-width: 40rem;
  width: 100%;
  max-height: min(42rem, calc(100dvh - 3rem));
  padding: 0;
  display: flex;
  flex-direction: column;
  border-radius: 16px 16px 0 0;
  overflow: hidden;
}

@media (min-width: 768px) {
  .notify-overlay {
    align-items: center;
    padding: 24px;
  }

  .notify-modal {
    border-radius: var(--radius-xl);
  }
}

/* Header */
.notify-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px 16px 12px 20px;
  border-bottom: 1px solid var(--border-light);
}

.notify-header-left {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.notify-title {
  font-size: 18px;
  font-weight: 800;
  color: var(--text-title);
  white-space: nowrap;
}

.notify-version {
  flex-shrink: 0;
  border: 1px solid var(--border-light);
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-muted);
}

.notify-close {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border-radius: 50%;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.notify-close:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.notify-close svg {
  width: 20px;
  height: 20px;
}

/* Tabs */
.notify-tabs {
  display: flex;
  gap: 8px;
  padding: 12px 20px 10px;
  overflow-x: auto;
  scrollbar-width: none;
}

.notify-tabs::-webkit-scrollbar {
  display: none;
}

.notify-tab {
  position: relative;
  flex-shrink: 0;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  border-radius: 999px;
  padding: 6px 16px;
  font-size: 12px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.notify-tab:hover {
  border-color: var(--accent);
  color: var(--text-primary);
}

.notify-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b1113;
}

.notify-tab-dot {
  position: absolute;
  top: 6px;
  right: 8px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

.notify-tab.is-active .notify-tab-dot {
  background: #0b1113;
  box-shadow: none;
}

/* List */
.notify-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 4px 20px 16px;
}

.notify-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.notify-item {
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  border-radius: var(--radius-lg);
  padding: 12px 14px;
  transition: var(--transition);
}

.notify-item:hover {
  border-color: var(--accent);
}

.notify-item.is-open {
  border-color: var(--accent);
  background: rgba(142, 231, 242, 0.12);
}

.notify-item-main {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  padding: 0;
  background: transparent;
  text-align: left;
  cursor: pointer;
}

.notify-item-texts {
  display: flex;
  flex-direction: column;
  gap: 3px;
  min-width: 0;
}

.notify-item-title {
  font-size: 15px;
  font-weight: 700;
  line-height: 1.4;
  color: var(--text-primary);
}

.notify-item-summary {
  font-size: 13px;
  line-height: 1.55;
  color: var(--text-secondary);
}

.notify-item-dot {
  margin-top: 7px;
  flex-shrink: 0;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: var(--border-color);
}

.notify-item.is-open .notify-item-dot {
  background: var(--accent);
  box-shadow: 0 0 8px var(--accent);
}

/* 展开详情 */
.notify-item-detail {
  display: none;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--border-light);
}

.notify-item.is-open .notify-item-detail {
  display: block;
}

.notify-item-body {
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
}

.notify-item-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-top: 10px;
}

.notify-item-time {
  font-size: 12px;
  color: var(--text-muted);
}

.notify-item-cta {
  flex-shrink: 0;
  padding: 0;
  background: transparent;
  font-size: 12px;
  font-weight: 700;
  color: var(--accent);
  cursor: pointer;
  transition: var(--transition);
}

.notify-item-cta:hover {
  color: var(--accent-hover);
}

.notify-empty {
  padding: 28px 12px;
  text-align: center;
  font-size: 14px;
  color: var(--text-muted);
}

/* Footer */
.notify-footer {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px;
  padding: 12px 20px 16px;
  border-top: 1px solid var(--border-light);
  background: var(--bg-secondary);
}

.notify-btn {
  height: 44px;
  border: 1px solid var(--border-color);
  background: var(--bg-card);
  border-radius: var(--radius);
  font-size: 14px;
  font-weight: 600;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.notify-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

.notify-btn.primary {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b1113;
  font-weight: 800;
}

.notify-btn.primary:hover {
  background: var(--accent-hover);
  border-color: var(--accent-hover);
  color: #0b1113;
}

.modal-close {
  position: absolute;
  top: 16px;
  right: 16px;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  color: var(--text-muted);
  border-radius: 50%;
  cursor: pointer;
  transition: var(--transition);
}

.modal-close:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.modal-close svg {
  width: 18px;
  height: 18px;
}

.modal-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-title);
  margin-bottom: 8px;
}

.modal-desc {
  font-size: 13px;
  color: var(--text-muted);
  margin-bottom: 24px;
}

.form-group {
  margin-bottom: 16px;
}

.form-label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-secondary);
  margin-bottom: 6px;
}

.form-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--bg-input);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  transition: var(--transition);
}

.form-input:focus {
  border-color: var(--accent);
  background: var(--bg-input-focus);
}

.form-input::placeholder {
  color: var(--text-muted);
}

.password-wrapper {
  position: relative;
}

.password-toggle {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px;
}

.password-toggle:hover {
  color: var(--text-primary);
}

.password-toggle svg {
  width: 16px;
  height: 16px;
}

.modal-submit {
  width: 100%;
  padding: 12px;
  background: var(--accent);
  border-radius: var(--radius);
  color: #fff;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  margin-top: 8px;
}

.modal-submit:hover {
  background: var(--accent-hover);
}

.modal-switch {
  text-align: center;
  margin-top: 16px;
  font-size: 13px;
  color: var(--text-muted);
}

.modal-switch a {
  color: var(--accent);
  cursor: pointer;
}

/* === Player Page === */
.player-page {
  padding: 0;
  max-width: 100%;
  min-height: 100vh;
  background: var(--bg-primary);
}

/* 播放页是全屏观影场景：保留左侧侧栏（与其他页面一致），
   只隐藏全局顶部 tab 和汉堡按钮，避免与 .player-top-nav 上的返回按钮形成重复导航 */
body:has(.player-page) .content-topbar,
body:has(.player-page) .mobile-menu-btn {
  display: none !important;
}
@media (max-width: 480px) {
  body:has(.player-page) .main-content {
    padding-top: 0 !important;
  }
}

/* Player Top Nav */
.player-top-nav {
  position: sticky;
  top: 0;
  z-index: 50;
  display: flex;
  align-items: center;
  padding: 12px 20px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
  gap: 16px;
}

.player-back-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-primary);
  text-decoration: none;
  transition: var(--transition);
  flex-shrink: 0;
}

.player-back-btn:hover {
  background: var(--bg-card-hover);
}

.player-title-area {
  flex: 1;
  min-width: 0;
}

.player-movie-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-title);
  margin-bottom: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.player-movie-meta {
  font-size: 12px;
  color: var(--text-muted);
}

.player-top-actions {
  display: flex;
  gap: 8px;
  flex-shrink: 0;
}

.player-action-btn {
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.player-action-btn:hover {
  background: var(--bg-card-hover);
  color: var(--text-primary);
}

/* Player Main Layout */
.player-main-layout {
  display: grid;
  grid-template-columns: 1fr 380px;
  gap: 0;
  min-height: calc(100vh - 61px);
}

/* Video Area */
.player-video-area {
  position: relative;
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: #000;
}

.player-container {
  flex: 1 1 auto;
  min-height: 0;
  width: 100%;
  aspect-ratio: 16/9; /* 默认 16:9；播放器区域被拉高时自动拉伸，贴合 .player-video-area */
  background: #000;
  position: relative;
}

.player-container video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

/* WGPlayer 接口播放器 iframe：铺满播放容器 */
.player-container iframe {
  position: absolute;
  top: 0;
  left: 0;
  width: 100%;
  height: 100%;
  border: none;
  background: #000;
}

/* 本集无可播放源提示（覆盖在视频区中央） */
.video-no-source {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(6, 10, 12, 0.55);
  color: var(--text-secondary);
  text-align: center;
  padding: 20px;
  pointer-events: none;
  z-index: 5;
}
.video-no-source p {
  font-size: 14px;
  line-height: 1.6;
}

/* Video Controls Bar */
.video-controls-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 8px 16px;
  background: var(--bg-secondary);
  border-bottom: 1px solid var(--border-light);
}

.video-controls-left,
.video-controls-center,
.video-controls-right {
  display: flex;
  align-items: center;
  gap: 8px;
}

.video-ctrl-btn {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: transparent;
  border: none;
  border-radius: 6px;
  color: var(--text-secondary);
  cursor: pointer;
  transition: var(--transition);
}

.video-ctrl-btn:hover {
  background: var(--bg-card);
  color: var(--text-primary);
}

.video-time {
  font-size: 12px;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
}

/* Danmaku Bar */
/* Player Side Panel */
.player-side-panel {
  display: flex;
  flex-direction: column;
  min-height: 0;
  background: var(--bg-secondary);
  border-left: 1px solid var(--border-light);
  overflow-y: auto;
  max-height: calc(100vh - 61px);
  position: sticky;
  top: 61px;
}

/* ===== Player Side Panel ===== */

/* Panel Tabs */
.player-panel-tabs {
  display: flex;
  flex-shrink: 0;
  align-items: stretch;
  gap: 16px;
  padding: 8px 16px 8px;
  border-bottom: 1px solid var(--border-light);
}

.player-panel-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  height: 40px;
  padding: 0 12px;
  background: transparent;
  border: none;
  border-radius: 8px 8px 0 0;
  color: var(--text-muted);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.player-panel-tab svg {
  width: 16px;
  height: 16px;
}

.player-panel-tab:hover {
  color: var(--text-primary);
  background: var(--bg-surface);
}

.player-panel-tab.is-active {
  color: var(--accent);
}

.player-panel-tab.is-active::after {
  content: '';
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: -1px;
  height: 2px;
  border-radius: 2px;
  background: var(--accent);
}

.player-panel-tab-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 18px;
  height: 18px;
  padding: 0 5px;
  border-radius: 999px;
  background: var(--accent);
  color: #0b1113;
  font-size: 11px;
  font-weight: 800;
}

.player-panel-tab-count:empty {
  display: none;
}

/* Panel Body */
.player-panel-body {
  display: none;
  flex-direction: column;
  gap: 14px;
  min-height: 0;
  padding: 14px 12px 24px;
}

.player-panel-body.is-active {
  display: flex;
}

/* Hero Card */
.player-hero-card {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  min-height: 168px;
  padding: 14px;
  border-radius: 12px;
  background-color: var(--bg-surface-strong);
  background-size: cover;
  background-position: center;
  background-repeat: no-repeat;
  overflow: hidden;
}

.player-hero-card::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(11, 17, 19, 0.05) 0%, rgba(11, 17, 19, 0.55) 60%, rgba(11, 17, 19, 0.92) 100%);
  pointer-events: none;
}

.player-hero-top,
.player-hero-tags,
.player-source-actions {
  position: relative;
  z-index: 1;
}

.player-hero-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 10px;
}

.player-hero-title {
  flex: 1;
  min-width: 0;
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.3;
  color: #fff;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.player-hero-title a {
  color: inherit;
  text-decoration: none;
}

.player-hero-title a:hover {
  color: var(--accent);
}

.player-hero-title svg {
  width: 16px;
  height: 16px;
  margin-left: 4px;
  vertical-align: -3px;
  flex-shrink: 0;
}

.player-hero-heat {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  min-width: 38px;
  height: 24px;
  padding: 0 10px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--accent) 22%, transparent);
  border: 1px solid color-mix(in srgb, var(--accent) 50%, transparent);
  color: var(--accent);
  font-size: 12px;
  font-weight: 900;
  backdrop-filter: blur(4px);
}

.player-hero-heat svg {
  width: 12px;
  height: 12px;
}

.player-hero-tags {
  margin: 6px 0 14px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.86);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.5);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* Level Bar */
.player-level-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-top: -14px;
  padding: 14px 16px;
  border-radius: 0 0 12px 12px;
  background: linear-gradient(180deg, rgba(11, 17, 19, 0.6) 0%, rgba(11, 17, 19, 0.85) 100%);
  border: none;
  border-bottom: 2px solid var(--accent);
  font-size: 14px;
  color: #fff;
  position: relative;
  z-index: 1;
}

.player-level-info,
.player-level-stats {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-width: 0;
}

.player-level-name {
  font-weight: 900;
  color: #fff;
  white-space: nowrap;
  flex-shrink: 0;
}

.player-level-hint {
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: rgba(255, 255, 255, 0.85);
}

.player-level-dot {
  color: rgba(255, 255, 255, 0.55);
  opacity: 1;
}

.player-level-stats {
  flex-shrink: 0;
}

.player-level-value {
  color: var(--accent);
  font-weight: 900;
  font-size: 16px;
  font-variant-numeric: tabular-nums;
}

/* Source Actions (Hero 内部) */
.player-source-actions {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
}

.player-source-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 5px;
  height: 38px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  backdrop-filter: blur(8px);
  transition: var(--transition);
}

.player-source-btn svg {
  width: 14px;
  height: 14px;
}

.player-source-btn:hover {
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.32);
  color: #fff;
}

/* Cast Panel */
.cast-intro {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  padding: 24px 16px 16px;
  border-radius: 12px;
  background: var(--bg-surface);
  border: 1px solid var(--border-light);
}

.cast-intro-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}

.cast-intro-icon svg {
  width: 24px;
  height: 24px;
}

.cast-intro-title {
  margin: 0;
  font-size: 15px;
  font-weight: 900;
  color: var(--text-primary);
}

.cast-intro-desc {
  margin: 0;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  text-align: center;
}

.cast-device-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.cast-device {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--text-primary);
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}

.cast-device:hover {
  border-color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, var(--bg-surface));
}

.cast-device-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  flex-shrink: 0;
  border-radius: 8px;
  background: color-mix(in srgb, var(--accent) 12%, transparent);
  color: var(--accent);
}

.cast-device-icon svg {
  width: 18px;
  height: 18px;
}

.cast-device-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}

.cast-device-name {
  font-size: 13px;
  font-weight: 900;
  color: var(--text-primary);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cast-device-meta {
  font-size: 11px;
  color: var(--text-muted);
}

.cast-device-badge {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  height: 24px;
  padding: 0 10px;
  border-radius: 6px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
  font-size: 11px;
  font-weight: 900;
}

.cast-device-empty {
  margin: 0;
  padding: 16px;
  font-size: 12px;
  color: var(--text-muted);
  text-align: center;
}

/* Episode List */
.movie-episode-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.movie-episode-quick-panel {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.episode-quick-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.movie-episode-section-title {
  margin: 0;
  font-size: 18px;
  font-weight: 900;
  color: var(--text-primary);
}

.episode-current-hint {
  font-size: 14px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-episode-expand-button {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  height: 32px;
  padding: 0 10px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 700;
  cursor: pointer;
  transition: var(--transition);
}

.movie-episode-expand-button svg {
  width: 14px;
  height: 14px;
}

.movie-episode-expand-button:hover {
  background: var(--bg-surface-strong);
  color: var(--text-primary);
  border-color: var(--border-color);
}

.movie-episode-latest {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  height: 44px;
  padding: 0 14px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.movie-episode-latest svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.movie-episode-latest:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.movie-episode-search {
  height: 38px;
  padding: 0 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  outline: none;
  transition: var(--transition);
}

.movie-episode-search::placeholder {
  color: var(--text-muted);
}

.movie-episode-search:focus {
  border-color: var(--accent);
}

.movie-episode-range-rail {
  display: flex;
  gap: 6px;
  overflow-x: auto;
  padding-bottom: 2px;
}

.movie-episode-range-tab {
  flex-shrink: 0;
  height: 32px;
  padding: 0 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.movie-episode-range-tab:hover {
  color: var(--text-primary);
  border-color: var(--border-color);
}

.movie-episode-range-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b1113;
}

.movie-episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 8px;
  max-height: 320px;
  overflow-y: auto;
  padding-right: 4px;
}

.movie-episode-tab {
  height: 44px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 16px;
  font-weight: 900;
  cursor: pointer;
  transition: var(--transition);
}

.movie-episode-tab:hover {
  background: var(--bg-surface-strong);
  border-color: var(--border-color);
  color: var(--text-primary);
}

.movie-episode-tab.is-active {
  background: var(--accent);
  border-color: var(--accent);
  color: #0b1113;
}

.movie-episode-empty {
  display: none;
  padding: 16px 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
}

.movie-episode-empty.is-visible {
  display: block;
}

.movie-episode-empty.is-static {
  display: block;
  padding: 20px 0;
}

/* Similar Recommendations */
.movie-similar-recommendations {
  margin-top: 2px;
}

.similar-card {
  padding: 12px;
  border: 1px solid var(--border-light);
  border-radius: 12px;
  background: var(--bg-surface);
}

.similar-head {
  display: flex;
  align-items: flex-start;
  gap: 12px;
}

.similar-heading {
  flex: 1;
  min-width: 0;
}

.similar-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent) 14%, transparent);
  color: var(--accent);
}

.similar-icon svg {
  width: 20px;
  height: 20px;
}

.similar-title {
  font-size: 16px;
  font-weight: 900;
  color: var(--text-primary);
}

.similar-desc {
  margin-top: 4px;
  font-size: 13px;
  line-height: 1.5;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.similar-actions {
  margin-top: 12px;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}

@media (max-width: 380px) {
  .similar-actions {
    grid-template-columns: repeat(2, 1fr);
  }
}

.similar-action {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-width: 0;
  height: 42px;
  padding: 0 10px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-surface-strong);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.similar-action span {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.similar-action svg {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.similar-action:hover {
  color: var(--text-primary);
  border-color: var(--accent);
}

/* Discuss Panel */
.discuss-compose {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.discuss-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: var(--transition);
}

.discuss-input:focus {
  border-color: var(--accent);
}

.discuss-compose-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.discuss-hint {
  font-size: 11px;
  color: var(--text-muted);
}

.discuss-submit {
  height: 32px;
  padding: 0 16px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #0b1113;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.discuss-submit:hover {
  background: var(--accent-hover);
}

.discuss-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 4px;
}

.discuss-item {
  display: flex;
  gap: 12px;
  padding: 14px;
  border-radius: 12px;
  background: var(--bg-surface);
  border-left: 3px solid var(--accent);
}

.discuss-avatar {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex-shrink: 0;
  border-radius: 50%;
  background: var(--accent-dark);
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  overflow: hidden;
}

.discuss-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.discuss-body {
  flex: 1;
  min-width: 0;
}

.discuss-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}

.discuss-name {
  font-size: 14px;
  font-weight: 900;
  color: var(--accent);
}

.discuss-badge {
  display: inline-flex;
  align-items: center;
  height: 22px;
  padding: 0 10px;
  border: 1px solid var(--accent);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 8%, transparent);
}

.discuss-time {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
}

.discuss-text {
  margin: 6px 0 10px;
  font-size: 14px;
  line-height: 1.6;
  color: var(--text-primary);
  word-break: break-word;
}

.discuss-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.discuss-action-link {
  display: inline-flex;
  align-items: center;
  background: none;
  border: none;
  padding: 0;
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  transition: var(--transition);
}

.discuss-action-link:hover {
  color: var(--accent);
}

.discuss-action-btns {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.discuss-action-btn {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  height: 30px;
  padding: 0 12px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-muted);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.discuss-action-btn svg {
  width: 12px;
  height: 12px;
}

.discuss-action-btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.discuss-action-btn.is-liked {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.discuss-item.is-reply {
  margin-left: 34px;
  border-left-color: var(--border-color);
  background: color-mix(in srgb, var(--bg-surface) 60%, transparent);
}

.discuss-empty {
  padding: 34px 14px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
}

/* Feedback Panel */
.feedback-desc {
  font-size: 12px;
  color: var(--text-muted);
}

.feedback-presets {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.feedback-preset {
  height: 36px;
  padding: 0 8px;
  border: 1px solid var(--border-light);
  border-radius: 8px;
  background: var(--bg-surface);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.feedback-preset:hover {
  color: var(--text-primary);
  border-color: var(--border-color);
}

.feedback-preset.is-active {
  border-color: var(--accent);
  color: var(--accent);
  background: color-mix(in srgb, var(--accent) 10%, transparent);
}

.feedback-input {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg-surface);
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  line-height: 1.5;
  resize: vertical;
  outline: none;
  transition: var(--transition);
}

.feedback-input:focus {
  border-color: var(--accent);
}

.feedback-submit {
  height: 38px;
  border: none;
  border-radius: 8px;
  background: var(--accent);
  color: #0b1113;
  font-size: 13px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition);
}

.feedback-submit:hover {
  background: var(--accent-hover);
}

/* === Search Capability Menu === */
.capability-menu {
  position: absolute;
  top: 100%;
  left: 0;
  width: 280px;
  background: var(--bg-secondary);
  border: 1px solid var(--border-color);
  border-radius: 10px;
  padding: 8px;
  z-index: 50;
  display: none;
  box-shadow: var(--shadow);
}

.capability-menu.active {
  display: block;
}

.capability-section-title {
  font-size: 11px;
  color: var(--text-muted);
  padding: 8px 12px 4px;
  font-weight: 600;
}

.capability-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: var(--transition);
  position: relative;
}

.capability-item:hover {
  background: var(--bg-card);
}

.capability-item.selected::after {
  content: '';
  position: absolute;
  right: 12px;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
}

.capability-item-icon {
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--bg-tag);
  border-radius: var(--radius);
  color: var(--accent);
  flex-shrink: 0;
}

.capability-item-icon svg {
  width: 16px;
  height: 16px;
}

.capability-item-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
}

.capability-item-desc {
  font-size: 12px;
  color: var(--text-muted);
}

/* Speed Mode */
.speed-mode-row {
  display: flex;
  gap: 8px;
  padding: 8px 12px;
}

.speed-mode-btn {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: var(--transition);
}

.speed-mode-btn.active {
  border-color: var(--accent);
  color: var(--accent);
  background: var(--bg-tag);
}

.speed-mode-btn svg {
  width: 14px;
  height: 14px;
}

/* === AI 生图弹窗 === */
.ai-image-overlay {
  z-index: 1200;
}
.ai-image-modal {
  max-width: 540px;
  width: 100%;
}
.ai-image-prompt {
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
  background: var(--bg-input);
  border: 1px solid var(--border-light);
  border-radius: var(--radius);
  padding: 8px 12px;
  margin-bottom: 14px;
  word-break: break-word;
  max-height: 60px;
  overflow-y: auto;
}
.ai-image-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 300px;
  background: #0b1113;
  border: 1px solid var(--border-light);
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 14px;
}
.ai-image-loading {
  text-align: center;
  color: var(--text-muted);
  padding: 32px 20px;
}
.ai-image-spinner {
  display: block;
  width: 36px;
  height: 36px;
  margin: 0 auto 12px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
.ai-image-loading p {
  font-size: 13px;
  line-height: 1.6;
}
.ai-image-wrap {
  width: 100%;
  max-height: 62vh;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ai-image-wrap img {
  max-width: 100%;
  max-height: 62vh;
  object-fit: contain;
  display: block;
}
.ai-image-error {
  padding: 26px 18px;
  text-align: center;
  color: var(--danger);
  font-size: 13px;
  line-height: 1.6;
}
.ai-image-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
}
.ai-image-actions .modal-submit {
  margin-top: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.ai-image-download,
.ai-image-again {
  background: var(--bg-card);
  color: var(--text-primary);
  border: 1px solid var(--border-color);
}
.ai-image-download:hover,
.ai-image-again:hover {
  background: var(--bg-card-hover);
  color: var(--accent);
  border-color: var(--accent);
}
.ai-image-close {
  background: var(--accent);
  color: #0b1113;
}
.ai-image-close:hover {
  background: var(--accent-hover);
}
@media (max-width: 480px) {
  .ai-image-actions {
    grid-template-columns: 1fr;
  }
}

/* === Responsive === */
@media (max-width: 1024px) {
  .updates-movie-grid {
    grid-template-columns: repeat(3, 1fr);
  }
  .calendar-movies-row {
    flex-wrap: nowrap;
  }
  /* 平板：追剧日历由 3 列降为 2 列，避免列过窄 */
  .calendar-categories {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 768px) {
  .sidebar {
    transform: translateX(-100%);
    width: var(--sidebar-width);
  }
  .sidebar.mobile-open {
    transform: translateX(0);
  }
  /* 侧栏打开时，浮在它左上角的汉堡按钮必须让位，否则会盖住头像 */
  body.sidebar-mobile-open .mobile-menu-btn {
    display: none;
  }
  .main-content {
    margin-left: 0 !important;
    width: 100% !important;
    max-width: 100% !important;
    padding-bottom: 56px !important;
  }
  /* 顶部 tab 胶囊：避开左上角汉堡，居中显示 */
  .content-topbar {
    justify-content: center;
    padding: 14px 56px 0;
  }
  .mobile-bottom-nav {
    display: block;
  }
  .player-main-layout {
    grid-template-columns: 1fr;
  }
  .player-side-panel {
    border-left: none;
    border-top: 1px solid var(--border-light);
    max-height: none;
    position: static;
  }
  .home-page,
  .short-drama-page,
  .history-page,
  .saved-page,
  .sessions-page,
  .search-page,
  .session-page,
  .updates-page,
  .download-page {
    padding: 16px;
  }
  .week-days {
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
  }
  .week-day {
    padding: 8px 4px;
  }
  .week-day-date {
    font-size: 14px;
  }
  .updates-movie-grid {
    grid-template-columns: repeat(2, 1fr);
  }
  .download-grid {
    grid-template-columns: 1fr;
  }
  .continue-grid {
    grid-template-columns: 1fr;
  }
  .movie-card {
    width: 160px;
  }
  .movie-card-poster {
    width: 160px;
    height: 240px;
  }
  .search-title {
    font-size: 24px;
  }
  .results-grid {
    grid-template-columns: repeat(auto-fill, minmax(130px, 1fr));
    gap: 16px 12px;
  }
  .history-item {
    flex-direction: column;
    align-items: flex-start;
  }
  .history-item-progress {
    width: 100%;
  }
}

@media (max-width: 480px) {
  /* === Layout === */
  .home-page,
  .short-drama-page,
  .history-page,
  .saved-page,
  .sessions-page,
  .search-page,
  .session-page,
  .updates-page,
  .download-page {
    padding: 12px;
  }
  .main-content {
    padding-top: 56px;
  }

  /* === Topbar (汉堡+居中 logo+域名) === */
  .content-topbar {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    height: 56px;
    padding: 0 60px;
    background: var(--bg-page);
    border-bottom: 1px solid var(--border-light);
    z-index: 30;
    justify-content: center;
    align-items: center;
  }
  .topbar-tabs {
    display: none;
  }
  .topbar-mobile-logo {
    display: flex;
    align-items: center;
    gap: 6px;
    min-width: 0;
    overflow: hidden;
  }
  .topbar-mobile-logo-icon {
    font-size: 18px;
    font-weight: 900;
    color: var(--accent);
    letter-spacing: 1px;
    flex-shrink: 0;
  }
  .topbar-mobile-logo-text {
    font-size: 16px;
    font-weight: 900;
    color: var(--accent);
    flex-shrink: 0;
  }
  .topbar-mobile-logo-domain {
    font-size: 11px;
    color: var(--text-muted);
    margin-left: 6px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
  }
  .topbar-mobile-logo-domain em {
    color: var(--accent);
    font-style: normal;
  }
  .mobile-menu-btn {
    top: 8px;
    left: 8px;
    width: 40px;
    height: 40px;
    z-index: 40;
  }

  /* === Search === */
  .search-area {
    margin-bottom: 24px;
  }
  .search-title {
    font-size: 22px;
    letter-spacing: 1px;
    margin-bottom: 6px;
  }
  .search-domain {
    font-size: 12px;
    flex-wrap: wrap;
    gap: 4px;
    margin-bottom: 16px;
  }
  .search-box {
    max-width: 100%;
  }
  .search-box-top {
    padding: 8px 10px;
    gap: 8px;
    flex-wrap: nowrap;
  }
  .search-plus-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 28px;
    height: 28px;
    flex-shrink: 0;
    background: var(--bg-tag);
    border: 1px solid var(--border-color);
    border-radius: 50%;
    color: var(--text-secondary);
    cursor: pointer;
  }
  .search-plus-btn svg {
    width: 14px;
    height: 14px;
  }
  .search-mode-btn {
    font-size: 12px;
    padding: 4px 12px;
    height: 28px;
  }
  .search-mode-btn svg {
    width: 12px;
    height: 12px;
  }
  .search-capability-btn {
    display: none;
  }
  .search-input-wrapper {
    padding: 8px 10px 10px;
    gap: 8px;
  }
  .search-input {
    font-size: 13px;
    min-height: 32px;
  }
  .search-input-actions {
    gap: 6px;
  }
  .voice-btn,
  .send-btn {
    width: 30px;
    height: 30px;
  }
  .voice-btn svg,
  .send-btn svg {
    width: 14px;
    height: 14px;
  }

  /* === Hot Searches (横滚) === */
  .hot-searches {
    margin-top: 16px;
    flex-wrap: nowrap;
    overflow-x: auto;
    justify-content: flex-start;
    padding: 0 0 4px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    gap: 8px;
  }
  .hot-searches::-webkit-scrollbar {
    display: none;
  }
  .hot-search-label {
    font-size: 12px;
    flex-shrink: 0;
    display: none; /* 手机端隐藏"热门影片"标题，避免与热词标签行视觉错位 */
  }
  .hot-tag {
    white-space: nowrap;
    flex-shrink: 0;
    font-size: 12px;
    padding: 5px 12px;
  }
  .hot-tag svg {
    width: 10px;
    height: 10px;
  }

  /* === Recommend === */
  .recommend-input {
    margin-top: 12px;
    gap: 6px;
    flex-wrap: wrap;
    justify-content: center;
  }
  .recommend-label {
    font-size: 12px;
  }
  .recommend-tag {
    font-size: 12px;
    padding: 4px 10px;
  }

  /* === Continue Watching (横滑大卡) === */
  .continue-grid {
    display: flex;
    grid-template-columns: none;
    gap: 12px;
    overflow-x: auto;
    padding: 0 0 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .continue-grid::-webkit-scrollbar {
    display: none;
  }
  .continue-card {
    flex-shrink: 0;
    width: 56%;
    max-width: 220px;
    border-radius: 10px;
  }
  .continue-card-img {
    height: 85px;
  }
  .continue-card-overlay {
    padding: 6px 8px;
  }
  .continue-card-title {
    font-size: 12px;
  }
  .continue-card-info {
    font-size: 10px;
    margin-bottom: 3px;
  }
  .continue-card-progress {
    font-size: 9px;
  }
  .continue-card-bar {
    height: 2px;
  }

  /* === Calendar === */
  .calendar-section {
    margin-top: 20px;
    padding: 12px;
    border-radius: 10px;
    background: var(--bg-card);
    border: 1px solid var(--border-light);
  }
  .calendar-header {
    flex-direction: row;
    align-items: flex-start;
    gap: 8px;
    margin-bottom: 10px;
  }
  .calendar-header-left {
    flex: 1;
    min-width: 0;
  }
  .calendar-title {
    font-size: 15px;
    font-weight: 700;
  }
  .calendar-subtitle {
    font-size: 11px;
    color: var(--text-muted);
  }
  .calendar-date-range {
    font-size: 11px;
    color: var(--text-secondary);
  }
  .calendar-date-range a {
    color: var(--accent);
    display: block;
    margin-bottom: 2px;
  }
  .calendar-icon {
    width: 18px;
    height: 18px;
  }
  .week-days {
    grid-template-columns: repeat(7, 1fr);
    gap: 4px;
    margin-bottom: 14px;
  }
  .week-day {
    padding: 6px 2px;
    border-radius: 8px;
  }
  .week-day-name {
    font-size: 10px;
  }
  .week-day-date {
    font-size: 12px;
    font-weight: 700;
  }
  .week-day-count {
    font-size: 10px;
  }
  .calendar-categories {
    grid-template-columns: 1fr;
    gap: 14px;
  }
  .calendar-category-header {
    margin-bottom: 8px;
  }
  .calendar-category-name {
    font-size: 13px;
    font-weight: 700;
  }
  .calendar-category-count {
    font-size: 11px;
    color: var(--text-muted);
  }
  .calendar-movies-row {
    flex-wrap: nowrap;
    gap: 10px;
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
    scrollbar-width: none;
  }
  .calendar-movies-row::-webkit-scrollbar {
    display: none;
  }
  .calendar-movie-item {
    width: 100px;
  }
  .calendar-movie-poster {
    width: 100px;
    height: 140px;
    border-radius: 8px;
  }
  .calendar-movie-title {
    font-size: 12px;
  }
  .calendar-movie-episode {
    font-size: 11px;
  }

  /* === Section Header & Cards === */
  .section-header {
    flex-direction: row;
    align-items: flex-end;
    gap: 8px;
    margin-top: 24px;
    margin-bottom: 12px;
  }
  .section-header > div:last-child {
    width: auto;
    flex-shrink: 0;
    gap: 4px;
  }
  .section-header > div:last-child .scroll-btn {
    display: none;
  }
  .section-title {
    font-size: 16px;
  }
  .section-subtitle {
    font-size: 11px;
  }
  .section-more {
    font-size: 12px;
  }

  /* === Movie card row (scroll 横滑) === */
  .scroll-section {
    position: relative;
  }
  .scroll-container {
    display: flex;
    flex-wrap: nowrap;
    overflow-x: auto;
    gap: 10px;
    padding: 0 0 8px;
    scrollbar-width: none;
    -webkit-overflow-scrolling: touch;
    margin: 0 -12px;
    padding-left: 12px;
    padding-right: 12px;
  }
  .scroll-container::-webkit-scrollbar {
    display: none;
  }
  .movie-card {
    flex-shrink: 0;
    width: 110px;
  }
  .movie-card-poster {
    width: 110px;
    height: 165px;
  }
  .results-grid {
    grid-template-columns: repeat(auto-fill, minmax(105px, 1fr));
    gap: 14px 10px;
  }
  .movie-card-title {
    font-size: 12px;
  }
  .movie-card-meta {
    font-size: 10px;
  }
  .movie-card-badge {
    font-size: 9px;
    padding: 1px 5px;
  }
  .movie-card-heat {
    font-size: 10px;
    padding: 1px 5px;
    gap: 2px;
  }
  .movie-card-heat svg {
    width: 8px;
    height: 8px;
  }

  /* === Bottom Nav (5个tab + 分享凸起) === */
  .mobile-bottom-nav-inner {
    max-width: 100%;
    padding: 0 8px;
  }
  .mobile-nav-item {
    padding: 6px 8px;
    font-size: 10px;
    flex: 1;
  }
  .mobile-nav-item svg {
    width: 20px;
    height: 20px;
  }
  .mobile-nav-share-wrap {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    margin-top: -20px;
    pointer-events: none;
    gap: 3px;
  }
  .mobile-nav-share {
    pointer-events: auto;
    width: 54px;
    height: 54px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--accent), #14b8a6);
    border: 3px solid var(--bg-page);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 16px rgba(20, 184, 166, 0.4);
    cursor: pointer;
    transition: transform 0.2s;
  }
  .mobile-nav-share:active {
    transform: scale(0.92);
  }
  .mobile-nav-share svg {
    width: 22px;
    height: 22px;
  }
  .mobile-nav-share-label {
    font-size: 10px;
    color: var(--text-muted);
    line-height: 1;
    text-align: center;
    pointer-events: none;
  }
}

/* === Animations === */

/* === Collapsed Sidebar === */
.sidebar.collapsed .sidebar-top,
.sidebar.collapsed .level-card,
.sidebar.collapsed .guest-warning,
.sidebar.collapsed .quick-actions,
.sidebar.collapsed .sidebar-stats,
.sidebar.collapsed .sidebar-section,
.sidebar.collapsed .login-btn {
  display: none;
}

.sidebar.collapsed .collapsed-icons {
  display: flex;
}

/* === Mobile Bottom Navigation === */
.mobile-bottom-nav {
  display: none;
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  height: 56px;
  background: var(--bg-nav);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-top: 1px solid var(--border-light);
  z-index: 110;
  padding-bottom: env(safe-area-inset-bottom);
}

/* Mobile Overlay */
.mobile-overlay {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: var(--bg-modal);
  z-index: 115;
}

.mobile-overlay.active {
  display: block;
}

.mobile-bottom-nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-around;
  height: 100%;
  max-width: 500px;
  margin: 0 auto;
}

.mobile-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 6px 16px;
  color: var(--text-muted);
  font-size: 10px;
  text-decoration: none;
  transition: var(--transition);
  position: relative;
}

.mobile-nav-item svg {
  width: 22px;
  height: 22px;
}

.mobile-nav-item:hover,
.mobile-nav-item.active {
  color: var(--accent);
}

.mobile-nav-item .badge {
  position: absolute;
  top: 0;
  right: 8px;
  background: var(--danger);
  color: #fff;
  font-size: 9px;
  padding: 1px 4px;
  border-radius: 8px;
  font-weight: 600;
  min-width: 16px;
  text-align: center;
}
@keyframes fadeIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: translateY(0); }
}

@keyframes slideIn {
  from { opacity: 0; transform: translateX(-20px); }
  to { opacity: 1; transform: translateX(0); }
}

.fade-in {
  animation: fadeIn 0.4s ease forwards;
}

.slide-in {
  animation: slideIn 0.3s ease forwards;
}

/* === Toast Notification === */
.toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.toast {
  padding: 12px 20px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  box-shadow: var(--shadow);
  animation: fadeIn 0.3s ease;
  display: flex;
  align-items: center;
  gap: 8px;
}

.toast.success {
  border-left: 3px solid var(--success);
}

.toast.error {
  border-left: 3px solid var(--danger);
}

.toast.info {
  border-left: 3px solid var(--accent);
}

/* === Loading Spinner === */
.spinner {
  width: 24px;
  height: 24px;
  border: 2px solid var(--border-color);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 20px auto;
}

@keyframes spin {
  to { transform: rotate(360deg); }
}

/* === Short Drama Watch (竖屏沉浸式播放) === */
.sd-watch {
  position: fixed;
  inset: 0;
  z-index: 2000;
  background: #000;
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
}

.sd-watch .sd-video {
  width: 100%;
  height: 100%;
  max-width: 480px;
  max-height: 100vh;
  object-fit: contain;
  background: #000;
  display: block;
  -webkit-tap-highlight-color: transparent;
}

.sd-stage-hint {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  z-index: 2;
}

.sd-stage-card {
  color: rgba(255, 255, 255, 0.85);
  text-align: center;
  background: rgba(0, 0, 0, 0.45);
  padding: 14px 18px;
  border-radius: 10px;
  border: 1px solid rgba(255, 255, 255, 0.08);
  max-width: 80%;
}

.sd-stage-title {
  font-size: 14px;
  font-weight: 700;
  margin-bottom: 4px;
}

.sd-stage-sub {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.6);
}

.sd-back {
  position: absolute;
  top: 14px;
  left: 14px;
  width: 40px;
  height: 40px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.1);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 5;
  transition: background .2s, transform .15s;
  padding: 0;
}

.sd-back:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.05);
}

.sd-back svg {
  width: 22px;
  height: 22px;
}

.sd-side-actions {
  position: absolute;
  right: 12px;
  top: 50%;
  transform: translateY(-50%);
  display: flex;
  flex-direction: column;
  gap: 12px;
  z-index: 4;
}

.sd-side-btn {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.45);
  border: 1px solid rgba(255, 255, 255, 0.08);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background .2s, transform .15s, color .2s;
  padding: 0;
  position: relative;
}

.sd-side-btn:hover {
  background: rgba(0, 0, 0, 0.7);
  transform: scale(1.06);
}

.sd-side-btn svg {
  width: 20px;
  height: 20px;
}

.sd-side-btn.sd-rate {
  font-size: 11px;
  font-weight: 800;
  letter-spacing: 0.5px;
  line-height: 1;
}

.sd-side-btn.favorited {
  color: #ff5b5b;
}

.sd-info {
  position: absolute;
  left: 16px;
  right: 80px;
  bottom: 36px;
  z-index: 4;
  color: #fff;
  pointer-events: none;
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.6);
}

.sd-title {
  font-size: 18px;
  font-weight: 800;
  margin: 0 0 8px;
  line-height: 1.3;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.sd-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: rgba(255, 255, 255, 0.9);
  flex-wrap: wrap;
}

.sd-episode,
.sd-heat {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  background: rgba(0, 0, 0, 0.45);
  padding: 3px 8px;
  border-radius: 6px;
  border: 1px solid rgba(255, 255, 255, 0.1);
}

.sd-heat svg {
  width: 12px;
  height: 12px;
  color: #ff8a3d;
}

.sd-progress {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 16px;
  height: 3px;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
  z-index: 4;
}

.sd-progress-fill {
  height: 100%;
  width: 0;
  background: #3FE0CC;
  transition: width .12s linear;
  pointer-events: none;
}

@media (max-width: 480px) {
  .sd-back {
    top: max(14px, env(safe-area-inset-top));
    left: 14px;
  }
  .sd-info {
    right: 70px;
    bottom: 32px;
  }
  .sd-title {
    font-size: 16px;
  }
  .sd-side-btn {
    width: 42px;
    height: 42px;
  }
  .sd-side-btn svg {
    width: 18px;
    height: 18px;
  }
}

/* === Mobile Menu Toggle === */
.mobile-menu-btn {
  display: none;
  position: fixed;
  top: 12px;
  left: 12px;
  z-index: 200;
  width: 40px;
  height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-light);
  border-radius: 50%;
  color: var(--text-primary);
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: var(--transition);
}

.mobile-menu-btn:hover {
  background: var(--bg-card-hover);
}

@media (max-width: 768px) {
  .mobile-menu-btn {
    display: flex;
  }
}

/* === 追剧日历 - 近期更新预告 === */
.cal-preview {
  margin-bottom: 24px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 14px;
  padding: 16px;
}
.cal-preview-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 8px;
  margin-bottom: 4px;
}
.cal-preview-title {
  font-size: 16px;
  font-weight: 700;
  color: var(--text-title);
}
.cal-preview-note {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}
.cal-preview-group {
  margin-top: 10px;
}
.cal-preview-day {
  font-size: 14px;
  font-weight: 700;
  color: var(--text-title);
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 6px;
}
.cal-preview-day small {
  font-size: 12px;
  color: var(--text-muted);
  font-weight: 400;
}
.cal-preview-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 10px;
  border-radius: 8px;
  text-decoration: none;
}
.cal-preview-item:hover {
  background: var(--bg-card-hover);
}
.cal-preview-tag {
  flex: 0 0 auto;
  font-size: 11px;
  padding: 2px 8px;
  border-radius: 20px;
  font-weight: 600;
}
.cal-preview-tag.local {
  background: var(--bg-tag);
  color: var(--accent);
}
.cal-preview-tag.tencent {
  background: rgba(255, 159, 67, 0.16);
  color: #ffb36b;
}
body.light-theme .cal-preview-tag.tencent {
  background: #fff3e0;
  color: #c05621;
}
.cal-preview-tag.iqiyi {
  background: rgba(67, 153, 255, 0.16);
  color: #7cc0ff;
}
body.light-theme .cal-preview-tag.iqiyi {
  background: #e3f0ff;
  color: #1a73e8;
}
.cal-preview-tag.custom {
  background: var(--bg-tag);
  color: var(--text-secondary);
}
.cal-preview-tag.souju {
  background: rgba(167, 139, 250, 0.16);
  color: #c4b5fd;
}
body.light-theme .cal-preview-tag.souju {
  background: #f1ebff;
  color: #7c3aed;
}
.cal-preview-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-title);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cal-preview-name:hover {
  color: var(--accent-hover);
}
.cal-preview-remark {
  font-size: 12px;
  color: var(--text-muted);
  margin-left: auto;
  flex: 0 0 auto;
  white-space: nowrap;
}
@media (max-width: 640px) {
  .cal-preview-remark {
    display: none;
  }
  .cal-preview-title {
    font-size: 15px;
  }
}

/* ============================================
   功能完善补充样式
   ============================================ */

/* 首页：大家都在看 - 加载更多 */
.home-more-wrap {
  text-align: center;
  padding: 8px 0 44px;
}
.home-more-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  height: 40px;
  padding: 0 22px;
  border: 1px solid var(--border-light);
  border-radius: 20px;
  background: var(--bg-card);
  color: var(--text-secondary);
  font-size: 13px;
  font-family: inherit;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
}
.home-more-btn:hover {
  color: var(--text-primary);
  border-color: var(--accent);
  background: var(--bg-card-hover);
}
.home-more-btn svg {
  width: 16px;
  height: 16px;
}
.home-more-btn.loading {
  opacity: .6;
  pointer-events: none;
}

/* 语音输入：录音中状态 */
.voice-btn.listening {
  color: #fff;
  background: var(--accent);
  animation: voice-pulse 1.2s ease-in-out infinite;
}
@keyframes voice-pulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(230, 57, 70, .35); }
  50% { box-shadow: 0 0 0 8px rgba(230, 57, 70, 0); }
}
.voice-btn:disabled {
  opacity: .5;
  pointer-events: none;
}

/* 日历切换加载中动画 */
#calendarContent.cal-loading {
  opacity: .45;
  pointer-events: none;
  transition: opacity .2s;
}

/* 播放页：右上角快捷操作菜单 */
.quick-actions-wrap {
  position: relative;
  display: flex;
  align-items: center;
}
.quick-menu {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 50;
  min-width: 168px;
  padding: 6px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  box-shadow: 0 12px 32px rgba(0, 0, 0, .18);
  display: none;
}
.quick-menu.active {
  display: block;
}
.quick-menu-item {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 12px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: var(--text-primary);
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition: var(--transition);
}
.quick-menu-item:hover {
  background: var(--bg-card-hover);
}
.quick-menu-item svg {
  width: 17px;
  height: 17px;
  color: var(--text-secondary);
}

/* 换源弹层 */
.source-modal {
  width: 440px;
  max-width: 92vw;
}
.source-modal .modal-desc {
  margin: 2px 0 16px;
  font-size: 13px;
  color: var(--text-muted);
}
.source-list {
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 40vh;
  overflow-y: auto;
}
.source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border: 1px solid var(--border-light);
  border-radius: 10px;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}
.source-item:hover {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}
.source-item.current {
  border-color: var(--accent);
  color: var(--accent);
}
.source-item-name {
  font-weight: 600;
}
.source-item-badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: var(--bg-chip, rgba(255, 255, 255, .08));
  color: var(--text-secondary);
}
.source-item.current .source-item-badge {
  background: var(--accent);
  color: #fff;
}
.source-list-empty {
  margin: 8px 0 0;
  text-align: center;
  font-size: 13px;
  color: var(--text-muted);
  padding: 18px 0;
}

/* 短剧播放页：底部抽屉（选集 / 评论 / 换源） */
.sd-drawer-overlay {
  position: fixed;
  inset: 0;
  z-index: 90;
  background: rgba(0, 0, 0, .55);
  opacity: 0;
  transition: opacity .22s ease;
}
.sd-drawer-overlay.is-open {
  opacity: 1;
}
.sd-drawer {
  position: fixed;
  left: 50%;
  bottom: 0;
  z-index: 91;
  width: min(560px, 100vw);
  transform: translate(-50%, 100%);
  background: var(--bg-primary, #101014);
  border-radius: 18px 18px 0 0;
  box-shadow: 0 -8px 40px rgba(0, 0, 0, .35);
  transition: transform .24s ease;
  max-height: 72vh;
  display: flex;
  flex-direction: column;
}
.sd-drawer.is-open {
  transform: translate(-50%, 0);
}
.sd-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 16px 18px 12px;
}
.sd-drawer-title {
  font-size: 16px;
  font-weight: 700;
}
.sd-drawer-close {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  background: var(--bg-card-hover);
  color: var(--text-primary);
  cursor: pointer;
}
.sd-drawer-close svg {
  width: 18px;
  height: 18px;
}
.sd-drawer-body {
  padding: 0 18px 20px;
  overflow-y: auto;
  min-height: 0;
}
.sd-drawer-panel {
  display: none;
}
.sd-drawer-panel.is-active {
  display: block;
}
.sd-drawer-sub {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-muted);
}
.sd-ep-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 10px;
  padding-bottom: 8px;
}
.sd-ep-item {
  position: relative;
  aspect-ratio: 1 / 1;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 14px;
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
  transition: var(--transition);
}
.sd-ep-item:hover {
  border-color: var(--accent);
}
.sd-ep-item.is-current {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}
.sd-ep-item[data-sd-no-src] {
  opacity: .42;
}
.sd-ep-item[data-sd-no-src]::after {
  content: '';
  position: absolute;
  top: 5px;
  right: 5px;
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--text-muted);
}
.sd-ep-item[data-sd-no-src].is-current::after {
  background: rgba(255, 255, 255, .8);
}
.sd-stage-actions {
  display: flex;
  justify-content: center;
  gap: 10px;
  margin-top: 18px;
  flex-wrap: wrap;
}
.sd-stage-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 9px 16px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .28);
  background: rgba(255, 255, 255, .1);
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  cursor: pointer;
  text-decoration: none;
  transition: var(--transition);
  backdrop-filter: blur(6px);
}
.sd-stage-btn:hover {
  background: rgba(255, 255, 255, .22);
}
.sd-stage-btn svg {
  width: 16px;
  height: 16px;
}

/* 抽屉内的评论输入区更紧凑 */
.sd-drawer .discuss-compose {
  margin-bottom: 16px;
}

/* 短剧列表页：简介与全部短剧快速切换 */
.short-drama-desc {
  margin: 10px 0 0;
  font-size: 13px;
  line-height: 1.7;
  color: var(--text-secondary);
  max-width: 560px;
}
.short-drama-all {
  margin-top: 28px;
}
.short-drama-all-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: 14px;
}
.short-drama-all-head h3 {
  font-size: 16px;
  margin: 0;
}
.short-drama-all-count {
  font-size: 12px;
  color: var(--text-muted);
}
.short-drama-all-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 10px;
}
.short-drama-all-item {
  display: block;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 13px;
  text-align: center;
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: var(--transition);
}
.short-drama-all-item:hover {
  border-color: var(--accent);
  transform: translateY(-1px);
}
.short-drama-all-item.is-current {
  border-color: var(--accent);
  color: var(--accent);
  font-weight: 600;
}
@media (max-width: 640px) {
  .short-drama-all-grid {
    grid-template-columns: repeat(auto-fill, minmax(104px, 1fr));
  }
}

/* 历史页：管理模式 */
.history-item .history-checkbox {
  display: none;
  align-items: center;
  justify-content: center;
  padding: 0 4px 0 12px;
}
.history-managing .history-item .history-checkbox {
  display: flex;
}
.history-checkbox {
  position: relative;
  cursor: pointer;
}
.history-checkbox input {
  position: absolute;
  opacity: 0;
  pointer-events: none;
}
.history-checkbox span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  border-radius: 50%;
  border: 2px solid var(--text-muted);
  background: transparent;
  transition: var(--transition);
  box-sizing: border-box;
}
.history-checkbox span::after {
  content: '';
  width: 8px;
  height: 5px;
  border-left: 2px solid #fff;
  border-bottom: 2px solid #fff;
  transform: rotate(-45deg) scale(0);
  transition: transform .15s ease;
  margin-top: -2px;
}
.history-checkbox input:checked + span {
  background: var(--accent);
  border-color: var(--accent);
}
.history-checkbox input:checked + span::after {
  transform: rotate(-45deg) scale(1);
}
.history-managing .history-item {
  cursor: pointer;
}
.history-managing .history-item.is-selected {
  border-color: var(--accent);
  background: var(--bg-card-hover);
}
.history-item.is-selected .history-item-poster {
  opacity: .9;
}
.history-manage-bar {
  position: fixed;
  bottom: 18px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 70;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 10px 14px 10px 18px;
  border-radius: 16px;
  border: 1px solid var(--border-light);
  background: var(--bg-card);
  box-shadow: 0 12px 34px rgba(0, 0, 0, .28);
}
.history-manage-bar[hidden] {
  display: none;
}
.history-manage-count {
  font-size: 13px;
  color: var(--text-secondary);
}
.history-manage-actions {
  display: flex;
  gap: 8px;
}
.history-manage-actions .toolbar-btn:disabled {
  opacity: .4;
  cursor: not-allowed;
}

/* 侧栏：等级说明弹窗 */
.level-help-modal {
  width: 380px;
  max-width: 92vw;
}
.level-help-name {
  margin: 6px 0 0;
  font-size: 22px;
  font-weight: 800;
  color: var(--accent, #4ecdc4);
}
.level-help-stat {
  margin: 6px 0 0;
  font-size: 13px;
  color: var(--text-secondary);
}
.level-help-list {
  margin: 18px 0 0;
  padding: 0;
  list-style: none;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.level-help-list li {
  display: flex;
  align-items: flex-start;
  gap: 8px;
  font-size: 13px;
  line-height: 1.6;
  color: var(--text-secondary);
}
.level-help-list li::before {
  content: '';
  flex: 0 0 auto;
  width: 6px;
  height: 6px;
  margin-top: 7px;
  border-radius: 50%;
  background: var(--accent, #4ecdc4);
}

/* ============================================
   投屏（扫码/口令投屏 + 遥控器 + 后台查看）
   ============================================ */
.cast-panel-x {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.cast-device.cast-device-primary {
  border-color: color-mix(in srgb, var(--accent, #4ecdc4) 55%, transparent);
  background: color-mix(in srgb, var(--accent, #4ecdc4) 7%, var(--bg-surface, #141722));
}
.cast-device.cast-device-primary .cast-device-badge {
  background: var(--accent, #4ecdc4);
  color: #06201f;
}

.cast-live-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #22c55e;
  box-shadow: 0 0 0 3px rgba(34, 197, 94, 0.18);
  animation: castDotPulse 2s infinite;
}
@keyframes castDotPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: 0.45; }
}

.cast-wait-card {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 12px;
  padding: 20px 16px;
  border-radius: 12px;
  background: var(--bg-surface, #141722);
  border: 1px solid var(--border-light, rgba(255,255,255,0.1));
}
.cast-wait-title {
  margin: 0;
  font-size: 14px;
  font-weight: 900;
  color: var(--text-primary, #f2f3f7);
}
.cast-qr-canvas {
  width: 188px;
  height: 188px;
  border-radius: 10px;
  background: #fff;
  padding: 6px;
  box-sizing: border-box;
}
.cast-wait-code-box {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
}
.cast-wait-code-label {
  font-size: 11px;
  color: var(--text-muted, #9aa1b2);
}
.cast-wait-code-num {
  font-size: 32px;
  font-weight: 900;
  letter-spacing: 10px;
  padding: 6px 14px 6px 20px;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent, #4ecdc4) 10%, transparent);
  color: var(--accent, #4ecdc4);
  font-variant-numeric: tabular-nums;
}
.cast-wait-status {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12px;
  color: var(--text-muted, #9aa1b2);
}
.cast-wait-spinner {
  width: 14px;
  height: 14px;
  border: 2px solid color-mix(in srgb, var(--accent, #4ecdc4) 35%, transparent);
  border-top-color: var(--accent, #4ecdc4);
  border-radius: 50%;
  animation: castSpin 0.9s linear infinite;
}
@keyframes castSpin {
  to { transform: rotate(360deg); }
}
.cast-wait-hint {
  margin: 0;
  font-size: 11px;
  color: var(--text-muted, #9aa1b2);
  text-align: center;
}

.cast-stop-btn {
  width: 100%;
  margin-top: 4px;
  padding: 10px;
  border: 1px solid color-mix(in srgb, #f87171 40%, transparent);
  border-radius: 10px;
  background: color-mix(in srgb, #f87171 8%, transparent);
  color: #f87171;
  font-size: 13px;
  font-weight: 900;
  cursor: pointer;
  transition: var(--transition, 0.2s);
}
.cast-stop-btn:hover {
  background: color-mix(in srgb, #f87171 16%, transparent);
}

.cast-remote-card {
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding: 16px;
  border-radius: 12px;
  background: var(--bg-surface, #141722);
  border: 1px solid var(--border-light, rgba(255,255,255,0.1));
}
.cast-remote-head {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cast-remote-tv-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent, #4ecdc4) 14%, transparent);
  color: var(--accent, #4ecdc4);
}
.cast-remote-tv-icon svg {
  width: 20px;
  height: 20px;
}
.cast-remote-head-info {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.cast-remote-title {
  font-size: 14px;
  font-weight: 900;
  color: var(--text-primary, #f2f3f7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cast-remote-sub {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  color: var(--text-muted, #9aa1b2);
}

.cast-remote-actions {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.cast-remote-btn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 12px 6px;
  border: 1px solid var(--border-light, rgba(255,255,255,0.1));
  border-radius: 10px;
  background: color-mix(in srgb, var(--accent, #4ecdc4) 7%, var(--bg-surface, #141722));
  color: var(--text-primary, #f2f3f7);
  font-size: 12px;
  font-weight: 800;
  cursor: pointer;
  transition: var(--transition, 0.2s);
}
.cast-remote-btn:hover {
  border-color: var(--accent, #4ecdc4);
}
.cast-remote-btn svg {
  width: 18px;
  height: 18px;
}

.cast-ep-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  max-height: 180px;
  overflow-y: auto;
  padding: 4px;
  border: 1px solid var(--border-light, rgba(255,255,255,0.08));
  border-radius: 10px;
}
.cast-ep-item {
  padding: 7px 4px;
  border: 0;
  border-radius: 7px;
  background: color-mix(in srgb, var(--text-primary, #fff) 6%, transparent);
  color: var(--text-secondary, #b7bccb);
  font-size: 11px;
  font-weight: 700;
  cursor: pointer;
}
.cast-ep-item:hover {
  background: color-mix(in srgb, var(--accent, #4ecdc4) 18%, transparent);
}
.cast-ep-item.is-current {
  background: var(--accent, #4ecdc4);
  color: #06201f;
}

.cast-remote-hint {
  margin: 0;
  font-size: 11px;
  line-height: 1.6;
  color: var(--text-muted, #9aa1b2);
  text-align: center;
}

/* 投屏中横幅 */
.cast-active-banner {
  display: flex;
  align-items: center;
  gap: 10px;
  position: sticky;
  top: 0;
  z-index: 60;
  padding: 9px 14px;
  margin: 0 0 8px;
  background: color-mix(in srgb, var(--accent, #4ecdc4) 12%, var(--bg-surface, #10141d));
  border: 1px solid color-mix(in srgb, var(--accent, #4ecdc4) 40%, transparent);
  border-radius: 10px;
}
.cast-banner-tv {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  flex-shrink: 0;
  border-radius: 7px;
  background: color-mix(in srgb, var(--accent, #4ecdc4) 20%, transparent);
  color: var(--accent, #4ecdc4);
}
.cast-banner-tv svg {
  width: 15px;
  height: 15px;
}
.cast-banner-text {
  flex: 1;
  min-width: 0;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-primary, #f2f3f7);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cast-banner-spacer {
  display: none;
}
.cast-banner-btn {
  flex-shrink: 0;
  padding: 5px 10px;
  border: 0;
  border-radius: 7px;
  background: var(--accent, #4ecdc4);
  color: #06201f;
  font-size: 11px;
  font-weight: 900;
  cursor: pointer;
}
.cast-banner-btn.danger {
  background: color-mix(in srgb, #f87171 15%, transparent);
  color: #f87171;
  border: 1px solid color-mix(in srgb, #f87171 40%, transparent);
}

/* ============================================
   Chromecast 直投遥控
   ============================================ */
.cast-cc-card {
  gap: 14px;
}
.cast-cc-progress {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cast-cc-time {
  flex-shrink: 0;
  min-width: 44px;
  font-size: 11px;
  font-variant-numeric: tabular-nums;
  color: var(--text-muted, #9aa1b2);
  text-align: center;
}
.cast-cc-seek,
.cast-cc-volslider {
  -webkit-appearance: none;
  appearance: none;
  flex: 1;
  height: 4px;
  border-radius: 999px;
  background: color-mix(in srgb, var(--text-primary, #fff) 14%, transparent);
  outline: none;
  cursor: pointer;
}
.cast-cc-seek::-webkit-slider-thumb,
.cast-cc-volslider::-webkit-slider-thumb {
  -webkit-appearance: none;
  appearance: none;
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent, #4ecdc4);
  border: 0;
  cursor: pointer;
}
.cast-cc-seek::-moz-range-thumb,
.cast-cc-volslider::-moz-range-thumb {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--accent, #4ecdc4);
  border: 0;
  cursor: pointer;
}
.cast-cc-transport {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
}
.cast-cc-btn {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border: 1px solid var(--border-light, rgba(255,255,255,0.1));
  border-radius: 50%;
  background: color-mix(in srgb, var(--accent, #4ecdc4) 7%, var(--bg-surface, #141722));
  color: var(--text-primary, #f2f3f7);
  cursor: pointer;
  transition: var(--transition, 0.2s);
}
.cast-cc-btn:hover {
  border-color: var(--accent, #4ecdc4);
}
.cast-cc-btn svg {
  width: 18px;
  height: 18px;
}
.cast-cc-btn.cast-cc-play {
  width: 54px;
  height: 54px;
  background: var(--accent, #4ecdc4);
  color: #06201f;
  border-color: transparent;
}
.cast-cc-btn.cast-cc-play svg {
  width: 24px;
  height: 24px;
}
.cast-cc-volume {
  display: flex;
  align-items: center;
  gap: 10px;
}
.cast-cc-mute {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  flex-shrink: 0;
  border: 1px solid var(--border-light, rgba(255,255,255,0.1));
  border-radius: 8px;
  background: transparent;
  color: var(--text-secondary, #b7bccb);
  cursor: pointer;
}
.cast-cc-mute svg {
  width: 17px;
  height: 17px;
}
.cast-cc-epbtn {
  flex-shrink: 0;
  width: auto;
  padding: 8px 12px;
  flex-direction: row;
  gap: 6px;
}
