:root {
  --text: #111827;
  --muted: #6b7280;
  --soft: #f8fafc;
  --surface: #ffffff;
  --line: #e5e7eb;
  --red: #dc2626;
  --red-dark: #b91c1c;
  --orange: #f97316;
  --amber: #facc15;
  --shadow: 0 20px 45px rgba(15, 23, 42, 0.12);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  color: var(--text);
  background: linear-gradient(180deg, #fff 0%, #fff7ed 28%, #f9fafb 100%);
  -webkit-font-smoothing: antialiased;
}

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

img,
video {
  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.88);
  backdrop-filter: blur(18px);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
}

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

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 12px;
  font-weight: 800;
}

.brand-mark {
  width: 42px;
  height: 42px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 14px;
  color: #fff;
  background: linear-gradient(135deg, #ef4444, #f97316);
  box-shadow: 0 16px 28px rgba(239, 68, 68, 0.24);
}

.brand-text {
  display: grid;
  gap: 2px;
}

.brand-text strong {
  font-size: 22px;
  line-height: 1;
  background: linear-gradient(90deg, var(--red), var(--orange));
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.brand-text small {
  color: var(--muted);
  font-size: 12px;
}

.main-nav {
  display: flex;
  align-items: center;
  gap: 24px;
  color: #374151;
  font-weight: 650;
}

.main-nav a,
.mobile-nav a,
.text-link,
.footer-grid a {
  transition: color 0.2s ease, transform 0.2s ease;
}

.main-nav a:hover,
.mobile-nav a:hover,
.text-link:hover,
.footer-grid a:hover {
  color: var(--red);
}

.menu-toggle {
  display: none;
  width: 42px;
  height: 42px;
  border: 0;
  border-radius: 12px;
  background: #f3f4f6;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  gap: 5px;
}

.menu-toggle span {
  width: 20px;
  height: 2px;
  background: #111827;
  border-radius: 999px;
}

.mobile-nav {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto 14px;
  padding: 12px;
  border-radius: 18px;
  background: #fff;
  box-shadow: var(--shadow);
  grid-template-columns: repeat(2, 1fr);
  gap: 10px;
}

.mobile-nav.is-open {
  display: grid;
}

.mobile-nav a {
  padding: 10px 12px;
  border-radius: 12px;
  background: #f9fafb;
}

.hero {
  position: relative;
  height: 600px;
  overflow: hidden;
  background: radial-gradient(circle at 20% 20%, rgba(249, 115, 22, 0.35), transparent 32%), linear-gradient(135deg, #111827, #450a0a);
}

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

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

.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.82;
}

.hero-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.92), rgba(0, 0, 0, 0.48) 46%, rgba(0, 0, 0, 0.15));
}

.hero-content {
  position: relative;
  z-index: 2;
  height: 100%;
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  padding-bottom: 88px;
  color: #fff;
}

.hero-label {
  width: fit-content;
  padding: 8px 14px;
  margin-bottom: 18px;
  border-radius: 999px;
  color: #fef3c7;
  background: rgba(220, 38, 38, 0.68);
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.2);
  font-weight: 800;
}

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

.hero p {
  max-width: 760px;
  margin: 0;
  color: #e5e7eb;
  font-size: 18px;
  line-height: 1.85;
}

.hero-tags,
.detail-tags,
.movie-mini-tags,
.tag-links,
.pill-nav {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tags {
  margin-top: 24px;
}

.hero-tags a,
.detail-tags span,
.movie-mini-tags span,
.tag-links a,
.pill-nav a {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 6px 12px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 700;
}

.hero-tags a {
  color: #fff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.28);
}

.hero-actions,
.page-hero-actions,
.detail-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 28px;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 46px;
  padding: 0 24px;
  border-radius: 999px;
  font-weight: 800;
  transition: transform 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.btn:hover {
  transform: translateY(-2px);
}

.btn.primary {
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 18px 30px rgba(220, 38, 38, 0.24);
}

.btn.ghost {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.45);
  background: rgba(255, 255, 255, 0.14);
}

.btn.ghost.dark {
  color: #111827;
  border: 1px solid rgba(17, 24, 39, 0.16);
  background: rgba(255, 255, 255, 0.72);
}

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

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

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

.page-flow,
.detail-flow {
  padding: 48px 0 72px;
}

.content-section {
  margin-bottom: 64px;
}

.section-heading {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 24px;
  margin-bottom: 26px;
}

.section-heading p {
  margin: 0 0 6px;
  color: var(--red);
  font-weight: 800;
}

.section-heading h2 {
  margin: 0;
  font-size: clamp(26px, 4vw, 36px);
  line-height: 1.15;
}

.text-link {
  color: var(--red);
  font-weight: 800;
}

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

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

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

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

.movie-card {
  min-width: 0;
}

