/* ===== 全局重置 ===== */
*, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }

:root {
  --bg: #141414;
  --bg2: #1a1a1a;
  --bg3: #222;
  --red: #e50914;
  --red-hover: #f40612;
  --text: #e5e5e5;
  --text-muted: #999;
  --card-w: 180px;
  --card-h: 270px;
  --radius: 6px;
  --nav-h: 68px;
}

html { scroll-behavior: smooth; }

body {
  background: var(--bg);
  color: var(--text);
  font-family: 'Noto Sans SC', 'PingFang SC', sans-serif;
  min-height: 100vh;
  overflow-x: hidden;
}

/* ===== 导航栏 ===== */
.navbar {
  position: fixed;
  top: 0; left: 0; right: 0;
  height: var(--nav-h);
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 4%;
  z-index: 1000;
  transition: background 0.3s;
  background: linear-gradient(to bottom, rgba(0,0,0,0.9) 0%, transparent 100%);
}
.navbar.scrolled { background: rgba(20,20,20,0.97); }

.nav-left { display: flex; align-items: center; gap: 32px; }

.logo {
  font-size: 1.6rem;
  font-weight: 700;
  color: var(--red);
  letter-spacing: -0.5px;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  list-style: none;
  gap: 20px;
}
.nav-links a {
  color: var(--text-muted);
  text-decoration: none;
  font-size: 0.9rem;
  transition: color 0.2s;
}
.nav-links a:hover, .nav-links a.active { color: #fff; }

.nav-right { display: flex; align-items: center; gap: 16px; }

.search-box {
  display: flex;
  align-items: center;
  background: rgba(255,255,255,0.1);
  border: 1px solid rgba(255,255,255,0.2);
  border-radius: 4px;
  overflow: hidden;
  transition: background 0.2s;
}
.search-box:focus-within { background: rgba(255,255,255,0.15); }
.search-box input {
  background: none;
  border: none;
  outline: none;
  color: #fff;
  padding: 8px 12px;
  font-size: 0.9rem;
  width: 200px;
}
.search-box input::placeholder { color: var(--text-muted); }
.search-box button {
  background: none;
  border: none;
  color: var(--text-muted);
  padding: 8px 12px;
  cursor: pointer;
  font-size: 1rem;
  transition: color 0.2s;
}
.search-box button:hover { color: #fff; }

.mobile-search-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
  padding: 4px 8px;
}

.mobile-search-btn:hover { color: #fff; }

/* ===== 移动端菜单 ===== */
.mobile-menu-btn {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.4rem;
  cursor: pointer;
  transition: color 0.2s;
  padding: 4px 8px;
  margin-right: 8px;
}

.mobile-menu-btn:hover { color: #fff; }

.mobile-menu-drawer {
  position: fixed;
  left: -100%;
  top: var(--nav-h);
  width: 80%;
  max-width: 300px;
  height: calc(100vh - var(--nav-h));
  background: var(--bg2);
  z-index: 999;
  transition: left 0.3s ease;
  overflow-y: auto;
  border-right: 1px solid #333;
}

.mobile-menu-drawer.open { left: 0; }

.mobile-menu-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px;
  border-bottom: 1px solid #333;
  font-weight: 600;
  color: #fff;
}

.mobile-menu-close {
  background: none;
  border: none;
  color: var(--text-muted);
  font-size: 1.2rem;
  cursor: pointer;
  transition: color 0.2s;
}

.mobile-menu-close:hover { color: #fff; }

.mobile-menu-links {
  list-style: none;
  padding: 0;
}

.mobile-menu-links li {
  border-bottom: 1px solid #2a2a2a;
}

.mobile-menu-links a {
  display: block;
  padding: 14px 16px;
  color: var(--text-muted);
  text-decoration: none;
  transition: all 0.2s;
}

.mobile-menu-links a:hover,
.mobile-menu-links a.active {
  background: rgba(229, 9, 20, 0.1);
  color: var(--red);
  padding-left: 20px;
}

/* 菜单背景遮罩 */
.mobile-menu-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.5);
  z-index: 998;
  display: none;
  top: var(--nav-h);
}

.mobile-menu-overlay.open { display: block; }

/* ===== Hero ===== */
.hero {
  position: relative;
  height: 85vh;
  min-height: 500px;
  overflow: hidden;
}
.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center top;
  background-color: #1a1a1a;
  transform: scale(1.05);
  transition: background-image 0.8s ease;
}
.hero-bg::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, rgba(229,9,20,0.15) 0%, rgba(255,107,107,0.1) 50%, transparent 100%);
  pointer-events: none;
}
.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    to right,
    rgba(20,20,20,0.9) 0%,
    rgba(20,20,20,0.5) 50%,
    transparent 100%
  ),
  linear-gradient(
    to top,
    rgba(20,20,20,1) 0%,
    transparent 40%
  );
}
.hero-content {
  position: absolute;
  bottom: 20%;
  left: 4%;
  max-width: 500px;
  z-index: 2;
}
.hero-badge {
  display: inline-block;
  background: var(--red);
  color: #fff;
  font-size: 0.75rem;
  font-weight: 700;
  padding: 3px 10px;
  border-radius: 3px;
  margin-bottom: 12px;
  letter-spacing: 1px;
  text-transform: uppercase;
}
.hero-content h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
  font-weight: 700;
  line-height: 1.2;
  margin-bottom: 12px;
  text-shadow: 2px 2px 8px rgba(0,0,0,0.8);
}
.hero-content p {
  font-size: 0.95rem;
  color: #ccc;
  line-height: 1.6;
  margin-bottom: 16px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.hero-meta {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 20px;
  font-size: 0.85rem;
  color: var(--text-muted);
}
.hero-meta .rating { color: #f5c518; font-weight: 600; }
.hero-btns { display: flex; gap: 12px; }

/* ===== 按钮 ===== */
.btn-play {
  background: #fff;
  color: #000;
  border: none;
  padding: 10px 24px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 700;
  cursor: pointer;
  transition: background 0.2s, transform 0.1s;
}
.btn-play:hover { background: rgba(255,255,255,0.85); transform: scale(1.02); }

.btn-info {
  background: rgba(109,109,110,0.7);
  color: #fff;
  border: none;
  padding: 10px 24px;
  border-radius: 4px;
  font-size: 0.95rem;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.2s;
}
.btn-info:hover { background: rgba(109,109,110,0.5); }

/* ===== 内容区域 ===== */
.content-area {
  padding: 0 4% 60px;
  margin-top: -80px;
  position: relative;
  z-index: 2;
}

.row-section { margin-bottom: 40px; }

.row-title {
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 16px;
  color: #e5e5e5;
}

/* ===== 横向滚动卡片行 ===== */
.card-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: thin;
  scrollbar-color: #555 transparent;
}
.card-row::-webkit-scrollbar { height: 4px; }
.card-row::-webkit-scrollbar-track { background: transparent; }
.card-row::-webkit-scrollbar-thumb { background: #555; border-radius: 2px; }

/* ===== 网格布局（搜索结果） ===== */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(var(--card-w), 1fr));
  gap: 12px;
}

