:root {
  color-scheme: light;
  --bg: #f3f7fb;
  --panel: #ffffff;
  --soft: #e8f0f7;
  --ink: #17222e;
  --muted: #617080;
  --line: #d5e0e9;
  --blue: #1c6fb8;
  --cyan: #2aa7a5;
  --red: #cf5148;
  --shadow: 0 18px 42px rgba(27, 57, 91, .11);
  --radius: 8px;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  color: var(--ink);
  background:
    linear-gradient(135deg, rgba(42,167,165,.12), transparent 34%),
    linear-gradient(90deg, rgba(28,111,184,.06) 1px, transparent 1px),
    linear-gradient(rgba(28,111,184,.045) 1px, transparent 1px),
    var(--bg);
  background-size: auto, 28px 28px, 28px 28px;
  font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

a { color: inherit; text-decoration: none; }
img { display: block; width: 100%; }
h1, h2, h3, p { margin: 0; }
button, select { font: inherit; }

.topbar,
.shell,
.library-wrap,
.footer {
  width: min(1500px, calc(100% - 32px));
  margin: 0 auto;
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 40;
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 18px;
  align-items: center;
  min-height: 70px;
  border-bottom: 1px solid var(--line);
  background: rgba(243,247,251,.94);
  backdrop-filter: blur(14px);
}

.brand {
  color: #fff;
  background: var(--blue);
  padding: 9px 14px;
  border-radius: var(--radius);
  font-size: 24px;
  font-weight: 900;
}

.nav {
  display: flex;
  justify-content: center;
  gap: 8px;
  overflow-x: auto;
  scrollbar-width: none;
}

.nav a,
.top-action,
.actions a,
.section-head a,
.side-panel a,
.tabs button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 34px;
  padding: 0 12px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: rgba(255,255,255,.82);
  font-weight: 800;
  white-space: nowrap;
}

.nav a.active,
.nav a:hover,
.top-action,
.actions a:first-child,
.side-panel a:hover,
.tabs button.active {
  color: #fff;
  border-color: var(--blue);
  background: var(--blue);
}

.shell {
  display: grid;
  grid-template-columns: 190px minmax(0, 1fr);
  gap: 16px;
  padding-top: 18px;
}

.side-panel {
  position: sticky;
  top: 88px;
  align-self: start;
  display: grid;
  gap: 9px;
  padding: 14px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.88);
  box-shadow: var(--shadow);
}

.side-panel a {
  justify-content: flex-start;
}

.main-panel {
  min-width: 0;
}

.hero,
.stats div,
.picked,
.hot-list,
.category-rows article,
.library-hero,
.filter-panel,
.library-card,
.detail-panel {
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: rgba(255,255,255,.9);
  box-shadow: var(--shadow);
}

.hero {
  display: grid;
  grid-template-columns: minmax(0, .95fr) minmax(420px, 1.25fr);
  gap: 16px;
  padding: 16px;
}

.hero-copy {
  display: grid;
  align-content: center;
  min-height: 410px;
  padding: clamp(18px, 4vw, 48px);
  border-radius: 6px;
  background: var(--soft);
}

.label {
  margin-bottom: 8px;
  color: var(--blue);
  font-size: 13px;
  font-weight: 900;
}

.hero-copy h1 {
  max-width: 9ch;
  margin-bottom: 14px;
  font-size: clamp(44px, 6vw, 86px);
  line-height: .98;
}

.hero-copy p:not(.label),
.library-hero p,
.detail-panel p,
.footer p {
  color: var(--muted);
  line-height: 1.78;
}

.actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 22px;
}

.hero-visual {
  display: grid;
  grid-template-columns: 1.25fr 1fr 1fr;
  grid-template-rows: repeat(2, 1fr);
  gap: 10px;
  min-height: 410px;
}

.hero-card {
  position: relative;
  overflow: hidden;
  border-radius: 6px;
  background: #000;
}

.hero-card.primary {
  grid-row: 1 / 3;
}

.hero-card img {
  height: 100%;
  min-height: 190px;
  object-fit: cover;
}

.hero-card::after {
  content: "";
  position: absolute;
  inset: 0;
  background: linear-gradient(transparent 45%, rgba(0,0,0,.72));
}

.hero-card span {
  position: absolute;
  z-index: 2;
  left: 10px;
  right: 10px;
  bottom: 10px;
  display: grid;
  gap: 4px;
  color: #fff;
}

.hero-card em,
.poster-card em,
.library-card em {
  color: #aee9ec;
  font-size: 12px;
  font-style: normal;
  font-weight: 900;
}

.stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.stats div {
  min-height: 82px;
  padding: 14px;
}

.stats b {
  display: block;
  color: var(--cyan);
  font-size: 36px;
}

.stats span {
  color: var(--muted);
  font-weight: 800;
}

.editor-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 310px;
  gap: 14px;
  margin-top: 14px;
}

.picked,
.hot-list,
.category-rows article,
.library-hero,
.filter-panel {
  padding: 16px;
}

.section-head {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  align-items: end;
  margin-bottom: 14px;
}

.section-head.plain {
  display: block;
}

.section-head h2 {
  font-size: clamp(25px, 3vw, 42px);
  line-height: 1.04;
}

.picked-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(122px, 1fr));
  gap: 10px;
}

