:root {
  --bg: #f8fbff;
  --panel: #ffffff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --brand: #2563eb;
  --brand-2: #06b6d4;
  --brand-soft: #eff6ff;
  --dark: #020617;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(135deg, #f8fafc 0%, #eff6ff 48%, #ecfeff 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

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

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.84);
  border-bottom: 1px solid rgba(226, 232, 240, 0.95);
  backdrop-filter: blur(18px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.nav-shell {
  height: 64px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
}

.brand-mark {
  width: 40px;
  height: 40px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.32);
}

.brand-mark.small {
  width: 32px;
  height: 32px;
  border-radius: 10px;
}

.brand-text {
  font-size: 20px;
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #2563eb, #0891b2);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.site-nav a,
.mobile-nav a {
  padding: 10px 14px;
  border-radius: 12px;
  color: #334155;
  font-weight: 700;
  transition: 0.2s ease;
}

.site-nav a:hover,
.mobile-nav a:hover,
.site-nav a.active,
.mobile-nav a.active {
  color: #fff;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.22);
}

.nav-toggle {
  display: none;
  border: 0;
  border-radius: 12px;
  padding: 9px 13px;
  background: #eef6ff;
  color: #0f3f87;
  font-weight: 800;
  cursor: pointer;
}

.mobile-nav {
  display: none;
  padding: 0 16px 16px;
}

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

.hero {
  position: relative;
  min-height: 560px;
  height: 72vh;
  overflow: hidden;
  background: #020617;
}

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

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

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

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.62) 46%, rgba(2, 6, 23, 0.1));
}

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

.hero-copy {
  width: min(680px, 100%);
  color: #fff;
  padding-top: 28px;
}

.eyebrow {
  margin: 0 0 14px;
  color: #22d3ee;
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(42px, 7vw, 74px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.hero p {
  margin: 0;
  color: #dbeafe;
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.8;
}

.hero-meta,
.detail-meta,
.rank-meta,
.movie-card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: #64748b;
}

.hero-meta {
  margin: 24px 0;
  color: #e2e8f0;
}

.hero-meta span,
.detail-meta span,
.rank-meta span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.16);
}

.detail-meta span,
.rank-meta span {
  background: #f1f5f9;
  color: #475569;
}

.hero-actions,
.section-head,
.detail-actions {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  flex-wrap: wrap;
}

.btn,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 999px;
  padding: 12px 20px;
  font-weight: 900;
  transition: 0.22s ease;
}

.btn {
  color: #fff;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.32);
}

.btn:hover {
  transform: translateY(-2px) scale(1.01);
  box-shadow: 0 20px 40px rgba(37, 99, 235, 0.38);
}

.btn-ghost {
  color: #dbeafe;
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
}

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

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

.hero-dot.active {
  width: 34px;
  background: #22d3ee;
}

.section {
  padding: 70px 0 0;
}

.section:last-child {
  padding-bottom: 70px;
}

.section-head {
  margin-bottom: 24px;
}

.section-head h2,
.filter-panel h2,
.category-hero h1,
.detail-title h1,
.page-hero h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.section-head p,
.category-hero p,
.page-hero p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.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));
  gap: 18px;
}

.movie-card {
  min-width: 0;
}

.movie-card[hidden] {
  display: none;
}

.movie-card-link {
  display: block;
  height: 100%;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  transition: 0.24s ease;
}

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

.poster-frame {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #dbeafe, #cffafe);
}

.poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.55s ease;
}

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

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.62));
}

.type-badge,
.score-badge,
.rank-flag {
  position: absolute;
  top: 12px;
  border-radius: 999px;
  padding: 5px 10px;
  color: #fff;
  font-size: 12px;
  font-weight: 900;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(10px);
}

.type-badge {
  left: 12px;
}

.score-badge {
  right: 12px;
  background: linear-gradient(90deg, #f59e0b, #ef4444);
}

.rank-flag {
  left: 12px;
  top: auto;
  bottom: 12px;
  background: linear-gradient(90deg, var(--brand), var(--brand-2));
}

.movie-card-body {
  display: block;
  padding: 16px;
}

.movie-card-meta {
  font-size: 13px;
  margin-bottom: 8px;
}

.movie-card h3 {
  margin: 0 0 9px;
  font-size: 18px;
  line-height: 1.35;
}

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

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag-row span,
.tag-pill {
  display: inline-flex;
  border-radius: 999px;
  padding: 5px 9px;
  color: #0f766e;
  background: #ccfbf1;
  font-size: 12px;
  font-weight: 800;
}

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

.category-card {
  position: relative;
  min-height: 230px;
  overflow: hidden;
  border-radius: 24px;
  background: #020617;
  color: #fff;
  box-shadow: var(--shadow);
}

.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.68;
  transition: transform 0.4s ease;
}

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

.category-card-content {
  position: absolute;
  inset: auto 0 0;
  padding: 22px;
  background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.9));
}

.category-card h3 {
  margin: 0 0 8px;
  font-size: 24px;
}

.category-card p {
  margin: 0;
  color: #dbeafe;
  line-height: 1.65;
}

