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

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

.chat-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    max-width: 1200px;
    margin: 0 auto;
    background: white;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    border-radius: 12px;
    overflow: hidden;
}

/* 头部样式 */
.chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    padding: 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.chat-header h1 {
    font-size: 1.5rem;
    font-weight: 600;
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.connection-status {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background-color: #ccc;
    transition: background-color 0.3s ease;
}

.connection-status.connected {
    background-color: #4caf50;
}

.connection-status.disconnected {
    background-color: #f44336;
}

/* 聊天消息区域 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
    display: flex;
    flex-direction: column;
    gap: 15px;
}

.welcome-message {
    text-align: center;
    padding: 40px 20px;
    color: #666;
    background: white;
    border-radius: 10px;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.welcome-message h3 {
    margin-bottom: 10px;
    color: #333;
}

.welcome-message p {
    color: #888;
}

.message {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.3s ease;
}

@keyframes fadeIn {
    from { opacity: 0; transform: translateY(10px); }
    to { opacity: 1; transform: translateY(0); }
}

.avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 18px;
    flex-shrink: 0;
}

.message-user .avatar {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
}

.message-ai .avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.message-system .avatar {
    background: #ff9800;
}

.content {
    flex: 1;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    max-width: 80%;
    word-wrap: break-word;
}

.message-user .content {
    background: #e3f2fd;
    border-bottom-right-radius: 4px;
    margin-left: auto;
}

.message-ai .content {
    background: white;
    border: 1px solid #e0e0e0;
    border-bottom-left-radius: 4px;
}

.message-system .content {
    background: #fff3e0;
    color: #e65100;
    text-align: center;
    border-radius: 18px;
    font-style: italic;
}

.typing-dots {
    display: inline-flex;
    align-items: center;
}

.typing-dots span {
    display: inline-block;
    width: 8px;
    height: 8px;
    background: #666;
    border-radius: 50%;
    margin: 0 2px;
    animation: bounce 1.5s infinite;
}

.typing-dots span:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dots span:nth-child(3) {
    animation-delay: 0.4s;
}

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

/* 音乐播放器样式 */
.music-player {
    background: #2c3e50;
    color: white;
    padding: 15px;
    border-top: 1px solid #34495e;
    display: none; /* 默认隐藏 */
}

.music-player.visible {
    display: block;
}

.player-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 10px;
}

.player-controls button {
    background: #34495e;
    border: none;
    color: white;
    width: 36px;
    height: 36px;
    border-radius: 50%;
    cursor: pointer;
    font-size: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.player-controls button:hover {
    background: #3d566e;
}

#play-pause.playing::before {
    content: '⏸';
}

#play-pause.paused::before {
    content: '▶';
}

#progress-bar, #volume-slider {
    flex: 1;
    height: 5px;
    border: none;
    outline: none;
    background: #34495e;
    border-radius: 5px;
    -webkit-appearance: none;
    appearance: none;
}

#progress-bar::-webkit-slider-thumb, #volume-slider::-webkit-slider-thumb {
    -webkit-appearance: none;
    appearance: none;
    width: 16px;
    height: 16px;
    border-radius: 50%;
    background: #3498db;
    cursor: pointer;
}

.now-playing {
    text-align: center;
    font-size: 14px;
}

#song-title {
    font-weight: bold;
    display: block;
}

#artist-name {
    color: #bdc3c7;
    font-size: 12px;
}

/* 输入区域样式 */
.input-area {
    padding: 20px;
    background: white;
    border-top: 1px solid #e0e0e0;
}

.input-controls {
    display: flex;
    align-items: center;
    gap: 10px;
    margin-bottom: 15px;
}

.voice-btn, .send-btn {
    width: 45px;
    height: 45px;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    transition: all 0.3s ease;
    background: #f0f0f0;
}

.voice-btn:hover, .send-btn:hover {
    background: #e0e0e0;
    transform: scale(1.05);
}

.voice-btn.recording {
    background: #ff6b6b;
    color: white;
    animation: pulse 1s infinite;
}

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

#message-input {
    flex: 1;
    padding: 15px;
    border: 2px solid #e0e0e0;
    border-radius: 25px;
    resize: none;
    font-size: 16px;
    outline: none;
    transition: border-color 0.3s ease;
    max-height: 150px;
}

