/* 身份验证器 · 样式。2026-10-01 改成全站绿色版式（参考 hermes-agent.nousresearch.com，规范见 ../theme/README.md）：
   整块绿带（页头、首屏）接纸面正文、超窄细体大标题、等宽小标签、方角、虚线分隔、视口细框；不要圆角、阴影、渐变、毛玻璃。
   链上应用：只用系统字体，不连任何链外资源。深浅两套配色；绿带里重设同一组语义变量（--ink、--hi……），组件跟着所在的底色走。代码 MIT。 */
:root {
  --g: #006B35; --g-deep: #005C2B; --g-deeper: #004A22; --frame: #1E8C4E; --lime: #E4F53C; --paper-c: #F2F3EF;
  --bg: #F2F3EF; --panel: #FFFFFF; --ink: #0B2A18; --ink2: #3C5446; --ink3: #5A6E62;
  --line: rgba(0, 107, 53, 0.26); --line2: rgba(0, 107, 53, 0.55); --hi: #006B35; --on-hi: #F2F3EF;
  --err: #B3261E; --on-err: #FFFFFF; --soft: rgba(0, 107, 53, 0.08); --scrim: rgba(11, 42, 24, 0.5);
  --snack-bg: #0B2A18; --snack-fg: #F2F3EF; --snack-edge: #E4F53C;
  --disp: "Avenir Next Condensed", "Bahnschrift", "DIN Condensed", "Roboto Condensed", "Arial Narrow", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --sans: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", "Segoe UI", system-ui, sans-serif;
  --mono: ui-monospace, "SF Mono", Menlo, Consolas, monospace;
  --in: 1080px;                                                   /* 宽屏内容宽度 */
  --pad: max(16px, env(safe-area-inset-left), calc(50% - var(--in) / 2));   /* 两侧留白：手机 16px，宽屏把内容收在中间 */
  --select: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%235A6E62' stroke-width='1.5'/%3E%3C/svg%3E");
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --g: #006A34; --g-deep: #00522A; --g-deeper: #00401F;
    --bg: #0D1A12; --panel: #13241A; --ink: #E6EFE8; --ink2: #A9BCB0; --ink3: #7E9386;
    --line: rgba(91, 224, 143, 0.22); --line2: rgba(91, 224, 143, 0.5); --hi: #5BE08F; --on-hi: #0D1A12;
    --err: #FF8A80; --on-err: #0D1A12; --soft: rgba(91, 224, 143, 0.1); --scrim: rgba(0, 0, 0, 0.6);
    --snack-bg: #E6EFE8; --snack-fg: #0D1A12; --snack-edge: #006A34;
    --select: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237E9386' stroke-width='1.5'/%3E%3C/svg%3E");
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --g: #006A34; --g-deep: #00522A; --g-deeper: #00401F;
  --bg: #0D1A12; --panel: #13241A; --ink: #E6EFE8; --ink2: #A9BCB0; --ink3: #7E9386;
  --line: rgba(91, 224, 143, 0.22); --line2: rgba(91, 224, 143, 0.5); --hi: #5BE08F; --on-hi: #0D1A12;
  --err: #FF8A80; --on-err: #0D1A12; --soft: rgba(91, 224, 143, 0.1); --scrim: rgba(0, 0, 0, 0.6);
  --snack-bg: #E6EFE8; --snack-fg: #0D1A12; --snack-edge: #006A34;
  --select: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%237E9386' stroke-width='1.5'/%3E%3C/svg%3E");
  color-scheme: dark;
}
/* 绿带：米白字，强调色换成黄绿（对比度：米白 6.0、黄绿 5.5）；面板是更深的绿 */
.topbar, .hero, .status, .empty, .drawer, .screen.center {
  --bg: var(--g); --panel: var(--g-deep); --ink: #F2F3EF; --ink2: rgba(242, 243, 239, 0.9); --ink3: rgba(242, 243, 239, 0.82);
  --line: rgba(242, 243, 239, 0.28); --line2: rgba(242, 243, 239, 0.6); --hi: var(--lime); --on-hi: #0B2A18;
  --err: var(--lime); --on-err: #0B2A18; --soft: rgba(242, 243, 239, 0.12);
  --select: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 12 8'%3E%3Cpath d='M1 1l5 5 5-5' fill='none' stroke='%23F2F3EF' stroke-width='1.5'/%3E%3C/svg%3E");
  background: var(--g); color: var(--ink);
}

