/* 界面层 · 共用部件：（一）不带行为的部件——按钮五级、状态签、输入与筛选、页签、表格基础、坞轨；（二）带行为的部件——遮罩与抽屉、凭据与验证码、命令面板、确认框、提示条、墨印。
   配色：只用 tokens.css 的 var(--…)。平时只有纸、墨、灰；朱红（--accent）只给主按钮，绿（--ok）只给健康圆点；圆角 0（只有健康圆点、待复活圆环是圆的），没有模糊阴影；过渡与动画都在 ui/motion.css。
   同一个选择器的基础规则写在它的 @media 变体之前；窄屏覆盖集中在文件末尾。 */

/* ============ 按钮：主按钮每屏 0 或 1 个，朱红实底白字（纸面上、墨带上同一个颜色）——全页唯一的一块朱红，眼睛一下就落到该点的地方 ============ */
.btn { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 36px; padding: 0 14px; border: 0; background: var(--paper-3); color: var(--ink); font-size: 14px; font-weight: 500; line-height: 1; text-decoration: none; white-space: nowrap; }
/* P1 要按的（纸面上，如确认框里的「确定」）：墨实底、纸色字、3px 灰压印底（和墨底分得开）+ 虚线隔出的箭头格 */
.btn-p1 { position: relative; min-height: 44px; padding: 0 16px; background: var(--accent); border: 0; color: var(--on-accent); font-size: 16px; font-weight: 600; box-shadow: 3px 3px 0 var(--line); }
.btn-p1 .btn-arrow { align-self: stretch; display: inline-flex; align-items: center; margin-left: 6px; padding-left: 14px; border-left: 1px dashed rgba(247, 245, 240, .62); font-family: var(--mono); }
.btn-p1 b { font: 500 1.06em/1 var(--mono); }
.btn-p1:hover { background: var(--accent-h); box-shadow: 4px 4px 0 var(--line); transform: translate(-1px, -1px); }
.btn-p1:active { background: var(--accent-p); box-shadow: 1px 1px 0 var(--line); transform: translate(2px, 2px); }
/* 不可按 = 虚线空槽，不是变淡的墨块 */
.btn-p1:disabled, .btn-p1:disabled:hover { background: var(--paper-3); color: var(--ink-46); box-shadow: none; transform: none; opacity: 1; outline: 1px dashed var(--line); outline-offset: -1px; }
.btn-p1:disabled .btn-arrow { border-left-color: var(--line); }
/* 办理中：灰底（--ink-3）+ 一层斜纹（走动由 ui/motion.css 负责）；同时带 disabled 时仍画成办理中 */
.btn-p1.is-busy, .btn-p1.is-busy:hover, .btn-p1.is-busy:active, .btn-p1.is-busy:disabled { background: var(--ink-3); color: var(--on-ink); box-shadow: none; transform: none; outline: 0; overflow: hidden; }
.btn-p1.is-busy::after { content: ""; position: absolute; inset: 0 -40px; background: repeating-linear-gradient(115deg, rgba(247, 245, 240, .22) 0 10px, transparent 10px 20px); pointer-events: none; }
.btn-p1.is-busy .btn-arrow { border-left-color: var(--on-ink-30); }   /* 灰底上的箭头格：纸色虚线 */
.btn-xl { min-height: 60px; width: 100%; padding: 0 22px; font-size: 16px; justify-content: space-between; }
/* P2 次操作：亮纸底 + 2px 墨色描边、墨字，没有压印底；指上去反成墨底纸字。让位的主按钮是灰框（指上去框变墨） */
.btn-p2, .btn-p1.is-demoted { min-height: 36px; background: var(--paper-hi); border: 2px solid var(--ink); color: var(--ink); font-weight: 600; box-shadow: none; }
.btn-p2:hover, .btn-p1.is-demoted:hover { background: var(--ink); border-color: var(--ink); color: var(--on-ink); transform: none; }
.btn-p2:active { background: var(--ink-deep); border-color: var(--ink-deep); color: var(--on-ink); }
.btn-p2:disabled, .btn-p2:disabled:hover, .btn-p2:disabled:active { background: transparent; border-color: var(--line); border-style: dashed; color: var(--ink-46); }
.btn-p1.is-demoted { background: transparent; border-color: var(--dash); color: var(--ink); font-weight: 500; }
.btn-p1.is-demoted .btn-arrow { border-left-color: var(--dash); }
/* P3 行内：无框、中性灰底、墨字、3px 墨色下划线；指上去整块反成墨底 */
.btn-p3 { min-height: 32px; padding: 0 12px; background: var(--paper-3); border: 0; border-bottom: 3px solid var(--ink); color: var(--ink); font-size: 13px; font-weight: 600; }
.btn-p3:hover { background: var(--ink); color: var(--on-ink); }
.btn-p3:active { background: var(--ink); color: var(--on-ink); }
.btn-p3:disabled, .btn-p3:disabled:hover, .btn-p3:disabled:active { background: var(--paper-3); color: var(--ink-46); border-bottom: 3px dashed var(--line); }
/* 危险：暖灰底、2px 墨框、深朱砂字、前置 ×；指上去是亮纸底 + 朱砂框，不铺朱砂实底 */
.btn-danger { background: var(--paper-3); border: 2px solid var(--ink); color: var(--cinnabar-d); font-weight: 600; }
.btn-danger::before { content: "×"; font: 500 16px/1 var(--mono); margin-right: 2px; }
.btn-danger:hover { background: var(--paper-hi); border-color: var(--cinnabar); color: var(--cinnabar-d); }
.btn-danger:disabled, .btn-danger:disabled:hover { background: var(--paper-3); border: 2px dashed var(--line); color: var(--ink-46); }
/* 最弱：透明、点线下划线 */
.btn-ghost { background: transparent; color: var(--ink-74); font-weight: 500; text-decoration: underline dotted var(--ink-46); text-underline-offset: 5px; }
.btn-ghost:hover { background: var(--paper-3); color: var(--ink); }
.btn:disabled { opacity: 1; }
/* 已复制：纸面上 = 墨实底 + 纸色勾（墨带上见「坞轨」一节） */
.btn.is-copied, .btn.is-copied:hover, .btn-p1.is-copied, .btn-p1.is-copied:hover, .btn-p2.is-copied, .btn-p2.is-copied:hover, .btn-p3.is-copied, .btn-p3.is-copied:hover { background: var(--ink); border-color: var(--ink); color: var(--on-ink); box-shadow: none; transform: none; }
.btn.is-copied .btn-text::before, .cred-btn.is-copied .btn-text::before { content: ""; display: inline-block; width: 11px; height: 6px; margin: 0 8px 3px 0; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }

