:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.86);
  --panel-strong: rgba(15, 23, 42, 0.96);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --accent: #f59e0b;
  --accent-2: #fbbf24;
  --radius: 1.25rem;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body.site-body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.16), transparent 30rem),
    linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  border-bottom: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0.9rem 1rem;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.55rem;
  color: #ffffff;
  font-size: 1.22rem;
  font-weight: 800;
  letter-spacing: 0.01em;
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 999px;
  color: #111827;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  box-shadow: 0 0 36px rgba(245, 158, 11, 0.35);
}

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

.nav-link,
.mobile-link {
  color: var(--muted-strong);
  font-weight: 600;
  transition: color 0.25s ease, background 0.25s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
  color: #ffffff;
}

.header-search,
.mobile-search,
.home-search,
.search-page-form,
.inline-filter {
  display: flex;
  align-items: center;
  gap: 0.65rem;
}

.header-search input,
.mobile-search input,
.home-search input,
.search-page-form input,
.inline-filter input {
  width: 100%;
  min-width: 0;
  color: #ffffff;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0.9rem;
  outline: none;
  background: rgba(15, 23, 42, 0.88);
  padding: 0.78rem 0.95rem;
  transition: border 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.header-search input:focus,
.mobile-search input:focus,
.home-search input:focus,
.search-page-form input:focus,
.inline-filter input:focus {
  border-color: rgba(245, 158, 11, 0.86);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.header-search button,
.mobile-search button,
.home-search button,
.search-page-form button,
.primary-button,
.ghost-button,
.ranking-card > a,
.player-corner-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.7rem;
  border: 0;
  border-radius: 0.9rem;
  color: #111827;
  background: linear-gradient(135deg, var(--accent-2), var(--accent));
  padding: 0.72rem 1.15rem;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.25s ease, box-shadow 0.25s ease, filter 0.25s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.home-search button:hover,
.search-page-form button:hover,
.primary-button:hover,
.ranking-card > a:hover,
.player-corner-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
  box-shadow: 0 16px 36px rgba(245, 158, 11, 0.26);
}

.header-search {
  width: min(23vw, 18rem);
}

.menu-toggle {
  display: none;
  margin-left: auto;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 0.8rem;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.88);
  padding: 0.55rem 0.75rem;
}

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

.mobile-nav.is-open {
  display: grid;
  gap: 0.85rem;
}

.hero-slider {
  position: relative;
  height: 600px;
  overflow: hidden;
  background: #000000;
}

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

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  z-index: 1;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.56) 45%, rgba(0, 0, 0, 0.12)),
    linear-gradient(0deg, rgba(2, 6, 23, 0.98), transparent 35%);
}

.hero-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 1rem;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
}

.hero-content h1 {
  max-width: 760px;
  margin: 0.75rem 0 1rem;
  font-size: clamp(2.4rem, 7vw, 5rem);
  line-height: 0.96;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.hero-content p {
  max-width: 680px;
  color: var(--muted-strong);
  font-size: clamp(1rem, 2vw, 1.3rem);
  line-height: 1.8;
}

.eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border: 1px solid rgba(245, 158, 11, 0.35);
  border-radius: 999px;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.12);
  padding: 0.38rem 0.75rem;
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hero-meta,
.movie-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
  margin: 1.1rem 0;
}

.hero-meta span,
.movie-meta span,
.detail-meta span {
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.72);
  padding: 0.34rem 0.7rem;
  font-size: 0.82rem;
  font-weight: 700;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.85rem;
  margin-top: 0.6rem;
}

.ghost-button {
  color: #ffffff;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

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

.hero-dot {
  width: 0.78rem;
  height: 0.78rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.is-active {
  width: 2.3rem;
  background: var(--accent);
}

.home-search-panel,
.section-wrap,
.page-hero,
.detail-main,
.site-footer {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
  padding-left: 1rem;
  padding-right: 1rem;
}

.home-search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 1.5rem;
  align-items: center;
  margin-top: -4.4rem;
  position: relative;
  z-index: 6;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.home-search-panel > div,
.home-search {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
  padding: 1.4rem;
}

.home-search-panel h2,
.section-title h2,
.page-hero h1,
.content-panel h2,
.side-panel h2,
.player-info h1 {
  margin: 0.7rem 0 0.6rem;
  color: #ffffff;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.home-search-panel h2,
.page-hero h1 {
  font-size: clamp(2rem, 4vw, 3.3rem);
}

.home-search-panel p,
.page-hero p,
.content-panel p,
.player-info p,
.ranking-card p,
.site-footer p {
  color: var(--muted-strong);
  line-height: 1.85;
}

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

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

.section-title h2 {
  font-size: clamp(1.8rem, 3vw, 2.55rem);
}

.section-title a {
  color: #fde68a;
  font-weight: 800;
}

.movie-grid {
  display: grid;
  gap: 1.25rem;
}

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s ease, border 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(245, 158, 11, 0.35);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.35);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.86);
}

