* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #0f172a;
  color: #f1f5f9;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  line-height: 1.5;
  min-height: 100vh;
}

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

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

button,
input,
select {
  font: inherit;
}

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

.header-inner {
  max-width: 1280px;
  height: 64px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 22px;
  font-weight: 800;
  background: linear-gradient(90deg, #e2e8f0, #94a3b8);
  background-clip: text;
  -webkit-background-clip: text;
  color: transparent;
  white-space: nowrap;
}

.logo-mark {
  width: 32px;
  height: 32px;
  border-radius: 999px;
  display: inline-grid;
  place-items: center;
  background: #1e293b;
  color: #cbd5e1;
  font-size: 14px;
  box-shadow: inset 0 0 0 1px #334155;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  color: #94a3b8;
  padding: 9px 14px;
  border-radius: 10px;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.85);
}

.nav-link.compact {
  font-size: 13px;
}

.nav-divider {
  width: 1px;
  height: 24px;
  margin: 0 6px;
  background: #334155;
}

.menu-toggle {
  display: none;
  color: #cbd5e1;
  background: #1e293b;
  border: 1px solid #334155;
  border-radius: 10px;
  padding: 7px 10px;
}

main {
  min-height: 70vh;
  background: linear-gradient(180deg, #0f172a 0%, #1e293b 48%, #0f172a 100%);
}

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

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

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

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, #0f172a 0%, rgba(15, 23, 42, 0.88) 43%, rgba(15, 23, 42, 0.28) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  max-width: 1280px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
}

.hero-content > * {
  max-width: 720px;
}

.hero-kicker {
  display: inline-flex;
  padding: 6px 13px;
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.86);
  color: #cbd5e1;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.03em;
  margin-bottom: 18px;
}

.hero-content h1 {
  margin: 0 0 16px;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 1.05;
  font-weight: 900;
  color: #ffffff;
  text-shadow: 0 12px 40px rgba(0, 0, 0, 0.45);
}

.hero-content p {
  margin: 0 0 22px;
  color: #cbd5e1;
  font-size: clamp(17px, 2vw, 21px);
  line-height: 1.75;
}

.hero-meta,
.hero-tags,
.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 12px;
}

.hero-meta {
  color: #94a3b8;
  font-size: 14px;
  margin-bottom: 18px;
}

.hero-tags {
  margin-bottom: 30px;
}

.hero-tags span,
.tag-row span,
.detail-tags span,
.meta-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: rgba(51, 65, 85, 0.72);
  color: #cbd5e1;
  padding: 5px 11px;
  font-size: 12px;
  line-height: 1;
}

.primary-btn,
.ghost-btn,
.section-more,
.search-button,
.player-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border-radius: 12px;
  border: 0;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-btn,
.search-button,
.player-start {
  color: #0f172a;
  background: linear-gradient(135deg, #f8fafc, #cbd5e1);
  padding: 13px 28px;
}

.ghost-btn,
.section-more {
  color: #e2e8f0;
  background: rgba(30, 41, 59, 0.82);
  border: 1px solid #334155;
  padding: 12px 22px;
}

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

.hero-control {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 46px;
  height: 46px;
  border-radius: 999px;
  border: 1px solid rgba(203, 213, 225, 0.25);
  background: rgba(15, 23, 42, 0.72);
  color: #f8fafc;
  font-size: 36px;
  line-height: 1;
  transform: translateY(-50%);
}

.hero-control.prev {
  left: 24px;
}

.hero-control.next {
  right: 24px;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 26px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 9px;
  z-index: 6;
}

.hero-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  padding: 0;
  border: 0;
  background: rgba(226, 232, 240, 0.42);
}

.hero-dot.active {
  width: 30px;
  background: #f8fafc;
}

.content-section,
.page-shell,
.detail-shell {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 24px;
}

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

.section-head h1,
.section-head h2,
.page-hero h1,
.detail-title {
  margin: 0 0 8px;
  color: #ffffff;
  line-height: 1.15;
  font-weight: 900;
}

