* {
  box-sizing: border-box;
}

:root {
  --blue: #2563eb;
  --cyan: #06b6d4;
  --teal: #14b8a6;
  --yellow: #facc15;
  --orange: #f97316;
  --red: #ef4444;
  --green: #10b981;
  --slate: #0f172a;
  --muted: #64748b;
  --card: #ffffff;
  --line: rgba(15, 23, 42, 0.1);
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 6px 18px rgba(15, 23, 42, 0.08);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: #1f2937;
  background: linear-gradient(135deg, #eff6ff 0%, #ecfeff 48%, #f0fdfa 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 100;
  background: linear-gradient(90deg, var(--blue), var(--cyan), var(--teal));
  box-shadow: 0 10px 25px rgba(37, 99, 235, 0.24);
}

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

.logo {
  color: #ffffff;
  font-size: 24px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  color: #ffffff;
  font-weight: 650;
}

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

.nav-links a:hover,
.nav-links a.active {
  color: #fef08a;
}

.header-search {
  display: flex;
  align-items: center;
  min-width: 260px;
}

.header-search input {
  width: 100%;
  border: 0;
  outline: 0;
  padding: 10px 12px;
  border-radius: 12px 0 0 12px;
  color: #0f172a;
}

.header-search button {
  border: 0;
  padding: 10px 14px;
  border-radius: 0 12px 12px 0;
  background: var(--yellow);
  color: #0f172a;
  font-weight: 800;
  cursor: pointer;
}

.mobile-toggle {
  display: none;
  border: 0;
  background: rgba(255, 255, 255, 0.18);
  color: #ffffff;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  cursor: pointer;
}

.mobile-nav {
  display: none;
  padding: 0 0 14px;
}

.mobile-nav a {
  display: block;
  color: #ffffff;
  padding: 10px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.16);
}

.hero {
  position: relative;
  overflow: hidden;
  color: #ffffff;
  background: linear-gradient(90deg, #2563eb 0%, #06b6d4 48%, #14b8a6 100%);
}

.hero::before,
.hero::after {
  content: "";
  position: absolute;
  border-radius: 999px;
  filter: blur(34px);
  opacity: 0.22;
  background: #ffffff;
  animation: pulseGlow 4s ease-in-out infinite;
}

.hero::before {
  width: 270px;
  height: 270px;
  top: 42px;
  left: 8%;
}

.hero::after {
  width: 390px;
  height: 390px;
  right: 4%;
  bottom: -110px;
  background: #fde047;
  animation-delay: 0.7s;
}

.hero-inner {
  position: relative;
  z-index: 2;
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(360px, 450px);
  gap: 42px;
  align-items: center;
  min-height: 540px;
  padding: 68px 0;
}

.hero-copy h1 {
  margin: 0 0 18px;
  font-size: clamp(42px, 6vw, 66px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.03em;
  animation: fadeIn 0.9s ease both;
}

.hero-copy p {
  max-width: 700px;
  margin: 0 0 30px;
  color: #dbeafe;
  font-size: clamp(18px, 2.4vw, 25px);
}

.hero-badges,
.movie-badges,
.meta-row,
.tag-list,
.quick-links {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 12px 18px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(12px);
  font-weight: 750;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  border: 0;
  border-radius: 14px;
  padding: 12px 18px;
  font-weight: 800;
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease, opacity 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
  box-shadow: 0 12px 24px rgba(15, 23, 42, 0.16);
}

.btn-primary {
  background: #ffffff;
  color: #2563eb;
}

.btn-accent {
  background: #facc15;
  color: #0f172a;
}

.btn-line {
  border: 1px solid rgba(255, 255, 255, 0.42);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.12);
}

.hero-carousel {
  position: relative;
  min-height: 430px;
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  transform: translateY(18px) scale(0.98);
  pointer-events: none;
  transition: opacity 0.45s ease, transform 0.45s ease;
}

.hero-slide.active {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.hero-card {
  overflow: hidden;
  min-height: 430px;
  border-radius: 28px;
  background: rgba(15, 23, 42, 0.28);
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.28);
}

.hero-card .poster-frame {
  position: relative;
  height: 430px;
}

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

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

.image-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0.35), rgba(0, 0, 0, 0.05));
}

.hero-card-body {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  padding: 26px;
}

.hero-card-title {
  margin: 12px 0 8px;
  font-size: 28px;
  line-height: 1.16;
  font-weight: 900;
}

.hero-card-desc {
  display: -webkit-box;
  margin: 0 0 16px;
  overflow: hidden;
  color: #e5e7eb;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.carousel-dots {
  position: absolute;
  left: 22px;
  bottom: -28px;
  display: flex;
  gap: 9px;
}

