:root {
  color-scheme: dark;
  --bg: #020617;
  --bg-soft: #0f172a;
  --bg-card: rgba(15, 23, 42, 0.72);
  --bg-panel: rgba(30, 41, 59, 0.62);
  --line: rgba(148, 163, 184, 0.18);
  --text: #f8fafc;
  --muted: #94a3b8;
  --muted-strong: #cbd5e1;
  --cyan: #22d3ee;
  --cyan-soft: rgba(34, 211, 238, 0.18);
  --blue: #2563eb;
  --orange: #f59e0b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.36);
  --radius-lg: 28px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.15), transparent 32rem),
    linear-gradient(180deg, #020617 0%, #0f172a 45%, #020617 100%);
  color: var(--text);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(2, 6, 23, 0.76);
  border-bottom: 1px solid var(--line);
  backdrop-filter: blur(18px);
}

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

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

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: white;
  box-shadow: 0 12px 34px rgba(34, 211, 238, 0.28);
}

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

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

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--muted-strong);
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: white;
  background: rgba(34, 211, 238, 0.12);
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.72);
  color: white;
}

.menu-button span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: currentColor;
  border-radius: 999px;
}

.hero {
  position: relative;
  height: min(76vh, 680px);
  min-height: 560px;
  overflow: hidden;
  background: #020617;
}

.hero-stage,
.hero-slide,
.hero-cover,
.hero-shade {
  position: absolute;
  inset: 0;
}

.hero-slide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.8s ease;
}

.hero-slide.active {
  opacity: 1;
  pointer-events: auto;
}

.hero-cover,
.detail-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  background:
    linear-gradient(135deg, rgba(34, 211, 238, 0.22), rgba(37, 99, 235, 0.12)),
    #0f172a;
}

.hero-cover.missing-image,
.detail-bg.missing-image,
.poster img.missing-image,
.compact-poster img.missing-image,
.rank-thumb img.missing-image,
.category-card img.missing-image,
.detail-poster img.missing-image,
.category-cover-strip img.missing-image {
  opacity: 0;
}

.hero-shade {
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.94) 0%, rgba(2, 6, 23, 0.72) 45%, rgba(2, 6, 23, 0.16) 100%),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.42) 44%, transparent 100%);
}

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

.hero-content h1 {
  max-width: 760px;
  margin: 0 0 18px;
  font-size: clamp(42px, 7vw, 76px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.hero-content p {
  max-width: 640px;
  margin: 0 0 22px;
  color: var(--muted-strong);
  font-size: 18px;
  line-height: 1.8;
}

.hero-kicker,
.page-hero span,
.section-title span,
.panel-title span {
  display: inline-flex;
  width: max-content;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--cyan);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.16em;
  text-transform: uppercase;
}

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

.hero-tags span,
.tag-row span {
  display: inline-flex;
  padding: 7px 10px;
  border: 1px solid rgba(34, 211, 238, 0.20);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.66);
  color: var(--muted-strong);
  font-size: 12px;
}

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

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

.primary-button {
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  color: white;
  box-shadow: 0 16px 38px rgba(34, 211, 238, 0.24);
}

.ghost-button {
  border: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.62);
  color: white;
}

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

.hero-panel {
  position: absolute;
  left: 50%;
  bottom: 34px;
  z-index: 4;
  width: min(1180px, calc(100% - 32px));
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.hero-search,
.filter-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-search input,
.filter-bar input,
.filter-bar select {
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  color: white;
}

.hero-search input {
  width: min(42vw, 390px);
  padding: 0 12px;
}

.hero-search button {
  height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  background: white;
  color: #020617;
  font-weight: 800;
  cursor: pointer;
}

.hero-dots {
  display: flex;
  align-items: center;
  gap: 8px;
}

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

.hero-dot.active {
  width: 34px;
  background: var(--cyan);
}

.section-wrap {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 58px 0;
}

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

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

.section-title h2,
.panel-title h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 38px);
  letter-spacing: -0.03em;
}

.section-title a,
.text-link {
  color: var(--cyan);
  font-weight: 700;
}

.compact-title {
  align-items: start;
  justify-content: start;
  flex-direction: column;
  gap: 0;
}

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

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--bg-card);
  box-shadow: 0 14px 40px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
  transform: translateY(-4px);
  border-color: rgba(34, 211, 238, 0.42);
  box-shadow: 0 22px 64px rgba(34, 211, 238, 0.10);
}

.poster,
.compact-poster,
.rank-thumb,
.detail-poster,
.category-card,
.category-cover-strip {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(circle at top left, rgba(34, 211, 238, 0.30), transparent 46%),
    linear-gradient(135deg, rgba(15, 23, 42, 1), rgba(30, 41, 59, 1));
}

