:root {
  color-scheme: light;
  --bg: #f8fafc;
  --card: #ffffff;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --blue: #2563eb;
  --emerald: #059669;
  --rose: #e11d48;
  --teal: #0f766e;
  --dark: #0f172a;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --soft-shadow: 0 10px 26px rgba(15, 23, 42, 0.08);
}

* {
  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: 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: 100;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(18px);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.08);
}

.topbar {
  max-width: 1280px;
  height: 64px;
  margin: 0 auto;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
}

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

.logo {
  font-size: 24px;
  color: #1f2937;
}

.logo-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(135deg, #2563eb, #06b6d4);
  color: #ffffff;
  font-size: 18px;
  box-shadow: 0 10px 20px rgba(37, 99, 235, 0.28);
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 26px;
  color: #4b5563;
  font-weight: 700;
}

.main-nav a,
.category-bar a,
.mobile-nav a {
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: var(--blue);
}

.menu-toggle {
  display: none;
  border: 0;
  background: #f3f4f6;
  color: #374151;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
}

.category-bar {
  border-top: 1px solid var(--line);
  background: #f9fafb;
  display: flex;
  gap: 18px;
  overflow-x: auto;
  max-width: 100%;
  padding: 10px max(20px, calc((100vw - 1280px) / 2 + 20px));
}

.category-bar a {
  white-space: nowrap;
  padding: 6px 12px;
  border-radius: 999px;
  color: #4b5563;
  font-size: 14px;
  font-weight: 700;
}

.category-bar a:hover {
  background: #e5e7eb;
  color: var(--blue);
}

.mobile-nav {
  display: none;
  padding: 12px 20px 18px;
  border-top: 1px solid var(--line);
  flex-direction: column;
  gap: 10px;
  font-weight: 700;
  color: #4b5563;
}

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

.hero {
  position: relative;
  height: 600px;
  overflow: hidden;
  background: linear-gradient(120deg, #0f172a, #334155);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.9s ease, visibility 0.9s ease;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
}

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.1));
}

.hero-content {
  position: absolute;
  left: 50%;
  right: auto;
  bottom: 0;
  width: min(1280px, 100%);
  transform: translateX(-50%);
  padding: 72px 20px 80px;
  color: #ffffff;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.88);
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 18px;
}

