/* ========================================
   小宁影视网 — Apple 液态玻璃风格
   浅色主题 · Glassmorphism · SF Pro
   ======================================== */

/* ---------- 变量 ---------- */
:root {
  /* 背景 */
  --bg-primary: #f2f2f7;
  --bg-elevated: #ffffff;

  /* 玻璃卡片 */
  --glass-bg: rgba(255, 255, 255, 0.72);
  --glass-bg-hover: rgba(255, 255, 255, 0.88);
  --glass-bg-strong: rgba(255, 255, 255, 0.85);
  --glass-border: rgba(0, 0, 0, 0.08);
  --glass-border-hover: rgba(0, 0, 0, 0.14);
  --glass-blur: saturate(180%) blur(30px);

  /* 深色玻璃（深色区域使用） */
  --glass-dark-bg: rgba(0, 0, 0, 0.04);
  --glass-dark-border: rgba(0, 0, 0, 0.06);

  /* 文字 */
  --text-primary: #1d1d1f;
  --text-secondary: #6e6e73;
  --text-tertiary: #aeaeb2;
  --text-placeholder: #c7c7cc;

  /* 强调色 - Apple 蓝 */
  --accent: #007AFF;
  --accent-hover: #0066d6;
  --accent-dim: rgba(0, 122, 255, 0.1);
  --accent-glow: rgba(0, 122, 255, 0.2);

  /* 播放按钮 - 保持暖色 */
  --play: #FF3B30;
  --play-hover: #e0352b;
  --play-glow: rgba(255, 59, 48, 0.25);

  /* 阴影 - Apple 风格柔和阴影 */
  --shadow-sm: 0 1px 3px rgba(0, 0, 0, 0.04), 0 1px 2px rgba(0, 0, 0, 0.06);
  --shadow-md: 0 4px 12px rgba(0, 0, 0, 0.06), 0 2px 4px rgba(0, 0, 0, 0.04);
  --shadow-lg: 0 12px 40px rgba(0, 0, 0, 0.10), 0 4px 12px rgba(0, 0, 0, 0.06);
  --shadow-xl: 0 20px 60px rgba(0, 0, 0, 0.14), 0 8px 20px rgba(0, 0, 0, 0.08);
  --shadow-glass: 0 8px 32px rgba(0, 0, 0, 0.08), 0 2px 8px rgba(0, 0, 0, 0.04);

  /* 圆角 */
  --radius-sm: 8px;
  --radius: 12px;
  --radius-md: 16px;
  --radius-lg: 20px;
  --radius-xl: 24px;
  --radius-2xl: 28px;
  --radius-full: 9999px;

  /* 动画 */
  --spring: cubic-bezier(0.25, 0.1, 0.25, 1);
  --spring-bounce: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.16, 0.75, 0.35, 1);

  /* 尺寸 */
  --nav-h: 56px;
  --content-max: 1480px;
}

/* ---------- 背景光球 ---------- */
.bg-aura {
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  overflow: hidden;
}

.aura {
  position: absolute;
  border-radius: 50%;
  filter: blur(120px);
  opacity: 0.4;
  animation: auraFloat 20s ease-in-out infinite;
}

.aura-1 {
  width: 600px;
  height: 600px;
  background: radial-gradient(circle, rgba(0, 122, 255, 0.18), transparent 70%);
  top: -15%;
  left: -10%;
  animation-delay: 0s;
}

.aura-2 {
  width: 500px;
  height: 500px;
  background: radial-gradient(circle, rgba(255, 59, 48, 0.12), transparent 70%);
  top: 40%;
  right: -8%;
  animation-delay: -7s;
}

.aura-3 {
  width: 400px;
  height: 400px;
  background: radial-gradient(circle, rgba(175, 82, 222, 0.10), transparent 70%);
  bottom: 5%;
  left: 30%;
  animation-delay: -14s;
}

.aura-4 {
  width: 350px;
  height: 350px;
  background: radial-gradient(circle, rgba(52, 199, 89, 0.08), transparent 70%);
  top: 20%;
  left: 45%;
  animation-delay: -5s;
}

