:root {
  color-scheme: dark;
  --bg: #0f172a;
  --bg-soft: #111827;
  --panel: rgba(30, 41, 59, 0.72);
  --panel-solid: #1e293b;
  --muted: #94a3b8;
  --text: #f8fafc;
  --text-soft: #cbd5e1;
  --line: rgba(148, 163, 184, 0.18);
  --amber: #f59e0b;
  --amber-light: #fbbf24;
  --sky: #0ea5e9;
  --sky-dark: #0284c7;
  --orange: #f97316;
  --shadow: 0 20px 25px -5px rgba(0, 0, 0, 0.45), 0 10px 10px -5px rgba(0, 0, 0, 0.24);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  line-height: 1.6;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(15, 23, 42, 0.95);
  border-bottom: 1px solid rgba(51, 65, 85, 0.78);
  backdrop-filter: blur(14px);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  min-width: max-content;
}

.brand-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: white;
  background: linear-gradient(135deg, var(--amber-light), var(--orange));
  border-radius: 10px;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.34);
  font-size: 14px;
}

.brand-text,
.footer-brand {
  font-size: 20px;
  font-weight: 800;
  background: linear-gradient(90deg, var(--amber-light), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
  letter-spacing: 0.03em;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--text-soft);
  font-size: 14px;
}

.nav-link,
.mobile-link {
  transition: color 0.2s ease;
}

.nav-link:hover,
.mobile-link:hover {
  color: white;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 10px;
  background: rgba(30, 41, 59, 0.82);
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  background: white;
  margin: 5px auto;
  border-radius: 999px;
}

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

