:root {
  --ink: #0f2744;
  --ink-soft: #1e3a5f;
  --sky: #2563a8;
  --sky-soft: #e8f0fa;
  --bg: #f5f7fb;
  --bg-alt: #eef2f7;
  --surface: #ffffff;
  --muted: #64748b;
  --line: #e2e8f0;
  --max: 1120px;
  --radius: 10px;
  --font: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", sans-serif;
  --display: "Manrope", "Noto Sans SC", sans-serif;
}

*, *::before, *::after { box-sizing: border-box; }
html { scroll-behavior: smooth; }

body {
  margin: 0;
  font-family: var(--font);
  color: var(--ink);
  background: var(--bg);
  -webkit-font-smoothing: antialiased;
}

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

.wrap { width: min(100% - 1.75rem, var(--max)); margin-inline: auto; }

/* ===== Header ===== */
.top {
  position: sticky;
  top: 0;
  z-index: 60;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(12px);
  border-bottom: 1px solid var(--line);
}
.top__row {
  display: flex;
  align-items: center;
  gap: 1rem;
  min-height: 66px;
}
.brand {
  display: inline-flex;
  align-items: center;
  gap: 0.65rem;
  flex-shrink: 0;
  min-width: 0;
}
.brand__mark {
  width: 34px;
  height: 34px;
  border-radius: 9px;
  background: linear-gradient(145deg, var(--ink), var(--sky));
  box-shadow: inset 0 0 0 2px rgba(255, 255, 255, 0.18);
  flex-shrink: 0;
  display: grid;
  place-items: center;
  color: #fff;
  font-size: 16px;
  font-weight: 800;
}
.brand__name {
  font-family: var(--display);
  font-weight: 800;
  font-size: clamp(0.9rem, 2vw, 1.05rem);
  letter-spacing: -0.02em;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 10.5rem;
}
.nav { display: none; align-items: center; gap: 1.1rem; }
.nav > a {
  font-size: 0.95rem;
  font-weight: 650;
  color: var(--ink-soft);
  padding: 0.25rem 0;
  position: relative;
}
.nav > a:hover { color: var(--sky); }
.nav > a.is-active::after {
  content: "";
  position: absolute;
  left: 0;
  right: 0;
  bottom: -6px;
  height: 2px;
  background: var(--sky);
  border-radius: 2px;
}
.search {
  margin-left: auto;
  display: none;
  align-items: center;
  min-width: 200px;
  max-width: 280px;
  flex: 1;
  background: var(--bg);
  border: 1px solid var(--line);
  border-radius: 999px;
  overflow: hidden;
}
.search input {
  flex: 1;
  border: 0;
  outline: 0;
  background: transparent;
  padding: 0.6rem 0.55rem;
  font: inherit;
  min-width: 0;
}
.search button {
  border: 0;
  background: var(--ink);
  color: #fff;
  min-height: 38px;
  padding: 0 16px;
  font-weight: 700;
  cursor: pointer;
}
.burger {
  margin-left: auto;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  background: var(--surface);
  border-radius: 10px;
  display: grid;
  place-content: center;
  gap: 5px;
  cursor: pointer;
  padding: 0;
}
.burger span { display: block; width: 16px; height: 2px; background: var(--ink); transition: 0.2s ease; }
.burger.is-open span:nth-child(1) { transform: translateY(7px) rotate(45deg); }
.burger.is-open span:nth-child(2) { opacity: 0; }
.burger.is-open span:nth-child(3) { transform: translateY(-7px) rotate(-45deg); }
.drawer {
  display: none;
  border-top: 1px solid var(--line);
  background: var(--surface);
  max-height: 0;
  overflow: hidden;
  transition: max-height 0.28s ease;
}
.drawer.is-open { display: block; max-height: 80vh; overflow: auto; }
.drawer__inner { padding: 1rem 0 1.4rem; display: grid; gap: 0.7rem; }
.drawer__inner > a { font-weight: 700; }
.drawer__label {
  margin: 0.35rem 0 0;
  font-size: 12px;
  letter-spacing: 0.08em;
  color: var(--muted);
  font-weight: 700;
}
.drawer__cats { display: grid; grid-template-columns: 1fr 1fr; gap: 6px; }
.drawer__cats a {
  padding: 0.55rem 0.7rem;
  background: var(--bg);
  border-radius: 8px;
  font-size: 0.875rem;
  font-weight: 600;
}
.drawer__search { display: flex; gap: 8px; }
.drawer__search input {
  flex: 1;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 0.65rem 0.75rem;
  font: inherit;
}
.drawer__search button {
  border: 0;
  background: var(--sky);
  color: #fff;
  border-radius: 8px;
  padding: 0.7rem 1rem;
  font-weight: 700;
  cursor: pointer;
}

