:root {
  --bg: #f6f8fb;
  --surface: #ffffff;
  --surface-soft: #eef6ff;
  --text: #111827;
  --muted: #667085;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --cyan: #06b6d4;
  --green: #16a34a;
  --orange: #f97316;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
  --radius: 18px;
  color-scheme: light;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

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

button,
input {
  font: inherit;
}

.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;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(16px);
}

.header-inner {
  max-width: 1180px;
  height: 68px;
  margin: 0 auto;
  padding: 0 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo-icon {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 11px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.28);
}

.logo-text {
  font-size: 21px;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link {
  padding: 9px 14px;
  border-radius: 999px;
  color: #475467;
  font-weight: 600;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background: #eff6ff;
  transform: translateY(-1px);
}

.header-search {
  flex: 0 1 260px;
}

.header-search input,
.page-filter-input,
.search-form input {
  width: 100%;
  border: 1px solid #d0d5dd;
  border-radius: 14px;
  padding: 11px 14px;
  color: var(--text);
  background: #ffffff;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.header-search input:focus,
.page-filter-input:focus,
.search-form input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: #f2f4f7;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 19px;
  height: 2px;
  margin: 4px auto;
  border-radius: 4px;
  background: #344054;
}

.mobile-panel {
  max-width: 1180px;
  margin: 0 auto;
  padding: 0 22px 18px;
}

.mobile-panel nav,
.mobile-category-links {
  display: grid;
  gap: 8px;
}

.mobile-category-links {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 12px;
}

.mobile-category-links a {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f8fafc;
  color: #475467;
}

.hero-carousel {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  background: #0f172a;
}

.hero-track,
.hero-slide {
  min-height: 640px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  background-position: center;
  background-size: cover;
  background-color: #0f172a;
}

.hero-slide.active {
  display: flex;
}

.hero-content {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
  padding: 100px 0 120px;
  color: #ffffff;
}

.hero-kicker,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
  color: #0ea5e9;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-content h1 {
  max-width: 760px;
  margin: 0;
  font-size: clamp(42px, 8vw, 84px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.hero-content p {
  max-width: 680px;
  margin: 24px 0 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
}

.hero-tags,
.tag-row,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tags {
  margin-top: 24px;
}

.hero-tags span,
.tag-row span,
.detail-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 5px 11px;
  border-radius: 999px;
  color: #175cd3;
  background: #eff8ff;
  font-size: 13px;
  font-weight: 700;
}

.hero-tags span {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 32px;
}

.primary-button,
.ghost-button,
.search-form button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border: 0;
  border-radius: 999px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button,
.search-form button {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 16px 35px rgba(37, 99, 235, 0.28);
}

.ghost-button {
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.34);
  background: rgba(255, 255, 255, 0.12);
}

.primary-button:hover,
.ghost-button:hover,
.search-form button:hover {
  transform: translateY(-2px);
}

.hero-controls {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  width: min(1180px, calc(100% - 44px));
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-dots {
  display: flex;
  gap: 8px;
}

.hero-dot,
.hero-arrow {
  border: 0;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
}

.hero-dot {
  width: 34px;
  height: 6px;
  border-radius: 999px;
}

.hero-dot.active {
  background: #ffffff;
}

.hero-arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 28px;
  line-height: 1;
}

.search-band {
  margin-top: -46px;
  position: relative;
  z-index: 3;
}

