:root {
  --page-bg: #f8fafc;
  --surface: #ffffff;
  --surface-soft: #fff7ed;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --red: #dc2626;
  --red-dark: #991b1b;
  --orange: #f97316;
  --amber: #f59e0b;
  --shadow: 0 18px 45px rgba(15, 23, 42, 0.12);
  --shadow-soft: 0 10px 30px rgba(15, 23, 42, 0.08);
  --radius: 22px;
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  background: var(--page-bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.94);
  border-bottom: 1px solid rgba(229, 231, 235, 0.86);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.08);
  backdrop-filter: blur(16px);
}

.site-header-inner {
  width: min(1180px, calc(100% - 32px));
  height: 68px;
  margin: 0 auto;
  display: flex;
  align-items: center;
  gap: 24px;
}

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

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

.brand-name {
  max-width: 270px;
  overflow: hidden;
  color: transparent;
  font-size: 20px;
  white-space: nowrap;
  text-overflow: ellipsis;
  background: linear-gradient(90deg, var(--red), var(--orange));
  background-clip: text;
  -webkit-background-clip: text;
}

.primary-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  margin-left: auto;
}

.primary-nav a {
  color: #374151;
  font-size: 15px;
  font-weight: 650;
  transition: color 0.2s ease;
}

.primary-nav a:hover {
  color: var(--red);
}

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

.header-search input,
.mobile-search input,
.large-search input,
.filter-search input {
  width: 240px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #ffffff;
  padding: 10px 15px;
  outline: none;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input:focus,
.mobile-search input:focus,
.large-search input:focus,
.filter-search input:focus {
  border-color: var(--red);
  box-shadow: 0 0 0 4px rgba(220, 38, 38, 0.12);
}

.header-search button,
.mobile-search button,
.large-search button,
.filter-search button,
.btn {
  border: 0;
  border-radius: 999px;
  padding: 10px 18px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 10px 20px rgba(220, 38, 38, 0.2);
  cursor: pointer;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.large-search button:hover,
.filter-search button:hover,
.btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 14px 26px rgba(220, 38, 38, 0.28);
}

.mobile-toggle {
  display: none;
  margin-left: auto;
  border: 0;
  border-radius: 12px;
  padding: 9px 12px;
  color: #111827;
  background: #f3f4f6;
}

.mobile-panel {
  display: none;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 0 0 18px;
}

.mobile-panel.is-open {
  display: grid;
  gap: 12px;
}

.mobile-panel a {
  padding: 8px 0;
  color: #374151;
  font-weight: 650;
}

.mobile-categories {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mobile-categories a {
  border-radius: 999px;
  padding: 7px 12px;
  background: #fff1f2;
  color: var(--red);
  font-size: 13px;
}

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

.hero-slider {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  background: #020617;
}

.hero-track {
  position: absolute;
  inset: 0;
}

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

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

.hero-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.05);
  filter: saturate(1.1);
}

.hero-shade {
  position: absolute;
  inset: 0;
  background:
    radial-gradient(circle at 70% 20%, rgba(249, 115, 22, 0.22), transparent 28%),
    linear-gradient(90deg, rgba(2, 6, 23, 0.92), rgba(2, 6, 23, 0.58) 48%, rgba(2, 6, 23, 0.34)),
    linear-gradient(0deg, #020617 0%, rgba(2, 6, 23, 0.1) 45%);
}

.hero-content {
  position: relative;
  z-index: 2;
  min-height: 620px;
  display: grid;
  grid-template-columns: 1.2fr 0.72fr;
  align-items: center;
  gap: 54px;
  padding: 72px 0;
}

.hero-copy {
  color: #ffffff;
}

.eyebrow {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 7px 13px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.16);
  font-size: 13px;
  font-weight: 800;
  letter-spacing: 0.04em;
}

.eyebrow.red {
  color: var(--red);
  background: #fff1f2;
}

