|
|
@@ -14,12 +14,21 @@
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/* 移动端视口高度 - 解决浏览器地址栏遮挡问题 */
|
|
|
+@supports (height: 100dvh) {
|
|
|
+ .h-screen-mobile {
|
|
|
+ height: 100dvh;
|
|
|
+ }
|
|
|
+}
|
|
|
+
|
|
|
body {
|
|
|
color: var(--foreground);
|
|
|
background: var(--background);
|
|
|
font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
|
|
|
-webkit-font-smoothing: antialiased;
|
|
|
-moz-osx-font-smoothing: grayscale;
|
|
|
+ /* 防止 iOS Safari 中 body 弹性滚动 */
|
|
|
+ overscroll-behavior: none;
|
|
|
}
|
|
|
|
|
|
/* 移动端优化 */
|
|
|
@@ -28,6 +37,11 @@ body {
|
|
|
font-size: 16px;
|
|
|
line-height: 1.5;
|
|
|
}
|
|
|
+
|
|
|
+ /* 防止触摸时的高亮 */
|
|
|
+ * {
|
|
|
+ -webkit-tap-highlight-color: transparent;
|
|
|
+ }
|
|
|
}
|
|
|
|
|
|
@layer utilities {
|
|
|
@@ -82,10 +96,6 @@ body {
|
|
|
|
|
|
/* 移动端滚动条优化 */
|
|
|
@media (max-width: 768px) {
|
|
|
- * {
|
|
|
- -webkit-tap-highlight-color: transparent;
|
|
|
- }
|
|
|
-
|
|
|
/* 自定义滚动条 */
|
|
|
::-webkit-scrollbar {
|
|
|
width: 4px;
|
|
|
@@ -106,25 +116,60 @@ body {
|
|
|
}
|
|
|
}
|
|
|
|
|
|
-/* 触摸友好的按钮 */
|
|
|
+/* 安全区域支持 */
|
|
|
+.safe-area-inset-bottom {
|
|
|
+ padding-bottom: env(safe-area-inset-bottom, 0);
|
|
|
+}
|
|
|
+
|
|
|
+.safe-area-inset-top {
|
|
|
+ padding-top: env(safe-area-inset-top, 0);
|
|
|
+}
|
|
|
+
|
|
|
+/* 固定底部输入框 - 解决浏览器地址栏遮挡 */
|
|
|
@media (max-width: 768px) {
|
|
|
+ /* 触摸友好的按钮 */
|
|
|
button, .btn {
|
|
|
min-height: 44px;
|
|
|
min-width: 44px;
|
|
|
}
|
|
|
|
|
|
- /* 安全区域支持 - iPhone 刘海屏 */
|
|
|
- .safe-area-inset-bottom {
|
|
|
- padding-bottom: calc(env(safe-area-inset-bottom, 0) + 0.5rem);
|
|
|
+ /* 输入框区域固定在视口底部 */
|
|
|
+ .fixed-bottom-input {
|
|
|
+ position: fixed;
|
|
|
+ bottom: 0;
|
|
|
+ left: 0;
|
|
|
+ right: 0;
|
|
|
+ z-index: 50;
|
|
|
+ background: white;
|
|
|
+ padding-bottom: max(env(safe-area-inset-bottom, 0), 8px);
|
|
|
}
|
|
|
|
|
|
- .safe-area-inset-top {
|
|
|
- padding-top: calc(env(safe-area-inset-top, 0) + 0.5rem);
|
|
|
+ .dark .fixed-bottom-input {
|
|
|
+ background: #1f2937; /* gray-800 */
|
|
|
}
|
|
|
|
|
|
- /* 固定底部输入框安全区域 */
|
|
|
+ /* 为消息列表添加底部 padding,避免被输入框遮挡 */
|
|
|
+ .messages-with-fixed-input {
|
|
|
+ padding-bottom: 80px; /* 大约输入框高度 */
|
|
|
+ }
|
|
|
+
|
|
|
+ /* pb-safe 类:底部安全区域 + 额外间距 */
|
|
|
.pb-safe {
|
|
|
- padding-bottom: calc(env(safe-area-inset-bottom, 0) + 0.75rem);
|
|
|
+ padding-bottom: max(env(safe-area-inset-bottom, 0), 12px);
|
|
|
}
|
|
|
}
|
|
|
|
|
|
+/* 桌面端保持原有样式 */
|
|
|
+@media (min-width: 769px) {
|
|
|
+ .fixed-bottom-input {
|
|
|
+ position: relative;
|
|
|
+ }
|
|
|
+
|
|
|
+ .messages-with-fixed-input {
|
|
|
+ padding-bottom: 1rem;
|
|
|
+ }
|
|
|
+
|
|
|
+ .pb-safe {
|
|
|
+ padding-bottom: 1rem;
|
|
|
+ }
|
|
|
+}
|