:root {
  --bg: #020617;
  --bg-soft: #0f172a;
  --panel: #1e293b;
  --panel-strong: #334155;
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --accent: #0ea5e9;
  --accent-dark: #0369a1;
  --blue: #2563eb;
  --orange: #f97316;
  --radius: 22px;
  --shadow: 0 24px 80px rgba(2, 6, 23, 0.42);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  border-bottom: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.82);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(1280px, calc(100% - 32px));
  height: 72px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.03em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  box-shadow: 0 14px 32px rgba(14, 165, 233, 0.34);
}

.brand-text,
.footer-brand {
  font-size: 24px;
  background: linear-gradient(135deg, #38bdf8, #3b82f6);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

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

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
  color: #38bdf8;
}

.quick-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 310px;
}

.quick-search input,
.filter-panel input,
.filter-panel select,
.search-hero input {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.82);
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.quick-search input {
  height: 42px;
  padding: 0 14px;
}

.quick-search input:focus,
.filter-panel input:focus,
.filter-panel select:focus,
.search-hero input:focus {
  border-color: rgba(56, 189, 248, 0.7);
  box-shadow: 0 0 0 4px rgba(14, 165, 233, 0.12);
}

.quick-search button,
.primary-button,
.filter-panel button {
  border: 0;
  border-radius: 14px;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 14px 32px rgba(14, 165, 233, 0.22);
}

.quick-search button {
  height: 42px;
  padding: 0 16px;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 14px;
  color: var(--text);
  background: rgba(15, 23, 42, 0.85);
}

.mobile-nav {
  display: none;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto 16px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.96);
}

.mobile-nav.open {
  display: grid;
  gap: 12px;
}

.hero-slider {
  position: relative;
  height: 78vh;
  min-height: 560px;
  overflow: hidden;
  background: #020617;
}

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

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

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(90deg, rgba(0, 0, 0, 0.92) 0%, rgba(0, 0, 0, 0.72) 42%, rgba(0, 0, 0, 0.12) 100%),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0) 42%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1280px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1280px;
}

.hero-content h1 {
  max-width: 760px;
  margin: 0 0 18px;
  font-size: clamp(42px, 7vw, 82px);
  line-height: 0.98;
  letter-spacing: -0.07em;
}

.hero-content p {
  max-width: 680px;
  margin: 0 0 30px;
  color: #d1d5db;
  font-size: clamp(17px, 2.1vw, 22px);
  line-height: 1.75;
}

.hero-tags,
.movie-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.hero-tags span,
.movie-tags span,
.card-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 11px;
  border-radius: 999px;
  color: white;
  background: rgba(14, 165, 233, 0.86);
  font-size: 13px;
  font-style: normal;
  font-weight: 800;
}

.hero-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.primary-button,
.ghost-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 50px;
  padding: 0 24px;
  border-radius: 15px;
  font-weight: 900;
  transition: transform 0.2s ease, background 0.2s ease, border-color 0.2s ease;
}

.primary-button:hover,
.ghost-button:hover,
.card-link:hover,
.category-tile:hover,
.compact-card:hover,
.ranking-row:hover {
  transform: translateY(-4px);
}

.ghost-button {
  border: 1px solid rgba(148, 163, 184, 0.3);
  color: var(--text);
  background: rgba(15, 23, 42, 0.72);
}

.hero-control {
  position: absolute;
  top: 50%;
  z-index: 5;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 999px;
  color: white;
  background: rgba(0, 0, 0, 0.48);
  cursor: pointer;
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-control:hover {
  background: rgba(0, 0, 0, 0.72);
}

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

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

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

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

.hero-dots button.active {
  width: 34px;
  background: #38bdf8;
}

main,
.page-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.page-shell {
  padding: 42px 0 72px;
}

.section-block {
  margin: 0 0 72px;
}

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

.section-heading span,
.eyebrow {
  display: inline-block;
  margin-bottom: 8px;
  color: #38bdf8;
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.section-heading h2,
.page-title h1,
.detail-title h1 {
  margin: 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.section-more {
  color: #38bdf8;
  font-weight: 900;
}

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

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

.movie-row {
  display: flex;
  gap: 18px;
  padding-bottom: 14px;
  overflow-x: auto;
  scrollbar-width: thin;
}

.movie-row .movie-card {
  width: 320px;
  flex: 0 0 auto;
}

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

.card-link {
  display: block;
  height: 100%;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 20px;
  overflow: hidden;
  background: linear-gradient(180deg, rgba(30, 41, 59, 0.96), rgba(15, 23, 42, 0.96));
  box-shadow: 0 12px 36px rgba(2, 6, 23, 0.22);
  transition: transform 0.25s ease, border-color 0.25s ease, box-shadow 0.25s ease;
}

.card-link:hover {
  border-color: rgba(56, 189, 248, 0.42);
  box-shadow: var(--shadow);
}

.poster-wrap {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: #0f172a;
}

.poster-wrap img,
.compact-card img,
.detail-poster img,
.feature-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.card-link:hover .poster-wrap img,
.compact-card:hover img,
.feature-card:hover img {
  transform: scale(1.08);
}

.poster-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.76), transparent 62%);
}

