:root {
  --bg: #fafaf9;
  --surface: #ffffff;
  --surface-soft: #f8fafc;
  --stone: #57534e;
  --muted: #78716c;
  --line: #e7e5e4;
  --blue-900: #0f172a;
  --blue-800: #1e293b;
  --blue-700: #334155;
  --blue-100: #e2e8f0;
  --accent: #d97706;
  --accent-dark: #b45309;
  --accent-soft: #fef3c7;
  --earth: #fdf8f6;
  --shadow-card: 0 4px 6px -1px rgba(0, 0, 0, .10), 0 2px 4px -1px rgba(0, 0, 0, .06);
  --shadow-xl: 0 24px 60px rgba(15, 23, 42, .20);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--blue-900);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, .92);
  border-bottom: 1px solid rgba(231, 229, 228, .85);
  backdrop-filter: blur(18px);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--blue-900);
}

.brand-mark {
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent), #f59e0b);
  color: #fff;
  box-shadow: var(--shadow-card);
}

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

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

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--stone);
  font-weight: 600;
  transition: background .2s ease, color .2s ease;
}

.nav-link:hover,
.nav-link.active {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

.mobile-menu-btn,
.mobile-menu {
  display: none;
}

.hero {
  position: relative;
  min-height: 580px;
  height: 72vh;
  overflow: hidden;
  background: var(--blue-900);
}

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

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

.hero-bg,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
  filter: saturate(1.05);
}

.hero-bg::before,
.poster-wrap::before,
.rank-poster::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 30% 20%, rgba(217, 119, 6, .45), transparent 35%),
    linear-gradient(135deg, #0f172a, #334155 50%, #92400e);
}

.hero-overlay {
  background: linear-gradient(90deg, rgba(15, 23, 42, .92), rgba(15, 23, 42, .58), rgba(15, 23, 42, .08));
}

.hero-content {
  position: relative;
  display: flex;
  height: 100%;
  align-items: center;
}

.hero-copy {
  width: min(720px, 100%);
  color: #fff;
}

.hero-kicker,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #fbbf24;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: .08em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 14px 0 18px;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 1.05;
  letter-spacing: -.05em;
}

.hero-copy p {
  max-width: 680px;
  color: #e7e5e4;
  font-size: 18px;
}

.hero-tags,
.detail-meta,
.meta-row,
.tag-row,
.tag-link-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.hero-tags {
  margin: 24px 0;
}

.hero-tags span,
.detail-meta span,
.tag-row span,
.tag-link-row a {
  border-radius: 999px;
  background: rgba(255, 255, 255, .12);
  padding: 6px 10px;
  color: inherit;
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(10px);
}

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

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

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

.btn-primary {
  background: var(--accent);
  color: #fff;
  box-shadow: 0 12px 30px rgba(217, 119, 6, .35);
}

.btn-primary:hover {
  background: var(--accent-dark);
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, .36);
  color: #fff;
  background: rgba(255, 255, 255, .08);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .16);
  color: #fff;
  font-size: 32px;
  cursor: pointer;
  transform: translateY(-50%);
  backdrop-filter: blur(8px);
}

.hero-arrow.prev {
  left: 24px;
}

.hero-arrow.next {
  right: 24px;
}

.hero-dots {
  position: absolute;
  right: 50%;
  bottom: 28px;
  z-index: 5;
  display: flex;
  gap: 8px;
  transform: translateX(50%);
}

.hero-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, .44);
  cursor: pointer;
}

.hero-dot.active {
  width: 28px;
  background: #fbbf24;
}

.search-panel {
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 18px;
  align-items: center;
  margin-top: -42px;
  margin-bottom: 42px;
  border-radius: 22px;
  background: #fff;
  padding: 18px;
  box-shadow: var(--shadow-xl);
}

.search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: var(--surface-soft);
}

.search-box input,
.filter-input input,
.filter-selects select {
  width: 100%;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 13px 14px;
  color: var(--blue-900);
  font: inherit;
}

.search-box button {
  border: 0;
  background: var(--accent);
  color: #fff;
  padding: 0 22px;
  font-weight: 800;
  cursor: pointer;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: flex-end;
}

.quick-links a,
.section-more {
  border-radius: 999px;
  background: var(--accent-soft);
  padding: 9px 12px;
  color: var(--accent-dark);
  font-weight: 800;
}