/* ===== 卡片 ===== */
.card {
  flex: 0 0 var(--card-w);
  width: var(--card-w);
  cursor: pointer;
  border-radius: var(--radius);
  overflow: hidden;
  transition: transform 0.25s, box-shadow 0.25s;
  position: relative;
  background: var(--bg3);
}
.card:hover {
  transform: scale(1.06);
  box-shadow: 0 8px 30px rgba(0,0,0,0.7);
  z-index: 10;
}
.card-poster {
  width: 100%;
  height: var(--card-h);
  object-fit: cover;
  display: block;
  background: var(--bg3);
}
.card-poster-placeholder {
  width: 100%;
  height: var(--card-h);
  background: linear-gradient(135deg, #2a2a2a, #1a1a1a);
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  color: var(--text-muted);
  font-size: 2rem;
}
.card-poster-placeholder span { font-size: 0.75rem; margin-top: 8px; text-align: center; padding: 0 8px; }
.card-info {
  padding: 8px;
  background: var(--bg3);
}
.card-name {
  font-size: 0.82rem;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #ddd;
}
.card-meta {
  font-size: 0.72rem;
  color: var(--text-muted);
  margin-top: 3px;
  display: flex;
  gap: 6px;
}
.card-rating { color: #f5c518; }
.card-overlay {
  position: absolute;
  inset: 0;
  background: rgba(0,0,0,0);
  transition: background 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}
.card:hover .card-overlay { background: rgba(0,0,0,0.3); }
.card-play-icon {
  opacity: 0;
  font-size: 2.5rem;
  transition: opacity 0.2s;
  filter: drop-shadow(0 2px 8px rgba(0,0,0,0.8));
}
.card:hover .card-play-icon { opacity: 1; }

/* 收藏按钮 */
.card-favorite-btn {
  position: absolute;
  top: 8px;
  right: 8px;
  width: 32px;
  height: 32px;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.6);
  border: none;
  color: #fff;
  font-size: 1.2rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.2s;
  z-index: 5;
  opacity: 0;
  padding: 0;
}
.card:hover .card-favorite-btn {
  opacity: 1;
}
.card-favorite-btn:hover {
  background: rgba(229, 9, 20, 0.8);
  transform: scale(1.1);
}
.card-favorite-btn.favorited {
  opacity: 1;
  background: rgba(229, 9, 20, 0.9);
  color: #fff;
}

/* 移动端收藏按钮始终显示 */
@media (max-width: 768px) {
  .card-favorite-btn {
    opacity: 1;
  }
}

/* ===== 详情弹窗 ===== */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.75);
  z-index: 2000;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
}
.modal-overlay.open { display: flex; }

