/* ─────────────────────────────────────────────────────────
 * Brumaire · Paper Dossier 视觉系统
 * 抽自 dungeon 同人库（2026-07-05 主公拍板纸感美学）
 * 其它子项目按需引用：
 *   <link rel="stylesheet" href="/_shared/paper-dossier.css" />
 * ───────────────────────────────────────────────────────── */

:root {
  --paper: #f4ece0;
  --paper-deep: #ede0c9;
  --paper-edge: #d6c6a4;
  --ink: #141210;
  --ink-soft: #3a342c;
  --cinnabar: #9c3a2a;
  --cinnabar-deep: #6f2318;
  --ash: #8a8376;
  --gold: #a88a4e;
  --line: rgba(20, 18, 16, 0.14);
}

/* === 纸张 grain · 纤维 === */
body::before {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9995;
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='260' height='260'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='0.85' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 0.08 0 0 0 0 0.07 0 0 0 0 0.05 0 0 0 0.18 0'/></filter><rect width='100%25' height='100%25' filter='url(%23n)'/></svg>");
  mix-blend-mode: multiply;
  opacity: 0.5;
}
body::after {
  content: "";
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 9994;
  background: repeating-linear-gradient(0deg, transparent 0, transparent 3px, rgba(20,18,16,0.012) 3px, rgba(20,18,16,0.012) 4px);
}

/* === 进度墨线（顶部水平）=== */
#progress-bar {
  position: fixed;
  inset: 0 0 auto 0;
  height: 1px;
  z-index: 9996;
  pointer-events: none;
}
#progress-bar::after {
  content: "";
  position: absolute;
  left: 0;
  top: 0;
  width: var(--p, 0%);
  height: 100%;
  background: linear-gradient(90deg, var(--ink), var(--cinnabar));
}

/* === 侧边 folio · sticky dots === */
#folio {
  position: fixed;
  left: 28px;
  top: 50%;
  transform: translateY(-50%);
  z-index: 100;
  display: flex;
  flex-direction: column;
  gap: 14px;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 12px;
  color: var(--ash);
  letter-spacing: 0.24em;
}
#folio .dot {
  width: 6px;
  height: 6px;
  border: 1px solid var(--ash);
  border-radius: 50%;
  transition: all 0.3s ease;
}
#folio .dot.active {
  background: var(--cinnabar);
  border-color: var(--cinnabar);
  transform: scale(1.6);
}

/* === 顶部 Meta bar === */
#topmeta {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  z-index: 100;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 22px 6vw;
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  font-size: 12px;
  color: var(--ash);
  letter-spacing: 0.22em;
}
#topmeta .mark {
  width: 20px;
  height: 20px;
  border: 1.5px solid var(--cinnabar-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: "Ma Shan Zheng", serif;
  font-style: normal;
  color: var(--cinnabar-deep);
  font-size: 11px;
  transform: rotate(-3deg);
}
#topmeta a {
  color: inherit;
  text-decoration: none;
}

/* === folio-card 通用 === */
.folio-card {
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid rgba(20, 18, 16, 0.12);
  background: rgba(255, 255, 255, 0.42);
  padding: 20px 22px;
  transition: transform 0.2s ease, border-color 0.2s ease, box-shadow 0.2s ease;
}
.folio-card:hover {
  transform: translateY(-2px);
  border-color: rgba(156, 58, 42, 0.34);
  box-shadow: 0 18px 30px rgba(20, 18, 16, 0.08);
}
.folio-card .tag {
  font-family: "JetBrains Mono", monospace;
  font-size: 0.7rem;
  letter-spacing: 0.14em;
  color: var(--cinnabar-deep);
  text-transform: uppercase;
}
.folio-card .track {
  font-family: "Cormorant Garamond", serif;
  font-style: italic;
  color: var(--ash);
  font-size: 0.92rem;
}

/* === reveal 滚动揭示 === */
.reveal {
  opacity: 0;
  transform: translateY(20px);
  transition: opacity 0.9s ease, transform 0.9s ease;
}
.reveal.in {
  opacity: 1;
  transform: translateY(0);
}

/* === 启动脚本（最小骨架，需要在页面末尾插入）===
   <script>
   const progressBar = document.getElementById('progress-bar');
   const dots = [...document.querySelectorAll('#folio .dot')];
   const reveals = [...document.querySelectorAll('.reveal')];
   const sections = [...document.querySelectorAll('section.block')];
   const io = new IntersectionObserver((entries) => {
     entries.forEach((entry) => { if (entry.isIntersecting) entry.target.classList.add('in'); });
   }, { threshold: 0.18 });
   reveals.forEach((el) => io.observe(el));
   function updateProgress() {
     const scrollTop = window.scrollY;
     const maxScroll = document.documentElement.scrollHeight - window.innerHeight;
     const pct = maxScroll > 0 ? (scrollTop / maxScroll) * 100 : 0;
     if (progressBar) progressBar.style.setProperty('--p', pct + '%');
     let active = 0;
     sections.forEach((section, idx) => {
       const rect = section.getBoundingClientRect();
       if (rect.top <= window.innerHeight * 0.45) active = idx;
     });
     dots.forEach((dot, idx) => dot.classList.toggle('active', idx === active));
   }
   window.addEventListener('scroll', updateProgress, { passive: true });
   window.addEventListener('load', updateProgress);
   </script>
*/

/* === 移动端响应 === */
@media (max-width: 1100px) {
  #folio { display: none; }
}
@media (max-width: 640px) {
  #topmeta {
    padding: 16px 5vw;
    flex-direction: column;
    gap: 10px;
    align-items: flex-start;
  }
}

/* === Laimay 阅读页追加 === */
.read-body { font-family: "Noto Serif SC", "Songti SC", "SimSun", serif; }
