/* ==========================================================================
   云海潮智慧云仓管理系统 —— 全局样式
   --------------------------------------------------------------------------
   ★ 全站配色只由下面的 CSS 变量控制 ★
   改这 1 组变量 = 全站换色；也可以在「系统配置 → 全局配色」里改，
   保存后所有页面（含登录页）同步生效，无需改任何页面代码。
   ========================================================================== */

:root {
  /* ---- 品牌主色（按钮、选中态、链接） ---- */
  --c-primary: #1668dc;
  --c-primary-hover: #3c89e8;
  --c-primary-active: #0f4fb0;
  --c-primary-soft: #e8f1ff;

  /* ---- 辅助色 ---- */
  --c-secondary: #0d9488;
  --c-secondary-soft: #e6fffb;

  /* ---- 页面与容器 ---- */
  --c-bg: #f4f6fa;
  --c-surface: #ffffff;
  --c-surface-alt: #f8fafc;
  --c-border: #e3e8ef;

  /* ---- 文字 ---- */
  --c-text: #1f2b3d;
  --c-text-sub: #5a6a85;
  --c-text-muted: #95a1b5;
  --c-text-on-primary: #ffffff;

  /* ---- 侧边栏 ---- */
  --c-sidebar-bg: #132a4a;
  --c-sidebar-text: #c7d5e8;
  --c-sidebar-active-bg: #1668dc;
  --c-sidebar-active-text: #ffffff;

  /* ---- 顶栏 ---- */
  --c-header-bg: #ffffff;
  --c-header-text: #1f2b3d;

  /* ---- 状态色 ---- */
  --c-success: #12a150;
  --c-warning: #e08a00;
  --c-danger: #e0342b;
  --c-info: #1668dc;

  /* ---- 形状 / 字体 ---- */
  --c-radius: 8px;
  --c-radius-sm: 6px;
  --c-font: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", "PingFang SC", "Hiragino Sans GB", Arial, sans-serif;

  /* ---- 表格 ---- */
  --c-table-head-bg: #f2f5fa;
  --c-table-stripe: #f0f6fd;
  --c-table-hover: #f0f6ff;

  /* ---- 固定尺寸 ---- */
  --sidebar-w: 216px;
  --header-h: 56px;
  --shadow-1: 0 1px 2px rgba(16, 30, 54, .06), 0 2px 8px rgba(16, 30, 54, .04);
  --shadow-2: 0 6px 24px rgba(16, 30, 54, .12);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  height: 100%;
  font-family: var(--c-font);
  font-size: 14px;
  color: var(--c-text);
  background: var(--c-bg);
  -webkit-font-smoothing: antialiased;
}

a { color: var(--c-primary); text-decoration: none; }
a:hover { color: var(--c-primary-hover); }
h1, h2, h3, h4 { margin: 0; font-weight: 600; }
input, select, textarea, button { font-family: inherit; font-size: 14px; }
::-webkit-scrollbar { width: 8px; height: 8px; }
::-webkit-scrollbar-thumb { background: #c8d2e0; border-radius: 4px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============================ 登录页 ============================ */
.login-wrap {
  min-height: 100vh;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(135deg, var(--c-sidebar-bg) 0%, var(--c-primary-active) 55%, var(--c-primary) 100%);
  padding: 24px;
}
.login-card {
  width: 400px;
  background: var(--c-surface);
  border-radius: 14px;
  box-shadow: var(--shadow-2);
  padding: 36px 34px 30px;
}
.login-brand { text-align: center; margin-bottom: 26px; }
.login-logo {
  width: 76px; height: 76px; margin: 0 auto 12px;
  display: block; object-fit: contain;
  filter: drop-shadow(0 8px 18px rgba(13, 90, 167, .18));
}
.login-title { font-size: 19px; font-weight: 600; color: var(--c-text); letter-spacing: .5px; }
.login-sub { font-size: 12.5px; color: var(--c-text-muted); margin-top: 6px; }
.login-tips {
  margin-top: 20px; padding: 12px 14px; border-radius: var(--c-radius-sm);
  background: var(--c-surface-alt); border: 1px dashed var(--c-border);
  font-size: 12px; color: var(--c-text-sub); line-height: 1.9;
}
.login-tips b { color: var(--c-text); }
.login-tips code {
  background: var(--c-primary-soft); color: var(--c-primary);
  padding: 1px 5px; border-radius: 4px; font-size: 11.5px;
}

/* ============================ 表单控件 ============================ */
.field { margin-bottom: 15px; }
.field > label {
  display: block; margin-bottom: 6px;
  font-size: 13px; color: var(--c-text-sub); font-weight: 500;
}
.field .req { color: var(--c-danger); margin-left: 2px; }
.input, .select, .textarea {
  width: 100%; padding: 9px 12px; line-height: 1.4;
  color: var(--c-text); background: var(--c-surface);
  border: 1px solid var(--c-border); border-radius: var(--c-radius-sm);
  outline: none; transition: border-color .15s, box-shadow .15s;
}
.textarea { resize: vertical; min-height: 76px; }
.input:focus, .select:focus, .textarea:focus {
  border-color: var(--c-primary);
  box-shadow: 0 0 0 3px var(--c-primary-soft);
}
.input:disabled, .select:disabled { background: var(--c-surface-alt); color: var(--c-text-muted); cursor: not-allowed; }
.input-lg { padding: 11px 13px; font-size: 15px; }
.form-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 16px; }
.form-grid-3 { display: grid; grid-template-columns: repeat(3, 1fr); gap: 0 16px; }
.form-grid .span2, .form-grid-3 .span2 { grid-column: span 2; }
.form-grid-3 .span3 { grid-column: span 3; }
.hint { font-size: 12px; color: var(--c-text-muted); margin-top: 5px; }

