:root {
  --amber: #f59e0b;
  --amber-dark: #d97706;
  --gray-50: #f9fafb;
  --gray-100: #f3f4f6;
  --gray-200: #e5e7eb;
  --gray-600: #4b5563;
  --gray-700: #374151;
  --gray-800: #1f2937;
  --gray-900: #111827;
  --blue: #2563eb;
  --cyan: #0891b2;
  --red: #ef4444;
  --shadow: 0 18px 50px rgba(15, 23, 42, 0.13);
  --radius: 24px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: var(--gray-800);
  background: var(--gray-50);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

button,
input {
  font: inherit;
}

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(14px);
}

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

.logo,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 24px;
  font-weight: 800;
  color: var(--gray-800);
}

.logo-icon {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: #fff;
  background: linear-gradient(135deg, var(--amber), #f97316);
  box-shadow: 0 10px 20px rgba(245, 158, 11, 0.24);
  font-size: 14px;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 6px;
}

.nav-link {
  padding: 10px 14px;
  border-radius: 999px;
  color: var(--gray-600);
  font-weight: 700;
  transition: color 0.2s ease, background 0.2s ease;
}

.nav-link:hover,
.nav-link.active {
  color: var(--amber-dark);
  background: #fff7ed;
}

.mobile-toggle {
  display: none;
  width: 44px;
  height: 44px;
  border: 0;
  border-radius: 12px;
  background: var(--gray-100);
  cursor: pointer;
}

.mobile-toggle span {
  display: block;
  width: 20px;
  height: 2px;
  margin: 4px auto;
  background: var(--gray-700);
}

.mobile-nav {
  display: none;
  padding: 10px 16px 18px;
  border-top: 1px solid var(--gray-200);
}

.mobile-nav.open {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
}

.hero {
  position: relative;
  height: 600px;
  overflow: hidden;
  background: var(--gray-900);
}

.hero-slide {
  position: absolute;
  inset: 0;
  opacity: 0;
  pointer-events: none;
  transform: scale(1.02);
  transition: opacity 0.8s ease, transform 1.2s ease;
}

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

.hero-slide > img,
.detail-bg img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

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

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  align-items: center;
}

.hero-text {
  max-width: 680px;
  color: #fff;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
  color: #fbbf24;
  font-size: 18px;
  font-weight: 800;
}

.hero h1,
.page-hero h1,
.detail-hero h1 {
  margin: 0 0 20px;
  font-size: clamp(40px, 6vw, 64px);
  line-height: 1.08;
  letter-spacing: -0.04em;
}

.hero p,
.page-hero p,
.detail-hero p {
  max-width: 760px;
  margin: 0 0 28px;
  color: rgba(255, 255, 255, 0.82);
  font-size: 20px;
}

.hero-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  margin-bottom: 30px;
}

.hero-meta span,
.hero-meta em,
.detail-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 6px 14px;
  border-radius: 999px;
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  font-style: normal;
  backdrop-filter: blur(10px);
}

.hero-meta span,
.detail-meta span:first-child {
  background: var(--amber);
}

.primary-btn,
.outline-btn {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  padding: 15px 28px;
  border-radius: 999px;
  color: #fff;
  background: var(--amber);
  font-weight: 800;
  box-shadow: 0 16px 34px rgba(245, 158, 11, 0.28);
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn:hover,
.outline-btn:hover {
  transform: translateY(-2px) scale(1.02);
  background: var(--amber-dark);
  box-shadow: 0 20px 42px rgba(245, 158, 11, 0.34);
}

.outline-btn {
  color: var(--amber-dark);
  background: #fff;
}

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

.hero-dots button {
  width: 38px;
  height: 8px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.42);
  cursor: pointer;
  transition: width 0.2s ease, background 0.2s ease;
}

.hero-dots button.active {
  width: 58px;
  background: var(--amber);
}

.section {
  padding: 72px 0;
}

.section.white {
  background: #fff;
}

.section.soft {
  background: var(--gray-100);
}

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

.section.blue {
  color: #fff;
  background: linear-gradient(90deg, var(--blue), var(--cyan));
}

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

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

.section-title h2 {
  margin: 0;
  color: var(--gray-800);
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.2;
}

.section-title a {
  color: var(--amber-dark);
  font-weight: 800;
}

.section-title.light h2,
.section-title.light a {
  color: #fff;
}

.section-icon {
  color: var(--amber);
  font-size: 26px;
}

.section-icon.red {
  color: var(--red);
}

.filter-panel {
  margin-bottom: 32px;
  padding: 18px;
  border: 1px solid var(--gray-200);
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: 0 12px 40px rgba(15, 23, 42, 0.08);
}

.search-box {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 0 18px;
  border: 1px solid var(--gray-200);
  border-radius: 999px;
  background: var(--gray-50);
}

.search-box span {
  color: var(--amber-dark);
  font-size: 24px;
}

.search-box input {
  width: 100%;
  height: 52px;
  border: 0;
  outline: 0;
  color: var(--gray-800);
  background: transparent;
}

