/* ============================================================
   冠霸 ERP —— 液态玻璃 UI
   iOS Liquid Glass · 20% 透明度 · 边缘折射反射

   v5.59（2026-09-28 吴总需求·分页栏固定）：
       ① .table-wrap 限高预算 258→316px：原 258px 时表格底边正好贴视口，
          分页条被顶到屏幕外（要滚一下才能翻页）；加 58px 给分页条，
          表格 + 分页条整体落在视口内，翻页条像表头一样恒在眼前。
       ② .pager 自身 position:sticky; bottom:0 + 玻璃底：小屏/内容超长的
           页面即使 .content 也要滚动，分页条吸附在滚动区底部可见。
           背景用与卡片同源的 --glass-bg/--glass-floor/--glass-blur，
           吸底时透出的内容被同样的毛玻璃模糊，风格不突兀。

   v5.58（2026-09-27 吴总需求·翻页时表头固定 + 每页最多 1000 条）：
       .table-wrap 由 overflow-x:auto 改 overflow:auto + max-height:calc(100vh-258px)。
       根因：thead th 的 sticky 一直写着，但被 .table-wrap 的横向滚动截断了
       生效链（sticky 相对最近滚动容器，纵向滚动发生在外层 .content，表头跟着滚走）。
       改后纵向滚动发生在 .table-wrap 内部，表头恒在顶、分页条恒在底；
       弹层里的表格用内联 max-height（如 46vh）覆盖，行为不变。
       配套：ui.js v5.8 分页条内置「N 条/页」选择（15~1000）、crud.js v5.14 接线、
       config.max_page_size 200→1000 统一把后端闸门。

   v5.56（2026-09-26 吴总反馈「图标和开关不要有透明度」）：
       功能性图标全部去透明——菜单图标 .nav-icon .92→1、菜单展开箭头 .nav-arrow .6→1、
       子菜单圆点 .45→1、分组折叠箭头 .fold-arrow .55→1、标签页关闭叉 .tab-x .55→1、
       首页待办箭头 .todo-item .arrow .35→1。
       开关「关」态轨道从半透明玻璃底改实色：浅色 --switch-off #c6cedd，
       深色在 themes.css 深色组覆盖 #454e63；「开」态本来就是实色渐变，不动。
       保留不动的：禁用态（.45 是在表达「不能用」）、空状态插画（.28 是刻意的弱化）、
       动画关键帧里的 opacity（那是入场动效不是透明度设计）。

   v5.55（2026-09-26 吴总反馈「纯色/网格壁纸缩略图空白」）：
       .wall-item 加常驻细描边（inset 1px 中性灰），近白壁纸在任何主题下
       都看得出边界；.active 的外发光环与描边叠加（box-shadow 会被整条覆盖，
       必须两层都写）。配套 wallpaper.js v5.4 把 plain/grid/dots 纹理加深。

   v5.54（2026-09-26 吴总需求·主题大幅扩充到 20 套）：
       新增 6 套主题（纸墨 paper / 极简 mono / 糖果 candy / 复古终端 retro /
       黑金 noir / 马卡龙 macaron，定义在 themes.css）。其中 retro / noir 为深色，
       本文件六组深色规则（.bg-layer 压暗遮罩 / #btnTheme 日月图标显隐 /
       .chip 与 .select 的 option 底色 / .tag-* 五色 / .src-ico-* 五色）同步扩展，
       漏一组就会在深色下出现白底下拉或发暗的标签字。

   v5.51（2026-09-26 吴总需求·门店管理卡片模式）：
       新增 .store-grid / .store-card 一族（一店一卡：图标块+店名+状态徽标+地址+
       月销售额/完成度/员工数/月目标四宫格+渐变进度条+编辑员工按钮）。
       颜色全部走主题变量（--glass-* / --text-* / --accent-grad / --success），
       深色皮肤自动跟随，不需要额外覆盖；图标块的五个渐变色是固定的（跟截图一致），
       浅深主题下都不突兀。

   v5.50（2026-09-24 吴总需求·IP 归属地到国家省市）：
       新增 .cell-geo（日志列表「来源」列里 IP 归属地那一行）。只有公网访问才渲染，
       本机/内网使用时不出现，所以列表观感跟上一版一致。颜色沿用 --text-3，
       深浅主题自动跟随，不需要额外覆盖。

   v5.49（2026-09-24 吴总需求·日志来源图标化）：
       新增 .src-row / .src-ico（操作日志详情的「来源 / 设备」行）、.src-raw（原始标识串折叠区）、
       .cell-src（日志列表里 IP 下面那行小字）。.src-ico 的五个配色与 .tag-* 同色板，
       深色主题的亮色覆盖一并补齐；漏一处就会在午夜/石墨/赛博/翡翠皮肤下看不清。
   v5.48（2026-09-23 吴总反馈·详情日期显示不全）：
       .modal.wide 984→1040 —— 「下次跟进」日期列 96→144（items.js）后，
       编辑态明细表 990px 在 984 弹层的 942 预算里放不下，弹层跟着加宽。
   v5.47（2026-09-23 吴总需求·列表页一键批量）：
       新增 .bulk-bar（批量操作条）。样式随主题主色走
       （color-mix(var(--accent) ...)），20 套皮肤下都不会突兀。
       注意 .bulk-bar[hidden] 必须显式 display:none ——
       上面的 display:flex 优先级高于浏览器对 [hidden] 的默认样式。
   ============================================================ */

* { box-sizing: border-box; margin: 0; padding: 0; }

html, body {
    height: 100%;
    font-family: var(--font);
    font-size: 14px;
    color: var(--text-1);
    background: var(--bg);
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

body { overflow: hidden; }

a { color: inherit; text-decoration: none; }
button, input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; outline: none; }
button { cursor: pointer; border: none; background: none; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb {
    background: color-mix(in srgb, var(--text-3) 40%, transparent);
    border-radius: 8px;
}
::-webkit-scrollbar-thumb:hover { background: color-mix(in srgb, var(--text-3) 65%, transparent); }

/* ------------------------------------------------------------
   背景层 —— 壁纸 + 流动光斑 + 噪点
   ------------------------------------------------------------ */
.bg-layer {
    position: fixed;
    inset: 0;
    z-index: 0;
    overflow: hidden;
    background: var(--bg);
}

/* ★ 深色主题下把整个壁纸层压暗（2026-09-17 吴总反馈「夜间模式字和标题看不清」）。
   根因：深色主题的文字是亮色系，而壁纸是独立设置——内置 12 张浅色渐变、
   以及用户上传的浅色照片，透过半透明玻璃卡片把整页衬成白雾，对比度崩塌。
   压暗层只盖背景（.bg-wall / .bg-blob / .bg-noise 之上、页面内容之下），
   四套深色主题启用；浅色主题不加（深字压浅壁纸本来就清楚）。
   色调用与主题背景同源的深蓝黑，观感统一；壁纸明暗不同时遮罩保证下限。 */
.bg-layer::after {
    content: '';
    position: absolute;
    inset: 0;
    background: transparent;
    pointer-events: none;
    transition: background .6s var(--ease);
}
html[data-theme="midnight"] .bg-layer::after,
html[data-theme="graphite"] .bg-layer::after,
html[data-theme="cyber"] .bg-layer::after,
html[data-theme="emerald"] .bg-layer::after,
html[data-theme="retro"] .bg-layer::after,
html[data-theme="noir"] .bg-layer::after {
    background: linear-gradient(150deg,
        rgba(11, 17, 32, .70) 0%,
        rgba(11, 17, 32, .60) 45%,
        rgba(11, 17, 32, .80) 100%);
}

.bg-wall {
    position: absolute;
    inset: -5%;
    background-size: cover;
    background-position: center;
    background-repeat: no-repeat;
    transition: opacity .6s var(--ease), transform 1.2s var(--ease);
    transform: scale(1.04);
}

.bg-blob {
    position: absolute;
    border-radius: 50%;
    filter: blur(70px);
    opacity: .55;
    will-change: transform;
}
[data-theme] .bg-blob { opacity: .5; }
.bg-blob-1 {
    width: 46vw; height: 46vw; left: -8vw; top: -12vw;
    background: radial-gradient(circle at 30% 30%, var(--wall-1), transparent 68%);
    animation: float1 26s ease-in-out infinite;
}
.bg-blob-2 {
    width: 40vw; height: 40vw; right: -6vw; top: 12vh;
    background: radial-gradient(circle at 60% 40%, var(--wall-2), transparent 68%);
    animation: float2 32s ease-in-out infinite;
}
.bg-blob-3 {
    width: 44vw; height: 44vw; left: 22vw; bottom: -18vw;
    background: radial-gradient(circle at 50% 50%, var(--wall-3), transparent 68%);
    animation: float3 38s ease-in-out infinite;
}
@keyframes float1 {
    0%, 100% { transform: translate(0, 0) scale(1); }
    50%      { transform: translate(6vw, 5vh) scale(1.12); }
}
@keyframes float2 {
    0%, 100% { transform: translate(0, 0) scale(1.05); }
    50%      { transform: translate(-7vw, 7vh) scale(.92); }
}
@keyframes float3 {
    0%, 100% { transform: translate(0, 0) scale(.95); }
    50%      { transform: translate(4vw, -6vh) scale(1.1); }
}

.bg-noise {
    position: absolute;
    inset: 0;
    opacity: .35;
    mix-blend-mode: overlay;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='200' height='200'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='.85' numOctaves='3'/%3E%3C/filter%3E%3Crect width='200' height='200' filter='url(%23n)' opacity='.5'/%3E%3C/svg%3E");
}

/* 关闭壁纸时的纯色底 */
.no-wallpaper .bg-wall { opacity: 0; }

/* ------------------------------------------------------------
   液态玻璃 —— 核心材质
   ------------------------------------------------------------ */
.glass {
    position: relative;
    /* --glass-floor 是「可读性地板」：在用户调节的透明度之上再垫一层
       半透明底色，保证 20% 透明度下文字依然够清楚（由 app.js 按主题注入） */
    background-color: var(--glass-bg);
    background-image: linear-gradient(0deg, var(--glass-floor), var(--glass-floor));
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    border-radius: var(--radius);
    border: 1px solid var(--glass-line);
    /* 顶/底内高光强度走变量：日间用默认 70%/26%，四套深色主题在 themes.css
       降到 12%/5%——2026-09-17 吴总反馈夜间白线太白、锯齿感强 */
    box-shadow:
        inset 0 1px 0 0 color-mix(in srgb, var(--white) var(--glass-hi, 70%), transparent),
        inset 0 -1px 0 0 color-mix(in srgb, var(--white) var(--glass-lo, 26%), transparent),
        var(--shadow);
    isolation: isolate;
}

/* 白色反光条已整体移除（2026-09-17 吴总反馈「白色折射反光条碍视线」）：
   原 .glass::before 高光描边与 .glass::after 斜向光斑删除；
   真折射透镜（折射 class + SVG 位移滤镜）也已在同日按吴总要求移除。 */
[data-theme] .glass { color: var(--text-1); }

/* 关闭玻璃效果 */
.no-glass .glass {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background-color: var(--glass-bg-strong);
    background-image: none;
}

/* ------------------------------------------------------------
   自定义壁纸（真实照片）模式
   内置壁纸是柔和渐变，叠上装饰光斑没问题；照片会被三层光斑
   + 噪点糊得看不出内容，所以照片模式关闭这些装饰层。
   ------------------------------------------------------------ */
body.custom-wall .bg-blob { display: none; }
body.custom-wall .bg-noise { opacity: .1; }
/* 只垫一层极淡的明度过渡，保住照片本身的可视度 */
body.custom-wall .bg-wall { transform: none; }

/* 页面标签栏 */
.tabbar {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    overflow-x: auto;
    overflow-y: hidden;
    scrollbar-width: none;
}
.tabbar::-webkit-scrollbar { display: none; }
.tabbar:empty { display: none; }
.tab-chip {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 7px;
    max-width: 190px;
    padding: 5px 8px 5px 12px;
    border-radius: 999px;
    border: 1px solid transparent;
    font-size: 12.5px;
    color: var(--text-2);
    cursor: pointer;
    white-space: nowrap;
    transition: background .18s var(--ease), color .18s var(--ease), box-shadow .18s var(--ease);
}
.tab-chip:hover { background: var(--glass-bg-strong); color: var(--text-1); }
.tab-chip.active {
    background: var(--accent-grad);
    color: #fff;
    box-shadow: 0 4px 12px var(--accent-soft);
}
.tab-chip .tab-label {
    overflow: hidden;
    text-overflow: ellipsis;
    max-width: 128px;
}
.tab-chip .tab-x {
    flex: 0 0 auto;
    width: 16px; height: 16px;
    border-radius: 50%;
    display: grid;
    place-items: center;
    color: currentColor;
    opacity: 1;
    transition: opacity .15s var(--ease), background .15s var(--ease);
}
.tab-chip .tab-x:hover { opacity: 1; background: rgba(0, 0, 0, .14); }
.tab-chip .tab-x svg { width: 9px; height: 9px; }
.tab-chip.active .tab-x:hover { background: rgba(255, 255, 255, .24); }
@media (max-width: 720px) {
    .tab-chip { max-width: 150px; }
    .tab-chip .tab-label { max-width: 92px; }
}

/* ------------------------------------------------------------
   应用骨架
   ------------------------------------------------------------ */
.app {
    position: relative;
    z-index: 1;
    display: flex;
    height: 100vh;
    padding: 14px;
    gap: 14px;
}

/* ------------------ 侧边栏 ------------------ */
.sidebar {
    width: var(--nav-w);
    flex: 0 0 var(--nav-w);
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    padding: 18px 12px;
    transition: margin-left .35s var(--ease), opacity .3s var(--ease);
}

.brand {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 4px 10px 18px;
}
.brand-logo {
    width: 38px; height: 38px;
    flex: 0 0 38px;
    border-radius: 12px;
    background: var(--accent-grad);
    display: grid;
    place-items: center;
    color: #fff;
    font-weight: 700;
    font-size: 17px;
    letter-spacing: -.5px;
    box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 40%, transparent);
}
.brand-text b {
    display: block;
    font-size: 15px;
    letter-spacing: -.2px;
    line-height: 1.25;
    /* 公司名称来自系统设置，长度不定：超长省略，悬停有 title 提示全名 */
    max-width: 148px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}
.brand-text span { font-size: 12px; color: var(--text-3); letter-spacing: .4px; }

.nav {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 2px 4px 8px;
    margin: 0 -4px;
}
.nav::-webkit-scrollbar { width: 4px; }

.nav-group-title {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    font-weight: 650;
    color: var(--text-2);
    letter-spacing: .8px;
    padding: 14px 12px 7px;
    text-transform: uppercase;
    cursor: pointer;
    user-select: none;
    border-radius: var(--radius-sm);
    transition: color .2s var(--ease), background .2s var(--ease);
}
.nav-group-title:hover {
    color: var(--text-1);
    background: var(--glass-bg-weak);
}
/* 分组折叠（2026-09-17 吴总需求）：标题右侧小箭头，折叠时指向右、展开时指向下 */
.fold-arrow {
    flex: 0 0 auto;
    width: 0; height: 0;
    border-left: 4.5px solid transparent;
    border-right: 4.5px solid transparent;
    border-top: 5px solid currentColor;
    opacity: 1;
    transition: transform .25s var(--ease);
}
.nav-group.folded .fold-arrow { transform: rotate(-90deg); }
/* 分组折叠动画（2026-09-18 修正「展开无动画」）：
   原方案 max-height 0↔640px，展开时前几百 px 是空跑（内容只有 80~280px），
   肉眼表现为"瞬间弹开"。改用 grid-template-rows 1fr↔0fr——高度由内容自适应，
   两个方向过渡距离都等于真实内容高度，动画对称平滑。
   .nav-sub 只做容器（grid + overflow:hidden），内容放 .nav-sub-inner（min-height:0
   是 grid 子项收缩的必要条件，缺了会撑开）。 */
