* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  color: #111827;
  background: #f5f7fb;
  line-height: 1.6;
}

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

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.nav-bar {
  min-height: 72px;
  display: flex;
  align-items: center;
  gap: 28px;
}

.brand,
.footer-brand {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: -0.02em;
}

.brand {
  flex-shrink: 0;
  font-size: 19px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #dc2626, #f97316);
  box-shadow: 0 10px 24px rgba(220, 38, 38, 0.28);
}

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

.nav-link {
  color: #4b5563;
  font-weight: 600;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.is-active,
.mobile-link.is-active {
  color: #dc2626;
}

.nav-search,
.mobile-search,
.wide-search,
.hero-search {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-search input,
.mobile-search input,
.wide-search input,
.hero-search input,
.inline-filter input,
.toolbar-fields input,
.toolbar-fields select,
.list-toolbar input {
  border: 1px solid #d1d5db;
  border-radius: 999px;
  background: #fff;
  outline: none;
  padding: 10px 16px;
  color: #111827;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.nav-search input:focus,
.mobile-search input:focus,
.wide-search input:focus,
.hero-search input:focus,
.inline-filter input:focus,
.toolbar-fields input:focus,
.toolbar-fields select:focus,
.list-toolbar input:focus {
  border-color: #ef4444;
  box-shadow: 0 0 0 4px rgba(239, 68, 68, 0.13);
}

.nav-search input {
  width: 220px;
}

.nav-search button,
.mobile-search button,
.wide-search button,
.hero-search button {
  border: 0;
  color: #fff;
  border-radius: 999px;
  padding: 10px 18px;
  background: #2563eb;
  font-weight: 700;
  transition: background 0.2s ease, transform 0.2s ease;
}

.nav-search button:hover,
.mobile-search button:hover,
.wide-search button:hover,
.hero-search button:hover,
.primary-button:hover {
  background: #1d4ed8;
  transform: translateY(-1px);
}

.nav-toggle {
  display: none;
  border: 0;
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: #f3f4f6;
  color: #111827;
  margin-left: auto;
}

.mobile-menu {
  padding: 0 16px 18px;
  border-top: 1px solid #e5e7eb;
  background: #fff;
}

.mobile-link {
  display: block;
  padding: 12px 0;
  color: #374151;
  font-weight: 700;
}

.mobile-search {
  padding: 16px 0 8px;
}

.mobile-search input {
  min-width: 0;
  flex: 1;
}

.hero-carousel {
  position: relative;
  height: 540px;
  overflow: hidden;
  background: #111827;
}

.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-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}

.hero-shade,
.detail-shade {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.86) 0%, rgba(0, 0, 0, 0.55) 48%, rgba(0, 0, 0, 0.1) 100%);
}

.hero-content {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
}

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

.hero-label,
.page-hero span,
.section-heading span,
.panel-heading span {
  display: inline-flex;
  align-items: center;
  width: fit-content;
  color: #fff;
  background: linear-gradient(90deg, #dc2626, #f97316);
  padding: 7px 14px;
  border-radius: 999px;
  font-size: 14px;
  font-weight: 800;
  margin-bottom: 16px;
}

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

.hero-copy p,
.page-hero p,
.detail-title-row p {
  margin: 0 0 26px;
  color: rgba(255, 255, 255, 0.9);
  font-size: 19px;
  max-width: 780px;
}

.hero-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-bottom: 30px;
  color: rgba(255, 255, 255, 0.84);
  font-weight: 700;
}

.hero-meta span {
  display: inline-flex;
  align-items: center;
  min-height: 30px;
  padding: 4px 11px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.12);
  backdrop-filter: blur(10px);
}

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

.primary-button,
.ghost-button,
.text-button,
.panel-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  border-radius: 999px;
  padding: 0 24px;
  font-weight: 800;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-button {
  color: #fff;
  background: #2563eb;
  box-shadow: 0 14px 28px rgba(37, 99, 235, 0.25);
}

.ghost-button {
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.5);
  background: rgba(255, 255, 255, 0.12);
}

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

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 3;
  transform: translateY(-50%);
  width: 52px;
  height: 52px;
  border: 0;
  border-radius: 50%;
  color: #fff;
  background: rgba(0, 0, 0, 0.5);
  font-size: 38px;
  line-height: 1;
  transition: background 0.2s ease;
}

.hero-arrow:hover {
  background: rgba(0, 0, 0, 0.72);
}

.hero-prev {
  left: 22px;
}

.hero-next {
  right: 22px;
}

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

.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: 28px;
  background: #fff;
}

.home-search-panel {
  margin-top: -34px;
  position: relative;
  z-index: 6;
}

.search-panel-inner {
  display: grid;
  grid-template-columns: 1fr minmax(320px, 520px);
  gap: 24px;
  align-items: center;
  padding: 24px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid rgba(229, 231, 235, 0.9);
  border-radius: 26px;
  box-shadow: 0 22px 60px rgba(15, 23, 42, 0.15);
}

