:root {
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-500: #3b82f6;
  --primary-600: #1e40af;
  --primary-700: #1e3a8a;
  --secondary-50: #f0fdf4;
  --secondary-600: #065f46;
  --secondary-700: #064e3b;
  --accent-50: #fef3c7;
  --accent-600: #92400e;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-card: 0 16px 40px rgba(15, 23, 42, 0.12);
  --radius-xl: 1rem;
  --radius-2xl: 1.25rem;
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100%;
  background: var(--gray-50);
  color: var(--gray-900);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.86);
}

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

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

.logo {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.logo-mark {
  width: 38px;
  height: 38px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--primary-600), var(--secondary-600));
  color: var(--white);
  display: grid;
  place-items: center;
  box-shadow: 0 10px 24px rgba(30, 64, 175, 0.24);
}

.logo-name {
  display: block;
  color: var(--primary-600);
  font-size: 20px;
  line-height: 1.1;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.logo-sub {
  display: block;
  margin-top: 2px;
  color: var(--gray-500);
  font-size: 12px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--gray-700);
  font-weight: 600;
}

.main-nav a {
  transition: color 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--primary-600);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 12px;
}

.header-search {
  position: relative;
  width: 220px;
}

.header-search input,
.page-search input {
  width: 100%;
  border: 1px solid var(--gray-300);
  border-radius: 999px;
  background: var(--white);
  color: var(--gray-800);
  outline: none;
  padding: 10px 42px 10px 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input:focus,
.page-search input:focus {
  border-color: var(--primary-500);
  box-shadow: 0 0 0 4px rgba(59, 130, 246, 0.16);
}

.header-search button,
.page-search button {
  position: absolute;
  right: 6px;
  top: 6px;
  width: 32px;
  height: 32px;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: var(--primary-600);
}

.mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--gray-200);
  border-radius: 12px;
  background: var(--white);
  color: var(--gray-700);
  align-items: center;
  justify-content: center;
}

.mobile-menu {
  display: none;
  border-top: 1px solid var(--gray-200);
  padding: 12px 0 18px;
}

.mobile-menu a {
  display: block;
  padding: 10px 0;
  color: var(--gray-700);
  font-weight: 600;
}

.hero-shell {
  background: linear-gradient(135deg, var(--primary-600), var(--secondary-600));
  color: var(--white);
}

.hero-head {
  padding: 56px 0 30px;
  text-align: center;
}

.hero-head h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.hero-head p {
  margin: 0 auto;
  max-width: 760px;
  color: rgba(219, 234, 254, 0.95);
  font-size: clamp(17px, 2vw, 22px);
}

.hero-search {
  position: relative;
  max-width: 620px;
  margin: 26px auto 0;
}

.hero-search input {
  width: 100%;
  border: 0;
  border-radius: 999px;
  padding: 16px 58px 16px 22px;
  outline: none;
  color: var(--gray-900);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.18);
}

.hero-search button {
  position: absolute;
  right: 7px;
  top: 7px;
  bottom: 7px;
  padding: 0 20px;
  border: 0;
  border-radius: 999px;
  background: var(--primary-600);
  color: var(--white);
  font-weight: 800;
}

.hero-carousel {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  box-shadow: 0 30px 70px rgba(0, 0, 0, 0.28);
  background: var(--gray-900);
  transform: translateY(42px);
}

.hero-slide {
  display: none;
  position: relative;
  min-height: 460px;
  aspect-ratio: 21 / 9;
}

.hero-slide.is-active {
  display: block;
}

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

.hero-slide::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.38), rgba(0, 0, 0, 0.12));
}

.hero-content {
  position: absolute;
  left: clamp(24px, 6vw, 64px);
  right: clamp(24px, 6vw, 64px);
  bottom: clamp(24px, 6vw, 58px);
  z-index: 2;
  max-width: 760px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 13px;
  margin-bottom: 14px;
  border-radius: 999px;
  background: var(--primary-500);
  color: var(--white);
  font-size: 14px;
  font-weight: 800;
}

.hero-content h2 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4.5vw, 52px);
  line-height: 1.08;
  font-weight: 900;
}

.hero-content p {
  margin: 0 0 22px;
  color: rgba(243, 244, 246, 0.96);
  font-size: clamp(16px, 2vw, 20px);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
}

.meta-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.16);
  color: var(--white);
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 12px;
  padding: 0 18px;
  border: 1px solid transparent;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.btn:hover {
  transform: translateY(-1px);
}

