/* Hallmark · shape: a two-sided pannable signing wall behind an invitation gate, the hero beside it · genre: atmospheric · theme: custom · job: join · idea: "一面可以翻面的签名墙：开场要用手指刮开才能进来签名，正面是朋友们的名字和表情，背面只有主人放的回忆" · vibe: "高级的生日邀请，一面墙两个面"
 * paper: oklch(0.2 0.085 268) · accent: oklch(0.9 0.17 98) · display: Noto Serif SC · body: Manrope · hero: 三行衬线大标题、一句话和两个动作压在深蓝地面的左下，签名墙这块大面板从右边挤进来，墙面小方块一排六个 · nav: 左边词标，右边风格、看背面、放映三个胶囊 · footer: 没有页脚，左下角一个“我是主人”的小链接 · imagery: 没有照片，墙和上面的签名本身就是产品；背面的照片只能管理员放 · signature: 开场把整页盖住，朋友用手指刮开才看到墙，刮的那一下就是第一笔签名的练习
 * axes: dark/high-contrast-serif/chromatic-yellow · posture: drenched · contrast: pass · fold: pass · v2.0.0 */
/* Hallmark · pre-emit critique: P4 H4 E4 S4 R4 V5 · weakest: E, 六种皮肤里每一种都要单独过对比度和笔迹质感；用同一套令牌和一个 data-skin 属性，换皮只动颜色和字体，不动结构 */
/* Hallmark · finish-review: subagent · 8 findings · 8 resolved (the back face has its own material per skin, picked stickers land on the pad at once, the owner entry left the phone's first screen, the wordmark shortens on phones, the flip control hides while the back is empty, photo cards are bigger, the cover is rebuilt with confetti, the occasion line and a finger cue and no stolen focus, the passphrase generator hides once a hash is set) · gap: four more defects found while retesting and fixed (the skip button sat under the canvas, the back note sat under the count chip, the owner link overlapped the chip, the phone's back pose cut the letter off) */
/* Hallmark · waive 12 ·--ease-spring appears only on the land keyframes of a signature · a signature settling onto the wall is the one character moment of this page */
/* Hallmark · waive 37 · each of the six wall skins carries its own display face and only one skin is on screen at a time · the wall switches between six materials, so Noto Serif SC, Ma Shan Zheng and ZCOOL KuaiLe each serve one skin */
/* Hallmark · waive 80 · div.world is a labelled diagram of real signatures, each placed where a friend dropped it · every signature on the wall is one friend's real handwriting, so the wall is data and not a drawing */
/* Hallmark · answered F7 · the wordmark, the zoom group and the skip link are controls or control groups, the url chip sits in the same dock as the slideshow buttons */
/* Hallmark · dismissed 41 · --back-ink is the text colour on the back face, which sits on --back and not on --wall-bg, so the linter pairs it with the wrong ground · measured in the browser per skin, back text on the back is 11.3 klein, 4.8 chalk, 9.6 xuan, 10.9 party, 12.7 gallery, 11.8 gilt, photo captions on the card at 14 or more */
/* Hallmark · dismissed 77 ·the page is one fixed stage and the wall is the whole product, every other panel is a dialog, so there is no scroll below the hero to fill */
@import url("./tokens.css");
@import url("./base.css");

/* ---------- 整页：一块不滚动的舞台 ---------- */
html, body { height: 100%; }
body { overflow-y: clip; overscroll-behavior: none; font-weight: 500; -webkit-tap-highlight-color: transparent; background: var(--color-paper); }
.skip { position: fixed; left: var(--space-md); top: var(--space-md); z-index: var(--z-tooltip); padding: var(--space-xs) var(--space-md); background: var(--color-ink); color: var(--color-paper); border-radius: var(--radius-pill); transform: translateY(-200%); }
.skip:focus-visible { transform: none; outline: 3px solid var(--color-focus); outline-offset: 3px; }

/* ---------- 按钮 ---------- */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: var(--space-xs); min-height: 52px; padding: 0 var(--space-lg); border: 2px solid var(--color-ink); border-radius: var(--ui-radius, 999px); background: transparent; color: var(--color-ink); font-weight: 700; font-size: var(--text-md); line-height: 1; white-space: nowrap; cursor: pointer; transition: transform var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.btn:hover { background: var(--color-ink); color: var(--color-paper); transform: translateY(-1px); }
.btn:active { transform: translateY(1px); }
.btn:disabled, .btn[aria-disabled="true"] { opacity: 0.55; cursor: not-allowed; transform: none; }
.btn--primary { background: var(--color-accent); border-color: var(--color-accent); color: var(--color-accent-ink); }
.btn--primary:hover { background: var(--color-ink); border-color: var(--color-ink); color: var(--color-paper); }
.ico { width: 22px; height: 22px; flex-shrink: 0; }

.barbtn, .wordmark { flex-shrink: 0; white-space: nowrap; display: inline-flex; align-items: center; gap: var(--space-xs); min-height: 44px; padding: 0 var(--space-md); border: 0; border-radius: var(--ui-radius, 999px); background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-edge); color: var(--color-ink); font-weight: 700; font-size: var(--text-sm); text-decoration: none; cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.barbtn .ico { width: 18px; height: 18px; }
.barbtn:hover, .wordmark:hover { background: var(--color-ink); color: var(--color-paper); }
.barbtn[aria-expanded="true"], .barbtn[aria-pressed="true"] { background: var(--color-accent); color: var(--color-accent-ink); }
.barbtn:active, .wordmark:active { transform: translateY(1px); }
.barbtn--sheet { background: var(--sheet); color: var(--sheet-ink); --color-focus: var(--color-paper); }
.barbtn--sheet:hover { background: var(--sheet-ink); color: var(--sheet); }
.wordmark { font-family: var(--font-display); font-weight: 700; font-size: var(--text-lg); background: none; box-shadow: none; padding-inline: var(--space-md); }
.wordmark:hover { background: none; color: var(--color-ink); text-decoration: underline; text-decoration-thickness: 2px; text-underline-offset: 0.25em; }

