/* 保留第一个完整的max-width: 900px媒体查询 */
/* 统一的响应式媒体查询 - 按屏幕尺寸降序排列 */

/* 大屏幕响应式 */
@media (max-width: 1200px) {
    .time-grid, .history-grid {
        grid-template-columns: repeat(6, 1fr);
    }
}

/* 中等屏幕响应式 */
@media (max-width: 900px) {
    .container {
        grid-template-columns: 1fr;
    }
    
    .timer-display {
        width: 200px;
        height: 200px;
    }
    
    .time {
        font-size: 38px;
    }
    
    .control-buttons {
        flex-direction: column;
    }
    
    .stat-container,
    .stats-container {
        grid-template-columns: repeat(4, minmax(0, 1fr));
        width: 100%;
        box-sizing: border-box;
    }
    
    .legend {
        flex-direction: column;
        align-items: center;
        gap: 12px;
    }
    
    .stat-card h3 {
        font-size: 11px;
    }
    
    .stat-card p {
        font-size: 14px;
    }
    
    .stat-value {
        font-size: 20px;
    }
}

/* 平板屏幕响应式 */
@media (max-width: 768px) {
    .time-grid, .history-grid {
        grid-template-columns: repeat(4, 1fr);
        padding: 8px;
    }
    
    .week-header, .week-time-row {
        grid-template-columns: 60px repeat(7, 1fr);
    }
    
    .week-time-label {
        font-size: 10px;
        padding: 0 5px;
    }
    
    .week-day-cell {
        height: 20px;
    }
    
    .month-day-cell {
        height: 40px;
    }
}

/* 小屏幕响应式 */
@media (max-width: 600px) {
    body {
        padding: 10px;
    }
    
    .panel {
        padding: 15px;
    }
    
    .timer-display {
        width: 180px;
        height: 180px;
    }
    
    .time {
        font-size: 32px;
    }
    
    .mode-btn {
        padding: 8px;
        font-size: 14px;
    }
    
    .control-btn {
        padding: 12px;
        font-size: 14px;
    }
    
    .stat-container,
    .stats-container {
        grid-template-columns: repeat(4, 1fr);
        width: 100%;
        box-sizing: border-box;
        gap: 4px;
    }
    
    .stat-card {
        padding: 5px;
        min-height: 60px;
    }
    
    .stat-value {
        font-size: 18px;
    }
    
    .stat-label {
        font-size: 11px;
    }
    
    .stat-card h3 {
        font-size: 10px;
    }
    
    .stat-card p {
        font-size: 12px;
    }
}

/* 手机屏幕响应式 */
@media (max-width: 480px) {
    .time-grid, .history-grid {
        grid-template-columns: repeat(3, 1fr);
        padding: 5px;
    }
    
    .stat-container,
    .stats-container {
        grid-template-columns: repeat(2, 1fr);
        width: 100%;
        box-sizing: border-box;
        gap: 8px;
    }
    
    .stat-card {
        min-width: auto;
        padding: 8px;
    }
    
    .stat-value {
        font-size: 16px;
    }
    
    .stat-label {
        font-size: 10px;
    }
    
    .week-header, .week-time-row {
        grid-template-columns: 50px repeat(7, 1fr);
    }
    
    .week-day-header, .month-day-header {
        font-size: 12px;
        padding: 5px;
    }
    
    .date-selector {
        flex-direction: column;
        align-items: stretch;
    }
    
    .date-selector label {
        margin-bottom: 5px;
    }
    
    .month-day-cell {
        height: 30px;
        font-size: 12px;
    }
}

/* 小屏幕手机响应式 */
@media (max-width: 350px) {
    .stat-container,
    .stats-container {
        grid-template-columns: 1fr;
    }
}