/* TenImper editorial reader — visual layer for existing chapter templates.
   No content, routing, controls, or reader preference logic is changed. */
.chapter-hero {
  --ti-paper:#f2e6d3; --ti-ink:#261f1c; --ti-cinnabar:#91392e;
  position:relative; isolation:isolate; overflow:hidden;
  max-width:1480px; margin:clamp(16px,3vw,46px) auto 0;
  border:1px solid #b892604f; border-radius:28px 28px 9px 9px;
  background:#171716; box-shadow:0 22px 55px #17100b26;
}
.chapter-hero .chapter-hero-media {position:relative;overflow:hidden;min-height:clamp(420px,49vw,680px)}
.chapter-hero .chapter-hero-media::after {content:"";position:absolute;inset:0;pointer-events:none;background:linear-gradient(90deg,transparent 50%,#15141377 100%),linear-gradient(0deg,#17141173,transparent 56%)}
.chapter-hero .chapter-hero-media img {width:100%;height:100%;object-fit:cover;display:block}
.chapter-hero .chapter-hero-copy {
  position:relative;z-index:1;color:var(--ti-ink);padding:clamp(32px,5vw,78px);
  background:radial-gradient(circle at 90% 90%,#b89e7840,transparent 34%),
    repeating-linear-gradient(104deg,#fff9e82b 0 2px,transparent 2px 7px),var(--ti-paper);
}
.chapter-hero .chapter-hero-copy::before {
  content:"影";display:grid;place-items:center;width:42px;height:42px;
  margin-bottom:clamp(24px,4vw,56px);background:var(--ti-cinnabar);
  color:#f6dfc5;font-family:serif;font-size:25px;box-shadow:2px 3px 0 #623027;
}
.chapter-hero .chapter-hero-copy::after {content:"";position:absolute;inset:12px;pointer-events:none;border:1px solid #99734a29}
.chapter-hero .eyebrow {color:var(--ti-cinnabar);letter-spacing:.22em;text-transform:uppercase}
.chapter-hero h1 {font-family:Georgia,"Times New Roman",serif;letter-spacing:-.035em;line-height:1.13;text-wrap:balance}
.chapter-hero .meta {border-top:1px solid #a8855f57;padding-top:18px}
.reader-surface {--ti-paper:#f3e8d6;--ti-ink:#2b251f}
.reader-surface[data-reader-theme="scroll"] .reader-stage,
.reader-surface[data-reader-theme="light"] .reader-stage {
  background-image:radial-gradient(circle at 0 0,#bca17d1d,transparent 32%),
    radial-gradient(circle at 100% 100%,#bca17d20,transparent 28%);
}
.reader-surface .reader-stage {position:relative}
.reader-surface .chapter-body {position:relative;max-width:min(100% - 40px,790px);margin-inline:auto}
.reader-surface .chapter-body::before {content:"";position:absolute;left:-22px;top:0;bottom:0;border-left:1px solid #99734a35;pointer-events:none}
.reader-surface .reader-toggle,.reader-surface .bookmark-toggle {border-color:#9f754b80}
.reader-surface .reader-panel {box-shadow:0 24px 70px #170e0955}
.chapter-nav__link {transition:transform .18s ease,box-shadow .18s ease}
.chapter-nav__link:hover {transform:translateY(-3px);box-shadow:0 12px 30px #3c241326}
@media(min-width:900px){
  .chapter-hero {display:grid;grid-template-columns:minmax(0,1.08fr) minmax(440px,.92fr)}
  .chapter-hero .chapter-hero-media {height:clamp(540px,48vw,720px)}
  .chapter-hero .chapter-hero-copy {display:flex;flex-direction:column;justify-content:center}
  .chapter-hero .chapter-hero-copy::after {inset:18px}
}
@media(max-width:899px){
  .chapter-hero {margin:0;border-radius:0 0 20px 20px}
  .chapter-hero .chapter-hero-media {min-height:0;height:clamp(270px,62vw,510px)}
  .chapter-hero .chapter-hero-copy {margin:-24px 12px 0;padding:28px 25px 34px;border-radius:2px 2px 16px 16px}
  .chapter-hero .chapter-hero-copy::before {width:34px;height:34px;font-size:21px;margin-bottom:20px}
  .chapter-hero h1 {font-size:clamp(30px,7.8vw,52px)}
}
@media(max-width:480px){
  .chapter-hero .chapter-hero-media {height:65vw;min-height:230px}
  .chapter-hero .chapter-hero-copy {margin-inline:8px;padding:24px 22px 30px}
  .reader-surface .chapter-body {max-width:calc(100% - 34px)}
  .reader-surface .chapter-body::before {left:-11px}
}
@media(prefers-reduced-motion:reduce){.chapter-nav__link{transition:none}}
