/* 全局样式 */ * { margin: 0; padding: 0; box-sizing: border-box; } body { font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif; background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); min-height: 100vh; } @keyframes fadeIn { from { opacity: 0; transform: translateY(10px); } to { opacity: 1; transform: translateY(0); } } @keyframes typing { 0%, 60%, 100% { transform: translateY(0); } 30% { transform: translateY(-10px); } } @keyframes pulse { 0% { opacity: 1; } 50% { opacity: 0.5; } 100% { opacity: 1; } } ::-webkit-scrollbar { width: 6px; } ::-webkit-scrollbar-track { background: #f1f1f1; border-radius: 3px; } ::-webkit-scrollbar-thumb { background: #c1c1c1; border-radius: 3px; } ::-webkit-scrollbar-thumb:hover { background: #a1a1a1; } /* 容器样式 */ .ai-chat-container { width: 100%; height: 92vh; background: white; // border-radius: 20px; box-shadow: 0 20px 60px rgba(0,0,0,0.15); display: flex; flex-direction: column; overflow: hidden; margin: 0 auto; position: relative; } /* 头部样式 */ .chat-header { background: linear-gradient(90deg, #2c3e50, #4a6491); color: white; padding: 20px; display: flex; justify-content: space-between; align-items: center; flex-shrink: 0; height: 120px; position: fixed; top: 39px; z-index: 200; width: 100%; } .header-left h1 { font-size: 18px; font-weight: 600; margin-bottom: 5px; color: #fff; } .header-left p { opacity: 0.8; font-size: 14px; } .header-right { display: flex; gap: 15px; width: 40%; flex-wrap: wrap; } .model-Button { position: fixed; right: 10px; top: 50px; z-index: 200; } .model-selector { background: rgba(255,255,255,0.1); border: 1px solid rgba(255,255,255,0.2); color: white; padding: 8px 8px; border-radius: 20px; font-size: 14px; outline: none; cursor: pointer; transition: all 0.3s; width: 100%; margin: 0 auto; } .model-selectors{ width: 80%; } .model-selectors:hover .model-selector:hover { background: rgba(255,255,255,0.2); } .model-selectors option , .model-selector option { background: #2c3e50; color: white; } /* 主体布局 */ .chat-body { display: flex; flex: 1; overflow: hidden; min-height: 0; margin-top: 100px; } .chat-main { flex: 1; display: flex; flex-direction: column; min-height: 0; } /* 消息区域 */ .messages-container { flex: 1; overflow-y: auto; padding: 40px 20px; background: white; } .message { margin-bottom: 20px; max-width: 80%; animation: fadeIn 0.3s ease; } .user-message { margin-left: auto; } .ai-message { margin-right: auto; } .message-bubble { padding: 15px 20px; border-radius: 20px; position: relative; word-wrap: break-word; line-height: 1.6; } .user-bubble { background: linear-gradient(90deg, #667eea, #764ba2); color: white; border-bottom-right-radius: 5px; } .ai-bubble { background: #f8f9fa; color: #333; border: 1px solid #e9ecef; border-bottom-left-radius: 5px; } .message-content { font-size: 15px; } /* Markdown 样式 */ .inline-code { background: #e9ecef; padding: 2px 6px; border-radius: 4px; font-family: 'Courier New', monospace; font-size: 14px; } .code-block { background: #f1f3f5; padding: 10px; border-radius: 8px; overflow-x: auto; margin: 10px 0; border: 1px solid #dee2e6; } .code-block code { font-family: 'Courier New', monospace; font-size: 14px; } /* 消息元信息 */ .message-meta { display: flex; justify-content: space-between; align-items: center; margin-top: 8px; font-size: 12px; } .message-time { color: #6c757d; } .message-actions { display: flex; gap: 8px; } .action-btn { background: none; border: none; color: #6c757d; cursor: pointer; font-size: 12px; padding: 2px 5px; border-radius: 3px; transition: all 0.2s; } .action-btn:hover { background: #e9ecef; color: #495057; } /* 打字机效果 */ .typing-indicator { display: flex; align-items: center; padding: 10px 20px; background: #f8f9fa; border-radius: 20px; width: fit-content; border: 1px solid #e9ecef; margin-bottom: 20px; } .typing-dot { width: 8px; height: 8px; background: #667eea; border-radius: 50%; margin: 0 2px; animation: typing 1.4s infinite; } .typing-text { margin-left: 10px; color: #666; font-size: 14px; } /* 输入区域 */ .input-section { border-top: 1px solid #e9ecef; background: white; flex-shrink: 0; padding: 20px; position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); z-index: 200; width: 100%; } .input-wrapper { display: flex; gap: 10px; position: relative; align-items: center; } .input-icon{ font-size: 30px; } .message-input { padding: 15px 20px; border: 2px solid #e9ecef; border-radius: 25px; font-size: 16px; outline: none; transition: border-color 0.3s; width: 80%; } .message-input:focus { border-color: #667eea; } .send-button { padding: 15px 30px; background: linear-gradient(90deg, #667eea, #764ba2); color: white; border: none; border-radius: 25px; font-size: 16px; font-weight: 600; cursor: pointer; transition: all 0.2s; white-space: nowrap; } .send-button:hover { transform: translateY(-2px); box-shadow: 0 5px 15px rgba(102, 126, 234, 0.4); } .send-button.disabled { opacity: 0.5; cursor: not-allowed; transform: none; box-shadow: none; } .bottom-spacer { height: 20px; flex-shrink: 0; } .message-icon{ position: absolute; left: 58%; top: 50%; transform: translateY(-50%); font-size: 26px; } .voice-button { display: flex; flex-direction: column; align-items: center; justify-content: center; padding: 8px 16px; background: #f5f7fa; border: 2px solid #e9ecef; border-radius: 25px; cursor: pointer; transition: all 0.3s; min-width: 60px; user-select: none; -webkit-user-select: none; touch-action: manipulation; &:hover { background: #e9ecef; border-color: #667eea; } &:active, &.recording { background: #ff4d4f; border-color: #ff4d4f; color: white; transform: scale(0.95); } &.active { background: #667eea; border-color: #667eea; color: white; } .message-icon { font-size: 24px; margin-bottom: 2px; } .voice-hint { font-size: 12px; white-space: nowrap; } } // 语音模式指示器 .voice-mode-indicator { display: flex; align-items: center; justify-content: center; gap: 12px; padding: 12px 20px; background: linear-gradient(90deg, #667eea, #764ba2); border-radius: 25px; margin-bottom: 10px; color: white; .voice-wave { display: flex; align-items: center; gap: 3px; height: 20px; span { display: block; width: 3px; height: 100%; background: white; border-radius: 2px; animation: wave 1s ease-in-out infinite; &:nth-child(1) { animation-delay: 0s; } &:nth-child(2) { animation-delay: 0.1s; } &:nth-child(3) { animation-delay: 0.2s; } &:nth-child(4) { animation-delay: 0.3s; } &:nth-child(5) { animation-delay: 0.4s; } } } .voice-text { font-size: 14px; font-weight: 500; } .voice-cancel-btn { padding: 4px 12px; background: rgba(255,255,255,0.2); border: 1px solid rgba(255,255,255,0.3); border-radius: 12px; color: white; font-size: 12px; cursor: pointer; transition: all 0.2s; &:hover { background: rgba(255,255,255,0.3); } } } @keyframes wave { 0%, 100% { height: 20%; } 50% { height: 100%; } } .phone-model{ position: fixed; top: 0; left: 0; right: 0; z-index: 201; width: 100%; height: 100%; .phone-zhezhao{ position: absolute; top: 0; left: 0; right: 0; z-index: 200; width: 100%; height: 100%; background-color: #fff; } .phone-phone{ position: absolute; bottom: 40px; left: 50%; transform: translateX(-50%); font-size: 50px; z-index: 210; } .phone-content{ position: absolute; width: 90%; height: 70%; background-color: #f3f3f3; z-index: 210; left: 50%; top: 2%; transform: translateX(-50%); padding: 10px; overflow-y: auto; } }