:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.72);
  --panel-strong: rgba(15, 23, 42, 0.92);
  --text: #f8fafc;
  --muted: #94a3b8;
  --line: rgba(148, 163, 184, 0.18);
  --accent: #10b981;
  --accent-dark: #059669;
  --gold: #fbbf24;
  --radius: 18px;
  --shadow: 0 18px 50px rgba(0, 0, 0, 0.35);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 20% 10%, rgba(16, 185, 129, 0.14), transparent 28%),
    radial-gradient(circle at 80% 0%, rgba(59, 130, 246, 0.12), transparent 24%),
    var(--bg);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

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

button,
input {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.78);
  backdrop-filter: blur(18px);
}

.site-header-inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-weight: 800;
  letter-spacing: 0.04em;
  white-space: nowrap;
}

.site-logo-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #22d3ee);
  box-shadow: 0 0 24px rgba(16, 185, 129, 0.3);
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: #cbd5e1;
  font-size: 15px;
}

.site-nav a {
  padding: 8px 0;
  transition: color 0.2s ease;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--accent);
}

.top-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
  width: min(360px, 38vw);
}

.top-search input,
.filter-bar input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  color: #e2e8f0;
  background: rgba(15, 23, 42, 0.78);
  outline: none;
  padding: 11px 16px;
}

.top-search input:focus,
.filter-bar input:focus {
  border-color: rgba(16, 185, 129, 0.72);
  box-shadow: 0 0 0 3px rgba(16, 185, 129, 0.14);
}

.top-search button,
.primary-button,
.ghost-button,
.filter-chip {
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.top-search button,
.primary-button {
  color: #fff;
  background: var(--accent);
  padding: 11px 18px;
  font-weight: 700;
}

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

.ghost-button {
  color: #e2e8f0;
  border: 1px solid rgba(226, 232, 240, 0.32);
  background: rgba(15, 23, 42, 0.42);
  padding: 11px 18px;
  font-weight: 700;
}

.ghost-button:hover {
  border-color: rgba(16, 185, 129, 0.72);
  color: #fff;
}

.mobile-menu-button {
  display: none;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: #fff;
  background: rgba(15, 23, 42, 0.7);
  padding: 8px 11px;
}

.hero-slider {
  position: relative;
  height: 70vh;
  min-height: 500px;
  overflow: hidden;
  background: #020617;
}

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

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

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.9) 0%, rgba(2, 6, 23, 0.72) 42%, rgba(2, 6, 23, 0.08) 100%),
    linear-gradient(0deg, rgba(2, 6, 23, 1) 0%, rgba(2, 6, 23, 0) 38%);
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
}

.hero-copy {
  width: min(680px, 100%);
  padding-top: 34px;
}

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

.hero-copy h1,
.hero-copy h2,
.page-hero h1,
.detail-title-block h1 {
  margin: 0;
  color: #fff;
  font-size: clamp(40px, 7vw, 76px);
  line-height: 1.02;
  letter-spacing: -0.04em;
}

.hero-copy p,
.page-hero p,
.detail-title-block p {
  margin: 22px 0 0;
  max-width: 720px;
  color: #dbeafe;
  font-size: clamp(16px, 2vw, 20px);
  line-height: 1.85;
}

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

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

.hero-tags span,
.detail-tags span,
.movie-tags span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  color: #d1fae5;
  background: rgba(16, 185, 129, 0.14);
  padding: 6px 10px;
  font-size: 13px;
}

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

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.48);
  cursor: pointer;
  transform: translateY(-50%);
}

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.72);
}

.hero-prev {
  left: 22px;
}

.hero-next {
  right: 22px;
}

.hero-dots {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 28px;
  display: flex;
  gap: 10px;
  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(--accent);
}

.section-block {
  padding: 74px 0 0;
}

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

.section-heading h2 {
  margin: 0;
  color: #fff;
  font-size: clamp(26px, 4vw, 36px);
  letter-spacing: -0.03em;
}

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

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

.movie-grid {
  display: grid;
  gap: 22px;
}

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

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

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

.mt-large {
  margin-top: 34px;
}

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

.movie-card-link {
  display: block;
  min-width: 0;
}

.movie-poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 14px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.9), rgba(30, 41, 59, 0.72));
  box-shadow: var(--shadow);
}

.movie-poster-wide {
  width: 172px;
  height: 108px;
  aspect-ratio: auto;
  flex: 0 0 auto;
}

.movie-poster-landscape {
  aspect-ratio: 16 / 9;
}

.movie-poster img,
.detail-poster img,
.category-tile img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, opacity 0.3s ease;
}

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

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.04) 55%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.movie-card:hover .poster-shade {
  opacity: 1;
}

.play-icon,
.player-play-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: rgba(16, 185, 129, 0.88);
  border-radius: 999px;
}

.play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 48px;
  height: 48px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.86);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.play-icon-big {
  width: 66px;
  height: 66px;
}

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

