:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.86);
  --panel-strong: #111827;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --cyan: #06b6d4;
  --blue: #3b82f6;
  --orange: #f97316;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.18), transparent 34rem),
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.14), transparent 30rem),
    linear-gradient(180deg, #020617 0%, #0f172a 48%, #020617 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

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

button,
input {
  font: inherit;
}

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

.header-inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 76px;
  margin: 0 auto;
  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: inline-grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 12px 32px rgba(6, 182, 212, 0.28);
  color: white;
  font-weight: 900;
}

.brand-text {
  max-width: 248px;
  font-weight: 900;
  letter-spacing: 0.04em;
  line-height: 1.2;
}

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

.nav-link {
  color: var(--soft);
  font-weight: 700;
  transition: color 0.2s ease;
}

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

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 6px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
}

.header-search input,
.mobile-search input,
.search-panel input,
.search-hero-bar input,
.local-filter {
  min-width: 0;
  border: 0;
  outline: 0;
  color: white;
  background: transparent;
}

.header-search input {
  width: 210px;
  padding: 8px 10px 8px 14px;
}

.header-search button,
.mobile-search button,
.search-panel button,
.search-hero-bar button {
  border: 0;
  border-radius: 999px;
  padding: 9px 16px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: white;
  font-weight: 800;
  cursor: pointer;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 8px 12px;
  background: rgba(15, 23, 42, 0.8);
  color: white;
}

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

.mobile-nav {
  display: grid;
  gap: 12px;
  padding: 8px 0 16px;
}

.mobile-search {
  display: flex;
  gap: 8px;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 8px;
  background: rgba(15, 23, 42, 0.86);
}

.mobile-search input {
  flex: 1;
  padding: 10px;
}

.hero-carousel {
  position: relative;
  min-height: 650px;
  overflow: hidden;
  background: #020617;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  background-position: center;
  background-size: cover;
  transition: opacity 0.72s ease, transform 1.2s ease;
  transform: scale(1.04);
}

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

.hero-content {
  width: min(1180px, calc(100% - 32px));
  min-height: 650px;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  gap: 22px;
  position: relative;
  z-index: 2;
}

.hero-kicker,
.eyebrow {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  border-radius: 999px;
  padding: 7px 14px;
  background: rgba(6, 182, 212, 0.15);
  border: 1px solid rgba(6, 182, 212, 0.36);
  color: #67e8f9;
  font-weight: 800;
  letter-spacing: 0.08em;
}

.hero-content h1 {
  max-width: 820px;
  margin: 0;
  font-size: clamp(2.8rem, 8vw, 6.5rem);
  line-height: 0.95;
  letter-spacing: -0.06em;
}

.hero-content p {
  max-width: 760px;
  margin: 0;
  color: #dbeafe;
  font-size: clamp(1rem, 2.4vw, 1.3rem);
  line-height: 1.85;
}

.hero-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: #dbeafe;
}

.hero-meta span,
.detail-meta span,
.detail-meta a {
  border-radius: 999px;
  padding: 8px 13px;
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

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

.primary-btn,
.ghost-btn,
.panel-link,
.section-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  border-radius: 999px;
  padding: 0 22px;
  font-weight: 900;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-btn {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: white;
  box-shadow: 0 18px 42px rgba(6, 182, 212, 0.24);
}

.ghost-btn,
.panel-link,
.section-more {
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.74);
  color: #dbeafe;
}

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

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

.hero-dot {
  width: 38px;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.32);
  cursor: pointer;
}

.hero-dot.is-active {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
}

main,
.page-main,
.detail-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.search-hero-bar {
  margin: -34px auto 42px;
  position: relative;
  z-index: 8;
}

.search-hero-bar form,
.search-panel {
  display: flex;
  gap: 10px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.search-hero-bar input,
.search-panel input {
  flex: 1;
  padding: 14px 16px;
}

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

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

.section-heading h2,
.ranking-panel h2,
.side-card h2 {
  margin: 10px 0 0;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1;
}

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

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

.movie-card {
  display: flex;
  min-width: 0;
  flex-direction: column;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.76);
  box-shadow: 0 18px 48px rgba(0, 0, 0, 0.22);
  transition: transform 0.24s ease, border-color 0.24s ease, box-shadow 0.24s ease;
}

.movie-card:hover {
  transform: translateY(-7px);
  border-color: rgba(6, 182, 212, 0.55);
  box-shadow: 0 28px 72px rgba(8, 145, 178, 0.22);
}

.poster-wrap {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: #020617;
}

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

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

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

.card-year,
.rank-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  border-radius: 999px;
  padding: 5px 9px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: white;
  font-size: 0.76rem;
  font-weight: 900;
}

