:root {
  color-scheme: light;
  --bg: #f5f7fb;
  --surface: #ffffff;
  --surface-soft: #eef4ff;
  --text: #0f172a;
  --muted: #64748b;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #f97316;
  --line: #e2e8f0;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #f8fbff 0%, #eef4ff 42%, #f8fafc 100%);
  line-height: 1.6;
}

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

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.92);
  backdrop-filter: blur(16px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

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

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.03em;
  color: #111827;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.35);
  font-size: 15px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 6px;
  margin-left: auto;
}

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  color: #475569;
  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);
}

.nav-search {
  width: 280px;
  display: flex;
  align-items: center;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.nav-search input,
.inline-filter input,
.search-page-form input {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--text);
}

.nav-search input {
  padding: 8px 10px 8px 14px;
}

.nav-search button,
.search-page-form button {
  border: 0;
  border-radius: 999px;
  padding: 8px 14px;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.24);
}

.nav-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  color: var(--text);
  background: #eef2ff;
  border-radius: 12px;
  padding: 8px 12px;
  cursor: pointer;
}

.hero-carousel {
  position: relative;
  width: min(1240px, calc(100% - 32px));
  margin: 26px auto 0;
  border-radius: 30px;
  overflow: hidden;
  box-shadow: var(--shadow);
  background: #0f172a;
}

.hero-stage {
  position: relative;
  min-height: 590px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(270px, 380px);
  align-items: center;
  gap: 42px;
  padding: 66px;
  color: #fff;
  background-size: cover;
  background-position: center;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
  transition: opacity 0.55s ease, visibility 0.55s ease, transform 0.55s ease;
}

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

.hero-copy {
  max-width: 700px;
  position: relative;
  z-index: 2;
}

.eyebrow,
.section-heading span,
.page-hero span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
  font-size: 14px;
  font-weight: 800;
  color: #93c5fd;
  text-transform: uppercase;
  letter-spacing: 0.08em;
}

.hero-copy h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.06em;
}

.hero-copy p {
  max-width: 620px;
  margin: 20px 0 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 19px;
}

.hero-actions,
.detail-copy .primary-btn {
  margin-top: 30px;
}

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

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

.ghost-btn {
  margin-left: 10px;
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.35);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

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

.hero-poster {
  position: relative;
  z-index: 2;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.42);
  aspect-ratio: 2 / 3;
  background: rgba(255, 255, 255, 0.12);
}

.hero-poster img,
.poster-link img,
.detail-poster img,
.compact-poster img,
.ranking-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-dots {
  position: absolute;
  left: 66px;
  bottom: 28px;
  z-index: 4;
  display: flex;
  gap: 10px;
}

.hero-dots button {
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(255, 255, 255, 0.45);
  transition: width 0.25s ease, background 0.25s ease;
}

.hero-dots button.active {
  width: 34px;
  background: #fff;
}

.section-wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 54px auto;
}

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

