:root {
  --color-primary: #059669;
  --color-primary-dark: #047857;
  --color-secondary: #0d9488;
  --color-accent: #06b6d4;
  --color-rose: #f43f5e;
  --color-text: #111827;
  --color-muted: #6b7280;
  --color-soft: #ecfdf5;
  --color-border: rgba(15, 23, 42, 0.10);
  --shadow-card: 0 18px 45px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 10px 25px rgba(15, 23, 42, 0.08);
  --radius-large: 28px;
  --radius-card: 22px;
  --container: 1180px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--color-text);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", Arial, sans-serif;
  background: linear-gradient(135deg, #f8fafc 0%, #ecfdf5 48%, #eff6ff 100%);
  line-height: 1.65;
}

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

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, #059669, #0d9488, #06b6d4);
  box-shadow: 0 12px 32px rgba(4, 120, 87, 0.22);
}

.header-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 70px;
  gap: 24px;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  color: #fff;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  background: rgba(255, 255, 255, 0.18);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.22);
  transition: transform 0.25s ease;
}

.brand:hover .brand-mark {
  transform: scale(1.08) rotate(3deg);
}

.brand-text {
  display: flex;
  flex-direction: column;
  line-height: 1.15;
}

.brand-text strong {
  font-size: 20px;
  letter-spacing: 0.02em;
}

.brand-text small {
  margin-top: 3px;
  color: rgba(255, 255, 255, 0.78);
  font-size: 12px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: #fff;
  font-weight: 600;
}

.main-nav > a,
.nav-dropdown > button {
  color: #fff;
  background: transparent;
  border: 0;
  padding: 10px 0;
  font: inherit;
  cursor: pointer;
  transition: color 0.25s ease;
}

.main-nav > a:hover,
.nav-dropdown > button:hover {
  color: #d1fae5;
}

.nav-dropdown {
  position: relative;
}

.nav-dropdown-panel {
  position: absolute;
  top: 100%;
  right: 0;
  width: 220px;
  padding: 12px;
  border-radius: 16px;
  background: rgba(255, 255, 255, 0.98);
  box-shadow: var(--shadow-card);
  opacity: 0;
  pointer-events: none;
  transform: translateY(10px);
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.nav-dropdown:hover .nav-dropdown-panel {
  opacity: 1;
  pointer-events: auto;
  transform: translateY(0);
}

.nav-dropdown-panel a {
  display: block;
  padding: 9px 10px;
  color: #075985;
  border-radius: 10px;
}

.nav-dropdown-panel a:hover {
  background: #ecfeff;
  color: var(--color-primary-dark);
}

.mobile-menu-button {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: rgba(255, 255, 255, 0.18);
  cursor: pointer;
}

.mobile-menu-button span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 5px auto;
  background: #fff;
}

.hero-carousel {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  background: #0f172a;
}

.hero-slide {
  position: absolute;
  inset: 0;
  min-height: 620px;
  opacity: 0;
  background-size: cover;
  background-position: center;
  transition: opacity 0.8s ease, transform 1.2s ease;
  transform: scale(1.02);
}

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

.hero-slide::before {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(16, 185, 129, 0.35), transparent 34%),
    linear-gradient(135deg, #064e3b 0%, #0f766e 42%, #0e7490 100%);
  z-index: -1;
}

.hero-overlay,
.detail-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.88), rgba(15, 23, 42, 0.56), rgba(15, 23, 42, 0.24)),
    linear-gradient(0deg, rgba(2, 6, 23, 0.72), transparent 55%);
}

.hero-content {
  position: relative;
  min-height: 620px;
  display: grid;
  grid-template-columns: minmax(0, 1.2fr) minmax(260px, 0.55fr);
  align-items: center;
  gap: 56px;
  color: #fff;
}

.hero-copy {
  max-width: 760px;
}

