:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #eff6ff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1e3a8a;
  --primary-soft: #dbeafe;
  --accent: #f97316;
  --radius: 22px;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background: var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  line-height: 1.6;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
}

.header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 14px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 20px;
  align-items: center;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  color: var(--primary-dark);
  white-space: nowrap;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  color: #ffffff;
  border-radius: 12px;
  background: linear-gradient(135deg, #2563eb, #1e3a8a);
  box-shadow: 0 8px 20px rgba(37, 99, 235, 0.35);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 6px;
  overflow-x: auto;
  scrollbar-width: none;
}

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

.nav-link {
  padding: 8px 12px;
  border-radius: 999px;
  color: #334155;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: var(--primary);
  background: var(--primary-soft);
}

.top-search,
.search-panel {
  display: flex;
  align-items: center;
  background: #f1f5f9;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}

.top-search input,
.search-panel input {
  width: 220px;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 10px 12px 10px 16px;
  color: var(--text);
}

.top-search button,
.search-panel button,
.primary-button,
.ghost-button,
.play-button {
  border: 0;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.top-search button,
.search-panel button,
.primary-button {
  color: #ffffff;
  background: var(--primary);
  padding: 10px 18px;
  border-radius: 999px;
}

.primary-button:hover,
.top-search button:hover,
.search-panel button:hover,
.play-button:hover {
  transform: translateY(-1px);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.25);
}

.ghost-button {
  color: #ffffff;
  padding: 10px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.hero {
  position: relative;
  height: 540px;
  color: #ffffff;
  overflow: hidden;
  background: linear-gradient(100deg, #172554 0%, #1d4ed8 52%, #60a5fa 100%);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 0.8s ease;
}

.hero-slide.is-active {
  opacity: 1;
  z-index: 2;
}

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.30;
}

.hero-bg img.image-missing {
  display: none;
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 75% 20%, rgba(255, 255, 255, 0.20), transparent 32%),
    linear-gradient(90deg, rgba(15, 23, 42, 0.72), rgba(30, 64, 175, 0.44), rgba(37, 99, 235, 0.30));
}

.hero-inner {
  position: relative;
  z-index: 3;
  max-width: 1240px;
  height: 100%;
  margin: 0 auto;
  padding: 42px 20px;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) 360px;
  gap: 38px;
  align-items: center;
}

.hero-copy {
  max-width: 680px;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px 13px;
  border-radius: 999px;
  background: rgba(59, 130, 246, 0.72);
  box-shadow: 0 14px 40px rgba(15, 23, 42, 0.20);
}

