* {
  box-sizing: border-box;
}

:root {
  color-scheme: dark;
  --bg: #020617;
  --panel: rgba(15, 23, 42, 0.62);
  --panel-strong: rgba(15, 23, 42, 0.92);
  --panel-soft: rgba(30, 41, 59, 0.32);
  --border: rgba(51, 65, 85, 0.74);
  --muted: #94a3b8;
  --text: #ffffff;
  --soft-text: #cbd5e1;
  --accent: #ef4444;
  --accent-strong: #dc2626;
  --accent-soft: rgba(239, 68, 68, 0.15);
  --shadow: 0 24px 70px rgba(0, 0, 0, 0.34);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top left, rgba(239, 68, 68, 0.14), transparent 34rem), linear-gradient(135deg, #020617 0%, #0f172a 45%, #020617 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: fixed;
  z-index: 100;
  top: 0;
  left: 0;
  right: 0;
  background: rgba(2, 6, 23, 0.95);
  border-bottom: 1px solid rgba(30, 41, 59, 0.6);
  backdrop-filter: blur(18px);
}

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

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

.brand-mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: var(--accent);
  color: white;
  box-shadow: 0 0 32px rgba(239, 68, 68, 0.38);
  font-size: 15px;
  line-height: 1;
}

.brand-copy {
  display: grid;
  gap: 2px;
}

.brand-title {
  font-weight: 800;
  font-size: 21px;
  letter-spacing: -0.04em;
}

.brand-subtitle {
  font-size: 12px;
  color: var(--muted);
}

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

.nav-link {
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 600;
  transition: color 0.2s ease;
}

.nav-link:hover {
  color: #ffffff;
}

.header-search,
.mobile-search,
.wide-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search input,
.mobile-search input,
.wide-search input,
.filter-row input,
.filter-row select {
  min-width: 0;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.65);
  color: var(--text);
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.header-search input,
.mobile-search input {
  width: 190px;
  padding: 10px 14px;
  font-size: 14px;
}

.header-search input:focus,
.mobile-search input:focus,
.wide-search input:focus,
.filter-row input:focus,
.filter-row select:focus {
  border-color: rgba(239, 68, 68, 0.74);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.14);
  background: rgba(15, 23, 42, 0.95);
}

.header-search button,
.mobile-search button,
.wide-search button,
.btn-primary,
.btn-secondary,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 999px;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, border 0.2s ease;
}

.header-search button,
.mobile-search button,
.wide-search button,
.btn-primary {
  background: var(--accent);
  color: #ffffff;
  font-weight: 700;
}

.header-search button,
.mobile-search button {
  padding: 10px 14px;
  font-size: 14px;
}

.btn-primary,
.btn-secondary {
  padding: 12px 24px;
  min-height: 46px;
}

.btn-primary:hover,
.header-search button:hover,
.mobile-search button:hover,
.wide-search button:hover {
  background: var(--accent-strong);
  transform: translateY(-1px);
}

.btn-secondary {
  color: #ffffff;
  background: rgba(15, 23, 42, 0.54);
  border: 1px solid rgba(148, 163, 184, 0.32);
  backdrop-filter: blur(10px);
}

.btn-secondary:hover {
  border-color: rgba(239, 68, 68, 0.6);
  background: rgba(15, 23, 42, 0.82);
}

.text-link {
  color: #f87171;
  font-weight: 700;
  white-space: nowrap;
}

.text-link:hover {
  color: #fecaca;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: rgba(15, 23, 42, 0.7);
  color: #ffffff;
  cursor: pointer;
}

.mobile-panel {
  display: none;
  border-top: 1px solid rgba(30, 41, 59, 0.6);
  padding: 16px;
  background: rgba(2, 6, 23, 0.98);
}

.mobile-panel.is-open {
  display: block;
}

