/* 颜色变量定义 */
:root {
    --primary-100: #d4eaf7;
    --primary-200: #b6ccd8;
    --primary-300: #3b3c3d;
    --accent-100: #71c4ef;
    --accent-200: #00668c;
    --text-100: #1d1c1c;
    --text-200: #313d44;
    --bg-100: #fffefb;
    --bg-200: #f5f4f1;
    --bg-300: #cccbc8;
}

/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: 'Microsoft YaHei', 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background-color: var(--bg-200);
    color: var(--text-100);
    line-height: 1.6;
}

/* 容器样式 */
.container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 0 20px;
}

/* 按钮样式 */
.btn {
    display: inline-block;
    padding: 10px 20px;
    background-color: var(--accent-100);
    color: var(--bg-100);
    text-decoration: none;
    border: none;
    border-radius: 4px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.3s ease;
}

.btn:hover {
    background-color: var(--accent-200);
}

.btn-primary {
    background-color: var(--accent-100);
}

.btn-primary:hover {
    background-color: var(--accent-200);
}

.btn-success {
    background-color: var(--accent-200);
}

.btn-success:hover {
    background-color: var(--primary-300);
}

.btn-warning {
    background-color: var(--primary-200);
    color: var(--text-100);
}

.btn-danger {
    background-color: #dc3545;
}

.btn-secondary {
    background-color: #6c757d;
}

/* 表格样式 */
.table {
    width: 100%;
    border-collapse: collapse;
    background-color: white;
    border-radius: 8px;
    overflow: hidden;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
}

.table th,
.table td {
    padding: 12px 15px;
    text-align: left;
    border-bottom: 1px solid #e9ecef;
}

.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    color: #495057;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 卡片样式 */
.card {
    background-color: white;
    border-radius: 8px;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    margin-bottom: 20px;
    overflow: hidden;
}

.card-header {
    background-color: #f8f9fa;
    padding: 15px 20px;
    border-bottom: 1px solid #e9ecef;
    font-weight: 600;
    color: #495057;
}

.card-body {
    padding: 20px;
}

/* 表单样式 */
.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    font-weight: 500;
    color: #495057;
}

.form-control {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ced4da;
    border-radius: 4px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.form-control:focus {
    outline: none;
    border-color: #007bff;
    box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}

/* 网格系统 */
.row {
    display: flex;
    flex-wrap: wrap;
    margin: 0 -10px;
}

.col {
    flex: 1;
    padding: 0 10px;
}

.col-2 { flex: 0 0 16.666667%; }
.col-3 { flex: 0 0 25%; }
.col-4 { flex: 0 0 33.333333%; }
.col-6 { flex: 0 0 50%; }
.col-8 { flex: 0 0 66.666667%; }
.col-9 { flex: 0 0 75%; }
.col-12 { flex: 0 0 100%; }

/* 工具类 */
.text-center { text-align: center; }
.text-right { text-align: right; }
.text-left { text-align: left; }

.mb-0 { margin-bottom: 0; }
.mb-1 { margin-bottom: 10px; }
.mb-2 { margin-bottom: 20px; }
.mb-3 { margin-bottom: 30px; }

.mt-0 { margin-top: 0; }
.mt-1 { margin-top: 10px; }
.mt-2 { margin-top: 20px; }
.mt-3 { margin-top: 30px; }

.p-0 { padding: 0; }
.p-1 { padding: 10px; }
.p-2 { padding: 20px; }
.p-3 { padding: 30px; }

/* 新增页面样式 */
.calculation-controls, .analysis-controls {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 8px;
    margin-bottom: 20px;
}

.calculation-results, .analysis-charts {
    margin-top: 20px;
}

.staff-stats, .drgs-overview, .bonus-summary, .workload-summary, .points-summary {
    margin-bottom: 20px;
}

.analysis-report {
    background: #f8f9fa;
    padding: 15px;
    border-radius: 8px;
}

.analysis-report ul {
    margin: 10px 0;
    padding-left: 20px;
}

.analysis-report li {
    margin-bottom: 8px;
}

.indicator-categories {
    margin-bottom: 20px;
}

.category-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    text-align: center;
    transition: all 0.3s ease;
}

.category-card:hover {
    box-shadow: 0 4px 8px rgba(0,0,0,0.1);
    transform: translateY(-2px);
}

.category-card h4 {
    color: #495057;
    margin-bottom: 10px;
    font-size: 16px;
}

.category-card p {
    color: #007bff;
    font-size: 24px;
    font-weight: bold;
    margin: 0;
}

.calculation-status {
    margin-bottom: 20px;
}

.alert {
    padding: 12px 16px;
    border-radius: 6px;
    margin-bottom: 20px;
}

