:root {
  --primary-50: #f0f9ff;
  --primary-100: #e0f2fe;
  --primary-500: #0ea5e9;
  --primary-600: #0284c7;
  --primary-700: #0369a1;
  --secondary-50: #f8fafc;
  --secondary-100: #f1f5f9;
  --secondary-200: #e2e8f0;
  --secondary-300: #cbd5e1;
  --secondary-500: #64748b;
  --secondary-600: #475569;
  --secondary-700: #334155;
  --secondary-800: #1e293b;
  --secondary-900: #0f172a;
  --accent-50: #fffbeb;
  --accent-100: #fef3c7;
  --accent-400: #f59e0b;
  --accent-700: #b45309;
  --radius-xl: 1.25rem;
  --shadow-md: 0 10px 25px rgba(15, 23, 42, 0.08);
  --shadow-lg: 0 20px 45px rgba(15, 23, 42, 0.16);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--secondary-900);
  background: var(--secondary-50);
}

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

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

button,
input,
select {
  font: inherit;
}

.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(16px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.header-inner {
  max-width: 1280px;
  height: 68px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 20px;
}

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

.brand-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  box-shadow: 0 10px 20px rgba(14, 165, 233, 0.28);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-left: auto;
}

.desktop-nav a,
.mobile-panel a {
  padding: 10px 12px;
  border-radius: 12px;
  color: var(--secondary-700);
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active,
.mobile-panel a:hover {
  color: var(--primary-700);
  background: var(--primary-50);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 8px;
}

.header-search input,
.mobile-panel input,
.quick-search-panel input,
.filter-controls input,
.filter-controls select {
  min-width: 0;
  border: 1px solid var(--secondary-300);
  border-radius: 13px;
  padding: 10px 12px;
  background: #fff;
  color: var(--secondary-900);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input:focus,
.mobile-panel input:focus,
.quick-search-panel input:focus,
.filter-controls input:focus,
.filter-controls select:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.16);
}

.header-search button,
.mobile-panel button,
.quick-search-panel button {
  border: 0;
  border-radius: 13px;
  padding: 10px 16px;
  color: #fff;
  background: var(--primary-600);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.header-search button:hover,
.mobile-panel button:hover,
.quick-search-panel button:hover {
  background: var(--primary-700);
  transform: translateY(-1px);
}

.menu-button {
  display: none;
  border: 0;
  border-radius: 12px;
  width: 42px;
  height: 42px;
  background: var(--secondary-100);
  color: var(--secondary-800);
  cursor: pointer;
}

.mobile-panel {
  display: none;
  max-width: 1280px;
  margin: 0 auto;
  padding: 10px 24px 18px;
  border-top: 1px solid var(--secondary-200);
}

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

.mobile-panel form {
  display: flex;
  gap: 8px;
}

.mobile-panel input {
  width: 100%;
}

.hero {
  position: relative;
  min-height: min(760px, 82vh);
  overflow: hidden;
  background: var(--secondary-900);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.02);
  pointer-events: none;
  transition: opacity 0.7s ease, transform 1.2s ease;
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

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

.hero-mask {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(14, 165, 233, 0.36), transparent 35%),
    linear-gradient(90deg, rgba(15, 23, 42, 0.94) 0%, rgba(15, 23, 42, 0.68) 45%, rgba(15, 23, 42, 0.22) 100%),
    linear-gradient(0deg, rgba(15, 23, 42, 0.98), transparent 58%);
}

.hero-content {
  position: absolute;
  left: max(24px, calc((100% - 1280px) / 2 + 24px));
  bottom: 88px;
  max-width: 760px;
  color: #fff;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 14px;
  border-radius: 999px;
  padding: 8px 12px;
  color: #fde68a;
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(10px);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hero h1,
.page-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1.03;
  letter-spacing: -0.04em;
}

.hero p,
.page-hero p {
  max-width: 760px;
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.82);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.7;
}

.hero-tags,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags span,
.tag-row span {
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--secondary-700);
  background: var(--secondary-100);
  font-size: 13px;
}

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

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

.primary-button,
.ghost-button,
.section-more,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 14px;
  padding: 0 18px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-button {
  color: #fff;
  background: var(--primary-600);
  box-shadow: 0 18px 35px rgba(2, 132, 199, 0.32);
}

