:root {
  --page-bg: #f9fafb;
  --panel: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --soft: #e5e7eb;
  --line: #e5e7eb;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --orange: #ea580c;
  --green: #16a34a;
  --footer: #111827;
  --shadow: 0 10px 25px rgba(15, 23, 42, 0.08);
  --shadow-strong: 0 24px 50px rgba(15, 23, 42, 0.18);
  --radius: 16px;
}

body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(180deg, #f9fafb 0%, #ffffff 52%, #f9fafb 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

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

.container {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
  box-shadow: 0 1px 8px rgba(15, 23, 42, 0.05);
  backdrop-filter: blur(10px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 64px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
}

.brand-icon,
.footer-brand span {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 34px;
  height: 34px;
  color: #ffffff;
  background: var(--blue);
  border-radius: 999px;
  font-size: 14px;
}

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

.nav-link,
.mobile-link {
  color: #374151;
  font-weight: 650;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
  color: var(--blue);
}

.menu-button {
  display: none;
  border: 0;
  background: transparent;
  color: #374151;
  font-size: 26px;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 14px;
  padding: 16px 24px 22px;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

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

.hero {
  position: relative;
  height: 70vh;
  min-height: 560px;
  overflow: hidden;
  background: #111827;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

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

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

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.55) 48%, rgba(0, 0, 0, 0.08) 100%);
}

.hero-content {
  position: absolute;
  left: 50%;
  bottom: 72px;
  transform: translateX(-50%);
  color: #ffffff;
}

.hero-tags,
.tag-line,
.detail-meta,
.hero-meta,
.card-meta,
.meta-line {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags span,
.tag-line span {
  display: inline-flex;
  align-items: center;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: 13px;
  line-height: 1;
}

.hero-tags span {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(6px);
}

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

.hero-content p {
  max-width: 720px;
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(17px, 2.2vw, 22px);
  line-height: 1.75;
}

.hero-meta span {
  padding: 6px 12px;
  border-radius: 8px;
  background: rgba(37, 99, 235, 0.76);
  color: #ffffff;
  font-size: 14px;
}

.hero-actions,
.inline-actions {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 26px;
}

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

.primary-button {
  color: #ffffff;
  background: var(--blue);
  box-shadow: 0 12px 24px rgba(37, 99, 235, 0.28);
}

.primary-button:hover,
.filter-form button:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
}

.primary-button.small,
.ghost-button.small {
  min-height: 38px;
  padding: 0 16px;
  font-size: 14px;
}

.ghost-button {
  color: #ffffff;
  background: rgba(0, 0, 0, 0.46);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(8px);
}

.ghost-button:hover {
  background: rgba(0, 0, 0, 0.68);
  transform: translateY(-1px);
}

.ghost-button.dark {
  color: #374151;
  background: #ffffff;
  border: 1px solid var(--line);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 2;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.52);
  font-size: 40px;
  line-height: 1;
  transform: translateY(-50%);
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.72);
  transform: translateY(-50%) scale(1.04);
}

.hero-prev {
  left: 22px;
}

.hero-next {
  right: 22px;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 32px;
  display: flex;
  gap: 9px;
  transform: translateX(-50%);
}

.hero-dot {
  width: 9px;
  height: 9px;
  padding: 0;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dot.active {
  width: 34px;
  background: #ffffff;
}

.page-main {
  padding: 64px 0 80px;
}

.inner-page {
  padding-top: 34px;
}

.search-strip,
.page-hero,
.section-block {
  background: var(--panel);
  border: 1px solid rgba(229, 231, 235, 0.82);
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.search-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  padding: 26px 30px;
  margin-bottom: 66px;
}

.search-strip h2,
.section-title h2,
.page-hero h1,
.detail-content h1 {
  margin: 0;
  color: var(--text);
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  color: var(--blue);
  font-size: 13px;
  font-weight: 850;
  letter-spacing: 0.1em;
}

.section-block {
  padding: 30px;
  margin-bottom: 64px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 28px;
}

.section-title h2 {
  font-size: 30px;
  font-weight: 850;
}

.section-title p,
.page-hero p,
.search-strip p {
  margin: 6px 0 0;
  color: var(--muted);
}

.section-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  color: #ffffff;
  background: var(--blue);
  border-radius: 999px;
  font-size: 18px;
  font-weight: 900;
}