* { box-sizing: border-box; }
html { -webkit-text-size-adjust: 100%; }
html, body { margin: 0; background: var(--bg); color: var(--ink); font-family: var(--sans); -webkit-tap-highlight-color: transparent; }
body { font-size: 15.5px; line-height: 1.6; -webkit-font-smoothing: antialiased; }
/* 视口四周一道细框（不挡点按） */
body::after { content: ""; position: fixed; inset: 0; border: 5px solid var(--frame); pointer-events: none; z-index: 1000; }
@media (max-width: 620px) { body::after { border-width: 3px; } }
button, input, select { font: inherit; color: inherit; }
a { color: var(--hi); }
:focus-visible { outline: 2px solid var(--hi); outline-offset: 2px; }
::selection { background: var(--lime); color: #0B2A18; }
.hidden { display: none; }
svg { fill: currentColor; }
[hidden] { display: none !important; }          /* .btn 等设了 display 的元素，hidden 属性也要生效 */

/* 等宽小标签（英文大写、宽字距；中文不转大写） */
.eyebrow { margin: 0; font: 400 12px/1.5 var(--mono); letter-spacing: 0.04em; text-transform: uppercase; color: var(--ink3); }
:lang(en) .eyebrow { letter-spacing: 0.12em; }

/* ---------------- 页面骨架：页头 → 首屏 → 正文 ---------------- */
.screen { position: relative; min-height: 100vh; min-height: 100dvh; padding-bottom: env(safe-area-inset-bottom); background: var(--bg); }
.topbar { position: sticky; top: 0; z-index: 5; display: flex; align-items: center; gap: 2px; min-height: 64px;
  padding: env(safe-area-inset-top) calc(var(--pad) - 10px) 0; border-bottom: 1px solid var(--line); }
.topbar > :first-child.mark { margin-left: 10px; }
.topbar h1 { margin: 0; }
/* 字标：窄体细体、大写；下面一行等宽小字 */
.mark { display: grid; justify-items: start; min-width: 0; margin-right: auto; padding: 8px 0; line-height: 0.92; color: var(--ink); }
.mark h1, .mark b { max-width: 100%; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 300 25px/0.95 var(--disp); font-stretch: condensed; letter-spacing: 0.02em; text-transform: uppercase; }
:lang(en) .mark h1, :lang(en) .mark b { font-weight: 200; font-size: 27px; }
.mark small { margin-top: 6px; font: 400 9.5px/1 var(--mono); letter-spacing: 0.2em; text-transform: uppercase; color: var(--ink3); white-space: nowrap; }
.topbar > .mark + .icon-btn, .topbar > .mark + * { margin-left: 8px; }
/* 宽屏：菜单里的几项排在页头（像主站的导航），窄屏收进「菜单」 */
.topnav { display: none; align-items: center; margin-right: 8px; }
.topnav button, .topnav a { min-height: 44px; padding: 0 14px; border: 0; background: none; color: var(--ink); cursor: pointer; text-decoration: none;
  display: inline-flex; align-items: center; font: 400 16px/1 var(--disp); font-stretch: condensed; letter-spacing: 0.06em; text-transform: uppercase; }
.topnav button:hover, .topnav a:hover { color: var(--hi); }
@media (min-width: 900px) { .topnav { display: flex; } .topbar .menu-btn { display: none; } }
/* 首屏：大号窄体细体标题 + 引言 */
.hero { padding: 22px var(--pad) 30px; }
.hero h1 { margin: 0; max-width: 18em; font: 300 clamp(38px, 9.4vw, 66px)/1.06 var(--disp); font-stretch: condensed; letter-spacing: -0.005em;
  word-break: keep-all; overflow-wrap: anywhere; }
:lang(en) .hero h1 { font-weight: 200; text-transform: uppercase; line-height: 1; }
.hero .lede { margin: 14px 0 0; max-width: 44em; color: var(--ink2); font-size: 15.5px; line-height: 1.6; }
.body { padding: 24px var(--pad) 56px; }
.body > :not(.bottom-bar) { max-width: 760px; }

/* 图标按钮：44px 方块（触屏可点范围） */
.icon-btn { flex: none; display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 0; border-radius: 0; background: none; color: var(--ink); cursor: pointer; }
.icon-btn svg { width: 24px; height: 24px; }
.icon-btn:hover { background: var(--soft); }
.icon-btn:disabled { opacity: 0.38; cursor: default; }
.topbar .icon-btn { color: var(--ink); }
.icon-btn.avatar .identicon { box-shadow: none; outline: 1px solid var(--line2); }
.topbar.selbar { --bg: var(--g-deeper); background: var(--g-deeper); }
.topbar.selbar h1 { flex: 1; min-width: 0; margin-left: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 300 26px/1 var(--disp); font-stretch: condensed; color: var(--lime); }
.search { flex: 1; min-width: 0; height: 44px; margin-left: 4px; padding: 0 14px; border: 1px solid var(--line); border-radius: 0; outline: none;
  background: var(--g-deeper); color: #F2F3EF; font-size: 16px; }
.search::placeholder { color: rgba(242, 243, 239, 0.7); }
.search:focus { border-color: var(--lime); }
.search::-webkit-search-cancel-button { -webkit-appearance: none; appearance: none; width: 18px; height: 18px; cursor: pointer;
  background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 24 24'%3E%3Cpath d='M19 6.41 17.59 5 12 10.59 6.41 5 5 6.41 10.59 12 5 17.59 6.41 19 12 13.41 17.59 19 19 17.59 13.41 12z' fill='%23F2F3EF'/%3E%3C/svg%3E") center / 18px no-repeat; }

/* ---------------- 首页：绿带里的说明与提醒，纸面上的验证码 ---------------- */
.status { padding: 0 var(--pad); }
.status > .eyebrow { padding: 12px 0 14px; }
.status > :last-child:not(:empty) { margin-bottom: 16px; }
.list { list-style: none; margin: 0; padding: 0 0 120px; }
.item { position: relative; padding: 12px var(--pad) 14px; border-bottom: 1px dashed var(--line2); cursor: pointer;
  user-select: none; -webkit-user-select: none; touch-action: manipulation; }
.item:focus-visible { outline: 2px solid var(--hi); outline-offset: -2px; }
@media (hover: hover) { .item:hover { background: var(--soft); } }
.item.selected { background: color-mix(in srgb, var(--hi) 14%, var(--panel)); }
.item.selected::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 4px; background: var(--hi); }
.item.dragging { position: relative; z-index: 2; background: var(--panel); outline: 2px solid var(--hi); outline-offset: -2px; }
/* 倒计时条：贴着这一行的底边，长度是剩余时间（--p 由脚本每 0.1 秒更新），最后 5 秒变红 */
.item::after { content: ""; position: absolute; left: 0; bottom: -1px; height: 3px; width: calc(var(--p, 0) * 100%); background: var(--hi); pointer-events: none; }
.item.expiring::after { background: var(--err); }
.label { min-width: 0; }
.label .iss { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 500 11.5px/1.5 var(--mono); letter-spacing: 0.12em; text-transform: uppercase; color: var(--ink3); }
.label .sep { display: none; }                   /* 「发行方: 名称」里的冒号：读屏和复制标签时还在，界面上分成两行就不显示 */
.label .nm { display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font: 400 21px/1.25 var(--disp); font-stretch: condensed; letter-spacing: 0.01em; color: var(--ink); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-top: 2px; min-height: 50px; }
.code { font: 400 clamp(34px, 10.4vw, 44px)/1.05 var(--mono); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; color: var(--hi); white-space: nowrap; }
.item.expiring .code { color: var(--err); }
/* 剩余秒数：方框里的等宽数字 */
.pie { flex: none; display: grid; place-items: center; min-width: 44px; height: 44px; padding: 0 6px; border: 1px solid var(--line2);
  font: 500 17px/1 var(--mono); font-variant-numeric: tabular-nums; color: var(--ink2); }
.item.expiring .pie { background: var(--err); border-color: var(--err); color: var(--on-err); }
.row .icon-btn { border: 1px solid var(--line2); color: var(--hi); }
.handle { cursor: grab; touch-action: none; }
.none { margin: 0; padding: 40px var(--pad); font: 300 24px/1.3 var(--disp); font-stretch: condensed; color: var(--ink3); }
/* 宽屏：验证码排成方角卡片网格（像参考站的功能网格）；多选时变回一列，拖动排序按上下位置算 */
@media (min-width: 760px) {
  .list { display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr)); gap: 16px; padding: 28px var(--pad) 140px; }
  .list.selecting { grid-template-columns: minmax(0, 720px); }
  .item { padding: 16px 18px 18px; border: 1px solid var(--line); background: var(--panel); }
  .code { font-size: 40px; }
  @media (hover: hover) { .item:hover { background: color-mix(in srgb, var(--hi) 5%, var(--panel)); } }
  .item::after { bottom: 0; }
}
/* 右下角「添加帐号」：方块；宽屏带文字 */
.fab { position: fixed; z-index: 6; right: calc(var(--pad) + env(safe-area-inset-right)); bottom: calc(20px + env(safe-area-inset-bottom));
  display: inline-flex; align-items: center; justify-content: center; gap: 10px; min-width: 56px; height: 56px; padding: 0 16px;
  border: 1px solid var(--hi); border-radius: 0; background: var(--hi); color: var(--on-hi); cursor: pointer;
  font: 400 18px/1 var(--disp); font-stretch: condensed; letter-spacing: 0.06em; text-transform: uppercase; }