.hero-copy h1,
.hero-copy h2 {
  margin: 20px 0 16px;
  max-width: 760px;
  font-size: clamp(40px, 6vw, 76px);
  line-height: 1.02;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.hero-copy p {
  max-width: 720px;
  color: rgba(255, 255, 255, 0.86);
  font-size: 19px;
  line-height: 1.8;
}

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

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

.hero-tags span,
.detail-meta span,
.tag-row span,
.detail-tags a {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 11px;
  background: rgba(255, 255, 255, 0.16);
  color: rgba(255, 255, 255, 0.9);
  font-size: 13px;
  font-weight: 650;
}

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

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  font-weight: 750;
}

.btn.ghost {
  border: 1px solid rgba(255, 255, 255, 0.32);
  background: rgba(255, 255, 255, 0.12);
  box-shadow: none;
  backdrop-filter: blur(8px);
}

.hero-poster {
  position: relative;
  overflow: hidden;
  border: 1px solid rgba(255, 255, 255, 0.18);
  border-radius: 34px;
  box-shadow: 0 30px 90px rgba(0, 0, 0, 0.46);
  transform: rotate(1.5deg);
}

.hero-poster img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  transition: transform 0.5s ease;
}

.hero-poster:hover img {
  transform: scale(1.05);
}

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

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

.hero-dots button.is-active {
  width: 54px;
  background: #ffffff;
}

.hero-rail-wrap {
  position: relative;
  z-index: 4;
  margin-top: -62px;
}

.hero-rail {
  display: grid;
  grid-template-columns: repeat(8, minmax(0, 1fr));
  gap: 12px;
  border: 1px solid rgba(255, 255, 255, 0.62);
  border-radius: 24px;
  padding: 14px;
  background: rgba(255, 255, 255, 0.92);
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
}

.hero-mini {
  min-width: 0;
}

.hero-mini img {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 16px;
  object-fit: cover;
}

