:root {
  --income: #d4380d;
  --expense: #389e0d;
  --primary: #0580ff;
  --primary-dark: #0052d9;
  --bg: #f5f7fa;
  --card: #ffffff;
  --border: #e8ecf3;
  --text: #373737;
  --text-2: #6b7280;
  --text-3: #97a3b7;
  --shadow: 0 1px 3px rgba(16,24,40,.08);
  --radius: 10px;
}
* { box-sizing: border-box; margin: 0; padding: 0; }
body { font-family: "Microsoft YaHei","PingFang SC","Segoe UI",sans-serif; background: var(--bg); color: var(--text); font-size: 14px; overflow-x: hidden; }
.loading { padding: 60px; text-align: center; color: var(--text-3); }

/* 顶栏 */
.topbar { background: transparent; color: #373737; padding: 0 24px 0 100px; display: flex; align-items: center; gap: 32px; height: 60px; border-bottom: none; box-shadow: none; }
.brand { display: flex; align-items: center; gap: 10px; font-size: 17px; font-weight: 700; white-space: nowrap; color: var(--primary); }
.brand-icon { width: 30px; height: 30px; border-radius: 8px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 800; }
#mainNav { display: flex; gap: 4px; height: 100%; }
#mainNav button { background: none; border: none; color: #5b6b8c; padding: 0 18px; font-size: 14.5px; cursor: pointer; height: 100%; border-bottom: 3px solid transparent; transition: all .15s; }
#mainNav button:hover { color: var(--primary); background: #f0f7ff; }
#mainNav button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

main { max-width: 1280px; margin: 0 auto; padding: 22px 24px 60px; }
/* 部门页面：main 撑满视口，避免居中导致侧栏与内容之间出现空白 */
main:has(> .dept-layout) { max-width: none; margin: 0; padding: 0; }

/* 页面切换淡入（简道云式顺滑感） */
@keyframes pageIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
#tabContent > *, .dept-main > * { animation: pageIn .22s ease; }
/* 全局：所有页面内容强制撑满主区宽度，避免被默认收缩到左上角 */
#tabContent > div, #tabContent > div > div, #tabContent > div > div > div, #tabContent > div > div > div > div, #tabContent > section, #tabContent > table, #tabContent > .card, #tabContent > .grid-2, #tabContent > .toolbar, #tabContent > .umt-bar, #tabContent > .opm-vtabs, #tabContent > .opm-table-wrap, #tabContent > .summary-row, #tabContent > .empty, #tabContent > .loading { width: 100% !important; max-width: none !important; margin-left: 0 !important; box-sizing: border-box !important; }
/* 修复：上面这条 !important 全宽规则会把表格板块的左侧列表/竖排标签栏也撑成 100%，导致右侧编辑器被挤出屏幕。
   用更高特异性的 !important 规则恢复表格板块的固定宽度。 */
#tabContent .shop-side { width: var(--shop-side-w, 180px) !important; max-width: var(--shop-side-w, 480px) !important; }
/* 侧栏拖拽把手：同样会被上面的全宽规则撑成100%，必须固定宽度（否则右栏被挤成0宽、编辑器消失） */
#tabContent #sideResizer { width: 8px !important; max-width: 8px !important; min-width: 8px !important; }
#tabContent .doc-tabs-vert { width: 150px !important; max-width: 150px !important; }

/* 表格表头吸顶 + 滚动条美化 */
table thead th { position: sticky; top: 0; background: #f7faff; z-index: 2; }
/* 修复：overflow-x:auto 的表格外层容器会把 sticky 的滚动锚点从视口抢走，导致表头吸顶失效。
   给这类容器限高并允许纵向滚动，让容器自身成为滚动区，表头即可吸附在容器顶部（全系统表格通用）。 */
#tabContent div[style*="overflow-x"]:has(> table) { max-height: calc(100vh - 190px); overflow-y: auto !important; }
#tabContent div[style*="overflow-x"]:has(> table) thead th { box-shadow: 0 1px 0 var(--border); }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c9d9f2; border-radius: 4px; }
::-webkit-scrollbar-thumb:hover { background: #a8c4ec; }
::-webkit-scrollbar-track { background: transparent; }

/* 卡片 */
.card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 24px; margin-bottom: 18px; }
.card h3 { font-size: 15px; margin-bottom: 14px; color: var(--text); display: flex; align-items: center; gap: 8px; }
.card h3::before { content: ""; width: 4px; height: 15px; background: var(--primary); border-radius: 2px; }

/* 概览卡片 */
.ledger-cards { display: grid; grid-template-columns: repeat(3,1fr); gap: 16px; margin-bottom: 18px; }
.ledger-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 20px 24px; cursor: pointer; transition: all .15s; border-top: 4px solid var(--lc,var(--primary)); }
.ledger-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16,24,40,.12); }
.ledger-card .lc-name { font-size: 16px; font-weight: 700; display: flex; justify-content: space-between; align-items: center; }
.ledger-card .lc-name .enter { font-size: 12px; color: var(--primary); font-weight: 400; }
.ledger-card .lc-desc { font-size: 12px; color: var(--text-3); margin: 4px 0 12px; }
.stat-row { display: flex; justify-content: space-between; margin-bottom: 8px; font-size: 13px; }
.stat-row .k { color: var(--text-2); }
.stat-row .v { font-weight: 600; font-variant-numeric: tabular-nums; }
.v.income,.income-text { color: var(--income); }
.v.expense,.expense-text { color: var(--expense); }
.v.profit-pos { color: var(--income); }
.v.profit-neg { color: var(--expense); }
.lc-profit { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--border); display: flex; justify-content: space-between; align-items: baseline; }
.lc-profit .num { font-size: 20px; font-weight: 800; font-variant-numeric: tabular-nums; }
.grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; width: 100%; }
.grid-2 > * { min-width: 0; }
.chart-box { height: 320px; }
.chart-box-sm { height: 280px; }

