/* 电影搜索引擎 - 全局样式 */
:root {
  --bg-primary: #0a0e17;
  --bg-secondary: #111827;
  --bg-card: #1a2235;
  --bg-glass: rgba(26, 34, 53, 0.8);
  --text-primary: #e2e8f0;
  --text-secondary: #94a3b8;
  --text-muted: #64748b;
  --accent-blue: #3b82f6;
  --accent-cyan: #06b6d4;
  --accent-purple: #8b5cf6;
  --accent-pink: #ec4899;
  --accent-gold: #f59e0b;
  --border-color: rgba(59, 130, 246, 0.15);
  --shadow: 0 8px 32px rgba(0, 0, 0, 0.3);
  --radius: 12px;
  --radius-lg: 20px;
}

* { margin: 0; padding: 0; box-sizing: border-box; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg-primary);
  color: var(--text-primary);
  line-height: 1.6;
  min-height: 100vh;
}

/* 滚动条 */
::-webkit-scrollbar { width: 6px; }
::-webkit-scrollbar-track { background: var(--bg-primary); }
::-webkit-scrollbar-thumb { background: #2d3748; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #4a5568; }

/* ===== 导航栏 ===== */
.navbar {
  position: fixed; top: 0; left: 0; right: 0; z-index: 1000;
  background: rgba(10, 14, 23, 0.85);
  backdrop-filter: blur(20px);
  -webkit-backdrop-filter: blur(20px);
  border-bottom: 1px solid var(--border-color);
  padding: 0 24px;
  height: 64px;
  display: flex;
  align-items: center;
  gap: 20px;
}

.navbar .logo {
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, var(--accent-cyan), var(--accent-purple));
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
  text-decoration: none;
  flex-shrink: 0;
  letter-spacing: -0.5px;
}

.navbar .logo span { font-weight: 300; opacity: 0.7; }

.nav-search {
  flex: 1; max-width: 520px; position: relative;
}

.nav-search input {
  width: 100%; height: 40px;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: 100px;
  padding: 0 44px 0 18px;
  color: var(--text-primary);
  font-size: 14px;
  outline: none;
  transition: all 0.3s;
}

.nav-search input:focus {
  border-color: var(--accent-blue);
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.15);
}

.nav-search .search-btn {
  position: absolute; right: 4px; top: 4px;
  width: 32px; height: 32px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border: none; border-radius: 50%;
  color: #fff; font-size: 14px;
  cursor: pointer; transition: transform 0.2s;
}

.nav-search .search-btn:hover { transform: scale(1.05); }

.nav-cats {
  display: flex; gap: 6px; overflow-x: auto;
  scrollbar-width: none; flex-shrink: 0;
}

.nav-cats::-webkit-scrollbar { display: none; }

.nav-cats a {
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 13px;
  color: var(--text-secondary);
  text-decoration: none;
  white-space: nowrap;
  transition: all 0.2s;
  border: 1px solid transparent;
}

.nav-cats a:hover, .nav-cats a.active {
  color: var(--text-primary);
  background: rgba(59, 130, 246, 0.1);
  border-color: var(--border-color);
}

.nav-cats a.active {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  color: #fff; border-color: transparent;
}

/* ===== 主容器 ===== */
.main { margin-top: 64px; min-height: calc(100vh - 64px); }
.container { max-width: 1400px; margin: 0 auto; padding: 24px; }

/* ===== 轮播图 ===== */
.banner-wrap {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  margin-bottom: 32px;
  height: 380px;
}

