/* AI测试页面样式 */

.test-container {
    display: grid;
    grid-template-columns: 300px 1fr;
    gap: 24px;
    height: calc(100vh - 200px);
}

/* 模型选择器 */
.model-selector {
    height: 100%;
    overflow-y: auto;
}

.model-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.model-card {
    padding: 16px;
    background: #fafafa;
    border: 2px solid transparent;
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.3s;
}

.model-card:hover {
    background: #f0f0f0;
}

.model-card.selected {
    border-color: #1890ff;
    background: #e6f7ff;
}

.model-card-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 8px;
}

.model-card-name {
    font-size: 15px;
    font-weight: 600;
    color: #333;
}

.model-card-badge {
    padding: 2px 8px;
    font-size: 11px;
    border-radius: 3px;
}

.model-card-badge.default {
    background: #f6ffed;
    color: #52c41a;
}

.model-card-provider {
    font-size: 13px;
    color: #666;
    margin-bottom: 4px;
}

.model-card-model {
    font-size: 12px;
    color: #999;
}

/* 对话区域 */
.chat-area {
    display: flex;
    flex-direction: column;
    height: 100%;
    overflow: hidden;
}

.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #fafafa;
    border-radius: 6px;
    margin-bottom: 16px;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
}

.welcome-message p {
    margin-bottom: 8px;
}

/* 消息样式 */
.message {
    margin-bottom: 16px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.message-user {
    display: flex;
    justify-content: flex-end;
}

.message-assistant {
    display: flex;
    justify-content: flex-start;
}

.message-content {
    max-width: 70%;
    padding: 12px 16px;
    border-radius: 12px;
    line-height: 1.6;
    word-break: break-word;
}

.message-user .message-content {
    background: #1890ff;
    color: #fff;
    border-bottom-right-radius: 4px;
}

.message-assistant .message-content {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message-time {
    font-size: 11px;
    color: #999;
    margin-top: 4px;
}

.message-user .message-time {
    text-align: right;
}

.message-error {
    background: #fff2f0;
    color: #ff4d4f;
    padding: 12px;
    border-radius: 6px;
    border: 1px solid #ffccc7;
}

.message-loading {
    display: flex;
    align-items: center;
    gap: 8px;
    color: #999;
    padding: 12px;
}

.message-loading::before {
    content: '';
    width: 16px;
    height: 16px;
    border: 2px solid #f3f3f3;
    border-top-color: #1890ff;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
}

/* 输入区域 */
.chat-input-area {
    background: #fff;
    border-top: 1px solid #f0f0f0;
    padding-top: 16px;
}

.current-model {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    font-size: 13px;
}

.model-label {
    color: #999;
}

.model-name {
    color: #1890ff;
    font-weight: 500;
}

.input-row {
    display: flex;
    gap: 12px;
}

.chat-input {
    flex: 1;
    padding: 12px;
    border: 1px solid #d9d9d9;
    border-radius: 6px;
    resize: none;
    font-size: 14px;
    line-height: 1.5;
}

.chat-input:focus {
    outline: none;
    border-color: #1890ff;
    box-shadow: 0 0 0 2px rgba(24, 144, 255, 0.1);
}

.send-btn {
    padding: 12px 24px;
    background: #1890ff;
    color: #fff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: background 0.3s;
    align-self: flex-end;
}

.send-btn:hover {
    background: #40a9ff;
}

.send-btn:disabled {
    background: #d9d9d9;
    cursor: not-allowed;
}

/* 空状态 */
.no-config {
    text-align: center;
    padding: 60px 20px;
}

.no-config-icon {
    font-size: 64px;
    margin-bottom: 16px;
}

.no-config h3 {
    font-size: 18px;
    color: #333;
    margin-bottom: 8px;
}

.no-config p {
    color: #999;
    margin-bottom: 16px;
}

/* 响应式 */
@media (max-width: 768px) {
    .test-container {
        grid-template-columns: 1fr;
        height: auto;
    }
    
    .model-selector {
        max-height: 300px;
    }
    
    .message-content {
        max-width: 85%;
    }
}
