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

body {
    font-family: 'Segoe UI', Tahoma, Geneva, Verdana, sans-serif;
    background: #ffffff;
    min-height: 100vh;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
    background: #ffffff;
    border: 2px solid #4CAF50;
    border-radius: 15px;
    box-shadow: 0 4px 20px rgba(76, 175, 80, 0.1);
    overflow: hidden;
}

.header {
    background: #ffffff;
    color: #333333;
    padding: 30px 20px;
    text-align: center;
    border-bottom: 2px solid #4CAF50;
}

.header h1 {
    margin-bottom: 15px;
    font-size: 2em;
    color: #4CAF50;
}

.user-info {
    display: flex;
    gap: 15px;
    justify-content: center;
    flex-wrap: wrap;
    margin-top: 20px;
}

.user-info input, .user-info select {
    padding: 12px 16px;
    border: 2px solid #4CAF50;
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
    color: #333333;
    transition: all 0.3s ease;
}

.user-info input:focus, .user-info select:focus {
    outline: none;
    border-color: #45a049;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.user-info button {
    padding: 12px 20px;
    border: none;
    border-radius: 8px;
    background: #4CAF50;
    color: white;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    font-size: 14px;
}

.user-info button:hover:not(:disabled) {
    background: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.user-info button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.chat-container {
    height: 500px;
    display: flex;
    flex-direction: column;
    border-top: 1px solid #e8f5e8;
}

.messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    background: #fafafa;
}

.message {
    margin-bottom: 15px;
    padding: 15px;
    border-radius: 12px;
    max-width: 80%;
    animation: fadeIn 0.3s ease-in;
    border: 1px solid #e8f5e8;
}

.message.user {
    background: #f1f8e9;
    margin-left: auto;
    border-bottom-right-radius: 5px;
    border-color: #4CAF50;
    margin-right: 0;
    float: right;
    clear: both;
}

.message.ai {
    background: #ffffff;
    border-bottom-left-radius: 5px;
    border-color: #4CAF50;
    border-left: 4px solid #4CAF50;
}

.message.transcription {
    background: #fff8e1;
    border-left: 4px solid #4CAF50;
    border-color: #4CAF50;
}

.message.system {
    background: #f1f8e9;
    text-align: center;
    margin: 0 auto;
    font-style: italic;
    border-color: #4CAF50;
}

.message.error {
    background: #ffebee;
    border-left: 4px solid #f44336;
    color: #c62828;
    border-color: #f44336;
}

.message-header {
    display: flex;
    justify-content: space-between;
    margin-bottom: 5px;
    font-size: 12px;
    opacity: 0.7;
}

.sender {
    font-weight: bold;
}

.message-content {
    font-size: 14px;
    line-height: 1.4;
}

.controls {
    padding: 25px;
    background: #ffffff;
    border-top: 2px solid #4CAF50;
}

.voice-controls, .text-controls, .audio-controls {
    display: flex;
    gap: 15px;
    margin-bottom: 20px;
    align-items: center;
    flex-wrap: wrap;
}

.voice-controls button {
    padding: 12px 24px;
    border: 2px solid #4CAF50;
    border-radius: 25px;
    font-size: 14px;
    font-weight: bold;
    cursor: pointer;
    transition: all 0.3s ease;
    background: #ffffff;
    color: #4CAF50;
}

#recordBtn {
    background: #4CAF50;
    color: white;
    border-color: #4CAF50;
}

#recordBtn:hover:not(:disabled) {
    background: #45a049;
    border-color: #45a049;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

#stopBtn {
    background: #ffffff;
    color: #f44336;
    border-color: #f44336;
}

#stopBtn:hover:not(:disabled) {
    background: #f44336;
    color: white;
    border-color: #f44336;
    transform: scale(1.05);
    box-shadow: 0 4px 12px rgba(244, 67, 54, 0.3);
}

.recording-status {
    font-weight: bold;
    padding: 8px 16px;
    border-radius: 20px;
    border: 2px solid #4CAF50;
    background: #f1f8e9;
    color: #4CAF50;
}

.recording-status.recording {
    background: #ffebee;
    color: #c62828;
    border-color: #f44336;
    animation: pulse 1s infinite;
}

.text-controls input {
    flex: 1;
    padding: 12px 16px;
    border: 2px solid #4CAF50;
    border-radius: 25px;
    font-size: 14px;
    background: #ffffff;
    transition: all 0.3s ease;
}

.text-controls input:focus {
    outline: none;
    border-color: #45a049;
    box-shadow: 0 0 0 3px rgba(76, 175, 80, 0.1);
}

.text-controls button, .audio-controls select {
    padding: 12px 24px;
    border: 2px solid #4CAF50;
    border-radius: 25px;
    background: #4CAF50;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s ease;
    font-weight: bold;
}

.text-controls button:hover:not(:disabled) {
    background: #45a049;
    border-color: #45a049;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(76, 175, 80, 0.3);
}

.audio-controls {
    display: flex;
    align-items: center;
    gap: 15px;
    margin-top: 15px;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 12px;
    border: 1px solid #e8f5e8;
}

.audio-controls label {
    font-weight: bold;
    color: #4CAF50;
}

.audio-controls select {
    padding: 8px 12px;
    border: 2px solid #4CAF50;
    border-radius: 8px;
    font-size: 14px;
    background: #ffffff;
    color: #333333;
}

.audio-controls button {
    padding: 8px 16px;
    background: #f44336;
    color: white;
    border: 2px solid #f44336;
    border-radius: 8px;
    cursor: pointer;
    font-size: 14px;
    font-weight: bold;
    transition: all 0.3s ease;
}

.audio-controls button:hover {
    background: #da190b;
    border-color: #da190b;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(244, 67, 54, 0.3);
}

button:disabled {
    opacity: 0.5;
    cursor: not-allowed;
    transform: none !important;
}

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

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

@media (max-width: 768px) {
    body {
        padding: 10px;
    }
    
    .container {
        border-radius: 10px;
    }
    
    .header {
        padding: 20px 15px;
    }
    
    .header h1 {
        font-size: 1.5em;
    }
    
    .user-info {
        flex-direction: column;
        gap: 10px;
    }
    
    .user-info input, .user-info select, .user-info button {
        width: 100%;
        max-width: 300px;
    }

    .voice-controls, .text-controls {
        flex-direction: column;
        gap: 10px;
    }
    
    .voice-controls button, .text-controls button {
        width: 100%;
        max-width: 200px;
    }
    
    .text-controls input {
        width: 100%;
        margin-bottom: 10px;
    }

    .message {
        max-width: 95%;
        padding: 12px;
    }
    
    .controls {
        padding: 15px;
    }
    
    .audio-controls {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
    }
    
    .audio-controls select, .audio-controls button {
        width: 100%;
    }
}

@media (max-width: 480px) {
    .header h1 {
        font-size: 1.2em;
    }
    
    .user-info input, .user-info select, .user-info button {
        font-size: 16px; /* 防止iOS缩放 */
    }
    
    .message {
        font-size: 13px;
    }
}