:root {
  --page-bg: #f8fafc;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --card: #ffffff;
  --primary: #2563eb;
  --primary-dark: #1e40af;
  --accent: #9333ea;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.10);
}

html {
  scroll-behavior: smooth;
}

body {
  min-height: 100vh;
  background: var(--page-bg);
  color: var(--text);
}

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

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

img.is-missing {
  opacity: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(16px);
}

.header-inner {
  max-width: 1280px;
  height: 64px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  font-size: 20px;
}

.brand-mark {
  width: 36px;
  height: 36px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 10px 28px rgba(37, 99, 235, 0.28);
}

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

.nav-link {
  color: #374151;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
}

.mobile-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: #f3f4f6;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.mobile-menu-button span {
  width: 20px;
  height: 2px;
  background: #374151;
  border-radius: 999px;
}

.mobile-nav {
  display: none;
  border-top: 1px solid var(--line);
  padding: 8px 24px 18px;
  background: #fff;
}

.mobile-nav a {
  display: block;
  padding: 12px 0;
  color: #374151;
  font-weight: 600;
}

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

.hero {
  position: relative;
  height: 560px;
  overflow: hidden;
  background: linear-gradient(135deg, #172554, #0f172a);
}

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

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

.hero-slide > img,
.detail-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.42) 52%, rgba(15, 23, 42, 0.18));
}

.hero-content {
  position: absolute;
  left: 50%;
  bottom: 64px;
  width: min(1180px, calc(100% - 48px));
  transform: translateX(-50%);
  color: #fff;
}

.hero-labels {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}

.hero-labels span,
.hero-labels a,
.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.92);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
}

.hero-labels a {
  background: rgba(220, 38, 38, 0.92);
}

.hero-content h1 {
  max-width: 780px;
  margin: 0 0 12px;
  font-size: clamp(30px, 6vw, 58px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.hero-content h2 {
  margin: 0 0 18px;
  font-size: clamp(24px, 4vw, 42px);
  line-height: 1.08;
  font-weight: 800;
}

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

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

.primary-button,
.ghost-button {
  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-button {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  box-shadow: 0 14px 30px rgba(37, 99, 235, 0.34);
}

.ghost-button {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.46);
  background: rgba(255, 255, 255, 0.14);
}

.ghost-button.dark {
  color: #111827;
  border-color: var(--line);
  background: #fff;
}

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

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(15, 23, 42, 0.5);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.hero-prev {
  left: 24px;
}

.hero-next {
  right: 24px;
}

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

.hero-dots button {
  width: 28px;
  height: 5px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.hero-dots button.is-active {
  background: #fff;
}

.section-inner,
.section-block {
  max-width: 1280px;
  margin: 0 auto;
  padding-left: 24px;
  padding-right: 24px;
}

.search-band {
  position: relative;
  z-index: 6;
  margin-top: -36px;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 190px 190px;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.search-panel input,
.search-panel select {
  min-height: 46px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  color: #111827;
  background: #fff;
  outline: none;
}

.search-panel input:focus,
.search-panel select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.flat-search {
  margin-top: 0;
  padding-top: 28px;
}

.section-block {
  padding-top: 54px;
  padding-bottom: 24px;
}

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

.section-heading h2,
.category-section h2 {
  margin: 10px 0 0;
  font-size: 30px;
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.section-heading > a {
  color: var(--primary);
  font-weight: 800;
}

.eyebrow {
  background: #dbeafe;
  color: #1d4ed8;
}

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

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

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

.movie-card {
  overflow: hidden;
  border-radius: 18px;
  background: var(--card);
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 42px rgba(15, 23, 42, 0.14);
}

.poster-link {
  display: block;
}

.poster-frame {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #1e3a8a, #0f172a 65%, #581c87);
}

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

.movie-card:hover .poster-frame img {
  transform: scale(1.06);
}

.poster-shade {
  position: absolute;
  inset: auto 0 0;
  height: 45%;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.65), transparent);
}

.duration-badge {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  font-size: 12px;
  font-weight: 700;
}

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

.movie-card h3 {
  min-height: 45px;
  margin: 0 0 8px;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 800;
}

.movie-card h3 a:hover {
  color: var(--primary);
}

.movie-card p {
  min-height: 43px;
  margin: 0 0 12px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.65;
}

.card-meta {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  color: #6b7280;
  font-size: 12px;
}

.card-meta a {
  color: var(--primary);
  font-weight: 800;
}

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

.tag-row span,
.tag-cloud span,
.tag-cloud a {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 9px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 12px;
  font-weight: 700;
}

.two-column-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
}

.ranking-panel,
.side-card,
.text-card,
.player-card,
.category-section {
  border: 1px solid var(--line);
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 25px rgba(15, 23, 42, 0.06);
}

.ranking-panel,
.side-card,
.text-card,
.category-section {
  padding: 22px;
}

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

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

.rank-list,
.rank-page-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.rank-item a {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-top: 1px solid var(--line);
  align-items: center;
}

.rank-item:first-child a {
  border-top: 0;
}

.rank-num {
  width: 32px;
  height: 32px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  background: #f3f4f6;
  font-weight: 900;
  color: #374151;
}

.top-rank .rank-num {
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #f59e0b);
}

.rank-title {
  display: block;
  min-width: 0;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 800;
}

.rank-meta {
  grid-column: 2;
  color: var(--muted);
  font-size: 12px;
}

.category-chip-grid,
.category-card-grid {
  display: grid;
  grid-template-columns: repeat(6, minmax(0, 1fr));
  gap: 14px;
}

.category-chip,
.category-card {
  min-height: 78px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 6px;
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.05);
  font-weight: 900;
}

.category-chip span,
.category-card span {
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.categories-overview {
  display: grid;
  gap: 24px;
}

.category-section h2 {
  margin-bottom: 18px;
}

.page-hero {
  color: #fff;
  background: radial-gradient(circle at top left, rgba(147, 51, 234, 0.45), transparent 34%), linear-gradient(135deg, #172554, #0f172a);
}

.compact-page-hero .section-inner {
  padding-top: 74px;
  padding-bottom: 72px;
}

.page-hero h1 {
  margin: 14px 0 14px;
  font-size: clamp(32px, 5vw, 52px);
  line-height: 1.08;
  font-weight: 900;
}

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

.rank-page-list {
  display: grid;
  gap: 10px;
}

.rank-page-list li a {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr) 360px;
  align-items: center;
  gap: 16px;
  min-height: 64px;
  padding: 12px 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: #fff;
}

.rank-page-list span {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  font-weight: 900;
}

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

.rank-page-list em {
  color: var(--muted);
  font-style: normal;
  text-align: right;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: #0f172a;
}

.detail-bg {
  position: absolute;
  inset: 0;
  opacity: 0.35;
  filter: blur(6px);
  transform: scale(1.04);
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.62));
}

