/* ================================================================
   CineMax — 沉浸式影视点播平台 · 完整样式系统
   ================================================================
   设计原则: 暗色沉浸 · 触控友好 · 性能优先 · 响应式
   ================================================================ */

/* ─── 1. 设计令牌 ─── */
:root {
  --brand: #e50914;
  --brand-hover: #ff1a25;
  --brand-glow: rgba(229, 9, 20, 0.35);
  --bg: #0a0a0f;
  --bg-soft: #12121a;
  --bg-elevated: #1a1a26;
  --bg-card: #1e1e2e;
  --bg-hover: #2a2a3e;
  --text: #ffffff;
  --text-secondary: #a0a0b0;
  --text-muted: #68687a;
  --border: #2a2a3a;
  --border-light: #3a3a4e;
  --radius-sm: 6px;
  --radius-md: 10px;
  --radius-lg: 16px;
  --ease: cubic-bezier(0.4, 0, 0.2, 1);
  --nav-h: 70px;
  --nav-h-scroll: 55px;
}

/* ─── 2. Reset & 基础 ─── */
*, *::before, *::after { margin: 0; padding: 0; box-sizing: border-box; }
html { scroll-behavior: smooth; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
  overscroll-behavior: none;
}
a { text-decoration: none; color: inherit; }
button { cursor: pointer; border: none; background: none; font: inherit; color: inherit; }
img { max-width: 100%; display: block; }
input, video { outline: none; font: inherit; }
ul { list-style: none; }

/* 键盘焦点环 */
:focus-visible { outline: 2px solid var(--brand); outline-offset: 2px; }

/* 滚动条 */
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #333; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #555; }

::selection { background: var(--brand); color: #fff; }

/* ─── 3. 关键帧动画 ─── */
@keyframes fadeIn { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes slideUp { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes skeleton-pulse { 0% { background: var(--bg-card); } 50% { background: var(--bg-hover); } 100% { background: var(--bg-card); } }
@keyframes cardIn { from { opacity: 0; transform: translateY(20px) scale(0.95); } to { opacity: 1; transform: translateY(0) scale(1); } }

/* ─── 图片加载失败兜底 ─── */
img { background: var(--bg-card); }
.movie-card-poster, .continue-card-img, .search-result-poster, .detail-poster { background: linear-gradient(135deg, var(--bg-card) 0%, var(--bg-hover) 100%); }

/* ─── 4. 导航栏 ─── */
#navbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: var(--nav-h);
  z-index: 1000;
  transition: height 0.3s var(--ease), background 0.3s var(--ease);
  background: transparent;
}
#navbar.scrolled {
  height: var(--nav-h-scroll);
  background: rgba(10, 10, 15, 0.92);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
  box-shadow: 0 2px 24px rgba(0,0,0,0.5);
}
.nav-container {
  max-width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  gap: 24px;
  padding: 0 clamp(16px, 3vw, 48px);
}
.logo {
  font-size: clamp(20px, 2.5vw, 28px);
  font-weight: 800;
  color: var(--brand);
  cursor: pointer;
  letter-spacing: -0.5px;
  flex-shrink: 0;
  transition: font-size 0.3s var(--ease);
}
.scrolled .logo { font-size: clamp(17px, 2vw, 22px); }

.nav-links { display: flex; gap: 20px; }
.nav-link {
  font-size: 14px; font-weight: 500;
  color: var(--text-secondary);
  padding: 8px 0;
  position: relative;
  transition: color 0.2s;
  min-height: 44px;
  display: flex; align-items: center;
}
.nav-link::after {
  content: '';
  position: absolute; bottom: 0; left: 0;
  width: 0; height: 2px;
  background: var(--brand);
  transition: width 0.3s var(--ease);
}
.nav-link.active, .nav-link:hover { color: var(--text); }
.nav-link.active::after { width: 100%; }

.nav-actions { margin-left: auto; display: flex; align-items: center; gap: 8px; }
.nav-icon-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-secondary);
  transition: background 0.2s, color 0.2s;
}
.nav-icon-btn:active { background: rgba(255,255,255,0.1); color: var(--text); }

/* 汉堡菜单 */
.hamburger {
  display: none;
  width: 44px; height: 44px;
  flex-direction: column; align-items: center; justify-content: center;
  gap: 5px;
}
.hamburger span {
  display: block;
  width: 20px; height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform 0.3s var(--ease), opacity 0.3s var(--ease);
}
.hamburger.active span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.hamburger.active span:nth-child(2) { opacity: 0; }
.hamburger.active span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }

