/**
 * 云信IM - AI智能回复按钮样式
 * 符合微信设计最佳实践
 */

/* ========== AI回复容器 ========== */
.yunxin-ai-reply-container {
    position: relative;
    display: flex;
    align-items: flex-end; /* 底部对齐 */
    gap: 4px;
}

/* ========== 模型选择按钮包装器 ========== */
.yunxin-ai-model-btn-wrapper {
    position: relative; /* 为菜单提供定位基准 */
    display: flex;
    align-items: center;
}

/* ========== 模型选择按钮 ========== */
.yunxin-ai-model-btn {
    width: 28px;
    height: 28px;
    border: none;
    background: #F0F0F0;
    border-radius: 4px;
    color: #666666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.yunxin-ai-model-btn:hover {
    background: #E0E0E0;
    color: #333333;
}

.yunxin-ai-model-btn:active {
    background: #D0D0D0;
}

/* ========== AI回复按钮（微信风格） ========== */
.yunxin-ai-reply-btn {
    width: 28px;
    height: 28px;
    padding: 0;
    border: none;
    background: #F0F0F0;
    border-radius: 4px;
    color: #666666;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s ease;
}

.yunxin-ai-reply-btn:hover {
    background: #E0E0E0;
    color: #333333;
}

.yunxin-ai-reply-btn:active {
    background: #D0D0D0;
}

.yunxin-ai-reply-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    background: #F0F0F0;
}

.yunxin-ai-reply-btn svg {
    flex-shrink: 0;
}

/* 加载状态（微信风格） */
.yunxin-ai-reply-btn.loading {
    opacity: 0.6;
}

.yunxin-ai-reply-btn.loading svg {
    animation: ai-pulse 1.5s ease-in-out infinite;
}

@keyframes ai-pulse {
    0%, 100% {
        opacity: 1;
    }
    50% {
        opacity: 0.5;
    }
}

/* ========== 模型选择菜单（微信风格） ========== */
.yunxin-ai-model-menu {
    position: absolute;
    bottom: calc(100% + 4px);
    right: 0; /* 右对齐 */
    width: 200px;
    max-height: 320px;
    background: #FFFFFF;
    border-radius: 4px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.12);
    border: 1px solid #E0E0E0;
    overflow: hidden;
    z-index: 1000;
    animation: ai-menu-fade-in 0.15s ease;
}

@keyframes ai-menu-fade-in {
    from {
        opacity: 0;
        transform: scale(0.95);
    }
    to {
        opacity: 1;
        transform: scale(1);
    }
}

/* 菜单头部（微信风格 - 简洁） */
.yunxin-ai-model-menu-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 10px 12px;
    background: #FAFAFA;
    border-bottom: 1px solid #E0E0E0;
    color: #666666;
    font-size: 12px;
}

.yunxin-ai-model-menu-close {
    width: 20px;
    height: 20px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 2px;
    font-size: 16px;
    line-height: 1;
    color: #999999;
    transition: all 0.2s ease;
}

.yunxin-ai-model-menu-close:hover {
    background: #E0E0E0;
    color: #333333;
}

/* 菜单列表（微信风格） */
.yunxin-ai-model-menu-list {
    max-height: 280px;
    overflow-y: auto;
    padding: 4px 0;
}

/* 模型项（微信风格 - 简洁扁平） */
.yunxin-ai-model-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 8px 12px;
    cursor: pointer;
    transition: background 0.15s ease;
    border-left: 2px solid transparent;
}

.yunxin-ai-model-item:hover {
    background: #F5F5F5;
}

.yunxin-ai-model-item.active {
    background: #F0F0F0;
    border-left-color: #07C160; /* 微信绿 */
}

.yunxin-ai-model-info {
    flex: 1;
    min-width: 0;
}

.yunxin-ai-model-name {
    font-size: 13px;
    color: #1A1A1A;
    margin-bottom: 0; /* 移除底部间距，因为价格已隐藏 */
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.yunxin-ai-model-price {
    font-size: 11px;
    color: #999999;
    display: none; /* 隐藏价格显示 */
}

.yunxin-ai-model-check {
    color: #07C160; /* 微信绿 */
    opacity: 0;
    transition: opacity 0.15s ease;
    flex-shrink: 0;
}

.yunxin-ai-model-item.active .yunxin-ai-model-check {
    opacity: 1;
}

/* ========== 滚动条样式（微信风格） ========== */
.yunxin-ai-model-menu-list::-webkit-scrollbar {
    width: 4px;
}

.yunxin-ai-model-menu-list::-webkit-scrollbar-track {
    background: transparent;
}

.yunxin-ai-model-menu-list::-webkit-scrollbar-thumb {
    background: #D0D0D0;
    border-radius: 2px;
}

.yunxin-ai-model-menu-list::-webkit-scrollbar-thumb:hover {
    background: #B0B0B0;
}

/* ========== 发送按钮顺序 ========== */
/* 确保发送按钮在AI按钮之后 */
.yunxin-send-btn {
    order: 1000;
}

/* ========== 响应式 ========== */
@media (max-width: 768px) {
    .yunxin-ai-model-menu {
        width: 180px;
    }
}

