/**
 * 界面样式 —— 由 tools/build.mjs inline 进 index.html
 *
 * 🔴 颜色一律 var(--*)，**本文件不出现颜色字面量**（除透明/无色）。
 *   值由 ui/theme.ts 在运行时写进 documentElement.style，
 *   切换主题零重排样式表。改配色只改 theme.ts。
 *
 * 🔴 浅色是默认且是主体验（用户明确"浅色高级风、拒黑底"）：
 *   body 背景取 --bg（暖白 #FBFBF8），卡片用 --box-bg 纯白 + 1px 描边
 *   ——浅底上白卡**必须靠描边区分**，只靠填充色会看不见（用户踩过）。
 */

/* ---------- reset ---------- */
* { box-sizing: border-box; }
html, body {
margin: 0;
  height: 100%;
  background: var(--bg);
  color: var(--fg);
  /* 🔴🔴 老项目 index.html:96：`font:16px/1.6 -apple-system,...` —— font **简写**，
     字号 16px 就在这条简写里。此前新项目拆成 font-family + line-height，
     **把 font-size 整条丢了**，于是继承下来的是浏览器默认 16px（恰好同值，PC 看不出来），
     但在有全局 font-size 的壳里就会被继承成别的值。
     而 display:flex + flex-direction:column 是布局的命门，见下。 */
  font: 16px/1.6 -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto,
    "PingFang SC", "Microsoft YaHei", sans-serif;
  /* 🔴🔴 老项目 index.html:96 末段 `display:flex;flex-direction:column` —— **本条曾整个漏掉**。
     后果是整条纵向布局链全断：
       body 不是 flex 容器 → .shell 的 `min-height:100%` 无参照
       → .ns-main 的 `flex:1` 无处可伸 → 编辑器不撑满剩余高度
       → 底部菜单栏（footer）被正文顶下去、随内容滚动，而不是钉在界面底部。
     这正是用户报的「笔记编辑界面应该比较高，菜单栏应该在界面底部」。 */
  display: flex; flex-direction: column;
  /* 老项目 `transition:background .3s,color .3s`（.3s 不是 .18s，属性名是简写） */
  transition: background .3s, color .3s;
}
button, input { font: inherit; color: inherit; }
button { background: none; border: 0; cursor: pointer; padding: 0; }
svg.ic { display: block; }

/* 🔴🔴 选中态（老项目 index.html:97 `::selection{background:rgba(169,134,60,.22)}`）。
   原先整个项目**没有这条规则** —— 于是选中文字落进浏览器默认的亮蓝 system color，
   蓝底 + 暖白正文是全站唯一一处"不像本App"的颜色，并排看正文与弹窗时最先刺眼。
   值走令牌（老项目是硬编码单值，日夜同档，见 theme.ts PALETTE 注释）。 */
::selection { background: var(--selection); }

/* 🔴🔴🔴 图标次级描边必须复刻老项目的**金色高亮语义**（老项目 index.html:588-589）：
 *     svg .g  { stroke: var(--accent) }
 *     svg .gf { fill: var(--accent); stroke: none }
 *
 *   原新项目写的是 `.ic .g { opacity: .6 }` —— 把"金色"换成了"半透明灰"。
 *   后果是**全站 20+ 图标的强调层一起变色**：老项目里星标的实心尖、
 *   菜单项的高亮笔画、锁的锁梁，全是金色 accent；改成opacity 之后
 *   它们变成"同色但发灰"，整屏图标一起降级 —— 而这类改动**单看任一个图标
 *   都不算错**，只有并排对比才刺眼，所以极难自查。
 *
 *   `.g` / `.gf` 是 SVG 内部的**类名**（写在 path 上），不限定 `.ic`：
 *   老项目顶栏 logo、落地页 logo、菜单里的裸 svg 也带这两个类，
 *   所以选择器不能收窄到 `.ic`，否则那些图标的高亮层会掉回默认色。
 */
svg .g { stroke: var(--accent); }
svg .gf { fill: var(--accent); stroke: none; }

/* ---------- 启动占位 ---------- */
#boot { min-height: 100%; display: flex; align-items: center; justify-content: center;
        font-size: 14px; color: var(--muted); }

/* ---------- 通用弹层 ---------- */
.mask {
  position: fixed; inset: 0; z-index: 40;
  /* 🔴 值由 ui/theme.ts 的 OVERLAY 写进来（本文件不出现颜色字面量） */
  background: var(--mask-bg);
  display: flex; align-items: center; justify-content: center;
  /* 🔴🔴 padding必须去掉（老项目 `.mask` 原文没有 padding）。
     量化实测：老项目弹窗盒子 x=19.5、bj x=20 —— 差的正是遮罩这 20px 内边距。
     而且它还会**把盒子整体压小**（老项目 h=323/323/… vs bj 308/360 随内容跳动）。
     遮罩只负责压暗+居中，间距由 .box 自己的 padding 管。 */
  padding: 0;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
}
.mask.hidden { display: none; }
/* 🔴🔴 菜单遮罩必须**独立压过所有浮层**（老项目 index.html:506 `#menuMask{z-index:90}`）。
   老项目在这条上面有专门的注释：菜单是模态独占交互，实测"点了没反应" ——
   根因就是遮罩层叠上下文比提醒卡(58)/时间chip(57) 低，浮卡的 pointer-events
   物理挡在菜单前面，用户的点击压根没落到菜单上。
   本项目原先完全没写这条，.mask 通盘z40：提醒卡 58、时间 chip 57、
   上传条 57 全都浮在菜单遮罩之上。 */
#menuMask { z-index: 90; }
/* 🔴 弹窗入场（老项目 index.html:509 `animation:rise .5s cubic-bezier(.2,.7,.3,1) both`）。
   原先**整条动画缺失** —— 所有弹窗是"啪"一下出现的，没有老项目那种
   "从下方 10px 升上来"的入场，浮层的"浮起"感全靠这一下。
   🔴🔴 to 帧必须显式写全 transform：老项目 index.html:590 的 rise 是
     `to{opacity:1;transform:none}`，而 fill-mode:both 会在动画结束后
     **永久接管 transform**。.box 自身没有居中用的 transform（居中靠 .mask 的
     flex），所以这里写 none 是安全的 —— 但仍要显式写出来，不能依赖默认。
   🔴 名字加 ns 前缀：老项目已占用 rise / remRise / chipRise / drawRise 等全局名，
     styles.css 是 inline 进单页的，撞名会互相覆盖（老项目 v5.44 的事故同源）。 */
@keyframes nsRise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}
/* 🔴🔴🔴 `.box` **不许带 max-height / overflow**（用户报障第 7 条
 *   「日间模式扫一扫、号码配对、菜单栏、历史版本等的滚动条和老版本不一样，
 *     有些地方不应该出现滚动条」——本批量化实锤）：
 *
 *   老项目 `.box`（index.html:509）原文只有
 *     `background/border/border-radius/padding/width/box-shadow/transition/animation`
 *   —— **没有 max-height、没有 overflow**。所以老项目里除了扫一扫那一张
 *   （:8599 用行内 `max-height:calc(100vh - 48px);overflow:auto` 单独开），
 *   其它任何弹窗、菜单盒都不可能长出滚动条。
 *
 *   bj 此前在 `.box` 上写了 `max-height:86vh; overflow-y:auto`，
 *   于是**每一个** `.box` 都成了潜在滚动容器：
 *     · 菜单盒 `#menuBox` → 菜单行多时盒自己再滚一条，与行内滚动**重复**；
 *     · 号码配对 / 修改口令 / 关于… → 内容没到 86vh 也留着一条永远不用的滚动条轨道；
 *     · 历史版本页 → 同上，且与 `.list-scroll` 的滚动叠成两条。
 *   "有些地方出现了不该有的滚动条"就是这一句的副作用，不是别处漏了什么。
 *
 *   需要限高滚动的地方**各自单独开**：扫一扫层已在 scan/layer.ts:88 用行内样式开好
 *   （与老项目 :8599 同款），历史/收藏列表走 `.list-scroll{max-height:min(50vh,400px)}`。
 */
.box {
  width: 100%; max-width: min(90vw, 380px);
  background: var(--box-bg);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 34px 30px 28px;
  /* 🔴 阴影换 --shadow-box（老项目 0 24px 70px rgba(20,20,18,.16)）。
     原先是 `0 10px 40px var(--ring)` —— 那是聚焦光圈的量级，
     拿来做弹窗投影等于浮层贴在纸上，没有高度感。 */
  box-shadow: var(--shadow-box);
  transition: background-color .3s ease;
  animation: nsRise .5s cubic-bezier(.2,.7,.3,1) both;
}
/* 🔴🔴 逐值抄老项目 `.modal-head{...;gap:12px;margin:0 0 8px}`。
   缺 `margin:0 0 8px` 时标题行与下方内容贴在一起，整盒高度少 8px
   （量化实测：老项目 323 vs bj 307，差的 16px 由此项与 .err 各占一半）。 */
.modal-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin: 0 0 8px; }
.modal-head h1 { font-size: 18px; font-weight: 600; margin: 0; letter-spacing: .02em; }
/* 🔴 关闭键36×36 / 圆角 10（老项目 index.html:487）。原先 32px/8px —— 比老项目小一号。 */
.box-x { width: 36px; height: 36px; display: grid; place-items: center;
         border-radius: 10px; color: var(--muted); flex: none;
         touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.box-x:hover { background: var(--hover); color: var(--fg); }
/* 🔴 关闭图标 20×20（老项目 index.html:489 `.box-x svg{width:20px;height:20px}`）。
   没有这条时 svg 落到 svg 默认尺寸，与 36px 盒子不配比。 */
.box-x svg { width: 20px; height: 20px; }

/* ---------- 落地页 ---------- */
.landing {
  position: fixed; inset: 0; z-index: 30;
  display: flex; flex-direction: column; align-items: center; justify-content: center;
  padding: 24px; text-align: center;
  /* 落地页底：中心偏上的暖金晕 + 页面底色（老项目 index.html:548 同款） */
  background:
    radial-gradient(ellipse 720px 480px at 50% 30%, var(--accent-soft), transparent),
    var(--bg);
}
/* 🔴🔴 `.landing-in` 这层包裹是**bj 自己加的**，老项目**没有**（index.html 里 0 处）。
   老项目里 logo / h1 / .sub / .input-row / .trust 都是 `.landing`（display:flex; column;
   align-items:center）的**直接子元素** ⇒ 每一项各自 shrink-to-fit，
   实测 h1 宽 157.53px、.sub 宽 89.97px（各自贴着文字宽度）。
   bj 多包一层 `.landing-in{width:100%}` ⇒ h1 被拉满 342px（用户报障第 1 条「文字位置不同」）。

   🔴 修法用 `display:contents`：它让这层的**子元素直接参与父级 flex 布局**，
   等价于老项目"没有这层包裹"的结构，而不是靠调 max-width 去凑宽度
   （试过 max-content：那会让 .input-row 的 340px 变成所有子项的共同宽度，h1 仍是 340，不对）。
   ⚠️ display:contents 会让 .landing-in 自身不产生盒子，所以它的 max-width 也不再生效
   —— 这正是我们要的（限宽由 .input-row 自己的 max-width:340 承担）。 */
.landing-in { display: contents; }
.ns-logo { color: var(--accent); margin: 0 auto 6px; display: block; }

/* 🔴🔴 落地页 logo 56px（老项目 index.html:557 `.logo{width:56px;height:56px;margin:0 0 22px}`）。
   原先写 48px —— 那是 viewBox 的尺寸，不是显示尺寸；56px 是老项目实际的视觉大小。 */
.ns-logo { width: 56px; height: 56px; margin: 0 0 22px; color: var(--accent); }

/* 🔴🔴🔴 顶栏 logo 的尺寸必须按视口 clamp（老项目 index.html:156）：
 *     width: clamp(17px, 4.4vw, 27px); height: 同值
 *   原新项目**写死 width="48" height="48"**，而顶栏格只有 17px 高 ——
 *   48px 的 SVG 塞进 17px 格子里，实际渲染成一团糊色块，还会撑开顶栏行高。
 *   老项目「HTML 里不写尺寸、用 CSS 缩放 SVG」的做法必须照搬：
 *   尺寸是**表现层**的事，不该烧进 markup（皮肤三态切换时还要复写它）。
 *
 * 🔴🔴 这条 clamp 是**上一批误抄进来的**，本批删除（用户报障第 5 条「logo 大小和老版本不一样」）。
 *   老项目 index.html:102 是 `header .brand svg{width:17px;height:17px;color:var(--accent);flex-shrink:0}`
 *   —— **恒定 17px**，且全文 `grep "clamp("` **零命中**，没有任何媒体查询覆盖它
 *   （`:293` 只改 `header button svg`，logo 不是 button 的子元素）。
 *   bj 这条 clamp 让视口 ≥386px 时 logo 就开始变大、≥614px 到 27px，
 *   在 PC 上并排一眼就看出"logo 变大了"。
 *   ⇒ 尺寸改由下面 `.ns-brand .ns-mark svg` 承担（与老项目 :102 逐值等价）。
 */
.landing h1 { font-family: var(--serif); font-size: 34px; font-weight: 500;
              margin: 0 0 10px; letter-spacing: .05em; }
.landing .sub { margin: 0 0 44px; font-size: 13px; color: var(--muted);
               letter-spacing: .32em; padding-left: .32em; }
/* 🔴 gap 与 max-width 逐值抄老项目 `#landing .input-row{display:flex;gap:10px;max-width:340px;width:100%}`。
   实测（390×844 并排量化对比）：gap 8→10、max-width 补 340px，
   输入框与「打开」按钮各宽 +2px，行总宽 342→340 —— 视觉上"输入框和按钮都大了一点/位置不同"。
   🔴 max-width:340 不是装饰：老项目整行锁 340px，两侧留白相等；
     不写的话 bj 行宽 342 且随视口拉伸，与老项目在**任何**非 342px 宽的屏上都不齐。 */
.lrow { display: flex; gap: 10px; max-width: 340px; width: 100%; }
/* 🔴🔴 落地页这一段逐值抄老项目（用户报障第 1 条：图标/字体/文字位置/按钮颜色都不同）。
   量化依据（390×844 并排探针实测，见 _diff_result_20261006.txt）：
     老项目 input  : h=46 w=250.19 line-height=normal
     bj改前        : h=48 w=264    line-height=24px
   老项目原文：
     #landing input{flex:1;height:46px;padding:0 16px;...;font-size:15px;outline:0;
                    background:var(--box-bg);color:var(--fg);
                    transition:border-color .2s,box-shadow .2s}
     #landing button{height:46px;padding:0 24px;border:0;border-radius:10px;
                    background:var(--fg);color:var(--bg);font-size:15px;
                    font-weight:500;letter-spacing:.06em;cursor:pointer;white-space:nowrap}
🔴 height 46 + padding 0 16px 是"文字上下居中"的成因：bj 此前用 padding 11px12px + 无固定高，
   行高被 24px 撑到 48px，文字基线整体下移 —— 这就是用户说的"文字位置不同"。
   🔴 line-height 用 normal（老项目原文）而不是固定 px：按钮是 flex 居中，固定行高会再偏 1px。 */
.lrow input {
  flex: 1; min-width: 0; height: 46px;
  background: var(--box-bg);
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 0 16px;
  font-size: 15px;
  line-height: normal;
  color: var(--fg);
  outline: none;
  transition: border-color .2s, box-shadow .2s;
}
.lrow input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
.lrow button {
  flex: none; height: 46px; padding: 0 24px; border: 0; border-radius: 10px;
  background: var(--fg); color: var(--bg);
  font-size: 15px; font-weight: 500; letter-spacing: .06em;
  line-height: normal;
  cursor: pointer; white-space: nowrap;
  transition: opacity .2s;
}
.lrow button:hover { opacity: .85; }
/* 🔴🔴 禁用态必须**换底色+换字色**，不能只压 opacity（用户报障第 1 条
   「打开按钮和扫码打开笔记按钮初始颜色不同」——量化实测：
     老项目 disabled:底 rgb(236,234,226)=--line，字 rgb(152,149,138)=--muted
     bj 改前       : 底 rgb(28,28,26)=--fg（深），字 rgb(251,251,248)=--bg（白）= 看着像可用态
   老项目原文：#landing button:disabled{background:var(--line);color:var(--muted);
     cursor:not-allowed;box-shadow:none;opacity:1}
   🔴 opacity:1 是关键：它把"禁用"这件事从"变淡"改成"换配色"，
     于是禁用态与可用态**同一个形状**、不同的颜色 —— 这才是老项目的视觉语言。 */
.lrow button:disabled {
  background: var(--line);
  color: var(--muted);
  cursor: not-allowed;
  box-shadow: none;
  opacity: 1;
}
.lrow button:disabled:hover { opacity: 1; }
/* 🔴🔴🔴 落地页入场动画（用户报障第 6 条「刷新时没有从上到下依次出现的效果」）。
   老项目 index.html:550-559 + :586 原文：
     #landing>*{animation:rise .7s cubic-bezier(.2,.7,.3,1) both}
     #landing>*:nth-child(2){animation-delay:.06s} … :nth-child(9){animation-delay:.48s}
     @keyframes rise{from{opacity:0;transform:translateY(10px)}to{opacity:1;transform:none}}

   🔴 为什么用 `#landing .landing-in > *` 而不是抄老项目的 `#landing > *`：
     bj 多一层 `.landing-in`（见上面 `display:contents` 那段注释），
     `#landing > *` 只会命中 **1 个** `.landing-in` 本身 —— 而 `display:contents`
     的元素不生成盒子，动画对它**完全无效果**（实测 animationName 能读到 rise，
     但用户眼前什么都不会动 —— 这类"声明在、效果无"最难查，必须钉子节点）。
   🔴 nth-child 步进必须落在 `.landing-in` 的子节点上。老项目 `#landing` 下是 9 个子节点，
     bj 的 `.landing-in` 下同样是 9 个（logo/h1/sub/lrow/warn/lurl/eggtip/lscan-row/scanMsg/trust
     —— 注意 bj 把 .lscan 包进了 .lscan-row 以复刻老项目的 .scan-row 26px 上边距，
     所以子节点数与老项目一致，步进序号才对得上）。 */
#landing .landing-in > * { animation: nsLandingRise .7s cubic-bezier(.2, .7, .3, 1) both; }
#landing .landing-in > *:nth-child(1) { animation-delay: 0s; }
#landing .landing-in > *:nth-child(2) { animation-delay: .06s; }
#landing .landing-in > *:nth-child(3) { animation-delay: .12s; }
#landing .landing-in > *:nth-child(4) { animation-delay: .18s; }
#landing .landing-in > *:nth-child(5) { animation-delay: .24s; }
#landing .landing-in > *:nth-child(6) { animation-delay: .30s; }
#landing .landing-in > *:nth-child(7) { animation-delay: .36s; }
#landing .landing-in > *:nth-child(8) { animation-delay: .42s; }
#landing .landing-in > *:nth-child(9) { animation-delay: .48s; }
/* 🔴 命名用 nsLandingRise 而不是老项目的 rise：
     `rise` 这个名字太通用，撞上别的库的同名 keyframes 会静默串味（@keyframes 全局作用域）。
     值与老项目逐字一致（from opacity0+translateY(10px) → to opacity1+none）。 */
@keyframes nsLandingRise {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}
/* 🔴🔴 警示行逐值抄老项目 index.html:574
     `#landing .warn{color:#C0453E;font-size:12px;margin:14px 0 0;letter-spacing:.04em}`
   bj 原先是 `margin-top:8px` 且**整行无字距** —— 字距这条是"文案字体不一样"里最容易被忽略的一项：
   12px × .04em = 0.48px，字号小的时候不写几乎看不出来，但整行的字距节奏会变。
   ⚠️ 颜色仍走 var(--danger) 而非硬编码 #C0453E：老项目那行是被三处反色覆盖块
     （:1094/:1196）覆写的，硬编码会绕过主题契约（bj 的判据 S4-T7 明令颜色只允许一个出处）。 */
#landing .warn { color: var(--danger); font-size: 12px; margin: 14px 0 0; letter-spacing: .04em; }
.hidden { display: none !important; }
/* 🔴🔴🔴 网址预览行逐值抄老项目 index.html:583-584
     `#landing .urlline{color:var(--muted);font-size:12.5px;margin:16px 0 0;
        line-height:1.7;letter-spacing:.03em;max-width:340px;word-break:break-all}`
     `#landing .urlline .u-name{color:var(--accent);font-weight:600;letter-spacing:.02em}`
   bj 改前实测：12px / letter-spacing:normal / line-height:19.2px / margin-top:10px / max-width:none，
   而且**整行是一个纯文本节点** ⇒ 笔记名拿不到金黄（用户报障："老版本笔记名是金黄色"）。
   🔴 max-width:340px 不能省：老项目整行锁 340 与输入行同宽，两侧留白相等；
     不写的话长网址会拉满整屏，视觉重心整个偏掉。 */
#landing .lurl {
  margin: 16px 0 0; color: var(--muted);
  font-size: 12.5px; line-height: 1.7; letter-spacing: .03em;
  max-width: 340px; word-break: break-all;
}
#landing .lurl .u-name { color: var(--accent); font-weight: 600; letter-spacing: .02em; }
/* 🔴🔴 彩蛋提示行逐值抄老项目 index.html:572-573
     `#landing .eggtip{margin:12px 0 0;max-width:340px;width:100%;font-size:11px;
        line-height:1.7;letter-spacing:.04em;color:var(--muted)}`
     `#landing .eggtip b{color:var(--accent);font-weight:600}`
   bj 原先是 `margin-top:4px;font-size:12px;color:var(--accent);min-height:1em` ——
   **整行金黄**（老项目整行 muted，只有 <b> 门牌名金黄）、字号大一号、无限宽、无字距，
   而且用 min-height 硬撑空行。老项目初始就带 hidden，空行压根不占位 ——
   用 min-height 撑会在扫码胶囊上方多出一段空白，这正是"元素位置不一样"的一处来源。 */
