:root {
  --color-primary: #0284c7;
  --color-primary-dark: #0369a1;
  --color-primary-soft: #e0f2fe;
  --color-accent: #f59e0b;
  --color-text: #292524;
  --color-muted: #78716c;
  --color-border: #e7e5e4;
  --color-bg: #fafaf9;
  --shadow-soft: 0 2px 8px rgba(0, 0, 0, 0.08);
  --shadow-card: 0 4px 16px rgba(0, 0, 0, 0.12);
}

* {
  box-sizing: border-box;
}

body {
  min-height: 100vh;
  margin: 0;
  background: var(--color-bg);
  color: var(--color-text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
}

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

button,
input,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.92);
  border-bottom: 1px solid rgba(231, 229, 228, 0.9);
  backdrop-filter: blur(16px);
}

.header-inner {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 4.25rem;
}

.site-logo,
.footer-logo {
  color: var(--color-primary-dark);
  font-size: 1.25rem;
  font-weight: 800;
  letter-spacing: -0.04em;
  white-space: nowrap;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  margin-left: 1rem;
}

.nav-link {
  display: inline-flex;
  align-items: center;
  height: 2.5rem;
  padding: 0 0.85rem;
  border-radius: 999px;
  color: #57534e;
  font-size: 0.95rem;
  transition: color 0.2s ease, background-color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active {
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 0.5rem;
  margin-left: auto;
}

.header-search input,
.mobile-search input,
.input-field {
  width: 100%;
  border: 1px solid #d6d3d1;
  border-radius: 0.65rem;
  background: #fff;
  color: var(--color-text);
  padding: 0.65rem 0.9rem;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input:focus,
.mobile-search input:focus,
.input-field:focus {
  border-color: var(--color-primary);
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.2);
}

.header-search button,
.mobile-search button,
.btn-primary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 0.65rem;
  background: var(--color-primary);
  color: #fff;
  padding: 0.72rem 1.25rem;
  font-weight: 700;
  cursor: pointer;
  transition: background-color 0.2s ease, transform 0.2s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.btn-primary:hover {
  background: var(--color-primary-dark);
  transform: translateY(-1px);
}

.mobile-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  background: var(--color-primary-soft);
  color: var(--color-primary-dark);
  border-radius: 0.65rem;
  padding: 0.55rem 0.75rem;
}

.mobile-nav {
  display: none;
  padding: 0 1rem 1rem;
  border-top: 1px solid var(--color-border);
  background: #fff;
}

.mobile-nav.is-open {
  display: grid;
  gap: 0.5rem;
}

.mobile-search {
  display: flex;
  gap: 0.5rem;
  margin-top: 0.5rem;
}

.hero-carousel {
  position: relative;
  height: 500px;
  overflow: hidden;
  background: #0c0a09;
}

.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-slide > img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.05));
}

.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
}

.hero-text {
  max-width: 44rem;
  color: #fff;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  margin-bottom: 0.9rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  color: rgba(255, 255, 255, 0.92);
  padding: 0.38rem 0.8rem;
  font-size: 0.9rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.hero-text h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.4rem, 6vw, 4.6rem);
  line-height: 1;
  letter-spacing: -0.08em;
}

.hero-text p {
  max-width: 40rem;
  margin: 0 0 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 2vw, 1.25rem);
  line-height: 1.8;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.8rem;
}

.hero-watch {
  padding: 0.85rem 1.8rem;
}

.hero-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 0.55rem;
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  padding: 0.6rem 0.9rem;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  width: 2.8rem;
  height: 2.8rem;
  transform: translateY(-50%);
  border: 0;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.4);
  color: #fff;
  font-size: 2rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.62);
}

.hero-prev {
  left: 1rem;
}

.hero-next {
  right: 1rem;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 1.5rem;
  z-index: 4;
  display: flex;
  gap: 0.5rem;
  transform: translateX(-50%);
}

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

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

.section-block {
  padding: 3rem 0;
}

.section-white {
  background: #fff;
}

.section-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.5rem;
}

.section-head h2 {
  margin: 0;
  color: #1c1917;
  font-size: 1.7rem;
  font-weight: 800;
  letter-spacing: -0.04em;
}

.section-actions {
  display: flex;
  align-items: center;
  gap: 0.5rem;
}

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

.rail-btn {
  width: 2.2rem;
  height: 2.2rem;
  border: 0;
  border-radius: 50%;
  background: #f5f5f4;
  color: #44403c;
  font-size: 1.5rem;
  cursor: pointer;
  transition: background-color 0.2s ease;
}

.rail-btn:hover {
  background: #e7e5e4;
}

.movie-rail {
  display: flex;
  gap: 1rem;
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.movie-rail::-webkit-scrollbar {
  display: none;
}

.rail-item {
  flex: 0 0 18rem;
  scroll-snap-align: start;
}

.movie-grid {
  display: grid;
  gap: 1.5rem;
}

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

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

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

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

.card-link {
  display: block;
  height: 100%;
  color: inherit;
}

.card-cover {
  position: relative;
  height: 12rem;
  overflow: hidden;
  background: #e7e5e4;
}

.card-cover img,
.card-large img,
.horizontal-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}

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

