:root {
  --amber-50: #fffbeb;
  --amber-100: #fef3c7;
  --amber-400: #fbbf24;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --orange-500: #f97316;
  --orange-600: #ea580c;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-500: #6b7280;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --white: #ffffff;
  --shadow-sm: 0 1px 2px rgba(15, 23, 42, .08);
  --shadow-md: 0 8px 20px rgba(15, 23, 42, .12);
  --shadow-lg: 0 20px 45px rgba(15, 23, 42, .18);
}

* {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
}

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

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

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

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;
  color: var(--white);
  background: linear-gradient(90deg, var(--amber-600), var(--orange-500));
  box-shadow: var(--shadow-md);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: .02em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 2px solid rgba(255, 255, 255, .85);
  border-radius: 12px;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, .18);
}

.brand-text {
  font-size: 20px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  font-weight: 600;
}

.nav-link,
.mobile-link {
  transition: color .2s ease, opacity .2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link:hover,
.mobile-link.is-active {
  color: var(--amber-100);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .14);
  padding: 10px;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--white);
  border-radius: 999px;
}

.mobile-nav {
  display: none;
  padding: 0 16px 16px;
}

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

.mobile-link {
  display: block;
  padding: 10px 0;
  font-weight: 700;
}

.hero-carousel {
  position: relative;
  height: 70vh;
  min-height: 520px;
  overflow: hidden;
  background: #000;
}

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

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, .92), rgba(0, 0, 0, .48) 48%, rgba(0, 0, 0, .16));
}

.hero-content {
  position: absolute;
  left: 50%;
  bottom: 82px;
  transform: translateX(-50%);
  color: var(--white);
}

.hero-content h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 5vw, 64px);
  line-height: 1.1;
  text-shadow: 0 8px 28px rgba(0, 0, 0, .45);
}

.hero-content h2 {
  margin: 0 0 12px;
  max-width: 780px;
  font-size: clamp(28px, 4vw, 58px);
  line-height: 1.1;
  font-weight: 800;
  text-shadow: 0 8px 28px rgba(0, 0, 0, .45);
}

.hero-content p {
  max-width: 780px;
  margin: 0 0 22px;
  font-size: clamp(16px, 2vw, 21px);
  color: #e5e7eb;
}

.hero-meta,
.detail-meta,
.card-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px 16px;
}

.hero-meta {
  margin-bottom: 24px;
}

.hero-meta span,
.detail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 7px 14px;
  color: var(--white);
  background: rgba(245, 158, 11, .92);
  border-radius: 999px;
  font-weight: 700;
}

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

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 24px;
  border-radius: 12px;
  font-weight: 800;
  transition: transform .2s ease, background .2s ease, color .2s ease, box-shadow .2s ease;
}

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

.primary-button:hover {
  background: var(--amber-600);
  transform: translateY(-2px) scale(1.02);
}

.secondary-button {
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, .72);
  background: rgba(255, 255, 255, .12);
  backdrop-filter: blur(8px);
}

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

.hero-control {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: rgba(0, 0, 0, .45);
  font-size: 34px;
  line-height: 1;
  transform: translateY(-50%);
  transition: background .2s ease, transform .2s ease;
}

.hero-control:hover {
  background: rgba(0, 0, 0, .72);
  transform: translateY(-50%) scale(1.06);
}

.hero-control.prev {
  left: 18px;
}

.hero-control.next {
  right: 18px;
}

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

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

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

.hero-search {
  position: absolute;
  right: max(16px, calc((100vw - 1180px) / 2));
  bottom: 34px;
  z-index: 5;
  display: flex;
  overflow: hidden;
  width: min(420px, calc(100% - 32px));
  border-radius: 999px;
  background: rgba(255, 255, 255, .94);
  box-shadow: var(--shadow-lg);
}

.hero-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  padding: 13px 18px;
  outline: 0;
  color: var(--gray-800);
}

.hero-search button {
  border: 0;
  padding: 0 22px;
  color: var(--white);
  background: var(--amber-500);
  font-weight: 800;
}

.main-stack {
  display: grid;
  gap: 64px;
  padding: 52px 0 0;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 24px;
}

.section-icon {
  color: var(--amber-600);
  font-size: 20px;
}

.section-title h2 {
  margin: 0;
  color: var(--gray-800);
  font-size: clamp(24px, 3vw, 34px);
  line-height: 1.2;
}

.section-title p {
  margin: 4px 0 0;
  color: var(--gray-600);
}

