:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-strong: rgba(15, 23, 42, 0.94);
  --line: rgba(59, 130, 246, 0.28);
  --line-bright: rgba(6, 182, 212, 0.55);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --cyan: #22d3ee;
  --cyan-strong: #06b6d4;
  --blue: #2563eb;
  --orange: #f97316;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.18), transparent 34rem),
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.22), transparent 30rem),
    linear-gradient(180deg, #020617 0%, #0b1f4d 48%, #020617 100%);
  color: var(--text);
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  border-bottom: 1px solid rgba(59, 130, 246, 0.28);
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 64, 175, 0.86), rgba(15, 23, 42, 0.96));
  backdrop-filter: blur(18px);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--cyan-strong), var(--blue));
  box-shadow: 0 0 26px rgba(34, 211, 238, 0.35);
  color: white;
  font-size: 18px;
}

.brand-name {
  display: block;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-subtitle {
  display: block;
  color: var(--cyan);
  font-size: 12px;
}

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

.nav-link {
  color: #cbd5e1;
  font-weight: 600;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--cyan);
}

.nav-link:hover {
  transform: translateY(-1px);
}

.header-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search input,
.mobile-search input,
.search-page-form input,
.filter-input,
.filter-select {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input {
  width: 250px;
  padding: 10px 16px;
}

.header-search button,
.mobile-search button,
.search-page-form button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--cyan-strong);
  color: white;
  cursor: pointer;
}

.header-search input:focus,
.mobile-search input:focus,
.search-page-form input:focus,
.filter-input:focus,
.filter-select:focus {
  border-color: var(--line-bright);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.15);
}

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

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: white;
  border-radius: 999px;
}

.mobile-panel {
  display: none;
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.96);
}

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

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

.mobile-search {
  display: flex;
  gap: 8px;
  padding: 16px 0 8px;
}

.mobile-search input {
  flex: 1;
  padding: 12px 16px;
}

.mobile-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
  padding: 8px 0 18px;
}

.mobile-link {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.76);
  color: #cbd5e1;
}

.hero {
  position: relative;
  height: min(80vh, 760px);
  min-height: 560px;
  overflow: hidden;
}

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

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

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.32;
  transform: scale(1.03);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.62), rgba(2, 6, 23, 0.35)),
    linear-gradient(0deg, #020617 0%, transparent 48%, rgba(2, 6, 23, 0.48) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1280px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 760px;
  margin-left: max(16px, calc((100% - 1280px) / 2));
}

.hero-kicker,
.section-kicker {
  color: var(--cyan);
  text-transform: uppercase;
  letter-spacing: 0.16em;
  font-size: 12px;
  font-weight: 800;
}

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

.hero h2 {
  margin: 14px 0 0;
  font-size: clamp(24px, 3vw, 42px);
  color: var(--cyan);
}

.hero p {
  max-width: 680px;
  margin: 22px 0 0;
  color: #cbd5e1;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.8;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(34, 211, 238, 0.24);
  border-radius: 999px;
  padding: 6px 10px;
  background: rgba(8, 145, 178, 0.13);
  color: #cffafe;
  font-size: 12px;
}

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

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

.primary-button,
.ghost-button,
.text-button,
.section-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.primary-button {
  min-height: 46px;
  padding: 0 22px;
  background: linear-gradient(90deg, var(--cyan-strong), var(--blue));
  color: white;
  box-shadow: 0 18px 36px rgba(8, 145, 178, 0.28);
}

.ghost-button {
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.7);
  color: #dbeafe;
}

.primary-button:hover,
.ghost-button:hover,
.text-button:hover,
.section-link:hover {
  transform: translateY(-2px);
}

.ghost-button:hover {
  border-color: var(--line-bright);
}

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

.hero-dot {
  width: 34px;
  height: 4px;
  border: 0;
  border-radius: 99px;
  background: rgba(148, 163, 184, 0.48);
  cursor: pointer;
}

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

.content-section,
.detail-wrap,
.footer-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.content-section {
  padding: 64px 0;
}

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

.section-heading h2,
.page-hero h1,
.detail-info h1,
.detail-article h2,
.detail-side h2 {
  margin: 6px 0 0;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.section-heading h2 {
  font-size: clamp(28px, 3vw, 44px);
}

.section-heading.slim {
  margin-bottom: 18px;
}

.section-link,
.text-button {
  color: var(--cyan);
}

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(59, 130, 246, 0.26);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.62);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.18);
  transition: transform 0.28s ease, border-color 0.28s ease, box-shadow 0.28s ease;
}

