:root {
  --bg: #2f4052;
  --accent: #e0bd7f;
  --paper: #efe6d2;
  --ink: #1c1a17;
  --line: rgba(239, 230, 210, .22);
  --muted: rgba(239, 230, 210, .62);
  --seal: #b8392b;
  --serif: 'Noto Serif SC', 'Songti SC', 'SimSun', serif;
  --brush: 'Ma Shan Zheng', 'STKaiti', 'KaiTi', var(--serif);
}

* { box-sizing: border-box; margin: 0; padding: 0; }
html, body { height: 100%; }
body {
  font-family: var(--serif);
  color: var(--paper);
  background: var(--bg);
  transition: background-color .8s ease;
  overflow: hidden;
  -webkit-font-smoothing: antialiased;
}
body::before { /* 纸纹 */
  content: ''; position: fixed; inset: 0; pointer-events: none; opacity: .18;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.8' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
  mix-blend-mode: overlay;
}
button { font: inherit; color: inherit; background: none; border: 0; cursor: pointer; }

.seal {
  display: inline-grid; place-items: center; width: 34px; height: 34px;
  background: var(--seal); color: #f4dccb; font-family: var(--brush);
  font-size: 12px; line-height: 1.05; text-align: center; border-radius: 2px;
  box-shadow: inset 0 0 0 2px rgba(255,255,255,.12);
}

/* ---------- 开屏 ---------- */
#splash {
  position: fixed; inset: 0; z-index: 50; background: #284a6e;
  display: flex; flex-direction: column; justify-content: space-between;
  padding: 12vh 8vw 6vh; transition: opacity .8s, visibility .8s;
}
#splash.gone { opacity: 0; visibility: hidden; }
#splash h1 {
  font-size: clamp(56px, 11vw, 150px); font-weight: 900; letter-spacing: .04em;
  display: flex; align-items: center; gap: .3em;
}
.seal.big { width: 1.6em; height: 1.6em; font-size: .38em; transform: rotate(4deg); line-height: 1.1; }
.lead { margin-top: 2.4vh; font-size: clamp(16px, 1.8vw, 24px); color: var(--paper); }
.lead em { font-style: normal; margin-left: 1.6em; }
.sub { margin-top: 8px; font-size: 14px; color: var(--muted); }
#enter {
  margin-top: 4vh; padding: 10px 26px; border: 1px solid var(--line);
  letter-spacing: .2em; transition: background .3s;
}
#enter:hover { background: rgba(255,255,255,.08); }
.strip { display: flex; gap: 12px; height: 28vh; overflow: hidden; }
.strip div {
  flex: 0 0 auto; height: 100%; aspect-ratio: 3/4.2; background-size: cover; background-position: center;
  box-shadow: 0 10px 24px rgba(0,0,0,.35); opacity: 0; transform: translateY(20px);
  animation: rise .8s forwards;
}
@keyframes rise { to { opacity: 1; transform: none; } }

/* ---------- 顶栏 ---------- */
#top {
  position: fixed; top: 0; left: 0; right: 0; height: 80px; z-index: 10;
  display: grid; grid-template-columns: 1fr auto 1fr; align-items: center; padding: 0 24px;
}
.brand { display: flex; align-items: center; gap: 22px; }
.brand nav { display: flex; gap: 22px; font-size: 16px; }
.brand nav button { color: var(--muted); transition: color .3s; }
.brand nav button.on, .brand nav button:hover { color: var(--paper); }
.count { justify-self: end; font-size: 15px; display: flex; align-items: center; gap: 10px; }
.count i { width: 6px; height: 6px; border-radius: 50%; background: var(--paper); }

.timeline { position: relative; width: min(380px, 34vw); height: 50px; }
.tl-track { position: absolute; left: 0; right: 0; top: 24px; height: 1px; background: var(--line); }
.tl-track b { position: absolute; top: -5px; width: 1px; height: 10px; background: rgba(239,230,210,.55); cursor: pointer; }
.tl-track b:hover { background: var(--accent); }
.tl-mark {
  position: absolute; top: -5px; width: 10px; height: 10px; margin-left: -5px;
  background: var(--accent); transition: left .6s cubic-bezier(.3,.7,.2,1);
}
.tl-label {
  position: absolute; top: 2px; transform: translateX(-50%); white-space: nowrap;
  font-size: 12px; color: var(--accent); transition: left .6s cubic-bezier(.3,.7,.2,1);
}
.tl-l, .tl-r { position: absolute; top: 32px; font-size: 10px; color: var(--muted); letter-spacing: .05em; }
.tl-l { left: 0; } .tl-r { right: 0; }

