/* ============================================================
   TVBox v2.1 - 影视聚合播放器 样式系统
   Apple TV 沉浸感 + iOS Liquid Glass + Netflix 活力
   ============================================================ */

/* ========= CSS 变量 ========= */
:root {
  /* 深邃暗色背景 - Apple TV 级纯黑 */
  --bg-primary: #000000;
  --bg-secondary: #0c0c0e;
  --bg-tertiary: #141416;
  --bg-card: rgba(28, 28, 32, 0.75);
  --bg-card-hover: rgba(44, 44, 50, 0.8);
  --bg-elevated: rgba(38, 38, 44, 0.85);
  --bg-hover: rgba(255,255,255,0.06);
  --bg-modal: rgba(0,0,0,0.88);
  --bg-glass: rgba(18, 18, 22, 0.72);
  --bg-glass-heavy: rgba(28, 28, 34, 0.82);
  --bg-search: rgba(255,255,255,0.07);

  /* Liquid Glass 材质 */
  --glass-bg: rgba(255, 255, 255, 0.04);
  --glass-border: rgba(255, 255, 255, 0.08);
  --glass-border-bright: rgba(255, 255, 255, 0.14);
  --glass-blur: 40px;
  --glass-saturate: saturate(180%);
  --glass-refraction: 1px solid rgba(255,255,255,0.06) inset;

  /* 文字层级 - SF Pro 风格 */
  --text-primary: #f5f5f7;
  --text-secondary: rgba(245, 245, 247, 0.6);
  --text-muted: rgba(245, 245, 247, 0.35);
  --text-accent: #ff6b35;
  --text-label: rgba(245, 245, 247, 0.5);

  /* 强调色 - 柔和但辨识度高 */
  --accent: #e50914;
  --accent-hover: #ff2c3a;
  --accent-soft: rgba(229, 9, 20, 0.12);
  --accent-gradient: linear-gradient(135deg, #e50914, #ff6b35);
  --accent-glow: 0 0 40px rgba(229, 9, 20, 0.2);
  --blue: #0a84ff;
  --blue-soft: rgba(10, 132, 255, 0.12);
  --green: #30d158;
  --green-soft: rgba(48, 209, 88, 0.12);
  --yellow: #ffd60a;
  --orange: #ff9f0a;
  --purple: #bf5af2;
  --pink: #ff375f;

  /* 边框与焦点 */
  --border: rgba(255,255,255,0.06);
  --border-subtle: rgba(255,255,255,0.04);
  --border-accent: rgba(229,9,20,0.35);
  --focus-ring: var(--blue);
  --focus-glow: 0 0 0 3px rgba(10, 132, 255, 0.35);
  --focus-glow-accent: 0 0 0 3px rgba(229, 9, 20, 0.3);

  /* 阴影 - 更微妙更自然 */
  --shadow-card: 0 2px 16px rgba(0,0,0,0.3);
  --shadow-elevated: 0 8px 32px rgba(0,0,0,0.45);
  --shadow-focus: 0 4px 24px rgba(10, 132, 255, 0.15);
  --shadow-modal: 0 24px 80px rgba(0,0,0,0.7);
  --shadow-hover: 0 12px 40px rgba(0,0,0,0.35);

  /* 圆角 - iOS 大圆角风格 */
  --radius-sm: 6px;
  --radius: 10px;
  --radius-lg: 14px;
  --radius-xl: 20px;
  --radius-2xl: 24px;
  --radius-full: 50%;
  --radius-pill: 100px;

  /* 动画 - Apple 风格弹性 */
  --spring: cubic-bezier(0.25, 0.46, 0.45, 0.94);
  --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-smooth: cubic-bezier(0.4, 0, 0.2, 1);
  --transition: 0.25s var(--spring);
  --transition-fast: 0.15s var(--spring);
  --transition-slow: 0.5s var(--spring);
  --focus-transition: 0.35s var(--spring-bounce);

  /* 布局 */
  --sidebar-width: 68px;
  --sidebar-expanded: 200px;
  --topbar-height: 52px;
  --font: -apple-system, BlinkMacSystemFont, 'SF Pro Display', 'SF Pro Text', 'Segoe UI', system-ui, sans-serif;
  --font-mono: 'SF Mono', 'Cascadia Code', 'Consolas', monospace;
}

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

html, body {
  width: 100%; height: 100%;
  overflow: hidden;
  font-family: var(--font);
  font-size: 14px;
  color: var(--text-primary);
  background: var(--bg-primary);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  user-select: none;
  cursor: default;
  letter-spacing: -0.01em;
}

/* 极简滚动条 */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: rgba(255,255,255,0.08); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(255,255,255,0.14); }

/* ========= 布局 ========= */
#app {
  display: flex;
  width: 100%;
  height: 100vh;
  overflow: hidden;
}

/* ========= 侧边栏 ========= */
#sidebar {
  width: var(--sidebar-width);
  height: 100vh;
  background: var(--bg-glass);
  backdrop-filter: blur(var(--glass-blur)) var(--glass-saturate);
  -webkit-backdrop-filter: blur(var(--glass-blur)) var(--glass-saturate);
  border-right: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  flex-shrink: 0;
  z-index: 100;
  transition: width 0.45s var(--spring);
  overflow: hidden;
}
#sidebar:hover { width: var(--sidebar-expanded); }

