:root {
  color-scheme: dark;
  --bg: #050b12;
  --panel: rgba(10, 20, 30, 0.86);
  --panel-strong: rgba(13, 27, 42, 0.94);
  --text: #f8fafc;
  --muted: #9ca3af;
  --soft: #cbd5e1;
  --line: rgba(148, 163, 184, 0.18);
  --brand: #34d399;
  --brand-strong: #10b981;
  --brand-soft: rgba(16, 185, 129, 0.16);
  --accent: #22d3ee;
  --danger: #fb7185;
  --radius: 22px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 15% 0%, rgba(16, 185, 129, 0.22), transparent 34rem),
    radial-gradient(circle at 88% 8%, rgba(34, 211, 238, 0.14), transparent 28rem),
    linear-gradient(180deg, #07111f 0%, #050b12 42%, #04070d 100%);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

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

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

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

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

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

.brand-icon {
  display: inline-grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 14px;
  color: #03130d;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 14px 38px rgba(16, 185, 129, 0.28);
}

.desktop-nav,
.footer-links,
.hero-quick-links,
.category-strip {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.desktop-nav a,
.mobile-nav a,
.footer-links a,
.hero-quick-links a,
.category-strip a {
  color: var(--soft);
  font-weight: 700;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.desktop-nav a:hover,
.mobile-nav a:hover,
.footer-links a:hover,
.hero-quick-links a:hover,
.category-strip a:hover {
  color: var(--brand);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(255, 255, 255, 0.06);
  font-size: 1.35rem;
}

.mobile-nav {
  display: none;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.96);
}

.mobile-nav.is-open {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.mobile-nav a {
  padding: 12px 14px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.05);
}

.hero-shell,
.page-hero,
.section-block,
.detail-layout,
.site-footer,
.filter-panel,
.player-section {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-shell {
  position: relative;
  padding-top: 28px;
}

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

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(280px, 0.55fr);
  gap: 34px;
  padding: clamp(28px, 6vw, 72px);
  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
  transition: opacity 0.6s ease, transform 0.6s ease, visibility 0.6s ease;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.hero-slide::before {
  position: absolute;
  inset: 0;
  z-index: 0;
  content: "";
  background-image: linear-gradient(90deg, rgba(5, 11, 18, 0.94), rgba(5, 11, 18, 0.64), rgba(5, 11, 18, 0.86)), var(--hero-image);
  background-position: center;
  background-size: cover;
  filter: saturate(1.1);
}

.hero-slide::after {
  position: absolute;
  inset: 0;
  z-index: 1;
  content: "";
  background:
    radial-gradient(circle at 80% 22%, rgba(52, 211, 153, 0.18), transparent 24rem),
    linear-gradient(to top, #050b12 0%, transparent 44%);
}

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

.hero-content {
  align-self: center;
  max-width: 780px;
}

.eyebrow {
  margin: 0 0 12px;
  color: var(--brand);
  font-size: 0.82rem;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-content h1,
.page-hero h1,
.detail-title h1 {
  margin: 0;
  font-size: clamp(2.4rem, 7vw, 5.6rem);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.hero-summary,
.page-hero p,
.section-heading p,
.detail-title p,
.site-footer p {
  color: var(--soft);
  line-height: 1.78;
}

.hero-summary {
  max-width: 680px;
  margin: 24px 0;
  font-size: 1.08rem;
}

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

.hero-tags span,
.tag-row span,
.detail-tags span,
.meta-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 10px;
  border: 1px solid rgba(52, 211, 153, 0.22);
  border-radius: 999px;
  color: #d1fae5;
  background: rgba(16, 185, 129, 0.12);
  font-size: 0.82rem;
  font-weight: 700;
}

.hero-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 26px;
}

.primary-button,
.ghost-button,
.hero-search button,
.filter-buttons button,
.play-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-button,
.hero-search button,
.play-button {
  color: #03130d;
  background: linear-gradient(135deg, var(--brand), var(--accent));
  box-shadow: 0 16px 40px rgba(16, 185, 129, 0.24);
}

.ghost-button,
.filter-buttons button {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
}

.primary-button:hover,
.ghost-button:hover,
.hero-search button:hover,
.filter-buttons button:hover,
.play-button:hover {
  transform: translateY(-2px);
}

.filter-buttons button.is-active,
.filter-buttons button:hover {
  color: #03130d;
  background: var(--brand);
}

.hero-poster {
  align-self: center;
  justify-self: end;
  width: min(360px, 100%);
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 30px;
  background:
    linear-gradient(135deg, rgba(52, 211, 153, 0.24), rgba(34, 211, 238, 0.12)),
    #101827;
  box-shadow: 0 32px 70px rgba(0, 0, 0, 0.42);
}

.hero-poster img,
.poster-wrap img,
.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

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

.hero-dots button.active {
  background: var(--brand);
}

.hero-search-card {
  position: relative;
  z-index: 6;
  width: min(980px, calc(100% - 32px));
  margin: -70px auto 0;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: rgba(15, 23, 42, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.hero-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.hero-search input,
.filter-search input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
  color: var(--text);
  background: rgba(255, 255, 255, 0.08);
  padding: 0 18px;
}

.hero-quick-links {
  margin-top: 12px;
}

.hero-quick-links a,
.category-strip a {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.06);
}

.section-block,
.page-hero,
.detail-layout,
.player-section {
  margin-top: 54px;
}

.page-hero {
  padding: clamp(30px, 6vw, 64px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    radial-gradient(circle at right top, rgba(16, 185, 129, 0.18), transparent 34rem),
    rgba(15, 23, 42, 0.7);
  box-shadow: var(--shadow);
}

.page-hero h1 {
  font-size: clamp(2.2rem, 5vw, 4.2rem);
}

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

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

.section-heading p {
  margin: 8px 0 0;
}

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

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

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(52, 211, 153, 0.42);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.28);
}

.poster-wrap {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background:
    linear-gradient(145deg, rgba(52, 211, 153, 0.24), rgba(34, 211, 238, 0.08)),
    #101827;
}

.poster-wrap::after,
.detail-poster::after,
.player-shell::after {
  position: absolute;
  inset: 0;
  pointer-events: none;
  content: "";
  background: linear-gradient(to top, rgba(0, 0, 0, 0.35), transparent 42%);
}

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  padding: 5px 9px;
  border-radius: 999px;
  color: #04130d;
  background: var(--brand);
  font-size: 0.72rem;
  font-weight: 900;
}

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

.movie-card h3 {
  min-height: 2.7em;
  margin: 0 0 8px;
  font-size: 1rem;
  line-height: 1.35;
}

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

.movie-meta,
.movie-line {
  margin: 0;
  color: var(--muted);
  font-size: 0.85rem;
  line-height: 1.58;
}

.movie-line {
  min-height: 4.7em;
  margin-top: 8px;
}

.tag-row {
  margin-top: 10px;
}

.tag-row span {
  min-height: 24px;
  padding: 4px 8px;
  font-size: 0.72rem;
}

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

.category-card {
  display: grid;
  gap: 10px;
  min-height: 160px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at 80% 10%, rgba(52, 211, 153, 0.16), transparent 12rem),
    rgba(15, 23, 42, 0.78);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(52, 211, 153, 0.38);
}

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

.category-card strong {
  font-size: 1.45rem;
}

.category-card em {
  color: var(--muted);
  font-style: normal;
  line-height: 1.6;
}

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

.filter-search {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

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

.ranking-list {
  display: grid;
  gap: 10px;
  padding: 0;
  margin: 0;
  list-style: none;
}

.ranking-list a {
  display: grid;
  grid-template-columns: 56px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
}

.ranking-list a:hover {
  border-color: rgba(52, 211, 153, 0.38);
  background: rgba(16, 185, 129, 0.08);
}

.rank-number {
  color: var(--brand);
  font-size: 1.2rem;
  font-weight: 900;
}

.rank-title {
  font-weight: 900;
}

.rank-meta {
  color: var(--muted);
  font-size: 0.86rem;
}

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

.detail-poster {
  position: sticky;
  top: 96px;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--line);
  border-radius: 30px;
  background:
    linear-gradient(145deg, rgba(52, 211, 153, 0.22), rgba(34, 211, 238, 0.09)),
    #101827;
  box-shadow: var(--shadow);
}

.detail-title {
  padding: clamp(24px, 5vw, 46px);
  border: 1px solid var(--line);
  border-radius: 30px;
  background: rgba(15, 23, 42, 0.72);
}

.detail-title h1 {
  font-size: clamp(2rem, 5vw, 4.8rem);
}

.detail-copy {
  display: grid;
  gap: 18px;
  margin-top: 22px;
}

.copy-block {
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.62);
}

