/* 历史旅人 — third episode + scrollable shelf + QA feedback polish */

/* ============================================================ home shelf */

#phone { --ph: min(100dvh, calc(100vw * 1.7778)); }

.screen.home {
  display: block;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  touch-action: pan-y;
}
.screen.home::-webkit-scrollbar { width: 0; height: 0; }

.home .hero {
  height: calc(var(--ph, 100dvh) * .40);
  min-height: 176px;
  flex: none;
}
.home .shelf { display: block; background: var(--night); }
.home .cards { padding: 12px 18px 6px; gap: 10px; }
.home .home-foot { position: static; margin-top: 4px; }

.card .t3 .new {
  display: inline-block; margin-left: 8px; padding: 1px 5px 0;
  border: 1px solid rgba(201,162,75,.55); color: var(--gold-2);
  font-size: 8px; letter-spacing: .18em; vertical-align: 1px; line-height: 1.5;
}
.home .card { position: relative; }
.home .card.done .t3 .new { opacity: .4; }

.shelfhint {
  display: flex; align-items: center; gap: 8px; justify-content: center;
  padding: 2px 0 10px; color: rgba(238,226,201,.3);
  font: 400 9px/1 var(--lat); letter-spacing: .26em; text-transform: uppercase;
}
.shelfhint:before, .shelfhint:after {
  content: ""; width: 26px; height: 1px; background: rgba(238,226,201,.16);
}

/* ======================================================= hokusai register */
/* QA P0: the two marks the paper must land on, drawn over the board. “Aligned” is
   shown only when the paper's own marks reach these, and an arrow shows the way. */
