:root {
  color-scheme: dark;
  --background: #08090b;
  --panel: #111318;
  --panel-strong: #171a21;
  --line: #292d37;
  --text: #f5f5f6;
  --muted: #9ca3af;
  --purple: #a855f7;
  --purple-soft: #c4b5fd;
  --danger: #ef4444;
}

* { box-sizing: border-box; }
html { scroll-behavior: smooth; }
body {
  margin: 0;
  min-height: 100vh;
  background: radial-gradient(circle at top, #25113c 0, transparent 34rem), var(--background);
  color: var(--text);
  font-family: system-ui, -apple-system, "Segoe UI", sans-serif;
}
a { color: inherit; text-decoration: none; }
button { font: inherit; cursor: pointer; }
.hidden { display: none !important; }
.wrap { width: min(1120px, calc(100% - 28px)); margin-inline: auto; }
.reading-progress {
  position: fixed;
  inset: 0 auto auto 0;
  z-index: 80;
  width: 0;
  height: 3px;
  background: linear-gradient(90deg, #7c3aed, #d946ef);
  box-shadow: 0 0 14px #a855f7;
}
.site-header {
  position: sticky;
  top: 0;
  z-index: 30;
  border-bottom: 1px solid var(--line);
  background: #08090bea;
  backdrop-filter: blur(12px);
}
.nav { display: flex; align-items: center; height: 64px; }
.brand { font-weight: 950; letter-spacing: .12em; }
.brand b { color: #c084fc; }
.hero { padding: 50px 0 24px; }
.hero h1 {
  margin: 8px 0 14px;
  font-size: clamp(36px, 7vw, 72px);
  line-height: .95;
  letter-spacing: -.035em;
}
.hero h1 span { color: #d8b4fe; }
.story-hero h1 { font-size: clamp(34px, 6vw, 64px); }
.eyebrow {
  margin: 0;
  color: var(--purple-soft);
  font-size: 12px;
  font-weight: 900;
  letter-spacing: .14em;
}
.muted { color: var(--muted); }
.section-bottom { padding-bottom: 64px; }
.section-title {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 12px;
  margin: 12px 0 18px;
}
.section-title h2 { margin: 0; }
.stories {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(250px, 1fr));
  gap: 18px;
}
.story-card {
  overflow: hidden;
  border: 1px solid var(--line);
  border-radius: 18px;
  background: var(--panel);
  transition: transform .2s ease, border-color .2s ease, box-shadow .2s ease;
}
.story-card:hover,
.story-card:focus-visible {
  transform: translateY(-4px);
  border-color: #6d4b93;
  box-shadow: 0 18px 50px #0007;
}
.story-cover {
  display: grid;
  place-items: center;
  aspect-ratio: 16 / 9;
  padding: 18px;
  background: linear-gradient(135deg, #35135c, #101218) center / cover;
  color: #ddd6fe;
  font-weight: 900;
  text-align: center;
}
.story-body { padding: 17px; }
.story-body h3 { margin: 8px 0; }
.story-meta { margin-top: 12px; color: #c4b5fd; font-size: 13px; font-weight: 750; }
.button {
  display: inline-block;
  padding: 10px 14px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--panel-strong);
  color: #fff;
  font-weight: 750;
}
.episodes { display: flex; flex-direction: column; gap: 10px; padding-bottom: 60px; }
.episode-card {
  display: grid;
  grid-template-columns: 88px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 10px;
  border: 1px solid var(--line);
  border-radius: 15px;
  background: var(--panel);
  transition: border-color .2s ease, background .2s ease;
}
.episode-card:hover { border-color: #6d4b93; background: #15121c; }
.episode-thumb {
  width: 88px;
  height: 112px;
  border-radius: 10px;
  background: linear-gradient(135deg, #35135c, #171a21) center / cover;
}
.episode-card h3 { margin: 5px 0; }
.published { margin-top: 7px; color: #aeb4c0; font-size: 13px; }
.new-badge {
  display: inline-block;
  margin-left: 7px;
  padding: 2px 7px;
  border-radius: 999px;
  background: #6d28d9;
  color: #fff;
  font-size: 11px;
  font-weight: 900;
  letter-spacing: .04em;
}
.view-count { margin-top: 7px; color: var(--purple-soft); font-size: 14px; font-weight: 700; }
.crumbs {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-top: 20px;
  color: var(--muted);
  font-size: 13px;
}
.crumbs a { color: #d8b4fe; }
.reader { width: min(980px, 100%); margin-inline: auto; padding: 20px 0 60px; }
.reader-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 0 14px 18px;
}
.reader-top h1 { margin: 10px 0 0; font-size: clamp(24px, 4vw, 36px); }
.reader-crumbs { padding: 0; }
.reader-pages { min-height: 240px; background: #000; }
.reader-pages img {
  display: block;
  width: 100%;
  height: auto;
  min-height: 100px;
  scroll-margin-top: 72px;
  background: #060606;
}
.chooser-wrap { padding: 12px 14px 0; }
.chooser-toggle {
  width: 100%;
  padding: 15px;
  border: 1px solid #5b3a85;
  border-radius: 14px;
  background: linear-gradient(135deg, #241333, #351750);
  color: #fff;
  font-weight: 900;
}
.chooser { margin-top: 10px; padding: 14px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.button-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(58px, 1fr)); gap: 8px; }
.jump-button {
  padding: 10px 6px;
  border: 1px solid #3a3f4b;
  border-radius: 10px;
  background: #171a21;
  color: #fff;
  font-weight: 800;
}
.jump-button.current { border-color: var(--purple); background: #311548; }
.next-navigation { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; padding: 20px 14px; }
.next-navigation a,
.navigation-off { padding: 16px; border: 1px solid var(--line); border-radius: 14px; background: var(--panel); }
.next-link { text-align: right; background: linear-gradient(135deg, #35135c, #52197a) !important; }
.navigation-off { opacity: .45; }
.music-toggle {
  position: fixed;
  right: 16px;
  bottom: 16px;
  z-index: 50;
  padding: 12px 16px;
  border: 1px solid #6d4b93;
  border-radius: 999px;
  background: #17111f;
  color: #fff;
  font-weight: 800;
  box-shadow: 0 10px 35px #0008;
}
.music-toggle.on { background: linear-gradient(135deg, #6d28d9, #a855f7); }
.status { min-height: 28px; padding: 12px 0; color: #f0abfc; }
.reader-status { padding-inline: 14px; }
.empty-state {
  padding: 28px;
  border: 1px dashed #383d49;
  border-radius: 16px;
  color: var(--muted);
  text-align: center;
}
.noscript { padding: 30px; color: #f0abfc; text-align: center; }

@media (max-width: 700px) {
  .brand { font-size: 14px; }
  .episode-card { grid-template-columns: 68px minmax(0, 1fr); }
  .episode-thumb { width: 68px; height: 92px; }
  .episode-card > .button { grid-column: 1 / -1; text-align: center; }
  .reader-top { align-items: flex-start; flex-direction: column; }
  .next-navigation { grid-template-columns: 1fr; }
  .next-link { text-align: left; }
  .button-grid { grid-template-columns: repeat(5, 1fr); }
}
