:root {
  --mist-50: #f8fafc;
  --mist-100: #f1f5f9;
  --mist-200: #e2e8f0;
  --mist-300: #cbd5e1;
  --mist-500: #64748b;
  --mist-600: #475569;
  --mist-700: #334155;
  --mist-800: #1e293b;
  --mist-900: #0f172a;
  --mineral-50: #f0f9ff;
  --mineral-200: #bae6fd;
  --mineral-300: #7dd3fc;
  --mineral-500: #0ea5e9;
  --mineral-600: #0284c7;
  --mineral-700: #0369a1;
  --moss-50: #f0fdf4;
  --moss-600: #16a34a;
  --shadow-md: 0 10px 28px rgba(15, 23, 42, 0.10);
  --shadow-xl: 0 26px 60px rgba(15, 23, 42, 0.22);
}

* {
  box-sizing: border-box;
}

html {
  scroll-behavior: smooth;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--mist-50);
  color: var(--mist-900);
  font-family: Inter, "PingFang SC", "Microsoft YaHei", system-ui, -apple-system, BlinkMacSystemFont, 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: 100;
  background: linear-gradient(90deg, var(--mist-800), var(--mist-700));
  color: white;
  box-shadow: var(--shadow-md);
}

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

.logo {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  white-space: nowrap;
}

.logo-mark {
  width: 34px;
  height: 34px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 999px;
  background: rgba(125, 211, 252, 0.18);
  color: var(--mineral-300);
  box-shadow: inset 0 0 0 1px rgba(125, 211, 252, 0.35);
}

.desktop-nav {
  display: flex;
  align-items: center;
  gap: 8px;
  flex: 1;
  min-width: 0;
}

.desktop-nav a {
  padding: 9px 10px;
  border-radius: 8px;
  color: var(--mist-100);
  font-size: 14px;
  transition: background 0.2s ease, color 0.2s ease;
}

.desktop-nav a:hover {
  background: rgba(255, 255, 255, 0.12);
  color: white;
}

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

.header-search input,
.mobile-search input,
.wide-search input,
.library-filter input {
  width: 220px;
  border: 1px solid rgba(255, 255, 255, 0.24);
  border-radius: 999px;
  padding: 10px 14px;
  background: rgba(255, 255, 255, 0.12);
  color: white;
  outline: none;
}

.header-search input::placeholder,
.mobile-search input::placeholder,
.wide-search input::placeholder {
  color: rgba(255, 255, 255, 0.7);
}

.header-search button,
.mobile-search button,
.wide-search button {
  border: 0;
  border-radius: 999px;
  padding: 10px 16px;
  background: var(--mineral-600);
  color: white;
  cursor: pointer;
  transition: background 0.2s ease;
}

.header-search button:hover,
.mobile-search button:hover,
.wide-search button:hover,
.primary-button:hover {
  background: var(--mineral-700);
}

.menu-toggle {
  display: none;
  flex-direction: column;
  gap: 5px;
  width: 42px;
  height: 42px;
  align-items: center;
  justify-content: center;
  border: 0;
  border-radius: 10px;
  background: rgba(255, 255, 255, 0.1);
  cursor: pointer;
}

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

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

.mobile-panel.open {
  display: block;
}

.mobile-panel nav {
  display: grid;
  gap: 6px;
  margin-top: 12px;
}

.mobile-panel a {
  padding: 10px 12px;
  border-radius: 8px;
  color: var(--mist-100);
  background: rgba(255, 255, 255, 0.06);
}

.hero {
  position: relative;
  height: 600px;
  overflow: hidden;
  background: var(--mist-900);
}

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

.hero-slide {
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.6s ease, visibility 0.6s ease;
}

.hero-slide.active {
  opacity: 1;
  visibility: visible;
}

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

.hero-overlay,
.detail-mask {
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(0, 0, 0, 0.84), rgba(0, 0, 0, 0.52), rgba(0, 0, 0, 0.08));
}

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

.hero-content h1 {
  max-width: 720px;
  margin: 14px 0 18px;
  font-size: clamp(34px, 6vw, 66px);
  line-height: 1.05;
  font-weight: 900;
  letter-spacing: -0.04em;
}

.hero-content p {
  max-width: 680px;
  margin: 0 0 28px;
  color: var(--mist-100);
  font-size: 18px;
  line-height: 1.8;
}

.hero-tag {
  display: inline-flex;
  width: fit-content;
  padding: 7px 12px;
  border-radius: 999px;
  background: rgba(2, 132, 199, 0.82);
  color: white;
  font-size: 14px;
}

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

