:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: rgba(15, 23, 42, 0.72);
  --panel-solid: #111827;
  --line: rgba(148, 163, 184, 0.18);
  --text: #e5edf7;
  --muted: #94a3b8;
  --soft: #cbd5e1;
  --sky: #38bdf8;
  --blue: #2563eb;
  --gold: #fbbf24;
  --radius: 18px;
  --shadow: 0 24px 70px rgba(2, 6, 23, 0.45);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(14, 165, 233, 0.12), transparent 32rem),
    linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
  color: var(--text);
}

body::-webkit-scrollbar {
  width: 10px;
}

body::-webkit-scrollbar-thumb {
  background: #334155;
  border-radius: 999px;
}

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

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

button,
input,
select {
  font: inherit;
}

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

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

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

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

.brand-icon {
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--sky), var(--blue));
  color: white;
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.32);
  transition: transform 0.25s ease;
}

.brand:hover .brand-icon {
  transform: scale(1.08) rotate(-2deg);
}

.brand-text strong {
  display: block;
  font-size: 24px;
  line-height: 1.05;
  letter-spacing: 0.02em;
  background: linear-gradient(90deg, #e0f2fe, #60a5fa);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-text small {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 18px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.nav-link {
  color: #dbeafe;
  font-weight: 600;
  padding: 10px 0;
  border-bottom: 2px solid transparent;
  transition: color 0.2s ease, border-color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--sky);
  border-bottom-color: var(--sky);
}

.nav-divider {
  width: 1px;
  height: 18px;
  background: var(--line);
}

.nav-toggle {
  display: none;
  border: 0;
  color: white;
  font-size: 26px;
  background: transparent;
}

.mobile-menu {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 16px;
  border-top: 1px solid var(--line);
}

.mobile-menu.open {
  display: grid;
  gap: 8px;
}

.hero-carousel {
  position: relative;
  height: min(70vh, 720px);
  min-height: 520px;
  overflow: hidden;
  background: #020617;
}

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

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-slide .poster-fallback,
.poster-frame .poster-fallback,
.detail-poster .poster-fallback,
.rank-cover .poster-fallback {
  display: none;
}

.hero-slide.image-error,
.poster-frame.image-error,
.detail-poster.image-error,
.rank-cover.image-error {
  background:
    radial-gradient(circle at 30% 25%, rgba(56, 189, 248, 0.35), transparent 35%),
    linear-gradient(135deg, #0f172a, #1e3a8a 55%, #020617);
}

.poster-frame.image-error img,
.detail-poster.image-error img,
.rank-cover.image-error img {
  display: none;
}

.poster-frame.image-error .poster-fallback,
.detail-poster.image-error .poster-fallback,
.rank-cover.image-error .poster-fallback {
  display: grid;
  place-items: center;
  height: 100%;
  padding: 18px;
  color: white;
  text-align: center;
  font-weight: 800;
  line-height: 1.35;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.98), rgba(2, 6, 23, 0.74), rgba(2, 6, 23, 0.18)),
    linear-gradient(0deg, #020617, rgba(2, 6, 23, 0.08) 45%, rgba(2, 6, 23, 0.24));
}

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

.hero-badge,
.card-category,
.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: #bae6fd;
  background: rgba(2, 132, 199, 0.22);
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 999px;
  padding: 6px 12px;
  font-size: 13px;
  font-weight: 700;
}

.hero-content h1 {
  margin: 18px 0 16px;
  max-width: 760px;
  font-size: clamp(38px, 7vw, 74px);
  line-height: 0.98;
  letter-spacing: -0.04em;
  color: white;
}

.hero-content p {
  max-width: 680px;
  margin: 0 0 20px;
  color: #dbeafe;
  font-size: 18px;
  line-height: 1.75;
}

.hero-meta,
.meta-line {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-wrap: wrap;
  color: var(--muted);
  font-size: 14px;
}

.hero-meta span:first-child,
.meta-line span:first-child {
  color: var(--gold);
  font-weight: 800;
}

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

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

.primary-btn {
  color: white;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  box-shadow: 0 12px 30px rgba(14, 165, 233, 0.26);
}

