/* =====================================================================
 * 07 机械车位限高适配 · CLEARANCE GAUGE
 * 独立设计：工业钢灰 + 荧光绿；首屏右半是一张带刻度尺的实时车库剖面，
 * 限高线为虚线、车体高度随输入实时伸缩，结论区是一盏大号信号灯。
 * ===================================================================== */
.mph {
    --ag-bg: #f0f2f3;
    --ag-bg2: #e3e8ea;
    --ag-surface: #ffffff;
    --ag-surface2: #f6f8f8;
    --ag-ink: #1f2b30;
    --ag-ink2: #4f6066;
    --ag-muted: #88979c;
    --ag-line: #d8e0e2;
    --ag-line2: #bccccf;
    --ag-accent: #3b6b62;
    --ag-accent2: #6cae2c;
    --ag-on: #f4fbf7;
    --ag-ok: #2f7a3f;
    --ag-okbg: #e4f3e2;
    --ag-warn: #9a6416;
    --ag-warnbg: #fbefd5;
    --ag-bad: #ad423c;
    --ag-badbg: #fae8e6;
    --ag-info: #3b6b84;
    --ag-infobg: #e5f0f4;
    --ag-r: 4px;
    --ag-shadow: 0 3px 0 rgba(31, 43, 48, .05), 0 12px 28px rgba(31, 43, 48, .08);
    --ag-h: "HarmonyOS Sans SC", "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    --ag-b: "PingFang SC", "Microsoft YaHei", system-ui, sans-serif;
    --ag-m: "JetBrains Mono", Consolas, monospace;
    font-family: var(--ag-b);
}
:root[data-theme="dark"] .mph {
    --ag-bg: #101618;
    --ag-bg2: #192325;
    --ag-surface: #1a2426;
    --ag-surface2: #202d30;
    --ag-ink: #e9f0ef;
    --ag-ink2: #afc2c1;
    --ag-muted: #869b9a;
    --ag-line: #2c3b3d;
    --ag-line2: #3b5052;
    --ag-accent: #8cc9b8;
    --ag-accent2: #a5d95e;
    --ag-on: #0f1a18;
    --ag-ok: #8ed36f;
    --ag-okbg: #1c3520;
    --ag-warn: #e5bd73;
    --ag-warnbg: #382c17;
    --ag-bad: #ef9a90;
    --ag-badbg: #3a221f;
    --ag-info: #8dc3d6;
    --ag-infobg: #1b333b;
    --ag-shadow: 0 12px 32px rgba(0, 0, 0, .4);
}
.mph { background: var(--ag-bg) repeating-linear-gradient(90deg, transparent 0 39px, rgba(59, 107, 98, .035) 39px 40px); }
.mph h1, .mph h2, .mph h3 { letter-spacing: -.02em; }
.mph input, .mph select, .mph textarea {
    width: 100%; background: var(--ag-surface2); color: var(--ag-ink);
    border: 1px solid var(--ag-line2); border-radius: 3px; padding: 8px 10px;
    font-size: 13.5px; line-height: 1.6; outline: none;
}
.mph input:focus, .mph select:focus, .mph textarea:focus { border-color: var(--ag-accent2); box-shadow: inset 0 -2px 0 var(--ag-accent2); }
.mph textarea { resize: vertical; font-family: var(--ag-m); font-size: 12.5px; }
.mph label { display: block; font-size: 12px; font-weight: 650; color: var(--ag-ink2); margin-bottom: 5px; }
.mph code { background: var(--ag-bg2); color: var(--ag-accent); }

