:root {
  color-scheme: dark;
  --site-bg: #020617;
  --panel-bg: rgba(15, 23, 42, 0.72);
  --panel-strong: rgba(15, 23, 42, 0.92);
  --line: rgba(148, 163, 184, 0.2);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --accent: #facc15;
  --accent-strong: #eab308;
  --silver: #cbd5e1;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.45);
}

html {
  scroll-behavior: smooth;
}

body.site-body {
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(250, 204, 21, 0.12), transparent 34%), radial-gradient(circle at top right, rgba(148, 163, 184, 0.16), transparent 32%), #020617;
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  min-height: 72px;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #f8fafc;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.logo-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #facc15, #94a3b8);
  color: #020617;
  box-shadow: 0 12px 34px rgba(250, 204, 21, 0.22);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.nav-link:hover,
.nav-link.active,
.mobile-nav-link:hover {
  color: #ffffff;
  background: rgba(250, 204, 21, 0.12);
}

.header-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  min-width: 300px;
  padding: 4px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.42);
}

.header-search input,
.search-page-form input,
.filter-bar input {
  width: 100%;
  color: #f8fafc;
  background: transparent;
  outline: none;
}

.header-search input {
  padding: 0 14px;
}

.header-search button {
  padding: 8px 14px;
  border-radius: 999px;
  color: #020617;
  background: var(--accent);
  font-weight: 700;
  cursor: pointer;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
  cursor: pointer;
}

.menu-toggle span {
  width: 18px;
  height: 2px;
  border-radius: 2px;
  background: #f8fafc;
}

.mobile-nav {
  display: none;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 16px;
}

.mobile-nav.is-open {
  display: grid;
  gap: 8px;
}

.hero-carousel {
  position: relative;
  min-height: 76vh;
  overflow: hidden;
  background: #020617;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.6s ease;
  background-image: linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.72) 48%, rgba(2, 6, 23, 0.28)), var(--hero-image);
  background-size: cover;
  background-position: center;
}

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

.hero-backdrop,
.detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, #020617 0%, transparent 38%, rgba(2, 6, 23, 0.24) 100%);
}

.hero-content {
  position: relative;
  min-height: 76vh;
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 420px);
  align-items: center;
  gap: 56px;
  padding-top: 84px;
  padding-bottom: 96px;
}

.eyebrow {
  color: var(--accent);
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
  font-size: 0.82rem;
}

.hero-copy h1,
.page-hero h1,
.detail-copy h1 {
  margin: 12px 0 18px;
  font-size: clamp(2.7rem, 7vw, 6.7rem);
  line-height: 0.95;
  font-weight: 900;
  letter-spacing: -0.06em;
  color: #f8fafc;
}

.hero-summary,
.page-hero p,
.detail-one-line {
  max-width: 760px;
  color: #cbd5e1;
  font-size: clamp(1rem, 1.6vw, 1.28rem);
  line-height: 1.8;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.btn-primary {
  color: #020617;
  background: linear-gradient(135deg, #fde047, #eab308);
  box-shadow: 0 18px 40px rgba(234, 179, 8, 0.24);
}

.btn-secondary {
  color: #f8fafc;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

.btn-ghost {
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.45);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.hero-poster {
  display: block;
  border-radius: 34px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.54);
}

.hero-poster img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.hero-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 24px;
  display: flex;
  align-items: center;
  gap: 14px;
  z-index: 4;
}

.hero-arrow,
.hero-dot {
  cursor: pointer;
}

.hero-arrow {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.26);
  font-size: 28px;
  line-height: 1;
}

.hero-dots {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.35);
}

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

.hero-category-strip {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 86px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-category-strip a,
.tag-row span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: #e2e8f0;
  background: rgba(148, 163, 184, 0.12);
  border: 1px solid rgba(148, 163, 184, 0.18);
}

.hero-category-strip a {
  padding: 8px 14px;
}

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

.tag-row span {
  padding: 5px 10px;
  font-size: 0.82rem;
}