.search-panel {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
  padding: 24px;
  display: grid;
  grid-template-columns: 1fr minmax(280px, 520px);
  gap: 24px;
  align-items: center;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.search-panel h2 {
  margin: 0;
  font-size: 24px;
}

.search-form {
  display: flex;
  gap: 10px;
}

.content-section {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
  padding: 58px 0;
}

.muted-section {
  width: 100%;
  max-width: none;
  padding: 58px max(22px, calc((100% - 1180px) / 2));
  background: linear-gradient(135deg, #f8fbff, #eef6ff);
}

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

.section-heading h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

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

.section-more {
  flex: 0 0 auto;
  color: var(--primary);
  font-weight: 800;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.92);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border 0.24s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(37, 99, 235, 0.25);
  box-shadow: var(--shadow);
}

.poster-frame,
.detail-poster,
.rank-poster {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a, #1d4ed8 48%, #06b6d4);
}

.poster-frame {
  aspect-ratio: 3 / 4;
}

.poster-frame img,
.detail-poster img,
.rank-poster img {
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

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

.poster-fallback {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 18px;
  color: #ffffff;
  font-size: 20px;
  font-weight: 800;
  text-align: center;
  opacity: 0;
}

.missing-cover .poster-fallback {
  opacity: 1;
}

.rating-badge {
  position: absolute;
  right: 12px;
  top: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(249, 115, 22, 0.92);
  font-size: 13px;
  font-weight: 800;
}

.card-body {
  padding: 16px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #667085;
  font-size: 13px;
}

.card-body h3 {
  margin: 10px 0 8px;
  font-size: 18px;
  line-height: 1.28;
}

.card-body h3 a:hover,
.rank-info h3 a:hover,
.category-overview-card h2 a:hover {
  color: var(--primary);
}

.card-body p {
  min-height: 48px;
  margin: 0 0 14px;
  color: #667085;
  font-size: 14px;
}

.tag-row span {
  color: #344054;
  background: #f2f4f7;
}

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

.category-card {
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.06);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

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

.category-icon {
  width: 48px;
  height: 48px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
}

.category-card strong {
  margin-top: 18px;
  font-size: 20px;
}

.category-card span:last-of-type,
.category-card em {
  color: #667085;
  font-style: normal;
}

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

.compact-rank .rank-row:nth-child(n + 6) {
  display: none;
}

.rank-row {
  display: grid;
  grid-template-columns: 58px 82px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.05);
}

.rank-number {
  color: var(--primary);
  font-size: 24px;
  font-weight: 900;
  text-align: center;
}

.rank-poster {
  width: 82px;
  height: 106px;
  border-radius: 14px;
}

.rank-info h3 {
  margin: 0 0 6px;
  font-size: 20px;
}

.rank-info p {
  margin: 0 0 8px;
  color: #667085;
}

.rank-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #667085;
  font-size: 13px;
}

.rank-score {
  text-align: right;
}

.rank-score strong {
  display: block;
  color: var(--orange);
  font-size: 25px;
}

.rank-score span {
  color: #667085;
  font-size: 13px;
}

.page-hero {
  min-height: 360px;
  display: flex;
  align-items: center;
  background: radial-gradient(circle at top left, rgba(6, 182, 212, 0.2), transparent 34%), linear-gradient(135deg, #0f172a, #1d4ed8);
  color: #ffffff;
}

.page-hero > div {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
}

.page-hero h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(36px, 6vw, 62px);
  line-height: 1.06;
  letter-spacing: -0.05em;
}

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

.small-hero {
  min-height: 310px;
}

.category-overview-grid {
  display: grid;
  gap: 22px;
}

