Files
urbanLifeline/urbanLifelineWeb/packages/workcase/src/views/public/AIChat/AIChatView.scss

619 lines
13 KiB
SCSS
Raw Normal View History

2025-12-17 15:32:58 +08:00
// 品牌色
$brand-color: #0055AA;
$brand-color-light: #EBF5FF;
$brand-color-hover: #004488;
.ai-chat-container {
2025-12-13 14:13:31 +08:00
display: flex;
2025-12-17 15:32:58 +08:00
height: 100%;
background: #f8fafc;
position: relative;
overflow: hidden;
font-family: 'Inter', 'Noto Sans SC', sans-serif;
}
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
// ==================== 折叠状态的历史栏 ====================
.history-collapsed {
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 48px;
background: #fff;
border-right: 1px solid #e2e8f0;
display: flex;
flex-direction: column;
align-items: center;
padding: 16px 0;
z-index: 10;
.history-toggle-btn {
padding: 8px;
color: #64748b;
background: transparent;
border: none;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s;
margin-bottom: 8px;
&:hover {
color: $brand-color;
background: $brand-color-light;
}
}
.history-icons {
flex: 1;
overflow-y: auto;
width: 100%;
2025-12-13 14:13:31 +08:00
display: flex;
flex-direction: column;
2025-12-17 15:32:58 +08:00
align-items: center;
gap: 4px;
padding: 8px 0;
}
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
.history-icon-btn {
padding: 8px;
color: #94a3b8;
background: transparent;
border: none;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s;
&:hover {
color: #64748b;
background: #f1f5f9;
}
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
&.active {
color: $brand-color;
background: $brand-color-light;
2025-12-13 14:13:31 +08:00
}
2025-12-17 15:32:58 +08:00
}
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
.expand-btn {
padding: 8px;
color: #94a3b8;
background: transparent;
border: none;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s;
&:hover {
color: #64748b;
background: #f1f5f9;
}
}
}
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
// ==================== 展开时的关闭按钮 ====================
.history-close-btn {
position: absolute;
left: 256px;
top: 50%;
transform: translateY(-50%);
z-index: 20;
background: #fff;
border: 1px solid #e2e8f0;
border-left: none;
border-radius: 0 8px 8px 0;
padding: 8px;
cursor: pointer;
box-shadow: 2px 0 8px rgba(0, 0, 0, 0.05);
transition: all 0.2s;
color: #64748b;
&:hover {
background: #f8fafc;
box-shadow: 2px 0 12px rgba(0, 0, 0, 0.1);
}
}
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
// ==================== 历史对话侧边栏 ====================
.history-sidebar {
position: absolute;
left: 0;
top: 0;
height: 100%;
width: 0;
background: #fff;
border-right: 1px solid #e2e8f0;
z-index: 10;
transition: all 0.3s ease;
overflow: hidden;
box-shadow: 4px 0 16px rgba(0, 0, 0, 0.08);
&.open {
width: 256px;
}
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
.sidebar-inner {
width: 256px;
height: 100%;
display: flex;
flex-direction: column;
}
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
.sidebar-header {
height: 56px;
display: flex;
align-items: center;
justify-content: space-between;
padding: 0 16px;
border-bottom: 1px solid #f1f5f9;
.title {
font-weight: 500;
color: #1e293b;
}
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
.new-chat-btn {
padding: 6px;
color: #64748b;
background: transparent;
border: none;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s;
&:hover {
color: $brand-color;
background: $brand-color-light;
2025-12-13 14:13:31 +08:00
}
}
2025-12-17 15:32:58 +08:00
}
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
.conversation-list {
flex: 1;
overflow-y: auto;
padding: 8px;
.empty-tip {
2025-12-13 14:13:31 +08:00
padding: 16px;
text-align: center;
2025-12-17 15:32:58 +08:00
color: #94a3b8;
font-size: 14px;
2025-12-13 14:13:31 +08:00
}
}
2025-12-17 15:32:58 +08:00
.conversation-item {
2025-12-13 14:13:31 +08:00
display: flex;
2025-12-17 15:32:58 +08:00
align-items: flex-start;
gap: 12px;
padding: 10px 12px;
margin-bottom: 4px;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s;
&:hover {
background: #f8fafc;
.delete-btn {
opacity: 1;
}
}
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
&.active {
background: $brand-color-light;
color: $brand-color;
}
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
.conv-icon {
flex-shrink: 0;
margin-top: 2px;
}
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
.conv-info {
flex: 1;
min-width: 0;
}
.conv-title {
font-size: 14px;
font-weight: 500;
color: #374151;
white-space: nowrap;
overflow: hidden;
text-overflow: ellipsis;
}
.conv-time {
font-size: 12px;
color: #94a3b8;
margin-top: 2px;
}
.delete-btn {
padding: 4px;
color: #94a3b8;
background: transparent;
border: none;
border-radius: 4px;
cursor: pointer;
opacity: 0;
transition: all 0.2s;
&:hover {
color: #ef4444;
2025-12-13 14:13:31 +08:00
}
}
2025-12-17 15:32:58 +08:00
}
}
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
// ==================== 主聊天区域 ====================
.chat-main {
flex: 1;
display: flex;
flex-direction: column;
height: 100%;
transition: all 0.3s ease;
margin-left: 48px;
&.sidebar-open {
margin-left: 256px;
}
}
// ==================== 消息容器 ====================
.messages-container {
flex: 1;
overflow-y: auto;
}
// ==================== 空状态 ====================
.empty-state {
height: 100%;
display: flex;
align-items: center;
justify-content: center;
padding: 32px;
.empty-content {
text-align: center;
max-width: 600px;
}
.logo-wrapper {
width: 80px;
height: 80px;
background: linear-gradient(135deg, $brand-color 0%, $brand-color-hover 100%);
border-radius: 20px;
display: flex;
align-items: center;
justify-content: center;
margin: 0 auto 24px;
box-shadow: 0 8px 24px rgba($brand-color, 0.3);
.logo-icon {
font-size: 40px;
color: #fff;
}
}
.title {
font-size: 24px;
font-weight: 700;
color: #1e293b;
margin: 0 0 8px;
}
.desc {
font-size: 14px;
color: #64748b;
margin: 0 0 32px;
line-height: 1.6;
}
.quick-grid {
display: grid;
grid-template-columns: repeat(2, 1fr);
gap: 12px;
max-width: 480px;
margin: 0 auto;
}
.quick-card {
display: flex;
align-items: center;
gap: 12px;
padding: 16px;
background: #fff;
border: 1px solid #e2e8f0;
border-radius: 12px;
cursor: pointer;
transition: all 0.2s;
text-align: left;
&:hover {
border-color: $brand-color;
box-shadow: 0 4px 12px rgba(0, 0, 0, 0.05);
}
.quick-icon {
width: 36px;
height: 36px;
background: $brand-color-light;
2025-12-13 14:13:31 +08:00
border-radius: 8px;
display: flex;
2025-12-17 15:32:58 +08:00
align-items: center;
justify-content: center;
color: $brand-color;
transition: all 0.2s;
}
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
&:hover .quick-icon {
background: $brand-color;
color: #fff;
}
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
.quick-label {
font-size: 14px;
font-weight: 500;
color: #374151;
}
}
}
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
// ==================== 消息列表 ====================
.messages-list {
max-width: 768px;
margin: 0 auto;
padding: 24px 16px;
2025-12-13 14:13:31 +08:00
2025-12-23 16:56:22 +08:00
.chat-header {
text-align: center;
padding: 16px 0 24px;
border-bottom: 1px solid #f1f5f9;
margin-bottom: 24px;
.chat-title {
font-size: 18px;
font-weight: 600;
color: #1e293b;
margin: 0;
}
}
2025-12-17 15:32:58 +08:00
.message-row {
display: flex;
gap: 12px;
margin-bottom: 24px;
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
&.user {
flex-direction: row-reverse;
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
.message-bubble {
background: $brand-color;
color: #fff;
border-radius: 16px 16px 4px 16px;
2025-12-13 14:13:31 +08:00
2025-12-17 15:32:58 +08:00
.message-time {
text-align: right;
color: rgba(255, 255, 255, 0.7);
2025-12-13 14:13:31 +08:00
}
}
}
}
2025-12-17 15:32:58 +08:00
.avatar {
width: 32px;
height: 32px;
border-radius: 50%;
display: flex;
align-items: center;
justify-content: center;
flex-shrink: 0;
&.user {
background: $brand-color;
color: #fff;
}
&.assistant {
background: linear-gradient(135deg, $brand-color 0%, $brand-color-hover 100%);
color: #fff;
}
}
.message-bubble {
max-width: 80%;
padding: 12px 16px;
border-radius: 16px 16px 16px 4px;
background: #fff;
border: 1px solid #f1f5f9;
box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
.message-text {
font-size: 14px;
line-height: 1.6;
white-space: pre-wrap;
word-wrap: break-word;
}
2025-12-23 16:56:22 +08:00
.typing-cursor {
display: inline-block;
animation: blink 0.8s infinite;
color: $brand-color;
font-weight: bold;
}
.loading-dots {
display: flex;
gap: 4px;
padding: 4px 0;
span {
width: 6px;
height: 6px;
background: #94a3b8;
border-radius: 50%;
animation: bounce 1.4s infinite ease-in-out both;
&:nth-child(1) { animation-delay: -0.32s; }
&:nth-child(2) { animation-delay: -0.16s; }
&:nth-child(3) { animation-delay: 0s; }
}
}
2025-12-17 15:32:58 +08:00
.message-time {
font-size: 12px;
color: #94a3b8;
margin-top: 8px;
}
}
2025-12-13 14:13:31 +08:00
}
2025-12-23 16:56:22 +08:00
@keyframes blink {
0%, 50% { opacity: 1; }
51%, 100% { opacity: 0; }
}
@keyframes bounce {
0%, 80%, 100% { transform: scale(0); }
40% { transform: scale(1); }
}
2025-12-17 15:32:58 +08:00
// ==================== 快捷命令栏 ====================
.quick-bar {
padding: 8px 16px;
border-top: 1px solid #f1f5f9;
background: #fff;
.quick-bar-inner {
max-width: 768px;
margin: 0 auto;
display: flex;
gap: 8px;
overflow-x: auto;
&::-webkit-scrollbar {
display: none;
}
}
.quick-pill {
display: flex;
align-items: center;
gap: 6px;
padding: 6px 12px;
background: #f8fafc;
border: 1px solid #e2e8f0;
border-radius: 20px;
font-size: 12px;
color: #64748b;
cursor: pointer;
white-space: nowrap;
transition: all 0.2s;
&:hover {
border-color: $brand-color;
background: $brand-color-light;
color: $brand-color;
}
.el-icon {
color: $brand-color;
}
2025-12-13 14:13:31 +08:00
}
2025-12-17 15:32:58 +08:00
}
// ==================== 输入区域 ====================
.input-area {
padding: 24px;
background: #f8fafc;
.input-wrapper {
max-width: 768px;
margin: 0 auto;
}
.input-card {
background: #fff;
border-radius: 16px;
box-shadow: 0 4px 24px rgba(0, 0, 0, 0.08);
border: 1px solid #e2e8f0;
overflow: hidden;
}
.input-row {
padding: 12px 16px;
}
.chat-textarea {
width: 100%;
border: none;
outline: none;
resize: none;
font-size: 14px;
color: #374151;
background: transparent;
line-height: 1.5;
max-height: 120px;
&::placeholder {
color: #94a3b8;
}
}
.toolbar-row {
padding: 12px 16px;
display: flex;
justify-content: flex-end;
border-top: 1px solid #f8fafc;
}
.toolbar-actions {
display: flex;
align-items: center;
gap: 8px;
}
.tool-btn {
padding: 8px;
color: #94a3b8;
background: transparent;
border: none;
border-radius: 8px;
cursor: pointer;
transition: all 0.2s;
&:hover {
color: #64748b;
background: #f1f5f9;
}
}
.send-btn {
padding: 10px;
background: #e2e8f0;
color: #94a3b8;
border: none;
border-radius: 12px;
cursor: not-allowed;
transition: all 0.2s;
&.active {
background: $brand-color;
color: #fff;
cursor: pointer;
box-shadow: 0 2px 8px rgba($brand-color, 0.3);
&:hover {
background: $brand-color-hover;
}
}
}
.disclaimer {
text-align: center;
font-size: 12px;
color: #94a3b8;
margin: 12px 0 0;
2025-12-13 14:13:31 +08:00
}
}