/* 人员投入概况看板 - 优化美化样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB',
                'Microsoft YaHei', Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    padding: 24px;
}

.container {
    max-width: 1920px;
    margin: 0 auto;
}

/* 头部 - 毛玻璃效果 */
.header {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 24px 32px;
    border-radius: 16px;
    margin-bottom: 24px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.12);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.header h1 {
    color: #1a202c;
    font-size: 32px;
    font-weight: 700;
    display: flex;
    align-items: center;
    gap: 12px;
}

.header-icon {
    font-size: 36px;
}

.update-time {
    color: #718096;
    font-size: 15px;
    display: flex;
    align-items: center;
    gap: 10px;
    font-weight: 500;
}

.update-time::before {
    content: '';
    width: 10px;
    height: 10px;
    background: #48bb78;
    border-radius: 50%;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 1; }
    50% { opacity: 0.5; }
}

/* 核心指标网格 - 5列 */
.stats-grid {
    display: grid;
    grid-template-columns: repeat(5, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.stat-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    padding: 24px;
    border-radius: 14px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
    overflow: hidden;
}

.stat-card::before {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    height: 4px;
    background: linear-gradient(90deg, #667eea 0%, #764ba2 100%);
}

.stat-card:hover {
    transform: translateY(-6px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.stat-card.primary::before { background: linear-gradient(90deg, #667eea 0%, #764ba2 100%); }
.stat-card.success::before { background: linear-gradient(90deg, #48bb78 0%, #38a169 100%); }
.stat-card.danger::before { background: linear-gradient(90deg, #f56565 0%, #e53e3e 100%); }
.stat-card.warning::before { background: linear-gradient(90deg, #ed8936 0%, #dd6b20 100%); }
.stat-card.info::before { background: linear-gradient(90deg, #4299e1 0%, #3182ce 100%); }

.stat-label {
    font-size: 12px;
    color: #718096;
    margin-bottom: 10px;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-value {
    font-size: 38px;
    font-weight: 800;
    color: #1a202c;
    margin-bottom: 6px;
    line-height: 1;
}

.stat-card.primary .stat-value { color: #667eea; }
.stat-card.success .stat-value { color: #48bb78; }
.stat-card.warning .stat-value { color: #ed8936; }
.stat-card.danger .stat-value { color: #f56565; }
.stat-card.info .stat-value { color: #4299e1; }

.stat-sub {
    font-size: 12px;
    color: #a0aec0;
    font-weight: 500;
}

/* 图表区域 - 3列布局 */
.charts-section {
    display: grid;
    grid-template-columns: repeat(3, 1fr);
    gap: 16px;
    margin-bottom: 24px;
}

.chart-card {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 14px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.chart-card.full-width {
    grid-column: 1 / -1;
}

.chart-title {
    font-size: 17px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 12px;
    display: flex;
    align-items: center;
    gap: 10px;
}

.chart-title::before {
    content: '';
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 2px;
}

.chart-container {
    position: relative;
    height: 280px;
}

/* 统计列表 */
.stats-list {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 12px;
}

.stats-item {
    background: #f7fafc;
    border-radius: 8px;
    padding: 12px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 12px;
    transition: all 0.2s ease;
}

.stats-item:hover {
    background: #edf2f7;
    transform: translateX(2px);
}

.stats-name {
    font-weight: 600;
    color: #2d3748;
}

.stats-value {
    font-weight: 700;
    color: #667eea;
}

/* 人员分组区域 */
.person-section {
    background: rgba(255, 255, 255, 0.98);
    backdrop-filter: blur(20px);
    -webkit-backdrop-filter: blur(20px);
    border-radius: 16px;
    padding: 24px;
    margin-bottom: 20px;
    box-shadow: 0 4px 20px rgba(0,0,0,0.1);
}

.group-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-bottom: 12px;
    padding-bottom: 14px;
    border-bottom: 2px solid #e2e8f0;
}

.group-title {
    font-size: 20px;
    font-weight: 700;
    color: #1a202c;
    display: flex;
    align-items: center;
    gap: 10px;
}

.group-icon {
    font-size: 28px;
}

.group-count {
    background: #edf2f7;
    color: #4a5568;
    padding: 6px 18px;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 700;
}

.group-count.full { background: #c6f6d5; color: #276749; }
.group-count.high { background: #bee3f8; color: #2c5282; }
.group-count.medium { background: #e9d8fd; color: #553c9a; }
.group-count.low { background: #feebc8; color: #9c4221; }
.group-count.idle { background: #fed7d7; color: #c53030; }

/* 人员卡片网格 - 7列自适应 */
.person-grid {
    display: grid;
    grid-template-columns: repeat(7, 1fr);
    gap: 12px;
}

.person-card {
    background: white;
    border: 2px solid #e2e8f0;
    border-radius: 10px;
    padding: 12px;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    position: relative;
}

.person-card::after {
    content: '';
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: radial-gradient(circle at var(--mouse-x, 50%) var(--mouse-y, 50%), rgba(102, 126, 234, 0.06) 0%, transparent 60%);
    opacity: 0;
    transition: opacity 0.3s ease;
    pointer-events: none;
}

.person-card:hover::after {
    opacity: 1;
}

.person-card:hover {
    box-shadow: 0 6px 20px rgba(0,0,0,0.12);
    transform: translateY(-3px);
}

.person-card.full { border-color: #48bb78; }
.person-card.high { border-color: #4299e1; }
.person-card.medium { border-color: #9f7aea; }
.person-card.low { border-color: #ed8936; }
.person-card.idle { border-color: #f56565; }

.person-name {
    font-size: 14px;
    font-weight: 700;
    color: #1a202c;
    margin-bottom: 8px;
}

.person-level {
    font-size: 10px;
    color: #718096;
    margin-bottom: 8px;
    font-weight: 600;
}

.saturation-bar {
    height: 5px;
    background: #e2e8f0;
    border-radius: 3px;
    overflow: hidden;
    margin-bottom: 8px;
}

.saturation-fill {
    height: 100%;
    border-radius: 3px;
    transition: width 0.6s cubic-bezier(0.4, 0, 0.2, 1);
}

.saturation-fill.full { background: linear-gradient(90deg, #48bb78 0%, #38a169 100%); }
.saturation-fill.high { background: linear-gradient(90deg, #4299e1 0%, #3182ce 100%); }
.saturation-fill.medium { background: linear-gradient(90deg, #9f7aea 0%, #805ad5 100%); }
.saturation-fill.low { background: linear-gradient(90deg, #ed8936 0%, #dd6b20 100%); }
.saturation-fill.idle { background: linear-gradient(90deg, #f56565 0%, #e53e3e 100%); }

.saturation-text {
    display: flex;
    justify-content: space-between;
    font-size: 10px;
    color: #718096;
    margin-bottom: 6px;
    font-weight: 600;
}

.person-stats {
    display: flex;
    justify-content: space-around;
    font-size: 10px;
    color: #718096;
    padding-top: 6px;
    border-top: 1px solid #e2e8f0;
}

/* 项目列表 - 美化渐变按钮 */
.project-list-toggle {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    margin-top: 8px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s ease-in-out;
    font-size: 10px;
    font-weight: 600;
    color: #ffffff;
    user-select: none;
    will-change: transform, box-shadow;
    transform: translateZ(0);
}

.project-list-toggle:hover {
    background: linear-gradient(135deg, #5568d3 0%, #6a3f8f 100%);
    transform: translateY(-1px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

.project-list-toggle:active {
    transform: translateY(0);
}

.toggle-icon {
    transition: transform 0.25s ease-in-out;
    font-size: 10px;
    will-change: transform;
}

.project-list-toggle.active .toggle-icon {
    transform: rotate(180deg);
}

.project-list {
    max-height: 0;
    overflow: hidden;
    transition: max-height 0.3s ease-in-out;
    background: #f7fafc;
    border-radius: 6px;
    margin-top: 0;
    will-change: max-height;
    transform: translateZ(0);
}

.project-list.show {
    max-height: 600px;
    margin-top: 8px;
    box-shadow: inset 0 2px 4px rgba(0, 0, 0, 0.06);
}

.project-item {
    padding: 8px 12px;
    font-size: 10px;
    color: #4a5568;
    border-bottom: 1px solid #edf2f7;
    line-height: 1.4;
    transition: all 0.2s ease;
}

.project-item:last-child {
    border-bottom: none;
}

.project-header {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-bottom: 4px;
}

.project-product {
    display: inline-block;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 2px 6px;
    border-radius: 4px;
    font-size: 9px;
    font-weight: 700;
    text-transform: uppercase;
}

.project-name {
    flex: 1;
    font-weight: 600;
    color: #2d3748;
}

.project-team {
    font-size: 9px;
    color: #718096;
    font-style: italic;
    margin-left: 14px;
}

.project-item:hover {
    background: #edf2f7;
}

.project-item:hover .project-name {
    color: #667eea;
}

/* 空状态 */
.empty-group {
    grid-column: 1 / -1;
    text-align: center;
    padding: 18px;
    color: #a0aec0;
    font-size: 12px;
}

/* 加载和错误状态 */
.loading {
    text-align: center;
    padding: 40px;
    color: #a0aec0;
    font-size: 16px;
    background: rgba(255, 255, 255, 0.5);
    backdrop-filter: blur(10px);
    border-radius: 12px;
}

.error {
    background: #fed7d7;
    color: #c53030;
    padding: 16px;
    border-radius: 8px;
    margin: 16px 0;
    font-weight: 600;
}

/* 响应式设计 */
@media (max-width: 1600px) {
    .person-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

@media (max-width: 1200px) {
    .stats-grid {
        grid-template-columns: repeat(3, 1fr);
    }
    .charts-section {
        grid-template-columns: repeat(2, 1fr);
    }
    .person-grid {
        grid-template-columns: repeat(5, 1fr);
    }
}

@media (max-width: 768px) {
    .stats-grid {
        grid-template-columns: 1fr;
    }
    .charts-section {
        grid-template-columns: 1fr;
    }
    .person-grid {
        grid-template-columns: repeat(3, 1fr);
    }
}
