* {
  box-sizing: border-box;
}

:root {
  --red-900: #7f1d1d;
  --red-800: #991b1b;
  --red-700: #b91c1c;
  --red-600: #dc2626;
  --amber-500: #f59e0b;
  --amber-600: #d97706;
  --gray-950: #030712;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-300: #d1d5db;
  --gray-100: #f3f4f6;
  --gray-50: #f9fafb;
  --white: #ffffff;
  --shadow: 0 16px 40px rgba(17, 24, 39, 0.12);
  --radius: 18px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--gray-900);
  background: linear-gradient(180deg, #fff7f7 0%, #ffffff 42%, #f8fafc 100%);
}

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

img,
video {
  display: block;
  max-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 10px 28px rgba(127, 29, 29, 0.28);
}

.header-inner {
  max-width: 1280px;
  height: 68px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: var(--white);
  font-weight: 800;
  letter-spacing: 0.04em;
}

.brand-icon {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: var(--white);
  color: var(--red-800);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.6);
}

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

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

.nav-link,
.nav-drop-button {
  border: 0;
  display: inline-flex;
  align-items: center;
  min-height: 38px;
  padding: 0 14px;
  color: #fee2e2;
  background: transparent;
  border-radius: 999px;
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.nav-drop-button:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.16);
}

.nav-dropdown {
  position: relative;
}

.nav-drop-menu {
  position: absolute;
  top: 44px;
  right: 0;
  width: 210px;
  padding: 10px;
  border-radius: 16px;
  background: var(--white);
  color: var(--gray-800);
  box-shadow: var(--shadow);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: all 0.2s ease;
}

.nav-dropdown:hover .nav-drop-menu {
  opacity: 1;
  visibility: visible;
  transform: translateY(0);
}

.nav-drop-menu a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  font-size: 14px;
}

.nav-drop-menu a:hover {
  color: var(--red-700);
  background: #fef2f2;
}

.mobile-menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.14);
  cursor: pointer;
}

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

.mobile-nav {
  display: none;
  padding: 0 24px 18px;
  background: var(--red-800);
}

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

.mobile-link {
  color: #fee2e2;
  padding: 10px 12px;
  border-radius: 10px;
}

.mobile-link.is-active,
.mobile-link:hover {
  color: var(--white);
  background: rgba(255, 255, 255, 0.14);
}

.hero-carousel {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  background: var(--gray-950);
}

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

.hero-slide.is-active {
  position: relative;
  opacity: 1;
  visibility: visible;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
  filter: saturate(1.05) contrast(1.02);
}

.hero-layer {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(3, 7, 18, 0.9), rgba(127, 29, 29, 0.72), rgba(3, 7, 18, 0.4)), linear-gradient(0deg, rgba(3, 7, 18, 0.95), transparent 46%);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1280px;
  min-height: 640px;
  margin: 0 auto;
  padding: 92px 24px 80px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  color: var(--white);
}

.hero-kicker,
.page-hero span,
.section-heading span,
.detail-kicker {
  display: inline-flex;
  width: fit-content;
  align-items: center;
  gap: 8px;
  color: #fecaca;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-content h1,
.hero-content h2 {
  max-width: 820px;
  margin: 16px 0 14px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.hero-title-line {
  max-width: 760px;
  color: #fee2e2;
  font-size: clamp(20px, 3vw, 30px);
  font-weight: 700;
  line-height: 1.25;
}

.hero-summary {
  max-width: 700px;
  margin-top: 18px;
  color: #e5e7eb;
  font-size: 17px;
  line-height: 1.8;
}

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

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

.hero-tags span,
.detail-tags span,
.tag-row span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.hero-tags span {
  color: var(--white);
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(6px);
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 22px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button:hover {
  transform: translateY(-2px);
}

.button.primary {
  color: var(--white);
  background: linear-gradient(90deg, var(--amber-600), var(--red-600));
  box-shadow: 0 14px 30px rgba(217, 119, 6, 0.28);
}

.button.ghost {
  color: var(--white);
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.3);
}

.button.small {
  min-height: 38px;
  padding: 0 16px;
  font-size: 14px;
}

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

.hero-dot {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

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

.content-section,
.home-search-section,
.sub-page,
.detail-page {
  max-width: 1280px;
  margin: 0 auto;
  padding: 56px 24px 0;
}

.home-search-section {
  margin-top: -42px;
  position: relative;
  z-index: 5;
}

.wide-search {
  padding: 18px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow);
  backdrop-filter: blur(10px);
}

.wide-search input,
.search-box input {
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--gray-900);
  background: transparent;
}

.wide-search input {
  min-height: 54px;
  padding: 0 18px;
  border-radius: 16px;
  background: var(--gray-50);
  font-size: 18px;
}

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

.section-heading.compact {
  display: block;
  margin-bottom: 12px;
}

.section-heading h2 {
  margin: 6px 0 0;
  color: var(--gray-900);
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.1;
  letter-spacing: -0.04em;
}

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

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

.category-card {
  position: relative;
  min-height: 230px;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--gray-900);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 22px 42px rgba(17, 24, 39, 0.18);
}