.carousel-dots button {
  width: 10px;
  height: 10px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.45);
  cursor: pointer;
}

.carousel-dots button.active {
  width: 28px;
  background: #ffffff;
}

.section {
  padding: 58px 0;
}

.section.alt-orange {
  background: linear-gradient(90deg, #ffedd5, #fee2e2);
}

.section.alt-green {
  background: linear-gradient(90deg, #dcfce7, #d1fae5);
}

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

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 0;
  color: #1f2937;
  font-size: clamp(25px, 3vw, 34px);
  line-height: 1.2;
  font-weight: 900;
}

.section-title .mark {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  border-radius: 14px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--blue), var(--cyan));
  box-shadow: var(--shadow-soft);
}

.grid {
  display: grid;
  gap: 22px;
}

.grid.featured-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 28px;
}

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

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

.featured-card,
.movie-card,
.category-tile,
.info-panel,
.rank-row,
.related-card {
  background: var(--card);
  box-shadow: var(--shadow-soft);
}

.featured-card,
.movie-card,
.related-card {
  display: block;
  overflow: hidden;
  border-radius: 18px;
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.featured-card {
  position: relative;
  min-height: 420px;
  border-radius: 24px;
  box-shadow: 0 22px 42px rgba(15, 23, 42, 0.18);
}

.featured-card:hover,
.movie-card:hover,
.related-card:hover {
  transform: translateY(-8px);
  box-shadow: 0 24px 48px rgba(15, 23, 42, 0.18);
}

.featured-card .poster-frame {
  height: 420px;
}

.featured-body {
  position: absolute;
  inset: auto 0 0 0;
  padding: 24px;
  color: #ffffff;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.86), rgba(0, 0, 0, 0));
}

.movie-card .poster-frame,
.related-card .poster-frame {
  position: relative;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #dbeafe, #ccfbf1);
}

.year-pill {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 8px;
  background: rgba(0, 0, 0, 0.68);
  color: #ffffff;
  font-size: 12px;
}

.play-hover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  opacity: 0;
  color: #2563eb;
  background: rgba(0, 0, 0, 0.38);
  transition: opacity 0.2s ease;
}

.play-hover span {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.92);
  font-size: 24px;
}

.movie-card:hover .play-hover,
.featured-card:hover .play-hover,
.related-card:hover .play-hover {
  opacity: 1;
}

.card-body {
  padding: 16px;
}

