:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.82);
  --bg-card-strong: rgba(15, 23, 42, 0.96);
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.18);
  --accent: #10b981;
  --accent-strong: #34d399;
  --accent-soft: rgba(16, 185, 129, 0.16);
  --danger: #f97316;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.38);
  --radius: 22px;
  --container: 1180px;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  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(16, 185, 129, 0.18), transparent 32rem),
    linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 100%);
}

body.menu-open {
  overflow: hidden;
}

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

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

button,
input,
select {
  font: inherit;
}

.container {
  width: min(100% - 32px, var(--container));
  margin: 0 auto;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 80;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.18));
  transition: background 0.25s ease, box-shadow 0.25s ease, backdrop-filter 0.25s ease;
}

.site-header.is-scrolled,
body.menu-open .site-header {
  background: rgba(2, 6, 23, 0.92);
  backdrop-filter: blur(16px);
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.24);
}

.nav {
  min-height: 76px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #06251c;
  background: linear-gradient(135deg, var(--accent-strong), #a7f3d0);
  box-shadow: 0 18px 40px rgba(16, 185, 129, 0.22);
}

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

.nav-link,
.nav-drop-button {
  border: 0;
  color: #e2e8f0;
  background: transparent;
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.nav-drop-button:hover {
  color: var(--accent-strong);
  background: rgba(15, 23, 42, 0.72);
}

.nav-dropdown {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% + 12px);
  right: 0;
  width: 180px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

.nav-dropdown:hover .dropdown-panel,
.nav-dropdown:focus-within .dropdown-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.dropdown-link {
  display: block;
  padding: 10px 12px;
  border-radius: 12px;
  color: #cbd5e1;
}

.dropdown-link:hover {
  background: var(--accent-soft);
  color: var(--accent-strong);
}

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

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: #f8fafc;
  border-radius: 999px;
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.hero {
  position: relative;
  min-height: 86vh;
  overflow: hidden;
  background: #020617;
}

.hero-stage,
.hero-slide,
.hero-slide img,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-slide {
  opacity: 0;
  transition: opacity 0.9s ease;
}

.hero-slide.active {
  opacity: 1;
  z-index: 2;
}

.hero-slide img {
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.62), rgba(2, 6, 23, 0.12)),
    linear-gradient(180deg, rgba(2, 6, 23, 0.06), rgba(2, 6, 23, 0.94));
}

.hero-content {
  position: relative;
  height: 100%;
  display: flex;
  align-items: center;
  padding-top: 96px;
}

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

.hero-tags,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hero-tags span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(52, 211, 153, 0.25);
  border-radius: 999px;
  color: #a7f3d0;
  background: rgba(16, 185, 129, 0.12);
  font-size: 13px;
  font-weight: 700;
}

.hero h1 {
  margin: 22px 0 18px;
  font-size: clamp(42px, 8vw, 78px);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.hero p,
.page-hero p,
.side-panel p,
.story-card p,
.category-card-body p,
.site-footer p {
  color: var(--muted);
  line-height: 1.78;
}

.hero p {
  max-width: 660px;
  font-size: clamp(17px, 2vw, 22px);
}

.hero-actions,
.page-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.primary-button,
.ghost-button,
.text-button,
.hero-search button,
.global-search button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  font-weight: 900;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.primary-button,
.hero-search button,
.global-search button {
  min-height: 48px;
  padding: 0 22px;
  color: #052e24;
  background: linear-gradient(135deg, var(--accent-strong), #a7f3d0);
  box-shadow: 0 18px 45px rgba(16, 185, 129, 0.24);
}

.ghost-button {
  min-height: 48px;
  padding: 0 22px;
  color: #e2e8f0;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.64);
}

.primary-button:hover,
.ghost-button:hover,
.text-button:hover,
.hero-search button:hover,
.global-search button:hover {
  transform: translateY(-2px);
}

.hero-controls {
  position: absolute;
  left: 50%;
  bottom: 90px;
  z-index: 6;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.hero-controls button {
  pointer-events: auto;
}

.hero-controls > button {
  width: 44px;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.62);
  font-size: 30px;
  cursor: pointer;
}

.hero-dots {
  display: flex;
  gap: 8px;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.56);
  backdrop-filter: blur(10px);
}

.hero-dots button {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: #64748b;
  cursor: pointer;
}

.hero-dots button.active {
  width: 30px;
  background: var(--accent-strong);
}

.hero-search {
  position: absolute;
  left: 50%;
  bottom: 24px;
  z-index: 7;
  width: min(calc(100% - 32px), 760px);
  transform: translateX(-50%);
  display: flex;
  gap: 10px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.76);
  backdrop-filter: blur(18px);
}