.ghost-btn,
.section-more {
  color: #bae6fd;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid rgba(125, 211, 252, 0.2);
}

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

.hero-nav {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 52px;
  height: 52px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.55);
  color: white;
  font-size: 42px;
  line-height: 0;
  cursor: pointer;
}

.hero-nav.prev {
  left: 22px;
}

.hero-nav.next {
  right: 22px;
}

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

.hero-dots button {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  transition: width 0.25s ease, background 0.25s ease;
  cursor: pointer;
}

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

.home-search {
  margin-top: -34px;
  position: relative;
  z-index: 8;
  background: rgba(15, 23, 42, 0.86);
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 24px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(18px);
}

.home-search h2,
.page-hero h1,
.section-head h2,
.detail-info h1,
.detail-section h2,
.sitemap-section h2 {
  margin: 0;
  color: white;
}

.home-search p,
.section-head p,
.page-hero p,
.category-panel p,
.detail-section p,
.site-footer p {
  color: var(--muted);
  line-height: 1.75;
}

.filter-panel {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 16px;
  align-items: end;
  margin-top: 18px;
}

.search-box {
  display: grid;
  gap: 8px;
  color: var(--soft);
  font-weight: 700;
}

.search-box input,
.filter-select {
  min-height: 46px;
  border-radius: 12px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  background: rgba(2, 6, 23, 0.58);
  color: white;
  padding: 0 14px;
  outline: none;
}

.search-box input:focus,
.filter-select:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(56, 189, 248, 0.16);
}

.filter-controls {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
}

.result-count {
  grid-column: 1 / -1;
  color: var(--muted);
  font-size: 14px;
}

.content-section,
.page-layout {
  padding: 62px 0;
}

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

.section-head h2 {
  margin-top: 12px;
  font-size: clamp(28px, 4vw, 42px);
  letter-spacing: -0.03em;
}

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

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.72), rgba(15, 23, 42, 0.72));
  box-shadow: 0 18px 40px rgba(2, 6, 23, 0.22);
  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.42);
  box-shadow: 0 26px 55px rgba(2, 6, 23, 0.36);
}

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

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

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

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

.poster-play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  padding: 7px 10px;
  border-radius: 999px;
  background: rgba(2, 132, 199, 0.92);
  color: white;
  font-size: 12px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(8px);
  transition: opacity 0.22s ease, transform 0.22s ease;
}

.movie-card:hover .poster-play {
  opacity: 1;
  transform: translateY(0);
}

.card-body {
  padding: 16px;
}

.card-body h3 {
  margin: 12px 0 8px;
  color: white;
  font-size: 18px;
  line-height: 1.35;
}

.card-body h3 a:hover,
.rank-info h2 a:hover,
.site-footer a:hover {
  color: var(--sky);
}

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

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 12px;
}

.tag-row span {
  padding: 5px 9px;
  border-radius: 999px;
  color: #cbd5e1;
  background: rgba(148, 163, 184, 0.12);
  font-size: 12px;
}

.movie-card.compact .card-body p {
  display: none;
}

.page-hero {
  padding: 54px;
  border: 1px solid var(--line);
  border-radius: 28px;
  background:
    radial-gradient(circle at 15% 20%, rgba(56, 189, 248, 0.22), transparent 32%),
    linear-gradient(135deg, rgba(15, 23, 42, 0.92), rgba(30, 41, 59, 0.82));
  box-shadow: var(--shadow);
}

.compact-hero,
.category-hero {
  margin-top: 34px;
}

.page-hero h1 {
  margin-top: 14px;
  font-size: clamp(34px, 6vw, 62px);
  letter-spacing: -0.04em;
}

.category-list {
  display: grid;
  gap: 28px;
  margin-top: 36px;
}

.category-panel {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.68);
  padding: 24px;
}

.category-panel-head {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
  margin-bottom: 22px;
}

.rank-list {
  display: grid;
  gap: 16px;
  padding: 0;
  margin: 26px 0 0;
  list-style: none;
}

.rank-item {
  display: grid;
  grid-template-columns: 78px 118px 1fr;
  gap: 18px;
  align-items: center;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.74);
  padding: 14px;
}