.banner-slide {
  position: absolute; inset: 0;
  opacity: 0; transition: opacity 0.8s ease;
  display: flex; align-items: flex-end;
  background: linear-gradient(135deg, #0a0e17 0%, transparent 50%, #0a0e17 100%);
}

.banner-slide.active { opacity: 1; }

.banner-slide .bg {
  position: absolute; inset: -20px;
  background-size: cover; background-position: center;
  /* 横版封面直接清晰显示，不再使用竖版海报时代的模糊压暗 */
  filter: none;
  z-index: 0;
}

.banner-slide .content {
  position: relative; z-index: 1;
  padding: 40px;
  max-width: 600px;
}

.banner-slide .content h2 { font-size: 28px; font-weight: 700; margin-bottom: 8px; }
.banner-slide .content .meta { color: var(--text-secondary); font-size: 13px; margin-bottom: 10px; }
.banner-slide .content .desc { color: var(--text-muted); font-size: 14px; line-height: 1.7; }
.banner-slide .content .btn {
  display: inline-block; margin-top: 16px;
  padding: 10px 28px;
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border-radius: 100px; color: #fff; font-weight: 600;
  text-decoration: none; font-size: 14px;
  transition: transform 0.2s;
}

.banner-slide .content .btn:hover { transform: scale(1.05); }

.banner-dots {
  position: absolute; bottom: 16px; left: 50%; transform: translateX(-50%);
  display: flex; gap: 8px; z-index: 2;
}

.banner-dots span {
  width: 8px; height: 8px; border-radius: 50%;
  background: rgba(255,255,255,0.3); cursor: pointer;
  transition: all 0.3s;
}

.banner-dots span.active { background: var(--accent-cyan); width: 24px; border-radius: 4px; }

/* ===== 电影网格 ===== */
.section-header {
  display: flex; align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.section-header h2 {
  font-size: 20px; font-weight: 700;
  display: flex; align-items: center; gap: 10px;
}

.section-header h2::before {
  content: ''; display: inline-block;
  width: 4px; height: 20px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--accent-cyan), var(--accent-purple));
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(160px, 1fr));
  gap: 16px;
  margin-bottom: 32px;
}

.movie-card {
  background: var(--bg-card);
  border-radius: var(--radius);
  overflow: hidden;
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid transparent;
  position: relative;
}

.movie-card:hover {
  transform: translateY(-4px);
  border-color: var(--border-color);
  box-shadow: 0 12px 40px rgba(0,0,0,0.4);
}

.movie-card .poster {
  aspect-ratio: 2/3;
  background-size: cover;
  background-position: center;
  position: relative;
}

.movie-card .poster .rating {
  position: absolute; top: 8px; right: 8px;
  background: rgba(0,0,0,0.7);
  backdrop-filter: blur(4px);
  padding: 2px 8px;
  border-radius: 100px;
  font-size: 12px;
  color: var(--accent-gold);
  font-weight: 700;
}

.movie-card .poster .play-overlay {
  position: absolute; inset: 0;
  background: rgba(0,0,0,0.4);
  display: flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity 0.3s;
}

/* 简介浮层：电脑端鼠标悬停封面才显示（手机端隐藏，见 media query） */
.movie-card .poster .poster-desc {
  position: absolute; inset: 0; z-index: 2;
  background: rgba(10, 14, 23, 0.88);
  display: flex; align-items: center; justify-content: center;
  padding: 12px;
  font-size: 12px; line-height: 1.7;
  color: var(--text-primary); text-align: center;
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}
.movie-card:hover .poster .poster-desc { opacity: 1; }

/* 手机端卡片简介：标题下方固定 2 行省略 */
.cat-desc {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
  font-size: 12px; line-height: 1.6;
  color: var(--text-muted); margin-top: 4px;
  max-height: 38px;
}
@media (min-width: 769px) {
  .cat-desc { display: none; }  /* 电脑端不显示正文简介（hover 浮层代替） */
}

.movie-card:hover .play-overlay { opacity: 1; }

.movie-card .poster .play-overlay .icon {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: rgba(59,130,246,0.8);
  backdrop-filter: blur(8px);
  display: flex; align-items: center; justify-content: center;
  font-size: 20px; color: #fff;
}

.movie-card .info {
  padding: 10px 12px 12px;
}

.movie-card .info .title {
  font-size: 14px; font-weight: 600;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}

.movie-card .info .meta {
  font-size: 12px; color: var(--text-muted);
  margin-top: 4px;
}

