:root {
  color-scheme: dark;
  --bg: #0f172a;
  --bg-deep: #030712;
  --panel: #111827;
  --panel-soft: #1f2937;
  --panel-line: #374151;
  --text: #f9fafb;
  --muted: #9ca3af;
  --soft: #d1d5db;
  --accent: #facc15;
  --accent-hot: #f59e0b;
  --shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--text);
  background: radial-gradient(circle at 15% 10%, rgba(250, 204, 21, 0.08), transparent 30%),
    linear-gradient(135deg, #0f172a 0%, #111827 40%, #030712 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

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

img {
  display: block;
  max-width: 100%;
  background: linear-gradient(135deg, #1f2937, #111827);
}

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(3, 7, 18, 0.86);
  border-bottom: 1px solid rgba(55, 65, 81, 0.8);
  backdrop-filter: blur(18px);
}

.header-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 14px 20px;
  display: flex;
  align-items: center;
  gap: 20px;
}

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

.logo-mark {
  width: 36px;
  height: 36px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 11px;
  color: #111827;
  background: linear-gradient(135deg, var(--accent), var(--accent-hot));
  box-shadow: 0 12px 28px rgba(250, 204, 21, 0.22);
}

.logo-text {
  font-size: 20px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 4px;
  flex: 1 1 auto;
  min-width: 0;
}

.nav-link {
  padding: 8px 11px;
  border-radius: 10px;
  color: #d1d5db;
  font-size: 14px;
  font-weight: 600;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
  white-space: nowrap;
}

.nav-link:hover,
.nav-link.active {
  color: var(--accent);
  background: rgba(31, 41, 55, 0.9);
}

.nav-link:hover {
  transform: translateY(-1px);
}

.nav-search,
.mobile-search,
.search-page-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-search input,
.mobile-search input,
.search-page-form input,
.filter-panel input,
.filter-panel select,
.search-tools select {
  color: var(--text);
  background: rgba(31, 41, 55, 0.95);
  border: 1px solid #374151;
  border-radius: 12px;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.nav-search input {
  width: 220px;
  padding: 10px 12px;
}

.nav-search button,
.mobile-search button,
.search-page-form button {
  padding: 10px 14px;
  color: #111827;
  background: var(--accent);
  border: 0;
  border-radius: 12px;
  font-weight: 800;
  cursor: pointer;
}

.nav-search input:focus,
.mobile-search input:focus,
.search-page-form input:focus,
.filter-panel input:focus,
.filter-panel select:focus,
.search-tools select:focus {
  border-color: var(--accent);
  box-shadow: 0 0 0 3px rgba(250, 204, 21, 0.18);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid #374151;
  border-radius: 12px;
  background: #111827;
  cursor: pointer;
}

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

.mobile-nav {
  display: none;
  padding: 0 20px 18px;
  border-top: 1px solid rgba(55, 65, 81, 0.65);
}

.mobile-nav.open {
  display: block;
}

.mobile-nav nav {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.mobile-search input {
  flex: 1;
  min-width: 0;
  padding: 11px 12px;
}

.hero-section {
  position: relative;
  min-height: 600px;
  overflow: hidden;
  display: flex;
  align-items: center;
}

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(3, 7, 18, 0.98) 0%, rgba(17, 24, 39, 0.88) 44%, rgba(17, 24, 39, 0.18) 100%),
    linear-gradient(0deg, rgba(3, 7, 18, 0.88), transparent 48%);
}

.hero-content {
  position: relative;
  width: min(1280px, 100%);
  margin: 0 auto;
  padding: 92px 20px 78px;
  z-index: 2;
}

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

.hero-content p {
  max-width: 650px;
  margin: 0 0 26px;
  color: #d1d5db;
  font-size: clamp(17px, 2vw, 22px);
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: var(--accent);
  font-size: 18px;
  font-weight: 800;
}

.hero-kicker::before {
  content: "";
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: var(--accent);
  box-shadow: 0 0 22px var(--accent);
}

.hero-feature {
  max-width: 660px;
  margin-bottom: 28px;
  padding: 18px 20px;
  background: rgba(17, 24, 39, 0.72);
  border: 1px solid rgba(250, 204, 21, 0.24);
  border-radius: 18px;
  box-shadow: var(--shadow);
  backdrop-filter: blur(12px);
}