.year-badge,
.rank-badge {
  position: absolute;
  z-index: 2;
  border-radius: 0.5rem;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  font-size: 0.8rem;
  font-weight: 700;
  padding: 0.26rem 0.55rem;
  backdrop-filter: blur(6px);
}

.year-badge {
  top: 0.65rem;
  right: 0.65rem;
}

.rank-badge {
  top: 0.65rem;
  left: 0.65rem;
  min-width: 2rem;
  text-align: center;
  background: var(--color-accent);
}

.card-body {
  padding: 1rem;
}

.card-body h3 {
  display: -webkit-box;
  min-height: 3rem;
  margin: 0 0 0.75rem;
  overflow: hidden;
  color: #1c1917;
  font-size: 1rem;
  font-weight: 800;
  line-height: 1.5;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  transition: color 0.2s ease;
}

.movie-card:hover h3 {
  color: var(--color-primary-dark);
}

.card-body p {
  display: -webkit-box;
  margin: 0 0 0.85rem;
  overflow: hidden;
  color: #57534e;
  font-size: 0.92rem;
  line-height: 1.7;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem;
  color: #78716c;
  font-size: 0.82rem;
}

.card-meta span {
  border-radius: 999px;
  background: #f5f5f4;
  padding: 0.22rem 0.55rem;
}

.card-meta.invert span {
  background: rgba(255, 255, 255, 0.2);
  color: #fff;
  backdrop-filter: blur(6px);
}

.card-horizontal .card-link {
  display: flex;
  min-height: 9rem;
}

.horizontal-cover {
  position: relative;
  flex: 0 0 12rem;
  overflow: hidden;
  background: #e7e5e4;
}

.card-horizontal .card-body {
  flex: 1;
}

.card-horizontal .card-body h3 {
  min-height: auto;
  -webkit-line-clamp: 1;
}

.card-large {
  position: relative;
  min-height: 24rem;
}

.card-large .card-link {
  position: relative;
  height: 100%;
  min-height: 24rem;
}

.card-large img {
  position: absolute;
  inset: 0;
}

.large-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.05));
}

.large-content {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 2;
  padding: 1.5rem;
  color: #fff;
}

.large-content h3 {
  margin: 0 0 0.6rem;
  font-size: 1.6rem;
  font-weight: 900;
}

.large-content p {
  margin: 0 0 0.8rem;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.7;
}

.featured-layout {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 1.5rem;
}

.featured-side {
  display: grid;
  gap: 1.5rem;
}

.category-section {
  background: linear-gradient(135deg, #f0f9ff, #fff7ed);
}

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

.category-tile {
  display: flex;
  min-height: 9rem;
  flex-direction: column;
  justify-content: space-between;
  border: 1px solid rgba(14, 165, 233, 0.16);
  border-radius: 1rem;
  background: rgba(255, 255, 255, 0.82);
  padding: 1rem;
  box-shadow: var(--shadow-soft);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-tile:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-card);
}

.category-tile span {
  color: var(--color-primary-dark);
  font-weight: 900;
}

.category-tile strong {
  color: #1c1917;
  font-size: 1.15rem;
  line-height: 1.35;
}

.category-tile em {
  color: #78716c;
  font-style: normal;
  font-size: 0.9rem;
}

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

.page-hero,
.detail-hero {
  position: relative;
  overflow: hidden;
  background: linear-gradient(135deg, #0c4a6e, #082f49 55%, #111827);
  color: #fff;
}

.compact-hero {
  padding: 4rem 0;
}

.page-hero h1,
.detail-info h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.1rem, 5vw, 4.2rem);
  line-height: 1.04;
  letter-spacing: -0.07em;
}

.page-hero p {
  max-width: 52rem;
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  font-size: 1.08rem;
  line-height: 1.8;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.45rem;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.75);
  font-size: 0.9rem;
}

.breadcrumb a:hover {
  color: #fff;
}

.filter-panel {
  display: grid;
  grid-template-columns: 1fr 12rem 12rem;
  gap: 0.85rem;
  margin-bottom: 1.5rem;
}

.searchable-grid .movie-card[hidden] {
  display: none;
}

.category-overview-card {
  overflow: hidden;
  border-radius: 1rem;
  background: #fff;
  box-shadow: var(--shadow-soft);
}

.category-overview-card a {
  display: block;
  height: 100%;
}

.category-covers {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  height: 13rem;
  background: #e7e5e4;
}

.category-covers img {
  height: 100%;
  object-fit: cover;
}

.category-overview-body {
  padding: 1.1rem;
}

.category-overview-body h2 {
  margin: 0 0 0.5rem;
  font-size: 1.25rem;
  font-weight: 900;
}

.category-overview-body p {
  margin: 0 0 0.8rem;
  color: #57534e;
  line-height: 1.7;
}

