64 lines
1.4 KiB
CSS
64 lines
1.4 KiB
CSS
/* 统一 KPI 统计网格响应式规范 */
|
||
|
||
.kpi-grid {
|
||
display: grid !important;
|
||
gap: 16px;
|
||
width: 100%;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
/* 规则 1:屏幕宽度 >= 1200px -> 固定 4 列 */
|
||
@media (min-width: 1200px) {
|
||
.kpi-grid {
|
||
grid-template-columns: repeat(4, minmax(0, 1fr)) !important;
|
||
}
|
||
}
|
||
|
||
/* 规则 2:768px <= 屏幕宽度 < 1200px -> 固定 2 列 */
|
||
@media (min-width: 768px) and (max-width: 1199.98px) {
|
||
.kpi-grid {
|
||
grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
|
||
}
|
||
}
|
||
|
||
/* 规则 3:屏幕宽度 < 768px -> 固定 1 列 */
|
||
@media (max-width: 767.98px) {
|
||
.kpi-grid {
|
||
grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
|
||
}
|
||
}
|
||
|
||
/* 强制子项允许收缩,防止内部长文本撑爆网格 */
|
||
.kpi-grid > *,
|
||
.kpi-grid-6 > * {
|
||
min-width: 0 !important;
|
||
flex: none !important; /* 覆盖旧的 flex 逻辑 */
|
||
width: auto !important; /* 让 grid 控制宽度 */
|
||
}
|
||
|
||
/* 6-2-1 网格规范 (对标 CRMEB 统计概况) */
|
||
.kpi-grid-6 {
|
||
display: grid !important;
|
||
gap: 16px;
|
||
width: 100%;
|
||
box-sizing: border-box;
|
||
}
|
||
|
||
@media (min-width: 1200px) {
|
||
.kpi-grid-6 {
|
||
grid-template-columns: repeat(6, minmax(0, 1fr)) !important;
|
||
}
|
||
}
|
||
|
||
@media (min-width: 768px) and (max-width: 1199.98px) {
|
||
.kpi-grid-6 {
|
||
grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
|
||
}
|
||
}
|
||
|
||
@media (max-width: 767.98px) {
|
||
.kpi-grid-6 {
|
||
grid-template-columns: repeat(1, minmax(0, 1fr)) !important;
|
||
}
|
||
}
|