:root {
  --slate-950: #020617;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --amber-600: #d97706;
  --amber-500: #f59e0b;
  --amber-400: #fbbf24;
  --orange-500: #f97316;
  --white: #ffffff;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.16);
  --shadow-card: 0 12px 28px rgba(15, 23, 42, 0.11);
  --radius-xl: 1.25rem;
  --radius-2xl: 1.6rem;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--slate-800);
  background: linear-gradient(180deg, var(--slate-50), var(--slate-100));
}

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

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

button,
input {
  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: rgba(15, 23, 42, 0.94);
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(18px);
}

.header-inner {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand {
  display: flex;
  align-items: center;
  gap: 12px;
  flex: 0 0 auto;
}

.brand-mark {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  font-size: 24px;
  font-weight: 800;
  color: var(--white);
  background: linear-gradient(135deg, var(--amber-500), var(--orange-500));
  box-shadow: 0 12px 24px rgba(245, 158, 11, 0.28);
}

.brand-text {
  display: grid;
  line-height: 1.1;
}

.brand-text strong {
  font-size: 22px;
  color: var(--amber-400);
}

.brand-text small {
  margin-top: 4px;
  color: var(--slate-300);
  font-size: 12px;
}

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

.nav-link {
  padding: 10px 14px;
  color: var(--slate-200);
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

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

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

.header-search input,
.large-search input {
  width: 230px;
  padding: 10px 12px;
  color: var(--slate-800);
  border: 1px solid rgba(255, 255, 255, 0.2);
  border-radius: 12px;
  outline: none;
  background: var(--white);
}

.header-search button,
.large-search button {
  padding: 10px 15px;
  border: 0;
  border-radius: 12px;
  color: var(--white);
  cursor: pointer;
  background: var(--amber-500);
  transition: background 0.2s ease, transform 0.2s ease;
}

.header-search button:hover,
.large-search button:hover {
  background: var(--amber-600);
  transform: translateY(-1px);
}

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

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

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transition: opacity 1s ease;
}

.hero-slide-active {
  opacity: 1;
  pointer-events: auto;
}

.hero-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.05);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 72% 34%, rgba(245, 158, 11, 0.32), transparent 28%),
    linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.66) 45%, rgba(2, 6, 23, 0.22)),
    linear-gradient(0deg, rgba(2, 6, 23, 0.96), transparent 44%);
}

.hero-content {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  align-items: center;
  gap: 56px;
  color: var(--white);
}

.hero-copy {
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  margin-bottom: 18px;
  padding: 8px 14px;
  color: var(--amber-400);
  border: 1px solid rgba(251, 191, 36, 0.35);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.54);
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero p {
  max-width: 690px;
  margin: 0 0 26px;
  color: var(--slate-200);
  font-size: clamp(18px, 2vw, 22px);
  line-height: 1.7;
}

.hero-tags,
.detail-meta,
.card-meta,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tags span,
.detail-meta span,
.tag-row span {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  color: var(--white);
}

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

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 14px;
  font-weight: 700;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn {
  color: var(--white);
  background: var(--amber-500);
  box-shadow: 0 12px 26px rgba(245, 158, 11, 0.32);
}

.ghost-btn {
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.1);
}

.primary-btn:hover,
.ghost-btn:hover {
  transform: translateY(-2px) scale(1.02);
}

.hero-poster {
  position: relative;
  overflow: hidden;
  min-height: 440px;
  border-radius: 28px;
  box-shadow: 0 26px 70px rgba(0, 0, 0, 0.35);
  transform: rotate(2deg);
}

.hero-poster img {
  width: 100%;
  height: 100%;
  min-height: 440px;
  object-fit: cover;
}

.hero-poster span,
.cover-play {
  position: absolute;
  inset: 50% auto auto 50%;
  transform: translate(-50%, -50%);
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 999px;
  color: var(--white);
  background: var(--amber-500);
  box-shadow: 0 14px 28px rgba(245, 158, 11, 0.34);
}

.hero-control {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: rgba(0, 0, 0, 0.5);
  cursor: pointer;
  font-size: 34px;
  transform: translateY(-50%);
}

.hero-prev {
  left: 18px;
}

.hero-next {
  right: 18px;
}

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

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

.hero-dots button.active {
  width: 34px;
  background: var(--amber-500);
}

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

.section-heading {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.section-heading span {
  width: 6px;
  height: 34px;
  border-radius: 999px;
  background: var(--amber-500);
}

.section-heading h2 {
  margin: 0;
  color: var(--slate-800);
  font-size: clamp(25px, 3vw, 36px);
}

.section-heading a {
  margin-left: auto;
  color: var(--amber-600);
  font-weight: 700;
}

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

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

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

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

.movie-cover {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: var(--slate-900);
}

.movie-card-wide .movie-cover {
  aspect-ratio: 16 / 10;
}

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

.movie-card:hover .movie-cover img,
.category-large:hover img,
.category-tile:hover img,
.compact-item:hover img {
  transform: scale(1.08);
}

.movie-cover::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 52%;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.86), transparent);
}