.filter-panel {
  display: grid;
  grid-template-columns: minmax(220px, 0.7fr) minmax(0, 1.8fr);
  gap: 22px;
  align-items: end;
  margin: 0 0 28px;
  padding: 24px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: 0 12px 26px rgba(15, 23, 42, 0.07);
}

.filter-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 12px;
}

.filter-grid label {
  display: grid;
  gap: 6px;
  color: #334155;
  font-size: 13px;
  font-weight: 900;
}

.filter-grid input,
.filter-grid select {
  width: 100%;
  height: 44px;
  border: 1px solid #dbeafe;
  border-radius: 13px;
  padding: 0 12px;
  outline: none;
  background: #f8fbff;
  color: #0f172a;
}

.filter-grid input:focus,
.filter-grid select:focus {
  border-color: #38bdf8;
  box-shadow: 0 0 0 4px rgba(56, 189, 248, 0.14);
}

.page-hero,
.category-hero {
  padding: 72px 0 42px;
}

.category-hero-card,
.page-hero-card {
  overflow: hidden;
  border-radius: 28px;
  padding: 42px;
  color: #fff;
  background: linear-gradient(135deg, #1d4ed8, #0891b2);
  box-shadow: var(--shadow);
}

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

.rank-row {
  display: grid;
  grid-template-columns: 66px 116px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border-radius: 20px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.07);
}

.rank-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 16px;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  font-size: 18px;
  font-weight: 900;
}

.rank-poster {
  display: block;
  overflow: hidden;
  border-radius: 15px;
  aspect-ratio: 16 / 10;
  background: #dbeafe;
}

.rank-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-content h3 {
  margin: 0 0 7px;
  font-size: 20px;
}

.rank-content p {
  margin: 0 0 10px;
  color: var(--muted);
  line-height: 1.65;
}

.rank-score {
  min-width: 90px;
  text-align: right;
}

.rank-score strong {
  display: block;
  color: #ea580c;
  font-size: 24px;
}

.rank-score span {
  display: block;
  color: var(--muted);
  font-size: 13px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 30px auto 18px;
  color: #64748b;
  font-size: 14px;
}

.breadcrumb a {
  color: #2563eb;
  font-weight: 800;
}

.detail-hero {
  padding-bottom: 58px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(280px, 0.7fr);
  gap: 28px;
}

.player-card,
.detail-side,
.detail-section {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
}

.player-card {
  overflow: hidden;
}

.player-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #020617;
}

.movie-video {
  width: 100%;
  height: 100%;
  display: block;
  background: #020617;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: #020617;
  cursor: pointer;
  transition: 0.28s ease;
}

.player-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.58;
}

.player-cover:after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at center, rgba(34, 211, 238, 0.32), rgba(2, 6, 23, 0.76));
}

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

.play-circle {
  position: relative;
  z-index: 2;
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 0 0 18px rgba(255, 255, 255, 0.16), 0 18px 38px rgba(37, 99, 235, 0.35);
  font-size: 32px;
}

.player-info,
.detail-section,
.detail-side {
  padding: 24px;
}

.detail-title h1 {
  margin-bottom: 14px;
}

.detail-title p {
  color: var(--muted);
  line-height: 1.8;
}

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

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

.detail-section p,
.detail-side p {
  color: #475569;
  line-height: 1.9;
}

.detail-cover {
  overflow: hidden;
  border-radius: 18px;
  aspect-ratio: 3 / 4;
  background: #dbeafe;
  margin-bottom: 18px;
}

.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.site-footer {
  color: #e2e8f0;
  background: linear-gradient(135deg, #0f172a, #1e293b);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 34px;
  padding: 48px 0;
}

.footer-grid h3 {
  margin: 0 0 14px;
  color: #38bdf8;
}

.footer-grid p,
.footer-grid a,
.footer-bottom {
  color: #cbd5e1;
  line-height: 1.8;
}

.footer-grid ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.footer-grid a:hover {
  color: #fff;
}

.footer-bottom {
  padding: 18px 0 28px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  font-size: 14px;
}

.back-top {
  position: fixed;
  right: 24px;
  bottom: 24px;
  z-index: 40;
  width: 46px;
  height: 46px;
  display: none;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--brand), var(--brand-2));
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.28);
  cursor: pointer;
}

.back-top.show {
  display: block;
}

.empty-state {
  display: none;
  padding: 28px;
  text-align: center;
  color: #64748b;
  border: 1px dashed #bfdbfe;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.72);
}

.empty-state.show {
  display: block;
}

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

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

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

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

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

  .hero {
    height: 680px;
  }

  .hero-shade {
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.88), rgba(2, 6, 23, 0.62));
  }

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

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

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

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

  .rank-score {
    grid-column: 3;
    text-align: left;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 24px, 1180px);
  }

  .brand-text {
    font-size: 18px;
  }

  .hero {
    min-height: 620px;
  }

  .hero-meta,
  .detail-meta {
    gap: 7px;
  }

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

  .category-hero-card,
  .page-hero-card {
    padding: 28px;
  }

  .rank-row {
    grid-template-columns: 44px 78px 1fr;
    gap: 12px;
  }

  .rank-content p,
  .rank-meta {
    display: none;
  }
}