.alert-info {
    background-color: #d1ecf1;
    border: 1px solid #bee5eb;
    color: #0c5460;
}

/* Badge样式增强 */
.badge {
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 12px;
    font-weight: 500;
}

.badge-success {
    background-color: #28a745;
    color: white;
}

.badge-primary {
    background-color: #007bff;
    color: white;
}

.badge-warning {
    background-color: #ffc107;
    color: #212529;
}

.badge-danger {
    background-color: #dc3545;
    color: white;
}

/* 表格增强样式 */
.table th {
    background-color: #f8f9fa;
    font-weight: 600;
    border-bottom: 2px solid #dee2e6;
}

.table tbody tr:hover {
    background-color: #f8f9fa;
}

/* 统计数字样式 */
.stat-number {
    font-size: 28px;
    font-weight: bold;
    color: #007bff;
    margin: 10px 0 5px 0;
}

/* 工具栏样式增强 */
.toolbar {
    margin-bottom: 20px;
    padding: 15px 0;
    border-bottom: 1px solid #e9ecef;
}

.toolbar .btn {
    margin-right: 10px;
    margin-bottom: 5px;
}

/* 图表卡片样式 */
.chart-card {
    background: #fff;
    border: 1px solid #e9ecef;
    border-radius: 8px;
    padding: 20px;
    margin-bottom: 20px;
    overflow: hidden; /* 防止内容溢出 */
}

.chart-card h3, .chart-card h4 {
    margin-bottom: 15px;
    color: #495057;
}

.chart-placeholder {
    background: #f8f9fa;
    border: 2px dashed #dee2e6;
    border-radius: 8px;
    padding: 40px;
    text-align: center;
    color: #6c757d;
    min-height: 200px;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* 图表容器响应式样式 */
.chart-container {
    position: relative;
    width: 100%;
    height: 300px;
    overflow: hidden;
    margin-bottom: 15px;
}

.chart-container canvas {
    max-width: 100%;
    height: auto;
    display: block;
}

/* 图表网格布局 */
.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-bottom: 20px;
}

/* 图表行布局 */
.chart-row {
    display: flex;
    flex-wrap: wrap;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-row .chart-card {
    flex: 1;
    min-width: 300px;
}

/* 页面内容容器 */
.page-content {
    padding: 20px;
}

.page-content h3 {
    margin-bottom: 20px;
    color: #495057;
    border-bottom: 2px solid #007bff;
    padding-bottom: 10px;
}

/* 表单控件样式增强 */
.form-control {
    border: 1px solid #ced4da;
    border-radius: 6px;
    padding: 8px 12px;
    font-size: 14px;
    transition: border-color 0.15s ease-in-out, box-shadow 0.15s ease-in-out;
}

.form-control:focus {
    border-color: #007bff;
    box-shadow: 0 0 0 0.2rem rgba(0, 123, 255, 0.25);
    outline: 0;
}

/* 标签样式 */
label {
    font-weight: 600;
    color: #495057;
    margin-bottom: 5px;
    display: block;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 0 10px;
    }
    
    .row {
        margin: 0 -5px;
    }
    
    .col {
        padding: 0 5px;
    }
    
    .col-2, .col-3, .col-4, .col-6, .col-8, .col-9 {
        flex: 0 0 100%;
        margin-bottom: 20px;
    }
    
    .table {
        font-size: 12px;
    }
    
    .table th,
    .table td {
        padding: 8px 10px;
    }
    
    .stat-number {
        font-size: 24px;
    }
    
    .chart-placeholder {
        padding: 20px;
        min-height: 150px;
    }
    
    .category-card {
        margin-bottom: 15px;
    }
    
    .page-content {
        padding: 15px;
    }
    
    /* 图表响应式调整 */
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .chart-row {
        flex-direction: column;
        gap: 15px;
    }
    
    .chart-row .chart-card {
        min-width: auto;
        width: 100%;
    }
    
    .chart-container {
        height: 250px;
    }
    
    .chart-card {
        padding: 15px;
    }
    
    .chart-card h3, .chart-card h4 {
        font-size: 16px;
        margin-bottom: 10px;
    }
}

@media (max-width: 480px) {
    .card-body {
        padding: 15px;
    }
    
    .btn {
        padding: 8px 16px;
        font-size: 12px;
    }
    
    /* 小屏幕图表优化 */
    .chart-container {
        height: 200px;
    }
    
    .chart-card {
        padding: 10px;
        margin-bottom: 15px;
    }
    
    .chart-card h3, .chart-card h4 {
        font-size: 14px;
        margin-bottom: 8px;
    }
    
    .charts-grid {
        gap: 10px;
    }
    
    .chart-row {
        gap: 10px;
    }
}