* {
  box-sizing: border-box;
}

:root {
  --primary-50: #eff6ff;
  --primary-100: #dbeafe;
  --primary-600: #2563eb;
  --primary-700: #1d4ed8;
  --secondary-50: #eef2ff;
  --accent-500: #f59e0b;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-900: #111827;
  --white: #ffffff;
  --radius-lg: 18px;
  --radius-xl: 24px;
  --shadow-sm: 0 6px 18px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 18px 40px rgba(15, 23, 42, 0.12);
  --shadow-dark: 0 24px 70px rgba(0, 0, 0, 0.32);
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--gray-900);
  background: var(--gray-50);
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "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;
}

.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.92);
  border-bottom: 1px solid rgba(229, 231, 235, 0.86);
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(16px);
}

.nav-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 66px;
  gap: 18px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--gray-900);
  white-space: nowrap;
}

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--white);
  background: linear-gradient(135deg, var(--primary-600), #4f46e5);
  border-radius: 999px;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.24);
}

.brand-name {
  font-size: 1.25rem;
  letter-spacing: 0.02em;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--gray-700);
  font-size: 0.96rem;
}

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

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

.nav-link-muted {
  color: var(--gray-500);
  font-size: 0.92rem;
}

.mobile-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: var(--gray-100);
}

.mobile-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: var(--gray-700);
  border-radius: 999px;
}

.mobile-nav {
  display: none;
  padding: 10px 16px 16px;
  background: var(--white);
  border-top: 1px solid var(--gray-200);
}

.mobile-nav.open {
  display: block;
}

.mobile-link {
  display: block;
  padding: 11px 12px;
  color: var(--gray-700);
  border-radius: 12px;
}

.mobile-link:hover {
  color: var(--primary-600);
  background: var(--primary-50);
}

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

.hero-carousel {
  position: relative;
  min-height: 68vh;
  overflow: hidden;
  color: var(--white);
  background: #030712;
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-dark);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transform: scale(1.02);
  transition: opacity 0.55s ease, transform 0.85s ease, visibility 0.55s ease;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

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

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.08)), linear-gradient(0deg, rgba(0, 0, 0, 0.70), transparent 48%);
}

.hero-content {
  position: absolute;
  left: clamp(24px, 6vw, 72px);
  bottom: clamp(96px, 13vh, 140px);
  width: min(680px, calc(100% - 48px));
}

.hero-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.hero-tags a,
.hero-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 12px;
  font-size: 0.88rem;
  font-weight: 700;
  background: rgba(37, 99, 235, 0.92);
  border-radius: 999px;
}

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

.hero-content h1 {
  max-width: 760px;
  margin: 0 0 16px;
  font-size: clamp(2.35rem, 6vw, 4.8rem);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.hero-content p {
  max-width: 680px;
  margin: 0 0 28px;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1rem, 2vw, 1.18rem);
}

.hero-actions,
.pager-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

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

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

.btn-primary {
  color: var(--white);
  background: var(--primary-600);
  box-shadow: 0 14px 25px rgba(37, 99, 235, 0.28);
}

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

.btn-ghost {
  color: var(--white);
  background: rgba(255, 255, 255, 0.16);
  border-color: rgba(255, 255, 255, 0.26);
  backdrop-filter: blur(16px);
}

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

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.70);
}

.hero-prev {
  left: 18px;
}

.hero-next {
  right: 18px;
}

.hero-dots {
  position: absolute;
  right: 28px;
  bottom: 28px;
  display: flex;
  gap: 8px;
}

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

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

.hero-search {
  position: absolute;
  left: clamp(24px, 6vw, 72px);
  right: clamp(24px, 6vw, 72px);
  bottom: 30px;
  display: flex;
  gap: 10px;
  max-width: 640px;
  padding: 8px;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  backdrop-filter: blur(18px);
}

.hero-search input,
.inline-search input,
.filter-bar input,
.filter-bar select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  outline: none;
  padding: 0 16px;
  color: var(--gray-900);
  background: var(--white);
}

.hero-search button,
.inline-search button,
.filter-bar button {
  min-height: 42px;
  padding: 0 20px;
  color: var(--white);
  font-weight: 800;
  white-space: nowrap;
  background: var(--primary-600);
  border: 0;
  border-radius: 999px;
}

.section-block {
  padding: 58px 0;
}

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

.section-head h2 {
  margin: 0;
  font-size: clamp(1.55rem, 3vw, 2.05rem);
  line-height: 1.2;
}

