/* ===== MovieNav 全局样式 — 明亮主题 ===== */

:root {
  --bg: #f8f9fa;
  --surface: #ffffff;
  --accent: #6d28d9;
  --accent-light: #8b5cf6;
  --hot: #e11d48;
  --text: #1a1a2e;
  --text-muted: #6b7280;
  --glass-border: rgba(0,0,0,.08);
  --glass-bg: rgba(255,255,255,.95);
  --radius: 12px;
  --shadow: 0 2px 12px rgba(0,0,0,.06);
  --shadow-hover: 0 8px 24px rgba(0,0,0,.12);
}

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

html { scroll-behavior:smooth; }

body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC',
    'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  background: var(--bg);
  color: var(--text);
  min-height: 100vh;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: inherit; text-decoration: none; }
img { max-width:100%; height:auto; }

/* ===== 顶部装饰条 ===== */
body::before {
  content: '';
  position: fixed; top: 0; left: 0; right: 0; height: 3px; z-index: 999;
  background: linear-gradient(90deg, var(--accent), var(--hot), var(--accent-light));
  pointer-events: none;
}

/* ===== 玻璃卡片 ===== */
.glass-card {
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  padding: 20px;
  transition: border-color .3s, box-shadow .3s;
}

.glass-card:hover {
  border-color: rgba(109,40,217,.15);
  box-shadow: var(--shadow-hover);
}

/* ===== 导航栏 ===== */
header {
  background: var(--surface);
  border-bottom: 1px solid var(--glass-border);
  box-shadow: 0 1px 4px rgba(0,0,0,.04);
  position: sticky;
  top: 0;
  z-index: 100;
}

header nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 12px;
  padding: 12px 0;
  max-width: 1280px;
  margin: 0 auto;
}

.brand {
  font-weight: 700;
  font-size: 1.2rem;
  color: var(--accent);
}

.nav-links {
  display: flex;
  gap: 4px 16px;
  flex-wrap: wrap;
}

.nav-links a {
  padding: 6px 12px;
  border-radius: 8px;
  font-size: .88rem;
  color: var(--text-muted);
  transition: all .2s;
}

.nav-links a:hover { color: var(--accent); background: rgba(109,40,217,.06); }

.lang-switch {
  display: flex;
  gap: 6px;
  align-items: center;
}

.lang-switch a {
  padding: 3px 8px;
  border: 1px solid var(--glass-border);
  border-radius: 6px;
  font-size: .78rem;
  color: var(--text-muted);
  transition: all .2s;
}

.lang-switch a.active {
  color: #fff;
  border-color: var(--accent);
  background: var(--accent);
}

/* ===== Hero ===== */
.hero {
  text-align: center;
  padding: 60px 0 30px;
  max-width: 640px;
  margin: 0 auto;
}

.hero h1 {
  font-size: clamp(1.8rem, 4vw, 2.8rem);
  margin-bottom: 12px;
  color: var(--text);
}

.hero p {
  color: var(--text-muted);
  font-size: 1.05rem;
  margin-bottom: 24px;
}

/* ===== 搜索 ===== */
.search-form {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  justify-content: center;
}

.search-form input {
  flex: 1;
  min-width: 280px;
  padding: 14px 20px;
  border-radius: var(--radius);
  border: 1px solid var(--glass-border);
  background: var(--surface);
  color: var(--text);
  font-size: 1rem;
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}

.search-form input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px rgba(109,40,217,.1); }

.search-form button {
  padding: 14px 28px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  border: none;
  font-weight: 600;
  font-size: 1rem;
  cursor: pointer;
  transition: background .2s;
}

.search-form button:hover { background: var(--accent-light); }

/* ===== 自动补全 ===== */
.autocomplete-dropdown {
  display: none;
  max-width: 500px;
  margin: 4px auto 0;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  overflow: hidden;
  z-index: 100;
  box-shadow: var(--shadow-hover);
}

.ac-item {
  display: flex;
  gap: 10px;
  align-items: center;
  padding: 10px 16px;
  color: var(--text);
  transition: background .2s;
}

.ac-item:hover { background: rgba(109,40,217,.06); }

.ac-item img { border-radius: 4px; }

