* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-strong: rgba(15, 23, 42, 0.96);
  --line: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --blue: #2563eb;
  --cyan: #22d3ee;
  --radius: 24px;
  --shadow: 0 24px 70px rgba(2, 6, 23, 0.55);
}

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

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;
  border-bottom: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(18px);
}

.nav-wrap {
  width: min(1280px, calc(100% - 32px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #60a5fa, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #22d3ee);
  box-shadow: 0 12px 34px rgba(37, 99, 235, 0.34);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: #cbd5e1;
  font-size: 15px;
}

.desktop-nav a,
.mobile-nav a {
  transition: color 0.2s ease, transform 0.2s ease;
}

.desktop-nav a:hover,
.mobile-nav a:hover {
  color: #ffffff;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.8);
  color: #ffffff;
}

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: #e2e8f0;
  border-radius: 4px;
}

.mobile-nav {
  display: none;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto 16px;
  padding: 16px;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.96);
}

.mobile-nav.open {
  display: grid;
}

main {
  overflow: hidden;
}

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

.hero-slider {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: #0f172a;
  box-shadow: var(--shadow);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.05fr) minmax(280px, 0.55fr);
  gap: 36px;
  align-items: center;
  padding: 72px;
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.hero-bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background-position: center;
  background-size: cover;
  filter: saturate(1.15);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 24% 24%, rgba(96, 165, 250, 0.16), transparent 24rem),
    linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.45));
}

.hero-content,
.hero-poster {
  position: relative;
  z-index: 1;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: #67e8f9;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1,
.page-hero h1,
.detail-info h1 {
  margin: 0;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.hero p,
.page-hero p,
.detail-one-line {
  max-width: 760px;
  margin: 22px 0 0;
  color: #dbeafe;
  font-size: 18px;
  line-height: 1.85;
}

.hero-tags,
.detail-meta,
.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

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

.hero-tags span,
.detail-meta span,
.card-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 4px 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.62);
}

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

.primary-button,
.glass-button,
.wide-link,
.inline-search button,
.hero-search button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border: 0;
  border-radius: 14px;
  color: #ffffff;
  font-weight: 750;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button,
.hero-search button,
.inline-search button {
  background: linear-gradient(135deg, #2563eb, #0891b2);
  box-shadow: 0 16px 38px rgba(37, 99, 235, 0.32);
}

.glass-button {
  border: 1px solid rgba(148, 163, 184, 0.22);
  background: rgba(15, 23, 42, 0.64);
}

.primary-button:hover,
.glass-button:hover,
.wide-link:hover,
.hero-search button:hover,
.inline-search button:hover {
  transform: translateY(-2px);
}

.hero-poster {
  justify-self: end;
  width: min(360px, 100%);
  aspect-ratio: 2 / 3;
  border-radius: 30px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  box-shadow: 0 32px 80px rgba(0, 0, 0, 0.44);
}

.poster-frame {
  position: relative;
  width: 100%;
  height: 100%;
  min-height: 100%;
  overflow: hidden;
  background:
    radial-gradient(circle at top, rgba(34, 211, 238, 0.28), transparent 18rem),
    linear-gradient(145deg, #172554, #0f172a 58%, #111827);
}

.poster-frame img {
  position: relative;
  z-index: 2;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-frame img.is-missing {
  display: none;
}

.poster-fallback {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  padding: 22px;
  color: #dbeafe;
  font-size: 22px;
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  background:
    linear-gradient(145deg, rgba(37, 99, 235, 0.2), rgba(15, 23, 42, 0.9)),
    radial-gradient(circle at 50% 0%, rgba(34, 211, 238, 0.24), transparent 16rem);
}

.hero-control {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 48px;
  height: 48px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(2, 6, 23, 0.58);
  cursor: pointer;
  font-size: 34px;
  line-height: 1;
  transform: translateY(-50%);
}

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

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

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

.hero-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  cursor: pointer;
}

.hero-dots button.active {
  width: 30px;
  background: #67e8f9;
}

.hero-search {
  width: min(980px, calc(100% - 32px));
  margin: -34px auto 0;
  position: relative;
  z-index: 8;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.94);
  box-shadow: 0 20px 60px rgba(2, 6, 23, 0.38);
}

.hero-search label {
  display: block;
  margin: 0 0 10px;
  color: #94a3b8;
  font-size: 14px;
}

.hero-search div,
.inline-search {
  display: flex;
  gap: 12px;
}

.hero-search input,
.inline-search input,
.filter-bar input {
  width: 100%;
  min-height: 46px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 14px;
  outline: none;
  padding: 0 16px;
  color: #ffffff;
  background: rgba(2, 6, 23, 0.62);
}

.content-section {
  width: min(1280px, calc(100% - 32px));
  margin: 74px auto;
}

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

.section-title h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: -0.03em;
}