.poster-frame {
  position: relative;
  display: block;
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border-radius: 18px;
  background: radial-gradient(circle at 20% 20%, rgba(249, 115, 22, 0.58), transparent 36%), linear-gradient(135deg, #1f2937, #7f1d1d);
  box-shadow: 0 16px 32px rgba(15, 23, 42, 0.16);
}

.poster-frame.large {
  border-radius: 28px;
}

.poster-frame img,
.rank-poster img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.35s ease;
}

.poster-frame:hover img {
  transform: scale(1.06);
}

.poster-frame::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(180deg, transparent 45%, rgba(0, 0, 0, 0.76));
  opacity: 0.75;
}

.poster-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 2;
  padding: 5px 9px;
  border-radius: 8px;
  color: #fff;
  background: var(--red);
  font-size: 12px;
  font-weight: 900;
}

.play-float {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: 48px;
  height: 48px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: rgba(220, 38, 38, 0.9);
  transform: translate(-50%, -50%) scale(0.88);
  opacity: 0;
  transition: opacity 0.2s ease, transform 0.2s ease;
}

.poster-frame:hover .play-float {
  opacity: 1;
  transform: translate(-50%, -50%) scale(1);
}

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

.movie-card-body h3 {
  margin: 0 0 10px;
  font-size: 16px;
  line-height: 1.4;
}

.movie-card-body h3 a:hover {
  color: var(--red);
}

.movie-card-body p {
  margin: 10px 0 0;
  color: var(--muted);
  font-size: 14px;
  line-height: 1.65;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.movie-mini-tags span {
  min-height: 24px;
  padding: 4px 8px;
  color: #991b1b;
  background: #fee2e2;
  font-size: 12px;
}

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

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

.category-card {
  overflow: hidden;
  border-radius: var(--radius);
  background: #fff;
  box-shadow: var(--shadow);
}

.category-card > a {
  display: block;
  min-height: 210px;
  padding: 24px;
  color: #fff;
  background: radial-gradient(circle at 80% 0%, rgba(250, 204, 21, 0.3), transparent 32%), linear-gradient(135deg, #991b1b, #f97316);
}

.category-card span {
  display: inline-flex;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.18);
  font-weight: 900;
}

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

.category-card p {
  margin: 0;
  color: rgba(255, 255, 255, 0.86);
  line-height: 1.75;
}

.category-preview {
  display: grid;
  gap: 10px;
  padding: 18px 22px 22px;
}

.category-preview a {
  color: #374151;
  font-weight: 700;
}

.category-preview a:hover {
  color: var(--red);
}

.rank-section {
  padding: 32px;
  border-radius: 28px;
  background: #fff;
  box-shadow: var(--shadow);
}

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

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

.rank-card {
  position: relative;
  display: grid;
  grid-template-columns: 92px 1fr;
  gap: 16px;
  align-items: center;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: #fff;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.rank-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 28px rgba(15, 23, 42, 0.1);
}

.rank-number {
  position: absolute;
  left: 8px;
  top: 8px;
  z-index: 2;
  min-width: 28px;
  height: 28px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 9px;
  color: #fff;
  background: var(--red);
  font-weight: 900;
}

.rank-poster {
  overflow: hidden;
  aspect-ratio: 2 / 3;
  border-radius: 14px;
  background: linear-gradient(135deg, #1f2937, #7f1d1d);
}

.rank-card h3 {
  margin: 0 0 8px;
  font-size: 18px;
}

.rank-card h3 a:hover {
  color: var(--red);
}

.rank-card p {
  margin: 0;
  color: var(--muted);
  line-height: 1.65;
}

.rank-meta {
  margin-bottom: 8px !important;
  color: #991b1b !important;
  font-size: 13px;
  font-weight: 800;
}

.page-hero {
  color: #111827;
  background: radial-gradient(circle at 15% 10%, rgba(249, 115, 22, 0.22), transparent 34%), linear-gradient(135deg, #fff7ed, #fee2e2 48%, #ffffff);
  border-bottom: 1px solid rgba(229, 231, 235, 0.8);
}

.page-hero.slim .container {
  padding: 70px 0;
}

.page-hero p {
  margin: 0 0 10px;
  color: var(--red);
  font-weight: 900;
}

.page-hero h1 {
  margin: 0;
  font-size: clamp(34px, 6vw, 58px);
  letter-spacing: -0.04em;
}

.page-hero .lead {
  max-width: 780px;
  margin-top: 18px;
  color: #4b5563;
  font-size: 18px;
  line-height: 1.8;
  font-weight: 500;
}

.pill-nav {
  margin-bottom: 32px;
}

.pill-nav a,
.tag-links a,
.detail-tags span {
  color: #991b1b;
  background: #fee2e2;
}

.search-panel {
  padding: 26px;
  margin-bottom: 36px;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.search-panel label {
  display: block;
  margin-bottom: 12px;
  font-size: 18px;
  font-weight: 900;
}

.search-row {
  display: flex;
  gap: 12px;
}

.search-row input {
  flex: 1;
  min-height: 52px;
  padding: 0 18px;
  border: 1px solid var(--line);
  border-radius: 16px;
  outline: none;
}

.search-row input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.08);
}

.search-row button {
  min-width: 94px;
  border: 0;
  border-radius: 16px;
  color: #fff;
  background: var(--red);
  font-weight: 800;
}

#searchResults:empty {
  display: none;
}

#searchResults:not(:empty) + [data-initial-results] {
  display: none;
}

