/* ===========================
   追剧时光 - 深邃电影感主题
   =========================== */
* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

:root {
  --primary: #f5c518;        /* 电影金 */
  --primary-dark: #d4a800;
  --bg-dark: #0d0d0d;
  --bg-card: #1a1a1a;
  --bg-card-hover: #252525;
  --text-primary: #ffffff;
  --text-secondary: #a0a0a0;
  --text-muted: #666666;
  --border: #333333;
  --accent: #e50914;         /* 播放按钮红 */
  --gradient-hero: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg-dark);
  color: var(--text-primary);
  line-height: 1.7;
  min-height: 100vh;
  -webkit-font-smoothing: antialiased;
}

a {
  color: var(--text-primary);
  text-decoration: none;
  transition: all 0.3s ease;
}

a:hover {
  color: var(--primary);
}

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

.container {
  max-width: 1400px;
  margin: 0 auto;
  padding: 0 24px;
}

/* ===========================
   头部导航
   =========================== */
.header {
  background: rgba(13, 13, 13, 0.95);
  backdrop-filter: blur(20px);
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid var(--border);
}

.header-content {
  display: flex;
  align-items: center;
  padding: 14px 0;
  gap: 40px;
}

.logo {
  font-size: 26px;
  font-weight: 800;
  color: var(--primary) !important;
  letter-spacing: -0.5px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo::before {
  content: '🎬';
}

.nav {
  display: flex;
  gap: 8px;
  flex: 1;
}

.nav-item {
  padding: 10px 20px;
  border-radius: 8px;
  font-weight: 500;
  font-size: 15px;
  transition: all 0.2s;
}

.nav-item:hover {
  background: rgba(255, 255, 255, 0.08);
  color: var(--text-primary);
}

.nav-item.active {
  background: var(--primary);
  color: #000 !important;
  font-weight: 600;
}

.search-box {
  display: flex;
  gap: 0;
}

.search-box input {
  padding: 10px 18px;
  border: 1px solid var(--border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: var(--bg-card);
  color: var(--text-primary);
  width: 220px;
  font-size: 14px;
  outline: none;
  transition: border-color 0.2s;
}

.search-box input:focus {
  border-color: var(--primary);
}

.search-box input::placeholder {
  color: var(--text-muted);
}

.search-box button {
  padding: 10px 18px;
  border: none;
  border-radius: 0 8px 8px 0;
  background: var(--primary);
  color: #000;
  font-size: 16px;
  cursor: pointer;
  transition: background 0.2s;
}

.search-box button:hover {
  background: var(--primary-dark);
}

/* ===========================
   轮播区域
   =========================== */
.hero {
  padding: 30px 0;
}

.hero-slider {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 20px;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.hero-slider::-webkit-scrollbar {
  display: none;
}

.hero-item {
  position: relative;
  border-radius: 16px;
  overflow: hidden;
  aspect-ratio: 16/10;
  scroll-snap-align: start;
  cursor: pointer;
  transition: transform 0.3s, box-shadow 0.3s;
}

.hero-item:hover {
  transform: translateY(-4px);
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.4);
}

.hero-item img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s;
}

.hero-item:hover img {
  transform: scale(1.05);
}

.hero-item .overlay {
  position: absolute;
  bottom: 0;
  left: 0;
  right: 0;
  padding: 60px 24px 24px;
  background: linear-gradient(transparent, rgba(0,0,0,0.95));
}

.hero-item .title {
  font-size: 20px;
  font-weight: 700;
  margin-bottom: 6px;
  text-shadow: 0 2px 4px rgba(0,0,0,0.5);
}

.hero-item .meta {
  font-size: 14px;
  color: var(--text-secondary);
}

/* ===========================
   电影网格
   =========================== */
.main {
  padding: 40px 0 60px;
  min-height: calc(100vh - 200px);
}

.section {
  margin-bottom: 50px;
}

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

.section-title {
  font-size: 22px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 10px;
}

.more {
  color: var(--primary) !important;
  font-size: 14px;
  font-weight: 500;
  opacity: 0.9;
}

.more:hover {
  opacity: 1;
  text-decoration: underline;
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 24px;
}

.movie-card {
  background: var(--bg-card);
  border-radius: 12px;
  overflow: hidden;
  transition: all 0.3s ease;
  cursor: pointer;
}

.movie-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 16px 48px rgba(245, 197, 24, 0.15);
  background: var(--bg-card-hover);
}

.movie-card .poster {
  position: relative;
  aspect-ratio: 2/3;
  overflow: hidden;
  background: #111;
}

.movie-card .poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.movie-card:hover .poster img {
  transform: scale(1.08);
}

.movie-card .poster .tag {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 4px 10px;
  background: var(--primary);
  color: #000;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
}

.movie-card .poster .score {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 4px 10px;
  background: rgba(0, 0, 0, 0.85);
  backdrop-filter: blur(4px);
  border-radius: 6px;
  font-size: 12px;
  font-weight: 600;
  color: var(--primary);
}