.category-card img {
  width: 100%;
  height: 100%;
  min-height: 230px;
  object-fit: cover;
  opacity: 0.72;
  transition: transform 0.4s ease;
}

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

.category-card span,
.category-card em {
  position: absolute;
  left: 18px;
  right: 18px;
  z-index: 2;
  color: var(--white);
}

.category-card span {
  bottom: 58px;
  font-size: 22px;
  font-weight: 900;
}

.category-card em {
  bottom: 18px;
  color: #fee2e2;
  font-size: 13px;
  line-height: 1.5;
  font-style: normal;
}

.two-column,
.ranking-layout,
.detail-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: start;
}

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

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

.movie-card {
  overflow: hidden;
  border-radius: 18px;
  background: var(--white);
  box-shadow: 0 10px 26px rgba(17, 24, 39, 0.1);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 20px 38px rgba(17, 24, 39, 0.16);
}

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: var(--gray-100);
}

.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-link::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 42%, rgba(0, 0, 0, 0.72));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.movie-card:hover .poster-link::after {
  opacity: 1;
}

.type-badge,
.score-badge {
  position: absolute;
  z-index: 2;
  top: 10px;
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 0 9px;
  border-radius: 999px;
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
}

.type-badge {
  left: 10px;
  background: rgba(185, 28, 28, 0.86);
}

.score-badge {
  right: 10px;
  background: rgba(217, 119, 6, 0.9);
}

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

.movie-card-body h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.3;
}

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

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

.movie-meta-row {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
  color: var(--gray-500);
  font-size: 12px;
}

.tag-row span {
  color: var(--red-700);
  background: #fef2f2;
}

.ranking-panel,
.story-block,
.side-related,
.category-overview-card {
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
}

.ranking-panel {
  position: sticky;
  top: 92px;
  padding: 22px;
}

.ranking-panel.wide {
  position: static;
}

.side-heading {
  margin-bottom: 16px;
}

.side-heading h2 {
  font-size: 28px;
}

.rank-list {
  margin: 0;
  padding: 0;
  list-style: none;
  display: grid;
  gap: 12px;
}

.rank-item a {
  display: grid;
  grid-template-columns: 42px 52px minmax(0, 1fr) 44px;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 16px;
  background: var(--gray-50);
  transition: background 0.2s ease, transform 0.2s ease;
}

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

.rank-number {
  color: var(--red-700);
  font-weight: 900;
  font-size: 18px;
}

.rank-item img {
  width: 52px;
  height: 70px;
  border-radius: 10px;
  object-fit: cover;
}

.rank-text {
  min-width: 0;
}

