:root {
  --red: #ef4444;
  --pink: #ec4899;
  --orange: #f97316;
  --purple: #8b5cf6;
  --indigo: #4338ca;
  --blue: #2563eb;
  --teal: #14b8a6;
  --yellow: #f59e0b;
  --green: #10b981;
  --dark: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --soft: #f8fafc;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.08);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: linear-gradient(180deg, #fff7ed 0, #f8fafc 340px, #f5f7fb 100%);
  color: #1f2937;
  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%;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, var(--red), var(--pink), var(--orange));
  box-shadow: 0 12px 30px rgba(236, 72, 153, 0.28);
}

.nav-wrap {
  width: min(1180px, calc(100% - 32px));
  height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 26px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: #fff;
  font-size: 23px;
  font-weight: 900;
  letter-spacing: -0.03em;
  text-shadow: 0 4px 16px rgba(0, 0, 0, 0.22);
  white-space: nowrap;
}

.logo-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.2);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.28);
  font-size: 16px;
}

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

.nav-link {
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
  transition: color 0.2s ease, transform 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: #fef3c7;
  transform: translateY(-1px);
}

.nav-search-form,
.mobile-search-form {
  display: flex;
  align-items: center;
  gap: 8px;
}

.nav-search-input {
  width: 230px;
  height: 40px;
  border: 0;
  border-radius: 999px;
  padding: 0 16px;
  outline: 0;
  background: rgba(255, 255, 255, 0.92);
  color: #374151;
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.4);
}

.nav-search-input:focus {
  box-shadow: 0 0 0 3px rgba(255, 255, 255, 0.32);
}

.nav-search-button,
.button-primary,
.button-secondary {
  border: 0;
  cursor: pointer;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.nav-search-button {
  height: 40px;
  padding: 0 16px;
  color: #fff;
  background: rgba(17, 24, 39, 0.28);
}

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

.menu-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: #fff;
  font-size: 28px;
  cursor: pointer;
}

.mobile-panel {
  display: none;
  padding: 14px 18px 18px;
  background: rgba(255, 255, 255, 0.96);
  border-top: 1px solid rgba(255, 255, 255, 0.4);
}

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

.mobile-search-form {
  margin-bottom: 12px;
}

.mobile-search-form .nav-search-input {
  width: 100%;
  background: #f3f4f6;
}

.mobile-nav-link {
  display: block;
  padding: 10px 4px;
  color: #4b5563;
  font-weight: 700;
}

.mobile-nav-link.active {
  color: var(--pink);
}

.hero-carousel {
  position: relative;
  height: 600px;
  overflow: hidden;
  background: #111827;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  visibility: hidden;
  background-position: center;
  background-size: cover;
  transform: scale(1.03);
  transition: opacity 0.8s ease, visibility 0.8s ease, transform 1.1s ease;
}

.hero-slide.is-active {
  opacity: 1;
  visibility: visible;
  transform: scale(1);
}

.hero-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.56) 46%, rgba(0, 0, 0, 0.18) 100%);
}

.hero-inner {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  align-items: flex-end;
  padding-bottom: 76px;
}

.hero-content {
  max-width: 760px;
  color: #fff;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 14px;
  padding: 6px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fde68a;
  font-weight: 800;
  backdrop-filter: blur(10px);
}

.hero-content h1 {
  margin: 0 0 14px;
  font-size: clamp(38px, 6vw, 70px);
  line-height: 1.02;
  font-weight: 950;
  letter-spacing: -0.05em;
  text-shadow: 0 10px 30px rgba(0, 0, 0, 0.35);
}

.hero-content p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 18px;
  max-width: 650px;
}

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

.hero-meta {
  margin: 24px 0 30px;
  color: rgba(255, 255, 255, 0.92);
  font-weight: 700;
}

.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
}

.button-primary {
  color: #fff;
  background: linear-gradient(90deg, var(--pink), var(--purple));
  box-shadow: 0 14px 28px rgba(139, 92, 246, 0.3);
}

.button-secondary {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.2);
}

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

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 28px;
  transform: translateX(-50%);
  z-index: 4;
  display: flex;
  align-items: center;
  gap: 10px;
}

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

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

.page-shell,
.home-sections {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
}

.home-sections {
  padding: 44px 0 72px;
}

.content-section {
  margin-bottom: 64px;
}

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

.section-title,
.page-title {
  margin: 0;
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.1;
  font-weight: 950;
  letter-spacing: -0.04em;
  color: transparent;
  background: linear-gradient(90deg, var(--red), var(--yellow), var(--pink));
  -webkit-background-clip: text;
  background-clip: text;
}

.section-link {
  color: var(--purple);
  font-weight: 800;
}

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

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

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

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

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

