Files
gzth/yuthon_ai_agent/static/src/css/ai_chat.css
T
2026-06-12 15:55:11 +08:00

253 lines
4.9 KiB
CSS

.o_ai_chat_action {
display: flex;
flex-direction: column;
height: 100%;
min-height: 400px;
}
.ai-chat-header {
flex-shrink: 0;
}
.ai-chat-messages {
flex: 1;
overflow-y: auto;
background: #f8f9fa;
min-height: 200px;
}
.ai-chat-msg {
display: flex;
flex-direction: column;
margin-bottom: 16px;
animation: fadeIn 0.3s ease;
}
.ai-chat-msg.user {
align-items: flex-end;
}
.ai-chat-msg.assistant {
align-items: flex-start;
}
.ai-chat-bubble {
max-width: 80%;
padding: 10px 16px;
border-radius: 12px;
line-height: 1.6;
word-wrap: break-word;
white-space: pre-wrap;
}
.ai-chat-msg.user .ai-chat-bubble {
background: #007bff;
color: #fff;
border-bottom-right-radius: 4px;
}
.ai-chat-msg.assistant .ai-chat-bubble {
background: #ffffff;
border: 1px solid #dee2e6;
border-bottom-left-radius: 4px;
}
.ai-chat-meta {
font-size: 11px;
color: #6c757d;
margin-top: 4px;
padding: 0 4px;
}
.ai-chat-input-area input {
flex: 1;
}
.ai-chat-input-area input:focus {
outline: none;
border-color: #007bff;
box-shadow: 0 0 0 2px rgba(0,123,255,0.15);
}
.ai-chat-loading {
color: #6c757d;
font-size: 13px;
}
/* 附件上传按钮 */
.ai-chat-attach-btn {
flex-shrink: 0;
}
/* 附件预览区 */
.ai-chat-attach-preview {
flex-shrink: 0;
display: flex;
flex-wrap: wrap;
gap: 6px;
background: #f8f9fa;
}
.ai-chat-attach-item {
display: inline-flex;
align-items: center;
gap: 4px;
padding: 3px 10px;
background: #fff;
border: 1px solid #dee2e6;
border-radius: 6px;
font-size: 12px;
color: #495057;
}
.ai-chat-attach-remove {
background: none;
border: none;
color: #adb5bd;
cursor: pointer;
padding: 0 2px;
font-size: 10px;
line-height: 1;
border-radius: 3px;
}
.ai-chat-attach-remove:hover {
color: #dc3545;
background: #f8d7da;
}
/* === URL 链接卡片 === */
.ai-chat-msg .o_ai_link_card,
.ai-chat-msg-user .o_ai_link_card {
display: inline-flex;
align-items: center;
gap: 6px;
padding: 4px 10px;
margin: 2px 0;
border-radius: 8px;
text-decoration: none !important;
transition: all 0.2s;
max-width: 100%;
overflow: hidden;
}
.ai-chat-msg.assistant .o_ai_link_card {
background: #f0f4ff;
border: 1px solid #d0d8f0;
color: #1d4ed8 !important;
}
.ai-chat-msg.assistant .o_ai_link_card:hover {
background: #e0e8ff;
border-color: #3b82f6;
}
.ai-chat-msg.user .o_ai_link_card {
background: rgba(255,255,255,0.15);
border: 1px solid rgba(255,255,255,0.25);
color: inherit !important;
}
.ai-chat-msg.user .o_ai_link_card:hover {
background: rgba(255,255,255,0.25);
}
.o_ai_link_icon {
flex-shrink: 0;
font-size: 11px;
opacity: 0.7;
}
.o_ai_link_domain {
font-weight: 600;
font-size: 12px;
white-space: nowrap;
}
.o_ai_link_url {
font-size: 11px;
opacity: 0.7;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
}
/* === 消息中附件缩略图 === */
.ai-chat-msg-attachments {
display: flex;
flex-wrap: wrap;
gap: 6px;
margin-top: 6px;
padding: 0 4px;
}
.ai-chat-msg-attachments.justify-content-end {
justify-content: flex-end;
}
.ai-chat-msg-img-wrap {
display: flex;
flex-direction: column;
align-items: center;
width: 140px;
border-radius: 10px;
overflow: hidden;
background: #fff;
border: 1px solid #dee2e6;
text-decoration: none !important;
transition: all 0.2s;
box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.ai-chat-msg-img-wrap:hover {
transform: translateY(-2px);
box-shadow: 0 4px 12px rgba(0,0,0,0.12);
border-color: #007bff;
}
.ai-chat-msg-thumb {
width: 140px;
height: 140px;
object-fit: cover;
display: block;
}
.ai-chat-msg-img-name {
padding: 4px 8px;
font-size: 11px;
color: #6c757d;
text-align: center;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
max-width: 100%;
box-sizing: border-box;
}
.ai-chat-msg-file-card {
display: inline-flex;
align-items: center;
gap: 8px;
padding: 6px 12px;
border-radius: 8px;
background: #fff;
border: 1px solid #dee2e6;
text-decoration: none !important;
color: #495057 !important;
font-size: 12px;
transition: all 0.2s;
max-width: 220px;
}
.ai-chat-msg-file-card:hover {
border-color: #007bff;
background: #e8f0fe;
}
.ai-chat-msg-file-icon {
color: #dc3545;
font-size: 16px;
flex-shrink: 0;
}
.ai-chat-msg-file-name {
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
flex: 1;
}
.ai-chat-msg-file-dl {
color: #adb5bd;
font-size: 12px;
flex-shrink: 0;
}
.ai-chat-msg-file-card:hover .ai-chat-msg-file-dl {
color: #007bff;
}
@keyframes fadeIn {
from { opacity: 0; transform: translateY(8px); }
to { opacity: 1; transform: translateY(0); }
}