/* AI虚拟助手角色样式 */
.ai-assistant-character {
    position: fixed;
    bottom: 30px;
    left: 30px;
    display: flex;
    align-items: flex-end;
    z-index: 9999;
    transform: scale(1.0);
    transition: transform 0.3s ease;
}

.ai-assistant-character:hover {
    transform: scale(1.05);
}

.character-container {
    position: relative;
    width: 80px;
    height: 95px;
    cursor: pointer;
    z-index: 2;
}

.character-light {
    position: absolute;
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79,195,247,0.3) 0%, rgba(0,0,0,0) 70%);
    animation: pulse 3s infinite;
}



.character-bubble {
    background: white;
    border-radius: 18px;
    padding: 10px 15px;
    margin-left: 15px;
    margin-bottom: 15px;
    max-width: 200px;
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    transform: scale(0);
    opacity: 0;
    transform-origin: left bottom;
    transition: all 0.3s ease;
}

.character-bubble:before {
    content: '';
    position: absolute;
    left: -8px;
    bottom: 15px;
    width: 15px;
    height: 15px;
    background: white;
    transform: rotate(45deg);
    box-shadow: -2px 2px 3px rgba(0, 0, 0, 0.05);
}

.character-bubble p {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #455a64;
}

.bubble-cta {
    color: #0277bd;
    font-weight: 500;
    font-size: 13px;
}

.ai-assistant-character:hover .character-bubble {
    transform: scale(1);
    opacity: 1;
}

@keyframes float {
    0% {
        transform: translateY(0);
    }
    50% {
        transform: translateY(-5px);
    }
    100% {
        transform: translateY(0);
    }
}

@keyframes pulse {
    0% {
        opacity: 0.3;
    }
    50% {
        opacity: 0.6;
    }
    100% {
        opacity: 0.3;
    }
}

@keyframes blink {
    0%, 45%, 55%, 100% {
        transform: scale(1);
    }
    50% {
        transform: scale(0.1);
    }
}

@keyframes glow {
    0% {
        box-shadow: 0 0 2px #b3e5fc;
    }
    100% {
        box-shadow: 0 0 8px #b3e5fc, 0 0 10px #4fc3f7;
    }
}

/* 响应式调整 */
@media screen and (max-width: 576px) {
    .character-bubble {
        max-width: 220px;
    }
}

/* AI助手形象样式 */
.character-avatar {
    background-image: url('../welcome/image/assitant.png') ;
    background-size: cover !important;
    background-position: center !important;
    border-radius: 70%;
    width: 85px;
    height: 85px;
    position: relative;
    top: 0;
    left: 5px;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 5px 20px rgba(2, 119, 189, 0.4);
    border: 1.5px solid #b3e5fc;
    overflow: hidden;
    animation: float 6s ease-in-out infinite;
}

/* 隐藏CSS绘制的面部元素 */
.character-face, .character-eyes, .eye {
    display: none !important;
}

/* 添加光晕效果 */
.character-avatar::after {
    content: '';
    position: absolute;
    top: -2px;
    left: -2px;
    right: -2px;
    bottom: -2px;
    border-radius: 50%;
    background: radial-gradient(circle, rgba(79, 195, 247, 0.3) 0%, rgba(79, 195, 247, 0) 70%);
    z-index: -1;
    animation: pulse-glow 3s infinite ease-in-out;
}

@keyframes pulse-glow {
    0% { transform: scale(1); opacity: 0.7; }
    50% { transform: scale(1.05); opacity: 1; }
    100% { transform: scale(1); opacity: 0.7; }
}

/* 优化字体样式 */
/* 替换原有的 character-bubble 样式 */
.character-bubble {
    background: white;
    border-radius: 18px;
    padding: 10px 15px;
    margin-left: 15px;
    margin-bottom: 15px;
    min-width: 150px;             /* 添加最小宽度 */
    max-width: 300px;             /* 增加最大宽度 */
    width: auto;                  /* 自动宽度 */
    box-shadow: 0 3px 10px rgba(0, 0, 0, 0.1);
    position: relative;
    transform: scale(0);
    opacity: 0;
    transform-origin: left bottom;
    transition: all 0.3s ease;
    box-sizing: border-box;       /* 确保padding包含在宽度内 */
    word-wrap: break-word;        /* 确保长文本会自动换行 */
}

/* 确保气泡内容自适应 */
.character-bubble p {
    margin: 0 0 5px 0;
    font-size: 14px;
    color: #455a64;
    white-space: normal;         /* 允许文本正常换行 */
    overflow-wrap: break-word;   /* 确保长单词也会换行 */
}

/* 调整气泡箭头的位置，始终保持在左侧中间 */
.character-bubble:before {
    content: '';
    position: absolute;
    left: -8px;
    top: 50%;                    /* 居中定位 */
    transform: translateY(-50%) rotate(45deg); /* 垂直居中并旋转 */
    width: 15px;
    height: 15px;
    background: white;
    box-shadow: -2px 2px 3px rgba(0, 0, 0, 0.05);
}


/* 强化悬停效果 */
.ai-assistant-character:hover .character-avatar {
    transform: scale(1.05);
    transition: transform 0.3s ease;
}
/* 对话泡泡箭头按钮样式 */
.bubble-nav-arrows {
    position: absolute;
    bottom: -20px;
    left: 50%;
    transform: translateX(-50%);
    display: flex;
    align-items: center;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 12px;
    padding: 2px 4px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.2s ease;
}

.character-bubble:hover .bubble-nav-arrows {
    opacity: 1;
}

.arrow-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 20px;
    height: 20px;
    cursor: pointer;
    color: #4fc3f7;
    background: transparent;
    border: none;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.arrow-btn:hover {
    background: rgba(79, 195, 247, 0.1);
}

.arrow-btn i {
    font-size: 16px;
}

.message-counter {
    font-size: 10px;
    margin: 0 4px;
    color: #78909c;
}
/* 关键字高亮样式 */
.highlight-keyword {
    color: var(--color-primary, #00e5ff);
    font-weight: bold;
    border-bottom: 1px dashed currentColor;
    cursor: pointer;
    transition: all 0.2s ease;
    padding: 0 2px;
}

.highlight-keyword:hover {
    background-color: rgba(0, 229, 255, 0.1);
    border-radius: 3px;
}

/* 气泡添加阴影效果，使关键字更显眼 */
.character-bubble p {
    text-shadow: 0 1px 1px rgba(0, 0, 0, 0.1);
}

/* 计算详情样式 */
.calculation-details {
    font-size: 12px;
    color: #78909c;
    margin-top: 5px;
    font-style: italic;
}

/* 收敛状态提示样式 */
.character-bubble.converged {
    border-left: 3px solid #4caf50;
}

.character-bubble.not-converged {
    border-left: 3px solid #f44336;
}

/* 气泡强调动画 */
@keyframes bubble-emphasis {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

.bubble-emphasis {
    animation: bubble-emphasis 1s ease;
}