:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --ink: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --dark: #0f172a;
  --dark-soft: #1e293b;
  --accent: #10b981;
  --accent-strong: #059669;
  --accent-soft: #ecfdf5;
  --blue-soft: #eff6ff;
  --purple-soft: #faf5ff;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: radial-gradient(circle at top left, rgba(16, 185, 129, 0.10), transparent 34rem), var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: #fff;
  background: rgba(15, 23, 42, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.18);
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.logo-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #22c55e);
  box-shadow: 0 12px 24px rgba(16, 185, 129, 0.34);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  font-weight: 650;
}

.desktop-nav a,
.mobile-nav a {
  color: #e2e8f0;
  transition: color 0.2s ease, background 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-nav a:hover,
.mobile-nav a.active {
  color: #34d399;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.08);
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  border-radius: 999px;
  background: #fff;
}

.mobile-nav {
  display: none;
  padding: 0 16px 16px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

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

.mobile-nav a {
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.06);
}

.hero {
  position: relative;
  min-height: 650px;
  overflow: hidden;
  color: #fff;
  background: #020617;
}

.hero-slider {
  position: relative;
  min-height: 650px;
}

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

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

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

.hero-image img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) brightness(0.64);
}

.hero-image::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.95) 0%, rgba(15, 23, 42, 0.72) 42%, rgba(15, 23, 42, 0.20) 100%), linear-gradient(0deg, #020617 0%, transparent 38%);
}

.hero-content {
  position: relative;
  z-index: 2;
  min-height: 650px;
  display: grid;
  align-content: center;
  max-width: 760px;
  padding: 64px 0;
}

.hero-kicker,
.section-kicker {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  gap: 8px;
  padding: 8px 14px;
  border-radius: 999px;
  color: #bbf7d0;
  background: rgba(16, 185, 129, 0.14);
  border: 1px solid rgba(52, 211, 153, 0.28);
  font-size: 14px;
  font-weight: 700;
}

.hero h1 {
  margin: 22px 0 18px;
  font-size: clamp(38px, 7vw, 78px);
  line-height: 1.02;
  letter-spacing: -0.05em;
  font-weight: 900;
}

.hero p {
  max-width: 680px;
  color: #cbd5e1;
  font-size: 18px;
  line-height: 1.85;
}

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

.hero-meta span,
.detail-meta span,
.movie-meta span {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  color: #334155;
  background: #f1f5f9;
  font-size: 13px;
  font-weight: 650;
}

.hero-meta span {
  color: #e2e8f0;
  background: rgba(255, 255, 255, 0.12);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  border: 1px solid transparent;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

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

.button.primary {
  color: #fff;
  background: var(--accent);
  box-shadow: 0 16px 28px rgba(16, 185, 129, 0.28);
}

.button.primary:hover {
  background: var(--accent-strong);
}

.button.ghost {
  color: #fff;
  border-color: rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.10);
}

.button.soft {
  color: #047857;
  background: var(--accent-soft);
}

.hero-tools {
  position: relative;
  z-index: 3;
  margin-top: -78px;
}

.hero-tools-card {
  display: grid;
  grid-template-columns: minmax(0, 1.3fr) minmax(280px, 0.7fr);
  gap: 18px;
  padding: 18px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.hero-search {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px;
  border-radius: 18px;
  background: #f8fafc;
  border: 1px solid var(--line);
}

.hero-search input {
  flex: 1;
  min-width: 0;
  height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  color: var(--ink);
  font-size: 16px;
}

.hero-search button {
  border: 0;
}

.quick-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.quick-links a {
  padding: 12px 14px;
  border-radius: 16px;
  color: #0f766e;
  background: var(--accent-soft);
  font-weight: 800;
}

.slider-controls {
  position: absolute;
  right: max(16px, calc((100vw - 1180px) / 2));
  bottom: 118px;
  z-index: 5;
  display: flex;
  gap: 10px;
}

.slider-controls button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 50%;
  color: #fff;
  background: rgba(15, 23, 42, 0.52);
  backdrop-filter: blur(12px);
  font-size: 22px;
}

.main-section {
  padding: 78px 0 0;
}

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

