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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, sans-serif;
    background: #1a1a2e;
    color: #eee;
    height: 100vh;
    display: flex;
    justify-content: center;
}

.chat-container {
    width: 100%;
    max-width: 800px;
    height: 100vh;
    display: flex;
    flex-direction: column;
}

.chat-header {
    padding: 16px 24px;
    background: #16213e;
    border-bottom: 1px solid #0f3460;
}

.chat-header h1 {
    font-size: 1.2rem;
    font-weight: 600;
    color: #e94560;
}

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

.message {
    display: flex;
    max-width: 80%;
}

.message.user {
    align-self: flex-end;
}

.message.assistant {
    align-self: flex-start;
}

.message-content {
    padding: 12px 16px;
    border-radius: 16px;
    line-height: 1.5;
    word-wrap: break-word;
}

.message-content p {
    margin: 0 0 8px 0;
}

.message-content p:last-child {
    margin-bottom: 0;
}

.message-content code {
    background: #0d1117;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 0.9em;
}

.message-content pre {
    background: #0d1117;
    border-radius: 8px;
    padding: 12px 16px;
    overflow-x: auto;
    margin: 8px 0;
}

.message-content pre code {
    background: none;
    padding: 0;
    font-size: 0.85em;
    color: #e6edf3;
}

.message-content ul,
.message-content ol {
    margin: 8px 0;
    padding-left: 24px;
}

.message-content li {
    margin: 4px 0;
}

.message-content blockquote {
    border-left: 3px solid #e94560;
    padding-left: 12px;
    margin: 8px 0;
    color: #aaa;
}

.message-content a {
    color: #e94560;
    text-decoration: none;
}

.message-content a:hover {
    text-decoration: underline;
}

.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4 {
    margin: 12px 0 6px 0;
}

.message-content table {
    border-collapse: collapse;
    margin: 8px 0;
    width: 100%;
}

.message-content th,
.message-content td {
    border: 1px solid #0f3460;
    padding: 6px 12px;
    text-align: left;
}

.message-content th {
    background: #0f3460;
}

.message.user .message-content {
    background: #e94560;
    color: white;
    border-bottom-right-radius: 4px;
}

.message.assistant .message-content {
    background: #16213e;
    color: #eee;
    border-bottom-left-radius: 4px;
}

.message-thinking .message-content {
    color: #888;
    font-style: italic;
}

.input-area {
    display: flex;
    gap: 12px;
    padding: 16px 24px;
    background: #16213e;
    border-top: 1px solid #0f3460;
}

#user-input {
    flex: 1;
    padding: 12px 16px;
    border: 1px solid #0f3460;
    border-radius: 12px;
    background: #1a1a2e;
    color: #eee;
    font-size: 1rem;
    outline: none;
    transition: border-color 0.2s;
}

#user-input:focus {
    border-color: #e94560;
}

#user-input::placeholder {
    color: #666;
}

#send-btn {
    padding: 12px 24px;
    border: none;
    border-radius: 12px;
    background: #e94560;
    color: white;
    font-size: 1rem;
    font-weight: 600;
    cursor: pointer;
    transition: background 0.2s;
}

#send-btn:hover {
    background: #c73652;
}

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

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

.messages::-webkit-scrollbar-track {
    background: transparent;
}

.messages::-webkit-scrollbar-thumb {
    background: #0f3460;
    border-radius: 3px;
}
