:root {
  color-scheme: dark;
  --bg-0: #020617;
  --bg-1: #0f172a;
  --bg-2: #111827;
  --card: rgba(15, 23, 42, 0.78);
  --card-strong: rgba(15, 23, 42, 0.94);
  --line: rgba(148, 163, 184, 0.18);
  --line-strong: rgba(226, 232, 240, 0.22);
  --text: #f8fafc;
  --muted: #cbd5e1;
  --soft: #94a3b8;
  --accent: #e2e8f0;
  --accent-dark: #0f172a;
  --shadow: 0 24px 70px rgba(2, 6, 23, 0.45);
  --radius-lg: 28px;
  --radius-md: 20px;
  --radius-sm: 14px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  background:
    radial-gradient(circle at 10% 0%, rgba(71, 85, 105, 0.28), transparent 32rem),
    radial-gradient(circle at 80% 12%, rgba(30, 41, 59, 0.72), transparent 36rem),
    linear-gradient(135deg, var(--bg-0), var(--bg-1) 48%, var(--bg-0));
}

body.menu-open {
  overflow: hidden;
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: fixed;
  top: 0;
  right: 0;
  left: 0;
  z-index: 50;
  border-bottom: 1px solid var(--line);
  background: rgba(15, 23, 42, 0.82);
  backdrop-filter: blur(18px);
}

.nav-shell {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: min(1180px, calc(100% - 32px));
  height: 68px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 0;
}

.brand-mark {
  display: grid;
  flex: 0 0 auto;
  width: 42px;
  height: 42px;
  place-items: center;
  border: 1px solid rgba(226, 232, 240, 0.14);
  border-radius: 14px;
  background: linear-gradient(145deg, #334155, #0f172a);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.08), 0 14px 28px rgba(2, 6, 23, 0.32);
}

.brand-play {
  width: 0;
  height: 0;
  margin-left: 3px;
  border-top: 8px solid transparent;
  border-bottom: 8px solid transparent;
  border-left: 13px solid #e2e8f0;
}

.brand-text {
  display: grid;
  gap: 2px;
}

.brand-text strong {
  font-size: 21px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand-text em {
  color: var(--soft);
  font-size: 12px;
  font-style: normal;
}

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

.nav-link,
.mobile-nav-link {
  color: var(--muted);
  transition: color 180ms ease, background 180ms ease, border-color 180ms ease;
}

.nav-link {
  padding: 9px 14px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 600;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-nav-link:hover,
.mobile-nav-link.is-active {
  color: var(--text);
  border-color: var(--line);
  background: rgba(148, 163, 184, 0.1);
}

.menu-button {
  display: none;
  width: 42px;
  height: 42px;
  padding: 0;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.9);
  cursor: pointer;
}

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

.mobile-nav {
  display: none;
  grid-template-columns: 1fr;
  gap: 8px;
  padding: 0 16px 16px;
}

.mobile-nav-link {
  padding: 14px 16px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: rgba(15, 23, 42, 0.94);
  font-weight: 700;
}

.hero {
  position: relative;
  min-height: 85vh;
  overflow: hidden;
}

.hero-stage,
.hero-slide,
.hero-slide img,
.hero-backdrop {
  position: absolute;
  inset: 0;
}

.hero-slide {
  opacity: 0;
  visibility: hidden;
  transition: opacity 700ms ease, visibility 700ms ease;
}

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.hero-backdrop {
  background:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96) 0%, rgba(2, 6, 23, 0.72) 42%, rgba(2, 6, 23, 0.2) 100%),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.1) 45%, rgba(2, 6, 23, 0.7) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  width: min(1180px, calc(100% - 32px));
  min-height: 85vh;
  margin: 0 auto;
  padding: 110px 0 92px;
}

.hero-tags,
.detail-meta,
.movie-meta,
.tag-row,
.detail-tags,
.filter-hints {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}

.hero-tags span,
.detail-meta span,
.movie-meta span,
.tag-row span,
.tag-row a,
.detail-tags span,
.filter-hints span {
  display: inline-flex;
  align-items: center;
  min-height: 28px;
  padding: 5px 10px;
  border: 1px solid rgba(226, 232, 240, 0.14);
  border-radius: 999px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.66);
  font-size: 12px;
  font-weight: 700;
}

.hero-content h1 {
  max-width: 820px;
  margin: 18px 0 18px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.055em;
}