/* ============================ 按钮 ============================ */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 8px 15px; border-radius: var(--c-radius-sm);
  border: 1px solid var(--c-border); background: var(--c-surface); color: var(--c-text);
  cursor: pointer; white-space: nowrap; user-select: none;
  transition: all .15s;
}
.btn:hover { border-color: var(--c-primary); color: var(--c-primary); }
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-text-on-primary); }
.btn-primary:hover { background: var(--c-primary-hover); border-color: var(--c-primary-hover); color: var(--c-text-on-primary); }
.btn-primary:active { background: var(--c-primary-active); }
.btn-success { background: var(--c-success); border-color: var(--c-success); color: #fff; }
.btn-success:hover { color: #fff; opacity: .9; border-color: var(--c-success); }
.btn-danger { background: var(--c-danger); border-color: var(--c-danger); color: #fff; }
.btn-danger:hover { color: #fff; opacity: .9; border-color: var(--c-danger); }
.btn-warn { background: var(--c-warning); border-color: var(--c-warning); color: #fff; }
.btn-warn:hover { color: #fff; opacity: .9; border-color: var(--c-warning); }.btn-ghost { background: transparent; }
.btn-sm { padding: 5px 10px; font-size: 13px; }
.btn-xs { padding: 3px 8px; font-size: 12px; border-radius: 4px; }
.btn-block { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; pointer-events: none; }
.btn-link {
  background: none; border: none; color: var(--c-primary);
  cursor: pointer; padding: 2px 4px;
}
.btn-link:hover { text-decoration: underline; }
.btn-link.danger { color: var(--c-danger); }
.btn-link.warn { color: var(--c-warning); }
.btn-group { display: flex; gap: 8px; flex-wrap: wrap; }

/* ============================ 主框架 ============================ */
.app-layout { display: flex; min-height: 100vh; }
.sidebar {
  width: var(--sidebar-w); flex: 0 0 var(--sidebar-w);
  background: var(--c-sidebar-bg); color: var(--c-sidebar-text);
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0; left: 0; z-index: 50;
}
.sidebar-brand {
  height: var(--header-h); display: flex; align-items: center; gap: 9px;
  padding: 0 16px; border-bottom: 1px solid rgba(255,255,255,.08);
  color: #fff; font-weight: 600; font-size: 14.5px; letter-spacing: .3px;
}
.sidebar-brand .mark {
  width: 26px; height: 26px; border-radius: 7px; flex: 0 0 26px;
  background: var(--c-primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 14px; font-weight: 700;
}
/* 品牌 logo（用户提供的云海潮圆形标识）：侧边栏白底圆标，放在深色底上更醒目 */
.sidebar-brand .brand-logo {
  width: 30px; height: 30px; flex: 0 0 30px; object-fit: contain;
  border-radius: 50%; background: #fff;
  box-shadow: 0 2px 8px rgba(0, 0, 0, .18);
}
.sidebar-brand span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nav-badge {
  margin-left: 6px; min-width: 18px; height: 18px; padding: 0 5px;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 9px; background: var(--c-danger); color: #fff;
  font-size: 11px; font-weight: 700; line-height: 1;
}
.sidebar-nav { flex: 1; overflow-y: auto; padding: 10px 0 20px; }
.nav-group-title {
  padding: 12px 16px 6px; font-size: 11px; letter-spacing: 1px;
  color: rgba(255,255,255,.35); text-transform: uppercase;
}
.nav-item {
  display: flex; align-items: center; gap: 10px;
  margin: 2px 8px; padding: 9px 12px; border-radius: var(--c-radius-sm);
  color: var(--c-sidebar-text); cursor: pointer; font-size: 13.5px;
  transition: background .15s, color .15s;
}
.nav-item:hover { background: rgba(255,255,255,.07); color: #fff; }
.nav-item.active { background: var(--c-sidebar-active-bg); color: var(--c-sidebar-active-text); font-weight: 500; }
.nav-item .ico { width: 18px; text-align: center; flex: 0 0 18px; font-size: 15px; }
.sidebar-foot {
  padding: 12px 14px; border-top: 1px solid rgba(255,255,255,.08);
  font-size: 11.5px; color: rgba(255,255,255,.45); line-height: 1.7;
}

.main { flex: 1; margin-left: var(--sidebar-w); display: flex; flex-direction: column; min-width: 0; }
.topbar {
  height: var(--header-h); background: var(--c-header-bg); color: var(--c-header-text);
  border-bottom: 1px solid var(--c-border);
  display: flex; align-items: center; justify-content: space-between;
  padding: 0 22px; position: sticky; top: 0; z-index: 40;
}
.topbar-left { display: flex; align-items: center; gap: 12px; min-width: 0; }
/* 页面大标题在顶栏居中（2026-09-27 用户要求试试）；窄屏收窄时回退靠左，避免与右侧用户区重叠 */
.page-title {
  font-size: 16px; font-weight: 600;
  position: absolute; left: 50%; transform: translateX(-50%);
  white-space: nowrap; pointer-events: none;
}
@media (max-width: 1100px) {
  .page-title { position: static; transform: none; }
}
.crumb { font-size: 12.5px; color: var(--c-text-muted); }
.topbar-right { display: flex; align-items: center; gap: 14px; }
.user-chip { display: flex; align-items: center; gap: 9px; cursor: pointer; padding: 5px 8px; border-radius: var(--c-radius-sm); }
.user-chip:hover { background: var(--c-surface-alt); }
.avatar {
  width: 30px; height: 30px; border-radius: 50%; background: var(--c-primary);
  color: var(--c-text-on-primary); display: flex; align-items: center; justify-content: center;
  font-size: 13px; font-weight: 600; flex: 0 0 30px;
}
.user-meta { line-height: 1.3; }
.user-meta .u-name { font-size: 13px; font-weight: 500; }
.user-meta .u-role { font-size: 11.5px; color: var(--c-text-muted); }
.content { padding: 20px 22px 40px; flex: 1; }

/* ============================ 卡片 / 区块 ============================ */
.card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--c-radius); box-shadow: var(--shadow-1); margin-bottom: 16px;
}
.card-head {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; padding: 14px 18px; border-bottom: 1px solid var(--c-border); flex-wrap: wrap;
}
.card-title { font-size: 14.5px; font-weight: 600; display: flex; align-items: center; gap: 8px; }
.card-title .dot { width: 3px; height: 14px; border-radius: 2px; background: var(--c-primary); }
.card-body { padding: 16px 18px; }
.card-body.tight { padding: 0; }

.stat-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(190px, 1fr)); gap: 14px; margin-bottom: 16px; }
.stat-card {
  background: var(--c-surface); border: 1px solid var(--c-border);
  border-radius: var(--c-radius); padding: 15px 17px; box-shadow: var(--shadow-1);
  position: relative; overflow: hidden;
}
.stat-card .label { font-size: 12.5px; color: var(--c-text-sub); }
.stat-card .value { font-size: 26px; font-weight: 700; margin-top: 6px; letter-spacing: -.5px; }
.stat-card .sub { font-size: 12px; color: var(--c-text-muted); margin-top: 4px; }
.stat-card .bar { position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--c-primary); }
.stat-card.c-warn .value { color: var(--c-warning); }
.stat-card.c-danger .value { color: var(--c-danger); }
.stat-card.c-success .value { color: var(--c-success); }
.stat-card.c-warn .bar { background: var(--c-warning); }
.stat-card.c-danger .bar { background: var(--c-danger); }
.stat-card.c-success .bar { background: var(--c-success); }

/* ============================ 表格 ============================ */
/* 表头吸顶（2026-11-01 用户要求）：往上滚时表头不动，只滚数据行。
   做法：让表格容器成为滚动区域并限制高度，thead 用 sticky 贴在容器顶部。
   注意不能只给 th 加 sticky 而容器仍 overflow-x:auto——那样容器高度=内容高度、
   没有纵向滚动，sticky 不会生效。 */
.table-wrap {
  width: 100%;
  overflow: auto;
  max-height: calc(100vh - var(--header-h) - var(--table-top-offset, 150px));
  overscroll-behavior: contain;
}
table.table thead th {
  position: sticky;
  top: 0;
  z-index: 6;
  background: var(--c-table-head-bg);
  /* border-collapse 下 sticky 表头的下边框会随滚动闪没，用内阴影补一条实线 */
  box-shadow: inset 0 -1px 0 var(--c-border);
}
table.table { width: 100%; border-collapse: collapse; font-size: 13.5px; }
table.table th {
  background: var(--c-table-head-bg); color: var(--c-text-sub);
  font-weight: 600; text-align: left; padding: 10px 12px;
  border-bottom: 1px solid var(--c-border); font-size: 13px;
}
table.table td { padding: 10px 12px; border-bottom: 1px solid var(--c-border); vertical-align: middle; word-break: break-word; }
table.table tbody tr:nth-child(even) { background: var(--c-table-stripe); }
table.table tbody tr:hover { background: var(--c-table-hover); }
table.table tr.total-row td { background: var(--c-primary-soft); font-weight: 600; }
table.table td.nowrap, table.table th.nowrap { white-space: nowrap; }
table.table td.num { text-align: right; font-variant-numeric: tabular-nums; }
/* 居中列（如「数量」）：短内容居中，与左右邻列距离对称 */
table.table td.ctr, table.table th.ctr { text-align: center; }
/* 数值列的表头必须跟单元格同样右对齐，否则表头与数字上下错位 */
table.table th.num { text-align: right; font-variant-numeric: tabular-nums; }
/* 均匀列宽（WMS.table 自动生成 colgroup + 固定布局）：长内容在格内折行，不挤压相邻列 */
table.table.fixed { table-layout: fixed; }
table.table.fixed th { position: relative; }
/* 吸顶优先于列宽拖柄的 relative：sticky 同样是定位元素，.col-resizer 仍以 th 为定位锚点 */
table.table.fixed thead th { position: sticky; }
table.table.fixed th, table.table.fixed td { overflow-wrap: anywhere; padding-left: 10px; padding-right: 10px; }
/* 列宽拖柄：贴在表头右缘，拖动调整列宽，双击恢复默认 */
.col-resizer { position: absolute; top: 0; right: 0; bottom: 0; width: 9px; cursor: col-resize; user-select: none; touch-action: none; }
body.col-resizing { cursor: col-resize !important; user-select: none !important; }
body.col-resizing * { cursor: col-resize !important; user-select: none !important; }
.col-resizer::after { content: ''; position: absolute; top: 20%; bottom: 20%; right: 3px; width: 2px; border-radius: 1px; background: transparent; }
.col-resizer:hover::after, .col-resizer:active::after { background: var(--c-primary); }
table.table.fixed td.nowrap, table.table.fixed th.nowrap { overflow-wrap: normal; }
/* 窄窗口自适应：窗口变小时缩小字号与内边距，文字自动换行不撑破布局
   （表单栅格的窄屏折叠已有 1100px 断点统一处理，这里只管表格） */
@media (max-width: 960px) {
  table.table { font-size: 12.5px; }
  table.table th { font-size: 12px; padding: 8px 8px; }
  table.table td { padding: 8px; }
}
@media (max-width: 620px) {
  table.table { font-size: 12px; }
  table.table th { padding: 7px 6px; }
  table.table td { padding: 7px 6px; }
}
.empty { padding: 40px 20px; text-align: center; color: var(--c-text-muted); font-size: 13.5px; }
.empty .big { font-size: 30px; display: block; margin-bottom: 10px; opacity: .45; }

/* ============================ 徽标 ============================ */
.badge {
  display: inline-block; padding: 2px 8px; border-radius: 20px;
  font-size: 12px; line-height: 1.7; white-space: nowrap;
  background: var(--c-surface-alt); color: var(--c-text-sub); border: 1px solid var(--c-border);
}
.badge.b-primary { background: var(--c-primary-soft); color: var(--c-primary); border-color: transparent; }
.badge.b-success { background: rgba(18,161,80,.11); color: var(--c-success); border-color: transparent; }
.badge.b-warning { background: rgba(224,138,0,.13); color: var(--c-warning); border-color: transparent; }
.badge.b-danger { background: rgba(224,52,43,.11); color: var(--c-danger); border-color: transparent; }
.badge.b-info { background: var(--c-secondary-soft); color: var(--c-secondary); border-color: transparent; }
.badge.b-muted { background: var(--c-surface-alt); color: var(--c-text-muted); }
.tag-dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; margin-right: 5px; vertical-align: middle; }

/* ============================ 工具条 / 筛选 ============================ */
.toolbar {
  display: flex; flex-wrap: wrap; gap: 10px; align-items: flex-end;
  padding: 14px 18px; border-bottom: 1px solid var(--c-border); background: var(--c-surface);
}
.toolbar .fi { display: flex; flex-direction: column; gap: 5px; }
.toolbar .fi > label { font-size: 12px; color: var(--c-text-sub); }
.toolbar .input, .toolbar .select { min-width: 130px; padding: 7px 10px; }
.toolbar .grow { flex: 1; min-width: 160px; }
.toolbar .spacer { flex: 1; }
.toolbar-actions { display: flex; gap: 8px; align-items: flex-end; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--c-border); padding: 0 18px; background: var(--c-surface); }
.tab {
  padding: 11px 16px; cursor: pointer; font-size: 13.5px; color: var(--c-text-sub);
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.tab:hover { color: var(--c-primary); }
.tab.active { color: var(--c-primary); border-bottom-color: var(--c-primary); font-weight: 600; }

.pager { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 12px 18px; flex-wrap: wrap; }
.pager .info { font-size: 13px; color: var(--c-text-sub); }
.pager .pages { display: flex; gap: 6px; align-items: center; }
.pager .pg {
  min-width: 32px; height: 30px; padding: 0 8px; border: 1px solid var(--c-border);
  background: var(--c-surface); border-radius: var(--c-radius-sm); cursor: pointer; color: var(--c-text);
}
.pager .pg.active { background: var(--c-primary); border-color: var(--c-primary); color: var(--c-text-on-primary); }
.pager .pg:disabled { opacity: .45; cursor: not-allowed; }

/* ============================ 弹窗 ============================ */
.modal-mask {
  position: fixed; inset: 0; background: rgba(16, 26, 44, .48);
  display: flex; align-items: flex-start; justify-content: center;
  z-index: 200; padding: 46px 20px; overflow-y: auto;
}
.modal {
  background: var(--c-surface); border-radius: 10px; box-shadow: var(--shadow-2);
  width: 620px; max-width: 100%; animation: pop .16s ease-out;
}
.modal.wide { width: 900px; }
.modal.narrow { width: 420px; }
@keyframes pop { from { opacity: 0; transform: translateY(-8px); } to { opacity: 1; transform: none; } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 15px 20px; border-bottom: 1px solid var(--c-border);
}
.modal-head h3 { font-size: 15px; }
.modal-close { background: none; border: none; font-size: 20px; line-height: 1; color: var(--c-text-muted); cursor: pointer; }
.modal-close:hover { color: var(--c-danger); }
.modal-body { padding: 18px 20px; max-height: 66vh; overflow-y: auto; }
.modal-foot { padding: 13px 20px; border-top: 1px solid var(--c-border); display: flex; justify-content: flex-end; gap: 10px; }

/* ============================ 提示 ============================ */
.toast-box { position: fixed; top: 18px; left: 50%; transform: translateX(-50%); z-index: 400; display: flex; flex-direction: column; gap: 9px; align-items: center; }
.toast {
  min-width: 200px; max-width: 520px; padding: 11px 18px; border-radius: var(--c-radius-sm);
  background: var(--c-surface); box-shadow: var(--shadow-2); border: 1px solid var(--c-border);
  font-size: 13.5px; animation: drop .18s ease-out; display: flex; align-items: center; gap: 9px;
}
@keyframes drop { from { opacity: 0; transform: translateY(-14px); } to { opacity: 1; transform: none; } }
.toast.ok { border-left: 3px solid var(--c-success); }
.toast.err { border-left: 3px solid var(--c-danger); }
.toast.info { border-left: 3px solid var(--c-info); }
.toast.warn { border-left: 3px solid var(--c-warning); }

.alert {
  padding: 11px 14px; border-radius: var(--c-radius-sm); font-size: 13px; line-height: 1.7;
  margin-bottom: 14px; border: 1px solid transparent;
}
.alert-info { background: var(--c-primary-soft); color: var(--c-primary); }
.alert-warn { background: rgba(224,138,0,.1); color: var(--c-warning); border-color: rgba(224,138,0,.25); }
.alert-danger { background: rgba(224,52,43,.08); color: var(--c-danger); border-color: rgba(224,52,43,.22); }
.alert-success { background: rgba(18,161,80,.09); color: var(--c-success); border-color: rgba(18,161,80,.22); }

/* ============================ 进度 / 图表（纯 CSS 条形） ============================ */
.bars { display: flex; align-items: flex-end; gap: 10px; height: 150px; padding: 4px 2px 0; }
.bars .b-col { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 6px; height: 100%; justify-content: flex-end; }
.bars .b-bar {
  width: 100%; max-width: 46px; border-radius: 5px 5px 0 0;
  background: linear-gradient(180deg, var(--c-primary-hover), var(--c-primary));
  min-height: 3px; transition: height .3s;
}
.bars .b-val { font-size: 12px; font-weight: 600; color: var(--c-text-sub); }
.bars .b-lab { font-size: 11.5px; color: var(--c-text-muted); white-space: nowrap; }

.bar-line { height: 7px; border-radius: 4px; background: var(--c-surface-alt); overflow: hidden; min-width: 60px; }
.bar-line > i { display: block; height: 100%; background: var(--c-primary); border-radius: 4px; }
.bar-line > i.warn { background: var(--c-warning); }
.bar-line > i.danger { background: var(--c-danger); }

/* ============================ 分仓可视化 ============================ */
.wh-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(130px, 1fr)); gap: 7px; }
.wh-cell {
  border: 1px solid var(--c-border); border-radius: var(--c-radius-sm);
  padding: 6px 9px; cursor: pointer; font-size: 12.5px; background: var(--c-surface);
  display: flex; align-items: center; justify-content: space-between; gap: 6px;
  transition: all .12s;
}
.wh-cell:hover { border-color: var(--c-primary); }
.wh-cell .p { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.wh-cell.south { border-left: 3px solid var(--c-primary); }
.wh-cell.north { border-left: 3px solid var(--c-secondary); }
.wh-cell .w { font-size: 11px; padding: 1px 6px; border-radius: 10px; }
.wh-cell.south .w { background: var(--c-primary-soft); color: var(--c-primary); }
.wh-cell.north .w { background: var(--c-secondary-soft); color: var(--c-secondary); }
/* 勾选态：整块高亮，便于确认批量设置的范围 */
.wh-cell.is-checked { border-color: var(--c-primary); background: var(--c-primary-soft); box-shadow: 0 0 0 1px var(--c-primary) inset; }
.wh-cell input[type=checkbox] { flex: 0 0 auto; cursor: pointer; }

/* ---- 省份分仓规则页：卡片改成上下两行，保证省份名完整可读 ---- */
.pv-bar {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  padding: 12px 14px; margin-bottom: 12px;
  border: 1px solid var(--c-border); border-radius: var(--c-radius-sm);
  background: var(--c-surface-alt);
}
.pv-bar-item { display: flex; align-items: center; gap: 8px; }
.pv-bar-label { font-size: 12.5px; color: var(--c-text-sub); white-space: nowrap; font-weight: 500; }
.pv-bar-arrow { color: var(--c-text-muted); font-size: 15px; }
.pv-bar-grow { flex: 1 1 16px; }
/* .select 默认 width:100%，在横向 flex 条里会撑坏布局，这里改回按内容宽度 */
.pv-bar .select { width: auto; min-width: 118px; padding: 7px 10px; }
.pv-count { font-size: 13px; color: var(--c-text-sub); white-space: nowrap; }
.pv-count b { color: var(--c-primary); font-size: 14.5px; }
.pv-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(158px, 1fr)); gap: 8px; }
.pv-cell {
  flex-direction: column; align-items: stretch; justify-content: flex-start;
  gap: 5px; padding: 9px 11px;
}
.pv-pick { display: flex; align-items: center; gap: 7px; cursor: pointer; min-width: 0; }
.pv-name { font-size: 13.5px; font-weight: 500; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pv-wh {
  align-self: flex-start; max-width: 100%;
  font-size: 11px; line-height: 1.7; padding: 1px 8px; border-radius: 10px;
  background: var(--c-primary-soft); color: var(--c-primary);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.pv-cell.north .pv-wh { background: var(--c-secondary-soft); color: var(--c-secondary); }

/* ============================ 配色预览 ============================ */
.color-row { display: grid; grid-template-columns: 130px 52px 1fr auto; gap: 10px; align-items: center; padding: 6px 0; }
.color-row label { font-size: 13px; color: var(--c-text-sub); }
.color-row input[type=color] { width: 46px; height: 30px; padding: 0; border: 1px solid var(--c-border); border-radius: 5px; background: none; cursor: pointer; }
.color-row input[type=text] { padding: 6px 9px; font-size: 12.5px; font-family: ui-monospace, Menlo, Consolas, monospace; }
.preset-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(150px, 1fr)); gap: 10px; }
.preset {
  border: 1px solid var(--c-border); border-radius: var(--c-radius-sm); padding: 9px 11px;
  cursor: pointer; display: flex; align-items: center; gap: 9px; font-size: 13px;
}
.preset:hover { border-color: var(--c-primary); }
.preset .sw { display: flex; gap: 3px; }
.preset .sw i { width: 13px; height: 13px; border-radius: 3px; display: block; }

