* {
  box-sizing: border-box;
}

:root {
  --primary-50: #f0f9ff;
  --primary-100: #e0f2fe;
  --primary-500: #0ea5e9;
  --primary-600: #0284c7;
  --primary-700: #0369a1;
  --neutral-50: #fafaf9;
  --neutral-100: #f5f5f4;
  --neutral-200: #e7e5e4;
  --neutral-300: #d6d3d1;
  --neutral-500: #78716c;
  --neutral-700: #44403c;
  --neutral-800: #292524;
  --neutral-900: #1c1917;
  --card-shadow: 0 2px 8px rgba(0, 0, 0, 0.08);
  --card-shadow-hover: 0 12px 30px rgba(2, 132, 199, 0.16);
  --radius: 0.75rem;
}

html {
  scroll-behavior: smooth;
}

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

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

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

button,
input {
  font: inherit;
}

button {
  cursor: pointer;
}

.container-custom {
  width: 100%;
  max-width: 80rem;
  margin: 0 auto;
  padding: 0 1rem;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid var(--neutral-200);
  backdrop-filter: blur(14px);
}

.nav-shell {
  min-height: 4rem;
  display: flex;
  align-items: center;
  gap: 1.5rem;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 0.625rem;
  font-weight: 800;
  color: var(--neutral-900);
}

.brand-mark {
  width: 2.25rem;
  height: 2.25rem;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--primary-500), var(--primary-700));
  box-shadow: 0 10px 24px rgba(14, 165, 233, 0.28);
}

.brand-text {
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 1.25rem;
  font-size: 0.95rem;
  color: var(--neutral-700);
}

.nav-links a {
  transition: color 0.2s ease;
}

.nav-links a:hover {
  color: var(--primary-600);
}

.header-search {
  margin-left: auto;
  display: flex;
  align-items: center;
  width: min(28rem, 36vw);
  border: 1px solid var(--neutral-200);
  border-radius: 999px;
  overflow: hidden;
  background: #fff;
}

.header-search input {
  width: 100%;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 0.625rem 1rem;
  color: var(--neutral-800);
}

.header-search button {
  border: 0;
  color: #fff;
  background: var(--primary-600);
  padding: 0.625rem 1rem;
  transition: background 0.2s ease;
}

.header-search button:hover {
  background: var(--primary-700);
}

.menu-toggle {
  display: none;
  width: 2.5rem;
  height: 2.5rem;
  border: 0;
  background: transparent;
  flex-direction: column;
  justify-content: center;
  gap: 0.35rem;
}

.menu-toggle span {
  display: block;
  height: 2px;
  background: var(--neutral-800);
}

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

.mobile-panel.is-open {
  display: grid;
  gap: 0.75rem;
}

.mobile-panel a {
  color: var(--neutral-700);
  font-weight: 600;
}

.mobile-panel input {
  width: 100%;
  border: 1px solid var(--neutral-200);
  border-radius: 0.5rem;
  padding: 0.65rem 0.85rem;
}

.hero-slider {
  position: relative;
  height: 500px;
  overflow: hidden;
  background: var(--neutral-900);
}

.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-shade {
  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.08));
}

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

.hero-copy {
  max-width: 42rem;
  color: #fff;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  margin-bottom: 0.75rem;
  color: var(--primary-500);
  font-size: 0.85rem;
  font-weight: 700;
  letter-spacing: 0.08em;
  text-transform: uppercase;
}

.hero-copy h1,
.page-hero h1,
.detail-copy h1 {
  margin: 0 0 1rem;
  font-size: clamp(2.25rem, 5vw, 3.75rem);
  line-height: 1.05;
  font-weight: 900;
}

.hero-copy p,
.page-hero p,
.detail-one-line {
  margin: 0 0 1.5rem;
  color: rgba(255, 255, 255, 0.9);
  font-size: clamp(1rem, 2vw, 1.25rem);
  max-width: 44rem;
}

.hero-meta,
.movie-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.hero-meta span,
.movie-tags span {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  font-size: 0.78rem;
  line-height: 1;
}

.hero-meta span {
  padding: 0.45rem 0.7rem;
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}

.hero-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.75rem;
  margin-top: 1.5rem;
}

.btn-primary,
.btn-glass,
.section-link,
.rank-play {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 0.55rem;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
}

.btn-primary {
  color: #fff;
  background: var(--primary-600);
  padding: 0.82rem 1.45rem;
  box-shadow: 0 12px 26px rgba(2, 132, 199, 0.28);
}

.btn-primary:hover,
.rank-play:hover {
  background: var(--primary-700);
  transform: translateY(-1px);
}

.btn-glass {
  color: #fff;
  padding: 0.82rem 1.35rem;
  background: rgba(255, 255, 255, 0.16);
  border: 1px solid rgba(255, 255, 255, 0.24);
  backdrop-filter: blur(10px);
}

.btn-glass:hover {
  background: rgba(255, 255, 255, 0.26);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 5;
  width: 2.75rem;
  height: 2.75rem;
  transform: translateY(-50%);
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.42);
  font-size: 2rem;
  line-height: 1;
  transition: background 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.35rem;
  z-index: 5;
  display: flex;
  gap: 0.5rem;
  transform: translateX(-50%);
}