.primary-button,
.ghost-button,
.section-more,
.category-overview-head a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-weight: 700;
  transition: transform 0.2s ease, background 0.2s ease, color 0.2s ease;
}

.primary-button {
  padding: 13px 22px;
  background: var(--mineral-600);
  color: white;
  box-shadow: 0 14px 32px rgba(2, 132, 199, 0.32);
}

.ghost-button {
  padding: 13px 22px;
  color: white;
  background: rgba(255, 255, 255, 0.16);
  backdrop-filter: blur(12px);
}

.primary-button:hover,
.ghost-button:hover,
.category-tile:hover,
.movie-card:hover {
  transform: translateY(-4px);
}

.hero-arrow {
  position: absolute;
  top: 50%;
  z-index: 4;
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 999px;
  background: rgba(0, 0, 0, 0.5);
  color: white;
  font-size: 38px;
  line-height: 1;
  cursor: pointer;
  transform: translateY(-50%);
}

.hero-arrow.prev {
  left: 22px;
}

.hero-arrow.next {
  right: 22px;
}

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

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

.hero-dots button.active {
  width: 34px;
  background: white;
}

.search-panel {
  width: min(1180px, calc(100% - 32px));
  margin: -54px auto 0;
  position: relative;
  z-index: 5;
  display: grid;
  grid-template-columns: 1.2fr 1fr;
  gap: 24px;
  align-items: center;
  padding: 28px;
  border-radius: 24px;
  background: rgba(15, 23, 42, 0.92);
  color: white;
  box-shadow: var(--shadow-xl);
}

.search-panel h2 {
  margin: 0 0 8px;
  font-size: 22px;
}

.search-panel p {
  margin: 0;
  color: var(--mist-300);
  line-height: 1.7;
}

.wide-search input {
  flex: 1;
  width: auto;
}

.page-section {
  padding: 64px max(16px, calc((100% - 1280px) / 2));
}

.light-section {
  background: var(--mist-50);
}

.white-section {
  background: white;
}

.gradient-section {
  background: linear-gradient(135deg, var(--mineral-50), var(--moss-50));
}

.section-heading,
.ranking-head,
.category-overview-head {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  gap: 24px;
  margin-bottom: 28px;
}

.section-heading h2,
.ranking-head h2,
.category-overview-head h2 {
  margin: 0 0 8px;
  color: var(--mist-900);
  font-size: clamp(26px, 3vw, 36px);
  letter-spacing: -0.03em;
}

.section-heading p,
.category-overview-head p {
  margin: 0;
  color: var(--mist-600);
}

.section-more,
.category-overview-head a {
  padding: 10px 15px;
  color: var(--mineral-700);
  background: var(--mineral-50);
}

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

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

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

