/* V7.0 前端样式：和桌面端保持一致（V7.0 起多公司共用这一套界面） */

:root {
    --accent: #2563eb;
    --border: #c9d1da;
    --bg: #f1f5f9;
    --panel: #ffffff;
    --head: #e6edf5;
    --text: #1c2430;
    --muted: #5b6675;
}

* {
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
    font-size: 13px;
    color: var(--text);
    box-sizing: border-box;
}

/* 上面那条 `*` 是"通配直选"：只要元素是 span / div / i 这类裸标签，它的 color 就归 `*` 管，
   父级写的白色只能靠继承，而继承永远输给直选——于是顶栏和左侧导航这两块深蓝面孔上，
   没自己点名配色的小东西全被拉回主题字色：白天是深字压深底（导航组名"库存管理"那一排、
   折叠箭头 ▾、"操作人"那一格），黑夜反倒看得见。这里把这两块里的默认字色交还给继承，
   写在所有具名规则前面，所以点过名的一概不受影响（当前页那颗蓝胶囊、模块切换的白药丸、
   退出键、机构标签都各自有更高特异性的规则）。 */
.toolbar *,
.nav-tree * {
    color: inherit;
}

body {
    margin: 0;
    background: var(--bg);
}

/* 顶部工具条：深藏青（A 方案稳重深蓝），白色文字 */
.toolbar {
    background: #1e3a5f;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    padding: 6px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    color: #fff;
}

.toolbar .title {
    font-weight: bold;
    color: #fff;
    font-size: 14px;
}

.toolbar button {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    padding: 4px 12px;
    cursor: pointer;
    color: #fff;
    border-radius: 4px;
    transition: all 0.2s;
}

.toolbar button:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.4);
}

.toolbar button.primary {
    background: rgba(255, 255, 255, 0.25);
    color: white;
    border-color: rgba(255, 255, 255, 0.5);
    font-weight: bold;
}

.toolbar .user-box {
    margin-left: auto;
    display: flex;
    align-items: center;
    gap: 6px;
    color: rgba(255, 255, 255, 0.9);
    font-size: 13px;
}

/* 操作人那一格只显自己一个名字：不再列别人的账号，
   也不再让人以为能在这里切身份（那颗下拉从来没绑过任何动作） */
.toolbar .user-box .user-name {
    background: rgba(255, 255, 255, 0.1);
    border: 1px solid rgba(255, 255, 255, 0.2);
    color: #fff;
    padding: 2px 8px;
    border-radius: 4px;
    font-weight: bold;
}

.toolbar .logout-btn {
    padding: 4px 12px;
    font-size: 13px;
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
    border: 1px solid rgba(255, 255, 255, 0.2);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}

.toolbar .logout-btn:hover {
    background: rgba(255, 68, 68, 0.8);
    border-color: rgba(255, 68, 68, 0.9);
}

/* 使用向导按钮：顶栏右侧，浅色底 + 蓝紫渐变边框 */
.toolbar .guide-btn {
    padding: 4px 10px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}

.toolbar .guide-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.8);
}

/* 提BUG按钮：顶栏右侧，红色醒目，带呼吸脉冲动画，方便用户遇到问题一键反馈 */
.toolbar .bug-report-btn {
    padding: 4px 12px;
    font-size: 12px;
    font-weight: bold;
    color: #fff;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border: 1px solid #fca5a5;
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    animation: bug-pulse 2s ease-in-out infinite;
    transition: transform 0.15s, box-shadow 0.2s;
}

.toolbar .bug-report-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.8);
    transform: scale(1.05);
}

@keyframes bug-pulse {
    0%, 100% { box-shadow: 0 0 6px rgba(239, 68, 68, 0.4); }
    50% { box-shadow: 0 0 14px rgba(239, 68, 68, 0.85); }
}

/* 主体布局：左树 + 右内容 */
.main {
    display: flex;
    height: calc(100vh - 42px);
}

/* 左侧栏：导航树在上，工具按钮固定在底部 */
.nav-side {
    width: 160px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(180deg, #22456e 0%, #1e3a5f 50%, #172c46 100%);
    border-right: 1px solid rgba(255, 255, 255, 0.1);
    color: #fff;
}

/* 左侧导航树 */
.nav-tree {
    flex: 1;
    overflow-y: auto;
    padding: 6px 0 12px 0;
}

/* 左下角工具按钮区：两列网格，省垂直空间 */
.nav-footer {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 6px;
    padding: 10px;
    border-top: 1px solid rgba(255, 255, 255, 0.12);
    background: rgba(0, 0, 0, 0.15);
}

.nav-footer button {
    width: 100%;
    text-align: center;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.15s;
    border-radius: 4px;
    border: 1px solid rgba(255, 255, 255, 0.18);
    padding: 5px 4px;
    color: #fff;
    background: rgba(255, 255, 255, 0.06);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.nav-footer button:hover {
    background: rgba(255, 255, 255, 0.14);
}

/* 主题切换：单独一行，居中图标 */
.nav-footer .theme-toggle {
    text-align: center;
    font-size: 15px;
    padding: 4px;
}

/* 教程按钮：蓝紫色调 */
.nav-footer .guide-btn {
    border-color: rgba(139, 92, 246, 0.5);
}
.nav-footer .guide-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.8);
}

