/* 历史旅人 — home: a text-free hero image, the brand block beneath it, then the shelf.
   Plus the #/chapters archive (timeline / grid, era·region·theme filters, search). */

/* ===================================================================== home */
.screen.home { background: var(--night); color: var(--paper); }

/* The hero is only the drawing: no title or tagline sits on top of it, so nothing
   covers the illustration. Its only overlay is the small album / language buttons. */
.screen.home .hero {
  position: relative; flex: 0 0 auto;
  height: calc(var(--ph, 100dvh) * .35);
  min-height: 198px; max-height: 330px; overflow: hidden;
  background: var(--night);
}
.screen.home .hero .hero-bg {
  position: absolute; inset: 0; width: 100%; height: 100%;
  object-fit: cover; object-position: 50% 40%;
  opacity: 0; filter: saturate(.30) contrast(1.10) brightness(.74);
  animation: none; transform: none; transition: opacity 1.2s ease;
}
.screen.home .hero .hero-bg.on { opacity: .16; }
.screen.home .hero .hero-art { position: absolute; inset: 0; width: 100%; height: 100%; display: block; z-index: 1; pointer-events: none; }
.screen.home .hero:after { content: none; }

.hero-actions { position: absolute; left: 14px; top: 14px; z-index: 3; display: flex; flex-direction: column; align-items: flex-start; gap: 7px; }
.hbtn {
  display: flex; align-items: center; gap: 6px; padding: 7px 11px; border-radius: 999px;
  border: 1px solid rgba(238,226,201,.22); background: rgba(7,11,20,.55); color: rgba(238,226,201,.84);
  font: 400 10.5px/1 var(--sans); letter-spacing: .06em; cursor: pointer; transition: .2s var(--ease);
  -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.hbtn:active { transform: scale(.95); background: rgba(201,162,75,.16); }
.hbtn b { font-family: var(--lat); font-weight: 400; color: var(--gold-2); font-size: 10px; }

/* the whole shelf scrolls; the hero stays */
.screen.home .shelf {
  flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 0 0 18px; background: var(--night);
}

/* ---- brand block: the title and tagline, on the page not on the picture ---- */
.brandblock { text-align: center; padding: 15px 24px 2px; }
.brandblock .brand {
  margin: 0; font-family: var(--serif); font-weight: 400;
  font-size: 27px; letter-spacing: .22em; color: var(--paper);
  text-indent: .22em;
}
.brandblock .brandk {
  margin-top: 5px; font-family: var(--lat); font-size: 8px;
  letter-spacing: .34em; color: rgba(226,192,122,.7); text-transform: uppercase;
}
.tagstrip { display: flex; flex-direction: column; gap: 4px; align-items: center; text-align: center; padding: 9px 0 0; }
.tagstrip .tz { font-family: var(--serif); font-size: 13px; line-height: 1.6; color: rgba(238,226,201,.82); }
.tagstrip .te { font-family: var(--lat); font-size: 8.5px; letter-spacing: .09em; line-height: 1.5; color: rgba(238,226,201,.38); }

/* ---- featured ---- */
.feat {
  position: relative; display: flex; gap: 13px; align-items: stretch;
  width: calc(100% - 32px); margin: 14px auto 2px; padding: 12px; text-align: left;
  color: var(--paper); cursor: pointer; overflow: hidden; border-radius: 3px;
  border: 1px solid rgba(201,162,75,.52);
  background:
    radial-gradient(120% 150% at 0% 0%, rgba(201,162,75,.2), rgba(201,162,75,.03) 60%),
    linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0));
  box-shadow: 0 10px 30px rgba(0,0,0,.4), inset 0 0 0 1px rgba(201,162,75,.08);
  transition: .2s var(--ease);
}
.feat:active { transform: scale(.99); border-color: rgba(226,192,122,.85); }
.ft-art { position: relative; flex: 0 0 96px; width: 96px; overflow: hidden; border: 1px solid rgba(201,162,75,.4); background: #0d1119; border-radius: 2px; }
.ft-art canvas { width: 100%; height: 100%; display: block; }
.ft-tag { position: absolute; left: 6px; top: 6px; padding: 2px 6px; border: 1px solid rgba(226,192,122,.7); background: rgba(7,11,20,.78); font: 400 7px/1.3 var(--lat); letter-spacing: .2em; color: var(--gold-2); }
/* QA: the year is primary navigation — keep it legible (was 9px) */
.ft-yr { position: absolute; right: 6px; bottom: 6px; font: 600 13px/1 var(--lat); letter-spacing: .04em; color: #f4e2b6; text-shadow: 0 1px 5px #000; }
.ft-main { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.ft-k { font-family: var(--lat); font-size: 7.5px; letter-spacing: .24em; color: var(--gold); text-transform: uppercase; }
.ft-person { font-family: var(--serif); font-size: 12px; color: rgba(238,226,201,.66); margin-top: 5px; }
.ft-title { font-family: var(--serif); font-size: 17px; letter-spacing: .02em; margin-top: 3px; line-height: 1.26; }
.ft-sub { font-size: 10.5px; line-height: 1.5; color: rgba(238,226,201,.52); margin-top: 5px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.ft-row { margin-top: auto; padding-top: 9px; display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.ft-meta { font-family: var(--lat); font-size: 9px; letter-spacing: .08em; color: rgba(238,226,201,.44); }
.ft-cta { display: inline-flex; align-items: center; gap: 5px; padding: 6px 12px; border-radius: 999px; background: var(--gold); color: #22180a; font: 400 11.5px/1 var(--serif); letter-spacing: .08em; }
.ft-cta i { font-style: normal; font-size: 12px; }

/* ---- sections ---- */
.sec { margin-top: 14px; }
.sech { display: flex; align-items: baseline; justify-content: space-between; padding: 0 18px 8px; }
.sech span { font-family: var(--lat); font-size: 8.5px; letter-spacing: .26em; color: var(--gold); text-transform: uppercase; }
.sech i { font-style: normal; font-size: 8.5px; letter-spacing: .08em; color: rgba(238,226,201,.4); }
/* QA: tell the reader the two orderings differ (release vs historical year) */
.sechint { padding: 0 18px 6px; margin-top: -4px; font: 400 10px/1.5 var(--sans); color: rgba(238,226,201,.4); }

/* continue journey */
.controw { display: flex; gap: 8px; align-items: stretch; padding: 0 18px 8px; }
.ct-main { flex: 1; min-width: 0; text-align: left; padding: 10px 12px; border-radius: 2px; cursor: pointer; color: var(--paper);
  border: 1px solid rgba(238,226,201,.14); background: linear-gradient(180deg, rgba(255,255,255,.035), rgba(255,255,255,0)); transition: .2s var(--ease); }
.ct-main:active { transform: scale(.985); border-color: rgba(201,162,75,.5); }
.ct-main b { display: block; font-family: var(--serif); font-weight: 400; font-size: 14px; }
.ct-main i { display: block; font-style: normal; font-size: 11px; color: rgba(238,226,201,.56); margin-top: 3px; }
.ct-main span { display: block; font-family: var(--lat); font-size: 8.5px; letter-spacing: .14em; color: var(--gold); margin-top: 5px; text-transform: uppercase; }
.ct-again { flex: 0 0 auto; padding: 0 12px; border-radius: 2px; cursor: pointer; color: rgba(238,226,201,.6);
  border: 1px solid rgba(238,226,201,.14); background: transparent; font: 400 11px/1 var(--sans); letter-spacing: .06em; }
.ct-again:active { transform: scale(.95); color: var(--gold-2); }

/* recent grid */
.epgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; padding: 0 18px; }
.tile { display: block; width: 100%; padding: 0; text-align: left; color: var(--paper); cursor: pointer; overflow: hidden; border-radius: 2px;
  border: 1px solid rgba(238,226,201,.13); background: #0d1424; transition: .22s var(--ease); }
.tile:active { transform: scale(.975); border-color: rgba(201,162,75,.55); }
.tile.done { border-color: rgba(201,162,75,.3); }
.tile .tl-thumb { position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; }
.tile .tl-thumb canvas { width: 100%; height: 100%; display: block; }
.tile .tl-caption { position: absolute; left: 0; right: 0; bottom: 0; padding: 24px 9px 8px;
  background: linear-gradient(0deg, rgba(4,6,12,.95) 30%, rgba(4,6,12,.5) 66%, rgba(4,6,12,0) 100%); }
.tile .tl-caption b { font-family: var(--serif); font-weight: 400; font-size: 12.5px; line-height: 1.3; letter-spacing: .02em; color: rgba(247,239,217,.96);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
/* QA: card year was 8px — the main locator, now 13px and brighter */
.tile .tl-caption i { display: block; font-style: normal; font-family: var(--lat); font-weight: 600; font-size: 13px; letter-spacing: .02em; color: #f0d79b; margin-top: 4px; }
.tl-done { position: absolute; right: 7px; top: 6px; z-index: 2; width: 17px; height: 17px; border-radius: 50%; display: grid; place-items: center; background: rgba(226,192,122,.92); color: #1d1508; font-size: 10px; line-height: 1; }

/* view all + timeline preview */
.alllink { display: flex; flex-direction: column; gap: 8px; width: calc(100% - 32px); margin: 16px auto 4px; padding: 13px 6px 8px; cursor: pointer; color: var(--paper);
  border: 1px solid rgba(201,162,75,.34); border-radius: 3px; background: rgba(201,162,75,.05); transition: .2s var(--ease); }
.alllink:active { transform: scale(.99); background: rgba(201,162,75,.1); }
.alllink .al-t { font-family: var(--serif); font-size: 14px; letter-spacing: .04em; color: rgba(247,239,217,.95); padding-left: 8px; }
.alllink .al-t b { color: var(--gold-2); font-weight: 400; }
/* the canvas is sized by JS at CSS-width × DPR; it must not be stretched by CSS */
.alllink .al-tl { display: block; width: 100%; height: 52px; }

.shelfend { text-align: center; padding: 14px 24px 4px; font: 400 9.5px/1.6 var(--sans); letter-spacing: .04em; color: rgba(238,226,201,.34); }

/* ================================================================= archive */
.screen.chapters { background: var(--night); color: var(--paper); }
.archead { display: flex; align-items: center; gap: 10px; padding: 14px 14px 8px; flex: 0 0 auto; }
.archead .iconbtn { border-color: rgba(238,226,201,.35); color: var(--paper); }
.archead .ah-t { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.archead .ah-t b { font-family: var(--serif); font-weight: 400; font-size: 18px; letter-spacing: .04em; }
.archead .ah-t span { font-family: var(--lat); font-size: 8.5px; letter-spacing: .14em; color: rgba(238,226,201,.44); margin-top: 2px; }
.archead .lang { font-family: var(--lat); font-size: 11px; letter-spacing: .14em; color: rgba(238,226,201,.55); background: none; border: 0; cursor: pointer; padding: 6px; }

.arcctl { display: flex; gap: 8px; align-items: center; padding: 2px 14px 8px; flex: 0 0 auto; }
.seg { display: inline-flex; flex: 0 0 auto; border: 1px solid rgba(238,226,201,.18); border-radius: 999px; overflow: hidden; }
.seg button { padding: 7px 13px; background: transparent; color: rgba(238,226,201,.6); border: 0; font: 400 10.5px/1 var(--sans); letter-spacing: .06em; cursor: pointer; }
.seg button.on { background: var(--gold); color: #22180a; }
.q { flex: 1; min-width: 0; padding: 9px 12px; border-radius: 999px; border: 1px solid rgba(238,226,201,.18); background: rgba(255,255,255,.03); color: var(--paper); font: 400 12px/1 var(--sans); letter-spacing: .02em; outline: none; }
.q::placeholder { color: rgba(238,226,201,.34); }
.q:focus { border-color: rgba(201,162,75,.6); }

.chips { display: flex; flex-wrap: wrap; gap: 6px; padding: 0 14px 8px; flex: 0 0 auto; }
.chipgrp { display: flex; gap: 6px; }
.chipgrp + .chipgrp { margin-left: 2px; padding-left: 8px; border-left: 1px solid rgba(238,226,201,.12); }
.chip { padding: 6px 11px; border-radius: 999px; border: 1px solid rgba(238,226,201,.18); background: transparent; color: rgba(238,226,201,.66); font: 400 10.5px/1 var(--sans); letter-spacing: .04em; cursor: pointer; transition: .16s var(--ease); white-space: nowrap; }
.chip:active { transform: scale(.94); }
.chip.on { background: rgba(201,162,75,.18); border-color: var(--gold); color: var(--gold-2); }

.arcbar { display: flex; align-items: center; justify-content: space-between; padding: 2px 18px 8px; flex: 0 0 auto; }
.arcbar .cnt { font-family: var(--lat); font-size: 10px; letter-spacing: .14em; color: rgba(238,226,201,.5); }
.arcbar .clear { background: none; border: 0; color: var(--gold); font: 400 11px/1 var(--sans); letter-spacing: .06em; cursor: pointer; padding: 4px 2px; }

.arclist { flex: 1; min-height: 0; overflow-y: auto; -webkit-overflow-scrolling: touch; padding: 2px 14px 20px; }

/* timeline rows — the whole row is the tap target, ≥72px tall (QA) */
.arclist.timeline .aro {
  position: relative; display: grid; grid-template-columns: 60px 14px 72px 1fr auto; align-items: center; gap: 8px;
  width: 100%; min-height: 76px; padding: 12px 6px; text-align: left; color: var(--paper); cursor: pointer; background: transparent; border: 0;
  border-bottom: 1px solid rgba(238,226,201,.08); transition: .16s var(--ease);
}
.arclist.timeline .aro:active { background: rgba(201,162,75,.06); }
/* QA: archive timeline year was 11px — now 14px, the primary locator */
.aro-yr { font-family: var(--lat); font-size: 14px; font-weight: 600; letter-spacing: .02em; color: #f0d79b; text-align: right; line-height: 1.25; }
.aro-line { position: relative; align-self: stretch; }
.aro-line i { position: absolute; left: 50%; top: 0; bottom: 0; width: 1px; background: rgba(201,162,75,.24); transform: translateX(-50%); }
.aro-line:before { content: ""; position: absolute; left: 50%; top: 50%; width: 8px; height: 8px; margin: -4px 0 0 -4px; border-radius: 50%; background: var(--gold); box-shadow: 0 0 8px rgba(201,162,75,.5); }
.aro.done .aro-line:before { background: var(--gold-2); }
.aro.new .aro-line:before { background: rgba(201,162,75,.4); box-shadow: none; }
.aro-art { width: 72px; height: 72px; border-radius: 2px; border: 1px solid rgba(201,162,75,.28); background: #0d1119; }
.aro-body { min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.aro-p { font-family: var(--serif); font-size: 13px; color: rgba(238,226,201,.72); display: flex; align-items: center; gap: 6px; }
.aro-p em { font-style: normal; font-family: var(--lat); font-size: 7px; letter-spacing: .18em; color: var(--gold-2); border: 1px solid rgba(226,192,122,.5); padding: 1px 4px; }
.aro-t { font-family: var(--serif); font-size: 15px; letter-spacing: .02em; line-height: 1.24; }
.aro-m { font-size: 9.5px; color: rgba(238,226,201,.42); line-height: 1.4; }
.aro-s { font-family: var(--lat); font-size: 8px; letter-spacing: .12em; color: var(--gold); text-transform: uppercase; margin-top: 2px; }
.aro-go { font-family: var(--serif); font-size: 11px; color: var(--gold-2); padding-left: 4px; white-space: nowrap; }

/* grid cards */
.arclist.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; align-content: start; }
.arc { display: flex; flex-direction: column; text-align: left; padding: 0; color: var(--paper); cursor: pointer; overflow: hidden; border-radius: 2px;
  border: 1px solid rgba(238,226,201,.13); background: #0d1424; transition: .2s var(--ease); }
.arc:active { transform: scale(.98); border-color: rgba(201,162,75,.5); }
.arc-art { position: relative; width: 100%; aspect-ratio: 1 / 1; overflow: hidden; }
.arc-art canvas { width: 100%; height: 100%; display: block; }
.arc-new { position: absolute; left: 7px; top: 7px; padding: 2px 5px; border: 1px solid rgba(226,192,122,.6); background: rgba(7,11,20,.74); font: 400 7px/1.3 var(--lat); letter-spacing: .2em; color: var(--gold-2); }
.arc-body { padding: 9px 10px 10px; display: flex; flex-direction: column; gap: 3px; flex: 1; }
.arc-p { font-family: var(--serif); font-size: 11.5px; color: rgba(238,226,201,.64); }
.arc-t { font-family: var(--serif); font-size: 13.5px; letter-spacing: .02em; line-height: 1.28; }
.arc-m { font-size: 9.5px; color: rgba(238,226,201,.44); }
.arc-m b { color: #f0d79b; font-weight: 600; font-size: 13px; font-family: var(--lat); }
.arc-th { display: flex; flex-wrap: wrap; gap: 4px; margin-top: 1px; }
.arc-th i { font-style: normal; font-size: 8px; letter-spacing: .04em; color: rgba(238,226,201,.56); border: 1px solid rgba(238,226,201,.16); border-radius: 999px; padding: 2px 7px; }
.arc-f { margin-top: auto; padding-top: 7px; display: flex; align-items: center; justify-content: space-between; gap: 6px; }
.arc-f span { font-family: var(--lat); font-size: 7.5px; letter-spacing: .1em; color: rgba(238,226,201,.4); text-transform: uppercase; }
.arc-f b { font-family: var(--serif); font-size: 11px; font-weight: 400; color: var(--gold-2); }
.arc.done .arc-f b { color: var(--gold); }

.arcnone { padding: 40px 24px; text-align: center; display: flex; flex-direction: column; gap: 16px; }
.arcnone p { font-family: var(--serif); font-size: 14px; color: rgba(238,226,201,.56); }

@media (prefers-reduced-motion: reduce) { .screen.home .hero .hero-art { opacity: .9; } }
@media (max-height: 700px) {
  .screen.home .hero { height: calc(var(--ph, 100dvh) * .30); min-height: 172px; }
  .brandblock { padding-top: 11px; }
  .brandblock .brand { font-size: 23px; }
  .tagstrip .tz { font-size: 12px; }
  .ft-art { flex-basis: 84px; width: 84px; }
}
