:root {
  --color-red: #dc2626;
  --color-red-dark: #b91c1c;
  --color-pink: #db2777;
  --color-purple: #9333ea;
  --color-blue: #2563eb;
  --color-gray-50: #f9fafb;
  --color-gray-100: #f3f4f6;
  --color-gray-400: #9ca3af;
  --color-gray-500: #6b7280;
  --color-gray-600: #4b5563;
  --color-gray-700: #374151;
  --color-gray-900: #111827;
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-strong: 0 25px 50px rgba(15, 23, 42, 0.18);
  --radius-lg: 18px;
  --radius-md: 12px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--color-gray-900);
  background: var(--color-gray-50);
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(229, 231, 235, 0.85);
  box-shadow: 0 8px 20px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(18px);
}

.top-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 64px;
  gap: 22px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--color-red);
  font-size: 1.55rem;
  font-weight: 800;
  white-space: nowrap;
}

.brand-icon {
  font-size: 1.4rem;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 22px;
  color: var(--color-gray-700);
  font-weight: 600;
  font-size: 0.95rem;
}

.nav-links a,
.mobile-menu a,
.site-footer a {
  transition: color 0.2s ease;
}

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

.mobile-menu-button {
  display: none;
  border: 0;
  border-radius: 10px;
  padding: 8px 10px;
  background: var(--color-gray-100);
  color: var(--color-gray-700);
  cursor: pointer;
}

.mobile-menu {
  display: none;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
  padding-bottom: 16px;
  color: var(--color-gray-700);
  font-weight: 600;
}

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

.search-bar {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding-bottom: 14px;
}

.search-label {
  color: var(--color-gray-600);
  font-weight: 700;
  white-space: nowrap;
}

.site-search-input {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  background: #fff;
  padding: 11px 18px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

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

.search-results {
  position: absolute;
  top: calc(100% - 7px);
  right: 0;
  display: none;
  width: min(640px, 100%);
  max-height: 430px;
  overflow-y: auto;
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 16px;
  box-shadow: var(--shadow-strong);
  padding: 10px;
}

.search-results.is-open {
  display: grid;
  gap: 8px;
}

.search-result-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  transition: background 0.2s ease;
}

.search-result-item:hover {
  background: var(--color-gray-100);
}

.search-result-item img {
  width: 54px;
  height: 74px;
  object-fit: cover;
  border-radius: 10px;
  background: linear-gradient(135deg, var(--color-red), var(--color-purple));
}

.search-result-item strong,
.search-result-item small {
  display: block;
}

.search-result-item small,
.search-empty {
  color: var(--color-gray-500);
}

.main-space {
  padding-top: 32px;
  padding-bottom: 48px;
}

.hero-carousel {
  position: relative;
  min-height: 500px;
  overflow: hidden;
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-strong);
  background: var(--color-gray-900);
  margin-bottom: 48px;
}

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

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

.hero-image {
  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.55), rgba(0, 0, 0, 0.2));
}

.hero-content {
  position: absolute;
  left: clamp(24px, 6vw, 64px);
  right: clamp(24px, 6vw, 64px);
  bottom: clamp(42px, 9vw, 76px);
  max-width: 760px;
  color: #fff;
}

.hero-kicker,
.badge {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  border-radius: 999px;
  font-size: 0.82rem;
  font-weight: 700;
  line-height: 1;
}

.hero-kicker {
  background: var(--color-red);
  padding: 8px 12px;
  margin-bottom: 14px;
}

.hero-content h1 {
  margin: 0 0 12px;
  font-size: clamp(2rem, 5vw, 3.8rem);
  line-height: 1.1;
}

.hero-content p {
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.88);
  font-size: clamp(1rem, 1.8vw, 1.2rem);
}

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

.primary-button,
.ghost-button,
.small-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.primary-button {
  background: var(--color-red);
  color: #fff;
  padding: 13px 22px;
}

.primary-button:hover {
  background: var(--color-red-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(220, 38, 38, 0.28);
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.55);
  color: #fff;
  padding: 12px 20px;
  background: rgba(255, 255, 255, 0.12);
}

.ghost-button:hover {
  background: rgba(255, 255, 255, 0.2);
}

.small-button {
  color: #fff;
  background: var(--color-red);
  padding: 9px 14px;
  white-space: nowrap;
}

.hero-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  transition: background 0.2s ease;
}

.hero-control:hover {
  background: rgba(255, 255, 255, 0.3);
}

.hero-prev {
  left: 18px;
}

.hero-next {
  right: 18px;
}

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

