/* 全局样式 */
* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

:root {
    --primary-color: #667eea;
    --secondary-color: #764ba2;
    --accent-color: #f093fb;
    --bg-dark: #0f0e17;
    --bg-card: #1a1a2e;
    --text-primary: #ffffff;
    --text-secondary: #a7a9be;
    --success-color: #10b981;
    --error-color: #ef4444;
}

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: var(--text-primary);
    overflow-x: hidden;
    min-height: 100vh;
}

/* 粒子背景 */
#particles {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: -1;
    background: radial-gradient(circle at 20% 50%, rgba(102, 126, 234, 0.2) 0%, transparent 50%),
                radial-gradient(circle at 80% 80%, rgba(240, 147, 251, 0.2) 0%, transparent 50%);
    animation: pulse 8s ease-in-out infinite;
}

@keyframes pulse {
    0%, 100% { opacity: 0.5; }
    50% { opacity: 1; }
}

/* 主容器 */
.container {
    max-width: 1400px;
    margin: 0 auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    min-height: 100vh;
}

/* 顶部标题 */
.header {
    text-align: center;
    margin-bottom: 20px;
    animation: fadeInDown 0.8s ease;
}

.title {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
}

.gradient-text {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 50%, #f093fb 100%);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
    animation: gradient-shift 3s ease infinite;
    background-size: 200% 200%;
}

@keyframes gradient-shift {
    0%, 100% { background-position: 0% 50%; }
    50% { background-position: 100% 50%; }
}

.subtitle {
    display: block;
    font-size: 1rem;
    font-weight: 400;
    color: var(--text-secondary);
    margin-top: 5px;
}

/* 状态指示器 */
.status-indicator {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    padding: 8px 16px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(10px);
    border-radius: 20px;
    margin-top: 10px;
}

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

.status-indicator.connected .status-dot {
    background: var(--success-color);
}

@keyframes pulse-dot {
    0%, 100% { opacity: 1; transform: scale(1); }
    50% { opacity: 0.5; transform: scale(1.2); }
}

.status-text {
    font-size: 0.9rem;
    color: var(--text-secondary);
}

/* 双人物对话场景 */
.dual-scene {
    flex: 1;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 40px;
    padding: 40px;
    animation: fadeIn 1s ease;
}

/* 角色容器 */
.character-container {
    position: relative;
    flex: 1;
    height: 600px;
    background: transparent;
    overflow: visible;
    transition: all 0.5s ease;
}

.character-container:hover {
    transform: translateY(-10px) scale(1.05);
}

/* 用户角色（蓝色系） */
.user-character {
    /* 无边框，纯透明 */
}

/* AI角色（紫色系） */
.ai-character {
    /* 无边框，纯透明 */
}

/* Canvas */
#user-canvas, #ai-canvas {
    width: 100%;
    height: 100%;
}

/* 角色标签 */
.character-label {
    position: absolute;
    bottom: -50px;
    left: 50%;
    transform: translateX(-50%);
    padding: 8px 24px;
    background: rgba(0, 0, 0, 0.4);
    backdrop-filter: blur(8px);
    border-radius: 20px;
    font-size: 0.95rem;
    font-weight: 600;
    text-transform: uppercase;
    letter-spacing: 2px;
    opacity: 0.9;
    transition: all 0.3s ease;
    pointer-events: none;
}

.character-container:hover .character-label {
    opacity: 1;
    bottom: -55px;
}

/* 中间控制区 */
.center-control {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 20px;
    z-index: 10;
}

/* 说话指示器 */
.speaking-indicator {
    display: none;
    animation: fadeIn 0.3s ease;
}

.speaking-indicator.active {
    display: flex;
    justify-content: center;
}

.sound-wave {
    display: flex;
    gap: 4px;
    align-items: center;
    justify-content: center;
}

.sound-wave span {
    width: 4px;
    height: 20px;
    background: linear-gradient(135deg, var(--primary-color), var(--accent-color));
    border-radius: 2px;
    animation: sound-wave 0.8s ease-in-out infinite;
}

.sound-wave span:nth-child(1) { animation-delay: 0s; }
.sound-wave span:nth-child(2) { animation-delay: 0.1s; }
.sound-wave span:nth-child(3) { animation-delay: 0.2s; }
.sound-wave span:nth-child(4) { animation-delay: 0.3s; }
.sound-wave span:nth-child(5) { animation-delay: 0.4s; }