/* ===== 广告位 ===== */
.ad-slot {
  background: linear-gradient(135deg, #1a2235, #111827);
  border: 1px dashed var(--border-color);
  border-radius: var(--radius);
  padding: 24px;
  text-align: center;
  color: var(--text-muted);
  font-size: 13px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}

.ad-slot::before {
  content: '广告';
  position: absolute; top: 8px; right: 12px;
  font-size: 10px; color: var(--text-muted);
  background: rgba(100,116,139,0.1);
  padding: 2px 8px; border-radius: 4px;
}

.ad-slot .ad-placeholder {
  min-height: 60px;
  display: flex; align-items: center; justify-content: center;
  gap: 8px;
}

/* ===== 广告位尺寸变体 ===== */
.ad-slot.ad-banner { min-height: 90px; }
.ad-slot.ad-sidebar { min-height: 250px; }
.ad-slot.ad-player-top { min-height: 60px; margin-bottom: 16px; }
.ad-slot.ad-player-bottom { min-height: 60px; margin-top: 16px; }

/* ===== 搜索页 ===== */
.search-page { padding-top: 24px; }
.search-page .search-header { margin-bottom: 24px; }
.search-page .search-header h1 { font-size: 24px; font-weight: 700; }
.search-page .search-header .sub { color: var(--text-muted); font-size: 14px; margin-top: 4px; }

.search-results { display: flex; flex-direction: column; gap: 12px; margin-bottom: 28px; } /* 老板 2026-08-18：与下方广告位留空隙 */

/* 子分类导航（老板 2026-08-18：分类页"共X个结果"下） */
.sub-cats { display: flex; flex-wrap: wrap; gap: 8px; margin: 12px 0 4px; }
.sub-cat {
  padding: 5px 16px; border-radius: 20px;
  background: var(--bg-card); color: var(--text-muted);
  font-size: 13px; cursor: pointer; user-select: none;
  border: 1px solid rgba(255,255,255,.08); transition: all .2s;
}
.sub-cat:hover { color: var(--accent-cyan); border-color: var(--accent-cyan); }
.sub-cat.active { background: var(--accent-cyan); color: #fff; border-color: var(--accent-cyan); }

/* 分类页卡片网格：电脑端一行多列 / 手机端单列横排（老板 2026-08-17 定） */
.search-results.cat-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(170px, 1fr));
  gap: 16px;
}

/* 手机端：单列 + 卡片横排（海报左 + 文字右） */
@media (max-width: 768px) {
  .search-results.cat-grid { grid-template-columns: 1fr; }
  .search-results.cat-grid .movie-card { display: flex; }
  .search-results.cat-grid .movie-card .poster { width: 110px; height: 147px; flex-shrink: 0; }
  .search-results.cat-grid .movie-card .poster-desc { display: none; }
  .search-results.cat-grid .movie-card .info { flex: 1; display: flex; flex-direction: column; justify-content: center; }
  .search-results.cat-grid .movie-card .info .title { font-size: 15px; }
  .search-results.cat-grid .movie-card .info .cat-desc { -webkit-line-clamp: 2; }
}

.search-item {
  display: flex; gap: 16px;
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  cursor: pointer;
  transition: all 0.3s;
  border: 1px solid transparent;
}

.search-item:hover {
  border-color: var(--border-color);
  transform: translateX(4px);
}

.search-item .poster {
  width: 100px; min-height: 140px;
  border-radius: 8px;
  background-size: cover; background-position: center;
  flex-shrink: 0;
}

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

.search-item .info .title { font-size: 17px; font-weight: 600; }
.search-item .info .meta { color: var(--text-secondary); font-size: 13px; margin: 6px 0; }
.search-item .info .desc { color: var(--text-muted); font-size: 13px; line-height: 1.6; }

.search-empty {
  text-align: center; padding: 60px 20px;
  color: var(--text-muted);
}

.search-empty .icon { font-size: 48px; margin-bottom: 12px; }
.search-empty h3 { font-size: 18px; margin-bottom: 8px; }

/* ===== 播放页 ===== */
.play-page { padding-top: 24px; }

.play-top-ad { margin-bottom: 16px; }

.player-wrap, .player-wrapper {
  position: relative;
  width: 100%;
  aspect-ratio: 16/9;
  background: #000;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 16px;
}