.poster-link img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease, filter 0.4s ease;
}

.movie-card:hover .poster-link img {
  transform: scale(1.06);
  filter: brightness(0.85);
}

.poster-badge {
  position: absolute;
  left: 0.7rem;
  top: 0.7rem;
  max-width: calc(100% - 1.4rem);
  border-radius: 999px;
  color: #111827;
  background: linear-gradient(135deg, #fde68a, var(--accent));
  padding: 0.28rem 0.6rem;
  font-size: 0.72rem;
  font-weight: 900;
}

.poster-play {
  position: absolute;
  inset: auto 0.8rem 0.8rem auto;
  display: grid;
  place-items: center;
  width: 2.45rem;
  height: 2.45rem;
  border-radius: 999px;
  color: #111827;
  background: #ffffff;
  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: 1rem;
}

.movie-card-body h3 {
  margin: 0;
  color: #ffffff;
  font-size: 1.02rem;
  line-height: 1.45;
  font-weight: 850;
}

.movie-card-body h3 a:hover {
  color: #fbbf24;
}

.movie-line {
  display: -webkit-box;
  min-height: 3.2em;
  margin: 0.55rem 0 0;
  overflow: hidden;
  color: var(--muted);
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  line-height: 1.6;
  font-size: 0.9rem;
}

.movie-meta {
  margin-bottom: 0;
}

.compact-card .movie-card-body h3 {
  font-size: 0.95rem;
}

.compact-card .movie-card-body {
  padding: 0.85rem;
}

.compact-card .movie-line {
  display: none;
}

.dark-panel {
  max-width: 1248px;
  margin-top: 3rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.62);
  box-shadow: var(--shadow);
}

.horizontal-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(180px, 210px);
  gap: 1rem;
  overflow-x: auto;
  padding-bottom: 0.8rem;
  scroll-snap-type: x mandatory;
}

.horizontal-rail .movie-card {
  scroll-snap-align: start;
}

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

.category-card,
.category-overview-card a {
  display: grid;
  gap: 0.8rem;
  min-height: 13rem;
  border: 1px solid var(--line);
  border-radius: 1.2rem;
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(30, 41, 59, 0.74)),
    rgba(15, 23, 42, 0.84);
  padding: 1rem;
  overflow: hidden;
  transition: transform 0.25s ease, border 0.25s ease;
}

.category-card:hover,
.category-overview-card a:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.42);
}

.category-card > span,
.category-overview-card h2 {
  color: #ffffff;
  font-size: 1.4rem;
  font-weight: 900;
}

.category-card strong,
.category-overview-card p {
  color: var(--muted-strong);
  font-weight: 500;
  line-height: 1.7;
}

.category-thumbs,
.category-collage {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 0.35rem;
  align-items: end;
  margin-top: auto;
}

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

.category-thumbs img,
.category-collage img {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 0.65rem;
  object-fit: cover;
}

.ranking-list,
.ranking-grid {
  display: grid;
  gap: 0.85rem;
}

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

.rank-row,
.ranking-card {
  display: grid;
  grid-template-columns: auto minmax(0, 1fr);
  gap: 0.85rem;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 1rem;
  background: rgba(15, 23, 42, 0.78);
  padding: 0.75rem;
}

.rank-row b,
.ranking-card b {
  color: #fbbf24;
  font-size: 1.4rem;
  font-weight: 900;
}

.ranking-card {
  grid-template-columns: auto minmax(0, 1fr) auto;
}

.ranking-card p {
  grid-column: 2 / 4;
  margin: 0;
}

.mini-card {
  display: grid;
  grid-template-columns: 4.2rem minmax(0, 1fr);
  gap: 0.75rem;
  align-items: center;
  min-width: 0;
}

.mini-card img {
  width: 4.2rem;
  aspect-ratio: 2 / 3;
  border-radius: 0.65rem;
  object-fit: cover;
}

.mini-card strong {
  display: -webkit-box;
  overflow: hidden;
  color: #ffffff;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.35;
}