@keyframes auraFloat {
  0%, 100% { transform: translate(0, 0) scale(1); }
  25% { transform: translate(40px, -30px) scale(1.08); }
  50% { transform: translate(-20px, 20px) scale(0.95); }
  75% { transform: translate(-30px, -10px) scale(1.05); }
}

/* ---------- Reset ---------- */
*, *::before, *::after {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Display", "SF Pro Text",
    "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.5;
  min-height: 100vh;
  overflow-x: hidden;
  position: relative;
}

#app {
  position: relative;
  z-index: 1;
}

a {
  color: inherit;
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
}

button {
  font-family: inherit;
  cursor: pointer;
  border: none;
  background: none;
  color: inherit;
  -webkit-tap-highlight-color: transparent;
}

input {
  font-family: inherit;
  outline: none;
  border: none;
}

/* ---------- 滚动条 ---------- */
::-webkit-scrollbar {
  width: 6px;
  height: 6px;
}
::-webkit-scrollbar-track {
  background: transparent;
}
::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.15);
  border-radius: 3px;
}
::-webkit-scrollbar-thumb:hover {
  background: rgba(0, 0, 0, 0.25);
}

/* ========================================
   导航栏 — 液态玻璃
   ======================================== */
#navbar {
  position: fixed;
  top: 16px;
  left: 50%;
  transform: translateX(-50%);
  width: calc(100% - 32px);
  max-width: var(--content-max);
  z-index: 100;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-glass);
  transition: all 0.3s var(--spring);
}

.nav-container {
  height: var(--nav-h);
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 28px;
  flex: 1;
  min-width: 0;
}

/* Logo */
.logo {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 18px;
  font-weight: 700;
  letter-spacing: -0.3px;
  white-space: nowrap;
  color: var(--text-primary);
}

.logo-icon {
  flex-shrink: 0;
  filter: drop-shadow(0 2px 4px rgba(0, 122, 255, 0.25));
}

.logo-text {
  color: var(--text-primary);
}

.logo-accent {
  color: var(--accent);
}

/* 分类导航 */
.nav-cats {
  display: flex;
  align-items: center;
  gap: 2px;
  overflow-x: auto;
  scrollbar-width: none;
  -ms-overflow-style: none;
}
.nav-cats::-webkit-scrollbar {
  display: none;
}

.nav-cats a {
  padding: 7px 14px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  white-space: nowrap;
  transition: all 0.25s var(--spring);
  letter-spacing: -0.1px;
}

.nav-cats a:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}

.nav-cats a.active {
  color: var(--accent);
  background: var(--accent-dim);
  font-weight: 600;
}

/* 搜索框 — 液态玻璃 */
.nav-right {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  background: rgba(0, 0, 0, 0.04);
  border: 1px solid transparent;
  border-radius: var(--radius-full);
  padding: 0 16px;
  height: 38px;
  width: 240px;
  transition: all 0.3s var(--spring);
}

.search-box:focus-within {
  background: rgba(255, 255, 255, 0.9);
  border-color: var(--glass-border);
  box-shadow: var(--shadow-sm), 0 0 0 3px var(--accent-dim);
  width: 300px;
}

.search-icon {
  color: var(--text-tertiary);
  flex-shrink: 0;
  transition: color 0.2s;
}

.search-box:focus-within .search-icon {
  color: var(--accent);
}

#searchInput {
  flex: 1;
  background: none;
  color: var(--text-primary);
  font-size: 14px;
  min-width: 0;
  letter-spacing: -0.1px;
}

#searchInput::placeholder {
  color: var(--text-placeholder);
  font-weight: 400;
}

.search-clear {
  width: 22px;
  height: 22px;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  border-radius: 50%;
  color: var(--text-tertiary);
  transition: all 0.2s;
}
.search-clear:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.06);
}