.modal {
  background: #181818;
  border-radius: 8px;
  width: 100%;
  max-width: 800px;
  max-height: 90vh;
  overflow-y: auto;
  position: relative;
  scrollbar-width: thin;
  scrollbar-color: #555 transparent;
}

.modal-close {
  position: absolute;
  top: 12px; right: 12px;
  background: rgba(0,0,0,0.6);
  border: none;
  color: #fff;
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1rem;
  z-index: 10;
  transition: background 0.2s;
}
.modal-close:hover { background: rgba(255,255,255,0.2); }

.modal-hero {
  display: flex;
  gap: 24px;
  padding: 24px;
}
.modal-hero img {
  width: 160px;
  height: 240px;
  object-fit: cover;
  border-radius: 6px;
  flex-shrink: 0;
}
.modal-hero-info { flex: 1; }
.modal-hero-info h2 { font-size: 1.5rem; margin-bottom: 10px; }
.modal-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 0.82rem;
}
.modal-meta span {
  background: rgba(255,255,255,0.1);
  padding: 3px 8px;
  border-radius: 3px;
  color: #ccc;
}
.modal-meta .tag-rating { background: rgba(245,197,24,0.2); color: #f5c518; }
.modal-meta .tag-year { background: rgba(229,9,20,0.2); color: #ff6b6b; }
#modalDesc {
  font-size: 0.88rem;
  color: #aaa;
  line-height: 1.7;
  margin-bottom: 16px;
}
.modal-btns { display: flex; gap: 10px; }

.episode-title {
  font-size: 1rem;
  font-weight: 600;
  padding: 0 24px 12px;
  color: #ccc;
  border-top: 1px solid #333;
  padding-top: 16px;
}
.episode-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 24px 24px;
}
.ep-btn {
  background: var(--bg3);
  border: 1px solid #444;
  color: #ccc;
  padding: 6px 14px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.82rem;
  transition: all 0.2s;
}
.ep-btn:hover, .ep-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* ===== 播放器 ===== */
.player-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.95);
  z-index: 3000;
  display: none;
  align-items: center;
  justify-content: center;
}
.player-overlay.open { display: flex; }

.player-container {
  width: 100%;
  max-width: 1100px;
  padding: 0 16px;
}
.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  color: #ccc;
  font-size: 0.9rem;
}
.player-close {
  background: rgba(255,255,255,0.1);
  border: none;
  color: #fff;
  width: 36px; height: 36px;
  border-radius: 50%;
  cursor: pointer;
  font-size: 1.1rem;
  transition: background 0.2s;
}
.player-close:hover { background: rgba(255,255,255,0.25); }

.player-wrap {
  position: relative;
  background: #000;
  border-radius: 8px;
  overflow: hidden;
  aspect-ratio: 16/9;
}

#artplayer-container {
  width: 100%;
  height: 100%;
}

/* ArtPlayer 主题定制 */
.art-video {
  background: #000;
}

.art-control {
  background: linear-gradient(to top, rgba(0,0,0,0.8), transparent);
}

.art-control-item {
  color: #fff;
}

.art-control-item:hover {
  color: var(--red);
}

.art-progress {
  background: rgba(255,255,255,0.2);
}

.art-progress-played {
  background: var(--red);
}