.mobile-nav.is-open {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

.mobile-link {
  color: var(--text-soft);
  padding: 8px 0;
}

.hero {
  position: relative;
  min-height: 520px;
  height: 70vh;
  overflow: hidden;
}

.hero-background,
.hero-slide,
.hero-overlay,
.detail-bg {
  position: absolute;
  inset: 0;
}

.hero-slide {
  opacity: 0;
  transform: scale(1.04);
  transition: opacity 0.75s ease, transform 1.5s ease;
}

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

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

.hero-overlay {
  background:
    radial-gradient(circle at 80% 15%, rgba(14, 165, 233, 0.28), transparent 30%),
    linear-gradient(to top, #0f172a 0%, rgba(15, 23, 42, 0.76) 45%, rgba(15, 23, 42, 0.12) 100%),
    linear-gradient(to right, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.36));
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: min(1280px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 36px;
  align-items: end;
  padding-bottom: 64px;
}

.hero-copy {
  position: relative;
  min-height: 330px;
}

.hero-text {
  opacity: 0;
  pointer-events: none;
  position: absolute;
  left: 0;
  bottom: 44px;
  max-width: 760px;
  transform: translateY(16px);
  transition: opacity 0.5s ease, transform 0.5s ease;
}

.hero-text.active {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.hero-tags,
.detail-meta,
.card-meta,
.horizontal-meta,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}

.hero-tags span,
.detail-kicker,
.tag,
.poster-badge,
.quality-badge,
.card-meta span,
.horizontal-meta span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

.hero-tags span,
.detail-kicker,
.tag {
  padding: 8px 12px;
  background: rgba(14, 165, 233, 0.9);
  color: white;
  box-shadow: 0 8px 24px rgba(14, 165, 233, 0.22);
}

.hero-text h1,
.detail-info h1,
.page-hero h1 {
  margin: 16px 0;
  color: white;
  line-height: 1.08;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

.hero-text h1 {
  font-size: clamp(42px, 6vw, 72px);
}

.hero-text p {
  max-width: 680px;
  margin: 0 0 28px;
  color: #e2e8f0;
  font-size: 18px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.hero-actions,
.detail-info .primary-btn {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.primary-btn,
.ghost-btn,
.search-box button,
.rank-entry {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 700;
  border: 1px solid transparent;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-btn,
.search-box button {
  background: var(--sky);
  color: white;
  box-shadow: 0 18px 40px rgba(14, 165, 233, 0.25);
}

.primary-btn:hover,
.search-box button:hover {
  background: var(--sky-dark);
  transform: translateY(-2px);
}

.ghost-btn,
.rank-entry {
  color: white;
  background: rgba(30, 41, 59, 0.72);
  border-color: rgba(148, 163, 184, 0.2);
}

.ghost-btn:hover,
.rank-entry:hover {
  border-color: rgba(251, 191, 36, 0.72);
  color: var(--amber-light);
}

.hero-dots {
  position: absolute;
  bottom: 0;
  left: 0;
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 10px;
  height: 10px;
  border-radius: 999px;
  border: 0;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.active {
  width: 34px;
  background: var(--sky);
}

.hero-side {
  margin-bottom: 8px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.64);
  backdrop-filter: blur(12px);
  box-shadow: var(--shadow);
}

.hero-side-title {
  font-weight: 800;
  margin-bottom: 14px;
  color: white;
}

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

.hero-mini-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  color: var(--text-soft);
}

.hero-mini-card img {
  width: 88px;
  aspect-ratio: 16 / 9;
  border-radius: 10px;
  object-fit: cover;
}

.hero-mini-card span {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rank-entry {
  width: 100%;
  margin-top: 16px;
}

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

.search-strip {
  background: linear-gradient(90deg, rgba(245, 158, 11, 0.13), rgba(14, 165, 233, 0.1));
  border-top: 1px solid rgba(255, 255, 255, 0.04);
  border-bottom: 1px solid rgba(255, 255, 255, 0.04);
}

.search-strip-inner,
.content-section > .section-head,
.featured-layout,
.scroll-row,
.ranking-grid,
.movie-grid,
.category-grid,
.category-panel-grid,
.filter-bar,
.ranking-list,
.detail-article,
.video-shell {
  width: min(1280px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

.search-strip-inner {
  display: grid;
  grid-template-columns: minmax(0, 0.9fr) minmax(300px, 1.1fr);
  align-items: center;
  gap: 28px;
}

.search-strip h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
}

.search-box,
.filter-bar {
  display: flex;
  gap: 12px;
}

.search-box input,
.filter-bar input,
.filter-bar select {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  color: white;
  background: rgba(15, 23, 42, 0.72);
  border: 1px solid var(--line);
  border-radius: 999px;
  outline: none;
}

.filter-bar {
  margin-bottom: 28px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(30, 41, 59, 0.55);
}

.filter-bar select {
  max-width: 180px;
}

.darker {
  background: rgba(30, 41, 59, 0.3);
}

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

.section-head h2 {
  margin: 0;
  color: white;
  font-size: clamp(24px, 3vw, 34px);
}

.section-more {
  color: var(--sky);
  font-size: 14px;
}

.featured-layout {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 22px;
}

.featured-side {
  display: grid;
  gap: 14px;
}

.scroll-row {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 230px;
  gap: 16px;
  overflow-x: auto;
  padding-bottom: 12px;
  scrollbar-width: none;
}

.scroll-row::-webkit-scrollbar {
  display: none;
}

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

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

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

.movie-card,
.horizontal-card,
.category-tile,
.category-panel {
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease, background 0.3s ease;
}

.movie-card {
  min-width: 0;
}

.card-link {
  display: block;
  height: 100%;
  background: rgba(30, 41, 59, 0.52);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 18px;
  overflow: hidden;
}

.movie-card:hover,
.horizontal-card:hover,
.category-tile:hover,
.category-panel:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow);
}

.movie-card:hover .card-link,
.category-tile:hover,
.category-panel:hover,
.horizontal-card:hover .horizontal-link {
  border-color: rgba(251, 191, 36, 0.28);
}

.poster-wrap {
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: #111827;
}

.compact .poster-wrap {
  aspect-ratio: 3 / 4;
}

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

.movie-card:hover .poster-wrap img,
.horizontal-card:hover .horizontal-poster img {
  transform: scale(1.055);
}

.quality-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 6px 8px;
  background: rgba(0, 0, 0, 0.7);
  color: var(--amber-light);
  font-weight: 800;
}

.poster-badge {
  position: absolute;
  left: 12px;
  bottom: 12px;
  max-width: calc(100% - 24px);
  padding: 7px 10px;
  color: white;
  background: rgba(245, 158, 11, 0.92);
}

.card-body {
  padding: 14px;
}

.card-title {
  margin: 0 0 8px;
  color: white;
  font-size: 16px;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

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

.card-meta span,
.horizontal-meta span {
  padding: 5px 8px;
  color: var(--text-soft);
  background: rgba(51, 65, 85, 0.75);
}

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

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

.horizontal-card {
  position: relative;
}

.horizontal-link {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr);
  gap: 14px;
  height: 100%;
  padding: 12px;
  background: rgba(30, 41, 59, 0.52);
  border: 1px solid rgba(148, 163, 184, 0.1);
  border-radius: 16px;
}

.horizontal-poster {
  aspect-ratio: 16 / 9;
  overflow: hidden;
  border-radius: 12px;
  background: #111827;
}

.horizontal-body h3 {
  margin: 0 0 6px;
  color: white;
  font-size: 16px;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.horizontal-body p {
  margin: 0 0 10px;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rank-number {
  position: absolute;
  z-index: 2;
  top: 12px;
  left: -6px;
  width: 44px;
  height: 44px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: white;
  font-size: 18px;
  font-weight: 900;
  background: linear-gradient(135deg, var(--amber-light), var(--orange));
  box-shadow: 0 12px 28px rgba(249, 115, 22, 0.28);
}

.rank-number + .horizontal-link {
  padding-left: 42px;
}

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

.category-tile,
.category-panel {
  min-height: 148px;
  padding: 22px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background:
    linear-gradient(135deg, rgba(245, 158, 11, 0.12), rgba(14, 165, 233, 0.08)),
    rgba(30, 41, 59, 0.5);
}

.category-tile span,
.category-panel-title {
  display: block;
  margin-bottom: 10px;
  color: white;
  font-size: 20px;
  font-weight: 800;
}

.category-tile p,
.category-panel p {
  margin: 0;
  color: var(--muted);
  font-size: 14px;
}

.category-panel-links {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 16px;
}

.category-panel-links a {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--text-soft);
  background: rgba(15, 23, 42, 0.55);
  font-size: 13px;
}

.page-hero,
.detail-hero {
  position: relative;
  overflow: hidden;
}

.page-hero {
  min-height: 360px;
  display: flex;
  align-items: center;
  background:
    radial-gradient(circle at 76% 20%, rgba(14, 165, 233, 0.24), transparent 32%),
    linear-gradient(135deg, rgba(245, 158, 11, 0.18), transparent 28%),
    #0f172a;
}

.compact-hero {
  min-height: 320px;
}

.rank-hero {
  background:
    radial-gradient(circle at 80% 18%, rgba(245, 158, 11, 0.24), transparent 30%),
    linear-gradient(135deg, rgba(14, 165, 233, 0.14), transparent 34%),
    #0f172a;
}

.page-hero-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 72px 0;
}

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

.page-hero p {
  max-width: 760px;
  margin: 0;
  color: var(--text-soft);
  font-size: 18px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 16px;
  color: var(--muted);
  font-size: 14px;
}

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

.detail-hero {
  min-height: 640px;
}

.detail-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background:
    linear-gradient(to top, #0f172a 0%, rgba(15, 23, 42, 0.82) 46%, rgba(15, 23, 42, 0.72) 100%),
    linear-gradient(to right, rgba(15, 23, 42, 0.96), rgba(15, 23, 42, 0.58));
  backdrop-filter: blur(10px);
}

.detail-inner {
  position: relative;
  z-index: 2;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0 64px;
}

.detail-main {
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  gap: 36px;
  align-items: end;
}

.detail-poster {
  aspect-ratio: 3 / 4;
  overflow: hidden;
  border-radius: 24px;
  background: #111827;
  box-shadow: var(--shadow);
}

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

.detail-one-line {
  max-width: 860px;
  margin: 0 0 20px;
  color: #e2e8f0;
  font-size: 19px;
}

.detail-meta span {
  padding: 8px 12px;
  border-radius: 999px;
  color: var(--text-soft);
  background: rgba(30, 41, 59, 0.7);
}

.tag-row {
  margin: 18px 0 28px;
}

.tag {
  background: rgba(245, 158, 11, 0.18);
  color: var(--amber-light);
  box-shadow: none;
}

.player-section {
  padding-top: 32px;
}

.video-shell {
  position: relative;
  overflow: hidden;
  border-radius: 26px;
  background: black;
  border: 1px solid rgba(148, 163, 184, 0.18);
  box-shadow: var(--shadow);
}

.movie-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: black;
}

.play-layer {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  cursor: pointer;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.62));
}

.play-layer span {
  width: 86px;
  height: 86px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: white;
  background: linear-gradient(135deg, var(--sky), var(--amber));
  box-shadow: 0 18px 40px rgba(14, 165, 233, 0.32);
  font-size: 30px;
  padding-left: 5px;
}

.play-layer.is-hidden {
  display: none;
}

.detail-article {
  max-width: 980px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 22px;
  background: rgba(30, 41, 59, 0.52);
}

.detail-article h2 {
  margin: 0 0 12px;
  color: white;
  font-size: 26px;
}

.detail-article h2:not(:first-child) {
  margin-top: 28px;
}

.detail-article p {
  margin: 0;
  color: var(--text-soft);
  font-size: 17px;
}

.site-footer {
  border-top: 1px solid rgba(51, 65, 85, 0.78);
  background: rgba(15, 23, 42, 0.95);
}

.footer-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 24px;
  align-items: center;
}

