:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.74);
  --panel-strong: rgba(15, 23, 42, 0.92);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --cyan: #06b6d4;
  --cyan-strong: #22d3ee;
  --blue: #2563eb;
  --rose: #fb7185;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 10% 0%, rgba(8, 145, 178, 0.18), transparent 34rem),
    radial-gradient(circle at 80% 16%, rgba(37, 99, 235, 0.16), transparent 30rem),
    var(--bg);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image: linear-gradient(rgba(255, 255, 255, 0.024) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.024) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, rgba(0, 0, 0, 0.7), transparent 75%);
}

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

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

button,
input,
select {
  font: inherit;
}

main {
  overflow: hidden;
}

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

.header-inner {
  width: min(1280px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: auto 1fr minmax(240px, 380px);
  gap: 22px;
  align-items: center;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 12px 30px rgba(6, 182, 212, 0.28);
}

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

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

.main-nav a {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted-strong);
  transition: 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: white;
  background: rgba(6, 182, 212, 0.14);
}

.header-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.76);
}

.header-search input,
.large-search input,
.filter-layout input,
.filter-layout select {
  width: 100%;
  color: white;
  border: 1px solid var(--line);
  outline: none;
  background: rgba(15, 23, 42, 0.85);
}

.header-search input {
  min-width: 0;
  padding: 8px 12px;
  border: none;
  background: transparent;
}

.header-search button,
.large-search button,
.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  white-space: nowrap;
  cursor: pointer;
}

.header-search button {
  padding: 8px 14px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
}

.mobile-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
}

.mobile-menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 9px;
  background: white;
}

.global-search-results {
  position: absolute;
  top: calc(100% + 10px);
  right: 0;
  width: min(540px, calc(100vw - 32px));
  max-height: 440px;
  overflow: auto;
  display: none;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(2, 6, 23, 0.96);
  box-shadow: var(--shadow);
}

.global-search-results.active {
  display: grid;
  gap: 8px;
}

.search-result-item {
  display: grid;
  grid-template-columns: 52px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.72);
}

.search-result-item img {
  width: 52px;
  height: 70px;
  object-fit: cover;
  border-radius: 10px;
}

.search-result-item strong {
  display: block;
  margin-bottom: 4px;
}

.search-result-item span {
  color: var(--muted);
  font-size: 13px;
}

.hero-section {
  position: relative;
  width: min(1280px, calc(100% - 32px));
  margin: 28px auto 70px;
}

.hero-slider {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 32px;
  background: var(--bg-soft);
  box-shadow: var(--shadow);
}

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

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

.hero-bg,
.detail-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.64), rgba(2, 6, 23, 0.18)),
    linear-gradient(0deg, rgba(2, 6, 23, 0.92), transparent 52%),
    radial-gradient(circle at 70% 18%, rgba(6, 182, 212, 0.22), transparent 32rem);
}

.hero-content {
  position: relative;
  z-index: 2;
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 56px;
  align-items: end;
  padding: 64px;
}

.hero-copy {
  max-width: 760px;
  padding-bottom: 28px;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 14px;
  padding: 7px 12px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 999px;
  color: var(--cyan-strong);
  background: rgba(8, 145, 178, 0.12);
  font-size: 13px;
  font-weight: 800;
}

.hero-copy h1,
.page-hero h1,
.detail-info h1 {
  margin: 0;
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.hero-copy h1 {
  font-size: clamp(42px, 7vw, 86px);
}

.hero-copy p {
  max-width: 650px;
  margin: 20px 0 0;
  color: var(--muted-strong);
  font-size: 18px;
  line-height: 1.8;
}

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

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

.hero-tags span,
.tag-row span,
.detail-meta span {
  padding: 6px 10px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(15, 23, 42, 0.72);
  font-size: 13px;
}

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

.button-primary,
.button-secondary {
  min-height: 48px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 800;
}

.button-primary {
  color: white;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 18px 40px rgba(6, 182, 212, 0.26);
}

.button-secondary {
  border: 1px solid var(--line);
  color: white;
  background: rgba(15, 23, 42, 0.72);
}

.hero-poster {
  position: relative;
  align-self: center;
  border-radius: 26px;
  transform: rotate(2deg);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.52);
}

.hero-poster::before {
  content: "";
  position: absolute;
  inset: -12px;
  z-index: -1;
  border-radius: 34px;
  background: linear-gradient(135deg, rgba(6, 182, 212, 0.7), rgba(37, 99, 235, 0.1));
  filter: blur(18px);
}