.art-progress-hover {
  background: rgba(229,9,20,0.5);
}

.art-button:hover {
  color: var(--red);
}

.art-contextmenu {
  background: rgba(30,30,30,0.95);
  border: 1px solid #444;
}

.art-contextmenu-item:hover {
  background: rgba(229,9,20,0.2);
  color: var(--red);
}

.art-notice {
  background: rgba(0,0,0,0.8);
  color: #fff;
}

.art-loading {
  color: var(--red);
}

.art-subtitle {
  color: #fff;
  text-shadow: 1px 1px 2px rgba(0,0,0,0.8);
}

#videoPlayer {
  width: 100%;
  height: 100%;
  display: block;
}

.player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.8);
  color: #ccc;
  gap: 16px;
}

.spinner {
  width: 48px; height: 48px;
  border: 4px solid rgba(255,255,255,0.1);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

@keyframes spin { to { transform: rotate(360deg); } }

.player-error {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  background: rgba(0,0,0,0.9);
  color: #ccc;
  gap: 16px;
  padding: 20px;
}

.source-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: center;
}

.source-btn {
  background: var(--bg3);
  border: 1px solid #555;
  color: #ccc;
  padding: 6px 16px;
  border-radius: 4px;
  cursor: pointer;
  font-size: 0.85rem;
  transition: all 0.2s;
}

.source-btn:hover { background: var(--red); border-color: var(--red); color: #fff; }

/* ===== Toast ===== */
.toast {
  position: fixed;
  bottom: 30px;
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  background: rgba(40,40,40,0.95);
  color: #fff;
  padding: 10px 20px;
  border-radius: 6px;
  font-size: 0.88rem;
  opacity: 0;
  transition: all 0.3s;
  z-index: 9999;
  pointer-events: none;
  border-left: 3px solid var(--red);
}
.toast.show {
  opacity: 1;
  transform: translateX(-50%) translateY(0);
}

/* ===== 加载骨架屏 ===== */
.skeleton {
  background: linear-gradient(90deg, #222 25%, #2a2a2a 50%, #222 75%);
  background-size: 200% 100%;
  animation: shimmer 1.5s infinite;
  border-radius: var(--radius);
}
@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}
.skeleton-card {
  flex: 0 0 var(--card-w);
  width: var(--card-w);
  height: calc(var(--card-h) + 50px);
}

/* ===== 响应式 ===== */
@media (max-width: 1024px) {
  .hero-top-list { display: none; }
}

@media (max-width: 768px) {
  :root { 
    --card-w: 130px; 
    --card-h: 195px;
    --nav-h: 56px;
  }
  
  /* 导航栏 */
  .navbar {
    padding: 0 3%;
    height: var(--nav-h);
  }
  
  .nav-left { gap: 16px; }
  
  .logo { font-size: 1.3rem; }
  
  .nav-links { display: none; }
  
  .nav-right {
    display: flex;
    align-items: center;
    gap: 6px;
  }
  
  /* 移动端搜索框始终显示在导航栏上 */
  .search-box { 
    position: static;
    width: 140px;
    display: flex !important;
    flex-direction: row;
    align-items: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 3px;
    padding: 4px 6px;
    box-sizing: border-box;
    gap: 2px;
  }
  
  .search-box.mobile-active {
    display: flex;
  }
  
  .search-box input {
    flex: 1;
    width: auto;
    min-width: 0;
    padding: 2px 4px;
    font-size: 0.75rem;
    min-height: auto;
    background: none;
    border: none;
    color: #fff;
  }
  
  .search-box input::placeholder {
    color: rgba(255,255,255,0.6);
  }
  
  .search-box button {
    padding: 2px 4px;
    min-height: auto;
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.9rem;
  }
  
  body.search-active {
    padding-bottom: 0;
  }
  
  /* Hero */
  .hero {
    height: 60vh;
    min-height: 350px;
  }
  
  .hero-content {
    bottom: 15%;
    left: 3%;
    max-width: 90%;
  }
  
  .hero-content h1 {
    font-size: clamp(1.4rem, 3vw, 2rem);
  }
  
  .hero-content p {
    font-size: 0.85rem;
    -webkit-line-clamp: 2;
  }
  
  .hero-btns {
    gap: 8px;
  }
  
  .btn-play, .btn-info {
    padding: 8px 16px;
    font-size: 0.85rem;
  }
  
  /* 内容区域 */
  .content-area {
    padding: 0 3% 40px;
    margin-top: -60px;
  }
  
  .row-title {
    font-size: 1rem;
    margin-bottom: 12px;
  }
  
  .card-row {
    gap: 6px;
  }
  
  /* 分类页 */
  .category-header {
    padding: 12px 3% 0;
  }
  
  .category-title {
    font-size: 1.2rem;
    margin-bottom: 10px;
  }
  
  .filter-bar {
    gap: 6px;
    padding-bottom: 10px;
  }
  
  .filter-btn {
    padding: 4px 10px;
    font-size: 0.75rem;
  }
  
  #categoryView .card-grid,
  #searchView .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
  
  /* 详情弹窗 */
  .modal {
    max-width: 95%;
    max-height: 85vh;
  }
  
  .modal-hero {
    flex-direction: column;
    gap: 16px;
    padding: 16px;
  }
  
  .modal-hero img {
    width: 100%;
    height: 200px;
  }
  
  .modal-hero-info h2 {
    font-size: 1.2rem;
  }
  
  #modalDesc {
    font-size: 0.82rem;
  }
  
  .episode-title {
    font-size: 0.9rem;
    padding: 0 16px 10px;
  }
  
  .episode-list {
    padding: 0 16px 16px;
    gap: 6px;
  }
  
  .ep-btn {
    padding: 5px 10px;
    font-size: 0.75rem;
  }
  
  /* 播放器 */
  .player-container {
    padding: 0 8px;
  }
  
  .player-header {
    padding: 8px 0;
    font-size: 0.85rem;
  }
  
  .player-close {
    width: 32px;
    height: 32px;
    font-size: 1rem;
  }
  
  /* 豆瓣高分榜 */
  .hero-top-list {
    display: none;
  }
  
  /* 源切换 */
  .source-switch-wrap {
    padding: 10px 16px 8px;
    gap: 8px;
  }
  
  .source-switch-label {
    font-size: 0.75rem;
  }
  
  .source-switch-btn {
    padding: 3px 10px;
    font-size: 0.75rem;
  }
}