#landing .legghint {
  margin: 12px 0 0; max-width: 340px; width: 100%;
  color: var(--muted); font-size: 11px; line-height: 1.7; letter-spacing: .04em;
}
#landing .legghint b { color: var(--accent); font-weight: 600; }
/* 🔴 扫码入口上方 26px（老项目 index.html:576 `#landing .scan-row{margin:26px 0 0}`）。
   bj 此前把 .lscan 直接挂成 .landing-in 的子节点、没有任何上边距 ⇒
   扫码胶囊紧贴上一行，一眼就"位置不对"。这里用一层 .lscan-row 复刻老项目的壳。 */
#landing .lscan-row { margin: 26px 0 0; }
.lscan {
  display: inline-flex; align-items: center; gap: 8px;
  color: var(--muted); font-size: 13px; letter-spacing: .1em;
  padding: 11px 20px; border: 1px solid var(--line); border-radius: 999px;
  cursor: pointer; min-height: 44px;
  transition: border-color .2s ease, color .2s ease;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
.lscan:hover { border-color: var(--accent); color: var(--accent); }
.lscan:active { opacity: .6; }
.lscan svg { width: 16px; height: 16px; display: block; }
.trust {
  position: absolute; left: 0; right: 0;
  bottom: calc(44px + env(safe-area-inset-bottom));
  display: flex; justify-content: center;
  color: var(--muted); font-size: 11.5px; letter-spacing: .05em;
  transition: opacity .25s ease;
}
/* 🔴🔴🔴 入场动画的 fill-mode 补丁必须**单独一条、且特异性不低于入场规则**。
   老项目 index.html:586 把它塞在 `#landing .trust{…animation-fill-mode:backwards}` 里，
   紧跟 `#landing>*{animation:rise … both}` 之后，靠**源码顺序**压过那个 both。

   bj 这里不能只靠顺序：`#landing .landing-in > *` 是 **(1,1,0)**，
   裸 `.trust` 只有 **(0,1,0)** ⇒ shorthand 里的 `both` **结构性压过**后续声明，
   `animation-fill-mode: backwards` 被吃得干干净净（实测 VVW-23 红：读到 both）。

   后果不是样式细节：both 会把 to 帧 `opacity:1` 在动画结束后**永久锁死**，
   于是"聚焦输入时信任行淡出"这条老项目 v7.9.1 闸R2/R3 修过的行为**完全失效** ——
   用户点了输入框，底部三行图标不下去、压住软键盘。
   ⇒ 必须堆到与入场规则同分（老项目靠 ID，这里给 `#landing .trust` = (1,1,0)）且写在后面。
   ⚠️ 同理 animation-delay：`.trust` 是 .landing-in 的**第 10 个**子节点 ——
      bj 比老项目多一个内部用的 #landingScanMsg 警示位（老项目 grep landingScanMsg = 0 命中），
      排在 `.lscan-row` 之后、`.trust` 之前。老项目"最后一行可见元素"的步进值是 **.48s**，
      那是用户眼睛看到的收尾节奏 ⇒ 这里把 .trust 显式钉回 .48s。
      两条 :nth-child(9) 与这条都是 .48s（并列而非递增），不影响"自上而下依次出现"：
      用户在正常路径下只看得到一行，.trust 仍是最后落位的那一行。 */
#landing .trust { animation-fill-mode: backwards; animation-delay: .48s; }
/* 老项目不用 flex gap 于 .trust 本身（老内核丢 gap 会让三图标粘连），margin 兜底。
   🔴 用 `#landing .trust > span` 而不是裸 `.trust > span`：老项目原文是
   `#landing .trust>span`（带 ID）。若 bj 留成裸类名 (0,1,0)，
   将来任何一条 (0,2,0) 的 `.landing-x span` 规则都能压过它 —— 与 VVW-20
   栽的 `.ns-rem-off` 被 `.box button:not(.box-x)` 吃掉是同一类事故。 */
#landing .trust > span { display: flex; flex-direction: column; align-items: center;
                gap: 7px; margin: 0 13px; }
#landing .trust svg { width: 17px; height: 17px; color: var(--muted); display: block; }
/* 聚焦输入时信任行淡出：给软键盘留出视觉空间（老项目 .trust-away）。
   🔴 这条必须能压过入场动画的 to 帧 opacity:1 —— 靠上面那条 backwards 兜底
   （both 会把 to 帧锁死，backwards 不会）。反向判据在 VVW-23。 */
.landing.trust-away .trust { opacity: 0; }

/* ---------- 口令页 / 首页 ---------- */
/* 🔴🔴 弹窗说明文字**逐值抄老项目 `.box p{font-size:13px;color:var(--muted);
   margin:0 0 20px;line-height:1.7}`**（index.html 同款）。
   量化实测（口令弹窗）：老项目 13px/22.1px 行高、盒子高 323；bj 12.5px/21.25px、
   盒子高 309 —— 字小一号 + 上下留白少 6px，两头差 14px。
   🔴 别只改字号：margin 也要跟着改回 `0 0 20px`，
   此前写的 `10px 0 14px`（上下各留一点）会让整盒高度差一截。 */
.box .hint { font-size: 13px; line-height: 1.7; color: var(--muted); margin: 0 0 20px; }
/* 🔴 口令框：老项目 index.html:513 `.box input{width:100%;padding:0 14px;height:46px;...}`。
   原先 padding:11px 12px（高约 41px），比老项目矮 5px、左右内边距也差 2px。 */
/* 🔴 选择器必须是 `.box input`（老项目 index.html:513 同款），不是 `.box input[type=password]`：
     老项目那条不带属性选择器，弹层里**任何** input 都吃它。
     限定属性会让将来新增的非密码输入框（换机码粘贴框等）静默退回浏览器默认样式 ——
     症状是"某个框圆角/高度和别的框不一样"，属同一类"漏枚举"故障。
     老项目还有 `color:var(--fg)`，缺了它输入的字符取 UA 默认黑，夜间模式下看不见。 */
.box input {
  width: 100%; background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px;
  height: 46px; padding: 0 14px; font-size: 15px; outline: none;
  color: var(--fg);
}
.box input:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }
/* 🔴🔴 逐值抄老项目 `.err{color:#C0453E;font-size:13px;min-height:20px;margin:10px 0 6px}`。
   差异同样体现在整盒高度上：bj 此前 min-height:1.2em / margin-top:8px / 12.5px，
   与老项目的 20px / 10px+6px / 13px 都不一致 ⇒ 弹窗整体比老项目矮一截。 */
.err { min-height: 20px; margin: 10px 0 6px; font-size: 13px; color: var(--danger); }
/* 🔴🔴🔴 主按钮规则必须与老项目 index.html:516 **同选择器**，不能只管 #ok：
     老项目是 `.box button:not(.box-x){width:100%;height:46px;…;letter-spacing:.08em}`
     —— 弹窗里**每一个**按钮（扫码配对的「关 闭」、换机的「生成备份码」/「取消」、
     提醒面板的按钮…）都吃这条通栏 46px 高规则。
     bj 此前写的是 `.box > button#ok`，于是只有 #ok 吃到，别的按钮退回浏览器默认：
     量化实测 `qrClose` 是 **36x26**（老项目 46px 高、100% 宽）。
     症状很轻（"按钮小一号"），但它是用户报障第 3 条
     「扫一扫、二维码配对弹窗下面两个按钮也不一样」的**真实根因**。
     `:not(.box-x)` 的排除是承重的：.box-x 是 36x36 的方键，
     被通栏规则按优先级覆盖会被渲染成 46px 高的实底条（老项目 v6.2 专门为此加的排除）。 */
.box button:not(.box-x) {
  width: 100%; height: 46px; padding: 0 14px;
  border-radius: 10px; background: var(--upload-bg); color: var(--bg);
  font-size: 15px; font-weight: 500; letter-spacing: .08em;
  transition: opacity .2s ease;
}
.box button:not(.box-x):hover { opacity: .85; }
.box button:not(.box-x):active { opacity: .75; }
/* 🔴🔴🔴 「取消」这类**次要按钮**在老项目里**和主按钮长得一模一样**（同底同字），
 *  尽管源码 :518 写了 `.box button.ghost-btn{margin-top:10px;background:none;color:var(--muted);
 *   border:1px solid var(--line);font-weight:400}`。
 *
 *   决定渲染结果的不是那段源码，而是 :1063 一条**运行时注入的 `!important` 主题覆盖**
 *   （由 applyTheme 在 :1269 无条件挂到 documentElement，模板在 themeCssCore() :1045-1067）：
 *     .box button:not(:disabled):not(.box-x){
 *       background:${p.fg}!important;color:${p.bg}!important;-webkit-text-fill-color:${p.bg}!important}
 *   specificity (0,3,1) 压过 ghost-btn 的 (0,2,1)，于是 background / color /
 *   font-weight 全被吃回主按钮那套，**只有 ghost-btn 独占的 margin-top:10px 与 border 活下来**。
 *   ⇒ 真实渲染：非禁用按钮一律 `--fg` 底/ `--bg` 字（深底浅字），
 *     日间实测 rgb(28,28,26) 底 / rgb(251,251,248) 字。
 *
 *   🔴🔴 上一批我漏读了 :1063 这条 `!important`，留下一条
 *     `.box button:not(.box-x):not(:disabled){background:var(--hover); …}`
 *     去"模拟 ghost-btn 观感"，**把深底顶成了浅灰淡底**（--hover 日间是
 *     rgba(28,28,26,.05)，几乎等于页面底色）—— 这就是用户报障第 2 条
 *     「弹窗内下方按钮颜色不对」的真实根因。该规则已删除：
 *     按钮底色交回上面 `.box button:not(.box-x)` 的 `--upload-bg`（≡ `--fg`/`--bg` 二选一）。
 *     教训与仓库里另外两处同源：老项目里"写了但被更具体规则（含 !important）吃掉的声明"
 *     必须以**运行时实测**为准，照抄声明等于把 bug 一起抄进来。
 *
 *   禁用态照抄老项目 :522（不是"整枚变淡"）：
 *     background:var(--line); color:var(--muted); opacity:1（明确写 1）
 */
.box button:not(.box-x):disabled {
  background: var(--line); color: var(--muted);
  cursor: not-allowed; box-shadow: none; opacity: 1;
}
/* 🔴🔴🔴 缺这条 ⇒ 用户报障第 5 条「修改口令弹窗按钮间距不对」。
 *   老项目 index.html:518 `.box button.ghost-btn{margin-top:10px;background:none;
 *   color:var(--muted);border:1px solid var(--line);font-weight:400}`。
 *   而 bj 的 `buildChangePass`(pages.ts:220) 给「取消」挂了 `class="ghost-btn"`，
 *   样式表里**却根本没有 `.ghost-btn` 规则** —— 类名挂了等于没挂：
 *   `margin-top:10px` 与那条 `border` 全都丢失，「下一步」与「取消」两枚按钮**贴死在一起**。
 *   这与老项目 :490 注释记的是同一个病（「此前 .box input 无 margin，两框贴死，
 *   用户实测"重合"」）—— 当年老项目自己踩了，加规则补上；bj 抄结构时**只抄了类名
 *   没抄规则**，于是同一个坑再踩一遍。症状极轻（"按钮间距不对"），但真值就是缺这条。
 *
 *   🔴 只写**老项目在运行时真正活下来的**两条（margin-top 与 border）：
 *     background/color/font-weight 在老项目里是被 :1063 那条 `!important`
 *     主题覆盖吃掉的（见上方 :332-353 的大段说明），所以此处**刻意不写**
 *     `background:none;color:var(--muted)` —— 写了反而会把深底顶成浅灰，
 *     正是 v1.8.0 那次「弹窗按钮色」回归的成因。照抄声明 = 把 bug 一起抄进来。 */
.box button.ghost-btn { margin-top: 10px; border: 1px solid var(--line); }
/* 🔴🔴🔴 `.box h1` / `.box p` 必须是**元素选择器**，与老项目 index.html:511-512 同选择器：
 *
 *   老项目原文：
 *     .box h1{font-size:18px;font-weight:600;margin:0 0 8px;letter-spacing:.02em}
 *     .box p {font-size:13px;color:var(--muted);margin:0 0 20px;line-height:1.7}
 *
 *   bj 此前**只有** `.modal-head h1` 与 `.box .hint` 两条**类名**规则，
 *   于是任何没挂这两个类名的 h1/p 都退回浏览器默认 —— 量化实测（改口令弹窗）：
 *     bj  h1: 32px / 700 / margin 21.44px   （老项目 18px / 600 / 0 0 8px）
 *     bj  p : 16px / fg / margin 16px       （老项目 13px / muted / 0 0 20px）
 *   症状就是用户报障第 12 条「修改口令弹窗和老版本不一样」与第 4 条
 *   「配对弹窗文案字体大小、颜色…和老版本不同」—— 同一个根因。
 *
 *   🔴 优先级核对（两条都必须成立，否则会连带改坏别处）：
 *     · `.box .hint`（0,2,0）> `.box p`（0,1,1）⇒ 口令页那段说明仍走自己的规则；
 *     · `.qr-box p`（0,1,1）与本条同优先级但**写在后面** ⇒ 配对弹窗的段间距
 *       仍是老项目的 14px，不是 20px（老项目也是这个顺序、同一结果）。
 */
.box h1 { font-size: 18px; font-weight: 600; margin: 0 0 8px; letter-spacing: .02em; }
.box p { font-size: 13px; color: var(--muted); margin: 0 0 20px; line-height: 1.7; }
/* 🔴 修改口令弹窗里两个新口令框之间的间距（老项目 index.html:491
   `#cpNew,#cpNew2{margin-top:12px}`；v6.1 之前这两框是与旧口令框贴死的）。 */
#cpNew, #cpNew2 { margin-top: 12px; }
/* 老项目 .box button 的 margin-top 是 0；#ok 在老项目里也没有额外上边距，
   bj 此前给 #ok 单加了 margin-top:6px —— 那会让弹窗第一个按钮与上方内容脱开一截。
   🔴 保持与老项目一致：不加。若将来要加，必须同步量老项目。 */
/* 🔴🔴 首页提示页（老项目 index.html:541-544 逐字）：
     .home{…padding:20px;text-align:center}
     .home h1{font-family:var(--serif);font-weight:500;font-size:24px;margin:0 0 12px;letter-spacing:.04em}
     .home p{color:var(--muted);font-size:14px;line-height:1.9;margin:0}
     .home code{background:var(--accent-soft);color:var(--accent);padding:3px 8px;border-radius:6px;font-size:13px}
   原先 h1 22px 且无字重无字距、p 13px/2、code 12.5px、padding 24px ——
   单看每一项都只差一点点，但这是用户解锁后看到的第一屏，
   "标题没有分量 + 提示字挤成两行" 的观感差异最扎眼。 */
.home { min-height: 100%; display: flex; flex-direction: column;
        align-items: center; justify-content: center; gap: 10px; padding: 20px; text-align: center; }
.home h1 { font-family: var(--serif); font-weight: 500; font-size: 24px;
           margin: 0 0 12px; letter-spacing: .04em; }
.home p { font-size: 14px; color: var(--muted); line-height: 1.9; margin: 0; }
.home code { font-family: var(--mono); font-size: 13px; color: var(--accent);
             background: var(--accent-soft); padding: 3px 8px; border-radius: 6px; }

/* ---------- 应用外壳（顶栏 / 编辑器 / 底栏） ---------- */
/* 🔴 body 是 flex column（老项目 index.html:96）之后，.shell 是 body 的唯一 flex 子项，
   必须 `flex:1` 才能占满高度 —— 否则它的 `min-height:100%` 参照的是 body 的内容高，
   底栏footer 照样被正文顶下去。两者缺一，菜单栏就回不到界面底部（用户报障第 3 条）。 */
.shell { display: flex; flex-direction: column; min-height: 100%; flex: 1; }

/* 🔴🔴🔴 #app 是 body 与 .shell 之间那一层，**本条曾完全没有样式** ——
   于是纵向布局链断在它身上：
     body(flex column) → #app（普通块，无高度）→ .shell（flex:1 但父不是 flex 容器）
   实测（真域名 Playwright，1440×900）：整条 shell 只占 327px / 900px，
   底栏浮在页面上半段、下面一大片空白 —— 即使用了户报的第 3 条仍然没修好。
   根因是**层级多了一层**，而每一层都得是"能承接高度的 flex item"，
   漏一层就前功尽弃。
   老项目没有这一层（编辑器直接挂 body），所以老项目不存在这个坑。
   修法：#app 自己也必须是 flex column + flex:1。
   🔴 判据必须量"底栏底边是否等于视口高度"，不能只看"编辑器紧贴底栏"——
      后者在链条断掉时**照样成立**（两块一起缩在上半段），差点被骗过去。 */
#app { display: flex; flex-direction: column; flex: 1; min-height: 0; }
header.ns-top {
  /* 🔴 逐字抄老项目 index.html:100（v9.0.0 注释：position:relative 给桌宠当包含块，
     #nsPet 是 absolute 且 append 进 header，缺它等于钉在首屏底缘外）。
     此前这里是 position:sticky + z-index:20 + background:var(--bg) ——
     三样老项目都没有：sticky 让顶栏吸附，老项目它是文档流内的一行；
     叠层与实底则会在滚动时糊出一层与老项目不同的底色。 */
  position: relative;
  display: flex; align-items: center; gap: 10px;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .04em;
  padding: 12px 20px;
  border-bottom: 1px solid var(--line);
  /* 🔴🔴 底色必须跟老项目一致（量化实测：老项目 header 背景 rgb(251,251,248)，
     bj 此前是 rgba(0,0,0,0)=透明 ⇒ 顶栏"没有自己的底"，直接透出页面底色）。
     老项目 header 规则里**没有** background —— 它靠 :root 的 body 底色透上来，
     视觉上等效，但一旦页面有滚动/渐变就会露馅；写死 var(--bg) 是等效且更稳的写法。 */
  background: var(--bg);
}
/* 🔴 老项目 index.html:101：`gap:8px`（不是 7px）、`color:var(--fg)`（不是 muted）、
   `flex-shrink:1`（不是 flex:none）。gap 差 1px 在 logo 与 NoteSync 字标之间看得出来，
   而 v7.3.3 的注释说明了 flex-shrink 的用途：长笔记名在窄屏不把右侧工具键挤出屏幕。 */
.ns-brand { display: flex; align-items: center; gap: 8px; color: var(--fg);
            flex-shrink: 1; min-width: 0; }
/* 🔴 老项目 index.html:102：17px 见方 + flex-shrink:0。缺了尺寸则图标按 SVG 自带
   viewBox 铺开，与右侧 17px 的工具键不同高 —— 顶栏最显眼的一处"不一样"。 */
.ns-brand .ns-mark { width: 17px; height: 17px; color: var(--accent); flex-shrink: 0; }
/* 🔴🔴 svg 本身也要钉 17px（老项目 index.html:102 的选择器是 `header .brand svg`，
 *   命中的就是 svg 本身）。`.ns-mark` 是包它的 span，给 span 尺寸**不会**约束内部 svg ——
 *   SVG 没有 width/height 属性时默认占 300×150。
 *   此前靠 `.ns-logo-sm` 那条 clamp 兜着（本批已删），删掉后必须由这条接手，
 *   否则顶栏 logo 退回 300×150 把整行撑爆（症状：顶栏被 logo 顶成两行高）。
 *   `.ns-logo-sm` 这个 class 已随之从 icons.ts 一并删除（无任何其它引用）。 */
.ns-brand .ns-mark svg { display: block; width: 17px; height: 17px; flex-shrink: 0; }
.ns-brand b { font-family: var(--serif); font-weight: 500; font-size: 13.5px;
              letter-spacing: .06em; }
/* App 端品牌位常驻当前笔记名（App 没地址栏，看不见笔记名）。
   用独立 span 不用 b：窄屏媒体查询会隐藏 b，用 span 则显示不依赖视口宽度。 */
.ns-brand #brandNote {
  font-family: var(--serif); font-weight: 500; font-size: 13.5px;
  letter-spacing: .06em;
  max-width: 42vw; min-width: 0;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.ns-top .sp { flex: 1; }
/* 🔴 老项目 index.html:104：flex + align/justify center（不是 grid/place-items），
   transition 简写 `color .2s,background .2s`（不是 background-color .2s ease）。
   grid 居中与 flex 居中在 17px 的 svg 上有一像素差，肉眼在 PC 并排时能看出来。 */
.ns-top button.ns-ic {
  flex: none;
  width: 31px; height: 31px; border-radius: 8px;
  display: flex; align-items: center; justify-content: center;
  color: var(--muted); background: none; border: 0;
  cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: color .2s, background .2s;
}
.ns-top button.ns-ic svg { width: 17px; height: 17px; pointer-events: none; }
.ns-top button.ns-ic:hover { color: var(--fg); background: var(--hover); }
.ns-top button.ns-ic:active { background: var(--accent-soft); }
/* 🔴 老项目把 themeBtn / lock 用 display:none 永久隐藏（功能已迁入菜单）。
   这里照实复刻：不是 disabled、不是 visibility，是真的不占位。 */
.ns-top button#themeBtn, .ns-top button#lock { display: none; }

