/* 动画样式 */

/* 淡入动画 */
@keyframes fadeIn {
    from { 
        opacity: 0; 
        transform: translateY(10px); 
    }
    to { 
        opacity: 1; 
        transform: translateY(0); 
    }
}

/* 旋转动画 */
@keyframes spin {
    to { 
        transform: rotate(360deg); 
    }
}

/* 脉冲动画 */
@keyframes pulse {
    0% { 
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0.7); 
    }
    70% { 
        box-shadow: 0 0 0 10px rgba(239, 68, 68, 0); 
    }
    100% { 
        box-shadow: 0 0 0 0 rgba(239, 68, 68, 0); 
    }
}

/* 打字指示器动画 */
@keyframes typing {
    0%, 80%, 100% { 
        transform: scale(0.8); 
        opacity: 0.5; 
    }
    40% { 
        transform: scale(1.2); 
        opacity: 1; 
    }
}

/* 生成中动画 */
@keyframes generating {
    0%, 80%, 100% { 
        transform: scale(0.8); 
        opacity: 0.5; 
    }
    40% { 
        transform: scale(1.2); 
        opacity: 1; 
    }
}

/* 加载动画 */
@keyframes loading {
    0%, 80%, 100% { 
        transform: scale(0.8); 
        opacity: 0.5; 
    }
    40% { 
        transform: scale(1.2); 
        opacity: 1; 
    }
}

/* 录音动画 */
@keyframes recording {
    0%, 100% { 
        opacity: 1; 
    }
    50% { 
        opacity: 0.5; 
    }
}

/* 应用动画类 */
.fade-in {
    animation: fadeIn 0.3s ease;
}

.spin {
    animation: spin 0.8s linear infinite;
}

.voice-btn.recording {
    animation: pulse 1.5s infinite;
}

.voice-btn.recording::after {
    content: "点击结束";
    position: absolute;
    bottom: -30px;
    left: 50%;
    transform: translateX(-50%);
    font-size: 0.75rem;
    color: var(--error-color);
    white-space: nowrap;
    font-weight: 500;
}

/* 打字指示器 */
.typing-indicator {
    display: flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--text-tertiary);
    font-style: italic;
    padding: var(--spacing-sm) var(--spacing-lg);
}

.typing-dots {
    display: flex;
    gap: 3px;
}

.typing-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: typing 1.4s infinite ease-in-out;
}

.typing-dot:nth-child(1) { 
    animation-delay: -0.32s; 
}

.typing-dot:nth-child(2) { 
    animation-delay: -0.16s; 
}

/* 生成中指示器 */
.generating-indicator {
    display: inline-flex;
    align-items: center;
    gap: var(--spacing-sm);
    color: var(--primary-color);
    font-size: 14px;
    font-weight: 500;
    padding: var(--spacing-sm) 0;
}

.generating-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: generating 1.4s infinite ease-in-out;
}

.generating-dot:nth-child(1) { 
    animation-delay: -0.32s; 
}

.generating-dot:nth-child(2) { 
    animation-delay: -0.16s; 
}

/* 生成中断提示 */
.generation-interrupted {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 12px;
    margin: 8px 0;
    background: rgba(107, 114, 128, 0.1);
    border-radius: 8px;
    color: #6b7280;
    font-size: 13px;
    font-weight: 500;
}

.generation-interrupted svg {
    flex-shrink: 0;
    opacity: 0.8;
}

/* 加载指示器 */
.loading-indicator {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--primary-color);
    font-weight: 500;
}

.loading-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--primary-color);
    animation: loading 1.4s infinite ease-in-out;
}

.loading-dot:nth-child(1) { 
    animation-delay: -0.32s; 
}

.loading-dot:nth-child(2) { 
    animation-delay: -0.16s; 
}

/* 录音指示器 */
.recording-indicator {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: var(--spacing-sm);
    color: var(--error-color);
    font-weight: 500;
}

.recording-dot {
    width: 10px;
    height: 10px;
    border-radius: 50%;
    background: var(--error-color);
    animation: recording 1.5s infinite;
}
