:root {
  --bg: #f8fafc;
  --panel: #ffffff;
  --text: #111827;
  --muted: #64748b;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --teal: #0f766e;
  --dark: #0f172a;
  --radius: 18px;
  --shadow: 0 14px 35px rgba(15, 23, 42, 0.10);
  --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: var(--bg);
  line-height: 1.65;
}

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, 0.94);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  backdrop-filter: blur(14px);
}

.navbar {
  min-height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 800;
  color: #1f2937;
  white-space: nowrap;
}

.logo-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--teal));
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  color: #475569;
  font-size: 15px;
  font-weight: 600;
}

.nav-links a:hover,
.footer a:hover,
.breadcrumb a:hover {
  color: var(--primary);
}

.header-search {
  position: relative;
  display: flex;
  width: min(280px, 26vw);
}

.header-search input,
.page-search input,
.filter-select {
  width: 100%;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  color: var(--text);
  padding: 0 16px;
  outline: none;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
}

.header-search input:focus,
.page-search input:focus,
.filter-select:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: #eef2ff;
  color: var(--primary-dark);
  font-size: 22px;
}

.mobile-panel {
  display: none;
  padding: 0 0 18px;
}

.mobile-panel a,
.mobile-panel form {
  display: block;
  margin: 12px 0;
}

.hero {
  position: relative;
  min-height: 530px;
  color: #ffffff;
  overflow: hidden;
  background: linear-gradient(120deg, #172554, #1d4ed8, #0f766e);
}

.hero::before {
  content: "";
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 20%, rgba(59, 130, 246, 0.48), transparent 34%),
    radial-gradient(circle at 84% 8%, rgba(20, 184, 166, 0.34), transparent 30%),
    linear-gradient(90deg, rgba(2, 6, 23, 0.82), rgba(15, 23, 42, 0.38));
  z-index: 1;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 700ms ease;
  background-size: cover;
  background-position: center;
}

.hero-slide.is-active {
  opacity: 1;
}

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.84), rgba(2, 6, 23, 0.38), rgba(2, 6, 23, 0.72));
}

.hero-inner {
  position: relative;
  z-index: 2;
  min-height: 530px;
  display: grid;
  grid-template-columns: 1.05fr 0.95fr;
  gap: 42px;
  align-items: center;
  padding: 72px 0;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  padding: 7px 14px;
  color: #bfdbfe;
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(8px);
  font-size: 14px;
}

.hero h1 {
  margin: 18px 0 16px;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.05;
  letter-spacing: -1px;
}

.hero-lead {
  max-width: 720px;
  margin: 0 0 18px;
  color: #dbeafe;
  font-size: clamp(17px, 2vw, 22px);
}

.hero-summary {
  max-width: 660px;
  margin: 0 0 28px;
  color: #e2e8f0;
  font-size: 16px;
}

.hero-actions,
.section-actions,
.filter-row,
.tag-row {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform 180ms ease, box-shadow 180ms ease, background 180ms ease;
}

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

.button-primary {
  background: linear-gradient(135deg, #2563eb, #0f766e);
  color: #ffffff;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.32);
}

.button-ghost {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border-color: rgba(255, 255, 255, 0.25);
  backdrop-filter: blur(10px);
}

.hero-panel {
  align-self: stretch;
  display: grid;
  align-items: end;
}

.hero-card {
  position: relative;
  overflow: hidden;
  min-height: 390px;
  border-radius: 30px;
  background: rgba(255, 255, 255, 0.12);
  box-shadow: 0 32px 70px rgba(2, 6, 23, 0.42);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

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

.hero-card-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 28px;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.9), transparent);
}

.hero-card-content h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.hero-dots {
  display: flex;
  gap: 8px;
  margin-top: 22px;
}

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

.hero-dot.is-active {
  width: 34px;
  background: #ffffff;
}

.section {
  padding: 58px 0;
}

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

.section-title {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.2;
}

.section-desc {
  margin: 8px 0 0;
  color: var(--muted);
}

.grid {
  display: grid;
  gap: 22px;
}

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

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

.movie-card,
.category-card,
.info-card,
.ranking-row,
.detail-panel {
  background: var(--panel);
  border: 1px solid rgba(226, 232, 240, 0.88);
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.movie-card {
  overflow: hidden;
  transition: transform 180ms ease, box-shadow 180ms ease;
}

.movie-card:hover,
.category-card:hover,
.ranking-row:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.poster {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, #172554, #0f766e);
}

.poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 280ms ease;
}

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

.poster::after {
  content: "";
  position: absolute;
  inset: 45% 0 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.78), transparent);
}

.play-badge {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(37, 99, 235, 0.86);
  transform: translate(-50%, -50%) scale(0.92);
  opacity: 0;
  transition: opacity 180ms ease, transform 180ms ease;
}

.movie-card:hover .play-badge {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.poster-meta {
  position: absolute;
  left: 12px;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  display: flex;
  justify-content: space-between;
  gap: 8px;
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

.card-body {
  padding: 16px;
}

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

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

.clamp-2,
.clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.clamp-2 {
  -webkit-line-clamp: 2;
}

.clamp-3 {
  -webkit-line-clamp: 3;
}

.meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-top: 12px;
  color: #64748b;
  font-size: 13px;
}

.chip,
.tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  padding: 5px 10px;
  font-size: 13px;
  font-weight: 700;
}

