/* 去城里赶大集 · 清平 */
:root {
  --ink: #2a1d17;
  --paper: #f7ecd6;
  --paper2: #efdfbf;
  --red: #c8322a;
  --red-deep: #8e1c18;
  --gold: #f2b33d;
  --mute: #7a6656;
  --night: #1b1a2c;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --sans: -apple-system, "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  --safe-t: env(safe-area-inset-top, 0px);
  --safe-b: env(safe-area-inset-bottom, 0px);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; background: var(--night); color: var(--ink); font-family: var(--sans); line-height: 1.75; overflow-x: hidden; }
img { max-width: 100%; display: block; }
button { font: inherit; color: inherit; cursor: pointer; }
h1, h2, h3, .quote, .big-title, .year, .era b { font-family: var(--serif); }
.mute { color: var(--mute); }
.small { font-size: .88rem; }
[hidden] { display: none !important; }

/* ---------- 常驻界面 ---------- */
#progress { position: fixed; left: 0; top: 0; height: 3px; width: 0; background: linear-gradient(90deg, var(--gold), var(--red)); z-index: 60; }
#topbar { position: fixed; left: 0; right: 0; top: 0; z-index: 50; display: flex; justify-content: space-between; align-items: flex-start; padding: calc(var(--safe-t) + 10px) 12px 0; pointer-events: none; }
#topbar > * { pointer-events: auto; }
.badge { display: flex; flex-direction: column; align-items: flex-start; gap: 0; border: 0; border-radius: 12px; padding: 6px 12px; background: rgba(28, 18, 14, .72); color: #fff4dc; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); font-size: .82rem; line-height: 1.4; text-align: left; box-shadow: 0 4px 16px rgba(0,0,0,.25); }
.badge small { color: var(--gold); font-size: .75rem; }
.badge.hot { background: rgba(160, 24, 20, .88); }
.disc { width: 44px; height: 44px; border-radius: 50%; border: 2px solid rgba(255,255,255,.7); background: radial-gradient(circle, #f2b33d 0 18%, #1c1310 19% 30%, #2a1d17 31% 60%, #1c1310 61%); color: #fff; display: grid; place-items: center; box-shadow: 0 4px 16px rgba(0,0,0,.35); }
.disc span { font-size: 14px; color: #1c1310; font-weight: 700; }
.disc.on { animation: spin 4s linear infinite; }
.disc.off { opacity: .55; filter: grayscale(1); }
.disc.off::after { content: ""; position: absolute; width: 46px; height: 2px; background: #fff; transform: rotate(-45deg); }
@keyframes spin { to { transform: rotate(360deg); } }

#hud { position: fixed; left: 50%; bottom: calc(var(--safe-b) + 12px); transform: translateX(-50%) translateY(140%); z-index: 50; display: flex; gap: 8px; transition: transform .5s cubic-bezier(.2,.8,.2,1); }
#hud.show { transform: translateX(-50%); }
.pill { white-space: nowrap; display: flex; align-items: center; gap: 6px; border: 0; border-radius: 999px; padding: 8px 14px; background: rgba(28, 18, 14, .82); color: #fff4dc; backdrop-filter: blur(6px); -webkit-backdrop-filter: blur(6px); box-shadow: 0 6px 20px rgba(0,0,0,.35); font-size: .9rem; }
.pill b { font-variant-numeric: tabular-nums; font-size: 1.05rem; color: var(--gold); }
.coin { font-style: normal; width: 22px; height: 22px; border-radius: 50%; background: var(--gold); color: #6b3a00; font-size: .7rem; display: grid; place-items: center; font-weight: 800; }
.ico-basket { width: 20px; height: 16px; border-radius: 0 0 8px 8px; background: repeating-linear-gradient(45deg, #c48a43 0 3px, #9a6427 3px 6px); position: relative; }
.ico-basket::before { content: ""; position: absolute; left: 3px; right: 3px; top: -8px; height: 10px; border: 2px solid #c48a43; border-bottom: 0; border-radius: 10px 10px 0 0; }
.pill.bump { animation: bump .45s; }
@keyframes bump { 30% { transform: scale(1.18); } }

#toast { position: fixed; left: 50%; top: 40%; transform: translate(-50%, -50%) scale(.9); z-index: 70; background: rgba(28,18,14,.9); color: #fff4dc; padding: 12px 18px; border-radius: 12px; max-width: 80vw; text-align: center; opacity: 0; pointer-events: none; transition: .25s; }
#toast.on { opacity: 1; transform: translate(-50%, -50%) scale(1); }

.sheet { position: fixed; inset: 0; z-index: 80; background: rgba(0,0,0,.5); display: flex; align-items: flex-end; justify-content: center; }
.sheet-card { position: relative; width: min(520px, 100%); max-height: 80vh; overflow: auto; background: var(--paper); border-radius: 18px 18px 0 0; padding: 20px 20px calc(var(--safe-b) + 24px); }
.sheet-card h3 { margin: 0 0 4px; }
.sheet-close { position: absolute; right: 10px; top: 6px; border: 0; background: none; font-size: 1.8rem; color: var(--mute); }
#sheetList, .basket-list { list-style: none; padding: 0; margin: 10px 0; }
#sheetList li, .basket-list li { display: flex; justify-content: space-between; align-items: center; gap: 8px; padding: 10px 4px; border-bottom: 1px dashed rgba(42,29,23,.2); }
#sheetList li { cursor: pointer; }
#sheetList li span:last-child, .basket-list li span:last-child { color: var(--mute); font-size: .85rem; text-align: right; }
#sheetList li.empty, .basket-list li.empty { color: var(--mute); justify-content: center; }

/* ---------- 滚动场景 ---------- */
.scene { position: relative; }
.stage { position: sticky; top: 0; height: 100vh; height: 100svh; overflow: hidden; background: #000; }
.layer { position: absolute; inset: 0; width: 100%; height: 100%; will-change: transform, opacity; }
.layer.cover { object-fit: cover; }
.vignette { position: absolute; inset: 0; background: linear-gradient(to bottom, rgba(0,0,0,.35), transparent 30%, transparent 55%, rgba(0,0,0,.7)); pointer-events: none; }
.vignette.strong { background: radial-gradient(ellipse at center, rgba(0,0,0,.25), rgba(0,0,0,.75)); }
.fg { pointer-events: none; }
.lanterns { height: 40%; }
.redwash { background: radial-gradient(ellipse at 50% 40%, rgba(214,40,30,.35), rgba(120,10,10,.75)); mix-blend-mode: multiply; }

.beat { position: absolute; left: 0; right: 0; padding: 0 22px; z-index: 5; opacity: 0; transform: translateY(24px); transition: opacity .6s, transform .6s cubic-bezier(.2,.8,.2,1); pointer-events: none; color: #fff7e6; text-shadow: 0 2px 16px rgba(0,0,0,.6); }
.beat.on { opacity: 1; transform: none; pointer-events: auto; }
.beat.center { top: 50%; transform: translateY(calc(-50% + 24px)); text-align: center; }
.beat.center.on { transform: translateY(-50%); }
.beat.bottom { bottom: calc(var(--safe-b) + 90px); }
.beat.top { top: calc(var(--safe-t) + 70px); }
.lead { font-size: 1.2rem; font-family: var(--serif); margin: .4em 0; }
.lead-s { font-size: 1.05rem; font-family: var(--serif); }
.quote { font-size: 1.6rem; font-weight: 900; color: var(--gold); margin: .3em 0; }
.kicker { margin: 0; font-size: .8rem; letter-spacing: .3em; color: var(--red); font-weight: 700; }
.kicker.light { color: var(--gold); }
.big-title { font-size: clamp(2.4rem, 12vw, 4.4rem); margin: .1em 0; letter-spacing: .12em; font-weight: 900; }
.big-title.mid { font-size: clamp(2rem, 10vw, 3.4rem); letter-spacing: .06em; line-height: 1.25; }
.quote.boxed { display: inline-block; background: rgba(120, 18, 14, .78); padding: 6px 14px; border-radius: 8px; font-size: 1.3rem; margin-top: 14px; }
.huaji { color: #ffe3a3; text-shadow: 0 0 30px rgba(255,80,40,.9), 0 4px 0 #8e1c18; }
.glass { background: rgba(28, 18, 14, .62); backdrop-filter: blur(8px); -webkit-backdrop-filter: blur(8px); border-left: 4px solid var(--gold); border-radius: 6px; padding: 12px 16px; text-align: left; text-shadow: none; max-width: 30rem; margin: 0 auto; }
.glass p { margin: .3em 0; }
.glass.sepia { background: rgba(80, 55, 30, .75); border-color: #e9c98a; }
.countdown { display: inline-block; margin-top: 8px; padding: 6px 16px; border: 2px solid var(--gold); border-radius: 999px; font-size: 1.1rem; color: #fff; background: rgba(140, 20, 16, .6); }
.countdown b { color: var(--gold); font-size: 1.6rem; margin: 0 4px; font-variant-numeric: tabular-nums; }

/* 第 0 幕 */
.dawn { background: #151632; }
.title-v { margin: 0; display: flex; flex-direction: column; align-items: center; font-size: clamp(4rem, 24vw, 8rem); line-height: 1.05; font-weight: 900; color: #fff3d6; letter-spacing: 0; }
.title-v span { display: block; animation: rise 1.4s both; }
.title-v span:nth-child(2) { animation-delay: .35s; }
.title-v span:nth-child(3) { animation-delay: .7s; }
@keyframes rise { from { opacity: 0; transform: translateY(40px) scale(1.1); filter: blur(10px); } }
.hint-scroll { font-size: .85rem; letter-spacing: .2em; opacity: .85; animation: nudge 1.6s ease-in-out infinite; }
@keyframes nudge { 50% { transform: translateY(-6px); } }
.walkers { pointer-events: none; }
.walker { position: absolute; left: 50%; bottom: 0; width: 18px; height: 40px; transform-origin: 50% 100%; animation: walk 9s linear infinite; }
.walker::before { content: ""; position: absolute; left: 4px; top: 0; width: 10px; height: 10px; border-radius: 50%; background: #2a1d17; }
.walker::after { content: ""; position: absolute; left: 1px; top: 10px; width: 16px; height: 28px; border-radius: 6px 6px 2px 2px; background: var(--c, #6b2b22); }
.w1 { --x: -30px; --c: #7a2a1f; animation-delay: -1s; }
.w2 { --x: 20px; --c: #2f4a6a; animation-delay: -4s; }
.w3 { --x: -6px; animation-delay: -6.5s; width: 40px; }
.w3::after { width: 38px; height: 18px; top: 18px; background: #3a6b52; border-radius: 4px; }
.w3::before { left: 22px; }
.w4 { --x: 40px; --c: #a04a2a; animation-delay: -8s; }
@keyframes walk {
  from { transform: translate(calc(-50% + var(--x) * 6), 0) scale(2.6); opacity: 0; }
  10% { opacity: 1; }
  to { transform: translate(calc(-50% + var(--x) * .15), -47vh) scale(.12); opacity: .6; }
}

/* 第 1 幕 */
.year { font-size: clamp(4rem, 22vw, 7rem); font-weight: 900; color: var(--gold); line-height: 1; letter-spacing: .04em; font-variant-numeric: tabular-nums; text-shadow: 0 4px 24px rgba(0,0,0,.6); margin-bottom: 12px; }

/* 第 2 幕：三样 */
.tri { position: absolute; inset: 0; display: grid; grid-template-columns: repeat(3, 1fr); gap: 4px; background: #2a120e; }
.tri img { width: 100%; height: 100%; object-fit: cover; }

/* 第 5 幕：纸面 */
.stage.paper { background: var(--paper2); }
.wall { margin: 0; display: grid; place-items: center; padding: calc(var(--safe-t) + 210px) 16px 40px; }
.wall img { max-height: 100%; width: auto; max-width: 100%; object-fit: contain; border-radius: 4px; box-shadow: 0 10px 40px rgba(0,0,0,.25); }
.era { display: inline-flex; align-items: baseline; gap: 10px; color: var(--red-deep); text-shadow: none; }
.era b { font-size: 3rem; line-height: 1; }
.era span { font-family: var(--serif); font-size: 1.3rem; font-weight: 700; }
#s5 .beat { color: var(--ink); text-shadow: none; }
#s5 .glass { color: #fff7e6; margin: 6px 0 0; }

/* ---------- 面板（摊位） ---------- */
.panel { position: relative; min-height: 100vh; min-height: 100svh; display: flex; align-items: center; justify-content: center; padding: calc(var(--safe-t) + 70px) 14px calc(var(--safe-b) + 90px); overflow: hidden; }
.panel::before { content: ""; position: absolute; inset: -40px; background: var(--bg, #3a2418) center/cover; filter: blur(18px) brightness(.55) saturate(1.2); transform: scale(1.1); }
.card { position: relative; width: min(30rem, 100%); background: var(--paper); border-radius: 14px; padding: 18px 18px 20px; box-shadow: 0 20px 60px rgba(0,0,0,.45); }
.card.wide { width: min(34rem, 100%); }
.card.night { background: #1f1d2c; color: #efe6d2; }
.card.night .mute { color: #a89a84; }
.card h2 { margin: .1em 0 .3em; font-size: 1.45rem; line-height: 1.35; }
.card p { margin: .4em 0; }
.stall-photo { max-width: none; width: calc(100% + 36px); margin: -18px -18px 12px; height: 180px; object-fit: cover; border-radius: 14px 14px 0 0; }
.wide-photo { height: 140px; }
.inline-img { margin: 8px auto; max-height: 260px; border-radius: 4px; }
details { margin-top: 10px; background: rgba(0,0,0,.04); border-radius: 8px; padding: 6px 12px; }
summary { cursor: pointer; color: var(--red); font-weight: 700; }
.row { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 12px; }
.btn { border: 0; border-radius: 999px; padding: 10px 18px; background: var(--ink); color: #fff4dc; font-weight: 700; letter-spacing: .05em; text-decoration: none; display: inline-flex; align-items: center; gap: 4px; }
.btn.red, .btn.buy { background: var(--red); }
.btn.ghost { background: transparent; color: inherit; border: 1.5px solid currentColor; }
.btn.sm { padding: 6px 12px; font-size: .85rem; }
.btn.buy.bought { background: #6d8a4a; }
.btn.buy.ready { animation: bump .5s 2; }
.btn:active { transform: scale(.96); }

.game-box { position: relative; width: 100%; aspect-ratio: 4 / 3; border-radius: 10px; overflow: hidden; background: #f3e3c3; touch-action: none; user-select: none; -webkit-user-select: none; }
.game-box.tall { aspect-ratio: 3 / 4; max-height: 62vh; }
.game-box.square { aspect-ratio: 1; }
.game-box.dark { background: #19121a; }
.game-box canvas { position: absolute; inset: 0; width: 100%; height: 100%; }
.game-bg { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.game-tip, .game-status { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: .85rem; color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.8); pointer-events: none; padding: 0 10px; }
.game-box:not(.dark) .game-status { color: var(--ink); text-shadow: 0 1px 0 rgba(255,255,255,.7); }
#p-balloon .game-status { color: #fff; text-shadow: 0 1px 6px rgba(0,0,0,.8); }

/* 第 0 幕：钞票 */
.money-wrap { position: relative; height: 230px; margin: 14px 0 4px; border-radius: 12px; background: linear-gradient(#f0dcb4, #e3c48f); display: grid; place-items: center; overflow: hidden; touch-action: none; }
.bill { position: relative; width: 240px; height: 116px; border-radius: 6px; background: linear-gradient(135deg, #d7b9d6, #b48ab8 40%, #9b6f9f); box-shadow: 0 8px 20px rgba(0,0,0,.3), inset 0 0 0 6px rgba(255,255,255,.25); transition: transform .5s cubic-bezier(.2,.8,.2,1), opacity .5s; touch-action: none; cursor: grab; }
.bill-n { position: absolute; left: 12px; top: 6px; font: 900 2.6rem var(--serif); color: #5a2f63; }
.bill-t { position: absolute; right: 16px; bottom: 10px; font: 900 1.6rem var(--serif); color: #5a2f63; letter-spacing: .1em; }
.bill-c { position: absolute; right: 14px; top: 12px; font-size: .7rem; color: #5a2f63; letter-spacing: .2em; }
.bill.gone { transform: translateY(-320px) rotate(-12deg) scale(.4) !important; opacity: 0; }
.hand-hint { position: absolute; bottom: 10px; font-size: .85rem; color: #6b4a2a; animation: nudge 1.6s infinite; }
.who label { display: block; margin: 10px 0 0; font-weight: 700; }
.who input { display: block; width: 100%; margin-top: 4px; padding: 10px 12px; border: 1.5px solid rgba(42,29,23,.3); border-radius: 8px; font: inherit; background: #fffaf0; }

/* 发卡 */
.clip-box { background: linear-gradient(#ffe7c9, #f6caa0); display: grid; place-items: center; }
.girl { width: 62%; height: auto; }
.clip-on { position: absolute; width: 64px; height: 44px; transform: translate(-50%, -50%) rotate(-12deg); cursor: grab; touch-action: none; animation: pop .35s; }
.clip-on svg { width: 100%; height: 100%; filter: drop-shadow(0 2px 2px rgba(0,0,0,.3)); }
@keyframes pop { from { transform: translate(-50%, -50%) scale(.2); } }
.clips { display: flex; gap: 8px; margin-top: 10px; }
.clips button { flex: 1; border: 2px solid transparent; background: #fff6e8; border-radius: 10px; padding: 6px; }
.clips button.on { border-color: var(--red); }
.clips svg { width: 100%; height: 34px; }

/* 福字和门 */
.fu-wrap { position: relative; }
.door { position: relative; width: 100%; aspect-ratio: 1; border-radius: 8px; overflow: hidden; background: #3a2418; display: flex; gap: 4px; padding: 10px 10px 0; }
.door-leaf { flex: 1; background: linear-gradient(90deg, #a2231b, #c33a2c 50%, #a2231b); border-radius: 4px 4px 0 0; position: relative; box-shadow: inset 0 0 0 4px rgba(0,0,0,.15); }
.knock { position: absolute; top: 55%; width: 18px; height: 18px; border-radius: 50%; border: 3px solid #e2b23d; }
.door-leaf.l .knock { right: 10px; }
.door-leaf.r .knock { left: 10px; }
.fu-on { position: absolute; left: 50%; top: 32%; width: 42%; transform: translate(-50%, -50%) rotate(45deg); transition: transform .9s cubic-bezier(.3,1.4,.4,1), opacity .4s; filter: drop-shadow(0 4px 6px rgba(0,0,0,.4)); }
.fu-on.fly { transform: translate(-50%, 140%) rotate(45deg) scale(1.6); opacity: 0; transition: none; }
.fu-msg { position: absolute; left: 0; right: 0; bottom: 10%; text-align: center; font: 900 1.8rem var(--serif); color: #ffe3a3; text-shadow: 0 3px 0 #8e1c18, 0 0 20px rgba(255,200,80,.8); opacity: 0; transition: .5s .6s; padding: 0 10px; }
.fu-msg.on { opacity: 1; }
.fu-msg.soft { font-size: 1.05rem; font-family: var(--sans); font-weight: 700; }

/* 年货摊 */
.shelf { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 10px; }
.shelf figure { margin: 0; text-align: center; }
.shelf img { width: 100%; aspect-ratio: 3 / 4; object-fit: cover; border-radius: 8px; }
.shelf figcaption { font-weight: 700; margin: 4px 0; }
.shelf .btn { width: 100%; justify-content: center; padding: 6px 4px; }

/* 尺八 */
.chiba { display: flex; gap: 16px; align-items: stretch; margin-top: 12px; }
.flute { width: 64px; flex: none; border-radius: 30px 30px 16px 16px; background: linear-gradient(90deg, #6b4a22, #b98a4a 40%, #d9b06a 55%, #8a6230); padding: 26px 0 18px; display: flex; flex-direction: column; align-items: center; justify-content: space-between; gap: 14px; box-shadow: inset 0 0 0 2px rgba(0,0,0,.2); min-height: 340px; position: relative; touch-action: none; }
.flute::before { content: ""; position: absolute; top: 34%; left: 0; right: 0; height: 6px; background: rgba(60,35,10,.5); }
.flute button { width: 38px; height: 38px; border-radius: 50%; border: 3px solid #5a3c18; background: radial-gradient(circle, #1a0f06 50%, #3a2410); transition: .08s; touch-action: none; }
.flute button.d { background: radial-gradient(circle, #f2b33d 40%, #c8322a); box-shadow: 0 0 18px rgba(242,179,61,.9); transform: scale(.92); }
.chiba-side { flex: 1; display: flex; flex-direction: column; gap: 8px; }
.breath { height: 10px; border-radius: 6px; background: rgba(255,255,255,.12); overflow: hidden; }
.breath i { display: block; height: 100%; width: 0; background: linear-gradient(90deg, #8ad, var(--gold)); transition: width .08s; }

/* 结尾 */
.poster-out { margin-top: 14px; text-align: center; }
.poster-out img { width: 100%; border-radius: 8px; box-shadow: 0 10px 30px rgba(0,0,0,.3); margin-bottom: 8px; }
.map { width: 100%; height: auto; margin-top: 8px; }
.pins circle { fill: var(--red); stroke: #fff; stroke-width: 2; cursor: pointer; }
.pins text { fill: #fff; font-weight: 700; pointer-events: none; }
.pins g.on circle { fill: var(--gold); }
.pins g.on text { fill: var(--ink); }

footer { position: relative; z-index: 1; background: #120d0b; color: #b8a890; padding: 40px 22px calc(var(--safe-b) + 110px); font-size: .82rem; text-align: center; }
footer p { margin: .4em auto; max-width: 30rem; }
.foot-title { font-family: var(--serif); font-size: 1.2rem; color: #f2dcb0; }
footer .btn { margin-top: 14px; color: #e6d6b8; }

/* 屏幕抖动 */
.shake { animation: shake .35s; }
@keyframes shake { 20% { transform: translate(-6px, 3px); } 40% { transform: translate(5px, -4px); } 60% { transform: translate(-4px, -2px); } 80% { transform: translate(3px, 4px); } }

/* 电脑端：居中显示成手机宽度的竖条，两边留暗色 */
@media (min-width: 760px) {
  body { background: #0d0a09; }
  main { max-width: 480px; margin: 0 auto; box-shadow: 0 0 80px rgba(0,0,0,.9); }
  #topbar { left: 50%; right: auto; width: 480px; transform: translateX(-50%); }
}
/* 低性能 / 减少动画 */
.lite .layer { will-change: auto; }
@media (prefers-reduced-motion: reduce) {
  .walker, .hint-scroll, .disc.on { animation: none; }
}

/* 页脚：作者 */
.author { margin: 32px auto 0; padding-top: 24px; border-top: 1px solid rgba(242, 220, 176, .2); max-width: 20rem; }
.author p { margin: .2em 0; }
.author-label { font-size: .75rem; letter-spacing: .3em; color: #8a7a64; }
.author-name { font-family: var(--serif); font-size: 1.05rem; color: #f2dcb0; font-weight: 700; }
.author a { color: var(--gold); text-decoration: none; }
.author img { width: 200px; height: auto; margin: 14px auto 6px; border-radius: 12px; }

/* ---------- 手绘插画（js/art.js） ---------- */
.art { position: absolute; inset: 0; overflow: hidden; }
.art-svg { width: 100%; height: 100%; display: block; }
.art .mover { animation: cross var(--dur) linear infinite; animation-delay: var(--dl); }
.art .mover.rtl { animation-name: crossR; }
@keyframes cross { from { transform: translateX(-70px); } to { transform: translateX(480px); } }
@keyframes crossR { from { transform: translateX(480px); } to { transform: translateX(-70px); } }
.art .leg, .art .arm { transform-box: fill-box; transform-origin: 50% 0; animation: swing .8s ease-in-out infinite alternate; }
.art .leg.b, .art .arm.f { animation-delay: -.8s; }
.art .arm { animation-name: swingA; }
@keyframes swing { from { transform: rotate(24deg); } to { transform: rotate(-24deg); } }
@keyframes swingA { from { transform: rotate(18deg); } to { transform: rotate(-18deg); } }
.art .bob { animation: bob .4s ease-in-out infinite alternate; }
@keyframes bob { to { transform: translateY(-1.6px); } }
.art .wheel { transform-box: fill-box; transform-origin: center; animation: spin 1.1s linear infinite; }
.art .lan, .art .sway { transform-box: fill-box; transform-origin: 50% 0; animation: sway var(--d, 2.6s) ease-in-out infinite alternate; }
@keyframes sway { from { transform: rotate(-5deg); } to { transform: rotate(5deg); } }
.art .balloon { animation: float 2.4s ease-in-out infinite alternate; }
@keyframes float { to { transform: translateY(-4px) rotate(2deg); } }
.art .cloud { animation: drift var(--cd, 70s) linear infinite alternate; }
@keyframes drift { to { transform: translateX(40px); } }
.art .steam circle { animation: steam 2.2s ease-out infinite; }
.art .steam circle:nth-child(2) { animation-delay: -1.1s; }
@keyframes steam { from { transform: translateY(6px); opacity: .7; } to { transform: translateY(-18px); opacity: 0; } }
.art .sun { animation: sunrise 6s ease-out both; }
@keyframes sunrise { from { transform: translateY(30px); opacity: .4; } }
.lite .art *, .art.paused * { animation-play-state: paused !important; }

/* 首页标题（浅色天空上用深色字） */
.beat.top-title { top: calc(var(--safe-t) + 58px); text-align: center; color: var(--ink); text-shadow: none; }
.title-h { margin: 0; font-size: clamp(3.4rem, 17vw, 4.6rem); line-height: 1.1; font-weight: 900; color: #8e1c18; letter-spacing: .22em; padding-left: .22em; }
.top-title .sub { margin: 2px 0 0; font-size: .9rem; letter-spacing: .3em; color: #7a4a2a; font-weight: 700; }
.glass.light { background: rgba(255, 248, 234, .88); color: var(--ink); border-color: var(--red); }
.glass.light .quote { color: var(--red); text-shadow: none; }
.pill-hint { display: inline-block; margin: 0 auto; padding: 6px 16px; border-radius: 999px; background: rgba(42, 29, 23, .72); color: #fff4dc; font-size: .85rem; letter-spacing: .15em; animation: nudge 1.6s ease-in-out infinite; text-shadow: none; }
.pill-hint.big { font-size: 1.1rem; font-family: var(--serif); letter-spacing: .1em; }
.beat.bottom { text-align: center; }
.game-bg.art { position: absolute; }
/* 插画放大时保持矢量清晰（不缓存成位图） */
.layer.art { will-change: auto; }
