* {
  box-sizing: border-box;
}

:root {
  --bg: #f5f7fb;
  --panel: #ffffff;
  --panel-soft: #f8fafc;
  --text: #111827;
  --muted: #64748b;
  --line: #e5e7eb;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #06b6d4;
  --dark: #0f172a;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
  --radius: 18px;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  background: var(--bg);
  color: var(--text);
  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.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.85);
}

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

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: var(--dark);
}

.brand-mark {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 12px 25px rgba(37, 99, 235, 0.25);
}

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

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

.nav-link,
.mobile-nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: #334155;
  font-weight: 650;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

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

.nav-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  cursor: pointer;
}

.nav-toggle span {
  display: block;
  width: 18px;
  height: 2px;
  margin: 4px auto;
  background: #0f172a;
  border-radius: 999px;
}

.mobile-nav {
  display: none;
  padding: 8px 20px 18px;
  border-top: 1px solid var(--line);
}

.mobile-nav.is-open {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.hero-carousel {
  position: relative;
  min-height: 70vh;
  overflow: hidden;
  background: #020617;
}

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

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

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

.hero-overlay {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 80% 30%, rgba(37, 99, 235, 0.25), transparent 28%),
    linear-gradient(90deg, rgba(2, 6, 23, 0.88) 0%, rgba(2, 6, 23, 0.62) 46%, rgba(2, 6, 23, 0.12) 100%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 40px));
  margin: 0 auto;
  min-height: 70vh;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  color: #ffffff;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.12);
  color: #60a5fa;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.hero-content h1 {
  max-width: 760px;
  margin: 18px 0 16px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.05em;
}

.hero-content p {
  max-width: 680px;
  margin: 0 0 28px;
  color: #dbeafe;
  font-size: clamp(17px, 2vw, 22px);
}

.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 22px;
  border-radius: 12px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.primary-button {
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.35);
}

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

.ghost-button.dark {
  color: var(--dark);
  border-color: var(--line);
  background: #ffffff;
}

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

.small-actions {
  margin-top: 22px;
}

.hero-search {
  position: absolute;
  left: 50%;
  bottom: 42px;
  z-index: 4;
  width: min(680px, calc(100% - 40px));
  transform: translateX(-50%);
}

.hero-search form {
  display: flex;
  gap: 10px;
  padding: 10px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(18px);
  box-shadow: var(--shadow);
}

.hero-search input {
  flex: 1;
  min-width: 0;
  height: 46px;
  padding: 0 16px;
  border: 0;
  outline: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.94);
  color: var(--dark);
}

.hero-search button {
  min-width: 92px;
  border: 0;
  border-radius: 12px;
  color: #ffffff;
  background: var(--primary);
  font-weight: 800;
  cursor: pointer;
}

.hero-dots {
  position: absolute;
  right: 42px;
  bottom: 52px;
  z-index: 5;
  display: flex;
  gap: 10px;
}

.hero-dot {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.55);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.is-active {
  width: 34px;
  background: #ffffff;
}

.content-section {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 56px 0 0;
}

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

.section-heading h2 {
  margin: 0;
  font-size: clamp(26px, 3vw, 36px);
  line-height: 1.15;
  font-weight: 900;
  color: var(--dark);
  letter-spacing: -0.03em;
}

.section-heading p {
  margin: 8px 0 0;
  color: var(--muted);
}

.section-more {
  flex: 0 0 auto;
  color: var(--primary);
  font-weight: 800;
}

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

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

.compact-grid,
.latest-grid,
.search-grid,
.ranking-grid {
  grid-template-columns: repeat(6, minmax(0, 1fr));
}

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

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(37, 99, 235, 0.3);
  box-shadow: var(--shadow);
}

.card-cover {
  position: relative;
  display: block;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
}

.compact-card .card-cover {
  aspect-ratio: 16 / 10;
}

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

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

.card-cover::after {
  content: "";
  position: absolute;
  inset: auto 0 0;
  height: 54%;
  background: linear-gradient(180deg, transparent, rgba(2, 6, 23, 0.78));
}

.card-play {
  position: absolute;
  right: 12px;
  bottom: 12px;
  z-index: 2;
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(37, 99, 235, 0.92);
  box-shadow: 0 10px 24px rgba(37, 99, 235, 0.3);
}

.rank-badge {
  position: absolute;
  left: 10px;
  top: 10px;
  z-index: 3;
  min-width: 34px;
  height: 28px;
  padding: 0 10px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(15, 23, 42, 0.78);
  font-weight: 900;
}

