:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.82);
  --bg-card-solid: #111827;
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(34, 211, 238, 0.38);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --cyan: #22d3ee;
  --cyan-deep: #0891b2;
  --cyan-soft: rgba(34, 211, 238, 0.12);
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 14px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background:
    radial-gradient(circle at top left, rgba(8, 145, 178, 0.22), transparent 34rem),
    linear-gradient(180deg, #020617 0%, #0f172a 50%, #020617 100%);
}

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

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

.container {
  width: min(100% - 32px, var(--max-width));
  margin-inline: auto;
}

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

.nav-shell {
  display: flex;
  align-items: center;
  min-height: 68px;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  border: 1px solid var(--line-strong);
  border-radius: 14px;
  background: linear-gradient(135deg, rgba(34, 211, 238, 0.2), rgba(15, 23, 42, 0.95));
  box-shadow: 0 12px 36px rgba(34, 211, 238, 0.16);
}

.brand-mark svg {
  width: 22px;
  height: 22px;
  fill: var(--cyan);
}

.brand-text {
  font-size: 20px;
  font-weight: 760;
  letter-spacing: -0.03em;
}

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

.desktop-nav a {
  color: var(--muted-strong);
  font-size: 14px;
  transition: color 0.2s ease;
}

.desktop-nav a:hover,
.footer-links a:hover,
.movie-card h3 a:hover,
.rank-content h3 a:hover {
  color: var(--cyan);
}

.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 0 0 260px;
}

.nav-search input,
.mobile-panel input,
.listing-controls input,
.listing-controls select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 999px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.88);
  outline: none;
}

.nav-search input,
.mobile-panel input {
  padding: 10px 14px;
}

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

.nav-search button,
.mobile-panel button,
.listing-controls button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  color: #ffffff;
  background: var(--cyan-deep);
  transition: transform 0.2s ease, background 0.2s ease;
}

.nav-search button:hover,
.mobile-panel button:hover,
.listing-controls button:hover,
.primary-button:hover {
  transform: translateY(-1px);
  background: #0e7490;
}

.menu-button {
  display: none;
  width: 44px;
  height: 44px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.82);
}

.menu-button span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  border-radius: 999px;
  background: var(--muted-strong);
}

.mobile-panel {
  display: none;
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.96);
}

.mobile-panel.is-open {
  display: block;
}

.mobile-panel-inner {
  display: grid;
  gap: 12px;
  padding: 18px 0 22px;
}

.mobile-panel a {
  color: var(--muted-strong);
}

.mobile-panel form {
  display: flex;
  gap: 8px;
}

.hero-section {
  position: relative;
  min-height: 72vh;
  overflow: hidden;
  isolation: isolate;
}

.hero-backdrop,
.detail-backdrop,
.page-hero-backdrop {
  position: absolute;
  inset: 0;
  z-index: -2;
}

.hero-backdrop img,
.detail-backdrop img,
.page-hero-backdrop img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.05);
}

.hero-gradient,
.detail-backdrop div,
.page-hero::after {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.72) 46%, rgba(2, 6, 23, 0.16) 100%),
    linear-gradient(180deg, transparent 20%, #020617 100%);
}

.hero-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  align-items: end;
  min-height: 72vh;
  gap: 48px;
  padding: 104px 0 72px;
}

.hero-copy {
  max-width: 720px;
}

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

