:root {
  color-scheme: light;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --accent: #f97316;
  --accent-deep: #dc2626;
  --ink: #111827;
  --muted: #6b7280;
  --soft: #f8fafc;
  --line: #e5e7eb;
  --card: #ffffff;
  --shadow: 0 20px 50px rgba(15, 23, 42, 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: #f9fafb;
  color: var(--ink);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid var(--line);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  backdrop-filter: blur(16px);
}

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

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

.logo-link {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.logo-mark {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  background: linear-gradient(135deg, #dc2626, #f97316);
  color: #ffffff;
  font-weight: 900;
  box-shadow: 0 14px 24px rgba(249, 115, 22, 0.26);
}

.logo-title {
  margin: 0;
  font-size: 20px;
  line-height: 1.05;
  font-weight: 800;
  color: #111827;
}

.logo-subtitle {
  margin: 3px 0 0;
  font-size: 12px;
  color: #6b7280;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 4px;
}

.nav-link {
  padding: 9px 12px;
  border-radius: 10px;
  color: #374151;
  font-size: 14px;
  font-weight: 650;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--primary);
  background: #eff6ff;
}

.header-actions {
  display: flex;
  align-items: center;
  gap: 10px;
}

.search-form {
  position: relative;
  display: flex;
  align-items: center;
}

.search-input,
.page-filter-input {
  width: 230px;
  height: 40px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  padding: 0 44px 0 16px;
  background: #ffffff;
  color: #111827;
  outline: none;
  transition: border 0.2s ease, box-shadow 0.2s ease;
}

.search-input:focus,
.page-filter-input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.12);
}

.search-submit {
  position: absolute;
  right: 4px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 0;
  background: var(--primary);
  color: #ffffff;
  cursor: pointer;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}

.mobile-toggle {
  display: none;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #ffffff;
  color: #111827;
  cursor: pointer;
}

.mobile-panel {
  display: none;
  border-top: 1px solid var(--line);
  background: #ffffff;
}

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

.mobile-nav {
  display: grid;
  gap: 8px;
  padding: 16px 0;
}

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

.hero-slider {
  position: relative;
  height: 540px;
  overflow: hidden;
  background: linear-gradient(90deg, #0f172a, #334155);
}

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

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

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

.hero-layer {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.82), rgba(0, 0, 0, 0.52) 42%, rgba(15, 23, 42, 0.12));
}

.hero-content {
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: min(1180px, calc(100% - 32px));
  padding: 0 0 58px;
  color: #ffffff;
}

