:root {
  color-scheme: dark;
  --bg: #050816;
  --panel: rgba(15, 23, 42, 0.82);
  --panel-strong: rgba(15, 23, 42, 0.95);
  --line: rgba(148, 163, 184, 0.22);
  --text: #f8fafc;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --blue: #3b82f6;
  --cyan: #22d3ee;
  --purple: #8b5cf6;
  --shadow: 0 24px 80px rgba(2, 6, 23, 0.45);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background:
    radial-gradient(circle at 18% 12%, rgba(37, 99, 235, 0.28), transparent 32rem),
    radial-gradient(circle at 82% 18%, rgba(34, 211, 238, 0.2), transparent 28rem),
    linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
}

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

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

.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);
}

.nav-wrap {
  width: min(1280px, calc(100% - 32px));
  min-height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 900;
  letter-spacing: -0.03em;
  background: linear-gradient(90deg, #60a5fa, #22d3ee);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
}

.brand-icon {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.42);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  color: var(--soft);
  font-size: 15px;
}

.main-nav a {
  padding: 10px 0;
  transition: color 0.2s ease;
}

.main-nav a:hover {
  color: white;
}

.nav-toggle {
  display: none;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: white;
  background: rgba(15, 23, 42, 0.8);
  padding: 8px 12px;
  font-size: 20px;
}

main {
  min-height: 70vh;
}

.hero-carousel {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  isolation: isolate;
}

.hero-layer {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.95) 0%, rgba(2, 6, 23, 0.68) 45%, rgba(2, 6, 23, 0.36) 100%),
    radial-gradient(circle at 76% 32%, rgba(37, 99, 235, 0.22), transparent 28rem);
  z-index: 2;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  opacity: 0;
  transition: opacity 0.55s ease;
  background-image:
    linear-gradient(90deg, rgba(2, 6, 23, 0.45), rgba(2, 6, 23, 0.72)),
    var(--poster-image),
    linear-gradient(135deg, #111827, #1d4ed8);
  background-size: cover;
  background-position: center;
}

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

.hero-copy {
  position: relative;
  z-index: 3;
  width: min(820px, calc(100% - 32px));
  margin: 0 auto;
  padding-top: 72px;
}

.eyebrow {
  margin: 0 0 16px;
  color: #67e8f9;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1,
.detail-copy h1 {
  margin: 0;
  max-width: 840px;
  font-size: clamp(42px, 7vw, 84px);
  line-height: 0.98;
  letter-spacing: -0.06em;
}

.hero-desc {
  max-width: 720px;
  margin: 24px 0 0;
  color: #dbeafe;
  font-size: 19px;
  line-height: 1.85;
}

.hero-tags,
.detail-meta,
.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 26px 0;
}

.hero-tags span,
.detail-meta span,
.tag-list span {
  border: 1px solid rgba(148, 163, 184, 0.28);
  border-radius: 999px;
  padding: 7px 12px;
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.6);
}

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

.primary-btn,
.ghost-btn,
.search-box button,
.section-more,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 14px;
  padding: 0 22px;
  font-weight: 800;
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.primary-btn,
.search-box button {
  color: white;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.36);
}

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

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

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

.hero-dots button {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
  cursor: pointer;
}

.hero-dots button.is-active {
  width: 34px;
  background: white;
}

.home-search,
.content-section,
.rank-preview,
.page-hero,
.player-section,
.detail-text {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.home-search {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(320px, 540px);
  gap: 24px;
  align-items: center;
  margin-top: -58px;
  position: relative;
  z-index: 5;
  padding: 26px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.86);
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.home-search h2,
.section-head h2,
.player-info h2,
.text-card h2,
.category-overview-card h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: -0.04em;
}

.home-search p,
.section-head p,
.page-hero p,
.player-info p,
.text-card p,
.category-overview-card p {
  color: var(--muted);
  line-height: 1.8;
}

.search-box {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 12px;
}

.search-box input,
.list-filter input {
  width: 100%;
  min-height: 48px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
  color: white;
  background: rgba(2, 6, 23, 0.58);
  padding: 0 16px;
  font-size: 16px;
}

.content-section,
.rank-preview,
.player-section,
.detail-text {
  padding: 76px 0 0;
}

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

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

