:root {
  --red: #dc2626;
  --red-dark: #b91c1c;
  --pink: #db2777;
  --blue: #2563eb;
  --purple: #7c3aed;
  --bg: #f9fafb;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --card: #ffffff;
  --dark: #111827;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --soft-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
  font: inherit;
}

.site-shell {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.main-space {
  padding: 32px 0 54px;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.95);
  box-shadow: 0 8px 26px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(12px);
}

.nav-row {
  display: flex;
  align-items: center;
  gap: 24px;
  min-height: 68px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  flex: 0 0 auto;
  color: var(--red);
  font-size: 25px;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--red), var(--pink));
  color: white;
  box-shadow: 0 14px 28px rgba(220, 38, 38, 0.28);
}

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

.desktop-nav a,
.mobile-menu a {
  color: #374151;
  font-weight: 700;
  transition: color 0.2s ease;
}

.desktop-nav a:hover,
.mobile-menu a:hover {
  color: var(--red);
}

.nav-search {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-left: 6px;
}

.nav-search input,
.mobile-menu input,
.search-panel input,
.filter-panel input,
.filter-panel select {
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.nav-search input:focus,
.mobile-menu input:focus,
.search-panel input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.1);
}

.nav-search button,
.mobile-menu button,
.search-panel button,
.filter-panel button {
  border: 0;
  border-radius: 12px;
  background: var(--red);
  color: white;
  padding: 10px 16px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, background 0.2s ease;
}

.nav-search button:hover,
.mobile-menu button:hover,
.search-panel button:hover,
.filter-panel button:hover {
  background: var(--red-dark);
  transform: translateY(-1px);
}

.mobile-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  border-radius: 12px;
  background: #f3f4f6;
  padding: 10px 13px;
  cursor: pointer;
}

.mobile-menu {
  display: none;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 18px;
  gap: 12px;
}

.mobile-menu.is-open {
  display: grid;
}

.mobile-menu form {
  display: flex;
  gap: 8px;
}

.hero {
  position: relative;
  overflow: hidden;
  min-height: 500px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
  background: #0f172a;
}

.hero-slide {
  display: none;
  position: absolute;
  inset: 0;
}

.hero-slide.is-active {
  display: block;
}

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

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.96), rgba(0, 0, 0, 0.48), rgba(0, 0, 0, 0.08));
}

.hero-copy {
  position: absolute;
  left: clamp(24px, 5vw, 64px);
  right: clamp(24px, 5vw, 64px);
  bottom: clamp(34px, 7vw, 74px);
  max-width: 780px;
  color: white;
}

.hero-kicker,
.card-badge,
.meta-pills span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: var(--red);
  color: #fff;
  padding: 5px 12px;
  font-size: 13px;
  font-weight: 800;
}

.hero-copy h1 {
  margin: 14px 0 10px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

.hero-copy p {
  max-width: 720px;
  margin: 0 0 18px;
  color: rgba(255, 255, 255, 0.86);
  font-size: clamp(16px, 2vw, 20px);
}

.hero-tags,
.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.hero-tags span,
.tag-row span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  padding: 5px 11px;
  font-size: 13px;
  font-weight: 700;
}

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

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

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

.btn-primary {
  background: var(--red);
  color: #fff;
}

.btn-primary:hover {
  background: var(--red-dark);
}

.btn-ghost {
  background: rgba(255, 255, 255, 0.18);
  color: white;
  backdrop-filter: blur(10px);
}

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

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

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

.search-panel,
.filter-panel,
.page-hero,
.detail-card,
.text-card,
.side-card,
.category-card {
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--soft-shadow);
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(280px, 460px);
  align-items: center;
  gap: 24px;
  margin: 28px 0 38px;
  padding: 26px;
}

.search-panel h2,
.filter-panel h2,
.section-head h2,
.page-hero h1,
.side-card h2,
.text-card h2 {
  margin: 0;
  letter-spacing: -0.04em;
}

.search-panel p,
.section-head p,
.page-hero p,
.category-card p,
.side-card p {
  margin: 6px 0 0;
  color: var(--muted);
}

