:root {
  --blue-700: #1d4ed8;
  --blue-600: #2563eb;
  --blue-500: #3b82f6;
  --cyan-500: #06b6d4;
  --red-600: #dc2626;
  --orange-500: #f97316;
  --gray-950: #030712;
  --gray-900: #111827;
  --gray-800: #1f2937;
  --gray-700: #374151;
  --gray-600: #4b5563;
  --gray-500: #6b7280;
  --gray-200: #e5e7eb;
  --gray-100: #f3f4f6;
  --gray-50: #f9fafb;
  --white: #ffffff;
  --shadow-sm: 0 2px 8px rgba(15, 23, 42, 0.08);
  --shadow-md: 0 12px 26px rgba(15, 23, 42, 0.12);
  --shadow-xl: 0 24px 60px rgba(15, 23, 42, 0.22);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--gray-50);
  color: var(--gray-900);
  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,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: var(--white);
  background: linear-gradient(90deg, var(--blue-600), var(--blue-700));
  box-shadow: 0 12px 32px rgba(37, 99, 235, 0.24);
}

.header-inner {
  width: min(1180px, calc(100% - 32px));
  height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

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

.brand-mark {
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  border-radius: 12px;
  color: var(--blue-700);
  background: var(--white);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.36);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  font-weight: 600;
}

.desktop-nav a,
.nav-menu button {
  color: rgba(255, 255, 255, 0.92);
  background: transparent;
  border: 0;
  padding: 10px 0;
}

.desktop-nav a:hover,
.nav-menu button:hover {
  color: #dbeafe;
}

.nav-menu {
  position: relative;
}

.nav-menu-panel {
  position: absolute;
  top: 100%;
  left: -18px;
  width: 170px;
  padding: 10px;
  border-radius: 14px;
  background: var(--white);
  color: var(--gray-800);
  box-shadow: var(--shadow-xl);
  opacity: 0;
  transform: translateY(8px);
  pointer-events: none;
  transition: 0.2s ease;
}

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

.nav-menu-panel a {
  display: block;
  padding: 10px 12px;
  border-radius: 10px;
  color: var(--gray-800);
}

.nav-menu-panel a:hover {
  background: #eff6ff;
  color: var(--blue-700);
}

.header-search {
  margin-left: auto;
  position: relative;
  width: min(360px, 32vw);
}

.header-search input,
.mobile-panel input,
.search-page-form input,
.filter-toolbar input,
.filter-toolbar select,
.search-page-form select {
  width: 100%;
  border: 0;
  outline: 0;
  border-radius: 999px;
}

.header-search input,
.mobile-panel input {
  color: var(--white);
  background: rgba(255, 255, 255, 0.18);
  padding: 11px 86px 11px 18px;
  backdrop-filter: blur(8px);
}

.header-search input::placeholder,
.mobile-panel input::placeholder {
  color: rgba(219, 234, 254, 0.92);
}

.header-search button,
.mobile-panel button,
.search-page-form button {
  border: 0;
  color: var(--blue-700);
  background: var(--white);
  font-weight: 700;
  cursor: pointer;
}

.header-search button {
  position: absolute;
  top: 6px;
  right: 6px;
  padding: 6px 14px;
  border-radius: 999px;
}

.mobile-toggle {
  display: none;
  margin-left: auto;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.14);
}

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

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

.mobile-panel a,
.mobile-panel form {
  padding: 10px 12px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.1);
}

.mobile-panel form {
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 10px;
}

.mobile-panel input {
  padding: 10px 14px;
}

.mobile-panel button {
  border-radius: 999px;
  padding: 0 16px;
}

.hero {
  position: relative;
  height: min(68vh, 620px);
  min-height: 500px;
  overflow: hidden;
  background: var(--gray-900);
}

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

.hero-slide {
  opacity: 0;
  transition: opacity 1s ease;
}

.hero-slide.is-active {
  opacity: 1;
  z-index: 1;
}

.hero-slide img,
.detail-hero > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, #1f2937, #2563eb);
}

.hero-shade,
.detail-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(3, 7, 18, 0.94), rgba(3, 7, 18, 0.44) 48%, rgba(3, 7, 18, 0.18));
}

.hero-content,
.detail-content {
  position: absolute;
  left: 50%;
  bottom: 0;
  width: min(1180px, calc(100% - 32px));
  transform: translateX(-50%);
  padding: 0 0 74px;
  color: var(--white);
  z-index: 2;
}

.hero-kicker,
.detail-meta-top span,
.page-hero span {
  display: inline-flex;
  width: fit-content;
  padding: 8px 16px;
  border-radius: 999px;
  color: var(--white);
  background: var(--red-600);
  font-size: 14px;
  font-weight: 700;
}

.hero h1,
.detail-hero h1 {
  max-width: 780px;
  margin: 16px 0 16px;
  font-size: clamp(34px, 6vw, 64px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.hero p,
.detail-hero p {
  max-width: 680px;
  margin: 0 0 28px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 19px;
}

.hero-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  align-items: center;
}

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 800;
  transition: 0.2s ease;
}