/* 提BUG按钮：红色脉冲，醒目 */
.nav-footer .bug-report-btn {
    font-weight: bold;
    background: linear-gradient(135deg, #ef4444, #dc2626);
    border-color: #fca5a5;
    box-shadow: 0 0 8px rgba(239, 68, 68, 0.5);
    animation: bug-pulse 2s ease-in-out infinite;
}
.nav-footer .bug-report-btn:hover {
    background: linear-gradient(135deg, #dc2626, #b91c1c);
    box-shadow: 0 0 14px rgba(239, 68, 68, 0.8);
}

/* 通知铃铛 2026-11-09 移到顶栏了，左下角那一套角标/跳动样式一并收走，
   现在只认 .toolbar .notif-btn（和待办红点同一份外观）。 */

/* 分组头：图标 + 组名 + 折叠箭头，整行可点（收起不常用的组，二十几项不用一直铺着） */
.nav-group { margin-top: 2px; }

.nav-tree .group {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 9px 12px 5px 12px;
    color: #ffffff;
    font-size: 12px;
    font-weight: 600;
    letter-spacing: 1px;
    cursor: pointer;
    user-select: none;
}

.nav-tree .group:hover { color: #fff; }

.nav-tree .group .chev {
    font-size: 10px;
    opacity: 0.9;
    transition: transform 0.15s;
}

.nav-group.collapsed .group .chev { transform: rotate(-90deg); }
.nav-group.collapsed .group-items { display: none; }

/* 菜单项：圆角胶囊排布；当前页整颗蓝底，原来那道浅色竖条太弱，扫一眼找不到 */
.nav-tree .item {
    margin: 1px 8px;
    padding: 7px 10px 7px 22px;
    cursor: pointer;
    color: #ffffff;
    font-size: 13px;
    border-radius: 6px;
    transition: background 0.15s, color 0.15s;
}

.nav-tree .item:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #fff;
}

.nav-tree .item.active {
    background: #2563eb;
    color: #fff;
    font-weight: 600;
}

/* 侧边栏左下角那一行：这一家还能用多久（到期 / 不限期 / 还剩几天）。
   sticky 钉在树底下——菜单一长就要滚，滚走的那一行等于没写；他明确要的是常驻可见。
   底色沿用侧栏那条蓝紫渐变的深端，不加投影不加圆角（这里是一行状态，不是卡片）。 */
.nav-tree .nav-expiry {
    position: sticky;
    bottom: 0;
    margin-top: 10px;
    padding: 9px 12px 10px 12px;
    background: #16293f;
    border-top: 1px solid rgba(255, 255, 255, 0.14);
    display: flex;
    flex-direction: column;
    gap: 3px;
    cursor: default;
}
.nav-tree .nav-expiry .ne-line {
    font-size: 12.5px;
    font-weight: 600;
    color: #e8f1ff;
    letter-spacing: .5px;
}
.nav-tree .nav-expiry .ne-sub {
    font-size: 11px;
    line-height: 1.5;
    color: rgba(232, 241, 255, 0.66);
}
.nav-tree .nav-expiry.ne-warn .ne-line { color: #ffd36e; }
.nav-tree .nav-expiry.ne-danger { background: #4a1d1d; border-top-color: rgba(255, 150, 150, .35); }
.nav-tree .nav-expiry.ne-danger .ne-line { color: #ffb3b3; }
.nav-tree .nav-expiry.ne-danger .ne-sub { color: rgba(255, 214, 214, .8); }

/* 右侧内容区 */
.content {
    flex: 1;
    overflow: auto;
    padding: 12px;
}
/* 面板 */
.panel {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 12px;
    margin-bottom: 12px;
}

/* 设置页：左侧二级导航 + 右侧内容（2026-11-06） */
.set-layout {
    display: flex;
    align-items: flex-start;
    gap: 16px;
}
.set-nav {
    flex: 0 0 150px;
    display: flex;
    flex-direction: column;
    gap: 4px;
    position: sticky;
    top: 12px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 6px;
    padding: 6px;
}
.set-nav-item {
    text-align: left;
    border: 1px solid transparent;
    background: transparent;
    color: var(--text);
    padding: 7px 10px;
    border-radius: 5px;
    cursor: pointer;
    font-size: 13px;
    line-height: 1.3;
}
.set-nav-item:hover {
    background: var(--head);
}
.set-nav-item.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: 600;
}
.set-body {
    flex: 1 1 auto;
    min-width: 0;
}
@media (max-width: 720px) {
    .set-layout { flex-direction: column; }
    .set-nav {
        position: static;
        flex-direction: row;
        flex-wrap: wrap;
        flex-basis: auto;
        width: 100%;
    }
}

.panel .panel-title {
    background: var(--head);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    padding: 5px 8px;
    font-weight: bold;
    margin: -12px -12px 12px -12px;
}

/* 首页面板标题（带副标题和按钮） */
.panel > .panel-title {
    background: none;
    border: none;
    border-left: none;
    margin: 0 0 12px 0;
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
}

.panel > .panel-title .panel-subtitle {
    font-weight: normal;
    font-size: 12px;
    color: var(--muted);
}

.panel > .panel-title .panel-actions {
    margin-left: auto;
    display: flex;
    gap: 8px;
}

/* 面板内部再分段时的标题行：标题在左、按钮在右（设置页「用户」那一段用） */
.sub-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 32px 0 12px;
}

.sub-section-head h3 {
    margin: 0;
}

.sub-section-head .btn {
    margin-left: auto;
    margin-right: 0;
}

.section-note {
    color: var(--muted);
    font-size: 12px;
    margin: 0;
}

.section-warn {
    color: #c0392b;
}

/* 表格 */
table {
    width: 100%;
    border-collapse: collapse;
    background: var(--panel);
}

table th {
    background: var(--head);
    border: 1px solid var(--border);
    padding: 6px 8px;
    font-weight: bold;
    text-align: left;
}

table td {
    border: 1px solid var(--border);
    padding: 4px 8px;
}

table tr:hover {
    background: #f8f9fa;
}

table tr.selected {
    background: #dbeafe;
}

/* 单据筛选栏：参考达源来 ERP 的一整排筛选格 */
.doc-filter-bar {
    margin-bottom: 10px;
}
.doc-filter-bar .filter-row {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px;
    padding: 8px;
    background: var(--bg);
    border: 1px solid var(--border);
    border-radius: 4px;
}
.doc-filter-bar .filter-row label {
    font-size: 12px;
    color: var(--muted);
    white-space: nowrap;
    margin-right: 2px;
}
.doc-filter-bar .filter-row input[type="text"],
.doc-filter-bar .filter-row input[type="date"],
.doc-filter-bar .filter-row input[type="number"],
.doc-filter-bar .filter-row select {
    padding: 3px 6px;
    border: 1px solid var(--border);
    border-radius: 3px;
    font-size: 12px;
    background: var(--panel);
    color: var(--fg);
}
.doc-filter-bar .filter-row input[type="text"] {
    width: 100px;
}
.doc-filter-bar .filter-row input[type="date"] {
    width: 120px;
}
.doc-filter-bar .filter-row input[type="number"] {
    width: 80px;
}
.doc-filter-bar .filter-row .checkbox-label {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    cursor: pointer;
}
.doc-filter-bar .filter-actions {
    display: flex;
    gap: 6px;
    margin-top: 8px;
}
.doc-filter-bar .filter-actions .btn.active {
    background: var(--primary, #3b82f6);
    color: #fff;
    border-color: var(--primary, #3b82f6);
}

/* 单据明细视图：横向滚动 + 汇总行 */
.doc-items-view {
    overflow-x: auto;
}

.doc-items-table {
    width: 100%;
    min-width: 1200px;
    border-collapse: collapse;
    font-size: 12px;
}

.doc-items-table thead th {
    background: var(--head);
    border: 1px solid var(--border);
    padding: 6px 8px;
    font-weight: bold;
    text-align: left;
    white-space: nowrap;
    position: sticky;
    top: 0;
}

.doc-items-table thead th.num {
    text-align: right;
}

/* 禅道 #67（2026-11-07）：明细视图点表头排序。能点的那几格给个手型 + 悬停有一点底色，
   正在排的那一列在列名后面挂 ▲（升）/ ▼（降）—— 和他手上那套 ERP 同一个记号。
   空记号也占一点宽度，点一下不会把整排列名挤得左右跳。 */
.doc-items-table thead th.sortable {
    cursor: pointer;
    user-select: none;
}

.doc-items-table thead th.sortable:hover {
    background: #e8eef7;
}

.doc-items-table thead th .sort-mark {
    display: inline-block;
    min-width: 1.1em;
    text-align: center;
    color: var(--primary);
    font-weight: bold;
}

.doc-items-table tbody td {
    border: 1px solid var(--border);
    padding: 4px 8px;
    white-space: nowrap;
}

.doc-items-table tbody td.num {
    text-align: right;
}

.doc-items-table tbody tr:hover {
    background: #f8f9fa;
}

.doc-items-table tfoot .summary-row {
    background: #f0f4f8;
    font-weight: bold;
}

.doc-items-table tfoot td {
    border: 1px solid var(--border);
    padding: 6px 8px;
}

/* 按钮 */
.btn {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 4px 12px;
    cursor: pointer;
    margin-right: 6px;
}

.btn:hover {
    background: var(--head);
    border-color: var(--accent);
}

/* 按钮里的图标（2026-11-08 库存查询搜索行这一轮）：形状只在 app.js 的 UI_ICON 存一份，
   这里管尺寸和基线 —— 14px 配 13px 字，vertical-align 抬到手写文字的中线上，缝 5px。
   颜色跟 currentColor 走：主键那颗自动变白，深色主题不用另写一条。 */
.btn svg {
    width: 14px;
    height: 14px;
    vertical-align: -2px;
    margin-right: 5px;
}

.btn.primary {
    background: var(--accent);
    color: white;
    border-color: var(--accent);
    font-weight: bold;
}

.btn.danger {
    background: #dc3545;
    color: white;
    border-color: #dc3545;
}

.btn.danger:hover {
    background: #c82333;
    border-color: #bd2130;
}

.btn.danger:disabled {
    background: var(--muted);
    border-color: var(--muted);
    cursor: not-allowed;
}

.btn-sm {
    padding: 2px 8px;
    font-size: 12px;
}

.btn:disabled {
    color: var(--muted);
    background: var(--bg);
    cursor: not-allowed;
}

.btn-link {
    background: none;
    border: none;
    color: var(--accent);
    cursor: pointer;
    padding: 2px 6px;
    font-size: 13px;
}

.btn-link:hover {
    text-decoration: underline;
}

/* 输入框 */
input, select, textarea {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 4px 8px;
    font-size: 13px;
}

input:focus, select:focus {
    border-color: var(--accent);
    outline: none;
}

/* 首页面板网格 */
.dashboard-grid {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
}

.dashboard-grid .panel {
    margin-bottom: 0;
}

.dashboard-grid .panel .count {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent);
}

/* KPI 行（8 列） */
.kpi-row {
    display: grid;
    grid-template-columns: repeat(8, 1fr);
    gap: 8px;
    margin-bottom: 0;
}

.kpi-row .kpi-item {
    background: var(--head);
    border: 1px solid var(--border);
    padding: 8px;
    text-align: center;
}

.kpi-row .kpi-item .label {
    font-size: 11px;
    color: var(--muted);
    margin-bottom: 4px;
}

.kpi-row .kpi-item .value {
    font-size: 20px;
    font-weight: bold;
    color: var(--accent);
}

/* 格子不足 8 个的那一排（经营看板是 6 个）：还是同一套 kpi-item 的皮，只把列数收一下，
   免得右边空两格看着像缺了东西。金额这一档不写 ¥，按首页/线索那几排的做法把「（元）」写进 label。 */
.kpi-row.kpi-6 { grid-template-columns: repeat(6, 1fr); }

/* 面板头部（表格面板） */
.panel-header {
    background: var(--head);
    border: 1px solid var(--border);
    border-left: 3px solid var(--accent);
    padding: 5px 8px;
    font-weight: bold;
    margin: -12px -12px 12px -12px;
}

/* 6 面板网格（2 列） */
.dashboard-panels {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
    margin-bottom: 12px;
}

.dashboard-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 12px;
}

.dashboard-panel .table-scroll {
    max-height: 200px;
    overflow-y: auto;
}

.dashboard-panel .panel-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-top: 8px;
    padding-top: 8px;
    border-top: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
}

.dashboard-panel .panel-footer button {
    padding: 3px 10px;
    font-size: 12px;
}

.dashboard-panel .empty {
    color: var(--muted);
    text-align: center;
    padding: 20px;
}

/* 分页 */
.pager {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 12px;
}

.pager button {
    padding: 4px 10px;
}

.pager .info {
    color: var(--muted);
}

/* 状态标签 */
.status {
    display: inline-block;
    padding: 2px 8px;
    border-radius: 2px;
    font-size: 12px;
}

.status.draft { background: #fff3cd; color: #856404; }
.status.confirmed { background: #d1ecf1; color: #0c5460; }
.status.posted { background: #d4edda; color: #155724; }
.status.void { background: #f8d7da; color: #721c24; }

/* 数字右对齐 */
.num {
    text-align: right;
    font-family: "Consolas", monospace;
}

/* 库存量：红色加粗（和桌面端一致） */
.qty-red {
    color: #c0392b;
    font-weight: bold;
}

/* 表单网格 */
.form-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

.form-field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.form-field label {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}

.form-field input,
.form-field select,
.form-field textarea {
    padding: 6px 8px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 14px;
    background: var(--panel);
}

.form-field input:focus,
.form-field select:focus,
.form-field textarea:focus {
    outline: none;
    border-color: var(--accent);
}

/* 新增型号 →「品质」多选：一排勾选框 + 勾了「自定义」才露出来的文字格 */
.quality-box {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 16px;
    padding: 4px 0 2px;
}
.q-chk {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 14px;
    color: var(--text);
    cursor: pointer;
    white-space: nowrap;
}
.q-chk input {
    width: auto;
    margin: 0;
    padding: 0;
    border: none;
    background: none;
}
.q-custom {
    margin-top: 2px;
}

/* 单据详情头部 */
.doc-header {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 12px;
    padding: 16px;
    background: var(--head);
    border-radius: 4px;
    margin-bottom: 16px;
}

.doc-field {
    display: flex;
    gap: 8px;
}

.doc-field label {
    color: var(--muted);
    min-width: 80px;
}

.doc-field span {
    font-weight: 500;
}

/* 隐藏（工具类，必须压过所有 display 声明） */
.hidden { display: none !important; }


/* 顶栏那一家是哪个：登录进去的人要知道自己此刻看的是哪家的账 */
.branch-tag {
    background: rgba(255, 255, 255, 0.22);
    border: 1px solid rgba(255, 255, 255, 0.45);
    color: #fff;
    border-radius: 4px;
    padding: 2px 8px;
    font-size: 12px;
}

/* #app 纵向三段：顶栏 / 平台运营横幅（平时没有）/ 主体。
   主体原来写死 height: calc(100vh - 42px)——横幅一出现，42px 之外还得再减一段，
   每改一次横幅高度就要跟着改算术。改成 flex 纵向分配：横幅多高，主体自动让多少。 */
#app {
    display: flex;
    flex-direction: column;
    height: 100vh;
}
#app .toolbar { flex-shrink: 0; }
#app .platform-banner { flex-shrink: 0; }
#app .main {
    flex: 1;
    min-height: 0;
    height: auto;   /* 盖掉 .main 原来的 calc(100vh - 42px)，交给 flex 分 */
}

/* 平台运营进了某一家：橙色横幅顶在顶栏下面，一眼可见，直到点「返回平台控制台」。
   注意这条规则要连子元素一起点名——全局 * 选择器把颜色写死在每个元素上，
   只给 .platform-banner 一个颜色，里面的字还是默认黑。 */
.platform-banner {
    background: #fff3e0;
    border-bottom: 1px solid #f0a941;
    padding: 8px 14px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    flex-wrap: wrap;
}
.platform-banner, .platform-banner span { color: #8a5a00; }
.platform-banner b { color: #b26a00; }

/* 状态条原来吃的是全局灰色字，压在蓝紫渐变上几乎看不清；顶栏里统一用白 */
.toolbar .status-info {
    color: rgba(255, 255, 255, 0.78);
}

/* 标签页区域 */
.tab-area {
    flex: 1;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.tab-bar {
    background: var(--head);
    border-bottom: 1px solid var(--border);
    display: flex;
    gap: 2px;
    padding: 4px 8px 0 8px;
    min-height: 32px;
}

.tab {
    background: var(--panel);
    border: 1px solid var(--border);
    border-bottom: none;
    padding: 6px 12px;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
}

.tab.active {
    background: var(--bg);
    font-weight: bold;
}

.tab .close {
    color: var(--muted);
    font-size: 16px;
    line-height: 1;
}

.tab .close:hover {
    color: #c00;
}

/* 状态信息 */
.status-info {
    color: var(--muted);
    font-size: 12px;
}

/* 弹窗 */
.modal-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.modal {
    background: var(--panel);
    border: 1px solid var(--border);
    width: 500px;
    max-width: 90%;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
}

.modal-title {
    background: var(--head);
    border-bottom: 1px solid var(--border);
    padding: 10px 16px;
    font-weight: bold;
    font-size: 14px;
}

.modal-body {
    padding: 16px;
    overflow-y: auto;
    flex: 1;
}

.modal-footer {
    border-top: 1px solid var(--border);
    padding: 12px 16px;
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

/* 表单 */
.form-row {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
    gap: 8px;
}

.form-row label {
    width: 120px;
    text-align: right;
    font-weight: bold;
    flex-shrink: 0;
}

.form-row input,
.form-row select,
.form-row textarea {
    flex: 1;
    padding: 6px 8px;
}

.form-row textarea {
    min-height: 60px;
    resize: vertical;
}

/* 工具栏按钮组 */
.page-toolbar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.page-toolbar input,
.page-toolbar select {
    padding: 4px 8px;
}

/* 单据明细表格 */
.items-table {
    margin-top: 12px;
}

.items-table input,
.items-table select {
    width: 100%;
    border: none;
    padding: 2px 4px;
}

.items-table input:focus,
.items-table select:focus {
    background: #fff;
    border: 1px solid var(--accent);
}

/* 首页面板 */
.dashboard-panel {
    background: var(--panel);
    border: 1px solid var(--border);
    padding: 12px;
}

.dashboard-panel h3 {
    margin: 0 0 12px 0;
    font-size: 14px;
    color: var(--accent);
    border-bottom: 2px solid var(--accent);
    padding-bottom: 6px;
}

.kpi-grid {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 12px;
    margin-bottom: 16px;
}

.kpi-item {
    background: var(--head);
    border: 1px solid var(--border);
    padding: 12px;
    text-align: center;
}

.kpi-item .value {
    font-size: 24px;
    font-weight: bold;
    color: var(--accent);
}

.kpi-item .label {
    font-size: 12px;
    color: var(--muted);
    margin-top: 4px;
}

/* 搜索栏 */
.search-bar {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
    align-items: center;
}

.search-bar input {
    flex: 1;
    max-width: 300px;
}

/* 分页控件 */
.pagination {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    margin-top: 12px;
}

.pagination button {
    padding: 4px 10px;
}

.pagination .page-info {
    color: var(--muted);
    font-size: 12px;
}

/* 状态标签映射 */
.status-tag {
    display: inline-block;
    padding: 2px 8px;
    font-size: 12px;
}.status-tag.草稿 { background: #fff3cd; color: #856404; }
.status-tag.已确认 { background: #d1ecf1; color: #0c5460; }
.status-tag.已执行 { background: #d4edda; color: #155724; }
.status-tag.已作废 { background: #f8d7da; color: #721c24; }
.status-tag.待询价 { background: #e2e3e5; color: #383d41; }
.status-tag.已询价 { background: #cce5ff; color: #004085; }
/* 2026-10-30 禅道 #28：明细视图里被冲销的单子用这个样式 */
.status-tag.voided { background: #f8d7da; color: #721c24; text-decoration: line-through; }

/* 单据详情页审批状态条（2026-11-09）：提交审批 / 审批中 / 已通过 的即时提示 */
.apv-pill {
    display: inline-flex; align-items: center;
    padding: 4px 12px; border-radius: 4px; font-size: 13px;
    background: #fff3cd; color: #856404; border: 1px solid #ffe69c;
    align-self: center;
}
.apv-pill.apv-ok { background: #d4edda; color: #155724; border-color: #b7e1c4; }
.apv-decide { display: inline-flex; align-items: center; gap: 6px; }
.apv-decide .ipt { padding: 4px 8px; }

/* 通用彩色标签：项目中心/售后中心各状态用 */
.tag { display: inline-block; padding: 2px 8px; font-size: 12px; border-radius: 3px; line-height: 1.4; }
.tag-green { background: #d4edda; color: #155724; }
.tag-blue { background: #cce5ff; color: #004085; }
.tag-gray { background: #e2e3e5; color: #383d41; }
.tag-orange { background: #ffe5cc; color: #8a4d00; }
.link-btn { color: #2563eb; cursor: pointer; margin: 0 4px; }
.link-btn:hover { text-decoration: underline; }
.link-danger { color: #dc2626; cursor: pointer; margin: 0 4px; }
.link-danger:hover { text-decoration: underline; }

/* 库存查询：27 列放不下屏幕，横向滚动，表头吸顶。
   仍然是平涂底色 + 1px 描边 + 方角，不加圆角和投影。 */
.table-scroll-x {
    overflow-x: auto;
    overflow-y: auto;
    max-height: calc(100vh - 210px);
    border: 1px solid var(--border);
}

.table-scroll-x table {
    width: auto;
    min-width: 100%;
}

/* 物料搜索弹窗那张表：放大字号与行高，列里内容看得更全 */
.mat-modal-table {
    font-size: 13px;
    width: 100%;
}
.mat-modal-table th,
.mat-modal-table td {
    padding: 8px 12px;
}

.stock-table th {
    position: sticky;
    top: 0;
    z-index: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.stock-table td {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 列宽分隔条：贴在表头格子右边界内侧（th 是 overflow:hidden 的，往外探出去会被剪掉），
   悬停/拖动时才看得见，平时不占版面。
   拉完的宽度记在浏览器本地（localStorage 的 inv-col-w），双击恢复默认 */
.col-grip {
    position: absolute;
    top: 0;
    right: 0;
    width: 6px;
    height: 100%;
    cursor: col-resize;
    user-select: none;
    z-index: 2;
}

.col-grip:hover,
body.col-resizing .col-grip {
    background: rgba(37, 99, 235, .55);
}

body.col-resizing,
body.col-resizing * {
    cursor: col-resize !important;
    user-select: none;
}

/* 宽表（库存查询、产品管理都走 renderWideGrid 这一份）整张表是"双击一行开弹窗"的地方，
   双击顺手选中半个型号会和弹窗打架，所以正文默认不给选中。
   原来这条只认 #inv-grid，产品管理那张表拿同一份渲染器却少了这个行为
   ——选择器挂在类上，两张表一起生效，不再各写一份。 */
.stock-table tbody td {
    user-select: none;
}

/* 唯独型号那一列放开：他要左键一拖把型号选走拷去别处。
   打架的那一半在 app.js 的 dblclick 里收掉（开弹窗前清选区），
   所以"双击改主档"和"拖选拷型号"在这列上各走各的。 */
.stock-table tbody td.part-sel {
    user-select: text;
    cursor: text;
}

/* 描述/备注这类长文本列允许换行（列定义里 wrap: true，渲染器打 cell-wrap），
   其余都保持一行，横向对齐才看得清。
   原来写的是 td:nth-child(24)，认的是"库存那张表第 24 列"这个位置——
   产品管理的列由「显示列」勾，位置会变，按位置认必错，所以改成按类认。 */
.stock-table td.cell-wrap {
    white-space: normal;
    min-width: 140px;
}

/* ---------------------------------------------------------------------------
   单据编辑器：三段（单据头 / 明细 / 汇总）各一个 panel，沿用平涂 + 1px 描边
   --------------------------------------------------------------------------- */
.doc-editor .panel {
    margin-bottom: 12px;
}

.form-grid-4 {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 10px 14px;
    margin-bottom: 10px;
}

.form-grid-6 {
    display: grid;
    grid-template-columns: repeat(6, 1fr);
    gap: 10px 14px;
    margin-bottom: 10px;
}

.form-grid-4 .form-field label,
.form-grid-6 .form-field label {
    font-size: 12px;
    color: var(--muted);
}

.form-grid-4 .form-field input,
.form-grid-4 .form-field select,
.form-grid-4 .form-field textarea,
.form-grid-6 .form-field input,
.form-grid-6 .form-field select,
.form-grid-6 .form-field textarea {
    width: 100%;
    font-size: 13px;
    padding: 4px 6px;
}

/* 型号弹窗里的那几组：平涂 + 1px 描边 + 方角，不用圆角卡片 */
.mat-dialog {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.form-group {
    border: 1px solid var(--border);
    background: var(--panel);
    padding: 8px 10px 6px 10px;
}

.form-group-title {
    font-size: 13px;
    font-weight: bold;
    color: var(--text);
    border-bottom: 1px solid var(--border);
    padding-bottom: 4px;
    margin-bottom: 8px;
}

.form-group-hint {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5;
    margin: 2px 0 4px 0;
}

/* 「这几列这里填不了」那一组：左边一列列名，右边一句为什么 */
.mat-readonly-list {
    display: flex;
    flex-direction: column;
    gap: 3px;
    font-size: 12px;
    line-height: 1.5;
    color: var(--muted);
}

.mat-readonly-list b {
    color: var(--text);
    font-weight: normal;
}

/* 只读格：底色跟表头一致，一眼看出这格不用自己填 */
input.ro {
    background: var(--head);
    color: var(--muted);
}

/* 导入预检报告：一行一个数，左边是什么数、中间多少、右边灰字说这个数怎么来的 */
.imp-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 2px 0;
    font-size: 13px;
}

.imp-row span {
    color: var(--muted);
    min-width: 104px;
}

.imp-row b {
    font-weight: bold;
}

.imp-row i {
    color: var(--muted);
    font-style: normal;
    font-size: 12px;
}

.imp-opt {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 3px 0;
    font-size: 13px;
    cursor: pointer;
}

.imp-opt input {
    margin-top: 3px;
}

.imp-err {
    font-size: 12px;
}

.imp-warn {
    font-size: 12px;
    line-height: 1.7;
    color: var(--muted);
}

.imp-warn b {
    color: var(--text);
    font-weight: normal;
}

/* 库存导入页（布局照达源来那扇导入窗口）：平涂 + 1px 描边 + 方角，不做圆角投影 */
.si-methods {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 16px;
}

@media (max-width: 980px) {
    .si-methods { grid-template-columns: 1fr; }
}

.si-method {
    border: 1px solid var(--border);
    background: var(--panel-alt, #f7f8fa);
    padding: 10px 12px;
}

.si-filrow {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 6px;
}

.si-filrow label {
    font-size: 13px;
    color: var(--muted);
    white-space: nowrap;
}

.si-filrow input[type="text"] {
    flex: 1;
    min-width: 0;
}

.si-cols {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(230px, 1fr));
    gap: 6px 12px;
}

.si-col {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 3px 4px;
    border: 1px solid transparent;
}

.si-col:hover {
    border-color: var(--border);
}

.si-col.off {
    opacity: .55;
}

.si-col-name {
    flex: 1;
    min-width: 0;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.si-col select {
    width: 108px;
    flex: none;
    font-size: 12px;
    padding: 2px 4px;
}

.si-col-warn {
    font-style: normal;
    font-size: 11px;
    color: #8a6d1a;
    background: #fdf6dd;
    border: 1px solid #e8d894;
    padding: 0 4px;
    flex: none;
}

/* 解析提示（不是错）：CSV 里 Excel 丢字符落成 '?' 这类"数据被清过"的告知 */
.si-note {
    margin-top: 10px;
    padding: 8px 10px;
    font-size: 13px;
    white-space: pre-line;
    color: #8a5a12;
    background: #fff8e6;
    border: 1px solid #efd9a8;
    border-radius: 3px;
}
:root[data-theme="dark"] .si-note { color: #f0c470; background: rgba(240, 196, 112, .10); border-color: rgba(240, 196, 112, .4); }

.si-error {
    margin-top: 10px;
    padding: 8px 10px;
    font-size: 13px;
    color: #a32020;
    background: #fdeeee;
    border: 1px solid #e6b3b3;
    border-left: 3px solid #a32020;
}

.si-grid-wrap {
    max-height: 420px;
    overflow-y: auto;
    border: 1px solid var(--border);
}

.si-grid {
    font-size: 12px;
}

.si-grid th {
    position: sticky;
    top: 0;
    z-index: 1;
}

.si-grid td input[type="text"] {
    width: 100%;
    min-width: 56px;
    border: 1px solid transparent;
    background: transparent;
    font-size: 12px;
    padding: 2px 4px;
}

.si-grid td input[type="text"]:hover,
.si-grid td input[type="text"]:focus {
    border-color: var(--border);
    background: #fff;
}

.si-grid th.c-pick, .si-grid td.c-pick {
    width: 34px;
    text-align: center;
}

.si-grid .si-st {
    white-space: nowrap;
}

.si-th-map {
    display: block;
    font-style: normal;
    font-weight: normal;
    font-size: 11px;
    color: var(--accent, #2563eb);
}

.si-th-skip {
    display: block;
    font-style: normal;
    font-weight: normal;
    font-size: 11px;
    color: var(--muted);
}

.si-st-ok  { color: #1d7a3d; }
.si-st-bad { color: #a32020; cursor: help; border-bottom: 1px dotted #a32020; }
.si-st-wait{ color: var(--muted); }

.si-count {
    margin-top: 8px;
    font-size: 13px;
}

.si-count #si-checking {
    color: var(--muted);
    font-size: 12px;
    margin-left: 6px;
}

.si-summary {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 12px;
    margin-bottom: 10px;
}

@media (max-width: 980px) {
    .si-summary { grid-template-columns: 1fr; }
}

.si-runline {
    border-top: 1px solid var(--border);
    padding-top: 8px;
}

.si-runbtns {
    display: flex;
    gap: 10px;
    margin-top: 12px;
}

/* 汇总：他说"汇总占地小一点，明细占地大一点"。
   18 个字段一个不减、行列顺序不动，只把每格的留白压下去：
   面板内边距 12→6，行距 10→4，输入框内边距 4→2；屏幕够宽（≥1250px）时
   标签再挪到输入框左边同一行，省掉一整行标签的高度。
   平涂 + 1px 描边 + 方角不变。 */
.doc-summary {
    padding: 6px 12px;
}

.doc-summary > .panel-title {
    margin: 0 0 6px 0;
}

.doc-summary .form-grid-6 {
    grid-template-columns: repeat(6, minmax(0, 1fr));
    gap: 4px 12px;
    margin-bottom: 4px;
}

/* 窗口窄的时候标签挪回输入框上面：六列一排时每格只剩 90px，
   标签写着一行不折行，输入框就被挤到十几像素，数字根本看不清。
   窄屏改回上下排，但内边距仍然是压缩过的，高度比原来还是省一截。 */
.doc-summary .form-field {
    display: flex;
    flex-direction: column;
    gap: 1px;
}

@media (min-width: 1250px) {
    /* 2026-11-22：label 必须定宽！原来用 auto，"未税总额"4字、"RMB总成本"7字
       把各自输入框挤得长短不一。定宽后所有输入框严格等宽，横排也对齐。 */
    .doc-summary .form-field {
        display: grid;
        grid-template-columns: 84px minmax(0, 1fr);
        align-items: center;
        gap: 6px;
    }
}

.doc-summary .form-field label {
    font-size: 12px;
    white-space: nowrap;
}

/* 2026-11-22：汇总行框对齐。六列严格等宽（minmax(0,1fr)），
   每一格都是同一套 .form-field 结构（label + 输入框），输入框统一等高、
   统一 box-sizing，label 固定行高——这样三行的框横竖都对齐。 */
.doc-summary .form-grid-6 > * {
    min-width: 0;
}

.doc-summary .form-field label {
    height: 16px;
    line-height: 16px;
    overflow: hidden;
    text-overflow: ellipsis;
}

.doc-summary .form-field input,
.doc-summary .form-field select {
    box-sizing: border-box;
    width: 100%;
    height: 26px;
    padding: 2px 6px;
    font-size: 13px;
    line-height: 20px;
    margin: 0;
}

.doc-summary .form-field input.ro {
    background: var(--bg-soft, #f6f8fb);
    color: var(--text, inherit);
}

/* 2026-11-22 持有占比弹窗：和主界面同一套 group-title / 按钮 / data-table。
   group-title 里右浮动的操作按钮撑开高度，加 clearfix 免得压住下面内容。 */
.group-title::after {
    content: '';
    display: table;
    clear: both;
}

#modal-body .data-table {
    margin: 4px 0 0;
}

#modal-body .data-table td,
#modal-body .data-table th {
    padding: 5px 8px;
}

/* 明细：把汇总省出来的高度全部给这一格，表体最少 220px，最多占 58vh */
.items-scroll {
    min-height: 220px;
    max-height: 58vh;
}

.doc-items-table td {
    padding: 2px 4px;
}

.doc-items-table .line-no {
    text-align: center;
    color: var(--muted);
}

.doc-items-table td.num input {
    text-align: right;
}

/* 「显示列」藏起来的那几列：格子和里头的值都还在（照样能填、保存照样带上），
   只是这一列不占位置。加 !important 是因为上面那排 .doc-items-table td / thead th
   是组件规则，工具类压不过它 —— 同一件事在 .hidden 上已经吃过一次亏。 */
.col-hidden {
    display: none !important;
}

/* 型号自动补全：输入框 + 压在下面的候选列表 */
.part-search-wrap {
    position: relative;
}

.material-search-dropdown {
    position: absolute;
    left: 0;
    top: 100%;
    min-width: 100%;
    max-height: 210px;
    overflow-y: auto;
    background: var(--panel);
    border: 1px solid var(--accent);
    z-index: 50;
}

/* 明细格里输入料号时的候选层：它挂在 body 上，用 fixed 定位，
   位置/宽度由 JS 算（见 app.js 的 placeSuggestBox）。
   为什么不能留在格子里：明细表外面那层 .items-scroll 是 overflow:auto，
   它会裁掉格子里任何绝对定位的东西，z-index 再大也没用——
   他报的"下面推荐的库存结果都被遮到了"就是这个。
   ID 选择器比上面的类选择器权重高，position/left/top 才压得住。 */
#material-suggest {
    position: fixed;
    left: auto;
    top: auto;
    min-width: 0;
    /* 型号候选表 24 列、每行信息多，放宽高度让一屏多显示几行 */
    max-height: min(76vh, 760px);
    overflow-y: auto;
    /* 2500 不是随手写的：.modal-overlay 是 2000，单据「编辑」那一张就开在弹窗里，
       候选层压在它下面的话，那一格里出的候选点在弹窗玻璃上（2026-10-27 真点量到的：
       弹窗里往来单位那一格候选出了、点下去值还是空的）。
       上面还得留位置：右键菜单 3000、使用教程侧栏 4000、引导 5000，都该盖过候选。 */
    z-index: 2500;
    /* 宽度由 JS 定死；某一行型号特别长时宁可截断，也不把整层撑出屏幕 */
    overflow-x: hidden;
}

/* 通用模糊推荐那一层（筛选栏、单据和档案里要填名字的格子共用，见 app.js 的 comboBox）：
   和型号浮窗一样挂在 body 上、fixed 定位，位置由 placeSuggestBox 算，
   所以那几条定位规则照抄一份在这里，不再依赖 #material-suggest 顺带管到它。
   z-index 和上面那一层同一个道理：弹窗里的格子必须点得到候选。 */
#combo-suggest {
    position: fixed;
    left: auto;
    top: auto;
    min-width: 0;
    max-height: 300px;
    overflow-y: auto;
    overflow-x: hidden;
    z-index: 2500;
}

/* 顶上那行灰字说的是"候选从哪来、一共多少条"——
   人不只要看到有哪几条，还得知道是不是只给了前几条。滚起来钉住不跟着走。 */
.combo-head {
    position: sticky;
    top: 0;
    padding: 3px 8px;
    font-size: 11px;
    color: var(--muted);
    background: var(--head);
    border-bottom: 1px solid var(--border);
}

/* 没有候选时那句说明带着因果和下一步，常常有两行，别压成一整句看不完 */
.material-search-empty {
    white-space: pre-line;
    line-height: 1.5;
}

/* 单据头的往来单位：检索框 + 就地建档按钮挤在同一格里，按钮不许把框挤没 */
.party-field {
    display: flex;
    gap: 4px;
    align-items: stretch;
}

.party-field .party-input {
    flex: 1 1 auto;
    min-width: 0;
}

.party-field .btn {
    flex: 0 0 auto;
    margin-right: 0;
    padding: 0 8px;
    font-size: 12px;
    white-space: nowrap;
}

/* 抬头：固定抬头是下拉 + 下面那块回填信息；自由文本抬头是输入框 + 保存按钮。
   禅道 #46（2026-11-01）：这块信息区原先一行样式都没有——.title-field 是 flex，
   没样式的 div 就跟着挤在下拉右边那一格窄缝里，等于"选了抬头地址没更新"。
   改成整行独占、自己一行一条，小字灰描边，和字段本身分开看。 */
.title-field {
    display: flex;
    flex-wrap: wrap;
    gap: 4px;
    align-items: stretch;
}

.title-field input,
.title-field select {
    flex: 1 1 auto;
    min-width: 0;
}

.title-field .btn {
    flex: 0 0 auto;
    margin-right: 0;
    padding: 0 8px;
    font-size: 12px;
    white-space: nowrap;
}

.title-info {
    flex: 1 1 100%;
    min-width: 0;
    padding: 4px 6px;
    border: 1px solid var(--border);
    background: #f6f8fa;
    font-size: 12px;
    line-height: 1.6;
    color: var(--muted);
    word-break: break-all;
}

.title-info .ti-line {
    white-space: normal;
}

/* 抬头旁边那行「展开公司资料」：默认收起，点一下才铺开地址/电话/开户行（2026-11-03） */
.title-info .ti-toggle {
    color: var(--accent);
    cursor: pointer;
    user-select: none;
}

.title-info .ti-toggle:hover {
    text-decoration: underline;
}

.title-info .ti-caret {
    display: inline-block;
    width: 1em;
}

/* 抬头名单没取到时那一行是报错，不是地址：给个能一眼看出来的颜色 */
.title-info .ti-err {
    color: #b3261e;
}

/* 设置页「固定抬头」：一家一格。方角 + 1px 描边 + 平涂底，不做圆角投影 */
.ft-card {
    border: 1px solid var(--border);
    background: #fbfcfd;
    padding: 10px 12px 14px;
    margin-bottom: 14px;
}

.ft-card-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    font-size: 13px;
    margin-bottom: 8px;
}

.ft-card-head .btn-sm {
    flex: 0 0 auto;
}

/* 固定抬头：每个字段输入框后面那一小块打印字体设置（字号/加粗/斜体）。屏幕 UI，和打印无关 */
.ft-field-fonts {
    display: flex;
    flex-wrap: wrap;
    gap: 6px 14px;
    margin-top: 5px;
}
.ft-fc {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 11px;
    color: var(--muted);
}
.ft-fc-tag {
    display: inline-block;
    padding: 0 5px;
    line-height: 16px;
    border: 1px solid var(--border);
    background: #eef3fb;
    color: #2f6fed;
    font-size: 11px;
    font-weight: 600;
}
.ft-fs {
    width: 48px;
    padding: 1px 4px;
    font-size: 12px;
}
.ft-tog {
    display: inline-flex;
    align-items: center;
    gap: 2px;
    font-size: 11px;
    color: var(--muted);
    cursor: pointer;
}

/* 禅道 #69（2026-11-07，图176 他红框框的是纸上「客户…日期 / 明细表 / 合计那一行」）：
   这一家抬头卡片底下多出来的一块 —— 抬头那几行早就能设字号，正文这三块一直没有入口。
   平涂一条浅底 + 1px 描边，方角，不做成另一张卡片。 */
.ft-body-fonts {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 6px 16px;
    margin-top: 10px;
    padding: 8px 10px;
    border: 1px solid var(--border);
    background: #f4f7fb;
}

.ft-body-title {
    font-size: 12px;
    font-weight: 600;
    color: var(--muted);
    margin-right: 4px;
}

.ft-body-row {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
}

/* 旧的那套往来单位候选层（#party-suggest）已经删掉了：它和 #combo-suggest 是同一件事，
   留两份源码就会出现"这格的候选和那格不一样"。这里不再补样式。 */

.material-search-item {
    display: flex;
    gap: 10px;
    align-items: baseline;
    padding: 4px 8px;
    cursor: pointer;
    white-space: nowrap;
}

/* 详细版：两行布局，第一行型号+主要字段，第二行成本/价格 */
.material-search-item.material-search-item-detailed {
    flex-direction: column;
    gap: 2px;
    align-items: stretch;
    white-space: normal;
    padding: 6px 10px;
}

.material-search-item .m-row {
    display: flex;
    gap: 8px;
    align-items: baseline;
    flex-wrap: nowrap;
}

.material-search-item .m-row-secondary {
    font-size: 12px;
    color: var(--muted);
}

.material-search-item .m-row-secondary .m-field-label {
    color: var(--muted);
    font-size: 11px;
    margin-right: 1px;
}

.material-search-item .m-field {
    color: #444;
    font-size: 13px;
}

.material-search-item .m-row-secondary .m-field {
    color: #555;
    font-size: 12px;
}

.material-search-item:hover,
.material-search-item.selected {
    background: #dbeafe;
}

.material-search-item .m-part {
    font-weight: bold;
}

.material-search-item .m-sub,
.material-search-item .m-qty {
    color: var(--muted);
    font-size: 12px;
}

.material-search-item .m-qty {
    margin-left: auto;
}

/* 型号推荐表：和库存查询同款的表格布局 */
.material-suggest-scroll {
    overflow-x: auto;
    max-width: 100%;
}

.material-suggest-table {
    width: 100%;
    /* 24 列各给足宽度，整张表横向铺开，减少左右滚动 */
    min-width: 1900px;
    border-collapse: collapse;
    font-size: 13px;
}

.material-suggest-table thead th {
    background: #f0f4f8;
    border-bottom: 1px solid var(--border);
    padding: 6px 9px;
    text-align: left;
    font-weight: 600;
    color: #333;
    position: sticky;
    top: 0;
    white-space: nowrap;
}

.material-suggest-table thead th.num {
    text-align: right;
}

.material-suggest-table tbody tr {
    cursor: pointer;
    border-bottom: 1px solid #e8ecf0;
}

.material-suggest-table tbody tr:hover,
.material-suggest-table tbody tr.selected {
    background: #dbeafe;
}

.material-suggest-table tbody td {
    padding: 6px 9px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    /* 原来每列最多 120px，长型号/批次编码/备注都被省略号截掉；放宽到 260px */
    max-width: 260px;
}

.material-suggest-table tbody td.num {
    text-align: right;
}

.material-suggest-table tbody td.m-part {
    font-weight: bold;
    color: #1a1a1a;
}

.material-search-empty {
    padding: 6px 8px;
    color: var(--muted);
    font-size: 12px;
}

.btn-link.danger {
    color: #c0392b;
}

/* 汇总区下面的缺数说明：哪几行算不进成本，点名写出来 */
.summary-note {
    border: 1px solid var(--border);
    border-left: 3px solid #c0392b;
    background: #fdf3f2;
    color: #7a2a20;
    padding: 6px 8px;
    font-size: 12px;
}

/* 汇总里的缺数说明：面板内边距已经收到 6px，这一条也跟着收，别顶出空白 */
.doc-summary .summary-note {
    margin-top: 2px;
    padding: 4px 8px;
}

/* 出货单：数量超过库存的格子标红，警告条贴在明细表正下方（不滚就看得见） */
.item-ship-qty.qty-over {
    border-color: #c0392b;
    background: #ffeceb;
    color: #7a2a20;
}

.doc-ship-warn {
    margin-top: 6px;
    border: 1px solid #e5b8b2;
    border-left: 3px solid #c0392b;
    background: #fdf3f2;
    color: #7a2a20;
    padding: 6px 8px;
    font-size: 12px;
}

.doc-ship-warn > div + div {
    margin-top: 4px;
}

/* ---------------------------------------------------------------------------
   库存查询：右侧一整列分上下两块
   平涂底色 + 1px 描边 + 方角，不加圆角和投影；两块同时可见，滚动只在自己的
   表体里滚，翻页条和合计永远钉在屏幕内。
   产品管理（.mat-split）只有一块，但"一屏高、表体自己滚、脚钉住"是同一个要求，
   所以这两条选择器一起带上它，屏高的数字只写这一份。
   --------------------------------------------------------------------------- */
/* 标签页内容外壳：openPage 每次都是「清空 #content，再塞这一个容器」，
   所以它就是 #content 唯一的直接子。#content 的高度是 .tab-area 那条 flex 链
   算出来的确定值（42 顶栏 + 35 标签栏 + 剩下的全给它），这里给 100% 就有值了。
   以前这里不写高度，所以下面那屏只能按 100vh 凑数字凑出来的（见下面那段注释）。 */
.tab-container { height: 100%; }

.inv-split,
.mat-split {
    /* 占满内容区就够，不再按视口凑数字。
       原来写的是 height: calc(100vh - 102px)，那 102 = 顶栏 42 + 标签栏 32 + 内边距 24，
       是普通账号的量。平台运营进了某一家时顶上还有一条 44 像素的横幅
       （#platform-banner，本机 NIUMAG 一直带着），整屏就被顶到视口外面 44 像素：
       合计和翻页条掉到屏幕底下，得把页面往下滚才看得见 —— 正是"脚要钉在屏内"的反面。
       改成跟着真容器走，横幅多高、标签栏多高都不用再改这里。
       min-height 留着：窗口拉到很矮时宁可让 #content 出滚动条，也不把表体压没。 */
    height: 100%;
    min-height: 320px;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.inv-split .panel,
.mat-split .panel {
    display: flex;
    flex-direction: column;
    margin: 0;
    padding: 8px;
    min-height: 0;
}

/* 产品管理只有一块，给它整屏；库存查询那两块按下面的 3:2 分，不吃这条 */
.mat-split .panel { flex: 1 1 auto; }

/* 上下两块按 3:2 分这一列，窗口矮了也各自保留一点表体高度，
   整页不出现第二条滚动条——合计和翻页条必须一直在屏内。 */
.inv-top { flex: 3 1 0; min-height: 170px; }
.inv-bottom { flex: 2 1 0; min-height: 150px; }

/* 库存查询上下栏分隔条：拖动调整占比（比例存当前账号，键「库存查询.上下比例」）。
   原 gap:8px 被这里收成 0，间距改由分隔条自身的上下边框承担，
   免得 top / 分隔条 / bottom 三块各多一条 8px。产品管理那张表不吃这条。 */
.inv-split { gap: 0; }
.inv-splitter {
    flex: 0 0 9px;
    cursor: row-resize;
    background: var(--panel);
    border-top: 1px solid var(--border);
    border-bottom: 1px solid var(--border);
    position: relative;
}
.inv-splitter::after {
    content: "";
    position: absolute;
    left: 50%; top: 50%;
    width: 36px; height: 3px;
    transform: translate(-50%, -50%);
    border-top: 1px solid var(--muted);
    border-bottom: 1px solid var(--muted);
    opacity: .45;
}
.inv-splitter:hover, .inv-splitter.dragging { background: #eef3fb; }

.inv-searchline {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
}

.inv-searchline .inv-field { width: 88px; }
.inv-searchline #inv-keyword { width: 190px; }
.inv-check { display: flex; align-items: center; gap: 4px; color: var(--muted); }

.inv-more-wrap { position: relative; }

.menu {
    position: absolute;
    top: 100%;
    left: 0;
    z-index: 30;
    background: var(--panel);
    border: 1px solid var(--border);
    display: flex;
    flex-direction: column;
    min-width: 210px;
}

.menu button {
    border: none;
    border-bottom: 1px solid var(--border);
    background: var(--panel);
    padding: 6px 10px;
    text-align: left;
    white-space: nowrap;
    cursor: pointer;
}

.menu button:last-child { border-bottom: none; }
.menu button:hover { background: #dbeafe; }

.inv-advance {
    display: flex;
    align-items: center;
    gap: 18px;
    flex-wrap: wrap;
    padding: 8px 0 2px;
}

.adv-group { display: flex; align-items: center; gap: 6px; }
.adv-label { color: var(--muted); }

.seg { display: flex; border: 1px solid var(--border); }
.seg button {
    border: none;
    border-right: 1px solid var(--border);
    background: var(--panel);
    padding: 4px 10px;
    cursor: pointer;
}
.seg button:last-child { border-right: none; }
.seg button.on { background: #dbeafe; font-weight: bold; }

.grid-tabs {
    display: flex;
    align-items: center;
    gap: 2px;
    border-bottom: 1px solid var(--border);
    margin-top: 6px;
}

.gtab {
    background: var(--bg);
    border: 1px solid var(--border);
    border-bottom: none;
    padding: 4px 12px;
    cursor: pointer;
}

.gtab.on { background: var(--panel); font-weight: bold; }
/* 下半区「页签设置」那颗：跟在最后一档后面，别混成一种单据页签 */
.pdtab-cfg-btn { margin-left: 6px; color: var(--muted); font-size: 12px; }
.pdtab-cfg-btn:hover { color: var(--accent); }
#pd-tabcfg { margin: 0 0 6px; }
.tab-hint { margin-left: auto; color: var(--muted); font-size: 12px; }
.tab-hint.inv-dbl-hint { margin-left: 14px; }

.grid-wrap {
    flex: 1 1 auto;
    min-height: 40px;
    overflow: auto;
    border: 1px solid var(--border);
    border-top: none;
    background: var(--panel);
}

.grid-wrap table { width: auto; min-width: 100%; }
.grid-wrap tbody tr { cursor: pointer; }
.grid-wrap .pd-table tbody tr { cursor: default; }
.grid-wrap th { position: sticky; top: 0; z-index: 1; white-space: nowrap; }
/* 库存查询表头点击排序：可排序列变手型，当前排序列在列名后画箭头
   （▲=升序/字母顺序，▼=降序/从大到小），双击恢复默认时箭头消失。
   箭头用表头里直接渲染的 <span class="sort-mark">（见 app.js），不靠 ::after，
   免得 table-cell 上伪元素不画、点了排序却看不见方向。 */
.stock-table th[data-sort] { cursor: pointer; user-select: none; }
.stock-table th[data-sort]:hover { color: var(--accent, #1a5fb4); }
.stock-table th .sort-mark { margin-left: 3px; font-size: 10px; font-weight: 700; color: #2563eb; }
:root[data-theme="dark"] .stock-table th .sort-mark { color: #93c5fd; }
.grid-wrap td { white-space: nowrap; }

.op-cells { white-space: nowrap; }
.op-cells .btn-link { margin-right: 4px; }

.grid-foot {
    display: flex;
    align-items: center;
    gap: 12px;
    padding-top: 6px;
    flex-wrap: wrap;
}

.inv-total { font-weight: bold; color: #c62828; }
.total-red { color: #c62828; }
.total-note { font-weight: normal; color: var(--muted); font-size: 12px; }

/* 全站分页条统一钉在表格脚的右侧：合计/选中信息留左边，分页靠 margin-left:auto 归位。
   不再靠某个兄弟元素带 auto 把它挤过去，六个页面的位置从此一致。 */
.pager-line { display: flex; align-items: center; gap: 4px; margin-left: auto; }
.pager-line .page-size { color: var(--muted); display: flex; align-items: center; gap: 4px; }
/* 每页条数：可自由输入的文本格（不用 number，免得冒出上下箭头），带常用档下拉建议。 */
.pager-line .page-size input { width: 58px; text-align: center; padding-right: 2px; }
.pager-line .page-info { color: var(--muted); font-size: 12px; white-space: nowrap; }
.page-goto { width: 56px; text-align: center; }

.pd-toolbar {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding: 8px 0 6px;
}

.pd-toolbar input[type="date"] { width: 130px; }
.pd-toolbar #pd-party, .pd-toolbar #pd-docno { width: 140px; }
.pd-sel { color: var(--muted); font-size: 12px; }

.empty-here { color: var(--muted); padding: 14px; line-height: 1.7; }
.loading { color: var(--muted); padding: 14px; }

.detail-facts { display: flex; gap: 18px; flex-wrap: wrap; color: var(--muted); }

/* 标签位只写不点的时候（产品管理只有一个页签）：还挂着 .gtab 的样式，
   但光标不能是手指，否则看着像能点。 */
.gtab.static { cursor: default; }

/* 一行里第二个提示接着第一个排，不再各自往两边甩 */
.tab-hint + .tab-hint { margin-left: 14px; }

/* ---------------------------------------------------------------------------
   产品管理：一整列、一屏高，表体在自己框子里滚，合计和翻页条钉在屏幕内。
   屏高、面板 flex 这两样和上面「库存查询」那一节是同一个条件，
   所以上面那两条选择器已经把 .mat-split 一起带上了，这里不写第三份。
   --------------------------------------------------------------------------- */
.mat-split .inv-searchline #mat-keyword { width: 190px; }

/* 「显示列」那一片：点「显示列」在工具条下面展开，勾完一次点「保存到账号」。
   平涂底色 + 1px 描边 + 方角，不做卡片（不加圆角和投影）。 */
.col-picker {
    border: 1px solid var(--border);
    background: var(--bg);
    padding: 8px;
    margin-top: 6px;
}

.col-picker.hidden { display: none; }

.cp-title {
    color: var(--muted);
    font-size: 12px;
    line-height: 1.6;
    padding-bottom: 6px;
    border-bottom: 1px solid var(--border);
}

.cp-list {
    display: grid;
    /* 列名两三个字，一行放六格；窗口窄了自己减列，不换行堆叠 */
    grid-template-columns: repeat(auto-fill, minmax(92px, 1fr));
    gap: 2px 8px;
    padding: 6px 0;
}

.cp-item {
    display: flex;
    align-items: center;
    gap: 4px;
    padding: 2px 4px;
    cursor: pointer;
    font-size: 12px;
}

.cp-item:hover { background: #dbeafe; }
.cp-item input { margin: 0; }

.cp-foot {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    border-top: 1px solid var(--border);
    padding-top: 6px;
}

/* 回执就在按钮这一排，勾完点保存当场看得见，不用往下找 */
.cp-msg { font-size: 12px; color: var(--muted); }
.cp-msg.ok { color: #2e7d32; }
.cp-msg.bad { color: #c62828; font-weight: bold; }

/* ============================================================
   显示列（全站共用那一颗）+ 自定义表头
   —— 平涂底色 + 1px 描边 + 方角，不做卡片；浅色区里不出现黑底
   ============================================================ */
.vis-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap;
    padding: 4px 0 6px;
}

.btn-mini {
    padding: 2px 10px;
    font-size: 12px;
    line-height: 1.5;
}

.vis-tip { font-size: 12px; color: var(--muted); }

.vis-panel {
    flex-basis: 100%;
    border: 1px solid var(--border);
    background: var(--bg);
    padding: 8px;
}

.vis-panel.hidden { display: none; }

/* 勾列清单里那一根"自定义"小标：认得出这是他加的列，不是系统列。
   这几处底色是写死的浅色（昼夜两套都用同一片浅蓝），所以字色也一起写死，
   不然夜间模式那个浅底上会顶着浅色字，等于看不见。 */
.cp-item.cc-col { background: #eef2ff; color: #1f2937; }
.cp-item.cc-col input { accent-color: #4f46e5; }
.cp-cc-tag {
    font-style: normal;
    font-size: 11px;
    color: #3730a3;
    border: 1px solid #c7d2fe;
    padding: 0 3px;
    margin-left: 3px;
}

/* 面板里「自定义表头」那一小节 */
.cp-cc {
    border-top: 1px solid var(--border);
    margin-top: 6px;
    padding-top: 6px;
}

.cp-cc-title { font-size: 12px; font-weight: bold; }
.cp-cc-sub { font-weight: normal; color: var(--muted); font-size: 12px; }

.cp-cc-list { padding: 4px 0; }

.cp-cc-item {
    display: flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    padding: 2px 0;
}

.cp-cc-name { min-width: 90px; }
.cp-cc-kind { color: var(--muted); }
.cp-cc-name-input,
.cp-cc-rename-input { font-size: 12px; padding: 1px 4px; }
.cp-cc-empty { font-size: 12px; color: var(--muted); padding: 2px 0; }

.cp-cc-row {
    display: flex;
    align-items: center;
    gap: 6px;
    flex-wrap: wrap;
    padding-top: 4px;
}

.cp-cc-name-input { flex: 0 0 auto; width: 240px; }
.cp-cc-fill-note { font-size: 12px; color: var(--muted); }

/* 拦回来的话：为什么这颗按钮按不动，一句话说清（不是悄悄 disabled） */
.cp-cc-block {
    font-size: 12px;
    color: #92400e;
    background: #fef3c7;
    border: 1px solid #fcd34d;
    padding: 4px 6px;
    margin-top: 4px;
    line-height: 1.6;
}

.cp-cc-msg { font-size: 12px; margin-top: 4px; line-height: 1.6; }
.cp-cc-msg.ok { color: #2e7d32; }
.cp-cc-msg.bad { color: #c62828; }

/* 表上那些自定义格子：描一根虚线，一眼看出这列不是系统列；空格子也照样能点 */
th.cc-th { color: #3730a3; background: #eef2ff; }
td.cc-cell { cursor: text; min-width: 60px; }
td.cc-cell.cc-blank::after { content: '待填'; color: var(--muted); font-size: 11px; }
td.cc-cell.cc-saving { background: #fef9c3; color: #1f2937; }
.cc-input { width: 100%; min-width: 70px; font-size: 12px; border: 1px solid var(--accent); padding: 1px 3px; }

/* ============================================================
   单据打印：屏幕上这一份是隐藏的，只有走打印时才作为整页出现
   ============================================================ */
#print-root { display: none; }

/* 电商对接页（2026-11-08）：凭证 / SKU映射 / 拉单 / 拉单记录 */
.ecom-wrap { padding: 10px; }
.ecom-sec { margin-bottom: 22px; border: 1px solid #e5e7eb; border-radius: 6px; padding: 10px 14px; }
.ecom-sec h3 { margin: 4px 0 10px; font-size: 14px; }
.ecom-pull-bar { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.ecom-result { margin-top: 8px; white-space: pre-wrap; font-size: 12px; color: #374151; }
.ecom-table { width: 100%; border-collapse: collapse; margin-top: 8px; font-size: 12px; }
.ecom-table th, .ecom-table td { border: 1px solid #e5e7eb; padding: 5px 8px; text-align: left; }
.ecom-table th { background: #f3f4f6; }
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.35); display: flex; align-items: center; justify-content: center; z-index: 999; }
.modal { background: #fff; border-radius: 8px; min-width: 320px; max-width: 92vw; padding: 16px 18px; box-shadow: 0 6px 24px rgba(0,0,0,.2); }
.modal-title { font-weight: 600; margin-bottom: 10px; }
.modal-body { display: flex; flex-direction: column; gap: 8px; }
.modal-body label { display: flex; flex-direction: column; font-size: 12px; gap: 2px; }
.modal-actions { margin-top: 14px; display: flex; justify-content: flex-end; gap: 8px; }

@media print {
    /* 打印时只留纸上那一份，界面上的工具条/标签页/表格滚动都不跟着出来 */
    #login-overlay, #app, #modal-overlay { display: none !important; }
    #print-root { display: block !important; width: 100%; }
    html, body { background: #fff; margin: 0; padding: 0; }

    /* @page margin:0 让 Chrome/Edge 隐藏默认页眉页脚（日期+标题）；
       A5 横向：210mm × 148mm，纸边距挪到 .print-sheet 的 padding */
    @page { size: A5 landscape; margin: 0; }

    .print-sheet {
        width: 100%;
        box-sizing: border-box;
        position: relative;
        padding: 10mm 8mm;
        font-family: "Microsoft YaHei", "SimSun", sans-serif;
        color: #000;
        -webkit-print-color-adjust: exact;
        print-color-adjust: exact;
    }

    /* 公司抬头 + 右上角打印配图（2026-11-05 扩到所有单据类型；11-06 改「右上角小方块阵」）。
       图绝对定位、不占文本流，公司名和地址照旧整张纸居中；没传图时这一段根本不生成，
       纸上和以前一模一样。内置版式 / 合同 / 对帐单用 .print-company-header 当支点，
       Excel 模板用 .print-qr-host；图由 app.js 的 printImagesHtml 统一生成。 */
    .print-company-header { position: relative; text-align: center; margin-bottom: 8px; }
    .print-company-name { font-size: 22px; font-weight: 700; letter-spacing: 2px; }
    .print-company-address { font-size: 12px; margin-top: 4px; }
    .print-company-phone { font-size: 12px; }
    /* 绑了 Excel 模板的那张纸没有 .print-company-header，用这一层当定位支点。 */
    .print-qr-host { position: relative; width: 100%; }
    .print-qr-host .print-qrcodes { top: 0; }
    /* 右上角固定排成「2 列」的小网格：1~2 张一行、3~4 张两行，图都锁在右上角这一块，
       不再像原来 flex 一行硬挤 4 张那样把版面撑宽 / 换行顶到标题。贴右缘、跟公司名同一
       水平带，抬头文字仍整张纸居中。 */
    /* 没用可视化编辑器、按老规矩存的图：仍排在抬头右侧默认网格。
       这一层现在贴在 .print-sheet 上（不再是抬头内部），top/right 按纸张内边距对齐。 */
    .print-qrcodes {
        position: absolute; top: 70px; right: 8mm;
        display: grid;
        grid-template-columns: repeat(2, 90px);
        gap: 8px;
        justify-items: center;
        align-content: start;
    }
    /* 白底：Excel 模板那支右上角可能有模板自己的字，别让它从图缝里透出来 */
    .print-qr { width: 90px; text-align: center; background: #fff; }
    /* 方框恒 90×90，图铺满（cover）、多出来的边裁掉：不管上传的原图多大、多宽多窄，
       纸上每一张都同尺寸 */
    .print-qr img { display: block; width: 90px; height: 90px; object-fit: cover; }
    /* 没填名字的图不留一行空标签 */
    .print-qr-label { font-size: 10px; line-height: 1.2; margin-top: 2px; word-break: break-all; }
    .print-qr-label:empty { display: none; }

    /* 可视化编辑器摆好位后存下来的图：整张纸一层绝对定位，每张按「占纸比例」摆。
       inset 对齐纸张内边距（10mm 8mm），和设置页预览画布（也只算内容区）一一对应。 */
    .print-img-free { position: absolute; left: 8mm; top: 10mm; right: 8mm; bottom: 10mm; pointer-events: none; }
    /* 框按宽度定、强制 1:1 正方形：高度不再吃「占纸高的百分比」（纸高是内容撑的，会偏短，
       算出来的框偏扁、cover 就把方图上下裁了 → 削顶）。图片用 contain 兜底，哪怕来源不是方图
       也整张显示、不裁。 */
    .print-img-free .print-qr { position: absolute; background: #fff; aspect-ratio: 1 / 1; }
    .print-img-free .print-qr img { display: block; width: 100%; height: 100%; object-fit: contain; }
    .print-img-free .print-qr-label { position: absolute; left: 0; right: 0; top: 100%; margin-top: 2px; }

    /* 合同章（2026-11-06 禅道 #60）：只盖销售合同，并且锁死压在「供方」那一栏上。
       锚定到 .contract-parties-wrap 的左半边（供方列），不是浮在整张纸按高度百分比瞎猜——
       那样明细表一长，供方资料被顶到纸的哪个高度都不确定，章就会漂走。
       现在章跟着供方那块走：x/y/w 是占这左半框的比例，永远在供方资料上面。 */
    .contract-parties-wrap { position: relative; }
    .print-seal { position: absolute; left: 0; top: 0; right: 50%; bottom: 0; pointer-events: none; z-index: 5; }
    /* 印章锁死在「供方」这一块框内：宽度/高度都不许超出，超出就等比缩（contain）。
       之前只写了 height:auto、没封顶，章一大就顶出供方框。 */
    .print-seal img { position: absolute; display: block; height: auto; max-width: 100%; max-height: 100%; object-fit: contain; }

    /* 标题 */
    .print-title { font-size: 24px; font-weight: 700; text-align: center; letter-spacing: 8px; margin: 12px 0; }

    /* 单据信息（客户/编号左右分布） */
    .print-doc-info { display: flex; justify-content: space-between; font-size: 12px; margin-bottom: 10px; }
    .print-doc-info-left div, .print-doc-info-right div { margin: 2px 0; }

    /* 表格。字号写在表上、不写在格子上（2026-11-07 禅道 #69）：
       原来 th/td 自己钉着 11px，固定抬头里那一格字号是挂在 <table> 的内联 style 上的，
       被这条更具体的规则一句句顶掉 —— 填了 18 纸上还是 11。挪到表这一层，
       格子继承，内联那一句才落得下去；不填的照旧 11px，一张老纸都不变。 */
    .print-table { width: 100%; border-collapse: collapse; table-layout: auto; font-size: 11px; }
    .print-table thead { display: table-header-group; }   /* 明细跨页时每页都带表头 */
    .print-table th, .print-table td {
        border: 1px solid #000;
        padding: 4px 6px;
        text-align: left;
        word-break: break-all;
    }
    .print-table th { font-weight: 600; text-align: center; }
    .print-table .c-num { text-align: right; white-space: nowrap; }
    .print-table .c-wide { min-width: 130px; }

    /* 合计行 */
    .print-total-row { font-weight: 600; }
    .print-total-row td { padding: 6px; }

    /* 对帐单的第一行「上期结欠」和末行「本期结欠」：上下各压一道线，纸上一眼找到 */
    .print-open-row { font-weight: 600; background: #f2f2f2; }
    .print-open-row td { padding: 6px; border-top: 1px solid #000; }

    /* 银行信息 */
    .print-bank { font-size: 12px; margin-top: 10px; }

    /* 条款 */
    .print-terms { font-size: 11px; margin-top: 8px; }
    .print-term { margin: 2px 0; }

    /* 出货单章（2026-11-10）：只盖「送货单位及经手人」那半格签字区。
       和合同章同一套 x/y/w，但锚定框换成这半格（设置页那张小纸画的就是它）：
       章跟着签字区走，明细表再长也不会漂。40px 是 .print-sign 两列之间的 gap。
       签字行本来只有一行文字高，章框若吃 100% 会被压成十几像素，和设置页摆好的
       大小对不上。这里把章框定成 2.6:1（和设置页预览框的 aspect 同一个数），
       并只在配了章的那张纸上撑出等高留白：没配章的纸一字不变。 */
    .print-sign-wrap { position: relative; }
    .print-sign-wrap.has-ship-seal { padding-bottom: calc((100% - 40px) * 0.1923); }
    .print-seal-ship { position: absolute; left: 0; top: 0;
                       width: calc((100% - 40px) / 2); aspect-ratio: 2.6;
                       pointer-events: none; z-index: 5; }
    .print-seal-ship img { position: absolute; display: block; height: auto;
                           max-width: 100%; max-height: 100%; object-fit: contain; }

    /* 签收行 */
    .print-sign { display: flex; gap: 40px; margin-top: 20px; font-size: 12px; }
    .print-sign div { flex: 1; text-align: center; }

    /* 签收日期 */
    .print-sign-date { display: flex; gap: 40px; margin-top: 8px; font-size: 12px; }
    .print-sign-date div { flex: 1; }

    /* 联次侧栏（禅道 #41，样张右边那四条）：白联自存/红联客户/黄联收据/绿联财务 */
    .print-sheet.has-sidebar { position: relative; padding-right: 26px; }
    .print-sidebar { position: absolute; top: 96px; right: 0; width: 24px; }
    .print-sidebar div {
        border: 1px solid #000;
        border-bottom: none;
        padding: 8px 0;
        writing-mode: vertical-rl;
        text-orientation: upright;
        letter-spacing: 2px;
        font-size: 11px;
        text-align: center;
        background: #fff;
    }
    .print-sidebar div:last-child { border-bottom: 1px solid #000; }

    /* 银行行：样张里那条带框的银行卡行（只有匹配抬头的单子才带框，老打印不动） */
    .print-bank { font-size: 12px; margin-top: 10px; }
    .print-bank.boxed { border: 1px solid #000; padding: 5px 6px; }

    /* 销售合同（禅道 #42）：供方/需方两栏 + 物料清单 + 八条条款 */
    .contract-sheet .print-company-name { text-align: center; }
    .contract-head { width: 100%; border-collapse: collapse; margin-bottom: 8px; }
    .contract-head td { border: 1px solid #000; padding: 4px 6px; font-size: 12px; }
    .contract-items { margin-bottom: 0; }
    .contract-clauses { font-size: 11px; margin-top: 10px; line-height: 1.7; }
    .contract-parties { width: 100%; border-collapse: collapse; margin-top: 12px; table-layout: fixed; }
    .contract-parties td {
        border: 1px solid #000;
        vertical-align: top;
        padding: 5px 8px;
        font-size: 11px;
        line-height: 1.6;
        width: 50%;
    }
}

/* ============================================================================
   V5.9 财务模块：顶部「资材 / 销售 / 财务」切换 + 快捷入口分组
   切换栏压在渐变色工具条上，用半透明白描边 + 选中反白，和平时的菜单项同一套语言。
   ============================================================================ */
.mod-switch {
    display: flex;
    align-items: center;
    gap: 2px;
    padding: 2px;
    background: rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(255, 255, 255, 0.25);
    border-radius: 4px;
}

.mod-switch button {
    background: transparent;
    border: none;
    color: rgba(255, 255, 255, 0.85);
    padding: 3px 14px;
    border-radius: 3px;
    cursor: pointer;
    font-size: 13px;
}

.mod-switch button:hover {
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
}

.mod-switch button.active {
    background: #fff;
    color: #1e3a5f;
    font-weight: bold;
}

/* 顶栏中心页签 + 侧边栏菜单：当前登录人还有几件没办完的事（2026-11-09）。
   数字直接来自业务表，处理完一张单就少一件；没待办时整颗角标不画，
   不挂一个空红圈在那儿当背景噪声。 */
.mod-switch button { position: relative; }
.nav-tree .item { position: relative; }
.nav-tree .item.has-todo { padding-right: 42px; }

/* 顶栏铃铛上的未读数用同一份外观，不另抄一套尺寸/颜色 */
.todo-badge, .notif-count {
    position: absolute;
    min-width: 20px;
    height: 20px;
    padding: 0 5px;
    border-radius: 10px;
    background: #e53935;
    color: #fff;
    font-size: 12px;
    line-height: 20px;
    font-weight: 700;
    text-align: center;
    white-space: nowrap;
    box-sizing: border-box;
    /* 红点自己就是「看是哪几张单」的入口，不能让它把点击漏给底下的页签/菜单 */
    pointer-events: auto;
    cursor: pointer;
    z-index: 2;
}
.mod-switch button > .todo-badge,
.toolbar .notif-btn > .notif-count {
    top: -9px;
    right: -7px;
    box-shadow: 0 0 0 2px #1e3a5f;
}
.mod-switch button.active > .todo-badge {
    box-shadow: 0 0 0 2px #fff;
}
.nav-tree .item > .todo-badge {
    top: 50%;
    right: 8px;
    transform: translateY(-50%);
}
:root[data-theme="dark"] .todo-badge { background: #ef4444; }
.todo-badge:hover { filter: brightness(1.12); outline: 2px solid rgba(229,57,53,.35); outline-offset: 1px; }

/* 点红点弹出来的待办清单：一行一张单，单号最显眼，整行可点 */
.todo-row { cursor: pointer; }
.todo-row:hover { background: rgba(37,99,235,.09); }
.todo-no { font-weight: 600; color: #1d4ed8; white-space: nowrap; }
:root[data-theme="dark"] .todo-no { color: #93c5fd; }

/* ---------------------------------------------------------------------------
   顶栏「找功能」：输入关键字模糊搜页名 / 分组 / 中心 / 同义词，点一行直达。
   独立浮层，z-index 在通用弹窗（2000）之上、新手引导（5000）之下。
   --------------------------------------------------------------------------- */
.toolbar .nav-search-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 4px 10px;
    font-size: 12px;
    white-space: nowrap;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(203, 213, 224, 0.55);
    border-radius: 4px;
    color: #fff;
    cursor: pointer;
}
.toolbar .nav-search-btn:hover {
    background: rgba(255, 255, 255, 0.28);
    border-color: rgba(226, 232, 240, 0.85);
}
.toolbar .nav-search-btn .ns-kbd {
    font-size: 10px;
    padding: 1px 5px;
    border: 1px solid rgba(255, 255, 255, 0.35);
    border-radius: 3px;
    color: rgba(255, 255, 255, 0.8);
}

.nav-search-layer {
    position: fixed;
    inset: 0;
    z-index: 4500;
    background: rgba(15, 23, 42, 0.45);
    display: flex;
    justify-content: center;
    align-items: flex-start;
    padding: 76px 16px 16px;
}
.ns-panel {
    width: min(680px, 100%);
    max-height: 76vh;
    display: flex;
    flex-direction: column;
    background: var(--panel, #fff);
    border: 1px solid var(--border, #d7dee8);
    border-radius: 6px;
    box-shadow: 0 18px 48px rgba(15, 23, 42, 0.28);
    overflow: hidden;
}
.ns-input-line {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 10px 12px;
    border-bottom: 1px solid var(--border, #e3e8ef);
}
.ns-icon { font-size: 16px; }
.ns-input-line .ipt { flex: 1; min-width: 0; font-size: 15px; }
.ns-hint {
    padding: 6px 12px;
    font-size: 12px;
    color: var(--muted, #667);
    border-bottom: 1px solid var(--border, #e3e8ef);
}
.ns-hint:empty { display: none; }
.ns-results { flex: 1; overflow: auto; padding: 6px; }
.ns-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 10px;
    border: 1px solid transparent;
    border-radius: 4px;
    cursor: pointer;
}
.ns-item:hover, .ns-item.on {
    background: rgba(37, 99, 235, 0.10);
    border-color: rgba(37, 99, 235, 0.35);
}
.ns-item .ns-name { font-size: 14px; font-weight: 600; color: var(--text, #1f2937); }
.ns-item .ns-path { margin-left: auto; font-size: 12px; color: var(--muted, #667); white-space: nowrap; }
.ns-item .ns-go { font-size: 12px; color: #2563eb; }
.ns-empty { padding: 18px; text-align: center; color: var(--muted, #667); font-size: 13px; }
.ns-foot {
    padding: 7px 12px;
    font-size: 11px;
    color: var(--muted, #667);
    background: var(--panel-alt, #f7f9fc);
    border-top: 1px solid var(--border, #e3e8ef);
}
@media (max-width: 768px) {
    .toolbar .nav-search-btn .ns-label, .toolbar .nav-search-btn .ns-kbd { display: none; }
    .nav-search-layer { padding-top: 56px; }
    .ns-item .ns-path { display: none; }
}

/* 全站表头：单击三态排序 / 双击缩列（2026-11-09）。
   手型只给数据表格，箭头只挂在真正生效的那一列上，不摆一排假箭头。 */
table.data-table thead th,
table.doc-items-table thead th { cursor: pointer; user-select: none; }
table thead th.th-sort-asc::after,
table thead th.th-sort-desc::after {
    font-size: 10px;
    font-weight: 700;
    color: #2563eb;
    margin-left: 3px;
}
table thead th.th-sort-asc::after { content: '▲'; }
table thead th.th-sort-desc::after { content: '▼'; }
table thead th.th-fitted { color: #1d4ed8; }
:root[data-theme="dark"] table thead th.th-sort-asc::after,
:root[data-theme="dark"] table thead th.th-sort-desc::after { color: #93c5fd; }

/* 快捷入口：包一层只为整组显隐，display:contents 让它不改变工具条原有排布 */
.quick-btns { display: contents; }

/* 财务页面共用：余额汇总条（平涂 + 1px 描边，不做卡片） */
.fin-summary {
    display: flex;
    flex-wrap: wrap;
    gap: 0;
    border: 1px solid var(--border);
    background: var(--panel);
    margin-bottom: 8px;
}

.fin-summary .fin-kv {
    padding: 6px 14px;
    border-right: 1px solid var(--border);
    font-size: 12px;
    color: var(--muted);
    min-width: 120px;
}

.fin-summary .fin-kv:last-child { border-right: none; }

.fin-summary .fin-kv b {
    display: block;
    color: var(--text);
    font-size: 14px;
    font-weight: 600;
    margin-top: 2px;
}

.fin-balance-pos b { color: #c0392b; }   /* 还欠着：红 */
.fin-balance-neg b { color: #1a7f37; }   /* 收多了：绿 */

/* 在建页：说明为什么这里还是空的，并把已经能用的替代路径点出来 */
.fin-wip {
    border: 1px solid var(--border);
    background: var(--panel);
    padding: 14px 16px;
    font-size: 13px;
    color: var(--text);
}

.fin-wip .fin-wip-tag {
    display: inline-block;
    border: 1px solid var(--border);
    background: var(--head);
    padding: 1px 8px;
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 8px;
}

.fin-wip ul { margin: 8px 0 0 18px; }
.fin-wip li { margin: 3px 0; }

/* 财务弹窗里的说明行 + 明细弹窗里的小标题 */
.fin-tip { font-size: 12px; color: var(--muted); line-height: 1.5; }

/* 银行流水弹窗里期初那一行：压在表头下面当"底子"，用淡底和上面的笔次分开 */
.fin-flow-opening td { background: color-mix(in srgb, var(--head) 78%, transparent); font-weight: 600; }

.fin-block-title {
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
    background: var(--head);
    border: 1px solid var(--border);
    border-bottom: none;
    padding: 4px 8px;
    margin-top: 10px;
}

/* 明细里退货/冲销那行：负号用红色，一眼看出这张单是在减欠款 */
.fin-neg { color: #c0392b; }
.fin-no-party { color: var(--muted); }

/* 余额页底下那句"有 N 张单没写往来单位"：不合进任何一家，但必须在屏幕上看得见 */
.fin-unassigned {
    border: 1px solid var(--border);
    border-left: 3px solid #c0392b;
    background: var(--head);
    padding: 6px 10px;
    margin-top: 8px;
    font-size: 12px;
    color: var(--text);
    line-height: 1.6;
}

/* 「在建」页里那些跳转链接：排成能一眼点到的列表，不是堆在一起的蓝字 */
.fin-wip-jump { padding-left: 0; }

/* 挑单据那张小表（收款核销 / 发票关联共用一份）：
   平涂 + 1px 描边 + 方角，不做圆角卡片——这一屏要逐行比数，糊成一片就数不清了 */
.fdp {
    border: 1px solid var(--border);
    background: var(--panel);
    margin-top: 6px;
    max-height: 260px;
    overflow-y: auto;
}

.fdp table { margin: 0; }
.fdp thead th { position: sticky; top: 0; background: var(--head); z-index: 1; }

/* 面额 vs 已填合计那一行：四种口气各有各的颜色，别只靠一句话 */
.fdp-total {
    border-top: 1px solid var(--border);
    padding: 5px 10px;
    font-size: 12px;
    line-height: 1.6;
    background: var(--panel);
}

.fdp-total b { font-weight: 600; }
.fdp-idle { color: var(--muted); }
.fdp-ok   { color: #1a7f37; }
.fdp-warn { color: #8a5a00; background: #fff8e6; }
.fdp-over { color: #c0392b; background: #fdecea; font-weight: 600; }

/* 预检报告底下那道勾 + 那颗按钮：同一行，点完不用滚 */
.fdp-check {
    border: 1px solid var(--border);
    background: var(--head);
    padding: 8px 10px;
    margin-top: 8px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 13px;
}

.fdp-check label { display: flex; align-items: center; gap: 6px; cursor: pointer; }

/* 试算派生出来的那几行：单号后面挂个角标，和真录的分开 */
.fin-demo-tag {
    display: inline-block;
    border: 1px solid #8a5a00;
    color: #8a5a00;
    background: #fff8e6;
    font-size: 11px;
    line-height: 1.4;
    padding: 0 4px;
    margin-left: 5px;
    vertical-align: 1px;
}

/* 对帐单里落在区间外的行：留着让人看见那笔不是这个月的事，但不跟着抢注意力 */
.fin-out-range td { color: var(--muted); background: #fafbfc; }

/* ===========================================================================
 * 「系统 → 角色权限」矩阵 + 「系统 → 分支机构」名录
 * 这一屏三百多格，靠的是行对齐和分组底色，不是卡片投影：
 * 平涂 + 1px 描边 + 方角，套成圆角卡片会把行与行糊成一片，反倒数不清勾。
 * ========================================================================= */

/* 面板里普通的说明句（不是报错、不是空状态，就是写在格子中间的一句话） */
.panel-plain {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.7;
    margin: 8px 0;
}

/* 两列格子里那句要占满一整行的（备注、重置密码那种长说明） */
.form-field.wide {
    grid-column: 1 / -1;
}

/* ===========================================================================
 * 平台控制台：公司详情页 / 垃圾箱
 * 还是平涂 + 1px 描边 + 方角，这一片只补三样：功能勾选那一列、页头那排状态、
 * 危险区那一片底色。名录里「使用期限」那一列按还剩几天分三档，一眼扫得出来。
 * ========================================================================= */

/* 功能清单：一项一行，名称在左、说明跟在后面。
   不用卡片不用圆角——五块功能要一眼比着勾，糊成一张张卡反倒数不清。 */
.feat-list {
    border: 1px solid var(--border);
    background: var(--panel);
}
.feat-row {
    display: flex;
    align-items: baseline;
    gap: 8px;
    padding: 7px 10px;
    border-bottom: 1px solid var(--border);
    cursor: pointer;
    background: var(--panel);
}
.feat-row:last-child { border-bottom: none; }
.feat-row:hover { background: #f4f8fd; }
.feat-row input[type=checkbox] {
    margin: 0;
    flex-shrink: 0;
    transform: translateY(1px);
    cursor: pointer;
}
/* 在垃圾箱里的那一家：整块勾不动，底色收一档，让人知道这一格不是漏了 */
.feat-row.disabled,
.feat-row:has(input:disabled) {
    background: #f7f9fc;
    cursor: default;
}
.feat-row.disabled .feat-name,
.feat-row:has(input:disabled) .feat-name { color: var(--muted); }
.feat-name {
    font-size: 13px;
    font-weight: 600;
    min-width: 110px;
    color: var(--text);
}
.feat-desc {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.6;
}

/* 详情页页头那一块：比别的面板重一档底色，因为它同时是"这是哪一家"的确认条 */
.cd-head {
    background: #f6f9fd;
}

/* 删除那一块：方角、1px 描边，只把描边和标题左边那根条换成红的。
   不做大红底——这一格是"想清楚了再点"，不是"这里着火了"。 */
.cd-danger {
    border-color: #e3b5b0;
}
.cd-danger > .panel-title {
    border-left: 3px solid #c0392b;
    padding-left: 8px;
}

/* 公司详情：左侧二级导航（锚点跳转 + 滚动高亮），免得整页往下拖 */
.cd-body { display: flex; gap: 18px; align-items: flex-start; }
.cd-nav {
    position: sticky; top: 14px;
    flex: 0 0 168px; align-self: flex-start;
    display: flex; flex-direction: column; gap: 2px;
    background: var(--panel); border: 1px solid var(--border);
    border-radius: 8px; padding: 8px; max-height: calc(100vh - 80px); overflow: auto;
}
.cd-nav-item {
    padding: 7px 10px; border-radius: 6px; font-size: 13px; color: var(--muted);
    cursor: pointer; text-decoration: none; border-left: 3px solid transparent; user-select: none;
}
.cd-nav-item:hover { background: var(--head); color: var(--text); }
.cd-nav-item.active {
    background: rgba(37, 99, 235, .12); color: var(--accent);
    border-left-color: var(--accent); font-weight: 600;
}
.cd-nav-danger { color: #c0392b; }
.cd-nav-danger:hover { background: rgba(192, 57, 43, .08); }
.cd-sections { flex: 1 1 auto; min-width: 0; }
.cd-sec { scroll-margin-top: 16px; }
@media (max-width: 760px) {
    .cd-body { flex-direction: column; gap: 12px; }
    .cd-nav { position: static; flex: none; flex-direction: row; flex-wrap: wrap; width: 100%; max-height: none; }
    .cd-nav-item { border-left: none; border-bottom: 2px solid transparent; }
    .cd-nav-item.active { border-left: none; border-bottom-color: var(--accent); }
}

/* 名录里「使用期限」那一列：已到期最刺眼，7 天内提醒，不限期最淡 */
.cp-expiry { color: var(--text); }
.cp-expiry.is-expired {
    color: #c0392b;
    font-weight: 600;
    background: #fdf0ee;
}
.cp-expiry.is-soon {
    color: #8a5a00;
    font-weight: 600;
    background: #fff8e6;
}

/* 登录链接、库文件路径、垃圾箱目录：原样选中就能复制，不做等宽衬线那种排版 */
code.copyable {
    font-family: Consolas, "Courier New", monospace;
    font-size: 12px;
    color: #1c2430;
    background: #eef2f7;
    border: 1px solid var(--border);
    padding: 1px 5px;
    user-select: all;
    word-break: break-all;
}

/* 到期只读时被按掉的那几颗（app.js 里 applyReadonlyGates 挂的类）。
   label.btn 那种"拍照 / 选择图片"是包着 input 的，disabled 属性压不住它，
   只能连点击一起收掉；title 上那句原因还在，悬停能读到。 */
.ro-off {
    opacity: .45;
    cursor: not-allowed;
}
label.ro-off,
input[type=file].ro-off {
    pointer-events: none;
}

/* 矩阵顶上那一排：分支机构 / 角色 / 编码 / 名称 / 备注 */
.perm-head {
    display: flex;
    flex-wrap: wrap;
    gap: 10px 20px;
    align-items: flex-end;
    padding: 10px 12px;
    border: 1px solid var(--border);
    background: var(--head);
    margin-bottom: 8px;
}

.perm-head .ph-field {
    display: flex;
    flex-direction: column;
    gap: 3px;
}

.perm-head .ph-field.wide {
    flex: 1;
    min-width: 240px;
}

.perm-head .ph-field label {
    font-size: 12px;
    color: var(--muted);
}

.perm-head .ph-field input,
.perm-head .ph-field select {
    height: 28px;
    padding: 2px 6px;
    border: 1px solid var(--border);
    background: #fff;
    font-size: 13px;
}

.perm-head .ph-field .btn {
    margin-top: 2px;
}

/* 当前进的是哪一家的角色：这一格不给改（改了就去别家了，得重新登录） */
.perm-head .ph-branch {
    height: 28px;
    line-height: 28px;
    font-weight: 600;
    padding: 0 8px;
    border: 1px solid var(--border);
    background: #fff;
    min-width: 140px;
}

.perm-note {
    font-size: 12px;
    color: var(--muted);
    line-height: 1.7;
    margin: 0 0 10px;
}

/* 矩阵上方工具栏：搜索 + 全部展开/折叠 */
.perm-toolbar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0 0 10px;
    padding: 8px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-radius: 4px;
}
.pm-search {
    flex: 1;
    max-width: 320px;
    padding: 5px 10px;
    border: 1px solid var(--border);
    border-radius: 4px;
    font-size: 13px;
}
.pm-toolbar-hint {
    font-size: 12px;
    color: var(--muted);
}

/* 矩阵本体 */
.perm-matrix {
    border: 1px solid var(--border);
    background: #fff;
}

.pm-group {
    background: #dfe6f0;
    color: #33415a;
    font-size: 12px;
    font-weight: 600;
    padding: 4px 10px;
    border-bottom: 1px solid var(--border);
    border-top: 1px solid var(--border);
    user-select: none;
}
.pm-group-arrow {
    display: inline-block;
    width: 14px;
    font-size: 10px;
    color: #6b7a90;
}
.pm-group.collapsed {
    background: #e9eef5;
}

.pm-group:first-child {
    border-top: none;
}

.pm-row {
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 5px 10px;
    border-bottom: 1px solid #eef1f5;
}

.pm-row:hover {
    background: #f7f9fc;
}

.pm-no {
    flex: none;
    width: 22px;
    text-align: right;
    color: var(--muted);
    font-size: 12px;
    line-height: 20px;
}

.pm-mod {
    flex: none;
    width: 150px;
    font-weight: 600;
    line-height: 20px;
}

.pm-only {
    font-style: normal;
    font-size: 11px;
    color: #6a4bb8;
    border: 1px solid #d6cbf2;
    background: #f4f0fd;
    padding: 0 4px;
    margin-left: 4px;
}

.pm-items {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-wrap: wrap;
    gap: 2px 14px;
}

.pm-item {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    line-height: 20px;
    cursor: pointer;
    white-space: nowrap;
}

.pm-item input {
    width: 14px;
    height: 14px;
    margin: 0;
    flex: none;
}

/* 参考图里那批红字（危险项：改均价、锁库存、禁改条款…）照原样标红 */
.pm-item.red .pi-txt {
    color: #c0392b;
}

/* 灰的是这一版还没有对应功能的勾：点了会存这一行，但后端没有东西去拦。
   摆着但不装作生效，鼠标停在上面能看到"拦在哪/为什么还没生效"。 */
.pm-item.ineffective .pi-txt {
    color: #a9b2bf;
}

.pm-item.ineffective.red .pi-txt {
    color: #d08b84;
}

/* 平台运营专用那几格：点不动，角色勾了也不给 */
.pm-item.locked {
    cursor: not-allowed;
    background: #f4f0fd;
    padding: 0 3px;
}

.pm-item.locked .pi-txt {
    color: #8b7bb0;
}

/* 行内「全选」放在这一行末尾，和勾项之间用一条竖线隔开，不然会被当成又一个勾项 */
.pm-all {
    display: flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    font-weight: 600;
    line-height: 20px;
    padding-left: 12px;
    border-left: 1px solid var(--border);
    margin-left: 4px;
    cursor: pointer;
}

/* 「查看权限」弹窗：按模块分组列已勾项，只读一览 */
.perm-overview {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 60vh;
    overflow-y: auto;
}
.po-group {
    border: 1px solid var(--border);
    border-radius: 4px;
    overflow: hidden;
}
.po-group-title {
    background: #dfe6f0;
    color: #33415a;
    font-size: 12px;
    font-weight: 600;
    padding: 5px 10px;
}
.po-mod {
    padding: 6px 10px;
    font-size: 13px;
    line-height: 1.8;
    border-bottom: 1px solid #eef1f5;
}
.po-mod:last-child { border-bottom: none; }
.po-mod strong { color: var(--text); margin-right: 6px; }
.po-grant {
    display: inline-block;
    background: #e8f5e9;
    color: #2e7d32;
    border: 1px solid #c8e6c9;
    border-radius: 3px;
    padding: 1px 6px;
    font-size: 12px;
    margin: 2px 3px 2px 0;
}

/* 顶上那句"改了哪几格/存完没有"：状态行要带因果，不只写"已改" */
.perm-status {
    display: block;
    font-size: 12px;
    line-height: 1.7;
    color: var(--text);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
    background: #f7f9fc;
    padding: 6px 10px;
    margin-top: 10px;
    min-height: 18px;
}

.perm-status:empty {
    display: none;
}

.ps-dirty {
    color: #c0392b;
    font-weight: 600;
}

.ps-ok {
    color: #1a7f4b;
    font-weight: 600;
}

.ps-right {
    float: right;
    color: var(--muted);
}

/* 弹窗里那句说明 + 弹窗自己的报错位置 */
.modal-note {
    font-size: 12px;
    color: var(--muted);
    margin: 0 0 8px;
}

.modal-err {
    font-size: 12px;
    color: #c0392b;
    margin: 10px 0 0;
    min-height: 16px;
}

.modal-err:empty {
    display: none;
}

/* 密码重置结果弹窗 */
.pwd-reset-result {
    padding: 10px 0;
}

.pwd-box {
    background: #f8f9fa;
    border: 2px solid var(--accent);
    padding: 12px 16px;
    font-family: 'Courier New', monospace;
    font-size: 18px;
    font-weight: bold;
    letter-spacing: 2px;
    margin: 12px 0;
    text-align: center;
    user-select: all;
}

.pwd-hint {
    font-size: 12px;
    color: var(--muted);
    margin-top: 8px;
}

.log-detail {
    white-space: normal;
    max-width: 560px;
    line-height: 1.6;
}

/* 表单格子底下那两行小字：说清这一格填错的后果，不藏进悬停提示里 */
.field-hint {
    font-size: 11px;
    color: var(--muted);
    line-height: 1.6;
    margin: 4px 0 0;
}

/* 名录表里那一列按钮 */
.row-btns {
    white-space: nowrap;
}

.row-btns .btn {
    margin: 0 4px 2px 0;
}

/* 会丢数据的那颗按钮：红色描边，和「保存」那种蓝的分开 */
.btn.danger {
    color: #c0392b;
    border-color: #e2b0aa;
    background: #fdf3f2;
}

.btn.danger:hover {
    background: #fbe9e7;
}

.tag-on {
    color: #1a7f4b;
    font-weight: 600;
}

.tag-off {
    color: #c0392b;
    font-weight: 600;
}

/* 收发存汇总 / ABC 分类（2026-11-04）：金额着色 + ABC 色标 */
.amt-in { color: #1a7f4b; }
.amt-out { color: #c0392b; }
/* 2026-11-04 晚补一刀：这套色标类和「整行着色」的行类撞名了 ——
   abc-B / abc-C 同时也是呆滞料报表 rowCls、效期/采购到期/缺料/IQC/巡检那些
   <tr class="abc-…"> 的行类。色标是给格子里 <span> 用的，display:inline-block
   一旦跟着类名糊到 <tr> 上，整张表就被打碎成一排排米黄色圆角小方块
   （他截图里那副怪样子，"有些页面这个风格很奇怪"）。
   :not(tr) 把两套语义隔开：格子里的色标照旧是药丸，行着色只走下面那两条 tr 规则；
   tr.abc-A（比价页「最低价」那一行）本来就没有行着色规则，照旧白底。 */
.abc-A:not(tr) { display: inline-block; min-width: 18px; text-align: center; padding: 0 5px;
    background: #fdecec; color: #c0392b; border: 1px solid #f5c2c0; border-radius: 4px; font-weight: 700; }
.abc-B:not(tr) { display: inline-block; min-width: 18px; text-align: center; padding: 0 5px;
    background: #fff7e6; color: #b7791f; border: 1px solid #f0d9a8; border-radius: 4px; font-weight: 700; }
.abc-C:not(tr) { display: inline-block; min-width: 18px; text-align: center; padding: 0 5px;
    background: #eef2f7; color: #5a6b7b; border: 1px solid #d4dce6; border-radius: 4px; font-weight: 700; }
/* 库位/批次管理：过期/临期行整行着色 */
tr.abc-C { background: #fdecec; }
tr.abc-B { background: #fff7e6; }

/* ============================================================
   统一页面结构（2026-11-04 补样式）：panel-head / panel-toolbar / panel-body /
   ipt / group-title / data-table / table-wrap。这批类一直被页面用，但样式
   一直没定义——新页面摆出来是裸的，旧页面（项目/售后等）的表格也只有默认框。
   按 .panel / .panel-title 的既有观感补齐，全部走主题变量，白/黑主题都自适应。
   ============================================================ */
.panel-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid var(--border);
}
.panel-head .panel-title {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: var(--text);
}
.panel-head .panel-actions { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

.panel-toolbar {
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 8px;
    padding: 9px 14px;
    border-bottom: 1px solid var(--border);
    background: var(--head);
}
.panel-toolbar label { font-size: 12px; color: var(--muted); }

.panel-body { padding: 12px 14px; overflow-x: auto; }

.ipt {
    padding: 5px 9px;
    font-size: 13px;
    border: 1px solid var(--border);
    border-radius: 4px;
    background: var(--panel);
    color: var(--text);
}
.ipt:focus { outline: none; border-color: var(--accent); }
.ipt::placeholder { color: var(--muted); }

.group-title {
    margin: 14px 0 6px;
    font-size: 13px;
    font-weight: 600;
    color: var(--text);
}
.group-title:first-child { margin-top: 0; }

/* data-table：旧页面一直在用、样式一直缺失。补一份克制的——只有细线和表头底色，
   不加花哨效果，避免把既有页面的排版顶乱。 */
.data-table {
    width: 100%;
    border-collapse: collapse;
    font-size: 13px;
    color: var(--text);
}
.data-table th, .data-table td {
    padding: 6px 10px;
    border-bottom: 1px solid var(--border);
    text-align: left;
    vertical-align: middle;
}
.data-table th {
    background: var(--head);
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}
.data-table tbody tr:hover { background: var(--bg); }
.table-wrap { overflow-x: auto; }


/* ============================================================
   移动端适配：手机屏幕（< 768px）侧栏收成汉堡菜单，表格横向滚，弹窗占满宽
   ============================================================ */

/* 汉堡菜单按钮：桌面端隐藏 */
.hamburger-btn {
    display: none;
    background: rgba(255, 255, 255, 0.15);
    border: 1px solid rgba(255, 255, 255, 0.3);
    color: #fff;
    font-size: 20px;
    padding: 4px 10px;
    cursor: pointer;
    border-radius: 4px;
    line-height: 1;
}

.hamburger-btn:hover {
    background: rgba(255, 255, 255, 0.25);
}

/* 移动端遮罩：侧栏打开时盖住内容区 */
.nav-overlay {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.4);
    z-index: 99;
}

.nav-overlay.show {
    display: block;
}

/* ============================================================================
 * 单据拍照记录（入库单用）
 * ============================================================================ */

/* 单据列表：拍过照的单号旁一个小徽标，一眼看出哪张单有图 */
.photo-badge {
    display: inline-block;
    margin-left: 4px;
    padding: 0 5px;
    font-size: 11px;
    line-height: 16px;
    border-radius: 8px;
    background: #dbeafe;
    color: #1e3a5f;
    vertical-align: 1px;
    cursor: default;
}

.doc-photo-section {
    margin-top: 8px;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
}

.doc-photo-toolbar {
    display: flex;
    align-items: center;
    gap: 12px;
    margin-bottom: 12px;
}

.doc-photo-stats {
    font-size: 13px;
    color: #666;
}

.doc-photo-grid {
    display: grid;
    grid-template-columns: repeat(auto-fill, minmax(140px, 1fr));
    gap: 12px;
}

.doc-photo-item {
    background: #fff;
    border: 1px solid #ddd;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.doc-photo-item img {
    width: 100%;
    height: 120px;
    object-fit: cover;
    cursor: pointer;
    display: block;
}

.doc-photo-item img:hover {
    opacity: 0.85;
}

.doc-photo-info {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 6px 8px;
    font-size: 12px;
    border-top: 1px solid #eee;
}

.doc-photo-note {
    flex: 1;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
    color: #333;
}

.doc-photo-delete {
    background: none;
    border: none;
    color: #c44;
    font-size: 18px;
    cursor: pointer;
    padding: 0 4px;
    line-height: 1;
}

.doc-photo-delete:hover {
    color: #f00;
}

.doc-photo-empty {
    grid-column: 1 / -1;
    text-align: center;
    padding: 24px;
    color: #999;
    font-size: 13px;
}

/* 照片预览遮罩 */
.photo-preview-overlay {
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.75);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
}

.photo-preview-modal {
    background: #fff;
    border-radius: 6px;
    max-width: 90vw;
    max-height: 90vh;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

.photo-preview-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 16px;
    border-bottom: 1px solid #e0e0e0;
    font-size: 14px;
    color: #333;
}

.photo-preview-close {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #666;
    padding: 0 4px;
    line-height: 1;
}

.photo-preview-close:hover {
    color: #000;
}

.photo-preview-body {
    padding: 16px;
    overflow: auto;
    flex: 1;
}

.photo-preview-body img {
    max-width: 100%;
    max-height: 75vh;
    display: block;
    margin: 0 auto;
}

/* 手机端照片网格：两列 */
@media (max-width: 768px) {
    .doc-photo-grid {
        grid-template-columns: repeat(2, 1fr);
    }

    .doc-photo-item img {
        height: 100px;
    }
}

@media (max-width: 768px) {
    /* 汉堡按钮显示 */
    .hamburger-btn {
        display: inline-block;
    }

    /* 顶栏：只留标题 + 模块切换 + 汉堡菜单 + 操作人，快捷按钮藏掉 */
    .toolbar {
        flex-wrap: nowrap;
        gap: 6px;
        padding: 6px 8px;
    }

    .toolbar .title {
        font-size: 13px;
        flex-shrink: 0;
    }

    /* 模块切换按钮缩小 */
    .mod-switch button {
        padding: 3px 8px;
        font-size: 12px;
    }

    /* 快捷按钮行：手机上藏掉，导航交给侧栏 */
    .quick-btns {
        display: none !important;
    }

    /* 统计数字那行：单独一行，小字 */
    .toolbar .status-info {
        font-size: 11px;
        order: 10;
        width: 100%;
        margin-top: 4px;
        padding-top: 4px;
        border-top: 1px solid rgba(255, 255, 255, 0.15);
        text-align: center;
    }

    /* 操作人信息：简化 */
    .toolbar .user-box {
        margin-left: auto;
        font-size: 11px;
        gap: 4px;
    }

    .toolbar .user-box .branch-tag {
        display: none;
    }

    .toolbar .user-box .user-name {
        padding: 2px 6px;
        font-size: 11px;
    }

    .toolbar .logout-btn {
        padding: 3px 8px;
        font-size: 11px;
    }

    .toolbar .bug-report-btn {
        padding: 3px 8px;
        font-size: 11px;
    }

    /* 侧栏：默认隐藏，打开时绝对定位覆盖 */
    .nav-tree {
        position: fixed;
        top: 42px;
        left: -200px;
        width: 180px;
        height: calc(100vh - 42px);
        z-index: 100;
        transition: left 0.25s ease;
        box-shadow: 2px 0 8px rgba(0, 0, 0, 0.2);
    }

    .nav-tree.open {
        left: 0;
    }

    /* 内容区占满 */
    .main {
        flex-direction: column;
    }

    .tab-area {
        width: 100%;
    }

    /* 表格：横向滚动 */
    .content {
        padding: 8px;
    }

    table {
        display: block;
        overflow-x: auto;
        white-space: nowrap;
    }

    table thead {
        display: table-header-group;
    }

    table tbody {
        display: table-row-group;
    }

    /* 弹窗：占满宽度 */
    .modal {
        width: calc(100vw - 20px) !important;
        max-width: none !important;
        max-height: calc(100vh - 40px);
        overflow-y: auto;
    }

    .modal-body {
        padding: 10px;
    }

    /* 表单：label 和 input 竖排 */
    .form-row {
        flex-direction: column;
        align-items: flex-start;
        gap: 4px;
    }

    .form-row label {
        min-width: auto;
        width: 100%;
    }

    .form-row input,
    .form-row select,
    .form-row textarea {
        width: 100%;
    }

    /* 按钮组：换行堆叠 */
    .panel-actions {
        flex-wrap: wrap;
        gap: 6px;
    }

    .panel-actions .btn {
        flex: 1 1 auto;
        min-width: 80px;
    }

    /* 财务汇总栏：竖排 */
    .fin-summary {
        flex-direction: column;
        gap: 6px;
    }

    .fin-summary > div {
        width: 100%;
    }

    /* 对帐单那几格汇总 */
    .fin-stmt-summary {
        grid-template-columns: 1fr !important;
    }

    /* 单据明细： facts 竖排 */
    .detail-facts {
        flex-direction: column;
        gap: 6px;
    }

    /* 打印对帐单按钮 */
    .fin-stmt-actions {
        flex-wrap: wrap;
    }

    .fin-stmt-actions .btn {
        flex: 1 1 auto;
    }
}

/* 超小屏（< 480px）：按钮再小一点 */
@media (max-width: 480px) {
    .toolbar {
        padding: 4px 8px;
        gap: 6px;
    }

    .toolbar .title {
        font-size: 12px;
    }

    .content {
        padding: 6px;
    }

    .panel {
        padding: 8px;
    }

    .btn {
        padding: 5px 10px;
        font-size: 12px;
    }

    table {
        font-size: 12px;
    }

    th, td {
        padding: 4px;
    }
}

/* ============================================================================
 * 表头拖动换列（2026-10-28 他提的：拖第三列到第一列，下面的数据跟着走）
 *  参与拖动的表头由 app.js 打 .ord-usable（吃手型），拖起来那一列压暗，
 *  插到哪一边就在那一格左边/右边画一条竖线。
 *  回执 .pref-receipt 是右下角一条平贴的小横幅（固定定位，不用滚到那儿才看见），
 *  方角、1px 描边、跟着主题那组变量走，不铺黑底也不做卡片。
 * =========================================================================== */
thead th.ord-usable {
    cursor: grab;
}

thead th.ord-src {
    opacity: .45;
}

thead th.ord-drop-before {
    box-shadow: inset 3px 0 0 var(--accent);
}

thead th.ord-drop-after {
    box-shadow: inset -3px 0 0 var(--accent);
}

body.ord-dragging {
    user-select: none;
    cursor: grabbing;
}

body.ord-dragging thead th.ord-usable {
    cursor: grabbing;
}

.pref-receipt {
    position: fixed;
    right: 18px;
    bottom: 18px;
    z-index: 4200;
    max-width: 460px;
    padding: 9px 13px;
    background: var(--panel);
    border: 1px solid var(--ok, #16a34a);
    color: var(--text);
    font-size: 13px;
    line-height: 1.5;
    cursor: pointer;
}

.pref-receipt.pref-bad {
    border-color: #c0392b;
    color: #c0392b;
    background: var(--panel);
}

/* ============================================================================
 * 黑夜主题（顶栏 🌙 按钮切换，选择记 localStorage('theme')，进页面由
 * index.html 头部那段小脚本先套上，不会先白一下再黑）
 *
 * 做法：组件基本都吃 :root 那组变量，换主题 = 把变量整个换掉；
 * 下面单独点名的，是写死了白底/深字的少数派。
 * 状态色（草稿黄/成功绿/错误红）不换——那是语义不是皮肤。
 * 顶栏和侧栏本来就很深，两套主题里用同一副面孔，不跟着换。
 * ============================================================================ */
:root[data-theme="dark"] {
    --accent: #3b82f6;
    --border: #334155;
    --bg: #0f172a;
    --panel: #1e293b;
    --head: #243449;
    --text: #e2e8f0;
    --muted: #94a3b8;
}

/* 顶栏切换按钮本体 */
.theme-toggle {
    background: none;
    border: none;
    font-size: 16px;
    cursor: pointer;
    padding: 2px 6px;
    line-height: 1;
}

/* 登录页整段昼夜覆盖已撤：它现在自己带四套配色（见文件末尾 --lg-* 那一层），
   白天/黑夜那颗开关只管 #app 里面的界面，不管门外面这一张。 */

/* 表格里获得焦点的输入框：原来反白，夜里反黑 */
:root[data-theme="dark"] .items-table input:focus,
:root[data-theme="dark"] .items-table select:focus,
:root[data-theme="dark"] .si-grid td input[type="text"]:hover,
:root[data-theme="dark"] .si-grid td input[type="text"]:focus { background: #0f172a; }

/* 权限矩阵那一块写死的白 */
:root[data-theme="dark"] .perm-head .ph-field input,
:root[data-theme="dark"] .perm-head .ph-field select,
:root[data-theme="dark"] .perm-head .ph-branch { background: #0f172a; color: var(--text); }
:root[data-theme="dark"] .perm-matrix { background: var(--panel); }
:root[data-theme="dark"] .pm-group { background: #243449; color: var(--text); }

/* 入库单拍照区 */
:root[data-theme="dark"] .doc-photo-item { background: var(--head); border-color: var(--border); }
:root[data-theme="dark"] .doc-photo-info { border-top-color: var(--border); }
:root[data-theme="dark"] .doc-photo-note { color: var(--text); }
:root[data-theme="dark"] .photo-preview-modal { background: var(--panel); }
:root[data-theme="dark"] .photo-preview-header { color: var(--text); border-bottom-color: var(--border); }
:root[data-theme="dark"] .photo-preview-close { color: var(--muted); }

/* 兜底：漏网的输入控件统一沉成深色，免得夜里一块白斑。
   只点 #app 里的：登录遮罩在 #app 外面，它现在自己带四套配色（文件末尾那段），
   要是让这条兜底管着，白昼玻璃那套的浅底输入框会被沉成一块深夜蓝。 */
:root[data-theme="dark"] #app input,
:root[data-theme="dark"] #app select,
:root[data-theme="dark"] #app textarea {
    background-color: #0f172a;
    color: var(--text);
}

/* ============================================================================
 * 昼夜配色 · 第二遍（2026-10-25）
 * 第一遍换主题只换了 :root 变量；但下面这些是写死的「浅底深字」语义贴片——
 * 状态徽章、警示条、悬停/选中高亮、权限紫色角标——夜里就是几块刺眼的白斑，
 * 而 #c0392b/#856404 这类深红深黄字压在深底上几乎看不见。
 * 这一遍只动明度、不动语义：黄仍是草稿、红仍是危险、蓝仍是选中。
 * 打印媒体查询本来就强制白纸黑字，不受这里影响；
 * 顶栏/侧栏/进销存·财务切换钮自己是深色，两套主题同一副面孔，也不动。
 * ============================================================================ */

/* 原生控件（下拉列表/日期选择/滚动条）跟着夜里变深；
   --panel-alt 原来只有浅色兜底值，这里补上定义，黑夜下不再是一块浅灰 */
:root { color-scheme: light; --panel-alt: #f7f8fa; }
:root[data-theme="dark"] { color-scheme: dark; --panel-alt: #243449; }

/* 悬停 / 选中：白浅灰、浅蓝贴片 → 同族低透明 */
:root[data-theme="dark"] table tr:hover,
:root[data-theme="dark"] .pm-row:hover,
:root[data-theme="dark"] .perm-status,
:root[data-theme="dark"] .doc-photo-section { background: rgba(226, 232, 240, .06); }
:root[data-theme="dark"] table tr.selected,
:root[data-theme="dark"] .material-search-item:hover,
:root[data-theme="dark"] .material-search-item.selected,
:root[data-theme="dark"] .menu button:hover,
:root[data-theme="dark"] .seg button.on { background: rgba(59, 130, 246, .28); }

/* 「显示列」那一片的勾选项：原件是 #dbeafe 浅蓝贴片，夜里同样是一块白斑 */
:root[data-theme="dark"] .cp-item:hover { background: rgba(59, 130, 246, .28); }

/* 单据状态徽章：两套写法（.status.* 和 .status-tag.中文名），贴片和字一起换 */
:root[data-theme="dark"] .status.draft,
:root[data-theme="dark"] .status-tag.草稿 { background: rgba(255, 213, 79, .16); color: #ffd54f; }
:root[data-theme="dark"] .status.confirmed,
:root[data-theme="dark"] .status-tag.已确认 { background: rgba(34, 211, 238, .14); color: #67e8f9; }
:root[data-theme="dark"] .status.posted,
:root[data-theme="dark"] .status-tag.已执行 { background: rgba(52, 199, 89, .16); color: #81c995; }
:root[data-theme="dark"] .status.void,
:root[data-theme="dark"] .status-tag.已作废 { background: rgba(242, 139, 130, .16); color: #f28b82; }
:root[data-theme="dark"] .status-tag.待询价 { background: rgba(148, 163, 184, .18); color: #c3cad6; }
:root[data-theme="dark"] .status-tag.已询价 { background: rgba(59, 130, 246, .2); color: #93c5fd; }
/* 2026-10-30 禅道 #28：明细视图里被冲销的单子用这个样式（夜里同色系） */
:root[data-theme="dark"] .status-tag.voided { background: rgba(242, 139, 130, .16); color: #f28b82; text-decoration: line-through; }

/* 深红警示字：夜里统一提亮一档（语义还是"红=危险/欠账"） */
:root[data-theme="dark"] .section-warn,
:root[data-theme="dark"] .qty-red,
:root[data-theme="dark"] .total-red,
:root[data-theme="dark"] .inv-total,
:root[data-theme="dark"] .cp-msg.bad,
:root[data-theme="dark"] .btn-link.danger,
:root[data-theme="dark"] .fin-balance-pos b,
:root[data-theme="dark"] .fin-neg,
:root[data-theme="dark"] .fdp-over,
:root[data-theme="dark"] .pm-item.red .pi-txt,
:root[data-theme="dark"] .ps-dirty,
:root[data-theme="dark"] .modal-err,
:root[data-theme="dark"] .tag-off,
:root[data-theme="dark"] .si-st-bad { color: #f28b82; }

/* 绿色"存上了"的回执：#2e7d32 压在深底上读不出，同一族提亮一档 */
:root[data-theme="dark"] .cp-msg.ok { color: #81c995; }

/* 红底贴片：浅粉底 → 半透红
   （.login-error 不在这一列里了：登录页现在自己带四套配色，
     错误框的底和字跟着 --lg-* 那一层走，见文件末尾那段） */
:root[data-theme="dark"] .si-error,
:root[data-theme="dark"] .summary-note,
:root[data-theme="dark"] .doc-ship-warn,
:root[data-theme="dark"] .fdp-over { background: rgba(242, 139, 130, .12); }
/* 底提亮了还得把字也提上来：这三块原件写的是深红字（#a32020/#7a2a20/#9c2b21），
   不补就变成暗底配暗字，等于黑夜里把警示藏起来 */
:root[data-theme="dark"] .si-error,
:root[data-theme="dark"] .summary-note,
:root[data-theme="dark"] .doc-ship-warn { color: #f28b82; border-color: rgba(242, 139, 130, .45); }
:root[data-theme="dark"] .item-ship-qty.qty-over {
    background: rgba(242, 139, 130, .14);
    border-color: #f28b82;
    color: #f28b82;
}
:root[data-theme="dark"] .btn.danger { background: rgba(242, 139, 130, .12); border-color: rgba(242, 139, 130, .45); color: #f28b82; }
:root[data-theme="dark"] .btn.danger:hover { background: rgba(242, 139, 130, .22); }

/* 琥珀警示：黄底深黄字 → 半透黄底亮黄字 */
:root[data-theme="dark"] .si-col-warn { background: rgba(255, 213, 79, .1); color: #ffd54f; border-color: rgba(255, 213, 79, .35); }
:root[data-theme="dark"] .fdp-warn,
:root[data-theme="dark"] .fin-demo-tag { background: rgba(255, 193, 7, .14); color: #ffd54f; }
:root[data-theme="dark"] .platform-banner { background: rgba(255, 193, 7, .14); }
:root[data-theme="dark"] .platform-banner,
:root[data-theme="dark"] .platform-banner span { color: #ffd54f; }
:root[data-theme="dark"] .platform-banner b { color: #ffe082; }

/* 权限矩阵的紫色角标 + 淡蓝小徽标 */
:root[data-theme="dark"] .pm-only,
:root[data-theme="dark"] .pm-item.locked { background: rgba(167, 139, 250, .16); color: #c4b5fd; }
:root[data-theme="dark"] .photo-badge { background: rgba(59, 130, 246, .28); color: #bfdbfe; }

/* 对帐区外行的斑马浅底 */
:root[data-theme="dark"] .fin-out-range td { background: rgba(226, 232, 240, .04); }

/* 登录页那几块（验证码底、重置键、禁用态）原来在这儿一条条沉深；
   现在登录页自己带四套配色（文件末尾 --lg-* 那一层），白天/黑夜那个开关不再管它，
   这几条留着会变成"翻了配色、重置键还是那块旧铁灰"，所以整段撤掉。 */

/* app.js 模板里直接写死的行内色（红绿增减、警示橙）：
   选择器认的是渲染出来的 style 属性字符串，模板不用改；行内样式要 !important 才压得住 */
:root[data-theme="dark"] [style*="#c00"],
:root[data-theme="dark"] [style*="#c44"],
:root[data-theme="dark"] [style*="#c0392b"],
:root[data-theme="dark"] [style*="#c62828"] { color: #f28b82 !important; }
:root[data-theme="dark"] [style*="#2e7d32"] { color: #81c995 !important; }
:root[data-theme="dark"] [style*="#f57c00"] { color: #ffb84d !important; }

/* 公司详情 / 垃圾箱那几块写死的浅底：黑底下要翻成同一档深蓝，
   不然「功能开通」那一列和页头会在黑夜模式里亮成两张白卡。 */
:root[data-theme="dark"] .feat-row:hover { background: rgba(59, 130, 246, .16); }
:root[data-theme="dark"] .feat-row:has(input:disabled),
:root[data-theme="dark"] .feat-row.disabled { background: rgba(226, 232, 240, .04); }
:root[data-theme="dark"] .cd-head { background: rgba(59, 130, 246, .10); }
:root[data-theme="dark"] .cd-danger { border-color: rgba(242, 139, 130, .45); }
:root[data-theme="dark"] .cd-danger > .panel-title { border-left-color: #f28b82; }
:root[data-theme="dark"] .cp-expiry.is-expired {
    color: #f28b82;
    background: rgba(242, 139, 130, .12);
}
:root[data-theme="dark"] .cp-expiry.is-soon {
    color: #ffd54f;
    background: rgba(255, 213, 79, .10);
}
:root[data-theme="dark"] code.copyable {
    color: #d7e3f4;
    background: rgba(226, 232, 240, .08);
    border-color: rgba(226, 232, 240, .22);
}
/* 侧边栏左下角那一行期限：黑夜下导航本身是深蓝，那块贴片要比它再深一档才分得开 */
:root[data-theme="dark"] .nav-tree .nav-expiry { background: #0f1c2e; }
:root[data-theme="dark"] .nav-tree .nav-expiry.ne-danger { background: #35161a; }


/* ============================================================================
 * V7.0 新手引导：蒙层挖洞 + 气泡
 * ----------------------------------------------------------------------------
 * 暗下来那一层不是铺一张全屏半透明片，而是给高亮框套一圈 9999px 的投影：
 * 这样"洞"跟着框走，框在动（切步骤）的时候是框在补间，不是一片黑幕在抖。
 * 洞以外那四片透明垫片只吃点击，不画颜色——所以高亮框里面那颗按钮照样点得动
 * （"你试着点一下这颗"那一步要的就是这个）。
 * 气泡吃 --panel / --text 那组变量，所以白天黑夜不用各写一份。
 * ============================================================================ */

body.ob-lock { overflow: hidden; }

#ob-root { position: fixed; inset: 0; z-index: 5000; }
#ob-root.hidden { display: none !important; }

.ob-panel { position: fixed; display: none; background: transparent; z-index: 5001; }

/* 整屏讲的那一步（这一步不亮某一格，讲的是"这套界面分三块"）：
   没有高亮框就没有那圈 9999px 投影，暗这一层得单独铺一片，
   否则屏幕上等于只浮了一张纸条，后面照样一点就中，"半透明蒙层"落空。 */
.ob-dark { position: fixed; inset: 0; z-index: 5001; background: rgba(11, 18, 32, .66); }
.ob-dark.hidden { display: none; }

.ob-spot {
    position: fixed;
    z-index: 5002;
    border-radius: 7px;
    box-shadow: 0 0 0 9999px rgba(11, 18, 32, .66);
    outline: 2px solid #60a5fa;
    outline-offset: 2px;
    transition: left .26s ease, top .26s ease, width .26s ease, height .26s ease;
    pointer-events: none;
}
.ob-spot.hidden { display: none; }
/* 高亮框轻轻呼吸一下，眼神才会落到那一格而不是气泡上；只动 outline 的透明度，
   不动宽高，免得在低配电脑上看着晃 */
@keyframes ob-pulse {
    0%, 100% { outline-color: rgba(96, 165, 250, .95); }
    50% { outline-color: rgba(96, 165, 250, .45); }
}
#ob-root.ob-on .ob-spot { animation: ob-pulse 1.8s ease-in-out 1; }

.ob-bubble {
    position: fixed;
    z-index: 5003;
    width: min(372px, calc(100vw - 24px));
    background: var(--panel);
    color: var(--text);
    border: 1px solid var(--border);
    border-radius: 10px;
    box-shadow: 0 14px 34px rgba(9, 16, 28, .34);
    padding: 12px 14px 10px;
    transition: left .22s ease, top .22s ease;
}
.ob-bubble.ob-loading, .ob-bubble.ob-missing { border-color: #f59e0b; }
.ob-bubble.ob-missing .ob-title { color: #b45309; }

.ob-b-head { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.ob-chip {
    font-size: 11px; color: #dbeafe; background: #2563eb;
    border-radius: 999px; padding: 2px 9px; white-space: nowrap;
}
.ob-count { font-size: 11px; color: var(--muted); margin-left: auto; }
.ob-x {
    border: none; background: none; color: var(--muted); cursor: pointer;
    font-size: 18px; line-height: 1; padding: 0 2px;
}
.ob-x:hover { color: var(--text); }

.ob-title { font-size: 14px; font-weight: 700; margin-bottom: 6px; }
.ob-body {
    font-size: 12.5px; line-height: 1.75; white-space: pre-line;
    color: var(--text); word-break: break-word;
}
.ob-body b { color: var(--accent); }

.ob-notice {
    margin-top: 8px; font-size: 11.5px; line-height: 1.6;
    color: #92400e; background: #fef3c7; border: 1px solid #fcd34d;
    border-radius: 6px; padding: 5px 7px;
}

.ob-dots { display: flex; gap: 5px; margin: 9px 0 2px; }
.ob-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--border); }
.ob-dot.past { background: #93c5fd; }
.ob-dot.on { background: var(--accent); transform: scale(1.35); }

/* 键盘提示那一行：跟着气泡走，每一步都在，不用人去猜有没有 Esc */
.ob-keys {
    margin-top: 7px; font-size: 11px; color: var(--muted);
    letter-spacing: .2px;
}

.ob-foot { display: flex; align-items: center; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.ob-foot .ob-spacer { flex: 1; }
/* 挤不下就整颗换行，不许把"下一步"折成"下一 / 步"那样断在半截字上 */
.ob-foot .btn { font-size: 12px; padding: 4px 10px; white-space: nowrap; }
.ob-foot .btn:disabled { opacity: .45; cursor: default; }
.ob-quiet { background: none; border: none; color: var(--muted); cursor: pointer; font-size: 11.5px; }
.ob-quiet:hover { color: var(--accent); text-decoration: underline; }

@keyframes ob-shake {
    0%, 100% { transform: translateX(0); }
    25% { transform: translateX(-5px); }
    75% { transform: translateX(5px); }
}
.ob-bubble.ob-shake { animation: ob-shake .22s ease 1; }

/* 手机上气泡贴屏幕下沿，高亮那一格在上面露着；按钮加大到指头点得着 */
@media (max-width: 768px) {
    .ob-bubble { width: calc(100vw - 20px); padding: 12px 12px 14px; }
    .ob-bubble.ob-sheet { box-shadow: 0 -12px 30px rgba(9, 16, 28, .4); }
    .ob-foot .btn { font-size: 14px; padding: 9px 14px; }
    .ob-quiet { font-size: 13px; padding: 8px 4px; }
    .ob-body { font-size: 13.5px; }
}

/* 无障碍：系统里开了"减少动态效果"就不补间、不呼吸、不抖 */
@media (prefers-reduced-motion: reduce) {
    #ob-root.ob-on .ob-spot { animation: none; }
    .ob-spot, .ob-bubble { transition: none; }
    .ob-bubble.ob-shake { animation: none; }
}

/* 黑夜：蒙层再沉一点，气泡边框提亮，免得那块白贴片在深底上晃眼 */
:root[data-theme="dark"] .ob-spot { box-shadow: 0 0 0 9999px rgba(2, 6, 16, .74); }
/* 整屏旁白那一步铺的是这一片，深色底下也要跟着压暗，不然和亮框那一步两种黑 */
:root[data-theme="dark"] .ob-dark { background: rgba(2, 6, 16, .74); }
:root[data-theme="dark"] .ob-bubble { border-color: #3b4a63; }

/* ---------------- 使用教程：右侧那一栏（顶栏「使用教程」开合） ----------------
   形状照禅道：贴在屏幕右缘的一栏，上面三个 tab，下面一行一个功能，
   每行右边一颗按钮（开始 / 继续 / 再看一遍 / 待编写）。
   方角 + 1px 描边 + 平涂底色，不画投影卡片；颜色全吃 :root 那组变量，黑夜自动翻面。 */
.ob-tut {
    position: fixed; top: 0; right: 0; bottom: 0; z-index: 4000;
    width: 322px; display: flex; flex-direction: column;
    background: var(--panel); border-left: 1px solid var(--border);
    color: var(--text); font-size: 12.5px;
}
.ob-tut-head {
    display: flex; align-items: center; gap: 8px; padding: 10px 12px;
    background: var(--head); border-bottom: 1px solid var(--border);
    font-size: 14px; font-weight: 700;
}
.ob-tut-x {
    margin-left: auto; border: none; background: none; cursor: pointer;
    font-size: 18px; line-height: 1; color: var(--muted); padding: 0 2px;
}
.ob-tut-x:hover { color: var(--text); }
.ob-tut-tabs { display: flex; gap: 2px; padding: 0 10px; border-bottom: 1px solid var(--border); }
.ob-tut-tab {
    border: none; background: none; cursor: pointer; padding: 8px 10px;
    font-size: 12.5px; color: var(--muted); border-bottom: 2px solid transparent;
}
.ob-tut-tab:hover { color: var(--text); }
.ob-tut-tab.on { color: var(--accent); border-bottom-color: var(--accent); font-weight: 700; }
/* 当前页那一行单独摆最上面：原来顶栏那颗按钮就是"播本页"，这条一路数不能丢 */
.ob-tut-cur {
    display: flex; align-items: center; gap: 8px; padding: 8px 12px;
    background: var(--bg); border-bottom: 1px solid var(--border);
}
/* 教程栏工具条（2026-11-05）：两颗开关把一长串收成"当下能点、当下这一间"，
   一颗按钮把分组一次全展开。小字贴着走，别再占一整行。 */
.ob-tut-tools {
    display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
    padding: 6px 12px 2px; font-size: 11.5px; color: var(--muted);
}
.ob-tut-switch { display: inline-flex; align-items: center; gap: 3px; cursor: pointer; white-space: nowrap; }
.ob-tut-switch input { margin: 0; cursor: pointer; }
.ob-tut-switch:hover { color: var(--text); }
.ob-tut-tool-btn {
    border: none; background: none; padding: 0; cursor: pointer;
    font-size: 11.5px; color: var(--accent); white-space: nowrap;
}
.ob-tut-tool-btn:hover { text-decoration: underline; }
.ob-tut-list { flex: 1; overflow: auto; padding: 2px 0 10px; }
.ob-tut-group {
    padding: 10px 12px 3px; font-size: 11px; color: var(--muted); letter-spacing: .3px;
    cursor: pointer; display: flex; align-items: center; gap: 4px; user-select: none;
}
.ob-tut-group:hover { color: var(--text); }
.ob-tut-group.folded { opacity: .7; }
.ob-tut-fold { font-size: 9px; opacity: .8; }
.ob-tut-row {
    display: flex; align-items: center; gap: 8px; padding: 6px 12px;
    border-left: 2px solid transparent;
}
.ob-tut-row:hover { background: var(--bg); border-left-color: var(--accent); }
.ob-tut-row .ob-tut-name { flex: 1; line-height: 1.5; }
.ob-tut-row .ob-tut-sub { display: block; font-size: 11px; color: var(--muted); }
.ob-tut-row.seen .ob-tut-name { color: var(--muted); }
.ob-tut-go { min-width: 66px; white-space: nowrap; }
.ob-tut-go:disabled { opacity: .5; cursor: default; }
.ob-tut-foot {
    padding: 8px 12px; border-top: 1px solid var(--border); background: var(--bg);
    color: var(--muted); font-size: 11px; line-height: 1.7;
}
/* 手机上整屏就是一张单子：侧栏本来就藏着，留 322px 会把行裁掉半截 */
@media (max-width: 768px) {
    .ob-tut { width: 100%; }
    .ob-tut-go { font-size: 13px; padding: 7px 10px; }
}
:root[data-theme="dark"] .ob-notice { color: #fcd34d; background: #3a2c10; border-color: #7c5b16; }
:root[data-theme="dark"] .ob-bubble.ob-missing .ob-title { color: #fbbf24; }

/* 设置页里那一格「新手引导」 */
.ob-settings { margin-top: 30px; }
.ob-settings .ob-set-row { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; margin: 8px 0; }
.ob-settings .ob-set-note { font-size: 11.5px; color: var(--muted); line-height: 1.7; }

/* ============================================================================
 * 库存查询页右键菜单（两级子菜单，结构照参考系统截图）
 *   吃 :root 那组变量，黑夜主题自动翻面；方角 + 1px 描边，不画投影卡片。
 * ==========================================================================*/
.ctx-menu {
    position: fixed; z-index: 3000; min-width: 190px;
    background: var(--panel); border: 1px solid var(--border); font-size: 12.5px;
}
.ctx-list { position: relative; }
.ctx-list.ctx-sub {
    position: absolute; top: -1px; left: 100%;
    background: var(--panel); border: 1px solid var(--border); min-width: 170px;
}
.ctx-list.ctx-sub.ctx-flip { left: auto; right: 100%; }
.ctx-item {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 5px 12px; cursor: pointer; color: var(--text); white-space: nowrap;
}
.ctx-item:hover { background: var(--head); }
.ctx-item.open > .ctx-text { color: var(--accent); }
.ctx-arrow { font-size: 9px; color: var(--muted); }
.ctx-sep { border-top: 1px solid var(--border); margin: 3px 0; }
/* 父项和它的子菜单之间不留缝：缝一宽，鼠标斜着走过去就断 */
.ctx-item.ctx-parent { position: relative; }

/* 勾选列（批量设置的目标行） */
.stock-table td.chk-c, .stock-table th[data-col="chk"] { text-align: center; padding: 2px 4px; }
.stock-table td.chk-c input, .stock-table th[data-col="chk"] input { cursor: pointer; }

/* 右键弹框里的公共块：原行事实一行话说清（该多少/现在多少/最多多少） */
.ctx-dlg .ctx-dlg-fact { margin: 0 0 10px; line-height: 1.8; color: var(--text); }
.ctx-dlg .ctx-split-table input { width: 100%; box-sizing: border-box; }
.ctx-dlg .ctx-split-table td { padding: 3px 4px; }
.ctx-dlg .ctx-split-table th { white-space: nowrap; }

/* 库存流水页顶上的右键带入筛选条：一条一个 ✕，摘掉哪条筛哪条 */
.mv-chips { display: flex; gap: 8px; flex-wrap: wrap; margin: 4px 0 8px; }
.mv-chips:empty { display: none; }
.mv-chip {
    display: inline-flex; align-items: center; gap: 6px;
    background: var(--head); border: 1px solid var(--border); padding: 2px 8px; font-size: 12px;
}
.mv-chip button { border: none; background: none; color: var(--muted); cursor: pointer; font-size: 11px; padding: 0; }
.mv-chip button:hover { color: #c62828; }

/* ============================================================================
 * 销售板块（顶栏第三颗「销售」）：线索管理 / 跟进记录 / 销售看板
 * ----------------------------------------------------------------------------
 * 三页共用这一小段，不在各页里写 style=""：同一颗阶段徽章要在列表那一格、
 * 详情页眉、看板列头、卡片上四处出现，抄四份就迟早改漏三份。
 * 一律平涂底色 + 1px 描边 + 方角，不给圆角和投影：这一屏是干活时盯着看的，
 * 不是宣传页上那种"卡片"。
 * 颜色只承担两件事：卡在哪个阶段、该不该催。催=琥珀/红，和单据状态那套一致；
 * 黑夜翻面写在下面那段 :root[data-theme="dark"] 里，不在这里各条带 if。
 * ==========================================================================*/

/* 阶段徽章：六个档一眼分得开，不靠读字 */
.lead-stage {
    display: inline-block; padding: 1px 7px; font-size: 12px; line-height: 1.6;
    border: 1px solid var(--border); background: var(--head); color: var(--text);
    white-space: nowrap;
}
.lead-stage[data-stage="新线索"] { background: #eef2f7; border-color: #cbd5e1; color: #334155; }
.lead-stage[data-stage="联系中"] { background: #e8f1fe; border-color: #bfdbfe; color: #1d4ed8; }
.lead-stage[data-stage="报价中"] { background: #e6f7f5; border-color: #99e2d9; color: #0f766e; }
.lead-stage[data-stage="谈判中"] { background: #fff6e0; border-color: #fcd34d; color: #92400e; }
.lead-stage[data-stage="已成交"] { background: #e9f7ec; border-color: #86efac; color: #166534; }
.lead-stage[data-stage="已流失"] { background: #fdecec; border-color: #fca5a5; color: #991b1b; }

/* 该催的：整行铺一层琥珀 + 左边一道粗边，扫一眼就挑得出来（判据在后端 due） */
tr.row-due > td { background: #fffbeb; }
tr.row-due > td:first-child { box-shadow: inset 3px 0 0 #d97706; }
.lead-due-tag {
    display: inline-block; margin-left: 4px; padding: 0 5px; font-size: 11px;
    background: #fff1f2; border: 1px solid #fda4af; color: #9f1239; cursor: help;
}
.lead-due-line { margin: 8px 0 0; color: #92400e; }
.lead-next-todo { font-size: 11px; color: var(--muted); line-height: 1.4; }

/* 线索详情那一片档案格子：平涂 + 1px 描边，四格一行，窄屏两格一行 */
.kv-grid {
    display: grid; grid-template-columns: repeat(4, 1fr); gap: 1px;
    background: var(--border); border: 1px solid var(--border); margin-top: 10px;
}
.kv { background: var(--panel); padding: 6px 8px; }
.kv i { display: block; font-style: normal; font-size: 11px; color: var(--muted); }
.kv b { font-size: 13px; word-break: break-all; }
/* 最后一行差一格时，让"内容本来就长"那一格占两列把网格收口。
   不收口的话网格底色会从那一格露出来，看着像漏了一格没画
   （2026-11-01 批次流向摘要头 11 格 / 四列一行，眼睛看截图才看出来）。 */
.kv.kv-wide { grid-column: span 2; }

/* 跟进时间线：一条一块，左边那道竖线分"转客户之前 / 之后" */
.fu-timeline { margin-top: 6px; }
.fu-item {
    border: 1px solid var(--border); border-left: 3px solid #94a3b8;
    background: var(--panel); padding: 8px 10px; margin-bottom: 8px;
}
.fu-item:last-child { margin-bottom: 0; }
.fu-item.fu-after-convert { border-left-color: #16a34a; }
.fu-head { display: flex; flex-wrap: wrap; align-items: baseline; gap: 8px; }
.fu-way { padding: 0 6px; font-size: 11px; background: var(--head); border: 1px solid var(--border); }
.fu-who, .fu-target-tag { font-size: 12px; color: var(--muted); }
.fu-acts { margin-left: auto; white-space: nowrap; }
.fu-content { margin-top: 4px; line-height: 1.6; white-space: pre-wrap; word-break: break-word; }
.fu-line { margin-top: 3px; font-size: 12px; }
.fu-line i { font-style: normal; color: var(--muted); margin-right: 6px; }
.fu-line.fu-next { color: #92400e; }
.fu-cell-content { max-width: 420px; white-space: pre-wrap; word-break: break-word; }
.fu-files { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
/* 缩略图带一张恒定的白托板：聊天截图多是白底，压灰底上看不清边 */
.fu-thumb {
    width: 76px; height: 56px; object-fit: cover; background: #fff;
    border: 1px solid var(--border); cursor: zoom-in;
}
.fu-file-missing {
    font-size: 12px; color: var(--muted); border: 1px dashed var(--border); padding: 2px 6px;
}

/* 「记跟进」弹窗里那颗按名字/编号找对象的：搜 → 列表 → 点一条定下来 */
.fu-target-row { display: flex; gap: 6px; }
.fu-target-row select { width: 96px; }
.fu-target-row input { flex: 1; }
.fu-target-hits {
    display: flex; flex-direction: column; gap: 4px; margin-top: 6px;
    max-height: 190px; overflow-y: auto;
}
.fu-hit {
    display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; width: 100%;
    text-align: left; background: var(--panel); border: 1px solid var(--border);
    padding: 5px 8px; cursor: pointer; color: var(--text);
}
.fu-hit:hover { background: var(--head); border-color: var(--accent); }
.fu-hit i { font-style: normal; margin-left: auto; font-size: 11px; color: var(--muted); }
/* 已经选定那一家之后，候选列表压暗留着：他想改主意直接点另一条，不用重搜 */
.fu-hits-done { opacity: .6; }

/* 弹窗里那些"这一格现在填的是啥、为什么这么定"的只读行 */
.form-static {
    padding: 5px 8px; min-height: 27px; line-height: 1.5;
    background: var(--head); border: 1px solid var(--border); word-break: break-all;
}
.field-tip { margin: 3px 0 0; font-size: 11px; color: var(--muted); line-height: 1.5; }
.row-actions { white-space: nowrap; }

/* 看板：六列平铺，窄屏横向滚（不是换行堆成六屏） */
.kanban-scroll { overflow-x: auto; padding-bottom: 4px; }
.kanban-board { display: flex; gap: 8px; align-items: flex-start; min-height: 240px; }
.kanban-col {
    flex: 1 0 236px; min-width: 236px; display: flex; flex-direction: column;
    background: var(--bg); border: 1px solid var(--border);
}
.kanban-head { padding: 6px 8px; background: var(--head); border-bottom: 1px solid var(--border); }
.kb-nums { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; font-size: 11px; color: var(--muted); }
.kb-nums b { color: var(--text); }
.kb-nums .kb-due, .kb-nums .kb-due b { color: #9f1239; }
.kanban-cards { display: flex; flex-direction: column; gap: 6px; padding: 6px; min-height: 96px; }
.kb-empty { margin: 2px; font-size: 11px; color: var(--muted); line-height: 1.5; }
.kanban-card {
    background: var(--panel); border: 1px solid var(--border);
    border-left: 3px solid #94a3b8; padding: 6px 8px;
}
.kanban-card.kc-drag { cursor: grab; }
.kanban-card.kc-drag:active { cursor: grabbing; }
.kanban-card.kc-due { border-left-color: #d97706; background: #fffbeb; }
.kanban-card.kc-dragging { opacity: .45; }
/* 拖到哪一列，那一列整列描一圈虚线：只给卡片变个样，人不确定放得下放不下 */
.kanban-col.kb-over { outline: 2px dashed var(--accent); outline-offset: -2px; background: #e8f1fe; }
.kb-closed .kanban-head { opacity: .9; }
.kb-odd { flex: 0 0 268px; min-width: 268px; border-style: dashed; }
.kb-warn { color: #92400e; }
.kc-top { display: flex; flex-wrap: wrap; align-items: baseline; gap: 6px; }
.kc-top .kc-open { font-weight: 700; }
.kc-conv-tag {
    margin-left: auto; padding: 0 4px; font-size: 11px;
    background: #e9f7ec; border: 1px solid #86efac; color: #166534; cursor: help;
}
.kc-line, .kc-money { margin-top: 3px; font-size: 12px; color: var(--muted); }
.kc-money b { color: var(--accent); }
.kc-foot { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 4px; font-size: 11px; color: var(--muted); }
.kc-foot .kc-stale { color: #9f1239; }
/* 手机上拖不动：每张卡底下这颗下拉就是拖拽的等效路子（同一道判据、同一个接口） */
.kc-move { width: 100%; margin-top: 6px; }

/* 进度条（工单看板 / 不良原因帕累托 / 项目看板）：原来每页在自己那格里现写一条内联 style，
   轨道有 #eef2f7 和 #eee 两种、填充有三种色、圆角也各配各的，黑主题底下灰轨道直接糊进底里。
   这里收成一具 .prog：轨道走主题变量、方角描边（和面板一个观感），色只分四档语义。 */
.prog {
    display: inline-block; width: 110px; height: 8px; vertical-align: middle;
    background: var(--bg); border: 1px solid var(--border); margin-right: 6px;
}
.prog > i { display: block; height: 100%; }
.prog-good > i { background: #1a7f4b; }
.prog-info > i { background: #3a6ea5; }
.prog-bad > i { background: #c0392b; }
.prog-accent > i { background: var(--accent); }
/* 看板列头那个计数小圆点：同一具 kb-count，别再在页面里内联 min-width/border-radius */
.kb-count {
    display: inline-block; min-width: 18px; padding: 0 5px; margin-left: 4px;
    text-align: center; font-size: 11px;
    background: var(--panel); border: 1px solid var(--border); color: var(--text);
}
.kanban-head .kb-amt { float: right; color: var(--muted); font-weight: 400; }

@media (max-width: 900px) {
    /* 看板在窄屏上是一列一列横着翻，不换成六行竖着堆（堆起来就又是滚不完的一屏） */
    .kanban-board { scroll-snap-type: x mandatory; }
    .kanban-col { flex: 0 0 80vw; min-width: 80vw; scroll-snap-align: start; }
    .kv-grid { grid-template-columns: repeat(2, 1fr); }
    .fu-acts { margin-left: 0; }
    .fu-cell-content { max-width: 46vw; }
}

/* 黑夜翻面：上面那些白底贴片在深底上会糊成一片，语义不变、只换承载 */
:root[data-theme="dark"] .lead-stage[data-stage="新线索"] { background: rgba(148, 163, 184, .16); border-color: #475569; color: #cbd5e1; }
:root[data-theme="dark"] .lead-stage[data-stage="联系中"] { background: rgba(59, 130, 246, .18); border-color: #1d4ed8; color: #93c5fd; }
:root[data-theme="dark"] .lead-stage[data-stage="报价中"] { background: rgba(34, 211, 238, .14); border-color: #0f766e; color: #67e8f9; }
:root[data-theme="dark"] .lead-stage[data-stage="谈判中"] { background: rgba(255, 213, 79, .16); border-color: #92400e; color: #ffd54f; }
:root[data-theme="dark"] .lead-stage[data-stage="已成交"] { background: rgba(52, 199, 89, .16); border-color: #166534; color: #81c995; }
:root[data-theme="dark"] .lead-stage[data-stage="已流失"] { background: rgba(242, 139, 130, .16); border-color: #7f1d1d; color: #f28b82; }
:root[data-theme="dark"] tr.row-due > td { background: rgba(255, 213, 79, .10); }
:root[data-theme="dark"] tr.row-due > td:first-child { box-shadow: inset 3px 0 0 #f59e0b; }
:root[data-theme="dark"] .lead-due-tag { background: rgba(242, 139, 130, .16); border-color: #7f1d1d; color: #f28b82; }
:root[data-theme="dark"] .lead-due-line, :root[data-theme="dark"] .kb-warn,
:root[data-theme="dark"] .fu-line.fu-next, :root[data-theme="dark"] .kb-nums .kb-due,
:root[data-theme="dark"] .kb-nums .kb-due b { color: #fca5a5; }
:root[data-theme="dark"] .kanban-card.kc-due { background: rgba(255, 213, 79, .10); border-left-color: #f59e0b; }
:root[data-theme="dark"] .kanban-col.kb-over { background: rgba(59, 130, 246, .14); }
:root[data-theme="dark"] .fu-thumb { background: #fff; }
:root[data-theme="dark"] .kc-conv-tag { background: rgba(52, 199, 89, .16); border-color: #166534; color: #81c995; }
:root[data-theme="dark"] .kc-foot .kc-stale { color: #f28b82; }

/* ============================================================================
 * 问卷调查：控制台那一页 + 公司端弹窗（2026-10-29）
 * 平涂底 + 1px 描边 + 方角，不做卡片；语义色和单据状态徽章同一套（黄=草稿、
 * 蓝=在发、绿=已填、红=拒填、灰=没吭声），黑夜翻面写在最后那几行。
 * ==========================================================================*/
.toolbar .survey-btn {
    position: relative;
    padding: 4px 10px;
    font-size: 12px;
    background: rgba(255, 255, 255, 0.15);
    color: #fff;
    border: 1px solid rgba(139, 92, 246, 0.5);
    border-radius: 4px;
    cursor: pointer;
    white-space: nowrap;
    transition: all 0.2s;
}

.toolbar .survey-btn:hover {
    background: rgba(139, 92, 246, 0.3);
    border-color: rgba(139, 92, 246, 0.8);
}

/* 有得填的时候才亮这一档：没得填也挂着红点，等于把"催"变成了背景噪声 */
.toolbar .survey-btn.sv-has-pending {
    background: linear-gradient(135deg, #6366f1, #8b5cf6);
    border-color: #a5b4fc;
}

.survey-count {
    margin-left: 5px;
    padding: 0 5px;
    font-size: 11px;
    font-weight: bold;
    color: #fff;
    background: #dc2626;
    border-radius: 8px;
}

.survey-count:empty { display: none; }

/* 一份问卷的一生：草稿 → 在发 → 关闭；表态四种 */
.sv-tag {
    display: inline-block;
    padding: 1px 7px;
    font-size: 12px;
    border: 1px solid var(--border);
    background: var(--panel-alt);
    color: var(--muted);
    white-space: nowrap;
}
.sv-tag-draft, .sv-tag-later { background: #fff8e1; border-color: #f0d68a; color: #8a6100; }
.sv-tag-sent, .sv-tag-none { background: #e8f0fe; border-color: #b6cdf5; color: #1a4fb4; }
.sv-tag-done { background: #e7f6ec; border-color: #b2ddbf; color: #1c6b3a; }
.sv-tag-closed { background: var(--head); border-color: var(--border); color: var(--muted); }
.sv-tag-refused { background: #fdeceb; border-color: #f3b8b4; color: #a32020; }

.sv-id { font-family: Consolas, "Courier New", monospace; font-size: 12px; color: var(--muted); }
.sv-time { font-size: 12px; color: var(--muted); white-space: nowrap; }
.sv-done { color: #1c6b3a; }
.sv-warn { font-size: 11px; color: #a32020; }
.sv-warn-line { color: #a32020; }
.sv-note { background: var(--panel-alt); border: 1px solid var(--border); padding: 6px 8px; }

/* 弹窗里的一段一段：普通面板，不是卡片 */
.sv-section {
    margin: 10px 0;
    border: 1px solid var(--border);
    background: var(--panel);
}
.sv-section-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 5px 8px;
    background: var(--head);
    border-bottom: 1px solid var(--border);
}
.sv-section-head > span:first-child { font-weight: bold; }
.sv-section-head .btn { margin-left: auto; }
.sv-section > *:not(.sv-section-head) { margin: 8px; }

/* 出题那一排：一题一块，题干 / 类型 / 选项 / 必答 */
.sv-q {
    padding: 8px;
    margin: 8px;
    border: 1px solid var(--border);
    background: var(--panel-alt);
}
.sv-q-head { display: flex; align-items: center; gap: 8px; margin-bottom: 5px; }
.sv-q-no { font-weight: bold; white-space: nowrap; }
.sv-q-req { display: flex; align-items: center; gap: 4px; white-space: nowrap; }
.sv-q-spacer { flex: 1; }
.sv-q select, .sv-q input[type=text] {
    padding: 4px 6px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
}
.sv-q-text { width: 100%; margin-bottom: 5px; }
.sv-q-opts { width: 100%; }
.sv-q-opts:disabled { background: var(--head); }

/* 下发范围那一排勾：一家一行，停用的灰着且点不动 */
.sv-target-mode { display: flex; gap: 16px; padding: 8px 8px 0; }
.sv-target-mode label { display: flex; align-items: center; gap: 4px; }
.sv-comps {
    max-height: 190px;
    overflow-y: auto;
    margin: 8px;
    padding: 6px;
    border: 1px solid var(--border);
    background: var(--panel-alt);
}
.sv-comp {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 3px 4px;
}
.sv-comp:hover { background: rgba(59, 130, 246, .10); }
.sv-comp.off { color: var(--muted); }
.sv-comp.off:hover { background: transparent; }
.sv-comp-code { font-family: Consolas, "Courier New", monospace; width: 42px; }
.sv-comp-name { flex: 1; }
#svf-picked { margin: 0 8px 8px; }

/* 答卷弹窗：逐题那一排横条 */
.sv-stat { padding: 8px; border-bottom: 1px solid var(--border); }
.sv-stat:last-child { border-bottom: none; }
.sv-stat-q { font-weight: bold; margin-bottom: 6px; }
.sv-bar { display: flex; align-items: center; gap: 8px; margin: 3px 0; }
.sv-bar-label { width: 190px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.sv-bar-track { flex: 1; height: 10px; border: 1px solid var(--border); background: var(--panel-alt); }
.sv-bar-track i { display: block; height: 100%; background: var(--accent); }
.sv-bar-num { width: 90px; text-align: right; color: var(--muted); font-size: 12px; }
.sv-texts { margin-top: 6px; }
.sv-text { display: flex; gap: 8px; padding: 4px 6px; border-left: 3px solid var(--accent); background: var(--panel-alt); margin-bottom: 4px; }
.sv-text span { color: var(--muted); white-space: nowrap; font-size: 12px; }
.sv-text p { margin: 0; white-space: pre-wrap; }

/* 逐人明细展开的那一行：谁答了什么 */
.sv-ans { display: flex; gap: 10px; padding: 3px 0; border-bottom: 1px dotted var(--border); }
.sv-ans:last-child { border-bottom: none; }
.sv-ans b { width: 320px; }
.sv-ans span { flex: 1; }
.sv-ans i { color: var(--muted); font-style: normal; font-size: 12px; white-space: nowrap; }

/* 公司端填写那一页 */
.sv-fq { padding: 8px; margin: 8px; border: 1px solid var(--border); background: var(--panel-alt); }
.sv-fq-head { display: flex; align-items: center; gap: 8px; margin-bottom: 4px; }
.sv-req { padding: 0 6px; font-size: 11px; color: #a32020; border: 1px solid #f3b8b4; background: #fdeceb; }
.sv-fq-text { font-weight: bold; margin-bottom: 6px; }
.sv-choice { display: block; padding: 3px 4px; }
.sv-choice:hover { background: rgba(59, 130, 246, .10); }
.sv-f-text {
    width: 100%;
    padding: 5px 6px;
    border: 1px solid var(--border);
    background: var(--panel);
    color: var(--text);
    resize: vertical;
}

/* 黑夜翻面：上面那些浅底贴片在深底上会糊成白卡，语义不变、只换承载 */
:root[data-theme="dark"] .sv-tag-draft,
:root[data-theme="dark"] .sv-tag-later { background: rgba(255, 213, 79, .16); border-color: #92400e; color: #ffd54f; }
:root[data-theme="dark"] .sv-tag-sent,
:root[data-theme="dark"] .sv-tag-none { background: rgba(59, 130, 246, .2); border-color: #1d4ed8; color: #93c5fd; }
:root[data-theme="dark"] .sv-tag-done { background: rgba(52, 199, 89, .16); border-color: #166534; color: #81c995; }
:root[data-theme="dark"] .sv-tag-refused { background: rgba(242, 139, 130, .16); border-color: #7f1d1d; color: #f28b82; }
:root[data-theme="dark"] .sv-tag-closed { background: rgba(226, 232, 240, .06); }
:root[data-theme="dark"] .sv-done { color: #81c995; }
:root[data-theme="dark"] .sv-warn,
:root[data-theme="dark"] .sv-warn-line,
:root[data-theme="dark"] .sv-req { color: #f28b82; }
:root[data-theme="dark"] .sv-req { background: rgba(242, 139, 130, .12); border-color: #7f1d1d; }
:root[data-theme="dark"] .sv-tag-refused,
:root[data-theme="dark"] .sv-comp.off:hover { border-color: #7f1d1d; }
:root[data-theme="dark"] .sv-q,
:root[data-theme="dark"] .sv-fq,
:root[data-theme="dark"] .sv-comps,
:root[data-theme="dark"] .sv-note,
:root[data-theme="dark"] .sv-text { background: var(--panel-alt); }
:root[data-theme="dark"] .sv-q select,
:root[data-theme="dark"] .sv-q input[type=text],
:root[data-theme="dark"] .sv-f-text { background: #1b2836; border-color: #3a4757; color: var(--text); }

/* 手机上这一颗只收字号、不藏掉：弹窗一次进系统只弹一轮，入口拆了人就找不回来了 */
@media (max-width: 768px) {
    .toolbar .survey-btn { padding: 3px 8px; font-size: 11px; }
    .sv-bar-label { width: 120px; }
}

/* ============================================================================
 * 通知待办（消息预警中心）：顶栏那颗铃铛 + 「通知」这一页（2026-11-02）
 * ----------------------------------------------------------------------------
 * 四条规则（应收到期 / 低库存 / 停在草稿的单 / 该跟进的线索）扫出来的事，
 * 从这里一键进那一页办。排版口径和问卷那一段一致：平涂底 + 1px 描边 + 方角，
 * 不做圆角卡片（一页通知叠一层投影就像一叠纸）；等级的颜色沿用单据状态那套
 * 语义（红=急、黄=要办、灰蓝=提一句），黑夜翻面写在这段最后几行。
 * 顶栏这颗只留一颗大铃铛：不要底色、不要描边。有没有事靠角标和跳动说，
 * 套上方框反而像工具条上又多了一个按钮，还跟旁边那排文字按钮抢位置。
 * ==========================================================================*/
.toolbar .notif-btn {
    position: relative;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: 34px;
    height: 32px;
    padding: 0;
    font-size: 22px;
    line-height: 1;
    background: transparent;
    color: #fff;
    border: 0;
    border-radius: 0;
    cursor: pointer;
    white-space: nowrap;
    -webkit-tap-highlight-color: transparent;
    transition: transform 0.15s ease;
}

.toolbar .notif-btn:hover {
    background: transparent;
    transform: scale(1.12);          /* 悬停轻轻放大，仍然不带框 */
}

.toolbar .notif-btn:active { transform: scale(0.96); }

/* 按钮没框了，角标往铃铛身上收一点，别像贴在框角那么远 */
.toolbar .notif-btn > .notif-count {
    top: -4px;
    right: -4px;
}

/* 有事才亮：只让铃铛跳，不给整颗按钮加红底红框（那正是要去的方框） */
.toolbar .notif-btn.nf-has-unread {
    background: transparent;
}

/* 里面有过了应收日期的（level=urgent）：只有跳动变快，不给描边光圈 */
.toolbar .notif-btn.nf-urgent {
    box-shadow: none;
}

/* 有没看过的通知时铃铛自己跳两下，急件跳得更快。
   只动图标那颗 span：数字角标跟着按钮不动，免得一整屏都在晃。 */
@keyframes nf-bounce {
    0%, 100% { transform: translateY(0) rotate(0deg); }
    20%      { transform: translateY(-4px) rotate(-14deg); }
    40%      { transform: translateY(0) rotate(0deg); }
    60%      { transform: translateY(-2px) rotate(10deg); }
    80%      { transform: translateY(0) rotate(0deg); }
}
.toolbar .notif-btn .nf-bell { display: inline-block; transform-origin: 50% 20%; }
.toolbar .notif-btn.nf-has-unread .nf-bell { animation: nf-bounce 1.4s ease-in-out infinite; }
.toolbar .notif-btn.nf-urgent .nf-bell { animation-duration: 0.8s; }
@media (prefers-reduced-motion: reduce) {
    .toolbar .notif-btn .nf-bell { animation: none !important; }
}

.notif-count:empty { display: none; }

/* 那一页上面的一排：摘要 + 回执 + 四颗动作 */
.notif-bar {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 8px;
    padding: 8px 10px;
    margin-bottom: 10px;
    background: var(--panel-alt);
    border: 1px solid var(--border);
}

.notif-sum { font-size: 13px; color: var(--text); }
.notif-sum b { color: #b91c1c; }

/* 动作的回执：成了绿一句、没成红一句，就写在这排里，不弹窗 */
.nf-hint { font-size: 12px; color: var(--muted); }
.nf-hint.nf-ok { color: #15803d; }
.nf-hint.nf-err, .nf-err { color: #b91c1c; }
.nf-hint:empty { display: none; }

.nf-filter {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    font-size: 12px;
    color: var(--muted);
    cursor: pointer;
}

.notif-list { display: flex; flex-direction: column; gap: 6px; }

.nf-row {
    padding: 7px 10px;
    background: var(--panel);
    border: 1px solid var(--border);
    border-left: 3px solid var(--border);
}

.nf-row.lv-urgent { background: #fef2f2; border-left-color: #dc2626; }
.nf-row.lv-warn { background: #fffbeb; border-left-color: #d97706; }
.nf-row.lv-info { background: #f8fafc; border-left-color: #64748b; }

.nf-head { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; font-size: 13px; }

/* 没看过的那条挂一颗点：一眼翻到还剩哪几条，比数角标准 */
.nf-dot {
    width: 8px;
    height: 8px;
    background: #dc2626;
    border-radius: 50%;
    flex: none;
}

.nf-type {
    padding: 0 6px;
    font-size: 12px;
    border: 1px solid var(--border);
    background: var(--head);
    color: var(--text);
}

.nf-lv { font-size: 11px; color: var(--muted); }
.nf-title { font-weight: bold; color: var(--text); }
.nf-body { margin-top: 4px; font-size: 12px; color: var(--muted); line-height: 1.6; }

.nf-foot {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    margin-top: 5px;
}

.nf-meta { font-size: 11px; color: var(--muted); }
.nf-acts { display: inline-flex; gap: 6px; }
.nf-read { font-size: 12px; color: var(--muted); }
.nf-empty { padding: 12px 4px; font-size: 13px; color: var(--muted); }

/* 没勾「重扫一遍」那一格：点不动，但钮还留着（藏起来人就以为功能坏了） */
.nf-off, .btn[disabled].nf-off { opacity: .5; cursor: not-allowed; }

/* 有一条规则没算出来（后端 scan 带回来的 报错）：角标位上打一个感叹号，
   琥珀色 —— 没未读不等于"今天很干净"，这一档必须和红色那种"有 N 条"分开。 */
/* 扫描出错：只把角标打成琥珀色感叹号，铃铛本体不再换成橙色方块 */
.toolbar .notif-btn.nf-scan-err {
    background: transparent;
}

.notif-btn.nf-scan-err .notif-count { background: #b45309; }

/* 手机上把"通知"两个字收掉，铃铛和角标留着：这一颗是入口，拆了人就找不回来了 */
@media (max-width: 768px) {
    .toolbar .notif-btn { width: 32px; height: 30px; font-size: 20px; }
    .notif-bar { gap: 6px; }
    .nf-foot { justify-content: flex-start; }
}

:root[data-theme="dark"] .nf-row.lv-urgent { background: rgba(242, 139, 130, .1); border-left-color: #f28b82; }
:root[data-theme="dark"] .nf-row.lv-warn { background: rgba(255, 213, 79, .1); border-left-color: #ffd54f; }
:root[data-theme="dark"] .nf-row.lv-info { background: rgba(148, 163, 184, .1); border-left-color: #94a3b8; }
:root[data-theme="dark"] .notif-sum b,
:root[data-theme="dark"] .nf-hint.nf-err,
:root[data-theme="dark"] .nf-err { color: #f28b82; }
:root[data-theme="dark"] .nf-hint.nf-ok { color: #81c995; }
:root[data-theme="dark"] .notif-bar { background: var(--panel-alt); border-color: var(--border); }
:root[data-theme="dark"] .nf-type { background: #1b2836; border-color: var(--border); color: var(--text); }
:root[data-theme="dark"] .toolbar .notif-btn.nf-has-unread { background: transparent; }
:root[data-theme="dark"] .toolbar .notif-btn.nf-urgent { box-shadow: none; }


/* ============================================================================
 * 登录页 · 科幻版（2026-10-31）
 * ----------------------------------------------------------------------------
 * 这一段为什么写在文件最末尾：前面 3300–3600 行有一批 :root[data-theme="dark"]
 * 的昼夜覆盖，其中「兜底把漏网的输入控件沉成深色」那条点名 #app 里面的控件，
 * 登录遮罩在 #app 外面，不受它管；其余登录页专属的黑夜覆盖这一轮已经撤掉。
 * 放在最后还有一层保险：万一以后又冒出别的主题覆盖，这一层的同权重规则靠顺序赢。
 *
 * 四套配色认的是 html 上的 data-pal：
 *   day（默认，没写 data-pal 也是它）白昼玻璃 · 浅底
 *   void 深空蓝紫 · aurora 极光青绿 · steel 石墨银蓝
 * 顶栏那四颗胶囊翻这个属性，选中的那一套记在 localStorage['login.pal']，
 * index.html 头部那段一行脚本在首帧之前就把它套上（免得先白一下再翻蓝）。
 * 这颗开关跟白天/黑夜那颗是两回事：昼夜管明暗，配色管色相。
 * V7.7 起配色不再只管门外，#app 里的顶栏 / 侧栏 / 主按钮也跟着变（见 premium.css 末尾）。
 *
 * 颜色只写在这一层 --lg-* token 里，别处（包括背景画布的 js）都从这里读，
 * 不另存一份蓝——否则会出现"面板换了色、身后网格还是旧蓝"。
 * 素材全是代码画的（canvas + CSS + 内联 SVG），不随包带任何图片文件。
 * ========================================================================== */

:root {
    /* ===== 白昼玻璃（默认套）===== */
    --lg-sky-1: #eaf2ff;
    --lg-sky-2: #f6f9ff;
    --lg-sky-3: #dbe8fb;
    --lg-accent-rgb: 37, 99, 235;
    --lg-accent2-rgb: 124, 58, 237;
    --lg-grid-rgb: 37, 99, 235;
    --lg-grid2-rgb: 96, 165, 250;
    --lg-star-rgb: 147, 197, 253;
    --lg-fx: .5;

    --lg-accent: rgba(var(--lg-accent-rgb), 1);
    --lg-accent2: rgba(var(--lg-accent2-rgb), 1);
    --lg-ink: #16223b;
    --lg-ink-dim: #57688a;
    --lg-line: rgba(30, 64, 175, .18);
    --lg-glass: rgba(255, 255, 255, .62);
    --lg-card-bg: #ffffff;
    --lg-shadow: 0 26px 70px rgba(30, 58, 110, .20);
    /* 小卡各自的浅阴影：四套配色通用（中性深色，浅底上是淡投影、深底上是压边），
       让每张卖点卡自己浮起来，而不是靠背景网格/竖条连成一串。 */
    --lg-card-sm: 0 2px 6px rgba(6, 14, 34, .10), 0 12px 26px rgba(6, 14, 34, .09);
    --lg-field-bg: #f1f5fb;
    --lg-field-bg-on: #e9f1fc;
    --lg-field-bd: rgba(30, 64, 175, .22);
    --lg-field-bd-on: rgba(37, 99, 235, .70);
    --lg-placeholder: #6b7f9e;
    --lg-brand-1: rgba(37, 99, 235, .10);
    --lg-brand-2: rgba(124, 58, 237, .06);
    --lg-chip-bg: rgba(255, 255, 255, .70);
    --lg-chip-bg-on: #ffffff;
    --lg-chip-bd: rgba(30, 64, 175, .14);
    --lg-spoke-1: rgba(var(--lg-accent-rgb), .85);
    --lg-spoke-2: rgba(var(--lg-accent2-rgb), .75);
    --lg-title-1: #1e3a8a;
    --lg-title-2: #2563eb;
    --lg-title-3: #7c3aed;
    --lg-btn-1: #1d4ed8;
    --lg-btn-2: #4f46e5;
    --lg-btn-3: #6d28d9;
    --lg-btn-ink: #ffffff;
    --lg-glow-a: rgba(96, 165, 250, .55);
    --lg-glow-b: rgba(196, 181, 253, .50);
    --lg-glow-c: rgba(165, 243, 252, .55);
    --lg-sweep-1: rgba(255, 255, 255, .40);
    --lg-sweep-2: rgba(255, 255, 255, .70);
    --lg-bad-ink: #8a1c2e;
    --lg-bad-bg: rgba(254, 226, 232, .90);
    --lg-bad-bd: rgba(225, 29, 72, .35);
    --lg-bad-solid: #be123c;
    --lg-ok: #15803d;
    --lg-glow: 0 0 22px rgba(37, 99, 235, .18);
}

/* ---------- 深空蓝紫 ---------- */
:root[data-pal="void"] {
    --lg-sky-1: #070d1c;
    --lg-sky-2: #0a1428;
    --lg-sky-3: #060a16;
    --lg-accent-rgb: 53, 224, 255;
    --lg-accent2-rgb: 139, 92, 246;
    --lg-grid-rgb: 53, 224, 255;
    --lg-grid2-rgb: 99, 170, 255;
    --lg-star-rgb: 190, 232, 255;
    --lg-fx: 1;
    --lg-ink: #e8f2ff;
    --lg-ink-dim: #93a8c9;
    --lg-line: rgba(var(--lg-grid2-rgb), .26);
    --lg-glass: rgba(11, 22, 43, .62);
    --lg-card-bg: #0b162c;
    --lg-shadow: 0 26px 70px rgba(3, 9, 22, .62);
    --lg-field-bg: rgba(6, 14, 30, .72);
    --lg-field-bg-on: rgba(9, 22, 44, .92);
    --lg-field-bd: rgba(var(--lg-grid2-rgb), .20);
    --lg-field-bd-on: rgba(var(--lg-accent-rgb), .72);
    --lg-placeholder: #5f7ba6;
    --lg-brand-1: rgba(37, 99, 235, .30);
    --lg-brand-2: rgba(30, 64, 175, .16);
    --lg-chip-bg: rgba(8, 18, 38, .40);
    --lg-chip-bg-on: rgba(12, 28, 56, .62);
    --lg-chip-bd: rgba(var(--lg-grid2-rgb), .14);
    --lg-title-1: #ffffff;
    --lg-title-2: #a5d8ff;
    --lg-title-3: #d8b4fe;
    --lg-btn-1: #2563eb;
    --lg-btn-2: #4f46e5;
    --lg-btn-3: #7c3aed;
    --lg-glow-a: rgba(37, 99, 235, .40);
    --lg-glow-b: rgba(139, 92, 246, .30);
    --lg-glow-c: rgba(6, 182, 212, .22);
    --lg-sweep-1: rgba(120, 220, 255, .075);
    --lg-sweep-2: rgba(190, 240, 255, .14);
    --lg-bad-ink: #ffd7dd;
    --lg-bad-bg: rgba(190, 24, 60, .22);
    --lg-bad-bd: rgba(251, 113, 133, .42);
    --lg-bad-solid: #fb7185;
    --lg-ok: #4ade80;
    --lg-glow: 0 0 24px rgba(var(--lg-accent-rgb), .28);
}

/* ---------- 极光青绿 ---------- */
:root[data-pal="aurora"] {
    --lg-sky-1: #04161a;
    --lg-sky-2: #072427;
    --lg-sky-3: #020d12;
    --lg-accent-rgb: 62, 242, 168;
    --lg-accent2-rgb: 129, 140, 248;
    --lg-grid-rgb: 62, 242, 168;
    --lg-grid2-rgb: 96, 220, 222;
    --lg-star-rgb: 198, 255, 232;
    --lg-fx: 1;
    --lg-ink: #e6fff4;
    --lg-ink-dim: #93bfb4;
    --lg-line: rgba(var(--lg-grid2-rgb), .26);
    --lg-glass: rgba(7, 30, 32, .60);
    --lg-card-bg: #061b1e;
    --lg-shadow: 0 26px 70px rgba(1, 12, 12, .62);
    --lg-field-bg: rgba(4, 20, 22, .72);
    --lg-field-bg-on: rgba(7, 28, 30, .92);
    --lg-field-bd: rgba(var(--lg-grid2-rgb), .20);
    --lg-field-bd-on: rgba(var(--lg-accent-rgb), .72);
    --lg-placeholder: #5f8f86;
    --lg-brand-1: rgba(13, 148, 136, .30);
    --lg-brand-2: rgba(15, 118, 110, .16);
    --lg-chip-bg: rgba(4, 22, 24, .40);
    --lg-chip-bg-on: rgba(8, 34, 36, .62);
    --lg-chip-bd: rgba(var(--lg-grid2-rgb), .14);
    --lg-title-1: #ffffff;
    --lg-title-2: #a7f3d0;
    --lg-title-3: #c7d2fe;
    --lg-btn-1: #0e7490;
    --lg-btn-2: #155e75;
    --lg-btn-3: #5b21b6;
    --lg-glow-a: rgba(16, 185, 129, .36);
    --lg-glow-b: rgba(56, 189, 248, .26);
    --lg-glow-c: rgba(109, 40, 217, .20);
    --lg-sweep-1: rgba(110, 231, 183, .08);
    --lg-sweep-2: rgba(190, 255, 230, .15);
    --lg-bad-ink: #ffe3e9;
    --lg-bad-bg: rgba(190, 24, 60, .24);
    --lg-bad-bd: rgba(251, 113, 133, .42);
    --lg-bad-solid: #fb7185;
    --lg-ok: #34d399;
    --lg-glow: 0 0 24px rgba(var(--lg-accent-rgb), .28);
}

/* ---------- 石墨银蓝 ---------- */
:root[data-pal="steel"] {
    --lg-sky-1: #0b0f14;
    --lg-sky-2: #12181f;
    --lg-sky-3: #070a0e;
    --lg-accent-rgb: 124, 196, 255;
    --lg-accent2-rgb: 148, 163, 184;
    --lg-grid-rgb: 148, 184, 220;
    --lg-grid2-rgb: 120, 144, 170;
    --lg-star-rgb: 226, 236, 246;
    --lg-fx: 1;
    --lg-ink: #e6eef7;
    --lg-ink-dim: #90a2b6;
    --lg-line: rgba(var(--lg-grid2-rgb), .26);
    --lg-glass: rgba(20, 26, 34, .66);
    --lg-card-bg: #141a22;
    --lg-shadow: 0 26px 70px rgba(4, 7, 11, .62);
    --lg-field-bg: rgba(10, 14, 19, .74);
    --lg-field-bg-on: rgba(16, 22, 29, .92);
    --lg-field-bd: rgba(var(--lg-grid2-rgb), .22);
    --lg-field-bd-on: rgba(var(--lg-accent-rgb), .72);
    --lg-placeholder: #62748a;
    --lg-brand-1: rgba(59, 130, 246, .24);
    --lg-brand-2: rgba(30, 41, 59, .22);
    --lg-chip-bg: rgba(12, 17, 22, .46);
    --lg-chip-bg-on: rgba(19, 26, 33, .64);
    --lg-chip-bd: rgba(var(--lg-grid2-rgb), .16);
    --lg-title-1: #ffffff;
    --lg-title-2: #cbd5e1;
    --lg-title-3: #93c5fd;
    --lg-btn-1: #334155;
    --lg-btn-2: #475569;
    --lg-btn-3: #1d4ed8;
    --lg-glow-a: rgba(71, 85, 105, .34);
    --lg-glow-b: rgba(29, 78, 216, .24);
    --lg-glow-c: rgba(148, 163, 184, .16);
    --lg-sweep-1: rgba(200, 220, 240, .07);
    --lg-sweep-2: rgba(235, 245, 255, .13);
    --lg-bad-ink: #ffdfe4;
    --lg-bad-bg: rgba(190, 24, 60, .24);
    --lg-bad-bd: rgba(251, 113, 133, .40);
    --lg-bad-solid: #fb7185;
    --lg-ok: #4ade80;
    --lg-glow: 0 0 24px rgba(var(--lg-accent-rgb), .26);
}

/* ---------- 背景三层：画布在最底，两张 CSS 光晕在上面 ---------- */
#fx-bg {
    position: fixed;
    inset: 0;
    width: 100%;
    height: 100%;
    z-index: 0;
}

.sky-glow {
    position: fixed;
    inset: 0;
    z-index: 1;
    pointer-events: none;
    background:
        radial-gradient(1100px 620px at 18% -10%, var(--lg-glow-a), transparent 62%),
        radial-gradient(900px 560px at 92% 8%, var(--lg-glow-b), transparent 60%),
        radial-gradient(1200px 700px at 50% 118%, var(--lg-glow-c), transparent 65%);
}

/* ---------- 顶栏 HUD：站点身份 + 四颗配色胶囊 + 一颗真时钟 ---------- */
.hud-bar {
    position: fixed;
    top: 0; left: 0; right: 0;
    z-index: 5;
    display: flex;
    align-items: center;
    gap: 18px;
    padding: 14px 22px;
    font-size: 11.5px;
    letter-spacing: 1.6px;
    color: var(--lg-ink-dim);
    text-transform: uppercase;
}

.hud-bar .dot {
    width: 7px; height: 7px;
    border-radius: 50%;
    background: var(--lg-accent);
    box-shadow: 0 0 10px var(--lg-accent);
    animation: lg-pulse 2.1s ease-in-out infinite;
}

@keyframes lg-pulse {
    0%, 100% { opacity: 1; transform: scale(1); }
    50%      { opacity: .35; transform: scale(.72); }
}

.hud-bar .sep { opacity: .35; }
.hud-bar .grow { flex: 1; }
.hud-clock { font-variant-numeric: tabular-nums; color: var(--lg-ink-dim); }
/* 这两格必须自己点名配色：文件开头那条 `* { color: var(--text) }` 是通配直选，
   裸标签的 span 只要没自己的 color，就会被拉回 #app 的深字（白天 #1c2430）——
   压在深空蓝紫的底上几乎看不见。.hud-id 和输入框里那枚图标就是这个漏网的。 */
.hud-id { color: var(--lg-ink-dim); }
.login-input-icon { color: var(--lg-ink-dim); }

.pal-bar { display: flex; gap: 6px; align-items: center; }
.pal-pill {
    font: inherit;
    letter-spacing: 1px;
    text-transform: none;
    padding: 4px 11px;
    border-radius: 999px;
    border: 1px solid var(--lg-field-bd);
    background: transparent;
    color: var(--lg-ink-dim);
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.pal-pill:hover { color: var(--lg-ink); border-color: var(--lg-field-bd-on); }
.pal-pill[aria-pressed="true"] {
    color: var(--lg-ink);
    border-color: var(--lg-field-bd-on);
    background: rgba(var(--lg-accent-rgb), .14);
    box-shadow: var(--lg-glow);
}

/* 登录页中/EN 切换按钮：外观对齐配色胶囊，但用独立 class 以免被 loginfx.js 的
   .pal-pill 点击逻辑（改 data-pal）误伤 */
.lang-pill {
    font: inherit;
    letter-spacing: 1px;
    padding: 4px 11px;
    border-radius: 999px;
    border: 1px solid var(--lg-field-bd);
    background: transparent;
    color: var(--lg-ink-dim);
    cursor: pointer;
    transition: color .2s ease, border-color .2s ease, background .2s ease, box-shadow .2s ease;
}
.lang-pill:hover { color: var(--lg-ink); border-color: var(--lg-field-bd-on); }

/* V7.1：顶栏那颗中英切换复用登录页的 .lang-pill，但 --lg-* 是登录遮罩里的变量，
   #app 里没定义，颜色会掉成透明。这里按系统内的主题色重画一遍（带兜底色）。 */
.toolbar .lang-pill {
    border-color: var(--border, #d0d7e2);
    color: var(--text, #334155);
    background: var(--panel, #fff);
    margin-right: 6px;
    letter-spacing: 0;
}
.toolbar .lang-pill:hover {
    color: var(--primary, #2563eb);
    border-color: var(--primary, #2563eb);
}

/* 顶栏折叠组：只留一个 < / > 符号，没有文字也没有外框，点它展开或折起。 */
.tool-tools { display: flex; align-items: center; gap: 6px; }
.tool-tools .lang-pill { margin-right: 0; }
#app .toolbar .tool-tools-trigger {
    display: inline-flex; align-items: center; justify-content: center;
    width: 18px; height: 24px; padding: 0 !important;
    color: rgba(240, 244, 255, .92) !important;
    background: transparent !important; border: 0 !important;
    border-radius: 5px; box-shadow: none !important;
}
#app .toolbar .tool-tools-trigger:hover {
    color: #fff !important;
    background: rgba(255, 255, 255, .12) !important;
    border: 0 !important;
}
.tool-tools-caret {
    font-size: 14px; line-height: 1; font-weight: 600;
}
.tool-tools-body {
    display: flex; align-items: center; gap: 6px;
    max-width: 360px; opacity: 1; overflow: hidden;
    transition: max-width .22s ease, opacity .18s ease;
}
.tool-tools.collapsed .tool-tools-body {
    max-width: 0; opacity: 0; pointer-events: none;
}

/* ---------- 遮罩本体 ----------
   2026-11-15 去掉底部页脚，面板居中只留干净留白。
   overflow 写在遮罩上（不写 html/body）：这一页收掉之后 #app 要照常滚。
   justify-content 那两行是同一件事的两种写法：认 safe center 的浏览器用第二行
   （内容比屏高时退回顶对齐，中间那截才不会被裁掉又滚不到），不认的留着第一行。 */
.login-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 1000;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    justify-content: safe center;
    gap: 18px;
    box-sizing: border-box;
    padding: 64px 16px 24px;
    overflow-y: auto;
    background: var(--lg-sky-1);
}

/* 中间面板拆成小块（同 1000 演示页的观感）：外框只当摆卡片的台子，
   不再自己描边铺底；左列 = 品牌卡 + 四张卖点小卡，右列 = 表单卡，
   卡与卡之间留缝，各自带边框/圆角/底色。 */
.login-shell {
    position: relative;
    display: flex;
    align-items: stretch;
    gap: 20px;              /* 左右两列分开：缝里露出干净底色，不再像连在一起 */
    flex: none;
    width: 1000px;
    max-width: calc(100vw - 32px);
    animation: lg-rise .72s cubic-bezier(.16, .84, .34, 1) both;
}

.login-side {
    display: flex;
    flex-direction: column;
    gap: 16px;
    flex: none;
    width: 430px;
    min-width: 0;
}

@keyframes lg-rise {
    from { opacity: 0; transform: translate3d(0, 26px, 0) scale(.985); }
    to   { opacity: 1; transform: none; }
}

/* HUD 四角：四条 L 形亮角 */
.corner {
    position: absolute;
    width: 22px; height: 22px;
    z-index: 3;
    border: 2px solid var(--lg-accent);
    opacity: .8;
    filter: drop-shadow(0 0 6px rgba(var(--lg-accent-rgb), .7));
}
.corner.tl { top: 10px; left: 10px; border-right: 0; border-bottom: 0; border-radius: 6px 0 0 0; }
.corner.tr { top: 10px; right: 10px; border-left: 0; border-bottom: 0; border-radius: 0 6px 0 0; }
.corner.bl { bottom: 10px; left: 10px; border-right: 0; border-top: 0; border-radius: 0 0 0 6px; }
.corner.br { bottom: 10px; right: 10px; border-left: 0; border-top: 0; border-radius: 0 0 6px 0; }

/* ---------- 左：品牌卡 ---------- */
.login-brand {
    position: relative;
    z-index: 2;
    flex: none;
    box-sizing: border-box;
    padding: 34px 34px 28px;
    display: flex;
    flex-direction: column;
    background: linear-gradient(158deg, var(--lg-brand-1) 0%, var(--lg-brand-2) 100%), var(--lg-card-bg);
    border: 1px solid var(--lg-line);
    border-radius: 14px;
    box-shadow: var(--lg-shadow);
    overflow: hidden;
}

/* 2026-11-15：logo 后面那两圈带小圆点的旋转虚线轨道（.orbit / .orbit.rev）
   连同 lg-spin 一起撤掉。虚线弧 + 漂浮圆点在品牌卡里看着像「从 logo 连出去的线」，
   与卡片间穿过的网格线同一类毛病；品牌卡只留干净的文字层次。 */

.brand-mark { position: relative; z-index: 1; margin-bottom: 22px; }
.brand-mark svg { filter: drop-shadow(0 6px 18px rgba(var(--lg-accent-rgb), .45)); }

/* V8.0：贴在 logo 右上角的 AI 徽章，一直轻轻弹跳。
   颜色只认 --lg-* token：翻四套配色时它跟着一起翻；pointer-events:none 保证不挡任何点击。 */
.login-ai-badge {
    position: absolute;
    left: 74px; top: -10px;
    z-index: 3;
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    gap: 1px;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--lg-accent), var(--lg-accent2));
    border: 2px solid rgba(255, 255, 255, .88);
    box-shadow: 0 6px 18px rgba(var(--lg-accent-rgb), .55), 0 0 0 4px rgba(var(--lg-accent-rgb), .12);
    color: #fff;
    font-family: inherit; font-size: 12px; font-weight: 800; line-height: 1;
    letter-spacing: .3px;
    pointer-events: none; user-select: none;
    animation: lg-ai-bounce 1.9s cubic-bezier(.28, .84, .42, 1) infinite;
}
.login-ai-badge .ai-spark { font-size: 13px; line-height: 1; transform: translateY(-3px); }

@keyframes lg-ai-bounce {
    0%, 100% { transform: translateY(0) rotate(-4deg); }
    50%      { transform: translateY(-9px) rotate(4deg) scale(1.06); }
}

.bm-1 { stop-color: var(--lg-btn-1); }
.bm-2 { stop-color: var(--lg-btn-2); }
.bm-3 { stop-color: var(--lg-btn-3); }
.bm-body { fill: #fff; }
.bm-edge { fill: none; stroke: rgba(255, 255, 255, .78); stroke-width: 2.5; }
.bm-detail { fill: none; stroke: rgba(255, 255, 255, .62); stroke-width: 3; stroke-linecap: round; }

/* 扫过 logo 的那条扫描线：只盖 logo 本身。
   原来 left/right 都写 -6px，而 .brand-mark 是列布局里被拉满整行宽的 flex 项，
   于是这条线横穿整张品牌卡，看着像把 logo 和右边连起来的一根线（11-15 收窄）。 */
.brand-mark::after {
    content: "";
    position: absolute;
    left: -6px; right: auto; width: 108px; top: 0;
    height: 3px;
    background: linear-gradient(90deg, transparent, var(--lg-accent), transparent);
    box-shadow: 0 0 14px rgba(var(--lg-accent-rgb), .8);
    animation: lg-scan-y 3.6s ease-in-out infinite;
}

@keyframes lg-scan-y {
    0%, 100% { transform: translateY(0); opacity: 0; }
    12%      { opacity: 1; }
    88%      { opacity: 1; }
    50%      { transform: translateY(94px); }
}

.brand-title {
    position: relative;
    z-index: 1;
    font-size: 27px;
    font-weight: 700;
    letter-spacing: 3px;
    margin-bottom: 12px;
    background: linear-gradient(92deg, var(--lg-title-1) 10%, var(--lg-title-2) 55%, var(--lg-title-3) 95%);
    -webkit-background-clip: text;
    background-clip: text;
    color: transparent;
    /* 渐变底要跟着动，字才有"流光"；不写 background-position 动画就是块死颜色 */
    background-size: 220% 100%;
    animation: lg-hue-slide 7s ease-in-out infinite;
}

@keyframes lg-hue-slide {
    0%, 100% { background-position: 0% 50%; }
    50%      { background-position: 100% 50%; }
}

.brand-slogan {
    position: relative;
    z-index: 1;
    font-size: 13px;
    line-height: 1.8;
    color: var(--lg-ink-dim);
    margin-bottom: 0;
}

/* 卖点四张小卡自己独立成块：字压的底要和原来一样稳，
   用 chip 色 tint 盖在实色 card-bg 上（原来它们就是压在整块卡底上的）。
   2026-11-15：原先每张卡左沿那根 2px 亮竖条撤掉——四根上下对齐、隔着缝，
   看着像一条把四块串起来的虚线；现在每块靠「边框 + 自己的投影 + 留缝」独立成形。 */
.brand-points {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.point {
    position: relative;
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 13px 16px;
    border-radius: 12px;
    border: 1px solid var(--lg-field-bd);
    background-color: var(--lg-card-bg);
    background-image: linear-gradient(0deg, var(--lg-chip-bg), var(--lg-chip-bg));
    box-shadow: var(--lg-card-sm);
    overflow: hidden;
    transition: transform .25s ease, border-color .25s ease,
                background-color .25s ease, box-shadow .25s ease;
    animation: lg-point-in .6s ease-out both;
}

.point:nth-child(1) { animation-delay: .18s; }
.point:nth-child(2) { animation-delay: .30s; }
.point:nth-child(3) { animation-delay: .42s; }
.point:nth-child(4) { animation-delay: .54s; }

@keyframes lg-point-in {
    from { opacity: 0; transform: translateX(-14px); }
    to   { opacity: 1; transform: none; }
}

.point:hover {
    transform: translateY(-2px);
    border-color: rgba(var(--lg-accent-rgb), .42);
    background-color: var(--lg-chip-bg-on);
    box-shadow: 0 6px 14px rgba(6, 14, 34, .14), 0 18px 36px rgba(6, 14, 34, .12);
}

.point-ico {
    font-size: 16px;
    width: 32px; height: 32px;
    flex: none;
    border-radius: 9px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(140deg, rgba(var(--lg-accent-rgb), .20), rgba(var(--lg-accent2-rgb), .20));
    border: 1px solid var(--lg-field-bd);
}

.point-txt b {
    display: block;
    font-size: 14px;
    font-weight: 600;
    margin-bottom: 3px;
    color: var(--lg-ink);
}

.point-txt i {
    display: block;
    font-style: normal;
    font-size: 12px;
    line-height: 1.6;
    color: var(--lg-ink-dim);
}

/* ---------- 右：表单卡 ---------- */
.login-form {
    position: relative;
    z-index: 2;
    flex: 1;
    min-width: 0;
    box-sizing: border-box;
    padding: 36px 44px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    background: var(--lg-card-bg);
    border: 1px solid var(--lg-line);
    border-radius: 14px;
    box-shadow: var(--lg-shadow);
}

.form-title {
    font-size: 20px;
    font-weight: 600;
    letter-spacing: 4px;
    color: var(--lg-ink);
    margin-bottom: 6px;
}

/* 标题下面那条会呼吸的短线 */
.form-rule {
    width: 54px;
    height: 2px;
    margin-bottom: 26px;
    background: linear-gradient(90deg, var(--lg-accent), var(--lg-accent2));
    box-shadow: 0 0 12px rgba(var(--lg-accent-rgb), .8);
    animation: lg-breathe 3.2s ease-in-out infinite;
}

@keyframes lg-breathe {
    0%, 100% { width: 54px; opacity: .85; }
    50%      { width: 96px; opacity: 1; }
}

.login-field { margin-bottom: 16px; }

.login-field label {
    display: block;
    font-size: 12px;
    letter-spacing: 1.4px;
    color: var(--lg-ink-dim);
    margin-bottom: 7px;
}

.login-input-wrap { position: relative; }

.login-input-icon {
    position: absolute;
    left: 12px; top: 50%;
    transform: translateY(-50%);
    font-size: 14px;
    opacity: .7;
    pointer-events: none;
    transition: opacity .2s ease;
    z-index: 2;
}

/* caret-color 明写：深浅两套底都靠这一行保证光标看得见，
   不去动全局的 color-scheme（那是 #app 里原生控件的事）。 */
.login-field input {
    width: 100%;
    height: 44px;
    box-sizing: border-box;
    padding: 0 14px 0 38px;
    font-size: 14px;
    color: var(--lg-ink);
    caret-color: var(--lg-ink);
    background: var(--lg-field-bg);
    border: 1px solid var(--lg-field-bd);
    border-radius: 9px;
    outline: none;
    transition: border-color .22s ease, box-shadow .22s ease, background .22s ease;
}

.login-field input::placeholder { color: var(--lg-placeholder); }

/* 聚焦：描边亮起来 + 底下一条从左往右铺过去的进度条 */
.login-field input:focus {
    border-color: var(--lg-field-bd-on);
    background: var(--lg-field-bg-on);
    box-shadow: 0 0 0 3px rgba(var(--lg-accent-rgb), .10), var(--lg-glow);
}

.login-input-wrap::after {
    content: "";
    position: absolute;
    left: 8px; right: 8px; bottom: 3px;
    height: 1px;
    background: linear-gradient(90deg, var(--lg-accent), var(--lg-accent2));
    transform: scaleX(0);
    transform-origin: left;
    transition: transform .34s cubic-bezier(.16, .84, .34, 1);
    pointer-events: none;
}

.login-input-wrap:focus-within::after { transform: scaleX(1); }
.login-input-wrap:focus-within .login-input-icon { opacity: 1; }

.captcha-row { display: flex; gap: 12px; }
.captcha-row .captcha-input { flex: 1; }

/* 132×44 是后端那张 SVG 的原尺寸（core/captcha.py 里 w, h = 132, 44）：
   一格不差，数字不会被裁掉半笔，也不用 object-fit 去凑。 */
.captcha-img {
    position: relative;
    flex: none;
    width: 132px;
    height: 44px;
    padding: 0;
    border: 1px solid var(--lg-field-bd);
    border-radius: 9px;
    background: var(--lg-field-bg);
    color: var(--lg-ink-dim);
    font-size: 12px;
    cursor: pointer;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: border-color .2s ease, box-shadow .2s ease;
}

.captcha-img:hover { border-color: var(--lg-field-bd-on); box-shadow: var(--lg-glow); }
.captcha-img img { display: block; width: 100%; height: 100%; }
.captcha-loading { font-size: 12px; color: var(--lg-ink-dim); }

/* 验证码框上慢慢下移的扫描线 */
.captcha-img::after {
    content: "";
    position: absolute;
    left: 0; right: 0; top: 0;
    height: 2px;
    background: linear-gradient(90deg, transparent, var(--lg-accent), transparent);
    animation: lg-cap-scan 2.8s ease-in-out infinite;
}

@keyframes lg-cap-scan {
    0%, 100% { transform: translateY(0); opacity: 0; }
    10%      { opacity: .9; }
    90%      { opacity: .9; }
    50%      { transform: translateY(42px); }
}

.login-hint { margin: 6px 0 0; font-size: 11.5px; color: var(--lg-ink-dim); }
.login-hint.ok { color: var(--lg-ok); }
.login-hint.bad { color: var(--lg-bad-solid); }
.login-hint b { color: var(--lg-ink); }

.login-error {
    margin: 4px 0 14px;
    padding: 10px 12px;
    font-size: 12.5px;
    line-height: 1.6;
    color: var(--lg-bad-ink);
    background: var(--lg-bad-bg);
    border: 1px solid var(--lg-bad-bd);
    border-left: 3px solid var(--lg-bad-solid);
    border-radius: 8px;
    animation: lg-shake .38s ease-out;
}

@keyframes lg-shake {
    0%, 100% { transform: translateX(0); }
    25%      { transform: translateX(-5px); }
    75%      { transform: translateX(5px); }
}

.login-btns { display: flex; gap: 12px; margin-top: 6px; }

.login-btn {
    position: relative;
    flex: 1;
    height: 46px;
    border: 0;
    border-radius: 10px;
    font-size: 15px;
    font-weight: 600;
    letter-spacing: 4px;
    color: var(--lg-btn-ink);
    cursor: pointer;
    overflow: hidden;
    background: linear-gradient(92deg, var(--lg-btn-1) 0%, var(--lg-btn-2) 48%, var(--lg-btn-3) 100%);
    box-shadow: 0 10px 26px rgba(var(--lg-accent-rgb), .28);
    transition: filter .28s ease, transform .12s ease, box-shadow .28s ease;
}

/* 悬停时一道高光从左扫到右 */
.login-btn::after {
    content: "";
    position: absolute;
    top: 0; bottom: 0; left: -60%;
    width: 45%;
    background: linear-gradient(100deg, transparent, rgba(255, 255, 255, .38), transparent);
    transform: skewX(-18deg);
    transition: left .55s ease;
}

/* 悬停改的是 filter 不是 background-position：三段渐变本来就没得"移动"。 */
.login-btn:hover {
    filter: hue-rotate(-8deg) saturate(1.12) brightness(1.06);
    box-shadow: 0 12px 34px rgba(var(--lg-accent-rgb), .38), var(--lg-glow);
}
.login-btn:hover::after { left: 120%; }
.login-btn:active { transform: translateY(1px) scale(.995); }

.login-btn.reset {
    flex: none;
    width: 108px;
    color: var(--lg-ink);
    background: var(--lg-field-bg);
    border: 1px solid var(--lg-field-bd);
    box-shadow: none;
    letter-spacing: 2px;
}
.login-btn.reset:hover {
    border-color: var(--lg-field-bd-on);
    box-shadow: var(--lg-glow);
    background: var(--lg-field-bg-on);
    filter: none;
}
.login-btn:disabled { opacity: .55; cursor: progress; }

.login-suggest { margin-top: 16px; font-size: 11.5px; color: var(--lg-ink-dim); }

/* 工信部 ICP 备案号：法规要求对外首页底部展示，整条固定在登录层最下方横排一行。
   备案号是标识符，无中英之分。用 absolute 钉在 #login-overlay 底边，不挤登录面板。 */
.login-beian {
    position: absolute;
    left: 0; right: 0; bottom: 12px;
    z-index: 5;
    text-align: center;
    pointer-events: none; /* 只有链接本身可点，别让整条横栏挡住画布交互 */
}
.login-beian a {
    pointer-events: auto;
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 5px 14px;
    border-radius: 20px;
    background: var(--lg-glass);
    border: 1px solid var(--lg-line);
    font-size: 11.5px;
    color: var(--lg-ink);
    text-decoration: none;
    box-shadow: var(--lg-card-sm);
    transition: color .2s, border-color .2s;
}
.login-beian a:hover { color: var(--lg-accent); border-color: var(--lg-accent); text-decoration: none; }
.login-beian svg { width: 15px; height: 15px; flex: none; color: var(--lg-accent); }

/* 2026-11-15：底部版权/隔离说明那行页脚整条删掉，连样式一起撤，
   省得以后有人以为还有个 .login-footer 可以往里塞东西。 */

/* 窄屏：品牌区收到上面，只留标题+标语。
   收到多小是有讲究的——「登 录」那颗必须不滚就到（手机打开登录页还要往下拖，
   等于把主按钮藏到第二屏）。所以这里连 logo、标语、格高一起压，不是只藏卖点。 */
@media (max-width: 880px) {
    .login-shell { flex-direction: column; }
    .login-overlay { padding-top: 48px; }
    .login-side { width: 100%; }
    .login-brand { padding: 20px 22px; }
    .brand-mark { margin-bottom: 10px; }
    .brand-mark svg { width: 58px; height: 58px; }
    .login-ai-badge { left: 46px; top: -6px; width: 30px; height: 30px; font-size: 10px; }
    .login-ai-badge .ai-spark { font-size: 10px; transform: translateY(-2px); }
    .brand-mark::after { display: none; }   /* 扫描线按 96px 那档走的位移，logo 缩了就扫到框外面 */
    .brand-title { font-size: 21px; letter-spacing: 2px; margin-bottom: 6px; }
    .brand-slogan { margin-bottom: 0; font-size: 12px; line-height: 1.6; }
    .brand-points { display: none; }
    .login-form { padding: 18px 22px 26px; }
    .form-title { font-size: 17px; margin-bottom: 4px; }
    .form-rule { margin-bottom: 16px; }
    .login-field { margin-bottom: 12px; }
    .login-field input { height: 42px; }
    .login-btn { height: 44px; }
    .login-suggest { margin-top: 10px; }
    .hud-bar { letter-spacing: .8px; font-size: 10.5px; gap: 10px; }
    /* 顶栏那一行窄屏只留三样：状态点、四颗配色、时钟。
       "MATERIAL · ERP / V7.0" 是气氛字，不是门槛，挤掉它换取四颗胶囊不折行。 */
    .hud-id { display: none; }
    .pal-pill { padding: 3px 8px; }
    .lang-pill { padding: 3px 8px; }
}

/* 系统里开了"减少动效"就老实用静态底：动画一条不跑，画布只画一帧 */
@media (prefers-reduced-motion: reduce) {
    .sky-sweep, .login-shell, .login-shell::before, .brand-title, .form-rule,
    .brand-mark::after, .captcha-img::after, .point, .hud-bar .dot, .login-ai-badge {
        animation: none !important;
    }
    .login-shell::before { opacity: .25; }
}

/* ---------------------------------------------------------------------------
   分析报表（2026-10-31）：图表网格 + 明细区
   图表那几块的高度要写死：canvas 自己没有"内容高度"这回事，
   不给父容器一个高度，Chart.js 按 responsive 一撑就把页面顶到无限高。
   --------------------------------------------------------------------------- */
.chart-grid {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px;
    margin-top: 12px;
}

.chart-box {
    background: var(--head);
    border: 1px solid var(--border);
    padding: 8px 10px 10px;
    min-width: 0;                 /* 网格里的子项不给这一句，长标签会把列撑破 */
}

.chart-box .cb-title {
    font-size: 12px;
    color: var(--muted);
    margin-bottom: 6px;
    display: flex;
    justify-content: space-between;
    gap: 8px;
}

.chart-box .cb-title .cb-tip {
    font-size: 11px;
    opacity: .8;
}

.chart-box .cb-canvas {
    position: relative;
    height: 240px;
}

.chart-box .cb-empty {
    height: 240px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--muted);
    font-size: 12px;
    text-align: center;
    padding: 0 12px;
    line-height: 1.7;
}

.an-detail {
    margin-top: 12px;
}

.an-detail .gtab-bar {
    display: flex;
    gap: 6px;
    margin-bottom: 8px;
    flex-wrap: wrap;
}

.an-detail .gtab {
    padding: 4px 12px;
    font-size: 12px;
    border: 1px solid var(--border);
    background: var(--panel);
    cursor: pointer;
}

.an-detail .gtab.active {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
}

.an-detail .an-note {
    font-size: 12px;
    color: var(--muted);
    margin: 6px 0;
    line-height: 1.7;
}

@media (max-width: 1100px) {
    .chart-grid { grid-template-columns: 1fr; }
}

/* 型号弹窗里仓库/库位格旁的「新增」按钮（禅道 #34） */
.mini-add { width: 24px; height: 24px; padding: 0; margin-left: 4px; border-radius: 4px;
    border: 1px solid var(--border, #ccc); background: #f4f6f9; color: #357; font-weight: 700;
    cursor: pointer; line-height: 1; }
.mini-add:hover { background: #e3eefb; }

/* 审批流·规则表（2026-11-04）：一个审批流程一行，各级排成一串 */
.ap-step {
    display: inline-flex; align-items: center; gap: 4px;
    border: 1px solid #c9cdd4; border-radius: 12px;
    padding: 2px 8px; margin: 1px 0; font-size: 12px; background: #f7f8fa;
}
.ap-step[data-on="0"] { opacity: .55; text-decoration: line-through; }
.ap-step-x {
    border: 0; background: none; color: #d03050; cursor: pointer;
    font-size: 12px; line-height: 1; padding: 0 0 0 2px;
}
.ap-arrow { margin: 0 8px; color: #8a8f99; }
.ap-step-btn {
    border: 0; background: none; color: #4a6785; cursor: pointer;
    font-size: 12px; line-height: 1; padding: 0 1px;
}
.ap-step-btn:hover { color: #1a3c5e; }
.ap-edit-sel { font-size: 12px; max-width: 140px; }

/* 审批流程编辑器（2026-11-04）：每条流程一张卡 + 一个新增/编辑表单 */
.ap-flow { border: 1px solid var(--border, #e5e6eb); border-radius: 8px;
    padding: 10px 12px; margin-bottom: 10px; background: #fff; }
.ap-flow-head { display: flex; align-items: center; flex-wrap: wrap; gap: 10px; }
.ap-flow-ttl { font-size: 14px; }
.ap-amt { color: #8a8f99; font-weight: 400; font-size: 12px; margin-left: 4px; }
.ap-flow-meta { color: #8a8f99; font-size: 12px; }
.ap-flow-meta .ap-off { color: #d03050; }
.ap-flow-head .panel-actions { margin-left: auto; gap: 6px; }
.ap-chain { margin-top: 8px; display: flex; flex-wrap: wrap; align-items: center; }
.ap-step { display: inline-flex; align-items: center; gap: 4px;
    border: 1px solid #c9cdd4; border-radius: 12px;
    padding: 2px 8px; margin: 1px 0; font-size: 12px; background: #f7f8fa; }
.ap-step.ap-step-off { opacity: .55; text-decoration: line-through; }
.ap-step-x { border: 0; background: none; color: #d03050; cursor: pointer;
    font-size: 12px; line-height: 1; padding: 0 0 0 2px; }
.ap-editor { border: 1px dashed #4a6785; border-radius: 8px; padding: 12px; margin-top: 10px; background: #fbfdff; }
.ap-editor-title { font-weight: 700; margin-bottom: 8px; color: #1a3c5e; }

/* ============================================================================
 * 全站补漏（2026-11-04 第二轮）：审计出「页面在用、style.css 没定义」的类。
 * 上一轮补的是 panel-head/panel-toolbar/data-table 那一批，这一轮是按钮/tag/说明
 * 文这一批。原则不变：不改几十个页面，缺的样式补到这里，全部走主题变量，
 * 新旧两套页面观感立刻一致。
 * ==========================================================================*/

/* ---- 按钮别名 ----
 * CSS 定的是 .btn.primary / .btn.danger（空格连写），可一半页面写的是
 * btn-primary / btn-danger（横线）——没定义就退化成普通灰按钮，
 * 「＋ 新建项目」和「新建单据」长得不一样就是这么来的。补上别名。
 * danger 的最终样子认的是后写的浅红版（3061 行），别名照它对齐。 */
.btn.primary, .btn-primary {
    background: var(--accent);
    color: #fff;
    border-color: var(--accent);
    font-weight: bold;
}
.btn.primary:hover, .btn-primary:hover {
    background: var(--accent);
    border-color: var(--accent);
    filter: brightness(0.95);
}
.btn.danger, .btn-danger {
    color: #c0392b;
    border-color: #e2b0aa;
    background: #fdf3f2;
}
.btn.danger:hover, .btn-danger:hover {
    background: #fbe9e7;
}

/* ---- 行内小按钮 ----
 * 车间单/质检/工程变更那批表格行内的「删 / 选它 / 作废 / 加一行」写的是
 * class="btn sm"，而 CSS 定的是 .btn-sm（横线）——34 处小按钮全是全尺寸。
 * 补 .btn.sm 同档，跟 .btn-sm 一个口径。 */
.btn.sm {
    padding: 2px 8px;
    font-size: 12px;
}

/* ---- 状态 tag 补两个语义色 ----
 * woTag 映射里有 tag-warn（已下达/采购建议）和 tag-done（完工），
 * tag-on/tag-off/tag-green 都有定义，就这两个漏了。颜色跟 tag-orange / tag-green 同档。 */
.tag-warn { background: #ffe5cc; color: #8a4d00; }
.tag-done { background: #d4edda; color: #155724; }

/* ---- ops.js（操作日志 / 单据轨迹 / 佣金台账 / 单据体检）----
 * 这一整个文件用的 .hint（灰字说明）和 .table（表格）都没定义，
 * 四个页面一直在裸奔。.table 对齐 .data-table 的口径，但留全边框——
 * 嵌在单据轨迹里当对比表用，没框看不出格子。 */
.hint {
    font-size: 12.5px;
    color: var(--muted);
    margin: 6px 0;
    line-height: 1.7;
}
.table {
    width: 100%;
    border-collapse: collapse;
    margin: 6px 0;
}
.table th, .table td {
    border: 1px solid var(--border);
    padding: 5px 8px;
    text-align: left;
    vertical-align: middle;
}
.table th {
    background: var(--head);
    color: var(--muted);
    font-weight: 600;
    white-space: nowrap;
}
.au-diff-table { margin: 4px 0 0; }

/* ---- 银行互转弹窗（.form-grid 里套 .field）----
 * form-field 那套有定义，field 这套没有——label 和输入框、灰字提示
 * 挤成一坨。照 .form-field 同一档补。 */
.form-grid .field {
    display: flex;
    flex-direction: column;
    gap: 4px;
}
.form-grid .field > label {
    font-size: 13px;
    color: var(--text);
    font-weight: 500;
}

/* ---- 销售看板列头 ----
 * kanban-head 有定义，里面的 .kb-title 没有——状态名和计数挤在一起没分量。 */
.kb-title {
    font-weight: 600;
    display: flex;
    align-items: center;
    gap: 6px;
}

/* ---- 新手引导底栏 ----
 * 「上一步 / 下一步 / 不再自动提示」三颗中间的弹簧，没有它三颗钮挤在左边。 */
.ob-spacer { flex: 1; }

/* ============================================================================
 * 打印表格兜底（2026-11-05）：纸上那几张表一律按真表格排，左右两端齐平
 *
 * 现象：销售合同的打印预览里，供方/需方表、明细表、双方资料表三张表右端参差，
 *       整块只占纸宽的一半左右，右边空一大条白；合同条款那几行字反倒顶到了右边距。
 * 根因：@media print 写在 2320 行，而「窄屏 <=768px」那组响应式规则在 3412 行之后。
 *       Chrome 打印时 media query 的 width 按 A4 内容区算（190mm ≈ 718px），718 < 768
 *       照样命中，那组里的 table { display:block; overflow-x:auto; white-space:nowrap }
 *       把三张表全改成了块盒。块盒自身是 width:100% 没错，但它里面那张匿名表格是
 *       shrink-to-fit，边框只画到内容宽度——三张表内容长短不同，右端就各走各的。
 * 这一块故意放在全文件最后：顺序在所有响应式规则之后，再用 #print-root 加前缀、
 *       关键属性上 !important，屏幕上一律不生效。其它单据（送货单/对帐单…）的
 *       打印表也被那条窄屏规则带歪过，这里一并扶正。
 * ============================================================================ */
@media print {
    html, body { margin: 0 !important; padding: 0 !important; }
    #print-root {
        display: block !important;
        width: 100% !important;
        max-width: none !important;
    }
    #print-root table {
        display: table !important;
        width: 100% !important;
        max-width: none !important;
        min-width: 0 !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
        border-collapse: collapse !important;
        table-layout: auto;
        white-space: normal !important;
        overflow: visible !important;
        background: transparent !important;
    }
    #print-root table thead { display: table-header-group !important; }
    #print-root table tbody { display: table-row-group !important; }
    #print-root table tfoot { display: table-footer-group !important; }
    #print-root table tr { display: table-row !important; }
    #print-root table th,
    #print-root table td { display: table-cell !important; }

    /* 合同三张表同一条左右基准线：顶到纸面可用宽的两端 */
    #print-root .contract-sheet,
    #print-root .contract-head,
    #print-root .contract-items,
    #print-root .contract-parties {
        width: 100% !important;
        margin-left: 0 !important;
        margin-right: 0 !important;
    }
}

/* ============================================================================
 * 打印配图可视化预览编辑器（2026-11-06）：设置页里那张缩小的「纸」，直接拖图进来、
 * 拖着摆位、拖角缩放，保存时把每张图「占整张纸的比例」一起存。屏幕 UI，和打印无关。
 * ============================================================================ */
.pi-surface {
    position: relative; width: 100%; max-width: 720px; margin: 10px 0;
    background: #fff; border: 1px solid var(--border); box-shadow: 0 1px 4px rgba(0,0,0,.08);
    overflow: hidden; touch-action: none; user-select: none;
}
.pi-surface.pi-drag { outline: 2px dashed #2b7de9; outline-offset: -4px; }
.pi-mock-header { text-align: center; padding: 14px 10px 6px; pointer-events: none; }
.pi-mock-name { font-size: 18px; font-weight: 700; }
.pi-mock-addr { font-size: 11px; color: #555; margin-top: 4px; }
.pi-mock-title { text-align: center; font-size: 18px; font-weight: 700; letter-spacing: 6px; margin: 6px 0 12px; pointer-events: none; }
.pi-imgs { position: absolute; left: 0; top: 0; right: 0; bottom: 0; }
.pi-img { position: absolute; border: 1px solid #2b7de9; cursor: move; box-shadow: 0 0 0 1px #fff inset; }
.pi-img.sel { border-color: #e63946; box-shadow: 0 0 0 2px rgba(230,57,70,.35); }
.pi-img img { display: block; width: 100%; height: 100%; object-fit: cover; pointer-events: none; }
.pi-img .pi-resize {
    position: absolute; right: -6px; bottom: -6px; width: 13px; height: 13px;
    background: #2b7de9; border: 1px solid #fff; border-radius: 2px; cursor: nwse-resize;
}
.pi-img.sel .pi-resize { background: #e63946; }
.pi-drop { position: absolute; left: 0; right: 0; bottom: 8px; text-align: center; font-size: 12px; color: #999; pointer-events: none; }
.pi-list { margin-top: 10px; max-width: 720px; }
.pi-list-item { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.pi-thumb { width: 40px; height: 40px; object-fit: cover; border: 1px solid var(--border); background: #fff; }

/* ---- 自定义功能球中心：全部功能标签汇成一颗立体不断转动的球 ---- */
.fb-page { height: 100%; display: flex; flex-direction: column; gap: 10px; min-height: 0; }
.fb-head { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; flex: 0 0 auto; }
.fb-title { display: flex; align-items: baseline; gap: 10px; margin-right: auto; }
.fb-title b { font-size: 16px; }
.fb-sub { font-size: 12px; color: var(--muted); }
.fb-q {
    width: 210px; max-width: 42vw; padding: 6px 11px; font-size: 12px;
    color: var(--text); background: var(--panel); border: 1px solid var(--border);
    border-radius: 999px; outline: none;
}
.fb-q:focus { border-color: var(--accent); }
.fb-toggle {
    padding: 6px 12px; font-size: 12px; cursor: pointer; color: var(--text);
    background: var(--panel); border: 1px solid var(--border); border-radius: 999px;
}
.fb-toggle:hover { border-color: var(--accent); color: var(--accent); }
.fb-stage {
    --fb-r: 260px; --fb-rgb: 37, 99, 235;
    position: relative; flex: 1; min-height: 320px; overflow: hidden;
    border-radius: 14px; border: 1px solid var(--border);
    perspective: 900px; perspective-origin: 50% 50%;
    touch-action: none; cursor: grab; user-select: none;
    background: radial-gradient(circle at 50% 42%, rgba(var(--fb-rgb), .10) 0%, rgba(var(--fb-rgb), .035) 46%, transparent 72%), var(--bg);
}
.fb-stage.fb-dragging { cursor: grabbing; }
.fb-stage::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; opacity: .45;
    background-image: radial-gradient(rgba(var(--fb-rgb), .38) 1px, transparent 1px);
    background-size: 34px 34px;
}
.fb-core {
    position: absolute; left: 50%; top: 50%; width: 170px; height: 170px; margin: -85px 0 0 -85px;
    border-radius: 50%; pointer-events: none; filter: blur(9px);
    background: radial-gradient(circle, rgba(var(--fb-rgb), .18), rgba(var(--fb-rgb), .05) 55%, transparent 72%);
}
.fb-ring {
    position: absolute; left: 50%; top: 50%; pointer-events: none; border-radius: 50%;
    width: calc(var(--fb-r) * 2); height: calc(var(--fb-r) * 2);
    margin-left: calc(var(--fb-r) * -1); margin-top: calc(var(--fb-r) * -1);
    border: 1px solid rgba(var(--fb-rgb), .20);
}
.fb-ring-a { transform: rotateX(74deg); }
.fb-ring-b { transform: rotateY(68deg); }
.fb-sphere {
    position: absolute; left: 50%; top: 50%; width: 0; height: 0;
    transform-style: preserve-3d; will-change: transform;
}
.fb-tag {
    position: absolute; left: 0; top: 0; white-space: nowrap; user-select: none;
    transform: rotateY(var(--fb-lon)) rotateX(var(--fb-lat)) translateZ(var(--fb-r)) translate(-50%, -50%);
    padding: 4px 10px; font-size: 12px; line-height: 1.4; color: var(--text);
    background: rgba(var(--fb-rgb), .07);
    border: 1px solid rgba(var(--fb-rgb), .34); border-radius: 999px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, .06);
    backdrop-filter: blur(2px); -webkit-backdrop-filter: blur(2px);
    backface-visibility: hidden; -webkit-backface-visibility: hidden;
    cursor: pointer; transition: opacity .2s ease, background .2s ease, box-shadow .2s ease, border-color .2s ease;
}
.fb-tag:hover {
    background: rgba(var(--fb-rgb), .20); border-color: rgba(var(--fb-rgb), .7);
    box-shadow: 0 0 14px rgba(var(--fb-rgb), .32);
}
.fb-tag.fb-dim { opacity: .12; pointer-events: none; }
.fb-hint {
    position: absolute; left: 0; right: 0; bottom: 10px; text-align: center; pointer-events: none;
    font-size: 11px; color: var(--muted);
}
@media (max-width: 700px) {
    .fb-q { width: 140px; }
    .fb-tag { font-size: 11px; padding: 3px 7px; }
    .fb-stage { min-height: 260px; }
}

/* 编辑态：顶栏自建中心的改名入口（✎），以及就地改名输入框 */
body.pl-editing .mod-switch button .pl-act {
    position: absolute; right: -7px; bottom: -7px; top: auto; left: auto; z-index: 5; margin-left: 0;
    width: 18px; height: 18px; font-size: 13px; color: #1c2430;
    background: #fbbf24; border-color: #f59e0b;
    box-shadow: 0 0 0 2px var(--toolbar-bg, #1e3a5f), 0 2px 6px rgba(0, 0, 0, .3);
}
body.pl-editing .mod-switch button .pl-act:hover { background: #fcd34d; }
body.pl-editing .mod-switch button .pl-mod-rename {
    position: absolute; inset: 2px; width: calc(100% - 4px); height: calc(100% - 4px);
    z-index: 6; margin: 0; padding: 2px 3px; text-align: center; font-size: 12px;
    color: var(--text, #1c2430); background: var(--input-bg, #fff);
}
.pi-list-item .pi-label { flex: 0 0 auto; }

/* 合同印章编辑器（2026-11-06 禅道 #60）：预览框本身就代表「供方资料」那一块，
   章只能在框内拖动、拖右下角缩放——所见即所得，保证打印时压在供方资料上。
   屏幕 UI，和打印无关。 */
.seal-surface { overflow: hidden; }
.seal-block-label {
    position: absolute; left: 8px; top: 6px; font-size: 12px; font-weight: 700;
    color: #c0392b; background: rgba(192, 57, 43, .06);
    border: 1px dashed #c0392b; padding: 2px 8px; pointer-events: none;
}
/* 出货单章编辑器上方延伸区：章可往上盖到签字区外（对应打印时压到条款区那一行） */
.seal-ext {
    position: absolute; left: 0; top: 0; width: 100%; pointer-events: none;
    background: repeating-linear-gradient(45deg, #fafafa, #fafafa 8px, #f3f3f3 8px, #f3f3f3 16px);
    display: flex; align-items: center; justify-content: center;
}
.seal-ext-tip { font-size: 11px; color: #8a8a8a; }
.seal-ext-line { position: absolute; left: 0; width: 100%; border-top: 1px dashed #c0392b; pointer-events: none; }
.seal-box {
    position: absolute; cursor: move; border: 1px solid #c0392b;
    box-shadow: 0 0 0 1px #fff inset;
}
.seal-box img { display: block; width: 100%; height: auto; pointer-events: none; }
.seal-box .pi-resize {
    position: absolute; right: -6px; bottom: -6px; width: 13px; height: 13px;
    background: #c0392b; border: 1px solid #fff; border-radius: 2px; cursor: nwse-resize;
}

/* 禅道 #70（2026-11-11）：没「库存查询 · 看成本金额」那一格时，型号选择浮窗 /
   搜索物料弹窗里那些直接拼出来的成本格一起收掉。标记由 loadMe() 挂在 body 上，
   后端同一时刻也把接口里对应字段裁掉，不是只做障眼法。 */
.no-cost-view .cost-col { display: none !important; }

/* ============================================================================
 * V7.7 基础设置「外观与语言」：原来主题只有左下角一颗 🌙，设置页里找不到板块。
 * 这里给设置页补一组卡片 + 分段选择器，三处入口共用 index.html 头部的状态函数。
 * 只加新类、不动旧规则；白天/黑夜都吃 :root 变量，深色不用再抄一遍。
 * ============================================================================ */
.set-card {
    border: 1px solid var(--border); border-radius: 10px;
    background: var(--panel); padding: 18px 20px 20px;
    margin: 0 0 20px; max-width: 760px;
}
.set-card-head { display: flex; align-items: center; gap: 10px; margin-bottom: 6px; }
.set-card-head h3 { margin: 0; font-size: 15px; font-weight: 600; }
.set-card-ico {
    display: inline-flex; align-items: center; justify-content: center;
    width: 28px; height: 28px; border-radius: 8px;
    background: rgba(59, 130, 246, .12); font-size: 15px;
}
.set-card-note {
    color: var(--muted); font-size: 12px; line-height: 1.7;
    margin: 0 0 8px 38px;
}
.set-row {
    display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
    padding: 12px 0; border-top: 1px dashed var(--border);
}
.set-row-label { width: 106px; flex: none; font-size: 13px; }
.set-row-ctl { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.set-state { color: var(--muted); font-size: 12px; }
/* 其余小节（送货单信息 / 固定抬头 …）不改结构，标题字号跟卡片里那一行对齐 */
.set-sec > h3 { font-size: 15px; font-weight: 600; margin: 0 0 14px; }
.set-choices {
    display: inline-flex; border: 1px solid var(--border);
    border-radius: 8px; overflow: hidden;
}
.set-choices button {
    border: none; border-right: 1px solid var(--border);
    background: var(--panel); color: var(--text);
    padding: 7px 14px; font-size: 13px; line-height: 1.4; cursor: pointer;
    transition: background-color .18s ease, color .18s ease;
}
.set-choices button:last-child { border-right: none; }
.set-choices button:hover:not(:disabled) { background: rgba(59, 130, 246, .10); }
.set-choices button.on { background: var(--accent); color: #fff; font-weight: 600; }
.set-choices button.on:hover { background: var(--accent); }
.set-choices button:disabled { opacity: .45; cursor: not-allowed; }
:root[data-theme="dark"] .set-choices button.on { background: rgba(59, 130, 246, .55); }
:root[data-theme="dark"] .set-card-ico { background: rgba(59, 130, 246, .22); }

/* 键盘可达：顶栏语言钮 / 左下角主题钮 / 设置页分段控件统一焦点环 */
.toolbar .lang-pill:focus-visible,
.theme-toggle:focus-visible,
.set-choices button:focus-visible,
.pal-pill:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

/* 翻主题时背景与文字有个短过渡，别硬切一下 */
body, .panel, .toolbar, .nav-side, .content, .set-card {
    transition: background-color .2s ease, color .2s ease, border-color .2s ease;
}
@media (prefers-reduced-motion: reduce) {
    body, .panel, .toolbar, .nav-side, .content, .set-card,
    .set-choices button { transition: none; }
}

/* 2026-11-14 单据明细：批号格旁边的只读批次编码。
   同一个 td 里并排，不新增列；通用规则 .items-table input{width:100%} 会把小标签
   挤到下一行，这里给这一格单独收窄 input。没有编码时 :empty 直接不占位。 */
.doc-items-table td.lot-cell { white-space: nowrap; }
.doc-items-table td.lot-cell .item-lot {
    width: calc(100% - 92px);
    min-width: 56px;
}
.doc-items-table td.lot-cell .item-batch-no {
    display: inline-block;
    margin-left: 4px;
    font-size: 11px;
    line-height: 18px;
    color: #64748b;
    vertical-align: middle;
    white-space: nowrap;
    user-select: all;
}
.doc-items-table td.lot-cell .item-batch-no:empty { display: none; }

/* 2026-11-14：数字格「显示不全」的根治。
   数量是 type=number，Chrome 右侧那对上下箭头常驻，加上 .items-table input 的
   2px 4px 内边距，78px 的列里能写字的地方只剩四十来像素 —— 4,545,545 只露出
   前面几位。去掉箭头、左右内边距收到 2px、数字用等宽字形，同样的列宽能写到
   九位；再配合 ITEM_COLS 里那三列适度加宽，整条数就完整了。 */
.doc-items-table td input[type="number"] {
    -moz-appearance: textfield;
    appearance: textfield;
    padding-left: 2px;
    padding-right: 2px;
    font-variant-numeric: tabular-nums;
}
.doc-items-table td input[type="number"]::-webkit-outer-spin-button,
.doc-items-table td input[type="number"]::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}
/* 只读的「库存量」是 text 格，没有箭头，同样收紧内边距让长数显示得下 */
.doc-items-table td .item-stock-qty {
    padding-left: 2px;
    padding-right: 2px;
    font-variant-numeric: tabular-nums;
}
/* 本单数量超过开单时库存：预计剩余按 0 显示，红字提示去核对，不摆一个负数 */
.doc-items-table td .item-stock-qty.stock-over {
    color: #b91c1c;
    font-weight: 600;
}

/* 2026-11-14：整页变红报错层。
   body 直属、与 #modal-overlay 同级：#content / .items-scroll 都是 overflow:auto，
   挂在里面会被裁。描边层 pointer-events:none，只有顶部红条能点，不挡人改数量。
   z-index 6000 高于现有最高一档（新手教程 5003）。 */
#page-error-layer {
    position: fixed;
    inset: 0;
    z-index: 6000;
    pointer-events: none;
}
#page-error-layer.hidden { display: none; }
#page-error-layer::before {
    content: '';
    position: absolute;
    inset: 0;
    border: 4px solid #dc2626;
    background: rgba(220, 38, 38, .05);
    box-shadow: inset 0 0 0 4px rgba(220, 38, 38, .12);
}
body.page-has-error #content { background: rgba(220, 38, 38, .06); }
.page-error-banner {
    position: absolute;
    top: 14px;
    left: 50%;
    transform: translateX(-50%);
    width: min(780px, calc(100vw - 40px));
    box-sizing: border-box;
    background: #b91c1c;
    border: 2px solid #7f1d1d;
    border-radius: 8px;
    padding: 10px 14px;
    box-shadow: 0 12px 32px rgba(0, 0, 0, .28);
    color: #fff;
    font-size: 13px;
    line-height: 1.6;
    pointer-events: auto;
}
/* 全局 `* { color: var(--text) }` 会把白字压回主题色，连子元素一起点名 */
.page-error-banner, .page-error-banner * { color: #fff; }
.page-error-title { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 14px; }
.page-error-icon {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; border-radius: 50%;
    background: #fff; color: #b91c1c !important; font-weight: 800;
}
.page-error-close {
    margin-left: auto;
    background: #fff; color: #b91c1c !important;
    border: 0; border-radius: 4px; padding: 3px 12px;
    font-weight: 700; cursor: pointer;
}
.page-error-banner ul { margin: 6px 0 0; padding-left: 20px; max-height: 170px; overflow: auto; }
.page-error-banner li { margin: 3px 0; }

/* ---- 新增/再次业务询价弹窗：三列等宽，合并格控件均分，左侧不被撑宽 ----
   .bi-cell 是每格的 label；.bi-pair 是「客接受价+单位+币种 / 报价+币种」那种一格多控件。
   min-width:0 是关键：grid item 和 flex item 默认 min-width:auto，
   input/select 会按内容宽度把这一列顶宽，三列 1fr 就分成「两宽一窄」。 */
.bi-form-grid > .bi-cell { min-width: 0; font-size: 12px; color: #444; }
.bi-form-grid .bi-solo,
.bi-form-grid .bi-pair { display: flex; width: 100%; min-width: 0; gap: 4px; }
.bi-form-grid .bi-solo > .ipt,
.bi-form-grid .bi-pair > .ipt { flex: 1 1 0; width: 100%; min-width: 0; box-sizing: border-box; }

/* 顶栏风格按钮：用一颗小方块当图标，不写「圆角/直角」文字。
   圆角风格下方块自带圆角；切直角后由下面 html.ui-square * 的规则自动变成方角。 */
.ui-style-icon {
    display: inline-block; width: 12px; height: 12px;
    border: 1.5px solid currentColor; border-radius: 4px;
    box-sizing: border-box; vertical-align: -1px;
}

/* 顶栏布局按钮：一枚「上标题栏 + 左右两栏」的分栏图标，跟风格/配色图标同尺寸。
   进入编辑态只靠 .on 高亮和 title 提示，不再把文字写进按钮把图标冲掉。 */
.page-layout-icon {
    display: inline-block; position: relative;
    width: 12px; height: 12px; border: 1.5px solid currentColor;
    border-radius: 2px; box-sizing: border-box; vertical-align: -1px;
}
.page-layout-icon::before,
.page-layout-icon::after { content: ''; position: absolute; background: currentColor; }
.page-layout-icon::before { left: 0; right: 0; top: 3px; height: 1.5px; }
.page-layout-icon::after { left: 5px; top: 4.5px; bottom: 0; width: 1.5px; }

/* ---- 界面风格切换：圆角 / 直角（账号级偏好 /api/prefs 的「界面风格」键）----
   切换只在 <html> 上挂一颗 ui-square：当前已开的页面、标签、弹窗一次性全部生效，
   新画的控件也自动跟着走，不用逐页重绘。
   一刀切掉所有风格化圆角（按钮/卡片/输入框/徽章/胶囊/伪元素装饰）；
   只留下几何圆点（未读点、状态点、错误图标）和滚动条的圆——那是语义，不是风格。 */
html.ui-square *,
html.ui-square *::before,
html.ui-square *::after { border-radius: 0 !important; }
html.ui-square .ob-dot,
html.ui-square .nf-dot,
html.ui-square .hud-bar .dot,
html.ui-square .page-error-icon { border-radius: 50% !important; }
html.ui-square ::-webkit-scrollbar-thumb { border-radius: 99px !important; }
/* premium.css 给顶栏按钮写死了 8px !important，这里用更高特异性压回去 */
html.ui-square #app .toolbar .lang-pill,
html.ui-square #app .toolbar .logout-btn { border-radius: 0 !important; }

/* ---- 业务询价弹窗：傻瓜式排布（工具条 + 编辑态格子）---- */
.bi-layout-bar {
    display: flex; flex-wrap: wrap; align-items: center; gap: 6px 10px;
    margin-bottom: 10px; padding: 8px 10px;
    background: #f5f8ff; border: 1px solid #d6e2ff; border-radius: 6px;
    font-size: 12px; color: #445;
}
.bi-layout-bar[hidden] { display: none; }
.bi-layout-bar b { color: #2563eb; }
.bi-layout-bar span { flex: 1 1 100%; color: #667; }
.bi-layout-bar button {
    padding: 4px 10px; font-size: 12px; cursor: pointer;
    border: 1px solid #b9cdf5; border-radius: 4px;
    background: #fff; color: #2b5fb3;
}
.bi-layout-bar button:hover { background: #e8f0ff; border-color: #7aa5ec; }
.bi-form-grid.bi-editing > .bi-cell,
.bi-form-grid.bi-editing > .bi-blank {
    position: relative; cursor: pointer;
    outline: 1px dashed #9db8ea; outline-offset: 1px;
    background: #fbfdff; border-radius: 4px;
}
.bi-form-grid.bi-editing > .bi-cell:hover,
.bi-form-grid.bi-editing > .bi-blank:hover { outline-color: #4a7fd4; background: #f2f7ff; }
.bi-form-grid.bi-editing > .bi-picked { outline: 2px solid #2563eb; background: #e6efff; }
.bi-form-grid.bi-editing .bi-label { border-bottom: 1px dotted #7aa5ec; cursor: text; }
.bi-rename { width: 100%; min-width: 0; box-sizing: border-box; font-size: 12px; padding: 2px 5px; }
/* 隐藏的格子：普通模式整格不显示（控件仍在 DOM，填过的值照样提交）；
   编辑模式缩成一块"已隐藏·点此显示"，让人能点回来，不会永久找不到。 */
.bi-form-grid > .bi-hidden-field { display: none !important; }
.bi-form-grid.bi-editing > .bi-hidden-field {
    display: flex !important; align-items: center; justify-content: center;
    min-height: 34px; padding: 2px 6px;
    border: 1px dashed #c9d3e0; border-radius: 5px;
    background: repeating-linear-gradient(-45deg, #fafbfc, #fafbfc 6px, #f2f4f7 6px, #f2f4f7 12px);
    cursor: pointer; position: relative;
}
.bi-hidden-tag { display: none; }
.bi-form-grid.bi-editing .bi-hidden-field .bi-hidden-tag {
    display: block; font-size: 11px; color: #8895a5; text-align: center;
}
.bi-form-grid.bi-editing .bi-hidden-field .bi-label,
.bi-form-grid.bi-editing .bi-hidden-field .bi-solo,
.bi-form-grid.bi-editing .bi-hidden-field .bi-pair { display: none !important; }
/* × 隐藏按钮：只在编辑态出现在格子右上角 */
.bi-hide-btn { display: none; }
.bi-form-grid.bi-editing .bi-hide-btn {
    display: inline-flex; align-items: center; justify-content: center;
    position: absolute; top: 2px; right: 3px; z-index: 2;
    width: 16px; height: 16px; line-height: 1;
    font-size: 13px; color: #b04a4a; background: #fff;
    border: 1px solid #e2b6b6; border-radius: 3px; cursor: pointer;
}
.bi-form-grid.bi-editing .bi-hide-btn:hover { background: #fdeaea; color: #a22; }

/* ---- 页面布局编辑（管理员）：不改界面结构，就在原元素上挂显示/隐藏开关 ---- */
.pl-eye { display: none; }
body.pl-editing .nav-tree .group,
body.pl-editing .nav-tree .item,
body.pl-editing .nav-tree .nav-expiry,
body.pl-editing .mod-switch button { position: relative; }
body.pl-editing .nav-tree .item { display: flex; align-items: center; }

body.pl-editing .pl-eye {
    display: inline-flex; align-items: center; justify-content: center;
    width: 20px; height: 20px; flex: 0 0 auto; margin-left: auto;
    color: #dbeafe; border: 1px solid rgba(255, 255, 255, .5); border-radius: 50%;
    background: linear-gradient(135deg, rgba(59, 130, 246, .9), rgba(37, 99, 235, .9));
    box-shadow: 0 2px 6px rgba(0, 0, 0, .28), inset 0 1px 0 rgba(255, 255, 255, .3);
    cursor: pointer; user-select: none;
    transition: transform .15s ease, box-shadow .15s ease, background .15s ease;
}
body.pl-editing .pl-eye svg { width: 12px; height: 12px; display: block; }
body.pl-editing .pl-eye.is-off {
    color: #ffe4e6; border-color: rgba(255, 200, 200, .55);
    background: linear-gradient(135deg, rgba(220, 80, 80, .92), rgba(168, 45, 45, .92));
}
body.pl-editing .pl-eye:hover {
    transform: scale(1.12);
    box-shadow: 0 4px 12px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .35);
}
body.pl-editing .pl-eye.is-off:hover {
    background: linear-gradient(135deg, #e05a5a, #b02d2d);
}
body.pl-editing .mod-switch .pl-eye {
    position: absolute; top: -7px; right: -7px; z-index: 3; margin-left: 0;
    box-shadow: 0 0 0 2px #1e3a5f, 0 2px 6px rgba(0, 0, 0, .28);
}
body.pl-editing .nav-tree .group .chev { display: none; }
body.pl-editing .nav-tree .group.pl-off,
body.pl-editing .nav-tree .item.pl-off,
body.pl-editing .nav-tree .nav-expiry.pl-off,
body.pl-editing .mod-switch button.pl-off { opacity: .55; filter: saturate(.6); }
body.pl-editing .nav-tree .item.pl-off,
body.pl-editing .nav-tree .group.pl-off { outline: 1px dashed rgba(255, 255, 255, .25); outline-offset: -2px; }
body.pl-editing .nav-tree .nav-expiry { cursor: pointer; }
body.pl-editing #page-layout-btn.on { background: #2563eb; color: #fff; }

/* 第一版自定义的复制/改名标识和就地改名输入框 */
.pl-act, .pl-rename { display: none; }
body.pl-editing .nav-tree .item { gap: 4px; }
body.pl-editing .nav-tree .item .pl-label {
    flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
body.pl-editing .pl-act {
    display: inline-flex; align-items: center; justify-content: center;
    width: 16px; height: 16px; flex: 0 0 auto;
    font-size: 11px; line-height: 1; color: #dbeafe;
    background: rgba(255, 255, 255, .12); border: 1px solid rgba(255, 255, 255, .3);
    border-radius: 4px; cursor: pointer; user-select: none;
}
body.pl-editing .pl-act:hover { background: rgba(96, 165, 250, .55); color: #fff; }
body.pl-editing .pl-rename {
    display: block; flex: 1; min-width: 0; width: 100%;
    padding: 2px 5px; font: inherit; font-size: 12px; color: #fff;
    background: #16293f; border: 1px solid #60a5fa; border-radius: 4px;
}
body.pl-editing .nav-tree .item[draggable="true"],
body.pl-editing .nav-tree .group[draggable="true"],
body.pl-editing .mod-switch button[draggable="true"] { cursor: grab; }
body.pl-preview .pl-eye, body.pl-preview .pl-act, body.pl-preview .pl-rename { display: none !important; }
body.pl-preview .nav-tree .item[draggable="true"],
body.pl-preview .nav-tree .group[draggable="true"],
body.pl-preview .mod-switch button[draggable="true"] { cursor: default; }

.pl-edit-bar {
    position: fixed; left: 50%; bottom: 16px; transform: translateX(-50%); z-index: 9998;
    display: flex; align-items: center; justify-content: center; flex-wrap: wrap;
    gap: 7px; max-width: calc(100vw - 24px);
    padding: 9px 12px; border-radius: 14px; font-size: 12px;
    color: #e8f1ff; border: 1px solid rgba(255, 255, 255, .18);
    background: linear-gradient(135deg, rgba(23, 43, 66, .97), rgba(32, 60, 92, .97));
    box-shadow: 0 12px 32px rgba(0, 0, 0, .35), inset 0 1px 0 rgba(255, 255, 255, .08);
    backdrop-filter: blur(8px);
}
.pl-edit-scope {
    padding: 4px 10px; border-radius: 999px; font-size: 11px; color: #dbeafe;
    background: rgba(59, 130, 246, .22); border: 1px solid rgba(147, 197, 253, .3);
}
.pl-edit-tag {
    padding: 3px 9px; border-radius: 999px; font-size: 11px; font-weight: 600; letter-spacing: .5px;
    color: #dbeafe; background: rgba(59, 130, 246, .28); border: 1px solid rgba(147, 197, 253, .35);
}
.pl-edit-msg { white-space: nowrap; color: #dbeafe; }
.pl-edit-err { color: #ffc4c4; }
.pl-edit-bar button {
    padding: 5px 12px; font-size: 12px; cursor: pointer; white-space: nowrap;
    color: #e8f1ff; background: rgba(255, 255, 255, .06);
    border: 1px solid rgba(255, 255, 255, .22); border-radius: 999px;
    transition: background .15s ease, transform .15s ease;
}
.pl-edit-bar button:hover { background: rgba(255, 255, 255, .16); transform: translateY(-1px); }
.pl-edit-bar button.primary {
    color: #fff; border-color: transparent;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    box-shadow: 0 3px 10px rgba(37, 99, 235, .45);
}
.pl-edit-bar button:disabled { opacity: .6; cursor: wait; transform: none; }

/* 编辑态的功能池：所有功能在这里，拖到左侧任意分组即可落位。 */
.pl-pool {
    position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 9997;
    width: min(760px, calc(100vw - 40px)); max-height: 260px; overflow: auto;
    padding: 10px 12px; border-radius: 12px;
    color: #e8f1ff; border: 1px solid rgba(255, 255, 255, .18);
    background: linear-gradient(135deg, rgba(20, 38, 60, .98), rgba(31, 56, 86, .98));
    box-shadow: 0 14px 36px rgba(0, 0, 0, .38);
}
.pl-pool.hidden { display: none; }
.pl-pool-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; font-size: 12px; }
.pl-pool-head b { font-size: 13px; }
.pl-pool-head span { color: rgba(232, 241, 255, .65); }
.pl-pool-head input {
    flex: 1; min-width: 90px; padding: 4px 8px; font-size: 12px;
    color: #fff; background: rgba(255, 255, 255, .08);
    border: 1px solid rgba(255, 255, 255, .25); border-radius: 6px;
}
.pl-pool-head button {
    width: 22px; height: 22px; color: #e8f1ff; cursor: pointer;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
}
.pl-pool-list { display: flex; flex-wrap: wrap; gap: 6px; }
.pl-pool-chip {
    padding: 4px 9px; font-size: 12px; cursor: grab; user-select: none;
    color: #dbeafe; background: rgba(59, 130, 246, .18);
    border: 1px solid rgba(147, 197, 253, .32); border-radius: 999px;
}
.pl-pool-chip:hover { background: rgba(59, 130, 246, .4); }

/* 公司布局历史：谁在什么时候改的，点回滚即可回到那一版。 */
.pl-history {
    position: fixed; left: 50%; bottom: 92px; transform: translateX(-50%); z-index: 9997;
    width: min(520px, calc(100vw - 40px)); max-height: 300px; overflow: auto;
    padding: 10px 12px; border-radius: 12px;
    color: #e8f1ff; border: 1px solid rgba(255, 255, 255, .18);
    background: linear-gradient(135deg, rgba(20, 38, 60, .98), rgba(31, 56, 86, .98));
    box-shadow: 0 14px 36px rgba(0, 0, 0, .38);
}
.pl-history.hidden { display: none; }
.pl-history-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; }
.pl-history-head b { font-size: 13px; }
.pl-history-head button {
    width: 22px; height: 22px; color: #e8f1ff; cursor: pointer;
    background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .22);
    border-radius: 50%;
}
.pl-history-row {
    display: flex; align-items: center; justify-content: space-between; gap: 10px;
    padding: 6px 8px; font-size: 12px; color: #dbeafe;
    background: rgba(255, 255, 255, .05); border-radius: 6px; margin-bottom: 5px;
}
.pl-history-row button {
    padding: 3px 10px; font-size: 11px; cursor: pointer; color: #fff;
    background: rgba(59, 130, 246, .55); border: 1px solid rgba(147, 197, 253, .4);
    border-radius: 999px;
}

/* ---- 账号级主题配色 ----
   只有用户真的存了配色，<html> 才会挂 has-custom-theme；没存过时下面一条都不生效，
   原来的浅色/深色两套皮肤一点不动。存了以后，用户颜色通过行内 CSS 变量盖在最上面。 */
.theme-palette-icon {
    display: inline-block; width: 12px; height: 12px; border-radius: 50%;
    background: conic-gradient(#2563eb 0 33%, #22c55e 33% 66%, #ef4444 66% 100%);
    border: 1px solid rgba(255, 255, 255, .55);
}
.theme-panel {
    position: fixed; left: 50%; top: 52px; transform: translateX(-50%); z-index: 9996;
    width: min(860px, calc(100vw - 32px)); max-height: calc(100vh - 150px); overflow: auto;
    color: #1f2937; border-radius: 12px; border: 1px solid #d5dbe3;
    background: #fff;
    box-shadow: 0 16px 42px rgba(0, 0, 0, .28);
}
.tp-head {
    display: flex; align-items: center; gap: 12px; padding: 12px 16px;
    border-bottom: 1px solid #e5e9ef; font-size: 13px;
}
.tp-head b { font-size: 14px; }
.tp-head span { flex: 1; font-size: 11px; color: #667085; }
.tp-head button, .tp-row button {
    color: #1f2937; cursor: pointer; background: #f2f5f9;
    border: 1px solid #ccd3dd; border-radius: 50%;
    width: 22px; height: 22px; line-height: 1;
}
.tp-group { padding: 10px 16px 4px; border-bottom: 1px solid #e5e9ef; }
.tp-group-title { font-size: 12px; font-weight: 600; color: #2563eb; margin-bottom: 7px; }
.tp-row {
    display: grid; grid-template-columns: 1fr 34px 86px 24px; align-items: center;
    gap: 8px; padding: 3px 0; font-size: 12px;
}
.tp-row input[type="color"] {
    width: 32px; height: 22px; padding: 0; cursor: pointer;
    background: #fff; border: 1px solid #c9d1da; border-radius: 4px;
}
.tp-row input[type="text"] {
    padding: 3px 6px; font-size: 12px; color: #1f2937;
    background: #fff;
    border: 1px solid #c9d1da; border-radius: 4px;
}
.tp-foot {
    display: flex; align-items: center; gap: 8px; padding: 12px 16px;
    position: sticky; bottom: 0; background: #fff;
    border-top: 1px solid #e5e9ef;
}
.tp-err { flex: 1; font-size: 12px; color: #c0342c; }
.tp-foot button {
    padding: 5px 12px; font-size: 12px; cursor: pointer; color: #1f2937;
    background: #f2f5f9; border: 1px solid #ccd3dd;
    border-radius: 999px;
}
.tp-foot button.primary {
    color: #fff; background: #2563eb; border-color: transparent;
}

html.has-custom-theme body { background: var(--bg) !important; color: var(--text) !important; }
html.has-custom-theme .panel,
html.has-custom-theme .card,
html.has-custom-theme .panel-header,
html.has-custom-theme .stat-card,
html.has-custom-theme .box {
    background: var(--panel) !important; color: var(--text) !important;
    border-color: var(--border) !important;
}
html.has-custom-theme .panel .panel-title,
html.has-custom-theme .panel-header,
html.has-custom-theme table thead th,
html.has-custom-theme .data-table thead th,
html.has-custom-theme .items-table th {
    background: var(--head) !important; color: var(--table-head-text) !important;
}
html.has-custom-theme table,
html.has-custom-theme table th,
html.has-custom-theme table td,
html.has-custom-theme .data-table,
html.has-custom-theme .items-table { border-color: var(--table-border) !important; color: var(--text) !important; }
html.has-custom-theme table tbody tr:hover { background: var(--table-hover) !important; }
html.has-custom-theme input:not([type="checkbox"]):not([type="radio"]):not([type="file"]),
html.has-custom-theme select,
html.has-custom-theme textarea {
    background: var(--input-bg) !important; color: var(--input-text) !important;
    border-color: var(--input-border) !important;
}
html.has-custom-theme label,
html.has-custom-theme .form-label,
html.has-custom-theme .field-label { color: var(--field-label) !important; }
html.has-custom-theme .btn {
    background: var(--btn-bg) !important; color: var(--btn-text) !important;
    border-color: var(--btn-border) !important;
}
html.has-custom-theme .btn:hover { background: var(--btn-hover) !important; }
html.has-custom-theme .btn.primary {
    background: var(--btn-primary-bg) !important; color: var(--btn-primary-text) !important;
    border-color: var(--btn-primary-bg) !important;
}
html.has-custom-theme .btn.danger {
    background: var(--btn-danger-bg) !important; color: var(--btn-danger-text) !important;
    border-color: var(--btn-danger-bg) !important;
}
html.has-custom-theme a,
html.has-custom-theme .btn-link { color: var(--link) !important; }
html.has-custom-theme .toolbar {
    background: var(--toolbar-bg) !important; color: var(--toolbar-text) !important;
    border-bottom-color: var(--toolbar-btn-border) !important;
}
html.has-custom-theme .toolbar .title,
html.has-custom-theme .toolbar .user-box,
html.has-custom-theme .toolbar .lang-pill,
html.has-custom-theme .toolbar .logout-btn {
    color: var(--toolbar-btn-text) !important;
}
html.has-custom-theme .toolbar .lang-pill,
html.has-custom-theme .toolbar .logout-btn,
html.has-custom-theme .toolbar .user-name {
    background: var(--toolbar-btn-bg) !important;
    border-color: var(--toolbar-btn-border) !important;
}
html.has-custom-theme .toolbar .lang-pill:hover,
html.has-custom-theme .toolbar .logout-btn:hover { background: var(--toolbar-btn-hover) !important; }
html.has-custom-theme .nav-side {
    background: var(--sidebar-bg) !important; color: var(--sidebar-text) !important;
    border-right-color: var(--sidebar-text) !important;
}
html.has-custom-theme .nav-tree .group,
html.has-custom-theme .nav-tree .item,
html.has-custom-theme .nav-tree .nav-expiry,
html.has-custom-theme .nav-footer button { color: var(--sidebar-text) !important; }
html.has-custom-theme .nav-tree .item:hover,
html.has-custom-theme .nav-tree .group:hover,
html.has-custom-theme .nav-footer button:hover {
    background: var(--sidebar-hover) !important; color: var(--sidebar-text) !important;
}
html.has-custom-theme .nav-tree .item.active {
    background: var(--sidebar-active-bg) !important; color: var(--sidebar-active-text) !important;
}
html.has-custom-theme .modal,
html.has-custom-theme .modal-mask .modal { background: var(--modal-bg) !important; color: var(--text) !important; }
html.has-custom-theme .tag,
html.has-custom-theme .status-tag,
html.has-custom-theme .chip { background: var(--chip-bg) !important; color: var(--chip-text) !important; }
html.has-custom-theme .status.posted,
html.has-custom-theme .status.confirmed,
html.has-custom-theme .cp-msg.ok { color: var(--success) !important; }
html.has-custom-theme .status.void,
html.has-custom-theme .modal-err,
html.has-custom-theme .si-error { color: var(--danger) !important; }
html.has-custom-theme .status.draft,
html.has-custom-theme .fin-demo-tag { color: var(--warning) !important; }

/* 询价回复的 Excel 式填写区：一行一家供应商，横向滚动，表头吸顶。 */
.bi-rev-bar { font-size: 12px; color: var(--muted); margin: 4px 0 6px; }
.bi-rev-wrap {
    max-height: 48vh; overflow: auto;
    border: 1px solid var(--border); border-radius: 6px; background: var(--panel);
}
.bi-rev-grid { border-collapse: separate; border-spacing: 0; min-width: 4200px; }
.bi-rev-grid th {
    position: sticky; top: 0; z-index: 2; white-space: nowrap;
    background: var(--head) !important; color: var(--text) !important;
    padding: 5px 6px; border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.bi-rev-grid td {
    min-width: 118px; padding: 3px; vertical-align: top;
    border-right: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.bi-rev-grid td.bi-rev-no { min-width: 34px; width: 34px; text-align: center; color: var(--muted); }
.bi-rev-grid td.bi-rev-del-cell { min-width: 30px; width: 30px; text-align: center; }
.bi-rev-grid .ipt { width: 100%; min-width: 110px; padding: 3px 5px; }
.bi-rev-grid textarea.ipt { width: 160px; min-width: 160px; height: 30px; resize: vertical; }
.bi-rev-del {
    width: 20px; height: 20px; padding: 0; cursor: pointer;
    color: #b91c1c; background: transparent; border: 1px solid #e3a6a6; border-radius: 50%;
}
.bi-rev-del:hover { background: #fee2e2; }
/* 采购报价上半区 12 列 Excel 录入表：不用 4200px 的宽表，紧凑排开 */
.bi-rev-grid.bi-buy-grid { min-width: 1180px; }
.bi-rev-grid.bi-buy-grid td { min-width: 92px; }
.bi-rev-grid.bi-buy-grid .ipt { min-width: 84px; }
.bi-rev-grid.bi-buy-grid td:first-child { min-width: 120px; }
.bi-rev-grid.bi-buy-grid input[readonly] { color: var(--muted); }

/* 业务询价页下半区：列表和下面的询价内容/采购回复详情各占一块，都能滚、都给够高度，
   避免详情被列表挤到只剩一条缝看不见表单。 */
#bi-bgrid { min-height: 220px; flex: 1 1 40%; }
#bi-grid { flex: 1 1 60%; }

/* 整页上下滚动页（采购报价）：不把面板锁死在一屏，各块按内容自然长高，
   整页一条竖向滚动条；表格宽了仍可横向滚。 */
.inv-split.bi-scroll-page { display: block; height: auto; min-height: 0; }
.bi-scroll-page .inv-splitter { display: none; }
.bi-scroll-page .panel { display: block; min-height: 0; margin-bottom: 10px; }
.bi-scroll-page .grid-wrap { flex: none; height: auto; overflow-x: auto; overflow-y: visible; }
.bi-scroll-page #bb-history { max-height: 96px; overflow-y: auto; }

/* 业务询价页三段分栏：快速发起 / 列表 / 详情，两条分隔条各自可拖。
   三段共用 inv-split 的 100% 高与 flex 列，段内各自滚动，整页不出第二滚动条。 */
.inv-split.bi-tri { gap: 0; }
.inv-split.bi-tri .panel { display: flex; flex-direction: column; margin: 0; padding: 8px; min-height: 0; }
.bi-tri .inv-seg-a { flex: 0 0 auto; min-height: 100px; }
.bi-tri .inv-seg-b { flex: 0 0 auto; min-height: 100px; }
.bi-tri .inv-seg-c { flex: 1 1 0; min-height: 100px; }
.bi-tri .bi-splitter-1, .bi-tri .bi-splitter-2 {
    flex: 0 0 13px; cursor: row-resize; position: relative; z-index: 2;
    background: var(--panel-alt, var(--head)); border-top: 1px solid var(--border); border-bottom: 1px solid var(--border);
}
.bi-tri .bi-splitter-1::after, .bi-tri .bi-splitter-2::after {
    content: ""; position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 52px; height: 5px; border-radius: 3px; background: var(--muted); opacity: .9;
    box-shadow: 0 0 0 1px var(--panel);
}
.bi-tri .bi-splitter-1:hover, .bi-tri .bi-splitter-2:hover { background: var(--accent); }
.bi-tri .bi-splitter-1:hover::after, .bi-tri .bi-splitter-2:hover::after { background: #fff; opacity: 1; }
.bi-tri .bi-splitter-1.dragging, .bi-tri .bi-splitter-2.dragging { background: var(--accent); }
.bi-tri .bi-splitter-1.dragging::after, .bi-tri .bi-splitter-2.dragging::after { background: #fff; opacity: 1; }
.bi-tri .grid-wrap { flex: 1 1 auto; min-height: 0; }
.bi-tri .bi-quick-wrap { flex: 0 0 auto; }

/* 采购报价页：压缩标题栏/说明条/历史区的空白，把高度让给录入表和订单列表。 */
.bi-reply-page .panel-head { padding: 4px 8px; min-height: 0; }
.bi-reply-page .panel-head .panel-title { font-size: 13px; }
.bi-reply-page .inv-top { padding: 5px 8px; }
.bi-reply-page .inv-bottom { padding: 5px 8px; }
.bi-reply-page .pd-toolbar { padding: 2px 0; margin: 0; min-height: 0; }
.bi-reply-page .pd-toolbar .panel-plain { font-size: 11px; }
.bi-reply-page .bi-rev-bar { margin: 3px 0 0; font-size: 11px; }
.bi-reply-page .group-title.bb-hist-title { margin: 5px 0 2px; font-size: 12px; }
.bi-reply-page #bb-history { max-height: 96px; flex: 0 0 auto; }
.bi-reply-page #bb-err { margin: 3px 0 0; }

/* 客户询价区顶部「快速发起询价」：像 Excel 直接在格子填，一行建一张单。 */
.bi-quick-wrap { margin: 0 0 8px; padding: 7px 9px; background: var(--panel); border: 1px solid var(--border); border-radius: 6px; }
.bi-quick-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 9px; margin-bottom: 6px; font-size: 12px; }
.bi-quick-bar b { color: var(--accent, #2563eb); }
.bi-quick-bar label { display: inline-flex; align-items: center; gap: 4px; }
.bi-quick-scroll { overflow-x: auto; }
.bi-quick-grid { min-width: 980px; }
.bi-quick-grid th { position: static; white-space: nowrap; padding: 4px 6px; background: var(--head) !important; color: var(--text) !important; }
/* 表头整列填充小按钮：点一下把这一列全部填成第一行填的值 */
.bi-fill-col { margin-left: 4px; padding: 0 4px; font-size: 12px; line-height: 1.4; cursor: pointer;
    border: 1px solid var(--border, #ccc); border-radius: 3px; background: var(--panel, #fff); color: var(--accent, #2563eb); }
.bi-fill-col:hover { background: var(--accent, #2563eb); color: #fff; }
.bi-quick-grid td { min-width: 96px; padding: 3px; vertical-align: middle; }
.bi-quick-grid td:first-child, .bi-quick-grid td:nth-child(2) { min-width: 110px; }
.bi-smart-inline { align-items: flex-start !important; }
.bi-smart-inline .btn { min-width: 92px; height: 30px; padding: 3px 10px; line-height: 22px; }
/* 低置信标黄：统一给所有 AI 识别场景（询价/单据明细/产品管理），不再只限 .bi-quick-grid */
input.ai-low, select.ai-low, textarea.ai-low, td.ai-low { background: #fff4d6 !important; }
.bi-smart-inline textarea {
    width: 320px; min-width: 240px; min-height: 34px; max-height: 90px;
    padding: 3px 6px; font-size: 12px; line-height: 1.4; resize: vertical;
}
/* 单据编辑器明细上方常驻 AI 栏（和询价同一种手感：贴文本/图片 + 一颗 AI 按钮）*/
.doc-ai-bar {
    padding: 8px 10px; margin-bottom: 8px; border: 1px solid var(--border, #d9dee7);
    border-radius: 8px; background: var(--panel-alt, #f7f9ff);
}
.doc-ai-input-row { display: flex; align-items: center; gap: 8px; }
.doc-ai-text {
    flex: 1 1 auto; min-width: 200px; height: 32px; min-height: 32px; max-height: 120px;
    padding: 4px 8px; font-size: 12px; line-height: 22px; resize: vertical;
}
.doc-ai-fill { flex: 0 0 auto; min-width: 120px; height: 32px; line-height: 24px; }
.doc-ai-img { display: flex; align-items: center; gap: 8px; margin-top: 6px; font-size: 12px; color: var(--muted); }
.doc-ai-img-thumb { width: 46px; height: 46px; object-fit: cover; border: 1px solid var(--border); border-radius: 4px; }
.doc-ai-note { margin: 6px 0 0; font-size: 12px; color: var(--accent, #2563eb); }
/* 粘贴图片后的提示条：在按钮组里单独换行，宽度跟这排控件对齐。 */
.bi-smart-img {
    flex: 0 0 100%; display: flex; align-items: center; gap: 6px;
    margin-top: 4px; padding: 3px 6px; border: 1px dashed var(--border, #d0d7e2);
    border-radius: 4px; background: var(--panel-alt, #f5f8ff);
    font-size: 12px; color: var(--text, #334155);
}
.bi-smart-img img { width: 34px; height: 28px; object-fit: cover; border: 1px solid var(--border, #d0d7e2); border-radius: 2px; }
.bi-smart-img span { flex: 1; min-width: 0; }
.bi-smart-img button { border: 0; background: transparent; cursor: pointer; font-size: 16px; line-height: 1; color: var(--muted, #666); padding: 0 4px; }
.bi-quick-grid .ipt { width: 100%; min-width: 88px; padding: 3px 5px; }
.bi-quick-grid td.bi-rev-del-cell { min-width: 30px; width: 30px; text-align: center; }
.bi-quick-msg { margin: 5px 0 0; min-height: 14px; font-size: 12px; color: #b91c1c; }

/* AI 工作时的覆盖遮罩：三种特效 + 随机轮换，JS 插入 .ai-fx-<方案> 节点盖住整块面板，结束移除。
   公共：模糊毛玻璃底 + 居中识别指示；各方案用 .ai-fx-layer 做不同的动态层。 */
.ai-mist-host { position: relative; }
.ai-mist {
    position: absolute; inset: 0; z-index: 60; border-radius: inherit; overflow: hidden;
    pointer-events: auto; display: flex; align-items: center; justify-content: center;
    -webkit-backdrop-filter: blur(4px) saturate(1.15); backdrop-filter: blur(4px) saturate(1.15);
}
.ai-fx-layer { position: absolute; pointer-events: none; }
.ai-mist-core {
    position: relative; z-index: 5; display: flex; flex-direction: column; align-items: center; gap: 8px;
    padding: 18px 30px; border-radius: 16px; background: rgba(255, 255, 255, .76);
    -webkit-backdrop-filter: blur(8px); backdrop-filter: blur(8px);
    box-shadow: 0 10px 40px rgba(60, 70, 130, .18), inset 0 0 0 1px rgba(255, 255, 255, .75);
    color: #4338ca; font-size: 15px; font-weight: 700; letter-spacing: .5px;
}
.ai-mist-core small { font-size: 11px; font-weight: 400; color: #6b7280; letter-spacing: 0; }
.ai-mist-spin {
    width: 30px; height: 30px; border-radius: 50%;
    border: 3px solid rgba(99, 102, 241, .2); border-top-color: #6366f1;
    animation: ai-mist-spin .8s linear infinite;
}
@keyframes ai-mist-spin { to { transform: rotate(360deg); } }

/* 方案1 雾气弥漫：两层模糊色团缓慢飘移 */
.ai-fx-mist { background: rgba(244, 247, 255, .62); }
.ai-fx-mist .ai-fx-layer {
    width: 95%; height: 160%; left: 2%; top: -30%; filter: blur(26px);
    background:
        radial-gradient(ellipse at 30% 40%, rgba(167, 199, 255, .6), transparent 60%),
        radial-gradient(ellipse at 72% 55%, rgba(226, 185, 255, .55), transparent 62%),
        radial-gradient(ellipse at 50% 75%, rgba(180, 240, 230, .5), transparent 60%);
    animation: ai-mist-drift 8s ease-in-out infinite alternate;
}
.ai-fx-mist .ai-fx-layer2 { animation-duration: 11s; animation-direction: alternate-reverse; opacity: .7; transform: scaleX(-1); }
@keyframes ai-mist-drift {
    0%   { transform: translate3d(-5%, 2%, 0) scale(1); }
    50%  { transform: translate3d(3%, -4%, 0) scale(1.12); }
    100% { transform: translate3d(6%, 3%, 0) scale(1.04); }
}
/* 方案2 极光流带：斜向彩色光带横扫 + 磨砂 */
.ai-fx-aurora { background: rgba(238, 242, 255, .5); }
.ai-fx-aurora .ai-fx-layer {
    width: 60%; height: 260%; top: -80%; left: -20%;
    background: linear-gradient(90deg, transparent, rgba(99,102,241,.35), rgba(236,72,153,.35),
                rgba(34,211,238,.35), rgba(168,85,247,.35), transparent);
    filter: blur(20px); transform: rotate(18deg);
    animation: ai-fx-aurora 3.2s linear infinite;
}
.ai-fx-aurora .ai-fx-layer2 { animation-duration: 4.6s; animation-delay: -1.8s; opacity: .55; }
@keyframes ai-fx-aurora {
    0%   { transform: translateX(-40%) rotate(18deg); }
    100% { transform: translateX(220%) rotate(18deg); }
}
/* 随机轮换的预览：三种色团叠在一起交替淡入，表示"每次随机一种" */
.ai-fx-random { background: rgba(244, 247, 255, .55); }
.ai-fx-random .ai-fx-layer {
    width: 95%; height: 160%; left: 2%; top: -30%; filter: blur(24px);
    background:
        radial-gradient(ellipse at 30% 40%, rgba(167, 199, 255, .6), transparent 60%),
        radial-gradient(ellipse at 72% 55%, rgba(226, 185, 255, .55), transparent 62%),
        radial-gradient(ellipse at 50% 75%, rgba(180, 240, 230, .5), transparent 60%);
    animation: ai-mist-drift 8s ease-in-out infinite alternate;
}
.ai-fx-random .ai-fx-layer2 {
    animation: ai-fx-rand-alt 4s ease-in-out infinite alternate;
}
@keyframes ai-fx-rand-alt {
    0%   { opacity: .15; transform: scale(.9); }
    100% { opacity: .8; transform: scale(1.1); }
}
/* 方案3 呼吸光晕：中心彩色径向光一呼一吸，边缘渐淡 */
.ai-fx-pulse { background: rgba(244, 247, 255, .55); }
.ai-fx-pulse .ai-fx-layer {
    width: 80%; height: 130%; left: 10%; top: -15%; border-radius: 50%; filter: blur(34px);
    background: radial-gradient(ellipse at center, rgba(129,140,248,.6), rgba(217,70,239,.3) 45%, transparent 72%);
    animation: ai-fx-pulse 2.2s ease-in-out infinite;
}
.ai-fx-pulse .ai-fx-layer2 { width: 55%; height: 90%; left: 22%; top: -5%; animation-delay: -1.1s; opacity: .6; }
@keyframes ai-fx-pulse {
    0%, 100% { transform: scale(.85); opacity: .6; }
    50%      { transform: scale(1.15); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
    .ai-fx-layer, .ai-mist-spin { animation: none !important; }
}

/* ---- 统一 AI 就地识别（与 V7.7 同步，paste 组件用）------------------------
   独立于 V8 自己的 ai-mist 特效：这里给粘贴弹窗在识别中套一层七彩流光扫描。 */
.ai-scanning { position: relative; overflow: hidden; }
.ai-scanning::before {
    content: ""; position: absolute; inset: 0; pointer-events: none; z-index: 3;
    background: linear-gradient(115deg, transparent 20%, rgba(114,46,209,.16) 42%,
        rgba(22,119,255,.22) 50%, rgba(114,46,209,.16) 58%, transparent 80%);
    background-size: 220% 100%; animation: ai-scan-sweep 1.6s linear infinite;
}
@keyframes ai-scan-sweep { from { background-position: 200% 0; } to { background-position: -120% 0; } }
@media (prefers-reduced-motion: reduce) {
    .ai-scanning, .ai-scanning::before { animation: none; }
    .ai-scanning::before { background: rgba(114,46,209,.16); }
}
/* 统一 AI 入口按钮：全站所有 AI 识别按钮同一副紫调外观 */
.ai-entry-btn {
    border-color: #722ed1 !important; color: #722ed1 !important;
    background: #f7f3ff !important; font-weight: 600;
}
.ai-entry-btn:hover { background: #ede3ff !important; }
@media (prefers-color-scheme: dark) {
    .ai-entry-btn { background: #2a1f47 !important; color: #c9a7ff !important; }
}
.ai-paste-wrap { padding: 4px 2px 8px; border-radius: 8px; }
.ai-paste-text {
    width: 100%; box-sizing: border-box; font-size: 13px; line-height: 1.5;
    resize: vertical; min-height: 150px; font-family: inherit;
}

/* 特效选择器：随机轮换 + 三种实时预览卡片 */
.ai-fx-page-head { padding: 4px 2px 14px; border-bottom: 1px solid var(--border); margin-bottom: 16px; }
.ai-fx-page-head h2 { margin: 0 0 8px; font-size: 18px; }
.ai-fx-page-head p { margin: 0; font-size: 12px; color: var(--muted); line-height: 1.7; }
.ai-fx-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 12px; margin-top: 8px; }
.ai-fx-card {
    border: 1px solid var(--border); border-radius: 12px; padding: 10px;
    background: var(--panel); display: flex; flex-direction: column; gap: 8px;
}
.ai-fx-card.active { border-color: #6366f1; box-shadow: 0 4px 16px rgba(99, 102, 241, .22); }
.ai-fx-demo {
    position: relative; height: 92px; border-radius: 8px; overflow: hidden;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(0, 0, 0, .06);
}
.ai-fx-demo-core {
    position: relative; z-index: 5; font-size: 12px; font-weight: 700; color: #4338ca;
    padding: 4px 10px; border-radius: 8px; background: rgba(255, 255, 255, .78);
}
.ai-fx-card-hd { display: flex; justify-content: space-between; align-items: center; font-size: 13px; }
.ai-fx-card-desc { margin: 0; font-size: 11px; color: var(--muted); line-height: 1.5; min-height: 48px; }
.ai-fx-use { margin-top: auto; }
/* 操作栏「发起询价」弹窗里的格子 */
.bi-send-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 8px 12px; margin: 8px 0; }
.bi-send-cell { display: flex; flex-direction: column; gap: 3px; font-size: 12px; color: var(--muted); }
.bi-send-cell .ipt { width: 100%; }

/* ---- 通用表单布局编辑（全公司统一版式）---- */
.gl-bar { display: flex; flex-wrap: wrap; align-items: center; gap: 5px 8px; margin: 0 0 8px;
          padding: 6px 9px; background: #f5f8ff; border: 1px solid #d6e2ff; border-radius: 5px;
          font-size: 12px; color: #445; }
.gl-hint { flex: 1 1 100%; color: #667; font-size: 11px; }
.gl-bar button { padding: 3px 9px; font-size: 12px; cursor: pointer; border: 1px solid #b9cdf5;
                 border-radius: 4px; background: #fff; color: #2b5fb3; }
.gl-bar button:hover { background: #e8f0ff; }
.form-grid.gl-editing > *, .form-grid-4.gl-editing > * {
    outline: 1px dashed #9db8ea; outline-offset: 1px; cursor: pointer;
}
.form-grid.gl-editing > .gl-picked, .form-grid-4.gl-editing > .gl-picked {
    outline: 2px solid #2563eb; background: #e6efff;
}
.gl-hidden { display: none !important; }
.gl-editing > .gl-hidden {
    display: flex !important; align-items: center; justify-content: center;
    min-height: 34px; border: 1px dashed #c9d3e0; border-radius: 5px;
    background: repeating-linear-gradient(-45deg,#fafbfc,#fafbfc 6px,#f2f4f7 6px,#f2f4f7 12px);
}
.gl-hidden-tag { display: none; }
.gl-editing .gl-hidden .gl-hidden-tag { display: block; font-size: 11px; color: #8895a5; }
.gl-editing .gl-hidden > :not(.gl-marks) { display: none !important; }
.gl-x { display: none; }
.gl-editing > .form-field > .gl-x, .gl-editing > label > .gl-x {
    display: inline-flex; align-items: center; justify-content: center;
    position: absolute; top: 2px; right: 3px; z-index: 2;
    width: 16px; height: 16px; font-size: 13px; color: #b04a4a;
    background: #fff; border: 1px solid #e2b6b6; border-radius: 3px; cursor: pointer;
}
.gl-editing > .form-field > .gl-x:hover { background: #fdeaea; }
.gl-rename { width: 100%; min-width: 0; box-sizing: border-box; font-size: 12px; padding: 2px 5px; }

/* 批量询价智能识别：低置信度行标出来给人核对，日志原样可读 */
tr.bq-low-conf { background: #fff9e8; }
tr.bq-low-conf:hover { background: #fff2cf; }
.bq-conf-badge {
    display: inline-block; margin-left: 3px; padding: 0 4px;
    font-size: 10px; line-height: 15px; color: #a35b00;
    background: #ffe2ab; border: 1px solid #f0c070; border-radius: 3px;
}
.bq-log-pre {
    max-height: 220px; overflow: auto; margin: 6px 0 0; padding: 8px 10px;
    font-family: Consolas, "Courier New", monospace; font-size: 11px; line-height: 1.55;
    color: #3c4757; background: #f6f8fb; border: 1px solid var(--border); border-radius: 4px;
    white-space: pre-wrap; word-break: break-all;
}

/* 单据定制中心：左侧选单据类型，右侧配那一类单据的自定义字段 */
.doc-custom-grid { display: grid; grid-template-columns: 190px minmax(0, 1fr); gap: 14px; padding: 12px 14px; }
.doc-custom-types { display: flex; flex-direction: column; gap: 5px; align-content: start; flex-wrap: nowrap; }
.doc-custom-types h4 { margin: 0 0 6px; font-size: 13px; }
.doc-custom-types .btn { text-align: left; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.doc-custom-main { min-width: 0; }
.doc-custom-bar { display: flex; align-items: center; flex-wrap: wrap; gap: 8px; margin-bottom: 10px; }
.doc-custom-bar code { font-size: 11px; color: #667; background: #f4f6f9; padding: 2px 5px; border-radius: 3px; }
.doc-custom-bar .hint, .doc-custom-add + .hint { font-size: 12px; color: #7a8190; }
.doc-custom-add { display: flex; gap: 8px; align-items: center; margin-bottom: 10px; }
.doc-custom-add input { flex: 1; min-width: 140px; max-width: 320px; }
.doc-custom-add select { min-width: 90px; }
.doc-custom-main .data-table input { width: 100%; min-width: 120px; box-sizing: border-box; }
.doc-custom-main .err { color: #c0342c; font-size: 12px; }
.doc-custom-head:empty { display: none; }
.field-dict-body { padding: 10px 14px 14px; }
.field-dict-body h4 { margin: 10px 0 6px; font-size: 13px; }
.field-dict-table { width: 100%; border-collapse: collapse; }
.field-dict-table th, .field-dict-table td { padding: 4px 6px; border-bottom: 1px solid var(--border); font-size: 12px; }
.field-dict-table input:not([type=checkbox]), .field-dict-table select { width: 100%; box-sizing: border-box; }
.field-dict-table input[type=checkbox] { width: auto; }
.field-dict-body .panel-plain { margin: 8px 0 4px; }
.field-dict-body .hint { color: #7a8190; font-size: 12px; }

/* 主题配色面板：色号输入框始终白底，哪怕当前账号存了自定义主题色。
   自定义主题那段通用 input 规则带 !important，所以这里用更长的选择器压住它。 */
html.has-custom-theme .theme-panel .tp-row input[type="text"] {
    background: #fff !important; color: #1f2937 !important; border-color: #c9d1da !important;
}
html.has-custom-theme .theme-panel .tp-row input[type="color"] {
    background: #fff !important; border-color: #c9d1da !important;
}
html.has-custom-theme .theme-panel {
    background: #fff !important; color: #1f2937 !important; border-color: #d5dbe3 !important;
}
html.has-custom-theme .theme-panel .tp-head,
html.has-custom-theme .theme-panel .tp-group,
html.has-custom-theme .theme-panel .tp-foot {
    background: #fff !important; border-color: #e5e9ef !important;
}
html.has-custom-theme .theme-panel .tp-head span { color: #667085 !important; }
html.has-custom-theme .theme-panel .tp-group-title { color: #2563eb !important; }
html.has-custom-theme .theme-panel .tp-head button,
html.has-custom-theme .theme-panel .tp-row button,
html.has-custom-theme .theme-panel .tp-foot button {
    color: #1f2937 !important; background: #f2f5f9 !important; border-color: #ccd3dd !important;
}
html.has-custom-theme .theme-panel .tp-foot button.primary {
    color: #fff !important; background: #2563eb !important; border-color: transparent !important;
}

/* ---- V8.0 AI中心：顶栏入口 ---- */
.ai-center-btn {
    flex: 0 0 auto; padding: 5px 12px; font-size: 12px; font-weight: 600; cursor: pointer;
    color: #fff; border: 1px solid rgba(167,139,250,.65); border-radius: 999px;
    background: linear-gradient(135deg, #6d28d9, #2563eb);
    box-shadow: 0 2px 10px rgba(80,50,180,.35); white-space: nowrap;
}
.ai-center-btn:hover { filter: brightness(1.15); }

/* ---- V8.1 AI中心：右下角悬浮快捷入口 ----
   照登录页 AI 徽章那颗做（同一套 --lg-* 配色 token + lg-ai-bounce 弹跳动画），
   只是尺寸从 40px 放大到 58px，好点、好看。 */
.ai-float-btn {
    position: fixed; right: 20px; bottom: 76px; z-index: 1500;
    width: 58px; height: 58px; padding: 0; border-radius: 50%; cursor: pointer;
    display: flex; align-items: center; justify-content: center; gap: 1px;
    color: #fff !important; font-family: inherit; font-weight: 800; line-height: 1; letter-spacing: .3px;
    background: linear-gradient(135deg, var(--lg-accent), var(--lg-accent2));
    border: 2px solid rgba(255, 255, 255, .88);
    box-shadow: inset 0 2px 6px rgba(255, 255, 255, .28),
                0 6px 18px rgba(var(--lg-accent-rgb), .55), 0 0 0 4px rgba(var(--lg-accent-rgb), .12);
    animation: lg-ai-bounce 1.9s cubic-bezier(.28, .84, .42, 1) infinite;
}
.ai-float-btn:hover { filter: brightness(1.12); }
.ai-float-btn .afb-spark { color: #fff !important; font-size: 17px; line-height: 1; transform: translateY(-3px); }
.ai-float-btn .afb-text { color: #fff !important; font-size: 15px; font-weight: 800; letter-spacing: .3px; }
.ai-float-btn.hidden { display: none; }
@media (prefers-reduced-motion: reduce) {
    .ai-float-btn { animation: none; }
}

/* ---- V8.1 语音输入：输入框旁麦克风 + 听写浮条 ---- */
.vx-voice-wrap { display: inline-flex; align-items: center; gap: 4px; }
.vx-voice-wrap > input, .vx-voice-wrap > textarea { flex: 1; min-width: 0; }
.vx-voice-mic {
    flex: 0 0 auto; width: 26px; height: 26px; padding: 0; cursor: pointer;
    border: 1px solid var(--border); border-radius: 50%; background: var(--panel);
    font-size: 13px; line-height: 1; display: inline-flex; align-items: center; justify-content: center;
}
.vx-voice-mic:hover { background: rgba(37,99,235,.10); border-color: var(--accent); }
.vx-voice-bar {
    position: fixed; left: 50%; top: 18px; transform: translateX(-50%); z-index: 6100;
    display: flex; align-items: center; gap: 10px; max-width: min(760px, 92vw);
    padding: 9px 14px; border-radius: 999px; color: #fff;
    background: linear-gradient(135deg, var(--lg-accent), var(--lg-accent2));
    box-shadow: 0 10px 30px rgba(37,99,235,.4);
}
.vx-voice-bar .vx-vm { font-size: 18px; animation: vx-mic-pulse 1.2s ease-in-out infinite; }
.vx-voice-bar .vx-vt { font-size: 13px; font-weight: 700; white-space: nowrap; }
.vx-voice-bar .vx-vtext {
    flex: 1; min-width: 40px; max-width: 460px; overflow: hidden; text-overflow: ellipsis;
    white-space: nowrap; font-size: 13px; opacity: .95;
}
.vx-voice-bar button {
    flex: 0 0 auto; padding: 4px 12px; border: 1px solid rgba(255,255,255,.7);
    border-radius: 999px; background: rgba(255,255,255,.16); color: #fff;
    font-size: 12px; cursor: pointer; white-space: nowrap;
}
.vx-voice-bar button:hover { background: rgba(255,255,255,.3); }
@keyframes vx-mic-pulse {
    0%, 100% { transform: scale(1); opacity: 1; }
    50%      { transform: scale(1.18); opacity: .75; }
}
@media (prefers-reduced-motion: reduce) {
    .vx-voice-bar .vx-vm { animation: none; }
}

/* ---- V8.0 AI中心：整页工作台 ---- */
.ac-page { height: 100%; display: flex; flex-direction: column; gap: 12px; min-height: 0; }
.ac-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; flex-wrap: wrap; }
.ac-head h2 { font-size: 19px; margin: 0; }
.ac-head p { margin: 4px 0 0; font-size: 12px; color: var(--muted); }
.ac-badge {
    padding: 5px 12px; border-radius: 999px; font-size: 12px;
    color: #92400e; background: #fef3c7; border: 1px solid #fcd34d;
}
.ac-badge.on { color: #166534; background: #dcfce7; border-color: #86efac; }
.ac-head-right { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.ac-audit-btn { padding: 6px 14px; font-size: 12px; }
.ac-audit-title { font-size: 14px; font-weight: 600; margin-bottom: 12px; }
.ac-audit-title span { font-size: 12px; font-weight: 400; color: var(--muted); margin-left: 8px; }
.ac-body { flex: 1; min-height: 0; display: grid; grid-template-columns: 300px 1fr; gap: 12px; }
.ac-list {
    overflow: auto; padding: 8px; border: 1px solid var(--border); border-radius: 12px;
    background: var(--panel); display: flex; flex-direction: column; gap: 6px;
}
.ac-mod {
    display: grid; grid-template-columns: 26px 1fr; gap: 2px 8px; text-align: left;
    padding: 9px 10px; border: 1px solid transparent; border-radius: 9px; cursor: pointer;
    background: transparent; color: var(--text);
}
.ac-mod:hover { background: var(--table-hover, #f5f8ff); border-color: var(--border); }
.ac-mod.active { background: rgba(37,99,235,.10); border-color: var(--accent); }
.ac-no {
    grid-row: 1 / 3; width: 26px; height: 26px; display: flex; align-items: center; justify-content: center;
    border-radius: 50%; font-size: 11px; font-weight: 700; color: #fff; background: var(--accent);
}
.ac-name { font-size: 13px; font-weight: 600; }
.ac-desc { font-size: 11px; color: var(--muted); line-height: 1.45; }
.ac-work { min-width: 0; overflow: auto; display: flex; flex-direction: column; gap: 12px; }
.ac-form, .ac-result {
    padding: 14px; border: 1px solid var(--border); border-radius: 12px; background: var(--panel);
}
.ac-form-title { display: flex; flex-direction: column; gap: 4px; margin-bottom: 12px; }
.ac-form-title b { font-size: 15px; }
.ac-form-title span { font-size: 12px; color: var(--muted); }
.ac-field { margin-bottom: 10px; }
.ac-field > label { display: block; margin-bottom: 5px; font-size: 12px; color: var(--muted); }
.ac-field textarea, .ac-field input[type="text"], .ac-field select {
    width: 100%; box-sizing: border-box; padding: 8px 10px; font: inherit; font-size: 13px;
    color: var(--input-text, var(--text)); background: var(--input-bg, #fff);
    border: 1px solid var(--input-border, var(--border)); border-radius: 7px;
}
.ac-check { display: inline-flex; align-items: center; gap: 6px; font-size: 12px; color: var(--text); }
.ac-actions { display: flex; align-items: center; gap: 12px; margin-top: 12px; }
.ac-msg { font-size: 12px; color: var(--muted); }
.ac-muted { font-size: 12px; color: var(--muted); }
.ac-lead {
    padding: 10px 12px; margin-bottom: 10px; border-left: 3px solid var(--accent);
    background: rgba(37,99,235,.07); border-radius: 6px; font-size: 13px; line-height: 1.7;
}
.ac-lead b { display: block; margin-bottom: 3px; font-size: 12px; color: var(--accent); }
.ac-kv { display: grid; grid-template-columns: 160px 1fr; gap: 10px; padding: 5px 0; border-bottom: 1px dashed var(--border); font-size: 12px; }
.ac-kv > span:first-child { color: var(--muted); }
.ac-tag { display: inline-block; margin: 2px; padding: 2px 8px; border-radius: 999px; font-size: 11px; background: var(--chip-bg, #e6edf5); }
.ac-table-wrap { overflow: auto; max-height: 320px; }
.ac-table-wrap table { font-size: 12px; }
.panel-err { color: #b91c1c; font-size: 13px; }
@media (max-width: 900px) { .ac-body { grid-template-columns: 1fr; } .ac-list { max-height: 220px; } }