/* 菜单按钮 */
.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  padding: 8px;
  border-radius: var(--radius-sm);
  transition: background 0.2s;
}
.menu-toggle:hover {
  background: rgba(0, 0, 0, 0.04);
}
.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: var(--text-primary);
  border-radius: 2px;
  transition: all 0.3s var(--spring);
}
.menu-toggle.active span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}
.menu-toggle.active span:nth-child(2) {
  opacity: 0;
}
.menu-toggle.active span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* 移动端分类 */
.mobile-cats {
  display: none;
  background: var(--glass-bg-strong);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
  padding: 6px 0;
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.4s var(--ease-out);
}
.mobile-cats.open {
  max-height: 500px;
  overflow-y: auto;
}
.mobile-cats a {
  display: block;
  padding: 13px 24px;
  font-size: 15px;
  color: var(--text-secondary);
  transition: background 0.15s;
}
.mobile-cats a:active {
  background: var(--accent-dim);
}

/* ========================================
   主内容区
   ======================================== */
#mainContent {
  margin-top: calc(var(--nav-h) + 32px);
  padding-top: 8px;
  min-height: calc(100vh - var(--nav-h) - 160px);
}

#viewContainer {
  min-height: 60vh;
}

/* ========================================
   首页 Hero — 液态玻璃卡片
   ======================================== */
.hero {
  max-width: var(--content-max);
  margin: 0 auto 40px;
  padding: 0 16px;
}

.hero-card {
  position: relative;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  height: 440px;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: flex-end;
}

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center 25%;
  transition: transform 0.6s var(--spring), opacity 0.6s;
}

.hero-card:hover .hero-bg {
  transform: scale(1.03);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(
    160deg,
    transparent 25%,
    rgba(0, 0, 0, 0.02) 40%,
    rgba(0, 0, 0, 0.15) 55%,
    rgba(0, 0, 0, 0.65) 75%,
    rgba(0, 0, 0, 0.85) 100%
  );
}

.hero-content {
  position: relative;
  z-index: 2;
  padding: 48px 44px;
  color: #fff;
  max-width: 580px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  padding: 5px 14px;
  border-radius: var(--radius-full);
  margin-bottom: 18px;
  letter-spacing: 0.3px;
}

.hero-title {
  font-size: 40px;
  font-weight: 800;
  line-height: 1.15;
  margin-bottom: 10px;
  letter-spacing: -0.5px;
}

.hero-meta {
  display: flex;
  gap: 16px;
  font-size: 14px;
  color: rgba(255, 255, 255, 0.75);
  margin-bottom: 14px;
  flex-wrap: wrap;
}

.hero-desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.65);
  line-height: 1.6;
  margin-bottom: 24px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions {
  display: flex;
  gap: 10px;
}

/* ========================================
   按钮 — Apple 风格
   ======================================== */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  padding: 12px 26px;
  border-radius: var(--radius-full);
  font-size: 15px;
  font-weight: 600;
  letter-spacing: -0.2px;
  transition: all 0.25s var(--spring);
  white-space: nowrap;
  position: relative;
  overflow: hidden;
}

.btn::after {
  content: '';
  position: absolute;
  inset: 0;
  border-radius: inherit;
  opacity: 0;
  transition: opacity 0.25s;
}

.btn:hover::after {
  opacity: 1;
}

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 2px 8px var(--accent-glow);
}
.btn-primary::after {
  background: linear-gradient(180deg, rgba(255,255,255,0.15) 0%, transparent 100%);
}
.btn-primary:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--accent-glow);
}
.btn-primary:active {
  transform: scale(0.97);
}

.btn-play {
  background: var(--play);
  color: #fff;
  box-shadow: 0 2px 8px var(--play-glow);
}
.btn-play::after {
  background: linear-gradient(180deg, rgba(255,255,255,0.2) 0%, transparent 100%);
}
.btn-play:hover {
  transform: translateY(-1px);
  box-shadow: 0 4px 16px var(--play-glow);
}
.btn-play:active {
  transform: scale(0.97);
}

.btn-secondary {
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.25);
  color: #fff;
}
.btn-secondary::after {
  background: rgba(255,255,255,0.1);
}
.btn-secondary:hover {
  background: rgba(255, 255, 255, 0.3);
  transform: translateY(-1px);
}
.btn-secondary:active {
  transform: scale(0.97);
}

