:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.72);
  --panel-solid: #0f172a;
  --panel-soft: rgba(30, 41, 59, 0.78);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --cyan: #22d3ee;
  --cyan-dark: #0891b2;
  --cyan-soft: rgba(34, 211, 238, 0.16);
  --shadow: 0 24px 70px rgba(8, 47, 73, 0.35);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at 20% 0%, rgba(8, 145, 178, 0.22), transparent 36rem),
    radial-gradient(circle at 90% 20%, rgba(79, 70, 229, 0.16), transparent 38rem),
    var(--bg);
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(2, 6, 23, 0.92);
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
  transition: background 0.25s ease, box-shadow 0.25s ease, backdrop-filter 0.25s ease;
}

.site-header.is-scrolled {
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: 0 14px 38px rgba(2, 6, 23, 0.42);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 22px;
  min-height: 68px;
}

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

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), #6366f1);
  color: white;
  box-shadow: 0 12px 28px rgba(34, 211, 238, 0.24);
  font-size: 14px;
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text span {
  font-size: 20px;
}

.brand-text small {
  margin-top: 2px;
  color: var(--cyan);
  font-size: 12px;
  font-weight: 700;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 28px;
  color: var(--muted-strong);
  font-size: 15px;
  font-weight: 700;
}

.desktop-nav a,
.mobile-panel a,
.footer-links a {
  transition: color 0.2s ease;
}

.desktop-nav a:hover,
.mobile-panel a:hover,
.footer-links a:hover {
  color: var(--cyan);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 4px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.86);
}

.header-search input,
.hero-search input,
.search-panel input,
.search-panel select,
.filter-bar input,
.filter-bar select {
  min-width: 0;
  color: var(--text);
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.78);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search input {
  width: 220px;
  border: 0;
  background: transparent;
  padding: 9px 8px 9px 14px;
}

.header-search button,
.hero-search button,
.search-panel button {
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  color: white;
  background: var(--cyan-dark);
  cursor: pointer;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease;
}

.header-search button:hover,
.hero-search button:hover,
.search-panel button:hover {
  transform: translateY(-1px);
  background: #0e7490;
}

.menu-toggle {
  display: none;
  border: 0;
  background: transparent;
  color: var(--text);
  cursor: pointer;
  font-size: 26px;
}

.mobile-panel {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0 20px;
  border-top: 1px solid var(--line);
}

.mobile-panel.is-open {
  display: grid;
  gap: 12px;
}

.hero-section {
  position: relative;
  min-height: 720px;
  padding: 126px 0 78px;
  overflow: hidden;
  background: #020617;
}

.hero-bg,
.detail-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
}

.hero-bg img,
.detail-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.46;
  transform: scale(1.04);
}

.hero-bg span,
.detail-bg span {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, #020617 0%, rgba(2, 6, 23, 0.92) 38%, rgba(2, 6, 23, 0.48) 100%),
    linear-gradient(0deg, #020617 0%, transparent 54%);
}

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

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

.eyebrow {
  margin: 0 0 14px;
  color: var(--cyan);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1,
.detail-copy h1 {
  margin: 0;
  max-width: 900px;
  font-size: clamp(38px, 6vw, 70px);
  line-height: 1.05;
  letter-spacing: -0.055em;
}

.hero-summary {
  max-width: 700px;
  margin: 24px 0 0;
  color: var(--muted-strong);
  font-size: 19px;
}

.hero-feature {
  max-width: 700px;
  margin-top: 28px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.88), rgba(8, 47, 73, 0.52));
  box-shadow: var(--shadow);
}

.hero-feature h2 {
  margin: 0 0 8px;
  font-size: clamp(24px, 3vw, 38px);
}

.hero-feature p {
  margin: 0;
  color: var(--muted-strong);
}

.hero-meta,
.detail-meta,
.movie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.hero-meta span,
.detail-meta span,
.movie-meta span {
  display: inline-flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 10px;
  color: var(--muted-strong);
  background: rgba(15, 23, 42, 0.56);
  font-size: 13px;
  font-weight: 700;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 900;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

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

.btn-primary {
  background: var(--cyan-dark);
  color: white;
  box-shadow: 0 16px 34px rgba(8, 145, 178, 0.28);
}

.btn-primary:hover {
  background: #0e7490;
}

.btn-ghost,
.btn-soft {
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.62);
  color: var(--text);
}