.eyebrow,
.section-kicker {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: #facc15;
  font-weight: 800;
  letter-spacing: 0.04em;
  text-transform: uppercase;
}

.hero-copy h1 {
  margin: 18px 0 18px;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.05em;
}

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

.hero-tags,
.detail-meta,
.page-stats {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin: 0 0 28px;
}

.hero-tags span,
.detail-meta span,
.page-stats span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.17);
  color: #fff;
  backdrop-filter: blur(12px);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.15);
}

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

.primary-button,
.secondary-button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 48px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.22s ease, box-shadow 0.22s ease, background 0.22s ease;
}

.primary-button {
  color: #fff;
  background: linear-gradient(90deg, var(--color-primary), var(--color-secondary));
  box-shadow: 0 16px 34px rgba(5, 150, 105, 0.32);
}

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

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

.hero-poster {
  position: relative;
  min-height: 430px;
  overflow: hidden;
  border-radius: 32px;
  background: linear-gradient(135deg, #064e3b, #155e75);
  box-shadow: 0 28px 70px rgba(0, 0, 0, 0.38);
}

.hero-poster img,
.detail-poster img,
.movie-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-poster.missing-cover::after,
.detail-poster.missing-cover::after,
.movie-poster.missing-cover::after {
  content: "封面待上传";
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  color: rgba(255, 255, 255, 0.85);
  font-weight: 800;
  letter-spacing: 0.08em;
}

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

.hero-dot {
  width: 38px;
  height: 6px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.36);
  cursor: pointer;
}

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

.section-block {
  padding: 64px 0 0;
}

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

.section-heading h2 {
  margin: 6px 0 0;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  letter-spacing: -0.04em;
}

.section-heading .section-kicker {
  color: var(--color-primary);
}

.section-more {
  color: var(--color-primary-dark);
  font-weight: 800;
}

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

.category-card,
.category-overview-card a {
  display: flex;
  min-height: 180px;
  flex-direction: column;
  justify-content: space-between;
  padding: 22px;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.76);
  box-shadow: var(--shadow-soft);
  border: 1px solid rgba(255, 255, 255, 0.75);
  transition: transform 0.22s ease, box-shadow 0.22s ease;
}

.category-card:hover,
.category-overview-card a:hover {
  transform: translateY(-5px);
  box-shadow: var(--shadow-card);
}

.category-card span,
.category-overview-card h2 {
  color: #064e3b;
  font-size: 20px;
  font-weight: 900;
}

.category-card strong,
.category-count {
  color: var(--color-rose);
  font-size: 32px;
  line-height: 1;
}

.category-card small,
.category-overview-card p {
  color: var(--color-muted);
}

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

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

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

.movie-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius-card);
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-soft);
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

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

.movie-poster {
  position: relative;
  display: block;
  height: 310px;
  overflow: hidden;
  background: linear-gradient(135deg, #064e3b, #0891b2);
}

.movie-grid-3 .movie-poster {
  height: 350px;
}

.movie-card-compact .movie-poster {
  height: 260px;
}

.movie-poster::after {
  content: "";
  position: absolute;
  inset: auto 0 0 0;
  height: 45%;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.72), transparent);
}

.play-chip {
  position: absolute;
  right: 14px;
  bottom: 14px;
  z-index: 2;
  padding: 7px 12px;
  border-radius: 999px;
  color: #fff;
  background: rgba(16, 185, 129, 0.92);
  font-size: 13px;
  font-weight: 800;
}

.rank-badge {
  position: absolute;
  left: 14px;
  top: 14px;
  z-index: 2;
  width: 42px;
  height: 42px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  box-shadow: 0 10px 22px rgba(244, 63, 94, 0.25);
}

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

.movie-meta-line {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
  color: var(--color-muted);
  font-size: 13px;
}

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

.movie-card h3 {
  margin: 0 0 9px;
  font-size: 20px;
  line-height: 1.25;
}

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

