/* 组件容器样式 */ :host { display: block; width: 100%; padding: 15px; } .dashboard { max-width: 1400px; margin: 0 auto; padding: 20px; background: white; border-radius: 8px; box-shadow: 0 4px 12px rgba(0, 0, 0, 0.08); } /* 头部样式 */ .dashboard-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 24px; padding-bottom: 16px; border-bottom: 1px solid #eee; } .dashboard-header h2 { display: flex; align-items: center; gap: 10px; font-size: 24px; color: #2c3e50; } .time-display { background: #2c3e50; color: white; padding: 8px 16px; border-radius: 20px; font-size: 14px; display: flex; align-items: center; gap: 8px; } /* 指标网格样式 */ .metric-grid { display: grid; grid-template-columns: repeat(auto-fit, minmax(240px, 1fr)); gap: 20px; margin-bottom: 20px; } .metric-card { background: white; border-radius: 8px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); padding: 20px; display: flex; align-items: center; gap: 15px; } .metric-icon { width: 60px; height: 60px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: 24px; color: white; } .metric-icon.blue { background: #3498db; } .metric-icon.green { background: #27ae60; } .metric-icon.orange { background: #f39c12; } .metric-icon.purple { background: #9b59b6; } .metric-data h3 { font-size: 16px; font-weight: 600; margin-bottom: 5px; color: #2c3e50; } .metric-value { font-size: 24px; font-weight: 700; color: #2c3e50; } .metric-label { font-size: 14px; color: #95a5a6; } /* 饼图样式 */ .pie-chart { display: flex; align-items: center; gap: 30px; padding: 20px 0; } .chart-container { width: 180px; height: 180px; position: relative; border-radius: 50%; background: conic-gradient( #27ae60 0% 80%, #f39c12 80% 95%, #e74c3c 95% 100% ); } .chart-center { position: absolute; width: 100px; height: 100px; background: white; border-radius: 50%; top: 50%; left: 50%; transform: translate(-50%, -50%); } .chart-legend div { display: flex; align-items: center; gap: 10px; margin-bottom: 15px; font-size: 16px; } .dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; } .dot.normal { background: #27ae60; } .dot.warning { background: #f39c12; } .dot.danger { background: #e74c3c; } /* 警报样式 */ .alert-list { margin-top: 15px; } .alert-item { display: flex; align-items: center; gap: 15px; padding: 12px 16px; border-radius: 6px; margin-bottom: 10px; background: #f9f9f9; border-left: 4px solid; } .alert-item.critical { border-left-color: #e74c3c; background: #fdecea; } .alert-item.warning { border-left-color: #f39c12; background: #fef5e7; } .alert-item.info { border-left-color: #3498db; background: #ebf5fb; } .alert-item i { font-size: 20px; } .alert-item.critical i { color: #e74c3c; } .alert-item.warning i { color: #f39c12; } .alert-item.info i { color: #3498db; } .alert-content { flex: 1; } .alert-content strong { display: block; font-weight: 600; margin-bottom: 3px; } .alert-content span { font-size: 13px; color: #95a5a6; } /* 趋势图样式 */ .trend-graph { display: flex; align-items: flex-end; gap: 10px; height: 200px; padding: 20px; background: #f8fafc; border-radius: 6px; margin-top: 15px; } .graph-bar { flex: 1; background: #3498db; height: calc(var(--height) * 2px); border-radius: 4px 4px 0 0; position: relative; } /* 仪表板行布局 */ .dashboard-row { display: flex; gap: 20px; margin-bottom: 20px; } .chart-card, .alert-card { flex: 1; background: white; border-radius: 8px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); } .trend-card { background: white; border-radius: 8px; padding: 20px; box-shadow: 0 2px 8px rgba(0,0,0,0.1); } /* 健康指数趋势卡片样式 */ .trend-card { background: white; border-radius: 12px; padding: 20px; box-shadow: 0 4px 12px rgba(0,0,0,0.08); transition: all 0.3s ease; border: 1px solid #eaeef2; position: relative; overflow: hidden; } .trend-card:hover { transform: translateY(-5px); box-shadow: 0 8px 20px rgba(0,0,0,0.12); border-color: #3498db; } .trend-card h3 { margin: 0 0 15px 0; font-size: 18px; color: #2c3e50; display: flex; align-items: center; gap: 10px; } .trend-card h3 i { color: #3498db; font-size: 20px; } .trend-description { font-size: 14px; color: #718096; margin-bottom: 20px; line-height: 1.5; } .trend-graph { display: flex; align-items: flex-end; gap: 12px; height: 200px; padding: 20px; background: #f8fafc; border-radius: 8px; margin-top: 15px; position: relative; } .graph-bar { flex: 1; background: linear-gradient(to top, #3498db, #67b7f5); height: calc(var(--height) * 1.8px); border-radius: 6px 6px 0 0; position: relative; transition: all 0.4s ease; cursor: pointer; min-width: 30px; } .graph-bar:hover { transform: scaleY(1.05); box-shadow: 0 -4px 8px rgba(52, 152, 219, 0.3); } .graph-bar::after { content: attr(data-value); position: absolute; top: -25px; left: 50%; transform: translateX(-50%); background: #2c3e50; color: white; padding: 3px 8px; border-radius: 12px; font-size: 12px; font-weight: 600; opacity: 0; transition: opacity 0.3s ease; } .graph-bar:hover::after { opacity: 1; } .time-labels { display: flex; justify-content: space-between; margin-top: 8px; font-size: 12px; color: #95a5a6; padding: 0 10px; } .trend-footer { display: flex; justify-content: space-between; align-items: center; margin-top: 20px; padding-top: 15px; border-top: 1px solid #eaeef2; } .trend-summary { font-size: 14px; color: #718096; } .trend-change { display: flex; align-items: center; gap: 5px; font-weight: 600; font-size: 14px; } .trend-change.positive { color: #27ae60; } .trend-change.negative { color: #e74c3c; } /* 响应式设计 */ @media (max-width: 768px) { .trend-card { padding: 15px; } .trend-graph { height: 160px; padding: 15px; gap: 8px; } .graph-bar { min-width: 20px; } }