:root {
  color-scheme: dark;
  --color-dark-950: #1a1f2e;
  --color-dark-900: #2d374c;
  --color-mirror-900: #17202e;
  --color-mirror-800: #243b53;
  --color-realm-400: #e8a84d;
  --color-realm-500: #d4941f;
  --color-realm-600: #b87d15;
  --color-text: #f8fafc;
  --color-muted: #a8b3c7;
  --shadow-glow: 0 8px 30px rgba(212, 148, 31, 0.2);
  --border-soft: rgba(255, 255, 255, 0.08);
  --glass: rgba(255, 255, 255, 0.06);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(212, 148, 31, 0.18), transparent 32rem),
    radial-gradient(circle at top right, rgba(36, 59, 83, 0.8), transparent 40rem),
    var(--color-dark-950);
  color: var(--color-text);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

body.is-menu-open {
  overflow: hidden;
}

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

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

button,
input,
select {
  font: inherit;
}

.container-custom {
  width: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
}

.section-padding {
  padding-top: 4rem;
  padding-bottom: 4rem;
}

.backdrop-glass {
  border: 1px solid var(--border-soft);
  background: var(--glass);
  backdrop-filter: blur(14px);
}

.text-gradient {
  background: linear-gradient(90deg, var(--color-realm-400), var(--color-realm-600));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.card-hover {
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.card-hover:hover {
  transform: translateY(-5px) scale(1.01);
  box-shadow: var(--shadow-glow);
  border-color: rgba(232, 168, 77, 0.35);
}

.animate-fade-in {
  animation: fadeIn 0.5s ease-in-out both;
}

.scrollbar-hide {
  scrollbar-width: none;
}

.scrollbar-hide::-webkit-scrollbar {
  display: none;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  border-width: 0 0 1px;
  background: rgba(26, 31, 46, 0.72);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  min-height: 4.5rem;
}

.site-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-size: 1.55rem;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.4rem;
  height: 2.4rem;
  border-radius: 0.85rem;
  background: linear-gradient(135deg, var(--color-realm-400), var(--color-realm-600));
  color: #ffffff;
  box-shadow: 0 12px 30px rgba(212, 148, 31, 0.28);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: auto;
}

.nav-link,
.mobile-nav-link {
  color: var(--color-muted);
  padding: 0.65rem 0.9rem;
  border-radius: 0.75rem;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-nav-link:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.07);
}

.header-search,
.mobile-search,
.search-large {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

.header-search {
  width: min(320px, 28vw);
}

.header-search input,
.mobile-search input,
.search-large input,
.filter-bar input,
.filter-bar select {
  width: 100%;
  border: 1px solid var(--border-soft);
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
  outline: none;
  padding: 0.72rem 0.9rem;
}

.header-search button,
.mobile-search button,
.search-large button {
  border: 0;
  border-radius: 0.85rem;
  background: var(--color-realm-500);
  color: #ffffff;
  cursor: pointer;
  padding: 0.72rem 1rem;
  transition: background 0.2s ease, transform 0.2s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.search-large button:hover {
  background: var(--color-realm-600);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  width: 2.7rem;
  height: 2.7rem;
  border: 1px solid var(--border-soft);
  border-radius: 0.8rem;
  background: rgba(255, 255, 255, 0.06);
  color: #ffffff;
  cursor: pointer;
  padding: 0.6rem;
}

.menu-toggle span {
  display: block;
  width: 100%;
  height: 2px;
  margin: 0.25rem 0;
  border-radius: 999px;
  background: currentColor;
}

.mobile-panel {
  display: none;
  border-top: 1px solid var(--border-soft);
  background: rgba(26, 31, 46, 0.96);
}

.mobile-panel-inner {
  display: grid;
  gap: 0.75rem;
  padding-top: 1rem;
  padding-bottom: 1rem;
}

.hero-slider {
  position: relative;
  height: 78vh;
  min-height: 620px;
  overflow: hidden;
  background: var(--color-dark-950);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  align-items: center;
  opacity: 0;
  visibility: hidden;
  background-position: center;
  background-size: cover;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
}

.hero-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 3rem;
  align-items: center;
  padding-top: 5rem;
}

.hero-kicker,
.page-hero span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(232, 168, 77, 0.28);
  border-radius: 999px;
  background: rgba(212, 148, 31, 0.16);
  color: var(--color-realm-400);
  font-size: 0.92rem;
  font-weight: 700;
  padding: 0.35rem 0.75rem;
}

