/* 豆包实时语音对话 - 样式表 */

:root {
    --primary-color: #6366f1;
    --primary-hover: #5558e3;
    --secondary-color: #8b5cf6;
    --success-color: #10b981;
    --danger-color: #ef4444;
    --warning-color: #f59e0b;
    --background: #0f172a;
    --surface: #1e293b;
    --surface-hover: #334155;
    --text: #f1f5f9;
    --text-secondary: #94a3b8;
    --border: #334155;
    --shadow: rgba(0, 0, 0, 0.3);
    --gradient: linear-gradient(135deg, var(--primary-color), var(--secondary-color));
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'Roboto', 'Oxygen',
        'Ubuntu', 'Cantarell', 'Fira Sans', 'Droid Sans', 'Helvetica Neue', sans-serif;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
    background: var(--background);
    color: var(--text);
    line-height: 1.6;
    min-height: 100vh;
    display: flex;
    flex-direction: column;
}

.container {
    max-width: 800px;
    width: 100%;
    margin: 0 auto;
    padding: 20px;
    flex: 1;
}

/* Header */
header {
    text-align: center;
    margin-bottom: 40px;
    padding: 20px 20px 40px;
}

/* 豆包形象 */
.doubao-avatar {
    display: flex;
    justify-content: center;
    align-items: center;
    margin-bottom: 20px;
}

.doubao-img {
    width: 120px;
    height: 120px;
    object-fit: contain;
    image-rendering: auto;
    filter: drop-shadow(0 4px 20px rgba(99, 102, 241, 0.3));
    transition: all 0.3s ease;
}

.doubao-img.talking {
    animation: bounce 0.5s ease-in-out infinite;
}

.doubao-img:hover {
    transform: scale(1.05);
    filter: drop-shadow(0 6px 25px rgba(99, 102, 241, 0.5));
}

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

header h1 {
    font-size: 2.5rem;
    font-weight: 700;
    margin-bottom: 10px;
    background: var(--gradient);
    -webkit-background-clip: text;
    -webkit-text-fill-color: transparent;
    background-clip: text;
}

.subtitle {
    color: var(--text-secondary);
    font-size: 1rem;
}

/* Main */
main {
    display: flex;
    flex-direction: column;
    gap: 24px;
}

/* Status Section */
.status-section {
    display: flex;
    justify-content: center;
}

.status-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px 40px;
    box-shadow: 0 4px 6px var(--shadow);
    border: 1px solid var(--border);
}

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

.status-dot {
    width: 16px;
    height: 16px;
    border-radius: 50%;
    transition: all 0.3s ease;
}

.status-dot.disconnected {
    background: var(--danger-color);
    box-shadow: 0 0 10px var(--danger-color);
}

.status-dot.connecting {
    background: var(--warning-color);
    box-shadow: 0 0 10px var(--warning-color);
    animation: pulse 1.5s infinite;
}

.status-dot.connected {
    background: var(--success-color);
    box-shadow: 0 0 10px var(--success-color);
    animation: pulse 2s infinite;
}

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

.status-text {
    font-size: 1.125rem;
    font-weight: 600;
}

/* Controls Section */
.controls-section {
    display: flex;
    gap: 16px;
    justify-content: center;
}

.btn {
    flex: 1;
    max-width: 200px;
    padding: 16px 32px;
    border: none;
    border-radius: 12px;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: all 0.3s ease;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 4px 6px var(--shadow);
}

.btn-primary {
    background: var(--gradient);
    color: white;
}

.btn-primary:hover:not(:disabled) {
    transform: translateY(-2px);
    box-shadow: 0 6px 12px rgba(99, 102, 241, 0.4);
}

.btn-secondary {
    background: var(--surface);
    color: var(--text);
    border: 2px solid var(--border);
}

.btn-secondary:hover:not(:disabled) {
    background: var(--surface-hover);
    transform: translateY(-2px);
}

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

.btn-icon {
    font-size: 1.2rem;
}

/* Transcript Section */
.transcript-section {
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.transcript-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 24px;
    box-shadow: 0 4px 6px var(--shadow);
    border: 1px solid var(--border);
}

.card-title {
    font-size: 1.25rem;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--text);
}

.transcript-item {
    background: rgba(255, 255, 255, 0.05);
    border-radius: 12px;
    padding: 16px;
    margin-bottom: 12px;
    transition: all 0.3s ease;
}

.transcript-item:last-child {
    margin-bottom: 0;
}

.transcript-item.transcript-user {
    border-left: 4px solid var(--primary-color);
}

.transcript-item.transcript-bot {
    border-left: 4px solid var(--success-color);
}

.transcript-label {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
    font-weight: 600;
    color: var(--text-secondary);
}

.label-icon {
    font-size: 1.2rem;
}

.transcript-content {
    color: var(--text);
    font-size: 1rem;
    line-height: 1.6;
    min-height: 24px;
}

.placeholder {
    color: var(--text-secondary);
    font-style: italic;
}

/* Debug Section */
.debug-section {
    margin-top: 24px;
}

.debug-card {
    background: var(--surface);
    border-radius: 16px;
    padding: 20px;
    box-shadow: 0 4px 6px var(--shadow);
    border: 1px solid var(--border);
}

.debug-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 16px;
}

.debug-header h3 {
    font-size: 1.125rem;
    font-weight: 600;
}

.btn-small {
    padding: 8px 16px;
    background: var(--surface-hover);
    border: 1px solid var(--border);
    border-radius: 8px;
    color: var(--text);
    cursor: pointer;
    font-size: 0.875rem;
    transition: all 0.2s ease;
}

.btn-small:hover {
    background: var(--border);
}

.debug-log {
    background: #000;
    border-radius: 8px;
    padding: 16px;
    font-family: 'Courier New', monospace;
    font-size: 0.875rem;
    color: #10b981;
    max-height: 300px;
    overflow-y: auto;
    line-height: 1.4;
}

.debug-log:empty::before {
    content: "暂无日志";
    color: var(--text-secondary);
}

.debug-log-entry {
    margin-bottom: 4px;
}

.debug-log-entry.error {
    color: #ef4444;
}

.debug-log-entry.warning {
    color: #f59e0b;
}

/* Footer */
footer {
    text-align: center;
    padding: 24px 20px;
    color: var(--text-secondary);
    font-size: 0.875rem;
}

.footer-note {
    margin-top: 8px;
    font-size: 0.8rem;
}

/* Responsive Design */
@media (max-width: 640px) {
    .container {
        padding: 16px;
    }

    header h1 {
        font-size: 2rem;
    }

    .controls-section {
        flex-direction: column;
    }

    .btn {
        max-width: none;
    }

    .status-card {
        padding: 20px 24px;
    }
}
