:root {
  color-scheme: light;
  --bg: #ffffff;
  --muted-bg: #f8fafc;
  --soft-blue: #eef6ff;
  --text: #111827;
  --muted: #64748b;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --indigo: #4f46e5;
  --rose: #f43f5e;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
  --radius: 24px;
}

* {
  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;
  color: var(--text);
  background: var(--bg);
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.84);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  backdrop-filter: blur(18px);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.06);
}

.site-header-inner {
  max-width: 1200px;
  height: 70px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

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

.brand-icon {
  width: 38px;
  height: 38px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.32);
}

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

.brand-name {
  font-size: 21px;
  letter-spacing: -0.03em;
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-subtitle {
  margin-top: 3px;
  font-size: 12px;
  color: var(--muted);
  font-weight: 500;
}

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

.nav-link,
.mobile-link {
  padding: 10px 14px;
  color: #475569;
  border-radius: 12px;
  transition: background 0.2s ease, color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.mobile-link:hover,
.nav-link.active,
.mobile-link.active {
  background: #eff6ff;
  color: var(--primary);
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.icon-button {
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 14px;
  background: #f1f5f9;
  color: #334155;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.icon-button:hover {
  transform: translateY(-1px);
  background: #e0edff;
}

.menu-toggle {
  display: none;
}

.search-panel,
.mobile-nav {
  max-width: 1200px;
  margin: 0 auto;
  padding: 14px 20px 18px;
}

.header-search,
.quick-search,
.search-box {
  display: flex;
  gap: 12px;
}

.header-search input,
.quick-search input,
.search-box input,
.filter-row select {
  width: 100%;
  border: 1px solid #dbe3ef;
  border-radius: 999px;
  padding: 14px 18px;
  color: var(--text);
  outline: none;
  background: #fff;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.header-search input:focus,
.quick-search input:focus,
.search-box input:focus,
.filter-row select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.header-search button,
.quick-search button,
.search-box button {
  border: 0;
  border-radius: 999px;
  padding: 0 24px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  cursor: pointer;
  white-space: nowrap;
  box-shadow: 0 12px 28px rgba(37, 99, 235, 0.24);
}

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

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

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

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

.hero-bg {
  position: absolute;
  inset: 0;
  overflow: hidden;
  background: radial-gradient(circle at 80% 20%, rgba(59, 130, 246, 0.45), transparent 32%), linear-gradient(135deg, #111827, #1e3a8a);
}

.hero-bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.88) 0%, rgba(15, 23, 42, 0.64) 46%, rgba(15, 23, 42, 0.16) 100%), linear-gradient(0deg, rgba(2, 6, 23, 0.82), rgba(2, 6, 23, 0.04) 55%);
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(1.05);
  transform: scale(1.02);
}

.hero-content {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  height: 100%;
  margin: 0 auto;
  padding: 0 20px 72px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  color: #fff;
}

.hero-badge {
  width: fit-content;
  padding: 8px 16px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.22);
  border: 1px solid rgba(191, 219, 254, 0.26);
  color: #dbeafe;
  backdrop-filter: blur(14px);
}

.hero-content h1 {
  max-width: 820px;
  margin: 22px 0 10px;
  font-size: clamp(30px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.055em;
}

.hero-content h2 {
  margin: 0 0 14px;
  font-size: clamp(24px, 4vw, 44px);
  line-height: 1.12;
}

.hero-content p {
  max-width: 760px;
  margin: 0 0 22px;
  color: #e2e8f0;
  font-size: 19px;
}

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

.hero-tags span,
.tag-row span,
.movie-meta span,
.detail-meta span {
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 700;
}

.hero-tags span {
  background: rgba(255, 255, 255, 0.14);
  color: #fff;
}

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

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

.primary-button {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.3);
}

.ghost-button {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(12px);
}

.ghost-button.dark {
  color: var(--primary);
  background: #eff6ff;
  border-color: #bfdbfe;
}

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

.hero-controls {
  position: absolute;
  right: calc((100% - min(1200px, 100%)) / 2 + 20px);
  bottom: 72px;
  z-index: 4;
  display: flex;
  gap: 10px;
}

.hero-controls button {
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.22);
  border-radius: 50%;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(12px);
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
}