.section-heading h2,
.page-hero h1,
.article-section h2 {
  margin: 0;
  font-size: clamp(28px, 3vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.section-heading p,
.page-hero p,
.article-section p,
.detail-one-line {
  color: var(--muted);
}

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

.intro-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 24px;
  align-items: stretch;
}

.wide-heading {
  display: block;
  margin-bottom: 0;
  padding: 30px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 14px 34px rgba(15, 23, 42, 0.08);
}

.quick-panel {
  display: grid;
  gap: 12px;
}

.quick-panel a {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 68px;
  border-radius: var(--radius);
  color: #fff;
  font-weight: 900;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  box-shadow: 0 14px 32px rgba(37, 99, 235, 0.22);
}

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

.category-tile {
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  padding: 22px;
  border-radius: 24px;
  color: #fff;
  background-size: cover;
  background-position: center;
  box-shadow: 0 16px 36px rgba(15, 23, 42, 0.16);
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-tile:hover {
  transform: translateY(-4px);
  box-shadow: 0 26px 50px rgba(15, 23, 42, 0.22);
}

.category-tile span {
  font-size: 24px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.category-tile strong {
  margin-top: 8px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  font-weight: 600;
}

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

.movie-card {
  overflow: hidden;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #dbeafe;
}

.poster-link img {
  transition: transform 0.35s ease;
}

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

.poster-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  max-width: calc(100% - 24px);
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(37, 99, 235, 0.92);
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

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

.movie-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

.movie-card h3,
.compact-card h3,
.ranking-info h2 {
  margin: 10px 0 8px;
  line-height: 1.3;
  font-size: 18px;
  letter-spacing: -0.03em;
}

.movie-card h3 a:hover,
.compact-card h3 a:hover,
.ranking-info h2 a:hover {
  color: var(--primary);
}

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

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.tag-row span {
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--primary-dark);
  background: #eff6ff;
  font-size: 12px;
  font-weight: 800;
}

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

.compact-card {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  min-height: 128px;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.compact-poster {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 14px;
  background: #dbeafe;
}

.rank-number {
  position: absolute;
  left: 8px;
  top: 8px;
  display: grid;
  place-items: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  font-size: 13px;
  font-weight: 900;
}

.compact-card p,
.compact-card span {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.page-main {
  padding-top: 28px;
}

.page-hero {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 34px;
  padding: 44px;
  border-radius: 28px;
  color: #fff;
  background: radial-gradient(circle at 20% 20%, rgba(96, 165, 250, 0.42), transparent 32%), linear-gradient(135deg, #0f172a, #1d4ed8 58%, #7c3aed);
  box-shadow: var(--shadow);
}

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

.inline-filter,
.search-page-form {
  max-width: 560px;
  display: flex;
  gap: 10px;
  margin-top: 24px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  border: 1px solid rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(14px);
}

.inline-filter input,
.search-page-form input {
  padding: 12px 16px;
  color: #fff;
}

.inline-filter input::placeholder,
.search-page-form input::placeholder {
  color: rgba(255, 255, 255, 0.74);
}

.search-page-form button {
  min-width: 96px;
  background: #fff;
  color: var(--primary);
  box-shadow: none;
}

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

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

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

.ranking-row {
  display: grid;
  grid-template-columns: 70px 90px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 14px;
  border-radius: 20px;
  background: var(--surface);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.07);
}

.ranking-index {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), #7c3aed);
  font-size: 20px;
  font-weight: 900;
}

.ranking-cover {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 14px;
  background: #dbeafe;
}

.ranking-info p {
  margin: 0 0 10px;
  color: var(--muted);
}

.breadcrumb {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 18px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

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

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

.detail-poster {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 24px;
  background: #dbeafe;
  box-shadow: 0 20px 45px rgba(15, 23, 42, 0.18);
}

.detail-copy h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.06;
  letter-spacing: -0.06em;
}

.detail-one-line {
  font-size: 19px;
}

.detail-meta-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  margin-top: 22px;
}

.detail-meta-list span {
  padding: 12px 14px;
  border-radius: 14px;
  background: var(--surface-soft);
  color: #1e3a8a;
  font-weight: 800;
}

.player-section {
  scroll-margin-top: 92px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: #020617;
  box-shadow: var(--shadow);
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 0;
  color: #fff;
  cursor: pointer;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.1), rgba(15, 23, 42, 0.78));
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.play-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.play-circle {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--primary);
  background: #fff;
  font-size: 36px;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.25);
}

.play-overlay strong {
  max-width: min(520px, 88%);
  font-size: 22px;
  text-align: center;
}

.article-section {
  padding: 34px;
  border-radius: 24px;
  background: var(--surface);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.article-section h2 + p {
  margin-top: 12px;
}

.article-section p {
  font-size: 17px;
}

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

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

.empty-state {
  grid-column: 1 / -1;
  padding: 34px;
  border-radius: 22px;
  text-align: center;
  background: var(--surface);
  color: var(--muted);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
}

.site-footer {
  margin-top: 70px;
  padding: 42px 0;
  color: #dbeafe;
  background: #0f172a;
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  gap: 16px;
}

.footer-brand {
  color: #fff;
}

.footer-inner p {
  max-width: 700px;
  margin: 0;
  color: #bfdbfe;
}

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

.footer-links a {
  color: #fff;
  font-weight: 800;
}

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

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

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

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

@media (max-width: 860px) {
  .site-nav {
    flex-wrap: wrap;
    padding: 12px 0;
  }

  .nav-toggle {
    display: inline-flex;
  }

  .nav-menu {
    display: none;
    width: 100%;
    order: 5;
    flex-direction: column;
    align-items: stretch;
    margin: 0;
  }

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

  .nav-link {
    border-radius: 14px;
  }

  .hero-stage {
    min-height: 680px;
  }

  .hero-slide {
    grid-template-columns: 1fr;
    align-content: center;
    padding: 34px;
  }

  .hero-poster {
    width: min(230px, 58vw);
    margin: 0 auto;
  }

  .hero-dots {
    left: 34px;
  }

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

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

  .ranking-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .section-wrap,
  .page-hero,
  .detail-hero,
  .breadcrumb,
  .hero-carousel {
    width: min(100% - 20px, 1180px);
  }

  .hero-carousel,
  .page-hero,
  .detail-hero {
    border-radius: 22px;
  }

  .hero-slide,
  .page-hero,
  .detail-hero,
  .article-section {
    padding: 22px;
  }

  .hero-stage {
    min-height: 650px;
  }

  .movie-grid,
  .category-movie-grid,
  .search-results,
  .related-grid,
  .category-grid,
  .big-category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .ranking-row {
    grid-template-columns: 46px 72px minmax(0, 1fr);
    gap: 12px;
  }

  .ranking-info p {
    display: none;
  }

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

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

  .movie-card p {
    min-height: 58px;
    -webkit-line-clamp: 2;
  }

  .play-circle {
    width: 70px;
    height: 70px;
    font-size: 30px;
  }
}