.mini-card:hover strong {
  color: #fbbf24;
}

.mini-card em {
  display: block;
  margin-top: 0.35rem;
  color: var(--muted);
  font-size: 0.82rem;
  font-style: normal;
}

.page-main {
  min-height: 70vh;
}

.page-hero {
  padding-top: 4rem;
  padding-bottom: 1rem;
}

.compact-hero {
  display: grid;
  gap: 0.7rem;
}

.inline-filter,
.search-page-form {
  margin-top: 1.1rem;
  max-width: 780px;
}

.search-page-form input,
.inline-filter input {
  min-height: 3.3rem;
}

.detail-main {
  padding-top: 1.4rem;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  align-items: center;
  color: var(--muted);
  padding: 1rem 0 1.4rem;
}

.breadcrumbs a {
  color: #fde68a;
}

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

.detail-primary {
  display: grid;
  gap: 1rem;
}

.player-card,
.content-panel,
.side-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.82);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #000000;
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 0.75rem;
  border: 0;
  color: #ffffff;
  background:
    radial-gradient(circle at center, rgba(245, 158, 11, 0.22), transparent 18rem),
    linear-gradient(180deg, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.7));
  cursor: pointer;
  transition: opacity 0.25s ease;
}

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

.play-icon {
  display: grid;
  place-items: center;
  width: 5.2rem;
  height: 5.2rem;
  border-radius: 999px;
  color: #111827;
  background: linear-gradient(135deg, #ffffff, #fbbf24);
  box-shadow: 0 20px 80px rgba(245, 158, 11, 0.35);
  font-size: 2rem;
}

.player-corner-button {
  position: absolute;
  right: 1rem;
  bottom: 1rem;
  z-index: 4;
}

.player-info,
.content-panel,
.side-panel {
  padding: 1.25rem;
}

.player-info h1 {
  font-size: clamp(1.8rem, 4vw, 3rem);
}

.detail-cover {
  width: 100%;
  aspect-ratio: 2 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  object-fit: cover;
  box-shadow: var(--shadow);
}

.detail-sidebar {
  display: grid;
  align-content: start;
  gap: 1rem;
}

.side-panel {
  display: grid;
  gap: 0.85rem;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.tag-cloud a {
  border: 1px solid rgba(245, 158, 11, 0.24);
  border-radius: 999px;
  color: #fde68a;
  background: rgba(245, 158, 11, 0.1);
  padding: 0.42rem 0.75rem;
  font-weight: 700;
}

.related-section {
  padding-left: 0;
  padding-right: 0;
}

.site-footer {
  margin-top: 4rem;
  border-top: 1px solid var(--line);
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 1.5rem;
}

.site-footer h2 {
  margin: 0 0 0.75rem;
  color: #ffffff;
  font-size: 1.05rem;
  font-weight: 900;
}

.site-footer a {
  display: block;
  margin: 0.45rem 0;
  color: var(--muted-strong);
}

.site-footer a:hover {
  color: #fbbf24;
}

.copyright {
  margin: 2rem 0 0;
  color: var(--muted);
  text-align: center;
  font-size: 0.9rem;
}

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

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

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

  .detail-layout {
    grid-template-columns: minmax(0, 1fr);
  }

  .detail-sidebar {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}

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

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

  .hero-slider {
    height: 560px;
  }

  .home-search-panel {
    grid-template-columns: 1fr;
    margin-top: -2rem;
  }

  .movie-grid-6,
  .movie-grid-4,
  .category-grid,
  .category-overview-grid,
  .ranking-grid,
  .footer-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .ranking-card {
    grid-template-columns: auto minmax(0, 1fr);
  }

  .ranking-card > a,
  .ranking-card p {
    grid-column: 2;
  }
}

@media (max-width: 600px) {
  .header-inner {
    padding: 0.75rem 1rem;
  }

  .brand {
    font-size: 1.02rem;
  }

  .hero-slider {
    height: 520px;
  }

  .hero-content {
    justify-content: flex-end;
    padding-bottom: 5rem;
  }

  .home-search,
  .search-page-form,
  .mobile-search {
    flex-direction: column;
    align-items: stretch;
  }

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

  .movie-grid-6,
  .movie-grid-4,
  .category-grid,
  .category-overview-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

  .detail-cover {
    max-width: 300px;
  }

  .player-corner-button {
    right: 0.75rem;
    bottom: 0.75rem;
    min-height: 2.25rem;
    padding: 0.45rem 0.8rem;
  }
}
