* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: #0f172a;
  color: #f8fafc;
  font-family: Inter, 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;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(2, 6, 23, 0.84);
  color: #ffffff;
  border-bottom: 1px solid rgba(148, 163, 184, 0.16);
  backdrop-filter: blur(18px);
}

.header-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 74px;
  display: flex;
  align-items: center;
  gap: 22px;
}

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

.brand-mark {
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(6, 182, 212, 0.32);
}

.brand-copy {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-title {
  font-size: 22px;
  letter-spacing: 0.05em;
}

.brand-subtitle {
  margin-top: 4px;
  font-size: 12px;
  color: #22d3ee;
}

.desktop-nav {
  display: flex;
  gap: 24px;
  margin-left: auto;
  align-items: center;
}

.nav-link {
  color: #cbd5e1;
  font-weight: 600;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #22d3ee;
}

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

.search-form input,
.mobile-search-form input,
.search-panel input {
  width: 220px;
  border: 1px solid rgba(148, 163, 184, 0.22);
  border-radius: 999px;
  background: rgba(30, 41, 59, 0.9);
  color: #ffffff;
  padding: 10px 16px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.search-form input:focus,
.mobile-search-form input:focus,
.search-panel input:focus {
  border-color: #22d3ee;
  box-shadow: 0 0 0 3px rgba(34, 211, 238, 0.16);
}

.search-form button,
.mobile-search-form button,
.search-panel button {
  border: 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #ffffff;
  padding: 10px 16px;
  cursor: pointer;
  font-weight: 700;
}

.menu-button {
  display: none;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #ffffff;
  font-size: 28px;
  cursor: pointer;
}

.mobile-nav {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 18px;
  gap: 12px;
  flex-direction: column;
}

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

.hero {
  position: relative;
  min-height: 680px;
  overflow: hidden;
  background: #020617;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  background-size: cover;
  background-position: center;
  transition: opacity 0.7s ease, visibility 0.7s ease, transform 1.2s ease;
  transform: scale(1.03);
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.hero-overlay,
.detail-backdrop::after,
.category-hero::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.92), rgba(15, 23, 42, 0.74) 45%, rgba(15, 23, 42, 0.08));
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  min-height: 680px;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: 720px;
  padding-right: 20px;
}

.hero-kicker,
.page-hero span {
  display: inline-flex;
  align-items: center;
  width: max-content;
  border-radius: 999px;
  background: #06b6d4;
  color: #ffffff;
  padding: 6px 14px;
  font-size: 14px;
  font-weight: 700;
  letter-spacing: 0.03em;
}

.hero-content h1,
.page-hero h1,
.detail-info h1 {
  margin: 18px 0 16px;
  color: #ffffff;
  font-size: clamp(40px, 8vw, 74px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero-content p,
.page-hero p,
.detail-info p {
  margin: 0 0 24px;
  color: #e2e8f0;
  font-size: clamp(17px, 2.2vw, 22px);
  max-width: 760px;
}

.hero-tags,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 28px;
}

.hero-tags span,
.detail-tags span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #e0f2fe;
  padding: 5px 12px;
  font-size: 13px;
  backdrop-filter: blur(12px);
}

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

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

.primary-button {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #ffffff;
  box-shadow: 0 18px 40px rgba(59, 130, 246, 0.35);
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(15, 23, 42, 0.62);
  color: #ffffff;
  backdrop-filter: blur(14px);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-2px) scale(1.02);
  box-shadow: 0 20px 45px rgba(6, 182, 212, 0.26);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.86);
  color: #0f172a;
  font-size: 34px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.hero-arrow:hover {
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #ffffff;
  transform: translateY(-50%) scale(1.08);
}

.hero-prev {
  left: 24px;
}

.hero-next {
  right: 24px;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 4;
  display: flex;
  gap: 8px;
  transform: translateX(-50%);
}

