/*==============================================================
阳佳缘 AI全能小助手 前端样式
==============================================================*/

/* 悬浮按钮 */
.ai-float-btn {
    position: fixed;
    right: 16px;
    bottom: 80px;
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8e53 100%);
    box-shadow: 0 4px 16px rgba(255, 107, 157, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 9999;
    transition: all 0.3s ease;
    animation: aiPulse 2s infinite;
}
.ai-float-btn:hover { transform: scale(1.1); }
.ai-float-btn svg { width: 28px; height: 28px; fill: #fff; }
.ai-float-btn .ai-badge {
    position: absolute;
    top: -2px; right: -2px;
    min-width: 18px; height: 18px;
    background: #ff4757; color: #fff;
    border-radius: 9px; font-size: 11px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 5px;
}
@keyframes aiPulse {
    0% { box-shadow: 0 4px 16px rgba(255,107,157,0.4); }
    50% { box-shadow: 0 4px 24px rgba(255,107,157,0.7); }
    100% { box-shadow: 0 4px 16px rgba(255,107,157,0.4); }
}

/* 聊天窗口 */
.ai-chat-panel {
    position: fixed;
    right: 12px;
    bottom: 12px;
    width: 360px;
    max-width: calc(100vw - 24px);
    height: 520px;
    max-height: calc(100vh - 24px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.2);
    display: none;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
    animation: aiSlideUp 0.3s ease;
}
.ai-chat-panel.open { display: flex; }
@keyframes aiSlideUp {
    from { transform: translateY(20px); opacity: 0; }
    to { transform: translateY(0); opacity: 1; }
}

/* 头部 */
.ai-chat-header {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8e53 100%);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}
.ai-chat-header .ai-title {
    display: flex; align-items: center; gap: 8px;
    font-size: 15px; font-weight: 600;
}
.ai-chat-header .ai-title .ai-avatar {
    width: 32px; height: 32px; border-radius: 50%;
    background: rgba(255,255,255,0.25);
    display: flex; align-items: center; justify-content: center;
    font-size: 18px;
}
.ai-chat-header .ai-title .ai-status {
    font-size: 11px; opacity: 0.9; font-weight: normal;
    display: block; margin-top: 2px;
}
.ai-chat-header .ai-close {
    width: 28px; height: 28px; border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 16px; color: #fff;
    transition: background 0.2s;
}
.ai-chat-header .ai-close:hover { background: rgba(255,255,255,0.35); }