.footer-inner p {
  max-width: 560px;
  margin: 8px 0 0;
  color: var(--muted);
  font-size: 14px;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 14px;
  color: var(--muted);
  font-size: 14px;
}

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

.is-filter-hidden {
  display: none !important;
}

@media (max-width: 1180px) {
  .desktop-nav {
    gap: 14px;
    font-size: 13px;
  }

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

  .hero-inner {
    grid-template-columns: 1fr;
  }

  .hero-side {
    display: none;
  }
}

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

  .nav-toggle {
    display: block;
  }

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

  .hero-inner {
    padding-top: 80px;
    padding-bottom: 46px;
    align-items: end;
  }

  .hero-copy {
    min-height: 430px;
  }

  .hero-text {
    bottom: 38px;
  }

  .hero-text p {
    font-size: 16px;
  }

  .search-strip-inner,
  .featured-layout,
  .detail-main,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .ranking-grid,
  .ranking-list,
  .category-grid,
  .category-panel-grid {
    grid-template-columns: 1fr;
  }

  .detail-main {
    align-items: start;
  }

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

  .filter-bar,
  .search-box {
    flex-direction: column;
  }

  .filter-bar select {
    max-width: none;
  }
}

@media (max-width: 640px) {
  .site-nav,
  .mobile-nav,
  .hero-inner,
  .search-strip-inner,
  .content-section > .section-head,
  .featured-layout,
  .scroll-row,
  .ranking-grid,
  .movie-grid,
  .category-grid,
  .category-panel-grid,
  .filter-bar,
  .ranking-list,
  .detail-article,
  .video-shell,
  .detail-inner,
  .page-hero-inner,
  .footer-inner {
    width: min(100% - 24px, 1280px);
  }

  .hero-text h1,
  .detail-info h1,
  .page-hero h1 {
    font-size: 34px;
  }

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

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

  .horizontal-link {
    grid-template-columns: 108px minmax(0, 1fr);
  }

  .horizontal-meta {
    display: none;
  }

  .card-body {
    padding: 12px;
  }

  .card-title {
    font-size: 14px;
  }

  .card-desc {
    font-size: 12px;
  }

  .detail-article {
    padding: 22px;
  }

  .play-layer span {
    width: 68px;
    height: 68px;
    font-size: 24px;
  }
}
