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

:root {
  --color-primary: 30 30 35;
  --color-secondary: 45 45 50;
  --color-accent: 70 130 180;
  --color-success: 46 125 50;
  --color-warning: 255 152 0;
  --color-error: 211 47 47;
  --color-text-primary: 240 240 245;
  --color-text-secondary: 180 180 190;
  --color-text-muted: 120 120 130;
  --color-bg-primary: 18 18 22;
  --color-bg-secondary: 25 25 30;
  --color-bg-tertiary: 35 35 40;
  --color-border: 50 50 60;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(70, 130, 180, 0.15), transparent 36rem),
    radial-gradient(circle at top right, rgba(255, 152, 0, 0.08), transparent 30rem),
    rgb(var(--color-bg-primary));
  color: rgb(var(--color-text-primary));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, Helvetica, Arial, "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

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

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgb(var(--color-border));
  background: rgba(25, 25, 30, 0.95);
  backdrop-filter: blur(14px);
}

.nav-container {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 80rem;
  height: 4rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.logo {
  display: inline-flex;
  align-items: center;
  gap: 0.6rem;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.logo-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.15rem;
  height: 2.15rem;
  border-radius: 0.75rem;
  background: rgb(var(--color-accent));
  color: #fff;
  box-shadow: 0 12px 30px rgba(70, 130, 180, 0.34);
}

.logo-text {
  font-size: 1.25rem;
  background: linear-gradient(90deg, rgb(var(--color-text-primary)), rgb(var(--color-accent)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.4rem;
}

.nav-link {
  position: relative;
  color: rgb(var(--color-text-secondary));
  font-size: 0.95rem;
  transition: color 0.2s ease;
}

.nav-link::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -0.45rem;
  height: 2px;
  transform: scaleX(0);
  transform-origin: left;
  background: rgb(var(--color-accent));
  transition: transform 0.2s ease;
}

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

.nav-link:hover::after,
.nav-link.is-active::after {
  transform: scaleX(1);
}

.mobile-toggle {
  display: none;
  width: 2.4rem;
  height: 2.4rem;
  border: 0;
  border-radius: 0.7rem;
  background: rgb(var(--color-bg-tertiary));
  color: rgb(var(--color-text-primary));
}

.mobile-toggle span {
  display: block;
  width: 1.15rem;
  height: 2px;
  margin: 0.22rem auto;
  background: currentColor;
}

.section-container {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 2.3rem 1rem;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-heading.compact {
  margin-bottom: 1rem;
}

.section-title {
  margin: 0;
  background: linear-gradient(90deg, rgb(var(--color-text-primary)), rgb(var(--color-text-secondary)));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  font-size: clamp(1.55rem, 2.5vw, 2.25rem);
  font-weight: 800;
  line-height: 1.2;
}

.section-subtitle {
  max-width: 42rem;
  margin: 0.35rem 0 0;
  color: rgb(var(--color-text-secondary));
}

.home-hero {
  padding-top: 1.4rem;
}

.hero-carousel {
  position: relative;
  height: min(68vh, 600px);
  min-height: 400px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.25rem;
  background: rgb(var(--color-bg-secondary));
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.34);
}

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

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

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

.hero-shade,
.gradient-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.1));
}

.hero-content {
  position: absolute;
  left: clamp(1.2rem, 5vw, 4.6rem);
  bottom: clamp(2rem, 7vw, 5rem);
  max-width: 42rem;
  padding-right: 1rem;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 0.9rem;
  color: rgb(var(--color-accent));
  font-size: 0.9rem;
  font-weight: 700;
  letter-spacing: 0.06em;
}

.hero-content h1,
.page-hero h1,
.detail-info h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(2rem, 5.5vw, 4.6rem);
  font-weight: 900;
  line-height: 1.05;
  text-shadow: 0 12px 32px rgba(0, 0, 0, 0.55);
}