.primary-btn {
  color: var(--white);
  background: var(--blue-600);
  box-shadow: 0 14px 34px rgba(37, 99, 235, 0.34);
}

.primary-btn:hover {
  background: var(--blue-700);
  transform: translateY(-2px);
}

.ghost-btn {
  color: var(--white);
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.3);
}

.hero-tags,
.detail-meta-top {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-tags span {
  padding: 7px 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.13);
}

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

.hero-controls button,
.rail-btn {
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.2);
  font-size: 30px;
  cursor: pointer;
  backdrop-filter: blur(8px);
}

.hero-controls button:hover,
.rail-btn:hover {
  background: rgba(255, 255, 255, 0.34);
}

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

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

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

.quick-categories,
.content-section,
.detail-layout {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.quick-categories {
  margin-top: -46px;
  position: relative;
  z-index: 5;
}

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

.category-tile,
.category-card {
  position: relative;
  display: block;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  background: var(--gray-900);
}

.category-tile {
  height: 136px;
}

.category-tile img,
.category-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.62;
  transition: 0.4s ease;
  background: linear-gradient(135deg, #1f2937, #2563eb);
}

.category-tile:hover img,
.category-card:hover img {
  transform: scale(1.06);
  opacity: 0.74;
}

.category-tile span {
  position: absolute;
  left: 18px;
  bottom: 16px;
  color: var(--white);
  font-size: 22px;
  font-weight: 900;
}

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

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

.section-heading h2,
.panel-heading h2,
.info-card h2,
.side-card h2 {
  margin: 0;
  font-size: 28px;
  line-height: 1.1;
}

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

.section-heading > a,
.panel-heading a {
  color: var(--blue-700);
  font-weight: 800;
}

.rail-wrap {
  position: relative;
}

.movie-rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: 250px;
  gap: 18px;
  overflow-x: auto;
  scroll-snap-type: x proximity;
  padding: 2px 2px 18px;
  scrollbar-width: none;
}

.movie-rail::-webkit-scrollbar {
  display: none;
}

.rail-btn {
  position: absolute;
  top: 100px;
  z-index: 3;
  background: rgba(17, 24, 39, 0.48);
}

.rail-left {
  left: -18px;
}

.rail-right {
  right: -18px;
}

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

.movie-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: 0.24s ease;
}

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

.poster-link {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #1f2937, #2563eb);
}

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

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

.poster-region,
.rank-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  color: var(--blue-700);
  background: rgba(255, 255, 255, 0.92);
  font-size: 12px;
  font-weight: 800;
}

.rank-badge {
  color: var(--white);
  background: var(--red-600);
}

.rank-badge + .poster-region {
  left: 58px;
}

.poster-play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: grid;
  width: 42px;
  height: 42px;
  place-items: center;
  border-radius: 999px;
  color: var(--white);
  background: rgba(37, 99, 235, 0.92);
  box-shadow: 0 10px 30px rgba(37, 99, 235, 0.4);
  opacity: 0;
  transform: translateY(8px);
  transition: 0.24s ease;
}

.movie-card:hover .poster-play {
  opacity: 1;
  transform: translateY(0);
}

.card-body {
  padding: 16px;
}

.card-meta,
.list-meta {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  color: var(--gray-500);
  font-size: 13px;
}

.card-meta span:first-child {
  color: var(--blue-700);
  font-weight: 800;
}

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

.card-body h2 a:hover,
.list-card h2 a:hover {
  color: var(--blue-700);
}

.card-body p {
  min-height: 45px;
  margin: 0 0 12px;
  color: var(--gray-600);
  font-size: 14px;
}

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

.tag-row span {
  display: inline-flex;
  padding: 5px 9px;
  border-radius: 999px;
  color: var(--gray-600);
  background: var(--gray-100);
  font-size: 12px;
}

.compact-card .card-body h2 {
  font-size: 16px;
}

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

