* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
}

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    min-height: 100vh;
    display: flex;
    justify-content: center;
    align-items: center;
    padding: 20px;
}

.container {
    width: 100%;
    max-width: 480px;
    height: 90vh;
    max-height: 800px;
    background: white;
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

/* Header */
header {
    padding: 20px;
    background: #4a5568;
    color: white;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

header h1 {
    font-size: 18px;
    font-weight: 600;
}

.status {
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 12px;
    font-weight: 500;
}

.status.connected {
    background: #48bb78;
}

.status.disconnected {
    background: #f56565;
}

.status.processing {
    background: #ed8936;
}

/* Chat Container */
main {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #f7fafc;
}

.message {
    max-width: 85%;
    padding: 12px 16px;
    border-radius: 18px;
    line-height: 1.5;
    font-size: 15px;
    animation: fadeIn 0.3s ease;
}

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

.message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant {
    align-self: flex-start;
    background: white;
    color: #2d3748;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.message.system {
    align-self: center;
    background: #edf2f7;
    color: #718096;
    font-size: 13px;
    padding: 8px 16px;
}

/* Footer */
footer {
    padding: 20px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 12px;
    border-top: 1px solid #e2e8f0;
    background: white;
}

.controls {
    display: flex;
    gap: 15px;
    align-items: center;
}

.call-button {
    width: 80px;
    height: 80px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #48bb78 0%, #38a169 100%);
    color: white;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    box-shadow: 0 4px 15px rgba(72, 187, 120, 0.4);
}

.call-button:hover {
    transform: scale(1.05);
    box-shadow: 0 6px 20px rgba(72, 187, 120, 0.5);
}

.call-button:active {
    transform: scale(0.98);
}

.call-button.active {
    background: linear-gradient(135deg, #f56565 0%, #e53e3e 100%);
    box-shadow: 0 4px 15px rgba(245, 101, 101, 0.4);
}

.call-button .icon {
    font-size: 28px;
}

.call-button .text {
    font-size: 11px;
    margin-top: 4px;
    font-weight: 500;
}

#recording-indicator {
    display: flex;
    align-items: center;
    gap: 10px;
    color: #f56565;
    font-size: 14px;
    font-weight: 500;
}

#recording-indicator.hidden {
    display: none;
}

.pulse {
    width: 12px;
    height: 12px;
    background: #f56565;
    border-radius: 50%;
    animation: pulse 1s infinite;
}

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

.hint {
    color: #a0aec0;
    font-size: 13px;
}

.hint kbd {
    background: #edf2f7;
    padding: 2px 8px;
    border-radius: 4px;
    font-family: inherit;
    font-size: 12px;
    border: 1px solid #e2e8f0;
}

/* Scrollbar */
main::-webkit-scrollbar {
    width: 6px;
}

main::-webkit-scrollbar-track {
    background: transparent;
}

main::-webkit-scrollbar-thumb {
    background: #cbd5e0;
    border-radius: 3px;
}

main::-webkit-scrollbar-thumb:hover {
    background: #a0aec0;
}

/* VAD 指示器 */
.vad-indicator {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 10px 16px;
    background: #f0f4f8;
    border-radius: 12px;
    width: 100%;
    max-width: 280px;
}

.vad-indicator.hidden {
    display: none;
}

.volume-bar {
    flex: 1;
    height: 8px;
    background: #e2e8f0;
    border-radius: 4px;
    overflow: hidden;
    position: relative;
}

.volume-bar::after {
    content: '';
    display: block;
    height: 100%;
    background: linear-gradient(90deg, #48bb78, #38a169);
    width: var(--volume, 0%);
    transition: width 0.1s ease;
    border-radius: 4px;
}

#vad-status {
    font-size: 12px;
    color: #4a5568;
    white-space: nowrap;
    min-width: 100px;
}

/* 状态消息样式 */
.message.system.status-success small {
    color: #38a169;
}

.message.system.status-error small {
    color: #e53e3e;
}

.message.system.status-warn small {
    color: #d69e2e;
}

/* Responsive */
@media (max-width: 520px) {
    body {
        padding: 0;
    }

    .container {
        height: 100vh;
        max-height: none;
        border-radius: 0;
    }
}