/* 台账页头 */
.ledger-head { display: flex; justify-content: space-between; align-items: flex-end; flex-wrap: wrap; gap: 12px; margin-bottom: 18px; padding-bottom: 14px; border-bottom: 1px solid #edf1f7; }
.ledger-head h2 { font-size: 20px; }
.ledger-head .desc { font-size: 13px; color: var(--text-3); max-width: 400px; }
.ledger-stats { display: flex; gap: 20px; flex-wrap: wrap; }
.ledger-stats .stat-item { text-align: center; }
.ledger-stats .stat-item .val { font-size: 20px; font-weight: 700; }
.ledger-stats .stat-item .lbl { font-size: 12px; color: var(--text-2); margin-top: 2px; }

/* 标签页切换 */
.tabs { display: flex; gap: 2px; border-bottom: 2px solid var(--border); margin-bottom: 14px; }
.tabs button { background: none; border: none; padding: 8px 18px; font-size: 14px; cursor: pointer; color: var(--text-2); border-bottom: 2px solid transparent; margin-bottom: -2px; transition: all .15s; }
.tabs button:hover { color: var(--text); }
.tabs button.active { color: var(--primary); border-bottom-color: var(--primary); font-weight: 600; }

/* 工具栏 */
.toolbar { display: flex; gap: 10px; flex-wrap: wrap; align-items: center; margin-bottom: 14px; }
.toolbar .btn { display: inline-flex; align-items: center; justify-content: center; height: 30px; box-sizing: border-box; }
.toolbar select,.toolbar input { padding: 6px 10px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; color: var(--text); height: 30px; box-sizing: border-box; flex-shrink: 0; }
.toolbar select { min-width: 100px; }
.toolbar input { min-width: 140px; }
/* 单据行选中（金蝶式上查/下查：点击行选中高亮） */
tr.rowPick { cursor: pointer; }
tr.rowPick:hover td { background: #f4f9ff; }
tr.rowPick.row-sel td { background: #e3f0ff !important; }
tr.rowPick.row-sel td:first-child { box-shadow: inset 3px 0 0 var(--primary, #0580ff); }
.spacer { flex: 1; }

/* 模式切换小页签 */
.inv-mode { display: inline-flex; background: #eef3fc; border: 1px solid var(--border); border-radius: 8px; padding: 3px; gap: 2px; }
.inv-mode button { border: none; background: transparent; padding: 5px 14px; font-size: 13px; border-radius: 6px; cursor: pointer; color: var(--text-2); font-family: inherit; }
.inv-mode button.active { background: #fff; color: var(--primary); font-weight: 600; box-shadow: 0 1px 3px rgba(16,24,40,.1); }

/* 产品库 */
.cat-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; align-items: center; }
.cat-tab { padding: 6px 14px; border: 1px solid var(--border); border-radius: 16px; background: #fff; font-size: 13px; cursor: pointer; color: var(--text-2); }
.cat-tab.active { background: var(--primary); border-color: var(--primary); color: #fff; font-weight: 600; }
.prod-img { width: 44px; height: 44px; object-fit: cover; border-radius: 6px; border: 1px solid var(--border); cursor: pointer; background: #f6f8fb; }
.prod-img-empty { width: 44px; height: 44px; border-radius: 6px; border: 1px dashed #c7d5ea; display: flex; align-items: center; justify-content: center; color: #a4b3ca; font-size: 11px; cursor: pointer; background: #f8fafd; }
.img-viewer { position: fixed; inset: 0; background: rgba(0,0,0,.75); z-index: 1000; display: flex; align-items: center; justify-content: center; cursor: zoom-out; }
.img-viewer img { max-width: 88vw; max-height: 88vh; border-radius: 10px; }
.sort-btns { display: inline-flex; flex-direction: column; gap: 1px; }
.sort-btns button { border: none; background: none; cursor: pointer; font-size: 10px; color: #8ba3cf; padding: 0 3px; line-height: 1; }
.sort-btns button:hover { color: var(--primary); }

/* 定价逻辑 */
.price-plat-tabs { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 12px; }
.param-bar { display: flex; gap: 8px 14px; flex-wrap: wrap; align-items: center; background: #f0f7ff; border: 1px solid #d5e3f7; border-radius: 8px; padding: 12px 18px; margin-bottom: 12px; font-size: 13px; }
.param-bar label { color: var(--text-2); display: inline-flex; align-items: center; gap: 4px; }
.param-bar input { width: 62px; border: 1px solid #a8d4f5; border-radius: 6px; padding: 4px 6px; font-size: 13px; text-align: right; }
.shop-side { width: 180px; flex-shrink: 0; background: #f4f9ff; border: 1px solid #d0e6f7; border-radius: 10px; padding: 6px; }
.shop-side-title { padding: 7px 10px 5px; font-size: 12px; font-weight: 700; color: #7d93b8; }
.shop-side-item { padding: 8px 10px; border-radius: 7px; cursor: pointer; font-size: 13.5px; display: flex; justify-content: space-between; align-items: center; gap: 4px; color: #33415c; }
.shop-side-item > span:first-child { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.shop-side-item:hover { background: #e6f3ff; color: #0052d9; }
.shop-side-item.active { background: #0580ff; color: #fff; font-weight: 600; }
.shop-side-item .del { color: #b91c1c; font-size: 12px; visibility: hidden; padding: 0 4px; font-style: normal; }
.shop-side-item:hover .del { visibility: visible; }
.shop-side-item.active .del { color: #fecaca; }
.shop-side-item .side-acts { display: none; align-items: center; gap: 2px; }
.shop-side-item:hover .side-acts { display: inline-flex; }
.shop-side-item .side-acts .edit { font-style: normal; cursor: pointer; padding: 0 3px; color: #8ba3cf; font-size: 13px; }
.shop-side-item .side-acts .edit:hover { color: #0052d9; }
.shop-side-item.drag-over { outline: 2px dashed #0580ff; background: #dbeafe; }

/* 文件浏览器（WPS云文档式） */
.fb-toolbar { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; flex-wrap: wrap; }
.fb-crumbs { display: flex; align-items: center; gap: 4px; font-size: 14px; }
.fb-crumbs .sep { color: #a8d4f5; }
.fb-crumbs .crumb { cursor: pointer; color: var(--text-2); padding: 3px 6px; border-radius: 5px; }
.fb-crumbs .crumb:hover { background: #f0f7ff; color: #0052d9; }
.fb-crumbs .crumb.cur { color: var(--text); font-weight: 700; cursor: default; }
.fb-crumbs .crumb.drag-over { outline: 2px dashed #0580ff; background: #dbeafe; }
.fb-list { background: #fff; border: 1px solid var(--border); border-radius: 10px; overflow: hidden; }
.fb-row { display: flex; align-items: center; gap: 10px; padding: 12px 18px; border-bottom: 1px solid #f0f4fb; cursor: pointer; transition: background .1s; }
.fb-row:last-child { border-bottom: none; }
.fb-row:hover { background: #f7faff; }
.fb-row.drag-over { outline: 2px dashed #0580ff; outline-offset: -2px; background: #eaf2ff; }
.fb-icon { flex-shrink: 0; display: flex; }
.fb-name { flex: 1; min-width: 0; font-size: 13.5px; color: var(--text); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fb-time { width: 110px; flex-shrink: 0; font-size: 12.5px; color: var(--text-3); }
.fb-size { width: 70px; flex-shrink: 0; font-size: 12.5px; color: var(--text-3); text-align: right; }
.fb-acts { display: none; gap: 4px; flex-shrink: 0; }
.fb-row:hover .fb-acts { display: inline-flex; }
.fb-acts i { font-style: normal; cursor: pointer; padding: 2px 6px; border-radius: 5px; color: #7d93b8; font-size: 14px; }
.fb-acts i:hover { background: #e6f3ff; color: #0052d9; }
.fb-acts i[data-act="del"]:hover { color: #dc2626; }
.fb-crumbs .crumb svg { vertical-align: -3px; margin-right: 1px; }

/* WPS 365式文档标签栏（页内多开表格） */
.doc-tabs { display: flex; gap: 3px; margin-bottom: 0; overflow-x: auto; padding: 0 4px; }
.doc-tab { display: inline-flex; align-items: center; gap: 6px; padding: 7px 14px; background: #e9eefb; border: 1px solid #d5e0f5; border-bottom: none; border-radius: 9px 9px 0 0; font-size: 13px; cursor: pointer; white-space: nowrap; color: #4a5670; user-select: none; transition: background .15s; }
.doc-tab svg { width: 15px; height: 15px; flex-shrink: 0; }
.doc-tab:hover { background: #dfe9fd; }
.doc-tab.active { background: #fff; font-weight: 600; color: #0052d9; box-shadow: 0 -2px 6px rgba(0,82,217,.06); }
.doc-tab .tab-close { font-style: normal; color: #8a97b0; padding: 0 4px; border-radius: 4px; font-size: 14px; line-height: 1; }
.doc-tab .tab-close:hover { color: #dc2626; background: #fee2e2; }
/* 左侧竖排小标签栏（缩小的任务栏，固定在左侧列表与内容之间） */
.doc-tabs-vert { flex-direction: column; width: 150px; gap: 4px; padding: 6px; overflow-y: auto; overflow-x: hidden; background: #f7fafd; border: 1px solid #e5eaf3; border-radius: 8px; align-items: stretch; }
.doc-tabs-vert .doc-tab { border: 1px solid #d5e0f5; border-bottom: 1px solid #d5e0f5; border-radius: 7px; padding: 6px 8px; font-size: 12.5px; justify-content: space-between; width: 100%; }
.doc-tabs-vert .doc-tab.active { box-shadow: none; border-color: #0052d9; }
.doc-tabs-vert .doc-tab > span:first-child { min-width: 0; overflow: hidden; }
.doc-tabs-vert .doc-tab span { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
/* 顶部紧凑横排标签栏（缩小版，放在内容区顶部） */
.doc-tabs-slim { padding: 4px 6px 0; gap: 4px; }
.doc-tabs-slim .doc-tab { padding: 4px 10px; font-size: 12.5px; border-radius: 7px 7px 0 0; }
.doc-tag { font-style: normal; font-size: 10.5px; color: #fff; border-radius: 6px; padding: 1px 6px; font-weight: 600; flex-shrink: 0; }
#regEditors { flex:1; min-width:0; display:flex; flex-direction:column; min-height:0; }
#regEditors .reg-editor { flex:1; min-height:400px; position:relative; border:1px solid #e5eaf3; border-radius:8px; background:#fff; overflow:hidden; }

/* 右键菜单（WPS式） */
.ctx-menu { position: fixed; z-index: 10002; min-width: 168px; background: #fff; border: 1px solid #d0e6f7; border-radius: 10px; box-shadow: 0 10px 32px rgba(16,24,40,.18); padding: 5px; }
.ctx-item { display: flex; align-items: center; gap: 8px; padding: 8px 12px; font-size: 13px; color: var(--text); border-radius: 7px; cursor: pointer; }
.ctx-item:hover { background: #f0f7ff; color: #0052d9; }
.ctx-item.danger { color: #dc2626; }
.ctx-item.danger:hover { background: #fef2f2; }
.ctx-item.disabled { color: #b0bacb; cursor: default; }
.ctx-item.disabled:hover { background: none; color: #b0bacb; }
.ctx-ico { width: 18px; text-align: center; font-size: 13px; flex-shrink: 0; }
.ctx-sep { height: 1px; background: #eef2fa; margin: 4px 8px; }
.calc-num { font-variant-numeric: tabular-nums; }
.neg { color: var(--expense) !important; }

/* 按钮 */
.btn { padding: 6px 14px; border: 1px solid var(--border); border-radius: 6px; background: #fff; color: var(--text); font-size: 13px; font-weight: 500; cursor: pointer; transition: all .18s ease; user-select: none; }
.btn:hover { background: #f3f6fc; border-color: #bfe0fb; transform: translateY(-1px); box-shadow: 0 2px 6px rgba(0,82,217,.10); }
.btn:active { transform: translateY(0); box-shadow: none; }
.btn:focus-visible { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(5,128,255,.18); }
.btn:disabled { opacity: .55; cursor: not-allowed; transform: none; box-shadow: none; }
.btn.primary { background: var(--primary); color: #fff; border-color: var(--primary); }
.btn.primary:hover { background: var(--primary-dark); border-color: var(--primary-dark); box-shadow: 0 3px 8px rgba(5,128,255,.30); }
.btn.danger { color: var(--income); border-color: var(--income); }
.btn.danger:hover { background: #fef2f2; box-shadow: 0 2px 6px rgba(220,38,38,.12); }
.btn.sm { padding: 3px 10px; font-size: 12px; }
.btn.sm:hover { transform: none; }
.btn-group { display: flex; gap: 6px; }

/* 表格 */
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th,td { padding: 12px 14px; text-align: left; border-bottom: 1px solid var(--border); }
th { background: #f9fafb; color: var(--text-2); font-weight: 600; font-size: 12px; white-space: nowrap; }
tr:hover td { background: #f9fafb; }
.text-r { text-align: right; }
.text-c { text-align: center; }
/* 可拖拽调宽表格：列之间浅色分隔线（提示拖拽位置） */
table.col-resizable th, table.col-resizable td { border-right: 1px solid #e8edf5; }
table.col-resizable th:last-child, table.col-resizable td:last-child { border-right: none; }

/* 分页 */
.pager { display: flex; justify-content: center; align-items: center; gap: 8px; margin-top: 14px; font-size: 13px; color: var(--text-2); }

/* 表单 */
.form-row { margin-bottom: 12px; }
.form-row label { display: block; font-size: 13px; color: var(--text); margin-bottom: 4px; }
.form-row .req { color: var(--income); }
.form-row input,.form-row select,.form-row textarea { width: 100%; padding: 8px 12px; border: 1px solid var(--border); border-radius: 6px; font-size: 13px; background: #fff; color: var(--text); }
.form-row textarea { resize: vertical; min-height: 60px; }
.form-inline { display: grid; grid-template-columns: 1fr 1fr; gap: 10px 16px; }

/* 多选类目 */
.cat-checks { display: flex; flex-wrap: wrap; gap: 8px; }
.chk-label { display: inline-flex; align-items: center; gap: 6px; padding: 5px 10px; border: 1px solid #d0d7e2; border-radius: 5px; font-size: 13px; cursor: pointer; background: #fff; transition: .15s; }
.chk-label:hover { border-color: #127ae6; }
.chk-label input[type=checkbox] { accent-color: #127ae6; width: 14px; height: 14px; margin: 0; cursor: pointer; }

/* 弹窗 */
.modal-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); display: flex; align-items: center; justify-content: center; z-index: 200; }
.modal { background: #fff; border-radius: 12px; width: 500px; max-width: 92vw; max-height: 85vh; overflow-y: auto; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.modal-head { display: flex; justify-content: space-between; align-items: center; padding: 18px 24px; border-bottom: 1px solid var(--border); font-size: 16px; font-weight: 700; }
.modal-head button { background: none; border: none; font-size: 22px; cursor: pointer; color: var(--text-3); }
.modal-body { padding: 20px 24px; }
.modal-foot { padding: 16px 24px; border-top: 1px solid var(--border); display: flex; justify-content: flex-end; gap: 8px; }

/* Toast */
#toastRoot { position: fixed; top: 72px; right: 20px; z-index: 300; display: flex; flex-direction: column; gap: 8px; }
.toast { padding: 10px 18px; border-radius: 8px; font-size: 13px; box-shadow: 0 4px 12px rgba(0,0,0,.15); animation: toastIn .25s ease-out; }
.toast.ok { background: #f6ffed; color: #389e0d; border: 1px solid #b7eb8f; }
.toast.err { background: #fff2f0; color: #d4380d; border: 1px solid #ffccc7; }
@keyframes toastIn { from { opacity: 0; transform: translateY(-10px); } to { opacity: 1; transform: translateY(0); } }

/* 状态标签 */
.tag { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 11px; font-weight: 600; }
.tag-open { background: #fff1f0; color: #d4380d; }
.tag-partial { background: #fff7e6; color: #d46b08; }
.tag-settled { background: #f6ffed; color: #389e0d; }
.tag-admin { background: #e6f7ff; color: #0958d9; }
.tag-clerk { background: #f5f5f5; color: #8c8c8c; }

/* 登录 */
.login-wrap { display: flex; align-items: center; justify-content: center; min-height: 100vh; background: linear-gradient(135deg,#0580ff 0%,#0052d9 100%); }
.login-card { background: #fff; border-radius: 16px; padding: 40px; width: 380px; box-shadow: 0 20px 60px rgba(0,0,0,.2); }
.login-card h1 { font-size: 24px; text-align: center; margin-bottom: 6px; color: var(--text); }
.login-card .sub { text-align: center; font-size: 13px; color: var(--text-3); margin-bottom: 28px; }
.login-btn { width: 100%; margin-top: 16px; padding: 10px 0; font-size: 15px; }
.login-tip { margin-top: 16px; font-size: 12px; color: var(--text-3); text-align: center; line-height: 1.6; }

/* 用户区 */
.user-box { display: flex; align-items: center; gap: 8px; margin-left: auto; }
.user-box .uname { font-size: 13px; color: #373737; }
.user-box .role-tag { font-size: 11px; margin-left: 4px; }
.user-box button { background: #f0f7ff; border: 1px solid #bfe0fb; color: var(--primary); padding: 4px 10px; border-radius: 4px; cursor: pointer; font-size: 12px; }
.user-box button:hover { background: #e6f3ff; }

/* 汇总行 */
.summary-row { display: flex; gap: 20px; padding: 10px 14px; background: #f9fafb; border-radius: 8px; margin-bottom: 14px; font-size: 13px; }
.summary-row .item { display: flex; gap: 6px; }
.summary-row .lbl { color: var(--text-2); }
.summary-row .val { font-weight: 700; }

/* 搜索框 */
.search-box { position: relative; }
.search-box input { padding-right: 28px; }
.search-box .clear-btn { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); background: none; border: none; cursor: pointer; color: var(--text-3); font-size: 14px; }

/* 固定开支类型标签 */
.fe-type { font-size: 11px; padding: 1px 6px; border-radius: 3px; }
.fe-rent { background: #e6f7ff; color: #0958d9; }
.fe-labor { background: #fff7e6; color: #d46b08; }
.fe-loan { background: #f6ffed; color: #389e0d; }
.fe-other { background: #f5f5f5; color: #8c8c8c; }

/* 响应式 */
@media (max-width: 900px) {
  .ledger-cards { grid-template-columns: 1fr; }
  .grid-2 { grid-template-columns: 1fr; }
  .ledger-stats { justify-content: center; }
  .topbar { padding: 0 12px; gap: 12px; }
  main { padding: 14px 12px 40px; }
  .dept-layout { flex-direction: column; }
  .dept-sidebar { width: 100% !important; display: flex; overflow-x: auto; padding: 0; position: relative; }
  .dept-side-name { display: none; }
  .side-group-name { white-space: nowrap; padding: 12px 16px; }
  .side-flyout { position: absolute; left: 0; top: 100%; min-width: 180px; border-radius: 0 0 10px 10px; max-height: 55vh; }
  .flyout-lv2 { position: static; box-shadow: none; border: none; border-top: 1px dashed #e0e8f8; border-radius: 0; padding: 4px 0 4px 10px; max-height: none; }
  .flyout-lv2-title { display: none; }
}

/* 部门左侧边栏布局（仿聚水潭悬浮菜单） */
.dept-layout { display: flex; align-items: stretch; margin: 0; width: 100vw; position: relative; min-height: calc(100vh - 60px); }
.dept-sidebar { width: 128px; flex-shrink: 0; background: linear-gradient(180deg, #e6f3ff 0%, #d6e9fc 100%); padding: 8px 0 20px; border-right: 1px solid #bfe0fb; }
.dept-side-name { padding: 12px 16px 14px; font-size: 16px; font-weight: 700; color: #0052d9; border-bottom: 1px solid #a8d4f5; margin-bottom: 6px; }

/* 大类（只显示名称，悬浮出菜单） */
.side-group { position: relative; }
.side-group-name { padding: 11px 14px; font-size: 15px; color: #33415c; font-weight: 600; cursor: pointer; user-select: none; display: flex; align-items: center; justify-content: space-between; border-left: 3px solid transparent; transition: all .12s; }
.side-group-name .go { font-size: 14px; color: #8ba3cf; transition: all .15s; }
.side-group-name:hover { color: #0052d9; background: rgba(255,255,255,.45); }
.side-group:hover .side-group-name .go, .side-group.open .side-group-name .go { transform: translateX(2px); color: #0052d9; }
.side-group.has-active .side-group-name { background: #fff; color: #0052d9; border-left-color: #0580ff; box-shadow: 0 1px 3px rgba(16,24,40,.1); }
.side-group:hover .side-group-name, .side-group.open .side-group-name { background: rgba(255,255,255,.55); color: #0052d9; }

/* 浮层菜单（聚水潭式：分组分栏全部显示） */
.side-flyout { display: none; position: absolute; left: 100%; top: 0; min-width: 200px; background: #fff; border: 1px solid #d0e6f7; border-radius: 0 12px 12px 12px; box-shadow: 0 10px 30px rgba(16,24,40,.16); z-index: 300; padding: 8px; max-height: 78vh; overflow-y: auto; }
.side-group.open .side-flyout { display: block; }
.side-flyout.mega { min-width: 400px; }
.flyout-title { padding: 8px 12px 10px; font-size: 14px; font-weight: 700; color: #0052d9; border-bottom: 1px solid #e8eefb; margin-bottom: 6px; }
.flyout-cols { display: flex; align-items: stretch; gap: 0; }
.flyout-col { flex: 1; min-width: 165px; }
.flyout-col.col-lv1 { flex: 0 0 150px; border-right: 1px solid #e8eefb; padding-right: 6px; background: #f7faff; border-radius: 8px 0 0 8px; }
.flyout-col.col-lv2 { padding-left: 8px; }
.flyout-lv1 { padding: 9px 12px; font-size: 13.5px; font-weight: 600; color: #33415c; cursor: pointer; user-select: none; display: flex; align-items: center; justify-content: space-between; border-radius: 7px; transition: all .1s; }
.flyout-lv1 .go { font-size: 12px; color: #8ba3cf; }
.flyout-lv1:hover { background: #eaf2ff; color: #0052d9; }
.flyout-lv1.open { background: #e6f3ff; color: #0052d9; }
.flyout-lv1.flyout-direct { cursor: pointer; }
.flyout-desc { padding: 10px 12px; font-size: 12.5px; color: var(--text-2); line-height: 1.7; }
.row-badge { display: inline-block; font-style: normal; font-size: 10.5px; background: #e6f3ff; color: #0580ff; border-radius: 8px; padding: 0 6px; margin-left: 6px; font-weight: 600; }

/* WPS编辑器：底部拖拽条 + 全屏 */
#wpsResizeBar { height: 12px; background: #eef3fc; border: 1px solid var(--border); border-top: none; border-radius: 0 0 8px 8px; cursor: ns-resize; display: flex; align-items: center; justify-content: center; }
#wpsResizeBar::before { content: ''; width: 44px; height: 4px; border-radius: 2px; background: #a8d4f5; }
#wpsResizeBar:hover { background: #e6f3ff; }
#wpsResizeBar:hover::before { background: #0580ff; }
/* 编辑器原生全屏（Fullscreen API）：Esc 由浏览器原生处理 */
#wpsWrap { position: relative; }
#wpsWrap:fullscreen { background: #f4f7fd; padding: 12px 16px; display: flex; flex-direction: column; }
#wpsWrap:fullscreen .toolbar { flex-shrink: 0; }
#wpsWrap:fullscreen #wpsGrid { flex: 1; height: auto !important; min-height: 0 !important; border-radius: 8px; }
#wpsWrap:fullscreen #wpsResizeBar { display: none; }
#wpsFocusExit { display: none; position: absolute; right: 22px; bottom: 22px; z-index: 10; background: #0052d9; color: #fff; border-color: #0052d9; box-shadow: 0 4px 14px rgba(16,24,40,.30); border-radius: 20px; padding: 8px 18px; }
#wpsFocusExit:hover { background: #0580ff; border-color: #0580ff; }
#wpsWrap:fullscreen #wpsFocusExit { display: block; }
.flyout-col-title { padding: 8px 12px 6px; font-size: 12.5px; color: #7d93b8; font-weight: 700; border-bottom: 1px dashed #e8eefb; margin-bottom: 4px; }
.flyout-item { padding: 8px 12px; font-size: 13.5px; color: #3d4a66; cursor: pointer; border-radius: 7px; transition: all .1s; display: flex; align-items: center; }
.flyout-item:hover { background: #f0f7ff; color: #0052d9; }
.flyout-item.active { background: #e6f3ff; color: #0052d9; font-weight: 600; }
.flyout-empty { padding: 10px 12px; font-size: 12px; color: #8a97b0; line-height: 1.6; }
.shop-del { margin-left: auto; color: #b91c1c; font-size: 13px; padding: 0 4px; border-radius: 4px; visibility: hidden; }
.flyout-item:hover .shop-del { visibility: visible; }
.shop-del:hover { background: #fee2e2; }
.flyout-add-shop { color: #0580ff !important; font-weight: 600; border-top: 1px dashed #e0e8f8; margin-top: 4px; border-radius: 0 0 7px 7px !important; }
/* 部门主区：脱离 flex 布局，绝对定位从左侧栏后开始，撑满剩余视口宽度 */
.dept-main { position: relative; display: block; width: calc(100vw - 76px); left: 76px; min-width: 0; padding: 18px 12px 40px 14px; box-sizing: border-box; margin-left: 0; }
#tabContent { width: 100%; margin-left: 0; box-sizing: border-box; padding-left: 0; }
#tabContent > .ledger-head, .dept-main > .ledger-head { margin-left: 0; padding-left: 0; }
/* 强制所有内容板块撑满主区（防各种 box 收缩到左上） */
#tabContent > * { display: block; width: 100% !important; max-width: none !important; margin-left: 0 !important; box-sizing: border-box !important; }
#tabContent .grid-2 { display: grid; grid-template-columns: 1.4fr 1fr; gap: 16px; width: 100% !important; }
#tabContent .grid-2 > * { min-width: 0; }

/* WPS式可编辑表格 */
.edit-grid td { padding: 2px 4px !important; }
.edit-grid input, .edit-grid select { width: 100%; border: 1px solid transparent; background: transparent; padding: 6px 8px; font-size: 14px; border-radius: 5px; color: var(--text); font-family: inherit; }
.edit-grid input:hover, .edit-grid select:hover { border-color: #bfe0fb; background: #fff; }
.edit-grid input:focus, .edit-grid select:focus { border-color: var(--primary); background: #fff; outline: none; box-shadow: 0 0 0 2px rgba(5,128,255,.12); }
.edit-grid input.text-r, .edit-grid td.text-r input { text-align: right; }
.edit-grid .add-row input, .edit-grid .add-row select { border: 1px dashed #a8d4f5; background: #f6f9ff; }
.edit-grid .add-row input:focus { border-style: solid; }
.edit-grid tbody tr:hover { background: #f4f9ff; }
.trial-bar { display: flex; align-items: center; gap: 8px; margin: 0 0 12px; padding: 10px 14px; background: #f0f7ff; border: 1px solid #d5e3f7; border-radius: 8px; font-size: 13px; }
.trial-bar input { border: 1px solid #a8d4f5; border-radius: 6px; padding: 6px 8px; font-size: 14px; text-align: right; }

/* 空状态 */
.empty { text-align: center; padding: 30px; color: var(--text-3); font-size: 13px; }

/* ===== 角色标签 ===== */
.role-boss { background: linear-gradient(135deg,#fa8c16,#d4380d) !important; color: #fff !important; padding: 2px 10px !important; border-radius: 12px !important; font-size: 11px !important; font-weight: 600; margin-left: 6px; }
.role-manager { background: linear-gradient(135deg,#0580ff,#0052d9) !important; color: #fff !important; padding: 2px 10px !important; border-radius: 12px !important; font-size: 11px !important; font-weight: 600; margin-left: 6px; }
.role-employee { background: #e6f3ff !important; color: #0052d9 !important; padding: 2px 10px !important; border-radius: 12px !important; font-size: 11px !important; font-weight: 600; margin-left: 6px; }
.tag.tag-scope { background: #f0f7ff; color: #0580ff; font-size: 11px; padding: 2px 8px; border-radius: 10px; }
.scope-badge { font-size: 11px; padding: 1px 8px; border-radius: 10px; margin-left: 8px; font-weight: 500; }
.scope-self { background: #fff7e6; color: #d48806; border: 1px solid #ffe58f; }
.scope-all { background: #e6f7ff; color: #0580ff; border: 1px solid #bfe0fb; }
.scope-notice { padding: 8px 14px; margin-bottom: 12px; background: #fffbe6; border: 1px solid #ffe58f; border-radius: 8px; font-size: 12.5px; color: #ad6800; display: flex; align-items: center; gap: 6px; }

/* ===== KPI 卡片行 ===== */
.kpi-row { display: grid; grid-template-columns: repeat(6,1fr); gap: 14px; margin-bottom: 18px; }
.kpi-row-sm { grid-template-columns: repeat(5,1fr); }
.kpi-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; text-align: center; position: relative; overflow: hidden; }
.kpi-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 3px; }
.kpi-income::before { background: #d4380d; } .kpi-expense::before { background: #389e0d; }
.kpi-profit::before { background: #0580ff; } .kpi-ar::before { background: #d48806; }
.kpi-ap::before { background: #7c3aed; } .kpi-stock::before { background: #08979c; }
.kpi-label { font-size: 12.5px; color: var(--text-3); margin-bottom: 6px; }
.kpi-val { font-size: 20px; font-weight: 700; color: var(--text); }
.kpi-income .kpi-val { color: #cf1322; } .kpi-expense .kpi-val { color: #389e0d; }
.kpi-profit .kpi-val { color: #0580ff; }

/* ===== 预警卡片 ===== */
.alerts-row { display: flex; gap: 12px; margin-bottom: 18px; flex-wrap: wrap; }
.alert-card { padding: 10px 16px; border-radius: 8px; font-size: 13px; display: flex; align-items: center; gap: 8px; flex: 1; min-width: 200px; }
.alert-warn { background: #fffbe6; border: 1px solid #ffe58f; color: #ad6800; }
.alert-danger { background: #fff2f0; border: 1px solid #ffccc7; color: #cf1322; }
.alert-info { background: #e6f7ff; border: 1px solid #bfe0fb; color: #0580ff; }
.alert-icon { font-size: 16px; }

/* ===== 老板看板 ===== */
.boss-dashboard { animation: pageIn .25s ease; }
.section-title { font-size: 15px; font-weight: 700; color: var(--text); margin: 18px 0 12px; display: flex; align-items: center; gap: 8px; }
.section-title::before { content: ""; width: 4px; height: 16px; background: var(--primary); border-radius: 2px; }

/* ===== 员工看板 ===== */
.employee-dashboard { animation: pageIn .25s ease; }
.task-list { max-height: 340px; overflow-y: auto; }
.task-item { padding: 12px 14px; border-bottom: 1px solid var(--border); cursor: default; transition: background .12s; }
.task-item:hover { background: #f8faff; }
.task-item:last-child { border-bottom: none; }
.task-party { font-size: 13px; font-weight: 600; color: var(--text); margin-bottom: 4px; }
.task-row { display: flex; justify-content: space-between; font-size: 12.5px; color: var(--text-2); margin-bottom: 2px; }
.task-amount { font-weight: 700; }
.task-meta { font-size: 11.5px; color: var(--text-3); }
.task-ar { border-left: 3px solid #d48806; }
.task-ar:hover { background: #fffbe6; }

/* ===== 快捷操作 ===== */
.quick-actions { display: flex; gap: 10px; flex-wrap: wrap; margin-bottom: 14px; }
.qa-btn { display: flex; align-items: center; gap: 8px; padding: 10px 18px; border: 1px solid var(--border); border-radius: 8px; background: #fff; cursor: pointer; font-size: 13.5px; color: var(--text); transition: all .15s; box-shadow: var(--shadow); }
.qa-btn:hover { transform: translateY(-1px); box-shadow: 0 4px 12px rgba(16,24,40,.12); border-color: var(--lc,var(--primary)); color: var(--lc,var(--primary)); }
.qa-icon { font-size: 18px; width: 28px; height: 28px; border-radius: 6px; background: var(--lc,#e6f3ff); color: var(--lc,#0580ff); display: flex; align-items: center; justify-content: center; font-weight: 700; }
.qa-rp .qa-icon { background: #ede9fe; color: #7c3aed; }

/* ===== 复选框组 ===== */
.checkbox-group { display: flex; gap: 14px; flex-wrap: wrap; padding: 6px 0; }
.checkbox-label { display: flex; align-items: center; gap: 6px; font-size: 13.5px; color: var(--text); cursor: pointer; }
.checkbox-label input[type="checkbox"] { width: 16px; height: 16px; accent-color: var(--primary); cursor: pointer; }

/* ===== 响应式 ===== */
@media (max-width: 900px) {
  .kpi-row { grid-template-columns: repeat(3,1fr); }
  .kpi-row-sm { grid-template-columns: repeat(2,1fr); }
  .ledger-cards { grid-template-columns: 1fr; }
  .quick-actions { flex-direction: column; }
}

/* ===== 仓库实时监控工作台 ===== */
.wh-dashboard { animation: pageIn .25s ease; }
.wh-dashboard .kpi-unit { font-size: 13px; color: var(--text-3); margin-left: 4px; font-weight: 400; }
.wh-dashboard .kpi-sub { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ===== 仓库实时大屏 ===== */
.wh-screen { animation: pageIn .25s ease; }
.screen-header { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; padding: 12px 18px; background: linear-gradient(135deg, #0580ff, #0052d9); color: #fff; border-radius: var(--radius); box-shadow: var(--shadow); }
.screen-header h2 { font-size: 18px; font-weight: 700; margin: 0; }
.screen-time { font-size: 13px; opacity: 0.9; }
.screen-kpi { display: grid; grid-template-columns: repeat(7, 1fr); gap: 14px; margin-bottom: 18px; }
.sk-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 18px 14px; text-align: center; position: relative; overflow: hidden; transition: all .15s; }
.sk-card:hover { transform: translateY(-2px); box-shadow: 0 6px 16px rgba(16,24,40,.12); }
.sk-card::before { content: ""; position: absolute; top: 0; left: 0; right: 0; height: 4px; }
.sk-total::before { background: #0580ff; }
.sk-value::before { background: #d48806; }
.sk-in::before { background: #389e0d; }
.sk-out::before { background: #d4380d; }
.sk-pending::before { background: #7c3aed; }
.sk-shipped::before { background: #08979c; }
.sk-warn::before { background: #cf1322; }
.sk-val { font-size: 24px; font-weight: 700; color: var(--text); margin-bottom: 4px; }
.sk-label { font-size: 12px; color: var(--text-3); }
.screen-wh-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 14px; }
.screen-wh-card { background: #fff; border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow); padding: 16px 18px; border-top: 4px solid var(--primary); }
.sw-name { font-size: 15px; font-weight: 700; color: var(--text); margin-bottom: 10px; }
.sw-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.sw-val { font-weight: 600; color: var(--text); }

/* ===== 标签样式补充 ===== */
.tag.tag-danger { background: #fff2f0; color: #cf1322; border: 1px solid #ffccc7; }
.tag.tag-warn { background: #fffbe6; color: #ad6800; border: 1px solid #ffe58f; }

/* ===== 账户仪表盘 ===== */
.shop-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(320px, 1fr)); gap: 16px; }
.shop-card { background: var(--card); border-radius: var(--radius); padding: 24px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.shop-card:hover { box-shadow: 0 4px 12px rgba(16,24,40,.12); }
.sc-head { display: flex; justify-content: space-between; align-items: center; margin-bottom: 8px; }
.sc-platform { font-size: 13px; color: var(--text-2); }
.sc-health { font-size: 13px; font-weight: 600; }
.sc-name { font-size: 16px; font-weight: 700; margin-bottom: 12px; }
.sc-info { display: grid; grid-template-columns: 1fr 1fr; gap: 6px 16px; margin-bottom: 12px; }
.sc-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); }
.sc-row span:first-child { color: var(--text-3); }
.sc-actions { display: flex; gap: 6px; flex-wrap: wrap; border-top: 1px solid var(--border); padding-top: 12px; }

/* ===== 主体卡片 ===== */
.entity-card { background: var(--card); border-radius: var(--radius); padding: 20px; margin-bottom: 16px; box-shadow: var(--shadow); border: 1px solid var(--border); }
.ec-head { display: flex; justify-content: space-between; align-items: flex-start; margin-bottom: 12px; }
.ec-name { font-size: 17px; font-weight: 700; }
.ec-meta { display: flex; gap: 6px; align-items: center; margin-top: 4px; flex-wrap: wrap; }
.ec-status { display: flex; gap: 6px; align-items: center; }
.ec-kpis { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-bottom: 8px; padding: 10px; background: var(--bg); border-radius: 8px; }
.ec-kpi { text-align: center; }
.ec-kpi span { display: block; font-size: 12px; color: var(--text-3); }
.ec-kpi b { font-size: 16px; color: var(--text); }
.ec-shops { font-size: 13px; color: var(--text-2); margin-bottom: 4px; display: flex; gap: 6px; flex-wrap: wrap; align-items: center; }
.ec-sales { font-size: 13px; color: var(--text-2); }
.ec-sales span { margin-right: 12px; white-space: nowrap; }
.ec-actions { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ===== 预警卡片 ===== */
.alert-card { padding: 10px 14px; border-radius: 6px; margin-bottom: 8px; font-size: 13px; border: 1px solid transparent; }
.alert-card b { margin-right: 4px; }
.alert-warn { background: #fffbe6; border-color: #ffe58f; color: #ad6800; }
.alert-danger { background: #fff2f0; border-color: #ffccc7; color: #cf1322; }
.alert-info { background: #e6f7ff; border-color: #91d5ff; color: #0050b3; }

/* 聚水潭交易模块状态标签 */
.jst-status { display: inline-block; padding: 2px 8px; border-radius: 4px; font-size: 12px; font-weight: 500; }
.status-pending,.status-awaiting_deposit,.status-awaiting_stock,.status-unshipped { background: #fff7e6; color: #d46b08; }
.status-paid,.status-deposit_paid { background: #e6f7ff; color: #1890ff; }
.status-reviewing,.status-tail_paid,.status-awaiting_tail { background: #f6ffed; color: #389e0d; }
.status-picking,.status-packed,.status-processing,.status-inspecting { background: #f0f5ff; color: #2f54eb; }
.status-shipped,.status-awaiting_ship,.status-mailed { background: #e6fffb; color: #08979c; }
.status-delivered,.status-signed,.status-in_transit,.status-arrived { background: #f6ffed; color: #52c41a; }
.status-completed,.status-done,.status-cleared { background: #f6ffed; color: #237804; }
.status-cancelled,.status-rejected,.status-exception { background: #fff2f0; color: #f5222d; }
.status-refunding,.status-returned { background: #fff0f6; color: #eb2f96; }
.status-active { background: #f6ffed; color: #52c41a; }
.status-inactive { background: #f5f5f5; color: #8c8c8c; }
.status-blacklist { background: #fff2f0; color: #f5222d; }

.order-item-row input { padding: 3px 6px; border: 1px solid #d9d9d9; border-radius: 3px; font-size: 12px; }
.order-item-row input[type="number"] { padding-right: 2px; }
.kpi-meta { font-size: 12px; color: var(--text-3); margin-top: 2px; }

/* ========== 聚水潭式蓝色纯文字侧栏（sticky 固定不随页面滚动） ========== */
.jst-sidebar { width: 76px; flex-shrink: 0; background: linear-gradient(180deg, #1d92f7 0%, #127ae6 100%); display: flex; flex-direction: column; padding: 30px 0 0; position: fixed; left: 0; top: 0; bottom: 0; z-index: 200; box-shadow: 2px 0 8px rgba(0,0,0,.06); }
.jst-nav-main { flex: 1; min-height: 0; overflow-y: auto; }
.jst-nav-bottom { margin-top: auto; border-top: 1px solid rgba(255,255,255,.18); padding: 0 0 14px; background: linear-gradient(180deg, transparent 0%, rgba(0,0,0,.14) 100%); display: flex; flex-direction: column; align-items: stretch; justify-content: flex-end; }
.jst-nav-bottom .jst-nav-item { padding: 0; margin-bottom: 0; line-height: 1; }
.jst-nav-bottom .jst-nav-label { font-size: 12px; letter-spacing: .5px; line-height: 1; padding-bottom: 0; }
.jst-nav-item { padding: 13px 2px; text-align: center; cursor: pointer; color: rgba(255,255,255,.92); user-select: none; transition: background .12s, color .12s; }
.jst-nav-main > .jst-nav-item:first-child { padding-top: 0; padding-bottom: 0; }
/* 第一个菜单项（财务）恢复标准 padding，避免被 topbar 遮挡 */
.dept-layout .jst-nav-main > .jst-nav-item:first-child { padding: 13px 2px; }
.jst-nav-bottom .jst-nav-label { font-size: 12px; letter-spacing: .5px; }
.jst-nav-gear { font-size: 16px; line-height: 1; filter: grayscale(100%) brightness(2.5); margin-bottom: 3px; }
.jst-nav-item:hover { background: rgba(255,255,255,.14); color: #fff; }
.jst-nav-item.active { background: transparent; color: #fff; font-weight: 700; border-left: 3px solid #fff; }
.jst-nav-label { font-size: 14px; font-weight: 500; letter-spacing: 1px; }

/* 多列平铺浮层（聚水潭式白色 mega menu，全高度从顶到底覆盖） */
.jst-flyout { display: none; position: absolute; left: 100%; top: 0; bottom: 0; background: #fff; border: 1px solid #e6ecf3; border-left: none; border-radius: 0 6px 6px 0; box-shadow: 2px 8px 24px rgba(16,24,40,.12); z-index: 400; padding: 8px 4px; overflow-y: auto; }
.jst-nav-item:hover .jst-flyout, .jst-nav-item.open .jst-flyout { display: flex; align-items: stretch; }
.jst-flyout-panel { min-width: 176px; max-width: 220px; padding: 2px 10px 20px; border-right: 1px solid #f0f3f8; }
.jst-flyout-panel:first-child { background: #fafcff; }
.jst-flyout-panel:last-child { border-right: none; }
.jst-flyout-group { padding: 14px 16px 8px; font-size: 14px; font-weight: 700; color: #1a1a1a; white-space: nowrap; letter-spacing: .5px; }
.jst-flyout-item { display: block; padding: 8px 16px; font-size: 14px; line-height: 1.5; color: #1a1a1a; border-radius: 4px; cursor: pointer; white-space: nowrap; transition: background .1s, color .1s; position: relative; }
.jst-flyout-item:hover { background: #f2f8ff; color: #000; }
.jst-flyout-item.active { background: #e6f3ff; color: #000; font-weight: 600; }
.jst-flyout-item .shop-del { position: absolute; right: 8px; top: 50%; transform: translateY(-50%); visibility: hidden; color: #cf1322; cursor: pointer; padding: 0 4px; font-size: 13px; }
.jst-flyout-item:hover .shop-del { visibility: visible; }
.jst-flyout-empty { padding: 8px 16px; font-size: 12px; color: #8a97b0; white-space: normal; line-height: 1.6; }
.jst-flyout-add { color: #127ae6 !important; font-weight: 600; border-top: 1px dashed #e0e8f8; margin-top: 6px; padding-top: 10px !important; border-radius: 0 !important; }

@media (max-width: 900px) {
  .jst-sidebar { position: static; width: 64px; box-shadow: none; }
  .dept-main { padding: 18px 22px 40px; }
  .jst-nav-label { font-size: 12px; }
  .jst-flyout-panel { min-width: 140px; }
  .jst-flyout-item, .jst-flyout-group { font-size: 14px; }
}

/* ===== 用户及权限标签页（聚水潭式） ===== */
.umt-bar { display: flex; gap: 4px; border-bottom: 2px solid #e6ecf3; margin-bottom: 16px; }
.umt-tab { padding: 10px 22px; font-size: 14px; color: #55627a; cursor: pointer; border: none; background: none; border-bottom: 2px solid transparent; margin-bottom: -2px; font-weight: 500; transition: all .12s; }
.umt-tab:hover { color: #127ae6; }
.umt-tab.active { color: #127ae6; border-bottom-color: #127ae6; font-weight: 600; }
.role-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: 14px; }
.role-card { border: 1px solid #e6ecf3; border-radius: 10px; padding: 18px; background: #fff; }
.role-card h4 { display: flex; align-items: center; justify-content: space-between; margin-bottom: 8px; font-size: 15px; }
.role-card .rc-desc { font-size: 12.5px; color: var(--text-3); line-height: 1.7; min-height: 40px; }
.role-card .rc-stats { display: flex; gap: 14px; margin: 10px 0; font-size: 12.5px; color: var(--text-2); }
.role-card .rc-stats b { color: var(--primary); }
.perm-tree { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 10px; }
.perm-tree-group { border: 1px solid #e6ecf3; border-radius: 8px; padding: 10px 14px; background: #fafcff; }
.perm-tree-group > b { display: block; font-size: 13.5px; margin-bottom: 6px; color: #22304a; }
.perm-tree-group label { display: block; padding: 4px 0; font-size: 13px; color: #45536b; cursor: pointer; }
.perm-tree-group label:hover { color: #127ae6; }

/* ===== 店铺平台分组 ===== */
.pf-tabs { display: flex; gap: 8px; flex-wrap: wrap; margin-bottom: 14px; }
.pf-tab { padding: 6px 14px; font-size: 13px; border: 1px solid #dbe4f0; background: #fff; color: #55627a; border-radius: 16px; cursor: pointer; transition: all .12s; }
.pf-tab:hover { border-color: #127ae6; color: #127ae6; }
.pf-tab.active { background: #127ae6; border-color: #127ae6; color: #fff; font-weight: 600; }
.pf-section { margin-bottom: 18px; }
.pf-title { font-size: 14px; font-weight: 700; color: #22304a; padding: 4px 0 10px; display: flex; align-items: baseline; gap: 8px; }
.pf-title::before { content: ''; display: inline-block; width: 4px; height: 14px; background: #127ae6; border-radius: 2px; align-self: center; }
.pf-count { font-size: 12px; color: #8a97b0; font-weight: 400; }

/* ===== 资产负债表 / 现金流量表 ===== */
.bs-table { width: 100%; border-collapse: collapse; }
.bs-table td { padding: 10px 12px; border-bottom: 1px solid #eef2f7; font-size: 13.5px; }
.bs-total td { font-weight: 700; background: #f6f9fd; border-top: 2px solid #d8e4f3; }
.cf-table { width: 100%; border-collapse: collapse; font-size: 12.5px; }
.cf-table th { padding: 8px 10px; background: #f6f9fd; border-bottom: 2px solid #d8e4f3; font-weight: 600; white-space: nowrap; }
.cf-table td { padding: 7px 10px; border-bottom: 1px solid #eef2f7; white-space: nowrap; }
.cf-sec td { background: #eaf3fe; font-weight: 700; color: #0d5bc4; }
.cf-net td { font-weight: 600; background: #f6f9fd; }
.cf-total td { font-weight: 700; background: #fff7e6; border-top: 2px solid #ffe1a8; }

/* ===== 运营管理：新品规划表 ===== */
.opm-cards { display: grid; grid-template-columns: repeat(6, 1fr); gap: 14px; margin-bottom: 16px; }
.opm-card { background: #fff; border-radius: 8px; padding: 14px 16px; box-shadow: 0 1px 4px rgba(15,42,80,.06); text-align: center; }
.opm-card-num { font-size: 24px; font-weight: 700; color: #22304a; }
.opm-card-label { font-size: 12.5px; color: #8a97b0; margin-top: 2px; }
.opm-progress { display: flex; gap: 3px; }
.opm-seg { flex: 1; height: 8px; border-radius: 4px; background: #e8edf5; }
.opm-seg.done { background: var(--seg-color); }
.opm-seg.doing { background: linear-gradient(90deg, var(--seg-color) 55%, #e8edf5 55%); animation: opmPulse 1.6s ease-in-out infinite; }
.opm-seg.skipped { background: repeating-linear-gradient(45deg, #e8edf5, #e8edf5 3px, #d5dce8 3px, #d5dce8 6px); }
@keyframes opmPulse { 0%,100% { opacity: 1; } 50% { opacity: .55; } }
/* 阶段时间轴弹窗 */
.opm-timeline { display: flex; flex-direction: column; }
.opm-stage { display: flex; gap: 14px; position: relative; padding-bottom: 18px; }
.opm-stage:not(:last-child)::before { content: ''; position: absolute; left: 11px; top: 26px; bottom: 0; width: 2px; background: #e5eaf3; }
.opm-stage-dot { width: 24px; height: 24px; border-radius: 50%; border: 2px solid #e5eaf3; flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; background: #e5eaf3; z-index: 1; }
.opm-stage-body { flex: 1; background: #f8fafd; border: 1px solid #edf1f7; border-radius: 8px; padding: 10px 12px; }
.opm-stage-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; margin-top: 8px; }
.opm-stage-grid > div { display: flex; flex-direction: column; gap: 3px; }
.opm-stage-grid span { font-size: 11.5px; color: #8a97b0; }
.opm-stage-grid input, .opm-st-note { padding: 5px 8px; border: 1px solid #dce3ee; border-radius: 6px; font-size: 12.5px; }
.opm-st-status { padding: 4px 8px; border: 1px solid #dce3ee; border-radius: 6px; font-size: 12.5px; }
@media (max-width: 1100px) { .opm-cards { grid-template-columns: repeat(3, 1fr); } .opm-stage-grid { grid-template-columns: repeat(2, 1fr); } }

/* ===== 新品开发管理表（整页宽表 + 内联编辑） ===== */
.opm-platbar { display: flex; gap: 6px; flex-wrap: wrap; margin-bottom: 10px; }
.opm-plat { border: 1px solid #dce3ee; background: #fff; padding: 8px 18px; font-size: 13.5px; font-weight: 600; color: #44506a; cursor: pointer; border-radius: 8px; display: flex; align-items: center; gap: 6px; transition: all .15s; }
.opm-plat:hover { border-color: #127ae6; color: #127ae6; }
.opm-plat.active { background: #127ae6; border-color: #127ae6; color: #fff; box-shadow: 0 2px 8px rgba(18,122,230,.3); }
.opm-plat-n { font-size: 11px; background: #eef2f8; color: #8a97b0; border-radius: 8px; padding: 0 6px; line-height: 16px; font-weight: 400; }
.opm-plat.active .opm-plat-n { background: rgba(255,255,255,.25); color: #fff; }
.opm-subbar { display: flex; gap: 8px; margin: 2px 0 14px; }
.opm-sub { border: 1px solid #dce3ee; background: #f6f9fd; padding: 5px 16px; font-size: 12.5px; font-weight: 600; color: #55627c; cursor: pointer; border-radius: 14px; transition: all .15s; }
.opm-sub:hover { border-color: #127ae6; color: #127ae6; }
.opm-sub.active { background: #eaf3fe; border-color: #127ae6; color: #0d5bc4; }
.opm-strategy { display: flex; align-items: center; gap: 10px; background: #fff8e6; border: 1px solid #ffe1a8; border-radius: 8px; padding: 8px 12px; margin-bottom: 10px; }
.opm-strategy-label { font-size: 12.5px; font-weight: 700; color: #ad6800; white-space: nowrap; }
.opm-strategy input { flex: 1; border: none; background: transparent; font-size: 12.5px; color: #5c4400; outline: none; }
.opm-strategy input::placeholder { color: #c9a86a; }
.opm-vtabs { display: flex; gap: 4px; flex-wrap: wrap; margin-bottom: 14px; border-bottom: 1px solid #e5eaf3; }
.opm-vtab { border: none; background: none; padding: 8px 14px; font-size: 13px; color: #55627c; cursor: pointer; border-bottom: 2px solid transparent; margin-bottom: -1px; display: flex; align-items: center; gap: 5px; }
.opm-vtab:hover { color: #127ae6; }
.opm-vtab.active { color: #127ae6; font-weight: 600; border-bottom-color: #127ae6; }
.opm-vtab-n { font-size: 11px; background: #eef2f8; color: #8a97b0; border-radius: 8px; padding: 0 6px; line-height: 16px; }
.opm-vtab.active .opm-vtab-n { background: #e3f0ff; color: #127ae6; }
.opm-table-wrap { overflow-x: auto; background: #fff; border-radius: 8px; box-shadow: 0 1px 4px rgba(15,42,80,.06); }
.opm-table { border-collapse: collapse; font-size: 12.5px; width: 100%; }
.opm-table th { padding: 8px; background: #f8fafd; border-bottom: 1px solid #edf1f7; font-weight: 600; color: #55627c; white-space: nowrap; text-align: center; }
.opm-table th.opm-gh { background: #fbfcfe; font-size: 12.5px; }
.opm-table td { padding: 6px 8px; border-bottom: 1px solid #f0f3f8; border-right: 1px solid #f6f8fb; white-space: nowrap; text-align: center; }
.opm-table tbody tr:hover td { background: #f6faff; }
.opm-row-dead td { opacity: .55; }
.opm-tag { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 600; }
.opm-thumb { width: 36px; height: 36px; object-fit: cover; border-radius: 6px; border: 1px solid #edf1f7; }
.opm-ed { cursor: pointer; }
.opm-ed:hover { outline: 1px dashed #a8c8f5; outline-offset: -1px; }
.opm-ed input, .opm-ed select { width: 100%; min-width: 80px; padding: 4px 6px; border: 1px solid #127ae6; border-radius: 4px; font-size: 12.5px; box-sizing: border-box; }

/* ===== 商品及库存管理（可售天数徽章/统计） ===== */
.pd-days { display: inline-block; padding: 2px 8px; border-radius: 10px; font-size: 11.5px; font-weight: 700; }
.pd-low { background: #fff1f0; color: #cf1322; }
.pd-mid { background: #fff7e6; color: #ad6800; }
.pd-high { background: #f6ffed; color: #389e0d; }
.pd-stat { cursor: pointer; font-size: 12px; padding: 3px 10px; border-radius: 12px; user-select: none; }
.pd-stat:hover { filter: brightness(.96); }

/* ===== HR 员工附件上传 ===== */
.hr-upbox { width: 150px; height: 95px; border: 1.5px dashed #b9c8de; border-radius: 8px; display: flex; align-items: center; justify-content: center; cursor: pointer; color: #8a97b0; font-size: 12.5px; background: #fafcfe; overflow: hidden; transition: border-color .15s; }
.hr-upbox:hover { border-color: #127ae6; color: #127ae6; background: #f2f8ff; }
.modal-body { max-height: 70vh; overflow-y: auto; }

/* ===== HR 职级通道卡片 ===== */
.lv-card { width: 210px; background: #f8fbff; border: 1px solid #e2ebf8; border-radius: 10px; padding: 12px 14px; }
.lv-badge { background: #127ae6; color: #fff; font-size: 11px; font-weight: 700; border-radius: 5px; padding: 1px 7px; }

/* ===== 全局默认：系统内所有 WPS 在线表格 =====
   编辑器精确填满容器（底部 Sheet 标签栏固定贴容器底部，不被顶出）
   注意：只作用于挂载容器本身（#wpsGrid / sheet.html #grid），不能选 .reg-editor > div（会误伤 #wpsWrap 工具栏容器） */
#wpsGrid { position: relative; }
#wpsGrid iframe, #wpsGrid > div { position: absolute !important; top: 0 !important; left: 0 !important; right: 0 !important; bottom: 0 !important; width: 100% !important; height: 100% !important; }

@media (max-width: 768px) {
  .shop-cards { grid-template-columns: 1fr; }
  .ec-kpis { grid-template-columns: repeat(2, 1fr); }
  .screen-wh-grid { grid-template-columns: repeat(2, 1fr); }
}

/* ===== 备案页脚 ===== */
#beianFooter { text-align: center; padding: 12px 10px 16px; font-size: 12px; color: #9aa7bc; }
#beianFooter a { color: #9aa7bc; text-decoration: none; transition: color .15s; }
#beianFooter a:hover { color: #0580ff; }

/* ===== 表格板块拖拽导入 ===== */
.shop-side-hint { font-size: 11.5px; color: #9aa7bc; padding: 10px 12px; text-align: center; border: 1.5px dashed #d5dfee; border-radius: 8px; margin-top: 8px; line-height: 1.6; }
.shop-side.drag-over { outline: 2px dashed #0580ff; outline-offset: -2px; background: #f0f7ff; }
.shop-side.drag-over .shop-side-hint { border-color: #0580ff; color: #0580ff; background: #eaf4ff; }

/* ===== 表格列表拖拽排序 ===== */
.shop-side-item.dragging { opacity: .45; }
.shop-side-item.drop-mark { box-shadow: inset 0 2px 0 #0580ff; background: #eef6ff; }
.shop-side-item[draggable="true"] { cursor: grab; }
.shop-side-item[draggable="true"]:active { cursor: grabbing; }

/* 标签栏图标尺寸 */
.doc-tab svg { width: 14px; height: 14px; flex-shrink: 0; }

/* 侧栏表格图标防压缩（长名称挤没图标的问题） */
.shop-side-item svg { flex-shrink: 0; }
.shop-side-item > span:first-child { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ===== 人事左侧大类树 ===== */
.hr-tree { width: 185px; flex-shrink: 0; background: #fff; border: 1px solid #e5eaf3; border-radius: 10px; padding: 8px; box-shadow: var(--shadow); position: sticky; top: 12px; max-height: calc(100vh - 120px); overflow-y: auto; }
.hr-tree-group { display: flex; align-items: center; gap: 6px; padding: 8px 10px; font-size: 13.5px; font-weight: 600; color: #1e2b4d; cursor: pointer; border-radius: 7px; user-select: none; }
.hr-tree-group:hover { background: #f0f6ff; }
.hr-tree-group.cur { color: #0580ff; }
.hr-tree-arrow { font-size: 11px; color: #8a97b0; width: 12px; }
.hr-tree-n { margin-left: auto; font-size: 11px; color: #9aa7bc; background: #f0f3f9; border-radius: 8px; padding: 1px 7px; font-weight: 400; }
.hr-tree-items { padding: 2px 0 6px 0; }
.hr-tree-item { padding: 7px 10px 7px 28px; font-size: 13px; color: #4a5b7c; cursor: pointer; border-radius: 7px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.hr-tree-item:hover { background: #f0f6ff; color: #0580ff; }
.hr-tree-item.active { background: #e6f2ff; color: #0580ff; font-weight: 600; }
.hr-tree-direct { padding-left: 12px; font-weight: 600; color: #1e2b4d; }

/* ===== 浮层手风琴（大类纵向 + 子类折叠） ===== */
.jst-flyout-acc { min-width: 210px; padding: 6px; }
.fly-acc-g { display: flex; align-items: center; gap: 7px; padding: 8px 10px; font-weight: 600; font-size: 13px; color: #1e2b4d; cursor: pointer; border-radius: 7px; user-select: none; }
.fly-acc-g:hover { background: #f0f6ff; color: #0580ff; }
.fly-acc-g.open { color: #0580ff; }
.fly-acc-arrow { font-size: 11px; color: #8a97b0; width: 12px; flex-shrink: 0; }
.fly-acc-items { padding: 2px 0 6px 14px; }

/* 列头排序小按钮（聚水潭同款：上下小三角，点击切换升序/降序，当前方向高亮蓝色） */
.th-sort { display: inline-flex; flex-direction: column; justify-content: center; margin-left: 4px; vertical-align: middle; cursor: pointer; padding: 2px 1px; border-radius: 3px; }
.th-sort:hover { background: rgba(5,128,255,.08); }
.th-sort i { width: 0; height: 0; border-left: 4px solid transparent; border-right: 4px solid transparent; display: block; }
.th-sort .sa { border-bottom: 5px solid #c3cddd; margin-bottom: 2px; }
.th-sort .sb { border-top: 5px solid #c3cddd; }
.th-sort[data-dir="asc"] .sa { border-bottom-color: #0580ff; }
.th-sort[data-dir="desc"] .sb { border-top-color: #0580ff; }

/* WPS 编辑器加载遮罩 + 旋转指示器 */
#wpsGrid .spinner { display:inline-block; }
@keyframes spin { to { transform: rotate(360deg); } }

/* 订单弹窗-产品库选择器浮层（z-index 高于 modal-mask 200，低于 toast 300） */
.so-pick-mask { position: fixed; inset: 0; background: rgba(0,0,0,.45); z-index: 250; display: flex; align-items: center; justify-content: center; }
.so-pick-box { background: #fff; width: 680px; max-width: 94vw; max-height: 86vh; border-radius: 10px; display: flex; flex-direction: column; overflow: hidden; box-shadow: 0 12px 40px rgba(0,0,0,.25); }
.so-pick-row { display: flex; align-items: center; gap: 10px; padding: 8px 14px; border-bottom: 1px solid #f0f2f5; cursor: pointer; font-size: 12.5px; }
.so-pick-row:hover { background: #f6f9ff; }
.so-pick-row.on { background: #e6f4ff; }

/* 宽屏弹窗（销售订单等多列明细表单，减少滚动） */
.modal.modal-lg { width: 1060px; max-width: 96vw; max-height: 94vh; }
.modal-lg .modal-body { max-height: calc(94vh - 150px); }
