:root {
  --bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #eef8ff;
  --text: #0f172a;
  --muted: #64748b;
  --line: #e2e8f0;
  --sky: #0284c7;
  --sky-dark: #0369a1;
  --sky-soft: #e0f2fe;
  --gold: #f59e0b;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --radius: 18px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

.container {
  width: min(var(--container), calc(100% - 32px));
  margin: 0 auto;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 90;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(226, 232, 240, 0.9);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 68px;
  gap: 22px;
}

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

.brand-text {
  font-size: 22px;
}

.brand-mark {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border-radius: 12px;
  background: linear-gradient(135deg, #38bdf8, #0284c7);
  color: #fff;
  box-shadow: 0 12px 25px rgba(2, 132, 199, 0.28);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 20px;
  font-size: 15px;
  color: #334155;
  white-space: nowrap;
}

.nav-link {
  position: relative;
  padding: 8px 0;
  transition: color 0.2s ease;
}

.nav-link::after {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  height: 2px;
  content: "";
  background: var(--sky);
  transform: scaleX(0);
  transform-origin: center;
  transition: transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--sky);
}

.nav-link:hover::after,
.nav-link.active::after {
  transform: scaleX(1);
}

.header-search,
.mobile-search {
  display: flex;
  align-items: center;
  overflow: hidden;
  min-width: 250px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.header-search input,
.mobile-search input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 11px 14px 11px 18px;
  color: var(--text);
  background: transparent;
}

.header-search button,
.mobile-search button {
  border: 0;
  padding: 11px 17px;
  color: #fff;
  background: var(--sky);
  cursor: pointer;
  transition: background 0.2s ease;
}

.header-search button:hover,
.mobile-search button:hover {
  background: var(--sky-dark);
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--sky-soft);
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: var(--sky-dark);
}

.mobile-panel {
  display: none;
  padding: 0 16px 18px;
  background: #fff;
  border-top: 1px solid var(--line);
}

.mobile-panel.open {
  display: block;
}

.mobile-links {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.mobile-link {
  padding: 10px 12px;
  border-radius: 12px;
  background: var(--surface-soft);
  color: #075985;
}

.hero-slider {
  position: relative;
  height: 610px;
  overflow: hidden;
  background: linear-gradient(135deg, #38bdf8, #0369a1);
}

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

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

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.04);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 20% 30%, rgba(14, 165, 233, 0.42), transparent 38%),
    linear-gradient(90deg, rgba(2, 6, 23, 0.86) 0%, rgba(15, 23, 42, 0.56) 46%, rgba(15, 23, 42, 0.14) 100%),
    linear-gradient(0deg, rgba(15, 23, 42, 0.94), transparent 48%);
}

.hero-content {
  position: relative;
  z-index: 2;
  display: flex;
  align-items: flex-end;
  height: 100%;
  padding-bottom: 82px;
}

.hero-copy {
  max-width: 720px;
  color: #fff;
}

.hero-labels {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 18px;
}

.hero-labels span {
  padding: 7px 12px;
  border: 1px solid rgba(255, 255, 255, 0.28);
  border-radius: 999px;
  color: #e0f2fe;
  background: rgba(2, 132, 199, 0.22);
  backdrop-filter: blur(10px);
}

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

.hero-copy p {
  max-width: 650px;
  margin: 0 0 28px;
  color: #e2e8f0;
  font-size: 20px;
}

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

.primary-btn,
.ghost-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 12px 22px;
  border-radius: 999px;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-btn {
  color: #fff;
  background: var(--sky);
  box-shadow: 0 15px 35px rgba(2, 132, 199, 0.28);
}

.primary-btn:hover {
  transform: translateY(-2px);
  background: var(--sky-dark);
}

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

.ghost-btn:hover {
  transform: translateY(-2px);
  background: rgba(255, 255, 255, 0.22);
}

.ghost-btn.dark {
  border-color: var(--line);
  color: var(--text);
  background: #fff;
}