.hero-content p,
.page-hero p,
.lead-text {
  max-width: 46rem;
  margin: 1rem 0 0;
  color: rgb(var(--color-text-secondary));
  font-size: clamp(1rem, 1.8vw, 1.18rem);
  line-height: 1.75;
}

.hero-tags,
.meta-pills,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem;
  margin-top: 1.15rem;
}

.hero-tags span,
.meta-pills span,
.tag-list span {
  display: inline-flex;
  align-items: center;
  min-height: 2rem;
  padding: 0.35rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.1);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  color: rgb(var(--color-text-primary));
  backdrop-filter: blur(10px);
  font-size: 0.86rem;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.8rem;
  margin-top: 1.55rem;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 2.75rem;
  padding: 0.75rem 1.25rem;
  border-radius: 0.75rem;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

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

.btn-primary {
  background: rgb(var(--color-accent));
  color: #fff;
  box-shadow: 0 16px 36px rgba(70, 130, 180, 0.32);
}

.btn-ghost {
  border: 1px solid rgba(255, 255, 255, 0.18);
  background: rgba(255, 255, 255, 0.1);
  color: #fff;
  backdrop-filter: blur(12px);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  display: grid;
  place-items: center;
  width: 3rem;
  height: 3rem;
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.48);
  color: #fff;
  cursor: pointer;
  font-size: 2rem;
  line-height: 1;
  transform: translateY(-50%);
  transition: background 0.2s ease, opacity 0.2s ease;
}

.hero-prev {
  left: 1rem;
}

.hero-next {
  right: 1rem;
}

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

.hero-dots {
  position: absolute;
  right: 1.2rem;
  bottom: 1.2rem;
  z-index: 4;
  display: flex;
  gap: 0.5rem;
}

.hero-dot {
  width: 0.65rem;
  height: 0.65rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.38);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
  width: 1.7rem;
  background: rgb(var(--color-accent));
}

.hero-search {
  display: flex;
  gap: 0.75rem;
  max-width: 46rem;
  margin: -1.5rem auto 0;
  padding: 0.7rem;
  border: 1px solid rgb(var(--color-border));
  border-radius: 1rem;
  background: rgba(25, 25, 30, 0.94);
  backdrop-filter: blur(14px);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.32);
  position: relative;
  z-index: 5;
}

.hero-search input,
.search-box input,
.filter-selects select {
  width: 100%;
  border: 1px solid rgb(var(--color-border));
  border-radius: 0.75rem;
  background: rgb(var(--color-bg-tertiary));
  color: rgb(var(--color-text-primary));
  outline: none;
}

.hero-search input,
.search-box input {
  min-height: 2.85rem;
  padding: 0 1rem;
}

.hero-search button {
  min-width: 6rem;
  border: 0;
  border-radius: 0.75rem;
  background: rgb(var(--color-accent));
  color: #fff;
  cursor: pointer;
  font-weight: 800;
}

.card {
  display: block;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.9rem;
  background: rgb(var(--color-bg-secondary));
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease;
}

.card:hover {
  transform: scale(1.035);
  background: rgb(var(--color-bg-tertiary));
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.45);
}

.poster-wrap {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
}

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

.card:hover .poster-wrap img {
  transform: scale(1.1);
}

.card-info {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: grid;
  gap: 0.25rem;
  padding: 1rem;
}

.card-info strong {
  color: #fff;
  font-size: 1rem;
  line-height: 1.35;
  text-shadow: 0 8px 20px #000;
}

