:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-strong: rgba(15, 23, 42, 0.94);
  --line: rgba(148, 163, 184, 0.18);
  --text: #e2e8f0;
  --muted: #94a3b8;
  --cyan: #22d3ee;
  --blue: #60a5fa;
  --accent: #38bdf8;
  --radius: 22px;
  --shadow: 0 24px 80px rgba(2, 8, 23, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.16), transparent 32rem),
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.14), transparent 28rem),
    linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(2, 6, 23, 0.82);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(1240px, calc(100% - 32px));
  height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #00131a;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 14px 34px rgba(34, 211, 238, 0.25);
}

.brand-name {
  font-size: 22px;
  font-weight: 850;
  letter-spacing: -0.04em;
  background: linear-gradient(90deg, var(--cyan), var(--blue));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

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

.nav-link,
.mobile-link {
  color: #cbd5e1;
  border-radius: 12px;
  transition: 0.22s ease;
}

.nav-link {
  padding: 10px 14px;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
  color: var(--cyan);
  background: rgba(15, 23, 42, 0.74);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.header-search input,
.mobile-search input,
.filter-bar input,
.page-search-form input {
  color: var(--text);
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.22);
  outline: none;
  border-radius: 14px;
  transition: 0.22s ease;
}

.header-search input {
  width: 230px;
  padding: 10px 12px;
}

.header-search input:focus,
.mobile-search input:focus,
.filter-bar input:focus,
.page-search-form input:focus {
  border-color: rgba(34, 211, 238, 0.76);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.08);
}

.header-search button,
.mobile-search button,
.page-search-form button {
  border: 0;
  cursor: pointer;
  color: #06111f;
  padding: 10px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  font-weight: 750;
}

.nav-toggle {
  display: none;
  border: 0;
  color: var(--text);
  background: rgba(15, 23, 42, 0.86);
  border-radius: 12px;
  padding: 10px 12px;
  cursor: pointer;
}

.mobile-panel {
  display: none;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 16px;
}

.mobile-panel.is-open {
  display: block;
}

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

.mobile-search input {
  flex: 1;
  padding: 12px;
}

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

.mobile-link {
  padding: 12px;
}

.hero-carousel {
  position: relative;
  min-height: 72vh;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--line);
}

.hero-carousel::before {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -3;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.42), rgba(2, 6, 23, 0.9)),
    linear-gradient(0deg, #020617, transparent 28%),
    var(--hero-img, none) center / cover no-repeat;
}

.hero-carousel::after {
  content: "";
  position: absolute;
  inset: auto -10% -35% -10%;
  height: 55%;
  z-index: -2;
  background: radial-gradient(ellipse at center, rgba(34, 211, 238, 0.17), transparent 70%);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.015);
  transition: opacity 0.8s ease, transform 0.9s ease;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 380px);
  align-items: center;
  gap: 42px;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 56px 0 84px;
  pointer-events: none;
}

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

.hero-copy {
  max-width: 700px;
}

.eyebrow,
.section-heading span,
.page-hero span,
.panel-title span {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 18px 0 18px;
  font-size: clamp(42px, 7vw, 86px);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.hero-copy p {
  max-width: 660px;
  color: #cbd5e1;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.8;
  margin: 0 0 30px;
}

.hero-actions,
.inline-actions {
  display: flex;
  align-items: center;
  gap: 14px;
  flex-wrap: wrap;
}

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

.primary-btn {
  color: #06111f;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 16px 40px rgba(34, 211, 238, 0.2);
}

.ghost-btn {
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line);
}

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

.hero-poster {
  position: relative;
  display: block;
  border-radius: 30px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.7);
  border: 1px solid rgba(226, 232, 240, 0.18);
  box-shadow: var(--shadow);
  transform: rotate(1.5deg);
}

.hero-poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.hero-poster span {
  position: absolute;
  left: 18px;
  bottom: 18px;
  right: 18px;
  color: white;
  padding: 12px 14px;
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(12px);
}

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

.hero-dot {
  width: 38px;
  height: 6px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(203, 213, 225, 0.35);
}

