:root {
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-solid: #0f172a;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --cyan: #22d3ee;
  --blue: #38bdf8;
  --pink: #f472b6;
  --green: #34d399;
  --gold: #fbbf24;
  --radius: 22px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-width: 320px;
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.16), transparent 34rem),
    radial-gradient(circle at top right, rgba(244, 114, 182, 0.12), transparent 32rem),
    linear-gradient(180deg, #020617 0%, #0f172a 46%, #020617 100%);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(148, 163, 184, 0.04) 1px, transparent 1px),
    linear-gradient(90deg, rgba(148, 163, 184, 0.04) 1px, transparent 1px);
  background-size: 44px 44px;
  mask-image: linear-gradient(to bottom, black, transparent 72%);
  z-index: -1;
}

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

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

button,
input {
  font: inherit;
}

.site-shell {
  min-height: 100vh;
}

.header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(2, 6, 23, 0.76);
  backdrop-filter: blur(22px);
  border-bottom: 1px solid var(--line);
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 900;
  letter-spacing: -0.04em;
  font-size: 22px;
}

.logo-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), #2563eb 52%, var(--pink));
  color: #00111a;
  box-shadow: 0 0 30px rgba(34, 211, 238, 0.28);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 6px;
  color: #dbeafe;
}

.nav-links a {
  padding: 9px 13px;
  border-radius: 999px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-links a:hover,
.nav-links a.is-active {
  color: #fff;
  background: rgba(34, 211, 238, 0.12);
  transform: translateY(-1px);
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.8);
  color: #fff;
  cursor: pointer;
}

.main {
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 22px 54px;
}

.hero {
  position: relative;
  height: min(720px, 74vh);
  min-height: 560px;
  margin: 0 -22px 44px;
  overflow: hidden;
  isolation: isolate;
  border-bottom: 1px solid var(--line);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.9s ease, transform 1.2s ease;
}

.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
}

.hero-media {
  position: absolute;
  inset: 0;
}

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

.hero-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.94) 0%, rgba(2, 6, 23, 0.68) 42%, rgba(2, 6, 23, 0.16) 100%),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.36) 42%, transparent 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  height: 100%;
  margin: 0 auto;
  padding: 86px 22px 54px;
  display: grid;
  align-items: end;
}

.hero-content {
  max-width: 720px;
  animation: rise 0.8s ease both;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  border: 1px solid rgba(34, 211, 238, 0.28);
  color: #a5f3fc;
  background: rgba(8, 47, 73, 0.45);
  font-size: 13px;
  font-weight: 700;
}

.hero h1,
.page-hero h1,
.detail-title {
  margin: 18px 0 16px;
  font-size: clamp(36px, 7vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.08em;
}

.hero-desc,
.page-desc,
.detail-desc {
  max-width: 760px;
  color: #cbd5e1;
  font-size: 18px;
}

.hero-meta,
.card-meta,
.detail-meta,
.rank-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  align-items: center;
}

.pill,
.tag {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  min-height: 28px;
  padding: 4px 10px;
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line);
  font-size: 13px;
}

.pill.hot {
  color: #fff7ed;
  border-color: rgba(251, 191, 36, 0.36);
  background: rgba(120, 53, 15, 0.52);
}

.hero-actions,
.section-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 24px;
}

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 18px;
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), #2563eb);
  color: #00111a;
  font-weight: 900;
  box-shadow: 0 16px 32px rgba(34, 211, 238, 0.23);
  cursor: pointer;
  transition: transform 0.18s ease, box-shadow 0.18s ease, filter 0.18s ease;
}

.button:hover {
  transform: translateY(-2px);
  filter: saturate(1.1);
  box-shadow: 0 20px 44px rgba(34, 211, 238, 0.32);
}

.button.ghost {
  color: #e0f2fe;
  background: rgba(15, 23, 42, 0.58);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: none;
}

.hero-controls {
  position: absolute;
  right: max(22px, calc((100vw - 1280px) / 2 + 22px));
  bottom: 52px;
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
}

.hero-dot {
  width: 11px;
  height: 11px;
  border: 0;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.36);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

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

.search-panel {
  margin: -78px 0 38px;
  position: relative;
  z-index: 8;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 14px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(20px);
  box-shadow: var(--shadow);
}

.search-input {
  width: 100%;
  min-height: 50px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  outline: 0;
  border-radius: 16px;
  padding: 0 16px;
  color: #fff;
  background: rgba(2, 6, 23, 0.68);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.filter-chip {
  min-height: 40px;
  padding: 0 14px;
  border-radius: 999px;
  border: 1px solid var(--line);
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.7);
  cursor: pointer;
  transition: color 0.18s ease, background 0.18s ease, border-color 0.18s ease;
}

.filter-chip:hover,
.filter-chip.is-active {
  color: #00111a;
  background: var(--cyan);
  border-color: var(--cyan);
}

.section {
  margin-top: 42px;
}

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

.section h2,
.detail-section h2 {
  margin: 0;
  font-size: clamp(26px, 3.2vw, 42px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.section p,
.muted {
  color: var(--muted);
}

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

.movie-card {
  position: relative;
  overflow: hidden;
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.78);
  border: 1px solid var(--line);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.26);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(34, 211, 238, 0.42);
  box-shadow: 0 24px 58px rgba(8, 145, 178, 0.16);
}