.mobile-panel nav {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.mobile-link {
  padding: 12px 14px;
  border-radius: 12px;
  color: #cbd5e1;
  font-weight: 600;
}

.mobile-link:hover {
  color: #ffffff;
  background: rgba(30, 41, 59, 0.66);
}

main {
  min-height: 70vh;
}

.hero {
  position: relative;
  height: 560px;
  overflow: hidden;
  margin-top: 72px;
}

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

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

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

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 6, 23, 1), rgba(2, 6, 23, 0.72) 45%, rgba(2, 6, 23, 0.28));
}

.hero-content {
  position: absolute;
  left: max(24px, calc((100vw - 1180px) / 2));
  right: 24px;
  bottom: 72px;
  max-width: 760px;
}

.hero-pill,
.eyebrow,
.category-pill {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(239, 68, 68, 0.88);
  border: 1px solid rgba(248, 113, 113, 0.38);
  font-size: 13px;
  font-weight: 800;
  padding: 7px 13px;
  backdrop-filter: blur(10px);
}

.eyebrow {
  margin-bottom: 12px;
}

.category-pill {
  color: #fca5a5;
  background: rgba(239, 68, 68, 0.1);
}

.hero-content h1,
.hero-content h2 {
  margin: 16px 0 14px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.06em;
}

.hero-content p {
  max-width: 680px;
  margin: 0 0 26px;
  color: #cbd5e1;
  font-size: clamp(16px, 2vw, 20px);
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-arrow {
  position: absolute;
  top: 50%;
  width: 48px;
  height: 48px;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.32);
  background: rgba(2, 6, 23, 0.52);
  color: #ffffff;
  font-size: 36px;
  line-height: 1;
  cursor: pointer;
  backdrop-filter: blur(10px);
  transform: translateY(-50%);
}

.hero-prev {
  left: 24px;
}

.hero-next {
  right: 24px;
}

.hero-arrow:hover {
  background: rgba(15, 23, 42, 0.86);
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 30px;
  display: flex;
  align-items: center;
  gap: 8px;
  transform: translateX(-50%);
}

.hero-dot {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(148, 163, 184, 0.72);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.is-active {
  width: 32px;
  background: var(--accent);
}

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

.home-shell {
  padding: 64px 0;
}

.intro-panel,
.feature-card,
.ranking-card,
.detail-card,
.aside-card,
.player-card,
.filter-panel {
  border: 1px solid rgba(30, 41, 59, 0.82);
  border-radius: 26px;
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.62), rgba(30, 41, 59, 0.28));
  box-shadow: var(--shadow);
}

.intro-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
  gap: 28px;
  align-items: center;
  padding: clamp(24px, 4vw, 42px);
  margin-bottom: 64px;
}

.intro-panel h2,
.feature-card h2,
.page-hero h1,
.detail-hero h1 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.05em;
}

.intro-panel p,
.feature-card p,
.page-hero p,
.detail-hero p {
  margin: 0;
  color: var(--soft-text);
  font-size: 17px;
}

.wide-search {
  padding: 8px;
  border: 1px solid rgba(51, 65, 85, 0.82);
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.38);
}

.wide-search input {
  flex: 1;
  padding: 14px 18px;
  border: 0;
  background: transparent;
}

.wide-search button {
  padding: 13px 20px;
}

.content-section {
  margin: 0 0 64px;
}

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

.section-heading.compact {
  align-items: center;
}

.section-heading h2 {
  margin: 0 0 6px;
  font-size: clamp(24px, 3vw, 34px);
  letter-spacing: -0.045em;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

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

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

.movie-card {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(30, 41, 59, 0.82);
  border-radius: 22px;
  background: rgba(15, 23, 42, 0.54);
  transition: border 0.24s ease, transform 0.24s ease, background 0.24s ease;
}

.movie-card:hover {
  border-color: rgba(239, 68, 68, 0.58);
  background: rgba(15, 23, 42, 0.82);
  transform: translateY(-4px);
}

.card-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #020617;
}

.movie-card-large .card-cover {
  aspect-ratio: 16 / 9;
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.42s ease;
}

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

.card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(2, 6, 23, 0.82), rgba(2, 6, 23, 0.08));
}

