:root {
  --night-950: #071a2d;
  --night-900: #102a43;
  --night-850: #18344f;
  --night-800: #243b53;
  --night-700: #334e68;
  --night-600: #486581;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-300: #d1d5db;
  --gray-400: #9ca3af;
  --amber-500: #f59e0b;
  --amber-400: #fbbf24;
  --amber-600: #d97706;
  --shadow-night: 0 10px 30px -5px rgba(16, 42, 67, 0.5);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--night-900);
  color: var(--gray-100);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.5;
}

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

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

button,
input,
select {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(36, 59, 83, 0.95);
  border-bottom: 1px solid var(--night-700);
  backdrop-filter: blur(16px);
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
  font-weight: 800;
  white-space: nowrap;
  color: var(--gray-100);
  transition: color 0.3s ease;
}

.logo:hover {
  color: var(--amber-400);
}

.logo-mark {
  display: inline-grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--amber-500);
  color: white;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.35);
}

.nav-links {
  display: flex;
  align-items: center;
  gap: 26px;
  color: var(--gray-300);
}

.nav-links a,
.mobile-menu a,
.footer-links a {
  transition: color 0.3s ease;
}

.nav-links a:hover,
.mobile-menu a:hover,
.footer-links a:hover {
  color: var(--amber-400);
}

.nav-search {
  position: relative;
  min-width: 240px;
}

.nav-search input,
.filter-panel input,
.filter-panel select {
  width: 100%;
  border: 0;
  outline: 0;
  border-radius: 10px;
  background: var(--night-700);
  color: var(--gray-100);
  padding: 10px 14px;
  transition: box-shadow 0.3s ease, background 0.3s ease;
}

.nav-search input:focus,
.filter-panel input:focus,
.filter-panel select:focus {
  box-shadow: 0 0 0 2px var(--amber-500);
  background: #3b5872;
}

.menu-button {
  display: none;
  width: 40px;
  height: 40px;
  border: 0;
  border-radius: 10px;
  background: var(--night-700);
  color: var(--gray-100);
}

.mobile-menu {
  display: none;
  border-top: 1px solid var(--night-700);
  padding: 12px 0 18px;
}

.mobile-menu.is-open {
  display: block;
}

.mobile-menu a {
  display: block;
  padding: 10px 0;
  color: var(--gray-300);
}

.hero {
  position: relative;
  min-height: 70vh;
  overflow: hidden;
}

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

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(to bottom, rgba(16, 42, 67, 0.95), rgba(36, 59, 83, 0.8));
}

.hero-inner {
  position: relative;
  min-height: 70vh;
  display: flex;
  align-items: center;
  padding: 80px 0;
}

.hero-content {
  width: min(100%, 720px);
  animation: fadeIn 0.6s ease-in-out;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 18px;
  padding: 7px 12px;
  border-radius: 999px;
  color: var(--amber-400);
  background: rgba(245, 158, 11, 0.14);
  border: 1px solid rgba(245, 158, 11, 0.3);
  font-size: 14px;
  font-weight: 700;
}

.hero h1,
.page-hero h1 {
  margin: 0 0 18px;
  font-size: clamp(40px, 7vw, 72px);
  line-height: 1.02;
  color: white;
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.55);
}

.hero p {
  margin: 0 0 28px;
  max-width: 680px;
  color: var(--gray-200);
  font-size: clamp(17px, 2vw, 22px);
  text-shadow: 0 2px 4px rgba(0, 0, 0, 0.5);
}

.hero-actions,
.section-head,
.card-meta,
.tag-row,
.breadcrumb,
.detail-meta,
.footer-grid,
.category-card-top,
.rank-item,
.player-title-row {
  display: flex;
  align-items: center;
}

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

.btn-primary,
.btn-secondary,
.btn-ghost {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  border-radius: 10px;
  padding: 10px 24px;
  font-weight: 700;
  transition: transform 0.3s ease, background 0.3s ease, box-shadow 0.3s ease, color 0.3s ease;
}

.btn-primary {
  background: var(--amber-500);
  color: white;
}

.btn-primary:hover {
  transform: translateY(-2px);
  background: var(--amber-600);
  box-shadow: 0 0 20px rgba(251, 191, 36, 0.3);
}

.btn-secondary {
  background: var(--night-700);
  color: var(--gray-100);
}

