.character-interaction {
    position: relative;
    width: 100%;
    height: 230px;
    display: flex;
    justify-content: center;
    align-items: center;
    overflow: hidden;
}

.character {
    position: relative;
    width: 600px;
    height: 230px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.character-img {
    width: 100%;
    height: 230px;
    object-fit: contain;
    animation: float 3s ease-in-out infinite;
    transform-origin: center center;
}

.character-img—nofloat {
    object-fit: cover;
}

.speech-bubble {
    width: 100px;
    position: absolute;
    top: 5px;
    left: 50%;
    transform: translateX(-50%);
    background: rgba(255, 255, 255, 0.9);
    padding: 10px 15px;
    border-radius: 15px;
    box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
    opacity: 0;
    transition: opacity 0.3s ease;
}

@media (max-width: 768px) {
    .character {
        width: min(600px, 100%);
    }

    .speech-bubble {
        width: auto;
        max-width: 78vw;
    }
}

.speech-bubble:after {
    content: '';
    position: absolute;
    bottom: -10px;
    left: 50%;
    transform: translateX(-50%);
    border-width: 10px 10px 0;
    border-style: solid;
    border-color: rgba(255, 255, 255, 0.9) transparent transparent;
}

.speech-bubble p {
    margin: 0;
    font-size: 14px;
    color: #333;
}

.character:hover .speech-bubble {
    opacity: 1;
}

@keyframes float {
    0% {
        transform: translateY(0px);
    }

    50% {
        transform: translateY(-10px);
    }

    100% {
        transform: translateY(0px);
    }
}

/* 添加鼠标悬停时的轻微摆动效果 */
.character:hover .character-img {
    animation: shake 0.5s ease-in-out;
}

@keyframes shake {
    0% {
        transform: rotate(0deg);
    }

    25% {
        transform: rotate(-2deg);
    }

    50% {
        transform: rotate(0deg);
    }

    75% {
        transform: rotate(2deg);
    }

    100% {
        transform: rotate(0deg);
    }
}