.card-type,
.rank-badge {
  position: absolute;
  z-index: 2;
  top: 14px;
  left: 14px;
  padding: 6px 10px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(239, 68, 68, 0.88);
  font-size: 12px;
  font-weight: 800;
}

.rank-badge {
  left: auto;
  right: 14px;
  background: rgba(2, 6, 23, 0.78);
  border: 1px solid rgba(148, 163, 184, 0.34);
}

.card-play {
  position: absolute;
  z-index: 2;
  left: 50%;
  top: 50%;
  width: 56px;
  height: 56px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.9);
  color: #ffffff;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.9);
  transition: opacity 0.24s ease, transform 0.24s ease;
}

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

.card-body {
  padding: 18px;
}

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

.movie-card-large .card-body h3 {
  font-size: 20px;
}

.card-body h3 a:hover {
  color: #f87171;
}

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

.card-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #94a3b8;
  font-size: 13px;
}

.card-meta span,
.detail-meta span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  background: rgba(30, 41, 59, 0.72);
}

.tag-row,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.tag-row span,
.detail-tags span {
  border: 1px solid rgba(51, 65, 85, 0.8);
  border-radius: 999px;
  padding: 4px 8px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.56);
  font-size: 12px;
}

.movie-rail {
  display: flex;
  gap: 22px;
  overflow-x: auto;
  padding: 4px 4px 18px;
  scroll-snap-type: x mandatory;
}

.rail-card {
  flex: 0 0 285px;
  scroll-snap-align: start;
}

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

.category-card,
.overview-card {
  position: relative;
  overflow: hidden;
  min-height: 112px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  border: 1px solid rgba(30, 41, 59, 0.8);
  border-radius: 20px;
  background: rgba(15, 23, 42, 0.54);
  padding: 18px;
  transition: transform 0.24s ease, border 0.24s ease;
}

.category-card:hover,
.overview-card:hover {
  border-color: rgba(239, 68, 68, 0.58);
  transform: translateY(-3px);
}

.category-card::before,
.overview-glow {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at top right, rgba(239, 68, 68, 0.24), transparent 50%);
  opacity: 0;
  transition: opacity 0.24s ease;
}

.category-card:hover::before,
.overview-card:hover .overview-glow {
  opacity: 1;
}

.category-card span,
.category-card small,
.overview-card h2,
.overview-card p,
.overview-card strong {
  position: relative;
}

.category-card span,
.overview-card h2 {
  font-weight: 800;
  font-size: 18px;
}

.category-card small,
.overview-card p {
  color: var(--muted);
}

.split-section {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 24px;
}

.ranking-card,
.feature-card {
  padding: 28px;
}

.feature-card {
  display: flex;
  flex-direction: column;
  align-items: start;
  justify-content: center;
}

.feature-card .btn-primary {
  margin-top: 24px;
}

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

.mini-item {
  position: relative;
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr) auto;
  gap: 13px;
  align-items: center;
  border-radius: 16px;
  padding: 10px;
  background: rgba(2, 6, 23, 0.32);
  border: 1px solid rgba(30, 41, 59, 0.6);
}

.mini-item:hover {
  border-color: rgba(239, 68, 68, 0.46);
}

.mini-item img {
  width: 112px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
}

.mini-copy {
  display: grid;
  gap: 6px;
  min-width: 0;
}

.mini-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 14px;
}

.mini-copy small {
  color: var(--muted);
}

.mini-rank {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  font-weight: 800;
}

.page-hero {
  margin-top: 72px;
  background: linear-gradient(to bottom, rgba(15, 23, 42, 0.72), rgba(2, 6, 23, 0));
  border-bottom: 1px solid rgba(30, 41, 59, 0.5);
}

.compact-hero {
  padding: 62px 0 46px;
}

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

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

.filter-panel {
  padding: 22px;
  margin: 42px 0 64px;
}

.filter-row {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 220px;
  gap: 14px;
  margin-bottom: 24px;
}

.filter-row input,
.filter-row select {
  width: 100%;
  padding: 13px 16px;
}

