* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: #111827;
  --panel-2: #1e293b;
  --border: #243244;
  --text: #f8fafc;
  --muted: #94a3b8;
  --cyan: #06b6d4;
  --cyan-light: #67e8f9;
  --yellow: #facc15;
  --danger: #fb7185;
  --shadow: 0 25px 60px rgba(0, 0, 0, 0.38);
  --radius: 18px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: linear-gradient(180deg, #020617 0%, #0f172a 42%, #020617 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

body::before {
  position: fixed;
  inset: 0;
  z-index: -1;
  content: "";
  pointer-events: none;
  background:
    radial-gradient(circle at 15% 10%, rgba(6, 182, 212, 0.12), transparent 26%),
    radial-gradient(circle at 85% 20%, rgba(14, 165, 233, 0.10), transparent 24%),
    radial-gradient(circle at 50% 80%, rgba(8, 47, 73, 0.28), transparent 35%);
}

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

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 24px;
}

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

.logo-mark {
  display: inline-grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--cyan), #0891b2);
  box-shadow: 0 0 24px rgba(6, 182, 212, 0.35);
}

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

.desktop-nav a {
  transition: color 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.is-active {
  color: var(--cyan-light);
}

.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 270px;
  padding: 5px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.92);
}

.nav-search input {
  min-width: 0;
  width: 100%;
  padding: 8px 12px;
  border: 0;
  outline: none;
  color: var(--text);
  background: transparent;
}

.nav-search button,
.primary-button,
.secondary-button,
.player-start,
.filter-button {
  border: 0;
  color: #ffffff;
  border-radius: 999px;
  background: var(--cyan);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.nav-search button {
  padding: 8px 16px;
}

.nav-search button:hover,
.primary-button:hover,
.player-start:hover,
.filter-button:hover {
  transform: translateY(-1px);
  background: #0891b2;
  box-shadow: 0 15px 30px rgba(6, 182, 212, 0.22);
}

.mobile-menu-button {
  display: none;
  border: 0;
  color: #ffffff;
  background: transparent;
  font-size: 26px;
}

.mobile-nav {
  display: none;
  padding: 12px 24px 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  background: rgba(15, 23, 42, 0.96);
}

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

.main-shell,
.page-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 54px 24px;
}

.hero {
  position: relative;
  height: 70vh;
  min-height: 560px;
  overflow: hidden;
  background: #000000;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1000ms ease;
}

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.hero-slide::after {
  position: absolute;
  inset: 0;
  content: "";
  background:
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.82) 26%, rgba(2, 6, 23, 0.18) 72%),
    linear-gradient(90deg, rgba(2, 6, 23, 0.72), transparent 62%);
}

.hero-content {
  position: absolute;
  left: max(24px, calc((100vw - 1280px) / 2 + 24px));
  right: 24px;
  bottom: 72px;
  z-index: 2;
  max-width: 760px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 8px 13px;
  border: 1px solid rgba(103, 232, 249, 0.28);
  border-radius: 999px;
  color: var(--cyan-light);
  background: rgba(8, 47, 73, 0.42);
}

.hero h1,
.hero h2 {
  margin: 0 0 18px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

.hero p {
  max-width: 700px;
  margin: 0 0 24px;
  color: #cbd5e1;
  font-size: clamp(17px, 2vw, 22px);
}

.hero-meta,
.detail-meta,
.card-meta,
.tag-list,
.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero-meta {
  margin-bottom: 28px;
  color: #dbeafe;
}

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

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  font-weight: 700;
}

.secondary-button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  color: #ffffff;
  background: rgba(15, 23, 42, 0.66);
}

.secondary-button:hover {
  border-color: rgba(103, 232, 249, 0.38);
  color: var(--cyan-light);
}

.hero-control {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: grid;
  width: 48px;
  height: 48px;
  place-items: center;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.5);
  transform: translateY(-50%);
  transition: background 0.2s ease;
}

.hero-control:hover {
  background: rgba(0, 0, 0, 0.75);
}

.hero-control.prev {
  left: 24px;
}

.hero-control.next {
  right: 24px;
}

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