.hero-copy h1 {
  max-width: 780px;
  margin: 1rem 0;
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-copy p {
  max-width: 720px;
  margin: 0;
  color: #d7deea;
  font-size: clamp(1rem, 2vw, 1.25rem);
}

.hero-chips,
.detail-tags,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 1.25rem;
}

.hero-chips span,
.detail-tags span,
.tag-cloud span {
  border: 1px solid var(--border-soft);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #d7deea;
  font-size: 0.9rem;
  padding: 0.38rem 0.75rem;
}

.hero-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.9rem;
  margin-top: 1.75rem;
}

.btn-primary,
.btn-ghost,
.section-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.9rem;
  border-radius: 0.85rem;
  font-weight: 700;
  padding: 0.75rem 1.25rem;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.btn-primary {
  background: var(--color-realm-500);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(212, 148, 31, 0.25);
}

.btn-primary:hover {
  background: var(--color-realm-600);
  transform: translateY(-2px);
}

.btn-ghost,
.section-link {
  border: 1px solid var(--border-soft);
  background: rgba(255, 255, 255, 0.08);
  color: #ffffff;
}

.btn-ghost:hover,
.section-link:hover {
  border-color: rgba(232, 168, 77, 0.35);
  background: rgba(255, 255, 255, 0.12);
  transform: translateY(-2px);
}

.hero-poster {
  position: relative;
  display: block;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1.4rem;
  background: var(--color-mirror-800);
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

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

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 2rem;
  display: flex;
  gap: 0.65rem;
  transform: translateX(-50%);
}

.hero-dots button {
  width: 2.2rem;
  height: 0.38rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.35);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dots button.is-active {
  width: 3.2rem;
  background: var(--color-realm-400);
}

.section-heading {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 2rem;
}

.section-heading h2,
.ranking-panel h2,
.detail-content h2,
.detail-info h2 {
  margin: 0 0 0.35rem;
  font-size: clamp(1.65rem, 3vw, 2.5rem);
  line-height: 1.15;
}

.section-heading p,
.ranking-panel p,
.page-hero p,
.site-footer p {
  margin: 0;
  color: var(--color-muted);
}

.feature-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 220px);
  gap: 1.25rem;
  overflow-x: auto;
  padding: 0.25rem 0.25rem 1.25rem;
  scroll-snap-type: x mandatory;
}

.feature-card {
  scroll-snap-align: start;
}

.feature-card a:first-child {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 1rem;
  background: var(--color-mirror-800);
}

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

.feature-card span {
  position: absolute;
  right: 0.6rem;
  top: 0.6rem;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--color-realm-400);
  font-weight: 800;
  padding: 0.25rem 0.55rem;
}

.feature-card h2 {
  margin: 0.75rem 0 0.15rem;
  font-size: 1rem;
  line-height: 1.35;
}

.feature-card p {
  margin: 0;
  color: var(--color-muted);
  font-size: 0.9rem;
}

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

.category-tile,
.category-overview-card {
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 1.2rem;
  background: rgba(255, 255, 255, 0.055);
  padding: 1rem;
}

.category-preview,
.category-overview-images {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.35rem;
  margin-bottom: 1rem;
}

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

.category-preview img,
.category-overview-images img {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 0.65rem;
  object-fit: cover;
}

.category-tile h2,
.category-overview-card h2 {
  margin: 0 0 0.35rem;
  font-size: 1.18rem;
}

.category-tile p,
.category-overview-card p {
  min-height: 3.2rem;
  margin: 0 0 0.8rem;
  color: var(--color-muted);
  font-size: 0.92rem;
}

.category-tile span,
.category-overview-card span {
  color: var(--color-realm-400);
  font-weight: 700;
}

.home-split {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 2rem;
  align-items: start;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--border-soft);
  border-radius: 1.15rem;
  background: rgba(255, 255, 255, 0.055);
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--color-mirror-800);
}

.poster-link img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform 0.35s ease;
}

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

