* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: #111827;
  background: linear-gradient(180deg, #f8fbff 0%, #eef5ff 42%, #f8fafc 100%);
  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 {
  display: block;
  max-width: 100%;
}

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: #ffffff;
  background: linear-gradient(90deg, rgba(29, 78, 216, .98), rgba(37, 99, 235, .98), rgba(30, 64, 175, .98));
  box-shadow: 0 14px 36px rgba(30, 64, 175, .28);
}

.nav-inner {
  width: min(1280px, calc(100% - 32px));
  height: 72px;
  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: -.02em;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  color: #1d4ed8;
  background: #ffffff;
  box-shadow: 0 12px 24px rgba(15, 23, 42, .18);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 18px;
  margin-left: auto;
  font-weight: 600;
  white-space: nowrap;
}

.desktop-nav a,
.mobile-nav a,
.footer-links a {
  transition: color .2s ease, background .2s ease, transform .2s ease;
}

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

.header-search {
  width: 290px;
  display: flex;
  overflow: hidden;
  border-radius: 999px;
  background: rgba(255, 255, 255, .14);
  border: 1px solid rgba(255, 255, 255, .25);
}

.header-search input {
  width: 100%;
  min-width: 0;
  color: #ffffff;
  background: transparent;
  border: 0;
  outline: 0;
  padding: 10px 14px;
}

.header-search input::placeholder {
  color: rgba(255, 255, 255, .78);
}

.header-search button {
  color: #1d4ed8;
  background: #ffffff;
  border: 0;
  padding: 0 16px;
  font-weight: 700;
}

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, .14);
}

.nav-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  border-radius: 999px;
  background: #ffffff;
}

.mobile-nav {
  display: none;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 18px;
  gap: 8px;
  flex-wrap: wrap;
}

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

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

.hero-carousel {
  position: relative;
  min-height: 640px;
  overflow: hidden;
  color: #ffffff;
  background: #0f172a;
}

.hero-slide {
  position: absolute;
  inset: 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(260px, 380px);
  align-items: center;
  gap: 56px;
  opacity: 0;
  pointer-events: none;
  padding: 92px max(32px, calc((100vw - 1280px) / 2)) 110px;
  background-size: cover;
  background-position: center;
  transition: opacity .65s ease, transform .65s ease;
  transform: scale(1.02);
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
  transform: scale(1);
}

.hero-content {
  max-width: 760px;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px 12px;
  border-radius: 999px;
  color: #bfdbfe;
  background: rgba(37, 99, 235, .28);
  border: 1px solid rgba(191, 219, 254, .34);
  font-size: 14px;
  font-weight: 700;
}

.hero-content h1,
.hero-content h2 {
  margin: 0;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -.06em;
  text-shadow: 0 24px 48px rgba(0, 0, 0, .38);
}

.hero-content h3 {
  margin: 18px 0 12px;
  color: #eff6ff;
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.2;
}

.hero-content p {
  max-width: 690px;
  margin: 0;
  color: #dbeafe;
  font-size: 18px;
}

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

.hero-tags {
  margin-top: 22px;
}