.category-overview-card {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 24px;
  padding: 22px;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.category-cover {
  min-height: 210px;
  display: grid;
  place-items: center;
  border-radius: 20px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  font-size: 28px;
  font-weight: 900;
  text-align: center;
}

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

.category-overview-card p {
  margin: 0 0 14px;
  color: #667085;
}

.category-count {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 6px 12px;
  border-radius: 999px;
  color: var(--primary);
  background: #eff6ff;
  font-weight: 800;
}

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

.category-overview-card li a {
  color: #475467;
}

.filter-toolbar {
  display: grid;
  gap: 14px;
  margin-bottom: 26px;
  padding: 18px;
  border: 1px solid rgba(226, 232, 240, 0.94);
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.05);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip {
  border: 0;
  border-radius: 999px;
  padding: 8px 13px;
  color: #475467;
  background: #f2f4f7;
  cursor: pointer;
  font-weight: 700;
}

.filter-chip.active,
.filter-chip:hover {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
}

.breadcrumb {
  width: min(1180px, calc(100% - 44px));
  margin: 24px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #667085;
  font-size: 14px;
}

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

.detail-hero {
  width: min(1180px, calc(100% - 44px));
  margin: 26px auto 0;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 34px;
  align-items: center;
  padding: 30px;
  border-radius: 28px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.detail-poster {
  aspect-ratio: 3 / 4;
  border-radius: 24px;
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.22);
}

.detail-info h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 66px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.detail-line {
  max-width: 760px;
  color: #475467;
  font-size: 18px;
}

.detail-meta {
  margin: 18px 0;
}

.detail-tags {
  margin-bottom: 22px;
}

.player-section {
  width: min(1180px, calc(100% - 44px));
  margin: 34px auto 0;
}

.player-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 26px;
  background: #050b18;
  box-shadow: 0 30px 70px rgba(15, 23, 42, 0.32);
}

.movie-player {
  width: 100%;
  height: 100%;
  display: block;
  background: #050b18;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 0;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(5, 11, 24, 0.36), rgba(5, 11, 24, 0.78));
  cursor: pointer;
}

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

.play-circle {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.34);
  font-size: 30px;
}

.two-column-detail {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.text-panel {
  padding: 28px;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.06);
}

.text-panel h2 {
  margin: 0 0 12px;
  font-size: 28px;
}

.text-panel p {
  margin: 0;
  color: #475467;
  font-size: 17px;
}

.site-footer {
  margin-top: 30px;
  color: #cbd5e1;
  background: #0f172a;
}

.footer-inner {
  width: min(1180px, calc(100% - 44px));
  margin: 0 auto;
  padding: 46px 0;
  display: grid;
  grid-template-columns: 1.2fr 2fr;
  gap: 48px;
}

.footer-logo {
  color: #ffffff;
  font-size: 24px;
}

.footer-brand p {
  color: #94a3b8;
}

.footer-links {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

.footer-links h3 {
  margin: 0 0 12px;
  color: #ffffff;
}

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

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

.is-filtered-out {
  display: none !important;
}

@media (max-width: 980px) {
  .desktop-nav,
  .header-search {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .search-panel,
  .detail-hero,
  .two-column-detail,
  .footer-inner,
  .category-overview-card {
    grid-template-columns: 1fr;
  }

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

  .detail-poster {
    max-width: 340px;
  }
}

@media (max-width: 680px) {
  .header-inner {
    height: 62px;
    padding: 0 16px;
  }

  .logo-text {
    font-size: 18px;
  }

  .hero-carousel,
  .hero-track,
  .hero-slide {
    min-height: 580px;
  }

  .hero-content {
    width: calc(100% - 32px);
    padding: 86px 0 110px;
  }

  .hero-content p {
    font-size: 16px;
  }

  .hero-controls,
  .content-section,
  .player-section,
  .detail-hero,
  .breadcrumb,
  .footer-inner,
  .search-panel,
  .page-hero > div {
    width: calc(100% - 32px);
  }

  .search-panel {
    padding: 18px;
  }

  .search-form {
    flex-direction: column;
  }

  .section-heading {
    display: block;
  }

  .section-more {
    display: inline-flex;
    margin-top: 10px;
  }

  .movie-grid,
  .category-grid,
  .footer-links {
    grid-template-columns: 1fr;
  }

  .rank-row {
    grid-template-columns: 42px 66px 1fr;
    gap: 12px;
  }

  .rank-score {
    grid-column: 3;
    text-align: left;
  }

  .rank-poster {
    width: 66px;
    height: 88px;
  }

  .detail-hero {
    padding: 20px;
  }

  .page-hero {
    min-height: 280px;
  }
}