.copy-block h2 {
  margin: 0 0 12px;
  font-size: 1.3rem;
}

.copy-block p {
  margin: 0;
  color: var(--soft);
  line-height: 1.9;
}

.player-section {
  scroll-margin-top: 90px;
}

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

.player-shell video {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #020617;
}

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  pointer-events: none;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.18), rgba(0, 0, 0, 0.42));
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-shell.is-playing .player-overlay {
  opacity: 0;
  visibility: hidden;
}

.play-button {
  pointer-events: auto;
  min-width: 164px;
  font-size: 1rem;
}

.pagination {
  width: min(1240px, calc(100% - 32px));
  margin: 32px auto 0;
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}

.pagination a {
  display: inline-grid;
  min-width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--soft);
  background: rgba(255, 255, 255, 0.06);
  font-weight: 800;
}

.pagination a.active,
.pagination a:hover {
  color: #03130d;
  background: var(--brand);
}

.site-footer {
  display: flex;
  justify-content: space-between;
  gap: 28px;
  margin-top: 70px;
  padding: 32px 0 44px;
  border-top: 1px solid var(--line);
}

.footer-links {
  align-content: flex-start;
  justify-content: flex-end;
}

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

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

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

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

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

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

  .hero-slide {
    grid-template-columns: 1fr;
    gap: 24px;
    align-content: center;
  }

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

  .hero-dots {
    bottom: 134px;
  }

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

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

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

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

  .detail-poster {
    position: relative;
    top: auto;
    max-width: 320px;
  }

  .ranking-list a {
    grid-template-columns: 48px 1fr;
  }

  .rank-meta {
    grid-column: 2;
  }

  .site-footer {
    display: grid;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .header-inner,
  .hero-shell,
  .page-hero,
  .section-block,
  .detail-layout,
  .site-footer,
  .filter-panel,
  .player-section,
  .pagination {
    width: min(100% - 20px, 1240px);
  }

  .hero-slider {
    min-height: 720px;
    border-radius: 24px;
  }

  .hero-slide {
    padding: 24px;
  }

  .hero-content h1 {
    font-size: 2.55rem;
  }

  .hero-search-card {
    width: calc(100% - 20px);
    border-radius: 20px;
  }

  .movie-grid {
    gap: 12px;
  }

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

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