/* 消息区 */
.ai-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 12px;
    background: #f7f8fa;
}
.ai-chat-body::-webkit-scrollbar { width: 4px; }
.ai-chat-body::-webkit-scrollbar-thumb { background: #ddd; border-radius: 2px; }

.ai-msg {
    display: flex;
    margin-bottom: 12px;
    animation: aiMsgIn 0.3s ease;
}
@keyframes aiMsgIn {
    from { opacity: 0; transform: translateY(8px); }
    to { opacity: 1; transform: translateY(0); }
}
.ai-msg.ai-bot { justify-content: flex-start; }
.ai-msg.ai-user { justify-content: flex-end; }
.ai-msg .ai-bubble {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}
.ai-msg.ai-bot .ai-bubble {
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0,0,0,0.06);
}
.ai-msg.ai-user .ai-bubble {
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8e53 100%);
    color: #fff;
    border-bottom-right-radius: 4px;
}
.ai-msg .ai-avatar-sm {
    width: 28px; height: 28px; border-radius: 50%;
    flex-shrink: 0; margin: 0 6px;
    display: flex; align-items: center; justify-content: center;
    font-size: 14px;
}
.ai-msg.ai-bot .ai-avatar-sm { background: linear-gradient(135deg,#ff6b9d,#ff8e53); color:#fff; }
.ai-msg.ai-user .ai-avatar-sm { background: #e0e0e0; color: #999; order: 2; }

/* 快捷按钮区 */
.ai-quick-btns {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    flex-shrink: 0;
}
.ai-quick-btn {
    padding: 6px 12px;
    background: #fff5f7;
    color: #ff6b9d;
    border: 1px solid #ffd6e0;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    white-space: nowrap;
}
.ai-quick-btn:hover { background: #ff6b9d; color: #fff; }
.ai-quick-btn.ai-vip-lock {
    background: #fff8e6; color: #f5a623; border-color: #ffe0a0;
}
.ai-quick-btn.ai-vip-lock::after { content: ' 👑'; }

/* 输入区 */
.ai-chat-input {
    display: flex;
    align-items: center;
    padding: 10px 12px;
    background: #fff;
    border-top: 1px solid #f0f0f0;
    gap: 8px;
    flex-shrink: 0;
}
.ai-chat-input input {
    flex: 1;
    height: 36px;
    padding: 0 12px;
    border: 1px solid #e8e8e8;
    border-radius: 18px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
}
.ai-chat-input input:focus { border-color: #ff6b9d; }
.ai-chat-input .ai-send-btn {
    width: 36px; height: 36px;
    border-radius: 50%;
    background: linear-gradient(135deg, #ff6b9d 0%, #ff8e53 100%);
    color: #fff; border: none;
    display: flex; align-items: center; justify-content: center;
    cursor: pointer; font-size: 16px;
    flex-shrink: 0;
}
.ai-chat-input .ai-send-btn:disabled { opacity: 0.5; cursor: not-allowed; }

/* 推荐卡片 */
.ai-recommend-cards {
    display: flex;
    gap: 10px;
    overflow-x: auto;
    padding: 4px 2px 8px;
    scroll-snap-type: x mandatory;
}
.ai-recommend-cards::-webkit-scrollbar { height: 0; }
.ai-recommend-card {
    flex-shrink: 0;
    width: 120px;
    background: #fff;
    border-radius: 10px;
    overflow: hidden;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
    scroll-snap-align: start;
    cursor: pointer;
    transition: transform 0.2s;
}
.ai-recommend-card:hover { transform: translateY(-2px); }
.ai-recommend-card .ai-card-photo {
    width: 120px; height: 140px;
    object-fit: cover;
    background: #f0f0f0;
}
.ai-recommend-card .ai-card-info {
    padding: 6px 8px;
}
.ai-recommend-card .ai-card-name {
    font-size: 13px; font-weight: 600; color: #333;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ai-recommend-card .ai-card-meta {
    font-size: 11px; color: #999; margin-top: 2px;
}
.ai-recommend-card .ai-card-vip {
    display: inline-block;
    background: linear-gradient(135deg,#ffd700,#ffaa00);
    color: #fff; font-size: 10px;
    padding: 1px 5px; border-radius: 3px;
    margin-top: 4px;
}

/* 一键复制按钮 */
.ai-copy-btn {
    display: inline-block;
    margin-top: 6px;
    padding: 3px 10px;
    background: #f0f0f0;
    color: #666;
    border-radius: 10px;
    font-size: 11px;
    cursor: pointer;
    border: none;
}
.ai-copy-btn:hover { background: #e0e0e0; }
.ai-copy-btn.copied { background: #52c41a; color: #fff; }

/* 打字中 */
.ai-typing {
    display: flex; gap: 4px; padding: 10px 14px;
}
.ai-typing span {
    width: 6px; height: 6px; border-radius: 50%;
    background: #ccc; animation: aiTyping 1.4s infinite;
}
.ai-typing span:nth-child(2) { animation-delay: 0.2s; }
.ai-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes aiTyping {
    0%, 60%, 100% { transform: translateY(0); opacity: 0.4; }
    30% { transform: translateY(-6px); opacity: 1; }
}

/* 会员开通提示 */
.ai-vip-tip {
    background: linear-gradient(135deg, #fff8e6 0%, #fff0d4 100%);
    border: 1px solid #ffe0a0;
    border-radius: 10px;
    padding: 12px;
    margin: 8px 0;
    text-align: center;
}
.ai-vip-tip .ai-vip-title {
    font-size: 14px; font-weight: 600; color: #f5a623;
}
.ai-vip-tip .ai-vip-desc {
    font-size: 12px; color: #999; margin: 6px 0;
}
.ai-vip-tip .ai-vip-btn {
    display: inline-block;
    padding: 6px 20px;
    background: linear-gradient(135deg, #ffd700, #ff8c00);
    color: #fff; border-radius: 16px;
    font-size: 13px; cursor: pointer;
    text-decoration: none;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .ai-chat-panel {
        right: 0; bottom: 0;
        width: 100%; max-width: 100%;
        height: 80vh; max-height: 80vh;
        border-radius: 16px 16px 0 0;
    }
    .ai-float-btn { bottom: 70px; right: 12px; width: 50px; height: 50px; }
}
