:root {
  --night-950: #081826;
  --night-900: #102a43;
  --night-850: #173653;
  --night-800: #243b53;
  --night-700: #334e68;
  --night-600: #486581;
  --amber-500: #f59e0b;
  --amber-400: #fbbf24;
  --amber-300: #fcd34d;
  --text-main: #f8fafc;
  --text-muted: #cbd5e1;
  --text-soft: #94a3b8;
  --card-border: rgba(251, 191, 36, 0.16);
  --shadow-strong: 0 22px 55px rgba(0, 0, 0, 0.3);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(245, 158, 11, 0.12), transparent 32rem),
    radial-gradient(circle at top right, rgba(72, 101, 129, 0.28), transparent 34rem),
    linear-gradient(180deg, var(--night-950), var(--night-900));
  color: var(--text-main);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
}

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

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: fixed;
  inset: 0 0 auto 0;
  z-index: 60;
  background: rgba(8, 24, 38, 0.88);
  border-bottom: 1px solid rgba(251, 191, 36, 0.12);
  backdrop-filter: blur(16px);
}

.nav-shell {
  height: 72px;
  display: flex;
  align-items: center;
  gap: 22px;
}

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

.brand {
  flex-shrink: 0;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #111827;
  background: linear-gradient(135deg, var(--amber-300), var(--amber-500));
  box-shadow: 0 12px 30px rgba(245, 158, 11, 0.28);
}

.brand-name {
  font-size: clamp(1.1rem, 2vw, 1.55rem);
}

.desktop-nav,
.nav-categories {
  display: flex;
  align-items: center;
  gap: 18px;
}

.desktop-nav a,
.category-trigger,
.category-menu a,
.mobile-panel a {
  color: var(--text-muted);
  transition: color 0.2s ease, background 0.2s ease;
}

.desktop-nav a:hover,
.category-trigger:hover,
.category-menu a:hover,
.mobile-panel a:hover {
  color: var(--amber-400);
}

.category-trigger {
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.nav-categories {
  position: relative;
}

.category-menu {
  position: absolute;
  top: calc(100% + 16px);
  left: 0;
  width: 178px;
  padding: 10px;
  display: grid;
  gap: 4px;
  border: 1px solid rgba(251, 191, 36, 0.12);
  border-radius: 16px;
  background: rgba(16, 42, 67, 0.98);
  box-shadow: var(--shadow-strong);
  opacity: 0;
  visibility: hidden;
  transform: translateY(-8px);
  transition: all 0.22s ease;
}

.nav-categories:hover .category-menu,
.nav-categories:focus-within .category-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.category-menu a {
  padding: 8px 10px;
  border-radius: 10px;
}

.category-menu a:hover {
  background: rgba(251, 191, 36, 0.1);
}

.nav-search,
.mobile-search,
.footer-search,
.big-search,
.search-page-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-search {
  margin-left: auto;
}

.nav-search input,
.mobile-search input,
.footer-search input,
.big-search input,
.search-page-form input,
.filter-panel input,
.filter-panel select {
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 14px;
  outline: none;
  color: var(--text-main);
  background: rgba(36, 59, 83, 0.8);
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.nav-search input,
.mobile-search input,
.footer-search input {
  height: 42px;
  padding: 0 14px;
}

.nav-search input {
  width: 230px;
}

.nav-search input:focus,
.mobile-search input:focus,
.footer-search input:focus,
.big-search input:focus,
.search-page-form input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
  border-color: var(--amber-400);
  box-shadow: 0 0 0 4px rgba(251, 191, 36, 0.12);
  background: rgba(36, 59, 83, 0.98);
}

.nav-search button,
.mobile-search button,
.footer-search button,
.big-search button,
.search-page-form button {
  border: 0;
  border-radius: 14px;
  color: #111827;
  background: linear-gradient(135deg, var(--amber-300), var(--amber-500));
  cursor: pointer;
  font-weight: 700;
}

.nav-search button,
.mobile-search button,
.footer-search button {
  height: 42px;
  padding: 0 14px;
}

.nav-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--text-main);
  font-size: 1.65rem;
  cursor: pointer;
}