.card-body {
  padding: 14px;
}

.card-body h3 {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 850;
  color: var(--dark);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.card-body h3 a:hover {
  color: var(--primary);
}

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

.card-meta,
.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: var(--muted);
  font-size: 12px;
}

.card-meta span,
.card-tags span,
.tag-row a {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f1f5f9;
}

.card-tags {
  margin-top: 10px;
}

.split-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 28px;
  align-items: start;
}

.ranking-panel,
.related-panel,
.text-panel,
.filter-panel,
.category-card,
.page-hero,
.detail-hero {
  border: 1px solid rgba(226, 232, 240, 0.88);
  border-radius: var(--radius);
  background: var(--panel);
  box-shadow: 0 14px 32px rgba(15, 23, 42, 0.06);
}

.ranking-panel {
  position: sticky;
  top: 88px;
  padding: 22px;
}

.ranking-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 16px;
}

.ranking-head h2 {
  margin: 0;
  font-size: 22px;
  font-weight: 900;
}

.ranking-head a {
  color: var(--primary);
  font-weight: 800;
}

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

.ranking-list a {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 12px;
  border-radius: 14px;
  background: var(--panel-soft);
  transition: background 0.2s ease, transform 0.2s ease;
}

.ranking-list a:hover {
  background: #eff6ff;
  transform: translateX(4px);
}

.ranking-list span {
  width: 28px;
  height: 28px;
  display: grid;
  place-items: center;
  border-radius: 9px;
  color: #ffffff;
  background: var(--primary);
  font-weight: 900;
}

.ranking-list strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-list em {
  color: #f97316;
  font-style: normal;
  font-weight: 850;
}

.category-area {
  width: min(1280px, calc(100% - 40px));
}

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

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

