:root {
  --bg: #f8fafc;
  --ink: #111827;
  --muted: #64748b;
  --line: #e5e7eb;
  --red: #dc2626;
  --red-soft: #fee2e2;
  --orange: #f97316;
  --slate: #0f172a;
  --slate-soft: #1e293b;
  --card: #ffffff;
  --radius: 18px;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--ink);
  background: linear-gradient(180deg, #f8fafc 0%, #eef2f7 100%);
  font-family: system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, #0f172a 0%, #1e293b 48%, #0f172a 100%);
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.35);
}

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

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.02em;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 12px 28px rgba(220, 38, 38, 0.36);
  font-size: 16px;
}

.nav-menu {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-link,
.nav-drop-panel a {
  color: #e5e7eb;
  border-radius: 999px;
  padding: 9px 14px;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.nav-drop-panel a:hover {
  color: #fff;
  background: rgba(248, 113, 113, 0.18);
}

.nav-dropdown {
  position: relative;
}

.nav-drop-btn {
  border: 0;
  background: transparent;
  cursor: pointer;
}

.nav-drop-panel {
  position: absolute;
  right: 0;
  top: calc(100% + 12px);
  width: 220px;
  padding: 12px;
  display: grid;
  gap: 4px;
  border-radius: 18px;
  background: rgba(15, 23, 42, 0.96);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s ease;
}

.nav-dropdown:hover .nav-drop-panel,
.nav-dropdown:focus-within .nav-drop-panel {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

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

.nav-toggle span {
  display: block;
  height: 2px;
  background: #fff;
  margin: 5px 0;
  border-radius: 999px;
}

.hero-section {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: radial-gradient(circle at 12% 10%, rgba(220, 38, 38, 0.36), transparent 32%), linear-gradient(120deg, #020617 0%, #450a0a 52%, #0f172a 100%);
  padding: 54px 0 64px;
}

.hero-bg-glow {
  position: absolute;
  width: 420px;
  height: 420px;
  right: -120px;
  top: -160px;
  border-radius: 50%;
  background: rgba(249, 115, 22, 0.24);
  filter: blur(18px);
}

.hero-layout,
.section-wrap,
.footer-grid {
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
}

.hero-layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  align-items: stretch;
}

.hero-main {
  display: grid;
  grid-template-columns: 0.78fr 1.22fr;
  gap: 28px;
  align-items: center;
}

.hero-title-block h1,
.page-hero h1,
.detail-copy h1 {
  margin: 0;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-title-block p,
.page-hero p,
.detail-copy .lead {
  color: #cbd5e1;
  font-size: 18px;
  margin: 18px 0 24px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: #fecaca;
  background: rgba(220, 38, 38, 0.18);
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 999px;
  padding: 6px 12px;
  margin-bottom: 14px;
  font-size: 13px;
  font-weight: 700;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.search-box {
  display: flex;
  gap: 10px;
  width: min(100%, 520px);
  padding: 8px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.15);
  backdrop-filter: blur(12px);
}

.search-box input {
  min-width: 0;
  flex: 1;
  border: 0;
  outline: 0;
  color: #fff;
  background: transparent;
  padding: 10px 12px;
}

.search-box input::placeholder {
  color: rgba(255, 255, 255, 0.68);
}

.search-box button,
.btn {
  border: 0;
  border-radius: 14px;
  padding: 10px 18px;
  font-weight: 800;
  cursor: pointer;
  white-space: nowrap;
}

.search-box button,
.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 14px 30px rgba(220, 38, 38, 0.32);
}

.btn.ghost {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.hero-stage {
  position: relative;
  min-height: 520px;
  border-radius: 28px;
  overflow: hidden;
  box-shadow: 0 25px 80px rgba(0, 0, 0, 0.4);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, transform 0.6s ease;
  transform: scale(1.02);
}

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

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

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.88) 0%, rgba(2, 6, 23, 0.48) 48%, rgba(2, 6, 23, 0.1) 100%), linear-gradient(0deg, rgba(2, 6, 23, 0.8) 0%, transparent 58%);
}

.hero-copy {
  position: absolute;
  left: 34px;
  right: 34px;
  bottom: 34px;
  max-width: 620px;
}

.hero-copy h2 {
  margin: 0 0 12px;
  font-size: clamp(30px, 4vw, 54px);
  line-height: 1.05;
}

.hero-copy p {
  color: #e5e7eb;
  margin: 0 0 18px;
  font-size: 17px;
}

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

.hero-side,
.rank-panel,
.story-panel,
.soft-panel {
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.hero-side {
  padding: 22px;
  color: var(--ink);
  align-self: stretch;
}

.hero-side h2,
.rank-head h2,
.section-heading h2,
.story-panel h2 {
  margin: 0;
}

.hero-thumb-list {
  display: grid;
  gap: 12px;
  margin: 18px 0;
}

.hero-thumb {
  display: grid;
  grid-template-columns: 76px 1fr;
  gap: 12px;
  align-items: center;
  width: 100%;
  padding: 8px;
  border: 1px solid transparent;
  border-radius: 16px;
  background: #f8fafc;
  color: var(--ink);
  text-align: left;
  cursor: pointer;
  transition: all 0.2s ease;
}

.hero-thumb img {
  width: 76px;
  height: 52px;
  object-fit: cover;
  border-radius: 12px;
}

.hero-thumb.is-active,
.hero-thumb:hover {
  border-color: rgba(220, 38, 38, 0.28);
  background: #fff1f2;
}

.side-link {
  display: block;
  text-align: center;
  color: #fff;
  border-radius: 16px;
  padding: 12px 16px;
  background: linear-gradient(135deg, #0f172a, #334155);
}

.section-wrap {
  padding: 54px 0;
}

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

.section-heading span,
.rank-head span {
  display: block;
  color: var(--red);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

.section-heading a {
  color: var(--red);
  font-weight: 800;
}

.card-grid {
  display: grid;
  gap: 22px;
}

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

.latest-grid,
.catalog-grid {
  grid-template-columns: repeat(4, minmax(0, 1fr));
}

.movie-card {
  background: var(--card);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 46px rgba(15, 23, 42, 0.16);
}

.movie-poster {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #111827;
}

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

.movie-card:hover .movie-poster img {
  transform: scale(1.08);
}

.play-badge {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 32px;
  background: rgba(0, 0, 0, 0.0);
  opacity: 0;
  transition: all 0.22s ease;
}

.movie-card:hover .play-badge {
  opacity: 1;
  background: rgba(0, 0, 0, 0.28);
}

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

.movie-card h2 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.35;
}

.movie-card h2 a:hover {
  color: var(--red);
}

.movie-meta {
  margin: 0 0 8px;
  color: var(--muted);
  font-size: 13px;
}

.movie-desc {
  margin: 0 0 12px;
  color: #475569;
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.tag-row span {
  color: #b91c1c;
  background: var(--red-soft);
  border-radius: 999px;
  padding: 4px 9px;
  font-size: 12px;
  font-weight: 700;
}

.hero-tags span,
.detail-tags span {
  color: #fff;
  background: rgba(248, 113, 113, 0.28);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

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

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

.category-tile {
  position: relative;
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: end;
  overflow: hidden;
  border-radius: 24px;
  padding: 20px;
  color: #fff;
  box-shadow: var(--shadow);
}

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

.category-tile::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.18));
  z-index: 1;
}

.category-tile span,
.category-tile small {
  position: relative;
  z-index: 2;
}

.category-tile span {
  font-size: 24px;
  font-weight: 900;
}

.category-tile small {
  color: #e5e7eb;
  margin-top: 8px;
}

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

.split-section,
.ranking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  align-items: start;
}

.rank-panel {
  padding: 22px;
}

.rank-panel.wide {
  grid-column: 1 / -1;
}

.rank-list {
  display: grid;
  gap: 10px;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 42px 58px minmax(0, 1fr) auto;
  gap: 12px;
  align-items: center;
  border-radius: 16px;
  padding: 8px;
  background: #f8fafc;
  transition: background 0.2s ease, transform 0.2s ease;
}

.rank-item:hover {
  background: #fff1f2;
  transform: translateX(4px);
}

.rank-no {
  color: var(--red);
  font-weight: 900;
  text-align: center;
}

.rank-item img {
  width: 58px;
  height: 42px;
  object-fit: cover;
  border-radius: 12px;
}

.rank-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.rank-meta {
  color: var(--muted);
  font-size: 13px;
}

.page-hero {
  color: #fff;
  background: radial-gradient(circle at 20% 0%, rgba(249, 115, 22, 0.32), transparent 30%), linear-gradient(120deg, #0f172a, #7f1d1d 60%, #0f172a);
  padding: 70px 0;
}

.page-hero > div {
  width: min(980px, calc(100% - 32px));
  margin: 0 auto;
}

.page-hero.small-hero,
.category-hero,
.ranking-hero,
.search-hero {
  padding: 58px 0;
}

.filter-zone {
  padding-top: 34px;
}

.filter-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 24px;
}

.filter-bar button {
  border: 0;
  border-radius: 999px;
  padding: 9px 14px;
  color: #475569;
  background: #fff;
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.08);
  cursor: pointer;
}