.fab svg { width: 24px; height: 24px; }
.fab-text { display: none; }
@media (min-width: 760px) { .fab { padding: 0 22px 0 18px; } .fab-text { display: inline; } }

/* 空列表：绿带首屏（标题、引言、按钮），插图在下面 / 宽屏在右边 */
.empty { display: grid; align-content: start; gap: 30px; min-height: calc(100vh - 65px); min-height: calc(100dvh - 65px); padding: 26px var(--pad) 56px; }
.empty h2 { margin: 12px 0 14px; max-width: 12em; font: 300 clamp(34px, 9.4vw, 64px)/1.06 var(--disp); font-stretch: condensed; letter-spacing: -0.005em;
  word-break: keep-all; overflow-wrap: anywhere; }
:lang(en) .empty h2 { font-weight: 200; text-transform: uppercase; line-height: 0.98; }
.empty-copy > p:not(.eyebrow) { max-width: 34em; margin: 0; color: var(--ink2); font-size: 16px; line-height: 1.6; }
.empty-actions { display: flex; flex-direction: column; gap: 10px; width: min(100%, 360px); margin: 24px 0 6px; }
.empty-actions .btn { justify-content: flex-start; min-height: 52px; }
.empty .link { margin: 8px 0 0; padding-left: 0; }
.empty .about { margin-top: 14px; }
.art { display: block; width: min(100%, 240px); height: auto; }
.art-frame { fill: none; stroke: rgba(242, 243, 239, 0.28); stroke-width: 0.12; }
.art-mod { fill: rgba(242, 243, 239, 0.55); }
.art-ring { fill: none; stroke: var(--lime); stroke-width: 1; }
.art-eye { fill: var(--lime); }
.art-scan { fill: var(--lime); animation: scanline 3.2s ease-in-out infinite alternate; }
@keyframes scanline { from { transform: translateY(-11px); } to { transform: translateY(11px); } }
@media (min-width: 900px) {
  .empty { grid-template-columns: minmax(0, 1fr) minmax(0, 360px); align-content: center; align-items: center; gap: 56px; padding-top: 48px; padding-bottom: 84px; }
  .empty-actions { flex-direction: row; flex-wrap: wrap; width: auto; }
  .art { width: 100%; }
}