.score-badge,
.type-badge,
.rank-badge {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  color: #ffffff;
  font-size: 0.78rem;
  font-weight: 800;
  padding: 0.25rem 0.55rem;
}

.score-badge {
  right: 0.6rem;
  top: 0.6rem;
  background: rgba(212, 148, 31, 0.92);
}

.type-badge {
  left: 0.6rem;
  bottom: 0.6rem;
  background: rgba(0, 0, 0, 0.62);
}

.rank-badge {
  left: 0.6rem;
  top: 0.6rem;
  background: rgba(0, 0, 0, 0.72);
}

.movie-card-body {
  padding: 0.9rem;
}

.movie-card-body h2 {
  margin: 0 0 0.4rem;
  font-size: 1.03rem;
  line-height: 1.35;
}

.movie-card-body p {
  display: -webkit-box;
  min-height: 2.9rem;
  margin: 0;
  overflow: hidden;
  color: var(--color-muted);
  font-size: 0.9rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.movie-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.6rem;
  margin-top: 0.8rem;
  color: #d7deea;
  font-size: 0.82rem;
}

.ranking-panel {
  position: sticky;
  top: 6rem;
  border-radius: 1.25rem;
  padding: 1.25rem;
}

.ranking-list {
  display: grid;
  gap: 0.6rem;
  margin-top: 1rem;
}

.ranking-row {
  display: grid;
  grid-template-columns: 2rem minmax(0, 1fr) auto auto;
  gap: 0.75rem;
  align-items: center;
  border-radius: 0.85rem;
  background: rgba(255, 255, 255, 0.055);
  padding: 0.7rem;
}

.ranking-number {
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: var(--color-realm-500);
  font-weight: 800;
}

.ranking-title {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-meta {
  color: var(--color-muted);
  font-size: 0.86rem;
}

.page-main {
  padding-top: 6rem;
}

.page-hero {
  border-radius: 1.4rem;
  margin-top: 1.5rem;
  padding: clamp(1.5rem, 4vw, 3rem);
}

.page-hero h1 {
  margin: 1rem 0 0.75rem;
  font-size: clamp(2.2rem, 6vw, 4.8rem);
  line-height: 1.05;
}

.category-overview-card {
  display: grid;
  gap: 1rem;
}

.filter-section {
  margin-top: 1.5rem;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 160px 160px auto;
  gap: 0.8rem;
  align-items: center;
  border-radius: 1.1rem;
  padding: 1rem;
}

.filter-count {
  color: var(--color-realm-400);
  font-weight: 800;
  white-space: nowrap;
}

.category-movie-section {
  padding-top: 2rem;
}

.ranking-page-list {
  display: grid;
  gap: 1rem;
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.ranking-card {
  display: grid;
  grid-template-columns: 110px minmax(0, 1fr) auto;
  gap: 1.2rem;
  align-items: center;
  border-radius: 1.15rem;
  padding: 1rem;
}

.ranking-card-poster {
  position: relative;
  overflow: hidden;
  border-radius: 0.9rem;
  background: var(--color-mirror-800);
}

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

.ranking-card-poster span {
  position: absolute;
  top: 0.5rem;
  left: 0.5rem;
  display: grid;
  place-items: center;
  width: 2rem;
  height: 2rem;
  border-radius: 50%;
  background: rgba(212, 148, 31, 0.95);
  font-weight: 900;
}

.ranking-card-content h2 {
  margin: 0 0 0.4rem;
}

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

.ranking-score {
  color: var(--color-realm-400);
  font-size: 2rem;
}

.search-page-box {
  padding-top: 2rem;
  padding-bottom: 4rem;
}

.search-large {
  border-radius: 1.1rem;
  padding: 1rem;
}

.search-status {
  min-height: 2rem;
  margin: 1.5rem 0;
  color: var(--color-muted);
}

.detail-main {
  padding-top: 0;
}

.detail-hero {
  min-height: 660px;
  background-position: center;
  background-size: cover;
  padding-top: 7rem;
  padding-bottom: 3rem;
}

.detail-hero-grid {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 2.5rem;
  align-items: center;
}

.detail-cover {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 1.2rem;
  background: var(--color-mirror-800);
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
}

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

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: var(--color-muted);
  font-size: 0.95rem;
}

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

.detail-hero-copy h1 {
  margin: 1rem 0;
  font-size: clamp(2.25rem, 6vw, 5rem);
  line-height: 1.05;
}

.detail-hero-copy p {
  max-width: 820px;
  margin: 0;
  color: #d7deea;
  font-size: 1.15rem;
}

.player-section {
  margin-top: -4rem;
  position: relative;
  z-index: 3;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 1.3rem;
  background: #000000;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.42);
}

.movie-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.player-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 1rem;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.72));
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.player-button {
  display: grid;
  place-items: center;
  width: 5.5rem;
  height: 5.5rem;
  border: 0;
  border-radius: 50%;
  background: var(--color-realm-500);
  box-shadow: 0 18px 48px rgba(212, 148, 31, 0.35);
  cursor: pointer;
}