.hero-poster img {
  width: 360px;
  height: 500px;
  object-fit: cover;
  border-radius: 26px;
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 48px;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: white;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(16px);
  font-size: 34px;
  transform: translateY(-50%);
}

.hero-arrow.prev {
  left: 18px;
}

.hero-arrow.next {
  right: 18px;
}

.hero-dots {
  position: absolute;
  left: 64px;
  bottom: 36px;
  z-index: 5;
  display: flex;
  gap: 9px;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  transition: 0.2s ease;
}

.hero-dot.active {
  width: 34px;
  background: var(--cyan-strong);
}

.search-panel,
.content-section,
.filter-bar,
.detail-container {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.search-panel {
  margin-bottom: 70px;
}

.search-panel-inner {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 540px);
  gap: 26px;
  align-items: center;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(8, 145, 178, 0.12));
}

.search-panel h2,
.section-head h2,
.page-hero h1 {
  margin: 0;
  letter-spacing: -0.035em;
}

.search-panel h2,
.section-head h2 {
  font-size: clamp(24px, 4vw, 38px);
}

.large-search {
  position: relative;
  display: flex;
  gap: 10px;
}

.large-search input,
.filter-layout input,
.filter-layout select {
  min-height: 52px;
  padding: 0 16px;
  border-radius: 16px;
}

.large-search button {
  padding: 0 20px;
  border-radius: 16px;
  color: white;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  font-weight: 800;
}

.large-results {
  left: 0;
  right: auto;
  top: calc(100% + 12px);
  width: 100%;
}

.content-section {
  margin-bottom: 76px;
}

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

.more-link {
  color: var(--cyan-strong);
  font-weight: 800;
}

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

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

.ranking-grid .movie-card-wide:nth-child(-n+20) {
  grid-column: span 2;
}

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.62);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.22);
  transition: transform 0.22s ease, border-color 0.22s ease, background 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, 0.34);
  background: rgba(15, 23, 42, 0.86);
}

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

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

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

.rank-badge,
.play-pill {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.rank-badge {
  top: 10px;
  left: 10px;
  padding: 6px 9px;
  background: linear-gradient(135deg, var(--rose), #f59e0b);
}

.play-pill {
  right: 10px;
  bottom: 10px;
  padding: 6px 10px;
  background: rgba(6, 182, 212, 0.86);
}

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

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

.movie-card h3 {
  min-height: 52px;
  margin: 9px 0 8px;
  font-size: 18px;
  line-height: 1.45;
}

.movie-card p {
  min-height: 64px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.55;
}

.tag-row span {
  padding: 4px 8px;
  font-size: 12px;
}

.page-hero {
  position: relative;
  width: min(1280px, calc(100% - 32px));
  margin: 28px auto 42px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at 20% 20%, rgba(6, 182, 212, 0.22), transparent 26rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.7));
}

.small-hero,
.ranking-hero {
  min-height: 260px;
}

.page-hero-content {
  position: relative;
  z-index: 2;
  max-width: 780px;
  padding: 54px;
}

.page-hero h1 {
  font-size: clamp(36px, 6vw, 64px);
}

.page-hero p {
  margin: 18px 0 0;
  color: var(--muted-strong);
  font-size: 18px;
  line-height: 1.8;
}

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

.category-card {
  position: relative;
  min-height: 280px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--bg-soft);
}

.category-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.category-card:hover img {
  transform: scale(1.07);
}

.category-card-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.22));
}

.category-card-content {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
}

.category-card-content span {
  color: var(--cyan-strong);
  font-weight: 900;
}

.category-card-content h2 {
  margin: 10px 0;
  font-size: 30px;
}

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

.filter-bar {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  align-items: center;
  margin-bottom: 30px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.65);
}

.filter-layout {
  flex: 1;
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 180px;
  gap: 12px;
}

.filter-count {
  margin: 0;
  color: var(--muted-strong);
  font-weight: 800;
}

.detail-hero {
  position: relative;
  min-height: 640px;
  margin-bottom: 42px;
  overflow: hidden;
}

.detail-bg-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.7), rgba(2, 6, 23, 0.24)),
    linear-gradient(0deg, #020617, transparent 68%);
}

