:root {
  --bg: #0f172a;
  --panel: #111827;
  --card: #ffffff;
  --muted: #64748b;
  --text: #111827;
  --text-light: #f8fafc;
  --brand: #f97316;
  --brand-dark: #ea580c;
  --line: #e5e7eb;
  --soft: #fff7ed;
  --shadow: 0 20px 60px rgba(15, 23, 42, 0.14);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: #f8fafc;
  line-height: 1.65;
}

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

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

.site-header {
  position: sticky;
  top: 0;
  z-index: 20;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(226, 232, 240, 0.8);
}

.site-header-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 20px;
  display: grid;
  grid-template-columns: auto 1fr auto auto;
  gap: 20px;
  align-items: center;
}

.site-brand,
.footer-brand {
  font-weight: 800;
  letter-spacing: -0.02em;
  color: #0f172a;
}

.site-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 20px;
}

.brand-mark {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  border-radius: 12px;
  background: linear-gradient(135deg, #fb923c, #ef4444);
  color: #ffffff;
  box-shadow: 0 10px 28px rgba(249, 115, 22, 0.3);
}

.site-nav {
  display: flex;
  gap: 8px;
  justify-content: center;
}

.site-nav a {
  padding: 9px 14px;
  border-radius: 999px;
  color: #475569;
  font-weight: 650;
}

.site-nav a:hover,
.site-nav a.is-active {
  color: var(--brand-dark);
  background: var(--soft);
}

.site-search {
  display: flex;
  width: 300px;
  padding: 4px;
  border: 1px solid #e2e8f0;
  border-radius: 999px;
  background: #ffffff;
}

.site-search input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  padding: 8px 10px 8px 14px;
  background: transparent;
}

.site-search button,
.primary-link,
.filter-row button {
  border: 0;
  border-radius: 999px;
  background: var(--brand);
  color: #ffffff;
  padding: 9px 16px;
  font-weight: 700;
  cursor: pointer;
}

.site-search button:hover,
.primary-link:hover,
.filter-row button:hover {
  background: var(--brand-dark);
}

.site-nav-toggle {
  display: none;
  border: 0;
  border-radius: 12px;
  background: #f1f5f9;
  padding: 9px 12px;
  font-size: 20px;
}

.page-hero {
  max-width: 1240px;
  margin: 28px auto;
  padding: 58px;
  border-radius: 34px;
  color: #ffffff;
  background:
    radial-gradient(circle at 15% 20%, rgba(251, 146, 60, 0.7), transparent 34%),
    radial-gradient(circle at 80% 10%, rgba(99, 102, 241, 0.55), transparent 34%),
    linear-gradient(135deg, #111827, #312e81 55%, #7c2d12);
  box-shadow: var(--shadow);
  overflow: hidden;
}

.page-hero.small-hero {
  padding: 42px 50px;
}

.page-hero h1 {
  margin: 12px 0 12px;
  max-width: 860px;
  font-size: clamp(36px, 6vw, 72px);
  line-height: 1.02;
  letter-spacing: -0.06em;
}

.page-hero.small-hero h1 {
  font-size: clamp(32px, 4vw, 48px);
}

.page-hero p {
  max-width: 720px;
  margin: 0;
  color: rgba(255, 255, 255, 0.82);
  font-size: 18px;
}

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

.hero-stat-grid {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 14px;
  margin-top: 34px;
}

.hero-stat {
  padding: 18px;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 18px;
  background: rgba(255, 255, 255, 0.12);
}

.hero-stat strong {
  display: block;
  font-size: 28px;
}

.eyebrow,
.section-kicker {
  color: #fb923c;
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.14em;
  text-transform: uppercase;
}

.content-section {
  max-width: 1240px;
  margin: 0 auto 34px;
  padding: 0 20px;
}

.section-title-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 20px;
  margin: 24px 0 18px;
}

.section-title-row h2 {
  margin: 6px 0 0;
  font-size: 30px;
  letter-spacing: -0.04em;
}

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

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.movie-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 18px 46px rgba(15, 23, 42, 0.16);
}

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

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

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

.movie-duration,
.movie-score {
  position: absolute;
  top: 12px;
  padding: 5px 9px;
  border-radius: 999px;
  background: rgba(15, 23, 42, 0.78);
  color: #ffffff;
  font-size: 12px;
  font-weight: 800;
}

.movie-duration {
  left: 12px;
}

.movie-score {
  right: 12px;
  background: rgba(249, 115, 22, 0.9);
}

.movie-info {
  padding: 16px;
}

.movie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  color: var(--muted);
  font-size: 12px;
  font-weight: 700;
}

.movie-info h3 {
  margin: 9px 0 8px;
  font-size: 18px;
  line-height: 1.35;
}