.btn-ghost:hover,
.btn-soft:hover {
  border-color: rgba(34, 211, 238, 0.6);
  color: var(--cyan);
}

.hero-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  max-width: 620px;
  margin-top: 28px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.76);
  backdrop-filter: blur(16px);
}

.hero-search input {
  border: 0;
  background: transparent;
  padding: 12px 16px;
}

.home-layout,
.category-overview,
.rankings-layout,
.search-layout,
.detail-layout {
  padding: 72px 0;
}

.content-section {
  margin-bottom: 72px;
}

.section-panel,
.category-panel,
.ranking-panel,
.content-card,
.category-overview-card {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.74), rgba(30, 41, 59, 0.44));
  box-shadow: var(--shadow);
}

.section-panel,
.category-panel,
.ranking-panel,
.content-card,
.category-overview-card {
  padding: clamp(22px, 4vw, 34px);
}

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

.section-heading.compact {
  align-items: start;
  margin-bottom: 20px;
}

.section-heading h2 {
  margin: 0 0 6px;
  font-size: clamp(26px, 3.2vw, 38px);
  line-height: 1.1;
}

.section-heading p,
.page-hero p,
.detail-copy p,
.content-card p {
  margin: 0;
  color: var(--muted);
}

.section-heading a {
  flex: 0 0 auto;
  color: var(--cyan);
  font-weight: 900;
}

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.66);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, 0.42);
  background: rgba(30, 41, 59, 0.86);
  box-shadow: 0 22px 42px rgba(8, 47, 73, 0.26);
}

.movie-cover {
  position: relative;
  display: block;
  aspect-ratio: 4 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(8, 145, 178, 0.2), rgba(15, 23, 42, 0.96));
}

.movie-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease, opacity 0.2s ease;
}

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

.cover-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.82));
}

.card-badge,
.card-year {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.78);
  color: var(--cyan);
  padding: 5px 9px;
  font-size: 12px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.card-badge {
  top: 12px;
  right: 12px;
}

.card-year {
  bottom: 12px;
  left: 12px;
  color: var(--text);
}

.movie-info {
  padding: 16px;
}

.movie-info h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.35;
}

.movie-info h3 a {
  transition: color 0.2s ease;
}

.movie-info h3 a:hover {
  color: var(--cyan);
}

.movie-info p {
  display: -webkit-box;
  min-height: 45px;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1.45fr) minmax(320px, 0.55fr);
  gap: 26px;
  margin-bottom: 72px;
}

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

.category-tile {
  min-height: 132px;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(2, 6, 23, 0.34);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.category-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.46);
  background: var(--cyan-soft);
}

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

.category-tile span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

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

.rank-item a {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr);
  gap: 10px 12px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  background: rgba(2, 6, 23, 0.32);
  transition: border-color 0.2s ease, background 0.2s ease;
}

.rank-item a:hover {
  border-color: rgba(34, 211, 238, 0.46);
  background: rgba(8, 145, 178, 0.12);
}

.rank-num {
  grid-row: span 2;
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 14px;
  background: var(--cyan-soft);
  color: var(--cyan);
  font-weight: 900;
}

.rank-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.rank-meta {
  overflow: hidden;
  color: var(--muted);
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 13px;
}

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

.page-hero {
  position: relative;
  padding: 90px 0 64px;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(8, 145, 178, 0.24), rgba(15, 23, 42, 0.72)),
    radial-gradient(circle at 80% 10%, rgba(99, 102, 241, 0.22), transparent 34rem);
  border-bottom: 1px solid var(--line);
}

.page-hero h1 {
  margin-bottom: 18px;
}

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

.category-overview {
  display: grid;
  gap: 28px;
}

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

.filter-bar,
.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 160px auto;
  gap: 12px;
  margin-bottom: 28px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.72);
}