.ns-main { flex: 1; min-height: 0; display: flex; }
.ns-editor {
  flex: 1; width: 100%; max-width: 720px; margin: 0 auto; min-width: 0;
  padding: 40px 28px 120px;
  outline: none;
  /* 🔴 v1.13.0：空态占位符要绝对定位到这个坐标系里（见下方 ::before 段）。
     老项目是裸 contenteditable，占位符用 `#editor:empty:before` 做**行内**内容，
     与光标自然同行；本项目是 Lexical（永远至少有一个 <p class="ns-p">），
     行内 ::before 会被块级 p 挤进匿名块、独占第一行 ⇒ 光标被顶到第二行。
     改成 absolute 后它不参与行盒计算，第一行还给正文与光标。
     padding 不得改（多处几何判据钉着它），只让占位符去对齐它。 */
  position: relative;
  font-size: 17px; line-height: 1.9;
  overflow-x: hidden;
  overflow-y: auto; -webkit-overflow-scrolling: touch;
  /* 恒留滚动条槽：否则滚动条出现/消失会让可用宽度跳 8px，
     折叠展开即整篇重排换行（换行点从第一行掉第二行）。 */
  scrollbar-gutter: stable;
  word-wrap: break-word; overflow-wrap: anywhere; word-break: break-all;
  white-space: pre-wrap;
  -webkit-user-select: text; user-select: text;
}
.ns-editor:focus { outline: none; }
.ns-editor.dragover {
  background: var(--accent-soft);
  outline: 1.5px dashed var(--accent); outline-offset: -8px;
}
.ns-editor::-webkit-scrollbar { width: 8px; }
.ns-editor::-webkit-scrollbar-thumb { background: var(--line); border-radius: 4px; }
/* 🔴🔴🔴 滚动条**轨道**必须显式定色，不能交给 UA + 系统主题。
   用户实机（2026-10-07，Windows 桌面 Chrome 截图）：日间模式轨道是**纯黑槽**，
   用户要的是白色。夜间则是老版本口径（VVW-29 已用 color-scheme 对齐）。

   为什么 color-scheme 那条不够（第一批修的正是它）：
     Windows 处于**深色系统主题**时，系统深色滚动条主题会压过页面声明的
     `color-scheme: light`。color-scheme 只是个**间接开关**，拿不到确定色。
     ⇒ 必须自己写死轨道色。

   🔴 值为什么用 `var(--line)`：
     · 日/夜自动跟随主题令牌（PALETTE.light.line=#ECEAE2 / dark.line=#242428），
       夜间那条修复不用动，两条并存；
     · 不引入颜色字面量（本仓 ui-contract 有机械扫描）；
     · 与 thumb 同色 ⇒ 轨道与滑块在视觉上融成一档，正是老项目观感。

   🔴 为什么用 `::-webkit-scrollbar-track` 而不是 `scrollbar-color`：
     变量有效性检查（真浏览器 headed）实测：
       `scrollbar-color: auto <track>` 被 Chromium **丢弃**（读回 `auto`）——
       "只定轨道、不碰滑块"走不通，必须两色都给；
       而 `::-webkit-scrollbar-track{background}` **只写 track 就生效**，
       且**不触发**滚动条形态变化（gutter 保持原生值，不会切自绘、不会掉箭头）。
     判据：test/e2e/16-visual-views.test.js VVW-33。

   ⚠️ 这条是**有意偏离老项目**：老项目 index.html 全文只有 426-427 的 width+thumb，
      `git log -S` 双仓均查不到任何 track / scrollbar-color 声明 ——
      它的轨道色同样 100% 由 UA + 系统主题决定，只是用户当时没撞上深色系统主题。
      不要"改回去对齐老项目"，那是把 bug 一起抄回来。

   🔴🔴 为什么**逐个列出选择器**而不是写一条 `*::-webkit-scrollbar-track`：
     通配写法确实一次覆盖全部容器，但以后谁新增一个滚动容器、哪怕完全忘了这条规则，
     也会因为全局命中而"看起来有保护" ⇒ 判据退化成恒真，漏加时没有任何东西会红。
     逐个列出 = 新增容器时**必须**同步改这里，判据（VVW-33 的声明层断言）会主动抓。
     🔴 改这个列表时对照 styles.css 里所有 `overflow-y:auto` / `overflow:auto`：
        .ns-editor / #menuMainView / .list-scroll / .hist-preview /
        .ns-remcard-list / .ns-rembox / .ns-rem-list / #eggList / .ns-mirror-box
        （.ns-rem-wheel 故意排除 —— 它不显示滚动条）*/
.ns-editor::-webkit-scrollbar-track,
#menuMainView::-webkit-scrollbar-track,
.list-scroll::-webkit-scrollbar-track,
.hist-preview::-webkit-scrollbar-track,
.ns-remcard-list::-webkit-scrollbar-track,
.ns-rembox::-webkit-scrollbar-track,
.ns-rem-list::-webkit-scrollbar-track,
#eggList::-webkit-scrollbar-track,
.ns-mirror-box::-webkit-scrollbar-track { background: var(--line); }
/* 🔴 .ns-rem-wheel（时间滚轮）**故意**不显示滚动条，它的隐藏声明在 :1417-1420 那一段，
   与 width/height/scroll-snap 写在一起、注释着老项目 :236-237 的出处。
   上面这条全局轨道色规则同样命中它 —— display:none 依然生效（::-webkit-scrollbar
   的 display 先于 track），不需要在这里重复声明，重复了反而会出现两处口径。 */
@media (max-width: 560px) {
  .ns-editor { padding: 24px 18px 100px; font-size: 16px; }
  /* 🔴🔴 v1.13.0：占位符的窄屏覆盖**不在这里**，挪到主规则之后了。
     同 specificity 时后写的赢 —— 覆盖写在主规则前面会被主规则的
     top:40px/left:28px 压掉（实测窄屏占位符比正文第一行高 16px、缩进差 10px）。
     🔴 这是**顺序承重**，不是 specificity 问题：别想着在这里堆类名/属性压过，
       也不要把这条搬回来。位置见主规则 .ns-editor:has(...)::before 段末尾。 */
}
/* 🔴🔴🔴 顶栏窄屏规则**整段缺失**（老项目 index.html:293 逐字）：
     @media (max-width:560px){ header{gap:6px;padding:12px 12px}
       header .brand b{display:none} header button{width:27px;height:27px}
       header button svg{width:16px;height:16px} }
 *   症状不是"少了个样式"，而是**窄屏顶栏整个撑爆**：7 个 31px 键 + 间距 10px
 *   加起来已超 375px，品牌字标再被挤一下就把工具键顶出屏幕（用户报"按钮点不到"）。
 *   老项目 v7.3.3 的 flex-shrink:1 + min-width:0 只解决长笔记名，不解决键本身。 */
@media (max-width: 560px) {
  header.ns-top { gap: 6px; padding: 12px 12px; }
  header.ns-top .ns-brand b { display: none; }
  header.ns-top button.ns-ic { width: 27px; height: 27px; }
  header.ns-top button.ns-ic svg { width: 16px; height: 16px; }
}
.ns-p { margin: 0; min-height: 1.85em; }

/* 🔴🔴🔴 第 4 条核实结论：老项目对 h1/h2/h3/blockquote/ul/ol/li/代码**零样式**。
 *
 *   核实方式（不是凭印象）：把老项目 index.html 第 58-616 行的整个 <style> 块
 *   捞出来 grep `h1|h2|h3|h4|blockquote|code|pre|li|ul|ol`，命中的 5 条**全部**
 *   落在 .modal-head / .box / .home / #landing 之下（弹窗与落地页），
 *   **没有一条在 #editor 之下**。也就是说正文里这几个标签完全没有样式：
 *   老项目是 contenteditable 纯文本，压根不产生这些标签
 *   （全文件 `<h1>`/`<pre>` 只出现在弹窗/落地页/彩蛋面板里，见 :632/:678/:755）。
 *
 *   而新项目（Lexical）凭空给它们加了一整套：衬线标题 1.5em/600、
 *   金色左边框引用、accent-soft 底的等宽行内代码。
 *   ⇒ 那是**另画的一套**，与老项目不一致，必须退回继承正文字体。
 *   保留 Lexical 的 class 名（nodes.ts 依赖它们挂节点），但样式一律继承。
 */
.ns-h1, .ns-h2, .ns-h3 { font: inherit; margin: 0; }
.ns-quote { margin: 0; padding: 0; border-left: 0; color: inherit; }
.ns-ul, .ns-ol { margin: 0; padding-left: 1em; }
.ns-li { margin: 0; }
.ns-li-nested { margin: 0; }
.ns-list-body { display: block; }

/* 链接：老项目 index.html:380-381
   `color:var(--accent); text-decoration:underline; text-underline-offset:3px;
    text-decoration-color:rgba(169,134,60,.35); transition:text-decoration-color .2s`
   hover 变实色 `var(--accent)`。
   🔴 原先只写了 offset:2px 且**完全没有线色** —— 用的是浏览器默认线色，
     于是"悬停变实色"这个老项目特意做的反馈在新项目里也一并丢了。 */
.ns-link {
  color: var(--accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-color: var(--link-line);
  transition: text-decoration-color .2s ease;
  word-break: break-all; overflow-wrap: break-word;
}
.ns-link:hover { text-decoration-color: var(--accent); }
.ns-b { font-weight: 700; } .ns-i { font-style: italic; } .ns-u { text-decoration: underline; }
/* 删除线：老项目 index.html:424
   `text-decoration-color:rgba(152,149,138,.7); color:var(--muted)`。
   🔴 原先只有 `line-through` —— 线色与字色都退回浏览器默认，
     表现为"黑灰细线 + 正常字色"，而老项目是"浅灰线 + muted 字"，整体更轻。 */
.ns-s { text-decoration: line-through; text-decoration-color: var(--del-line); color: var(--muted); }
/* 行内代码：老项目正文零样式（见上），故退回继承，不加等宽/底色。 */
.ns-c { font: inherit; background: none; padding: 0; border-radius: 0; }

/* 🔴🔴 提醒标记：对应老项目 `<u class="rem-mark">`（老项目 index.html:247）。
 *
 *   两个错一起修：
 *   1. **类名写错了**：nodes.ts:89 造的是 `dom.className = 'rem-mark'`，
 *      而这里原先写的是 `.ns-rem` —— 选择器命中不到任何元素，属静默失效。
 *      症状是"提醒的下划线怎么没了"，但 DOM 里 class 明明在，极难自查。
 *   2. **实现方式错了**：原先用 `border-bottom:1.5px solid var(--accent)`，
 *      那是**金色实底方边框**，而老项目是 `text-decoration:underline`
 *      （与正文同一套下划线机制，offset 3px、thickness 1.5px）。
 *      两者并排看差别很明显：金色 1.5px 实边 vs 细下划线。
 *
 *   老项目为什么坚持 text-decoration：主题切换不反色，且底边距可精确控制。 */
.rem-mark {
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1.5px;
  cursor: pointer;
}
/* 到点已推送：整段删除线 + 降透明（老项目 index.html:250 `s.rem-done`）。
   🔴 原先 `.ns-rem-done` 同样命中不到（且把 border-bottom 改成line 色，
     属"改错对象"）；这里同时补 thickness 与 opacity 两项。 */
.rem-done {
  text-decoration: line-through;
  text-decoration-thickness: 1.5px;
  text-decoration-color: var(--del-line);
  opacity: .62;
}
/* 🔴🔴 折叠块：手风琴把手 + 折叠体。open 状态是 ephemeral UI 态，不进真源。
   🔴 结构是**单层**：标题 = children[0]（第一个子段落），其余children 是正文。
     DOM 树是 .ns-fold > (标题段落 | 正文段落…)，没有额外的 head/body 壳
     —— 原因见 nodes.ts FoldNode.createDOM 的注释（ElementDOMSlot 不可导出）。
     下面的选择器与 behaviors.ts 的点击判据、serialize.ts 的导入导出切法
     **三处必须一致**，改任一处都要同步另两处。
 *
 * 🔴🔴 把手退回到老项目的「行内 muted 把手」（老项目 index.html:386-400）：
 *   老项目是 `span.ns-fold-mark{font-size:0;padding:0 3px;margin-right:2px;
 *   border-radius:6px;color:var(--muted)}` —— 一个**行内小块**，
 *   三角与标题文字同处一行，标题本身是正常字色。
 *   原先这里是 `display:flex` 的**整行金色块**（accent 字色 + gap 6px + padding 5px 0），
 *   整篇折叠标题全变金、并被撑成一整条可点区域 —— 与老项目并排看，
 *   正文里一出现折叠就"跳"出整块金色，是这批差异里最刺眼的一条。 */
/* 🔴🔴 `cursor` **不许**留在这一级（用户报障第 10 条「显示小手」）。
   老项目 index.html:386 的 `cursor:pointer` 挂的是 `span.ns-fold-mark`——
   那个span 只包住三角（font-size:0 + padding 0 3px），**不包标题文字**。
   真浏览器实测（老项目真页，2026-10-06）：
     getComputedStyle(.ns-fold-mark).cursor        === 'pointer'
     getComputedStyle(标题文字所在盒).cursor        === 'auto'   ← 标题不是小手
   写成整行 `cursor:pointer`（本项目此前就是）⇒ 光标划过标题文字全程小手，
   而那一行只有 14px 宽的三角是真正可点的 ⇒ 指针范围与可点范围不一致。
   ⇒ pointer 改挂到 ::before / ::after（见下两条），标题这一级恢复 auto。 */
.ns-fold > :first-child {
  color: inherit;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
/* 三角用边框画，不用"▸"字形：字形比汉字小一圈，行高加再大也追不上图标。
   两态必须同盒全等（收起 8w×8h/展开 8w×8h），否则两态行盒占宽不同会跳行。
   🔴 currentColor 取自把手自己的 muted（见下），不再吃标题的 accent。 */
.ns-fold > :first-child::before {
  content: ""; display: inline-block;
  width: 0; height: 0;
  border-top: 4px solid transparent;
  border-bottom: 4px solid transparent;
  border-left: 8px solid var(--muted);
  vertical-align: middle; position: relative; top: -6px;
  /* 老项目把手是 `padding:0 3px` + `margin-right:2px` 的行内小块（index.html:386）。
     三角本身是 0×0 盒（视觉全由边框构成），**不能加 padding** ——
     那会把上下 transparent 边从 4px 撑成 4+2×padding，三角直接变形。
     所以用 margin 等效复刻那6px 让位：左 3px（=padding-left）+ 右 5px（=padding-right 3 + margin-right 2）。
     🔴 这条 margin 是**逐值对齐老项目实测**的结果，别再"顺手改成 4px 4px"：
     老项目真页实测 mark盒 14px 宽（= 3 padding + 8 三角 + 3 padding），
     三角左缘距 mark 左缘 3px、三角右缘到标题文字起点 5px（= 3 + margin-right 2）。 */
  margin: 0 5px 0 3px;
  /* 🔴 `cursor:pointer` 挂在这里（三角本体），**不挂父级**（用户报障第 10 条）。
     老项目 pointer 在span.ns-fold-mark 上，而那个 span 只包三角不包文字。
     伪元素是唯一能在bj 里"只圈住三角"的选择器 —— 父级那一行还含标题文字。
     实测（老项目真页）：三角 computed cursor='pointer'，标题文字='auto'。 */
  cursor: pointer;
}
.ns-fold[data-open="true"] > :first-child::before {
  border-top: 8px solid var(--muted);
  border-bottom: 0;
  border-left: 4px solid transparent;
  border-right: 4px solid transparent;
  top: -6px;
}
/* 🔴🔴 把手 hover 底：**只盖把手那 18×20 感应区，不多盖一像素**（用户报障第 7 条 b）。
 *
 * 老项目 index.html:400 是 `span.ns-fold-mark:hover{background:var(--hover)}`，
 * 那个 span 的盒是 **14×0**（font-size:0 + padding 0 3px ⇒ 宽 14、高 0），
 * 且真正的 hover 承载体是它那枚 18×20 的 ::after（index.html:399）。
 * 真浏览器实测（老项目**真页** index.html，2026-10-06）：
 *   · mark 盒 rect = 14 × 0
 *   · 原样 hover：底**不可见**（0 高的盒子画不出面积）
 *   · 对照组把该 span 强制成 `inline-block + height:20px` 后**红底立刻可见**
 *     ⇒ 证明"不可见"是 0 高造成的，**不是探针失灵**（这一条是本段结论的地基：
 *        我第一版探针忘了撤 `#landing`/`#mask` 遮罩，鼠标命中全被遮罩吃掉，
 *        得出了"老项目 hover 底可见"的假结论；加了遮罩对照实验才站得住）。
 * ⇒ 老项目桌面档 hover 的**可见范围就是那枚 18×20 感应区**，纵向 0 溢出。
 *
 * 🔴 本项目此前用 `box-shadow: 0 0 0 7px var(--hover)` + `border-radius:7px`
 *   把 0×0 盒撑成 **14×14 圆角块** —— 纵向比老项目多盖 14px、山形是圆的，
 *   而三角只有 8×8 ⇒ 底色从上下各溢出 3px（用户报障第 7 条 b 的真根因）。
 *   box-shadow 的 spread 是**等距**的，压不到"只横向"，所以整条弃用。
 *
 * 🔴🔴🔴 **hover 底必须挂在 ::after（感应区）上，不能挂父段落，也不能挂 ::before**。
 *   两个都试过，都会坏，且坏法不同
 *   （2026-10-06 真浏览器网格扫 dx∈[-6,40] dy∈[-4,20] 步长 2，逐格读 computed background）：
 *   ① `.ns-fold > :first-child:hover::before`（挂父段落）
 *      ⇒ 鼠标落在**标题文字**上（同一段落内）三角就亮底 ——
 *      实测「标题文字处(左起 34px) 有底色 = true」，而那里根本不在把手上。
 *      老项目是 `span.ns-fold-mark:hover`，hover 域**就是把手本身**，
 *      标题文字在 span 之外 ⇒ 鼠标移到标题上，三角不亮。
 *   ② `.ns-fold > :first-child::before:hover`（挂伪元素自己）
 *      ⇒ **恒不命中**：::before 的盒是 0×0（视觉全由 border 构成），
 *      零面积盒拿不到 hover —— 网格扫 13×24 = **312 个点全灭**（无一格命中）。
 *      ⇒ 桌面档唯一的 hover 承载体就是那枚 18×20 的 ::after。
 *
 * 结论：`::after:hover` —— hover 域 = 18×20 感应区（= 老项目把手的可点域），
 * 标题文字在域外不亮底、三角在域内亮底，与老项目语义一致。
 * 窄屏档（≤560px）感应区放大到 44×44，hover 域随之放大（老项目同款）。 */
.ns-fold > :first-child::after:hover {
  background: var(--hover);
}
/* 命中区放大：老项目 index.html:399 在把手上挂一枚absolute 的透明 ::after
   （18×20）——因为三角改用边框画之后 span 自身盒高恒为 0，桌面唯一命中面
   就是 ::before 的边框盒（实测掉到 63px²），点偏就落进正文。
   本项目把手盒同理是 0 高，故必须补这一枚。 */
.ns-fold > :first-child { position: relative; }
.ns-fold > :first-child::after {
  content: ""; position: absolute; left: -4px; top: -15px; width: 18px; height: 20px;
  /* 🔴 感应区也归pointer 管：老项目那枚 ::after 是 `.ns-fold-mark` 的子伪元素，
     继承 span 的 `cursor:pointer`（index.html:386+399）。
     bj 的 ::after 直接挂在标题段落上，不写这一条就退回 auto ——
     三角本体（::before）是小手、旁边 18×20 的感应区却是默认箭头，
     用户在同一枚把手上看到两种指针（实测elementFromPoint 命中同一把手）。
     ⚠️ 命中区**不能**比三角更宽地吃指针：18px 已含右缘 2px 余量，
     再宽就会盖到标题首字上（老项目 index.html:393 实测右缘 132px vs 首字 133px）。 */
  cursor: pointer;
}
/* 正文：往里缩进 + 左侧引导线（--line 令牌，非新色；老项目 v9.1.1 同款）。
   🔴 缩进必须是 1em 不是 14px：老项目 index.html:402 是
     `margin-left:.5em;padding-left:1em` —— 用 em 是因为字号会随
     ≤560px 媒体查询从 17px 掉到 16px，写死 px 会让窄屏的引导线内缩量对不上。 */
.ns-fold > :not(:first-child) { padding-left: 1em; border-left: 2px solid var(--line); margin-left: .5em; }
/* 收起态：藏掉除标题外的全部子块。标题恒可见（老项目铁律：收起后仍要能看见并再展开） */
.ns-fold[data-open="false"] > :not(:first-child) { display: none; }

/* 🔴 窄屏（≤560px）把手命中区 44×44（老项目 index.html:418）。
   老项目是把span 本体改成 44×44 的 inline-flex，本项目把手是 ::before、
   改它会破坏三角几何，故由 ::after 承担这块 44×44 感应区。
   三角同时按老项目 v10.0.4 放大一档（长边 8→9px、上下 4→5px），手指更容易点中。 */
@media (max-width: 560px) {
  .ns-fold > :first-child::before {
    border-top: 5px solid transparent;
    border-bottom: 5px solid transparent;
    border-left: 9px solid var(--muted);
    top: 0;
  }
  .ns-fold[data-open="true"] > :first-child::before {
    border-top: 9px solid var(--muted);
    border-bottom: 0;
    border-left: 5px solid transparent;
    border-right: 5px solid transparent;
    top: 0;
  }
  .ns-fold > :first-child::after { left: -8px; top: -12px; width: 44px; height: 44px; }
}

/* 🔴 打印时展开全部折叠（老项目 index.html:423，浏览器 Ctrl+P 直打活的编辑器，
   收起态正文会整段丢在纸外）。老项目那条 @media print 一共 6 条声明：
     `#editor .ns-fold-hide{display:block}`（还原正文）
     `#editor .ns-fold-mark{font-size:inherit}`（显回 [折叠] 标记文本）
     `#editor .ns-fold-mark::before,#editor .ns-fold-open>.ns-fold-mark::before{content:'';display:none;border:0;width:0;height:0;top:0}`（去三角，两态）
   bj 逐条对照：
     · 还原正文 —— 下面 ① 对应。
     · 显回 [折叠] 文本 —— **bj 无此对象**：老项目把 `[折叠]` 字面文本留在 DOM 里、
       用 `font-size:0` 藏起来，打印时还原；bj 的把手是纯 ::before 三角（模型见 nodes.ts
       FoldNode，标题存字段），DOM 里根本没有这串文本，故无对应声明（不是漏了）。
     · 去三角 —— 下面 ② 对应，且**必须两态都杀**。
   三角是用边框画的，所以"去三角"必须连边框一起清零 —— 只清 content 会留下一枚画出来的三角。 */
@media print {
  /* ① 还原正文 */
  .ns-fold[data-open="false"] > :not(:first-child) { display: block; }
  /* ② 去三角（两态）
     🔴🔴 bj 的展开态三角是**另一条规则** `.ns-fold[data-open="true"] > :first-child::before`，
     specificity (0,2,1)，高于这里单写 `.ns-fold > :first-child::before` 的 (0,1,1) ——
     只写一条会被展开态压回去，**打印时"展开的折叠块"仍会画出三角**
     （老项目为此在 :423 同时挂了 `.ns-fold-mark::before` 与 `.ns-fold-open>.ns-fold-mark::before`
     两条选择器，原因同此）。所以展开态必须单列一条同 specificity 的选择器。 */
  .ns-fold > :first-child::before,
  .ns-fold[data-open="true"] > :first-child::before {
    content: ""; display: none; border: 0; width: 0; height: 0; top: 0;
  }
}

/* 🔴 空态占位符（老项目 index.html:341 + :746 `data-ph="开始输入，自动同步到所有设备…"`）。
   原先**整条规则缺失** —— 空编辑器是一片纯白，用户不知道能不能点、能不能打字。
   🔴🔴 判据不能照抄老项目的 `#editor:empty:before`：老项目编辑器是**裸
     contenteditable div**，空了就是真空；本项目是 Lexical，**永远**至少有一个
     `<p class="ns-p"><br></p>`（实测 :empty恒不成立，见 15-visual-editor 的探针断言）。
     照抄的结果是规则在、但永远不命中 —— 又是那种"代码写了、界面没变"的静默失效。
     ⇒ 改判"唯一子元素且它里面只有 Lexical 托管的占位 br"。 */
.ns-editor:has(> .ns-p:only-child > br:only-child)::before {
  content: attr(data-ph);
  color: var(--muted); opacity: .75;
  pointer-events: none;
  /* 🔴 v1.13.0：绝对定位，脱离行盒（上面 position:relative 是它的坐标系）。
     🔴 别删这三条 position —— 删回行内就是"新建笔记光标落在第二行"那个 bug：
     行内 ::before 会被后面的块级 <p> 挤进匿名块独占第一行。
     top/left 与上面 padding（40px 28px）逐字对齐；移动端那条 @media 里同步改了。 */
  position: absolute;
  top: 40px;
  left: 28px;
  right: 28px;
  line-height: 1.9;
  /* 占位符不换行的话，长文案在窄屏会溢出编辑区 */
  white-space: pre-wrap;
}
/* 🔴 v1.13.0：占位符的窄屏覆盖。**必须写在上面那条主规则之后**（原来它挂在
   560px 那段 @media 里、位置在前，被主规则的 top:40px/left:28px 压掉 ——
   实测窄屏占位符比正文第一行高 16px、缩进差 10px）。
   🔴 这是**源码顺序承重**，不是 specificity 问题：`:has()` / `:not()` 都不贡献
     额外 specificity（`:not()` 取其参数的），@media 也不提升，两条同分 ⇒ 谁后写谁赢。
     所以修法是搬顺序，不是堆类名/属性压过。
   🔴 top/left/right 逐字对齐窄屏的 .ns-editor padding: 24px 18px（560px 那段）。
     改窄屏 padding 必须回来同步这三条，否则窄屏重新错位。
   🔴 移动任一条（主规则或这条）都会让窄屏错位 16px/10px。 */
@media (max-width: 560px) {
  .ns-editor:has(> .ns-p:only-child > br:only-child)::before {
    top: 24px;
    left: 18px;
    right: 18px;
  }
}

/* 正文图片：老项目 index.html:343
   `border-radius:10px; border:1px solid var(--line); cursor:zoom-in`。
   🔴 原先圆角 8px、无描边、无 zoom-in 光标。 */
.ns-img { display: block; max-width: 100%; margin: 6px 0; }
.ns-img img {
  display: block; max-width: 100%;
  border-radius: 10px;
  border: 1px solid var(--line);
  cursor: zoom-in;
}

footer.ns-foot {
  display: flex; align-items: center; justify-content: center; gap: 7px;
  padding: 14px 18px; font-size: 12px; color: var(--muted);
  letter-spacing: .14em;
  border-top: 1px solid var(--line);
  position: relative; min-height: 46px;
  /* 🔴 同顶栏：老项目 footer 也没有 background，靠页面底色透上来（实测 rgb(251,251,248)）。
     bj 此前透明，滚动时底栏会"糊"出下层内容。 */
  background: var(--bg);
}
/* 触控区 44px：图标 19px 靠 padding 撑到手指够得着的尺寸 */
footer.ns-foot #menuBtn {
  position: absolute; left: 10px; top: 50%; transform: translateY(-50%);
  display: flex; align-items: center;
  padding: 10px 14px; min-height: 44px; min-width: 44px;
  justify-content: center; border-radius: 8px;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  letter-spacing: 0;
}
footer.ns-foot #menuBtn svg { width: 19px; height: 19px; display: block; }
footer.ns-foot #menuBtn:active { opacity: .6; }
footer.ns-foot #menuBtn:hover { background: var(--hover); }
footer.ns-foot .dot {
  width: 7px; height: 7px; border-radius: 50%; background: var(--dot-idle);
  /* 🔴🔴 老项目 index.html:498 只有 `flex-shrink:0`，**没有 margin-left**。
     此前这里写了 `margin-left:42px` —— 一个没有任何出处的硬编码偏移，
     把「绿点 + 文字」这一组整体往右推，于是"已同步"看着就不居中了（用户报障第 4 条）。
     居中由footer 的 justify-content:center + gap:7px 负责，元素自己不许再偏移。 */
  flex-shrink: 0;
  /* 老项目 index.html:498 `transition:background .3s`（简写、非 ease）——照抄不改。 */
  transition: background .3s;
}
/* 🔴🔴 老项目 index.html:499 `footer .dot.on{background:#2FA866}`。
   此前接的是 var(--accent)（金色 #8F7126），于是"已同步"显示成**黄点** —— 用户报障第 4 条。
   老项目 .dot 无夜间覆写（两档都是硬编码单值），故夜间同为这枚绿。 */
footer.ns-foot .dot.on { background: var(--dot-on); }
footer.ns-foot .dot.off { background: var(--danger); }
#refreshBtn {
  position: absolute; right: 10px; top: 50%; transform: translateY(-50%);
  width: 40px; height: 40px; display: grid; place-items: center;
  border-radius: 8px; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
#refreshBtn svg { width: 19px; height: 19px; display: block; }
#refreshBtn:active { opacity: .6; }
#refreshBtn:hover { background: var(--hover); }
.offlinebar { color: var(--muted); }

/* ---------- 菜单面板 ---------- */
/**
 * 🔴🔴 菜单视图容器**必须是普通块级，不能是 flex 列**（用户报障「菜单栏间距比老版本大」）。
 *
 *   量化实测（同 Playwright、同 390x844 视口、同 11 行）：
 *     老项目：行高 46、行顶间隔 51（= 46 + margin-bottom 5）
 *     bj 改前：行高 42、行顶间隔 55
 *
 *   差在两处，都是 `display:flex; flex-direction:column; gap:8px` 这一句带来的：
 *     ① **gap 8px 是凭空多出来的间距** —— 老项目 `#menuMainView`（index.html:480）
 *        只有 `max-height` + `overflow-y`，**没有任何 gap**；行与行的间距全部来自
 *        行自身的 `margin-bottom:5px`（:437）。8+5=13 ⇒ 一眼就"松"。
 *     ② **flex 列容器里的行会被压扁**：容器有 `max-height:min(72vh,560px)`，
 *        11 行 × 46 + gap 撑破上限 ⇒ flex 项按 `flex-shrink:1` **收缩**，
 *        于是行高从 46 掉到 42（内容被压，不是 min-height 生效）。
 *        这解释了"明明 min-height 写的是 42、老项目却是 46"：
 *        老项目的 46 = 26(图标) + 9+9(padding) + 1+1(border)，是**内容撑出来的**，
 *        压根没用到 min-height。
 *        ⇒ 别去改 min-height，那是拿错误的东西凑数字。
 *
 *   修法：退回块级（块级下 margin-bottom 不合并、不被压扁），gap 去掉。
 */
#menuMainView, .menu-view { display: block; }
#menuMainView { max-height: min(72vh, 560px); overflow-y: auto; }
/* 菜单盒比普通弹层宽一点：菜单项有一列 112px 标签 + 26px 图标，420px 会挤 */
.menu-box {
  max-width: none; width: min(86vw, 300px);
  text-align: left; padding: 14px 16px;
}
/* 🔴 菜单盒收焦点（Esc 关闭靠它）—— 焦点框本身不该露出来：
   菜单一打开就带一圈描边，与老项目"点开就干净浮层"的观感不符，
   而 role=dialog 的语义也由 aria-label 承担，视觉焦点圈是多余的。 */
.menu-box:focus { outline: none; }
.menu-item {
  display: flex; align-items: center; gap: 12px;
  /* 🔴🔴 justify-content:center —— 老项目 index.html:437 明确写 center。
     * 缺这一句时 flex 默认 flex-start，整组菜单贴左，与老项目"两侧对称留白"的
     * 观感差一截（用户反馈"贴左大片空 = 失衡"的反面：老项目是**居中**）。
     * 二级视图的行由下面 .menu-sub 规则改回 flex-start（老项目 :447 同款）。 */
  justify-content: center;
  width: 100%; box-sizing: border-box;
  padding: 9px 12px; margin-bottom: 5px;
  min-height: 42px; line-height: 1.4;
  border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; color: var(--fg); font-size: 15px;
  /* 🔴🔴 老项目 `.menu-item` **没有 background**（实测 rgba(0,0,0,0)）——
     菜单行的底色来自外层 `.box`（弹层底），行本身是透明的。
     bj 此前给每行加了 `background: var(--box-bg)`（= 白），
     于是菜单打开时每一行都是**独立白块**、行间露出弹层底色（实测 rgb(255,255,255) vs 透明）
     —— 这正是用户报障第 4 条「菜单项间距不同 / 看着不对」的成因。
     删掉即可，弹层底色由 .menu-box 承担。 */
  background: transparent;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: border-color .2s ease, background-color .2s ease;
}
.menu-item:hover { border-color: var(--accent); }
.menu-item:active { background: var(--hover); }
/* 🔴🔴 菜单项图标 **26px**（老项目 index.html:443 `.menu-item svg{width:26px;height:26px;flex:none}`）。
   上一批误改成 20px：单看一个图标只是"小一号"，但菜单是 11 行同屏的成组元素 ——
   整列图标缩到 20px 后菜单明显"变精致/变小气"，与老项目并排一眼就不同。 */
.menu-item .ic { width: 26px; height: 26px; flex: none; color: var(--fg); }
/* 🔴 标签列定宽 112px —— 老项目 CSS 的原值，别"顺手改成自适应" */
.menu-item .mi-l, #menuThemeLabel {
  width: 112px; text-align: left;
  /* 🔴🔴 font-size 必须 15px（老项目 .menu-item 的字号），此前写 14px。
     连带后果：行内容器高度按字号走，14px 时标签盒26px、整行 42px（只够 min-height）；
     老项目 15px 时标签盒 21px、整行 46px（内容把行撑到 46）。
     量化实测：老项目行高 46、bj 42 —— 这就是用户报的「菜单项间距不同」。
     🔴 别用 min-height 去修成 46：那只是把行撑高，标签字号仍与老项目不同。 */
  font-size: 15px;
}
/* 🔴🔴 二级视图内的所有菜单行左起笔（老项目 index.html:447
   `#menuFavView .menu-item,#menuHistView .menu-item{justify-content:flex-start}`）。
   用户报「收藏列表太靠左没和返回对齐」的根因是主菜单那套居中逻辑漏到了二级页；
   图标列与列表行的图标列必须落在同一条竖线上（同为左 12px padding）。 */