.movie-card {
  background: white;
  border-radius: 18px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.movie-card:hover {
  box-shadow: var(--shadow-xl);
}

.movie-card-link {
  display: block;
  height: 100%;
}

.poster-wrap {
  position: relative;
  height: 250px;
  overflow: hidden;
  background: var(--mist-800);
}

.movie-card.small .poster-wrap {
  height: 180px;
}

.movie-card.large .poster-wrap {
  height: 320px;
}

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

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

.poster-shade {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(0deg, rgba(0, 0, 0, 0.72), rgba(0, 0, 0, 0.08));
  opacity: 0;
  transition: opacity 0.25s ease;
}

.movie-card:hover .poster-shade {
  opacity: 1;
}

.play-icon {
  width: 56px;
  height: 56px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 4px;
  border-radius: 999px;
  background: rgba(14, 165, 233, 0.92);
  color: white;
  font-size: 22px;
}

.badge {
  position: absolute;
  top: 12px;
  padding: 6px 9px;
  border-radius: 8px;
  color: white;
  font-size: 12px;
  background: rgba(0, 0, 0, 0.68);
}

.badge.region {
  left: 12px;
  background: rgba(2, 132, 199, 0.9);
}

.badge.year {
  right: 12px;
}

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

.movie-card-body h2 {
  min-height: 46px;
  margin: 0 0 9px;
  font-size: 17px;
  line-height: 1.35;
  color: var(--mist-900);
  transition: color 0.2s ease;
}

.movie-card:hover h2 {
  color: var(--mineral-600);
}

.movie-card-body p {
  display: -webkit-box;
  min-height: 44px;
  margin: 0 0 12px;
  overflow: hidden;
  color: var(--mist-600);
  font-size: 14px;
  line-height: 1.58;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.movie-meta-line {
  color: var(--mist-500);
  font-size: 12px;
}

.scroll-row {
  display: flex;
  gap: 24px;
  overflow-x: auto;
  padding: 4px 4px 24px;
  scrollbar-width: none;
}

.scroll-row::-webkit-scrollbar {
  display: none;
}

.scroll-item {
  width: 310px;
  flex: 0 0 auto;
}

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

.category-tile {
  display: flex;
  min-height: 170px;
  flex-direction: column;
  justify-content: space-between;
  padding: 24px;
  border-radius: 22px;
  background: rgba(255, 255, 255, 0.82);
  box-shadow: var(--shadow-md);
  transition: transform 0.25s ease, box-shadow 0.25s ease;
}

.category-tile:hover {
  box-shadow: var(--shadow-xl);
}

.category-tile span {
  color: var(--mineral-700);
  font-size: 14px;
  font-weight: 800;
}

.category-tile strong {
  color: var(--mist-900);
  font-size: 19px;
  line-height: 1.45;
}

.category-tile em {
  color: var(--mist-500);
  font-size: 13px;
  font-style: normal;
  line-height: 1.6;
}

.split-section {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 360px;
  gap: 32px;
  align-items: start;
}

.ranking-box {
  padding: 24px;
  border-radius: 22px;
  background: white;
  box-shadow: var(--shadow-md);
}

.sticky-box {
  position: sticky;
  top: 92px;
}

.compact-card {
  display: grid;
  grid-template-columns: auto 78px minmax(0, 1fr);
  gap: 14px;
  align-items: center;
  padding: 12px 0;
  border-bottom: 1px solid var(--mist-200);
}

.compact-card:last-child {
  border-bottom: 0;
}

.compact-card img {
  width: 78px;
  height: 58px;
  border-radius: 10px;
  object-fit: cover;
}

.rank-num {
  color: var(--mineral-600);
  font-size: 20px;
  font-weight: 900;
}

.compact-card strong,
.compact-card em {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.compact-card strong {
  color: var(--mist-900);
  font-size: 14px;
}

.compact-card em {
  margin-top: 5px;
  color: var(--mist-500);
  font-size: 12px;
  font-style: normal;
}

.sub-hero,
.ranking-hero {
  position: relative;
  padding: 82px max(16px, calc((100% - 1280px) / 2));
  overflow: hidden;
  background: radial-gradient(circle at top right, rgba(14, 165, 233, 0.28), transparent 34%), linear-gradient(135deg, var(--mist-900), var(--mist-700));
  color: white;
}

.sub-hero span {
  display: inline-flex;
  margin-bottom: 14px;
  color: var(--mineral-300);
  font-weight: 800;
}

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

.sub-hero p {
  max-width: 820px;
  margin: 0;
  color: var(--mist-200);
  line-height: 1.8;
}

.library-filter {
  display: grid;
  gap: 14px;
  margin-top: 28px;
}

.library-filter input {
  width: min(620px, 100%);
  border-color: rgba(255, 255, 255, 0.2);
}

.year-pills,
.category-pills {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
}

.year-pills button,
.category-pills a {
  border: 0;
  border-radius: 999px;
  padding: 9px 13px;
  background: rgba(255, 255, 255, 0.13);
  color: white;
  cursor: pointer;
}

.category-pills {
  margin-top: 18px;
}

.empty-state {
  display: none;
  margin-top: 28px;
  padding: 28px;
  border-radius: 18px;
  background: white;
  color: var(--mist-600);
  text-align: center;
  box-shadow: var(--shadow-md);
}

.empty-state.show {
  display: block;
}

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

.category-overview-card {
  padding: 24px;
  border-radius: 24px;
  background: white;
  box-shadow: var(--shadow-md);
}

.overview-preview {
  display: grid;
  gap: 4px;
}

.ranking-hero {
  min-height: 460px;
  display: flex;
  align-items: center;
}

.ranking-hero img,
.detail-bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.34;
}

.ranking-hero::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(90deg, rgba(15, 23, 42, 0.94), rgba(15, 23, 42, 0.46));
}

.ranking-hero-content {
  position: relative;
  z-index: 2;
  max-width: 760px;
}

.ranking-hero-content span {
  color: var(--mineral-300);
  font-weight: 800;
}

.ranking-hero-content h1 {
  margin: 16px 0;
  font-size: clamp(36px, 6vw, 70px);
  line-height: 1;
}

.ranking-hero-content p {
  margin: 0 0 28px;
  color: var(--mist-100);
  font-size: 18px;
  line-height: 1.8;
}

.detail-hero {
  position: relative;
  min-height: 620px;
  overflow: hidden;
  color: white;
  background: var(--mist-900);
}

.detail-inner {
  position: relative;
  z-index: 2;
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 34px 0 72px;
}

.breadcrumb {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
  margin-bottom: 36px;
  color: var(--mist-200);
  font-size: 14px;
}

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

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

.detail-poster {
  border-radius: 24px;
  overflow: hidden;
  box-shadow: var(--shadow-xl);
}

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

.detail-info h1 {
  margin: 18px 0;
  font-size: clamp(38px, 6vw, 72px);
  line-height: 1.04;
  letter-spacing: -0.05em;
}

.detail-one-line {
  max-width: 780px;
  color: var(--mist-100);
  font-size: 18px;
  line-height: 1.8;
}

.tag-row {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin: 24px 0 30px;
}

.tag-row span {
  padding: 8px 12px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.14);
  color: white;
  font-size: 13px;
}

