:root{color-scheme:light;box-sizing:border-box;padding-top:env(safe-area-inset-top,0px);padding-bottom:env(safe-area-inset-bottom,0px)}html{scroll-padding-top:env(safe-area-inset-top,0px)}body{margin:0;padding:0;font:14px -apple-system,BlinkMacSystemFont,sans-serif;background:#fff;color:#000}img{max-width:100%}[hidden]:not([hidden=until-found i]){display:none!important}

/* Layout: a full-screen 3D terminal you slide along; lessons rise as a bottom sheet over it.
   One committed daytime-airport look: every color is set explicitly. */
:root {
  --sky: #cfd9e2;
  --paper: #ffffff;
  --ink: #1c2130;
  --muted: #5d6676;
  --sign: #ffd400;
  --sign-ink: #141414;
  --border: #1d2a5c;
  --green: #12804b;
  --green-soft: #ddf1e6;
  --red: #c62d2d;
  --red-soft: #f8dede;
  --purple: #6950a1;
  --line: #d9dee5;
  --f-title: "Noto Serif SC", "Songti SC", "STSong", serif;
  --f-zh: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --f-en: "Hind", "Helvetica Neue", Arial, sans-serif;
  color-scheme: light;
}
[hidden] { display: none !important; }
html, body { height: 100%; overflow: hidden; }
body { background: var(--sky); color: var(--ink); font-family: var(--f-zh); font-size: 17px; line-height: 1.6; }

.hud { position: fixed; left: 0; right: 0; top: 0; padding: calc(10px + env(safe-area-inset-top, 0px)) 16px 18px; background: linear-gradient(var(--sky) 55%, rgba(207,217,226,0)); display: flex; flex-direction: column; gap: 8px; pointer-events: none; }
.hud > * { pointer-events: auto; }
.titlebar { display: flex; align-items: center; gap: 10px; }
.home { flex: none; display: inline-flex; align-items: center; min-height: 44px; padding: 0 12px; margin-left: -4px; border-radius: 999px; background: rgba(255,255,255,.85); color: var(--ink); font-size: 15px; text-decoration: none; }
.home:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.chapter { font-family: var(--f-title); font-size: 18px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.2; margin: 0; flex: 1; min-width: 0; }
.chapter small { display: block; font-family: var(--f-en); font-size: 12px; letter-spacing: .12em; color: var(--muted); font-weight: 600; text-transform: uppercase; }
.pills { display: flex; gap: 5px; }
.pill { width: 14px; height: 6px; border-radius: 3px; background: rgba(28,33,48,.18); }
.pill.done { background: var(--green); }
.pill.now { background: var(--ink); }
.mission { align-self: flex-start; background: var(--ink); color: #fff; border-radius: 12px; padding: 6px 12px; font-size: 14px; max-width: 100%; box-sizing: border-box; }
.mission b { color: var(--sign); font-weight: 600; }

.dock { position: fixed; left: 0; right: 0; bottom: 0; padding: 12px 16px calc(14px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 10px; align-items: center; pointer-events: none; }
.dock > * { pointer-events: auto; }
.hint { font-size: 14px; color: var(--muted); background: rgba(255,255,255,.8); border-radius: 999px; padding: 4px 12px; margin: 0; }
.dockrow { display: flex; gap: 10px; width: 100%; max-width: 480px; }
.go { flex: 1; font: inherit; font-size: 19px; font-weight: 600; min-height: 56px; border: 0; border-radius: 16px; background: var(--sign); color: var(--sign-ink); cursor: pointer; box-shadow: 0 6px 18px rgba(28,33,48,.18); }
.pocket { font: inherit; font-size: 15px; min-height: 56px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 16px; background: var(--paper); color: var(--ink); cursor: pointer; }
.toast { position: fixed; left: 50%; top: 40%; transform: translateX(-50%); background: var(--ink); color: #fff; padding: 10px 16px; border-radius: 12px; font-size: 15px; max-width: calc(100% - 32px); box-sizing: border-box; text-align: center; }

.sheet { position: fixed; left: 0; right: 0; bottom: 0; max-height: 66%; background: var(--paper); border-radius: 22px 22px 0 0; box-shadow: 0 -10px 30px rgba(28,33,48,.18); display: flex; flex-direction: column; animation: rise .32s ease-out; }
@keyframes rise { from { transform: translateY(40px); opacity: 0; } to { transform: none; opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .sheet { animation: none; } }
.sheethead { display: flex; align-items: center; gap: 10px; padding: 14px 16px 6px; }
.sheethead h2 { font-family: var(--f-title); font-size: 19px; margin: 0; flex: 1; min-width: 0; }
.steps { display: flex; gap: 4px; }
.step { width: 18px; padding: 12px 2px; border: 0; background: none; cursor: pointer; }
.step::before { content: ""; display: block; height: 5px; border-radius: 3px; background: var(--line); }
.step.on::before { background: var(--ink); }
.step:disabled { cursor: default; }
.x { font: inherit; border: 0; background: var(--line); color: var(--ink); width: 36px; height: 36px; border-radius: 50%; cursor: pointer; font-size: 18px; line-height: 1; }
.body { overflow-y: auto; padding: 6px 16px 12px; display: flex; flex-direction: column; gap: 14px; }
.body > * { flex-shrink: 0; }
.foot { padding: 8px 16px calc(12px + env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--line); display: flex; gap: 10px; }
.prev { font: inherit; font-size: 17px; min-height: 54px; padding: 0 16px; border: 2px solid var(--ink); border-radius: 14px; background: var(--paper); color: var(--ink); cursor: pointer; flex: none; }
.next { flex: 1; min-width: 0; font: inherit; font-size: 19px; font-weight: 600; min-height: 54px; border: 0; border-radius: 14px; background: var(--ink); color: #fff; cursor: pointer; }
.next[hidden] { display: none !important; }

.story { font-size: 18px; margin: 0; }
.who { font-size: 14px; color: var(--muted); margin: 0; }
.en { font-family: var(--f-en); font-size: 25px; font-weight: 600; line-height: 1.25; margin: 0; }
.zh { color: var(--muted); margin: 0; }
.row { display: flex; gap: 8px; flex-wrap: wrap; }
.btn { font: inherit; font-size: 16px; border: 2px solid var(--ink); background: var(--paper); color: var(--ink); border-radius: 999px; min-height: 48px; padding: 0 16px; display: inline-flex; align-items: center; gap: 8px; cursor: pointer; }
.btn.play { background: var(--ink); color: #fff; }
.btn.playing { background: var(--sign); color: var(--sign-ink); border-color: var(--sign); }
.btn svg { width: 18px; height: 18px; flex: none; }
.btn.small { min-height: 40px; padding: 0 10px; }
button:focus-visible { outline: 3px solid var(--purple); outline-offset: 2px; }
.tip { background: #f3f5f8; border-radius: 14px; padding: 10px 12px; font-size: 15px; margin: 0; }
.tip strong { font-weight: 600; }
.tip .say-inline { font-family: var(--f-en); font-weight: 600; font-size: 16px; border: 0; background: none; padding: 0; color: var(--ink); text-decoration: underline; text-decoration-color: var(--sign); text-decoration-thickness: 3px; text-underline-offset: 3px; cursor: pointer; text-align: left; }
.opts { display: grid; grid-template-columns: 1fr; gap: 10px; }
.opt { font: inherit; text-align: left; background: var(--paper); border: 2px solid var(--line); border-radius: 14px; padding: 12px 14px; cursor: pointer; color: var(--ink); font-size: 17px; display: flex; flex-direction: column; gap: 2px; }
.opt .oen { font-family: var(--f-en); font-weight: 600; font-size: 19px; }
.opt.right { border-color: var(--green); background: var(--green-soft); }
.opt.wrong { border-color: var(--red); background: var(--red-soft); }
.opt[disabled] { cursor: default; }
.verdict { font-family: var(--f-title); font-size: 20px; margin: 0; }
.verdict.ok { color: var(--green); }
.verdict.no { color: var(--red); }
.praise { color: var(--green); font-weight: 600; margin: 0; }

/* sign replicas */
.signs { display: flex; flex-direction: column; gap: 6px; }
.hsign { background: var(--sign); color: var(--sign-ink); border-radius: 6px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; font-family: var(--f-en); font-weight: 700; font-size: 22px; line-height: 1.1; }
.hsign svg { width: 26px; height: 26px; flex: none; }
.hsign .gloss { margin-left: auto; font-family: var(--f-zh); font-weight: 400; font-size: 14px; color: #3a3a3a; }
.hsign.dark { background: #2a2d33; color: var(--sign); }
.hsign.dark .gloss { color: #c9c9c9; }
.psign { background: var(--purple); color: #fff; border-radius: 6px; padding: 8px 12px; display: flex; align-items: center; gap: 10px; font-family: var(--f-en); font-weight: 700; font-size: 22px; line-height: 1.1; }
.psign .gloss { margin-left: auto; font-family: var(--f-zh); font-weight: 400; font-size: 14px; color: #fff; }
.dmx { background: #101418; color: #ffb000; border-radius: 8px; padding: 12px; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-size: 15px; line-height: 1.5; }
.dmx-row { display: grid; grid-template-columns: auto minmax(0, 1fr) auto; gap: 10px; font-variant-numeric: tabular-nums; }
.dmx-call { margin-top: 8px; padding-top: 8px; border-top: 1px solid #343434; font-size: 13px; overflow-wrap: anywhere; }
.chapter-next { text-decoration: none; justify-content: center; margin-top: 10px; }
.bsign { background: var(--border); color: #fff; border-radius: 6px; padding: 10px 12px; font-family: var(--f-en); font-weight: 600; font-size: 20px; display: flex; align-items: center; gap: 10px; }
.bsign .gloss { margin-left: auto; font-family: var(--f-zh); font-size: 14px; color: #c8cde0; font-weight: 400; }
.csign { border-radius: 6px; padding: 12px; color: #fff; font-family: var(--f-en); font-weight: 700; font-size: 21px; display: flex; flex-direction: column; }
.csign span { font-family: var(--f-zh); font-size: 14px; font-weight: 400; opacity: .9; }
.cpair { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.fids { background: #101418; border-radius: 8px; padding: 10px; font-family: var(--f-en); color: #f2c14e; overflow-x: auto; }
.fids table { border-collapse: collapse; width: 100%; font-size: 16px; font-variant-numeric: tabular-nums; }
.fids th { color: #8a96a3; font-weight: 500; font-size: 12px; text-align: left; letter-spacing: .08em; text-transform: uppercase; padding: 0 6px 6px; }
.fids td { padding: 5px 6px; border-top: 1px solid #252c33; white-space: nowrap; }
.fids td.belt { font-size: 20px; font-weight: 700; color: #fff; text-align: center; }
.fids .st { color: #7ed1a0; }
.note { font-size: 13px; color: var(--muted); margin: 0; }
.roundel { display: inline-flex; align-items: center; justify-content: center; width: 30px; height: 30px; flex: none; }

/* Hotel, streets and tea lesson pictures. Columns wrap within a phone-width sheet. */
.floors:not(.sg), .stsign, .rdsign, .menu, .stand, .bill { box-sizing: border-box; max-width: 100%; }
.floors:not(.sg) { background: #292c31; color: #fff; border-radius: 8px; padding: 8px; font-size: 16px; }
.fl-row, .fl-head { display: grid; grid-template-columns: minmax(0, 1.2fr) minmax(0, 1fr) minmax(0, .65fr); gap: 8px; padding: 8px; }
.fl-row { border-bottom: 1px solid #51545a; }
.fl-row span:first-child { font-family: var(--f-en); }
.fl-head { color: #c8cde0; font-size: 14px; }
.fl-hi { background: #ffd400; color: #141414; border-radius: 4px; font-weight: 600; }
.stsign { background: #fff; color: #111; border: 1px solid #111; padding: 10px 12px; font-family: var(--f-en); font-size: 21px; font-weight: 700; line-height: 1.3; text-transform: uppercase; }
.stsign .gloss, .rdsign .gloss { display: block; font-family: var(--f-zh); font-size: 14px; font-weight: 400; text-transform: none; margin-top: 4px; }
.stsign small, .sg.street small { color: #b52a28; font-size: .65em; }
.rdsign { background: #34383d; color: #fff; border-radius: 6px; padding: 12px; font: 700 25px/1.3 var(--f-en); letter-spacing: .08em; text-align: center; }
.rdsign .gloss { letter-spacing: 0; color: #e0e3e6; }
.menu { background: #faf4e6; color: #3a3024; border: 1px solid #d8c6a8; border-radius: 6px; padding: 14px 12px; }
.menu-h { font: 700 25px/1.3 Georgia, "Times New Roman", serif; text-align: center; margin-bottom: 8px; }
.menu-r { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 12px; padding: 7px 0; border-top: 1px solid #e3d7c1; font-size: 16px; }
.menu-r span:first-child { font-family: var(--f-en); }
.menu-r span:last-child { text-align: right; }
.stand { display: flex; flex-direction: column; gap: 8px; align-items: center; padding: 8px 0; }
.stand-r { box-sizing: border-box; width: 100%; display: grid; grid-template-columns: minmax(0, .7fr) minmax(0, 1.5fr) minmax(0, .8fr); gap: 8px; background: #faf4e6; border: 1px solid #d8c6a8; border-bottom: 4px solid #ba9a6c; border-radius: 8px; padding: 10px; font-size: 16px; }
.stand-r span:nth-child(-n+2) { font-family: var(--f-en); }
.stand-r span:last-child { text-align: right; }
.bill { background: #fff; color: #202328; border: 1px dashed #a0a5ab; padding: 12px; font: 16px/1.5 ui-monospace, "SFMono-Regular", Consolas, monospace; }
.bill-r { display: grid; grid-template-columns: minmax(0, 1fr) auto; gap: 10px; padding: 6px 0; }
.bill-r span:last-child { text-align: right; font-variant-numeric: tabular-nums; white-space: nowrap; }
.bill-t { border-top: 1px solid #202328; margin-top: 6px; padding-top: 10px; font-weight: 700; }
/* Larger controls in the new chapters; leave Chapters 1 and 2's layout unchanged. */
.later-chapter .sheethead { flex-wrap: wrap; }
.later-chapter .steps { order: 3; flex-basis: 100%; }
.later-chapter .step { flex: 1; min-width: 44px; min-height: 44px; }
.later-chapter .x { width: 44px; height: 44px; flex: none; }
.later-chapter .btn.small { min-height: 44px; min-width: 44px; justify-content: center; box-sizing: border-box; }
.later-chapter .hsign { flex-wrap: wrap; }
.later-chapter .body { min-height: 0; overflow-wrap: anywhere; }

.stamp { align-self: center; width: 170px; height: 170px; transform: rotate(-7deg); animation: thump .5s ease-out; }
@keyframes thump { 0% { transform: rotate(-7deg) scale(1.5); opacity: 0; } 100% { transform: rotate(-7deg) scale(1); opacity: 1; } }
@media (prefers-reduced-motion: reduce) { .stamp { animation: none; } }
.teaser { border: 2px dashed var(--muted); border-radius: 14px; padding: 12px; }
.teaser h3 { font-family: var(--f-title); font-size: 17px; margin: 0 0 4px; }
.teaser p { margin: 0; color: var(--muted); font-size: 15px; }
.trip { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 8px; }
.trip span { font-size: 13px; border-radius: 999px; padding: 2px 10px; background: var(--line); color: var(--muted); }
.trip span.on { background: var(--green); color: #fff; }

.pocketcard { position: fixed; inset: 0; background: var(--paper); overflow-y: auto; padding: calc(18px + env(safe-area-inset-top, 0px)) 16px calc(24px + env(safe-area-inset-bottom, 0px)); display: flex; flex-direction: column; gap: 16px; }
.pocketcard h2 { font-family: var(--f-title); font-size: 24px; margin: 0; }
.pocketcard h3 { font-size: 14px; color: var(--muted); margin: 6px 0 0; font-weight: 600; letter-spacing: .04em; }
.pline { display: flex; gap: 10px; align-items: flex-start; }
.pline div { min-width: 0; }
.pline .en { font-size: 24px; }
.empty { color: var(--muted); }
/* the scroll */
body { background: #e7e4dd; }
.strip { position: fixed; left: 0; right: 0; top: calc(112px + env(safe-area-inset-top, 0px)); bottom: calc(150px + env(safe-area-inset-bottom, 0px)); overflow-x: auto; overflow-y: hidden; scrollbar-width: none; transition: top .4s ease, bottom .4s ease; -webkit-overflow-scrolling: touch; }
.strip::-webkit-scrollbar { display: none; }
body.sheet-on .strip { top: calc(70px + env(safe-area-inset-top, 0px)); bottom: 66%; }
.track { position: relative; height: 100%; display: flex; width: max-content; padding-inline: 16px; }
.panel { position: relative; height: 100%; aspect-ratio: 1672 / 941; flex: none; container-type: size; overflow: hidden; }
.panel:first-child { border-radius: 10px 0 0 10px; }
.panel:last-child { border-radius: 0 10px 10px 0; }
.panel + .panel { -webkit-mask-image: linear-gradient(to right, transparent 0, #000 6%); mask-image: linear-gradient(to right, transparent 0, #000 6%); }
.art { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; display: block; }
.over { position: absolute; inset: 0; pointer-events: none; }
.sg { position: absolute; display: flex; align-items: center; gap: .35em; padding: 0 .45em; box-sizing: border-box; font-family: "Hind", "Segoe UI", Arial, sans-serif; font-weight: 600; line-height: 1.02; overflow: hidden; border-radius: .4cqh; box-shadow: 0 .5cqh 1.2cqh rgba(0,0,0,.18); white-space: nowrap; }
.sg.yellow { background: #ffd400; color: #141414; --bg: #ffd400; }
.sg.dark { background: #2a2d33; color: #ffd400; --bg: #2a2d33; }
.sg.navy { background: #1d2a5c; color: #fff; }
.sg.green { background: #12804b; color: #fff; }
.sg.red { background: #c62d2d; color: #fff; }
.sg.purple { background: #6950a1; color: #fff; }
.sg.board { background: #101418; color: #ffb000; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-weight: 500; }
.sg.floors { background: #101418; color: #ffb000; flex-direction: column; justify-content: space-evenly; gap: 0; padding: .25cqh; font-family: ui-monospace, "SFMono-Regular", Consolas, monospace; font-variant-numeric: tabular-nums; }
.sg.street { background: #fff; color: #111; border: 1px solid #111; border-radius: 0; box-shadow: none; text-transform: uppercase; font-weight: 700; }
.sg.floor { background: none; color: #967100; box-shadow: none; border-radius: 0; padding: 0; justify-content: center; }
[data-chapter="streets"] .sg.floor { color: #fff; text-shadow: 0 1px 2px #34383d; }
.sg.center { justify-content: center; }
.sg .arr, .sg .pic { height: 1.05em; width: 1.05em; flex: none; display: block; }
.sg .pic svg { width: 100%; height: 100%; display: block; }
.sg.screen { background: #0e1a2b; color: #fff; flex-direction: column; align-items: stretch; padding: 0; gap: 0; font-size: 2.5cqh; }
.scrtop { background: #ffd400; color: #141414; display: flex; justify-content: space-between; align-items: center; padding: 0 .4em; font-size: 2.2cqh; }
.scrtop b { font-size: 3.6cqh; }
.scrrow { padding: .45em .4em 0; }
.scrok { color: #7ed1a0; padding: .2em .4em; font-size: 2.1cqh; font-weight: 500; }
.sg.poster { background: #fff; color: #222; flex-direction: column; align-items: stretch; padding: 0; gap: 0; font-size: 1.25cqh; font-weight: 500; white-space: normal; }
.poster b { background: #c62d2d; color: #fff; padding: .35em; font-size: 1.4cqh; }
.poster span { padding: .35em; }
.sg.card { background: #fff; color: #1b1b1b; justify-content: center; font-size: 2.3cqh; font-weight: 700; box-shadow: none; outline: 1px solid rgba(0,0,0,.25); }
.sg.eliz { background: none; box-shadow: none; padding: 0; overflow: visible; }
.eliz svg { width: 100%; height: auto; display: block; }
.mist { position: absolute; inset: -3%; pointer-events: none; z-index: 5;
  background: radial-gradient(ellipse 45% 35% at 22% 30%, rgba(255,255,255,.9), transparent), radial-gradient(ellipse 50% 40% at 72% 58%, rgba(248,250,252,.92), transparent), radial-gradient(ellipse 40% 30% at 40% 86%, rgba(255,255,255,.88), transparent), rgba(236,239,242,.62);
  -webkit-backdrop-filter: blur(10px) saturate(.45) brightness(1.06); backdrop-filter: blur(10px) saturate(.45) brightness(1.06);
  transition: opacity 2.8s ease, transform 3.2s ease; animation: drift 14s ease-in-out infinite alternate; }
.mist.gone { opacity: 0; transform: translateX(8%) scale(1.06); animation: none; }
@keyframes drift { from { background-position: 0 0, 0 0, 0 0, 0 0; } to { background-position: 4cqh -2cqh, -5cqh 2cqh, 3cqh 0, 0 0; } }
.pin { position: absolute; transform: translate(-50%, -100%); width: 12cqh; height: 12cqh; min-width: 44px; min-height: 44px; border-radius: 50%; border: 3px solid #fff; display: flex; align-items: center; justify-content: center; font: 600 6.5cqh "Hind", Arial, sans-serif; cursor: pointer; z-index: 6; box-shadow: 0 .8cqh 2cqh rgba(28,33,48,.3); padding: 0; }
.pin b { font-weight: 600; line-height: 1; padding-top: .12em; }
.pin svg { width: 55%; height: 55%; }
.pin.now { background: #ffd400; color: #141414; animation: bob 1.6s ease-in-out infinite; }
.pin.done { background: #12804b; color: #fff; }
.pin.locked { background: #8b939c; color: #fff; }
@keyframes bob { 50% { transform: translate(-50%, -112%); } }
.plabel { position: absolute; top: 100%; margin-top: 1.4cqh; font: 600 3.6cqh "PingFang SC", "Microsoft YaHei", sans-serif; color: #1c2130; background: rgba(255,255,255,.92); padding: .1em .6em; border-radius: 99px; white-space: nowrap; }
.you { position: absolute; bottom: 5%; height: 24%; transform: translateX(-50%); z-index: 4; pointer-events: none; filter: drop-shadow(0 4px 4px rgba(0,0,0,.18)); }
.you canvas, .you img { height: 100%; width: auto; display: block; }
.you.walking { animation: walkbob .42s ease-in-out infinite; }
@keyframes walkbob { 50% { margin-bottom: 1.2%; } }
.bag { position: absolute; height: 3.4%; border-radius: .8cqh; transform: translate(-50%, -50%); box-shadow: 0 .5cqh .8cqh rgba(0,0,0,.35); }
.cab { position: absolute; width: 8%; left: -12%; animation: drive 16s linear infinite; }
.cab svg { width: 100%; height: auto; display: block; }
@keyframes drive { to { left: 112%; } }
@media (prefers-reduced-motion: reduce) { .pin.now, .mist, .cab, .you.walking { animation: none; } .mist { transition: opacity .3s; } }
