:root {
  --red-900: #7f1d1d;
  --red-800: #991b1b;
  --red-700: #b91c1c;
  --red-600: #dc2626;
  --red-500: #ef4444;
  --slate-950: #020617;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --white: #ffffff;
  --shadow-soft: 0 18px 50px rgba(15, 23, 42, 0.12);
  --shadow-red: 0 22px 60px rgba(185, 28, 28, 0.25);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 12px;
  --container: 1200px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--slate-900);
  background: linear-gradient(180deg, var(--slate-50), #ffffff 55%, #fff7f7);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, var(--red-900), var(--red-700));
  box-shadow: 0 12px 30px rgba(127, 29, 29, 0.28);
}

.nav-shell {
  max-width: var(--container);
  height: 68px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
}

.brand-icon,
.footer-brand span {
  display: inline-flex;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  background: #ffffff;
  color: var(--red-800);
  font-weight: 900;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.18);
}

.brand-copy {
  display: grid;
  line-height: 1.1;
}

.brand-copy strong {
  font-size: 20px;
  letter-spacing: 0.02em;
}

.brand-copy small {
  color: #fee2e2;
  font-size: 12px;
  margin-top: 3px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  color: #fff1f2;
  font-weight: 650;
}

.site-nav > a,
.nav-dropdown > a {
  padding: 22px 0;
  transition: color 0.18s ease, opacity 0.18s ease;
}

.site-nav a:hover {
  color: #ffffff;
}

.nav-dropdown {
  position: relative;
}

.dropdown-panel {
  position: absolute;
  top: calc(100% - 6px);
  left: 0;
  min-width: 190px;
  padding: 8px;
  border-radius: 14px;
  background: var(--white);
  color: var(--slate-700);
  box-shadow: var(--shadow-soft);
  opacity: 0;
  pointer-events: none;
  transform: translateY(8px);
  transition: opacity 0.18s ease, transform 0.18s ease;
}

.nav-dropdown:hover .dropdown-panel,
.nav-dropdown:focus-within .dropdown-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.dropdown-panel a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.dropdown-panel a:hover {
  color: var(--red-800);
  background: #fff1f2;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  background: rgba(255,255,255,0.12);
  border-radius: 12px;
  cursor: pointer;
}

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

.main-content {
  min-height: 65vh;
}

.hero-slider {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  background: var(--slate-950);
}

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

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: scale(1.03);
  transition: opacity 0.55s ease, transform 1.2s ease;
}

.hero-slide.is-active {
  opacity: 1;
  transform: scale(1);
  z-index: 2;
}

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.42;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 18% 40%, rgba(220, 38, 38, 0.42), transparent 34%),
    linear-gradient(90deg, rgba(2, 6, 23, 0.95) 0%, rgba(15, 23, 42, 0.72) 48%, rgba(15, 23, 42, 0.18) 100%),
    linear-gradient(0deg, rgba(2, 6, 23, 0.98), transparent 32%);
}

.hero-inner {
  position: relative;
  z-index: 3;
  max-width: var(--container);
  min-height: 560px;
  margin: 0 auto;
  padding: 70px 20px 92px;
  display: grid;
  align-items: center;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 42px;
}

.hero-copy {
  color: var(--white);
  max-width: 700px;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px 12px;
  border-radius: 999px;
  background: var(--red-600);
  color: var(--white);
  font-weight: 800;
  font-size: 14px;
  box-shadow: var(--shadow-red);
}

.hero-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(38px, 6vw, 64px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-copy p {
  max-width: 640px;
  margin: 0 0 24px;
  color: #d1d5db;
  font-size: 18px;
}

.hero-meta,
.detail-meta,
.page-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-meta span,
.detail-meta span,
.page-meta span {
  display: inline-flex;
  padding: 6px 11px;
  border-radius: 999px;
  color: #fff;
  background: rgba(220, 38, 38, 0.78);
  font-size: 14px;
  font-weight: 700;
}

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

.btn-primary,
.btn-secondary,
.btn-outline {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 12px;
  font-weight: 850;
  transition: transform 0.18s ease, box-shadow 0.18s ease, background 0.18s ease;
}

.btn-primary {
  color: var(--white);
  background: var(--red-600);
  box-shadow: var(--shadow-red);
}

.btn-primary:hover,
.btn-secondary:hover,
.btn-outline:hover {
  transform: translateY(-2px);
}

.btn-primary:hover {
  background: var(--red-700);
}

.btn-secondary {
  color: var(--white);
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(12px);
}

.btn-outline {
  color: var(--red-800);
  border: 1px solid #fecaca;
  background: #fff5f5;
}

.hero-card {
  align-self: end;
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.12);
  border: 1px solid rgba(255,255,255,0.18);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow-soft);
  overflow: hidden;
}

