:root {
  --bg: #f9fafb;
  --paper: #ffffff;
  --ink: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --accent: #dc2626;
  --accent-dark: #b91c1c;
  --accent-soft: #fee2e2;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
  --radius: 20px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

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

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

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

button,
input {
  font: inherit;
}

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

.site-header-inner {
  width: min(1200px, calc(100% - 32px));
  height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.site-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  color: var(--accent);
  font-size: 24px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.site-logo-mark {
  width: 34px;
  height: 34px;
  display: inline-grid;
  place-items: center;
  border-radius: 11px;
  color: #ffffff;
  background: linear-gradient(135deg, #ef4444, #be123c);
  box-shadow: 0 10px 18px rgba(220, 38, 38, 0.32);
  font-size: 15px;
}

.site-nav {
  display: flex;
  align-items: center;
  gap: 30px;
}

.nav-link,
.mobile-nav-link {
  color: #374151;
  font-weight: 700;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-nav-link:hover {
  color: var(--accent);
}

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

.mobile-nav {
  display: none;
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 16px;
  gap: 12px;
  flex-direction: column;
}

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

.page-shell {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 32px 0 64px;
}

.hero-carousel {
  position: relative;
  min-height: 540px;
  margin-bottom: 48px;
  overflow: hidden;
  border-radius: 28px;
  background: #111827;
  box-shadow: var(--shadow);
}

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

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

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

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.48) 45%, rgba(0, 0, 0, 0.1)), linear-gradient(0deg, rgba(0, 0, 0, 0.74), rgba(0, 0, 0, 0.02));
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(720px, 100%);
  padding: 72px;
  color: #ffffff;
}

.hero-kicker,
.page-hero span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  min-height: 28px;
  padding: 4px 12px;
  border-radius: 999px;
  background: var(--accent);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
}

.hero-content h1,
.page-hero h1 {
  margin: 16px 0 14px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -0.04em;
}

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

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

.hero-tags {
  margin: 22px 0 28px;
}

.hero-tags span,
.tag-row span,
.movie-card-tags span {
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
  font-size: 13px;
  font-weight: 700;
}

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

.primary-button,
.ghost-button,
.text-link {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 22px;
  border-radius: 14px;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-button {
  background: var(--accent);
  color: #ffffff;
  box-shadow: 0 16px 28px rgba(220, 38, 38, 0.32);
}

.primary-button:hover {
  background: var(--accent-dark);
  transform: translateY(-2px);
}

.ghost-button {
  border: 1px solid rgba(255, 255, 255, 0.45);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
}

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

.hero-dots {
  position: absolute;
  z-index: 5;
  left: 50%;
  bottom: 22px;
  display: flex;
  gap: 10px;
  transform: translateX(-50%);
}

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

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

.quick-search-panel,
.ranking-band,
.page-hero {
  margin-bottom: 48px;
  border-radius: var(--radius);
  box-shadow: var(--shadow);
}

.quick-search-panel {
  display: grid;
  grid-template-columns: 1.2fr 0.8fr;
  gap: 24px;
  align-items: center;
  padding: 34px;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  color: #ffffff;
}

.quick-search-panel h2,
.ranking-band h2,
.section-title-row h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 34px);
  font-weight: 900;
  letter-spacing: -0.03em;
}

.quick-search-panel p {
  margin: 10px 0 0;
  color: rgba(255, 255, 255, 0.86);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 8px 8px 16px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.96);
  color: #111827;
  box-shadow: 0 12px 28px rgba(15, 23, 42, 0.16);
}

.search-box span {
  color: var(--accent);
  font-weight: 900;
}

.search-box input {
  width: 100%;
  min-height: 44px;
  border: 0;
  outline: 0;
  background: transparent;
  color: #111827;
}

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

.section-title-row a,
.text-link {
  color: var(--accent);
  font-weight: 900;
}

.category-strip,
section {
  margin-bottom: 54px;
}

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

.category-card,
.category-overview-card,
.detail-card,
.side-card,
.rank-card,
.movie-card {
  background: var(--paper);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: var(--radius);
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.08);
}