.cover-year {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 5px 9px;
  color: var(--white);
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.6);
  font-size: 13px;
}

.cover-play {
  opacity: 0;
  width: 56px;
  height: 56px;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-card:hover .cover-play {
  opacity: 1;
}

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

.movie-card-body h2 {
  min-height: 2.8em;
  margin: 0 0 10px;
  color: var(--slate-800);
  font-size: 18px;
  line-height: 1.35;
}

.movie-card-body p {
  display: -webkit-box;
  min-height: 3.2em;
  margin: 0 0 14px;
  overflow: hidden;
  color: var(--slate-600);
  line-height: 1.6;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-meta span {
  color: var(--slate-600);
  font-size: 13px;
}

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

.tag-row span {
  color: var(--slate-600);
  background: var(--slate-100);
  font-size: 13px;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1.5fr) minmax(300px, 0.8fr);
  gap: 28px;
}

.latest-panel,
.category-panel,
.ranking-side,
.related-panel,
.detail-card {
  border-radius: var(--radius-2xl);
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.latest-panel,
.category-panel,
.ranking-side,
.related-panel {
  padding: 26px;
}

.compact-heading {
  margin-bottom: 20px;
}

.compact-heading h2 {
  font-size: 24px;
}

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

.compact-item {
  display: grid;
  grid-template-columns: auto 96px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 18px;
  background: var(--white);
  transition: background 0.2s ease, transform 0.2s ease;
}

.compact-item:hover {
  background: var(--slate-50);
  transform: translateX(3px);
}

.rank-num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: var(--white);
  border-radius: 999px;
  background: var(--amber-500);
  font-weight: 800;
}

.compact-thumb {
  display: block;
  overflow: hidden;
  aspect-ratio: 4 / 3;
  border-radius: 14px;
  background: var(--slate-900);
}

.compact-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.4s ease;
}

.compact-item h2 {
  margin: 0 0 6px;
  color: var(--slate-800);
  font-size: 16px;
}

.compact-item p {
  display: -webkit-box;
  margin: 0 0 6px;
  overflow: hidden;
  color: var(--slate-600);
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.compact-meta {
  color: var(--slate-500);
  font-size: 13px;
}

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

.category-tile,
.category-large {
  position: relative;
  overflow: hidden;
  display: block;
  min-height: 116px;
  border-radius: 20px;
  color: var(--white);
  background: var(--slate-900);
}

.category-tile img,
.category-large img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
  transition: transform 0.45s ease;
}

.category-tile::after,
.category-large::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.86), rgba(2, 6, 23, 0.18));
}

.category-tile span,
.category-tile strong,
.category-large div {
  position: absolute;
  z-index: 2;
}

.category-tile span {
  left: 16px;
  bottom: 16px;
  font-weight: 800;
}

.category-tile strong {
  top: 14px;
  right: 14px;
  padding: 4px 8px;
  border-radius: 999px;
  background: var(--amber-500);
}

.scroll-row {
  display: grid;
  grid-auto-columns: 230px;
  grid-auto-flow: column;
  gap: 20px;
  overflow-x: auto;
  padding-bottom: 14px;
}

.page-hero {
  padding: 64px 0;
  color: var(--white);
}

.amber-hero {
  background: linear-gradient(135deg, var(--amber-500), var(--orange-500));
}

.slate-hero {
  background:
    radial-gradient(circle at 78% 22%, rgba(245, 158, 11, 0.38), transparent 26%),
    linear-gradient(135deg, var(--slate-900), var(--slate-700));
}

.page-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(34px, 5vw, 54px);
}

.page-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
  line-height: 1.7;
}

.hero-count {
  display: inline-flex;
  margin-top: 18px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.15);
  font-weight: 700;
}

.back-link {
  display: inline-flex;
  margin-bottom: 18px;
  color: rgba(255, 255, 255, 0.86);
  font-weight: 700;
}

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

.category-large {
  min-height: 240px;
  box-shadow: var(--shadow-card);
}

.category-large div {
  left: 26px;
  right: 26px;
  bottom: 26px;
}

.category-large h2 {
  margin: 0 0 8px;
  font-size: 28px;
}

.category-large p {
  margin: 0 0 12px;
  color: var(--slate-200);
  line-height: 1.6;
}

.category-large span {
  display: inline-flex;
  padding: 7px 11px;
  border-radius: 999px;
  background: var(--amber-500);
  font-weight: 800;
}

.category-list {
  align-items: stretch;
}

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