.hero-tags span,
.tag-row span,
.detail-tags span {
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.hero-tags span {
  padding: 7px 12px;
  color: #ffffff;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .24);
}

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

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

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

.btn-primary {
  color: #1d4ed8;
  background: #ffffff;
  box-shadow: 0 20px 40px rgba(255, 255, 255, .2);
}

.btn-ghost {
  color: #ffffff;
  background: rgba(255, 255, 255, .16);
  border: 1px solid rgba(255, 255, 255, .28);
}

.btn-soft {
  color: #dbeafe;
  background: rgba(37, 99, 235, .32);
  border: 1px solid rgba(147, 197, 253, .32);
}

.hero-poster {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  aspect-ratio: 2 / 3;
  background: rgba(255, 255, 255, .08);
  box-shadow: 0 30px 80px rgba(0, 0, 0, .42);
}

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

.hero-poster:hover img {
  transform: scale(1.06);
}

.hero-controls {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 8px;
  border-radius: 999px;
  background: rgba(15, 23, 42, .58);
  backdrop-filter: blur(16px);
}

.hero-controls button {
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(255, 255, 255, .15);
  font-size: 24px;
  line-height: 1;
}

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

.hero-dots button {
  width: 10px;
  height: 10px;
  padding: 0;
  background: rgba(255, 255, 255, .35);
}

.hero-dots button.is-active {
  width: 28px;
  background: #ffffff;
}

.search-panel,
.page-wrap,
.content-section,
.detail-wrap {
  width: min(1280px, calc(100% - 32px));
  margin-left: auto;
  margin-right: auto;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(280px, 1.05fr);
  gap: 24px;
  align-items: center;
  margin-top: -56px;
  position: relative;
  z-index: 4;
  padding: 28px;
  border-radius: 26px;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #0f766e);
  box-shadow: 0 24px 60px rgba(37, 99, 235, .28);
}

.search-panel h2,
.section-head h2,
.page-hero h1,
.movie-info-panel h1,
.related-sidebar h2 {
  margin: 0;
  letter-spacing: -.04em;
}

.search-panel h2 {
  font-size: clamp(24px, 3vw, 34px);
}

.search-panel p {
  margin: 8px 0 0;
  color: #dbeafe;
}

.big-search,
.inline-search {
  display: flex;
  overflow: hidden;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 20px 40px rgba(15, 23, 42, .12);
}

.big-search input,
.inline-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 16px 18px;
  color: #111827;
}

.big-search button,
.inline-search button {
  border: 0;
  color: #ffffff;
  background: #2563eb;
  padding: 0 24px;
  font-weight: 800;
}

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

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

.section-head h2 {
  font-size: clamp(26px, 3.6vw, 42px);
  color: #0f172a;
}

.section-head p {
  margin: 8px 0 0;
  color: #64748b;
}

.section-more {
  flex: none;
  color: #2563eb;
  font-weight: 800;
}

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