.hero-feature span,
.hero-feature em {
  display: block;
  color: var(--muted);
  font-style: normal;
}

.hero-feature strong {
  display: block;
  margin: 4px 0;
  color: var(--accent);
  font-size: 24px;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 46px;
  padding: 12px 22px;
  border-radius: 12px;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, border 0.2s ease;
}

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

.btn.primary {
  color: #111827;
  background: linear-gradient(135deg, var(--accent), var(--accent-hot));
  box-shadow: 0 14px 30px rgba(250, 204, 21, 0.22);
}

.btn.ghost {
  color: #fff;
  background: rgba(31, 41, 55, 0.9);
  border: 1px solid #374151;
}

.btn.plain {
  color: var(--accent);
  background: rgba(250, 204, 21, 0.08);
  border: 1px solid rgba(250, 204, 21, 0.24);
}

.btn.wide {
  width: 100%;
}

.section-wrap {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 64px 0;
}

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

.section-heading.compact {
  margin-bottom: 18px;
}

.section-heading h2 {
  margin: 0 0 6px;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.2;
}

.section-heading p {
  margin: 0;
  color: var(--muted);
}

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

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

.category-card,
.overview-card {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  border-radius: var(--radius);
  background: #111827;
  box-shadow: var(--shadow);
}

.overview-card {
  min-height: 230px;
}

.category-card img,
.overview-card img {
  width: 100%;
  height: 100%;
  min-height: inherit;
  object-fit: cover;
  opacity: 0.82;
  transition: transform 0.35s ease, opacity 0.35s ease;
}

.category-card:hover img,
.overview-card:hover img {
  transform: scale(1.1);
  opacity: 0.95;
}

.category-card::after,
.overview-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(3, 7, 18, 0.88), rgba(3, 7, 18, 0.18));
}

.category-card.red::after { background: linear-gradient(0deg, rgba(127, 29, 29, 0.9), rgba(249, 115, 22, 0.18)); }
.category-card.blue::after { background: linear-gradient(0deg, rgba(30, 58, 138, 0.9), rgba(6, 182, 212, 0.18)); }
.category-card.green::after { background: linear-gradient(0deg, rgba(20, 83, 45, 0.9), rgba(16, 185, 129, 0.18)); }
.category-card.purple::after { background: linear-gradient(0deg, rgba(88, 28, 135, 0.9), rgba(236, 72, 153, 0.18)); }
.category-card.pink::after { background: linear-gradient(0deg, rgba(131, 24, 67, 0.9), rgba(244, 114, 182, 0.18)); }
.category-card.cyan::after { background: linear-gradient(0deg, rgba(22, 78, 99, 0.9), rgba(34, 211, 238, 0.18)); }
.category-card.amber::after { background: linear-gradient(0deg, rgba(120, 53, 15, 0.9), rgba(245, 158, 11, 0.18)); }
.category-card.emerald::after { background: linear-gradient(0deg, rgba(6, 78, 59, 0.9), rgba(52, 211, 153, 0.18)); }

.category-card span,
.overview-card span {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  padding: 22px;
}

.category-card strong,
.overview-card strong {
  display: block;
  font-size: 24px;
  line-height: 1.2;
}

.category-card em,
.overview-card em {
  display: block;
  margin-top: 8px;
  color: #e5e7eb;
  font-style: normal;
  font-size: 14px;
}

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

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

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

.movie-card {
  display: flex;
  flex-direction: column;
  overflow: hidden;
  min-width: 0;
  background: rgba(31, 41, 55, 0.78);
  border: 1px solid rgba(55, 65, 81, 0.85);
  border-radius: var(--radius);
  box-shadow: 0 18px 50px rgba(0, 0, 0, 0.18);
  transition: transform 0.22s ease, border-color 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-4px);
  border-color: rgba(250, 204, 21, 0.9);
  box-shadow: 0 22px 60px rgba(0, 0, 0, 0.32);
}

.poster-wrap {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
}

.poster-wrap img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.movie-card:hover .poster-wrap img {
  transform: scale(1.08);
}

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.66), transparent 48%);
}