.roundbtn { display: inline-grid; place-items: center; width: 48px; height: 48px; padding: 0; border: 0; border-radius: var(--ui-round, 50%); background: transparent; color: var(--color-ink); cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.roundbtn:hover { background: var(--color-ink); color: var(--color-paper); }
.roundbtn:active { transform: translateY(1px); }
.roundbtn[aria-pressed="true"] { background: var(--color-ink); color: var(--color-paper); }
.roundbtn--sheet { border: 0; background: var(--sheet-2); color: var(--sheet-ink); --color-focus: var(--sheet-ink); }
.roundbtn--sheet:hover { background: var(--sheet-ink); color: var(--sheet); }
.roundbtn:focus-visible, .barbtn:focus-visible, .wordmark:focus-visible { outline: 3px solid var(--color-ink); outline-offset: 3px; box-shadow: 0 0 0 3px var(--color-paper-3); }

.linkbtn { border: 0; background: none; padding: var(--space-xs) var(--space-sm); min-height: 44px; color: inherit; font-weight: 700; text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.linkbtn:hover { text-decoration-thickness: 2px; }

/* ---------- 顶栏 ---------- */
.bar { position: fixed; inset: 0 0 auto 0; z-index: var(--z-sticky-nav); display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); height: var(--bar-h); padding: 0 max(var(--space-2xs), calc(var(--edge) - var(--space-md))); pointer-events: none; }
.bar > * { pointer-events: auto; }
.bar__nav { display: flex; gap: var(--space-xs); }

/* ---------- 首屏：黄底上的标题，墙从右边和下边挤进来 ---------- */
.hero { position: fixed; z-index: var(--z-raised); inset: var(--bar-h) auto 0 var(--edge); width: min(46vw, 44rem, calc(var(--container) * 0.44)); display: flex; flex-direction: column; justify-content: flex-end; gap: var(--space-lg); padding-bottom: max(var(--space-xl), 13dvh); transition: opacity var(--dur-long) var(--ease-out), transform var(--dur-long) var(--ease-out), visibility 0s linear 0s; }
.hero__title { font-size: var(--text-display); line-height: 1.12; letter-spacing: var(--tracking-display); font-weight: 700; color: var(--color-ink); max-width: none; }
.hero__lead { font-size: var(--text-lead); line-height: 1.5; max-width: 26em; color: var(--color-ink-2); font-weight: 700; }
.hero__actions { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.noscript { color: var(--color-error); font-weight: 700; }
.is-wall .hero { opacity: 0; transform: translateX(-32px); visibility: hidden; pointer-events: none; transition: opacity var(--dur-long) var(--ease-out), transform var(--dur-long) var(--ease-out), visibility 0s linear var(--dur-long); }
.js .hero__title, .js .hero__lead, .js .hero__actions { animation: rise 640ms var(--ease-out) both; animation-delay: calc(var(--n, 0) * 90ms + 160ms); }
.js .hero__title { --n: 0; } .js .hero__lead { --n: 1; } .js .hero__actions { --n: 2; }
@keyframes rise { from { opacity: 0; transform: translateY(14px); } to { opacity: 1; transform: none; } }

/* ---------- 舞台、世界和墙 ---------- */
.stage { position: fixed; inset: 0; overflow: clip; touch-action: none; cursor: grab; background: var(--color-paper); -webkit-user-select: none; user-select: none; }
.stage.is-drag { cursor: grabbing; }
.world { position: absolute; left: 0; top: 0; width: var(--ww, 3200px); height: var(--wh, 2000px); transform-origin: 0 0; }
.fx { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: var(--z-dropdown); }
.board { position: absolute; inset: 0; border-radius: var(--radius-board); background: var(--wall-bg, var(--wall)); border: var(--frame-w, 0px) solid var(--wall-edge); box-shadow: var(--board-shadow); overflow: hidden; color: var(--on-wall); }
.board__title { position: absolute; left: 150px; top: 100px; width: 1900px; height: 940px; overflow: visible; pointer-events: none; -webkit-user-select: none; user-select: none; }
.board__title text { font-family: var(--font-display); font-size: 400px; font-weight: 700; fill: var(--wall-2); letter-spacing: var(--tracking-display); }
.sigs { position: absolute; inset: 0; }
.board__scrim { position: absolute; inset: 0; background: var(--wall); opacity: 0; pointer-events: none; z-index: 900; transition: opacity var(--dur-long) var(--ease-out); }
.board.is-focus .board__scrim { opacity: 0.84; }
.is-sealed .sig { opacity: 0.3; pointer-events: none; }

/* ---------- 一条签名、一张相纸 ---------- */
.k1 { fill: var(--pen-1); stroke: var(--pen-1); } .k2 { fill: var(--pen-2); stroke: var(--pen-2); } .k3 { fill: var(--pen-3); stroke: var(--pen-3); }
.k4 { fill: var(--pen-4); stroke: var(--pen-4); } .k5 { fill: var(--pen-5); stroke: var(--pen-5); } .k6 { fill: var(--pen-6); stroke: var(--pen-6); }
.ink { stroke-width: var(--ink-weight, 2px); stroke-linejoin: round; }
.ink-reveal { fill: none; stroke: var(--pen-2); stroke-linecap: round; stroke-linejoin: round; }
.sig { position: absolute; left: 0; top: 0; width: var(--w); height: var(--h); margin: 0; padding: 0; border: 0; background: none; color: inherit; cursor: pointer; translate: calc(var(--x) - var(--w) / 2) calc(var(--y) - var(--h) / 2); rotate: var(--r, 0deg); z-index: var(--z, 1); -webkit-tap-highlight-color: transparent; }
.sig:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 10px; border-radius: 14px; }
.sig__in { display: block; position: relative; width: 100%; height: 100%; transition: transform var(--dur-short) var(--ease-out), filter var(--dur-short) var(--ease-out); }
@media (hover: hover) { .sig:hover .sig__in { transform: scale(1.04); } }
.sig:active .sig__in { transform: scale(0.98); }
.sig__ink { width: 100%; height: 100%; overflow: visible; filter: var(--sig-filter); pointer-events: none; }
.sig__name { position: absolute; inset: 0; display: grid; place-items: center; font-family: var(--font-display); font-size: calc(var(--h) * 0.6); line-height: 1; color: var(--pen-1); pointer-events: none; }
.sig--photo .sig__in { padding: var(--pad) var(--pad) 0; background: var(--card); box-shadow: 0 14px 34px var(--shadow-soft); border-radius: 3px; }
.sig__img { display: block; width: 100%; height: calc(var(--h) - var(--pad) - var(--cap)); object-fit: cover; }
.sig__cap { position: absolute; left: var(--pad); right: var(--pad); bottom: 0; height: var(--cap); display: grid; place-items: center; font-family: var(--font-display); font-size: calc(var(--cap) * 0.44); color: var(--card-ink); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.board.is-lite .sig__ink { filter: none; }
.sig.is-pre { opacity: 0; }
.sig.is-in .sig__in { animation: sig-in 760ms var(--ease-out) var(--id, 0ms) both; }
.sig.is-land .sig__in { animation: land 900ms var(--ease-spring) both; }
.sig.is-land::after { content: ""; position: absolute; inset: -16px; border-radius: 18px; border: 2px solid var(--color-focus); pointer-events: none; animation: ring 1000ms var(--ease-out) both; }
.sig.is-placing { cursor: grab; touch-action: none; outline: 2px dashed var(--on-wall); outline-offset: 16px; border-radius: 14px; }
.sig.is-placing.is-drag { cursor: grabbing; }
.sig.is-placing .sig__in { filter: drop-shadow(0 22px 26px var(--shadow-soft)); scale: 1.04; }
.sig.is-on { z-index: 1000; }
@keyframes sig-in { from { opacity: 0; translate: 0 12px; scale: 0.96; } to { opacity: 1; translate: 0 0; scale: 1; } }
@keyframes land { 0% { scale: 1.28; opacity: 0.1; } 60% { scale: 0.97; opacity: 1; } 100% { scale: 1; opacity: 1; } }
@keyframes ring { from { scale: 0.86; opacity: 0.9; } to { scale: 1.22; opacity: 0; } }


/* ---------- 底部操作区 ---------- */
.hud { display: none; position: fixed; inset: auto 0 0 0; z-index: var(--z-sticky); display: none; grid-template-columns: 1fr auto 1fr; align-items: end; gap: var(--space-md); padding: 0 var(--edge) calc(var(--space-xl) + env(safe-area-inset-bottom, 0px)); pointer-events: none; transform: translateY(16px); transition: opacity var(--dur-long) var(--ease-out), transform var(--dur-long) var(--ease-out), visibility 0s linear var(--dur-long); }
.hud > * { pointer-events: auto; }
.js .hud { display: grid; opacity: 0; visibility: hidden; }
.js.is-wall .hud, .is-wall .hud { opacity: 1; visibility: visible; transform: none; transition: opacity var(--dur-long) var(--ease-out), transform var(--dur-long) var(--ease-out), visibility 0s; }
.hud__count { white-space: pre-line; justify-self: start; padding: var(--space-xs) var(--space-md); border-radius: var(--ui-radius-lg, 18px); background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-edge); font-weight: 700; font-size: var(--text-sm); line-height: 1.4; }
.fab { min-height: 56px; padding-inline: var(--space-xl); font-size: var(--text-lg); box-shadow: var(--shadow-card); }
.zoom { justify-self: end; display: flex; gap: var(--space-2xs); padding: var(--space-2xs); border-radius: var(--ui-radius, 999px); background: var(--glass); box-shadow: inset 0 0 0 1px var(--glass-edge); }
.is-peek .hud, .is-show .hud { opacity: 0; visibility: hidden; }
.corner p { padding: var(--space-2xs) var(--space-sm); border-radius: 14px; background: var(--glass); width: fit-content; }
.corner { position: fixed; left: var(--edge); bottom: calc(var(--space-sm) + env(safe-area-inset-bottom, 0px)); z-index: var(--z-raised); max-width: min(60ch, calc(100% - 2 * var(--gutter))); font-size: var(--text-xs); line-height: 1.4; color: var(--color-ink-2); pointer-events: none; }
.corner a { pointer-events: auto; }
.corner p { max-width: none; }
.is-wall .corner { display: none; }

/* ---------- 点开一只气球：下方的留言卡 ---------- */
.peek { position: fixed; z-index: var(--z-modal); left: 50%; bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 0px)); width: min(40rem, calc(100% - 2 * var(--space-md))); display: grid; grid-template-columns: minmax(0, 1fr) auto; align-items: end; gap: var(--space-md); padding: var(--space-lg); border-radius: var(--ui-radius-lg, 28px); background: var(--sheet); color: var(--sheet-ink); --color-focus: var(--sheet-ink); transform: translate(-50%, 0); animation: peek-in var(--dur-long) var(--ease-out) both; }
.peek__name { font-size: var(--text-display-s); line-height: 1.12; font-weight: 700; color: var(--sheet-ink); max-width: none; }
.peek__text { margin-top: var(--space-xs); font-size: var(--text-lead); line-height: 1.5; max-width: none; overflow-wrap: anywhere; }
.peek__text:empty { display: none; }
.peek__meta { margin-top: var(--space-xs); font-size: var(--text-sm); color: var(--sheet-muted); max-width: none; }
.peek__meta a { color: inherit; }
.peek__ctl { display: flex; gap: var(--space-xs); flex-wrap: nowrap; justify-content: flex-end; }
@keyframes rise-in { from { opacity: 0; translate: 0 24px; } to { opacity: 1; translate: 0 0; } }
@keyframes peek-in { from { opacity: 0; transform: translate(-50%, 24px); } to { opacity: 1; transform: translate(-50%, 0); } }
.is-show .peek { width: max-content; min-width: min(26rem, calc(100% - 2 * var(--space-md))); max-width: min(56rem, calc(100% - 2 * var(--space-md))); grid-template-columns: minmax(0, 1fr); bottom: var(--space-2xl); }
.is-show .peek__name { font-size: var(--text-display); }
.is-show .peek__text { font-size: var(--text-2xl); }
.is-show .peek__ctl { display: none; }

