*,
*::before,
*::after {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #eff6ff;
  --indigo-soft: #eef2ff;
  --red: #ef4444;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --surface: #ffffff;
  --page: #f9fafb;
  --dark: #0f172a;
  --radius-lg: 24px;
  --radius-md: 16px;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-strong: 0 22px 60px rgba(15, 23, 42, 0.18);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--text);
  background: var(--page);
  line-height: 1.65;
}

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

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

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(16px);
}

.header-inner {
  height: 68px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  color: var(--text);
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), #4f46e5);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.35);
  font-size: 14px;
}

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

.nav-link {
  color: #374151;
  font-weight: 700;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link.is-active {
  color: var(--blue);
}

.mobile-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: transparent;
  padding: 9px;
  cursor: pointer;
}

.mobile-menu-button span {
  display: block;
  height: 2px;
  margin: 6px 0;
  background: #374151;
  border-radius: 999px;
}

.mobile-nav {
  display: none;
  padding: 8px 16px 18px;
  background: #ffffff;
  border-top: 1px solid var(--line);
}

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

.mobile-link {
  padding: 10px 12px;
  border-radius: 12px;
  color: #374151;
  font-weight: 700;
}

.mobile-link:hover {
  background: var(--blue-soft);
  color: var(--blue);
}

.hero {
  position: relative;
  height: 70vh;
  min-height: 520px;
  overflow: hidden;
  background: #000000;
}

.hero-stage,
.hero-slide {
  position: absolute;
  inset: 0;
}

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

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

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.52) 48%, rgba(0, 0, 0, 0.18)),
    linear-gradient(0deg, rgba(15, 23, 42, 0.55), transparent 45%);
}

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

.hero-copy {
  max-width: 680px;
  color: #ffffff;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  padding: 8px 14px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(37, 99, 235, 0.92);
  font-size: 14px;
  font-weight: 700;
}

.hero h1,
.hero h2,
.page-hero h1,
.detail-hero h1 {
  margin: 0 0 18px;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero h1,
.hero h2 {
  font-size: clamp(42px, 7vw, 74px);
}

.hero p,
.page-hero p,
.detail-hero p {
  margin: 0 0 24px;
  font-size: clamp(16px, 2vw, 21px);
  color: rgba(255, 255, 255, 0.86);
}

.hero-tags,
.card-meta,
.tag-cloud,
.pill-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tags span,
.tag-cloud span,
.category-pill {
  display: inline-flex;
  align-items: center;
  padding: 7px 12px;
  border-radius: 999px;
  color: #374151;
  background: #f3f4f6;
  font-size: 14px;
  font-weight: 700;
}

.hero .hero-tags span,
.detail-hero .hero-tags span {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}

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

.primary-button,
.ghost-button,
.search-form button,
.inline-filter button,
.search-tools button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 14px;
  padding: 13px 24px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.primary-button,
.search-form button,
.inline-filter button,
.search-tools button {
  color: #ffffff;
  background: var(--blue);
  box-shadow: 0 18px 30px rgba(37, 99, 235, 0.28);
}

.primary-button:hover,
.search-form button:hover,
.inline-filter button:hover,
.search-tools button:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.ghost-button {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.17);
  backdrop-filter: blur(12px);
}

.ghost-button:hover {
  transform: translateY(-1px);
  background: rgba(255, 255, 255, 0.25);
}

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

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

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

.search-band {
  position: relative;
  z-index: 4;
  margin-top: -44px;
}

.search-panel,
.search-tools,
.inline-filter {
  display: flex;
  align-items: center;
  gap: 16px;
  background: rgba(255, 255, 255, 0.96);
  border-radius: var(--radius-lg);
  padding: 22px;
  box-shadow: var(--shadow-strong);
  backdrop-filter: blur(16px);
}

.search-panel {
  justify-content: space-between;
}

.search-panel h2,
.section-heading h2,
.side-card h2,
.detail-card h2 {
  margin: 0;
  color: var(--text);
}

.search-panel p {
  margin: 4px 0 0;
  color: var(--muted);
}

.search-form,
.inline-filter,
.search-tools {
  min-width: min(540px, 100%);
}

.search-form input,
.inline-filter input,
.search-tools input,
.search-tools select {
  min-width: 0;
  flex: 1;
  height: 48px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  color: var(--text);
  background: #ffffff;
  outline: 0;
}