.sidebar-logo {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 18px 16px;
  border-bottom: 1px solid var(--glass-border);
  white-space: nowrap;
  overflow: hidden;
}
.logo-icon { font-size: 26px; flex-shrink: 0; filter: drop-shadow(0 0 8px rgba(229,9,20,0.3)); }
.logo-text {
  font-size: 20px;
  font-weight: 700;
  background: var(--accent-gradient);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  letter-spacing: -0.5px;
  opacity: 0;
  transition: opacity var(--transition);
}
#sidebar:hover .logo-text { opacity: 1; }

.sidebar-nav {
  flex: 1;
  overflow-y: auto;
  padding: 10px 8px;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.sidebar-nav::-webkit-scrollbar { width: 0; }

.nav-item {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
  overflow: hidden;
  flex-shrink: 0;
}
.nav-item:hover { background: var(--bg-hover); }
.nav-item.focused {
  background: rgba(255,255,255,0.08);
  box-shadow: var(--glass-refraction);
}
.nav-item.active {
  background: var(--accent-soft);
}
.nav-item.active::before {
  content: '';
  position: absolute;
  left: 0;
  top: 50%;
  transform: translateY(-50%);
  width: 3px;
  height: 18px;
  background: var(--accent);
  border-radius: 0 3px 3px 0;
}
.nav-icon { font-size: 19px; flex-shrink: 0; width: 24px; text-align: center; opacity: 0.8; }
.nav-label {
  font-size: 13px;
  font-weight: 500;
  opacity: 0;
  transition: opacity var(--transition);
  color: var(--text-secondary);
}
#sidebar:hover .nav-label { opacity: 1; }
.nav-item.active .nav-label { color: var(--text-primary); font-weight: 600; }

.nav-badge {
  margin-left: auto;
  background: var(--accent);
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  padding: 1px 6px;
  border-radius: 10px;
  min-width: 18px;
  text-align: center;
  flex-shrink: 0;
}

.sidebar-bottom {
  border-top: 1px solid var(--glass-border);
  padding: 8px 8px;
}

/* 侧边栏展开（鼠标悬停） */
#sidebar.expanded { width: var(--sidebar-expanded) !important; }
#sidebar.expanded .nav-label { display: block !important; opacity: 1 !important; }
#sidebar.expanded .logo-text { display: block !important; opacity: 1 !important; }

/* ========= 主内容区 ========= */
#main-content {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}

/* ========= 顶部栏 - Liquid Glass 风格 ========= */
#topbar {
  height: var(--topbar-height);
  display: flex;
  align-items: center;
  padding: 0 28px;
  gap: 16px;
  background: var(--bg-glass);
  backdrop-filter: blur(60px) var(--glass-saturate);
  -webkit-backdrop-filter: blur(60px) var(--glass-saturate);
  border-bottom: 1px solid var(--glass-border);
  flex-shrink: 0;
  z-index: 50;
  box-shadow: var(--glass-refraction);
}
.topbar-title {
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  flex-shrink: 0;
  letter-spacing: -0.01em;
}
.topbar-search {
  flex: 1;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 7px 16px;
  cursor: pointer;
  transition: all var(--transition);
}
.topbar-search:hover, .topbar-search.focused {
  background: rgba(255,255,255,0.08);
  border-color: var(--glass-border-bright);
  box-shadow: var(--glass-refraction);
}
.search-icon { font-size: 14px; opacity: 0.5; flex-shrink: 0; }
.topbar-search input {
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 13px;
  width: 100%;
  cursor: pointer;
  letter-spacing: -0.01em;
}
.topbar-search input::placeholder { color: var(--text-muted); }
.topbar-search input:read-only { cursor: pointer; }

.topbar-actions { display: flex; gap: 6px; margin-left: auto; flex-shrink: 0; }
.topbar-btn {
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  padding: 5px 14px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.topbar-btn:hover, .topbar-btn.focused {
  border-color: var(--glass-border-bright);
  color: var(--text-primary);
  background: rgba(255,255,255,0.08);
  box-shadow: var(--glass-refraction);
}

/* ========= 页面容器 ========= */
.page {
  display: none;
  flex: 1;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 24px 28px;
  scroll-behavior: smooth;
}
.page.active { display: block; }
.page-inner { height: 100%; overflow-y: auto; }

/* ========= Hero Banner - Apple TV Cinematic ========= */
.hero-banner {
  position: relative;
  width: 100%;
  height: 380px;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  margin-bottom: 32px;
  background: radial-gradient(ellipse at 30% 80%, #1a1a2e 0%, #0a0a0a 70%);
  cursor: pointer;
  box-shadow: 0 4px 40px rgba(0,0,0,0.5);
}
.hero-banner::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(
    180deg,
    transparent 30%,
    rgba(0,0,0,0.1) 50%,
    rgba(0,0,0,0.75) 85%,
    rgba(0,0,0,0.95) 100%
  );
  pointer-events: none;
}
.hero-banner::before {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0,0,0,0.7) 0%, transparent 50%);
  pointer-events: none;
  z-index: 1;
}
.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 8s var(--ease-smooth), opacity 0.6s ease;
}
.hero-banner:hover .hero-bg { transform: scale(1.03); }