.movie-card .info {
  padding: 14px;
}

.movie-card .title {
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  line-height: 1.4;
}

.movie-card .meta {
  font-size: 13px;
  color: var(--text-secondary);
}

/* ===========================
   电影详情页
   =========================== */
.breadcrumb {
  padding: 20px 0;
  color: var(--text-secondary);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--text-secondary);
}

.breadcrumb a:hover {
  color: var(--primary);
}

.breadcrumb span {
  color: var(--text-muted);
}

.movie-detail {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 48px;
  padding: 40px;
  background: var(--bg-card);
  border-radius: 20px;
  margin-bottom: 40px;
}

.detail-poster {
  position: relative;
}

.detail-poster img {
  width: 100%;
  border-radius: 16px;
  box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

.play-btn {
  margin-top: 20px;
  padding: 16px 24px;
  background: var(--accent);
  border: none;
  border-radius: 12px;
  text-align: center;
  font-size: 16px;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: all 0.3s;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
}

.play-btn:hover {
  background: #c40812;
  transform: scale(1.02);
}

.play-btn:disabled {
  background: var(--text-muted);
  cursor: not-allowed;
  transform: none;
}

.detail-title {
  font-size: 32px;
  font-weight: 800;
  margin-bottom: 16px;
  line-height: 1.3;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 28px;
  padding-bottom: 24px;
  border-bottom: 1px solid var(--border);
}

.detail-meta span {
  padding: 8px 16px;
  background: var(--bg-dark);
  border-radius: 8px;
  font-size: 14px;
  font-weight: 500;
}

.detail-meta .score {
  color: var(--primary);
  background: rgba(245, 197, 24, 0.12);
}

.detail-section {
  margin-bottom: 24px;
}

.detail-section h3 {
  font-size: 14px;
  font-weight: 600;
  color: var(--text-muted);
  margin-bottom: 10px;
  text-transform: uppercase;
  letter-spacing: 1px;
}

.detail-section p {
  line-height: 1.8;
  color: var(--text-secondary);
}

.description {
  color: var(--text-secondary) !important;
  line-height: 1.9 !important;
}

/* ===========================
   播放器模态框
   =========================== */
.player-modal {
  display: none;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background: rgba(0, 0, 0, 0.97);
  z-index: 1000;
  justify-content: center;
  align-items: center;
}

.player-modal.active {
  display: flex;
}

.player-content {
  width: 95%;
  max-width: 1200px;
  background: var(--bg-card);
  border-radius: 20px;
  overflow: hidden;
  box-shadow: 0 40px 100px rgba(0, 0, 0, 0.5);
}

.player-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 16px 24px;
  background: var(--bg-dark);
  border-bottom: 1px solid var(--border);
}

.player-header h3 {
  font-size: 16px;
  font-weight: 600;
}

.close-btn {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: 50%;
  background: var(--bg-card);
  color: var(--text-primary);
  font-size: 24px;
  cursor: pointer;
  transition: all 0.2s;
  display: flex;
  align-items: center;
  justify-content: center;
}

.close-btn:hover {
  background: var(--accent);
  transform: scale(1.1);
}

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

.player-wrapper video {
  width: 100%;
  height: 100%;
}

/* ===========================
   页脚
   =========================== */
.footer {
  padding: 40px 0;
  text-align: center;
  background: var(--bg-card);
  border-top: 1px solid var(--border);
  color: var(--text-muted);
}

.footer p {
  margin: 6px 0;
  font-size: 14px;
}

/* ===========================
   工具类
   =========================== */
.loading,
.error {
  text-align: center;
  padding: 80px 20px;
  color: var(--text-secondary);
  font-size: 18px;
}

.no-results {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-muted);
  font-size: 16px;
  grid-column: 1 / -1;
}

.page-title {
  font-size: 28px;
  font-weight: 800;
  margin-bottom: 8px;
}

.page-subtitle {
  color: var(--text-secondary);
  margin-bottom: 30px;
}

/* ===========================
   响应式
   =========================== */
@media (max-width: 1024px) {
  .hero-slider {
    grid-template-columns: repeat(2, 1fr);
  }

  .movie-grid {
    grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
    gap: 16px;
  }
}

@media (max-width: 768px) {
  .header-content {
    flex-wrap: wrap;
    gap: 16px;
  }

  .nav {
    order: 3;
    width: 100%;
    overflow-x: auto;
    gap: 6px;
    padding-bottom: 8px;
  }

  .nav-item {
    padding: 8px 14px;
    font-size: 14px;
  }

  .search-box {
    margin-left: auto;
  }

  .search-box input {
    width: 160px;
  }

  .hero-slider {
    grid-template-columns: 1fr;
  }

  .movie-detail {
    grid-template-columns: 1fr;
    padding: 24px;
    gap: 24px;
  }

  .detail-poster {
    max-width: 240px;
    margin: 0 auto;
  }

  .detail-title {
    font-size: 24px;
    text-align: center;
  }
}

@media (max-width: 480px) {
  .movie-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
  }

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