.hero-dots button {
  width: 12px;
  height: 12px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dots button.is-active {
  width: 32px;
  background: var(--cyan);
}

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

.section-heading h2,
.page-title,
.detail-title {
  margin: 0;
  color: #ffffff;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.section-heading p,
.page-lead {
  max-width: 820px;
  margin: 8px 0 0;
  color: var(--muted);
}

.section-link {
  flex: none;
  color: var(--cyan-light);
  font-weight: 700;
}

.content-section {
  margin-bottom: 70px;
}

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

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

.movie-card {
  position: relative;
  min-width: 0;
  border: 1px solid rgba(148, 163, 184, 0.10);
  border-radius: var(--radius);
  background: rgba(30, 41, 59, 0.74);
  overflow: hidden;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.24);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-5px) scale(1.015);
  border-color: rgba(103, 232, 249, 0.32);
  box-shadow: var(--shadow);
}

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

.poster-wrap {
  position: relative;
  aspect-ratio: 4 / 5;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a, #164e63);
}

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

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

.movie-card:hover .poster-wrap img {
  filter: saturate(1.08) contrast(1.05);
  transform: scale(1.08);
}

.poster-wrap::after {
  position: absolute;
  inset: 0;
  content: "";
  opacity: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.78), transparent 58%);
  transition: opacity 0.25s ease;
}

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

.pill,
.rating-badge,
.category-chip,
.meta-pill,
.tag,
.rank-number {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border-radius: 999px;
  white-space: nowrap;
}

.pill-top {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 5px 10px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.68);
  font-size: 12px;
}

.rating-badge {
  position: absolute;
  left: 10px;
  bottom: 10px;
  z-index: 2;
  padding: 5px 9px;
  color: var(--yellow);
  background: rgba(0, 0, 0, 0.68);
  font-size: 12px;
  font-weight: 800;
}

.play-float {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  display: grid;
  width: 60px;
  height: 60px;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(6, 182, 212, 0.92);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.72);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

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

.movie-card-body h3 {
  display: -webkit-box;
  min-height: 48px;
  margin: 0 0 8px;
  overflow: hidden;
  color: #ffffff;
  font-size: 17px;
  line-height: 1.4;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  transition: color 0.2s ease;
}

.movie-card:hover h3 {
  color: var(--cyan-light);
}

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

.card-meta {
  gap: 8px;
  color: #94a3b8;
  font-size: 13px;
}

.card-meta span {
  overflow: hidden;
  max-width: 100%;
  text-overflow: ellipsis;
}

.category-chip {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 5px 10px;
  color: #cffafe;
  background: rgba(8, 47, 73, 0.8);
  font-size: 12px;
}

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

.category-tile {
  min-height: 180px;
  padding: 22px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius);
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.96), rgba(8, 47, 73, 0.72));
  box-shadow: 0 16px 45px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-tile:hover {
  transform: translateY(-4px);
  border-color: rgba(103, 232, 249, 0.35);
}

.category-tile h2,
.category-tile h3 {
  margin: 0 0 10px;
}

.category-tile p {
  margin: 0 0 20px;
  color: #cbd5e1;
}

.category-count {
  color: var(--cyan-light);
  font-weight: 800;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin: 28px 0;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.78);
}

.filter-bar input,
.search-hero input {
  width: 100%;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 999px;
  outline: none;
  color: #ffffff;
  background: rgba(2, 6, 23, 0.72);
}

.filter-bar input {
  padding: 13px 18px;
}

.filter-button {
  padding: 0 22px;
  font-weight: 700;
}

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

.rank-row {
  display: grid;
  grid-template-columns: auto 120px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.11);
  border-radius: var(--radius);
  background: rgba(30, 41, 59, 0.72);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-row:hover {
  transform: translateX(5px);
  border-color: rgba(103, 232, 249, 0.32);
}

.rank-number {
  justify-content: center;
  width: 42px;
  height: 42px;
  color: #020617;
  background: var(--cyan-light);
  font-weight: 900;
}

.rank-row img {
  width: 120px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 12px;
}

.rank-row h2,
.rank-row h3 {
  margin: 0 0 6px;
  color: #ffffff;
}

.rank-row p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--muted);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rank-score {
  color: var(--yellow);
  font-size: 20px;
  font-weight: 900;
}

