:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.78);
  --panel-strong: rgba(15, 23, 42, 0.94);
  --line: rgba(148, 163, 184, 0.18);
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --text: #f8fafc;
  --emerald: #34d399;
  --emerald-deep: #059669;
  --cyan: #22d3ee;
  --red: #f87171;
  --shadow: 0 22px 70px rgba(0, 0, 0, 0.38);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 18% 8%, rgba(16, 185, 129, 0.20), transparent 26rem),
    radial-gradient(circle at 82% 14%, rgba(34, 211, 238, 0.18), transparent 30rem),
    linear-gradient(180deg, #020617 0%, #0f172a 42%, #020617 100%);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
}

body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  background-image:
    linear-gradient(rgba(255, 255, 255, 0.025) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255, 255, 255, 0.025) 1px, transparent 1px);
  background-size: 42px 42px;
  mask-image: linear-gradient(to bottom, black, transparent 80%);
  z-index: -1;
}

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

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

button,
input,
select {
  font: inherit;
}

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

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

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

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 16px;
  color: #04111d;
  font-weight: 900;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  box-shadow: 0 14px 34px rgba(34, 211, 238, 0.18);
}

.brand-name {
  font-size: 20px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link,
.mobile-link {
  border-radius: 999px;
  padding: 10px 14px;
  color: var(--soft);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
  color: white;
  background: rgba(255, 255, 255, 0.10);
}

.header-search {
  margin-left: auto;
  width: min(380px, 100%);
  display: flex;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.82);
}

.header-search input,
.mobile-search input,
.filter-input,
.filter-select {
  width: 100%;
  border: 0;
  outline: none;
  color: white;
  background: transparent;
}

.header-search input,
.mobile-search input {
  padding: 11px 14px;
}

.header-search button,
.mobile-search button,
.primary-btn,
.ghost-btn,
.player-button {
  border: 0;
  border-radius: 999px;
  color: #04111d;
  font-weight: 800;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  cursor: pointer;
  transition: transform 0.2s ease, filter 0.2s ease;
}

.header-search button,
.mobile-search button {
  margin-right: 4px;
  padding: 8px 16px;
}

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 0 22px;
}

.ghost-btn {
  color: white;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.16);
}

.header-search button:hover,
.mobile-search button:hover,
.primary-btn:hover,
.ghost-btn:hover,
.player-button:hover {
  transform: translateY(-1px);
  filter: brightness(1.05);
}

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

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: white;
}

.mobile-panel {
  display: none;
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto 16px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: var(--panel-strong);
}

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

.mobile-panel nav {
  display: grid;
  gap: 8px;
  margin-bottom: 14px;
}

.mobile-search {
  display: flex;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.55);
  overflow: hidden;
}

main {
  min-height: 70vh;
}

.page-shell,
.hero-shell {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
}

.hero {
  position: relative;
  min-height: 78vh;
  overflow: hidden;
  border-bottom: 1px solid rgba(148, 163, 184, 0.12);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.8s ease, transform 1.4s ease;
  pointer-events: none;
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

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

.hero-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.46;
  filter: saturate(1.12) contrast(1.04);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.78) 42%, rgba(2, 6, 23, 0.25)),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.36) 46%, rgba(2, 6, 23, 0.86) 100%);
}

.hero-shell {
  position: relative;
  z-index: 2;
  min-height: 78vh;
  display: grid;
  grid-template-columns: minmax(0, 1.08fr) 420px;
  gap: 44px;
  align-items: center;
  padding: 70px 0 84px;
}

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

.eyebrow {
  margin: 0 0 12px;
  color: var(--emerald);
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero h1,
.page-title h1,
.detail-title h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.05em;
}

.hero h1 span,
.gradient-text {
  background: linear-gradient(135deg, white 0%, #bbf7d0 45%, #67e8f9 100%);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.hero-summary {
  max-width: 680px;
  margin: 22px 0 0;
  color: var(--soft);
  font-size: 18px;
  line-height: 1.85;
}

.hero-tags,
.tag-row,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

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

.hero-tags span,
.tag-row span,
.detail-tags span,
.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  padding: 4px 10px;
  color: #d1fae5;
  background: rgba(16, 185, 129, 0.10);
  font-size: 13px;
}

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

.hero-card {
  position: relative;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 32px;
  padding: 16px;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.76), rgba(2, 6, 23, 0.90));
  box-shadow: var(--shadow);
  overflow: hidden;
}

.hero-card::before {
  content: "";
  position: absolute;
  inset: -80px -80px auto auto;
  width: 180px;
  height: 180px;
  border-radius: 999px;
  background: rgba(34, 211, 238, 0.16);
  filter: blur(12px);
}

.hero-card img {
  position: relative;
  z-index: 1;
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 24px;
}

.hero-card-meta {
  position: relative;
  z-index: 2;
  padding: 16px 6px 4px;
}

.hero-card-meta h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.hero-card-meta p {
  margin: 0;
  color: var(--muted);
  line-height: 1.7;
}

.hero-controls {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 32px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 12px;
}

