:root {
  --bg: #f9fafb;
  --surface: #ffffff;
  --surface-soft: #f3f4f6;
  --text: #111827;
  --muted: #6b7280;
  --line: #e5e7eb;
  --blue: #2563eb;
  --blue-dark: #1d4ed8;
  --blue-soft: #dbeafe;
  --orange: #ea580c;
  --green: #16a34a;
  --red: #dc2626;
  --shadow: 0 10px 30px rgba(15, 23, 42, 0.08);
  --shadow-strong: 0 25px 50px rgba(15, 23, 42, 0.25);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
  -webkit-text-size-adjust: 100%;
}

body {
  margin: 0;
  color: var(--text);
  background: linear-gradient(180deg, #f9fafb 0%, #ffffff 45%, #f9fafb 100%);
  font-family: ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
  line-height: 1.6;
}

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

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

button,
input {
  font: inherit;
}

.site-header {
  position: sticky;
  top: 0;
  z-index: 50;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid rgba(229, 231, 235, 0.9);
  box-shadow: 0 4px 20px rgba(15, 23, 42, 0.04);
  backdrop-filter: blur(12px);
}

.header-inner {
  max-width: 1280px;
  height: 64px;
  margin: 0 auto;
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 24px;
}

.brand,
.footer-logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  color: #1f2937;
}

.brand-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  border-radius: 999px;
  box-shadow: 0 8px 18px rgba(37, 99, 235, 0.28);
}

.brand-text {
  font-size: 20px;
  letter-spacing: -0.02em;
}

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

.nav-link,
.mobile-link {
  color: #374151;
  font-weight: 600;
  transition: color 0.2s ease;
}

.nav-link:hover,
.nav-link.active,
.mobile-link:hover,
.mobile-link.active {
  color: var(--blue);
}

.header-search {
  display: flex;
  align-items: center;
  gap: 8px;
  width: 280px;
}

.header-search input,
.mobile-search input,
.filter-input,
.search-panel input {
  width: 100%;
  min-width: 0;
  border: 1px solid var(--line);
  border-radius: 999px;
  padding: 10px 14px;
  outline: none;
  color: var(--text);
  background: #ffffff;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.header-search input:focus,
.mobile-search input:focus,
.filter-input:focus,
.search-panel input:focus {
  border-color: rgba(37, 99, 235, 0.55);
  box-shadow: 0 0 0 4px rgba(37, 99, 235, 0.1);
}

.header-search button,
.mobile-search button,
.search-panel button,
.primary-button,
.secondary-button {
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: var(--blue);
  padding: 10px 18px;
  font-weight: 700;
  cursor: pointer;
  white-space: nowrap;
  transition: transform 0.2s ease, background 0.2s ease, box-shadow 0.2s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.search-panel button:hover,
.primary-button:hover {
  background: var(--blue-dark);
  transform: translateY(-1px);
  box-shadow: 0 10px 22px rgba(37, 99, 235, 0.24);
}

.secondary-button {
  color: #ffffff;
  background: rgba(255, 255, 255, 0.18);
  border: 1px solid rgba(255, 255, 255, 0.45);
  backdrop-filter: blur(10px);
}

.secondary-button:hover {
  background: rgba(255, 255, 255, 0.28);
}

.menu-button {
  display: none;
  border: 0;
  background: transparent;
  color: #374151;
  font-size: 26px;
  cursor: pointer;
}

.mobile-nav {
  border-top: 1px solid var(--line);
  padding: 16px 24px 22px;
  background: #ffffff;
}

.mobile-nav[hidden] {
  display: none;
}

.mobile-link {
  display: block;
  padding: 10px 0;
}

.mobile-search {
  display: flex;
  gap: 8px;
  margin-top: 10px;
}

.hero {
  position: relative;
  height: 70vh;
  min-height: 520px;
  overflow: hidden;
  background: #111827;
}

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

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

.hero-slide img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transform: scale(1.03);
}

.hero-overlay {
  position: absolute;
  inset: 0;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.88) 0%, rgba(0, 0, 0, 0.45) 46%, rgba(0, 0, 0, 0.16) 100%);
}

.hero-content {
  position: absolute;
  left: max(24px, calc((100vw - 1280px) / 2 + 24px));
  bottom: 74px;
  width: min(820px, calc(100vw - 48px));
  color: #ffffff;
}

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

.tag-pill {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 14px;
  color: #ffffff;
  background: rgba(255, 255, 255, 0.2);
  backdrop-filter: blur(10px);
  font-size: 14px;
}

.mini-tag {
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 4px 9px;
  color: var(--blue);
  background: var(--blue-soft);
  font-size: 12px;
  font-weight: 700;
}

.hero h1,
.hero h2 {
  margin: 18px 0 16px;
  max-width: 760px;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.08;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.hero p {
  max-width: 720px;
  margin: 0 0 24px;
  color: #e5e7eb;
  font-size: clamp(17px, 2vw, 22px);
}

.hero-meta,
.movie-meta,
.detail-meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 12px;
  color: #4b5563;
  font-size: 14px;
}