.btn-secondary:hover {
  transform: translateY(-2px);
  background: var(--night-600);
}

.btn-ghost {
  color: var(--amber-400);
  padding-inline: 0;
}

.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.45);
  transition: width 0.3s ease, background 0.3s ease;
}

.hero-dot.is-active {
  width: 34px;
  background: var(--amber-500);
}

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

.section-head {
  justify-content: space-between;
  gap: 20px;
  margin-bottom: 28px;
}

.section-title {
  display: flex;
  align-items: center;
  gap: 12px;
}

.section-title h2,
.section-title h1 {
  margin: 0;
  font-size: clamp(28px, 4vw, 38px);
  color: var(--gray-100);
}

.section-icon {
  width: 34px;
  height: 34px;
  border-radius: 10px;
  display: inline-grid;
  place-items: center;
  background: rgba(245, 158, 11, 0.16);
  color: var(--amber-400);
}

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

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

.movie-card,
.category-card,
.info-panel,
.rank-panel,
.filter-panel,
.detail-card {
  overflow: hidden;
  border-radius: 16px;
  background: var(--night-800);
  box-shadow: var(--shadow-night);
}

.movie-card {
  position: relative;
  transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  box-shadow: 0 18px 42px rgba(0, 0, 0, 0.28);
}

.poster-wrap {
  position: relative;
  display: block;
  aspect-ratio: 2 / 3;
  overflow: hidden;
  background: var(--night-850);
}

.movie-grid.large .poster-wrap {
  aspect-ratio: 16 / 10;
}

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

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

.play-hover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(to top, rgba(0, 0, 0, 0.75), transparent 55%);
  opacity: 0;
  transition: opacity 0.3s ease;
}

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

.play-hover span,
.play-ring {
  display: inline-grid;
  place-items: center;
  width: 58px;
  height: 58px;
  border-radius: 50%;
  background: rgba(245, 158, 11, 0.92);
  color: white;
  font-size: 22px;
  box-shadow: 0 0 24px rgba(245, 158, 11, 0.35);
}

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

.movie-card h3 {
  margin: 8px 0 8px;
  color: var(--gray-100);
  font-size: 18px;
  line-height: 1.25;
}

.movie-card p {
  margin: 0 0 12px;
  color: var(--gray-400);
  font-size: 14px;
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-meta,
.detail-meta {
  flex-wrap: wrap;
  gap: 8px;
  color: var(--gray-400);
  font-size: 13px;
}

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

.tag,
.pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 5px 10px;
  font-size: 12px;
  color: var(--gray-300);
  background: var(--night-700);
}

.tag.hot,
.pill.hot {
  color: white;
  background: var(--amber-500);
}

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

.category-card {
  position: relative;
  min-height: 190px;
  padding: 24px;
  border: 1px solid rgba(245, 158, 11, 0.14);
  transition: transform 0.3s ease, border-color 0.3s ease;
}

.category-card:hover {
  transform: translateY(-5px);
  border-color: rgba(245, 158, 11, 0.45);
}

.category-card-top {
  justify-content: space-between;
  margin-bottom: 22px;
}

.category-card h2,
.category-card h3 {
  margin: 0 0 12px;
  font-size: 24px;
}

.category-card p,
.info-panel p,
.detail-card p,
.page-hero p {
  color: var(--gray-300);
}

.rank-layout {
  display: grid;
  grid-template-columns: 1.4fr 1fr;
  gap: 28px;
}

.rank-panel {
  padding: 22px;
}

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

.rank-item {
  justify-content: space-between;
  gap: 16px;
  padding: 14px;
  border-radius: 14px;
  background: rgba(51, 78, 104, 0.48);
  transition: background 0.3s ease, transform 0.3s ease;
}

.rank-item:hover {
  transform: translateX(4px);
  background: rgba(72, 101, 129, 0.65);
}

.rank-left {
  display: flex;
  min-width: 0;
  align-items: center;
  gap: 14px;
}

.rank-num {
  display: inline-grid;
  place-items: center;
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--amber-500);
  color: white;
  font-weight: 900;
}

.rank-thumb {
  width: 58px;
  height: 78px;
  flex: 0 0 auto;
  overflow: hidden;
  border-radius: 10px;
  background: var(--night-850);
}

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

.rank-text {
  min-width: 0;
}