.mobile-menu {
  position: absolute; top: 100%; left: 0; right: 0;
  background: rgba(10, 10, 15, 0.98);
  backdrop-filter: blur(12px);
  padding: 8px 24px 16px;
  display: none;
  flex-direction: column;
  border-top: 1px solid var(--border);
}
.mobile-menu.open { display: flex; }
.mobile-menu .nav-link { font-size: 16px; padding: 12px 0; min-height: 48px; }

/* 底部导航（桌面隐藏） */
.bottom-nav { display: none; }

/* ─── 5. 英雄轮播 ─── */
.hero {
  position: relative;
  width: 100%;
  height: 85vh;
  min-height: 440px;
  max-height: 900px;
  overflow: hidden;
  user-select: none;
  -webkit-user-select: none;
}
.hero-backdrop {
  position: absolute; inset: 0;
  background-size: cover; background-position: center;
  transition: background-image 0.6s ease;
  will-change: background-image;
}
.hero-backdrop::after {
  content: '';
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, transparent 50%),
              linear-gradient(90deg, rgba(10,10,15,0.5) 0%, transparent 55%);
}
.hero-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, transparent 40%);
  z-index: 1;
  pointer-events: none;
}
.hero-content {
  position: relative; z-index: 2;
  max-width: 1440px; margin: 0 auto;
  padding: 0 clamp(16px, 4vw, 60px);
  height: 100%;
  display: flex; flex-direction: column; justify-content: center;
  padding-bottom: 80px;
}
.hero-badge {
  display: inline-flex; align-items: center;
  background: var(--brand); color: #fff;
  font-size: 11px; font-weight: 700; text-transform: uppercase;
  letter-spacing: 2px; padding: 4px 12px; border-radius: 4px;
  margin-bottom: 14px; width: fit-content; height: 26px;
}
.hero-title {
  font-size: clamp(28px, 5vw, 64px);
  font-weight: 800; line-height: 1.1;
  text-shadow: 0 4px 20px rgba(0,0,0,0.5);
  max-width: 700px; margin-bottom: 12px;
}
.hero-meta {
  display: flex; align-items: center; gap: 14px;
  font-size: 14px; color: var(--text-secondary);
  margin-bottom: 14px; flex-wrap: wrap;
}
.hero-meta .rating { color: #f5c518; font-weight: 600; }
.hero-meta .tag {
  background: rgba(255,255,255,0.1);
  padding: 2px 10px; border-radius: 4px; font-size: 12px;
}
.hero-desc {
  font-size: clamp(13px, 1.2vw, 17px);
  color: var(--text-secondary);
  max-width: 520px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical;
  overflow: hidden; margin-bottom: 24px;
}
.hero-buttons { display: flex; gap: 12px; flex-wrap: wrap; }

/* 通用按钮 */
.btn {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 12px 28px; border-radius: var(--radius-sm);
  font-size: 15px; font-weight: 600;
  transition: transform 0.2s, background 0.2s, box-shadow 0.2s;
  min-height: 44px;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:active { transform: scale(0.96); }
.btn-secondary {
  background: rgba(255,255,255,0.08); color: #fff;
  border: 1px solid rgba(255,255,255,0.15);
}
.btn-secondary:active { background: rgba(255,255,255,0.16); transform: scale(0.96); }
.btn-sm { padding: 8px 18px; font-size: 13px; min-height: 40px; }

/* 轮播导航（箭头 + 指示点） */
.hero-nav {
  position: absolute;
  bottom: 24px; left: 50%; transform: translateX(-50%);
  z-index: 3;
  display: flex; align-items: center; gap: 16px;
}
.hero-dots { display: flex; gap: 10px; }
.hero-dot {
  width: 12px; height: 12px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  cursor: pointer;
  transition: background 0.2s, transform 0.2s;
  padding: 8px; background-clip: content-box;
}
.hero-dot:active { transform: scale(1.3); }
.hero-dot.active { background: var(--brand); box-shadow: 0 0 12px var(--brand-glow); }
.hero-arrow {
  width: 44px; height: 44px;
  border-radius: 50%;
  background: rgba(255,255,255,0.06);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  font-size: 24px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, transform 0.2s;
}
.hero-arrow:active { background: var(--brand); border-color: var(--brand); transform: scale(0.92); }

/* ─── 6. 分类区域 ─── */
.categories {
  max-width: 1440px;
  margin: -32px auto 0;
  padding: 0 clamp(12px, 3vw, 48px) 48px;
  position: relative; z-index: 5;
}
.category-group { margin-bottom: 40px; }
.category-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 14px;
}
.category-title {
  font-size: clamp(17px, 1.8vw, 22px);
  font-weight: 700;
  padding-left: 12px;
  position: relative;
}
.category-title::before {
  content: '';
  position: absolute; left: 0; top: 3px;
  width: 3px; height: calc(100% - 6px);
  background: var(--brand); border-radius: 2px;
}

/* 分类左右滚动按钮 */
.category-controls { display: flex; gap: 6px; flex-shrink: 0; }
.cat-scroll-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  background: var(--bg-card);
  border: 1px solid var(--border);
  color: var(--text-secondary);
  font-size: 20px;
  display: flex; align-items: center; justify-content: center;
  transition: background 0.2s, border-color 0.2s;
}
.cat-scroll-btn:active { background: var(--bg-hover); border-color: var(--border-light); color: var(--text); }