.section-head h1,
.page-hero h1,
.detail-title {
  font-size: clamp(34px, 5vw, 52px);
}

.section-head h2 {
  font-size: clamp(28px, 4vw, 38px);
}

.section-head p,
.page-hero p {
  margin: 0;
  color: #94a3b8;
  font-size: 16px;
}

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

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

.movie-card-link {
  display: block;
  height: 100%;
  background: rgba(30, 41, 59, 0.52);
  border: 1px solid #334155;
  border-radius: 18px;
  overflow: hidden;
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.movie-card-link:hover {
  transform: translateY(-5px);
  background: rgba(30, 41, 59, 0.78);
  border-color: #475569;
}

.poster-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #020617;
}

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

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

.poster-year,
.poster-type,
.rank-badge {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #e2e8f0;
  font-size: 12px;
  font-weight: 800;
  padding: 5px 9px;
  backdrop-filter: blur(6px);
}

.poster-year {
  top: 12px;
  right: 12px;
}

.poster-type {
  left: 12px;
  bottom: 12px;
}

.rank-badge {
  left: 12px;
  top: 12px;
  min-width: 34px;
  text-align: center;
  background: rgba(248, 250, 252, 0.92);
  color: #0f172a;
}

.movie-card-body {
  padding: 18px;
}

.movie-card-body h3 {
  margin: 0 0 9px;
  color: #f8fafc;
  font-size: 19px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-card-body p {
  margin: 0 0 14px;
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  color: #64748b;
  font-size: 12px;
  margin-bottom: 12px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

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

.category-tile {
  position: relative;
  min-height: 180px;
  overflow: hidden;
  border-radius: 18px;
  border: 1px solid #334155;
  background: #1e293b;
  padding: 22px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  isolation: isolate;
}

.category-tile img {
  position: absolute;
  inset: 0;
  z-index: -2;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.48;
  transition: transform 0.35s ease;
}

.category-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.12), rgba(15, 23, 42, 0.92));
}

.category-tile:hover img {
  transform: scale(1.07);
}

.category-tile span {
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 8px;
}

.category-tile small {
  color: #cbd5e1;
  line-height: 1.6;
}

.page-hero {
  border-radius: 24px;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.86), rgba(15, 23, 42, 0.92));
  border: 1px solid #334155;
  padding: 42px;
  margin-bottom: 36px;
  overflow: hidden;
}

.search-panel {
  background: rgba(15, 23, 42, 0.74);
  border: 1px solid #334155;
  border-radius: 18px;
  padding: 18px;
  display: grid;
  grid-template-columns: 1fr 180px 140px;
  gap: 14px;
  margin-bottom: 28px;
}

.search-panel input,
.search-panel select {
  width: 100%;
  border: 1px solid #334155;
  background: rgba(30, 41, 59, 0.8);
  color: #e2e8f0;
  border-radius: 12px;
  padding: 13px 14px;
  outline: none;
}

.search-panel input:focus,
.search-panel select:focus {
  border-color: #64748b;
}

.empty-state {
  display: none;
  padding: 60px 20px;
  text-align: center;
  color: #94a3b8;
}

.empty-state.show {
  display: block;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 70px 120px 1fr;
  gap: 16px;
  align-items: center;
  background: rgba(30, 41, 59, 0.58);
  border: 1px solid #334155;
  border-radius: 18px;
  padding: 14px;
}

.rank-number {
  color: #0f172a;
  background: linear-gradient(135deg, #f8fafc, #94a3b8);
  width: 44px;
  height: 44px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  font-weight: 900;
}

.rank-row img {
  width: 120px;
  height: 76px;
  object-fit: cover;
  border-radius: 12px;
}

.rank-row h2 {
  margin: 0 0 6px;
  font-size: 18px;
  color: #f8fafc;
}

.rank-row p {
  margin: 0;
  color: #94a3b8;
  font-size: 13px;
  line-height: 1.6;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  color: #94a3b8;
  font-size: 14px;
  margin-bottom: 22px;
}

.breadcrumb a:hover {
  color: #f8fafc;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 1fr);
  gap: 34px;
  align-items: start;
}

.player-frame {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  border: 1px solid #334155;
  background: #020617;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.35);
}

.player-frame video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.1), rgba(2, 6, 23, 0.58));
  transition: opacity 0.22s ease;
  pointer-events: auto;
}