.hero-content {
  position: absolute;
  bottom: 36px;
  left: 36px;
  right: 220px;
  z-index: 2;
}
.hero-tags { display: flex; gap: 6px; margin-bottom: 12px; }
.hero-tag {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 600;
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(10px);
  color: rgba(255,255,255,0.9);
  border: 1px solid rgba(255,255,255,0.08);
}
.hero-tag.accent { background: var(--accent); color: #fff; border: none; }
.hero-tag.blue { background: rgba(10,132,255,0.25); color: #64b5f6; border: 1px solid rgba(10,132,255,0.3); }
.hero-tag.green { background: rgba(48,209,88,0.2); color: #64d68a; border: 1px solid rgba(48,209,88,0.3); }

.hero-title {
  font-size: 36px;
  font-weight: 700;
  line-height: 1.1;
  margin-bottom: 10px;
  text-shadow: 0 2px 20px rgba(0,0,0,0.5);
  letter-spacing: -0.02em;
}
.hero-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 10px;
}
.hero-meta .score {
  color: var(--yellow);
  font-weight: 700;
  font-size: 15px;
}
.hero-meta .dot {
  width: 3px; height: 3px;
  background: rgba(255,255,255,0.3);
  border-radius: 50%;
}
.hero-desc {
  font-size: 13px;
  color: rgba(255,255,255,0.55);
  line-height: 1.6;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 18px;
}
.hero-actions { display: flex; gap: 10px; }
.hero-play-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 28px;
  background: rgba(255,255,255,0.15);
  backdrop-filter: blur(12px);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.hero-play-btn:hover {
  background: rgba(255,255,255,0.22);
  transform: translateY(-1px);
  box-shadow: 0 4px 20px rgba(255,255,255,0.1);
}
.hero-play-btn .play-icon {
  width: 20px; height: 20px;
  background: var(--accent);
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
}
.hero-info-btn {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 10px 24px;
  background: rgba(255,255,255,0.08);
  backdrop-filter: blur(8px);
  color: rgba(255,255,255,0.8);
  border: 1px solid rgba(255,255,255,0.08);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.hero-info-btn:hover { background: rgba(255,255,255,0.14); color: #fff; }

/* Hero 指示器 - Apple TV 风格胶囊 */
.hero-indicators {
  position: absolute;
  bottom: 16px;
  right: 36px;
  display: flex;
  gap: 4px;
  z-index: 3;
}
.hero-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  cursor: pointer;
  transition: all 0.4s var(--spring);
}
.hero-dot.active {
  width: 20px;
  border-radius: 3px;
  background: rgba(255,255,255,0.8);
}

/* ========= 内容区块 ========= */
.section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
  margin-top: 8px;
}
.section-title {
  font-size: 18px;
  font-weight: 600;
  letter-spacing: -0.01em;
  display: flex;
  align-items: center;
  gap: 8px;
}
.section-more {
  color: var(--text-muted);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  padding: 4px 12px;
  border-radius: var(--radius);
  transition: all var(--transition);
}
.section-more:hover, .section-more.focused { color: var(--text-primary); background: var(--bg-hover); }

/* ========= 卡片行 ========= */
.card-row {
  display: flex;
  gap: 16px;
  overflow-x: auto;
  overflow-y: hidden;
  padding-bottom: 8px;
  margin-bottom: 32px;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.card-row::-webkit-scrollbar { height: 0; }

/* ========= 影片卡片 - Apple TV Focus Style ========= */
.movie-card {
  flex-shrink: 0;
  width: 155px;
  cursor: pointer;
  transition: all var(--focus-transition);
  scroll-snap-align: start;
  border-radius: var(--radius-lg);
  overflow: visible;
}
.movie-card:hover, .movie-card.focused {
  transform: scale(1.08) translateY(-4px);
  z-index: 10;
  outline: none;
}
.movie-card.focused {
  box-shadow:
    0 0 0 2px rgba(255,255,255,0.15),
    0 8px 32px rgba(0,0,0,0.5),
    0 0 60px rgba(255,255,255,0.04);
}
/* 非焦点卡片变暗 - Apple TV 经典效果 */
.card-row .movie-card:not(:hover):not(.focused) {
  opacity: 0.55;
  transition: all var(--focus-transition), opacity 0.5s ease;
}
.card-row:hover .movie-card { opacity: 1; }
.card-row:hover .movie-card:hover,
.card-row .movie-card.focused { opacity: 1; }

.card-poster {
  width: 100%;
  height: 220px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-tertiary);
  position: relative;
  box-shadow: var(--shadow-card);
  transition: box-shadow var(--focus-transition);
}
.movie-card:hover .card-poster,
.movie-card.focused .card-poster {
  box-shadow: var(--shadow-elevated);
}
.card-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.6s var(--spring);
}
.movie-card:hover .card-poster img,
.movie-card.focused .card-poster img { transform: scale(1.05); }

.card-poster .card-badge {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 10px;
  font-weight: 600;
  z-index: 2;
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.1);
}
.card-badge.hot { background: rgba(229,9,20,0.8); color: #fff; }
.card-badge.new { background: rgba(48,209,88,0.8); color: #fff; }
.card-badge.vip { background: rgba(255,214,10,0.8); color: #000; }

.card-poster .card-score {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  color: var(--yellow);
  font-size: 12px;
  font-weight: 700;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
}
.card-poster .card-note {
  position: absolute;
  bottom: 8px;
  left: 8px;
  background: rgba(0,0,0,0.65);
  backdrop-filter: blur(8px);
  color: var(--text-secondary);
  font-size: 11px;
  padding: 2px 8px;
  border-radius: var(--radius-sm);
  max-width: 80%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-info { padding: 8px 2px; }
.card-title {
  font-size: 13px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.35;
  letter-spacing: -0.01em;
}
.card-subtitle {
  font-size: 11px;
  color: var(--text-muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  margin-top: 2px;
}

/* 大卡片 */
.movie-card-lg {
  flex-shrink: 0;
  width: 330px;
  height: 110px;
  display: flex;
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  cursor: pointer;
  transition: all var(--focus-transition);
  scroll-snap-align: start;
  border: 1px solid var(--glass-border);
}
.movie-card-lg:hover, .movie-card-lg.focused {
  transform: scale(1.03) translateY(-2px);
  border-color: var(--glass-border-bright);
  box-shadow: var(--shadow-elevated);
}
.movie-card-lg.focused {
  box-shadow: var(--shadow-focus), var(--shadow-elevated);
}
.lg-poster {
  width: 80px;
  height: 110px;
  flex-shrink: 0;
  overflow: hidden;
}
.lg-poster img { width: 100%; height: 100%; object-fit: cover; }
.lg-info {
  flex: 1;
  padding: 10px 14px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}
.lg-title {
  font-size: 14px;
  font-weight: 600;
  margin-bottom: 4px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: -0.01em;
}
.lg-meta { font-size: 11px; color: var(--text-muted); margin-bottom: 6px; }
.lg-desc {
  font-size: 12px;
  color: var(--text-secondary);
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ========= 分类筛选 - iOS Segmented Control ========= */
.filter-bar {
  display: flex;
  gap: 6px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.filter-tag {
  padding: 6px 16px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 12px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.filter-tag:hover, .filter-tag.focused {
  background: rgba(255,255,255,0.08);
  border-color: var(--glass-border-bright);
  color: var(--text-primary);
}
.filter-tag.active {
  background: rgba(255,255,255,0.14);
  border-color: rgba(255,255,255,0.2);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: var(--glass-refraction);
}

/* ========= 网格布局 ========= */
.card-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 20px;
  margin-bottom: 32px;
}

/* ========= 搜索页 ========= */
.search-container { max-width: 580px; margin: 20px auto; }
.search-input-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 12px 20px;
  margin-bottom: 16px;
  transition: all var(--transition);
}
.search-input-wrap.focused, .search-input-wrap:focus-within {
  border-color: var(--blue);
  background: rgba(255,255,255,0.06);
  box-shadow: var(--focus-glow);
}
.search-input-wrap input {
  flex: 1;
  background: none;
  border: none;
  outline: none;
  color: var(--text-primary);
  font-size: 16px;
  letter-spacing: -0.01em;
}
.search-input-wrap input::placeholder { color: var(--text-muted); }
.search-input-wrap .clear-btn {
  font-size: 18px;
  cursor: pointer;
  color: var(--text-muted);
  transition: color var(--transition);
}
.search-input-wrap .clear-btn:hover { color: var(--text-primary); }

.hot-search { margin-top: 24px; }
.hot-search-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; color: var(--text-label); }
.hot-tags { display: flex; flex-wrap: wrap; gap: 8px; }
.hot-tag {
  padding: 6px 14px;
  border-radius: var(--radius-pill);
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}
.hot-tag:hover, .hot-tag.focused { background: rgba(255,255,255,0.1); color: var(--text-primary); }
.hot-tag .rank {
  display: inline-block;
  width: 18px;
  height: 18px;
  line-height: 18px;
  text-align: center;
  border-radius: 5px;
  font-size: 10px;
  font-weight: 700;
  margin-right: 6px;
}
.hot-tag .rank.top { background: var(--accent); color: #fff; }
.hot-tag .rank:not(.top) { background: rgba(255,255,255,0.1); color: var(--text-muted); }

.search-history { margin-top: 20px; }
.search-history-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; }
.search-history-title { font-size: 14px; font-weight: 600; color: var(--text-label); }
.clear-history-btn {
  font-size: 12px;
  color: var(--text-muted);
  cursor: pointer;
  padding: 4px 10px;
  border-radius: var(--radius);
}
.clear-history-btn:hover { color: var(--text-primary); }

/* ========= 详情页 ========= */
.detail-layout { display: flex; gap: 28px; padding-top: 8px; }
.detail-poster {
  width: 200px;
  height: 280px;
  flex-shrink: 0;
  border-radius: var(--radius-xl);
  overflow: hidden;
  box-shadow: var(--shadow-elevated);
  transition: transform var(--transition-slow);
}
.detail-poster:hover { transform: scale(1.02); }
.detail-poster img { width: 100%; height: 100%; object-fit: cover; }

.detail-info { flex: 1; min-width: 0; padding-top: 4px; }
.detail-title {
  font-size: 28px;
  font-weight: 700;
  line-height: 1.15;
  margin-bottom: 10px;
  letter-spacing: -0.02em;
}
.detail-tags { display: flex; gap: 6px; margin-bottom: 14px; flex-wrap: wrap; }
.detail-tag {
  padding: 3px 10px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  font-weight: 500;
  background: var(--glass-bg);
  color: var(--text-secondary);
  border: 1px solid var(--glass-border);
}
.detail-meta {
  display: flex;
  gap: 18px;
  font-size: 13px;
  color: var(--text-secondary);
  margin-bottom: 12px;
}
.detail-meta .score { color: var(--yellow); font-weight: 700; font-size: 17px; }
.detail-desc {
  font-size: 13px;
  color: var(--text-secondary);
  line-height: 1.8;
  margin-bottom: 20px;
}
.detail-actions { display: flex; gap: 10px; margin-bottom: 24px; }
.btn-play {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 30px;
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(8px);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-play:hover {
  background: rgba(255,255,255,0.2);
  transform: translateY(-1px);
}
.btn-fav {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 11px 22px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  color: var(--text-primary);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-fav:hover, .btn-fav.active {
  border-color: rgba(255,214,10,0.4);
  color: var(--yellow);
  background: rgba(255,214,10,0.08);
}

/* 源/线路选择 - iOS Segmented Control */
.source-selector { margin-bottom: 20px; }
.source-tabs {
  display: flex;
  gap: 2px;
  margin-bottom: 16px;
  padding: 3px;
  background: rgba(255,255,255,0.06);
  border-radius: var(--radius);
  width: fit-content;
  border: 1px solid var(--glass-border);
}
.source-tab {
  padding: 7px 20px;
  border-radius: 7px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}
.source-tab:hover { color: var(--text-secondary); }
.source-tab.active {
  background: rgba(255,255,255,0.14);
  color: var(--text-primary);
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0,0,0,0.2);
}

/* 选集列表 */
.episode-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(52px, 1fr));
  gap: 6px;
  max-height: 280px;
  overflow-y: auto;
  padding: 4px;
}
.episode-item {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 8px 4px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
  position: relative;
}
.episode-item:hover, .episode-item.focused {
  background: rgba(255,255,255,0.1);
  color: var(--text-primary);
  border-color: var(--glass-border);
}
.episode-item.active {
  background: rgba(10,132,255,0.2);
  color: #64b5f6;
  border-color: rgba(10,132,255,0.4);
  font-weight: 600;
}
.episode-item .ep-progress {
  position: absolute;
  bottom: 2px;
  left: 4px;
  right: 4px;
  height: 2px;
  background: var(--blue);
  border-radius: 1px;
  opacity: 0.5;
}

/* ========= 播放页 ========= */
#page-player { padding: 0; }
.player-wrap { width: 100%; height: 100%; background: #000; display: flex; flex-direction: column; }
.player-video { flex: 1; position: relative; min-height: 0; }
.player-video video { width: 100%; height: 100%; object-fit: contain; background: #000; }
.player-overlay {
  position: absolute;
  bottom: 0; left: 0; right: 0;
  padding: 40px 24px 20px;
  background: linear-gradient(transparent, rgba(0,0,0,0.85));
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  opacity: 0;
  transition: opacity 0.35s ease;
}
.player-video:hover .player-overlay,
.player-overlay.show { opacity: 1; }
.player-title { font-size: 16px; font-weight: 600; letter-spacing: -0.01em; }
.player-ep-info { font-size: 12px; color: var(--text-muted); margin-top: 4px; }
.player-controls { display: flex; gap: 8px; }
.player-ctrl {
  width: 40px;
  height: 40px;
  border-radius: var(--radius-full);
  background: rgba(255,255,255,0.12);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255,255,255,0.08);
  color: #fff;
  font-size: 16px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all var(--transition);
}
.player-ctrl:hover { background: rgba(255,255,255,0.22); }
.player-ctrl.big {
  width: 52px;
  height: 52px;
  background: rgba(255,255,255,0.18);
  font-size: 22px;
}
.player-loading {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  color: var(--text-muted);
  font-size: 14px;
  text-align: center;
}
.spinner {
  width: 36px;
  height: 36px;
  border: 2.5px solid rgba(255,255,255,0.1);
  border-top-color: rgba(255,255,255,0.6);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}
@keyframes spin { to { transform: rotate(360deg); } }

.player-error {
  position: absolute;
  top: 50%; left: 50%;
  transform: translate(-50%, -50%);
  text-align: center;
  color: var(--text-muted);
}
.player-error p { margin-bottom: 12px; }
.error-retry-btn {
  padding: 8px 20px;
  background: rgba(255,255,255,0.14);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.12);
  border-radius: var(--radius-pill);
  font-size: 13px;
  cursor: pointer;
  transition: all var(--transition);
}
.error-retry-btn:hover { background: rgba(255,255,255,0.22); }

.player-ep-panel {
  max-height: 120px;
  overflow-y: auto;
  padding: 8px 24px 12px;
  background: var(--bg-glass);
  backdrop-filter: blur(20px);
}
.player-ep-row { display: flex; gap: 6px; flex-wrap: wrap; }
.player-ep-btn {
  padding: 6px 14px;
  border-radius: var(--radius-sm);
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
  border: 1px solid transparent;
}
.player-ep-btn:hover, .player-ep-btn.focused { color: var(--text-primary); background: rgba(255,255,255,0.08); }
.player-ep-btn.active { background: rgba(10,132,255,0.2); color: #64b5f6; border-color: rgba(10,132,255,0.3); }

/* ========= 设置页 ========= */
.settings-section {
  background: var(--bg-card);
  backdrop-filter: blur(12px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 20px 24px;
  margin-bottom: 14px;
  box-shadow: var(--glass-refraction);
}
.settings-section-title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  display: flex;
  align-items: center;
  gap: 8px;
  letter-spacing: -0.01em;
}
.source-item {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 0;
  border-bottom: 1px solid var(--border-subtle);
}
.source-item:last-child { border-bottom: none; }
.source-item-name { font-size: 14px; font-weight: 500; }
.source-item-url { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.source-item-btns { display: flex; gap: 6px; }
.source-btn {
  padding: 4px 12px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--glass-border);
  background: transparent;
  color: var(--text-secondary);
  font-size: 12px;
  cursor: pointer;
  transition: all var(--transition);
}
.source-btn:hover { border-color: var(--glass-border-bright); color: var(--text-primary); }
.source-btn.danger:hover { border-color: rgba(255,59,48,0.5); color: var(--pink); }

.btn-primary {
  padding: 10px 24px;
  background: rgba(255,255,255,0.12);
  color: #fff;
  border: 1px solid rgba(255,255,255,0.1);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-primary:hover {
  background: rgba(255,255,255,0.18);
  transform: translateY(-1px);
}
.btn-secondary {
  padding: 10px 24px;
  background: var(--glass-bg);
  color: var(--text-primary);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all var(--transition);
}
.btn-secondary:hover { border-color: var(--glass-border-bright); }

/* ========= 弹窗 - Liquid Glass ========= */
.modal-overlay {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 1000;
  opacity: 0;
  visibility: hidden;
  transition: all 0.3s ease;
}
.modal-overlay.show { opacity: 1; visibility: visible; }
.modal {
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(60px) var(--glass-saturate);
  -webkit-backdrop-filter: blur(60px) var(--glass-saturate);
  border: 1px solid var(--glass-border-bright);
  border-radius: var(--radius-2xl);
  padding: 28px;
  min-width: 420px;
  max-width: 540px;
  box-shadow: var(--shadow-modal), var(--glass-refraction);
  transform: scale(0.92) translateY(10px);
  transition: transform 0.35s var(--spring-bounce);
}
.modal-overlay.show .modal { transform: scale(1) translateY(0); }
.modal-title {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 20px;
  letter-spacing: -0.01em;
}
.modal-field { margin-bottom: 16px; }
.modal-label { font-size: 13px; font-weight: 500; color: var(--text-label); margin-bottom: 6px; }
.modal-input {
  width: 100%;
  padding: 10px 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}
.modal-input:focus {
  border-color: var(--blue);
  box-shadow: var(--focus-glow);
}
.modal-input::placeholder { color: var(--text-muted); }
.modal-actions { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }
.form-group { margin-bottom: 16px; }
.form-label { font-size: 13px; font-weight: 500; color: var(--text-label); margin-bottom: 6px; }
.input-field {
  width: 100%;
  padding: 10px 14px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: border-color var(--transition);
}
.input-field:focus { border-color: var(--blue); box-shadow: var(--focus-glow); }
.input-field::placeholder { color: var(--text-muted); }
.modal-footer { display: flex; gap: 10px; justify-content: flex-end; margin-top: 24px; }

/* ========= Toast - Liquid Glass ========= */
#toast-container {
  position: fixed;
  top: 20px;
  right: 20px;
  z-index: 9999;
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.toast {
  padding: 12px 18px;
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(40px) var(--glass-saturate);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  color: var(--text-primary);
  font-size: 13px;
  box-shadow: var(--shadow-elevated), var(--glass-refraction);
  animation: toastIn 0.35s var(--spring);
  max-width: 320px;
  font-weight: 500;
}
.toast.success { border-left: 3px solid var(--green); }
.toast.error { border-left: 3px solid var(--pink); }
.toast.info { border-left: 3px solid var(--blue); }
@keyframes toastIn { from { opacity: 0; transform: translateX(30px) scale(0.95); } to { opacity: 1; transform: translateX(0) scale(1); } }

/* ========= 加载与空状态 ========= */
.loading-spinner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  height: 200px;
  color: var(--text-muted);
  gap: 12px;
  font-size: 13px;
}
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  gap: 12px;
  height: 100%;
}
.empty-state .icon { font-size: 64px; opacity: 0.2; }
.empty-state h3 { font-size: 17px; font-weight: 600; color: var(--text-primary); margin: 0; }
.empty-state p { font-size: 14px; color: var(--text-muted); text-align: center; margin: 0; }

/* ========= 频道号指示器 ========= */
.channel-indicator {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) scale(0.85);
  background: var(--bg-glass-heavy);
  backdrop-filter: blur(60px) var(--glass-saturate);
  border: 1px solid var(--glass-border-bright);
  border-radius: var(--radius-xl);
  padding: 20px 40px;
  text-align: center;
  z-index: 2000;
  display: none;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  box-shadow: var(--shadow-elevated), var(--glass-refraction);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s var(--spring);
}
.channel-indicator.show {
  display: flex !important;
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}
.channel-number {
  font-size: 48px;
  font-weight: 700;
  color: var(--text-primary);
  line-height: 1;
  font-variant-numeric: tabular-nums;
  letter-spacing: 2px;
}
.channel-name {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ========= 焦点导航 ========= */
[data-focusable] {
  outline: none;
  transition: all var(--focus-transition);
}
[data-focusable].focused {
  outline: none;
}
/* 按钮类焦点 */
.topbar-btn.focused,
.source-btn.focused,
.filter-tag.focused,
.episode-item.focused,
.source-tab.focused,
.player-ep-btn.focused {
  box-shadow: 0 0 0 2px rgba(255,255,255,0.15);
}

/* ========= 直播频道列表页 ========= */
.live-layout {
  display: flex;
  height: calc(100vh - var(--topbar-height));
  overflow: hidden;
}
.live-groups {
  width: 160px;
  flex-shrink: 0;
  background: var(--bg-glass);
  backdrop-filter: blur(30px);
  border-right: 1px solid var(--glass-border);
  overflow-y: auto;
  padding: 8px 6px;
}
.live-groups::-webkit-scrollbar { display: none; }
.live-groups-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 11px;
  color: var(--text-muted);
  padding: 10px 12px;
  font-weight: 600;
  text-transform: uppercase;
  letter-spacing: 0.5px;
}
.live-channel-count {
  background: var(--glass-bg);
  color: var(--text-secondary);
  font-size: 10px;
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  font-weight: 600;
}
.live-group-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 8px 12px;
  border: none;
  background: none;
  color: var(--text-secondary);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  border-radius: var(--radius);
  margin: 1px 4px;
  transition: all 0.15s ease;
  text-align: left;
}
.live-group-btn:hover,
.live-group-btn.focused { background: var(--bg-hover); color: var(--text-primary); }
.live-group-btn.active {
  background: rgba(255,255,255,0.12);
  color: var(--text-primary);
  font-weight: 600;
}
.live-group-count {
  font-size: 10px;
  background: rgba(255,255,255,0.08);
  padding: 1px 6px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
}
.live-group-btn.active .live-group-count { background: rgba(255,255,255,0.18); }

.live-channels {
  flex: 1;
  overflow-y: auto;
  padding: 12px 16px;
  min-width: 0;
}
.live-source-bar {
  display: flex;
  gap: 8px;
  align-items: center;
  margin-bottom: 14px;
  flex-wrap: wrap;
}
.live-search-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  background: var(--glass-bg);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-pill);
  padding: 8px 14px;
  margin-bottom: 14px;
  transition: border-color var(--transition);
}
.live-search-bar.focused { border-color: var(--blue); }
.live-search-bar input { background: none; border: none; outline: none; color: var(--text-primary); font-size: 13px; flex: 1; }