.card-info span,
.card-info small {
  color: rgb(var(--color-text-secondary));
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

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

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

.category-tile {
  display: grid;
  gap: 0.55rem;
  min-height: 8.4rem;
  padding: 1.35rem;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1rem;
  background: linear-gradient(135deg, rgba(70, 130, 180, 0.22), rgba(255, 255, 255, 0.04));
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(70, 130, 180, 0.6);
}

.category-tile strong {
  font-size: 1.2rem;
}

.category-tile span {
  color: rgb(var(--color-text-secondary));
  line-height: 1.65;
}

.category-tile.large {
  min-height: 10rem;
}

.accent-section {
  max-width: none;
  background: rgba(25, 25, 30, 0.5);
}

.accent-section > * {
  max-width: 80rem;
  margin-left: auto;
  margin-right: auto;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 1.4rem;
}

.row-list,
.rank-list,
.rank-card-list {
  display: grid;
  gap: 0.85rem;
}

.movie-row,
.rank-item,
.rank-card {
  display: grid;
  grid-template-columns: 4.6rem minmax(0, 1fr);
  gap: 0.9rem;
  align-items: center;
  padding: 0.75rem;
  border: 1px solid rgba(255, 255, 255, 0.06);
  border-radius: 0.85rem;
  background: rgb(var(--color-bg-secondary));
  transition: background 0.2s ease, transform 0.2s ease;
}

.movie-row:hover,
.rank-item:hover,
.rank-card:hover {
  transform: translateY(-2px);
  background: rgb(var(--color-bg-tertiary));
}

.movie-row img,
.rank-item img,
.rank-card img {
  width: 4.6rem;
  aspect-ratio: 2 / 3;
  border-radius: 0.6rem;
  object-fit: cover;
}

.row-body,
.rank-card-body,
.rank-item span:last-child {
  min-width: 0;
  display: grid;
  gap: 0.2rem;
}

.row-body strong,
.rank-card-body strong,
.rank-item strong {
  overflow: hidden;
  color: #fff;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.row-body em,
.rank-card-body em,
.rank-item em {
  display: -webkit-box;
  overflow: hidden;
  color: rgb(var(--color-text-secondary));
  font-style: normal;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.row-body span,
.rank-card-body small {
  color: rgb(var(--color-text-muted));
  font-size: 0.86rem;
}

.ranking-box {
  align-self: start;
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 1rem;
  background: rgba(25, 25, 30, 0.72);
}

.rank-num {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 2.25rem;
  height: 2.25rem;
  border-radius: 50%;
  background: rgba(70, 130, 180, 0.24);
  color: rgb(var(--color-accent));
  font-weight: 900;
}

.rank-item {
  grid-template-columns: 2.25rem 3.5rem minmax(0, 1fr);
}

.rank-item img {
  width: 3.5rem;
}

.rank-card {
  grid-template-columns: 3rem 5rem minmax(0, 1fr);
}

.rank-card img {
  width: 5rem;
}

.page-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.25rem;
  background:
    linear-gradient(135deg, rgba(70, 130, 180, 0.22), rgba(255, 255, 255, 0.04)),
    rgb(var(--color-bg-secondary));
}

.compact-hero {
  margin-top: 1.2rem;
  padding: clamp(2rem, 6vw, 4.5rem);
}

.filter-panel {
  display: grid;
  gap: 0.85rem;
  margin-bottom: 1.2rem;
  padding: 0.9rem;
  border: 1px solid rgb(var(--color-border));
  border-radius: 1rem;
  background: rgba(25, 25, 30, 0.76);
}

.filter-selects {
  display: grid;
  gap: 0.75rem;
}

.filter-selects select {
  min-height: 2.75rem;
  padding: 0 0.75rem;
}

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

.empty-state {
  display: none;
  padding: 2rem;
  border: 1px solid rgb(var(--color-border));
  border-radius: 1rem;
  background: rgb(var(--color-bg-secondary));
  color: rgb(var(--color-text-secondary));
  text-align: center;
}

.empty-state.is-visible {
  display: block;
}

.detail-top {
  padding-top: 1.2rem;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1rem;
  color: rgb(var(--color-text-muted));
  font-size: 0.92rem;
}

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

.detail-layout {
  display: grid;
  gap: 1.4rem;
  align-items: center;
}

.detail-cover {
  max-width: 22rem;
}

.detail-cover img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.detail-info {
  max-width: 54rem;
}

.player-section {
  padding-top: 0;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.08);
  border-radius: 1.2rem;
  background: #000;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.45);
  aspect-ratio: 16 / 9;
}

.video-player {
  width: 100%;
  height: 100%;
  background: #000;
  object-fit: contain;
  cursor: pointer;
}

.play-layer {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: grid;
  place-content: center;
  gap: 0.7rem;
  border: 0;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.36), rgba(0, 0, 0, 0.78));
  color: #fff;
  cursor: pointer;
  text-align: center;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.play-icon {
  display: inline-grid;
  place-items: center;
  width: 4.2rem;
  height: 4.2rem;
  margin: 0 auto;
  border-radius: 50%;
  background: rgb(var(--color-accent));
  box-shadow: 0 18px 38px rgba(70, 130, 180, 0.35);
  font-size: 1.8rem;
}