.section-head h2,
.page-title h1,
.detail-info h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.section-head p,
.page-title p,
.category-card p,
.detail-info p,
.content-card p,
.site-footer p {
  color: var(--muted);
  line-height: 1.8;
}

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

.movie-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

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

.movie-poster {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a, #115e59);
}

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

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

.poster-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, 0.78);
  font-size: 12px;
  font-weight: 800;
}

.movie-card-body {
  padding: 18px;
}

.movie-card h3 {
  margin: 8px 0 10px;
  font-size: 19px;
  line-height: 1.35;
  font-weight: 850;
}

.movie-card p {
  min-height: 52px;
  color: var(--muted);
  line-height: 1.65;
  font-size: 14px;
}

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

.tag-row span {
  padding: 5px 9px;
  border-radius: 999px;
  color: #047857;
  background: var(--accent-soft);
  font-size: 12px;
  font-weight: 750;
}

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

.category-card {
  min-height: 260px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  border-radius: 26px;
  background: linear-gradient(145deg, #fff, #f8fafc);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.category-card h2,
.category-card h3 {
  margin: 0 0 12px;
  font-size: 26px;
  font-weight: 900;
}

.category-samples {
  display: grid;
  gap: 8px;
  margin: 16px 0;
}

.category-samples a {
  color: #0f766e;
  font-weight: 700;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 56px 96px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 14px;
  border-radius: 20px;
  background: var(--panel);
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.rank-no {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 15px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #14b8a6);
  font-weight: 900;
}

.rank-item img {
  width: 96px;
  height: 62px;
  object-fit: cover;
  border-radius: 14px;
}

.rank-item h2,
.rank-item h3 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 850;
}

.rank-item p {
  margin: 0;
  color: var(--muted);
  line-height: 1.55;
}

.page-title {
  padding: 54px 0 28px;
}

.toolbar {
  position: sticky;
  top: 72px;
  z-index: 30;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 210px;
  gap: 12px;
  margin-bottom: 24px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.94);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

.toolbar input,
.toolbar select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 15px;
  outline: 0;
  background: #f8fafc;
  color: var(--ink);
}

.detail-main {
  padding: 42px 0 0;
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(320px, 0.8fr);
  gap: 28px;
  align-items: start;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: #020617;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

.watch-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #020617;
}

.watch-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.64));
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.play-toggle {
  width: 86px;
  height: 86px;
  display: grid;
  place-items: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--accent);
  box-shadow: 0 18px 34px rgba(16, 185, 129, 0.36);
  font-size: 34px;
}

.detail-info,
.content-card {
  padding: 26px;
  border-radius: 28px;
  background: var(--panel);
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.content-card {
  margin-top: 28px;
}

.content-card h2 {
  margin: 0 0 14px;
  font-size: 26px;
  font-weight: 900;
}

.content-card h2:not(:first-child) {
  margin-top: 28px;
}

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

.compact-card {
  overflow: hidden;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
}

.compact-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.compact-card span {
  display: block;
  padding: 12px;
  font-weight: 800;
  line-height: 1.45;
}

.empty-state {
  display: none;
  padding: 26px;
  border-radius: 22px;
  color: var(--muted);
  background: #fff;
  text-align: center;
}

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

.site-footer {
  margin-top: 78px;
  padding: 42px 0;
  color: #cbd5e1;
  background: #0f172a;
}

.footer-grid {
  display: flex;
  justify-content: space-between;
  gap: 24px;
}

.site-footer strong {
  display: block;
  margin-bottom: 8px;
  color: #fff;
  font-size: 20px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}

.footer-links a {
  padding: 10px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
}

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

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

  .detail-hero,
  .hero-tools-card {
    grid-template-columns: 1fr;
  }
}

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

  .menu-toggle {
    display: block;
  }

  .hero,
  .hero-slider,
  .hero-content {
    min-height: 590px;
  }

  .hero-tools {
    margin-top: -42px;
  }

  .slider-controls {
    bottom: 84px;
  }

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

  .toolbar {
    top: 72px;
    grid-template-columns: 1fr;
  }

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

  .rank-item .button {
    grid-column: 1 / -1;
  }

  .footer-grid {
    flex-direction: column;
  }
}

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

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

  .hero-search button,
  .button {
    width: 100%;
  }

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

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

  .rank-item img {
    display: none;
  }
}
