/* 《南锣来信》水墨胡同 · 样式（theme tokens 见 :root） */
:root {
  --paper: #f3ecdd; --paper-deep: #e6dcc4; --paper-grey: #d8d0bd;
  --ink: #1c1b19; --ink-soft: #3a3834; --ink-mute: #76716a; --ink-dark: #0f0e0d;
  --cinnabar: #b3282d; --cinnabar-deep: #8e1d22; --ochre: #b79a6a;
  --pencil: #5d5a55;
  --ease: cubic-bezier(.22,.61,.36,1);
  --t-slow: 900ms; --t-mid: 520ms; --t-fast: 220ms;
  --font-title: var(--yoroll-font-title, "Songti SC", "STSong", serif);
  --font-body: var(--yoroll-font-body, "PingFang SC", "Noto Sans SC", sans-serif);
  --paper-noise: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' width='180' height='180'><filter id='n'><feTurbulence type='fractalNoise' baseFrequency='.9' numOctaves='2' stitchTiles='stitch'/><feColorMatrix values='0 0 0 0 .35  0 0 0 0 .28  0 0 0 0 .18  0 0 0 .09 0'/></filter><rect width='100%' height='100%' filter='url(%23n)'/></svg>");
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; height: 100%; overflow: hidden; background: #cfc7b3; color: var(--ink); font-family: var(--font-body); }
body { background: radial-gradient(ellipse at 50% 30%, #ddd5c1, #b9b09a); }
button { font: inherit; color: inherit; cursor: pointer; border: 0; background: none; padding: 0; }
button:disabled { cursor: default; }
h1, h2, h3, p { margin: 0; }

#app { position: relative; margin: 0 auto; height: 100vh; height: 100dvh; max-width: 480px; overflow: hidden; background: var(--paper); box-shadow: 0 0 60px rgba(28,27,25,.28); }
#app { background: var(--paper) url("assets/bg_paper.webp") center / cover; }
#app::before { content: ""; position: absolute; inset: 0; background: var(--paper-noise); pointer-events: none; z-index: 0; }
#screen { position: absolute; inset: 0; z-index: 1; }
.screen { position: absolute; inset: 0; display: flex; flex-direction: column; animation: fadeIn var(--t-mid) var(--ease) both; }
.screen.dark { background: var(--ink-dark) radial-gradient(ellipse at 50% 38%, #2a2824 0%, #0f0e0d 70%); color: #e9e2d2; }
.screen.paper { background: transparent; }
.scroll { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; -webkit-overflow-scrolling: touch; padding: 0 22px calc(28px + env(safe-area-inset-bottom)); }
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }
.rise { animation: rise var(--t-slow) var(--ease) both; }

/* topbar */
.topbar { display: flex; align-items: center; gap: 8px; padding: calc(10px + env(safe-area-inset-top)) 14px 8px; min-height: 52px; }
.topbar .back { min-width: 44px; height: 44px; display: grid; place-items: center; font-size: 22px; color: var(--ink-soft); border-radius: 2px; }
.topbar .back:active { background: rgba(28,27,25,.08); }
.topbar .ttl { flex: 1; min-width: 0; font-family: var(--font-title); font-size: 18px; letter-spacing: .12em; text-align: center; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.topbar .sp { width: 44px; }
.dark .topbar .back { color: #cfc7b3; }

/* 静音钮 */
#mute { position: absolute; right: 10px; top: calc(8px + env(safe-area-inset-top)); z-index: 30; width: 34px; height: 34px; border: 1px solid rgba(28,27,25,.3); border-radius: 2px; font-size: 13px; background: rgba(243,236,221,.7); color: var(--ink-soft); font-family: var(--font-title); }
#mute.off { color: var(--ink-mute); text-decoration: line-through; }
#app.is-dark #mute { background: rgba(15,14,13,.5); color: #cfc7b3; border-color: rgba(233,226,210,.35); }

/* buttons */
.btn-seal { display: block; width: 100%; min-height: 50px; padding: 12px 18px; background: var(--cinnabar); color: #f7efe0; font-family: var(--font-title); font-size: 18px; letter-spacing: .3em; text-indent: .3em; text-align: center; border-radius: 3px; box-shadow: inset 0 0 0 1px rgba(255,255,255,.18), 0 2px 0 var(--cinnabar-deep); transition: transform var(--t-fast) var(--ease), opacity var(--t-fast); }
.btn-seal:active:not(:disabled) { transform: translateY(2px); box-shadow: inset 0 0 0 1px rgba(255,255,255,.18); }
.btn-seal:disabled { opacity: .4; }
.btn-line { display: block; width: 100%; min-height: 46px; padding: 10px 16px; border: 1px solid var(--ink-soft); color: var(--ink); text-align: center; letter-spacing: .12em; border-radius: 2px; background: rgba(243,236,221,.4); transition: background var(--t-fast), transform var(--t-fast); }
.btn-line:active:not(:disabled) { background: rgba(28,27,25,.1); transform: translateY(1px); }
.btn-line:disabled { opacity: .4; }
.dark .btn-line { border-color: #cfc7b3; color: #e9e2d2; background: transparent; }
.dark .btn-line:active { background: rgba(233,226,210,.12); }
.btn-text { color: var(--ink-mute); text-decoration: underline; text-underline-offset: 4px; min-height: 44px; padding: 0 8px; letter-spacing: .08em; }
.row { display: flex; gap: 10px; } .row > * { flex: 1; min-width: 0; }
.stack { display: flex; flex-direction: column; gap: 12px; }
.mt { margin-top: 18px; } .mt2 { margin-top: 28px; }
.mute { color: var(--ink-mute); } .small { font-size: 13px; }

/* 印章 / 邮戳 */
.stamp { display: inline-grid; place-items: center; border: 2px solid var(--cinnabar); color: var(--cinnabar); font-family: var(--font-title); line-height: 1.05; text-align: center; padding: 4px 6px; border-radius: 2px; transform: rotate(-6deg); opacity: .92; mix-blend-mode: multiply; }
.stamp.sq { width: 56px; height: 56px; font-size: 22px; }
.stamp.big { width: 88px; height: 88px; font-size: 34px; border-width: 3px; }
.stamp.post { border-radius: 50%; width: 92px; height: 92px; font-size: 13px; letter-spacing: .08em; border-style: double; border-width: 4px; padding: 6px; }
.stamp.drop { animation: stampDrop 700ms var(--ease) both; }
@keyframes stampDrop { 0% { opacity: 0; transform: rotate(-6deg) scale(1.25); } 60% { opacity: 1; } 100% { opacity: .92; transform: rotate(-6deg) scale(1); } }

/* ===== 首页 ===== */
.home { background: transparent; }
.home .art { position: absolute; left: 0; right: 0; top: 0; height: 72%; pointer-events: none; }
.home .art svg { width: 100%; height: 100%; display: block; }
.home .titlebox { position: relative; z-index: 2; padding: calc(70px + env(safe-area-inset-top)) 28px 0; text-align: left; }
.home h1 { font-family: var(--font-title); font-size: 64px; font-weight: 400; letter-spacing: .14em; line-height: 1.1; color: var(--ink); text-shadow: 1px 1px 0 rgba(255,255,255,.4); }
.home .sub { margin-top: 10px; font-family: var(--font-title); font-size: 15px; letter-spacing: .22em; color: var(--ink-soft); }
.home .tag { margin-top: 20px; font-size: 14px; color: var(--ink-mute); letter-spacing: .1em; line-height: 1.8; max-width: 15em; }
.home .bottom { position: relative; z-index: 2; margin-top: auto; padding: 0 28px calc(24px + env(safe-area-inset-bottom)); }
.home .resume { font-size: 13px; color: var(--ink-soft); margin-bottom: 10px; letter-spacing: .06em; display: flex; justify-content: space-between; gap: 8px; }
.home .resume b { font-family: var(--font-title); font-weight: 400; color: var(--cinnabar); }
.home .links { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.home .links button { min-height: 42px; border-bottom: 1px solid rgba(28,27,25,.35); letter-spacing: .14em; font-size: 14px; color: var(--ink-soft); text-align: left; padding: 0 4px; }
.home .links button:active { background: rgba(28,27,25,.07); }

/* ===== 序章 / 暗场 ===== */
.center-col { flex: 1; display: flex; flex-direction: column; justify-content: center; padding: 0 34px; gap: 20px; }
.ink-line { opacity: 0; animation: inkIn 1400ms var(--ease) forwards; font-family: var(--font-title); font-size: 19px; letter-spacing: .14em; line-height: 1.9; filter: blur(3px); }
@keyframes inkIn { from { opacity: 0; filter: blur(4px); } to { opacity: 1; filter: blur(0); } }
.fade-late { opacity: 0; animation: fadeIn 1400ms var(--ease) forwards; }
.dark-wu { font-style: oblique; color: #a79f8e; font-size: 14px; letter-spacing: .1em; }

/* ===== 规则 ===== */
.title-block { padding: 6px 4px 14px; }
.title-block h2 { font-family: var(--font-title); font-size: 30px; font-weight: 400; letter-spacing: .16em; }
.title-block .line { height: 2px; width: 46px; background: var(--cinnabar); margin: 12px 0; }
.rule { display: flex; gap: 14px; align-items: flex-start; padding: 14px 0; border-bottom: 1px dashed rgba(28,27,25,.25); }
.rule .ic { flex: none; width: 36px; height: 36px; border: 1.5px solid var(--ink-soft); display: grid; place-items: center; font-family: var(--font-title); font-size: 17px; border-radius: 2px; }
.rule p { line-height: 1.7; font-size: 15px; padding-top: 5px; }
.warn { margin: 18px 0 6px; border: 2px solid var(--cinnabar); color: var(--cinnabar-deep); padding: 12px 14px; line-height: 1.7; font-size: 15px; background: rgba(179,40,45,.05); }

/* ===== 老吴批注 ===== */
.wu { position: relative; margin: 6px 0; padding: 12px 14px 12px 50px; background: rgba(230,220,196,.55); border-left: 3px solid var(--pencil); min-height: 52px; }
.wu .av { position: absolute; left: 10px; top: 12px; width: 30px; height: 30px; border-radius: 50%; background: var(--ink-soft); color: var(--paper); display: grid; place-items: center; font-family: var(--font-title); font-size: 14px; }
.wu .tx { font-style: oblique; color: var(--pencil); line-height: 1.85; font-size: 15px; letter-spacing: .04em; white-space: pre-wrap; }
.wu .tx .sig { display: block; text-align: right; margin-top: 2px; }
.wu .tx.line-in span { opacity: 0; animation: fadeIn 900ms var(--ease) forwards; }
.dark .wu { background: rgba(233,226,210,.07); border-left-color: #8a8374; }
.dark .wu .tx { color: #b9b19f; } .dark .wu .av { background: #cfc7b3; color: var(--ink-dark); }
/* 通用交互态（与 index.html 内联规则一致，便于其它入口复用） */
button:hover:not(:disabled), [role="button"]:hover, .env-card:hover { filter: brightness(1.04); }
button:active:not(:disabled), [role="button"]:active, .env-card:active { filter: brightness(.94); }
/* 老吴水墨头像（assets/art_laowu.webp 面部裁切；图片缺失时仍显示“吴”字） */
.wu { padding-left: 58px; }
.wu .av, .dark .wu .av { width: 38px; height: 38px; left: 10px; top: 10px; background: #d9cfb8 url(assets/art_laowu.webp) 52% 15% / 260% auto no-repeat; color: transparent; box-shadow: 0 0 0 1.5px var(--ink-soft), 0 0 0 3px rgba(243,236,221,.8); filter: grayscale(.25) contrast(1.05); }
.wu-figure { position: relative; margin: 18px auto 4px; width: min(240px, 66%); aspect-ratio: 2 / 3; background: url(assets/art_laowu.webp) center 0 / cover no-repeat; mix-blend-mode: multiply; -webkit-mask-image: linear-gradient(#000 70%, transparent); mask-image: linear-gradient(#000 70%, transparent); }
.wu-figure-cap { text-align: center; font-family: var(--font-title); letter-spacing: .3em; color: var(--ink-soft); font-size: 14px; margin: -18px 0 10px; position: relative; }
.wu-figure-cap::before { content: ""; display: inline-block; width: 8px; height: 8px; background: var(--cinnabar); margin-right: 10px; vertical-align: middle; }

/* 水墨配图（图集裁切）：谜题 3×2 图集，格 432×412 */
.ink-plate { display: block; background: url(assets/art_puzzles.webp) no-repeat; background-size: 355.56% auto; aspect-ratio: 432 / 412; }
.ink-plate.c-p1 { background-position: 7.25% 13.73%; }
.ink-plate.c-p2 { background-position: 50.18% 13.73%; }
.ink-plate.c-p3 { background-position: 92.93% 13.73%; }
.ink-plate.c-p4 { background-position: 7.25% 86.93%; }
.ink-plate.c-p5 { background-position: 50.18% 86.93%; }
.ink-plate.c-story { background-position: 92.93% 86.93%; }
/* 漂流瓶 / 封存箱 图集，格 640×520 */
.ink-obj { display: block; background: url(assets/art_objects.webp) no-repeat; background-size: 240% auto; aspect-ratio: 640 / 520; mix-blend-mode: multiply; }
.ink-obj.o-bottle { background-position: 8.93% 51.6%; }
.ink-obj.o-box { background-position: 91.52% 49.6%; }
.pz-art { margin: 16px auto 2px; width: min(250px, 68%); transform: rotate(-1.2deg); box-shadow: 0 3px 10px rgba(40,30,15,.18); outline: 6px solid rgba(247,242,229,.9); }
.pz-art.c-p2, .pz-art.c-p4 { transform: rotate(1deg); }
.story-plate { margin: 6px auto 14px; width: min(230px, 64%); transform: rotate(1.4deg); box-shadow: 0 3px 10px rgba(40,30,15,.18); outline: 6px solid rgba(247,242,229,.9); }
.dest-card .ink-obj { width: 100%; max-width: 160px; }
.mine-art { width: min(200px, 56%); margin: 0 auto 6px; }

/* ===== 谜题页 ===== */
.pz-head { padding: 4px 4px 0; }
.pz-no { display: flex; align-items: center; gap: 10px; color: var(--cinnabar); font-family: var(--font-title); letter-spacing: .2em; font-size: 14px; }
.pz-no::after { content: ""; flex: 1; height: 1px; background: rgba(179,40,45,.4); }
.pz-title { font-family: var(--font-title); font-size: 30px; letter-spacing: .1em; font-weight: 400; margin-top: 6px; line-height: 1.2; }
.pz-sub { color: var(--ink-mute); font-size: 13px; letter-spacing: .12em; margin-top: 4px; }
.pz-desc { margin-top: 16px; line-height: 1.95; font-size: 15px; padding: 14px 16px; border: 1px solid rgba(28,27,25,.28); background: rgba(243,236,221,.6); white-space: pre-line; position: relative; }
.pz-desc::before, .pz-desc::after { content: ""; position: absolute; width: 10px; height: 10px; border: 1.5px solid var(--ink-soft); }
.pz-desc::before { left: -1px; top: -1px; border-right: 0; border-bottom: 0; } .pz-desc::after { right: -1px; bottom: -1px; border-left: 0; border-top: 0; }
.pack { margin-top: 14px; display: flex; gap: 12px; align-items: center; padding: 10px 12px; border: 1px dashed var(--ink-mute); }
.pack .tagbox { flex: none; width: 44px; height: 44px; border: 2px solid var(--cinnabar); color: var(--cinnabar); display: grid; place-items: center; font-family: var(--font-title); font-size: 11px; line-height: 1.15; text-align: center; transform: rotate(-4deg); }
.pack p { font-size: 13.5px; line-height: 1.7; color: var(--ink-soft); }
.field { margin-top: 18px; }
.field label { display: block; font-size: 13px; letter-spacing: .18em; color: var(--ink-mute); margin-bottom: 2px; }
.field input { width: 100%; font: inherit; font-size: 20px; letter-spacing: .12em; padding: 10px 2px 8px; border: 0; border-bottom: 1.5px solid var(--ink-soft); background: transparent; color: var(--ink); border-radius: 0; outline: none; transition: border-color var(--t-fast); }
.field input::placeholder { color: #aaa293; letter-spacing: .08em; font-size: 15px; }
.field input:focus { border-bottom-color: var(--cinnabar); border-bottom-width: 2px; }
.field.err input { border-bottom-color: var(--cinnabar); }
.shake { animation: shake 360ms var(--ease); }
@keyframes shake { 0%,100% { transform: none; } 25% { transform: translateX(-4px); } 75% { transform: translateX(4px); } }
.msg { margin-top: 14px; min-height: 24px; font-size: 14.5px; line-height: 1.7; color: var(--cinnabar-deep); }
.msg.ok { color: var(--ink-soft); }

/* 提示阶梯 */
.hints { margin-top: 18px; }
.hint-btn { display: flex; align-items: center; gap: 8px; min-height: 44px; color: var(--pencil); font-style: oblique; border-bottom: 1px solid rgba(93,90,85,.5); width: 100%; letter-spacing: .08em; }
.hint-btn .lv { margin-left: auto; font-style: normal; font-size: 12px; color: var(--ink-mute); }
.hint-list { margin-top: 8px; display: flex; flex-direction: column; gap: 8px; }
.hint { padding: 8px 12px; border-left: 3px solid var(--ochre); background: rgba(183,154,106,.12); animation: rise var(--t-mid) var(--ease) both; }
.hint small { display: block; font-size: 11.5px; color: var(--ink-mute); letter-spacing: .14em; margin-bottom: 2px; }
.hint p { font-style: oblique; color: var(--pencil); font-size: 14.5px; line-height: 1.8; }

/* 密码锁 */
.diary { margin: 18px auto 0; width: 100%; padding: 22px 16px 18px; background: linear-gradient(135deg, #6f5a3f, #4e3f2b); border-radius: 3px 8px 8px 3px; box-shadow: inset 6px 0 0 rgba(0,0,0,.28), 0 6px 14px rgba(28,27,25,.3); position: relative; color: #e9dcc0; text-align: center; transition: transform var(--t-slow) var(--ease), filter var(--t-slow); }
.diary .lab { font-family: var(--font-title); letter-spacing: .5em; text-indent: .5em; font-size: 20px; border: 1px solid rgba(233,220,192,.5); display: inline-block; padding: 8px 16px; margin-bottom: 18px; }
.diary.open { transform: perspective(600px) rotateY(-14deg); filter: brightness(1.1); }
.wheels { display: flex; justify-content: center; gap: 10px; }
.wheel { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.wheel .arrow { width: 52px; height: 36px; color: #e9dcc0; font-size: 14px; border-radius: 2px; background: rgba(0,0,0,.18); }
.wheel .arrow:active { background: rgba(0,0,0,.4); }
.wheel .win { width: 52px; height: 62px; overflow: hidden; background: #efe5cd; color: var(--ink); border: 2px solid #2b2318; border-radius: 3px; position: relative; box-shadow: inset 0 6px 8px rgba(0,0,0,.25), inset 0 -6px 8px rgba(0,0,0,.25); }
.wheel .strip { position: absolute; left: 0; right: 0; top: 0; transition: transform 200ms var(--ease); }
.wheel .strip div { height: 62px; display: grid; place-items: center; font-family: var(--font-title); font-size: 34px; }
.diary.bad { animation: shake 360ms var(--ease); }

/* 成功层 */
.overlay { position: absolute; inset: 0; z-index: 20; display: flex; align-items: center; justify-content: center; padding: 28px; background: rgba(28,27,25,.0); animation: veil var(--t-slow) var(--ease) forwards; }
@keyframes veil { to { background: rgba(28,27,25,.62); } }
.overlay .card { position: relative; width: 100%; max-width: 380px; background: var(--paper); padding: 30px 22px 22px; text-align: center; border: 1px solid var(--ink-soft); box-shadow: 0 10px 30px rgba(0,0,0,.35); animation: rise var(--t-slow) var(--ease) both; overflow: hidden; }
.overlay .card::before { content: ""; position: absolute; left: 50%; top: 80px; width: 40px; height: 40px; margin: -20px; border-radius: 50%; background: radial-gradient(circle, rgba(28,27,25,.28), rgba(28,27,25,0) 70%); animation: spread 1500ms var(--ease) both; pointer-events: none; }
@keyframes spread { from { transform: scale(.3); opacity: .9; } to { transform: scale(11); opacity: 0; } }
.card h3 { font-family: var(--font-title); font-size: 24px; letter-spacing: .18em; font-weight: 400; margin: 14px 0 8px; }
.card p { line-height: 1.8; color: var(--ink-soft); font-size: 15px; }
.card .stamp { margin-top: 4px; }
.card .wu { text-align: left; margin-top: 14px; }

/* modal */
.modal { position: absolute; inset: 0; z-index: 40; display: flex; align-items: center; justify-content: center; padding: 28px; background: rgba(28,27,25,.55); animation: fadeIn var(--t-fast) both; }
.modal .box { width: 100%; max-width: 360px; background: var(--paper); border: 1px solid var(--ink-soft); padding: 22px 20px 16px; box-shadow: 0 10px 30px rgba(0,0,0,.35); }
.modal h3 { font-family: var(--font-title); font-weight: 400; font-size: 20px; letter-spacing: .14em; margin-bottom: 10px; }
.modal p { line-height: 1.8; font-size: 14.5px; color: var(--ink-soft); }
.toast { position: absolute; left: 50%; bottom: calc(40px + env(safe-area-inset-bottom)); transform: translateX(-50%); z-index: 60; max-width: 86%; padding: 10px 16px; background: rgba(28,27,25,.9); color: #efe7d3; font-size: 14px; line-height: 1.6; border-radius: 2px; animation: fadeIn var(--t-fast) both; pointer-events: none; }

/* ===== 进度 ===== */
.role-card { display: flex; align-items: center; gap: 14px; padding: 14px; border: 1px solid var(--ink-soft); background: rgba(243,236,221,.6); }
.role-card .nm { font-family: var(--font-title); font-size: 24px; letter-spacing: .14em; }
.role-card .nt { font-size: 13px; color: var(--ink-mute); margin-top: 2px; }
.role-steps { display: flex; gap: 0; margin: 14px 0 4px; }
.role-steps span { flex: 1; text-align: center; font-size: 11.5px; letter-spacing: .06em; color: var(--ink-mute); padding-top: 12px; position: relative; }
.role-steps span::before { content: ""; position: absolute; left: 0; right: 0; top: 4px; height: 2px; background: var(--paper-grey); }
.role-steps span::after { content: ""; position: absolute; left: 50%; top: 0; width: 10px; height: 10px; margin-left: -5px; border-radius: 50%; background: var(--paper-grey); }
.role-steps span.on { color: var(--ink); } .role-steps span.on::before { background: var(--ink-soft); } .role-steps span.on::after { background: var(--cinnabar); }
.stats { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-top: 14px; }
.stats div { border: 1px solid rgba(28,27,25,.3); padding: 10px 12px; }
.stats b { font-family: var(--font-title); font-weight: 400; font-size: 26px; color: var(--cinnabar); } .stats span { font-size: 12.5px; color: var(--ink-mute); display: block; letter-spacing: .1em; }
.chap { margin-top: 20px; }
.chap h3 { font-family: var(--font-title); font-weight: 400; letter-spacing: .14em; font-size: 18px; display: flex; align-items: center; gap: 8px; }
.chap h3 small { font-size: 12px; color: var(--ink-mute); letter-spacing: .1em; font-family: var(--font-body); }
.task { display: flex; align-items: center; gap: 10px; padding: 11px 4px; border-bottom: 1px dashed rgba(28,27,25,.25); font-size: 14.5px; min-height: 44px; }
.task .dot { flex: none; width: 22px; height: 22px; border: 1.5px solid var(--ink-mute); border-radius: 50%; display: grid; place-items: center; font-size: 12px; color: transparent; }
.task.done .dot { border-color: var(--cinnabar); background: var(--cinnabar); color: #f7efe0; }
.task.cur .dot { border-color: var(--cinnabar); } .task.cur { font-weight: bold; }
.task.lock { color: #a39b8a; }
.task .go { margin-left: auto; color: var(--cinnabar); letter-spacing: .1em; font-size: 13px; min-height: 36px; padding: 0 4px; }
.task .tg { margin-left: auto; font-size: 12px; color: var(--cinnabar); letter-spacing: .12em; }

/* ===== 信件列表 ===== */
.env-card { display: flex; gap: 14px; align-items: center; width: 100%; text-align: left; padding: 14px; margin-top: 12px; border: 1px solid var(--ink-soft); background: linear-gradient(135deg, #efe3c6, #e3d5b2); position: relative; min-height: 78px; }
.env-card::before { content: ""; position: absolute; inset: 5px; border: 1px solid rgba(28,27,25,.2); pointer-events: none; }
.env-card:active { transform: translateY(1px); }
.env-card.locked { background: rgba(216,208,189,.4); border-style: dashed; color: #9a927f; }
.env-card .meta { flex: 1; min-width: 0; }
.env-card .t { font-family: var(--font-title); font-size: 18px; letter-spacing: .08em; overflow-wrap: anywhere; }
.env-card .s { font-size: 12.5px; color: var(--ink-mute); margin-top: 4px; letter-spacing: .06em; }
.env-card .stamp { flex: none; }

/* ===== 信件阅读 ===== */
.letter-stage { flex: 1; min-height: 0; overflow-y: auto; overflow-x: hidden; padding: 6px 18px calc(24px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; }
.envelope { margin: auto; width: 100%; max-width: 330px; aspect-ratio: 1.5; position: relative; cursor: pointer; perspective: 800px; }
.envelope .body { position: absolute; inset: 0; background: linear-gradient(135deg, #e8d9b4, #d9c8a0); border: 1px solid #8d7b55; box-shadow: 0 8px 18px rgba(28,27,25,.28); }
.envelope .body::before { content: ""; position: absolute; inset: 0; background: linear-gradient(to top right, transparent 49.4%, rgba(120,100,60,.45) 50%, transparent 50.6%), linear-gradient(to top left, transparent 49.4%, rgba(120,100,60,.45) 50%, transparent 50.6%); }
.envelope .addr { position: absolute; left: 14%; right: 14%; bottom: 14%; font-family: var(--font-title); font-size: 15px; letter-spacing: .2em; color: var(--ink-soft); text-align: center; }
.envelope .flap { position: absolute; left: 0; right: 0; top: 0; height: 56%; background: linear-gradient(160deg, #e4d3aa, #cdb98c); clip-path: polygon(0 0, 100% 0, 50% 100%); transform-origin: top; transition: transform 900ms var(--ease); border: 0; }
.envelope.open .flap { transform: rotateX(180deg); }
.envelope .seal { position: absolute; left: 50%; top: 46%; transform: translate(-50%, -50%); z-index: 3; transition: opacity 500ms; }
.envelope.open .seal { opacity: 0; }
.env-hint { text-align: center; color: var(--ink-mute); letter-spacing: .2em; font-size: 13px; margin-top: 18px; animation: pulse 2.4s ease-in-out infinite; }
@keyframes pulse { 50% { opacity: .4; } }
.sheet-wrap { margin: 0 auto; width: 100%; transform-origin: top; animation: unfold 1000ms var(--ease) both; }
@keyframes unfold { from { opacity: 0; transform: scaleY(.15); } to { opacity: 1; transform: none; } }
.sheet { position: relative; padding: 30px 24px 26px; border: 1px solid rgba(60,50,30,.35); box-shadow: 0 6px 16px rgba(28,27,25,.22); overflow: hidden; }
.sheet .reveal { opacity: 0; animation: inkIn 1200ms var(--ease) forwards; }
.sheet .sal { font-size: 17px; margin-bottom: 14px; }
.sheet .para { font-size: 16px; line-height: 2; text-indent: 2em; margin-bottom: 6px; text-align: justify; }
.sheet .sign { margin-top: 18px; text-align: right; white-space: pre-line; line-height: 1.8; font-size: 15px; }
.sheet .arc { font-size: 11.5px; letter-spacing: .14em; color: var(--ink-mute); margin-bottom: 14px; }
.sheet .stamp { position: absolute; }
/* 军报：泛黄折痕 */
.sheet.military { background: linear-gradient(180deg, #e7d49f, #dcc78a 60%, #d4bd7c); font-family: var(--font-title); color: #2a2218; }
.sheet.military .para, .sheet.military .sal, .sheet.military .sign { font-family: var(--font-body); }
.sheet.military::before { content: ""; position: absolute; left: 0; right: 0; top: 34%; height: 2px; background: rgba(90,70,30,.28); box-shadow: 0 1px 0 rgba(255,255,255,.3); }
.sheet.military::after { content: ""; position: absolute; left: 0; right: 0; top: 68%; height: 2px; background: rgba(90,70,30,.22); }
.sheet.military .stamp { right: 16px; top: 14px; }
.sheet.military .head { font-family: var(--font-title); font-size: 24px; letter-spacing: .5em; color: var(--cinnabar-deep); border-bottom: 2px solid var(--cinnabar-deep); padding-bottom: 6px; margin-bottom: 8px; }
/* 公函：50 年代 */
.sheet.office { background: #f1ede1; background-image: repeating-linear-gradient(0deg, transparent 0 31px, rgba(60,80,110,.0) 31px 32px); font-family: "SimSun", "Songti SC", var(--font-body); }
.sheet.office .head { text-align: center; font-family: var(--font-title); letter-spacing: .4em; font-size: 22px; padding-bottom: 8px; border-bottom: 3px double var(--ink-soft); margin-bottom: 12px; }
.sheet.office .sign { padding-right: 70px; }
.sheet.office .stamp { right: 26px; bottom: 44px; width: 78px; height: 78px; border-radius: 50%; font-size: 13px; letter-spacing: .05em; }
.photo { margin: 14px 0 4px; width: 132px; height: 126px; background: #b5ac98 url(assets/art_puzzles.webp) 50.18% 13.73% / 355.56% auto no-repeat; filter: sepia(.35) grayscale(.3) contrast(1.05); border: 6px solid #f7f2e5; box-shadow: 0 2px 6px rgba(0,0,0,.3); transform: rotate(-3deg); position: relative; }
.photo::after { content: "光绪廿六年"; position: absolute; left: 0; right: 0; bottom: 4px; text-align: center; font-size: 11px; color: #f2eddc; letter-spacing: .1em; font-family: var(--font-title); }
/* 家书：横格 */
.sheet.family { background: #f6f0df; background-image: repeating-linear-gradient(0deg, transparent 0 33px, rgba(120,100,70,.28) 33px 34px); font-family: var(--font-body); }
.sheet.family .para { line-height: 34px; margin: 0; font-size: 17px; letter-spacing: .04em; }
.sheet.family .sal { line-height: 34px; margin: 0 0 0; font-size: 17px; }
.sheet.family .sign { line-height: 34px; margin-top: 6px; }
.sheet.family::before { content: ""; position: absolute; left: 12px; top: 0; bottom: 0; width: 1px; background: rgba(179,40,45,.35); }
.sheet .anno { margin-top: 18px; }

/* ===== 故事 ===== */
.story-art { height: 120px; margin: 4px 0 12px; }
.story p { line-height: 2; font-size: 16px; text-indent: 2em; margin-bottom: 10px; }
.story .mean { margin-top: 14px; border-top: 1px solid var(--ink-soft); padding-top: 10px; font-family: var(--font-title); letter-spacing: .3em; color: var(--cinnabar); text-align: center; }

/* 占位（终章批次接入前） */
.soon { text-align: center; color: var(--ink-mute); line-height: 2; }

/* ===================== 终章 ===================== */
.later-btn { opacity: 0; pointer-events: none; transition: opacity 900ms var(--ease); }
.later-btn.ready { opacity: 1; pointer-events: auto; }
.skip .later-btn { opacity: 1; pointer-events: auto; }
.note-paper .reveal, .blank-sheet .reveal, .end-lines .reveal { opacity: 0; animation: inkIn 1200ms var(--ease) forwards; }
.skip .note-paper .reveal, .skip .blank-sheet .reveal, .skip .end-lines .reveal { animation-delay: 0s !important; animation-duration: 300ms !important; }

/* 暗场提问 */
.fin-q::after { content: ""; position: absolute; left: 50%; top: 40%; width: 300px; height: 300px; margin: -150px; border-radius: 50%; background: radial-gradient(circle, rgba(233,226,210,.08), rgba(233,226,210,0) 70%); animation: bloom 5s var(--ease) both; pointer-events: none; }
@keyframes bloom { from { transform: scale(.3); opacity: 0; } to { transform: scale(1.4); opacity: 1; } }
.fq { align-items: center; text-align: center; }
.fq .q { font-size: 24px; line-height: 2; letter-spacing: .16em; }
.fq-choices { position: relative; z-index: 1; padding: 0 34px calc(44px + env(safe-area-inset-bottom)); display: flex; flex-direction: column; gap: 12px; }
.choice { opacity: 0; pointer-events: none; transition: opacity 1200ms var(--ease), background var(--t-fast); position: relative; }
.choice.ready { opacity: 1; pointer-events: auto; }
.choice::before { content: ""; position: absolute; left: 12px; top: 50%; width: 6px; height: 6px; margin-top: -3px; background: var(--cinnabar); }

/* 老吴笔记 / 旧纸 */
.screen.note { background: linear-gradient(180deg, #e7dbb5, #dccf9f); }
.note-scroll { padding-top: 6px; }
.note-paper { position: relative; padding: 18px 20px 24px; background-color: #f1e8cf; background-image: repeating-linear-gradient(0deg, transparent 0 35px, rgba(120,100,70,.24) 35px 36px); border: 1px solid rgba(60,50,30,.35); box-shadow: 0 6px 16px rgba(28,27,25,.2); }
.note-head { font-family: var(--font-title); font-size: 22px; line-height: 36px; letter-spacing: .2em; }
.nline { margin: 0; line-height: 36px; font-size: 16px; overflow-wrap: anywhere; }
.nline.pencil { font-style: oblique; color: var(--pencil); text-decoration: underline; text-decoration-color: rgba(93,90,85,.55); text-underline-offset: 6px; }
.note-seal { position: absolute; right: 12px; top: 10px; opacity: 0; width: 46px; height: 46px; font-size: 19px; animation-fill-mode: both; }

/* 最后任务：空白信纸 */
.screen.task { background: var(--paper); }
.blank-sheet { margin-top: 10px; padding: 26px 22px 30px; background: #f8f3e4; border: 1px solid rgba(60,50,30,.3); box-shadow: 0 6px 16px rgba(28,27,25,.18); min-height: 380px; }
.wl-head { font-family: var(--font-title); letter-spacing: .3em; color: var(--ink-mute); font-size: 14px; margin-bottom: 14px; border-bottom: 1px solid rgba(28,27,25,.2); padding-bottom: 8px; }
.wl { font-style: oblique; color: var(--pencil); line-height: 2.1; font-size: 16.5px; margin-bottom: 10px; overflow-wrap: anywhere; }
.wl-sig { text-align: right; font-style: oblique; color: var(--pencil); margin-top: 6px; }

/* 写信 */
.write-sheet { margin-top: 6px; padding: 20px 16px 18px; background: #f8f3e4; border: 1px solid rgba(60,50,30,.3); box-shadow: 0 6px 16px rgba(28,27,25,.16); }
.write-sheet h2 { font-family: var(--font-title); font-weight: 400; font-size: 26px; letter-spacing: .14em; }
.write-sheet .line { height: 2px; width: 40px; background: var(--cinnabar); margin: 10px 0; }
.write-sheet .help { font-size: 13.5px; line-height: 1.8; color: var(--ink-mute); }
.wlabel { display: block; font-size: 13px; letter-spacing: .14em; color: var(--ink-mute); margin: 16px 0 6px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { min-height: 38px; padding: 6px 12px; border: 1px solid rgba(28,27,25,.4); font-size: 14px; letter-spacing: .05em; border-radius: 2px; text-align: left; max-width: 100%; overflow-wrap: anywhere; }
.chip.on { border-color: var(--cinnabar); color: var(--cinnabar-deep); background: rgba(179,40,45,.07); }
.wfield { display: block; width: 100%; font: inherit; font-size: 17px; padding: 8px 2px; border: 0; border-bottom: 1.5px solid var(--ink-soft); background: transparent; color: var(--ink); outline: none; border-radius: 0; }
.wfield:focus { border-bottom-color: var(--cinnabar); }
textarea.wfield { border: 1px solid rgba(28,27,25,.3); padding: 0 10px; line-height: 34px; min-height: 276px; resize: none; background: repeating-linear-gradient(0deg, transparent 0 33px, rgba(120,100,70,.25) 33px 34px); background-color: rgba(255,255,255,.25); }
textarea.wfield:focus { border-color: var(--cinnabar); }
.wcount { display: flex; justify-content: space-between; gap: 8px; font-size: 12.5px; color: var(--ink-mute); margin-top: 6px; }
.wcount.bad b { color: var(--cinnabar); }
.pub { margin-top: 14px; padding-top: 10px; border-top: 1px dashed rgba(28,27,25,.3); font-size: 13px; line-height: 1.7; color: var(--ink-mute); }

/* 预览 / 信纸（通用家书风） */
.sheet.prev { padding: 26px 22px 24px; }
.sheet.prev .to { font-size: 15px; color: var(--ink-mute); letter-spacing: .1em; line-height: 34px; overflow-wrap: anywhere; }
.sheet.prev .bt { font-family: var(--font-title); font-weight: 400; font-size: 22px; letter-spacing: .1em; line-height: 34px; overflow-wrap: anywhere; }
.sheet .pre { white-space: pre-wrap; text-indent: 0; overflow-wrap: anywhere; }
.sheet.unfold { animation: unfold 900ms var(--ease) both; transform-origin: top; }

/* 去向选择 */
.dest { display: flex; flex-direction: column; gap: 18px; margin-top: 6px; }
.dest-card { padding: 18px 16px 16px; border: 1px solid var(--ink-soft); background: rgba(243,236,221,.6); display: flex; flex-direction: column; align-items: center; gap: 12px; text-align: center; }
.dest-card svg { width: 84px; height: 64px; }
.dest-card p { font-size: 14px; line-height: 1.7; color: var(--ink-soft); }
.dest-card .pub-note { font-size: 12.5px; color: var(--cinnabar-deep); border-top: 1px dashed rgba(179,40,45,.35); padding-top: 8px; }
.dest-card .btn-seal { letter-spacing: .12em; text-indent: .12em; }

/* 封存 / 漂出动画 */
.screen.anim { align-items: center; }
.anim-wrap { flex: 1; min-height: 0; width: 100%; overflow-y: auto; overflow-x: hidden; display: flex; flex-direction: column; align-items: center; padding: 56px 20px calc(24px + env(safe-area-inset-bottom)); }
.anim-stage { position: relative; flex: none; width: 100%; max-width: 330px; height: 400px; margin-top: auto; }
.anim-text { margin: 18px auto auto; max-width: 330px; text-align: center; opacity: 0; transition: opacity 1400ms var(--ease); }
.anim-text h2 { font-family: var(--font-title); font-weight: 400; font-size: 24px; letter-spacing: .16em; line-height: 1.5; }
.anim-text p { margin-top: 8px; font-size: 14.5px; line-height: 1.8; color: #b9b19f; }
.anim-wrap.done .anim-text { opacity: 1; }
.anim-text .btn-seal { pointer-events: none; } .anim-wrap.done .anim-text .btn-seal { pointer-events: auto; }
.skip-anim { color: #8a8374; align-self: center; margin-top: 8px; }
.pap { position: absolute; left: 50%; top: 30px; width: 190px; height: 240px; margin-left: -95px; padding: 18px 14px; background-color: #f6f0df; background-image: repeating-linear-gradient(0deg, transparent 0 25px, rgba(120,100,70,.25) 25px 26px); color: var(--ink); box-shadow: 0 8px 22px rgba(0,0,0,.45); overflow: hidden; opacity: 0; z-index: 2; transition: transform 1000ms var(--ease), opacity 1000ms var(--ease); }
.pap .pt { font-family: var(--font-title); font-size: 15px; letter-spacing: .1em; line-height: 26px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pap .pb { font-size: 12.5px; line-height: 26px; display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden; overflow-wrap: anywhere; white-space: pre-wrap; }
.s1 .pap { opacity: 1; }
/* 封存 / 漂出动画的具体编排见文件末尾「生成素材动画」 */

/* 结局 / 远方来信 / 拾信 */
.screen.endscr { background: transparent; }
.end-art { position: relative; height: 200px; margin: 0 -22px; }
.end-stamp { position: absolute; right: 22px; top: 14px; }
.end-lines { padding: 14px 4px 0; text-align: center; }
.el { font-family: var(--font-title); font-size: 17px; line-height: 2; letter-spacing: .12em; overflow-wrap: anywhere; }
.el.big { font-size: 19px; color: var(--cinnabar-deep); }
.end-gap { height: 16px; }
.water-head { height: 170px; margin: 0 -22px 6px; }
.remote-p { font-size: 15px; line-height: 1.95; color: var(--ink-soft); margin-bottom: 6px; }
.center { text-align: center; }
.notice { margin-top: 16px; padding: 10px 12px; border: 1px dashed var(--ink-mute); font-size: 12.5px; line-height: 1.7; color: var(--ink-mute); }
.empty-note { margin: 28px 6px 6px; padding: 26px 18px; text-align: center; line-height: 2; color: var(--ink-soft); border: 1px solid rgba(28,27,25,.25); background: rgba(243,236,221,.6); }
.status-line { margin-top: 14px; font-size: 13.5px; line-height: 1.7; color: var(--ink-mute); text-align: center; }

@media (hover: hover) {
  .btn-seal:hover:not(:disabled) { background: #c2323a; }
  .btn-line:hover:not(:disabled) { background: rgba(28,27,25,.07); }
  .dark .btn-line:hover { background: rgba(233,226,210,.1); }
  .env-card:hover:not(.locked) { background: linear-gradient(135deg, #f2e7cb, #e8dbb9); }
  .home .links button:hover, .topbar .back:hover, .task .go:hover, .wheel .arrow:hover, .hint-btn:hover, #mute:hover { background: rgba(28,27,25,.07); }
  .btn-text:hover { color: var(--ink); }
}
#mute:active, .hint-btn:active, .task .go:active { background: rgba(28,27,25,.12); }
.skip .ink-line, .skip .fade-late, .skip .reveal { animation-delay: 0s !important; animation-duration: 300ms !important; }
@media (max-height: 640px) {
  .home h1 { font-size: 50px; } .home .titlebox { padding-top: 46px; } .home .tag { margin-top: 10px; }
  .pz-title { font-size: 26px; }
}

/* =====================================================================
 * 本轮：生成素材替换绘制（纸张 / 道具动画 / 古风主视觉）
 *  assets/art_papers.webp 1536×1024：左 泛黄军报纸 / 中 红框公函纸 / 右 毛边宣纸（内框裁切后拉伸铺满）
 *  assets/art_props.webp  1536×1024 透明：空瓶+瓶塞 / 信卷 / 火漆信封 / 开盖木匣 / 合盖木匣 / 装信漂流瓶
 *  assets/art_home.webp   1024×1536：水墨胡同、红门、古槐、什刹海湖面
 * ===================================================================== */
:root {
  --pp-mil: #d6bd8c url(assets/art_papers.webp) 5.63% 48.4% / 353.1% 127.2% no-repeat;
  --pp-off: #e7e5dd url(assets/art_papers.webp) 49.86% 49.07% / 334.6% 126.7% no-repeat;
  --pp-fam: #efe6d1 url(assets/art_papers.webp) 93.4% 50.2% / 371% 132.1% no-repeat;
}
/* 信纸：去掉绘制的格线/折痕/边框，改垫生成纸张 */
.sheet { border: 0; box-shadow: 0 8px 20px rgba(28,27,25,.28), 0 1px 3px rgba(28,27,25,.2); }
.sheet.military, .note-paper { background: var(--pp-mil); }
.sheet.office { background: var(--pp-off); padding: 44px 38px 42px; }
.sheet.family, .sheet.prev, .blank-sheet, .write-sheet, .pap { background: var(--pp-fam); }
.sheet.military::before, .sheet.military::after, .sheet.family::before { display: none; }
.note-paper, .blank-sheet, .write-sheet { border: 0; box-shadow: 0 8px 20px rgba(28,27,25,.24), 0 1px 3px rgba(28,27,25,.18); }
.sheet.family .para, .sheet.family .sal, .sheet.family .sign { color: #2a2620; }
.sheet.office .stamp { right: 40px; bottom: 52px; }
.sheet.office .sign { padding-right: 84px; }
.write-sheet .wfield, .write-sheet textarea.wfield { background-color: rgba(255,252,242,.35); }
textarea.wfield { background-image: none; }
.pap { padding: 22px 18px; }
/* 信件档案卡：宣纸片 */
.env-card { border: 0; background: var(--pp-fam); box-shadow: 0 4px 12px rgba(28,27,25,.2); }
.env-card::before { display: none; }
@media (hover: hover) { .env-card:hover:not(.locked) { background: var(--pp-fam); filter: brightness(1.04); } }
.env-card.locked { background: rgba(216,208,189,.45); border: 1px dashed rgba(28,27,25,.35); box-shadow: none; }

/* 道具精灵（透明图集裁切） */
.sp { position: absolute; display: block; background-image: url(assets/art_props.webp); background-repeat: no-repeat; pointer-events: none; }
.sp-bottle { aspect-ratio: 234 / 360; background-size: 656.4% 284.4%; background-position: 13.67% 13.86%; }
.sp-scroll { aspect-ratio: 392 / 228; background-size: 391.8% 449.1%; background-position: 49.48% 19.6%; }
.sp-env    { aspect-ratio: 372 / 262; background-size: 412.9% 390.8%; background-position: 92.96% 18.9%; }
.sp-boxo   { aspect-ratio: 378 / 354; background-size: 406.3% 289.3%; background-position: 7.43% 84.18%; }
.sp-boxc   { aspect-ratio: 378 / 278; background-size: 406.3% 368.3%; background-position: 49.91% 83.38%; }
.sp-bfull  { aspect-ratio: 392 / 192; background-size: 391.8% 533.3%; background-position: 94.06% 78.37%; }

/* 读信页信封：火漆信封图，点按后上提淡出 */
.envelope { aspect-ratio: 372 / 262; max-width: 300px; perspective: none; }
.envelope .body { background: url(assets/art_props.webp) 92.96% 18.9% / 412.9% 390.8% no-repeat; border: 0; box-shadow: none; filter: drop-shadow(0 10px 14px rgba(28,27,25,.3)); transition: transform 900ms var(--ease), opacity 900ms var(--ease); }
.envelope .body::before, .envelope .flap, .envelope .seal { display: none; }
.envelope .addr { left: -10%; right: -10%; bottom: -46px; font-size: 16px; }
.envelope:not(.open) .body { animation: envIdle 3.2s ease-in-out infinite; }
@keyframes envIdle { 0%,100% { transform: rotate(-1.5deg); } 50% { transform: rotate(1.5deg) translateY(-3px); } }
.envelope.open .body { transform: translateY(-40px) scale(1.08) rotate(-5deg); opacity: 0; }
.envelope.open .addr { opacity: 0; transition: opacity 500ms; }
.env-hint { margin-top: 64px; }

/* ---------- 封存动画 ---------- */
.anim-stage .sp { opacity: 0; }
.sealst .a-env { left: 50%; top: 70px; width: 210px; margin-left: -105px; z-index: 3; transform: scale(.75) rotate(8deg); transition: transform 900ms var(--ease), opacity 700ms var(--ease); filter: drop-shadow(0 8px 12px rgba(0,0,0,.45)); }
.sealst .a-boxo { left: 50%; bottom: 0; width: 240px; margin-left: -120px; z-index: 2; transform: translateY(30px); transition: transform 900ms var(--ease), opacity 700ms var(--ease); filter: drop-shadow(0 10px 14px rgba(0,0,0,.5)); }
.sealst .a-boxc { left: 50%; bottom: 0; width: 205px; margin-left: -118px; z-index: 2; transition: opacity 260ms ease-out; filter: drop-shadow(0 10px 14px rgba(0,0,0,.5)); }
.sealst .a-seal { position: absolute; left: 50%; bottom: 96px; margin-left: 30px; z-index: 5; opacity: 0; }
.sealst .a-seal .stamp { width: 78px; height: 78px; font-size: 18px; background: rgba(243,236,221,.92); color: var(--cinnabar); border-color: var(--cinnabar); mix-blend-mode: normal; box-shadow: 0 4px 10px rgba(0,0,0,.4); }
.sealst.s2 .pap { transform: scale(.9,.4) translateY(40px); opacity: 0; }
.sealst.s2 .a-env { opacity: 1; transform: none; }
.sealst.s3 .a-env { animation: waxPress 600ms var(--ease); }
.sealst.s3 .a-boxo { opacity: 1; transform: none; }
@keyframes waxPress { 40% { transform: scale(.94); } 100% { transform: none; } }
.sealst.s4 .a-env { transform: translateY(150px) scale(.5) rotate(-6deg); opacity: 0; transition: transform 1400ms cubic-bezier(.5,0,.4,1), opacity 380ms 1100ms; }
.sealst.s5 .a-boxo { opacity: 0; transition: opacity 260ms ease-out; }
.sealst.s5 .a-boxc { opacity: 1; animation: lidThump 520ms var(--ease); }
@keyframes lidThump { 0% { transform: translateY(-6px) scaleY(1.04); } 55% { transform: translateY(2px) scaleY(.97); } 100% { transform: none; } }
.sealst.s6 .a-seal { opacity: 1; } .sealst.s6 .a-seal .stamp { animation: stampDrop 700ms var(--ease) both; }

/* ---------- 漂出动画 ---------- */
.fl-scene { position: absolute; inset: 0; opacity: 0; transition: opacity 1400ms var(--ease); background: #efe6d1 url(assets/art_home.webp) 50% 100% / 170% auto no-repeat; }
.s5 .fl-scene { opacity: 1; animation: lakeDrift 14s ease-in-out infinite alternate; }
@keyframes lakeDrift { from { background-position: 46% 100%; } to { background-position: 56% 99%; } }
.flt .a-scroll { left: 50%; top: 120px; width: 180px; margin-left: -90px; z-index: 3; transform: scale(.6); transition: transform 900ms var(--ease), opacity 700ms var(--ease); filter: drop-shadow(0 6px 10px rgba(0,0,0,.4)); }
.a-float { position: absolute; left: 50%; top: 150px; width: 200px; height: 200px; margin-left: -100px; z-index: 4; transition: transform 1600ms var(--ease), opacity 1000ms; }
.flt .a-bottle { left: 50%; top: 50%; width: 120px; margin: -92px 0 0 -60px; transform: translateY(24px); transition: transform 1000ms var(--ease), opacity 800ms var(--ease); filter: drop-shadow(0 8px 12px rgba(0,0,0,.4)); }
.a-bob { position: absolute; inset: 0; }
.flt .a-bfull { left: 50%; top: 50%; width: 196px; margin: -48px 0 0 -98px; transform: rotate(90deg); transition: transform 1000ms var(--ease), opacity 800ms var(--ease); }
.flt .a-refl { left: 50%; top: 50%; width: 196px; margin: 34px 0 0 -98px; transform: scaleY(-.6); transform-origin: top; -webkit-mask-image: linear-gradient(transparent 10%, #000); mask-image: linear-gradient(transparent 10%, #000); filter: blur(1.5px); transition: opacity 1200ms; }
.flt.s2 .pap { transform: scale(.1,.85); opacity: 0; transition: transform 1000ms var(--ease), opacity 600ms 500ms; }
.flt.s2 .a-scroll { opacity: 1; transform: none; }
.flt.s3 .a-bottle { opacity: 1; transform: none; }
.flt.s3 .a-scroll { transform: translateY(78px) rotate(90deg) scale(.32); opacity: 0; transition: transform 1300ms cubic-bezier(.5,0,.4,1), opacity 350ms 1050ms; }
.flt.s4 .a-bottle { transform: rotate(-90deg); opacity: 0; }
.flt.s4 .a-bfull { transform: none; opacity: 1; }
.flt.s5 .a-float { transform: translateY(78px) scale(.82); }
.flt.s5 .a-bob { animation: bob 2.6s ease-in-out 1.2s infinite; }
.flt.s5 .a-refl { opacity: .22; }
@keyframes bob { 0%,100% { transform: translateY(0) rotate(-3deg); } 50% { transform: translateY(5px) rotate(3deg); } }
.flt.s6 .a-float { transform: translate(110px, 60px) scale(.3); opacity: 0; transition: transform 4200ms cubic-bezier(.3,0,.7,1), opacity 3600ms 600ms ease-in; }

/* ---------- 结局 / 远方来信 水面 ---------- */
.end-art, .water-head { overflow: hidden; }
.water-img { position: absolute; inset: 0; background: url(assets/art_home.webp) 50% 84% / 100% auto no-repeat; mix-blend-mode: multiply; }
.water-head { position: relative; }
.water-img .w-bottle { right: 54px; bottom: 26px; width: 120px; mix-blend-mode: normal; animation: bob 2.8s ease-in-out infinite; }
.water-img .w-env { left: 34px; bottom: 24px; width: 104px; transform: rotate(-6deg); }

/* ---------- 古风首页：水墨主视觉铺满 + 竖排标题 ---------- */
.home { background: #efe6d1 url(assets/art_home.webp) 66% 100% / cover no-repeat; }
.home .titlebox { display: flex; flex-direction: row-reverse; justify-content: flex-end; align-items: flex-start; gap: 12px; padding: calc(46px + env(safe-area-inset-top)) 22px 0; }
.home h1 { writing-mode: vertical-rl; font-size: 58px; letter-spacing: .16em; line-height: 1; text-shadow: none; }
.home .sub { writing-mode: vertical-rl; margin-top: 30px; font-size: 16px; letter-spacing: .14em; line-height: 1.3; color: var(--ink-soft); }
.home .tag { writing-mode: vertical-rl; margin-top: 64px; max-width: none; max-height: 18em; font-size: 13px; letter-spacing: .24em; line-height: 1.6; color: var(--ink-mute); }
.home .bottom { margin: auto 14px calc(10px + env(safe-area-inset-bottom)); padding: 18px 16px 12px; background: rgba(243,236,221,.8); -webkit-backdrop-filter: blur(3px); backdrop-filter: blur(3px); box-shadow: 0 4px 18px rgba(28,27,25,.18); }
@media (max-height: 700px) {
  .home h1 { font-size: 46px; } .home .titlebox { padding-top: 30px; } .home .sub { margin-top: 20px; } .home .tag { margin-top: 40px; max-height: 15em; }
}

/* 古风标题字体会把部分简体字显示为繁体字形：玩家自己写的标题一律用正文字体，保证所写即所见 */
.sheet.prev .bt, .pap .pt, .env-card .t.dyn, .dyn-title .topbar .ttl { font-family: var(--font-body); }

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: 1ms !important; animation-delay: 0ms !important; transition-duration: 1ms !important; }
  .sheet .reveal, .ink-line, .fade-late { opacity: 1 !important; filter: none !important; }
}