/* 影片行 — CSS Scroll Snap */
.movie-row {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding: 4px 2px 12px;
  scrollbar-width: none;
}
.movie-row::-webkit-scrollbar { display: none; }
.movie-row > * { scroll-snap-align: start; }

/* 影片卡片 */
.movie-card {
  flex: 0 0 clamp(130px, 14vw, 200px);
  cursor: pointer;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  transition: transform 0.3s ease;
  animation: cardIn 0.4s ease both;
  animation-delay: calc(var(--i, 0) * 60ms);
}
.movie-card:hover { transform: scale(1.05); }
.movie-card-poster {
  width: clamp(130px, 14vw, 200px);
  height: clamp(185px, 20vw, 280px);
  object-fit: cover;
  border-radius: var(--radius-md);
  display: block;
  background: var(--bg-card);
}
.movie-card-overlay {
  position: absolute; bottom: 0; left: 0; right: 0;
  padding: 40px 10px 10px;
  background: linear-gradient(transparent, rgba(0,0,0,0.92));
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
}
.movie-card:hover .movie-card-overlay { opacity: 1; }
@media (hover: none) { .movie-card:hover { transform: none; } .movie-card:active { transform: scale(0.96); } .movie-card-overlay { opacity: 1; background: linear-gradient(transparent 30%, rgba(0,0,0,0.92)); } }

