fix: 修复移动端主题切换问题 📱

- 添加 z-index: 100 确保按钮在最上层
- 增加 touchstart/touchend 事件支持
- 添加 touch-action 优化触摸操作
- 增加 -webkit-tap-highlight 去除高亮
- 添加防抖机制避免重复触发
- 支持键盘操作(无障碍)
This commit is contained in:
root
2026-03-11 21:51:31 +08:00
parent 00a33bc424
commit f55891f1cd
2 changed files with 56 additions and 4 deletions

View File

@@ -203,6 +203,12 @@ h1 {
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
z-index: 100;
/* 移动端触摸优化 */
touch-action: manipulation;
-webkit-tap-highlight-color: transparent;
-webkit-touch-callout: none;
user-select: none;
}
.theme-toggle:hover {
@@ -210,6 +216,10 @@ h1 {
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.3);
}
.theme-toggle:active {
transform: scale(0.95);
}
/* 表单样式 */
.auth-container {
max-width: 400px;