.menu-sub .menu-item { justify-content: flex-start; }
/* 历史列表容器：独立滚动限高。老项目 index.html:478
   `#menuHistList,#menuFavList{max-height:min(50vh,400px);overflow-y:auto}`。
   🔴 没有限高时条目一多就把菜单盒撑出屏幕，"关掉菜单"这件事本身变成不可能。 */
.list-scroll { max-height: min(50vh, 400px); overflow-y: auto; -webkit-overflow-scrolling: touch; }
/* 🔴🔴 计数行：等宽体 + uppercase + 字距 .14em + **金色引导圆点**
   （老项目 index.html:462-463 逐字）：
     .list-kicker{display:flex;align-items:center;font:400 10.5px/1 <mono>;letter-spacing:.14em;
                  text-transform:uppercase;color:var(--muted);padding:6px 4px 10px}
     .list-kicker::before{content:'';width:5px;height:5px;border-radius:50%;background:var(--accent);margin-right:8px;flex:none}
   原先只有 11.5px 普通灰字：那一行成了纯说明文字，与下方列表没有层级关系。 */
.list-kicker {
  display: flex; align-items: center;
  font: 400 10.5px/1 var(--mono);
  letter-spacing: .14em; text-transform: uppercase;
  color: var(--muted); padding: 6px 4px 10px;
}
.list-kicker::before {
  content: ''; width: 5px; height: 5px; border-radius: 50%;
  background: var(--accent); margin-right: 8px; flex: none;
}
.link-hint { margin: 2px 6px 0; font-size: 11.5px; line-height: 1.6; color: var(--muted); }
/* 🔴🔴 链接打开方式那一页的选中标记（用户报障第 4 条「没有选中状态」）。
   老项目原文 `.tick{margin-left:auto;width:16px;height:16px;color:var(--accent);
   visibility:hidden}` —— **默认隐藏、选中才 visible**，
   靠 CSS 可见性表达"选中"而不是插/删 DOM（两个选项行结构完全对称，切换时不会跳）。
   🔴 bj 此前既没有 .tick 规则、也没有对勾图标（拿五角星顶替），
   于是这一页**没有任何选中态**。
   aria-checked 由 markup 提供，.tick 只管视觉——两者都要，别只做其中一个。 */
.tick { margin-left: auto; width: 16px; height: 16px; color: var(--accent); visibility: hidden; }
[aria-checked="true"] > .tick { visibility: visible; }
.tick svg { width: 16px; height: 16px; display: block; }
/* 🔴 两行各自的专属图标：尺寸与菜单项其它图标一致（老项目 .menu-item svg 同款） */
.menu-item.link-opt > svg { width: 26px; height: 26px; flex: none; }
/* 🔴🔴 二级页空态**逐值抄老项目** `#menuFavEmpty/#menuHistEmpty`（index.html:494-497）：
   flex 列 + 居中 + gap 8px + 12.5px muted + padding 22px 0 16px，
   **外加一枚 22px / opacity .55 的轮廓图标**（收藏=空心星、历史=时钟）。
   此前是 `padding:26px 0;font-size:13px` 的一句裸文本：
   没有图标、字号与留白都与老项目不同 —— 空列表看着像"报错"而非"还没有内容"。 */
.empty {
  display: flex; flex-direction: column; align-items: center; gap: 8px;
  text-align: center; color: var(--muted); font-size: 12.5px;
  padding: 22px 0 16px;
}
.empty-ic, .empty-ic > svg { width: 22px; height: 22px; flex: none; }
.empty-ic { opacity: .55; }
/* 列表行：与主菜单同族的胶囊行（老项目 .fav-row index.html:456）。
   🔴 三列各自定宽：图标列 / 名字列 / 右箭头列 —— 与主菜单的"112px 标签列"是同一种
   「定宽起线齐」的排版纪律；改成自适应的话长短名会让右箭头列参差不齐。 */
/* 🔴🔴🔴 `flex-wrap: wrap` 是 `.hist-preview{width:100%}` 能换行的**唯一前提**。
   老项目 index.html:465 `.hist-item{display:flex;flex-wrap:wrap;align-items:center;…}`
   —— 那个 wrap 就是"预览文本框落到按钮下方独占一行"的成因。

   🔴 缺它的症状（用户报障第 3 条「老版本是在预览按钮下方出现一个文本框」）：
     `.hist-preview` 的 `width:100%` 在 nowrap 的 flex 行里**不是"占满一行"**，
     而是"作为一个 flex 项被压到剩余空间"——量出来 263.39px（行内容宽 366），
     挤在时间戳右边成一条窄文本；`max-height:120px` 的滚动条也随之难触发。
   量化实测（390×844）：老项目 flex-wrap=wrap、预览块占满行内容宽；
   bj 改前 flex-wrap=nowrap、预览块被压到 263.39px。

   ⚠️ 这一条**不能**靠"给 .hist-preview 加 flex:0 0 100%"绕过去：
     那会让预览块脱离文档流里的行内布局，与老项目的换行机制不同，
     且在多按钮行下的对齐会漂。照抄 wrap 是唯一正解。 */
.list-row { display: flex; flex-wrap: wrap; align-items: center; gap: 10px; box-sizing: border-box;
            width: 100%; padding: 10px 12px; margin-bottom: 6px;
            min-height: 42px; font-size: 14px;
            border: 1px solid var(--line); border-radius: 10px;
            background: var(--box-bg); color: var(--fg); cursor: pointer;
            touch-action: manipulation; -webkit-tap-highlight-color: transparent;
            transition: border-color .2s ease; }
.list-row:active { background: var(--hover); }
.list-row:hover { border-color: var(--accent); }
/* 🔴🔴 历史行与收藏行**不是同一族**（老项目 .hist-item index.html:465 vs .fav-row :456）：
     .hist-item{padding:9px 12px;font-size:13px}  ← 比收藏行紧一号、字号小一号
     .fav-row {padding:10px 12px;font-size:14px}
   两者同用一个 .list-row 骨架，历史行靠这一级拉回老项目的两个值。
   （差异来自"行内有什么"：历史行装的是等宽时间戳+两枚按钮，收藏行只装一个笔记名。） */
.list-row.hist-row { padding: 9px 12px; font-size: 13px; }
/* 收藏金星 18px（老项目 .fav-star index.html:459）/ 历史时钟 16px（:467 .hist-clock）
   🔴🔴 选择器必须**同时命中包裹 span 与内部 svg**：SVG 没有 width/height 属性时
   默认占 300×150，只给 span 定尺寸的话里面会撑出一个巨大空框（行高整个炸开）。
   老项目是把这三个类直接写在 <svg> 上，本项目多了一层 span 包裹，故要写全两处。 */
.list-row .fav-star, .list-row .fav-star > svg { width: 18px; height: 18px; flex: none; }
.list-row .fav-star { color: var(--accent); }
.list-row .hist-clock, .list-row .hist-clock > svg { width: 16px; height: 16px; flex: none; }
/* 名字列走**等宽体**：老项目 index.html:460 `.fav-name{font:400 13.5px/1.5 <mono>;letter-spacing:.01em}`
   / :469 `.hist-meta{font:400 12.5px/1.5 <mono>;color:var(--muted);letter-spacing:.02em}`。
   🔴 等宽体给笔记名/时间戳一种"标识符"感，与正文的比例字形明确区分开。 */