.movie-card-title {
  font-size: clamp(11px, 1vw, 13px);
  font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.movie-card-meta { font-size: 11px; color: var(--text-secondary); display: flex; gap: 8px; }
.movie-card-rating { color: #f5c518; font-weight: 600; }

/* 卡片 + 按钮（加入片单） */
.movie-card-btn {
  position: absolute; top: 6px; right: 6px;
  width: 36px; height: 36px;
  border-radius: 50%;
  background: rgba(0,0,0,0.5);
  color: #fff;
  display: flex; align-items: center; justify-content: center;
  transition: opacity 0.2s, background 0.2s;
  border: 1px solid rgba(255,255,255,0.1);
  z-index: 2;
  opacity: 0;
}
.movie-card:hover .movie-card-btn { opacity: 1; }
.movie-card-btn.in-list { opacity: 1; background: var(--brand); border-color: var(--brand); }
@media (hover: none) { .movie-card-btn { opacity: 1; } }

/* 骨架屏（Skeleton） */
.skeleton-card {
  flex: 0 0 clamp(130px, 14vw, 200px);
  height: clamp(185px, 20vw, 280px);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  animation: skeleton-pulse 1.5s ease-in-out infinite;
}

/* ─── 7. 继续观看 ─── */
.continue-watching { display: none; margin-bottom: 40px; }
.continue-watching.has-items { display: block; }
.continue-row {
  display: flex; gap: 12px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  padding: 4px 2px 12px;
  scrollbar-width: none;
}
.continue-row::-webkit-scrollbar { display: none; }
.continue-row > * { scroll-snap-align: start; }
.continue-card {
  flex: 0 0 clamp(220px, 22vw, 300px);
  cursor: pointer;
  border-radius: var(--radius-md);
  overflow: hidden;
  position: relative;
  transition: transform 0.2s;
  animation: cardIn 0.4s ease both;
  animation-delay: calc(var(--i, 0) * 80ms);
}
.continue-card:active { transform: scale(0.97); }
.continue-card-img { width: 100%; aspect-ratio: 16/9; object-fit: cover; background: var(--bg-card); }
.continue-card-overlay {
  position: absolute; inset: 0;
  background: linear-gradient(transparent 55%, rgba(0,0,0,0.92));
  display: flex; flex-direction: column; justify-content: flex-end;
  padding: 12px;
}
.continue-card-title { font-size: 14px; font-weight: 600; margin-bottom: 6px; }
.continue-card-progress { height: 3px; background: rgba(255,255,255,0.2); border-radius: 2px; overflow: hidden; }
.continue-card-progress-fill { height: 100%; background: var(--brand); border-radius: 2px; }
.continue-card .resume-badge {
  position: absolute; top: 8px; left: 8px;
  background: rgba(0,0,0,0.7);
  font-size: 11px; padding: 3px 8px; border-radius: 4px;
  color: var(--text-secondary);
}

/* ─── 8. 详情页 ─── */
#page-detail { min-height: 100dvh; padding-top: var(--nav-h); position: relative; }
.detail-backdrop {
  position: absolute; top: 0; left: 0; right: 0;
  height: 60vh;
  background-size: cover; background-position: center;
  z-index: 0;
  pointer-events: none;
}
.detail-backdrop-gradient {
  position: absolute; inset: 0;
  background: linear-gradient(to top, var(--bg) 0%, transparent 60%),
              linear-gradient(90deg, rgba(10,10,15,0.4), transparent 55%);
}
.detail-content {
  position: relative; z-index: 1;
  max-width: 1200px; margin: 0 auto;
  padding: 100px clamp(16px, 3vw, 48px) 60px;
}
.detail-back-btn {
  display: inline-flex; align-items: center; gap: 6px;
  color: var(--text-secondary); font-size: 14px; font-weight: 500;
  margin-bottom: 20px; padding: 8px 14px; border-radius: var(--radius-sm);
  background: rgba(0,0,0,0.4); border: 1px solid var(--border);
  min-height: 44px;
  transition: background 0.2s;
}
.detail-back-btn:active { background: rgba(255,255,255,0.08); }
.detail-layout { display: flex; gap: clamp(20px, 3vw, 48px); }
.detail-poster {
  width: clamp(140px, 20vw, 300px);
  aspect-ratio: 2/3;
  object-fit: cover; border-radius: var(--radius-lg);
  flex-shrink: 0;
  box-shadow: 0 8px 40px rgba(0,0,0,0.6);
  background: var(--bg-card);
}
.detail-info { flex: 1; }
.detail-info h1 { font-size: clamp(24px, 3vw, 36px); font-weight: 800; margin-bottom: 10px; }
.detail-meta { display: flex; gap: 12px; align-items: center; margin-bottom: 14px; flex-wrap: wrap; font-size: 14px; color: var(--text-secondary); }
.detail-meta .rating { color: #f5c518; font-weight: 600; }
.detail-genre-tag { background: rgba(255,255,255,0.08); padding: 4px 12px; border-radius: 20px; font-size: 12px; }
.detail-desc { font-size: clamp(14px, 1.1vw, 16px); line-height: 1.7; color: var(--text-secondary); margin-bottom: 24px; }
.detail-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-bottom: 28px; }
.detail-episodes h3 { font-size: 18px; font-weight: 600; margin-bottom: 12px; }
.episode-list { display: flex; flex-direction: column; gap: 6px; }
.episode-item {
  display: flex; align-items: center;
  padding: 12px 16px; min-height: 48px;
  background: var(--bg-card);
  border-radius: var(--radius-sm);
  cursor: pointer;
  transition: background 0.2s;
  border: 1px solid transparent;
}
.episode-item:active { background: var(--bg-hover); }
.episode-item .ep-num { font-size: 13px; color: var(--text-muted); width: 44px; flex-shrink: 0; }
.episode-item .ep-title { flex: 1; font-size: 14px; font-weight: 500; }
.episode-item .ep-play { width: 36px; height: 36px; border-radius: 50%; background: rgba(255,255,255,0.06); display: flex; align-items: center; justify-content: center; color: var(--text-secondary); flex-shrink: 0; }

/* ─── 9. 播放器 ─── */
#page-player {
  position: fixed; inset: 0;
  z-index: 2000;
  background: #000;
  display: none;
  height: 100dvh;
}
#page-player.active { display: flex; }
.player-container { flex: 1; display: flex; min-height: 0; }
.player-main { flex: 1; display: flex; position: relative; min-width: 0; }

.player-video-wrapper {
  flex: 1; display: flex; align-items: center; justify-content: center;
  background: #000; position: relative;
}
.video-player { width: 100%; height: 100%; object-fit: contain; cursor: pointer; }

/* 播放器返回按钮 */
.player-back-btn {
  position: absolute; top: 16px; left: 16px;
  z-index: 15;
  display: flex; align-items: center; gap: 6px;
  padding: 8px 16px;
  background: rgba(0,0,0,0.5);
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: 8px;
  color: #fff; font-size: 14px; font-weight: 500;
  min-height: 44px;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  transition: background 0.2s;
}
.player-back-btn:active { background: rgba(229,9,20,0.8); }

/* 播放器控制栏 */
.player-controls {
  position: absolute; bottom: 0; left: 0; right: 0;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  padding: 60px 16px 16px;
  opacity: 0;
  transition: opacity 0.3s ease;
  z-index: 10;
  pointer-events: none;
  backdrop-filter: blur(4px);
}
.player-video-wrapper.show-controls .player-controls { opacity: 1; pointer-events: auto; }

/* 播放速度控制 */
.speed-control { position: relative; }
.speed-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
  font-size: 13px; font-weight: 700;
  transition: background 0.2s;
}
.speed-btn:active { background: rgba(255,255,255,0.12); }
.speed-menu {
  position: absolute;
  bottom: 48px; left: 50%;
  transform: translateX(-50%);
  background: rgba(20,20,30,0.95);
  backdrop-filter: blur(8px);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 4px;
  display: none;
  flex-direction: column;
  gap: 2px;
  min-width: 64px;
  z-index: 20;
}
.speed-menu.open { display: flex; }
.speed-option {
  padding: 8px 16px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: 4px;
  text-align: center;
  transition: background 0.15s, color 0.15s;
  min-height: 36px;
  display: flex; align-items: center; justify-content: center;
}
.speed-option:active { background: var(--bg-hover); }
.speed-option.active { color: var(--brand); font-weight: 700; }