.content-section {
  padding-top: 64px;
  padding-bottom: 28px;
}

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

.section-heading h2,
.player-section h2,
.detail-article h2,
.footer-grid h2,
.panel-title h2 {
  font-size: clamp(1.45rem, 2.4vw, 2.1rem);
  font-weight: 900;
  color: #f8fafc;
}

.section-heading p {
  margin-top: 8px;
  color: var(--muted);
}

.section-more,
.panel-title a {
  color: var(--accent);
  font-weight: 800;
}

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

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

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

.movie-card {
  overflow: hidden;
  border-radius: 24px;
  background: var(--panel-bg);
  border: 1px solid rgba(148, 163, 184, 0.16);
  box-shadow: 0 16px 40px rgba(0, 0, 0, 0.24);
}

.movie-poster {
  position: relative;
  display: block;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.86);
}

.movie-poster img {
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform 0.42s ease;
}

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

.movie-year {
  position: absolute;
  left: 10px;
  top: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #020617;
  background: var(--accent);
  font-size: 0.78rem;
  font-weight: 900;
}

.movie-card-content {
  padding: 15px;
}

.movie-meta {
  color: var(--muted);
  font-size: 0.82rem;
  margin-bottom: 6px;
}

.movie-card h2,
.movie-card h3 {
  color: #f8fafc;
  font-size: 1.02rem;
  font-weight: 850;
  line-height: 1.35;
  margin-bottom: 8px;
}

.movie-card h2 a,
.movie-card h3 a {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-card-text {
  min-height: 44px;
  color: #94a3b8;
  font-size: 0.88rem;
  line-height: 1.55;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-card .tag-row {
  margin-top: 12px;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
}

.ranking-panel {
  align-self: start;
  position: sticky;
  top: 96px;
  border-radius: 28px;
  padding: 22px;
}

.panel-title {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.ranking-list {
  display: grid;
  gap: 8px;
}

.ranking-list a {
  display: grid;
  grid-template-columns: 46px minmax(0, 1fr) auto;
  align-items: center;
  gap: 10px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.5);
}

.rank-num,
.wide-rank-num {
  color: var(--accent);
  font-weight: 950;
  letter-spacing: -0.04em;
}

.rank-title {
  color: #f8fafc;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rank-meta {
  color: var(--muted);
  font-size: 0.82rem;
}

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

.category-tile,
.category-card a {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: 26px;
  min-height: 190px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: var(--panel-bg);
}

.category-tile img,
.category-card img {
  position: absolute;
  inset: 0;
  height: 100%;
  object-fit: cover;
  opacity: 0.4;
}

.category-tile::after,
.category-card a::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.24));
}

.category-tile span,
.category-tile em,
.category-card div {
  position: absolute;
  z-index: 2;
  left: 20px;
  right: 20px;
}

.category-tile span {
  bottom: 54px;
  color: #f8fafc;
  font-size: 1.4rem;
  font-weight: 900;
}

.category-tile em {
  bottom: 24px;
  color: #cbd5e1;
  font-style: normal;
}

.category-card a {
  min-height: 240px;
}

.category-card div {
  bottom: 24px;
}

.category-card h2 {
  color: #f8fafc;
  font-size: 1.6rem;
  font-weight: 900;
  margin-bottom: 8px;
}

.category-card p {
  color: #cbd5e1;
  line-height: 1.65;
}

.category-card span {
  display: inline-flex;
  margin-top: 14px;
  color: var(--accent);
  font-weight: 800;
}

.page-main {
  padding-top: 42px;
  padding-bottom: 70px;
}

.page-hero {
  position: relative;
  overflow: hidden;
  border-radius: 34px;
  padding: clamp(30px, 6vw, 72px);
  box-shadow: var(--shadow);
}

.category-hero {
  background-image: linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.48)), var(--hero-image);
  background-size: cover;
  background-position: center;
}

.page-actions {
  margin-top: 22px;
}

.filter-bar,
.search-status {
  margin-bottom: 22px;
  padding: 14px 18px;
  border-radius: 20px;
}

