:root {
  color-scheme: light;
  --slate-950: #020617;
  --slate-900: #0f172a;
  --slate-800: #1e293b;
  --slate-700: #334155;
  --slate-600: #475569;
  --slate-500: #64748b;
  --slate-100: #f1f5f9;
  --slate-50: #f8fafc;
  --cyan-500: #06b6d4;
  --cyan-400: #22d3ee;
  --blue-500: #3b82f6;
  --red-500: #ef4444;
  --amber-400: #fbbf24;
  --white: #ffffff;
  --shadow-soft: 0 20px 45px rgba(15, 23, 42, 0.12);
  --shadow-card: 0 10px 30px rgba(15, 23, 42, 0.10);
  --radius-xl: 24px;
  --radius-lg: 18px;
  --radius-md: 14px;
  --container: min(1180px, calc(100vw - 32px));
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.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 12px 30px rgba(2, 6, 23, 0.24);
}

.nav-shell {
  width: var(--container);
  min-height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 22px;
}

.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: 999px;
  color: var(--slate-900);
  background: linear-gradient(135deg, var(--cyan-400), var(--blue-500));
  box-shadow: 0 0 0 6px rgba(34, 211, 238, 0.10);
}

.logo-text,
.footer-logo {
  font-size: 20px;
  background: linear-gradient(90deg, var(--cyan-400), #93c5fd);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

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

.nav-link {
  font-weight: 700;
  color: rgba(255, 255, 255, 0.82);
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--cyan-400);
  transform: translateY(-1px);
}

.top-search {
  width: 260px;
  display: flex;
  align-items: center;
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 999px;
  overflow: hidden;
  background: rgba(15, 23, 42, 0.6);
}

.top-search input {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--white);
  padding: 10px 14px;
  background: transparent;
}

.top-search input::placeholder {
  color: rgba(226, 232, 240, 0.72);
}

.top-search button {
  border: 0;
  padding: 10px 16px;
  color: var(--slate-900);
  font-weight: 800;
  background: linear-gradient(135deg, var(--cyan-400), #60a5fa);
}

.menu-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  color: var(--white);
  font-size: 24px;
  border-radius: 12px;
  padding: 8px 12px;
  background: rgba(255, 255, 255, 0.08);
}

.mobile-panel {
  display: none;
  width: var(--container);
  margin: 0 auto;
  padding: 0 0 18px;
}

.mobile-panel.open {
  display: grid;
  gap: 8px;
}

.mobile-link {
  display: block;
  border-radius: 12px;
  padding: 11px 14px;
  color: rgba(255, 255, 255, 0.88);
  background: rgba(255, 255, 255, 0.06);
}

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

.hero-track,
.hero-slide {
  position: absolute;
  inset: 0;
}

.hero-slide {
  opacity: 0;
  pointer-events: none;
  display: flex;
  align-items: center;
  background-image:
    radial-gradient(circle at 18% 20%, rgba(34, 211, 238, 0.24), transparent 30%),
    linear-gradient(90deg, rgba(2, 6, 23, 0.95), rgba(15, 23, 42, 0.76), rgba(15, 23, 42, 0.28)),
    var(--poster-image);
  background-size: cover;
  background-position: center;
  transition: opacity 0.8s ease, transform 0.8s ease;
  transform: scale(1.02);
}

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

.hero-layer {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(0deg, rgba(15, 23, 42, 0.92), transparent 42%),
    radial-gradient(circle at 74% 18%, rgba(59, 130, 246, 0.26), transparent 28%);
}

.hero-content {
  position: relative;
  width: var(--container);
  margin: 0 auto;
  padding: 80px 0 120px;
  max-width: 860px;
}