.btn svg {
  flex-shrink: 0;
}

/* ========================================
   内容区
   ======================================== */
.content-section {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 16px 48px;
}

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

.section-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.3px;
}

.section-header a {
  font-size: 14px;
  font-weight: 500;
  color: var(--accent);
  transition: opacity 0.2s;
}
.section-header a:hover {
  opacity: 0.7;
}

/* 筛选条 — 液态玻璃 */
.filter-bar {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
  margin-bottom: 24px;
  padding: 4px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-full);
  width: fit-content;
}

.filter-chip {
  padding: 7px 18px;
  font-size: 13px;
  font-weight: 500;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  transition: all 0.2s var(--spring);
  cursor: pointer;
  letter-spacing: -0.1px;
}

.filter-chip:hover {
  color: var(--text-primary);
  background: rgba(0, 0, 0, 0.04);
}

.filter-chip.active {
  background: var(--bg-elevated);
  color: var(--accent);
  font-weight: 600;
  box-shadow: var(--shadow-sm);
}

/* ========================================
   视频网格
   ======================================== */
.video-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 24px;
}

/* 视频卡片 — 液态玻璃 */
.video-card {
  cursor: pointer;
  transition: transform 0.35s var(--spring-bounce);
}

.video-card:hover {
  transform: translateY(-6px);
}

.video-card .poster {
  position: relative;
  border-radius: var(--radius-md);
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-md);
  transition: box-shadow 0.35s var(--spring);
}

.video-card:hover .poster {
  box-shadow: var(--shadow-lg);
}

.video-card .poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s var(--spring), opacity 0.3s;
}

.video-card:hover .poster img {
  transform: scale(1.06);
}

.video-card .poster .placeholder {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, #e8e8ed, #f5f5fa);
  color: var(--text-tertiary);
  font-size: 13px;
  font-weight: 500;
}

/* 标签 */
.video-card .badge {
  position: absolute;
  top: 10px;
  left: 10px;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  color: var(--text-secondary);
  font-size: 11px;
  font-weight: 600;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  letter-spacing: 0.1px;
}

.video-card .badge-score {
  left: auto;
  right: 10px;
  background: rgba(255, 59, 48, 0.12);
  border-color: rgba(255, 59, 48, 0.2);
  color: var(--play);
}

/* 悬浮播放按钮 */
.video-card .overlay {
  position: absolute;
  inset: 0;
  background: rgba(0, 0, 0, 0.25);
  opacity: 0;
  transition: opacity 0.3s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.video-card:hover .overlay {
  opacity: 1;
}

.video-card .play-btn {
  width: 52px;
  height: 52px;
  border-radius: 50%;
  background: var(--glass-bg-strong);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid rgba(255, 255, 255, 0.3);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--play);
  transform: scale(0.8);
  transition: all 0.3s var(--spring-bounce);
  box-shadow: var(--shadow-lg);
}

.video-card:hover .play-btn {
  transform: scale(1);
}

.video-card .info {
  padding: 12px 4px 0;
}

.video-card .title {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-primary);
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  line-height: 1.4;
  letter-spacing: -0.1px;
}

.video-card .meta {
  font-size: 12px;
  color: var(--text-tertiary);
  margin-top: 4px;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
  overflow: hidden;
  letter-spacing: -0.05px;
}

/* ========================================
   详情页
   ======================================== */
.detail-page {
  max-width: var(--content-max);
  margin: 0 auto;
  padding: 0 16px 48px;
}

.detail-back {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 12px;
  margin-bottom: 16px;
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  border-radius: var(--radius-full);
  transition: all 0.2s;
}
.detail-back:hover {
  background: rgba(0, 0, 0, 0.04);
  color: var(--accent);
}

/* 详情头部 — 液态玻璃卡片 */
.detail-header {
  display: flex;
  gap: 36px;
  margin-bottom: 32px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-2xl);
  padding: 36px;
  box-shadow: var(--shadow-glass);
}