#message-input:focus {
    border-color: #667eea;
    box-shadow: 0 0 0 3px rgba(102, 126, 234, 0.1);
}

.input-hints {
    display: flex;
    justify-content: space-between;
    align-items: center;
    flex-wrap: wrap;
    gap: 15px;
}

.model-selector {
    display: flex;
    align-items: center;
    gap: 8px;
}

.model-selector label {
    font-weight: 500;
    color: #555;
}

#model-select {
    padding: 8px 12px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    outline: none;
    transition: border-color 0.3s ease;
}

#model-select:focus {
    border-color: #667eea;
}

.toggle-btn {
    padding: 8px 15px;
    border: 2px solid #e0e0e0;
    border-radius: 20px;
    background: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 6px;
    transition: all 0.3s ease;
}

.toggle-btn:hover {
    background: #f0f0f0;
    border-color: #667eea;
}

.toggle-btn.active {
    background: #667eea;
    color: white;
    border-color: #667eea;
}

/* 状态栏样式 */
.status-bar {
    display: flex;
    justify-content: space-around;
    padding: 12px 20px;
    background: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    font-size: 14px;
    color: #666;
}

.status-item {
    display: flex;
    align-items: center;
    gap: 8px;
}

.status-label {
    font-weight: 500;
    color: #555;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .chat-container {
        height: 100vh;
        border-radius: 0;
    }
    
    .chat-header {
        padding: 15px;
    }
    
    .chat-header h1 {
        font-size: 1.2rem;
    }
    
    .input-hints {
        flex-direction: column;
        align-items: stretch;
    }
    
    .model-selector, .voice-controls {
        justify-content: center;
    }
    
    .content {
        max-width: 90%;
    }
    
    .status-bar {
        flex-direction: column;
        gap: 8px;
        text-align: center;
    }
}

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

.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
}

.chat-messages::-webkit-scrollbar-thumb {
    background: #c1c1c1;
    border-radius: 3px;
}

.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #a8a8a8;
}
/* 添加唤醒词相关的CSS样式 */
.wake-word-controls {
    display: flex;
    justify-content: center;
    align-items: center;
    gap: 15px;
    padding: 10px;
    background-color: #f5f5f5;
    border-top: 1px solid #e0e0e0;
    margin-top: 10px;
}

.wake-word-btn {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border: none;
    padding: 10px 20px;
    border-radius: 25px;
    cursor: pointer;
    font-size: 14px;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    gap: 8px;
}

.wake-word-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 5px 15px rgba(0,0,0,0.2);
}

.wake-word-btn:active {
    transform: translateY(0);
}

.wake-word-btn.active {
    background: linear-gradient(135deg, #ff6b6b 0%, #ee5a24 100%);
    animation: pulse 2s infinite;
}

.wake-word-help {
    color: #666;
    font-size: 12px;
}

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

/* 唤醒状态提示样式 */
.wake-status {
    position: fixed;
    top: 50%;
    left: 50%;
    transform: translate(-50%, -50%);
    background: rgba(76, 175, 80, 0.9);
    color: white;
    padding: 20px 30px;
    border-radius: 10px;
    font-size: 18px;
    z-index: 10000;
    box-shadow: 0 4px 20px rgba(0,0,0,0.3);
    animation: fadeInOut 3s ease-in-out;
}

.wake-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
}

.pulse-animation {
    width: 12px;
    height: 12px;
    background: white;
    border-radius: 50%;
    animation: pulseDot 1.5s infinite;
}

@keyframes pulseDot {
    0% { transform: scale(0.8); opacity: 0.7; }
    50% { transform: scale(1.2); opacity: 1; }
    100% { transform: scale(0.8); opacity: 0.7; }
}

@keyframes fadeInOut {
    0% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
    10% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    90% { opacity: 1; transform: translate(-50%, -50%) scale(1); }
    100% { opacity: 0; transform: translate(-50%, -50%) scale(0.8); }
}

/* 更新语音输入按钮样式 */
.voice-btn {
    transition: all 0.3s ease;
}

.voice-btn.recording {
    background-color: #ff6b6b;
    animation: recordingPulse 1.5s infinite;
}

@keyframes recordingPulse {
    0% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0.7); }
    70% { box-shadow: 0 0 0 10px rgba(255, 107, 107, 0); }
    100% { box-shadow: 0 0 0 0 rgba(255, 107, 107, 0); }
}