优化移动端UI布局,修复按钮和内容超出屏幕问题

主要改进:
- 优化header布局,支持flex-wrap防止内容溢出
- 改进工具栏和按钮组的响应式布局
- 优化表格在移动端的显示(添加横向滚动)
- 调整模态窗口在小屏幕上的尺寸和间距
- 优化表单输入框字体大小(防止iOS自动缩放)
- 改进统计卡片、导航栏等组件的移动端适配
- 为登录/注册页面添加移动端优化样式

受影响文件:
- templates/index.html - 用户主界面移动端优化
- templates/admin.html - 管理员界面移动端优化
- templates/login.html - 登录页面移动端优化
- templates/register.html - 注册页面移动端优化
- templates/admin_login.html - 管理员登录页面移动端优化

🤖 Generated with [Claude Code](https://claude.com/claude-code)

Co-Authored-By: Claude Opus 4.5 <noreply@anthropic.com>
This commit is contained in:
2025-12-11 12:38:18 +08:00
parent 48124db411
commit 94e716b6b1
5 changed files with 230 additions and 26 deletions

View File

@@ -20,7 +20,7 @@
.header { .header {
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%); background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
color: white; color: white;
padding: 15px; padding: 12px 15px;
box-shadow: 0 2px 10px rgba(0,0,0,0.1); box-shadow: 0 2px 10px rgba(0,0,0,0.1);
} }
@@ -30,22 +30,25 @@
display: flex; display: flex;
justify-content: space-between; justify-content: space-between;
align-items: center; align-items: center;
gap: 10px; gap: 8px;
flex-wrap: wrap;
} }
.header h1 { .header h1 {
font-size: 18px; font-size: 16px;
white-space: nowrap;
} }
.header-actions { .header-actions {
display: flex; display: flex;
gap: 10px; gap: 8px;
align-items: center; align-items: center;
flex-wrap: wrap;
} }
.header-actions > span { .header-actions > span {
display: inline; display: inline;
font-size: 13px; font-size: 12px;
} }
.btn { .btn {
@@ -319,7 +322,112 @@
.action-buttons { .action-buttons {
display: flex; display: flex;
flex-wrap: wrap; flex-wrap: wrap;
gap: 4px;
}
/* 移动端优化 */
@media (max-width: 767px) {
* { -webkit-tap-highlight-color: transparent; }
.header { padding: 10px 12px; }
.header h1 { font-size: 15px; }
.header-actions { gap: 6px; }
.header-actions > span { font-size: 11px; }
.btn { padding: 5px 10px; font-size: 11px; }
.btn-logout { padding: 5px 10px; }
.container { padding: 12px; }
.stats-grid {
grid-template-columns: repeat(2, 1fr);
gap: 8px;
margin-bottom: 15px;
}
.stat-card { padding: 12px 10px; }
.stat-value { font-size: 24px; }
.stat-label { font-size: 11px; }
.panel { padding: 12px; margin-bottom: 12px; }
.panel-title { font-size: 15px; margin-bottom: 12px; padding-bottom: 6px; }
.tabs {
gap: 3px; gap: 3px;
margin-bottom: 12px;
padding-bottom: 0;
overflow-x: auto;
-webkit-overflow-scrolling: touch;
}
.tab {
padding: 8px 12px;
font-size: 12px;
flex-shrink: 0;
}
.table-container {
margin: -12px;
padding: 12px 0;
}
table {
min-width: 800px;
font-size: 11px;
}
th { padding: 8px 6px; font-size: 11px; }
td { padding: 8px 6px; font-size: 11px; }
.status-badge { padding: 3px 8px; font-size: 10px; }
.btn-small { padding: 4px 6px; font-size: 10px; margin: 1px; }
.form-group { margin-bottom: 12px; }
.form-group label { font-size: 12px; margin-bottom: 5px; }
.form-group input,
.form-group select {
padding: 8px;
font-size: 14px;
max-width: 100%;
}
.notification {
top: 10px;
right: 10px;
left: 10px;
padding: 10px 12px;
font-size: 12px;
}
.user-info { font-size: 10px; margin-top: 2px; }
.vip-badge-inline, .normal-badge-inline {
font-size: 9px;
padding: 2px 6px;
}
.action-buttons { gap: 3px; }
.empty-message { padding: 20px 10px; font-size: 12px; }
/* 系统状态卡片优化 */
[style*="display: flex"][style*="justify-content: space-between"] {
gap: 10px !important;
}
/* 系统配置表单优化 */
#scheduleWeekdaysGroup label {
font-size: 12px;
padding: 4px 8px;
}
/* 分页控件优化 */
#logsPagination {
gap: 5px;
padding: 10px 0;
}
#logsPagination button {
padding: 5px 8px;
font-size: 11px;
}
#logsPagination span {
font-size: 11px;
}
} }
/* 平板及以上屏幕 */ /* 平板及以上屏幕 */