.section-icon.orange {
  background: var(--orange);
}

.section-icon.green {
  background: var(--green);
}

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

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

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

.movie-card {
  overflow: hidden;
  background: #ffffff;
  border: 1px solid rgba(229, 231, 235, 0.78);
  border-radius: 14px;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.05);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.movie-card:hover {
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: var(--shadow-strong);
  transform: translateY(-3px);
}

.poster-link,
.rank-poster {
  position: relative;
  display: block;
  height: 250px;
  overflow: hidden;
  background: #111827;
}

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

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

.type-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 9px;
  border-radius: 7px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.7);
  font-size: 12px;
}

.play-mark {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: rgba(0, 0, 0, 0);
  font-size: 42px;
  opacity: 0;
  transition: opacity 0.22s ease, background 0.22s ease, transform 0.22s ease;
}

.movie-card:hover .play-mark {
  opacity: 1;
  background: rgba(0, 0, 0, 0.28);
  transform: scale(1.08);
}

.card-body {
  padding: 15px;
}

.card-body h3 {
  margin: 0 0 9px;
  overflow: hidden;
  color: #1f2937;
  font-size: 17px;
  font-weight: 800;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.card-body p {
  display: -webkit-box;
  min-height: 44px;
  margin: 0 0 12px;
  overflow: hidden;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.tag-line span {
  color: var(--blue);
  background: #eff6ff;
}

.card-meta,
.meta-line {
  justify-content: space-between;
  margin-top: 12px;
  color: #6b7280;
  font-size: 13px;
}

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

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

.category-card {
  display: flex;
  min-height: 132px;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border: 1px solid rgba(191, 219, 254, 0.7);
  border-radius: 16px;
  background: linear-gradient(135deg, #eff6ff 0%, #ffffff 65%);
  transition: transform 0.22s ease, box-shadow 0.22s ease, border-color 0.22s ease;
}

.category-card:hover {
  border-color: rgba(37, 99, 235, 0.45);
  box-shadow: var(--shadow);
  transform: translateY(-2px);
}

.category-card strong {
  color: #1f2937;
  font-size: 21px;
}

.category-card span {
  margin-top: 14px;
  color: #4b5563;
  line-height: 1.7;
}

.page-hero {
  padding: 38px 42px;
  margin-bottom: 34px;
}

.compact-hero {
  background: linear-gradient(135deg, #ffffff 0%, #eff6ff 100%);
}

.page-hero h1 {
  margin-top: 10px;
  font-size: clamp(34px, 5vw, 54px);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.page-hero p {
  max-width: 820px;
  font-size: 17px;
  line-height: 1.75;
}

.filter-form {
  display: grid;
  grid-template-columns: minmax(260px, 1.4fr) minmax(130px, 0.7fr) minmax(150px, 0.8fr) auto;
  gap: 14px;
  align-items: end;
  margin-bottom: 28px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 14px;
  background: #f9fafb;
}

.filter-form label {
  display: flex;
  flex-direction: column;
  gap: 7px;
  color: #374151;
  font-size: 14px;
  font-weight: 750;
}

.filter-form input,
.filter-form select {
  width: 100%;
  height: 44px;
  padding: 0 14px;
  border: 1px solid #d1d5db;
  border-radius: 10px;
  color: #111827;
  background: #ffffff;
  outline: none;
}

.filter-form input:focus,
.filter-form select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.14);
}

.filter-form button {
  height: 44px;
  color: #ffffff;
  background: var(--blue);
}

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

.rank-row {
  display: grid;
  grid-template-columns: 132px minmax(0, 1fr) 96px;
  gap: 18px;
  align-items: center;
  padding: 12px;
}

.rank-poster {
  height: 88px;
  border-radius: 12px;
}

.rank-info h2 {
  margin: 0 0 8px;
  overflow: hidden;
  font-size: 20px;
  font-weight: 850;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-info p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #4b5563;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.rank-score {
  display: flex;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  min-height: 76px;
  border-radius: 12px;
  color: var(--orange);
  background: #fff7ed;
}

.rank-score strong {
  font-size: 26px;
  line-height: 1;
}

.rank-score span {
  margin-top: 4px;
  color: #9a3412;
  font-size: 12px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 20px;
  color: #6b7280;
  font-size: 14px;
}

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

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

.detail-main,
.detail-aside,
.detail-content,
.aside-card {
  min-width: 0;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: #000000;
  box-shadow: var(--shadow-strong);
}

.player-shell video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #ffffff;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.42), rgba(0, 0, 0, 0.16));
  cursor: pointer;
  transition: opacity 0.22s ease, visibility 0.22s ease;
}

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

.player-start {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 82px;
  height: 82px;
  padding-left: 5px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(37, 99, 235, 0.9);
  box-shadow: 0 12px 35px rgba(37, 99, 235, 0.4);
  font-size: 35px;
}

.detail-content {
  margin-top: 24px;
  padding: 30px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.detail-content h1 {
  font-size: clamp(32px, 4vw, 46px);
  font-weight: 900;
  letter-spacing: -0.04em;
}

.detail-meta {
  margin-top: 15px;
}

.detail-meta span {
  padding: 6px 12px;
  border-radius: 8px;
  color: #1d4ed8;
  background: #eff6ff;
  font-size: 14px;
}

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

.lead-text {
  margin-top: 22px;
  color: #1f2937;
  font-size: 18px;
  line-height: 1.85;
}

.detail-content h2 {
  margin: 30px 0 10px;
  font-size: 24px;
  font-weight: 850;
}

.detail-content p {
  color: #374151;
  font-size: 16px;
  line-height: 1.95;
}

.detail-aside {
  position: sticky;
  top: 88px;
}

.detail-cover,
.aside-card {
  overflow: hidden;
  width: 100%;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: var(--shadow);
}

.detail-cover {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.aside-card {
  margin-top: 18px;
  padding: 22px;
  border: 1px solid var(--line);
}

.aside-card h2 {
  margin: 0 0 16px;
  font-size: 22px;
}

.aside-card dl {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
}

.aside-card dt {
  color: #6b7280;
}

.aside-card dd {
  margin: 0;
  color: #1f2937;
  font-weight: 700;
}

.site-footer {
  color: #d1d5db;
  background: var(--footer);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1.2fr;
  gap: 32px;
  padding: 46px 0;
}

.site-footer h3 {
  margin: 0 0 16px;
  color: #ffffff;
  font-size: 17px;
}

.site-footer p,
.site-footer li {
  color: #9ca3af;
  font-size: 14px;
  line-height: 1.8;
}

.site-footer ul {
  display: grid;
  gap: 8px;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

.footer-brand {
  margin-bottom: 16px;
  color: #ffffff;
}

.back-top {
  min-height: 36px;
  margin-top: 12px;
  color: #d1d5db;
  background: rgba(255, 255, 255, 0.08);
  border: 1px solid rgba(255, 255, 255, 0.12);
}

.back-top:hover {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

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

@media (max-width: 1180px) {
  .movie-grid,
  .category-movie-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

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

  .menu-button {
    display: inline-flex;
  }

  .hero {
    min-height: 620px;
  }

  .hero-content {
    bottom: 74px;
  }

  .hero-arrow {
    width: 42px;
    height: 42px;
    font-size: 34px;
  }

  .movie-grid,
  .featured-grid,
  .category-movie-grid,
  .category-grid,
  .category-grid.large {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

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

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

  .detail-aside {
    position: static;
  }
}

@media (max-width: 640px) {
  .container {
    width: min(100% - 24px, 1280px);
  }

  .hero {
    height: 76vh;
    min-height: 620px;
  }

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

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

  .hero-prev {
    left: 10px;
  }

  .hero-next {
    right: 10px;
  }

  .page-main {
    padding: 36px 0 58px;
  }

  .search-strip,
  .section-block,
  .page-hero,
  .detail-content {
    padding: 22px;
  }

  .search-strip {
    align-items: flex-start;
    flex-direction: column;
  }

  .movie-grid,
  .featured-grid,
  .category-movie-grid,
  .category-grid,
  .category-grid.large {
    grid-template-columns: 1fr;
  }

  .poster-link {
    height: 290px;
  }

  .filter-form,
  .rank-row {
    grid-template-columns: 1fr;
  }

  .rank-poster {
    height: 180px;
  }

  .rank-score {
    align-items: flex-start;
    padding: 12px 14px;
  }
}