/* ---------- 首屏 ---------- */
.mph-hero { display: grid; grid-template-columns: 1fr 1fr; background: var(--ag-surface); border: 1px solid var(--ag-line2); border-top: 5px solid var(--ag-accent); box-shadow: var(--ag-shadow); }
.mph-input-col { padding: 30px 30px 26px; border-right: 1px dashed var(--ag-line2); }
.mph-kicker { display: inline-block; font-family: var(--ag-m); font-size: 10px; letter-spacing: .2em; color: var(--ag-accent); border: 1px solid var(--ag-line2); border-left: 3px solid var(--ag-accent2); padding: 5px 12px; margin-bottom: 16px; }
.mph-hero h1 { font-size: clamp(28px, 3.4vw, 42px); font-weight: 850; margin-bottom: 12px; }
.mph-lede { font-size: 14px; line-height: 2; color: var(--ag-ink2); max-width: 40em; }
.mph-lede b { color: var(--ag-accent); font-weight: 750; }
.mph-fields { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; margin-top: 22px; }
.mph-field.wide { grid-column: 1 / -1; }
.mph-num { display: grid; grid-template-columns: 1fr 76px; gap: 0; }
.mph-num input { border-radius: 3px 0 0 3px; border-right: 0; font-family: var(--ag-m); font-size: 14px; font-weight: 700; }
.mph-num select { border-radius: 0 3px 3px 0; font-family: var(--ag-m); font-size: 12px; text-align: center; }
.mph-unit { display: grid; place-items: center; border: 1px solid var(--ag-line2); border-left: 0; border-radius: 0 3px 3px 0; background: var(--ag-bg2); font-family: var(--ag-m); font-size: 12px; color: var(--ag-ink2); }
.mph-quick-btns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 20px; }
.mph-quick-note { font-size: 11.5px; line-height: 1.8; color: var(--ag-muted); margin: 13px 0 0; padding-top: 10px; border-top: 1px dotted var(--ag-line2); }