.category-card {
  overflow: hidden;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.category-card > a {
  display: block;
  min-height: 160px;
  padding: 24px;
  color: #ffffff;
  background:
    radial-gradient(circle at top right, rgba(6, 182, 212, 0.45), transparent 30%),
    linear-gradient(135deg, #0f172a, #1d4ed8);
}

.category-card span {
  display: inline-block;
  margin-bottom: 14px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 13px;
  font-weight: 800;
}

.category-card strong {
  display: block;
  font-size: 19px;
  line-height: 1.45;
}

.category-samples {
  display: grid;
  gap: 8px;
  padding: 16px 20px 20px;
}

.category-samples a {
  overflow: hidden;
  color: #475569;
  font-size: 14px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.category-samples a:hover {
  color: var(--primary);
}

.page-main,
.detail-main {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 34px 0 64px;
}

.page-hero {
  position: relative;
  overflow: hidden;
  padding: 46px;
  color: #ffffff;
  background:
    radial-gradient(circle at 80% 20%, rgba(6, 182, 212, 0.4), transparent 28%),
    linear-gradient(135deg, #0f172a, #1e3a8a 62%, #2563eb);
}

.page-hero h1 {
  max-width: 820px;
  margin: 16px 0 12px;
  font-size: clamp(34px, 4vw, 54px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.page-hero p {
  max-width: 780px;
  margin: 0;
  color: #dbeafe;
  font-size: 18px;
}

.slim-hero {
  min-height: 250px;
  display: flex;
  align-items: center;
}

.category-hero {
  min-height: 290px;
}

.filter-panel {
  width: min(1280px, calc(100% - 40px));
  margin: 26px auto 0;
  padding: 18px;
  display: grid;
  grid-template-columns: minmax(260px, 1.2fr) repeat(3, minmax(160px, 0.6fr));
  gap: 14px;
}

.filter-panel label {
  display: grid;
  gap: 7px;
  color: #334155;
  font-size: 13px;
  font-weight: 800;
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 12px;
  padding: 0 12px;
  background: #ffffff;
  color: var(--dark);
  outline: 0;
}

.filter-panel input:focus,
.filter-panel select:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.12);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-bottom: 24px;
  color: var(--muted);
  font-size: 14px;
}

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

.detail-hero {
  display: grid;
  grid-template-columns: 300px minmax(0, 1fr);
  gap: 32px;
  padding: 28px;
  align-items: stretch;
}

.detail-cover {
  overflow: hidden;
  border-radius: 18px;
  background: linear-gradient(135deg, #0f172a, #1d4ed8);
  box-shadow: var(--shadow);
}

.detail-cover img {
  width: 100%;
  height: 100%;
  min-height: 420px;
  object-fit: cover;
}

.detail-info h1 {
  margin: 18px 0 14px;
  font-size: clamp(34px, 4.5vw, 58px);
  line-height: 1.08;
  color: var(--dark);
  font-weight: 900;
  letter-spacing: -0.05em;
}

.detail-one-line {
  max-width: 800px;
  margin: 0 0 22px;
  color: #334155;
  font-size: 19px;
}

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

.meta-table div {
  padding: 13px 14px;
  border-radius: 14px;
  background: var(--panel-soft);
}

.meta-table dt {
  color: var(--muted);
  font-size: 13px;
}

.meta-table dd {
  margin: 3px 0 0;
  color: var(--dark);
  font-weight: 800;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 20px;
}

.tag-row a {
  color: #1e40af;
  background: #dbeafe;
  font-size: 13px;
  font-weight: 800;
}

.player-section {
  margin-top: 28px;
}

.player-section h2,
.related-panel h2,
.text-panel h2 {
  margin: 0 0 16px;
  color: var(--dark);
  font-size: 24px;
  font-weight: 900;
}

.player-box {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #020617;
  box-shadow: var(--shadow);
  aspect-ratio: 16 / 9;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.78));
  cursor: pointer;
}

.player-overlay.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.play-icon {
  width: 74px;
  height: 74px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 18px 36px rgba(37, 99, 235, 0.36);
  font-size: 28px;
  padding-left: 4px;
}

.player-overlay strong {
  font-size: 20px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 380px;
  gap: 28px;
  align-items: start;
  margin-top: 30px;
}

.detail-content {
  display: grid;
  gap: 22px;
}

.text-panel {
  padding: 26px;
}

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

.related-panel {
  position: sticky;
  top: 88px;
  padding: 22px;
}

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

.related-list .movie-card {
  display: grid;
  grid-template-columns: 130px minmax(0, 1fr);
}

.related-list .card-cover,
.related-list .compact-card .card-cover {
  height: 100%;
  aspect-ratio: auto;
}

.related-list .card-body p,
.related-list .card-tags {
  display: none;
}

.related-list .card-body h3 {
  font-size: 15px;
}

.site-footer {
  margin-top: 72px;
  color: #cbd5e1;
  background: #020617;
}

.footer-inner {
  width: min(1280px, calc(100% - 40px));
  margin: 0 auto;
  padding: 46px 0;
  display: grid;
  grid-template-columns: minmax(0, 1fr) 420px;
  gap: 32px;
}

.footer-logo {
  color: #ffffff;
}

.footer-brand p {
  max-width: 620px;
  margin: 18px 0 0;
  color: #94a3b8;
}

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

.footer-link-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.footer-link-grid a {
  color: #94a3b8;
}

.footer-link-grid a:hover {
  color: #ffffff;
}

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

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

@media (max-width: 1180px) {
  .movie-grid,
  .compact-grid,
  .latest-grid,
  .search-grid,
  .ranking-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

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

  .ranking-panel,
  .related-panel {
    position: static;
  }
}

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

  .nav-toggle {
    display: block;
  }

  .hero-content {
    min-height: 68vh;
    padding-bottom: 110px;
  }

  .hero-search {
    bottom: 26px;
  }

  .hero-dots {
    right: 22px;
    bottom: 104px;
  }

  .hero-search form {
    flex-direction: column;
  }

  .movie-grid,
  .featured-grid,
  .compact-grid,
  .latest-grid,
  .search-grid,
  .ranking-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .category-grid,
  .large-category-grid {
    grid-template-columns: 1fr;
  }

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

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

  .detail-cover img {
    min-height: auto;
  }

  .meta-table {
    grid-template-columns: 1fr;
  }

  .footer-inner {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .header-inner,
  .content-section,
  .page-main,
  .detail-main,
  .filter-panel,
  .footer-inner {
    width: calc(100% - 28px);
    padding-left: 0;
    padding-right: 0;
  }

  .header-inner {
    min-height: 62px;
  }

  .brand-name {
    font-size: 17px;
  }

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

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

  .page-hero {
    padding: 30px 22px;
  }

  .movie-grid,
  .featured-grid,
  .compact-grid,
  .latest-grid,
  .search-grid,
  .ranking-grid {
    grid-template-columns: 1fr;
  }

  .related-list .movie-card {
    grid-template-columns: 112px minmax(0, 1fr);
  }
}