.hero-dot.active {
  background: linear-gradient(90deg, var(--cyan), var(--blue));
}

.hero-category-strip {
  position: absolute;
  left: 50%;
  bottom: 70px;
  transform: translateX(-50%);
  width: min(1040px, calc(100% - 32px));
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 4px;
  scrollbar-width: none;
}

.hero-category-strip::-webkit-scrollbar {
  display: none;
}

.hero-category-strip a {
  flex: 0 0 auto;
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.62);
  border: 1px solid rgba(148, 163, 184, 0.18);
  padding: 9px 14px;
  border-radius: 999px;
  backdrop-filter: blur(14px);
}

.section-wrap {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 64px 0 0;
}

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

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

.section-heading h2,
.page-hero h1,
.detail-copy h1 {
  margin: 8px 0 0;
  font-size: clamp(30px, 4vw, 52px);
  letter-spacing: -0.05em;
}

.section-heading p,
.page-hero p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.8;
}

.with-action {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 20px;
}

.with-action > a,
.panel-title a,
.category-preview-head a {
  color: var(--cyan);
  font-weight: 760;
}

.featured-grid,
.movie-grid,
.category-grid,
.preview-grid {
  display: grid;
  gap: 18px;
}

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

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

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

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

.movie-card {
  min-width: 0;
}

.movie-card .poster {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 16px 42px rgba(2, 8, 23, 0.28);
}

.movie-card .poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform 0.38s ease;
}

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

.poster-glow {
  position: absolute;
  inset: auto 0 0;
  height: 44%;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.74), transparent);
}

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

.movie-meta {
  color: var(--cyan);
  font-size: 12px;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

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

.movie-info h3 a:hover {
  color: var(--cyan);
}

.movie-info p {
  min-height: 44px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
  margin: 8px 0 10px;
}

.tag-row {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}

.tag-row span {
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.16);
  border: 1px solid rgba(96, 165, 250, 0.16);
  border-radius: 999px;
  padding: 5px 8px;
  font-size: 12px;
}

.movie-card.large .movie-info h3 {
  font-size: 21px;
}

.movie-card.large .movie-info p {
  min-height: 52px;
  font-size: 14px;
}

.ranking-panel,
.category-tile,
.category-preview,
.page-hero,
.detail-content article,
.side-list,
.filter-bar,
.player-shell {
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.ranking-panel {
  position: sticky;
  top: 88px;
  border-radius: 26px;
  padding: 22px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 34px 1fr auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.35);
  transition: 0.22s ease;
}

.rank-row:hover {
  background: rgba(14, 165, 233, 0.12);
}

.rank-row span {
  color: var(--cyan);
  font-weight: 900;
}

.rank-row strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rank-row em {
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.category-tile {
  min-height: 172px;
  border-radius: 24px;
  padding: 22px;
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.18), transparent 50%),
    rgba(15, 23, 42, 0.76);
  transition: 0.22s ease;
}

.category-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.38);
}

.category-tile span {
  display: block;
  font-size: 22px;
  font-weight: 850;
  margin-bottom: 12px;
}

.category-tile p {
  color: var(--muted);
  line-height: 1.7;
  margin: 0;
}

.site-footer {
  margin-top: 80px;
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.78);
}

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

.footer-inner p {
  color: var(--muted);
  max-width: 520px;
}

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

.footer-links a:hover {
  color: var(--cyan);
}

.copyright {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  color: #64748b;
  border-top: 1px solid var(--line);
  padding: 18px 0 28px;
}

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

.page-hero {
  margin-top: 34px;
  border-radius: 30px;
  padding: clamp(36px, 7vw, 76px);
  overflow: hidden;
  position: relative;
  background:
    radial-gradient(circle at 80% 10%, rgba(34, 211, 238, 0.2), transparent 30%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.76));
}

.category-preview {
  border-radius: 28px;
  padding: 24px;
  margin-top: 28px;
}

.category-preview-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: start;
  margin-bottom: 22px;
}

.category-preview-head h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.category-preview-head p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.filter-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  border-radius: 22px;
  padding: 16px;
  margin-bottom: 24px;
}

