/* ===== 天平最小取样量 · 天平台 ===== */
.bal {
    background: #fbfbfc;
    border: 1px solid #e4e6ec;
    border-radius: 12px;
    padding: 24px 22px;
    margin-bottom: 26px;
    box-shadow: 0 10px 30px rgba(40, 50, 70, .07);
}

.bal-stage {
    display: grid;
    grid-template-columns: 220px 1fr;
    gap: 26px;
    align-items: center;
}

/* ---- 天平 ---- */
.bal-scale {
    position: relative; width: 196px; height: 200px; margin: 0 auto;
}
.bal-column {
    position: absolute; left: 50%; bottom: 30px; transform: translateX(-50%);
    width: 12px; height: 92px;
    background: linear-gradient(90deg, #cbd5e1, #e2e8f0 45%, #94a3b8);
    border-radius: 3px 3px 0 0;
}
.bal-base {
    position: absolute; left: 50%; bottom: 0; transform: translateX(-50%);
    width: 172px; height: 34px;
    background: linear-gradient(180deg, #e2e8f0, #cbd5e1 60%, #b9c4d3);
    border-radius: 6px 6px 10px 10px;
    box-shadow: 0 6px 14px rgba(51, 65, 85, .18);
}
.bal-base::after {
    content: '';
    position: absolute; left: 12px; right: 12px; bottom: 6px; height: 2px;
    background: rgba(148, 163, 184, .7); border-radius: 1px;
}
.bal-pan {
    position: absolute; left: 50%; bottom: 118px; transform: translateX(-50%);
    width: 118px; height: 12px;
    background: linear-gradient(180deg, #f1f5f9, #cbd5e1);
    border-radius: 50%;
    box-shadow: 0 2px 5px rgba(51, 65, 85, .22);
}
.bal-sample {
    position: absolute; left: 50%; bottom: 130px; transform: translateX(-50%);
    width: 34px; height: 26px;
    background: linear-gradient(180deg, #fde68a, #f59e0b);
    border-radius: 4px 4px 2px 2px;
    box-shadow: 0 2px 5px rgba(180, 83, 9, .28);
    transition: width .35s, height .35s;
}
.bal-sample::after {
    content: '';
    position: absolute; left: 3px; right: 3px; top: 3px; height: 3px;
    background: rgba(255, 255, 255, .55); border-radius: 2px;
}
.bal-display {
    position: absolute; left: 50%; bottom: 48px; transform: translateX(-50%);
    background: #0f172a; color: #4ade80;
    font: 700 13px/1 ui-monospace, monospace;
    padding: 5px 10px; border-radius: 4px; letter-spacing: .02em;
    box-shadow: inset 0 0 8px rgba(74, 222, 128, .2);
    z-index: 2; white-space: nowrap;
}
.bal-bubble {
    position: absolute; right: 22px; bottom: 8px;
    width: 20px; height: 20px; border-radius: 50%;
    border: 2px solid #b9c4d3; background: #f8fafc;
    overflow: hidden;
}
.bal-bubble::after {
    content: '';
    position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
    width: 7px; height: 7px; border-radius: 50%; background: #22c55e;
}
.bal-caption {
    text-align: center; font: 700 10px/1.4 ui-monospace, monospace; color: #8c93a3;
}
.bal-caption em { display: block; font-style: normal; font-size: 9px; color: #b0b6c3; font-weight: 400; }

/* ---- 读数 ---- */
.bal-read {
    background: #fff; border: 1px solid #e4e6ec; border-radius: 10px;
    padding: 16px 18px; display: flex; flex-direction: column; gap: 12px;
}
.bal-big small { font-size: 10px; color: #8c93a3; letter-spacing: .05em; display: block; }
.bal-big b {
    font: 700 34px/1 ui-monospace, Consolas, monospace; color: #0f172a;
    font-variant-numeric: tabular-nums; letter-spacing: -.02em;
}
.bal-big b em { font-style: normal; font-size: 12px; color: #8c93a3; font-weight: 400; }
.bal-big i {
    font-style: normal; font-size: 11px; font-weight: 700; margin-left: 8px;
    padding: 4px 10px; border-radius: 4px; vertical-align: middle;
    background: #eff6ff; color: #1d4ed8; border: 1px solid #bfdbfe;
}
.bal-big i.bad { background: #fef2f2; color: #b91c1c; border-color: #fecaca; }

.bal-cards { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.bal-card {
    background: #f8fafc; border: 1px solid #e8ebf1; border-radius: 7px; padding: 8px 10px;
}
.bal-card span { display: block; font-size: 9.5px; color: #8c93a3; }
.bal-card b {
    font: 700 13px/1.35 ui-monospace, monospace; color: #1e293b;
    font-variant-numeric: tabular-nums;
}
.bal-card b em { font-style: normal; font-size: 9px; color: #8c93a3; font-weight: 400; }

/* ---- 刻度尺 ---- */
.bal-ruler { margin-top: 20px; }
.bal-ruler-head {
    display: flex; justify-content: space-between; align-items: baseline;
    font-size: 10.5px; color: #8c93a3; margin-bottom: 6px;
}
.bal-ruler-head b { color: #1d4ed8; font-family: ui-monospace, monospace; }
.bal-track {
    position: relative; height: 34px; border-radius: 6px;
    background: linear-gradient(90deg, #fee2e2 0%, #fef3c7 26%, #dcfce7 52%, #dbeafe 100%);
    border: 1px solid #e4e6ec; overflow: hidden;
}
.bal-track-mark {
    position: absolute; top: 0; bottom: 0; width: 2px;
    background: #1d4ed8; transition: left .4s;
}
.bal-track-mark::after {
    content: attr(data-label);
    position: absolute; top: -1px; left: 4px;
    font: 700 8.5px/1.4 ui-monospace, monospace; color: #1d4ed8;
    background: rgba(255, 255, 255, .8); padding: 1px 3px; border-radius: 2px;
    white-space: nowrap;
}
.bal-track-cur {
    position: absolute; top: 0; bottom: 0; width: 2px;
    background: #b45309; transition: left .4s;
}
.bal-track-cur::after {
    content: attr(data-label);
    position: absolute; bottom: 1px; left: 4px;
    font: 700 8.5px/1.4 ui-monospace, monospace; color: #b45309;
    background: rgba(255, 255, 255, .8); padding: 1px 3px; border-radius: 2px;
    white-space: nowrap;
}
.bal-track-axis {
    display: flex; justify-content: space-between;
    font: 700 8px/1 ui-monospace, monospace; color: #a8afbd; margin-top: 4px;
}

/* ---- 参数 ---- */
.bal-params { margin-top: 18px; border-top: 1px solid #e4e6ec; padding-top: 15px; }
.bal-params h2 { font-size: 12px; letter-spacing: .07em; color: #4b5563; margin: 0 0 11px; }
.bal-grid { display: grid; grid-template-columns: repeat(5, 1fr); gap: 10px; }
.bal-grid label { display: flex; flex-direction: column; gap: 4px; }
.bal-grid span { font-size: 10.5px; color: #8c93a3; }
.bal-grid input, .bal-grid select {
    font: inherit; font-size: 12px; padding: 7px 9px; border: 1px solid #e4e6ec;
    border-radius: 5px; background: #fff; color: #1e293b; font-variant-numeric: tabular-nums;
    min-width: 0;
}
.bal-grid input:focus, .bal-grid select:focus { outline: 2px solid rgba(29, 78, 216, .14); border-color: #1d4ed8; }
.bal-grid input.is-bad { border-color: #dc2626; background: #fff1f2; }

.bal-verdict {
    margin: 15px 0 0; padding: 10px 13px; border-radius: 8px;
    font-size: 11.5px; line-height: 1.7; color: #1e3a5f; background: #f1f6fc;
    border-left: 3px solid #3b82f6;
}
.bal-verdict.bad { color: #9f1239; background: #fff5f7; border-left-color: #e11d48; }

@media (max-width: 860px) {
    .bal-stage { grid-template-columns: 1fr; justify-items: center; }
    .bal-read { width: 100%; }
    .bal-grid { grid-template-columns: 1fr 1fr 1fr; }
}
@media (max-width: 560px) {
    .bal { padding: 16px 13px; }
    .bal-grid { grid-template-columns: 1fr 1fr; }
    .bal-cards { grid-template-columns: 1fr 1fr; }
    .bal-big b { font-size: 27px; }
}

/* ---- 深色 ---- */
[data-theme="dark"] .bal { background: #0f1116; border-color: #262a33; box-shadow: none; }
[data-theme="dark"] .bal-read { background: #151920; border-color: #262a33; }
[data-theme="dark"] .bal-column { background: linear-gradient(90deg, #334155, #475569 45%, #1e293b); }
[data-theme="dark"] .bal-base { background: linear-gradient(180deg, #334155, #26303d 60%, #1e2733); }
[data-theme="dark"] .bal-pan { background: linear-gradient(180deg, #475569, #334155); }
[data-theme="dark"] .bal-big b { color: #e2e8f0; }
[data-theme="dark"] .bal-big small, [data-theme="dark"] .bal-card span, [data-theme="dark"] .bal-grid span, [data-theme="dark"] .bal-caption { color: #8c93a3; }
[data-theme="dark"] .bal-card { background: #1a1f27; border-color: #262a33; }
[data-theme="dark"] .bal-card b { color: #cbd5e1; }
[data-theme="dark"] .bal-track { border-color: #262a33; background: linear-gradient(90deg, rgba(127,29,29,.35), rgba(120,53,15,.28) 26%, rgba(6,78,59,.3) 52%, rgba(30,58,138,.35) 100%); }
[data-theme="dark"] .bal-params { border-color: #262a33; }
[data-theme="dark"] .bal-params h2 { color: #cbd5e1; }
[data-theme="dark"] .bal-grid input, [data-theme="dark"] .bal-grid select { background: #151920; border-color: #262a33; color: #e2e8f0; }
[data-theme="dark"] .bal-verdict { background: rgba(59, 130, 246, .12); color: #bfdbfe; }
[data-theme="dark"] .bal-verdict.bad { background: rgba(190, 18, 60, .12); color: #fda4af; }