.play-float {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  width: 62px;
  height: 62px;
  margin: auto;
  border-radius: 999px;
  color: white;
  background: rgba(14, 165, 233, 0.94);
  opacity: 0;
  transform: scale(0.8);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.card-link:hover .play-float {
  opacity: 1;
  transform: scale(1);
}

.region-badge,
.year-badge,
.type-badge {
  position: absolute;
  z-index: 2;
  padding: 5px 9px;
  border-radius: 9px;
  color: white;
  font-size: 12px;
  font-weight: 900;
}

.region-badge {
  left: 10px;
  bottom: 10px;
  background: rgba(2, 132, 199, 0.92);
}

.year-badge {
  right: 10px;
  top: 10px;
  background: rgba(0, 0, 0, 0.66);
}

.card-body {
  display: block;
  padding: 16px;
}

.card-body strong {
  display: block;
  margin-bottom: 8px;
  color: white;
  font-size: 18px;
  line-height: 1.35;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  transition: color 0.2s ease;
}

.card-link:hover .card-body strong {
  color: #38bdf8;
}

.card-body em {
  display: -webkit-box;
  min-height: 46px;
  margin-bottom: 12px;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  font-style: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-meta {
  display: block;
  color: #64748b;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.feature-card {
  display: grid;
  grid-template-columns: 1fr 1fr;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 28px;
  overflow: hidden;
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.96), rgba(51, 65, 85, 0.86));
  box-shadow: var(--shadow);
}

.feature-media {
  min-height: 390px;
  overflow: hidden;
}

.feature-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  padding: clamp(28px, 5vw, 58px);
}

.feature-content h2 {
  margin: 0 0 16px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.feature-content p,
.page-title p,
.detail-title p,
.info-panel p {
  color: var(--muted-strong);
  line-height: 1.85;
}

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

.category-tile {
  display: block;
  min-height: 176px;
  padding: 24px;
  border: 1px solid rgba(148, 163, 184, 0.16);
  border-radius: 22px;
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.22), transparent 44%),
    linear-gradient(135deg, rgba(30, 41, 59, 0.98), rgba(15, 23, 42, 0.98));
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.category-tile:hover {
  border-color: rgba(56, 189, 248, 0.45);
  background:
    radial-gradient(circle at top right, rgba(59, 130, 246, 0.32), transparent 44%),
    linear-gradient(135deg, rgba(2, 132, 199, 0.85), rgba(29, 78, 216, 0.72));
}

.category-tile strong {
  display: block;
  margin-bottom: 12px;
  font-size: 22px;
}

.category-tile span {
  color: var(--muted-strong);
  line-height: 1.7;
}

.page-title {
  margin-bottom: 32px;
  padding: 42px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 28px;
  background:
    radial-gradient(circle at top right, rgba(14, 165, 233, 0.2), transparent 36%),
    linear-gradient(135deg, rgba(30, 41, 59, 0.92), rgba(15, 23, 42, 0.92));
}

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

.breadcrumbs a {
  color: #38bdf8;
}

.filter-panel {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 14px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.74);
}

.filter-panel label {
  display: grid;
  gap: 8px;
  color: var(--muted-strong);
  font-size: 13px;
  font-weight: 800;
}

.filter-panel input,
.filter-panel select,
.search-hero input {
  min-height: 46px;
  padding: 0 14px;
}

.empty-state {
  display: none;
  padding: 28px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 20px;
  color: var(--muted-strong);
  background: rgba(15, 23, 42, 0.82);
}

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

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

.ranking-row {
  display: grid;
  grid-template-columns: 76px 124px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.74);
  transition: transform 0.25s ease, border-color 0.25s ease, background 0.25s ease;
}

.ranking-row:hover {
  border-color: rgba(56, 189, 248, 0.42);
  background: rgba(30, 41, 59, 0.92);
}