.mph-section { padding: 22px 24px; background: #16272a; color: #dcece8; }
:root[data-theme="dark"] .mph-section { background: #0d1b1d; }
.mph-section-hd { display: flex; align-items: center; justify-content: space-between; gap: 10px; font-family: var(--ag-m); font-size: 10.5px; letter-spacing: .14em; color: #8fb9b1; border-bottom: 1px solid #2c4648; padding-bottom: 10px; margin-bottom: 14px; }
.mph-section-hd span { color: #b9e26f; font-weight: 700; }
.mph-diagram { display: grid; grid-template-columns: 40px 1fr; gap: 8px; height: 260px; }
.mph-ruler { display: flex; flex-direction: column; justify-content: space-between; font-family: var(--ag-m); font-size: 9px; color: #77948f; padding: 4px 0; text-align: right; }
.mph-plot { position: relative; border-left: 1px solid #3b5b5c; border-bottom: 2px solid #6e8d8a; }
.mph-line { position: absolute; left: 0; right: 0; border-top: 2px dashed #6ea8a0; }
.mph-line span { position: absolute; right: 4px; top: -19px; font-family: var(--ag-m); font-size: 9.5px; color: #a8d3cc; background: #16272a; padding: 0 4px; }
.mph-line-stall { border-top-color: #b9e26f; }
.mph-line-stall span { color: #c8e98a; }
.mph-line b { font-weight: 700; }
.mph-car { position: absolute; bottom: 2px; left: 28%; width: 46%; display: flex; flex-direction: column; align-items: center; transition: height .25s ease; }
.mph-car-body { position: relative; width: 100%; height: calc(100% - 12px); border: 2px solid #cfe0dc; border-bottom: 0; border-radius: 32px 32px 4px 4px; background: linear-gradient(180deg, rgba(110, 168, 160, .35), rgba(110, 168, 160, .12)); display: grid; place-items: center; }
.mph-car-body > span { font-family: var(--ag-m); font-size: 11px; color: #e7f3f0; font-weight: 700; }
.mph-addon { position: absolute; top: -12px; left: 28%; right: 28%; height: 10px; background: #b9e26f; border-radius: 4px 4px 0 0; opacity: 0; transition: opacity .2s; }
.mph-wheels { width: 100%; height: 12px; display: flex; justify-content: space-between; padding: 0 9%; }
.mph-wheels i { width: 20px; height: 12px; border-radius: 0 0 6px 6px; background: #cfe0dc; }
.mph-ground { position: absolute; left: 0; right: 0; bottom: -2px; height: 2px; background: #6e8d8a; }
.mph-art { display: block; width: 100%; max-width: 260px; height: auto; margin: 16px auto 0; opacity: .7; }
.mph-live { margin-top: 12px; padding: 9px 11px; font-family: var(--ag-m); font-size: 11px; line-height: 1.8; color: #a8cdc6; background: rgba(255, 255, 255, .04); border-left: 2px solid #b9e26f; }

/* ---------- 按钮 ---------- */
.mph-btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; padding: 9px 16px; border: 1px solid transparent; border-radius: 3px; font-size: 13px; font-weight: 750; transition: transform .13s, box-shadow .13s, background .13s; }
.mph-btn:hover { transform: translateY(-1px); }
.mph-btn:disabled { opacity: .55; cursor: not-allowed; transform: none; }
.mph-btn-main { background: var(--ag-accent2); color: #16251a; box-shadow: 0 5px 14px rgba(108, 174, 44, .24); }
.mph-btn-soft { background: var(--ag-accent); color: #fff; }
.mph-btn-line { background: transparent; color: var(--ag-ink2); border-color: var(--ag-line2); }
.mph-btn-line:hover { border-color: var(--ag-accent); color: var(--ag-accent); }
.mph-btn-mini { padding: 4px 10px; font-size: 11.5px; }

/* ---------- 区块 ---------- */
.mph-sec-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; flex-wrap: wrap; margin: 42px 0 16px; }
.mph-sec-hd h2 { font-size: 21px; display: flex; align-items: center; gap: 11px; }
.mph-sec-hd h2 i { font-family: var(--ag-m); font-style: normal; font-size: 10.5px; color: #fff; background: var(--ag-accent); padding: 3px 8px; border-radius: 3px; }
.mph-sec-hd span { font-size: 12px; color: var(--ag-muted); }
.mph-verdict { display: flex; align-items: center; gap: 20px; padding: 20px 24px; background: var(--ag-surface); border: 1px solid var(--ag-line2); border-left: 5px solid var(--ag-line2); }
.mph-verdict.ok { border-left-color: var(--ag-accent2); }
.mph-verdict.no { border-left-color: var(--ag-bad); }
.mph-lamp { width: 52px; height: 52px; flex: none; border-radius: 50%; background: var(--ag-bg2); border: 4px solid var(--ag-line2); }
.mph-verdict.ok .mph-lamp { background: var(--ag-accent2); border-color: #c7e7a2; box-shadow: 0 0 0 7px rgba(108, 174, 44, .16); }
.mph-verdict.no .mph-lamp { background: var(--ag-bad); border-color: #f0b8b3; box-shadow: 0 0 0 7px rgba(173, 66, 60, .14); }
.mph-verdict h3 { font-size: 20px; margin-bottom: 3px; }
.mph-verdict p { margin: 0; font-size: 12.8px; line-height: 1.8; color: var(--ag-ink2); }
.mph-formula { margin-top: 12px; padding: 12px 16px; background: var(--ag-surface2); border: 1px dashed var(--ag-line2); font-family: var(--ag-m); font-size: 12px; line-height: 1.9; color: var(--ag-ink2); overflow-wrap: anywhere; }
.mph-formula b { color: var(--ag-accent); }
.mph-err { margin-top: 12px; padding: 10px 13px; background: var(--ag-badbg); color: var(--ag-bad); font-size: 12.5px; }
.mph-actions { display: flex; flex-wrap: wrap; gap: 9px; margin-top: 18px; }
.mph-stats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; margin-bottom: 14px; }
.mph-stat { background: var(--ag-surface); border: 1px solid var(--ag-line); border-top: 3px solid var(--ag-accent); padding: 12px 15px; }
.mph-stat small { display: block; font-size: 11px; color: var(--ag-muted); }
.mph-stat b { display: block; font-family: var(--ag-m); font-size: 19px; line-height: 1.5; }
.mph-result-grid { display: grid; grid-template-columns: 1.15fr 1fr; gap: 14px; }
.mph-panel { background: var(--ag-surface); border: 1px solid var(--ag-line); padding: 18px 20px; min-width: 0; }
.mph-panel-hd { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; border-bottom: 1px solid var(--ag-line); padding-bottom: 9px; margin-bottom: 12px; }
.mph-panel-hd h3 { font-size: 16px; }
.mph-panel-hd span { font-size: 11px; color: var(--ag-muted); }
.mph-scroll { overflow-x: auto; margin-top: 14px; }
.mph-table { width: 100%; min-width: 620px; font-size: 12.5px; }
.mph-table th { text-align: left; background: var(--ag-bg2); color: var(--ag-ink2); font-size: 11px; padding: 8px 10px; border-bottom: 2px solid var(--ag-line2); white-space: nowrap; }
.mph-table td { padding: 8px 10px; border-bottom: 1px dotted var(--ag-line); line-height: 1.7; font-family: var(--ag-m); }
.mph-ok { color: var(--ag-ok); font-weight: 700; }
.mph-no { color: var(--ag-bad); font-weight: 700; }
.mph-risks { display: grid; gap: 8px; }
.mph-risk { display: flex; gap: 9px; align-items: flex-start; padding: 9px 11px; border-left: 3px solid var(--ag-line2); background: var(--ag-surface2); font-size: 12.5px; line-height: 1.8; }
.mph-risk.lv1 { border-left-color: var(--ag-bad); background: var(--ag-badbg); }
.mph-risk.lv2 { border-left-color: var(--ag-warn); background: var(--ag-warnbg); }
.mph-risk i { font-family: var(--ag-m); font-style: normal; font-size: 10px; color: var(--ag-muted); flex: none; }
.mph-clean { display: flex; align-items: center; flex-wrap: wrap; gap: 6px; margin-top: 12px; font-size: 11.5px; }
.mph-clean > b { color: var(--ag-ink2); }
.mph-clean #mphPreview { flex: 1 1 100%; font-family: var(--ag-m); font-size: 11px; color: var(--ag-muted); background: var(--ag-surface2); border-left: 2px solid var(--ag-accent2); padding: 6px 9px; overflow-wrap: anywhere; white-space: normal; }
.mph-panel > label { font-size: 12px; margin-bottom: 8px; line-height: 1.8; }
.mph-read { margin-top: 46px; padding: 26px 28px; background: var(--ag-surface); border: 1px solid var(--ag-line2); border-top: 5px solid var(--ag-accent2); }
.mph-read h2 { font-size: 21px; margin-bottom: 16px; }
.mph-read p { font-size: 14px; line-height: 2.05; color: var(--ag-ink2); margin-bottom: 14px; }
.mph-read p:last-child { margin-bottom: 0; }
.mph-read b { color: var(--ag-accent); font-weight: 750; }

@media (max-width: 1080px) {
    .mph-hero { grid-template-columns: 1fr; }
    .mph-input-col { border-right: 0; border-bottom: 1px dashed var(--ag-line2); }
    .mph-art { display: none; }
    .mph-result-grid { grid-template-columns: 1fr; }
    .mph-stats { grid-template-columns: repeat(2, 1fr); }
}
@media (max-width: 720px) {
    .mph-input-col, .mph-section { padding: 22px 16px; }
    .mph-fields { grid-template-columns: 1fr; }
    .mph-field.wide { grid-column: auto; }
    .mph-diagram { height: 220px; }
    .mph-read { padding: 20px 18px; }
}