.detail-poster {
  flex-shrink: 0;
  width: 240px;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-lg);
  aspect-ratio: 2 / 3;
  background: #e8e8ed;
}

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

.detail-poster .placeholder {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 100%;
  color: var(--text-tertiary);
  font-size: 14px;
}

.detail-info {
  flex: 1;
  min-width: 0;
}

.detail-title {
  font-size: 32px;
  font-weight: 800;
  color: var(--text-primary);
  margin-bottom: 4px;
  line-height: 1.25;
  letter-spacing: -0.5px;
}

.detail-subtitle {
  font-size: 15px;
  color: var(--text-tertiary);
  margin-bottom: 16px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
}

.detail-meta .meta-item {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 5px 12px;
  font-size: 13px;
  color: var(--text-secondary);
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-full);
  font-weight: 500;
}

.detail-meta .meta-label {
  color: var(--text-tertiary);
  font-weight: 400;
}

.detail-score {
  font-size: 32px;
  font-weight: 800;
  color: var(--play);
  letter-spacing: -0.5px;
}

.detail-blurb {
  font-size: 15px;
  color: var(--text-secondary);
  line-height: 1.7;
  margin-bottom: 24px;
  max-width: 700px;
}

.detail-actions {
  display: flex;
  gap: 10px;
}

.detail-actions .btn-play {
  background: var(--play);
  box-shadow: 0 2px 8px var(--play-glow);
}

/* ========================================
   播放器区
   ======================================== */
.player-section {
  background: #000;
  border-radius: var(--radius-2xl);
  overflow: hidden;
  margin-bottom: 24px;
  box-shadow: var(--shadow-xl);
}

.player-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

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

.player-loading {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(0, 0, 0, 0.7);
  backdrop-filter: blur(4px);
  z-index: 5;
}

.player-loading .spinner {
  width: 44px;
  height: 44px;
  border: 3px solid rgba(255, 255, 255, 0.15);
  border-top-color: #fff;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}

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

.player-error {
  position: absolute;
  inset: 0;
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 10px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  color: rgba(255, 255, 255, 0.7);
  z-index: 6;
  font-size: 14px;
}

.player-error.show {
  display: flex;
}

.player-error svg {
  width: 40px;
  height: 40px;
  opacity: 0.4;
}

/* ========================================
   集数列表
   ======================================== */
.episode-section {
  margin-bottom: 32px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-glass);
}

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

.episode-title {
  font-size: 17px;
  font-weight: 700;
  color: var(--text-primary);
  letter-spacing: -0.2px;
}

.episode-count {
  font-size: 13px;
  color: var(--text-tertiary);
  font-weight: 500;
}

.episode-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(110px, 1fr));
  gap: 8px;
  max-height: 360px;
  overflow-y: auto;
}

.episode-item {
  padding: 9px 14px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  text-align: center;
  cursor: pointer;
  border-radius: var(--radius-sm);
  background: rgba(0, 0, 0, 0.03);
  transition: all 0.2s var(--spring);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  letter-spacing: -0.05px;
}

.episode-item:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
}

.episode-item.active {
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px var(--accent-glow);
}

/* ========================================
   演职员
   ======================================== */
.cast-section {
  margin-bottom: 32px;
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-xl);
  padding: 24px;
  box-shadow: var(--shadow-glass);
}

.cast-list {
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}

.cast-tag {
  padding: 6px 16px;
  background: rgba(0, 0, 0, 0.03);
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  letter-spacing: -0.05px;
  transition: all 0.2s;
}
.cast-tag:hover {
  background: rgba(0, 0, 0, 0.06);
  color: var(--text-primary);
}