.nav-sub {
    display: grid;
    grid-template-rows: 1fr;
    overflow: hidden;
    transition: grid-template-rows .32s var(--ease);
}
.nav-sub-inner { min-height: 0; }
.nav-group.folded .nav-sub { grid-template-rows: 0fr; }

.nav-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 10px 12px;
    border-radius: var(--radius-sm);
    color: var(--text-1);
    font-size: 13.5px;
    font-weight: 500;
    cursor: pointer;
    position: relative;
    transition: background .2s var(--ease), color .2s var(--ease), transform .18s var(--ease);
    user-select: none;
}
.nav-item:hover {
    background: var(--glass-bg-weak);
    color: var(--text-1);
    transform: translateX(2px);
}
.nav-item.active {
    background: var(--accent-grad);
    color: #fff;
    box-shadow: 0 8px 22px color-mix(in srgb, var(--accent) 38%, transparent),
                inset 0 1px 0 rgba(255, 255, 255, .4);
}
.nav-item.active .nav-icon { color: #fff; }
.nav-icon {
    width: 18px; height: 18px;
    flex: 0 0 18px;
    display: grid;
    place-items: center;
    color: currentColor;
    opacity: 1;
}
.nav-icon svg { width: 18px; height: 18px; }
.nav-badge {
    margin-left: auto;
    font-size: 12px;
    padding: 1px 7px;
    border-radius: 20px;
    background: var(--danger);
    color: #fff;
    font-weight: 600;
}
.nav-arrow {
    margin-left: auto;
    width: 14px; height: 14px;
    transition: transform .25s var(--ease);
    opacity: 1;
}
.nav-item.open .nav-arrow { transform: rotate(90deg); }

/* .nav-sub 的折叠机制统一在上方 grid-template-rows 区块定义（勿在此重复 max-height，
   会覆盖上面规则导致展开无动画——2026-09-18 踩过的坑） */
.nav-sub .nav-item {
    padding-left: 34px;
    font-size: 13px;
}
.nav-sub .nav-item::before {
    content: "";
    position: absolute;
    left: 18px;
    width: 5px; height: 5px;
    border-radius: 50%;
    background: currentColor;
    opacity: 1;
}
.nav-sub .nav-item.active::before { opacity: 1; background: #fff; }

.sidebar-foot {
    padding: 12px 10px 2px;
    border-top: 1px solid var(--glass-line);
    margin-top: 6px;
}
.sidebar-foot .user-mini {
    display: flex;
    align-items: center;
    gap: 10px;
}
.avatar {
    width: 34px; height: 34px;
    flex: 0 0 34px;
    border-radius: 50%;
    background: var(--accent-grad);
    color: #fff;
    display: grid;
    place-items: center;
    font-weight: 600;
    font-size: 13px;
    overflow: hidden;
}
.avatar img { width: 100%; height: 100%; object-fit: cover; }

/* ============================================================
   头像悬停动效（2026-09-28 吴总要求）
   需求原话：「鼠标悬停到头像的时候，头像会等比放大并 Q 弹一下后开始旋转」

   ★ 为什么拆成两层：Q弹放大 与 持续旋转 都要用 transform，
     放在同一个元素上会互相覆盖（旋转会把缩放顶掉）。
     因此分工——
       · 外层 .avatar        → 负责「等比放大 + Q弹」（transition + cubic-bezier 回弹）
       · 内层 .avatar img    → 负责「持续旋转」（animation: spin）
     两层叠加，视觉上就是「先弹一下、随后转起来」。
   ★ 为什么 hover 时要放宽 overflow / 收回圆角：
     头像默认是 overflow:hidden + border-radius:50% 的正圆。
     正圆无论怎么旋转，轮廓都是不变的圆 —— 旋转**看不出来**（这是几何事实，不是 bug）。
     所以 hover 放大时把圆角收紧成「超椭圆/近方形」，让图片四角露出、旋转才有视觉反馈。
   ★ 只对「有图」的头像生效（.avatar.has-img）：纯首字头像没有图可转。
   ★ 无定时器、无 JS、无监听残留 —— 纯 CSS，鼠标移开自动复位（内存纪律）。
   ============================================================ */
.avatar.has-img {
    /* 缩放用弹性缓动：先冲过头再回弹，形成 Q 弹手感 */
    transition: transform .42s cubic-bezier(.34, 1.56, .64, 1),
                border-radius .3s var(--ease),
                box-shadow .28s var(--ease);
    will-change: transform;
    transform: translateZ(0);   /* 提升为合成层，避免 hover 时整页重绘卡顿 */
    position: relative;
}
.avatar.has-img:hover {
    transform: scale(1.28);
    /* 圆角收紧 → 露出四角，旋转才看得见；
       overflow 同步放开，否则四角仍被裁掉（父层 overflow:hidden 的锅） */
    border-radius: 26%;
    overflow: visible;
    box-shadow: 0 10px 26px rgba(15, 23, 42, .28);
    z-index: 6;
}
.avatar.has-img:hover img {
    /* 图片自己补回圆角，避免溢出后露出直角 */
    border-radius: 26%;
    /* 旋转匀速无限循环。0~8% 静止一瞬，先让 Q 弹的放大被看见，
       之后才转 —— 即「弹一下 → 再开始转」 */
    animation: avatar-spin 2.2s linear infinite;
}
@keyframes avatar-spin {
    0%, 8%   { transform: rotate(0deg); }
    100%     { transform: rotate(360deg); }
}

/* 顶栏/侧边栏的小头像（30px）：倍率略降，免得撑破容器 */
.user-chip .avatar.has-img:hover { transform: scale(1.18); }

/* 无障碍：系统开启「减弱动态效果」时，只保留轻微放大，去掉旋转与回弹 */
@media (prefers-reduced-motion: reduce) {
    .avatar.has-img { transition: transform .2s ease, border-radius .2s ease; }
    .avatar.has-img:hover { transform: scale(1.08); }
    .avatar.has-img:hover img { animation: none; }
}

.user-mini-info { min-width: 0; flex: 1; }
.user-mini-info b { display: block; font-size: 13px; font-weight: 600; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.user-mini-info span { font-size: 12px; color: var(--text-3); }

/* ------------------ 主区 ------------------ */
.main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 14px;
}

.topbar {
    height: var(--top-h);
    flex: 0 0 var(--top-h);
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 0 16px;
    border-radius: var(--radius-lg);
}

.icon-btn {
    width: 36px; height: 36px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    color: var(--text-2);
    background: var(--glass-bg-weak);
    border: 1px solid transparent;
    transition: all .2s var(--ease);
    flex: 0 0 36px;
}
.icon-btn:hover {
    background: var(--glass-bg-strong);
    color: var(--text-1);
    border-color: var(--glass-line);
    transform: translateY(-1px);
}
.icon-btn svg { width: 18px; height: 18px; }
.icon-btn.spin svg { animation: spin .8s linear infinite; }
/* 日间/夜间切换按钮（#btnTheme）双图标显隐：
   浅色主题 → 显示月亮（点了去夜间）；四套深色主题 → 显示太阳（点了回日间）。
   深色清单必须与 app.js 的 App.DAY_NIGHT_DARK 保持一致。 */
#btnTheme .ico-sun { display: none; }
#btnTheme .ico-moon { display: block; }
html[data-theme="midnight"] #btnTheme .ico-moon,
html[data-theme="graphite"] #btnTheme .ico-moon,
html[data-theme="cyber"] #btnTheme .ico-moon,
html[data-theme="emerald"] #btnTheme .ico-moon,
html[data-theme="retro"] #btnTheme .ico-moon,
html[data-theme="noir"] #btnTheme .ico-moon { display: none; }
html[data-theme="midnight"] #btnTheme .ico-sun,
html[data-theme="graphite"] #btnTheme .ico-sun,
html[data-theme="cyber"] #btnTheme .ico-sun,
html[data-theme="emerald"] #btnTheme .ico-sun,
html[data-theme="retro"] #btnTheme .ico-sun,
html[data-theme="noir"] #btnTheme .ico-sun { display: block; }
@keyframes spin { to { transform: rotate(360deg); } }

.page-title { min-width: 0; flex: 1; }
.page-title h1 {
    font-size: 17px;
    font-weight: 650;
    letter-spacing: -.3px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.page-title p {
    font-size: 12px;
    color: var(--text-3);
    margin-top: 1px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.topbar-right { display: flex; align-items: center; gap: 8px; }

.chip {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    height: 36px;
    padding: 0 12px;
    border-radius: 11px;
    background: var(--glass-bg-weak);
    border: 1px solid var(--glass-line);
    font-size: 12.5px;
    color: var(--text-2);
    cursor: pointer;
    transition: all .2s var(--ease);
    white-space: nowrap;
}
.chip:hover { background: var(--glass-bg-strong); color: var(--text-1); }
.chip svg { width: 15px; height: 15px; }
.chip select {
    background: transparent;
    border: none;
    font-size: 12.5px;
    color: var(--text-1);
    cursor: pointer;
    max-width: 130px;
}
.chip select option { background: #fff; color: #16203a; }
[data-theme="midnight"] .chip select option,
[data-theme="graphite"] .chip select option,
[data-theme="cyber"] .chip select option,
[data-theme="emerald"] .chip select option,
[data-theme="retro"] .chip select option,
[data-theme="noir"] .chip select option { background: #1a1f2e; color: #eef2ff; }

.user-chip {
    display: flex;
    align-items: center;
    gap: 9px;
    height: 40px;
    padding: 0 12px 0 5px;
    border-radius: 13px;
    background: var(--glass-bg-weak);
    border: 1px solid var(--glass-line);
    cursor: pointer;
    transition: all .2s var(--ease);
}
.user-chip:hover { background: var(--glass-bg-strong); }
.user-chip .avatar { width: 30px; height: 30px; flex: 0 0 30px; font-size: 12px; }
.user-chip b { font-size: 12.5px; font-weight: 600; }
.user-chip small { display: block; font-size: 12px; color: var(--text-3); line-height: 1.2; }

/* ------------------ 内容区 ------------------ */
.content {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    padding-right: 2px;
    scroll-behavior: smooth;
}
.content-inner { padding-bottom: 20px; animation: fadeUp .38s var(--ease); }
/* 页面根节点：每次路由新建一个，旧节点被卸载，
   使旧页面的异步回调无法串写到新页面 */
.page-host { display: block; min-width: 0; }
@keyframes fadeUp {
    from { opacity: 0; transform: translateY(8px); }
    to   { opacity: 1; transform: none; }
}

/* ------------------------------------------------------------
   卡片 / 网格
   ------------------------------------------------------------ */
.card {
    border-radius: var(--radius);
    padding: 18px;
    margin-bottom: 14px;
}
.card-head {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 14px;
}
.card-head h3 {
    font-size: 14.5px;
    font-weight: 620;
    letter-spacing: -.2px;
    display: flex;
    align-items: center;
    gap: 8px;
}
.card-head h3::before {
    content: "";
    width: 3px; height: 15px;
    border-radius: 3px;
    background: var(--accent-grad);
}
.card-head .spacer { flex: 1; }
.card-head .sub { font-size: 12px; color: var(--text-2); }

.grid { display: grid; gap: 14px; }
.grid-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.grid-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.grid-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }

/* KPI 卡 */
.kpi {
    border-radius: var(--radius);
    padding: 16px 18px;
    position: relative;
    overflow: hidden;
}
.kpi-top {
    display: flex;
    align-items: center;
    gap: 9px;
    margin-bottom: 12px;
}
.kpi-ico {
    width: 34px; height: 34px;
    border-radius: 11px;
    display: grid;
    place-items: center;
    background: var(--accent-soft);
    color: var(--accent);
}
.kpi-ico svg { width: 17px; height: 17px; }
.kpi-label { font-size: 12.5px; color: var(--text-2); font-weight: 500; }
.kpi-value {
    font-size: 25px;
    font-weight: 700;
    letter-spacing: -1px;
    font-family: var(--font-num);
    line-height: 1.1;
    display: flex;
    align-items: baseline;
    gap: 4px;
}
.kpi-value small { font-size: 13px; font-weight: 500; letter-spacing: 0; opacity: .7; }
.kpi-foot {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 9px;
    font-size: 12px;
    color: var(--text-3);
}
.trend {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-weight: 600;
    font-family: var(--font-num);
}
.trend.up { color: #e11d48; }
.trend.down { color: #059669; }
.trend svg { width: 12px; height: 12px; }

/* 待办小块 */
.todo-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 14px;
    border-radius: var(--radius-sm);
    background: var(--glass-bg-weak);
    border: 1px solid transparent;
    cursor: pointer;
    transition: all .2s var(--ease);
}
.todo-item:hover {
    background: var(--glass-bg-strong);
    border-color: var(--glass-line);
    transform: translateX(3px);
}
.todo-ico {
    width: 36px; height: 36px;
    flex: 0 0 36px;
    border-radius: 11px;
    display: grid;
    place-items: center;
}
.todo-ico svg { width: 17px; height: 17px; }
.todo-item .n { font-size: 19px; font-weight: 700; font-family: var(--font-num); line-height: 1; }
.todo-item .l { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.todo-item .arrow { margin-left: auto; opacity: 1; }

/* ------------------------------------------------------------
   按钮
   ------------------------------------------------------------ */
.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 6px;
    height: 36px;
    padding: 0 15px;
    border-radius: 11px;
    font-size: 13px;
    font-weight: 550;
    background: var(--glass-bg-weak);
    border: 1px solid var(--glass-line);
    color: var(--text-1);
    transition: all .2s var(--ease);
    white-space: nowrap;
    position: relative;
    overflow: hidden;
}
.btn:hover {
    background: var(--glass-bg-strong);
    transform: translateY(-1px);
    box-shadow: var(--shadow-sm);
}
.btn:active { transform: translateY(0) scale(.98); }
.btn svg { width: 15px; height: 15px; }

.btn-primary {
    background: var(--accent-grad);
    color: #fff;
    border-color: transparent;
    box-shadow: 0 6px 18px color-mix(in srgb, var(--accent) 34%, transparent);
}
.btn-primary:hover {
    box-shadow: 0 9px 24px color-mix(in srgb, var(--accent) 45%, transparent);
    background: var(--accent-grad);
}
.btn-danger { color: var(--danger); border-color: color-mix(in srgb, var(--danger) 32%, transparent); }
.btn-danger:hover { background: color-mix(in srgb, var(--danger) 12%, transparent); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-ghost:hover { background: var(--glass-bg-weak); box-shadow: none; }
.btn-sm { height: 30px; padding: 0 11px; font-size: 12.5px; border-radius: 9px; }
.btn-sm svg { width: 13px; height: 13px; }
.btn-xs { height: 26px; padding: 0 9px; font-size: 12px; border-radius: 8px; }
.btn:disabled { opacity: .45; cursor: not-allowed; transform: none !important; box-shadow: none !important; }
/* 置灰但仍可点：用于详情弹层里「当前状态不能编辑」的编辑按钮 ——
   点它会弹出原因，所以不能用 :disabled（那样连点击事件都不触发）。 */
.btn-off { opacity: .45; box-shadow: none !important; }
.btn-off:hover { transform: none !important; }

.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* 表格行内操作 */
.row-actions { display: flex; gap: 4px; align-items: center; }
.row-btn {
    width: 28px; height: 28px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    color: var(--text-2);
    transition: all .18s var(--ease);
}
.row-btn:hover { background: var(--accent-soft); color: var(--accent); }
.row-btn.danger:hover { background: color-mix(in srgb, var(--danger) 14%, transparent); color: var(--danger); }
.row-btn svg { width: 14px; height: 14px; }

/* ------------------------------------------------------------
   表单
   ------------------------------------------------------------ */
.form-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 14px;
}
.form-grid.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.form-item { display: flex; flex-direction: column; gap: 6px; }
.form-item.full { grid-column: 1 / -1; }
.form-item label {
    font-size: 12.5px;
    color: var(--text-2);
    font-weight: 550;
    display: flex;
    align-items: center;
    gap: 4px;
}
.form-item label .req { color: var(--danger); }

/* select 快捷新增（2026-09-21 吴总：商品「所属分类」旁直接建分类）：
   下拉与「+ 新增」小按钮同行，下拉自适应占满、按钮不被压缩 */
.form-item .with-qa { display: flex; gap: 8px; align-items: center; }
.form-item .with-qa .select { flex: 1 1 auto; min-width: 0; }
.form-item .with-qa .qa-btn { flex: 0 0 auto; white-space: nowrap; }

.input, .select, .textarea {
    height: 38px;
    padding: 0 12px;
    border-radius: 11px;
    background: var(--glass-bg-weak);
    border: 1px solid var(--glass-line);
    color: var(--text-1);
    font-size: 13px;
    transition: all .2s var(--ease);
    width: 100%;
}
.textarea { height: auto; min-height: 78px; padding: 9px 12px; resize: vertical; line-height: 1.55; }
.input:focus, .select:focus, .textarea:focus {
    background: var(--glass-bg-strong);
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.input::placeholder, .textarea::placeholder { color: var(--text-3); }
.select { appearance: none; cursor: pointer; padding-right: 30px;
    background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 24 24' fill='none' stroke='%23888' stroke-width='2.5' stroke-linecap='round'%3E%3Cpath d='M6 9l6 6 6-6'/%3E%3C/svg%3E");
    background-repeat: no-repeat;
    background-position: right 11px center;
}
.select option { background: #fff; color: #16203a; }
[data-theme="midnight"] .select option,
[data-theme="graphite"] .select option,
[data-theme="cyber"] .select option,
[data-theme="emerald"] .select option,
[data-theme="retro"] .select option,
[data-theme="noir"] .select option { background: #1a1f2e; color: #eef2ff; }

/* ------------------------------------------------------------
   自定义下拉（原生 select 的系统弹层无法定制外观，由 ui.js 接管）
   真实 select 隐藏保留（取值/赋值/change 全兼容），按钮 + 玻璃浮层代替
   ------------------------------------------------------------ */
.gbsel { position: relative; display: inline-flex; vertical-align: middle; max-width: 100%; }
.form-item .gbsel { display: flex; width: 100%; }
.gbsel-native { display: none !important; }

.gbsel-trigger {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 0 11px 0 12px;
    background: var(--glass-bg-weak);
    border: 1px solid var(--glass-line);
    border-radius: 11px;
    color: var(--text-1);
    font-size: 13px;
    text-align: left;
    cursor: pointer;
    transition: all .2s var(--ease);
}
.gbsel-trigger:hover,
.gbsel-trigger.open {
    background: var(--glass-bg-strong);
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
}
.gbsel-trigger.open { box-shadow: 0 0 0 3px var(--accent-soft); }
.gbsel-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.gbsel-caret { flex: 0 0 auto; color: var(--text-3); transition: transform .2s var(--ease); }
.gbsel-trigger.open .gbsel-caret { transform: rotate(180deg); color: var(--accent); }

/* 位置随宿主收窄：筛选栏 / 明细行 / 顶栏 */
.filter-bar .gbsel-trigger { height: 36px; min-width: 130px; }
/* 明细行变体（.gbsel-line）：基础尺寸在此；表格里另有更窄的专属覆盖，
   见文末「明细表」段 table.items-grid .gbsel-line .gbsel-trigger */
.gbsel.gbsel-line .gbsel-trigger { height: 30px; min-width: 96px; padding: 0 8px 0 9px; font-size: 12.5px; border-radius: 9px; }
.topbar .gbsel-trigger,
.chip .gbsel-trigger {
    height: auto;
    min-width: 0;
    padding: 0;
    background: transparent;
    border: none;
    box-shadow: none;
    font-size: 12.5px;
    font-weight: 600;
    color: var(--text-1);
}
.chip .gbsel-caret { color: var(--text-3); }

.gbsel-menu {
    position: fixed;
    min-width: 120px;
    max-height: 264px;
    overflow-y: auto;
    padding: 5px;
    background: color-mix(in srgb, var(--glass-bg-strong) 90%, transparent);
    backdrop-filter: blur(22px) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(22px) saturate(var(--glass-sat));
    border: 1px solid var(--glass-line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    animation: gbselIn .16s var(--ease);
}
.no-glass .gbsel-menu {
    backdrop-filter: none;
    -webkit-backdrop-filter: none;
    background: var(--glass-bg-strong);
}
@keyframes gbselIn {
    from { opacity: 0; transform: translateY(-5px); }
    to   { opacity: 1; transform: none; }
}
.gbsel-item {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 11px;
    border-radius: 8px;
    font-size: 13px;
    color: var(--text-1);
    cursor: pointer;
    transition: background .15s var(--ease);
}
.gbsel-item:hover { background: color-mix(in srgb, var(--accent) 12%, transparent); }
.gbsel-item.active {
    color: var(--accent);
    background: color-mix(in srgb, var(--accent) 12%, transparent);
    font-weight: 600;
}
.gbsel-item.active::after { content: "✓"; margin-left: auto; font-size: 12px; }
.gbsel-item.disabled { opacity: .45; cursor: not-allowed; }

/* 筛选栏 */
.filter-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 9px;
    margin-bottom: 14px;
}
.filter-bar .input, .filter-bar .select { width: auto; min-width: 130px; height: 36px; }
.filter-bar .input.search { min-width: 200px; }
.filter-bar .spacer { flex: 1; }

.search-wrap { position: relative; display: flex; align-items: center; }
.search-wrap svg {
    position: absolute;
    left: 11px;
    width: 15px; height: 15px;
    color: var(--text-3);
    pointer-events: none;
}
.search-wrap .input { padding-left: 32px; }

/* 批量操作条（2026-09-23 吴总需求·列表页一键批量）
   勾选任意行后出现在筛选栏与表格之间。
   用「当前主题主色的淡色调」描边 + 打底，使它在一堆中性色的表单控件里跳出来，
   明确告诉用户「现在有一批单据待处理」；跟随主题色所以 14 套皮肤下都不会突兀。 */
.bulk-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 10px;
    margin-bottom: 12px;
    padding: 9px 14px;
    border-radius: var(--radius-sm);
    border: 1px solid color-mix(in srgb, var(--accent) 40%, transparent);
    background: color-mix(in srgb, var(--accent) 10%, transparent);
}
/* 必须显式关掉：上面的 display:flex 优先级高于浏览器对 [hidden] 的默认样式，
   不写这条，未勾选时批量条会照样显示出来（空的）。 */
.bulk-bar[hidden] { display: none; }
.bulk-bar .bulk-info {
    display: inline-flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    color: var(--text-2);
    white-space: nowrap;
}
.bulk-bar .bulk-info svg { color: var(--accent); }
.bulk-bar .bulk-info b { color: var(--accent); font-size: 15px; margin: 0 2px; }
.bulk-bar .bulk-acts { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; }
.bulk-bar .bulk-clear { margin-left: auto; }
/* 置灰的批量按钮保留可见（不隐藏）：按钮凭空消失会让人以为功能坏了，
   而「为什么现在不能点」正是用户需要的信息 —— 原因写在 title 上，悬停即见。 */
.bulk-bar .btn:disabled { opacity: .45; cursor: not-allowed; }

/* 复选/单选 */
.check { display: inline-flex; align-items: center; gap: 7px; cursor: pointer; font-size: 13px; }
.check input { width: 15px; height: 15px; accent-color: var(--accent); cursor: pointer; }

/* 明细表格内输入 */
.line-input {
    height: 32px;
    padding: 0 9px;
    border-radius: 8px;
    background: var(--glass-bg-weak);
    border: 1px solid var(--glass-line);
    font-size: 12.5px;
    width: 100%;
    color: var(--text-1);
}
.line-input:focus { border-color: var(--accent); background: var(--glass-bg-strong); }
/* 明细行输入框下方的小字（v5.12 第二十三轮）：设备规格、跟进临期提示 */
.line-sub {
    font-size: 11px;
    line-height: 1.45;
    margin-top: 3px;
    color: var(--text-3);
    word-break: break-all;
}

/* ------------------------------------------------------------
   表格
   ------------------------------------------------------------ */
.table-wrap {
    /* v5.58：横竖都滚 + 视口内限高。此前只有 overflow-x，纵向被外层 .content
       滚走 —— thead 的 sticky 是相对最近滚动容器的，被 .table-wrap 截断后
       表头跟着滚走（吴总「翻阅要拉回最上面看列名」的根因）。现在纵向滚动
       发生在 .table-wrap 内部，thead th 的 sticky 立即生效，表头恒在顶、
       分页条恒在底；弹层里的表格用内联 max-height 覆盖（如 46vh）不受影响。 */
    overflow: auto;
    max-height: calc(100vh - 316px);
    border-radius: var(--radius-sm);
    margin: 0 -4px;
    padding: 0 4px;
}
table.data {
    width: 100%;
    border-collapse: separate;
    border-spacing: 0;
    font-size: 13.5px;
    color: var(--text-1);
    min-width: 760px;
}
table.data thead th {
    text-align: left;
    font-size: 12.5px;
    font-weight: 650;
    color: var(--text-2);
    padding: 11px 12px;
    white-space: nowrap;
    border-bottom: 1px solid var(--glass-line);
    background: var(--glass-bg-weak);
    position: sticky;
    top: 0;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    z-index: 3;
}
table.data thead th:first-child { border-radius: 10px 0 0 0; }
table.data thead th:last-child { border-radius: 0 10px 0 0; }
table.data tbody td {
    padding: 12px 12px;
    border-bottom: 1px solid color-mix(in srgb, var(--glass-line) 55%, transparent);
    vertical-align: middle;
}
table.data tbody tr { transition: background .16s var(--ease); }
table.data tbody tr:hover td { background: var(--glass-bg-weak); }
table.data tbody tr:last-child td { border-bottom: none; }
table.data .num { font-family: var(--font-num); text-align: right; white-space: nowrap; }
table.data .num.strong { font-weight: 650; }
table.data .nowrap { white-space: nowrap; }
table.data .money { font-family: var(--font-num); text-align: right; font-weight: 600; white-space: nowrap; }
table.data .money.pos { color: #e11d48; }
table.data .money.neg { color: #059669; }
.col-check { width: 36px; }

/* 合计行（2026-09-26 吴总：汇总表 / 明细表底部合计，数据更直观）。
   全部走主题玻璃变量 —— 深浅色 / 主题切换自动跟随 */
table.data tbody tr.sum-row td {
    background: var(--glass-bg-weak);
    border-top: 2px solid var(--glass-line);
    border-bottom: none;
    font-weight: 700;
    color: var(--text-1);
    position: sticky;
    bottom: 0;
    z-index: 2;
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}
table.data tbody tr.sum-row td.num { font-family: var(--font-num); }
table.data tbody tr.sum-row td.sum-label { text-align: right; font-size: 12.5px; letter-spacing: 2px; color: var(--text-2); }

/* 汇总表行首排名角标 */
.sm-name-wrap { display: flex; align-items: center; gap: 8px; min-width: 0; }
.sm-name-wrap .rank-no { flex: 0 0 auto; }
.rank-no {
    display: inline-block;
    min-width: 22px;
    text-align: center;
    padding: 1px 0;
    border-radius: 6px;
    font-size: 11px;
    font-family: var(--font-num);
    color: var(--text-3);
    background: var(--glass-bg-weak);
}
tr.clickable { cursor: pointer; }
.cell-main { font-weight: 600; }
.cell-sub { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.ellipsis { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 可点击表格行（客户全景的设备明细等：整行点开对应单据详情） */
table.data tbody tr.row-click { cursor: pointer; }

/* 区块小标题 + 右侧搜索框（客户全景里每个列表自己的精确搜索，2026-09-18） */
.sec-head {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 18px 0 9px;
}
.sec-head .sec-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    flex: 1;
}
.sec-head .search-wrap { margin: 0; }

/* 标签 */
.tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    height: 22px;
    padding: 0 9px;
    border-radius: 7px;
    font-size: 12px;
    font-weight: 600;
    white-space: nowrap;
    background: var(--glass-bg-weak);
    border: 1px solid var(--glass-line);
    color: var(--text-2);
}
.tag-dot { width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.tag-blue   { background: color-mix(in srgb, #3b82f6 15%, transparent); color: #2563eb; border-color: color-mix(in srgb, #3b82f6 28%, transparent); }
.tag-green  { background: color-mix(in srgb, #10b981 15%, transparent); color: #059669; border-color: color-mix(in srgb, #10b981 28%, transparent); }
.tag-amber  { background: color-mix(in srgb, #f59e0b 16%, transparent); color: #b45309; border-color: color-mix(in srgb, #f59e0b 30%, transparent); }
.tag-red    { background: color-mix(in srgb, #ef4444 14%, transparent); color: #dc2626; border-color: color-mix(in srgb, #ef4444 28%, transparent); }
.tag-purple { background: color-mix(in srgb, #a855f7 14%, transparent); color: #9333ea; border-color: color-mix(in srgb, #a855f7 28%, transparent); }
.tag-gray   { background: var(--glass-bg-weak); color: var(--text-3); }
[data-theme="midnight"] .tag-blue, [data-theme="graphite"] .tag-blue,
[data-theme="cyber"] .tag-blue, [data-theme="emerald"] .tag-blue,
[data-theme="retro"] .tag-blue, [data-theme="noir"] .tag-blue { color: #93c5fd; }
[data-theme="midnight"] .tag-green, [data-theme="graphite"] .tag-green,
[data-theme="cyber"] .tag-green, [data-theme="emerald"] .tag-green,
[data-theme="retro"] .tag-green, [data-theme="noir"] .tag-green { color: #6ee7b7; }
[data-theme="midnight"] .tag-amber, [data-theme="graphite"] .tag-amber,
[data-theme="cyber"] .tag-amber, [data-theme="emerald"] .tag-amber,
[data-theme="retro"] .tag-amber, [data-theme="noir"] .tag-amber { color: #fcd34d; }
[data-theme="midnight"] .tag-red, [data-theme="graphite"] .tag-red,
[data-theme="cyber"] .tag-red, [data-theme="emerald"] .tag-red,
[data-theme="retro"] .tag-red, [data-theme="noir"] .tag-red { color: #fca5a5; }
[data-theme="midnight"] .tag-purple, [data-theme="graphite"] .tag-purple,
[data-theme="cyber"] .tag-purple, [data-theme="emerald"] .tag-purple,
[data-theme="retro"] .tag-purple, [data-theme="noir"] .tag-purple { color: #d8b4fe; }

/* ---------- 操作日志「来源 / 设备」（2026-09-24 吴总：来源信息要中文化 + 图标化） ----------
   一行 = 一块浅色图标 + 「字段名 / 值」。配色沿用上面 .tag-* 那一套色板，
   所以深色主题的亮色覆盖也一并抄下来（少抄一个就会出现「深色皮肤下看不见」）。 */
.src-row { display: flex; align-items: center; gap: 10px; padding: 7px 0; }
.src-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; flex: none; border-radius: 9px;
    background: var(--glass-bg-weak);
    border: 1px solid var(--glass-line);
    color: var(--text-2);
}
.src-ico-blue   { background: color-mix(in srgb, #3b82f6 15%, transparent); color: #2563eb; border-color: color-mix(in srgb, #3b82f6 26%, transparent); }
.src-ico-green  { background: color-mix(in srgb, #10b981 15%, transparent); color: #059669; border-color: color-mix(in srgb, #10b981 26%, transparent); }
.src-ico-amber  { background: color-mix(in srgb, #f59e0b 16%, transparent); color: #b45309; border-color: color-mix(in srgb, #f59e0b 28%, transparent); }
.src-ico-purple { background: color-mix(in srgb, #a855f7 14%, transparent); color: #9333ea; border-color: color-mix(in srgb, #a855f7 26%, transparent); }
.src-ico-red    { background: color-mix(in srgb, #ef4444 14%, transparent); color: #dc2626; border-color: color-mix(in srgb, #ef4444 26%, transparent); }
.src-ico-gray   { }
[data-theme="midnight"] .src-ico-blue, [data-theme="graphite"] .src-ico-blue,
[data-theme="cyber"] .src-ico-blue, [data-theme="emerald"] .src-ico-blue,
[data-theme="retro"] .src-ico-blue, [data-theme="noir"] .src-ico-blue { color: #93c5fd; }
[data-theme="midnight"] .src-ico-green, [data-theme="graphite"] .src-ico-green,
[data-theme="cyber"] .src-ico-green, [data-theme="emerald"] .src-ico-green,
[data-theme="retro"] .src-ico-green, [data-theme="noir"] .src-ico-green { color: #6ee7b7; }
[data-theme="midnight"] .src-ico-amber, [data-theme="graphite"] .src-ico-amber,
[data-theme="cyber"] .src-ico-amber, [data-theme="emerald"] .src-ico-amber,
[data-theme="retro"] .src-ico-amber, [data-theme="noir"] .src-ico-amber { color: #fcd34d; }
[data-theme="midnight"] .src-ico-purple, [data-theme="graphite"] .src-ico-purple,
[data-theme="cyber"] .src-ico-purple, [data-theme="emerald"] .src-ico-purple,
[data-theme="retro"] .src-ico-purple, [data-theme="noir"] .src-ico-purple { color: #d8b4fe; }
[data-theme="midnight"] .src-ico-red, [data-theme="graphite"] .src-ico-red,
[data-theme="cyber"] .src-ico-red, [data-theme="emerald"] .src-ico-red,
[data-theme="retro"] .src-ico-red, [data-theme="noir"] .src-ico-red { color: #fca5a5; }
.src-row .k { font-size: 11.5px; color: var(--text-3); line-height: 1.5; }
.src-row .v { font-size: 13.5px; font-weight: 600; line-height: 1.5; word-break: break-all; }
.src-row .v .sub2 { font-weight: 400; font-size: 11.5px; color: var(--text-3); margin-left: 6px; }
/* 原始标识串：默认折起，审计要查原文时展开即可（不占平时的版面） */
.src-raw { margin-top: 8px; }
.src-raw > summary {
    cursor: pointer; font-size: 12px; color: var(--text-3);
    padding: 4px 0; user-select: none; outline: none;
}
.src-raw > summary:hover { color: var(--text-2); }
.src-raw code {
    display: block; margin-top: 6px; padding: 8px 10px;
    font-size: 11.5px; line-height: 1.65; color: var(--text-3);
    word-break: break-all; border-radius: 9px;
    background: var(--glass-bg-weak); border: 1px solid var(--glass-line);
}
/* 日志列表里的「来源」小字（IP 下方那一行） */
.cell-src { display: inline-flex; align-items: center; gap: 4px; font-size: 11.5px; color: var(--text-3); }

/* ============================================================
   门店管理卡片模式（2026-09-26 吴总，参照他给的样式图）
   一店一卡。颜色全走主题变量，深色皮肤自动跟随；
   图标块五色是固定渐变（一家一色，跟截图一致）。
   ============================================================ */
.store-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(330px, 1fr));
    gap: 14px;
    padding: 2px 2px 6px;
}
.store-card {
    border: 1px solid var(--glass-line);
    background: var(--glass-bg-weak);
    border-radius: var(--radius-lg, 14px);
    padding: 14px 16px 12px;
    transition: box-shadow var(--ease, .15s), transform var(--ease, .15s);
}
.store-card:hover { box-shadow: var(--shadow); }
.store-card.st-flash { outline: 2px solid var(--accent); outline-offset: 2px; }
.st-head { display: flex; align-items: center; gap: 10px; }
.st-logo {
    width: 40px; height: 40px; border-radius: 12px; flex: none;
    display: flex; align-items: center; justify-content: center;
    font-size: 17px; font-weight: 620; color: #fff;
    text-shadow: 0 1px 2px rgba(0, 0, 0, .12);
}
.st-logo.c1 { background: linear-gradient(135deg, #7f6bf0, #5b8def); }   /* 紫 */
.st-logo.c2 { background: linear-gradient(135deg, #ef5f6b, #f0803c); }   /* 红 */
.st-logo.c3 { background: linear-gradient(135deg, #22b07d, #4cc3a0); }   /* 绿 */
.st-logo.c4 { background: linear-gradient(135deg, #f0a03c, #e8c34a); }   /* 橙 */
.st-logo.c5 { background: linear-gradient(135deg, #3c9ef0, #4a6cf0); }   /* 蓝 */
.st-title { min-width: 0; }
.st-title .n { font-size: 15px; font-weight: 620; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-title .c { font-size: 11.5px; color: var(--text-3); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-status {
    margin-left: auto; flex: none; font-size: 11.5px; padding: 3px 10px;
    border-radius: 999px; white-space: nowrap;
}
.st-status.on { color: var(--success); background: color-mix(in srgb, var(--success) 14%, transparent); }
.st-status.off { color: var(--text-3); background: color-mix(in srgb, var(--text-3) 12%, transparent); }
.st-del {
    flex: none; border: none; background: none; color: var(--text-3);
    cursor: pointer; padding: 5px; border-radius: 8px; display: inline-flex;
}
.st-del:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
.st-addr { display: flex; align-items: center; gap: 5px; margin-top: 10px; font-size: 12px; color: var(--text-3); }
.st-addr span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.st-kpis { display: grid; grid-template-columns: 1fr 1fr; gap: 8px 14px; margin-top: 12px; }
.st-kpi .k { font-size: 11.5px; color: var(--text-3); }
.st-kpi .v { font-size: 15px; font-weight: 620; color: var(--text-1); margin-top: 2px; font-family: var(--font-num); }
.st-kpi .v.hl { color: var(--accent); }
.st-kpi .v.ok { color: var(--success); }
.st-bar {
    height: 6px; border-radius: 999px; margin-top: 12px; overflow: hidden;
    background: color-mix(in srgb, var(--text-3) 14%, transparent);
}
.st-bar i {
    display: block; height: 100%; border-radius: 999px;
    background: var(--accent-grad, linear-gradient(90deg, var(--accent), var(--danger)));
    transition: width .35s var(--ease, ease);
}
.st-acts { display: flex; gap: 8px; margin-top: 12px; }
.st-acts .btn { flex: 1; justify-content: center; }
.st-empty { padding: 34px 0; text-align: center; color: var(--text-3); font-size: 12.5px; }
.st-staff-row {
    display: flex; align-items: center; gap: 10px;
    padding: 9px 2px; border-bottom: 1px solid var(--glass-line);
}
.st-staff-row:last-child { border-bottom: none; }
.st-staff-row .n { font-size: 13.5px; font-weight: 500; color: var(--text-1); white-space: nowrap; }
.st-staff-row .n .st-sup { color: var(--danger); font-size: 11px; font-weight: 400; }
.st-staff-row .c { flex: 1; min-width: 0; font-size: 12px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }


/* 日志列表「来源」列：IP 的地理归属地（国家 · 省 · 市 · 运营商）。
   只有公网访问才会有这一行（本机/内网 IP 没有城市归属，前端整行不渲染），
   所以默认状态下列表跟改版前一模一样，不会莫名多出一行空的。 */
.cell-geo {
    display: flex; align-items: center; gap: 4px;
    margin-top: 2px; font-size: 11px; line-height: 1.4; color: var(--text-3);
}

/* 分页 */
.pager {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 14px;
    flex-wrap: wrap;
    /* v5.59 分页栏固定：内容超长（.content 也滚动）时吸附在滚动区底部，
       毛玻璃背景与卡片同源，吸底时透出的行被同样模糊，不突兀 */
    position: sticky;
    bottom: 0;
    z-index: 5;
    background-color: var(--glass-bg);
    background-image: linear-gradient(0deg, var(--glass-floor), var(--glass-floor));
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    border-radius: var(--radius-sm);
    padding: 6px 4px;
    margin-left: -4px;
    margin-right: -4px;
}
.pager .info { font-size: 12.5px; color: var(--text-3); margin-right: auto; }
.pager .pages { display: flex; gap: 4px; }
.pager button {
    min-width: 32px; height: 32px;
    padding: 0 9px;
    border-radius: 9px;
    background: var(--glass-bg-weak);
    border: 1px solid var(--glass-line);
    color: var(--text-2);
    font-size: 12.5px;
    font-family: var(--font-num);
    transition: all .18s var(--ease);
}
.pager button:hover:not(:disabled) { background: var(--glass-bg-strong); color: var(--text-1); }
.pager button.active {
    background: var(--accent-grad);
    color: #fff;
    border-color: transparent;
    font-weight: 650;
}
.pager button:disabled { opacity: .4; cursor: not-allowed; }

/* ------------------------------------------------------------
   弹窗 / 抽屉
   ------------------------------------------------------------ */
.mask {
    position: fixed;
    inset: 0;
    z-index: 100;
    background: color-mix(in srgb, var(--text-1) 22%, transparent);
    /* ⚠️ 这里不能再加 backdrop-filter（2026-09-17 实测踩坑）：
       带 backdrop-filter 的元素会成为「backdrop root」，其后代（.modal.glass）的
       backdrop-filter 采样被边界拦截 —— modal 的真折射滤镜（SVG 位移滤镜，已移除）会
       完全失去输入，计算值正确但渲染零变化。聚焦靠 22% 暗色遮罩，
       磨砂由 modal 自己的 backdrop-filter 完成（与 iOS 弹层一致：
       窗外只暗化不糊，窗内才是玻璃）。 */
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    animation: fadeIn .22s var(--ease);
}
@keyframes fadeIn { from { opacity: 0; } to { opacity: 1; } }

.modal {
    width: 100%;
    max-width: 620px;
    max-height: 92vh;
    display: flex;
    flex-direction: column;
    border-radius: var(--radius-lg);
    animation: zoomIn .3s var(--ease);
    overflow: hidden;
}
@keyframes zoomIn {
    from { opacity: 0; transform: scale(.94) translateY(12px); }
    to   { opacity: 1; transform: none; }
}
.modal.wide { max-width: 1040px; } /* 2026-09-21 吴总：920→984，明细单价/金额列按十万级加宽（items.js 单价 120/金额 118），可用预算 886→952；
                                     2026-09-23：984→1040，「下次跟进」日期列 96→144 后编辑态明细表 990px
                                     （856 固定列 + 设备 134），984 的 942 预算放不下、设备列会被压到 86px ——
                                     弹层跟着加宽，预算 942→998，设备列保住 134，明细表不再溢出 */
.modal.narrow { max-width: 440px; }
/* 2026-09-23 吴总：员工KPI绩效的下钻明细有 10 列（日期/来源/单号/客户/设备/数量/
   行金额/行成本/参与人/人均毛利），984px 挤不下会横向滚动 —— 单开一档更宽的，
   只给这类「列多的只读明细弹层」用。窄屏仍受 vw 限制，不会溢出屏幕。 */
.modal.xwide { max-width: 1360px; }

.modal-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--glass-line);
    flex: 0 0 auto;
}
.modal-head h3 { font-size: 15.5px; font-weight: 650; letter-spacing: -.2px; }
.modal-head .sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.modal-head .close {
    margin-left: auto;
    width: 32px; height: 32px;
    border-radius: 10px;
    display: grid;
    place-items: center;
    color: var(--text-2);
    transition: all .18s var(--ease);
}
.modal-head .close:hover { background: var(--glass-bg-strong); color: var(--text-1); }
.modal-body { padding: 18px 20px; overflow-y: auto; flex: 1; }
.modal-foot {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 14px 20px 18px;
    border-top: 1px solid var(--glass-line);
    flex: 0 0 auto;
}
.modal-foot .spacer { flex: 1; }

/* 抽屉 */
.drawer-mask {
    position: fixed;
    inset: 0;
    z-index: 110;
    background: color-mix(in srgb, var(--text-1) 18%, transparent);
    backdrop-filter: blur(4px);
    animation: fadeIn .2s var(--ease);
}
.drawer {
    position: fixed;
    top: 14px; right: 14px; bottom: 14px;
    width: 380px;
    max-width: calc(100vw - 28px);
    z-index: 111;
    border-radius: var(--radius-lg);
    display: flex;
    flex-direction: column;
    animation: slideIn .32s var(--ease);
    overflow: hidden;
}
@keyframes slideIn {
    from { transform: translateX(30px); opacity: 0; }
    to   { transform: none; opacity: 1; }
}
.drawer-head {
    display: flex;
    align-items: center;
    padding: 18px 20px 14px;
    border-bottom: 1px solid var(--glass-line);
}
.drawer-head h3 { font-size: 15.5px; font-weight: 650; }
.drawer-head .close { margin-left: auto; width: 32px; height: 32px; border-radius: 10px; display: grid; place-items: center; color: var(--text-2); }
.drawer-head .close:hover { background: var(--glass-bg-strong); }
.drawer-body { padding: 18px 20px; overflow-y: auto; flex: 1; }

/* 设置分组 */
.set-group { margin-bottom: 22px; }
.set-group > h4 {
    font-size: 12.5px;
    font-weight: 650;
    color: var(--text-2);
    margin-bottom: 11px;
    display: flex;
    align-items: center;
    gap: 6px;
}
.set-group > h4 svg { width: 14px; height: 14px; }

/* 主题选择器 */
.theme-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 9px;
}
.theme-swatch {
    border-radius: 13px;
    height: 54px;
    cursor: pointer;
    position: relative;
    overflow: hidden;
    border: 2px solid transparent;
    transition: all .2s var(--ease);
}
.theme-swatch:hover { transform: translateY(-2px) scale(1.03); }
.theme-swatch.active {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.theme-swatch .dot {
    position: absolute;
    right: 7px; bottom: 7px;
    width: 15px; height: 15px;
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, .85);
}
.theme-swatch .nm {
    position: absolute;
    left: 8px; bottom: 6px;
    font-size: 12px;
    font-weight: 600;
    color: #fff;
    text-shadow: 0 1px 4px rgba(0, 0, 0, .55);
}
.theme-swatch .check {
    position: absolute;
    left: 7px; top: 7px;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: #fff;
    color: var(--accent);
    display: none;
    place-items: center;
}
.theme-swatch.active .check { display: grid; }

/* 壁纸选择器 */
.wall-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 9px; }
.wall-item {
    height: 62px;
    border-radius: 12px;
    cursor: pointer;
    border: 2px solid transparent;
    background-size: cover;
    background-position: center;
    transition: all .2s var(--ease);
    position: relative;
    overflow: hidden;
    /* 常驻细描边（2026-09-26）：纯色/网格这类近白壁纸在深色抽屉里是「一块白」，
       浅色主题下白壁纸又融进白卡片——一圈中性灰细线保证任何主题下都看得出边界 */
    box-shadow: inset 0 0 0 1px rgba(100, 116, 139, .38);
}
.wall-item:hover { transform: translateY(-2px); }
.wall-item.active { border-color: var(--accent); box-shadow: 0 0 0 3px var(--accent-soft), inset 0 0 0 1px rgba(100, 116, 139, .38); }
.wall-item.upload {
    display: grid;
    place-items: center;
    background: var(--glass-bg-weak);
    border: 1.5px dashed var(--glass-line);
    color: var(--text-3);
    font-size: 12px;
    gap: 3px;
}
.wall-item.upload svg { width: 16px; height: 16px; }

/* 自定义壁纸：删除按钮 */
.wall-item .wall-del {
    position: absolute; top: 4px; right: 4px;
    width: 18px; height: 18px; padding: 0;
    border: none; border-radius: 50%;
    background: rgba(220, 38, 38, .92);
    color: #fff; cursor: pointer;
    display: grid; place-items: center;
    opacity: 0; z-index: 2;
    transition: opacity .18s var(--ease), transform .18s var(--ease);
}
.wall-item .wall-del svg { width: 10px; height: 10px; }
.wall-item:hover .wall-del { opacity: 1; }
.wall-item .wall-del:hover { transform: scale(1.14); }
@media (hover: none) { .wall-item .wall-del { opacity: 1; } }

.wall-empty {
    grid-column: 1 / -1;
    padding: 18px 10px;
    text-align: center;
    font-size: 12px;
    color: var(--text-3);
    border: 1.5px dashed var(--glass-line);
    border-radius: 12px;
}

/* ---------------- 头像编辑 ---------------- */
.avatar.has-img { background: none; }
.avatar.avatar-xl {
    width: 68px; height: 68px; flex: 0 0 68px;
    font-size: 26px;
    border: 2px solid var(--glass-line);
    box-shadow: 0 6px 18px rgba(15, 23, 42, .16);
}
.avatar-edit { display: flex; align-items: center; gap: 14px; }
.avatar-edit-info { min-width: 0; flex: 1; }
.avatar-edit-info > b { display: block; font-size: 14px; font-weight: 650; }
.avatar-edit-info > span { display: block; margin-top: 2px; font-size: 12px; color: var(--text-3); }
.avatar-edit-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 9px; }

.field-tip { margin: 9px 0 0; font-size: 12px; line-height: 1.65; color: var(--text-3); }
.h4-extra { margin-left: auto; font-size: 12px; font-weight: 500; color: var(--text-3); }

/* 上传预览弹窗 */
.img-preview {
    display: grid; place-items: center;
    max-height: 268px;
    border: 1px solid var(--glass-line);
    border-radius: var(--radius);
    background: var(--glass-bg-weak);
    overflow: hidden;
}
.img-preview img { display: block; max-width: 100%; max-height: 268px; object-fit: contain; }
.img-preview.round {
    width: 176px; height: 176px;
    margin: 4px auto 0;
    border-radius: 50%;
}
.img-preview.round img { width: 100%; height: 100%; max-height: none; object-fit: cover; }
.img-hint { margin: 12px 0 0; font-size: 12px; line-height: 1.7; color: var(--text-3); text-align: center; }

/* 滑块 */
.slider-row { display: flex; align-items: center; gap: 11px; margin-bottom: 13px; }
.slider-row label { font-size: 12.5px; color: var(--text-2); width: 74px; flex: 0 0 74px; }
.slider-row input[type=range] {
    flex: 1;
    -webkit-appearance: none;
    height: 5px;
    border-radius: 5px;
    background: var(--glass-bg-strong);
    cursor: pointer;
}
.slider-row input[type=range]::-webkit-slider-thumb {
    -webkit-appearance: none;
    width: 16px; height: 16px;
    border-radius: 50%;
    background: var(--accent-grad);
    box-shadow: 0 2px 8px color-mix(in srgb, var(--accent) 45%, transparent);
    cursor: pointer;
}
.slider-row .val {
    font-size: 12px;
    font-family: var(--font-num);
    color: var(--text-3);
    width: 42px;
    text-align: right;
}

/* 开关 */
.switch { position: relative; display: inline-block; width: 42px; height: 24px; flex: 0 0 42px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .track {
    position: absolute;
    inset: 0;
    border-radius: 24px;
    /* 2026-09-26 吴总反馈「按钮开关有透明」：轨道从半透明玻璃底改为实色，
       浅色主题用 --switch-off（默认灰蓝），深色主题在 themes.css 深色组覆盖 */
    background: var(--switch-off, #c6cedd);
    border: 1px solid var(--switch-off-line, #aab4c8);
    transition: all .25s var(--ease);
    cursor: pointer;
}
.switch .track::after {
    content: "";
    position: absolute;
    width: 18px; height: 18px;
    left: 2px; top: 2px;
    border-radius: 50%;
    background: #fff;
    box-shadow: 0 2px 6px rgba(0, 0, 0, .22);
    transition: transform .25s var(--ease);
}
.switch input:checked + .track { background: var(--accent-grad); border-color: transparent; }
.switch input:checked + .track::after { transform: translateX(18px); }

/* ------------------------------------------------------------
   界面音效（音色风格 + 试听）
   ------------------------------------------------------------ */
.sfx-label {
    margin: 14px 0 8px;
    font-size: 12px;
    font-weight: 600;
    color: var(--text-2);
}
.sfx-styles { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
.sfx-style {
    height: 36px;
    border-radius: 11px;
    border: 1px solid var(--glass-line);
    background: var(--glass-bg-weak);
    color: var(--text-2);
    font-size: 13px;
    font-weight: 550;
    font-family: inherit;
    cursor: pointer;
    transition: all .18s var(--ease);
}
.sfx-style:hover {
    color: var(--text-1);
    border-color: var(--accent);
    transform: translateY(-1px);
}
.sfx-style.active {
    color: #fff;
    border-color: transparent;
    background: var(--accent-grad);
    box-shadow: 0 4px 12px var(--accent-soft);
}
.sfx-grid { display: flex; flex-wrap: wrap; gap: 8px; }
.sfx-grid .btn { display: inline-flex; align-items: center; gap: 5px; }

/* ------------------------------------------------------------
   图表容器
   ------------------------------------------------------------ */
.chart-box { width: 100%; position: relative; }
.chart-box svg { display: block; width: 100%; overflow: visible; }
.chart-legend {
    display: flex;
    flex-wrap: wrap;
    gap: 14px;
    margin-top: 12px;
    font-size: 12px;
    color: var(--text-2);
}
.chart-legend i {
    width: 9px; height: 9px;
    border-radius: 3px;
    display: inline-block;
    margin-right: 5px;
}

/* 排行榜 */
.rank-list { display: flex; flex-direction: column; gap: 9px; }
.rank-item {
    display: flex;
    align-items: center;
    gap: 11px;
    padding: 9px 11px;
    border-radius: var(--radius-sm);
    background: var(--glass-bg-weak);
    transition: all .2s var(--ease);
}
.rank-item:hover { background: var(--glass-bg-strong); }
/* 2026-09-21 吴总：排行项可点击下钻（门店/设备/业务员明细弹层） */
.rank-item.clickable { cursor: pointer; }
.rank-item.clickable:hover { box-shadow: var(--shadow-sm, 0 1px 4px rgba(15,23,42,.08)); }
.rank-no {
    width: 24px; height: 24px;
    flex: 0 0 24px;
    border-radius: 8px;
    display: grid;
    place-items: center;
    font-size: 12px;
    font-weight: 700;
    font-family: var(--font-num);
    background: var(--glass-bg-strong);
    color: var(--text-2);
}
.rank-item:nth-child(1) .rank-no { background: linear-gradient(135deg, #fbbf24, #f59e0b); color: #fff; }
.rank-item:nth-child(2) .rank-no { background: linear-gradient(135deg, #cbd5e1, #94a3b8); color: #fff; }
.rank-item:nth-child(3) .rank-no { background: linear-gradient(135deg, #fdba74, #ea580c); color: #fff; }
.rank-main { flex: 1; min-width: 0; }
.rank-main .t { font-size: 13px; font-weight: 550; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rank-bar {
    height: 4px;
    border-radius: 4px;
    background: var(--glass-bg-strong);
    margin-top: 6px;
    overflow: hidden;
}
.rank-bar i { display: block; height: 100%; border-radius: 4px; background: var(--accent-grad); }
.rank-val { font-family: var(--font-num); font-size: 13px; font-weight: 650; white-space: nowrap; }

/* ------------------------------------------------------------
   提示 / 空态 / 加载
   ------------------------------------------------------------ */
.toast-wrap {
    position: fixed;
    top: 22px;
    left: 50%;
    transform: translateX(-50%);
    z-index: 260;   /* 高于下拉浮层(240)，提示永远在最上层 */
    display: flex;
    flex-direction: column;
    gap: 9px;
    align-items: center;
    pointer-events: none;
}
.toast {
    display: flex;
    align-items: center;
    gap: 9px;
    padding: 11px 17px;
    border-radius: 14px;
    font-size: 13px;
    font-weight: 500;
    box-shadow: var(--shadow);
    animation: toastIn .3s var(--ease);
    pointer-events: auto;
    max-width: 460px;
    border-radius: 14px;
    background: var(--glass-bg-strong);
    backdrop-filter: blur(24px) saturate(180%);
    -webkit-backdrop-filter: blur(24px) saturate(180%);
    border: 1px solid var(--glass-line);
}
@keyframes toastIn {
    from { opacity: 0; transform: translateY(-14px) scale(.94); }
    to   { opacity: 1; transform: none; }
}
.toast.out { animation: toastOut .26s var(--ease) forwards; }
@keyframes toastOut {
    to { opacity: 0; transform: translateY(-10px) scale(.95); }
}
.toast svg { width: 16px; height: 16px; flex: 0 0 16px; }
.toast.success svg { color: var(--success); }
.toast.error svg { color: var(--danger); }
.toast.info svg { color: var(--info); }

.empty {
    text-align: center;
    padding: 52px 20px;
    color: var(--text-3);
}
.empty svg { width: 54px; height: 54px; opacity: .28; margin-bottom: 12px; }
.empty p { font-size: 13.5px; }
.empty small { font-size: 12px; opacity: .8; display: block; margin-top: 5px; }

.loading {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 10px;
    padding: 52px;
    color: var(--text-3);
    font-size: 13px;
}
.spinner {
    width: 19px; height: 19px;
    border: 2.5px solid var(--glass-line);
    border-top-color: var(--accent);
    border-radius: 50%;
    animation: spin .7s linear infinite;
}

.skeleton {
    background: linear-gradient(90deg, var(--glass-bg-weak) 25%, var(--glass-bg-strong) 50%, var(--glass-bg-weak) 75%);
    background-size: 200% 100%;
    animation: shimmer 1.4s infinite;
    border-radius: 8px;
}
@keyframes shimmer { to { background-position: -200% 0; } }

/* 详情描述列表 */
.desc-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    background: var(--glass-line);
    border-radius: var(--radius-sm);
    overflow: hidden;
}
.desc-item { background: var(--glass-bg-weak); padding: 11px 14px; }
.desc-item .k { font-size: 12px; color: var(--text-3); margin-bottom: 4px; }
.desc-item .v { font-size: 13px; font-weight: 550; word-break: break-all; }
.desc-item.full { grid-column: 1 / -1; }

/* 时间线 */
.timeline { position: relative; padding-left: 22px; }
.timeline::before {
    content: "";
    position: absolute;
    left: 6px; top: 6px; bottom: 6px;
    width: 1.5px;
    background: var(--glass-line);
}
.tl-item { position: relative; padding-bottom: 17px; }
.tl-item::before {
    content: "";
    position: absolute;
    left: -19px; top: 4px;
    width: 9px; height: 9px;
    border-radius: 50%;
    background: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft);
}
.tl-item .t { font-size: 12.5px; font-weight: 600; }
.tl-item .d { font-size: 12px; color: var(--text-3); margin-top: 2px; }
.tl-item .c { font-size: 12.5px; color: var(--text-2); margin-top: 6px; line-height: 1.6; background: var(--glass-bg-weak); padding: 9px 11px; border-radius: 9px; }

/* 权限矩阵 */
.perm-table { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; }
.perm-table th {
    text-align: left;
    font-size: 12px;
    color: var(--text-3);
    padding: 9px 11px;
    border-bottom: 1px solid var(--glass-line);
    font-weight: 600;
}
.perm-table td { padding: 9px 11px; border-bottom: 1px solid color-mix(in srgb, var(--glass-line) 50%, transparent); }
.perm-table tr:hover td { background: var(--glass-bg-weak); }
.perm-table .mod { font-weight: 600; }
.perm-ops { display: flex; flex-wrap: wrap; gap: 10px; }

/* ------------------------------------------------------------
   登录页
   ------------------------------------------------------------ */
.login-wrap {
    position: relative;
    z-index: 1;
    height: 100vh;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 22px;
}
.login-card {
    width: 100%;
    max-width: 400px;
    border-radius: 26px;
    padding: 34px 30px 28px;
    animation: zoomIn .5s var(--ease);
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-brand .logo {
    width: 58px; height: 58px;
    margin: 0 auto 14px;
    border-radius: 18px;
    background: var(--accent-grad);
    display: grid;
    place-items: center;
    color: #fff;
    font-size: 25px;
    font-weight: 700;
    box-shadow: 0 12px 30px color-mix(in srgb, var(--accent) 42%, transparent);
}
.login-brand h1 { font-size: 20px; font-weight: 700; letter-spacing: -.4px; }
.login-brand p { font-size: 12.5px; color: var(--text-3); margin-top: 5px; }
.login-form { display: flex; flex-direction: column; gap: 14px; }
.login-form .input { height: 44px; border-radius: 13px; }
.login-btn {
    height: 45px;
    border-radius: 13px;
    font-size: 14.5px;
    font-weight: 620;
    margin-top: 4px;
    background: var(--accent-grad);
    color: #fff;
    border: none;
    box-shadow: 0 10px 26px color-mix(in srgb, var(--accent) 40%, transparent);
    transition: all .22s var(--ease);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 7px;
}
.login-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 32px color-mix(in srgb, var(--accent) 48%, transparent); }
.login-btn:active { transform: translateY(0); }
.login-btn:disabled { opacity: .7; transform: none; }

.login-hint {
    margin-top: 20px;
    padding: 13px 15px;
    border-radius: 13px;
    background: var(--glass-bg-weak);
    border: 1px solid var(--glass-line);
    font-size: 12px;
    color: var(--text-2);
    line-height: 1.75;
}
.login-hint b { color: var(--accent); font-weight: 650; }
.login-hint .row { display: flex; justify-content: space-between; gap: 10px; }
.login-hint code {
    font-family: var(--font-num);
    background: var(--accent-soft);
    padding: 1px 6px;
    border-radius: 5px;
    font-size: 12px;
    color: var(--accent);
}

.login-err {
    display: none;
    align-items: center;
    gap: 7px;
    padding: 10px 13px;
    border-radius: 11px;
    background: color-mix(in srgb, var(--danger) 13%, transparent);
    border: 1px solid color-mix(in srgb, var(--danger) 28%, transparent);
    color: #dc2626;
    font-size: 12.5px;
}
.login-err.show { display: flex; animation: shake .4s var(--ease); }
@keyframes shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}

/* 主题浮标（登录页可切主题） */
.theme-fab {
    position: fixed;
    top: 20px; right: 20px;
    z-index: 10;
    display: flex;
    gap: 8px;
    flex-wrap: wrap;
    max-width: 220px;
    justify-content: flex-end;
}
.theme-fab .mini-sw {
    width: 26px; height: 26px;
    border-radius: 9px;
    cursor: pointer;
    border: 2px solid rgba(255, 255, 255, .6);
    box-shadow: 0 3px 10px rgba(0, 0, 0, .16);
    transition: transform .2s var(--ease);
}
.theme-fab .mini-sw:hover { transform: scale(1.16); }
.theme-fab .mini-sw.active { border-color: #fff; box-shadow: 0 0 0 3px color-mix(in srgb, var(--accent) 45%, transparent); }

/* ------------------------------------------------------------
   响应式
   ------------------------------------------------------------ */
.burger { display: none; }

@media (max-width: 1280px) {
    .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 1024px) {
    .sidebar {
        position: fixed;
        left: 14px; top: 14px; bottom: 14px;
        z-index: 120;
        margin-left: calc(-1 * (var(--nav-w) + 30px));
        box-shadow: 0 20px 60px rgba(0, 0, 0, .28);
    }
    .sidebar.open { margin-left: 0; }
    .burger { display: grid; }
    .nav-mask {
        position: fixed;
        inset: 0;
        z-index: 119;
        background: color-mix(in srgb, var(--text-1) 16%, transparent);
        backdrop-filter: blur(3px);
    }
    .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
    .grid-2, .grid-3, .grid-4 { grid-template-columns: minmax(0, 1fr); }
    .form-grid, .form-grid.cols-3 { grid-template-columns: minmax(0, 1fr); }
    .desc-grid { grid-template-columns: minmax(0, 1fr); }
    .app { padding: 10px; gap: 10px; }
    .drawer { width: calc(100vw - 20px); right: 10px; top: 10px; bottom: 10px; }
    .page-title p { display: none; }
    .hide-sm { display: none !important; }
}

@media (max-width: 640px) {
    .topbar { padding: 0 10px; gap: 8px; }
    .user-chip b, .user-chip small { display: none; }
    .user-chip { padding: 0 8px 0 5px; }
    .card { padding: 14px; }
    .kpi-value { font-size: 21px; }
    .modal { max-height: 94vh; }
    .theme-grid { grid-template-columns: repeat(3, 1fr); }
    .pager .pages button:not(.active):not(:first-child):not(:last-child) { display: none; }
}

@media print {
    .sidebar, .topbar, .bg-layer { display: none; }
}

/* ============================================================
   通知中心（2026-09-17）：顶栏铃铛角标 + 抽屉列表 + 发布表单
   独立命名空间（nc-*），不与现有样式互相干扰
   ============================================================ */
.notice-btn { position: relative; }
.notice-badge {
    position: absolute; top: 2px; right: 2px;
    min-width: 16px; height: 16px; padding: 0 4px;
    border-radius: 8px; background: #e11d48; color: #fff;
    font-size: 10px; font-weight: 700; line-height: 16px;
    text-align: center; pointer-events: none;
}
.nc-bar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
/* 超管监听开关（2026-09-19 吴总需求）：复用全局 .switch 组件缩小一号，
   只覆盖尺寸不改全局（球 14px，checked 位移 = 宽 32 - 球 14 - 左右 2×2 = 14px） */
.nc-sup { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text-2); white-space: nowrap; cursor: default; }
.nc-sup .nc-sup-sw { width: 32px; height: 18px; flex: 0 0 32px; }
.nc-sup .nc-sup-sw .track { border-radius: 18px; }
.nc-sup .nc-sup-sw .track::after { width: 14px; height: 14px; left: 2px; top: 1px; }
.nc-sup .nc-sup-sw input:checked + .track::after { transform: translateX(14px); }
.nc-tabs { display: flex; gap: 6px; margin-bottom: 12px; }
.nc-tabs button {
    padding: 5px 14px; border-radius: 14px; font-size: 12.5px;
    color: var(--text-2); background: var(--glass-bg-weak);
    transition: all .16s var(--ease); cursor: pointer;
}
.nc-tabs button.active { color: #fff; background: var(--accent); }
.nc-item {
    display: flex; gap: 10px; align-items: flex-start;
    padding: 11px 10px; border-radius: 10px; margin-bottom: 6px;
    background: var(--glass-bg-weak); cursor: default;
}
.nc-item.unread { background: var(--glass-bg); box-shadow: inset 0 0 0 1px var(--accent, #6366f1); }
.nc-ico {
    flex: 0 0 30px; width: 30px; height: 30px; border-radius: 9px;
    display: flex; align-items: center; justify-content: center;
    background: var(--glass-bg-weak); border: 1px solid transparent;
}
.nc-main { flex: 1; min-width: 0; }
.nc-t { font-size: 13px; font-weight: 600; line-height: 1.45; word-break: break-all; }
.nc-hot { color: #e11d48; font-size: 10.5px; border: 1px solid #e11d4855; border-radius: 4px; padding: 0 4px; margin-left: 4px; }
.nc-dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: #6366f1; margin-left: 6px; vertical-align: 1px; }
/* pre-wrap：发布时写的换行、空行、缩进原样呈现（2026-09-17 吴总反馈「通知不能排版」） */
.nc-c { font-size: 12px; color: var(--text-2); line-height: 1.55; margin-top: 3px; word-break: break-all; white-space: pre-wrap; }
.nc-m { font-size: 11px; color: var(--text-3); margin-top: 5px; }
.nc-kind { font-weight: 600; }
.nc-ops { flex: 0 0 auto; display: flex; gap: 4px; }
.nc-more { text-align: center; padding: 8px 0 2px; }
.nc-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; min-height: 10px; }
.nc-chip {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 3px 8px; border-radius: 12px; font-size: 12px;
    background: var(--glass-bg-weak); border: 1px solid var(--accent, #6366f1); color: var(--text-1);
}
.nc-chip i { cursor: pointer; font-style: normal; color: var(--text-3); font-weight: 700; }
.nc-chip i:hover { color: #e11d48; }
/* 抽屉提示条（单击已读 / 双击详情） */
.nc-hint { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-3); margin: -4px 0 8px; }
/* 通知详情弹层（双击行打开）：标题 + 按发布排版展示的全文 */
.nc-d-title {
    display: flex; align-items: center; gap: 7px;
    font-size: 15px; font-weight: 700; line-height: 1.5; margin-bottom: 10px;
}
.nc-d-title .nc-hot { margin-left: 2px; }
.nc-d-body {
    font-size: 13px; color: var(--text-1); line-height: 1.75;
    white-space: pre-wrap; word-break: break-all;
    padding: 12px 14px; border-radius: 10px;
    background: var(--glass-bg-weak); max-height: 46vh; overflow: auto;
}
/* 归纳标签数量（v1.4）：tab 文字后的小数字，未删除/未过期总数；激活 tab 内反白 */
.nc-cnt {
    font-style: normal; font-size: 11px; line-height: 1;
    margin-left: 5px; padding: 2px 5px; border-radius: 8px;
    background: var(--glass-bg-strong); color: var(--text-2);
}
.nc-tabs button.active .nc-cnt { background: rgba(255, 255, 255, .22); color: #fff; }
/* 提醒详情的单据备注块（v1.4）：正文下方弱底色块，pre-wrap 保留录入时排版 */
.nc-d-remark {
    margin-top: 10px; padding: 10px 12px; border-radius: 10px;
    background: var(--glass-bg-weak); border: 1px dashed var(--glass-line);
    font-size: 12.5px; color: var(--text-2); line-height: 1.7;
    white-space: pre-wrap; word-break: break-all;
}
.nc-d-remark .k {
    display: inline-block; margin-right: 8px; padding: 1px 7px; border-radius: 6px;
    background: var(--accent-soft, rgba(99, 102, 241, .14)); color: var(--accent);
    font-size: 11px; font-weight: 600;
}

/* ============================================================
   通知批量操作（v1.6，2026-09-20 吴总：可选/批量/一键清除）
   ============================================================ */
/* 工具条：全选 + 清空本栏，常驻在提示条与列表之间，弱视觉不抢戏 */
.nc-toolbar {
    display: flex; align-items: center; gap: 10px;
    margin: 0 0 8px; padding: 6px 10px; border-radius: 10px;
    background: var(--glass-bg-weak); border: 1px solid transparent;
    transition: border-color .16s var(--ease);
}
.nc-toolbar:has(input:checked), .nc-toolbar:has(input:indeterminate) { border-color: var(--glass-line); }
/* 自定义复选框：accent 主题色 + 白色对勾，行首与工具条共用 */
.nc-chk {
    display: inline-flex; align-items: center; gap: 6px;
    cursor: pointer; user-select: none; color: var(--text-3);
    font-size: 12px; flex: 0 0 auto; padding: 2px;
}
.nc-chk input { position: absolute; opacity: 0; width: 1px; height: 1px; pointer-events: none; }
.nc-chk i {
    width: 15px; height: 15px; flex: none; border-radius: 5px;
    border: 1.5px solid var(--text-3); background: transparent;
    display: inline-block; position: relative; transition: all .15s var(--ease);
}
.nc-chk:hover i { border-color: var(--accent); }
.nc-chk input:checked + i, .nc-chk input:indeterminate + i {
    background: var(--accent); border-color: var(--accent);
}
.nc-chk input:checked + i::after {
    content: ''; position: absolute; left: 4px; top: 1px; width: 4px; height: 8px;
    border: solid #fff; border-width: 0 2px 2px 0; transform: rotate(45deg);
}
.nc-chk input:indeterminate + i::after {
    content: ''; position: absolute; left: 2.5px; top: 6px; width: 8px; height: 2px;
    border-radius: 1px; background: #fff;
}
.nc-chk input:focus-visible + i { box-shadow: 0 0 0 3px var(--accent-soft, rgba(99, 102, 241, .25)); }
/* 行选中态：微底色 + accent 内描边（与未读描边区分：未读是全强度描边） */
.nc-item.sel { background: var(--accent-soft, rgba(99, 102, 241, .1)); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--accent) 45%, transparent); }
/* 清空本栏：幽灵小按钮，hover 才变危险色（日常不干扰视线） */
.nc-tool-btn {
    display: inline-flex; align-items: center; gap: 5px;
    padding: 4px 10px; border-radius: 8px; font-size: 12px; cursor: pointer;
    color: var(--text-3); background: transparent; border: none;
    transition: all .15s var(--ease);
}
.nc-tool-btn:hover { color: var(--danger); background: color-mix(in srgb, var(--danger) 10%, transparent); }
/* 底部批量浮条：毛玻璃胶囊，选中后从底部滑入（sticky 悬浮在滚动区底） */
.nc-batch {
    position: sticky; bottom: 0; z-index: 5;
    display: flex; align-items: center; gap: 8px;
    margin: 10px 2px 0; padding: 9px 12px; border-radius: 14px;
    background: color-mix(in srgb, var(--glass-bg-strong, rgba(255, 255, 255, .75)) 92%, transparent);
    -webkit-backdrop-filter: blur(18px) saturate(1.4); backdrop-filter: blur(18px) saturate(1.4);
    border: 1px solid var(--glass-line);
    box-shadow: 0 10px 28px rgba(15, 23, 42, .18);
    transform: translateY(calc(100% + 18px)); opacity: 0; pointer-events: none;
    transition: transform .24s var(--ease), opacity .2s var(--ease);
}
.nc-batch.show { transform: none; opacity: 1; pointer-events: auto; }
.nc-batch-cnt { font-size: 12.5px; color: var(--text-2); white-space: nowrap; }
.nc-batch-cnt b { color: var(--accent); font-size: 14px; margin: 0 1px; }
.nc-batch .spacer { flex: 1; }

/* 液态玻璃「真折射透镜」已整体移除（2026-09-17 吴总反馈）：
   弹窗/抽屉打开时滤镜首帧计算导致闪烁、观感不协调且吃 GPU。
   原折射 class 的 backdrop-filter 规则与 app.php 里的 SVG 位移滤镜、
   app.js 的内核检测一并删除，弹层统一回落 blur+saturate 磨砂方案。 */

/* ============================================================
   客户搜索联想选择器（v5.20 / 2026-09-20 吴总需求）
   —— 开单表单里的客户字段：输入公司名 / 电话 / 联系人即时联想。
   复用 .gbsel 触发器的视觉语言（玻璃下拉），但结构独立，
   不会被 UI.enhanceSelects 的 MutationObserver 反复增强。
   ============================================================ */

/* 触发器：文字过长省略，占满父容器 */
.cp { display: block; width: 100%; }
.cp .cp-trigger { width: 100%; }
.cp .cp-text {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
    text-align: left;
}
.cp .cp-text.is-ph { color: var(--text-3); }

/* 浮层：挂 body、fixed 定位（不被弹窗容器裁剪），玻璃磨砂。
   z-index 必须落在弹窗（ui.js acquireZ 的 100~190 区间）与自定义下拉菜单（240）之间：
   取 200 —— 保证浮层盖在自己的弹窗之上，又不会被后续弹窗盖住；
   点「+ 新增客户」时组件会先关浮层，新弹窗自然在最上层。 */
.cp-panel {
    position: fixed; z-index: 200; display: none;
    border-radius: 14px; overflow: hidden;
    background: color-mix(in srgb, var(--glass-bg-strong, rgba(255, 255, 255, .82)) 96%, transparent);
    -webkit-backdrop-filter: blur(20px) saturate(1.5); backdrop-filter: blur(20px) saturate(1.5);
    border: 1px solid var(--glass-line);
    box-shadow: 0 16px 40px rgba(15, 23, 42, .22);
    animation: cpIn .16s var(--ease);
}
/* 打开态：必须显式 block —— 只写内联 display:'' 会回落到上面的 none */
.cp-panel.show { display: block; }
@keyframes cpIn { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
.cp-panel.up { animation: cpInUp .16s var(--ease); }
@keyframes cpInUp { from { opacity: 0; transform: translateY(4px); } to { opacity: 1; transform: none; } }

/* 搜索框 */
.cp-search { padding: 9px 10px; border-bottom: 1px solid var(--glass-line); }
.cp-search .cp-kw { width: 100%; height: 34px; font-size: 13px; }

/* 候选列表：限高可滚，滚动条用既有约定 */
.cp-list { max-height: 268px; overflow-y: auto; padding: 5px; }
.cp-item {
    display: flex; align-items: center; gap: 10px;
    padding: 8px 10px; border-radius: 10px; cursor: pointer;
    transition: background .12s var(--ease);
}
.cp-item:hover, .cp-item.active { background: var(--accent-soft, rgba(99, 102, 241, .12)); }
.cp-main { flex: 1; min-width: 0; }
.cp-name { font-size: 13px; color: var(--text-1); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.cp-sub { font-size: 11.5px; color: var(--text-3); margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 欠款角标：欠钱才显示，用危险色提示（销售看一眼就知道这家还欠多少） */
.cp-ar { font-size: 11.5px; color: var(--danger); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* 空结果提示 */
.cp-empty { padding: 18px 12px; text-align: center; font-size: 12.5px; color: var(--text-3); }

/* 关键字联想（GB_KWSUGGEST，2026-09-23 吴总）：候选行的类型标签与匹配笔数 */
.ks-tag {
    flex: none; font-size: 11px; line-height: 1; padding: 4px 7px; border-radius: 6px;
    background: var(--accent-soft, rgba(99, 102, 241, .12)); color: var(--accent);
    white-space: nowrap;
}
.ks-tag.bill { background: rgba(16, 185, 129, .13); color: #059669; }
.ks-n { flex: none; font-size: 11.5px; color: var(--text-3); white-space: nowrap; font-variant-numeric: tabular-nums; }

/* 底部「+ 新增客户」快捷入口 */
.cp-foot { padding: 8px; border-top: 1px solid var(--glass-line); }
.cp-addbtn {
    display: flex; align-items: center; justify-content: center; gap: 6px;
    width: 100%; padding: 9px; border-radius: 10px; cursor: pointer;
    font-size: 13px; font-weight: 500;
    color: var(--accent); background: var(--accent-soft, rgba(99, 102, 241, .1));
    border: 1px dashed color-mix(in srgb, var(--accent) 45%, transparent);
    transition: all .15s var(--ease);
}
.cp-addbtn:hover { background: color-mix(in srgb, var(--accent) 18%, transparent); border-style: solid; }

/* 移动端：浮层贴边全宽 */
@media (max-width: 640px) {
    .cp-panel { left: 8px !important; right: 8px; width: auto !important; }
    .cp-list { max-height: 46vh; }
}

/* ============================================================
   明细行「参与业务员」多选（2026-09-20 吴总）
   锚点常驻在明细表格单元格里；浮层挂 document.body（position:fixed），
   不受 .modal-body 的 overflow 裁剪，切换行只换内容、不重建节点。
   ============================================================ */
.line-salepick:hover { border-color: var(--accent); }
.line-salepick:focus { outline: none; border-color: var(--accent); box-shadow: 0 0 0 2px var(--accent-soft, rgba(99,102,241,.15)); }

/* 浮层本体：玻璃材质与弹窗完全同口径（2026-09-20 吴总反馈「选择器 UI 没跟主题变化、看不清字」）。
   根因：旧内联样式用了从未定义的 var(--bg-1)/var(--bg-2)，background 计算无效回退透明，
   文字直接叠在表格与壁纸上，深浅主题都看不清。改用 .glass 同款变量——
   --glass-bg + --glass-floor 垫底 + 毛玻璃滤镜，主题切换自动跟随。 */
.line-salepop {
    position: fixed;
    z-index: 210;
    background: var(--glass-bg);
    background-image: linear-gradient(0deg, var(--glass-floor), var(--glass-floor));
    backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    -webkit-backdrop-filter: blur(var(--glass-blur)) saturate(var(--glass-sat));
    border: 1px solid var(--glass-line);
    border-radius: 12px;
    box-shadow: var(--shadow);
    padding: 8px;
    min-width: 200px;
    max-height: 280px;
    overflow: auto;
    color: var(--text-1);
}
/* hover 高亮走 CSS（同 .chip 口径），替代旧内联 onmouseover（用的 var(--bg-2) 未定义） */
.line-salepop .line-saleopt:hover { background: var(--glass-bg-strong); }
.line-salepop .line-saleopt { transition: background .12s var(--ease); }
.line-salepop .line-saleopt input[type=checkbox] { width: 14px; height: 14px; cursor: pointer; margin: 0; }
.line-salepop .line-saleopt span { user-select: none; }
/* 浮层小按钮沿用 .btn-sm，这里只收一下内边距，避免在窄浮层里换行 */
.line-salepop .btn-sm { padding: 5px 10px; font-size: 12.5px; }

/* ============================================================
   明细编辑表格紧凑化（2026-09-20 吴总反馈：弹窗内横向溢出）
   .modal.wide 可用 952px（2026-09-21 弹窗 920→984 后），全列编辑态
   min-width 832px（单价 120/金额 118 十万级加宽后）宽裕放下；
   这里再把单元格 padding 收窄、输入控件撑满列宽，窄列（数量/折扣）
   才不会挤成一条缝。只作用于 items.js 渲染的表格，不影响全局 .data。
   ============================================================ */
table.items-grid {
    /* 固定布局：列宽严格按表头分配。auto 布局下不换行内容（业务员姓名串、
       日期控件）会把列硬撑到 min-content，878px 的预算直接作废（实测撑到 919px）；
       fixed 之后列宽才真正管得住。 */
    table-layout: fixed;
}
table.items-grid thead th { padding: 9px 8px; }
table.items-grid thead th, table.items-grid tbody td, table.items-grid tfoot td { overflow: hidden; }
table.items-grid tbody td {
    padding: 8px;
    /* 文本内容完整显示（2026-09-20 吴总反馈「单据明细显示不全」）：
       长文本（业务员名单、备注、设备编号）超宽自动折行，不再省略号截断。
       anywhere 让连续长串（11111111111 这类无空格内容）也能断行。
       数字列不受影响：.num/.money 自带 white-space:nowrap，nowrap 优先于
       overflow-wrap —— 金额/单价/数量永远单行，配合列宽验算不会被截断。 */
    overflow-wrap: anywhere;
}
table.items-grid .nowrap { text-overflow: ellipsis; }
table.items-grid tfoot td { padding: 10px 8px; }
table.items-grid .line-input { width: 100%; min-width: 0; }
/* 明细行多行文本框（设备编号/行备注，items.js line-auto）：
   rows=1 起步与单行 input 等高，内容长了自动折行、脚本（fitLineTa）随内容撑高——
   编辑过程中输入内容始终完整可见（2026-09-20 吴总）。resize 交给脚本不让手拖；
   textarea 默认 monospace 字体必须拉回正文。 */
table.items-grid textarea.line-auto {
    height: 32px;
    min-height: 32px;
    line-height: 1.5;
    padding: 5px 9px;
    resize: none;
    overflow: hidden;
    display: block;
    font-family: inherit;
}
/* 数量/单价/折扣数字框：右对齐 + 内边距 9→4px + 字号 12.5→11.5px
   （2026-09-20 吴总反馈「数字没显示全」：真机量测 12.5px 数字约 8.4px/字符，
   56px 列两侧 9px 内边距吃掉 18px 只能看 3~5 字符；11.5px 字号 + 4px 内边距后，
   68/88px 列宽可容 5 数+点（1.6666/121.55）与 7 数+点（28988.00）） */
table.items-grid td .line-input.num {
    text-align: right;
    padding: 0 4px;
    font-size: 11.5px;
}
/* 金额列万一超出（百万级单价等极端值）至少出省略号提示被截，不再无声硬切 */
table.items-grid td.money { text-overflow: ellipsis; }
/* 设备下拉瘦身（2026-09-20 吴总反馈「设备选择项又被挤压了」）
   ⚠️ 关键：明细行里的 <select class="line-input"> 会被 ui.js 的 UI.enhanceSelects
   接管成玻璃下拉（span.gbsel.gbsel-line 包裹 + button.gbsel-trigger 显示 +
   原生 select 加 .gbsel-native 并被 display:none 隐藏，仅保留取值/赋值/change）。
   所以真正要瘦身的是 .gbsel-trigger，不是原生 select —— 打在 select 上的规则
   全部落在隐藏元素上，一行都不生效（第一版修复打偏的教训）。
   命中链路（第一版打偏的教训）：
   ① 真正显示的是 .gbsel-trigger，原生 select 被 .gbsel-native 隐藏，规则必须打在 trigger 上；
   ② 宽度卡在 96px 是因为 842 行通用规则 .gbsel.gbsel-line .gbsel-trigger { min-width:96px }
     —— .gbsel.gbsel-line（0,2,0）权重高于 table.items-grid .gbsel（0,1,1），
     所以容器与 trigger 的选择器都要带上 .gbsel-line 双类（或更高权重）才能覆盖它。
   明细行场景下容器必须 100% 撑满单元格（宽度交给 td 决定），trigger 也放开 min-width。
   宽度账（真机实测 + 全量设备扫描 16 台定档）：
   td 128 − 单元格内边距 10（本格单独收窄，见下条规则） = 容器 118
   ⇒ − 触发器边框 2 − 触发器内边距 6 − 箭头 10 − 间距 2 = 文本位 98px。
   11.5px 中文约 11.5px/字 ⇒ 最长设备名「螺杆式空气压缩机 / 焊接机器人工作站」（8 字
   实测 92px）可完整显示，全 16 台设备 100% 无截断。 */
table.items-grid .gbsel.gbsel-line { display: flex; width: 100%; }
/* 下拉所在的单元格内边距从 8px 收到 5px：8px 上下留白对 32px 高的触发器无必要，
   省出的 6px 全部让给文本位（明细行其它单元格维持 8px 不变）。
   用显式 class（items.js 渲染时给该 td 加 td-sel），不用 :has() 以免依赖新选择器。 */
table.items-grid tbody td.td-sel { padding-left: 5px; padding-right: 5px; }
table.items-grid .gbsel.gbsel-line .gbsel-trigger {
    gap: 2px;
    width: 100%;
    min-width: 0;
    /* ★ 2026-09-22：32 → min-height 32 + 自适应高。设备名折行后按钮要跟着长高，
       否则 .gbsel-text 换行了却被固定高度裁掉（换成换行反而更看不到，就白改了）。 */
    min-height: 32px;
    height: auto;
    padding: 5px 3px;
    font-size: 11.5px;
    border-radius: 9px;
    align-items: flex-start;
}
table.items-grid .gbsel.gbsel-line .gbsel-caret { width: 10px; height: 10px; flex: 0 0 10px; margin-top: 3px; }

/* ------------------------------------------------------------------
   设备选择器 = 自绘按钮（2026-09-20 吴总：「设备选择改成跟客户选择那样，
   可以搜索、又可以方便新增」）
   ----------------------------------------------------------------
   items.js 把原生的 <select data-k="product_id"> 换成：
       div.gbsel.gbsel-line.line-prodsel
         └ button.gbsel-trigger[data-prodsel]  ← 显示 + 点击弹 GB_PRODPICK 浮层
         └ input[hidden][data-k="product_id"]  ← 真值（表单取值兼容）
   刻意复用 gbsel 的 class，是为了自动继承上面那套「被挤压」调好的瘦身参数
   （11.5px / 窄内边距 / 10px 箭头 / 撑满格子），列宽预算一行都不用重算。

   下面是自绘按钮与原生被接管的 .gbsel-trigger 的三点差异补齐：
   ① 文本要能省略号截断（原生 trigger 靠 select 撑，自绘靠 span 自己收）；
   ② 光标给手指，明确这是可点控件；
   ③ 焦点态保留可见轮廓（键盘可达性，原生 select 自带、自绘要自己补）。
   ------------------------------------------------------------------ */
table.items-grid .gbsel.gbsel-line .gbsel-text {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    /* ★ 2026-09-22 吴总：「名称，规格应该也像这样样式显示，或者是自动换行显示也行，
       不然文字多了我只能看到省略号」—— 放开 nowrap，长设备名自动折行显示完整。
       容器高度不再固定 32px（见下条 .gbsel-trigger 的 height:auto），
       折行后按钮自然增高，行高跟着长，内容永远看得见。 */
    white-space: normal;
    word-break: break-word;
    line-height: 1.35;
    text-overflow: clip;
    text-align: left;
}
/* 设备格内的规格行（2026-09-22 新增）：与名称分两行显示，11.5px 灰字，允许折行。
   只读展示（规格以设备档案为准），所以不做输入控件样式。 */
table.items-grid .line-spec-line {
    margin-top: 3px;
    padding-left: 2px;
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--text-3);
    word-break: break-word;
    text-align: left;
}
/* 只读态的设备名称 / 规格也允许折行（原 .cell-main/.cell-sub 是 nowrap 单行） */
table.items-grid .line-wrap { white-space: normal; word-break: break-word; }
table.items-grid .line-prodsel .gbsel-trigger { cursor: pointer; }
table.items-grid .line-prodsel .gbsel-trigger:focus-visible {
    outline: 2px solid var(--primary, #2f6df6);
    outline-offset: 1px;
}
/* 设备浮层（GB_PRODPICK 单例，复用 .cp-panel 玻璃样式）在最窄处保底宽度，
   免得某个窄列（如只读模式下的窄表）把浮层压到看不清名称 */
.pp-panel { min-width: 300px; }

/* ------------------------------------------------------------------
   可搜索下拉筛选器（GB_FILTERPICK，2026-09-20 吴总第八轮）
   ----------------------------------------------------------------
   用在 filter-bar / 报表筛选栏里（设备筛选），外观对齐 .select 的高度与圆角，
   展开后的浮层复用 .cp-panel；选中非「全部」时描边高亮，一眼看出筛选生效。
   宿主要显式给宽度（.fpick 默认 auto，由父级 flex 决定）。
   ------------------------------------------------------------------ */
.fpick { position: relative; display: inline-block; min-width: 130px; }
.fpick .fpick-trigger {
    display: flex; align-items: center; gap: 6px; width: 100%; height: 34px;
    padding: 0 10px; border-radius: 9px; cursor: pointer;
    border: 1px solid var(--glass-line);
    background: var(--glass-bg-weak, rgba(255, 255, 255, .55));
    color: var(--text-1, inherit); font-size: 13px; font-family: inherit;
}
.fpick .fpick-trigger:hover { border-color: var(--glass-line-strong, var(--glass-line)); }
.fpick .fpick-trigger.is-on {
    border-color: var(--primary, #2f6df6);
    color: var(--primary, #2f6df6);
    font-weight: 600;
}
.fpick .fpick-trigger:focus-visible {
    outline: 2px solid var(--primary, #2f6df6);
    outline-offset: 1px;
}
.fpick .fpick-text {
    flex: 1; min-width: 0; overflow: hidden;
    text-overflow: ellipsis; white-space: nowrap; text-align: left;
}
.fpick .fpick-caret {
    flex: 0 0 10px; width: 10px; height: 10px;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translate(-1px, -1px); opacity: .55;
}
.fpick-panel { min-width: 260px; }

/* ------------------------------------------------------------------
   多选人员组件（GB_MULTIPICK，2026-09-22 吴总第二十一轮）
   ----------------------------------------------------------------
   用在主表单里替代原来的「处理人」单选框（多人协作场景需多选）。
   浮层复用 .line-salepop 的玻璃材质（深/浅主题自动跟随），
   这里只补「触发器 + 浮层内部排版」：
   ① 触发器外观对齐 .select（同高 38px、同圆角 11px），
      换掉单选框后表单栅格视觉零变化；
   ② 浮层顶部小字说明 + 可滚动选项区 + 底部按钮条；
   ③ 选中非空时描边高亮（对齐 .fpick-trigger.is-on 的口径）。
   ------------------------------------------------------------------ */
.mpick { position: relative; display: block; width: 100%; }
.mpick-trigger {
    display: flex;
    align-items: center;
    gap: 7px;
    width: 100%;
    min-width: 0;
    height: 38px;
    padding: 0 11px 0 12px;
    background: var(--glass-bg-weak);
    border: 1px solid var(--glass-line);
    border-radius: 11px;
    color: var(--text-1);
    font-size: 13px;
    font-family: inherit;
    text-align: left;
    cursor: pointer;
    transition: all .2s var(--ease);
}
.mpick-trigger:hover { background: var(--glass-bg-strong); border-color: color-mix(in srgb, var(--accent) 55%, transparent); }
.mpick-trigger.is-on {
    border-color: color-mix(in srgb, var(--accent) 55%, transparent);
    color: var(--accent);
    font-weight: 600;
}
.mpick-trigger:focus-visible { outline: 2px solid var(--accent); outline-offset: 1px; }
.mpick-text { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mpick-caret {
    flex: 0 0 10px; width: 10px; height: 10px;
    border-right: 1.5px solid currentColor; border-bottom: 1.5px solid currentColor;
    transform: rotate(45deg) translate(-1px, -1px); opacity: .55;
    transition: transform .2s var(--ease);
}
.mpick-trigger.is-open .mpick-caret { transform: rotate(-135deg) translate(-1px, -1px); opacity: .9; }

.mpick-panel { min-width: 240px; max-height: none; padding: 8px; }
.mpick-panel .mpick-hint {
    font-size: 12px;
    color: var(--text-3);
    padding: 2px 6px 8px;
    border-bottom: 1px solid var(--glass-line);
    margin-bottom: 6px;
    line-height: 1.5;
}
.mpick-list { overflow: auto; }
.mpick-panel .mpick-opt {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 8px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
}
.mpick-panel .mpick-name { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mpick-panel .mpick-sub { color: var(--text-3); font-size: 11.5px; flex: 0 0 auto; }
.mpick-panel .mpick-empty { padding: 18px 8px; text-align: center; color: var(--text-3); font-size: 12.5px; }
.mpick-panel .mpick-foot {
    display: flex;
    gap: 8px;
    align-items: center;
    padding-top: 8px;
    margin-top: 6px;
    border-top: 1px solid var(--glass-line);
}
.mpick-panel .mpick-spacer { flex: 1; }

/* 数量/单价/折扣框去原生上下箭头（2026-09-20 吴总反馈「箭头阻碍内容显示查看」）：
   只作用于明细表格内的 number 输入，主表单的数字框不受影响；
   键盘上下键仍可步进，校验逻辑不变，功能不减。 */
table.items-grid input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
}
table.items-grid input[type="number"]::-webkit-outer-spin-button,
table.items-grid input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 库存检索提示（2026-09-16 吴总）：出库方向单据明细「数量超现存」=红框、「扣除后剩
   ≤2」=橙框，一眼定位是哪一行有问题；完整文案走 toast + input title（悬停）。
   明细表 td overflow:hidden 会裁掉行内文字条，所以行内只用框色不用文字。 */
table.items-grid input[data-k="quantity"].stock-lack {
    border-color: var(--danger);
    background: rgba(225, 29, 72, 0.06);
}
table.items-grid input[data-k="quantity"].stock-low {
    border-color: #d97706;
    background: rgba(217, 119, 6, 0.08);
}

/* 单据表单内的小节标题（设备明细 / 采购明细 / 退货明细，6 处统一）：
   左侧品牌色竖条做视觉锚点，替代原来一行孤零零的灰字 */
.sect-title {
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-2);
    margin: 4px 0 10px;
}
.sect-title::before {
    content: '';
    width: 3px;
    height: 13px;
    border-radius: 2px;
    background: var(--accent, #22c55e);
    flex: none;
}

/* ------------------------------------------------------------
   保内维修（2026-09-23 吴总需求）
   成本合计带 —— 录单弹窗底部与列表页顶部共用同一套视觉。
   吴总最关心的一个数字就是「这单/这批保修花了多少」，把它做成
   整块里字号最大、颜色最重的那一个，扫一眼就能看到。
   ------------------------------------------------------------ */
.rp-sum,
.rp-sum-bar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 9px;
    padding: 11px 16px;
    border-radius: var(--radius-sm);
    background: var(--glass-bg-weak);
    border: 1px solid var(--glass-line);
    font-size: 13px;
    color: var(--text-2);
}
.rp-sum-bar { margin-bottom: 12px; }
.rp-sum-item { display: inline-flex; align-items: baseline; gap: 5px; }
.rp-sum-item b {
    font-family: var(--font-num);
    font-size: 14.5px;
    font-weight: 600;
    color: var(--text-1);
}
.rp-sum-op { color: var(--text-3); }
.rp-sum-total b { color: var(--danger); font-size: 16px; }

/* 配件格里的规格行：名称与规格分两行显示，观感与开单明细一致。
   那边把规则限定在 table.items-grid 内，本模块用的是普通 .data 表，
   所以按同样的字号行高单独放开一份。 */
.rp-parts-table .line-spec-line {
    margin-top: 3px;
    padding-left: 2px;
    font-size: 11.5px;
    line-height: 1.4;
    color: var(--text-3);
    word-break: break-word;
    text-align: left;
}

/* 库存检索提示（2026-09-23 吴总反馈「没有库存剩余数量检查」）：
   保内维修配件明细勾了「走仓库」的行，数量超该仓现存 = 红框、扣完剩 ≤2 = 橙框；
   配件格底下再给一行字（本仓现存 N）—— 那里宽度够，能直接看见数字。
   上方 items-grid 的同名规则选择器只覆盖开单明细表，本表 class 不同，
   必须单独放一份，否则颜色在这个页面不生效。
   小字常驻占位（无提示时内容为空），:empty 折叠掉不占高度。 */
table.rp-parts-table input[data-k="quantity"].stock-lack {
    border-color: var(--danger);
    background: rgba(225, 29, 72, 0.06);
}
table.rp-parts-table input[data-k="quantity"].stock-low {
    border-color: #d97706;
    background: rgba(217, 119, 6, 0.08);
}
.rp-stock-line:empty { display: none; }
.rp-parts-table .rp-stock-line.is-lack { color: var(--danger); font-weight: 600; }
.rp-parts-table .rp-stock-line.is-low  { color: #b45309; font-weight: 600; }

/* 行操作「完工」按钮：绿色语义（原有 .row-btn 只有 danger 变体） */
.row-btn.ok:hover {
    background: color-mix(in srgb, var(--success) 14%, transparent);
    color: var(--success);
}

/* ============================================================
   通知消息管理页 + 桌面弹窗  2026-09-26 v5.52（第四十三轮）
   页面：pages/notify.js（sys-notify）；弹窗：window.NTF
   ============================================================ */

/* ---- 页内标签行（消息中心 / 通知事件 / 通知偏好） ---- */
.ntf-page .ntf-tabs {
    display: flex; gap: 8px; margin: 2px 0 14px;
    border-bottom: 1px solid var(--glass-line); padding-bottom: 10px;
}
.ntf-tab {
    border: none; background: transparent; cursor: pointer;
    font-size: 13px; color: var(--text-2); padding: 6px 14px;
    border-radius: 999px; transition: all .18s var(--ease);
}
.ntf-tab:hover { background: var(--glass-bg-weak); color: var(--text-1); }
.ntf-tab.active {
    background: var(--accent-grad); color: #fff;
    box-shadow: 0 2px 10px color-mix(in srgb, var(--accent) 35%, transparent);
}
/* 标签上的未读角标（消息中心，v5.53）：红色小圆，与侧边栏 .nav-badge 同语义 */
.ntf-tab-badge {
    font-style: normal; font-size: 11px; line-height: 1;
    margin-left: 6px; padding: 2px 6px; border-radius: 20px;
    background: var(--danger); color: #fff; font-weight: 600;
    vertical-align: 1px;
}

/* ---- 消息中心：统计卡 ---- */
.msg-stats {
    display: grid; grid-template-columns: repeat(auto-fit, minmax(140px, 1fr));
    gap: 10px; margin-bottom: 14px;
}
.ms-card {
    background: var(--glass-bg-weak); border: 1px solid var(--glass-line);
    border-radius: var(--radius-lg); padding: 12px 14px;
}
.ms-card .k { font-size: 11.5px; color: var(--text-3); margin-bottom: 4px; }
.ms-card .v { font-size: 22px; font-weight: 700; font-family: var(--font-num); color: var(--text-1); }
.ms-card .v.hl { color: var(--accent); }
.ms-card .v.ok { color: var(--success); }

/* ---- 消息中心：工具条 / 分类筛选 / 列表 ---- */
.msg-toolbar { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; flex-wrap: wrap; }
.msg-chips { display: flex; gap: 6px; flex-wrap: wrap; }
.msg-chip {
    border: 1px solid var(--glass-line); background: transparent; cursor: pointer;
    font-size: 12px; color: var(--text-2); padding: 4px 12px; border-radius: 999px;
    transition: all .18s var(--ease);
}
.msg-chip:hover { background: var(--glass-bg-weak); color: var(--text-1); }
.msg-chip.active { background: var(--accent); border-color: var(--accent); color: #fff; }
.msg-toolbar .sub { flex: 1; font-size: 12px; color: var(--text-3); }

.msg-list { display: flex; flex-direction: column; gap: 8px; }
.msg-row {
    display: flex; align-items: center; gap: 10px;
    background: var(--glass-bg-weak); border: 1px solid var(--glass-line);
    border-radius: var(--radius-lg); padding: 10px 12px; cursor: pointer;
    transition: all .18s var(--ease);
}
.msg-row:hover { background: var(--glass-bg-strong); }
.msg-row.unread { border-left: 3px solid var(--accent); }
.msg-row.high .mt::after { content: '重要'; font-size: 10px; color: var(--danger); margin-left: 6px; }
.msg-row .mi {
    width: 30px; height: 30px; border-radius: 9px; flex: none;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid; background: var(--glass-bg-weak);
}
.msg-row .mm { flex: 1; min-width: 0; }
.msg-row .mt { font-size: 13px; color: var(--text-1); display: flex; align-items: center; }
.msg-row.unread .mt { font-weight: 600; }
.msg-row .mdot {
    width: 7px; height: 7px; border-radius: 50%; background: var(--accent);
    display: inline-block; margin-left: 8px; flex: none;
}
.msg-row .mc { font-size: 11.5px; color: var(--text-3); margin-top: 3px; }
.msg-row .ma { display: flex; gap: 6px; flex: none; }

/* ---- 通知事件：卡片网格 ---- */
.nev-grid {
    display: grid; grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
    gap: 12px;
}
.nev-card {
    background: var(--glass-bg-weak); border: 1px solid var(--glass-line);
    border-radius: var(--radius-lg); padding: 14px;
    transition: all .18s var(--ease);
}
.nev-card:hover { background: var(--glass-bg-strong); }
.nev-card.off { opacity: .62; }
.nev-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.nev-ico {
    width: 36px; height: 36px; border-radius: 10px; flex: none;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid; background: var(--glass-bg-weak);
}
.nev-tt { flex: 1; min-width: 0; }
.nev-tt .n { font-size: 13.5px; font-weight: 600; color: var(--text-1); }
.nev-tt .c { font-size: 11px; color: var(--text-3); margin-top: 2px; font-family: var(--font-num); }
.nev-ch { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.nev-chip {
    font-size: 10.5px; color: var(--text-2);
    border: 1px solid var(--glass-line); border-radius: 999px; padding: 2px 9px;
    background: var(--glass-bg-weak);
}
.nev-tpl {
    font-size: 12px; color: var(--text-2); line-height: 1.5;
    background: var(--glass-bg-weak); border-radius: 9px; padding: 8px 10px;
    margin-bottom: 10px; word-break: break-all;
    display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.nev-acts { display: flex; gap: 6px; flex-wrap: wrap; }
.nev-chn { display: flex; gap: 14px; }
.nev-chk { display: inline-flex; align-items: center; gap: 5px; font-size: 12.5px; color: var(--text-2); cursor: pointer; }

/* 编辑弹层里的实时预览块 */
.nev-preview, .nev-pv {
    margin-top: 10px; border: 1px dashed var(--glass-line);
    border-radius: var(--radius-lg); padding: 10px 12px;
    background: var(--glass-bg-weak);
}
.nev-preview .t, .nev-pv .t { font-size: 13px; font-weight: 600; color: var(--text-1); }
.nev-preview .c, .nev-pv .c { font-size: 12px; color: var(--text-2); margin-top: 5px; line-height: 1.6; }
.nev-preview .m { font-size: 11px; color: var(--text-3); margin-top: 8px; }

/* ---- 通知偏好 ---- */
.pref-wrap { display: flex; flex-direction: column; gap: 14px; max-width: 640px; }
.pref-block {
    background: var(--glass-bg-weak); border: 1px solid var(--glass-line);
    border-radius: var(--radius-lg); padding: 14px 16px;
}
.pref-block h4 {
    display: flex; align-items: center; gap: 6px;
    font-size: 13px; color: var(--text-1); margin: 0 0 4px;
}
.pref-block .field-tip { margin: 2px 0 10px; }
.pref-row { display: flex; align-items: center; gap: 14px; padding: 7px 0; flex-wrap: wrap; }
.pref-row .n { display: flex; align-items: center; gap: 6px; font-size: 12.5px; min-width: 110px; }
.pref-sw {
    display: inline-flex; align-items: center; gap: 6px;
    font-size: 12.5px; color: var(--text-2); cursor: pointer;
}
.pref-sw input, .nev-chk input { accent-color: var(--accent); }

/* ---- 桌面弹窗（window.NTF） ---- */
.ntf-host {
    position: fixed; top: 16px; right: 16px; z-index: 1300;
    display: flex; flex-direction: column; gap: 10px; pointer-events: none;
}
.ntf-pop {
    pointer-events: auto; cursor: pointer;
    display: flex; align-items: flex-start; gap: 10px;
    width: 320px; padding: 12px 14px;
    background: var(--glass-bg-strong); border: 1px solid var(--glass-line);
    border-radius: var(--radius-lg);
    backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
    box-shadow: 0 10px 34px rgba(0, 0, 0, 0.18);
}
.ntf-ico {
    width: 32px; height: 32px; border-radius: 9px; flex: none;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid; background: var(--glass-bg-weak);
}
.ntf-main { flex: 1; min-width: 0; }
.ntf-t { font-size: 12.5px; font-weight: 600; color: var(--text-1); line-height: 1.45; }
.ntf-c { font-size: 11.5px; color: var(--text-2); margin-top: 3px; line-height: 1.5; }
.ntf-m { font-size: 10.5px; color: var(--text-3); margin-top: 5px; }
.ntf-x {
    border: none; background: transparent; cursor: pointer; flex: none;
    color: var(--text-3); padding: 2px; border-radius: 6px;
}
.ntf-x:hover { color: var(--text-1); background: var(--glass-bg-weak); }

/* 弹出动画：淡入 / 滑入 / 弹跳（none 不加 class，直接出现） */
.ntf-pop.anim-fade { animation: ntfFade .26s var(--ease) both; }
.ntf-pop.anim-slide { animation: ntfSlide .3s var(--ease) both; }
.ntf-pop.anim-bounce { animation: ntfBounce .5s var(--ease) both; }
.ntf-pop.anim-out { animation: ntfOut .26s var(--ease) both; }
@keyframes ntfFade { from { opacity: 0; } to { opacity: 1; } }
@keyframes ntfSlide { from { opacity: 0; transform: translateX(40px); } to { opacity: 1; transform: none; } }
@keyframes ntfBounce {
    0% { opacity: 0; transform: translateY(-18px) scale(.92); }
    55% { opacity: 1; transform: translateY(4px) scale(1.02); }
    78% { transform: translateY(-2px) scale(.99); }
    100% { opacity: 1; transform: none; }
}
@keyframes ntfOut { to { opacity: 0; transform: translateX(30px); } }