/* 进度条区域 */
.controls-progress {
  position: relative; height: 24px;
  display: flex; align-items: center;
  cursor: pointer; margin-bottom: 4px;
  padding: 10px 0;
}
.progress-track {
  width: 100%; height: 4px;
  background: rgba(255,255,255,0.2);
  border-radius: 2px; position: relative;
  transition: height 0.15s;
}
.controls-progress:hover .progress-track, .controls-progress:active .progress-track { height: 6px; }
.progress-fill { height: 100%; background: var(--brand); border-radius: 2px; position: relative; will-change: width; }
.progress-fill::after {
  content: ''; position: absolute; right: -5px; top: -4px;
  width: 12px; height: 12px; background: var(--brand);
  border-radius: 50%; opacity: 0;
}
.controls-progress:hover .progress-fill::after { opacity: 1; }
.progress-hover { position: absolute; top: 0; left: 0; height: 100%; background: rgba(255,255,255,0.25); border-radius: 2px; pointer-events: none; opacity: 0; }
.controls-progress:hover .progress-hover { opacity: 1; }
.progress-tooltip {
  position: absolute; bottom: 28px;
  background: rgba(0,0,0,0.85); color: #fff;
  font-size: 12px; padding: 4px 10px; border-radius: 4px;
  white-space: nowrap; pointer-events: none;
  opacity: 0; transform: translateX(-50%);
}
.controls-progress:hover .progress-tooltip { opacity: 1; }

#progressBar {
  position: absolute; inset: 0;
  opacity: 0; cursor: pointer; width: 100%;
  z-index: 2; height: 100%;
}

/* 控制栏底部 */
.controls-bottom { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.controls-left, .controls-right { display: flex; align-items: center; gap: 10px; }

.ctrl-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  color: #fff; flex-shrink: 0;
  transition: background 0.2s;
}
.ctrl-btn:active { background: rgba(255,255,255,0.12); }
.switch-btn { color: var(--brand); font-size: 12px; }

