:root {
  --color-red: #dc2626;
  --color-red-dark: #b91c1c;
  --color-pink: #db2777;
  --color-blue: #2563eb;
  --color-purple: #7c3aed;
  --color-bg: #f9fafb;
  --color-text: #111827;
  --color-muted: #6b7280;
  --color-border: #e5e7eb;
  --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.10);
  --shadow-hero: 0 25px 60px rgba(15, 23, 42, 0.28);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  line-height: 1.6;
}

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(14px);
}

.nav-shell {
  width: min(1280px, calc(100% - 32px));
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-logo {
  flex: 0 0 auto;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-red);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.logo-mark {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 14px;
  background: #fee2e2;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  flex: 1 1 auto;
  min-width: 0;
  overflow-x: auto;
  white-space: nowrap;
}

.desktop-nav a,
.mobile-panel a,
.footer-links a {
  color: #374151;
  font-weight: 650;
  transition: color 0.2s ease;
}

.desktop-nav a:hover,
.mobile-panel a:hover,
.footer-links a:hover {
  color: var(--color-red);
}

.search-form {
  display: flex;
  align-items: center;
  width: min(320px, 30vw);
  border: 1px solid var(--color-border);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.search-form input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 10px 14px;
  background: transparent;
}

.search-form button,
.primary-button,
.secondary-button {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.search-form button {
  margin-right: 4px;
  padding: 8px 16px;
  color: #fff;
  background: var(--color-red);
}

.search-form button:hover,
.primary-button:hover {
  background: var(--color-red-dark);
  transform: translateY(-1px);
}

.mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: #f3f4f6;
  padding: 10px;
}

.mobile-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  border-radius: 999px;
  background: #374151;
}

.mobile-panel {
  display: none;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 14px 0 18px;
  border-top: 1px solid var(--color-border);
}

.mobile-panel.is-open {
  display: grid;
  gap: 12px;
}

.page-main {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 0;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.hero-carousel {
  position: relative;
  overflow: hidden;
  min-height: 500px;
  margin-bottom: 48px;
  border-radius: 26px;
  background: #111827;
  box-shadow: var(--shadow-hero);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  background-size: cover;
  background-position: center;
  transform: scale(1.02);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(17, 24, 39, 0.94), rgba(17, 24, 39, 0.58) 48%, rgba(17, 24, 39, 0.18));
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(720px, 92%);
  padding: 72px 64px;
  color: #fff;
}

.hero-eyebrow,
.card-badge,
.detail-badge,
.rank-badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
}

.hero-eyebrow {
  margin-bottom: 18px;
  padding: 6px 14px;
  background: var(--color-red);
  font-size: 14px;
}

.hero-title {
  margin: 0 0 16px;
  font-size: clamp(34px, 6vw, 60px);
  line-height: 1.06;
  letter-spacing: -0.06em;
}

.hero-desc {
  max-width: 650px;
  margin: 0 0 26px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
}

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

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
}

.primary-button {
  color: #fff;
  background: var(--color-red);
}

.secondary-button {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.42);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
}

.secondary-button:hover {
  color: #111827;
  background: #fff;
}

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

.hero-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.54);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.is-active {
  width: 34px;
  background: #fff;
}

.content-section {
  margin-bottom: 54px;
}

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

.section-heading h2,
.detail-content h2,
.player-section h2,
.related-section h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
  letter-spacing: -0.04em;
}

.section-heading p {
  margin: 8px 0 0;
  color: var(--color-muted);
}

.section-link {
  color: var(--color-red);
  font-weight: 800;
}

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

.movie-grid-large {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 4px 14px rgba(15, 23, 42, 0.06);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

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

.poster-link,
.poster-frame {
  display: block;
}

.poster-frame {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background-color: #111827;
  background-size: cover;
  background-position: center;
}

.poster-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 50%, rgba(0, 0, 0, 0.48));
}

.card-badge {
  position: absolute;
  z-index: 2;
  top: 10px;
  left: 10px;
  padding: 4px 10px;
  color: #fff;
  background: rgba(220, 38, 38, 0.92);
  font-size: 12px;
}

.rank-badge {
  position: absolute;
  z-index: 3;
  right: 10px;
  bottom: 10px;
  min-width: 34px;
  height: 34px;
  color: #fff;
  background: rgba(17, 24, 39, 0.82);
  font-size: 14px;
}

.card-body {
  padding: 14px;
}

.card-title {
  display: -webkit-box;
  min-height: 44px;
  overflow: hidden;
  color: #111827;
  font-weight: 800;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-title:hover {
  color: var(--color-red);
}

.card-desc {
  display: -webkit-box;
  min-height: 42px;
  margin: 8px 0 12px;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 14px;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--color-muted);
  font-size: 14px;
}

.score {
  color: #f59e0b;
  font-weight: 800;
}