.list-row .fav-name { flex: 1; min-width: 0; font: 400 13.5px/1.5 var(--mono);
                      letter-spacing: .01em; color: var(--fg);
                      overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 🔴🔴 2026-10-09：改回老项目 `nowrap + ellipsis` 截断（index.html:469 逐字）。
   2026-10-08 曾去掉截断以"显示完整时间"，但用户复核后要求改回老版本
   「不换行、超出省略」，时间戳也回到 `MM-DD HH:mm`（见 sync/history.ts fmtHistTime）。 */
.list-row .hist-meta { flex: 1; min-width: 0; font: 400 12.5px/1.5 var(--mono);
                       letter-spacing: .02em; color: var(--muted);
                       overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 右箭头列 14px muted（老项目 .fav-go index.html:461）—— "这一行可以进去"的唯一暗示 */
.list-row .fav-go, .list-row .fav-go > svg { width: 14px; height: 14px; flex: none; }
.list-row .fav-go { color: var(--muted); }
/* 冲突视图里的纯文本行（无图标列/箭头列） */
.list-row .grow { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis;
                  white-space: nowrap; }
/* 🔴 按钮 min-height 32px（老项目 index.html:473 `.hist-btns button{min-height:32px;…}`） */
.row-btn { flex: none; min-height: 32px; padding: 4px 12px; border-radius: 8px; font-size: 12.5px;
           border: 1px solid var(--line); background: var(--bg); }
.row-btn:hover { background: var(--hover); }
/* 🔴🔴🔴 必须有一条**更特异**的规则把历史行按钮从弹窗通栏规则里救出来。
 *
 * 病根：历史版本行住在 `.box menu-box` 里（menu.ts:203 `class="box menu-box"`，
 *   历史页 body 在 menu.ts:379），而 styles.css:321 的弹窗主按钮规则是
 *   `.box button:not(.box-x){width:100%;height:46px;padding:0 14px;border-radius:10px;
 *     font-size:15px;…}` —— specificity **(0,2,1)**，**命中**历史行按钮。
 *   `.row-btn` 自己只有 **(0,1,0)**，被压得几乎只剩min-height。
 *
 * 量化实测（真浏览器，`.box.menu-box` 内放一条同构历史行，2026-10-06）：
 *   before：按钮 131×46（width 130.812px / height 46px）、padding 0 14px、radius 10px、font-size 15px
 *   after ↓（本条修复后）：按钮 **51×32**、padding 4px 12px、radius 8px、font-size 12.5px
 *   —— 51×32 与老项目 `.hist-btns button{min-height:32px;padding:4px 12px;font-size:12.5px}`
 *      在 420px 宽容器内实测一致。
 *
 * 🔴 为什么不用 `.box button.row-btn` 就够：那条是 (0,2,1)，
 *   与被压的 `.box button:not(.box-x)` **同分** ⇒ 只能靠源码顺序取胜，
 *   而弹窗那条写在样式区**前面**（:321 vs :977），赢不了。
 *   `.box .list-row .hist-btns button.row-btn` 是 (0,4,1)，**结构性地压过**，
 *   不依赖顺序 ⇒ 以后有人在后面再加一条 .box 按钮规则也不会把它打回去。
 *   同样刻意避开 `.box button:not(.box-x)` 里的 :not() 排除写法：
 *   那样只是"同分靠后"，同样脆弱。 */
.box .list-row .hist-btns button.row-btn {
  width: auto; height: auto; min-height: 32px;
  padding: 4px 12px; border-radius: 8px; font-size: 12.5px;
  background: var(--bg); color: var(--fg); font-weight: 400;
  letter-spacing: normal;
}
/* 同理，hover/active 的 opacity 通路也来自通栏规则（styles.css:327-328），
   老项目 `.hist-btns button` 没有 opacity 过渡，只有背景色变化。 */
.box .list-row .hist-btns button.row-btn:hover { opacity: 1; background: var(--hover); }
.box .list-row .hist-btns button.row-btn:active { opacity: 1; }
.box .list-row .hist-btns button.row-btn:disabled {
  background: var(--line); color: var(--muted); cursor: not-allowed;
}
/* ---------- 历史版本「预览」内联展开（老项目 index.html:456 `.hist-preview` 逐字）----------
 * 🔴 用户报障第 4 条「历史版本页面没有预览按钮」——功能缺失，这一块是它的容器。
 *   逐值抄老项目：背景 --hover、左侧 2px 金色竖条（"这是内容不是按钮"的语义）、
 *   max-height 120px + overflow-y:auto（长版本能滚，不把列表撑到爆）、
 *   white-space:pre-wrap + word-break:break-all（预览的是**正文**，换行必须原样保留）。
 *   ⚠️ 最后一对是功能性的，不是美化：去掉 pre-wrap 会让"空行"在预览里消失，
 *   于是用户看到的预览与恢复后的正文长得不一样，误以为恢复会丢内容。
 */
/* 🔴🔴 左侧竖条是 `color-mix(accent 55%, transparent)`，**不是** var(--accent)。
 *   老项目 index.html:470 逐字：`border-left:2px solid color-mix(in srgb, var(--accent) 55%, transparent)`。
 *   bj 此前写 `var(--accent)` = 100% 不透明 ⇒ 竖条比老项目明显更重、更抢眼，
 *   而这正是"预览内容"的克制性引导线，写成实色就变成了"强调框"。 */
.hist-preview { width: 100%; margin-top: 2px; padding: 9px 12px; background: var(--hover);
                 border-radius: 10px;
                 border-left: 2px solid color-mix(in srgb, var(--accent) 55%, transparent);
                 font-size: 12.5px; line-height: 1.7; color: var(--muted);
                 white-space: pre-wrap; word-break: break-all;
                 max-height: 120px; overflow-y: auto; }
/* 展开预览的那一行：描边转金、与收起态一眼可辨；与老项目一致用 color-mix 柔和金（老项目 .hist-item.hist-open 为 accent 45% + line） */
.list-row.hist-open { border-color: color-mix(in srgb, var(--accent) 45%, var(--line)); }
/* 预览/恢复两枚按钮的容器：gap 6px、整体不参与压缩（老项目 .hist-btns） */
.list-row .hist-btns { display: flex; gap: 6px; flex-shrink: 0; }
/* 预览/链接页的按钮行。导出全屏预览的「下载 / 完成」用它。 */
.link-actions { display: flex; gap: 12px; justify-content: center; margin-top: 14px; }
/* 🔴🔴 导出全屏预览的图：逐值抄老项目 index.html
   `img.setAttribute('style','max-width:100%;max-height:60vh;border-radius:12px;background:#fff')`。
   此前本规则只有 `display:block;margin:0auto`，注释还写着"圆角 + 白底"——
   **注释描述了三条，规则里一条都没有**（max-width/max-height/border-radius/background 全缺）。
   症状正是用户报障第 3 条「导出为图片…图片外围的边框不同」：
   图按原始像素宽铺开、顶到遮罩边、方角、夜里背景透明直接糊在深色上。
 * 容器侧的 max-width:92vw 由老项目在 box 上用行内样式给（max-width:92vw），
   这条只管图自身，两者都要。 */
#imgPreviewMask img {
  display: block; margin: 0 auto;
  max-width: 100%; max-height: 60vh;
  /* 🔴 底色走 --qr-paper 令牌，不写 #fff：S4-T7 纪律闸禁止 CSS 里出现颜色字面量
     （改配色时会漏改，症状是"夜间某处还是浅色"）。
     老项目这里是行内 `background:#fff`，但它整套 CSS 都在主题反色块覆盖之下，
     bj 既然把色板收进 theme.ts，就该用等价令牌。--qr-paper 正是"纸白"。*/
  border-radius: 12px;
  background: var(--qr-paper);
}

/* ---------- 皮肤覆膜层 ---------- */
/* 🔴 非色彩、低透明、**不拦截交互**（pointer-events:none），老项目同此。
   背景纹理由 ui/theme.ts 的 skinOverlayStyle() 直接写 style.background ——
   这里只管几何与层序。 */
#skinFx { position: fixed; inset: 0; z-index: 60; pointer-events: none; }
/* 复古皮肤：**整站等宽**（老项目 nsSkinOverrideCss 对两档皮肤都注入
   `body{font-family:"Cascadia Mono",Consolas,…monospace}`，index.html:1102）。
   🔴🔴 2026-10-09 修订（用户报障第 9 条）：
     · 此前是 `body.skin-a{--serif:var(--mono)}` —— 那是"只换字形不换配色"的旧做法，
       且**改错了对象**：老项目改的是 `body` 的 font-family，显式写了 `var(--serif)` 的
       元素（字标 b / 关于页标题 / 落地页大标题 / 结算卡文案 / 桌宠档案）**仍是衬线**。
       把 `--serif` 改成 mono 会把这些元素一起拉成等宽，与老项目并排看得出。
     · 字体栈也用老项目皮肤那套 `--skin-mono`（Cascadia Mono 优先），
       与 `--mono`（ui-monospace）分开 —— 老项目就是两套栈。 */
body.skin-a, body.skin-b { font-family: var(--skin-mono); }
/* 字标加宽字距（老项目 header .brand b{letter-spacing:.14em}，皮肤专属） */
body.skin-a #brandWord, body.skin-b #brandWord { letter-spacing: .14em; }
/* 皮肤档气泡字距（老项目 #versionToast{letter-spacing:.08em}；bj 对应 #skinToast） */
body.skin-a #skinToast, body.skin-b #skinToast { letter-spacing: .08em; }
/* 正文光标色（老项目皮肤专属 `#editor{caret-color:…}`；default 档 --caret = --fg，
   与"没写这条"的浏览器默认一致） */
.ns-editor { caret-color: var(--caret); }
/* 打字机纸皮肤：正文行距更松、字距略开（纸感横线由覆膜层负责） */
body.skin-b .ns-editor { line-height: 2.05; letter-spacing: .3px; }

/* 🔴🔴🔴 color-scheme 必须**类名驱动**（老项目 index.html:80/:92 逐字同款）：
     :root → light，body.dark → dark。
   实测（真浏览器 computedStyle，判据 VVW-29）：本条改之前，**日间与夜间都是
   `normal`** —— 而 `normal` 的含义是"我不表态"，UA 回落到自己的默认值，
   于是「应用内夜间」和「系统夜间」在滚动条轨道（track）上给出两套答案，
   且都与老项目不同（本项目对 track 没有任何自定义声明，老项目同样只有
   :426-427 的 width + thumb ⇒ 轨道色 100% 由 UA 说了算）。
   这就是用户报障第 5 条「夜间模式滚动条后面背景条颜色和老版本不一样」。

   🔴🔴 为什么**不能**继续用媒体查询（原先是这一条）：
     @media (prefers-color-scheme: dark) { html:not(.force-light) body { color-scheme: dark } }
     ① 它跟的是**系统偏好**，而本项目夜间是**时间规则 + 手动切换**说了算
        （theme.ts 的 applyTheme 写 body.dark）—— 两者不是一回事；
     ② 用户在日间把系统偏好设成深色时，媒体查询会给 body 盖上 color-scheme:dark，
        而页面配色仍是日间 ⇒ 表单控件、UA 轨道与页面配色当场打架；
     ③ `html:not(.force-light)` 里的 force-light **全仓没有任何代码去设置它**
        （grep 只有这一处出现），这个排除条件是死的，写着它只会让人误以为有兜底。
   老项目 :1124-1127 的注释也明写这套 color-scheme 是**为国产浏览器"网页夜间"
   强制反色做的对抗**（body.dark + color-scheme:dark 让对手判定页面已深色而放行），
   而那条对抗靠的正是**类名**，不是媒体查询。
   判据：test/e2e/16-visual-views.test.js VVW-29（钉死日夜两态，双向都验）。 */
:root { color-scheme: light; }
body.dark { color-scheme: dark; }

/* ================= 提醒：时间 chip / 响铃卡 / 提醒面板 ================= */
/* 🔴🔴 本段**零颜色字面量**，一律 var()。S4 的 ui-contract 测试有机械扫描，
   加了字面量会红。皮肤覆膜层（#skinFx, z-index 60）在下面，提醒层要盖过它。 */

/* ---- 时间 chip：老项目 v7.8.0 起是三行小卡（不是单行胶囊）----
   旧单行胶囊 white-space:nowrap + max-width:92vw 在窄屏把尾部CTA 整颗挤出屏幕，
   手机端看不见「添加提醒」（老项目用户实测）。现在 width:min(86vw,340px) 桌面手机同一套，
   省略号截断只落在事项行 —— 截断代价归事项，CTA 恒完整可见可点。 */
#timeChip { position: fixed; top: 54px; left: 50%; transform: translateX(-50%);
  z-index: 56; width: min(86vw, 340px); max-width: 92vw; padding: 13px 15px 15px;
  display: flex; flex-direction: column; gap: 9px; font-size: 14px; color: var(--fg);
  background: var(--box-bg); border: 1px solid var(--line); border-radius: 16px;
  box-shadow: var(--shadow-chip); cursor: pointer; user-select: none;
  -webkit-user-select: none; touch-action: manipulation; animation: chipRise .28s cubic-bezier(.2,.7,.3,1) both; }
/* 🔴🔴 to 帧必须显式写全transform：fill-mode:both 会在动画结束后永久接管
   transform，缺 to 帧时用的是「无动画时的计算值」，一旦基座换定位方式
   （如改成 bottom 锚点）居中偏移会被抹掉。旧写法只给了 from帧。 */
@keyframes chipRise {
  from { opacity: 0; transform: translateX(-50%) translateY(-8px); }
  to   { opacity: 1; transform: translateX(-50%); }
}
#timeChip .ns-chip-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; }
/* 🔴 相对日11px + .08em 字距（老项目 index.html:218 `.chip-day{font-size:11px;...;letter-spacing:.08em}`）。
   原先 12.5px 无字距 —— 与右侧 16px 的时钟并排时左边那块明显偏大偏松。 */
#timeChip .ns-chip-rel { flex: none; font-size: 11px; color: var(--muted); letter-spacing: .08em; }
#timeChip .ns-chip-clock { font-size: 16px; font-weight: 600; line-height: 1.35;
  font-variant-numeric: tabular-nums; }
/* 🔴 事项行字色 muted（老项目 index.html:219 `.chip-what{color:var(--muted)}`）。
   原先是 fg —— 事项与时间同色同重，读起来像两句并列的标题，而不是"主时间 + 次事项"。 */
#timeChip .ns-chip-item { font-size: 13px; line-height: 1.5; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 🔴 分隔线（老项目 index.html:220 `.chip-sep{height:1px;margin:1px -15px 2px;background:var(--line)}`）。
   负margin 让线**通栏**抵到卡片左右内边距（老项目原值），不是缩在内容列里。 */
#timeChip .ns-chip-sep { height: 1px; margin: 1px -15px 2px; background: var(--line); }
/* 🔴 CTA 回到老项目的**通栏居中 42px**（老项目 index.html:221
   `.chip-cta{display:flex;align-items:center;justify-content:center;min-height:42px;...}`）。
   原先是 `align-self:flex-start` 的小钮 —— 左对齐、贴着事项行，
   与"通栏按钮"的语言完全不同（老项目全站主按钮一律通栏反色）。 */
#timeChip .ns-chip-cta { align-self: stretch; display: flex; align-items: center;
  justify-content: center; min-height: 42px; padding: 0; border-radius: 11px;
  font-size: 14.5px; font-weight: 600; letter-spacing: .02em;
  color: var(--bg); -webkit-text-fill-color: var(--bg); background: var(--fg); }
#timeChip .ns-chip-cta:active { opacity: .82; }
/* 已添加的两行确认卡：不是按钮，不吃通栏反色（老项目 index.html:229-230）
   🔴 老项目 `.chip-ok1` 是 flex + space-between（左右分置），不是通栏居中；
      `.chip-ok2` 的色是 muted。这里照抄老项目的「行左标题 + 行右事项」布局。 */
/* 🔴🔴 已添加态两行确认卡（老项目 index.html:228-230 + 6486 buildChipDeleteBtn）。
   此前新项目是**三行 + 无删除钮 + ok1 吃 var(--accent) 金色**：
     - ok1 必须是 flex + space-between（左「✅ 提醒已添加」右「删除」钮），
       色是 var(--fg)（**不是** accent）—— 金色会把"状态"读成"可点"。
     - ok2 是时间＋事项（色 muted），不是相对日。
     - chip-del 是 span 伪按钮：描边胶囊 12px，不是实心块。
   这三样都落在用户报的第 8 条「弹窗标题、按钮大小、字体大小和颜色不一样」上。 */
#timeChip.feedback { gap: 5px; cursor: default; }
#timeChip .ns-chip-ok1 { display: flex; align-items: center; justify-content: space-between;
  gap: 10px; font-size: 14.5px; font-weight: 600; line-height: 1.4; color: var(--fg); }
#timeChip .ns-chip-ok2 { font-size: 13px; line-height: 1.5; margin-top: 0; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#timeChip .ns-chip-del { flex: none; padding: 2px 10px; font-size: 12px; font-weight: 400;
  color: var(--fg); border: 1px solid var(--line); border-radius: 999px; cursor: pointer;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
#timeChip .ns-chip-del:hover { border-color: var(--muted); }
#timeChip .ns-chip-del:active { opacity: .7; }

/* ---- 上传状态条 #uploadNote：老项目 showUploadStatus 同款 ----
   🔴🔴 位置与配色整体退回老项目（index.html:598 `.upload-status`）：
     老项目是**贴底黑色胶囊** —— `position:fixed; bottom:44px; z-index:89;
     background:var(--upload-bg); color:var(--bg); padding:10px 20px;
     border-radius:999px`，靠 opacity 进出，不是白卡。
     原先是 `top:54px` 的**白卡**（--box-bg + 1px 描边 + 12px 圆角）——
     而top:54px 正是时间 chip 与提醒卡的锚点那条线，三者叠在同一条竖直轴上
     互相打架。贴底则与底栏成一条"状态带"，bottom:44px 正好坐在 44px 底栏之上。
   🔴 状态色：老项目**只有一种外观**（黑底反色），成功/失败全靠文案区分
     （index.html:2412「上传成功」/ :2416「上传失败：…，图片未插入，请重试」）。
     所以这里不再给 [data-kind] 染色：失败文案本身已含"未插入/请重试"，
     而染色会与 06/09/13/14 四支 e2e 依赖的 data-kind 语义脱钩
     （它们断言的是文案与 kind，不是颜色）。
   🔴 入场动画刻意不加：老项目这条只有 opacity 过渡（`.upload-status{transition:opacity .3s}`
     + `.show{opacity:1}`），没有位移入场。 */
#uploadNote { position: fixed; bottom: 44px; left: 50%; transform: translateX(-50%);
  z-index: 89; max-width: 88vw; padding: 10px 20px; font-size: 13px; line-height: 1.5;
  letter-spacing: .03em; color: var(--bg); background: var(--upload-bg);
  border-radius: 999px; box-shadow: var(--shadow-upload); pointer-events: none; }

/* ---- 响铃卡 remCard：页内主通道，无论通知权限如何都弹 ---- */
/* 🔴🔴 几何整体对齐老项目 index.html:189-206：
     padding 20/18/16 → 30/30/26、圆角 16 → 18、宽 360 → 380、
     z-index 58 → 80、补 remRise 入场。原先那张卡又扁又窄、层级还压在
     时间 chip 下面，而它是"到点提醒"这个最高优先级的事件。 */
.ns-remcard { position: fixed; left: 50%; top: 50%; transform: translate(-50%,-50%);
  z-index: 80; width: min(90vw, 380px); max-width: 86vw;
  padding: 30px 30px 26px; color: var(--fg);
  background: var(--box-bg); border: 1px solid var(--line); border-radius: 18px;
  box-shadow: var(--shadow-box);
  display: flex; flex-direction: column; gap: 14px; text-align: center;
  animation: nsRemRise .5s cubic-bezier(.2,.7,.3,1) both; }
/* 🔴🔴🔴 to 帧**必须自带 translate(-50%,-50%)** —— 这是老项目明确记过的事故
   （index.html:186-188 与 v5.44）：通用 rise 的 to 帧是 transform:none，
   而 fill-mode:both 会在动画结束后**永久接管 transform**，
   于是基座那半屏宽的居中偏移被抹掉，卡片左上角钉在屏幕中心点
   （用户看到的现象是"卡片不在正中心"，偏出去半个卡宽）。
   两个帧都写全居中位移，这个坑就绕过去了。 */
@keyframes nsRemRise {
  from { opacity: 0; transform: translate(-50%,-50%) translateY(14px); }
  to   { opacity: 1; transform: translate(-50%,-50%); }
}
.ns-remcard .box-x { position: absolute; top: 14px; right: 14px; }
/* 标题 18px（老项目 index.html:191 `.remCardTitle{font-size:18px}`）。原先 15px。 */
.ns-remcard-title { font-size: 18px; font-weight: 600; letter-spacing: .02em; }
/* 列表 gap 6px（老项目 index.html:195，v7.1.0 由 10 收到 6：用户反馈行距过大）。
   限高内滚 + overscroll 防滚动穿透（长列表顶爆卡片）。 */
