:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.72);
  --panel-solid: #0f172a;
  --line: rgba(148, 163, 184, 0.18);
  --muted: #94a3b8;
  --text: #f8fafc;
  --soft: #cbd5e1;
  --accent: #f59e0b;
  --accent-2: #f97316;
  --green: #22c55e;
  --shadow: 0 26px 70px rgba(0, 0, 0, 0.42);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(245, 158, 11, 0.16), transparent 30%),
    radial-gradient(circle at 82% 18%, rgba(59, 130, 246, 0.18), transparent 28%),
    linear-gradient(180deg, #020617 0%, #0f172a 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: 50;
  border-bottom: 1px solid var(--line);
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.94));
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(1280px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-grid;
  place-items: center;
  border-radius: 16px;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #111827;
  font-weight: 900;
  box-shadow: 0 18px 40px rgba(245, 158, 11, 0.28);
}

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

.brand-text strong {
  font-size: 20px;
  letter-spacing: 0.04em;
}

.brand-text small {
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.nav-links,
.mobile-nav,
.mobile-cats {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link,
.mobile-cats a,
.footer-links a {
  color: var(--soft);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  font-weight: 700;
}

.nav-link:hover,
.mobile-cats a:hover,
.footer-links a:hover {
  color: #fff;
  background: rgba(245, 158, 11, 0.14);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-search,
.mobile-search,
.filter-panel {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search input,
.mobile-search input,
.filter-panel input,
.filter-panel select {
  min-width: 0;
  color: var(--text);
  background: rgba(15, 23, 42, 0.75);
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  outline: none;
  padding: 11px 14px;
}

.header-search input {
  width: 220px;
}

.header-search button,
.mobile-search button,
.hero-actions a,
.section-more,
.player-button,
.back-link {
  border: 0;
  border-radius: 999px;
  color: #111827;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  padding: 11px 18px;
  font-weight: 900;
  cursor: pointer;
  box-shadow: 0 14px 34px rgba(245, 158, 11, 0.26);
}

.hero-actions a.secondary,
.section-more.secondary,
.back-link.secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

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

.mobile-panel {
  display: none;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.92);
}

.hero {
  position: relative;
  min-height: 720px;
  overflow: hidden;
  border-bottom: 1px solid var(--line);
}

.hero-slide {
  display: none;
  position: absolute;
  inset: 0;
  min-height: 720px;
}

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

.hero-image {
  position: absolute;
  inset: 0;
}

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.04);
  transform: scale(1.02);
}

.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.76) 42%, rgba(2, 6, 23, 0.34) 100%),
    linear-gradient(180deg, rgba(2, 6, 23, 0.36) 0%, rgba(2, 6, 23, 0.84) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1280px, calc(100% - 32px));
  min-height: 720px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 390px;
  align-items: center;
  gap: 48px;
  padding: 96px 0 70px;
}

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

.hero-eyebrow,
.page-eyebrow,
.detail-eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #fed7aa;
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 999px;
  padding: 8px 12px;
  font-weight: 800;
}

.hero h1,
.page-hero h1,
.detail-title h1 {
  margin: 22px 0 18px;
  font-size: clamp(42px, 6vw, 76px);
  line-height: 1.03;
  letter-spacing: -0.04em;
}

.hero p,
.page-hero p,
.detail-title p {
  margin: 0;
  color: var(--soft);
  font-size: 18px;
  line-height: 1.8;
}

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

.hero-meta span,
.detail-meta span,
.tag-row span,
.info-tags span {
  border-radius: 999px;
  color: #fed7aa;
  background: rgba(245, 158, 11, 0.12);
  border: 1px solid rgba(245, 158, 11, 0.2);
  padding: 7px 11px;
  font-size: 13px;
  font-weight: 800;
}

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

.hero-side {
  align-self: end;
  border: 1px solid rgba(255, 255, 255, 0.13);
  border-radius: 30px;
  background: rgba(15, 23, 42, 0.62);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
  padding: 18px;
}

.hero-side h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.hero-thumbs {
  display: grid;
  gap: 12px;
}

.hero-thumb {
  display: grid;
  grid-template-columns: 74px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.06);
  cursor: pointer;
  text-align: left;
  color: var(--text);
}

.hero-thumb.is-active,
.hero-thumb:hover {
  border-color: rgba(245, 158, 11, 0.5);
  background: rgba(245, 158, 11, 0.12);
}

.hero-thumb img {
  width: 74px;
  height: 54px;
  object-fit: cover;
  border-radius: 12px;
}

.hero-thumb strong,
.hero-thumb small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-thumb small {
  color: var(--muted);
  margin-top: 4px;
}

.section,
.page-hero,
.detail-layout,
.breadcrumbs,
.player-section {
  width: min(1280px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

.section {
  padding: 56px 0;
}

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

.section-title h2,
.section-title h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.03em;
}

.section-title p {
  margin: 10px 0 0;
  color: var(--muted);
  line-height: 1.75;
}

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.66);
  box-shadow: 0 22px 50px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease, border 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(245, 158, 11, 0.45);
  box-shadow: 0 22px 70px rgba(245, 158, 11, 0.12);
}

.card-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #111827;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 30%, rgba(2, 6, 23, 0.82));
}

.play-icon {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  margin: auto;
  border-radius: 999px;
  color: #111827;
  background: rgba(245, 158, 11, 0.92);
  opacity: 0;
  transform: scale(0.86);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-card:hover .play-icon {
  opacity: 1;
  transform: scale(1);
}

.year-badge,
.rank-badge {
  position: absolute;
  z-index: 3;
  top: 12px;
  right: 12px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.72);
  color: #fff;
  padding: 6px 10px;
  font-size: 12px;
  font-weight: 900;
}

