:root {
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: #111827;
  --bg-card-strong: #0b1120;
  --line: #1e293b;
  --line-bright: #334155;
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --accent: #2563eb;
  --accent-soft: #3b82f6;
  --accent-glow: rgba(37, 99, 235, 0.38);
  --danger: #ef4444;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  min-height: 100%;
  background: var(--bg);
  color: var(--text);
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100%;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
  background:
    radial-gradient(circle at top left, rgba(37, 99, 235, 0.18), transparent 34rem),
    linear-gradient(180deg, #020617 0%, #0f172a 42%, #020617 100%);
  color: var(--text);
}

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

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  border-bottom: 1px solid rgba(30, 41, 59, 0.9);
  background: rgba(15, 23, 42, 0.94);
  backdrop-filter: blur(18px);
}

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

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

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: linear-gradient(135deg, var(--accent), #06b6d4);
  box-shadow: 0 0 30px var(--accent-glow);
  color: #ffffff;
  font-size: 14px;
}

.brand-name {
  white-space: nowrap;
  font-size: 20px;
}

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

.nav-link,
.mobile-link {
  color: var(--muted-strong);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.mobile-link:hover,
.nav-link.is-active,
.mobile-link.is-active {
  color: #ffffff;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 4px;
}

.header-search input,
.mobile-search input,
.search-panel input {
  min-width: 210px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(2, 6, 23, 0.66);
  color: var(--text);
  outline: none;
}

.header-search input:focus,
.mobile-search input:focus,
.search-panel input:focus {
  border-color: var(--accent-soft);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.18);
}

.header-search button,
.mobile-search button,
.search-panel button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  margin-left: auto;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.55);
}

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

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

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

.mobile-search {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
  margin-bottom: 14px;
}

.mobile-search input {
  min-width: 0;
  width: 100%;
}

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

.mobile-link {
  padding: 12px 14px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.48);
}

.hero-section {
  position: relative;
  min-height: calc(100vh - 68px);
  overflow: hidden;
  background: #020617;
}

.hero-track {
  position: relative;
  min-height: calc(100vh - 68px);
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 360px);
  gap: 58px;
  align-items: center;
  padding: 86px max(32px, calc((100vw - 1180px) / 2)) 108px;
  background-position: center;
  background-size: cover;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.015);
  transition: opacity 0.7s ease, transform 0.7s ease;
}

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

.hero-copy {
  max-width: 720px;
  position: relative;
  z-index: 2;
}

