From 761073fffc4cb81b01012dd32680330da95d286c Mon Sep 17 00:00:00 2001 From: imengying Date: Sun, 13 Sep 2026 00:39:54 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E5=A4=8D=E6=9C=8D=E5=8A=A1=E5=99=A8?= =?UTF-8?q?=E5=8D=A1=E7=89=87=E6=8C=87=E6=A0=87=E8=A1=8C=E5=9C=A8=E4=B8=8D?= =?UTF-8?q?=E5=B9=B3=E5=8F=B0=E7=9A=84=E5=AF=B9=E9=BD=90=E9=97=AE=E9=A2=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 指标格的标签行与详情行使用 line-height: normal,行盒高度由实际 渲染字体决定:CJK 回退字体(如 Windows 的雅黑)的 normal 行高大于 拉丁文本,同排格子会互相错位,把进度条与详情行顶偏 2-4px。 改为固定行高(标签行 16px、详情行 14px),格子内三段(标签/进度条/ 详情)的纵向位置在全平台保持一致。已用 demo 页逐卡测量:8 卡 × 4 格 仅存在一组几何值(headH=16、subH=14、barDelta=20)。 --- frontend/src/styles/dashboard.css | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/frontend/src/styles/dashboard.css b/frontend/src/styles/dashboard.css index 86ea6c1..531a169 100644 --- a/frontend/src/styles/dashboard.css +++ b/frontend/src/styles/dashboard.css @@ -70,10 +70,11 @@ .metric-grid { display: grid; gap: 10px 16px; grid-template-columns: 1fr 1fr; } .metric { display: flex; min-width: 0; flex-direction: column; gap: 4px; } .metric.muted { opacity: .55; } -.metric > div { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; } +/* 固定行高:CJK 回退字体的 normal 行高大于拉丁文本,浮动行高会把进度条与下一行顶偏 */ +.metric > div { display: flex; min-width: 0; align-items: center; justify-content: space-between; gap: 8px; font-size: 13px; line-height: 16px; } .metric span, .metric small { color: var(--muted-foreground); } .metric strong { font-weight: 500; font-variant-numeric: tabular-nums; } -.metric small { overflow: hidden; font-size: 12px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; } +.metric small { overflow: hidden; font-size: 12px; font-variant-numeric: tabular-nums; text-overflow: ellipsis; white-space: nowrap; line-height: 14px; } .progress-track { display: block; width: 100%; height: 4px; overflow: hidden; border-radius: 2px; background: color-mix(in srgb, var(--foreground) 9%, transparent); } .progress-fill { display: block; height: 100%; border-radius: 2px; transition: width 300ms ease; } .progress-fill.good { background: var(--success-bar); }