.search-form input:focus,
.inline-filter input:focus,
.search-tools input:focus,
.search-tools select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.section {
  padding: 68px 0;
}

.section-soft {
  background: linear-gradient(135deg, var(--blue-soft), var(--indigo-soft));
}

.section-heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 28px;
}

.section-heading h2 {
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.15;
}

.section-heading a {
  color: var(--blue);
  font-weight: 800;
}

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

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

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

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

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

.movie-card {
  overflow: hidden;
  border-radius: 18px;
  background: var(--surface);
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.card-poster {
  position: relative;
  height: 248px;
  overflow: hidden;
  background: #dbeafe;
}

.movie-card.compact .card-poster {
  height: 190px;
}

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

.movie-card:hover .card-poster img,
.media-row:hover img,
.category-tile:hover img {
  transform: scale(1.08);
}

.duration-badge,
.rank-badge {
  position: absolute;
  z-index: 2;
  padding: 5px 9px;
  border-radius: 999px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.duration-badge {
  right: 10px;
  bottom: 10px;
  background: rgba(0, 0, 0, 0.72);
}

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

.play-hover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.28);
  font-size: 42px;
  opacity: 0;
  transition: opacity 0.25s ease;
}

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

.card-body {
  padding: 16px;
}

.card-body h2 {
  display: -webkit-box;
  margin: 0 0 8px;
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  line-height: 1.35;
  font-weight: 800;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color 0.2s ease;
}

.movie-card:hover h2 {
  color: var(--blue);
}

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

.card-meta {
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
}

.card-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3f4f6;
}

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

.category-tile {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-tile:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-strong);
}

.category-covers {
  display: grid;
  grid-template-columns: 1.2fr 0.9fr 0.9fr;
  gap: 6px;
  height: 180px;
  overflow: hidden;
  background: #dbeafe;
}

.category-covers img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.category-copy {
  padding: 20px;
}

.category-copy h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.category-copy p {
  margin: 0 0 16px;
  color: var(--muted);
}

.category-copy span {
  color: var(--blue);
  font-weight: 800;
}

.two-column,
.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 0.45fr);
  gap: 34px;
}

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

.media-row a {
  display: flex;
  gap: 14px;
  padding: 12px;
  border-radius: 16px;
  background: #ffffff;
  box-shadow: var(--shadow);
  transition: background 0.2s ease, transform 0.2s ease;
}

.media-row a:hover {
  background: #f8fafc;
  transform: translateY(-2px);
}

.media-row img {
  width: 112px;
  height: 82px;
  flex: 0 0 112px;
  border-radius: 12px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.media-row h3 {
  display: -webkit-box;
  margin: 0 0 4px;
  overflow: hidden;
  font-size: 16px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.media-row p {
  display: -webkit-box;
  margin: 0 0 4px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.media-row span {
  color: #9ca3af;
  font-size: 12px;
  font-weight: 700;
}

.page-hero,
.detail-hero {
  position: relative;
  overflow: hidden;
  color: #ffffff;
  background: linear-gradient(135deg, #111827, #1e3a8a);
}

.page-hero {
  padding: 86px 0 72px;
}

.small-hero {
  background:
    radial-gradient(circle at 20% 20%, rgba(37, 99, 235, 0.65), transparent 32%),
    linear-gradient(135deg, #111827, #1e3a8a);
}

.ranking-hero {
  background:
    radial-gradient(circle at 80% 18%, rgba(239, 68, 68, 0.45), transparent 34%),
    linear-gradient(135deg, #111827, #1d4ed8);
}

.page-hero h1 {
  font-size: clamp(38px, 5vw, 58px);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.75);
  font-weight: 700;
}

.breadcrumb a:hover {
  color: #ffffff;
}

.pill-row {
  margin-top: 24px;
}

.category-pill {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
}

.category-pill:hover {
  background: rgba(255, 255, 255, 0.26);
}

.inline-filter {
  width: min(620px, 100%);
  margin-top: 28px;
  padding: 12px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

.search-tools {
  width: min(820px, 100%);
  margin-top: 28px;
  padding: 12px;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.18);
}

.search-tools select {
  flex: 0 0 190px;
}

.empty-state {
  margin: 40px auto 0;
  padding: 28px;
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.detail-hero {
  min-height: 560px;
  background-image: var(--poster);
  background-size: cover;
  background-position: center;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.84), rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.24)),
    linear-gradient(0deg, rgba(15, 23, 42, 0.86), rgba(15, 23, 42, 0.18));
  backdrop-filter: blur(2px);
}

.detail-hero-inner {
  position: relative;
  z-index: 2;
  padding: 64px 0;
}

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

.detail-cover {
  width: 280px;
  aspect-ratio: 2 / 3;
  border-radius: 24px;
  object-fit: cover;
  box-shadow: var(--shadow-strong);
}

.detail-hero h1 {
  font-size: clamp(36px, 5vw, 64px);
}

.detail-main,
.detail-side {
  min-width: 0;
}

.player-card,
.detail-card,
.side-card {
  border-radius: var(--radius-lg);
  background: #ffffff;
  box-shadow: var(--shadow);
}

.player-card {
  overflow: hidden;
  background: #000000;
}

.player-shell {
  position: relative;
  background: #000000;
}

.movie-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 14px;
  border: 0;
  color: #ffffff;
  text-align: center;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.64), rgba(0, 0, 0, 0.1));
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.player-button {
  width: 86px;
  height: 86px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--blue);
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.35);
  font-size: 30px;
}

