/* V3.4.38 2026-07-29 侧栏菜单统一美化(杨总)：圆角菜单项(margin2px10px+radius8px)取代左边框式、active蓝渐变+投影、分组标题10px+字距2px、图标15px、滚动条细化；与主页dside同款 */
/* V2.4.2 专区共享桌面外壳（desk-shell）：财务/销售/人力/生产四页共用侧栏+顶栏。仅 ≥900px 由 desk-shell.js 注入并启用（body.dshell-mode），手机端零影响 */
.dsh-side,.dsh-top{display:none}
body.dshell-mode{padding-left:220px !important;padding-top:52px !important}
/* 隐藏各页原生头部（限定body直接子级，避免误伤页面内部元素） */
body.dshell-mode > div.header:not([data-keep]),
body.dshell-mode > div.hd,
body.dshell-mode > div.topbar{display:none !important}
/* 各页内容容器桌面放宽（原手机限宽480~640px） */
body.dshell-mode .container{max-width:1000px !important}
body.dshell-mode .wrap{max-width:1000px !important}
body.dshell-mode .grid{grid-template-columns:repeat(5,1fr) !important}
/* 侧栏（与主页V2.4.0同一视觉） */
body.dshell-mode .dsh-side{display:flex;flex-direction:column;position:fixed;left:0;top:0;bottom:0;width:220px;background:#001529;z-index:150;overflow-y:auto}
.dsh-logo{padding:18px 16px 14px;border-bottom:1px solid rgba(255,255,255,.08);cursor:pointer}
.dsh-logo h1{font-size:17px;font-weight:600;color:#fff;margin:0}
.dsh-logo p{font-size:11px;color:rgba(255,255,255,.45);margin:4px 0 0}
.dsh-sec{padding:16px 18px 6px;font-size:10px;letter-spacing:2px;color:rgba(255,255,255,.38)}
.dsh-item{display:flex;align-items:center;gap:10px;margin:2px 10px;padding:10px 12px;color:rgba(255,255,255,.75);font-size:13.5px;cursor:pointer;border-radius:8px;transition:background .15s,color .15s}
.dsh-item:hover{background:rgba(255,255,255,.08);color:#fff}
.dsh-item.active{background:linear-gradient(135deg,#1890ff,#096dd9);color:#fff;font-weight:600;box-shadow:0 2px 8px rgba(24,144,255,.35)}
.dsh-item .dsi-ic{width:20px;text-align:center;flex:none;font-size:15px}
.dsh-side::-webkit-scrollbar{width:4px}
.dsh-side::-webkit-scrollbar-thumb{background:rgba(255,255,255,.15);border-radius:2px}
.dsh-badge{margin-left:auto;background:#f5222d;color:#fff;font-size:11px;border-radius:9px;min-width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;padding:0 5px}
/* 顶栏 */
body.dshell-mode .dsh-top{display:flex;align-items:center;position:fixed;left:220px;right:0;top:0;height:52px;background:#fff;z-index:140;box-shadow:0 1px 4px rgba(0,21,41,.08);padding:0 24px;box-sizing:border-box}
.dsh-crumb{font-size:14px;color:#8c8c8c}
.dsh-crumb b{color:#1f1f1f;font-weight:600}
.dsh-right{margin-left:auto;display:flex;align-items:center;gap:20px}
.dsh-bell{position:relative;cursor:pointer;font-size:17px;line-height:1}
.dsh-bnum{position:absolute;top:-7px;right:-9px;background:#f5222d;color:#fff;font-size:10px;border-radius:8px;min-width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center;padding:0 4px}
.dsh-user{display:flex;align-items:center;gap:8px;cursor:pointer}
.dsh-uav{width:30px;height:30px;border-radius:50%;background:linear-gradient(135deg,#667eea,#764ba2);color:#fff;display:flex;align-items:center;justify-content:center;font-size:13px;font-weight:600}
.dsh-uname{font-size:13px;color:#333;max-width:120px;white-space:nowrap;overflow:hidden;text-overflow:ellipsis}

/* ===== V2.4.3 采购系统接入：取消采购自绘侧栏/顶栏，统一OA外壳 + 采购页签条（仅桌面 dshell-mode 且 data-zone=purchase 生效） ===== */
body.dshell-mode[data-zone="purchase"]{background:#f0f2f5;padding-top:96px !important}
body.dshell-mode[data-zone="purchase"] .sidebar{display:none !important}
body.dshell-mode[data-zone="purchase"] .mask{display:none !important}
body.dshell-mode[data-zone="purchase"] .main{margin-left:0 !important}
body.dshell-mode[data-zone="purchase"] .content{margin-left:0 !important}
body.dshell-mode[data-zone="purchase"] .topbar{display:none !important}
/* 采购功能页签条（desk-shell.js 注入，替代原侧栏导航） */
.dsh-ptabs{display:none}
body.dshell-mode[data-zone="purchase"] .dsh-ptabs{display:flex;position:fixed;left:220px;right:0;top:52px;height:44px;background:#fff;z-index:130;box-shadow:0 1px 4px rgba(0,21,41,.06);padding:0 24px;align-items:center;gap:4px;box-sizing:border-box;overflow-x:auto}
.dsh-ptabs .dsh-ptab{flex:none;padding:6px 14px;font-size:13px;color:#595959;border-radius:16px;cursor:pointer;white-space:nowrap;transition:background .15s}
.dsh-ptabs .dsh-ptab:hover{background:#f0f7ff;color:#1890ff}
.dsh-ptabs .dsh-ptab.on{background:#1890ff;color:#fff;font-weight:600}

/* V2.4.4 功能目录页不注入页签条（平铺图标菜单已覆盖导航），顶距恢复为仅外壳顶栏 */
body.dshell-mode[data-zone="purchase"][data-ptab="admin"]{padding-top:52px !important}

/* V2.4.5 外壳侧栏底部版本号区 */
body.dshell-mode .dsh-foot{margin-top:auto;padding:14px 16px;font-size:11px;color:rgba(255,255,255,.32);border-top:1px solid rgba(255,255,255,.08)}


/* V2.4.10 桌面首绘遮罩（防FOUC）：外壳JS注入前隐藏手机版原生内容，杜绝跳转时"闪一下手机版"；2.8秒异常兜底自动恢复可见，防JS加载失败白屏 */
@media (min-width:900px){
  body:not(.dshell-mode){background:linear-gradient(to right, #001529 0, #001529 220px, #f4f6fa 220px, #f4f6fa 100%)}
  /* V2.4.16 遮罩已移除：首帧即最终布局，内容不再隐藏，彻底消灭慢网白闪 */
}

/* ===== V2.4.15 侧栏跳动根治（首帧即最终布局）=====
   根因：原布局位移(padding-left:220px/padding-top:52px)由JS注入dshell-mode时才生效，
   首屏先全宽、后被推右220px下52px，肉眼即"跳动"。
   根治：≥900px无条件预留侧栏/顶栏空间（body的data-zone/data-ptab属性首字节即存在，纯CSS命中），
   JS注入只往预留位填内容，内容区全程零位移。手机端不受影响。 */
@media (min-width:900px){
  body{padding-left:220px !important;padding-top:52px !important}
  body[data-zone="purchase"]{padding-top:96px !important}
  body[data-zone="purchase"][data-ptab="admin"]{padding-top:52px !important}
  /* V2.4.16 静态外壳首帧显示（不再等JS） */
  .dsh-side{display:flex !important;flex-direction:column;position:fixed;left:0;top:0;bottom:0;width:220px;background:#001529;z-index:150;overflow-y:auto}
  .dsh-top{display:flex !important;align-items:center;justify-content:space-between;position:fixed;left:220px;right:0;top:0;height:52px;background:#fff;z-index:140;box-shadow:0 1px 4px rgba(0,21,41,.08);padding:0 24px;box-sizing:border-box}
  body[data-zone="purchase"] .dsh-ptabs{display:flex !important}
  /* 页面原生头部/侧栏 首帧即隐藏（原来等JS加dshell-mode才隐藏，是跳动源之一） */
  body > div.header:not([data-keep]), body > div.hd, body > div.topbar{display:none !important}
  body .container, body .wrap, body .content, body .main, body .page{max-width:1120px;margin-left:auto;margin-right:auto}
  body .grid{grid-template-columns:repeat(5,1fr) !important}
  body[data-zone="purchase"] .sidebar, body[data-zone="purchase"] .mask, body[data-zone="purchase"] .topbar{display:none !important}
  body[data-zone="purchase"] .main, body[data-zone="purchase"] .content{margin-left:0 !important}
}

/* ===== V2.4.16 外壳元素样式（静态内嵌首帧即完整，原在JS内注入） ===== */
.dsh-logo{padding:18px 16px 14px;border-bottom:1px solid rgba(255,255,255,.08);cursor:pointer}
.dsh-logo h1{font-size:17px;font-weight:600;color:#fff;margin:0}
.dsh-logo p{font-size:11px;color:rgba(255,255,255,.45);margin:4px 0 0}
.dsh-sec{padding:16px 18px 6px;font-size:10px;letter-spacing:2px;color:rgba(255,255,255,.38)}
.dsh-item{display:flex;align-items:center;gap:10px;margin:2px 10px;padding:10px 12px;color:rgba(255,255,255,.75);font-size:13.5px;cursor:pointer;border-radius:8px;transition:background .15s,color .15s}
.dsh-item.active{background:linear-gradient(135deg,#1890ff,#096dd9);color:#fff;font-weight:600;box-shadow:0 2px 8px rgba(24,144,255,.35)}
.dsh-item .dsi-ic{width:20px;text-align:center;flex:none;font-size:15px}
.dsh-badge{margin-left:auto;background:#f5222d;color:#fff;font-size:11px;border-radius:9px;min-width:18px;height:18px;display:inline-flex;align-items:center;justify-content:center;padding:0 5px}
.dsh-crumb{font-size:14px;color:#8c8c8c}
.dsh-crumb b{color:#1f1f1f;font-weight:600}
.dsh-right{margin-left:auto;display:flex;align-items:center;gap:20px}
.dsh-bell{position:relative;cursor:pointer;font-size:17px;line-height:1}
.dsh-bnum{position:absolute;top:-7px;right:-9px;background:#f5222d;color:#fff;font-size:10px;border-radius:8px;min-width:16px;height:16px;display:inline-flex;align-items:center;justify-content:center;padding:0 4px}
.dsh-foot{margin-top:auto;padding:14px 16px;font-size:11px;color:rgba(255,255,255,.32);border-top:1px solid rgba(255,255,255,.08)}
.dsh-ptabs{display:none;position:fixed;left:220px;right:0;top:52px;height:44px;background:#fff;z-index:130;box-shadow:0 1px 4px rgba(0,21,41,.06);padding:0 24px;align-items:center;gap:4px;box-sizing:border-box;overflow-x:auto}
.dsh-ptabs .dsh-ptab{flex:none;padding:6px 14px;font-size:13px;color:#595959;border-radius:16px;cursor:pointer;white-space:nowrap}
.dsh-ptabs .dsh-ptab.on{background:#1890ff;color:#fff;font-weight:600}
@media (min-width:900px){ body[data-zone="purchase"] .dsh-ptabs{display:flex !important} }
@media (max-width:899px){ .dsh-ptabs{display:none !important} }
