* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  color: #111827;
  background: linear-gradient(180deg, #f9fafb 0%, #ffffff 46%, #f9fafb 100%);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
}

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

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

button,
input,
select {
  font: inherit;
}

button {
  cursor: pointer;
}

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

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 80;
  background: rgba(255, 255, 255, 0.95);
  border-bottom: 1px solid rgba(229, 231, 235, 0.7);
  backdrop-filter: blur(16px);
}

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

.brand,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
}

.brand-mark {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: linear-gradient(135deg, #111827, #4b5563);
  box-shadow: 0 12px 28px rgba(17, 24, 39, 0.18);
  font-size: 14px;
}

.brand-text,
.footer-logo span:last-child {
  display: flex;
  flex-direction: column;
  line-height: 1.1;
}

.brand-text strong,
.footer-logo strong {
  color: #1f2937;
  font-size: 20px;
  font-weight: 650;
}

.brand-text small,
.footer-logo small {
  margin-top: 2px;
  color: #6b7280;
  font-size: 12px;
}

.site-search {
  flex: 1;
  max-width: 440px;
  display: flex;
  align-items: center;
  gap: 8px;
}

.site-search label {
  flex: 1;
}

.site-search input,
.search-page-form input {
  width: 100%;
  border: 1px solid #d1d5db;
  border-radius: 999px;
  outline: 0;
  background: rgba(249, 250, 251, 0.75);
  padding: 10px 16px;
  transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.site-search input:focus,
.search-page-form input:focus,
.sort-select:focus {
  border-color: #9ca3af;
  background: #ffffff;
  box-shadow: 0 0 0 3px rgba(209, 213, 219, 0.75);
}

.site-search button,
.search-page-form button {
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: #111827;
  padding: 10px 18px;
  transition: background 0.2s ease, transform 0.2s ease;
}

.site-search button:hover,
.search-page-form button:hover,
.primary-btn:hover {
  background: #374151;
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 22px;
  color: #4b5563;
  font-size: 14px;
}

.desktop-nav a:hover,
.footer-links a:hover,
.section-more:hover,
.breadcrumb a:hover {
  color: #111827;
}

.mobile-toggle {
  display: none;
  border: 0;
  color: #4b5563;
  background: transparent;
  font-size: 26px;
}

.mobile-panel {
  border-top: 1px solid #e5e7eb;
  padding: 16px;
  background: rgba(255, 255, 255, 0.96);
}

.mobile-panel nav,
.mobile-tags {
  width: min(1180px, 100%);
  margin: 12px auto 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.mobile-panel a,
.mobile-tags a {
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  padding: 8px 12px;
  font-size: 14px;
}

.hero {
  position: relative;
  height: 500px;
  overflow: hidden;
  background: #111827;
}

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

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

.hero-slide img {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  background: linear-gradient(135deg, #1f2937, #111827);
}

.hero-shade {
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(90deg, rgba(17, 24, 39, 0.95), rgba(31, 41, 55, 0.72), rgba(17, 24, 39, 0.28));
}

.hero-content {
  position: relative;
  z-index: 2;
  width: min(1180px, calc(100% - 32px));
  height: 100%;
  margin: 0 auto;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: flex-start;
  max-width: 1180px;
  color: #ffffff;
}

.hero-pill {
  display: inline-flex;
  align-items: center;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  padding: 8px 16px;
  margin-bottom: 22px;
  color: rgba(255, 255, 255, 0.92);
  font-size: 14px;
}

.hero h1 {
  max-width: 820px;
  margin: 0 0 10px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.05;
  font-weight: 760;
  letter-spacing: -0.04em;
}

.hero h2 {
  margin: 0 0 12px;
  font-size: clamp(24px, 3vw, 38px);
  font-weight: 700;
}

.hero p {
  max-width: 680px;
  margin: 0 0 22px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 19px;
  line-height: 1.7;
}

.hero-tags,
.hero-actions,
.detail-meta,
.card-meta,
.detail-tags,
.page-hero-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
}

.hero-tags span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.13);
  color: rgba(255, 255, 255, 0.86);
  padding: 6px 12px;
  font-size: 13px;
}

.hero-actions {
  margin-top: 28px;
}

.primary-btn,
.ghost-btn,
.section-more,
.category-tile > a,
.overview-head a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  font-weight: 600;
  transition: color 0.2s ease, background 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.primary-btn {
  color: #111827;
  background: #ffffff;
  padding: 12px 22px;
}

.ghost-btn {
  border: 1px solid rgba(255, 255, 255, 0.22);
  color: #ffffff;
  background: rgba(255, 255, 255, 0.1);
  backdrop-filter: blur(12px);
  padding: 12px 22px;
}

.ghost-btn:hover {
  background: rgba(255, 255, 255, 0.2);
}

.hero-controls {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: 24px;
  transform: translateX(-50%);
  display: flex;
  align-items: center;
  gap: 14px;
}

.hero-prev,
.hero-next,
.hero-dot {
  border: 0;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  backdrop-filter: blur(10px);
}

.hero-prev,
.hero-next {
  width: 38px;
  height: 38px;
  border-radius: 50%;
  font-size: 26px;
  line-height: 1;
}

.hero-dots {
  display: flex;
  gap: 8px;
}

.hero-dot {
  width: 9px;
  height: 9px;
  border-radius: 999px;
  padding: 0;
  opacity: 0.55;
  transition: width 0.2s ease, opacity 0.2s ease;
}

.hero-dot.active {
  width: 28px;
  opacity: 1;
}

.content-section {
  padding: 64px 0;
}

.soft-section {
  background: linear-gradient(180deg, #f9fafb 0%, #ffffff 100%);
}

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

.section-heading h2 {
  margin: 0;
  color: #111827;
  font-size: 28px;
  font-weight: 720;
}

.section-heading p {
  margin: 8px 0 0;
  color: #6b7280;
  line-height: 1.7;
}

.section-more {
  gap: 6px;
  color: #4b5563;
  font-size: 14px;
}

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

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

.rail {
  display: grid;
  grid-auto-flow: column;
  grid-auto-columns: minmax(280px, 1fr);
  gap: 24px;
  overflow-x: auto;
  padding: 6px 0 18px;
  scroll-snap-type: x proximity;
}

.rail .movie-card {
  scroll-snap-align: start;
}

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

.card-link {
  display: block;
  height: 100%;
  overflow: hidden;
  border: 1px solid #f3f4f6;
  border-radius: 18px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
  transition: transform 0.24s ease, box-shadow 0.24s ease, border-color 0.24s ease;
}

.card-link:hover {
  transform: translateY(-4px);
  border-color: #e5e7eb;
  box-shadow: 0 22px 44px rgba(15, 23, 42, 0.12);
}

.poster-frame {
  position: relative;
  display: block;
  aspect-ratio: 16 / 9;
  overflow: hidden;
  background: linear-gradient(135deg, #e5e7eb, #f9fafb);
}

.movie-card.large .poster-frame {
  aspect-ratio: 16 / 11;
}

.poster-frame img,
.compact-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.45s ease, opacity 0.2s ease;
}

.card-link:hover img,
.compact-card:hover img {
  transform: scale(1.055);
}

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

.poster-label {
  right: 12px;
}

.rank-badge {
  left: 12px;
  background: rgba(17, 24, 39, 0.82);
}

.card-body {
  display: flex;
  flex-direction: column;
  gap: 8px;
  padding: 16px;
}

.card-body strong {
  color: #1f2937;
  font-size: 17px;
  font-weight: 650;
  line-height: 1.35;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-body em,
.compact-info em {
  color: #6b7280;
  font-size: 13px;
  font-style: normal;
  line-height: 1.45;
}

.card-desc {
  min-height: 42px;
  color: #4b5563;
  font-size: 14px;
  line-height: 1.55;
  display: -webkit-box;
  overflow: hidden;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

.card-meta {
  color: #9ca3af;
  font-size: 12px;
}

.card-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}

.card-tags span,
.detail-tags span {
  border-radius: 999px;
  color: #4b5563;
  background: #f3f4f6;
  padding: 5px 9px;
  font-size: 12px;
}

.movie-card.list .card-link,
.sortable-grid.list-view .movie-card .card-link {
  display: grid;
  grid-template-columns: 240px minmax(0, 1fr);
}

.movie-card.list .poster-frame,
.sortable-grid.list-view .poster-frame {
  aspect-ratio: 4 / 3;
  height: 100%;
}

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

.category-tile,
.category-overview-card,
.detail-card,
.detail-side,
.toolbar {
  border: 1px solid #e5e7eb;
  border-radius: 20px;
  background: #ffffff;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}

.category-tile {
  padding: 18px;
  transition: transform 0.24s ease, box-shadow 0.24s ease;
}

.category-tile:hover {
  transform: translateY(-3px);
  box-shadow: 0 18px 32px rgba(15, 23, 42, 0.1);
}

.category-tile > a {
  display: grid;
  justify-content: stretch;
  text-align: left;
}

.category-tile span,
.overview-head h2 {
  color: #111827;
  font-size: 20px;
  font-weight: 700;
}

.category-tile strong {
  margin-top: 6px;
  color: #6b7280;
  font-size: 14px;
}

.category-tile em {
  margin-top: 12px;
  color: #4b5563;
  font-size: 14px;
  font-style: normal;
  line-height: 1.6;
}

.category-tile div {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
}

.category-tile div a {
  border-radius: 999px;
  background: #f3f4f6;
  color: #4b5563;
  padding: 5px 9px;
  font-size: 12px;
}

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

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

.compact-card a {
  min-height: 86px;
  display: grid;
  grid-template-columns: auto 86px minmax(0, 1fr);
  align-items: center;
  gap: 12px;
  border: 1px solid #f3f4f6;
  border-radius: 14px;
  background: #ffffff;
  padding: 10px;
  transition: background 0.2s ease, box-shadow 0.2s ease, transform 0.2s ease;
}

.compact-card a:hover {
  background: #f9fafb;
  box-shadow: 0 10px 24px rgba(15, 23, 42, 0.08);
  transform: translateY(-2px);
}

.compact-rank {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: #111827;
  font-size: 13px;
  font-weight: 700;
}

.compact-thumb {
  width: 86px;
  height: 58px;
  overflow: hidden;
  border-radius: 9px;
  background: #f3f4f6;
}

.compact-info {
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 5px;
}

.compact-info strong {
  overflow: hidden;
  color: #1f2937;
  font-weight: 640;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.page-hero {
  color: #ffffff;
  background: linear-gradient(90deg, #111827, #1f2937);
  padding: 52px 0;
}

.page-hero h1 {
  margin: 12px 0 12px;
  font-size: clamp(30px, 4vw, 46px);
  line-height: 1.1;
}

.page-hero p {
  max-width: 760px;
  color: rgba(255, 255, 255, 0.76);
  line-height: 1.8;
}

.page-hero-meta span {
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.1);
  padding: 7px 12px;
  font-size: 13px;
}

.breadcrumb {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  color: rgba(255, 255, 255, 0.68);
  font-size: 14px;
}

.detail-page .breadcrumb {
  margin: 24px 0;
  color: #6b7280;
}

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

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 18px;
  background: #000000;
  box-shadow: 0 24px 50px rgba(15, 23, 42, 0.18);
}

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

.play-cover {
  position: absolute;
  inset: 0;
  z-index: 3;
  border: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 12px;
  color: #ffffff;
  background: linear-gradient(180deg, rgba(0, 0, 0, 0.1), rgba(0, 0, 0, 0.62));
}

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

.play-icon {
  width: 74px;
  height: 74px;
  border-radius: 50%;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  background: rgba(255, 255, 255, 0.22);
  backdrop-filter: blur(10px);
  font-size: 28px;
  box-shadow: 0 18px 40px rgba(0, 0, 0, 0.25);
}

.play-cover strong {
  font-size: 17px;
}

.player-message {
  position: absolute;
  left: 50%;
  bottom: 20px;
  z-index: 5;
  transform: translateX(-50%);
  border-radius: 999px;
  color: #ffffff;
  background: rgba(17, 24, 39, 0.8);
  padding: 9px 14px;
  font-size: 13px;
}

.detail-title {
  margin: 24px 0;
}

.detail-title h1 {
  margin: 0 0 12px;
  color: #111827;
  font-size: clamp(28px, 4vw, 40px);
  line-height: 1.16;
}

.detail-meta {
  color: #6b7280;
  font-size: 14px;
}

.detail-card {
  margin-bottom: 22px;
  padding: 24px;
}

.detail-card h2,
.detail-side h2 {
  margin: 0 0 16px;
  color: #111827;
  font-size: 20px;
}

.detail-card p {
  color: #374151;
  line-height: 1.9;
  text-align: justify;
}

.movie-facts {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 12px;
  margin: 0 0 18px;
}

.movie-facts div {
  border-radius: 14px;
  background: #f9fafb;
  padding: 12px;
}

.movie-facts dt {
  color: #9ca3af;
  font-size: 12px;
}

.movie-facts dd {
  margin: 5px 0 0;
  color: #1f2937;
  font-weight: 650;
}

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

.review-card {
  background: linear-gradient(135deg, #ffffff, #f9fafb);
}

.detail-side {
  position: sticky;
  top: 88px;
  padding: 20px;
}

.side-list,
.overview-list {
  display: grid;
  gap: 12px;
}

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

.category-overview-card {
  padding: 20px;
}

.overview-head {
  margin-bottom: 16px;
  display: flex;
  justify-content: space-between;
  gap: 18px;
}

.overview-head h2 {
  margin: 0 0 8px;
}

.overview-head p {
  margin: 0;
  color: #6b7280;
  line-height: 1.65;
}

.overview-head a {
  flex-shrink: 0;
  color: #ffffff;
  background: #111827;
  padding: 9px 14px;
  font-size: 14px;
}

.toolbar {
  margin-bottom: 24px;
  padding: 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}

.toolbar label {
  color: #4b5563;
  display: flex;
  align-items: center;
  gap: 10px;
}

.sort-select {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  background: #ffffff;
  padding: 9px 12px;
  outline: 0;
}

.view-actions {
  display: flex;
  gap: 8px;
}

.view-toggle {
  border: 1px solid #d1d5db;
  border-radius: 12px;
  color: #4b5563;
  background: #ffffff;
  padding: 9px 14px;
}

.view-toggle.active {
  border-color: #111827;
  color: #ffffff;
  background: #111827;
}

.search-hero .container {
  max-width: 860px;
}

.search-page-form {
  margin-top: 22px;
  display: flex;
  gap: 10px;
}

.search-summary {
  margin-bottom: 16px;
  color: #111827;
  font-size: 20px;
  font-weight: 700;
}

.tag-cloud {
  margin-bottom: 28px;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
}

.tag-cloud button {
  border: 1px solid #e5e7eb;
  border-radius: 999px;
  color: #4b5563;
  background: linear-gradient(180deg, #ffffff, #f9fafb);
  padding: 8px 12px;
}

.tag-cloud button:hover {
  color: #111827;
  background: #f3f4f6;
}

.site-footer {
  margin-top: 48px;
  border-top: 1px solid #e5e7eb;
  background: linear-gradient(180deg, #f9fafb, #f3f4f6);
}

.footer-inner {
  width: min(1180px, calc(100% - 32px));
  margin: 0 auto;
  padding: 44px 0;
  display: grid;
  grid-template-columns: 2fr 1fr 1fr;
  gap: 36px;
}

.footer-brand p {
  max-width: 520px;
  color: #6b7280;
  line-height: 1.75;
}

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

.footer-links {
  display: grid;
  gap: 10px;
  color: #6b7280;
  font-size: 14px;
}

.footer-bottom {
  border-top: 1px solid #e5e7eb;
  color: #6b7280;
  text-align: center;
  padding: 18px;
  font-size: 14px;
}

.image-hidden {
  opacity: 0;
}

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

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

@media (max-width: 820px) {
  .header-inner {
    gap: 12px;
  }

  .desktop-nav,
  .header-inner > .site-search {
    display: none;
  }

  .mobile-toggle {
    display: inline-flex;
    margin-left: auto;
  }

  .mobile-search {
    display: flex;
    max-width: none;
  }

  .hero {
    height: 560px;
  }

  .hero-shade {
    background: linear-gradient(180deg, rgba(17, 24, 39, 0.86), rgba(17, 24, 39, 0.72));
  }

  .hero-content {
    justify-content: flex-end;
    padding-bottom: 86px;
  }

  .hero-actions {
    align-items: stretch;
    flex-direction: column;
    width: 100%;
  }

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

  .section-heading,
  .toolbar,
  .overview-head {
    align-items: flex-start;
    flex-direction: column;
  }

  .movie-grid,
  .movie-grid.two-column,
  .category-grid,
  .ranking-grid,
  .ranking-grid.wide,
  .overview-grid,
  .footer-inner,
  .detail-layout {
    grid-template-columns: 1fr;
  }

  .movie-card.list .card-link,
  .sortable-grid.list-view .movie-card .card-link {
    grid-template-columns: 132px minmax(0, 1fr);
  }

  .detail-side {
    position: static;
  }
}

@media (max-width: 540px) {
  .brand-text strong {
    font-size: 17px;
  }

  .brand-text small {
    font-size: 11px;
  }

  .hero h1 {
    font-size: 32px;
  }

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

  .content-section {
    padding: 44px 0;
  }

  .rail {
    grid-auto-columns: minmax(260px, 86vw);
  }

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

  .compact-card a {
    grid-template-columns: auto 72px minmax(0, 1fr);
  }

  .compact-thumb {
    width: 72px;
    height: 52px;
  }

  .search-page-form {
    flex-direction: column;
  }
}