/* ===== Hero ===== */
.hero {
  position: relative;
  min-height: clamp(380px, 58vh, 520px);
  display: flex;
  align-items: flex-end;
  overflow: hidden;
  background: var(--ink);
  color: #fff;
}
.hero__bg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  opacity: 0.55;
}
.hero__mask {
  position: absolute;
  inset: 0;
  background:
    linear-gradient(105deg, rgba(15, 39, 68, 0.92) 0%, rgba(15, 39, 68, 0.62) 55%, rgba(37, 99, 168, 0.35) 100%),
    linear-gradient(180deg, transparent 40%, rgba(15, 39, 68, 0.85) 100%);
}
.hero__inner {
  position: relative;
  z-index: 1;
  padding: clamp(2.2rem, 6vw, 3.5rem) 0;
  max-width: 36rem;
}
.hero__eyebrow {
  margin: 0 0 0.7rem;
  font-size: 12px;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: #93c5fd;
}
.hero h1 {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: clamp(1.9rem, 5vw, 3rem);
  font-weight: 800;
  line-height: 1.15;
  letter-spacing: -0.03em;
}
.hero__lead {
  margin: 0 0 1.35rem;
  font-size: clamp(0.98rem, 2vw, 1.1rem);
  line-height: 1.65;
  color: rgba(255, 255, 255, 0.82);
}
.hero__actions { display: flex; flex-wrap: wrap; gap: 0.7rem; }
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 44px;
  padding: 0 1.25rem;
  border-radius: 999px;
  font-weight: 750;
  font-size: 0.92rem;
  border: 0;
  cursor: pointer;
  transition: transform 0.15s ease, background 0.15s ease, color 0.15s ease;
}
.btn:hover { transform: translateY(-1px); }
.btn--primary { background: #fff; color: var(--ink); }
.btn--soft { background: transparent; color: #fff; border: 1.5px solid rgba(255, 255, 255, 0.55); }
.btn--soft:hover { background: #fff; color: var(--ink); }
.btn--outline { background: var(--surface); color: var(--ink); border: 1.5px solid var(--line); }
.btn--outline:hover { border-color: var(--sky); color: var(--sky); }

/* ===== Sections ===== */
.block { padding: clamp(1.75rem, 4vw, 2.5rem) 0; }
.block--alt { background: var(--bg-alt); }
.section-head {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 1rem;
  margin-bottom: 1.15rem;
}
.section-head__sub { margin: 0 0 0.25rem; font-size: 0.8rem; color: var(--sky); font-weight: 700; }
.section-head h2 {
  margin: 0;
  font-family: var(--display);
  font-size: clamp(1.3rem, 3vw, 1.65rem);
  font-weight: 800;
  letter-spacing: -0.02em;
}
.section-head__more { color: var(--sky); font-weight: 750; font-size: 0.9rem; white-space: nowrap; }
.section-head__more:hover { text-decoration: underline; }

/* ===== Category strip ===== */
.cats { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.cats__item {
  display: grid;
  place-items: center;
  min-height: 46px;
  padding: 0.45rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  font-weight: 700;
  font-size: 0.9rem;
  transition: 0.15s ease;
}
.cats__item:hover { border-color: var(--sky); color: var(--sky); background: var(--sky-soft); }

/* ===== Card grid ===== */
.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 1rem 0.85rem; }
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}
.card:hover { border-color: #cbd5e1; box-shadow: 0 10px 24px rgba(15, 39, 68, 0.06); }
.card__cover {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  background: var(--ink);
  overflow: hidden;
}
.card__cover img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  transition: transform 0.3s ease;
}
.card:hover .card__cover img { transform: scale(1.04); }
.card__score {
  position: absolute;
  top: 8px;
  left: 8px;
  padding: 0.2rem 0.45rem;
  background: rgba(15, 39, 68, 0.88);
  color: #fff;
  border-radius: 6px;
  font-family: var(--display);
  font-weight: 800;
  font-size: 0.75rem;
}
.card__time {
  position: absolute;
  right: 8px;
  bottom: 8px;
  padding: 0.18rem 0.4rem;
  background: rgba(0, 0, 0, 0.65);
  color: #fff;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 600;
}
.card__body { padding: 0.85rem 0.9rem 1rem; }
.card__body h3 {
  margin: 0;
  font-size: 0.95rem;
  font-weight: 750;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__body h3 a:hover { color: var(--sky); }
.card__desc {
  margin: 0.4rem 0 0;
  color: var(--muted);
  font-size: 0.82rem;
  line-height: 1.5;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.card__meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.75rem;
  margin-top: 0.55rem;
  font-size: 0.75rem;
  color: var(--muted);
}
.card__meta a { color: var(--sky); font-weight: 750; }

/* ===== Banner (category/detail) ===== */
.banner {
  background: linear-gradient(120deg, var(--ink), var(--sky));
  color: #fff;
  padding: clamp(1.5rem, 4vw, 2.4rem) 0;
}
.crumb { display: flex; gap: 0.4rem; margin-bottom: 0.65rem; font-size: 0.85rem; color: rgba(255, 255, 255, 0.7); }
.crumb a:hover { color: #fff; }
.banner h1 {
  margin: 0 0 0.35rem;
  font-family: var(--display);
  font-size: clamp(1.55rem, 4vw, 2.2rem);
  font-weight: 800;
}
.banner p { margin: 0; color: rgba(255, 255, 255, 0.8); }

/* ===== Filters ===== */
.filters {
  display: flex;
  gap: 0.5rem;
  overflow-x: auto;
  margin-bottom: 1rem;
  padding-bottom: 2px;
  -webkit-overflow-scrolling: touch;
}
.filters a {
  flex: 0 0 auto;
  padding: 0.4rem 0.85rem;
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 999px;
  font-size: 0.85rem;
  font-weight: 700;
  white-space: nowrap;
}
.filters a.is-active { background: var(--ink); border-color: var(--ink); color: #fff; }
.toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 0.75rem;
  margin-bottom: 1rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.toolbar strong { color: var(--ink); }
.toolbar select {
  min-height: 36px;
  margin-left: 6px;
  padding: 0 0.7rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--surface);
  font: inherit;
  font-weight: 650;
  cursor: pointer;
}
.empty { text-align: center; padding: 3rem 1rem; color: var(--muted); grid-column: 1 / -1; }
.lib-search { margin-bottom: 1rem; }
.lib-search input {
  width: 100%;
  min-height: 44px;
  padding: 0 1rem;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font: inherit;
  outline: none;
}
.lib-search input:focus { border-color: var(--sky); box-shadow: 0 0 0 3px var(--sky-soft); }

/* ===== Detail ===== */
.panel {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 1.2rem 1.1rem;
}
.panel h1 {
  margin: 0 0 0.75rem;
  font-family: var(--display);
  font-size: clamp(1.2rem, 3vw, 1.55rem);
  font-weight: 800;
  line-height: 1.3;
}
.panel h2 { margin: 0 0 0.85rem; font-size: 1.02rem; font-weight: 800; }
.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 0.6rem 1rem;
  margin-bottom: 0.9rem;
  font-size: 0.88rem;
  color: var(--muted);
}
.meta span { display: inline-flex; align-items: center; gap: 0.3rem; }
.meta a {
  padding: 0.15rem 0.5rem;
  background: var(--sky-soft);
  color: var(--sky);
  border-radius: 999px;
  font-weight: 750;
}
.desc { margin: 0 0 0.85rem; line-height: 1.7; color: #334155; }
.tags { display: flex; flex-wrap: wrap; gap: 0.4rem; }
.tags span {
  display: inline-flex;
  align-items: center;
  gap: 0.15rem;
  padding: 0.25rem 0.55rem;
  background: var(--bg);
  border-radius: 999px;
  font-size: 0.78rem;
  color: var(--muted);
}
.actions { display: flex; flex-wrap: wrap; align-items: center; gap: 0.6rem; margin-bottom: 1.1rem; }
.actions .btn { min-height: 40px; }
.actions .btn--solid { background: var(--ink); color: #fff; }
.actions .btn--solid:hover { background: var(--sky); }

/* ===== Play ===== */
.stage { background: #0b1220; padding-bottom: 1rem; }
.stage__tip {
  margin: 0;
  padding: 0.55rem 1rem;
  text-align: center;
  font-size: 0.85rem;
  font-weight: 650;
  color: #fff;
  background: var(--ink-soft);
}
.player {
  width: min(100%, 900px);
  margin: 0.85rem auto 0;
  aspect-ratio: 16 / 9;
  max-height: min(50vh, 460px);
  overflow: hidden;
  background: #000;
  border-radius: 8px;
  position: relative;
}
.player-screen {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.9rem;
  color: #fff;
  background: linear-gradient(135deg, var(--tone-a, #0f2744), var(--tone-b, #2563a8));
}
.player-screen .play-symbol {
  width: 66px;
  height: 66px;
  display: grid;
  place-items: center;
  border-radius: 999px;
  font-size: 26px;
  color: var(--ink);
  background: #fff;
  box-shadow: 0 16px 38px rgba(0, 0, 0, 0.4);
}
.player-screen strong { font-size: 1.3rem; }
.player-screen span { color: rgba(255, 255, 255, 0.8); font-size: 0.85rem; }
.play__layout { display: grid; gap: 1.15rem; padding: 1.4rem 0 2.75rem; }
.play__main { display: grid; gap: 1rem; }
.play__side { display: grid; gap: 1rem; align-content: start; }
.related { display: grid; gap: 0.7rem; }
.related__item {
  display: grid;
  grid-template-columns: 92px minmax(0, 1fr);
  gap: 0.7rem;
  padding: 0.35rem;
  border-radius: 8px;
}
.related__item:hover { background: var(--sky-soft); }
.related__item img {
  width: 92px;
  height: 54px;
  object-fit: cover;
  border-radius: 6px;
  background: var(--ink);
}
.related__item h3 {
  margin: 0 0 0.25rem;
  font-size: 0.88rem;
  font-weight: 700;
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.related__item p { margin: 0; font-size: 0.75rem; color: var(--muted); }

/* ===== Footer ===== */
.foot { margin-top: auto; background: var(--ink); color: rgba(255, 255, 255, 0.78); }
.foot__grid { display: grid; gap: 1.75rem; padding: 2.4rem 0 1.8rem; }
.foot__brand { margin: 0 0 0.5rem; font-family: var(--display); font-size: 1.2rem; font-weight: 800; color: #fff; }
.foot__lead { margin: 0; max-width: 28rem; line-height: 1.65; font-size: 0.92rem; }
.foot h3 { margin: 0 0 0.7rem; color: #fff; font-size: 0.95rem; }
.foot ul { list-style: none; margin: 0; padding: 0; display: grid; gap: 0.4rem; }
.foot ul a:hover { color: #93c5fd; }
.foot__bottom { border-top: 1px solid rgba(255, 255, 255, 0.1); }
.foot__bottom-row {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  justify-content: space-between;
  gap: 1.25rem;
  padding: 1.15rem 0 1.4rem;
  font-size: 0.8rem;
  color: rgba(255, 255, 255, 0.55);
}
.foot__bottom-row p { margin: 0 0 0.4rem; }
.foot__bottom-row a:hover { color: #fff; }

/* ===== Responsive ===== */
@media (min-width: 720px) {
  .cats { grid-template-columns: repeat(8, minmax(0, 1fr)); }
  .grid { grid-template-columns: repeat(3, minmax(0, 1fr)); }
  .foot__grid { grid-template-columns: 1.5fr 1fr 1fr 1fr; }
  .brand__name { max-width: none; }
}
@media (min-width: 960px) {
  .nav, .search { display: flex; }
  .burger, .drawer, .drawer.is-open { display: none; }
  .grid { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .play__layout { grid-template-columns: minmax(0, 1.7fr) minmax(260px, 0.9fr); }
}
@media (max-width: 719px) {
  .hero { min-height: 340px; }
  .cats { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .player { border-radius: 0; width: 100%; }
  .section-head { align-items: flex-start; flex-direction: column; }
}
