* {
  box-sizing: border-box;
}

:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --cyan: #06b6d4;
  --teal: #14b8a6;
  --shadow: 0 18px 45px rgba(15, 23, 42, .12);
  --radius: 22px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--ink);
  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 {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, .88);
  backdrop-filter: blur(20px);
  border-bottom: 1px solid rgba(255, 255, 255, .08);
}

.site-header-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  height: 72px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.brand {
  color: #fff;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--cyan), var(--teal));
  box-shadow: 0 10px 25px rgba(37, 99, 235, .36);
}

.brand-text {
  font-size: 20px;
}

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

.nav-link {
  color: rgba(255, 255, 255, .78);
  padding: 10px 14px;
  border-radius: 999px;
  transition: .2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(255, 255, 255, .12);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: rgba(255, 255, 255, .12);
  border: 0;
  color: #fff;
  padding: 10px;
}

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

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

.hero-track,
.hero-slide {
  position: absolute;
  inset: 0;
}

.hero-slide {
  display: flex;
  align-items: center;
  background-size: cover;
  background-position: center;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity .65s ease, transform .65s ease;
}

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

.hero-content {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  color: #fff;
  padding-top: 56px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--primary);
  background: rgba(37, 99, 235, .1);
  border: 1px solid rgba(37, 99, 235, .18);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 13px;
  font-weight: 700;
}

.hero-content .eyebrow,
.page-hero .eyebrow {
  color: #dbeafe;
  background: rgba(255, 255, 255, .16);
  border-color: rgba(255, 255, 255, .2);
}

.hero-content h1 {
  max-width: 780px;
  margin: 18px 0 16px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1.05;
  letter-spacing: -.05em;
}

.hero-content p {
  max-width: 700px;
  margin: 0;
  color: rgba(255, 255, 255, .86);
  font-size: clamp(18px, 2vw, 22px);
}

.hero-meta,
.detail-meta,
.movie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.hero-meta span,
.detail-meta span,
.movie-meta span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  background: rgba(255, 255, 255, .12);
  color: rgba(255, 255, 255, .92);
  font-size: 13px;
}

.movie-meta span,
.detail-meta span {
  background: #eef2ff;
  color: #334155;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 999px;
  padding: 0 20px;
  font-weight: 800;
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn-primary {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--cyan));
  box-shadow: 0 14px 30px rgba(37, 99, 235, .28);
}

.btn-ghost {
  color: #fff;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .24);
}

.btn-ghost.dark {
  color: var(--ink);
  background: #fff;
  border-color: var(--line);
}

.hero-controls {
  position: absolute;
  left: 50%;
  bottom: 34px;
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  z-index: 3;
}

.hero-dot {
  width: 40px;
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .38);
  cursor: pointer;
}

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

.section,
.page-hero,
.detail-hero {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.section {
  padding: 56px 0;
}

.section-heading {
  margin-bottom: 26px;
}

.section-heading h2,
.page-hero h1,
.detail-content h1,
.movie-article h2 {
  margin: 12px 0 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  letter-spacing: -.04em;
}

.section-heading p,
.page-hero p,
.detail-content .lead,
.movie-article p {
  max-width: 760px;
  color: var(--muted);
  font-size: 17px;
}

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

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

.quick-search,
.filter-bar,
.filter-panel {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

.quick-search input,
.filter-bar input,
.filter-panel input,
.filter-panel select {
  height: 48px;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 16px;
  padding: 0 16px;
  color: var(--ink);
  outline: none;
  box-shadow: 0 6px 18px rgba(15, 23, 42, .05);
}

.quick-search input,
.filter-bar input,
.filter-panel input {
  min-width: min(420px, 100%);
}

.filter-chip {
  height: 42px;
  border-radius: 999px;
  padding: 0 15px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
}

.filter-chip.active {
  color: #fff;
  border-color: var(--primary);
  background: var(--primary);
}

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

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

.category-card {
  min-height: 180px;
  border-radius: var(--radius);
  padding: 22px;
  background-size: cover;
  background-position: center;
  color: #fff;
  display: flex;
  flex-direction: column;
  justify-content: end;
  box-shadow: var(--shadow);
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease;
}

.category-card:hover,
.movie-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 55px rgba(15, 23, 42, .16);
}

.category-card span {
  font-size: 24px;
  font-weight: 900;
}

.category-card strong {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.5;
  color: rgba(255, 255, 255, .86);
}

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

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

.movie-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 14px 35px rgba(15, 23, 42, .08);
  border: 1px solid rgba(226, 232, 240, .86);
  transition: transform .22s ease, box-shadow .22s ease;
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, #dbeafe, #ccfbf1);
}

.poster-link img,
.detail-poster img {
  transition: transform .35s ease;
}

.movie-card:hover .poster-link img,
.detail-poster:hover img {
  transform: scale(1.06);
}

.score-badge {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 44px;
  height: 30px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, #f97316, #ef4444);
  font-size: 14px;
  font-weight: 900;
  box-shadow: 0 8px 18px rgba(239, 68, 68, .28);
}

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

.movie-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}