.category-card {
  min-height: 138px;
  padding: 22px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-card strong {
  display: block;
  margin-bottom: 10px;
  color: #111827;
  font-size: 20px;
}

.category-card span {
  display: block;
  color: var(--muted);
  font-size: 14px;
}

.category-card:hover,
.movie-card:hover,
.rank-card:hover,
.category-overview-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 22px 48px rgba(15, 23, 42, 0.14);
}

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

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

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

.movie-poster {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: linear-gradient(135deg, #111827, #374151);
}

.movie-poster img,
.rank-cover img,
.category-preview img,
.side-related img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.28s ease;
}

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

.movie-badge,
.movie-duration {
  position: absolute;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 3px 8px;
  border-radius: 8px;
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.movie-badge {
  top: 10px;
  left: 10px;
  background: var(--accent);
}

.movie-duration {
  right: 10px;
  bottom: 10px;
  background: rgba(0, 0, 0, 0.72);
}

.movie-hover {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.45);
  font-weight: 900;
  opacity: 0;
  transition: opacity 0.2s ease;
}

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

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

.movie-card h3,
.rank-body h2,
.detail-card h1 {
  margin: 0;
  line-height: 1.25;
  font-weight: 900;
}

.movie-card h3 {
  min-height: 44px;
  font-size: 16px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 9px 0;
  color: var(--muted);
  font-size: 13px;
}

.movie-meta span:not(:last-child)::after {
  content: "·";
  margin-left: 8px;
  color: #d1d5db;
}

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

.movie-card-tags span {
  background: #f3f4f6;
  color: #4b5563;
}

.ranking-band {
  padding: 34px;
  background: linear-gradient(135deg, #db2777, #dc2626);
  color: #ffffff;
}

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

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

.ranking-item {
  display: grid;
  grid-template-columns: 40px 1fr auto;
  align-items: center;
  gap: 10px;
  min-height: 56px;
  padding: 10px 12px;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.12);
}

.ranking-item span {
  font-weight: 900;
  color: #fecaca;
}

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

.ranking-item em {
  font-style: normal;
  font-weight: 900;
}

.page-hero {
  padding: 44px;
  color: #ffffff;
  background: linear-gradient(135deg, #dc2626, #db2777);
}

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

.category-search,
.search-page-box {
  margin-top: 26px;
  max-width: 680px;
}

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

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

.category-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 4px;
  height: 170px;
  background: #111827;
}

.category-overview-body {
  padding: 22px;
}

.category-overview-body h2 {
  margin: 0 0 10px;
  font-size: 24px;
  font-weight: 900;
}

.category-overview-body p {
  margin: 0 0 14px;
  color: var(--muted);
}

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

.rank-card {
  display: grid;
  grid-template-columns: 128px 1fr;
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-cover {
  position: relative;
  min-height: 190px;
  background: #111827;
}

.rank-cover span {
  position: absolute;
  top: 10px;
  left: 10px;
  min-width: 36px;
  min-height: 30px;
  display: inline-grid;
  place-items: center;
  border-radius: 10px;
  background: var(--accent);
  color: #ffffff;
  font-weight: 900;
}

.rank-body {
  padding: 18px;
}

.rank-body h2 {
  font-size: 20px;
}

.rank-body p {
  color: var(--muted);
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
}

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

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

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

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

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

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  align-content: center;
  gap: 14px;
  border: 0;
  background-size: cover;
  background-position: center;
  color: #ffffff;
  cursor: pointer;
  transition: opacity 0.24s ease;
}

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

.play-icon {
  width: 74px;
  height: 74px;
  display: inline-grid;
  place-items: center;
  border-radius: 999px;
  background: var(--accent);
  box-shadow: 0 16px 32px rgba(220, 38, 38, 0.36);
  font-size: 30px;
  text-indent: 4px;
}

.player-cover strong {
  max-width: 80%;
  text-align: center;
  font-size: clamp(20px, 4vw, 34px);
  line-height: 1.2;
}

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

.detail-meta-top {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: 16px;
}