/* ===== 影片网格 ===== */
.movie-section {
  max-width: 1280px;
  margin: 40px auto 0;
  padding: 0 16px;
}

.movie-section h2 {
  font-size: 1.3rem;
  font-weight: 600;
  margin-bottom: 20px;
  display: flex;
  align-items: center;
  gap: 8px;
  color: var(--text);
}

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

.movie-card {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: transform .25s, box-shadow .25s;
  border-radius: var(--radius);
  opacity: 0;
}

.movie-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-hover);
}

.movie-card.revealed {
  animation: fadeUp .5s ease forwards;
}

@keyframes fadeUp {
  from { opacity:0; transform:translateY(20px); }
  to   { opacity:1; transform:translateY(0); }
}

.poster-wrap {
  position: relative;
  padding-top: 150%;
  background: #e5e7eb;
  border-radius: var(--radius);
  overflow: hidden;
  margin-bottom: 8px;
}

.poster-wrap img {
  position: absolute;
  top: 0; left: 0;
  width: 100%; height: 100%;
  object-fit: cover;
  transition: transform .3s;
}

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

.rating {
  position: absolute;
  bottom: 8px;
  right: 8px;
  background: var(--accent);
  color: #fff;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: .75rem;
  font-weight: 600;
}

.movie-card h3 {
  font-size: .9rem;
  font-weight: 500;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: var(--text);
}

/* ===== 广告位 ===== */
.ad-slot {
  max-width: 1280px;
  margin: 20px auto;
  text-align: center;
  overflow: hidden;
  min-height: 90px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  padding: 12px;
}

.ad-label {
  font-size: .7rem;
  color: var(--text-muted);
  margin-bottom: 8px;
}

/* ===== 影片详情 ===== */
.movie-header {
  border-radius: var(--radius);
  overflow: hidden;
  background-size: cover;
  background-position: center;
  margin-bottom: 24px;
}

.movie-header-inner {
  display: flex;
  gap: 24px;
  padding: 32px;
  backdrop-filter: blur(4px);
}

.movie-poster img {
  width: 200px;
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
}

.movie-info h1 {
  font-size: clamp(1.5rem, 3vw, 2.2rem);
  margin-bottom: 12px;
  color: var(--text);
}

.movie-meta {
  display: flex;
  gap: 16px;
  flex-wrap: wrap;
  color: var(--text-muted);
  font-size: .9rem;
  margin-bottom: 12px;
}

.movie-genres {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
}

.genre-tag {
  padding: 4px 12px;
  background: rgba(109,40,217,.08);
  border: 1px solid rgba(109,40,217,.15);
  border-radius: 16px;
  font-size: .8rem;
  color: var(--accent);
  transition: all .2s;
}

.genre-tag:hover { background: rgba(109,40,217,.15); }

/* ===== 播放平台 ===== */
.watch-section { margin-top: 24px; }

.provider-regions {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.region-btn {
  padding: 6px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 8px;
  background: transparent;
  color: var(--text-muted);
  cursor: pointer;
  font-size: .85rem;
  transition: all .2s;
}

.region-btn.active {
  background: var(--accent);
  color: #fff;
  border-color: var(--accent);
}

.provider-list {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  margin-bottom: 16px;
}

.provider-item {
  display: flex;
  gap: 8px;
  align-items: center;
  padding: 10px 16px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  transition: all .2s;
  box-shadow: var(--shadow);
}

.provider-item:hover {
  border-color: var(--accent);
  box-shadow: var(--shadow-hover);
}

.provider-item img {
  border-radius: 8px;
  width: 36px;
  height: 36px;
  object-fit: cover;
}

.no-providers {
  color: var(--text-muted);
  text-align: center;
  padding: 24px 0;
}

/* ===== 观看指南 ===== */
.guide-section { margin-top: 24px; }
.guide-section p {
  color: var(--text-muted);
  font-size: .92rem;
  line-height: 1.8;
}

/* ===== TMDb 归属 ===== */
.tmdb-attribution {
  text-align: center;
  padding: 20px;
  font-size: .8rem;
  color: var(--text-muted);
}

.tmdb-attribution a { color: var(--accent); }

/* ===== 面包屑 ===== */
.breadcrumb ol {
  display: flex;
  gap: 8px;
  list-style: none;
  font-size: .85rem;
  color: var(--text-muted);
  margin-bottom: 16px;
}

.breadcrumb li:not(:last-child)::after { content: '/'; margin-left: 8px; }
.breadcrumb a { color: var(--accent); }
.breadcrumb a:hover { text-decoration: underline; }

/* ===== 分页 ===== */
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  margin-top: 32px;
}