.hero-content p {
  max-width: 720px;
  margin: 0 0 30px;
  color: var(--muted);
  font-size: clamp(17px, 2vw, 22px);
  line-height: 1.78;
}

.hero-actions,
.page-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 22px;
  border: 1px solid transparent;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 180ms ease, border-color 180ms ease, background 180ms ease;
}

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

.btn-primary {
  color: var(--accent-dark);
  background: var(--accent);
}

.btn-ghost {
  color: var(--text);
  border-color: var(--line-strong);
  background: rgba(15, 23, 42, 0.48);
}

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

.hero-dot {
  width: 36px;
  height: 5px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(226, 232, 240, 0.34);
  cursor: pointer;
  transition: width 180ms ease, background 180ms ease;
}

.hero-dot.is-active {
  width: 64px;
  background: #e2e8f0;
}

.home-main,
.page-main {
  min-height: 100vh;
}

.page-main {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding-top: 98px;
}

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

.page-main > .content-section {
  width: 100%;
}

.home-intro {
  display: grid;
  grid-template-columns: minmax(0, 1.1fr) minmax(320px, 0.9fr);
  gap: 26px;
  align-items: stretch;
  margin-top: -42px;
  padding-top: 0;
}

.section-heading {
  max-width: 720px;
  margin-bottom: 26px;
}

.section-heading-wide,
.filter-panel,
.catalog-callout,
.page-hero,
.player-card,
.detail-content,
.detail-side,
.fact-card,
.overview-card,
.rank-panel,
.category-card,
.ranking-table {
  border: 1px solid var(--line);
  background: linear-gradient(145deg, rgba(15, 23, 42, 0.86), rgba(2, 6, 23, 0.72));
  box-shadow: var(--shadow);
}

.section-heading-wide,
.filter-panel {
  min-height: 100%;
  padding: 30px;
  border-radius: var(--radius-lg);
}

.section-heading span,
.page-hero span,
.catalog-callout span,
.rank-panel-head span,
.overview-body span {
  display: inline-flex;
  margin-bottom: 10px;
  color: var(--soft);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.18em;
  text-transform: uppercase;
}

.section-heading h2,
.page-hero h1,
.catalog-callout h2,
.detail-content h1 {
  margin: 0;
  font-weight: 900;
  letter-spacing: -0.035em;
}

.section-heading h2 {
  font-size: clamp(28px, 4vw, 44px);
}

.section-heading p,
.page-hero p,
.catalog-callout p,
.detail-content p,
.overview-body p {
  color: var(--muted);
  line-height: 1.75;
}

.filter-panel {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 18px;
}

.search-box {
  display: grid;
  gap: 8px;
}

.search-box span {
  color: var(--soft);
  font-size: 13px;
  font-weight: 900;
  letter-spacing: 0.14em;
}

.search-box input {
  width: 100%;
  min-height: 52px;
  padding: 0 16px;
  border: 1px solid var(--line-strong);
  border-radius: 16px;
  outline: none;
  color: var(--text);
  background: rgba(2, 6, 23, 0.72);
}

.search-box input:focus {
  border-color: rgba(226, 232, 240, 0.58);
  box-shadow: 0 0 0 4px rgba(226, 232, 240, 0.08);
}

.movie-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(188px, 1fr));
  gap: 20px;
}

.compact-grid {
  grid-template-columns: repeat(auto-fill, minmax(164px, 1fr));
}

.movie-card {
  position: relative;
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--card);
  box-shadow: 0 18px 42px rgba(2, 6, 23, 0.26);
  transition: transform 200ms ease, border-color 200ms ease, background 200ms ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: rgba(226, 232, 240, 0.26);
  background: rgba(15, 23, 42, 0.98);
}

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

.movie-cover {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: linear-gradient(145deg, #1e293b, #020617);
}

.movie-cover img,
.overview-cover img,
.category-card img,
.detail-poster {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.movie-cover img {
  transition: transform 260ms ease, opacity 260ms ease;
}

.movie-card:hover .movie-cover img {
  transform: scale(1.06);
}

.cover-gradient,
.category-shade {
  position: absolute;
  inset: auto 0 0 0;
  height: 48%;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.9), transparent);
}

.rank-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 3;
  display: grid;
  width: 38px;
  height: 38px;
  place-items: center;
  border-radius: 12px;
  color: #020617;
  background: #e2e8f0;
  font-weight: 900;
}

.movie-card-body {
  display: grid;
  gap: 10px;
  padding: 16px;
}

