:root {
  color-scheme: dark;
  --bg: #0c0a09;
  --panel: #1c1917;
  --panel-soft: #292524;
  --line: #44403c;
  --muted: #a8a29e;
  --text: #fafaf9;
  --amber: #f59e0b;
  --amber-dark: #d97706;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.36);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: radial-gradient(circle at top left, rgba(245, 158, 11, 0.12), transparent 34rem), var(--bg);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

img {
  max-width: 100%;
  display: block;
  background: linear-gradient(135deg, #292524, #0c0a09);
}

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

button,
input {
  font: inherit;
}

.site-header {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 50;
  background: rgba(28, 25, 23, 0.92);
  border-bottom: 1px solid rgba(68, 64, 60, 0.9);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(1180px, calc(100% - 32px));
  height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.site-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--amber);
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.02em;
}

.logo-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--amber), #facc15);
  color: #1c1917;
  box-shadow: 0 0 30px rgba(245, 158, 11, 0.45);
  font-size: 14px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-link {
  color: #d6d3d1;
  font-size: 15px;
  font-weight: 700;
  transition: color 0.2s ease;
}

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

.mobile-menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: #292524;
  color: #fff;
  cursor: pointer;
}

.mobile-menu-button span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: currentColor;
  border-radius: 999px;
}

.mobile-nav {
  display: none;
  padding: 0 18px 18px;
  border-top: 1px solid rgba(68, 64, 60, 0.8);
}

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

main {
  min-height: 70vh;
}

.hero-carousel {
  position: relative;
  height: 640px;
  overflow: hidden;
  background: #0c0a09;
}

.hero-slides,
.hero-slide {
  position: absolute;
  inset: 0;
}

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

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

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(12, 10, 9, 0.96), rgba(12, 10, 9, 0.72) 45%, rgba(12, 10, 9, 0.22)), linear-gradient(0deg, #0c0a09 0%, transparent 44%);
}

.hero-content {
  position: absolute;
  left: max(24px, calc((100% - 1180px) / 2));
  bottom: 92px;
  width: min(640px, calc(100% - 48px));
}

.hero-label,
.card-kicker,
.channel-label {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 10px;
  border-radius: 999px;
  background: rgba(245, 158, 11, 0.96);
  color: #1c1917;
  font-size: 12px;
  font-weight: 900;
}

.hero-content h1 {
  margin: 18px 0 16px;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 0.98;
  letter-spacing: -0.05em;
  font-weight: 950;
}

.hero-content p {
  max-width: 620px;
  margin: 0 0 22px;
  color: #d6d3d1;
  font-size: 18px;
  line-height: 1.8;
}

.hero-meta,
.card-meta,
.detail-meta,
.rank-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

.hero-meta span:first-child,
.score-text {
  color: var(--amber);
  font-weight: 900;
}

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

.hero-tags span,
.tag-row span,
.detail-tags span {
  padding: 5px 9px;
  border: 1px solid rgba(245, 158, 11, 0.28);
  border-radius: 999px;
  color: #fcd34d;
  background: rgba(245, 158, 11, 0.08);
  font-size: 12px;
}

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

.primary-button,
.ghost-button,
.section-more,
.search-button,
.pager-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-weight: 900;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-button,
.search-button {
  min-height: 46px;
  padding: 0 22px;
  background: var(--amber);
  color: #1c1917;
}

.primary-button:hover,
.search-button:hover {
  background: var(--amber-dark);
  transform: translateY(-1px);
}

.ghost-button,
.section-more,
.pager-link {
  min-height: 46px;
  padding: 0 20px;
  border: 1px solid rgba(245, 158, 11, 0.35);
  color: #fcd34d;
  background: rgba(28, 25, 23, 0.72);
}

.ghost-button:hover,
.section-more:hover,
.pager-link:hover {
  border-color: rgba(245, 158, 11, 0.9);
  transform: translateY(-1px);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.52);
  color: #fff;
  font-size: 42px;
  line-height: 1;
  cursor: pointer;
}

.hero-prev {
  left: 22px;
}

.hero-next {
  right: 22px;
}

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

.hero-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.46);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

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

.content-wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0 0;
}

.content-wrap.with-top {
  padding-top: 112px;
}

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

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

.section-heading h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 950;
  letter-spacing: -0.03em;
}

.section-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

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

.movie-grid.large-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 24px;
}

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

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

.card-link {
  display: block;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius);
  background: rgba(41, 37, 36, 0.92);
  box-shadow: 0 10px 36px rgba(0, 0, 0, 0.22);
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.card-link:hover {
  transform: translateY(-6px);
  background: #292524;
  box-shadow: var(--shadow);
}