.poster {
  display: block;
  aspect-ratio: 2 / 3;
}

.poster-wide {
  min-width: 180px;
  height: 252px;
}

.poster img,
.compact-poster img,
.rank-thumb img,
.detail-poster img,
.category-card img,
.category-cover-strip img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.poster-year {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 5px 8px;
  border-radius: 999px;
  background: rgba(2, 6, 23, 0.78);
  color: white;
  font-size: 12px;
  font-weight: 800;
}

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

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

.movie-card h3,
.review-card h3,
.category-overview-card h2 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
}

.movie-card p,
.review-card p,
.category-overview-card p,
.article-block p,
.watch-panel p,
.page-hero p {
  color: var(--muted-strong);
  line-height: 1.78;
}

.movie-card p {
  min-height: 50px;
  margin: 0 0 12px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  font-size: 14px;
}

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

.category-card {
  min-height: 210px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  box-shadow: var(--shadow);
}

.category-layer {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.08));
}

.category-content {
  position: absolute;
  left: 18px;
  right: 18px;
  bottom: 18px;
}

.category-content strong {
  display: block;
  margin-bottom: 8px;
  font-size: 20px;
}

.category-content em {
  display: block;
  color: var(--muted-strong);
  font-size: 13px;
  font-style: normal;
  line-height: 1.6;
}

.two-column-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 30px;
  align-items: start;
}

.side-panel,
.info-panel,
.watch-panel,
.article-block {
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: rgba(15, 23, 42, 0.72);
  box-shadow: var(--shadow);
}

.side-panel,
.info-panel,
.article-block {
  padding: 24px;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 48px 68px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.62);
  transition: border-color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.rank-row:hover {
  transform: translateX(3px);
  border-color: rgba(34, 211, 238, 0.42);
  background: rgba(30, 41, 59, 0.72);
}

.rank-row.compact {
  grid-template-columns: 38px 54px minmax(0, 1fr);
}

.rank-row.compact .rank-score {
  display: none;
}

.rank-number {
  color: var(--cyan);
  font-size: 20px;
  font-weight: 900;
}

.rank-thumb {
  width: 68px;
  height: 92px;
  border-radius: 12px;
}

.rank-row.compact .rank-thumb {
  width: 54px;
  height: 72px;
}

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

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

.rank-main em,
.compact-info em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-score {
  padding: 7px 10px;
  border-radius: 999px;
  background: var(--cyan-soft);
  color: var(--cyan);
  font-weight: 900;
}

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

.review-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  gap: 20px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: linear-gradient(135deg, rgba(15, 23, 42, 0.86), rgba(30, 41, 59, 0.58));
}

.review-card > div:last-child {
  padding: 22px 22px 22px 0;
}

.page-hero {
  position: relative;
  width: min(1180px, calc(100% - 32px));
  margin: 34px auto 0;
  padding: 68px;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at right top, rgba(34, 211, 238, 0.24), transparent 36rem),
    linear-gradient(135deg, rgba(15, 23, 42, 0.94), rgba(2, 6, 23, 0.92));
  box-shadow: var(--shadow);
}

.page-hero h1 {
  margin: 0 0 16px;
  font-size: clamp(36px, 6vw, 62px);
  letter-spacing: -0.05em;
}

.page-hero p {
  max-width: 650px;
  margin: 0;
  font-size: 17px;
}

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

.category-overview-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  background: var(--bg-card);
  box-shadow: var(--shadow);
}

.category-cover-strip {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  height: 180px;
}

.category-overview-body {
  padding: 24px;
}

.category-actions {
  margin-top: 16px;
}

.filter-bar {
  width: 100%;
  justify-content: space-between;
  margin-bottom: 22px;
  border-radius: var(--radius-md);
}

.filter-bar input,
.filter-bar select {
  height: 42px;
  padding: 0 14px;
  border-radius: 12px;
  background: rgba(2, 6, 23, 0.42);
}

.filter-bar input {
  flex: 1 1 auto;
}

.filter-bar select {
  flex: 0 0 150px;
}

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

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

.detail-hero {
  position: relative;
  min-height: 560px;
  overflow: hidden;
}

.detail-bg,
.detail-bg-mask {
  position: absolute;
  inset: 0;
}

.detail-bg-mask {
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(2, 6, 23, 0.72), rgba(2, 6, 23, 0.48)),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.35) 55%, rgba(2, 6, 23, 0.82) 100%);
}

.detail-shell {
  position: relative;
  z-index: 3;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 32px;
  color: var(--muted-strong);
  font-size: 14px;
}

