:root {
  --bg: #0d1117;
  --bg-soft: #111827;
  --surface: #161b22;
  --surface-2: #1f2937;
  --line: rgba(255,255,255,.08);
  --text: #e5e7eb;
  --muted: #94a3b8;
  --primary: #0b6fff;
  --primary-2: #0059c0;
  --accent: #ff6b00;
  --good: #16a34a;
  --shadow: 0 20px 50px rgba(0,0,0,.35);
  --radius-xl: 28px;
  --radius-lg: 20px;
  --radius-md: 16px;
  --radius-sm: 12px;
  --container: 1240px;
  --hero-grad: linear-gradient(135deg, #0f172a 0%, #111827 42%, #0b6fff 120%);
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  font-family: Inter, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", Arial, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: radial-gradient(circle at top, rgba(11,111,255,.18), transparent 34%), linear-gradient(180deg, #0b1020 0%, #0d1117 22%, #0b1020 100%);
  color: var(--text);
  line-height: 1.6;
}

a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }
button, input, select, textarea { font: inherit; }

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

.site-header {
  position: sticky; top: 0; z-index: 1000;
  backdrop-filter: blur(16px);
  background: rgba(8, 12, 22, .72);
  border-bottom: 1px solid rgba(255,255,255,.06);
}
.header-inner {
  display: flex; align-items: center; justify-content: space-between; gap: 16px;
  min-height: 78px;
}
.brand {
  display: flex; align-items: center; gap: 14px; min-width: 0;
}
.brand-mark {
  width: 44px; height: 44px; border-radius: 14px;
  background: linear-gradient(135deg, var(--primary), var(--accent));
  box-shadow: 0 10px 26px rgba(11,111,255,.28);
  position: relative; flex: 0 0 auto;
}
.brand-mark:before, .brand-mark:after {
  content: ""; position: absolute; inset: 10px;
  border: 2px solid rgba(255,255,255,.92); border-radius: 10px; opacity: .9;
}
.brand-mark:after { inset: 16px 10px 10px 16px; border-radius: 8px; opacity: .6; }
.brand-text { min-width: 0; }
.brand-text strong { display: block; font-size: 1rem; line-height: 1.2; }
.brand-text span { display: block; color: var(--muted); font-size: .82rem; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

.nav {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap; justify-content: center;
}
.nav a {
  padding: 10px 14px; border-radius: 999px;
  color: rgba(255,255,255,.86);
  transition: .25s ease;
}
.nav a:hover, .nav a.active {
  background: rgba(11,111,255,.18);
  color: #fff;
}

.header-actions { display: flex; align-items: center; gap: 10px; }
.search-inline {
  display: flex; align-items: center; gap: 0;
  border: 1px solid rgba(255,255,255,.10);
  background: rgba(255,255,255,.04);
  border-radius: 999px;
  overflow: hidden;
}
.search-inline input {
  width: 280px; max-width: 40vw;
  padding: 12px 16px; border: 0; outline: 0; background: transparent; color: var(--text);
}
.search-inline input::placeholder { color: #98a2b3; }
.search-inline button, .btn, .chip, .menu-btn {
  border: 0; outline: 0; cursor: pointer;
}
.search-inline button {
  background: var(--primary); color: #fff; padding: 12px 16px; transition: .25s ease;
}
.search-inline button:hover { background: #0864e4; }

.menu-btn {
  display: none; width: 44px; height: 44px; border-radius: 12px;
  background: rgba(255,255,255,.06); color: #fff;
}

.hero {
  padding: 34px 0 10px;
}
.hero-panel {
  position: relative; overflow: hidden;
  background: linear-gradient(135deg, rgba(11,111,255,.18), rgba(255,107,0,.12) 58%, rgba(255,255,255,.05) 100%);
  border: 1px solid rgba(255,255,255,.08);
  border-radius: 34px;
  box-shadow: var(--shadow);
}
.hero-panel:before {
  content: ""; position: absolute; inset: 0;
  background: radial-gradient(circle at 20% 20%, rgba(255,255,255,.12), transparent 22%),
              radial-gradient(circle at 80% 10%, rgba(11,111,255,.22), transparent 25%),
              radial-gradient(circle at 75% 85%, rgba(255,107,0,.16), transparent 24%);
  pointer-events: none;
}
.hero-grid {
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 22px; align-items: stretch;
  padding: 34px;
}
.hero-copy { position: relative; z-index: 1; }
.hero-kicker {
  display: inline-flex; align-items: center; gap: 8px;
  padding: 8px 14px; border-radius: 999px;
  background: rgba(255,255,255,.10);
  color: #fff; font-weight: 700; font-size: .9rem;
}
.hero-copy h1 {
  margin: 18px 0 14px; font-size: clamp(2rem, 4vw, 4.25rem); line-height: 1.05;
}
.hero-copy p {
  margin: 0; color: rgba(255,255,255,.82); max-width: 760px; font-size: 1.05rem;
}
.hero-actions { display: flex; gap: 12px; flex-wrap: wrap; margin-top: 22px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 10px;
  padding: 12px 18px; border-radius: 999px; font-weight: 700;
  transition: transform .2s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn-primary { background: var(--primary); color: #fff; box-shadow: 0 12px 28px rgba(11,111,255,.24); }
.btn-primary:hover { background: #0864e4; }
.btn-ghost { background: rgba(255,255,255,.08); color: #fff; border: 1px solid rgba(255,255,255,.10); }
.btn-ghost:hover { background: rgba(255,255,255,.12); }
.hero-stats {
  display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; margin-top: 24px;
}
.stat-card, .feature-card, .section-card, .movie-card, .category-card, .panel, .detail-card {
  border: 1px solid rgba(255,255,255,.08);
  background: rgba(13,17,23,.70);
  backdrop-filter: blur(12px);
  border-radius: var(--radius-lg);
}
.stat-card {
  padding: 18px 16px; min-height: 104px;
}
.stat-card strong { display: block; font-size: 1.45rem; margin-bottom: 6px; }
.stat-card span { color: var(--muted); font-size: .92rem; }

.hero-side {
  position: relative; z-index: 1; display: flex; flex-direction: column; gap: 12px;
}
.hero-side .panel { padding: 18px; }
.panel-title { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.panel-title h2, .panel-title h3 { margin: 0; font-size: 1rem; }
.panel-title .more { color: #9fd1ff; font-size: .9rem; }
.feature-list { display: grid; gap: 10px; }
.feature-mini {
  display: grid; grid-template-columns: 86px 1fr; gap: 12px; align-items: center;
  padding: 10px; border-radius: 18px; background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.05);
}
.feature-mini .rank {
  width: 86px; height: 120px; border-radius: 14px; display: grid; place-items: center;
  background: linear-gradient(135deg, rgba(11,111,255,.35), rgba(255,107,0,.28));
  color: #fff; font-weight: 900; font-size: 1.1rem; text-align: center; padding: 8px;
}
.feature-mini strong { display: block; margin-bottom: 6px; }
.feature-mini p { margin: 0; color: var(--muted); font-size: .88rem; line-height: 1.45; }
.feature-mini .meta { margin-top: 8px; display: flex; gap: 8px; flex-wrap: wrap; }
.tag, .chip {
  display: inline-flex; align-items: center; justify-content: center;
  padding: 6px 10px; border-radius: 999px;
  background: rgba(255,255,255,.08); color: #dce6f7; font-size: .78rem;
}
.chip.active { background: var(--primary); color: #fff; }

.section { padding: 18px 0 18px; }
.section-header {
  display: flex; align-items: end; justify-content: space-between; gap: 20px; margin-bottom: 16px;
}
.section-header h2 { margin: 0; font-size: 1.55rem; }
.section-header p { margin: 6px 0 0; color: var(--muted); }
.section-header .actions { display: flex; gap: 10px; flex-wrap: wrap; }

.grid {
  display: grid; gap: 18px;
}
.grid.movies {
  grid-template-columns: repeat(5, minmax(0, 1fr));
}
.grid.categories { grid-template-columns: repeat(4, minmax(0, 1fr)); }
.grid.stats { grid-template-columns: repeat(4, minmax(0, 1fr)); }

.movie-card {
  overflow: hidden; transition: transform .22s ease, border-color .22s ease, box-shadow .22s ease;
  background: linear-gradient(180deg, rgba(255,255,255,.04), rgba(255,255,255,.02));
}
.movie-card:hover {
  transform: translateY(-4px);
  border-color: rgba(11,111,255,.32);
  box-shadow: 0 18px 40px rgba(0,0,0,.28);
}
.movie-poster {
  aspect-ratio: 2 / 3; background: #0b1020; position: relative; overflow: hidden;
}
.movie-poster img { width: 100%; height: 100%; object-fit: cover; }
.movie-body { padding: 14px 14px 16px; }
.movie-title {
  font-size: .98rem; font-weight: 800; line-height: 1.35; margin: 0 0 8px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  min-height: 2.7em;
}
.movie-meta {
  display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); font-size: .8rem; margin-bottom: 10px;
}
.movie-desc {
  color: #cbd5e1; font-size: .88rem; margin: 0 0 12px;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; min-height: 4.2em;
}
.movie-actions { display: flex; justify-content: space-between; align-items: center; gap: 10px; }
.movie-actions .btn { padding: 9px 12px; font-size: .88rem; }
.movie-actions .mini { color: #9fd1ff; font-size: .82rem; }

.category-card {
  padding: 18px; min-height: 168px; position: relative; overflow: hidden;
  background: linear-gradient(145deg, rgba(11,111,255,.16), rgba(255,107,0,.10));
}
.category-card h3 { margin: 0 0 8px; font-size: 1.15rem; }
.category-card p { margin: 0 0 14px; color: var(--muted); font-size: .92rem; }
.category-card .count { font-size: 2.2rem; font-weight: 900; line-height: 1; margin-bottom: 10px; }
.category-card:after {
  content: ""; position: absolute; right: -38px; bottom: -38px; width: 140px; height: 140px;
  background: radial-gradient(circle, rgba(255,255,255,.18), transparent 70%);
}

.feature-row {
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(240px, 1fr);
  gap: 14px; overflow-x: auto; padding-bottom: 8px; scroll-snap-type: x mandatory;
}
.feature-row::-webkit-scrollbar, .scrollbar-hidden::-webkit-scrollbar { height: 8px; }
.feature-row::-webkit-scrollbar-thumb, .scrollbar-hidden::-webkit-scrollbar-thumb { background: rgba(255,255,255,.14); border-radius: 999px; }
.feature-box {
  scroll-snap-align: start; padding: 18px; min-height: 190px;
  border-radius: var(--radius-lg); border: 1px solid rgba(255,255,255,.08);
  background: linear-gradient(135deg, rgba(11,111,255,.18), rgba(255,107,0,.12));
}
.feature-box h3 { margin: 0 0 8px; }
.feature-box p { margin: 0 0 14px; color: var(--muted); }

.breadcrumb { color: var(--muted); font-size: .9rem; margin: 18px 0 0; }
.breadcrumb a { color: #d6e6ff; }
.breadcrumb span { color: var(--muted); }

.page-hero {
  margin-top: 26px; padding: 26px; border-radius: 30px; overflow: hidden;
  background: linear-gradient(135deg, rgba(11,111,255,.18), rgba(255,107,0,.08));
  border: 1px solid rgba(255,255,255,.08); box-shadow: var(--shadow);
}
.page-hero h1 { margin: 0 0 10px; font-size: clamp(1.8rem, 3vw, 3rem); }
.page-hero p { margin: 0; color: rgba(255,255,255,.84); max-width: 860px; }
.page-tools {
  display: flex; gap: 10px; flex-wrap: wrap; margin-top: 16px;
}
.page-tools .search-inline { width: min(100%, 520px); }
.page-tools .search-inline input { width: 100%; max-width: none; }

.toolbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 22px 0 16px; flex-wrap: wrap;
}
.filter-bar { display: flex; gap: 8px; flex-wrap: wrap; }
.filter-bar button {
  padding: 10px 14px; border-radius: 999px; background: rgba(255,255,255,.06);
  color: #e8eef9; border: 1px solid rgba(255,255,255,.08); cursor: pointer; transition: .2s ease;
}
.filter-bar button.active, .filter-bar button:hover { background: var(--primary); border-color: var(--primary); }
.count-pill { color: var(--muted); font-size: .92rem; }

.catalog-grid { display: grid; grid-template-columns: repeat(6, minmax(0, 1fr)); gap: 16px; }
.catalog-grid .movie-card { background: rgba(255,255,255,.03); }

.detail-top {
  display: grid; grid-template-columns: 340px 1fr; gap: 24px; align-items: start;
}
.poster-shell {
  background: rgba(255,255,255,.04); border: 1px solid rgba(255,255,255,.08); border-radius: 30px; overflow: hidden;
  box-shadow: var(--shadow);
}
.poster-shell img { width: 100%; aspect-ratio: 2/3; object-fit: cover; }
.poster-shell .poster-meta { padding: 16px; }
.poster-shell .poster-meta h2 { margin: 0 0 10px; font-size: 1.3rem; }
.poster-shell .poster-meta .meta { display: flex; flex-wrap: wrap; gap: 8px; color: var(--muted); }

.detail-card { padding: 22px; }
.detail-card h1 { margin: 0 0 12px; font-size: clamp(1.7rem, 3vw, 2.7rem); line-height: 1.15; }
.detail-card .meta-row { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 14px; }
.detail-card .summary { color: #d8e0ec; margin: 0 0 16px; }
.detail-card .specs { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin-top: 18px; }
.spec { padding: 14px; border-radius: 18px; background: rgba(255,255,255,.04); }
.spec strong { display: block; margin-bottom: 6px; }
.spec span { color: var(--muted); font-size: .92rem; }

.player-wrap {
  margin-top: 22px;
  padding: 18px;
  border-radius: 30px;
  background: rgba(255,255,255,.04);
  border: 1px solid rgba(255,255,255,.08);
  box-shadow: var(--shadow);
}
.player-head { display: flex; justify-content: space-between; align-items: end; gap: 16px; margin-bottom: 14px; flex-wrap: wrap; }
.player-head h2 { margin: 0; }
.player-shell {
  position: relative; overflow: hidden; border-radius: 26px; background: #000;
}
.player-shell video { width: 100%; aspect-ratio: 16 / 9; background: #000; display: block; }
.player-shell .player-cover {
  position: absolute; inset: 0; display: grid; place-items: center; pointer-events: none;
  background: linear-gradient(135deg, rgba(11,111,255,.12), rgba(255,107,0,.08));
  color: #fff; font-weight: 700; text-align: center; padding: 20px;
}
.play-badge {
  width: 92px; height: 92px; border-radius: 50%;
  display: grid; place-items: center; background: rgba(255,255,255,.12);
  border: 1px solid rgba(255,255,255,.18); backdrop-filter: blur(10px);
  margin-bottom: 12px;
}
.play-badge:before {
  content: ""; width: 0; height: 0; border-left: 24px solid #fff; border-top: 16px solid transparent; border-bottom: 16px solid transparent; margin-left: 5px;
}

.rich-box {
  margin-top: 22px;
  display: grid; grid-template-columns: 1.2fr .8fr; gap: 18px;
}
.rich-box .detail-card { min-height: 100%; }

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

.footer {
  margin-top: 34px; padding: 28px 0 34px; color: var(--muted);
  border-top: 1px solid rgba(255,255,255,.08);
}
.footer-grid { display: grid; grid-template-columns: 1.3fr .7fr .7fr; gap: 22px; }
.footer h3 { color: #fff; margin: 0 0 12px; }
.footer a { color: #d5e6ff; }
.footer p { margin: 0; }
.footer small { display: block; margin-top: 16px; opacity: .9; }

.notice {
  padding: 16px 18px; border-radius: 18px; background: rgba(255,255,255,.05); color: var(--muted);
  border: 1px dashed rgba(255,255,255,.12);
}

.search-results { display: grid; gap: 16px; }
.search-filters { display: flex; gap: 10px; flex-wrap: wrap; margin-top: 14px; }
.search-filters select, .search-filters input {
  padding: 12px 14px; border-radius: 14px; border: 1px solid rgba(255,255,255,.12);
  background: rgba(255,255,255,.05); color: #fff; outline: 0;
}
.search-filters select option { color: #111; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip: rect(0,0,0,0); border: 0; }

@media (max-width: 1200px) {
  .grid.movies, .catalog-grid, .related-grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .detail-top { grid-template-columns: 300px 1fr; }
  .hero-grid { grid-template-columns: 1fr; }
}
@media (max-width: 900px) {
  .nav { display: none; width: 100%; padding: 12px 0 16px; }
  .nav.open { display: flex; }
  .menu-btn { display: inline-grid; place-items: center; }
  .header-inner { flex-wrap: wrap; }
  .header-actions { width: 100%; justify-content: space-between; }
  .search-inline { flex: 1; }
  .search-inline input { width: 100%; max-width: none; }
  .grid.movies, .grid.categories, .grid.stats, .catalog-grid, .related-grid { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-top, .rich-box, .footer-grid { grid-template-columns: 1fr; }
  .hero-grid { padding: 22px; }
  .hero-stats { grid-template-columns: 1fr; }
}
@media (max-width: 560px) {
  .container { width: min(var(--container), calc(100% - 22px)); }
  .hero-copy h1 { font-size: 2.15rem; }
  .hero-copy p { font-size: .98rem; }
  .grid.movies, .grid.categories, .grid.stats, .catalog-grid, .related-grid { grid-template-columns: 1fr; }
  .page-hero, .player-wrap, .detail-card, .category-card, .panel { border-radius: 22px; }
  .search-inline input { width: 100%; }
}