.tag-list {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-list span {
  padding: 5px 9px;
  border-radius: 999px;
  color: #047857;
  background: #d1fae5;
  font-size: 12px;
  font-weight: 700;
}

.soft-panel {
  margin-top: 64px;
  padding: 48px 0;
  border-radius: 42px;
  background: rgba(255, 255, 255, 0.62);
  box-shadow: inset 0 0 0 1px rgba(255, 255, 255, 0.65);
}

.page-main {
  min-height: 60vh;
}

.page-hero {
  margin-top: 32px;
  padding: 58px;
  border-radius: 36px;
  color: #fff;
  background: radial-gradient(circle at top left, rgba(34, 197, 94, 0.5), transparent 38%),
    linear-gradient(135deg, #064e3b, #0f766e 48%, #075985);
  box-shadow: var(--shadow-card);
}

.page-hero h1 {
  margin: 8px 0 12px;
  font-size: clamp(36px, 6vw, 62px);
  line-height: 1.08;
  letter-spacing: -0.05em;
}

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

.toolbar {
  display: grid;
  grid-template-columns: 2fr 1fr;
  gap: 18px;
  margin-top: 28px;
  padding: 22px;
  border-radius: 24px;
  background: rgba(255, 255, 255, 0.8);
  box-shadow: var(--shadow-soft);
}

.search-toolbar {
  grid-template-columns: 2fr 1fr 1fr;
}

.toolbar label {
  display: flex;
  flex-direction: column;
  gap: 8px;
  color: var(--color-muted);
  font-weight: 800;
}

.toolbar input,
.toolbar select {
  width: 100%;
  min-height: 46px;
  padding: 0 14px;
  border: 1px solid var(--color-border);
  border-radius: 14px;
  background: #fff;
  color: var(--color-text);
  font: inherit;
}

.toolbar input:focus,
.toolbar select:focus {
  outline: 3px solid rgba(16, 185, 129, 0.18);
  border-color: var(--color-primary);
}

.ranking-panel {
  padding-top: 38px;
}

.ranking-list {
  overflow: hidden;
  border-radius: 28px;
  background: rgba(255, 255, 255, 0.9);
  box-shadow: var(--shadow-card);
}

.ranking-row {
  display: grid;
  grid-template-columns: 62px minmax(140px, 1.2fr) minmax(180px, 1fr) 72px;
  gap: 16px;
  align-items: center;
  padding: 16px 22px;
  border-bottom: 1px solid rgba(15, 23, 42, 0.08);
}

.ranking-row:hover {
  background: #f0fdfa;
}

.ranking-number {
  width: 38px;
  height: 38px;
  display: grid;
  place-items: center;
  border-radius: 12px;
  color: #fff;
  background: linear-gradient(135deg, #f43f5e, #ec4899);
  font-weight: 900;
}

.ranking-title {
  font-size: 18px;
  font-weight: 900;
}

.ranking-meta {
  color: var(--color-muted);
}

.detail-main {
  background: #f8fafc;
}

.detail-hero {
  position: relative;
  min-height: 560px;
  overflow: hidden;
  background: #0f172a;
}

.detail-bg {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(3px) brightness(0.45);
  transform: scale(1.04);
}

.detail-bg::before {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(135deg, #064e3b, #0f766e 45%, #0e7490);
  z-index: -1;
}

.detail-hero-inner {
  position: relative;
  min-height: 560px;
  display: grid;
  grid-template-columns: 330px minmax(0, 1fr);
  align-items: center;
  gap: 48px;
  color: #fff;
}

.detail-poster {
  position: relative;
  height: 450px;
  overflow: hidden;
  border-radius: 30px;
  background: linear-gradient(135deg, #064e3b, #0891b2);
  box-shadow: 0 26px 65px rgba(0, 0, 0, 0.36);
}

.detail-copy h1 {
  margin: 12px 0 16px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.detail-one-line {
  max-width: 820px;
  margin: 0 0 24px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 20px;
}

.detail-tags {
  margin-bottom: 26px;
}

.player-section {
  margin-top: -64px;
  position: relative;
  z-index: 2;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 32px;
  background: #020617;
  box-shadow: 0 32px 80px rgba(15, 23, 42, 0.26);
}

.video-player {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #020617;
}

.player-start {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  border: 0;
  color: #fff;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.18), rgba(2, 6, 23, 0.62));
  cursor: pointer;
  font: inherit;
}

.player-start span {
  width: 82px;
  height: 82px;
  display: grid;
  place-items: center;
  padding-left: 5px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--color-primary), var(--color-accent));
  box-shadow: 0 18px 38px rgba(6, 182, 212, 0.28);
  font-size: 32px;
}

.player-start strong {
  font-size: 20px;
}

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

.player-status {
  margin: 0;
  padding: 12px 18px;
  color: #cbd5e1;
  background: rgba(15, 23, 42, 0.95);
  font-size: 14px;
}

.detail-content-grid {
  display: grid;
  grid-template-columns: minmax(0, 1.15fr) minmax(280px, 0.85fr);
  gap: 24px;
  padding-top: 52px;
}

.content-card {
  padding: 30px;
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.content-card h2 {
  margin: 0 0 14px;
  font-size: 26px;
}

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

.search-summary {
  margin-bottom: 18px;
  color: var(--color-muted);
  font-weight: 800;
}

.site-footer {
  margin-top: 72px;
  color: #d1d5db;
  background: linear-gradient(135deg, #111827, #1f2937, #0f172a);
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.3fr 0.75fr 1fr 1fr;
  gap: 36px;
  padding: 52px 0;
}

.footer-logo {
  margin-bottom: 12px;
  color: #fff;
  font-size: 24px;
  font-weight: 900;
}

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

.site-footer a {
  display: block;
  margin: 8px 0;
  color: #a7f3d0;
}

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

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

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

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

  .hero-content {
    grid-template-columns: 1fr;
    gap: 24px;
    padding: 90px 0 70px;
  }

  .hero-poster {
    display: none;
  }

  .detail-hero-inner {
    grid-template-columns: 260px minmax(0, 1fr);
  }
}

@media (max-width: 820px) {
  .mobile-menu-button {
    display: block;
  }

  .main-nav {
    position: absolute;
    top: 70px;
    left: 16px;
    right: 16px;
    display: none;
    flex-direction: column;
    align-items: stretch;
    gap: 4px;
    padding: 16px;
    border-radius: 18px;
    background: rgba(4, 120, 87, 0.98);
    box-shadow: var(--shadow-card);
  }

  .main-nav.is-open {
    display: flex;
  }

  .nav-dropdown-panel {
    position: static;
    width: 100%;
    margin-top: 6px;
    opacity: 1;
    pointer-events: auto;
    transform: none;
  }

  .hero-carousel,
  .hero-slide,
  .hero-content {
    min-height: 560px;
  }

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

  .toolbar,
  .search-toolbar,
  .detail-content-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

  .detail-hero-inner {
    grid-template-columns: 1fr;
    padding: 54px 0 94px;
  }

  .detail-poster {
    width: 240px;
    height: 340px;
  }

  .ranking-row {
    grid-template-columns: 44px minmax(0, 1fr);
  }

  .ranking-meta,
  .ranking-row strong {
    grid-column: 2;
  }
}

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

  .brand-text strong {
    font-size: 17px;
  }

  .brand-text small {
    display: none;
  }

  .hero-copy h1,
  .detail-copy h1,
  .page-hero h1 {
    letter-spacing: -0.03em;
  }

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

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

  .page-hero {
    padding: 34px 24px;
    border-radius: 26px;
  }

  .movie-poster,
  .movie-grid-3 .movie-poster,
  .movie-card-compact .movie-poster {
    height: 360px;
  }
}
