:root {
  --slate-950: #020617;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --red-700: #b91c1c;
  --red-600: #dc2626;
  --red-500: #ef4444;
  --red-400: #f87171;
  --orange-500: #f97316;
  --orange-100: #ffedd5;
  --white: #ffffff;
  --shadow: 0 20px 40px rgba(15, 23, 42, 0.14);
  --soft-shadow: 0 12px 30px rgba(15, 23, 42, 0.1);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--slate-800);
  background: linear-gradient(180deg, #f8fafc 0%, #ffffff 44%, #f8fafc 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "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;
  color: var(--white);
  background: linear-gradient(90deg, var(--slate-800), var(--slate-700), var(--slate-800));
  box-shadow: 0 12px 30px rgba(2, 6, 23, 0.25);
}

.nav-inner,
.category-nav-inner,
.footer-grid,
.detail-layout,
.content-section {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.nav-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

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

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  color: var(--white);
  background: linear-gradient(135deg, var(--red-500), var(--orange-500));
  border-radius: 12px;
  box-shadow: 0 12px 24px rgba(239, 68, 68, 0.3);
}

.brand-name {
  font-size: 26px;
  background: linear-gradient(90deg, var(--red-400), #fecaca);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link,
.category-nav-link,
.mobile-link {
  border-radius: 12px;
  transition: background 0.25s ease, color 0.25s ease, transform 0.25s ease;
}

.nav-link {
  padding: 10px 14px;
  color: #e5e7eb;
  font-size: 15px;
}

.nav-link:hover,
.nav-link.active,
.category-nav-link:hover,
.category-nav-link.active,
.mobile-link:hover,
.mobile-link.active {
  color: var(--white);
  background: var(--red-500);
}

.category-nav {
  border-top: 1px solid rgba(255, 255, 255, 0.12);
}

.category-nav-inner {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 12px;
}

.category-nav-link {
  flex: 0 0 auto;
  padding: 7px 14px;
  color: #cbd5e1;
  font-size: 14px;
}

.mobile-menu-button {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  border-radius: 12px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.1);
}

.mobile-menu-button span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: var(--white);
  border-radius: 2px;
}

.mobile-panel {
  display: none;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 16px;
}

.mobile-panel.open {
  display: grid;
  gap: 8px;
}

.mobile-link {
  padding: 10px 14px;
  color: #e5e7eb;
}

.hero-slider {
  position: relative;
  height: 560px;
  overflow: hidden;
  color: var(--white);
  background: linear-gradient(135deg, var(--slate-900), #7f1d1d, var(--slate-900));
}

.hero-pattern {
  position: absolute;
  inset: 0;
  opacity: 0.16;
  background-image: linear-gradient(rgba(255, 255, 255, 0.12) 1px, transparent 1px), linear-gradient(90deg, rgba(255, 255, 255, 0.12) 1px, transparent 1px);
  background-size: 60px 60px;
  pointer-events: none;
}

.hero-track,
.hero-slide,
.hero-backdrop,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-slide {
  opacity: 0;
  transform: scale(1.02);
  transition: opacity 0.7s ease, transform 0.7s ease;
  pointer-events: none;
}

.hero-slide.active {
  opacity: 1;
  transform: scale(1);
  pointer-events: auto;
}

.hero-backdrop {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.08) contrast(1.02);
}

.hero-shade,
.detail-hero-shade,
.category-hero-shade {
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(15, 23, 42, 0.78) 42%, rgba(127, 29, 29, 0.42) 68%, rgba(2, 6, 23, 0.72) 100%);
}

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

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

.hero-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  color: #fecaca;
  background: rgba(239, 68, 68, 0.18);
  border: 1px solid rgba(248, 113, 113, 0.36);
  border-radius: 999px;
  font-size: 14px;
  font-weight: 700;
}

.hero-content h1,
.hero-content h2,
.page-hero h1,
.category-hero h1,
.detail-title-row h1 {
  margin: 18px 0 12px;
  font-size: clamp(36px, 6vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero-movie-name {
  margin: 0 0 10px;
  color: #fecaca;
  font-size: clamp(22px, 3vw, 34px);
  font-weight: 800;
}

.hero-summary,
.hero-content p,
.page-hero p,
.category-hero p,
.detail-title-row p {
  color: #e5e7eb;
  font-size: clamp(16px, 2vw, 20px);
  max-width: 760px;
}

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

.hero-tags {
  margin-top: 18px;
}

.hero-tags span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.hero-tags span {
  padding: 6px 12px;
  color: #fee2e2;
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.18);
}

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

.primary-button,
.ghost-button,
.section-more,
.side-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  font-weight: 800;
  transition: transform 0.25s ease, box-shadow 0.25s ease, background 0.25s ease;
}

