:root {
  --color-red-900: #7f1d1d;
  --color-red-800: #991b1b;
  --color-red-700: #b91c1c;
  --color-red-600: #dc2626;
  --color-red-500: #ef4444;
  --color-gray-950: #030712;
  --color-gray-900: #111827;
  --color-gray-800: #1f2937;
  --color-gray-700: #374151;
  --color-gray-600: #4b5563;
  --color-gray-500: #6b7280;
  --color-gray-300: #d1d5db;
  --color-gray-200: #e5e7eb;
  --color-gray-100: #f3f4f6;
  --color-gray-50: #f9fafb;
  --color-white: #ffffff;
  --shadow-md: 0 8px 24px rgba(15, 23, 42, 0.10);
  --shadow-lg: 0 18px 40px rgba(15, 23, 42, 0.18);
  --radius-md: 12px;
  --radius-lg: 18px;
  --max-width: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  color: var(--color-gray-900);
  background: var(--color-gray-50);
  line-height: 1.6;
}

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: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--color-gray-200);
  backdrop-filter: blur(16px);
}

.header-inner {
  max-width: var(--max-width);
  height: 72px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  gap: 22px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 21px;
  font-weight: 800;
  color: var(--color-gray-900);
  white-space: nowrap;
}

.site-logo__mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: var(--color-white);
  font-size: 15px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--color-red-500), var(--color-red-800));
  box-shadow: 0 10px 22px rgba(220, 38, 38, 0.28);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  color: var(--color-gray-700);
  font-weight: 600;
}

.desktop-nav a,
.nav-dropdown button {
  padding: 8px 2px;
  border: 0;
  color: inherit;
  background: transparent;
}

.desktop-nav a:hover,
.desktop-nav a.is-active,
.nav-dropdown:hover button {
  color: var(--color-red-600);
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown__menu {
  position: absolute;
  top: 100%;
  left: -14px;
  width: 190px;
  padding: 10px;
  display: grid;
  gap: 4px;
  background: var(--color-white);
  border: 1px solid var(--color-gray-200);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  visibility: hidden;
  transform: translateY(8px);
  transition: opacity 0.2s ease, transform 0.2s ease, visibility 0.2s ease;
}

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

.nav-dropdown__menu a {
  padding: 9px 10px;
  border-radius: 8px;
  font-size: 14px;
}

.nav-dropdown__menu a:hover {
  color: var(--color-red-600);
  background: #fff1f2;
}

.header-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search input,
.mobile-search input,
.search-page-form input,
.filter-bar input,
.filter-bar select {
  border: 1px solid var(--color-gray-300);
  border-radius: 999px;
  background: var(--color-white);
  color: var(--color-gray-900);
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.header-search input {
  width: 230px;
  padding: 10px 14px;
}

.header-search input:focus,
.mobile-search input:focus,
.search-page-form input:focus,
.filter-bar input:focus,
.filter-bar select:focus {
  border-color: var(--color-red-500);
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.12);
}

.header-search button,
.mobile-search button,
.search-page-form button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  color: var(--color-white);
  background: linear-gradient(135deg, var(--color-red-500), var(--color-red-700));
  font-weight: 700;
}

.menu-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  background: transparent;
  font-size: 26px;
  color: var(--color-gray-900);
}

.mobile-nav {
  display: none;
  padding: 0 20px 18px;
  border-top: 1px solid var(--color-gray-200);
  background: var(--color-white);
}

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

.mobile-nav a {
  font-weight: 700;
  color: var(--color-gray-700);
}

.mobile-nav__categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mobile-nav__categories a {
  padding: 6px 10px;
  border-radius: 999px;
  background: var(--color-gray-100);
  font-size: 13px;
}

.mobile-search {
  display: flex;
  gap: 8px;
}

.mobile-search input {
  width: 100%;
  padding: 10px 14px;
}

