* {
  box-sizing: border-box;
}

:root {
  --text: #111827;
  --muted: #6b7280;
  --soft: #f3f4f6;
  --line: #e5e7eb;
  --panel: #ffffff;
  --dark: #0f172a;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --red: #dc2626;
  --orange: #f97316;
  --green: #10b981;
  --purple: #8b5cf6;
  --shadow: 0 18px 40px rgba(15, 23, 42, 0.12);
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-width: 320px;
  color: var(--text);
  background: #f8fafc;
  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,
select {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 40;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(229, 231, 235, 0.92);
  backdrop-filter: blur(18px);
}

.header-inner {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  gap: 24px;
  width: min(1280px, calc(100% - 32px));
  min-height: 76px;
  margin: 0 auto;
}

.brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  min-width: 210px;
}

.brand-icon {
  display: inline-grid;
  place-items: center;
  width: 42px;
  height: 42px;
  color: #ffffff;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 12px 28px rgba(220, 38, 38, 0.25);
}

.brand-copy strong {
  display: block;
  font-size: 20px;
  line-height: 1.1;
}

.brand-copy em {
  display: block;
  margin-top: 3px;
  color: var(--muted);
  font-size: 12px;
  font-style: normal;
}

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

.main-nav a {
  padding: 9px 12px;
  color: #374151;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  white-space: nowrap;
  transition: color 0.2s ease, background 0.2s ease;
}

.main-nav a:hover,
.main-nav a.is-active {
  color: var(--blue);
  background: #eff6ff;
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
}

.header-search input {
  width: 230px;
  height: 42px;
  padding: 0 16px;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  outline: none;
  background: #ffffff;
}

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

.header-search button,
.button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 42px;
  padding: 0 18px;
  border: 0;
  border-radius: 12px;
  cursor: pointer;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.header-search button,
.button.primary {
  color: #ffffff;
  background: var(--blue);
}

.header-search button:hover,
.button.primary:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 12px 26px rgba(37, 99, 235, 0.25);
}

.button.ghost {
  color: #ffffff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

.button.ghost:hover {
  background: rgba(255, 255, 255, 0.22);
  transform: translateY(-1px);
}

.button.full {
  width: 100%;
}

.menu-toggle {
  display: none;
  width: 44px;
  height: 44px;
  padding: 10px;
  border: 0;
  border-radius: 12px;
  background: #f3f4f6;
  cursor: pointer;
}

.menu-toggle span {
  display: block;
  height: 2px;
  margin: 5px 0;
  background: #111827;
  border-radius: 2px;
}

.home-hero {
  background: var(--dark);
}

.hero-viewport {
  position: relative;
  min-height: 640px;
  height: min(78vh, 760px);
  overflow: hidden;
}

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

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

.hero-image {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.02);
}

.hero-gradient {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(2, 6, 23, 0.92) 0%, rgba(15, 23, 42, 0.72) 42%, rgba(15, 23, 42, 0.18) 100%), linear-gradient(0deg, rgba(2, 6, 23, 0.88) 0%, rgba(2, 6, 23, 0.08) 46%);
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 48px));
  margin: 0 auto;
  padding-top: 142px;
  color: #ffffff;
}

.hero-kicker {
  display: inline-flex;
  align-items: center;
  min-height: 34px;
  padding: 0 14px;
  border-radius: 999px;
  background: linear-gradient(90deg, #dc2626, #db2777);
  font-size: 14px;
  font-weight: 800;
}

.hero-content h1 {
  max-width: 760px;
  margin: 24px 0 18px;
  font-size: clamp(38px, 7vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.04em;
}

.hero-content p {
  max-width: 720px;
  margin: 0 0 24px;
  color: #e5e7eb;
  font-size: clamp(17px, 2.2vw, 22px);
}

.hero-meta,
.movie-meta,
.detail-meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}

.hero-meta span,
.movie-meta span,
.detail-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 26px;
  padding: 3px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.08);
  color: #4b5563;
  font-size: 12px;
  font-weight: 700;
}

.hero-meta span {
  background: rgba(255, 255, 255, 0.14);
  color: #ffffff;
}