.hero-meta {
  color: rgba(255, 255, 255, 0.9);
  margin-bottom: 26px;
}

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

.hero-control {
  position: absolute;
  top: 50%;
  width: 46px;
  height: 46px;
  border: 0;
  border-radius: 999px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.48);
  cursor: pointer;
  transform: translateY(-50%);
  transition: background 0.2s ease, transform 0.2s ease;
}

.hero-control:hover {
  background: rgba(0, 0, 0, 0.72);
  transform: translateY(-50%) scale(1.04);
}

.hero-control.prev {
  left: 24px;
}

.hero-control.next {
  right: 24px;
}

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

.hero-dot {
  width: 9px;
  height: 9px;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.5);
  cursor: pointer;
  transition: width 0.25s ease, background 0.25s ease;
}

.hero-dot.active {
  width: 32px;
  background: #ffffff;
}

.container {
  max-width: 1280px;
  margin: 0 auto;
  padding: 64px 24px;
}

.section {
  margin-bottom: 78px;
}

.section:last-child {
  margin-bottom: 0;
}

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

.section-title {
  margin: 0;
  font-size: clamp(26px, 3vw, 38px);
  line-height: 1.2;
  font-weight: 900;
  letter-spacing: -0.03em;
}

.section-title span {
  color: var(--blue);
}

.section-desc {
  margin: 10px 0 0;
  color: var(--muted);
  max-width: 760px;
}

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

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

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

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

.movie-card,
.category-card,
.rank-card,
.info-box {
  background: var(--surface);
  border: 1px solid rgba(229, 231, 235, 0.85);
  border-radius: 18px;
  overflow: hidden;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
  transition: transform 0.25s ease, box-shadow 0.25s ease, border-color 0.25s ease;
}

.movie-card:hover,
.category-card:hover,
.rank-card:hover {
  border-color: rgba(37, 99, 235, 0.28);
  box-shadow: var(--shadow);
  transform: translateY(-4px);
}

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

.movie-cover.wide-cover {
  width: 280px;
  min-width: 280px;
  aspect-ratio: 16 / 9;
}

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

.movie-card:hover .movie-cover img,
.rank-card:hover img {
  transform: scale(1.08);
}

.play-badge {
  position: absolute;
  right: 12px;
  bottom: 12px;
  display: inline-flex;
  align-items: center;
  border-radius: 999px;
  padding: 6px 12px;
  color: #ffffff;
  background: rgba(0, 0, 0, 0.68);
  font-size: 13px;
  font-weight: 700;
  backdrop-filter: blur(8px);
}

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

.movie-card h2,
.movie-card h3 {
  margin: 10px 0 8px;
  font-size: 18px;
  line-height: 1.35;
  font-weight: 800;
}