.filter-bar input,
.search-page-form input {
  font-size: 1rem;
}

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

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

.wide-rank-card {
  border-radius: 22px;
  overflow: hidden;
}

.wide-rank-link {
  display: grid;
  grid-template-columns: 74px 86px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 14px 18px;
}

.wide-rank-link img {
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 14px;
}

.wide-rank-text {
  display: grid;
  gap: 6px;
}

.wide-rank-text strong {
  color: #f8fafc;
  font-size: 1.1rem;
}

.wide-rank-text em,
.wide-rank-text span {
  color: var(--muted);
  font-style: normal;
}

.search-page-form {
  margin-top: 24px;
  max-width: 720px;
  display: flex;
  gap: 12px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.search-page-form input {
  padding: 0 18px;
}

.movie-detail-main {
  padding-bottom: 70px;
}

.detail-hero {
  position: relative;
  min-height: 68vh;
  background-image: linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.66), rgba(2, 6, 23, 0.36)), var(--hero-image);
  background-size: cover;
  background-position: center;
}

.detail-hero-inner {
  position: relative;
  min-height: 68vh;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 44px;
  align-items: center;
  padding-top: 78px;
  padding-bottom: 70px;
}

.detail-poster {
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: var(--shadow);
}

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

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

.detail-meta span {
  padding: 8px 12px;
  border-radius: 999px;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.68);
  border: 1px solid rgba(148, 163, 184, 0.2);
}

.player-section h2 {
  margin-bottom: 18px;
}

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

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 12px;
  align-content: center;
  color: #f8fafc;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.22), rgba(2, 6, 23, 0.72));
  cursor: pointer;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

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

.play-icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #020617;
  background: var(--accent);
  box-shadow: 0 18px 48px rgba(234, 179, 8, 0.34);
  font-size: 26px;
}

.player-status {
  position: absolute;
  left: 18px;
  bottom: 14px;
  color: #cbd5e1;
  font-size: 0.9rem;
  pointer-events: none;
}

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

.detail-article {
  border-radius: 26px;
  padding: 26px;
  line-height: 1.9;
  color: #cbd5e1;
}

.detail-article h2 {
  margin-bottom: 14px;
}

.site-footer {
  margin-top: 52px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(2, 6, 23, 0.72);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
  padding-top: 44px;
  padding-bottom: 32px;
}

.footer-grid p {
  max-width: 520px;
  color: var(--muted);
  margin-top: 16px;
  line-height: 1.8;
}

.footer-logo {
  font-size: 1.1rem;
}

.footer-links {
  display: grid;
  gap: 9px;
  margin-top: 16px;
}

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

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

.footer-bottom {
  padding: 18px 24px 30px;
  color: #64748b;
  text-align: center;
}

[data-filter-hidden="true"] {
  display: none !important;
}

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

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

  .ranking-panel {
    position: static;
  }
}

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

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

  .hero-content,
  .detail-hero-inner {
    grid-template-columns: 1fr;
    gap: 28px;
  }

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

  .hero-carousel,
  .hero-slide,
  .hero-content {
    min-height: auto;
  }

  .hero-slide.is-active {
    padding-top: 24px;
  }

  .hero-controls,
  .hero-category-strip {
    position: static;
    padding-top: 16px;
    padding-bottom: 0;
  }

  .movie-grid,
  .home-grid,
  .compact-grid,
  .category-movie-grid,
  .category-grid,
  .category-list-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

@media (max-width: 560px) {
  .header-inner {
    padding: 0 16px;
  }

  .site-logo span:last-child {
    max-width: 7em;
    overflow: hidden;
    text-overflow: ellipsis;
  }

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

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

  .movie-grid,
  .home-grid,
  .compact-grid,
  .category-movie-grid,
  .category-grid,
  .category-list-grid {
    grid-template-columns: 1fr;
  }

  .wide-rank-link {
    grid-template-columns: 48px 70px minmax(0, 1fr);
    gap: 12px;
    padding: 12px;
  }

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