.hero-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 30px;
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  display: grid;
  place-items: center;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.42);
  cursor: pointer;
  font-size: 32px;
  line-height: 1;
  transform: translateY(-50%);
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.64);
  transform: translateY(-50%) scale(1.06);
}

.hero-prev {
  left: 28px;
}

.hero-next {
  right: 28px;
}

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

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

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

.page-main,
.detail-main {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
}

.top-space {
  padding-top: 42px;
}

.intro-strip,
.filter-panel,
.content-section,
.page-heading,
.detail-card,
.side-panel,
.poster-card,
.category-panel {
  background: #ffffff;
  border: 1px solid rgba(229, 231, 235, 0.85);
  border-radius: 24px;
  box-shadow: 0 10px 28px rgba(15, 23, 42, 0.06);
}

.intro-strip {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 24px;
  margin-top: -58px;
  padding: 28px 32px;
  position: relative;
  z-index: 5;
}

.intro-strip h2,
.filter-heading h2,
.section-title h2,
.page-heading h1,
.detail-card h1,
.detail-card h2,
.side-panel h2,
.category-panel h2 {
  margin: 0;
  color: #111827;
  line-height: 1.2;
}

.intro-strip p,
.filter-heading p,
.section-title p,
.page-heading p,
.category-panel p {
  margin: 8px 0 0;
  color: var(--muted);
}

.text-link {
  color: var(--blue);
  font-weight: 800;
  white-space: nowrap;
}

.text-link.light {
  color: #bfdbfe;
}

.filter-panel {
  margin: 28px 0;
  padding: 26px;
}

.filter-controls {
  display: grid;
  grid-template-columns: minmax(220px, 1fr) 180px 180px 180px;
  gap: 14px;
  margin-top: 22px;
}

.filter-controls input,
.filter-controls select {
  width: 100%;
  height: 46px;
  padding: 0 14px;
  border: 1px solid #d1d5db;
  border-radius: 14px;
  background: #ffffff;
  outline: none;
}