.hero-section {
  color: var(--color-white);
  background:
    radial-gradient(circle at 15% 15%, rgba(239, 68, 68, 0.45), transparent 36%),
    linear-gradient(135deg, var(--color-red-900), var(--color-red-700) 48%, var(--color-gray-900));
}

.hero-section__inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 72px 20px;
}

.hero-heading {
  max-width: 760px;
  margin: 0 auto 38px;
  text-align: center;
}

.eyebrow {
  margin: 0 0 12px;
  color: #fecaca;
  font-weight: 700;
  letter-spacing: 0.08em;
}

.hero-heading h1 {
  margin: 0;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  font-weight: 900;
}

.hero-heading p {
  margin: 16px auto 0;
  color: #fee2e2;
  font-size: 18px;
}

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

.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 800;
}

.button--primary {
  color: var(--color-red-700);
  background: var(--color-white);
}

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

.hero-grid {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  grid-auto-rows: 190px;
  gap: 16px;
}

.hero-card {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  background: var(--color-gray-900);
}

.hero-card--large {
  grid-column: span 3;
  grid-row: span 2;
}

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

.hero-card:hover img {
  transform: scale(1.07);
  opacity: 0.9;
}

.hero-card__shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.78), rgba(0, 0, 0, 0.12) 62%, rgba(0, 0, 0, 0));
}

.hero-card__content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 22px;
}

.hero-card__content span {
  display: inline-flex;
  margin-bottom: 8px;
  color: #fecaca;
  font-size: 13px;
  font-weight: 800;
}

.hero-card__content h2 {
  margin: 0;
  font-size: 20px;
  font-weight: 900;
}

.hero-card--large .hero-card__content h2 {
  font-size: clamp(28px, 4vw, 42px);
}

.hero-card__content p {
  margin: 8px 0 0;
  color: #e5e7eb;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.content-section {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 48px 20px;
}

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

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

.section-heading h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.25;
  font-weight: 900;
}

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

.section-heading--compact h2 {
  font-size: 22px;
}

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

.category-tile,
.category-card__main {
  display: block;
  padding: 22px;
  min-height: 150px;
  border-radius: var(--radius-lg);
  color: var(--color-white);
  background: linear-gradient(135deg, var(--color-red-500), var(--color-red-700));
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-tile:hover,
.category-card__main:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.category-tile span,
.category-card__main h2 {
  display: block;
  margin: 0 0 10px;
  font-size: 21px;
  font-weight: 900;
}

.category-tile p,
.category-card__main p {
  margin: 0;
  color: #fee2e2;
  font-size: 14px;
}

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

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

.movie-card {
  min-width: 0;
}

.movie-card__link {
  height: 100%;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--color-white);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.movie-card__link:hover {
  transform: translateY(-4px);
  box-shadow: var(--shadow-lg);
}

.movie-card__poster {
  position: relative;
  margin: 0;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: var(--color-gray-900);
}

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

.movie-card__link:hover .movie-card__poster img {
  transform: scale(1.08);
}

.movie-card__year {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 9px;
  color: var(--color-white);
  border-radius: 999px;
  background: var(--color-red-600);
  font-size: 12px;
  font-weight: 800;
}

.movie-card__body {
  flex: 1;
  padding: 16px;
  display: flex;
  flex-direction: column;
}

.movie-card__title {
  margin: 0 0 8px;
  min-height: 48px;
  color: var(--color-gray-900);
  font-size: 18px;
  line-height: 1.35;
  font-weight: 900;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-card__link:hover .movie-card__title {
  color: var(--color-red-600);
}

.movie-card__summary {
  margin: 0 0 12px;
  min-height: 46px;
  color: var(--color-gray-600);
  font-size: 14px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.tag-list span {
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--color-gray-700);
  background: var(--color-gray-100);
  font-size: 12px;
  font-weight: 700;
}

.tag-list--large span {
  padding: 6px 11px;
  font-size: 13px;
}

.movie-card__meta {
  margin-top: auto;
  padding-top: 12px;
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--color-gray-500);
  font-size: 13px;
  border-top: 1px solid var(--color-gray-100);
}

.ranking-panel,
.sidebar-card,
.text-panel,
.player-card,
.detail-content {
  border-radius: var(--radius-lg);
  background: var(--color-white);
  box-shadow: var(--shadow-md);
}

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

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

.ranking-list a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 10px;
  align-items: center;
}