.hero-mini span {
  display: block;
  margin-top: 8px;
  overflow: hidden;
  color: #374151;
  font-size: 13px;
  font-weight: 750;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.section-head-block {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 28px;
  padding-top: 72px;
  padding-bottom: 20px;
}

.section-head-block.inline-head {
  padding-top: 0;
}

.section-head-block h1,
.section-head-block h2,
.page-hero h1,
.search-panel h2,
.ranking-side h2 {
  margin: 12px 0 8px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.12;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.section-head-block p,
.page-hero p,
.search-panel p {
  max-width: 760px;
  color: var(--muted);
  line-height: 1.8;
}

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

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

.movie-card {
  overflow: hidden;
  border: 1px solid rgba(229, 231, 235, 0.8);
  border-radius: var(--radius);
  background: var(--surface);
  box-shadow: var(--shadow-soft);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.movie-card:hover {
  transform: translateY(-5px);
  border-color: rgba(220, 38, 38, 0.26);
  box-shadow: var(--shadow);
}

.poster-link {
  position: relative;
  display: block;
  overflow: hidden;
  background: #111827;
}

.poster-link img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  transition: transform 0.5s ease;
}

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

.poster-badge {
  position: absolute;
  top: 12px;
  right: 12px;
  border-radius: 999px;
  padding: 5px 10px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.58);
  font-size: 12px;
  font-weight: 750;
  backdrop-filter: blur(8px);
}

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

.movie-card-title,
.rank-title,
.category-title {
  display: block;
  color: #111827;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 850;
}

.movie-card-title:hover,
.rank-title:hover,
.category-title:hover {
  color: var(--red);
}

.movie-meta {
  margin-top: 7px;
  overflow: hidden;
  color: var(--muted);
  font-size: 13px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.movie-card-text {
  display: -webkit-box;
  min-height: 48px;
  margin-top: 10px;
  overflow: hidden;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.72;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tag-row {
  margin-top: 12px;
}

.tag-row span {
  background: #fff1f2;
  color: var(--red);
}

.category-section {
  padding-top: 72px;
}

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

.category-card {
  overflow: hidden;
  border: 1px solid rgba(229, 231, 235, 0.86);
  border-radius: var(--radius);
  padding: 16px;
  background: linear-gradient(135deg, #ffffff, #fff7ed);
  box-shadow: var(--shadow-soft);
}

.category-preview {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 8px;
  margin-bottom: 16px;
}

.category-preview img {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  object-fit: cover;
}

.category-card p {
  margin: 8px 0 14px;
  color: var(--muted);
  line-height: 1.7;
}

.split-layout,
.ranking-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 340px;
  gap: 28px;
  padding-top: 72px;
}

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

.rank-item {
  display: grid;
  grid-template-columns: 56px 74px minmax(0, 1fr);
  align-items: center;
  gap: 14px;
  border: 1px solid rgba(229, 231, 235, 0.86);
  border-radius: 18px;
  padding: 12px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.rank-number {
  display: grid;
  width: 46px;
  height: 46px;
  place-items: center;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--red), var(--orange));
  font-weight: 900;
}

.rank-poster img {
  width: 74px;
  aspect-ratio: 2 / 3;
  border-radius: 12px;
  object-fit: cover;
}

.rank-item p {
  display: -webkit-box;
  margin: 6px 0;
  overflow: hidden;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.6;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.rank-item span {
  color: var(--muted);
  font-size: 13px;
}

.search-panel,
.ranking-side {
  position: sticky;
  top: 92px;
  align-self: start;
  border: 1px solid rgba(254, 202, 202, 0.9);
  border-radius: 28px;
  padding: 24px;
  background: linear-gradient(135deg, #fff7ed, #ffffff);
  box-shadow: var(--shadow-soft);
}

.large-search {
  margin-top: 20px;
}

.large-search input {
  flex: 1;
  width: 100%;
}

.page-hero {
  margin-top: 34px;
  padding: 42px;
}

.soft-hero {
  border: 1px solid rgba(254, 202, 202, 0.9);
  border-radius: 30px;
  background:
    radial-gradient(circle at 80% 20%, rgba(249, 115, 22, 0.16), transparent 28%),
    linear-gradient(135deg, #ffffff, #fff7ed);
  box-shadow: var(--shadow-soft);
}

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
  color: var(--muted);
  font-size: 14px;
}

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

.filter-bar {
  display: grid;
  gap: 14px;
  margin-top: 24px;
  margin-bottom: 24px;
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 18px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.filter-search input {
  flex: 1;
  width: 100%;
}

.filter-search button {
  background: #111827;
  box-shadow: none;
}

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

.filter-chips button {
  border: 0;
  border-radius: 999px;
  padding: 8px 13px;
  color: var(--red);
  background: #fff1f2;
  font-weight: 700;
  cursor: pointer;
}

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

.compact-card .movie-card-title {
  font-size: 15px;
}

.compact-card .movie-card-text,
.compact-card .tag-row {
  display: none;
}

.library-grid {
  padding-bottom: 60px;
}

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

.side-card-grid {
  display: grid;
  gap: 14px;
  margin-top: 18px;
}

.side-card-grid .movie-card {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
}

.side-card-grid .poster-link img {
  height: 100%;
  min-height: 138px;
}

.detail-hero {
  margin-top: 34px;
}

.detail-layout {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 38px;
  align-items: center;
  border-radius: 34px;
  padding: 34px;
  color: #ffffff;
  background:
    radial-gradient(circle at 80% 12%, rgba(249, 115, 22, 0.28), transparent 28%),
    linear-gradient(135deg, #111827, #450a0a 62%, #7f1d1d);
  box-shadow: var(--shadow);
}

.detail-poster img {
  width: 100%;
  aspect-ratio: 2 / 3;
  border-radius: 26px;
  object-fit: cover;
  box-shadow: 0 24px 70px rgba(0, 0, 0, 0.35);
}

.detail-copy h1 {
  margin: 18px 0 12px;
  font-size: clamp(36px, 5vw, 66px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.detail-intro {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 19px;
  line-height: 1.8;
}

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

.detail-tags a {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.14);
}

.detail-copy .btn {
  margin-top: 26px;
}

.watch-section {
  padding-top: 54px;
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 30px;
  background: #000000;
  box-shadow: var(--shadow);
}

.movie-player {
  width: 100%;
  aspect-ratio: 16 / 9;
  background: #000000;
}

.player-cover {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  gap: 10px;
  border: 0;
  color: #ffffff;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.28));
  cursor: pointer;
}

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

.play-circle {
  display: grid;
  width: 86px;
  height: 86px;
  place-items: center;
  border-radius: 999px;
  padding-left: 5px;
  color: #ffffff;
  background: linear-gradient(135deg, var(--red), var(--orange));
  box-shadow: 0 18px 40px rgba(220, 38, 38, 0.34);
  font-size: 34px;
}

.player-cover strong {
  font-size: clamp(22px, 3vw, 36px);
  font-weight: 900;
}

.player-cover em {
  font-style: normal;
  opacity: 0.86;
}

.detail-text-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 24px;
  padding-top: 42px;
}

.detail-text-grid article {
  border: 1px solid var(--line);
  border-radius: 24px;
  padding: 26px;
  background: #ffffff;
  box-shadow: var(--shadow-soft);
}

.detail-text-grid h2 {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 900;
}

.detail-text-grid p {
  color: #374151;
  line-height: 1.9;
  white-space: pre-line;
}

.site-footer {
  margin-top: 76px;
  padding: 48px 0 26px;
  color: #e5e7eb;
  background: #111827;
}

.footer-grid {
  display: grid;
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  grid-template-columns: 1.2fr 0.7fr 0.7fr;
  gap: 28px;
}

.footer-brand {
  color: #ffffff;
  font-size: 22px;
}

.site-footer p {
  max-width: 560px;
  margin-top: 12px;
  color: #9ca3af;
  line-height: 1.8;
}

.site-footer h2 {
  margin: 0 0 14px;
  color: #ffffff;
  font-size: 18px;
  font-weight: 850;
}

.site-footer a {
  display: block;
  margin: 8px 0;
  color: #d1d5db;
}

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

.copyright {
  width: min(1180px, calc(100% - 32px));
  margin: 26px auto 0;
  border-top: 1px solid rgba(255, 255, 255, 0.12);
  padding-top: 20px;
  color: #9ca3af;
}

@media (max-width: 1060px) {
  .header-search {
    display: none;
  }

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

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

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

  .split-layout,
  .ranking-layout {
    grid-template-columns: 1fr;
  }

  .search-panel,
  .ranking-side {
    position: static;
  }

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

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

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

  .site-header-inner {
    height: 64px;
  }

  .brand-name {
    max-width: 210px;
    font-size: 17px;
  }

  .hero-slider,
  .hero-content {
    min-height: 720px;
  }

  .hero-content {
    grid-template-columns: 1fr;
    gap: 26px;
    padding: 44px 0 86px;
  }

  .hero-poster {
    width: min(280px, 76vw);
    margin: 0 auto;
  }

  .hero-copy h1,
  .hero-copy h2 {
    font-size: clamp(36px, 12vw, 56px);
  }

  .hero-copy p {
    font-size: 16px;
  }

  .hero-rail-wrap {
    margin-top: -42px;
  }

  .hero-rail {
    overflow-x: auto;
    display: flex;
  }

  .hero-mini {
    width: 112px;
    flex: 0 0 112px;
  }

  .section-head-block {
    display: grid;
    align-items: start;
    padding-top: 54px;
  }

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

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

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

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

  .page-hero {
    padding: 28px;
  }
}

@media (max-width: 520px) {
  .site-section,
  .site-header-inner,
  .mobile-panel,
  .footer-grid,
  .copyright {
    width: min(100% - 22px, 1180px);
  }

  .brand-name {
    max-width: 176px;
  }

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

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

  .rank-number {
    width: 38px;
    height: 38px;
    border-radius: 13px;
  }

  .rank-poster img {
    width: 62px;
  }

  .filter-search,
  .large-search,
  .mobile-search {
    align-items: stretch;
    flex-direction: column;
  }

  .filter-search button,
  .large-search button,
  .mobile-search button {
    width: 100%;
  }
}
