﻿/* ─── 虚拟形象 ─────────────────────────────────── */
.avatar-container {
    position: relative; z-index: 5;
    display: flex; align-items: center; justify-content: center;
    width: 100%; height: 100%;
}
.avatar-face {
    width: 180px; height: 180px; border-radius: 50%;
    background: var(--avatar-gradient, linear-gradient(135deg, #ff6b9d, #ffa6c9));
    display: flex; flex-direction: column; align-items: center;
    justify-content: center; gap: 10px; transition: all 0.3s ease;
    box-shadow: var(--avatar-glow, 0 0 30px rgba(255,107,157,0.3));
    animation: avatarBreathe 4s ease-in-out infinite;
}
.avatar-face.emotion-happy { background: linear-gradient(135deg, #ffd700, #ffed4e); box-shadow: 0 0 30px rgba(255,215,0,0.4); }
.avatar-face.emotion-sad { background: linear-gradient(135deg, #5b9bd5, #9cc3e4); box-shadow: 0 0 30px rgba(91,155,213,0.3); }
.avatar-face.emotion-caring { background: linear-gradient(135deg, #ff9999, #ffcccc); box-shadow: 0 0 30px rgba(255,153,153,0.4); }
.avatar-face.emotion-curious { background: linear-gradient(135deg, #9b59b6, #c39bd3); box-shadow: 0 0 30px rgba(155,89,182,0.3); }
.avatar-face.emotion-excited { background: linear-gradient(135deg, #e91e63, #f06292); box-shadow: 0 0 30px rgba(233,30,99,0.5); }

.avatar-eyes { display: flex; gap: 20px; }
.avatar-eye {
    width: 16px; height: 20px; background: #333; border-radius: 50%;
    transition: all 0.2s ease;
}
.avatar-face.speaking .avatar-eye { height: 4px; }
.avatar-face.listening .avatar-eye { animation: eyeBlink 0.15s ease-in-out infinite alternate; }

.avatar-mouth {
    width: 24px; height: 8px; background: #333; border-radius: 0 0 12px 12px;
    transition: all 0.3s ease;
}
.emotion-happy .avatar-mouth { width: 32px; height: 12px; border-radius: 0 0 16px 16px; }
.emotion-sad .avatar-mouth { width: 20px; height: 4px; border-radius: 12px 12px 0 0; transform: translateY(4px); }
.emotion-caring .avatar-mouth { width: 16px; height: 16px; border-radius: 50%; background: transparent; border: 3px solid #333; }
.emotion-curious .avatar-mouth { width: 12px; height: 12px; border-radius: 50%; }
.emotion-excited .avatar-mouth { width: 36px; height: 14px; border-radius: 0 0 18px 18px; }
.avatar-face.speaking .avatar-mouth { animation: mouthTalk 0.3s ease-in-out infinite alternate; }

@keyframes avatarBreathe {
    0%,100% { transform: scale(1); }
    50% { transform: scale(1.03); }
}
@keyframes eyeBlink {
    from { height: 20px; }
    to { height: 2px; }
}
@keyframes mouthTalk {
    from { height: 6px; }
    to { height: 14px; }
}

/* ─── 角色专属虚拟形象 ─────────────────────── */
/* 女友：爱心光晕 + 微笑嘴型 */
.avatar-face.char-girlfriend {
    box-shadow: 0 0 30px var(--avatar-color, #ff6b9d),
                0 0 60px var(--avatar-color, #ff6b9d)33,
                0 0 90px var(--avatar-color, #ff6b9d)1a;
    animation: avatarBreathe 3.5s ease-in-out infinite, avatarHeartPulse 2s ease-in-out infinite;
}
.avatar-face.char-girlfriend .avatar-mouth { width: 28px; height: 10px; border-radius: 0 0 14px 14px; }
.avatar-face.char-girlfriend.emotion-happy .avatar-mouth { width: 36px; }

/* 母亲：柔光扩散 + 温柔微笑 */
.avatar-face.char-mother {
    box-shadow: 0 0 20px var(--avatar-color, #ff9999),
                0 0 40px var(--avatar-color, #ff9999)22,
                0 0 80px var(--avatar-color, #ff9999)0f;
    animation: avatarBreathe 5s ease-in-out infinite;
}
.avatar-face.char-mother .avatar-mouth { width: 22px; height: 7px; border-radius: 0 0 11px 11px; }

/* 朋友：弹跳动画 + 大眼睛 */
.avatar-face.char-friend {
    box-shadow: 0 0 25px var(--avatar-color, #ffa500),
                0 0 50px var(--avatar-color, #ffa500)33;
    animation: avatarBreathe 3s ease-in-out infinite, avatarBounce 0.6s ease-in-out infinite;
}
.avatar-face.char-friend .avatar-eye { width: 18px; height: 22px; }
.avatar-face.char-friend .avatar-mouth { width: 28px; height: 10px; border-radius: 0 0 14px 14px; }

/* 导师：平稳呼吸 + 沉稳嘴型 */
.avatar-face.char-mentor {
    box-shadow: 0 0 20px var(--avatar-color, #5b9bd5),
                0 0 45px var(--avatar-color, #5b9bd5)28;
    animation: avatarBreathe 6s ease-in-out infinite;
}
.avatar-face.char-mentor .avatar-mouth { width: 20px; height: 6px; border-radius: 2px 2px 10px 10px; }
.avatar-face.char-mentor .avatar-eye { width: 14px; height: 18px; }

@keyframes avatarHeartPulse {
    0%,100% { transform: scale(1); }
    15% { transform: scale(1.04); }
    30% { transform: scale(1); }
}
@keyframes avatarBounce {
    0%,100% { transform: translateY(0); }
    25% { transform: translateY(-2px); }
    75% { transform: translateY(1px); }
}

/* 角色选择样式 */
.character-card {
    display: flex; flex-direction: column; align-items: center; gap: 4px;
    padding: 10px 6px; border-radius: 8px; cursor: pointer;
    background: var(--surface2); border: 1px solid var(--surface3);
    transition: all 0.2s;
    text-align: center;
}
.character-card:hover { border-color: var(--text3); }
.character-card.active { border-color: var(--accent); background: var(--accent); color: #000; }
.character-card .char-avatar {
    width: 40px; height: 40px; border-radius: 50%;
    display: flex; align-items: center; justify-content: center;
    font-size: 20px;
}
.character-card .char-name { font-size: 11px; font-weight: 600; }
.character-card .char-voice {
    font-size: 9px; color: var(--text3); line-height: 1.2;
}
.character-card.active .char-voice { color: inherit; opacity: .7; }