.btn-primary {
  background: var(--primary-600);
  color: var(--white);
  box-shadow: 0 12px 26px rgba(30, 64, 175, 0.22);
}

.btn-primary:hover {
  background: var(--primary-700);
}

.btn-light {
  background: var(--white);
  color: var(--primary-600);
}

.btn-outline {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.28);
  color: var(--white);
}

.hero-controls button {
  position: absolute;
  top: 50%;
  z-index: 3;
  transform: translateY(-50%);
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.48);
  transition: background 0.2s ease;
}

.hero-controls button:hover {
  background: rgba(0, 0, 0, 0.72);
}

.hero-prev {
  left: 18px;
}

.hero-next {
  right: 18px;
}

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

.hero-dot {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  padding: 0;
  background: rgba(255, 255, 255, 0.55);
  transition: width 0.2s ease, background 0.2s ease;
}

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

.section {
  padding: 74px 0;
}

.section.after-hero {
  padding-top: 116px;
}

.section-soft {
  background: linear-gradient(135deg, var(--secondary-50), var(--primary-50));
}

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

.section-title h2,
.page-title h1 {
  margin: 0;
  color: var(--gray-900);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.18;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.section-title p,
.page-title p {
  margin: 8px 0 0;
  color: var(--gray-600);
  max-width: 720px;
}

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

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

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

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

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

.poster {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, var(--primary-100), var(--secondary-50));
}

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

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

.poster-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  max-width: calc(100% - 20px);
  overflow: hidden;
  border-radius: 999px;
  padding: 5px 10px;
  background: rgba(30, 64, 175, 0.92);
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.card-body {
  padding: 14px;
}

.card-title {
  margin: 0 0 8px;
  color: var(--gray-900);
  font-size: 16px;
  font-weight: 850;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 1;
  overflow: hidden;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--gray-500);
  font-size: 12px;
}

.card-desc {
  margin: 8px 0 0;
  color: var(--gray-600);
  font-size: 13px;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.movie-card.compact a {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px;
  padding: 0;
}

.movie-card.compact .poster {
  aspect-ratio: 3 / 4;
  border-radius: var(--radius-xl) 0 0 var(--radius-xl);
}

.movie-card.compact .card-body {
  padding: 12px 12px 12px 0;
}

.category-card {
  position: relative;
  overflow: hidden;
  min-height: 168px;
  border-radius: var(--radius-2xl);
  padding: 22px;
  background: linear-gradient(135deg, var(--white), var(--primary-50));
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.category-card::after {
  content: "";
  position: absolute;
  right: -40px;
  bottom: -48px;
  width: 140px;
  height: 140px;
  border-radius: 999px;
  background: linear-gradient(135deg, rgba(30, 64, 175, 0.12), rgba(6, 95, 70, 0.12));
}

.category-card h3 {
  position: relative;
  margin: 0 0 10px;
  font-size: 22px;
  font-weight: 900;
}

.category-card p {
  position: relative;
  margin: 0 0 18px;
  color: var(--gray-600);
  font-size: 14px;
}

.category-card span {
  position: relative;
  color: var(--primary-600);
  font-weight: 850;
}

.page-hero {
  background: linear-gradient(135deg, var(--secondary-600), var(--primary-600));
  color: var(--white);
  padding: 58px 0;
}

.page-hero .page-title h1 {
  color: var(--white);
}

.page-hero .page-title p {
  color: rgba(219, 234, 254, 0.96);
}

.toolbar {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) auto;
  gap: 18px;
  align-items: center;
  margin-bottom: 28px;
}

.page-search {
  position: relative;
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 10px;
}

.filter-chip {
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  background: var(--white);
  color: var(--gray-700);
  padding: 9px 14px;
  font-weight: 750;
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease;
}

.filter-chip.is-active,
.filter-chip:hover {
  border-color: var(--primary-600);
  background: var(--primary-600);
  color: var(--white);
}

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

.rank-item {
  display: grid;
  grid-template-columns: 64px 116px minmax(0, 1fr) auto;
  align-items: center;
  gap: 18px;
  background: var(--white);
  border-radius: var(--radius-xl);
  padding: 14px;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-card);
}

.rank-num {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--accent-50), var(--primary-50));
  color: var(--primary-600);
  font-weight: 900;
  font-size: 18px;
}