.content-section,
.category-strip,
.categories-overview,
.listing-page,
.rank-page,
.detail-main,
.related-section {
  padding: 34px 0;
}

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

.section-heading.compact {
  margin-bottom: 16px;
}

.section-heading h2 {
  margin: 4px 0 4px;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.18;
  letter-spacing: -.03em;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(231, 229, 228, .72);
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow-card);
  transition: transform .22s ease, box-shadow .22s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-xl);
}

.poster-wrap,
.rank-poster {
  position: relative;
  display: block;
  overflow: hidden;
  background: var(--blue-800);
  color: #fff;
}

.poster-wrap {
  aspect-ratio: 3 / 4;
}

.poster-wrap.tall {
  border-radius: 24px;
  box-shadow: var(--shadow-xl);
}

.movie-card.small .poster-wrap {
  aspect-ratio: 16 / 10;
}

.poster-img,
.rank-img {
  position: relative;
  z-index: 1;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform .45s ease;
}

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

.poster-fallback {
  position: absolute;
  inset: 0;
  z-index: 0;
  display: grid;
  place-items: center;
  padding: 24px;
  text-align: center;
  color: rgba(255, 255, 255, .82);
  font-size: 26px;
  font-weight: 900;
  letter-spacing: .05em;
}

.rating,
.duration,
.rank-badge {
  position: absolute;
  z-index: 3;
  border-radius: 999px;
  background: rgba(0, 0, 0, .68);
  color: #fff;
  padding: 5px 8px;
  font-size: 12px;
  font-weight: 800;
  backdrop-filter: blur(8px);
}

.rating {
  top: 10px;
  right: 10px;
  color: #fbbf24;
}

.duration {
  right: 10px;
  bottom: 10px;
}

.rank-badge {
  top: 10px;
  left: 10px;
  background: var(--accent);
}

.play-mask {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .55));
  color: #fff;
  font-size: 42px;
  opacity: 0;
  transition: opacity .2s ease;
}

.movie-card:hover .play-mask {
  opacity: 1;
}

.card-body {
  padding: 15px;
}

.card-body h3 {
  margin: 0 0 8px;
  overflow: hidden;
  font-size: 17px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-body h3 a:hover,
.rank-info h2 a:hover {
  color: var(--accent-dark);
}

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

.meta-row {
  color: var(--muted);
  font-size: 13px;
}

.meta-row span {
  border-radius: 999px;
  background: var(--surface-soft);
  padding: 4px 7px;
}

.tag-row {
  margin-top: 10px;
}

.tag-row span,
.tag-link-row a {
  background: var(--accent-soft);
  color: var(--accent-dark);
}

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

.category-tile,
.category-card {
  border: 1px solid rgba(231, 229, 228, .75);
  border-radius: 18px;
  background: linear-gradient(135deg, #fff, var(--earth));
  box-shadow: var(--shadow-card);
}

.category-tile {
  display: block;
  padding: 18px;
  transition: transform .2s ease, box-shadow .2s ease;
}

.category-tile:hover,
.category-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-xl);
}

.category-tile span,
.category-card h2 {
  display: block;
  margin-bottom: 6px;
  font-size: 18px;
  font-weight: 900;
}

.category-tile small,
.category-card p,
.category-card li {
  color: var(--muted);
  font-size: 13px;
}

.page-hero,
.detail-hero {
  background:
    radial-gradient(circle at 20% 20%, rgba(217, 119, 6, .28), transparent 34%),
    linear-gradient(135deg, var(--blue-700), var(--blue-900));
  color: #fff;
}

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

.page-hero.slim {
  padding: 56px 0;
}

.page-hero h1,
.detail-copy h1 {
  margin: 10px 0 12px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  letter-spacing: -.04em;
}

.page-hero p,
.detail-copy p {
  max-width: 760px;
  color: #e7e5e4;
  font-size: 17px;
}

.category-card {
  overflow: hidden;
  transition: transform .2s ease, box-shadow .2s ease;
}

.category-card-main {
  display: block;
  padding: 22px;
}

.category-index {
  color: var(--accent);
  font-weight: 900;
}

.category-card ul {
  margin: 0;
  padding: 0 22px 22px;
  list-style: none;
}

.category-card li + li {
  margin-top: 8px;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) 2fr;
  gap: 14px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  padding: 16px;
  box-shadow: var(--shadow-card);
}

.filter-input,
.filter-selects label {
  display: grid;
  gap: 5px;
}