.hero-dot {
  width: 0.72rem;
  height: 0.72rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.48);
}

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

.quick-search-wrap {
  margin-top: -2rem;
  position: relative;
  z-index: 10;
}

.quick-search {
  display: flex;
  overflow: hidden;
  border-radius: 1rem;
  background: #fff;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.14);
}

.quick-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 1rem 1.25rem;
}

.quick-search button {
  border: 0;
  color: #fff;
  background: var(--primary-600);
  padding: 0 1.5rem;
  font-weight: 700;
}

.page-main {
  padding-top: 2rem;
}

.page-section {
  margin-top: 3rem;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.2rem;
}

.section-heading h2 {
  margin: 0;
  color: var(--neutral-900);
  font-size: clamp(1.45rem, 3vw, 2rem);
  line-height: 1.2;
}

.section-heading p {
  margin: 0.35rem 0 0;
  color: var(--neutral-500);
}

.section-link {
  color: var(--primary-700);
  background: var(--primary-50);
  padding: 0.58rem 0.85rem;
  white-space: nowrap;
}

.section-link:hover {
  color: #fff;
  background: var(--primary-600);
}

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

.movie-card,
.content-card,
.category-card,
.ranking-card,
.filter-panel {
  background: #fff;
  border: 1px solid rgba(231, 229, 228, 0.85);
  border-radius: var(--radius);
  box-shadow: var(--card-shadow);
}

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

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

.poster-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  background: linear-gradient(135deg, var(--primary-700), var(--neutral-900));
}

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

.movie-card:hover .poster-frame img,
.rank-cover:hover img {
  transform: scale(1.05);
}

.poster-missing::after {
  content: attr(data-title);
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
  color: #fff;
  font-weight: 800;
  text-align: center;
  background: linear-gradient(135deg, rgba(2, 132, 199, 0.92), rgba(28, 25, 23, 0.95));
}

.poster-badge {
  position: absolute;
  right: 0.65rem;
  top: 0.65rem;
  z-index: 2;
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.58);
  padding: 0.25rem 0.5rem;
  font-size: 0.75rem;
  backdrop-filter: blur(8px);
}

.movie-card-body {
  padding: 0.95rem;
}

.movie-tags span {
  color: var(--primary-700);
  background: var(--primary-50);
  padding: 0.35rem 0.5rem;
}

.movie-card h3 {
  margin: 0.65rem 0 0.35rem;
  color: var(--neutral-900);
  font-size: 1rem;
  line-height: 1.35;
}

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

.movie-card p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: var(--neutral-500);
  font-size: 0.9rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

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

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

.category-card {
  display: block;
  padding: 1.15rem;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.category-card span {
  display: block;
  color: var(--neutral-900);
  font-size: 1.1rem;
  font-weight: 800;
}

.category-card p {
  margin: 0.45rem 0 0.8rem;
  color: var(--neutral-500);
  font-size: 0.92rem;
}

.category-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
  color: var(--neutral-700);
  font-size: 0.88rem;
}

.category-card li {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.ranking-card {
  padding: 1rem;
}

.ranking-list {
  display: grid;
  gap: 0.85rem;
  margin: 0;
  padding: 0;
  list-style: none;
}

.ranking-item {
  display: grid;
  grid-template-columns: auto 4.25rem minmax(0, 1fr) auto;
  gap: 0.85rem;
  align-items: center;
  padding: 0.65rem;
  border: 1px solid var(--neutral-100);
  border-radius: 0.75rem;
  background: #fff;
}

.rank-number {
  color: var(--primary-600);
  font-weight: 900;
  font-size: 1rem;
}

.rank-cover {
  aspect-ratio: 2 / 3;
  overflow: hidden;
  border-radius: 0.55rem;
  background: var(--neutral-900);
}

.rank-cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.25s ease;
}

.rank-info h3 {
  margin: 0 0 0.2rem;
  font-size: 1rem;
  line-height: 1.35;
}

.rank-info p {
  display: -webkit-box;
  margin: 0 0 0.45rem;
  overflow: hidden;
  color: var(--neutral-500);
  font-size: 0.9rem;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.rank-play {
  color: #fff;
  background: var(--primary-600);
  padding: 0.55rem 0.8rem;
  font-size: 0.85rem;
}

.page-hero {
  position: relative;
  overflow: hidden;
  border-radius: 1.35rem;
  padding: clamp(2rem, 5vw, 4rem);
  color: #fff;
  background: radial-gradient(circle at top left, rgba(14, 165, 233, 0.78), transparent 36%), linear-gradient(135deg, #0f172a, #1c1917 68%, #082f49);
}

.page-hero p {
  margin-bottom: 0;
}

.filter-panel {
  display: grid;
  gap: 0.85rem;
  margin-top: 1.5rem;
  padding: 1rem;
}

.input-field {
  width: 100%;
  border: 1px solid var(--neutral-300);
  border-radius: 0.65rem;
  padding: 0.72rem 0.95rem;
  outline: 0;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.input-field:focus {
  border-color: transparent;
  box-shadow: 0 0 0 3px rgba(14, 165, 233, 0.24);
}

.filter-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
}

.filter-actions button {
  border: 0;
  border-radius: 999px;
  color: var(--primary-700);
  background: var(--primary-50);
  padding: 0.45rem 0.75rem;
  font-weight: 700;
}

.filter-actions button.is-active,
.filter-actions button:hover {
  color: #fff;
  background: var(--primary-600);
}

.empty-state {
  margin: 1rem 0 0;
  color: var(--neutral-500);
  text-align: center;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  min-height: 520px;
  color: #fff;
  background-image: var(--detail-bg);
  background-position: center;
  background-size: cover;
}

.detail-hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.88), rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.3));
  backdrop-filter: blur(2px);
}