/* ---------------- 按钮 ---------------- */
/* 方角；主按钮：纸面上绿底米白字（深色模式亮绿底深字），绿带上米白底绿字；描边、文字按钮次之；危险操作红色 */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 0 18px; border: 1px solid var(--hi); border-radius: 0;
  background: var(--hi); color: var(--on-hi); cursor: pointer; text-align: center; text-decoration: none;
  font: 400 17px/1.15 var(--disp); font-stretch: condensed; letter-spacing: 0.04em; text-transform: uppercase; }
:lang(en) .btn { letter-spacing: 0.07em; }
.btn svg { flex: none; width: 20px; height: 20px; }
.btn:hover { filter: brightness(1.07); }
.btn.tonal, .btn.ghost { background: transparent; color: var(--hi); border-color: var(--line2); }
.btn.tonal:hover, .btn.ghost:hover { filter: none; border-color: var(--hi); background: var(--soft); }
.btn.text { background: none; border-color: transparent; color: var(--hi); padding: 0 10px; }
.btn.text:hover { filter: none; background: var(--soft); }
.btn.danger { background: var(--err); border-color: var(--err); color: var(--on-err); }
.btn.ghost.danger { background: transparent; color: var(--err); border-color: var(--err); }
.btn.text.danger { background: none; border-color: transparent; color: var(--err); }
.btn:disabled { opacity: 0.4; cursor: default; filter: none; }
.topbar .btn, .hero .btn, .status .btn, .empty .btn, .drawer .btn, .screen.center .btn { background: #F2F3EF; color: var(--g); border-color: #F2F3EF; }
.topbar .btn.tonal, .hero .btn.tonal, .status .btn.tonal, .empty .btn.tonal, .screen.center .btn.tonal,
.topbar .btn.ghost, .empty .btn.ghost { background: rgba(242, 243, 239, 0.14); color: #F2F3EF; border-color: transparent; }
.status .btn.text, .empty .btn.text, .screen.center .btn.text { background: none; color: var(--lime); border-color: transparent; }
a.btn { text-decoration: none; }
.link { min-height: 44px; margin-top: 16px; padding: 0 2px; border: 0; background: none; color: var(--hi); cursor: pointer;
  font: 400 17px/1.2 var(--disp); font-stretch: condensed; letter-spacing: 0.03em; text-decoration: underline; text-underline-offset: 4px; text-decoration-thickness: 1px; }

/* ---------------- 遮罩：对话框、底部面板、菜单 ---------------- */
.scrim { position: fixed; inset: 0; z-index: 20; background: var(--scrim); opacity: 0; transition: opacity 0.15s; }
.scrim.open { opacity: 1; }
.dim { display: grid; place-items: center; padding: 16px; }
.dialog { width: min(100%, 440px); max-height: calc(100vh - 32px); max-height: calc(100dvh - 32px); overflow: auto; padding: 22px 22px 18px;
  border: 1px solid var(--line); border-top: 4px solid var(--hi); background: var(--panel); }
.dialog:has(button.danger[type="submit"]) { border-top-color: var(--err); }
.dialog h2 { margin: 0 0 12px; font: 300 27px/1.15 var(--disp); font-stretch: condensed; color: var(--hi); word-break: keep-all; overflow-wrap: anywhere; }
:lang(en) .dialog h2 { font-weight: 400; }
.dialog p { margin: 0 0 16px; color: var(--ink2); line-height: 1.6; font-size: 14.5px; }
.dialog .actions { display: flex; flex-wrap: wrap; justify-content: flex-end; gap: 8px; margin-top: 18px; padding-top: 14px; border-top: 1px dashed var(--line2); }
/* 底部面板：方角白卡，顶上一道 4px 绿线；宽屏上放在中间 */
.sheet { position: absolute; left: 0; right: 0; bottom: 0; max-width: 560px; max-height: 90vh; max-height: 90dvh; margin: 0 auto; overflow: auto;
  padding: 6px 0 calc(14px + env(safe-area-inset-bottom)); border-top: 4px solid var(--hi); background: var(--panel); transform: translateY(100%); transition: transform 0.2s; }
.scrim.open .sheet { transform: none; }
@media (min-width: 760px) {
  .sheet-scrim { display: grid; place-items: center; padding: 24px; }
  .sheet { position: relative; width: 100%; padding-bottom: 14px; border: 1px solid var(--line); border-top: 4px solid var(--hi); transform: translateY(16px); }
}
.grip { display: none; }
.sheet-title { margin: 14px 20px 10px; font: 300 30px/1.1 var(--disp); font-stretch: condensed; color: var(--hi); }
:lang(en) .sheet-title { font-weight: 200; text-transform: uppercase; }
.sheet-text { margin: 0 20px 12px; color: var(--ink2); font-size: 14.5px; line-height: 1.55; }
.sheet-text a { color: var(--hi); }
.sheet-actions { display: flex; flex-wrap: wrap; gap: 8px; padding: 2px 20px 16px; }
.sheet-actions + .sheet-text { padding-top: 16px; border-top: 1px dashed var(--line2); }
.sheet-item, .drawer-item { display: flex; align-items: center; gap: 16px; width: 100%; min-height: 60px; padding: 10px 20px; border: 0; border-top: 1px dashed var(--line2);
  background: none; color: var(--ink); cursor: pointer; text-align: left; text-decoration: none;
  font: 400 20px/1.2 var(--disp); font-stretch: condensed; letter-spacing: 0.01em; }
.sheet-item svg { flex: none; width: 24px; height: 24px; color: var(--hi); }
.sheet-item::after { content: "→"; margin-left: auto; padding-left: 12px; font: 400 18px/1 var(--mono); color: var(--hi); }
.sheet-item:hover, .drawer-item:hover { background: var(--soft); }
.sheet-item:disabled { opacity: 0.4; cursor: default; }
.sheet-title + .sheet-item, .wallet-head + .sheet-text { border-top: 1px solid var(--line2); }
/* 菜单：从右边滑出的绿带，窄体大字，等宽编号 */
.drawer { position: absolute; top: 0; bottom: 0; right: 0; display: flex; flex-direction: column; width: min(88vw, 380px); overflow: auto;
  padding-bottom: env(safe-area-inset-bottom); counter-reset: drawer; transform: translateX(100%); transition: transform 0.2s; }
.scrim.open .drawer { transform: none; }
.drawer-title { display: flex; align-items: center; gap: 8px; min-height: 64px; padding: env(safe-area-inset-top) 6px 0 20px; border-bottom: 1px solid var(--line); }
.drawer-item { counter-increment: drawer; align-items: baseline; min-height: 68px; padding: 18px 20px; border-top: 0; border-bottom: 1px dashed var(--line);
  font-size: 25px; font-weight: 300; }
:lang(en) .drawer-item { font-weight: 200; text-transform: uppercase; letter-spacing: 0.03em; }
.drawer-item::before { content: counter(drawer, decimal-leading-zero); flex: none; width: 26px; font: 400 12px/1 var(--mono); letter-spacing: 0.08em; color: var(--lime); }
.drawer-item svg { display: none; }

/* ---------------- 表单 ---------------- */
.form { max-width: 520px; }
.field { display: flex; flex-direction: column; gap: 6px; margin-bottom: 20px; }
.field > span { font: 500 11.5px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink3); }
.field input, .field select { width: 100%; height: 50px; padding: 0 14px; border: 1px solid var(--line2); border-radius: 0; background: var(--panel); color: var(--ink); font-size: 16px; }
.field select { appearance: none; -webkit-appearance: none; padding-right: 40px; background-image: var(--select); background-repeat: no-repeat; background-position: right 14px center; background-size: 12px 8px; }
.field input:focus, .field select:focus { outline: 2px solid var(--hi); outline-offset: -2px; border-color: var(--hi); }
.field input::placeholder { color: var(--ink3); opacity: 0.8; }
.field select option { background: var(--panel); color: var(--ink); }
.field small { color: var(--ink3); }
.form-error { min-height: 20px; margin: -8px 0 12px; color: var(--err); font-size: 14px; }
.form-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 8px 0 18px; }

