/* factory-overview.css */ :host { display: block; width: 100%; padding: 15px; font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif; } .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; } .header-left { display: flex; align-items: center; gap: 30px; } .dashboard-header h2 { display: flex; align-items: center; gap: 10px; font-size: 24px; color: #2c3e50; margin: 0; } .quick-nav { display: flex; gap: 10px; } .nav-btn { padding: 8px 16px; background: #f1f2f6; border: none; border-radius: 4px; cursor: pointer; font-size: 14px; transition: all 0.3s ease; } .nav-btn.active, .nav-btn:hover { background: #2c3e50; color: white; } .header-right { display: flex; align-items: center; gap: 20px; } .user-info { display: flex; align-items: center; gap: 8px; font-size: 14px; color: #2c3e50; } .time-display { background: #2c3e50; color: white; padding: 8px 16px; border-radius: 20px; font-size: 14px; display: flex; align-items: center; gap: 8px; } .refresh-btn { background: #27ae60; color: white; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-size: 14px; display: flex; align-items: center; gap: 8px; transition: background 0.3s ease; } .refresh-btn:hover { background: #219653; } /* 指标网格样式 */ .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; position: relative; overflow: hidden; cursor: pointer; transition: all 0.3s ease; } .metric-card:hover { transform: translateY(-5px); box-shadow: 0 12px 20px rgba(0,0,0,0.15); } .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 { flex: 1; } .metric-data h3 { font-size: 16px; font-weight: 600; margin-bottom: 5px; color: #2c3e50; } .metric-value { font-size: 24px; font-weight: 700; color: #2c3e50; margin: 5px 0; } .metric-label { font-size: 14px; color: #95a5a6; margin: 0; } /* 进度条样式 */ .metric-progress { height: 6px; background: #e0e0e0; border-radius: 3px; margin-top: 10px; overflow: hidden; } .progress-bar { height: 100%; border-radius: 3px; transition: width 0.5s ease; } .metric-card:nth-child(1) .progress-bar { background: #3498db; } .metric-card:nth-child(2) .progress-bar { background: #f39c12; } .metric-card:nth-child(3) .progress-bar { background: #27ae60; } .metric-card:nth-child(4) .progress-bar { background: #9b59b6; } /* 悬停效果 */ .metric-hover { position: absolute; bottom: 0; left: 0; right: 0; background: rgba(0,0,0,0.8); color: white; padding: 10px; text-align: center; opacity: 0; transform: translateY(100%); transition: all 0.3s ease; } .metric-card.hover .metric-hover { opacity: 1; transform: translateY(0); } /* 仪表板行布局 */ .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); } /* 饼图样式 */ .chart-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; } .chart-tabs { display: flex; gap: 8px; } .tab-btn { padding: 6px 12px; border: none; border-radius: 15px; background: #f1f1f1; font-size: 12px; cursor: pointer; transition: all 0.3s ease; } .tab-btn.active, .tab-btn:hover { background: #2c3e50; color: white; } .chart-container-wrapper { display: flex; gap: 30px; } .pie-chart { display: flex; align-items: center; gap: 30px; padding: 10px 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%); display: flex; align-items: center; justify-content: center; } .chart-center-text { font-size: 20px; font-weight: bold; color: #2c3e50; } .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; } /* 图表详情 */ .chart-details { display: grid; grid-template-columns: 1fr 1fr; gap: 15px; flex: 1; } .detail-item { background: #f8fafc; border-radius: 6px; padding: 12px; transition: transform 0.3s ease; } .detail-item:hover { transform: translateY(-3px); box-shadow: 0 2px 6px rgba(0,0,0,0.1); } .detail-label { font-size: 13px; color: #7f8c8d; margin-bottom: 5px; } .detail-value { font-size: 18px; font-weight: 700; color: #2c3e50; } /* 警报样式 */ .alert-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 10px; } .alert-filter select { padding: 6px 12px; border: 1px solid #ddd; border-radius: 4px; background: white; font-size: 14px; } .alert-list { margin-top: 15px; max-height: 300px; overflow-y: auto; } .alert-item { display: flex; align-items: center; gap: 15px; padding: 12px 16px; border-radius: 6px; margin-bottom: 10px; background: #f9f9f9; border-left: 4px solid; transition: all 0.3s ease; } .alert-item:hover { transform: translateX(5px); box-shadow: 0 3px 8px rgba(0,0,0,0.1); } .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; } .alert-status { padding: 4px 10px; border-radius: 12px; font-size: 12px; font-weight: bold; } .alert-item.critical .alert-status { background: #e74c3c; color: white; } .alert-item.warning .alert-status { background: #f39c12; color: white; } .alert-item.info .alert-status { background: #3498db; color: white; } .alert-footer { margin-top: 15px; text-align: center; } .view-all-btn { background: #3498db; color: white; border: none; padding: 8px 15px; border-radius: 4px; cursor: pointer; font-size: 14px; display: inline-flex; align-items: center; gap: 8px; transition: background 0.3s ease; } .view-all-btn:hover { background: #2980b9; } /* 趋势图样式 */ .trend-header { display: flex; justify-content: space-between; align-items: center; margin-bottom: 15px; } .time-range-selector { display: flex; gap: 8px; } .time-btn { padding: 6px 12px; border: 1px solid #ddd; border-radius: 15px; background: white; font-size: 12px; cursor: pointer; transition: all 0.3s ease; } .time-btn.active, .time-btn:hover { border-color: #3498db; background: #3498db; color: white; } .trend-graph { display: flex; flex-direction: column; height: 200px; padding: 20px; background: #f8fafc; border-radius: 6px; margin-top: 15px; position: relative; } .graph-labels { display: flex; justify-content: space-between; margin-top: auto; color: #7f8c8d; font-size: 12px; } .graph-bars { display: flex; align-items: flex-end; gap: 10px; height: 100%; width: 100%; } .graph-bar { flex: 1; background: #3498db; border-radius: 4px 4px 0 0; position: relative; transition: height 0.5s ease; } .graph-bar::after { content: attr(style); position: absolute; top: -25px; left: 50%; transform: translateX(-50%); background: rgba(0,0,0,0.7); color: white; padding: 3px 8px; border-radius: 4px; font-size: 12px; opacity: 0; transition: opacity 0.3s ease; } .graph-bar:hover::after { opacity: 1; } /* 响应式调整 */ @media (max-width: 1200px) { .dashboard-row { flex-direction: column; } } @media (max-width: 768px) { .dashboard-header { flex-direction: column; align-items: flex-start; gap: 15px; } .header-left, .header-right { width: 100%; } .quick-nav { overflow-x: auto; padding-bottom: 10px; } .chart-container-wrapper { flex-direction: column; } }