.primary-button:hover,
.section-more:hover,
.text-link:hover {
  transform: translateY(-2px);
  background: var(--primary-700);
  color: #fff;
}

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

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

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

.hero-dots button {
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dots button.active {
  width: 34px;
  background: #fff;
}

.quick-search-panel,
.filter-panel,
.content-section,
.category-strip,
.overview-grid,
.detail-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 24px;
}

.quick-search-panel,
.filter-panel {
  display: grid;
  grid-template-columns: 1.15fr 1fr;
  gap: 24px;
  align-items: center;
}

.quick-search-panel h2,
.filter-panel h2 {
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 38px);
}

.quick-search-panel p,
.filter-panel p,
.section-head p,
.category-tile span,
.category-overview-card p,
.movie-info p,
.detail-info p,
.site-footer p {
  color: var(--secondary-600);
  line-height: 1.75;
}

.quick-search-panel form {
  display: flex;
  gap: 10px;
}

.quick-search-panel input {
  width: 100%;
  min-height: 50px;
}

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

.section-head h2 {
  margin: 0 0 6px;
  font-size: clamp(28px, 4vw, 42px);
}

.section-head p {
  margin: 0;
}

.section-more,
.text-link {
  min-height: 40px;
  color: var(--primary-700);
  background: var(--primary-50);
}

.content-section.section-dark {
  max-width: none;
  background: var(--secondary-900);
}

.content-section.section-dark .section-head {
  max-width: 1280px;
  margin-left: auto;
  margin-right: auto;
}

.content-section.section-dark h2,
.content-section.section-dark .movie-info h3 a {
  color: #fff;
}

.content-section.section-dark .section-head p,
.content-section.section-dark .movie-info p {
  color: var(--secondary-300);
}

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

.content-section.section-dark .movie-grid {
  max-width: 1280px;
  margin: 0 auto;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(14, 165, 233, 0.35);
  box-shadow: var(--shadow-lg);
}

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

.poster {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: var(--secondary-200);
}

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

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

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

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(15, 23, 42, 0.58), transparent 55%);
  opacity: 0.78;
}

.rank-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent-400), var(--accent-700));
  box-shadow: 0 12px 25px rgba(180, 83, 9, 0.28);
}

.movie-info {
  padding: 18px;
}

.meta-row,
.card-foot,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 12px;
  color: var(--secondary-500);
  font-size: 13px;
}

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

.movie-info h3 a:hover {
  color: var(--primary-700);
}