.detail-hero {
  position: relative;
  min-height: 520px;
  margin-top: 72px;
  overflow: hidden;
}

.detail-bg,
.detail-bg-shade {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.detail-bg {
  object-fit: cover;
  filter: blur(4px) saturate(1.1);
  transform: scale(1.03);
}

.detail-bg-shade {
  background: linear-gradient(to top, rgba(2, 6, 23, 1), rgba(2, 6, 23, 0.78) 55%, rgba(2, 6, 23, 0.44));
}

.detail-hero-inner {
  position: relative;
  padding: 44px 0 54px;
}

.detail-hero-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  align-items: center;
  gap: 34px;
}

.detail-poster {
  width: 260px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 24px;
  border: 1px solid rgba(148, 163, 184, 0.28);
  box-shadow: var(--shadow);
}

.detail-hero .detail-meta {
  margin: 22px 0 24px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.9fr);
  gap: 28px;
  padding: 48px 0 72px;
}

.detail-main {
  display: grid;
  gap: 24px;
  min-width: 0;
}

.player-card {
  overflow: hidden;
  padding: 0;
}

.video-wrap {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #000000;
}

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

.video-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.08));
  color: white;
  cursor: pointer;
}

.video-overlay.is-hidden {
  display: none;
}

.video-overlay span {
  width: 76px;
  height: 76px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(239, 68, 68, 0.92);
  box-shadow: 0 0 60px rgba(239, 68, 68, 0.42);
  font-size: 30px;
}

.detail-card,
.aside-card {
  padding: clamp(22px, 3vw, 32px);
}

.detail-card h2,
.aside-card h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

.detail-card p {
  color: var(--soft-text);
  margin: 0 0 14px;
  line-height: 1.85;
}

.review-card {
  background: linear-gradient(135deg, rgba(30, 41, 59, 0.48), rgba(15, 23, 42, 0.68));
}

.detail-aside {
  min-width: 0;
}

.detail-aside .aside-card {
  position: sticky;
  top: 98px;
}

.related-section {
  grid-column: 1 / -1;
  margin-top: 22px;
}

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

.search-wide {
  margin-bottom: 28px;
}

.overview-grid {
  padding: 44px 0 72px;
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.overview-card {
  min-height: 180px;
  padding: 26px;
}

.overview-card strong {
  color: #f87171;
}

.site-footer {
  border-top: 1px solid rgba(30, 41, 59, 0.62);
  background: rgba(2, 6, 23, 0.92);
}

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

.footer-brand {
  display: flex;
  align-items: center;
  gap: 10px;
  color: #ffffff;
  margin-bottom: 14px;
}

.site-footer h3 {
  margin: 0 0 14px;
  color: #ffffff;
  font-size: 16px;
}

.site-footer p {
  margin: 0;
  max-width: 420px;
}

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

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

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

@media (max-width: 1100px) {
  .desktop-nav,
  .header-search {
    display: none;
  }

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

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

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

  .split-section,
  .intro-panel,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .detail-aside .aside-card {
    position: static;
  }
}

@media (max-width: 820px) {
  .hero {
    height: 520px;
  }

  .hero-arrow {
    display: none;
  }

  .hero-content {
    left: 18px;
    bottom: 64px;
  }

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

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

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

  .detail-poster {
    width: min(230px, 70vw);
  }

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

@media (max-width: 560px) {
  .nav-shell {
    width: min(100% - 24px, 1180px);
    min-height: 64px;
  }

  .brand-title {
    font-size: 18px;
  }

  .brand-subtitle {
    display: none;
  }

  .hero,
  .page-hero,
  .detail-hero {
    margin-top: 64px;
  }

  .hero {
    height: 500px;
  }

  .hero-content h1,
  .hero-content h2 {
    font-size: 34px;
  }

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

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

  .mini-item {
    grid-template-columns: 96px minmax(0, 1fr);
  }

  .mini-item img {
    width: 96px;
    height: 64px;
  }

  .mini-rank {
    position: absolute;
    right: 10px;
    top: 10px;
  }
}