.movie-card:hover {
  transform: translateY(-8px);
  border-color: rgba(34, 211, 238, 0.55);
  box-shadow: 0 24px 70px rgba(8, 145, 178, 0.18);
}

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

.featured-grid .poster-link {
  aspect-ratio: 16 / 10;
}

.poster-link img,
.category-tile img,
.rank-cover img,
.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.movie-card:hover .poster-link img,
.category-tile:hover img,
.rank-card:hover .rank-cover img {
  transform: scale(1.08);
}

.poster-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.85), transparent 55%);
}

.play-pill,
.rank-badge {
  position: absolute;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.play-pill {
  right: 10px;
  bottom: 10px;
  padding: 6px 10px;
  background: rgba(6, 182, 212, 0.95);
  color: white;
}

.rank-badge {
  top: 10px;
  left: 10px;
  min-width: 30px;
  height: 30px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--orange), #ef4444);
}

.card-body {
  padding: 14px;
}

.card-body h3 {
  margin: 0;
  font-size: 16px;
  line-height: 1.4;
}

.card-body h3 a:hover,
.rank-info h3 a:hover {
  color: var(--cyan);
}

.card-body p {
  min-height: 42px;
  margin: 8px 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

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

.category-tile {
  position: relative;
  min-height: 210px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 26px;
  background: var(--panel);
}

.category-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.95), rgba(2, 6, 23, 0.32));
}

.category-name,
.category-desc {
  position: absolute;
  left: 20px;
  right: 20px;
}

.category-name {
  bottom: 56px;
  font-size: 24px;
  font-weight: 900;
}

.category-desc {
  bottom: 22px;
  color: #cbd5e1;
  font-size: 14px;
}

.split-section {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 36px;
  align-items: start;
}

.side-column {
  position: sticky;
  top: 104px;
  border: 1px solid var(--line);
  border-radius: 26px;
  padding: 22px;
  background: rgba(15, 23, 42, 0.66);
}

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

.rank-card {
  display: grid;
  grid-template-columns: auto 84px 1fr auto;
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(59, 130, 246, 0.22);
  border-radius: 18px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.58);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.compact-list .rank-card {
  grid-template-columns: auto 78px 1fr;
}

.compact-list .rank-card .text-button {
  display: none;
}

.rank-card:hover {
  transform: translateY(-2px);
  border-color: var(--line-bright);
}

.rank-num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, #0e7490, #2563eb);
  font-weight: 900;
}

.rank-cover {
  display: block;
  height: 96px;
  border-radius: 14px;
  overflow: hidden;
  background: #0f172a;
}

.rank-info h3 {
  margin: 0 0 6px;
  font-size: 16px;
}

.rank-info p {
  margin: 0 0 6px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.meta-line {
  color: var(--muted-2);
  font-size: 12px;
}

.page-hero {
  position: relative;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
  background:
    radial-gradient(circle at 20% 20%, rgba(34, 211, 238, 0.18), transparent 26rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 64, 175, 0.52));
}

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

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

.page-hero p {
  max-width: 760px;
  margin: 16px 0 0;
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1.8;
}

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

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

.category-card-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

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

.category-card p {
  margin: 12px 0 18px;
  color: var(--muted);
  line-height: 1.7;
}

.sample-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.sample-links a {
  border: 1px solid rgba(34, 211, 238, 0.22);
  border-radius: 999px;
  padding: 6px 10px;
  color: #cffafe;
  font-size: 13px;
}

.filter-panel {
  display: grid;
  grid-template-columns: 1fr 180px 190px;
  gap: 12px;
  margin-bottom: 26px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.62);
}

.filter-input,
.filter-select {
  min-height: 46px;
  padding: 0 16px;
}

.full-rank .rank-card {
  grid-template-columns: 46px 92px 1fr auto;
}

.detail-hero {
  position: relative;
  overflow: hidden;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  z-index: -1;
}

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

.detail-backdrop span {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.72) 52%, rgba(2, 6, 23, 0.78) 100%),
    linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(15, 23, 42, 0.42));
}

.detail-wrap {
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 38px;
  padding: 70px 0 56px;
  align-items: end;
}