.hero-card img {
  height: 430px;
  object-fit: cover;
}

.hero-card-footer {
  padding: 16px;
  color: #fff;
}

.hero-card-footer strong {
  display: block;
  font-size: 18px;
}

.hero-card-footer small {
  color: #fecaca;
}

.hero-controls {
  position: absolute;
  z-index: 8;
  left: 50%;
  bottom: 28px;
  width: min(100% - 40px, var(--container));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  pointer-events: none;
}

.hero-arrows,
.hero-dots {
  display: flex;
  align-items: center;
  gap: 10px;
  pointer-events: auto;
}

.hero-arrow,
.hero-dot {
  border: 0;
  cursor: pointer;
}

.hero-arrow {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  color: #fff;
  background: rgba(255,255,255,0.14);
  backdrop-filter: blur(10px);
  font-size: 24px;
}

.hero-dot {
  width: 28px;
  height: 5px;
  border-radius: 999px;
  background: rgba(255,255,255,0.32);
}

.hero-dot.is-active {
  width: 42px;
  background: var(--red-500);
}

.section,
.page-hero,
.detail-shell,
.player-wrap {
  max-width: var(--container);
  margin-left: auto;
  margin-right: auto;
  padding-left: 20px;
  padding-right: 20px;
}

.section {
  padding-top: 56px;
  padding-bottom: 12px;
}

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

.section-title,
.page-hero h1,
.detail-title {
  margin: 0;
  color: var(--slate-900);
  line-height: 1.15;
  letter-spacing: -0.03em;
}

.section-title {
  font-size: clamp(26px, 3vw, 34px);
}

.section-desc,
.page-hero p {
  margin: 8px 0 0;
  color: var(--slate-600);
}

.search-panel {
  margin-top: -34px;
  position: relative;
  z-index: 9;
}

.search-card {
  max-width: var(--container);
  margin: 0 auto;
  padding: 20px;
  border-radius: var(--radius-xl);
  background: rgba(255,255,255,0.96);
  box-shadow: var(--shadow-soft);
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 14px;
  align-items: center;
}

.search-card input,
.search-card select,
.filter-bar input,
.filter-bar select {
  width: 100%;
  min-height: 48px;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  padding: 0 16px;
  outline: none;
  color: var(--slate-800);
  background: #fff;
}

.search-card input:focus,
.search-card select:focus,
.filter-bar input:focus,
.filter-bar select:focus {
  border-color: #fca5a5;
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.18);
}

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

.movie-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-soft);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, #111827, #7f1d1d);
}