.detail-meta-top span,
.detail-meta-top strong {
  padding: 6px 10px;
  border-radius: 999px;
  background: #f3f4f6;
  color: #374151;
  font-size: 13px;
  font-weight: 800;
}

.detail-meta-top strong {
  background: #fef3c7;
  color: #b45309;
}

.detail-card h1 {
  font-size: clamp(30px, 4vw, 48px);
}

.detail-one-line {
  margin: 14px 0 18px;
  color: #374151;
  font-size: 18px;
}

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

.detail-section {
  margin-top: 28px;
  padding-top: 24px;
  border-top: 1px solid var(--line);
}

.detail-section h2,
.side-card h2 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 900;
}

.detail-section p {
  margin: 0;
  color: #374151;
  font-size: 16px;
  line-height: 1.9;
}

.detail-side {
  position: sticky;
  top: 96px;
  align-self: start;
}

.side-related {
  display: grid;
  grid-template-columns: 104px 1fr;
  gap: 12px;
  align-items: center;
  padding: 10px;
  border-radius: 14px;
  transition: background 0.2s ease;
}

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

.side-related img {
  width: 104px;
  height: 72px;
  border-radius: 12px;
  background: #111827;
}

.side-related span {
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  font-weight: 800;
}

.side-related em {
  display: block;
  margin-top: 6px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.info-list {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 10px 14px;
  margin: 0;
}

.info-list dt {
  color: var(--muted);
}

.info-list dd {
  margin: 0;
  font-weight: 800;
}

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

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

.no-result {
  grid-column: 1 / -1;
  padding: 46px;
  border-radius: var(--radius);
  background: #ffffff;
  color: var(--muted);
  text-align: center;
  font-weight: 800;
}

.site-footer {
  background: #111827;
  color: #ffffff;
  margin-top: 48px;
}

.footer-inner {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 48px 0;
  display: grid;
  grid-template-columns: 1.4fr 0.8fr 0.8fr;
  gap: 42px;
}

.footer-inner h2,
.footer-inner h3 {
  margin: 0 0 14px;
  color: #ffffff;
}

.footer-inner h2 {
  color: #ef4444;
}

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

.footer-inner ul {
  list-style: none;
  margin: 0;
  padding: 0;
}

.footer-inner li + li {
  margin-top: 8px;
}

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

.footer-bottom {
  width: min(1200px, calc(100% - 32px));
  margin: 0 auto;
  padding: 22px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.08);
  text-align: center;
}

.hidden-by-search {
  display: none !important;
}

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

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

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

  .detail-side {
    position: static;
  }
}

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

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

  .page-shell {
    padding-top: 20px;
  }

  .hero-carousel {
    min-height: 620px;
    border-radius: 22px;
  }

  .hero-content {
    padding: 36px 24px 72px;
  }

  .quick-search-panel,
  .footer-inner,
  .category-overview-grid,
  .rank-grid {
    grid-template-columns: 1fr;
  }

  .category-grid,
  .featured-grid,
  .ranking-list,
  .related-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .movie-grid,
  .search-results {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .page-hero,
  .quick-search-panel,
  .ranking-band,
  .detail-card,
  .side-card {
    padding: 24px;
  }

  .rank-card {
    grid-template-columns: 112px 1fr;
  }

  .rank-cover {
    min-height: 168px;
  }
}

@media (max-width: 520px) {
  .site-header-inner,
  .page-shell,
  .footer-inner,
  .footer-bottom {
    width: min(100% - 22px, 1200px);
  }

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

  .hero-content h1,
  .page-hero h1 {
    font-size: 32px;
  }

  .category-grid,
  .movie-grid,
  .search-results,
  .related-grid {
    grid-template-columns: 1fr 1fr;
    gap: 12px;
  }

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

  .movie-card h3 {
    min-height: 40px;
    font-size: 14px;
  }

  .movie-card p,
  .movie-card-tags {
    display: none;
  }

  .rank-card {
    grid-template-columns: 92px 1fr;
  }

  .rank-cover {
    min-height: 138px;
  }

  .detail-card h1 {
    font-size: 28px;
  }
}