.rank-text h3 {
  margin: 0 0 5px;
  overflow: hidden;
  color: var(--gray-100);
  font-size: 17px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-text p {
  margin: 0;
  color: var(--gray-400);
  font-size: 13px;
}

.page-hero {
  background: linear-gradient(135deg, #29203d, #40365c, #5a4d7e);
  padding: 72px 0;
  text-align: center;
}

.page-hero h1 {
  font-size: clamp(34px, 6vw, 54px);
}

.page-hero p {
  width: min(760px, 100%);
  margin: 0 auto;
  font-size: 18px;
}

.filter-panel {
  display: grid;
  grid-template-columns: 1fr 180px 180px;
  gap: 16px;
  margin-bottom: 28px;
  padding: 18px;
}

.empty-state {
  display: none;
  padding: 26px;
  border-radius: 14px;
  color: var(--gray-300);
  background: var(--night-800);
  text-align: center;
}

.empty-state.is-visible {
  display: block;
}

.breadcrumb {
  flex-wrap: wrap;
  gap: 9px;
  margin: 28px 0;
  color: var(--gray-400);
  font-size: 14px;
}

.breadcrumb a:hover {
  color: var(--amber-400);
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.9fr);
  gap: 28px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 16px;
  background: black;
  box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.35);
}

.player-shell video {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: black;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  border: 0;
  background: radial-gradient(circle at center, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.68));
  color: white;
  transition: opacity 0.3s ease, visibility 0.3s ease;
}

.player-shell.is-playing .player-cover {
  visibility: hidden;
  opacity: 0;
  pointer-events: none;
}

.detail-card {
  margin-top: 22px;
  padding: 24px;
}

.detail-card h1 {
  margin: 0 0 14px;
  font-size: clamp(30px, 5vw, 44px);
  color: var(--gray-100);
}

.detail-card h2,
.info-panel h2 {
  margin: 24px 0 12px;
  color: var(--gray-100);
  font-size: 22px;
}

.detail-card p {
  margin: 0 0 16px;
  line-height: 1.8;
}

.info-panel {
  position: sticky;
  top: 88px;
  padding: 22px;
}

.info-table {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.info-row {
  display: flex;
  justify-content: space-between;
  gap: 16px;
  color: var(--gray-300);
  border-bottom: 1px solid rgba(51, 78, 104, 0.7);
  padding-bottom: 12px;
}

.info-row span:first-child {
  color: var(--gray-400);
}

.site-footer {
  margin-top: 80px;
  border-top: 1px solid var(--night-700);
  background: var(--night-800);
}

.footer-grid {
  align-items: flex-start;
  justify-content: space-between;
  gap: 34px;
  padding: 42px 0;
}

.footer-brand {
  max-width: 540px;
}

.footer-brand p {
  color: var(--gray-400);
}

.footer-links {
  display: grid;
  gap: 10px;
  min-width: 160px;
  color: var(--gray-400);
}

.footer-links strong {
  color: var(--gray-100);
}

.footer-bottom {
  border-top: 1px solid var(--night-700);
  padding: 18px 0;
  color: var(--gray-400);
  text-align: center;
  font-size: 14px;
}

@keyframes fadeIn {
  from {
    opacity: 0;
  }

  to {
    opacity: 1;
  }
}

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

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

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

  .menu-button {
    display: inline-grid;
    place-items: center;
  }

  .hero,
  .hero-inner {
    min-height: 620px;
  }

  .main-section {
    padding-top: 54px;
  }

  .section-head,
  .footer-grid,
  .player-title-row {
    align-items: flex-start;
    flex-direction: column;
  }

  .movie-grid,
  .movie-grid.large,
  .category-grid,
  .rank-layout,
  .detail-layout,
  .filter-panel {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }

  .filter-panel input {
    grid-column: 1 / -1;
  }

  .info-panel {
    position: static;
  }
}

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

  .movie-grid,
  .movie-grid.large,
  .category-grid,
  .rank-layout,
  .detail-layout,
  .filter-panel {
    grid-template-columns: 1fr;
  }

  .hero h1,
  .page-hero h1 {
    font-size: 36px;
  }

  .hero p,
  .page-hero p {
    font-size: 16px;
  }

  .rank-item {
    align-items: flex-start;
    flex-direction: column;
  }
}