@media (max-width: 480px) {
  :root { 
    --card-w: 100px; 
    --card-h: 150px;
    --nav-h: 50px;
  }
  
  /* 导航栏 */
  .navbar {
    padding: 0 2%;
  }
  
  .nav-left { gap: 12px; }
  
  .logo { font-size: 1.1rem; }
  
  .nav-right {
    display: flex;
    align-items: center;
    gap: 4px;
  }
  
  /* 移动端搜索框始终显示在导航栏上 */
  .search-box { 
    position: static;
    width: 120px;
    display: flex !important;
    flex-direction: row;
    align-items: center;
    background: rgba(255,255,255,0.08);
    border: 1px solid rgba(255,255,255,0.1);
    border-radius: 3px;
    padding: 3px 5px;
    box-sizing: border-box;
    gap: 2px;
  }
  
  .search-box.mobile-active {
    display: flex;
  }
  
  .search-box input {
    flex: 1;
    width: auto;
    min-width: 0;
    padding: 2px 3px;
    font-size: 0.7rem;
    min-height: auto;
    background: none;
    border: none;
    color: #fff;
  }
  
  .search-box button {
    padding: 2px 3px;
    min-height: auto;
    background: none;
    border: none;
    color: rgba(255,255,255,0.8);
    cursor: pointer;
    flex-shrink: 0;
    font-size: 0.85rem;
  }
  
  body.search-active {
    padding-bottom: 0;
  }
  
  /* Hero */
  .hero {
    height: 50vh;
    min-height: 280px;
  }
  
  .hero-content {
    bottom: 12%;
    left: 2%;
    max-width: 95%;
  }
  
  .hero-content h1 {
    font-size: clamp(1.2rem, 2.5vw, 1.6rem);
    margin-bottom: 8px;
  }
  
  .hero-content p {
    font-size: 0.8rem;
    -webkit-line-clamp: 2;
    margin-bottom: 12px;
  }
  
  .hero-badge {
    font-size: 0.65rem;
    padding: 2px 8px;
    margin-bottom: 8px;
  }
  
  .hero-meta {
    font-size: 0.75rem;
    gap: 8px;
    margin-bottom: 12px;
  }
  
  .hero-btns {
    gap: 6px;
  }
  
  .btn-play, .btn-info {
    padding: 6px 12px;
    font-size: 0.75rem;
  }
  
  /* 内容区域 */
  .content-area {
    padding: 0 2% 30px;
    margin-top: -50px;
  }
  
  .row-title {
    font-size: 0.9rem;
    margin-bottom: 10px;
  }
  
  .card-row {
    gap: 4px;
  }
  
  /* 分类页 */
  .category-header {
    padding: 10px 2% 0;
  }
  
  .category-title {
    font-size: 1rem;
    margin-bottom: 8px;
  }
  
  .filter-bar {
    gap: 4px;
    padding-bottom: 8px;
  }
  
  .filter-btn {
    padding: 3px 8px;
    font-size: 0.7rem;
  }
  
  #categoryView .card-grid,
  #searchView .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
    gap: 8px;
  }
  
  /* 详情弹窗 */
  .modal {
    max-width: 98%;
    max-height: 90vh;
  }
  
  .modal-hero {
    flex-direction: column;
    gap: 12px;
    padding: 12px;
  }
  
  .modal-hero img {
    width: 100%;
    height: 180px;
  }
  
  .modal-close {
    width: 28px;
    height: 28px;
    top: 8px;
    right: 8px;
    font-size: 0.9rem;
  }
  
  .modal-hero-info h2 {
    font-size: 1rem;
    margin-bottom: 8px;
  }
  
  .modal-meta {
    gap: 6px;
    margin-bottom: 10px;
    font-size: 0.75rem;
  }
  
  #modalDesc {
    font-size: 0.78rem;
    line-height: 1.5;
    margin-bottom: 12px;
  }
  
  .modal-btns {
    gap: 8px;
  }
  
  .episode-title {
    font-size: 0.85rem;
    padding: 0 12px 8px;
  }
  
  .episode-list {
    padding: 0 12px 12px;
    gap: 5px;
  }
  
  .ep-btn {
    padding: 4px 8px;
    font-size: 0.7rem;
  }
  
  /* 播放器 */
  .player-container {
    padding: 0 4px;
  }
  
  .player-header {
    padding: 6px 0;
    font-size: 0.8rem;
  }
  
  .player-close {
    width: 28px;
    height: 28px;
    font-size: 0.9rem;
  }
  
  .player-error {
    padding: 16px;
  }
  
  .source-btn {
    padding: 5px 12px;
    font-size: 0.75rem;
  }
  
  /* 源切换 */
  .source-switch-wrap {
    padding: 8px 12px 6px;
    gap: 6px;
  }
  
  .source-switch-label {
    font-size: 0.7rem;
  }
  
  .source-switch-list {
    gap: 6px;
  }
  
  .source-switch-btn {
    padding: 3px 8px;
    font-size: 0.7rem;
  }
  
  /* Toast */
  .toast {
    bottom: 20px;
    font-size: 0.8rem;
    padding: 8px 16px;
  }
  
  /* 加载更多 */
  .load-more-wrap {
    padding: 24px 0 40px;
  }
  
  .load-more-btn {
    padding: 8px 30px;
    font-size: 0.85rem;
  }
}
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
}
.empty-state .icon { font-size: 3rem; margin-bottom: 12px; }
.empty-state p { font-size: 0.95rem; }