.movie-tags span {
  display: inline-flex;
  border-radius: 999px;
  padding: 4px 8px;
  color: var(--primary-dark);
  background: #dbeafe;
  font-size: 12px;
  font-weight: 700;
}

.movie-card h3 {
  margin: 0;
  font-size: 18px;
  line-height: 1.35;
}

.movie-card h3 a:hover {
  color: var(--primary);
}

.movie-card p {
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-card .movie-meta {
  margin-top: 12px;
}

.movie-card .movie-meta span {
  padding: 4px 8px;
  font-size: 12px;
}

.rank-layout {
  display: grid;
  grid-template-columns: minmax(260px, 380px) 1fr;
  gap: 28px;
  align-items: start;
}

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

.rank-list-large {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-bottom: 34px;
}

.rank-item {
  display: grid;
  grid-template-columns: 44px 58px 1fr;
  gap: 12px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(15, 23, 42, .06);
}

.rank-number {
  font-size: 20px;
  font-weight: 900;
  color: var(--primary);
}

.rank-item img {
  width: 58px;
  height: 76px;
  border-radius: 12px;
  background: linear-gradient(135deg, #dbeafe, #ccfbf1);
}

.rank-text strong,
.rank-text em {
  display: block;
}

.rank-text strong {
  line-height: 1.35;
}

.rank-text em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.page-hero {
  margin-top: 28px;
  color: #fff;
  border-radius: 32px;
  padding: clamp(34px, 6vw, 72px);
  background: linear-gradient(135deg, rgba(37, 99, 235, .94), rgba(6, 182, 212, .86), rgba(20, 184, 166, .82));
  box-shadow: var(--shadow);
}

.compact-hero p {
  color: rgba(255, 255, 255, .88);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 16px;
  color: rgba(255, 255, 255, .8);
  font-size: 14px;
}

.breadcrumb a:hover {
  color: #fff;
}

.detail-hero {
  padding: 36px 0 18px;
}

.detail-hero .breadcrumb {
  color: var(--muted);
}

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

.detail-grid {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 32px;
  align-items: center;
}

.detail-poster {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(135deg, #dbeafe, #ccfbf1);
  box-shadow: var(--shadow);
}

.detail-score {
  right: 18px;
  top: 18px;
}

.detail-content h1 {
  font-size: clamp(36px, 6vw, 68px);
}

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

.watch-section {
  padding-top: 28px;
}

.watch-panel {
  border-radius: 28px;
  overflow: hidden;
  background: #020617;
  box-shadow: var(--shadow);
}

.player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #020617;
}

.player-frame video {
  width: 100%;
  height: 100%;
  display: block;
  background: #020617;
}

.player-cover {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 18px;
  border: 0;
  color: #fff;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  transition: opacity .22s ease, visibility .22s ease;
}

.player-cover.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.play-orb {
  width: 78px;
  height: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: rgba(255, 255, 255, .92);
  color: var(--primary);
  font-size: 30px;
  box-shadow: 0 18px 42px rgba(0, 0, 0, .34);
}

.player-cover span:last-child {
  font-size: 20px;
  font-weight: 900;
}

.movie-article {
  padding: clamp(24px, 5vw, 44px);
  border-radius: 28px;
  background: #fff;
  border: 1px solid var(--line);
  box-shadow: 0 12px 35px rgba(15, 23, 42, .07);
}

.movie-article h2 {
  font-size: 28px;
  margin-top: 0;
}

.movie-article h2:not(:first-child) {
  margin-top: 28px;
}

.movie-article p {
  max-width: none;
  margin: 14px 0 0;
  color: #334155;
}

.article-tags {
  margin-top: 14px;
}

.site-footer {
  margin-top: 40px;
  background: #0f172a;
  color: rgba(255, 255, 255, .78);
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 38px 0;
  display: flex;
  justify-content: space-between;
  gap: 28px;
}

.footer-brand {
  color: #fff;
  font-size: 20px;
}

.site-footer p {
  max-width: 560px;
  margin: 10px 0 0;
}

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

.footer-links a {
  color: #fff;
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, .1);
}

.is-hidden {
  display: none !important;
}

@media (max-width: 1024px) {
  .movie-grid,
  .category-grid,
  .category-grid.large {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

  .rank-layout,
  .detail-grid {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 760px) {
  .site-header-inner {
    height: 64px;
  }

  .menu-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 72px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border-radius: 18px;
    background: rgba(15, 23, 42, .96);
    box-shadow: var(--shadow);
  }

  .site-nav.is-open {
    display: flex;
  }

  .nav-link {
    text-align: center;
  }

  .hero-slider {
    min-height: 580px;
  }

  .hero-content h1 {
    font-size: clamp(36px, 14vw, 56px);
  }

  .section {
    padding: 38px 0;
  }

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

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

  .rank-item {
    grid-template-columns: 38px 52px 1fr;
  }
}

@media (max-width: 520px) {
  .movie-grid,
  .compact-grid,
  .category-grid,
  .category-grid.large,
  .rank-list-large {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .detail-actions,
  .quick-search,
  .filter-panel,
  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .btn,
  .quick-search input,
  .filter-bar input,
  .filter-panel input,
  .filter-panel select {
    width: 100%;
  }

  .page-hero {
    border-radius: 24px;
  }
}