.section-head a {
  color: var(--primary-600);
  font-weight: 800;
}

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

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

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

.movie-card {
  min-width: 0;
}

.movie-card-link {
  display: block;
  height: 100%;
  overflow: hidden;
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

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

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

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

.poster-frame::after {
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  content: "";
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.58), transparent);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.movie-card-link:hover .poster-frame::after {
  opacity: 1;
}

.rating-badge,
.type-badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 2px 8px;
  color: var(--white);
  font-size: 0.78rem;
  font-weight: 800;
  border-radius: 8px;
}

.rating-badge {
  top: 10px;
  right: 10px;
  background: rgba(0, 0, 0, 0.70);
}

.type-badge {
  left: 10px;
  bottom: 10px;
  background: var(--primary-600);
}

.movie-card-body {
  padding: 14px;
}

.movie-card-body h2 {
  display: -webkit-box;
  min-height: 2.9em;
  margin: 0 0 8px;
  overflow: hidden;
  color: var(--gray-900);
  font-size: 1rem;
  line-height: 1.45;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color 0.2s ease;
}

.movie-card-link:hover h2 {
  color: var(--primary-600);
}

.movie-meta {
  margin: 0 0 8px;
  color: var(--gray-500);
  font-size: 0.88rem;
}

.movie-line {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--gray-600);
  font-size: 0.9rem;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