/* ===== 分类页 ===== */
.category-header {
  position: sticky;
  top: var(--nav-h);
  z-index: 100;
  background: rgba(20, 20, 20, 0.97);
  backdrop-filter: blur(8px);
  padding: 16px 4% 0;
  border-bottom: 1px solid #2a2a2a;
}

/* 分类页整体顶部留出导航栏 + category-header 的高度 */
#categoryView,
#searchView,
#favoritesView {
  padding-top: var(--nav-h);
}

.category-title {
  font-size: 1.5rem;
  font-weight: 700;
  color: #fff;
  margin-bottom: 12px;
}

/* 筛选栏 */
.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-bottom: 12px;
}

.filter-group {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.filter-label {
  font-size: 0.8rem;
  color: var(--text-muted);
  white-space: nowrap;
  padding-right: 4px;
}

.filter-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.1);
  color: #aaa;
  padding: 5px 14px;
  border-radius: 20px;
  font-size: 0.82rem;
  cursor: pointer;
  transition: all 0.18s;
  white-space: nowrap;
}
.filter-btn:hover { background: rgba(255,255,255,0.13); color: #fff; }
.filter-btn.active {
  background: var(--red);
  border-color: var(--red);
  color: #fff;
}

/* 分类网格 */
#categoryView .content-area,
#searchView .content-area,
#favoritesView .content-area {
  margin-top: 0;
  padding-top: 20px;
}