.detail-hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  margin: 0 auto;
  padding: 58px 24px;
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 34px;
  align-items: end;
}

.detail-poster {
  overflow: hidden;
  border-radius: 22px;
  background: linear-gradient(135deg, #1e3a8a, #0f172a);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.38);
}

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

.breadcrumb {
  margin-bottom: 14px;
  color: rgba(255, 255, 255, 0.75);
  font-size: 14px;
}

.breadcrumb a {
  color: #bfdbfe;
}

.detail-info h1 {
  margin: 0 0 18px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  font-weight: 900;
}

.detail-info p {
  max-width: 840px;
  color: rgba(255, 255, 255, 0.84);
  font-size: 18px;
  line-height: 1.8;
}

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

.detail-meta span {
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 13px;
  font-weight: 800;
}

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

.detail-main {
  display: grid;
  gap: 22px;
}

.player-card {
  position: relative;
  overflow: hidden;
  background: #000;
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  color: #fff;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.18));
  font-size: 20px;
  font-weight: 900;
  cursor: pointer;
}

.play-overlay span {
  width: 62px;
  height: 62px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: var(--primary);
  box-shadow: 0 14px 35px rgba(37, 99, 235, 0.45);
}

.player-card.is-playing .play-overlay {
  display: none;
}

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

.text-card p {
  margin: 0;
  color: #374151;
  line-height: 1.95;
  font-size: 16px;
}

.detail-side {
  display: grid;
  gap: 20px;
}

.side-card dl {
  margin: 0;
  display: grid;
  gap: 12px;
}

.side-card dl div {
  display: grid;
  grid-template-columns: 58px minmax(0, 1fr);
  gap: 12px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.side-card dl div:last-child {
  border-bottom: 0;
  padding-bottom: 0;
}

.side-card dt {
  color: var(--muted);
}

.side-card dd {
  margin: 0;
  font-weight: 800;
}

.next-card a {
  display: block;
  padding: 10px 0;
  color: var(--primary);
  font-weight: 800;
}

.site-footer {
  margin-top: 60px;
  border-top: 1px solid var(--line);
  background: #fff;
}

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

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

.footer-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  font-weight: 800;
  color: var(--primary);
}

.footer-bottom {
  padding: 18px 24px 28px;
  color: var(--muted);
  text-align: center;
  font-size: 14px;
}

[hidden] {
  display: none !important;
}

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

  .two-column-section,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .ranking-panel,
  .detail-side {
    order: 2;
  }

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

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

  .mobile-menu-button {
    display: inline-flex;
  }

  .hero {
    height: 620px;
  }

  .hero-content {
    bottom: 70px;
  }

  .hero-arrow {
    display: none;
  }

  .search-panel {
    grid-template-columns: 1fr;
  }

  .movie-grid,
  .featured-grid,
  .small-grid,
  .library-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

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

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

  .detail-hero-inner {
    grid-template-columns: 140px minmax(0, 1fr);
    gap: 18px;
    padding-top: 38px;
    padding-bottom: 38px;
  }

  .rank-page-list li a {
    grid-template-columns: 46px minmax(0, 1fr);
  }

  .rank-page-list em {
    grid-column: 2;
    text-align: left;
  }

  .footer-inner {
    flex-direction: column;
  }
}

@media (max-width: 540px) {
  .header-inner,
  .section-inner,
  .section-block,
  .detail-hero-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .brand {
    font-size: 18px;
  }

  .hero-content h1 {
    font-size: 30px;
  }

  .hero-content h2 {
    font-size: 25px;
  }

  .hero-content p,
  .detail-info p,
  .page-hero p {
    font-size: 15px;
  }

  .movie-grid,
  .featured-grid,
  .small-grid,
  .library-grid,
  .category-chip-grid,
  .category-card-grid {
    grid-template-columns: 1fr;
  }

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

  .detail-poster {
    width: 170px;
  }
}