.filter-bar button.is-active,
.filter-bar button:hover {
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--orange));
}

.empty-state {
  display: none;
  color: var(--muted);
  text-align: center;
  padding: 48px 0;
}

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

.detail-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: #020617;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  opacity: 0.3;
  filter: blur(4px);
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.94), rgba(2, 6, 23, 0.72));
}

.detail-layout {
  position: relative;
  z-index: 1;
  width: min(1220px, calc(100% - 32px));
  margin: 0 auto;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  padding: 64px 0;
}

.detail-poster {
  border-radius: 26px;
  overflow: hidden;
  aspect-ratio: 3 / 4;
  box-shadow: 0 28px 80px rgba(0, 0, 0, 0.42);
}

.detail-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

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

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

.detail-meta span {
  border-radius: 999px;
  padding: 7px 12px;
  color: #fee2e2;
  background: rgba(255, 255, 255, 0.1);
}

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

.player-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  border-radius: 26px;
  overflow: hidden;
  background: #000;
  box-shadow: 0 24px 60px rgba(15, 23, 42, 0.24);
}

.movie-video {
  width: 100%;
  height: 100%;
  background: #000;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  color: #fff;
  border: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.18));
  cursor: pointer;
  z-index: 2;
}

.player-cover span {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 18px 48px rgba(220, 38, 38, 0.42);
  font-size: 28px;
}

