/* 独立称重台（自适应弹窗） */
.wst{
    position:fixed;
    inset:0;
    z-index:20000;
    display:none;
    align-items:center;
    justify-content:center;
    padding:clamp(8px,2.5vh,24px);
    background:rgba(15,20,40,.45);
    backdrop-filter:blur(2px);
}
.wst.on{display:flex;}
.wst-dialog{
    width:min(1180px,96vw);
    height:min(800px,94vh);
    display:flex;
    flex-direction:column;
    background:#f4f5f8;
    border-radius:18px;
    overflow:hidden;
    box-shadow:0 24px 70px rgba(15,20,40,.30);
    color:#1d1d1f;
}
.wst-head{
    flex:0 0 auto;
    display:flex;
    align-items:center;
    gap:18px;
    padding:12px 18px;
    background:#fff;
    border-bottom:1px solid #eceef3;
    box-shadow:0 2px 10px rgba(17,24,39,.04);
}
.wst-back{
    border:0;
    background:#f2f4f8;
    color:#4b5563;
    font-size:14px;
    padding:10px 16px;
    border-radius:10px;
    cursor:pointer;
}
.wst-back:hover{background:#e9edf5;color:#111827;}
.wst-title{display:flex;align-items:baseline;gap:10px;min-width:0;}
.wst-title b{font-size:18px;}
.wst-title span{font-size:12.5px;color:#8a909b;}
.wst-scale{
    margin-left:auto;
    display:flex;
    align-items:center;
    gap:8px;
    font-size:12.5px;
    color:#6b7280;
}
.wst-dot{width:8px;height:8px;border-radius:50%;background:#c7ccd6;box-shadow:0 0 0 3px rgba(199,204,214,.25);}
.wst-dot.on{background:#22c55e;box-shadow:0 0 0 3px rgba(34,197,94,.18);}
.wst-conn{
    border:1px solid #dfe3ea;
    background:#fff;
    color:#374151;
    font-size:12.5px;
    padding:8px 14px;
    border-radius:9px;
    cursor:pointer;
}
.wst-conn:hover{border-color:var(--ind-color,#007aff);color:var(--ind-color,#007aff);}

.wst-body{
    flex:1 1 auto;
    min-height:0;
    display:grid;
    grid-template-columns:minmax(0,1fr) 416px;
    gap:14px;
    padding:14px 18px 18px;
}
.wst-left{
    min-width:0;
    display:flex;
    flex-direction:column;
    background:#fff;
    border-radius:16px;
    border:1px solid #eceef3;
    overflow:hidden;
}
.wst-bar{padding:12px 14px 8px;border-bottom:1px solid #f2f3f7;}
.wst-search{
    display:flex;
    align-items:center;
    gap:8px;
    background:#f4f6fa;
    border-radius:11px;
    padding:0 12px;
    height:44px;
}
.wst-search input{
    flex:1;
    border:0;
    background:transparent;
    outline:none;
    font-size:15px;
    color:#111827;
}
.wst-cats{display:flex;gap:8px;overflow-x:auto;padding:10px 0 2px;scrollbar-width:thin;}
.wst-cats::-webkit-scrollbar{height:5px;}
.wst-cats::-webkit-scrollbar-thumb{background:#dfe3ea;border-radius:3px;}
.wst-cat{
    flex:0 0 auto;
    border:1px solid #e6e9f0;
    background:#fff;
    color:#4b5563;
    font-size:13px;
    padding:7px 13px;
    border-radius:9px;
    cursor:pointer;
    white-space:nowrap;
}
.wst-cat.on{background:var(--ind-color,#007aff);border-color:var(--ind-color,#007aff);color:#fff;}

.wst-grid{
    flex:1 1 auto;
    min-height:0;
    overflow-y:auto;
    padding:12px 14px 18px;
    display:grid;
    grid-template-columns:repeat(auto-fill,minmax(158px,1fr));
    gap:10px;
    align-content:start;
}
.wst-card{
    border:1px solid #eceef3;
    border-radius:13px;
    padding:12px 12px 10px;
    background:#fff;
    cursor:pointer;
    transition:border-color .15s, box-shadow .15s, transform .15s;
    min-height:104px;
    display:flex;
    flex-direction:column;
    gap:6px;
}
.wst-card:hover{border-color:#cfd6e4;box-shadow:0 6px 16px rgba(17,24,39,.06);}
.wst-card.on{
    border-color:var(--ind-color,#007aff);
    box-shadow:0 0 0 2px color-mix(in srgb,var(--ind-color,#007aff) 22%,#fff);
    background:color-mix(in srgb,var(--ind-color,#007aff) 4%,#fff);
}
.wst-card-name{font-size:14px;font-weight:600;line-height:1.35;color:#111827;
    display:-webkit-box;-webkit-line-clamp:2;-webkit-box-orient:vertical;overflow:hidden;}
.wst-card-meta{display:flex;align-items:baseline;gap:6px;margin-top:auto;}
.wst-card-price{font-size:16px;font-weight:800;color:var(--ind-color,#007aff);}
.wst-card-unit{font-size:11.5px;color:#9aa1ad;}
.wst-card-stock{font-size:11.5px;color:#9aa1ad;margin-left:auto;}

.wst-empty{
    flex:1;
    display:flex;
    flex-direction:column;
    align-items:center;
    justify-content:center;
    gap:6px;
    color:#9aa1ad;
    font-size:13px;
}
.wst-empty-ic{font-size:44px;opacity:.6;}
.wst-empty p{margin:0;font-size:15px;color:#6b7280;font-weight:600;}

.wst-right{
    display:flex;
    flex-direction:column;
    gap:10px;
    background:#fff;
    border-radius:16px;
    border:1px solid #eceef3;
    padding:14px;
    overflow-y:auto;
}
.wst-cur{
    border-radius:12px;
    background:#f7f8fc;
    padding:12px 14px;
    min-height:74px;
    display:flex;
    align-items:center;
}
.wst-cur-empty{color:#9aa1ad;font-size:13.5px;}
.wst-cur-name{font-size:16px;font-weight:700;line-height:1.35;}
.wst-cur-meta{display:flex;gap:12px;font-size:12.5px;color:#6b7280;margin-top:4px;}

.wst-weight{
    border-radius:14px;
    padding:10px 14px 12px;
    background:linear-gradient(160deg, color-mix(in srgb,var(--ind-color,#007aff) 8%,#fff), #fff);
    border:1px solid color-mix(in srgb,var(--ind-color,#007aff) 16%,#fff);
}
.wst-weight-num{display:flex;align-items:baseline;gap:6px;justify-content:flex-end;}
.wst-weight-num span{font-size:52px;font-weight:800;letter-spacing:-1px;line-height:1.1;font-variant-numeric:tabular-nums;}
.wst-weight-num em{font-style:normal;font-size:15px;color:#8a909b;font-weight:600;}
.wst-weight-sub{display:flex;align-items:center;justify-content:space-between;margin-top:2px;font-size:12.5px;color:#8a909b;}
.wst-amount{font-size:22px;font-weight:800;color:var(--ind-color,#007aff);}
.wst-weight.stable .wst-weight-num span{color:#16a34a;}

.wst-keys{display:grid;grid-template-columns:repeat(3,1fr);gap:8px;}
.wst-keys button{
    height:56px;
    border:1px solid #e6e9f0;
    background:#fff;
    border-radius:12px;
    font-size:21px;
    font-weight:600;
    color:#374151;
    cursor:pointer;
}
.wst-keys button:hover{background:#f5f7fb;border-color:#d5dbe7;}
.wst-keys button:active{transform:translateY(1px);}

.wst-toggles{display:flex;gap:16px;font-size:12.5px;color:#4b5563;}
.wst-toggles label{display:flex;align-items:center;gap:6px;cursor:pointer;}

.wst-add{
    height:58px;
    border:0;
    border-radius:13px;
    background:var(--ind-color,#007aff);
    color:#fff;
    font-size:18px;
    font-weight:700;
    cursor:pointer;
}
.wst-add span{font-size:12px;opacity:.75;font-weight:400;}
.wst-add:disabled{background:#d8dce6;cursor:not-allowed;}

.wst-hint{font-size:12px;color:#8a909b;line-height:1.6;}

.wst-log{border-top:1px dashed #eceef3;padding-top:8px;}
.wst-log-head{font-size:12.5px;color:#6b7280;margin-bottom:6px;}
.wst-log-list{display:flex;flex-direction:column;gap:6px;max-height:132px;overflow-y:auto;}
.wst-log-item{
    display:flex;align-items:center;gap:8px;
    font-size:12.5px;
    background:#f7f8fc;
    border-radius:8px;
    padding:7px 9px;
}
.wst-log-item b{font-weight:600;flex:1;min-width:0;overflow:hidden;text-overflow:ellipsis;white-space:nowrap;}
.wst-log-item span{color:#6b7280;}
.wst-log-item i{font-style:normal;color:#16a34a;font-weight:600;}

@media (max-width:1180px){
    .wst-body{grid-template-columns:minmax(0,1fr) 356px;}
    .wst-weight-num span{font-size:44px;}
    .wst-keys button{height:50px;font-size:19px;}
}
@media (max-width:900px){
    .wst-body{grid-template-columns:1fr;grid-template-rows:minmax(0,1fr) auto;}
    .wst-right{max-height:52vh;}
}
@media (max-width:900px), (max-height:640px){
    .wst{padding:0;}
    .wst-dialog{width:100vw;height:100vh;border-radius:0;}
}
@media (max-width:560px){
    .wst-head{gap:8px;padding:10px 12px;}
    .wst-title span{display:none;}
    .wst-scale{font-size:11.5px;}
}