.section-title p {
  max-width: 620px;
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

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

.category-tile {
  position: relative;
  min-height: 178px;
  overflow: hidden;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.74);
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.24);
}

.category-tile span,
.category-tile strong,
.category-tile em {
  position: relative;
  z-index: 2;
  display: block;
}

.category-tile span {
  color: #67e8f9;
  font-size: 13px;
  font-weight: 700;
}

.category-tile strong {
  margin-top: 14px;
  font-size: 22px;
}

.category-tile em {
  margin-top: 12px;
  color: #cbd5e1;
  font-style: normal;
  line-height: 1.6;
}

.category-tile i {
  position: absolute;
  right: -28px;
  bottom: -46px;
  width: 142px;
  height: 190px;
  border-radius: 22px;
  opacity: 0.22;
  background-size: cover;
  background-position: center;
  transform: rotate(8deg);
}

.panel-section {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: 34px;
  background: rgba(15, 23, 42, 0.52);
}

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

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.22);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.movie-card:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.42);
}

.card-poster {
  display: block;
  aspect-ratio: 2 / 3;
  background: #0f172a;
}

.card-body {
  padding: 18px;
}

.card-meta {
  gap: 7px;
  margin-bottom: 12px;
  font-size: 12px;
}

.movie-card h2 {
  margin: 0;
  font-size: 19px;
  line-height: 1.35;
}

.movie-card h2 a:hover,
.text-link:hover,
.muted-link:hover {
  color: #67e8f9;
}

.movie-card p {
  min-height: 72px;
  margin: 12px 0 0;
  color: #b6c3d1;
  font-size: 14px;
  line-height: 1.7;
}

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

.tag-row span,
.detail-tags a {
  padding: 5px 9px;
  border-radius: 999px;
  color: #bfdbfe;
  background: rgba(37, 99, 235, 0.18);
  font-size: 12px;
}

.text-link {
  color: #93c5fd;
  font-weight: 750;
}

.muted-link {
  color: #94a3b8;
  font-size: 14px;
}

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

.rank-aside {
  position: sticky;
  top: 96px;
  padding: 24px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.72);
}

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

.mini-card {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  min-height: 86px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.34);
}

.mini-card .poster-frame {
  width: 58px;
  height: 74px;
  border-radius: 12px;
}

.mini-card span,
.mini-card small {
  grid-column: 2;
  display: block;
}

.mini-card span {
  color: #f8fafc;
  font-weight: 760;
}

.mini-card small {
  margin-top: -18px;
  color: #94a3b8;
}

.wide-link {
  width: 100%;
  margin-top: 18px;
  background: rgba(37, 99, 235, 0.24);
}

.page-hero,
.detail-layout {
  width: min(1280px, calc(100% - 32px));
  margin: 32px auto 0;
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.16), transparent 26rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(2, 6, 23, 0.88));
  box-shadow: var(--shadow);
}

.compact-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 28px;
  padding: 54px;
}

.filter-bar {
  display: grid;
  gap: 16px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.62);
}

.filter-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-pills button {
  min-height: 34px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  padding: 0 14px;
  color: #cbd5e1;
  background: rgba(2, 6, 23, 0.46);
  cursor: pointer;
}

.filter-pills button.active,
.filter-pills button:hover {
  color: #ffffff;
  border-color: rgba(34, 211, 238, 0.38);
  background: rgba(37, 99, 235, 0.32);
}

