|
|
@@ -163,11 +163,11 @@ watch(
|
|
|
</transition>
|
|
|
|
|
|
<!-- 聊天主区域 -->
|
|
|
- <div class="flex justify-center px-4 py-6 h-full">
|
|
|
- <div class="w-full max-w-4xl flex flex-col h-full">
|
|
|
+ <div class="flex justify-center px-2 sm:px-4 py-3 sm:py-6 h-full">
|
|
|
+ <div class="w-full max-w-2xl sm:max-w-4xl flex flex-col h-full">
|
|
|
|
|
|
<!-- 聊天消息容器 -->
|
|
|
- <div id="chat-container" class="flex-1 overflow-y-auto space-y-4 mb-4 px-4 py-4 rounded-lg shadow-lg">
|
|
|
+ <div id="chat-container" class="flex-1 overflow-y-auto space-y-2 sm:space-y-4 mb-4 px-2 sm:px-4 py-2 sm:py-4 rounded-lg shadow-lg">
|
|
|
<!-- 没有对话内容显示的内容 -->
|
|
|
<div v-if="chatStore.messages.length === 0" class="flex flex-col items-center justify-center h-full text-gray-400">
|
|
|
<div class="text-6xl mb-4">💬</div>
|
|
|
@@ -183,8 +183,8 @@ watch(
|
|
|
:class="msg.role === 'user' ? 'justify-end' : 'justify-start'"
|
|
|
>
|
|
|
<!-- AI 图标 -->
|
|
|
- <div v-if="msg.role !== 'user'" class="flex-shrink-0 mr-3 mt-1">
|
|
|
- <div class="w-8 h-8 bg-blue-600 rounded-full flex items-center justify-center text-sm font-semibold">
|
|
|
+ <div v-if="msg.role !== 'user'" class="flex-shrink-0 mr-2 sm:mr-3 mt-1">
|
|
|
+ <div class="w-6 h-6 sm:w-8 sm:h-8 bg-blue-600 rounded-full flex items-center justify-center text-xs sm:text-sm font-semibold">
|
|
|
AI
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -192,13 +192,13 @@ watch(
|
|
|
<!-- 用户消息气泡 -->
|
|
|
<div
|
|
|
v-if="msg.role === 'user'"
|
|
|
- class="max-w-2xl px-4 py-3 rounded-lg shadow-sm prose prose-invert max-w-none relative bg-blue-600 text-white rounded-br-sm prose-headings:text-white prose-p:text-white prose-strong:text-white prose-em:text-white"
|
|
|
+ class="max-w-xs sm:max-w-sm md:max-w-2xl px-3 sm:px-4 py-2 sm:py-3 rounded-lg shadow-sm prose prose-invert max-w-none relative bg-blue-600 text-white rounded-br-sm prose-headings:text-white prose-p:text-white prose-strong:text-white prose-em:text-white text-sm sm:text-base"
|
|
|
>
|
|
|
<div v-html="formatMessage(msg.displayContent || msg.content, msg.role)"></div>
|
|
|
</div>
|
|
|
|
|
|
<!-- AI 消息:三阶段分块 -->
|
|
|
- <div v-else class="flex flex-col gap-2 min-w-0" style="max-width: 42rem">
|
|
|
+ <div v-else class="flex flex-col gap-2 min-w-0" style="max-width: min(100%, 42rem)">
|
|
|
|
|
|
<!-- ① 思考块(紫色,可折叠) -->
|
|
|
<div v-if="msg.thinkingContent" class="rounded-lg border border-purple-700/40 bg-purple-950/50 overflow-hidden">
|
|
|
@@ -253,7 +253,7 @@ watch(
|
|
|
<!-- ③ 正式回答(灰色气泡) -->
|
|
|
<div
|
|
|
v-if="msg.displayContent"
|
|
|
- class="px-4 py-3 rounded-lg shadow-sm prose prose-invert max-w-none relative bg-gray-700 text-white rounded-bl-sm prose-headings:text-gray-100 prose-p:text-gray-100 prose-strong:text-gray-100 prose-em:text-gray-100 prose-code:text-blue-300 prose-code:bg-gray-800 prose-pre:bg-gray-800 prose-blockquote:border-blue-500"
|
|
|
+ class="px-3 sm:px-4 py-2 sm:py-3 rounded-lg shadow-sm prose prose-invert max-w-none relative bg-gray-700 text-white rounded-bl-sm prose-headings:text-gray-100 prose-p:text-gray-100 prose-strong:text-gray-100 prose-em:text-gray-100 prose-code:text-blue-300 prose-code:bg-gray-800 prose-pre:bg-gray-800 prose-blockquote:border-blue-500 text-sm sm:text-base"
|
|
|
>
|
|
|
<div v-html="formatMessage(msg.displayContent, msg.role)"></div>
|
|
|
<span v-if="msg.isStreaming && msg.phase === 'answer'" class="typing-cursor"></span>
|
|
|
@@ -261,8 +261,8 @@ watch(
|
|
|
</div>
|
|
|
|
|
|
<!-- 用户图标 -->
|
|
|
- <div v-if="msg.role === 'user'" class="flex-shrink-0 ml-3">
|
|
|
- <div class="w-8 h-8 bg-gray-600 rounded-full flex items-center justify-center text-sm font-semibold">
|
|
|
+ <div v-if="msg.role === 'user'" class="flex-shrink-0 ml-2 sm:ml-3">
|
|
|
+ <div class="w-6 h-6 sm:w-8 sm:h-8 bg-gray-600 rounded-full flex items-center justify-center text-xs sm:text-sm font-semibold">
|
|
|
我
|
|
|
</div>
|
|
|
</div>
|
|
|
@@ -271,12 +271,12 @@ watch(
|
|
|
|
|
|
<!-- 等待回复过程:仅在 loading 且还没有任何流式内容时显示 -->
|
|
|
<div v-if="chatStore.isLoading && !chatStore.messages.some(m => m.isStreaming && (m.displayContent || m.thinkingDisplayContent || m.searchingItems.length > 0))" class="flex justify-start">
|
|
|
- <div class="flex-shrink-0 mr-3">
|
|
|
- <div class="w-8 h-8 bg-blue-600 rounded-full flex items-center justify-center text-sm font-semibold">
|
|
|
+ <div class="flex-shrink-0 mr-2 sm:mr-3">
|
|
|
+ <div class="w-6 h-6 sm:w-8 sm:h-8 bg-blue-600 rounded-full flex items-center justify-center text-xs sm:text-sm font-semibold">
|
|
|
AI
|
|
|
</div>
|
|
|
</div>
|
|
|
- <div class="bg-gray-700 text-white px-4 py-3 rounded-lg rounded-bl-sm shadow-sm">
|
|
|
+ <div class="bg-gray-700 text-white px-3 sm:px-4 py-2 sm:py-3 rounded-lg rounded-bl-sm shadow-sm text-sm sm:text-base">
|
|
|
<div class="flex items-center space-x-2">
|
|
|
<div class="flex space-x-1">
|
|
|
<div class="w-2 h-2 bg-gray-400 rounded-full animate-bounce"></div>
|