/* ---------------- 扫码 ---------------- */
.viewfinder { position: relative; width: min(100%, 420px); aspect-ratio: 1; overflow: hidden; background: #000; }
.cam { width: 100%; height: 100%; object-fit: cover; visibility: hidden; }   /* 画面出来前隐藏：iOS 会给空的 video 画一个大播放键 */
.cam.live { visibility: visible; }
.viewfinder.off .frame { display: none; }
.viewfinder .cam-off { position: absolute; inset: 0; margin: auto; width: 56px; height: 56px; color: rgba(242, 243, 239, 0.45); }
.frame { position: absolute; inset: 14%; border: 2px solid var(--lime); box-shadow: 0 0 0 999px rgba(0, 0, 0, 0.38); }
.scan-hint { margin: 16px 0 6px; color: var(--ink); font-size: 16px; line-height: 1.55; }
.scan-hint.error { color: var(--err); }
.scan-tip { margin: 0 0 12px; padding: 10px 12px; border: 1px dashed var(--line2); color: var(--ink2); font-size: 14px; line-height: 1.55; }
.scan-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 14px 0 18px; }
@media (max-width: 520px) { .scan-actions { flex-direction: column; align-items: stretch; } }

/* ---------------- 转移帐号、链上备份、设置 ---------------- */
.intro { margin: 0 0 14px; color: var(--ink2); line-height: 1.6; }
/* 地址、链接这类不带空格的长串：到边就断开，别把页面撑出横向滚动 */
.body p, .hero .lede, .dialog p, .sheet-text, .notice .grow, .sync-banner .grow, .scan-hint { overflow-wrap: anywhere; }
.menu-list, .check-list { list-style: none; margin: 0; padding: 0; }
.menu-list { border-top: 1px dashed var(--line2); }
.menu-item { display: flex; align-items: center; justify-content: space-between; gap: 16px; width: 100%; padding: 18px 2px; border: 0; border-bottom: 1px dashed var(--line2);
  background: none; color: var(--ink); cursor: pointer; text-align: left; }