.hero-dots button {
  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-dots button.active {
  width: 34px;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
}

.content-section {
  padding: 76px max(16px, calc((100% - 1180px) / 2));
}

.rounded-section {
  border-radius: 28px;
  margin: 24px auto;
  width: min(1180px, calc(100% - 32px));
  padding-left: 24px;
  padding-right: 24px;
}

.slate-900 {
  background: #0f172a;
}

.slate-800 {
  background: #1e293b;
}

.slate-700 {
  background: #334155;
}

.slate-gradient {
  background: linear-gradient(135deg, #1e293b, #0f172a);
}

.section-heading {
  text-align: center;
  margin-bottom: 42px;
}

.section-heading h2 {
  margin: 0 0 12px;
  color: #ffffff;
  font-size: clamp(30px, 4vw, 44px);
  line-height: 1.1;
}

.section-heading p {
  margin: 0 auto 16px;
  max-width: 680px;
  color: #cbd5e1;
}

.section-heading span {
  display: block;
  width: 88px;
  height: 4px;
  margin: 18px auto 0;
  border-radius: 999px;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
}

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

.featured-grid,
.library-grid,
.category-list,
.related-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

.movie-card,
.wide-card,
.rank-card,
.ranking-item {
  position: relative;
  display: flex;
  overflow: hidden;
  background: #334155;
  color: #ffffff;
  border-radius: 18px;
  box-shadow: 0 18px 45px rgba(2, 6, 23, 0.18);
  transition: transform 0.22s ease, box-shadow 0.22s ease, outline-color 0.22s ease;
}

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

.movie-card:hover,
.wide-card:hover,
.rank-card:hover,
.ranking-item:hover {
  transform: translateY(-7px);
  box-shadow: 0 24px 70px rgba(2, 6, 23, 0.36);
  outline: 2px solid rgba(34, 211, 238, 0.45);
}

.poster-wrap,
.rank-poster,
.ranking-poster {
  position: relative;
  display: block;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a, #1e293b);
}

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

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

.movie-card:hover img,
.wide-card:hover img,
.rank-card:hover img,
.ranking-item:hover img {
  transform: scale(1.08);
}

.poster-mask {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: rgba(0, 0, 0, 0.42);
  color: #22d3ee;
  font-size: 40px;
  opacity: 0;
  transition: opacity 0.22s ease;
}

.movie-card:hover .poster-mask {
  opacity: 1;
}

.year-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  border-radius: 999px;
  background: #06b6d4;
  color: #ffffff;
  padding: 3px 9px;
  font-size: 12px;
  font-weight: 800;
}

.movie-card-body {
  display: flex;
  flex-direction: column;
  gap: 5px;
  padding: 12px;
}

.movie-card-body strong,
.wide-content strong,
.rank-info strong,
.ranking-copy strong {
  color: #ffffff;
  font-size: 15px;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-card-body em,
.wide-content em,
.rank-info em,
.ranking-copy em {
  color: #94a3b8;
  font-size: 12px;
  font-style: normal;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.movie-card-body span,
.wide-content span,
.rank-info span,
.ranking-copy span {
  color: #cbd5e1;
  font-size: 13px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

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

.wide-card {
  min-height: 170px;
  background: #1e293b;
}

.wide-poster {
  flex: 0 0 280px;
  background: #0f172a;
}

.wide-content {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 10px;
  padding: 24px;
}

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

.rank-card {
  min-height: 250px;
  flex-direction: column;
  background: #334155;
}

.rank-poster {
  aspect-ratio: 16 / 10;
}

.rank-info {
  display: flex;
  flex-direction: column;
  gap: 6px;
  padding: 14px;
}

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

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

.category-card {
  position: relative;
  min-height: 330px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  overflow: hidden;
  border-radius: 24px;
  background-size: cover;
  background-position: center;
  padding: 26px;
  color: #ffffff;
  box-shadow: 0 24px 60px rgba(2, 6, 23, 0.32);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

.category-card.large {
  min-height: 300px;
}

.category-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 30px 80px rgba(2, 6, 23, 0.48);
}

.category-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.14), rgba(15, 23, 42, 0.92));
}

.category-card strong,
.category-card em,
.category-card b {
  position: relative;
  z-index: 2;
}

.category-card strong {
  font-size: 26px;
  line-height: 1.1;
}

.category-card em {
  margin: 10px 0 18px;
  color: #e2e8f0;
  font-style: normal;
}

.category-card b {
  width: max-content;
  border-radius: 12px;
  background: #ffffff;
  color: #0f172a;
  padding: 9px 15px;
}

.masonry-grid {
  columns: 4 220px;
  column-gap: 18px;
}

.masonry-grid .movie-card {
  break-inside: avoid;
  margin-bottom: 18px;
}

.center-actions {
  justify-content: center;
  margin-top: 34px;
}

.page-shell,
.detail-shell {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 30px 0 80px;
}

.page-hero {
  position: relative;
  overflow: hidden;
  min-height: 340px;
  border-radius: 28px;
  background: linear-gradient(135deg, #0f172a, #1e3a8a 55%, #0891b2);
  background-size: cover;
  background-position: center;
  margin: 24px 0;
  padding: 54px;
  display: flex;
  flex-direction: column;
  justify-content: center;
}

.page-hero.compact {
  min-height: 280px;
}

.page-hero > * {
  position: relative;
  z-index: 2;
}

.category-hero::after {
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(15, 23, 42, 0.62), rgba(15, 23, 42, 0.18));
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: #94a3b8;
  margin: 8px 0 22px;
  font-size: 14px;
}

.breadcrumb a:hover {
  color: #22d3ee;
}

.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 44px;
}