.rank-cover {
  aspect-ratio: 3 / 4;
  border-radius: 14px;
  overflow: hidden;
  background: var(--primary-50);
}

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

.rank-info h2,
.rank-info h3 {
  margin: 0 0 8px;
  font-size: 20px;
  line-height: 1.3;
  font-weight: 900;
}

.rank-info p {
  margin: 0;
  color: var(--gray-600);
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

.detail-hero {
  background: linear-gradient(135deg, #0f172a, var(--primary-700));
  color: var(--white);
  padding: 34px 0 62px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  color: rgba(255, 255, 255, 0.76);
  font-size: 14px;
}

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

.player-wrap {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-2xl);
  background: #020617;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  border: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.7), rgba(0, 0, 0, 0.08));
  color: var(--white);
  display: grid;
  place-items: center;
  z-index: 2;
}

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

.play-button-inner {
  display: grid;
  place-items: center;
  gap: 12px;
}

.play-icon {
  display: grid;
  place-items: center;
  width: 84px;
  height: 84px;
  border-radius: 999px;
  background: var(--white);
  color: var(--primary-600);
  font-size: 34px;
  box-shadow: 0 16px 44px rgba(0, 0, 0, 0.28);
}

.play-text {
  font-weight: 900;
  font-size: 18px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 30px;
  align-items: start;
}

.detail-main,
.detail-side,
.info-panel {
  background: var(--white);
  border-radius: var(--radius-2xl);
  box-shadow: var(--shadow-soft);
}

.detail-main {
  padding: 28px;
}

.detail-main h1 {
  margin: 0 0 12px;
  color: var(--gray-900);
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.15;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 20px;
}

.detail-meta span,
.tag {
  display: inline-flex;
  border-radius: 999px;
  padding: 6px 11px;
  background: var(--primary-50);
  color: var(--primary-600);
  font-size: 13px;
  font-weight: 750;
}

.detail-main h2 {
  margin: 30px 0 12px;
  color: var(--gray-900);
  font-size: 24px;
  font-weight: 900;
}

.detail-main p {
  margin: 0 0 16px;
  color: var(--gray-700);
  line-height: 1.85;
}

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

.detail-side {
  position: sticky;
  top: 96px;
  padding: 20px;
}

.detail-side h2 {
  margin: 0 0 18px;
  font-size: 22px;
  font-weight: 900;
}

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

.empty-state {
  display: none;
  padding: 40px 20px;
  text-align: center;
  color: var(--gray-600);
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
}

.site-footer {
  background: var(--gray-900);
  color: var(--gray-300);
  padding: 48px 0 36px;
}

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

.footer-title {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--white);
  font-size: 20px;
  font-weight: 900;
}

.footer-grid p {
  max-width: 520px;
  color: var(--gray-300);
}

.footer-grid h3 {
  margin: 0 0 12px;
  color: var(--white);
  font-size: 16px;
}

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

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

.footer-bottom {
  margin-top: 30px;
  padding-top: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #9ca3af;
  font-size: 14px;
}

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

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

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

  .detail-side {
    position: static;
  }
}

@media (max-width: 820px) {
  .main-nav,
  .header-search {
    display: none;
  }

  .mobile-toggle {
    display: flex;
  }

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

  .hero-head {
    padding-top: 42px;
  }

  .hero-slide {
    min-height: 420px;
    aspect-ratio: auto;
  }

  .hero-controls button {
    display: none;
  }

  .section-title,
  .toolbar {
    display: block;
  }

  .filter-row {
    justify-content: flex-start;
    margin-top: 14px;
  }

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

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

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

  .rank-item .btn {
    grid-column: 2 / -1;
    justify-self: start;
  }

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

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

  .logo-sub {
    display: none;
  }

  .hero-carousel {
    border-radius: 0;
    margin-left: -11px;
    margin-right: -11px;
  }

  .hero-content {
    left: 18px;
    right: 18px;
    bottom: 26px;
  }

  .hero-content p {
    -webkit-line-clamp: 3;
  }

  .section {
    padding: 52px 0;
  }

  .section.after-hero {
    padding-top: 96px;
  }

  .grid.movies,
  .grid.categories {
    gap: 14px;
  }

  .card-body {
    padding: 11px;
  }

  .movie-card.compact a {
    grid-template-columns: 76px minmax(0, 1fr);
  }

  .detail-main {
    padding: 20px;
  }
}
