From 5052796b67ed4b9d953907ecbbf35cbcf225765b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E9=9B=AA=E8=B1=B9=E5=90=8C=E5=BF=97?= <1486853830@qq.com> Date: Tue, 17 Jun 2025 04:03:26 +0000 Subject: [PATCH] =?UTF-8?q?=E6=94=B9=E5=9B=9E=E5=8E=BB?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Signed-off-by: 雪豹同志 <1486853830@qq.com> --- styles/common.css | 79 +++++++++++++++++++++++++++++++++++++++-------- 1 file changed, 66 insertions(+), 13 deletions(-) diff --git a/styles/common.css b/styles/common.css index 1255d63..f4f8258 100644 --- a/styles/common.css +++ b/styles/common.css @@ -64,6 +64,12 @@ body { color: #ffffff; } +.bot-message { + background-color: rgba(50, 50, 50, 0.7); + /* 深灰色机器人消息 */ + color: #ffffff; +} + #input-area { display: flex; gap: 10px; @@ -76,15 +82,10 @@ body { max-width: 760px; backdrop-filter: blur(10px); /* 毛玻璃效果 */ - padding: 6px; + padding: 10px; + border-radius: 8px; background: rgba(255, 255, 255, 0.2); /* 半透明背景 */ - background: rgba(0, 0, 0, 0.3); /* 原为 rgba(255,255,255,0.1) */ - backdrop-filter: blur(10px); - -webkit-backdrop-filter: blur(10px); - border-radius: 12px; - border: 1px solid rgba(255, 255, 255, 0.2); - box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); } #user-input { @@ -152,6 +153,25 @@ button { max-width: 80%; } +.bot-message { + max-width: 80%; +} + +/* 添加宽屏响应式样式 */ +@media (min-width: 768px) { + .user-message { + max-width: 30%; + margin-left: auto !important; + margin-right: 10px; + } + + .bot-message { + max-width: 30%; + margin-right: auto !important; + margin-left: 10px; + } +} + .user-message { background-color: rgba(227, 242, 253, 0.7); margin-left: auto; @@ -164,18 +184,14 @@ button { } .bot-message { + background-color: rgba(241, 241, 241, 0.7); margin-right: auto; margin-left: 0; text-align: left; display: block; width: fit-content; max-width: 80%; - background-color: rgba(20, 20, 20, 0.7); - /* 深灰背景 */ - color: white; - /* 白色文字 */ - border: 1px solid rgba(255, 255, 255, 0.2); - /* 浅色边框 */ + /* 这个定义会被后面的重复定义覆盖 */ } /* 将媒体查询移到所有消息定义之后 */ @@ -193,6 +209,18 @@ button { } } +/* 删除下方重复的.user-message和.bot-message定义 */ +.bot-message { + background-color: rgba(241, 241, 241, 0.7); + margin-right: auto; + margin-left: 0; + text-align: left; + display: block; + width: fit-content; + max-width: 80%; + /* 这个定义会被后面的重复定义覆盖 */ +} + /* 添加加载动画样式 */ /* 添加旋转动画关键帧 */ @keyframes spin { @@ -227,6 +255,7 @@ button { width: fit-content; position: absolute; top: 20px; + left: 20px; } .title-avatar { @@ -310,6 +339,25 @@ h1 { /* 浅色边框 */ } +.bot-message { + background-color: rgba(20, 20, 20, 0.7); + /* 深灰背景 */ + color: white; + /* 白色文字 */ + border: 1px solid rgba(255, 255, 255, 0.2); + /* 浅色边框 */ +} + +#input-area { + background: rgba(0, 0, 0, 0.3); /* 原为 rgba(255,255,255,0.1) */ + backdrop-filter: blur(10px); + -webkit-backdrop-filter: blur(10px); + border-radius: 12px; + border: 1px solid rgba(255, 255, 255, 0.2); + box-shadow: 0 4px 6px rgba(0, 0, 0, 0.2); + padding: 8px 15px; +} + /* 可选:调整输入框透明效果 */ #user-input { background: rgba(255, 255, 255, 0.1); @@ -375,6 +423,11 @@ h1 { font-size: inherit; } +#input-area { + padding: 6px; + /* 原8px */ +} + #user-input { padding: 8px; /* 原10px */ -- Gitee