:root {
  --blue-900: #1e3a8a;
  --blue-800: #1e40af;
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-100: #dbeafe;
  --gray-950: #0f172a;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 8px 20px rgba(15, 23, 42, 0.1);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.16);
  --shadow-xl: 0 25px 60px rgba(15, 23, 42, 0.22);
  --radius-lg: 18px;
  --radius-xl: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--gray-900);
  background: #f9fafb;
  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: 50;
  color: var(--white);
  background: linear-gradient(90deg, #2563eb, #1d4ed8 50%, #1e40af);
  box-shadow: var(--shadow-md);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #1d4ed8;
  background: var(--white);
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.16);
}

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

.nav-link {
  color: rgba(255, 255, 255, 0.9);
  font-weight: 600;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--white);
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  color: var(--white);
  background: transparent;
  border: 0;
  font-size: 28px;
  cursor: pointer;
}

.mobile-nav {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 14px;
}

.mobile-nav a {
  display: block;
  padding: 10px 0;
  color: rgba(255, 255, 255, 0.95);
  font-weight: 600;
}

.hero-carousel {
  position: relative;
  height: 60vh;
  min-height: 460px;
  overflow: hidden;
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8 58%, #2563eb);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 1s ease, visibility 1s ease;
}

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

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

.hero-layer {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.38) 52%, rgba(0, 0, 0, 0.18));
}

.hero-content {
  position: absolute;
  left: 50%;
  bottom: 58px;
  transform: translateX(-50%);
  color: var(--white);
  max-width: 1180px;
}

.eyebrow {
  margin: 0 0 12px;
  color: #bfdbfe;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-content h1 {
  margin: 0 0 18px;
  max-width: 820px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1;
  font-weight: 900;
  animation: fadeIn 0.6s ease both;
}

.hero-desc {
  max-width: 740px;
  margin: 0 0 28px;
  font-size: clamp(17px, 2vw, 22px);
  color: rgba(255, 255, 255, 0.92);
}

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

.primary-btn,
.glass-btn,
.outline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  border-radius: 12px;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn {
  color: var(--white);
  background: var(--blue-600);
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.35);
}

.primary-btn:hover {
  background: var(--blue-700);
  transform: translateY(-2px);
}

.glass-btn {
  color: var(--white);
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}

.glass-btn:hover {
  background: rgba(255, 255, 255, 0.26);
  transform: translateY(-2px);
}

.outline-btn {
  color: var(--blue-700);
  border: 1px solid var(--blue-600);
  background: var(--white);
}

.outline-btn:hover {
  color: var(--white);
  background: var(--blue-600);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.45);
  font-size: 40px;
  line-height: 1;
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.72);
  transform: translateY(-50%) scale(1.06);
}

.hero-prev {
  left: 24px;
}

.hero-next {
  right: 24px;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 22px;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

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

.hero-dot.is-active {
  width: 32px;
  background: var(--white);
}

.section {
  padding: 56px 0;
}

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

.section-head h2 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.2;
}

.section-head p {
  margin: 0;
  color: var(--gray-600);
}

.soft-section {
  margin-left: -16px;
  margin-right: -16px;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: 28px;
}

.green-section {
  background: linear-gradient(90deg, #f0fdf4, #ecfdf5);
}

.blue-section {
  background: linear-gradient(135deg, #eff6ff, #eef2ff 55%, #faf5ff);
}

.ranking-strip {
  margin-left: -16px;
  margin-right: -16px;
  padding-left: 16px;
  padding-right: 16px;
  border-radius: 28px;
  background: linear-gradient(90deg, #fef2f2, #fff7ed, #fefce8);
}

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

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

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

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

.movie-row {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding-bottom: 10px;
  scroll-snap-type: x mandatory;
}

.movie-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-md);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.movie-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #dbeafe;
}

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

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

.cover-play {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 54px;
  height: 54px;
  display: grid;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 999px;
  color: var(--blue-700);
  background: rgba(255, 255, 255, 0.9);
  opacity: 0;
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.movie-info {
  padding: 18px;
}

.movie-meta {
  margin-bottom: 6px;
  color: var(--gray-500);
  font-size: 13px;
}

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

.movie-card h3 a:hover {
  color: var(--blue-600);
}

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

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list span {
  padding: 4px 9px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: 12px;
  font-weight: 700;
}

.movie-card-horizontal {
  display: grid;
  grid-template-columns: 42% 1fr;
  min-height: 180px;
}

.movie-card-horizontal .movie-cover {
  height: 100%;
  aspect-ratio: auto;
}

.movie-card-compact {
  width: 280px;
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.movie-card-compact .movie-info {
  padding: 14px;
}

.movie-card-compact h3 {
  font-size: 16px;
}

.rank-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 3;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: var(--white);
  background: linear-gradient(135deg, #ef4444, #f97316);
  font-weight: 900;
  box-shadow: var(--shadow-md);
}

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

.category-tile {
  position: relative;
  min-height: 220px;
  overflow: hidden;
  border-radius: 20px;
  box-shadow: var(--shadow-lg);
  background: var(--gray-900);
}

.category-tile img {
  width: 100%;
  height: 100%;
  min-height: 220px;
  object-fit: cover;
  transition: transform 0.3s ease;
}

.category-tile:hover img {
  transform: scale(1.1);
}

.category-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.9), rgba(0, 0, 0, 0.46), rgba(0, 0, 0, 0.08));
}