.movie-meta {
  gap: 6px;
}

.movie-meta span {
  padding: 0;
  border: 0;
  background: transparent;
  color: var(--soft);
  font-size: 12px;
}

.movie-card h3 {
  display: -webkit-box;
  min-height: 48px;
  margin: 0;
  overflow: hidden;
  color: var(--text);
  font-size: 17px;
  line-height: 1.42;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-card p {
  display: -webkit-box;
  min-height: 60px;
  margin: 0;
  overflow: hidden;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.55;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

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

.category-card {
  position: relative;
  min-height: 260px;
  overflow: hidden;
  border-radius: var(--radius-md);
  isolation: isolate;
}

.category-card img {
  position: absolute;
  inset: 0;
  z-index: -2;
  transition: transform 260ms ease;
}

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

.category-card .category-shade {
  inset: 0;
  z-index: -1;
  height: auto;
  background:
    linear-gradient(0deg, rgba(2, 6, 23, 0.9), rgba(2, 6, 23, 0.2)),
    linear-gradient(90deg, rgba(2, 6, 23, 0.8), transparent);
}

.category-card strong,
.category-card em,
.category-card p {
  position: relative;
  z-index: 2;
  display: block;
  padding: 0 20px;
}

.category-card strong {
  margin-top: 128px;
  font-size: 24px;
  font-weight: 900;
}

.category-card em {
  margin-top: 7px;
  color: var(--muted);
  font-style: normal;
  font-weight: 800;
}

.category-card p {
  margin: 10px 0 0;
  color: var(--soft);
  font-size: 13px;
  line-height: 1.55;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 26px;
}

.rank-panel {
  position: sticky;
  top: 88px;
  align-self: start;
  padding: 20px;
  border-radius: var(--radius-lg);
}

.rank-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 16px;
}

.rank-panel-head a {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

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

.rank-line {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr);
  gap: 8px 10px;
  padding: 12px;
  border: 1px solid rgba(148, 163, 184, 0.12);
  border-radius: 14px;
  background: rgba(2, 6, 23, 0.36);
}

.rank-line span {
  grid-row: span 2;
  display: grid;
  width: 32px;
  height: 32px;
  place-items: center;
  border-radius: 10px;
  color: #020617;
  background: #e2e8f0;
  font-weight: 900;
}

.rank-line strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-line em {
  overflow: hidden;
  color: var(--soft);
  font-size: 12px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.catalog-callout {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 56px;
  padding: 32px;
  border-radius: var(--radius-lg);
}

.page-hero {
  display: flex;
  align-items: end;
  min-height: 300px;
  margin-bottom: 42px;
  padding: 44px;
  border-radius: var(--radius-lg);
  background:
    radial-gradient(circle at 82% 20%, rgba(148, 163, 184, 0.22), transparent 28rem),
    linear-gradient(145deg, rgba(15, 23, 42, 0.95), rgba(2, 6, 23, 0.74));
}

.page-hero h1 {
  max-width: 820px;
  font-size: clamp(34px, 5vw, 60px);
}

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

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

.overview-card {
  display: grid;
  grid-template-columns: 180px minmax(0, 1fr);
  overflow: hidden;
  border-radius: var(--radius-md);
}

.overview-cover {
  min-height: 260px;
  background: linear-gradient(145deg, #1e293b, #020617);
}

.overview-body {
  display: grid;
  align-content: center;
  gap: 12px;
  padding: 24px;
}

.overview-body h2 {
  margin: 0;
  font-size: 26px;
}

.overview-body p {
  margin: 0;
}

.overview-links {
  display: grid;
  gap: 7px;
}

.overview-links a {
  color: var(--muted);
  overflow: hidden;
  font-size: 13px;
  font-weight: 700;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.section-heading-inline {
  display: flex;
  flex-wrap: wrap;
  align-items: end;
  justify-content: space-between;
  gap: 14px;
  max-width: none;
}

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

.page-link {
  display: grid;
  min-width: 40px;
  height: 40px;
  place-items: center;
  border: 1px solid var(--line);
  border-radius: 12px;
  color: var(--muted);
  background: rgba(15, 23, 42, 0.72);
  font-weight: 800;
}

.page-link:hover,
.page-link.is-active {
  color: #020617;
  background: #e2e8f0;
}

.ranking-top-grid {
  grid-template-columns: repeat(3, 1fr);
}

.ranking-table {
  display: grid;
  overflow: hidden;
  border-radius: var(--radius-md);
}

.ranking-row {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr) minmax(220px, auto) 70px;
  align-items: center;
  gap: 18px;
  padding: 16px 20px;
  border-bottom: 1px solid var(--line);
}

.ranking-row:last-child {
  border-bottom: 0;
}

.ranking-number {
  color: var(--soft);
  font-weight: 900;
}

.ranking-title {
  overflow: hidden;
  font-weight: 900;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-meta,
.ranking-link {
  color: var(--soft);
  font-size: 13px;
  font-weight: 800;
}

.ranking-link {
  text-align: right;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--soft);
  font-size: 14px;
  font-weight: 700;
}

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

.detail-primary {
  display: grid;
  gap: 24px;
}

.player-card,
.detail-content,
.detail-side,
.fact-card {
  overflow: hidden;
  border-radius: var(--radius-lg);
}

.player-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
}

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

.play-mask {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  gap: 14px;
  place-content: center;
  border: 0;
  color: var(--text);
  background: rgba(2, 6, 23, 0.36);
  cursor: pointer;
  transition: opacity 220ms ease, visibility 220ms ease;
}

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

.play-icon {
  display: grid;
  width: 76px;
  height: 76px;
  place-items: center;
  margin: 0 auto;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: 50%;
  background: rgba(248, 250, 252, 0.95);
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.36);
}

.play-icon::before {
  content: "";
  width: 0;
  height: 0;
  margin-left: 5px;
  border-top: 15px solid transparent;
  border-bottom: 15px solid transparent;
  border-left: 23px solid #020617;
}

.play-mask strong {
  font-size: 20px;
  letter-spacing: 0.08em;
}

.detail-content {
  padding: 32px;
}

.detail-content h1 {
  margin: 18px 0 18px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.08;
}

.detail-one-line {
  color: var(--text);
  font-size: 18px;
}

.detail-content section {
  margin-top: 28px;
}

.detail-content h2,
.fact-card h2 {
  margin: 0 0 12px;
  font-size: 21px;
}

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

.detail-side {
  align-self: start;
  display: grid;
  gap: 18px;
  border: 0;
  background: transparent;
  box-shadow: none;
}

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

.fact-card {
  padding: 22px;
}

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

.fact-card li {
  display: grid;
  gap: 5px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--line);
}