.hero-search input,
.global-search input,
.search-box input,
.filter-selects select {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  color: var(--text);
  background: rgba(15, 23, 42, 0.82);
}

.hero-search input,
.global-search input {
  min-height: 48px;
  padding: 0 18px;
  border-radius: 999px;
}

.section {
  padding: 72px 0 0;
}

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

.eyebrow {
  margin: 0 0 9px;
  color: var(--accent-strong);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.section-heading h2,
.page-hero h1,
.side-panel h2,
.story-card h2,
.category-card-body h2 {
  margin: 0;
  letter-spacing: -0.04em;
}

.section-heading h2,
.page-hero h1 {
  font-size: clamp(32px, 4vw, 52px);
}

.section-link,
.text-button {
  color: var(--accent-strong);
  font-weight: 900;
}

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

.category-tile,
.category-card,
.movie-card,
.side-panel,
.story-card,
.filter-panel,
.global-search,
.player-frame,
.detail-meta {
  border: 1px solid var(--line);
  background: var(--bg-card);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.22);
  backdrop-filter: blur(16px);
}

.category-tile {
  min-height: 128px;
  padding: 20px;
  border-radius: var(--radius);
  overflow: hidden;
  position: relative;
}

.category-tile::after {
  content: "";
  position: absolute;
  width: 80px;
  height: 80px;
  right: -20px;
  bottom: -20px;
  border-radius: 999px;
  background: var(--accent-soft);
}

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

.category-tile em {
  display: block;
  color: var(--muted);
  font-style: normal;
  line-height: 1.62;
}

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

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

.movie-card {
  overflow: hidden;
  border-radius: var(--radius);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(52, 211, 153, 0.42);
  background: var(--bg-card-strong);
}

.card-cover {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #0f172a;
}

.card-cover img {
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.movie-card:hover .card-cover img {
  transform: scale(1.05);
}

.card-cover::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.88));
}

.score-badge,
.type-badge,
.rank-badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.score-badge {
  right: 10px;
  top: 10px;
  min-width: 42px;
  height: 28px;
  color: #052e24;
  background: var(--accent-strong);
}

.type-badge {
  left: 10px;
  bottom: 10px;
  padding: 6px 10px;
  color: #e2e8f0;
  background: rgba(2, 6, 23, 0.72);
}

.rank-badge {
  left: 10px;
  top: 10px;
  width: 34px;
  height: 34px;
  color: #052e24;
  background: linear-gradient(135deg, #fde68a, #f97316);
}

.card-body {
  padding: 16px;
}

.card-meta {
  display: flex;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--muted);
  font-size: 12px;
}

.card-body h2 {
  margin: 0 0 10px;
  font-size: 18px;
  line-height: 1.28;
}

.card-body h2 a:hover {
  color: var(--accent-strong);
}

.card-body p {
  min-height: 62px;
  margin: 0 0 14px;
  color: #a8b3c7;
  font-size: 14px;
  line-height: 1.58;
}

.compact .card-body p {
  min-height: 0;
}

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

.rank-panel {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
}

.side-panel,
.story-card {
  border-radius: var(--radius);
  padding: 28px;
}

.page-main {
  padding-top: 96px;
}

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

.page-hero p {
  max-width: 760px;
  font-size: 18px;
}

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

.category-card {
  overflow: hidden;
  border-radius: var(--radius);
}

.category-card-cover {
  display: block;
  height: 190px;
  overflow: hidden;
}

.category-card-cover img {
  height: 100%;
  object-fit: cover;
}

.category-card-body {
  padding: 22px;
}

.category-card-body h2 {
  font-size: 26px;
}

.category-card-body ul,
.site-footer ul {
  list-style: none;
  padding: 0;
  margin: 18px 0;
}

.category-card-body li,
.site-footer li {
  margin: 8px 0;
  color: #cbd5e1;
}

.category-card-body a:hover,
.site-footer a:hover {
  color: var(--accent-strong);
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 16px;
  align-items: end;
  margin-bottom: 24px;
  padding: 16px;
  border-radius: var(--radius);
}

.search-box span {
  display: block;
  margin-bottom: 8px;
  color: var(--muted);
  font-weight: 800;
}