.breadcrumb {
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 14px;
}

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

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

.player-card,
.detail-panel,
.side-panel,
.search-hero,
.empty-state {
  border: 1px solid rgba(148, 163, 184, 0.11);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.84);
  box-shadow: 0 20px 55px rgba(0, 0, 0, 0.28);
}

.player-card {
  position: relative;
  margin-bottom: 24px;
  overflow: hidden;
  background: #000000;
}

.player-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.player-frame video {
  width: 100%;
  height: 100%;
  background: #000000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 22px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.18));
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.player-start {
  min-width: 180px;
  min-height: 54px;
  padding: 0 26px;
  font-size: 18px;
  font-weight: 900;
}

.player-message {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 16px;
  color: #cbd5e1;
  font-size: 14px;
  text-align: center;
}

.detail-panel,
.side-panel,
.search-hero,
.empty-state {
  padding: 24px;
}

.detail-title {
  margin-bottom: 18px;
}

.detail-meta {
  margin-bottom: 18px;
}

.meta-pill,
.tag {
  padding: 6px 11px;
  color: #cbd5e1;
  background: rgba(51, 65, 85, 0.88);
  font-size: 14px;
}

.meta-pill.score {
  color: var(--yellow);
}

.one-line {
  margin: 0 0 18px;
  color: var(--cyan-light);
  font-size: 19px;
  font-weight: 700;
}

.detail-text {
  color: #cbd5e1;
  font-size: 16px;
}

.detail-panel h2 {
  margin: 0 0 14px;
  font-size: 24px;
}

.detail-panel + .detail-panel {
  margin-top: 24px;
}

.tag-list {
  margin-top: 22px;
}

.side-panel {
  position: sticky;
  top: 94px;
}

.side-panel h2,
.side-panel h3 {
  margin: 0 0 16px;
}

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

.compact-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 14px;
  background: rgba(30, 41, 59, 0.65);
  transition: background 0.2s ease, transform 0.2s ease;
}

.compact-card:hover {
  background: rgba(51, 65, 85, 0.95);
  transform: translateX(4px);
}

.compact-cover {
  display: block;
  overflow: hidden;
  border-radius: 12px;
}

.compact-cover img {
  width: 112px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.compact-info {
  min-width: 0;
}

.compact-info strong,
.compact-info em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-info strong {
  color: #ffffff;
}

.compact-info em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.compact-score {
  color: var(--yellow);
  font-weight: 900;
}

.search-hero {
  margin-bottom: 34px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.94), rgba(8, 47, 73, 0.52));
}

.search-hero form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  margin-top: 20px;
}

.search-hero input {
  padding: 16px 20px;
  font-size: 17px;
}

.result-summary {
  margin: 0 0 20px;
  color: var(--muted);
}

.empty-state {
  color: var(--muted);
  text-align: center;
}

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

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 32px;
  max-width: 1280px;
  margin: 0 auto;
  padding: 42px 24px 28px;
  color: var(--muted);
}

.footer-grid h3 {
  margin: 0 0 12px;
  color: #ffffff;
}

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

.footer-grid a:hover {
  color: var(--cyan-light);
}

.copyright {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px 32px;
  color: #64748b;
  font-size: 13px;
}

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

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

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

  .side-panel {
    position: static;
  }
}

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

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

  .hero {
    min-height: 580px;
  }

  .hero-content {
    left: 24px;
    bottom: 82px;
  }

  .hero-control {
    display: none;
  }

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

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

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

  .rank-score {
    grid-column: 3;
  }

  .rank-row img {
    width: 92px;
  }

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

@media (max-width: 560px) {
  .nav-shell,
  .main-shell,
  .page-shell {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero {
    min-height: 620px;
  }

  .hero-content {
    left: 16px;
    right: 16px;
  }

  .hero-actions,
  .filter-bar,
  .search-hero form {
    grid-template-columns: 1fr;
    flex-direction: column;
  }

  .primary-button,
  .secondary-button,
  .filter-button {
    width: 100%;
  }

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

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

  .compact-score {
    grid-column: 2;
  }

  .compact-cover img {
    width: 96px;
  }
}
