/* 统计页面专用样式 */

.stats-container {
    max-width: 1200px;
    margin: 0 auto;
    padding: 20px;
    background-color: #f9f9fb;
    min-height: 100vh;
}

/* 顶部导航 */
.stats-header {
    position: relative;
    padding: 20px 0;
    margin-bottom: 30px;
    overflow: hidden;
}

.stats-header .header-bg {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 150px;
    background-color: #f0f0f5;
    clip-path: polygon(0 0, 100% 0, 100% 70%, 0 100%);
    z-index: -1;
}

.stats-header h1 {
    color: #333;
    margin: 0 0 20px 0;
    font-size: 28px;
    font-weight: bold;
}

.nav-buttons {
    display: flex;
    flex-direction: row;
    align-items: stretch;
    justify-content: space-between;
    gap: 12px;
    width: 100%;
}

.nav-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 1 1 0;
    padding: 12px 16px;
    background-color: #7070ff;
    color: white;
    text-decoration: none;
    border-radius: 10px;
    border: 1px solid transparent;
    cursor: pointer;
    font-size: 14px;
    line-height: 1.2;
    transition: background-color 0.2s ease, box-shadow 0.2s ease, transform 0.1s ease;
    box-shadow: 0 2px 8px rgba(112, 112, 255, 0.25);
}

.nav-btn:hover {
    background-color: #5555ff;
}
.nav-btn:active {
    transform: translateY(1px);
}
.nav-btn:focus-visible {
    outline: none;
    box-shadow: 0 0 0 3px rgba(112,112,255,0.25), 0 4px 14px rgba(112, 112, 255, 0.35);
}

/* 1. 顶部 - 核心数据概览 */
.metrics-overview {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 40px;
}

.metric-card {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
    display: flex;
    align-items: center;
    gap: 20px;
    transition: transform 0.3s ease, box-shadow 0.3s ease;
}

.metric-card:hover {
    transform: translateY(-4px);
    box-shadow: 0 8px 30px rgba(0, 0, 0, 0.12);
}

.metric-icon {
    font-size: 48px;
    width: 80px;
    height: 80px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, #7070ff, #5555ff);
    border-radius: 20px;
    color: white;
}

.metric-content {
    flex: 1;
}

.metric-number {
    font-size: 36px;
    font-weight: bold;
    color: #333;
    line-height: 1;
    margin-bottom: 8px;
}

.metric-label {
    font-size: 16px;
    color: #666;
    font-weight: 500;
}

/* 2. 中部 - 图表分析区 */
.charts-section {
    margin-bottom: 40px;
}

.chart-row {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 20px;
    margin-bottom: 20px;
}

.chart-container {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.chart-container.chart-wide {
    grid-column: 1 / -1;
}

.chart-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f5;
}

.chart-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
    font-weight: 600;
}

.chart-controls {
    display: flex;
    gap: 8px;
}

.chart-btn {
    padding: 6px 12px;
    border: 2px solid #e0e0e0;
    background: white;
    color: #666;
    border-radius: 6px;
    cursor: pointer;
    font-size: 12px;
    transition: all 0.3s ease;
}

.chart-btn.active,
.chart-btn:hover {
    border-color: #7070ff;
    background: #7070ff;
    color: white;
}

.chart-wrapper {
    position: relative;
    height: 300px;
}

.chart-wrapper canvas {
    max-height: 100%;
}

/* 3. 底部 - 详细数据表格 */
.data-table-section {
    background: white;
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.08);
}

.table-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    padding-bottom: 16px;
    border-bottom: 2px solid #f0f0f5;
}

.table-header h3 {
    margin: 0;
    font-size: 20px;
    color: #333;
    font-weight: 600;
}

.table-controls {
    display: flex;
    gap: 12px;
    align-items: center;
}

.table-controls select,
.table-controls input {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 8px;
    font-size: 14px;
    transition: border-color 0.3s ease;
}

.table-controls select:focus,
.table-controls input:focus {
    outline: none;
    border-color: #7070ff;
}

.table-controls input {
    min-width: 200px;
}

.table-wrapper {
    overflow-x: auto;
    border-radius: 12px;
    border: 1px solid #e0e0e0;
}

#dataTable {
    width: 100%;
    border-collapse: collapse;
    font-size: 14px;
}

#dataTable th {
    background: #f8f9fa;
    padding: 16px 12px;
    text-align: left;
    font-weight: 600;
    color: #333;
    border-bottom: 2px solid #e0e0e0;
    position: sticky;
    top: 0;
    z-index: 10;
}

#dataTable td {
    padding: 12px;
    border-bottom: 1px solid #f0f0f5;
    color: #555;
}

#dataTable tbody tr:hover {
    background-color: #f8f9fa;
}

.status-badge {
    display: inline-block;
    padding: 4px 8px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}

.status-badge.active {
    background-color: #e8f5e8;
    color: #2d5a2d;
}

.status-badge.honorary {
    background-color: #fff8e1;
    color: #f57c00;
}

/* 响应式设计 */
@media (max-width: 1024px) {
    .stats-container {
        padding: 16px;
    }
    .stats-header h1 {
        font-size: 24px;
    }
    .nav-buttons {
        flex-direction: row;
    }
    .chart-wrapper {
        height: 280px;
    }
}
@media (max-width: 768px) {
    .stats-container {
        padding: 15px;
    }
    
    .metrics-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 12px;
    }
    
    .chart-row {
        grid-template-columns: 1fr;
        gap: 15px;
    }
    
    .chart-container.chart-wide {
        grid-column: 1;
    }
    
    .table-header {
        flex-direction: column;
        gap: 15px;
        align-items: stretch;
    }
    
    .table-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .table-controls input {
        min-width: auto;
    }
    
    .nav-buttons {
        flex-direction: row;
        width: 100%;
        max-width: none;
        gap: 10px;
    }
    .nav-btn {
        flex: 1 1 0;
        width: auto;
        padding: 10px 12px;
        font-size: 13px;
    }
}

@media (max-width: 480px) {
    .metrics-overview {
        grid-template-columns: repeat(2, 1fr);
        gap: 10px;
    }
    .metric-card {
        flex-direction: column;
        text-align: center;
        gap: 15px;
    }
    
    .metric-icon {
        width: 60px;
        height: 60px;
        font-size: 36px;
    }
    
    .metric-number {
        font-size: 28px;
    }
    
    .chart-wrapper {
        height: 250px;
    }
}

/* 加载动画 */
.loading {
    display: flex;
    justify-content: center;
    align-items: center;
    height: 200px;
    color: #666;
    font-size: 16px;
}

.loading::after {
    content: '';
    width: 20px;
    height: 20px;
    border: 2px solid #e0e0e0;
    border-top: 2px solid #7070ff;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-left: 10px;
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 空状态 */
.empty-state {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.empty-state-icon {
    font-size: 48px;
    margin-bottom: 16px;
    opacity: 0.5;
}

/* 工具提示 */
.tooltip {
    position: relative;
    cursor: help;
}

.tooltip::after {
    content: attr(data-tooltip);
    position: absolute;
    bottom: 100%;
    left: 50%;
    transform: translateX(-50%);
    background: #333;
    color: white;
    padding: 8px 12px;
    border-radius: 6px;
    font-size: 12px;
    white-space: nowrap;
    opacity: 0;
    pointer-events: none;
    transition: opacity 0.3s ease;
    z-index: 1000;
}

.tooltip:hover::after {
    opacity: 1;
}
