:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --card: rgba(15, 23, 42, 0.82);
  --card-strong: rgba(15, 23, 42, 0.95);
  --line: rgba(148, 163, 184, 0.2);
  --text: #f8fafc;
  --muted: #94a3b8;
  --blue: #38bdf8;
  --cyan: #67e8f9;
  --gold: #facc15;
  --red: #fb7185;
  --green: #34d399;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  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(14, 165, 233, 0.18), transparent 36rem),
    radial-gradient(circle at top right, rgba(6, 182, 212, 0.12), transparent 30rem),
    linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
  color: var(--text);
  min-height: 100vh;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  backdrop-filter: blur(18px);
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 64, 175, 0.86), rgba(15, 23, 42, 0.96));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 28px rgba(2, 6, 23, 0.4);
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 900;
  white-space: nowrap;
  letter-spacing: -0.04em;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 36px;
  height: 36px;
  border-radius: 14px;
  color: #082f49;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 14px 36px rgba(56, 189, 248, 0.32);
}

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

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

.nav-link:hover,
.nav-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.1);
}

.search-box {
  margin-left: auto;
  position: relative;
  display: flex;
  align-items: center;
  width: min(360px, 32vw);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid rgba(148, 163, 184, 0.24);
}

.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 12px 96px 12px 18px;
  color: white;
  background: transparent;
}

.search-box button {
  position: absolute;
  right: 4px;
  top: 4px;
  bottom: 4px;
  border: 0;
  border-radius: 999px;
  padding: 0 18px;
  color: #082f49;
  font-weight: 800;
  cursor: pointer;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
}

.search-panel {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 10px);
  background: rgba(15, 23, 42, 0.98);
  border: 1px solid var(--line);
  border-radius: 20px;
  box-shadow: var(--shadow);
  padding: 8px;
  display: none;
  max-height: 420px;
  overflow: auto;
}

.search-panel.open {
  display: block;
}

.search-panel a {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border-radius: 14px;
}

.search-panel a:hover {
  background: rgba(56, 189, 248, 0.12);
}

.search-panel small {
  color: var(--muted);
}

.menu-toggle {
  display: none;
  border: 1px solid var(--line);
  color: white;
  border-radius: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
}

.mobile-nav {
  display: none;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 14px;
  flex-wrap: wrap;
  gap: 8px;
}

.mobile-nav a {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #dbeafe;
}

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

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

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.06) contrast(1.05);
}

.hero-layer {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.72) 44%, rgba(2, 6, 23, 0.2) 100%),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0) 40%);
}

.hero-content {
  position: absolute;
  left: max(6vw, 24px);
  bottom: 12vh;
  width: min(720px, calc(100% - 48px));
}

.eyebrow {
  color: var(--cyan);
  margin: 0 0 12px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-content h1,
.page-hero h1,
.detail-info h1 {
  margin: 0;
  font-size: clamp(40px, 7vw, 84px);
  line-height: 0.96;
  letter-spacing: -0.07em;
}

.hero-text,
.page-hero p,
.detail-lead {
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1.8;
}

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

.hero-tags span,
.tag-row span,
.detail-meta span {
  border: 1px solid rgba(103, 232, 249, 0.24);
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.58);
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 13px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  padding: 13px 22px;
  font-weight: 900;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  color: #082f49;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 18px 42px rgba(56, 189, 248, 0.26);
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
}

.btn.plain {
  color: var(--cyan);
  padding-left: 0;
}

.hero-control {
  position: absolute;
  right: max(6vw, 24px);
  bottom: 8vh;
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-control button {
  cursor: pointer;
}

.hero-control > button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: white;
  font-size: 28px;
  background: rgba(15, 23, 42, 0.62);
}

.hero-dots {
  display: flex;
  gap: 7px;
}

.hero-dot {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 99px;
  padding: 0;
  background: rgba(255, 255, 255, 0.36);
}

