:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-strong: rgba(15, 23, 42, 0.96);
  --line: rgba(96, 165, 250, 0.22);
  --line-strong: rgba(34, 211, 238, 0.42);
  --text: #f8fafc;
  --muted: #94a3b8;
  --cyan: #22d3ee;
  --blue: #2563eb;
  --amber: #f59e0b;
  --radius: 22px;
  --shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

body::before {
  position: fixed;
  inset: 0;
  z-index: -2;
  content: "";
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 72px 72px;
  mask-image: linear-gradient(to bottom, #000, transparent 80%);
}

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

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

button,
input,
select {
  font: inherit;
}

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

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

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

.brand-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  border-radius: 13px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 12px 26px rgba(34, 211, 238, 0.28);
}

.brand-text {
  font-size: 1.08rem;
}

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

.nav-link {
  padding: 10px 14px;
  color: #cbd5e1;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #ffffff;
  background: rgba(34, 211, 238, 0.14);
}

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

.header-search input,
.filter-grid input,
.filter-grid select {
  width: 100%;
  color: var(--text);
  background: rgba(15, 23, 42, 0.76);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input {
  padding: 11px 16px;
}

.header-search input:focus,
.filter-grid input:focus,
.filter-grid select:focus {
  border-color: var(--line-strong);
  box-shadow: 0 0 0 4px rgba(34, 211, 238, 0.12);
}

.header-search button,
.primary-button,
.secondary-button,
.filter-panel button {
  cursor: pointer;
  border: none;
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 16px 36px rgba(37, 99, 235, 0.26);
}

.header-search button {
  padding: 11px 16px;
  border-radius: 999px;
  white-space: nowrap;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  padding: 8px;
  border: 0;
  background: transparent;
}

.menu-toggle span {
  display: block;
  width: 24px;
  height: 2px;
  margin: 5px 0;
  background: #e2e8f0;
  border-radius: 99px;
}

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

.hero {
  position: relative;
  width: min(100%, 1600px);
  min-height: 620px;
  margin: 0 auto 60px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background: #020617;
}

.hero-track {
  position: relative;
  min-height: 620px;
}

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

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

.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.5;
}

.hero-slide img.image-hidden {
  display: none;
}

.hero-slide::before {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.98) 0%, rgba(2, 6, 23, 0.72) 42%, rgba(2, 6, 23, 0.24) 100%),
    radial-gradient(circle at 74% 26%, rgba(34, 211, 238, 0.2), transparent 22rem),
    linear-gradient(135deg, rgba(14, 165, 233, 0.26), rgba(30, 41, 59, 0.22));
}

.hero-content {
  position: relative;
  z-index: 3;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 132px 0 96px;
}

.hero-kicker,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 7px 14px;
  color: #e0f2fe;
  font-size: 0.9rem;
  font-weight: 700;
  border: 1px solid rgba(34, 211, 238, 0.36);
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.18);
}

.hero h1 {
  max-width: 760px;
  margin: 22px 0 18px;
  font-size: clamp(2.5rem, 6vw, 5.4rem);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero p {
  max-width: 720px;
  margin: 0 0 30px;
  color: #cbd5e1;
  font-size: clamp(1rem, 2vw, 1.24rem);
  line-height: 1.8;
}

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

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 48px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button:hover,
.secondary-button:hover,
.header-search button:hover {
  transform: translateY(-2px);
}

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

.hero-control {
  position: absolute;
  top: 50%;
  z-index: 5;
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border: 1px solid rgba(226, 232, 240, 0.18);
  border-radius: 999px;
  color: #ffffff;
  cursor: pointer;
  background: rgba(2, 6, 23, 0.62);
  backdrop-filter: blur(16px);
}

.hero-control.prev {
  left: 22px;
}

.hero-control.next {
  right: 22px;
}

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

.hero-dot {
  width: 36px;
  height: 5px;
  padding: 0;
  border: none;
  border-radius: 999px;
  cursor: pointer;
  background: rgba(226, 232, 240, 0.34);
}

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

.section {
  margin: 0 0 64px;
}

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

.section-heading p {
  margin: 0 0 8px;
  color: var(--cyan);
  font-weight: 800;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(1.7rem, 3vw, 2.4rem);
  letter-spacing: -0.03em;
}

.section-link {
  flex-shrink: 0;
  color: var(--cyan);
  font-weight: 800;
}

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

.movie-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.82));
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: var(--line-strong);
  box-shadow: var(--shadow);
}

.card-poster {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background:
    radial-gradient(circle at 22% 14%, rgba(34, 211, 238, 0.36), transparent 16rem),
    linear-gradient(135deg, #172554, #020617 60%, #0f172a);
}

.card-poster img,
.compact-card img,
.rank-thumb img,
.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.32s ease, opacity 0.2s ease;
}

.poster-image.image-hidden {
  opacity: 0;
}

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

.poster-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.72), transparent 62%);
}

.play-badge {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 7px 12px;
  color: #ffffff;
  font-size: 0.82rem;
  font-weight: 800;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 10px 26px rgba(37, 99, 235, 0.28);
}

.card-body {
  padding: 18px;
}

.card-meta,
.detail-meta,
.rank-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.88rem;
}

.card-meta span,
.detail-meta span,
.rank-meta span {
  padding: 4px 9px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.54);
}

.movie-card h3 {
  margin: 12px 0 8px;
  font-size: 1.08rem;
  line-height: 1.35;
}

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