.gradient-panel {
  padding: 34px;
  border-radius: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--color-blue), var(--color-purple));
  box-shadow: var(--shadow-card);
}

.gradient-panel-red {
  background: linear-gradient(135deg, var(--color-pink), var(--color-red));
}

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

.category-card {
  overflow: hidden;
  min-height: 260px;
  padding: 24px;
  border-radius: 24px;
  color: #fff;
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-card);
}

.category-card h2 {
  margin: 0 0 10px;
  font-size: 28px;
}

.category-card p {
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.86);
}

.category-card ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-card a:hover {
  text-decoration: underline;
}

.page-hero {
  margin-bottom: 34px;
  padding: 42px;
  border-radius: 26px;
  color: #fff;
  background: linear-gradient(135deg, var(--color-red), var(--color-pink));
  box-shadow: var(--shadow-card);
}

.page-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 52px);
  line-height: 1.1;
}

.page-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 18px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--color-muted);
  font-size: 14px;
}

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

.detail-hero {
  display: grid;
  grid-template-columns: minmax(260px, 360px) minmax(0, 1fr);
  gap: 34px;
  align-items: stretch;
  margin-bottom: 34px;
}

.detail-poster {
  min-height: 520px;
  border-radius: 26px;
  background-color: #111827;
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow-card);
}

.detail-info {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: 38px;
  border-radius: 26px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.detail-badge {
  align-self: flex-start;
  margin-bottom: 18px;
  padding: 6px 14px;
  color: #fff;
  background: var(--color-red);
}

.detail-info h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.1;
  letter-spacing: -0.06em;
}

.detail-lead {
  margin: 0 0 22px;
  color: #374151;
  font-size: 18px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 22px;
}

.detail-meta span,
.tag-chip {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 12px;
  border-radius: 999px;
  color: #374151;
  background: #f3f4f6;
  font-weight: 700;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.player-section,
.detail-content,
.related-section {
  margin-bottom: 36px;
  padding: 28px;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-card);
}

.player-section h2,
.detail-content h2,
.related-section h2 {
  margin-bottom: 18px;
}

.video-shell {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #000;
  aspect-ratio: 16 / 9;
}

.video-shell video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

.play-toggle {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  color: #fff;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.25), rgba(0, 0, 0, 0.52));
  cursor: pointer;
}

.play-toggle span {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border-radius: 999px;
  background: var(--color-red);
  box-shadow: 0 18px 40px rgba(220, 38, 38, 0.38);
  font-size: 30px;
  transform: translateX(2px);
}

.video-shell.is-playing .play-toggle {
  opacity: 0;
  pointer-events: none;
}

.detail-content p {
  margin: 0 0 20px;
  color: #374151;
  font-size: 17px;
}

.no-results {
  margin: 28px 0 0;
  padding: 22px;
  border-radius: 18px;
  color: var(--color-muted);
  background: #fff;
  text-align: center;
  box-shadow: var(--shadow-card);
}

.site-footer {
  margin-top: 72px;
  color: #fff;
  background: #111827;
}

.footer-grid {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding: 46px 0;
}

.footer-grid h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.footer-grid p {
  margin: 0;
  color: rgba(255, 255, 255, 0.72);
}

.footer-links {
  display: grid;
  gap: 10px;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.78);
}

.footer-bottom {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: rgba(255, 255, 255, 0.58);
}

@media (max-width: 1100px) {
  .desktop-nav {
    display: none;
  }

  .search-form {
    margin-left: auto;
    width: min(420px, 48vw);
  }

  .mobile-toggle {
    display: block;
  }

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

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

@media (max-width: 820px) {
  .nav-shell {
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 0;
  }

  .site-logo {
    font-size: 22px;
  }

  .search-form {
    order: 3;
    width: 100%;
  }

  .hero-carousel {
    min-height: 560px;
    border-radius: 20px;
  }

  .hero-content {
    padding: 54px 28px;
  }

  .movie-grid,
  .movie-grid-large {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .category-overview-grid,
  .detail-hero,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .detail-poster {
    min-height: 420px;
  }

  .detail-info,
  .page-hero,
  .gradient-panel,
  .player-section,
  .detail-content,
  .related-section {
    padding: 24px;
    border-radius: 20px;
  }
}

@media (max-width: 520px) {
  .page-main,
  .nav-shell,
  .mobile-panel,
  .footer-grid,
  .footer-bottom {
    width: min(100% - 22px, 1280px);
  }

  .movie-grid,
  .movie-grid-large {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

  .card-body {
    padding: 11px;
  }

  .card-title {
    font-size: 14px;
  }

  .card-desc {
    display: none;
  }

  .detail-poster {
    min-height: 360px;
  }

  .play-toggle span {
    width: 70px;
    height: 70px;
  }
}