.showbar { position: fixed; z-index: var(--z-modal); right: var(--space-lg); bottom: var(--space-lg); display: flex; align-items: center; gap: var(--space-sm); }
.showbar__url { padding: var(--space-xs) var(--space-md); border-radius: var(--radius-pill); background: var(--glass); font-weight: 700; font-size: var(--text-sm); max-width: none; }

.toast { position: fixed; z-index: var(--z-toast); left: 50%; top: calc(var(--bar-h) + var(--space-xs)); transform: translateX(-50%); padding: var(--space-sm) var(--space-lg); border-radius: var(--radius-pill); background: var(--color-ink); color: var(--color-paper); font-weight: 700; font-size: var(--text-sm); max-width: calc(100% - 2 * var(--space-md)); animation: peek-in var(--dur-long) var(--ease-out) both; }

/* ---------- 面板（签名板、留言码、主人面板） ---------- */
.sheet { border: 0; padding: var(--space-lg); background: var(--sheet); color: var(--sheet-ink); border-radius: var(--ui-radius-lg, 28px); width: min(56rem, calc(100% - 2 * var(--space-md))); max-height: calc(100dvh - 2 * var(--space-md)); overflow: auto; overscroll-behavior: contain; --color-focus: var(--sheet-ink); color-scheme: dark; }
.sheet::backdrop { background: color-mix(in oklab, var(--color-ink) 64%, transparent); }
.sheet[open] { animation: sheet-in var(--dur-long) var(--ease-out) both; }
@keyframes sheet-in { from { opacity: 0; transform: translateY(24px) scale(0.98); } to { opacity: 1; transform: none; } }
.sheet h2 { font-size: var(--text-2xl); font-weight: 700; line-height: 1.15; color: var(--sheet-ink); }
.sheet h3 { font-family: var(--font-body); font-size: var(--text-lg); font-weight: 700; line-height: 1.3; color: var(--sheet-ink); }
.sheet p { max-width: 60ch; }
.sheet__bar { display: flex; align-items: center; justify-content: space-between; gap: var(--space-md); margin-bottom: var(--space-md); }
.sheet__sec { display: grid; gap: var(--space-sm); margin-top: var(--space-lg); padding-top: var(--space-lg); border-top: 1px solid var(--sheet-rule); }
.sheet__row { display: flex; flex-wrap: wrap; gap: var(--space-sm); }
.sheet__foot { margin-top: var(--space-md); display: flex; }
.sheet__foot .btn--primary { width: 100%; }
.sheet__foot--row { gap: var(--space-sm); flex-wrap: wrap; }
.sheet__foot--row .btn--primary { width: auto; }
.sheet .btn { border-color: var(--sheet-ink); color: var(--sheet-ink); }
.sheet .btn:hover { background: var(--sheet-ink); color: var(--sheet); }
.sheet .btn--primary { background: var(--sheet-ink); border-color: var(--sheet-ink); color: var(--sheet); }
.sheet .btn--primary:hover { background: var(--sheet-muted); border-color: var(--sheet-muted); color: var(--sheet); }
.sheet .btn:disabled { opacity: 0.55; cursor: not-allowed; }
.sheet .btn[aria-busy="true"] { cursor: progress; opacity: 0.8; }
.help { font-size: var(--text-sm); color: var(--sheet-muted); min-height: 1lh; max-width: 60ch; }
.help[data-kind="error"] { color: var(--sheet-ink); font-weight: 700; }
.field { display: grid; gap: var(--space-2xs); }
.field label, .check { font-size: var(--text-sm); font-weight: 700; }
.field-row { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-sm); }
.input { width: 100%; min-height: 48px; padding: var(--space-sm) var(--space-md); border: 2px solid var(--sheet-rule); border-radius: 14px; background: var(--sheet-2); color: var(--sheet-ink); font-size: 1rem; line-height: 1.4; resize: vertical; }
.input:hover { border-color: var(--sheet-muted); }
.input:focus-visible { outline: 3px solid var(--sheet-ink); outline-offset: 0; }
.input--code { font-family: ui-monospace, "SF Mono", Menlo, monospace; font-size: var(--text-sm); word-break: break-all; }
.input--file { padding: var(--space-sm); }
.check { display: flex; align-items: center; gap: var(--space-sm); min-height: 44px; }
.check input { width: 22px; height: 22px; accent-color: var(--sheet-ink); }
.addr { padding: var(--space-sm) var(--space-md); border-radius: 14px; background: var(--sheet-2); font-weight: 700; word-break: break-all; }
.sheet[id="owner"] { width: min(44rem, calc(100% - 2 * var(--space-md))); }
.sheet[id="done"] { width: min(34rem, calc(100% - 2 * var(--space-md))); }
.sheet[id="done"][open] { display: grid; gap: var(--space-md); }