.poster-wrap {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, #292524, #0c0a09);
}

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

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

.card-link:hover .poster-wrap img {
  transform: scale(1.08);
}

.score-badge,
.rank-number {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 900;
}

.score-badge {
  right: 10px;
  top: 10px;
  padding: 5px 8px;
  background: rgba(0, 0, 0, 0.68);
  color: #fcd34d;
}

.rank-number {
  left: 10px;
  top: 10px;
  min-width: 34px;
  height: 34px;
  background: var(--amber);
  color: #1c1917;
}

.card-content {
  display: grid;
  gap: 10px;
  padding: 15px;
}

.card-content h3 {
  margin: 0;
  color: #fff;
  font-size: 16px;
  font-weight: 900;
  line-height: 1.35;
}

.card-content p {
  display: -webkit-box;
  min-height: 44px;
  margin: 0;
  overflow: hidden;
  color: #d6d3d1;
  font-size: 13px;
  line-height: 1.65;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-meta {
  gap: 6px;
  font-size: 12px;
}

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

.channel-card,
.category-card {
  min-height: 180px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border: 1px solid rgba(68, 64, 60, 0.9);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(41, 37, 36, 0.95), rgba(28, 25, 23, 0.95));
  box-shadow: 0 16px 48px rgba(0, 0, 0, 0.24);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.channel-card:hover,
.category-card:hover {
  transform: translateY(-4px);
  border-color: rgba(245, 158, 11, 0.75);
}

.channel-card h3,
.category-card h2 {
  margin: 18px 0 10px;
  color: #fff;
  font-size: 21px;
  font-weight: 950;
}

.channel-card p,
.category-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
  font-size: 14px;
}

.page-hero {
  margin-bottom: 42px;
  padding: 44px;
  border: 1px solid rgba(68, 64, 60, 0.82);
  border-radius: 28px;
  background: radial-gradient(circle at top right, rgba(245, 158, 11, 0.18), transparent 30rem), linear-gradient(135deg, rgba(41, 37, 36, 0.98), rgba(12, 10, 9, 0.92));
  box-shadow: var(--shadow);
}

.page-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(32px, 5vw, 56px);
  line-height: 1.05;
  font-weight: 950;
  letter-spacing: -0.05em;
}

.page-hero p {
  max-width: 820px;
  margin: 0;
  color: #d6d3d1;
  font-size: 17px;
  line-height: 1.8;
}

.search-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  margin: 24px 0 28px;
  padding: 14px;
  border: 1px solid rgba(68, 64, 60, 0.85);
  border-radius: 18px;
  background: rgba(28, 25, 23, 0.78);
}

.movie-search {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  border: 1px solid rgba(68, 64, 60, 0.9);
  border-radius: 14px;
  outline: 0;
  background: #0c0a09;
  color: #fff;
}

.movie-search:focus {
  border-color: rgba(245, 158, 11, 0.9);
  box-shadow: 0 0 0 4px rgba(245, 158, 11, 0.12);
}

.category-tabs,
.pager-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.category-tab {
  padding: 10px 14px;
  border: 1px solid rgba(68, 64, 60, 0.88);
  border-radius: 999px;
  color: #d6d3d1;
  background: rgba(41, 37, 36, 0.88);
  font-size: 14px;
  font-weight: 800;
}

.category-tab:hover,
.category-tab.is-active {
  border-color: rgba(245, 158, 11, 0.78);
  color: #1c1917;
  background: var(--amber);
}

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

.rank-item {
  display: grid;
  grid-template-columns: 72px 96px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(68, 64, 60, 0.82);
  border-radius: 18px;
  background: rgba(28, 25, 23, 0.88);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-item:hover {
  transform: translateY(-2px);
  border-color: rgba(245, 158, 11, 0.62);
}

.rank-index {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 50px;
  height: 50px;
  border-radius: 16px;
  background: rgba(245, 158, 11, 0.12);
  color: var(--amber);
  font-size: 20px;
  font-weight: 950;
}

.rank-poster {
  width: 96px;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 14px;
}

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

.rank-copy h2 {
  margin: 0 0 8px;
  color: #fff;
  font-size: 20px;
  font-weight: 950;
}

.rank-copy p {
  margin: 0 0 10px;
  color: #d6d3d1;
  line-height: 1.7;
}

.detail-page {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 104px 0 0;
}

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

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

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) 360px;
  gap: 30px;
  align-items: start;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #000;
  box-shadow: var(--shadow);
}

.player-shell video {
  width: 100%;
  aspect-ratio: 16 / 9;
  display: block;
  background: #000;
  cursor: pointer;
}

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.42));
  color: #fff;
  cursor: pointer;
}

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