.search-panel form {
  display: flex;
  gap: 10px;
}

.search-panel input {
  flex: 1;
}

.section {
  margin: 42px 0;
}

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

.section-head h2 {
  font-size: 28px;
}

.section-more {
  color: var(--red);
  font-weight: 900;
}

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

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

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

.movie-card {
  border-radius: 16px;
  background: #fff;
  overflow: hidden;
  box-shadow: var(--soft-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.card-media {
  position: relative;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, #111827, #4b5563);
}

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

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

.card-media::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.56), transparent 52%);
  opacity: 0.92;
}

.card-badge {
  position: absolute;
  top: 10px;
  left: 10px;
  z-index: 2;
  border-radius: 8px;
  padding: 4px 8px;
  font-size: 12px;
}

.card-time {
  position: absolute;
  right: 10px;
  bottom: 10px;
  z-index: 2;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.72);
  color: white;
  padding: 4px 8px;
  font-size: 12px;
  font-weight: 800;
}

.card-play {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: grid;
  place-items: center;
  color: white;
  font-size: 42px;
  opacity: 0;
  background: rgba(0, 0, 0, 0.28);
  transition: opacity 0.2s ease;
}

.movie-card:hover .card-play {
  opacity: 1;
}

.card-body {
  padding: 13px;
}

.card-body h3 {
  display: -webkit-box;
  min-height: 44px;
  margin: 0 0 8px;
  overflow: hidden;
  color: var(--text);
  font-size: 15px;
  line-height: 1.45;
  font-weight: 900;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-desc {
  display: -webkit-box;
  min-height: 42px;
  margin: 0 0 10px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-meta {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.card-meta span:first-child,
.rank-score {
  color: #f59e0b;
}

.movie-card-large .card-media {
  aspect-ratio: 16 / 10;
}

.movie-card-large .card-body h3 {
  font-size: 18px;
}

.movie-card-large .tag-row span {
  background: #f3f4f6;
  color: #4b5563;
}

.movie-card-compact .card-media {
  aspect-ratio: 2 / 3;
}

.gradient-section-inner .movie-card,
.accent-section .movie-card {
  background: rgba(255, 255, 255, 0.16);
  box-shadow: none;
}

.accent-section {
  padding: 26px;
  border-radius: var(--radius);
  background: linear-gradient(135deg, var(--pink), var(--red));
}

.page-hero {
  margin-bottom: 28px;
  padding: clamp(28px, 5vw, 48px);
}

.page-hero h1 {
  font-size: clamp(34px, 5vw, 52px);
}

.page-hero-red {
  background: linear-gradient(135deg, var(--red), var(--pink));
  color: white;
}

.page-hero-red p {
  color: rgba(255, 255, 255, 0.86);
}

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

.category-card {
  padding: 22px;
}

.category-card > a span {
  color: var(--red);
  font-size: 22px;
  font-weight: 900;
}

.category-preview {
  display: grid;
  gap: 7px;
  margin-top: 16px;
}

.category-preview a {
  color: #374151;
  font-weight: 700;
}

.category-preview a:hover {
  color: var(--red);
}

.filter-panel {
  margin-bottom: 24px;
  padding: 22px;
}

.filter-panel form {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 180px 110px;
  gap: 10px;
  margin-top: 14px;
}

.empty-result {
  display: none;
  margin: 18px 0 0;
  color: var(--muted);
  font-weight: 700;
}

.empty-result.is-visible {
  display: block;
}

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

.rank-list-page {
  grid-template-columns: 1fr;
}

.rank-item {
  display: grid;
  grid-template-columns: 42px 72px minmax(0, 1fr) 52px;
  align-items: center;
  gap: 13px;
  border-radius: 16px;
  background: #fff;
  padding: 10px;
  box-shadow: var(--soft-shadow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.rank-num {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--red), var(--pink));
  color: white;
  font-weight: 900;
}

.rank-item img {
  width: 72px;
  height: 48px;
  border-radius: 10px;
  object-fit: cover;
  background: #111827;
}

.rank-info {
  display: grid;
  min-width: 0;
}

.rank-info strong {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 900;
}

.rank-info em {
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-score {
  justify-self: end;
  font-weight: 900;
}

.crumbs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--muted);
  font-weight: 700;
}

.crumbs a:hover {
  color: var(--red);
}

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

.detail-main {
  min-width: 0;
}

.player {
  overflow: hidden;
  border-radius: var(--radius);
  background: #000;
  box-shadow: var(--shadow);
}

.video-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000;
}

.video-frame video {
  width: 100%;
  height: 100%;
  object-fit: contain;
}

.player-veil {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 8px;
  border: 0;
  background: rgba(0, 0, 0, 0.42);
  color: #fff;
  cursor: pointer;
  font-size: 18px;
  font-weight: 900;
  transition: opacity 0.2s ease;
}

.play-icon {
  display: grid;
  place-items: center;
  width: 74px;
  height: 74px;
  border-radius: 999px;
  background: var(--red);
  box-shadow: 0 18px 38px rgba(220, 38, 38, 0.32);
  font-size: 30px;
}

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

.detail-card {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 24px;
  margin-top: 22px;
  padding: 24px;
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  object-fit: cover;
  background: #111827;
}

.detail-info h1 {
  margin: 14px 0 10px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.12;
  letter-spacing: -0.05em;
}

.lead-text {
  color: #374151;
  font-size: 17px;
}

.meta-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.meta-pills span {
  background: #fef2f2;
  color: var(--red);
}

.detail-info .tag-row span {
  background: #f3f4f6;
  color: #4b5563;
}

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

.detail-data div {
  border-radius: 14px;
  background: #f9fafb;
  padding: 12px;
}

.detail-data dt {
  color: var(--muted);
  font-size: 12px;
  font-weight: 800;
}

.detail-data dd {
  margin: 4px 0 0;
  font-weight: 900;
}

.text-card {
  margin-top: 22px;
  padding: 24px;
}

.text-card h2 {
  margin-bottom: 10px;
  font-size: 24px;
}

.text-card p {
  margin: 0;
  color: #374151;
  font-size: 16px;
}

.detail-side {
  display: grid;
  align-content: start;
  gap: 20px;
}

.side-card {
  padding: 20px;
}

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

.related-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
  border-radius: 14px;
  padding: 8px;
  transition: background 0.2s ease;
}

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

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

