* {
  box-sizing: border-box;
}

:root {
  color-scheme: light;
  --bg: #f8fafc;
  --soft: #f1f5f9;
  --card: #ffffff;
  --ink: #0f172a;
  --text: #334155;
  --muted: #64748b;
  --line: #e2e8f0;
  --dark: #0f172a;
  --dark-2: #1e293b;
  --dark-3: #334155;
  --accent: #475569;
  --accent-2: #64748b;
  --white: #ffffff;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 18px;
}

html {
  scroll-behavior: smooth;
}

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

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

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: linear-gradient(90deg, #1e293b, #0f172a);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.22);
}

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

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

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(148, 163, 184, 0.22);
  color: #e2e8f0;
  font-size: 14px;
}

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

.main-nav a {
  color: #cbd5e1;
  font-weight: 600;
  transition: color 0.25s ease;
}

.main-nav a:hover,
.main-nav a.active {
  color: #ffffff;
}

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

.nav-search input,
.toolbar input,
.toolbar select {
  border: 1px solid rgba(148, 163, 184, 0.35);
  border-radius: 12px;
  outline: none;
  transition: box-shadow 0.25s ease, border-color 0.25s ease;
}

.nav-search input {
  width: 230px;
  padding: 10px 14px;
  background: rgba(51, 65, 85, 0.9);
  color: var(--white);
}

.nav-search input::placeholder {
  color: #94a3b8;
}

.nav-search button,
.primary-btn,
.ghost-btn {
  border: 0;
  border-radius: 12px;
  font-weight: 700;
  transition: transform 0.25s ease, background 0.25s ease, color 0.25s ease;
}

.nav-search button {
  padding: 10px 16px;
  background: #475569;
  color: var(--white);
}

.nav-search button:hover,
.primary-btn:hover {
  background: #64748b;
  transform: translateY(-1px);
}

.menu-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  background: transparent;
  color: var(--white);
  font-size: 26px;
}

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

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transition: opacity 1s ease;
  pointer-events: none;
}

.hero-slide.is-active {
  opacity: 1;
  pointer-events: auto;
}

.hero-image {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.92), rgba(15, 23, 42, 0.68), rgba(15, 23, 42, 0.08));
}

.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  max-width: 1180px;
  color: var(--white);
}

.eyebrow {
  margin: 0 0 12px;
  color: #cbd5e1;
  font-size: 14px;
  font-weight: 800;
  letter-spacing: 0.12em;
  text-transform: uppercase;
}

.eyebrow.dark {
  color: #64748b;
}

.hero-content h1,
.hero-content h2 {
  max-width: 740px;
  margin: 0 0 18px;
  font-size: clamp(42px, 7vw, 78px);
  line-height: 1.06;
  font-weight: 900;
  color: var(--white);
}

.hero-summary {
  max-width: 720px;
  margin: 0 0 24px;
  color: #e2e8f0;
  font-size: clamp(17px, 2vw, 22px);
}

.hero-meta,
.detail-meta,
.tag-row,
.pill-row,
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-meta span,
.detail-meta span,
.pill-row span,
.tag-cloud span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  background: rgba(71, 85, 105, 0.72);
  color: #f8fafc;
  font-size: 13px;
  font-weight: 700;
}

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

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

.primary-btn {
  background: #475569;
  color: var(--white);
  box-shadow: var(--shadow-soft);
}

.ghost-btn {
  border: 1px solid rgba(226, 232, 240, 0.55);
  color: #f8fafc;
  background: rgba(15, 23, 42, 0.25);
  backdrop-filter: blur(10px);
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.16);
}

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

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

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

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

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

.section-title h2 {
  margin: 0;
  color: var(--ink);
  font-size: clamp(28px, 4vw, 38px);
  line-height: 1.15;
}

.section-title a {
  color: #475569;
  font-weight: 800;
}

.section-title.light h2,
.section-title.light a {
  color: var(--white);
}

