:root {
  --bg: #06111f;
  --bg2: #0a1630;
  --panel: rgba(7, 15, 30, 0.82);
  --panel-soft: rgba(10, 20, 40, 0.72);
  --line: rgba(144, 172, 255, 0.16);
  --text: #edf2ff;
  --muted: #9fb0d4;
  --accent: linear-gradient(135deg, #8b5cf6, #06b6d4);
}
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  color: var(--text);
  font: 16px/1.55 Inter, ui-sans-serif, system-ui, -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(139, 92, 246, 0.20), transparent 28%),
    radial-gradient(circle at right, rgba(6, 182, 212, 0.18), transparent 30%),
    linear-gradient(180deg, var(--bg2), var(--bg));
  min-height: 100vh;
}
a { color: inherit; text-decoration: none; }
code { background: rgba(255,255,255,0.08); padding: 0.12rem 0.38rem; border-radius: 0.45rem; }
.container { width: min(1180px, calc(100% - 32px)); margin: 0 auto; padding: 24px 0 48px; }
.stack > * + * { margin-top: 16px; }
.stack-lg > * + * { margin-top: 24px; }
.panel, .panel-soft {
  border: 1px solid var(--line);
  border-radius: 24px;
  box-shadow: 0 18px 60px rgba(0,0,0,0.24);
}
.panel { background: var(--panel); padding: 24px; }
.panel-soft { background: var(--panel-soft); padding: 18px; }
.hero { display: grid; grid-template-columns: 1.5fr 0.8fr; gap: 20px; align-items: stretch; }
.eyebrow {
  display: inline-block; padding: 6px 12px; border-radius: 999px; border: 1px solid var(--line);
  font-size: 0.8rem; color: var(--muted); margin-bottom: 10px;
}
h1, h2, h3 { margin: 0; line-height: 1.05; }
h1 { font-size: clamp(2.2rem, 4vw, 4.4rem); letter-spacing: -0.04em; }
h2 { font-size: 1.5rem; }
h3 { font-size: 1.2rem; }
.maxw { max-width: 60ch; }
.muted { color: var(--muted); }
.small { font-size: 0.92rem; }
.actions { display: flex; gap: 10px; flex-wrap: wrap; }
.actions.vertical { flex-direction: column; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; min-height: 44px; padding: 0 16px;
  border-radius: 14px; border: 1px solid var(--line); background: rgba(255,255,255,0.04); color: var(--text);
}
.btn:hover { background: rgba(255,255,255,0.09); }
.btn-primary { background: var(--accent); border: 0; }
.stats-grid { display: grid; gap: 16px; }
.stat { min-height: 110px; display: flex; flex-direction: column; justify-content: center; }
.stat strong { font-size: 2rem; }
.stat span { color: var(--muted); }
.toolbar { display: flex; justify-content: space-between; gap: 16px; align-items: end; }
.toolbar-controls { display: flex; gap: 10px; flex-wrap: wrap; }
input, select {
  min-height: 44px; min-width: 180px; padding: 0 14px; color: var(--text);
  border: 1px solid var(--line); border-radius: 14px; background: rgba(255,255,255,0.05);
}
.status { color: var(--muted); }
.cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(240px, 1fr)); gap: 16px; }
.card { display: flex; flex-direction: column; gap: 12px; min-height: 100%; }
.card-cover, .reader-cover {
  width: 100%; aspect-ratio: 16 / 10; object-fit: cover; border-radius: 18px; border: 1px solid var(--line);
  background: rgba(255,255,255,0.04);
}
.badge-row { display: flex; gap: 8px; flex-wrap: wrap; }
.badge {
  padding: 5px 10px; border-radius: 999px; font-size: 0.78rem; color: var(--muted);
  background: rgba(255,255,255,0.05); border: 1px solid var(--line);
}
.card-desc { min-height: 72px; }
.meta-list { margin: 0; display: grid; gap: 10px; }
.meta-list.compact { gap: 6px; }
.meta-list div { display: grid; grid-template-columns: 72px 1fr; gap: 10px; }
.meta-list dt { color: var(--muted); }
.meta-list dd { margin: 0; }
.reader-shell { min-height: 100vh; }
.reader-layout {
  display: grid; grid-template-columns: 340px 1fr; gap: 18px; padding: 18px; min-height: 100vh;
}
.reader-sidebar, .reader-main { min-height: calc(100vh - 36px); }
.reader-title { font-size: 2rem; }
.reader-main { padding: 8px; }
.reader-frame { width: 100%; min-height: calc(100vh - 54px); border: 0; border-radius: 18px; background: white; }
.back-link { color: var(--muted); }
@media (max-width: 920px) {
  .hero, .reader-layout { grid-template-columns: 1fr; }
  .toolbar { align-items: stretch; flex-direction: column; }
  .toolbar-controls { width: 100%; }
  input, select { width: 100%; }
}
