/* AI智能助手 - 星耀酱 浮窗样式 */
.ai-assistant-wrap {
    position: fixed;
    right: 20px;
    bottom: 100px;
    z-index: 9999;
    font-family: "Microsoft YaHei", "PingFang SC", sans-serif;
}

/* 悬浮小球 */
.ai-assistant-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B9D 0%, #C44569 100%);
    box-shadow: 0 4px 15px rgba(196, 69, 105, 0.4);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
    animation: aiFloat 3s ease-in-out infinite;
}

.ai-assistant-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 20px rgba(196, 69, 105, 0.6);
}

.ai-assistant-btn .ai-icon {
    font-size: 28px;
    color: #fff;
}

.ai-assistant-btn .ai-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: #FF4757;
    border-radius: 50%;
    border: 2px solid #fff;
    display: none;
}

@keyframes aiFloat {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-6px); }
}

/* 聊天窗口 */
.ai-chat-window {
    position: absolute;
    right: 0;
    bottom: 70px;
    width: 380px;
    height: 520px;
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0,0,0,0.15);
    display: none;
    flex-direction: column;
    overflow: hidden;
    animation: aiWindowIn 0.3s ease;
}

.ai-chat-window.active {
    display: flex;
}

@keyframes aiWindowIn {
    from { opacity: 0; transform: translateY(20px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 头部 */
.ai-chat-header {
    background: linear-gradient(135deg, #FF6B9D 0%, #C44569 100%);
    padding: 14px 18px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    color: #fff;
}

.ai-chat-header .ai-info {
    display: flex;
    align-items: center;
    gap: 10px;
}

.ai-chat-header .ai-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.ai-chat-header .ai-name {
    font-size: 16px;
    font-weight: bold;
}

.ai-chat-header .ai-status {
    font-size: 12px;
    opacity: 0.8;
    display: flex;
    align-items: center;
    gap: 4px;
}

.ai-chat-header .ai-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #2ECC71;
    border-radius: 50%;
    display: inline-block;
}

.ai-chat-header .ai-close {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    background: rgba(255,255,255,0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    color: #fff;
    font-size: 18px;
}

.ai-chat-header .ai-close:hover {
    background: rgba(255,255,255,0.3);
}

/* 消息区域 */
.ai-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #F8F9FA;
}

.ai-chat-body::-webkit-scrollbar {
    width: 4px;
}

.ai-chat-body::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 2px;
}

/* 消息气泡 */
.ai-message {
    display: flex;
    gap: 10px;
    margin-bottom: 16px;
    animation: aiMsgIn 0.3s ease;
}

.ai-message.ai-user {
    flex-direction: row-reverse;
}

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

.ai-message .ai-msg-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 16px;
}

.ai-message.ai-bot .ai-msg-avatar {
    background: linear-gradient(135deg, #FF6B9D 0%, #C44569 100%);
    color: #fff;
}

.ai-message.ai-user .ai-msg-avatar {
    background: #6C5CE7;
    color: #fff;
}

.ai-message .ai-msg-content {
    max-width: 260px;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
}

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

.ai-message.ai-user .ai-msg-content {
    background: #6C5CE7;
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* 加载动画 */
.ai-typing {
    display: flex;
    gap: 4px;
    padding: 12px 14px;
}

.ai-typing span {
    width: 8px;
    height: 8px;
    background: #FF6B9D;
    border-radius: 50%;
    animation: aiTyping 1.4s ease-in-out 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); }
    30% { transform: translateY(-8px); }
}

/* 底部输入区 */
.ai-chat-footer {
    padding: 12px 16px;
    background: #fff;
    border-top: 1px solid #eee;
}

.ai-chat-footer .ai-quick-tags {
    display: flex;
    gap: 8px;
    margin-bottom: 10px;
    overflow-x: auto;
    padding-bottom: 4px;
}

.ai-chat-footer .ai-quick-tags::-webkit-scrollbar {
    display: none;
}

.ai-chat-footer .ai-quick-tag {
    flex-shrink: 0;
    padding: 5px 12px;
    background: #FFF0F3;
    color: #C44569;
    border-radius: 16px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid #FFD1DC;
}

.ai-chat-footer .ai-quick-tag:hover {
    background: #C44569;
    color: #fff;
}

.ai-chat-footer .ai-input-wrap {
    display: flex;
    gap: 8px;
    align-items: center;
}

.ai-chat-footer .ai-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #e0e0e0;
    border-radius: 20px;
    outline: none;
    font-size: 14px;
    transition: border-color 0.2s;
    resize: none;
    height: 40px;
    line-height: 20px;
}

.ai-chat-footer .ai-input:focus {
    border-color: #FF6B9D;
}

.ai-chat-footer .ai-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #FF6B9D 0%, #C44569 100%);
    border: none;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.ai-chat-footer .ai-send-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 3px 10px rgba(196, 69, 105, 0.3);
}

.ai-chat-footer .ai-send-btn:disabled {
    opacity: 0.6;
    cursor: not-allowed;
    transform: none;
}

/* 登录提示 */
.ai-login-tip {
    text-align: center;
    padding: 40px 20px;
    color: #999;
}

.ai-login-tip .ai-login-btn {
    display: inline-block;
    margin-top: 12px;
    padding: 8px 24px;
    background: linear-gradient(135deg, #FF6B9D 0%, #C44569 100%);
    color: #fff;
    border-radius: 20px;
    text-decoration: none;
    font-size: 14px;
    transition: all 0.2s;
}

.ai-login-tip .ai-login-btn:hover {
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(196, 69, 105, 0.3);
}

/* 响应式 */
@media (max-width: 480px) {
    .ai-chat-window {
        width: calc(100vw - 40px);
        height: 60vh;
        right: -10px;
    }
}
