﻿:root {
  --read-bg: #0e1117;
  --read-bg-2: #171b25;
  --read-panel: rgba(12, 16, 24, 0.78);
  --read-line: rgba(255, 255, 255, 0.1);
  --read-text: #f3efe7;
  --read-muted: #adb7c4;
  --read-accent: #d9a441;
  --read-accent-2: #7fc3ff;
  --read-shadow: 0 24px 80px rgba(0, 0, 0, 0.34);
}

* { box-sizing: border-box; }
html, body { margin: 0; min-height: 100%; }
body.read-page {
  position: relative;
  overflow-x: hidden;
  color: var(--read-text);
  font-family: "IBM Plex Sans", sans-serif;
  background:
    radial-gradient(circle at top left, rgba(217, 164, 65, 0.18), transparent 28%),
    radial-gradient(circle at 80% 10%, rgba(127, 195, 255, 0.14), transparent 22%),
    linear-gradient(145deg, var(--read-bg) 0%, var(--read-bg-2) 50%, #241716 100%);
}
.read-noise, .read-glow { position: fixed; pointer-events: none; }
.read-noise {
  inset: 0;
  opacity: 0.18;
  background-image:
    linear-gradient(rgba(255,255,255,0.03) 1px, transparent 1px),
    linear-gradient(90deg, rgba(255,255,255,0.03) 1px, transparent 1px);
  background-size: 28px 28px;
}
.read-glow { border-radius: 999px; filter: blur(80px); }
.read-glow-a { top: -8rem; left: -8rem; width: 26rem; height: 26rem; background: rgba(217, 164, 65, 0.18); }
.read-glow-b { right: -8rem; bottom: -9rem; width: 24rem; height: 24rem; background: rgba(127, 195, 255, 0.16); }
.read-shell {
  position: relative;
  z-index: 1;
  width: min(1320px, calc(100% - 2rem));
  margin: 0 auto;
  padding: 1.4rem 0 3rem;
}
.read-hero, .library-panel, .reader-panel {
  border: 1px solid var(--read-line);
  border-radius: 30px;
  backdrop-filter: blur(22px);
  box-shadow: var(--read-shadow);
  background:
    linear-gradient(180deg, rgba(255,255,255,0.05), rgba(255,255,255,0.02)),
    var(--read-panel);
}
.read-hero { padding: 2.5rem; }
.read-kicker, .section-tag {
  margin: 0 0 .8rem;
  color: var(--read-accent);
  text-transform: uppercase;
  letter-spacing: .22em;
  font-size: .82rem;
}
.read-hero h1, .panel-head h2, .reader-head h2 { margin: 0; }
.read-hero h1 {
  font-size: clamp(2.8rem, 8vw, 5.8rem);
  line-height: .95;
}
.read-copy, .reader-meta, .reader-excerpt, .library-sub, .library-summary {
  color: var(--read-muted);
  line-height: 1.7;
}
.read-meta { display: flex; flex-wrap: wrap; gap: .75rem; margin-top: 1.25rem; }
.meta-pill {
  display: inline-flex;
  align-items: center;
  min-height: 2.4rem;
  padding: .55rem .95rem;
  border: 1px solid var(--read-line);
  border-radius: 999px;
  background: rgba(255,255,255,0.05);
}
.read-layout {
  display: grid;
  grid-template-columns: minmax(320px, 430px) minmax(0, 1fr);
  gap: 1rem;
  margin-top: 1rem;
}
.library-panel, .reader-panel { padding: 1.4rem; }
.panel-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 1rem;
}
.library-search {
  width: min(240px, 100%);
  padding: .9rem 1rem;
  border: 1px solid var(--read-line);
  border-radius: 18px;
  background: rgba(255,255,255,0.05);
  color: var(--read-text);
  font: inherit;
}
.library-list {
  display: grid;
  gap: .8rem;
  margin-top: 1rem;
  max-height: 72vh;
  overflow: auto;
}
.library-item {
  display: grid;
  gap: .35rem;
  padding: 1rem;
  text-align: left;
  border: 1px solid var(--read-line);
  border-radius: 22px;
  color: inherit;
  cursor: pointer;
  background: rgba(255,255,255,0.04);
  transition: transform .16s ease, border-color .16s ease;
}
.library-item:hover, .library-item:focus-visible { transform: translateY(-2px); }
.library-item.is-active {
  border-color: rgba(217, 164, 65, 0.42);
  box-shadow: inset 0 0 0 1px rgba(217, 164, 65, 0.14);
}
.library-title { font-size: 1.05rem; font-weight: 700; }
.library-summary {
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.library-empty {
  padding: 1.25rem;
  border: 1px solid var(--read-line);
  border-radius: 20px;
  color: var(--read-muted);
  background: rgba(255,255,255,0.04);
}
.reader-head {
  padding-bottom: 1rem;
  border-bottom: 1px solid var(--read-line);
}
.reader-body {
  margin-top: 1.25rem;
  font-family: "Noto Serif SC", serif;
  font-size: 1.05rem;
  line-height: 2;
}
.reader-body p {
  margin: 0 0 1.1rem;
  white-space: pre-wrap;
}
@media (max-width: 980px) {
  .read-layout { grid-template-columns: 1fr; }
  .library-list { max-height: none; }
}
@media (max-width: 720px) {
  .read-shell { width: min(100% - 1rem, 100%); padding-top: 1rem; }
  .read-hero, .library-panel, .reader-panel { padding: 1.2rem; border-radius: 24px; }
  .panel-head { flex-direction: column; }
  .library-search { width: 100%; }
}