.player-overlay strong {
  max-width: min(86%, 720px);
  font-size: 22px;
}

.player-error {
  position: absolute;
  left: 50%;
  top: 50%;
  width: min(90%, 420px);
  padding: 18px;
  border-radius: 16px;
  color: #ffffff;
  text-align: center;
  background: rgba(15, 23, 42, 0.9);
  transform: translate(-50%, -50%);
}

.detail-card {
  margin-top: 24px;
  padding: 28px;
}

.detail-card h2 {
  margin-top: 28px;
  font-size: 24px;
}

.detail-card h2:first-child {
  margin-top: 0;
}

.detail-card p {
  color: #374151;
  font-size: 16px;
}

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

.info-grid div {
  padding: 14px;
  border-radius: 16px;
  background: #f8fafc;
}

.info-grid span {
  display: block;
  color: var(--muted);
  font-size: 12px;
}

.info-grid strong {
  display: block;
  margin-top: 4px;
  color: var(--text);
}

.detail-side {
  position: relative;
}

.side-card {
  position: sticky;
  top: 92px;
  padding: 22px;
}

.related-list .media-row a {
  box-shadow: none;
  border: 1px solid var(--line);
}

.site-footer {
  margin-top: 40px;
  color: #d1d5db;
  background: #111827;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.7fr 0.9fr;
  gap: 34px;
  padding: 48px 0;
}

.footer-brand {
  margin-bottom: 12px;
  color: #ffffff;
}

.site-footer p {
  max-width: 520px;
  margin: 0;
  color: #9ca3af;
}

.site-footer h2 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: 18px;
}

.site-footer a:not(.footer-brand) {
  display: block;
  margin: 7px 0;
  color: #d1d5db;
}

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

.footer-bottom {
  padding: 18px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #9ca3af;
  text-align: center;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1080px) {
  .grid-six,
  .grid-five {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

  .side-card {
    position: static;
  }
}

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

  .mobile-menu-button {
    display: block;
  }

  .hero {
    height: 78vh;
    min-height: 560px;
  }

  .search-panel,
  .search-tools,
  .inline-filter {
    align-items: stretch;
    flex-direction: column;
  }

  .search-form,
  .inline-filter,
  .search-tools {
    width: 100%;
    min-width: 0;
  }

  .search-tools select {
    flex: auto;
  }

  .grid-six,
  .grid-five,
  .grid-four,
  .grid-three {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .category-grid,
  .footer-grid,
  .detail-hero-copy,
  .info-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  .hero-copy {
    padding-right: 6px;
  }

  .section {
    padding: 46px 0;
  }

  .movie-grid {
    gap: 14px;
  }

  .card-poster,
  .movie-card.compact .card-poster {
    height: 220px;
  }

  .card-body {
    padding: 12px;
  }

  .card-body p {
    display: none;
  }

  .media-row img {
    width: 96px;
    height: 72px;
    flex-basis: 96px;
  }

  .player-button {
    width: 68px;
    height: 68px;
  }
}