/* ============ 状态签：健康五态形状都不同，只有「有事」的两种着色；分配状态弱一档 ============ */
.health { display: inline-flex; align-items: center; height: 22px; gap: 6px; vertical-align: middle; font-size: 12px; font-weight: 600; line-height: 22px; white-space: nowrap; }
.health-mark { position: relative; width: 10px; height: 10px; flex: none; background: none; }
.health[data-health="healthy"] { color: var(--ink-74); font-weight: 500; }   /* 健康是常态：字不加重 */
.health[data-health="healthy"] .health-mark { background: var(--ok); border-radius: 50%; }
.health[data-health="need_revival"] { color: var(--amber); }
.health[data-health="need_revival"] .health-mark { border: 3px solid var(--amber); border-radius: 50%; }
.health[data-health="manual"] { padding: 0 8px 0 7px; background: var(--cinnabar); color: var(--on-ink); }
.health[data-health="manual"] .health-mark { width: 8px; height: 8px; background: var(--on-ink); transform: rotate(45deg); }
.health[data-health="dead"] { padding: 0 8px 0 7px; background: var(--stop-bg); color: var(--stop-ink); box-shadow: inset 0 0 0 1px var(--line); }
.health[data-health="dead"] .health-mark::before, .health[data-health="dead"] .health-mark::after { content: ""; position: absolute; left: -1px; top: 4px; width: 12px; height: 2px; background: var(--stop-ink); transform: rotate(45deg); }
.health[data-health="dead"] .health-mark::after { transform: rotate(-45deg); }
.health[data-health="unknown"] { color: var(--ink-64); font-weight: 500; }
.health[data-health="unknown"] .health-mark { border: 2px dashed var(--ink-64); }
/* 分配状态：只是带小竖线的字；冻结 = 灰虚线色竖线 + 墨字 + 淡墨斜纹；待分配不出节点 */
.status { display: inline-block; margin-left: 10px; padding-left: 7px; font-size: 12px; line-height: 16px; color: var(--ink-64); opacity: 1; border-left: 2px solid var(--line); vertical-align: middle; }
.status[data-status="frozen"] { padding-right: 6px; border-left-color: var(--dash); color: var(--ink); background: repeating-linear-gradient(135deg, rgba(30, 30, 28, .12) 0 3px, transparent 3px 6px); }
.status[data-status="invalid"] { text-decoration: line-through; color: var(--ink-46); }

