* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 20px;
}

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

.header {
    text-align: center;
    color: white;
    margin-bottom: 40px;
    animation: fadeInDown 0.6s ease;
}

.header h1 {
    font-size: 3em;
    margin-bottom: 10px;
    text-shadow: 0 2px 10px rgba(0,0,0,0.2);
}

.header p {
    font-size: 1.2em;
    opacity: 0.9;
}

.stats-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 20px;
    margin-bottom: 30px;
}

.stat-card {
    background: white;
    border-radius: 15px;
    padding: 25px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    animation: fadeInUp 0.6s ease;
}

.stat-card:hover {
    transform: translateY(-5px);
    box-shadow: 0 15px 40px rgba(0,0,0,0.3);
}

.stat-card .icon {
    font-size: 2.5em;
    margin-bottom: 10px;
}

.stat-card .label {
    font-size: 0.9em;
    color: #666;
    margin-bottom: 10px;
}

.stat-card .value {
    font-size: 2em;
    font-weight: bold;
    color: #667eea;
}

.chart-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    margin-bottom: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: fadeInUp 0.8s ease;
}

.chart-section h2 {
    margin-bottom: 20px;
    color: #333;
    font-size: 1.5em;
}

.chart-container {
    height: 300px;
}

.table-section {
    background: white;
    border-radius: 15px;
    padding: 30px;
    box-shadow: 0 10px 30px rgba(0,0,0,0.2);
    animation: fadeInUp 1s ease;
}

.table-section h2 {
    margin-bottom: 20px;
    color: #333;
}

.table-responsive {
    overflow-x: auto;
}

table {
    width: 100%;
    border-collapse: collapse;
}

table thead {
    background: #ffffff;
    color: white;
}

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

table tbody tr:hover {
    background: #f8f9fa;
}

.loading {
    text-align: center;
    padding: 50px;
    color: white;
    font-size: 1.5em;
}

.loading::after {
    content: '...';
    animation: dots 1.5s steps(4, end) infinite;
}

.error {
    background: #ff4444;
    color: white;
    padding: 20px;
    border-radius: 10px;
    margin: 20px 0;
    text-align: center;
}

.refresh-btn {
    background: #ffffff;
    color: white;
    border: none;
    padding: 12px 30px;
    border-radius: 25px;
    font-size: 1em;
    cursor: pointer;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(0,0,0,0.2);
    margin: 20px auto;
    display: block;
}

.refresh-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(0,0,0,0.3);
}

.distribution-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 20px;
    margin-top: 20px;
}

.distribution-card {
    background: #f8f9fa;
    padding: 20px;
    border-radius: 10px;
}

.distribution-card h3 {
    margin-bottom: 15px;
    color: #667eea;
}

.distribution-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 10px 0;
    border-bottom: 1px solid #dee2e6;
}

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

.distribution-item .name {
    flex: 1;
}

.distribution-item .count {
    font-weight: bold;
    color: #667eea;
    margin: 0 15px;
}

.distribution-item .bar {
    width: 100px;
    height: 20px;
    background: #e9ecef;
    border-radius: 10px;
    overflow: hidden;
}

.distribution-item .bar-fill {
    height: 100%;
    background: #ffffff;
    transition: width 0.5s ease;
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes fadeInUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

@keyframes dots {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

@media (max-width: 768px) {
    .header h1 {
        font-size: 2em;
    }
    
    .stats-grid {
        grid-template-columns: 1fr;
    }
    
    .distribution-grid {
        grid-template-columns: 1fr;
    }
}

/* 白色背景下的额外样式调整 */
.container {
    background: #f5f7fa !important;
}

.header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%) !important;
    padding: 3rem 2rem !important;
    margin: -2rem -2rem 2rem -2rem !important;
    border-radius: 0 !important;
}

.header h1,
.header p {
    color: white !important;
}

/* 将退出登录按钮移到页面顶部 */
.user-badge {
    position: fixed !important;
    top: 20px !important;
    right: 20px !important;
    left: auto !important;
    bottom: auto !important;
    background: white !important;
    padding: 12px 24px !important;
    border-radius: 30px !important;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15) !important;
    display: flex !important;
    align-items: center !important;
    gap: 15px !important;
    z-index: 10000 !important;
}

.user-name {
    color: #667eea !important;
    font-weight: 600 !important;
    font-size: 14px !important;
}

.logout-btn {
    background: linear-gradient(135deg, #667eea, #764ba2) !important;
    color: white !important;
    border: none !important;
    padding: 8px 18px !important;
    border-radius: 20px !important;
    font-size: 13px !important;
    font-weight: 600 !important;
    cursor: pointer !important;
    transition: transform 0.2s !important;
}

.logout-btn:hover {
    transform: translateY(-2px) !important;
}