.poster-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  max-width: calc(100% - 20px);
  padding: 4px 8px;
  color: #111827;
  background: var(--accent);
  border-radius: 8px;
  font-size: 12px;
  font-weight: 900;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 15px;
}

.card-body strong {
  color: #fff;
  font-size: 16px;
  line-height: 1.35;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 1;
  -webkit-box-orient: vertical;
}

.card-body em,
.card-line {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.card-line {
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tag-row,
.genre-row,
.tag-links,
.meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span,
.genre-row span,
.tag-links a,
.meta-pills span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 4px 9px;
  color: #fef3c7;
  background: rgba(250, 204, 21, 0.1);
  border: 1px solid rgba(250, 204, 21, 0.18);
  border-radius: 999px;
  font-size: 12px;
}

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

.ranking-panel,
.poster-panel {
  background: rgba(17, 24, 39, 0.86);
  border: 1px solid rgba(55, 65, 81, 0.85);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}

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

.ranking-item {
  display: grid;
  grid-template-columns: 42px 58px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  background: rgba(31, 41, 55, 0.7);
  transition: background 0.2s ease, transform 0.2s ease;
}

.ranking-item:hover {
  background: rgba(55, 65, 81, 0.86);
  transform: translateX(3px);
}

.rank-number {
  color: var(--accent);
  font-size: 20px;
  font-weight: 900;
  text-align: center;
}

.ranking-item img {
  width: 58px;
  height: 78px;
  object-fit: cover;
  border-radius: 10px;
}

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

.ranking-item em {
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.page-hero,
.detail-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #111827, #030712);
  border-bottom: 1px solid rgba(55, 65, 81, 0.8);
}

.page-hero.slim > div {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 70px 0 56px;
}

.page-hero h1,
.detail-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(36px, 6vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.page-hero p,
.detail-hero p {
  max-width: 780px;
  margin: 0;
  color: #d1d5db;
  font-size: 18px;
}

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

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

.filter-panel,
.search-tools {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 180px;
  gap: 14px;
  margin-bottom: 28px;
  padding: 16px;
  background: rgba(17, 24, 39, 0.72);
  border: 1px solid rgba(55, 65, 81, 0.78);
  border-radius: var(--radius);
}

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

.filter-empty,
.search-empty {
  margin: 30px 0 0;
  padding: 24px;
  color: var(--muted);
  text-align: center;
  background: rgba(17, 24, 39, 0.72);
  border: 1px solid rgba(55, 65, 81, 0.78);
  border-radius: var(--radius);
}

.search-page-form {
  max-width: 700px;
  margin-top: 26px;
}

.search-page-form input {
  flex: 1;
  min-width: 0;
  padding: 14px 16px;
  font-size: 16px;
}

.search-page-form button {
  padding: 14px 22px;
}

.search-tools {
  grid-template-columns: 180px 180px;
  justify-content: start;
}

.detail-hero {
  min-height: 460px;
}

.detail-hero > img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.46;
  filter: blur(2px);
  transform: scale(1.04);
}

.detail-hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(3, 7, 18, 0.96), rgba(17, 24, 39, 0.72), rgba(3, 7, 18, 0.32)),
    linear-gradient(0deg, rgba(3, 7, 18, 0.9), transparent);
}

.detail-hero-inner {
  position: relative;
  z-index: 2;
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 82px 0 76px;
}

.detail-hero-inner > p:not(.breadcrumb) {
  margin-bottom: 24px;
}

.detail-layout {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 54px 0 20px;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 330px;
  gap: 30px;
  align-items: start;
}

.player-section {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #000;
  border: 1px solid rgba(55, 65, 81, 0.9);
  border-radius: 22px;
  box-shadow: var(--shadow);
}

.movie-video {
  width: 100%;
  height: 100%;
  background: #000;
  display: block;
}

.player-cover {
  position: absolute;
  inset: 0;
  z-index: 5;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #fff;
  background: linear-gradient(0deg, rgba(3, 7, 18, 0.72), rgba(3, 7, 18, 0.25));
  border: 0;
  cursor: pointer;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.player-cover.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.play-ring {
  width: 82px;
  height: 82px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--accent), var(--accent-hot));
  box-shadow: 0 18px 42px rgba(250, 204, 21, 0.28);
}