.ranking-list span {
  width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--color-white);
  background: var(--color-red-600);
  font-size: 13px;
  font-weight: 900;
}

.ranking-list strong {
  display: block;
  color: var(--color-gray-900);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.ranking-list em {
  display: block;
  color: var(--color-gray-500);
  font-size: 12px;
  font-style: normal;
}

.page-hero {
  padding: 54px 20px;
  color: var(--color-gray-900);
  background: linear-gradient(135deg, var(--color-white), #fff1f2);
}

.page-hero--red {
  color: var(--color-white);
  background: linear-gradient(135deg, var(--color-red-700), var(--color-red-900));
}

.page-hero--dark {
  color: var(--color-white);
  background: linear-gradient(135deg, var(--color-gray-950), var(--color-red-900));
}

.page-hero > * {
  max-width: var(--max-width);
  margin-left: auto;
  margin-right: auto;
}

.page-hero h1 {
  margin-top: 12px;
  margin-bottom: 10px;
  font-size: clamp(32px, 5vw, 48px);
  line-height: 1.15;
  font-weight: 900;
}

.page-hero p {
  margin-top: 0;
  max-width: 760px;
  color: inherit;
  opacity: 0.82;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  color: inherit;
  font-size: 14px;
  opacity: 0.88;
}

.breadcrumb a:hover {
  text-decoration: underline;
}

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

.category-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--color-white);
  box-shadow: var(--shadow-md);
}

.category-card__main {
  min-height: 170px;
  border-radius: 0;
}

.category-card__main span {
  display: inline-flex;
  margin-top: 18px;
  font-weight: 900;
}

.category-card__links {
  padding: 18px;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 9px 14px;
}

.category-card__links a {
  color: var(--color-gray-700);
  font-weight: 700;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.category-card__links a:hover {
  color: var(--color-red-600);
}

.filter-bar {
  margin-bottom: 24px;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 180px;
  gap: 14px;
  border-radius: var(--radius-lg);
  background: var(--color-white);
  box-shadow: var(--shadow-md);
}

.filter-bar input,
.filter-bar select {
  width: 100%;
  padding: 12px 14px;
}

.empty-state {
  padding: 40px;
  border-radius: var(--radius-lg);
  background: var(--color-white);
  color: var(--color-gray-600);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.ranking-grid {
  display: grid;
  gap: 16px;
}

.ranking-card a {
  min-height: 128px;
  display: grid;
  grid-template-columns: 54px 170px minmax(0, 1fr);
  gap: 18px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius-lg);
  background: var(--color-white);
  box-shadow: var(--shadow-md);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ranking-card a:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow-lg);
}

.ranking-card__number {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--color-white);
  background: linear-gradient(135deg, var(--color-red-500), var(--color-red-800));
  font-weight: 900;
}

.ranking-card img {
  width: 170px;
  height: 100px;
  object-fit: cover;
  border-radius: 12px;
}

.ranking-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
  font-weight: 900;
}

.ranking-card p {
  margin: 0 0 8px;
  color: var(--color-gray-600);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.ranking-card__meta {
  color: var(--color-gray-500);
  font-size: 13px;
}

.search-page-form {
  max-width: 760px;
  margin-top: 24px;
  display: flex;
  gap: 12px;
}

.search-page-form input {
  width: 100%;
  padding: 14px 18px;
}

.search-page-form button {
  padding-left: 26px;
  padding-right: 26px;
}

.detail-layout {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 34px 20px 56px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 28px;
}

.detail-layout > .breadcrumb {
  grid-column: 1 / -1;
  color: var(--color-gray-600);
}

.detail-main {
  display: grid;
  gap: 22px;
}

.player-card {
  overflow: hidden;
}

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

.movie-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: var(--color-gray-950);
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.50), rgba(0, 0, 0, 0.12));
  transition: opacity 0.2s ease;
}