.movie-info p {
  display: -webkit-box;
  min-height: 54px;
  margin: 0 0 12px;
  overflow: hidden;
  color: #475569;
  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 span {
  padding: 5px 9px;
  border-radius: 999px;
  background: #f1f5f9;
  color: #475569;
  font-size: 12px;
  font-weight: 700;
}

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

.category-card {
  display: grid;
  grid-template-columns: 1.1fr 1fr;
  gap: 18px;
  padding: 22px;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

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

.category-card p {
  margin: 0;
  color: #64748b;
}

.category-card ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.category-card li + li {
  margin-top: 8px;
}

.category-card li a {
  display: block;
  padding: 8px 10px;
  border-radius: 12px;
  background: #f8fafc;
  color: #334155;
  font-weight: 700;
}

.category-card li a:hover {
  color: var(--brand-dark);
  background: #fff7ed;
}

.filter-panel {
  padding: 18px;
  margin-bottom: 22px;
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  background: #ffffff;
}

.filter-row {
  display: grid;
  grid-template-columns: 1fr 180px 180px;
  gap: 12px;
}

.filter-row input,
.filter-row select {
  width: 100%;
  border: 1px solid #e2e8f0;
  border-radius: 14px;
  background: #f8fafc;
  padding: 12px 14px;
  outline: 0;
}

.filter-row input:focus,
.filter-row select:focus {
  border-color: #fb923c;
  background: #ffffff;
}

.filter-empty {
  margin: 14px 0 0;
  color: #ef4444;
  font-weight: 700;
}

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

.detail-main,
.detail-side,
.player-box,
.detail-text,
.detail-meta-card,
.ranking-list,
.search-app {
  border: 1px solid #e2e8f0;
  border-radius: var(--radius);
  background: #ffffff;
  box-shadow: 0 8px 30px rgba(15, 23, 42, 0.08);
}

.detail-main {
  overflow: hidden;
}

.player-box {
  overflow: hidden;
  background: #111827;
}

.player-box video {
  display: block;
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #020617;
}

.player-note {
  margin: 0;
  padding: 12px 16px;
  color: #cbd5e1;
  background: #111827;
  font-size: 13px;
}

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

.detail-text h2 {
  margin: 24px 0 10px;
}

.detail-text h2:first-child {
  margin-top: 0;
}

.detail-side {
  padding: 18px;
}

.detail-poster {
  width: 100%;
  border-radius: 18px;
  overflow: hidden;
}

.detail-meta-card {
  margin-top: 18px;
  padding: 18px;
  box-shadow: none;
}

.detail-meta-card h2 {
  margin: 0 0 12px;
}

.detail-meta-card dl {
  margin: 0;
}

.detail-meta-card div {
  display: flex;
  justify-content: space-between;
  gap: 18px;
  padding: 10px 0;
  border-bottom: 1px solid #e2e8f0;
}

.detail-meta-card div:last-child {
  border-bottom: 0;
}

.detail-meta-card dt {
  color: #64748b;
  font-weight: 700;
}

.detail-meta-card dd {
  margin: 0;
  text-align: right;
  font-weight: 800;
}

.ranking-list {
  overflow: hidden;
}

.ranking-item {
  display: grid;
  grid-template-columns: 70px 80px 1fr 88px;
  gap: 16px;
  align-items: center;
  padding: 14px 18px;
  border-bottom: 1px solid #e2e8f0;
}

.ranking-item:last-child {
  border-bottom: 0;
}

.rank-number {
  color: var(--brand-dark);
  font-size: 24px;
  font-weight: 900;
}

.ranking-cover {
  width: 80px;
  height: 112px;
  border-radius: 12px;
  object-fit: cover;
}

.ranking-title h3 {
  margin: 0 0 6px;
}

.ranking-title p {
  margin: 0;
  color: #64748b;
}

.ranking-score {
  font-size: 24px;
  font-weight: 900;
  color: #f97316;
  text-align: right;
}

.search-app {
  padding: 20px;
}

.search-results-info {
  margin: 0 0 16px;
  color: #64748b;
  font-weight: 700;
}

.site-footer {
  margin-top: 56px;
  background: #0f172a;
  color: #cbd5e1;
}

.footer-inner {
  max-width: 1240px;
  margin: 0 auto;
  padding: 34px 20px;
  display: flex;
  justify-content: space-between;
  gap: 28px;
}

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

.footer-inner p {
  margin: 8px 0 0;
}

.footer-links {
  display: flex;
  flex-wrap: wrap;
  gap: 12px;
  align-items: center;
}

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

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

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

  .site-nav,
  .site-search {
    display: none;
  }

  .site-nav.is-open,
  .site-search.is-open {
    display: flex;
    grid-column: 1 / -1;
    width: 100%;
  }

  .site-nav.is-open {
    justify-content: flex-start;
    flex-wrap: wrap;
  }

  .site-nav-toggle {
    display: inline-block;
    justify-self: end;
  }

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

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

@media (max-width: 720px) {
  .page-hero,
  .page-hero.small-hero {
    margin: 16px 12px;
    padding: 30px 24px;
    border-radius: 24px;
  }

  .hero-stat-grid,
  .movie-grid,
  .movie-grid.related-grid,
  .category-overview-grid,
  .filter-row {
    grid-template-columns: 1fr;
  }

  .ranking-item {
    grid-template-columns: 46px 66px 1fr;
  }

  .ranking-score {
    grid-column: 3;
    text-align: left;
  }

  .footer-inner {
    flex-direction: column;
  }
}