.fact-card li:last-child {
  padding-bottom: 0;
  border-bottom: 0;
}

.fact-card span {
  color: var(--soft);
  font-size: 12px;
  font-weight: 900;
}

.fact-card strong {
  color: var(--text);
  font-size: 14px;
}

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

.footer-shell {
  display: grid;
  grid-template-columns: 1.2fr 0.6fr 1fr;
  gap: 34px;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 42px 0;
}

.footer-brand h2,
.footer-group h3 {
  margin: 0 0 12px;
}

.footer-brand p {
  max-width: 540px;
  margin: 0;
  color: var(--soft);
  line-height: 1.75;
}

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

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

.footer-links a {
  color: var(--muted);
  font-size: 14px;
  font-weight: 700;
}

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

  .menu-button {
    display: block;
  }

  body.menu-open .mobile-nav {
    display: grid;
  }

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

  .category-grid,
  .overview-grid,
  .ranking-top-grid {
    grid-template-columns: repeat(2, 1fr);
  }

  .rank-panel {
    position: static;
  }

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

@media (max-width: 700px) {
  .nav-shell {
    height: 64px;
  }

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

  .brand-text em {
    font-size: 11px;
  }

  .hero,
  .hero-content {
    min-height: 78vh;
  }

  .hero-content {
    padding: 92px 0 72px;
  }

  .hero-content h1 {
    font-size: clamp(34px, 13vw, 48px);
  }

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

  .content-section,
  .page-main {
    width: min(100% - 24px, 1180px);
  }

  .section-heading-wide,
  .filter-panel,
  .catalog-callout,
  .page-hero,
  .detail-content {
    padding: 22px;
  }

  .category-grid,
  .overview-grid,
  .ranking-top-grid,
  .detail-side {
    grid-template-columns: 1fr;
  }

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

  .overview-cover {
    min-height: 220px;
  }

  .ranking-row {
    grid-template-columns: 46px minmax(0, 1fr);
    gap: 8px 12px;
  }

  .ranking-meta,
  .ranking-link {
    grid-column: 2;
    text-align: left;
  }

  .catalog-callout {
    align-items: stretch;
    flex-direction: column;
  }

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