.rank-num {
  display: grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 18px;
  color: white;
  background: linear-gradient(135deg, #0ea5e9, #1d4ed8);
  font-size: 22px;
  font-weight: 900;
}

.rank-cover {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 14px;
  background: #0f172a;
}

.rank-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-info h2 {
  margin: 10px 0 8px;
  color: white;
  font-size: 22px;
}

.rank-info p {
  color: var(--muted);
  line-height: 1.7;
}

.detail-page {
  padding-bottom: 70px;
}

.player-shell {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 36px auto 0;
  overflow: hidden;
  border: 1px solid rgba(125, 211, 252, 0.18);
  border-radius: 28px;
  background: #000;
  box-shadow: 0 28px 80px rgba(2, 6, 23, 0.56);
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  gap: 12px;
  border: 0;
  color: white;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.28), rgba(0, 0, 0, 0.5));
  cursor: pointer;
}

.play-overlay span {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  margin: 0 auto;
  border-radius: 999px;
  background: linear-gradient(135deg, #0ea5e9, #2563eb);
  box-shadow: 0 16px 42px rgba(14, 165, 233, 0.36);
  font-size: 36px;
}

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

.detail-layout {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 32px;
  margin-top: 34px;
  align-items: start;
}

.detail-poster {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  aspect-ratio: 2 / 3;
  background: #0f172a;
  box-shadow: var(--shadow);
}

.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.detail-info {
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.72);
  padding: 30px;
}

.detail-info h1 {
  margin-top: 14px;
  font-size: clamp(32px, 5vw, 56px);
  letter-spacing: -0.04em;
}

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

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

.detail-meta-grid span {
  min-height: 70px;
  display: grid;
  gap: 6px;
  align-content: center;
  padding: 12px;
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.44);
  color: var(--soft);
}

.detail-meta-grid strong {
  color: var(--muted);
  font-size: 12px;
}

.detail-section {
  margin-top: 26px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.72);
  padding: 30px;
}

.detail-section h2 {
  font-size: 28px;
}

.detail-section p {
  color: var(--soft);
  font-size: 16px;
}

.sitemap-section {
  margin-top: 28px;
  border: 1px solid var(--line);
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.72);
  padding: 26px;
}

.sitemap-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  padding: 0;
  list-style: none;
}

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

.sitemap-grid a {
  display: block;
  padding: 12px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.36);
  color: #cbd5e1;
}

.sitemap-grid a:hover {
  color: white;
  background: rgba(14, 165, 233, 0.18);
}

.site-footer {
  margin-top: 72px;
  border-top: 1px solid var(--line);
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.72), rgba(2, 6, 23, 0.95));
}

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

.site-footer h2,
.site-footer h3 {
  color: white;
}

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

.site-footer li {
  margin: 8px 0;
  color: var(--muted);
}

[data-card].is-hidden {
  display: none !important;
}

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

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

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

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

  .nav-toggle {
    display: block;
  }

  .brand-text strong {
    font-size: 20px;
  }

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

  .hero-content {
    bottom: 86px;
  }

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

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

  .section-head,
  .category-panel-head {
    align-items: flex-start;
    flex-direction: column;
  }

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

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

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

  .rank-item {
    grid-template-columns: 54px 92px 1fr;
  }

  .rank-num {
    width: 46px;
    height: 46px;
    font-size: 18px;
  }
}

@media (max-width: 560px) {
  .container-block,
  .nav-wrap,
  .mobile-menu,
  .footer-grid,
  .player-shell {
    width: min(100% - 22px, 1180px);
  }

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

  .hero-content h1 {
    font-size: 38px;
  }

  .hero-content p {
    font-size: 15px;
  }

  .hero-nav {
    display: none;
  }

  .page-hero,
  .detail-info,
  .detail-section,
  .category-panel {
    padding: 22px;
  }

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

  .rank-item {
    grid-template-columns: 44px 76px 1fr;
    gap: 10px;
  }

  .rank-info p,
  .rank-info .meta-line span:nth-child(n+3) {
    display: none;
  }

  .detail-meta-grid,
  .footer-grid,
  .sitemap-grid,
  .sitemap-grid.dense {
    grid-template-columns: 1fr;
  }
}
