RAG/static/chat/style.css

967 lines
20 KiB
CSS

/* 全局样式 */
* {
margin: 0;
padding: 0;
box-sizing: border-box;
}
body {
font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue',
sans-serif;
-webkit-font-smoothing: antialiased;
-moz-osx-font-smoothing: grayscale;
background: linear-gradient(135deg, #0F2027 0%, #203A43 50%, #2C5364 100%);
height: 100vh;
overflow: hidden;
}
/* 聊天容器 */
.chat-container {
display: flex;
height: 100vh;
max-width: 1600px;
margin: 0 auto;
background: rgba(255, 255, 255, 0.98);
backdrop-filter: blur(15px);
box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
border-radius: 12px;
overflow: hidden;
}
/* 侧边栏 */
.sidebar {
width: 320px;
background: linear-gradient(180deg, #1a1a2e 0%, #16213e 100%);
border-right: 1px solid rgba(255, 255, 255, 0.1);
display: flex;
flex-direction: column;
transition: width 0.3s ease;
}
.sidebar-header {
padding: 25px 20px;
border-bottom: 1px solid rgba(255, 255, 255, 0.1);
display: flex;
justify-content: space-between;
align-items: center;
}
.sidebar-header h1 {
font-size: 1.6rem;
font-weight: 700;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
display: flex;
align-items: center;
gap: 12px;
letter-spacing: -0.5px;
}
.sidebar-header h1 i {
color: #667eea;
background: none;
font-size: 1.8rem;
}
.new-chat-btn {
width: 45px;
height: 45px;
border-radius: 50%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border: none;
color: white;
font-size: 1.3rem;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
display: flex;
align-items: center;
justify-content: center;
}
.new-chat-btn:hover {
transform: translateY(-3px) scale(1.05);
box-shadow: 0 6px 20px rgba(102, 126, 234, 0.5);
}
.new-chat-btn:active {
transform: translateY(-1px) scale(0.98);
}
.conversations-list {
flex: 1;
overflow-y: auto;
padding: 10px 0;
}
.conversation-item {
padding: 18px 20px;
cursor: pointer;
border-bottom: 1px solid rgba(255, 255, 255, 0.05);
transition: all 0.3s ease;
position: relative;
display: flex;
align-items: center;
justify-content: space-between;
}
.conversation-content {
flex: 1;
min-width: 0;
padding-right: 10px;
}
.conversation-actions {
display: flex;
align-items: center;
}
.delete-conv-btn {
width: 24px;
height: 24px;
border: none;
background: none;
color: rgba(255, 255, 255, 0.6);
font-size: 18px;
cursor: pointer;
border-radius: 4px;
display: flex;
align-items: center;
justify-content: center;
transition: background-color 0.2s, color 0.2s;
opacity: 0.6;
}
.delete-conv-btn:hover {
background-color: rgba(255, 255, 255, 0.1);
color: #ff4444;
opacity: 1;
}
.conversation-item:hover .delete-conv-btn {
opacity: 1;
}
.conversation-item:hover {
background: rgba(255, 255, 255, 0.05);
transform: translateX(5px);
}
.conversation-item.active {
background: linear-gradient(90deg, rgba(102, 126, 234, 0.2) 0%, rgba(118, 75, 162, 0.2) 100%);
border-right: 4px solid #667eea;
}
.conversation-title {
font-weight: 600;
color: white;
margin-bottom: 8px;
overflow: hidden;
text-overflow: ellipsis;
white-space: nowrap;
font-size: 0.95rem;
}
.conversation-time {
font-size: 0.8rem;
color: rgba(255, 255, 255, 0.5);
}
.sidebar-footer {
padding: 20px;
border-top: 1px solid rgba(255, 255, 255, 0.1);
display: flex;
justify-content: space-between;
align-items: center;
background: rgba(255, 255, 255, 0.05);
}
.user-info {
display: flex;
align-items: center;
gap: 12px;
}
.user-avatar {
width: 45px;
height: 45px;
border-radius: 50%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
display: flex;
align-items: center;
justify-content: center;
color: white;
font-size: 1.3rem;
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}
.user-details {
display: flex;
flex-direction: column;
}
.user-name {
font-weight: 600;
color: white;
font-size: 0.95rem;
}
.user-role {
font-size: 0.8rem;
color: rgba(255, 255, 255, 0.6);
text-transform: uppercase;
letter-spacing: 0.5px;
}
.settings-btn {
background: none;
border: none;
font-size: 1.3rem;
color: rgba(255, 255, 255, 0.7);
cursor: pointer;
padding: 10px;
border-radius: 50%;
transition: all 0.3s ease;
}
.settings-btn:hover {
background: rgba(255, 255, 255, 0.1);
color: white;
transform: rotate(30deg);
}
/* 主聊天区域 */
.chat-main {
flex: 1;
display: flex;
flex-direction: column;
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
min-height: 0;
}
/* 欢迎界面 */
.welcome-screen {
flex: 1;
display: flex;
align-items: center;
justify-content: center;
text-align: center;
padding: 20px;
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
}
.welcome-content {
max-width: 550px;
padding: 40px;
background: rgba(255, 255, 255, 0.9);
border-radius: 20px;
box-shadow: 0 10px 40px rgba(0, 0, 0, 0.1);
}
.welcome-icon {
font-size: 6rem;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
margin-bottom: 25px;
animation: float 3s ease-in-out infinite;
}
@keyframes float {
0%, 100% { transform: translateY(0px); }
50% { transform: translateY(-25px); }
}
.welcome-content h2 {
font-size: 2.8rem;
color: #333;
margin-bottom: 20px;
font-weight: 700;
letter-spacing: -0.5px;
}
.welcome-content p {
font-size: 1.2rem;
color: #666;
margin-bottom: 40px;
line-height: 1.7;
font-weight: 400;
}
.start-chat-btn {
padding: 18px 50px;
font-size: 1.2rem;
font-weight: 600;
color: white;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border: none;
border-radius: 50px;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
text-transform: uppercase;
letter-spacing: 0.5px;
}
.start-chat-btn:hover {
transform: translateY(-3px) scale(1.02);
box-shadow: 0 8px 25px rgba(102, 126, 234, 0.5);
}
.start-chat-btn:active {
transform: translateY(-1px) scale(0.98);
}
/* 聊天界面 */
.chat-screen {
flex: 1;
display: flex;
flex-direction: column;
min-height: 0;
}
.chat-header {
padding: 25px 30px;
background: white;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
display: flex;
justify-content: space-between;
align-items: center;
box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}
.chat-title {
font-size: 1.4rem;
font-weight: 700;
color: #333;
letter-spacing: -0.5px;
}
.chat-actions {
display: flex;
gap: 12px;
}
.action-btn {
width: 45px;
height: 45px;
border-radius: 50%;
background: linear-gradient(135deg, #f093fb 0%, #f5576c 100%);
border: none;
color: white;
font-size: 1.1rem;
cursor: pointer;
transition: all 0.3s ease;
box-shadow: 0 3px 10px rgba(245, 87, 108, 0.3);
display: flex;
align-items: center;
justify-content: center;
}
.action-btn:nth-child(2) {
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
box-shadow: 0 3px 10px rgba(79, 172, 254, 0.3);
}
.action-btn:nth-child(3) {
background: linear-gradient(135deg, #43e97b 0%, #38f9d7 100%);
box-shadow: 0 3px 10px rgba(67, 233, 123, 0.3);
}
.action-btn:hover {
transform: translateY(-3px) scale(1.05);
box-shadow: 0 6px 15px rgba(0, 0, 0, 0.2);
}
.action-btn:active {
transform: translateY(-1px) scale(0.98);
}
.messages-container {
flex: 1;
overflow-y: auto;
padding: 30px;
display: flex;
flex-direction: column;
gap: 25px;
background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%);
/* 确保滚动条能够正确显示 */
max-height: calc(100vh - 200px);
}
/* 滚动条样式 - 为 messages-container 专门设置 */
.messages-container::-webkit-scrollbar {
width: 10px;
}
.messages-container::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.05);
border-radius: 5px;
}
.messages-container::-webkit-scrollbar-thumb {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 5px;
border: 2px solid rgba(255, 255, 255, 0.2);
}
.messages-container::-webkit-scrollbar-thumb:hover {
background: linear-gradient(135deg, #556bda 0%, #65418a 100%);
transform: scale(1.1);
}
/* 消息样式 */
.message {
display: flex;
gap: 18px;
animation: slideIn 0.4s cubic-bezier(0.4, 0, 0.2, 1);
align-items: flex-end;
}
@keyframes slideIn {
from {
opacity: 0;
transform: translateY(20px) scale(0.95);
}
to {
opacity: 1;
transform: translateY(0) scale(1);
}
}
.message.user {
flex-direction: row-reverse;
}
.message-avatar {
width: 45px;
height: 45px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}
.message.user .message-avatar {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
font-size: 1.3rem;
}
.message.assistant .message-avatar {
background: linear-gradient(135deg, #4facfe 0%, #00f2fe 100%);
color: white;
font-size: 1.3rem;
}
/* 消息文本框中的打字指示器 */
.message.text .typing-dots {
display: flex;
align-items: center;
gap: 6px;
padding: 18px 22px;
margin: 0;
}
.message.text .typing-dots .dot {
width: 10px;
height: 10px;
border-radius: 50%;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
animation: typing 1.4s infinite;
box-shadow: 0 2px 5px rgba(102, 126, 234, 0.3);
}
.message.text .typing-dots .dot:nth-child(1) {
animation-delay: -0.32s;
}
.message.text .typing-dots .dot:nth-child(2) {
animation-delay: -0.16s;
}
.message.text .typing-dots .dot:nth-child(3) {
animation-delay: 0s;
}
@keyframes typing {
0%, 80%, 100% {
opacity: 0;
transform: scale(0.7);
}
40% {
opacity: 1;
transform: scale(1);
}
}
.message-content {
max-width: 75%;
flex: 1;
word-wrap: break-word;
display: flex;
flex-direction: column;
}
.message-content > * {
display: block;
width: 100%;
}
.message.text {
padding: 18px 22px;
border-radius: 22px;
font-size: 1rem;
line-height: 1.6;
word-wrap: break-word;
font-weight: 400;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.1);
display: block;
width: 100%;
}
.message.text * {
display: block;
width: 100%;
margin: 0 0 10px 0;
padding: 0;
}
.message.text *:last-child {
margin-bottom: 0;
}
.message.text p {
margin: 0 0 10px 0;
padding: 0;
display: block;
width: 100%;
}
.message.text p:last-child {
margin-bottom: 0;
}
.message.user .message.text {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border-bottom-right-radius: 8px;
border-top-right-radius: 22px;
}
.message.assistant .message.text {
background: white;
color: #333;
border: 1px solid rgba(0, 0, 0, 0.1);
border-bottom-left-radius: 8px;
border-top-left-radius: 22px;
}
.message-time {
font-size: 0.8rem;
color: rgba(0, 0, 0, 0.5);
margin-top: 8px;
text-align: right;
font-weight: 500;
letter-spacing: 0.3px;
}
.message.assistant .message-time {
text-align: left;
}
/* 输入区域 */
.input-area {
padding: 25px 30px;
background: white;
border-top: 1px solid rgba(0, 0, 0, 0.1);
box-shadow: 0 -2px 10px rgba(0, 0, 0, 0.05);
}
.input-container {
display: flex;
align-items: center;
gap: 12px;
background: #f8f9fa;
border-radius: 35px;
padding: 12px;
border: 2px solid transparent;
transition: all 0.3s ease;
}
.input-container:focus-within {
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
background: white;
}
.input-btn {
width: 45px;
height: 45px;
border-radius: 50%;
background: none;
border: none;
color: #666;
font-size: 1.2rem;
cursor: pointer;
transition: all 0.3s ease;
display: flex;
align-items: center;
justify-content: center;
}
.input-btn:hover {
background: #e9ecef;
color: #333;
transform: scale(1.05);
}
#messageInput {
flex: 1;
background: transparent;
border: none;
padding: 14px 18px;
font-size: 1rem;
outline: none;
color: #333;
font-weight: 400;
}
#messageInput::placeholder {
color: #999;
font-weight: 300;
}
#sendBtn {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
font-size: 1.3rem;
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.3);
}
#sendBtn:hover {
background: linear-gradient(135deg, #556bda 0%, #65418a 100%);
transform: scale(1.05);
box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}
#sendBtn:active {
transform: scale(0.98);
}
/* 打字指示器 */
/* 样式已移至 .message-avatar .typing-dots */
/* 模态框 */
.modal {
display: none;
position: fixed;
z-index: 10000;
left: 0;
top: 0;
width: 100%;
height: 100%;
background: rgba(0, 0, 0, 0.6);
backdrop-filter: blur(8px);
animation: fadeIn 0.3s ease;
}
@keyframes fadeIn {
from { opacity: 0; }
to { opacity: 1; }
}
.modal-content {
background: linear-gradient(135deg, rgba(255, 255, 255, 0.95) 0%, rgba(248, 250, 252, 0.98) 100%);
margin: 10% auto;
border-radius: 20px;
width: 90%;
max-width: 480px;
max-height: 90vh;
overflow-y: auto;
box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
animation: slideUp 0.3s cubic-bezier(0.4, 0, 0.2, 1);
border: 1px solid rgba(255, 255, 255, 0.2);
}
@keyframes slideUp {
from { transform: translateY(100px); opacity: 0; }
to { transform: translateY(0); opacity: 1; }
}
.modal-header {
padding: 25px 30px;
border-bottom: 1px solid rgba(0, 0, 0, 0.1);
display: flex;
justify-content: space-between;
align-items: center;
background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
border-radius: 20px 20px 0 0;
}
.modal-header h3 {
font-size: 1.4rem;
font-weight: 700;
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
-webkit-background-clip: text;
-webkit-text-fill-color: transparent;
background-clip: text;
letter-spacing: -0.5px;
}
.close-btn {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border: none;
font-size: 1.5rem;
color: white;
cursor: pointer;
padding: 0;
width: 35px;
height: 35px;
display: flex;
align-items: center;
justify-content: center;
border-radius: 50%;
transition: all 0.3s ease;
box-shadow: 0 3px 10px rgba(102, 126, 234, 0.3);
}
.close-btn:hover {
transform: scale(1.1) rotate(90deg);
box-shadow: 0 4px 15px rgba(102, 126, 234, 0.4);
}
.modal-body {
padding: 25px;
}
.modal-body input {
width: 100%;
padding: 12px 16px;
border: 2px solid rgba(0, 0, 0, 0.1);
border-radius: 10px;
font-size: 0.95rem;
margin-bottom: 0;
transition: all 0.3s ease;
background: white;
font-weight: 400;
height: 42px;
}
.modal-body input:focus {
outline: none;
border-color: #667eea;
box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.15);
transform: translateY(-2px);
}
.modal-body input::placeholder {
color: #999;
font-weight: 300;
}
/* 表单组样式 */
.form-group {
margin-bottom: 15px;
}
.form-group label {
display: block;
font-size: 0.95rem;
font-weight: 600;
color: #334155;
margin-bottom: 6px;
letter-spacing: 0.3px;
}
/* 按钮样式扩展 */
.btn {
padding: 10px 16px;
border: none;
border-radius: 10px;
font-size: 0.9rem;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
text-transform: none;
letter-spacing: 0.3px;
box-shadow: 0 3px 10px rgba(0, 0, 0, 0.15);
white-space: nowrap;
height: auto;
line-height: 1.4;
}
.btn.primary {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
}
.btn.primary:hover {
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}
.btn.secondary {
background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
color: #64748b;
}
.btn.secondary:hover {
background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
color: #475569;
}
.modal-footer {
padding: 15px 20px;
border-top: 1px solid rgba(0, 0, 0, 0.1);
display: flex;
justify-content: flex-end;
gap: 10px;
background: linear-gradient(135deg, #f8fafc 0%, #e2e8f0 100%);
border-radius: 0 0 20px 20px;
flex-wrap: wrap;
align-items: center;
}
.cancel-btn, .confirm-btn {
padding: 14px 28px;
border: none;
border-radius: 12px;
font-size: 1.05rem;
font-weight: 600;
cursor: pointer;
transition: all 0.3s ease;
text-transform: uppercase;
letter-spacing: 0.5px;
box-shadow: 0 4px 15px rgba(0, 0, 0, 0.15);
}
.cancel-btn {
background: linear-gradient(135deg, #f1f5f9 0%, #cbd5e1 100%);
color: #64748b;
border: 2px solid transparent;
}
.cancel-btn:hover {
background: linear-gradient(135deg, #e2e8f0 0%, #cbd5e1 100%);
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(0, 0, 0, 0.2);
color: #475569;
}
.confirm-btn {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
color: white;
border: 2px solid transparent;
}
.confirm-btn:hover {
background: linear-gradient(135deg, #556bda 0%, #65418a 100%);
transform: translateY(-2px);
box-shadow: 0 6px 20px rgba(102, 126, 234, 0.4);
}
.confirm-btn.danger {
background: linear-gradient(135deg, #ff6b6b 0%, #ee5a52 100%);
box-shadow: 0 4px 15px rgba(255, 107, 107, 0.3);
}
.confirm-btn.danger:hover {
background: linear-gradient(135deg, #ee5a52 0%, #c0392b 100%);
box-shadow: 0 6px 20px rgba(255, 107, 107, 0.4);
transform: translateY(-2px);
}
/* 滚动条样式 */
::-webkit-scrollbar {
width: 10px;
}
::-webkit-scrollbar-track {
background: rgba(0, 0, 0, 0.05);
border-radius: 5px;
}
::-webkit-scrollbar-thumb {
background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
border-radius: 5px;
border: 2px solid rgba(255, 255, 255, 0.2);
}
::-webkit-scrollbar-thumb:hover {
background: linear-gradient(135deg, #556bda 0%, #65418a 100%);
transform: scale(1.1);
}
/* 侧边栏滚动条 */
.sidebar ::-webkit-scrollbar-track {
background: rgba(255, 255, 255, 0.05);
}
.sidebar ::-webkit-scrollbar-thumb {
background: linear-gradient(135deg, rgba(102, 126, 234, 0.5) 0%, rgba(118, 75, 162, 0.5) 100%);
border: 2px solid rgba(255, 255, 255, 0.1);
}
.sidebar ::-webkit-scrollbar-thumb:hover {
background: linear-gradient(135deg, rgba(102, 126, 234, 0.7) 0%, rgba(118, 75, 162, 0.7) 100%);
}
/* 响应式设计 */
@media (max-width: 768px) {
.sidebar {
width: 100%;
position: absolute;
z-index: 100;
transform: translateX(-100%);
}
.sidebar.active {
transform: translateX(0);
}
.chat-main {
width: 100%;
}
.message-content {
max-width: 85%;
}
.chat-header {
padding: 15px 20px;
}
.messages-container {
padding: 15px 20px;
}
.input-area {
padding: 15px 20px;
}
}
/* 加载动画 */
.loading {
display: inline-block;
width: 20px;
height: 20px;
border: 3px solid rgba(102, 126, 234, 0.3);
border-radius: 50%;
border-top-color: #667eea;
animation: spin 1s ease-in-out infinite;
}
@keyframes spin {
to { transform: rotate(360deg); }
}