.mobile-panel {
  display: none;
  padding: 0 16px 18px;
  border-top: 1px solid rgba(251, 191, 36, 0.1);
  background: rgba(16, 42, 67, 0.98);
}

.mobile-panel.is-open {
  display: grid;
  gap: 12px;
}

.page-main {
  padding-top: 72px;
}

.hero-carousel {
  position: relative;
  min-height: clamp(620px, 85vh, 850px);
  overflow: hidden;
  background: var(--night-950);
}

.hero-track,
.hero-slide,
.hero-slide img,
.hero-overlay {
  position: absolute;
  inset: 0;
}

.hero-slide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.7s ease;
}

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

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

.hero-overlay {
  background:
    linear-gradient(90deg, rgba(8, 24, 38, 0.96), rgba(8, 24, 38, 0.74) 46%, rgba(8, 24, 38, 0.32)),
    linear-gradient(0deg, var(--night-950), transparent 45%);
}

.hero-copy {
  position: relative;
  z-index: 2;
  width: min(760px, calc(100% - 32px));
  margin-left: max(16px, calc((100vw - 1280px) / 2));
  padding-top: clamp(150px, 20vh, 230px);
}

.hero-kicker,
.page-hero span,
.section-heading span,
.detail-kicker {
  display: inline-block;
  margin-bottom: 12px;
  color: var(--amber-300);
  font-size: 0.82rem;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.hero-copy h1 {
  max-width: 720px;
  margin: 0 0 20px;
  font-size: clamp(2.6rem, 7vw, 5.8rem);
  line-height: 0.96;
  letter-spacing: -0.06em;
}

.hero-copy p {
  max-width: 670px;
  margin: 0 0 24px;
  color: var(--text-muted);
  font-size: clamp(1.05rem, 1.8vw, 1.35rem);
  line-height: 1.85;
}

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

.hero-tags span,
.tag-row span {
  border: 1px solid rgba(251, 191, 36, 0.22);
  border-radius: 999px;
  color: var(--amber-300);
  background: rgba(251, 191, 36, 0.1);
  font-size: 0.78rem;
}

.hero-tags span {
  padding: 7px 12px;
}

.tag-row span {
  padding: 5px 9px;
}

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

.btn-primary,
.btn-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 15px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn-primary {
  color: #111827;
  background: linear-gradient(135deg, var(--amber-300), var(--amber-500));
  box-shadow: 0 14px 32px rgba(245, 158, 11, 0.24);
}

.btn-secondary {
  color: var(--text-main);
  background: rgba(51, 78, 104, 0.86);
  border: 1px solid rgba(148, 163, 184, 0.16);
}

.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-strong);
}

.hero-dots {
  position: absolute;
  z-index: 4;
  left: max(16px, calc((100vw - 1280px) / 2));
  bottom: 42px;
  display: flex;
  gap: 10px;
}

.hero-dot {
  width: 34px;
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  cursor: pointer;
}

.hero-dot.is-active {
  background: var(--amber-400);
}

.search-hero-panel {
  position: relative;
  z-index: 5;
  margin-top: -72px;
  display: grid;
  grid-template-columns: 1fr minmax(280px, 560px);
  gap: 24px;
  align-items: center;
  padding: 28px;
  border: 1px solid rgba(251, 191, 36, 0.14);
  border-radius: 28px;
  background: rgba(16, 42, 67, 0.88);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-strong);
}

.search-hero-panel h2 {
  margin: 0 0 8px;
  font-size: clamp(1.4rem, 3vw, 2.2rem);
}

.search-hero-panel p {
  margin: 0;
  color: var(--text-soft);
}

.big-search input,
.search-page-form input {
  flex: 1;
  height: 54px;
  padding: 0 18px;
}

.big-search button,
.search-page-form button {
  height: 54px;
  padding: 0 22px;
}

.content-section {
  padding: 70px 0 0;
}

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

.section-heading a {
  color: var(--amber-300);
  font-weight: 700;
}

.section-title {
  margin: 0;
  color: var(--text-main);
  font-size: clamp(1.7rem, 3vw, 2.65rem);
  letter-spacing: -0.04em;
}

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

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