.detail-hero {
  position: relative;
  overflow: hidden;
  color: #fff;
  background: radial-gradient(circle at 20% 10%, rgba(249, 115, 22, 0.42), transparent 34%), linear-gradient(135deg, #111827, #7f1d1d);
}

.detail-hero-grid {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 44px;
  align-items: center;
  padding: 72px 0;
}

.detail-copy h1 {
  margin: 14px 0 18px;
  font-size: clamp(36px, 6vw, 62px);
  line-height: 1.05;
  letter-spacing: -0.04em;
}

.detail-copy p {
  max-width: 760px;
  margin: 0;
  color: #e5e7eb;
  font-size: 18px;
  line-height: 1.85;
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 9px;
  color: #fef3c7;
  font-weight: 800;
}

.detail-tags {
  margin-top: 24px;
}

.detail-article,
.player-section {
  margin-bottom: 44px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  aspect-ratio: 16 / 9;
  border-radius: 28px;
  background: #020617;
  box-shadow: 0 22px 56px rgba(2, 6, 23, 0.3);
}

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

.player-start {
  position: absolute;
  left: 50%;
  top: 50%;
  display: inline-flex;
  align-items: center;
  gap: 12px;
  padding: 14px 22px;
  border: 0;
  border-radius: 999px;
  color: #fff;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 18px 30px rgba(220, 38, 38, 0.28);
  transform: translate(-50%, -50%);
  font-weight: 900;
}

.player-start span {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: var(--red);
  background: #fff;
}

.player-shell.is-playing .player-start {
  display: none;
}

.player-status {
  position: absolute;
  left: 24px;
  bottom: 18px;
  margin: 0;
  padding: 8px 12px;
  border-radius: 999px;
  color: rgba(255, 255, 255, 0.9);
  background: rgba(0, 0, 0, 0.46);
  font-size: 13px;
}

.player-shell.is-playing .player-status {
  opacity: 0;
}

.detail-article {
  display: grid;
  gap: 24px;
}

.detail-article section {
  padding: 30px;
  border-radius: 24px;
  background: #fff;
  box-shadow: var(--shadow);
}

.detail-article h2 {
  margin: 0 0 16px;
  font-size: 26px;
}

.detail-article p {
  margin: 0;
  color: #374151;
  font-size: 17px;
  line-height: 1.9;
}

.info-table dl {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 14px;
  margin: 0;
}

.info-table div {
  padding: 16px;
  border-radius: 16px;
  background: #f9fafb;
}

.info-table dt {
  color: var(--muted);
  font-size: 13px;
  font-weight: 800;
}

.info-table dd {
  margin: 6px 0 0;
  color: #111827;
  font-weight: 800;
}

.site-footer {
  color: #d1d5db;
  background: linear-gradient(135deg, #111827, #450a0a);
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 40px;
  padding: 54px 0;
}

.footer-brand {
  color: #fff;
  margin-bottom: 18px;
}

.footer-grid p {
  max-width: 520px;
  margin: 0;
  line-height: 1.8;
}

.footer-grid h2 {
  margin: 0 0 14px;
  color: #fecaca;
  font-size: 18px;
}

.footer-grid ul {
  display: grid;
  gap: 10px;
  margin: 0;
  padding: 0;
  list-style: none;
}

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

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

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

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

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

@media (max-width: 820px) {
  .hero {
    height: 540px;
  }

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

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

  .home-rank,
  .category-grid.wide,
  .footer-grid,
  .detail-hero-grid {
    grid-template-columns: 1fr;
  }

  .detail-poster {
    max-width: 240px;
  }

  .info-table dl {
    grid-template-columns: 1fr;
  }
}

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

  .header-inner {
    min-height: 66px;
  }

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

  .brand-text strong {
    font-size: 18px;
  }

  .hero {
    height: 520px;
  }

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

  .hero-actions,
  .page-hero-actions,
  .detail-actions,
  .search-row {
    flex-direction: column;
  }

  .movie-grid.six,
  .movie-grid.five,
  .movie-grid.three,
  .category-grid {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 16px;
  }

  .movie-card-body p {
    -webkit-line-clamp: 2;
  }

  .rank-card {
    grid-template-columns: 72px 1fr;
  }

  .rank-section,
  .detail-article section,
  .search-panel {
    padding: 20px;
    border-radius: 20px;
  }

  .player-shell {
    border-radius: 18px;
  }
}
