* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --card: rgba(15, 23, 42, 0.88);
  --card-strong: rgba(30, 41, 59, 0.95);
  --line: rgba(148, 163, 184, 0.16);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --blue: #38bdf8;
  --blue-deep: #2563eb;
  --cyan: #22d3ee;
  --green: #34d399;
  --yellow: #facc15;
  --red: #fb7185;
  --shadow: 0 24px 70px rgba(2, 6, 23, 0.42);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  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 15% 5%, rgba(37, 99, 235, 0.25), transparent 28rem),
    radial-gradient(circle at 80% 12%, rgba(20, 184, 166, 0.18), transparent 26rem),
    linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
}

body.is-menu-open {
  overflow: hidden;
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 41, 59, 0.94), rgba(15, 23, 42, 0.96));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.26);
  backdrop-filter: blur(18px);
}

.nav-wrap {
  max-width: 1280px;
  height: 72px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 28px;
}

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

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  color: #e0f2fe;
  background: linear-gradient(135deg, var(--blue-deep), var(--cyan));
  border-radius: 12px;
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.30);
}

.brand-text,
.footer-brand {
  font-size: 21px;
  background: linear-gradient(90deg, #60a5fa, #22d3ee);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  white-space: nowrap;
}

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

.nav-link {
  color: var(--soft);
  font-size: 15px;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  color: #60a5fa;
}

.top-search,
.mobile-search,
.inline-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.top-search input,
.mobile-search input,
.inline-search input {
  border: 1px solid var(--line);
  color: var(--text);
  background: rgba(15, 23, 42, 0.94);
  outline: none;
}

.top-search input {
  width: 210px;
  padding: 10px 14px;
  border-radius: 999px;
}

.top-search button,
.mobile-search button,
.inline-search button {
  border: 0;
  cursor: pointer;
  color: white;
  background: linear-gradient(135deg, var(--blue-deep), var(--cyan));
  border-radius: 999px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.top-search button {
  padding: 10px 15px;
}

.top-search button:hover,
.mobile-search button:hover,
.inline-search button:hover,
.btn-primary:hover,
.btn-secondary:hover {
  transform: translateY(-1px);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.25);
}

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

.menu-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: var(--text);
  border-radius: 2px;
}

.mobile-panel {
  display: none;
  border-top: 1px solid var(--line);
  padding: 16px 24px 22px;
  background: rgba(15, 23, 42, 0.98);
}

.mobile-link {
  display: block;
  padding: 12px 0;
  color: var(--soft);
}

.mobile-search {
  margin-top: 10px;
}

.mobile-search input {
  min-width: 0;
  flex: 1;
  padding: 12px 14px;
  border-radius: 999px;
}

.mobile-search button {
  padding: 12px 18px;
}

.page-main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 34px 24px 70px;
}

.inner-page {
  padding-top: 28px;
}

.hero-carousel,
.page-hero {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  border-radius: 28px;
  background: linear-gradient(110deg, #2563eb, #0891b2, #0f766e);
  box-shadow: var(--shadow);
}

.hero-carousel {
  margin-bottom: 64px;
}

.hero-carousel::before,
.page-hero::before {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0.22;
  background-image:
    radial-gradient(circle at 1px 1px, rgba(255, 255, 255, 0.75) 1px, transparent 0);
  background-size: 34px 34px;
}

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

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

.hero-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  transform: scale(1.04);
}

.hero-content {
  position: relative;
  z-index: 2;
  min-height: 520px;
  padding: 54px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(240px, 360px);
  align-items: center;
  gap: 46px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  margin-bottom: 14px;
  padding: 7px 13px;
  color: #dbeafe;
  background: rgba(37, 99, 235, 0.22);
  border: 1px solid rgba(147, 197, 253, 0.26);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.06em;
}

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

.hero-copy h2 {
  margin: 0 0 18px;
  color: #e0f2fe;
  font-size: clamp(22px, 3vw, 34px);
}

.hero-copy p,
.page-hero p {
  max-width: 710px;
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 18px;
  line-height: 1.8;
}

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

.hero-tags span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  color: #bfdbfe;
  background: rgba(30, 64, 175, 0.26);
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 999px;
  font-size: 12px;
}

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

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

.btn-primary {
  color: #0f172a;
  background: white;
}

.btn-secondary {
  color: white;
  border: 1px solid rgba(255, 255, 255, 0.48);
  background: rgba(255, 255, 255, 0.08);
}

.hero-poster {
  position: relative;
  min-height: 430px;
  border-radius: 24px;
  overflow: hidden;
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.55);
  transform: rotate(2deg);
}

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

.hero-poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.64));
}

.hero-poster span {
  position: absolute;
  left: 22px;
  bottom: 22px;
  z-index: 2;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  color: #0f172a;
  background: white;
  border-radius: 50%;
}