.tag {
  background: #f1f5f9;
  color: #475569;
}

.category-card {
  padding: 22px;
  min-height: 170px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  overflow: hidden;
  position: relative;
}

.category-card::after {
  content: "";
  position: absolute;
  width: 130px;
  height: 130px;
  border-radius: 999px;
  right: -50px;
  top: -50px;
  background: rgba(37, 99, 235, 0.1);
}

.category-card h2,
.category-card h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

.category-card p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.category-card span {
  margin-top: 18px;
  color: var(--primary);
  font-weight: 800;
}

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

.ranking-row {
  display: grid;
  grid-template-columns: 70px 86px minmax(0, 1fr) auto;
  align-items: center;
  gap: 16px;
  padding: 12px 16px;
}

.rank-num {
  font-size: 28px;
  font-weight: 900;
  color: var(--primary);
}

.rank-poster {
  width: 86px;
  height: 112px;
  object-fit: cover;
  border-radius: 12px;
  background: linear-gradient(135deg, #172554, #0f766e);
}

.rank-title {
  margin: 0 0 6px;
  font-size: 20px;
}

.rank-desc {
  margin: 0;
  color: var(--muted);
}

.rank-hot {
  color: #f97316;
  font-weight: 900;
  white-space: nowrap;
}

.page-hero {
  color: #ffffff;
  background:
    linear-gradient(120deg, rgba(23, 37, 84, 0.94), rgba(30, 64, 175, 0.86), rgba(15, 118, 110, 0.9)),
    radial-gradient(circle at 20% 10%, rgba(96, 165, 250, 0.4), transparent 32%);
  padding: 74px 0;
}

.page-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 56px);
}

.page-hero p {
  max-width: 760px;
  margin: 0;
  color: #dbeafe;
  font-size: 18px;
}

.filter-box {
  margin-top: -32px;
  padding: 22px;
  position: relative;
  z-index: 2;
}

.page-search {
  flex: 1 1 360px;
}

.filter-select {
  flex: 0 0 190px;
  border-radius: 14px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #dbeafe;
  margin-bottom: 18px;
  font-size: 14px;
}

.detail-hero {
  color: #ffffff;
  background:
    linear-gradient(120deg, rgba(2, 6, 23, 0.94), rgba(30, 64, 175, 0.76), rgba(15, 118, 110, 0.82)),
    var(--detail-cover);
  background-size: cover;
  background-position: center;
  padding: 46px 0 70px;
}

.detail-header {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 34px;
  align-items: end;
}

.detail-cover {
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 28px 60px rgba(2, 6, 23, 0.42);
}

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

.detail-title h1 {
  margin: 0 0 16px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.12;
}

.detail-title p {
  max-width: 850px;
  margin: 0 0 18px;
  color: #dbeafe;
  font-size: 18px;
}

.detail-main {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 28px;
  padding: 40px 0 64px;
}

.detail-panel {
  padding: 24px;
  margin-bottom: 24px;
}

.detail-panel h2 {
  margin: 0 0 16px;
  font-size: 26px;
}

.detail-panel p {
  color: #334155;
}

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

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

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  color: #ffffff;
  background: rgba(2, 6, 23, 0.2);
  cursor: pointer;
}

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

.player-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.62), rgba(2, 6, 23, 0.15));
}

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

.player-icon {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  font-size: 38px;
  background: rgba(37, 99, 235, 0.88);
  box-shadow: 0 20px 45px rgba(37, 99, 235, 0.38);
}

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

.side-link {
  display: grid;
  grid-template-columns: 76px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: #f8fafc;
}

.side-link:hover {
  background: #eff6ff;
}

.side-link img {
  width: 76px;
  height: 96px;
  object-fit: cover;
  border-radius: 12px;
}

.side-link strong {
  display: block;
  margin-bottom: 5px;
}

.side-link span {
  color: var(--muted);
  font-size: 13px;
}

.footer {
  background: #111827;
  color: #cbd5e1;
  padding: 46px 0 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 1fr 1fr 1fr;
  gap: 28px;
}

.footer h2,
.footer h3 {
  margin: 0 0 14px;
  color: #ffffff;
}

.footer p,
.footer li {
  color: #94a3b8;
  font-size: 14px;
}

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

.footer-bottom {
  margin-top: 32px;
  padding-top: 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  color: #94a3b8;
  font-size: 14px;
}

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

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

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

  .hero-inner,
  .detail-main {
    grid-template-columns: 1fr;
  }

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

@media (max-width: 768px) {
  .navbar {
    min-height: 62px;
  }

  .nav-links,
  .header-search {
    display: none;
  }

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

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

  .hero,
  .hero-inner {
    min-height: auto;
  }

  .hero-inner {
    grid-template-columns: 1fr;
    padding: 54px 0;
  }

  .hero-card,
  .hero-card img {
    min-height: 300px;
  }

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

  .section-head {
    display: block;
  }

  .section-actions {
    margin-top: 16px;
  }

  .ranking-row {
    grid-template-columns: 42px 72px minmax(0, 1fr);
  }

  .rank-hot {
    grid-column: 3;
  }

  .rank-poster {
    width: 72px;
    height: 94px;
  }

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

  .detail-cover {
    width: min(260px, 72vw);
  }

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

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

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

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

  .filter-select {
    flex: 1 1 100%;
  }

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