:root {
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-strong: rgba(15, 23, 42, 0.96);
  --line: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #64748b;
  --sky: #38bdf8;
  --blue: #2563eb;
  --amber: #f59e0b;
  --red: #ef4444;
  --green: #22c55e;
  --shadow: 0 26px 80px rgba(2, 6, 23, 0.45);
  --radius: 22px;
}

* {
  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(--text);
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.18), transparent 28rem),
    radial-gradient(circle at 80% 12%, rgba(37, 99, 235, 0.16), transparent 24rem),
    linear-gradient(180deg, #020617 0%, #0f172a 54%, #020617 100%);
  min-height: 100vh;
}

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

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: rgba(2, 6, 23, 0.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 12px 50px rgba(2, 6, 23, 0.38);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 16px 0;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--sky), var(--blue));
  box-shadow: 0 12px 34px rgba(14, 165, 233, 0.32);
}

.brand-text strong {
  display: block;
  font-size: 20px;
  line-height: 1.1;
  letter-spacing: 0.02em;
}

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

.main-nav {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-link,
.mobile-link,
.quick-cats a {
  color: #cbd5e1;
  border-radius: 999px;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link {
  padding: 10px 15px;
  font-weight: 600;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active,
.quick-cats a:hover {
  color: white;
  background: rgba(56, 189, 248, 0.14);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  color: white;
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid var(--line);
  border-radius: 12px;
}

.mobile-nav {
  display: none;
  padding: 0 16px 14px;
  border-top: 1px solid var(--line);
}

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

.mobile-link {
  display: block;
  padding: 12px 14px;
}

.quick-cats {
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}

.quick-cats-inner {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding: 10px 0;
}

.quick-cats a {
  white-space: nowrap;
  padding: 7px 13px;
  font-size: 13px;
  background: rgba(15, 23, 42, 0.55);
}

.hero-carousel {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  background: #020617;
}

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

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

.hero-slide > img,
.page-hero > img,
.detail-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-backdrop,
.page-hero-shade,
.detail-hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.72) 48%, rgba(2, 6, 23, 0.28) 100%),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.2) 52%, rgba(2, 6, 23, 0.8) 100%);
}

.hero-content {
  position: relative;
  min-height: 680px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: center;
  gap: 56px;
  padding: 72px 0 98px;
}

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

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--sky);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
  margin-bottom: 18px;
}

.hero-copy h1,
.page-hero h1,
.detail-copy h1 {
  margin: 0;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.hero-copy p,
.page-hero p,
.detail-one-line {
  margin: 22px 0 0;
  color: #dbeafe;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.8;
}

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

.hero-tags {
  margin-top: 26px;
}

.hero-tags span,
.detail-tags a,
.tag-row span {
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.66);
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 999px;
  padding: 7px 12px;
  font-size: 12px;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 32px;
}

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

.primary-btn {
  color: white;
  background: linear-gradient(135deg, var(--sky), var(--blue));
  box-shadow: 0 16px 40px rgba(14, 165, 233, 0.3);
}

.ghost-btn {
  color: #e0f2fe;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(125, 211, 252, 0.18);
}

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

.hero-poster {
  position: relative;
  border-radius: 30px;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  box-shadow: var(--shadow);
  transform: rotate(2deg);
  transition: transform 0.25s ease;
}

.hero-poster:hover {
  transform: rotate(0deg) scale(1.02);
}

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

.hero-poster span,
.play-dot,
.detail-poster span {
  position: absolute;
  display: grid;
  place-items: center;
  color: #020617;
  background: rgba(255, 255, 255, 0.92);
  border-radius: 999px;
}

.hero-poster span {
  width: 70px;
  height: 70px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  font-size: 26px;
}

.hero-controls {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 10px 12px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.64);
  border: 1px solid var(--line);
  backdrop-filter: blur(12px);
}

.hero-prev,
.hero-next,
.hero-dot {
  border: 0;
  color: white;
  background: transparent;
}

.hero-prev,
.hero-next {
  width: 34px;
  height: 34px;
  border-radius: 999px;
  font-size: 28px;
  line-height: 1;
}

.hero-prev:hover,
.hero-next:hover {
  background: rgba(255, 255, 255, 0.12);
}

.hero-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

.hero-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  padding: 0;
  background: rgba(203, 213, 225, 0.46);
}

.hero-dot.active {
  width: 28px;
  background: var(--sky);
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
  align-items: center;
  gap: 24px;
  margin-top: 34px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.74);
  box-shadow: 0 18px 60px rgba(2, 6, 23, 0.24);
}

