/* 统计卡片网格 */
.stats-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(180px, 1fr));
gap: 16px;
margin-bottom: 24px;
}

.stat-card {
background: white;
border-radius: 10px;        /* 圆角10px */
padding: 20px 18px;
box-shadow: 0 4px 12px rgba(0, 20, 40, 0.02);
border: 1px solid #e9eef5;
transition: box-shadow 0.15s, transform 0.1s;
display: flex;
flex-direction: column;
}

.stat-card:hover {
box-shadow: 0 8px 18px rgba(0, 30, 60, 0.06);
transform: translateY(-1px);
}

.stat-label {
font-size: 0.85rem;
font-weight: 500;
color: #5a6f8c;
text-transform: uppercase;
letter-spacing: 0.3px;
margin-bottom: 8px;
display: flex;
align-items: center;
gap: 6px;
}

.stat-value {
font-size: 2.3rem;
font-weight: 700;
color: #0a1e3c;
line-height: 1.2;
margin-bottom: 6px;
}

.stat-trend {
font-size: 0.85rem;
font-weight: 500;
display: flex;
align-items: center;
gap: 6px;
color: #2f7d4b;
}

.stat-trend.warning {
color: #c14545;
}

.stat-trend.neutral {
color: #6b7c98;
}

/* 图表行：两个并排 (环形图 + 柱状图) */
.charts-row {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 18px;
margin-bottom: 24px;
}

.chart-card {
background: white;
border-radius: 10px;        /* 圆角10px */
padding: 18px 18px 12px;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
border: 1px solid #e9eef5;
display: flex;
flex-direction: column;
}

.chart-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 12px;
}

.chart-header h3 {
font-weight: 600;
font-size: 1.15rem;
color: #1a2a4a;
letter-spacing: -0.2px;
display: flex;
align-items: center;
gap: 8px;
}

.chart-header .pill {
background: #eef3fe;
color: #1e4f8a;
font-size: 0.75rem;
font-weight: 600;
padding: 4px 10px;
border-radius: 40px;
}

.chart-container {
position: relative;
width: 100%;
height: 200px;
margin-top: 4px;
}

canvas {
display: block;
width: 100% !important;
height: 100% !important;
}

/* 电池报警类型明细 (扁平卡片列表) */
.type-section {
background: white;
border-radius: 10px;        /* 圆角10px */
padding: 20px 22px 22px;
border: 1px solid #e9eef5;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.02);
margin-bottom: 12px;
}

.section-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 18px;
flex-wrap: wrap;
gap: 8px;
}

.section-header h3 {
font-size: 1.2rem;
font-weight: 600;
color: #1a2a4a;
display: flex;
align-items: center;
gap: 8px;
}

.section-header .update-time {
font-size: 0.8rem;
color: #7a8ca3;
background: #f0f4fa;
padding: 4px 12px;
border-radius: 40px;
font-weight: 500;
}

.type-grid {
display: grid;
grid-template-columns: repeat(auto-fit, minmax(210px, 1fr));
gap: 12px;
}

.type-item {
display: flex;
align-items: center;
justify-content: space-between;
padding: 12px 16px;
background: #fafcff;
border-radius: 10px;        /* 圆角10px */
border: 1px solid #eef3fa;
transition: background 0.1s;
}

.type-item:hover {
background: #f2f7ff;
}

.type-left {
display: flex;
align-items: center;
gap: 10px;
}

.color-dot {
width: 10px;
height: 10px;
border-radius: 4px;        /* 小圆点也扁平一些 */
flex-shrink: 0;
}

.type-name {
font-weight: 600;
color: #1e2e4a;
font-size: 0.95rem;
}

.type-stats {
display: flex;
align-items: center;
gap: 8px;
}

.type-count {
font-weight: 700;
font-size: 1.25rem;
color: #0a1e3c;
}

.type-percent {
font-size: 0.75rem;
font-weight: 600;
color: #3d5a80;
background: #e6eefb;
padding: 3px 8px;
border-radius: 30px;
}

/* 辅助说明 */
.footer-note {
font-size: 0.78rem;
color: #8395ae;
text-align: right;
margin-top: 8px;
letter-spacing: 0.2px;
}

/* 响应式 */
@media (max-width: 750px) {
.charts-row {
grid-template-columns: 1fr;
}
.stat-value {
font-size: 2rem;
}
body { padding: 16px; }
.header h1 { font-size: 1.6rem; }
}

@media (max-width: 480px) {
.type-grid { grid-template-columns: 1fr; }
}

.dc-card{
width:100%;
display:flex;flex-direction:column;align-items:center;justify-content:center;
gap:18px;
font-family:"PingFang SC","Microsoft YaHei","Helvetica Neue",Arial,sans-serif;
user-select:none;box-sizing:border-box;}
.dc-title{width:100%;text-align:center;font-size:15px;font-weight:600;
color:#1f2430;letter-spacing:.5px;}
.dc-wrap{position:relative;}
.dc-ring{display:block;overflow:visible;}
.dc-ring .dc-slice{cursor:pointer;transition:transform .18s ease,opacity .18s ease,filter .18s ease;
transform-origin:50% 50%;}
.dc-ring .dc-slice:hover{transform:scale(1.045);filter:brightness(1.1);}
.dc-ring.dim .dc-slice{opacity:.4;}
.dc-ring.dim .dc-slice.dc-hovered{opacity:1;}
.dc-ring.animate .dc-slice{animation:dcIn .6s cubic-bezier(.25,.8,.35,1) backwards;}
@keyframes dcIn{from{opacity:0;transform:scale(.55);}to{opacity:1;transform:scale(1);}}
.dc-label{pointer-events:none;}
.dc-center{position:absolute;top:50%; left:50%; transform:translate(-50%,-50%);text-align:center;}
.dc-center .dc-clabel,
.dc-center .dc-cvalue{}
.dc-center .dc-cvalue{font-size:18px;font-weight:700;color:#1f2430;line-height:1.1;}
.dc-center .dc-clabel{top:calc(50% - 1.6em);font-size:12px;color:#8a90a0;display:block;}
.dc-legend{display:flex;flex-wrap:wrap;justify-content:center;gap:8px 20px;margin-top:3px;}
.dc-legend-item{display:flex;align-items:center;gap:8px;font-size:13px;color:#1f2430;
cursor:pointer;transition:opacity .15s;margin-right:6px;}
.dc-legend-item:last-of-type{margin-right:0;}
.dc-legend-item:hover{opacity:.85;}
.dc-legend-item .dc-swatch{width:12px;height:12px;border-radius:4px;flex:none;margin-right:1px;}
.dc-legend-item .dc-pct{color:#8a90a0;font-size:12px;}
.dc-tooltip{position:fixed;padding:8px 14px;background:#2b3040;color:#fff;font-size:13px;
border-radius:8px;white-space:nowrap;pointer-events:none;opacity:0;
transform:translate(-50%,-130%);transition:opacity .12s ease;
box-shadow:0 6px 16px rgba(0,0,0,.18);z-index:9999;}
.dc-tooltip.dc-show{opacity:1;}
.dc-tooltip .dc-dot{display:inline-block;width:8px;height:8px;border-radius:50%;margin-right:6px;}