/* =============================================================
   捷仓ERP · 商户端统一视觉 & 多端适配样式
   -------------------------------------------------------------
   设计目标：干净现代的 SaaS 后台观感；桌面 / 平板 / 手机三端可用。
   约定：所有应用外壳样式以 .erp-shell 作用域，避免污染弹层/组件。
   ============================================================= */

:root{
  --erp-brand:#1e9fff;
  --erp-brand-d:#0f7cdd;
  --erp-brand-l:#e8f3ff;
  --erp-brand-grad:linear-gradient(135deg,#4db0ff 0%,#1e9fff 52%,#0d78e0 100%);
  --erp-bg:#f3f6fb;
  --erp-surface:#ffffff;
  --erp-text:#1b2537;
  --erp-text-2:#55637d;
  --erp-muted:#93a1b8;
  --erp-line:#e8edf6;
  --erp-line-2:#f2f6fb;
  --erp-ok:#12b886;
  --erp-warn:#f59f00;
  --erp-danger:#f03e3e;
  --erp-radius:14px;
  --erp-radius-sm:10px;
  --erp-radius-xs:8px;
  --erp-shadow-sm:0 1px 2px rgba(27,37,55,.04),0 2px 8px rgba(27,37,55,.05);
  --erp-shadow:0 2px 6px rgba(27,37,55,.05),0 14px 30px -14px rgba(27,37,55,.22);
  --erp-side-bg:#131a29;
  --erp-side-bg2:#1a2337;
  --erp-topbar-h:58px;
  --erp-side-w:224px;
}

/* ---------- 基础 ---------- */
*{box-sizing:border-box}
.erp-shell, .erp-shell *{box-sizing:border-box}
.erp-shell{
  margin:0;
  background:var(--erp-bg);
  color:var(--erp-text);
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Hiragino Sans GB","Microsoft YaHei",sans-serif;
  -webkit-font-smoothing:antialiased;
  -webkit-text-size-adjust:100%;
}
/* 仅去掉下划线；不覆盖链接颜色，避免盖掉 .layui-btn 的白字 */
.erp-shell a{text-decoration:none}
.erp-shell img{max-width:100%}

/* =============================================================
   1. 顶部栏
   ============================================================= */
.erp-topbar{
  position:fixed;top:0;left:0;right:0;height:var(--erp-topbar-h);z-index:1200;
  display:flex;align-items:center;gap:10px;
  padding:0 14px;
  background:var(--erp-brand-grad);
  box-shadow:0 2px 12px rgba(13,120,224,.24);
  color:#fff;
}
.erp-burger{
  display:none;align-items:center;justify-content:center;
  width:40px;height:40px;flex:0 0 auto;
  border:0;border-radius:10px;cursor:pointer;
  background:rgba(255,255,255,.16);color:#fff;font-size:19px;line-height:1;
  transition:background .18s ease;
  -webkit-tap-highlight-color:transparent;
}
.erp-burger:active{background:rgba(255,255,255,.3)}
.erp-brand{
  display:flex;align-items:center;gap:9px;
  color:#fff !important;font-size:16px;font-weight:700;letter-spacing:.4px;
  white-space:nowrap;flex:0 1 auto;min-width:0;max-width:min(42vw,460px);
}
/* 商户名可能较长：超出部分省略，避免顶栏被挤爆 */
.erp-brand span{min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.erp-brand .layui-icon{font-size:20px;flex:0 0 auto}
.erp-topbar-spacer{flex:1 1 auto;min-width:4px}

.erp-topbar-right{display:flex;align-items:center;gap:6px;flex:0 0 auto}
.erp-hbtn{
  position:relative;
  display:inline-flex;align-items:center;gap:6px;
  height:38px;padding:0 12px;border-radius:10px;
  color:#fff !important;font-size:13px;white-space:nowrap;
  background:rgba(255,255,255,.12);
  transition:background .18s ease;
  -webkit-tap-highlight-color:transparent;
}
.erp-hbtn:hover{background:rgba(255,255,255,.24)}
.erp-hbtn .layui-icon{font-size:16px}
.erp-hbtn-erp-ghost{background:transparent}
.erp-badge{
  display:inline-block;
  min-width:18px;height:18px;line-height:18px;padding:0 5px;
  border-radius:9px;background:#ff4d4f;color:#fff;
  font-size:11px;font-weight:700;text-align:center;
  box-shadow:0 0 0 2px rgba(255,255,255,.55);
  vertical-align:middle;
}
.erp-user{
  display:flex;align-items:center;gap:8px;
  height:38px;padding:0 10px 0 6px;border-radius:10px;
  background:rgba(255,255,255,.12);color:#fff;
}
.erp-avatar{
  width:26px;height:26px;border-radius:50%;
  display:inline-flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,.92);color:var(--erp-brand-d);
  font-size:13px;font-weight:700;flex:0 0 auto;
}
.erp-username{font-size:13px;max-width:150px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
.erp-hsep{width:1px;height:20px;background:rgba(255,255,255,.35);flex:0 0 auto}

/* 消息小红点跳动 */
@keyframes erpBadgePulse{0%{transform:scale(1)}40%{transform:scale(1.6)}100%{transform:scale(1)}}
.erp-badge-pulse{animation:erpBadgePulse .7s ease}

/* =============================================================
   2. 侧边栏
   ============================================================= */
.erp-sidebar{
  position:fixed;top:var(--erp-topbar-h);bottom:0;left:0;width:var(--erp-side-w);
  background:linear-gradient(180deg,var(--erp-side-bg2) 0%,var(--erp-side-bg) 100%);
  overflow-y:auto;overflow-x:hidden;
  z-index:1100;
  padding:12px 10px 26px;
  -webkit-overflow-scrolling:touch;
  transition:transform .26s cubic-bezier(.4,0,.2,1);
}
.erp-sidebar::-webkit-scrollbar{width:6px}
.erp-sidebar::-webkit-scrollbar-thumb{background:rgba(255,255,255,.14);border-radius:3px}

/* layui 导航树外观重写 */
.erp-sidebar .layui-nav,
.erp-sidebar .layui-nav-tree{
  width:100%;background:transparent;padding:0;margin:0;
}
.erp-sidebar .layui-nav .layui-nav-item{display:block;margin:2px 0;border-radius:var(--erp-radius-sm);overflow:hidden}
.erp-sidebar .layui-nav .layui-nav-item > a{
  display:flex;align-items:center;gap:10px;
  height:42px;line-height:42px;padding:0 12px;
  color:#c7d0e0 !important;font-size:13.5px;
  border-radius:var(--erp-radius-sm);
  transition:background .16s ease,color .16s ease;
  -webkit-tap-highlight-color:transparent;
}
.erp-sidebar .layui-nav .layui-nav-item > a .layui-icon{font-size:16px;opacity:.9;flex:0 0 auto}
.erp-sidebar .layui-nav .layui-nav-item > a:hover{
  background:rgba(255,255,255,.08);color:#fff !important;
}
/* 分组展开态 */
.erp-sidebar .layui-nav-tree .layui-nav-itemed > a{
  background:transparent;color:#fff !important;font-weight:600;
}
.erp-sidebar .layui-nav-tree .layui-nav-itemed > a .layui-icon{color:#6fc0ff}
/* 子菜单 */
.erp-sidebar .layui-nav-child{
  display:none;position:static;background:transparent;
  padding:2px 0 6px;margin:0;border:0;box-shadow:none;
}
.erp-sidebar .layui-nav-itemed > .layui-nav-child{display:block}
.erp-sidebar .layui-nav-child dd{display:block;margin:1px 0}
.erp-sidebar .layui-nav-child dd a{
  position:relative;
  display:flex;align-items:center;
  min-height:40px;line-height:1.35;padding:8px 12px 8px 40px !important;
  color:#a9b5c9 !important;font-size:13px;border-radius:var(--erp-radius-xs);
  transition:background .16s ease,color .16s ease;
  -webkit-tap-highlight-color:transparent;
}
.erp-sidebar .layui-nav-child dd a::before{
  content:"";position:absolute;left:21px;top:50%;transform:translateY(-50%);
  width:6px;height:6px;border-radius:50%;background:rgba(255,255,255,.28);
  transition:background .16s ease,transform .16s ease;
}
.erp-sidebar .layui-nav-child dd a:hover{
  background:rgba(255,255,255,.08);color:#fff !important;
}
/* 当前页高亮 */
.erp-sidebar .layui-nav-child dd a.erp-active{
  background:rgba(30,159,255,.2);color:#fff !important;font-weight:600;
  box-shadow:inset 3px 0 0 #1e9fff;
}
.erp-sidebar .layui-nav-child dd a.erp-active::before{
  background:#4db0ff;transform:translateY(-50%) scale(1.25);
  box-shadow:0 0 0 4px rgba(77,176,255,.18);
}
.erp-sidebar .layui-nav-item > a.erp-active{
  background:rgba(30,159,255,.2);color:#fff !important;
  box-shadow:inset 3px 0 0 #1e9fff;
}
/* 分组折叠箭头（纯 CSS 雪佛龙，避免图标字体差异） */
/* LayUI 会自动注入 .layui-nav-more 箭头，与我们自定义的箭头重复，隐藏之 */
.erp-sidebar .layui-nav .layui-nav-more{display:none !important}
.erp-sidebar .layui-nav-item > a .erp-caret{
  margin-left:auto;flex:0 0 auto;
  width:7px;height:7px;opacity:.7;
  border-right:2px solid currentColor;border-bottom:2px solid currentColor;
  transform:rotate(-45deg);                 /* 收起：指向右 */
  transition:transform .2s ease;
}
.erp-sidebar .layui-nav-itemed > a .erp-caret{transform:rotate(45deg)}  /* 展开：指向下 */

/* 遮罩（移动端抽屉） */
.erp-mask{
  position:fixed;inset:0;background:rgba(16,24,40,.45);
  opacity:0;visibility:hidden;z-index:1090;
  transition:opacity .24s ease,visibility .24s ease;
  -webkit-tap-highlight-color:transparent;
}
.erp-mask.is-open{opacity:1;visibility:visible}

/* =============================================================
   3. 内容区
   ============================================================= */
.erp-body{
  margin-left:var(--erp-side-w);
  padding-top:var(--erp-topbar-h);
  min-height:100vh;
  transition:margin-left .26s cubic-bezier(.4,0,.2,1);
}
.erp-page-head{
  display:flex;align-items:center;gap:10px;flex-wrap:wrap;
  padding:18px 20px 0;
}
.erp-page-title{
  margin:0;font-size:18px;font-weight:700;color:var(--erp-text);
  display:flex;align-items:center;gap:9px;
}
.erp-page-title::before{
  content:"";width:4px;height:17px;border-radius:3px;
  background:var(--erp-brand-grad);flex:0 0 auto;
}
.erp-main{padding:14px 20px 30px}
.erp-card{
  background:var(--erp-surface);
  border:1px solid var(--erp-line);
  border-radius:var(--erp-radius);
  box-shadow:var(--erp-shadow-sm);
  padding:18px;
}
.erp-card + .erp-card{margin-top:14px}
.erp-card > h2:first-child, .erp-card > .erp-card-title:first-child{margin-top:0}

/* 面包屑（可选） */
.erp-crumb{font-size:12.5px;color:var(--erp-muted);margin-bottom:2px}

/* =============================================================
   4. 表格
   ============================================================= */
.erp-table-wrap{
  --erp-cols:5;                       /* 由 erp.js 按实际列数写入，窄屏据此放大表格最小宽度 */
  width:100%;overflow-x:auto;-webkit-overflow-scrolling:touch;
  border:1px solid var(--erp-line);border-radius:var(--erp-radius-sm);
  background:#fff;
}
.erp-table-wrap > .layui-table{margin:0;border:0;border-radius:0}
/* 数字列不换行（金额/单数等窄列被挤压时横向滚动而不是断行），首列文字列除外 */
.erp-fit-num th,.erp-fit-num td{white-space:nowrap}
.erp-fit-num td:first-child,.erp-fit-num th:first-child{white-space:normal}
.erp-shell .layui-table{
  margin:0;color:var(--erp-text);font-size:13px;
  border-collapse:separate;border-spacing:0;
}
.erp-shell .layui-table thead tr{
  background:linear-gradient(180deg,#f8fbff,#f2f7ff);
}
.erp-shell .layui-table thead th{
  background:linear-gradient(180deg,#f8fbff,#f2f7ff) !important;
  font-weight:600;color:var(--erp-text-2);font-size:12.5px;
  letter-spacing:.2px;white-space:nowrap;
  border-color:var(--erp-line) !important;
}
.erp-shell .layui-table td{
  border-color:var(--erp-line-2) !important;
  vertical-align:middle;word-break:break-word;
}
.erp-shell .layui-table tbody tr{transition:background .14s ease}
.erp-shell .layui-table tbody tr:hover{background:#f7fbff}
.erp-shell .layui-table tbody tr:nth-child(even){background:#fcfdff}
.erp-shell .layui-table tbody tr:nth-child(even):hover{background:#f4faff}
.erp-shell .layui-table-view{margin:0;border-radius:var(--erp-radius-sm)}
/* 表格内操作按钮：同一行内、以及换行成两行后，都保留间隙（手机端按钮常分成两行） */
.erp-shell .layui-table td .layui-btn,
.erp-shell .layui-table td .layui-badge,
.erp-shell .layui-table td .erp-move-btn{
  margin:0 6px 5px 0;vertical-align:middle;
}
.erp-shell .layui-table td .layui-btn:last-child,
.erp-shell .layui-table td .layui-badge:last-child,
.erp-shell .layui-table td .erp-move-btn:last-child{margin-right:0}

/* 触屏排序按钮：桌面隐藏，手机显示（见媒体查询） */
.erp-move-cell{display:none}
.erp-move-btn{
  display:inline-flex;align-items:center;justify-content:center;
  width:30px;height:28px;margin:0 3px 0 0;
  border:1px solid var(--erp-line);border-radius:7px;background:#fff;
  color:var(--erp-text-2);font-size:13px;line-height:1;cursor:pointer;
  -webkit-tap-highlight-color:transparent;
}
.erp-move-btn:active{background:#eef5ff;border-color:var(--erp-brand);color:var(--erp-brand)}

/* =============================================================
   5. 表单
   ============================================================= */
.erp-shell .layui-form-label{
  color:var(--erp-text-2);font-weight:600;font-size:13px;
  width:118px;padding:9px 12px 9px 0;
}
.erp-shell .layui-input-block{margin-left:118px;min-height:36px}
.erp-shell .layui-input,
.erp-shell .layui-textarea,
.erp-shell .layui-select{
  border:1px solid var(--erp-line);border-radius:var(--erp-radius-xs);
  height:38px;line-height:38px;color:var(--erp-text);
  transition:border-color .16s ease,box-shadow .16s ease;
  background:#fff;
}
.erp-shell .layui-textarea{height:auto;line-height:1.5;padding:8px 10px}
.erp-shell .layui-input:focus,
.erp-shell .layui-textarea:focus{
  border-color:var(--erp-brand) !important;
  box-shadow:0 0 0 3px rgba(30,159,255,.14);
}
.erp-shell .layui-input[disabled],
.erp-shell .layui-input.layui-disabled{
  background:#f5f7fb;color:var(--erp-text-2);cursor:not-allowed;
}
.erp-shell .layui-input-inline{min-width:200px}

/* 分隔线与明细区 */
.erp-shell hr{border:0;border-top:1px solid var(--erp-line);margin:18px 0}
.erp-shell .layui-row > .layui-btn-sm{margin-bottom:2px}

/* LayUI 会把 select 渲染成自定义下拉，这里统一外观 */
.erp-shell .layui-form-select .layui-input{
  height:38px;line-height:38px;
  border:1px solid var(--erp-line);border-radius:var(--erp-radius-xs);
  transition:border-color .16s ease,box-shadow .16s ease;
}
.erp-shell .layui-form-select .layui-input:hover{border-color:#c9d8ee}
.erp-shell .layui-form-select.layui-form-selected .layui-input,
.erp-shell .layui-form-select .layui-input:focus{
  border-color:var(--erp-brand) !important;
  box-shadow:0 0 0 3px rgba(30,159,255,.14);
}
.erp-shell .layui-form-select dl{
  border:1px solid var(--erp-line);border-radius:12px;
  box-shadow:var(--erp-shadow);padding:5px;margin-top:5px;
  max-height:320px;
}
.erp-shell .layui-form-select dl dd,
.erp-shell .layui-form-select dl dt{
  border-radius:8px;line-height:34px;font-size:13px;margin:1px 0;
}
.erp-shell .layui-form-select dl dd:hover{background:#f2f8ff}
.erp-shell .layui-form-select dl dd.layui-this{
  background:var(--erp-brand-grad);color:#fff;border-radius:8px;
}
.erp-shell .layui-form-select dl dd.layui-this .layui-badge{border-color:transparent}
/* 开关（switch）与复选框 */
.erp-shell .layui-form-switch{margin-top:0;border-radius:20px}
.erp-shell .layui-form-checkbox[lay-skin="primary"]{margin-top:0}
.erp-shell .layui-form-item{margin-bottom:16px}
.erp-shell .layui-form-item .layui-word-aux{font-size:12px;color:var(--erp-muted)}
.erp-shell fieldset.layui-elem-field{border:1px solid var(--erp-line);border-radius:var(--erp-radius-sm);padding:0}
.erp-shell .layui-elem-field legend{padding:0 10px;font-weight:600;color:var(--erp-text-2)}
.erp-shell .layui-field-box{padding:16px 18px 2px}
.erp-shell .layui-elem-quote{
  border-radius:var(--erp-radius-sm);border-left:4px solid var(--erp-brand);
  background:#f2f8ff;border:1px solid #dcebfd;border-left-width:4px;
  color:var(--erp-text-2);line-height:1.7;
}

/* =============================================================
   6. 按钮
   ============================================================= */
.erp-shell .layui-btn{
  height:38px;line-height:38px;padding:0 18px;
  border-radius:var(--erp-radius-xs);font-size:13.5px;font-weight:500;
  transition:transform .12s ease,box-shadow .16s ease,background .16s ease;
}
.erp-shell .layui-btn:active{transform:translateY(1px)}
.erp-shell .layui-btn-sm{height:32px;line-height:32px;padding:0 14px;font-size:13px;border-radius:7px}
.erp-shell .layui-btn-xs{height:26px;line-height:26px;padding:0 10px;font-size:12px;border-radius:6px}
.erp-shell .layui-btn-primary{border-color:var(--erp-line);color:var(--erp-text-2);background:#fff}
.erp-shell .layui-btn-primary:hover{border-color:var(--erp-brand);color:var(--erp-brand)}
.erp-shell .layui-btn-normal{
  background:var(--erp-brand-grad);border:0;
  box-shadow:0 4px 12px -4px rgba(13,120,224,.5);
}
.erp-shell .layui-btn-disabled,
.erp-shell .layui-btn.layui-btn-disabled{
  background:#f0f2f6 !important;color:#b3bccb !important;border-color:#e6eaf2 !important;
  box-shadow:none;cursor:not-allowed;
}
.erp-shell .layui-btn-warm{background:#ff9f1a;border:0}
.erp-shell .layui-btn-danger{background:#ff5b5b;border:0}

/* 徽标 / 标签 */
.erp-shell .layui-badge{border-radius:6px;padding:1px 7px;font-size:11.5px}
.erp-shell .layui-badge-rim{border-radius:6px;padding:1px 7px;font-size:11.5px;color:var(--erp-text-2)}

/* 表格列通用对齐 */
.erp-shell .layui-table th.text-center,
.erp-shell .layui-table td.text-center{text-align:center !important}
/* 表格内状态徽标：恢复 LayUI 紧凑胶囊（避免被提示块样式的淡色背景/边框/大内边距撑大） */
.erp-shell .layui-table .layui-badge.layui-bg-green{background:#16baaa !important;color:#fff !important;border:0;padding:1px 7px}
.erp-shell .layui-table .layui-badge.layui-bg-red{background:#ff5722 !important;color:#fff !important;border:0;padding:1px 7px}
/* 表格内徽标禁止文字换行（移动端窄列会把「正常」折成两行） */
.erp-shell .layui-table .layui-badge,
.erp-shell .layui-table .layui-badge-rim{white-space:nowrap}

/* =============================================================
   7. 工具条 / 分页 / 空态
   ============================================================= */
.erp-toolbar{
  display:flex;flex-wrap:wrap;align-items:center;gap:10px;
  margin-bottom:14px;
}
.erp-toolbar .layui-form{display:flex;flex-wrap:wrap;align-items:center;gap:10px;margin:0}
.erp-toolbar .layui-input-inline{margin:0;min-width:180px}
.erp-toolbar .layui-input-inline select,
.erp-toolbar .layui-input-inline input{width:100%}
.erp-toolbar .erp-toolbar-right{margin-left:auto;display:flex;gap:8px;flex-wrap:wrap}
.erp-toolbar > .layui-btn:last-child{margin-left:auto}

.erp-shell .layui-laypage{
  display:flex;flex-wrap:wrap;align-items:center;gap:5px;
  margin:14px 0 0;font-size:13px;
}
.erp-shell .layui-laypage span{
  color:var(--erp-muted);background:transparent;padding:0 6px;
}
.erp-shell .layui-laypage a{
  min-width:32px;height:32px;line-height:32px;text-align:center;
  border:1px solid var(--erp-line);border-radius:8px;
  color:var(--erp-text-2);background:#fff;padding:0 8px;
  transition:all .16s ease;
}
.erp-shell .layui-laypage a:hover{border-color:var(--erp-brand);color:var(--erp-brand)}
.erp-shell .layui-laypage .layui-laypage-curr{
  background:var(--erp-brand-grad);border-color:transparent;color:#fff;font-weight:600;
}
.erp-empty{
  display:flex;flex-direction:column;align-items:center;gap:10px;
  padding:46px 16px;color:var(--erp-muted);font-size:13.5px;
}
.erp-empty .layui-icon{font-size:42px;opacity:.35}

/* 卡片式关键指标 */
.erp-stat{
  display:flex;align-items:center;gap:14px;
  background:#fff;border:1px solid var(--erp-line);border-radius:var(--erp-radius);
  padding:16px 18px;box-shadow:var(--erp-shadow-sm);
  transition:transform .16s ease,box-shadow .18s ease;
}
.erp-stat:hover{transform:translateY(-2px);box-shadow:var(--erp-shadow)}
.erp-stat-icon{
  width:46px;height:46px;border-radius:13px;flex:0 0 auto;
  display:flex;align-items:center;justify-content:center;
  font-size:22px;color:#fff;
}
.erp-stat-icon.i-blue{background:linear-gradient(135deg,#4db0ff,#1e9fff)}
.erp-stat-icon.i-teal{background:linear-gradient(135deg,#3ddbb4,#12b886)}
.erp-stat-icon.i-violet{background:linear-gradient(135deg,#a98bff,#7b61ff)}
.erp-stat-icon.i-amber{background:linear-gradient(135deg,#ffc04d,#f59f00)}
.erp-stat-meta{min-width:0}
.erp-stat-value{font-size:23px;font-weight:700;line-height:1.2;color:var(--erp-text);word-break:break-all}
.erp-stat-label{font-size:12.5px;color:var(--erp-muted);margin-top:2px}

/* 图表容器 */
.erp-chart{width:100%;height:320px}
@media (max-width:768px){ .erp-chart{height:250px} }

/* layui-card 美化 */
.erp-shell .layui-card{
  border:1px solid var(--erp-line);border-radius:var(--erp-radius);
  box-shadow:var(--erp-shadow-sm);overflow:hidden;
}
.erp-shell .layui-card-header{
  font-weight:600;color:var(--erp-text);font-size:14px;
  background:linear-gradient(180deg,#fbfdff,#f6faff);
  border-bottom:1px solid var(--erp-line);
  height:auto;line-height:1.5;padding:13px 18px;
}
.erp-shell .layui-card-body{padding:18px}

/* 提示条 */
.erp-shell .layui-bg-green,
.erp-shell .erp-alert-ok{
  background:linear-gradient(90deg,#e8fbf3,#f2fdf8) !important;
  color:#0b8a63 !important;border:1px solid #b9ecd8;
  border-radius:var(--erp-radius-xs);padding:10px 14px;
}
.erp-shell .layui-bg-red,
.erp-shell .erp-alert-err{
  background:linear-gradient(90deg,#fdecec,#fef5f5) !important;
  color:#c03636 !important;border:1px solid #f6cccc;
  border-radius:var(--erp-radius-xs);padding:10px 14px;
}

/* =============================================================
   8. 登录 / 门户（blank 外壳）
   ============================================================= */
.erp-auth-body{
  margin:0;min-height:100vh;
  font-family:-apple-system,BlinkMacSystemFont,"Segoe UI","PingFang SC","Microsoft YaHei",sans-serif;
  background:var(--erp-brand-grad);
  background-attachment:fixed;
  display:flex;align-items:center;justify-content:center;
  padding:24px 16px;
  -webkit-font-smoothing:antialiased;
}
.erp-auth-body .layui-container{margin:0 !important;width:100%;max-width:100%}
.erp-auth-card{
  width:100%;max-width:430px;margin:0 auto;
  background:#fff;border-radius:18px;overflow:hidden;
  box-shadow:0 24px 60px -20px rgba(6,42,84,.5);
  border:1px solid rgba(255,255,255,.5);
}
.erp-auth-head{
  position:relative;padding:30px 26px 24px;color:#fff;
  background:var(--erp-brand-grad);
  text-align:center;
}
.erp-auth-head .erp-auth-logo{
  width:54px;height:54px;margin:0 auto 12px;border-radius:16px;
  display:flex;align-items:center;justify-content:center;
  background:rgba(255,255,255,.2);font-size:26px;
  box-shadow:inset 0 0 0 1px rgba(255,255,255,.35);
}
/* 自定义 LOGO 图片：白色圆角底衬，深色/彩色头部上也清晰 */
.erp-auth-head .erp-auth-logo.has-img{
  background:#fff;box-shadow:0 2px 10px rgba(0,0,0,.18);border-radius:16px;overflow:hidden;
}
.erp-auth-head .erp-auth-logo.has-img img{
  width:100%;height:100%;object-fit:contain;display:block;
}
.erp-auth-head h1{margin:0;font-size:19px;font-weight:700;letter-spacing:.5px}
.erp-auth-head p{margin:6px 0 0;font-size:12.5px;opacity:.9}
.erp-auth-body-card{padding:24px 26px 22px}
/* 登录/注册卡片内的表单标签更紧凑 */
.erp-auth-body-card .layui-form-label{
  width:92px;padding:9px 10px 9px 0;font-size:13px;color:var(--erp-text-2);font-weight:600;
}
.erp-auth-body-card .layui-input-block{margin-left:92px}
.erp-auth-body-card .layui-btn-fluid{width:100%}
/* 验证码：输入框与图片并排 */
.erp-captcha-block{display:flex;align-items:center;gap:10px}
.erp-captcha-block .layui-input{flex:1 1 auto;min-width:0}
.erp-captcha-img{
  flex:0 0 auto;height:38px;width:130px;border:1px solid var(--erp-line);
  border-radius:8px;cursor:pointer;background:#f5f8fc;object-fit:cover;
  transition:box-shadow .15s;
}
.erp-captcha-img:hover{box-shadow:0 0 0 2px rgba(30,159,255,.25)}
.erp-auth-foot{
  margin-top:16px;padding-top:14px;border-top:1px dashed var(--erp-line);
  display:flex;flex-wrap:wrap;justify-content:center;gap:6px 14px;
  font-size:12.5px;color:var(--erp-muted);
}
.erp-auth-foot a{color:var(--erp-brand)}
/* 门户入口按钮组 */
.erp-portal-actions{display:flex;flex-direction:column;gap:10px}
.erp-portal-actions .layui-btn{
  margin:0;height:46px;line-height:46px;font-size:15px;border-radius:10px;
}
.erp-portal-actions .layui-btn .layui-icon{font-size:16px;margin-right:4px}

/* =============================================================
   9. 响应式 —— 桌面优先，逐级降级
   ============================================================= */

/* ---- 平板（<= 992px）：侧栏收窄、栅格三列---- */
@media (max-width:992px){
  :root{ --erp-side-w:206px; }
  .erp-main, .erp-page-head{padding-left:16px;padding-right:16px}
  .erp-shell .layui-input-inline{min-width:160px}
}

/* ---- 手机 / 小平板（<= 768px）：抽屉式侧栏、表单堆叠、表格横滚 ---- */
@media (max-width:768px){
  .erp-burger{display:inline-flex}
  .erp-topbar{padding:0 10px;gap:8px}
  .erp-brand span{display:block}            /* 手机端保留商户名（超长自动省略） */
  .erp-brand{max-width:40vw;font-size:14.5px;gap:7px}
  .erp-brand .layui-icon{font-size:18px}
  .erp-username{display:none}
  .erp-user{padding:0 6px;background:transparent}
  .erp-hbtn{padding:0 10px}
  .erp-hbtn-label{display:none}            /* 按钮只留图标 */
  .erp-hsep{display:none}

  /* 侧栏改为抽屉 */
  .erp-sidebar{
    width:250px;left:0;
    transform:translateX(-100%);
    box-shadow:0 12px 40px rgba(0,0,0,.4);
    padding-top:10px;
  }
  .erp-shell.erp-nav-open .erp-sidebar{transform:translateX(0)}
  .erp-body{margin-left:0 !important}

  /* 页面留白收紧 */
  .erp-main{padding:12px 12px 26px}
  .erp-page-head{padding:14px 12px 0}
  .erp-page-title{font-size:16px}
  .erp-card{padding:14px 12px;border-radius:var(--erp-radius-sm)}

  /* 表单：标签上移、控件全宽 */
  .erp-shell .layui-form-label{
    float:none;display:block;width:auto;text-align:left;
    padding:0 0 6px 2px;font-size:12.5px;
  }
  .erp-shell .layui-input-block{margin-left:0}
  .erp-shell .layui-input-inline{
    display:block;width:100% !important;min-width:0;
    margin:0 0 10px !important;
  }
  .erp-shell .layui-form-item{margin-bottom:14px}
  .erp-shell .layui-elem-field legend{font-size:13px}
  .erp-shell .layui-field-box{padding:12px 12px 0}

  /* 工具条：控件整行；新增按钮整行靠左 */
  .erp-toolbar{gap:8px}
  .erp-toolbar .layui-form{width:100%}
  .erp-toolbar .layui-input-inline{flex:1 1 100%;margin:0 !important}
  .erp-toolbar .erp-toolbar-right{width:100%;margin-left:0}
  .erp-toolbar .erp-toolbar-right > *{flex:1 1 auto}
  .erp-toolbar > .layui-btn:last-child{margin-left:0;width:100%}
  /* 兼容旧写法：按钮内联 float:right */
  .erp-shell .erp-toolbar .layui-btn[style*="float:right"],
  .erp-shell form > .layui-btn[style*="float:right"]{
    float:none !important;display:block;width:100%;margin-top:8px;
  }

  /* 表格横向滚动：按列数放大最小宽度，让每列都宽一些（超宽就左右滑动查看） */
  .erp-table-wrap .layui-table{min-width:640px}
  .erp-table-wrap .layui-table{min-width:max(640px,calc(var(--erp-cols) * 118px))}

  /* 明细区「添加明细」整行按钮，便于触屏点按 */
  .erp-shell #addRow{display:block;width:100%;height:42px;line-height:42px}

  /* 商品属性排序：触屏用 ▲▼ 代替拖拽 */
  .erp-shell .erp-move-cell{display:table-cell !important}

  /* 分页 */
  .erp-shell .layui-laypage a{min-width:30px;height:30px;line-height:30px}

  /* 登录卡片贴合小屏 */
  .erp-auth-body{padding:16px 12px}
  .erp-auth-card{max-width:100%;border-radius:16px}
  .erp-auth-head{padding:26px 20px 20px}
  .erp-auth-body-card{padding:20px 18px 18px}
  .erp-auth-body-card .layui-form-label{
    float:none;display:block;width:auto;text-align:left;padding:0 0 6px 2px;
  }
  .erp-auth-body-card .layui-input-block{margin-left:0}
}

/* ---- 小屏手机（<= 480px）---- */
@media (max-width:480px){
  .erp-shell .layui-table{font-size:12.5px}
  .erp-stat{padding:13px 14px;gap:11px}
  .erp-stat-value{font-size:20px}
  .erp-stat-icon{width:40px;height:40px;font-size:19px;border-radius:11px}
  .erp-brand .layui-icon{font-size:19px}
}

/* ---- 触摸设备：加大点击热区 ---- */
@media (hover:none){
  .erp-shell .layui-table td .layui-btn-xs{height:30px;line-height:30px;padding:0 12px}
}

/* ---- 打印：去掉外壳装饰 ---- */
@media print{
  .erp-topbar,.erp-sidebar,.erp-mask,.erp-toolbar,.erp-shell .layui-laypage{display:none !important}
  .erp-body{margin:0 !important;padding-top:0 !important}
  .erp-card{box-shadow:none;border:0;padding:0}
}

/* 表格内 layui 下拉展开时放开裁剪（erp.js 同步 erp-ovis 类） */
.erp-table-wrap.erp-ovis{overflow:visible}
.erp-table-wrap.erp-ovis > .layui-table{overflow:visible}
.erp-shell .layui-form-select dl{z-index:900}
/* 表单内明细表格：与上下元素留出间距（避免保存按钮紧贴表格） */
.erp-shell form .erp-table-wrap{margin:8px 0 18px}