.highlight-section,
.soft-section,
.ranking-section {
  padding: clamp(24px, 4vw, 42px);
  border-radius: 34px;
  box-shadow: var(--shadow-md);
}

.highlight-section {
  background: linear-gradient(90deg, var(--amber-50), #fff7ed);
}

.soft-section {
  background: linear-gradient(135deg, #faf5ff, #fdf2f8);
}

.ranking-section {
  background: var(--white);
}

.movie-grid {
  display: grid;
  gap: 18px;
}

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

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

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

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

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

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

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

.poster-wrap {
  position: relative;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  background: linear-gradient(135deg, var(--gray-800), var(--gray-900));
}

.movie-card.large .poster-wrap,
.movie-card.featured .poster-wrap {
  aspect-ratio: 4 / 3;
}

.movie-card.compact .poster-wrap {
  aspect-ratio: 16 / 10;
}

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

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

.duration-pill,
.rank-badge,
.list-rank {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--white);
  font-weight: 800;
}

.duration-pill {
  right: 10px;
  top: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(0, 0, 0, .66);
  font-size: 12px;
}

.rank-badge {
  left: 10px;
  top: 10px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--amber-500);
}

.card-content {
  padding: 14px;
}

.card-content h3 {
  display: -webkit-box;
  min-height: 2.8em;
  margin: 0 0 8px;
  overflow: hidden;
  color: var(--gray-800);
  font-size: 16px;
  line-height: 1.4;
  font-weight: 800;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color .2s ease;
}

.movie-card > a:hover h3 {
  color: var(--amber-600);
}

.card-content p {
  display: -webkit-box;
  min-height: 3em;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--gray-600);
  font-size: 14px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

.card-meta span:first-child {
  color: var(--amber-600);
  font-weight: 800;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.badge {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--amber-600);
  background: var(--amber-50);
  border: 1px solid var(--amber-100);
  font-size: 12px;
  font-weight: 700;
}

.movie-card.featured > a {
  position: relative;
  border: 2px solid var(--amber-400);
  background: var(--gray-900);
}

.movie-card.featured .card-content,
.movie-card.large .card-content {
  color: var(--white);
  background: linear-gradient(0deg, rgba(17, 24, 39, .96), rgba(17, 24, 39, .88));
}

.movie-card.featured h3,
.movie-card.featured p,
.movie-card.large h3,
.movie-card.large p {
  color: var(--white);
}

.horizontal > a {
  display: grid;
  grid-template-columns: 148px minmax(0, 1fr);
  min-height: 132px;
}

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

.horizontal .card-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.horizontal .card-content h3 {
  min-height: 0;
  -webkit-line-clamp: 1;
}

.list-rank {
  left: 10px;
  top: 10px;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--amber-500), var(--orange-600));
}

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

.category-tile,
.category-panel > a {
  display: block;
  height: 100%;
  padding: 22px;
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: transform .2s ease, box-shadow .2s ease, background .2s ease;
}

.category-tile:hover,
.category-panel > a:hover {
  transform: translateY(-4px);
  background: var(--amber-50);
  box-shadow: var(--shadow-md);
}

.category-tile span,
.category-panel h2 {
  display: block;
  margin: 0 0 8px;
  color: var(--gray-800);
  font-size: 20px;
  font-weight: 800;
}

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

.category-panel ul {
  margin: 18px 0;
  padding: 0;
  list-style: none;
}

.category-panel li {
  margin: 6px 0;
  color: var(--gray-700);
  font-size: 14px;
}

.category-panel span {
  color: var(--amber-600);
  font-weight: 800;
}

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

.region-columns h3 {
  margin: 0 0 16px;
  padding-left: 12px;
  border-left: 6px solid var(--amber-500);
  color: var(--gray-700);
  font-size: 22px;
}

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

.ranking-list.full {
  gap: 16px;
}

.section-more {
  margin-top: 24px;
  text-align: center;
}

.page-shell {
  padding: 36px 0 0;
}

.page-hero {
  margin-bottom: 28px;
  padding: clamp(28px, 4vw, 46px);
  border-radius: 30px;
  background: linear-gradient(135deg, var(--white), var(--amber-50));
  box-shadow: var(--shadow-md);
}

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

.page-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.15;
}

.page-hero p {
  max-width: 820px;
  margin: 0;
  color: var(--gray-600);
  font-size: 18px;
}