.empty-state {
  display: none;
  padding: 40px;
  color: #94a3b8;
  text-align: center;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.56);
}

.empty-state.show {
  display: block;
}

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

.rank-card {
  display: grid;
  grid-template-columns: 76px 96px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 14px;
}

.rank-number {
  display: grid;
  place-items: center;
  width: 56px;
  height: 56px;
  border-radius: 18px;
  color: #ffffff;
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(135deg, #1d4ed8, #0891b2);
}

.rank-poster {
  display: block;
  width: 96px;
  height: 124px;
  border-radius: 16px;
  overflow: hidden;
}

.rank-card p {
  min-height: auto;
  margin-bottom: 12px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(320px, 0.85fr);
  gap: 32px;
  align-items: center;
  padding: 34px;
}

.player-card {
  border-radius: 28px;
  overflow: hidden;
  background: #000000;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
}

.video-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.main-video {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
  background: #000000;
}

.play-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  border: 0;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.3), rgba(2, 6, 23, 0.65));
  cursor: pointer;
}

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

.play-overlay span {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, #2563eb, #22d3ee);
  box-shadow: 0 18px 44px rgba(37, 99, 235, 0.38);
  font-size: 34px;
  text-indent: 4px;
}

.video-status {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  z-index: 3;
  display: none;
  padding: 12px 14px;
  border-radius: 14px;
  color: #dbeafe;
  background: rgba(2, 6, 23, 0.72);
}

.video-status.show {
  display: block;
}

.detail-info {
  padding: 12px 10px;
}

.detail-meta {
  margin-top: 24px;
}

.detail-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
}

.prose-card {
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(15, 23, 42, 0.64);
}

.prose-card h2 {
  margin: 0 0 16px;
  font-size: 24px;
}

.prose-card p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.9;
}

.tag-card {
  grid-column: 1 / -1;
}

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

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

.footer-grid {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
  gap: 36px;
}

.footer-grid p,
.footer-grid a,
.footer-bottom {
  color: #94a3b8;
}

.footer-grid p {
  max-width: 540px;
  line-height: 1.75;
}

.footer-grid h2 {
  margin: 0 0 16px;
  color: #f8fafc;
  font-size: 18px;
}

.footer-grid ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.footer-grid li + li {
  margin-top: 10px;
}

.footer-grid a:hover {
  color: #ffffff;
}

.footer-bottom {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 32px;
  border-top: 1px solid var(--line);
}

@media (max-width: 1180px) {
  .desktop-nav {
    gap: 14px;
    font-size: 14px;
  }

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

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

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

  .rank-aside {
    position: static;
  }
}

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

  .menu-toggle {
    display: block;
  }

  .hero-slider {
    min-height: 760px;
  }

  .hero-slide {
    grid-template-columns: 1fr;
    padding: 38px 24px 78px;
  }

  .hero-poster {
    justify-self: start;
    width: min(260px, 78vw);
  }

  .hero-search div,
  .inline-search,
  .compact-hero,
  .section-title {
    flex-direction: column;
    align-items: stretch;
  }

  .category-grid,
  .movie-grid,
  .compact-grid,
  .listing-grid,
  .mini-grid,
  .detail-content,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .rank-card {
    grid-template-columns: 54px 76px minmax(0, 1fr);
    gap: 12px;
  }

  .rank-number {
    width: 46px;
    height: 46px;
    font-size: 18px;
  }

  .rank-poster {
    width: 76px;
    height: 98px;
  }

  .compact-hero,
  .detail-layout,
  .panel-section {
    padding: 24px;
  }
}

@media (max-width: 520px) {
  .nav-wrap,
  .hero,
  .content-section,
  .page-hero,
  .detail-layout,
  .footer-grid,
  .footer-bottom {
    width: min(100% - 22px, 1280px);
  }

  .brand {
    font-size: 18px;
  }

  .hero h1,
  .page-hero h1,
  .detail-info h1 {
    font-size: 34px;
  }

  .hero p,
  .page-hero p,
  .detail-one-line {
    font-size: 16px;
  }
}
