* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.72);
  --panel-strong: rgba(15, 23, 42, 0.94);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --subtle: #94a3b8;
  --cyan: #22d3ee;
  --cyan-strong: #0891b2;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  --radius: 18px;
}

html {
  scroll-behavior: smooth;
}

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

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

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

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

button,
input,
select {
  font: inherit;
}

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

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

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--cyan), #2563eb);
  color: white;
  box-shadow: 0 14px 35px rgba(34, 211, 238, 0.28);
}

.brand-text {
  font-size: 20px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
}

.nav-link {
  color: var(--muted);
  font-size: 15px;
  transition: color 0.2s ease;
}

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

.nav-search,
.mobile-search {
  display: flex;
  gap: 8px;
}

.nav-search input,
.mobile-search input,
.filter-bar input,
.filter-bar select,
.search-panel input {
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.9);
  color: var(--text);
  padding: 10px 12px;
  outline: none;
}

.nav-search input:focus,
.mobile-search input:focus,
.filter-bar input:focus,
.filter-bar select:focus,
.search-panel input:focus {
  border-color: rgba(34, 211, 238, 0.62);
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.12);
}

.nav-search button,
.mobile-search button {
  border: 0;
  border-radius: 12px;
  background: var(--cyan-strong);
  color: white;
  padding: 10px 14px;
  cursor: pointer;
}

.menu-button {
  display: none;
  margin-left: auto;
  border: 0;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.86);
  color: white;
  width: 42px;
  height: 42px;
  cursor: pointer;
}

.mobile-panel {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 18px;
}

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

.mobile-link {
  color: var(--muted);
  padding: 10px 0;
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

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

.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-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.74;
  transform: scale(1.03);
}

.hero-layer {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.72) 42%, rgba(2, 6, 23, 0.2) 100%),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0) 48%);
}

.hero-content {
  position: absolute;
  inset: auto auto 72px max(24px, calc((100vw - 1180px) / 2));
  width: min(660px, calc(100% - 48px));
  z-index: 2;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border: 1px solid rgba(34, 211, 238, 0.28);
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
}

.hero-content h1,
.page-hero h1,
.detail-content h1 {
  margin: 18px 0 14px;
  font-size: clamp(34px, 5vw, 66px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-content p,
.page-hero p {
  color: var(--muted);
  line-height: 1.9;
  font-size: clamp(16px, 1.5vw, 19px);
}

.hero-meta,
.detail-meta,
.meta-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  color: var(--subtle);
}

.hero-meta span,
.detail-meta span,
.detail-meta a,
.meta-row span {
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.76);
  border: 1px solid var(--line);
  padding: 6px 10px;
  font-size: 13px;
}

.detail-meta a {
  color: var(--cyan);
}

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

.hero-tags span,
.tag {
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.72);
  color: #dbeafe;
  padding: 6px 10px;
  font-size: 13px;
  transition: color 0.2s ease, background 0.2s ease;
}

.tag:hover {
  background: rgba(34, 211, 238, 0.16);
  color: var(--cyan);
}

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

.primary-button,
.ghost-button,
.section-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  min-height: 46px;
  padding: 0 20px;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-button {
  background: linear-gradient(135deg, #0891b2, #2563eb);
  color: white;
  box-shadow: 0 18px 40px rgba(8, 145, 178, 0.25);
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.72);
  color: var(--text);
}

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

.hero-controls {
  position: absolute;
  right: max(24px, calc((100vw - 1180px) / 2));
  bottom: 76px;
  display: flex;
  gap: 10px;
  z-index: 3;
}

.hero-dot {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(203, 213, 225, 0.48);
  cursor: pointer;
}

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

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

.muted-section {
  width: 100%;
  padding-left: max(16px, calc((100vw - 1180px) / 2));
  padding-right: max(16px, calc((100vw - 1180px) / 2));
  background: rgba(15, 23, 42, 0.42);
  border-top: 1px solid rgba(148, 163, 184, 0.08);
  border-bottom: 1px solid rgba(148, 163, 184, 0.08);
}

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

.section-heading h2,
.site-footer h2,
.detail-side h2,
.info-block h2 {
  margin: 0;
  color: white;
  font-size: 24px;
}

.section-heading p {
  margin: 8px 0 0;
  color: var(--subtle);
  line-height: 1.7;
}

.section-more {
  color: var(--cyan);
  min-height: auto;
  padding: 0;
}

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

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

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

.movie-card,
.category-card,
.category-overview-card,
.spotlight-panel,
.info-block,
.info-grid,
.player-card,
.sticky-panel,
.search-panel,
.empty-state {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.movie-card {
  position: relative;
  min-width: 0;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover,
.category-card:hover,
.category-overview-card:hover,
.ranking-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.46);
}

