:root {
  color-scheme: dark;
  --bg: #0a0e1a;
  --bg-soft: #101827;
  --panel: #131827;
  --panel-strong: #172033;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --primary: #0ea5e9;
  --primary-light: #38bdf8;
  --primary-deep: #0369a1;
  --amber: #f59e0b;
  --danger: #f43f5e;
  --radius: 18px;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --glow: 0 0 28px rgba(56, 189, 248, 0.25);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.18), transparent 34rem),
    radial-gradient(circle at 80% 8%, rgba(245, 158, 11, 0.12), transparent 30rem),
    var(--bg);
  color: var(--text);
}

body.menu-open {
  overflow: hidden;
}

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

img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, rgba(14, 165, 233, 0.22), rgba(15, 23, 42, 0.85));
}

button,
input,
select {
  font: inherit;
}

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

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  box-shadow: var(--glow);
  color: #00111f;
}

.brand-text {
  white-space: nowrap;
  font-size: 18px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: auto;
}

.nav-link {
  padding: 9px 12px;
  border-radius: 999px;
  color: var(--muted-strong);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--text);
  background: rgba(56, 189, 248, 0.14);
}

.header-search {
  width: 270px;
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  overflow: hidden;
}

.header-search input {
  width: 100%;
  min-width: 0;
  padding: 10px 14px;
  color: var(--text);
  border: 0;
  outline: 0;
  background: transparent;
}

.header-search button,
.primary-button,
.ghost-button,
.filter-button,
.player-button {
  border: 0;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.header-search button {
  padding: 10px 16px;
  color: white;
  background: var(--primary);
}

.header-search button:hover,
.primary-button:hover,
.player-button:hover {
  transform: translateY(-1px);
  background: var(--primary-deep);
}

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

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: var(--text);
}

.main {
  min-height: 60vh;
}

.container,
.section {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 20px;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 76vh;
  border-bottom: 1px solid var(--line);
}

.hero-track {
  position: relative;
  min-height: 76vh;
}

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

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

.hero-bg {
  position: absolute;
  inset: 0;
}

.hero-bg img {
  filter: saturate(1.15);
  transform: scale(1.03);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(10, 14, 26, 0.96) 0%, rgba(10, 14, 26, 0.76) 46%, rgba(10, 14, 26, 0.28) 100%),
    linear-gradient(0deg, var(--bg) 0%, rgba(10, 14, 26, 0.1) 45%, rgba(10, 14, 26, 0.45) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  min-height: 76vh;
  padding: 110px 20px 86px;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) minmax(280px, 0.7fr);
  align-items: center;
  gap: 52px;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px 12px;
  border: 1px solid rgba(56, 189, 248, 0.36);
  border-radius: 999px;
  color: var(--primary-light);
  background: rgba(2, 132, 199, 0.14);
  font-size: 14px;
}

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

.hero-copy p {
  max-width: 720px;
  margin: 22px 0 0;
  color: var(--muted-strong);
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.8;
}

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

.primary-button,
.ghost-button,
.filter-button,
.player-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 700;
}

.primary-button,
.player-button {
  color: white;
  background: var(--primary);
  box-shadow: var(--glow);
}

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

.ghost-button:hover,
.filter-button:hover,
.filter-button.active {
  color: var(--primary-light);
  border-color: rgba(56, 189, 248, 0.4);
  background: rgba(14, 165, 233, 0.14);
}

.hero-side {
  display: grid;
  gap: 16px;
}

.hero-poster {
  position: relative;
  overflow: hidden;
  min-height: 480px;
  border: 1px solid rgba(56, 189, 248, 0.26);
  border-radius: 28px;
  box-shadow: var(--shadow), var(--glow);
}

.hero-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(10, 14, 26, 0.82), transparent 50%);
}

.hero-poster span {
  position: absolute;
  left: 22px;
  right: 22px;
  bottom: 22px;
  z-index: 2;
  color: white;
  font-weight: 800;
  font-size: 24px;
}

.hero-mini-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}

.hero-mini-grid a {
  overflow: hidden;
  height: 96px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
}

.hero-controls {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 26px;
  width: min(1240px, calc(100% - 40px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.hero-arrows,
.hero-dots {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.hero-arrow,
.hero-dot {
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  cursor: pointer;
}

.hero-arrow {
  width: 42px;
  height: 42px;
  border-radius: 50%;
}

.hero-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  border-radius: 50%;
}

.hero-dot.active {
  width: 28px;
  border-color: var(--primary-light);
  background: var(--primary-light);
}

.section {
  padding-top: 64px;
  padding-bottom: 20px;
}

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

.section-heading h2,
.category-panel h2,
.search-panel h2,
.detail-section h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  letter-spacing: -0.03em;
}

.section-heading p,
.page-hero p,
.category-panel p,
.search-panel p,
.detail-section p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(19, 24, 39, 0.88);
  box-shadow: 0 10px 38px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(56, 189, 248, 0.42);
  box-shadow: var(--shadow), var(--glow);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--panel-strong);
}

.poster-link img {
  transition: transform 0.35s ease, opacity 0.35s ease;
}

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