.search-box input,
.filter-selects select {
  min-height: 46px;
  padding: 0 14px;
  border-radius: 14px;
}

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

.empty-state {
  margin: 30px 0;
  color: var(--muted);
  font-weight: 800;
  text-align: center;
}

.global-search {
  display: flex;
  gap: 10px;
  max-width: 760px;
  padding: 10px;
  border-radius: 999px;
}

.detail-main {
  background: #020617;
}

.detail-hero {
  position: relative;
  min-height: 720px;
  overflow: hidden;
  padding-top: 96px;
}

.detail-backdrop,
.detail-shade {
  position: absolute;
  inset: 0;
}

.detail-backdrop {
  height: 100%;
  object-fit: cover;
  opacity: 0.34;
  filter: blur(2px);
}

.detail-shade {
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.38)),
    linear-gradient(180deg, rgba(2, 6, 23, 0.16), #020617 92%);
}

.detail-intro {
  position: relative;
  z-index: 3;
  padding-top: 36px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 28px;
  color: #cbd5e1;
}

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

.detail-layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 42px;
  align-items: center;
}

.detail-poster {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  box-shadow: var(--shadow);
}

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

.detail-poster span {
  position: absolute;
  left: 20px;
  bottom: 20px;
  padding: 10px 18px;
  border-radius: 999px;
  color: #052e24;
  background: var(--accent-strong);
  font-weight: 900;
}

.detail-copy h1 {
  margin: 20px 0 16px;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.detail-one-line {
  max-width: 780px;
  color: #cbd5e1;
  font-size: 20px;
  line-height: 1.74;
}

.detail-meta {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  max-width: 840px;
  margin: 28px 0 0;
  overflow: hidden;
  border-radius: var(--radius);
}

.detail-meta div {
  padding: 16px;
  background: rgba(15, 23, 42, 0.62);
}

.detail-meta dt {
  margin-bottom: 8px;
  color: var(--muted);
  font-size: 13px;
}

.detail-meta dd {
  margin: 0;
  color: var(--text);
  font-weight: 900;
}

.player-frame {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  background: #000;
  aspect-ratio: 16 / 9;
}

.movie-video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

.player-start {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 0;
  color: #f8fafc;
  background: radial-gradient(circle, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.78));
  cursor: pointer;
}

.player-frame.is-playing .player-start {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.play-symbol {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #052e24;
  background: var(--accent-strong);
  box-shadow: 0 20px 60px rgba(16, 185, 129, 0.32);
  font-size: 30px;
}

.detail-content {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 20px;
}

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

.site-footer {
  margin-top: 86px;
  padding: 54px 0 0;
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.64);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.1fr;
  gap: 34px;
}

.site-footer h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.footer-bottom {
  margin-top: 32px;
  padding: 18px;
  border-top: 1px solid var(--line);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1100px) {
  .movie-grid,
  .wide-grid,
  .related-grid {
    grid-template-columns: repeat(4, 1fr);
  }

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

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

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

@media (max-width: 820px) {
  .menu-toggle {
    display: block;
  }

  .nav-links {
    position: fixed;
    top: 76px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 18px;
    border: 1px solid var(--line);
    border-radius: 22px;
    background: rgba(2, 6, 23, 0.96);
    box-shadow: var(--shadow);
  }

  body.menu-open .nav-links {
    display: flex;
  }

  .nav-dropdown,
  .nav-drop-button {
    display: none;
  }

  .hero {
    min-height: 760px;
  }

  .hero-controls {
    bottom: 116px;
  }

  .hero-search,
  .global-search {
    border-radius: 22px;
    flex-direction: column;
  }

  .hero-search button,
  .global-search button {
    width: 100%;
  }

  .section-heading,
  .filter-panel {
    display: block;
  }

  .filter-selects {
    margin-top: 14px;
    flex-direction: column;
  }

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

  .category-grid,
  .rank-panel,
  .category-card-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .detail-hero {
    min-height: auto;
    padding-bottom: 48px;
  }

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

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

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

@media (max-width: 520px) {
  .container {
    width: min(100% - 22px, var(--container));
  }

  .brand,
  .footer-brand {
    font-size: 23px;
  }

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

  .hero-controls > button {
    display: none;
  }

  .movie-grid,
  .wide-grid,
  .related-grid {
    gap: 12px;
  }

  .card-body {
    padding: 12px;
  }

  .card-body h2 {
    font-size: 16px;
  }

  .card-body p {
    display: none;
  }

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