/* ========================================
   分页
   ======================================== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 4px;
  padding: 36px 0 8px;
}

.page-btn {
  min-width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--glass-bg);
  backdrop-filter: blur(10px);
  -webkit-backdrop-filter: blur(10px);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius-sm);
  font-size: 14px;
  font-weight: 500;
  color: var(--text-secondary);
  transition: all 0.2s var(--spring);
  padding: 0 12px;
  letter-spacing: -0.1px;
}

.page-btn:hover:not(:disabled) {
  background: var(--glass-bg-hover);
  color: var(--text-primary);
  border-color: var(--glass-border-hover);
  transform: translateY(-1px);
}

.page-btn.active {
  background: var(--accent);
  border-color: var(--accent);
  color: #fff;
  font-weight: 600;
  box-shadow: 0 2px 8px var(--accent-glow);
}

.page-btn:disabled {
  opacity: 0.35;
  cursor: not-allowed;
}

.page-ellipsis {
  color: var(--text-tertiary);
  padding: 0 6px;
  font-size: 14px;
}

/* ========================================
   加载状态
   ======================================== */
.loading-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(190px, 1fr));
  gap: 24px;
}

.skeleton-card {
  border-radius: var(--radius-md);
  overflow: hidden;
}

.skeleton-poster {
  aspect-ratio: 2 / 3;
  background: linear-gradient(120deg, #e8e8ed 25%, #f0f0f5 50%, #e8e8ed 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
  border-radius: var(--radius-md);
}

.skeleton-line {
  height: 13px;
  margin-top: 10px;
  border-radius: 6px;
  background: linear-gradient(120deg, #e8e8ed 25%, #f0f0f5 50%, #e8e8ed 75%);
  background-size: 200% 100%;
  animation: shimmer 1.8s infinite;
}

.skeleton-line.short {
  width: 60%;
}

@keyframes shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

/* 居中加载 */
.center-loading {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 80px 0;
}

.center-loading .spinner {
  width: 36px;
  height: 36px;
  border: 2.5px solid rgba(0, 0, 0, 0.08);
  border-top-color: var(--accent);
  border-radius: 50%;
  animation: spin 0.7s linear infinite;
}

/* ========================================
   空状态
   ======================================== */
.empty-state {
  text-align: center;
  padding: 80px 24px;
  color: var(--text-tertiary);
}

.empty-state svg {
  width: 56px;
  height: 56px;
  margin: 0 auto 16px;
  opacity: 0.25;
  stroke: var(--text-secondary);
}

.empty-state h3 {
  font-size: 17px;
  font-weight: 600;
  margin-bottom: 6px;
  color: var(--text-secondary);
  letter-spacing: -0.2px;
}

.empty-state p {
  font-size: 14px;
}

/* ========================================
   底部
   ======================================== */
#footer {
  background: var(--glass-bg);
  backdrop-filter: var(--glass-blur);
  -webkit-backdrop-filter: var(--glass-blur);
  border-top: 1px solid var(--glass-border);
  padding: 32px 24px;
  text-align: center;
}

.footer-inner {
  max-width: var(--content-max);
  margin: 0 auto;
}

.footer-inner p {
  font-size: 13px;
  color: var(--text-tertiary);
  margin-bottom: 4px;
}

.footer-inner a {
  color: var(--accent);
  font-weight: 500;
}

.footer-disclaimer {
  font-size: 12px !important;
}

/* ========================================
   响应式 — 手机/平板全面适配
   ======================================== */

/* 安全区域（刘海屏/底部指示条） */
@supports (padding-top: env(safe-area-inset-top)) {
  #navbar {
    top: calc(16px + env(safe-area-inset-top));
  }
  #mainContent {
    padding-top: env(safe-area-inset-top);
  }
  #footer {
    padding-bottom: calc(32px + env(safe-area-inset-bottom));
  }
}

/* 手机上禁止 hover 效果（保留 :active） */
@media (hover: none) and (pointer: coarse) {
  .video-card:hover { transform: none; }
  .video-card:hover .poster img { transform: none; }
  .video-card:hover .poster { box-shadow: var(--shadow-md); }
  .video-card:hover .overlay { opacity: 0; }
  .video-card:active { transform: scale(0.97); }
  .video-card:active .overlay { opacity: 1; }
  .video-card:active .play-btn { transform: scale(1); }
  .btn:hover { transform: none; }
  .btn:active { transform: scale(0.95); }
  .page-btn:hover:not(:disabled) { transform: none; }
  .page-btn:active:not(:disabled) { transform: scale(0.95); }
}