.detail-hero-grid {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 46px;
  align-items: end;
  min-height: 640px;
  padding: 70px 0;
}

.detail-poster img {
  width: 320px;
  height: 450px;
  object-fit: cover;
  border: 1px solid var(--line);
  border-radius: 26px;
  box-shadow: var(--shadow);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--muted);
}

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

.detail-info h1 {
  max-width: 900px;
  font-size: clamp(42px, 7vw, 82px);
}

.detail-one-line {
  max-width: 820px;
  margin: 20px 0 22px;
  color: var(--muted-strong);
  font-size: 19px;
  line-height: 1.85;
}

.detail-tags {
  margin: 18px 0 26px;
}

.player-section {
  margin-bottom: 54px;
}

.video-player {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: black;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

.movie-video {
  width: 100%;
  height: 100%;
  background: black;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 12px;
  padding: 24px;
  color: white;
  border: 0;
  background:
    radial-gradient(circle at 50% 40%, rgba(6, 182, 212, 0.32), transparent 20rem),
    rgba(2, 6, 23, 0.58);
  backdrop-filter: blur(3px);
  text-align: center;
}

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

.player-play-icon {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 20px 50px rgba(6, 182, 212, 0.32);
  font-size: 34px;
}

.player-cover strong {
  font-size: 24px;
}

.player-cover em {
  color: var(--muted-strong);
  font-style: normal;
}

.detail-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  margin-bottom: 68px;
}

.detail-article,
.detail-sidebar {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.68);
}

.detail-article {
  padding: 34px;
}

.detail-article h2,
.detail-sidebar h2 {
  margin: 0 0 18px;
  font-size: 24px;
}

.detail-article p {
  margin: 0 0 22px;
  color: var(--muted-strong);
  font-size: 16px;
  line-height: 1.9;
}

.detail-sidebar {
  align-self: start;
  padding: 28px;
}

.detail-sidebar dl {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 12px 16px;
  margin: 0;
}

.detail-sidebar dt {
  color: var(--muted);
}

.detail-sidebar dd {
  margin: 0;
  color: var(--muted-strong);
}

.detail-sidebar a {
  color: var(--cyan-strong);
}

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

.footer-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 20px;
  padding: 32px 0;
  color: var(--muted);
}

.footer-inner strong {
  display: block;
  margin-bottom: 8px;
  color: white;
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 14px;
  color: var(--muted-strong);
}

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

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

  .hero-content {
    grid-template-columns: 1fr 280px;
    gap: 32px;
    padding: 48px;
  }

  .hero-poster img {
    width: 280px;
    height: 400px;
  }
}

@media (max-width: 900px) {
  .header-inner {
    grid-template-columns: auto auto;
  }

  .mobile-menu-button {
    display: block;
    justify-self: end;
  }

  .main-nav,
  .header-search {
    grid-column: 1 / -1;
    display: none;
  }

  .main-nav.open,
  .header-search.open {
    display: flex;
  }

  .main-nav.open {
    flex-wrap: wrap;
    padding-bottom: 6px;
  }

  .hero-slider,
  .hero-content {
    min-height: 720px;
  }

  .hero-content {
    grid-template-columns: 1fr;
    align-items: end;
    padding: 36px 24px 84px;
  }

  .hero-poster {
    display: none;
  }

  .hero-dots {
    left: 24px;
  }

  .search-panel-inner,
  .detail-hero-grid,
  .detail-content-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .detail-hero-grid {
    padding-top: 44px;
  }

  .detail-poster img {
    width: 220px;
    height: 310px;
  }

  .filter-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 700px) {
  .movie-grid,
  .compact-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .ranking-grid .movie-card-wide:nth-child(-n+20) {
    grid-column: span 1;
  }

  .movie-card h3 {
    min-height: auto;
    font-size: 16px;
  }

  .movie-card p {
    min-height: auto;
    display: -webkit-box;
    overflow: hidden;
    -webkit-line-clamp: 3;
    -webkit-box-orient: vertical;
  }

  .page-hero-content {
    padding: 34px 22px;
  }

  .footer-inner,
  .section-head,
  .large-search {
    flex-direction: column;
    align-items: stretch;
  }
}

@media (max-width: 480px) {
  .movie-grid,
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .hero-section,
  .search-panel,
  .content-section,
  .filter-bar,
  .detail-container,
  .page-hero {
    width: min(100% - 20px, 1280px);
  }
}
