// 主容器 .chat-container { height: 100vh; display: flex; flex-direction: column; background: linear-gradient(180deg, #E8F4FD 0%, #F5FAFF 25%, #FAFCFE 50%, #FFFFFF 100%); position: relative; // 多种安全区域适配方式 padding-top: env(safe-area-inset-top); padding-top: constant(safe-area-inset-top); /* 兼容iOS < 11.2 */ box-sizing: border-box; } // 顶部标题栏 .header { position: fixed; top: 0; left: 0; right: 0; display: flex; flex-direction: row; align-items: center; padding: 0 16px; z-index: 100; box-sizing: border-box; // 小程序需要为右侧胶囊按钮留出空间 /* #ifdef MP-WEIXIN */ padding-right: 100px; /* #endif */ } .title { font-size: 20px; font-weight: bold; color: #000000; line-height: 1; flex-shrink: 0; } .header-right { flex: 1; display: flex; flex-direction: row; align-items: center; justify-content: flex-end; gap: 6px; } .workcase-btn { display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 4px; padding: 4px 10px; height: 28px; background: rgba(255, 255, 255, 0.8); border: none; border-radius: 14px; box-sizing: border-box; white-space: nowrap; flex-shrink: 0; margin: 0; line-height: 1; } .workcase-btn::after { border: none; } .btn-icon { width: 16px; height: 16px; } .btn-text { color: #333333; font-size: 12px; font-weight: 500; } // 欢迎区域(机器人+浮动标签) .hero { position: relative; height: 280px; display: flex; align-items: center; justify-content: center; margin-top: 80px; } .rings { position: absolute; width: 100%; height: 100%; } .ring { position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%); border-radius: 50%; border: 1px solid rgba(100, 180, 255, 0.15); } .r1 { width: 260px; height: 260px; } .r2 { width: 200px; height: 200px; border-color: rgba(100, 180, 255, 0.2); } .r3 { width: 150px; height: 150px; border-color: rgba(100, 180, 255, 0.25); } .r4 { width: 110px; height: 110px; border-color: rgba(100, 180, 255, 0.35); } .robot { position: relative; z-index: 2; } .robot-face { width: 100px; height: 100px; background: linear-gradient(145deg, #e8f7ff 0%, #c5e4ff 100%); border-radius: 50%; display: flex; flex-direction: row; align-items: center; justify-content: center; gap: 16px; box-shadow: 0 10px 40px rgba(180, 220, 255, 0.5), inset 0 0 20px rgba(255, 255, 255, 0.8); } .eye { width: 14px; height: 24px; background: linear-gradient(180deg, #7ec1ff 0%, #1846ff 100%); border-radius: 10px; } .float-tag { position: absolute; padding: 6px 12px; background: rgba(255, 255, 255, 0.8); border: 1px solid rgba(200, 220, 255, 0.5); border-radius: 16px; font-size: 12px; color: #666; } .t1 { right: 20px; top: 40px; } .t2 { left: 20px; top: 80px; } .t3 { right: 30px; bottom: 50px; } .greeting { text-align: left; padding: 0 30px; margin-top: 24px; } .greeting-title { display: block; font-size: 24px; font-weight: 800; color: #1d72d3; margin-bottom: 10px; } .greeting-sub { font-size: 15px; color: #a2a9b7; } // AI初始消息 .ai-initial-msg { background: #fff; padding: 12px 16px; border-radius: 12px; margin: 16px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.05); } .ai-msg-text { font-size: 14px; color: #333; line-height: 1.5; } // 聊天消息区域 .chat-messages { flex: 1; // background: rgba(255, 255, 255, 0.6); backdrop-filter: blur(10px); padding: 20px 16px; padding-bottom: 120px; position: relative; // 为固定定位的header留出空间 margin-top: 76px; // 默认header高度 } // 欢迎界面 .welcome-container { display: flex; flex-direction: column; align-items: center; justify-content: center; height: 400px; text-align: center; padding: 40px 20px; } .welcome-image { width: 90%; // 增大图片尺寸以适应PNG图标+文字气泡 margin-bottom: 32px; } .welcome-text-primary { font-size: 22px; // 增大主标题字体 font-weight: 600; color: #1A1A1A; // 更深的文字颜色 margin-bottom: 12px; line-height: 1.3; } .welcome-text-secondary { font-size: 16px; // 增大副标题字体 color: #4A4A4A; // 调整副标题颜色 line-height: 1.4; } // 消息列表 .messages-list { padding: 16px 0; } .message-item { margin-bottom: 20px; display: flex; flex-direction: column; } .user-message-content { display: flex; flex-direction: row; align-items: flex-start; justify-content: flex-end; gap: 8px; } .bot-message-content { display: flex; flex-direction: row; align-items: flex-start; gap: 8px; } .avatar { width: 40px; height: 40px; border-radius: 20px; display: flex; align-items: center; justify-content: center; flex-shrink: 0; } .user-avatar { background: #5B8FF9; } .bot-avatar { background: #FF6B6B; } .avatar-text { font-size: 14px; font-weight: 500; color: #FFFFFF; } .message-bubble { max-width: 240px; padding: 10px 14px; border-radius: 12px; position: relative; } .user-bubble { background: #5B8FF9; border-radius: 12px; } .bot-bubble { background: #FFFFFF; border: 1px solid #E5E5E5; border-radius: 12px; } .user-bubble .message-text { color: #FFFFFF; } .bot-bubble .message-text { color: #333333; } .message-text { font-size: 14px; line-height: 1.5; word-wrap: break-word; } .message-time { font-size: 11px; color: #999999; margin-top: 4px; } .user-message .message-time { text-align: right; padding-right: 48px; } .bot-message .message-time { text-align: left; padding-left: 48px; } // 底部操作区域 .bottom-area { position: fixed; bottom: 0; left: 0; right: 0; // background: rgba(240, 241, 246, 0.95); padding: 12px 16px; padding-bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 50; } // 快捷按钮横向滚动 .quick-scroll { white-space: nowrap; margin-bottom: 12px; } .quick-list { display: inline-flex; flex-direction: row; align-items: center; gap: 8px; } .quick-btn { margin: 0; position: relative; box-sizing: border-box; flex-shrink: 0; flex-grow: 0; flex-basis: auto; align-content: stretch; min-height: 0px; min-width: 0px; overflow: hidden; align-items: center; justify-content: center; background: #fff; border-radius: 24px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.06); border: none; display: flex; flex-direction: row; padding: 10px 24px; color: black; } .quick-btn.has-icon { // background: linear-gradient(90deg, #173294 0%, #4a6fd9 100%); border: none; padding: 10px 24px; } .quick-btn.has-icon .quick-text { // color: #fff; font-weight: 500; } .quick-icon { font-size: 14px; margin-right: 6px; color: #333; } .quick-divider { width: 1px; height: 20px; background: #d0d5dd; margin: 0 4px; } .quick-text { font-size: 13px; color: #333; white-space: nowrap; } // 输入区域 .chat-input-wrap { position: relative; display: flex; flex-direction: row; align-items: center; background: #fff; border-radius: 24px; padding: 4px; box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04); } .chat-input { flex: 1; height: 40px; padding: 0 16px; background: transparent; border: none; font-size: 14px; color: #333; } .chat-input::placeholder { color: #999; } .send-btn { width: 40px; height: 40px; border-radius: 20px; background: linear-gradient(135deg, #e9f1ff 0%, #d4e4ff 100%); border: 1px solid #8dbbff; display: flex; align-items: center; justify-content: center; flex-shrink: 0; } .send-icon { font-size: 18px; color: #4b87ff; }