.movie-info p {
  display: -webkit-box;
  min-height: 52px;
  margin: 0 0 14px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-foot {
  justify-content: space-between;
  margin-top: 14px;
}

.card-foot a {
  color: var(--primary-700);
  font-weight: 700;
}

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

.category-tile,
.category-overview-card {
  display: grid;
  gap: 10px;
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 22px;
  padding: 22px;
  background: linear-gradient(135deg, #fff, var(--primary-50));
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-tile:hover,
.category-overview-card:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.category-tile strong,
.category-overview-card h2 {
  margin: 0;
  font-size: 22px;
}

.category-overview-card ul {
  margin: 6px 0 10px;
  padding-left: 18px;
  color: var(--secondary-700);
  line-height: 1.8;
}

.category-overview-card li a:hover {
  color: var(--primary-700);
}

.page-hero {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at 10% 20%, rgba(14, 165, 233, 0.36), transparent 28%),
    linear-gradient(135deg, var(--secondary-900), #172554 60%, var(--primary-700));
  color: #fff;
}

.small-hero {
  min-height: 360px;
  display: flex;
  align-items: center;
  padding: 76px max(24px, calc((100% - 1280px) / 2 + 24px));
}

.rank-hero {
  background:
    radial-gradient(circle at 18% 28%, rgba(245, 158, 11, 0.32), transparent 30%),
    linear-gradient(135deg, #111827, #312e81 58%, #0369a1);
}

.filter-panel {
  padding-top: 38px;
  padding-bottom: 24px;
}

.filter-controls {
  display: grid;
  grid-template-columns: 1fr 150px 170px;
  gap: 10px;
}

.page-list {
  padding-top: 24px;
}

.empty-state {
  display: none;
  margin: 34px 0 0;
  border-radius: 18px;
  padding: 28px;
  text-align: center;
  color: var(--secondary-600);
  background: #fff;
  box-shadow: var(--shadow-md);
}

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

.detail-page {
  padding-top: 28px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--secondary-600);
  font-size: 14px;
}

.breadcrumb a:hover {
  color: var(--primary-700);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2.1fr) minmax(320px, 0.9fr);
  gap: 28px;
}

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

.player-card {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: #000;
  box-shadow: 0 26px 60px rgba(15, 23, 42, 0.25);
  aspect-ratio: 16 / 9;
}

.player-card video {
  display: block;
  width: 100%;
  height: 100%;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  border: 0;
  color: #fff;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.68), rgba(2, 6, 23, 0.22));
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.play-icon {
  display: grid;
  place-items: center;
  width: 82px;
  height: 82px;
  border-radius: 999px;
  padding-left: 4px;
  color: #fff;
  background: var(--primary-600);
  box-shadow: 0 18px 40px rgba(2, 132, 199, 0.4);
  font-size: 30px;
}

.player-overlay strong {
  font-size: 20px;
}

.detail-info {
  margin-top: 24px;
  border-radius: 24px;
  padding: 28px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

.detail-info h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 5vw, 48px);
  line-height: 1.15;
}

.detail-info h2,
.detail-side h2 {
  margin: 26px 0 12px;
  font-size: 24px;
}

.detail-meta span {
  border-radius: 999px;
  padding: 6px 10px;
  background: var(--primary-50);
  color: var(--primary-700);
  font-weight: 700;
}

.detail-tags {
  margin: 16px 0;
}

.one-line {
  border-left: 4px solid var(--primary-600);
  border-radius: 14px;
  padding: 16px 18px;
  background: linear-gradient(90deg, var(--primary-50), var(--accent-50));
  color: var(--secondary-900) !important;
  font-weight: 700;
}

.detail-side {
  position: sticky;
  top: 92px;
  align-self: start;
  border-radius: 24px;
  padding: 22px;
  background: #fff;
  box-shadow: var(--shadow-md);
}

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

.side-list .movie-card.horizontal {
  grid-template-columns: 42% 1fr;
  border-radius: 18px;
  box-shadow: none;
  border-color: var(--secondary-200);
}

.side-list .movie-info {
  padding: 12px;
}

.side-list .movie-info h3 {
  font-size: 15px;
}

.side-list .movie-info p,
.side-list .tag-row,
.side-list .card-foot {
  display: none;
}

.site-footer {
  margin-top: 42px;
  padding: 52px 24px 24px;
  color: var(--secondary-300);
  background: var(--secondary-900);
}

.footer-grid {
  max-width: 1280px;
  margin: 0 auto;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 34px;
}

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

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

.site-footer a {
  display: block;
  margin: 10px 0;
  color: var(--secondary-300);
}

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

.footer-bottom {
  max-width: 1280px;
  margin: 34px auto 0;
  border-top: 1px solid rgba(226, 232, 240, 0.12);
  padding-top: 22px;
  text-align: center;
  color: var(--secondary-500);
}

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

  .header-search {
    margin-left: auto;
  }

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

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

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

@media (max-width: 880px) {
  .header-search {
    display: none;
  }

  .header-inner {
    padding: 0 16px;
  }

  .hero {
    min-height: 680px;
  }

  .hero-content {
    left: 20px;
    right: 20px;
    bottom: 78px;
  }

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

  .quick-search-panel form,
  .filter-controls {
    grid-template-columns: 1fr;
  }

  .movie-grid,
  .horizontal-grid,
  .category-grid,
  .overview-grid,
  .footer-grid,
  .detail-layout {
    grid-template-columns: 1fr;
  }

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

  .detail-side {
    position: static;
  }
}

@media (max-width: 560px) {
  .brand,
  .footer-brand {
    font-size: 18px;
  }

  .hero-actions,
  .quick-search-panel form,
  .mobile-panel form {
    flex-direction: column;
  }

  .primary-button,
  .ghost-button,
  .quick-search-panel button,
  .mobile-panel button {
    width: 100%;
  }

  .quick-search-panel,
  .filter-panel,
  .content-section,
  .category-strip,
  .overview-grid,
  .detail-page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .small-hero {
    padding-left: 16px;
    padding-right: 16px;
  }
}
