:root {
  --bg: #020617;
  --bg-soft: #0f172a;
  --card: rgba(15, 23, 42, 0.78);
  --card-strong: rgba(30, 41, 59, 0.92);
  --line: rgba(96, 165, 250, 0.22);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-2: #cbd5e1;
  --blue: #2563eb;
  --blue-light: #38bdf8;
  --cyan: #67e8f9;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 20% 10%, rgba(37, 99, 235, 0.22), transparent 32rem),
    radial-gradient(circle at 80% 0%, rgba(14, 165, 233, 0.18), transparent 28rem),
    linear-gradient(135deg, #020617 0%, #0f172a 48%, #020617 100%);
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.96), rgba(30, 64, 175, 0.92), rgba(15, 23, 42, 0.96));
  border-bottom: 1px solid var(--line);
  box-shadow: 0 14px 34px rgba(2, 6, 23, 0.42);
  backdrop-filter: blur(18px);
}

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

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

.brand-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  color: white;
  box-shadow: 0 0 28px rgba(56, 189, 248, 0.35);
  font-size: 15px;
}

.brand-text,
.footer-logo {
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #60a5fa, #67e8f9);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.nav-link {
  padding: 9px 10px;
  border-radius: 12px;
  color: #dbeafe;
  font-size: 14px;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #fff;
  background: rgba(30, 64, 175, 0.55);
  transform: translateY(-1px);
}

.search-form,
.mobile-search,
.wide-search,
.page-search {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-form input,
.mobile-search input,
.wide-search input,
.page-search input {
  min-width: 0;
  border: 1px solid rgba(96, 165, 250, 0.35);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.72);
  color: white;
  outline: none;
  padding: 12px 14px;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.search-form input {
  width: 240px;
  padding: 10px 12px;
}

.search-form input:focus,
.mobile-search input:focus,
.wide-search input:focus,
.page-search input:focus {
  border-color: var(--blue-light);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.17);
}

.search-form button,
.mobile-search button,
.wide-search button,
.page-search button,
.primary-btn,
.outline-btn,
.ghost-btn,
.text-link {
  border: 0;
  border-radius: 14px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.search-form button,
.mobile-search button,
.wide-search button,
.page-search button,
.primary-btn {
  color: white;
  background: linear-gradient(135deg, var(--blue), #0ea5e9);
  padding: 12px 18px;
  font-weight: 700;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.28);
}

.search-form button {
  padding: 10px 14px;
}

.primary-btn:hover,
.search-form button:hover,
.mobile-search button:hover,
.wide-search button:hover,
.page-search button:hover {
  transform: translateY(-2px);
  background: linear-gradient(135deg, #1d4ed8, #0284c7);
}

.ghost-btn,
.outline-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 12px 18px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.48);
  color: #e2e8f0;
  font-weight: 700;
}

.ghost-btn:hover,
.outline-btn:hover {
  transform: translateY(-2px);
  background: rgba(30, 64, 175, 0.38);
  border-color: rgba(125, 211, 252, 0.5);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  color: white;
  background: rgba(15, 23, 42, 0.7);
}

.mobile-panel {
  display: none;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 12px 0 18px;
  border-top: 1px solid rgba(96, 165, 250, 0.22);
}

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

.mobile-panel a {
  display: block;
  padding: 12px 14px;
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.5);
  color: #dbeafe;
}

.hero {
  position: relative;
  height: clamp(520px, 70vh, 680px);
  overflow: hidden;
  background: #020617;
}

.hero-track,
.hero-slide {
  position: absolute;
  inset: 0;
}

.hero-slide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.9s ease;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
  filter: saturate(1.08) contrast(1.05);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(15, 23, 42, 0.54), rgba(2, 6, 23, 0.16)),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.35) 45%, rgba(2, 6, 23, 0.25) 100%);
}

.hero-content {
  position: absolute;
  left: max(24px, calc((100vw - 1280px) / 2 + 24px));
  bottom: 78px;
  width: min(720px, calc(100% - 48px));
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  margin-bottom: 18px;
  padding: 8px 14px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.82);
  color: white;
  font-size: 14px;
  box-shadow: 0 0 26px rgba(37, 99, 235, 0.42);
}

.hero h1 {
  margin: 0 0 18px;
  font-size: clamp(38px, 6vw, 68px);
  line-height: 1.03;
  letter-spacing: -0.05em;
}