.filter-bar input,
.filter-bar select,
.search-panel input,
.search-panel select {
  min-height: 46px;
  border-radius: 999px;
  padding: 0 16px;
}

.filter-bar input:focus,
.filter-bar select:focus,
.search-panel input:focus,
.search-panel select:focus,
.header-search input:focus,
.hero-search input:focus {
  border-color: rgba(34, 211, 238, 0.7);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

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

.rankings-layout {
  max-width: 980px;
}

.ranking-cards {
  display: grid;
  gap: 16px;
}

.ranking-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 22px;
  align-items: center;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.68);
  transition: border-color 0.2s ease, transform 0.2s ease;
}

.ranking-card:hover {
  transform: translateY(-3px);
  border-color: rgba(34, 211, 238, 0.44);
}

.ranking-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: rgba(8, 47, 73, 0.3);
}

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

.ranking-cover span {
  position: absolute;
  top: 10px;
  left: 10px;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.82);
  color: var(--cyan);
  font-weight: 900;
}

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

.ranking-card p {
  margin: 0;
  color: var(--muted);
}

.search-results h2 {
  margin: 0 0 22px;
  font-size: 30px;
}

.detail-main {
  padding-top: 68px;
}

.detail-hero {
  position: relative;
  min-height: 620px;
  display: flex;
  align-items: center;
  overflow: hidden;
  padding: 70px 0;
  background: #020617;
}

.detail-hero-content {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: clamp(26px, 5vw, 54px);
  align-items: center;
}

.detail-poster {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(8, 47, 73, 0.34);
  box-shadow: var(--shadow);
}

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

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

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

.detail-copy h1 {
  max-width: 850px;
  margin-bottom: 22px;
}

.detail-copy p {
  max-width: 800px;
  font-size: 18px;
}

.player-section {
  margin-bottom: 36px;
}

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

.movie-video {
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.78)),
    radial-gradient(circle at 50% 50%, rgba(34, 211, 238, 0.18), transparent 18rem);
  cursor: pointer;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.player-trigger {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  border: 0;
  border-radius: 999px;
  background: var(--cyan-dark);
  color: white;
  padding: 16px 28px;
  cursor: pointer;
  box-shadow: 0 20px 48px rgba(8, 145, 178, 0.38);
  transition: transform 0.2s ease, background 0.2s ease;
}

.player-trigger:hover {
  transform: scale(1.04);
  background: #0e7490;
}

.player-trigger span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
}

.content-card {
  margin-bottom: 56px;
}

.detail-content h2 {
  margin: 0 0 14px;
  font-size: 28px;
}

.detail-content h2:not(:first-child) {
  margin-top: 34px;
}

.detail-content p {
  font-size: 17px;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 28px;
}

.tag-list span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 8px 12px;
  background: rgba(2, 6, 23, 0.32);
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 800;
}

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

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 36px;
  padding: 48px 0;
}

.footer-brand {
  margin-bottom: 14px;
  font-size: 20px;
}

.site-footer p {
  max-width: 430px;
  margin: 0;
  color: var(--muted);
}

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

.footer-links {
  display: grid;
  gap: 9px;
  color: var(--muted);
}

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

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

.empty-state {
  padding: 34px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.72);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1080px) {
  .desktop-nav,
  .header-search {
    display: none;
  }

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

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

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

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

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

@media (max-width: 760px) {
  .container {
    width: min(100% - 24px, 1180px);
  }

  .hero-section {
    min-height: auto;
    padding: 104px 0 54px;
  }

  .hero-search,
  .filter-bar,
  .search-panel {
    grid-template-columns: 1fr;
    border-radius: var(--radius-md);
  }

  .hero-copy h1,
  .page-hero h1,
  .detail-copy h1 {
    font-size: clamp(34px, 12vw, 48px);
  }

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

  .movie-grid,
  .movie-grid-featured,
  .category-grid,
  .overview-grid,
  .category-tile-grid {
    grid-template-columns: 1fr;
  }

  .ranking-card {
    grid-template-columns: 1fr;
  }

  .ranking-cover {
    max-width: none;
  }

  .detail-hero {
    min-height: auto;
  }

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

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