.ranking-panel,
.side-card,
.info-card,
.player-card {
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

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

.ranking-list,
.list-stack {
  display: grid;
  gap: 14px;
}

.list-card {
  display: grid;
  grid-template-columns: 156px 1fr;
  gap: 18px;
  overflow: hidden;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
  transition: 0.22s ease;
}

.list-card:hover {
  box-shadow: var(--shadow-md);
  transform: translateY(-3px);
}

.list-cover {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(135deg, #1f2937, #2563eb);
}

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

.list-head {
  display: flex;
  align-items: center;
  gap: 10px;
}

.list-head h2 {
  margin: 0;
  font-size: 18px;
}

.list-card p {
  margin: 8px 0 0;
  color: var(--gray-600);
}

.list-rank {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 38px;
  height: 28px;
  border-radius: 999px;
  color: var(--white);
  background: linear-gradient(90deg, var(--red-600), var(--orange-500));
  font-size: 13px;
  font-weight: 900;
}

.page-hero {
  color: var(--white);
  background: linear-gradient(120deg, var(--blue-600), var(--cyan-500));
}

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

.page-hero h1 {
  margin: 16px 0 12px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.08;
}

.page-hero p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 18px;
}

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

.category-card {
  height: 230px;
}

.category-card div {
  position: absolute;
  inset: auto 0 0;
  padding: 24px;
  color: var(--white);
  background: linear-gradient(0deg, rgba(3, 7, 18, 0.82), transparent);
}

.category-card div span {
  color: #bfdbfe;
  font-weight: 800;
  font-size: 13px;
}

.category-card h2 {
  margin: 6px 0 8px;
  font-size: 24px;
}

.category-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.filter-toolbar,
.search-page-form {
  display: grid;
  grid-template-columns: 1fr 160px 160px auto;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

.filter-toolbar {
  grid-template-columns: 1fr 170px 170px;
}

.filter-toolbar input,
.filter-toolbar select,
.search-page-form input,
.search-page-form select {
  min-height: 46px;
  padding: 0 16px;
  color: var(--gray-800);
  background: var(--gray-100);
}

.search-page-form button {
  min-height: 46px;
  padding: 0 22px;
  border-radius: 999px;
  color: var(--white);
  background: var(--blue-600);
}

.pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 8px;
  margin-top: 34px;
}

.pagination a,
.pagination span {
  display: inline-flex;
  min-width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  padding: 0 14px;
  border-radius: 999px;
  background: var(--white);
  box-shadow: var(--shadow-sm);
  color: var(--gray-700);
  font-weight: 800;
}

.pagination .current {
  color: var(--white);
  background: var(--blue-600);
}

.detail-hero {
  position: relative;
  height: min(64vh, 560px);
  min-height: 450px;
  overflow: hidden;
  background: var(--gray-900);
}

.breadcrumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(255, 255, 255, 0.72);
  font-size: 14px;
}

.breadcrumbs a:hover {
  color: var(--white);
}

.detail-meta-top span {
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(8px);
}

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

.player-card {
  padding: 14px;
}

.movie-player {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: #000;
  aspect-ratio: 16 / 9;
}

.movie-player video,
.player-cover,
.player-cover img {
  width: 100%;
  height: 100%;
}

.movie-player video {
  object-fit: contain;
  background: #000;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: block;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: #000;
  z-index: 2;
}

.player-cover.is-hidden {
  display: none;
}

.player-cover img {
  object-fit: cover;
  opacity: 0.64;
}

.player-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border-radius: 999px;
  color: var(--white);
  background: rgba(37, 99, 235, 0.92);
  box-shadow: 0 18px 40px rgba(37, 99, 235, 0.36);
  transform: translate(-50%, -50%);
  font-size: 34px;
}

.info-card,
.side-card {
  padding: 24px;
  margin-top: 22px;
}

.info-card p {
  margin: 14px 0 0;
  color: var(--gray-700);
  font-size: 17px;
}

.detail-sidebar {
  position: sticky;
  top: 92px;
}

.poster-card {
  padding: 0;
  overflow: hidden;
}

.poster-card img {
  width: 100%;
  aspect-ratio: 4 / 5;
  object-fit: cover;
  background: linear-gradient(135deg, #1f2937, #2563eb);
}

.side-card dl {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 10px 14px;
  margin: 16px 0 18px;
}

.side-card dt {
  color: var(--gray-500);
}

.side-card dd {
  margin: 0;
  font-weight: 700;
}

.related-section {
  padding-top: 44px;
}

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

.footer-grid {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 36px;
}

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

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

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

.site-footer a:not(.footer-brand) {
  display: block;
  margin: 8px 0;
  color: var(--gray-400);
}

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

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px 16px;
  text-align: center;
  color: var(--gray-500);
  font-size: 14px;
}

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

.empty-state {
  grid-column: 1 / -1;
  padding: 46px;
  border-radius: var(--radius);
  text-align: center;
  color: var(--gray-600);
  background: var(--white);
  box-shadow: var(--shadow-sm);
}

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

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

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

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

  .mobile-toggle {
    display: grid;
    place-items: center;
  }

  .header-inner {
    height: 64px;
  }

  .hero {
    min-height: 560px;
  }

  .hero-content,
  .detail-content {
    padding-bottom: 74px;
  }

  .hero-controls {
    display: none;
  }

  .quick-grid,
  .movie-grid,
  .category-grid,
  .footer-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .filter-toolbar,
  .search-page-form {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 620px) {
  .brand,
  .footer-brand {
    font-size: 18px;
  }

  .hero,
  .detail-hero {
    min-height: 520px;
  }

  .hero h1,
  .detail-hero h1 {
    font-size: 38px;
  }

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

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

  .movie-rail {
    grid-auto-columns: 78%;
  }

  .rail-btn {
    display: none;
  }

  .list-card {
    grid-template-columns: 120px 1fr;
    gap: 12px;
  }

  .list-head {
    align-items: flex-start;
  }

  .list-head h2 {
    font-size: 16px;
  }

  .list-card p {
    display: none;
  }

  .page-hero > div {
    padding: 56px 0;
  }

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