:root {
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --cyan: #14b8a6;
  --red: #ef4444;
  --orange: #f97316;
  --purple: #7c3aed;
  --green: #059669;
  --slate: #111827;
  --muted: #64748b;
  --line: #e5e7eb;
  --bg: #f8fafc;
  --card: #ffffff;
  --shadow: 0 18px 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;
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 36%, #f8fafc 100%);
  color: #111827;
}

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

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

button,
input,
select {
  font: inherit;
}

.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);
  backdrop-filter: blur(16px);
}

.navbar {
  max-width: 1280px;
  margin: 0 auto;
  height: 68px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
  font-weight: 800;
  color: #0f172a;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.25);
}

.brand-text {
  font-size: 20px;
  letter-spacing: -0.02em;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link,
.mobile-link {
  padding: 10px 14px;
  border-radius: 12px;
  color: #475569;
  font-size: 15px;
  font-weight: 700;
  transition: all 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
  color: var(--blue);
  background: #eff6ff;
}

.top-search {
  margin-left: auto;
  width: min(360px, 32vw);
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-search input,
.mobile-search input,
.hero-search input,
.large-search input,
.filter-bar select {
  width: 100%;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #ffffff;
  padding: 11px 14px;
  outline: none;
  color: #0f172a;
  transition: all 0.2s ease;
}

.top-search input:focus,
.mobile-search input:focus,
.hero-search input:focus,
.large-search input:focus,
.filter-bar select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.top-search button,
.mobile-search button,
.hero-search button,
.large-search button {
  border: 0;
  border-radius: 14px;
  padding: 11px 16px;
  color: #ffffff;
  background: var(--blue);
  font-weight: 800;
  white-space: nowrap;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  border: 1px solid #cbd5e1;
  border-radius: 14px;
  background: #ffffff;
}

.mobile-panel {
  display: none;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 18px;
}

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

.mobile-search {
  display: flex;
  gap: 8px;
}

.quick-cats {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 12px;
  display: flex;
  gap: 10px;
  overflow-x: auto;
}

.quick-cats a {
  flex: 0 0 auto;
  padding: 7px 12px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 13px;
  font-weight: 700;
}

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

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.75s ease;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
  filter: saturate(1.08);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 72% 26%, rgba(20, 184, 166, 0.28), transparent 28%),
    linear-gradient(90deg, rgba(15, 23, 42, 0.92), rgba(37, 99, 235, 0.64) 52%, rgba(15, 23, 42, 0.35)),
    linear-gradient(180deg, rgba(15, 23, 42, 0.15), rgba(15, 23, 42, 0.92));
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  min-height: 620px;
  padding: 96px 24px 92px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.eyebrow,
.section-title span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #facc15;
  font-weight: 900;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-content h1 {
  margin: 14px 0 10px;
  max-width: 880px;
  color: #ffffff;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.hero-content h2 {
  margin: 0 0 18px;
  color: #dbeafe;
  font-size: clamp(24px, 3.6vw, 44px);
  line-height: 1.1;
}

.hero-content p {
  max-width: 680px;
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 19px;
  line-height: 1.8;
}

.hero-tags,
.detail-meta,
.movie-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero-tags span,
.detail-meta span,
.movie-meta span {
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.movie-meta span,
.detail-meta span {
  background: #f1f5f9;
  color: #475569;
}

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

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 900;
  transition: all 0.25s ease;
}

.primary-btn {
  color: var(--blue);
  background: #ffffff;
  box-shadow: 0 18px 35px rgba(15, 23, 42, 0.24);
}

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

.ghost-btn {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.28);
  backdrop-filter: blur(14px);
}

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

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

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

.section-wrap {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 24px;
}

.intro-strip {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 520px);
  gap: 28px;
  align-items: center;
}

