* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

html {
    height: 100%;
    width: 100%;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    line-height: 1.6;
    color: #333;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    width: 100%;
    overflow-x: hidden;
    display: flex;
    flex-direction: column;
}

.wrapper {
    width: 100%;
    max-width: 1400px;
    margin: 0 auto;
    padding: 0 1rem;
    flex: 1;
}

header {
    background: rgba(255, 255, 255, 0.95);
    padding: 2rem 0;
    text-align: center;
    box-shadow: 0 2px 10px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    width: 100%;
}

header h1 {
    color: #4a5568;
    font-size: clamp(1.5rem, 5vw, 2.5rem);
    margin-bottom: 0.5rem;
    font-weight: 700;
}

header p {
    color: #718096;
    font-size: clamp(0.9rem, 2.5vw, 1.1rem);
}

main {
    padding: 2rem 0;
    width: 100%;
    flex: 1;
}

.dashboard {
    margin-bottom: 3rem;
}

.stats-cards {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(250px, 1fr));
    gap: 1.5rem;
    margin-bottom: 2rem;
    width: 100%;
}

.card {
    background: rgba(255, 255, 255, 0.95);
    padding: clamp(1rem, 3vw, 1.5rem);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    transition: transform 0.3s ease, box-shadow 0.3s ease;
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
}

.card:hover {
    transform: translateY(-5px);
    box-shadow: 0 12px 40px rgba(0,0,0,0.15);
}

.card h3 {
    color: #4a5568;
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    font-weight: 600;
    margin-bottom: 0.5rem;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.stat-number {
    font-size: clamp(1.2rem, 4vw, 2rem);
    font-weight: 700;
    color: #2d3748;
    margin-bottom: 0.5rem;
}

.trend {
    font-size: clamp(0.8rem, 2vw, 0.9rem);
    font-weight: 600;
    padding: 0.25rem 0.5rem;
    border-radius: 5px;
    display: inline-block;
}

.trend.up {
    color: #48bb78;
    background: rgba(72, 187, 120, 0.1);
}

.trend.down {
    color: #f56565;
    background: rgba(245, 101, 101, 0.1);
}

.charts-grid {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(300px, 1fr));
    gap: 2rem;
    margin-bottom: 3rem;
    width: 100%;
}

.chart-container {
    background: rgba(255, 255, 255, 0.95);
    padding: clamp(1rem, 3vw, 2rem);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    min-height: 0;
}

.chart-container h2 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-size: clamp(1rem, 3vw, 1.3rem);
    font-weight: 600;
    text-align: center;
}

.chart-wrapper {
    position: relative;
    width: 100%;
    height: 0;
    padding-bottom: 60%; /* 调整此值来控制图表高度比例 */
}

.chart-container canvas {
    position: absolute;
    top: 0;
    left: 0;
    width: 100% !important;
    height: 100% !important;
}

.table-wrapper {
    overflow-x: auto;
    -webkit-overflow-scrolling: touch;
}

.data-table {
    background: rgba(255, 255, 255, 0.95);
    padding: clamp(1rem, 3vw, 2rem);
    border-radius: 15px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.1);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.2);
    width: 100%;
    overflow-x: auto;
}

.data-table h2 {
    color: #2d3748;
    margin-bottom: 1.5rem;
    font-size: clamp(1.2rem, 3.5vw, 1.5rem);
    font-weight: 600;
}

#dataTable {
    width: 100%;
    border-collapse: collapse;
    margin-top: 1rem;
    min-width: 600px;
}

#dataTable th,
#dataTable td {
    padding: clamp(0.5rem, 2vw, 1rem);
    text-align: left;
    border-bottom: 1px solid #e2e8f0;
    font-size: clamp(0.8rem, 2vw, 1rem);
}

#dataTable th {
    background: #f7fafc;
    font-weight: 600;
    color: #4a5568;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

#dataTable tr:hover {
    background: #f7fafc;
}

footer {
    background: rgba(255, 255, 255, 0.95);
    text-align: center;
    padding: 2rem 0;
    margin-top: 3rem;
    color: #718096;
    box-shadow: 0 -2px 10px rgba(0,0,0,0.1);
    width: 100%;
}

/* 超小屏幕优化 */
@media (max-width: 480px) {
    .wrapper {
        padding: 0 0.5rem;
    }
    
    .stats-cards {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
        gap: 1rem;
    }
    
    .chart-container {
        padding: 0.75rem;
    }
    
    .chart-container canvas {
        max-height: 300px;
    }
}

/* 小屏幕优化 */
@media (max-width: 768px) and (min-width: 481px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: 1fr;
    }
    
    .chart-container canvas {
        max-height: 350px;
    }
}

/* 中等屏幕优化 */
@media (max-width: 1024px) and (min-width: 769px) {
    .stats-cards {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-container canvas {
        max-height: 400px;
    }
}

/* 大屏幕优化 */
@media (min-width: 1025px) {
    .stats-cards {
        grid-template-columns: repeat(4, 1fr);
    }
    
    .charts-grid {
        grid-template-columns: repeat(2, 1fr);
    }
    
    .chart-container canvas {
        max-height: 450px;
    }
}