/* 移动端专用样式 */

/* 小屏幕设备优化 */
@media (max-width: 576px) {
    .container {
        padding-left: 8px;
        padding-right: 8px;
    }
    
    /* 按钮组垂直排列 */
    .btn-group {
        flex-direction: column;
    }
    
    .btn-group .btn {
        border-radius: 6px !important;
        margin-bottom: 5px;
    }
    
    /* 表格优化 */
    .table-responsive {
        font-size: 0.85rem;
    }
    
    .table th,
    .table td {
        padding: 0.5rem 0.25rem;
    }
    
    /* 隐藏非必要列 */
    .table td:nth-child(4), /* 规格列 */
    .table th:nth-child(4) {
        display: none;
    }
    
    /* 卡片内边距调整 */
    .card-body {
        padding: 1rem;
    }
    
    /* 表单元素调整 */
    .form-control {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    /* 搜索区域调整 */
    .input-group {
        flex-direction: column;
    }
    
    .input-group .form-control {
        border-radius: 8px;
        margin-bottom: 10px;
    }
    
    .input-group .btn {
        border-radius: 8px;
        width: 100%;
    }
}

/* 超小屏幕设备 */
@media (max-width: 400px) {
    .navbar-brand {
        font-size: 1.2rem;
    }
    
    .login-card {
        padding: 1.25rem;
    }
    
    .card-header-custom h5 {
        font-size: 1rem;
    }
}

/* 横屏模式优化 */
@media (max-height: 500px) and (orientation: landscape) {
    .login-container {
        padding: 10px;
    }
    
    .login-card {
        max-width: 90%;
        padding: 1.5rem;
    }
    
    .scanner-modal .modal-dialog {
        max-width: 90%;
    }
}

/* 高DPI屏幕优化 */
@media (-webkit-min-device-pixel-ratio: 2), (min-resolution: 192dpi) {
    .product-image {
        image-rendering: -webkit-optimize-contrast;
        image-rendering: crisp-edges;
    }
}

/* 减少动画（无障碍支持） */
@media (prefers-reduced-motion: reduce) {
    * {
        animation-duration: 0.01ms !important;
        animation-iteration-count: 1 !important;
        transition-duration: 0.01ms !important;
    }
    
    .scanner-line {
        animation: none;
    }
    
    .card-custom:hover {
        transform: none;
    }
}

/* 触摸反馈优化 */
.btn:active {
    transform: scale(0.98);
}

/* 长按菜单防止 */
* {
    -webkit-touch-callout: none;
    -webkit-user-select: none;
    -khtml-user-select: none;
    -moz-user-select: none;
    -ms-user-select: none;
    user-select: none;
}

input, textarea {
    -webkit-user-select: text;
    -khtml-user-select: text;
    -moz-user-select: text;
    -ms-user-select: text;
    user-select: text;
}