.card-cover {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, #0f172a, #111827);
  overflow: hidden;
}

.wide-card .card-cover {
  aspect-ratio: 16 / 9;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease, opacity 0.3s ease;
}

.movie-card:hover .card-cover img,
.compact-card:hover img,
.rank-row:hover img,
.ranking-card:hover img {
  transform: scale(1.08);
}

.play-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  margin: auto;
  border-radius: 999px;
  background: rgba(8, 145, 178, 0.9);
  opacity: 0;
  transform: scale(0.9);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .play-badge {
  opacity: 1;
  transform: scale(1);
}

.card-body {
  position: relative;
  padding: 14px;
}

.card-body h2 {
  margin: 0 0 8px;
  color: white;
  font-size: 16px;
  line-height: 1.35;
}

.card-body h2 a:hover,
.compact-card:hover span,
.rank-row:hover span {
  color: var(--cyan);
}

.card-body p {
  color: var(--subtle);
  font-size: 13px;
  line-height: 1.7;
  margin: 0 0 12px;
}

.meta-row {
  gap: 6px;
  margin-bottom: 10px;
}

.meta-row span {
  font-size: 12px;
  padding: 4px 8px;
}

.category-card,
.category-overview-card {
  padding: 18px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.category-icon {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 14px;
  background: rgba(34, 211, 238, 0.12);
  color: var(--cyan);
  font-weight: 800;
  margin-bottom: 14px;
}

.category-card h2,
.category-overview-card h2 {
  margin: 0 0 10px;
  font-size: 18px;
}

.category-card p,
.category-overview-card p {
  margin: 0;
  color: var(--subtle);
  line-height: 1.7;
  font-size: 13px;
}

.category-samples {
  display: grid;
  gap: 8px;
  margin-top: 14px;
}

.category-samples a {
  color: var(--muted);
  font-size: 13px;
}

.category-samples a:hover {
  color: var(--cyan);
}

.cover-stack {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  margin-bottom: 16px;
}

.cover-stack img {
  aspect-ratio: 2 / 3;
  width: 100%;
  height: auto;
  object-fit: cover;
  border-radius: 10px;
  background: #0f172a;
}

.split-section {
  display: grid;
  grid-template-columns: 1.4fr 0.6fr;
  gap: 28px;
  align-items: start;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 48px 84px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.62);
}

.rank-row strong {
  color: var(--cyan);
  font-size: 20px;
}

.rank-row img {
  width: 84px;
  height: 54px;
  object-fit: cover;
  border-radius: 10px;
  transition: transform 0.35s ease;
}

.rank-row span {
  color: white;
  font-weight: 700;
}

.rank-row em {
  color: var(--subtle);
  font-style: normal;
  font-size: 13px;
}

.spotlight-panel {
  padding: 28px;
  position: sticky;
  top: 96px;
}

.spotlight-panel h2 {
  margin: 18px 0 12px;
  font-size: 28px;
}

.spotlight-panel p {
  color: var(--muted);
  line-height: 1.9;
}

.page-hero {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 320px;
  display: flex;
  align-items: end;
  padding: 76px 0 48px;
}

.slim-hero,
.rank-hero {
  min-height: 260px;
}

.page-hero > div {
  width: min(780px, 100%);
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 180px;
  gap: 12px;
  margin-bottom: 24px;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 130px;
  gap: 12px;
  padding: 18px;
}

.search-panel input {
  width: 100%;
}

.hot-tags {
  margin: 22px 0 30px;
}

.empty-state {
  text-align: center;
  padding: 70px 20px;
  color: var(--subtle);
}

.empty-state h2 {
  margin: 0 0 10px;
  color: var(--text);
}

.detail-layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 70px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: var(--subtle);
  font-size: 14px;
  margin-bottom: 18px;
}

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

.player-card {
  padding: 0;
  background: #000;
}

.movie-player {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: black;
  overflow: hidden;
}

.movie-player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: black;
  cursor: pointer;
}

.center-play {
  position: absolute;
  inset: 0;
  margin: auto;
  width: 82px;
  height: 82px;
  border: 0;
  border-radius: 999px;
  background: rgba(8, 145, 178, 0.92);
  color: white;
  font-size: 30px;
  cursor: pointer;
  box-shadow: 0 18px 42px rgba(8, 145, 178, 0.32);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.center-play:hover {
  transform: scale(1.06);
}

.movie-player.is-playing .center-play {
  opacity: 0;
  pointer-events: none;
}

.player-controls {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  display: flex;
  gap: 10px;
  padding: 18px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.8), transparent);
  opacity: 0;
  transform: translateY(12px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-player:hover .player-controls,
.movie-player:focus-within .player-controls {
  opacity: 1;
  transform: translateY(0);
}

.player-controls button {
  border: 0;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.84);
  color: white;
  padding: 9px 14px;
  cursor: pointer;
}