.eras {
  position: fixed; top: 100px; left: 50%; transform: translateX(-50%); z-index: 9;
  display: flex; border: 1px solid var(--line);
}
.eras button {
  width: 103px; height: 40px; font-size: 14px; color: var(--paper);
  border-left: 1px solid var(--line); transition: background .3s, color .3s;
}
.eras button:first-child { border-left: 0; }
.eras button:hover { background: rgba(255,255,255,.06); }
.eras button.on { background: var(--accent); color: #2a1d10; }

.view { position: fixed; inset: 0; opacity: 0; visibility: hidden; transition: opacity .5s, visibility .5s; }
.view.on { opacity: 1; visibility: visible; }

/* ---------- 书架 ---------- */
.shelf-wrap { position: absolute; left: 0; right: 0; top: 190px; height: 340px; perspective: 1400px; }
.shelf { position: absolute; inset: 0; }
.plank {
  position: absolute; left: 0; right: 0; bottom: 0; height: 2px;
  background: rgba(239,230,210,.35); box-shadow: 0 18px 40px rgba(0,0,0,.35);
}
.spine {
  position: absolute; bottom: 2px; transform-origin: bottom center; cursor: pointer;
  transition: left .55s cubic-bezier(.3,.7,.2,1), width .55s cubic-bezier(.3,.7,.2,1),
              height .55s, transform .55s, opacity .4s;
  border-radius: 2px 2px 0 0; overflow: visible;
}
.spine.jump { transition: none; }
.spine:hover:not(.sel) { transform: translateY(-8px); }
.spine .face {
  position: absolute; inset: 0; overflow: hidden; border-radius: 2px 2px 0 0;
  box-shadow: inset -6px 0 10px rgba(0,0,0,.35), inset 3px 0 4px rgba(255,255,255,.12);
}
/* 线装古籍书脊 */
.spine.old .face { background-size: auto 100%; }
.spine.old .face::before {
  content: ''; position: absolute; inset: 0;
  background:
    linear-gradient(to bottom, transparent 18px, rgba(255,255,255,.75) 18px 19px, transparent 19px 24px, rgba(255,255,255,.6) 24px 25px, transparent 25px),
    linear-gradient(to top, transparent 18px, rgba(255,255,255,.75) 18px 19px, transparent 19px 24px, rgba(255,255,255,.6) 24px 25px, transparent 25px),
    linear-gradient(90deg, rgba(0,0,0,.25), rgba(0,0,0,0) 30%, rgba(0,0,0,.3));
}
.spine.old .label {
  position: absolute; left: 50%; top: 30%; transform: translateX(-50%);
  width: 62%; padding: 10px 0; background: #f2eadb; color: #1d1a14;
  box-shadow: 0 1px 2px rgba(0,0,0,.4);
  writing-mode: vertical-rl; font-family: var(--brush); font-size: clamp(16px, 1.7vw, 24px);
  display: flex; align-items: center; justify-content: flex-start; letter-spacing: .08em;
  line-height: 1;
}
/* 现代书脊 */
.spine.new .face { color: var(--ink); }
.spine.new .ttl {
  position: absolute; top: 18px; left: 0; right: 0; writing-mode: vertical-rl; margin: 0 auto;
  font-weight: 900; font-size: clamp(15px, 1.5vw, 22px); letter-spacing: .06em; line-height: 1;
}
.spine.new .au {
  position: absolute; left: 0; right: 0; bottom: 74px; writing-mode: vertical-rl; margin: 0 auto;
  font-size: 9px; opacity: .75; line-height: 1;
}
.spine.new .patch {
  position: absolute; left: 0; right: 0; bottom: 0; height: 64px; background-size: cover; background-position: center;
}
.spine.new .patch::after {
  content: '书脊'; position: absolute; left: 50%; top: 50%; transform: translate(-50%,-50%);
  width: 18px; height: 18px; background: var(--seal); color: #f5dccb; font-size: 5px;
  display: grid; place-items: center;
}
/* 选中：显示封面 */
.spine.sel { cursor: default; transform: rotateY(-10deg) rotateZ(-1deg); z-index: 3; }
.spine.sel .face { box-shadow: 0 30px 50px rgba(0,0,0,.45), inset -10px 0 14px rgba(0,0,0,.18); }
.spine .cover { position: absolute; inset: 0; opacity: 0; transition: opacity .45s .1s; background-size: cover; background-position: center; }
.spine.sel .cover { opacity: 1; }
.spine.sel .label, .spine.sel .ttl, .spine.sel .au, .spine.sel .patch { opacity: 0; }
.cover .c-label {
  position: absolute; left: 10%; top: 6%; width: 22%; height: 66%; padding: 10px 0;
  background: #f4ecdc; color: #18140e; border: 1px solid rgba(0,0,0,.25);
  box-shadow: inset 0 0 0 3px #f4ecdc, inset 0 0 0 4px rgba(0,0,0,.35);
  writing-mode: vertical-rl; font-family: var(--brush); font-size: 34px; line-height: 1;
  display: flex; align-items: center; justify-content: space-between; letter-spacing: .1em;
}
.cover .c-label small { font-size: 10px; font-family: var(--serif); opacity: .7; }
.cover .stitch {
  position: absolute; right: 7%; top: 0; bottom: 0; width: 1px; background: rgba(255,255,255,.8);
  box-shadow: 0 0 0 .5px rgba(0,0,0,.2);
}
.cover .stitch::before { content: ''; position: absolute; left: -4px; right: -4px; top: 10%; bottom: 10%;
  background: repeating-linear-gradient(to bottom, rgba(255,255,255,.8) 0 2px, transparent 2px 22%); }
.cover.modern { background-size: cover; }
.cover.modern .band {
  position: absolute; left: 0; right: 0; bottom: 0; height: 26%; padding: 14px 14px;
  display: flex; flex-direction: column; justify-content: space-between;
}
.cover.modern .band b { font-size: 24px; font-weight: 900; letter-spacing: .06em; }
.cover.modern .band span { font-size: 10px; display: flex; justify-content: space-between; opacity: .85; }
.cover.modern .band em { font-style: normal; }
.spine .open-tab {
  position: absolute; left: -30px; top: 56%; width: 30px; padding: 10px 0; background: var(--accent);
  color: #2a1d10; writing-mode: vertical-rl; font-size: 15px; letter-spacing: .3em;
  display: flex; align-items: center; opacity: 0; pointer-events: none; transition: opacity .3s .3s;
  box-shadow: -4px 4px 10px rgba(0,0,0,.25);
}
.spine.sel .open-tab { opacity: 1; pointer-events: auto; cursor: pointer; }
.spine .reflect {
  position: absolute; left: 0; right: 0; top: 100%; height: 30px; opacity: .14; pointer-events: none;
  background: inherit; filter: blur(6px);
}

.nav-btn {
  position: absolute; top: 548px; width: 44px; height: 44px; border: 1px solid var(--line);
  font-size: 18px; transition: background .3s;
}
.nav-btn:hover { background: rgba(255,255,255,.08); }
.nav-btn.prev { left: 24px; } .nav-btn.next { right: 24px; }
.caption { position: absolute; left: 0; right: 0; top: 548px; text-align: center; }
.caption h2 { font-family: var(--brush); font-weight: 400; font-size: 44px; letter-spacing: .14em; }
.caption .py { margin-top: 6px; font-size: 12px; letter-spacing: .12em; color: var(--accent); }
.caption .meta { margin-top: 10px; font-size: 14px; color: var(--muted); letter-spacing: .06em; }
.hints {
  position: absolute; left: 24px; right: 24px; bottom: 22px; display: flex; justify-content: space-between;
  font-size: 12px; color: var(--muted);
}

/* ---------- 画廊 ---------- */
#galleryView { overflow-y: auto; padding: 160px 24px 60px; }
.masonry { columns: 4 280px; column-gap: 14px; }
.card {
  break-inside: avoid; margin-bottom: 14px; background: rgba(0,0,0,.18); cursor: pointer;
  opacity: 0; transform: translateY(24px); transition: opacity .7s, transform .7s;
}
.card.in { opacity: 1; transform: none; }
.card .img { background-size: cover; background-position: center; transition: filter .4s; }
.card:hover .img { filter: brightness(1.08); }
.card .foot { display: flex; align-items: center; gap: 12px; padding: 12px 14px; background: rgba(0,0,0,.22); }
.card .badge {
  flex: 0 0 30px; height: 30px; border-radius: 50%; background: var(--accent); color: #2a1d10;
  display: grid; place-items: center; font-size: 13px; font-weight: 600;
}
.card .txt { flex: 1; min-width: 0; }
.card .txt b { display: block; font-size: 14px; font-weight: 600; }
.card .txt span { display: block; font-size: 12px; color: var(--muted); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; margin-top: 2px; }
.card .yr { font-size: 12px; color: var(--muted); white-space: nowrap; }

/* ---------- 展卷 ---------- */
#reader {
  position: fixed; inset: 0; z-index: 30; background: #1b1310; visibility: hidden; opacity: 0;
  transition: opacity .35s, visibility .35s;
}
#reader.on { visibility: visible; opacity: 1; }
#mosaic { position: absolute; inset: 0; width: 100%; height: 100%; }
.r-shade { position: absolute; inset: 0; background: linear-gradient(90deg, rgba(20,12,8,.92) 0%, rgba(20,12,8,.72) 45%, rgba(20,12,8,.25) 100%); }
#reader.h .r-shade { background: linear-gradient(90deg, rgba(20,10,8,.25) 0%, rgba(20,10,8,.7) 40%, rgba(20,10,8,.9) 100%); }
.r-stage { position: absolute; inset: 0; clip-path: inset(0 50% 0 50%); }
#reader.unrolled .r-stage { clip-path: inset(0 0 0 0); transition: clip-path 1.2s cubic-bezier(.6,.05,.25,1); }