/* ============ 输入与筛选：亮纸底 + 灰线 + 2px 墨色底线；指上去变白、底线加粗一档 ============ */
.filters { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; padding: 12px 0 10px; }
.search { position: relative; flex: 1 1 240px; max-width: 340px; display: flex; }
.search input, .sel, .inp { min-height: 36px; border: 0; border-bottom: 2px solid var(--ink); background-color: var(--paper-hi); box-shadow: inset 1px 0 0 var(--line), inset -1px 0 0 var(--line), inset 0 1px 0 var(--line); font-size: 13px; }
.search input { width: 100%; padding: 0 36px 0 12px; }
.inp { padding: 0 12px; }
textarea.inp { padding-top: 8px; padding-bottom: 8px; }
.search input::placeholder, .inp::placeholder { color: var(--ink-46); }
.search kbd { position: absolute; right: 10px; top: 50%; transform: translateY(-50%); opacity: 1; }
.sel { padding: 0 6px 0 10px; color: var(--ink); cursor: pointer; }
.search input:hover, .sel:hover, .inp:hover { background-color: #fff; box-shadow: inset 1px 0 0 var(--line), inset -1px 0 0 var(--line), inset 0 1px 0 var(--line), inset 0 -1px 0 var(--ink); }
.search input:disabled, .sel:disabled, .inp:disabled, .search input:disabled:hover, .sel:disabled:hover, .inp:disabled:hover { background-color: var(--paper-3); color: var(--ink-46); border-bottom: 2px dashed var(--line); box-shadow: inset 1px 0 0 var(--line), inset -1px 0 0 var(--line), inset 0 1px 0 var(--line); cursor: not-allowed; }
/* 带标题的一格：标题 12px 灰字在上，输入框在下 */
.field { display: flex; flex-direction: column; gap: 4px; }
.field-k { font-size: 12px; color: var(--ink-64); }
.count { margin-left: auto; font-size: 13px; color: var(--ink-64); opacity: 1; }
/* 筛选签：生效的筛选是「当前」= 墨底纸字，「×」是一个 18% 纸色的小格；「清除全部」是墨字下划线 */
.chips { display: flex; gap: 6px; flex-wrap: wrap; padding-bottom: 10px; }
.chip { display: inline-flex; align-items: center; gap: 6px; min-height: 28px; padding: 0 4px 0 10px; border: 0; background: var(--ink); color: var(--on-ink); box-shadow: none; font-size: 13px; font-weight: 600; cursor: pointer; }
.chip i { display: grid; place-items: center; width: 22px; height: 22px; font: 500 16px/1 var(--mono); background: rgba(247, 245, 240, .18); color: var(--on-ink); }
.chip:hover { background: var(--ink-deep); }
.chip-clear { padding: 0 10px; background: transparent; color: var(--ink); box-shadow: none; text-decoration: underline; text-underline-offset: 4px; }
.chip-clear:hover { background: var(--paper-3); }

/* ============ 页签：账本的索引签；当前签墨底纸字、高出一截，整排底下一条 2px 墨线 ============ */
.tabs { display: flex; gap: 4px; align-items: flex-end; padding-top: 2px; border-bottom: 2px solid var(--ink); overflow-x: auto; }
.tab { position: relative; display: inline-flex; align-items: center; gap: 10px; height: 40px; padding: 0 16px 0 18px; border: 0; background: var(--paper-2); color: var(--ink-74); box-shadow: inset 0 0 0 1px var(--line), inset 0 -1px 0 var(--paper-2); font-size: 14px; line-height: 1; white-space: nowrap; cursor: pointer; }
.tab-num { font: 500 20px/1 var(--mono); color: var(--ink); }
.tab:hover { background: var(--paper-3); color: var(--ink); }
.tab.is-current, .tab.is-current:hover { height: 46px; padding: 0 20px; background: var(--ink); color: var(--on-ink); font-weight: 600; box-shadow: none; }
.tab.is-current .tab-num { color: var(--on-ink); }
.tab.is-current ::selection { background: var(--on-ink); color: var(--ink); }   /* 墨底上的选区反过来 */

/* ============ 表格基础：账页（列宽、勾选格、行状态归 ui/console.css） ============ */
.table-wrap { position: relative; isolation: isolate; overflow: clip; border: 0; background: var(--paper-hi); box-shadow: inset 0 -1px 0 var(--line); }
.grid { width: 100%; table-layout: fixed; border-collapse: separate; border-spacing: 0; font-variant-numeric: tabular-nums; }
.grid th, .grid td { padding: 0 10px; text-align: left; vertical-align: middle; border-bottom: 1px solid var(--line-2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grid th { position: sticky; top: var(--top-h); z-index: 3; height: 34px; background: var(--paper-3); color: var(--ink-74); font-size: 12px; font-weight: 600; border-bottom: 1px solid var(--line); }
.grid td { height: 40px; line-height: 39px; vertical-align: top; font-size: 13px; }
.row { cursor: pointer; }
.row:hover { background: var(--paper-2); }
.empty { display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 6px; padding: 44px 18px; color: var(--ink-64); }
.empty b { font-size: 16px; color: var(--ink); }
.more { display: flex; align-items: center; justify-content: center; gap: 10px; padding: 14px; background: var(--paper); }

/* ============ 坞轨：永远在下沿的墨带——读数 + 本屏唯一的主按钮 + 提示 + 最近推送 ============ */
.m-rail { position: fixed; left: var(--rail-x); right: 0; bottom: 0; z-index: 15; height: var(--rail-h); display: flex; align-items: center; padding: 0 var(--rail-pad); background: var(--ink); color: var(--on-ink); }
.m-rail-count { flex: 0 0 var(--count-w); display: flex; align-items: baseline; gap: 10px; min-width: 0; white-space: nowrap; }
.m-rail-n { font: 500 36px/1 var(--mono); color: var(--on-ink); }
.m-rail-unit { font-size: 13px; color: var(--on-ink-64); }
.m-rail-slot { display: flex; flex: 0 0 236px; height: 44px; }
.m-rail-slot > .btn { width: 100%; min-height: 44px; justify-content: space-between; }
.m-rail-hint { margin-left: 24px; font-size: 13px; color: var(--on-ink-64); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.m-rail-hint b { color: var(--on-ink); font-weight: 600; }
.m-rail-last { margin-left: auto; padding-left: 20px; display: flex; align-items: baseline; gap: 10px; white-space: nowrap; font-size: 13px; color: var(--on-ink-64); }
.m-rail-last b { font-size: 14px; font-weight: 600; color: var(--on-ink); }
.m-rail-last i { font-style: normal; display: inline-block; padding: 3px 7px; margin-right: 6px; background: var(--on-ink); color: var(--ink); font: 500 13px/1 var(--mono); }   /* 墨带上的新到签反过来：纸底墨字 */
/* 墨带上的主按钮：朱红实底白字，箭头格用一条浅色虚线隔开；压印底是墨带上的一层灰（30% 的纸色） */
.m-rail .btn-p1 { background: var(--accent); color: var(--on-accent); box-shadow: 3px 3px 0 var(--on-ink-30); }
.m-rail .btn-p1:hover { background: var(--accent-h); box-shadow: 4px 4px 0 var(--on-ink-30); }
.m-rail .btn-p1:active { background: var(--accent-p); box-shadow: 1px 1px 0 var(--on-ink-30); }
/* 墨带上还不能按的主按钮：一个空的虚线槽 */
.m-rail .btn-p1:disabled, .m-rail .btn-p1:disabled:hover, .m-rail .btn-p1:disabled:active { background: transparent; color: var(--on-ink-64); box-shadow: none; outline: 1px dashed var(--on-ink-30); outline-offset: -1px; }
.m-rail .btn-p1:disabled .btn-arrow { border-left-color: var(--on-ink-30); }
/* 墨带上正在办的：和纸面上同一种画法（--ink-3 灰底 + 斜纹），「不可按」压不过它 */
.m-rail .btn-p1.is-busy, .m-rail .btn-p1.is-busy:hover, .m-rail .btn-p1.is-busy:active, .m-rail .btn-p1.is-busy:disabled { background: var(--ink-3); color: var(--on-ink); box-shadow: none; outline: 0; }
.m-rail .btn-p1.is-busy .btn-arrow { border-left-color: var(--on-ink-30); }
/* 让位的主按钮：淡纸色细框透明底；指上去反成纸色实底墨字；同时又不能按时仍是 64% 纸色字，指上去也不反白 */
.m-rail .btn-p1.is-demoted { background: transparent; border: 2px solid var(--on-ink-30); color: var(--on-ink); box-shadow: none; font-size: 14px; font-weight: 500; }
.m-rail .btn-p1.is-demoted .btn-arrow { border-left-color: var(--on-ink-30); }
.m-rail .btn-p1.is-demoted:hover { background: var(--on-ink); border-color: var(--on-ink); color: var(--ink); transform: none; }
.m-rail .btn-p1.is-demoted:disabled, .m-rail .btn-p1.is-demoted:disabled:hover, .m-rail .btn-p1.is-demoted:disabled:active { background: transparent; border-color: var(--on-ink-30); color: var(--on-ink-64); box-shadow: none; }
/* 墨带上的其余按钮：次按钮 = 纸色描边，最弱 = 淡纸色下划线 */
.m-rail .btn-p2 { min-height: 40px; padding: 0 16px; background: transparent; border: 2px solid var(--on-ink); color: var(--on-ink); }
.m-rail .btn-p2:hover { background: var(--on-ink); border-color: var(--on-ink); color: var(--ink); }
.m-rail .btn-p2:disabled, .m-rail .btn-p2:disabled:hover { background: transparent; border-color: var(--on-ink); border-style: dashed; color: var(--on-ink-64); }
.m-rail .btn-ghost { color: var(--on-ink-64); border: 0; text-decoration-color: var(--on-ink-30); }
.m-rail .btn-ghost:hover { background: rgba(247, 245, 240, .12); color: var(--on-ink); }
/* 已复制（墨带上）：透明底 + 2px 纸色描边 + 纸色勾，不像被禁用的灰块 */
.m-rail .btn.is-copied, .m-rail .btn.is-copied:hover { background: transparent; color: var(--on-ink); box-shadow: inset 0 0 0 2px var(--on-ink); }
/* 落在墨带上的文字与控件：选区、焦点框反过来用纸色 */
.m-rail ::selection { background: var(--on-ink); color: var(--ink); }
.m-rail :focus-visible { outline-color: var(--on-ink); }

/* ============ 遮罩与抽屉：层叠次序定死——遮罩 50、抽屉 60、命令面板 70、确认框 80、提示条 90（坞轨是 15） ============ */
.scrim { position: fixed; inset: 0; z-index: 50; background: rgba(30, 30, 28, .44); }
/* 抽屉：贴右、亮纸底，左缘一道 6px 实墨硬边；头与脚是灰纸底 + 2px 墨线，体可滚动 */
.drawer { position: fixed; top: 0; right: 0; bottom: 0; z-index: 60; width: min(500px, 100vw); display: flex; flex-direction: column; background: var(--paper-hi); border-left: 0; box-shadow: -6px 0 0 var(--ink); }
.drawer-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 12px; padding: 16px 20px 14px 22px; background: var(--paper-3); border-bottom: 2px solid var(--ink); }
.drawer-title { min-width: 0; }
.drawer-kicker { font-size: 12px; color: var(--ink-64); }
.drawer-head h2 { font: 500 20px/1.3 var(--mono); }
.drawer-state { margin-top: 8px; }
.drawer-body { flex: 1 1 auto; overflow-y: auto; display: flex; flex-direction: column; gap: 18px; padding: 16px 20px 20px 22px; }
/* 结果条：成功 = 灰底 + 墨条 + 墨字，前面一个墨色的勾（形状代替颜色）；失败 = 灰底 + 朱砂条 + 深朱砂字（不铺红） */
.drawer-result { padding: 10px 12px 10px 16px; font-size: 13px; font-weight: 600; }
.drawer-result[data-ok="1"] { background: var(--paper-2); box-shadow: inset 5px 0 0 var(--ink); color: var(--ink); }
.drawer-result[data-ok="1"]::before { content: ""; display: inline-block; width: 11px; height: 6px; margin: 0 9px 3px 1px; border-left: 2px solid currentColor; border-bottom: 2px solid currentColor; transform: rotate(-45deg); }
.drawer-result[data-ok="0"] { background: var(--paper-2); box-shadow: inset 5px 0 0 var(--cinnabar); color: var(--cinnabar-d); }
/* 点线引导的键值表：两列；临期那一格不铺底，只有琥珀竖条和琥珀字 */
.facts { display: grid; grid-template-columns: 1fr 1fr; gap: 0 22px; }
.fact { display: flex; align-items: baseline; gap: 8px; min-height: 34px; padding: 6px 0; font-size: 13px; }
.fact dt { order: 1; flex: none; font-size: 12px; color: var(--ink-64); }
.fact::after { content: ""; order: 2; flex: 1 1 12px; min-width: 12px; border-bottom: 2px dotted var(--line); transform: translateY(-3px); }
.fact dd { order: 3; flex: 0 1 auto; min-width: 0; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fact dd code { font-size: 12px; }
.fact.is-urgent dd { padding: 1px 7px; box-shadow: inset 3px 0 0 var(--amber); color: var(--amber-d); font-weight: 600; }
.drawer-sec h3 { margin-bottom: 8px; padding-top: 10px; border-top: 2px solid var(--ink); font-size: 14px; font-weight: 600; }
.drawer-acts { display: flex; flex-wrap: wrap; gap: 8px; padding: 14px 20px 14px 22px; background: var(--paper-3); border-top: 2px solid var(--ink); }
.drawer-acts .btn-danger { margin-left: auto; }

/* ============ 凭据与验证码：三行凭据（行间点线），下面一块墨底的实时验证码，底边是倒计时 ============ */
.creds { display: flex; flex-direction: column; gap: 0; }
.cred { position: relative; display: flex; align-items: center; gap: 8px; min-height: 44px; border-bottom: 1px dotted var(--line); }   /* relative：揭开的动效在行里定位 */
.cred-k { flex: 0 0 76px; font-size: 12px; color: var(--ink-64); }
.cred-v { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font: 500 14px/1.4 var(--mono); color: var(--ink); }
.cred-v.is-masked { color: var(--ink-46); font-weight: 400; }
.cred-btn { min-height: 30px; padding: 0 10px; font-size: 13px; }
.totp { position: relative; display: flex; align-items: center; flex-wrap: wrap; gap: 4px 12px; min-height: 76px; margin-top: 12px; padding: 12px 14px 16px 16px; background: var(--ink); color: var(--on-ink); overflow: hidden; }
.totp .cred-k { flex: 1 0 100%; color: var(--on-ink-64); }
.totp-code { font: 500 36px/1 var(--mono); letter-spacing: .02em; color: var(--on-ink); }
.totp-ring { position: absolute; left: 0; right: 0; bottom: 0; height: 6px; flex: none; background: var(--on-ink-30); }
.totp-ring i { display: none; }
/* 倒计时：浅灰条（用纸色会和墨块下面的纸底连成一片）；长度由 --totp（0–1）决定；剩 5 秒起变琥珀 */
.totp-ring::after { content: ""; position: absolute; inset: 0; background: var(--line); transform-origin: 0 50%; transform: scaleX(var(--totp, 1)); }
.totp-left { margin-left: auto; font: 500 16px/1 var(--mono); color: var(--on-ink); white-space: nowrap; }
.totp-next { order: 5; flex: 1 0 100%; padding-top: 6px; font: 500 13px/1 var(--mono); color: var(--amber-hi); white-space: nowrap; }
/* 墨底上的复制：透明底、纸色字、纸色下划线；指上去纸色实底墨字；已复制 = --ink-3 灰块 + 纸色勾，下沿 3px 是墨线 */
.totp .cred-btn { background: transparent; color: var(--on-ink); border-bottom-color: var(--on-ink); }
.totp .cred-btn:hover { background: var(--on-ink); color: var(--ink); }
.totp .cred-btn.is-copied, .totp .cred-btn.is-copied:hover { background: var(--ink-3); border-color: var(--ink); color: var(--on-ink); }
.totp[data-left="5"] .totp-ring::after, .totp[data-left="4"] .totp-ring::after, .totp[data-left="3"] .totp-ring::after, .totp[data-left="2"] .totp-ring::after, .totp[data-left="1"] .totp-ring::after { background: var(--amber-hi); }
.totp[data-left="5"] .totp-left, .totp[data-left="4"] .totp-left, .totp[data-left="3"] .totp-left, .totp[data-left="2"] .totp-left, .totp[data-left="1"] .totp-left { color: var(--amber-hi); }
/* 算不出验证码：块的大小不变，只留一句纸色的说明（码、倒计时、复制由 kit.js 用 hidden 收起） */
.totp[data-state="off"] .cred-k { display: none; }
.totp[data-state="wait"] .totp-code { color: var(--on-ink-64); }
.totp-fallback { flex: 1 0 100%; color: var(--on-ink); font-size: 14px; line-height: 1.6; }
/* 墨底上的焦点框与选区反过来用纸色 */
.totp :focus-visible { outline-color: var(--on-ink); }
.totp ::selection { background: var(--on-ink); color: var(--ink); }

/* ============ 命令面板：内容靠上的亮纸框，2px 墨框 + 8px 实墨硬投影；当前项墨实底纸字 ============ */
.palette { position: fixed; inset: 0; z-index: 70; display: flex; justify-content: center; align-items: flex-start; padding-top: 13vh; }
.palette-box { width: min(640px, calc(100vw - 32px)); background: var(--paper-hi); border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); }
.palette-input { width: 100%; min-height: 58px; padding: 0 18px; border: 0; border-bottom: 2px solid var(--ink); background: transparent; font-size: 16px; caret-color: var(--ink); outline: none; }
.palette-input::placeholder { color: var(--ink-46); }
.palette-list { max-height: 46vh; overflow-y: auto; }
.palette-item { display: flex; align-items: center; gap: 12px; min-height: 44px; padding: 0 16px 0 14px; border-bottom: 1px solid var(--line-2); font-size: 14px; cursor: pointer; }
.pi-k { flex: 0 0 44px; padding: 3px 0; text-align: center; font-size: 12px; font-weight: 600; color: var(--ink-74); background: var(--paper-3); }
.pi-t { font-weight: 500; }
.pi-sub { font-size: 12px; color: var(--ink-64); }
.palette-item kbd { margin-left: auto; opacity: 0; }
.palette-item.is-active { background: var(--ink); color: var(--on-ink); }
.palette-item.is-active .pi-k { background: var(--on-ink); color: var(--ink); }
.palette-item.is-active .pi-sub { color: rgba(247, 245, 240, .8); }
.palette-item.is-active kbd { opacity: 1; background: var(--ink-deep); border-color: var(--dash); color: var(--on-ink); }
.palette-item.is-active ::selection { background: var(--on-ink); color: var(--ink); }   /* 墨底上的选区反过来 */
.palette-empty, .palette-foot { padding: 10px 16px; font-size: 12px; color: var(--ink-64); }
.palette-foot { background: var(--paper-3); }
.palette-foot kbd { margin: 0 3px; }

/* ============ 确认框：居中的亮纸框；框里的「是」是纸面上的主按钮，那一刻它是唯一的主按钮 ============ */
.confirm { position: fixed; inset: 0; z-index: 80; display: flex; align-items: center; justify-content: center; padding: 16px; background: rgba(30, 30, 28, .5); }
.confirm-box { width: min(460px, 100%); display: flex; flex-direction: column; gap: 10px; padding: 22px 24px 20px; background: var(--paper-hi); border: 2px solid var(--ink); box-shadow: 8px 8px 0 var(--ink); }
.confirm-box h2 { font-size: 20px; font-weight: 600; }
.confirm-body { font-size: 14px; line-height: 1.7; color: var(--ink-74); white-space: pre-line; }
.confirm-acts { display: flex; justify-content: flex-end; gap: 24px; margin-top: 12px; }
.confirm-acts .btn { min-height: 44px; }
/* 确认框开着时坞轨上的主按钮让位：纸色细框、透明底（.btn-p1 本身没有框，框的三项分开写） */
html:has(.confirm:not([hidden])) .m-rail .btn-p1 { background: transparent; border-width: 2px; border-style: solid; border-color: var(--on-ink-64); color: var(--on-ink); box-shadow: none; }
html:has(.confirm:not([hidden])) .m-rail .btn-p1 .btn-arrow { border-left-color: var(--on-ink-30); }

/* ============ 提示条：在坞轨上方水平居中；墨底纸字 + 灰色硬投影；彩色只做小记号 ============ */
.toasts, .toast-region { position: fixed; left: 50%; bottom: calc(var(--rail-h) + 20px); transform: translateX(-50%); z-index: 90; display: flex; flex-direction: column; align-items: center; gap: 8px; pointer-events: none; }
.toast { pointer-events: auto; display: flex; align-items: center; gap: 12px; max-width: min(520px, calc(100vw - 32px)); padding: 12px 16px; background: var(--ink); color: var(--on-ink); font-size: 14px; line-height: 22px; box-shadow: 4px 4px 0 var(--line); }
/* 提示条什么时候都接点击，确认框开着时也一样：不让点击穿过它落到底下。提示条摞到确认框的按钮上时（见下面窄屏那一条），
   被盖住的按钮是看不见的——点击要是穿得过去，点到的可能正是那颗看不见的「是」。宁可等提示条自己收掉再点 */
/* 撤销：墨底上的纸色下划线按钮 */
.toast-btn { min-height: 28px; background: transparent; color: var(--on-ink); border-bottom: 3px solid var(--on-ink); }
.toast-btn:hover { background: var(--on-ink); color: var(--ink); }
/* 到账：墨底，左边一道 5px 纸色竖条，字粗一档 */
.toast-arrival { background: var(--ink); box-shadow: inset 5px 0 0 var(--on-ink), 4px 4px 0 var(--line); font-weight: 600; }
/* 出错（kit.js 的 .toast-error 与旧脚本的 .toast.error）：墨底纸字，最前面一个朱砂底的「×」格，贴着左缘、上下占满；
   1px 纸色细线把朱砂格和墨底分开（朱砂对墨只有 2.20:1） */
.toast-error, .toast.error { display: flex; align-items: center; gap: 12px; padding-left: 0; background: var(--ink); }
.toast-error::before, .toast.error::before { content: "×"; flex: none; align-self: stretch; display: grid; place-items: center; width: 44px; margin: -12px 0; background: var(--cinnabar); color: var(--on-ink); font: 500 20px/1 var(--mono); box-shadow: 0 0 0 1px var(--on-ink-64); }
/* 墨底上的焦点框与选区反过来用纸色 */
.toast :focus-visible { outline-color: var(--on-ink); }
.toast ::selection { background: var(--on-ink); color: var(--ink); }

/* ============ 墨印（class 仍叫 .m-seal）：出票 / 兑换成功留下的印迹；静态终态就是 78% 墨量的这一枚。
   印面墨底、纸色字、内圈一道纸色细框；放它的容器自己 position: relative 并在上方让出位置 ============ */
.m-seal { position: absolute; right: 24px; top: -34px; width: 148px; height: 148px; pointer-events: none; transform: rotate(-4deg); }
.m-seal i { position: absolute; inset: 0; font-style: normal; }
.m-seal .m-seal-face { display: grid; place-content: center; justify-items: center; gap: 4px; color: var(--on-ink); background: var(--ink); box-shadow: inset 0 0 0 7px var(--ink), inset 0 0 0 9px var(--on-ink); }
.m-seal small { font: 600 16px/1 var(--sans); letter-spacing: .12em; margin-right: -.12em; }
.m-seal b { font: 500 64px/1 var(--mono); letter-spacing: -.02em; }
.m-seal em { font: 600 13px/1 var(--sans); font-style: normal; }
.m-seal > .m-seal-print { -webkit-mask: url("../img/seal-mask.webp?v=1") 0 0 / 148px 148px, linear-gradient(rgba(0, 0, 0, .62), rgba(0, 0, 0, .62)); -webkit-mask-composite: source-over; mask: url("../img/seal-mask.webp?v=1") 0 0 / 148px 148px, linear-gradient(rgba(0, 0, 0, .62), rgba(0, 0, 0, .62)); mask-composite: add; }
/* 这三层平时看不见，只在砸下的动画里出现 */
.m-seal > .m-seal-solid { overflow: hidden; opacity: 0; }
.m-seal > .m-seal-shadow { background: var(--ink); opacity: 0; }
.m-seal > .m-seal-ring { border: 3px solid var(--ink); opacity: 0; }

/* ============ 窄屏（≤760）：坞轨只留读数和主按钮；页签同高；输入控件 44 高、16px ============ */
@media (max-width: 760px) {
  .m-rail-hint, .m-rail-last { display: none; }
  .m-rail-n { font-size: 28px; }
  .m-rail-count { gap: 6px; }
  .m-rail-unit { font-size: 12px; }
  .m-rail-slot { flex: 1 1 auto; }
  .tabs { scrollbar-width: none; }
  .tab, .tab.is-current, .tab.is-current:hover { flex: none; height: 44px; }   /* 连同指着的当前签：否则基础规则里的 :hover 更具体，会长回 46px */
  .search { flex: 1 1 100%; max-width: none; }
  .search input, .sel, .inp { min-height: 44px; font-size: 16px; }   /* 手机上的输入控件一律 16px：小于 16px 时 iOS 会在聚焦时把页面放大 */
  .sel { flex: 1 1 calc(50% - 4px); min-width: 0; }
  .count { flex: 1 1 100%; margin-left: 0; }
  /* 抽屉与凭据：抽屉占满整屏、没有左缘硬边；键值表一列；按钮不矮于 44 */
  .drawer { width: 100vw; box-shadow: none; }
  .drawer-head { padding: 14px 16px 12px; }
  .drawer-body { padding: 14px 16px 18px; }
  .facts { grid-template-columns: minmax(0, 1fr); }
  .drawer-acts { padding: 10px 16px; }
  .drawer-acts .btn { min-height: 44px; }
  .cred-k { flex-basis: 60px; }
  .cred-btn { min-height: 44px; }
  .cred-v:not(.is-masked) { white-space: normal; word-break: break-all; }
  .totp-code { font-size: 28px; }
  .confirm-acts { gap: 12px; }
  .toasts, .toast-region { bottom: calc(var(--rail-h) + 16px); width: calc(100vw - 32px); }
  /* 确认框开着的时候来了提示条——窄屏上提示条从底下往上摞（后台垫着坞轨的高度，客户页垫着结果条的高度，商户台没有下沿坞轨、贴着屏幕底边），
     矮一点的手机上两条就把确认框的两颗按钮整个盖住（后台 375×667、360×640 上量到的）。这时把提示条挪到屏幕顶上：会压住确认框标题的头一两行，
     平常盖不到按钮。没有根治：从顶上往下摞得够多、够长时还是会摞到按钮上。照后台入账说不准时的原话在真页面上量过（320、360、375、390 宽，
     两到四条）：商户名平常长短（十二个字）时四条也盖不到；商户名到 120 个字的上限、又摞到四条时，320–375 宽上盖得住。盖住的那几秒按钮点不到，
     等提示条自己收掉再点（后台入账那几条挂 3.6 秒；不让点击穿过去，原因见上面 .toast 那一条）。
     哪一页都这样（店主 2026-11-14 定的：商户台、客户页也照后台改）。那两页也在真页面上量过（各照它自己会弹的话弹一到四条，同样四种宽度，
     两颗按钮上各取五个点）。客户页挪之前：320 宽两条盖住六个点、三条十个点全盖住、四条六个，360 宽三条八个、四条十个，375 宽三条三个、四条九个，390 宽盖不到；
     商户台挪之前只有 320 宽、四条那一种盖住四个点。挪上去之后这几种都盖不到。
     客户页平时垫的是结果条的高度（--m-dock-h，public.css 里后写的一条），这一条比它重（[0,3,1] 对 [0,1,0]），照样挪得上去。
     只看宽度：手机横过来、宽度过了 760 的不在这一条里（真页面上量过 844×390、915×412：后台一条、客户页一两条就盖得住按钮，商户台要摞到三四条才盖住——
     后台从这条规则有的那天起就是这样；要不要把矮屏也管上，等店主定） */
  body:has(.confirm:not([hidden])) .toasts, body:has(.confirm:not([hidden])) .toast-region { top: 12px; bottom: auto; }
  /* 墨印：96 见方 */
  .m-seal { right: 12px; top: -14px; width: 96px; height: 96px; }
  .m-seal small { font-size: 13px; }
  .m-seal b { font-size: 36px; }
  .m-seal em { font-size: 12px; }
  .m-seal .m-seal-face { gap: 2px; box-shadow: inset 0 0 0 5px var(--ink), inset 0 0 0 7px var(--on-ink); }
  .m-seal > .m-seal-print { -webkit-mask-size: 116px 116px, auto; mask-size: 116px 116px, auto; }
}
