* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --slate-950: #020617;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-300: #cbd5e1;
  --slate-200: #e2e8f0;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --teal-700: #0f766e;
  --teal-600: #0d9488;
  --teal-500: #14b8a6;
  --teal-400: #2dd4bf;
  --white: #ffffff;
  --shadow-soft: 0 18px 45px rgba(15, 23, 42, 0.12);
  --shadow-card: 0 12px 28px rgba(15, 23, 42, 0.1);
  --radius-lg: 24px;
  --radius-md: 18px;
  --radius-sm: 12px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  color: var(--slate-900);
  background: linear-gradient(180deg, var(--slate-50), #ffffff 42%, var(--slate-100));
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.65;
}

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

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

button,
input,
select {
  font: inherit;
}

.sr-only {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  color: var(--white);
  background: linear-gradient(90deg, var(--slate-900), var(--slate-800), var(--slate-900));
  box-shadow: 0 10px 30px rgba(2, 6, 23, 0.22);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  max-width: 1280px;
  height: 72px;
  padding: 0 24px;
  margin: 0 auto;
}

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

.brand-mark {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  color: var(--slate-900);
  background: linear-gradient(135deg, var(--teal-400), var(--teal-600));
  border-radius: 14px;
  box-shadow: 0 12px 24px rgba(20, 184, 166, 0.32);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

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

.brand-text small {
  color: var(--slate-300);
  font-size: 12px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
}

.desktop-nav a {
  color: rgba(255, 255, 255, 0.82);
  transition: color 0.2s ease;
}

.desktop-nav a:hover,
.desktop-nav a.active {
  color: var(--teal-400);
}

.mobile-menu-button {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  color: var(--white);
  background: rgba(255, 255, 255, 0.08);
  border: 0;
  border-radius: 12px;
}

.mobile-menu-button span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: currentColor;
  border-radius: 999px;
}

.mobile-nav {
  display: none;
  flex-direction: column;
  gap: 2px;
  padding: 12px 24px 18px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
}

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

.mobile-nav a {
  padding: 9px 0;
  color: rgba(255, 255, 255, 0.86);
}

.hero {
  position: relative;
  height: 70vh;
  min-height: 560px;
  overflow: hidden;
  background: var(--slate-900);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
  transition: opacity 0.65s ease, transform 0.65s ease;
}

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

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

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.95), rgba(15, 23, 42, 0.76) 45%, rgba(15, 23, 42, 0.14));
}

.hero-content {
  position: absolute;
  top: 50%;
  left: max(24px, calc((100vw - 1280px) / 2 + 24px));
  width: min(660px, calc(100vw - 48px));
  color: var(--white);
  transform: translateY(-50%);
}