.time-display {
  font-size: 13px; color: var(--text-secondary);
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* 音量滑块 */
.volume-slider {
  width: 72px; height: 4px;
  -webkit-appearance: none; appearance: none;
  background: rgba(255,255,255,0.25);
  border-radius: 2px; cursor: pointer;
}
.volume-slider::-webkit-slider-thumb {
  -webkit-appearance: none;
  width: 14px; height: 14px;
  border-radius: 50%; background: #fff;
  cursor: pointer;
}

/* 中央播放按钮 */
.player-center-play {
  position: absolute; top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  width: 80px; height: 80px;
  border-radius: 50%;
  background: rgba(229, 9, 20, 0.85);
  display: flex; align-items: center; justify-content: center;
  color: #fff; cursor: pointer;
  transition: opacity 0.3s, transform 0.3s;
  z-index: 5;
  border: 3px solid rgba(255,255,255,0.12);
}
.player-center-play:active { transform: translate(-50%, -50%) scale(0.92); }
.player-center-play.hidden { opacity: 0; pointer-events: none; }

/* 自动连播倒计时 */
.autoplay-overlay {
  position: absolute; top: 0; left: 0; right: 0;
  padding: 16px;
  background: linear-gradient(180deg, rgba(0,0,0,0.85), transparent);
  z-index: 8; display: none;
}
.autoplay-overlay.visible { display: block; }
.autoplay-content { display: flex; align-items: center; gap: 14px; }
.autoplay-content p { font-size: 14px; color: var(--text-secondary); }
.autoplay-content #countdownNum { color: #fff; font-weight: 700; }

/* ─── 10. 选集侧边栏 ─── */
.player-sidebar {
  width: 320px;
  background: var(--bg);
  border-left: 1px solid var(--border);
  display: flex; flex-direction: column;
  flex-shrink: 0;
  overflow: hidden;
}
.sidebar-header { display: flex; align-items: center; justify-content: space-between; padding: 14px 18px; border-bottom: 1px solid var(--border); }
.sidebar-header h3 { font-size: 15px; font-weight: 600; }
.sidebar-close { width: 44px; height: 44px; display: none; align-items: center; justify-content: center; font-size: 24px; color: var(--text-secondary); }
.sidebar-close:active { background: var(--bg-card); color: var(--text); border-radius: 50%; }
.sidebar-episodes { flex: 1; overflow-y: auto; padding: 8px 12px; }
.ep-sidebar-item {
  display: flex; align-items: center; gap: 10px;
  padding: 12px; min-height: 48px;
  border-radius: var(--radius-sm); cursor: pointer;
  transition: background 0.2s;
  border-left: 3px solid transparent;
}
.ep-sidebar-item:active { background: var(--bg-card); }
.ep-sidebar-item.active { background: var(--bg-hover); border-left-color: var(--brand); }
.ep-sidebar-item .ep-sidebar-num { font-size: 13px; color: var(--text-muted); width: 28px; text-align: center; flex-shrink: 0; }
.ep-sidebar-item .ep-sidebar-title { font-size: 13px; font-weight: 500; flex: 1; }
.ep-sidebar-item.active .ep-sidebar-title { color: var(--brand); }

/* ─── 11. 海报预览灯箱 ─── */
.poster-lightbox {
  display: none;
  position: fixed; inset: 0;
  z-index: 3000;
  background: rgba(0,0,0,0.9);
  align-items: center; justify-content: center;
  backdrop-filter: blur(8px);
  cursor: zoom-out;
}
.poster-lightbox.open { display: flex; }
.lightbox-close {
  position: absolute; top: 20px; right: 20px;
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(255,255,255,0.08);
  color: #fff;
  font-size: 32px;
  display: flex; align-items: center; justify-content: center;
  z-index: 3001;
  transition: background 0.2s;
}
.lightbox-close:active { background: rgba(229,9,20,0.8); }
.lightbox-img {
  max-width: 90vw;
  max-height: 90vh;
  border-radius: var(--radius-lg);
  box-shadow: 0 20px 60px rgba(0,0,0,0.8);
  object-fit: contain;
}

/* ─── 12. 搜索浮层 ─── */
.search-overlay {
  position: fixed; inset: 0;
  z-index: 1500;
  background: rgba(10,10,15,0.98);
  display: none; flex-direction: column;
  height: 100dvh;
  padding-top: 80px;
}
.search-overlay.open { display: flex; }
.search-header { max-width: 720px; margin: 0 auto; width: 100%; padding: 0 20px; }
.search-input-wrapper { position: relative; display: flex; align-items: center; }
.search-input-icon { position: absolute; left: 16px; color: var(--text-muted); pointer-events: none; }
.search-input {
  width: 100%; height: 56px;
  background: var(--bg-soft);
  border: 2px solid var(--border);
  border-radius: var(--radius-md);
  color: var(--text); font-size: 18px;
  padding: 0 52px 0 52px;
  transition: border-color 0.2s;
}
.search-input:focus { border-color: var(--brand); }
.search-input::placeholder { color: var(--text-muted); }
.search-close {
  position: absolute; right: 8px;
  width: 44px; height: 44px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--text-secondary);
  border-radius: 50%;
}
.search-close:active { background: var(--bg-card); color: var(--text); }
.search-tags { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.search-tag {
  padding: 8px 18px;
  background: var(--bg-card);
  border: 1px solid var(--border);
  border-radius: 20px;
  font-size: 13px; font-weight: 500;
  color: var(--text-secondary);
  cursor: pointer;
  min-height: 44px;
  display: flex; align-items: center;
  transition: border-color 0.2s, background 0.2s;
}
.search-tag:active { border-color: var(--brand); color: var(--text); }
.search-tag.active { background: var(--brand); border-color: var(--brand); color: #fff; }

.search-results { max-width: 720px; margin: 20px auto 0; width: 100%; padding: 0 20px; flex: 1; overflow-y: auto; display: none; }
.search-results.has-results { display: block; }
.search-result-item { display: flex; gap: 14px; padding: 12px 14px; min-height: 60px; border-radius: var(--radius-md); cursor: pointer; transition: background 0.2s; }
.search-result-item:active { background: var(--bg-card); }
.search-result-poster { width: 52px; height: 72px; object-fit: cover; border-radius: var(--radius-sm); flex-shrink: 0; background: var(--bg-card); }
.search-result-info { flex: 1; min-width: 0; }
.search-result-title { font-size: 15px; font-weight: 600; margin-bottom: 2px; }
.search-result-title .highlight { background: rgba(229,9,20,0.35); color: #fff; padding: 0 2px; border-radius: 2px; }
.search-result-meta { font-size: 12px; color: var(--text-muted); display: flex; gap: 8px; }
.search-result-desc { font-size: 13px; color: var(--text-secondary); margin-top: 3px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.search-empty { max-width: 720px; margin: 40px auto 0; padding: 0 20px; text-align: center; color: var(--text-muted); display: flex; flex-direction: column; align-items: center; gap: 10px; }
.search-empty p { font-size: 15px; }

/* ─── 12. 我的片单 ─── */
#page-list { min-height: 100dvh; padding: calc(var(--nav-h) + 24px) clamp(16px, 3vw, 48px) 40px; max-width: 1440px; margin: 0 auto; }
#page-list h1 { font-size: 26px; font-weight: 700; margin-bottom: 28px; }
.list-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 16px; }
.list-empty { grid-column: 1 / -1; display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 80px 20px; text-align: center; color: var(--text-muted); }
.list-empty svg { margin-bottom: 16px; opacity: 0.25; }
.list-empty h2 { font-size: 20px; font-weight: 600; color: var(--text-secondary); margin-bottom: 6px; }
.list-empty p { font-size: 14px; margin-bottom: 20px; }

/* ─── 13. Toast 提示 ─── */
.toast-container { position: fixed; bottom: 24px; right: 24px; z-index: 9999; display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.toast {
  background: rgba(30,30,46,0.95);
  backdrop-filter: blur(8px);
  color: #fff;
  padding: 12px 20px;
  border-radius: var(--radius-md);
  font-size: 14px; font-weight: 500;
  box-shadow: 0 8px 30px rgba(0,0,0,0.5);
  border: 1px solid var(--border);
  border-left: 3px solid var(--brand);
  animation: slideUp 0.25s var(--ease);
  max-width: 320px;
  pointer-events: auto;
}
.toast.removing { opacity: 0; transform: translateY(12px); transition: all 0.25s; }

/* ─── 14. 页脚 ─── */
.footer { margin-top: 24px; padding: 32px 0; border-top: 1px solid var(--border); }
.footer-content { max-width: 1440px; margin: 0 auto; padding: 0 clamp(16px, 3vw, 48px); display: flex; flex-direction: column; align-items: center; gap: 16px; text-align: center; }
.footer-logo { font-size: 20px; font-weight: 800; color: var(--brand); }
.footer-links { display: flex; gap: 20px; flex-wrap: wrap; justify-content: center; }
.footer-links a { font-size: 13px; color: var(--text-muted); }
.footer-links a:active { color: var(--text); }
.footer-social { display: flex; gap: 12px; }
.social-icon { width: 36px; height: 36px; border-radius: 50%; background: var(--bg-card); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.social-icon:active { background: var(--brand); color: #fff; }
.footer-copy { font-size: 12px; color: var(--text-muted); }

/* ─── 15. 页面切换 ─── */
.page { display: none; }
.page.active { display: block; animation: fadeIn 0.35s var(--ease); }
#page-player.active { display: flex; animation: none; }

/* ─── 16. 响应式 ─── */

/* 平板 */
@media (max-width: 1024px) {
  .detail-layout { flex-direction: column; }
  .detail-poster { width: 160px; }
  .player-sidebar { width: 280px; }
  /* 触控设备禁用 hover */
  .movie-card:hover { transform: none; }
  .movie-card:active { transform: scale(0.96); }
  .search-result-item:hover { background: transparent; }
}

/* 手机 */
@media (max-width: 768px) {
  :root { --nav-h: 60px; }

  .nav-links { display: none; }
  .hamburger { display: flex; }

  /* 底部导航栏（移动端） */
  .bottom-nav {
    display: flex;
    position: fixed;
    bottom: 0; left: 0; right: 0;
    height: 60px;
    background: rgba(10,10,15,0.95);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    border-top: 1px solid var(--border);
    z-index: 1500;
    justify-content: space-around;
    align-items: center;
    padding-bottom: env(safe-area-inset-bottom, 0);
  }
  .bottom-nav-item {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    padding: 4px 12px;
    min-width: 56px;
    min-height: 44px;
    color: var(--text-muted);
    transition: color 0.2s;
    font-size: 10px;
    font-weight: 500;
  }
  .bottom-nav-item.active { color: var(--brand); }
  .bottom-nav-item svg { transition: color 0.2s; }

  /* 页面底部留出导航栏空间 */
  .categories { padding-bottom: 80px; }
  #page-list { padding-bottom: 80px; }

  .hero { height: 60vh; min-height: 380px; }
  .hero-content { padding-bottom: 60px; }
  .hero-nav { bottom: 16px; gap: 10px; }

  .category-controls { display: none; } /* 手机上隐藏滚动按钮，用触摸滑动 */

  #page-detail { padding-top: var(--nav-h); }
  .detail-content { padding-top: 70px; }
  #page-list { padding: calc(var(--nav-h) + 16px) 16px 32px; }

  /* 选集侧边栏 → 底部 Drawer */
  .player-sidebar {
    position: fixed; bottom: 0; left: 0; right: 0;
    width: 100%; max-height: 60dvh;
    z-index: 20;
    transform: translateY(100%);
    transition: transform 0.35s var(--ease);
    border-left: none;
    border-radius: var(--radius-lg) var(--radius-lg) 0 0;
    border-top: 1px solid var(--border);
  }
  .player-sidebar.open { transform: translateY(0); }
  .player-sidebar::before {
    content: '';
    position: absolute; top: 8px; left: 50%; transform: translateX(-50%);
    width: 32px; height: 4px;
    background: var(--text-muted); border-radius: 2px;
    z-index: 3;
  }
  .sidebar-close { display: flex; }

  .player-main { flex-direction: column; }
  .player-video-wrapper { flex: 1; min-height: 0; }

  .search-input { font-size: 16px; height: 48px; }
  .volume-slider { width: 56px; }
  .list-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 12px; }
}

/* 小屏手机 */
@media (max-width: 480px) {
  .hero { height: 50vh; min-height: 320px; }
  .list-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .detail-poster { width: 120px; }
}

/* 宽屏桌面 */
@media (min-width: 1920px) {
  .hero { height: 75vh; }
  .categories { max-width: 1600px; }
}