.intro-strip h2,
.section-title h2,
.ranking-panel h2,
.side-panel h2,
.detail-card h2 {
  margin: 0;
  color: #0f172a;
  font-size: clamp(26px, 3.4vw, 40px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.intro-strip p {
  margin: 12px 0 0;
  color: var(--muted);
  font-size: 17px;
  line-height: 1.8;
}

.hero-search,
.large-search {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.section-title {
  margin-bottom: 28px;
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
}

.section-title a {
  color: var(--blue);
  font-weight: 900;
}

.movie-grid {
  display: grid;
  gap: 22px;
}

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.07);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.poster-wrap {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #1e3a8a, #0f172a);
}

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

.movie-card:hover img {
  transform: scale(1.08);
}

.duration,
.play-dot {
  position: absolute;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.68);
  backdrop-filter: blur(12px);
}

.duration {
  right: 12px;
  bottom: 12px;
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 800;
}

.play-dot {
  left: 12px;
  top: 12px;
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
}

.movie-info {
  padding: 16px;
}

.movie-title,
.ranking-title {
  display: block;
  color: #0f172a;
  font-size: 18px;
  font-weight: 900;
  line-height: 1.35;
}

.movie-title:hover,
.ranking-title:hover {
  color: var(--blue);
}

.movie-info p,
.ranking-card p,
.detail-card p,
.page-hero p,
.category-tile span,
.poster-card + .side-panel p {
  color: var(--muted);
  line-height: 1.75;
}

.movie-info p {
  min-height: 52px;
  margin: 8px 0 12px;
  font-size: 14px;
}

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

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

.category-band {
  background: linear-gradient(90deg, #fff7ed, #fff1f2);
}

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

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

.category-tile {
  min-height: 150px;
  padding: 22px;
  border-radius: 22px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  color: #ffffff;
  box-shadow: var(--shadow);
  overflow: hidden;
  position: relative;
}

.category-tile::after {
  content: "";
  position: absolute;
  width: 120px;
  height: 120px;
  right: -30px;
  top: -30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
}

.category-tile strong {
  position: relative;
  z-index: 1;
  font-size: 22px;
}

.category-tile span {
  position: relative;
  z-index: 1;
  color: rgba(255, 255, 255, 0.86);
}

.grad-blue { background: linear-gradient(135deg, #2563eb, #14b8a6); }
.grad-orange { background: linear-gradient(135deg, #f97316, #ef4444); }
.grad-green { background: linear-gradient(135deg, #059669, #22c55e); }
.grad-purple { background: linear-gradient(135deg, #7c3aed, #2563eb); }
.grad-red { background: linear-gradient(135deg, #ef4444, #f43f5e); }
.grad-cyan { background: linear-gradient(135deg, #0891b2, #2563eb); }
.grad-indigo { background: linear-gradient(135deg, #4f46e5, #9333ea); }
.grad-teal { background: linear-gradient(135deg, #0d9488, #2563eb); }
.grad-pink { background: linear-gradient(135deg, #db2777, #f97316); }
.grad-slate { background: linear-gradient(135deg, #111827, #475569); }

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
}

.ranking-panel,
.side-panel,
.detail-card,
.poster-card,
.player-shell {
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.ranking-panel,
.side-panel {
  padding: 22px;
}

.rank-line {
  display: grid;
  grid-template-columns: 36px 1fr auto;
  gap: 10px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid #f1f5f9;
}

.rank-line:last-child {
  border-bottom: 0;
}

.rank-num {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: var(--blue);
  font-weight: 900;
}

.rank-name {
  font-weight: 800;
}

.rank-hot {
  color: var(--red);
  font-size: 13px;
  font-weight: 900;
}

.page-hero {
  color: #ffffff;
}

.page-hero > div {
  max-width: 1280px;
  margin: 0 auto;
  padding: 72px 24px;
}

.page-hero h1 {
  margin: 16px 0 12px;
  font-size: clamp(36px, 5vw, 60px);
  letter-spacing: -0.05em;
}

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

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: rgba(255, 255, 255, 0.82);
  font-size: 14px;
}

.breadcrumb.dark {
  color: #64748b;
  margin-bottom: 16px;
}

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

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

.filter-bar {
  padding-top: 32px;
  padding-bottom: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: end;
}

.filter-bar label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-weight: 900;
}

.filter-bar select {
  min-width: 170px;
}

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

.ranking-card {
  display: grid;
  grid-template-columns: 190px 1fr;
  gap: 20px;
  padding: 16px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.06);
}

.rank-poster {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 16px;
  background: #0f172a;
}

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

.rank-poster span {
  position: absolute;
  z-index: 2;
  left: 10px;
  top: 10px;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: rgba(239, 68, 68, 0.92);
  font-weight: 900;
}

.search-page {
  padding-top: 36px;
}

.large-search {
  max-width: 860px;
  margin-bottom: 18px;
}

.search-hint {
  margin-bottom: 24px;
  color: var(--muted);
  font-weight: 800;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

.detail-main {
  min-width: 0;
}

.player-shell {
  overflow: hidden;
  background: #020617;
}

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

.video-el {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #020617;
}

.play-overlay {
  position: absolute;
  inset: 0;
  z-index: 5;
  border: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.58));
}

.play-overlay span {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--blue);
  background: rgba(255, 255, 255, 0.95);
  font-size: 32px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, 0.32);
  transition: transform 0.2s ease;
}

.play-overlay:hover span {
  transform: scale(1.08);
}

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

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

.category-pill {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--blue);
  background: #eff6ff;
  font-weight: 900;
}

.detail-card h1 {
  margin: 0 0 12px;
  font-size: clamp(32px, 4vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.05em;
}

.one-line {
  font-size: 18px;
}

.detail-card h2 {
  margin-top: 28px;
  margin-bottom: 10px;
  font-size: 24px;
}

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

.detail-side {
  display: grid;
  gap: 18px;
  position: sticky;
  top: 110px;
}

.poster-card {
  padding: 16px;
}

.poster-card img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 18px;
  background: #0f172a;
}

.primary-btn.full {
  width: 100%;
  margin-top: 14px;
  color: #ffffff;
  background: var(--blue);
}

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

.compact-card {
  display: grid;
  grid-template-columns: 118px 1fr;
  gap: 12px;
  box-shadow: none;
}

.compact-card .poster-wrap {
  height: 100%;
}

.compact-card .movie-info {
  padding: 12px 12px 12px 0;
}

.compact-card .movie-title {
  font-size: 15px;
}

.compact-card p,
.compact-card .tag-row {
  display: none;
}

.hidden-by-filter {
  display: none !important;
}

@media (max-width: 1120px) {
  .featured-grid,
  .latest-grid,
  .category-movies {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .detail-side {
    position: static;
    grid-template-columns: 320px 1fr;
  }
}

@media (max-width: 860px) {
  .nav-links,
  .top-search {
    display: none;
  }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .quick-cats {
    padding-bottom: 10px;
  }

  .hero-carousel,
  .hero-content {
    min-height: 560px;
  }

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

  .featured-grid,
  .latest-grid,
  .category-movies,
  .category-grid,
  .category-grid.wide {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 560px) {
  .navbar,
  .section-wrap,
  .page-hero > div,
  .hero-content {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-actions,
  .hero-search,
  .large-search,
  .mobile-search {
    flex-direction: column;
  }

  .featured-grid,
  .latest-grid,
  .category-movies,
  .category-grid,
  .category-grid.wide {
    grid-template-columns: 1fr;
  }

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

  .compact-card .movie-info {
    padding: 14px;
  }

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