.primary-button {
  min-height: 48px;
  padding: 0 24px;
  color: var(--white);
  background: linear-gradient(135deg, var(--red-500), var(--red-600));
  box-shadow: 0 16px 34px rgba(220, 38, 38, 0.34);
}

.ghost-button {
  min-height: 48px;
  padding: 0 20px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
}

.primary-button:hover,
.ghost-button:hover,
.section-more:hover,
.side-link:hover {
  transform: translateY(-2px);
}

.hero-controls {
  position: absolute;
  z-index: 4;
  right: max(24px, calc((100vw - 1280px) / 2));
  bottom: 34px;
  display: flex;
  gap: 10px;
}

.hero-dot {
  width: 34px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.34);
  cursor: pointer;
}

.hero-dot.active {
  background: var(--red-400);
}

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

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

.section-heading h2 {
  margin: 0;
  color: var(--slate-900);
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.16;
}

.section-heading p {
  margin: 8px 0 0;
  color: var(--slate-500);
}

.section-more,
.side-link {
  color: var(--red-600);
  background: #fee2e2;
}

.section-more {
  flex: 0 0 auto;
  padding: 10px 16px;
}

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

.category-card {
  overflow: hidden;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 24px;
  box-shadow: var(--soft-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-card:hover,
.movie-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow);
}

.category-card-posters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 150px;
  overflow: hidden;
  background: linear-gradient(135deg, var(--slate-800), var(--red-700));
}

.category-card-posters img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-card-body {
  padding: 20px;
}

.category-card h3 {
  margin: 0 0 8px;
  color: var(--slate-900);
  font-size: 22px;
}

.category-card p {
  min-height: 76px;
  margin: 0 0 16px;
  color: var(--slate-500);
  font-size: 14px;
}

.category-card span {
  color: var(--red-600);
  font-weight: 800;
}

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

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

.full-grid,
.ranking-grid {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}

.movie-card {
  overflow: hidden;
  background: var(--white);
  border: 1px solid rgba(226, 232, 240, 0.9);
  border-radius: 22px;
  box-shadow: var(--soft-shadow);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card.is-hidden {
  display: none;
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, var(--slate-800), var(--slate-900));
}

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

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

.poster-glow {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(2, 6, 23, 0.82) 100%);
}

.year-badge,
.rank-badge {
  position: absolute;
  z-index: 2;
  top: 10px;
  padding: 5px 9px;
  color: var(--white);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
}

.year-badge {
  left: 10px;
  background: rgba(2, 6, 23, 0.72);
  backdrop-filter: blur(6px);
}

.rank-badge {
  right: 10px;
  background: linear-gradient(135deg, var(--orange-500), var(--red-500));
}

.poster-play {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  width: 56px;
  height: 56px;
  place-items: center;
  color: var(--white);
  background: rgba(239, 68, 68, 0.92);
  border-radius: 999px;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.86);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

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

.movie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 8px;
  color: var(--slate-500);
  font-size: 12px;
  font-weight: 700;
}

.movie-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 6px;
  color: #cbd5e1;
}

