/* 移动端触摸优化 */
@media (max-width: 1024px) {
    /* 触摸目标尺寸优化 */
    .project-metrics {
        min-height: 44px; /* 确保触摸目标足够大 */
        touch-action: manipulation; /* 优化触摸响应 */
        -webkit-tap-highlight-color: transparent; /* 移除默认触摸高亮 */
    }
    
    .metric-item {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    .progress-section {
        min-height: 44px;
        touch-action: manipulation;
    }
    
    /* 触摸反馈优化 */
    .project-metrics:active {
        background: rgba(255, 255, 255, 0.25);
        transform: scale(0.98);
        transition: all 0.15s cubic-bezier(0.4, 0, 0.2, 1);
    }
    
    .metric-item:active {
        background: rgba(255, 255, 255, 0.1);
        transform: scale(0.95);
        transition: all 0.1s cubic-bezier(0.4, 0, 0.2, 1);
    }
}

/* 平板电脑特定优化 */
@media (min-width: 768px) and (max-width: 1024px) and (orientation: portrait) {
    .project-metrics {
        margin: 20px 0;
        padding: 20px;
        gap: 25px;
    }
    
    .metric-item {
        padding: 0 20px;
    }
    
    .metric-label {
        font-size: 14px;
        margin-bottom: 10px;
    }
    
    .metric-value {
        font-size: 20px;
    }
    
    .progress-section {
        margin: 20px 0;
        padding: 20px;
    }
    
    .progress-label {
        font-size: 16px;
        min-width: 80px;
    }
    
    .progress-bar {
        height: 12px;
    }
    
    .progress-percentage {
        font-size: 16px;
        min-width: 50px;
    }
}

@media (min-width: 768px) and (max-width: 1024px) and (orientation: landscape) {
    .project-metrics {
        margin: 15px 0;
        padding: 15px;
        gap: 20px;
    }
    
    .metric-item {
        padding: 0 15px;
    }
    
    .metric-label {
        font-size: 12px;
        margin-bottom: 6px;
    }
    
    .metric-value {
        font-size: 18px;
    }
    
    .progress-section {
        margin: 15px 0;
        padding: 15px;
    }
    
    .progress-label {
        font-size: 14px;
        min-width: 70px;
    }
    
    .progress-bar {
        height: 10px;
    }
    
    .progress-percentage {
        font-size: 14px;
        min-width: 45px;
    }
}

/* 手机横屏模式优化 */
@media (max-width: 767px) and (orientation: landscape) {
    .project-metrics {
        flex-direction: row;
        gap: 12px;
        margin: 10px 0;
        padding: 10px;
    }
    
    .metric-item {
        padding: 0 6px;
        border-bottom: none;
        width: auto;
        flex-direction: column;
        text-align: center;
        min-height: 40px;
    }
    
    .metric-label {
        text-align: center;
        margin-bottom: 3px;
        font-size: 10px;
    }
    
    .metric-value {
        text-align: center;
        font-size: 14px;
    }
    
    .progress-section {
        margin: 10px 0;
        padding: 10px;
    }
    
    .progress-item {
        flex-direction: row;
        align-items: center;
        gap: 10px;
    }
    
    .progress-label {
        width: auto;
        min-width: 50px;
        font-size: 12px;
    }
    
    .progress-bar {
        width: auto;
        flex: 1;
        height: 6px;
    }
    
    .progress-percentage {
        width: auto;
        min-width: 35px;
        text-align: right;
        font-size: 12px;
    }
}

/* 超小屏幕设备优化 */
@media (max-width: 360px) {
    .project-metrics {
        margin: 8px 0;
        padding: 10px;
        gap: 12px;
    }
    
    .metric-item {
        padding: 6px 0;
        min-height: 40px;
    }
    
    .metric-label {
        font-size: 10px;
        margin-bottom: 0;
    }
    
    .metric-value {
        font-size: 14px;
    }
    
    .progress-section {
        margin: 8px 0;
        padding: 10px;
    }
    
    .progress-item {
        gap: 6px;
    }
    
    .progress-label {
        font-size: 12px;
    }
    
    .progress-bar {
        height: 6px;
    }
    
    .progress-percentage {
        font-size: 12px;
    }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 3), (min-resolution: 288dpi) {
    .project-metrics {
        border-width: 0.5px;
    }
    
    .progress-section {
        border-width: 0.5px;
    }
    
    .metric-item {
        border-bottom-width: 0.5px;
    }
}

/* 安全区域支持（iPhone X 等） */
@supports (padding: max(0px)) {
    .project-metrics {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
    
    .progress-section {
        padding-left: max(15px, env(safe-area-inset-left));
        padding-right: max(15px, env(safe-area-inset-right));
    }
}

/* 打印样式优化 */
@media print {
    .project-metrics {
        background: #f5f5f5;
        border: 1px solid #ddd;
        color: #333;
        box-shadow: none;
    }
    
    .metric-label {
        color: #666;
    }
    
    .metric-value {
        color: #333;
    }
    
    .progress-section {
        background: #f9f9f9;
        border: 1px solid #ddd;
    }
    
    .progress-label {
        color: #666;
    }
    
    .progress-bar {
        background: #e0e0e0;
        border: 1px solid #ccc;
    }
    
    .progress-fill {
        background: #4CAF50;
    }
    
    .progress-percentage {
        color: #333;
    }
}
