/* 易智MES 左侧分组导航（对标行业标杆布局：分组归类 + 折叠 + 权限过滤）
   电脑端：固定左侧栏；移动端（≤900px）：收起为汉堡抽屉，保持原移动端布局 */
#sidebar{position:fixed;top:0;left:0;bottom:0;width:230px;background:linear-gradient(180deg,#16283f,#1e3a5f);color:#cfe0f2;z-index:80;display:flex;flex-direction:column;overflow:hidden;box-shadow:2px 0 12px rgba(15,30,45,.18)}
#sidebar .sb-logo{display:flex;align-items:center;gap:8px;padding:14px 16px;font-size:20px;font-weight:700;color:#fff;border-bottom:1px solid rgba(255,255,255,.10);flex-shrink:0}
#sidebar .sb-logo small{font-size:12px;font-weight:400;opacity:.75;margin-left:2px}
#sidebar .sb-body{flex:1;overflow-y:auto;overflow-x:hidden;padding:8px 0 24px}
#sidebar .sb-body::-webkit-scrollbar{width:4px}
#sidebar .sb-body::-webkit-scrollbar-thumb{background:rgba(255,255,255,.18);border-radius:4px}
#sidebar .sb-g{font-size:16px;color:#8aa7cc;padding:14px 18px 6px;letter-spacing:1px;font-weight:700;display:flex;align-items:center;justify-content:space-between;cursor:pointer;user-select:none}
#sidebar .sb-g b{font-size:13px;color:#8aa7cc;transition:transform .15s}
#sidebar .sb-g.open b{transform:rotate(90deg)}
#sidebar a.sb-i{display:block;padding:10px 18px 10px 22px;font-size:16px;color:#d6e5f6;text-decoration:none;border-left:3px solid transparent;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}
#sidebar a.sb-i:hover{background:rgba(255,255,255,.09);color:#fff}
#sidebar a.sb-i.active{background:rgba(37,99,235,.55);color:#fff;font-weight:600;border-left-color:#60a5fa}
#sidebar a.sb-i.hide{display:none}
#sidebar .sb-foot{flex-shrink:0;padding:10px 18px;font-size:13px;color:#8aa7cc;border-top:1px solid rgba(255,255,255,.10)}
.sb-toggle{display:none;position:fixed;top:10px;left:10px;z-index:85;background:#1e3a5f;color:#fff;border:none;border-radius:8px;width:38px;height:38px;font-size:18px;cursor:pointer}
.sb-mask{display:none;position:fixed;inset:0;background:rgba(15,30,45,.45);z-index:79}
/* 主内容左偏移：适配各类 .wrap（居中 max-width 容器不再错位，改为贴侧栏占满右侧） */
@media print{#sidebar,.sb-toggle,.sb-mask{display:none!important}body.sb-on .wrap{margin-left:0!important}}
body.sb-on .wrap{margin-left:260px !important;margin-right:16px;max-width:none !important;padding-left:0 !important}
body.sb-on > .card, body.sb-on > div:not(.topbar):not(#sidebar):not(.sb-toggle):not(.sb-mask):not(.toast){margin-left:260px !important;margin-right:16px;}
body.sb-on .topbar{padding-left:260px !important}
@media (min-width:901px) and (max-width:1100px){
  body.sb-on .wrap{margin-left:16px;max-width:none}
}
/* 顶栏适配：去掉 nav 后 logo 与右侧区布局（页面内联 .topbar nav{display:flex} 同特异性后加载会覆盖，故 !important） */
.topbar nav{display:none !important}
/* 统一顶栏：固定高度 52px、不换行、logo 左置、右侧功能区靠右，避免各页顶栏高度不一造成错位 */
body.sb-on .topbar{height:52px;min-height:52px;padding:0 20px;display:flex;align-items:center;gap:12px;flex-wrap:nowrap;overflow:hidden}
body.sb-on .topbar .logo{white-space:nowrap;flex:0 0 auto;font-size:17px}
body.sb-on .topbar .user,body.sb-on .topbar .right,body.sb-on .topbar>a{margin-left:auto;white-space:nowrap}
body.sb-on .topbar .user+.user,body.sb-on .topbar .right+.right{margin-left:8px}
@media (max-width:1100px){
  body.sb-on .topbar .user{font-size:12px}
  body.sb-on .topbar .right{display:none}
}
/* 手机/窄屏抽屉适配：宽度自适应、字号加大、触控间距加大（触控目标≥44px）
   断点 768px：真正手机（375-768px）才收起抽屉；PC 微信内置浏览器（视口常 980px+）保持侧栏常显 */
@media (max-width:768px){
  #sidebar{width:82vw;max-width:300px;transform:translateX(-100%);transition:transform .2s}
  #sidebar .sb-logo{padding:16px;font-size:20px}
  #sidebar .sb-logo small{font-size:12px}
  #sidebar .sb-g{font-size:16px;padding:14px 18px 6px}
  #sidebar .sb-g b{font-size:13px}
  #sidebar a.sb-i{padding:12px 18px 12px 22px;font-size:16px}
  #sidebar .sb-foot{padding:12px 18px;font-size:13px}
  body.sb-on.sb-open #sidebar{transform:translateX(0)}
  body.sb-on .sb-toggle{display:flex;align-items:center;justify-content:center}
  body.sb-on.sb-open .sb-mask{display:block}
  body.sb-on .wrap{margin-left:0;max-width:none;padding-left:56px;margin-right:0}
  body.sb-on .topbar{padding-left:56px}
  .topbar nav{display:none !important}
}

/* ===== 全局美化（对标黑湖简洁风格） ===== */
/* 卡片样式优化 */
body.sb-on .card{
  border-radius:12px;
  box-shadow:0 1px 3px rgba(0,0,0,.06),0 1px 2px rgba(0,0,0,.04);
  border:1px solid #e5e7eb;
  margin-bottom:16px;
  transition:box-shadow .2s;
}
body.sb-on .card:hover{
  box-shadow:0 4px 12px rgba(0,0,0,.08);
}
/* 表格优化 */
body.sb-on table{
  border-collapse:separate;
  border-spacing:0;
  width:100%;
}
body.sb-on table th{
  background:#f8fafc;
  font-weight:600;
  font-size:13px;
  color:#475569;
  padding:10px 12px;
  border-bottom:2px solid #e2e8f0;
  white-space:nowrap;
}
body.sb-on table td{
  padding:10px 12px;
  border-bottom:1px solid #f1f5f9;
  font-size:13px;
}
body.sb-on table tr:hover td{
  background:#f8fafc;
}
/* 按钮优化 */
body.sb-on .btn{
  border-radius:8px;
  font-weight:500;
  transition:all .15s;
}
body.sb-on .btn:hover{
  transform:translateY(-1px);
  box-shadow:0 2px 6px rgba(0,0,0,.1);
}
/* 标签页优化 */
body.sb-on .tabs{
  gap:4px;
  border-bottom:2px solid #e2e8f0;
  margin-bottom:16px;
}
body.sb-on .tabs a{
  border-radius:8px 8px 0 0;
  padding:10px 18px;
  font-weight:500;
  transition:all .15s;
}
body.sb-on .tabs a.active{
  background:#fff;
  border-bottom:2px solid #0d9488;
  color:#0d9488;
  font-weight:600;
}
/* 状态标签优化 */
body.sb-on .pill,body.sb-on .chip{
  border-radius:6px;
  font-size:12px;
  padding:2px 8px;
  font-weight:500;
}
/* 进度条优化 */
body.sb-on .bar{
  height:8px;
  border-radius:4px;
  background:#e2e8f0;
  overflow:hidden;
}
body.sb-on .bar i{
  border-radius:4px;
  background:linear-gradient(90deg,#0d9488,#14b8a6);
  transition:width .3s;
}
/* 搜索框优化 */
body.sb-on input[type="text"],body.sb-on input[type="search"],body.sb-on select{
  border-radius:8px;
  border:1px solid #e2e8f0;
  padding:8px 12px;
  font-size:14px;
  transition:border-color .15s;
}
body.sb-on input:focus,body.sb-on select:focus{
  outline:none;
  border-color:#0d9488;
  box-shadow:0 0 0 3px rgba(13,148,136,.1);
}