.hero-arrow,
.hero-dot {
  border: 1px solid rgba(255, 255, 255, 0.16);
  background: rgba(15, 23, 42, 0.66);
  color: white;
  cursor: pointer;
  backdrop-filter: blur(10px);
}

.hero-arrow {
  width: 42px;
  height: 42px;
  border-radius: 999px;
}

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

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  padding: 0;
}

.hero-dot.active {
  width: 28px;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
}

.section {
  padding: 60px 0;
}

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

.section-head h2,
.page-title h1,
.detail-section h2 {
  margin: 0;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.03em;
}

.section-more {
  color: var(--emerald);
  font-weight: 800;
}

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

.movie-card,
.category-card,
.info-panel,
.player-panel,
.detail-card {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.18);
  overflow: hidden;
}

.movie-card {
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(52, 211, 153, 0.42);
  background: rgba(15, 23, 42, 0.92);
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.62);
}

.poster-link img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 0.45s ease, opacity 0.3s ease;
}

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

.play-dot {
  position: absolute;
  right: 12px;
  bottom: 12px;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #04111d;
  background: linear-gradient(135deg, var(--emerald), var(--cyan));
  box-shadow: 0 14px 30px rgba(0, 0, 0, 0.35);
}

.rank-badge {
  position: absolute;
  z-index: 2;
  left: 12px;
  top: 12px;
  min-width: 38px;
  height: 30px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #04111d;
  font-weight: 900;
  background: linear-gradient(135deg, #fef3c7, #34d399);
}

.movie-info {
  padding: 16px;
}

.movie-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
}

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

.movie-info h3 a:hover {
  color: var(--emerald);
}

.movie-info p {
  min-height: 48px;
  margin: 0 0 14px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.7;
}

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

.category-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 18px;
  padding: 18px;
  transition: transform 0.25s ease, border-color 0.25s ease;
}

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

.category-covers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 8px;
}

.category-covers img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 14px;
}

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

.category-card p {
  margin: 0 0 16px;
  color: var(--muted);
  line-height: 1.8;
}

.page-title {
  padding: 56px 0 24px;
}

.page-title p {
  max-width: 760px;
  margin: 14px 0 0;
  color: var(--soft);
  font-size: 17px;
  line-height: 1.8;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 160px 160px;
  gap: 12px;
  margin: 20px 0 28px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.72);
}

.filter-input,
.filter-select {
  min-height: 44px;
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 0 14px;
  background: rgba(2, 6, 23, 0.42);
}

.filter-select option {
  color: #0f172a;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 76px 92px minmax(0, 1fr);
  gap: 16px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: var(--panel);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-row:hover {
  transform: translateY(-3px);
  border-color: rgba(52, 211, 153, 0.36);
}

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

.rank-row img {
  width: 92px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 16px;
}

.rank-row h2,
.rank-row h3 {
  margin: 0 0 8px;
  font-size: 19px;
}

.rank-row p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.detail-hero {
  padding: 56px 0 30px;
}

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

.detail-poster {
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  border: 1px solid var(--line);
}

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

.detail-title p {
  margin: 18px 0 0;
  color: var(--soft);
  font-size: 18px;
  line-height: 1.85;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 22px 0;
}

.player-panel {
  margin-top: 28px;
  padding: 16px;
}

.player-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #000;
}

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

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.12), rgba(2, 6, 23, 0.68));
  cursor: pointer;
}

.player-cover.hidden {
  display: none;
}

.player-button {
  width: 86px;
  height: 86px;
  font-size: 30px;
  box-shadow: 0 20px 52px rgba(0, 0, 0, 0.42);
}

.detail-section {
  padding: 28px 0;
}

.detail-card {
  padding: 26px;
}

.detail-card p {
  margin: 14px 0 0;
  color: var(--soft);
  font-size: 17px;
  line-height: 1.95;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  margin-bottom: 18px;
}

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

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

.footer-inner {
  width: min(1240px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
}

.footer-inner strong {
  color: white;
}

.footer-inner p {
  margin: 8px 0 0;
}

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

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

.empty-state {
  display: none;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 22px;
  color: var(--muted);
  background: var(--panel);
}

.empty-state.show {
  display: block;
}

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

  .menu-button {
    display: block;
    margin-left: auto;
  }

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

  .hero-card {
    max-width: 420px;
  }

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

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

@media (max-width: 760px) {
  .hero,
  .hero-shell {
    min-height: auto;
  }

  .hero-shell {
    padding: 50px 0 96px;
  }

  .hero-card {
    display: none;
  }

  .section-head,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .movie-info {
    padding: 12px;
  }

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

  .category-covers {
    grid-template-columns: repeat(4, 1fr);
  }

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

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

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

  .detail-grid {
    gap: 22px;
  }

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

@media (max-width: 520px) {
  .page-shell,
  .hero-shell,
  .header-inner,
  .mobile-panel,
  .footer-inner {
    width: min(100% - 20px, 1240px);
  }

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

  .hero h1,
  .page-title h1,
  .detail-title h1 {
    font-size: 34px;
  }

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

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