#categoryView .card-grid,
#searchView .card-grid,
#favoritesView .card-grid {
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
}

#categoryView .card,
#searchView .card,
#favoritesView .card {
  width: 100%;
  flex: none;
}

/* 加载更多 */
.load-more-wrap {
  text-align: center;
  padding: 32px 0 60px;
}
.load-more-btn {
  background: rgba(255,255,255,0.08);
  border: 1px solid rgba(255,255,255,0.15);
  color: #ccc;
  padding: 10px 40px;
  border-radius: 4px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s;
}
.load-more-btn:hover { background: var(--red); border-color: var(--red); color: #fff; }
.load-more-btn:disabled { opacity: 0.4; cursor: not-allowed; }

@media (max-width: 768px) {
  #categoryView .card-grid,
  #searchView .card-grid,
  #favoritesView .card-grid {
    grid-template-columns: repeat(auto-fill, minmax(120px, 1fr));
    gap: 10px;
  }
  .filter-bar { gap: 6px; }
  .filter-btn { padding: 4px 10px; font-size: 0.78rem; }
}

/* ===== 播放源切换 ===== */
.source-switch-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 14px 24px 10px;
  flex-wrap: wrap;
}

.source-switch-label {
  font-size: 0.82rem;
  color: var(--text-muted);
  white-space: nowrap;
}

.source-switch-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.source-switch-btn {
  background: rgba(255,255,255,0.07);
  border: 1px solid rgba(255,255,255,0.15);
  color: #bbb;
  padding: 4px 14px;
  border-radius: 4px;
  font-size: 0.8rem;
  cursor: pointer;
  transition: all 0.18s;
}
.source-switch-btn:hover { background: rgba(255,255,255,0.13); color: #fff; }
.source-switch-btn.active {
  background: rgba(229,9,20,0.15);
  border-color: var(--red);
  color: #fff;
}

/* 选集加载中 */
.ep-loading {
  color: var(--text-muted);
  font-size: 0.85rem;
  padding: 12px 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.ep-loading::before {
  content: '';
  width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,0.1);
  border-top-color: var(--red);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  flex-shrink: 0;
}

/* ===== Hero 右侧豆瓣高分榜 ===== */
.hero-top-list {
  position: absolute;
  right: 4%;
  bottom: 12%;
  z-index: 3;
  width: 240px;
}

.hero-top-title {
  font-size: 0.78rem;
  font-weight: 700;
  color: #f5c518;
  letter-spacing: 1px;
  text-transform: uppercase;
  margin-bottom: 10px;
  padding-left: 2px;
  border-left: 3px solid #f5c518;
  padding-left: 8px;
}

.hero-top-items {
  display: flex;
  flex-direction: column;
  gap: 8px;
}

.hero-top-item {
  display: flex;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  padding: 6px 8px;
  border-radius: 6px;
  background: rgba(0,0,0,0.45);
  backdrop-filter: blur(6px);
  transition: background 0.2s, transform 0.2s;
}
.hero-top-item:hover {
  background: rgba(255,255,255,0.1);
  transform: translateX(-4px);
}

.hero-top-rank {
  font-size: 1rem;
  font-weight: 800;
  color: #f5c518;
  width: 20px;
  text-align: center;
  flex-shrink: 0;
}
.hero-top-rank.rank-1 { color: #f5c518; }
.hero-top-rank.rank-2 { color: #c0c0c0; }
.hero-top-rank.rank-3 { color: #cd7f32; }
.hero-top-rank.rank-other { color: #666; font-size: 0.82rem; }

.hero-top-poster {
  width: 36px;
  height: 52px;
  object-fit: cover;
  border-radius: 3px;
  flex-shrink: 0;
  background: #222;
}

.hero-top-info {
  flex: 1;
  overflow: hidden;
}

.hero-top-name {
  font-size: 0.82rem;
  font-weight: 600;
  color: #eee;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.hero-top-score {
  font-size: 0.72rem;
  color: #f5c518;
  margin-top: 2px;
}

@media (max-width: 1024px) {
  .hero-top-list { display: none; }
}