.player-cover strong {
  font-size: 22px;
}

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

.story-panel {
  padding: 28px;
}

.story-panel h2 {
  margin-top: 0;
  margin-bottom: 12px;
  font-size: 24px;
}

.story-panel p {
  color: #475569;
  margin: 0 0 24px;
  text-indent: 2em;
}

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

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 1.2fr 1fr;
  gap: 28px;
  padding: 48px 0;
}

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

.site-footer p {
  color: #94a3b8;
}

.site-footer a {
  display: block;
  color: #cbd5e1;
  margin: 7px 0;
}

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

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

.footer-bottom {
  border-top: 1px solid rgba(148, 163, 184, 0.16);
  text-align: center;
  color: #64748b;
  padding: 18px;
}

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

@media (max-width: 1080px) {
  .hero-layout,
  .hero-main,
  .split-section,
  .ranking-layout,
  .detail-main {
    grid-template-columns: 1fr;
  }

  .hero-side {
    order: 2;
  }

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

  .detail-layout {
    grid-template-columns: 240px minmax(0, 1fr);
  }

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

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

  .nav-menu {
    position: absolute;
    left: 16px;
    right: 16px;
    top: 72px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 14px;
    border-radius: 18px;
    background: rgba(15, 23, 42, 0.98);
    box-shadow: var(--shadow);
  }

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

  .nav-dropdown,
  .nav-drop-panel {
    width: 100%;
  }

  .nav-drop-panel {
    position: static;
    opacity: 1;
    visibility: visible;
    transform: none;
    background: rgba(255, 255, 255, 0.06);
    box-shadow: none;
    margin-top: 8px;
  }

  .hero-stage {
    min-height: 460px;
  }

  .hero-copy {
    left: 22px;
    right: 22px;
    bottom: 22px;
  }

  .search-box {
    flex-direction: column;
  }

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

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

  .detail-poster {
    width: min(280px, 78vw);
  }

  .detail-main {
    padding-top: 28px;
  }

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

@media (max-width: 520px) {
  .brand {
    font-size: 19px;
  }

  .hero-section,
  .page-hero {
    padding: 38px 0;
  }

  .hero-stage {
    min-height: 420px;
  }

  .featured-grid,
  .latest-grid,
  .catalog-grid,
  .category-grid,
  .category-grid.large {
    grid-template-columns: 1fr;
  }

  .rank-item {
    grid-template-columns: 36px 52px minmax(0, 1fr);
  }

  .rank-meta {
    display: none;
  }
}