.hero-tags,
.detail-tags,
.filter-chips {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tags span,
.detail-tags span,
.section-kicker {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 12px;
  color: var(--cyan-400);
  font-size: 13px;
  font-weight: 800;
  background: rgba(8, 145, 178, 0.12);
  border: 1px solid rgba(34, 211, 238, 0.22);
}

.hero-content h1 {
  max-width: 760px;
  margin: 18px 0 16px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 0.98;
  letter-spacing: -0.04em;
}

.hero-content p {
  max-width: 680px;
  margin: 0 0 28px;
  color: rgba(226, 232, 240, 0.88);
  font-size: 18px;
  line-height: 1.8;
}

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

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

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

.btn.primary {
  color: var(--slate-900);
  background: linear-gradient(135deg, var(--cyan-400), #60a5fa);
  box-shadow: 0 14px 32px rgba(34, 211, 238, 0.28);
}

.btn.ghost {
  color: var(--white);
  border: 1px solid rgba(255, 255, 255, 0.25);
  background: rgba(255, 255, 255, 0.08);
  backdrop-filter: blur(12px);
}

.hero-controls {
  position: absolute;
  left: 50%;
  bottom: 28px;
  z-index: 5;
  width: var(--container);
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-prev,
.hero-next,
.hero-dot {
  border: 0;
  color: var(--white);
  background: rgba(255, 255, 255, 0.14);
  backdrop-filter: blur(12px);
}

.hero-prev,
.hero-next {
  width: 42px;
  height: 42px;
  border-radius: 999px;
  font-size: 30px;
  line-height: 1;
}

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

.hero-dot {
  width: 34px;
  height: 9px;
  border-radius: 999px;
  opacity: 0.55;
}

.hero-dot.active {
  opacity: 1;
  background: var(--cyan-400);
}

.wide-panel,
.content-section,
.dark-section,
.filter-panel,
.search-workbench,
.player-section {
  width: var(--container);
  margin: 0 auto;
}

.search-panel {
  margin-top: -48px;
  position: relative;
  z-index: 6;
  display: grid;
  grid-template-columns: 1fr minmax(280px, 520px);
  gap: 24px;
  align-items: center;
  border-radius: var(--radius-xl);
  padding: 26px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: var(--shadow-soft);
}

.search-panel h2,
.section-head h2,
.page-hero h1 {
  margin: 0;
  color: var(--slate-900);
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.12;
  letter-spacing: -0.03em;
}

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

.large-search,
.global-search-form {
  display: flex;
  align-items: center;
  overflow: hidden;
  border-radius: 999px;
  border: 1px solid rgba(15, 23, 42, 0.12);
  background: var(--white);
}

.large-search input,
.global-search-form input,
.local-filter {
  min-width: 0;
  width: 100%;
  border: 0;
  outline: 0;
  color: var(--slate-900);
  padding: 15px 18px;
  background: transparent;
}

.large-search button,
.global-search-form button {
  border: 0;
  align-self: stretch;
  padding: 0 24px;
  color: var(--white);
  font-weight: 900;
  background: linear-gradient(135deg, var(--slate-900), var(--slate-700));
}

.content-section,
.dark-section {
  padding: 58px 0;
}

.dark-section {
  margin-top: 20px;
  margin-bottom: 20px;
  border-radius: 32px;
  padding: 42px;
  background: linear-gradient(135deg, var(--slate-900), var(--slate-800));
  box-shadow: var(--shadow-soft);
}

.dark-section .section-head h2,
.dark-section .section-head p {
  color: var(--white);
}

.dark-section .section-head p {
  color: rgba(226, 232, 240, 0.76);
}

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

.section-more {
  white-space: nowrap;
  color: var(--cyan-500);
  font-weight: 900;
}

.movie-grid,
.featured-grid,
.rank-grid,
.category-grid,
.category-overview-grid {
  display: grid;
  gap: 22px;
}

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

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

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

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

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

.movie-card {
  min-width: 0;
}

.card-link,
.category-card a,
.story-card,
.info-card {
  display: block;
  height: 100%;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: var(--white);
  box-shadow: var(--shadow-card);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.card-link:hover,
.category-card a:hover {
  transform: translateY(-6px);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.poster,
.detail-poster,
.mini-poster {
  position: relative;
  overflow: hidden;
  background-image:
    linear-gradient(160deg, rgba(15, 23, 42, 0.10), rgba(15, 23, 42, 0.62)),
    var(--poster-image),
    linear-gradient(135deg, #0f172a, #0891b2);
  background-size: cover;
  background-position: center;
}

.poster {
  aspect-ratio: 3 / 4;
}

.featured-card .poster {
  aspect-ratio: 16 / 9;
}

.compact-card .poster {
  aspect-ratio: 3 / 4;
}

.type-pill,
.year-pill,
.rank-badge {
  position: absolute;
  z-index: 2;
  border-radius: 999px;
  padding: 6px 10px;
  color: var(--white);
  font-size: 12px;
  font-weight: 900;
  background: rgba(2, 6, 23, 0.74);
  backdrop-filter: blur(10px);
}

.type-pill {
  top: 12px;
  left: 12px;
}

.year-pill {
  right: 12px;
  bottom: 12px;
}

.rank-badge {
  top: 12px;
  right: 12px;
  min-width: 34px;
  text-align: center;
  color: var(--slate-900);
  background: linear-gradient(135deg, var(--amber-400), #fde68a);
}

.card-body {
  padding: 16px;
}

.card-body h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.3;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  transition: color 0.2s ease;
}

.card-link:hover h3 {
  color: var(--cyan-500);
}

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

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  color: var(--slate-500);
  font-size: 12px;
}

.card-meta span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-tile,
.category-card a {
  border-radius: var(--radius-lg);
  padding: 22px;
  background: linear-gradient(135deg, var(--white), #eef8ff);
  box-shadow: var(--shadow-card);
}

.category-tile span,
.category-card h2 {
  display: block;
  margin: 0 0 8px;
  color: var(--slate-900);
  font-size: 20px;
  font-weight: 900;
}

.category-tile p,
.category-card p {
  margin: 0;
  color: var(--slate-600);
  line-height: 1.7;
}

.page-hero {
  color: var(--white);
  background:
    radial-gradient(circle at 16% 26%, rgba(34, 211, 238, 0.28), transparent 30%),
    linear-gradient(135deg, var(--slate-900), var(--slate-800));
}

.compact-hero {
  padding: 62px max(16px, calc((100vw - 1180px) / 2)) 58px;
}

.compact-hero h1,
.compact-hero p {
  color: var(--white);
}

.compact-hero p {
  max-width: 760px;
  color: rgba(226, 232, 240, 0.78);
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: rgba(226, 232, 240, 0.74);
  font-size: 14px;
}

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

.filter-panel,
.search-workbench {
  margin-top: 28px;
  margin-bottom: 6px;
  padding: 22px;
  border-radius: var(--radius-xl);
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.local-filter {
  border: 1px solid rgba(15, 23, 42, 0.12);
  border-radius: 999px;
}

.filter-chips {
  margin-top: 14px;
}

.filter-chips button {
  border: 1px solid rgba(15, 23, 42, 0.10);
  border-radius: 999px;
  padding: 9px 14px;
  color: var(--slate-700);
  font-weight: 800;
  background: var(--slate-50);
}

.filter-chips button:hover,
.filter-chips button.active {
  color: var(--slate-900);
  background: #cffafe;
  border-color: rgba(6, 182, 212, 0.36);
}

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

.mini-poster {
  display: block;
  aspect-ratio: 3 / 4;
  border-radius: 12px;
}

.ranking-list {
  display: grid;
  gap: 14px;
  margin: 28px 0 0;
  padding: 0;
  list-style: none;
}

.ranking-list li {
  display: grid;
  grid-template-columns: 54px 280px 1fr;
  gap: 16px;
  align-items: center;
  border-radius: 18px;
  padding: 16px;
  background: var(--white);
  box-shadow: var(--shadow-card);
}

.rank-number {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  color: var(--slate-900);
  font-weight: 900;
  background: linear-gradient(135deg, #facc15, #fef08a);
}

.ranking-list strong,
.ranking-list em {
  display: block;
}

.ranking-list em {
  margin-top: 4px;
  color: var(--slate-500);
  font-style: normal;
  font-size: 13px;
}

.ranking-list li > span:last-child {
  color: var(--slate-600);
  line-height: 1.55;
}

.detail-hero {
  position: relative;
  min-height: 560px;
  display: flex;
  align-items: center;
  color: var(--white);
  background-image:
    linear-gradient(90deg, rgba(2, 6, 23, 0.96), rgba(15, 23, 42, 0.84), rgba(15, 23, 42, 0.36)),
    var(--poster-image);
  background-size: cover;
  background-position: center;
}

.detail-shade {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 15%, rgba(34, 211, 238, 0.25), transparent 35%);
}

.detail-shell {
  position: relative;
  width: var(--container);
  margin: 0 auto;
  display: grid;
  grid-template-columns: 310px 1fr;
  gap: 42px;
  align-items: center;
  padding: 70px 0;
}

.detail-poster {
  aspect-ratio: 3 / 4;
  border-radius: 28px;
  box-shadow: 0 28px 60px rgba(2, 6, 23, 0.46);
}

.detail-info h1 {
  margin: 0 0 18px;
  font-size: clamp(36px, 6vw, 66px);
  line-height: 1;
  letter-spacing: -0.04em;
}

.detail-line {
  max-width: 780px;
  margin: 0 0 20px;
  color: rgba(226, 232, 240, 0.86);
  font-size: 18px;
  line-height: 1.8;
}

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

.detail-meta span {
  border-radius: 999px;
  padding: 8px 12px;
  color: rgba(255, 255, 255, 0.92);
  background: rgba(255, 255, 255, 0.10);
  border: 1px solid rgba(255, 255, 255, 0.13);
}

.detail-tags {
  margin-bottom: 26px;
}

.player-section {
  padding-top: 44px;
}

.video-shell {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  aspect-ratio: 16 / 9;
  background: var(--slate-950);
  box-shadow: 0 30px 72px rgba(15, 23, 42, 0.28);
}

.video-player {
  width: 100%;
  height: 100%;
  background: #000000;
}

.play-cover {
  position: absolute;
  inset: 0;
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  color: var(--white);
  background-image:
    linear-gradient(0deg, rgba(2, 6, 23, 0.88), rgba(15, 23, 42, 0.42)),
    var(--poster-image);
  background-size: cover;
  background-position: center;
}

.video-shell.is-playing .play-cover {
  display: none;
}

.play-icon {
  width: 84px;
  height: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: var(--slate-900);
  font-size: 34px;
  background: linear-gradient(135deg, var(--cyan-400), #93c5fd);
  box-shadow: 0 0 0 14px rgba(34, 211, 238, 0.14);
}

.play-cover strong {
  max-width: min(700px, 80%);
  font-size: clamp(24px, 4vw, 46px);
  line-height: 1.1;
}

.play-cover em {
  font-style: normal;
  color: rgba(226, 232, 240, 0.82);
}

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

.story-card,
.info-card {
  padding: 28px;
}

.story-card h2,
.info-card h2 {
  margin: 0 0 16px;
  font-size: 24px;
}

.story-card p {
  margin: 0 0 28px;
  color: var(--slate-700);
  line-height: 1.95;
}

.story-card p:last-child {
  margin-bottom: 0;
}

.info-card dl {
  display: grid;
  grid-template-columns: 78px 1fr;
  gap: 12px 16px;
  margin: 0;
}

.info-card dt {
  color: var(--slate-500);
  font-weight: 800;
}

.info-card dd {
  margin: 0;
  color: var(--slate-800);
}

.search-workbench {
  display: grid;
  gap: 18px;
}

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

.search-empty {
  grid-column: 1 / -1;
  border-radius: 18px;
  padding: 26px;
  color: var(--slate-600);
  background: var(--slate-50);
}

.site-footer {
  margin-top: 40px;
  color: rgba(226, 232, 240, 0.82);
  background: var(--slate-900);
}

.footer-grid {
  width: var(--container);
  margin: 0 auto;
  padding: 44px 0;
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
  gap: 34px;
}

.site-footer h2 {
  margin: 0 0 14px;
  color: var(--white);
  font-size: 16px;
}

.site-footer p {
  max-width: 520px;
  margin: 14px 0 0;
  line-height: 1.8;
}

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

.site-footer a:hover {
  color: var(--cyan-400);
}

.footer-bottom {
  width: var(--container);
  margin: 0 auto;
  border-top: 1px solid rgba(148, 163, 184, 0.22);
  padding: 20px 0 28px;
  text-align: center;
  color: rgba(203, 213, 225, 0.68);
}

.is-hidden {
  display: none !important;
}

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

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

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

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

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

  .menu-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .nav-shell {
    min-height: 62px;
  }

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

  .hero-content {
    padding-top: 110px;
  }

  .search-panel,
  .two-column,
  .footer-grid,
  .detail-shell,
  .ranking-list li {
    grid-template-columns: 1fr;
  }

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

  .search-panel {
    margin-top: 18px;
  }

  .movie-grid,
  .movie-grid.six-col,
  .featured-grid,
  .rank-grid,
  .category-grid,
  .category-overview-grid,
  .search-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .dark-section {
    padding: 26px;
  }

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

@media (max-width: 560px) {
  :root {
    --container: min(100vw - 22px, 1180px);
  }

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

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

  .movie-grid,
  .movie-grid.six-col,
  .featured-grid,
  .rank-grid,
  .category-grid,
  .category-overview-grid,
  .search-results {
    grid-template-columns: 1fr;
  }

  .category-posters {
    grid-template-columns: repeat(4, 1fr);
  }

  .large-search,
  .global-search-form {
    align-items: stretch;
    flex-direction: column;
    border-radius: 18px;
  }

  .large-search button,
  .global-search-form button {
    min-height: 46px;
  }

  .video-shell {
    border-radius: 20px;
  }
}