.channel-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 12px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 2px;
  border: 1px solid transparent;
}
.channel-item:hover, .channel-item.focused {
  background: var(--bg-hover);
  border-color: var(--glass-border);
}
.channel-item.active {
  background: rgba(10,132,255,0.08);
  border-color: rgba(10,132,255,0.2);
}
.channel-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.channel-logo {
  width: 42px;
  height: 42px;
  border-radius: var(--radius);
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  flex-shrink: 0;
  overflow: hidden;
}
.channel-logo img { width: 100%; height: 100%; object-fit: contain; }
.channel-info { flex: 1; min-width: 0; }
.channel-name { font-size: 14px; font-weight: 500; letter-spacing: -0.01em; }
.channel-epg { font-size: 12px; color: var(--text-muted); margin-top: 2px; }
.channel-actions {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
  flex-shrink: 0;
}
.channel-fav-btn {
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted);
  padding: 4px 8px;
  border-radius: var(--radius-sm);
  transition: all 0.2s;
}
.channel-fav-btn:hover,
.channel-fav-btn.active { color: var(--yellow); background: rgba(255,214,10,0.08); }
.channel-live-dot {
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--accent);
  flex-shrink: 0;
  animation: pulse 2s ease-in-out infinite;
  box-shadow: 0 0 6px rgba(229,9,20,0.4);
}
@keyframes pulse { 0%,100% { opacity: 1; } 50% { opacity: 0.3; } }