.hero-dot.active {
  width: 28px;
  background: var(--cyan);
}

.quick-categories {
  width: min(1240px, calc(100% - 32px));
  margin: -48px auto 24px;
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 12px;
}

.category-tile,
.category-showcase-grid a,
.category-overview-card,
.detail-block,
.ranking-row {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.94), rgba(30, 41, 59, 0.72));
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.2);
}

.category-tile {
  min-height: 118px;
  border-radius: 24px;
  padding: 18px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile:hover,
.movie-card:hover,
.category-showcase-grid a:hover,
.category-overview-card:hover {
  transform: translateY(-4px);
  border-color: rgba(103, 232, 249, 0.48);
}

.category-tile span {
  font-size: 20px;
  font-weight: 900;
}

.category-tile small,
.category-showcase-grid span {
  color: var(--muted);
  line-height: 1.6;
}

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

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

.section-title h2,
.detail-block h2,
.category-overview-card h2,
.ranking-row h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  letter-spacing: -0.04em;
}

.section-title p,
.detail-block p,
.category-overview-card p,
.ranking-row p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

.section-more,
.text-link {
  color: var(--cyan);
  font-weight: 900;
}

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

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

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

.poster-wrap {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #1e293b, #020617);
}

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

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

.poster-shine {
  position: absolute;
  inset: auto 0 0;
  height: 52%;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.92), transparent);
}

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

.movie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 800;
}

.movie-card h3 {
  margin: 10px 0 8px;
  font-size: 20px;
  line-height: 1.28;
}

.small-card h3 {
  font-size: 17px;
}

.movie-card p {
  color: var(--muted);
  margin: 0 0 12px;
  font-size: 14px;
  line-height: 1.65;
}

.tag-row span {
  font-size: 12px;
  padding: 4px 8px;
}

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

.rank-no {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 3;
  width: 34px;
  height: 34px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #082f49;
  background: linear-gradient(135deg, var(--gold), #fef3c7);
  box-shadow: 0 10px 24px rgba(250, 204, 21, 0.28);
}

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

.category-showcase-grid a {
  min-height: 134px;
  border-radius: 24px;
  padding: 18px;
  display: grid;
  align-content: space-between;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-showcase-grid strong {
  font-size: 20px;
}

.page-hero {
  width: min(1240px, calc(100% - 32px));
  margin: 42px auto 0;
  border: 1px solid var(--line);
  border-radius: 32px;
  padding: clamp(32px, 5vw, 68px);
  background:
    radial-gradient(circle at top right, rgba(56, 189, 248, 0.2), transparent 28rem),
    linear-gradient(145deg, rgba(15, 23, 42, 0.96), rgba(30, 64, 175, 0.42));
  box-shadow: var(--shadow);
}

.small-page-hero h1 {
  font-size: clamp(36px, 5vw, 64px);
}

.page-filter {
  margin-top: 28px;
  display: flex;
  gap: 12px;
  max-width: 760px;
}

.page-filter input,
.page-filter select {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 14px 16px;
  color: white;
  background: rgba(2, 6, 23, 0.68);
  outline: 0;
}

.page-filter input {
  flex: 1;
}

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

.category-overview-card {
  border-radius: 28px;
  overflow: hidden;
  display: grid;
  grid-template-columns: 42% 1fr;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-cover-row {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  min-height: 240px;
  background: #020617;
}

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

.category-overview-card > div {
  padding: 26px;
}

.breadcrumb {
  width: min(1240px, calc(100% - 32px));
  margin: 28px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  color: var(--muted);
}

.breadcrumb a {
  color: #dbeafe;
}

.detail-hero {
  width: min(1240px, calc(100% - 32px));
  margin: 28px auto 48px;
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: clamp(28px, 5vw, 72px);
  align-items: center;
}

.detail-poster {
  border-radius: 32px;
  overflow: hidden;
  border: 1px solid var(--line);
  box-shadow: var(--shadow);
  background: #020617;
}

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

.detail-info h1 {
  font-size: clamp(36px, 5.6vw, 72px);
}

.detail-meta {
  margin: 18px 0;
}

.detail-tags {
  margin-bottom: 26px;
}

.player-section {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto 52px;
}

.player-shell {
  position: relative;
  border-radius: 30px;
  overflow: hidden;
  background: black;
  border: 1px solid rgba(148, 163, 184, 0.24);
  box-shadow: var(--shadow);
}

.site-video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: black;
  cursor: pointer;
}

.player-start {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  color: white;
  cursor: pointer;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.38), rgba(2, 6, 23, 0.82));
}