.player-controls button:hover {
  background: rgba(8, 145, 178, 0.9);
}

.player-error {
  position: absolute;
  inset: 0;
  display: none;
  place-items: center;
  padding: 24px;
  color: white;
  background: rgba(0, 0, 0, 0.76);
  text-align: center;
}

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

.detail-content {
  padding: 26px 0 0;
}

.detail-content h1 {
  font-size: clamp(30px, 4vw, 48px);
}

.detail-tags {
  margin: 22px 0;
}

.info-block {
  margin: 18px 0;
  padding: 24px;
}

.info-block p {
  color: var(--muted);
  line-height: 1.95;
  margin: 12px 0 0;
}

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

.info-grid div {
  padding: 18px;
  border-right: 1px solid var(--line);
}

.info-grid div:last-child {
  border-right: 0;
}

.info-grid span {
  display: block;
  color: var(--subtle);
  font-size: 13px;
  margin-bottom: 8px;
}

.info-grid strong {
  color: white;
  line-height: 1.5;
}

.detail-side {
  min-width: 0;
}

.sticky-panel {
  position: sticky;
  top: 96px;
  padding: 18px;
}

.compact-list {
  display: grid;
  gap: 12px;
  margin-top: 16px;
}

.compact-card {
  display: grid;
  grid-template-columns: 96px 1fr;
  gap: 12px;
  align-items: center;
  border-radius: 14px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.64);
  overflow: hidden;
}

.compact-card img {
  width: 96px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 10px;
  transition: transform 0.35s ease;
}

.compact-card span {
  display: block;
  color: white;
  font-weight: 700;
  line-height: 1.35;
}

.compact-card em {
  display: block;
  color: var(--subtle);
  font-style: normal;
  font-size: 12px;
  margin-top: 6px;
}

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

.ranking-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.ranking-card a {
  display: grid;
  grid-template-columns: 64px 120px minmax(0, 1fr) 64px;
  gap: 18px;
  align-items: center;
  padding: 14px;
}

.ranking-card strong {
  color: var(--cyan);
  font-size: 22px;
}

.ranking-card img {
  width: 120px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  transition: transform 0.35s ease;
}

.ranking-card h2 {
  margin: 0 0 8px;
  color: white;
  font-size: 18px;
}

.ranking-card p {
  margin: 0 0 8px;
  color: var(--muted);
  line-height: 1.6;
}

.ranking-card span {
  color: var(--subtle);
  font-size: 13px;
}

.ranking-card em {
  justify-self: end;
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.13);
  color: var(--cyan);
  font-style: normal;
  font-weight: 800;
}

.site-footer {
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.76);
  padding: 48px 0 28px;
}

.footer-grid {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 1.2fr 1fr 0.8fr;
  gap: 36px;
}

.site-footer p {
  color: var(--subtle);
  line-height: 1.8;
}

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

.footer-links a {
  color: var(--muted);
  font-size: 14px;
}

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

.copyright {
  width: min(1180px, calc(100% - 32px));
  margin: 34px auto 0;
  color: #64748b;
  font-size: 13px;
}

.is-hidden {
  display: none !important;
}

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

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

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

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

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

  .spotlight-panel,
  .sticky-panel {
    position: static;
  }
}

@media (max-width: 720px) {
  .nav-wrap {
    height: 64px;
  }

  .brand-text {
    font-size: 17px;
  }

  .hero-slider {
    min-height: 82vh;
  }

  .hero-content {
    inset: auto 16px 86px 16px;
    width: auto;
  }

  .hero-controls {
    left: 16px;
    right: auto;
    bottom: 42px;
  }

  .content-section {
    padding: 48px 0;
  }

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

  .featured-grid,
  .poster-grid,
  .category-grid,
  .category-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

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

  .rank-row {
    grid-template-columns: 42px 72px 1fr;
  }

  .rank-row em {
    display: none;
  }

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

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

  .info-grid div:nth-child(2) {
    border-right: 0;
  }

  .ranking-card a {
    grid-template-columns: 52px 88px 1fr;
    gap: 12px;
  }

  .ranking-card em {
    display: none;
  }

  .ranking-card p {
    display: none;
  }

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

@media (max-width: 460px) {
  .featured-grid,
  .poster-grid,
  .category-grid,
  .category-overview-grid {
    grid-template-columns: 1fr;
  }

  .card-cover {
    aspect-ratio: 16 / 9;
  }

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

  .info-grid div {
    border-right: 0;
    border-bottom: 1px solid var(--line);
  }

  .info-grid div:last-child {
    border-bottom: 0;
  }
}