.movie-card p {
  margin: 0 0 14px;
  color: var(--muted);
  display: -webkit-box;
  overflow: hidden;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-card-horizontal {
  display: flex;
}

.movie-card-horizontal .movie-card-body {
  display: flex;
  flex-direction: column;
  justify-content: center;
  min-width: 0;
}

.category-card {
  display: flex;
  flex-direction: column;
  min-height: 220px;
  padding: 28px;
  background: linear-gradient(135deg, #ffffff, #f8fbff);
}

.category-card h2 {
  margin: 0 0 12px;
  font-size: 24px;
  font-weight: 900;
}

.category-card p {
  margin: 0 0 24px;
  color: var(--muted);
}

.category-card a {
  margin-top: auto;
  color: var(--blue);
  font-weight: 800;
}

.page-hero {
  background: linear-gradient(135deg, #eff6ff 0%, #faf5ff 100%);
  border-bottom: 1px solid rgba(191, 219, 254, 0.9);
}

.page-hero-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 62px 24px;
}

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

.breadcrumb a {
  color: var(--blue);
  font-weight: 700;
}

.page-hero h1 {
  margin: 0;
  max-width: 880px;
  font-size: clamp(34px, 5vw, 56px);
  line-height: 1.1;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.page-hero p {
  max-width: 820px;
  margin: 18px 0 0;
  color: #4b5563;
  font-size: 18px;
}

.filter-bar,
.search-panel {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 28px;
  padding: 18px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

.filter-status,
.search-status {
  color: var(--muted);
  white-space: nowrap;
  font-size: 14px;
}

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

.rank-card {
  display: grid;
  grid-template-columns: 70px 138px 1fr auto;
  align-items: center;
  gap: 18px;
  padding: 14px;
}

.rank-number {
  width: 50px;
  height: 50px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 16px;
  color: #ffffff;
  background: linear-gradient(135deg, #2563eb, #7c3aed);
  font-weight: 900;
  font-size: 20px;
}

.rank-card img {
  width: 138px;
  height: 82px;
  object-fit: cover;
  border-radius: 14px;
  transition: transform 0.5s ease;
}

.rank-card h2 {
  margin: 0 0 8px;
  font-size: 20px;
  font-weight: 900;
}

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

.rank-action {
  color: var(--blue);
  font-weight: 800;
  padding-right: 10px;
}

.detail-layout {
  display: grid;
  grid-template-columns: minmax(0, 2fr) minmax(280px, 0.9fr);
  gap: 32px;
}

.player-card,
.detail-card,
.sidebar-card {
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 22px;
  box-shadow: var(--shadow);
  overflow: hidden;
}

.player-wrap {
  position: relative;
  background: #000000;
}

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

.player-poster-button {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 0;
  color: #ffffff;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.62), rgba(0, 0, 0, 0.18));
  cursor: pointer;
  z-index: 2;
}

.player-poster-button[hidden] {
  display: none;
}

.player-poster-button span {
  width: 84px;
  height: 84px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(37, 99, 235, 0.9);
  box-shadow: 0 20px 44px rgba(37, 99, 235, 0.35);
  font-size: 32px;
  transform: scale(1);
  transition: transform 0.2s ease, background 0.2s ease;
}

.player-poster-button:hover span {
  transform: scale(1.08);
  background: var(--blue-dark);
}

.player-message {
  min-height: 24px;
  padding: 12px 18px;
  color: #ef4444;
  background: #111827;
  font-size: 14px;
}

.player-message:empty {
  display: none;
}

.detail-card {
  padding: 28px;
}

.detail-card h2,
.sidebar-card h2 {
  margin: 0 0 16px;
  font-size: 24px;
  font-weight: 900;
}

.detail-card p {
  margin: 0 0 18px;
  color: #374151;
  white-space: pre-line;
}

.detail-cover {
  border-radius: 22px;
  overflow: hidden;
  box-shadow: var(--shadow);
}

.detail-cover img {
  width: 100%;
  aspect-ratio: 2 / 3;
  object-fit: cover;
}

.sidebar-card {
  padding: 20px;
  margin-top: 22px;
}

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

.side-item {
  display: grid;
  grid-template-columns: 84px 1fr;
  gap: 12px;
  align-items: center;
}

.side-item img {
  width: 84px;
  height: 56px;
  border-radius: 10px;
  object-fit: cover;
}

.side-item h3 {
  margin: 0 0 4px;
  font-size: 15px;
  line-height: 1.35;
}

.side-item p {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
}

.search-results {
  display: grid;
  gap: 16px;
}

.search-result-card {
  display: grid;
  grid-template-columns: 128px 1fr;
  gap: 18px;
  padding: 16px;
  background: #ffffff;
  border: 1px solid var(--line);
  border-radius: 18px;
  box-shadow: 0 4px 18px rgba(15, 23, 42, 0.05);
}

.search-result-card img {
  width: 128px;
  height: 82px;
  object-fit: cover;
  border-radius: 14px;
}

.search-result-card h2 {
  margin: 0 0 6px;
  font-size: 20px;
}

.search-result-card p {
  margin: 0 0 10px;
  color: var(--muted);
}

.site-footer {
  color: #d1d5db;
  background: #111827;
}

.footer-inner {
  max-width: 1280px;
  margin: 0 auto;
  padding: 46px 24px;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 34px;
}

.footer-brand p {
  margin: 16px 0 0;
  color: #9ca3af;
}

.footer-logo {
  color: #ffffff;
}

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

.footer-links div {
  display: grid;
  gap: 8px;
}

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

.footer-bottom {
  max-width: 1280px;
  margin: 0 auto;
  padding: 18px 24px 26px;
  color: #6b7280;
  border-top: 1px solid #1f2937;
  font-size: 14px;
}

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

  .header-search {
    display: none;
  }
}

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

  .menu-button {
    display: inline-flex;
    margin-left: auto;
  }

  .hero {
    min-height: 560px;
  }

  .hero-content {
    bottom: 88px;
  }

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

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

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

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

  .rank-action {
    display: none;
  }
}

@media (max-width: 640px) {
  .header-inner {
    padding: 0 16px;
  }

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

  .hero {
    height: 76vh;
    min-height: 560px;
  }

  .hero-content {
    left: 18px;
    width: calc(100vw - 36px);
  }

  .hero-control {
    display: none;
  }

  .container,
  .page-hero-inner {
    padding-left: 16px;
    padding-right: 16px;
  }

  .grid-3,
  .grid-4,
  .grid-5 {
    grid-template-columns: 1fr;
  }

  .movie-card-horizontal {
    flex-direction: column;
  }

  .movie-cover.wide-cover {
    width: 100%;
    min-width: 0;
  }

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

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

  .rank-card img {
    display: none;
  }

  .search-result-card {
    grid-template-columns: 1fr;
  }

  .search-result-card img {
    width: 100%;
    height: auto;
    aspect-ratio: 16 / 9;
  }
}
