* {
    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;
    padding: 20px;
}

.container {
    max-width: 1200px;
    margin: 0 auto;
}

header {
    text-align: center;
    color: white;
    margin-bottom: 30px;
}

header h1 {
    font-size: 2.5em;
    margin-bottom: 10px;
}

header p {
    font-size: 1.2em;
    opacity: 0.9;
    margin-bottom: 15px;
}

.config-panel {
    background: rgba(255, 255, 255, 0.2);
    padding: 15px;
    border-radius: 8px;
    display: inline-flex;
    align-items: center;
    gap: 10px;
    margin-top: 15px;
}

.config-panel label {
    color: white;
    font-weight: 500;
}

.config-panel input {
    padding: 8px 12px;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    min-width: 200px;
}

.config-panel button {
    padding: 8px 16px;
    background: white;
    color: #667eea;
    border: none;
    border-radius: 4px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
}

.config-panel button:hover {
    background: #f0f0f0;
}

.tabs {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    justify-content: center;
}

.tab-btn {
    padding: 12px 30px;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 16px;
    cursor: pointer;
    transition: all 0.3s;
}

.tab-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

.tab-btn.active {
    background: white;
    color: #667eea;
    font-weight: bold;
}

.tab-content {
    display: none;
}

.tab-content.active {
    display: block;
}

.card {
    background: white;
    border-radius: 12px;
    padding: 30px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.2);
}

.card h2 {
    color: #333;
    margin-bottom: 20px;
    font-size: 1.8em;
}

.form-group {
    margin-bottom: 20px;
}

.form-group label {
    display: block;
    margin-bottom: 8px;
    color: #555;
    font-weight: 500;
}

.form-group input,
.form-group select,
.form-group textarea {
    width: 100%;
    display: block;
    box-sizing: border-box;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.3s;
}

.form-group input:focus,
.form-group select:focus,
.form-group textarea:focus {
    outline: none;
    border-color: #667eea;
}

.button-group {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
    flex-wrap: wrap;
}

button {
    padding: 12px 24px;
    background: #667eea;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.3s;
    font-weight: 500;
}

button:hover:not(:disabled) {
    background: #5568d3;
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
}

button:disabled {
    background: #ccc;
    cursor: not-allowed;
    transform: none;
}

.status {
    padding: 12px;
    background: #f5f5f5;
    border-radius: 6px;
    margin-bottom: 20px;
    font-size: 14px;
    color: #666;
}

.status.connected {
    background: #e8f5e9;
    color: #2e7d32;
}

.status.recording {
    background: #fff3e0;
    color: #e65100;
}

.result-box {
    margin-top: 20px;
}

.result-box h3 {
    color: #333;
    margin-bottom: 10px;
    font-size: 1.2em;
}

.result-text {
    min-height: 200px;
    max-height: 400px;
    overflow-y: auto;
    padding: 15px;
    background: #f9f9f9;
    border-radius: 6px;
    border: 1px solid #e0e0e0;
    font-size: 14px;
    line-height: 1.6;
    color: #333;
    white-space: pre-wrap;
    word-wrap: break-word;
}

/* Chat 样式 */
.chat-container {
    margin-top: 20px;
}

.chat-messages {
    min-height: 200px;
    max-height: 250px;
    overflow-y: auto;
    padding: 20px;
    background: #f9f9f9;
    border-radius: 8px;
    border: 1px solid #e0e0e0;
    margin-bottom: 15px;
}

.message {
    margin-bottom: 15px;
    padding: 12px 16px;
    border-radius: 8px;
    max-width: 80%;
    word-wrap: break-word;
}

.message.user {
    background: #667eea;
    color: white;
    margin-left: auto;
    text-align: right;
}

.message.assistant {
    background: #e0e0e0;
    color: #333;
}

.message.system {
    background: #fff3e0;
    color: #e65100;
    text-align: center;
    max-width: 100%;
    font-size: 12px;
}

.message .timestamp {
    font-size: 11px;
    opacity: 0.7;
    margin-top: 5px;
}

.chat-input-group {
    display: flex;
    gap: 10px;
}

.chat-input-group input {
    flex: 1;
    padding: 12px;
    border: 2px solid #e0e0e0;
    border-radius: 6px;
    font-size: 14px;
}

.chat-input-group input:focus {
    outline: none;
    border-color: #667eea;
}

.chat-input-group button {
    padding: 12px 30px;
}

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

.result-text::-webkit-scrollbar-track,
.chat-messages::-webkit-scrollbar-track {
    background: #f1f1f1;
    border-radius: 4px;
}

.result-text::-webkit-scrollbar-thumb,
.chat-messages::-webkit-scrollbar-thumb {
    background: #888;
    border-radius: 4px;
}

.result-text::-webkit-scrollbar-thumb:hover,
.chat-messages::-webkit-scrollbar-thumb:hover {
    background: #555;
}

/* 响应式设计 */
@media (max-width: 768px) {
    .container {
        padding: 10px;
    }

    header h1 {
        font-size: 2em;
    }

    .card {
        padding: 20px;
    }

    .message {
        max-width: 90%;
    }

    .config-panel {
        flex-direction: column;
        align-items: stretch;
    }

    .config-panel input {
        min-width: auto;
        width: 100%;
    }
}