.search-panel-inner h2,
.section-heading h2,
.panel-heading h2,
.list-toolbar h2,
.story-card h2,
.side-card h2,
.category-overview-card h2,
.cta-box h2 {
  margin: 0;
  font-size: clamp(24px, 3vw, 36px);
  line-height: 1.15;
  letter-spacing: -0.03em;
  font-weight: 900;
  color: #111827;
}

.search-panel-inner p,
.list-toolbar p,
.category-overview-card p,
.cta-box p {
  margin: 8px 0 0;
  color: #6b7280;
}

.wide-search input,
.hero-search input {
  flex: 1;
  min-width: 0;
}

.section-block {
  padding: 76px 0;
}

.section-soft {
  background: #fff;
}

.section-gradient {
  background: linear-gradient(135deg, #111827, #7f1d1d);
  color: #fff;
}

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

.section-heading span,
.panel-heading span,
.page-hero span {
  color: #dc2626;
  background: #fee2e2;
  margin-bottom: 10px;
}

.section-heading a {
  color: #dc2626;
  font-weight: 800;
}

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

.category-card,
.category-overview-card,
.movie-card,
.ranking-panel,
.story-card,
.side-card {
  background: #fff;
  border: 1px solid #e5e7eb;
  border-radius: 22px;
  box-shadow: 0 12px 30px rgba(15, 23, 42, 0.07);
}

.category-card {
  min-height: 136px;
  padding: 20px;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

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

.category-card span {
  color: #6b7280;
  font-weight: 800;
}

.category-card strong {
  color: #111827;
  font-size: 28px;
}

.category-card em {
  color: #dc2626;
  font-style: normal;
  font-size: 14px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.inline-filter {
  margin-bottom: 24px;
}

.inline-filter input {
  width: min(420px, 100%);
}

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

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

.movie-card {
  overflow: hidden;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.movie-poster {
  display: block;
  position: relative;
  aspect-ratio: 3 / 4;
  overflow: hidden;
  background: linear-gradient(135deg, #111827, #374151);
}

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

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

.rank-badge {
  position: absolute;
  left: 12px;
  top: 12px;
  z-index: 2;
  min-width: 34px;
  height: 34px;
  border-radius: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #fff;
  background: linear-gradient(135deg, #dc2626, #f97316);
  font-weight: 900;
  box-shadow: 0 10px 24px rgba(0, 0, 0, 0.24);
}

.movie-info {
  padding: 15px;
}

.movie-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
  color: #6b7280;
  font-size: 12px;
  font-weight: 700;
  margin-bottom: 8px;
}

.movie-meta span {
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.movie-info h3 {
  margin: 0 0 8px;
  color: #111827;
  font-size: 17px;
  line-height: 1.35;
  font-weight: 900;
}

.movie-info h3 a:hover {
  color: #dc2626;
}

.movie-info p {
  display: -webkit-box;
  min-height: 43px;
  margin: 0 0 12px;
  color: #6b7280;
  font-size: 14px;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.tag-row,
.tag-cloud,
.category-pills {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.tag-row span,
.tag-cloud a,
.category-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  padding: 5px 10px;
  font-size: 12px;
  font-weight: 800;
}

.tag-cloud a:hover,
.category-pill:hover {
  color: #dc2626;
  background: #fee2e2;
}

.two-column-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 30px;
  align-items: start;
}

.ranking-panel {
  padding: 22px;
}

.panel-heading {
  margin-bottom: 18px;
}

.rank-item {
  display: grid;
  grid-template-columns: 34px 54px 1fr auto;
  gap: 12px;
  align-items: center;
  padding: 10px 0;
  border-bottom: 1px solid #f3f4f6;
}

.rank-item:last-of-type {
  border-bottom: 0;
}

.rank-number {
  color: #dc2626;
  font-weight: 900;
  font-size: 18px;
}

.rank-item img {
  width: 54px;
  height: 72px;
  border-radius: 12px;
  object-fit: cover;
  background: #111827;
}

.rank-title {
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-weight: 800;
}

.rank-score {
  color: #f59e0b;
  font-weight: 900;
}

.panel-more {
  width: 100%;
  margin-top: 18px;
  color: #fff;
  background: #dc2626;
}

.cta-box {
  text-align: center;
}

.cta-box h2,
.cta-box p {
  color: #fff;
}

.cta-box p {
  max-width: 760px;
  margin: 12px auto 24px;
  color: rgba(255, 255, 255, 0.82);
}

.category-pills {
  justify-content: center;
}

.category-pill {
  color: #fff;
  background: rgba(255, 255, 255, 0.14);
  border: 1px solid rgba(255, 255, 255, 0.2);
}

.page-main {
  background: #f5f7fb;
}

.page-hero {
  position: relative;
  color: #fff;
  padding: 86px 0;
  background: radial-gradient(circle at top left, rgba(249, 115, 22, 0.4), transparent 34%), linear-gradient(135deg, #111827, #7f1d1d 58%, #111827);
}

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

.page-hero h1 {
  max-width: 880px;
}

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

.category-overview-card {
  padding: 26px;
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.category-count {
  width: fit-content;
  color: #dc2626;
  background: #fee2e2;
  border-radius: 999px;
  padding: 6px 12px;
  font-weight: 900;
  margin-bottom: 16px;
}

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

.overview-links a {
  color: #4b5563;
  font-weight: 700;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.overview-links a:hover,
.text-button:hover {
  color: #dc2626;
}

.text-button {
  justify-content: flex-start;
  color: #dc2626;
  background: #fee2e2;
}

.list-toolbar {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: end;
  margin-bottom: 26px;
}

.toolbar-fields {
  display: flex;
  gap: 12px;
  flex-wrap: wrap;
  justify-content: flex-end;
}

.toolbar-fields input {
  min-width: 260px;
}

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

.ranking-content {
  min-width: 0;
}

.sticky-panel {
  position: sticky;
  top: 96px;
}

.detail-hero {
  position: relative;
  min-height: 520px;
  overflow: hidden;
  color: #fff;
  background: #111827;
}

.detail-backdrop {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: blur(6px) scale(1.03);
  opacity: 0.72;
}

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

.breadcrumb {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  color: rgba(255, 255, 255, 0.78);
  margin-bottom: 32px;
  font-weight: 700;
}

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

.detail-title-row {
  display: grid;
  grid-template-columns: 220px minmax(0, 1fr);
  gap: 32px;
  align-items: end;
}

.detail-poster {
  width: 220px;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: 26px;
  box-shadow: 0 30px 80px rgba(0, 0, 0, 0.45);
  background: #111827;
}

.detail-meta {
  margin-bottom: 0;
}

.detail-section {
  padding-top: 40px;
}

.detail-layout {
  grid-template-columns: minmax(0, 1fr) 320px;
}

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

.player-shell {
  margin-bottom: 28px;
}

.video-stage {
  position: relative;
  overflow: hidden;
  border-radius: 28px;
  background: #000;
  aspect-ratio: 16 / 9;
  box-shadow: 0 20px 60px rgba(15, 23, 42, 0.26);
}

.video-stage video,
.player-cover {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
}

.video-stage video {
  z-index: 1;
  background: #000;
}

.player-cover {
  z-index: 2;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 14px;
  border: 0;
  color: #fff;
  background-size: cover;
  background-position: center;
  transition: opacity 0.24s ease, visibility 0.24s ease;
}

.player-cover.is-hidden {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
}

.play-icon {
  width: 72px;
  height: 72px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  color: #fff;
  background: linear-gradient(135deg, #2563eb, #dc2626);
  font-size: 30px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.32);
}

.play-text {
  font-size: 20px;
  font-weight: 900;
}

.story-card,
.side-card {
  padding: 26px;
  margin-bottom: 22px;
}

.story-card h2,
.side-card h2 {
  font-size: 26px;
  margin-bottom: 12px;
}

.story-card p {
  margin: 0;
  color: #374151;
  font-size: 17px;
}

.side-card dl {
  margin: 0;
}

.side-card dl div {
  display: grid;
  grid-template-columns: 70px minmax(0, 1fr);
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid #f3f4f6;
}

.side-card dl div:last-child {
  border-bottom: 0;
}

.side-card dt {
  color: #6b7280;
  font-weight: 800;
}

.side-card dd {
  margin: 0;
  color: #111827;
  font-weight: 800;
}

.site-footer {
  color: #d1d5db;
  background: linear-gradient(180deg, #111827, #000000);
  padding: 56px 0;
}

.footer-grid {
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 36px;
}

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

.site-footer p {
  max-width: 520px;
  color: #9ca3af;
}

.site-footer h2 {
  margin: 0 0 16px;
  color: #fff;
  font-size: 18px;
}

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

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

[hidden] {
  display: none !important;
}

@media (max-width: 1120px) {
  .movie-grid {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }

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

  .two-column-layout,
  .ranking-layout,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .sticky-panel {
    position: static;
  }
}

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

  .nav-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
  }

  .brand-text {
    max-width: 230px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
  }

  .hero-carousel {
    height: 620px;
  }

  .hero-content {
    align-items: end;
    padding-bottom: 82px;
  }

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

  .hero-arrow {
    display: none;
  }

  .search-panel-inner {
    grid-template-columns: 1fr;
  }

  .wide-search,
  .hero-search,
  .list-toolbar,
  .toolbar-fields {
    align-items: stretch;
    flex-direction: column;
  }

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

  .category-grid,
  .category-overview-grid,
  .footer-grid {
    grid-template-columns: 1fr;
  }

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

  .detail-title-row {
    grid-template-columns: 130px minmax(0, 1fr);
    align-items: center;
    gap: 18px;
  }

  .detail-poster {
    width: 130px;
    border-radius: 18px;
  }

  .detail-hero {
    min-height: 560px;
  }
}

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

  .brand {
    font-size: 16px;
  }

  .brand-text {
    max-width: 180px;
  }

  .hero-carousel {
    height: 650px;
  }

  .hero-meta {
    gap: 8px;
  }

  .hero-actions,
  .hero-search {
    flex-direction: column;
    align-items: stretch;
  }

  .primary-button,
  .ghost-button {
    width: 100%;
  }

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

  .overview-links {
    grid-template-columns: 1fr;
  }

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

  .detail-poster {
    width: 180px;
  }

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