.ns-remcard-list { display: flex; flex-direction: column; gap: 6px;
  font-size: 13.5px; line-height: 1.4;
  max-height: min(60vh, 440px); overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
/* 条目 min-height 40px 保可点热区（老项目 index.html:196）。 */
.ns-rem-item { display: flex; flex-direction: column; gap: 2px;
  min-height: 40px; justify-content: center; }
.ns-rem-when { font-size: 14px; overflow: hidden; text-overflow: ellipsis; }
/* 「知道了」：老项目 index.html:201 是 height:46px 通栏、字距 .08em。
   原先是 padding:11px（高约 41px）且字距没有 —— 与老项目 .box 主按钮
   同一套外观是v5.40 定的对齐关系，两处不一致就散了。 */
.ns-remcard-ack { display: flex; align-items: center; justify-content: center;
  width: 100%; height: 46px; margin-top: 4px; padding: 0; text-align: center;
  font-size: 15px; font-weight: 500; letter-spacing: .08em;
  color: var(--bg); background: var(--fg);
  border-radius: 10px; cursor: pointer;
  user-select: none; -webkit-user-select: none;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ns-remcard-ack:hover { opacity: .85; }
.ns-remcard-ack:active { opacity: .75; }

/* ---- 提醒面板 remPanel：时/分滚轮 ---- */
/* 🔴 滚轮值以dataset.val 为唯一事实源，jsdom 无布局也能读写与测试。 */
.ns-rembox { width: min(92vw, 380px); max-height: 86vh; overflow-y: auto; }
.ns-rem-form { display: flex; flex-direction: column; gap: 11px; }
.ns-rem-time-row { display: flex; align-items: center; justify-content: center; gap: 8px; }
.ns-rem-time-row input[type="date"] { flex: 1; min-width: 0; padding: 9px 10px;
  font-size: 14px; color: var(--fg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 10px; }
.ns-rem-colon { color: var(--muted); font-weight: 600; flex: none; }
/* 🔴 滚轮盒几何回老项目 index.html:235-242：
     外层 54×150、1px 描边、圆角 12、盒内上下渐隐mask；
     内层 15px 字号、50px 行高、cur 为 fg + 500。原先 62×132、无描边无渐隐。
   🔴 渐隐渐变整条来自 theme.ts 的 --wheel-fade-mask（含那个 #000 不透明挡位），
     本文件不出现颜色字面量 —— S4-T7 机械扫描闸守着这条。 */
.ns-rem-wheel-wrap { position: relative; width: 54px; height: 150px; flex: none;
  overflow: hidden; border: 1px solid var(--line); border-radius: 12px;
  background: var(--box-bg);
  -webkit-mask-image: var(--wheel-fade-mask);
  mask-image: var(--wheel-fade-mask); }
/* 🔴🔴🔴 内层高必须**写死 150px**，不能写 height:100%。
 *
 *   踩坑实录：外层 wrap 是 150px 且带 1px 描边 + box-sizing:border-box，
 *   于是 `height:100%` 解析成 150 − 1 − 1 = **148px**。
 *   而滚轮的行高是 50px、scroll-snap 吃的是"行高整数倍"，
 *   148 不是 50 的整数倍 ⇒ 吸附点算出来是 1px、51px…
 *   浏览器开局就把 scrollTop 拉到最近的吸附点**并触发一次 scroll 事件**，
 *   而 ui.ts 的 scroll 回调是 `val = round(scrollTop / 50)` ⇒ 默认小时被改写成 0。
 *   症状是"打开提醒面板，时间默认成了 00:00"，且只在加了描边之后出现 ——
 *   极像"snapping 坏了"，实际是一行 height:100%。
 *
 *   老项目没这个坑：它的 .rem-wheel 同样写在 150px 高的 wrap 里，
 *   但那时候还没有那条 1px 描边（描边是这一批按 index.html:235 复刻进来的）。
 *   行高 50px × 3 = 150 ⇒ 吸附点正好落在行边界上，scrollTop 开局为 0。 */
.ns-rem-wheel { width: 100%; height: 150px; overflow-y: auto;
  scroll-snap-type: y mandatory; scrollbar-width: none; outline: none;
  -webkit-overflow-scrolling: touch; }
.ns-rem-wheel::-webkit-scrollbar { display: none; }
.ns-rem-wheel:focus-visible { outline: 2px solid var(--accent); outline-offset: -2px; }
.ns-rem-wheel-pad { height: 50px; }
.ns-rem-wheel-it { height: 50px; line-height: 50px; text-align: center;
  font-size: 15px; color: var(--muted); scroll-snap-align: center;
  cursor: pointer; user-select: none; -webkit-user-select: none;
  font-variant-numeric: tabular-nums; }
.ns-rem-wheel-it.cur { color: var(--fg); font-weight: 500; }
/* 🔴🔴 选中线回到**金色 1.5px 上下双线**（老项目 index.html:242
   `.rem-wheel-mid{border-top:1.5px solid var(--accent);border-bottom:1.5px solid var(--accent)}`）。
   原先是 `1px solid var(--line)` 的中性灰细线 —— 那是"两条淡淡的分隔线"，
   看不出"当前选中的是这一格"；金色双线才是"选择器"该有的样子。 */
.ns-rem-wheel-mid { position: absolute; left: 5px; right: 5px; top: 50%; height: 50px;
  transform: translateY(-50%);
  border-top: 1.5px solid var(--accent); border-bottom: 1.5px solid var(--accent);
  border-radius: 2px; pointer-events: none; }
.ns-rem-input { width: 100%; padding: 10px 11px; font-size: 14px; color: var(--fg);
  background: var(--bg); border: 1px solid var(--line); border-radius: 10px; }
.ns-rem-add { width: 100%; padding: 11px; font-size: 14px; font-weight: 600;
  color: var(--bg); background: var(--fg); border: none; border-radius: 11px; cursor: pointer; }
.ns-rem-tip { font-size: 12px; color: var(--accent); }
.ns-bad { border-color: var(--accent) !important; }
/* 🔴🔴 已设提醒列表回到老项目的**裸行 + 顶部一条分隔线**（老项目 index.html:280-284）：
     容器 `border-top:1px solid var(--line); padding-top:14px`，
     行本身 `background:none`、**无描边无圆角**。
   原先是每行一个胶囊卡片（1px 描边 + 10px 圆角 + --box-bg 实底+ padding 10px 11px），
   于是这一段与上方"通栏反色"的添加按钮完全同构 —— 列表看起来像一摞按钮，
   而老项目那里是"一行行文字 + 右侧一个描边小×"，层级完全不同。 */
.ns-rem-list { display: flex; flex-direction: column; gap: 8px;
  border-top: 1px solid var(--line); padding-top: 14px;
  max-height: min(60vh,440px); overflow-y: auto;
  -webkit-overflow-scrolling: touch; overscroll-behavior: contain; }
/* 老项目 v5.42：行内容用裸文本节点，span 元素盒被国产浏览器夜间模块吃字。
   颜色由行容器锁定继承，布局用 grid(1fr auto)。 */
.ns-rem-row { display: grid; grid-template-columns: 1fr auto; align-items: center;
  gap: 10px; font-size: 13px; line-height: 1.5; text-align: left; color: var(--fg);
  background: none; border: 0; border-radius: 0; padding: 0; }
/* 行内取消键：老项目 index.html:283 `padding:4px 12px;font-size:12px;
   border:1px solid var(--line);border-radius:8px`（描边小钮，非实心方块）。
   🔴🔴🔴 光有上面这条声明**不够** —— 它会被弹窗通栏按钮规则吃掉。

   量化实测（真浏览器读 computed，不是推断）：
     命中该元素的规则里，`.box button:not(.box-x){width:100%;height:46px;
       padding:0 14px;border-radius:10px;background:var(--fg);color:var(--bg);
       font-size:15px;…}` 是 **(0,2,1)**，而本条 `.ns-rem-off` 只有 **(0,1,0)**
     ⇒ 结构性压不过，关闭钮实际渲染成：深底白字、15px、padding 0 14px、圆角 10px、高 46px。
     这正是用户报障第 4 条「关闭按钮颜色和老版本不一样」的成因。

   老项目靠什么保住？它的对应声明挂在 **ID 级**选择器上：
     `#remBoxList .rem-row button` = **(1,2,1)** —— 有 ID，稳压 (0,2,1)。
   bj 的 DOM 里没有那个 ID（容器是 `.ns-rem-list`），所以必须**自己堆出等价特异性**。
   ⇒ `.box .ns-rem-list .ns-rem-row button.ns-rem-off` = (0,4,2)，结构性压过，
     且不依赖源码顺序（以后有人在后面再加一条 .box 按钮规则也打不回来）。
   🔴 为什么不用 `.box button.ns-rem-off`：(0,2,1) 与被压的规则**同分**，
     只能靠"写在后面"取胜 —— 源码顺序一改就静默失效，这条本项目栽过。 */
.box .ns-rem-list .ns-rem-row button.ns-rem-off {
  flex: none; width: auto; height: auto; min-height: 0;
  padding: 4px 12px; font-size: 12px; line-height: 1.5; font-weight: 400;
  letter-spacing: normal;
  color: var(--fg); -webkit-text-fill-color: var(--fg);
  background: none; border: 1px solid var(--line);
  border-radius: 8px; cursor: pointer;
  transition: border-color .2s ease;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
/* hover/active/disabled 同样要压过通栏按钮规则（老项目 :284 `button:hover{border-color:var(--muted)}`，
   以及 styles.css 里 `.box button:hover{opacity:.85}` / `:active{opacity:.8}` 这两条）。 */
.box .ns-rem-list .ns-rem-row button.ns-rem-off:hover {
  opacity: 1; background: none; border-color: var(--muted); color: var(--fg);
}
.box .ns-rem-list .ns-rem-row button.ns-rem-off:active { opacity: .7; }
.box .ns-rem-list .ns-rem-row button.ns-rem-off:disabled {
  background: none; border-color: var(--line); color: var(--muted); cursor: not-allowed;
}
/* 🔴 老项目 index.html:281 `#remBoxList:empty{display:none}` —— 空列表**整个隐藏**。
   漏了它：无提醒时那条 1px 上边框 +14px 上内边距仍在，
   于是"设置行"下方凭空多一道横线与一段空白，弹窗凭空高一截。
   用户报的"界面显示和之前不一样"里就有这一条。 */
.ns-rem-list:empty { display: none; }

/* ══════════════════════════════════════════════════════════════════
   彩蛋层：图鉴 / 游戏外壳 / 粒子 / 徽章
   🔴 全部只吃主题令牌，零新色字面量（老项目 v9.2.0 立的口径）。
   ══════════════════════════════════════════════════════════════════ */

/* ── 图鉴 ── */
.egg-row { display: flex; align-items: center; gap: 10px; box-sizing: border-box;
  width: 100%; padding: 10px 12px; border: 1px solid var(--line); border-radius: 10px;
  margin-bottom: 6px; min-height: 42px; font-size: 14px; color: var(--fg);
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  transition: border-color .2s; }
.egg-row:active { background: var(--hover); }
.egg-row.locked { color: var(--muted); border-style: dashed; cursor: default; }
.egg-name { width: 96px; flex: none; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.egg-hint { flex: 1; min-width: 0; font-size: 12px; color: var(--muted);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.egg-go { width: 14px; height: 14px; flex: none; color: var(--accent); }
.egg-row.locked .egg-go { display: none; }
#eggList { max-height: 52vh; overflow-y: auto; }
.egg-count { font-family: var(--mono); font-size: 10.5px; line-height: 1;
  letter-spacing: .14em; color: var(--muted); text-align: right; padding: 2px 4px 10px; }
/* 🔴 z90 高于菜单（菜单 z60）：图鉴是从菜单里点开的，必须压住它 */
#eggMask { z-index: 90; }

/* ── 游戏外壳 ── */
.ns-game { position: fixed; inset: 0; z-index: 80; display: flex; flex-direction: column;
  background: var(--bg); }
/* 🔴 dom 型（镜像/桌宠）必须透明底：它不占满屏，而是让 .ns-pet-stage
   自己居中。不透明的话 .ns-game 整屏铺满，实测表现为"桌宠看不见、只剩一条黑边"。
   老项目的 dom 型就是直接铺 body，所以这里显式写 transparent。 */
.ns-game.ns-dom { background: transparent; }
.ns-hud { flex: none; display: flex; align-items: center; gap: 10px;
  padding: calc(env(safe-area-inset-top) + 8px) 12px 8px; font-size: 12.5px;
  color: var(--muted); border-bottom: 1px solid var(--line);
  /* 🔴 必须 relative + z-index：dom 型的舞台是 fixed inset:0，
     在同一个层叠上下文里会盖住没有定位的 HUD ——
     症状是"退出键看得见、点不动"（Playwright 的 hit-test 明确报
     .ns-pet-stage intercepts pointer events，真机表现是按着没反应）。 */
  position: relative; z-index: 2; }
.ns-x { display: inline-flex; align-items: center; gap: 4px; cursor: pointer;
  color: var(--muted); }
.ns-x svg { width: 18px; height: 18px; }
.ns-x b { font-weight: 500; }
.ns-gate { font-family: var(--mono); color: var(--fg); }
.ns-lv { color: var(--accent); }
.ns-sp { flex: 1; }
.ns-sc { font-family: var(--mono); color: var(--fg); font-variant-numeric: tabular-nums; }
.ns-mute { cursor: pointer; display: inline-flex; }
.ns-mute svg { width: 18px; height: 18px; }
.ns-mute.off { color: var(--line); }
.ns-stage { flex: 1; position: relative; min-height: 0; display: flex;
  align-items: center; justify-content: center; overflow: hidden; }
.ns-stage canvas { display: block; touch-action: none; }
.ns-tip { flex: none; padding: 8px 12px calc(env(safe-area-inset-bottom) + 8px);
  font-size: 12px; color: var(--muted); text-align: center; }
/* 结算卡：点背景 = 重开（老项目 v9.3.3：不再误触退回笔记） */
.ns-over { position: absolute; inset: 0; display: flex; align-items: center;
  justify-content: center; background: var(--mask-bg); padding: 20px; }
.ns-card { position: relative; width: 100%; max-width: 320px; padding: 20px; text-align: center;
  background: var(--box-bg); border: 1px solid var(--line); border-radius: 14px;
  box-shadow: var(--shadow-card); }
.ns-card h2 { margin: 0 0 12px; font-size: 16px; font-weight: 600; color: var(--fg); }
.ns-rows { display: flex; flex-direction: column; gap: 6px; margin-bottom: 14px; }
.ns-rows > div { display: flex; justify-content: space-between; font-size: 13px;
  color: var(--muted); }
.ns-rows b { font-family: var(--mono); color: var(--fg); font-weight: 500; }
.ns-btns { display: flex; gap: 8px; }
.ns-btns button { flex: 1; padding: 10px; font-size: 13.5px; border-radius: 10px;
  cursor: pointer; border: 1px solid var(--line); background: transparent; color: var(--fg); }
.ns-again { background: var(--fg) !important; color: var(--bg) !important;
  border-color: var(--fg) !important; }
/* 🔴🔴 v9.4.0：仅 /dragon 撞停后，桌宠从结算卡左下往上爬、扒住卡顶来「看你摔了」
 * （老项目 index.html:10384-10388 逐字；锚点靠上面 `.ns-card{position:relative}`）。 */
.ns-pet-climb { position: absolute; left: 10px; bottom: 8px; width: 26px; height: 26px;
  color: var(--accent); pointer-events: none; opacity: 0; z-index: 2; }
.ns-pet-climb.go { opacity: 1; animation: petClimb 2.4s cubic-bezier(.4,.05,.5,.95) .3s both; }
.ns-pet-climb svg { width: 100%; height: 100%; overflow: visible; display: block; }
@keyframes petClimb {
  0% { transform: translate(0, 12px) rotate(0); }
  22% { transform: translate(3px, -24px) rotate(-7deg); }
  48% { transform: translate(8px, -66px) rotate(7deg); }
  72% { transform: translate(5px, -104px) rotate(-4deg); }
  100% { transform: translate(3px, -112px) rotate(0); }
}
@media (prefers-reduced-motion: reduce) {
  .ns-pet-climb.go { animation: none; opacity: 1; transform: translate(3px, -112px); }
}

/* ── 非 canvas 型（镜像 / 桌宠）── */
/* 🔴 z-index 是**层叠上下文内部**的比较，不是全局比较：
   .ns-game 自身是 fixed z80 且带 background，形成层叠上下文；
   里面的 HUD(z2) 与舞台(z1) 只在这内部比。所以舞台给 z1 就够，
   给 z70 反而会盖住 HUD（退出键看得见点不动）。 */
.ns-pet-stage, .ns-mirror-stage { position: fixed; inset: 0; z-index: 1;
  display: flex; align-items: center; justify-content: center; background: transparent; }
/* ---------- 桌宠养成档案面板（老项目 index.html:10397-10455 逐字）----------
 * 🔴🔴 老项目 v9.2.0 记过一次真实设计缺陷，这条两段式布局就是修它的：
 *   旧形态把档案内容与按钮放在**同一个** `margin:auto` 盒子里，而父级 overflow:hidden
 *   ⇒ 面板比视口高时**上下两端一起被裁**，症状是「『让它去睡』下面的护照与说明文字
 *   永不露出，而且滑不动」——按钮可见、底下的内容永远够不着。
 *   修法（老项目逐字）：拆成两段 —— 内容区自己滚，操作区 `.ns-pet-dock` 钉在底部常驻。
 * 🔴🔴 2026-10-09 修正（用户报障第 1 条「/pet 按钮什么的乱了」）：
 *   此前 `.ns-pet-stage-panel` **漏了 `flex-direction:column`**，而基类
 *   `.ns-pet-stage` 是 `display:flex`（默认 row）⇒ 面板的每个区块
 *   （头/柜子/档案/说明/换养/底部按钮）被排成**一行**，横向挤成一团，
 *   这就是"按钮乱了"的真身。补 column 是第一步。
 *   同时按老项目两段式补齐：内容区自己滚、操作区钉底 —— 老项目
 *   `.ns-pet-panel{flex-direction:column}` + `.ns-pet-scroll{flex:1;overflow-y:auto}`
 *   + `.ns-pet-dock{flex:none}`。所以这里也让 `dom()` 建 `.ns-pet-scroll` 包住内容。 */
.ns-pet-stage-panel { flex-direction: column; align-items: stretch; justify-content: flex-start;
  overflow: hidden; }
/* 面板宽度与内边距：老项目 `.ns-pet-panel` 的 max-width:420px + scroll 区的 22/20/14 */
.ns-pet-stage-panel > * { width: 100%; max-width: 420px; margin-left: auto; margin-right: auto; }
.ns-pet-stage-panel > .ns-pet-dock { max-width: none; }
/* 内容滚动区（老项目 index.html:10398 逐字：flex:1 + min-height:0 + 22/20/14 内边距） */
.ns-pet-scroll { flex: 1; min-height: 0; overflow-y: auto;
  -webkit-overflow-scrolling: touch; padding: 22px 20px 14px; }
.ns-pet-dock { flex: none; border-top: 1px solid var(--line); background: var(--bg);
  padding: 12px 20px calc(14px + env(safe-area-inset-bottom)); }
/* 顶部 margin 归零：老项目 `.ns-pet-top{margin-bottom:14px}` 的 22px 顶距由
   `.ns-pet-scroll` 的 padding-top 提供，两边都给就变成 44px。 */
.ns-pet-top { display: flex; align-items: center; gap: 12px; margin: 0 0 14px; }
.ns-pet-av { width: 44px; height: 44px; flex: none; border: 1px solid var(--line);
  border-radius: 12px; display: flex; align-items: center; justify-content: center;
  color: var(--fg); background: var(--box-bg); }
.ns-pet-av svg { width: 28px; height: 28px; }
/* 🔴 `.ns-pet` 自带 width/height:96px（给舞台里那只大螃蟹），必须在这里压回 44px，
 *   否则头像会被撑成 96px、把 `.ns-pet-top` 整行顶高一倍。老项目只有 44px 一个尺寸。 */
.ns-pet.ns-pet-av { width: 44px; height: 44px; }
.ns-pet-meta b { display: block; font: 600 15px/1.4 var(--serif); letter-spacing: .04em; color: var(--fg); }
.ns-pet-meta span { font: 400 10.5px/1.6 var(--mono); color: var(--muted); }
.ns-shelf { display: grid; grid-template-columns: repeat(4, 1fr); gap: 7px; margin-bottom: 14px; }
.ns-sh { aspect-ratio: 1; border: 1px solid var(--line); border-radius: 9px;
  background: var(--box-bg); display: flex; align-items: center; justify-content: center;
  font: 400 9px/1.3 var(--mono); color: var(--muted); text-align: center; padding: 4px; }
.ns-sh.empty { border-style: dashed; opacity: .55; }
.ns-pet-btns { display: flex; gap: 8px; margin-bottom: 12px; }
.ns-pet-btns button { flex: 1; font: 400 11px/1.3 var(--mono); padding: 10px 4px;
  border: 1px solid var(--line); border-radius: 10px; background: none;
  color: var(--fg); cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent; }
.ns-pet-free { border-color: var(--accent) !important; color: var(--accent) !important;
  background: var(--accent-soft) !important; }
.ns-pass { border: 1px dashed var(--accent); border-radius: 10px; background: var(--accent-soft);
  padding: 10px 11px; font: 400 10.5px/1.7 var(--mono); color: var(--fg);
  word-break: break-all; margin-bottom: 10px; }
.ns-swap { display: flex; flex-direction: column; gap: 8px; margin: 2px 0 10px; }
.ns-swap-in { font: 400 11px/1.4 var(--mono); padding: 10px 11px;
  border: 1px solid var(--ring); border-radius: 9px; background: var(--box-bg);
  color: var(--fg); width: 100%; }
.ns-swap-in.bad { border-color: var(--danger); }
.ns-swap-go { font: 600 12px/1.2 var(--mono); letter-spacing: .04em; padding: 11px;
  border: 1px solid var(--accent); border-radius: 9px; background: var(--accent-soft);
  color: var(--accent); cursor: pointer; touch-action: manipulation;
  -webkit-tap-highlight-color: transparent; }
.ns-swap-go:disabled { opacity: .45; }
.ns-swap-msg { font: 400 10.5px/1.6 var(--mono); color: var(--muted); margin: 0; }
.ns-swap-msg.bad { color: var(--danger); }
.ns-pnote { font: 400 10.5px/1.7 var(--mono) !important; color: var(--muted) !important;
  margin: 0 0 12px; }

/* 🦀 桌宠本体：老项目是**SVG**（viewBox 0 0 26 26），不是 emoji。
   此前这里写 `font-size:64px` 是给 🐾 字形设的，改成 SVG 后那个尺寸会把螃蟹撑得过大。
   老项目在顶栏里是 26px 级的"小螃蟹"；这里摆在彩蛋页中央，给到 96px 与"居中展示"相称，
   但**比例必须按 viewBox 走**（1:1），不能压扁。 */
.ns-pet { width: 96px; height: 96px; cursor: pointer; user-select: none;
  color: var(--fg); transition: transform .2s; }
.ns-pet svg { width: 100%; height: 100%; display: block; }
.ns-pet.jump { transform: translateY(-22px); }
/* ---------- 桌宠：常驻顶栏下沿那只螃蟹（老项目 index.html:10422-10434 逐字）----------
 * 🔴🔴 与上面 .ns-pet（彩蛋页舞台里 96px 的那只是**另一只形态**）不是同一个东西：
 *   这里管的是"任何笔记页都骑在 header 下沿、每 60ms 横向走 0.35px"的那只。
 *   用户报障「包括螃蟹在顶栏爬行」—— 这条以前**完全没实现**，
 *   桌宠只做成了 /pet 彩蛋页里的一只大号静态螃蟹。
 *
 *   bottom:-11px 让它骑在 header 的下边框线上（半骑线），0 占宽；
 *   background:var(--bg) 补一块底色，避免正文/滚动内容从螃蟹背后透出来。
 *   🔴 动画挂在**外层**、左右走位写在 inline transform 上，两者不冲突：
 *   bob 动的是 margin-bottom，点头动的是 transform —— 但点头会**短暂覆盖**
 *   爬行的 translateX（老项目就是这个写法，点头 0.5s 结束即恢复）。
 */
#nsPet {
  position: absolute; left: 0; bottom: -11px;
  width: 24px; height: 24px;
  color: var(--fg); background: var(--bg);
  border-radius: 7px; padding: 1px; z-index: 5;
  cursor: pointer; transition: opacity .3s;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
}
#nsPet svg { width: 22px; height: 22px; display: block; }
#nsPet { animation: nsPetBob 2.6s ease-in-out infinite; }
@keyframes nsPetBob { 0%, 100% { margin-bottom: 0; } 50% { margin-bottom: 2px; } }
#nsPet.talk { animation: nsPetNod .5s ease-in-out; }
@keyframes nsPetNod { 0%, 100% { transform: rotate(0); } 40% { transform: rotate(-8deg) translateY(-2px); } }
#nsPet.asleep { opacity: .42; animation: none; }
@media (max-width: 560px) { #nsPet { width: 22px; height: 22px; } }
.ns-mirror-box { max-width: min(90vw, 560px); max-height: 70vh; overflow: auto;
  padding: 18px; background: var(--box-bg); border: 1px solid var(--line);
  border-radius: 14px; box-shadow: var(--shadow-card); }
.ns-mirror-title { margin-bottom: 10px; font-size: 15px; font-weight: 600; color: var(--fg); }
.ns-mirror-pre { margin: 0; white-space: pre-wrap; word-break: break-word;
  font-family: var(--mono); font-size: 15px; line-height: 1.6; color: var(--fg);
  transform-origin: center center; cursor: zoom-in; }

/* ── 粒子层与徽章 ── */
/* 🔴 pointer-events:none 是硬要求：粒子飘过编辑器时吃掉点击，
   症状是「打字的某一刻按什么都没反应」，极难自查。 */
#nsFx { position: fixed; inset: 0; pointer-events: none; z-index: 40; }

/* ── 数字梗粒子 `.ns-burst` 与 notesync 烟花 `.ns-fw` ──
   🔴🔴 这两条是**逐字**抄自老项目 index.html:310-312 与 :326-328。
   老项目的这两个动效是 **DOM `<i>` + CSS keyframes**，bj 曾经在 canvas 里用
   rAF 重画了一遍 —— 载体不同，位移/时长/缓动/缩放四条曲线全不一样，
   用户报「动效效果不好」正是这个。**不要把它们改回 canvas 粒子。**
   z-index 58：高于编辑器(30)与粒子画布(40)，低于提醒卡(80)与菜单遮罩(90)。 */
.ns-burst{position:fixed;z-index:58;pointer-events:none}
.ns-burst i{position:absolute;left:0;top:0;font-style:normal;font-size:16px;animation:nsBurstUp .95s ease-out forwards}
@keyframes nsBurstUp{0%{transform:translate(0,0) scale(.6);opacity:0}15%{opacity:1}100%{transform:translate(var(--nx,8px),var(--ny,-38px)) scale(1.15) rotate(var(--nr,12deg));opacity:0}}

.ns-fw{position:fixed;z-index:58;pointer-events:none}
.ns-fw i{position:absolute;left:0;top:0;width:5px;height:5px;border-radius:50%;background:var(--accent);animation:nsFwOut 1.2s cubic-bezier(.12,.68,.35,1) forwards}
@keyframes nsFwOut{0%{transform:translate(0,0) scale(.35);opacity:0}10%{opacity:1}100%{transform:translate(var(--fx,0px),var(--fy,0px)) scale(.45);opacity:0}}
/* 🔴🔴🔴 彩蛋徽章：老项目是**顶栏品牌内联的一枚小胶囊**（index.html:653挂点 /
   :298-302 样式 / :321 窄屏规则），不是浮在屏幕右上角的 fixed 药丸：
     #nsBadge{display:none;align-items:center;gap:6px;max-width:34vw;flex:none;font-size:12px;
       color:var(--fg);background:var(--accent-soft);border:1px solid var(--ring);
       border-radius:999px;padding:3px 10px 3px 8px;letter-spacing:.03em;
       white-space:nowrap;overflow:hidden;pointer-events:none}
     #nsBadge.show{display:inline-flex;animation:nsBadgePop .45s cubic-bezier(.2,.7,.3,1) both}
     #nsBadge .ns-be{font-style:normal;font-size:13px;flex:none}
     #nsBadge .ns-bt{font-style:normal;display:inline-block;min-width:0;max-width:100%;
       overflow:hidden;text-overflow:ellipsis;vertical-align:bottom}
     @keyframes nsBadgePop{from{transform:scale(.6);opacity:0}to{transform:scale(1);opacity:1}}
     @media (max-width:560px){ #nsBadge{padding:0;border:0;background:none;gap:0} #nsBadge .ns-bt{display:none} }
   固定在右上角时它压在工具键上，窄屏下和按钮抢同一块地方；内联到品牌后面后
   它随标题栏流式排布，窄屏自动只留裸emoji（老项目 v8.2.3：脱掉胶囊皮）。 */
#nsBadge { display: none; align-items: center; gap: 6px; max-width: 34vw; flex: none;
  font-size: 12px; color: var(--fg); background: var(--accent-soft);
  border: 1px solid var(--ring); border-radius: 999px;
  padding: 3px 10px 3px 8px; letter-spacing: .03em;
  white-space: nowrap; overflow: hidden; pointer-events: none; }
#nsBadge.show { display: inline-flex; animation: nsBadgePop .45s cubic-bezier(.2,.7,.3,1) both; }
#nsBadge .ns-be { font-style: normal; font-size: 13px; flex: none; }
#nsBadge .ns-bt { font-style: normal; display: inline-block; min-width: 0; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; vertical-align: bottom; }
/* to 帧显式写全transform（fill-mode:both 会永久接管 transform，见上文 .box 同款理由） */
@keyframes nsBadgePop {
  from { transform: scale(.6); opacity: 0; }
  to   { transform: scale(1); opacity: 1; }
}
@media (max-width: 560px) {
  #nsBadge { padding: 0; border: 0; background: none; gap: 0; }
  #nsBadge .ns-bt { display: none; }
}

/* ── 图片查看器 #nsZoom / 长按菜单 #nsImgMenu ─────────────────────
   🔴🔴 老项目 index.html:348-375 整块。此处**只写样式与挂点契约**，
   点击放大/长按弹菜单的交互是另一批的事 —— 这里不写任何 JS 行为。
   z序：查看器 88、菜单 89，都在图鉴 z90 之下（"图鉴最高"是钉住的口径）。
   🔴🔴 日间也用暗底（--zoom-bg 日间就压到近黑）：照片要看清必须暗背景，
   白底浅色图在查看器里等于一片糊。
   🔴🔴 底栏是**不透明实底** --zoom-solid，不是半透明 —— 老项目 v9.3.7
   记过一次：半透明底被亮图冲淡，按钮文字直接看不清（问题4）。 */
#nsZoom {
  position: fixed; inset: 0; z-index: 88;
  background: var(--zoom-bg);
  display: flex; align-items: center; justify-content: center;
  touch-action: none;
  -webkit-user-select: none; user-select: none;
  cursor: zoom-out;
  animation: nsRise .22s ease both;
}
#nsZoom .nz-stage { width: 100%; height: 100%; display: flex;
  align-items: center; justify-content: center; overflow: hidden; }
#nsZoom img { max-width: 92vw; max-height: 82vh; object-fit: contain;
  border-radius: 8px; background: var(--box-bg);
  transform-origin: center center; will-change: transform; cursor: zoom-in; }
#nsZoom.zm img { cursor: grab; }
#nsZoom .nz-x { position: absolute; top: 14px; right: 16px;
  width: 38px; height: 38px; display: flex; align-items: center; justify-content: center;
  border: 0; border-radius: 50%;
  background: var(--zoom-chip); color: var(--zoom-ink); cursor: pointer; }
#nsZoom .nz-x svg { width: 16px; height: 16px; }
#nsZoom .nz-tip { position: absolute; top: 22px; left: 50%; transform: translateX(-50%);
  font: 400 10.5px/1 var(--mono); letter-spacing: .1em; color: var(--zoom-dim);
  pointer-events: none; text-align: center; }