.page-btn {
  padding: 8px 16px;
  border-radius: 8px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  color: var(--text);
  font-size: .9rem;
  transition: all .2s;
  cursor: pointer;
  box-shadow: var(--shadow);
}

.page-btn:hover { border-color: var(--accent); color: var(--accent); }
.page-info { color: var(--text-muted); font-size: .85rem; margin-left: 8px; }

/* ===== 法律页面 ===== */
.legal-page {
  max-width: 800px;
  margin: 0 auto;
  padding: 40px 16px;
}

.legal-page h1 { font-size: 1.8rem; margin-bottom: 24px; color: var(--text); }
.legal-page h2 { font-size: 1.1rem; margin: 24px 0 8px; color: var(--accent); }
.legal-page p { color: var(--text-muted); line-height: 1.8; margin-bottom: 8px; }
.legal-page ol { padding-left: 20px; color: var(--text-muted); line-height: 1.8; }
.legal-page li { margin-bottom: 8px; }
.legal-page a { color: var(--accent); }

/* ===== 平台列表 ===== */
.platform-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(200px, 1fr));
  gap: 16px;
  max-width: 1280px;
  margin: 24px auto 0;
  padding: 0 16px;
}

.platform-card {
  padding: 20px;
  background: var(--surface);
  border: 1px solid var(--glass-border);
  border-radius: var(--radius);
  transition: all .2s;
  box-shadow: var(--shadow);
}

.platform-card:hover {
  border-color: var(--accent);
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
}

/* ===== 跳转中间页 ===== */
.go-page {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 100vh;
  background: var(--bg);
}

.go-content {
  text-align: center;
  max-width: 480px;
  padding: 32px;
  background: var(--surface);
  border-radius: var(--radius);
  box-shadow: var(--shadow-hover);
}

.go-content h1 { font-size: 1.5rem; margin-bottom: 16px; color: var(--text); }
.movie-name { font-size: 1.1rem; color: var(--accent); margin-bottom: 16px; }
.disclaimer { font-size: .85rem; color: var(--text-muted); margin: 16px 0; }
.auto-redirect { font-size: .8rem; color: var(--text-muted); margin-top: 16px; }

.go-btn {
  display: inline-block;
  padding: 12px 28px;
  border-radius: var(--radius);
  background: var(--accent);
  color: #fff;
  font-weight: 600;
  font-size: 1rem;
  transition: all .2s;
}

.go-btn:hover { background: var(--accent-light); }

/* ===== 错误页面 ===== */
.error-page {
  text-align: center;
  padding: 80px 16px;
}

.error-page h1 {
  font-size: 4rem;
  color: var(--accent);
  margin-bottom: 16px;
}

.error-page p {
  color: var(--text-muted);
  margin-bottom: 24px;
}

/* ===== Main 容器 ===== */
main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 16px;
}

/* ===== 页脚 ===== */
footer {
  margin-top: 60px;
  padding: 24px;
  text-align: center;
  border-top: 1px solid var(--glass-border);
  font-size: .85rem;
  color: var(--text-muted);
  background: var(--surface);
}

footer a { color: var(--accent); }
footer a:hover { text-decoration: underline; }

.footer-links {
  display: flex;
  gap: 16px;
  justify-content: center;
  flex-wrap: wrap;
  margin-top: 12px;
}

/* ===== 滚动条 ===== */
::-webkit-scrollbar { width: 8px; }
::-webkit-scrollbar-track { background: var(--bg); }
::-webkit-scrollbar-thumb { background: rgba(109,40,217,.2); border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: rgba(109,40,217,.4); }

::selection { background: rgba(109,40,217,.2); color: var(--text); }

