133 lines
2.0 KiB
CSS
133 lines
2.0 KiB
CSS
/* static/css/chat.css */
|
|
|
|
#chat-widget {
|
|
position: fixed;
|
|
bottom: 20px;
|
|
right: 20px;
|
|
width: 300px;
|
|
font-family: Arial, sans-serif;
|
|
z-index: 1000;
|
|
}
|
|
|
|
#toggle-chat {
|
|
width: 100%;
|
|
padding: 10px;
|
|
background-color: #00f0ff;
|
|
border: none;
|
|
color: white;
|
|
cursor: pointer;
|
|
font-size: 16px;
|
|
border-radius: 5px 5px 0 0;
|
|
}
|
|
|
|
#toggle-chat:hover {
|
|
background-color: #00c0d1;
|
|
}
|
|
|
|
#chat-container {
|
|
border: 1px solid #ccc;
|
|
border-top: none;
|
|
background-color: white;
|
|
border-radius: 0 0 10px 10px;
|
|
box-shadow: 0 4px 6px rgba(0,0,0,0.1);
|
|
display: flex;
|
|
flex-direction: column;
|
|
height: 400px;
|
|
overflow: hidden;
|
|
}
|
|
|
|
.hidden {
|
|
display: none;
|
|
}
|
|
|
|
#messages {
|
|
flex: 1;
|
|
padding: 10px;
|
|
overflow-y: auto;
|
|
background-color: #f9f9f9;
|
|
}
|
|
|
|
.message {
|
|
display: flex;
|
|
margin-bottom: 10px;
|
|
}
|
|
|
|
.message.user {
|
|
justify-content: flex-end;
|
|
}
|
|
|
|
.message.system {
|
|
justify-content: center;
|
|
}
|
|
|
|
.message .bubble {
|
|
max-width: 70%;
|
|
padding: 10px;
|
|
border-radius: 10px;
|
|
position: relative;
|
|
}
|
|
|
|
.message.user .bubble {
|
|
background-color: #d1e7dd;
|
|
text-align: right;
|
|
}
|
|
|
|
.message.system .bubble {
|
|
background-color: #f1f1f1;
|
|
text-align: center;
|
|
}
|
|
|
|
#status-indicator {
|
|
height: 20px;
|
|
text-align: center;
|
|
color: #555;
|
|
font-size: 14px;
|
|
}
|
|
|
|
#input-area {
|
|
display: flex;
|
|
align-items: center;
|
|
padding: 10px;
|
|
border-top: 1px solid #ccc;
|
|
background-color: #fafafa;
|
|
}
|
|
|
|
#input-area button {
|
|
background: none;
|
|
border: none;
|
|
cursor: pointer;
|
|
margin-right: 10px;
|
|
}
|
|
|
|
#input-area img {
|
|
width: 24px;
|
|
height: 24px;
|
|
}
|
|
|
|
#message-input {
|
|
flex: 1;
|
|
padding: 8px;
|
|
border: 1px solid #ccc;
|
|
border-radius: 5px;
|
|
}
|
|
|
|
#message-input:disabled {
|
|
background-color: #e0e0e0;
|
|
}
|
|
|
|
/* 渐隐动画 */
|
|
.fade-out {
|
|
opacity: 0;
|
|
transition: opacity 0.5s ease-out;
|
|
}
|
|
|
|
/* 为消息气泡添加淡入效果 */
|
|
.bubble {
|
|
animation: fadeIn 0.5s;
|
|
}
|
|
|
|
@keyframes fadeIn {
|
|
from { opacity: 0; }
|
|
to { opacity: 1; }
|
|
}
|