.rank-text strong,
.rank-text em {
  display: block;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.rank-text strong {
  font-size: 15px;
}

.rank-text em {
  margin-top: 4px;
  color: var(--gray-500);
  font-size: 12px;
  font-style: normal;
}

.rank-score {
  color: var(--amber-600);
  font-weight: 900;
}

.page-hero {
  position: relative;
  min-height: 330px;
  overflow: hidden;
  border-radius: 28px;
  color: var(--white);
  background: linear-gradient(135deg, var(--red-900), var(--red-700));
  box-shadow: var(--shadow);
}

.page-hero.simple-hero,
.page-hero.category-hero {
  display: flex;
  align-items: center;
  padding: 54px;
}

.page-hero h1 {
  max-width: 800px;
  margin: 12px 0;
  font-size: clamp(36px, 5vw, 58px);
  line-height: 1.05;
  letter-spacing: -0.05em;
}

.page-hero p {
  max-width: 720px;
  margin: 0;
  color: #fee2e2;
  font-size: 18px;
  line-height: 1.8;
}

.ranking-hero {
  min-height: 420px;
  display: flex;
  align-items: end;
  padding: 54px;
}

.ranking-hero img,
.page-hero-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.ranking-hero img {
  object-fit: cover;
}

.page-hero-overlay {
  background: linear-gradient(90deg, rgba(3, 7, 18, 0.86), rgba(127, 29, 29, 0.64));
}

.ranking-hero div:last-child {
  position: relative;
  z-index: 2;
}

.toolbar {
  display: flex;
  gap: 16px;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 26px;
  padding: 16px;
  border-radius: 20px;
  background: var(--white);
  box-shadow: var(--shadow);
}

.search-box {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 48px;
  padding: 0 16px;
  border-radius: 14px;
  background: var(--gray-50);
}

.search-box span {
  color: var(--red-700);
  font-size: 22px;
  font-weight: 900;
}

.select-wrap {
  display: flex;
  align-items: center;
  gap: 10px;
  color: var(--gray-600);
  font-size: 14px;
  font-weight: 700;
}

.select-wrap select {
  min-height: 48px;
  padding: 0 12px;
  border: 0;
  border-radius: 14px;
  background: var(--gray-50);
  color: var(--gray-900);
  outline: 0;
}

.empty-state {
  display: none;
  margin: 28px 0 0;
  padding: 28px;
  border-radius: 18px;
  background: #fef2f2;
  color: var(--red-700);
  text-align: center;
  font-weight: 800;
}

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

.category-overview-list {
  display: grid;
  gap: 26px;
  margin-top: 36px;
}

.category-overview-card {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  gap: 24px;
  padding: 24px;
}

.category-overview-text span {
  color: var(--red-700);
  font-weight: 900;
  font-size: 13px;
}

.category-overview-text h2 {
  margin: 8px 0 12px;
  font-size: 30px;
}

.category-overview-text p {
  margin: 0 0 20px;
  color: var(--gray-600);
  line-height: 1.8;
}

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

.mini-movie-grid.single-column {
  grid-template-columns: 1fr;
}

.small-card .movie-card-body p,
.mini-movie-grid .movie-card-body p {
  display: none;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin: 30px 0 18px;
  color: var(--gray-600);
  font-size: 14px;
}

.breadcrumb a:hover {
  color: var(--red-700);
}

.detail-hero {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(320px, 0.65fr);
  gap: 30px;
  align-items: stretch;
}

.player-card,
.detail-info {
  border-radius: 26px;
  background: var(--white);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.player-wrap {
  position: relative;
  aspect-ratio: 16 / 9;
  background: var(--gray-950);
}

.movie-player {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: var(--gray-950);
}

.play-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: radial-gradient(circle, rgba(0, 0, 0, 0.2), rgba(0, 0, 0, 0.62));
  cursor: pointer;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.big-play {
  width: 86px;
  height: 86px;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: linear-gradient(135deg, var(--amber-600), var(--red-600));
  box-shadow: 0 20px 44px rgba(220, 38, 38, 0.38);
  cursor: pointer;
  font-size: 34px;
  text-indent: 5px;
}

.detail-info {
  padding: 34px;
}

.detail-info h1 {
  margin: 12px 0 14px;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
  letter-spacing: -0.05em;
}

.detail-one-line {
  color: var(--gray-700);
  font-size: 18px;
  line-height: 1.7;
}

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

.detail-meta span {
  padding: 8px 11px;
  border-radius: 12px;
  color: var(--gray-700);
  background: var(--gray-100);
  font-size: 13px;
  font-weight: 800;
}

.detail-tags span {
  color: var(--red-700);
  background: #fef2f2;
}

.story-block {
  padding: 32px;
}

.story-block h2,
.side-related h2 {
  margin: 0 0 14px;
  font-size: 26px;
  letter-spacing: -0.03em;
}

.story-block h2:not(:first-child) {
  margin-top: 30px;
}

.story-block p {
  margin: 0;
  color: var(--gray-700);
  font-size: 17px;
  line-height: 2;
  white-space: pre-wrap;
}

.side-related {
  position: sticky;
  top: 92px;
  padding: 24px;
}

.next-prev {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin-top: 32px;
}

.next-prev a {
  padding: 14px 16px;
  border-radius: 14px;
  color: var(--red-700);
  background: #fef2f2;
  font-weight: 800;
}

.next-prev a:hover {
  background: #fee2e2;
}

.site-footer {
  margin-top: 70px;
  color: #d1d5db;
  background: linear-gradient(180deg, var(--gray-800), var(--gray-950));
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 46px 24px 28px;
}

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

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

.footer-grid p {
  margin: 0;
  color: #9ca3af;
  line-height: 1.8;
}

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

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

.footer-bottom {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  margin-top: 34px;
  padding-top: 24px;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  color: #9ca3af;
  font-size: 14px;
}

@media (max-width: 1120px) {
  .category-grid,
  .catalog-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .two-column,
  .ranking-layout,
  .detail-content-grid,
  .detail-hero {
    grid-template-columns: 1fr;
  }

  .ranking-panel,
  .side-related {
    position: static;
  }
}

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

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

  .hero-carousel,
  .hero-content {
    min-height: 580px;
  }

  .hero-content {
    padding-top: 70px;
  }

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

  .toolbar {
    display: grid;
  }

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

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

  .footer-bottom {
    flex-direction: column;
  }

  .page-hero.simple-hero,
  .page-hero.category-hero,
  .ranking-hero {
    padding: 34px;
  }

  .next-prev {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .header-inner {
    height: 62px;
    padding: 0 16px;
  }

  .brand-icon {
    width: 38px;
    height: 38px;
  }

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

  .hero-carousel,
  .hero-content {
    min-height: 620px;
  }

  .hero-content,
  .content-section,
  .home-search-section,
  .sub-page,
  .detail-page {
    padding-left: 16px;
    padding-right: 16px;
  }

  .hero-actions {
    display: grid;
  }

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

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

  .detail-info,
  .story-block,
  .side-related {
    padding: 22px;
  }
}