.page-hero.amber p {
  color: rgba(255, 255, 255, .88);
}

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

.breadcrumb.dark {
  color: rgba(255, 255, 255, .75);
}

.breadcrumb a {
  color: var(--amber-600);
  font-weight: 700;
}

.breadcrumb.dark a {
  color: var(--amber-100);
}

.filter-toolbar {
  display: flex;
  gap: 12px;
  margin: 0 0 24px;
}

.filter-toolbar input,
.filter-toolbar select {
  border: 1px solid var(--gray-200);
  border-radius: 16px;
  background: var(--white);
  outline: 0;
  box-shadow: var(--shadow-sm);
}

.filter-toolbar input {
  flex: 1;
  min-width: 0;
  padding: 14px 18px;
}

.filter-toolbar select {
  min-width: 160px;
  padding: 14px 16px;
}

.empty-state {
  margin: 20px 0;
  padding: 24px;
  border-radius: 18px;
  color: var(--gray-600);
  background: var(--white);
  text-align: center;
  box-shadow: var(--shadow-sm);
}

.player-section {
  padding: 26px 0 34px;
  background: #050505;
}

.player-frame {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #000;
  box-shadow: 0 24px 60px rgba(0, 0, 0, .48);
}

.video-element {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  color: var(--white);
  background: radial-gradient(circle, rgba(0, 0, 0, .1), rgba(0, 0, 0, .54));
  transition: opacity .25s ease, visibility .25s ease;
}

.player-overlay span {
  width: 78px;
  height: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--amber-500);
  box-shadow: 0 12px 36px rgba(245, 158, 11, .35);
  font-size: 34px;
}

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

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

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 300px;
  gap: 32px;
  padding: 36px 0;
}

.detail-main,
.detail-side .side-card {
  border-radius: 24px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

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

.detail-main h1 {
  margin: 0 0 16px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.15;
}

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

.lead-text {
  color: var(--gray-700);
  font-size: 20px;
  font-weight: 700;
}

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

.detail-main p {
  margin: 0 0 12px;
  color: var(--gray-700);
  font-size: 17px;
}

.detail-tags {
  margin-top: 24px;
}

.detail-side {
  display: grid;
  align-content: start;
  gap: 18px;
}

.detail-side > img {
  width: 100%;
  border-radius: 24px;
  box-shadow: var(--shadow-md);
}

.side-card {
  padding: 22px;
}

.side-card h2 {
  margin: 0 0 14px;
  font-size: 22px;
}

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

.side-card a {
  color: var(--amber-600);
  font-weight: 800;
}

.related-section {
  padding-bottom: 28px;
}

.site-footer {
  margin-top: 64px;
  color: #d1d5db;
  background: linear-gradient(90deg, var(--gray-800), var(--gray-900));
}

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

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

.site-footer p {
  margin: 0;
  color: #d1d5db;
}

.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-footer li {
  margin: 8px 0;
}

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

.footer-bottom {
  padding: 18px 16px;
  border-top: 1px solid rgba(255, 255, 255, .1);
  color: #9ca3af;
  text-align: center;
}

[hidden] {
  display: none !important;
}

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

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

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

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

  .menu-toggle {
    display: block;
  }

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

  .hero-content {
    bottom: 128px;
  }

  .hero-search {
    left: 16px;
    right: 16px;
    bottom: 28px;
    width: auto;
  }

  .hero-control {
    display: none;
  }

  .catalog-grid,
  .search-grid,
  .compact-grid,
  .mini-grid,
  .featured-grid,
  .large-grid,
  .category-grid,
  .category-overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .region-columns,
  .movie-list-two,
  .footer-grid,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-side {
    grid-template-columns: 180px minmax(0, 1fr);
    align-items: start;
  }
}

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

  .brand-text {
    font-size: 18px;
  }

  .hero-content {
    bottom: 118px;
  }

  .hero-meta span {
    padding: 6px 10px;
    font-size: 13px;
  }

  .catalog-grid,
  .search-grid,
  .compact-grid,
  .mini-grid,
  .featured-grid,
  .large-grid,
  .category-grid,
  .category-overview {
    gap: 12px;
  }

  .card-content {
    padding: 11px;
  }

  .horizontal > a {
    grid-template-columns: 116px minmax(0, 1fr);
  }

  .filter-toolbar {
    flex-direction: column;
  }

  .filter-toolbar select {
    width: 100%;
  }

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

  .player-frame {
    border-radius: 16px;
  }
}