.poster {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(145deg, rgba(14, 165, 233, 0.22), rgba(244, 114, 182, 0.12));
}

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

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

.poster::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.9), transparent 45%);
}

.score {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 4px 8px;
  border-radius: 999px;
  color: #111827;
  background: linear-gradient(135deg, #fef08a, var(--gold));
  font-size: 12px;
  font-weight: 900;
}

.card-body {
  padding: 14px;
}

.card-title {
  margin: 0 0 8px;
  min-height: 44px;
  font-size: 16px;
  line-height: 1.35;
  font-weight: 850;
}

.card-line {
  margin: 10px 0 0;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.58;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.page-hero {
  margin: 34px 0;
  padding: clamp(28px, 6vw, 64px);
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.18), transparent 28rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.86));
  box-shadow: var(--shadow);
}

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

.category-card {
  min-height: 180px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.12), transparent),
    rgba(15, 23, 42, 0.78);
  box-shadow: 0 18px 46px rgba(0, 0, 0, 0.22);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  border-color: rgba(34, 211, 238, 0.38);
}

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

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

.rank-item {
  display: grid;
  grid-template-columns: 64px 82px 1fr auto;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.72);
}

.rank-no {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: #00111a;
  background: linear-gradient(135deg, var(--cyan), var(--gold));
  font-weight: 950;
}

.rank-cover {
  width: 82px;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  overflow: hidden;
  background: rgba(148, 163, 184, 0.12);
}

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

.rank-title {
  margin: 0 0 6px;
  font-size: 18px;
}

.detail-hero {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 34px;
  align-items: end;
  margin: 34px 0;
  padding: clamp(22px, 5vw, 48px);
  border: 1px solid var(--line);
  border-radius: 34px;
  background:
    radial-gradient(circle at 18% 20%, rgba(34, 211, 238, 0.18), transparent 25rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.86));
  box-shadow: var(--shadow);
}

.detail-poster {
  overflow: hidden;
  border-radius: 26px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.5);
  background: rgba(148, 163, 184, 0.12);
}

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

.detail-title {
  font-size: clamp(36px, 5.6vw, 72px);
}

.player-section {
  margin: 42px 0;
}

.player-frame {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  border: 1px solid rgba(34, 211, 238, 0.24);
  background: #000;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.52);
}

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

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  color: #fff;
  background:
    linear-gradient(0deg, rgba(2, 6, 23, 0.78), rgba(2, 6, 23, 0.38)),
    var(--poster-image) center / cover no-repeat;
  cursor: pointer;
  z-index: 2;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

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

.play-badge {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 16px 22px;
  border-radius: 999px;
  color: #00111a;
  background: linear-gradient(135deg, var(--cyan), #fff);
  font-weight: 950;
  box-shadow: 0 20px 58px rgba(34, 211, 238, 0.28);
}

.content-card {
  padding: clamp(22px, 4vw, 34px);
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.78);
  box-shadow: 0 18px 54px rgba(0, 0, 0, 0.22);
}

.content-card p {
  color: #cbd5e1;
  font-size: 17px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 28px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.footer {
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.72);
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 34px 22px;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 24px;
  color: #94a3b8;
}

.footer h3,
.footer h4 {
  margin-top: 0;
  color: #fff;
}

.empty-state {
  display: none;
  padding: 30px;
  border: 1px dashed var(--line);
  border-radius: 22px;
  color: #cbd5e1;
  text-align: center;
}

@keyframes rise {
  from {
    opacity: 0;
    transform: translateY(22px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

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

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

@media (max-width: 860px) {
  .nav {
    align-items: flex-start;
  }

  .menu-button {
    display: inline-grid;
    place-items: center;
  }

  .nav-links {
    position: absolute;
    top: 72px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border: 1px solid var(--line);
    border-radius: 20px;
    background: rgba(2, 6, 23, 0.95);
  }

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

  .hero {
    min-height: 620px;
    height: 78vh;
  }

  .hero-media::after {
    background:
      linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.78) 45%, rgba(2, 6, 23, 0.32) 100%);
  }

  .hero-inner {
    padding-top: 90px;
  }

  .hero-controls {
    left: 22px;
    right: auto;
    bottom: 24px;
  }

  .search-panel {
    grid-template-columns: 1fr;
    margin-top: -58px;
  }

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

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

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

  .detail-poster {
    max-width: 320px;
  }

  .rank-item {
    grid-template-columns: 44px 64px 1fr;
  }

  .rank-item .button {
    grid-column: 1 / -1;
  }

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

@media (max-width: 560px) {
  .main {
    padding-left: 14px;
    padding-right: 14px;
  }

  .nav {
    padding-left: 14px;
    padding-right: 14px;
  }

  .hero {
    margin-left: -14px;
    margin-right: -14px;
  }

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

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

  .card-body {
    padding: 12px;
  }

  .card-title {
    font-size: 15px;
  }

  .section-head {
    display: block;
  }

  .rank-item {
    grid-template-columns: 42px 56px 1fr;
    gap: 10px;
  }

  .rank-cover {
    width: 56px;
  }
}