.detail-poster {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border: 1px solid var(--line-bright);
  border-radius: 28px;
  background: var(--panel-strong);
  box-shadow: var(--shadow);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 14px;
}

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

.detail-info h1 {
  max-width: 900px;
  font-size: clamp(36px, 5vw, 66px);
}

.detail-one-line {
  max-width: 860px;
  margin: 16px 0 0;
  color: #dbeafe;
  font-size: 20px;
  line-height: 1.75;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.detail-meta span {
  border-radius: 14px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.75);
  color: #e0f2fe;
}

.detail-section {
  padding-top: 28px;
}

.player-frame {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-bright);
  border-radius: 28px;
  background: #000;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

.player-frame video {
  width: 100%;
  height: 100%;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.62), rgba(2, 6, 23, 0.28));
  color: white;
  cursor: pointer;
  transition: opacity 0.24s ease;
}

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

.play-circle {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--cyan-strong), var(--blue));
  box-shadow: 0 0 38px rgba(34, 211, 238, 0.48);
  font-size: 32px;
}

.play-text {
  font-size: 18px;
  font-weight: 900;
}

.detail-text-grid {
  display: grid;
  grid-template-columns: 1fr 390px;
  gap: 34px;
  margin-top: 36px;
  align-items: start;
}

.detail-article,
.detail-side {
  border: 1px solid var(--line);
  border-radius: 28px;
  padding: 28px;
  background: rgba(15, 23, 42, 0.66);
}

.detail-article h2,
.detail-side h2 {
  font-size: 28px;
}

.detail-article p {
  margin: 14px 0 26px;
  color: #cbd5e1;
  line-height: 1.95;
  font-size: 16px;
}

.detail-article p:last-child {
  margin-bottom: 0;
}

.mini-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin-top: 18px;
}

.movie-card.compact {
  border-radius: 18px;
}

.movie-card.compact .card-body {
  padding: 10px;
}

.movie-card.compact .card-body p,
.movie-card.compact .tag-row {
  display: none;
}

.search-page-form {
  display: flex;
  gap: 12px;
  margin-bottom: 18px;
}

.search-page-form input {
  flex: 1;
  min-height: 52px;
  padding: 0 18px;
}

.search-page-form button {
  min-width: 110px;
}

.search-summary {
  min-height: 26px;
  margin-bottom: 24px;
  color: var(--muted);
}

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

.footer-inner {
  display: flex;
  justify-content: space-between;
  gap: 24px;
  padding: 34px 0;
  color: var(--muted);
}

.footer-inner strong {
  display: block;
  color: var(--text);
  font-size: 20px;
  margin-bottom: 8px;
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.footer-links a {
  color: #cbd5e1;
}

.footer-links a:hover {
  color: var(--cyan);
}

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

@media (max-width: 1180px) {
  .header-search {
    display: none;
  }

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

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

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

  .side-column {
    position: static;
  }
}

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

  .menu-toggle {
    display: block;
    margin-left: auto;
  }

  .header-inner {
    height: 66px;
  }

  .brand-name {
    font-size: 18px;
  }

  .brand-subtitle {
    display: none;
  }

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

  .hero-content {
    width: min(100% - 32px, 680px);
    margin-left: 16px;
  }

  .content-section {
    padding: 42px 0;
  }

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

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

  .filter-panel {
    grid-template-columns: 1fr;
  }

  .rank-card,
  .full-rank .rank-card {
    grid-template-columns: 38px 74px 1fr;
  }

  .rank-card .text-button {
    display: none;
  }

  .rank-cover {
    height: 84px;
  }

  .detail-wrap {
    grid-template-columns: 1fr;
    padding: 38px 0;
  }

  .detail-poster {
    width: min(260px, 72vw);
  }

  .detail-one-line {
    font-size: 17px;
  }

  .player-frame {
    border-radius: 18px;
  }

  .detail-article,
  .detail-side {
    padding: 20px;
    border-radius: 20px;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (max-width: 520px) {
  .movie-grid,
  .featured-grid,
  .category-grid,
  .category-card-grid,
  .mini-grid {
    grid-template-columns: 1fr;
  }

  .hero-actions,
  .search-page-form {
    flex-direction: column;
  }

  .primary-button,
  .ghost-button,
  .search-page-form button {
    width: 100%;
  }

  .rank-info p {
    display: none;
  }

  .rank-card,
  .full-rank .rank-card {
    grid-template-columns: 34px 70px 1fr;
  }
}
