:root {
    --bg-color: #0f172a;
    --panel-bg: #1e293b;
    --text-main: #f8fafc;
    --text-muted: #94a3b8;
    --accent: #3b82f6;
    --accent-hover: #2563eb;
    --system-msg: #334155;
    --ai-msg: #1e3a8a;
    --user-msg: #065f46;
}

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

body {
    font-family: 'Inter', sans-serif;
    background-color: var(--bg-color);
    color: var(--text-main);
    display: flex;
    justify-content: center;
    align-items: center;
    height: 100vh;
}

.app-container {
    width: 900px;
    height: 600px;
    background-color: var(--panel-bg);
    border-radius: 16px;
    box-shadow: 0 25px 50px -12px rgba(0, 0, 0, 0.5);
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

header {
    padding: 20px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.brand {
    display: flex;
    align-items: center;
    gap: 14px;
}

h1 {
    font-size: 1.25rem;
    font-weight: 600;
    letter-spacing: -0.02em;
}

.med-badge {
    display: inline-flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 9999px;
    font-size: 0.8rem;
    font-weight: 500;
    background: rgba(59, 130, 246, 0.15);
    color: #93c5fd;
    border: 1px solid rgba(59, 130, 246, 0.35);
}

.status-indicator {
    display: flex;
    align-items: center;
    gap: 8px;
    font-size: 0.9rem;
    color: var(--text-muted);
}

.dot {
    width: 10px;
    height: 10px;
    background-color: #10b981;
    border-radius: 50%;
    display: inline-block;
}

.dot.processing {
    background-color: #f59e0b;
    animation: pulse 1.5s infinite;
}

.dot.speaking {
    background-color: var(--accent);
    animation: pulse 1s infinite;
}

@keyframes pulse {
    0% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 0, 0, 0.7); }
    70% { transform: scale(1); box-shadow: 0 0 0 10px rgba(0, 0, 0, 0); }
    100% { transform: scale(0.95); box-shadow: 0 0 0 0 rgba(0, 0, 0, 0); }
}

main {
    display: flex;
    flex: 1;
    overflow: hidden;
}

.video-container {
    flex: 1;
    padding: 20px;
    display: flex;
    justify-content: center;
    align-items: center;
    border-right: 1px solid rgba(255, 255, 255, 0.1);
}

.avatar-placeholder {
    width: 100%;
    max-width: 300px;
    aspect-ratio: 3/4;
    background: linear-gradient(145deg, #1e293b, #0f172a);
    border-radius: 20px;
    display: flex;
    flex-direction: column;
    justify-content: center;
    align-items: center;
    position: relative;
    border: 2px solid rgba(255, 255, 255, 0.05);
}

.avatar-placeholder.active {
    border-color: var(--accent);
    box-shadow: 0 0 30px rgba(59, 130, 246, 0.2);
}

.avatar-circle {
    width: 90px;
    height: 90px;
    border-radius: 50%;
    background-color: #334155;
    display: flex;
    justify-content: center;
    align-items: center;
    font-size: 1.6rem;
    font-weight: 600;
    color: var(--text-muted);
    margin-bottom: 10px;
    transition: all 0.3s ease;
}

.avatar-meta {
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 2px;
    margin-bottom: 16px;
}

.doctor-name {
    font-size: 0.95rem;
    font-weight: 600;
    color: var(--text-main);
}

.doctor-title {
    font-size: 0.75rem;
    color: var(--text-muted);
}

.avatar-placeholder.active .avatar-circle {
    background-color: var(--accent);
    color: white;
}

.waveform {
    display: flex;
    gap: 4px;
    height: 30px;
    align-items: center;
    opacity: 0;
    transition: opacity 0.3s;
}

.waveform.active {
    opacity: 1;
}

.waveform span {
    display: block;
    width: 4px;
    height: 4px;
    background-color: var(--text-main);
    border-radius: 2px;
}

.waveform.active span {
    animation: wave 1s infinite ease-in-out;
}

.waveform span:nth-child(2) { animation-delay: 0.1s; }
.waveform span:nth-child(3) { animation-delay: 0.2s; }
.waveform span:nth-child(4) { animation-delay: 0.3s; }
.waveform span:nth-child(5) { animation-delay: 0.4s; }

@keyframes wave {
    0%, 100% { height: 4px; }
    50% { height: 25px; }
}

.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.messages {
    flex: 1;
    padding: 20px;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

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

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

.message.system {
    background-color: var(--system-msg);
    color: var(--text-muted);
    align-self: center;
    font-size: 0.8rem;
}

.message.ai {
    background-color: var(--ai-msg);
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.message.user {
    background-color: var(--user-msg);
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.quick-questions {
    padding: 12px 20px;
    background-color: rgba(15, 23, 42, 0.45);
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    display: flex;
    flex-direction: column;
    gap: 8px;
    animation: fadeIn 0.3s ease;
}

.qq-label {
    font-size: 0.72rem;
    text-transform: uppercase;
    letter-spacing: 0.06em;
    color: var(--text-muted);
    font-weight: 600;
}

.qq-chips {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
}

.chip {
    flex: 0 1 auto;
    padding: 6px 12px;
    border-radius: 9999px;
    font-size: 0.8rem;
    background: rgba(255, 255, 255, 0.06);
    border: 1px solid rgba(255, 255, 255, 0.15);
    color: var(--text-main);
    cursor: pointer;
    transition: all 0.2s ease;
}

.chip:hover:not(:disabled) {
    background: rgba(59, 130, 246, 0.2);
    border-color: var(--accent);
    color: #ffffff;
    transform: translateY(-1px);
}

.chip:disabled {
    opacity: 0.4;
    cursor: not-allowed;
}

.controls {
    padding: 20px;
    border-top: 1px solid rgba(255, 255, 255, 0.1);
    display: flex;
    gap: 10px;
}

button {
    flex: 1;
    padding: 12px;
    border: none;
    border-radius: 8px;
    font-size: 0.95rem;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
}

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

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

.primary-btn:hover:not(:disabled) {
    background-color: var(--accent-hover);
}

.secondary-btn {
    background-color: transparent;
    color: var(--text-main);
    border: 1px solid rgba(255, 255, 255, 0.2);
}

.secondary-btn:hover:not(:disabled) {
    background-color: rgba(255, 255, 255, 0.05);
}
