*{margin:0;padding:0;box-sizing:border-box}
body{font-family:'Microsoft YaHei','Segoe UI',system-ui,sans-serif;background:#f0f2f5;color:#2c3648;font-size:14px}
a{text-decoration:none;color:inherit}
/* ---------- 登录 ---------- */
#loginPage{position:fixed;inset:0;background:linear-gradient(135deg,#1a2332 0%,#243447 55%,#2f4a63 100%);display:flex;align-items:center;justify-content:center;z-index:900}
.login-box{width:390px;background:#fff;border-radius:14px;padding:38px 34px 30px;box-shadow:0 24px 60px rgba(0,0,0,.35)}
.login-logo{text-align:center;margin-bottom:16px}
.login-logo img{width:248px;max-width:100%;display:inline-block}
.login-box h1{font-size:22px;color:#1a2332;letter-spacing:1px}
.login-box .sub{font-size:12px;color:#8a94a6;margin-top:6px;margin-bottom:26px}
.login-box label{display:block;font-size:12px;color:#5c6779;margin-bottom:6px}
.login-box input{width:100%;padding:11px 13px;border:1px solid #dde3ec;border-radius:8px;font-size:14px;margin-bottom:16px;outline:none;transition:.2s}
.login-box input:focus{border-color:#2f7cf6;box-shadow:0 0 0 3px rgba(47,124,246,.12)}
.login-box button{width:100%;padding:12px;background:linear-gradient(135deg,#2f7cf6,#1f5fd0);border:none;border-radius:8px;color:#fff;font-size:15px;cursor:pointer;letter-spacing:2px}
.login-box button:hover{opacity:.92}
.login-err{color:#e5484d;font-size:12px;margin-bottom:12px;min-height:16px}
.login-tip{margin-top:16px;font-size:11px;color:#9aa4b5;line-height:1.7}
/* ---------- 布局 ---------- */
#app{display:none}
.sidebar{position:fixed;top:0;left:0;bottom:0;width:224px;background:linear-gradient(180deg,#161e2b 0%,#22303f 100%);color:#fff;overflow-y:auto;z-index:100}
.sidebar::-webkit-scrollbar{width:6px}
.sidebar::-webkit-scrollbar-thumb{background:rgba(255,255,255,.18);border-radius:3px}
.logo{padding:20px 18px;border-bottom:1px solid rgba(255,255,255,.08)}
.logo h2{font-size:15px;color:#4fc3f7;letter-spacing:1px}
.logo p{font-size:10px;color:#7d8b9c;margin-top:5px;letter-spacing:.5px}
.nav-group{padding:6px 0 2px}
.nav-title{padding:10px 18px 6px;font-size:11px;color:#66798d;letter-spacing:1px}
.nav-item{padding:10px 18px;display:flex;align-items:center;gap:9px;font-size:13px;color:#b6c2cf;cursor:pointer;border-left:3px solid transparent;transition:.15s}
.nav-item:hover{background:rgba(255,255,255,.06);color:#fff}
.nav-item.active{background:rgba(79,195,247,.12);color:#4fc3f7;border-left-color:#4fc3f7}
.nav-item .ic{width:16px;text-align:center;font-size:13px;opacity:.9}
.main{margin-left:224px;min-height:100vh;display:flex;flex-direction:column}
.header{height:56px;background:#fff;box-shadow:0 1px 4px rgba(16,24,40,.06);display:flex;align-items:center;padding:0 22px;position:sticky;top:0;z-index:60}
.header .title{font-size:15px;font-weight:600;color:#1a2332}
.header .crumb{font-size:12px;color:#98a2b3;margin-left:10px}
.header .right{margin-left:auto;display:flex;align-items:center;gap:14px;font-size:12px;color:#667085}
.avatar{width:30px;height:30px;border-radius:50%;background:linear-gradient(135deg,#4fc3f7,#2f7cf6);color:#fff;display:flex;align-items:center;justify-content:center;font-size:12px;font-weight:600}
.content{padding:18px 22px 40px;flex:1}
/* ---------- 卡片 & 统计 ---------- */
.stats{display:grid;grid-template-columns:repeat(4,1fr);gap:14px;margin-bottom:14px}
.stat{background:#fff;border-radius:10px;padding:18px 18px 16px;box-shadow:0 1px 3px rgba(16,24,40,.07);position:relative;overflow:hidden}
.stat::before{content:'';position:absolute;left:0;top:0;bottom:0;width:4px}
.stat.blue::before{background:#2f7cf6}.stat.green::before{background:#12b76a}
.stat.orange::before{background:#f79009}.stat.red::before{background:#f04438}
.stat .lbl{font-size:12px;color:#8a94a6}
.stat .val{font-size:26px;font-weight:700;color:#1a2332;margin-top:8px;letter-spacing:-.5px}
.stat .hint{font-size:11px;color:#98a2b3;margin-top:6px}
.card{background:#fff;border-radius:10px;box-shadow:0 1px 3px rgba(16,24,40,.07);padding:18px;margin-bottom:14px}
.card-h{display:flex;align-items:center;justify-content:space-between;margin-bottom:14px}
.card-h h3{font-size:14px;color:#1a2332;font-weight:600}
.card-h .extra{font-size:12px;color:#8a94a6}
/* ---------- 工具条 ---------- */
.toolbar{display:flex;gap:10px;align-items:center;flex-wrap:wrap;margin-bottom:14px}
.toolbar .grow{flex:1}
input,select,textarea{padding:8px 11px;border:1px solid #dde3ec;border-radius:7px;font-size:13px;outline:none;background:#fff;color:#2c3648;transition:.15s;font-family:inherit}
input:focus,select:focus,textarea:focus{border-color:#2f7cf6;box-shadow:0 0 0 3px rgba(47,124,246,.1)}
.btn{padding:8px 14px;border-radius:7px;border:1px solid #dde3ec;background:#fff;color:#475467;font-size:13px;cursor:pointer;display:inline-flex;align-items:center;gap:5px;transition:.15s;white-space:nowrap}
.btn:hover{border-color:#2f7cf6;color:#2f7cf6}
.btn.primary{background:#2f7cf6;border-color:#2f7cf6;color:#fff}
.btn.primary:hover{background:#1f66d0}
.btn.success{background:#12b76a;border-color:#12b76a;color:#fff}
.btn.success:hover{background:#0a9a57}
.btn.warn{background:#f79009;border-color:#f79009;color:#fff}
.btn.danger{background:#f04438;border-color:#f04438;color:#fff}
.btn.danger:hover{background:#d92d20}
.btn.sm{padding:4px 9px;font-size:12px;border-radius:5px}
.btn:disabled{opacity:.5;cursor:not-allowed}
/* ---------- 表格 ---------- */
table{width:100%;border-collapse:collapse;font-size:13px}
th{background:#f8fafc;padding:11px 12px;text-align:left;font-weight:600;color:#475467;border-bottom:1px solid #eaecf0;white-space:nowrap;font-size:12px}
td{padding:11px 12px;border-bottom:1px solid #f2f4f7;color:#344054;vertical-align:middle}
tbody tr:hover{background:#f9fbfd}
.num{font-variant-numeric:tabular-nums}
.money{font-weight:600;color:#1a2332;font-variant-numeric:tabular-nums}
.muted{color:#98a2b3;font-size:12px}
.link{color:#2f7cf6;cursor:pointer}
.link:hover{text-decoration:underline}
/* ---------- 标签 ---------- */
.tag{display:inline-block;padding:2px 9px;border-radius:20px;font-size:11px;font-weight:500;white-space:nowrap}
.tag.g{background:#e7f8f0;color:#0a9a57}
.tag.b{background:#e8f1fe;color:#1f5fd0}
.tag.o{background:#fef4e6;color:#c96a05}
.tag.r{background:#feecea;color:#d92d20}
.tag.n{background:#f2f4f7;color:#667085}
.tag.p{background:#f3e8ff;color:#7a3fd4}
/* ---------- 模态 ---------- */
.mask{position:fixed;inset:0;background:rgba(16,24,40,.5);display:none;align-items:center;justify-content:center;z-index:800;padding:20px}
.mask.show{display:flex}
.modal{background:#fff;border-radius:12px;width:100%;max-width:720px;max-height:88vh;display:flex;flex-direction:column;box-shadow:0 24px 60px rgba(0,0,0,.3)}
.modal.wide{max-width:1000px}
.modal-h{padding:16px 20px;border-bottom:1px solid #eaecf0;display:flex;align-items:center;justify-content:space-between}
.modal-h h3{font-size:15px;color:#1a2332}
.modal-h .x{cursor:pointer;color:#98a2b3;font-size:20px;line-height:1;background:none;border:none}
.modal-b{padding:18px 20px;overflow-y:auto;flex:1}
.modal-f{padding:13px 20px;border-top:1px solid #eaecf0;display:flex;justify-content:flex-end;gap:8px}
.form-grid{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.fg label{display:block;font-size:12px;color:#5c6779;margin-bottom:6px}
.fg input,.fg select,.fg textarea{width:100%}
.fg.full{grid-column:1/-1}
/* ---------- 提示 ---------- */
#toast{position:fixed;top:18px;right:18px;z-index:999;display:flex;flex-direction:column;gap:8px}
.toast{padding:11px 18px;border-radius:8px;color:#fff;font-size:13px;box-shadow:0 6px 20px rgba(0,0,0,.18);animation:slideIn .2s}
.toast.ok{background:#12b76a}.toast.err{background:#f04438}.toast.info{background:#2f7cf6}
@keyframes slideIn{from{transform:translateX(20px);opacity:0}to{transform:none;opacity:1}}
/* ---------- 空状态 & 图表 ---------- */
.empty{text-align:center;padding:46px 0;color:#b0b8c4;font-size:13px}
.bars{display:flex;flex-direction:column;gap:10px}
.bar-row{display:flex;align-items:center;gap:10px;font-size:12px}
.bar-row .nm{width:110px;color:#667085;text-align:right;flex-shrink:0}
.bar-wrap{flex:1;background:#f2f4f7;border-radius:4px;height:16px;overflow:hidden}
.bar{height:100%;background:linear-gradient(90deg,#4fc3f7,#2f7cf6);border-radius:4px}
.bar-row .v{width:90px;color:#1a2332;font-weight:600;font-variant-numeric:tabular-nums}
.mini-trend{display:flex;align-items:flex-end;gap:10px;height:120px;padding:8px 4px}
.mini-trend .col{flex:1;display:flex;flex-direction:column;align-items:center;gap:6px}
.mini-trend .barv{width:100%;background:linear-gradient(180deg,#4fc3f7,#2f7cf6);border-radius:4px 4px 0 0;min-height:3px}
.mini-trend .dt{font-size:10px;color:#98a2b3}
.tabs{display:flex;gap:4px;border-bottom:1px solid #eaecf0;margin-bottom:16px}
.tab{padding:9px 16px;font-size:13px;color:#667085;cursor:pointer;border-bottom:2px solid transparent}
.tab.active{color:#2f7cf6;border-bottom-color:#2f7cf6;font-weight:600}
.two{display:grid;grid-template-columns:1fr 1fr;gap:14px}
.three{display:grid;grid-template-columns:repeat(3,1fr);gap:14px}
.kv{display:flex;justify-content:space-between;padding:8px 0;border-bottom:1px dashed #eaecf0;font-size:13px}
.kv span:first-child{color:#8a94a6}
.kv span:last-child{font-weight:600;color:#1a2332}
@media(max-width:1200px){.stats{grid-template-columns:repeat(2,1fr)}.two,.three{grid-template-columns:1fr}}
/* ---------- 移动端卡片 / 底部导航 ---------- */
.mchips{display:flex;gap:8px;overflow-x:auto;padding:2px 0 10px;-webkit-overflow-scrolling:touch;scrollbar-width:none}
.mchips::-webkit-scrollbar{display:none}
.mchip{flex-shrink:0;padding:7px 14px;border-radius:18px;background:#fff;color:#5c6779;font-size:13px;border:1px solid #e6eaf0;cursor:pointer}
.mchip.on{background:#2f7cf6;border-color:#2f7cf6;color:#fff;font-weight:600}
.mtool{display:flex;gap:8px;align-items:center;margin-bottom:10px}
.minput{flex:1;min-width:0;padding:10px 12px}
.mbar{margin-bottom:12px}
.mbar .btn{width:100%;justify-content:center;padding:11px}
.mstat{font-size:12px;color:#8a94a6;margin:2px 2px 10px}
.mstat b{color:#1a2332}
.mneg{color:#d92d20}
.msub{font-size:12px;color:#98a2b3;margin:6px 2px 8px}
.mcard{background:#fff;border-radius:12px;padding:13px 14px;margin-bottom:10px;box-shadow:0 1px 3px rgba(16,24,40,.08)}
.mrow1{display:flex;align-items:center;justify-content:space-between;gap:10px}
.mno{font-size:13px;font-weight:600;color:#1f5fd0;letter-spacing:.3px}
.mrow2{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:8px}
.mstrong{font-size:15px;font-weight:600;color:#1a2332}
.mmoney{font-size:16px;font-weight:700;font-variant-numeric:tabular-nums}
.mqty{font-size:17px;font-weight:700;color:#12b76a;font-variant-numeric:tabular-nums}
.mqty small{font-size:11px;color:#98a2b3;font-weight:400}
.mrow3{display:flex;align-items:center;justify-content:space-between;gap:10px;margin-top:7px;font-size:12px;line-height:1.5}
.macts{display:flex;gap:8px;flex-wrap:wrap;margin-top:11px}
.macts .btn{padding:7px 14px;font-size:13px}
.mfab{position:fixed;right:14px;bottom:74px;z-index:70;background:none;box-shadow:none}
.mfab .btn{padding:11px 18px;border-radius:24px;box-shadow:0 8px 20px rgba(47,124,246,.35)}
#mnav{display:none}
body.mobile #mnav{display:flex;position:fixed;left:0;right:0;bottom:0;height:58px;background:#fff;border-top:1px solid #e9edf2;z-index:200;padding-bottom:env(safe-area-inset-bottom);box-shadow:0 -2px 10px rgba(16,24,40,.06)}
body.mobile .mtab{flex:1;display:flex;flex-direction:column;align-items:center;justify-content:center;gap:2px;font-size:11px;color:#7a8798;cursor:pointer}
body.mobile .mtab .mi{font-size:19px;line-height:1.1;filter:grayscale(.25)}
body.mobile .mtab.on{color:#2f7cf6;font-weight:600}
body.mobile .mtab.on .mi{filter:none}
body.mobile #toast{top:auto;bottom:70px;right:12px;left:12px;align-items:center}

@media(max-width:820px){
  body.mobile .sidebar{display:none}
  body.mobile .main{margin-left:0;padding-bottom:66px}
  body.mobile .header{height:50px;padding:0 14px}
  body.mobile .header .crumb{display:none}
  body.mobile .header .right{gap:8px}
  body.mobile .header .right #userRole{display:none}
  body.mobile .header .right #userName{max-width:96px;overflow:hidden;text-overflow:ellipsis;white-space:nowrap}
  body.mobile .content{padding:10px 12px 12px}
  body.mobile .stats{grid-template-columns:repeat(2,1fr);gap:10px}
  body.mobile .stat{padding:12px 13px}
  body.mobile .stat .val{font-size:20px;margin-top:4px}
  body.mobile .card{padding:13px;border-radius:12px}
  body.mobile .toolbar{gap:8px}
  body.mobile .two,.three{grid-template-columns:1fr}
  body.mobile .form-grid{grid-template-columns:1fr}
  body.mobile input,body.mobile select,body.mobile textarea{font-size:16px;padding:10px 12px}
  body.mobile .btn{padding:9px 14px;font-size:14px}
  body.mobile .mitem{padding:11px 0;border-bottom:1px solid #f2f4f7}
  body.mobile .mitem:last-child{border-bottom:none}
  body.mobile .mact2{display:flex;align-items:center;gap:8px;margin-top:9px}
  body.mobile .mact2 label{font-size:12px;color:#8a94a6}
  body.mobile .mact2 input{flex:1;min-width:0;padding:8px 10px;font-size:15px}
  body.mobile .mitems{padding:2px 0}
  body.mobile .org-banner{padding:8px 12px;font-size:12px}
  body.mobile .org-chip{display:none}
  body.mobile .reg-row{grid-template-columns:1fr}
  body.mobile .oline{flex-wrap:wrap}
  body.mobile .oline #no_prod{flex:0 0 100%!important;width:100%!important;max-width:none}
  body.mobile .oline #no_qty{flex:0 0 80px;width:80px!important}
  body.mobile .oline .btn{flex:1;justify-content:center}
  body.mobile .mask{padding:0;align-items:stretch}
  body.mobile .modal{max-width:100%;max-height:100%;height:100dvh;border-radius:0}
  body.mobile .modal-b{padding:14px}
  body.mobile .modal-f{padding:12px 14px calc(12px + env(safe-area-inset-bottom));position:sticky;bottom:0;background:#fff}
  body.mobile .modal-f .btn{flex:1;justify-content:center;padding:11px}
  body.mobile table{font-size:13px}
  body.mobile th,body.mobile td{padding:9px 10px}
  body.mobile .bars .bar-row .nm{width:76px;font-size:11px}
  body.mobile .bar-row .v{width:72px;font-size:12px}
  body.mobile .mini-trend{height:110px;gap:6px}
  body.mobile .login-box{width:calc(100% - 32px);padding:30px 22px 24px;border-radius:12px}
  body.mobile .login-box h1{font-size:20px}
  body.mobile .login-logo img{width:188px}
  body.mobile #loginPage{min-height:100dvh;padding:20px 0}
}
/* ---------- 登录页双入口 ---------- */
.login-tabs{display:flex;gap:6px;background:#f5f7fa;border-radius:9px;padding:4px;margin-bottom:20px}
.ltab{flex:1;text-align:center;padding:8px 0;font-size:13px;color:#5c6779;border-radius:7px;cursor:pointer;transition:.15s}
.ltab.on{background:#fff;color:#2f7cf6;font-weight:600;box-shadow:0 1px 3px rgba(16,24,40,.08)}
.reg-row{display:grid;grid-template-columns:1fr 1fr;gap:10px}
.reg-row > div{display:block}
/* ---------- 组织标识 / 到期提醒 ---------- */
.org-chip{font-size:12px;color:#667085;background:#f2f5fa;border-radius:20px;padding:4px 10px;display:inline-flex;align-items:center;gap:4px;max-width:260px;overflow:hidden;white-space:nowrap}
.org-chip b.ok{color:#0a9a57}.org-chip b.warn{color:#c96a05}.org-chip b.danger{color:#d92d20}
.org-banner{display:flex;align-items:center;justify-content:space-between;gap:12px;padding:9px 22px;font-size:13px;background:#fff7e6;color:#b25e09;border-bottom:1px solid #ffe7ba}
.org-banner.danger{background:#feecea;color:#d92d20;border-bottom-color:#fecdca}
.org-banner a{color:inherit;font-weight:600;text-decoration:underline;cursor:pointer;white-space:nowrap}
.org-banner.hide{display:none}
/* ---------- 到期提醒列表 ---------- */
.notice{display:flex;gap:12px;padding:10px 0;border-bottom:1px dashed #eaecf0;font-size:13px}
.notice:last-child{border-bottom:none}
.notice .nd{color:#98a2b3;font-size:12px;flex:0 0 84px}
.notice .nc{color:#344054;line-height:1.6}
.notice.warn .nc{color:#c96a05}.notice.danger .nc{color:#d92d20}
td.acts{white-space:nowrap}
td.acts .btn{margin-right:4px}
td.acts .btn:last-child{margin-right:0}