.home-search {
  margin-top: -54px;
  position: relative;
  z-index: 6;
}

.search-panel h2,
.section-heading h2,
.story-card h2,
.site-footer h2 {
  margin: 0;
  font-size: 24px;
}

.search-panel p,
.section-heading p,
.story-card p,
.site-footer p {
  margin: 8px 0 0;
  color: var(--muted);
  line-height: 1.8;
}

.search-box {
  height: 54px;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.68);
  border: 1px solid var(--line);
}

.search-box input {
  width: 100%;
  color: white;
  background: transparent;
  border: 0;
  outline: 0;
}

.content-section {
  padding: 54px 0 8px;
}

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

.section-heading h2 {
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.03em;
}

.section-more {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--sky);
  font-weight: 800;
}

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

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

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

.movie-card {
  overflow: hidden;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(148, 163, 184, 0.13);
  box-shadow: 0 16px 40px rgba(2, 6, 23, 0.2);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(56, 189, 248, 0.34);
  box-shadow: 0 24px 70px rgba(14, 165, 233, 0.12);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #0f172a;
}

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

.movie-card:hover .poster-link img,
.category-tile:hover img,
.category-cover:hover img {
  transform: scale(1.08);
}

.poster-shade,
.tile-overlay,
.category-cover span {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.05) 58%, rgba(2, 6, 23, 0.08));
}

.play-dot {
  width: 52px;
  height: 52px;
  left: 50%;
  top: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.88);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-card:hover .play-dot {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.year-chip,
.rank-badge {
  position: absolute;
  z-index: 2;
  color: white;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.year-chip {
  right: 10px;
  bottom: 10px;
  padding: 6px 10px;
  background: rgba(2, 6, 23, 0.72);
}

.rank-badge {
  left: 10px;
  top: 10px;
  min-width: 32px;
  height: 32px;
  display: grid;
  place-items: center;
  background: linear-gradient(135deg, var(--red), var(--amber));
}

.card-body {
  padding: 16px;
}

.card-title {
  display: -webkit-box;
  overflow: hidden;
  min-height: 46px;
  color: white;
  font-weight: 900;
  font-size: 17px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-title:hover {
  color: var(--sky);
}

.card-body p {
  display: -webkit-box;
  overflow: hidden;
  margin: 10px 0 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted-2);
  font-size: 12px;
}

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

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

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

.category-tile {
  position: relative;
  min-height: 230px;
  overflow: hidden;
  border-radius: 24px;
  background: #0f172a;
  border: 1px solid var(--line);
}

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

.category-tile strong,
.category-tile em {
  position: absolute;
  z-index: 2;
  left: 18px;
  right: 18px;
}

.category-tile strong {
  bottom: 72px;
  font-size: 23px;
  font-style: normal;
}

.category-tile em {
  bottom: 20px;
  color: #cbd5e1;
  font-size: 13px;
  line-height: 1.55;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 32px;
  align-items: start;
}

.ranking-panel {
  position: sticky;
  top: 128px;
  padding: 22px;
  border-radius: var(--radius);
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.72);
}

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

.wide-card {
  display: grid;
  grid-template-columns: 116px minmax(0, 1fr);
}

.wide-card .poster-link {
  aspect-ratio: auto;
  min-height: 154px;
}

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

.page-hero,
.detail-hero {
  position: relative;
  overflow: hidden;
  min-height: 360px;
  background: #020617;
}

.page-hero .container {
  position: relative;
  z-index: 2;
  padding: 90px 0;
}

.small-hero {
  background:
    radial-gradient(circle at 16% 20%, rgba(56, 189, 248, 0.24), transparent 30rem),
    linear-gradient(135deg, #020617, #0f172a 58%, #082f49);
}

.small-hero .container {
  max-width: 900px;
  margin-left: auto;
  margin-right: auto;
  text-align: center;
}

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

.category-card {
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.72);
}

.category-cover {
  position: relative;
  min-height: 260px;
  overflow: hidden;
}

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

.category-card-body {
  padding: 24px;
}

.category-name {
  color: white;
  font-size: 26px;
  font-weight: 900;
}

.category-card-body p {
  color: var(--muted);
  line-height: 1.8;
}

.category-preview {
  display: grid;
  gap: 7px;
  margin-top: 18px;
}

.category-preview a {
  color: #bae6fd;
  font-size: 14px;
}

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

.rank-table {
  display: grid;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.68);
}