.hero p {
  max-width: 650px;
  margin: 0 0 28px;
  color: #dbeafe;
  font-size: clamp(16px, 2vw, 21px);
  line-height: 1.8;
}

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

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 48px;
  height: 48px;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  color: white;
  background: rgba(0, 0, 0, 0.45);
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
}

.hero-prev {
  left: 18px;
}

.hero-next {
  right: 18px;
}

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

.hero-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.48);
  cursor: pointer;
}

.hero-dot.is-active {
  width: 30px;
  background: #38bdf8;
}

.home-search-panel,
.content-section,
.page-main,
.site-footer {
  width: min(1280px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

.home-search-panel {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
  align-items: center;
  margin-top: -46px;
  position: relative;
  z-index: 5;
  padding: 28px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(15, 23, 42, 0.88);
  box-shadow: var(--shadow);
  backdrop-filter: blur(20px);
}

.home-search-panel h2,
.section-head h2,
.page-hero h1,
.detail-card h1 {
  margin: 0;
  font-size: clamp(26px, 4vw, 42px);
  letter-spacing: -0.04em;
}

.home-search-panel p,
.section-head p,
.page-hero p {
  margin: 8px 0 0;
  color: var(--muted-2);
  line-height: 1.8;
}

.wide-search input,
.page-search input {
  flex: 1;
}

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

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

.section-link,
.text-link {
  color: var(--cyan);
  font-weight: 700;
}

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(96, 165, 250, 0.16);
  border-radius: 20px;
  background: var(--card);
  box-shadow: 0 18px 46px rgba(2, 6, 23, 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(56, 189, 248, 0.52);
  box-shadow: 0 28px 70px rgba(14, 165, 233, 0.16);
}

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

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

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

.poster-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  color: white;
  background: rgba(2, 6, 23, 0.74);
  font-size: 12px;
  font-weight: 700;
}

.movie-info {
  padding: 16px;
}

.movie-info h2,
.movie-info h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
}

.movie-meta {
  color: var(--blue-light);
  font-size: 13px;
  line-height: 1.6;
}

.movie-info p {
  margin: 9px 0 0;
  min-height: 44px;
  color: var(--muted-2);
  font-size: 14px;
  line-height: 1.6;
}

.tag-row,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.tag-row span,
.detail-tags span {
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.18);
  color: #bfdbfe;
  font-size: 12px;
}

.rank-section {
  padding: 58px 0 6px;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 54px 1fr;
  gap: 12px;
  align-items: center;
  min-height: 74px;
  padding: 14px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
}

.rank-item strong {
  color: var(--blue-light);
  font-size: 24px;
}

.rank-item span {
  display: block;
  font-weight: 750;
}

.rank-item em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

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

.compact-card {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  border-radius: 18px;
  background: #0f172a;
}

.compact-card img {
  width: 100%;
  height: 100%;
  position: absolute;
  inset: 0;
  object-fit: cover;
  opacity: 0.82;
  transition: transform 0.25s ease, opacity 0.25s ease;
}

.compact-card:hover img {
  transform: scale(1.06);
  opacity: 1;
}

.compact-card span {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 42px 12px 12px;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.96), transparent);
  font-weight: 750;
  line-height: 1.35;
}

.page-main {
  padding: 40px 0 70px;
}

.page-hero {
  padding: 42px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background:
    radial-gradient(circle at 15% 15%, rgba(37, 99, 235, 0.28), transparent 28rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(30, 64, 175, 0.34));
  box-shadow: var(--shadow);
}

.small-hero h1 {
  margin-top: 8px;
}

.breadcrumb {
  color: var(--muted);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--blue-light);
}

.category-overview {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
  margin-top: 28px;
}

.category-card {
  display: grid;
  gap: 16px;
  padding: 18px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 22px;
  background: var(--card);
}

.category-poster-stack {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  min-height: 160px;
  overflow: hidden;
  border-radius: 18px;
  background: #0f172a;
}

.category-poster-stack img {
  width: 100%;
  height: 100%;
  min-height: 160px;
  object-fit: cover;
}

.category-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.category-card p {
  margin: 0 0 12px;
  color: var(--muted-2);
  line-height: 1.7;
}

.list-toolbar {
  display: flex;
  justify-content: flex-end;
  margin: 0 0 22px;
}

.list-toolbar label {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--muted-2);
}