.player-section {
  padding: 56px max(16px, calc((100% - 1180px) / 2));
  background: var(--mist-900);
}

.player-shell {
  position: relative;
  overflow: hidden;
  border-radius: 24px;
  background: black;
  box-shadow: var(--shadow-xl);
  aspect-ratio: 16 / 9;
}

.video-player {
  display: block;
  width: 100%;
  height: 100%;
  background: black;
}

.player-start {
  position: absolute;
  inset: 0;
  z-index: 3;
  display: flex;
  flex-direction: column;
  gap: 14px;
  align-items: center;
  justify-content: center;
  border: 0;
  background: radial-gradient(circle, rgba(2, 132, 199, 0.24), rgba(0, 0, 0, 0.56));
  color: white;
  cursor: pointer;
}

.player-start span {
  width: 82px;
  height: 82px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding-left: 6px;
  border-radius: 999px;
  background: var(--mineral-600);
  font-size: 32px;
  box-shadow: 0 18px 42px rgba(2, 132, 199, 0.36);
}

.player-start.hidden {
  display: none;
}

.detail-text-section {
  padding-top: 56px;
  padding-bottom: 56px;
}

.detail-article {
  max-width: 980px;
  margin: 0 auto;
  padding: 34px;
  border-radius: 24px;
  background: white;
  box-shadow: var(--shadow-md);
}

.detail-article h2 {
  margin: 0 0 14px;
  color: var(--mist-900);
  font-size: 26px;
}

.detail-article p {
  margin: 0 0 28px;
  color: var(--mist-700);
  line-height: 1.95;
}

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

.info-list div {
  padding: 14px;
  border-radius: 14px;
  background: var(--mist-50);
}

.info-list dt {
  margin-bottom: 6px;
  color: var(--mist-500);
  font-size: 13px;
}

.info-list dd {
  margin: 0;
  color: var(--mist-900);
  font-weight: 700;
}

.site-footer {
  background: linear-gradient(180deg, var(--mist-800), var(--mist-900));
  color: var(--mist-100);
}

.footer-inner {
  width: min(1280px, calc(100% - 32px));
  margin: 0 auto;
  padding: 52px 0;
  display: grid;
  grid-template-columns: 1.4fr 1fr 1fr;
  gap: 42px;
}

.footer-brand p {
  max-width: 460px;
  color: var(--mist-300);
  line-height: 1.8;
}

.footer-links h2 {
  margin: 0 0 16px;
  font-size: 17px;
}

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

.footer-links a {
  color: var(--mist-300);
}

.footer-links a:hover {
  color: var(--mineral-300);
}

.footer-bottom {
  border-top: 1px solid rgba(255, 255, 255, 0.1);
  padding: 18px 16px;
  color: var(--mist-300);
  text-align: center;
  font-size: 13px;
}

[data-search-card].hidden {
  display: none;
}

@media (max-width: 1180px) {
  .desktop-nav,
  .header-search {
    display: none;
  }

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

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

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

  .split-section {
    grid-template-columns: 1fr;
  }

  .sticky-box {
    position: static;
  }
}

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

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

  .hero-arrow {
    display: none;
  }

  .search-panel {
    grid-template-columns: 1fr;
    margin-top: 0;
    border-radius: 0;
    width: 100%;
  }

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

  .mobile-search input,
  .wide-search input {
    width: 100%;
  }

  .page-section {
    padding-top: 42px;
    padding-bottom: 42px;
  }

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

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

  .poster-wrap {
    height: 280px;
  }

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

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

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

  .player-section {
    padding-left: 0;
    padding-right: 0;
  }

  .player-shell {
    border-radius: 0;
  }
}
