.chat-view {
    display: flex;
    flex-direction: row;
    height: 100%;
    background: #fff;
    position: relative;
}

// 左侧侧边栏样式 - ChatGPT Style
.chat-sidebar {
    width: 260px;
    background: #f7f7f8;
    border-right: 1px solid #e5e7eb;
    display: flex;
    flex-direction: column;
    transition: width 0.3s ease;
    
    &.collapsed {
        width: 60px;
        
        .new-chat-btn {
            padding: 10px;
            justify-content: center;
        }
    }
    
    .sidebar-header {
        padding: 12px;
        display: flex;
        flex-direction: column;
        gap: 8px;
        border-bottom: 1px solid #e5e7eb;
    }
    
    .new-chat-btn {
        flex: 1;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 10px 16px;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        font-size: 14px;
        color: #374151;
        cursor: pointer;
        transition: all 0.2s;
        
        &:hover {
            background: #f3f4f6;
            border-color: #0055AA;
            color: #0055AA;
        }
    }
    
    .collapse-toggle {
        width: 100%;
        display: flex;
        align-items: center;
        justify-content: center;
        gap: 8px;
        padding: 10px 16px;
        background: #fff;
        border: 1px solid #e5e7eb;
        border-radius: 8px;
        font-size: 14px;
        color: #6b7280;
        cursor: pointer;
        transition: all 0.2s;
        
        &:hover {
            background: #f3f4f6;
            color: #0055AA;
        }
    }
    
    .conversations-list {
        flex: 1;
        overflow-y: auto;
        padding: 12px 8px;
    }
    
    .list-section {
        margin-bottom: 16px;
        
        .section-title {
            padding: 8px 12px;
            font-size: 12px;
            color: #9ca3af;
            font-weight: 500;
        }
    }
    
    .conversation-item {
        display: flex;
        align-items: center;
        gap: 10px;
        padding: 10px 12px;
        border-radius: 8px;
        cursor: pointer;
        transition: all 0.2s;
        color: #374151;
        
        &:hover {
            background: #e5e7eb;
            
            .conv-actions {
                opacity: 1;
            }
        }
        
        &.active {
            background: #e5e7eb;
        }
        
        .conv-title {
            flex: 1;
            font-size: 14px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        
        .conv-actions {
            opacity: 0;
            display: flex;
            gap: 4px;
            transition: opacity 0.2s;
            
            .action-icon {
                padding: 4px;
                border-radius: 4px;
                color: #6b7280;
                
                &:hover {
                    background: #d1d5db;
                    color: #ef4444;
                }
            }
        }
    }
}

// 主聊天区域
.chat-main {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-width: 0;
}

.chat-header {
    padding: 16px 24px;
    border-bottom: 1px solid #e5e7eb;
    
    .agent-dropdown {
        cursor: pointer;
    }
    
    .header-title {
        display: flex;
        align-items: center;
        gap: 8px;
        font-size: 16px;
        font-weight: 500;
        color: #374151;
        cursor: pointer;
        padding: 8px 12px;
        border-radius: 8px;
        transition: all 0.2s;
        
        &:hover {
            background: #f3f4f6;
            color: #0055AA;
        }
        
        .agent-icon {
            font-size: 20px;
        }
    }
}

.dropdown-agent-icon {
    margin-right: 8px;
    font-size: 16px;
}

:deep(.el-dropdown-menu__item.is-active) {
    background: rgba(0, 85, 170, 0.1);
    color: #0055AA;
}

.chat-content {
    flex: 1;
    overflow-y: auto;
    padding: 40px 80px;
}

.welcome-section {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    min-height: 400px;
}

.messages-container {
    display: flex;
    flex-direction: column;
    gap: 24px;
    
    .message {
        display: flex;
        gap: 12px;
        
        &.user {
            flex-direction: row-reverse;
            
            .message-content {
                align-items: flex-end;
                
                .message-text {
                    background: #0055AA;
                    color: #fff;
                }
            }
        }
        
        .message-avatar {
            flex-shrink: 0;
            
            .ai-avatar-small {
                width: 40px;
                height: 40px;
                border-radius: 10px;
                object-fit: contain;
                background: #f3f4f6;
                padding: 4px;
            }
            
            .user-avatar-small {
                width: 40px;
                height: 40px;
                background: #e5e7eb;
                border-radius: 50%;
                display: flex;
                align-items: center;
                justify-content: center;
                font-size: 18px;
            }
        }
        
        .message-content {
            display: flex;
            flex-direction: column;
            gap: 4px;
            max-width: 70%;
            
            .message-text {
                padding: 12px 16px;
                background: #f3f4f6;
                border-radius: 12px;
                color: #1f2937;
                line-height: 1.6;
                white-space: pre-wrap;
            }
            
            .message-time {
                font-size: 12px;
                color: #9ca3af;
                padding: 0 4px;
            }
        }
    }
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 16px;
    
    span {
        width: 8px;
        height: 8px;
        background: #9ca3af;
        border-radius: 50%;
        animation: typing 1.4s infinite ease-in-out both;
        
        &:nth-child(1) { animation-delay: -0.32s; }
        &:nth-child(2) { animation-delay: -0.16s; }
    }
}

@keyframes typing {
    0%, 80%, 100% {
        transform: scale(0.6);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

.input-area {
    padding: 20px 80px 30px;
    background: #fff;
    
    .input-wrapper {
        background: #f9fafb;
        border: 1px solid #e5e7eb;
        border-radius: 12px;
        padding: 12px 16px;
        
        textarea {
            width: 100%;
            border: none;
            background: transparent;
            resize: none;
            outline: none;
            font-size: 14px;
            color: #1f2937;
            min-height: 24px;
            max-height: 120px;
            
            &::placeholder {
                color: #9ca3af;
            }
        }
        
        .input-actions {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-top: 12px;
            
            .action-buttons, .send-actions {
                display: flex;
                gap: 8px;
            }
            
            .action-btn {
                width: 32px;
                height: 32px;
                border-radius: 8px;
                display: flex;
                align-items: center;
                justify-content: center;
                color: #6b7280;
                transition: all 0.2s;
                border: none;
                background: transparent;
                cursor: pointer;
                
                &:hover {
                    background: #e5e7eb;
                    color: #374151;
                }
            }
            
            .send-btn {
                width: 36px;
                height: 36px;
                background: #0055AA;
                border-radius: 8px;
                display: flex;
                align-items: center;
                justify-content: center;
                color: #fff;
                transition: all 0.2s;
                border: none;
                cursor: pointer;
                
                &:hover:not(:disabled) {
                    background: #004488;
                }
                
                &:disabled {
                    background: #d1d5db;
                    cursor: not-allowed;
                }
            }
        }
    }
}