.play-triangle {
  width: 0;
  height: 0;
  margin-left: 5px;
  border-top: 14px solid transparent;
  border-bottom: 14px solid transparent;
  border-left: 22px solid #111827;
}

.player-cover strong {
  font-size: clamp(24px, 4vw, 40px);
}

.player-cover em {
  color: #fde68a;
  font-style: normal;
  font-weight: 700;
}

.player-message {
  position: absolute;
  left: 18px;
  bottom: 18px;
  z-index: 7;
  margin: 0;
  color: #fecaca;
  font-weight: 700;
}

.detail-article,
.poster-panel {
  margin-top: 24px;
}

.detail-article {
  padding: 26px;
  background: rgba(17, 24, 39, 0.78);
  border: 1px solid rgba(55, 65, 81, 0.86);
  border-radius: var(--radius);
}

.detail-article h2 {
  margin: 0 0 12px;
  font-size: 24px;
}

.detail-article h2:not(:first-child) {
  margin-top: 28px;
}

.detail-article p {
  margin: 0;
  color: #d1d5db;
  font-size: 16px;
}

.poster-panel {
  position: sticky;
  top: 90px;
}

.poster-panel img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 16px;
}

.poster-panel h2 {
  margin: 18px 0 8px;
  font-size: 24px;
}

.poster-panel p {
  margin: 0 0 18px;
  color: var(--muted);
}

.related-wrap {
  padding-top: 24px;
}

.rank-card {
  flex-direction: row;
  min-height: 178px;
}

.rank-card .poster-wrap {
  width: 132px;
  min-width: 132px;
  aspect-ratio: auto;
}

.rank-card .card-body {
  justify-content: center;
}

.site-footer {
  margin-top: 40px;
  background: rgba(3, 7, 18, 0.94);
  border-top: 1px solid rgba(55, 65, 81, 0.8);
}

.footer-inner {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 44px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 40px;
}

.footer-inner p {
  max-width: 620px;
  color: var(--muted);
}

.footer-inner h2 {
  margin: 0 0 14px;
  font-size: 18px;
}

.footer-inner ul {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px 16px;
}

.footer-inner a:hover {
  color: var(--accent);
}

.footer-bottom {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 18px 0 26px;
  color: var(--muted);
  border-top: 1px solid rgba(55, 65, 81, 0.6);
  font-size: 14px;
}

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

  .menu-toggle {
    display: block;
  }

  .nav-search {
    margin-left: auto;
  }

  .catalog-grid,
  .movie-grid,
  .rank-grid,
  .search-result-grid,
  .compact-grid {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }

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

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

  .poster-panel {
    position: static;
  }
}

@media (max-width: 760px) {
  .header-inner {
    padding: 12px 16px;
  }

  .nav-search {
    display: none;
  }

  .hero-section {
    min-height: 560px;
  }

  .hero-content {
    padding: 70px 20px 58px;
  }

  .hero-actions,
  .search-page-form {
    flex-direction: column;
    align-items: stretch;
  }

  .section-wrap,
  .page-hero.slim > div,
  .detail-hero-inner,
  .detail-layout,
  .footer-inner,
  .footer-bottom {
    width: min(100% - 28px, 1280px);
  }

  .section-wrap {
    padding: 44px 0;
  }

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

  .catalog-grid,
  .movie-grid,
  .rank-grid,
  .search-result-grid,
  .compact-grid,
  .category-grid,
  .overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .filter-panel,
  .search-tools,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .detail-layout {
    padding-top: 32px;
  }

  .detail-article {
    padding: 20px;
  }

  .rank-card {
    flex-direction: column;
  }

  .rank-card .poster-wrap {
    width: 100%;
    min-width: 0;
    aspect-ratio: 3 / 4;
  }
}

@media (max-width: 460px) {
  .catalog-grid,
  .movie-grid,
  .rank-grid,
  .search-result-grid,
  .compact-grid,
  .category-grid,
  .overview-grid {
    grid-template-columns: 1fr;
  }

  .mobile-search {
    flex-direction: column;
    align-items: stretch;
  }
}