.hero-badge {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 16px;
  border-radius: 999px;
  background: linear-gradient(90deg, #dc2626, #ec4899);
  color: #ffffff;
  font-size: 14px;
  font-weight: 800;
  box-shadow: 0 18px 30px rgba(220, 38, 38, 0.25);
}

.hero-title {
  max-width: 760px;
  margin: 18px 0 14px;
  font-size: clamp(34px, 5vw, 58px);
  line-height: 1.04;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.hero-text {
  max-width: 680px;
  margin: 0 0 24px;
  color: #e5e7eb;
  font-size: 18px;
  line-height: 1.75;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 22px;
  margin-bottom: 26px;
  color: #f8fafc;
  font-size: 14px;
}

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

.button-primary,
.button-secondary {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  min-height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.button-primary {
  background: var(--primary);
  color: #ffffff;
  box-shadow: 0 16px 30px rgba(37, 99, 235, 0.28);
}

.button-primary:hover {
  background: var(--primary-dark);
  transform: translateY(-1px);
}

.button-secondary {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.25);
}

.button-secondary:hover {
  background: rgba(255, 255, 255, 0.22);
}

.hero-control {
  position: absolute;
  top: 50%;
  transform: translateY(-50%);
  width: 46px;
  height: 46px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.35);
  color: #ffffff;
  cursor: pointer;
  display: grid;
  place-items: center;
  transition: background 0.2s ease;
}

.hero-control:hover {
  background: rgba(0, 0, 0, 0.58);
}

.hero-prev {
  left: 24px;
}

.hero-next {
  right: 24px;
}

.hero-dots {
  position: absolute;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  gap: 8px;
}

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

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

.page-main {
  padding: 48px 0 64px;
}

.section-stack {
  display: grid;
  gap: 56px;
}

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

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

.section-icon {
  width: 42px;
  height: 42px;
  border-radius: 14px;
  display: grid;
  place-items: center;
  color: #ffffff;
  background: linear-gradient(135deg, #f97316, #dc2626);
  box-shadow: 0 16px 26px rgba(249, 115, 22, 0.18);
}

.section-title {
  margin: 0;
  font-size: 26px;
  line-height: 1.2;
  font-weight: 900;
  color: #111827;
}

.section-desc {
  margin: 4px 0 0;
  color: var(--muted);
  font-size: 14px;
}

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

.tinted-section {
  padding: 34px;
  border-radius: 26px;
  background: linear-gradient(135deg, #eff6ff, #ecfeff);
}

.warm-section {
  padding: 34px;
  border-radius: 26px;
  background: linear-gradient(135deg, #fff7ed, #fef3c7);
}

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

.movie-card {
  background: var(--card);
  border: 1px solid rgba(229, 231, 235, 0.72);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.poster-link {
  position: relative;
  display: block;
  height: 255px;
  overflow: hidden;
  background: #e5e7eb;
}

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

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

.card-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 9px;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.72);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.card-body {
  padding: 16px;
}

.card-title {
  margin: 0 0 8px;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 850;
  color: #111827;
}

.card-title a:hover {
  color: var(--primary);
}

.card-text {
  min-height: 44px;
  margin: 0 0 12px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.6;
}

.card-meta,
.detail-meta,
.rank-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  color: #6b7280;
  font-size: 13px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  margin-top: 12px;
}

.tag-pill {
  display: inline-flex;
  align-items: center;
  min-height: 24px;
  padding: 0 9px;
  border-radius: 999px;
  background: #eff6ff;
  color: #1d4ed8;
  font-size: 12px;
  font-weight: 700;
}

.line-clamp-2,
.line-clamp-3 {
  display: -webkit-box;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.line-clamp-2 {
  -webkit-line-clamp: 2;
}

.line-clamp-3 {
  -webkit-line-clamp: 3;
}

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

.list-card {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 18px;
  align-items: stretch;
  padding: 16px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid rgba(229, 231, 235, 0.72);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.05);
  transition: box-shadow 0.2s ease, transform 0.2s ease;
}

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

.list-card .poster-link {
  height: 126px;
  border-radius: 14px;
}

.list-title {
  margin: 0 0 8px;
  font-size: 19px;
  font-weight: 850;
}

.category-hero {
  padding: 50px 0;
  color: #ffffff;
  background: linear-gradient(110deg, #2563eb, #06b6d4);
}

.category-hero a {
  color: rgba(255, 255, 255, 0.9);
}

.category-hero h1 {
  margin: 10px 0 8px;
  font-size: clamp(32px, 5vw, 48px);
  font-weight: 900;
}

.category-hero p {
  max-width: 760px;
  margin: 0;
  color: rgba(255, 255, 255, 0.9);
  line-height: 1.8;
}

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

.category-card {
  position: relative;
  overflow: hidden;
  min-height: 230px;
  border-radius: 22px;
  background: #111827;
  color: #ffffff;
  box-shadow: var(--shadow);
}

.category-card img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.52;
  transition: transform 0.4s ease;
}

.category-card:hover img {
  transform: scale(1.06);
}

.category-card-content {
  position: absolute;
  inset: auto 0 0;
  padding: 24px;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.8), transparent);
}

.category-card h2 {
  margin: 0 0 8px;
  font-size: 24px;
  font-weight: 900;
}

.category-card p {
  margin: 0;
  color: #e5e7eb;
  line-height: 1.65;
}

.filter-panel {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 24px;
  padding: 16px;
  border-radius: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
}

.filter-buttons {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-button {
  min-height: 36px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #ffffff;
  color: #374151;
  padding: 0 14px;
  font-weight: 700;
  cursor: pointer;
}

.filter-button.active,
.filter-button:hover {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #bfdbfe;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 58px 118px minmax(0, 1fr) auto;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid rgba(229, 231, 235, 0.78);
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 8px 22px rgba(15, 23, 42, 0.05);
}

.rank-number {
  width: 42px;
  height: 42px;
  border-radius: 13px;
  display: grid;
  place-items: center;
  color: #ffffff;
  font-weight: 900;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
}

.rank-cover {
  height: 78px;
  border-radius: 12px;
  overflow: hidden;
  background: #e5e7eb;
}

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

.rank-title {
  margin: 0 0 6px;
  font-size: 18px;
  font-weight: 850;
}

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

.player-card,
.detail-card,
.related-card {
  border-radius: 22px;
  background: #ffffff;
  border: 1px solid rgba(229, 231, 235, 0.78);
  box-shadow: 0 12px 34px rgba(15, 23, 42, 0.08);
  overflow: hidden;
}

.player-shell {
  position: relative;
  aspect-ratio: 16 / 9;
  background: #000000;
  overflow: hidden;
}

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

.player-overlay {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.58), rgba(0, 0, 0, 0.26));
  transition: opacity 0.2s ease;
}