.movie-card h3 {
  display: -webkit-box;
  min-height: 52px;
  margin: 0 0 8px;
  overflow: hidden;
  color: var(--slate-900);
  font-size: 17px;
  line-height: 1.5;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-card p {
  display: -webkit-box;
  min-height: 44px;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--slate-500);
  font-size: 13px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tag-row span {
  padding: 4px 8px;
  color: var(--red-600);
  background: #fee2e2;
}

.tool-panel {
  display: grid;
  gap: 14px;
  margin-bottom: 24px;
  padding: 18px;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 22px;
  box-shadow: var(--soft-shadow);
}

.search-label {
  color: var(--slate-900);
  font-size: 18px;
  font-weight: 800;
}

.search-wrap input {
  width: 100%;
  min-height: 48px;
  padding: 0 16px;
  color: var(--slate-900);
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: 14px;
  outline: none;
}

.search-wrap input:focus {
  border-color: var(--red-400);
  box-shadow: 0 0 0 4px rgba(248, 113, 113, 0.16);
}

.filter-row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.filter-button {
  min-height: 36px;
  padding: 0 14px;
  color: var(--slate-700);
  background: var(--slate-100);
  border: 1px solid var(--slate-200);
  border-radius: 999px;
  cursor: pointer;
}

.filter-button.active,
.filter-button:hover {
  color: var(--white);
  background: var(--red-500);
  border-color: var(--red-500);
}

.empty-state {
  display: none;
  margin: 24px 0 0;
  padding: 18px;
  color: var(--slate-500);
  text-align: center;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 18px;
}

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

.page-hero,
.category-hero,
.detail-hero {
  position: relative;
  overflow: hidden;
  color: var(--white);
  background: linear-gradient(135deg, var(--slate-900), #7f1d1d, var(--slate-900));
}

.page-hero {
  display: grid;
  min-height: 330px;
  place-items: center;
  padding: 70px 16px;
  text-align: center;
}

.page-hero > div {
  max-width: 860px;
}

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

.category-hero > img,
.detail-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-hero-shade,
.detail-hero-shade {
  position: absolute;
  inset: 0;
}

.category-hero-content,
.detail-hero-inner {
  position: relative;
  z-index: 2;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.category-hero-content {
  display: flex;
  min-height: 420px;
  flex-direction: column;
  justify-content: center;
  max-width: 1280px;
}

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

.breadcrumbs a {
  color: #fecaca;
  font-weight: 800;
}

.detail-hero {
  min-height: 430px;
}

.detail-hero-inner {
  display: flex;
  min-height: 430px;
  flex-direction: column;
  justify-content: center;
}

.detail-title-row {
  max-width: 860px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 28px;
  padding: 50px 0;
}

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

.player-panel,
.story-card,
.info-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 24px;
  box-shadow: var(--soft-shadow);
}

.player-panel {
  overflow: hidden;
  margin-bottom: 24px;
}

.video-shell {
  position: relative;
  overflow: hidden;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000;
}

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

.play-layer {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle at center, rgba(239, 68, 68, 0.16), rgba(2, 6, 23, 0.74));
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.play-layer.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.big-play-button {
  display: inline-flex;
  align-items: center;
  gap: 14px;
  min-height: 62px;
  padding: 0 28px;
  color: var(--white);
  background: linear-gradient(135deg, var(--red-500), var(--orange-500));
  border: 0;
  border-radius: 999px;
  box-shadow: 0 18px 34px rgba(239, 68, 68, 0.34);
  cursor: pointer;
}

.big-play-button span {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--red-600);
  background: var(--white);
  border-radius: 999px;
}

.story-card {
  margin-bottom: 22px;
  padding: 26px;
}

.story-card h2,
.info-card h2 {
  margin: 0 0 12px;
  color: var(--slate-900);
  font-size: 24px;
}

.story-card p {
  margin: 0;
  color: #475569;
  text-align: justify;
}

.nested-section {
  width: 100%;
  padding: 24px 0 0;
}

.detail-side {
  position: sticky;
  top: 126px;
  align-self: start;
}

.detail-side > img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 24px;
  box-shadow: var(--shadow);
}

.info-card {
  margin-top: 18px;
  padding: 22px;
}

.info-card dl {
  display: grid;
  gap: 12px;
  margin: 0 0 18px;
}

.info-card dl div {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  padding-bottom: 10px;
  border-bottom: 1px solid var(--slate-200);
}

.info-card dt {
  color: var(--slate-500);
  font-weight: 700;
}

.info-card dd {
  margin: 0;
  color: var(--slate-900);
  text-align: right;
  font-weight: 800;
}

.side-link {
  width: 100%;
  min-height: 44px;
  margin-top: 10px;
}

.site-footer {
  margin-top: 30px;
  color: #cbd5e1;
  background: linear-gradient(135deg, var(--slate-900), var(--slate-800), var(--slate-900));
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 34px;
  padding: 48px 0;
}

.footer-brand {
  color: var(--white);
  font-size: 22px;
}

.site-footer p {
  margin: 14px 0 0;
  color: #94a3b8;
  font-size: 14px;
}

.site-footer h2 {
  margin: 0 0 14px;
  color: var(--white);
  font-size: 18px;
}

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

.site-footer a:hover {
  color: var(--red-400);
}

.footer-bottom {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
  color: #94a3b8;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  font-size: 14px;
  text-align: center;
}

@media (max-width: 1180px) {
  .compact-grid,
  .full-grid,
  .ranking-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

  .mobile-menu-button {
    display: block;
  }

  .hero-slider {
    height: 620px;
  }

  .hero-content {
    justify-content: end;
    padding-bottom: 82px;
  }

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

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

  .detail-side {
    position: static;
    display: grid;
    grid-template-columns: 220px minmax(0, 1fr);
    gap: 18px;
  }

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

@media (max-width: 640px) {
  .nav-inner,
  .category-nav-inner,
  .footer-grid,
  .detail-layout,
  .content-section,
  .category-hero-content,
  .detail-hero-inner,
  .mobile-panel {
    width: min(100% - 22px, 1280px);
  }

  .brand-name {
    font-size: 22px;
  }

  .category-nav-inner {
    padding-bottom: 10px;
  }

  .hero-slider {
    height: 650px;
  }

  .hero-actions {
    flex-direction: column;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

  .hero-controls {
    right: 16px;
    bottom: 24px;
  }

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

  .category-grid,
  .compact-grid,
  .full-grid,
  .ranking-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

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

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

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

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