.category-tile,
.category-overview-card {
  min-height: 190px;
  border: 1px solid var(--line);
  border-radius: 24px;
  overflow: hidden;
  padding: 22px;
  background-image:
    linear-gradient(180deg, rgba(2, 6, 23, 0.08), rgba(2, 6, 23, 0.92)),
    var(--poster-image),
    linear-gradient(135deg, #1e293b, #1d4ed8);
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
}

.category-tile {
  display: flex;
  flex-direction: column;
  justify-content: end;
}

.category-tile span {
  font-size: 22px;
  font-weight: 900;
}

.category-tile strong {
  margin-top: 8px;
  color: #dbeafe;
  font-size: 14px;
  line-height: 1.55;
}

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

.movie-card {
  border: 1px solid var(--line);
  border-radius: 22px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.68);
  box-shadow: 0 18px 52px rgba(2, 6, 23, 0.28);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.movie-card:hover {
  border-color: rgba(96, 165, 250, 0.65);
  transform: translateY(-5px);
}

.poster-link,
.poster-frame {
  display: block;
}

.poster-frame {
  position: relative;
  aspect-ratio: 2 / 3;
  background-image:
    linear-gradient(180deg, rgba(2, 6, 23, 0.06), rgba(2, 6, 23, 0.72)),
    var(--poster-image),
    linear-gradient(135deg, #1e3a8a, #111827 70%);
  background-size: cover;
  background-position: center;
}

.type-pill,
.rank-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  border-radius: 999px;
  padding: 5px 9px;
  color: white;
  font-size: 12px;
  font-weight: 800;
  background: rgba(15, 23, 42, 0.78);
  backdrop-filter: blur(8px);
}

.rank-badge {
  left: auto;
  right: 12px;
  background: linear-gradient(135deg, #f97316, #ef4444);
}

.play-mark {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 999px;
  color: white;
  background: rgba(59, 130, 246, 0.82);
  transform: translate(-50%, -50%) scale(0.92);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.card-body {
  padding: 16px;
}

.card-body h3 {
  margin: 0;
  min-height: 48px;
  font-size: 17px;
  line-height: 1.4;
}

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

.card-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-top: 14px;
  color: #bfdbfe;
  font-size: 13px;
}

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

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

.rank-row {
  display: grid;
  grid-template-columns: 52px 76px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.72);
}

.rank-num {
  color: #67e8f9;
  font-size: 22px;
  font-weight: 900;
  text-align: center;
}

.rank-cover {
  display: block;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  background-image:
    linear-gradient(180deg, rgba(2, 6, 23, 0.05), rgba(2, 6, 23, 0.65)),
    var(--poster-image),
    linear-gradient(135deg, #1e293b, #1d4ed8);
  background-size: cover;
  background-position: center;
}

.rank-info h3 {
  margin: 0;
  font-size: 17px;
}

.rank-info p {
  margin: 6px 0 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.55;
}

.rank-score {
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  border-radius: 16px;
  color: white;
  font-weight: 900;
  background: linear-gradient(135deg, var(--blue), var(--purple));
}

.page-hero {
  margin-top: 48px;
  padding: 54px;
  border: 1px solid var(--line);
  border-radius: 32px;
  background:
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 64, 175, 0.46)),
    radial-gradient(circle at 80% 20%, rgba(34, 211, 238, 0.22), transparent 24rem);
  box-shadow: var(--shadow);
}

.small-hero h1 {
  font-size: clamp(34px, 5vw, 58px);
}

.category-title {
  background-image:
    linear-gradient(135deg, rgba(2, 6, 23, 0.92), rgba(30, 64, 175, 0.58)),
    var(--poster-image),
    linear-gradient(135deg, #0f172a, #1d4ed8);
  background-size: cover;
  background-position: center;
}

.list-filter {
  margin-bottom: 24px;
}

.empty-state {
  display: none;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 30px;
  color: var(--muted);
  text-align: center;
  background: rgba(15, 23, 42, 0.7);
}

.detail-hero {
  position: relative;
  padding: 76px 0;
  background-image:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.74)),
    var(--poster-image),
    linear-gradient(135deg, #111827, #1d4ed8);
  background-size: cover;
  background-position: center;
}

.detail-grid {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 40px;
  align-items: center;
}

.detail-poster {
  aspect-ratio: 2 / 3;
  border: 1px solid var(--line);
  border-radius: 28px;
  background-image:
    linear-gradient(180deg, rgba(2, 6, 23, 0.05), rgba(2, 6, 23, 0.55)),
    var(--poster-image),
    linear-gradient(135deg, #1e293b, #1d4ed8);
  background-size: cover;
  background-position: center;
  box-shadow: var(--shadow);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 20px;
  color: #bfdbfe;
}

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

.detail-line {
  max-width: 780px;
  color: #dbeafe;
  font-size: 18px;
  line-height: 1.8;
}

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

.video-shell {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 28px;
  background: #020617;
  box-shadow: var(--shadow);
}

.main-video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #020617;
}

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

.detail-text {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 24px;
}

.text-card p,
.prose-panel p {
  color: var(--soft);
  line-height: 1.9;
}

.pager-links {
  grid-column: 1 / -1;
  justify-content: space-between;
}

.pager-links a {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px;
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.7);
}

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

.category-overview-card {
  min-height: 280px;
  display: flex;
  align-items: end;
}

.mini-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0;
}

.mini-links a {
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 7px 12px;
  color: #dbeafe;
  background: rgba(15, 23, 42, 0.72);
}

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

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

.site-footer p,
.site-footer li {
  color: var(--muted);
  line-height: 1.8;
}

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

.site-footer h3 {
  margin: 0 0 16px;
}

.footer-bottom {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  border-top: 1px solid var(--line);
  padding: 20px 0 28px;
  color: var(--muted);
  text-align: center;
}

@media (max-width: 1100px) {
  .movie-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .player-section,
  .home-search {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 840px) {
  .nav-toggle {
    display: inline-flex;
  }

  .main-nav {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 72px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    border: 1px solid var(--line);
    border-radius: 18px;
    padding: 12px;
    background: rgba(2, 6, 23, 0.96);
  }

  .main-nav.is-open {
    display: flex;
  }

  .main-nav a {
    padding: 12px;
  }

  .hero-carousel {
    min-height: 620px;
  }

  .movie-grid,
  .rank-list.compact,
  .category-overview-grid,
  .detail-text,
  .footer-grid,
  .detail-grid {
    grid-template-columns: 1fr;
  }

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

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

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

  .rank-score {
    grid-column: 3;
    width: auto;
    height: auto;
    padding: 8px 12px;
  }

  .search-box {
    grid-template-columns: 1fr;
  }

  .page-hero {
    padding: 32px;
  }
}

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

  .hero-copy h1,
  .page-hero h1,
  .detail-copy h1 {
    letter-spacing: -0.04em;
  }
}