.hero-kicker,
.eyebrow {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  padding: 6px 14px;
  color: var(--teal-500);
  background: rgba(20, 184, 166, 0.12);
  border: 1px solid rgba(20, 184, 166, 0.24);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.hero h1 {
  margin: 18px 0 16px;
  font-size: clamp(42px, 7vw, 72px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.hero p {
  max-width: 620px;
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 32px;
}

.hero-meta span {
  padding: 7px 12px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 999px;
  backdrop-filter: blur(10px);
}

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

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

.primary-button {
  color: var(--white);
  background: linear-gradient(135deg, var(--teal-500), var(--teal-700));
  box-shadow: 0 14px 26px rgba(20, 184, 166, 0.28);
}

.primary-button:hover,
.ghost-button:hover {
  transform: translateY(-2px);
}

.ghost-button {
  color: var(--white);
  background: rgba(255, 255, 255, 0.12);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(8px);
}

.block {
  display: flex;
  width: 100%;
  margin-top: 14px;
}

.hero-controls {
  position: absolute;
  right: max(24px, calc((100vw - 1280px) / 2 + 24px));
  bottom: 34px;
  display: flex;
  align-items: center;
  gap: 16px;
  z-index: 3;
}

.hero-arrow,
.hero-dot {
  border: 0;
  cursor: pointer;
}

.hero-arrow {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  color: var(--white);
  background: rgba(255, 255, 255, 0.14);
  border-radius: 999px;
  font-size: 32px;
  line-height: 1;
  backdrop-filter: blur(8px);
}

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

.hero-dot {
  width: 10px;
  height: 10px;
  padding: 0;
  background: rgba(255, 255, 255, 0.42);
  border-radius: 999px;
}

.hero-dot.active {
  width: 30px;
  background: var(--teal-400);
}

.content-section,
.search-section,
.detail-shell {
  max-width: 1280px;
  padding: 72px 24px;
  margin: 0 auto;
}

.search-section {
  padding-bottom: 34px;
}

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

.section-head.center {
  display: grid;
  justify-items: center;
  max-width: 780px;
  margin: 0 auto 24px;
  text-align: center;
}

.section-head.compact {
  display: block;
  margin-bottom: 20px;
}

.section-head h2,
.page-hero h1,
.detail-content h1 {
  margin: 10px 0 0;
  font-size: clamp(30px, 4vw, 48px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

.section-head p,
.page-hero p {
  margin: 10px 0 0;
  color: var(--slate-600);
}

.section-head a {
  color: var(--teal-700);
  font-weight: 800;
}

.search-panel {
  position: relative;
  width: min(760px, 100%);
  margin: 0 auto;
}

.site-search-input,
.catalog-filter,
.filter-bar select {
  width: 100%;
  height: 56px;
  color: var(--slate-900);
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 16px;
  box-shadow: var(--shadow-card);
  outline: none;
}

.site-search-input,
.catalog-filter {
  padding: 0 22px;
}

.site-search-input:focus,
.catalog-filter:focus,
.filter-bar select:focus {
  border-color: var(--teal-500);
  box-shadow: 0 0 0 4px rgba(20, 184, 166, 0.12), var(--shadow-card);
}

.search-results {
  position: absolute;
  top: calc(100% + 10px);
  left: 0;
  right: 0;
  display: none;
  max-height: 430px;
  padding: 12px;
  overflow: auto;
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: 18px;
  box-shadow: var(--shadow-soft);
  z-index: 20;
}

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

.search-result-item {
  display: grid;
  grid-template-columns: 58px 1fr;
  gap: 12px;
  padding: 8px;
  border-radius: 12px;
}

.search-result-item:hover {
  background: var(--slate-50);
}

.search-result-item img {
  width: 58px;
  height: 76px;
  object-fit: cover;
  border-radius: 10px;
}

.search-result-item strong,
.search-result-item small {
  display: block;
}

.search-result-item small {
  color: var(--slate-500);
}

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

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

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

.movie-card {
  min-width: 0;
  background: var(--white);
  border: 1px solid rgba(226, 232, 240, 0.88);
  border-radius: var(--radius-md);
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  overflow: hidden;
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  box-shadow: var(--shadow-soft);
}

.movie-link {
  display: block;
  height: 100%;
}

.poster-wrap {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--slate-200);
}

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

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

.type-badge,
.rank-badge,
.play-hint {
  position: absolute;
  z-index: 2;
}

.type-badge {
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  color: var(--white);
  background: rgba(15, 23, 42, 0.76);
  border-radius: 999px;
  font-size: 12px;
}

.rank-badge {
  top: 10px;
  left: 10px;
  display: grid;
  width: 34px;
  height: 34px;
  place-items: center;
  color: var(--white);
  background: linear-gradient(135deg, var(--teal-500), var(--teal-700));
  border-radius: 50%;
  font-weight: 900;
}

.play-hint {
  top: 50%;
  left: 50%;
  display: grid;
  width: 52px;
  height: 52px;
  place-items: center;
  color: var(--white);
  background: rgba(20, 184, 166, 0.82);
  border-radius: 50%;
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.88);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.movie-card:hover .play-hint {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.movie-info {
  padding: 16px;
}

.movie-info h3 {
  margin: 0 0 8px;
  overflow: hidden;
  font-size: 17px;
  line-height: 1.35;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movie-info p {
  display: -webkit-box;
  min-height: 44px;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--slate-600);
  font-size: 14px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--slate-500);
  font-size: 13px;
}

.movie-meta span,
.detail-meta span {
  padding: 4px 8px;
  background: var(--slate-100);
  border-radius: 999px;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 12px;
}

.tag-row span {
  padding: 4px 8px;
  color: var(--teal-700);
  background: rgba(20, 184, 166, 0.1);
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
}

.muted-section {
  max-width: none;
  padding-right: max(24px, calc((100vw - 1280px) / 2 + 24px));
  padding-left: max(24px, calc((100vw - 1280px) / 2 + 24px));
  background: linear-gradient(180deg, rgba(241, 245, 249, 0.65), rgba(255, 255, 255, 0));
}

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

.category-tile {
  position: relative;
  min-height: 190px;
  overflow: hidden;
  color: var(--white);
  background: var(--slate-800);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.category-tile img {
  width: 100%;
  height: 100%;
  min-height: 190px;
  object-fit: cover;
  opacity: 0.58;
  transition: transform 0.35s ease;
}

.category-tile:hover img {
  transform: scale(1.08);
}

.category-tile span {
  position: absolute;
  inset: auto 18px 18px 18px;
}

.category-tile strong,
.category-tile small {
  display: block;
}

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

.category-tile small {
  color: rgba(255, 255, 255, 0.78);
}

.split-section {
  display: grid;
  grid-template-columns: 0.8fr 1.2fr;
  gap: 28px;
}

.ranking-panel,
.latest-panel,
.category-overview-card,
.detail-content,
.side-card,
.player-card {
  background: var(--white);
  border: 1px solid var(--slate-200);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-card);
}

.ranking-panel,
.latest-panel {
  padding: 24px;
}

.mini-list,
.side-list {
  display: grid;
  gap: 12px;
}

.mini-card {
  display: grid;
  grid-template-columns: 64px 1fr;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 14px;
  transition: background 0.2s ease;
}

.mini-card:hover {
  background: var(--slate-50);
}

.mini-card img {
  width: 64px;
  height: 86px;
  object-fit: cover;
  border-radius: 12px;
}

.mini-text strong,
.mini-text small {
  display: block;
}

.mini-text small {
  color: var(--slate-500);
}

.mini-rank {
  display: inline-grid;
  min-width: 28px;
  height: 28px;
  place-items: center;
  margin-bottom: 6px;
  color: var(--white);
  background: var(--teal-600);
  border-radius: 999px;
  font-size: 13px;
  font-weight: 900;
}

.page-hero {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 540px);
  gap: 28px;
  align-items: end;
  max-width: 1280px;
  padding: 66px 24px 42px;
  margin: 0 auto;
}

.soft-hero,
.category-hero,
.ranking-hero {
  margin-top: 18px;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  color: var(--slate-600);
  font-size: 14px;
}

.crumbs a {
  color: var(--teal-700);
  font-weight: 800;
}

.category-overview-card {
  overflow: hidden;
}

.category-overview-card a {
  display: block;
  height: 100%;
}

.category-covers {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  height: 160px;
  overflow: hidden;
}

.category-covers img {
  width: 100%;
  height: 160px;
  object-fit: cover;
}

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

.category-overview-body h2 {
  margin: 0 0 8px;
}

.category-overview-body p {
  min-height: 54px;
  margin: 0 0 16px;
  color: var(--slate-600);
}

.category-overview-body span {
  color: var(--teal-700);
  font-weight: 900;
}

.filter-bar {
  display: grid;
  grid-template-columns: minmax(260px, 1fr) repeat(3, minmax(140px, 190px));
  gap: 14px;
  max-width: 1280px;
  padding: 0 24px 8px;
  margin: 0 auto;
}

.filter-bar select {
  padding: 0 14px;
  box-shadow: none;
}

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

.detail-crumbs {
  margin-bottom: 18px;
}

.player-card {
  padding: 14px;
  overflow: hidden;
}

.video-player {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  color: var(--white);
  background: var(--slate-950);
  border-radius: 18px;
}

.video-player video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  cursor: pointer;
}

.player-center-button {
  position: absolute;
  top: 50%;
  left: 50%;
  z-index: 3;
  display: grid;
  width: 78px;
  height: 78px;
  place-items: center;
  color: var(--white);
  background: rgba(20, 184, 166, 0.92);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 18px 35px rgba(20, 184, 166, 0.32);
  cursor: pointer;
  transform: translate(-50%, -50%);
}

.video-player.playing .player-center-button {
  opacity: 0;
  pointer-events: none;
}

.player-loading,
.player-error {
  position: absolute;
  top: 16px;
  left: 16px;
  z-index: 4;
  display: none;
  padding: 7px 12px;
  background: rgba(15, 23, 42, 0.78);
  border-radius: 999px;
  font-size: 13px;
}

.video-player.loading .player-loading,
.video-player.error .player-error {
  display: block;
}

.player-controls {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 5;
  display: grid;
  grid-template-columns: auto auto 1fr auto auto;
  gap: 10px;
  align-items: center;
  padding: 18px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0));
  opacity: 0;
  transition: opacity 0.2s ease;
}

