/**
 * 移动端响应式设计增强
 * 非侵入式，不影响现有样式
 */

/* 移动端优化 - 小屏幕设备 */
@media (max-width: 768px) {
    /* 改善触摸体验 */
    button, a, input, select, textarea {
        min-height: 44px; /* iOS推荐的最小触摸目标 */
        min-width: 44px;
    }
    
    /* 改善表格显示 */
    .table-responsive {
        -webkit-overflow-scrolling: touch;
        overflow-x: auto;
    }
    
    table {
        font-size: 0.875rem;
    }
    
    /* 改善卡片布局 */
    .card {
        margin-bottom: 1rem;
    }
    
    .card-body {
        padding: 1rem;
    }
    
    /* 改善图表容器 */
    .chart-container {
        height: 250px !important;
        max-height: 250px;
    }
    
    /* 改善导航栏 */
    .navbar-nav {
        padding: 0.5rem 0;
    }
    
    .navbar-nav .nav-link {
        padding: 0.75rem 1rem;
    }
    
    /* 改善按钮组 */
    .btn-group {
        display: flex;
        flex-direction: column;
        width: 100%;
    }
    
    .btn-group .btn {
        width: 100%;
        margin-bottom: 0.5rem;
    }
    
    /* 改善表单 */
    .form-control, .form-select {
        font-size: 16px; /* 防止iOS自动缩放 */
    }
    
    /* 改善模态框 */
    .modal-dialog {
        margin: 0.5rem;
        max-width: calc(100% - 1rem);
    }
    
    .modal-content {
        border-radius: 0.5rem;
    }
    
    /* 改善时间显示 */
    .time-display {
        font-size: 0.875rem;
        word-break: break-word;
    }
    
    /* 改善状态指示器 */
    .status-badge {
        font-size: 0.75rem;
        padding: 0.25rem 0.5rem;
    }
    
    /* 改善数据表格 */
    .data-table {
        font-size: 0.8rem;
    }
    
    .data-table th,
    .data-table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* 隐藏不必要的装饰元素 */
    .decorative-element {
        display: none;
    }
    
    /* 改善滚动性能 */
    * {
        -webkit-overflow-scrolling: touch;
    }
    
    /* 改善文本可读性 */
    body {
        -webkit-text-size-adjust: 100%;
        text-size-adjust: 100%;
    }
}

/* 超小屏幕设备 */
@media (max-width: 576px) {
    /* 进一步优化小屏幕 */
    .container {
        padding-left: 0.75rem;
        padding-right: 0.75rem;
    }
    
    h1 {
        font-size: 1.5rem;
    }
    
    h2 {
        font-size: 1.25rem;
    }
    
    h3 {
        font-size: 1.1rem;
    }
    
    /* 改善图表 */
    .chart-container {
        height: 200px !important;
    }
    
    /* 改善卡片标题 */
    .card-title {
        font-size: 1rem;
    }
    
    /* 改善按钮 */
    .btn {
        font-size: 0.875rem;
        padding: 0.5rem 1rem;
    }
    
    /* 改善输入框 */
    .form-control, .form-select {
        font-size: 16px;
        padding: 0.5rem;
    }
}

/* 横屏优化 */
@media (max-width: 1024px) and (orientation: landscape) {
    .chart-container {
        height: 300px !important;
    }
    
    .navbar {
        padding: 0.25rem 0;
    }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    /* 改善图标和图像清晰度 */
    img, svg {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    /* 改善触摸反馈 */
    button, a, .clickable {
        -webkit-tap-highlight-color: rgba(0, 0, 0, 0.1);
        tap-highlight-color: rgba(0, 0, 0, 0.1);
    }
    
    /* 改善悬停效果 */
    .hover-effect:hover {
        opacity: 1;
    }
    
    /* 改善滚动 */
    .scrollable {
        -webkit-overflow-scrolling: touch;
        overscroll-behavior: contain;
    }
}

/* 改善可访问性 */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
}

/* 改善打印样式 */
@media print {
    .no-print {
        display: none !important;
    }
    
    .chart-container {
        page-break-inside: avoid;
    }
}