.badge {
  display: inline-flex;
  align-items: center;
  max-width: 100%;
  padding: 4px 8px;
  border-radius: 8px;
  color: #ffffff;
  background: linear-gradient(90deg, #3b82f6, #06b6d4);
  font-size: 12px;
  font-weight: 750;
  white-space: nowrap;
}

.badge.green {
  background: linear-gradient(90deg, #22c55e, #10b981);
}

.badge.red {
  background: #ef4444;
}

.badge.orange {
  background: linear-gradient(90deg, #f97316, #ef4444);
}

.card-title {
  display: -webkit-box;
  margin: 10px 0 8px;
  overflow: hidden;
  color: #1f2937;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 850;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-desc {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #64748b;
  font-size: 14px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.category-tile {
  display: block;
  min-height: 180px;
  padding: 24px;
  border-radius: 24px;
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: linear-gradient(135deg, #ffffff, #eff6ff);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-tile:hover {
  transform: translateY(-7px);
  box-shadow: 0 24px 44px rgba(15, 23, 42, 0.14);
}

.category-tile h3 {
  margin: 0 0 8px;
  font-size: 22px;
}

.category-tile p {
  color: #64748b;
}

.page-hero {
  padding: 54px 0;
  color: #ffffff;
  background: linear-gradient(90deg, #2563eb, #06b6d4, #14b8a6);
}

.page-hero h1 {
  margin: 0 0 14px;
  font-size: clamp(34px, 5vw, 54px);
  line-height: 1.1;
  font-weight: 900;
}

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

.filter-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 180px 180px;
  gap: 12px;
  padding: 18px;
  margin: 28px 0;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.filter-panel input,
.filter-panel select,
.search-panel input {
  width: 100%;
  border: 1px solid var(--line);
  outline: none;
  padding: 12px 14px;
  border-radius: 14px;
  color: #0f172a;
  background: #f8fafc;
}

.search-panel {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 12px;
  padding: 18px;
  margin: 28px 0;
  border-radius: 22px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.search-panel button {
  border: 0;
  border-radius: 14px;
  padding: 0 24px;
  color: #ffffff;
  background: linear-gradient(90deg, #2563eb, #06b6d4);
  font-weight: 850;
  cursor: pointer;
}

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

.rank-row {
  display: grid;
  grid-template-columns: 64px 132px minmax(0, 1fr) auto;
  gap: 18px;
  align-items: center;
  padding: 14px;
  border-radius: 20px;
}

.rank-no {
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, #f97316, #ef4444);
  font-size: 18px;
  font-weight: 900;
}

.rank-thumb {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 16px;
  background: #dbeafe;
}

.rank-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.rank-info h3 {
  margin: 0 0 6px;
  font-size: 19px;
}

.rank-info p {
  display: -webkit-box;
  margin: 0;
  overflow: hidden;
  color: #64748b;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rank-score {
  padding: 8px 12px;
  border-radius: 999px;
  color: #92400e;
  background: #fef3c7;
  font-weight: 900;
}

.breadcrumb {
  margin: 24px 0;
  color: #64748b;
  font-size: 14px;
}

.breadcrumb a {
  color: #2563eb;
  font-weight: 700;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(300px, 0.86fr);
  gap: 28px;
  align-items: start;
}

.player-card,
.detail-card,
.side-card {
  overflow: hidden;
  border-radius: 24px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.player-box {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #020617;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  cursor: pointer;
  background: radial-gradient(circle at center, rgba(37, 99, 235, 0.12), rgba(2, 6, 23, 0.72));
  transition: opacity 0.2s ease, visibility 0.2s ease;
}

.player-overlay.is-hidden {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.player-start {
  display: grid;
  place-items: center;
  width: 86px;
  height: 86px;
  border-radius: 999px;
  color: #2563eb;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 18px 38px rgba(0, 0, 0, 0.28);
  font-size: 34px;
  transform: scale(1);
  transition: transform 0.2s ease;
}

.player-overlay:hover .player-start {
  transform: scale(1.08);
}

.detail-content {
  padding: 24px;
}

.detail-content h1 {
  margin: 0 0 12px;
  color: #111827;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.18;
  font-weight: 950;
}

.detail-content h2,
.side-card h2 {
  margin: 0 0 14px;
  color: #111827;
  font-size: 24px;
}

.detail-content p {
  color: #334155;
  font-size: 16px;
}

.poster-side img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
}

.side-card {
  padding: 18px;
}

.tag {
  display: inline-flex;
  align-items: center;
  padding: 6px 10px;
  border-radius: 999px;
  color: #0f766e;
  background: #ccfbf1;
  font-size: 13px;
  font-weight: 750;
}

.related-list {
  display: grid;
  gap: 12px;
}

.related-card {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  padding: 10px;
  border-radius: 16px;
}

.related-card .poster-frame {
  border-radius: 12px;
}

.related-card h3 {
  display: -webkit-box;
  margin: 0 0 6px;
  overflow: hidden;
  font-size: 15px;
  line-height: 1.35;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.related-card p {
  margin: 0;
  color: #64748b;
  font-size: 12px;
}

.site-footer {
  margin-top: 62px;
  color: #cbd5e1;
  background: linear-gradient(90deg, #1e293b, #334155, #1e293b);
}

.footer-inner {
  display: grid;
  grid-template-columns: minmax(0, 1fr) auto;
  gap: 20px;
  align-items: center;
  padding: 30px 0;
}

.footer-title {
  margin: 0 0 8px;
  color: #ffffff;
  font-size: 22px;
  font-weight: 900;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 16px;
}

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

.no-results {
  display: none;
  padding: 38px;
  border-radius: 22px;
  color: #64748b;
  text-align: center;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.no-results.visible {
  display: block;
}

@keyframes fadeIn {
  from {
    opacity: 0;
    transform: translateY(20px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes pulseGlow {
  0%, 100% {
    transform: scale(1);
  }
  50% {
    transform: scale(1.08);
  }
}

@media (max-width: 1024px) {
  .header-search {
    min-width: 210px;
  }

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

  .hero-carousel {
    min-height: 420px;
  }

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

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

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

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

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

  .hero-inner {
    min-height: auto;
    padding: 48px 0 76px;
  }

  .hero-carousel,
  .hero-card .poster-frame,
  .hero-card {
    min-height: 360px;
    height: 360px;
  }

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

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

  .filter-panel,
  .search-panel,
  .rank-row {
    grid-template-columns: 1fr;
  }

  .rank-thumb {
    width: 100%;
  }

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

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

  .logo {
    font-size: 20px;
  }

  .grid.card-grid,
  .grid.category-grid,
  .grid.featured-grid {
    grid-template-columns: 1fr;
  }

  .hero-copy h1 {
    font-size: 40px;
  }

  .hero-card-title {
    font-size: 24px;
  }

  .rank-row {
    padding: 12px;
  }

  .related-card {
    grid-template-columns: 96px 1fr;
  }
}