.poster-badge,
.poster-play {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.poster-badge {
  top: 12px;
  left: 12px;
  padding: 5px 9px;
  color: #00111f;
  background: var(--primary-light);
}

.poster-play {
  right: 12px;
  bottom: 12px;
  padding: 7px 12px;
  color: white;
  background: rgba(14, 165, 233, 0.9);
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .poster-play {
  opacity: 1;
  transform: translateY(0);
}

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

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

.movie-meta-line a,
.breadcrumb a {
  color: var(--primary-light);
}

.movie-card h3,
.rank-content h2 {
  margin: 9px 0 8px;
  color: white;
  font-size: 18px;
  line-height: 1.35;
}

.movie-card h3 a:hover,
.rank-content h2 a:hover,
.compact-card:hover strong {
  color: var(--primary-light);
}

.movie-card p {
  display: -webkit-box;
  min-height: 3.1em;
  margin: 0;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  color: var(--muted-strong);
  line-height: 1.55;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.tag-row span,
.info-pill {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(15, 23, 42, 0.72);
  font-size: 12px;
}

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

.category-tile {
  position: relative;
  min-height: 180px;
  padding: 22px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.18), transparent 9rem),
    rgba(19, 24, 39, 0.88);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(56, 189, 248, 0.4);
}

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

.category-tile p {
  margin: 0;
  color: var(--muted-strong);
  line-height: 1.65;
}

.category-tile span {
  position: absolute;
  right: 18px;
  bottom: 16px;
  color: var(--primary-light);
  font-weight: 800;
}

.page-hero {
  max-width: 1280px;
  margin: 0 auto;
  padding: 80px 20px 30px;
}

.page-hero-card,
.category-panel,
.search-panel,
.detail-card,
.player-card {
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.16), transparent 24rem),
    rgba(19, 24, 39, 0.82);
  box-shadow: var(--shadow);
}

.page-hero-card {
  padding: clamp(26px, 5vw, 54px);
}

.filter-bar,
.search-tools {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
  margin: 20px 0 26px;
}

.search-tools input,
.search-tools select {
  min-height: 46px;
  padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: 0;
  color: var(--text);
  background: rgba(10, 14, 26, 0.74);
}

.search-tools input {
  min-width: min(420px, 100%);
}

.category-panel,
.search-panel {
  padding: 24px;
  margin-bottom: 24px;
}

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

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

.rank-number {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 18px;
  color: #00111f;
  background: linear-gradient(135deg, var(--primary), var(--primary-light));
  font-weight: 900;
}

.rank-thumb {
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 14px;
}

.rank-content p {
  margin: 0 0 12px;
  color: var(--muted-strong);
  line-height: 1.7;
}

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

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 24px;
}

.detail-title {
  max-width: 1280px;
  margin: 0 auto;
  padding: 54px 20px 24px;
}

.detail-title p {
  max-width: 860px;
  color: var(--muted-strong);
  font-size: 18px;
  line-height: 1.8;
}

.player-card {
  overflow: hidden;
}

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

.movie-video {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  background: #000;
}

.video-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.08));
  cursor: pointer;
  z-index: 3;
}

.player-shell.is-playing .video-overlay {
  display: none;
}

.player-button {
  min-width: 128px;
  min-height: 54px;
  font-size: 18px;
}

.detail-card {
  padding: 26px;
  margin-top: 24px;
}

.detail-section + .detail-section {
  margin-top: 24px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.detail-section p {
  color: var(--muted-strong);
  font-size: 17px;
}

.detail-info {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.sidebar {
  display: grid;
  gap: 18px;
  align-content: start;
}

.sidebar-box {
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(19, 24, 39, 0.86);
}

.sidebar-box h2 {
  margin: 0 0 16px;
  font-size: 20px;
}

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

.compact-card {
  display: grid;
  grid-template-columns: 68px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
}

.compact-card img {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 12px;
}

.compact-card strong {
  display: block;
  color: white;
  line-height: 1.35;
}

.compact-card em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  line-height: 1.45;
}

.no-results {
  display: none;
  padding: 30px;
  text-align: center;
  color: var(--muted-strong);
  border: 1px dashed var(--line);
  border-radius: 20px;
}

.no-results.show {
  display: block;
}

.site-footer {
  margin-top: 70px;
  border-top: 1px solid var(--line);
  background: rgba(7, 10, 18, 0.72);
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 40px 20px;
  display: grid;
  grid-template-columns: 1.8fr 1fr 1fr;
  gap: 26px;
}

.footer-inner p,
.footer-inner a {
  color: var(--muted-strong);
  line-height: 1.8;
}

.footer-inner h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.footer-inner a {
  display: block;
  margin: 7px 0;
}

.footer-inner a:hover {
  color: var(--primary-light);
}

.copyright {
  padding: 16px 20px;
  text-align: center;
  color: var(--muted);
  border-top: 1px solid var(--line);
}

.back-top {
  position: fixed;
  right: 20px;
  bottom: 20px;
  width: 44px;
  height: 44px;
  display: none;
  border: 1px solid var(--line);
  border-radius: 50%;
  color: white;
  background: rgba(14, 165, 233, 0.9);
  cursor: pointer;
  z-index: 30;
}

.back-top.show {
  display: block;
}

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

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

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

@media (max-width: 900px) {
  .header-inner {
    gap: 12px;
  }

  .main-nav {
    position: fixed;
    inset: 66px 16px auto;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(10, 14, 26, 0.96);
    box-shadow: var(--shadow);
  }

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

  .header-search {
    margin-left: auto;
    width: min(230px, 42vw);
  }

  .menu-toggle {
    display: block;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 28px;
    padding-top: 92px;
  }

  .hero-poster {
    min-height: 340px;
  }

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

  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 640px) {
  .brand-text {
    font-size: 15px;
  }

  .header-search {
    display: none;
  }

  .hero,
  .hero-track,
  .hero-content {
    min-height: 86vh;
  }

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

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

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

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

  .rank-item {
    grid-template-columns: 48px 78px minmax(0, 1fr);
    gap: 12px;
  }

  .rank-number {
    width: 42px;
    height: 42px;
    border-radius: 14px;
  }

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

  .compact-card {
    grid-template-columns: 58px minmax(0, 1fr);
  }
}