.rank-number {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  color: white;
  background: linear-gradient(135deg, var(--orange), var(--accent));
  font-size: 20px;
  font-weight: 900;
}

.ranking-row img {
  width: 124px;
  aspect-ratio: 16 / 9;
  object-fit: cover;
  border-radius: 16px;
}

.ranking-info strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.ranking-info span {
  color: var(--muted);
}

.ranking-note {
  max-width: 260px;
  color: var(--muted-strong);
  font-size: 14px;
  line-height: 1.65;
}

.search-hero {
  display: grid;
  gap: 18px;
}

.search-hero form {
  display: flex;
  gap: 12px;
}

.search-hero input {
  flex: 1;
}

.search-hero button {
  min-width: 120px;
}

.detail-hero {
  padding: 36px 0 40px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1.65fr) minmax(320px, 0.75fr);
  gap: 28px;
  align-items: start;
}

.player-card,
.info-panel,
.side-panel {
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.82);
  box-shadow: 0 18px 48px rgba(2, 6, 23, 0.28);
}

.player-card {
  overflow: hidden;
}

.video-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  background: black;
}

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

.player-cover {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  padding: 0;
  border: 0;
  color: white;
  background: #020617;
  cursor: pointer;
}

.player-cover.hidden {
  display: none;
}

.player-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.62;
}

.player-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.78), rgba(2, 6, 23, 0.18));
}

.play-badge {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 92px;
  height: 92px;
  border-radius: 999px;
  color: white;
  background: linear-gradient(135deg, var(--accent), var(--blue));
  font-size: 34px;
  box-shadow: 0 24px 64px rgba(14, 165, 233, 0.42);
}

.player-caption {
  padding: 22px 24px;
}

.player-caption h2 {
  margin: 0 0 8px;
  font-size: 24px;
}

.player-caption p {
  margin: 0;
  color: var(--muted-strong);
}

.info-panel,
.side-panel {
  padding: 24px;
}

.info-panel h2,
.side-panel h2 {
  margin: 0 0 16px;
  font-size: 24px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 16px 0 22px;
}

.detail-meta span {
  padding: 7px 12px;
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  color: var(--muted-strong);
  background: rgba(30, 41, 59, 0.72);
  font-size: 13px;
  font-weight: 800;
}

.detail-poster {
  position: relative;
  margin-bottom: 22px;
  border-radius: 24px;
  overflow: hidden;
  aspect-ratio: 16 / 9;
}

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

.compact-card {
  display: grid;
  grid-template-columns: 96px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border: 1px solid rgba(148, 163, 184, 0.14);
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.7);
  transition: transform 0.25s ease, border-color 0.25s ease;
}

.compact-card:hover {
  border-color: rgba(56, 189, 248, 0.42);
}

.compact-card img {
  aspect-ratio: 16 / 9;
  border-radius: 13px;
}

.compact-card strong {
  display: block;
  margin-bottom: 6px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.compact-card em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

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

.footer-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0;
  display: grid;
  gap: 14px;
  color: var(--muted-strong);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

.footer-links a {
  color: #38bdf8;
  font-weight: 800;
}

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

  .quick-search {
    display: none;
  }

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

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

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .hero-slider {
    min-height: 620px;
    height: 76vh;
  }

  .hero-shade {
    background:
      linear-gradient(0deg, rgba(2, 6, 23, 0.94) 0%, rgba(2, 6, 23, 0.46) 100%),
      linear-gradient(90deg, rgba(0, 0, 0, 0.72), transparent);
  }

  .hero-control {
    display: none;
  }

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

  .feature-card {
    grid-template-columns: 1fr;
  }

  .feature-media {
    min-height: 260px;
  }

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

  .ranking-row {
    grid-template-columns: 52px 96px minmax(0, 1fr);
  }

  .ranking-note {
    grid-column: 2 / -1;
    max-width: none;
  }

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

@media (max-width: 560px) {
  .header-inner {
    width: min(100% - 20px, 1280px);
  }

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

  main,
  .page-shell,
  .hero-content,
  .footer-inner,
  .mobile-nav {
    width: min(100% - 20px, 1280px);
  }

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

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

  .page-title {
    padding: 26px;
  }

  .search-hero form,
  .hero-actions,
  .detail-actions {
    flex-direction: column;
    align-items: stretch;
  }

  .ranking-row {
    grid-template-columns: 1fr;
  }

  .ranking-row img,
  .rank-number {
    width: 100%;
  }

  .rank-number {
    height: 44px;
  }
}