.player-overlay.hidden {
  opacity: 0;
  pointer-events: none;
}

.play-button {
  width: 76px;
  height: 76px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
  border-radius: 999px;
  color: var(--color-white);
  background: rgba(220, 38, 38, 0.92);
  font-size: 30px;
  box-shadow: 0 16px 36px rgba(0, 0, 0, 0.32);
}

.detail-content {
  padding: 22px;
  display: grid;
  grid-template-columns: 210px minmax(0, 1fr);
  gap: 22px;
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--radius-md);
}

.detail-info h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.16;
  font-weight: 900;
}

.detail-one-line {
  margin: 0 0 16px;
  color: var(--color-gray-700);
  font-size: 17px;
}

.detail-meta {
  margin-bottom: 16px;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.detail-meta span {
  padding: 6px 10px;
  border-radius: 999px;
  color: var(--color-red-700);
  background: #fee2e2;
  font-size: 13px;
  font-weight: 800;
}

.text-panel {
  padding: 24px;
}

.text-panel h2,
.sidebar-card h2 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 900;
}

.text-panel p {
  margin: 0;
  color: var(--color-gray-700);
  font-size: 16px;
}

.text-panel--accent {
  border-left: 5px solid var(--color-red-600);
  background: #fff7f7;
}

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

.sidebar-card {
  position: sticky;
  top: 96px;
  padding: 20px;
}

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

.related-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  column-gap: 12px;
  align-items: center;
}

.related-card img {
  grid-row: span 2;
  width: 112px;
  height: 70px;
  object-fit: cover;
  border-radius: 10px;
}

.related-card span {
  color: var(--color-gray-900);
  font-weight: 800;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.related-card:hover span {
  color: var(--color-red-600);
}

.related-card em {
  color: var(--color-gray-500);
  font-size: 12px;
  font-style: normal;
}

.sidebar-more {
  margin-top: 18px;
  display: block;
  padding: 11px 14px;
  border-radius: 999px;
  color: var(--color-white);
  background: linear-gradient(135deg, var(--color-red-500), var(--color-red-700));
  text-align: center;
  font-weight: 900;
}

.site-footer {
  color: var(--color-gray-300);
  background: var(--color-gray-900);
}

.footer-inner {
  max-width: var(--max-width);
  margin: 0 auto;
  padding: 42px 20px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 32px;
}

.site-logo--footer {
  color: var(--color-white);
}

.site-footer p {
  max-width: 440px;
  color: var(--color-gray-300);
}

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

.footer-links {
  display: grid;
  gap: 8px;
}

.footer-links a:hover {
  color: var(--color-red-500);
}

.footer-bottom {
  padding: 18px 20px;
  border-top: 1px solid var(--color-gray-800);
  text-align: center;
  color: var(--color-gray-500);
  font-size: 14px;
}

[hidden] {
  display: none !important;
}

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

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

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

  .hero-card--large {
    grid-column: 1 / -1;
  }

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

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

  .ranking-panel,
  .sidebar-card {
    position: static;
  }
}

@media (max-width: 760px) {
  .header-inner {
    height: 66px;
  }

  .site-logo {
    font-size: 18px;
  }

  .hero-section__inner {
    padding: 48px 16px;
  }

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

  .hero-card,
  .hero-card--large {
    min-height: 240px;
    grid-column: auto;
    grid-row: auto;
  }

  .content-section {
    padding: 36px 16px;
  }

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

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

  .ranking-card a {
    grid-template-columns: 42px 96px minmax(0, 1fr);
    gap: 12px;
  }

  .ranking-card img {
    width: 96px;
    height: 72px;
  }

  .detail-layout {
    padding: 24px 16px 42px;
  }

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

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

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

  .search-page-form,
  .mobile-search {
    flex-direction: column;
  }
}