.player-shell.is-playing .player-overlay {
  opacity: 0;
  pointer-events: none;
}

.play-button {
  width: 86px;
  height: 86px;
  border: 0;
  border-radius: 50%;
  background: #2563eb;
  color: #ffffff;
  cursor: pointer;
  display: grid;
  place-items: center;
  box-shadow: 0 22px 42px rgba(37, 99, 235, 0.35);
  transform: scale(1);
  transition: transform 0.2s ease, background 0.2s ease;
}

.play-button:hover {
  transform: scale(1.06);
  background: #1d4ed8;
}

.player-message {
  position: absolute;
  left: 16px;
  right: 16px;
  bottom: 16px;
  display: none;
  padding: 10px 14px;
  border-radius: 12px;
  background: rgba(0, 0, 0, 0.68);
  color: #ffffff;
  font-size: 14px;
}

.player-message.show {
  display: block;
}

.player-info {
  padding: 24px;
}

.player-info h1 {
  margin: 0 0 12px;
  font-size: clamp(28px, 4vw, 42px);
  line-height: 1.15;
  font-weight: 900;
}

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

.detail-card h2,
.related-card h2 {
  margin: 0 0 14px;
  font-size: 22px;
  font-weight: 900;
}

.detail-card p {
  margin: 0 0 16px;
  color: #374151;
  line-height: 1.9;
}

.side-poster {
  border-radius: 22px;
  overflow: hidden;
  background: #e5e7eb;
  box-shadow: var(--shadow);
}

.side-poster img {
  width: 100%;
  height: 480px;
  object-fit: cover;
}

.related-card {
  padding: 20px;
  margin-top: 20px;
  position: sticky;
  top: 92px;
}

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

.related-item {
  display: grid;
  grid-template-columns: 112px minmax(0, 1fr);
  gap: 12px;
  align-items: center;
}

.related-thumb {
  height: 72px;
  border-radius: 12px;
  overflow: hidden;
  background: #e5e7eb;
}

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

.related-title {
  margin: 0 0 6px;
  font-weight: 850;
  line-height: 1.35;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 18px;
  color: #6b7280;
  font-size: 14px;
}

.breadcrumb a {
  color: #2563eb;
}

.site-footer {
  background: #111827;
  color: #d1d5db;
  padding: 46px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.5fr 1fr 1fr 1fr;
  gap: 28px;
}

.site-footer h3,
.site-footer h4 {
  color: #ffffff;
  margin: 0 0 12px;
}

.site-footer p,
.site-footer a {
  color: #9ca3af;
  line-height: 1.8;
}

.site-footer a:hover {
  color: #60a5fa;
}

.footer-links {
  display: grid;
  gap: 8px;
}

.empty-state {
  display: none;
  padding: 36px;
  text-align: center;
  border-radius: 18px;
  background: #ffffff;
  color: #6b7280;
  border: 1px solid var(--line);
}

.empty-state.show {
  display: block;
}

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

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

  .related-card {
    position: static;
  }

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

@media (max-width: 820px) {
  .main-nav,
  .header-actions .search-form {
    display: none;
  }

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

  .hero-slider {
    height: 560px;
  }

  .hero-content {
    padding-bottom: 70px;
  }

  .hero-control {
    display: none;
  }

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

  .rank-item {
    grid-template-columns: 42px 92px minmax(0, 1fr);
  }

  .rank-item .button-primary {
    grid-column: 1 / -1;
  }

  .list-card {
    grid-template-columns: 140px minmax(0, 1fr);
  }
}

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

  .logo-subtitle {
    display: none;
  }

  .hero-slider {
    height: 520px;
  }

  .hero-title {
    font-size: 34px;
  }

  .hero-text {
    font-size: 15px;
  }

  .page-main {
    padding-top: 34px;
  }

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

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

  .poster-link {
    height: 310px;
  }

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

  .list-card .poster-link {
    height: 220px;
  }

  .filter-panel {
    align-items: stretch;
  }

  .page-filter-input {
    width: 100%;
  }

  .rank-item {
    grid-template-columns: 40px minmax(0, 1fr);
  }

  .rank-cover {
    grid-column: 1 / -1;
    height: 190px;
  }

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