/* ============================ 订单明细行 ============================ */
.item-rows { border: 1px solid var(--c-border); border-radius: var(--c-radius-sm); overflow: hidden; }
.item-row { display: grid; grid-template-columns: 1.2fr 1.6fr 1fr .7fr .6fr auto; gap: 8px; padding: 8px; align-items: center; border-bottom: 1px solid var(--c-border); }
.item-row:last-child { border-bottom: none; }
.item-row.head { background: var(--c-table-head-bg); font-size: 12.5px; color: var(--c-text-sub); font-weight: 600; }
.item-row .input { padding: 6px 9px; }
/* 录单时多两列价格（标准价 / 实收单价），只有管理员看得到 */
.item-row.with-price { grid-template-columns: 1.1fr 1.5fr .8fr .55fr .5fr .8fr .8fr auto; }

/* 商品模糊搜索下拉（录单表单的商品名称 / SKU 输入框）。
   position:fixed 由 JS 按输入框视口坐标定位，z-index 高于弹窗层(200)，保证永远浮在最上层 */
.ac-menu {
  position: fixed; z-index: 300;
  background: var(--c-surface); border: 1px solid var(--c-border); border-radius: 8px;
  box-shadow: 0 10px 28px rgba(15, 35, 70, .16);
  max-height: 240px; overflow: auto; display: none;
}
.ac-item {
  display: flex; justify-content: space-between; align-items: center; gap: 12px;
  padding: 8px 12px; font-size: 13px; cursor: pointer;
}
.ac-item + .ac-item { border-top: 1px solid var(--c-surface-alt); }
.ac-item b { font-weight: 600; color: var(--c-text); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.ac-item span { font-size: 12px; color: var(--c-text-muted); white-space: nowrap; }
.ac-item:hover, .ac-item.active { background: var(--c-primary-soft); }
.order-detail-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 0 18px; }
.kv { display: flex; gap: 8px; padding: 7px 0; border-bottom: 1px dashed var(--c-border); font-size: 13.5px; }
.kv .k { color: var(--c-text-sub); flex: 0 0 88px; }
.kv .v { flex: 1; word-break: break-all; }