.rank-row {
  display: grid;
  grid-template-columns: 54px minmax(0, 1.1fr) 80px minmax(0, 1fr);
  align-items: center;
  gap: 16px;
  min-height: 58px;
  padding: 0 18px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.1);
}

.rank-row:hover {
  background: rgba(56, 189, 248, 0.1);
}

.rank-row span {
  color: var(--sky);
  font-weight: 900;
}

.rank-row strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rank-row em,
.rank-row small {
  color: var(--muted);
  font-style: normal;
}

.detail-hero {
  min-height: 620px;
}

.detail-hero-inner {
  position: relative;
  z-index: 2;
  padding: 38px 0 70px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  color: var(--muted);
  font-size: 14px;
  margin-bottom: 38px;
}

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

.detail-layout {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 48px;
  align-items: center;
}

.detail-poster {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  aspect-ratio: 2 / 3;
  box-shadow: var(--shadow);
}

.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-poster span {
  width: 70px;
  height: 70px;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
}

.detail-copy {
  max-width: 820px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.detail-meta span {
  color: #e0f2fe;
  background: rgba(2, 6, 23, 0.54);
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 999px;
  padding: 8px 13px;
  font-size: 13px;
}

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

.player-section {
  margin-top: -42px;
  position: relative;
  z-index: 4;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: #000;
  border: 1px solid rgba(125, 211, 252, 0.18);
  box-shadow: var(--shadow);
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  color: white;
  background: radial-gradient(circle at center, rgba(14, 165, 233, 0.26), rgba(2, 6, 23, 0.76));
  border: 0;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.play-overlay span {
  width: 84px;
  height: 84px;
  display: grid;
  place-items: center;
  color: #020617;
  background: white;
  border-radius: 999px;
  font-size: 32px;
  box-shadow: 0 18px 50px rgba(255, 255, 255, 0.2);
}

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

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

.detail-content {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 22px;
  padding-top: 42px;
}

.story-card {
  padding: 26px;
  border-radius: 24px;
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.72);
}

.story-card p {
  color: #cbd5e1;
  line-height: 2;
  font-size: 16px;
}

.site-footer {
  margin-top: 70px;
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.8);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr 1fr;
  gap: 34px;
  padding: 44px 0;
}

.footer-brand {
  color: white;
  font-size: 22px;
  font-weight: 900;
}

.footer-links {
  display: grid;
  gap: 10px;
  margin-top: 14px;
}

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

.footer-links a {
  color: var(--muted);
}

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

.footer-bottom {
  color: var(--muted-2);
  text-align: center;
  padding: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.08);
}

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

.empty-state {
  grid-column: 1 / -1;
  color: var(--muted);
  text-align: center;
  padding: 40px;
  border: 1px dashed var(--line);
  border-radius: var(--radius);
}

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

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

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

  .ranking-panel {
    position: static;
  }

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

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

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

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

  .hero-content {
    min-height: 720px;
    padding-top: 58px;
    gap: 30px;
  }

  .hero-poster,
  .detail-poster {
    width: min(310px, 80vw);
    margin: 0 auto;
  }

  .detail-copy,
  .small-hero .container {
    text-align: left;
  }

  .rank-row {
    grid-template-columns: 44px minmax(0, 1fr) 60px;
  }

  .rank-row small {
    display: none;
  }
}

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

  .brand-text small,
  .quick-cats {
    display: none;
  }

  .hero-carousel,
  .hero-content {
    min-height: 650px;
  }

  .hero-copy h1,
  .page-hero h1,
  .detail-copy h1 {
    font-size: 38px;
  }

  .movie-grid,
  .catalog-grid,
  .compact-grid,
  .category-grid,
  .category-list-grid,
  .rank-page-list {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .wide-card {
    grid-template-columns: 90px minmax(0, 1fr);
  }

  .wide-card .poster-link {
    min-height: 138px;
  }

  .card-body {
    padding: 12px;
  }

  .card-title {
    font-size: 15px;
  }

  .category-tile {
    min-height: 190px;
  }

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

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

  .player-shell {
    border-radius: 18px;
  }
}

@media (max-width: 420px) {
  .movie-grid,
  .catalog-grid,
  .compact-grid,
  .category-grid,
  .category-list-grid,
  .rank-page-list {
    grid-template-columns: 1fr;
  }

  .hero-actions {
    flex-direction: column;
  }

  .primary-btn,
  .ghost-btn {
    width: 100%;
  }
}