/* ---------- 签名板 ---------- */
.studio__cols { display: grid; gap: var(--space-md); grid-template-columns: minmax(0, 1fr); }
.studio__left, .studio__right { display: grid; gap: var(--space-md); align-content: start; min-width: 0; }
.pad { position: relative; width: 100%; aspect-ratio: 800 / 560; border-radius: 24px; overflow: hidden; background: var(--wall); color: var(--on-wall); box-shadow: inset 0 0 0 var(--frame-w, 2px) var(--wall-edge); touch-action: none; cursor: crosshair; -webkit-user-select: none; user-select: none; -webkit-touch-callout: none; transition: background-color var(--dur-long) var(--ease-out); }
.pad__svg { position: absolute; inset: 0; width: 100%; height: 100%; touch-action: none; filter: var(--sig-filter); }
.pad__hint { position: absolute; inset: 0; display: grid; place-items: center; padding: var(--space-md); text-align: center; pointer-events: none; font-family: var(--font-display); font-size: var(--text-display-s); line-height: 1.2; opacity: 0.6; max-width: none; transition: opacity var(--dur-short) var(--ease-out); }
.pad.has-ink .pad__hint { opacity: 0; }
.tools { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm) var(--space-lg); }
.tools fieldset, .studio fieldset { border: 0; margin: 0; padding: 0; min-width: 0; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-2xs); }
.studio legend { float: left; padding: 0 var(--space-sm) 0 0; font-size: var(--text-sm); font-weight: 700; color: var(--sheet-muted); line-height: 44px; }
.swatches--balloon { display: block; }
.swatches--balloon legend { float: none; display: block; line-height: 1.4; margin-bottom: var(--space-xs); }
.swatches--balloon .sw { margin-right: 0; }
.sw { position: relative; display: inline-grid; place-items: center; width: 44px; height: 44px; cursor: pointer; }
.sw input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.sw__dot { width: 30px; height: 30px; border-radius: 50%; background: var(--c); border: 3px solid var(--sheet-rule); transition: transform var(--dur-short) var(--ease-out), border-color var(--dur-short) var(--ease-out); pointer-events: none; }
.sw:hover .sw__dot { transform: scale(1.1); }
.sw:has(input:checked) .sw__dot { border-color: var(--sheet-ink); transform: scale(1.2); }
.sw:has(input:focus-visible) { outline: 3px solid var(--sheet-ink); outline-offset: 0; border-radius: 50%; }
.sw--size .sw__dot { display: grid; place-items: center; background: none; border: 0; width: 44px; height: 44px; }
.sw--size .sw__dot::before { content: ""; width: var(--d); height: var(--d); border-radius: 50%; background: var(--sheet-ink); }
.sw--size:has(input:checked) .sw__dot { transform: none; }
.sw--size:has(input:checked) { background: var(--sheet-2); border-radius: 50%; }
.tools__btns { display: flex; gap: var(--space-xs); margin-left: auto; }
.sbtn__t { white-space: nowrap; }
.sbtn { display: inline-flex; align-items: center; gap: var(--space-xs); min-height: 44px; padding: 0 var(--space-md); border: 2px solid var(--sheet-rule); border-radius: var(--radius-pill); background: transparent; color: var(--sheet-ink); font-weight: 700; font-size: var(--text-sm); cursor: pointer; transition: background-color var(--dur-micro) var(--ease-out), color var(--dur-micro) var(--ease-out); }
.sbtn:hover { background: var(--sheet-ink); color: var(--sheet); border-color: var(--sheet-ink); }
.sbtn:active { transform: translateY(1px); }
.sbtn:disabled { opacity: 0.55; cursor: not-allowed; }
.fields { display: grid; gap: var(--space-md); }
@media (min-width: 56rem) {
  .studio__cols { grid-template-columns: minmax(0, 1.55fr) minmax(0, 1fr); gap: var(--space-lg); }
}
@media (max-width: 40rem) {
  .studio { inset: 0; width: 100%; max-width: none; max-height: none; height: 100dvh; border-radius: 0; padding: var(--space-md); padding-bottom: calc(var(--space-md) + env(safe-area-inset-bottom, 0px)); }
  .studio[open] { display: flex; flex-direction: column; gap: var(--space-md); }
  .studio[open] .sheet__bar, .studio[open] .pad, .studio[open] .tools, .studio__right > fieldset, .studio[open] .fields, .studio[open] .help, .studio[open] .sheet__foot { flex-shrink: 0; }
  .studio .sheet__bar { margin-bottom: 0; }
  .studio__cols, .studio__left, .studio__right { display: contents; }
  .studio .sheet__foot { margin-top: 0; }
  .pad { border-radius: 22px; }
  .tools__btns { margin-left: 0; }
  .sbtn { padding: 0; width: 44px; justify-content: center; }
  .sbtn__t { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); }
  .sheet__foot { position: sticky; bottom: calc(-1 * var(--space-md) - env(safe-area-inset-bottom, 0px)); margin-inline: calc(-1 * var(--space-md)); padding: var(--space-sm) var(--space-md) calc(var(--space-md) + var(--space-sm) + env(safe-area-inset-bottom, 0px)); background: var(--sheet); z-index: var(--z-raised); }
}