.hero-dot {
  width: 9px;
  height: 9px;
  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: 32px;
  background: #fff;
}

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

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

.section-header h2 {
  margin: 0;
  font-size: clamp(1.35rem, 3vw, 2rem);
}

.section-header a {
  color: var(--color-red);
  font-weight: 800;
  white-space: nowrap;
}

.light-header h2,
.light-header a {
  color: #fff;
}

.movie-grid,
.large-card-grid,
.editor-grid {
  display: grid;
  gap: 18px;
}

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

.large-card-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 22px;
}

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

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

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

.movie-card-light {
  background: rgba(255, 255, 255, 0.18);
  color: #fff;
}

.movie-link {
  display: block;
  height: 100%;
}

.poster-frame {
  position: relative;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #111827, var(--color-red));
}

.poster-frame img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease, opacity 0.2s ease;
}

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

.poster-frame img.image-missing,
.hero-image.image-missing,
.rank-movie img.image-missing,
.side-related-item img.image-missing,
.search-result-item img.image-missing {
  opacity: 0;
}

.badge-red {
  color: #fff;
  background: var(--color-red);
  padding: 6px 9px;
}

.poster-frame .badge {
  position: absolute;
  top: 10px;
  left: 10px;
  max-width: calc(100% - 20px);
}

.duration {
  position: absolute;
  right: 10px;
  bottom: 10px;
  padding: 5px 8px;
  border-radius: 8px;
  color: #fff;
  background: rgba(0, 0, 0, 0.76);
  font-size: 0.78rem;
}

.poster-play {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: #fff;
  background: rgba(0, 0, 0, 0.4);
  font-size: 2.5rem;
  opacity: 0;
  transition: opacity 0.2s ease;
}

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

.movie-info {
  padding: 12px;
}

.movie-info h3 {
  display: -webkit-box;
  min-height: 2.7em;
  margin: 0 0 8px;
  overflow: hidden;
  font-size: 0.96rem;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-info p {
  display: -webkit-box;
  margin: 0 0 10px;
  overflow: hidden;
  color: var(--color-gray-600);
  font-size: 0.86rem;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-card-light .movie-info p {
  color: rgba(255, 255, 255, 0.82);
}

.movie-card-large .movie-info h3 {
  font-size: 1.08rem;
}

.movie-card-small .movie-info {
  display: none;
}

.meta-row,
.detail-meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  color: var(--color-gray-500);
  font-size: 0.86rem;
}

.movie-card-light .meta-row {
  color: rgba(255, 255, 255, 0.82);
}

.rating,
.rank-score {
  color: #eab308;
  font-weight: 800;
}

.gradient-section,
.page-hero {
  border-radius: var(--radius-lg);
  padding: clamp(24px, 4vw, 36px);
  color: #fff;
  box-shadow: var(--shadow-soft);
}

.blue-purple {
  background: linear-gradient(120deg, var(--color-blue), var(--color-purple));
}

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

.page-hero {
  margin-bottom: 34px;
}

.page-hero h1 {
  margin: 0 0 10px;
  font-size: clamp(2rem, 5vw, 3.5rem);
}

.page-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.08rem;
}

.rank-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  margin: 0;
  padding: 0;
  list-style: none;
}

.rank-list a {
  display: grid;
  grid-template-columns: 44px minmax(0, 1fr) auto;
  align-items: center;
  gap: 12px;
  padding: 14px;
  border-radius: 14px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.rank-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 10px;
  color: #fff;
  background: var(--color-red);
  font-weight: 900;
}

.rank-title {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
  font-weight: 800;
}

.category-overview-grid {
  display: grid;
  gap: 24px;
}

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

.category-panel {
  padding: 24px;
}

.category-panel-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.category-panel h2,
.category-panel p {
  margin: 0;
}

.category-panel p {
  color: var(--color-gray-600);
}

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

.filter-panel {
  margin-bottom: 28px;
  padding: 20px;
}

.filter-row {
  display: grid;
  grid-template-columns: minmax(240px, 1fr) 180px 220px;
  gap: 16px;
}

.filter-row label {
  display: grid;
  gap: 8px;
  color: var(--color-gray-600);
  font-weight: 700;
}

.filter-panel input,
.filter-panel select {
  width: 100%;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  background: #fff;
  padding: 10px 12px;
  outline: none;
}

.filter-count {
  margin: 14px 0 0;
  color: var(--color-gray-600);
}

.table-card {
  overflow-x: auto;
}

.ranking-table {
  width: 100%;
  border-collapse: collapse;
  min-width: 760px;
}