@keyframes sound-wave {
    0%, 100% { height: 20px; }
    50% { height: 40px; }
}

/* 状态提示 */
.status-message {
    position: absolute;
    top: 20px;
    left: 50%;
    transform: translateX(-50%);
    padding: 10px 20px;
    background: rgba(102, 126, 234, 0.9);
    backdrop-filter: blur(10px);
    border-radius: 10px;
    font-size: 0.9rem;
    opacity: 0;
    transition: opacity 0.3s ease;
}

.status-message.show {
    opacity: 1;
}

/* 移除聊天区域样式 - 不需要了 */

/* 大语音唤醒按钮 */
.voice-wake-button-large {
    width: 120px;
    height: 120px;
    background: rgba(255, 255, 255, 0.1);
    border: 4px solid rgba(255, 255, 255, 0.3);
    border-radius: 50%;
    color: var(--text-primary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.4s ease;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
}

.voice-wake-button-large:hover {
    background: rgba(255, 255, 255, 0.2);
    transform: scale(1.1);
    box-shadow: 0 15px 50px rgba(0, 0, 0, 0.4);
}

.voice-wake-button-large.active {
    background: linear-gradient(135deg, #ff6b6b, #ee5a6f);
    border-color: #ff6b6b;
    animation: pulse-voice 2s ease infinite;
}

@keyframes pulse-voice {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7);
    }
    50% { 
        box-shadow: 0 0 0 15px rgba(255, 107, 107, 0);
    }
}

.voice-wake-button-large.listening {
    background: linear-gradient(135deg, #10b981, #059669);
    border-color: #10b981;
    animation: pulse-listening 1.5s ease infinite;
}

@keyframes pulse-listening {
    0%, 100% { 
        box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7);
    }
    50% { 
        box-shadow: 0 0 0 15px rgba(16, 185, 129, 0);
    }
}

/* 语音状态提示 */
.voice-status {
    padding: 12px 24px;
    background: rgba(255, 255, 255, 0.1);
    backdrop-filter: blur(20px);
    border-radius: 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    font-size: 1rem;
    animation: fadeIn 0.3s ease;
    box-shadow: 0 5px 20px rgba(0, 0, 0, 0.3);
}

.voice-status .status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--success-color);
    animation: pulse-dot 2s ease infinite;
}

.voice-status.awake .status-dot {
    background: #ff6b6b;
}

.voice-status .status-text {
    color: var(--text-secondary);
}

/* 对话气泡 */
.speech-bubble {
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    max-width: 300px;
    padding: 20px 25px;
    background: rgba(255, 255, 255, 0.95);
    border-radius: 20px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.3);
    animation: bubbleIn 0.4s ease;
    z-index: 5;
}

@keyframes bubbleIn {
    from {
        opacity: 0;
        transform: translateY(-50%) scale(0.8);
    }
    to {
        opacity: 1;
        transform: translateY(-50%) scale(1);
    }
}

.speech-bubble p {
    margin: 0;
    color: #2c3e50;
    font-size: 1rem;
    line-height: 1.6;
}

/* 用户气泡（左侧） */
.user-bubble {
    left: 100%;
    margin-left: 20px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.user-bubble::before {
    content: '';
    position: absolute;
    left: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-right: 15px solid #3b82f6;
}

.user-bubble p {
    color: #ffffff;
}

/* AI气泡（右侧） */
.ai-bubble {
    right: 100%;
    margin-right: 20px;
    background: linear-gradient(135deg, #a78bfa, #8b5cf6);
}

.ai-bubble::before {
    content: '';
    position: absolute;
    right: -15px;
    top: 50%;
    transform: translateY(-50%);
    width: 0;
    height: 0;
    border-top: 15px solid transparent;
    border-bottom: 15px solid transparent;
    border-left: 15px solid #a78bfa;
}

.ai-bubble p {
    color: #ffffff;
}

/* 移除清除按钮 - 界面更简洁 */

/* 动画 */
@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fadeInDown {
    from {
        opacity: 0;
        transform: translateY(-20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

/* 响应式 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }
    
    .title {
        font-size: 1.8rem;
    }
    
    .avatar-container {
        height: 300px;
    }
    
    .chat-container {
        max-height: 200px;
    }
}

/* 滚动条样式 */
.chat-messages::-webkit-scrollbar {
    width: 8px;
}

.chat-messages::-webkit-scrollbar-track {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: rgba(102, 126, 234, 0.5);
    border-radius: 10px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(102, 126, 234, 0.7);
}