.filter-input span,
.filter-selects span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.filter-input input,
.filter-selects select {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--surface-soft);
}

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

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

.rank-row {
  display: grid;
  grid-template-columns: 52px 110px 1fr 90px;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  padding: 14px;
  box-shadow: var(--shadow-card);
}

.rank-number {
  color: var(--accent);
  font-size: 28px;
  font-weight: 900;
  text-align: center;
}

.rank-poster {
  aspect-ratio: 16 / 10;
  border-radius: 14px;
}

.rank-info h2 {
  margin: 0 0 8px;
  font-size: 20px;
}

.rank-info p {
  margin: 0 0 10px;
  color: var(--muted);
}

.heat-score {
  justify-self: end;
  border-radius: 14px;
  background: var(--accent-soft);
  padding: 10px 12px;
  color: var(--accent-dark);
  font-size: 20px;
}

.detail-hero {
  padding: 54px 0;
}

.detail-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 36px;
  align-items: center;
}

.detail-one-line {
  font-size: 19px;
}

.detail-meta {
  margin: 22px 0;
}

.detail-meta span {
  color: #fff;
}

.player-card {
  overflow: hidden;
  border-radius: 24px;
  background: #020617;
  box-shadow: var(--shadow-xl);
}

.video-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  background:
    radial-gradient(circle at 35% 20%, rgba(217, 119, 6, .28), transparent 38%),
    linear-gradient(135deg, #020617, #1e293b);
}

.video-el {
  width: 100%;
  height: 100%;
  background: #020617;
}

.play-large {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  border: 0;
  background: rgba(2, 6, 23, .35);
  color: #fff;
  cursor: pointer;
}

.play-large span {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  font-size: 34px;
  box-shadow: 0 18px 45px rgba(217, 119, 6, .35);
}

.play-large strong {
  font-size: 18px;
}

.video-shell.is-playing .play-large {
  display: none;
}

.player-message {
  position: absolute;
  left: 18px;
  bottom: 18px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .62);
  color: #fff;
  padding: 8px 12px;
  font-size: 13px;
  backdrop-filter: blur(8px);
}

.detail-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 18px;
  margin-top: 28px;
}

.detail-panel {
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  padding: 24px;
  box-shadow: var(--shadow-card);
}

.detail-panel.full {
  grid-column: 1 / -1;
}

.detail-panel h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.detail-panel p {
  margin: 0;
  color: var(--stone);
}

.empty-state {
  border-radius: 18px;
  background: #fff;
  padding: 40px;
  text-align: center;
  color: var(--muted);
  box-shadow: var(--shadow-card);
}

.site-footer {
  margin-top: 40px;
  background: var(--blue-900);
  color: #cbd5e1;
  padding: 44px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
}

.footer-logo {
  margin-bottom: 10px;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

.site-footer h3 {
  margin: 0 0 12px;
  color: #fff;
}

.site-footer a {
  display: block;
  margin: 7px 0;
  color: #cbd5e1;
}

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

[hidden] {
  display: none !important;
}

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

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

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

@media (max-width: 760px) {
  .main-nav {
    display: none;
  }

  .mobile-menu-btn {
    display: inline-grid;
    width: 42px;
    height: 42px;
    place-items: center;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: #fff;
  }

  .mobile-menu.open {
    display: grid;
    gap: 6px;
    border-top: 1px solid var(--line);
    padding: 10px 16px 16px;
    background: #fff;
  }

  .hero {
    min-height: 620px;
  }

  .hero-copy h1 {
    font-size: 40px;
  }

  .hero-arrow {
    display: none;
  }

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

  .search-box {
    grid-template-columns: 1fr;
  }

  .search-box button {
    min-height: 44px;
  }

  .quick-links {
    justify-content: flex-start;
  }

  .section-heading {
    display: block;
  }

  .section-more {
    display: inline-flex;
    margin-top: 12px;
  }

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

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

  .rank-row {
    grid-template-columns: 38px 84px 1fr;
  }

  .heat-score {
    grid-column: 3;
    justify-self: start;
  }

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

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

@media (max-width: 460px) {
  .movie-grid,
  .movie-grid.dense,
  .category-grid,
  .category-card-grid {
    grid-template-columns: 1fr;
  }

  .rank-row {
    grid-template-columns: 1fr;
  }

  .rank-number,
  .heat-score {
    justify-self: start;
  }
}