.aspect-video {
  aspect-ratio: 16 / 9;
}

.aspect-poster {
  aspect-ratio: 2 / 3;
}

.card-poster img,
.rank-thumb img,
.collection-card img,
.category-card img,
.detail-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease;
}

.movie-card:hover img,
.rank-row:hover img,
.collection-card:hover img,
.category-card:hover img {
  transform: scale(1.08);
}

.card-badge,
.rating-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #fff;
  font-size: 12px;
  font-weight: 800;
}

.card-content {
  display: block;
  padding: 16px;
}

.card-content strong {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  color: #1f2937;
  font-size: 17px;
  line-height: 1.35;
  min-height: 46px;
}

.card-content small {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
}

.card-content em {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 10px;
  color: #64748b;
  font-size: 14px;
  font-style: normal;
}

.card-meta {
  margin-top: 12px;
  color: #6b7280;
  font-size: 13px;
}

.scroll-row {
  display: flex;
  gap: 18px;
  overflow-x: auto;
  padding: 4px 2px 18px;
  scroll-snap-type: x mandatory;
}

.scroll-row .movie-card-wide {
  width: 290px;
  flex: 0 0 auto;
  scroll-snap-align: start;
}

.masonry-grid {
  columns: 3 280px;
  column-gap: 20px;
}

.masonry-grid .movie-card {
  break-inside: avoid;
  margin-bottom: 20px;
}

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

.editor-item {
  display: grid;
  grid-template-columns: 230px 1fr;
  gap: 18px;
  padding: 16px;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-soft);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

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

.editor-item .card-poster {
  border-radius: 14px;
}

.editor-index {
  width: 30px;
  height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--yellow), var(--orange));
  font-weight: 900;
}

.editor-item h3 {
  margin: 0 0 10px;
  font-size: 22px;
}

.editor-item p {
  margin: 0 0 14px;
  color: #64748b;
}

.rank-panel {
  padding: 22px;
  border-radius: 22px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

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

.rank-row {
  display: grid;
  grid-template-columns: 40px 96px 1fr auto;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border-radius: 16px;
  transition: background 0.2s ease;
}

.rank-row:hover {
  background: linear-gradient(90deg, #faf5ff, #fdf2f8);
}

.rank-number {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  color: #fff;
  background: #9ca3af;
  font-weight: 900;
}

.rank-row:nth-child(1) .rank-number,
.full-ranking .rank-row:nth-child(1) .rank-number {
  background: linear-gradient(135deg, #fbbf24, #d97706);
}

.rank-row:nth-child(2) .rank-number,
.full-ranking .rank-row:nth-child(2) .rank-number {
  background: linear-gradient(135deg, #d1d5db, #6b7280);
}

.rank-row:nth-child(3) .rank-number,
.full-ranking .rank-row:nth-child(3) .rank-number {
  background: linear-gradient(135deg, #fb923c, #c2410c);
}

.rank-thumb {
  display: block;
  overflow: hidden;
  border-radius: 12px;
  aspect-ratio: 16 / 9;
  background: #111827;
}

.rank-info strong {
  display: block;
  color: #111827;
}

.rank-info small {
  color: var(--muted);
}

.rank-score {
  color: var(--yellow);
  font-weight: 900;
}

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

.collection-card,
.category-card {
  position: relative;
  overflow: hidden;
  min-height: 260px;
  border-radius: 24px;
  box-shadow: var(--shadow-soft);
  background: #111827;
}

.collection-card img,
.category-card img {
  position: absolute;
  inset: 0;
}

.collection-card::after,
.category-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.28));
}

.collection-content,
.category-card-content {
  position: absolute;
  inset: auto 0 0;
  z-index: 2;
  padding: 24px;
  color: #fff;
}

.collection-content span,
.category-card-content span {
  display: inline-block;
  margin-bottom: 10px;
  padding: 4px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fde68a;
  font-size: 12px;
  font-weight: 900;
  backdrop-filter: blur(10px);
}

.collection-content h3,
.category-card-content h2 {
  margin: 0 0 8px;
  font-size: 25px;
  line-height: 1.2;
}

.collection-content p,
.category-card-content p {
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
}

.page-hero {
  margin: 34px 0 30px;
  padding: 34px;
  border-radius: 28px;
  background: linear-gradient(135deg, #fff 0%, #fff7ed 45%, #fdf2f8 100%);
  box-shadow: var(--shadow-soft);
}

.page-hero p {
  max-width: 760px;
  margin: 12px 0 0;
  color: #64748b;
  font-size: 17px;
}

.filter-panel {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 24px;
  padding: 16px;
  border-radius: 20px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.filter-input,
.filter-select {
  height: 44px;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 0 16px;
  outline: 0;
  color: #374151;
  background: #fff;
}

.filter-input {
  min-width: min(360px, 100%);
  flex: 1;
}

.empty-state {
  display: none;
  padding: 30px;
  text-align: center;
  color: #64748b;
  border-radius: 20px;
  background: #fff;
}

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

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 26px 0;
  color: #64748b;
  font-size: 14px;
}

.breadcrumb a {
  color: var(--purple);
  font-weight: 800;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 26px;
  align-items: start;
}

.detail-main,
.detail-side,
.detail-section {
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.detail-main {
  overflow: hidden;
}

.player-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  background: #020617;
}

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

.play-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: grid;
  place-items: center;
  border: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.18));
  cursor: pointer;
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

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

.play-overlay span {
  width: 86px;
  height: 86px;
  display: inline-grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, var(--pink), var(--purple));
  box-shadow: 0 20px 40px rgba(0, 0, 0, 0.34);
  font-size: 34px;
  padding-left: 5px;
}