.rank-badge {
  left: 12px;
  right: auto;
  background: linear-gradient(135deg, var(--accent), var(--accent-2));
  color: #111827;
}

.card-body {
  padding: 17px;
}

.card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
}

.card-meta a {
  color: #fed7aa;
  font-weight: 800;
}

.card-body h2 {
  margin: 10px 0 8px;
  font-size: 18px;
  line-height: 1.35;
}

.card-body h2 a:hover {
  color: var(--accent);
}

.card-body p {
  min-height: 48px;
  margin: 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

.tag-row,
.info-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

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

.category-card {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 26px;
  background:
    radial-gradient(circle at top right, rgba(245, 158, 11, 0.16), transparent 42%),
    rgba(15, 23, 42, 0.7);
  box-shadow: 0 18px 44px rgba(0, 0, 0, 0.2);
}

.category-card::before {
  content: "";
  position: absolute;
  inset: auto 20px 20px auto;
  width: 72px;
  height: 72px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.06);
  transform: rotate(14deg);
}

.category-card h2,
.category-card h3 {
  position: relative;
  margin: 0 0 12px;
  font-size: 24px;
}

.category-card p,
.category-card small {
  position: relative;
  color: var(--muted);
  line-height: 1.7;
}

.category-card strong {
  position: relative;
  display: inline-block;
  margin-top: 16px;
  color: #fed7aa;
}

.rank-panel {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(340px, 0.8fr);
  gap: 28px;
}

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

.rank-item a {
  display: grid;
  grid-template-columns: 54px 82px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.64);
  padding: 10px;
}

.rank-item a:hover {
  border-color: rgba(245, 158, 11, 0.4);
  background: rgba(30, 41, 59, 0.78);
}

.rank-num {
  color: var(--accent);
  font-size: 22px;
  font-weight: 950;
  text-align: center;
}

.rank-item img {
  width: 82px;
  height: 58px;
  border-radius: 12px;
  object-fit: cover;
}

.rank-copy strong,
.rank-copy small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-copy small {
  margin-top: 5px;
  color: var(--muted);
}

.page-hero {
  padding: 70px 0 28px;
}

.page-hero-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    radial-gradient(circle at 20% 20%, rgba(245, 158, 11, 0.2), transparent 28%),
    radial-gradient(circle at 80% 10%, rgba(59, 130, 246, 0.2), transparent 30%),
    rgba(15, 23, 42, 0.72);
  padding: clamp(28px, 5vw, 54px);
  box-shadow: var(--shadow);
}

.filter-panel {
  justify-content: space-between;
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.62);
}

.filter-panel input {
  flex: 1;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  padding: 28px 0 0;
  color: var(--muted);
  font-size: 14px;
}

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

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 30px;
  padding: 28px 0 64px;
}

.player-section {
  padding-top: 24px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 30px;
  background: #000;
  box-shadow: var(--shadow);
}

.player-shell video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background-size: cover;
  background-position: center;
  cursor: pointer;
  z-index: 3;
}

.player-cover::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(180deg, rgba(2, 6, 23, 0.2), rgba(2, 6, 23, 0.74)),
    rgba(0, 0, 0, 0.28);
}

.player-cover.is-hidden {
  display: none;
}

.player-button {
  position: relative;
  z-index: 4;
  min-width: 156px;
  border-radius: 999px;
  font-size: 18px;
}

.detail-title {
  margin-top: 24px;
}

.detail-title h1 {
  font-size: clamp(34px, 5vw, 60px);
}

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

.detail-main h2,
.detail-side-card h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.detail-main p {
  margin: 0 0 18px;
  color: var(--soft);
  line-height: 1.95;
  font-size: 16px;
}

.detail-poster {
  border-radius: 24px;
  overflow: hidden;
  border: 1px solid var(--line);
  margin-bottom: 18px;
}

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

.side-related {
  display: grid;
  gap: 12px;
}

.side-related a {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.side-related a:hover {
  border-color: rgba(245, 158, 11, 0.42);
}

.side-related img {
  width: 86px;
  height: 62px;
  object-fit: cover;
  border-radius: 12px;
}

.side-related strong,
.side-related small {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.side-related small {
  color: var(--muted);
  margin-top: 6px;
}

.empty-state {
  display: none;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 24px;
  text-align: center;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.68);
}

.empty-state.is-visible {
  display: block;
}

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

  .hero-content,
  .rank-panel,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .hero-side {
    align-self: auto;
  }
}

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

  .menu-button {
    display: inline-grid;
    place-items: center;
  }

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

  .mobile-nav,
  .mobile-cats {
    flex-wrap: wrap;
    margin-top: 12px;
  }

  .mobile-search input {
    flex: 1;
  }

  .hero,
  .hero-slide,
  .hero-content {
    min-height: 760px;
  }

  .hero-content {
    padding-top: 62px;
    gap: 24px;
  }

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

  .section-head,
  .filter-panel {
    align-items: stretch;
    flex-direction: column;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .section,
  .page-hero,
  .detail-layout,
  .breadcrumbs,
  .player-section {
    width: min(100% - 22px, 1280px);
  }

  .brand-text small {
    display: none;
  }

  .hero h1,
  .page-hero h1,
  .detail-title h1 {
    font-size: 36px;
  }

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

  .rank-item a {
    grid-template-columns: 44px 70px minmax(0, 1fr);
  }

  .rank-item img {
    width: 70px;
    height: 52px;
  }
}