.hero-copy h1,
.page-hero h1,
.detail-copy h1 {
  margin: 18px 0 18px;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.hero-copy p,
.page-hero p,
.detail-one-line {
  max-width: 680px;
  color: var(--muted-strong);
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.75;
}

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

.hero-meta,
.detail-meta {
  margin: 24px 0;
}

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

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

.primary-button,
.secondary-button,
.ghost-link,
.section-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  padding: 0 18px;
  font-weight: 760;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-button {
  color: #ffffff;
  background: var(--cyan-deep);
  box-shadow: 0 14px 42px rgba(8, 145, 178, 0.32);
}

.secondary-button,
.ghost-link,
.section-more {
  border: 1px solid var(--line);
  color: var(--muted-strong);
  background: rgba(15, 23, 42, 0.72);
}

.secondary-button:hover,
.ghost-link:hover,
.section-more:hover {
  transform: translateY(-1px);
  border-color: var(--line-strong);
  color: var(--cyan);
  background: rgba(8, 145, 178, 0.16);
}

.hero-dots {
  display: flex;
  gap: 8px;
  margin-top: 24px;
}

.hero-dot {
  width: 26px;
  height: 4px;
  border: 0;
  border-radius: 999px;
  background: rgba(203, 213, 225, 0.26);
}

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

.hero-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-xl);
  padding: 18px;
  background: rgba(15, 23, 42, 0.72);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.panel-title {
  display: block;
  margin-bottom: 14px;
  color: var(--muted-strong);
  font-weight: 760;
}

.hero-mini-card {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: center;
  border-radius: 18px;
  padding: 10px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-mini-card:hover {
  transform: translateX(2px);
  background: rgba(34, 211, 238, 0.08);
}

.hero-mini-card img {
  width: 76px;
  height: 54px;
  object-fit: cover;
  border-radius: 14px;
  background: #111827;
}

.hero-mini-card strong,
.hero-mini-card em {
  display: block;
}

.hero-mini-card strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.hero-mini-card em {
  margin-top: 4px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

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

.overlap-section {
  margin-top: -28px;
}

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

.section-heading h2,
.text-panel h2 {
  margin: 12px 0 8px;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

.section-heading p,
.text-panel p,
.footer-about p,
.category-card-large p,
.category-tile p,
.movie-card p,
.rank-content p {
  color: var(--muted);
  line-height: 1.7;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.18);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-4px);
  border-color: var(--line-strong);
  background: rgba(15, 23, 42, 0.94);
}

.poster-frame {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.22), transparent),
    #111827;
}

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

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

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 35%, rgba(2, 6, 23, 0.76));
}

.play-chip,
.rank-badge {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(8, 145, 178, 0.9);
  font-size: 13px;
  font-weight: 800;
}

.play-chip {
  right: 12px;
  bottom: 12px;
  padding: 7px 12px;
}

.rank-badge {
  left: 12px;
  top: 12px;
  padding: 7px 10px;
}

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

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

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

.movie-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.35;
}

.movie-card p {
  display: -webkit-box;
  min-height: 3.4em;
  margin: 0;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-size: 14px;
}

.mini-tags,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.mini-tags span,
.detail-tags span {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 5px 9px;
  color: var(--cyan);
  background: rgba(34, 211, 238, 0.08);
  font-size: 12px;
}

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

.category-tile,
.category-card-large a {
  display: block;
  min-height: 168px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 20px;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.12), transparent 50%),
    rgba(15, 23, 42, 0.78);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.category-tile:hover,
.category-card-large a:hover {
  transform: translateY(-3px);
  border-color: var(--line-strong);
}

.category-tile span,
.category-card-large h2 {
  display: block;
  margin-bottom: 10px;
  font-size: 22px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

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

.category-card-large a {
  min-height: 100%;
  padding: 14px;
}

.category-covers {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  min-height: 86px;
  margin-bottom: 16px;
}

.category-covers img {
  width: 100%;
  height: 86px;
  object-fit: cover;
  border-radius: 14px;
  background: #111827;
}

.page-hero {
  position: relative;
  overflow: hidden;
  padding: 104px 0 68px;
  isolation: isolate;
}

.compact-page-hero {
  background:
    radial-gradient(circle at top right, rgba(34, 211, 238, 0.2), transparent 34rem),
    linear-gradient(180deg, rgba(15, 23, 42, 0.9), rgba(2, 6, 23, 0.96));
}

.page-hero::after {
  content: "";
  z-index: -1;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.1), #020617 100%);
}

.page-hero h1 {
  max-width: 820px;
}

