/* 全局学习助手样式 */
.learning-assistant {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 100px;
    height: 100px;
    cursor: grab;
    z-index: 9999;
    box-shadow: 0 4px 20px rgba(255, 94, 98, 0.4);
    transition: box-shadow 0.3s ease, transform 0.15s ease;
    animation: float 3s ease-in-out infinite;
    border-radius: 50%;
    display: none;
    user-select: none;
    -webkit-user-select: none;
    touch-action: none;
}

.learning-assistant.dragging {
    cursor: grabbing;
    animation: none;
    transition: none;
    opacity: 0.9;
    box-shadow: 0 8px 32px rgba(255, 94, 98, 0.55);
}

.learning-assistant:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 25px rgba(255, 94, 98, 0.6);
}

.learning-assistant.dragging:hover {
    transform: none;
}

.assistant-image {
    width: 100%;
    height: 100%;
    object-fit: contain;
    border-radius: 50%;
}

/* 添加助手昵称样式 */
.assistant-name {
    position: absolute;
    top: -35px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(0, 200, 255, 0.7);
    color: white;
    padding: 8px 16px;
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    z-index: 10000;
    text-align: center;
    display: flex;
    align-items: center;
    justify-content: center;
    min-width: 60px;
    height: 32px; /* 增加高度 */
    box-sizing: border-box;
    border: 2px solid rgba(255, 255, 255, 0.3); /* 添加白色边框增强视觉效果 */
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2); /* 添加阴影增强立体感 */
    backdrop-filter: blur(5px); /* 毛玻璃效果 */
    transition: all 0.3s ease; /* 添加过渡动画 */
}

/* 鼠标悬停效果 */
.assistant-name:hover {
    background: rgba(0, 162, 255, 0.9);
    transform: translateX(-50%) translateY(-2px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.3);
}

.assistant-speech-bubble {
    position: fixed;
    background: white;
    color: #333;
    padding: 15px 20px;
    border-radius: 20px;
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    z-index: 10000;
    max-width: 200px;
    font-size: 16px;
    font-weight: 500;
    opacity: 0;
    transform: translateY(20px);
    transition: opacity 0.3s ease, transform 0.3s ease;
    pointer-events: none;
    display: none;
}

/* 默认箭头在气泡右侧（气泡在助手左侧） */
.assistant-speech-bubble::after {
    content: '';
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    right: -8px;
    border-width: 8px 0 8px 8px;
    border-style: solid;
    border-color: transparent transparent transparent white;
}

/* 箭头在气泡左侧（气泡在助手右侧） */
.assistant-speech-bubble[data-arrow="left"]::after {
    right: auto;
    left: -8px;
    border-width: 8px 8px 8px 0;
    border-color: transparent white transparent transparent;
}

/* 箭头在气泡顶部（气泡在助手下方） */
.assistant-speech-bubble[data-arrow="top"]::after {
    top: -8px;
    right: auto;
    left: 20px;
    transform: none;
    border-width: 0 8px 8px 8px;
    border-color: transparent transparent white transparent;
}

.assistant-speech-bubble.show {
    opacity: 1;
    transform: translateY(0);
}

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

/* 学习助手设置页面样式 */
.animal-selection {
    display: grid;
    grid-template-columns: repeat(2, 1fr);
    gap: 15px;
    margin-top: 10px;
}

.animal-option {
    display: flex;
    flex-direction: column;
    align-items: center;
    padding: 15px;
    border: 2px solid rgba(255, 255, 255, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.3s ease;
    background: rgba(0, 0, 0, 0.1);
}

.animal-option:hover {
    border-color: var(--primary);
    background: rgba(0, 247, 255, 0.1);
    transform: translateY(-2px);
}

.animal-option.selected {
    border-color: var(--primary);
    background: rgba(0, 247, 255, 0.2);
    box-shadow: 0 0 15px rgba(0, 247, 255, 0.3);
}

.animal-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    margin-bottom: 10px;
    background: rgba(255, 255, 255, 0.1);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 30px;
}

.animal-icon.placeholder {
    background: linear-gradient(135deg, var(--primary), var(--secondary));
}

.animal-option span {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
}