.breadcrumb a {
  color: var(--cyan);
}

.detail-grid {
  display: grid;
  grid-template-columns: 260px minmax(0, 1fr);
  gap: 34px;
  align-items: end;
}

.detail-poster {
  aspect-ratio: 2 / 3;
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
}

.detail-main h1 {
  max-width: 780px;
  margin: 0 0 20px;
  font-size: clamp(40px, 7vw, 74px);
  line-height: 1.05;
  letter-spacing: -0.06em;
}

.detail-one-line {
  max-width: 720px;
  color: var(--muted-strong);
  font-size: 18px;
  line-height: 1.85;
}

.detail-tags {
  margin-top: 20px;
}

.detail-content {
  padding-top: 26px;
}

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

.watch-panel {
  overflow: hidden;
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #020617;
}

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

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

.video-frame.is-playing .play-overlay {
  opacity: 0;
  pointer-events: none;
}

.play-icon {
  width: 74px;
  height: 74px;
  border-radius: 999px;
  background: linear-gradient(135deg, var(--cyan), var(--blue));
  box-shadow: 0 20px 60px rgba(34, 211, 238, 0.28);
}

.play-icon::before {
  content: "";
  position: absolute;
  width: 0;
  height: 0;
  margin-left: 30px;
  margin-top: 24px;
  border-top: 13px solid transparent;
  border-bottom: 13px solid transparent;
  border-left: 20px solid white;
}

.watch-panel h2,
.watch-panel p {
  padding-left: 24px;
  padding-right: 24px;
}

.watch-panel h2 {
  margin: 24px 0 10px;
  font-size: 26px;
}

.watch-panel p {
  margin: 0 0 24px;
}

.info-panel h2,
.article-block h2 {
  margin: 0 0 18px;
  font-size: 24px;
}

.detail-list {
  display: grid;
  gap: 14px;
  margin: 0;
}

.detail-list div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.detail-list dt {
  color: var(--muted);
}

.detail-list dd {
  margin: 0;
  text-align: right;
  color: white;
}

.article-block {
  margin-top: 24px;
}

.article-block p {
  margin: 0;
  font-size: 16px;
}

.related-title {
  margin-top: 42px;
}

.related-grid {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 14px;
}

.compact-card {
  display: grid;
  grid-template-columns: 86px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: rgba(15, 23, 42, 0.68);
  transition: transform 0.2s ease, border-color 0.2s ease;
}

.compact-card:hover {
  transform: translateY(-2px);
  border-color: rgba(34, 211, 238, 0.42);
}

.compact-poster {
  width: 86px;
  height: 118px;
  border-radius: 12px;
}

.site-footer {
  margin-top: 34px;
  border-top: 1px solid var(--line);
  background: rgba(2, 6, 23, 0.82);
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  min-height: 120px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  color: var(--muted);
}

.footer-brand {
  color: white;
}

@media (max-width: 1080px) {
  .home-grid,
  .latest-grid,
  .catalog-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .side-panel {
    order: -1;
  }
}

@media (max-width: 820px) {
  .menu-button {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: 72px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    padding: 12px;
    border: 1px solid var(--line);
    border-radius: 18px;
    background: rgba(2, 6, 23, 0.94);
    box-shadow: var(--shadow);
  }

  .main-nav.open {
    display: flex;
  }

  .hero {
    height: auto;
    min-height: 640px;
  }

  .hero-content {
    padding-top: 90px;
    justify-content: flex-start;
  }

  .hero-panel {
    flex-direction: column;
    align-items: stretch;
  }

  .hero-search {
    width: 100%;
  }

  .hero-search input {
    width: 100%;
  }

  .section-title,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .home-grid,
  .latest-grid,
  .catalog-grid,
  .movie-grid,
  .review-grid,
  .category-overview-grid,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

  .review-card > div:last-child {
    padding: 0 20px 22px;
  }

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

  .detail-poster {
    width: 220px;
  }

  .page-hero {
    padding: 42px 24px;
  }

  .filter-bar {
    display: grid;
    grid-template-columns: 1fr;
    border-radius: var(--radius-md);
  }

  .filter-bar select {
    width: 100%;
    flex-basis: auto;
  }
}

@media (max-width: 560px) {
  .header-inner,
  .section-wrap,
  .detail-shell,
  .page-hero,
  .footer-inner {
    width: min(100% - 24px, 1180px);
  }

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

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

  .home-grid,
  .latest-grid,
  .catalog-grid,
  .movie-grid,
  .review-grid,
  .category-grid,
  .category-overview-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .rank-row {
    grid-template-columns: 38px 56px minmax(0, 1fr);
  }

  .rank-score {
    display: none;
  }
}
