/* 质量管理看板样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #1a1a2e 0%, #16213e 50%, #0f3460 100%);
    color: #ffffff;
    overflow-x: hidden;
    min-height: 100vh;
}

/* 顶部标题栏 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 15px 30px;
    background: linear-gradient(90deg, #10b981 0%, #059669 50%, #047857 100%);
    box-shadow: 0 4px 20px rgba(16, 185, 129, 0.3);
    position: relative;
    z-index: 100;
}

.header::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: linear-gradient(45deg, transparent 30%, rgba(255,255,255,0.1) 50%, transparent 70%);
    animation: shimmer 3s infinite;
}

@keyframes shimmer {
    0% { transform: translateX(-100%); }
    100% { transform: translateX(100%); }
}

.header-left {
    display: flex;
    align-items: center;
    gap: 15px;
}

.logo {
    width: 50px;
    height: 50px;
    border-radius: 8px;
    box-shadow: 0 4px 15px rgba(0,0,0,0.3);
}

.company-name {
    font-size: 18px;
    font-weight: bold;
    color: #ffffff;
    text-shadow: 2px 2px 4px rgba(0,0,0,0.5);
}

.header-center h1 {
    font-size: 32px;
    font-weight: bold;
    text-align: center;
    color: #ffffff;
    text-shadow: 3px 3px 6px rgba(0,0,0,0.5);
    margin-bottom: 5px;
}

.subtitle {
    font-size: 14px;
    color: rgba(255,255,255,0.9);
    text-align: center;
    font-style: italic;
}

.header-right {
    text-align: right;
}

.datetime {
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 5px;
}

.quality-status {
    font-size: 14px;
    color: rgba(255,255,255,0.9);
}

.status-excellent {
    color: #10b981;
    font-weight: bold;
    text-shadow: 0 0 10px #10b981;
}

/* 主要内容区域 */
.main-content {
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    min-height: calc(100vh - 120px);
}

/* 行布局 */
.row-1, .row-2, .row-3, .row-4 {
    display: flex;
    gap: 20px;
    height: auto;
    min-height: 300px;
}

.row-1 { min-height: 350px; }
.row-2 { min-height: 400px; }
.row-3 { min-height: 300px; }
.row-4 { min-height: 280px; }

/* 面板通用样式 */
.panel {
    background: linear-gradient(135deg, rgba(16, 185, 129, 0.1) 0%, rgba(5, 150, 105, 0.05) 100%);
    border: 2px solid rgba(16, 185, 129, 0.3);
    border-radius: 12px;
    padding: 20px;
    box-shadow: 0 8px 32px rgba(16, 185, 129, 0.1);
    backdrop-filter: blur(10px);
    position: relative;
    overflow: hidden;
    transition: all 0.3s ease;
}

.panel::before {
    content: '';
    position: absolute;
    top: 0;
    left: -100%;
    width: 100%;
    height: 2px;
    background: linear-gradient(90deg, transparent, #10b981, transparent);
    animation: scan 4s infinite;
}

@keyframes scan {
    0% { left: -100%; }
    100% { left: 100%; }
}

.panel:hover {
    border-color: rgba(16, 185, 129, 0.6);
    box-shadow: 0 12px 40px rgba(16, 185, 129, 0.2);
    transform: translateY(-2px);
}

.panel-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 10px;
    border-bottom: 1px solid rgba(16, 185, 129, 0.3);
}