.pagination a,
.pagination span {
  min-width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.75);
  color: #cbd5e1;
}

.pagination a.active,
.pagination a:hover {
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: #ffffff;
}

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

.ranking-item {
  display: grid;
  grid-template-columns: 70px 105px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 12px;
  background: rgba(15, 23, 42, 0.64);
}

.ranking-number {
  display: grid;
  place-items: center;
  width: 54px;
  height: 54px;
  border-radius: 18px;
  background: linear-gradient(135deg, #f97316, #ef4444);
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
}

.ranking-poster {
  aspect-ratio: 2 / 3;
  border-radius: 14px;
}

.ranking-copy {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.search-panel {
  width: min(680px, 100%);
}

.search-panel input {
  width: 100%;
  min-height: 52px;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  display: grid;
  grid-template-columns: 320px minmax(0, 1fr);
  gap: 34px;
  align-items: center;
  min-height: 520px;
  padding: 40px;
  border-radius: 30px;
  background: #111827;
  box-shadow: 0 28px 90px rgba(0, 0, 0, 0.35);
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(3px) saturate(0.95);
  transform: scale(1.04);
}

.detail-poster,
.detail-info {
  position: relative;
  z-index: 2;
}

.detail-poster {
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border-radius: 24px;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.46);
  background: #0f172a;
}

.detail-info h1 {
  font-size: clamp(36px, 5vw, 68px);
}

.player-section,
.detail-content,
.related-section {
  margin-top: 32px;
}

.player-section {
  border-radius: 28px;
  background: #020617;
  padding: 28px;
  box-shadow: 0 26px 80px rgba(0, 0, 0, 0.3);
}

.player-section h2,
.detail-content h2 {
  margin: 0 0 18px;
  color: #ffffff;
  font-size: 28px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 22px;
  background: #000000;
}

.player-shell video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000000;
  object-fit: contain;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: radial-gradient(circle, rgba(15, 23, 42, 0.1), rgba(0, 0, 0, 0.46));
  cursor: pointer;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-overlay span {
  width: 104px;
  height: 104px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  color: #ffffff;
  font-size: 46px;
  padding-left: 8px;
  backdrop-filter: blur(18px);
  box-shadow: 0 18px 55px rgba(0, 0, 0, 0.36);
}

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

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

.detail-content article {
  border-radius: 24px;
  background: #1e293b;
  padding: 28px;
}

.detail-content p {
  margin: 0;
  color: #dbeafe;
  font-size: 17px;
}

.site-footer {
  background: linear-gradient(180deg, #0f172a, #020617);
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  color: #cbd5e1;
  padding: 56px max(16px, calc((100% - 1180px) / 2)) 26px;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 34px;
}

.footer-brand {
  color: #ffffff;
  font-size: 24px;
  margin-bottom: 12px;
}

.site-footer h2 {
  margin: 0 0 14px;
  font-size: 18px;
  color: #ffffff;
}

.site-footer p {
  margin: 0;
  max-width: 420px;
  color: #94a3b8;
}

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

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

.footer-bottom {
  margin-top: 34px;
  padding-top: 20px;
  border-top: 1px solid rgba(148, 163, 184, 0.14);
  color: #94a3b8;
  font-size: 14px;
  text-align: center;
}

@media (max-width: 1100px) {
  .search-form {
    display: none;
  }

  .movie-grid,
  .featured-grid,
  .library-grid,
  .category-list,
  .related-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

  .menu-button {
    display: block;
  }

  .mobile-search-form input {
    width: 100%;
  }

  .hero,
  .hero-content {
    min-height: 590px;
  }

  .hero-arrow {
    display: none;
  }

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

  .wide-poster {
    flex: 0 0 auto;
    aspect-ratio: 16 / 9;
  }

  .detail-hero {
    grid-template-columns: 1fr;
    padding: 24px;
  }

  .detail-poster {
    max-width: 280px;
  }

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

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

@media (max-width: 620px) {
  .header-inner {
    min-height: 66px;
  }

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

  .content-section {
    padding-top: 54px;
    padding-bottom: 54px;
  }

  .movie-grid,
  .featured-grid,
  .library-grid,
  .category-list,
  .related-grid,
  .rank-strip,
  .category-grid,
  .category-grid.overview {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .ranking-item {
    grid-template-columns: 52px 80px minmax(0, 1fr);
    gap: 10px;
  }

  .ranking-number {
    width: 42px;
    height: 42px;
    border-radius: 14px;
    font-size: 18px;
  }

  .category-card {
    min-height: 250px;
    padding: 20px;
  }

  .category-card strong {
    font-size: 22px;
  }

  .hero-content h1,
  .page-hero h1,
  .detail-info h1 {
    font-size: 36px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }
}