.player-wrap video, .player-wrapper video { width: 100%; height: 100%; object-fit: contain; background: #000; }
/* 2026-08-18：竖屏漫剧适配——Video.js fluid 会按竖屏比例把播放器撑成 9:16(padding-top 177%)，
   超出 16:9 容器被裁剪只剩顶部。强制 videojs 容器填满 16:9、video 按比例 contain 居中 */
.player-wrapper .video-js {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  padding-top: 0 !important;
}
.player-wrapper .vjs-tech,
.player-wrap video, .player-wrapper video {
  position: absolute !important;
  top: 0 !important;
  left: 0 !important;
  width: 100% !important;
  height: 100% !important;
  object-fit: contain !important;
  background: #000;
}
.player-wrapper .video-js { width: 100% !important; height: 100% !important; }

.player-info {
  display: flex; gap: 20px;
  margin-bottom: 20px;
}

.player-info .poster {
  width: 120px; min-height: 170px;
  border-radius: 10px;
  background-size: cover; background-position: center;
  flex-shrink: 0;
}

.player-info .detail { flex: 1; }

.player-info .detail h1 { font-size: 22px; font-weight: 700; margin-bottom: 6px; }
.player-info .detail .meta { color: var(--text-secondary); font-size: 13px; margin-bottom: 8px; }
.player-info .detail .desc { color: var(--text-muted); font-size: 13px; line-height: 1.7; }

/* 线路选择 */
.lines-section {
  background: var(--bg-card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 20px;
}

.lines-section h3 {
  font-size: 15px; font-weight: 600;
  margin-bottom: 12px;
  display: flex; align-items: center; gap: 8px;
}

.lines-grid {
  display: flex; flex-wrap: wrap; gap: 8px;
}

.line-btn {
  padding: 6px 16px;
  border-radius: 100px;
  font-size: 13px;
  border: 1px solid var(--border-color);
  background: transparent;
  color: var(--text-secondary);
  cursor: pointer;
  transition: all 0.2s;
}

.line-btn:hover {
  border-color: var(--accent-blue);
  color: var(--text-primary);
}

.line-btn.active {
  background: linear-gradient(135deg, var(--accent-blue), var(--accent-cyan));
  border-color: transparent;
  color: #fff;
}

/* ===== 页脚 ===== */
.footer {
  text-align: center;
  padding: 32px 20px;
  color: var(--text-muted);
  font-size: 12px;
  border-top: 1px solid var(--border-color);
  margin-top: 40px;
}

.footer a { color: var(--text-secondary); text-decoration: none; }
.footer a:hover { color: var(--accent-cyan); }

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .navbar { padding: 10px 12px; gap: 10px; height: auto; min-height: 0; flex-wrap: wrap; }
  .nav-cats { display: flex; width: 100%; order: 3; overflow-x: auto; gap: 6px; padding: 8px 0 2px; -webkit-overflow-scrolling: touch; }
  .nav-cats a { padding: 5px 14px; font-size: 13px; flex-shrink: 0; }
  .nav-search { order: 2; flex: 1; min-width: 0; }
  .navbar .logo { order: 1; }
  .main { margin-top: 110px; }
  .banner-wrap { height: 240px; }
  .banner-slide .content { padding: 20px; }
  .banner-slide .content h2 { font-size: 20px; }
  .banner-slide .content .desc { display: none; }
  .movie-grid { grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 10px; }
  .player-info { flex-direction: column; }
  .player-info .poster { width: 80px; min-height: 114px; }
  .search-item .poster { width: 80px; min-height: 110px; }
  .container { padding: 16px; }
}

/* ===== 加载动画 ===== */
.loading {
  text-align: center; padding: 40px; color: var(--text-muted);
}

.spinner {
  width: 32px; height: 32px;
  border: 3px solid var(--border-color);
  border-top-color: var(--accent-cyan);
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
  margin: 0 auto 12px;
}

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

/* ===== 通知弹窗 ===== */
.toast {
  position: fixed; top: 80px; left: 50%; transform: translateX(-50%);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius);
  padding: 12px 24px;
  z-index: 2000;
  font-size: 14px;
  box-shadow: var(--shadow);
  opacity: 0; transition: opacity 0.3s;
  pointer-events: none;
}

.toast.show { opacity: 1; }