diff --git a/src/assets/main.css b/src/assets/main.css index d9ecd78..238b7b3 100644 --- a/src/assets/main.css +++ b/src/assets/main.css @@ -102,30 +102,43 @@ select { ); } -@media (pointer: coarse) { - .ss-sidebar .ant-menu-item { +/* 移动平台(iOS/Android)小屏设备适配 */ +@media (max-width: 768px) { + /* 侧边栏菜单项增大触摸区域 */ + html.platform-ios .ss-sidebar .ant-menu-item, + html.platform-android .ss-sidebar .ant-menu-item { min-height: 48px; font-size: 16px; } - .ant-btn { - min-height: 44px; + /* 按钮和输入框保持合适大小 */ + html.platform-ios .ant-btn, + html.platform-android .ant-btn { + min-height: 40px; } - .ant-input, - .ant-select-selector, - .ant-input-number { - min-height: 44px; + html.platform-ios .ant-input, + html.platform-ios .ant-select-selector, + html.platform-ios .ant-input-number, + html.platform-android .ant-input, + html.platform-android .ant-select-selector, + html.platform-android .ant-input-number { + min-height: 40px; font-size: 16px; } - .ant-table th, - .ant-table td { - padding-top: 14px; - padding-bottom: 14px; + /* 表格单元格增加内边距 */ + html.platform-ios .ant-table th, + html.platform-ios .ant-table td, + html.platform-android .ant-table th, + html.platform-android .ant-table td { + padding-top: 12px; + padding-bottom: 12px; } - .ant-modal { + /* 模态框全屏 */ + html.platform-ios .ant-modal, + html.platform-android .ant-modal { max-width: 100vw !important; width: 100vw !important; margin: 0 !important; @@ -136,80 +149,41 @@ select { right: 0 !important; } - .ant-modal-content { + html.platform-ios .ant-modal-content, + html.platform-android .ant-modal-content { height: 100vh !important; border-radius: 0 !important; display: flex !important; flex-direction: column !important; } - .ant-modal-body { + html.platform-ios .ant-modal-body, + html.platform-android .ant-modal-body { flex: 1 !important; overflow-y: auto !important; overflow-x: hidden !important; -webkit-overflow-scrolling: touch !important; } - .ant-modal-wrap { + html.platform-ios .ant-modal-wrap, + html.platform-android .ant-modal-wrap { overflow: hidden !important; } - .ant-select-dropdown { + /* 下拉菜单高度限制 */ + html.platform-ios .ant-select-dropdown, + html.platform-android .ant-select-dropdown { max-height: 50vh !important; overflow-y: auto !important; -webkit-overflow-scrolling: touch !important; } - .ant-table-wrapper { + /* 表格横向滚动 */ + html.platform-ios .ant-table-wrapper, + html.platform-android .ant-table-wrapper { overflow-x: auto !important; -webkit-overflow-scrolling: touch !important; } - - .ant-table { - min-width: 600px !important; - } -} - -@media (max-width: 480px) { - .ant-modal { - max-width: 100vw !important; - width: 100vw !important; - margin: 0 !important; - padding: 0 !important; - } - - .ant-modal-content { - height: 100vh !important; - border-radius: 0 !important; - display: flex !important; - flex-direction: column !important; - } - - .ant-modal-body { - flex: 1 !important; - overflow-y: auto !important; - overflow-x: hidden !important; - -webkit-overflow-scrolling: touch !important; - } - - .ant-modal-wrap { - overflow: hidden !important; - } - - .ant-table-container { - overflow-x: auto !important; - -webkit-overflow-scrolling: touch !important; - } - - .ant-table { - min-width: 600px !important; - } - - .ant-select-dropdown { - max-height: 50vh !important; - overflow-y: auto !important; - -webkit-overflow-scrolling: touch !important; - } } .ss-table-center .ant-table th,