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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background: #ffffff;
    height: 100vh;
    overflow: hidden;
    position: fixed;
    width: 100%;
}

.app {
    display: flex;
    flex-direction: column;
    height: 100%;
    width: 100%;
    background: #ffffff;
}

.header {
    background: #ffffff;
    border-bottom: 1px solid #e9ecef;
    padding: 12px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-shrink: 0;
}

.header-left {
    display: flex;
    align-items: center;
    gap: 10px;
}

.logo-icon {
    width: 32px;
    height: 32px;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
}

.header-left h1 {
    font-size: 20px;
    font-weight: 600;
    color: #1a1a1a;
}

.badge {
    font-size: 11px;
    padding: 4px 10px;
    background: #f1f3f5;
    border-radius: 20px;
    color: #495057;
}

.chat-main {
    flex: 1;
    overflow: hidden;
}

.messages-container {
    height: 100%;
    overflow-y: auto;
    padding: 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.message {
    display: flex;
    gap: 12px;
    animation: fadeIn 0.2s ease;
}

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

.message.user {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.message.assistant .message-avatar {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
}

.message.user .message-avatar {
    background: #1a1a1a;
}

.message-content {
    max-width: 75%;
    min-width: 0;
}

.message-header {
    display: flex;
    align-items: baseline;
    gap: 8px;
    margin-bottom: 6px;
}

.message-role {
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a;
}

.message-time {
    font-size: 11px;
    color: #868e96;
}

.message-text {
    font-size: 14px;
    line-height: 1.5;
    color: #2c3e50;
    word-wrap: break-word;
}

.message.assistant .message-text {
    background: #f8f9fa;
    padding: 12px 16px;
    border-radius: 16px;
    border-top-left-radius: 4px;
}

.message.user .message-text {
    background: #1a1a1a;
    color: white;
    padding: 12px 16px;
    border-radius: 16px;
    border-top-right-radius: 4px;
}

.message-text pre {
    margin: 10px 0;
    background: #1e1e1e;
    border-radius: 10px;
    overflow-x: auto;
}

.message-text pre code {
    display: block;
    padding: 14px;
    font-family: monospace;
    font-size: 12px;
    color: #d4d4d4;
    overflow-x: auto;
    white-space: pre-wrap;
    word-break: break-word;
}

.code-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #2d2d2d;
    font-size: 11px;
    color: #9e9e9e;
}

.copy-btn {
    background: transparent;
    border: none;
    color: #9e9e9e;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
}

.typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
}

.typing-indicator span {
    width: 8px;
    height: 8px;
    background: #adb5bd;
    border-radius: 50%;
    animation: typingBlink 1.4s infinite;
}

.typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
.typing-indicator span:nth-child(3) { animation-delay: 0.4s; }

@keyframes typingBlink {
    0%, 60%, 100% { opacity: 0.3; }
    30% { opacity: 1; }
}

.input-footer {
    background: #ffffff;
    border-top: 1px solid #e9ecef;
    padding: 12px 20px 20px;
}

.input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.input-wrapper textarea {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #dee2e6;
    border-radius: 24px;
    font-family: inherit;
    font-size: 14px;
    resize: none;
    outline: none;
    background: #f8f9fa;
    max-height: 100px;
}

.input-wrapper textarea:focus {
    border-color: #667eea;
    background: #ffffff;
}

.send-btn {
    width: 44px;
    height: 44px;
    background: #1a1a1a;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
}

.send-btn:disabled {
    background: #ced4da;
    cursor: not-allowed;
}

.status-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 10px;
    margin-left: 8px;
}

.status-dot {
    width: 6px;
    height: 6px;
    border-radius: 50%;
    background: #51cf66;
}

.status-dot.thinking {
    background: #fcc419;
    animation: pulse 1s infinite;
}

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

.status-bar span {
    font-size: 12px;
    color: #868e96;
}

::-webkit-scrollbar {
    width: 6px;
}

::-webkit-scrollbar-track {
    background: #f1f3f5;
}

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