.menu-item:hover { background: var(--soft); }
.menu-item b { display: block; font: 300 25px/1.15 var(--disp); font-stretch: condensed; color: var(--hi); }
:lang(en) .menu-item b { font-weight: 400; }
.menu-item small { display: block; margin-top: 6px; color: var(--ink2); font-size: 14px; line-height: 1.5; }
.menu-item svg { flex: none; width: 22px; height: 22px; color: var(--hi); }
.check { display: flex; align-items: center; gap: 14px; min-height: 54px; padding: 10px 2px; border-bottom: 1px dashed var(--line2); cursor: pointer; }
.check > span { min-width: 0; overflow-wrap: anywhere; }
.check.all { border-top: 1px dashed var(--line2); border-bottom: 1px solid var(--line2); font: 400 19px/1.2 var(--disp); font-stretch: condensed; color: var(--hi); }
.check input { appearance: none; -webkit-appearance: none; flex: none; display: grid; place-items: center; width: 22px; height: 22px; margin: 0;
  border: 1px solid var(--line2); border-radius: 0; background: var(--panel); cursor: pointer; }
.check input:checked { background: var(--hi); border-color: var(--hi); }
.check input:checked::after { content: ""; width: 6px; height: 11px; margin-top: -2px; border: solid var(--on-hi); border-width: 0 2px 2px 0; transform: rotate(45deg); }
.bottom-bar { position: sticky; bottom: 0; display: flex; justify-content: flex-end; max-width: 760px; padding: 14px 0 calc(14px + env(safe-area-inset-bottom));
  border-top: 1px solid var(--line); background: var(--bg); }