.quick-search-section {
  padding: 28px 20px 0;
  background: linear-gradient(180deg, #f8fafc, #fff);
}

.quick-search {
  max-width: 920px;
  margin: 0 auto;
  padding: 16px;
  border: 1px solid #e2e8f0;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 20px 50px rgba(15, 23, 42, 0.08);
}

.content-section,
.search-page,
.watch-section {
  max-width: 1200px;
  margin: 0 auto;
  padding: 72px 20px;
}

.soft-bg {
  max-width: none;
  padding-left: calc((100% - min(1200px, 100%)) / 2 + 20px);
  padding-right: calc((100% - min(1200px, 100%)) / 2 + 20px);
  background: linear-gradient(135deg, #f8fafc, #eef6ff);
}

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

.section-heading.compact {
  margin-bottom: 20px;
}

.section-heading p {
  margin: 0 0 6px;
  color: var(--primary);
  font-size: 14px;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.section-heading h2,
.search-heading h2 {
  margin: 0;
  color: var(--text);
  font-size: clamp(26px, 4vw, 38px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.text-link {
  color: var(--primary);
  font-weight: 800;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid #e7edf6;
  border-radius: 24px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover {
  transform: translateY(-6px);
  border-color: #bfdbfe;
  box-shadow: var(--shadow);
}

.movie-cover {
  position: relative;
  height: 210px;
  display: block;
  overflow: hidden;
  background: radial-gradient(circle at 30% 15%, #93c5fd, transparent 35%), linear-gradient(135deg, #1e3a8a, #111827);
}

.cover-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.movie-card:hover .cover-image {
  transform: scale(1.08);
}

.play-chip {
  position: absolute;
  right: 14px;
  bottom: 14px;
  padding: 6px 12px;
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, 0.58);
  backdrop-filter: blur(12px);
  font-size: 12px;
  font-weight: 800;
}

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

.movie-meta {
  margin-bottom: 10px;
}

.movie-meta span {
  color: var(--primary);
  background: #eff6ff;
}

.movie-card h2 {
  margin: 0 0 8px;
  font-size: 19px;
  line-height: 1.32;
}

.movie-card h2 a:hover {
  color: var(--primary);
}

.movie-card p {
  min-height: 46px;
  margin: 0 0 14px;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.tag-row span {
  color: #475569;
  background: #f1f5f9;
}

.tag-row.large span {
  padding: 8px 13px;
  font-size: 14px;
}

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

.category-tile,
.catalog-card {
  min-height: 150px;
  padding: 24px;
  border-radius: 24px;
  color: #fff;
  background: radial-gradient(circle at 88% 14%, rgba(255, 255, 255, 0.28), transparent 30%), linear-gradient(135deg, var(--primary), var(--indigo));
  box-shadow: 0 16px 42px rgba(37, 99, 235, 0.22);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-tile:hover,
.catalog-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 52px rgba(37, 99, 235, 0.3);
}

.category-tile strong,
.catalog-card span {
  display: block;
  margin-bottom: 12px;
  font-size: 24px;
  font-weight: 900;
}

.category-tile small,
.catalog-card p {
  display: grid;
  gap: 4px;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 410px;
  gap: 32px;
}

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

.compact-card,
.rank-row {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px;
  border: 1px solid #e5edf6;
  border-radius: 18px;
  background: #fff;
  transition: border-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.compact-card:hover,
.rank-row:hover {
  transform: translateY(-2px);
  border-color: #bfdbfe;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.08);
}

.compact-cover {
  width: 82px;
  height: 64px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 14px;
  background: linear-gradient(135deg, #1e3a8a, #111827);
}

.compact-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.compact-info {
  min-width: 0;
  display: grid;
  gap: 4px;
}

.compact-info strong,
.ranking-copy strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-info em,
.rank-row em,
.ranking-copy em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.ranking-panel {
  padding: 24px;
  border: 1px solid #e7edf6;
  border-radius: 28px;
  background: linear-gradient(180deg, #fff, #f8fafc);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}

.rank-row span {
  width: 40px;
  height: 40px;
  border-radius: 14px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  font-weight: 900;
}

.rank-row {
  display: grid;
  grid-template-columns: 40px minmax(0, 1fr);
}

.rank-row em {
  grid-column: 2;
}

.group-links {
  padding-top: 40px;
}

.pill-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.pill-links a {
  padding: 10px 16px;
  border-radius: 999px;
  color: var(--primary);
  background: #eff6ff;
  font-weight: 800;
}

.page-hero {
  position: relative;
  padding: 82px 20px;
  color: #fff;
  background: radial-gradient(circle at 80% 15%, rgba(255, 255, 255, 0.22), transparent 28%), linear-gradient(135deg, var(--primary), var(--indigo));
  overflow: hidden;
}

.page-hero > div {
  max-width: 1200px;
  margin: 0 auto;
}

.page-hero p {
  margin: 0 0 10px;
  color: #dbeafe;
  font-weight: 900;
  letter-spacing: 0.08em;
}

.page-hero h1 {
  max-width: 820px;
  margin: 0 0 16px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.page-hero span {
  max-width: 760px;
  display: block;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
}

.search-page {
  display: grid;
  gap: 22px;
}

.filter-row {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 12px;
}

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

.ranking-item {
  display: grid;
  grid-template-columns: 60px 118px minmax(0, 1fr);
  align-items: center;
  gap: 18px;
  padding: 14px;
  border: 1px solid #e7edf6;
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.ranking-item:hover {
  transform: translateY(-3px);
  box-shadow: var(--shadow);
}

.ranking-number {
  color: var(--primary);
  font-size: 28px;
  font-weight: 900;
}

.ranking-poster {
  height: 84px;
  overflow: hidden;
  border-radius: 16px;
  background: linear-gradient(135deg, #1e3a8a, #111827);
}

.ranking-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.ranking-copy {
  min-width: 0;
  display: grid;
  gap: 6px;
}

.ranking-copy p {
  margin: 0;
  color: var(--muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.detail-hero {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  background: #0f172a;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 70% 20%, rgba(59, 130, 246, 0.42), transparent 34%), linear-gradient(135deg, #0f172a, #1e1b4b);
}

.detail-backdrop::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(15, 23, 42, 0.68) 52%, rgba(15, 23, 42, 0.24)), linear-gradient(0deg, rgba(2, 6, 23, 0.8), transparent 62%);
}

.detail-bg {
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(4px) saturate(1.05);
  transform: scale(1.03);
}

.detail-layout {
  position: relative;
  z-index: 2;
  max-width: 1200px;
  min-height: 560px;
  margin: 0 auto;
  padding: 70px 20px;
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  align-items: center;
  gap: 42px;
  color: #fff;
}

.detail-poster {
  overflow: hidden;
  border-radius: 28px;
  background: linear-gradient(135deg, #1e3a8a, #111827);
  box-shadow: 0 24px 60px rgba(0, 0, 0, 0.35);
  aspect-ratio: 3 / 4;
}

.poster-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  color: #bfdbfe;
  font-weight: 800;
}

.detail-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(36px, 5vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.detail-copy .lead {
  max-width: 800px;
  margin: 0 0 24px;
  color: #e2e8f0;
  font-size: 20px;
}

.detail-meta span {
  color: #dbeafe;
  background: rgba(255, 255, 255, 0.13);
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  background: #020617;
  box-shadow: 0 24px 70px rgba(15, 23, 42, 0.26);
  aspect-ratio: 16 / 9;
}

.movie-player {
  width: 100%;
  height: 100%;
  display: block;
  background: #020617;
}

.player-launch {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #fff;
  background: radial-gradient(circle at 50% 50%, rgba(37, 99, 235, 0.32), rgba(2, 6, 23, 0.5));
  cursor: pointer;
}

.player-launch span {
  width: 92px;
  height: 92px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 7px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--indigo));
  font-size: 42px;
  box-shadow: 0 24px 60px rgba(37, 99, 235, 0.36);
  transition: transform 0.2s ease;
}

.player-launch:hover span {
  transform: scale(1.08);
}

.player-launch.is-hidden {
  display: none;
}

.player-message {
  position: absolute;
  left: 20px;
  bottom: 18px;
  z-index: 4;
  color: #fff;
  font-weight: 800;
}

.text-panel {
  max-width: 920px;
  margin: 0 auto;
  padding: 34px;
  border: 1px solid #e7edf6;
  border-radius: 28px;
  background: #fff;
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.06);
}

.text-panel h2 {
  margin: 26px 0 10px;
  font-size: 26px;
}

.text-panel h2:first-child {
  margin-top: 0;
}

.text-panel p {
  margin: 0;
  color: #475569;
  font-size: 17px;
}

.site-footer {
  border-top: 1px solid #e5e7eb;
  background: linear-gradient(180deg, #f8fafc, #f1f5f9);
}

.footer-grid {
  max-width: 1200px;
  margin: 0 auto;
  padding: 54px 20px;
  display: grid;
  grid-template-columns: 1.4fr repeat(3, 1fr);
  gap: 28px;
  color: #475569;
}

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

.footer-grid p {
  margin: 14px 0 0;
}

.footer-grid a:not(.footer-brand) {
  display: block;
  margin: 8px 0;
  color: #475569;
}

.footer-grid a:hover {
  color: var(--primary);
}

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

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

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

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

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

  .site-header-inner {
    height: 64px;
  }

  .brand-subtitle {
    display: none;
  }

  .hero-carousel {
    height: 620px;
  }

  .hero-content {
    padding-bottom: 92px;
  }

  .hero-controls {
    left: 20px;
    right: auto;
    bottom: 28px;
  }

  .header-search,
  .quick-search,
  .search-box {
    flex-direction: column;
  }

  .header-search button,
  .quick-search button,
  .search-box button {
    min-height: 48px;
  }

  .content-section,
  .search-page,
  .watch-section {
    padding: 52px 16px;
  }

  .soft-bg {
    padding-left: 16px;
    padding-right: 16px;
  }

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

  .movie-grid,
  .category-grid,
  .catalog-grid,
  .filter-row {
    grid-template-columns: 1fr;
  }

  .ranking-item {
    grid-template-columns: 48px 86px minmax(0, 1fr);
    gap: 12px;
  }

  .ranking-poster {
    height: 68px;
  }

  .detail-layout {
    padding: 42px 16px;
    gap: 24px;
  }

  .detail-poster {
    width: 220px;
  }

  .player-launch span {
    width: 74px;
    height: 74px;
    font-size: 34px;
  }

  .text-panel {
    padding: 24px;
  }
}

@media (max-width: 480px) {
  .movie-grid {
    gap: 16px;
  }

  .movie-cover {
    height: 190px;
  }

  .page-hero {
    padding: 62px 16px;
  }

  .quick-search {
    padding: 12px;
  }
}