.soft-band {
  background: linear-gradient(90deg, #f1f5f9, #e2e8f0);
}

.dark-band {
  background: linear-gradient(180deg, #1e293b, #0f172a);
}

.large-grid,
.movie-grid,
.category-grid,
.category-overview-grid,
.year-grid {
  display: grid;
  gap: 24px;
}

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

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

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

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

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

.year-grid a {
  display: grid;
  place-items: center;
  min-height: 72px;
  border-radius: 16px;
  background: rgba(71, 85, 105, 0.86);
  color: var(--white);
  font-size: 24px;
  font-weight: 900;
  transition: transform 0.25s ease, background 0.25s ease;
}

.year-grid a:hover {
  background: #64748b;
  transform: scale(1.03);
}

.movie-card {
  display: block;
  min-width: 0;
  overflow: hidden;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  transition: transform 0.28s ease, box-shadow 0.28s ease;
}

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

.poster-frame,
.poster-wide,
.poster-list {
  position: relative;
  display: block;
  overflow: hidden;
  background: #1e293b;
}

.poster-frame {
  aspect-ratio: 3 / 4;
}

.poster-wide {
  aspect-ratio: 16 / 9;
}

.poster-list {
  width: 190px;
  min-height: 140px;
  flex: 0 0 190px;
}

.poster-frame img,
.poster-wide img,
.poster-list img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.movie-card:hover img,
.category-tile:hover .category-bg,
.related-mini:hover img {
  transform: scale(1.08);
}

.poster-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent, rgba(0, 0, 0, 0.78));
}

.year-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  padding: 5px 10px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.82);
  color: var(--white);
  font-size: 12px;
  font-weight: 800;
}