.play-circle {
  width: 82px;
  height: 82px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--amber);
  color: #1c1917;
  font-size: 32px;
  box-shadow: 0 0 50px rgba(245, 158, 11, 0.52);
}

.play-text {
  font-size: 18px;
  font-weight: 900;
}

.player-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 18px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), transparent);
  opacity: 0;
  transition: opacity 0.2s ease;
}

.player-shell:hover .player-controls,
.player-controls.is-visible {
  opacity: 1;
}

.player-controls button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 42px;
  height: 42px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
  cursor: pointer;
}

.player-controls button:hover {
  background: var(--amber);
  color: #1c1917;
}

.player-error {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 24px;
  background: rgba(0, 0, 0, 0.82);
  color: #fecaca;
  text-align: center;
}

.player-error.is-visible {
  display: flex;
}

.detail-text,
.detail-side,
.related-section {
  border: 1px solid rgba(68, 64, 60, 0.82);
  border-radius: 24px;
  background: rgba(28, 25, 23, 0.9);
  box-shadow: 0 16px 50px rgba(0, 0, 0, 0.2);
}

.detail-text {
  margin-top: 26px;
  padding: 28px;
}

.detail-text h1 {
  margin: 0 0 14px;
  color: #fff;
  font-size: clamp(28px, 4vw, 44px);
  line-height: 1.12;
  font-weight: 950;
}

.detail-text h2,
.detail-side h2,
.related-section h2 {
  margin: 30px 0 12px;
  color: #fff;
  font-size: 22px;
  font-weight: 950;
}

.detail-text h2:first-child,
.detail-side h2:first-child,
.related-section h2:first-child {
  margin-top: 0;
}

.detail-text p {
  color: #d6d3d1;
  line-height: 1.9;
}

.detail-side {
  position: sticky;
  top: 92px;
  padding: 22px;
}

.detail-cover {
  overflow: hidden;
  border-radius: 18px;
  aspect-ratio: 3 / 4;
  margin-bottom: 20px;
}

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

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 12px 0;
  border-bottom: 1px solid rgba(68, 64, 60, 0.82);
  color: var(--muted);
}

.info-row strong {
  color: #fff;
  text-align: right;
}

.related-section {
  margin-top: 34px;
  padding: 28px;
}

.site-footer {
  margin-top: 80px;
  border-top: 1px solid rgba(68, 64, 60, 0.86);
  background: rgba(28, 25, 23, 0.95);
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 34px;
}

.footer-inner p,
.footer-inner a,
.footer-bottom {
  color: var(--muted);
  line-height: 1.8;
}

.footer-inner h2 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 17px;
  font-weight: 900;
}

.footer-inner ul {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 8px;
}

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

.footer-bottom {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 20px 0 34px;
  border-top: 1px solid rgba(68, 64, 60, 0.7);
  text-align: center;
  font-size: 14px;
}

.is-filtered-out {
  display: none !important;
}

@media (max-width: 1100px) {
  .movie-grid,
  .movie-grid.detail-related {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

  .detail-side {
    position: static;
  }
}

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

  .mobile-menu-button {
    display: block;
  }

  .hero-carousel {
    height: 580px;
  }

  .hero-content {
    bottom: 78px;
  }

  .hero-content p {
    font-size: 15px;
  }

  .hero-arrow {
    display: none;
  }

  .content-wrap,
  .content-wrap.with-top,
  .detail-page {
    width: min(100% - 24px, 1180px);
  }

  .content-wrap.with-top,
  .detail-page {
    padding-top: 92px;
  }

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

  .movie-grid,
  .movie-grid.large-grid,
  .movie-grid.detail-related {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .channel-grid,
  .category-overview-grid {
    grid-template-columns: 1fr;
  }

  .page-hero {
    padding: 28px;
    border-radius: 22px;
  }

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

  .rank-item {
    grid-template-columns: 46px 74px 1fr;
  }

  .rank-action {
    grid-column: 2 / -1;
  }

  .rank-index {
    width: 42px;
    height: 42px;
    border-radius: 13px;
    font-size: 16px;
  }

  .rank-poster {
    width: 74px;
  }

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

@media (max-width: 460px) {
  .site-logo {
    font-size: 18px;
  }

  .movie-grid,
  .movie-grid.large-grid,
  .movie-grid.detail-related {
    grid-template-columns: 1fr 1fr;
  }

  .card-content {
    padding: 12px;
  }

  .card-content p,
  .tag-row {
    display: none;
  }

  .hero-actions {
    display: grid;
  }
}