/* ——— 平板 ≤1024 ——— */
@media (max-width: 1024px) {
  .nav-cats { display: none; }
  .menu-toggle { display: flex; }
  .mobile-cats { display: block; }
  .search-box { width: 180px; }
  .search-box:focus-within { width: 220px; }
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
  .loading-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); gap: 18px; }
  .hero-card { height: 340px; }
  .hero-title { font-size: 30px; }
  .detail-header { flex-direction: column; gap: 24px; padding: 28px; }
  .detail-poster { width: 180px; margin: 0 auto; }
  .detail-title { font-size: 26px; }
}

/* ——— 手机横屏 / 小平板 ≤768 ——— */
@media (max-width: 768px) {
  #navbar {
    top: 8px;
    width: calc(100% - 16px);
    border-radius: var(--radius-lg);
  }
  .nav-container { padding: 0 10px 0 14px; height: 48px; gap: 10px; }
  .nav-left { gap: 10px; }
  .logo { font-size: 16px; }
  .logo-icon { width: 24px; height: 24px; }

  /* 搜索在手机上占满剩余空间 */
  .search-box {
    flex: 1;
    height: 34px;
    padding: 0 12px;
    width: auto;
    max-width: none;
  }
  .search-box:focus-within {
    width: 100%;
  }
  #searchInput { font-size: 13px; }
  .search-icon { width: 16px; height: 16px; }
  .nav-right { flex: 1; min-width: 0; }

  /* 移动端菜单展开 */
  .mobile-cats a {
    padding: 14px 20px;
    font-size: 16px;
    min-height: 44px;
    display: flex;
    align-items: center;
  }

  .content-section { padding: 0 12px 32px; }
  .detail-page { padding: 0 12px 32px; }

  /* Hero 缩小 */
  .hero { padding: 0 12px; margin-bottom: 28px; }
  .hero-card {
    height: 260px;
    border-radius: var(--radius-lg);
  }
  .hero-title { font-size: 22px; }
  .hero-content { padding: 24px 20px; }
  .hero-desc { font-size: 12px; -webkit-line-clamp: 2; }
  .hero-meta { font-size: 12px; gap: 10px; }
  .hero-badge { font-size: 11px; padding: 4px 10px; }

  /* 按钮缩小 */
  .btn { padding: 10px 18px; font-size: 14px; min-height: 44px; }
  .btn svg { width: 16px; height: 16px; }

  /* 视频网格 */
  .video-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 14px; }
  .video-card .title { font-size: 13px; }
  .video-card .meta { font-size: 11px; }
  .video-card .info { padding: 8px 2px 0; }
  .video-card .badge { font-size: 10px; padding: 2px 8px; top: 6px; left: 6px; }
  .video-card .badge-score { right: 6px; }

  .section-title { font-size: 17px; }

  /* 筛选条水平滚动 */
  .filter-bar {
    width: 100%;
    overflow-x: auto;
    flex-wrap: nowrap;
    scrollbar-width: none;
    -ms-overflow-style: none;
    border-radius: var(--radius-lg);
    padding: 4px 6px;
  }
  .filter-bar::-webkit-scrollbar { display: none; }
  .filter-chip {
    flex-shrink: 0;
    padding: 8px 16px;
    font-size: 13px;
    min-height: 36px;
  }

  /* 详情页 */
  .detail-header {
    padding: 18px;
    border-radius: var(--radius-lg);
    gap: 18px;
  }
  .detail-poster { width: 130px; }
  .detail-title { font-size: 20px; text-align: center; }
  .detail-subtitle { text-align: center; font-size: 13px; }
  .detail-meta { justify-content: center; gap: 4px; }
  .detail-meta .meta-item { font-size: 12px; padding: 4px 10px; }
  .detail-score { font-size: 26px; }
  .detail-blurb { font-size: 13px; text-align: left; }
  .detail-actions { justify-content: center; }
  .detail-back { font-size: 13px; min-height: 40px; }

  /* 播放器全宽 */
  .player-section {
    border-radius: var(--radius-md);
    margin-left: -12px;
    margin-right: -12px;
    width: calc(100% + 24px);
  }

  /* 集数列表 */
  .episode-section, .cast-section {
    padding: 16px;
    border-radius: var(--radius-lg);
  }
  .episode-title { font-size: 16px; }
  .episode-list {
    grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
    gap: 6px;
    max-height: 280px;
  }
  .episode-item {
    padding: 10px 8px;
    font-size: 12px;
    min-height: 40px;
  }
  .cast-tag { font-size: 12px; padding: 6px 14px; }

  /* 分页缩小 */
  .pagination { gap: 3px; padding: 24px 0 8px; }
  .page-btn {
    min-width: 32px;
    height: 32px;
    font-size: 13px;
    padding: 0 8px;
    border-radius: 6px;
  }

  /* 底部 */
  #footer { padding: 24px 16px; }
  .footer-disclaimer { font-size: 11px !important; }
}