.category-tile,
.category-card a {
  display: flex;
  flex-direction: column;
  height: 100%;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(30, 64, 175, .10);
  border: 1px solid rgba(148, 163, 184, .18);
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.category-tile {
  min-height: 178px;
  padding: 20px;
}

.category-tile:hover,
.category-card a:hover,
.movie-card:hover,
.compact-card:hover,
.rank-row a:hover {
  transform: translateY(-5px);
  box-shadow: 0 24px 58px rgba(30, 64, 175, .18);
  border-color: rgba(37, 99, 235, .32);
}

.category-tile span {
  color: #2563eb;
  font-size: 20px;
  font-weight: 900;
}

.category-tile strong {
  margin-top: 12px;
  color: #334155;
  font-size: 14px;
}

.category-tile em {
  margin-top: auto;
  color: #94a3b8;
  font-style: normal;
  font-size: 12px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

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

.category-movie-grid {
  padding-bottom: 72px;
}

.movie-card {
  border-radius: 22px;
  background: #ffffff;
  box-shadow: 0 18px 40px rgba(30, 64, 175, .10);
  border: 1px solid rgba(148, 163, 184, .18);
  overflow: hidden;
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.movie-card-link {
  display: flex;
  flex-direction: column;
  height: 100%;
}

.poster-frame {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: #dbeafe;
}

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

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

.score-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  min-width: 46px;
  padding: 5px 9px;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(37, 99, 235, .92);
  text-align: center;
  font-size: 13px;
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(29, 78, 216, .32);
}

.movie-card-body {
  padding: 16px;
  display: flex;
  flex-direction: column;
  flex: 1;
}

.movie-card-body h3 {
  margin: 0;
  color: #0f172a;
  font-size: 17px;
  line-height: 1.32;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.movie-meta-line {
  margin: 8px 0;
  color: #64748b;
  font-size: 13px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-one-line {
  margin: 0 0 12px;
  color: #475569;
  font-size: 14px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
}

.tag-row {
  margin-top: auto;
}

.tag-row span {
  padding: 4px 8px;
  color: #1d4ed8;
  background: #dbeafe;
}

.ranking-strip {
  padding-bottom: 0;
}

.rank-strip-grid,
.related-list {
  display: grid;
  gap: 14px;
}

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

.compact-card {
  display: grid;
  grid-template-columns: 84px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, .18);
  box-shadow: 0 14px 32px rgba(30, 64, 175, .08);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.compact-card img {
  width: 84px;
  height: 58px;
  object-fit: cover;
  border-radius: 12px;
}

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

.compact-card strong {
  color: #0f172a;
  font-size: 15px;
}

.compact-card em {
  color: #64748b;
  font-size: 12px;
  font-style: normal;
}

.page-wrap,
.detail-wrap {
  padding: 34px 0 74px;
}

.page-hero {
  margin-bottom: 28px;
  padding: 42px;
  border-radius: 28px;
  color: #ffffff;
  background: linear-gradient(135deg, #1e3a8a 0%, #2563eb 52%, #0f766e 100%);
  box-shadow: 0 24px 60px rgba(37, 99, 235, .24);
}

.page-hero.compact {
  padding: 36px;
}

.page-hero h1 {
  font-size: clamp(32px, 4vw, 52px);
  line-height: 1.08;
}

.page-hero p {
  max-width: 780px;
  margin: 12px 0 0;
  color: #dbeafe;
  font-size: 17px;
}

.inline-search {
  max-width: 640px;
  margin-top: 22px;
}

.category-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  padding-bottom: 60px;
}

.category-card {
  min-height: 100%;
}

.category-posters {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 6px;
  padding: 10px;
  background: #eff6ff;
}

.category-posters img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 12px;
}

.category-card-body {
  padding: 22px;
}

.category-card-body h2 {
  margin: 0;
  color: #0f172a;
  font-size: 24px;
}

.category-card-body p {
  margin: 10px 0 18px;
  color: #475569;
}

.category-card-body span {
  color: #2563eb;
  font-weight: 900;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: #64748b;
  font-size: 14px;
}

.breadcrumb a {
  color: #2563eb;
  font-weight: 700;
}

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

.detail-main,
.related-sidebar,
.movie-info-panel {
  min-width: 0;
}

.player-section,
.movie-info-panel,
.related-sidebar {
  border-radius: 24px;
  background: #ffffff;
  box-shadow: 0 18px 42px rgba(30, 64, 175, .10);
  border: 1px solid rgba(148, 163, 184, .18);
}

.player-section {
  overflow: hidden;
  background: #020617;
}

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

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 0;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(2, 6, 23, .16), rgba(2, 6, 23, .72));
  transition: opacity .2s ease, visibility .2s ease;
}

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

.play-ring {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #1d4ed8;
  background: #ffffff;
  font-size: 30px;
  box-shadow: 0 20px 50px rgba(0, 0, 0, .34);
}

.player-overlay strong {
  width: min(88%, 680px);
  font-size: clamp(22px, 3vw, 34px);
  line-height: 1.2;
  text-shadow: 0 16px 30px rgba(0, 0, 0, .48);
}

.movie-info-panel {
  margin-top: 22px;
  padding: 30px;
}

.movie-info-panel h1 {
  color: #0f172a;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.1;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 18px 0 28px;
}

.detail-meta span,
.detail-meta b {
  padding: 8px 12px;
  border-radius: 999px;
  color: #1d4ed8;
  background: #dbeafe;
  font-size: 14px;
}

.detail-meta b {
  color: #ffffff;
  background: #2563eb;
}

.movie-info-panel h2 {
  margin: 28px 0 10px;
  color: #0f172a;
  font-size: 22px;
}

.movie-info-panel p {
  margin: 0;
  color: #475569;
  font-size: 16px;
}

.lead-text {
  color: #1e293b !important;
  font-size: 18px !important;
  font-weight: 700;
  margin-bottom: 10px !important;
}

.detail-tags span {
  padding: 8px 12px;
  color: #1d4ed8;
  background: #dbeafe;
}

.related-sidebar {
  position: sticky;
  top: 96px;
  align-self: start;
  padding: 22px;
}

.related-sidebar h2 {
  margin-bottom: 16px;
  color: #0f172a;
  font-size: 22px;
}

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

.rank-row a {
  display: grid;
  grid-template-columns: 72px 92px minmax(0, 1fr) 68px;
  gap: 18px;
  align-items: center;
  padding: 14px 18px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(148, 163, 184, .18);
  box-shadow: 0 12px 28px rgba(30, 64, 175, .08);
  transition: transform .22s ease, box-shadow .22s ease, border-color .22s ease;
}

.rank-number {
  color: #2563eb;
  font-size: 22px;
  font-weight: 900;
}

.rank-row img {
  width: 92px;
  height: 64px;
  object-fit: cover;
  border-radius: 14px;
}

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

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

.rank-info strong {
  color: #0f172a;
  font-size: 18px;
}

.rank-info em {
  color: #64748b;
  font-style: normal;
  font-size: 13px;
}

.rank-info small {
  color: #475569;
  font-size: 13px;
}

.rank-row b {
  color: #ffffff;
  background: #2563eb;
  border-radius: 999px;
  padding: 8px 12px;
  text-align: center;
}

.empty-result {
  display: none;
  margin: 20px 0 60px;
  padding: 20px;
  border-radius: 18px;
  color: #1d4ed8;
  background: #dbeafe;
  font-weight: 800;
  text-align: center;
}

.empty-result.is-visible {
  display: block;
}

.site-footer {
  color: #cbd5e1;
  background: #0f172a;
}

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

.footer-brand {
  color: #ffffff;
}

.site-footer p {
  margin: 12px 0 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  justify-content: flex-end;
}

.footer-links a:hover {
  color: #ffffff;
}

.is-filtered-out {
  display: none !important;
}

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

  .nav-toggle {
    display: block;
  }

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

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

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

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

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

  .related-sidebar {
    position: static;
  }
}