.hk .board { position: relative; }
.hk .regtarget {
  position: absolute; width: 16px; height: 16px; z-index: 2; pointer-events: none;
  border-left: 1.5px solid rgba(226,192,122,.85); border-top: 1.5px solid rgba(226,192,122,.85);
  transition: border-color .15s, box-shadow .15s;
}
.hk .regtarget.br { transform: rotate(180deg); }
.hk .regtarget.hit { border-color: rgba(120,220,150,.95); box-shadow: 0 0 8px rgba(120,220,150,.5); }
.hk .paperlayer { z-index: 3; transition: left .04s linear, top .04s linear; }
.hk .regarrow {
  position: absolute; left: 50%; top: 50%; width: 0; height: 0; opacity: 0;
  transition: opacity .2s; pointer-events: none;
  border-top: 7px solid transparent; border-bottom: 7px solid transparent;
  border-left: 14px solid rgba(226,192,122,.92);
  filter: drop-shadow(0 0 4px rgba(0,0,0,.5));
}
.hk .regok { color: #9fe6b4; }
.hk .regok.on { animation: regpop .3s var(--ease); }
@keyframes regpop { 0% { transform: translateX(-50%) scale(.6); } 100% { transform: translateX(-50%) scale(1); } }

/* ============================================================= zhang heng */

.zh { background: #0a0d12; color: var(--paper); }
.zh-head { flex: 0 0 auto; padding: 2px 22px 6px; text-align: center; }
.zh-head .kicker { color: var(--gold); font-size: 9px; }
.zh-t {
  font-family: var(--serif); font-weight: 400; font-size: 21px; letter-spacing: .1em;
  margin: 8px 0 6px;
}
.zh-p { font-size: 12.5px; line-height: 1.75; color: rgba(238,226,201,.62); margin: 0; }
.zh-p em { font-style: normal; color: var(--gold-2); }

.zh-stage { flex: 0 0 auto; display: grid; place-items: center; padding: 0 10px; }
.zh-stage svg.vessel { width: 100%; max-height: 42vh; display: block; overflow: visible; }

.zh-knobs {
  flex: 0 0 auto; display: flex; gap: 18px; justify-content: center;
  padding: 6px 18px 0;
}
.knob { display: flex; flex-direction: column; align-items: center; gap: 7px; touch-action: none; }
.knob .ktrack {
  position: relative; width: 46px; height: 84px; border-radius: 23px;
  background: linear-gradient(180deg, rgba(0,0,0,.55), rgba(201,162,75,.07));
  border: 1px solid rgba(201,162,75,.28);
  box-shadow: inset 0 0 18px rgba(0,0,0,.7);
}
.knob .kthumb {
  position: absolute; left: 50%; width: 38px; height: 30px; margin-left: -19px;
  border-radius: 8px;
  background: radial-gradient(circle at 36% 30%, #d9b46c, #8a6a35 62%, #4a3818);
  box-shadow: 0 3px 10px rgba(0,0,0,.6), inset 0 1px 0 rgba(255,255,255,.25);
  transition: transform .02s linear;
}
.knob .kthumb:after {
  content: ""; position: absolute; left: 4px; right: 4px; top: 13px; height: 1px;
  background: rgba(0,0,0,.35);
}
.knob span { font-size: 10px; letter-spacing: .1em; color: rgba(238,226,201,.5); }
.knob.glowing span { color: var(--gold-2); }
/* QA P0: per-foot hint — which screw is high, under its label */
.knob .kdir { font-size: 9px; letter-spacing: .04em; min-height: 12px; color: rgba(217,155,140,.9); transition: color .2s; }
.knob .kdir.ok { color: rgba(140,214,160,.95); }

.zh-meter { flex: 0 0 auto; margin: 12px 26px 0; height: 2px; background: rgba(238,226,201,.12); }
.zh-meter i {
  display: block; height: 100%; width: 0;
  background: var(--gold-2); box-shadow: 0 0 8px rgba(226,192,122,.7);
  transition: width .12s linear;
}
.zh-cue {
  flex: 0 0 auto; text-align: center; padding: 7px 18px 0;
  font-size: 11px; letter-spacing: .1em; color: rgba(238,226,201,.45); min-height: 20px;
}

/* --- vessel parts --- */
.vessel .body { fill: #4c3a1c; stroke: #2a1f0d; stroke-width: 1.1; }
.vessel .body-hi { fill: #6b5227; }
.vessel .rim { fill: #7d6031; stroke: #3a2c14; stroke-width: 1; }
.vessel .plinth { fill: #16130d; stroke: #33291a; stroke-width: 1; }
.vessel .toad { fill: #6a5330; stroke: #2f2412; stroke-width: 1; }
.vessel .toad.lit { fill: #c9a24b; }
.vessel .head { fill: #8a6a35; stroke: #33260f; stroke-width: 1; transition: fill .25s; }
.vessel .eye { fill: #f0d79c; }
.vessel .horn { fill: none; stroke: #33260f; stroke-width: 1.6; stroke-linecap: round; }
.vessel .jaw { stroke: #2a1f0d; stroke-width: 1.2; fill: none; }
.vessel .drg { cursor: default; transition: opacity .2s; }
.vessel .drg.pick { cursor: pointer; }
.vessel .drg.lit .head { fill: #d8b169; }
.vessel .drg.lit .jaw { transform: rotate(-16deg); transform-origin: 14px 0; }
.vessel .pearl { fill: #e8c887; stroke: #7a5c26; stroke-width: .8; }
.vessel .pearl.fall { transition: transform .85s cubic-bezier(.5,0,.75,.4), opacity .25s .8s; }
.vessel .pearl.gone { opacity: 0; }
.vessel .seated { fill: #e8c887; opacity: 0; }
.vessel .seated.on { opacity: 1; }
.vessel .ripple { fill: none; stroke: rgba(226,192,122,.5); stroke-width: 1; opacity: 0; }
.vessel .ripple.go { animation: rip 1.1s ease-out; }
@keyframes rip { 0% { opacity: .8; transform: scale(.55); } 100% { opacity: 0; transform: scale(1.35); } }
.vessel .plumb { stroke: rgba(238,226,201,.4); stroke-width: 1; stroke-dasharray: 2 3; }
.vessel .bob { fill: #e2c07a; }
.vessel .zone { fill: none; stroke: rgba(226,192,122,.55); stroke-width: 1; stroke-dasharray: 3 4; }
.vessel .zone.ok { stroke: rgba(140,214,160,.95); stroke-dasharray: none; }
.vessel .dlabel {
  font-family: "Songti SC","SimSun",serif; font-size: 11px; fill: rgba(238,226,201,.34);
  text-anchor: middle;
}
.zh-stage.shake { animation: zshake .32s linear; }
@keyframes zshake {
  0%,100% { transform: translate(0,0); }
  25% { transform: translate(-2px,1px); }
  50% { transform: translate(2px,-1px); }
  75% { transform: translate(-1px,-2px); }
}

/* --- disturbance choice --- */
.zh-acts { display: flex; gap: 10px; padding: 10px 18px 0; flex: 0 0 auto; }
.zh-acts .btn { flex: 1; }
.zh-read {
  flex: 0 0 auto; min-height: 34px; text-align: center; padding: 6px 22px 0;
  font-size: 11.5px; line-height: 1.5; color: rgba(238,226,201,.55); letter-spacing: .04em;
}
.zh-read b { color: var(--gold-2); font-weight: 400; }

/* --- compass --- */
.compass {
  position: relative; width: 100%; max-width: 300px; aspect-ratio: 1/1; margin: 0 auto;
  touch-action: none;
}
.compass svg { width: 100%; height: 100%; display: block; }
.zd {
  cursor: pointer; transition: opacity .2s;
}
.zd circle { fill: rgba(201,162,75,.08); stroke: rgba(201,162,75,.45); stroke-width: 1; }
.zd text { font-family: "Songti SC","SimSun",serif; font-size: 15px; fill: rgba(238,226,201,.8); text-anchor: middle; }
.zd.sel circle { fill: rgba(201,162,75,.32); stroke: var(--gold-2); }
.zd.sel text { fill: #231a09; }

/* --- messenger --- */
.letter {
  flex: 1; min-height: 0; overflow-y: auto; margin: 6px 18px 0; padding: 18px 18px 20px;
  background: var(--paper); color: var(--ink); box-shadow: 0 16px 44px rgba(0,0,0,.55);
}
.letter h2 { font-family: var(--serif); font-weight: 400; font-size: 20px; letter-spacing: .06em; margin: 0 0 4px; }
.letter .sub { font: 400 9.5px/1.6 var(--lat); letter-spacing: .2em; color: var(--ink-3); margin-bottom: 14px; }
.letter p { font-family: var(--serif); font-size: 14px; line-height: 1.95; color: var(--ink-2); margin: 0 0 11px; }
.letter .quote { border-left: 2px solid var(--verm); padding-left: 10px; color: var(--ink); }
.verdict { display: flex; gap: 10px; align-items: baseline; padding: 10px 0 6px; border-top: 1px solid rgba(25,23,19,.14); }
.verdict b { font-family: var(--serif); font-size: 26px; font-weight: 400; }
.verdict span { font-size: 11.5px; line-height: 1.6; color: var(--ink-3); }

/* ====================================================== galileo aiming aid */
/* QA P0: show the sky is draggable and whether Jupiter is getting closer. */
.gx .sky { cursor: grab; }
.gx .sky.grabbing { cursor: grabbing; }
.gx .aimhint {
  position: absolute; left: 50%; bottom: 46px; transform: translateX(-50%); z-index: 4;
  display: flex; align-items: center; gap: 6px; padding: 5px 11px; border-radius: 999px;
  background: rgba(7,11,20,.6); border: 1px solid rgba(238,226,201,.2);
  font: 400 10.5px/1 var(--sans); letter-spacing: .04em; color: rgba(238,226,201,.8);
  pointer-events: none; transition: opacity .3s; -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px);
}
.gx .aimhint.hide { opacity: 0; }
.gx .aimhint .hand { animation: handpan 1.8s ease-in-out infinite; }
@keyframes handpan { 0%,100% { transform: translateX(-3px); } 50% { transform: translateX(3px); } }
.gx .ring.near { border-color: rgba(226,192,122,.7); box-shadow: 0 0 22px rgba(226,192,122,.18) inset; }
@media (prefers-reduced-motion: reduce) {
  .gx .aimhint .hand { animation: none; }
  .hk .regok.on { animation: none; }
}