.category-text {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
  color: var(--white);
}

.category-text strong {
  display: block;
  margin-bottom: 8px;
  font-size: 22px;
}

.category-text em {
  display: -webkit-box;
  overflow: hidden;
  color: rgba(255, 255, 255, 0.84);
  font-style: normal;
  font-size: 13px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.page-main {
  min-height: 70vh;
}

.page-hero {
  padding: 82px 0;
  color: var(--white);
  background: linear-gradient(135deg, #1e3a8a, #1d4ed8 55%, #2563eb);
}

.small-hero,
.category-hero,
.ranking-hero {
  position: relative;
  overflow: hidden;
}

.small-hero::after,
.category-hero::after,
.ranking-hero::after {
  content: "";
  position: absolute;
  right: -140px;
  top: -140px;
  width: 360px;
  height: 360px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
}

.page-hero h1 {
  position: relative;
  z-index: 1;
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.1;
}

.page-hero p {
  position: relative;
  z-index: 1;
  max-width: 720px;
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 18px;
}

.category-overview-block {
  padding: 44px 0;
  border-bottom: 1px solid var(--gray-200);
}

.overview-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 22px;
}

.overview-title h2 {
  margin: 0 0 6px;
}

.overview-title p {
  margin: 0;
  color: var(--gray-600);
}

.overview-title a,
.section-more a {
  color: var(--blue-700);
  font-weight: 800;
}

.catalog-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 160px 160px 160px;
  gap: 14px;
  margin-bottom: 26px;
  padding: 18px;
  border-radius: 18px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.catalog-tools label {
  display: grid;
  gap: 6px;
  color: var(--gray-600);
  font-size: 13px;
  font-weight: 700;
}

.catalog-tools input,
.catalog-tools select {
  width: 100%;
  min-height: 44px;
  padding: 0 14px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  color: var(--gray-900);
  background: var(--white);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.catalog-tools input:focus,
.catalog-tools select:focus {
  border-color: var(--blue-600);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.is-hidden-by-filter {
  display: none !important;
}

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

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 24px 0;
  color: var(--gray-600);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--blue-700);
  font-weight: 700;
}

.detail-main {
  background: linear-gradient(180deg, #eff6ff 0, #f9fafb 240px);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 0.9fr);
  gap: 28px;
  align-items: start;
}

.detail-primary,
.detail-side > * {
  overflow: hidden;
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-md);
}

.player-shell {
  position: relative;
  overflow: hidden;
  background: #000;
}

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

.player-start {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  color: var(--white);
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.18));
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-start span {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  padding-left: 5px;
  border-radius: 999px;
  color: var(--blue-700);
  background: rgba(255, 255, 255, 0.92);
  font-size: 38px;
  box-shadow: var(--shadow-lg);
}

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

.player-state {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: none;
  padding: 10px 14px;
  border-radius: 12px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.68);
  text-align: center;
}

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

.detail-content {
  padding: 28px;
}

.detail-content h1 {
  margin: 0 0 14px;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
}

.detail-content h2 {
  margin: 28px 0 10px;
  font-size: 24px;
}

.detail-content p {
  margin: 0 0 12px;
  color: var(--gray-700);
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.detail-meta span {
  padding: 6px 11px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #dbeafe;
  font-weight: 800;
  font-size: 13px;
}

.lead-text {
  font-size: 18px;
  color: var(--gray-800) !important;
}

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

.detail-side {
  display: grid;
  gap: 22px;
}

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

.poster-card div {
  padding: 18px;
}

.poster-card strong {
  display: block;
  margin-bottom: 8px;
  font-size: 22px;
}

.poster-card p {
  margin: 0;
  color: var(--gray-600);
}

.side-panel {
  padding: 18px;
}

.side-panel h2 {
  margin: 0 0 16px;
}

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

.side-list .movie-card-compact {
  width: 100%;
}

.side-list .movie-cover {
  aspect-ratio: 16 / 9;
}

.site-footer {
  margin-top: 50px;
  color: #d1d5db;
  background: var(--gray-900);
}

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

.site-footer h3 {
  margin: 0 0 14px;
  color: var(--white);
}

.site-footer p {
  margin: 0;
  color: #cbd5e1;
}

.footer-links {
  display: grid;
  gap: 8px;
}

.footer-links a:hover {
  color: var(--white);
}

.footer-bottom {
  padding: 22px 0;
  border-top: 1px solid #263244;
  color: #9ca3af;
  text-align: center;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(10px);
  }

  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

  .catalog-tools {
    grid-template-columns: 1fr 1fr;
  }

  .rank-list,
  .double-grid {
    grid-template-columns: 1fr;
  }
}

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

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

  .mobile-nav.is-open {
    display: block;
    animation: fadeIn 0.28s ease both;
  }

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

  .hero-carousel {
    min-height: 520px;
    height: 68vh;
  }

  .hero-content {
    bottom: 68px;
  }

  .hero-arrow {
    width: 42px;
    height: 42px;
    font-size: 32px;
  }

  .hero-prev {
    left: 12px;
  }

  .hero-next {
    right: 12px;
  }

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

  .movie-card-horizontal {
    grid-template-columns: 1fr;
  }

  .catalog-tools {
    grid-template-columns: 1fr;
  }

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

  .overview-title {
    display: block;
  }
}

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

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

  .movie-card-compact {
    width: 250px;
  }

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

  .detail-content {
    padding: 22px;
  }
}