.category-overview-body span {
  display: -webkit-box;
  overflow: hidden;
  color: var(--color-primary-dark);
  font-size: 0.9rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.ranking-hero {
  padding: 4rem 0;
}

.ranking-hero-layout {
  display: grid;
  grid-template-columns: 1fr 24rem;
  align-items: center;
  gap: 2rem;
}

.ranking-champion .card-large {
  min-height: 28rem;
}

.detail-hero {
  min-height: 36rem;
  padding: 3rem 0;
}

.detail-bg,
.detail-bg-mask {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.detail-bg {
  object-fit: cover;
  filter: blur(18px) scale(1.08);
  opacity: 0.35;
}

.detail-bg-mask {
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.28));
}

.detail-hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: 18rem 1fr;
  gap: 2rem;
  align-items: center;
}

.detail-breadcrumb {
  grid-column: 1 / -1;
  margin-bottom: 0;
}

.detail-poster {
  overflow: hidden;
  border-radius: 1rem;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.32);
}

.detail-poster img {
  aspect-ratio: 3 / 4;
  object-fit: cover;
}

.detail-info p {
  max-width: 56rem;
  margin: 0 0 1.25rem;
  color: rgba(255, 255, 255, 0.88);
  font-size: 1.08rem;
  line-height: 1.85;
}

.detail-meta-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.75rem;
  margin-bottom: 1rem;
  color: rgba(255, 255, 255, 0.82);
}

.detail-meta-grid span {
  border-radius: 0.7rem;
  background: rgba(255, 255, 255, 0.12);
  padding: 0.65rem 0.8rem;
  backdrop-filter: blur(8px);
}

.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  margin-bottom: 1.2rem;
}

.tag-cloud span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.16);
  padding: 0.35rem 0.7rem;
  color: rgba(255, 255, 255, 0.92);
  font-size: 0.88rem;
}

.player-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 20rem;
  gap: 1.5rem;
  align-items: stretch;
}

.player-box {
  position: relative;
  overflow: hidden;
  border-radius: 1rem;
  background: #0c0a09;
  box-shadow: var(--shadow-card);
  aspect-ratio: 16 / 9;
}

.player-box video,
.player-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.player-box video {
  z-index: 1;
  background: #000;
  object-fit: contain;
}

.player-cover {
  z-index: 2;
  border: 0;
  padding: 0;
  cursor: pointer;
  background: #000;
}

.player-cover.is-hidden {
  display: none;
}

.player-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.72;
}

.play-icon {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  width: 5rem;
  height: 5rem;
  place-items: center;
  transform: translate(-50%, -50%);
  border-radius: 50%;
  background: rgba(2, 132, 199, 0.92);
  color: #fff;
  font-size: 2.2rem;
  box-shadow: 0 18px 45px rgba(2, 132, 199, 0.4);
}

.player-aside,
.content-card {
  border-radius: 1rem;
  background: #fff;
  padding: 1.5rem;
  box-shadow: var(--shadow-soft);
}

.player-aside h2,
.content-card h2 {
  margin: 0 0 0.85rem;
  font-size: 1.35rem;
  font-weight: 900;
}

.player-aside p,
.content-card p {
  margin: 0 0 1rem;
  color: #57534e;
  line-height: 1.85;
}

.aside-link {
  color: var(--color-primary-dark);
  font-weight: 800;
}

.detail-content {
  max-width: 64rem;
}

.site-footer {
  background: #1c1917;
  color: rgba(255, 255, 255, 0.74);
  padding: 2.5rem 0;
}

.footer-inner {
  display: grid;
  grid-template-columns: 1fr 2fr;
  gap: 2rem;
}

.footer-logo {
  display: inline-flex;
  margin-bottom: 0.8rem;
  color: #fff;
}

.footer-inner p {
  margin: 0;
  line-height: 1.8;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 0.7rem 1rem;
}

.footer-links a {
  color: rgba(255, 255, 255, 0.8);
}

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

@media (min-width: 768px) {
  .hero-carousel {
    height: 600px;
  }
}

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

  .ranking-hero-layout,
  .player-layout {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 860px) {
  .desktop-nav,
  .header-search {
    display: none;
  }

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

  .hero-carousel {
    height: 520px;
  }

  .hero-arrow {
    display: none;
  }

  .featured-layout,
  .ranking-list,
  .footer-inner,
  .detail-hero-inner {
    grid-template-columns: 1fr;
  }

  .detail-poster {
    max-width: 16rem;
  }

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

@media (max-width: 640px) {
  .section-block {
    padding: 2rem 0;
  }

  .grid-four,
  .grid-three,
  .category-grid,
  .category-overview-grid {
    grid-template-columns: 1fr 1fr;
    gap: 1rem;
  }

  .rail-item {
    flex-basis: 16rem;
  }

  .card-cover {
    height: 10rem;
  }

  .card-horizontal .card-link {
    flex-direction: column;
  }

  .horizontal-cover {
    flex-basis: 11rem;
  }

  .footer-links {
    justify-content: flex-start;
  }
}

@media (max-width: 460px) {
  .grid-four,
  .grid-three,
  .category-grid,
  .category-overview-grid {
    grid-template-columns: 1fr;
  }

  .hero-text h1,
  .page-hero h1,
  .detail-info h1 {
    font-size: 2.1rem;
  }

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