/* 移动端自适应样式 */

/* 基础响应式设置 */
* {
    box-sizing: border-box;
}

html {
    -webkit-text-size-adjust: 100%;
    -ms-text-size-adjust: 100%;
}

img {
    max-width: 100%;
    height: auto;
}

/* 平板设备 (768px - 1024px) */
@media screen and (max-width: 1024px) {
    .container {
        padding: 0 20px;
    }
    
    .ant-layout-sider {
        width: 200px !important;
        min-width: 200px !important;
    }
}

/* 手机设备 (小于768px) */
@media screen and (max-width: 768px) {
    body {
        font-size: 14px;
    }
    
    .container {
        padding: 0 15px;
    }
    
    /* 导航栏适配 */
    .ant-layout-header,
    header {
        padding: 0 15px !important;
        height: auto !important;
        min-height: 50px;
    }
    
    /* 侧边栏适配 - 手机上隐藏 */
    .ant-layout-sider {
        position: fixed !important;
        z-index: 999;
        transform: translateX(-100%);
        transition: transform 0.3s;
    }
    
    .ant-layout-sider.show {
        transform: translateX(0);
    }
    
    /* 内容区域全宽 */
    .ant-layout-content,
    main {
        margin-left: 0 !important;
        padding: 15px !important;
    }
    
    /* 表格响应式 */
    .ant-table-wrapper {
        overflow-x: auto;
    }
    
    .ant-table {
        min-width: 600px;
    }
    
    /* 表单适配 */
    .ant-form-item {
        margin-bottom: 12px;
    }
    
    .ant-input,
    .ant-select-selector,
    .ant-picker {
        font-size: 16px !important; /* 防止iOS自动缩放 */
    }
    
    /* 按钮适配 */
    .ant-btn {
        padding: 6px 12px;
        font-size: 14px;
    }
    
    /* 卡片适配 */
    .ant-card {
        margin-bottom: 15px;
    }
    
    .ant-card-body {
        padding: 15px;
    }
    
    /* 模态框适配 */
    .ant-modal {
        max-width: 95vw !important;
        margin: 10px auto !important;
    }
    
    .ant-modal-body {
        padding: 15px;
    }
    
    /* 统计卡片适配 */
    .ant-statistic {
        text-align: center;
    }
    
    /* Flex布局适配 */
    .ant-row {
        margin: 0 !important;
    }
    
    .ant-col {
        padding: 5px !important;
    }
    
    /* 分页适配 */
    .ant-pagination {
        display: flex;
        flex-wrap: wrap;
        justify-content: center;
    }
    
    .ant-pagination-item {
        min-width: 32px;
    }
}

/* 小屏手机 (小于480px) */
@media screen and (max-width: 480px) {
    body {
        font-size: 13px;
    }
    
    h1 { font-size: 1.5rem; }
    h2 { font-size: 1.3rem; }
    h3 { font-size: 1.1rem; }
    
    .ant-btn {
        padding: 4px 10px;
        font-size: 13px;
    }
    
    .ant-table {
        font-size: 12px;
    }
    
    .ant-modal {
        top: 20px !important;
    }
    
    /* 隐藏某些非必要列 */
    .hide-on-mobile {
        display: none !important;
    }
}

/* 横屏适配 */
@media screen and (max-width: 768px) and (orientation: landscape) {
    .ant-layout-header {
        height: 45px !important;
    }
    
    .ant-modal {
        max-height: 90vh;
        overflow-y: auto;
    }
}

/* iOS Safari底部安全区域 */
@supports (padding-bottom: env(safe-area-inset-bottom)) {
    .ant-layout {
        padding-bottom: env(safe-area-inset-bottom);
    }
}

/* 触摸设备优化 */
@media (hover: none) and (pointer: coarse) {
    .ant-btn,
    .ant-menu-item,
    .ant-table-row {
        min-height: 44px;
    }
    
    a, button {
        touch-action: manipulation;
    }
}
