/* Edge浏览器特殊修复 */

/* 动态视口高度支持 */
html {
    height: 100%;
}

body {
    height: 100%;
}

.main-container,
.welcome-screen,
#chatScreen,
.chat-list-page,
.chat-detail-page {
    height: 100%;
    height: 100dvh;
}

/* Safari特殊处理 */
@supports (-webkit-touch-callout: none) {
    html, body {
        height: -webkit-fill-available;
    }
    
    .main-container,
    .welcome-screen,
    .chat-list-page,
    .chat-detail-page {
        height: -webkit-fill-available;
    }
}

/* 确保底部操作区域在安全区域内 */
.bottom-actions {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

/* 输入区域安全区 */
.input-area {
    padding-bottom: calc(12px + env(safe-area-inset-bottom, 0px));
}

/* 检测Edge浏览器 */
@supports (-ms-ime-align: auto) {
    .messages-container {
        padding-bottom: 120px !important;
    }
    
    .bottom-actions {
        padding-bottom: calc(20px + env(safe-area-inset-bottom, 30px)) !important;
    }
}

/* 键盘弹出时的通用修复：仅手机端生效，避免桌面端缩放/低高度时误留底部空白 */
@media (max-width: 767px) and (max-height: 500px) {
    .messages-container {
        padding-bottom: 100px !important;
    }
}