@media (max-width: 759px) { .bottom-bar { margin: 0 -16px; padding-left: 16px; padding-right: 16px; } }
.export { display: flex; flex-direction: column; align-items: flex-start; gap: 14px; }
.export p { margin: 0; line-height: 1.6; }
.qr { display: block; width: min(100%, 340px); height: auto; padding: 0; border: 1px solid var(--line); background: #fff; image-rendering: pixelated; }
.export .pager { font: 300 44px/1 var(--disp); font-stretch: condensed; letter-spacing: 0.02em; color: var(--hi); font-variant-numeric: tabular-nums; }
.muted { color: var(--ink2); }
.warn { color: var(--err); font-size: 14px; }
.export .warn { padding: 10px 12px; border: 1px solid var(--err); }
.settings { padding: 18px 0 22px; border-bottom: 1px dashed var(--line2); }
.settings:first-child { padding-top: 0; }
.settings h2 { margin: 0 0 14px; font: 300 28px/1.1 var(--disp); font-stretch: condensed; color: var(--hi); }
:lang(en) .settings h2 { font-weight: 200; text-transform: uppercase; }
/* 分段单选：方角、一行，选中的实心 */
.seg { display: inline-flex; flex-wrap: wrap; max-width: 100%; border: 1px solid var(--line2); }
.radio { position: relative; display: block; cursor: pointer; }
.radio + .radio { border-left: 1px solid var(--line2); }
.radio input { position: absolute; inset: 0; width: 100%; height: 100%; margin: 0; opacity: 0; cursor: pointer; }
.radio span { display: flex; align-items: center; min-height: 44px; padding: 0 16px; font: 400 17px/1.2 var(--disp); font-stretch: condensed; letter-spacing: 0.03em; color: var(--ink2); }
.radio input:checked + span { background: var(--hi); color: var(--on-hi); }
.radio input:focus-visible + span { outline: 2px solid var(--hi); outline-offset: 2px; }
.radio:hover span { color: var(--ink); }
.switch-row { display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 2px 0 14px; cursor: pointer; }
.switch-row b { display: block; font: 400 20px/1.2 var(--disp); font-stretch: condensed; }
.switch-row small { display: block; margin-top: 6px; color: var(--ink2); font-size: 14px; line-height: 1.5; }
/* 开关：方角，滑块是小方块 */
.switch { appearance: none; -webkit-appearance: none; flex: none; position: relative; width: 56px; height: 32px; margin: 0; border: 1px solid var(--line2); border-radius: 0;
  background: transparent; cursor: pointer; transition: background 0.15s; }
.switch::after { content: ""; position: absolute; top: 5px; left: 5px; width: 20px; height: 20px; background: var(--ink3); transition: left 0.15s, background 0.15s; }
.switch:checked { background: var(--hi); border-color: var(--hi); }
.switch:checked::after { left: 29px; background: var(--on-hi); }
.row-btn { display: flex; align-items: center; justify-content: space-between; gap: 12px; width: 100%; min-height: 52px; padding: 12px 2px; border: 0; border-top: 1px dashed var(--line2);
  background: none; color: var(--hi); cursor: pointer; text-align: left; text-decoration: none; font: 400 19px/1.2 var(--disp); font-stretch: condensed; letter-spacing: 0.02em; }
.row-btn:hover { background: var(--soft); }
.row-btn svg { flex: none; width: 22px; height: 22px; color: var(--hi); }
.settings .about-link { margin-bottom: 10px; border-bottom: 1px dashed var(--line2); }
.about { margin: 0 0 12px; color: var(--ink2); line-height: 1.6; font-size: 14px; }
.about.mono { padding: 9px 12px; border: 1px dashed var(--line2); color: var(--ink); font: 12.5px/1.55 var(--mono); word-break: break-all; }
.intro.warn, .about.warn { color: var(--err); }
ol.steps { margin: 0 0 16px; padding: 0; list-style: none; counter-reset: step; border-top: 1px dashed var(--line2); }
ol.steps li { counter-increment: step; position: relative; margin: 0; padding: 12px 0 12px 40px; border-bottom: 1px dashed var(--line2); }
ol.steps li::before { content: counter(step, decimal-leading-zero); position: absolute; left: 0; top: 14px; font: 400 12px/1.6 var(--mono); letter-spacing: 0.1em; color: var(--hi); }
.chain { padding-top: 20px; }
.chain:first-child { padding-top: 6px; }
.chain .menu-list { margin-top: 4px; }
.chain .menu-item b { font-family: var(--mono); font-size: 20px; font-weight: 400; letter-spacing: 0.02em; }
.chain .about { margin-bottom: 8px; }
.chain .about .spinner { margin-right: 10px; }
#backup-body > .intro { margin-top: 18px; }

/* ---------------- 锁屏：整屏绿带，页头只有字标 ---------------- */
.screen.center { display: flex; flex-direction: column; }
.center-body { flex: 1; display: flex; align-items: center; padding: 28px var(--pad) 64px; }
.unlock { display: flex; flex-direction: column; align-items: stretch; gap: 14px; width: min(100%, 520px); }
.unlock .big { width: 40px; height: 40px; color: var(--lime); }
.unlock .identicon { outline: 1px solid var(--line2); }
.unlock h1 { margin: 6px 0 0; font: 300 clamp(36px, 9vw, 56px)/1.05 var(--disp); font-stretch: condensed; letter-spacing: -0.005em; word-break: keep-all; overflow-wrap: anywhere; }
:lang(en) .unlock h1 { font-weight: 200; text-transform: uppercase; line-height: 1; }
.unlock p { margin: 0; }
.unlock .muted { color: var(--ink2); font-size: 15.5px; }
.unlock input { height: 52px; padding: 0 14px; border: 1px solid var(--line); border-radius: 0; background: var(--g-deeper); color: #F2F3EF; font-size: 16px; }
.unlock input::placeholder { color: rgba(242, 243, 239, 0.65); }
.unlock input:focus { outline: 2px solid var(--lime); outline-offset: -2px; border-color: var(--lime); }
.unlock .btn { min-height: 52px; }
.unlock .form-error { margin: 0; min-height: 0; }
.unlock .form-error:not(:empty) { padding: 9px 12px; background: #F2F3EF; color: #B3261E; }   /* 绿底上红字看不清：错误放在米白底上 */
.unlock .link { align-self: flex-start; margin-top: 2px; color: var(--lime); }

/* ---------------- 钱包 ---------------- */
.identicon { display: block; border-radius: 0; }
.icon-btn.avatar { padding: 0; }
.wallet-head { display: flex; align-items: center; gap: 14px; padding: 14px 20px 14px; }
.wallet-head .identicon { outline: 1px solid var(--line2); }
.wallet-head b { display: block; font: 400 19px/1.2 var(--mono); letter-spacing: 0.02em; font-variant-numeric: tabular-nums; }
.wallet-head small { display: block; margin-top: 4px; font: 400 11.5px/1.4 var(--mono); letter-spacing: 0.1em; text-transform: uppercase; color: var(--ink3); }
.wallet-head + .sheet-text { padding-top: 14px; }
.wallet-icon { width: 24px; height: 24px; border-radius: 0; }
.sync-banner { display: flex; align-items: center; gap: 12px; min-height: 52px; padding: 6px 6px 6px 14px; border: 1px solid var(--line); background: var(--g-deep);
  color: var(--ink); font-size: 14.5px; line-height: 1.45; }
.sync-banner:empty { display: none; }
.sync-banner > svg { flex: none; width: 20px; height: 20px; color: var(--lime); }
.sync-banner .grow { flex: 1; min-width: 0; padding: 6px 0; }
.sync-banner .btn { flex: none; min-height: 40px; padding: 0 16px; }
/* 等待中：转动的小方块 */
.spinner { flex: none; display: inline-block; width: 14px; height: 14px; margin-right: 8px; vertical-align: -2px;
  border: 2px solid color-mix(in srgb, var(--hi) 28%, transparent); border-top-color: var(--hi); animation: spin 0.9s linear infinite; }
.sync-banner .spinner { margin: 0 2px; }
@keyframes spin { to { transform: rotate(360deg); } }
.chain .about.warn { color: var(--err); }

/* ---------------- 提醒（内置浏览器、时钟、数据可能被清……）：方角卡片，顶上一道红线；在绿带里是深绿卡片、黄绿线 ---------------- */
.notice { display: flex; align-items: flex-start; gap: 12px; margin: 0 0 12px; padding: 11px 4px 11px 14px; border: 1px solid var(--line); border-top: 3px solid var(--err);
  background: var(--panel); color: var(--ink); font-size: 14px; line-height: 1.55; }
.notice > svg { flex: none; width: 20px; height: 20px; margin-top: 1px; color: var(--err); }
.notice .grow { flex: 1; min-width: 0; }
.notice .icon-btn { margin: -8px 0 -8px; }
.notice .btn { flex: none; align-self: center; }

/* ---------------- 底部提示条 ---------------- */
#snackbar { position: fixed; left: 50%; bottom: calc(24px + env(safe-area-inset-bottom)); z-index: 30; width: max-content; max-width: min(100vw - 32px, 560px);
  padding: 13px 18px; border-left: 4px solid var(--snack-edge); background: var(--snack-bg); color: var(--snack-fg); font-size: 14.5px; line-height: 1.45;
  transform: translate(-50%, 20px); opacity: 0; pointer-events: none; transition: opacity 0.15s, transform 0.15s; }
#snackbar.show { transform: translate(-50%, 0); opacity: 1; }
#snackbar.top { bottom: auto; top: calc(16px + env(safe-area-inset-top)); }

@media (prefers-reduced-motion: reduce) {
  * { transition: none !important; animation: none !important; }
}

/* 预览器里的说明：正常加载时不显示（见 index.html / about.html） */
.preview-note { display: none; }