/* ---------- 窄屏 ---------- */
@media (max-width: 60rem) {
  .hero { width: auto; right: var(--gutter); inset-block: var(--bar-h) auto; justify-content: flex-start; padding-top: var(--space-lg); padding-bottom: 0; gap: var(--space-md); }
  .hero__title { font-size: var(--text-display); }
}
@media (max-width: 40rem) {
  .bar { padding: 0 var(--space-2xs); gap: var(--space-2xs); }
  .barbtn .ico { display: none; }
  .barbtn { padding: 0 var(--space-sm); min-height: 40px; }
  .wordmark { padding-inline: var(--space-2xs) var(--space-sm); min-height: 40px; }
  .bar { padding-inline: var(--space-md); }
  .barbtn, .wordmark { padding: 0 var(--space-sm); }
  .wordmark { font-size: var(--text-md); }
  .barbtn { gap: var(--space-2xs); }
  .hero { left: var(--space-md); right: var(--space-md); }
  .hud { grid-template-columns: minmax(0, 1fr) auto; grid-template-areas: "count zoom" "fab fab"; padding: 0 var(--space-md) calc(var(--space-lg) + env(safe-area-inset-bottom, 0px)); row-gap: var(--space-sm); }
  .hud__count { grid-area: count; align-self: center; }
  .zoom { grid-area: zoom; }
  .fab { grid-area: fab; justify-self: center; width: min(100%, 22rem); }
  .zoom .roundbtn { width: 44px; height: 44px; }
  #z-in, #z-out { display: none; }
  .corner { left: var(--space-md); }
  .peek { grid-template-columns: minmax(0, 1fr); padding: var(--space-md); bottom: calc(var(--space-sm) + env(safe-area-inset-bottom, 0px)); }
  .peek__ctl { max-width: none; justify-content: flex-start; }
  .showbar { right: var(--space-md); bottom: var(--space-md); }
}
@media (prefers-reduced-motion: reduce) {
  .js .hero__title, .js .hero__lead, .js .hero__actions { animation: none; }
  .unused__sway { animation: none; }
}

/* ---------- 放置：把写好的签名拖到墙上 ---------- */
.place { position: fixed; z-index: var(--z-modal); left: 0; right: 0; margin-inline: auto; bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 0px)); width: min(34rem, calc(100% - 2 * var(--space-md))); display: grid; gap: var(--space-sm); padding: var(--space-md) var(--space-lg); border-radius: var(--ui-radius-lg, 28px); background: var(--sheet); color: var(--sheet-ink); box-shadow: 0 24px 60px var(--shadow-deep); --color-focus: var(--sheet-ink); animation: rise-in var(--dur-long) var(--ease-out) both; }
.place__hint { font-family: var(--font-display); font-size: var(--text-xl); line-height: 1.2; max-width: none; }
.place__rows { display: grid; gap: var(--space-2xs); }
.place__row { display: grid; grid-template-columns: 3rem minmax(0, 1fr); align-items: center; gap: var(--space-sm); font-size: var(--text-sm); font-weight: 700; color: var(--sheet-muted); min-height: 44px; }
.place__row input { width: 100%; accent-color: var(--sheet-ink); }
.place__btns { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-sm); }
.place__btns .btn { min-height: 48px; }
.is-placing .hud { opacity: 0; visibility: hidden; }
.is-placing .hero { opacity: 0; visibility: hidden; }

/* ---------- 换风格的面板 ---------- */
.skins { position: fixed; z-index: var(--z-modal); top: calc(var(--bar-h) + var(--space-2xs)); right: max(var(--space-2xs), calc(var(--edge) - var(--space-md))); width: min(32rem, calc(100% - 2 * var(--space-md))); padding: var(--space-md); border-radius: var(--ui-radius-lg, 28px); background: var(--sheet); color: var(--sheet-ink); box-shadow: 0 24px 60px var(--shadow-deep); --color-focus: var(--sheet-ink); animation: rise-in var(--dur-long) var(--ease-out) both; }
.skins__hint { margin: 0 var(--space-2xs) var(--space-sm); font-family: var(--font-display); font-size: var(--text-lg); line-height: 1.2; max-width: none; }
.skins__list { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: var(--space-xs); }
.skin { display: grid; gap: var(--space-2xs); align-content: start; padding: var(--space-xs); border: 2px solid transparent; border-radius: 18px; background: transparent; color: inherit; text-align: left; cursor: pointer; transition: border-color var(--dur-micro) var(--ease-out), background-color var(--dur-micro) var(--ease-out); }
.skin:hover { background: var(--sheet-2); }
.skin[aria-checked="true"] { border-color: var(--sheet-ink); }
.skin__wall { display: grid; place-items: center; aspect-ratio: 12 / 5; border-radius: 10px; background: var(--wall); border: 2px solid var(--wall-edge); overflow: hidden; }
.skin__ink { width: 80%; height: 80%; overflow: visible; }
.skin__name { font-weight: 700; font-size: var(--text-sm); line-height: 1.3; }
.skin__tag { font-size: var(--text-xs); line-height: 1.35; color: var(--sheet-muted); }
::view-transition-old(root), ::view-transition-new(root) { animation: none; mix-blend-mode: normal; }
::view-transition-old(root) { z-index: 1; }
::view-transition-new(root) { z-index: 2; }