/* ========= 直播播放页 ========= */
.live-player-layout {
  display: flex;
  height: calc(100vh - var(--topbar-height));
  background: #000;
  overflow: hidden;
}
.live-player-main { flex: 1; display: flex; flex-direction: column; min-width: 0; background: #000; }
.live-video-wrap { flex: 1; position: relative; background: #000; min-height: 0; }
.live-video-wrap video { width: 100%; height: 100%; object-fit: contain; }

.live-loading-overlay {
  position: absolute; inset: 0;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.75);
  z-index: 10; gap: 12px;
}
.live-loading-overlay[style*="flex"],
.live-loading-overlay.show { display: flex !important; }

.live-error-overlay {
  position: absolute; inset: 0;
  display: none; flex-direction: column;
  align-items: center; justify-content: center;
  background: rgba(0,0,0,0.88);
  z-index: 11; gap: 12px; padding: 24px;
}
.live-error-overlay[style*="flex"],
.live-error-overlay.show { display: flex !important; }

.live-overlay {
  position: absolute; inset: 0;
  display: flex; flex-direction: column;
  justify-content: space-between;
  padding: 28px 32px;
  background: linear-gradient(180deg, rgba(0,0,0,0.6) 0%, transparent 25%, transparent 75%, rgba(0,0,0,0.6) 100%);
  opacity: 0;
  transition: opacity 0.3s ease;
  pointer-events: none;
  z-index: 5;
}
.live-overlay.show { opacity: 1; pointer-events: auto; }
.live-overlay-top { display: flex; flex-direction: column; gap: 4px; }
.live-overlay-bottom { display: flex; gap: 10px; align-items: center; }

.live-channel-title {
  font-size: 22px;
  font-weight: 600;
  color: #fff;
  text-shadow: 0 2px 12px rgba(0,0,0,0.6);
  letter-spacing: -0.01em;
}
.live-current-epg {
  font-size: 13px;
  color: rgba(255,255,255,0.5);
}
.live-ctrl-btns { display: flex; gap: 10px; }

.live-side-panel {
  width: 280px;
  flex-shrink: 0;
  background: var(--bg-glass);
  backdrop-filter: blur(30px);
  border-left: 1px solid var(--glass-border);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.live-side-header {
  padding: 14px 16px;
  border-bottom: 1px solid var(--glass-border);
  font-weight: 600;
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  letter-spacing: -0.01em;
}
.live-side-channels { flex: 1; overflow-y: auto; padding: 8px; }
.live-side-channels::-webkit-scrollbar { display: none; }
.live-side-channel-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 10px;
  border-radius: var(--radius);
  cursor: pointer;
  transition: all var(--transition);
  margin-bottom: 2px;
  border: 1px solid transparent;
}
.live-side-channel-item:hover,
.live-side-channel-item.focused { background: var(--bg-hover); }
.live-side-channel-item.active {
  background: rgba(10,132,255,0.08);
  border-color: rgba(10,132,255,0.2);
}
.live-side-ch-num {
  font-size: 12px;
  font-weight: 700;
  color: var(--blue);
  min-width: 28px;
  text-align: center;
  flex-shrink: 0;
}
.live-side-ch-logo {
  width: 32px;
  height: 32px;
  border-radius: 6px;
  background: var(--bg-tertiary);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.live-side-ch-name { font-size: 13px; font-weight: 500; flex: 1; letter-spacing: -0.01em; }

/* EPG 面板 */
.epg-panel {
  position: fixed; inset: 0;
  z-index: 1000;
  background: rgba(0,0,0,0.82);
  backdrop-filter: blur(20px) var(--glass-saturate);
  display: flex;
  flex-direction: column;
  padding: 40px 60px;
}
.epg-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 15px;
  font-weight: 600;
  color: var(--text-primary);
  margin-bottom: 16px;
  letter-spacing: -0.01em;
}
.epg-list { flex: 1; overflow-y: auto; padding: 0 4px; }
.epg-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px;
  border-radius: var(--radius);
  margin-bottom: 2px;
  transition: background 0.15s;
}
.epg-item:hover { background: var(--bg-hover); }
.epg-item.active {
  background: rgba(10,132,255,0.1);
  border-left: 3px solid var(--blue);
}
.epg-time {
  font-size: 12px;
  color: var(--text-muted);
  min-width: 110px;
  font-variant-numeric: tabular-nums;
}
.epg-title { font-size: 14px; color: var(--text-primary); flex: 1; font-weight: 500; }
.epg-now-badge {
  font-size: 10px;
  background: rgba(10,132,255,0.2);
  color: var(--blue);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-weight: 600;
  flex-shrink: 0;
}