.rating-badge,
.rank-badge {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.rating-badge {
  top: 10px;
  right: 10px;
  padding: 5px 8px;
  background: rgba(0, 0, 0, 0.72);
}

.rank-badge {
  top: 10px;
  left: 10px;
  min-width: 34px;
  height: 34px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.movie-card-body {
  display: grid;
  gap: 7px;
  padding-top: 12px;
  min-width: 0;
}

.movie-card-body strong {
  overflow: hidden;
  color: #fff;
  font-size: 15px;
  font-weight: 700;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.movie-card:hover .movie-card-body strong {
  color: var(--accent);
}

.movie-meta,
.movie-card-desc {
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.movie-card-desc {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-card-large .movie-card-link {
  position: relative;
}

.movie-card-body-overlay {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 28px;
}

.movie-card-body-overlay strong {
  font-size: 24px;
  white-space: normal;
}

.movie-card-horizontal .movie-card-link {
  display: flex;
  gap: 16px;
  min-height: 126px;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.58);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

.movie-card-horizontal .movie-card-link:hover {
  border-color: rgba(16, 185, 129, 0.36);
  background: rgba(15, 23, 42, 0.84);
  transform: translateY(-2px);
}

.movie-card-horizontal .movie-card-body {
  align-content: center;
  padding: 0;
}

.category-panel,
.ranking-panel,
.detail-panel,
.side-card,
.player-card {
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.38);
  box-shadow: var(--shadow);
}

.category-panel,
.ranking-panel {
  padding: 34px;
}

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

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

.category-tile {
  position: relative;
  display: grid;
  align-items: end;
  min-height: 132px;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.76);
  box-shadow: var(--shadow);
}

.category-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.18));
}

.category-tile img {
  position: absolute;
  inset: 0;
}

.category-tile span,
.category-tile small {
  position: relative;
  z-index: 2;
  padding: 0 18px;
}

.category-tile span {
  color: #fff;
  font-size: 20px;
  font-weight: 800;
}

.category-tile small {
  padding-bottom: 16px;
  color: #cbd5e1;
}

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

.ranking-list-full {
  grid-template-columns: 1fr;
}

.page-hero,
.detail-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a, #020617);
}

.compact-hero {
  padding: 74px 0 62px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.compact-hero h1 {
  font-size: clamp(36px, 6vw, 58px);
}

.filter-bar {
  display: grid;
  gap: 14px;
  margin-bottom: 28px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.52);
}

.filter-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-chip {
  color: #cbd5e1;
  border: 1px solid rgba(148, 163, 184, 0.18);
  background: rgba(30, 41, 59, 0.6);
  padding: 8px 13px;
}

.filter-chip.is-active,
.filter-chip:hover {
  color: #fff;
  border-color: rgba(16, 185, 129, 0.52);
  background: rgba(16, 185, 129, 0.24);
}

.filter-status {
  color: var(--muted);
  font-size: 14px;
}

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

.detail-bg-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.64), rgba(2, 6, 23, 0.86)),
    linear-gradient(0deg, rgba(2, 6, 23, 1), rgba(2, 6, 23, 0) 45%);
}

.detail-hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 36px;
  align-items: center;
  min-height: 460px;
  padding: 54px 0;
}

.detail-poster {
  overflow: hidden;
  border-radius: 20px;
  aspect-ratio: 2 / 3;
  background: #111827;
  box-shadow: var(--shadow);
}

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

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

.player-card {
  padding: 12px;
}

.video-shell {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: #000;
  aspect-ratio: 16 / 9;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  color: #fff;
  background: radial-gradient(circle, rgba(2, 6, 23, 0.16), rgba(2, 6, 23, 0.76));
  cursor: pointer;
}

.player-card.is-playing .player-overlay {
  opacity: 0;
  pointer-events: none;
}

.player-play-icon {
  width: 76px;
  height: 76px;
  font-size: 30px;
  box-shadow: 0 0 40px rgba(16, 185, 129, 0.36);
}

.detail-panel,
.side-card {
  padding: 24px;
}

.detail-panel h2,
.side-card h2 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 22px;
}

.detail-panel p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.9;
}

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

.detail-info-grid div {
  display: grid;
  gap: 6px;
  min-width: 0;
}

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

.detail-info-grid strong {
  color: #fff;
  font-size: 15px;
}

.detail-side {
  align-self: start;
  position: sticky;
  top: 96px;
}

.site-footer {
  margin-top: 78px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  background: rgba(2, 6, 23, 0.84);
}

.footer-inner {
  display: grid;
  gap: 12px;
  padding: 34px 0;
  color: var(--muted);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

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

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

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

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

  .detail-side {
    position: static;
  }
}

@media (max-width: 860px) {
  .site-header-inner {
    flex-wrap: wrap;
    gap: 14px;
    padding: 14px 0;
  }

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

  .site-nav {
    display: none;
    width: 100%;
    order: 3;
    flex-direction: column;
    align-items: flex-start;
    gap: 8px;
    padding: 12px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.96);
  }

  .site-nav.is-open {
    display: flex;
  }

  .top-search {
    width: 100%;
    order: 4;
  }

  .hero-slider {
    min-height: 560px;
  }

  .hero-arrow {
    display: none;
  }

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

  .feature-grid,
  .ranking-list {
    grid-template-columns: 1fr;
  }

  .detail-hero-inner {
    grid-template-columns: 160px 1fr;
    gap: 22px;
  }

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

@media (max-width: 620px) {
  .container,
  .site-header-inner {
    width: min(100% - 22px, 1180px);
  }

  .hero-copy h1,
  .hero-copy h2,
  .detail-title-block h1 {
    font-size: 38px;
  }

  .section-block {
    padding-top: 50px;
  }

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

  .movie-grid.six-cols,
  .movie-grid.four-cols {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

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

  .category-panel,
  .ranking-panel {
    padding: 22px;
  }

  .movie-card-horizontal .movie-card-link {
    gap: 12px;
  }

  .movie-poster-wide {
    width: 128px;
    height: 88px;
  }

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

  .detail-poster {
    width: 170px;
  }

  .detail-panel,
  .side-card {
    padding: 20px;
  }
}