/* ——— 手机竖屏 ≤480 ——— */
@media (max-width: 480px) {
  #navbar {
    top: 4px;
    width: calc(100% - 12px);
    border-radius: var(--radius);
  }
  .nav-container { padding: 0 8px 0 12px; height: 44px; gap: 8px; }
  .logo { font-size: 15px; }
  .logo-icon { width: 22px; height: 22px; }
  .search-box { height: 32px; padding: 0 10px; }
  #searchInput { font-size: 12px; }
  #searchInput::placeholder { font-size: 12px; }

  /* 视频 2 列 */
  .video-grid { grid-template-columns: repeat(2, 1fr); gap: 10px; }
  .video-card .title { font-size: 12px; }
  .video-card .meta { font-size: 10px; }
  .video-card .badge { font-size: 9px; padding: 2px 7px; top: 4px; left: 4px; }
  .video-card .badge-score { right: 4px; }

  /* Hero 更紧凑 */
  .hero { padding: 0 8px; margin-bottom: 24px; }
  .hero-card { height: 220px; }
  .hero-title { font-size: 18px; }
  .hero-content { padding: 18px 16px; }
  .hero-desc { display: none; }
  .hero-meta { font-size: 11px; gap: 8px; }
  .hero-actions { flex-direction: row; gap: 8px; }
  .hero-actions .btn { padding: 8px 14px; font-size: 12px; min-height: 36px; flex: 1; justify-content: center; }

  .content-section { padding: 0 8px 24px; }
  .detail-page { padding: 0 8px 24px; }
  .section-title { font-size: 16px; }

  /* 详情 */
  .detail-header { padding: 14px; }
  .detail-poster { width: 110px; }
  .detail-title { font-size: 18px; }
  .detail-blurb { font-size: 12px; }
  .detail-meta .meta-item { font-size: 11px; padding: 3px 8px; }

  .episode-section, .cast-section { padding: 12px; }
  .episode-list {
    grid-template-columns: repeat(auto-fill, minmax(68px, 1fr));
    gap: 5px;
    max-height: 240px;
  }
  .episode-item { padding: 8px 6px; font-size: 11px; min-height: 36px; }
  .cast-tag { font-size: 11px; padding: 4px 10px; }

  /* 分页更紧凑 */
  .page-btn {
    min-width: 28px;
    height: 28px;
    font-size: 12px;
  }
  .page-ellipsis { font-size: 12px; padding: 0 2px; }
}

/* ——— 极小屏 ≤360 ——— */
@media (max-width: 360px) {
  .video-grid { gap: 8px; }
  .hero-card { height: 190px; }
  .hero-title { font-size: 16px; }
  .hero-content { padding: 14px 12px; }
  .hero-meta { font-size: 10px; }
  .hero-actions .btn { padding: 6px 10px; font-size: 11px; min-height: 32px; }
  .detail-poster { width: 90px; }
  .detail-title { font-size: 16px; }
  .episode-item { padding: 7px 4px; font-size: 10px; min-height: 32px; }
}