View File

@@ -143,6 +143,19 @@
margin-bottom: 20px; margin-bottom: 20px;
font-size: 13px; font-size: 13px;
} }
@media (max-width: 480px) {
body { padding: 12px; align-items: flex-start; padding-top: 20px; }
.login-container { width: 100%; max-width: 100%; padding: 28px 20px; }
.login-header h1 { font-size: 24px; }
.login-header p { font-size: 13px; }
.admin-badge { font-size: 11px; padding: 4px 12px; }
.form-group { margin-bottom: 18px; }
.form-group label { font-size: 13px; }
.form-group input { padding: 11px; font-size: 16px; } /* iOS防止自动缩放 */
.btn-login { padding: 13px; font-size: 15px; }
.back-link { margin-top: 16px; font-size: 14px; }
}
</style> </style>
</head> </head>
<body> <body>

View File

@@ -39,8 +39,8 @@
.header { .header {
background: var(--md-primary); background: var(--md-primary);
color: var(--md-on-primary); color: var(--md-on-primary);
padding: 0 24px; padding: 0 16px;
height: 56px; min-height: 56px;
display: flex; display: flex;
align-items: center; align-items: center;
justify-content: space-between; justify-content: space-between;
@@ -50,15 +50,17 @@
left: 0; left: 0;
right: 0; right: 0;
z-index: 1000; z-index: 1000;
flex-wrap: wrap;
gap: 8px;
} }
.header-title { font-size: 20px; font-weight: 500; display: flex; align-items: center; gap: 8px; } .header-title { font-size: 18px; font-weight: 500; display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.header-actions { display: flex; align-items: center; gap: 8px; } .header-actions { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.header-actions .btn { color: white; } .header-actions .btn { color: white; padding: 6px 12px; font-size: 13px; }
.header-actions .btn-outlined { border-color: rgba(255,255,255,0.7); } .header-actions .btn-outlined { border-color: rgba(255,255,255,0.7); }
.header-actions .btn-outlined:hover { background: rgba(255,255,255,0.1); } .header-actions .btn-outlined:hover { background: rgba(255,255,255,0.1); }
.header-actions .btn-text:hover { background: rgba(255,255,255,0.1); } .header-actions .btn-text:hover { background: rgba(255,255,255,0.1); }
.user-info { display: flex; align-items: center; gap: 8px; font-size: 14px; } .user-info { display: flex; align-items: center; gap: 6px; font-size: 13px; flex-wrap: wrap; }
.vip-badge { background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer; } .vip-badge { background: linear-gradient(135deg, #FFD700, #FFA500); color: #000; padding: 2px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; cursor: pointer; }
.vip-badge:hover { box-shadow: 0 2px 8px rgba(255,215,0,0.5); } .vip-badge:hover { box-shadow: 0 2px 8px rgba(255,215,0,0.5); }
.normal-badge { background: #E0E0E0; color: #616161; padding: 2px 8px; border-radius: 999px; font-size: 12px; cursor: pointer; } .normal-badge { background: #E0E0E0; color: #616161; padding: 2px 8px; border-radius: 999px; font-size: 12px; cursor: pointer; }
@@ -177,7 +179,8 @@
.progress-details { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--md-on-surface-medium); } .progress-details { display: flex; flex-wrap: wrap; gap: 16px; font-size: 12px; color: var(--md-on-surface-medium); }
.account-card-actions { display: flex; align-items: center; gap: 8px; padding: 16px; flex-wrap: wrap; } .account-card-actions { display: flex; align-items: center; gap: 8px; padding: 16px; flex-wrap: wrap; }
.account-card-actions .select-inline { flex: 1; min-width: 100px; } .account-card-actions .select-inline { flex: 1; min-width: 100px; max-width: 100%; }
.account-card-actions .btn { white-space: nowrap; }
.schedule-card { background: var(--md-surface); border-radius: 8px; box-shadow: var(--md-shadow-1); padding: 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; } .schedule-card { background: var(--md-surface); border-radius: 8px; box-shadow: var(--md-shadow-1); padding: 16px; margin-bottom: 16px; display: flex; align-items: center; gap: 16px; flex-wrap: wrap; }
.schedule-info { flex: 1; min-width: 200px; } .schedule-info { flex: 1; min-width: 200px; }
@@ -194,14 +197,14 @@
.screenshot-time { font-size: 12px; color: var(--md-on-surface-medium); margin-bottom: 8px; } .screenshot-time { font-size: 12px; color: var(--md-on-surface-medium); margin-bottom: 8px; }
.screenshot-actions { display: flex; gap: 4px; flex-wrap: wrap; } .screenshot-actions { display: flex; gap: 4px; flex-wrap: wrap; }
.modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 2000; opacity: 0; visibility: hidden; transition: all 0.2s; } .modal-overlay { position: fixed; top: 0; left: 0; right: 0; bottom: 0; background: rgba(0,0,0,0.5); display: flex; align-items: center; justify-content: center; z-index: 2000; opacity: 0; visibility: hidden; transition: all 0.2s; padding: 16px; }
.modal-overlay.active { opacity: 1; visibility: visible; } .modal-overlay.active { opacity: 1; visibility: visible; }
.modal { background: var(--md-surface); border-radius: 16px; box-shadow: var(--md-shadow-3); width: 90%; max-width: 480px; max-height: 90vh; overflow: auto; transform: translateY(-20px); transition: transform 0.2s; } .modal { background: var(--md-surface); border-radius: 16px; box-shadow: var(--md-shadow-3); width: 100%; max-width: 480px; max-height: 90vh; overflow: auto; transform: translateY(-20px); transition: transform 0.2s; }
.modal-overlay.active .modal { transform: translateY(0); } .modal-overlay.active .modal { transform: translateY(0); }
.modal-header { padding: 24px; border-bottom: 1px solid var(--md-divider); } .modal-header { padding: 20px; border-bottom: 1px solid var(--md-divider); }
.modal-title { font-size: 20px; font-weight: 500; } .modal-title { font-size: 18px; font-weight: 500; }
.modal-body { padding: 24px; } .modal-body { padding: 20px; }
.modal-footer { padding: 16px 24px; border-top: 1px solid var(--md-divider); display: flex; justify-content: flex-end; gap: 8px; } .modal-footer { padding: 16px 20px; border-top: 1px solid var(--md-divider); display: flex; justify-content: flex-end; gap: 8px; flex-wrap: wrap; }
.weekday-selector { display: flex; flex-wrap: wrap; gap: 8px; } .weekday-selector { display: flex; flex-wrap: wrap; gap: 8px; }
.weekday-chip { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border: 1px solid var(--md-divider); border-radius: 999px; cursor: pointer; transition: all 0.2s; font-size: 13px; user-select: none; } .weekday-chip { display: flex; align-items: center; gap: 4px; padding: 6px 12px; border: 1px solid var(--md-divider); border-radius: 999px; cursor: pointer; transition: all 0.2s; font-size: 13px; user-select: none; }
@@ -251,16 +254,62 @@
.feedback-status-closed { background: #ECEFF1; color: #546E7A; } .feedback-status-closed { background: #ECEFF1; color: #546E7A; }
@media (max-width: 768px) { @media (max-width: 768px) {
.sidebar { width: 100%; position: fixed; top: auto; bottom: 0; height: 60px; border-right: none; border-top: 1px solid var(--md-divider); display: flex; overflow-x: auto; } .header { padding: 0 12px; min-height: auto; }
.nav-item { flex-direction: column; padding: 8px 16px; border-left: none; border-top: 3px solid transparent; min-width: 80px; text-align: center; } .header-title { font-size: 16px; }
.header-actions { gap: 4px; }
.header-actions .btn { padding: 5px 10px; font-size: 12px; }
.user-info { font-size: 12px; }
.sidebar { width: 100%; position: fixed; top: auto; bottom: 0; height: 60px; border-right: none; border-top: 1px solid var(--md-divider); display: flex; overflow-x: auto; -webkit-overflow-scrolling: touch; }
.nav-item { flex-direction: column; padding: 8px 12px; border-left: none; border-top: 3px solid transparent; min-width: 70px; text-align: center; flex-shrink: 0; }
.nav-item.active { border-left-color: transparent; border-top-color: var(--md-primary); } .nav-item.active { border-left-color: transparent; border-top-color: var(--md-primary); }
.nav-label { font-size: 11px; } .nav-icon { font-size: 18px; }
.main-content { margin-left: 0; margin-bottom: 60px; max-width: 100%; } .nav-label { font-size: 10px; }
.accounts-grid { grid-template-columns: 1fr; }
.toolbar { flex-direction: column; align-items: stretch; } .main-content { margin-left: 0; margin-bottom: 60px; max-width: 100%; padding: 16px; }
.accounts-grid { grid-template-columns: 1fr; gap: 12px; }
.card { padding: 16px; margin-bottom: 16px; }
.card-header { flex-direction: column; align-items: flex-start; gap: 8px; }
.card-title { font-size: 16px; }
.stats-row { grid-template-columns: repeat(2, 1fr); gap: 12px; margin-bottom: 16px; }
.stat-card { padding: 12px; }
.stat-value { font-size: 24px; }
.stat-label { font-size: 11px; }
.toolbar { padding: 12px; gap: 12px; }
.toolbar-group { width: 100%; gap: 6px; }
.toolbar-group .select-inline { width: 100%; }
.toolbar-divider { display: none; } .toolbar-divider { display: none; }
.fab { bottom: 80px; }
.account-card-actions { padding: 12px; gap: 6px; }
.account-card-actions .select-inline { width: 100%; min-width: auto; }
.account-card-actions .btn-small { flex: 1; min-width: 60px; }
.schedule-card { padding: 12px; gap: 12px; }
.schedule-info { min-width: 100%; }
.schedule-actions { width: 100%; justify-content: flex-start; }
.modal { margin: 0; border-radius: 12px; }
.modal-header { padding: 16px; }
.modal-title { font-size: 16px; }
.modal-body { padding: 16px; }
.modal-footer { padding: 12px 16px; }
.fab { bottom: 80px; min-width: 120px; height: 48px; border-radius: 24px; font-size: 14px; }
.fab-icon { font-size: 20px; }
.fab-text { font-size: 14px; }
.preview-controls { bottom: 80px; } .preview-controls { bottom: 80px; }
.preview-close { top: 16px; right: 16px; width: 40px; height: 40px; font-size: 20px; }
.zoom-info { top: 16px; font-size: 12px; padding: 6px 12px; }
.upgrade-banner { padding: 12px 16px; flex-direction: column; gap: 12px; text-align: center; }
.upgrade-banner-text { font-size: 13px; }
.upgrade-banner-text strong { font-size: 14px; }
.form-input, .form-select { font-size: 16px; } /* 防止iOS自动缩放 */
} }
</style> </style>
</head> </head>

View File

@@ -139,6 +139,27 @@
.btn-secondary:hover { background: #EEEEEE; } .btn-secondary:hover { background: #EEEEEE; }
.btn-primary { padding: 12px 24px; background: var(--md-primary); color: var(--md-on-primary); border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; } .btn-primary { padding: 12px 24px; background: var(--md-primary); color: var(--md-on-primary); border: none; border-radius: 8px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-primary:hover { background: var(--md-primary-dark); } .btn-primary:hover { background: var(--md-primary-dark); }
@media (max-width: 480px) {
body { padding: 12px; }
.login-card { max-width: 100%; }
.login-header { padding: 24px 20px; }
.login-header .logo { font-size: 40px; margin-bottom: 10px; }
.login-header h1 { font-size: 20px; }
.login-header p { font-size: 13px; }
.login-body { padding: 24px 20px; }
.form-group { margin-bottom: 20px; }
.form-group label { font-size: 13px; }
.form-group input { padding: 12px 14px; font-size: 16px; } /* iOS防止自动缩放 */
.captcha-code { padding: 8px 12px; font-size: 18px; letter-spacing: 3px; }
.captcha-refresh { padding: 8px 12px; font-size: 16px; }
.btn-login { padding: 14px; font-size: 15px; }
.modal { max-width: 100%; }
.modal-header, .modal-body { padding: 20px; }
.modal-header h2 { font-size: 18px; }
.modal-footer { padding: 14px 20px; flex-direction: column; }
.modal-footer button { width: 100%; }
}
</style> </style>
</head> </head>
<body> <body>

View File

@@ -130,6 +130,19 @@
margin-bottom: 20px; margin-bottom: 20px;
display: none; display: none;
} }
@media (max-width: 480px) {
body { padding: 12px; align-items: flex-start; padding-top: 20px; }
.register-container { width: 100%; max-width: 100%; padding: 24px 20px; }
.register-header h1 { font-size: 24px; }
.register-header p { font-size: 13px; }
.form-group { margin-bottom: 18px; }
.form-group label { font-size: 13px; }
.form-group input { padding: 11px; font-size: 16px; } /* iOS防止自动缩放 */
.form-group small { font-size: 11px; }
.btn-register { padding: 13px; font-size: 15px; }
.login-link { margin-top: 16px; font-size: 14px; }
}
</style> </style>
</head> </head>
<body> <body>