.player-frame.is-playing .player-cover {
  opacity: 0;
  pointer-events: none;
}

.player-start {
  font-size: 18px;
  min-width: 150px;
}

.detail-title {
  margin-top: 30px;
}

.detail-lead {
  color: #cbd5e1;
  font-size: 20px;
  line-height: 1.75;
  margin: 0 0 26px;
}

.detail-meta,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 26px;
}

.detail-card {
  background: rgba(30, 41, 59, 0.54);
  border: 1px solid #334155;
  border-radius: 18px;
  padding: 24px;
  margin-bottom: 20px;
}

.detail-card h2,
.sidebar-card h2 {
  margin: 0 0 16px;
  color: #ffffff;
  font-size: 22px;
}

.detail-card p {
  color: #cbd5e1;
  line-height: 1.9;
  margin: 0;
}

.sidebar-card {
  background: rgba(30, 41, 59, 0.54);
  border: 1px solid #334155;
  border-radius: 18px;
  padding: 20px;
}

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

.related-item {
  display: grid;
  grid-template-columns: 116px 1fr;
  gap: 14px;
  align-items: center;
  border-radius: 14px;
  padding: 10px;
  background: rgba(15, 23, 42, 0.42);
  transition: background 0.2s ease;
}

.related-item:hover {
  background: rgba(51, 65, 85, 0.55);
}

.related-item img {
  width: 116px;
  height: 74px;
  object-fit: cover;
  border-radius: 11px;
}

.related-item h3 {
  margin: 0 0 6px;
  color: #f8fafc;
  font-size: 15px;
}

.related-item p {
  margin: 0;
  color: #94a3b8;
  font-size: 12px;
  line-height: 1.5;
}

.site-footer {
  background: #0f172a;
  border-top: 1px solid #1e293b;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 44px 24px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr 1fr;
  gap: 28px;
}

.footer-logo {
  color: #e2e8f0;
  font-size: 22px;
  font-weight: 900;
  margin-bottom: 12px;
}

.footer-brand p,
.footer-links p,
.footer-links li {
  color: #94a3b8;
  font-size: 14px;
  line-height: 1.7;
}

.footer-links h2 {
  color: #e2e8f0;
  font-size: 16px;
  margin: 0 0 12px;
}

.footer-links ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 8px;
}

.footer-links a:hover {
  color: #f8fafc;
}

.footer-bottom {
  border-top: 1px solid #1e293b;
  padding: 18px 24px;
  text-align: center;
  color: #64748b;
  font-size: 13px;
}

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

  .site-nav {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 70px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    background: rgba(15, 23, 42, 0.98);
    border: 1px solid #334155;
    border-radius: 18px;
    padding: 14px;
  }

  .site-nav.open {
    display: flex;
  }

  .nav-divider {
    display: none;
  }

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

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

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

@media (max-width: 640px) {
  .header-inner {
    padding: 0 16px;
  }

  .site-logo {
    font-size: 19px;
  }

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

  .hero-content {
    padding: 0 18px;
  }

  .hero-overlay {
    background: linear-gradient(180deg, rgba(15, 23, 42, 0.5), rgba(15, 23, 42, 0.94));
  }

  .hero-control {
    display: none;
  }

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

  .content-section,
  .page-shell,
  .detail-shell {
    padding: 38px 16px;
  }

  .section-head {
    display: block;
  }

  .section-more {
    margin-top: 16px;
  }

  .page-hero {
    padding: 28px;
  }

  .rank-row {
    grid-template-columns: 44px 88px 1fr;
    gap: 12px;
  }

  .rank-row img {
    width: 88px;
    height: 58px;
  }
}