/* 老项目 v9.3.0（用户反馈「移动端这三个按钮看不清楚」）：12px mono 半透明小胶囊
   → 44px 高大按钮。padding 底部避开全面屏手势条（safe-area）。 */
#nsZoom .nz-bar { position: absolute; left: 0; right: 0; bottom: 0;
  display: flex; gap: 10px; justify-content: center;
  padding: 12px 16px calc(20px + env(safe-area-inset-bottom, 8px));
  background: var(--zoom-solid); pointer-events: auto; }
#nsZoom .nz-bar button { pointer-events: auto; flex: 1; max-width: 220px; min-height: 44px;
  /* 老项目这里写死系统 sans栈；本项目按钮已由 reset 的 `button{font:inherit}` 继承全站字体，
     故用 longhand 只写字重字号，字形自动与全站一致。 */
  font-weight: 600; font-size: 15px; line-height: 1;
  letter-spacing: .04em; padding: 12px 0;
  border: 1px solid var(--zoom-line); border-radius: 12px;
  background: var(--zoom-chip); color: var(--zoom-btn-ink); cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
/* 老项目 v9.3.8：主按钮纯白底 + 纯黑字（近白底/近黑字在手机上仍发灰，用户拍板纯黑字）。
   不用 --zoom-ink（#F2F1EC），那个近白值在手机屏上会发灰。 */
#nsZoom .nz-bar button.nz-pri { background: var(--zoom-pri-bg); color: var(--zoom-pri-ink);
  border-color: var(--zoom-pri-bg); }
#nsImgMenu { position: fixed; z-index: 89; min-width: 150px;
  background: var(--box-bg); border: 1px solid var(--line); border-radius: 12px;
  box-shadow: var(--img-menu-shadow); padding: 5px;
  animation: nsMenuFade .16s ease both; }
/* 入场只动 opacity：通用 rise 的 to 帧是 transform:none，fill:both 下会把定位用的
   transform 一起吞掉。菜单靠 left/top 定位，不需要 transform。
   🔴 to 帧仍显式写全 transform（见文件头关于 fill-mode:both 接管 transform 的纪律）。 */
@keyframes nsMenuFade {
  from { opacity: 0; transform: none; }
  to   { opacity: 1; transform: none; }
}
#nsImgMenu button { display: block; width: 100%; text-align: left; padding: 11px 12px;
  font: inherit; font-size: 13.5px; color: var(--fg);
  background: none; border: 0; border-radius: 8px; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
#nsImgMenu button:hover { background: var(--hover); }
/* 触屏端自建菜单接管「保存」，iOS 原生 callout 在 contenteditable 里本来只给
   选择/复制，留着会与自建菜单打架。 */
html.ns-no-callout .ns-editor img { -webkit-touch-callout: none; }

/* ── 扫码配对（出码浮层）──────────────────────────────────────────
   类名与老项目逐字一致（.qr-box/.qr-title/.qr-warn/.qr-lock-warn），
   用户可见观感是契约的一部分（见 ui/copy.ts 文件头）。 */
.qr-box { text-align: center; }
.qr-title { font-size: 18px; font-weight: 600; margin: 0 0 8px; letter-spacing: .02em; }
.qr-box p { margin: 0 0 14px; }
#qrHolder { display: flex; align-items: center; justify-content: center;
  min-height: 236px; margin: 0 0 12px; }
#qrHolder button { width: 100%; }
#qrCanvas { border-radius: 12px; border: 1px solid var(--line); background: var(--qr-paper);
  max-width: 100%; cursor: pointer; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; }
.qr-warn { font-size: 12px; color: var(--danger); line-height: 1.65; margin: 0 0 16px; }
/* 🔴🔴 `.ns-qr-warn`（扫码配对 / 换机面板的警示文字）此前**根本没有对应的样式规则**
   —— 本文件只有 `.qr-warn`，而三处面板用的是 ns- 前缀：
     scan/panel.ts:193（扫码配对）、migrate/panel.ts:221 与 :230（换机）。
   ⇒ 那三处警示文字完全没被样式命中，字号/颜色/行高/边距全是浏览器默认值。
   量化实测：老项目该行 289x44（22px×2 行），bj 是 289x51 —— 字号大一号、行距不同。
   这正是用户报障第 3 条「扫码配对弹窗文字与大小不同」。
   🔴 修法是**补选择器**而不是改那三处调用点的类名 ——
   "类名与老项目逐字对应"是本项目的约定，改类名会把它破掉。 */
/*🔴🔴 这三条警示是 `.qr-box` 里的 `<p>`，所以 `.qr-box p { margin:0 0 14px }`
   （老项目 :527）**会覆盖**下面的 `margin: 0 0 16px` —— 同一个坑老项目也有。
   🔴 那为什么不在这里直接写 14px：老项目 `.qr-warn` 也写 16px、也生效成14px，
   **声明值与老项目逐字一致**是本项目的约定（类名/字面量对齐是契约，见上方注释），
   而"实际生效 14px"两边也一样 ⇒ 观感一致，不需要改。
   写清这一点是为了免得下次有人"顺手改成 16px"—— 那才会真的与老项目不同。
   若将来老项目改了 `.qr-box p`，两边会一起变，仍保持一致。 */
.ns-qr-warn { font-size: 12px; color: var(--danger); line-height: 1.65; margin: 0 0 16px; }
.ns-lock-warn { font-size: 13px; color: var(--muted); line-height: 1.7; }
/* 🔴 bj 自造的 `.ns-ghost-btn{background:transparent!important}` 已删除：
   它会把 `.box` 内按钮压成透明浅字，而老项目运行时**所有** `.box button` 都是实底
   （:1063 的 !important 覆盖，见本文件 :420-464）。唯一使用点（扫码配对「锁定笔记」）
   已改用老项目次级按钮类 `ghost-btn`。 */

/* 全屏放大码（反光/夜里对拍）。
   🔴 纯白铺满 + 点击任意处收回：老项目 v7.5.1 定的形态，不要加提示文字，
   那会让"这只是个放大层"变成需要用户确认的事。 */
#qrLarge { position: fixed; inset: 0; z-index: 300; background: var(--qr-paper); display: none;
  align-items: center; justify-content: center; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
#qrLarge.show { display: flex; }
#qrLarge canvas { width: 88vmin; height: 88vmin; max-width: 92vw; max-height: 92vh;
  display: block; image-rendering: pixelated; }

/* ── 扫码换机（出码/收码浮层）────────────────────────────────────
   🔴 复用 .mask/.box/.qr-box/.qr-title 这些既有承重类，新增元素零自定义配色。
   理由与老项目 v10.1.4 的注释同款：动态板（.night 覆盖）用 !important 压死裸 color，
   新造一个色值会出现"日间能看、夜间隐身"。所以这里只加**几何**不加**颜色**。 */
#migrateQrHolder { display: flex; align-items: center; justify-content: center;
  min-height: 236px; margin: 0 0 12px; }
#migrateQr { border-radius: 12px; border: 1px solid var(--line); background: var(--qr-paper);
  max-width: 100%; cursor: pointer; -webkit-tap-highlight-color: transparent;
  touch-action: manipulation; }
#migrateCodeIn { width: 100%; padding: 10px 14px; border-radius: 10px;
  border: 1px solid var(--line); background: var(--bg); color: var(--fg);
  font-size: 12px; line-height: 1.6; resize: vertical;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; word-break: break-all; }
#migrateCodeIn:focus { border-color: var(--accent); box-shadow: 0 0 0 3px var(--ring); }

/* 换机码的全屏放大层：几何与 #qrLarge 逐字同款（老项目「点码放大」是同一交互），
   独立 id 是因为两层的 show/hide 生命周期不同（出码层与收码层可能先后打开）。 */
#migrateLarge { position: fixed; inset: 0; z-index: 300; background: var(--qr-paper); display: none;
  align-items: center; justify-content: center; cursor: pointer;
  -webkit-tap-highlight-color: transparent; touch-action: manipulation; }
#migrateLarge.show { display: flex; }
#migrateLarge canvas { width: 88vmin; height: 88vmin; max-width: 92vw; max-height: 92vh;
  display: block; image-rendering: pixelated; }

/* ── 扫一扫（取景浮层）──────────────────────────────────────────
   🔴 取景面积 56vh/420px（老项目 v10.1.4）：密集码要对得更远才装得下，
   窗口一小就变成「太远解不出、太近被裁掉」两头堵。 */
.ns-scan-stage { position: relative; width: 100%; height: 56vh; min-height: 200px;
  max-height: 420px; overflow: hidden; border-radius: 12px;
  background: radial-gradient(120% 90% at 50% 40%, var(--scan-stage-a) 0%, var(--scan-stage-b) 78%);
  box-shadow: inset 0 0 0 1px var(--scan-stage-edge); }
/* 🔴 锁色必须成对（color + -webkit-text-fill-color）：动态主题板在 body 上
   写的 -webkit-text-fill-color 会继承压死裸写的 color，
   日间主题下这行浅字会被染成深色落在深底 stage 上 = 看不见。
   老项目 v8.1.4 就埋着这个雷，本版它开始承载"为什么扫不出"的信息，顺手钉死。 */
.ns-scan-status { position: absolute; left: 0; right: 0; bottom: 26px; text-align: center;
  font-size: 12.5px; letter-spacing: .14em; color: var(--scan-stage-text);
  -webkit-text-fill-color: var(--scan-stage-text); }
.ns-scan-tip { font-size: 13px; color: var(--muted); margin: 12px 0 14px; }

/* ── 关于页 / App 在线升级（S8）──────────────────────────────────
   🔴 本项目**没有**通用 .btn 类（各处按钮都是自定义的），这里同样自定义，
     不引入全局按钮样式 —— 改一处全局会波及所有既有弹窗。
   🔴🔴 行内容一律用**裸文本节点**，不套 <span>：
     老项目 v5.42 实锤「span 元素盒被国产浏览器夜间模块吃字」，
     颜色由行容器锁定继承。这条对升级弹窗同样成立 ——
     版本号与包大小若各裹一层 span，日间主题下可能掉色看不见。 */
/* 🔴🔴🔴 关于页：扉页式版式（老项目 index.html:253-260 逐字）。
     #aboutTitle{font-family:var(--serif);font-size:18px;font-weight:600;letter-spacing:1px}
     #aboutTitle::after{content:'';display:block;width:52px;height:1px;background:var(--accent);margin:11px auto 0;opacity:.8}
     #aboutVerBlock{margin:12px auto 0}
     .about-row{display:flex;justify-content:center;align-items:baseline;gap:10px;line-height:2;font-size:12.5px}
     .about-k{color:var(--muted);font-size:11.5px;letter-spacing:1px}
     .about-v{width:110px;text-align:left;color:var(--fg);font-variant-numeric:tabular-nums;word-break:break-all;font-weight:600}
     #aboutAuthor{...margin:6px auto 0}
   原先是 grid 72px+1fr 左对齐、标题无衬线无金线 —— 「小号衬线标题 + 细长金线 +
   两行信息整体居中」是用户五轮反馈收敛出来的版式（老项目 v7.0），丢了就不是那个关于页。
   gap:0 也是抄的：老项目各行靠 line-height:2 自己撑开，只有作者行有 6px 外边距。 */
/* 🔴🔴🔴 选择器必须是 `#aboutTitle`（**ID 特异性**），不能只靠 `.about-title` 类：
 *   老项目 index.html:829 的标题是 `<h1 class="qr-title" id="aboutTitle">`，
 *   它靠 `#aboutTitle`（1,0,0）压过 `.qr-box .qr-title`（0,2,0）的 letter-spacing:.02em，
 *   才保住「字距 1px」；本项目新增的 `.box h1` 同样是 (0,1,1)，
 *   类名写法（0,1,0）会被它吃掉 —— 实测标题字距从 1px 掉到 0.36px，
 *   而「扉页式小号衬线标题 + 细长金线」是用户五轮反馈收敛出来的版式。
 *   类名 `.about-title` 保留（e2e 按它选），承重的那份 specificity 交给 id。 */
#aboutTitle {
  font-family: var(--serif); font-size: 18px; font-weight: 600;
  letter-spacing: 1px; margin: 0; text-align: center;
}
#aboutTitle::after {
  content: ''; display: block; width: 52px; height: 1px;
  background: var(--accent); margin: 11px auto 0; opacity: .8;
}
/* 关闭键绝对定位浮在盒内右上，老项目 .box-x 同款（v6.1 退役的 absolute 悬浮式）。
   不绝对定位它就会作为一个 flex/块参与标题行排版，把「居中标题」挤偏。 */
#aboutMask .box { position: relative; }
#aboutMask .box-x { position: absolute; top: 14px; right: 14px; }
.about-body { display: flex; flex-direction: column; gap: 0; margin-top: 12px; }
.about-row { display: flex; justify-content: center; align-items: baseline; gap: 10px;
             line-height: 2; font-size: 12.5px; color: var(--fg); }
.about-k { color: var(--muted); font-size: 11.5px; letter-spacing: 1px; }
.about-v { width: 110px; text-align: left; color: var(--fg); font-weight: 600;
           font-variant-numeric: tabular-nums; word-break: break-all; }
/* 作者行的值是**金色衬线 14px**（老项目 index.html:260 `#aboutAuthorName{…}`）——
   与其余行的前景色值不同：作者署名是扉页上唯一该发金的一行。 */
.about-author { margin: 6px auto 0; }
.about-author .about-v { font-family: var(--serif); font-weight: 400; font-size: 14px;
                         letter-spacing: .5px; color: var(--accent); }
.upd-link { color: var(--accent); text-decoration: underline;
  text-underline-offset: 3px; text-decoration-thickness: 1px; cursor: pointer;
  -webkit-tap-highlight-color: transparent; }
/* 🔴🔴 关于页第四行「彩蛋 N / M FOUND」入口（老项目 index.html:10457-10465 逐字）。
   缺这条 ⇒ 用户报障第 5 条「关于 NoteSyncX 没有列举彩蛋」。
   🔴 为什么 `.about-v` 要在这里被**重新定宽**：基础 `.about-v` 是 `width:110px`
   + `word-break:break-all`（为「Version 3.0.0」那种短串设计），
   「10 / 10 FOUND」塞进去必被 break-all 拦腰折断、尾字母 D 掉到下一行
   （老项目 :10458-10460 的注释记的正是这个坑）⇒ 这里 width:auto + nowrap。 */