.mono { font-family: ui-monospace, Menlo, Consolas, monospace; font-size: 12.5px; }
.muted { color: var(--c-text-muted); }
.sub { color: var(--c-text-sub); }
.fs12 { font-size: 12px; }
.fs13 { font-size: 13px; }
.mt8 { margin-top: 8px; } .mt12 { margin-top: 12px; } .mt16 { margin-top: 16px; }
.mb8 { margin-bottom: 8px; } .mb12 { margin-bottom: 12px; }
.flex { display: flex; } .between { justify-content: space-between; } .center { align-items: center; }
.gap8 { gap: 8px; } .gap12 { gap: 12px; }
.right { text-align: right; }
.hidden { display: none !important; }
.clamp2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* 占位骨架 */
.skeleton { background: linear-gradient(90deg, var(--c-surface-alt) 25%, var(--c-bg) 37%, var(--c-surface-alt) 63%); background-size: 400% 100%; animation: sk 1.2s ease infinite; border-radius: 5px; }
@keyframes sk { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------------- 系统升级页 ---------------- */
.up-ver { display: flex; align-items: center; gap: 20px; flex-wrap: wrap; }
.up-ver-num {
  font-size: 30px; font-weight: 700; line-height: 1;
  color: var(--c-primary); padding: 10px 18px;
  background: var(--c-primary-soft); border-radius: 10px; letter-spacing: .5px;
}
.up-ver-meta { display: flex; flex-direction: column; gap: 5px; font-size: 13px; color: var(--c-text-sub); }
.up-ver-meta span::before { content: '·'; margin-right: 6px; color: var(--c-border); }

.up-drop {
  border: 2px dashed var(--c-border); border-radius: 10px;
  padding: 26px 18px; text-align: center; cursor: pointer;
  background: var(--c-surface-alt); transition: border-color .15s, background .15s;
}
.up-drop:hover, .up-drop.dragging { border-color: var(--c-primary); background: var(--c-primary-soft); }
.up-drop.has-file { border-style: solid; border-color: var(--c-success); background: rgba(18,161,80,.06); }
.up-drop-icon { font-size: 30px; line-height: 1; margin-bottom: 8px; }
.up-drop-text { font-size: 13px; color: var(--c-text-sub); word-break: break-all; }
.up-drop.has-file .up-drop-text { color: var(--c-text); }

@media (max-width: 1100px) {
  .stat-grid { grid-template-columns: repeat(auto-fit, minmax(160px, 1fr)); }
  .form-grid, .form-grid-3, .order-detail-grid { grid-template-columns: 1fr; }
  .form-grid .span2, .form-grid-3 .span2, .form-grid-3 .span3 { grid-column: span 1; }
}

/* ==========================================================================
   v1.8 视觉升级 · A 阶段（轻量美化：图标 / 层级 / 表格 / 登录页）
   —— 仅覆盖视觉，不改任何布局结构与业务交互
   ========================================================================== */
:root {
  --c-border: #e6ebf2;
  --c-surface-alt: #f7f9fc;
  --c-table-head-bg: #f7f9fc;
  --c-table-stripe: #f0f6fd;
  --c-table-hover: #f4f8ff;
  --c-radius: 10px;
  --c-radius-sm: 8px;
  --sidebar-w: 220px;
  --header-h: 58px;
  --shadow-1: 0 1px 2px rgba(16, 30, 54, .04), 0 10px 24px -18px rgba(16, 30, 54, .35);
  --shadow-2: 0 18px 48px -12px rgba(10, 25, 46, .28);
}

/* ---------- 侧边栏 ---------- */
.sidebar {
  background: var(--c-sidebar-bg);
  border-right: 1px solid rgba(15, 32, 56, .06);
}
.sidebar-brand { padding: 0 18px; font-size: 14px; letter-spacing: .2px; }
.sidebar-brand .brand-logo { width: 28px; height: 28px; flex: 0 0 28px; }
.sidebar-nav { padding: 6px 0 16px; }
.nav-group-title {
  padding: 16px 20px 6px; font-size: 10.5px; letter-spacing: 1.6px;
  color: rgba(255, 255, 255, .34);
}
.nav-item {
  margin: 2px 10px; padding: 9px 12px; border-radius: 8px;
  font-size: 13px; gap: 10px; color: var(--c-sidebar-text);
}
.nav-item:hover { background: rgba(255, 255, 255, .06); color: #fff; }
.nav-item.active {
  background: var(--c-sidebar-active-bg); color: var(--c-sidebar-active-text); font-weight: 500;
  box-shadow: 0 8px 18px -8px rgba(22, 104, 220, .8), inset 3px 0 0 rgba(255, 255, 255, .55);
}
.nav-item .ico {
  width: 18px; height: 18px; flex: 0 0 18px;
  display: flex; align-items: center; justify-content: center; opacity: .82;
}
.nav-item.active .ico { opacity: 1; }
.svg-ico { width: 18px; height: 18px; display: block; }
.nav-badge { margin-left: auto; height: 17px; min-width: 17px; font-size: 10.5px; }
.sidebar-foot {
  padding: 14px 18px; font-size: 11px; line-height: 1.65;
  color: rgba(255, 255, 255, .42); border-top-color: rgba(255, 255, 255, .07);
}

/* ---------- 顶栏 ---------- */
.topbar { padding: 0 24px; box-shadow: 0 1px 0 rgba(16, 30, 54, .03); }
.topbar-left {
  flex-direction: column; align-items: flex-start; justify-content: center;
  gap: 1px; min-width: 0;
}
.page-title {
  position: static; left: auto; transform: none;
  font-size: 15.5px; font-weight: 600; line-height: 1.25; letter-spacing: .2px;
}
.crumb { font-size: 11.5px; color: var(--c-text-muted); line-height: 1.2; }
.user-chip { padding: 4px 8px; border-radius: 8px; }
.avatar {
  width: 32px; height: 32px; flex: 0 0 32px; font-size: 13px;
  background: linear-gradient(135deg, var(--c-primary-hover), var(--c-primary));
  box-shadow: 0 4px 10px -4px rgba(22, 104, 220, .6);
}
.content { padding: 22px 24px 44px; }

/* ---------- 卡片 ---------- */
.card {
  border-color: #e7ecf3; border-radius: 12px;
  box-shadow: 0 1px 2px rgba(16, 30, 54, .04), 0 12px 28px -22px rgba(16, 30, 54, .4);
}
.card-head { padding: 14px 20px; min-height: 52px; border-bottom-color: #eef2f7; }
.card-title { font-size: 14px; letter-spacing: .1px; }
.card-title .dot { height: 15px; border-radius: 2px; }
.card-body { padding: 18px 20px; }

/* ---------- 表格 ---------- */
table.table th {
  padding: 10px 12px; font-size: 12px; font-weight: 600;
  color: #6b7a90; letter-spacing: .02em;
  background: var(--c-table-head-bg); border-bottom: 1px solid #e6ebf2;
}
table.table td { padding: 11px 12px; font-size: 13px; border-bottom: 1px solid #f1f4f9; }
table.table tbody tr:nth-child(even) { background: var(--c-table-stripe); }
table.table tbody tr:hover { background: var(--c-table-hover); }
table.table tbody tr:last-child td { border-bottom: none; }

/* ---------- 状态标签 ---------- */
.badge {
  padding: 2px 8px; border-radius: 6px; font-size: 11.5px; font-weight: 500;
  line-height: 1.65;
}
.badge.b-primary { background: #e9f2ff; color: #1257bd; }
.badge.b-success { background: #e7f6ed; color: #0d7a3e; }
.badge.b-warning { background: #fdf3e2; color: #a35f00; }
.badge.b-danger { background: #fdecea; color: #c02a22; }
.badge.b-info { background: #e6f7f5; color: #0b7d72; }

/* ---------- 按钮 / 表单 ---------- */
.btn { min-height: 36px; padding: 7px 14px; font-size: 13.5px; border-radius: 8px; }
.btn-primary {
  box-shadow: 0 4px 10px -6px rgba(22, 104, 220, .75);
}
.btn-sm { min-height: 30px; padding: 5px 11px; font-size: 12.5px; }
.btn-xs { min-height: 26px; padding: 3px 8px; }
.input, .select, .textarea { min-height: 38px; border-radius: 8px; }
.input-lg { min-height: 44px; font-size: 14.5px; }
.field > label { font-size: 12.5px; color: #5d6b82; }

/* ---------- 统计卡 ---------- */
.stat-card {
  border-radius: 12px; padding: 17px 18px;
  transition: transform .15s, box-shadow .15s;
}
.stat-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 2px 4px rgba(16, 30, 54, .05), 0 14px 30px -18px rgba(16, 30, 54, .45);
}
.stat-card .label { font-size: 12.5px; color: #6b7a90; }
.stat-card .value { font-size: 28px; margin-top: 7px; letter-spacing: -.8px; }
.stat-card .sub { font-size: 11.5px; }

/* ---------- 登录页 ---------- */
.login-wrap {
  background:
    radial-gradient(880px 520px at 12% 8%, rgba(60, 137, 232, .38), transparent 62%),
    radial-gradient(720px 520px at 88% 92%, rgba(13, 148, 136, .26), transparent 60%),
    linear-gradient(135deg, #0c1e33 0%, #103a68 56%, #1668dc 100%);
}
.login-card {
  width: 408px; border-radius: 18px; padding: 40px 36px 30px;
  box-shadow: 0 30px 70px -24px rgba(3, 16, 34, .65);
  position: relative; overflow: hidden;
}
.login-card::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, var(--c-primary), var(--c-secondary));
}
.login-brand { margin-bottom: 24px; }
.login-logo { width: 72px; height: 72px; margin-bottom: 14px; }
.login-title { font-size: 20px; letter-spacing: .4px; }
.login-sub { font-size: 12px; margin-top: 7px; }
.login-card .input-lg { min-height: 44px; font-size: 14px; }
.login-card .btn-block { min-height: 44px; font-size: 15px; letter-spacing: 2px; }
.login-footer {
  margin-top: 22px; text-align: center; font-size: 11px;
  color: var(--c-text-muted); letter-spacing: .3px;
}

/* ---------- 加载骨架 ---------- */
.page-skeleton { padding: 6px 0; }
.page-skeleton .sk {
  display: block; border-radius: 8px; margin-bottom: 16px;
  background: linear-gradient(90deg, #eef2f7 25%, #f8fafc 37%, #eef2f7 63%);
  background-size: 400% 100%; animation: skShimmer 1.2s ease infinite;
}
.page-skeleton .sk-title { width: 200px; height: 22px; }
.page-skeleton .sk-line { width: 100%; height: 14px; }
.page-skeleton .sk-block { width: 100%; height: 168px; }
@keyframes skShimmer { 0% { background-position: 100% 50%; } 100% { background-position: 0 50%; } }

/* ---------- 空状态 ---------- */
.empty { padding: 52px 20px; font-size: 13px; color: var(--c-text-muted); }
.empty .big { font-size: 26px; margin-bottom: 8px; opacity: .35; }

/* ==========================================================================
   v1.8 视觉升级 · B 阶段（工作台重构：主卡 + KPI + 分仓库存 + 可操作待办）
   ========================================================================== */
.dash-top {
  display: grid; grid-template-columns: minmax(0, 1.75fr) minmax(300px, 1fr);
  gap: 16px; margin-bottom: 16px; align-items: stretch;
}

/* ---------- 主卡（今日订单 + 7 天趋势） ---------- */
.hero-card {
  border: none; color: #fff; padding: 20px 22px 16px; position: relative; overflow: hidden;
  background: linear-gradient(135deg, #0e3563 0%, #14589f 46%, #1d74d8 100%);
  box-shadow: 0 18px 38px -22px rgba(13, 60, 120, .8);
}
.hero-card::after {
  content: ''; position: absolute; right: -70px; top: -80px; width: 260px; height: 260px;
  border-radius: 50%; pointer-events: none;
  background: radial-gradient(circle, rgba(255, 255, 255, .18), transparent 70%);
}
.hero-head { display: flex; justify-content: space-between; align-items: flex-start; gap: 16px; position: relative; z-index: 1; }
.hero-label { font-size: 12.5px; color: rgba(255, 255, 255, .72); letter-spacing: .3px; }
.hero-value { font-size: 42px; font-weight: 700; line-height: 1.08; margin-top: 6px; letter-spacing: -1.6px; }
.hero-delta { font-size: 12px; color: rgba(255, 255, 255, .7); margin-top: 4px; }
.hero-delta .up { color: #8ff0c0; font-weight: 600; }
.hero-delta .down { color: #ffb3ad; font-weight: 600; }
.hero-delta .muted { color: rgba(255, 255, 255, .55); }
.hero-badge {
  font-size: 11.5px; padding: 5px 11px; border-radius: 20px; white-space: nowrap;
  background: rgba(255, 255, 255, .14); border: 1px solid rgba(255, 255, 255, .22); color: #fff;
}

.trend-chart {
  display: flex; gap: 8px; align-items: flex-end; height: 128px; margin-top: 14px;
  position: relative; z-index: 1; border-radius: 4px;
  background: repeating-linear-gradient(to top, rgba(255, 255, 255, .10) 0 1px, transparent 1px 42px);
}
.tc-col { flex: 1; min-width: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: flex-end; gap: 4px; }
.tc-val { font-size: 11px; font-weight: 600; color: rgba(255, 255, 255, .82); }
.tc-track { flex: 1; width: 100%; display: flex; align-items: flex-end; justify-content: center; }
.tc-bar {
  width: 58%; max-width: 34px; min-width: 10px; border-radius: 6px 6px 2px 2px;
  background: linear-gradient(180deg, #ffffff, rgba(255, 255, 255, .58));
  box-shadow: 0 -2px 12px rgba(255, 255, 255, .28); transition: height .3s;
}
.tc-lab { font-size: 10.5px; color: rgba(255, 255, 255, .6); white-space: nowrap; }
.hero-foot {
  display: flex; gap: 18px; flex-wrap: wrap; margin-top: 12px; padding-top: 12px;
  border-top: 1px solid rgba(255, 255, 255, .16);
  font-size: 11.5px; color: rgba(255, 255, 255, .68);
}
.hero-foot b { color: #fff; font-weight: 600; }
.hero-pull { margin-left: auto; }

/* ---------- KPI 2×2 ---------- */
.kpi-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.kpi {
  position: relative; overflow: hidden; text-decoration: none; color: inherit;
  background: var(--c-surface); border: 1px solid #e7ecf3; border-radius: 12px;
  padding: 14px 16px 13px;
  box-shadow: 0 1px 2px rgba(16, 30, 54, .04), 0 12px 26px -22px rgba(16, 30, 54, .45);
  transition: transform .15s, box-shadow .15s, border-color .15s;
}
.kpi::before {
  content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px;
  border-radius: 2px; background: var(--c-primary);
}
.kpi.k-warn::before { background: var(--c-warning); }
.kpi.k-danger::before { background: var(--c-danger); }
.kpi:hover {
  transform: translateY(-2px); border-color: #d6e2f3; text-decoration: none;
  box-shadow: 0 2px 4px rgba(16, 30, 54, .05), 0 16px 32px -20px rgba(16, 30, 54, .5);
}
.kpi-label { font-size: 12.5px; color: var(--c-text-sub); }
.kpi-value { font-size: 26px; font-weight: 700; margin-top: 4px; letter-spacing: -.6px; }
.kpi.k-warn .kpi-value { color: var(--c-warning); }
.kpi.k-danger .kpi-value { color: var(--c-danger); }
.kpi.is-zero .kpi-value { color: var(--c-text-muted); }
.kpi-hint { font-size: 11px; color: var(--c-text-muted); margin-top: 2px; }
.kpi-arrow { position: absolute; right: 12px; bottom: 10px; color: var(--c-text-muted); opacity: .55; font-size: 14px; }

/* ---------- 分仓库存 ---------- */
.stock-card { margin-bottom: 16px; }
.stock-strip { display: flex; flex-wrap: wrap; }
.stock-item { flex: 1; min-width: 150px; padding: 2px 18px; border-left: 1px solid var(--c-border); }
.stock-item:first-child { border-left: none; padding-left: 2px; }
.si-name { font-size: 12px; color: var(--c-text-sub); }
.si-qty { font-size: 22px; font-weight: 700; margin-top: 2px; letter-spacing: -.5px; }
.si-qty span { font-size: 11px; font-weight: 400; color: var(--c-text-muted); margin-left: 3px; }
.si-sub { font-size: 11px; color: var(--c-text-muted); }

/* ---------- 待办列表 ---------- */
.todo-list { display: flex; flex-direction: column; gap: 8px; }
.todo-row {
  display: flex; align-items: center; justify-content: space-between; gap: 10px;
  padding: 9px 12px; border: 1px solid var(--c-border); border-radius: 8px;
  background: var(--c-surface-alt); text-decoration: none; color: var(--c-text); font-size: 12.5px;
  transition: border-color .15s, background .15s;
}
.todo-row:hover { border-color: var(--c-primary); background: var(--c-primary-soft); text-decoration: none; }
.todo-row.is-zero { color: var(--c-text-muted); }
.todo-n {
  min-width: 22px; height: 22px; padding: 0 7px; border-radius: 11px;
  display: inline-flex; align-items: center; justify-content: center;
  background: var(--c-primary-soft); color: var(--c-primary); font-size: 11.5px; font-weight: 600;
}
.todo-row.is-zero .todo-n { background: var(--c-surface-alt); color: var(--c-text-muted); }

.card-link { font-size: 12px; color: var(--c-primary); text-decoration: none; }
.card-link:hover { text-decoration: underline; }

@media (max-width: 1100px) {
  .dash-top { grid-template-columns: 1fr; }
  .hero-value { font-size: 36px; }
}
@media (max-width: 620px) {
  .kpi-grid { grid-template-columns: 1fr; }
  .hero-pull { margin-left: 0; }
  .stock-item { flex: 1 1 100%; border-left: none; padding: 6px 0; border-top: 1px solid #eef2f7; }
  .stock-item:first-child { border-top: none; }
}

.trend-empty {
  height: 100%; display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; color: rgba(255, 255, 255, .55); letter-spacing: .3px;
}

/* KPI 网格：允许列收缩，避免右侧卡片溢出内容区 */
.kpi-grid { grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); }
.kpi { min-width: 0; }
.kpi-label, .kpi-hint { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ==========================================================================
   v1.8.1 轻盈配色
   html.theme-light  → 浅色页面外壳（浅底、白卡、浅色主卡、浅色登录页）
   html.sidebar-light → 浅色侧栏（白底、浅蓝选中）
   深色配色方案（暗夜模式等）不会命中这些规则，仍走上面的经典样式。
   ========================================================================== */

/* ---------- 页面 / 顶栏 / 卡片 ---------- */
html.theme-light body { background: #f4f7fc; }
html.theme-light .topbar {
  background: var(--c-surface);
  border-bottom: 1px solid #eef2f8;
  box-shadow: none;
}
html.theme-light .card {
  border-color: #edf2f9;
  box-shadow: 0 1px 2px rgba(20, 38, 66, .03);
}
html.theme-light .card-head { border-bottom-color: #f1f5fa; }
html.theme-light .stat-card,
html.theme-light .kpi {
  border-color: #edf2f9;
  box-shadow: 0 1px 2px rgba(20, 38, 66, .03);
}
html.theme-light .stat-card:hover,
html.theme-light .kpi:hover {
  border-color: #dfeafa;
  box-shadow: 0 10px 24px -18px rgba(22, 48, 84, .35);
}
html.theme-light .kpi::before { width: 2px; border-radius: 1px; opacity: .9; }

/* ---------- 工作台主卡：浅蓝渐变 + 深色文字 ---------- */
html.theme-light .hero-card {
  background:
    radial-gradient(560px 240px at 92% -10%, var(--c-secondary-soft), transparent 72%),
    linear-gradient(132deg, var(--c-primary-soft) 0%, #ffffff 56%, var(--c-secondary-soft) 100%);
  border: 1px solid var(--c-border);
  color: var(--c-text);
  box-shadow: 0 1px 2px rgba(20, 38, 66, .03);
}
html.theme-light .hero-card::after {
  width: 300px; height: 300px; right: -90px; top: -110px;
  background: radial-gradient(circle, rgba(255, 255, 255, .55), transparent 70%);
}
html.theme-light .hero-label { color: var(--c-text-sub); }
html.theme-light .hero-value { color: var(--c-text); }
html.theme-light .hero-delta { color: var(--c-text-muted); }
html.theme-light .hero-delta .up { color: #0d7a3e; }
html.theme-light .hero-delta .down { color: #c02a22; }
html.theme-light .hero-delta .muted { color: var(--c-text-muted); }
html.theme-light .hero-badge {
  background: #ffffff;
  border: 1px solid var(--c-border);
  color: var(--c-primary);
  box-shadow: 0 1px 2px rgba(20, 38, 66, .03);
}
html.theme-light .trend-chart {
  background: repeating-linear-gradient(to top, rgba(24, 44, 70, .07) 0 1px, transparent 1px 42px);
}
html.theme-light .tc-val { color: var(--c-text-sub); }
html.theme-light .tc-bar {
  background:
    linear-gradient(180deg, rgba(255, 255, 255, .42), rgba(255, 255, 255, 0) 58%),
    var(--c-primary);
  box-shadow: none;
}
html.theme-light .tc-lab { color: var(--c-text-muted); }
html.theme-light .hero-foot {
  border-top: 1px solid var(--c-border);
  color: var(--c-text-muted);
}
html.theme-light .hero-foot b { color: var(--c-text); }
html.theme-light .trend-empty { color: var(--c-text-muted); }
html.theme-light .trend-chart.is-empty {
  background: none;
  border-top: 1px dashed var(--c-border);
  border-bottom: 1px dashed var(--c-border);
}
.trend-chart.is-empty { height: 72px; margin-top: 12px; }
.trend-chart.is-empty .trend-empty { font-size: 12px; }

/* ---------- 侧栏：白底 + 细线，选中为浅蓝胶囊 ---------- */
html.sidebar-light .sidebar {
  background: #ffffff;
  border-right: 1px solid #eaf0f7;
  box-shadow: none;
}
html.sidebar-light .sidebar-brand {
  color: #17263e;
  border-bottom: 1px solid #f0f4fa;
}
html.sidebar-light .sidebar-brand span { color: #17263e; }
html.sidebar-light .sidebar-brand .brand-logo {
  background: transparent;
  box-shadow: none;
  border-radius: 8px;
}
html.sidebar-light .nav-group-title { color: #a9b6c9; letter-spacing: 1.4px; }
html.sidebar-light .nav-item { color: #5b6b85; }
html.sidebar-light .nav-item:hover { background: #f4f8ff; color: #1b2b45; }
html.sidebar-light .nav-item.active {
  background: var(--c-sidebar-active-bg);
  color: var(--c-sidebar-active-text);
  font-weight: 600;
  box-shadow: inset 3px 0 0 var(--c-primary);
}
html.sidebar-light .nav-item .ico { opacity: .72; }
html.sidebar-light .nav-item.active .ico { opacity: 1; }
html.sidebar-light .nav-badge { background: #fdecea; color: #c02a22; font-weight: 600; }
html.sidebar-light .sidebar-foot {
  color: #a3b0c4;
  border-top-color: #f0f4fa;
  background: #fcfdff;
}

/* ---------- 登录页：浅色天光 ---------- */
html.theme-light .login-wrap {
  background:
    radial-gradient(900px 520px at 10% 6%, rgba(96, 160, 240, .22), transparent 62%),
    radial-gradient(760px 520px at 90% 94%, rgba(13, 148, 136, .12), transparent 60%),
    linear-gradient(160deg, #f2f7ff 0%, #f9fcff 52%, #eef5ff 100%);
}
html.theme-light .login-card {
  width: 408px;
  border: 1px solid #e6eefa;
  border-radius: 18px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 26px 60px -34px rgba(19, 52, 95, .38);
  position: relative;
  overflow: hidden;
}
html.theme-light .login-card::before {
  content: ''; position: absolute; left: 0; right: 0; top: 0; height: 3px;
  background: linear-gradient(90deg, #5a9cf0, #0d9488);
  border-radius: 18px 18px 0 0;
}
html.theme-light .login-footer { color: #9aa9bd; }

/* 彩色 / 深色侧栏的层次感（浅色侧栏不受影响）：顶部微亮、底部压暗 */
html:not(.sidebar-light) .sidebar {
  background-color: var(--c-sidebar-bg);
  background-image: linear-gradient(180deg, rgba(255, 255, 255, .07) 0%, rgba(255, 255, 255, 0) 34%, rgba(0, 0, 0, .12) 100%);
}
html.theme-light:not(.sidebar-light) .nav-item.active {
  box-shadow: 0 8px 18px -12px rgba(10, 24, 42, .6), inset 3px 0 0 var(--c-primary);
}

/* 彩色侧栏下的分组标题 / 底部说明：提高可读性 */
html.theme-light:not(.sidebar-light) .nav-group-title { color: rgba(255, 255, 255, .58); }
html.theme-light:not(.sidebar-light) .sidebar-foot {
  color: rgba(255, 255, 255, .55);
  border-top-color: rgba(255, 255, 255, .12);
}

/* 发货弹窗：多快递单号行 */
.track-row { display: flex; align-items: center; gap: 8px; }
.track-row + .track-row { margin-top: 6px; }
.track-row .trk-label { flex: 0 0 58px; font-size: 12.5px; color: var(--c-text-sub); }
.track-row .trk-input { flex: 1; }
.track-row .trk-del { flex: 0 0 auto; }

/* 整组斑马纹：按订单/包裹分组交替，而不是逐行交替 */
table.table.grouped tbody tr:nth-child(even) { background: transparent; }
table.table.grouped tbody tr.group-alt td { background: var(--c-table-stripe); }
table.table.grouped tbody tr:hover td { background: var(--c-table-hover); }