.ranking-list {
  padding: 18px;
  border-radius: var(--radius-2xl);
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.ranking-side {
  position: sticky;
  top: 96px;
}

.ranking-side h2,
.related-panel h2 {
  margin: 0 0 18px;
}

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

.side-grid .movie-card-body p,
.side-grid .tag-row,
.side-grid .card-meta {
  display: none;
}

.detail-top {
  padding: 28px 0 70px;
  background: linear-gradient(180deg, var(--slate-900), var(--slate-50) 360px);
}

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

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

.player-box {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  margin-bottom: 28px;
  border-radius: var(--radius-2xl);
  background: var(--slate-950);
  box-shadow: 0 26px 60px rgba(2, 6, 23, 0.36);
}

.movie-video {
  width: 100%;
  height: 100%;
  background: var(--slate-950);
}

.video-start {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  color: var(--white);
  background: rgba(0, 0, 0, 0.32);
  cursor: pointer;
  transition: background 0.2s ease, opacity 0.2s ease;
}

.video-start span {
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 999px;
  background: var(--amber-500);
  box-shadow: 0 18px 34px rgba(245, 158, 11, 0.35);
  font-size: 34px;
}

.player-box.is-playing .video-start {
  opacity: 0;
  pointer-events: none;
}

.detail-card {
  padding: clamp(24px, 4vw, 42px);
}

.detail-card h1 {
  margin: 0 0 18px;
  color: var(--slate-800);
  font-size: clamp(30px, 4vw, 48px);
}

.detail-meta {
  margin-bottom: 28px;
}

.detail-meta span {
  color: var(--slate-700);
  background: var(--slate-100);
}

.detail-meta span:nth-child(2) {
  color: var(--white);
  background: var(--amber-500);
}

.detail-card section {
  margin-top: 30px;
}

.detail-card h2 {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 0 0 12px;
  color: var(--slate-800);
  font-size: 22px;
}

.detail-card h2::before {
  content: "";
  display: inline-block;
  width: 5px;
  height: 24px;
  border-radius: 999px;
  background: var(--amber-500);
}

.detail-card p {
  margin: 0;
  color: var(--slate-700);
  line-height: 1.9;
  font-size: 17px;
}

.lead-text {
  font-weight: 700;
}

.large-tags span {
  color: var(--slate-700);
  background: var(--slate-100);
}

.related-panel {
  position: sticky;
  top: 96px;
}

.related-list .compact-item {
  grid-template-columns: 90px minmax(0, 1fr);
}

.related-list .rank-num {
  display: none;
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 38px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  padding: 0 12px;
  border-radius: 12px;
  background: var(--white);
  color: var(--slate-700);
  box-shadow: 0 6px 14px rgba(15, 23, 42, 0.08);
}

.pagination a.active,
.pagination a:hover {
  color: var(--white);
  background: var(--amber-500);
}

.search-hero .large-search {
  display: flex;
  width: min(620px, 100%);
  gap: 12px;
  margin-top: 28px;
}

.large-search input {
  flex: 1;
  width: auto;
}

.site-footer {
  padding: 54px 0;
  color: var(--slate-300);
  background: var(--slate-900);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr;
  gap: 32px;
}

.footer-brand {
  color: var(--amber-400);
  font-size: 24px;
  font-weight: 900;
}

.site-footer h2 {
  margin: 0 0 16px;
  color: var(--white);
  font-size: 18px;
}

.site-footer p {
  max-width: 480px;
  color: var(--slate-300);
  line-height: 1.7;
}

.site-footer a:not(.footer-brand) {
  display: block;
  margin: 8px 0;
  color: var(--slate-300);
}

.site-footer a:hover {
  color: var(--amber-400);
}

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

  .hero-content {
    grid-template-columns: 1fr;
  }

  .hero-poster {
    display: none;
  }

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

  .split-section,
  .ranking-layout,
  .detail-grid {
    grid-template-columns: 1fr;
  }

  .ranking-side,
  .related-panel {
    position: static;
  }
}

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

  .header-inner {
    flex-wrap: wrap;
    min-height: 64px;
  }

  .brand-text small {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

  .main-nav {
    display: none;
    flex-basis: 100%;
    order: 5;
    margin: 0;
    padding-bottom: 14px;
  }

  .main-nav.open {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .nav-link {
    text-align: center;
    background: rgba(255, 255, 255, 0.08);
  }

  .hero {
    height: 76vh;
    min-height: 540px;
  }

  .hero-content {
    align-items: end;
    padding-bottom: 90px;
  }

  .hero h1 {
    font-size: 42px;
  }

  .hero p {
    font-size: 16px;
  }

  .hero-control {
    display: none;
  }

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

  .featured-grid,
  .movie-grid,
  .category-large-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

  .compact-item,
  .related-list .compact-item {
    grid-template-columns: 82px minmax(0, 1fr);
  }

  .rank-num {
    display: none;
  }

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

  .detail-top {
    padding-top: 18px;
  }

  .detail-card {
    padding: 24px;
  }

  .search-hero .large-search {
    flex-direction: column;
  }
}