.hero-controls {
  position: absolute;
  z-index: 5;
  left: 54px;
  bottom: 32px;
  display: flex;
  gap: 8px;
}

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

.hero-dot.is-active {
  background: white;
}

.section-block {
  margin-bottom: 64px;
}

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

.section-heading > span {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  background: rgba(15, 23, 42, 0.9);
  border: 1px solid var(--line);
  border-radius: 14px;
}

.section-heading h2 {
  margin: 0 0 4px;
  font-size: clamp(26px, 3vw, 34px);
}

.section-heading p {
  margin: 0;
  color: var(--muted);
  line-height: 1.6;
}

.section-heading.with-link a {
  margin-left: auto;
  color: #7dd3fc;
  font-weight: 700;
}

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

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

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

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

.movie-card {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.96));
  box-shadow: 0 16px 46px rgba(2, 6, 23, 0.22);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

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

.movie-card-link {
  display: block;
  height: 100%;
}

.poster-wrap {
  position: relative;
  margin: 0;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.98);
}

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

.poster-wrap img {
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, opacity 0.3s ease;
}

.movie-card:hover img {
  transform: scale(1.055);
  opacity: 0.86;
}

.poster-type {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 5px 10px;
  color: white;
  background: rgba(37, 99, 235, 0.86);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.poster-play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  color: #0f172a;
  background: white;
  border-radius: 50%;
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-card:hover .poster-play {
  opacity: 1;
  transform: scale(1);
}

.card-body {
  padding: 18px;
}

.card-meta,
.score-line,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: var(--muted);
  font-size: 13px;
}