.filter-bar input {
  width: min(520px, 100%);
  padding: 13px 14px;
}

.filter-count {
  color: var(--muted);
  white-space: nowrap;
}

.rank-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #06111f;
  font-weight: 900;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 12px 24px rgba(2, 6, 23, 0.36);
}

.breadcrumb {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--muted);
  margin: 28px 0 18px;
  flex-wrap: wrap;
}

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

.detail-hero {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 32px;
  align-items: end;
  border-radius: 30px;
  padding: 28px;
  background:
    radial-gradient(circle at top right, rgba(96, 165, 250, 0.16), transparent 40%),
    rgba(15, 23, 42, 0.7);
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
}

.detail-poster {
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid var(--line);
  box-shadow: 0 18px 44px rgba(2, 8, 23, 0.42);
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

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

.lead {
  color: #dbeafe;
  line-height: 1.85;
  font-size: 18px;
  max-width: 820px;
}

.detail-meta {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 20px 0;
}

.detail-meta span {
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.38);
  border-radius: 14px;
  padding: 9px 12px;
}

.large-tags span {
  padding: 7px 11px;
}

.player-section {
  margin-top: 30px;
}

.player-shell {
  position: relative;
  border-radius: 28px;
  overflow: hidden;
  background: #000;
}

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

.play-toggle {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  border: 0;
  color: white;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.42));
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

.play-toggle span {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  color: #06111f;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  border-radius: 999px;
  font-size: 28px;
  box-shadow: 0 20px 52px rgba(34, 211, 238, 0.25);
}

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

.detail-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 30px;
  margin-top: 34px;
}

.detail-content article,
.side-list {
  border-radius: 28px;
  padding: 28px;
}

.detail-content h2,
.side-list h2 {
  margin: 0 0 14px;
  font-size: 28px;
}

.detail-content p {
  color: #cbd5e1;
  font-size: 17px;
  line-height: 2;
}

.side-cards {
  display: grid;
  gap: 12px;
}

.horizontal-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.34);
  transition: 0.22s ease;
}

.horizontal-card:hover {
  background: rgba(14, 165, 233, 0.12);
}

.horizontal-card img {
  width: 96px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 14px;
}

.horizontal-card strong,
.horizontal-card p,
.horizontal-card small {
  display: block;
}

.horizontal-card strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.horizontal-card p {
  margin: 4px 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.horizontal-card small {
  color: var(--cyan);
}

.related-wrap {
  padding-top: 46px;
}

.page-search-form {
  display: flex;
  width: min(620px, 100%);
  gap: 10px;
  margin-top: 22px;
}

.page-search-form input {
  flex: 1;
  padding: 14px 16px;
}

.empty-state {
  grid-column: 1 / -1;
  color: var(--muted);
  text-align: center;
  padding: 54px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.56);
}

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

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

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

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

  .ranking-panel {
    position: static;
  }
}

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

  .nav-toggle {
    display: block;
    margin-left: auto;
  }

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

  .hero-poster {
    display: none;
  }

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

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

  .detail-hero {
    grid-template-columns: 180px minmax(0, 1fr);
  }
}

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

  .brand-name {
    font-size: 19px;
  }

  .hero-carousel {
    min-height: 78vh;
  }

  .hero-copy h1 {
    font-size: 40px;
  }

  .hero-category-strip {
    bottom: 70px;
  }

  .section-wrap {
    padding-top: 48px;
  }

  .featured-grid,
  .category-grid,
  .movie-grid,
  .catalog-grid,
  .ranking-grid,
  .preview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .movie-info p {
    display: none;
  }

  .category-preview,
  .page-hero,
  .detail-hero,
  .detail-content article,
  .side-list {
    border-radius: 22px;
    padding: 18px;
  }

  .category-preview-head,
  .with-action,
  .footer-inner,
  .filter-bar {
    display: grid;
  }

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

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

  .detail-copy h1 {
    font-size: 36px;
  }

  .lead {
    font-size: 16px;
  }

  .page-search-form {
    display: grid;
  }

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