.quick-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}

.quick-tags button {
  border: 0;
  padding: 8px 14px;
  border-radius: 999px;
  color: var(--gray-700);
  background: var(--gray-100);
  cursor: pointer;
  transition: color 0.2s ease, background 0.2s ease;
}

.quick-tags button:hover,
.quick-tags button.active {
  color: #fff;
  background: var(--amber);
}

.movie-grid {
  display: grid;
  gap: 24px;
}

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

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

.horizontal-grid {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  margin-top: 24px;
}

.movie-card {
  overflow: hidden;
  border-radius: 20px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

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

.card-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: linear-gradient(135deg, var(--gray-800), var(--gray-900));
}

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

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

.card-cover::after {
  content: "";
  position: absolute;
  inset: 0;
  opacity: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.64), rgba(0, 0, 0, 0.05));
  transition: opacity 0.25s ease;
}

.movie-card:hover .card-cover::after {
  opacity: 1;
}

.card-play {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 58px;
  height: 58px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: var(--amber);
  opacity: 0;
  transform: translate(-50%, -50%) scale(0.84);
  transition: opacity 0.25s ease, transform 0.25s ease;
}

.movie-card:hover .card-play {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

.card-year {
  position: absolute;
  right: 12px;
  top: 12px;
  z-index: 3;
  padding: 4px 9px;
  border-radius: 9px;
  color: #fff;
  background: rgba(0, 0, 0, 0.68);
  font-size: 12px;
  font-weight: 800;
}

.card-body {
  padding: 18px;
}

.card-category {
  display: inline-flex;
  margin-bottom: 10px;
  padding: 4px 9px;
  border-radius: 999px;
  color: var(--amber-dark);
  background: #fffbeb;
  font-size: 12px;
  font-weight: 800;
}

.card-body h3 {
  display: -webkit-box;
  min-height: 3.1em;
  margin: 0 0 8px;
  overflow: hidden;
  color: var(--gray-800);
  font-size: 18px;
  line-height: 1.55;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.card-body h3 a:hover {
  color: var(--amber-dark);
}

.card-meta {
  margin: 0 0 10px;
  color: var(--gray-600);
  font-size: 13px;
}

.card-desc {
  display: -webkit-box;
  min-height: 3em;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--gray-600);
  font-size: 14px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tag-row,
.detail-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span,
.detail-tags a {
  padding: 4px 8px;
  border-radius: 999px;
  color: var(--gray-700);
  background: var(--gray-100);
  font-size: 12px;
}

.movie-card.horizontal {
  display: grid;
  grid-template-columns: 180px 1fr;
}

.movie-card.horizontal .card-cover {
  height: 100%;
  aspect-ratio: auto;
}

.movie-card.slide {
  width: 310px;
  flex: 0 0 auto;
  color: #fff;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.movie-card.slide h3,
.movie-card.slide .card-meta,
.movie-card.slide .card-desc {
  color: #fff;
}

.slide-row {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding-bottom: 16px;
}

.rank-layout {
  display: grid;
  grid-template-columns: 1.1fr 0.9fr;
  gap: 36px;
}

.rank-list,
.ranking-list,
.side-related {
  display: grid;
  gap: 14px;
}

.rank-item,
.ranking-row {
  display: grid;
  grid-template-columns: 44px 86px 1fr;
  align-items: center;
  gap: 14px;
  padding: 12px;
  border-radius: 16px;
  background: #fff;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-item:hover,
.ranking-row:hover {
  transform: translateX(4px);
  box-shadow: var(--shadow);
}

.rank-num,
.ranking-index {
  width: 38px;
  height: 38px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  color: #fff;
  background: var(--amber);
  font-weight: 900;
}

.rank-item img,
.ranking-row img {
  width: 86px;
  height: 58px;
  border-radius: 12px;
  object-fit: cover;
  background: var(--gray-900);
}

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

.rank-info strong,
.ranking-row strong {
  display: block;
  overflow: hidden;
  color: var(--gray-800);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.rank-info em,
.ranking-row em {
  display: block;
  overflow: hidden;
  color: var(--gray-600);
  font-size: 13px;
  font-style: normal;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-row {
  grid-template-columns: 48px 96px 1fr 1fr auto;
}

.ranking-row > span:last-child {
  color: var(--amber-dark);
  font-weight: 800;
}

.category-panel,
.side-card,
.content-card,
.player-card {
  border-radius: 22px;
  background: #fff;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.08);
}

.category-panel {
  padding: 28px;
}

.category-panel h2,
.side-card h2,
.content-card h2 {
  margin: 0 0 16px;
  color: var(--gray-800);
}

.category-pills,
.footer-links {
  display: grid;
  gap: 12px;
}

.category-pills a,
.category-card {
  display: block;
  padding: 16px;
  border: 1px solid var(--gray-200);
  border-radius: 18px;
  background: var(--gray-50);
  transition: transform 0.2s ease, border-color 0.2s ease, background 0.2s ease;
}

.category-pills a:hover,
.category-card:hover {
  transform: translateY(-3px);
  border-color: #fcd34d;
  background: #fffbeb;
}

.category-pills strong,
.category-card span {
  display: block;
  color: var(--gray-800);
  font-size: 18px;
  font-weight: 900;
}

.category-pills span,
.category-card p {
  display: block;
  margin: 4px 0 0;
  color: var(--gray-600);
  font-size: 14px;
}

.category-card em {
  display: inline-flex;
  margin-top: 12px;
  color: var(--amber-dark);
  font-style: normal;
  font-weight: 800;
}

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

.page-hero {
  padding: 92px 0;
  color: #fff;
  background: linear-gradient(135deg, #111827, #374151);
}

.categories-hero {
  background: linear-gradient(135deg, #92400e, #f59e0b);
}

.category-hero {
  background: linear-gradient(135deg, #111827, #1d4ed8);
}

.ranking-hero {
  background: linear-gradient(135deg, #7f1d1d, #f97316);
}

.detail-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: var(--gray-900);
}

.detail-bg {
  position: absolute;
  inset: 0;
  opacity: 0.42;
  filter: blur(2px);
}

.detail-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(17, 24, 39, 0.92), rgba(17, 24, 39, 0.66));
}

.detail-hero-inner {
  position: relative;
  z-index: 2;
  padding: 42px 0 54px;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 28px;
  color: rgba(255, 255, 255, 0.72);
}

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

.detail-title-grid {
  display: grid;
  grid-template-columns: 260px 1fr;
  gap: 34px;
  align-items: center;
}

.detail-poster {
  width: 260px;
  aspect-ratio: 3 / 4;
  border-radius: 22px;
  object-fit: cover;
  background: var(--gray-800);
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.34);
}

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

.detail-main {
  display: grid;
  gap: 22px;
}

.video-shell {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  background: #000;
  aspect-ratio: 16 / 9;
}

.movie-video {
  width: 100%;
  height: 100%;
  object-fit: contain;
  background: #000;
}

.play-overlay {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 16px;
  border: 0;
  color: #fff;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.68), rgba(0, 0, 0, 0.22));
  cursor: pointer;
  transition: opacity 0.2s ease;
}

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

.play-circle {
  width: 82px;
  height: 82px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: var(--amber);
  box-shadow: 0 20px 40px rgba(245, 158, 11, 0.36);
  font-size: 30px;
}

.content-card,
.side-card {
  padding: 26px;
}

.content-card p {
  margin: 0;
  color: var(--gray-700);
  font-size: 17px;
  line-height: 1.9;
}

.detail-tags a:hover {
  color: #fff;
  background: var(--amber);
}

.side-card dl {
  display: grid;
  grid-template-columns: 70px 1fr;
  gap: 12px;
  margin: 0;
}

.side-card dt {
  color: var(--gray-600);
}

.side-card dd {
  margin: 0;
  color: var(--gray-800);
  font-weight: 700;
}

.sticky-side {
  position: sticky;
  top: 96px;
  margin-top: 22px;
}

.filter-empty {
  display: none;
  margin: 28px 0 0;
  padding: 22px;
  border-radius: 18px;
  color: var(--gray-600);
  text-align: center;
  background: #fff;
}

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

.site-footer {
  color: #d1d5db;
  background: linear-gradient(135deg, var(--gray-900), var(--gray-800));
}

.footer-grid {
  display: grid;
  grid-template-columns: 1.2fr 1fr 1fr;
  gap: 40px;
  padding: 56px 0 34px;
}

.footer-logo {
  color: #fff;
  margin-bottom: 14px;
}

.site-footer h3 {
  margin: 0 0 16px;
  color: #fff;
}

.footer-links a {
  color: #d1d5db;
}

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

.footer-bottom {
  padding: 20px;
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  color: #9ca3af;
  text-align: center;
}

.back-top {
  position: fixed;
  right: 28px;
  bottom: 28px;
  z-index: 40;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: var(--amber);
  box-shadow: 0 16px 30px rgba(245, 158, 11, 0.28);
  cursor: pointer;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.back-top.show {
  opacity: 1;
  pointer-events: auto;
}

.back-top:hover {
  transform: translateY(-3px);
}

@media (max-width: 1024px) {
  .desktop-nav {
    display: none;
  }

  .mobile-toggle {
    display: block;
  }

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

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

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

  .sticky-side {
    position: static;
    margin-top: 0;
  }
}

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

  .hero {
    height: 560px;
  }

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

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

  .section {
    padding: 48px 0;
  }

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

  .featured-grid,
  .compact-grid,
  .horizontal-grid,
  .category-grid,
  .footer-grid,
  .detail-side {
    grid-template-columns: 1fr;
  }

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

  .ranking-row {
    grid-template-columns: 42px 76px 1fr;
  }

  .ranking-row em,
  .ranking-row > span:last-child {
    display: none;
  }

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

  .detail-poster {
    width: min(260px, 100%);
  }

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