.panel-header h3 {
    font-size: 20px;
    font-weight: bold;
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

/* 第一行：质量总览和实时监控 */
.quality-overview {
    flex: 1.2;
}

.real-time-monitor {
    flex: 0.8;
}

.panel-tabs {
    display: flex;
    gap: 10px;
}

.tab {
    padding: 8px 16px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 20px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.tab.active, .tab:hover {
    background: rgba(16, 185, 129, 0.4);
    border-color: #10b981;
    color: #ffffff;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.quality-stats {
    display: flex;
    gap: 30px;
    align-items: center;
    margin-bottom: 20px;
}

.stat-circle {
    position: relative;
}

.circle-chart {
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: conic-gradient(#10b981 0deg 354deg, rgba(16, 185, 129, 0.2) 354deg 360deg);
    display: flex;
    align-items: center;
    justify-content: center;
    position: relative;
}

.circle-inner {
    width: 80px;
    height: 80px;
    background: rgba(26, 26, 46, 0.9);
    border-radius: 50%;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    border: 2px solid rgba(16, 185, 129, 0.3);
}

.circle-value {
    font-size: 24px;
    font-weight: bold;
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.5);
}

.circle-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-top: 2px;
}

.quality-numbers {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    flex: 1;
}

.number-item {
    text-align: center;
    padding: 15px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.number-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
}

.number-value {
    font-size: 24px;
    font-weight: bold;
    color: #10b981;
    text-shadow: 0 0 10px rgba(16, 185, 129, 0.3);
}

.quality-categories {
    display: flex;
    flex-direction: column;
    gap: 10px;
}

.category-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    transition: all 0.3s ease;
}

.category-item:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.4);
}

.category-icon {
    font-size: 24px;
    width: 40px;
    text-align: center;
}

.category-info {
    flex: 1;
}

.category-name {
    font-size: 16px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 2px;
}

.category-rate {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.7);
}