.eyebrow {
  margin: 0 0 14px;
  color: #60a5fa;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1,
.detail-copy h1 {
  margin: 0;
  color: #ffffff;
  font-weight: 900;
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero-copy h1 {
  font-size: clamp(44px, 7vw, 92px);
}

.hero-line {
  max-width: 650px;
  margin: 22px 0 0;
  color: #dbeafe;
  font-size: clamp(18px, 2vw, 24px);
}

.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 {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  color: #dbeafe;
  font-size: 12px;
  line-height: 1;
}

.hero-tags span,
.detail-tags span {
  padding: 8px 12px;
}

.tag-row span {
  padding: 6px 9px;
}

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

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

.primary-btn {
  background: linear-gradient(135deg, var(--accent), #06b6d4);
  color: #ffffff;
  box-shadow: 0 16px 38px var(--accent-glow);
}

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

.ghost-btn {
  border: 1px solid rgba(226, 232, 240, 0.24);
  background: rgba(15, 23, 42, 0.68);
  color: #ffffff;
}

.primary-btn.wide {
  width: 100%;
}

.hero-poster {
  width: min(34vw, 360px);
  border: 1px solid rgba(226, 232, 240, 0.16);
  border-radius: 28px;
  overflow: hidden;
  box-shadow: var(--shadow);
  transform: rotate(2deg);
}

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

.hero-controls {
  position: absolute;
  left: max(32px, calc((100vw - 1180px) / 2));
  bottom: 42px;
  z-index: 4;
  display: flex;
  gap: 9px;
}

.hero-dot {
  width: 34px;
  height: 7px;
  border: 0;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.32);
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
  width: 56px;
  background: #60a5fa;
}

.hero-quick {
  position: absolute;
  right: max(32px, calc((100vw - 1180px) / 2));
  bottom: 34px;
  z-index: 4;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-quick a {
  border: 1px solid rgba(226, 232, 240, 0.15);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(2, 6, 23, 0.62);
  color: #e2e8f0;
  font-size: 14px;
}

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

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

.section-heading h2 {
  margin: 0;
  color: #ffffff;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
}

.section-heading p {
  margin: 10px 0 0;
  color: var(--muted);
}

.section-more,
.rank-play {
  min-height: 40px;
  background: rgba(15, 23, 42, 0.82);
  border: 1px solid var(--line-bright);
  color: #ffffff;
}

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

.category-card {
  min-height: 190px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  gap: 10px;
  border: 1px solid rgba(148, 163, 184, 0.2);
  border-radius: var(--radius);
  padding: 22px;
  background-size: cover;
  background-position: center;
  box-shadow: 0 16px 42px rgba(0, 0, 0, 0.24);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-card:hover,
.movie-card:hover,
.featured-card:hover,
.category-overview-card:hover,
.rank-row:hover {
  transform: translateY(-4px);
  border-color: rgba(96, 165, 250, 0.58);
}

.category-card span {
  color: #ffffff;
  font-size: 24px;
  font-weight: 900;
}

.category-card strong {
  color: #dbeafe;
  font-size: 14px;
  font-weight: 500;
}

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

.movie-card {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.72);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
  box-shadow: 0 20px 48px rgba(0, 0, 0, 0.32);
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: #0b1120;
}

.poster-link img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform 0.35s ease;
}

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

.poster-year {
  position: absolute;
  top: 10px;
  right: 10px;
  border-radius: 999px;
  padding: 5px 8px;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.poster-play,
.featured-play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 56px;
  height: 56px;
  border-radius: 50%;
  background: rgba(37, 99, 235, 0.9);
  color: #ffffff;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.85);
  transition: opacity 0.2s ease, transform 0.2s ease;
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.5);
}

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

.card-body {
  padding: 14px;
}

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

.card-line {
  display: -webkit-box;
  min-height: 44px;
  margin: 0 0 10px;
  overflow: hidden;
  color: var(--muted-strong);
  font-size: 13px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-meta,
.meta-line {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 12px;
}

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

.featured-card {
  display: grid;
  grid-template-columns: 108px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 18px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.72);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.featured-image {
  position: relative;
  border-radius: 14px;
  overflow: hidden;
}

.featured-image img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.featured-copy p {
  margin: 0 0 6px;
  color: #60a5fa;
  font-size: 12px;
  font-weight: 800;
}

.featured-copy h3 {
  margin: 0 0 8px;
  color: #ffffff;
  line-height: 1.25;
}

.featured-copy span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 64px 86px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 20px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.72);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.rank-row.compact {
  grid-template-columns: 58px 70px minmax(0, 1fr) auto;
}

.rank-num {
  color: #60a5fa;
  font-size: 26px;
  font-weight: 900;
  text-align: center;
}

.rank-poster {
  border-radius: 12px;
  overflow: hidden;
}

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

.rank-copy h2 {
  margin: 0 0 6px;
  color: #ffffff;
  font-size: 20px;
}

.rank-copy p {
  display: -webkit-box;
  margin: 0 0 8px;
  overflow: hidden;
  color: var(--muted-strong);
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.page-shell {
  padding: 54px 0 80px;
}

.page-hero {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 26px;
  padding: 44px;
  background:
    radial-gradient(circle at top right, rgba(37, 99, 235, 0.32), transparent 24rem),
    rgba(15, 23, 42, 0.72);
  box-shadow: var(--shadow);
}

.page-hero h1 {
  font-size: clamp(36px, 5vw, 66px);
}

.page-hero p:not(.eyebrow) {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted-strong);
  font-size: 18px;
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 22px;
  color: var(--muted);
  font-size: 14px;
}

.breadcrumbs a {
  color: #bfdbfe;
}

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

.category-overview-card {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.72);
  overflow: hidden;
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.category-overview-link {
  display: block;
  padding: 16px;
}

.category-thumbs {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
  margin-bottom: 16px;
}

.category-thumbs img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
}

.category-overview-copy h2 {
  margin: 0 0 10px;
  color: #ffffff;
}

.category-overview-copy p {
  min-height: 52px;
  margin: 0 0 12px;
  color: var(--muted-strong);
}