.ranking-table th,
.ranking-table td {
  padding: 14px 16px;
  border-bottom: 1px solid #eef2f7;
  text-align: left;
}

.ranking-table th {
  color: var(--color-gray-600);
  background: var(--color-gray-100);
}

.rank-cell {
  color: var(--color-red);
  font-weight: 900;
}

.rank-movie {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.rank-movie img {
  width: 48px;
  height: 66px;
  border-radius: 8px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--color-blue), var(--color-red));
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 20px;
  color: var(--color-gray-600);
}

.breadcrumb a {
  color: var(--color-red);
  font-weight: 700;
}

.detail-grid {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 1fr);
  gap: 30px;
}

.player-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-lg);
  background: #000;
  box-shadow: var(--shadow-strong);
  aspect-ratio: 16 / 9;
  margin-bottom: 24px;
}

.player-card video {
  width: 100%;
  height: 100%;
  background: #000;
}

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 12px;
  border: 0;
  color: #fff;
  background: radial-gradient(circle, rgba(220, 38, 38, 0.22), rgba(0, 0, 0, 0.64));
  cursor: pointer;
  font-size: 1.05rem;
  font-weight: 800;
}

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

.big-play {
  display: grid;
  place-items: center;
  width: 76px;
  height: 76px;
  border-radius: 50%;
  background: var(--color-red);
  box-shadow: 0 20px 40px rgba(220, 38, 38, 0.35);
  font-size: 2rem;
}

.detail-card,
.side-card {
  padding: 24px;
  margin-bottom: 24px;
}

.detail-meta-row {
  justify-content: flex-start;
  flex-wrap: wrap;
}

.detail-card h1 {
  margin: 16px 0 12px;
  font-size: clamp(1.8rem, 4vw, 3rem);
  line-height: 1.15;
}

.detail-card h2,
.side-card h2 {
  margin: 0 0 14px;
}

.one-line {
  color: var(--color-gray-600);
  font-size: 1.08rem;
}

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  margin: 18px 0;
}

.tag-list span {
  border-radius: 999px;
  background: var(--color-gray-100);
  padding: 7px 11px;
  color: var(--color-gray-600);
  font-size: 0.88rem;
  font-weight: 700;
}

.info-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px 18px;
  border-top: 1px solid #eef2f7;
  padding-top: 18px;
  color: var(--color-gray-700);
}

.text-block {
  border-top: 1px solid #eef2f7;
  margin-top: 18px;
  padding-top: 18px;
}

.text-block p,
.detail-card > p {
  color: var(--color-gray-700);
}

.sticky-card {
  position: sticky;
  top: 150px;
}

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

.side-related-item {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 8px;
  border-radius: 12px;
  transition: background 0.2s ease;
}

.side-related-item:hover {
  background: var(--color-gray-100);
}

.side-related-item img {
  width: 104px;
  height: 68px;
  border-radius: 10px;
  object-fit: cover;
  background: linear-gradient(135deg, var(--color-pink), var(--color-red));
}

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

.side-related-item strong {
  display: -webkit-box;
  overflow: hidden;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.side-related-item small {
  color: var(--color-gray-500);
}

.site-footer {
  background: var(--color-gray-900);
  color: #fff;
  margin-top: 48px;
  padding: 44px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 28px;
}

.site-footer h3 {
  margin: 0 0 12px;
  color: #fff;
}

.site-footer p,
.site-footer a {
  color: var(--color-gray-400);
}

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

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

[hidden] {
  display: none !important;
}

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

  .mobile-menu-button {
    display: inline-grid;
  }

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

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

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

  .sticky-card {
    position: static;
  }
}

@media (max-width: 820px) {
  .container {
    width: min(100% - 22px, var(--container));
  }

  .top-nav {
    min-height: 58px;
  }

  .brand {
    font-size: 1.28rem;
  }

  .search-bar {
    align-items: stretch;
    flex-direction: column;
  }

  .hero-carousel {
    min-height: 430px;
    border-radius: 16px;
  }

  .hero-control {
    display: none;
  }

  .hero-content {
    bottom: 48px;
  }

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

  .large-card-grid,
  .rank-list,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

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

  .category-panel-header,
  .section-header {
    align-items: flex-start;
    flex-direction: column;
  }

  .info-grid {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 520px) {
  .mobile-menu {
    grid-template-columns: 1fr;
  }

  .hero-carousel {
    min-height: 380px;
  }

  .hero-content h1 {
    font-size: 2rem;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
  }

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

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

  .side-related-item img {
    width: 90px;
  }
}