.listing-controls {
  display: grid;
  grid-template-columns: 1fr 180px 180px;
  gap: 12px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 14px;
  background: rgba(15, 23, 42, 0.72);
}

.search-controls {
  grid-template-columns: 1fr 220px auto;
}

.listing-controls input,
.listing-controls select {
  min-height: 46px;
  padding: 0 16px;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  isolation: isolate;
}

.detail-layout {
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 42px;
  align-items: end;
  min-height: 620px;
  padding: 112px 0 70px;
}

.detail-poster {
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background: #111827;
  box-shadow: var(--shadow);
}

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

.detail-copy h1 {
  max-width: 820px;
}

.player-section {
  padding: 58px 0 34px;
}

.player-box {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-xl);
  background: #000000;
  box-shadow: var(--shadow);
}

.movie-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 12px;
  border: 0;
  color: #ffffff;
  background: radial-gradient(circle, rgba(8, 145, 178, 0.24), rgba(2, 6, 23, 0.66));
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

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

.big-play-icon {
  width: 78px;
  height: 78px;
  border-radius: 50%;
  background: var(--cyan-deep);
  box-shadow: 0 18px 52px rgba(8, 145, 178, 0.42);
  clip-path: polygon(35% 25%, 35% 75%, 76% 50%);
}

.player-overlay strong {
  font-size: 20px;
}

.player-message {
  position: absolute;
  left: 18px;
  bottom: 16px;
  margin: 0;
  color: var(--muted-strong);
  font-size: 14px;
  pointer-events: none;
}

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

.text-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 24px;
  background: rgba(15, 23, 42, 0.72);
}

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

.rank-row {
  display: grid;
  grid-template-columns: 72px 120px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  padding: 12px;
  background: rgba(15, 23, 42, 0.72);
  transition: transform 0.22s ease, border-color 0.22s ease;
}

.rank-row:hover {
  transform: translateY(-2px);
  border-color: var(--line-strong);
}

.rank-number {
  color: var(--cyan);
  font-size: 28px;
  font-weight: 900;
  text-align: center;
}

.rank-thumb img {
  width: 120px;
  height: 78px;
  object-fit: cover;
  border-radius: 14px;
  background: #111827;
}

.rank-content h3 {
  margin: 0 0 8px;
  font-size: 20px;
}

.rank-content p {
  margin: 0 0 10px;
}

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

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 48px;
  padding: 48px 0;
}

.footer-brand {
  margin-bottom: 16px;
}

.footer-about p {
  max-width: 560px;
}

.site-footer h2 {
  margin: 0 0 16px;
  font-size: 16px;
}

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

.footer-links a {
  color: var(--muted);
  transition: color 0.2s ease;
}

.is-hidden-card {
  display: none;
}

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

  .nav-search {
    margin-left: auto;
  }

  .menu-button {
    display: block;
  }

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

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

  .hero-layout,
  .detail-layout,
  .detail-text-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .hero-layout {
    align-items: end;
    gap: 28px;
    padding-top: 92px;
  }

  .hero-panel {
    display: none;
  }

  .detail-layout {
    min-height: auto;
    padding-top: 92px;
  }

  .detail-poster {
    width: min(100%, 330px);
  }

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

  .listing-controls,
  .search-controls {
    grid-template-columns: 1fr;
  }

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

  .rank-row .ghost-link {
    grid-column: 2 / -1;
    width: fit-content;
  }

  .rank-thumb img {
    width: 92px;
    height: 64px;
  }
}

@media (max-width: 560px) {
  .container {
    width: min(100% - 22px, var(--max-width));
  }

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

  .hero-section,
  .hero-layout {
    min-height: 78vh;
  }

  .hero-copy h1,
  .page-hero h1,
  .detail-copy h1 {
    font-size: 38px;
  }

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

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

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

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

  .rank-thumb {
    display: none;
  }

  .rank-row .ghost-link {
    grid-column: 2;
  }
}