.category-tile,
.category-panel {
  overflow: hidden;
  background: linear-gradient(135deg, var(--white), var(--primary-50));
  border: 1px solid rgba(219, 234, 254, 0.92);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.category-tile {
  display: block;
  min-height: 210px;
  padding: 24px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.category-tile strong,
.category-panel h2 {
  display: block;
  margin: 0 0 10px;
  font-size: 1.35rem;
}

.category-tile p,
.category-panel p {
  margin: 0 0 18px;
  color: var(--gray-600);
}

.tile-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tile-preview span,
.genre-tags span,
.tag-cloud a {
  display: inline-flex;
  align-items: center;
  padding: 5px 10px;
  color: var(--primary-700);
  background: var(--primary-50);
  border-radius: 999px;
  font-size: 0.84rem;
  font-weight: 700;
}

.section-tinted {
  padding: 60px 0;
  background: linear-gradient(135deg, var(--primary-50), var(--secondary-50));
}

.two-column {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 32px;
  align-items: start;
}

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

.ranking-item {
  display: grid;
  grid-template-columns: 52px 1fr 76px;
  gap: 14px;
  align-items: center;
  padding: 14px;
  background: var(--white);
  border-radius: 16px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.rank-number,
.rank-large {
  display: grid;
  place-items: center;
  color: var(--primary-600);
  font-size: 1.5rem;
  font-weight: 900;
  background: var(--primary-100);
  border-radius: 14px;
}

.rank-number {
  width: 52px;
  height: 52px;
}

.ranking-copy strong,
.ranking-copy em {
  display: block;
}

.ranking-copy em {
  display: -webkit-box;
  overflow: hidden;
  color: var(--gray-500);
  font-size: 0.9rem;
  font-style: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.ranking-item img {
  width: 76px;
  height: 76px;
  object-fit: cover;
  border-radius: 12px;
}

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

.mini-card {
  display: block;
  padding: 10px;
  background: var(--white);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.mini-card img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 10px;
  margin-bottom: 8px;
}

.mini-card span {
  display: -webkit-box;
  min-height: 2.75em;
  overflow: hidden;
  color: var(--gray-900);
  font-weight: 800;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.mini-card em {
  display: block;
  color: var(--gray-500);
  font-style: normal;
  font-size: 0.84rem;
}

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

.page-hero span {
  display: inline-flex;
  margin-bottom: 12px;
  padding: 5px 12px;
  font-weight: 800;
  background: rgba(255, 255, 255, 0.16);
  border-radius: 999px;
}

.page-hero h1 {
  max-width: 820px;
  margin: 0 0 14px;
  font-size: clamp(2rem, 5vw, 3.7rem);
  line-height: 1.12;
}

.page-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.84);
  font-size: 1.08rem;
}

.inline-search,
.filter-bar {
  display: flex;
  gap: 10px;
  margin-top: 24px;
}

.filter-bar {
  flex-wrap: wrap;
  max-width: 1080px;
}

.filter-bar input {
  flex: 2 1 260px;
}

.filter-bar select {
  flex: 1 1 150px;
}

.category-panels {
  display: grid;
  gap: 26px;
}

.category-panel {
  display: grid;
  grid-template-columns: 0.85fr 1.15fr;
  gap: 24px;
  padding: 26px;
  align-items: center;
}

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

.pager-links {
  justify-content: center;
  margin-top: 36px;
}

.pager-links a {
  padding: 10px 18px;
  color: var(--primary-700);
  font-weight: 800;
  background: var(--primary-50);
  border-radius: 999px;
}

.empty-state {
  padding: 38px;
  text-align: center;
  color: var(--gray-600);
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.rank-stack {
  display: grid;
  gap: 18px;
}

.rank-card a {
  display: grid;
  grid-template-columns: 70px 110px 1fr;
  gap: 18px;
  align-items: center;
  padding: 16px;
  background: var(--white);
  border-radius: 18px;
  box-shadow: var(--shadow-sm);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.rank-large {
  width: 70px;
  height: 70px;
  font-size: 1.8rem;
}

.rank-card img {
  width: 110px;
  height: 110px;
  object-fit: cover;
  border-radius: 14px;
}

.rank-card h2 {
  margin: 0 0 6px;
  font-size: 1.3rem;
}

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

.rank-card strong {
  color: var(--accent-500);
}

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

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 20px;
  color: var(--gray-500);
  font-size: 0.92rem;
}

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

.player-card {
  overflow: hidden;
  background: var(--white);
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-md);
  margin-bottom: 34px;
}

.video-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.movie-player {
  width: 100%;
  height: 100%;
  background: #000000;
}

.player-cover {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  gap: 12px;
  color: var(--white);
  text-align: center;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.66), rgba(0, 0, 0, 0.18));
  border: 0;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

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

.play-circle {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  padding-left: 5px;
  color: var(--white);
  font-size: 2rem;
  background: var(--primary-600);
  border-radius: 999px;
  box-shadow: 0 20px 45px rgba(37, 99, 235, 0.36);
}

.player-cover strong {
  max-width: 80%;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
  line-height: 1.2;
}

.detail-copy {
  padding: 26px 30px 30px;
}

.detail-copy h1 {
  margin: 0 0 12px;
  font-size: clamp(1.9rem, 4vw, 3rem);
  line-height: 1.16;
}

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

.detail-meta span,
.category-pill {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 12px;
  color: var(--primary-700);
  font-weight: 800;
  background: var(--primary-50);
  border-radius: 999px;
}

.lead-text {
  max-width: 940px;
  margin: 0 0 18px;
  color: var(--gray-700);
  font-size: 1.08rem;
}

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

.detail-article,
.side-panel {
  padding: 28px;
  background: var(--white);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
}

.detail-article h2,
.side-panel h2 {
  margin: 0 0 14px;
  font-size: 1.35rem;
}

.detail-article h2:not(:first-child) {
  margin-top: 26px;
}

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

.genre-tags,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
}

.tag-cloud {
  margin-top: 12px;
}

.detail-related {
  padding-bottom: 0;
}

[hidden] {
  display: none !important;
}

@media (max-width: 1120px) {
  .movie-grid,
  .featured-grid,
  .all-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

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

  .mobile-toggle {
    display: block;
  }

  .hero-carousel {
    min-height: 620px;
    border-radius: 0;
  }

  .home-shell {
    width: 100%;
    margin-top: 0;
  }

  .hero-content {
    bottom: 126px;
  }

  .hero-arrow {
    display: none;
  }

  .hero-search,
  .inline-search,
  .filter-bar {
    flex-direction: column;
    align-items: stretch;
    border-radius: 24px;
  }

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

  .detail-grid {
    gap: 18px;
  }

  .side-panel {
    order: 2;
  }
}

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

  .section-block {
    padding: 38px 0;
  }

  .movie-grid,
  .featured-grid,
  .all-grid,
  .mini-grid,
  .compact-mini {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

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

  .hero-content {
    left: 18px;
    bottom: 132px;
    width: calc(100% - 36px);
  }

  .hero-search {
    left: 18px;
    right: 18px;
  }

  .hero-dots {
    right: 18px;
  }

  .rank-card a,
  .ranking-item {
    grid-template-columns: 48px 1fr;
  }

  .rank-card img,
  .ranking-item img {
    display: none;
  }

  .rank-large,
  .rank-number {
    width: 48px;
    height: 48px;
    font-size: 1.25rem;
  }

  .detail-copy,
  .detail-article,
  .side-panel {
    padding: 20px;
  }
}