.hero-controls {
  position: absolute;
  right: 0;
  bottom: 32px;
  left: 0;
  z-index: 4;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.hero-dot {
  width: 34px;
  height: 5px;
  border: 0;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.hero-dot.active {
  background: #fff;
}

.hero-arrows {
  display: flex;
  gap: 10px;
}

.hero-arrows button {
  width: 44px;
  height: 44px;
  border: 1px solid rgba(255, 255, 255, 0.32);
  border-radius: 999px;
  color: #fff;
  background: rgba(15, 23, 42, 0.3);
  cursor: pointer;
  font-size: 30px;
  line-height: 1;
}

.home-search-panel {
  margin-top: -38px;
  position: relative;
  z-index: 8;
}

.search-shell {
  padding: 28px;
  border: 1px solid rgba(226, 232, 240, 0.8);
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: var(--shadow);
}

.search-shell h2 {
  margin: 0 0 18px;
  font-size: 26px;
}

.search-shell form {
  display: flex;
  gap: 12px;
}

.search-shell input {
  flex: 1;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 14px 18px;
  outline: 0;
}

.search-shell button {
  border: 0;
  border-radius: 999px;
  padding: 0 24px;
  color: #fff;
  background: var(--sky);
  cursor: pointer;
}

.quick-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 18px;
}

.quick-categories a {
  padding: 8px 12px;
  border-radius: 999px;
  color: #075985;
  background: var(--sky-soft);
}

.section-block {
  padding: 64px 0 0;
}

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

.section-title span,
.rank-copy span,
.page-hero span {
  display: inline-block;
  margin-bottom: 8px;
  color: var(--sky);
  font-weight: 800;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.section-title h2,
.rank-copy h2,
.page-hero h1 {
  margin: 0;
  color: var(--text);
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.16;
  letter-spacing: -0.04em;
}

.section-title a {
  color: var(--sky);
  font-weight: 700;
}

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(226, 232, 240, 0.88);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.card-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, #dbeafe, #f0f9ff);
}

.card-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.card-cover::after {
  position: absolute;
  inset: 0;
  content: "";
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.55), transparent 60%);
  opacity: 0;
  transition: opacity 0.25s ease;
}

.movie-card:hover .card-cover::after {
  opacity: 1;
}

.card-duration,
.card-badge {
  position: absolute;
  z-index: 2;
  padding: 5px 8px;
  border-radius: 8px;
  color: #fff;
  font-size: 12px;
  background: rgba(15, 23, 42, 0.72);
}

.card-duration {
  right: 10px;
  bottom: 10px;
}

.card-badge {
  top: 10px;
  left: 10px;
  background: rgba(2, 132, 199, 0.88);
}

.card-play {
  position: absolute;
  z-index: 3;
  top: 50%;
  left: 50%;
  display: grid;
  width: 54px;
  height: 54px;
  place-items: center;
  border-radius: 999px;
  color: var(--sky);
  background: rgba(255, 255, 255, 0.92);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.92);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

.card-body {
  padding: 16px;
}

.card-body h2 {
  margin: 0 0 8px;
  font-size: 18px;
  line-height: 1.3;
}

.card-body h2 a:hover {
  color: var(--sky);
}

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

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: #475569;
  font-size: 13px;
}

.card-meta span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
}

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

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

.category-card {
  overflow: hidden;
  border: 1px solid rgba(186, 230, 253, 0.8);
  border-radius: 22px;
  background: linear-gradient(135deg, #fff, #eff6ff);
  box-shadow: 0 10px 24px rgba(2, 132, 199, 0.08);
}

.category-card-main {
  display: block;
  padding: 22px;
}

.category-card-main span {
  display: block;
  margin-bottom: 8px;
  color: var(--sky-dark);
  font-size: 22px;
  font-weight: 800;
}

.category-card-main strong {
  display: block;
  color: #475569;
  font-weight: 500;
}

.category-samples {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding: 0 22px 22px;
}

.category-samples a {
  padding: 6px 9px;
  border-radius: 999px;
  color: #0369a1;
  font-size: 13px;
  background: #e0f2fe;
}

.rank-panel {
  margin-top: 64px;
  padding: 66px 0;
  background: linear-gradient(135deg, #0f172a, #075985);
}

.rank-layout,
.rank-hero-layout {
  display: grid;
  grid-template-columns: 0.9fr 1.1fr;
  gap: 36px;
  align-items: center;
}

.rank-copy h2,
.rank-copy p {
  color: #fff;
}

.rank-copy p {
  max-width: 460px;
  color: #cbd5e1;
}

.rank-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
}

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

.compact-card {
  display: flex;
  align-items: center;
  gap: 12px;
  min-height: 86px;
  padding: 10px;
  border: 1px solid rgba(226, 232, 240, 0.5);
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.94);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.compact-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 16px 35px rgba(15, 23, 42, 0.16);
}

.compact-card img {
  width: 82px;
  height: 62px;
  flex: 0 0 82px;
  border-radius: 12px;
  object-fit: cover;
  background: #e2e8f0;
}

.compact-card strong,
.compact-card em {
  display: block;
}

.compact-card strong {
  margin-bottom: 3px;
  line-height: 1.25;
}

.compact-card em {
  color: var(--muted);
  font-style: normal;
  font-size: 13px;
}

.rank-num {
  display: grid;
  width: 28px;
  height: 28px;
  flex: 0 0 28px;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: var(--gold);
  font-weight: 800;
}