.rods { position: absolute; inset: 0; pointer-events: none; }
.rod {
  position: absolute; top: 0; bottom: 0; width: 8px; left: 50%; margin-left: -4px;
  background: linear-gradient(90deg, #4a2a14, #8a5a30 50%, #3a200e); transition: left 1.2s cubic-bezier(.6,.05,.25,1), opacity .5s;
}
.rod::before, .rod::after {
  content: ''; position: absolute; left: -6px; width: 20px; height: 24px; border-radius: 4px;
  background: linear-gradient(90deg, #cfc4a6, #f4eedc, #bdb08e);
}
.rod::before { top: 0; } .rod::after { bottom: 0; }
#reader.unrolled .rod:first-child { left: 0; }
#reader.unrolled .rod:last-child { left: 100%; }
#reader.unrolled .rods { opacity: 0; transition: opacity .5s 1.1s; }

.r-close {
  position: absolute; top: 20px; left: 24px; z-index: 2; padding: 10px 18px;
  border: 1px solid var(--line); background: rgba(0,0,0,.25); font-size: 15px;
}
.r-close small { margin-left: 8px; font-size: 11px; color: var(--muted); }
.r-nav { position: absolute; top: 20px; right: 24px; z-index: 2; display: flex; align-items: center; gap: 14px; font-size: 15px; color: var(--muted); }
.r-nav button { width: 44px; height: 40px; border: 1px solid var(--line); background: rgba(0,0,0,.25); color: var(--paper); font-size: 16px; }
.r-nav button:hover, .r-close:hover { background: rgba(255,255,255,.1); }
.r-paint { position: absolute; right: 24px; bottom: 16px; font-size: 12px; color: rgba(239,230,210,.75); letter-spacing: .06em; }
#reader.h .r-paint { right: auto; left: 8px; }

.r-book { position: absolute; inset: 0; opacity: 0; transition: opacity .5s; }
.r-book.show { opacity: 1; }
.num {
  position: absolute; font-family: var(--brush); font-size: 220px; line-height: 1; color: transparent;
  -webkit-text-stroke: 1.2px rgba(239,230,210,.4); pointer-events: none; white-space: nowrap;
}
.stamp {
  position: absolute; width: 66px; height: 66px; background: var(--seal); color: #f6dfcf;
  display: grid; grid-template-columns: 1fr 1fr; place-items: center; padding: 6px;
  font-family: var(--brush); font-size: 17px; line-height: 1; transform: rotate(-6deg);
  box-shadow: inset 0 0 0 3px rgba(255,255,255,.18); opacity: .9;
}

/* 竖排 */
.v-wrap {
  position: absolute; top: 120px; bottom: 80px; right: 4vw; left: 4vw;
  display: flex; flex-direction: row-reverse; align-items: flex-start; gap: 26px;
}
.v-wrap .bk { flex: 0 0 auto; width: min(290px, 22vw); aspect-ratio: 3/4.4; position: relative; margin-left: 30px; box-shadow: 0 30px 60px rgba(0,0,0,.5); }
.v-col { writing-mode: vertical-rl; flex: 0 0 auto; }
.v-who { font-size: 14px; color: var(--accent); letter-spacing: .3em; }
.v-who span { margin-top: 1em; display: inline-block; color: var(--muted); }
.v-title {
  font-family: var(--brush); font-size: clamp(56px, 7vw, 96px); line-height: 1.05; letter-spacing: .05em;
  border: 1px solid rgba(217,183,122,.45); padding: 14px 8px;
}
.v-meta { font-size: 14px; color: var(--muted); letter-spacing: .3em; }
.v-meta i { font-style: normal; display: inline-block; margin-top: 1.6em; }
.v-quote { font-family: var(--brush); font-size: clamp(26px, 2.4vw, 36px); color: var(--accent); letter-spacing: .12em; max-height: 64vh; line-height: 1.35; }
.v-src { font-size: 13px; color: var(--muted); letter-spacing: .2em; }
.v-lbl { font-size: 13px; color: var(--muted); letter-spacing: .4em; }
.v-intro {
  height: min(470px, 62vh); font-size: 17px; line-height: 2.3; letter-spacing: .14em; color: rgba(239,230,210,.92);
  background: repeating-linear-gradient(to left, transparent 0 calc(2.3em - 1px), rgba(239,230,210,.18) calc(2.3em - 1px) 2.3em);
  text-indent: 2em; text-align: justify;
}

/* 横排 */
.h-wrap {
  position: absolute; top: 110px; bottom: 70px; left: 4vw; right: 6vw;
  display: grid; grid-template-columns: min(320px, 26vw) 1fr; gap: 5vw; align-items: start;
}
.h-wrap .bk { position: relative; aspect-ratio: 3/4.6; margin-top: 40px; box-shadow: 0 30px 60px rgba(0,0,0,.55); }
.h-text { max-width: 600px; padding-top: 20px; }
.h-who { font-size: 14px; color: var(--muted); letter-spacing: .3em; }
.h-title { display: flex; flex-wrap: wrap; margin: 18px 0 14px; }
.h-title span {
  font-size: clamp(44px, 5vw, 66px); font-weight: 900; width: 1.3em; height: 1.3em; display: grid; place-items: center;
  border: 1px solid rgba(217,183,122,.4); margin-left: -1px;
}
.h-meta { font-size: 13px; color: var(--muted); letter-spacing: .25em; }
.h-quote { margin: 34px 0 40px; font-size: clamp(20px, 2vw, 28px); font-weight: 600; color: var(--accent); letter-spacing: .06em; }
.h-lbl { font-size: 13px; color: var(--muted); letter-spacing: .3em; margin-bottom: 18px; }
.h-intro {
  font-size: 17px; line-height: 2.1; letter-spacing: .05em; text-indent: 2em; text-align: justify;
  background: repeating-linear-gradient(to bottom, transparent 0 calc(2.1em - 1px), rgba(239,230,210,.15) calc(2.1em - 1px) 2.1em);
}

/* 展卷中的书 */
.bk .cover { opacity: 1; }
.bk .cover.modern .band b { font-size: 30px; }
.bk .cover .c-label { font-size: 42px; }

@media (max-width: 760px) {
  #top { grid-template-columns: 1fr auto; height: 64px; padding: 0 16px; }
  .timeline { display: none; }
  .count { font-size: 12px; }
  .eras { top: 70px; width: calc(100% - 32px); overflow-x: auto; }
  .eras button { width: auto; flex: 0 0 auto; padding: 0 14px; }
  .shelf-wrap { top: 140px; height: 300px; }
  .nav-btn, .caption { top: 470px; }
  .nav-btn.prev { left: 16px; } .nav-btn.next { right: 16px; }
  .caption h2 { font-size: 34px; }
  .caption .meta { font-size: 12px; padding: 0 70px; }
  .hints span:last-child { display: none; }
  #galleryView { padding: 130px 16px 40px; }
  .r-stage { overflow-y: auto; }
  .v-wrap, .h-wrap { position: relative; inset: auto; padding: 90px 16px 60px; display: flex; flex-direction: column; gap: 22px; height: auto; }
  .v-wrap .bk, .h-wrap .bk { width: 60%; margin: 0; }
  .v-col { writing-mode: horizontal-tb; }
  .v-intro { height: auto; background: none; }
  .v-title { font-size: 54px; padding: 6px 12px; align-self: flex-start; }
  .v-quote { max-height: none; }
  .num { font-size: 120px; }
  .stamp { display: none; }
}

/* ---------- 正文入口（导读页） ---------- */
.t-entries { display: flex; gap: 12px; align-items: center; }
.t-entries.v { writing-mode: vertical-rl; flex-direction: column; }
.t-entries.h { margin-top: 34px; flex-wrap: wrap; }
.t-entry {
  padding: 12px 18px; background: var(--accent); color: #2a1d10; font-size: 15px; letter-spacing: .3em;
  box-shadow: 0 6px 18px rgba(0,0,0,.3); transition: transform .25s, filter .25s;
}
.t-entries.v .t-entry { padding: 18px 10px; }
.t-entry:hover { transform: translateY(-2px); filter: brightness(1.06); }
.t-entry.ghost { background: none; color: var(--muted); border: 1px solid var(--line); box-shadow: none; font-size: 13px; letter-spacing: .15em; }
.t-entry.ghost:hover { color: var(--paper); }
.t-note { font-size: 12px; color: var(--muted); letter-spacing: .05em; }

/* ---------- 正文阅读 ---------- */
#tView { position: absolute; inset: 0; z-index: 3; opacity: 0; visibility: hidden; transition: opacity .45s, visibility .45s; }
#reader.t-on #tView { opacity: 1; visibility: visible; }
#reader.t-on .r-stage, #reader.t-on .r-close, #reader.t-on .r-nav, #reader.t-on .r-paint { opacity: 0; pointer-events: none; }
.r-stage, .r-close, .r-nav, .r-paint { transition: opacity .4s; }
#reader.t-on .r-shade { background: rgba(18, 11, 8, .86); transition: background .6s; }

.t-top {
  position: absolute; top: 20px; left: 24px; right: 24px; display: grid; grid-template-columns: 1fr auto 1fr; align-items: center;
}
.t-btn {
  padding: 9px 16px; border: 1px solid var(--line); background: rgba(0,0,0,.25); font-size: 14px; transition: background .25s;
}
.t-btn:hover { background: rgba(255,255,255,.1); }
.t-btn small { margin-left: 8px; font-size: 11px; color: var(--muted); }
.t-top > .t-btn { justify-self: start; }
.t-tools { justify-self: end; display: flex; gap: 8px; }
.t-head { text-align: center; line-height: 1.5; }
.t-head b { display: block; font-family: var(--brush); font-weight: 400; font-size: 24px; letter-spacing: .16em; }
.t-head span { font-size: 12px; color: var(--accent); letter-spacing: .12em; }

.t-page {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -46%); overflow: hidden; cursor: pointer;
}
.t-flow { position: absolute; top: 0; transition: transform .55s cubic-bezier(.3,.7,.2,1), opacity .3s; color: rgba(239,230,210,.93); }
.t-flow.fade { opacity: 0; }
#tView.v .t-flow {
  right: 0; writing-mode: vertical-rl; font-size: var(--fs); line-height: var(--lh); letter-spacing: .12em;
  background: repeating-linear-gradient(to left, transparent 0 calc(var(--lh) - 1px), rgba(239,230,210,.12) calc(var(--lh) - 1px) var(--lh));
}
#tView.h .t-flow {
  left: 0; font-size: var(--fs); line-height: var(--lh); letter-spacing: .04em; text-align: justify;
}
.t-flow p { margin: 0; text-indent: 2em; }
.t-flow p.gap { text-indent: 0; }
.t-flow h3, .t-flow h4 { margin: 0; font-weight: 400; color: var(--accent); text-indent: 0; }
.t-flow h3 { font-family: var(--brush); font-size: calc(var(--fs) * 1.5); line-height: calc(var(--lh) * 2); letter-spacing: .14em; }
.t-flow h4 { font-weight: 600; line-height: var(--lh); }
#tView.h .t-flow h3, #tView.h .t-flow h4 { break-after: avoid; }
.t-flow h3 + p, .t-flow h4 + p { text-indent: 2em; }