.poster-link img {
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

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

.quality-badge,
.rank-badge {
  position: absolute;
  top: 12px;
  z-index: 2;
  padding: 5px 9px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 850;
}

.quality-badge {
  left: 12px;
  color: #fff;
  background: var(--red-600);
}

.rank-badge {
  right: 12px;
  color: #fff;
  background: rgba(2, 6, 23, 0.72);
}

.play-bubble {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-flex;
  width: 52px;
  height: 52px;
  align-items: center;
  justify-content: center;
  transform: translate(-50%, -50%) scale(0.86);
  border-radius: 50%;
  color: #fff;
  background: rgba(220, 38, 38, 0.86);
  opacity: 0;
  box-shadow: var(--shadow-red);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

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

.card-body {
  padding: 15px 15px 17px;
}

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

.card-body h3 a:hover {
  color: var(--red-700);
}

.meta-line,
.summary-line {
  margin: 0;
  color: var(--slate-500);
  font-size: 13px;
}

.summary-line {
  margin-top: 8px;
  color: var(--slate-600);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-tags,
.footer-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.card-tags span,
.footer-tags span,
.tag-pill {
  display: inline-flex;
  padding: 5px 8px;
  border-radius: 999px;
  background: #fff1f2;
  color: var(--red-700);
  font-size: 12px;
  font-weight: 700;
}

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

.category-card {
  position: relative;
  overflow: hidden;
  min-height: 210px;
  border-radius: var(--radius-xl);
  padding: 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--red-800), #111827);
  box-shadow: var(--shadow-soft);
}

.category-card::after {
  content: "";
  position: absolute;
  right: -46px;
  top: -46px;
  width: 180px;
  height: 180px;
  border-radius: 50%;
  background: rgba(255,255,255,0.12);
}

.category-card h3 {
  position: relative;
  margin: 0 0 10px;
  font-size: 24px;
}

.category-card p {
  position: relative;
  margin: 0 0 22px;
  color: #fee2e2;
}

.category-thumbs {
  position: relative;
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
}

.category-thumbs img {
  width: 54px;
  height: 72px;
  border-radius: 10px;
  object-fit: cover;
  box-shadow: 0 12px 24px rgba(0,0,0,0.28);
}

.page-hero-wrap {
  background: linear-gradient(135deg, var(--red-800), var(--red-600));
  color: #fff;
}

.page-hero {
  padding-top: 64px;
  padding-bottom: 64px;
}

.page-hero h1 {
  color: #fff;
  font-size: clamp(34px, 5vw, 52px);
}

.page-hero p {
  max-width: 760px;
  color: #fee2e2;
  font-size: 18px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 14px;
  color: #fee2e2;
  font-size: 14px;
}

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

.filter-bar {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 180px;
  gap: 14px;
  padding: 20px;
  margin-top: -28px;
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-soft);
}

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

.rank-row {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 14px;
  padding: 12px;
  border-radius: var(--radius-lg);
  background: #fff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.07);
}

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

.rank-row strong {
  display: block;
  margin-bottom: 6px;
  font-size: 17px;
}

.rank-row p {
  margin: 0;
  color: var(--slate-600);
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.rank-number {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  color: #fff;
  background: var(--red-600);
  font-weight: 850;
  font-size: 12px;
}

.player-section {
  background: #000;
}

.player-wrap {
  padding-top: 28px;
  padding-bottom: 28px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: var(--radius-xl);
  background: #000;
  box-shadow: 0 24px 70px rgba(0,0,0,0.32);
}

.player-shell video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0,0,0,0.18);
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-shell.is-playing .player-cover {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.play-trigger {
  display: inline-flex;
  width: 84px;
  height: 84px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--red-600);
  box-shadow: var(--shadow-red);
  font-size: 34px;
  cursor: pointer;
}

.detail-shell {
  padding-top: 34px;
  padding-bottom: 18px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 280px minmax(0, 1fr);
  gap: 32px;
}

.detail-poster img {
  border-radius: var(--radius-xl);
  box-shadow: var(--shadow-soft);
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.detail-title {
  font-size: clamp(32px, 4vw, 50px);
  margin-bottom: 14px;
}

.detail-intro {
  margin: 22px 0;
  color: var(--slate-700);
  font-size: 18px;
}

.detail-text {
  margin-top: 26px;
  padding: 24px;
  border-radius: var(--radius-xl);
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}

.detail-text h2 {
  margin: 0 0 12px;
  font-size: 22px;
}

.detail-text p {
  margin: 0 0 18px;
  color: var(--slate-700);
}

.detail-text p:last-child {
  margin-bottom: 0;
}

.site-footer {
  margin-top: 64px;
  color: #cbd5e1;
  background: linear-gradient(180deg, #1f2937, #0f172a);
}

.footer-shell {
  max-width: var(--container);
  margin: 0 auto;
  padding: 44px 20px 28px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}

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

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

.site-footer h2 {
  margin: 0 0 14px;
  color: #fff;
  font-size: 17px;
}

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

.site-footer a:hover {
  color: #fff;
}

.copyright {
  margin: 30px 0 0;
  padding-top: 20px;
  border-top: 1px solid rgba(255,255,255,0.1);
  color: #94a3b8;
  font-size: 14px;
}

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

.empty-state {
  display: none;
  padding: 34px;
  text-align: center;
  border-radius: var(--radius-xl);
  background: #fff;
  color: var(--slate-600);
}

.empty-state.is-visible {
  display: block;
}

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

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

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

  .hero-card {
    display: none;
  }
}

@media (max-width: 760px) {
  .nav-toggle {
    display: block;
  }

  .site-nav {
    position: absolute;
    left: 14px;
    right: 14px;
    top: 76px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    padding: 12px;
    border-radius: 18px;
    background: var(--red-900);
    box-shadow: var(--shadow-soft);
  }

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

  .site-nav > a,
  .nav-dropdown > a {
    padding: 11px 12px;
  }

  .dropdown-panel {
    position: static;
    display: grid;
    box-shadow: none;
    opacity: 1;
    pointer-events: auto;
    transform: none;
    background: rgba(255,255,255,0.08);
    color: #fff;
    margin: 4px 0 8px;
  }

  .dropdown-panel a:hover {
    background: rgba(255,255,255,0.12);
    color: #fff;
  }

  .brand-copy small {
    display: none;
  }

  .hero-slider,
  .hero-inner {
    min-height: 620px;
  }

  .hero-inner {
    padding-top: 54px;
  }

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

  .hero-controls {
    align-items: end;
  }

  .search-card,
  .filter-bar,
  .detail-layout {
    grid-template-columns: 1fr;
  }

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

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

  .detail-poster {
    max-width: 240px;
  }
}

@media (max-width: 480px) {
  .movie-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .card-body {
    padding: 12px;
  }

  .card-body h3 {
    font-size: 15px;
  }

  .summary-line,
  .card-tags {
    display: none;
  }
}