.hero h1,
.hero h2 {
  margin: 0 0 18px;
  font-size: clamp(34px, 5vw, 60px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero p {
  margin: 0 0 24px;
  max-width: 620px;
  color: #dbeafe;
  font-size: 18px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.hero-poster {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  min-height: 430px;
  background: linear-gradient(150deg, #1e40af, #93c5fd);
  box-shadow: var(--shadow);
}

.hero-poster img {
  width: 100%;
  height: 430px;
  object-fit: cover;
}

.hero-poster img.image-missing {
  display: none;
}

.hero-poster-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px;
  background: linear-gradient(0deg, rgba(15, 23, 42, 0.86), transparent);
}

.hero-controls {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 6;
  display: flex;
  align-items: center;
  gap: 10px;
  transform: translateX(-50%);
}

.hero-dot {
  width: 12px;
  height: 12px;
  border: 0;
  padding: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.45);
}

.hero-dot.is-active {
  width: 32px;
  background: #ffffff;
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 7;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.20);
  transform: translateY(-50%);
}

.hero-arrow:hover {
  background: rgba(255, 255, 255, 0.32);
}

.hero-arrow.prev {
  left: 18px;
}

.hero-arrow.next {
  right: 18px;
}

.main {
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 20px 70px;
}

.content-section {
  margin-top: 44px;
}

.section-heading,
.page-heading {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: flex-end;
  margin-bottom: 22px;
}

.section-heading h2,
.page-heading h1,
.detail-copy h1 {
  margin: 0;
  font-size: clamp(26px, 3vw, 40px);
  line-height: 1.18;
  letter-spacing: -0.03em;
}

.section-heading p,
.page-heading p {
  max-width: 720px;
  margin: 8px 0 0;
  color: var(--muted);
}

.section-more {
  color: var(--primary);
  font-weight: 800;
  white-space: nowrap;
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 22px;
}

.movie-card,
.category-card,
.rank-card,
.detail-panel,
.search-result-empty {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
}

.movie-card {
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

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

.poster-wrap {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background:
    linear-gradient(150deg, rgba(37, 99, 235, 0.95), rgba(147, 197, 253, 0.78)),
    radial-gradient(circle at top right, rgba(249, 115, 22, 0.55), transparent 42%);
}

.poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.poster-wrap img.image-missing {
  display: none;
}

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

.poster-score {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 4px 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
  border-radius: 999px;
  background: rgba(249, 115, 22, 0.94);
}

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

.movie-title {
  display: block;
  font-size: 17px;
  font-weight: 800;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movie-title:hover {
  color: var(--primary);
}

.movie-meta,
.breadcrumb,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

.movie-meta {
  margin-top: 8px;
}

.movie-meta span,
.detail-meta span {
  padding: 3px 8px;
  border-radius: 999px;
  background: #f1f5f9;
}

.movie-card-body p {
  margin: 10px 0 0;
  color: #475569;
  font-size: 14px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.tag-row span {
  padding: 3px 9px;
  color: #1d4ed8;
  font-size: 12px;
  border-radius: 999px;
  background: var(--primary-soft);
}

.category-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 18px;
}

.category-card {
  padding: 22px;
  position: relative;
  overflow: hidden;
}

.category-card::after {
  content: "";
  position: absolute;
  right: -36px;
  top: -36px;
  width: 120px;
  height: 120px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.10);
}

.category-card h2,
.category-card h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

.category-card p {
  margin: 0 0 14px;
  color: var(--muted);
}

.category-card strong {
  color: var(--primary);
}

.rank-list {
  display: grid;
  gap: 14px;
}

.rank-card {
  display: grid;
  grid-template-columns: 66px 84px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 12px;
}

.rank-number {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 900;
  border-radius: 16px;
  background: linear-gradient(135deg, #f97316, #ef4444);
}

.rank-poster {
  width: 84px;
  height: 118px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(135deg, #2563eb, #93c5fd);
}

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

.rank-poster img.image-missing {
  display: none;
}

.rank-card h2,
.rank-card h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.rank-card p {
  margin: 8px 0 0;
  color: #475569;
}

.rank-side {
  color: var(--primary);
  font-weight: 900;
  white-space: nowrap;
}

.breadcrumb {
  margin-bottom: 18px;
}

.breadcrumb a {
  color: var(--primary);
  font-weight: 700;
}

.detail-hero {
  display: grid;
  grid-template-columns: 330px 1fr;
  gap: 30px;
  align-items: stretch;
  margin-bottom: 34px;
}

.detail-cover {
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(150deg, #1d4ed8, #93c5fd);
  box-shadow: var(--shadow);
}

.detail-cover img {
  width: 100%;
  height: 100%;
  min-height: 480px;
  object-fit: cover;
}

.detail-cover img.image-missing {
  display: none;
}

.detail-copy {
  padding: 30px;
}

.detail-copy p {
  color: #334155;
  font-size: 17px;
}

.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 20px;
}

.player-panel {
  overflow: hidden;
}

.player-frame {
  position: relative;
  background: #020617;
}

.movie-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #020617;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  background:
    radial-gradient(circle at center, rgba(37, 99, 235, 0.20), rgba(2, 6, 23, 0.88)),
    linear-gradient(120deg, rgba(15, 23, 42, 0.7), rgba(30, 64, 175, 0.35));
}

.player-cover.is-hidden {
  display: none;
}

.play-button {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #ffffff;
  padding: 16px 24px;
  border-radius: 999px;
  background: var(--primary);
  box-shadow: 0 18px 44px rgba(37, 99, 235, 0.32);
}

.play-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: var(--primary);
  border-radius: 999px;
  background: #ffffff;
}

.detail-panel {
  padding: 28px;
  margin-top: 28px;
}

.detail-panel h2 {
  margin: 0 0 12px;
  font-size: 26px;
}

.detail-panel p {
  margin: 0;
  color: #334155;
}

.search-panel {
  max-width: 720px;
  margin: 0 0 28px;
}

.search-panel input {
  width: 100%;
  min-width: 0;
}

.search-result-empty {
  padding: 34px;
  color: var(--muted);
}

.site-footer {
  background: #0f172a;
  color: #cbd5e1;
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 28px 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.footer-brand {
  color: #ffffff;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.footer-links a:hover {
  color: #ffffff;
}

@media (max-width: 1180px) {
  .movie-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

  .category-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
}

@media (max-width: 900px) {
  .header-inner {
    grid-template-columns: 1fr;
  }

  .hero {
    height: auto;
    min-height: 620px;
  }

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

  .hero-poster {
    display: none;
  }

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

  .detail-cover img {
    min-height: auto;
  }

  .rank-card {
    grid-template-columns: 48px 70px 1fr;
  }

  .rank-side {
    grid-column: 3;
  }
}

@media (max-width: 720px) {
  .movie-grid,
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .main {
    padding-inline: 14px;
  }

  .hero h1,
  .hero h2 {
    font-size: 36px;
  }

  .hero-arrow {
    display: none;
  }

  .section-heading,
  .page-heading,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .top-search input {
    width: 100%;
  }

  .detail-copy,
  .detail-panel {
    padding: 20px;
  }
}