.hover-panel {
  position: absolute;
  inset: auto 12px 12px 12px;
  display: grid;
  place-items: center;
  min-height: 38px;
  border-radius: 12px;
  background: rgba(15, 23, 42, 0.82);
  color: var(--white);
  font-size: 14px;
  font-weight: 800;
  opacity: 0;
  transform: translateY(10px);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .hover-panel {
  opacity: 1;
  transform: translateY(0);
}

.movie-card-body,
.movie-list-body {
  display: block;
  padding: 16px;
}

.movie-card-body strong,
.movie-list-body strong,
.rank-info strong,
.related-mini strong {
  display: block;
  color: var(--ink);
  font-size: 17px;
  font-weight: 900;
  line-height: 1.35;
}

.movie-card-body em,
.movie-list-body em,
.rank-info em,
.related-mini em {
  display: -webkit-box;
  margin-top: 6px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  font-style: normal;
  line-height: 1.55;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.overlay-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  color: var(--white);
}

.overlay-body strong,
.overlay-body em,
.overlay-body .meta-line {
  color: var(--white);
}

.meta-line {
  display: block;
  margin-top: 10px;
  color: #64748b;
  font-size: 13px;
  font-weight: 700;
}

.tag-row {
  margin-top: 10px;
}

.tag-row span {
  border-radius: 999px;
  padding: 3px 8px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

.movie-card-list {
  display: flex;
}

.list-stack {
  display: grid;
  gap: 18px;
}

.category-tile,
.category-overview-card {
  position: relative;
  overflow: hidden;
  border-radius: var(--radius);
  box-shadow: var(--shadow-soft);
}

.category-tile {
  min-height: 210px;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding: 24px;
  background: linear-gradient(135deg, #334155, #0f172a);
  color: var(--white);
}

.category-bg,
.category-shade {
  position: absolute;
  inset: 0;
}

.category-bg {
  background-size: cover;
  background-position: center;
  opacity: 0.38;
  transition: transform 0.5s ease;
}

.category-shade {
  background: linear-gradient(180deg, rgba(15, 23, 42, 0.2), rgba(15, 23, 42, 0.9));
}

.category-tile strong,
.category-tile em {
  position: relative;
  z-index: 2;
}

.category-tile strong {
  font-size: 22px;
  font-weight: 900;
}

.category-tile em {
  display: block;
  margin-top: 8px;
  color: #cbd5e1;
  font-style: normal;
  font-size: 14px;
}

.category-overview-card {
  display: grid;
  grid-template-columns: 150px 1fr;
  min-height: 170px;
  background: var(--card);
}

.category-overview-card img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.category-overview-card span {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 8px;
  padding: 22px;
}

.category-overview-card strong {
  color: var(--ink);
  font-size: 22px;
  font-weight: 900;
}

.category-overview-card em {
  color: var(--muted);
  font-style: normal;
}

.sub-hero {
  padding: 72px 0;
  background: radial-gradient(circle at top right, rgba(100, 116, 139, 0.55), transparent 35%), linear-gradient(135deg, #1e293b, #0f172a);
  color: var(--white);
}

.sub-hero h1 {
  max-width: 820px;
  margin: 0 0 16px;
  font-size: clamp(36px, 6vw, 60px);
  line-height: 1.08;
  font-weight: 900;
}

.sub-hero p {
  max-width: 780px;
  margin: 0;
  color: #cbd5e1;
  font-size: 18px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  margin-top: 22px;
  color: #64748b;
  font-size: 14px;
  font-weight: 700;
}

.breadcrumb a {
  color: #475569;
}

.breadcrumb.dark,
.breadcrumb.dark a {
  color: #cbd5e1;
}

.toolbar {
  display: flex;
  gap: 12px;
  align-items: center;
  margin-bottom: 28px;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.toolbar input,
.toolbar select {
  min-height: 46px;
  padding: 0 14px;
  background: #ffffff;
  color: var(--text);
}

.toolbar input {
  flex: 1 1 320px;
}

.toolbar input:focus,
.toolbar select:focus,
.nav-search input:focus {
  border-color: #64748b;
  box-shadow: 0 0 0 4px rgba(100, 116, 139, 0.18);
}

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

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

.rank-item {
  display: grid;
  grid-template-columns: 56px 84px 1fr auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-soft);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.rank-num {
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: #1e293b;
  color: var(--white);
  font-weight: 900;
}

.rank-item img {
  width: 84px;
  height: 112px;
  border-radius: 12px;
  object-fit: cover;
}

.rank-item b {
  color: #0f172a;
  font-size: 22px;
  font-weight: 900;
}

.player-section {
  padding: 42px 0 64px;
  background: radial-gradient(circle at top right, rgba(100, 116, 139, 0.48), transparent 36%), linear-gradient(135deg, #020617, #0f172a 52%, #1e293b);
  color: var(--white);
}

.player-section h1 {
  max-width: 920px;
  margin: 24px 0 12px;
  font-size: clamp(34px, 6vw, 58px);
  line-height: 1.08;
  font-weight: 900;
}

.player-section p {
  max-width: 860px;
  margin: 0 0 28px;
  color: #cbd5e1;
  font-size: 18px;
}

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

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

.play-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  padding: 0;
  background: #020617;
  transition: opacity 0.25s ease, visibility 0.25s ease;
}

.play-cover img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
}

.play-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, rgba(2, 6, 23, 0.15), rgba(2, 6, 23, 0.7));
}

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

.play-circle {
  position: relative;
  z-index: 2;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  border-radius: 50%;
  background: rgba(255, 255, 255, 0.92);
  color: #0f172a;
  font-size: 34px;
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.45);
  transition: transform 0.25s ease;
}

.play-cover:hover .play-circle {
  transform: scale(1.08);
}

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

.detail-card,
.content-panel,
.side-card {
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.detail-card {
  display: grid;
  grid-template-columns: 240px 1fr;
  gap: 28px;
  padding: 24px;
}

.detail-poster {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: 16px;
  object-fit: cover;
}

.detail-copy h2,
.content-panel h2,
.side-card h2 {
  margin: 0 0 16px;
  color: var(--ink);
  font-size: 24px;
  line-height: 1.2;
}

.detail-meta {
  margin-bottom: 18px;
}

.detail-meta span,
.pill-row span,
.tag-cloud span {
  background: #f1f5f9;
  color: #475569;
}

.lead-text {
  margin: 0 0 18px;
  color: var(--text);
  font-size: 18px;
  font-weight: 700;
}

.content-panel {
  margin-top: 24px;
  padding: 26px;
}

.content-panel p {
  margin: 0 0 14px;
  color: var(--text);
}

.content-panel p:last-child {
  margin-bottom: 0;
}

.tag-cloud {
  gap: 10px;
}

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

.side-card {
  position: sticky;
  top: 96px;
  padding: 22px;
}

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

.related-mini {
  display: flex;
  gap: 12px;
  padding: 10px;
  border-radius: 14px;
  transition: background 0.25s ease;
}

.related-mini:hover {
  background: #f8fafc;
}

.related-mini img {
  width: 78px;
  height: 104px;
  flex: 0 0 78px;
  border-radius: 10px;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.related-mini span {
  min-width: 0;
}

.site-footer {
  margin-top: 48px;
  padding: 36px 0;
  background: linear-gradient(180deg, #0f172a, #020617);
  color: #cbd5e1;
}

.footer-inner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
}

.footer-inner strong {
  display: block;
  color: var(--white);
  font-size: 22px;
  margin-bottom: 6px;
}

.footer-inner p {
  margin: 0;
}

.footer-links {
  display: flex;
  gap: 16px;
  font-weight: 700;
}

.is-hidden-card {
  display: none !important;
}

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

  .rank-list.compact,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .side-card {
    position: static;
  }

  .nav-search {
    display: none;
  }
}

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

  .nav-shell {
    min-height: 64px;
    flex-wrap: wrap;
    gap: 12px;
    padding: 10px 0;
  }

  .brand {
    font-size: 21px;
  }

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

  .main-nav {
    display: none;
    width: 100%;
    flex-direction: column;
    align-items: stretch;
    gap: 0;
    margin: 0;
    padding: 8px 0 2px;
    border-top: 1px solid rgba(148, 163, 184, 0.22);
  }

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

  .main-nav a {
    padding: 11px 2px;
  }

  .hero-carousel {
    min-height: 560px;
    height: 82vh;
  }

  .hero-overlay {
    background: linear-gradient(180deg, rgba(0, 0, 0, 0.72), rgba(15, 23, 42, 0.9));
  }

  .hero-content {
    justify-content: flex-end;
    padding-bottom: 88px;
  }

  .hero-actions {
    margin-top: 22px;
  }

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

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

  .section-title,
  .footer-inner {
    align-items: flex-start;
    flex-direction: column;
  }

  .large-grid,
  .category-overview-grid {
    grid-template-columns: 1fr;
  }

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

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

  .movie-card-body,
  .movie-list-body {
    padding: 12px;
  }

  .movie-card-list {
    display: grid;
    grid-template-columns: 110px 1fr;
  }

  .poster-list {
    width: 110px;
    min-height: 150px;
    flex-basis: 110px;
  }

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

  .toolbar input {
    flex-basis: auto;
  }

  .rank-item {
    grid-template-columns: 42px 70px 1fr;
    gap: 10px;
  }

  .rank-item img {
    width: 70px;
    height: 96px;
  }

  .rank-item b {
    grid-column: 3;
    font-size: 18px;
  }

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

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

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

  .footer-links {
    flex-wrap: wrap;
  }
}

@media (max-width: 480px) {
  .movie-grid,
  .category-grid {
    grid-template-columns: 1fr;
  }

  .hero-content h1,
  .hero-content h2,
  .sub-hero h1,
  .player-section h1 {
    font-size: 36px;
  }

  .category-overview-card {
    grid-template-columns: 110px 1fr;
  }
}