.filter-controls input:focus,
.filter-controls select:focus {
  border-color: var(--blue);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.content-section {
  margin: 32px 0;
  padding: 30px;
}

.featured-section {
  background: linear-gradient(135deg, #eff6ff, #ecfeff);
}

.section-title {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 24px;
}

.section-title.light h2,
.section-title.light p {
  color: #ffffff;
}

.section-title.light {
  color: #ffffff;
}

.section-title .text-link {
  margin-left: auto;
}

.section-icon {
  display: grid;
  place-items: center;
  width: 46px;
  height: 46px;
  flex: 0 0 auto;
  color: #ffffff;
  border-radius: 14px;
  font-size: 22px;
  box-shadow: var(--shadow);
}

.section-icon.warm {
  background: linear-gradient(135deg, #f97316, #dc2626);
}

.section-icon.cool {
  background: linear-gradient(135deg, #2563eb, #06b6d4);
}

.section-icon.green {
  background: linear-gradient(135deg, #10b981, #059669);
}

.section-icon.purple {
  background: linear-gradient(135deg, #8b5cf6, #d946ef);
}

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

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

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

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

.movie-cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #111827;
}

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

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

.cover-badge {
  position: absolute;
  top: 10px;
  right: 10px;
  padding: 4px 8px;
  color: #ffffff;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.72);
  font-size: 12px;
  font-weight: 800;
}

.cover-play {
  position: absolute;
  left: 12px;
  bottom: 12px;
  display: grid;
  place-items: center;
  width: 38px;
  height: 38px;
  color: #ffffff;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.9);
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.35);
}

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

.movie-title {
  display: -webkit-box;
  min-height: 46px;
  overflow: hidden;
  color: #111827;
  font-size: 16px;
  font-weight: 800;
  line-height: 1.4;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-title:hover {
  color: var(--blue);
}

.movie-line {
  display: -webkit-box;
  min-height: 44px;
  margin: 8px 0 12px;
  overflow: hidden;
  color: var(--muted);
  font-size: 14px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

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

.category-card {
  display: flex;
  flex-direction: column;
  min-height: 170px;
  padding: 22px;
  border-radius: 20px;
  color: #ffffff;
  background: linear-gradient(135deg, #111827, #1d4ed8);
  box-shadow: var(--shadow);
  transition: transform 0.2s ease;
}

.category-card:nth-child(2n) {
  background: linear-gradient(135deg, #7f1d1d, #dc2626);
}

.category-card:nth-child(3n) {
  background: linear-gradient(135deg, #064e3b, #059669);
}

.category-card:hover {
  transform: translateY(-4px);
}

.category-card strong {
  font-size: 22px;
}

.category-card p {
  margin: 10px 0 18px;
  color: rgba(255, 255, 255, 0.82);
}

.category-card div {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: auto;
}

.category-card span {
  max-width: 100%;
  overflow: hidden;
  padding: 4px 8px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  font-size: 12px;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.ranking-strip {
  color: #ffffff;
  background: radial-gradient(circle at top left, rgba(37, 99, 235, 0.48), transparent 32%), linear-gradient(135deg, #0f172a, #111827 62%, #450a0a);
}

.rank-grid,
.ranking-page-list {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 16px;
}

.ranking-page-list {
  margin: 32px 0;
}

.rank-item {
  display: grid;
  grid-template-columns: 48px 120px 1fr;
  gap: 14px;
  align-items: center;
  padding: 12px;
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.94);
  box-shadow: 0 10px 22px rgba(15, 23, 42, 0.06);
}

.ranking-strip .rank-item {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.14);
}

.rank-number {
  color: #f97316;
  font-size: 28px;
  font-weight: 900;
  text-align: center;
}

.rank-cover {
  aspect-ratio: 16 / 10;
  overflow: hidden;
  border-radius: 14px;
  background: #111827;
}

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

.rank-info a {
  display: block;
  color: #111827;
  font-size: 16px;
  font-weight: 900;
}

.ranking-strip .rank-info a,
.ranking-strip .rank-info p {
  color: #ffffff;
}

.rank-info p {
  display: -webkit-box;
  margin: 5px 0 8px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.page-heading {
  padding: 38px;
}

.page-heading span {
  display: inline-block;
  margin-bottom: 10px;
  color: var(--blue);
  font-weight: 900;
}

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

.dark-heading {
  color: #ffffff;
  background: linear-gradient(135deg, #0f172a, #1e3a8a);
}

.dark-heading h1,
.dark-heading p,
.dark-heading span {
  color: #ffffff;
}

.category-heading {
  background: linear-gradient(135deg, #eff6ff, #ffffff);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
  padding: 24px 0;
  color: var(--muted);
  font-size: 14px;
}

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

.category-panels {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  margin: 32px 0;
}

.category-panel {
  padding: 26px;
}

.category-panel h2 {
  font-size: 28px;
}

.compact-list {
  display: grid;
  gap: 14px;
  margin-top: 20px;
}

.compact-card {
  display: grid;
  grid-template-columns: 112px 1fr;
  gap: 12px;
  align-items: center;
}

.compact-card img {
  width: 112px;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 12px;
  background: #111827;
  transition: transform 0.4s ease;
}

.compact-card strong {
  display: -webkit-box;
  overflow: hidden;
  font-weight: 900;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.compact-card em {
  display: block;
  margin-top: 5px;
  color: var(--muted);
  font-size: 13px;
  font-style: normal;
}

.detail-main {
  padding-top: 18px;
}

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

.detail-primary {
  min-width: 0;
}

.player-shell {
  overflow: hidden;
  border-radius: 24px;
  background: #020617;
  box-shadow: var(--shadow);
}

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

.movie-video {
  width: 100%;
  height: 100%;
  background: #020617;
}

.player-overlay {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  padding: 0;
  border: 0;
  cursor: pointer;
  background: #020617;
}

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

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

.player-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(2, 6, 23, 0.8), rgba(2, 6, 23, 0.15));
}

.player-button {
  position: absolute;
  left: 50%;
  top: 50%;
  display: grid;
  place-items: center;
  width: 88px;
  height: 88px;
  color: #ffffff;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.92);
  box-shadow: 0 16px 34px rgba(37, 99, 235, 0.38);
  font-size: 34px;
  transform: translate(-50%, -50%);
}

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

.detail-card h1 {
  font-size: clamp(30px, 4vw, 46px);
}

.detail-meta {
  margin: 18px 0 22px;
}

.lead-text {
  margin: 0 0 20px;
  color: #1f2937;
  font-size: 18px;
  font-weight: 700;
}

.tag-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin: 0 0 24px;
}

.tag-row span {
  padding: 6px 10px;
  color: #1d4ed8;
  border-radius: 999px;
  background: #dbeafe;
  font-size: 13px;
  font-weight: 800;
}

.detail-card h2 {
  margin-top: 26px;
  font-size: 24px;
}

.detail-card p {
  color: #374151;
  font-size: 16px;
}

.detail-aside {
  min-width: 0;
}

.poster-card,
.side-panel {
  padding: 20px;
  position: sticky;
  top: 100px;
}

.poster-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  border-radius: 16px;
  margin-bottom: 16px;
  background: #111827;
}

.side-panel {
  top: 430px;
  margin-top: 20px;
}

.related-section {
  margin-top: 34px;
}

.site-footer {
  margin-top: 48px;
  color: #d1d5db;
  background: #111827;
}

.footer-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0;
}

.footer-brand {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

.footer-brand strong {
  display: block;
  color: #ffffff;
  font-size: 20px;
}

.footer-brand p {
  max-width: 680px;
  margin: 8px 0 0;
  color: #9ca3af;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  margin: 26px 0;
}

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

.copyright {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

[data-card].is-hidden {
  display: none;
}

@media (max-width: 1180px) {
  .header-inner {
    grid-template-columns: auto auto;
  }

  .main-nav {
    grid-column: 1 / -1;
    order: 3;
    overflow-x: auto;
    padding-bottom: 10px;
  }

  .header-search {
    justify-self: end;
  }

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

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

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

  .detail-aside,
  .poster-card,
  .side-panel {
    position: static;
  }
}

@media (max-width: 820px) {
  .header-inner {
    display: flex;
    flex-wrap: wrap;
    min-height: 68px;
    gap: 12px;
    padding: 12px 0;
  }

  .brand {
    min-width: 0;
    margin-right: auto;
  }

  .brand-copy em {
    display: none;
  }

  .menu-toggle {
    display: inline-block;
  }

  .main-nav {
    display: none;
    flex: 0 0 100%;
    flex-direction: column;
    align-items: stretch;
    order: 4;
    padding: 8px 0 0;
    overflow: visible;
  }

  .main-nav.is-open {
    display: flex;
  }

  .header-search {
    flex: 0 0 100%;
    order: 5;
  }

  .header-search input {
    width: 100%;
  }

  .hero-viewport {
    min-height: 560px;
    height: 68vh;
  }

  .hero-content {
    width: min(100% - 32px, 680px);
    padding-top: 104px;
  }

  .hero-arrow {
    display: none;
  }

  .intro-strip,
  .section-title,
  .rank-item {
    align-items: flex-start;
  }

  .intro-strip,
  .section-title {
    flex-direction: column;
  }

  .filter-controls {
    grid-template-columns: 1fr;
  }

  .movie-grid,
  .movie-grid.dense,
  .movie-grid.category-list,
  .category-grid,
  .rank-grid,
  .ranking-page-list,
  .category-panels {
    grid-template-columns: 1fr;
  }

  .rank-item {
    grid-template-columns: 42px 104px 1fr;
  }

  .page-heading,
  .content-section,
  .detail-card,
  .filter-panel {
    padding: 22px;
    border-radius: 20px;
  }
}

@media (max-width: 520px) {
  .page-main,
  .detail-main,
  .footer-inner {
    width: min(100% - 24px, 1280px);
  }

  .brand-icon {
    width: 38px;
    height: 38px;
  }

  .brand-copy strong {
    font-size: 17px;
  }

  .hero-content h1 {
    font-size: 34px;
  }

  .movie-grid,
  .movie-grid.dense,
  .movie-grid.category-list {
    gap: 16px;
  }

  .rank-item {
    grid-template-columns: 36px 86px 1fr;
    gap: 10px;
  }

  .compact-card {
    grid-template-columns: 92px 1fr;
  }

  .compact-card img {
    width: 92px;
  }
}