.rank-badge {
  background: linear-gradient(135deg, var(--orange), #ef4444);
}

.play-dot {
  position: absolute;
  left: 50%;
  top: 50%;
  width: 58px;
  height: 58px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.20);
  color: white;
  transform: translate(-50%, -50%) scale(0.86);
  opacity: 0;
  backdrop-filter: blur(10px);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

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

.card-body {
  display: grid;
  gap: 8px;
  padding: 14px;
}

.card-body strong {
  min-height: 2.8em;
  color: white;
  font-size: 1rem;
  line-height: 1.4;
}

.card-body em,
.related-item em,
.ranking-line em {
  color: var(--muted);
  font-size: 0.84rem;
  font-style: normal;
}

.card-desc {
  min-height: 3.2em;
  color: #cbd5e1;
  font-size: 0.88rem;
  line-height: 1.6;
}

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

.tag-row span,
.detail-tags span {
  border-radius: 999px;
  padding: 4px 8px;
  background: rgba(148, 163, 184, 0.12);
  color: #a5f3fc;
  font-size: 0.76rem;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

.split-section .content-section {
  padding-top: 0;
}

.ranking-panel,
.side-card,
.detail-card,
.player-shell,
.category-large,
.page-hero,
.filter-strip {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: var(--shadow);
}

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

.ranking-list {
  display: grid;
  gap: 10px;
  margin: 22px 0;
}

.ranking-line {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
  padding: 12px;
  border-radius: 16px;
  background: rgba(15, 23, 42, 0.82);
}

.ranking-line span {
  grid-row: span 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--orange), #ef4444);
  font-weight: 900;
}

.ranking-line strong {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

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

.category-tile,
.category-large {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  gap: 10px;
  padding: 22px;
  border-radius: 24px;
  background-size: cover;
  background-position: center;
  overflow: hidden;
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.category-tile:hover,
.category-large:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 70px rgba(6, 182, 212, 0.18);
}

.category-tile span,
.category-large span {
  font-size: 1.35rem;
  font-weight: 900;
}

.category-tile strong,
.category-large p {
  margin: 0;
  color: #cbd5e1;
  line-height: 1.7;
}

.page-main {
  padding: 34px 0 16px;
}

.page-hero {
  padding: clamp(30px, 6vw, 64px);
  background:
    radial-gradient(circle at top right, rgba(6, 182, 212, 0.22), transparent 24rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.96), rgba(2, 6, 23, 0.92));
}

.page-hero h1 {
  margin: 14px 0 12px;
  font-size: clamp(2.2rem, 6vw, 5rem);
  line-height: 1;
  letter-spacing: -0.04em;
}

.page-hero p {
  max-width: 820px;
  margin: 0;
  color: #cbd5e1;
  font-size: 1.08rem;
  line-height: 1.8;
}

.filter-strip {
  margin-top: 24px;
  padding: 12px;
}

.local-filter {
  width: 100%;
  padding: 16px 18px;
  border-radius: 18px;
  background: rgba(2, 6, 23, 0.64);
  color: white;
}

.empty-tip {
  margin: 36px 0;
  color: var(--muted);
  text-align: center;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  padding: 26px 0 18px;
  color: var(--muted);
}

.breadcrumb a {
  color: #67e8f9;
}

.breadcrumb strong {
  color: white;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
  padding-bottom: 56px;
}

.detail-primary {
  display: grid;
  gap: 22px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  background: #000;
  aspect-ratio: 16 / 9;
}

.movie-video {
  width: 100%;
  height: 100%;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 0;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.18), rgba(2, 6, 23, 0.62));
  color: white;
  cursor: pointer;
}

.player-overlay span {
  width: 88px;
  height: 88px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.20);
  font-size: 2.6rem;
  backdrop-filter: blur(12px);
}

.player-overlay strong {
  font-size: 1.15rem;
}

.player-overlay.is-hidden {
  display: none;
}

.detail-card {
  padding: clamp(22px, 4vw, 36px);
}

.detail-badge {
  display: inline-flex;
  border-radius: 999px;
  padding: 7px 14px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: white;
  font-weight: 900;
}

.detail-card h1 {
  margin: 18px 0 14px;
  font-size: clamp(2rem, 5vw, 4rem);
  line-height: 1.1;
}

.detail-card h2 {
  margin: 28px 0 12px;
  font-size: 1.4rem;
}

.detail-card p {
  margin: 0 0 14px;
  color: #cbd5e1;
  line-height: 1.95;
}

.detail-tags {
  margin-top: 18px;
}

.detail-side {
  display: grid;
  gap: 22px;
  position: sticky;
  top: 96px;
}

.side-card {
  padding: 18px;
}

.poster-card img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 18px;
  margin-bottom: 16px;
}

.full-btn {
  width: 100%;
}

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

.related-item {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  background: rgba(2, 6, 23, 0.45);
  transition: background 0.2s ease;
}

.related-item:hover {
  background: rgba(8, 145, 178, 0.20);
}

.related-item img {
  width: 72px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
}

.related-item strong {
  display: block;
  margin-bottom: 6px;
  line-height: 1.35;
}

.search-page .movie-card.is-hidden,
.movie-card.is-hidden {
  display: none;
}

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

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

.footer-brand {
  display: grid;
  gap: 14px;
  align-content: start;
}

.footer-brand p {
  margin: 0;
  color: var(--muted);
  line-height: 1.8;
}

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

.footer-links div {
  display: grid;
  gap: 10px;
}

.footer-links h3 {
  margin: 0 0 8px;
}

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

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

.footer-bottom {
  border-top: 1px solid var(--line);
  padding: 18px;
  color: var(--muted);
  text-align: center;
}

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

  .menu-toggle {
    display: inline-flex;
  }

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

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

  .ranking-panel,
  .detail-side {
    position: static;
  }
}

@media (max-width: 720px) {
  .header-inner,
  main,
  .page-main,
  .detail-main,
  .footer-inner,
  .mobile-panel {
    width: min(100% - 24px, 1180px);
  }

  .brand-text {
    max-width: 180px;
    font-size: 0.92rem;
  }

  .hero-carousel,
  .hero-content {
    min-height: 590px;
  }

  .hero-content {
    gap: 16px;
  }

  .hero-actions,
  .search-hero-bar form,
  .search-panel,
  .mobile-search {
    flex-direction: column;
  }

  .search-hero-bar {
    margin-top: -22px;
  }

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

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

  .card-body {
    padding: 12px;
  }

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

  .category-tile,
  .category-large {
    min-height: 150px;
    padding: 16px;
  }

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

@media (max-width: 430px) {
  .movie-grid,
  .all-grid {
    grid-template-columns: 1fr;
  }

  .poster-wrap {
    aspect-ratio: 16 / 10;
  }
}