.video-player:hover .player-controls,
.video-player:focus-within .player-controls {
  opacity: 1;
}

.player-controls button {
  color: var(--white);
  background: rgba(255, 255, 255, 0.14);
  border: 0;
  border-radius: 999px;
  padding: 8px 12px;
  cursor: pointer;
}

.progress-track {
  position: relative;
  height: 7px;
  overflow: hidden;
  background: rgba(255, 255, 255, 0.22);
  border-radius: 999px;
  cursor: pointer;
}

.progress-track span {
  position: absolute;
  inset: 0 auto 0 0;
  width: 0%;
  background: var(--teal-400);
  border-radius: inherit;
}

.time-label {
  color: rgba(255, 255, 255, 0.88);
  font-size: 13px;
  white-space: nowrap;
}

.detail-content {
  padding: 30px;
  margin-top: 24px;
}

.detail-content h1 {
  margin-top: 0;
}

.one-line {
  padding: 18px 20px;
  color: var(--slate-700);
  background: rgba(20, 184, 166, 0.08);
  border-left: 4px solid var(--teal-500);
  border-radius: 14px;
  font-weight: 700;
}

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

.detail-content h2,
.side-card h2,
.footer-inner h2 {
  margin: 0 0 12px;
  font-size: 20px;
}

.detail-content p {
  color: var(--slate-700);
}