/* ===== 移动端导航按钮 ===== */
.nav-toggle {
  display: none;
  flex-direction: column;
  gap: 4px;
  background: none;
  border: none;
  cursor: pointer;
  padding: 6px;
  z-index: 200;
}

.nav-toggle span {
  display: block;
  width: 22px;
  height: 2px;
  background: var(--text);
  border-radius: 2px;
  transition: transform .3s, opacity .3s;
}

.nav-toggle.open span:nth-child(1) {
  transform: translateY(6px) rotate(45deg);
}

.nav-toggle.open span:nth-child(2) {
  opacity: 0;
}

.nav-toggle.open span:nth-child(3) {
  transform: translateY(-6px) rotate(-45deg);
}

/* 搜索框聚焦态 */
.search-form.focused input {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(109,40,217,.1);
}

/* 广告占位态 */
.ad-slot.ad-pending {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 90px;
  color: var(--text-muted);
  font-size: 0.75rem;
  opacity: 0.5;
}

.ad-slot.ad-pending::after {
  content: 'Advertisement';
}

/* 返回顶部按钮 */
.back-to-top:hover {
  background: rgba(109,40,217,.1) !important;
  border-color: var(--accent) !important;
  color: var(--accent) !important;
}

/* ===== 响应式 ===== */
@media (max-width: 768px) {
  .movie-header-inner { flex-direction: column; align-items: center; text-align: center; }
  .movie-poster img { width: 150px; }
  .movie-grid { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 12px; }
  .hero { padding: 40px 0 20px; }
  .search-form input { min-width: auto; }
  .provider-list { gap: 8px; }
  .platform-grid { grid-template-columns: repeat(auto-fill, minmax(160px, 1fr)); }

  .nav-toggle {
    display: flex;
  }

  header nav {
    flex-wrap: nowrap;
  }

  .nav-links {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-radius: 0 0 var(--radius) var(--radius);
    flex-direction: column;
    padding: 12px 16px;
    z-index: 150;
    box-shadow: var(--shadow-hover);
  }

  .nav-links.open {
    display: flex;
  }

  .nav-links a {
    padding: 10px 12px;
    font-size: .95rem;
  }

  .lang-switch {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 8px 16px;
    z-index: 150;
    box-shadow: var(--shadow-hover);
  }

  .lang-switch.open {
    display: flex;
    justify-content: center;
  }
}

@media (max-width: 480px) {
  .movie-grid { grid-template-columns: 1fr 1fr; gap: 10px; }
  .movie-card h3 { font-size: .8rem; }
  .page-btn { padding: 6px 12px; font-size: .82rem; }
}

/* ===== 导航栏搜索框 ===== */
.nav-search {
  display: flex;
  gap: 0;
  align-items: center;
}

.nav-search input {
  padding: 6px 12px;
  border: 1px solid var(--glass-border);
  border-right: none;
  border-radius: 8px 0 0 8px;
  background: var(--surface);
  color: var(--text);
  font-size: .85rem;
  outline: none;
  width: 160px;
  transition: border-color .2s, width .2s;
}

.nav-search input:focus {
  border-color: var(--accent);
  width: 220px;
}

.nav-search button {
  padding: 6px 14px;
  border: 1px solid var(--glass-border);
  border-radius: 0 8px 8px 0;
  background: var(--accent);
  color: #fff;
  font-size: .85rem;
  cursor: pointer;
  transition: background .2s;
}

.nav-search button:hover {
  background: var(--accent-light);
}

@media (max-width: 768px) {
  .nav-search {
    display: none;
    position: absolute;
    top: 100%;
    left: 0;
    right: 0;
    background: var(--surface);
    border: 1px solid var(--glass-border);
    border-top: none;
    border-radius: 0 0 var(--radius) var(--radius);
    padding: 12px 16px;
    z-index: 150;
    box-shadow: var(--shadow-hover);
  }

  .nav-search.open {
    display: flex;
  }

  .nav-search input {
    width: 100%;
    flex: 1;
  }

  .nav-search input:focus {
    width: 100%;
  }
}

/* 影片详情页全宽覆盖 */
.movie-header {
  max-width: none;
  margin-left: -16px;
  margin-right: -16px;
}