.t-turn {
  position: absolute; top: 50%; width: 44px; height: 44px; margin-top: -22px; border: 1px solid var(--line);
  background: rgba(0,0,0,.25); font-size: 18px; transition: background .25s;
}
.t-turn:hover { background: rgba(255,255,255,.1); }
.t-turn.l { left: 24px; } .t-turn.r { right: 24px; }

.t-foot {
  position: absolute; left: 24px; right: 24px; bottom: 18px; display: grid; grid-template-columns: 1fr minmax(120px, 360px) 1fr;
  gap: 18px; align-items: center; font-size: 12px; color: var(--muted); letter-spacing: .06em;
}
.t-src { justify-self: end; }
.t-bar { height: 2px; background: var(--line); position: relative; }
.t-bar b { position: absolute; left: 0; top: 0; bottom: 0; background: var(--accent); transition: width .4s; }

.t-toc {
  position: absolute; top: 0; right: 0; bottom: 0; width: min(340px, 86vw); padding: 26px 0 26px 26px;
  background: rgba(22,14,10,.97); border-left: 1px solid var(--line); transform: translateX(105%);
  transition: transform .45s cubic-bezier(.3,.7,.2,1); display: flex; flex-direction: column; z-index: 4;
}
.t-toc.on { transform: none; box-shadow: -20px 0 50px rgba(0,0,0,.4); }
.t-toc-h { font-family: var(--brush); font-size: 26px; letter-spacing: .3em; margin-bottom: 16px; }
.t-toc ol { list-style: none; overflow-y: auto; padding-right: 20px; }
.t-toc li {
  padding: 10px 2px; border-bottom: 1px solid rgba(239,230,210,.1); font-size: 14px; color: var(--muted); cursor: pointer;
  line-height: 1.5; transition: color .2s;
}
.t-toc li:hover { color: var(--paper); }
.t-toc li.on { color: var(--accent); }

.t-msg {
  position: absolute; left: 50%; bottom: 60px; transform: translateX(-50%); padding: 8px 18px; font-size: 13px;
  background: rgba(0,0,0,.6); border: 1px solid var(--line); opacity: 0; transition: opacity .3s; pointer-events: none;
}
.t-msg.on { opacity: 1; }

@media (max-width: 760px) {
  .t-top { top: 12px; left: 12px; right: 12px; }
  .t-head b { font-size: 18px; }
  .t-btn { padding: 7px 10px; font-size: 13px; }
  .t-btn small { display: none; }
  .t-turn { display: none; }
  .t-foot { left: 16px; right: 16px; grid-template-columns: 1fr; text-align: center; }
  .t-src { display: none; }
  .t-entries.v { writing-mode: horizontal-tb; flex-direction: row; }
  .t-entries.v .t-entry { padding: 12px 18px; }
}
#reader.t-on .rods { opacity: 0; transition: opacity .3s; }