.content-card {
  padding: clamp(1.2rem, 3vw, 2rem);
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 1rem;
  background: rgb(var(--color-bg-secondary));
}

.content-card h2 {
  margin: 0 0 0.85rem;
  font-size: 1.35rem;
}

.content-card p {
  margin: 0 0 1.25rem;
  color: rgb(var(--color-text-secondary));
  line-height: 1.85;
}

.next-prev {
  display: grid;
  gap: 0.8rem;
  margin-top: 1rem;
}

.next-prev a {
  padding: 1rem;
  border: 1px solid rgba(255, 255, 255, 0.07);
  border-radius: 0.85rem;
  background: rgb(var(--color-bg-secondary));
  color: rgb(var(--color-text-secondary));
}

.next-prev a:hover {
  color: rgb(var(--color-text-primary));
  background: rgb(var(--color-bg-tertiary));
}

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

.text-page {
  max-width: 58rem;
  color: rgb(var(--color-text-secondary));
  line-height: 1.85;
}

.site-footer {
  margin-top: 2rem;
  border-top: 1px solid rgb(var(--color-border));
  background: rgb(var(--color-bg-secondary));
}

.footer-inner {
  display: grid;
  gap: 1.3rem;
  max-width: 80rem;
  margin: 0 auto;
  padding: 2rem 1rem;
}

.footer-brand p {
  max-width: 38rem;
  color: rgb(var(--color-text-secondary));
  line-height: 1.7;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 1rem;
  color: rgb(var(--color-text-secondary));
}

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

.footer-copy {
  color: rgb(var(--color-text-muted));
  font-size: 0.9rem;
}

@media (min-width: 640px) {
  .section-container {
    padding-left: 1.5rem;
    padding-right: 1.5rem;
  }

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

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

@media (min-width: 768px) {
  .movie-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
    gap: 1.25rem;
  }

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

  .detail-layout {
    grid-template-columns: 18rem minmax(0, 1fr);
  }

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

@media (min-width: 1024px) {
  .nav-container,
  .section-container,
  .footer-inner {
    padding-left: 2rem;
    padding-right: 2rem;
  }

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

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

  .split-section {
    grid-template-columns: minmax(0, 1fr) 24rem;
  }
}

@media (min-width: 1280px) {
  .movie-grid {
    grid-template-columns: repeat(6, minmax(0, 1fr));
  }
}

@media (max-width: 767px) {
  .mobile-toggle {
    display: inline-block;
  }

  .nav-links {
    position: absolute;
    top: 4rem;
    left: 0;
    right: 0;
    display: none;
    flex-direction: column;
    align-items: flex-start;
    gap: 0;
    padding: 0.7rem 1rem 1rem;
    border-bottom: 1px solid rgb(var(--color-border));
    background: rgba(25, 25, 30, 0.98);
  }

  .nav-links.is-open {
    display: flex;
  }

  .nav-link {
    width: 100%;
    padding: 0.75rem 0;
  }

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

  .hero-search {
    flex-direction: column;
    margin-top: 0.8rem;
  }

  .hero-search button {
    min-height: 2.75rem;
  }

  .hero-arrow {
    opacity: 0.82;
  }

  .section-heading {
    display: block;
  }

  .rank-card {
    grid-template-columns: 2.6rem 4.2rem minmax(0, 1fr);
  }
}