@media (max-width: 860px) {
  .nav-inner {
    gap: 12px;
  }

  .header-search {
    display: none;
  }

  .hero-carousel {
    min-height: 720px;
  }

  .hero-slide {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 72px 22px 118px;
  }

  .hero-poster {
    width: min(58vw, 260px);
    justify-self: center;
  }

  .search-panel {
    grid-template-columns: 1fr;
    margin-top: -34px;
    padding: 22px;
  }

  .section-head {
    display: block;
  }

  .section-more {
    display: inline-flex;
    margin-top: 12px;
  }

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

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

  .rank-strip-grid {
    grid-template-columns: 1fr;
  }

  .rank-row a {
    grid-template-columns: 44px 78px minmax(0, 1fr);
  }

  .rank-row b {
    grid-column: 3;
    justify-self: start;
    margin-top: 4px;
  }

  .page-hero,
  .page-hero.compact,
  .movie-info-panel {
    padding: 24px;
  }

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

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 520px) {
  .nav-inner {
    width: min(100% - 20px, 1280px);
  }

  .brand {
    font-size: 18px;
  }

  .brand-mark {
    width: 36px;
    height: 36px;
  }

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

  .hero-actions,
  .big-search,
  .inline-search {
    flex-direction: column;
  }

  .big-search button,
  .inline-search button {
    min-height: 46px;
  }

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

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

  .movie-card-body h3 {
    font-size: 15px;
  }

  .compact-card {
    grid-template-columns: 70px minmax(0, 1fr);
  }

  .compact-card img {
    width: 70px;
    height: 52px;
  }
}