.page-hero {
  padding: 86px 0 64px;
  background:
    radial-gradient(circle at 20% 20%, rgba(14, 165, 233, 0.24), transparent 34%),
    linear-gradient(135deg, #eff6ff, #fff);
}

.page-hero p {
  max-width: 760px;
  margin: 16px 0 0;
  color: var(--muted);
  font-size: 18px;
}

.category-hero,
.rank-hero {
  color: #fff;
  background:
    radial-gradient(circle at 20% 20%, rgba(125, 211, 252, 0.3), transparent 35%),
    linear-gradient(135deg, #0f172a, #075985);
}

.category-hero h1,
.category-hero p,
.rank-hero h1,
.rank-hero p {
  color: #fff;
}

.hero-mini-list {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 12px;
  margin-top: 28px;
}

.filter-bar {
  display: grid;
  grid-template-columns: 2fr repeat(3, 1fr);
  gap: 12px;
  margin-bottom: 24px;
  padding: 18px;
  border: 1px solid var(--line);
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.05);
}

.filter-bar input,
.filter-bar select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 12px 14px;
  outline: 0;
  background: #fff;
}

.filter-bar input:focus,
.filter-bar select:focus {
  border-color: var(--sky);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.12);
}

.empty-state {
  display: none;
  padding: 34px;
  border-radius: 18px;
  color: var(--muted);
  text-align: center;
  background: #fff;
}

.empty-state.show {
  display: block;
}

.detail-hero {
  padding: 38px 0 62px;
  color: #fff;
  background:
    radial-gradient(circle at 20% 20%, rgba(14, 165, 233, 0.28), transparent 36%),
    linear-gradient(135deg, #0f172a, #075985);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin-bottom: 28px;
  color: #cbd5e1;
  font-size: 14px;
}

.breadcrumb a:hover {
  color: #fff;
}

.detail-layout {
  display: grid;
  grid-template-columns: 320px 1fr;
  gap: 38px;
  align-items: center;
}

.detail-poster {
  overflow: hidden;
  border-radius: 24px;
  box-shadow: 0 24px 58px rgba(0, 0, 0, 0.34);
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  background: #e2e8f0;
}

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

.detail-line {
  max-width: 780px;
  margin: 0 0 22px;
  color: #dbeafe;
  font-size: 20px;
}

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

.detail-meta span {
  padding: 7px 12px;
  border-radius: 999px;
  color: #e0f2fe;
  background: rgba(255, 255, 255, 0.12);
}

.player-section {
  padding: 62px 0 0;
}

.player-section h2 {
  margin: 0 0 18px;
  font-size: 28px;
}

.player-card {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: #020617;
  box-shadow: var(--shadow);
}

.video-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #020617;
}

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  color: #fff;
  background: rgba(2, 6, 23, 0.42);
  cursor: pointer;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-icon {
  display: grid;
  width: 82px;
  height: 82px;
  place-items: center;
  border-radius: 999px;
  color: var(--sky);
  background: rgba(255, 255, 255, 0.94);
  font-size: 32px;
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.24);
}

.detail-text {
  max-width: 930px;
}

.detail-text h2 {
  margin: 0 0 14px;
  font-size: 28px;
}

.detail-text p {
  margin: 0 0 28px;
  color: #334155;
  font-size: 18px;
}

.rank-feature {
  display: block;
  overflow: hidden;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: var(--shadow);
}

.rank-feature img {
  width: 100%;
  aspect-ratio: 16 / 9;
  object-fit: cover;
}

.rank-feature strong,
.rank-feature span {
  display: block;
  padding: 0 22px;
}

.rank-feature strong {
  padding-top: 20px;
  color: var(--text);
  font-size: 26px;
}

.rank-feature span {
  padding-bottom: 22px;
  color: var(--muted);
}

.site-footer {
  margin-top: 76px;
  padding-top: 48px;
  color: #cbd5e1;
  background: #0f172a;
}

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

.footer-brand {
  margin-bottom: 14px;
  color: #fff;
  font-size: 22px;
}

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

.site-footer p {
  margin: 0;
  color: #94a3b8;
}

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

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

.site-footer a:hover {
  color: #7dd3fc;
}

.footer-bottom {
  margin-top: 42px;
  padding: 18px;
  border-top: 1px solid rgba(148, 163, 184, 0.18);
  color: #94a3b8;
  text-align: center;
}

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

  .menu-toggle {
    display: block;
  }

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

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

  .rank-layout,
  .rank-hero-layout,
  .detail-layout {
    grid-template-columns: 1fr;
  }

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

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

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

  .hero-slider {
    height: 560px;
  }

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

  .hero-copy p {
    font-size: 17px;
  }

  .hero-controls {
    align-items: flex-start;
    flex-direction: column;
    gap: 14px;
  }

  .search-shell form,
  .hero-actions,
  .detail-actions {
    flex-direction: column;
  }

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

  .movie-grid,
  .category-grid,
  .category-grid.wide,
  .rank-list,
  .rank-list.expanded,
  .hero-mini-list,
  .footer-grid,
  .filter-bar {
    grid-template-columns: 1fr;
  }

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

  .compact-card img {
    width: 76px;
    height: 58px;
    flex-basis: 76px;
  }

  .detail-hero,
  .page-hero {
    padding: 42px 0;
  }
}
