/* 交子新印 · 页面样式（深墨底、暖纸色、朱红、金；等宽小字作标注） */
:root {
	--ink: #0b0a08; --ink2: #13110e; --ink3: #1b1814; --paper: #f2ebde; --dim: rgba(242, 235, 222, .66); --faint: rgba(242, 235, 222, .4);
	--line: rgba(242, 235, 222, .13); --line2: rgba(242, 235, 222, .26); --zhu: #e2462b; --gold: #d9b36c; --ok: #8fc49a;
	--serif: "Songti SC", "STSong", "Noto Serif CJK SC", "Source Han Serif SC", "Noto Serif SC", "SimSun", serif;
	--sans: system-ui, -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", sans-serif;
	--mono: "JetBrains Mono", ui-monospace, Menlo, Consolas, monospace;
	--pad: clamp(16px, 4vw, 40px);
}
*, *::before, *::after { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
body { margin: 0; min-height: 100vh; background: radial-gradient(1100px 520px at 50% -12%, rgba(226, 70, 43, .12), transparent 62%) no-repeat, var(--ink); color: var(--paper); font: 15px/1.7 var(--sans); overflow-x: hidden; }
a { color: var(--gold); text-underline-offset: 3px; }
button, input, select, textarea { font: inherit; color: inherit; }
:focus-visible { outline: 2px solid var(--gold); outline-offset: 2px; }
[hidden] { display: none !important; }
#ambient { position: fixed; inset: 0; width: 100%; height: 100%; pointer-events: none; z-index: 0; }
.app { position: relative; z-index: 1; max-width: 1240px; margin: 0 auto; padding: 0 var(--pad) 56px; padding-left: max(var(--pad), env(safe-area-inset-left)); padding-right: max(var(--pad), env(safe-area-inset-right)); }

/* ---------- 题头与分页 ---------- */
.hd { text-align: center; padding: 22px 92px 6px; }
.hd-k { margin: 0; font: 500 11px/1.5 var(--mono); letter-spacing: .14em; color: var(--gold); }
.hd-k span { display: inline-grid; place-items: center; width: 19px; height: 19px; margin-right: 8px; border: 1px solid var(--zhu); color: var(--zhu); font: 700 12px/1 var(--serif); letter-spacing: 0; vertical-align: 1px; }
.hd-t { margin: 8px 0 4px; font: 900 clamp(30px, 5.4vw, 48px)/1.12 var(--serif); letter-spacing: .14em; text-indent: .14em; }
.hd-s { margin: 0; color: var(--dim); font-size: 14px; }
.tabs { display: flex; justify-content: center; margin: 16px 0 26px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.tabs button { position: relative; flex: 0 0 auto; padding: 14px clamp(10px, 2.4vw, 22px) 13px; border: 0; background: none; color: var(--dim); font: 700 15px/1 var(--serif); letter-spacing: .06em; cursor: pointer; white-space: nowrap; }
.tabs button i { margin-right: 7px; font: 500 10px/1 var(--mono); font-style: normal; letter-spacing: .1em; color: var(--faint); vertical-align: 2px; }
.tabs button:hover { color: var(--paper); }
.tabs button[aria-selected="true"] { color: var(--paper); }
.tabs button[aria-selected="true"]::after { content: ""; position: absolute; left: 10px; right: 10px; bottom: -1px; height: 2px; background: var(--zhu); }
.tabs button:focus-visible { outline-offset: -4px; }
.panel { animation: rise .5s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(8px); } to { opacity: 1; transform: none; } }

/* ---------- 通用部件 ---------- */
.st { display: flex; align-items: baseline; justify-content: space-between; gap: 12px; margin: 26px 0 12px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font: 700 17px/1.3 var(--serif); letter-spacing: .06em; }
.st:first-child { margin-top: 0; }
.st span { font: 500 10px/1 var(--mono); letter-spacing: .16em; color: var(--faint); }
.note { margin: 10px 0 0; color: var(--dim); font-size: 13px; line-height: 1.75; }
.cap { margin: 10px 0 0; text-align: center; font: 500 11px/1.4 var(--mono); letter-spacing: .08em; color: var(--faint); }
.chk { display: inline-flex; align-items: center; gap: 7px; font-size: 14px; color: var(--dim); cursor: pointer; }
.chk input { width: 16px; height: 16px; margin: 0; accent-color: var(--zhu); }
.seg { display: inline-flex; padding: 3px; border: 1px solid var(--line2); border-radius: 999px; background: rgba(11, 10, 8, .6); }
.seg button { padding: 7px 15px; border: 0; border-radius: 999px; background: none; color: var(--dim); font-size: 14px; cursor: pointer; white-space: nowrap; }
.seg button[aria-checked="true"] { background: var(--paper); color: var(--ink); font-weight: 700; }
.seg-wide { display: flex; }
.seg-wide button { flex: 1; }
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 42px; padding: 9px 18px; border: 1px solid var(--line2); background: rgba(242, 235, 222, .04); color: var(--paper); font-size: 15px; font-weight: 700; letter-spacing: .04em; text-decoration: none; cursor: pointer; transition: background .15s, border-color .15s; }
.btn:hover { background: rgba(242, 235, 222, .1); border-color: var(--faint); }
.btn-main { background: var(--zhu); border-color: var(--zhu); color: #fff8ee; }
.btn-main:hover { background: #f0563a; border-color: #f0563a; }
.btn[disabled] { opacity: .45; cursor: not-allowed; }
.btns { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; margin: 16px 0 0; }
.fld { display: flex; flex-direction: column; gap: 5px; min-width: 0; font: 500 11px/1.3 var(--mono); letter-spacing: .08em; color: var(--faint); }
.fld input, .fld select, .dt textarea { width: 100%; min-height: 40px; padding: 8px 10px; border: 1px solid var(--line2); border-radius: 0; background: rgba(11, 10, 8, .72); color: var(--paper); font: 15px/1.4 var(--sans); letter-spacing: 0; }
.fld select { appearance: none; background-image: linear-gradient(45deg, transparent 50%, var(--dim) 50%), linear-gradient(135deg, var(--dim) 50%, transparent 50%); background-position: calc(100% - 16px) 50%, calc(100% - 11px) 50%; background-size: 5px 5px; background-repeat: no-repeat; padding-right: 28px; }
.fld input:focus, .fld select:focus, .dt textarea:focus { border-color: var(--gold); outline: none; }
.row2, .grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 14px; }
.fld-wide { grid-column: 1 / -1; }
.fs { margin: 18px 0 0; padding: 14px 14px 16px; border: 1px solid var(--line); position: relative; }
.fs legend { padding: 0 8px; font: 700 15px/1 var(--serif); letter-spacing: .08em; color: var(--paper); }
.alert { position: relative; margin: 0 0 14px; padding: 12px 14px 12px 16px; border: 1px solid; font-size: 14px; line-height: 1.7; }
.alert::before { content: ""; position: absolute; left: -1px; top: -1px; bottom: -1px; width: 4px; background: currentColor; }
.alert b { margin-right: 4px; }
.alert-warn { border-color: rgba(226, 70, 43, .55); background: rgba(226, 70, 43, .1); color: #ffd9cf; }
.alert-ok { border-color: rgba(143, 196, 154, .5); background: rgba(143, 196, 154, .08); color: #d8f0dc; }
.status { min-height: 1.6em; margin: 10px 0 0; font-size: 13.5px; color: var(--dim); }
.status.bad { color: #ff9f8a; }
.status.good { color: var(--ok); }
code { padding: 1px 5px; background: rgba(242, 235, 222, .08); font: 12.5px/1.6 var(--mono); word-break: break-all; }

/* HUD 角标：四角的小括号 */
.hud { position: relative; }
.hud::before, .hud::after { content: ""; position: absolute; z-index: 2; width: 14px; height: 14px; pointer-events: none; border-color: var(--gold); border-style: solid; opacity: .75; }
.hud::before { left: -7px; top: -7px; border-width: 1px 0 0 1px; }
.hud::after { right: -7px; bottom: -7px; border-width: 0 1px 1px 0; }

/* ---------- 红包封面 ---------- */
.hb { display: grid; grid-template-columns: minmax(280px, 380px) minmax(0, 1fr); gap: clamp(22px, 4vw, 56px); align-items: start; }
.stage { position: sticky; top: 14px; }
.phone { position: relative; width: min(330px, 100%); margin: 0 auto; aspect-ratio: 9 / 18.6; padding: 9px; border-radius: 40px; background: linear-gradient(150deg, #2c2824, #0f0e0c 60%); box-shadow: 0 0 0 1px rgba(242, 235, 222, .14), 0 0 0 7px rgba(11, 10, 8, .9), 0 34px 70px -26px rgba(0, 0, 0, .9); }
.ph-bar { position: absolute; z-index: 6; top: 15px; left: 32px; right: 32px; display: flex; justify-content: space-between; align-items: center; font: 600 11px/1 var(--sans); color: #1c1a17; pointer-events: none; }
.ph-bar i { width: 22px; height: 9px; border: 1px solid currentColor; border-radius: 3px; opacity: .8; }
.phone[data-view="open"] .ph-bar, .phone[data-view="story"] .ph-bar { color: #f2ebde; }
.ph-scr { position: relative; width: 100%; height: 100%; overflow: hidden; border-radius: 31px; background: #ececea; container-type: inline-size; }
.pv { position: absolute; inset: 0; display: none; }
.phone[data-view="chat"] .pv-chat, .phone[data-view="open"] .pv-open, .phone[data-view="story"] .pv-story { display: block; }
/* 聊天 */
.pv-chat { padding: 40px 10px 0; background: #ececea; color: #1c1a17; }
.ch-top { display: flex; justify-content: space-between; align-items: center; height: 34px; margin: 0 -10px 12px; padding: 0 14px; border-bottom: 1px solid rgba(0, 0, 0, .08); font-size: 14px; }
.ch-top b { font-weight: 600; }
.ch-msg { display: flex; align-items: flex-start; gap: 8px; margin: 0 0 14px; }
.ch-msg > p { margin: 0; padding: 7px 11px; border-radius: 4px; background: #fff; font-size: 13px; line-height: 1.5; }
.ch-me { justify-content: flex-end; }
.ch-me > p { background: #b9e59a; }
.ch-av { flex: 0 0 auto; width: 32px; height: 32px; border-radius: 4px; background: linear-gradient(135deg, #c9b79a, #8c7a62); }
.ch-av2 { background: linear-gradient(135deg, #d9b36c, #a8321f); }
.ch-av3 { background: linear-gradient(135deg, #8aa1b5, #4c6275); }
.rp { position: relative; width: 74%; aspect-ratio: 480 / 216; margin-top: 18px; margin-bottom: 14px; border-radius: 6px; overflow: visible; }
.rp canvas { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: 6px; }
.rp-shade { position: absolute; inset: 0; border-radius: 6px; background: linear-gradient(90deg, rgba(150, 30, 18, .92) 0%, rgba(150, 30, 18, .55) 46%, rgba(150, 30, 18, 0) 72%); }
.rp-t { position: absolute; left: 10%; top: 26%; width: 56%; margin: 0; color: #fff3e2; font-size: clamp(11px, 4cqw, 14px); line-height: 1.4; font-weight: 600; }
.rp-k { position: absolute; left: 10%; bottom: 7%; margin: 0; color: rgba(255, 243, 226, .7); font-size: 10px; }
.rp-pend, .op-pend { position: absolute; display: block; pointer-events: none; }
.rp-pend { left: 0; top: -44.44%; width: 100%; height: 177.78%; }
.rp-pend canvas, .op-pend canvas, .op-cover canvas, .st-img canvas { display: block; width: 100%; height: 100%; }
/* 拆红包 */
.pv-open { background: radial-gradient(120% 80% at 50% 40%, #3a3631, #1b1916); }
.op-wrap { position: absolute; left: 13%; top: 23%; width: 74%; aspect-ratio: 861 / 1308; }
.op-card { position: absolute; inset: 0; border-radius: 10px; overflow: hidden; box-shadow: 0 18px 40px -16px rgba(0, 0, 0, .8); }
.op-pend { left: -11.15%; top: -26.15%; width: 122.3%; height: 133.49%; }
.op-cover { position: absolute; inset: 0; }
.op-cover canvas { object-fit: cover; }
.op-from { position: absolute; left: 0; right: 0; top: 4%; margin: 0; text-align: center; color: rgba(255, 246, 232, .92); font-size: 11px; text-shadow: 0 1px 3px rgba(0, 0, 0, .6); }
.op-btn { position: absolute; left: 50%; top: 66%; width: 27%; aspect-ratio: 1; transform: translate(-50%, -50%); display: grid; place-items: center; border-radius: 50%; background: radial-gradient(circle at 40% 35%, #f6dca0, #d8a849 70%); color: #3b2a12; font: 900 clamp(16px, 7cqw, 24px)/1 var(--serif); box-shadow: 0 4px 12px rgba(0, 0, 0, .35); }
.op-x { position: absolute; left: 50%; bottom: 7%; transform: translateX(-50%); display: grid; place-items: center; width: 30px; height: 30px; border: 1px solid rgba(255, 255, 255, .5); border-radius: 50%; color: rgba(255, 255, 255, .8); font-size: 18px; line-height: 1; }
/* 封面故事 */
.pv-story { background: #000; }
.st-img { position: absolute; left: 0; right: 0; top: 50%; transform: translateY(-50%); aspect-ratio: 750 / 1250; }
.st-bar { position: absolute; z-index: 2; top: 38px; left: 14px; right: 14px; height: 2px; background: rgba(255, 255, 255, .3); }
.st-bar i { display: block; width: 40%; height: 100%; background: #fff; }
/* 叠加层：安全区与暗记 */
.ov-safe, .ov-mark { position: absolute; inset: 0; z-index: 5; pointer-events: none; }
.zone { position: absolute; border: 1px dashed var(--gold); color: var(--gold); font: 600 9px/1.25 var(--mono); letter-spacing: .04em; }
.zone span { position: absolute; left: 3px; top: 2px; padding: 1px 3px; background: rgba(11, 10, 8, .78); white-space: nowrap; }
.zone.band { border-style: solid; border-color: rgba(226, 70, 43, .9); background: rgba(226, 70, 43, .18); color: #ffd9cf; }
.ring { position: absolute; border: 2px solid var(--gold); border-radius: 50%; box-shadow: 0 0 0 3px rgba(11, 10, 8, .55), 0 0 18px rgba(217, 179, 108, .8); animation: ping 1.6s ease-in-out infinite; }
@keyframes ping { 50% { transform: scale(1.18); opacity: .7; } }
#views { display: flex; width: fit-content; margin: 16px auto 0; }

/* 三款与素材 */
.vars { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 12px; }
.var { display: flex; flex-direction: column; gap: 8px; padding: 10px; border: 1px solid var(--line); background: rgba(19, 17, 14, .7); color: var(--paper); text-align: left; cursor: pointer; transition: border-color .15s, background .15s; }
.var:hover { border-color: var(--line2); }
.var[aria-checked="true"] { border-color: var(--zhu); background: rgba(226, 70, 43, .08); }
.var canvas { width: 100%; height: auto; aspect-ratio: 957 / 1278; background: #222; }
.var b { font: 700 15px/1.2 var(--serif); letter-spacing: .06em; }
.var small { color: var(--dim); font-size: 12px; line-height: 1.55; }
.var[aria-checked="true"] canvas { animation: stamp .45s cubic-bezier(.2, 1.6, .4, 1) both; }
@keyframes stamp { from { transform: scale(1.06); filter: brightness(1.25); } to { transform: none; filter: none; } }
.tgl { display: flex; flex-wrap: wrap; gap: 10px 22px; margin: 16px 0 0; }
.mark-note { padding: 10px 12px; border-left: 2px solid var(--gold); background: rgba(217, 179, 108, .08); color: var(--paper); }
.assets { margin: 0; padding: 0; list-style: none; border-top: 1px solid var(--line); }
.asset { display: grid; grid-template-columns: 54px minmax(0, 1fr) auto; gap: 14px; align-items: center; padding: 12px 0; border-bottom: 1px solid var(--line); }
.asset .th { width: 54px; height: 54px; display: grid; place-items: center; background: repeating-conic-gradient(#2a2622 0 25%, #1d1a17 0 50%) 0 0 / 10px 10px; }
.asset .th canvas { max-width: 50px; max-height: 50px; }
.asset b { display: block; font: 700 15px/1.3 var(--serif); }
.asset .spec { display: block; font: 500 11px/1.5 var(--mono); color: var(--faint); letter-spacing: .02em; }
.asset .kb { display: block; font: 500 11px/1.5 var(--mono); color: var(--ok); }
.asset .kb.over { color: #ff9f8a; }
.asset .btn { min-height: 36px; padding: 6px 12px; font-size: 13px; }

/* ---------- 冷钱包备份页 ---------- */
.qb { display: grid; grid-template-columns: minmax(0, 430px) minmax(0, 1fr); grid-template-rows: auto 1fr; gap: 0 clamp(22px, 4vw, 52px); align-items: start; }
.qb-a { grid-column: 1; grid-row: 1; }
.qb-b { grid-column: 1; grid-row: 2; }
.qb-stage { grid-column: 2; grid-row: 1 / span 2; position: sticky; top: 14px; }
.sheet-fit { position: relative; width: 100%; overflow: hidden; }
.sheet-host { position: absolute; left: 0; top: 0; transform-origin: 0 0; box-shadow: 0 30px 60px -28px rgba(0, 0, 0, .95), 0 0 0 1px rgba(242, 235, 222, .12); }
.dt { margin: 14px 0 0; border: 1px solid var(--line); background: rgba(19, 17, 14, .6); }
.dt summary { padding: 11px 14px; cursor: pointer; font-size: 14px; color: var(--paper); list-style: none; }
.dt summary::-webkit-details-marker { display: none; }
.dt summary::before { content: "+"; display: inline-block; width: 1.2em; font-family: var(--mono); color: var(--gold); }
.dt[open] summary::before { content: "−"; }
.dt > :not(summary) { margin-left: 14px; margin-right: 14px; }
.dt > :last-child { margin-bottom: 14px; }
.dt textarea { min-height: 76px; resize: vertical; font-family: var(--mono); font-size: 13px; }
.ent-fb { min-height: 1.5em; margin: 10px 14px 0; font: 500 12px/1.6 var(--mono); color: var(--dim); }
.ent-fb.bad { color: #ff9f8a; }
.words { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); grid-auto-flow: column; grid-template-rows: repeat(var(--r3, 8), auto); gap: 6px; margin: 14px 0 0; padding: 0; list-style: none; counter-reset: w; }
.words:empty { display: none; }
.words li { display: flex; align-items: baseline; gap: 8px; padding: 7px 9px; border: 1px solid var(--line); background: rgba(11, 10, 8, .7); font: 600 15px/1.2 var(--mono); }
.words li::before { counter-increment: w; content: counter(w, decimal-leading-zero); font: 500 10px/1 var(--mono); color: var(--faint); }
.words.zh li { font-family: var(--serif); font-size: 18px; }
.blurred .words li, .blurred .sh-w b { filter: blur(6px); }
.addr { display: grid; grid-template-columns: 112px minmax(0, 1fr); gap: 14px; margin: 16px 0 0; padding: 14px; border: 1px solid var(--line); background: rgba(19, 17, 14, .6); }
.addr-qr { width: 112px; height: 112px; padding: 6px; background: #fff; }
.addr-qr svg { display: block; width: 100%; height: 100%; }
.addr-k { margin: 0; font: 500 10.5px/1.5 var(--mono); letter-spacing: .06em; color: var(--gold); }
.addr-v { margin: 6px 0 0; font: 600 13px/1.55 var(--mono); word-break: break-all; color: var(--paper); }
.off { margin: 26px 0 0; padding: 16px; border: 1px solid var(--line2); background: rgba(19, 17, 14, .7); }
.off p { margin: 10px 0 0; font-size: 14px; color: var(--dim); }
.off .st { margin-top: 0; }
.off-size { font: 500 11px/1 var(--mono); color: var(--faint); margin-left: 8px; }
.sha { font: 500 11px/1.6 var(--mono); color: var(--faint); word-break: break-all; }
.sha span { color: var(--gold); }
.steps { margin: 12px 0 0; padding-left: 1.4em; font-size: 14px; color: var(--paper); }
.steps li { margin: 3px 0; }
.safety { margin: 26px 0 0; }
.safety ul { margin: 0; padding-left: 1.2em; font-size: 14px; color: var(--dim); }
.safety li { margin: 6px 0; }
.safety li::marker { color: var(--zhu); }
.print-hint { padding: 10px 12px; border: 1px dashed var(--line2); }

/* ---------- 交子小史 ---------- */
.ls { max-width: 760px; margin: 0 auto; font: 16px/1.95 var(--serif); }
.ls-t { margin: 0 0 18px; font: 900 clamp(24px, 3.4vw, 32px)/1.3 var(--serif); letter-spacing: .06em; }
.ls p { margin: 0 0 16px; color: rgba(242, 235, 222, .86); }
.ls blockquote { position: relative; margin: 6px 0 20px; padding: 14px 18px 14px 22px; border-left: 2px solid var(--zhu); background: rgba(226, 70, 43, .07); color: var(--paper); font-size: 17px; }
.ls-h { margin: 34px 0 14px; padding-bottom: 8px; border-bottom: 1px solid var(--line); font: 700 18px/1.4 var(--serif); letter-spacing: .04em; }
.cmp { display: grid; grid-template-columns: 1fr 1fr; gap: 1px; margin: 0 0 18px; background: var(--line); border: 1px solid var(--line); }
.cmp div { padding: 12px 14px; background: var(--ink2); }
.cmp div:nth-child(odd) b { color: var(--zhu); }
.cmp div:nth-child(even) b { color: var(--gold); }
.cmp b { font-size: 15px; letter-spacing: .08em; }
.cmp p { margin: 4px 0 0; font: 14px/1.7 var(--sans); color: var(--dim); }
.src { margin: 0; padding-left: 1.2em; font: 13px/1.8 var(--sans); color: var(--dim); }
.src li { margin: 4px 0; }
.ft { display: flex; flex-wrap: wrap; justify-content: space-between; gap: 6px 20px; margin-top: 48px; padding: 16px 0 0; border-top: 1px solid var(--line); font: 500 11px/1.6 var(--mono); letter-spacing: .06em; color: var(--faint); padding-right: 150px; }
.print-root { display: none; }

/* ---------- 窄屏 ---------- */
@media (max-width: 880px) {
	.hb, .qb { grid-template-columns: minmax(0, 1fr); }
	.stage, .qb-stage { position: relative; top: auto; }
	.qb-a, .qb-b, .qb-stage { grid-column: 1; grid-row: auto; }
	.qb-stage { margin: 22px 0 4px; }
}
@media (max-width: 560px) {
	.hd { padding: 18px 76px 4px; }
	.hd-k { font-size: 10px; letter-spacing: .08em; }
	.hd-s { font-size: 13px; }
	.tabs { justify-content: flex-start; margin: 12px calc(var(--pad) * -1) 20px; padding: 0 6px; }
	.tabs button { font-size: 14px; padding: 13px 10px 12px; }
	.tabs button i { display: none; }
	.vars { gap: 8px; }
	.var { padding: 7px; }
	.var small { display: none; }
	.var b { font-size: 13px; }
	.words { grid-template-columns: repeat(2, minmax(0, 1fr)); grid-template-rows: repeat(var(--r2, 12), auto); }
	.addr { grid-template-columns: 1fr; }
	.ft { padding-right: 0; padding-bottom: 54px; }
	.cmp { grid-template-columns: 1fr; }
}
@media (prefers-reduced-motion: reduce) {
	*, *::before, *::after { animation: none !important; transition: none !important; }
}

.paused *, .paused *::before, .paused *::after { animation-play-state: paused !important; }