.movie-card p {
  display: -webkit-box;
  min-height: 3.1em;
  margin: 0;
  overflow: hidden;
  color: #cbd5e1;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

.tag-row span {
  padding: 5px 9px;
  color: #bae6fd;
  font-size: 0.8rem;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.13);
}

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

.category-card {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.18), transparent 15rem),
    linear-gradient(135deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.86));
}

.category-card h2,
.category-card h3 {
  margin: 0 0 12px;
}

.category-card p {
  margin: 0 0 22px;
  color: #cbd5e1;
  line-height: 1.75;
}

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

.compact-card {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  border-radius: 13px;
  background: linear-gradient(135deg, #172554, #020617);
}

.compact-card span {
  position: absolute;
  inset: auto 0 0;
  padding: 18px 8px 8px;
  font-size: 0.78rem;
  font-weight: 700;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.95), transparent);
}

.filter-panel {
  margin: 0 0 28px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.18);
}

.filter-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 16px;
}

.filter-title span {
  color: var(--cyan);
  font-weight: 800;
}

.filter-grid {
  display: grid;
  grid-template-columns: minmax(240px, 1.3fr) repeat(3, minmax(130px, 0.7fr));
  gap: 14px;
}

.filter-grid input,
.filter-grid select {
  min-height: 46px;
  padding: 0 14px;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 54px 128px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.68);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.rank-item:hover {
  transform: translateX(4px);
  border-color: var(--line-strong);
  background: rgba(30, 41, 59, 0.88);
}

.rank-number {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  font-weight: 900;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.86);
}

.rank-item:nth-child(1) .rank-number,
.rank-item:nth-child(2) .rank-number,
.rank-item:nth-child(3) .rank-number {
  color: #ffffff;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.rank-thumb {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(135deg, #172554, #020617);
}

.rank-info h3 {
  margin: 0 0 8px;
}

.rank-info p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.6;
}

.page-hero {
  padding: 72px 0 36px;
}

.page-hero h1 {
  max-width: 880px;
  margin: 18px 0 18px;
  font-size: clamp(2rem, 5vw, 4.2rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.page-hero p {
  max-width: 820px;
  margin: 0;
  color: #cbd5e1;
  font-size: 1.08rem;
  line-height: 1.8;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 32px;
  align-items: end;
  padding: 58px 0 36px;
}

.detail-hero h1 {
  margin: 18px 0;
  font-size: clamp(2.1rem, 5vw, 4.8rem);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.detail-hero p {
  max-width: 820px;
  color: #cbd5e1;
  font-size: 1.08rem;
  line-height: 1.8;
}

.detail-poster {
  overflow: hidden;
  aspect-ratio: 3 / 4;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: linear-gradient(135deg, #172554, #020617);
  box-shadow: var(--shadow);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 0.92rem;
}

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

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: 28px;
  background: #000000;
  box-shadow: var(--shadow);
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  color: #ffffff;
  cursor: pointer;
  background: radial-gradient(circle at center, rgba(14, 165, 233, 0.24), rgba(2, 6, 23, 0.64));
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-overlay span {
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  padding-left: 5px;
  font-size: 2.2rem;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 18px 52px rgba(37, 99, 235, 0.42);
}

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

.content-panel,
.side-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.18);
}

.content-panel {
  padding: 28px;
}

.content-panel h2,
.side-panel h2 {
  margin: 0 0 16px;
}

.content-panel p {
  margin: 0 0 22px;
  color: #cbd5e1;
  line-height: 1.9;
}

.side-panel {
  padding: 22px;
}

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

.side-link {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.54);
}

.side-link:hover {
  background: rgba(30, 41, 59, 0.86);
}

.side-link img {
  width: 84px;
  height: 56px;
  object-fit: cover;
  border-radius: 12px;
  background: linear-gradient(135deg, #172554, #020617);
}

.side-link strong {
  display: block;
  margin-bottom: 5px;
}

.side-link span {
  color: var(--muted);
  font-size: 0.86rem;
}

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

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

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

.footer-inner p {
  margin: 8px 0 0;
  color: var(--muted);
}

.footer-links {
  display: flex;
  gap: 16px;
  align-items: center;
}

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

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

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

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

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

@media (max-width: 820px) {
  .header-inner {
    flex-wrap: wrap;
    min-height: 64px;
    padding: 12px 0;
  }

  .menu-toggle {
    display: block;
  }

  .site-nav {
    display: none;
    flex-basis: 100%;
    flex-direction: column;
    align-items: stretch;
    padding: 8px 0;
  }

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

  .header-search {
    order: 3;
    min-width: 100%;
  }

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

  .hero-control {
    display: none;
  }

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

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

  .rank-item {
    grid-template-columns: 42px 96px 1fr;
  }

  .rank-item .primary-button {
    grid-column: 1 / -1;
  }

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

@media (max-width: 560px) {
  .page-main,
  .header-inner,
  .hero-content,
  .footer-inner {
    width: min(100% - 22px, 1280px);
  }

  .movie-grid,
  .category-grid,
  .category-preview {
    grid-template-columns: 1fr;
  }

  .hero h1,
  .page-hero h1,
  .detail-hero h1 {
    letter-spacing: -0.03em;
  }

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

  .rank-thumb {
    display: none;
  }

  .content-panel,
  .side-panel,
  .filter-panel {
    padding: 18px;
  }

  .footer-links {
    flex-wrap: wrap;
  }
}
