GZMachinesWeb/WebContent/static/css/mobile.css

364 lines
6.0 KiB
CSS
Raw Normal View History

2025-07-16 18:26:36 +08:00
/* 移动端适配样式 */
* {
box-sizing: border-box;
}
body {
margin: 0;
padding: 0;
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
font-size: 14px;
line-height: 1.5;
color: #333;
background-color: #f5f5f5;
}
/* 容器 */
.mobile-container {
width: 100%;
max-width: 100%;
padding: 0;
margin: 0;
}
/* 头部 */
.mobile-header {
position: fixed;
top: 0;
left: 0;
right: 0;
height: 50px;
background-color: #007bff;
color: white;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 15px;
z-index: 1000;
box-shadow: 0 2px 4px rgba(0,0,0,0.1);
}
.mobile-header h1 {
font-size: 18px;
margin: 0;
font-weight: 500;
}
.back-btn {
background: none;
border: none;
color: white;
font-size: 16px;
padding: 5px;
cursor: pointer;
}
/* 内容区域 */
.mobile-content {
margin-top: 50px;
padding: 15px;
padding-bottom: 80px; /* 为底部按钮留空间 */
}
/* 搜索表单 */
.mobile-search-form {
background: white;
border-radius: 8px;
padding: 15px;
margin-bottom: 15px;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.mobile-form-group {
margin-bottom: 15px;
}
.mobile-form-group:last-child {
margin-bottom: 0;
}
.mobile-form-group label {
display: block;
margin-bottom: 5px;
font-weight: 500;
color: #555;
}
.mobile-form-control {
width: 100%;
padding: 10px 12px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 16px; /* 防止iOS缩放 */
background-color: white;
}
.mobile-form-control:focus {
outline: none;
border-color: #007bff;
box-shadow: 0 0 0 2px rgba(0,123,255,0.25);
}
.mobile-select {
width: 100%;
padding: 10px 12px;
border: 1px solid #ddd;
border-radius: 4px;
font-size: 16px;
background-color: white;
}
/* 按钮 */
.mobile-btn {
display: inline-block;
padding: 10px 16px;
border: none;
border-radius: 4px;
font-size: 14px;
text-align: center;
cursor: pointer;
text-decoration: none;
transition: all 0.2s;
min-height: 44px; /* iOS触摸目标最小尺寸 */
}
.mobile-btn-primary {
background-color: #007bff;
color: white;
}
.mobile-btn-primary:hover {
background-color: #0056b3;
}
.mobile-btn-success {
background-color: #28a745;
color: white;
}
.mobile-btn-success:hover {
background-color: #1e7e34;
}
.mobile-btn-full {
width: 100%;
margin-bottom: 10px;
}
/* 任务列表 */
.mobile-task-list {
background: white;
border-radius: 8px;
overflow: hidden;
box-shadow: 0 1px 3px rgba(0,0,0,0.1);
}
.mobile-task-item {
padding: 15px;
border-bottom: 1px solid #eee;
position: relative;
}
.mobile-task-item:last-child {
border-bottom: none;
}
.mobile-task-item.selected {
background-color: #e7f3ff;
}
.mobile-task-header {
display: flex;
align-items: flex-start;
margin-bottom: 8px;
}
.mobile-task-checkbox {
margin-right: 10px;
margin-top: 2px;
transform: scale(1.2);
}
.mobile-task-title {
flex: 1;
font-size: 16px;
font-weight: 500;
color: #333;
line-height: 1.4;
}
.mobile-task-meta {
display: grid;
grid-template-columns: 1fr 1fr;
gap: 8px;
margin-top: 10px;
font-size: 13px;
color: #666;
}
.mobile-task-meta-item {
display: flex;
flex-direction: column;
}
.mobile-task-meta-label {
font-size: 12px;
color: #999;
margin-bottom: 2px;
}
.mobile-task-meta-value {
font-weight: 500;
}
/* 底部操作栏 */
.mobile-bottom-actions {
position: fixed;
bottom: 0;
left: 0;
right: 0;
background: white;
padding: 15px;
border-top: 1px solid #eee;
box-shadow: 0 -2px 4px rgba(0,0,0,0.1);
z-index: 1000;
}
.mobile-bottom-actions .mobile-btn {
margin-bottom: 0;
}
/* 加载状态 */
.mobile-loading {
text-align: center;
padding: 20px;
color: #666;
}
.mobile-loading::after {
content: "";
display: inline-block;
width: 20px;
height: 20px;
border: 2px solid #ddd;
border-top-color: #007bff;
border-radius: 50%;
animation: mobile-spin 1s linear infinite;
margin-left: 10px;
}
@keyframes mobile-spin {
to {
transform: rotate(360deg);
}
}
/* 空状态 */
.mobile-empty {
text-align: center;
padding: 40px 20px;
color: #999;
}
.mobile-empty-icon {
font-size: 48px;
margin-bottom: 15px;
color: #ddd;
}
/* 分页 */
.mobile-pagination {
text-align: center;
padding: 20px;
}
.mobile-pagination .mobile-btn {
margin: 0 5px;
min-width: 44px;
}
/* 模态框 */
.mobile-modal {
position: fixed;
top: 0;
left: 0;
right: 0;
bottom: 0;
background: rgba(0,0,0,0.5);
z-index: 2000;
display: none;
}
.mobile-modal.show {
display: block;
}
.mobile-modal-content {
position: absolute;
bottom: 0;
left: 0;
right: 0;
background: white;
border-radius: 16px 16px 0 0;
padding: 20px;
max-height: 80vh;
overflow-y: auto;
}
.mobile-modal-header {
display: flex;
justify-content: space-between;
align-items: center;
margin-bottom: 20px;
padding-bottom: 15px;
border-bottom: 1px solid #eee;
}
.mobile-modal-title {
font-size: 18px;
font-weight: 500;
margin: 0;
}
.mobile-modal-close {
background: none;
border: none;
font-size: 24px;
color: #999;
cursor: pointer;
}
/* 响应式调整 */
@media (max-width: 480px) {
.mobile-content {
padding: 10px;
}
.mobile-search-form {
padding: 12px;
}
.mobile-task-meta {
grid-template-columns: 1fr;
}
.mobile-bottom-actions {
padding: 12px;
}
}
/* 横屏适配 */
@media (orientation: landscape) and (max-height: 500px) {
.mobile-header {
height: 44px;
}
.mobile-content {
margin-top: 44px;
padding-bottom: 70px;
}
.mobile-bottom-actions {
padding: 10px 15px;
}
}