.related-item strong {
  display: -webkit-box;
  overflow: hidden;
  color: var(--text);
  font-size: 14px;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.related-item em {
  display: block;
  margin-top: 4px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

.side-gradient {
  background: linear-gradient(135deg, var(--red), var(--pink));
  color: white;
}

.side-gradient p {
  color: rgba(255, 255, 255, 0.86);
}

.side-gradient a {
  display: inline-flex;
  margin-top: 16px;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  padding: 10px 16px;
  font-weight: 900;
}

.site-footer {
  margin-top: 38px;
  background: #111827;
  color: #fff;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 36px;
  padding: 46px 0;
}

.site-footer h2,
.site-footer h3 {
  margin: 0 0 12px;
}

.site-footer h2 {
  color: #f87171;
}

.site-footer p,
.footer-links a,
.footer-bottom {
  color: #9ca3af;
}

.footer-links {
  display: grid;
  gap: 8px;
}

.footer-links a:hover {
  color: white;
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  padding: 18px;
  text-align: center;
}

[data-movie-card].is-hidden {
  display: none;
}

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

  .mobile-toggle {
    display: inline-flex;
  }

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

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

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

@media (max-width: 760px) {
  .site-shell {
    width: min(100% - 24px, 1280px);
  }

  .brand {
    font-size: 21px;
  }

  .hero {
    min-height: 560px;
  }

  .search-panel,
  .filter-panel form,
  .detail-card,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .search-panel form,
  .mobile-menu form {
    flex-direction: column;
  }

  .movie-grid,
  .movie-grid-four,
  .movie-grid-eight {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
  }

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

  .rank-item {
    grid-template-columns: 34px 64px minmax(0, 1fr) 44px;
    gap: 9px;
  }

  .rank-item img {
    width: 64px;
    height: 44px;
  }

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

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