/* CodeBuddy 风格 AI助手样式 - 完全沿用官方IP形象风格 */
:root {
    --cb-size: 90px;
    --cb-primary: #6C4DFF;
    --cb-primary-dark: #583ED3;
    --cb-glow: #32E6B9;
    --cb-white: #ffffff;
}

#qwenAIButton {
    position: fixed;
    bottom: 40px;
    right: 40px;
    cursor: pointer;
    z-index: 1000;
    transition: all 0.3s ease;
}

#qwenAIButton:hover {
    transform: scale(1.1);
    filter: brightness(1.1);
}

#qwenAIButton:active {
    transform: scale(0.95);
}

/* CodeBuddy 主体 - 紫色渐变圆形 */
.pure-ai-assistant {
    position: relative;
    width: var(--cb-size);
    height: var(--cb-size);
    border-radius: 50%;
    background: linear-gradient(180deg, var(--cb-primary) 0%, var(--cb-primary-dark) 100%);
    box-shadow: 
        0 8px 32px rgba(108, 77, 255, 0.4),
        0 4px 16px rgba(0, 0, 0, 0.2),
        inset 0 2px 4px rgba(255, 255, 255, 0.3),
        inset 0 -2px 4px rgba(0, 0, 0, 0.2),
        0 0 0 3px rgba(50, 230, 185, 0.3);
    animation: cb-float 3s ease-in-out infinite;
}

/* 外圈发光效果 */
.pure-ai-assistant::before {
    content: '';
    position: absolute;
    inset: -8px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(50, 230, 185, 0.4) 0%, transparent 70%);
    animation: cb-glow-pulse 2s ease-in-out infinite;
    z-index: -1;
}

/* 高光效果 */
.pure-ai-assistant::after {
    content: '';
    position: absolute;
    top: 8%;
    left: 15%;
    width: 35%;
    height: 25%;
    border-radius: 50%;
    background: radial-gradient(ellipse, rgba(255, 255, 255, 0.4) 0%, transparent 70%);
    pointer-events: none;
}

/* 悬浮动画 */
@keyframes cb-float {
    0%, 100% {
        transform: translateY(0px) rotate(0deg);
    }
    50% {
        transform: translateY(-8px) rotate(2deg);
    }
}

/* 发光脉冲动画 */
@keyframes cb-glow-pulse {
    0%, 100% {
        opacity: 0.6;
        transform: scale(1);
    }
    50% {
        opacity: 1;
        transform: scale(1.1);
    }
}

/* AI面部容器 */
.pure-ai-face {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    border-radius: 50%;
    overflow: hidden;
    display: flex;
    align-items: center;
    justify-content: center;
}

/* CodeBuddy 风格眼睛 - 两个倾斜的白色矩形 */
.pure-ai-eyes {
    position: absolute;
    top: 40%;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    gap: 16px;
    align-items: center;
}

.pure-ai-eye {
    width: 14px;
    height: 24px;
    background: var(--cb-white);
    border-radius: 4px;
    box-shadow: 
        0 0 12px rgba(50, 230, 185, 0.8),
        0 0 24px rgba(50, 230, 185, 0.4),
        inset 0 2px 4px rgba(255, 255, 255, 0.5);
    animation: cb-blink 4s ease-in-out infinite;
    position: relative;
    transform: rotate(-25deg);
}

.pure-ai-eye:last-child {
    transform: rotate(25deg);
}

/* 眼睛高光 */
.pure-ai-eye::before {
    content: '';
    position: absolute;
    top: 4px;
    left: 3px;
    width: 4px;
    height: 6px;
    border-radius: 2px;
    background: rgba(255, 255, 255, 0.9);
}

/* 眨眼动画 */
@keyframes cb-blink {
    0%, 45%, 55%, 100% {
        transform: rotate(-25deg) scaleY(1);
    }
    50% {
        transform: rotate(-25deg) scaleY(0.1);
    }
}

.pure-ai-eye:last-child {
    animation-name: cb-blink-right;
}

@keyframes cb-blink-right {
    0%, 45%, 55%, 100% {
        transform: rotate(25deg) scaleY(1);
    }
    50% {
        transform: rotate(25deg) scaleY(0.1);
    }
}

/* 微笑嘴巴 - 可爱弧线 */
.pure-ai-helmet {
    position: absolute;
    bottom: 28%;
    left: 50%;
    transform: translateX(-50%);
    width: 20px;
    height: 8px;
    border: 2px solid var(--cb-white);
    border-top: none;
    border-radius: 0 0 20px 20px;
    opacity: 0.7;
    box-shadow: 0 2px 4px rgba(50, 230, 185, 0.3);
}

/* 腮红/脸颊 - 蓝绿色微光 */
.pure-ai-cheeks {
    position: absolute;
    top: 58%;
    left: 50%;
    transform: translateX(-50%);
    width: 60px;
    display: flex;
    justify-content: space-between;
}

.pure-ai-cheek {
    width: 10px;
    height: 6px;
    background: rgba(50, 230, 185, 0.3);
    border-radius: 50%;
    box-shadow: 0 0 8px rgba(50, 230, 185, 0.4);
}

/* 悬停时动画加速 */
#qwenAIButton:hover .pure-ai-assistant {
    animation-duration: 1.5s;
}

#qwenAIButton:hover .pure-ai-assistant::before {
    animation-duration: 1s;
}

/* AI助手标签 */
.qwen-label {
    position: absolute;
    top: 50%;
    left: -120px;
    transform: translateY(-50%);
    background: linear-gradient(135deg, var(--cb-primary), var(--cb-primary-dark));
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 500;
    white-space: nowrap;
    opacity: 0;
    transition: all 0.3s ease;
    pointer-events: none;
    backdrop-filter: blur(10px);
    box-shadow: 0 4px 16px rgba(108, 77, 255, 0.4);
}

#qwenAIButton:hover .qwen-label {
    opacity: 1;
    left: -130px;
}

/* 点击效果 - 弹出对话框动画 */
@keyframes cb-click {
    0% {
        transform: scale(1);
    }
    30% {
        transform: scale(0.85);
    }
    60% {
        transform: scale(1.1);
    }
    100% {
        transform: scale(1);
    }
}

.ai-clicked {
    animation: cb-click 0.4s ease;
}

/* 点击时的光环爆发效果 */
#qwenAIButton.clicked .pure-ai-assistant::before {
    animation: cb-burst 0.5s ease-out;
}

@keyframes cb-burst {
    0% {
        transform: scale(1);
        opacity: 1;
    }
    100% {
        transform: scale(2);
        opacity: 0;
    }
}