.detail-hero-grid {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: minmax(14rem, 18rem) minmax(0, 1fr);
  gap: clamp(1.25rem, 4vw, 3rem);
  align-items: center;
  min-height: 520px;
  padding-top: 2rem;
  padding-bottom: 2rem;
}

.detail-poster {
  border-radius: 1rem;
  box-shadow: 0 25px 55px rgba(0, 0, 0, 0.48);
}

.detail-copy h1 {
  color: #fff;
}

.detail-content {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 1.25rem;
  margin-top: 3rem;
}

.content-card {
  padding: 1.25rem;
}

.content-card h2 {
  margin: 0 0 0.75rem;
  color: var(--neutral-900);
  font-size: 1.25rem;
}

.content-card p {
  margin: 0;
  color: var(--neutral-700);
  line-height: 1.85;
}

.info-list {
  grid-column: 1 / -1;
}

.info-list dl {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 0.75rem;
  margin: 0;
}

.info-list div {
  border-radius: 0.65rem;
  background: var(--neutral-100);
  padding: 0.75rem;
}

.info-list dt {
  color: var(--neutral-500);
  font-size: 0.78rem;
}

.info-list dd {
  margin: 0.25rem 0 0;
  color: var(--neutral-900);
  font-weight: 700;
}

.player-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 1rem;
  background: #000;
  box-shadow: 0 20px 45px rgba(0, 0, 0, 0.24);
}

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

.player-start {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.85rem;
  border: 0;
  color: #fff;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.34), rgba(0, 0, 0, 0.72));
}

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

.play-triangle {
  width: 4.6rem;
  height: 4.6rem;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  position: relative;
  box-shadow: 0 18px 45px rgba(0, 0, 0, 0.3);
}

.play-triangle::after {
  content: "";
  position: absolute;
  left: 1.85rem;
  top: 1.35rem;
  border-left: 1.35rem solid var(--primary-700);
  border-top: 0.9rem solid transparent;
  border-bottom: 0.9rem solid transparent;
}

.player-message {
  position: absolute;
  left: 50%;
  bottom: 1rem;
  transform: translateX(-50%);
  border-radius: 999px;
  color: #fff;
  background: rgba(0, 0, 0, 0.72);
  padding: 0.45rem 0.85rem;
}

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

.site-footer {
  margin-top: 5rem;
  color: var(--neutral-300);
  background: var(--neutral-900);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 2rem;
  padding-top: 3rem;
  padding-bottom: 3rem;
}

.footer-brand {
  color: #fff;
  margin-bottom: 1rem;
}

.site-footer p {
  max-width: 32rem;
  margin: 0;
  color: var(--neutral-300);
}

.site-footer h3 {
  margin: 0 0 0.8rem;
  color: #fff;
  font-size: 1rem;
}

.site-footer a:not(.footer-brand) {
  display: block;
  margin: 0.45rem 0;
  color: var(--neutral-300);
}

.site-footer a:hover {
  color: var(--primary-500);
}

[hidden] {
  display: none !important;
}

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

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

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

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

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

  .menu-toggle {
    display: flex;
    margin-left: auto;
  }

  .hero-slider {
    height: 520px;
  }

  .hero-copy {
    padding: 0 2.5rem;
  }

  .hero-arrow {
    width: 2.25rem;
    height: 2.25rem;
    font-size: 1.45rem;
  }

  .quick-search {
    flex-direction: column;
  }

  .quick-search button {
    padding: 0.85rem 1rem;
  }

  .section-heading {
    align-items: flex-start;
    flex-direction: column;
  }

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

  .ranking-item {
    grid-template-columns: auto 3.8rem minmax(0, 1fr);
  }

  .rank-play {
    grid-column: 2 / -1;
  }

  .detail-hero-grid {
    grid-template-columns: 1fr;
    min-height: auto;
    padding-top: 2rem;
  }

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

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

@media (max-width: 520px) {
  .container-custom {
    padding-left: 0.85rem;
    padding-right: 0.85rem;
  }

  .brand-text {
    max-width: 8rem;
    overflow: hidden;
    text-overflow: ellipsis;
  }

  .hero-copy {
    padding: 0 1.5rem;
  }

  .hero-copy p {
    display: -webkit-box;
    overflow: hidden;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 3;
  }

  .movie-grid,
  .related-grid {
    gap: 0.85rem;
  }

  .movie-card-body {
    padding: 0.75rem;
  }

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