.player-button span {
  width: 0;
  height: 0;
  margin-left: 0.3rem;
  border-top: 1.05rem solid transparent;
  border-bottom: 1.05rem solid transparent;
  border-left: 1.55rem solid #ffffff;
}

.player-layer strong {
  max-width: min(90%, 760px);
  text-align: center;
  font-size: clamp(1.25rem, 3vw, 2.2rem);
}

.detail-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 1.5rem;
  padding-top: 2rem;
}

.detail-content,
.detail-info {
  border-radius: 1.2rem;
  padding: 1.4rem;
}

.detail-content p {
  color: #d7deea;
  font-size: 1.04rem;
}

.detail-info {
  height: fit-content;
}

.detail-info dl {
  display: grid;
  gap: 0.75rem;
  margin: 1rem 0;
}

.detail-info dt {
  color: var(--color-muted);
  font-size: 0.86rem;
}

.detail-info dd {
  margin: -0.65rem 0 0;
  color: #ffffff;
}

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

.site-footer {
  border-top: 1px solid var(--border-soft);
  background: rgba(23, 32, 46, 0.72);
  margin-top: 3rem;
  padding: 3rem 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) 0.8fr 1.2fr;
  gap: 2rem;
}

.site-footer h2 {
  margin: 0 0 1rem;
  font-size: 1.05rem;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
}

.footer-links a {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.07);
  color: var(--color-muted);
  padding: 0.35rem 0.7rem;
}

.footer-links a:hover {
  color: #ffffff;
  background: rgba(212, 148, 31, 0.22);
}

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

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

  .ranking-panel {
    position: static;
  }

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

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

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

  body.is-menu-open .mobile-panel {
    display: block;
  }

  .hero-slider {
    min-height: 720px;
    height: auto;
  }

  .hero-slide {
    position: relative;
    display: none;
    min-height: 720px;
  }

  .hero-slide.is-active {
    display: grid;
  }

  .hero-content,
  .detail-hero-grid {
    grid-template-columns: 1fr;
    gap: 1.5rem;
  }

  .hero-poster,
  .detail-cover {
    width: min(280px, 70vw);
  }

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

  .filter-count {
    grid-column: 1 / -1;
  }

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

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

@media (max-width: 640px) {
  .container-custom {
    padding: 0 0.85rem;
  }

  .section-padding {
    padding-top: 2.5rem;
    padding-bottom: 2.5rem;
  }

  .site-logo {
    font-size: 1.25rem;
  }

  .logo-mark {
    width: 2.1rem;
    height: 2.1rem;
  }

  .hero-content {
    padding-top: 6rem;
  }

  .hero-copy h1,
  .detail-hero-copy h1 {
    font-size: 2.35rem;
  }

  .hero-actions,
  .detail-actions,
  .section-heading {
    align-items: stretch;
    flex-direction: column;
  }

  .category-grid,
  .category-overview-grid,
  .movie-grid,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 0.9rem;
  }

  .movie-card-body {
    padding: 0.75rem;
  }

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

  .ranking-card-poster {
    width: 130px;
  }

  .ranking-score {
    font-size: 1.4rem;
  }

  .detail-hero {
    min-height: auto;
    padding-top: 6rem;
  }

  .player-section {
    margin-top: 1rem;
  }

  .detail-content,
  .detail-info {
    padding: 1rem;
  }
}