/* 源卡片 */
.source-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  background: var(--bg-card);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-lg);
  margin-bottom: 8px;
  transition: all var(--transition);
  box-shadow: var(--glass-refraction);
}
.source-card:hover { border-color: var(--glass-border-bright); }
.source-card-name { font-size: 14px; font-weight: 500; margin-bottom: 2px; }
.source-card-url { font-size: 11px; color: var(--text-muted); max-width: 260px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.source-card-meta { font-size: 11px; color: var(--text-muted); margin-top: 2px; }
.source-card-count { color: var(--blue); font-weight: 600; }

/* mark 高亮 */
mark {
  background: rgba(10,132,255,0.3) !important;
  color: var(--text-primary) !important;
  border-radius: 3px;
  padding: 0 2px;
}

/* ========= 动画 ========= */
@keyframes fadeInUp { from { opacity: 0; transform: translateY(16px); } to { opacity: 1; transform: translateY(0); } }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
.fade-in { animation: fadeIn 0.5s var(--spring); }
.fade-in-up { animation: fadeInUp 0.6s var(--spring); }

/* ========= 响应式 ========= */
@media (max-width: 1200px) {
  .hero-banner { height: 300px; }
  .hero-title { font-size: 28px; }
  .detail-poster { width: 170px; height: 240px; }
  .card-grid { grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); }
}
@media (max-width: 900px) {
  #sidebar { display: none; }
  .live-side-panel { width: 220px; }
  .epg-panel { padding: 24px; }
}
@media (max-width: 600px) {
  .hero-banner { height: 220px; border-radius: var(--radius-xl); }
  .hero-content { right: 24px; bottom: 20px; }
  .hero-title { font-size: 22px; }
  .detail-layout { flex-direction: column; align-items: center; }
  .detail-poster { width: 160px; height: 230px; }
  .detail-info { width: 100%; }
  .live-side-panel { display: none; }
  .epg-panel { padding: 16px; }
}

/* v2.2 - 在线获取源 */
input[type="checkbox"] {
  appearance: none;
  width: 18px; height: 18px;
  border: 2px solid var(--glass-border);
  border-radius: 4px;
  background: var(--bg-card);
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  position: relative;
}
input[type="checkbox"]:checked {
  background: var(--accent-blue);
  border-color: var(--accent-blue);
}
input[type="checkbox"]:checked::after {
  content: '';
  position: absolute;
  left: 4px; top: 1px;
  width: 6px; height: 10px;
  border: solid #fff;
  border-width: 0 2px 2px 0;
  transform: rotate(45deg);
}
input[type="checkbox"]:focus-visible {
  outline: 2px solid var(--accent-blue);
  outline-offset: 2px;
}