.player-start span {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 50%;
  color: #082f49;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 24px 54px rgba(56, 189, 248, 0.32);
  font-size: 34px;
  padding-left: 5px;
}

.player-start.is-hidden {
  display: none;
}

.detail-block {
  width: min(980px, calc(100% - 32px));
  margin: 28px auto;
  border-radius: 28px;
  padding: clamp(24px, 4vw, 44px);
}

.related-section {
  margin-top: 48px;
}

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

.ranking-row {
  border-radius: 24px;
  padding: 14px;
  display: grid;
  grid-template-columns: 88px 46px 1fr auto;
  gap: 18px;
  align-items: center;
}

.ranking-poster {
  border-radius: 16px;
  overflow: hidden;
  background: #020617;
}

.ranking-poster img {
  width: 88px;
  height: 124px;
  object-fit: cover;
}

.ranking-row b {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #082f49;
  background: linear-gradient(135deg, var(--gold), #fef3c7);
}

.ranking-row h2 {
  font-size: 22px;
}

.search-results {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 18px;
}

.search-result-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  padding: 18px;
  background: var(--card);
}

.search-result-card h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.search-result-card p,
.search-result-card span {
  color: var(--muted);
  line-height: 1.7;
}

.site-footer {
  width: min(1240px, calc(100% - 32px));
  margin: 90px auto 30px;
  border-top: 1px solid var(--line);
  padding-top: 30px;
  color: var(--muted);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
}

.footer-grid strong,
.footer-grid h2 {
  color: white;
  font-size: 20px;
  margin: 0 0 10px;
}

.footer-grid p {
  line-height: 1.8;
}

.footer-grid a {
  margin-right: 16px;
  color: #dbeafe;
}

.footer-bottom {
  margin-top: 28px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

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

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

  .search-box {
    width: min(440px, 46vw);
  }

  .menu-toggle {
    display: inline-flex;
  }

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

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

  .movie-grid,
  .compact-grid,
  .rank-list,
  .search-results {
    grid-template-columns: repeat(3, 1fr);
  }

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

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

  .logo {
    font-size: 20px;
  }

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

  .hero-carousel {
    min-height: 620px;
    height: 78vh;
  }

  .hero-layer {
    background: linear-gradient(0deg, rgba(2, 6, 23, 0.98) 0%, rgba(2, 6, 23, 0.56) 100%);
  }

  .hero-content {
    bottom: 110px;
  }

  .hero-control {
    left: 24px;
    right: auto;
    bottom: 42px;
  }

  .quick-categories,
  .movie-grid,
  .compact-grid,
  .rank-list,
  .category-showcase-grid,
  .search-results {
    grid-template-columns: repeat(2, 1fr);
  }

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

  .page-filter {
    flex-direction: column;
  }

  .category-overview-card,
  .detail-hero {
    grid-template-columns: 1fr;
  }

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

  .ranking-row {
    grid-template-columns: 72px 34px 1fr;
  }

  .ranking-row .text-link {
    grid-column: 3;
  }

  .ranking-poster img {
    width: 72px;
    height: 104px;
  }

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

@media (max-width: 480px) {
  .quick-categories,
  .movie-grid,
  .compact-grid,
  .rank-list,
  .category-showcase-grid,
  .search-results {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

  .btn {
    width: 100%;
  }
}