.hero h1,
.hero h2 {
  margin: 0 0 16px;
  max-width: 760px;
  font-size: clamp(36px, 6vw, 58px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.hero p {
  margin: 0 0 24px;
  max-width: 720px;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(17px, 2vw, 22px);
}

.hero-meta,
.detail-meta,
.movie-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
}

.hero-meta {
  margin-bottom: 28px;
}

.hero-meta span,
.detail-meta span {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-weight: 700;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  border-radius: 12px;
  padding: 0 20px;
  background: #ffffff;
  color: #111827;
  font-weight: 800;
  box-shadow: 0 16px 30px rgba(0, 0, 0, 0.18);
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 22px 40px rgba(0, 0, 0, 0.22);
}

.btn.primary {
  background: var(--emerald);
  color: #ffffff;
}

.btn.blue {
  background: var(--blue);
  color: #ffffff;
}

.btn.ghost {
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  box-shadow: none;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 30px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

.hero-dots button {
  width: 12px;
  height: 12px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.52);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dots button.active {
  width: 34px;
  background: #ffffff;
}

.section {
  padding: 70px 20px;
}

.section.white {
  background: #ffffff;
}

.section.tint {
  background: linear-gradient(135deg, #ecfeff, #f0fdf4);
}

.section.dark {
  background: #0f172a;
  color: #ffffff;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
}

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

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0 0 8px;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.2;
  color: #1f2937;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.dark .section-title {
  color: #ffffff;
}

.section-desc {
  margin: 0;
  color: var(--muted);
  max-width: 760px;
}

.dark .section-desc {
  color: rgba(255, 255, 255, 0.72);
}

.grid {
  display: grid;
  gap: 24px;
}

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

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

.movie-card {
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--soft-shadow);
  border: 1px solid rgba(226, 232, 240, 0.8);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: #111827;
}

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

.movie-card.compact img {
  height: 170px;
}

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

.year-badge,
.play-hover {
  position: absolute;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.year-badge {
  top: 10px;
  right: 10px;
  min-width: 58px;
  height: 28px;
  padding: 0 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.68);
  color: #ffffff;
  font-size: 13px;
  font-weight: 800;
}

.play-hover {
  inset: 0;
  margin: auto;
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: var(--rose);
  font-size: 25px;
  opacity: 0;
  transform: scale(0.88);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

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

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

.movie-card h3 {
  margin: 0 0 8px;
  color: #1f2937;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 800;
}

.movie-card h3 a:hover {
  color: var(--rose);
}

.movie-card p {
  min-height: 46px;
  margin: 0 0 12px;
  color: #6b7280;
  font-size: 14px;
}

.movie-meta {
  justify-content: space-between;
  color: #6b7280;
  font-size: 13px;
  margin-bottom: 12px;
}

.movie-meta span:last-child {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f3f4f6;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.tag-row span {
  padding: 4px 8px;
  border-radius: 999px;
  background: #f8fafc;
  color: #64748b;
  font-size: 12px;
}

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

.category-card {
  display: block;
  padding: 24px;
  border-radius: 20px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.95);
  box-shadow: var(--soft-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.category-card strong {
  display: block;
  margin-bottom: 8px;
  color: #1f2937;
  font-size: 22px;
}

.category-card p {
  margin: 0 0 14px;
  color: #6b7280;
}

.category-card span {
  color: var(--blue);
  font-weight: 800;
}

.filter-panel {
  display: grid;
  grid-template-columns: 2fr repeat(4, minmax(140px, 1fr));
  gap: 12px;
  padding: 16px;
  margin-bottom: 28px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  box-shadow: var(--soft-shadow);
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #f9fafb;
  color: #111827;
  padding: 12px 13px;
  outline: none;
}

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

.empty-result {
  display: none;
  padding: 30px;
  margin-bottom: 24px;
  text-align: center;
  border-radius: 18px;
  background: #ffffff;
  color: #6b7280;
  border: 1px solid var(--line);
}

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

.rank-list {
  display: grid;
  gap: 12px;
  list-style: none;
  margin: 0;
  padding: 0;
}

.rank-item a {
  display: grid;
  grid-template-columns: 54px 96px 1fr auto;
  align-items: center;
  gap: 16px;
  padding: 12px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(226, 232, 240, 0.9);
  box-shadow: 0 8px 18px rgba(15, 23, 42, 0.06);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-item a:hover {
  transform: translateX(4px);
  box-shadow: var(--soft-shadow);
}

.rank-no {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  background: linear-gradient(135deg, #e11d48, #f97316);
  color: #ffffff;
  font-weight: 900;
}

.rank-item img {
  width: 96px;
  height: 62px;
  object-fit: cover;
  border-radius: 12px;
}

.rank-info strong,
.rank-info em {
  display: block;
}

.rank-info strong {
  color: #1f2937;
  font-size: 17px;
}

.rank-info em {
  color: #6b7280;
  font-size: 13px;
  font-style: normal;
}

.rank-play {
  padding: 8px 14px;
  border-radius: 999px;
  background: #ecfdf5;
  color: #047857;
  font-weight: 800;
}

.breadcrumb {
  margin-bottom: 18px;
  color: #6b7280;
  font-size: 14px;
}

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

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(320px, 0.9fr);
  gap: 28px;
}

.player-card,
.detail-card,
.side-card {
  background: #ffffff;
  border-radius: 20px;
  box-shadow: var(--soft-shadow);
  border: 1px solid rgba(226, 232, 240, 0.9);
  overflow: hidden;
}

.movie-player {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.movie-player video {
  width: 100%;
  height: 100%;
  display: block;
  background: #000000;
  cursor: pointer;
}

.player-button {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 4;
  transform: translate(-50%, -50%);
  width: 86px;
  height: 86px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.93);
  color: var(--rose);
  font-size: 34px;
  cursor: pointer;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
  transition: transform 0.2s ease, opacity 0.2s ease;
}

.player-button:hover {
  transform: translate(-50%, -50%) scale(1.06);
}

.movie-player.is-playing .player-button {
  opacity: 0;
  pointer-events: none;
}

.detail-card {
  padding: 26px;
  margin-top: 22px;
}

.detail-card h1 {
  margin: 0 0 10px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.14;
  font-weight: 900;
  color: #111827;
}

.detail-lead {
  margin: 0 0 22px;
  color: #4b5563;
  font-size: 18px;
}

.detail-meta span {
  background: #eff6ff;
  color: #1d4ed8;
}

.content-block {
  border-top: 1px solid var(--line);
  padding-top: 20px;
  margin-top: 20px;
}

.content-block h2 {
  margin: 0 0 12px;
  font-size: 22px;
  color: #111827;
}

.content-block p {
  margin: 0;
  color: #374151;
}

.side-card {
  padding: 20px;
}

.side-card h2 {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 900;
}

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

.related-item {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
  transition: background 0.2s ease;
}

.related-item:hover {
  background: #f8fafc;
}

.related-item img {
  width: 112px;
  height: 72px;
  object-fit: cover;
  border-radius: 12px;
}

.related-item strong,
.related-item span {
  display: block;
}

.related-item strong {
  color: #1f2937;
  line-height: 1.35;
}

.related-item span {
  margin-top: 4px;
  color: #6b7280;
  font-size: 13px;
}

.site-footer {
  background: #111827;
  color: #d1d5db;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 54px 20px 32px;
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 34px;
}

.footer-logo {
  color: #ffffff;
  font-size: 21px;
  margin-bottom: 14px;
}

.site-footer h3 {
  margin: 0 0 14px;
  color: #ffffff;
}

.site-footer p,
.site-footer ul {
  margin: 0;
  padding: 0;
  color: #9ca3af;
}

.site-footer ul {
  list-style: none;
  display: grid;
  gap: 8px;
}

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

.copyright {
  max-width: 1280px;
  margin: 0 auto;
  padding: 22px 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  color: #9ca3af;
  font-size: 14px;
}

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

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

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

@media (max-width: 768px) {
  .main-nav,
  .category-bar {
    display: none;
  }

  .menu-toggle {
    display: inline-grid;
    place-items: center;
  }

  .hero {
    height: 560px;
  }

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

  .section {
    padding: 52px 16px;
  }

  .section-head {
    display: block;
  }

  .grid.cards-4,
  .grid.cards-3,
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

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

  .rank-item a {
    grid-template-columns: 44px 76px 1fr;
  }

  .rank-play {
    display: none;
  }

  .rank-item img {
    width: 76px;
    height: 54px;
  }
}

@media (max-width: 520px) {
  .topbar {
    padding: 0 14px;
  }

  .logo {
    font-size: 20px;
  }

  .hero {
    height: 520px;
  }

  .hero-meta span {
    padding: 6px 10px;
    font-size: 13px;
  }

  .grid.cards-4,
  .grid.cards-3,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .movie-card img {
    height: 220px;
  }

  .related-item {
    grid-template-columns: 96px 1fr;
  }

  .related-item img {
    width: 96px;
    height: 64px;
  }
}