.category-status {
    padding: 4px 12px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.category-status.excellent {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.category-status.good {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* 实时监控 */
.monitor-controls {
    display: flex;
    gap: 10px;
}

.control-btn {
    padding: 8px 16px;
    background: rgba(16, 185, 129, 0.2);
    border: 1px solid rgba(16, 185, 129, 0.3);
    border-radius: 20px;
    color: #ffffff;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.control-btn.active, .control-btn:hover {
    background: rgba(16, 185, 129, 0.4);
    border-color: #10b981;
    box-shadow: 0 0 15px rgba(16, 185, 129, 0.3);
}

.alert-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    max-height: 250px;
    overflow-y: auto;
}

.quality-alert {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 8px;
    border-left: 4px solid;
    transition: all 0.3s ease;
}

.quality-alert.critical {
    border-left-color: #ef4444;
    background: rgba(239, 68, 68, 0.1);
}

.quality-alert.warning {
    border-left-color: #f59e0b;
    background: rgba(245, 158, 11, 0.1);
}

.quality-alert.info {
    border-left-color: #10b981;
}

.alert-priority {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    min-width: 50px;
    text-align: center;
}

.quality-alert.critical .alert-priority {
    background: rgba(239, 68, 68, 0.2);
    color: #ef4444;
    border: 1px solid rgba(239, 68, 68, 0.3);
}

.quality-alert.warning .alert-priority {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

.quality-alert.info .alert-priority {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.alert-content {
    flex: 1;
}

.alert-title {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 2px;
}

.alert-details {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.alert-time {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.6);
    min-width: 60px;
    text-align: center;
}

.btn-handle {
    padding: 6px 12px;
    background: linear-gradient(45deg, #10b981, #059669);
    border: none;
    border-radius: 6px;
    color: #ffffff;
    cursor: pointer;
    font-size: 12px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.btn-handle:hover {
    background: linear-gradient(45deg, #059669, #047857);
    box-shadow: 0 4px 15px rgba(16, 185, 129, 0.4);
    transform: translateY(-1px);
}

/* 第二行：缺陷分析和供应商质量 */
.defect-analysis {
    flex: 1;
}

.supplier-quality {
    flex: 1;
}

.defect-overview {
    display: flex;
    gap: 20px;
}

.defect-stats {
    flex: 1;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.defect-stat {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.stat-label {
    font-size: 14px;
    color: #ffffff;
    font-weight: bold;
}

.stat-value {
    font-size: 18px;
    font-weight: bold;
    color: #10b981;
}

.stat-count {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.defect-chart {
    flex: 1;
    height: 250px;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* 供应商质量 */
.supplier-overview {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.supplier-ranking h4 {
    color: #10b981;
    margin-bottom: 15px;
    font-size: 16px;
}

.ranking-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 300px;
    overflow-y: auto;
}

.ranking-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 12px;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    transition: all 0.3s ease;
}

.ranking-item:hover {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.4);
}

.supplier-rank {
    width: 30px;
    height: 30px;
    background: linear-gradient(45deg, #10b981, #059669);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
}

.supplier-info {
    flex: 1;
}

.supplier-name {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
    margin-bottom: 2px;
}

.supplier-category {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.supplier-score {
    font-size: 16px;
    font-weight: bold;
    color: #10b981;
}

/* 第三行：质量趋势和改进措施 */
.quality-trend {
    flex: 1;
}

.improvement-measures {
    flex: 1;
}

.trend-overview {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.trend-kpis {
    display: flex;
    gap: 20px;
}

.kpi-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 15px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    flex: 1;
}

.kpi-icon {
    font-size: 24px;
    width: 40px;
    text-align: center;
}

.kpi-info {
    flex: 1;
}

.kpi-label {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    margin-bottom: 5px;
}

.kpi-value {
    font-size: 20px;
    font-weight: bold;
    color: #10b981;
    margin-bottom: 2px;
}

.kpi-trend {
    font-size: 12px;
    font-weight: bold;
}

.kpi-trend.up {
    color: #10b981;
}

.kpi-trend.excellent {
    color: #10b981;
}

.kpi-trend.good {
    color: #3b82f6;
}

.trend-chart {
    height: 200px;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

/* 改进措施 */
.improvement-overview {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.improvement-summary {
    display: flex;
    gap: 20px;
}

.measure-type {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid;
    flex: 1;
}

.measure-type.completed {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.measure-type.ongoing {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.measure-type.planned {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

.measure-count {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.measure-type.completed .measure-count {
    color: #10b981;
}

.measure-type.ongoing .measure-count {
    color: #3b82f6;
}

.measure-type.planned .measure-count {
    color: #f59e0b;
}

.measure-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.improvement-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 200px;
    overflow-y: auto;
}

.improvement-item {
    display: flex;
    flex-direction: column;
    gap: 5px;
    padding: 12px;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 8px;
    border-left: 4px solid;
}

.improvement-item.completed {
    border-left-color: #10b981;
}

.improvement-item.ongoing {
    border-left-color: #3b82f6;
}

.improvement-item.planned {
    border-left-color: #f59e0b;
}

.improvement-title {
    font-size: 14px;
    font-weight: bold;
    color: #ffffff;
}

.improvement-desc {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
}

.improvement-effect {
    font-size: 12px;
    color: #10b981;
    font-weight: bold;
}

.improvement-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
    align-self: flex-start;
}

.improvement-item.completed .improvement-status {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.improvement-item.ongoing .improvement-status {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

.improvement-item.planned .improvement-status {
    background: rgba(245, 158, 11, 0.2);
    color: #f59e0b;
    border: 1px solid rgba(245, 158, 11, 0.3);
}

/* 第四行：检验设备和质量培训 */
.inspection-equipment {
    flex: 1;
}

.quality-training {
    flex: 1;
}

.equipment-overview {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.equipment-summary {
    display: flex;
    gap: 20px;
}

.equipment-type {
    text-align: center;
    padding: 15px;
    border-radius: 8px;
    border: 2px solid;
    flex: 1;
}

.equipment-type.normal {
    background: rgba(16, 185, 129, 0.1);
    border-color: rgba(16, 185, 129, 0.3);
}

.equipment-type.maintenance {
    background: rgba(245, 158, 11, 0.1);
    border-color: rgba(245, 158, 11, 0.3);
}

.equipment-type.calibration {
    background: rgba(59, 130, 246, 0.1);
    border-color: rgba(59, 130, 246, 0.3);
}

.equipment-count {
    font-size: 28px;
    font-weight: bold;
    margin-bottom: 5px;
}

.equipment-type.normal .equipment-count {
    color: #10b981;
}

.equipment-type.maintenance .equipment-count {
    color: #f59e0b;
}

.equipment-type.calibration .equipment-count {
    color: #3b82f6;
}

.equipment-label {
    font-size: 14px;
    color: rgba(255, 255, 255, 0.8);
}

.equipment-list h4 {
    color: #10b981;
    margin-bottom: 15px;
    font-size: 16px;
}

.equipment-items {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 150px;
    overflow-y: auto;
}

.equipment-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.equipment-name {
    font-size: 14px;
    font-weight: bold;
    color: #10b981;
    min-width: 120px;
}

.equipment-location {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.8);
    min-width: 80px;
}

.equipment-accuracy {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    flex: 1;
}

.equipment-status {
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: bold;
}

.equipment-status.normal {
    background: rgba(16, 185, 129, 0.2);
    color: #10b981;
    border: 1px solid rgba(16, 185, 129, 0.3);
}

.equipment-status.calibration {
    background: rgba(59, 130, 246, 0.2);
    color: #3b82f6;
    border: 1px solid rgba(59, 130, 246, 0.3);
}

/* 质量培训 */
.training-overview {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.training-stats {
    display: flex;
    gap: 20px;
}

.training-stat {
    text-align: center;
    padding: 15px;
    background: rgba(16, 185, 129, 0.1);
    border-radius: 8px;
    border: 1px solid rgba(16, 185, 129, 0.2);
    flex: 1;
}

.training-courses h4 {
    color: #10b981;
    margin-bottom: 15px;
    font-size: 16px;
}

.course-list {
    display: flex;
    flex-direction: column;
    gap: 10px;
    max-height: 150px;
    overflow-y: auto;
}

.course-item {
    display: flex;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background: rgba(16, 185, 129, 0.05);
    border-radius: 6px;
    border: 1px solid rgba(16, 185, 129, 0.2);
}

.course-name {
    font-size: 14px;
    color: #ffffff;
    font-weight: bold;
    min-width: 120px;
}

.course-progress {
    display: flex;
    align-items: center;
    gap: 8px;
    flex: 1;
}

.progress-bar {
    height: 8px;
    background: #10b981;
    border-radius: 4px;
    position: relative;
    flex: 1;
    max-width: 100px;
}

.progress-bar::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    height: 100%;
    background: rgba(16, 185, 129, 0.2);
    border-radius: 4px;
    width: 100%;
}

.progress-text {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    min-width: 35px;
}

.course-participants {
    font-size: 12px;
    color: rgba(255, 255, 255, 0.7);
    min-width: 50px;
    text-align: right;
}

/* 响应式设计 */
@media (max-width: 1600px) {
    .row-1, .row-2, .row-3, .row-4 {
        flex-direction: column;
        height: auto;
    }
    
    .panel {
        margin-bottom: 20px;
    }
    
    .quality-stats {
        flex-direction: column;
        align-items: flex-start;
    }
    
    .defect-overview {
        flex-direction: column;
    }
    
    .trend-kpis {
        flex-direction: column;
    }
    
    .improvement-summary, .equipment-summary, .training-stats {
        flex-direction: column;
    }
}

@media (max-width: 768px) {
    .header {
        flex-direction: column;
        gap: 15px;
        text-align: center;
    }
    
    .header-left, .header-right {
        justify-content: center;
    }
    
    .main-content {
        padding: 10px;
    }
    
    .panel {
        padding: 15px;
    }
    
    .quality-numbers {
        grid-template-columns: 1fr;
    }
}

/* 滚动条样式 */
::-webkit-scrollbar {
    width: 8px;
}

::-webkit-scrollbar-track {
    background: rgba(16, 185, 129, 0.1);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb {
    background: rgba(16, 185, 129, 0.5);
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: rgba(16, 185, 129, 0.7);
}

/* 动画效果 */
@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.panel {
    animation: fadeInUp 0.6s ease-out;
}

.panel:nth-child(1) { animation-delay: 0.1s; }
.panel:nth-child(2) { animation-delay: 0.2s; }
.panel:nth-child(3) { animation-delay: 0.3s; }
.panel:nth-child(4) { animation-delay: 0.4s; }

/* 数据更新动画 */
@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.number-value, .stat-value, .kpi-value {
    animation: pulse 2s infinite;
}