.detail-side {
  position: sticky;
  top: 98px;
  display: grid;
  gap: 18px;
}

.side-card {
  padding: 18px;
}

.poster-card img {
  width: 100%;
  border-radius: 18px;
  box-shadow: var(--shadow-card);
}

.related-section {
  padding-top: 8px;
}

.site-footer {
  color: var(--slate-300);
  background: linear-gradient(180deg, var(--slate-900), var(--slate-950));
}

.footer-inner {
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
  gap: 32px;
  max-width: 1280px;
  padding: 48px 24px;
  margin: 0 auto;
}

.footer-logo {
  margin-bottom: 12px;
  color: var(--white);
  font-size: 24px;
  font-weight: 900;
}

.footer-inner p {
  max-width: 520px;
  margin: 0;
  color: var(--slate-300);
}

.footer-inner h2 {
  color: var(--white);
}

.footer-inner ul {
  padding: 0;
  margin: 0;
  list-style: none;
}

.footer-inner li + li {
  margin-top: 8px;
}

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

@media (max-width: 1180px) {
  .desktop-nav {
    gap: 14px;
    font-size: 13px;
  }

  .featured-grid,
  .small-grid,
  .catalog-grid,
  .ranking-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

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

  .mobile-menu-button {
    display: block;
  }

  .hero {
    min-height: 620px;
  }

  .hero-content {
    top: 46%;
  }

  .hero-controls {
    left: 24px;
    right: auto;
  }

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

  .split-section,
  .page-hero,
  .detail-shell,
  .footer-inner {
    grid-template-columns: 1fr;
  }

  .detail-side {
    position: static;
  }

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

@media (max-width: 640px) {
  .header-inner {
    height: 64px;
    padding: 0 16px;
  }

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

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

  .brand-text small {
    display: none;
  }

  .hero {
    height: auto;
    min-height: 610px;
  }

  .hero-shade {
    background: linear-gradient(180deg, rgba(2, 6, 23, 0.38), rgba(2, 6, 23, 0.95));
  }

  .hero-content {
    top: auto;
    bottom: 110px;
    left: 16px;
    width: calc(100vw - 32px);
    transform: none;
  }

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

  .hero-controls {
    bottom: 28px;
    left: 16px;
  }

  .content-section,
  .search-section,
  .detail-shell,
  .page-hero {
    padding-right: 16px;
    padding-left: 16px;
  }

  .section-head {
    display: block;
  }

  .movie-grid,
  .featured-grid,
  .small-grid,
  .catalog-grid,
  .ranking-grid,
  .category-grid,
  .category-overview-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .movie-info {
    padding: 12px;
  }

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

  .movie-info p {
    font-size: 13px;
  }

  .filter-bar {
    grid-template-columns: 1fr;
    padding-right: 16px;
    padding-left: 16px;
  }

  .detail-content {
    padding: 22px;
  }

  .player-controls {
    grid-template-columns: auto auto 1fr;
  }

  .time-label,
  [data-player-fullscreen] {
    display: none;
  }
}