.card-body h3 {
  min-height: 3em;
  margin: 10px 0 8px;
  color: white;
  font-size: 18px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.score-line {
  justify-content: space-between;
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

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

.category-card {
  position: relative;
  min-height: 178px;
  padding: 22px;
  border-radius: 22px;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.11);
  background: linear-gradient(135deg, rgba(37, 99, 235, 0.9), rgba(8, 145, 178, 0.88));
  box-shadow: 0 18px 50px rgba(2, 6, 23, 0.24);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  transform: translateY(-4px) scale(1.01);
  box-shadow: 0 25px 70px rgba(14, 165, 233, 0.22);
}

.category-card::after {
  content: "";
  position: absolute;
  inset: auto -30px -60px auto;
  width: 130px;
  height: 130px;
  background: rgba(255, 255, 255, 0.12);
  border-radius: 50%;
}

.category-card h3 {
  position: relative;
  z-index: 1;
  margin: 10px 0 8px;
  font-size: 22px;
}

.category-card p {
  position: relative;
  z-index: 1;
  margin: 0;
  color: rgba(255, 255, 255, 0.83);
  line-height: 1.6;
  font-size: 14px;
}

.category-icon {
  position: relative;
  z-index: 1;
  font-size: 34px;
}

.from-red {
  background: linear-gradient(135deg, #ef4444, #e11d48);
}

.from-blue {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
}

.from-green {
  background: linear-gradient(135deg, #059669, #10b981);
}

.from-orange {
  background: linear-gradient(135deg, #f97316, #f59e0b);
}

.from-purple {
  background: linear-gradient(135deg, #7c3aed, #a855f7);
}

.from-pink {
  background: linear-gradient(135deg, #db2777, #f43f5e);
}

.from-teal {
  background: linear-gradient(135deg, #0d9488, #22d3ee);
}

.from-indigo {
  background: linear-gradient(135deg, #4f46e5, #2563eb);
}

.from-amber {
  background: linear-gradient(135deg, #d97706, #facc15);
}

.from-cyan {
  background: linear-gradient(135deg, #0891b2, #22d3ee);
}

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

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

.ranking-row a {
  display: grid;
  grid-template-columns: 48px 72px minmax(0, 1fr) auto 52px;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.82);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.ranking-row a:hover {
  transform: translateX(4px);
  border-color: rgba(56, 189, 248, 0.45);
}

.rank-no {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  color: #0f172a;
  background: linear-gradient(135deg, #facc15, #fb923c);
  border-radius: 13px;
  font-weight: 900;
}

.ranking-row img {
  width: 72px;
  height: 92px;
  object-fit: cover;
  border-radius: 12px;
}

.rank-title {
  font-weight: 800;
  line-height: 1.4;
}

.rank-info {
  color: var(--muted);
  font-size: 13px;
}

.ranking-row strong {
  color: var(--yellow);
}

.page-hero {
  min-height: 290px;
  padding: 46px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  margin-bottom: 42px;
}

.slim-hero {
  min-height: 310px;
}

.category-hero {
  min-height: 340px;
}

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

.breadcrumb a {
  color: #7dd3fc;
}

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

.category-feature {
  position: relative;
  min-height: 220px;
  border-radius: 20px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.9);
}

.category-feature img {
  height: 100%;
  object-fit: cover;
  opacity: 0.66;
}

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

.category-feature span {
  top: 18px;
  color: #bfdbfe;
  font-size: 13px;
  font-weight: 800;
}

.category-feature strong {
  bottom: 18px;
  font-size: 18px;
  line-height: 1.4;
}

.inline-search {
  max-width: 720px;
  margin-top: 26px;
}

.inline-search input {
  min-width: 0;
  flex: 1;
  padding: 15px 18px;
  border-radius: 999px;
}

.inline-search button {
  padding: 15px 24px;
}

.empty-state {
  padding: 54px;
  text-align: center;
  color: var(--muted);
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.78);
}

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

.player-card,
.detail-content,
.side-card {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.88);
  box-shadow: var(--shadow);
}

.player-card {
  overflow: hidden;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: black;
}

.movie-video {
  width: 100%;
  height: 100%;
  display: block;
  background: black;
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.72));
  cursor: pointer;
}

.play-overlay.is-hidden {
  display: none;
}

.big-play {
  width: 88px;
  height: 88px;
  border: 0;
  color: #0f172a;
  background: white;
  border-radius: 50%;
  font-size: 34px;
  cursor: pointer;
  box-shadow: 0 18px 48px rgba(2, 6, 23, 0.42);
}

.player-error {
  position: absolute;
  left: 24px;
  right: 24px;
  bottom: 24px;
  margin: 0;
  padding: 14px 18px;
  color: #fecaca;
  background: rgba(127, 29, 29, 0.82);
  border-radius: 16px;
  text-align: center;
}

.detail-content {
  margin-top: 24px;
  padding: 28px;
}

.detail-title-row {
  display: flex;
  gap: 18px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}

.detail-content h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.16;
}

.detail-content h2,
.side-card h2 {
  margin: 28px 0 12px;
  font-size: 24px;
}

.detail-content p {
  color: var(--soft);
  line-height: 1.9;
  font-size: 17px;
}

.one-line {
  margin: 22px 0;
  color: #e0f2fe !important;
  font-size: 19px !important;
}

.detail-tags {
  margin: 18px 0 8px;
}

.detail-poster {
  border-radius: 24px;
  min-height: 440px;
  object-fit: cover;
  box-shadow: var(--shadow);
}

.side-card {
  margin-top: 22px;
  padding: 24px;
}

.side-card h2 {
  margin-top: 0;
}

.side-card dl {
  margin: 0;
}

.side-card dt {
  color: var(--muted);
  font-size: 13px;
}

.side-card dd {
  margin: 4px 0 18px;
  line-height: 1.6;
}

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

.site-footer {
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.98), #020617);
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 38px 24px;
  display: flex;
  justify-content: space-between;
  gap: 30px;
}

.footer-inner p {
  max-width: 620px;
  color: var(--muted);
  line-height: 1.8;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-content: flex-start;
  justify-content: flex-end;
}

.footer-links a {
  color: #bae6fd;
}

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 28px;
  color: #64748b;
  font-size: 14px;
}

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

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

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

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

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

  .menu-toggle {
    display: block;
    margin-left: auto;
  }

  .mobile-panel.is-open {
    display: block;
  }

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

  .hero-poster {
    display: none;
  }

  .compact-ranking,
  .movie-grid,
  .featured-grid,
  .triple-grid,
  .catalog-grid,
  .category-grid,
  .feature-strip,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .detail-side {
    display: grid;
    grid-template-columns: 240px minmax(0, 1fr);
    gap: 20px;
  }

  .detail-poster {
    min-height: 0;
    height: 360px;
  }
}

@media (max-width: 640px) {
  .nav-wrap {
    height: 66px;
    padding: 0 16px;
  }

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

  .page-main {
    padding: 20px 14px 48px;
  }

  .hero-carousel,
  .page-hero {
    min-height: 460px;
    border-radius: 20px;
  }

  .hero-content,
  .page-hero {
    padding: 26px;
  }

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

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

  .hero-controls {
    left: 26px;
    bottom: 22px;
  }

  .section-heading,
  .detail-title-row,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .section-heading.with-link a {
    margin-left: 0;
  }

  .movie-grid,
  .featured-grid,
  .triple-grid,
  .catalog-grid,
  .category-grid,
  .feature-strip,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .ranking-row a {
    grid-template-columns: 42px 58px minmax(0, 1fr) 44px;
  }

  .rank-info {
    display: none;
  }

  .ranking-row img {
    width: 58px;
    height: 76px;
  }

  .detail-side {
    display: block;
  }

  .detail-poster {
    height: auto;
  }

  .inline-search {
    flex-direction: column;
    align-items: stretch;
  }
}
