.chat-container { display: flex; flex-direction: column; height: calc(100vh - 60px); /* 减去header高度 */ background: #fcfcfd; /* 更浅的背景色,接近白色 */ } .chat-messages { flex: 1; overflow-y: auto; padding: 20px; display: flex; flex-direction: column; gap: 16px; scroll-behavior: smooth; background: #fcfcfd; /* 与容器背景保持一致 */ } .fill-button { padding: 4px 8px; margin-left: 8px; border-radius: 4px; border: 1px solid #ddd; background: #fff; cursor: pointer; } .fill-button:hover { background: #f5f5f5; } .message { display: flex; max-width: 85%; margin-bottom: 4px; width: 100%; } .message.user { justify-content: flex-end; margin-left: auto; } .message-content { position: relative; padding: 12px 16px; border-radius: 12px; background: #fff; box-shadow: 0 1px 2px rgba(0, 0, 0, 0.08); transition: all 0.3s ease; max-width: 100%; overflow-wrap: break-word; word-wrap: break-word; word-break: break-word; hyphens: auto; } .message.user .message-content { background: #e8f4ff; border-top-right-radius: 4px; } .message.assistant .message-content { background: #f0f4f8; border-top-left-radius: 4px; } .message p { margin: 0; line-height: 1.5; color: #333; } .chat-input-container { position: sticky !important; /* 确保固定在底部 */ bottom: 0 !important; padding: 16px !important; background: #fff !important; border-top: 1px solid #f0f0f0 !important; z-index: 1 !important; /* 确保在消息上方 */ } .input-wrapper { position: relative !important; display: flex !important; gap: 8px !important; background: #f0f4f8 !important; border-radius: 8px !important; padding: 8px 12px !important; transition: all 0.3s ease-out !important; min-height: 40px !important; /* 设置固定的最小高度 */ max-height: 120px !important; margin-top: 8px; } .input-wrapper:focus-within { box-shadow: 0 0 0 1px #1a73e8; background: #f0f4f8 !important; /* 保持背景色一致 */ } #chat-input { flex: 1 !important; border: none !important; background: transparent !important; resize: none !important; padding: 8px !important; font-size: 14px !important; line-height: 1.5 !important; min-height: 24px !important; /* 确保最小高度一致 */ max-height: 100px !important; outline: none !important; color: #333 !important; overflow-y: auto !important; box-sizing: border-box !important; /* 添加盒模型设置 */ } /* 确保输入框placeholder样式一致 */ #chat-input::placeholder { opacity: 1 !important; color: #999 !important; line-height: 24px !important; } /* 输入框禁用状态样式 */ #chat-input:disabled { cursor: not-allowed !important; color: #999 !important; background: #f5f5f5 !important; } .input-buttons { display: flex; align-items: center; gap: 8px; } .icon-button { position: relative; overflow: hidden; background: none; border: none; padding: 6px; cursor: pointer; color: #666; border-radius: 4px; transition: all 0.2s; } .icon-button::after { content: ""; position: absolute; top: 50%; left: 50%; width: 100%; height: 100%; background: currentColor; border-radius: 50%; transform: translate(-50%, -50%) scale(0); opacity: 0; transition: all 0.2s ease; } .icon-button:hover::after { transform: translate(-50%, -50%) scale(1.5); opacity: 0.1; } /* 工具栏 */ .toolbar { display: flex; align-items: center; justify-content: flex-end; /* 改为从右向左排列 */ background: #fff; border-radius: 8px; } .toolbar-left, .toolbar-right { display: flex; align-items: center; gap: 8px; flex-direction: row-reverse; /* 按钮从右向左排列 */ } /* 工具栏按钮 */ .toolbar-button { display: inline-flex; align-items: center; gap: 6px; padding: 8px 12px; /* 只保留左内边距 */ border: none; border-radius: 6px; background: #f5f7fa; color: #444; font-size: 13px; font-weight: 500; cursor: pointer; transition: all 0.2s ease; } .toolbar-button:hover { background: #edf2fc; color: #1a73e8; } .toolbar-button svg { width: 16px; height: 16px; } /* 快捷指令面板优化 */ .prompt-panel { position: absolute; bottom: 100%; left: 16px; right: 16px; margin-bottom: 8px; background: #fff; border-radius: 8px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); max-height: 400px; display: none; overflow: hidden; } .prompt-panel.show { display: flex; flex-direction: column; animation: slideUp 0.2s ease-out; } .prompt-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #eee; background: #f8f9fa; } .prompt-header h3 { margin: 0; font-size: 14px; color: #333; font-weight: 500; } .prompt-list { flex: 1; overflow-y: auto; padding: 8px; } .prompt-item { display: flex; align-items: center; width: 100%; padding: 10px 12px; text-align: left; background: none; border: none; border-radius: 6px; cursor: pointer; transition: all 0.2s; color: #333; font-size: 13px; line-height: 1.4; } .prompt-item:hover { background: #f0f4f8; } .prompt-item svg { width: 16px; height: 16px; margin-right: 8px; color: #666; } @keyframes slideUp { from { transform: translateY(20px); opacity: 0; } to { transform: translateY(0); opacity: 1; } } /* 滚动条样式 */ .chat-messages::-webkit-scrollbar { width: 6px; } .chat-messages::-webkit-scrollbar-track { background: transparent; } .chat-messages::-webkit-scrollbar-thumb { background: #ddd; border-radius: 3px; } .chat-messages::-webkit-scrollbar-thumb:hover { background: #ccc; } /* 打字动画相关样式 */ .message-content.typing { display: flex; flex-direction: column; } .message-content.typing p { display: inline; white-space: pre-wrap; word-break: break-word; } .message-content.typing p::after { content: "|"; display: inline; margin-left: 1px; font-weight: bold; animation: blink 1s infinite; vertical-align: baseline; } @keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: 0; } } /* 加载动画样式 */ .typing-indicator { display: flex; gap: 4px; padding: 4px 8px; } .typing-indicator span { width: 8px; height: 8px; background: #90a4ae; border-radius: 50%; animation: bounce 1.4s infinite ease-in-out; } .typing-indicator span:nth-child(1) { animation-delay: -0.32s; } .typing-indicator span:nth-child(2) { animation-delay: -0.16s; } @keyframes bounce { 0%, 80%, 100% { transform: scale(0); } 40% { transform: scale(1); } } /* 消息内容的过渡效果 */ .message-content { transition: opacity 0.3s ease; } .message-content.loading { min-width: 60px; min-height: 24px; } /* 消息时间戳样式 */ .message-timestamp { font-size: 12px; color: #999; line-height: 24px; /* 与按钮高度一致 */ margin: 0; /* 移除可能的外边距 */ padding: 0 2px; /* 添加少许水平内边距 */ } /* 消息hover效果 */ .message-content:hover { box-shadow: 0 2px 4px rgba(0, 0, 0, 0.15); } /* 添加头像占位 */ .message.assistant::before { content: ""; width: 32px; height: 32px; min-width: 32px; margin-right: 8px; border-radius: 50%; background: #fff url("../images/icon128.png") center/cover no-repeat; box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1); transition: all 0.3s ease; } /* 头像悬停效果 */ .message.assistant:hover::before { transform: scale(1.1); box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15); } /* 消息分组 */ .message + .message.assistant, .message + .message.user { margin-top: 2px; } .message:not(:first-child) { margin-top: 16px; } /* 添加新消息指示器 */ .new-messages-indicator { position: absolute; bottom: 80px; left: 50%; transform: translateX(-50%); background: rgba(33, 150, 243, 0.9); color: #fff; padding: 8px 16px; border-radius: 20px; font-size: 14px; cursor: pointer; opacity: 0; transition: all 0.3s ease; pointer-events: none; } .new-messages-indicator.show { opacity: 1; pointer-events: auto; } /* 消息格式化样式 */ .message-content p { margin: 0; line-height: 1.5; } .message-content pre { background: #f6f8fa; padding: 16px; border-radius: 6px; overflow-x: auto; margin: 8px 0; max-width: 100%; /* 限制最大宽度 */ white-space: pre-wrap; /* 允许代码块换行 */ } .message-content code { font-family: monospace; background: #f6f8fa; padding: 2px 4px; border-radius: 4px; font-size: 0.9em; } .message-content pre code { padding: 0; background: none; font-size: 0.9em; line-height: 1.5; white-space: pre-wrap; /* 允许代码换行 */ } .message-content a { color: #1a73e8; text-decoration: none; word-break: break-all; /* 确保长链接可以换行 */ } .message-content a:hover { text-decoration: underline; } .message-content strong { font-weight: 600; } .message-content em { font-style: italic; } /* 消息操作栏样式 */ .message-actions { display: flex; justify-content: flex-end; align-items: center; /* 确保垂直居中对齐 */ gap: 8px; margin-top: 4px; min-height: 24px; /* 设置最小高度确保一致性 */ } /* 复制按钮样式 */ .fill-button, .copy-button { display: flex; align-items: center; gap: 4px; height: 24px; /* 固定高度 */ padding: 0 6px; /* 调整水平内边距 */ font-size: 12px; color: #666; background: none; border: none; border-radius: 4px; cursor: pointer; transition: all 0.2s ease; } .fill-button:hover, .copy-button:hover { background: rgba(0, 0, 0, 0.05); color: #1a73e8; } .fill-button svg, .copy-button svg { width: 14px; height: 14px; } /* 复制成功提示 */ .copy-button.copied { color: #00c853; pointer-events: none; } /* Markdown样式 */ .message-content h1, .message-content h2, .message-content h3, .message-content h4, .message-content h5, .message-content h6 { margin: 16px 0 8px; font-weight: 600; line-height: 1.25; color: #333; } .message-content h1 { font-size: 1.5em; } .message-content h2 { font-size: 1.3em; } .message-content h3 { font-size: 1.2em; } .message-content h4 { font-size: 1.1em; } .message-content h5 { font-size: 1em; } .message-content h6 { font-size: 0.9em; } .message-content ul, .message-content ol { margin: 8px 0; padding-left: 20px; } .message-content li { margin: 4px 0; } .message-content blockquote { margin: 8px 0; padding: 8px 16px; border-left: 4px solid #ddd; background: rgba(0, 0, 0, 0.02); color: #666; } .message-content hr { margin: 16px 0; border: none; border-top: 1px solid #eee; } /* 调整代码块样式 */ .message-content pre { background: #f6f8fa; padding: 16px; border-radius: 6px; overflow-x: auto; margin: 8px 0; max-width: 100%; /* 限制最大宽度 */ white-space: pre-wrap; /* 允许代码块换行 */ } .message-content pre code { padding: 0; background: none; font-size: 0.9em; line-height: 1.5; white-space: pre-wrap; /* 允许代码换行 */ } /* 打断按钮样式 */ .stop-button { display: none; /* 默认隐藏 */ padding: 6px 12px; color: #666; background: none; border: 1px solid #ddd; border-radius: 4px; cursor: pointer; font-size: 12px; transition: all 0.2s ease; } .stop-button.show { display: flex; align-items: center; gap: 4px; } .stop-button:hover { color: #d32f2f; border-color: #d32f2f; background: rgba(211, 47, 47, 0.05); } .stop-button svg { width: 14px; height: 14px; } /* 中断消息样式 */ .message.assistant .message-content.interrupted { background: #fff1f0; border-left: 4px solid #ff4d4f; border-top-left-radius: 0; padding-left: 12px; color: #cf1322; } .message-content.interrupted .message-timestamp { color: rgba(207, 19, 34, 0.6); } .input-wrapper.generating { background: #f5f5f5; } /* 修改:只禁用输入框和其他按钮 */ .input-wrapper.generating #chat-input, .input-wrapper.generating .icon-button { pointer-events: none; opacity: 0.5; /* 添加透明度表示禁用状态 */ } .input-wrapper.generating #chat-input::placeholder { color: #999; opacity: 0.8; } /* 确保只有停止按钮可以点击 */ .input-wrapper.generating .stop-button { pointer-events: auto; opacity: 1; /* 保持完全不透明 */ cursor: pointer; } /* 页面信息卡片 */ .page-info-card { display: flex; align-items: center; gap: 12px; padding: 12px 16px; margin: 0 16px 8px; /* 保持底部间距为8px */ background: #fff; border-radius: 8px; box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1); } /* 网站图标 */ .page-favicon { width: 16px; height: 16px; flex-shrink: 0; } /* 页面标题容器 */ .page-title-container { flex: 1; position: relative; overflow: hidden; white-space: nowrap; scrollbar-width: none; -ms-overflow-style: none; } /* 隐藏滚动条但保持可滚动 */ .page-title-container::-webkit-scrollbar { display: none; } /* 页面标题 */ .page-title { font-size: 14px; color: #333; margin: 0; display: inline-block; position: relative; /* 添加相对定位 */ padding-right: 20px; /* 移除这些可能导致标题消失的样式 */ /* padding-left: 100%; */ /* transform: translateX(-100%); */ } /* 当容器被hover时启动滚动动画 */ .page-title-container:hover .page-title { animation: scrollText 20s linear infinite; /* 增加动画时间到20秒 */ } /* 修改滚动动画逻辑 */ @keyframes scrollText { from { transform: translateX(0); } to { transform: translateX(-100%); } } /* 优化渐变遮罩 */ .page-title-container::after { content: ""; position: absolute; top: 0; right: 0; width: 30px; /* 减小遮罩宽度 */ height: 100%; background: linear-gradient( to right, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8) ); /* 降低不透明度 */ pointer-events: none; } /* 添加左侧渐变遮罩 */ .page-title-container::before { content: ""; position: absolute; top: 0; left: 0; width: 30px; /* 减小遮罩宽度 */ height: 100%; background: linear-gradient( to left, rgba(255, 255, 255, 0), rgba(255, 255, 255, 0.8) ); /* 降低不透明度 */ pointer-events: none; z-index: 1; } /* 滚动时显示左侧遮罩 */ .page-title-container:hover::before { opacity: 1; } /* 总结按钮 */ .summarize-button { position: relative; /* 添加相对定位 */ padding: 6px 12px; color: #1a73e8; background: #e8f0fe; border: none; border-radius: 4px; font-size: 13px; cursor: pointer; transition: all 0.2s ease; flex-shrink: 0; overflow: hidden; /* 确保星星不会溢出按钮区域 */ } /* 星星元素 */ .summarize-button::after { content: "✦"; position: absolute; top: 0; right: 2px; font-size: 10px; opacity: 0; transform: translateY(10px); transition: all 0.3s ease; } /* 鼠标悬停时的动画效果 */ .summarize-button:hover { background: #d2e3fc; transform: translateY(-1px); } .summarize-button:hover::after { opacity: 1; transform: translateY(0); animation: twinkle 1s infinite; } /* 点击效果 */ .summarize-button:active { transform: translateY(0); } /* 星星闪烁动画 */ @keyframes twinkle { 0% { opacity: 1; transform: scale(1) rotate(0deg); } 50% { opacity: 0.5; transform: scale(1.2) rotate(180deg); } 100% { opacity: 1; transform: scale(1) rotate(360deg); } } /* 输入框过渡动画 */ .input-transition { transition: height 0.3s ease-out !important; will-change: height !important; } #chat-input { flex: 1 !important; border: none !important; background: transparent !important; resize: none !important; padding: 8px !important; font-size: 14px !important; line-height: 1.5 !important; min-height: 24px !important; max-height: 100px !important; outline: none !important; color: #333 !important; overflow-y: auto !important; box-sizing: border-box !important; /* 添加盒模型设置 */ } /* 快捷指令面板头部 */ .prompt-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #eee; background: #f8f9fa; } /* 关闭按钮样式优化 */ .close-prompt { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: none; border-radius: 4px; background: transparent; color: #666; font-size: 18px; cursor: pointer; transition: all 0.2s ease; } .close-prompt:hover { background: rgba(0, 0, 0, 0.05); color: #333; } /* 使用SVG图标替代文字 */ .close-prompt svg { width: 16px; height: 16px; } /* 工具箱面板 */ .tools-panel { position: absolute; bottom: 100%; left: 16px; right: 16px; margin-bottom: 8px; background: #fff; border-radius: 8px; box-shadow: 0 4px 20px rgba(0, 0, 0, 0.15); max-height: 500px; display: none; overflow: hidden; } .tools-panel.show { display: flex; flex-direction: column; animation: slideUp 0.2s ease-out; } .tools-header { display: flex; justify-content: space-between; align-items: center; padding: 12px 16px; border-bottom: 1px solid #eee; background: #f8f9fa; } .tools-header h3 { margin: 0; font-size: 14px; color: #333; font-weight: 500; } .tools-content { flex: 1; overflow-y: auto; padding: 16px; } .tools-section { margin-bottom: 20px; } .tools-section:last-child { margin-bottom: 0; } .tools-section h4 { margin: 0 0 12px; font-size: 13px; color: #666; font-weight: 500; } .tools-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(120px, 1fr)); gap: 8px; } .tool-item { display: flex; flex-direction: column; align-items: center; gap: 6px; padding: 12px; border: none; border-radius: 6px; background: #f5f7fa; color: #444; font-size: 12px; cursor: pointer; transition: all 0.2s ease; } .tool-item:hover { background: #edf2fc; color: #1a73e8; } .tool-item svg { width: 20px; height: 20px; } .close-tools { display: flex; align-items: center; justify-content: center; width: 24px; height: 24px; padding: 0; border: none; border-radius: 4px; background: transparent; color: #666; cursor: pointer; transition: all 0.2s ease; } .close-tools:hover { background: rgba(0, 0, 0, 0.05); color: #333; } .close-tools svg { width: 16px; height: 16px; } /* 文件上传按钮样式 */ #upload-button { position: relative; overflow: hidden; background: none; border: none; padding: 6px; cursor: pointer; color: #666; border-radius: 4px; transition: all 0.2s; } #upload-button:hover { color: #1a73e8; background: rgba(26, 115, 232, 0.08); } #upload-button svg { width: 20px; height: 20px; } /* 文件上传按钮点击效果 */ #upload-button:active { transform: scale(0.95); } /* 停止生成按钮 */ .stop-button { display: none; color: #d32f2f; } .stop-button.show { display: inline-flex; } .stop-button:hover { background-color: rgba(211, 47, 47, 0.08); }