.category-overview-copy span {
  color: #60a5fa;
  font-weight: 800;
}

.movie-list-section,
.search-results,
.full-rank {
  margin-top: 28px;
}

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

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 10px;
  max-width: 720px;
  margin-top: 28px;
}

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

.search-status {
  margin-bottom: 18px;
  color: var(--muted-strong);
}

.movie-card.is-hidden,
.rank-row.is-hidden {
  display: none;
}

.detail-page {
  padding: 34px 0 80px;
}

.detail-top {
  margin-top: 24px;
}

.player-shell {
  position: relative;
  width: 100%;
  aspect-ratio: 16 / 9;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 24px;
  background: #000000;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.movie-video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.78), rgba(2, 6, 23, 0.2));
  color: #ffffff;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-overlay span {
  width: 84px;
  height: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  padding-left: 6px;
  background: linear-gradient(135deg, var(--accent), #06b6d4);
  box-shadow: 0 20px 60px var(--accent-glow);
  font-size: 30px;
}

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

.detail-grid {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 34px;
  margin-top: 34px;
}

.detail-poster-card {
  position: sticky;
  top: 96px;
  align-self: start;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 22px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.72);
}

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

.detail-copy h1 {
  font-size: clamp(36px, 6vw, 68px);
}

.detail-line {
  margin: 18px 0 0;
  color: #dbeafe;
  font-size: 22px;
}

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

.detail-meta {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin: 26px 0 0;
}

.detail-meta div {
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 16px;
  padding: 14px;
  background: rgba(15, 23, 42, 0.72);
}

.detail-meta dt {
  margin-bottom: 6px;
  color: var(--muted);
  font-size: 12px;
}

.detail-meta dd {
  margin: 0;
  color: #ffffff;
  font-weight: 800;
}

.text-panel {
  margin-top: 24px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 20px;
  padding: 24px;
  background: rgba(15, 23, 42, 0.72);
}

.text-panel h2 {
  margin: 0 0 12px;
  color: #ffffff;
}

.text-panel p {
  margin: 0;
  color: var(--muted-strong);
  font-size: 17px;
}

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

.site-footer {
  margin-top: 88px;
  border-top: 1px solid rgba(30, 41, 59, 0.9);
  background: rgba(2, 6, 23, 0.64);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 28px;
  padding: 42px 0;
}

.footer-grid h2 {
  margin: 0 0 14px;
  color: #ffffff;
  font-size: 16px;
}

.footer-grid ul {
  list-style: none;
  padding: 0;
  margin: 0;
}

.footer-grid li + li {
  margin-top: 8px;
}

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

.footer-brand p {
  max-width: 310px;
}

.footer-bottom {
  display: flex;
  justify-content: center;
  gap: 12px;
  border-top: 1px solid rgba(30, 41, 59, 0.9);
  padding: 18px 16px;
  color: var(--muted);
  font-size: 14px;
}

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

  .menu-toggle {
    display: block;
  }

  .hero-slide {
    grid-template-columns: 1fr;
    gap: 26px;
    padding-top: 64px;
  }

  .hero-poster {
    display: none;
  }

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

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

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

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

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

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

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

@media (max-width: 760px) {
  .container,
  .nav-wrap,
  .mobile-panel {
    width: min(100% - 24px, 1180px);
  }

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

  .hero-section,
  .hero-track {
    min-height: 680px;
  }

  .hero-slide {
    min-height: 680px;
    padding: 54px 20px 116px;
  }

  .hero-copy h1 {
    font-size: clamp(38px, 12vw, 58px);
  }

  .hero-quick {
    left: 20px;
    right: 20px;
    justify-content: flex-start;
  }

  .hero-controls {
    left: 20px;
    bottom: 88px;
  }

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

  .category-grid,
  .featured-grid,
  .category-overview-grid {
    grid-template-columns: 1fr;
  }

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

  .featured-card {
    grid-template-columns: 96px minmax(0, 1fr);
  }

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

  .rank-play {
    grid-column: 2 / -1;
    justify-self: start;
  }

  .page-hero {
    padding: 28px;
  }

  .detail-meta {
    grid-template-columns: 1fr;
  }

  .text-panel {
    padding: 18px;
  }

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

  .footer-bottom {
    flex-direction: column;
    align-items: center;
  }
}