.player-message {
  position: absolute;
  left: 20px;
  bottom: 18px;
  z-index: 5;
  color: rgba(255, 255, 255, 0.86);
  font-size: 14px;
}

.detail-copy {
  padding: 28px;
}

.detail-copy h1 {
  margin: 0 0 14px;
  color: #111827;
  font-size: clamp(30px, 5vw, 46px);
  line-height: 1.08;
  font-weight: 950;
  letter-spacing: -0.04em;
}

.detail-meta {
  margin-bottom: 18px;
  color: #64748b;
  font-weight: 700;
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 18px 0 0;
}

.tag-cloud span {
  padding: 5px 11px;
  border-radius: 999px;
  color: #7c2d12;
  background: #ffedd5;
  font-size: 13px;
  font-weight: 800;
}

.detail-side {
  padding: 18px;
}

.detail-cover {
  overflow: hidden;
  border-radius: 18px;
  aspect-ratio: 2 / 3;
  background: #111827;
}

.info-list {
  display: grid;
  gap: 12px;
  margin-top: 18px;
}

.info-list div {
  display: grid;
  grid-template-columns: 72px 1fr;
  gap: 8px;
  color: #64748b;
  font-size: 14px;
}

.info-list strong {
  color: #111827;
}

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

.detail-section h2 {
  margin: 0 0 14px;
  color: #111827;
  font-size: 25px;
  font-weight: 950;
}

.detail-section p {
  margin: 0;
  color: #475569;
  font-size: 16px;
}

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

.full-ranking {
  display: grid;
  gap: 8px;
  margin-bottom: 70px;
}

.site-footer {
  margin-top: 48px;
  background: linear-gradient(90deg, #581c87, #1e3a8a, #312e81);
  color: #fff;
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  display: flex;
  justify-content: space-between;
  gap: 30px;
  padding: 42px 0;
}

.footer-brand p {
  max-width: 480px;
  color: rgba(255, 255, 255, 0.72);
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  gap: 14px 20px;
  font-weight: 800;
}

.footer-links a:hover {
  color: #fde68a;
}

.footer-bottom {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 18px 0 28px;
  color: rgba(255, 255, 255, 0.72);
  border-top: 1px solid rgba(255, 255, 255, 0.16);
  text-align: center;
}

@media (max-width: 1024px) {
  .main-nav,
  .nav-search-form {
    display: none;
  }

  .menu-toggle {
    display: block;
  }

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

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

  .detail-side {
    display: grid;
    grid-template-columns: 180px 1fr;
    gap: 18px;
  }
}

@media (max-width: 760px) {
  .nav-wrap {
    height: 62px;
  }

  .site-logo {
    font-size: 20px;
  }

  .hero-carousel {
    height: 540px;
  }

  .hero-inner {
    align-items: flex-end;
    padding-bottom: 76px;
  }

  .hero-content p {
    font-size: 16px;
  }

  .movie-grid,
  .poster-grid,
  .collection-grid,
  .category-overview-grid,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
  }

  .editor-item {
    grid-template-columns: 1fr;
  }

  .rank-row {
    grid-template-columns: 32px 74px 1fr;
  }

  .rank-score {
    display: none;
  }

  .page-hero {
    padding: 24px;
  }

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

  .detail-cover {
    max-width: 230px;
  }

  .footer-inner {
    display: block;
  }

  .footer-links {
    margin-top: 22px;
  }
}

@media (max-width: 520px) {
  .movie-grid,
  .poster-grid,
  .collection-grid,
  .category-overview-grid,
  .related-grid {
    grid-template-columns: 1fr;
  }

  .card-content strong {
    min-height: auto;
  }

  .play-overlay span {
    width: 70px;
    height: 70px;
    font-size: 28px;
  }
}