/* ---------- 每种风格自己的框和材质 ---------- */
[data-skin="chalk"] { --frame-w: 36px; }
[data-skin="party"] { --frame-w: 18px; }
[data-skin="gilt"] { --frame-w: 5px; }
[data-skin="gallery"] { --frame-w: 3px; }
@media (max-width: 40rem) {
  .skins { left: var(--space-md); right: var(--space-md); width: auto; }
  .skins__list { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .place { bottom: calc(var(--space-sm) + env(safe-area-inset-bottom, 0px)); padding: var(--space-md); }
}

.sig.is-ghost { z-index: 800; transition: opacity var(--dur-long) var(--ease-out); }
.sig.is-ghost.is-out { opacity: 0; }

.place, .skins, .peek { box-shadow: inset 0 0 0 1px var(--sheet-rule), 0 24px 60px var(--shadow-deep); }

.hero__skins { display: flex; flex-wrap: wrap; gap: var(--space-2xs); margin-top: var(--space-xs); }
.hskin { width: 64px; padding: var(--space-2xs); border: 2px solid transparent; border-radius: 14px; background: none; cursor: pointer; transition: border-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.hskin .skin__wall { aspect-ratio: 16 / 9; border-radius: 8px; }
.hskin:hover { transform: translateY(-2px); }
.hskin:active { transform: translateY(1px); }
.hskin[aria-checked="true"] { border-color: var(--color-ink); }
@media (max-width: 40rem) { .hskin { width: 48px; } .hero__skins { gap: var(--space-2xs); } }

/* ---------- 风格自己的材质：笔、边、光 ---------- */
[data-skin="gilt"] .k1 { fill: url(#g-gold); stroke: var(--pen-1); }
[data-skin="gilt"] .board { box-shadow: var(--board-shadow), inset 0 0 0 5px var(--wall), inset 0 0 0 6px var(--wall-edge); }
[data-skin="gallery"] .board { box-shadow: 0 1px 0 var(--wall-edge), var(--board-shadow); }
[data-skin="chalk"] .btn, [data-skin="chalk"] .barbtn { letter-spacing: 0; }

/* ---------- 放置：一行的面板，草稿上有提示，拖的时候面板让开 ---------- */
.place { grid-template-columns: minmax(0, 1fr); gap: var(--space-sm); width: min(40rem, calc(100% - 2 * var(--space-md))); padding: var(--space-md); }
.place__rows { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: var(--space-md); }
.place__row { grid-template-columns: auto minmax(0, 1fr); gap: var(--space-xs); min-height: 44px; }
.place__btns { gap: var(--space-xs); }
.place__btns .btn { padding-inline: var(--space-md); min-height: 44px; }
.is-dragging-sig .place { opacity: 0.35; transition: opacity var(--dur-short) var(--ease-out); }
.place { transition: opacity var(--dur-short) var(--ease-out); }
.sig.is-placing::after { content: "拖到想放的地方"; position: absolute; left: 50%; top: -14px; translate: -50% -100%; scale: var(--inv, 3); transform-origin: 50% 100%; padding: var(--space-xs) var(--space-sm); border-radius: var(--ui-radius, 999px); background: var(--sheet); color: var(--sheet-ink); font: 700 15px/1.2 var(--font-body); white-space: nowrap; pointer-events: none; }
.is-placing .hud { opacity: 1; visibility: visible; pointer-events: none; }
.is-placing .hud__count, .is-placing .fab { opacity: 0; visibility: hidden; }
.is-placing .zoom { position: fixed; right: max(var(--space-md), var(--edge)); top: calc(var(--bar-h) + var(--space-sm)); pointer-events: auto; }
.is-placing .corner, .is-peek .corner, .is-show .corner { visibility: hidden; }

/* ---------- 左下角的小链接：我是主人 ---------- */
.corner { pointer-events: auto; display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); max-width: min(60ch, calc(100% - 2 * var(--space-md))); }
.corner__owner { min-height: 44px; padding: 0 var(--space-xs); font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); }
.is-wall .corner { display: none; }
@media (max-width: 40rem) { .hud { padding-bottom: calc(var(--space-xl) + env(safe-area-inset-bottom, 0px)); } }

/* ---------- 首屏小方块够大、右边的墙淡出而不是硬切 ---------- */
.hskin { min-height: 44px; display: grid; place-items: center; }
.hskin .skin__wall { width: 100%; }
body:not(.is-wall) .stage { -webkit-mask-image: linear-gradient(to right, var(--color-ink) calc(100% - 96px), transparent); mask-image: linear-gradient(to right, var(--color-ink) calc(100% - 96px), transparent); }

/* ---------- 双面的墙：翻面、旋转 ---------- */
.world { perspective: 5200px; }
.flip { position: absolute; inset: 0; transform-style: preserve-3d; transform: rotateY(var(--flip, 0deg)); }
.face { position: absolute; inset: 0; -webkit-backface-visibility: hidden; backface-visibility: hidden; }
.face--back { transform: rotateY(180deg); }
.board--back { background: var(--back, var(--wall-2)); }
.board--back .board__title text { fill: var(--back-tone, var(--wall)); }
.board__title--back { left: auto; right: 150px; top: 80px; bottom: auto; width: 1500px; height: 560px; }
body[data-face="back"] #board { pointer-events: none; }
body:not([data-face="back"]) #board-back { pointer-events: none; }
.letter { position: absolute; left: 170px; top: 150px; width: 1180px; padding: var(--space-2xl) var(--space-3xl); background: var(--card); color: var(--card-ink); border-radius: 6px; box-shadow: 0 18px 44px var(--shadow-soft); rotate: -1.2deg; font-family: var(--font-display); font-size: 56px; line-height: 1.6; }
.letter p { margin: 0; max-width: none; }
.letter__text { white-space: pre-line; overflow-wrap: anywhere; }
.letter__by { margin-top: 32px; text-align: right; font-size: 36px; }
.flipctl { display: inline-flex; align-items: center; padding: 0 var(--space-sm) 0 var(--space-xs); min-height: 44px; }
.flipctl input { width: 112px; accent-color: var(--color-ink); }
@media (max-width: 40rem) { .flipctl { display: none; } }
.is-placing .flipctl, .is-placing #btn-flip { display: none; }

/* ---------- 贴纸 ---------- */
.sig__stk { position: absolute; inset: 0; pointer-events: none; }
.sig__e { position: absolute; font-size: clamp(34px, calc(var(--h) * 0.62), 120px); line-height: 1; filter: drop-shadow(0 3px 4px var(--shadow-soft)); font-family: var(--font-emoji); }
.sig__e.e0 { right: -7%; top: -36%; rotate: 12deg; }
.sig__e.e1 { left: -9%; bottom: -36%; rotate: -10deg; }
.sig__e.e2 { right: -4%; bottom: -34%; rotate: 8deg; }
.sig.is-land .sig__e { animation: stk-pop 800ms var(--ease-spring) 240ms both; }
@keyframes stk-pop { from { scale: 0; } to { scale: 1; } }
.stk-box { border: 0; padding: 0; margin: 0; min-width: 0; }
.stk-box legend { padding: 0; font-size: var(--text-sm); font-weight: 700; color: var(--sheet-muted); margin-bottom: var(--space-xs); }
.stickers { display: grid; grid-template-columns: repeat(auto-fill, minmax(44px, 1fr)); gap: var(--space-2xs); }
.stk { min-height: 44px; border: 2px solid transparent; border-radius: var(--ui-radius-lg, 14px); background: var(--sheet-2); font-size: 1.5rem; line-height: 1; cursor: pointer; font-family: var(--font-emoji); transition: border-color var(--dur-micro) var(--ease-out), transform var(--dur-micro) var(--ease-out); }
.stk:hover { transform: translateY(-1px); }
.stk:active { transform: translateY(1px); }
.stk[aria-pressed="true"] { border-color: var(--sheet-ink); }

/* ---------- 管理员 ---------- */
.gen { margin-top: var(--space-sm); display: grid; gap: var(--space-sm); }
.gen summary { cursor: pointer; font-weight: 700; font-size: var(--text-sm); min-height: 44px; display: flex; align-items: center; }
.gen summary { gap: var(--space-xs); text-decoration: underline; text-underline-offset: 0.25em; }
.gen summary::after { content: ''; width: 0.5em; height: 0.5em; border-right: 2px solid currentColor; border-bottom: 2px solid currentColor; rotate: 45deg; translate: 0 -0.1em; transition: rotate var(--dur-micro) var(--ease-out); }
.gen[open] > summary::after { rotate: -135deg; translate: 0 0.1em; }
.gen[open] { padding-top: 0; }

/* ---------- 开场：把整页盖住，用手指刮开 ---------- */
.gate { position: fixed; inset: 0; z-index: calc(var(--z-toast) + 10); touch-action: none; cursor: crosshair; transition: opacity 700ms var(--ease-out), visibility 0s linear 700ms; }
.gate.is-out { opacity: 0; visibility: hidden; pointer-events: none; }
.gate__cv { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.gate__skip { position: absolute; z-index: 2; left: 50%; bottom: calc(var(--space-lg) + env(safe-area-inset-bottom, 0px)); translate: -50% 0; min-height: 44px; padding: 0 var(--space-lg); border: 0; border-radius: var(--ui-radius, 999px); background: transparent; color: var(--color-ink); font-weight: 700; font-size: var(--text-sm); text-decoration: underline; text-underline-offset: 0.2em; cursor: pointer; }
.is-gated .hero__title, .is-gated .hero__lead, .is-gated .hero__actions { animation-play-state: paused; }

.studio .stk-box { display: block; }
.studio .stk-box legend { float: none; display: block; line-height: 1.4; padding: 0; margin-bottom: var(--space-xs); }
.stickers { width: 100%; }

/* ---------- 背面的一句话：谁能放照片 ---------- */
.back__note { position: absolute; left: 180px; bottom: 270px; margin: 0; max-width: none; font-family: var(--font-display); font-size: 52px; line-height: 1.3; color: var(--back-ink); pointer-events: none; }

/* ---------- 签名板上：选中的贴纸马上贴在角上 ---------- */
.pad__stk { position: absolute; inset: 0; pointer-events: none; }
.pad__stk span { position: absolute; font-size: clamp(30px, 9%, 64px); line-height: 1; font-family: var(--font-emoji); filter: drop-shadow(0 2px 3px var(--shadow-soft)); animation: stk-pop 500ms var(--ease-spring) both; }
.pad__stk .e0 { right: 3%; top: 4%; rotate: 12deg; } .pad__stk .e1 { left: 3%; bottom: 5%; rotate: -10deg; } .pad__stk .e2 { right: 3%; bottom: 5%; rotate: 8deg; }
.stk-box legend #stk-count { color: var(--sheet-ink); font-variant-numeric: tabular-nums; }

/* ---------- 手机上：名字短一点，主人入口不放在拇指够得到的地方，首屏不重复放风格 ---------- */
.skins__owner { margin: var(--space-sm) 0 0; max-width: none; text-align: right; }
.skins__owner .linkbtn { font-size: var(--text-xs); font-weight: 500; color: var(--sheet-muted); }
@media (max-width: 40rem) {
  .wm__b { display: none; }
  .corner__owner { display: none; }
  .hero__skins { display: none; }
}

/* ---------- 开场盖子上的指尖 ---------- */
.gate__finger { position: absolute; z-index: 1; left: 0; top: 0; width: 64px; height: 64px; border-radius: 50%; border: 3px solid var(--color-ink); background: var(--color-paper-3); opacity: 0; pointer-events: none; transition: opacity var(--dur-short) var(--ease-out); box-shadow: 0 0 0 10px var(--shadow-soft); }
.gate__finger.is-on { opacity: 0.85; }
.gate__skip:focus:not(:focus-visible) { outline: none; }

/* ---------- 平台模式：管理员看到的真名、举报、“我也想做一面” ---------- */
.peek__real { margin-top: var(--space-2xs); font-size: var(--text-sm); color: var(--sheet-muted); max-width: none; }
.skins__plat { margin-top: var(--space-xs); }
.skins__plat p { margin: 0; max-width: none; text-align: right; }
.skins__plat .linkbtn { font-size: var(--text-xs); font-weight: 500; color: var(--sheet-muted); }
#report-form { margin-top: var(--space-xs); }
#report-form textarea { min-height: 0; }
.corner__make { min-height: 44px; display: inline-flex; align-items: center; padding: 0 var(--space-xs); font-size: var(--text-xs); font-weight: 500; color: var(--color-muted); }

/* ---------- 平台模式：签名没开放时的按钮、状态说明、开放设置 ---------- */
#hero-sign:disabled, #fab:disabled, #hero-sign[aria-disabled="true"], #fab[aria-disabled="true"] { background: var(--color-paper-3); color: var(--color-muted); box-shadow: inset 0 0 0 1px var(--color-rule); opacity: 1; cursor: not-allowed; }
.sign-note { margin: var(--space-sm) 0 0; max-width: 34em; font-size: var(--text-sm); line-height: 1.5; color: var(--color-ink-2); }
.openset { display: grid; gap: var(--space-2xs); margin: 0; padding: 0; border: 0; min-width: 0; }
.openset legend { padding: 0; font-size: var(--text-sm); font-weight: 700; margin-bottom: var(--space-2xs); }
#o-open-form { display: grid; gap: var(--space-sm); }
#o-open-form .help { margin: 0; }

/* ---------- 每面墙自己的尺寸：墙上的字、信随墙的大小按比例缩放（--tk = 墙宽高相对 3200×2000 的比例） ---------- */
.board__title { left: calc(150px * var(--tk, 1)); top: calc(100px * var(--tk, 1)); scale: var(--tk, 1); transform-origin: 0 0; }
.board__title--back { left: auto; right: calc(150px * var(--tk, 1)); top: calc(80px * var(--tk, 1)); transform-origin: 100% 0; }
.letter { left: calc(170px * var(--tk, 1)); top: calc(150px * var(--tk, 1)); scale: var(--tk, 1); transform-origin: 0 0; }
.back__note { left: calc(180px * var(--tk, 1)); bottom: calc(270px * var(--tk, 1)); scale: var(--tk, 1); transform-origin: 0 100%; }
.board.title-off .board__title { visibility: hidden; }

/* ---------- 背面的签名：背面是另一种材料，笔色往背面的字色靠一点，才看得清 ---------- */
.board--back { --bp1: color-mix(in oklab, var(--pen-1) 30%, var(--back-ink)); --bp2: color-mix(in oklab, var(--pen-2) 40%, var(--back-ink)); --bp3: color-mix(in oklab, var(--pen-3) 40%, var(--back-ink));
  --bp4: color-mix(in oklab, var(--pen-4) 40%, var(--back-ink)); --bp5: color-mix(in oklab, var(--pen-5) 40%, var(--back-ink)); --bp6: color-mix(in oklab, var(--pen-6) 40%, var(--back-ink)); }
.board--back .k1 { fill: var(--bp1); stroke: var(--bp1); } .board--back .k2 { fill: var(--bp2); stroke: var(--bp2); } .board--back .k3 { fill: var(--bp3); stroke: var(--bp3); }
.board--back .k4 { fill: var(--bp4); stroke: var(--bp4); } .board--back .k5 { fill: var(--bp5); stroke: var(--bp5); } .board--back .k6 { fill: var(--bp6); stroke: var(--bp6); }
.board--back .sig__name { color: var(--back-ink); }

/* ---------- 自定义背景：笔迹加一圈很细的描边，帮助看清（背景的底色和叠色见 main.js 的 setBg） ---------- */
.board.has-bg .sig__ink { filter: var(--sig-filter) drop-shadow(0 0 1px var(--wall)) drop-shadow(0 0 3px var(--wall)); }
.board--back.has-bg .sig__ink { filter: var(--sig-filter) drop-shadow(0 0 1px var(--back)) drop-shadow(0 0 3px var(--back)); }
.board.has-bg.is-lite .sig__ink { filter: none; }

/* ---------- 平台的墙：签名者没有“风格”可切换 ---------- */
.platform .hero__skins, .platform .skins__list, .platform .skins__hint, .platform #show-skins { display: none; }

/* ---------- 背景编辑窗口 ---------- */
.bgedit { width: min(720px, calc(100% - 2 * var(--space-md))); }
.bgedit__stage { --ar: 1.6; position: relative; width: min(100%, calc(36vh * var(--ar))); aspect-ratio: var(--ar); margin: 0 auto var(--space-md); border-radius: var(--space-sm); overflow: hidden; background: var(--wall); touch-action: none; cursor: default; box-shadow: inset 0 0 0 1px var(--sheet-rule); }
.bgedit__stage.has-img { cursor: grab; }
.bgedit__stage.is-grab { cursor: grabbing; }
.bgedit__stage:focus-visible { outline: 3px solid var(--color-focus); outline-offset: 3px; }
.bgedit__stage canvas { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.bgedit__tint { position: absolute; inset: 0; opacity: 0.45; pointer-events: none; }
.bgedit__demo { position: absolute; inset: 0; width: 100%; height: 100%; pointer-events: none; overflow: visible; filter: var(--sig-filter); }
.bgedit__stage.board--back .bgedit__demo { filter: none; }
.bgedit input[type="range"] { width: 100%; accent-color: var(--color-ink); min-height: 44px; }
.bgedit output { font-variant-numeric: tabular-nums; color: var(--sheet-muted); font-weight: 500; }
@media (max-width: 40rem) {
  .bgedit { width: 100%; max-width: 100%; height: 100%; max-height: 100%; margin: 0; border-radius: 0; }
  .bgedit__stage { width: min(100%, calc(40vh * var(--ar))); }
}
.lookbox { margin-top: var(--space-md); display: grid; gap: var(--space-sm); }
.lookbox h4 { margin: 0; font-size: var(--text-sm); font-weight: 700; font-family: var(--font-body); }
.bgrow { display: flex; flex-wrap: wrap; align-items: center; gap: var(--space-xs); }
.bgrow > span { flex: 1 1 8em; font-size: var(--text-sm); }
.bgedit .field--range { grid-template-columns: 7.5em minmax(0, 1fr); align-items: center; gap: var(--space-sm); }
.bgedit .field--range label { margin: 0; white-space: nowrap; }
.bgedit__save { position: sticky; bottom: 0; padding: var(--space-sm) 0; margin-top: var(--space-xs); background: var(--sheet); z-index: 2; }
