* { box-sizing: border-box; }
/* 设计基调：页面与内容块统一纯白；分层只用留白、1px 极淡分隔线、字重，不用投影 */
body { margin:0; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif; background:#fff; color:#1f2937; font-size:14px; line-height:1.5; -webkit-font-smoothing:antialiased; }
.layout { display:flex; min-height:100vh; }
.sidebar { width:200px; background:#fff; color:#374151; padding:18px 12px 16px; border-right:1px solid #eef0f3; flex-shrink:0; display: flex; flex-direction: column; }
.sidebar h1 { font-size:16px; margin:0 0 18px; padding:0 8px; color:#111827; letter-spacing:.2px; }
.sidebar nav { flex: 1; }
.sidebar nav a { display:block; padding:9px 12px; color:#4b5563; text-decoration:none; border-radius:8px; cursor:pointer; margin-bottom:2px; }
.sidebar nav a:hover { background:#f4f6f9; color:#1f2937; }
.sidebar nav a.active { background:#eff6ff; color:#1d4ed8; font-weight:600; }
.sidebar nav a.active:hover { background:#e8f1ff; color:#1d4ed8; }
.user-info { padding:14px 8px 0; border-top: 1px solid #f0f2f5; font-size: 13px; color: #9ca3af; }
.user-info button { margin-top: 10px; width: 100%; padding: 0 6px; background:#fef2f2; color:#dc2626; border:1px solid #fbe1e1; border-radius: 8px; cursor: pointer; }
.user-info button:hover { background:#fee2e2; }
.user-info button.pwd-btn { background:#eff6ff; color:#1d4ed8; border-color:#dbeafe; }
.user-info button.pwd-btn:hover { background:#e0ecff; }

.content { flex:1; padding:0; overflow:hidden; display:flex; flex-direction:column; background:#fff; }
.tab-body { flex:1; padding:20px 24px 24px; overflow:auto; background:#fff; }
/* 顶部页面标签：与侧边栏同为白底，浅色底表示选中，不再用粗边框勾边 */
.pagetabs { flex:none; display:flex; align-items:center; flex-wrap:wrap; gap:4px; padding:10px 20px 8px; background:#fff; border-bottom:1px solid #eef0f3; }
.ptab { display:inline-flex; align-items:center; gap:7px; max-width:200px; padding:7px 10px; font-size:13px; color:#6b7280; background:transparent; border:none; border-radius:8px; cursor:pointer; user-select:none; }
.ptab:hover { background:#f4f6f9; color:#1f2937; }
.ptab.on { background:#eff6ff; color:#1d4ed8; font-weight:600; }
.ptab-name { overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.ptab-x { font-style:normal; width:16px; height:16px; line-height:14px; text-align:center; border-radius:50%; color:#9ca3af; font-size:14px; }
.ptab-x:hover { background:#e7ebf0; color:#1f2937; }
.ptab.locked .ptab-name { margin-right:2px; }
.tab { display:none; }
.tab.active { display:block; }
h2 { margin:0 0 16px; font-size:20px; font-weight:600; color:#111827; letter-spacing:.2px; }
.row-form { display:flex; gap:8px; flex-wrap:wrap; margin-bottom:12px; align-items:center; }
.row-form input, .row-form select { min-width:120px; }
/* 工具条 / 面板卡片：统一白底、1px 极淡边框、10px 圆角、无投影 */
.toolbar, .panel-card { background:#fff; border:1px solid #eef0f3; border-radius:10px; }
.toolbar { padding:12px 14px; margin-bottom:16px; }
/* 工具条统一排版：筛选控件一组、操作按钮一组；按钮组紧接着筛选控件排，放不下就整组换行，统一左对齐、不用左右两拨 */
.row-form.tb-split { gap:8px 10px; }
.tb-filters { display:flex; flex-wrap:wrap; align-items:center; gap:8px; flex:0 1 auto; min-width:0; }
.tb-actions { display:flex; flex-wrap:wrap; align-items:center; justify-content:flex-start; gap:8px; flex:0 1 auto; min-width:0; margin-left:0; }
.tb-actions > * { flex:none; }
.tb-actions .colset { margin:0; }
.toolbar-note { font-size:12px; color:#9ca3af; margin:-8px 0 10px; padding-left:2px; }
/* 工具栏下方说明行：计数 + 说明（省略号 + title 看全文）+ 右侧红色预警 */
.tb-note-line { display:flex; align-items:center; gap:8px; white-space:nowrap; overflow:hidden; }
.tb-note-line > span { flex:none; }
.tb-note-line .tb-note-txt { flex:1 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; }
.tb-note-line .tb-note-sep { color:#d1d5db; }
.tb-note-line .tb-note-warn { flex:0 1 auto; min-width:0; overflow:hidden; text-overflow:ellipsis; color:#dc2626; }
/* 紧凑工具条（库存管理 / 供货核算待结）：控件收窄、按钮紧凑，1024 宽也保持一行 */
.row-form.tb-compact { flex-wrap:nowrap; gap:8px; }
.tb-compact .tb-filters { flex:0 1 auto; flex-wrap:nowrap; min-width:auto; gap:5px; }
.tb-compact .tb-actions { flex:0 0 auto; flex-wrap:nowrap; gap:5px; }
/* 库存主工具条：按钮等分吃掉行内剩余宽度，宽屏右侧不再空一大截 */
#tab-stock .tb-compact .tb-actions { flex:1 1 auto; min-width:0; }
#tab-stock .tb-compact .tb-actions > button { flex:1 1 auto; min-width:min-content; }
.tb-compact button, .tb-compact .colset-btn { padding:0 2px; font-size:13px; white-space:nowrap; }
.tb-compact .help-tip { margin-left:0; }
#stockShopDropdown .anchor { white-space:nowrap; }
#tab-stock .tb-compact .tb-filters { flex:0 1 auto; }
/* ---- 工具条按钮层次（库存 / 库存价值 / 供货待结 统一） ---- */
#tab-stock .tb-compact .tb-actions button#btnImgSearch,
#tab-stock_value .tb-compact .tb-actions button#btnImgSearchVal { background:#eef4ff; border:1px solid #cfe0ff; color:#2563eb; box-shadow:none; }
#tab-stock .tb-compact .tb-actions button#btnImgSearch:hover,
#tab-stock_value .tb-compact .tb-actions button#btnImgSearchVal:hover { background:#e2edff; }
#tab-stock .tb-compact .tb-actions button.b-add[onclick="showAddStock()"],
#tab-stock .tb-compact .tb-actions button.b-export[onclick="importStock()"],
#tab-stock_value .tb-compact .tb-actions button#btnInboundMode { background:#e6f6ee; border:1px solid #a7e3c6; color:#047857; box-shadow:none; }
#tab-stock .tb-compact .tb-actions button.b-add[onclick="showAddStock()"]:hover:not(:disabled),
#tab-stock .tb-compact .tb-actions button.b-export[onclick="importStock()"]:hover:not(:disabled),
#tab-stock_value .tb-compact .tb-actions button#btnInboundMode:hover { background:#d2f1e1; border-color:#a7ddc3; }
#tab-stock .tb-compact .tb-actions button#btnDelStock:not(:disabled) { background:#fef2f2; border:1px solid #fecaca; color:#dc2626; }
#tab-stock .tb-compact .tb-actions button#btnDelStock:not(:disabled):hover { background:#fee2e2; border-color:#fca5a5; }
/* 删除未勾选：与可用态完全同色，只靠不可点区分 */
#tab-stock .tb-compact .tb-actions button#btnDelStock:disabled { background:#fef2f2 !important; color:#dc2626 !important; border-color:#fecaca !important; opacity:1 !important; box-shadow:none; }
#sv-pending .tb-compact .tb-actions button#spSettleBtn:not(:disabled) { background:#ea580c; border:1px solid #ea580c; color:#fff; box-shadow:none; }
#sv-pending .tb-compact .tb-actions button#spSettleBtn:not(:disabled):hover { background:#d9480a; border-color:#d9480a; }
/* 确认结算：两态同为实心橙，未勾选只体现在不可点 */
#sv-pending .tb-compact .tb-actions button#spSettleBtn:disabled { background:#ea580c !important; color:#fff !important; border-color:#ea580c !important; opacity:1 !important; box-shadow:none; }
/* 导出类：浅紫底 + 紫字（导出库存 / 下载模板 / 盘点报告 / 导出待结明细） */
#tab-stock .tb-compact .tb-actions button#btnExportStock,
#tab-stock .tb-compact .tb-actions button.b-tpl[onclick="genStockTemplate()"],
#tab-stock .tb-compact .tb-actions button#reportCheckBtn,
#sv-pending .tb-compact .tb-actions button.b-export[onclick="exportSupplyPending()"] { background:#f4f1ff; border:1px solid #ded5fa; color:#6d28d9; box-shadow:none; }
#tab-stock .tb-compact .tb-actions button#btnExportStock:hover,
#tab-stock .tb-compact .tb-actions button.b-tpl[onclick="genStockTemplate()"]:hover:not(:disabled),
#tab-stock .tb-compact .tb-actions button#reportCheckBtn:hover,
#sv-pending .tb-compact .tb-actions button.b-export[onclick="exportSupplyPending()"]:hover:not(:disabled) { background:#eae3ff; border-color:#cbbcf7; }
/* 核对/调整类：浅橙底 + 橙字（库存对账 / 库存修正） */
#tab-stock .tb-compact .tb-actions button#btnReconcile,
#tab-stock .tb-compact .tb-actions button#btnTotalFix { background:#fff7ed; border:1px solid #fbdfc0; color:#c2410c; box-shadow:none; }
#tab-stock .tb-compact .tb-actions button#btnReconcile:hover,
#tab-stock .tb-compact .tb-actions button#btnTotalFix:hover { background:#ffedda; border-color:#f7c99a; }
/* 模式切换：浅青绿底（盘点模式），开启后加深一档 */
#tab-stock .tb-compact .tb-actions button#checkModeBtn { background:#e2f5f1; border:1px solid #bfe6df; color:#0f766e; box-shadow:none; }
#tab-stock .tb-compact .tb-actions button#checkModeBtn:hover { background:#cfeee8; border-color:#9ed9cd; }
#tab-stock .tb-compact .tb-actions button#checkModeBtn.is-mode { background:#c4e9e2; border-color:#8fd3c5; color:#0f766e; }
#tab-stock .tb-compact .tb-actions button#btnReconcile.is-mode { background:#ffe3c4; border-color:#f5bd88; color:#b45309; }
/* 禁用态统一降透明度 */
#tab-stock .tb-compact .tb-actions button:disabled:not(.b-danger),
#tab-stock_value .tb-compact .tb-actions button:disabled:not(.b-danger),
#sv-pending .tb-compact .tb-actions button:disabled:not(.b-danger) { opacity:.55 !important; }
#tab-stock .tb-compact #searchKw { flex:1 1 160px; min-width:150px; max-width:160px; width:auto; font-size:13px; }
#stockCatDropdown { max-width:64px; }
#stockShopDropdown { max-width:92px; }
/* 1081~1200：内容区还不够放完整尺寸，统一收到 12px，但仍留出呼吸空间，搜索框吃满剩余宽度 */
@media (max-width:1200px) and (min-width:1081px) {
  .tab-body { padding-left:16px; padding-right:16px; }
  #tab-stock .tb-compact #searchKw { flex:1 1 90px; min-width:80px; max-width:150px; }
  #stockCatDropdown { max-width:56px; }
  #stockCatDropdown .anchor, #tab-stock .tb-compact #stockShopDropdown .anchor { min-width:0; padding:0 16px 0 6px; font-size:12px; }
  #tab-stock .tb-compact #stockShopDropdown { max-width:88px; }
  .tb-compact button, .tb-compact .colset-btn { padding:0 2px; font-size:12px; }
  .tb-compact .tb-actions { gap:3px; }
  .tb-compact .tb-filters { gap:3px; }
}
/* ≤1080：真正窄的宽度才用超紧凑规则，保证 11 个按钮一行排完不换行 */
@media (max-width:1080px) {
  .tab-body { padding-left:16px; padding-right:16px; }
  #tab-stock .tb-compact { padding-left:1px; padding-right:1px; }
  #tab-stock .tb-compact #searchKw { flex:0 0 76px; width:76px; min-width:0; }
  #stockCatDropdown { max-width:48px; }
  #stockCatDropdown .anchor, #tab-stock .tb-compact #stockShopDropdown .anchor { min-width:0; padding:0 16px 0 6px; font-size:12px; }
  #tab-stock .tb-compact #stockShopDropdown { max-width:82px; }
  .tb-compact button, .tb-compact .colset-btn { padding:0 1px; font-size:12px; }
  .tb-compact .tb-actions { gap:2px; }
  .tb-compact .tb-filters { gap:2px; }
}
/* ≥1500：空间够时放开按钮内边距与间距，右侧空白由库存按钮等分吸收 */
@media (min-width:1500px) {
  .tb-compact .tb-filters { gap:8px; }
  .tb-compact .tb-actions { gap:8px; }
  .tb-compact button, .tb-compact .colset-btn { padding:0 9px; }
  #tab-stock .tb-compact #searchKw { flex:0 0 180px; width:180px; min-width:0; max-width:180px; }
  #stockCatDropdown { max-width:66px; }
  #stockShopDropdown { max-width:94px; }
  #valKw { width:190px; }
}
/* ≥1700：大屏给到 13px 内边距、9px 间距 */
@media (min-width:1700px) {
  .tb-compact .tb-filters { gap:9px; }
  .tb-compact .tb-actions { gap:9px; }
  .tb-compact button, .tb-compact .colset-btn { padding:0 13px; }
  #tab-stock .tb-compact #searchKw { flex:0 0 210px; width:210px; min-width:0; max-width:210px; }
  #stockCatDropdown { max-width:72px; }
  #stockShopDropdown { max-width:100px; }
  #valKw { width:210px; }
}
/* 结算记录 / 商品供货设置：窄屏收掉长说明、缩短输入框，避免工具条折行 */
@media (max-width:1200px) {
  #sv-bills .tb-filters > .muted, #sv-settings .tb-filters > .muted, #sv-settings .tb-filters .help-tip { display:none; }
  #sv-bills #sbKw { width:200px !important; }
  #sv-bills #sbMonth { width:120px !important; }
  #sv-settings #ssKw { width:200px !important; }
  #sv-settings #ssMode { width:120px !important; }
  #sv-bills .tb-filters, #sv-settings .tb-filters { gap:4px; }
}
/* ≤1080：供货设置三条筛选 + 三个按钮压到一行 */
@media (max-width:1080px) {
  #sv-settings #ssKw { width:150px !important; }
  #sv-settings #ssMode { width:104px !important; }
  #sv-settings .tb-filters .anchor { min-width:0; padding:0 16px 0 6px; font-size:12px; }
  #sv-settings .tb-actions button { padding:0 8px; font-size:13px; }
  #sv-settings .tb-split { gap:6px; }
}
/* 库存/供货工具条配色：只有「查询」是主色，其余白底深灰字；删除红字；模式按钮浅蓝强调 */
#tab-stock .tb-compact .tb-actions button:not(.b-query),
#tab-stock .tb-compact .tb-actions .colset-btn,
#tab-stock_value .tb-compact .tb-actions button:not(.b-query),
#tab-stock_value .tb-compact .tb-actions .colset-btn,
#sv-pending .tb-compact .tb-actions button:not(.b-query),
#sv-pending .tb-compact .tb-actions .colset-btn { background:#fff; color:#374151; border:1px solid #d8dee9; box-shadow:none; }
#tab-stock .tb-compact .tb-actions button:not(.b-query):hover:not(:disabled),
#tab-stock_value .tb-compact .tb-actions button:not(.b-query):hover:not(:disabled),
#sv-pending .tb-compact .tb-actions button:not(.b-query):hover:not(:disabled) { background:#f5f7fa; }
#tab-stock .tb-compact .tb-actions button:disabled,
#tab-stock_value .tb-compact .tb-actions button:disabled,
#sv-pending .tb-compact .tb-actions button:disabled { color:#b9c0cc; border-color:#e5e9f0; background:#fafbfc; }
#tab-stock .tb-compact .tb-actions button.b-danger { color:#dc2626; border-color:#f0d5d5; }
#tab-stock .tb-compact .tb-actions button.is-mode,
#tab-stock_value .tb-compact .tb-actions button.is-mode { background:#eef4ff; border-color:#c9dcff; color:#1d4ed8; }
#valKw { min-width:160px; }
/* 盘点模式下收起与盘点无关的入口，保证一行放得下「盘点报告/清除标记」 */
#tab-stock .tb-compact.checking .tb-actions [data-stock-normal] { display:none; }
/* 店铺多选下拉：全选/清空 + 勾选列表 + 确定 */
#stockShopDropdown { max-width:92px; }
#stockShopAnchor.on { color:#1d4ed8; font-weight:600; }
#stockShopItems { min-width: 300px; max-height: 360px; }
.panel-card { padding:18px 20px; }
/* 控件高度全站统一：主工具行 36px（按钮/输入框/下拉/多选框/日期），分页行与表格行内小按钮 30px，行内编辑输入框 28px */
button, input:not([type=checkbox]):not([type=radio]):not([type=file]):not(.edit-sku-input), select { height:36px; box-sizing:border-box; }
/* 控件统一 8px 圆角、极淡边框；输入框聚焦只加浅蓝边与浅色描边，不做重投影 */
button { padding:0 14px; border:1px solid #e4e7ec; border-radius:8px; background:#fff; color:#374151; cursor:pointer; font-size:14px; display:inline-flex; align-items:center; justify-content:center; line-height:1; transition:background .15s, border-color .15s, color .15s; }
input:not([type=checkbox]):not([type=radio]):not([type=file]):not(.edit-sku-input), select { padding:0 10px; border:1px solid #e4e7ec; border-radius:8px; background:#fff; color:#374151; font-size:14px; outline:none; transition:border-color .15s, box-shadow .15s; }
input:not([type=checkbox]):not([type=radio]):not([type=file]):not(.edit-sku-input):focus, select:focus { border-color:#bfdbfe; box-shadow:0 0 0 3px rgba(37,99,235,.08); }
tbody button, .pager button, .pager select, .map-table select, .user-info button { height:30px; }
tbody button { padding:0 10px; font-size:13px; }
.edit-sku-input { height:28px; padding:0 6px; border:1px solid #e4e7ec; border-radius:6px; }
button:hover { background:#f7f8fa; border-color:#d8dde5; }
/* 可用态一律带一圈同色边框；禁用态褪成灰底灰字、边框一起褪掉，不再靠"变淡"区分 */
button:disabled { cursor:not-allowed !important; pointer-events:none !important; opacity:1 !important; background:#f3f4f6 !important; color:#9ca3af !important; border-color:#f3f4f6 !important; }
/* 全局按钮按功能分色：主操作实心蓝 / 录入绿 / 导出紫 / 执行调整橙 / 删除红 / 状态青 / 中性白 */
.b-query { background:#2563eb; color:#fff; border:1px solid #2563eb; }
.b-query:hover { background:#1d4ed8; border-color:#1d4ed8; }
.b-action { background:#fff7ed; color:#c2410c; border:1px solid #fbdfc0; }
.b-action:hover:not(:disabled) { background:#ffedda; border-color:#f7c99a; }
.b-action:disabled { background:#fff7ed !important; color:#c2410c !important; border-color:#fbdfc0 !important; opacity:1 !important; }
/* 确认入库：与「库存入库」同色系，禁用只体现在不可点 */
#btnInbound { background:#e6f6ee; color:#047857; border:1px solid #a7e3c6; }
#btnInbound:hover:not(:disabled) { background:#d2f1e1; border-color:#a7ddc3; }
#btnInbound:disabled { background:#e6f6ee !important; color:#047857 !important; border-color:#a7e3c6 !important; opacity:1 !important; }
.b-add { background:#e6f6ee; color:#047857; border:1px solid #a7e3c6; }
.b-add:hover:not(:disabled) { background:#d2f1e1; border-color:#a7ddc3; }
.b-add:disabled { background:#e6f6ee !important; color:#047857 !important; border-color:#a7e3c6 !important; opacity:1 !important; }
.b-tpl { background:#f4f1ff; color:#6d28d9; border:1px solid #ded5fa; }
.b-tpl:hover { background:#eae3ff; border-color:#cbbcf7; }
.b-export { background:#f4f1ff; color:#6d28d9; border:1px solid #ded5fa; }
.b-export:hover { background:#eae3ff; border-color:#cbbcf7; }
.b-danger { background:#fef2f2; color:#dc2626; border:1px solid #fecaca; }
.b-danger:hover:not(:disabled) { background:#fee2e2; border-color:#fca5a5; }
.b-danger:disabled { background:#fef2f2 !important; color:#dc2626 !important; border-color:#fecaca !important; opacity:1 !important; }
.b-state { background:#e2f5f1; color:#0f766e; border:1px solid #bfe6df; }
.b-state:hover { background:#cfeee8; border-color:#9ed9cd; }
/* 选中态：同色系加深一档，不加粗边框 */
.b-state.on { background:#c4e9e2; color:#0f766e; border-color:#8fd3c5; }
.b-state.on:hover { background:#b5e3da; border-color:#7cc7b7; }
/* 订单页功能分色：青（库存/发货动作）、浅青（已扣标记）、靛蓝（状态动作） */
.b-cyan { background:#e3f6f8; color:#0e7490; border:1px solid #bfe4ec; }
.b-cyan:hover:not(:disabled) { background:#d2eef3; border-color:#a8d8e4; }
.b-cyan:disabled { background:#e3f6f8 !important; color:#0e7490 !important; border-color:#bfe4ec !important; opacity:1 !important; }
.b-cyan-l { background:#f0fafc; color:#0e7490; border:1px solid #d5ecf3; }
.b-cyan-l:hover:not(:disabled) { background:#e2f4f8; border-color:#bfe0ea; }
.b-cyan-l:disabled { background:#f0fafc !important; color:#0e7490 !important; border-color:#d5ecf3 !important; opacity:1 !important; }
.b-indigo { background:#eef2ff; color:#4338ca; border:1px solid #d6dcfb; }
.b-indigo:hover:not(:disabled) { background:#e2e9ff; border-color:#c3cdf8; }
.b-indigo:disabled { background:#eef2ff !important; color:#4338ca !important; border-color:#d6dcfb !important; opacity:1 !important; }
.b-danger-strong { background:#fee2e2; color:#b91c1c; border:1px solid #fca5a5; }
.b-danger-strong:hover:not(:disabled) { background:#fecaca; border-color:#f87171; }
.b-danger-strong:disabled { background:#fee2e2 !important; color:#b91c1c !important; border-color:#fca5a5 !important; opacity:1 !important; }
/* 查看/信息类：浅蓝 */
.b-info { background:#eef4ff; color:#2563eb; border:1px solid #cfdefb; }
.b-info:hover:not(:disabled) { background:#e2edff; border-color:#bfd3f9; }
.b-info:disabled { background:#eef4ff !important; color:#2563eb !important; border-color:#cfdefb !important; opacity:1 !important; }
.b-plain { background:#fff; color:#4b5563; border:1px solid #e4e7ec; }
.b-plain:hover { background:#f7f8fa; border-color:#d8dde5; }
/* 行内「设置」类小按钮：浅蓝系，尺寸沿用行内 30px */
tbody .b-set { background:#eef4ff; color:#2563eb; border:1px solid #cfdefb; }
tbody .b-set:hover { background:#e2edff; border-color:#bfd3f9; }
/* 订单状态列：点击直接改，平时像文字，悬停才显出下拉感 */
.status-select { height:28px; max-width:150px; padding:0 22px 0 8px; border:1px solid transparent; border-radius:6px; background:transparent; color:#374151; font-size:13px; cursor:pointer; }
.status-select:hover { border-color:#d8dde5; background:#fff; }
.status-select:focus { border-color:#2563eb; box-shadow:0 0 0 3px rgba(37,99,235,.10); }
.status-select.is-bad { color:#b91c1c; font-weight:600; }
#batchStatusSel { min-width:132px; font-size:13px; }

/* 下拉统一组件 */
.dropdown-check-list { display: inline-block; position: relative; vertical-align: middle; }
.dropdown-check-list .anchor { position:relative; padding: 0 26px 0 10px; height: 36px; line-height: 34px; border: 1px solid #e4e7ec; border-radius: 8px; background: #fff; cursor: pointer; user-select: none; display: block; min-width: 70px; font-size: 13px; color: #374151; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.dropdown-check-list .anchor::after { content:''; position:absolute; right:11px; top:50%; width:6px; height:6px; border-right:1.5px solid #9ca3af; border-bottom:1.5px solid #9ca3af; transform:translateY(-70%) rotate(45deg); }
.dropdown-check-list .anchor:hover { border-color:#d8dde5; background:#fcfcfd; }
.dropdown-check-list .items { display: none; position: absolute; top: 100%; left: 0; margin-top: 6px; background: #fff; border: 1px solid #eef0f3; padding: 10px 12px 12px; z-index: 100; max-height: 360px; overflow-y: auto; border-radius: 12px; box-shadow: 0 10px 30px rgba(15,23,42,.12); min-width: 260px; width: max-content; max-width: min(520px, calc(100vw - 16px)); }
.dropdown-check-list .items div { padding: 0; height: 36px; display: flex; align-items: center; }
.dropdown-check-list .items label { display: flex; align-items: center; justify-content: flex-start; gap: 10px; width: 100%; height: 36px; padding: 0 8px; margin: 0; cursor: pointer; font-size: 13px; color: #374151; border-radius: 8px; white-space: nowrap; }
.dropdown-check-list .items label:hover { background-color: #f4f6f9; }
/* 多选下拉内部复选框：写死尺寸，避免被 .cr-row input 等全局弹性规则拉成竖条 */
.dropdown-check-list .items input[type="checkbox"] {
    flex: 0 0 14px !important;
    width: 14px !important; height: 14px !important;
    min-width: 14px !important; max-width: 14px !important;
    min-height: 14px !important; max-height: 14px !important;
    padding: 0 !important; margin: 0 !important; border: 0 !important;
    box-sizing: border-box !important;
    appearance: auto !important; -webkit-appearance: auto !important;
    accent-color: #2563eb !important;
    cursor: pointer;
}
.dropdown-check-list .items span { flex: 0 1 auto; min-width: 0; text-align: left; white-space: nowrap; overflow: visible; text-overflow: clip; }
.dropdown-check-list .items .confirm-btn { display: flex; gap: 8px; height: auto; margin-top: 8px; padding: 10px 0 0; border-top: 1px solid #eef1f6; }
.dropdown-check-list .items .confirm-btn button { flex: 1 1 0; width: auto; min-width: 64px; padding: 0 14px; font-size: 13px; height: 32px; border-radius: 8px; }
.dropdown-check-list .items .confirm-btn button.on { background: #eef4ff; border-color: #c7dbff; color: #1d4ed8; }
.dropdown-check-list.visible .items { display: block; }
.dropdown-check-list .items.fixed-position { position: fixed !important; margin-top: 0 !important; z-index: 99999 !important; display: block !important; }
.group-title { padding:4px 8px; font-size:12px; color:#9ca3af; font-weight:bold; }
/* 面板里"每行内边距清零"那条会连分组标题一起抹掉，这里补回缩进，让标题左边缘跟复选框对齐 */
.dropdown-check-list .items .group-title { padding:4px 0 4px 6px; height:auto; }

/* 供货设置：多供应商每行的"默认供应商"单选，同样写死尺寸，避免被 .cr-row input 拉伸 */
.ss-def { display:flex; align-items:center; gap:5px; flex:0 0 auto; font-size:12px; color:#4b5563; cursor:pointer; white-space:nowrap; }
.ss-def input[type="radio"] {
    flex: 0 0 14px !important;
    width: 14px !important; height: 14px !important;
    min-width: 14px !important; max-width: 14px !important;
    min-height: 14px !important; max-height: 14px !important;
    padding: 0 !important; margin: 0 !important; border: 0 !important;
    box-sizing: border-box !important;
    appearance: auto !important; -webkit-appearance: auto !important;
    accent-color: #2563eb !important;
    cursor: pointer;
}
.ss-hint { margin:0 0 6px 0; font-size:12px; line-height:1.6; color:#6b7280; }

/* 表格基础：白底、10px 圆角、1px 极淡外框，无投影；分层只靠表头浅灰与细分隔线 */
.table-container { width:100%; max-height: calc(100vh - 320px); overflow-y:auto; overflow-x:auto; background:#fff; border:1px solid #eef0f3; border-radius:10px; margin-bottom:16px; }
table { width:100%; border-collapse: separate; border-spacing: 0; }
th { position: sticky; top: 0; background-color: #fafbfc !important; z-index: 20; font-weight: 600; font-size:13px; color:#667085; text-align: left; padding:10px 14px; border-bottom: 1px solid #eceef1; vertical-align: middle; height: 44px; }
td { padding:11px 14px; border-bottom:1px solid #f2f4f7; font-size:14px; color:#374151; vertical-align:middle; background-color: #fff; font-variant-numeric: tabular-nums; }
tbody tr:last-child td { border-bottom:0; }
input[type="checkbox"] { width: 16px; height: 16px; cursor: pointer; margin: 0; vertical-align: middle; accent-color: #2563eb; }
tbody tr:hover td { background-color: #fafbfc; }
/* 全站统一的表头排序：点列名切换正序/反序 */
th[data-sort] { cursor: pointer; }
th[data-sort]:hover { background-color:#f4f6f9 !important; }
/* 表头右边缘拖拽改列宽：热区不占位，避免影响排序点击与表格宽度 */
.col-resizer { position:absolute; top:0; right:0; width:9px; height:100%; cursor:col-resize; z-index:3; touch-action:none; }
.col-resizer:hover, .col-resizer:active { background:rgba(37,99,235,.28); }
/* 拖列宽时只切换光标；拖动期间由 JS 临时拦截 selectstart，松开立即恢复，平时全站文字可选 */
body.col-resizing, body.col-resizing * { cursor:col-resize !important; }
.sort-mark { color:#9ca3af; font-size:12px; font-weight:normal; }
/* 提成三表表头排序：可点提示 + 当前方向箭头（未排序不显示箭头） */
th[data-csort] { cursor:pointer; }
th[data-csort]:hover { background:#eef2f7; }
.csort-mark { display:inline-block; min-width:11px; margin-left:3px; color:#2563eb; font-size:12px; font-weight:600; }
#orderTable tbody tr, #valTable tbody tr, #logTable tbody tr, #dashTable tbody tr, #stockTable tbody tr { content-visibility: auto; contain-intrinsic-size: 0 46px; }

/* 统一分页：紧贴表格下沿，与表格同宽、同一白底，只靠一条细线分隔 */
.pager { display:flex; align-items:center; gap:8px; padding:10px 14px; margin:0 0 16px; flex-wrap: wrap; background:#fff; border:1px solid #eef0f3; border-top:1px solid #f0f2f5; border-radius:10px; }
.pager:empty { display:none; }
/* 表格后紧跟分页时，两者拼成一张卡片：上圆角留给表格，下圆角留给分页 */
.table-container:has(+ .pager:not(:empty)) { border-bottom:0; border-radius:10px 10px 0 0; margin-bottom:0; }
.table-container + .pager:not(:empty) { border-radius:0 0 10px 10px; }
.pager button { padding: 0 12px; }
.pager select { padding: 0 8px; border:1px solid #e4e7ec; border-radius:8px; background:#fff; }
.pager .page-info { color:#6b7280; font-size:13px; }

/* 状态与文字色 */
.muted { color:#9ca3af; font-size:12px; }
.num-red { color:#dc2626; font-weight:bold; }
.status-bad { color:#dc2626; font-weight:bold; }
.deducted { color:#16a34a; font-weight:bold; }
.req { color:#dc2626; font-weight:bold; }
.tag-ok { color:#16a34a; font-size:12px; margin-left:6px; }
.req-hint { font-size:11px; color:#dc2626; margin-top:2px; }

/* 行状态 */
.order-row-invalid td { color: #b0b0b0 !important; }
.row-checked td { background-color:#f0fdf4; }

/* 库存表专用：列宽统一用百分比，1280 首屏不出现横向滚动，窄屏在容器内横滚 */
#stockTable { table-layout: fixed; width: 100%; min-width: 900px; }
#stockTable th, #stockTable td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#stockTable tbody td img { display: block; width: 40px; height: 40px; object-fit: contain; background: #fafbfc; border-radius: 6px; margin: 0 auto; }
#stockTable .col-cb { width: 5%; text-align: center; }
#stockTable .col-img { width: 8%; text-align: center !important; }
#stockTable .col-sku { width: 11%; text-align: center; }
#stockTable .col-name { width: 25%; text-align: center; }
#stockTable .col-cat { width: 9%; text-align: center; }
#stockTable .col-qty { width: 9%; text-align: center; }
#stockTable .col-shop { width: 15%; text-align: center; }
#stockTable .col-price { width: 9%; text-align: center; }
#stockTable .col-check { width: 9%; text-align: center; }
/* 窄屏（如 960）在页面内收缩，不出现横向滚动；表头允许换行，图片列保证 40px 不被裁 */
@media (max-width: 1100px) {
    #stockTable { min-width: 0; }
    #stockTable th, #stockTable td { white-space: normal; word-break: break-word; line-height: 1.25; padding-left: 8px; padding-right: 8px; }
    #stockTable td { white-space: nowrap; }
    #stockTable .col-cb { width: 44px; }
    #stockTable .col-img { width: 64px; }
}

/* 库存价值：最左商品小图与库存页同一尺寸，懒加载，没图给占位 */
#valTable .col-img { width:60px; min-width:60px; text-align:center !important; }
#valTable tbody td.col-img img { display:block; width:40px; height:40px; object-fit:contain; background:#fafbfc; border-radius:6px; margin:0 auto; }
#valTable .col-img .img-none { white-space:nowrap; }

/* 待结明细：图片列收窄一点，不挤压供应商/商品列 */
#supplyPendingTable .col-img { width:56px; min-width:56px; padding-left:6px !important; padding-right:6px !important; text-align:center !important; }
#supplyPendingTable tbody td.col-img img { display:block; width:40px; height:40px; object-fit:contain; background:#fafbfc; border-radius:6px; margin:0 auto; }
#supplyPendingTable .col-img .img-none { white-space:nowrap; font-size:12px; }

/* 库存对账表：与库存主列表同一套图片/勾选列，列宽百分比保证 1280 不横滚 */
#recTable { table-layout: fixed; width: 100%; min-width: 900px; }
#recTable th, #recTable td { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
#recTable tbody td img { display: block; width: 40px; height: 40px; object-fit: contain; background: #fafbfc; border-radius: 6px; margin: 0 auto; }
#recTable .col-cb { width: 5%; text-align: center; }
#recTable .col-img { width: 7%; text-align: center !important; }
#recTable .col-sku { width: 11%; text-align: center; }
#recTable .col-name { width: 17%; text-align: center; }
#recTable .col-cat { width: 8%; text-align: center; }
#recTable .col-total, #recTable .col-sold, #recTable .col-theory, #recTable .col-current { width: 8%; text-align: center; }
#recTable .col-diff { width: 5%; text-align: center; }
#recTable .col-status { width: 15%; }
/* 窄屏（960）：表头换行、收窄内边距，图片/勾选列给固定宽度，避免挤压「差异」「核对状态」 */
@media (max-width: 1100px) {
    #recTable { min-width: 0; }
    #recTable th { white-space: normal; word-break: break-word; line-height: 1.25; padding-left: 8px; padding-right: 8px; }
    #recTable .col-cb { width: 44px; }
    #recTable .col-img { width: 60px; }
}

/* 平台、店铺表基础宽度 */
#platformTable .col-cb, #shopTable .col-cb, #orderTable .col-cb, #userTable .col-cb, #valTable .col-cb { width: 50px; min-width: 50px; text-align: center; }
/* 平台店铺：面板按可用宽度换行，平台表不再被挤成竖排；两栏各自按内容高度显示，不互相拉伸 */
.shop-panels { display:flex; gap:20px; flex-wrap:wrap; align-items:flex-start; }
.shop-panels > div { align-self:flex-start; }
/* 面板已经是白底卡片，里面的表格不再套第二层框 */
.shop-panels .table-container { margin-bottom:0; border:0; border-radius:0; }
.shop-panel-platform { flex:1 1 520px; min-width:0; }
.shop-panel-shop { flex:2 1 640px; min-width:0; }
#platformTable, #shopTable { table-layout:fixed; width:100%; }
#platformTable th, #platformTable td, #shopTable th, #shopTable td {
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis;
}
#platformTable .col-cb, #shopTable .col-cb { width:6%; min-width:0; }
#platformTable .col-name { width:18%; min-width:0; }
#shopTable .col-name { width:auto; min-width:0; }
#platformTable .col-status { width:24%; }
#platformTable .col-fields { width:auto; }
#platformTable .edit-sku-input, #shopTable .edit-sku-input { width:100%; }
#platformTable tbody button, #shopTable tbody button { white-space:nowrap; }
#logTable .log-detail { white-space: pre-wrap; word-break: break-all; }

/* 强制隐藏 */
.admin-hidden { display: none !important; }

/* 图片 */
.thumb-box { width:40px; height:40px; margin:0 auto; cursor:zoom-in; overflow:hidden; border-radius:4px; }
#supplySettingTable .sup-img { width:64px; text-align:center !important; }
#supplySettingTable .sup-img img { display:block; width:40px; height:40px; object-fit:contain; background:#fafbfc; border-radius:6px; margin:0 auto; }
/* 总库存修正预览：图片列与供货设置页同宽同尺寸 */
#tfTable { table-layout: fixed; width:100%; }
#tfTable th:nth-child(2) { width:96px; }
#tfTable th:nth-child(4) { width:82px; }
#tfTable th:nth-child(5), #tfTable th:nth-child(6), #tfTable th:nth-child(7) { width:88px; }
#tfTable th:nth-child(8) { width:112px; }
#tfTable th:nth-child(9) { width:72px; }
#tfTable td { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
#tfTable .sup-img { width:70px; text-align:center !important; }
#tfTable .sup-img img { display:block; width:40px; height:40px; object-fit:contain; background:#fafbfc; border-radius:6px; margin:0 auto; }
#tfTable .img-none { white-space:nowrap; }
.img-none { color:#9ca3af; font-size:12px; cursor:pointer; }
.img-hint-red { font-size:12px; color:#dc2626; margin-top:8px; }

/* 只读输入框：底色、文字、边框一起褪成灰，跟禁用按钮一个观感 */
.row-form input.input-readonly { background:#f3f4f6; color:#9ca3af; border-color:#f3f4f6; cursor:not-allowed; }

/* 行内编辑 */
.inline-edit { cursor:pointer; display:inline-block; padding:4px 0; }

/* 模态框通用 */
.check-row { display:flex; align-items:center; gap:8px; cursor:pointer; }
.map-tip { color:#6b7280; font-size:13px; margin-bottom:10px; }
.map-table { width:100%; }
.map-table td { padding:6px 8px; }
.map-table select { width:100%; padding:6px; border:1px solid #e4e7ec; border-radius:8px; }

/* 订单列表编号标注 */
.tip-ok { color:#166534; }
.tip-warn { color:#b45309; }
.tip-bad { color:#dc2626; }

/* 订单编号抽取提示 */
.sku-tip { font-size:12px; line-height:1.4; margin-top:2px; }

/* 看板每日柱状图 */
.dash-chart-card { position:relative; background:#fff; border:1px solid #eef0f3; border-radius:10px; padding:16px 18px; margin-bottom:20px; }
.dash-chart-head { display:flex; justify-content:space-between; align-items:baseline; margin-bottom:12px; }
.dash-chart-title { font-size:15px; font-weight:bold; color:#1f2937; }
.dash-chart-note { font-size:12px; color:#9ca3af; }
.dash-chart { display:flex; align-items:flex-end; gap:2px; height:186px; padding:16px 2px 0; border-bottom:1px solid #e5e7eb; }
.chart-col { flex:1 1 0; height:100%; display:flex; flex-direction:column; cursor:pointer; }
.chart-col.no-jump { cursor:default; }
.chart-col.no-jump:hover .chart-bar { background:#2563eb; }
.chart-plot { flex:1; min-height:0; position:relative; display:flex; align-items:flex-end; justify-content:center; }
.chart-val { position:absolute; left:50%; transform:translateX(-50%); font-size:10px; color:#4b5563; line-height:12px; white-space:nowrap; pointer-events:none; }
.chart-bar { width:100%; max-width:22px; background:#2563eb; border-radius:3px 3px 0 0; min-height:2px; }
.chart-bar.empty { background:#e5e7eb; }
.chart-col:hover .chart-bar { background:#1d4ed8; }
.chart-day { font-size:11px; color:#6b7280; line-height:16px; text-align:center; }
.dash-chart-tip { position:absolute; top:44px; background:#1f2937; color:#fff; font-size:12px; line-height:1.6; padding:8px 10px; border-radius:6px; white-space:pre; pointer-events:none; z-index:30; box-shadow:0 4px 6px -1px rgba(0,0,0,.2); }
.dash-chart-tip .tip-loss { color:#f87171; }
/* 今天这一格：橙色柱 + 淡橙竖带 + 加粗金额与轴标签，让它在整段区间里一眼看到 */
.chart-col.today .chart-plot { background:#fff7ed; border-radius:4px 4px 0 0; }
.chart-bar.today { background:#f97316; }
.chart-bar.empty.today { background:#e5e7eb; }
.chart-col.today .chart-val { font-weight:800; color:#c2410c; }
.chart-day.today { font-weight:800; color:#c2410c; }
.chart-col.today:hover .chart-bar { background:#ea580c; }
.chart-col.today.no-jump:hover .chart-bar { background:#ea580c; }

/* 看板双榜：各占一整行、上下排列，表格铺满；窄屏靠容器内部横向滚动，不撑破页面 */
.dash-ranks { display:grid; grid-template-columns:minmax(0,1fr); gap:18px; align-items:start; }
/* 窄屏时让表格在容器内部横向滚动，别把整页/整个标签页撑宽 */
.dash-ranks > div { min-width:0; }
.rn { font-weight:600; }
.rn[data-act] { cursor:pointer; text-decoration:none; border-radius:4px; padding:1px 5px; margin:-1px -5px; transition:background .12s ease, color .12s ease; }
.rn[data-act]:hover { background:#eef4ff; }
#shopRankBody tr.rank-row, #anchorRankBody tr.rank-row, #custProdBody tr.rank-row { cursor:pointer; }
#shopRankBody tr.rank-row:hover > td, #anchorRankBody tr.rank-row:hover > td, #custProdBody tr.rank-row:hover > td { background:#f7faff; }
.rn-total { color:#2563eb; }
.rn-valid { color:#15803d; }
.rn-loss { color:#dc2626; }
.rank-no { flex:none; width:26px; text-align:center; color:#9ca3af; font-size:12px; }
/* 第一列：奖杯（或第 4 名起的同宽数字占位）+ 店名 · 主播，一行显示、行高一致、名字左边缘对齐 */
#shopRankTable, #anchorRankTable { table-layout:fixed; min-width:1020px; }
#shopRankTable th, #shopRankTable td, #anchorRankTable th, #anchorRankTable td { padding-left:8px; padding-right:8px; font-size:13px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* 表头字略小一号，10 列在 1280 宽下也能完整显示标题不被省略 */
#shopRankTable th, #anchorRankTable th { font-size:12px; }
/* 列宽按内容分配：名称列最宽，金额列略宽，其余均分；拖动列宽后由记忆值覆盖 */
#shopRankTable th:nth-child(1) { width:19%; min-width:180px; }
#shopRankTable th:nth-child(2) { width:7%; }
#shopRankTable th:nth-child(3) { width:8%; }
#shopRankTable th:nth-child(4) { width:11%; }
#shopRankTable th:nth-child(5) { width:8%; }
#shopRankTable th:nth-child(6) { width:11%; }
#shopRankTable th:nth-child(7) { width:9%; }
#shopRankTable th:nth-child(8) { width:10%; }
#shopRankTable th:nth-child(9) { width:7%; }
#shopRankTable th:nth-child(10) { width:11%; }
#anchorRankTable th:nth-child(1) { width:14%; min-width:110px; }
#anchorRankTable th:nth-child(2) { width:9%; }
#anchorRankTable th:nth-child(3) { width:12%; }
#anchorRankTable th:nth-child(4) { width:9%; }
#anchorRankTable th:nth-child(5) { width:11%; }
#anchorRankTable th:nth-child(6) { width:8%; }
#anchorRankTable th:nth-child(7) { width:10%; }
#anchorRankTable th:nth-child(8) { width:9%; }
#anchorRankTable th:nth-child(9) { width:7%; }
#anchorRankTable th:nth-child(10) { width:11%; }
.rank-in { display:flex; align-items:center; gap:8px; min-height:52px; }
.rank-txt { flex:1; min-width:0; }
.rn-line { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.rank-note { font-size:12px; color:#9ca3af; margin:6px 2px 0; }
.trophy { --cup1:#fde68a; --cup2:#f59e0b; --dark:#b45309; position:relative; flex:none; width:26px; height:22px; }
.trophy.t2 { --cup1:#f3f4f6; --cup2:#9ca3af; --dark:#6b7280; }
.trophy.t3 { --cup1:#fdba74; --cup2:#c2410c; --dark:#7c2d12; }
.trophy .cup { position:absolute; left:4px; top:0; width:18px; height:14px; border-radius:2px 2px 9px 9px; background:linear-gradient(180deg,var(--cup1),var(--cup2)); box-shadow:inset 0 1px 0 rgba(255,255,255,.65), inset 0 -2px 3px rgba(0,0,0,.18); }
.trophy .cup::before, .trophy .cup::after { content:''; position:absolute; top:1px; width:6px; height:9px; border:2px solid var(--dark); background:transparent; }
.trophy .cup::before { left:-6px; border-right:none; border-radius:6px 0 0 6px; }
.trophy .cup::after { right:-6px; border-left:none; border-radius:0 6px 6px 0; }
.trophy .stand { position:absolute; left:10px; top:14px; width:6px; height:3px; background:var(--dark); }
.trophy .foot { position:absolute; left:6px; top:17px; width:14px; height:4px; border-radius:2px; background:var(--dark); }
.trophy .no { position:absolute; left:4px; top:0; width:18px; height:14px; display:flex; align-items:center; justify-content:center; font-size:10px; font-weight:800; color:var(--dark); }
.top1 { display:inline-block; margin-left:6px; padding:1px 6px; border-radius:10px; background:linear-gradient(135deg,#f59e0b,#d97706); color:#fff; font-size:10px; font-weight:800; letter-spacing:.4px; vertical-align:1px; box-shadow:0 1px 2px rgba(217,119,6,.45); }

/* ===== 看板：客户复购与排行榜 ===== */
.dash-sec { margin-top:4px; }
.dash-sec-head { display:flex; justify-content:space-between; align-items:baseline; gap:12px; margin:8px 0 14px; padding-top:20px; border-top:1px solid #eef0f3; }
.dash-sec-title { font-size:16px; font-weight:700; color:#111827; }
.dash-sec-sub { font-size:12px; color:#9ca3af; margin-left:8px; }
.dash-month-badge { font-size:12px; color:#4b5563; background:#f7f8fa; border:1px solid #eef0f3; border-radius:999px; padding:3px 10px; white-space:nowrap; }
.dash-cust-grid { display:grid; grid-template-columns:minmax(0,1.12fr) minmax(0,1fr); gap:16px; align-items:stretch; }
.dash-cust-grid > .dash-chart-card { margin-bottom:16px; display:flex; flex-direction:column; }
@media (max-width:1100px) { .dash-cust-grid { grid-template-columns:1fr; } }
.cust-stats { display:grid; grid-template-columns:repeat(3, minmax(0,1fr)); gap:8px; }
.cust-stat { background:#fafbfc; border-radius:8px; padding:8px 8px; min-width:0; }
.cust-stat.clickable { cursor:pointer; transition:background .15s ease, box-shadow .15s ease; }
.cust-stat.clickable:hover { background:#f4f8ff; box-shadow:inset 0 0 0 1px #cfe0fb; }
.cust-stat.clickable:hover .cs-drill { color:#2563eb; }
.cs-label { font-size:12px; color:#6b7280; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.cs-drill { float:right; font-size:13px; color:#c3c9d4; line-height:1; }
.cs-val { font-size:18px; font-weight:700; color:#111827; line-height:1.35; font-variant-numeric:tabular-nums; white-space:nowrap; }
.cs-unit { font-size:12px; font-weight:500; color:#6b7280; margin-left:1px; }
.cs-sub { font-size:11px; line-height:1.45; color:#9ca3af; min-height:32px; }
.cs-sub .mom { font-size:10.5px; letter-spacing:-.2px; }
.cust-legend { display:flex; gap:16px; font-size:12px; color:#6b7280; margin:12px 0 0; }
.lg { display:inline-block; width:10px; height:10px; border-radius:2px; margin-right:5px; vertical-align:-1px; }
.lg-new { background:#2563eb; }
.lg-rep { background:#15803d; }
.lg-line { width:12px; height:3px; border-radius:2px; background:#f59e0b; vertical-align:3px; }
.cust-plot { position:relative; height:150px; min-height:150px; flex:1 1 auto; margin-top:6px; border-bottom:1px solid #e5e7eb; }
.cust-cols { position:absolute; inset:0; display:grid; align-items:end; }
.cust-col { position:relative; height:100%; display:flex; align-items:flex-end; justify-content:center; gap:4px; }
.cust-bar { width:16px; border-radius:3px 3px 0 0; background:#2563eb; min-height:2px; }
.cust-bar.rep { background:#15803d; }
.cust-bar.zero { background:#e5e7eb; }
.cust-zero { position:absolute; left:0; right:0; bottom:2px; text-align:center; font-size:11px; color:#c9cdd4; }
.cust-line { position:absolute; inset:0; width:100%; height:100%; overflow:visible; }
.cust-line polyline { fill:none; stroke:#f59e0b; stroke-width:2; vector-effect:non-scaling-stroke; }
.cust-dots { position:absolute; inset:0; pointer-events:none; }
.cust-dot { position:absolute; width:7px; height:7px; margin:-4px 0 0 -4px; border-radius:50%; background:#fff; border:2px solid #f59e0b; box-sizing:border-box; }
.cust-dot-lab { position:absolute; transform:translate(-50%,-100%); margin-top:-7px; font-size:11px; color:#b45309; white-space:nowrap; text-shadow:0 0 3px #fff, 0 1px 0 #fff, 1px 0 0 #fff, -1px 0 0 #fff, 0 -1px 0 #fff; }
.cust-dot-lab.below { transform:translate(-50%,0); margin-top:8px; }
.cust-xaxis { display:grid; margin-top:4px; }
.cust-xaxis span { text-align:center; font-size:11px; color:#6b7280; white-space:nowrap; }
.cust-key-note { margin-top:12px; font-size:12px; line-height:1.65; color:#6b7280; background:#fafbfc; border-radius:8px; padding:8px 10px; }
.min-seg { display:inline-flex; border:1px solid #e4e7ec; border-radius:8px; overflow:hidden; flex:none; }
.min-seg button { height:28px; padding:0 12px; font-size:12px; border:0; border-radius:0; background:#fff; color:#6b7280; }
.min-seg button + button { border-left:1px solid #eef0f3; }
.min-seg button:hover { background:#f7f8fa; }
.min-seg button.on { background:#eff6ff; color:#1d4ed8; font-weight:600; }
.cust-rank-wrap { margin-bottom:0; max-height:none; }
.cust-rank { table-layout:fixed; width:100%; }
.cust-rank th, .cust-rank td { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; padding-left:8px; padding-right:8px; }
.cust-rank .c-rank { width:44px; padding-left:10px; }
.cust-rank .c-num { width:96px; text-align:right; }
.cust-rank .c-share { width:104px; }
.cust-rank .c-mom { width:76px; text-align:right; }
.cust-rank .c-cat { width:96px; }
.cust-rank td.c-num { font-variant-numeric:tabular-nums; }
.cust-rank .c-rank .trophy, .cust-rank .c-rank .rank-no { width:26px; height:22px; }
.share { display:flex; align-items:center; gap:6px; }
.share-bar { flex:1; min-width:32px; height:6px; background:#f1f3f6; border-radius:3px; overflow:hidden; }
.share-bar i { display:block; height:100%; background:#93c5fd; border-radius:3px; }
.share span { flex:none; width:40px; text-align:right; font-size:12px; color:#6b7280; font-variant-numeric:tabular-nums; }
.mom { font-size:12px; font-weight:600; white-space:nowrap; }
.mom.up { color:#15803d; }
.mom.down { color:#dc2626; }
.mom.flat { color:#9ca3af; font-weight:400; }
@media (max-width:620px) {
  .cust-stats { grid-template-columns:1fr; }
  .cust-rank .c-share { width:104px; }
  .cust-rank .c-mom { width:76px; }
}

/* ===== 主播提成页：说明气泡、紧凑表格、搜索分页 ===== */
.help-tip { position:relative; display:inline-flex; align-items:center; justify-content:center; width:16px; height:16px; margin-left:6px; border-radius:50%; background:#f1f3f6; color:#8a94a6; font-size:11px; font-weight:700; cursor:pointer; user-select:none; vertical-align:middle; flex:none; }
.help-tip:hover, .help-tip.open { background:#eff6ff; color:#1d4ed8; }
/* 气泡挂 body 定位（JS 控制翻转与收边），避免被表格 overflow 裁切 */
#helpTipLayer { position:fixed; display:none; z-index:4000; width:max-content; max-width:380px; max-height:min(60vh, 360px); overflow-y:auto; overflow-x:hidden; padding:9px 11px; background:#1f2937; color:#f9fafb; font-size:12px; font-weight:400; line-height:1.65; border-radius:6px; white-space:pre-line; overflow-wrap:anywhere; word-break:break-word; text-align:left; box-shadow:0 8px 24px rgba(0,0,0,.25); user-select:text; -webkit-user-select:text; cursor:text; }
#helpTipLayer::-webkit-scrollbar { width:8px; }
#helpTipLayer::-webkit-scrollbar-thumb { background:#4b5563; border-radius:4px; }
.panel-head h3, .card .label { display:flex; align-items:center; }
/* 主播筛选：可输入过滤的自定义下拉 */
.comm-anchor-picker { position:relative; display:inline-block; }
.comm-anchor-picker input { padding-right:22px; }
.comm-anchor-items { display:none; position:absolute; top:100%; left:0; margin-top:4px; min-width:100%; max-height:260px; overflow:auto; background:#fff; border:1px solid #eef0f3; border-radius:10px; box-shadow:0 8px 24px rgba(15,23,42,.08); z-index:60; }
.comm-anchor-items.open { display:block; }
.comm-anchor-items div { padding:7px 10px; font-size:13px; color:#374151; cursor:pointer; white-space:nowrap; }
.comm-anchor-items div:hover, .comm-anchor-items div.on { background:#eff6ff; color:#2563eb; }
#commTable { table-layout:fixed; width:100%; }
#commTable th, #commTable td { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; padding-left:10px; padding-right:10px; text-align:center; }
#commTable th, .comm-rule-wrap th, .comm-modal-table th, .comm-channel-table th { font-size:14px; }
#commTable td.c-num { font-variant-numeric:tabular-nums; }
#commTable td.c-name { font-weight:500; }
/* 提成页三张表统一：表头与内容同一种对齐（全部居中），数字用等宽数字 */
#commRuleTable th, #commRuleTable td { text-align:center; }
#commRuleTable td.c-tiers { text-align:center; }
#commHistoryTable th, #commHistoryTable td { text-align:center; font-variant-numeric:tabular-nums; }
#commTable td.c-act, #commRuleTable td.c-act { text-align:center; }
#commRuleTable td.c-act { white-space:nowrap; }
#commRuleTable td.c-act button { height:26px; padding:0 6px; font-size:12px; margin:0 2px; }
.comm-tag { display:inline-block; margin-left:6px; padding:0 6px; height:18px; line-height:18px; border-radius:9px; background:#f4f6f9; color:#6b7280; font-size:11px; font-weight:500; vertical-align:1px; }
.comm-tag-own { background:#fffbeb; color:#b45309; }
.comm-table-wrap { max-height:52vh; }
.comm-panels { display:flex; flex-direction:column; gap:16px; margin-top:16px; }
.comm-panel { background:#fff; border:1px solid #eef0f3; border-radius:10px; padding:14px 18px 8px; min-width:0; }
.comm-panel-rules { flex:none; }
.panel-head { display:flex; justify-content:space-between; align-items:center; margin-bottom:8px; }
.panel-head h3 { margin:0; font-size:15px; }
/* 提成页表格已在外层白卡里，内层表格不再套框 */
.comm-panel .table-container { border:0; border-radius:0; margin-bottom:0; }
.comm-rule-wrap { max-height:46vh; }
.comm-rule-wrap table { table-layout:fixed; width:100%; }
.comm-rule-wrap th, .comm-rule-wrap td { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; padding-left:9px; padding-right:9px; }
.comm-rule-wrap td.c-tiers { white-space:normal; line-height:1.5; overflow-wrap:anywhere; }
.comm-history-wrap table { table-layout:fixed; min-width:420px; }
.comm-modal-wrap { overflow:auto; }
.comm-modal-table { table-layout:fixed; width:100%; }
.comm-modal-table th, .comm-modal-table td { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.comm-modal-table td.c-num { text-align:center; font-variant-numeric:tabular-nums; }
/* 弹层表格的按钮列：固定窄内边距，窄屏只在表格容器内横向滚动，按钮不被切 */
.comm-modal-table td.c-act, .comm-modal-table th.c-act { text-align:center; padding-left:4px; padding-right:4px; }
.comm-modal-table td.c-act button { white-space:nowrap; }
.comm-modal-table.comm-orders-table { min-width:1150px; }
/* 订单明细列多且含 19 位订单号：整表 13px，短列才能完整显示；规则/说明保持 12px 并省略+悬浮 */
.comm-orders-table th, .comm-orders-table td { font-size:13px; }
.comm-orders-table td.muted { font-size:12px; }
.comm-modal-table.comm-pay-table { min-width:760px; }
.comm-modal-table.comm-anchor-table { min-width:640px; }
#commChannelSummary { overflow-x:auto; }
#commChannelSummary:not(:empty) { padding-bottom:12px; border-bottom:1px solid #eef0f3; }
/* 订单状态用完整文字，不缩写、不截断 */
.comm-orders-table td.c-included { text-align:center; font-weight:600; }
.cr-tiers-head { display:flex; align-items:center; white-space:nowrap; margin:16px 0 8px; font-size:14px; font-weight:500; color:#374151; }
.comm-channel-table { table-layout:fixed; width:100%; min-width:560px; }
.comm-channel-table th, .comm-channel-table td { white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
/* 提成相关弹层的金额/数量列统一居中（含表头），文本列保持左对齐 */
.comm-modal-table th.c-mid, .comm-modal-table td.c-mid,
.comm-channel-table th.c-mid, .comm-channel-table td.c-mid { text-align:center; }
/* 可下钻数字：浅色虚线 + 末尾小箭头，hover 才变色；不可点的数字不加这个类 */
.comm-link { cursor:pointer; border-bottom:1px dashed #cbd5e1; padding-bottom:1px; transition:color .15s, border-color .15s; }
.comm-link:hover { color:#2563eb; border-bottom-color:#93c5fd; }
.comm-link::after { content:'›'; font-size:10px; margin-left:2px; color:#9ca3af; }
.comm-link:hover::after { color:#2563eb; }
.comm-link-tag { cursor:pointer; transition:color .15s, background .15s; }
.comm-link-tag:hover { color:#2563eb; background:#eef2ff; }
.comm-drill-sum { margin:12px 0; padding:10px 14px; background:#fafbfc; border:1px solid #f2f4f7; border-radius:8px; color:#475569; font-size:12px; line-height:1.8; }
.comm-drill-empty { padding:28px 0; text-align:center; color:#9ca3af; font-size:13px; }
.cr-tier input { padding:0 8px; border:1px solid #e4e7ec; border-radius:8px; font-size:13px; }
/* 规则弹窗：字段行统一标签宽度；档位行带单位、单行不换行 */
#modalCommissionRule .cr-tier input, #modalCommissionRule .cr-row input,
#modalCommissionRule .cr-row select { height:32px; }
.cr-row { display:flex; align-items:center; gap:10px; margin-bottom:12px; }
.cr-row .cr-label { flex:none; min-width:78px; white-space:nowrap; display:inline-flex; align-items:center; font-size:14px; color:#374151; }
.cr-row select, .cr-row input { flex:1 1 0; min-width:0; font-size:14px; }
.cr-row textarea { flex:1 1 0; min-width:0; font-size:14px; font-family:inherit; line-height:1.5;
  padding:8px 10px; border:1px solid #e4e7ec; border-radius:8px; background:#fff; color:#374151;
  outline:none; resize:vertical; min-height:56px; transition:border-color .15s, box-shadow .15s; }
.cr-row textarea:focus { border-color:#bfdbfe; box-shadow:0 0 0 3px rgba(37,99,235,.08); }
/* 流水表：项目/明细过长时最多两行，超出省略 */
.fin-item-cell { display:-webkit-box; max-width:260px; overflow:hidden; -webkit-line-clamp:2;
  -webkit-box-orient:vertical; white-space:pre-wrap; word-break:break-word; }
.cr-row .dropdown-check-list { flex:1 1 0; min-width:0; }
.cr-tier { display:flex; align-items:center; gap:5px; margin-bottom:8px; white-space:nowrap; }
.cr-tier .cr-k { flex:none; font-size:13px; color:#374151; }
.cr-tier .cr-u { flex:none; font-size:12px; color:#6b7280; }
.cr-tier .cr-arrow { flex:none; font-size:12px; color:#9ca3af; }
.cr-tier .cr-min { flex:1 1 0; min-width:0; }
.cr-tier .cr-rate { flex:0 0 88px; width:88px; }
.cr-tier button { flex:none; height:30px; padding:0 10px; font-size:13px; }
@media (max-width:560px) {
  .cr-row { gap:8px; }
  .cr-row .cr-label { min-width:74px; font-size:13px; }
  .cr-tier { gap:4px; }
  .cr-tier .cr-rate { flex-basis:70px; width:70px; }
  .cr-tier button { padding:0 6px; }
}

/* ===== 供货核算 ===== */
.supply-switch { display:flex; gap:8px; flex-wrap:wrap; margin:0 0 16px; }
.supply-tab { background:#fff; border:1px solid #e4e7ec; color:#4b5563; padding:7px 15px; border-radius:7px; font-size:14px; cursor:pointer; transition:background .15s, border-color .15s, color .15s; }
.supply-tab:hover { background:#f7f8fa; }
.supply-tab.on { background:#eff6ff; border-color:#bfdbfe; color:#1d4ed8; font-weight:600; }
.supply-tip { background:#fffbeb; border:1px solid #fde68a; color:#92400e; font-size:12.5px; line-height:1.7; padding:8px 12px; border-radius:7px; margin-bottom:14px; }
.supply-diff-head { display:flex; justify-content:space-between; align-items:center; gap:12px; margin:26px 0 12px; }
.supply-diff-head h3 { font-size:15px; display:flex; align-items:center; }
/* 供货核算页（含弹层明细表）：表头与单元格一律左对齐；数字保留等宽数字，但不再右对齐 */
.supply-view th, .supply-view td,
#modalSupplyOrders th, #modalSupplyOrders td,
#modalSupplyBill th, #modalSupplyBill td,
#modalSupplyDrill th, #modalSupplyDrill td { text-align:left; }
.supply-view th.num, .supply-view td.num,
#modalSupplyOrders th.num, #modalSupplyOrders td.num,
#modalSupplyBill th.num, #modalSupplyBill td.num,
#modalSupplyDrill th.num, #modalSupplyDrill td.num { font-variant-numeric:tabular-nums; }
.supply-view .col-cb { padding-left:8px; padding-right:8px; }
.supply-view td .b-plain { padding:4px 9px; font-size:12px; }
#supDrillTable { min-width:780px; }
/* 供应商在供明细带图片列：9 列在 960 宽的弹层里也能完整显示，不出现横向滚动 */
#supDrillTable.with-img th, #supDrillTable.with-img td { font-size:13px; }
#supDrillTable .sup-img { text-align:center !important; }
#supDrillTable .sup-img img { display:block; width:40px; height:40px; object-fit:contain; background:#fafbfc; border-radius:6px; }
#supDrillTable .sup-none { font-size:11px; }
.carry-tag { display:inline-block; margin-left:6px; padding:1px 6px; font-size:12px; line-height:1.5;
    color:#92400e; background:#fef3c7; border:1px solid #fde68a; border-radius:999px; white-space:nowrap; }
#spSettleBtn:disabled { opacity:.5; cursor:not-allowed; }

/* 账号启停状态标签 */
.u-status { display:inline-block; margin-left:8px; padding:1px 7px; border-radius:999px; font-size:12px;
    line-height:18px; font-weight:500; vertical-align:middle; }
.u-status.on { color:#166534; background:#f0fdf4; border:1px solid #bbf7d0; }
.u-status.off { color:#9a3412; background:#fff7ed; border:1px solid #fed7aa; }

/* 账号管理：密码列「状态 + 重设密码」同一行，窄屏也不拆散 */
#userTable { min-width: 1000px; }
#userTable td:nth-child(2), #userTable td:nth-child(5) { white-space:nowrap; }
#userTable td:nth-child(6) { min-width:140px; }
#userTable .user-pwd-cell { white-space:nowrap; }
#userTable .pwd-line { display:flex; align-items:center; gap:8px; white-space:nowrap; }
#userTable .user-pwd-cell .u-status { margin-left:0; }
#tab-users .toolbar button { white-space:nowrap; }

/* 失效账号清单：表格在弹窗内滚动，长备注/权限自动换行 */
.deleted-list { flex:1 1 auto; min-height:0; overflow:auto; }
#deletedUserTable { width:100%; }
#deletedUserTable th, #deletedUserTable td { white-space:nowrap; }
#deletedUserTable td:nth-child(5), #deletedUserTable td:nth-child(6) { white-space:normal; }

/* 权限设置弹窗：模块总开关 + 查看/编辑子项（两级结构） */
/* 弹窗容器用 flex 撑满视口并留 20px 边距，卡片不超出视口 */
#modalUserPerm { padding:20px; box-sizing:border-box; align-items:center; justify-content:center; }
.perm-card { background:#fff; display:flex; flex-direction:column; width:520px; max-width:100%;
    max-height:100%; overflow:hidden; margin:0; padding:20px; border-radius:10px; box-sizing:border-box; }
.perm-card > h3, .perm-tip, .perm-actions { flex:none; }
.perm-tip { margin:-6px 0 10px; font-size:12px; line-height:1.75; color:#64748b; }
/* 只有模块列表滚动，底部按钮始终可见 */
.perm-list { display:flex; flex-direction:column; flex:1 1 auto; min-height:0; overflow-y:auto;
    scrollbar-gutter:stable; margin:14px 0 0; padding-right:4px; }
.perm-actions { text-align:right; padding-top:14px; }
.perm-item { display:flex; flex-direction:column; align-items:stretch; gap:6px;
    padding:10px 2px; border-bottom:1px solid #eef1f6; }
.perm-item:last-child { border-bottom:0; }
.perm-head { display:flex; align-items:center; gap:8px; min-width:0; cursor:pointer; }
.perm-head input[type=checkbox] { width:15px; height:15px; margin:0; flex:none; }
.perm-name { font-size:13px; font-weight:600; color:#334155; white-space:nowrap; }
.perm-children { display:flex; align-items:center; gap:18px; padding-left:23px; }
.perm-children .check-row { display:inline-flex; align-items:center; gap:6px; margin:0;
    font-size:13px; color:#475569; cursor:pointer; white-space:nowrap; }
.perm-children .check-row input[type=checkbox] { width:14px; height:14px; margin:0; }
.perm-item.off .perm-children { opacity:.45; }
.perm-item.off .perm-children label { cursor:not-allowed; }

/* ===== 直播知识：列表、详情、防复制区域 ===== */
#knowledgeTable { table-layout:fixed; width:100%; }
/* 只有查看权限时的文章目录样式：留白为主，不带管理列 */
.kn-article-list { background:#fff; border:1px solid #eef0f3; border-radius:10px; padding:6px 10px; }
.kn-article-item { padding:15px 12px; border-bottom:1px solid #f2f4f8; border-radius:6px; cursor:pointer; }
.kn-article-item:last-child { border-bottom:0; }
.kn-article-item:hover { background:#f7f9fc; }
.kn-article-item-title { font-size:15px; font-weight:500; color:#1f2d3d; overflow-wrap:anywhere; }
.kn-article-item-meta { margin-top:6px; font-size:12px; color:#8a94a6; overflow-wrap:anywhere; }
/* 直播知识列表：分类单元格可点改，点开后就地变成下拉 */
.kn-cat-cell { cursor:pointer; color:#111827; }
.kn-cat-cell:hover { color:#000; text-decoration:underline; }
.kn-cat-inline { width:100%; min-width:0; height:28px; padding:0 4px; font-size:12px; }
/* 表头点击排序：可排序列常驻淡色 ↕，当前列显示蓝色 ▲/▼；拖动排序模式下不响应 */
#knowledgeTable thead th[data-sort] { position:relative; padding-right:16px; cursor:pointer; user-select:none; }
#knowledgeTable thead th[data-sort]:hover { color:#2563eb; }
#knowledgeTable thead th[data-sort]::after { content:'↕'; position:absolute; right:3px; top:50%;
    transform:translateY(-50%); font-size:10px; color:#c3cad5; }
#knowledgeTable thead th[data-sort].kn-sort-asc::after { content:'▲'; color:#2563eb; }
#knowledgeTable thead th[data-sort].kn-sort-desc::after { content:'▼'; color:#2563eb; }
#knowledgeTable.kn-sorting thead th { pointer-events:none; }
/* 管理员长按空白处进入拖动排序：提示条 + 行内拖动反馈 */
.kn-sort-bar { display:flex; align-items:center; justify-content:space-between; gap:12px;
    margin-bottom:10px; padding:9px 12px; background:#eff6ff; border:1px solid #bfdbfe;
    border-radius:10px; color:#1d4ed8; font-size:13px; }
.kn-sort-tip { font-weight:500; }
#knowledgeTable.kn-sorting { user-select:none; }
#knowledgeTable.kn-sorting tbody tr { cursor:grab; }
#knowledgeTable.kn-sorting tbody tr.kn-dragging { opacity:.5; }
#knowledgeTable.kn-sorting .kn-title,
#knowledgeTable.kn-sorting .kn-cat-cell,
#knowledgeTable.kn-sorting tbody button,
#knowledgeTable.kn-sorting tbody a { pointer-events:none; }
.kn-empty { padding:32px 12px; text-align:center; color:#9aa4b2; font-size:13px; }
/* 详情页底部上一篇/下一篇：窄屏也不换行、不压正文 */
.kn-detail-nav { flex:0 0 auto; display:flex; flex-wrap:nowrap; gap:10px; justify-content:center;
    align-items:center; padding:10px 16px; border-top:1px solid #eef0f3; background:#fff; }
.kn-detail-nav button { display:flex; align-items:center; justify-content:flex-start;
    text-align:left; white-space:nowrap; flex:1 1 0; min-width:0; max-width:460px;
    overflow:hidden; padding:0 12px; }
/* 前缀「上一篇：」「下一篇：」固定显示；只有标题参与末尾省略 */
.kn-detail-nav .kn-nav-prefix { flex:0 0 auto; }
.kn-detail-nav .kn-nav-title { flex:1 1 auto; min-width:0; overflow:hidden;
    text-overflow:ellipsis; white-space:nowrap; }
.kn-detail-nav button:disabled { opacity:.45; cursor:not-allowed; }
/* 列表标题：一行显示、末尾省略，悬停看完整标题；颜色用正文黑，不用链接蓝 */
/* 标题一行显示后，用统一的行最小高度兜住最后的 1px 舍入差，避免行高参差 */
#knowledgeTable tbody td { height:107px; }
.kn-title-line { display:flex; align-items:center; min-width:0; }
.kn-title { flex:1 1 auto; min-width:0; color:#111827; cursor:pointer;
    white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.kn-title:hover { color:#000; text-decoration:underline; }
.kn-tag { display:inline-block; margin-left:6px; padding:1px 6px; font-size:12px;
    color:#92400e; background:#fffbeb; border:1px solid #fde68a; border-radius:4px; white-space:nowrap; }
.kn-meta { font-size:12px; color:#8a94a6; margin-top:2px; }
.kn-video { width:100%; max-height:56vh; background:#000; border-radius:8px; display:block; }
.kn-cover { max-width:100%; max-height:280px; border-radius:8px; margin-bottom:12px; display:block; }
/* 详情页正文容器：纯白、无边框、无阴影、无圆角，左右不留内边距，文字直接贴左侧铺开 */
.kn-article { line-height:1.85; font-size:14px; color:#374151;
    padding:8px 0; background:#fff; border:0; border-radius:0; box-shadow:none;
    overflow-wrap:anywhere; }
.kn-article p { margin:0 0 10px; }
.kn-article p:last-child { margin-bottom:0; }
.kn-article h1, .kn-article h2 { font-size:19px; margin:14px 0 8px; color:#111827; }
.kn-article h3, .kn-article h4, .kn-article h5, .kn-article h6 { font-size:16px; margin:12px 0 6px; color:#111827; }
.kn-article ul, .kn-article ol { margin:0 0 10px; padding-left:22px; }
.kn-article li { margin:2px 0; }
.kn-article blockquote { margin:10px 0; padding:0 0 0 12px; color:#4b5563;
    background:#fff; border:0; }
/* 正文内部元素同样不带底色和边框线（含 Word 粘贴带进来的内联背景/边框） */
.kn-article p, .kn-article h1, .kn-article h2, .kn-article h3,
.kn-article h4, .kn-article h5, .kn-article h6,
.kn-article ul, .kn-article ol, .kn-article blockquote, .kn-article pre {
    background-color:#fff !important; background-image:none !important; border:0 !important;
}
/* 代码块长行自动折行，窄屏不出现横向滚动 */
.kn-article pre { white-space:pre-wrap; overflow-wrap:anywhere; max-width:100%; }
.kn-article img { max-width:100%; height:auto; border-radius:4px; -webkit-user-drag:none; }
.kn-article table { border-collapse:collapse; display:block; width:max-content; max-width:100%; overflow-x:auto; margin:8px 0; }
/* 正文表格纯白无框：盖掉 Word/网页粘贴带进来的 style / bgcolor / border / bordercolor，不要条纹和 hover */
.kn-article table, .kn-article thead, .kn-article tbody, .kn-article tfoot,
.kn-article tr, .kn-article td, .kn-article th,
.kn-editor-body table, .kn-editor-body thead, .kn-editor-body tbody, .kn-editor-body tfoot,
.kn-editor-body tr, .kn-editor-body td, .kn-editor-body th {
    border:0 !important;
    background-color:#fff !important;
    background-image:none !important;
}
/* 没有格线后靠列间距和内边距区分各列，避免文字挤在一起 */
.kn-article td, .kn-article th,
.kn-editor-body td, .kn-editor-body th {
    padding:6px 16px;
    vertical-align:top;
}
/* 详情页表格左右贴边，列间距只留在列与列之间 */
.kn-article tr > td:first-child, .kn-article tr > th:first-child { padding-left:0; }
.kn-article tr > td:last-child, .kn-article tr > th:last-child { padding-right:0; }
/* 用户显式设置过边框的表格：外框粗细看 data-kn-border，内网格线看 data-kn-grid，颜色取 --kn-tbl-bc */
.kn-article table[data-kn-border="1"], .kn-editor-body table[data-kn-border="1"] {
    border:1px solid var(--kn-tbl-bc, #475569) !important;
}
.kn-article table[data-kn-border="2"], .kn-editor-body table[data-kn-border="2"] {
    border:2px solid var(--kn-tbl-bc, #475569) !important;
}
.kn-article table[data-kn-grid="1"] td, .kn-article table[data-kn-grid="1"] th,
.kn-editor-body table[data-kn-grid="1"] td, .kn-editor-body table[data-kn-grid="1"] th {
    border:1px solid var(--kn-tbl-bc, #475569) !important;
}
.kn-guard, .kn-guard * { user-select:none !important; -webkit-user-select:none !important; }
.kn-guard img, .kn-guard video { -webkit-user-drag:none; }
/* 图文正文编辑器：工具栏 + contenteditable，全部原生实现 */
.kn-editor { border:1px solid #e4e7ec; border-radius:8px; overflow:hidden; }
.kn-toolbar { display:flex; flex-wrap:wrap; align-items:center; gap:4px; padding:6px 8px;
    background:#fafbfc; border-bottom:1px solid #eef0f3; }
.kn-toolbar button { height:28px; min-width:30px; padding:0 8px; font-size:13px; }
/* 表格工具：行列数 + 插入按钮 + 边框粗细/颜色/内网格线，窄屏跟工具栏一起换行 */
.kn-tbl-tools { display:inline-flex; align-items:center; flex-wrap:wrap; gap:4px; }
.kn-toolbar .kn-tbl-tools input[type=number] { width:48px; height:28px !important; padding:0 4px !important; font-size:13px !important; text-align:center; }
.kn-tbl-x { font-size:12px; color:#9aa4b2; }
.kn-tbl-color { height:28px; }
.kn-tbl-grid { white-space:nowrap; }
.kn-toolbar select { height:28px; padding:0 6px; font-size:13px; }
.kn-tb-sep { width:1px; height:18px; background:#e4e7ec; margin:0 2px; }
.kn-color { position:relative; display:inline-flex; align-items:center; gap:3px; height:28px;
    padding:0 8px; border:1px solid #e4e7ec; border-radius:8px; cursor:pointer;
    font-size:13px; color:#374151; background:#fff; }
.kn-color input[type=color] { position:absolute; inset:0; width:100%; height:100%;
    padding:0; border:0; opacity:0; cursor:pointer; }
.kn-editor-body { min-height:220px; max-height:420px; overflow:auto; padding:10px 12px;
    font-size:14px; line-height:1.8; color:#1f2937; outline:none; }
.kn-editor-body:empty:before { content:'在这里输入正文…'; color:#9aa4b2; }
.kn-editor-body img { max-width:100%; height:auto; border-radius:4px; }
.kn-editor-body table { border-collapse:collapse; max-width:100%; }
.kn-file-row { display:flex; align-items:center; gap:10px; padding:8px 0;
    border-bottom:1px solid #f4f6f9; flex-wrap:wrap; }
.kn-file-row:last-child { border-bottom:0; }
.kn-file-name { flex:1; min-width:160px; word-break:break-all; }
.kn-note { font-size:13px; color:#6b7280; background:#f8fafc; border:1px solid #eef0f3;
    border-radius:8px; padding:8px 10px; margin-bottom:12px; }
/* 勾选项：文字紧跟复选框、整块左对齐（.row-form input 的 120px 最小宽度会把它推远） */
.row-form input[type="checkbox"] { min-width:0; }
.kn-check { display:inline-flex; align-items:center; justify-content:flex-start; gap:6px;
    flex:0 0 auto; min-width:0; white-space:nowrap; font-size:13px; color:#374151; cursor:pointer; }
.kn-check input[type="checkbox"] { flex:none; margin:0; }
/* 课件保存失败：留在编辑页，把原因摆在保存按钮上方 */
.kn-save-error { margin:0 0 8px; padding:8px 12px; background:#fef2f2; border:1px solid #fecaca;
    border-radius:8px; color:#b91c1c; font-size:13px; line-height:1.5; }
/* 访问密码旁的「清除密码」：小号文字按钮，不抢主按钮的视觉 */
.kn-pwd-clear { flex:0 0 auto; height:28px; padding:0 8px; font-size:12px; line-height:1;
    color:#2563eb; background:transparent; border:0; border-radius:6px; cursor:pointer; }
.kn-pwd-clear:hover { background:#eff6ff; }
.kn-pwd-clear:focus-visible { outline:2px solid #2563eb; outline-offset:1px; }

/* 新增/编辑课件：模块内整页视图，铺开用宽度，底部按钮固定可见 */
#knListView { min-height:0; }
#knEditView, #knDetailView, #knCatView { display:none; flex-direction:column; height:calc(100vh - 126px); min-height:460px; }
.kn-detail-title { min-width:0; }
.kn-detail-title h3 { margin:0; font-size:18px; color:#111827; overflow-wrap:anywhere; }
.kn-detail-actions { flex:none; display:flex; align-items:center; gap:8px; }
@media (max-width:820px) {
    .kn-detail-actions { gap:6px; }
    .kn-detail-actions .b-plain { padding:6px 10px; }
}
.kn-page-head { flex:none; display:flex; align-items:center; justify-content:space-between;
    gap:12px; padding-bottom:12px; margin-bottom:12px; border-bottom:1px solid #eef0f3; }
.kn-page-head h3 { margin:0; font-size:18px; color:#111827; }
.kn-page-body { flex:1 1 auto; min-height:0; overflow:auto; padding-right:2px; }
.kn-page-foot { flex:none; display:flex; justify-content:flex-end; gap:8px;
    padding-top:12px; margin-top:10px; border-top:1px solid #eef0f3; }
/* 编辑器在整页里给足高度，正文自带滚动 */
#knEditView .kn-editor-body { height:clamp(300px, calc(100vh - 450px), 760px); max-height:none; overflow:auto; }
#knEditView .kn-editor-body table { display:block; width:max-content; max-width:100%; overflow-x:auto; }
/* HTML 源码模式：等宽字体、长行自动折行，窄屏也不出横向滚动 */
.kn-editor-src { display:block; width:100%; box-sizing:border-box; border:0; outline:none;
    min-height:220px; padding:10px 12px; resize:vertical; background:#fff; color:#1f2937;
    font-family:Consolas, "Courier New", monospace; font-size:13px; line-height:1.6;
    white-space:pre-wrap; overflow-wrap:anywhere; }
#knEditView .kn-editor-src { height:clamp(300px, calc(100vh - 450px), 760px); resize:none; }
/* 整屏编辑：只留工具栏和正文，其余区域被遮住 */
.kn-editor.kn-full { position:fixed; inset:0; z-index:900; border:0; border-radius:0;
    display:flex; flex-direction:column; background:#fff; }
.kn-editor.kn-full .kn-toolbar { flex:0 0 auto; }
#knEditView .kn-editor.kn-full .kn-editor-body,
#knEditView .kn-editor.kn-full .kn-editor-src { flex:1 1 auto; height:auto; max-height:none;
    min-height:0; overflow:auto; resize:none; }
body.kn-full-lock { overflow:hidden; }
@media (max-width:1100px) {
    .kn-video { max-height:46vh; }
}

/* ===== 以图搜图：结果面板（白底扁平，与全站一致） ===== */
.isr-panel { overflow:hidden; }
.isr-head { display:flex; align-items:center; gap:10px; margin-bottom:10px; flex-wrap:wrap; }
.isr-title { font-size:14px; font-weight:600; color:#111827; }
.isr-note { flex:1 1 auto; min-width:0; font-size:12px; color:#6b7280; }
.isr-head .b-plain { height:30px; padding:0 10px; font-size:13px; }
.isr-body { display:grid; grid-template-columns:repeat(auto-fill, minmax(220px, 1fr)); gap:8px;
    max-height:360px; overflow-y:auto; overflow-x:hidden; }
.isr-card { display:flex; align-items:center; gap:10px; width:100%; min-width:0; height:auto;
    min-height:60px; padding:8px 10px; text-align:left; background:#fff; border:1px solid #eef0f3;
    border-radius:8px; cursor:pointer; }
.isr-card:hover { background:#f8fafc; border-color:#dbe3ee; }
.isr-thumb { flex:0 0 40px; width:40px; height:40px; border-radius:4px; overflow:hidden;
    background:#f3f4f6; display:flex; align-items:center; justify-content:center;
    cursor:zoom-in; transition:box-shadow .15s ease; }
.isr-thumb:hover { box-shadow:0 0 0 2px rgba(37,99,235,.28); }
.isr-thumb img { width:100%; height:100%; object-fit:cover; display:block; transition:transform .15s ease; }
.isr-thumb:hover img { transform:scale(1.08); }
.isr-noimg { font-size:11px; color:#9ca3af; }
.isr-info { flex:1 1 auto; min-width:0; display:flex; flex-direction:column; gap:2px; }
.isr-sku { font-size:12px; color:#6b7280; }
.isr-name { font-size:13px; color:#111827; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.isr-cat { font-size:12px; color:#9ca3af; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; }
.isr-score { flex:0 0 auto; padding:2px 8px; border-radius:12px; font-size:13px; font-weight:600; }
.isr-score.high { background:#ecfdf5; color:#15803d; }
.isr-score.mid { background:#eff6ff; color:#1d4ed8; }
.isr-score.low { background:#f8fafc; color:#64748b; }
.isr-empty { grid-column:1 / -1; padding:18px; text-align:center; color:#6b7280; font-size:13px; }
.isr-empty.isr-error { color:#b91c1c; }

/* ===== 看板：指标卡下钻 + 商品排行放右列 ===== */
.stat-card.clickable { cursor:pointer; transition:border-color .15s ease, background .15s ease; }
.stat-card.clickable:hover { border-color:#dbe3ee; background:#fcfdff; }
.stat-card.clickable:active { background:#f8fafc; }
/* 右列放商品排行（7 列），比左列略宽一点，商品名不至于被挤没 */
@media (min-width:1101px) {
    .dash-cust-grid { grid-template-columns:minmax(0,1fr) minmax(0,1.2fr); }
}
.cust-rank-tools { display:flex; align-items:center; gap:10px; flex-wrap:wrap; justify-content:flex-end; }
#custProdTable th, #custProdTable td { padding-left:6px; padding-right:6px; font-size:13px; }
#custProdTable .c-rank { width:44px; padding-left:8px; }
#custProdTable .c-cat { width:64px; }
#custProdTable .c-num { width:72px; }
#custProdTable .c-share { width:84px; }
#custProdTable .c-mom { width:78px; }
#dashDetailTable td:first-child { max-width:52%; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#dashDetailFoot .muted { color:#9ca3af; font-weight:400; }

/* ===== 列设置 / 显示字段 ===== */
.colset { position:relative; display:inline-block; }
.colset-btn { height:36px; padding:0 10px; border:1px solid #e4e7ec; border-radius:8px; background:#fff;
    font-size:13px; color:#374151; cursor:pointer; white-space:nowrap; }
.colset-btn:hover { border-color:#d8dde5; background:#fcfcfd; }
.colset.open .colset-btn { border-color:#93b4f7; color:#2563eb; }
.colset-menu { display:none; position:fixed; z-index:9999; min-width:210px; max-width:calc(100vw - 16px);
    max-height:360px; overflow-y:auto; padding:10px 12px 12px; background:#fff; border:1px solid #eef0f3;
    border-radius:12px; box-shadow:0 10px 30px rgba(15,23,42,.12); }
.colset.open .colset-menu { display:block; }
.colset-item { display:flex; align-items:center; gap:10px; height:36px; padding:0 8px; margin:0;
    font-size:13px; color:#374151; cursor:pointer; white-space:nowrap; border-radius:8px; }
.colset-item:hover { background:#f4f6f9; }
.colset-item input { margin:0; }
.colset-item span { overflow:hidden; text-overflow:ellipsis; }
.colset-item input:disabled + span { color:#9ca3af; }
.colset-foot { border-top:1px solid #f1f3f6; margin-top:8px; padding:10px 0 0; text-align:right; }
.colset-foot .b-plain { height:32px; padding:0 14px; font-size:13px; border-radius:8px; }
.colset-hidden { display:none !important; }

/* 客户明细里的「本月下单次数」可点 */
.order-count-link { border:0; background:transparent; padding:2px 7px; margin:0; border-radius:6px;
    font:inherit; font-weight:600; color:#2563eb; cursor:pointer; }
.order-count-link:hover { background:#eff6ff; }
#dashCustOrdersTable td:nth-child(3) { max-width:440px; overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
#dashCustOrdersTable td, #dashCustOrdersTable th { font-size:13px; }
/* 看板下钻弹窗：更宽的行距/列距，表头吸顶，内容区滚动、底部合计固定 */
#dashDetailTable th, #dashDetailTable td,
#dashCustOrdersTable th, #dashCustOrdersTable td { padding:11px 14px; }
#dashDetailTable th, #dashCustOrdersTable th {
    position:sticky; top:0; z-index:2; background:#fbfcfe; white-space:nowrap;
    box-shadow:inset 0 -1px 0 #e5e7eb;
}
#dashDetailTable td, #dashCustOrdersTable td { line-height:1.55; }
.link-mini { color:#2563eb; cursor:pointer; text-decoration:none; margin-left:4px; }
.link-mini:hover { color:#1d4ed8; text-decoration:none; }

/* 内部财务：凭证上传格（加号方块网格） */
.fin-voucher-grid { display:grid; grid-template-columns:repeat(4, 76px); gap:10px; }
.fin-voucher-item { position:relative; width:76px; height:76px; border-radius:10px; overflow:hidden;
    border:1px solid #e5e7eb; background:#f8fafc; box-shadow:0 1px 2px rgba(15,23,42,.04); }
.fin-voucher-item img { display:block; width:100%; height:100%; object-fit:cover; cursor:zoom-in;
    transition:transform .18s ease; }
.fin-voucher-item:hover img { transform:scale(1.04); }
.fin-voucher-item.pending { border:1px dashed #93c5fd; background:#eff6ff; }
.fin-voucher-del { position:absolute; top:4px; right:4px; width:20px; height:20px; padding:0; border:0;
    border-radius:50%; background:rgba(15,23,42,.72); color:#fff; font-size:14px; line-height:20px;
    display:flex; align-items:center; justify-content:center; cursor:pointer; opacity:0;
    transition:opacity .15s ease, background .15s ease; }
.fin-voucher-item:hover .fin-voucher-del, .fin-voucher-item:focus-within .fin-voucher-del { opacity:1; }
.fin-voucher-del:hover { background:#dc2626; }
.fin-voucher-pending { position:absolute; left:0; right:0; bottom:0; padding:2px 0; text-align:center;
    font-size:11px; line-height:1.4; color:#1d4ed8; background:rgba(239,246,255,.94); }
.fin-voucher-add { width:76px; height:76px; padding:0; display:flex; flex-direction:column; align-items:center;
    justify-content:center; gap:3px; border:1.5px dashed #cbd5e1; border-radius:10px; background:#fafbfc;
    color:#94a3b8; cursor:pointer; transition:border-color .15s ease, color .15s ease, background .15s ease; }
.fin-voucher-add:hover { border-color:#2563eb; color:#2563eb; background:#eff6ff; }
.fin-voucher-add svg { width:22px; height:22px; }
.fin-voucher-add span { font-size:11px; line-height:1; }
.fin-voucher-note { display:flex; align-items:center; flex-wrap:wrap; gap:4px 10px; margin-top:8px;
    font-size:12px; color:#9ca3af; }
.fin-voucher-note #finVoucherHint:not(:empty) { color:#2563eb; font-weight:600; }
@media (max-width:480px) {
    .fin-voucher-grid { grid-template-columns:repeat(3, 76px); }
}
@media (hover:none) {
    .fin-voucher-del { opacity:1; }
}

/* 内部财务流水表：固定布局 + 最小宽度，窄窗口下横向滚动而不是把列挤成竖排文字；配合表头拖拽调宽 */
#financeTable { table-layout:fixed; width:100%; min-width:1260px; }

/* 内部财务：Excel 导入结果提示 */
.fin-import-result { margin:0 0 16px; padding:12px 14px; background:#fffbeb; border:1px solid #fde68a;
    border-radius:10px; font-size:13px; color:#7c2d12; }
.fin-import-head { display:flex; align-items:center; gap:10px; flex-wrap:wrap; }
.fin-import-head span { color:#92400e; }
.fin-import-close { margin-left:auto; border:0; background:transparent; font-size:18px; line-height:1;
    color:#92400e; cursor:pointer; padding:0 2px; }
.fin-import-list { margin:8px 0 0; padding-left:20px; max-height:160px; overflow:auto; color:#78350f; }
.fin-import-list li { margin:2px 0; }

/* 内部财务：批量选择 / 分类胶囊 */
.fin-sel-info { font-size:12px; color:#64748b; margin-right:2px; white-space:nowrap; }
button.b-danger:disabled { opacity:.45; cursor:not-allowed; }
.fin-cat-chip { background:#f8fafc; border:1px solid #eef0f3; border-radius:999px; color:inherit;
    cursor:pointer; transition:border-color .15s ease, background .15s ease; }
.fin-cat-chip:hover { border-color:#93c5fd; background:#f0f7ff; }
.fin-cat-chip.active { border-color:#2563eb; background:#eff6ff; }

/* 内部财务：流水表上方独立操作条（已选条数 + 批量/新增/模板/导入/导出） */
.fin-action-bar { display:flex; flex-wrap:wrap; align-items:center; gap:8px 12px;
    padding:10px 14px; margin:0 0 12px; background:#fff; border:1px solid #eef0f3; border-radius:10px; }
.fin-action-bar .fin-sel-info { margin-right:auto; }
.fin-action-bar .tb-actions { flex:0 1 auto; justify-content:flex-end; margin-left:auto; }

/* 内部财务：以图搜索结果 / 定位高亮 */
.fin-row-hl td { background:#fff7cc !important; }
.fin-img-item { display:flex; gap:12px; align-items:center; padding:10px 12px; border:1px solid #eef0f3;
    border-radius:10px; margin-bottom:8px; background:#fff; }
.fin-img-thumb { width:64px; height:64px; object-fit:cover; border-radius:8px; border:1px solid #e5e7eb;
    cursor:zoom-in; flex:none; }
.fin-img-info { flex:1 1 auto; min-width:0; }
.fin-img-line1 { display:flex; gap:8px; align-items:center; font-size:13px; color:#374151; flex-wrap:wrap; }
.fin-img-tag { padding:1px 6px; border-radius:999px; background:#f1f5f9; color:#475569; font-size:12px; }
.fin-img-itemname { margin-top:4px; font-size:14px; color:#111827; font-weight:600;
    overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.fin-img-meta { margin-top:4px; font-size:12px; color:#6b7280; }
.fin-img-actions { flex:none; display:flex; flex-direction:column; align-items:flex-end; gap:6px; }
.fin-img-score { font-size:12px; color:#2563eb; font-weight:600; }
@media (max-width:560px) {
    .fin-img-item { flex-wrap:wrap; }
    .fin-img-actions { flex-direction:row; width:100%; justify-content:flex-end; align-items:center; }
}