.ns-egg-entry { cursor: pointer; border-radius: 9px; margin: 0 -2px; padding: 0 2px;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
.ns-egg-entry .about-v { display: flex; align-items: baseline; gap: 5px; position: relative;
  width: auto; word-break: normal; white-space: nowrap; flex: none; }
.ns-egg-entry .ns-num { font: 400 12px/1.5 var(--mono); letter-spacing: .1em;
  color: var(--fg); font-weight: 600; white-space: nowrap; }
.ns-egg-entry .ns-chev { width: 11px; height: 11px; color: var(--accent); flex: none; }

/* 🔴🔴🔴 升级弹窗（老项目 index.html:263-272 逐字）：
     #updMask .box{text-align:center}
     #updVer{font:600 22px/1.25 var(--serif);color:var(--accent);letter-spacing:.04em}
     #updVer .sz{font:400 12px/1 var(--mono);color:var(--muted);letter-spacing:0;margin-left:5px}
     #updNotes{font-size:13.5px;line-height:1.95;color:var(--fg);font-weight:500;text-align:left;margin:14px 22px 2px}
     #updNotes i{font-style:normal;color:var(--accent);margin-right:5px;font-weight:400}
     #updProg{height:6px;border-radius:3px;background:var(--line);overflow:hidden;margin:12px 0 2px}
     #updMsg{min-height:18px;font:400 11.5px/1.6 var(--mono);color:var(--muted);margin-top:6px;text-align:left}
   版本号是**金色衬线 22px**：这是"有新版本"这件事唯一需要被看见的信号，
   原先 15px 前景色把它压成了普通正文一行。进度条 5px→6px 同样是为了让那点进度可见。 */
#updMask .box { text-align: center; }
.upd-ver { font: 600 22px/1.25 var(--serif); color: var(--accent); letter-spacing: .04em; }
/* 包大小弱化成等宽小字后缀：它是参考信息，不该和版本号抢注意力 */
.upd-ver .sz { font: 400 12px/1 var(--mono); color: var(--muted); letter-spacing: 0;
               margin-left: 5px; }
.upd-notes { font-size: 13.5px; line-height: 1.95; color: var(--fg); font-weight: 500;
             text-align: left; margin: 14px 22px 2px; }
/* 金色「·」前缀维持常规字重，只让说明文字本身加粗（老项目 v9.3.4 方案B） */
.upd-notes i { font-style: normal; color: var(--accent); margin-right: 5px; font-weight: 400; }
.upd-msg { min-height: 18px; font: 400 11.5px/1.6 var(--mono); color: var(--muted);
          margin-top: 6px; text-align: left; }
.upd-prog { margin: 12px 0 2px; }
.upd-bar { height: 6px; border-radius: 3px; background: var(--line); overflow: hidden; }
.upd-bar > i { display: block; height: 100%; width: 0; background: var(--accent);
  transition: width .25s ease; }
.upd-foot { display: flex; gap: 10px; margin-top: 18px; }
.upd-foot > button { flex: 1; padding: 11px; font-size: 14px; font-weight: 500;
  border-radius: 11px; cursor: pointer; border: 1px solid var(--line);
  color: var(--fg); background: transparent; }
.upd-foot > button.primary { color: var(--bg); background: var(--fg); border-color: var(--fg); }
.upd-foot > button:disabled { opacity: .4; cursor: not-allowed; }


/* ================= 彩蛋词表确认浮层 =================
   老项目 index.html:10467-10476（#nsAsk）+ :11007（挂 .ns-ask-m）。
   🔴🔴 值逐条照抄，只把 id 换成本项目命名（#eggAsk），并把 rgba 投影提成
   var(--shadow-ask)（颜色字面量只允许在 ui/theme.ts，见 S4-T7 机械扫描闸）。
   投影值与 --shadow-upload 同尺寸不同透明度，是老项目两个不同的值，不要合并。 */
#eggAsk {
  position: fixed; left: 50%; bottom: 76px; transform: translateX(-50%);
  /* 🔴 z85：必须**低于图鉴 z90**（老项目「图鉴最高」是钉住的口径），
     高于游戏外壳 z80（从编辑器里弹时不该被游戏盖住）。 */
  z-index: 85;
  display: flex; align-items: center; gap: 12px; padding: 11px 14px;
  border: 1px solid var(--line); border-radius: 14px;
  background: var(--box-bg); box-shadow: var(--shadow-ask);
  font: 400 13.5px/1 -apple-system, "PingFang SC", sans-serif; color: var(--fg);
}
#eggAsk button { font: 400 13px/1 -apple-system, "PingFang SC", sans-serif;
  padding: 8px 12px; border: 1px solid var(--line); border-radius: 9px;
  background: none; color: var(--muted); cursor: pointer; }
#eggAsk .ns-go { border-color: var(--accent); color: var(--accent);
  background: var(--accent-soft); font-weight: 600; }
/* 金胶囊 pill 变体（老项目 v9.3.6 A：PC/移动统一）
   圆角 999px 是老项目「移动端改单行胶囊」那条结论，桌面端同款。 */
#eggAsk.ns-ask-m { gap: 10px; padding: 9px 10px 9px 16px; border-radius: 999px;
  bottom: calc(76px + env(safe-area-inset-bottom, 0px)); font-size: 13.5px;
  white-space: nowrap; }
#eggAsk.ns-ask-m .ns-w { font-family: var(--serif); color: var(--accent);
  font-weight: 600; letter-spacing: .02em; }
#eggAsk.ns-ask-m .ns-go { border: 0; background: var(--accent); color: var(--box-bg);
  border-radius: 999px; padding: 9px 15px; font-weight: 600; }
#eggAsk.ns-ask-m .ns-no { width: 30px; height: 30px; padding: 0;
  border: 1px solid var(--line); border-radius: 50%; background: none;
  color: var(--muted); font-size: 15px; line-height: 1;
  display: flex; align-items: center; justify-content: center; }

/* ---------- PWA 安装引导条（老项目 index.html:171-183 逐值）----------
 * 🔴 用户报障第 12 条「网页端不支持生成 PWA」：manifest 齐了之后，
 *   `beforeinstallprompt` 才会真的发出来，而它**只发一次且不告诉用户任何事** ——
 *   不接住它就等于"能装但没人知道能装"。
 *
 * 逐值抄老项目（:171-183）：fixed 底部居中 / 18px 圆角 / rise 入场 /
 * 30px 金色 logo / 衬线标题 + 52px 金线 / 两枚 44px 触控区按钮。
 * 🔴 入场动画用**专用** `@keyframes nsInstRise`（to 帧 `transform:none`），
 *   不是老项目那条通用 `rise` —— 通用 rise 的 to 帧会把 translateX(-50%) 抹掉，
 *   条会钉在屏幕正中。老项目那条 .instcard 复用了 .instRise（自己的），同款。
 */
#installBar { position: fixed; left: 50%; transform: translateX(-50%);
  bottom: 16px; z-index: 55; max-width: 92vw; }
#installBar.hidden { display: none; }
.instcard { position: relative; background: var(--box-bg); border: 1px solid var(--line);
  border-radius: 18px; box-shadow: var(--shadow-box); padding: 20px 24px 18px;
  width: min(88vw, 340px); text-align: center;
  animation: nsInstRise .5s cubic-bezier(.2,.7,.3,1) both; }
@keyframes nsInstRise { from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); } }
.inst-logo { width: 30px; height: 30px; color: var(--accent); display: block;
  margin: 0 auto 4px; }
.inst-logo > svg { width: 30px; height: 30px; display: block; }
#installTitle { font-family: var(--serif); font-size: 16.5px; font-weight: 600;
  letter-spacing: .02em; color: var(--fg); }
#installTitle::after { content: ''; display: block; width: 52px; height: 1px;
  background: var(--accent); margin: 9px auto 0; opacity: .8; }
#installMsg { font-size: 12.5px; line-height: 1.7; color: var(--muted);
  margin: 10px 0 14px; }
.inst-btns { display: flex; gap: 10px; }
.inst-btns button { flex: 1; min-height: 44px; padding: 12px 0; font-size: 15px;
  font-weight: 500; border-radius: 10px; cursor: pointer;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent;
  border: 1px solid var(--line); background: none; color: var(--fg); }
.inst-btns button:active { opacity: .8; }
#installGo { background: var(--upload-bg); color: var(--bg); border-color: transparent; }
#installGo.hidden { display: none; }
/* 关闭 ×：绝对定位浮在卡内右上（同 .box-x 的做法，不参与标题行排版） */
#installDismiss { position: absolute; top: 10px; right: 10px; width: 30px; height: 30px;
  display: grid; place-items: center; background: none; border: none;
  color: var(--muted); cursor: pointer; border-radius: 8px; padding: 0;
  touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
#installDismiss:hover { background: var(--hover); color: var(--fg); }

/* ---------- 每日一句话气泡（老项目 index.html:114-115 逐值）----------
 * 位置是**顶部居中**（top:54px），不是正文上方 —— 用户报障第 5 条
 * 「夜深了，写完这条就睡」的图标/文案位置不对，根因之一是把问候做成了正文浮层。
 *
 * 🔴 z-index 54 **低于**草稿/冲突条的 55：问候是"锦上添花"，
 *   绝不能盖住用户正在处理的数据冲突（老项目注释明确写了这条优先级）。
 * 🔴 阴影复用 `--shadow-ask` 令牌（theme.ts:196 的值与老项目 :114 逐字节相同
 *   `0 10px 30px rgba(20,20,18,.14)`），不写字面量 —— 纪律闸 S4-T7 禁颜色字面量。
 */
/*
 * 🔴 `#skinToast` 与 `#nsDayToast` **共用这一条规则**（老项目 v8.2.0 的切档气泡
 *   就是复用同一个"顶部居中胶囊"位，index.html:1738 注释原文
 *   「在原版本气泡位（#versionToast 位置与样式废物利用）弹 1.5s 标签」）。
 *   两个 id **逐个列出**而不是用 CSS 通配/属性选择器：
 *   通配会让以后新增的任何浮层"看起来也有这层样式"，判据随之退化成恒真
 *   （本项目在滚动容器那条上已经栽过一次，纪律同款）。
 */
#nsDayToast,
#skinToast {
  position: fixed; top: 54px; left: 50%;
  transform: translateX(-50%) translateY(-8px);
  z-index: 54; max-width: min(86vw, 360px);
  padding: 10px 16px;
  border: 1px solid var(--line); border-radius: 999px;
  background: var(--box-bg); color: var(--fg);
  font: 400 13px/1.5 var(--serif); letter-spacing: .01em;
  box-shadow: var(--shadow-ask);
  opacity: 0; pointer-events: none;
  transition: opacity .32s, transform .32s;
  text-align: center; white-space: normal;
}
#nsDayToast.show,
#skinToast.show { opacity: 1; transform: translateX(-50%) translateY(0); }

/* ---------- 光标诊断面板（老项目 index.html:2063-2072 / :8217-8246）----------
 * 🔴🔴 `pointer-events: none` 是**纪律**，不是随手加的：
 *   浮层压在页面右下角（老项目 right:8px; bottom:8px），若吃掉点击，
 *   用户会以为"右下角那个按钮坏了" —— 而真因是诊断浮层盖住了它。
 *   老项目 :1928 的文件头把这条写成了纪律原文。
 * 🔴 `user-select: none` 同理：浮层里的读数不该被误选中（用户正在选正文）。
 * 🔴 颜色全走 var(--diag-*)：老项目是 cssText 内联 rgba(0,0,0,.82)/#0f0，
 *   写进 CSS 会被纪律闸 S4-T7 判红（颜色字面量只允许在 ui/theme.ts 的 OVERLAY）。
 *   理由见 theme.ts OVERLAY.diagBg 的注释：**取证浮层必须任何主题下都读得清**。
 */
.ns-caret-diag {
  position: fixed; right: 8px; bottom: 8px; z-index: 99999;
  max-width: 46vw; padding: 8px 10px; border-radius: 8px;
  background: var(--diag-bg); color: var(--diag-ink);
  font: 11px/1.5 var(--mono);
  white-space: pre-wrap; word-break: break-all;
  pointer-events: none; user-select: none;
}

/* 诊断模态：比 .box 宽（读数是长行），底色走 --diag-modal-*（与浮层的固定黑底绿字
 * 刻意分开 —— 模态与全站弹窗一致，浮层才是那套"截图里一眼认出是诊断"的配色）。 */
.diag-box { max-width: min(92vw, 620px); }
/* 🔴 .diag-pre 必须给 max-height + overflow:auto：10 组读数在窄屏上比 .box 高，
 *   而 .box **刻意不带 max-height/overflow**（见 .box 注释：老项目 .box 也没有，
 *   加了会让每个弹窗都成潜在滚动容器、并且被用户报障为"不该出现的滚动条"）。
 *   ⇒ 需要滚动的地方各自单独开，与扫一扫层/历史列表同款做法。 */
.diag-pre {
  margin: 0 0 14px; padding: 10px 12px;
  max-height: min(56vh, 460px); overflow: auto;
  border: 1px solid var(--line); border-radius: 10px;
  background: var(--diag-modal-bg); color: var(--diag-modal-ink);
  font: 400 11px/1.6 var(--mono);
  white-space: pre-wrap; word-break: break-all;
  -webkit-overflow-scrolling: touch;
}
/* 复制按钮不挂任何自定义类：`.box button:not(.box-x)` 已是全站通栏按钮规则
 *（老项目 :518 同款），另起一套类只会造成"这个弹窗的按钮小一号"。 */
/* 🔴 v3.1.4 诊断弹窗双按钮间距：v3.1.3 加了「导出日志文件」后，两个通栏按钮
 *   相邻且零 margin ⇒ 视觉上叠在一起（用户报障"颜色和位置都重合"）。
 *   只钉 .diag-box 内的相邻按钮对，不动全站 .box button 规则。 */
.diag-box button + button { margin-top: 10px; }

/* 🔴🔴 v3.1.5 弹窗内反馈条：导出/复制的结果提示。v3.1.3/v3.1.4 把反馈写进
   编辑器上传条 #uploadNote，而诊断面板在非编辑器态也能开（?diag/关于页连点）
   ——那时 #uploadNote 不存在 ⇒ 全链反馈被 `if (!el) return` 咽掉 ⇒ 用户看到
   「点击按钮没反应」（真机 inEditor=no 实锤）。反馈面必须住在弹窗里。
   配色跟随 #uploadNote 的贴底黑胶囊同款变量（--upload-bg/--bg），状态色只走
   文案不染色（老项目口径：成功/失败全靠文案区分）。 */
.diag-note {
  margin: 10px 0 0; padding: 8px 14px;
  font-size: 12px; line-height: 1.5; text-align: center;
  color: var(--upload-bg); background: var(--bg);
  border: 1px solid var(--line); border-radius: 999px;
}
.diag-note[data-kind="err"] { color: var(--danger); border-color: var(--danger); }
.diag-note[hidden] { display: none; }

/* ── v9.2.0 刷新开奖卡（老项目 index.html:119-148 逐字移植，id nsDraw→eggDraw）
 *    Bug4 用户报障根因：彩蛋 JS（egg/draw.ts）移植了，这块 CSS 一条没跟过来，
 *    卡片以裸文本渲染在 body 末尾。与 #nsGreet 同一条底部浮层泳道（bottom:64px），
 *    互斥由 drawConsume 的在场守卫保证。非模态、不抓焦点、点一下即收；
 *    R/SR/SSR 定时自收，UR 不自收（hold.ur=0，老项目拍板）。
 *    🔴 颜色只走变量：金属分档色见 theme.ts PALETTE.foil*，投影见 OVERLAY.shadowDraw。 */
#eggDraw{position:fixed;left:50%;bottom:64px;transform:translateX(-50%);z-index:59;width:min(88vw,340px);
  background:var(--box-bg);border:1px solid var(--line);border-radius:18px;box-shadow:var(--shadow-draw);
  padding:30px 26px 22px;text-align:center;cursor:pointer;touch-action:manipulation;-webkit-tap-highlight-color:transparent;
  -webkit-user-select:none;user-select:none;animation:drawRise .5s cubic-bezier(.2,.7,.3,1) both}
/* 通用 rise 的 to 帧是 transform:none，fill-mode:both 会在动画结束后永久接管 transform，
   把基座的 translateX(-50%) 抹掉＝卡片右偏半个屏（v5.44 remCard 同款事故，必须自带居中帧）。 */
@keyframes drawRise{from{opacity:0;transform:translate(-50%,10px)}to{opacity:1;transform:translate(-50%,0)}}
#eggDraw.out{animation:drawOut .3s ease both}
@keyframes drawOut{to{opacity:0;transform:translate(-50%,8px)}}
#eggDraw .dw-tx{font-size:15px;line-height:1.9;color:var(--fg);letter-spacing:.02em}
#eggDraw .dw-ft{margin-top:14px;font:400 9.5px/1 var(--mono);letter-spacing:.18em;color:var(--muted);opacity:.7}
#eggDraw .dw-rar{position:absolute;top:0;right:0;font:600 10px/1 var(--mono);letter-spacing:.12em;
  padding:5px 10px 5px 12px;border-radius:0 18px 0 10px;color:var(--muted);background:var(--hover)}
#eggDraw.sr::before,#eggDraw.ssr::before,#eggDraw.ur::before{content:'';position:absolute;inset:5px;border-radius:13px;pointer-events:none}
#eggDraw.sr::before{border:1px solid var(--foil-silver);opacity:.5}
#eggDraw.sr .dw-rar{color:var(--foil-silver)}
#eggDraw.ssr{border-color:var(--foil-gold)}
#eggDraw.ssr::before{border:1px solid var(--foil-gold);opacity:.55}
#eggDraw.ssr .dw-tx{font-family:var(--serif);font-size:16.5px;letter-spacing:.04em}
#eggDraw.ssr .dw-rar{color:var(--foil-gold);background:var(--accent-soft)}
#eggDraw.ur{border:1px solid transparent;overflow:hidden;
  background:linear-gradient(var(--box-bg),var(--box-bg)) padding-box,linear-gradient(135deg,var(--foil-gold),var(--foil-gold-hi),var(--foil-silver),var(--foil-gold)) border-box}
#eggDraw.ur::before{border:1px solid var(--foil-gold-hi);opacity:.7}
#eggDraw.ur .dw-tx{font-family:var(--serif);font-size:17px;letter-spacing:.05em;color:var(--foil-gold)}
#eggDraw.ur .dw-rar{color:var(--box-bg);background:linear-gradient(135deg,var(--foil-gold),var(--foil-gold-hi))}
#eggDraw.ur::after{content:'';position:absolute;top:-60%;left:-32%;width:40%;height:220%;transform:rotate(20deg);pointer-events:none;
  background:linear-gradient(90deg,transparent,var(--foil-sheen),transparent);animation:dwSweep 2.8s ease-in-out .45s 2}
@keyframes dwSweep{0%{left:-40%}55%{left:118%}100%{left:118%}}

/* ═══ /mirror 镜像模式 —— 老项目 index.html:10350-10417 逐条移植 ═══
   三档：A 全镜像（字也反）/ B 镜像不反字（默认）/ C 只翻装饰。
   选择器从老项目 DOM 映射到本项目：#editor→#editor-host、.brand→.ns-brand、
   footer→.ns-foot、对话框 .box/.mask 同名沿用。会话态不落盘，刷新即回正常。 */
body.ns-mirror-A,body.ns-mirror-B{transform:scaleX(-1)}
body.ns-mirror-A img{transform:scaleX(-1)}
body.ns-mirror-B #editor-host,body.ns-mirror-B .ns-brand,body.ns-mirror-B .ns-foot,
body.ns-mirror-B img,body.ns-mirror-B .mask,body.ns-mirror-B .box,
body.ns-mirror-B .ns-mirror-panel,body.ns-mirror-B #nsGame{transform:scaleX(-1)}
body.ns-mirror-A .ns-mirror-panel,body.ns-mirror-B .ns-mirror-panel{transform:translateX(-50%) scaleX(-1)}
body.ns-mirror-C .ns-top{flex-direction:row-reverse}
.ns-mirror-panel{position:fixed;left:50%;bottom:22px;transform:translateX(-50%);width:min(92vw,420px);background:var(--box-bg);border:1px solid var(--line);border-radius:16px;padding:22px 20px 30px;z-index:60}
.ns-mirror-panel h2{font:600 17px/1.4 var(--serif);letter-spacing:.04em;margin:0 0 10px}
.ns-mirror-panel p{font-size:12.5px;line-height:1.8;color:var(--muted);margin:0 0 12px}
.ns-mirror-panel .ns-mnote{margin-bottom:0}
.ns-mrow{display:flex;gap:8px;margin:0 0 12px}
.ns-mrow button{flex:1;padding:9px 6px;border:1px solid var(--line);border-radius:10px;background:var(--box-bg);color:var(--fg);font-size:13px;cursor:pointer}
.ns-mrow button.on{border-color:var(--accent);color:var(--accent);font-weight:600}

/* ---- 离线草稿冲突条 #draftBar（v3.1.1）：老项目 draftBar/remoteBar 同族
   （index.html:160-167 / :720-727 逐字几何）。配色全走 theme 令牌；
   老项目 .confcard 的 rgba 阴影按「色彩只进 theme.ts」红线折算成 --shadow-box。
   条与时间 chip 同位 top:54px（老项目 :156），弹出时 chip 让位由 chip 侧
   既有逻辑处理；bj 的 chip 锚位有意的偏离不动（VVW-33 同一纪律：这里只加不改）。 */
.conflictbar { position: fixed; left: 50%; transform: translateX(-50%); z-index: 55;
  pointer-events: none; max-width: 92vw; }
.conflictbar.hidden { display: none; }
#draftBar { top: 54px; }
.confcard { pointer-events: auto; background: var(--box-bg); border: 1px solid var(--line);
  border-top: 3px solid var(--accent); border-radius: 18px; box-shadow: var(--shadow-box);
  padding: 22px 26px 18px; width: min(92vw, 420px); text-align: center;
  animation: rise .5s cubic-bezier(.2, .7, .3, 1) both; }
.confcard .conf-title { font-size: 17.5px; font-weight: 600; margin: 0 0 8px; color: var(--fg); }
.confcard .conf-msg { font-size: 13.5px; color: var(--muted); margin: 0 0 16px; line-height: 1.6; }
.confcard .conf-btns { display: flex; gap: 10px; }
.confcard .conf-btns button { flex: 1; min-height: 44px; padding: 12px 0; font-size: 15px;
  color: var(--fg); background: none; border: 1px solid var(--line); border-radius: 10px;
  cursor: pointer; touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