.poster-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 8px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.poster-card img {
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 4px;
}

.poster-card span,
.compact-card span,
.library-card span {
  min-width: 0;
}

.hero-card b,
.poster-card b,
.compact-card b,
.hot-row b,
.library-card b {
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.poster-card b {
  min-height: 36px;
  display: -webkit-box;
  white-space: normal;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  line-height: 1.34;
}

.hero-card small,
.poster-card small,
.compact-card small,
.hot-row small,
.library-card small {
  overflow: hidden;
  color: var(--muted);
  font-size: 12px;
  white-space: nowrap;
  text-overflow: ellipsis;
}

.hot-row {
  display: grid;
  grid-template-columns: 30px minmax(0, 1fr) 42px;
  gap: 9px;
  align-items: center;
  min-height: 46px;
  padding: 8px 0;
  border-top: 1px solid var(--line);
}

.hot-row i {
  display: grid;
  width: 28px;
  height: 28px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--red);
  font-style: normal;
  font-weight: 900;
}

.hot-row strong {
  color: var(--blue);
}

.category-rows {
  display: grid;
  gap: 14px;
  margin-top: 14px;
}

.row-strip {
  display: grid;
  grid-template-columns: repeat(10, minmax(0, 1fr));
  gap: 9px;
}

.compact-card {
  display: grid;
  gap: 6px;
  min-width: 0;
  padding: 7px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
}

.compact-card img {
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 4px;
}

.library-wrap {
  padding-top: 18px;
}

.library-hero {
  display: flex;
  justify-content: space-between;
  gap: 20px;
  align-items: center;
}

.library-hero h1,
.detail-panel h1 {
  margin-bottom: 8px;
  font-size: clamp(38px, 5vw, 70px);
  line-height: 1;
}

.library-hero strong {
  color: var(--red);
  font-size: 40px;
  white-space: nowrap;
}

.filter-panel {
  display: flex;
  justify-content: space-between;
  gap: 14px;
  align-items: center;
  margin-top: 14px;
}

.tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filter-panel label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  color: var(--muted);
  font-weight: 800;
}

.filter-panel select {
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
}

.library-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 14px;
}

.library-card {
  display: grid;
  grid-template-columns: 72px minmax(0, 1fr) 42px;
  gap: 10px;
  align-items: center;
  min-height: 104px;
  padding: 8px;
  box-shadow: none;
}

.library-card img {
  width: 72px;
  height: 88px;
  object-fit: cover;
  border-radius: 4px;
}

.library-card em {
  color: var(--blue);
}

.library-card small {
  white-space: normal;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}

.library-card strong {
  display: grid;
  width: 40px;
  height: 40px;
  place-items: center;
  border-radius: 50%;
  color: #fff;
  background: var(--cyan);
}

.detail-panel {
  display: grid;
  grid-template-columns: 280px 1fr;
  gap: 26px;
  align-items: center;
  padding: 20px;
}

.detail-panel > img {
  width: 280px;
  aspect-ratio: 2 / 3;
  object-fit: cover;
  border-radius: 6px;
}

.detail-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 14px;
}

.detail-meta span {
  padding: 8px 10px;
  border: 1px solid var(--line);
  border-radius: 999px;
  background: var(--soft);
  font-weight: 800;
}

.related-block {
  margin-top: 14px;
}

.footer {
  display: grid;
  grid-template-columns: 1.5fr repeat(3, 1fr);
  gap: 24px;
  margin-top: 34px;
  padding: 28px 0 38px;
  border-top: 1px solid var(--line);
}

.footer b {
  color: var(--blue);
  font-size: 24px;
}

.footer h3 {
  margin: 0 0 10px;
  color: var(--blue);
}

.footer a {
  display: block;
  margin: 8px 0;
  color: var(--muted);
}

.empty {
  padding: 24px;
  color: var(--muted);
}

@media (max-width: 1240px) {
  .shell,
  .hero,
  .editor-layout,
  .library-grid {
    grid-template-columns: 1fr;
  }
  .side-panel {
    position: static;
    grid-template-columns: repeat(5, 1fr);
  }
  .side-panel .label {
    grid-column: 1 / -1;
  }
  .row-strip {
    grid-template-columns: repeat(5, minmax(0, 1fr));
  }
}

@media (max-width: 820px) {
  .topbar,
  .stats,
  .hero-visual,
  .side-panel,
  .library-hero,
  .filter-panel,
  .detail-panel,
  .footer {
    grid-template-columns: 1fr;
  }
  .nav {
    grid-column: 1 / -1;
    justify-content: flex-start;
  }
  .top-action {
    display: none;
  }
  .library-hero,
  .filter-panel {
    align-items: stretch;
  }
  .detail-panel > img {
    width: min(280px, 100%);
  }
}

@media (max-width: 560px) {
  .topbar,
  .shell,
  .library-wrap,
  .footer {
    width: calc(100% - 22px);
  }
  .hero,
  .picked,
  .hot-list,
  .category-rows article,
  .library-hero,
  .filter-panel,
  .detail-panel {
    padding: 12px;
  }
  .picked-grid,
  .row-strip {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
  .library-card {
    grid-template-columns: 64px minmax(0, 1fr);
  }
  .library-card img {
    width: 64px;
    height: 82px;
  }
  .library-card strong {
    display: none;
  }
}