.video-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--card-border);
  border-radius: 22px;
  background: rgba(36, 59, 83, 0.72);
  box-shadow: 0 12px 34px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.video-card:hover {
  transform: translateY(-5px);
  border-color: rgba(251, 191, 36, 0.36);
  box-shadow: var(--shadow-strong);
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, var(--night-800), var(--night-700));
}

.video-card-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.video-card:hover .video-card-image {
  transform: scale(1.06);
}

.play-chip,
.rank-badge {
  position: absolute;
  z-index: 3;
  border-radius: 999px;
  color: #111827;
  background: linear-gradient(135deg, var(--amber-300), var(--amber-500));
  font-weight: 800;
}

.play-chip {
  right: 12px;
  bottom: 12px;
  padding: 7px 10px;
  font-size: 0.78rem;
}

.rank-badge {
  left: 12px;
  top: 12px;
  min-width: 36px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 0.88rem;
}

.card-body {
  padding: 16px;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 9px;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.card-body h2 {
  margin: 0 0 10px;
  color: var(--text-main);
  font-size: 1.05rem;
  font-weight: 800;
  line-height: 1.35;
}

.card-body h2 a:hover {
  color: var(--amber-300);
}

.card-body p {
  display: -webkit-box;
  min-height: 3.2em;
  margin: 0 0 13px;
  overflow: hidden;
  color: var(--text-soft);
  line-height: 1.62;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.compact-card .card-body {
  padding: 13px;
}

.compact-card .card-body h2 {
  font-size: 0.98rem;
}

.compact-card .card-body p {
  font-size: 0.9rem;
}

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

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

.category-card a {
  display: block;
  overflow: hidden;
  height: 100%;
  border: 1px solid rgba(251, 191, 36, 0.14);
  border-radius: 24px;
  background: rgba(36, 59, 83, 0.66);
  box-shadow: 0 14px 34px rgba(0, 0, 0, 0.18);
  transition: transform 0.24s ease, border-color 0.24s ease;
}

.category-card a:hover {
  transform: translateY(-4px);
  border-color: rgba(251, 191, 36, 0.36);
}

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

.category-covers img {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  object-fit: cover;
}

.category-card-body {
  padding: 0 18px 20px;
}

.category-card-body h2 {
  margin: 0 0 10px;
  font-size: 1.25rem;
}

.category-card-body p {
  min-height: 3.2em;
  margin: 0 0 16px;
  color: var(--text-soft);
  line-height: 1.62;
}

.category-card-body span {
  color: var(--amber-300);
  font-weight: 800;
}

.inner-page {
  padding-bottom: 72px;
}

.page-hero {
  padding: 88px 0 14px;
}

.page-hero h1 {
  max-width: 920px;
  margin: 0 0 16px;
  font-size: clamp(2.15rem, 6vw, 4.5rem);
  line-height: 1.04;
  letter-spacing: -0.055em;
}

.page-hero p {
  max-width: 820px;
  margin: 0;
  color: var(--text-muted);
  font-size: 1.08rem;
  line-height: 1.85;
}

.filter-panel {
  display: grid;
  grid-template-columns: 1fr 170px 170px 170px;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  border: 1px solid rgba(251, 191, 36, 0.12);
  border-radius: 22px;
  background: rgba(16, 42, 67, 0.74);
}

.filter-panel input,
.filter-panel select {
  height: 46px;
  padding: 0 14px;
}

.empty-state {
  display: none;
  margin-top: 18px;
  padding: 26px;
  border: 1px solid rgba(251, 191, 36, 0.14);
  border-radius: 20px;
  color: var(--text-soft);
  text-align: center;
  background: rgba(36, 59, 83, 0.55);
}

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

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  padding-top: 34px;
  color: var(--text-soft);
  font-size: 0.92rem;
}

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

.detail-hero {
  display: grid;
  grid-template-columns: minmax(240px, 360px) 1fr;
  gap: 36px;
  align-items: center;
  padding: 46px 0 34px;
}

.detail-poster {
  overflow: hidden;
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: 28px;
  box-shadow: var(--shadow-strong);
  background: var(--night-800);
}

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

.detail-info h1 {
  margin: 0 0 18px;
  font-size: clamp(2.1rem, 5.2vw, 4.85rem);
  line-height: 1.02;
  letter-spacing: -0.055em;
}

.detail-one-line {
  max-width: 860px;
  margin: 0 0 22px;
  color: var(--text-muted);
  font-size: 1.15rem;
  line-height: 1.85;
}

.large-tags span {
  padding: 7px 12px;
  font-size: 0.86rem;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.detail-meta-grid div {
  padding: 15px;
  border: 1px solid rgba(251, 191, 36, 0.12);
  border-radius: 18px;
  background: rgba(36, 59, 83, 0.6);
}

.detail-meta-grid span {
  display: block;
  margin-bottom: 6px;
  color: var(--text-soft);
  font-size: 0.78rem;
}

.detail-meta-grid strong {
  color: var(--text-main);
  font-size: 0.95rem;
}

.player-section {
  padding-top: 24px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(251, 191, 36, 0.18);
  border-radius: 28px;
  background: #000;
  box-shadow: var(--shadow-strong);
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #111827;
  background: linear-gradient(180deg, rgba(8, 24, 38, 0.12), rgba(8, 24, 38, 0.45));
  cursor: pointer;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

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

.player-start {
  width: 82px;
  height: 82px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #111827;
  background: linear-gradient(135deg, var(--amber-300), var(--amber-500));
  box-shadow: 0 18px 40px rgba(245, 158, 11, 0.35);
  font-size: 2rem;
  text-indent: 4px;
}

.detail-content-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 22px;
  padding-top: 32px;
}

.story-card {
  padding: 26px;
  border: 1px solid rgba(251, 191, 36, 0.13);
  border-radius: 24px;
  background: rgba(36, 59, 83, 0.62);
  box-shadow: 0 12px 30px rgba(0, 0, 0, 0.16);
}

.story-card h2 {
  margin: 0 0 14px;
  color: var(--amber-300);
  font-size: 1.45rem;
}

.story-card p {
  margin: 0;
  color: var(--text-muted);
  line-height: 1.9;
}

.site-footer {
  margin-top: 86px;
  border-top: 1px solid rgba(251, 191, 36, 0.12);
  background: rgba(8, 24, 38, 0.72);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr 1fr;
  gap: 32px;
  padding: 46px 0;
}

.site-footer p,
.site-footer a {
  color: var(--text-soft);
}

.site-footer p {
  max-width: 420px;
  line-height: 1.75;
}

.site-footer h2 {
  margin: 0 0 14px;
  color: var(--text-main);
  font-size: 1rem;
}

.site-footer a {
  display: block;
  margin: 8px 0;
}

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

.footer-search {
  align-items: stretch;
}

.footer-search input {
  width: 100%;
}

.footer-bottom {
  padding: 18px 0 28px;
  color: var(--text-soft);
  text-align: center;
}

.search-results-section {
  min-height: 320px;
}

@media (max-width: 1180px) {
  .movie-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

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

@media (max-width: 920px) {
  .desktop-nav,
  .nav-categories,
  .nav-search {
    display: none;
  }

  .nav-toggle {
    display: block;
  }

  .hero-copy {
    padding-top: 132px;
  }

  .search-hero-panel,
  .detail-hero,
  .detail-content-grid {
    grid-template-columns: 1fr;
  }

  .detail-poster {
    max-width: 320px;
  }

  .detail-meta-grid,
  .filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

@media (max-width: 680px) {
  .container-custom {
    width: min(100% - 24px, 1280px);
  }

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

  .hero-copy h1,
  .detail-info h1,
  .page-hero h1 {
    letter-spacing: -0.035em;
  }

  .search-hero-panel {
    margin-top: -54px;
    padding: 20px;
  }

  .big-search,
  .search-page-form,
  .footer-search {
    flex-direction: column;
    align-items: stretch;
  }

  .big-search button,
  .search-page-form button,
  .footer-search button {
    width: 100%;
  }

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

  .filter-panel,
  .detail-meta-grid {
    grid-template-columns: 1fr;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

  .player-start {
    width: 64px;
    height: 64px;
    font-size: 1.55rem;
  }
}
