/* 书信 Letters · v3「书桌」
 * 一张夜里的木书桌，台灯从右上方照下来。所有界面都是桌上的实物：信纸、信封、火漆、邮票、邮戳。
 * 系统层（导航、标签栏、面板）用暖色毛玻璃，遵循 iOS 的层级与手势习惯。
 */
:root {
  --ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Helvetica Neue", sans-serif;
  --serif: "Noto Serif SC", "Songti SC", Georgia, serif;
  --hand: "Long Cang", "Caveat", cursive;
  --brushf: "Ma Shan Zheng", "Long Cang", serif;
  --mono: "Courier Prime", "SF Mono", ui-monospace, monospace;
  --cream: #f4e8d2;
  --c2: rgba(244, 232, 210, .68);
  --c3: rgba(244, 232, 210, .44);
  --c4: rgba(244, 232, 210, .16);
  --hair: rgba(255, 238, 214, .13);
  --brass: #d6b06a;
  --wax: #9b2f2a;
  --glass: rgba(44, 28, 17, .52);
  --glass-strong: rgba(34, 22, 13, .82);
  --envpaper: linear-gradient(165deg, #f7eed9 0%, #efe2c6 55%, #e5d2ae 100%);
  --ease: cubic-bezier(.2, .8, .2, 1);
  --spring: linear(0, .009, .035 2.1%, .141 4.4%, .281 6.7%, .723 12.9%, .938 16.7%, 1.017 19.4%, 1.077 22.3%, 1.121 25.6%, 1.149 29.3%, 1.159 32.3%, 1.157 35.5%, 1.137 39.8%, 1.082 47.7%, 1.032 55.3%, 1.004 62.1%, .991 69.4%, .99 77%, 1);
  --soft: linear(0, .012, .047 2.6%, .177 5.6%, .38 9.3%, .627 13.9%, .8 18%, .914 22.4%, .981 27.2%, 1.014 32.3%, 1.024 38.3%, 1.012 48.7%, 1.002 61%, 1);
  --noise: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='180' height='180'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .32 0 0 0 0 .24 0 0 0 0 .15 0 0 0 .3 0'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23n)'/%3E%3C/svg%3E");
  --grain: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='560' height='560'%3E%3Cfilter id='w'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.0035 .12' numOctaves='4' seed='7' stitchTiles='stitch'/%3E%3CfeColorMatrix values='0 0 0 0 .1 0 0 0 0 .05 0 0 0 0 .02 1.9 0 0 0 -.7'/%3E%3C/filter%3E%3Crect width='100%25' height='100%25' filter='url(%23w)'/%3E%3C/svg%3E");
}
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body { background: #0c0a09; font-family: var(--ui); overflow: hidden; }
button { font: inherit; color: inherit; }
a { color: inherit; }
:focus-visible { outline: 2px solid var(--brass); outline-offset: 2px; border-radius: 8px; }

/* ===================== stage & device ===================== */
#stage { position: fixed; left: 300px; right: 0; top: 0; bottom: 0; overflow: hidden;
  background: radial-gradient(60% 55% at 50% 46%, #2b2219 0%, #15110d 55%, #0b0908 100%); }
.device { position: absolute; left: 50%; top: 50%; width: 417px; height: 876px; transform: translate(-50%, -50%) scale(var(--k, 1)); }
.bezel { position: absolute; inset: 0; border-radius: 64px; padding: 12px;
  background: linear-gradient(145deg, #4a4540 0%, #1d1b19 30%, #2f2b28 70%, #151312 100%);
  box-shadow: 0 0 0 1.5px #57514a, inset 0 0 0 2px #0b0a09, 0 50px 90px rgba(0, 0, 0, .65), 0 0 120px rgba(255, 190, 110, .05); }
.screen { position: relative; width: 393px; height: 852px; border-radius: 52px; overflow: hidden; isolation: isolate;
  color: var(--cream); -webkit-font-smoothing: antialiased; user-select: none; -webkit-user-select: none;
  background:
    radial-gradient(115% 52% at 84% -8%, rgba(255, 196, 118, .46), transparent 62%),
    radial-gradient(150% 85% at 50% 118%, rgba(0, 0, 0, .58), transparent 62%),
    var(--noise),
    var(--grain),
    linear-gradient(176deg, #73492a 0%, #5c3a21 46%, #452a19 100%);
  background-size: auto, auto, 180px, 560px, auto; }
input, textarea, select { user-select: text; -webkit-user-select: text; }
.view { position: absolute; inset: 0; view-transition-name: view; }
.scroll { position: absolute; inset: 0; overflow-y: auto; overflow-x: hidden; padding: 58px 0 150px; scrollbar-width: none; overscroll-behavior: contain; }
.scroll::-webkit-scrollbar, .ink-scroll::-webkit-scrollbar, .ds-in::-webkit-scrollbar, .pm-strip::-webkit-scrollbar { display: none; }

.statusbar { position: absolute; top: 0; left: 0; right: 0; height: 54px; padding: 18px 34px 0 46px; display: flex; justify-content: space-between;
  font: 600 16.5px/1 var(--ui); letter-spacing: -.01em; color: var(--cream); z-index: 40; pointer-events: none; transition: color .3s; }
.sb-r { display: flex; gap: 6px; align-items: center; }
.sb-r svg { fill: currentColor; }
.sb-dark .statusbar { color: #1d1610; }
.home-ind { position: absolute; bottom: 8px; left: 50%; width: 136px; height: 5px; margin-left: -68px; border-radius: 3px; background: var(--cream); opacity: .75; z-index: 40; pointer-events: none; }
.sb-dark .home-ind { background: #1d1610; opacity: .6; }

/* dynamic island */
.island { position: absolute; top: 11px; left: 50%; width: 124px; height: 36px; transform: translateX(-50%); border-radius: 20px; background: #000; z-index: 45; overflow: hidden;
  transition: width .55s var(--spring), height .55s var(--spring), border-radius .55s var(--spring), top .55s var(--spring); }
.island.open { width: 356px; height: 74px; border-radius: 30px; top: 9px; box-shadow: 0 10px 30px rgba(0, 0, 0, .45); }
.isl-c { display: flex; align-items: center; gap: 12px; height: 74px; padding: 0 18px; opacity: 0; transform: scale(.9); transition: opacity .2s, transform .4s var(--spring); }
.island.open .isl-c { opacity: 1; transform: none; transition-delay: .12s; }
.isl-ic { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; flex: none; color: #fff7ea; background: radial-gradient(circle at 35% 30%, color-mix(in srgb, var(--c) 70%, #fff), var(--c)); }
.isl-t { display: flex; flex-direction: column; gap: 3px; min-width: 0; }
.isl-t b { font: 600 15px var(--ui); color: #fff; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.isl-t small { font-size: 12.5px; color: rgba(255, 255, 255, .62); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* ===================== materials ===================== */
.glass { background: var(--glass); -webkit-backdrop-filter: blur(22px) saturate(160%); backdrop-filter: blur(22px) saturate(160%);
  border: .5px solid var(--hair); box-shadow: inset 0 1px 0 rgba(255, 240, 220, .08), 0 10px 26px rgba(0, 0, 0, .28); }
.glass-strong { background: var(--glass-strong); -webkit-backdrop-filter: blur(30px) saturate(170%); backdrop-filter: blur(30px) saturate(170%);
  box-shadow: inset 0 .5px 0 rgba(255, 238, 214, .2), 0 -10px 40px rgba(0, 0, 0, .3); }
.glass-inset { background: rgba(0, 0, 0, .22); border: .5px solid var(--hair); }

/* ===================== controls ===================== */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; height: 44px; padding: 0 20px; border-radius: 22px; border: 0; cursor: pointer;
  font: 600 15.5px/1 var(--ui); letter-spacing: .01em; color: var(--cream); text-decoration: none; white-space: nowrap; transition: transform .3s var(--spring), filter .2s, opacity .2s; }
.btn:active { transform: scale(.95); }
.btn-wax { color: #fff6ec; background: linear-gradient(180deg, #b6423a, #8b2823); box-shadow: 0 8px 18px rgba(110, 22, 18, .45), inset 0 1px 0 rgba(255, 205, 185, .35), inset 0 -1px 0 rgba(0, 0, 0, .2); }
.btn-glass { background: rgba(255, 238, 214, .12); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: inset 0 0 0 .5px var(--hair); }
.btn-plain { background: none; color: var(--c2); }
.btn.sm { height: 34px; padding: 0 15px; font-size: 14px; border-radius: 17px; }
.btn.lg { height: 52px; padding: 0 28px; border-radius: 26px; font-size: 16.5px; }
.btn.wide { width: 100%; }
.cbtn { width: 40px; height: 40px; border-radius: 50%; display: grid; place-items: center; color: var(--cream); flex: none; border: 0; cursor: pointer; text-decoration: none; transition: transform .3s var(--spring); }
.cbtn:active { transform: scale(.9); }
.chip { display: inline-flex; align-items: center; gap: 6px; height: 26px; padding: 0 11px; border-radius: 13px; font: 600 12.5px/1 var(--ui); white-space: nowrap; }
.chip-ok { background: rgba(143, 191, 138, .17); color: #bfe2b8; }
.chip-warn { background: rgba(226, 178, 107, .17); color: #f2cd8f; }
.chip-live { background: rgba(233, 194, 122, .18); color: #f5d797; }
.chip-live::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; animation: pulse 1.6s infinite; }
.chip-done { background: var(--c4); color: var(--c2); }
@keyframes pulse { 50% { opacity: .3; } }
.mono { font-variant-numeric: tabular-nums; }

.navbar { position: absolute; top: 54px; left: 0; right: 0; height: 52px; display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 0 16px; z-index: 6; }
.nb-t { flex: 1; min-width: 0; display: flex; flex-direction: column; align-items: center; gap: 2px; }
.nb-t b { font: 600 16px var(--ui); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.nb-t small { font-size: 11.5px; color: var(--c2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 100%; }
.nb-sp { width: 40px; flex: none; }

/* large title */
.lt { padding: 6px 20px 0; }
.lt-over { font: 500 13px var(--ui); color: var(--c3); letter-spacing: .02em; }
.lt-row { display: flex; align-items: center; justify-content: space-between; margin-top: 2px; }
.lt h1 { font: 700 36px/1.2 var(--serif); letter-spacing: .02em; text-shadow: 0 2px 10px rgba(0, 0, 0, .3); }
.lt-sub { font-size: 14.5px; color: var(--c2); margin-top: 4px; }
.lt-acts { display: flex; align-items: center; gap: 8px; }
.lang-btn { display: inline-flex; align-items: center; gap: 4px; cursor: pointer; }
.lang-btn i { font: 600 12px var(--ui); font-style: normal; color: var(--c3); padding: 1px 2px; transition: color .2s; }
.lang-btn i.on { color: var(--cream); }
.lang-btn i + i::before { content: '/'; margin-right: 4px; color: var(--c4); font-weight: 400; }
.lang-btn.static { flex: none; color: var(--c2); }
.loc { display: inline-flex; align-items: center; gap: 5px; height: 32px; padding: 0 13px 0 10px; border-radius: 16px; font: 600 13.5px var(--ui); color: var(--cream); cursor: pointer; }

.sec { padding: 26px 16px 0; }
.sec-h { display: flex; align-items: baseline; justify-content: space-between; font: 600 13px var(--ui); color: var(--c3); letter-spacing: .04em; padding: 0 6px 9px; }
.sec-h span { font-weight: 500; }
.sec-h.small { padding: 18px 2px 9px; }

.list { border-radius: 20px; overflow: hidden; }
.row { position: relative; display: flex; align-items: center; gap: 12px; width: 100%; min-height: 62px; padding: 11px 14px; color: var(--cream); text-decoration: none; background: none; border: 0; text-align: left; cursor: pointer; transition: background .2s; }
.row + .row::before { content: ""; position: absolute; top: 0; left: 64px; right: 0; height: .5px; background: var(--hair); }
.row:active:not(.static) { background: rgba(255, 240, 220, .06); }
.row.static { cursor: default; align-items: flex-start; }
.row > .ic { color: var(--c3); flex: none; }
.r-ic { width: 38px; height: 38px; border-radius: 12px; display: grid; place-items: center; flex: none; color: #f6ecd8;
  background: linear-gradient(160deg, color-mix(in srgb, var(--c) 80%, #fff 10%), color-mix(in srgb, var(--c) 85%, #000)); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15); }
.r-wax { width: 38px; display: grid; place-items: center; flex: none; }
.r-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.r-main b { font: 600 15.5px var(--ui); }
.r-main small { font-size: 12.5px; color: var(--c2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.row.static .r-main small { white-space: normal; line-height: 1.55; }
.r-side { font-size: 13px; color: var(--c2); white-space: nowrap; }
.r-num { width: 28px; height: 28px; border-radius: 50%; background: rgba(214, 176, 106, .16); color: var(--brass); display: grid; place-items: center; font: 700 13px var(--serif); flex: none; margin-top: 1px; }
.r-check { color: var(--brass); flex: none; }
.bar { display: block; height: 3px; border-radius: 2px; background: var(--c4); margin-top: 6px; overflow: hidden; }
.bar i { display: block; height: 100%; border-radius: 2px; background: linear-gradient(90deg, var(--brass), #f3d89f); transition: width 1s var(--ease); }

/* ===================== tab bar ===================== */
#tabbar { position: absolute; left: 0; right: 0; bottom: 26px; display: flex; justify-content: center; align-items: center; gap: 10px; z-index: 20; pointer-events: none;
  transition: transform .5s var(--spring), opacity .3s; }
#tabbar > * { pointer-events: auto; }
.no-tabs #tabbar { transform: translateY(140%); opacity: 0; }
.tb-cap { position: relative; display: flex; height: 64px; border-radius: 32px; padding: 5px; }
.tb { position: relative; z-index: 1; width: 80px; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  color: var(--c2); text-decoration: none; font: 600 10.5px var(--ui); transition: color .25s; }
.tb.on { color: var(--cream); }
.tb .ic { transition: transform .4s var(--spring); }
.tb:active .ic { transform: scale(.88); }
.tb-pill { position: absolute; top: 5px; bottom: 5px; left: 5px; width: 80px; border-radius: 27px; background: rgba(255, 238, 214, .14);
  box-shadow: inset 0 1px 0 rgba(255, 240, 220, .14), 0 2px 8px rgba(0, 0, 0, .2); transform: translateX(calc(var(--i, 0) * 80px)); transition: transform .55s var(--spring); }
.badge { position: absolute; top: 6px; right: 19px; min-width: 17px; height: 17px; padding: 0 4px; border-radius: 9px; background: #c4453b; color: #fff; font: 700 10.5px/17px var(--ui); font-style: normal; text-align: center;
  transform: scale(0); transition: transform .4s var(--spring); box-shadow: 0 0 0 2px rgba(40, 25, 15, .6); }
.badge.show { transform: scale(1); }
.tb-write { width: 64px; height: 64px; border-radius: 50%; display: grid; place-items: center; color: #fff6ec;
  background: radial-gradient(circle at 35% 28%, #c14b42, #8b2823 70%); box-shadow: 0 12px 24px rgba(100, 20, 16, .5), inset 0 1px 0 rgba(255, 205, 185, .4); transition: transform .35s var(--spring); }
.tb-write:active { transform: scale(.92); }

/* ===================== envelope ===================== */
.env3d { position: relative; width: 300px; aspect-ratio: 1.6; container-type: inline-size; perspective: 1500px; transition: transform .7s var(--ease), opacity .5s; }
.env3d.big { width: min(330px, 86vw); }
.env3d.mini { width: 66px; perspective: none; }
.env-card { position: absolute; inset: 0; transform-style: preserve-3d; transition: transform .85s var(--spring); cursor: default; }
.env-card.flipped { transform: rotateY(180deg); }
.env-face { position: absolute; inset: 0; border-radius: 1.4cqw; -webkit-backface-visibility: hidden; backface-visibility: hidden;
  box-shadow: 0 7cqw 10cqw -3cqw rgba(0, 0, 0, .55), 0 1cqw 1.6cqw rgba(0, 0, 0, .25); }
.ef-grain { position: absolute; inset: 0; border-radius: inherit; background: var(--noise); background-size: 140px; opacity: .9; mix-blend-mode: multiply; pointer-events: none; }
.env-front { background: var(--envpaper); overflow: hidden; box-shadow: 0 7cqw 10cqw -3cqw rgba(0, 0, 0, .55), 0 1cqw 1.6cqw rgba(0, 0, 0, .25), inset 0 0 0 .35cqw rgba(255, 255, 255, .28), inset 0 -3cqw 5cqw rgba(120, 88, 48, .1); }
.ef-from { position: absolute; left: 6cqw; top: 6cqw; display: flex; flex-direction: column; gap: .6cqw; font: 400 4cqw/1 var(--hand); color: #5a4630; }
.ef-from em { font: 600 2.4cqw/1 var(--ui); font-style: normal; letter-spacing: .14em; color: #8f7a5c; text-transform: uppercase; }
.ef-stamp { position: absolute; right: 5.5cqw; top: 5.5cqw; z-index: 1; }
.stamp-slot { width: 17cqw; aspect-ratio: .82; border: .4cqw dashed rgba(110, 85, 55, .3); border-radius: .6cqw; }
.ef-pms { position: absolute; inset: 0; pointer-events: none; z-index: 2; }
.ef-pms .pm { position: absolute; --pm: 17cqw; }
.ef-pms .waves { position: absolute; right: 24cqw; top: 9cqw; width: 18cqw; opacity: .55; }
.waves path { fill: none; stroke: rgba(48, 40, 72, .7); stroke-width: 1.4; }
.ef-to { position: absolute; left: 28cqw; right: 8cqw; bottom: 9cqw; z-index: 3; }
.ef-name { font: 400 8.6cqw/1.15 var(--hand); color: #1f2b4a; padding-bottom: 1.2cqw; border-bottom: .3cqw dashed rgba(70, 50, 25, .26); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ef-city { display: flex; align-items: baseline; gap: 2.4cqw; margin-top: 2.2cqw; font: 400 5.4cqw/1.1 var(--hand); color: #1f2b4a; }
.ef-city code { font: 700 2.6cqw var(--mono); color: #7a6648; letter-spacing: .12em; }
.ef-name.empty, .ef-city.empty { color: rgba(80, 60, 35, .3); }
.ef-tag { position: absolute; left: 3cqw; bottom: 5cqw; z-index: 4; min-width: 24cqw; padding: 2.2cqw 2cqw 2cqw 4.6cqw; border-radius: .8cqw 2.6cqw 2.6cqw .8cqw;
  background: linear-gradient(160deg, #e2c48a, #cfac6c); color: #5a3d1a; transform: rotate(-9deg); box-shadow: 0 1.2cqw 1.8cqw rgba(0, 0, 0, .3); display: flex; flex-direction: column; gap: .8cqw; }
.ef-tag i { position: absolute; left: 1.4cqw; top: 50%; width: 2cqw; height: 2cqw; margin-top: -1cqw; border-radius: 50%; background: #5c3a21; box-shadow: inset 0 0 0 .4cqw #a8854a; }
.ef-tag b { font: 400 4.4cqw/1 var(--hand); color: #8b2823; white-space: nowrap; }
.ef-tag small { font: 700 2.1cqw/1.2 var(--mono); letter-spacing: .04em; }
.env3d.mini .env-face { box-shadow: 0 4px 8px rgba(0, 0, 0, .4); }

.env-back { transform: rotateY(180deg); background: #cdb790; }
.eb-inside { position: absolute; inset: 0; border-radius: inherit; background: linear-gradient(180deg, #bda57c, #d7c39d); box-shadow: inset 0 3cqw 5cqw rgba(0, 0, 0, .28); }
.eb-letter { position: absolute; left: 5cqw; right: 5cqw; top: 4cqw; height: 55cqw; border-radius: .6cqw; transition: transform .9s var(--spring), opacity .25s;
  background: repeating-linear-gradient(180deg, transparent 0 4.2cqw, rgba(100, 80, 50, .14) 4.2cqw 4.5cqw) 0 3cqw no-repeat, var(--noise), #f9f2e1; box-shadow: 0 .6cqw 1.6cqw rgba(0, 0, 0, .22); }
.env3d.inserting:not(.insert) .eb-letter { transform: translateY(-75cqw); opacity: 0; }
.env3d.reveal .eb-letter { transform: translateY(-46cqw); }
.eb-pocket { position: absolute; inset: 0; border-radius: inherit; clip-path: polygon(0 0, 50% 57%, 100% 0, 100% 100%, 0 100%); z-index: 2;
  background: linear-gradient(to top right, rgba(0, 0, 0, .06), transparent 50%), linear-gradient(to top left, rgba(0, 0, 0, .05), transparent 50%), var(--envpaper); }
.eb-flap { position: absolute; left: 0; right: 0; top: 0; height: 100%; clip-path: polygon(0 0, 100% 0, 50% 59%); z-index: 3; transform-origin: top center;
  background: linear-gradient(180deg, #f4e9d0, #e4d0aa); transition: transform .6s var(--spring), z-index 0s .22s, background .3s .2s; }
.eb-flap.open { transform: scaleY(-1); z-index: 0; background: linear-gradient(180deg, #c8b088, #d9c49f); }
.eb-wax { position: absolute; left: 50%; top: 59%; width: 27cqw; height: 27cqw; z-index: 4; transform: translate(-50%, -50%) scale(var(--s, 1)); transition: transform .14s; }
.eb-wax:not(.on) { --s: var(--p, 0); }
.eb-wax > .wax, .eb-wax .half .wax { position: absolute; inset: 0; width: 100%; height: 100%; }
.eb-wax.pressed { animation: press .55s var(--spring); }
@keyframes press { 0% { transform: translate(-50%, -50%) scale(1.18); } 35% { transform: translate(-50%, -50%) scale(.9); } 100% { transform: translate(-50%, -50%) scale(1); } }
.crack { position: absolute; inset: 6%; width: 88%; height: 88%; overflow: visible; }
.crack path { fill: none; stroke: rgba(28, 5, 3, .8); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; stroke-dasharray: 1; stroke-dashoffset: calc(1 - var(--c, 0)); }
.eb-wax.straining > .wax { animation: strain .1s infinite; }
@keyframes strain { 50% { transform: translate(.5px, -.4px) rotate(.6deg); } }
.half { position: absolute; inset: 0; opacity: 0; }
.half.l { clip-path: polygon(0 0, 50% 0, 46% 26%, 52% 40%, 47% 58%, 51% 74%, 48% 100%, 0 100%); }
.half.r { clip-path: polygon(50% 0, 100% 0, 100% 100%, 48% 100%, 51% 74%, 47% 58%, 52% 40%, 46% 26%); }
.eb-wax.broken > .wax, .eb-wax.broken .crack { opacity: 0; }
.eb-wax.broken .half { opacity: 1; animation: fall-l 1s cubic-bezier(.45, 0, .85, .5) forwards; }
.eb-wax.broken .half.r { animation-name: fall-r; }
@keyframes fall-l { 0% { transform: none; } 18% { transform: translate(-8%, -4%) rotate(-8deg); } 100% { transform: translate(-60%, 220%) rotate(-70deg); opacity: 0; } }
@keyframes fall-r { 0% { transform: none; } 18% { transform: translate(8%, -3%) rotate(7deg); } 100% { transform: translate(55%, 240%) rotate(64deg); opacity: 0; } }
.env3d.ready .eb-wax::before { content: ""; position: absolute; inset: -14%; border-radius: 50%; border: 2px solid rgba(255, 212, 150, .7); animation: halo 1.8s ease-out infinite; }
@keyframes halo { 0% { transform: scale(.85); opacity: .9; } 100% { transform: scale(1.35); opacity: 0; } }
.wax-hit { position: absolute; left: 50%; top: 59%; width: 34cqw; height: 34cqw; transform: translate(-50%, -50%); border-radius: 50%; border: 0; background: none; z-index: 5; display: none; cursor: pointer; touch-action: none; }
.env3d.ready .wax-hit { display: block; }
.env3d.away { transform: translateY(-150%) rotate(-12deg) scale(.5); opacity: 0; transition: transform .7s cubic-bezier(.55, -0.25, .7, .45), opacity .5s .2s; }

/* stamp */
.stamp { --sw: 17cqw; --r: 1.15cqw; width: var(--sw); aspect-ratio: .82; padding: var(--r); background: #faf4e6; transform: rotate(2.5deg); transition: transform .45s var(--spring);
  filter: drop-shadow(0 .4cqw .5cqw rgba(0, 0, 0, .2));
  -webkit-mask: linear-gradient(#000 0 0) content-box, radial-gradient(circle at center, transparent calc(var(--r) * .62), #000 calc(var(--r) * .62 + .5px)) calc(var(--r) * -1) calc(var(--r) * -1) / calc(var(--r) * 2) calc(var(--r) * 2) round;
  -webkit-mask-composite: source-over; mask-composite: add; }
.st-in { height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: calc(var(--sw) * .05); color: #f7eedb;
  background: radial-gradient(120% 90% at 30% 20%, color-mix(in srgb, var(--sc) 78%, #fff), var(--sc) 70%); box-shadow: inset 0 0 0 calc(var(--sw) * .035) rgba(250, 244, 230, .5); }
.st-g { width: calc(var(--sw) * .44); height: auto; }
.st-in b { font: 600 calc(var(--sw) * .145)/1 var(--serif); letter-spacing: .06em; white-space: nowrap; }
.st-in small { font: 700 calc(var(--sw) * .1)/1 var(--mono); opacity: .8; }

/* postmark */
.pm { --pm: 64px; width: var(--pm); height: var(--pm); flex: none; position: relative; border-radius: 50%; display: flex; flex-direction: column; align-items: center; justify-content: center; text-align: center;
  border: calc(var(--pm) * .03) solid var(--pmc, rgba(48, 40, 72, .62)); color: var(--pmc, rgba(48, 40, 72, .72)); transform: rotate(var(--rot)); mix-blend-mode: multiply; }
.pm::before { content: ""; position: absolute; inset: calc(var(--pm) * .075); border-radius: 50%; border: calc(var(--pm) * .016) solid currentColor; opacity: .7; }
.pm small { font: 700 calc(var(--pm) * .11)/1 var(--ui); letter-spacing: .1em; opacity: .85; }
.pm b { font: 700 calc(var(--pm) * .17)/1.15 var(--serif); margin: calc(var(--pm) * .04) 0; max-width: 78%; white-space: nowrap; overflow: hidden; }
.pm span { font: 700 calc(var(--pm) * .12)/1 var(--mono); }
.pm-sea b { font: 700 calc(var(--pm) * .11)/1.15 var(--mono); }
.pm-arrive { --pmc: rgba(140, 41, 36, .7); }
.pm-forward { --pmc: rgba(44, 74, 106, .72); }
.ef-pms.slam .pm { animation: slam .5s var(--spring) both; }
.ef-pms.slam .waves { animation: fadein .3s .25s both; }
@keyframes slam { 0% { transform: rotate(var(--rot)) scale(1.9); opacity: 0; } 50% { opacity: 1; } 100% { transform: rotate(var(--rot)) scale(1); } }
@keyframes fadein { from { opacity: 0; } }

/* ===================== desk ===================== */
.pile-wrap { padding: 18px 0 0; }
.pile { position: relative; height: 232px; }
.pcard { position: absolute; left: 50%; top: 18px; width: 300px; margin-left: -150px; touch-action: pan-y; cursor: grab;
  transform: translateY(calc(var(--i) * 11px)) rotate(var(--rot)) scale(calc(1 - var(--i) * .05)); transition: transform .6s var(--spring), opacity .3s, filter .3s; }
.pcard:not([data-top]) { filter: brightness(.82); }
.pcard.drag { transition: none; cursor: grabbing; }
.pcard.thrown { transition: transform .32s cubic-bezier(.3, .6, .4, 1), opacity .3s; opacity: 0; }
.pcard .env3d { width: 100%; }
.dots { display: flex; justify-content: center; gap: 6px; height: 6px; margin-top: 4px; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: var(--c4); transition: width .4s var(--spring), background .3s; }
.dots i.on { width: 18px; background: var(--cream); }
.pcap { text-align: center; padding: 14px 20px 0; }
.pc-name { font: 700 25px/1.2 var(--serif); }
.pc-sub { display: inline-flex; align-items: center; gap: 5px; margin-top: 4px; font-size: 13.5px; color: var(--c2); }
.pc-act { display: flex; flex-direction: column; align-items: center; gap: 14px; margin-top: 12px; }
.pc-act .btn { min-width: 148px; }
.pile-empty { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 26px 34px 6px; text-align: center; }
.pile-empty .inkwell { width: 132px; margin-bottom: 6px; filter: drop-shadow(0 10px 14px rgba(0, 0, 0, .35)); }
.pile-empty b { font: 600 18px var(--serif); }
.pile-empty small { font-size: 13.5px; line-height: 1.6; color: var(--c2); margin-bottom: 12px; }

/* ===================== paper & ink ===================== */
.paper { --lh: 34px; --rule: rgba(110, 85, 55, .16); --inkc: #1f2b4a; color: var(--inkc); border-radius: 3px;
  background: var(--noise), radial-gradient(130% 90% at 28% 8%, #fbf4e4, #efe1c4);
  background-size: 180px, auto;
  box-shadow: 0 34px 44px -20px rgba(0, 0, 0, .65), 0 2px 5px rgba(0, 0, 0, .25), inset 0 0 0 1px rgba(255, 255, 255, .35), inset 0 0 40px rgba(160, 120, 60, .12); }
.paper-bamboo { --rule: rgba(90, 110, 70, .15); background: linear-gradient(90deg, rgba(110, 135, 80, .07) 1px, transparent 1px) 0 0 / 24px 100%, var(--noise), radial-gradient(130% 90% at 28% 8%, #f6f3df, #e3e0c2); background-size: 24px 100%, 180px, auto; }
.paper-airmail { --rule: rgba(44, 74, 106, .14); border: 8px solid transparent;
  border-image: repeating-linear-gradient(-45deg, #b6423a 0 11px, #faf6ec 11px 16px, #2c4a6a 16px 27px, #faf6ec 27px 32px) 8;
  background: var(--noise), #f8f4ea; background-size: 180px, auto; }
.paper-gold { --rule: rgba(150, 110, 50, .18); background: radial-gradient(circle, rgba(201, 160, 80, .6) 0 1px, transparent 1.6px) 0 0 / 23px 19px, radial-gradient(circle, rgba(201, 160, 80, .45) 0 .8px, transparent 1.3px) 7px 11px / 31px 27px, var(--noise), radial-gradient(130% 90% at 28% 8%, #f7ead6, #ead6b6); background-size: 23px 19px, 31px 27px, 180px, auto; }
.paper-floral { --rule: rgba(160, 90, 100, .15); background: radial-gradient(circle at 100% 0, rgba(214, 120, 130, .26), transparent 34%), radial-gradient(circle at 0 100%, rgba(130, 160, 110, .24), transparent 34%), var(--noise), #f8efe7; background-size: auto, auto, 180px, auto; }
.tool-pen { --inkc: #1f2b4a; --lh: 34px; }
.tool-quill { --inkc: #3a2a1c; --lh: 34px; }
.tool-brush { --inkc: #191613; --lh: 40px; }
.tool-typewriter { --inkc: #26231f; --lh: 30px; }
.ink { white-space: pre-wrap; word-break: break-word; line-height: var(--lh); color: var(--inkc); }
.tool-pen .ink { font: 400 24px/var(--lh) var(--hand); }
.tool-quill .ink { font: 400 25px/var(--lh) "Pinyon Script", var(--hand); }
.tool-brush .ink { font: 400 28px/var(--lh) var(--brushf); }
.tool-typewriter .ink { font: 400 16.5px/var(--lh) var(--mono), var(--serif); letter-spacing: .02em; }
.ink i { position: relative; font-style: normal; }
.ink s.cut { text-decoration: none; opacity: .62; background: linear-gradient(-5deg, transparent 47%, var(--inkc) 47%, var(--inkc) 55%, transparent 55%); }
.tool-typewriter .ink s.cut { background: none; text-decoration: line-through; text-decoration-thickness: 1.6px; text-decoration-color: var(--inkc); }
.ink .fresh { animation: inkin .55s ease-out; }
@keyframes inkin { from { opacity: .1; filter: blur(1.4px); } to { opacity: 1; filter: none; } }
.ink .caret { display: inline-block; width: 2px; height: 1.05em; vertical-align: -.14em; margin-left: 1px; border-radius: 1px; background: var(--inkc); opacity: .8; animation: blink 1.1s steps(1) infinite; }
@keyframes blink { 50% { opacity: 0; } }
.ink .ph { opacity: .3; margin-left: -3px; }
.ink .comp { text-decoration: underline dotted; text-underline-offset: 4px; opacity: .7; }
.dateline { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; width: 100%; padding: 0 0 10px; margin-bottom: 6px; background: none; border: 0; text-align: left; cursor: pointer;
  font: 500 11.5px/1.4 var(--ui); color: #8a6d4b; border-bottom: 1px dashed rgba(138, 109, 75, .28); }
.dateline em { font-style: normal; opacity: .5; }
.dateline.static { cursor: default; }

/* ===================== write ===================== */
.paper-stage { position: absolute; top: 112px; left: 12px; right: 12px; bottom: 128px; }
#paper { position: absolute; inset: 0; display: flex; flex-direction: column; padding: 20px 22px 10px; transform: rotate(-.5deg); }
#paper.enter { animation: paperin .95s var(--soft) both; }
@keyframes paperin { from { transform: translateY(108%) rotate(5deg); } to { transform: rotate(-.5deg); } }
#paper.shake { animation: shake .42s; }
@keyframes shake { 20%, 60% { transform: translateX(-7px) rotate(-.5deg); } 40%, 80% { transform: translateX(7px) rotate(-.5deg); } }
#paper.nudge { animation: nudge .09s; }
@keyframes nudge { 50% { transform: translateX(.9px) rotate(-.5deg); } }
.ink-scroll { flex: 1; overflow-y: auto; scrollbar-width: none; cursor: text;
  background: repeating-linear-gradient(180deg, transparent 0 calc(var(--lh) - 1px), var(--rule) calc(var(--lh) - 1px) var(--lh)); background-attachment: local; }
.tool-typewriter .ink-scroll { background: none; }
.ghost { position: absolute; left: 50%; bottom: 24px; width: 2px; height: 2px; opacity: 0; border: 0; padding: 0; resize: none; font-size: 16px; pointer-events: none; }

/* 纸上的笔 */
.paper-stage { z-index: 3; transition: left .55s var(--soft), right .55s var(--soft), bottom .55s var(--soft); }
.instr { position: absolute; left: 0; top: 0; width: 0; height: 0; pointer-events: none; z-index: 5; }
.instr.in { animation: instr-in .7s .9s var(--soft) both; }
.instr.swap { animation: instr-in .55s var(--soft) both; }
@keyframes instr-in { from { transform: translate(150px, 280px) rotate(10deg); opacity: 0; } }
.v-write.tw .instr { display: none; }
.in-move { position: absolute; left: 0; top: 0; will-change: transform; }
.in-lift { position: absolute; left: 0; top: 0; transition: transform .5s var(--soft), filter .5s var(--soft);
  filter: drop-shadow(3px 5px 2px rgba(40, 22, 8, .34)) drop-shadow(9px 15px 12px rgba(20, 10, 4, .2)); }
.in-lift.rest { transform: translate(6px, -12px); filter: drop-shadow(14px 22px 7px rgba(40, 22, 8, .2)) drop-shadow(24px 36px 22px rgba(20, 10, 4, .15)); }
.in-body { position: absolute; left: 0; transform-origin: 0 50%; }
.in-body svg { display: block; }
@keyframes scrib { 0% { transform: none; } 30% { transform: translate(-1.6px, -2.4px) rotate(-.8deg); } 60% { transform: translate(1.5px, 1.2px) rotate(.5deg); } 85% { transform: translate(-.5px, 1.4px); } 100% { transform: none; } }
@keyframes scribb { 0% { transform: none; } 35% { transform: translate(1px, 2.6px) scale(.985); } 70% { transform: translate(-1.6px, -1px); } 100% { transform: none; } }
.v-write:not(.tw) .ink .caret { opacity: 0; animation: none; }
/* 一个字一个字写出来 */
.paper:not(.tool-typewriter) .ink .fresh { animation: none; }
.ink .w { animation: wr var(--wd, 110ms) linear both; animation-delay: calc(var(--i) * var(--wd, 110ms)); }
@keyframes wr { from { clip-path: inset(-40% 100% -40% -10%); } to { clip-path: inset(-40% -10% -40% -10%); } }
.tool-brush .ink .w { animation-name: wr, bleed; animation-duration: var(--wd, 185ms), 1.1s; animation-timing-function: linear, ease-out; }
@keyframes bleed { from { text-shadow: 0 0 2.5px rgba(20, 18, 16, .6); } }
.tool-pen .ink .w, .tool-quill .ink .w { animation-name: wr, wet; animation-duration: var(--wd, 110ms), 1.6s; animation-timing-function: linear, ease-out; }
@keyframes wet { from { color: color-mix(in srgb, var(--inkc) 70%, #000); text-shadow: 0 0 .6px rgba(0, 0, 0, .35); } }
.ink s.cut { background-repeat: no-repeat; background-size: 100% 100%; }
.ink s.cut.now { animation: cutdraw .21s .11s linear both; }
@keyframes cutdraw { from { background-size: 0% 100%; } }
.tool-typewriter .ink .fresh, .tool-typewriter .ink s.cut.now { animation: tslam .24s ease-out; }
@keyframes tslam { from { opacity: .3; text-shadow: 0 0 .6px #000, 0 0 1.6px rgba(0, 0, 0, .55); } }

/* 打字机 */
.view.v-write { overflow: clip; }
.tw-machine { position: absolute; left: 0; right: 0; bottom: 124px; height: 226px; z-index: 4; pointer-events: none; visibility: hidden;
  transform: translateY(calc(100% + 140px)); transition: transform .65s var(--soft), visibility 0s .65s; }
.v-write.tw .tw-machine { transform: none; pointer-events: auto; visibility: visible; transition: transform .65s var(--soft), visibility 0s; }
.v-write.tw .paper-stage { left: 30px; right: 30px; bottom: 316px; }
.v-write.tw #paper { transform: none; padding-bottom: 28px; border-radius: 2px 2px 0 0; }
.v-write.tw #paper.enter { animation: feedin 1s var(--soft) both; }
@keyframes feedin { from { transform: translateY(75%); } to { transform: none; } }
.v-write.tw #paper.nudge { animation: tnudge .09s; }
@keyframes tnudge { 50% { transform: translateY(.8px); } }
.v-write.tw #paper.shake { animation: tshake .42s; }
@keyframes tshake { 20%, 60% { transform: translateX(-7px); } 40%, 80% { transform: translateX(7px); } }
.v-write.tw .ink-scroll { display: flex; flex-direction: column; }
.v-write.tw .ink { margin-top: auto; }
.v-write.tw .ink .caret { opacity: 0; animation: none; }
.tw-carriage { position: absolute; left: 0; right: 0; top: 0; height: 46px; z-index: 2; }
.platen { position: absolute; left: 30px; right: 30px; top: 2px; height: 38px; border-radius: 19px;
  background: linear-gradient(180deg, #57534e 0%, #1d1c1a 20%, #0d0c0c 52%, #050505 78%, #2d2a27 100%);
  box-shadow: 0 12px 18px -6px rgba(0, 0, 0, .75), inset 0 1px 0 rgba(255, 255, 255, .14); }
.platen::after { content: ''; position: absolute; left: 14px; right: 14px; top: 7px; height: 3px; border-radius: 2px; background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .24) 18%, rgba(255, 255, 255, .07) 82%, transparent); }
.knob { position: absolute; top: -2px; width: 30px; height: 44px; border-radius: 9px;
  background: repeating-linear-gradient(180deg, rgba(255, 255, 255, .2) 0 1.4px, rgba(0, 0, 0, .28) 1.4px 2.8px), linear-gradient(90deg, #32302d, #c3beb3 42%, #75716a 72%, #2b2926);
  box-shadow: 0 8px 12px -4px rgba(0, 0, 0, .7); }
.knob.l { left: 4px; } .knob.r { right: 4px; }
.bail { position: absolute; left: 44px; right: 44px; top: 13px; height: 4px; border-radius: 2px; background: linear-gradient(180deg, #f4f1ea, #8b877f 60%, #d8d4cb); box-shadow: 0 2px 3px rgba(0, 0, 0, .45); }
.bail i { position: absolute; top: -3px; width: 24px; height: 10px; border-radius: 5px; background: linear-gradient(180deg, #34312d, #0f0e0d); box-shadow: inset 0 1px 0 rgba(255, 255, 255, .15); }
.bail i:first-child { left: 20%; } .bail i:last-child { right: 20%; }
.tw-guide { position: absolute; top: -9px; left: 50%; width: 22px; height: 17px; margin-left: -6px; z-index: 3; }
.tw-guide::before { content: ''; position: absolute; inset: 0; background: linear-gradient(180deg, #f6f3ec, #9f9a90 55%, #e4e0d7);
  clip-path: polygon(0 0, 32% 0, 50% 48%, 68% 0, 100% 0, 100% 100%, 0 100%); filter: drop-shadow(0 2px 2px rgba(0, 0, 0, .5)); }
.tw-guide i { position: absolute; left: -10px; right: -10px; top: 9px; height: 8px; border-radius: 1px; z-index: -1; background: linear-gradient(180deg, #161616 52%, #8e1f1b 52%); box-shadow: 0 2px 3px rgba(0, 0, 0, .4); }
.tw-guide.hit { animation: ghit .13s ease-out; }
@keyframes ghit { 40% { transform: translateY(-6px); } }
.tw-lever { position: absolute; left: 0; top: -30px; width: 44px; height: 11px; padding: 0; border: 0; border-radius: 6px; cursor: pointer;
  transform: rotate(-30deg); transform-origin: 100% 50%; background: linear-gradient(180deg, #f4f1ea, #8f8a81 60%, #d6d2c9); box-shadow: 0 5px 7px rgba(0, 0, 0, .5); transition: transform .3s var(--spring); }
.tw-lever::before { content: ''; position: absolute; left: -6px; top: -3px; width: 17px; height: 17px; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #4a4743, #111 70%); }
.tw-lever:active { transform: rotate(-30deg) translateX(10px); }
.tw-body { position: absolute; left: 6px; right: 6px; top: 26px; bottom: 0; z-index: 1; border-radius: 24px 24px 32px 32px; padding: 26px 8px 22px;
  background: radial-gradient(120% 70% at 50% 0%, #363a31, #1b1d19 58%, #121410);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, .13), inset 0 -12px 26px rgba(0, 0, 0, .5), 0 26px 40px -14px rgba(0, 0, 0, .75); }
.tw-body::before { content: ''; position: absolute; left: 16px; right: 16px; top: 20px; height: 1px; background: linear-gradient(90deg, transparent, rgba(214, 176, 106, .5), transparent); }
.tw-badge { position: absolute; left: 0; right: 0; bottom: 7px; text-align: center; font: 700 8px var(--mono); letter-spacing: .32em; color: rgba(214, 176, 106, .55); pointer-events: none; }
.tw-keys { display: flex; flex-direction: column; align-items: center; gap: 7px; }
.tw-row { display: flex; align-items: center; gap: 5px; }
.tw-row:nth-child(2) { margin-left: 12px; }
.k { position: relative; flex: none; width: 30px; height: 30px; padding: 0; border: 0; border-radius: 50%; cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  background: radial-gradient(circle at 50% 34%, #3a3833 0 42%, #171614 74%);
  box-shadow: 0 0 0 1.6px #cfc9bc, 0 0 0 2.7px #5b5750, 0 3px 0 2.4px #0a0a09, 0 7px 9px 1px rgba(0, 0, 0, .55);
  color: #f2e8ce; font: 700 12.5px/1 var(--mono); text-transform: uppercase; transition: transform .07s, box-shadow .07s, color .2s; }
.k span { position: relative; }
.k.down, .k:active { transform: translateY(2.6px); box-shadow: 0 0 0 1.6px #cfc9bc, 0 0 0 2.7px #5b5750, 0 .4px 0 2.4px #0a0a09, 0 2px 4px rgba(0, 0, 0, .5), 0 0 14px 2px rgba(255, 205, 130, .28); }
.k-shift, .k-bksp, .k-ime, .k-enter { width: 42px; border-radius: 15px; font-size: 15px; }
.k-enter { width: 50px; }
.k-ime { font: 600 10.5px var(--ui); text-transform: none; letter-spacing: .02em; }
.k-space { width: 148px; height: 20px; border-radius: 10px; background: linear-gradient(180deg, #f4f1ea, #a29d93 55%, #dbd7ce);
  box-shadow: 0 3px 0 1.2px #3b3833, 0 7px 9px rgba(0, 0, 0, .5); }
.k-space.down, .k-space:active { box-shadow: 0 .4px 0 1.2px #3b3833, 0 2px 4px rgba(0, 0, 0, .5); }
/* 中/A：亮着的那一半就是当前语言 */
.k-ime b { font-weight: 700; opacity: .42; transition: opacity .2s, color .2s; }
.k-ime i { font-style: normal; opacity: .35; margin: 0 1px; }
.tw-machine:not(.zh) .k-ime .i-en, .tw-machine.zh .k-ime .i-zh { opacity: 1; color: var(--brass); }
.k-ime .i-zh { font-size: 1.1em; }
/* 拼音候选栏：盖在压纸滚筒上，像一条黄铜铭牌 */
.tw-cand { position: absolute; left: 22px; right: 22px; top: 0; height: 40px; z-index: 6; border-radius: 20px; display: flex; align-items: center; gap: 2px; padding: 0 8px 0 14px;
  background: linear-gradient(180deg, #2c2620, #15110d); box-shadow: 0 0 0 1px rgba(214, 176, 106, .55), 0 8px 18px rgba(0, 0, 0, .55), inset 0 1px 0 rgba(255, 255, 255, .08);
  overflow-x: auto; scrollbar-width: none; opacity: 0; transform: translateY(6px); pointer-events: none; transition: opacity .16s, transform .16s; }
.tw-cand::-webkit-scrollbar { display: none; }
.tw-cand.on { opacity: 1; transform: none; pointer-events: auto; }
.tc-py { flex: none; font: 600 12px var(--mono); color: var(--brass); letter-spacing: .04em; margin-right: 6px; padding-right: 10px; border-right: 1px solid rgba(214, 176, 106, .3); }
.tc-w { flex: none; border: 0; background: none; display: flex; align-items: baseline; gap: 3px; padding: 6px 8px; border-radius: 12px; color: #f2e8ce; font: 600 16px var(--serif); white-space: nowrap; }
.tc-w small { font: 600 9px var(--mono); color: rgba(242, 232, 206, .4); }
.tc-w:first-of-type { background: rgba(214, 176, 106, .18); color: #fff3d6; }
.tc-w:active { background: rgba(214, 176, 106, .32); }
.tc-wait { flex: none; font: 500 12px var(--ui); color: rgba(242, 232, 206, .55); }
.tw-machine.caps .k-shift { color: var(--brass); box-shadow: 0 0 0 1.6px #cfc9bc, 0 0 0 2.7px #5b5750, 0 3px 0 2.4px #0a0a09, 0 0 14px 2px rgba(214, 176, 106, .4); }

.dock { position: absolute; left: 10px; right: 10px; bottom: 28px; height: 90px; border-radius: 32px; display: flex; align-items: center; padding: 0 6px; }
.dk-tools { flex: 1; display: flex; justify-content: space-around; }
.dk-tool { width: 60px; height: 80px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; padding-bottom: 8px;
  background: none; border: 0; cursor: pointer; color: var(--c3); font: 500 10.5px var(--ui); transition: color .25s; }
.dk-tool svg { width: 42px; height: 42px; filter: drop-shadow(0 3px 3px rgba(0, 0, 0, .45)); transition: transform .5s var(--spring), filter .3s; }
.dk-tool.on { color: var(--cream); }
.dk-tool.on svg { transform: translateY(-6px) scale(1.1) rotate(-4deg); filter: drop-shadow(0 10px 8px rgba(0, 0, 0, .45)) drop-shadow(0 0 12px rgba(255, 205, 130, .35)); }
.dk-tool:active svg { transform: scale(.9); }
.dk-sep { width: .5px; height: 46px; background: var(--hair); flex: none; }
.dk-opts { display: flex; padding-left: 4px; }
.dk-opt { width: 58px; height: 80px; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 6px; padding-bottom: 8px;
  background: none; border: 0; cursor: pointer; color: var(--c3); font: 500 10.5px var(--ui); }
.dk-opt:active > :first-child { transform: scale(.9); }
.sw-paper { display: block; width: 28px; height: 36px; border-radius: 2px; transform: rotate(-5deg); box-shadow: 0 4px 6px rgba(0, 0, 0, .45); transition: transform .35s var(--spring); }
.sw-paper.paper-airmail, .pg-sw.paper-airmail { border-width: 4px; }

/* ===================== envelope flow ===================== */
.env-stage { position: absolute; top: 108px; left: 0; right: 0; height: 252px; display: grid; place-items: center; }
.env-stage .env3d.big { width: 300px; }
.env-sheet { position: absolute; left: 0; right: 0; bottom: 0; top: 372px; border-radius: 32px 32px 0 0; padding: 16px 16px 0; overflow-y: auto; scrollbar-width: none;
  transition: transform .55s var(--ease), opacity .4s; }
.env-sheet::-webkit-scrollbar { display: none; }
.env-sheet.done { transform: translateY(105%); opacity: .4; }
.seg { position: relative; display: grid; grid-template-columns: repeat(3, 1fr); padding: 3px; border-radius: 12px; background: rgba(0, 0, 0, .28); margin-bottom: 14px; }
.seg button { position: relative; z-index: 1; height: 32px; border: 0; background: none; cursor: pointer; color: var(--c2); font: 600 13px var(--ui); transition: color .25s; }
.seg button.on { color: var(--cream); }
.seg-pill { position: absolute; top: 3px; bottom: 3px; left: 3px; width: calc((100% - 6px) / 3); border-radius: 9px; background: rgba(255, 238, 214, .15);
  box-shadow: 0 2px 8px rgba(0, 0, 0, .25), inset 0 .5px 0 rgba(255, 240, 220, .15); transform: translateX(calc(var(--i, 0) * 100%)); transition: transform .5s var(--spring); }
.group { border-radius: 14px; overflow: hidden; background: rgba(255, 238, 214, .06); border: .5px solid var(--hair); }
.g-row { display: flex; align-items: center; gap: 10px; width: 100%; min-height: 48px; padding: 0 14px; background: none; border: 0; color: var(--cream); font: 15px var(--ui); text-align: left; cursor: pointer; }
.g-row + .g-row { border-top: .5px solid var(--hair); }
.g-l { min-width: 70px; flex: none; white-space: nowrap; color: var(--c2); font-size: 14.5px; }
.g-row input, .g-row select { flex: 1; min-width: 0; height: 46px; border: 0; background: none; outline: none; color: var(--cream); font: 16px var(--ui); }
.g-row select option { color: #1d1610; }
.g-row input::placeholder { color: var(--c3); }
.g-v { flex: 1; text-align: right; font-size: 15px; white-space: nowrap; }
.g-v.ph { color: var(--c3); }
.g-row > .ic { color: var(--c3); flex: none; }
.okc { display: inline-flex; align-items: center; gap: 4px; color: #bfe2b8; font-size: 13.5px; }
.err { color: #f2a59a; font-size: 12.5px; }
.g-hint { font-size: 12px; line-height: 1.6; color: var(--c3); padding: 8px 6px 0; }
.stamps { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; }
.stamp-card { --sw: 50px; --r: 3.4px; display: flex; flex-direction: column; align-items: center; gap: 7px; padding: 14px 6px 11px; border-radius: 16px; cursor: pointer;
  background: rgba(255, 238, 214, .05); border: 1px solid transparent; color: var(--cream); transition: transform .4s var(--spring), border-color .25s, background .25s, opacity .25s; }
.stamp-card .stamp { --sw: 50px; --r: 3.4px; }
.stamp-card > b { font: 600 13.5px var(--ui); }
.stamp-card > small { font-size: 11px; color: var(--c2); line-height: 1.3; text-align: center; }
.stamp-card.on { border-color: rgba(214, 176, 106, .75); background: rgba(214, 176, 106, .12); }
.stamp-card.on .stamp { transform: rotate(-5deg) translateY(-3px) scale(1.08); }
.stamp-card:active:not(:disabled) { transform: scale(.96); }
.stamp-card:disabled { opacity: .32; cursor: not-allowed; }
.seal-row { position: sticky; bottom: 0; display: flex; align-items: center; gap: 14px; margin: 16px -16px 0; padding: 18px 18px 36px;
  background: linear-gradient(rgba(34, 22, 13, 0), rgba(34, 22, 13, .96) 28%); }
.seal-txt { flex: 1; min-width: 0; }
.seal-txt b { display: block; font: 600 15.5px var(--ui); }
.seal-txt small { display: block; margin-top: 4px; font-size: 12px; line-height: 1.55; color: var(--c2); }
.seal-btn { position: relative; width: 88px; height: 88px; flex: none; padding: 0; border: 0; border-radius: 50%; background: none; cursor: pointer; touch-action: none; }
.seal-btn .wax { position: absolute; left: 9px; top: 9px; width: 70px; height: 70px; transition: transform .35s var(--spring), filter .3s; }
.seal-btn:not(.disabled):not(.holding) .wax { animation: breathe 2.8s ease-in-out infinite; }
@keyframes breathe { 50% { transform: scale(1.05); } }
.seal-btn.holding .wax { transform: scale(.88); }
.seal-btn.disabled { cursor: not-allowed; }
.seal-btn.disabled .wax { filter: grayscale(.85) brightness(.65); }
.ring { position: absolute; inset: 0; width: 100%; height: 100%; transform: rotate(-90deg); }
.ring circle { fill: none; stroke-width: 3.5; }
.r-bg { stroke: rgba(255, 238, 214, .12); }
.r-fg { stroke: var(--brass); stroke-linecap: round; stroke-dasharray: 289; stroke-dashoffset: 289; filter: drop-shadow(0 0 4px rgba(214, 176, 106, .6)); }

/* ===================== track ===================== */
.v-track { background: #d8c7a2; }
.map-wrap { position: absolute; inset: 0; }
.map-wrap::after { content: ""; position: absolute; inset: 0; pointer-events: none; background: var(--noise), radial-gradient(120% 80% at 50% 30%, transparent 50%, rgba(80, 55, 25, .35)); background-size: 180px, auto; mix-blend-mode: multiply; }
.map-svg { display: block; width: 100%; height: 100%; }
.map-fallback { display: grid; place-items: center; height: 60%; color: #5c4528; font-size: 14px; }
.m-sea { fill: #d6c49d; }
.m-grat { fill: none; stroke: rgba(105, 80, 48, .16); stroke-width: .6; }
.m-land-shadow { fill: none; stroke: rgba(90, 66, 35, .2); stroke-width: 6; transform: translate(1.5px, 2px); }
.m-land { fill: #efe3c6; stroke: #7d6342; stroke-width: .7; stroke-opacity: .7; }
.m-border { fill: none; stroke: #8a6d47; stroke-width: .6; stroke-dasharray: 2.5 2; stroke-opacity: .55; }
.m-towns circle { fill: #8a6d47; opacity: .7; }
.m-towns text { font: 500 9.5px var(--serif); fill: #7a5f3c; paint-order: stroke; stroke: #efe3c6; stroke-width: 2.2px; opacity: .9; }
.m-route { fill: none; stroke: #6b5130; stroke-width: 1.7; stroke-dasharray: 1.5 5.5; stroke-linecap: round; opacity: .8; }
.m-done { fill: none; stroke: #9b2f2a; stroke-width: 2.8; stroke-linecap: round; }
.m-wp circle { fill: #efe3c6; stroke: #6b5130; stroke-width: 1.3; }
.m-wp text { font: 600 10.5px var(--serif); fill: #5c4528; paint-order: stroke; stroke: #efe3c6; stroke-width: 2.5px; }
.m-wp.passed circle { fill: #9b2f2a; stroke: #9b2f2a; }
.m-city circle:first-child { fill: #f8f0dd; stroke: #3d2c1a; stroke-width: 1.6; }
.m-core { fill: #3d2c1a; }
.m-city text { font: 700 13.5px var(--serif); fill: #2e2114; paint-order: stroke; stroke: #efe3c6; stroke-width: 3.5px; }
.m-to circle:first-child { stroke: #9b2f2a; }
.m-to .m-core { fill: #9b2f2a; }
.m-compass circle { fill: rgba(239, 227, 198, .55); stroke: #6b5130; stroke-width: .8; }
.m-compass path { fill: #6b5130; opacity: .45; }
.m-compass path.n { fill: #9b2f2a; opacity: .9; }
.m-compass text { font: 700 9px var(--serif); fill: #6b5130; }
.mc-disc { stroke: #f8f0dd; stroke-width: 2.5; filter: drop-shadow(0 3px 4px rgba(0, 0, 0, .35)); }
.mc-g { fill: none; stroke: #f8f0dd; stroke-width: 1.9; stroke-linecap: round; stroke-linejoin: round; }
.mc-ping { fill: none; stroke: #9b2f2a; stroke-width: 1.6; transform-box: fill-box; transform-origin: center; animation: mping 2.2s ease-out infinite; }
@keyframes mping { 0% { transform: scale(.8); opacity: .9; } 100% { transform: scale(2.3); opacity: 0; } }
.map-top { position: absolute; top: 56px; left: 16px; right: 16px; display: flex; align-items: center; justify-content: space-between; z-index: 3; }
.map-chip { display: inline-flex; align-items: center; gap: 6px; height: 34px; padding: 0 14px; border-radius: 17px; font: 600 13px var(--ui); color: var(--cream); }
.dsheet { position: absolute; left: 0; right: 0; bottom: 0; height: 86%; border-radius: 34px 34px 0 0; z-index: 4; touch-action: none;
  transform: translateY(calc(47% + var(--drag, 0px))); transition: transform .55s var(--spring); }
.dsheet.up { transform: translateY(calc(0% + var(--drag, 0px))); }
.grabber { width: 38px; height: 5px; border-radius: 3px; background: rgba(255, 238, 214, .3); margin: 8px auto 4px; cursor: grab; }
.ds-in { height: calc(100% - 17px); overflow-y: auto; padding: 4px 20px 40px; scrollbar-width: none; touch-action: pan-y; }
.ds-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 12px; padding: 4px 0; cursor: grab; }
.ds-head h2 { font: 700 21px/1.3 var(--serif); }
.ds-head small { font-size: 13px; color: var(--c2); }
.cd { display: flex; align-items: baseline; gap: 4px; margin: 16px 0 4px; }
.cd-d { font: 700 58px/1 var(--serif); }
.cd-u { font: 500 17px var(--ui); color: var(--c2); margin-right: 12px; }
.cd-t { font: 500 34px/1 var(--ui); font-variant-numeric: tabular-nums; letter-spacing: -.01em; }
.cd.word { font: 700 40px/1.15 var(--serif); }
.cd-l { font-size: 14px; color: var(--c2); line-height: 1.55; margin-bottom: 12px; }
.count .btn { margin-top: 4px; }
.progress { display: flex; align-items: center; gap: 10px; margin: 16px 0 6px; font: 600 12.5px var(--ui); color: var(--c2); }
.pg-line { position: relative; flex: 1; height: 3px; border-radius: 2px; background: var(--c4); }
.pg-line i { position: absolute; left: 0; top: 0; bottom: 0; border-radius: 2px; background: linear-gradient(90deg, var(--brass), #f3d89f); transition: width 1s var(--ease); }
.pg-line b { position: absolute; top: 50%; width: 26px; height: 26px; margin: -13px 0 0 -13px; border-radius: 50%; display: grid; place-items: center; color: #f8f0dd;
  background: var(--c); box-shadow: 0 0 0 2.5px rgba(248, 240, 221, .25), 0 3px 8px rgba(0, 0, 0, .4); transition: left 1s var(--ease); }
.pm-strip { display: flex; gap: 12px; overflow-x: auto; padding: 8px 4px 14px; scrollbar-width: none; --pmc: rgba(244, 232, 210, .74); }
.pm-strip .pm { --pm: 68px; mix-blend-mode: normal; }
.pm-strip .pm-arrive { --pmc: #eea99f; }
.pm-strip .pm-forward { --pmc: #9fc0e0; }
.pm-more { border-style: dashed !important; }
.pm-more::before { display: none; }
.linkbox { display: flex; align-items: center; gap: 10px; padding: 8px 8px 8px 12px; border-radius: 14px; color: var(--c2); }
.linkbox code { flex: 1; min-width: 0; font: 12px var(--mono); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.small-link { display: inline-flex; align-items: center; gap: 4px; margin: 10px 0 0 4px; font-size: 13.5px; color: var(--brass); text-decoration: none; }
.note { display: flex; gap: 8px; align-items: flex-start; margin-top: 18px; font-size: 12.5px; line-height: 1.6; color: var(--c3); }
.note svg { flex: none; margin-top: 3px; }

/* ===================== letter: away / ceremony / read ===================== */
.stage-center { position: absolute; left: 0; right: 0; top: 112px; display: grid; place-items: center; }
.away-stage { height: calc(100% - 112px - 330px); }
.cer-stage { height: calc(100% - 112px - 210px); }
.cer-stage .env-card { cursor: pointer; }
.cer-hint { position: absolute; left: 50%; bottom: 128px; transform: translateX(-50%); display: inline-flex; align-items: center; gap: 8px; height: 40px; padding: 0 16px 0 12px; border-radius: 20px;
  background: rgba(255, 238, 214, .1); -webkit-backdrop-filter: blur(16px); backdrop-filter: blur(16px); box-shadow: inset 0 0 0 .5px var(--hair); font: 500 14px var(--ui); white-space: nowrap; transition: opacity .4s, transform .4s var(--ease); }
.cer-hint .h-ic { display: grid; color: var(--brass); animation: tapme 1.8s ease-in-out infinite; }
@keyframes tapme { 0%, 100% { transform: none; } 50% { transform: translateY(-3px) scale(.92); } }
.cer-hint.gone { opacity: 0; transform: translateX(-50%) translateY(10px); }
.cer-meta { position: absolute; left: 0; right: 0; bottom: 92px; text-align: center; font-size: 12.5px; color: var(--c3); }
.card-sheet { position: absolute; left: 0; right: 0; bottom: 0; border-radius: 32px 32px 0 0; padding: 22px 16px 38px; }
.lead { font-size: 14.5px; line-height: 1.65; color: var(--c2); padding: 0 4px 6px; }
.lead.center { text-align: center; }
.opt-row { display: flex; align-items: center; gap: 12px; width: 100%; margin-top: 10px; padding: 14px; border-radius: 18px; text-align: left; cursor: pointer;
  background: rgba(255, 238, 214, .06); border: .5px solid var(--hair); color: var(--cream); transition: transform .3s var(--spring), background .2s; }
.opt-row:active:not(.static) { transform: scale(.98); background: rgba(255, 238, 214, .1); }
.opt-row.static { cursor: default; }
.opt-row > .ic { color: var(--c3); flex: none; }
.o-ic { width: 42px; height: 42px; border-radius: 13px; display: grid; place-items: center; flex: none; color: #f6ecd8; background: linear-gradient(160deg, color-mix(in srgb, var(--c, #7a5a36) 85%, #fff 8%), color-mix(in srgb, var(--c, #7a5a36) 80%, #000)); }
.o-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.o-main b { font: 600 15.5px var(--ui); }
.o-main small { font-size: 12.5px; line-height: 1.5; color: var(--c2); }
.o-tag { flex: none; padding: 4px 8px; border-radius: 8px; font-size: 11px; color: var(--brass); background: rgba(214, 176, 106, .16); white-space: nowrap; }

.read-scroll { padding: 108px 14px 150px; }
.paper.read { position: relative; padding: 26px 24px 22px; transform: rotate(-.3deg); }
.paper.read .ink { background: repeating-linear-gradient(180deg, transparent 0 calc(var(--lh) - 1px), var(--rule) calc(var(--lh) - 1px) var(--lh)); }
.paper.read.tool-typewriter .ink { background: none; }
.paper.unfold { animation: unfold 1.1s var(--soft) both; transform-origin: 50% 0; }
@keyframes unfold { 0% { transform: perspective(900px) translateY(80px) rotateX(78deg) scaleY(.4); opacity: 0; filter: brightness(1.25); } 45% { opacity: 1; } 100% { transform: rotate(-.3deg); filter: none; } }
.sign { display: flex; align-items: center; justify-content: flex-end; gap: 10px; margin-top: 22px; font: 12px var(--ui); color: #8a6d4b; }
.journey { padding: 30px 2px 0; }
.journey .sec-h { padding-top: 6px; }
.j-card { border-radius: 20px; padding: 14px; margin-bottom: 18px; }
.j-sum { display: flex; align-items: center; gap: 12px; }
.j-sum b { display: block; font: 600 15px var(--ui); }
.j-sum small { font-size: 12.5px; color: var(--c2); }
.tl-row { position: relative; display: grid; grid-template-columns: 12px 1fr auto; gap: 10px; align-items: start; padding: 10px 4px; }
.tl-row i { width: 8px; height: 8px; margin-top: 6px; border-radius: 50%; background: var(--brass); box-shadow: 0 0 0 3px rgba(214, 176, 106, .18); }
.tl-row + .tl-row::before { content: ""; position: absolute; left: 7.5px; top: -8px; width: 1px; height: 18px; background: var(--hair); }
.tl-row div b { display: block; font: 600 14.5px var(--ui); color: var(--cream); }
.tl-row div span { font-size: 12px; color: var(--c2); }
.tl-row em { font-style: normal; font-size: 12px; color: var(--c2); white-space: nowrap; margin-top: 2px; }
.tl-row.live i { background: #f2cd8f; animation: pulse 1.4s infinite; }
.float-top { position: absolute; top: 56px; left: 16px; z-index: 5; }
.float-bottom { position: absolute; left: 0; right: 0; bottom: 34px; display: flex; justify-content: center; z-index: 5; pointer-events: none; }
.float-bottom .btn { pointer-events: auto; }
.notice { position: absolute; inset: 0; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 18px; padding: 40px; text-align: center; color: var(--c2); line-height: 1.6; }

/* ===================== sent & me & link ===================== */
.cards { display: flex; flex-direction: column; gap: 10px; }
.ocard { display: flex; align-items: center; gap: 14px; padding: 14px 14px 14px 16px; border-radius: 20px; color: var(--cream); text-decoration: none; transition: transform .3s var(--spring); }
.ocard:active { transform: scale(.98); }
.oc-env { flex: none; display: block; transform: rotate(-5deg); }
.oc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 4px; }
.oc-main b { font: 600 16px var(--ui); }
.oc-main small { display: flex; align-items: center; gap: 4px; font-size: 12.5px; color: var(--c2); white-space: nowrap; overflow: hidden; }
.oc-main small svg { flex: none; }
.oc-main .ell { min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.oc-date { color: var(--c3) !important; }
.oc-side { flex: none; font-size: 13px; color: var(--c2); text-align: right; }

.card-wrap { display: flex; flex-direction: column; align-items: center; gap: 16px; padding: 24px 16px 4px; }
.acard { position: relative; width: 100%; max-width: 340px; aspect-ratio: 1.7; display: flex; flex-direction: column; padding: 20px 22px 16px; border-radius: 10px; color: #3a2c1c; transform: rotate(-1.5deg);
  background: var(--noise), linear-gradient(160deg, #f8f0df, #eadabd); background-size: 160px, auto; box-shadow: 0 26px 32px -14px rgba(0, 0, 0, .6), 0 2px 3px rgba(0, 0, 0, .2), inset 0 0 0 1px rgba(255, 255, 255, .4); }
.ac-k { font: 700 9.5px var(--ui); letter-spacing: .26em; color: #9a7c55; }
.ac-name { margin-top: auto; font: 700 34px/1.2 var(--serif); color: #3a2c1c; text-shadow: 0 1px 0 rgba(255, 255, 255, .7), 0 -1px 0 rgba(60, 40, 15, .18); }
.ac-city { display: flex; align-items: center; gap: 4px; margin-top: 2px; font-size: 14px; color: #6b5a44; }
.ac-foot { display: flex; justify-content: space-between; margin-top: 12px; padding-top: 10px; border-top: 1px solid rgba(90, 70, 40, .18); font: 12px var(--mono); color: #6b5a44; }
.ac-wax { position: absolute; right: 16px; top: 14px; }
.foot-note { padding: 0 14px; font-size: 12.5px; line-height: 1.6; color: var(--c3); text-align: center; }

.center-col { display: flex; flex-direction: column; align-items: center; gap: 12px; padding: 76px 20px 40px; text-align: center; }
.center-col .stage-center { position: static; padding: 14px 0 6px; }
.eyebrow { font-size: 13px; letter-spacing: .08em; color: var(--brass); }
.hero-t { font: 700 26px/1.3 var(--serif); }
.arrive .env3d { animation: arrive 1.1s var(--soft) both; }
@keyframes arrive { from { transform: translateY(-70px) rotate(-10deg); opacity: 0; } }
.lstat { width: 100%; }
.lstat p { font-size: 13px; color: var(--c2); }
.group.wide { width: 100%; text-align: left; }
.center-col .g-hint { text-align: left; width: 100%; }

/* ===================== sheets & alerts ===================== */
#overlay { position: absolute; inset: 0; z-index: 50; pointer-events: none; }
#overlay > * { pointer-events: auto; }
.sheet-wrap { position: absolute; inset: 0; }
.sheet-dim { position: absolute; inset: 0; background: rgba(0, 0, 0, .42); opacity: 0; transition: opacity .35s; }
.sheet-wrap.in .sheet-dim { opacity: 1; }
.sheet { position: absolute; left: 8px; right: 8px; bottom: 8px; max-height: 84%; overflow-y: auto; scrollbar-width: none; border-radius: 38px; padding: 0 18px 26px; color: var(--cream);
  transform: translateY(112%); transition: transform .55s var(--spring); }
.sheet::-webkit-scrollbar { display: none; }
.sheet-wrap.in .sheet { transform: none; }
.sheet-wrap.out .sheet { transform: translateY(112%); transition: transform .38s var(--ease); }
.sheet-wrap.out .sheet-dim { opacity: 0; }
.sheet.tall { height: 80%; display: flex; flex-direction: column; overflow: hidden; }
.sh-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 4px 0 12px; cursor: grab; }
.sh-head h3 { font: 700 19px var(--serif); }
.sh-x { width: 30px; height: 30px; border-radius: 50%; border: 0; display: grid; place-items: center; flex: none; cursor: pointer; color: var(--c2); background: rgba(255, 238, 214, .1); }
.sh-p { font-size: 13.5px; line-height: 1.65; color: var(--c2); margin-bottom: 14px; }
.sh-p.center, .center-t, .price { text-align: center; }
.sheet .btn.wide { margin-top: 10px; }
.search { display: flex; align-items: center; gap: 8px; height: 40px; padding: 0 12px; margin-bottom: 8px; border-radius: 12px; background: rgba(0, 0, 0, .28); color: var(--c3); flex: none; }
.search input { flex: 1; min-width: 0; border: 0; outline: none; background: none; color: var(--cream); font: 16px var(--ui); }
.search input::placeholder { color: var(--c3); }
.city-list { flex: 1; overflow-y: auto; margin: 0 -8px; scrollbar-width: none; }
.city-list .row { min-height: 54px; border-radius: 12px; }
.city-list .row::before { left: 14px !important; }
.city-list .row.on b { color: var(--brass); }
.list.inset { background: rgba(0, 0, 0, .2); border-radius: 14px; margin-bottom: 14px; }
.list.inset .row { min-height: 48px; align-items: center; }
.list.inset .row::before { left: 14px; }
.empty-note { padding: 16px; text-align: center; font-size: 13px; color: var(--c3); }
.tl.glass-inset { border-radius: 16px; padding: 4px 10px; }
.toggle-row { display: flex; align-items: center; justify-content: space-between; gap: 14px; padding: 16px 4px 2px; cursor: pointer; }
.toggle-row b { display: block; font: 600 15px var(--ui); }
.toggle-row small { font-size: 12px; color: var(--c2); }
.switch { appearance: none; -webkit-appearance: none; position: relative; width: 51px; height: 31px; flex: none; border-radius: 16px; background: rgba(255, 238, 214, .2); cursor: pointer; transition: background .25s; }
.switch::after { content: ""; position: absolute; left: 2px; top: 2px; width: 27px; height: 27px; border-radius: 50%; background: #fff; box-shadow: 0 2px 5px rgba(0, 0, 0, .3); transition: transform .4s var(--spring); }
.switch:checked { background: #5f9a5a; }
.switch:checked::after { transform: translateX(20px); }
.paper-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px 8px; padding-bottom: 6px; }
.pg { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 8px 0; border: 0; background: none; color: var(--cream); cursor: pointer; }
.pg-sw { display: grid; place-items: center; width: 74px; height: 92px; border-radius: 3px; box-shadow: 0 10px 14px -5px rgba(0, 0, 0, .55); transition: transform .4s var(--spring); }
.pg-sw i { font: 400 14px var(--hand); font-style: normal; color: #1f2b4a; }
.pg-sw.big { width: 140px; height: 176px; }
.pg-sw.big i { font-size: 22px; }
.pg-sw.tiny { width: 22px; height: 28px; flex: none; box-shadow: 0 3px 5px rgba(0, 0, 0, .4); }
.pg-sw.tiny i { display: none; }
.pg.on .pg-sw { transform: translateY(-5px) rotate(-3deg); outline: 2px solid var(--brass); outline-offset: 4px; }
.pg b { font: 600 13px var(--ui); }
.pg small { font-size: 11px; color: var(--c2); }
.wax-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 6px; padding-bottom: 4px; }
.wg { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 10px 0 8px; border: 0; border-radius: 18px; background: none; color: var(--c2); cursor: pointer; transition: background .25s; }
.wg .wax { transition: transform .45s var(--spring); }
.wg.on { background: rgba(255, 238, 214, .08); color: var(--cream); }
.wg.on .wax { transform: scale(1.1) rotate(-8deg); }
.wg b { font: 600 12.5px var(--ui); }
.wax-grid.seals { grid-template-columns: repeat(5, 1fr); gap: 2px; }
.wax-grid.seals .wg { padding: 8px 0 6px; }
.wax-grid.seals .wg b { font-size: 11.5px; }
.sh-sub { margin: 14px 4px 6px; font: 600 12.5px var(--ui); color: var(--c3); letter-spacing: .04em; }
.seal-art .f { fill: var(--sf); stroke: none; }
.paid-hero { display: flex; justify-content: center; padding: 18px 0 10px; }
.center-t { font: 700 20px var(--serif); }
.price { font: 600 26px var(--ui); color: var(--brass); margin: 6px 0 8px; }

.alert-wrap { position: absolute; inset: 0; z-index: 60; display: grid; place-items: center; background: rgba(0, 0, 0, .38); opacity: 0; transition: opacity .2s; }
.alert-wrap.in { opacity: 1; }
.alert { width: 272px; overflow: hidden; border-radius: 18px; text-align: center; transform: scale(1.12); transition: transform .35s var(--spring); }
.alert-wrap.in .alert { transform: none; }
.al-b { padding: 20px 16px 16px; }
.al-b b { display: block; font: 600 16.5px/1.35 var(--ui); }
.al-b p { margin-top: 6px; font-size: 13px; line-height: 1.5; color: var(--c2); }
.al-a { display: flex; border-top: .5px solid var(--hair); }
.al-a button { flex: 1; height: 46px; border: 0; background: none; cursor: pointer; color: #eac57e; font: 400 16.5px var(--ui); }
.al-a button + button { border-left: .5px solid var(--hair); }
.al-a .bold { font-weight: 600; }
.al-a .destructive { color: #f18b7f; font-weight: 600; }

/* ===================== view transitions ===================== */
::view-transition-old(root), ::view-transition-new(root) { animation: none; }
::view-transition-old(view) { animation: vt-out .28s var(--ease) both; }
::view-transition-new(view) { animation: vt-in .42s var(--ease) both; }
html[data-nav="push"]::view-transition-new(view) { animation-name: vt-push; }
html[data-nav="pop"]::view-transition-new(view) { animation-name: vt-pop; }
::view-transition-group(hero-env) { animation-duration: .6s; animation-timing-function: var(--soft); }
@keyframes vt-out { to { opacity: 0; } }
@keyframes vt-in { from { opacity: 0; } }
@keyframes vt-push { from { opacity: 0; transform: translateY(22px) scale(.985); } }
@keyframes vt-pop { from { opacity: 0; transform: scale(1.02); } }

/* ===================== demo panel ===================== */
#demo { position: fixed; left: 0; top: 0; bottom: 0; width: 300px; overflow-y: auto; padding: 24px 20px; background: #13110f; border-right: 1px solid #241f1a; color: #d9cfbf; font: 13px var(--ui); z-index: 10; }
.d-head { display: flex; align-items: center; gap: 8px; font: 600 15px var(--ui); color: #f1e7d6; }
.demo-pill { padding: 3px 7px; border-radius: 5px; background: var(--brass); color: #1a140c; font: 700 10px var(--mono); letter-spacing: .1em; }
.d-sub { margin: 8px 0 18px; font-size: 12px; line-height: 1.6; color: #8e8577; }
.d-field { display: flex; flex-direction: column; gap: 7px; margin-bottom: 16px; }
.d-field > span { font-size: 11.5px; letter-spacing: .04em; color: #9b917f; }
.d-field small { color: #6f675b; }
.d-field select { height: 36px; padding: 0 10px; border-radius: 9px; border: 1px solid #2e2924; background: #1e1b18; color: #efe6d6; font: 13.5px var(--ui); }
.d-clock { font: 600 15px var(--ui); color: #f1e7d6; font-variant-numeric: tabular-nums; }
.dseg { display: flex; gap: 4px; padding: 3px; border-radius: 9px; border: 1px solid #2e2924; background: #1e1b18; }
.dseg button { flex: 1; height: 28px; border: 0; border-radius: 6px; background: none; color: #b3a998; font: 12px var(--ui); cursor: pointer; }
.dseg button.on { background: #3a332b; color: #fff; }
.d-guide { margin-top: 20px; padding: 14px; border-radius: 12px; background: #1a1714; border: 1px solid #2a2520; }
.d-guide > span { font-size: 11.5px; letter-spacing: .06em; color: var(--brass); }
.d-guide ol { display: grid; gap: 9px; margin-top: 8px; padding-left: 18px; font-size: 12.5px; line-height: 1.6; color: #bdb2a0; }
.d-reset { width: 100%; height: 36px; margin-top: 16px; border-radius: 9px; border: 1px solid #3a2a26; background: none; color: #d58a7e; cursor: pointer; }
.demo-fab { display: none; }

/* ===================== devices ===================== */
/* 手机上，分屏容器只是透明的包装 */
.pa, .pb { display: contents; }
.w-side, .winbar, .hinge, .tb-brand, .tbw-l, .tb-foot, .pb-empty { display: none; }

/* ---------- iPhone Duo ----------
   依据 Apple「Prepare your app for iPhone Duo」和配套 Tech Talk（111461 / 111462 / 111463）：
   · 合上（外屏）：状态栏和摄像头在右侧，导航栏 / 工具栏 / 标签栏竖排在右侧，内容占满左边
   · 书本（内屏半折，折痕竖在中间）：size class 是 regular / regular，像 iPad 布局的延伸；折痕是一块 division 保留区，
     两栏 50/50 分在折痕两侧；弹窗、提示移到尾侧；系统栏竖排在右侧
   · 立起（比宽更高，折痕横在中间）：回到熟悉的 iPhone 横向栏；上半区放远处看的内容，下半区放可点的控件
   Apple 没公布点数，这里按 7.6" 2670×1878 估成 951×669pt，外屏按 5.4" 估成 466×678pt；竖栏宽度也是估的 */
.device.dev-duo { --hinge: 16px; }
.dev-duo .bezel { border-radius: 46px; }
.dev-duo .screen { border-radius: 34px; overflow: clip; }
.dev-duo .hinge { display: block; position: absolute; z-index: 3; pointer-events: none; }
.dev-duo .hinge i { display: none; position: absolute; border-radius: 4px; background: linear-gradient(90deg, #24211e, #8c857b 45%, #3a3632 60%, #151311); box-shadow: 0 0 0 1px #0a0908; }
.dev-duo .pb-empty, .wide .pb-empty { display: block; padding: 48px 34px; text-align: center; font-size: 13.5px; line-height: 1.6; color: var(--c3); }

/* —— 尺寸 —— */
.device.dev-duo.posture-cover { --rail: 58px; width: 490px; height: 702px; }
.dev-duo.posture-cover .bezel { border-radius: 52px; }
.dev-duo.posture-cover .screen { width: 466px; height: 678px; border-radius: 40px; }
.device.dev-duo.posture-book { --rail: 66px; --fold: 467px; --fr: calc(var(--fold) + var(--hinge)); width: 975px; height: 693px; }
.dev-duo.posture-book .screen { width: 951px; height: 669px; }
.device.dev-duo.posture-stand { --half: 467px; --b: calc(var(--half) + var(--hinge)); width: 693px; height: 975px; }
.dev-duo.posture-stand .screen { width: 669px; height: 951px; }

/* —— 铰链 / 折痕 —— */
/* 合上：书脊在左侧 */
.dev-duo.posture-cover .hinge { left: -5px; top: 70px; bottom: 70px; width: 9px; border-radius: 5px; background: linear-gradient(90deg, #151311, #6f6961 40%, #2a2724 75%, #0e0d0c); box-shadow: 0 0 0 1px #0a0908; }
/* 书本：折痕竖在中间，上下两端露出铰链 */
.dev-duo.posture-book .hinge { top: 12px; bottom: 12px; left: calc(12px + var(--fold)); width: var(--hinge); background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .36) 42%, rgba(255, 226, 180, .1) 58%, transparent); }
.dev-duo.posture-book .hinge i { display: block; left: 3px; right: 3px; height: 10px; background: linear-gradient(180deg, #24211e, #8c857b 45%, #3a3632 60%, #151311); }
.dev-duo.posture-book .hinge i:first-child { top: -19px; }
.dev-duo.posture-book .hinge i:last-child { bottom: -19px; }
.dev-duo.posture-book .bezel { background: linear-gradient(90deg, #4a4540 0%, #2a2724 calc(12px + var(--fold)), #1b1917 calc(12px + var(--fr)), #2b2825 100%); }
.dev-duo.posture-book .screen::before, .dev-duo.posture-book .screen::after { content: ''; position: absolute; top: 0; bottom: 0; width: 46px; z-index: 39; pointer-events: none; }
.dev-duo.posture-book .screen::before { left: calc(var(--fold) - 46px); background: linear-gradient(90deg, transparent, rgba(0, 0, 0, .2)); }
.dev-duo.posture-book .screen::after { left: var(--fr); background: linear-gradient(90deg, rgba(0, 0, 0, .26), transparent); }
/* 立起：折痕横在中间，左右两端露出铰链；下半区微微后仰，暗一点 */
.dev-duo.posture-stand .hinge { left: 12px; right: 12px; top: calc(12px + var(--half)); height: var(--hinge); background: linear-gradient(180deg, transparent, rgba(0, 0, 0, .34) 42%, rgba(255, 226, 180, .1) 58%, transparent); }
.dev-duo.posture-stand .hinge i { display: block; top: 3px; bottom: 3px; width: 10px; background: linear-gradient(180deg, #24211e, #8c857b 45%, #3a3632 60%, #151311); }
.dev-duo.posture-stand .hinge i:first-child { left: -19px; }
.dev-duo.posture-stand .hinge i:last-child { right: -19px; }
.dev-duo.posture-stand .bezel { background: linear-gradient(180deg, #4a4540 0%, #2a2724 calc(12px + var(--half)), #1b1917 calc(12px + var(--b)), #2b2825 100%); }
.dev-duo.posture-stand .screen::before, .dev-duo.posture-stand .screen::after { content: ''; position: absolute; left: 0; right: 0; z-index: 39; pointer-events: none; }
.dev-duo.posture-stand .screen::before { top: calc(var(--half) - 40px); height: 40px; background: linear-gradient(transparent, rgba(0, 0, 0, .22)); }
.dev-duo.posture-stand .screen::after { top: var(--b); height: 60px; background: linear-gradient(rgba(0, 0, 0, .3), transparent); }

/* ===== 竖栏（合上 / 书本）：状态栏、摄像头、导航和标签都在右侧，内容在左边的安全区里 ===== */
.dev-duo.rail .view { right: var(--rail); overflow: visible; }
.dev-duo.rail .screen:not(.no-tabs) .view { left: 0; }
.dev-duo.rail .statusbar { left: auto; right: 0; width: var(--rail); height: auto; padding: 48px 0 0; flex-direction: column; align-items: center; gap: 10px; font-size: 14px; }
.dev-duo.rail .sb-r { flex-direction: column; gap: 8px; }
/* Apple 的 Duo 资料里没有灵动岛：摄像头是固定的小孔（相机工作时是一块 occlusion 保留区）。
   所以摄像头单独画成小孔，通知改成独立滑入的横幅，不再从摄像头“变形”出来 */
.dev-duo .statusbar::before { content: ''; position: absolute; width: 20px; height: 20px; border-radius: 50%;
  background: radial-gradient(circle at 50% 50%, #1c2a3a 0 3px, #050608 3.5px 7px, #000 7.5px); box-shadow: 0 0 0 1px rgba(255, 255, 255, .05); }
.dev-duo.rail .statusbar::before { top: 14px; left: 50%; margin-left: -10px; }
.dev-duo.posture-stand .statusbar::before { top: 14px; left: 50%; margin-left: -10px; }
.device.dev-duo .island { left: auto; right: calc(var(--rail, 0px) + 12px); top: 12px; width: 340px; height: 74px; border-radius: 22px; transform: none;
  opacity: 0; translate: 0 -14px; pointer-events: none; background: rgba(30, 21, 14, .92); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px);
  box-shadow: 0 18px 40px rgba(0, 0, 0, .45), inset 0 0 0 .5px var(--hair); transition: opacity .3s, translate .55s var(--spring); }
.device.dev-duo .island.open { opacity: 1; translate: 0 0; width: 340px; height: 74px; top: 12px; border-radius: 22px; pointer-events: auto; }
.device.dev-duo.posture-stand .island { right: auto; left: 50%; margin-left: -170px; top: 42px; }
.dev-duo.rail .home-ind { left: calc(50% - var(--rail) / 2); }
/* 标签栏竖排：只用图标 + 短标签，写信按钮紧跟其后 */
.device.dev-duo.rail #tabbar { left: auto; right: 0; top: 116px; bottom: auto; width: var(--rail); flex-direction: column; justify-content: flex-start; align-items: center; gap: 14px; padding: 0;
  background: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; }
.dev-duo.rail .no-tabs #tabbar { transform: translateX(110%); opacity: 0; }
.dev-duo.rail .tb-brand, .dev-duo.rail .tbw-l, .dev-duo.rail .tb-foot { display: none; }
.dev-duo.rail .tb-cap { order: 0; flex-direction: column; width: 52px; height: auto; padding: 4px; border-radius: 26px;
  background: rgba(30, 20, 12, .42); -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%); box-shadow: inset 0 0 0 .5px var(--hair), 0 10px 24px rgba(0, 0, 0, .25); }
.dev-duo.rail .tb { width: 44px; height: 54px; padding: 0; flex-direction: column; justify-content: center; gap: 3px; font: 600 9.5px var(--ui); }
.dev-duo.rail .tb .ic { width: 21px; height: 21px; }
.dev-duo.rail .tb-pill { left: 4px; right: 4px; top: 4px; bottom: auto; width: auto; height: 54px; border-radius: 22px; transform: translateY(calc(var(--i, 0) * 54px)); }
.dev-duo.rail .badge { top: 3px; right: 0; margin-top: 0; }
.dev-duo.rail .tb-write { order: 1; width: 48px; height: 48px; padding: 0; border-radius: 50%; gap: 0; }
/* 导航栏竖排：顶端是关闭 / 返回，接着是主要操作；标题留在内容区右上角 */
.dev-duo.rail .navbar { left: auto; right: calc(-1 * var(--rail)); top: 116px; width: var(--rail); height: auto; flex-direction: column; justify-content: flex-start; align-items: center; gap: 14px; padding: 0; }
.dev-duo.rail .navbar .nb-sp { display: none; }
.dev-duo.rail .nb-t { position: absolute; right: calc(100% + 18px); top: -102px; width: 320px; align-items: flex-end; text-align: right; }
.dev-duo.rail .navbar .btn { width: 46px; height: 46px; padding: 0; border-radius: 50%; font-size: 0; gap: 0; }
.dev-duo.rail .navbar .btn::before { content: ''; width: 22px; height: 22px; background: currentColor;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E") center / contain no-repeat;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24' fill='none' stroke='black' stroke-width='2' stroke-linecap='round' stroke-linejoin='round'%3E%3Crect x='3' y='5' width='18' height='14' rx='2'/%3E%3Cpath d='m3 7 9 6 9-6'/%3E%3C/svg%3E") center / contain no-repeat; }
.dev-duo.rail .map-top { left: auto; right: calc(-1 * var(--rail)); top: 116px; width: var(--rail); flex-direction: column; justify-content: flex-start; }
.dev-duo.rail .map-top .nb-sp { display: none; }
.dev-duo.rail .map-top .map-chip { position: absolute; right: calc(100% + 16px); top: -100px; margin: 0; white-space: nowrap; }
/* 背景可以铺到安全区外：地图延伸到竖栏下面 */
.dev-duo.rail .map-wrap { right: calc(-1 * var(--rail)); }

/* —— 合上：外屏，沿用 iPhone 单栏，只是系统栏挪到右侧 —— */
.dev-duo.posture-cover .home-ind { width: 120px; margin-left: -60px; }
.dev-duo.posture-cover .scroll { padding-top: 22px; padding-bottom: 40px; }
.dev-duo.posture-cover .read-scroll { padding-top: 62px; }
.dev-duo.posture-cover .paper-stage { top: 62px; }
.dev-duo.posture-cover .center-col { padding-top: 34px; }
.dev-duo.posture-cover .env-stage { top: 54px; height: 210px; }
.dev-duo.posture-cover .env-sheet { top: 276px; }
.dev-duo.posture-cover .stage-center { top: 58px; }
.dev-duo.posture-cover .cer-stage { height: calc(100% - 58px - 200px); }
.dev-duo.posture-cover .away-stage { height: calc(100% - 58px - 320px); }
.dev-duo.posture-cover .env3d.big { width: 300px; }

/* —— 书本的基础：内屏横放，iPad 布局的延伸（内容宽 885pt），下面再按折痕分栏 —— */
.dev-duo.wide .scroll { padding-top: 34px; }
.dev-duo.wide .pb { padding-top: 70px; }
.dev-duo.wide .pile { height: 300px; }
.dev-duo.wide .pcard { width: 380px; margin-left: -190px; }
.dev-duo.wide .read-scroll { grid-template-columns: minmax(0, 500px) 300px; column-gap: 34px; padding: 62px 28px 110px; }
.dev-duo.wide .center-col:has(> .pa) { grid-template-columns: minmax(0, 1fr) 360px; column-gap: 40px; padding: 40px 44px; }
.dev-duo.wide .env3d.big { width: 380px; }
.dev-duo.wide .paper-stage { width: 500px; margin-left: -330px; top: 70px; bottom: 134px; }
.dev-duo.wide .dock { width: 500px; margin-left: -330px; }
.dev-duo.wide .w-side { right: 22px; top: 70px; width: 220px; max-height: calc(100% - 210px); }
.dev-duo.wide .v-write.tw .paper-stage { width: 400px; margin-left: -250px; top: 62px; bottom: 343px; }
.dev-duo.wide .tw-machine { bottom: 129px; }
.dev-duo.wide .v-write.tw .tw-machine { transform: scale(1.05); }
.dev-duo.wide .env-stage { top: 40px; bottom: 30px; }
.dev-duo.wide .env-stage .env3d.big { width: 360px; }
.dev-duo.wide .env-sheet { top: 24px; bottom: 24px; }
.dev-duo.wide .cer-stage, .dev-duo.wide .away-stage { top: 40px; }
.dev-duo.wide .cer-stage { height: calc(100% - 40px - 190px); }
.dev-duo.wide .away-stage { height: calc(100% - 40px - 340px); }
.dev-duo.wide .dsheet { top: 24px; }

/* —— 书本：折痕把内容分成左 0–467、右 483–885 两块，各自对齐折痕；弹窗在尾侧（右） —— */
.dev-duo.posture-book .scroll:has(> .pa), .dev-duo.posture-book .read-scroll, .dev-duo.posture-book .center-col:has(> .pa) {
  grid-template-columns: 425px 362px; column-gap: 56px; justify-content: start; padding-left: 22px; padding-right: 20px; }
.dev-duo.posture-book .center-col:has(> .pa) { padding-top: 40px; padding-bottom: 40px; }
.dev-duo.posture-book .paper-stage { left: 22px; width: 425px; margin-left: 0; }
.dev-duo.posture-book .w-side { left: calc(var(--fr) + 20px); right: 20px; width: auto; }
.dev-duo.posture-book .dock { left: calc(var(--fr) + 20px); width: 362px; margin-left: 0; }
.dev-duo.posture-book .dk-tool { width: 50px; }
.dev-duo.posture-book .dk-opt { width: 48px; }
.dev-duo.posture-book .v-write.tw .paper-stage { left: 34px; width: 400px; margin-left: 0; }
.dev-duo.posture-book .tw-machine { left: 37px; margin-left: 0; }
.dev-duo.posture-book .env-stage { left: 0; right: auto; width: var(--fold); }
.dev-duo.posture-book .env-sheet { left: calc(var(--fr) + 20px); right: 20px; }
.dev-duo.posture-book .cer-stage, .dev-duo.posture-book .away-stage { right: auto; width: var(--fold); height: calc(100% - 80px); }
.dev-duo.posture-book .cer-hint { left: calc(var(--fr) + (885px - var(--fr)) / 2); bottom: auto; top: calc(50% - 20px); }
.dev-duo.posture-book .cer-meta { left: var(--fr); right: 0; bottom: auto; top: calc(50% + 34px); }
.dev-duo.posture-book .card-sheet { left: calc(var(--fr) + 20px); right: 20px; width: auto; margin-left: 0; top: 24px; bottom: 24px; overflow-y: auto; scrollbar-width: none; }
.dev-duo.posture-book .dsheet { left: calc(var(--fr) + 20px); right: 20px; width: auto; bottom: 24px; }
.dev-duo.posture-book .sheet { left: calc(var(--fr) + 12px); width: 380px; margin-left: 0; }
.dev-duo.posture-book .alert-wrap { left: var(--fr); right: var(--rail); }

/* ===== 立起：横向栏，折痕横在 y=467；上半区是内容，下半区是控件 ===== */
.dev-duo.posture-stand .home-ind { width: 170px; margin-left: -85px; }
.dev-duo.posture-stand #tabbar { bottom: 22px; }
.dev-duo.posture-stand .scroll:has(> .pa) { overflow: hidden; padding: 0; }
.dev-duo.posture-stand .pa, .dev-duo.posture-stand .pb { display: block; position: absolute; left: 0; right: 0; overflow-y: auto; overflow-x: hidden; scrollbar-width: none; overscroll-behavior: contain; }
.dev-duo.posture-stand .pa::-webkit-scrollbar, .dev-duo.posture-stand .pb::-webkit-scrollbar { display: none; }
.dev-duo.posture-stand .pa { top: 0; height: var(--half); padding: 58px 28px 14px; }
.dev-duo.posture-stand .pb { top: var(--b); bottom: 0; padding: 12px 28px 110px; }
.dev-duo.posture-stand .sec { padding: 12px 0 0; }
.dev-duo.posture-stand .v-tab .pa { display: flex; flex-direction: column; justify-content: safe center; }
.dev-duo.posture-stand .pile-wrap { display: grid; grid-template-columns: 320px minmax(0, 1fr); column-gap: 22px; align-items: center; padding: 6px 0 0; }
.dev-duo.posture-stand .pile { grid-column: 1; grid-row: 1; }
.dev-duo.posture-stand .pile-wrap .dots { grid-column: 1; grid-row: 2; }
.dev-duo.posture-stand .pcap { grid-column: 2; grid-row: 1 / span 2; text-align: left; padding: 0; }
.dev-duo.posture-stand .pc-act { align-items: flex-start; }
.dev-duo.posture-stand .card-wrap { display: grid; grid-template-columns: 320px minmax(0, 1fr); column-gap: 22px; justify-items: start; padding: 10px 0 0; }
.dev-duo.posture-stand .card-wrap .acard { grid-row: 1 / span 2; }
.dev-duo.posture-stand .card-wrap .foot-note { text-align: left; padding: 0; }
.dev-duo.posture-stand .read-scroll .pa { padding: 108px calc(50% - 290px) 22px; }
.dev-duo.posture-stand .read-scroll .pb { padding: 4px calc(50% - 290px) 40px; }
.dev-duo.posture-stand .center-col .pa { display: grid; grid-template-columns: 1fr 290px; column-gap: 24px; align-content: center; align-items: center; text-align: left; padding: 58px 32px 10px; }
.dev-duo.posture-stand .center-col .pa > :not(.stage-center) { grid-column: 1; }
.dev-duo.posture-stand .center-col .stage-center { grid-column: 2; grid-row: 1 / span 2; }
.dev-duo.posture-stand .center-col .pb { display: flex; flex-direction: column; gap: 12px; padding: 22px calc(50% - 250px) 40px; }
.dev-duo.posture-stand .env3d.big { width: 290px; }
/* 写信：上半区是信纸；下半区左边换笔、右边信纸和火漆，中间是修改痕迹 */
.dev-duo.posture-stand .paper-stage { left: 50%; right: auto; width: 580px; margin-left: -290px; top: 108px; bottom: calc(100% - var(--half) + 12px); }
.dev-duo.posture-stand .v-write:not(.tw) .dock { left: 0; right: 0; top: var(--b); bottom: 0; height: auto; padding: 0; border-radius: 0; background: none; box-shadow: none; border: 0; -webkit-backdrop-filter: none; backdrop-filter: none; pointer-events: none; }
.dev-duo.posture-stand .v-write:not(.tw) .dk-sep { display: none; }
.dev-duo.posture-stand .v-write:not(.tw) .dk-tools, .dev-duo.posture-stand .v-write:not(.tw) .dk-opts { position: absolute; top: 50%; translate: 0 -56%; pointer-events: auto; padding: 6px; border-radius: 28px;
  background: rgba(28, 18, 11, .5); -webkit-backdrop-filter: blur(24px) saturate(150%); backdrop-filter: blur(24px) saturate(150%); box-shadow: inset 0 0 0 .5px var(--hair), 0 14px 30px rgba(0, 0, 0, .3); }
.dev-duo.posture-stand .v-write:not(.tw) .dk-tools { left: 22px; flex: none; display: grid; grid-template-columns: 64px 64px; }
.dev-duo.posture-stand .v-write:not(.tw) .dk-opts { right: 22px; flex-direction: column; }
.dev-duo.posture-stand .w-side { display: block; position: absolute; left: 182px; right: 112px; top: calc(var(--b) + 16px); bottom: 34px; border-radius: 24px; padding: 2px 16px 14px; overflow-y: auto; scrollbar-width: none; }
.dev-duo.posture-stand .v-write.tw .w-side { display: none; }
/* 打字机：压纸滚筒压在折痕上，下半区是整块键盘（宣传片里那个姿势），工具条在最下面 */
.dev-duo.posture-stand .v-write.tw .paper-stage { width: 520px; margin-left: -260px; bottom: calc(100% - var(--half) + 9px); }
.dev-duo.posture-stand .tw-machine { left: 50%; right: auto; width: 600px; margin-left: -300px; top: calc(var(--half) - 22px); bottom: 136px; height: auto; }
.dev-duo.posture-stand .v-write.tw .dock { left: 50%; right: auto; width: 560px; margin-left: -280px; bottom: 24px; }
.dev-duo.posture-stand .tw-body { top: 46px; display: flex; flex-direction: column; justify-content: center; padding: 18px 10px 30px; border-radius: 22px 22px 30px 30px; }
.dev-duo.posture-stand .tw-body::before { top: 12px; }
.dev-duo.posture-stand .tw-keys { gap: 12px; }
.dev-duo.posture-stand .tw-row { gap: 8px; }
.dev-duo.posture-stand .tw-row:nth-child(2) { margin-left: 20px; }
.dev-duo.posture-stand .k { height: 42px; font-size: 15px; }
.dev-duo.posture-stand .k-l { width: 44px; border-radius: 50%; }
.dev-duo.posture-stand .k-shift, .dev-duo.posture-stand .k-bksp, .dev-duo.posture-stand .k-ime { width: 64px; border-radius: 21px; }
.dev-duo.posture-stand .k-enter { width: 76px; border-radius: 21px; }
.dev-duo.posture-stand .k-ime { font-size: 12px; }
.dev-duo.posture-stand .k-space { width: 236px; height: 24px; border-radius: 12px; }
.dev-duo.posture-stand .tw-badge { bottom: 11px; font-size: 9px; }
.dev-duo.posture-stand .tw-lever { left: -6px; }
/* 拆信、装信封、追踪：上半区放主体，下半区放操作 */
.dev-duo.posture-stand .cer-stage, .dev-duo.posture-stand .away-stage { top: 100px; height: calc(var(--half) - 110px); }
.dev-duo.posture-stand .cer-hint { bottom: auto; top: calc(var(--b) + 110px); }
.dev-duo.posture-stand .cer-meta { bottom: auto; top: calc(var(--b) + 170px); }
.dev-duo.posture-stand .card-sheet { top: var(--b); left: 16px; right: 16px; border-radius: 26px 26px 0 0; padding-top: 18px; overflow-y: auto; scrollbar-width: none; }
.dev-duo.posture-stand .env-stage { top: 100px; height: calc(var(--half) - 110px); }
.dev-duo.posture-stand .env-stage .env3d.big { width: 330px; }
.dev-duo.posture-stand .env-sheet { top: var(--b); left: 16px; right: 16px; border-radius: 26px 26px 0 0; }
.dev-duo.posture-stand .dsheet { top: var(--b); left: 16px; right: 16px; height: auto; transform: none !important; border-radius: 26px 26px 0 0; }
.dev-duo.posture-stand .dsheet .grabber { visibility: hidden; height: 6px; }
.dev-duo.posture-stand .sheet { left: 12px; right: 12px; max-height: calc(100% - var(--b) - 10px); }
.dev-duo.posture-stand .sheet.tall { height: calc(100% - var(--b) - 10px); }
.dev-duo.posture-stand .alert-wrap { top: var(--b); }

/* ---------- iPad（横屏）与 Mac 网页 ---------- */
.device.dev-ipad { width: 1220px; height: 860px; }
.dev-ipad .bezel { border-radius: 46px; padding: 20px; }
.dev-ipad .screen { width: 1180px; height: 820px; border-radius: 26px; }
.dev-ipad .statusbar { height: 30px; padding: 9px 26px 0 30px; font-size: 13.5px; }
.dev-ipad .home-ind { width: 300px; margin-left: -150px; bottom: 7px; }
.device.dev-mac { width: 1280px; height: 838px; }
.dev-mac .bezel { border-radius: 12px; padding: 38px 0 0; background: linear-gradient(180deg, #34302c, #2a2623 38px); box-shadow: 0 0 0 1px #4a443d, inset 0 1px 0 rgba(255, 255, 255, .1), 0 50px 90px rgba(0, 0, 0, .65); }
.dev-mac .screen { width: 1280px; height: 800px; border-radius: 0 0 12px 12px; }
.dev-mac .statusbar, .dev-mac .home-ind { display: none; }
.dev-mac .winbar { display: flex; position: absolute; top: 0; left: 0; right: 0; height: 38px; align-items: center; gap: 14px; padding: 0 14px; }
.winbar .lights { display: flex; gap: 8px; width: 52px; }
.winbar .lights i { width: 12px; height: 12px; border-radius: 50%; background: #ff5f57; box-shadow: inset 0 0 0 .5px rgba(0, 0, 0, .25); }
.winbar .lights i:nth-child(2) { background: #febc2e; }
.winbar .lights i:nth-child(3) { background: #28c840; }
.winbar .url { flex: 0 1 440px; margin: 0 auto; height: 26px; border-radius: 7px; display: flex; align-items: center; justify-content: center; gap: 6px; background: rgba(255, 255, 255, .07); color: #a99f91; font: 500 12.5px var(--ui); }
.winbar .url b { font-weight: 500; color: #ddd3c3; }
.wb-sp { width: 52px; }
/* 通知：右上角横幅 */
.wide .island { left: auto; right: 18px; top: 16px; transform: none; width: 340px; height: 74px; border-radius: 20px; opacity: 0; translate: 0 -14px; pointer-events: none;
  background: rgba(30, 21, 14, .9); -webkit-backdrop-filter: blur(24px); backdrop-filter: blur(24px); box-shadow: 0 18px 40px rgba(0, 0, 0, .45), inset 0 0 0 .5px var(--hair); transition: opacity .3s, translate .55s var(--spring); }
.dev-ipad .island { top: 38px; }
.wide .island.open { opacity: 1; translate: 0 0; width: 340px; height: 74px; }
/* 侧边栏代替底部标签栏 */
.wide #tabbar { right: auto; top: 0; bottom: 0; width: 240px; flex-direction: column; align-items: stretch; justify-content: flex-start; gap: 18px; padding: 54px 16px 22px;
  background: rgba(28, 17, 10, .4); -webkit-backdrop-filter: blur(26px) saturate(150%); backdrop-filter: blur(26px) saturate(150%); border-right: .5px solid var(--hair); }
.dev-mac #tabbar { padding-top: 26px; }
.wide .no-tabs #tabbar { transform: translateX(-102%); opacity: 0; }
.wide .tb-brand { display: flex; align-items: center; gap: 10px; padding: 0 6px 4px; order: 0; }
.tb-brand b { font: 700 21px var(--serif); letter-spacing: .04em; }
.tb-brand small { margin-left: auto; font: 700 9.5px var(--mono); letter-spacing: .22em; color: var(--c3); text-transform: uppercase; }
.wide .tb-write { order: 1; width: auto; height: 46px; border-radius: 14px; display: flex; gap: 10px; justify-content: center; font: 600 15px var(--ui); text-decoration: none; }
.wide .tbw-l { display: inline; }
.wide .tb-cap { order: 2; flex-direction: column; height: auto; padding: 0; border-radius: 0; background: none; border: 0; box-shadow: none; -webkit-backdrop-filter: none; backdrop-filter: none; }
.wide .tb { width: auto; height: 44px; flex-direction: row; justify-content: flex-start; gap: 12px; padding: 0 12px; font: 600 15px var(--ui); }
.wide .tb .ic { width: 20px; height: 20px; }
.wide .tb-pill { left: 0; right: 0; top: 0; bottom: auto; width: auto; height: 44px; border-radius: 12px; transform: translateY(calc(var(--i, 0) * 44px)); }
.wide .badge { top: 50%; right: 12px; margin-top: -8.5px; }
.wide .tb-foot { display: block; order: 3; margin-top: auto; padding: 0 8px; font-size: 12px; color: var(--c3); }
.wide .screen:not(.no-tabs) .view { left: 240px; }
/* 列表页：左右两栏 */
.wide .scroll { padding: 64px 0 60px; }
.dev-mac .scroll { padding-top: 34px; }
.wide .scroll:has(> .pa) { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(320px, 1fr); column-gap: 32px; align-items: start; padding-left: 28px; padding-right: 36px; }
.wide .pa, .wide .pb { display: block; min-width: 0; }
.wide .pa { position: sticky; top: 0; }
.wide .pb { padding-top: 74px; }
.wide .sec { padding-left: 0; padding-right: 0; }
.wide .lt { padding-left: 4px; }
.wide .lt h1 { font-size: 40px; }
.wide .pile { height: 340px; }
.wide .pcard { width: 430px; margin-left: -215px; top: 28px; }
.wide .pcap { padding-top: 20px; }
.wide .acard { max-width: 430px; }
.wide .read-scroll { grid-template-columns: minmax(0, 640px) 340px; justify-content: center; column-gap: 40px; padding: 100px 40px 130px; }
.wide .read-scroll .pa { position: static; }
.wide .read-scroll .pb { position: sticky; top: 0; padding-top: 0; }
.wide .center-col:has(> .pa) { grid-template-columns: minmax(0, 1fr) 400px; align-items: center; column-gap: 48px; padding: 60px 64px; text-align: center; }
.wide .center-col .pa { position: static; display: flex; flex-direction: column; align-items: center; gap: 12px; }
.wide .center-col .pb { display: flex; flex-direction: column; gap: 12px; padding-top: 0; }
.wide .env3d.big { width: 460px; }
/* 写信：信纸居中，右侧是实时修改痕迹 */
.wide .navbar { padding: 0 28px; }
.wide .paper-stage { left: 50%; right: auto; width: 580px; margin-left: -340px; top: 104px; bottom: 140px; }
.wide .dock { left: 50%; right: auto; width: 540px; margin-left: -320px; }
.wide .w-side { display: block; position: absolute; right: 28px; top: 104px; width: 240px; max-height: calc(100% - 250px); border-radius: 22px; padding: 4px 14px 14px; overflow-y: auto; scrollbar-width: none; }
.wide .v-write.tw .paper-stage { left: 50%; right: auto; width: 440px; margin-left: -270px; bottom: 405px; }
.wide .tw-machine { left: 50%; right: auto; width: 393px; margin-left: -246.5px; bottom: 215px; transform-origin: 50% 0; }
.wide .v-write.tw .tw-machine { transform: scale(1.4); }
/* 装信封：左边信封，右边填写 */
.wide .env-stage { top: 96px; bottom: 40px; height: auto; right: 50%; }
.wide .env-stage .env3d.big { width: 440px; }
.wide .env-sheet { left: calc(50% + 10px); right: 32px; top: 96px; bottom: 28px; border-radius: 28px; }
.wide .seal-row { padding-bottom: 22px; }
/* 拆信、改寄 */
.wide .cer-stage { height: calc(100% - 112px - 190px); }
.wide .away-stage { height: calc(100% - 112px - 350px); }
.wide .card-sheet { left: 50%; right: auto; width: 540px; margin-left: -270px; bottom: 28px; border-radius: 28px; }
/* 追踪：地图铺满，信息是左侧浮动卡片 */
.wide .dsheet { left: 24px; right: auto; width: 380px; top: 108px; bottom: 24px; height: auto; border-radius: 28px; transform: none !important; }
.wide .dsheet .grabber { visibility: hidden; }
.wide .map-top { right: auto; width: 380px; left: 24px; }
.wide .map-top .nb-sp { display: none; }
.wide .map-top .map-chip { margin-left: 12px; }
/* 弹层：居中的卡片 */
.wide .sheet { left: 50%; right: auto; bottom: auto; top: 50%; width: 460px; margin-left: -230px; max-height: 80%; opacity: 0; transform: translateY(-46%) scale(.96); transition: transform .5s var(--spring), opacity .25s; }
.wide .sheet-wrap.in .sheet { opacity: 1; transform: translateY(-50%); }
.wide .sheet-wrap.out .sheet { opacity: 0; transform: translateY(-46%) scale(.96); transition: transform .3s var(--ease), opacity .2s; }
.wide .sheet.tall { height: 76%; }
.wide .sheet .grabber { visibility: hidden; height: 0; margin: 10px 0 0; }
/* ---------- Mac 网页：收紧留白 ----------
   参考「复古打字机工作台」的版式：信纸 / 打字机做主角，占满左边的大块；
   换笔、信纸、火漆和修改痕迹收成右侧一整列「写信台」；顶部不再给状态栏留空 */
.dev-mac .navbar { top: 14px; }
.dev-mac .island { top: 14px; right: 136px; }
/* 写信：左边主舞台（0–884，中心 442），右边写信台（宽 340） */
.dev-mac .paper-stage { left: 142px; right: auto; width: 600px; margin-left: 0; top: 76px; bottom: 28px; }
.dev-mac .dock { left: auto; right: 28px; top: 76px; bottom: auto; width: 340px; height: auto; margin-left: 0; flex-wrap: wrap; align-items: stretch; padding: 10px 12px 12px; border-radius: 24px; }
.dev-mac .dock::before { content: 'WRITING DESK'; flex-basis: 100%; padding: 4px 6px 6px; font: 700 10px var(--mono); letter-spacing: .26em; color: var(--brass); opacity: .8; }
.dev-mac .dk-tools { flex: 1 1 100%; display: grid; grid-template-columns: repeat(4, 1fr); }
.dev-mac .dk-tool { width: auto; height: 76px; border-radius: 16px; }
.dev-mac .dk-tool.on { background: rgba(255, 238, 214, .08); box-shadow: inset 0 0 0 .5px var(--hair); }
.dev-mac .dk-sep { flex-basis: 100%; width: auto; height: .5px; margin: 8px 4px; }
.dev-mac .dk-opts { flex: 1 1 100%; display: grid; grid-template-columns: 1fr 1fr; gap: 8px; padding: 0; }
.dev-mac .dk-opt { width: auto; height: 54px; flex-direction: row; justify-content: flex-start; align-items: center; gap: 12px; padding: 0 14px; border-radius: 14px; background: rgba(255, 238, 214, .06); box-shadow: inset 0 0 0 .5px var(--hair); font-size: 12.5px; }
.dev-mac .w-side { right: 28px; top: 292px; bottom: 28px; width: 340px; max-height: none; }
/* 打字机：机身放大到 1.5 倍压在底部，信纸从压纸滚筒里升起来 */
.dev-mac .v-write.tw .paper-stage { left: 202px; width: 480px; margin-left: 0; top: 76px; bottom: 320px; }
.dev-mac .tw-machine { left: 245.5px; margin-left: 0; top: 433px; bottom: auto; height: 226px; }
.dev-mac .v-write.tw .tw-machine { transform: scale(1.5); }
/* 书桌：信堆和列表都放大一点，两栏贴紧 */
.dev-mac .scroll:has(> .pa) { grid-template-columns: minmax(0, 1fr) 420px; column-gap: 36px; padding-left: 40px; padding-right: 40px; }
.dev-mac .pile { height: 360px; }
.dev-mac .pcard { width: 470px; margin-left: -235px; }
.dev-mac .pb { padding-top: 64px; }
/* 读信：信纸更宽，信短的时候整体上下居中 */
.dev-mac .read-scroll { grid-template-columns: minmax(0, 700px) 380px; align-content: safe center; padding-top: 70px; padding-bottom: 90px; }
.ws-note { display: flex; align-items: center; gap: 6px; margin-top: 10px; font-size: 12px; color: var(--c3); }

/* ===================== phone-sized browsers ===================== */
@media (max-width: 640px) {
  #demo { width: 86vw; transform: translateX(-100%); transition: transform .4s var(--ease); z-index: 100; box-shadow: 20px 0 60px rgba(0, 0, 0, .5); }
  body.demo-open #demo { transform: none; }
  #stage { left: 0; }
  .device { left: 0; top: 0; width: 100vw; height: 100dvh; transform: none; }
  .bezel { border-radius: 0; padding: 0; background: none; box-shadow: none; }
  .screen { width: 100vw; height: 100dvh; border-radius: 0; }
  .statusbar, .home-ind { display: none; }
  .island:not(.open) { opacity: 0; }
  .demo-fab { display: block; position: fixed; top: 12px; right: 12px; z-index: 90; padding: 6px 10px; border: 0; border-radius: 8px; background: var(--brass); color: #1a140c; font: 700 11px var(--mono); letter-spacing: .1em; box-shadow: 0 6px 16px rgba(0, 0, 0, .4); }
  .env3d.big { width: min(320px, 84vw); }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; transition-duration: .05s !important; }
}