.list-toolbar select {
  border: 1px solid rgba(96, 165, 250, 0.3);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.78);
  color: white;
  padding: 10px 12px;
}

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

.ranking-row {
  display: grid;
  grid-template-columns: 72px 92px 1fr auto;
  gap: 18px;
  align-items: center;
  padding: 16px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 20px;
  background: var(--card);
}

.ranking-num {
  color: var(--cyan);
  font-size: 24px;
  font-weight: 900;
}

.ranking-row img {
  width: 92px;
  height: 126px;
  border-radius: 14px;
  object-fit: cover;
  background: #0f172a;
}

.ranking-row h2 {
  margin: 0 0 8px;
}

.ranking-row p {
  margin: 6px 0;
  color: var(--muted-2);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
}

.player-box {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(96, 165, 250, 0.25);
  border-radius: 24px;
  background: #000;
  box-shadow: var(--shadow);
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  color: white;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.16), rgba(2, 6, 23, 0.62));
  cursor: pointer;
}

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

.play-circle {
  width: 78px;
  height: 78px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--blue), var(--blue-light));
  box-shadow: 0 0 42px rgba(56, 189, 248, 0.42);
  font-size: 28px;
}

.detail-card,
.side-card {
  margin-top: 22px;
  padding: 24px;
  border: 1px solid rgba(96, 165, 250, 0.18);
  border-radius: 22px;
  background: var(--card);
}

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

.detail-meta span {
  padding: 7px 11px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.18);
  color: #bfdbfe;
}

.lead-text {
  color: #e0f2fe;
  font-size: 18px;
  line-height: 1.8;
}

.detail-card h2,
.side-card h2 {
  margin: 26px 0 12px;
  font-size: 24px;
}

.detail-card p,
.side-card p {
  color: var(--muted-2);
  line-height: 1.9;
}

.detail-poster {
  width: 100%;
  border-radius: 22px;
  background: #0f172a;
  box-shadow: var(--shadow);
}

.side-card {
  position: sticky;
  top: 92px;
}

.side-card p {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  border-bottom: 1px solid rgba(148, 163, 184, 0.13);
  padding-bottom: 10px;
}

.side-card strong {
  color: var(--text);
}

.block-btn {
  display: flex;
  justify-content: center;
  margin-top: 18px;
}

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

.page-search {
  margin-top: 24px;
}

.search-status {
  color: var(--cyan);
}

.site-footer {
  padding: 58px 0 28px;
  border-top: 1px solid rgba(96, 165, 250, 0.16);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 28px;
}

.footer-grid p {
  color: var(--muted-2);
  line-height: 1.8;
}

.footer-grid h2 {
  margin: 0 0 12px;
  font-size: 18px;
}

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

.footer-links a {
  padding: 8px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.8);
  color: var(--muted-2);
}

.copyright {
  margin-top: 28px;
  padding-top: 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.12);
  color: var(--muted);
  font-size: 14px;
}

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

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

  .home-grid,
  .related-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

@media (max-width: 860px) {
  .header-inner {
    height: auto;
    min-height: 64px;
  }

  .search-form {
    display: none;
  }

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    margin-left: auto;
  }

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

  .hero {
    height: 560px;
  }

  .hero-content {
    bottom: 74px;
  }

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

  .wide-search,
  .page-search,
  .mobile-search {
    flex-direction: column;
    align-items: stretch;
  }

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

  .category-overview,
  .rank-grid,
  .footer-grid,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-side {
    order: -1;
  }

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

  .side-card {
    position: static;
  }

  .ranking-row {
    grid-template-columns: 52px 82px 1fr;
  }

  .ranking-row .outline-btn {
    grid-column: 2 / 4;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .home-search-panel,
  .content-section,
  .page-main,
  .site-footer,
  .mobile-panel {
    width: min(100% - 22px, 1280px);
  }

  .hero-arrow {
    display: none;
  }

  .hero-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .movie-grid,
  .home-grid,
  .related-grid,
  .compact-grid {
    grid-template-columns: 1fr;
  }

  .compact-card {
    min-height: 260px;
  }

  .page-hero,
  .detail-card,
  .side-card {
    padding: 22px;
  }

  .ranking-row {
    grid-template-columns: 46px 1fr;
  }

  .ranking-row img {
    display: none;
  }

  .ranking-row .outline-btn {
    grid-column: 1 / 3;
  }
}
