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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", sans-serif;
    background: #0f1115;
    color: #e6e6e6;
    height: 100vh;
}

.container {
    display: flex;
    height: 100vh;
}

.sidebar {
    width: 280px;
    background: #171a21;
    padding: 16px;
    border-right: 1px solid #2a2f3a;
    overflow-y: auto;
}

.sidebar h2 {
    font-size: 18px;
    margin-bottom: 8px;
    color: #fff;
}

.hint {
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}

#modelSelect {
    width: 100%;
    padding: 8px;
    background: #0f1115;
    color: #e6e6e6;
    border: 1px solid #2a2f3a;
    border-radius: 6px;
    margin-bottom: 12px;
}

.filter-group {
    display: flex;
    gap: 6px;
    align-items: center;
    margin-bottom: 12px;
    font-size: 13px;
}

.filter-group label {
    margin-left: 4px;
}

.params {
    display: flex;
    flex-direction: column;
    gap: 6px;
    margin-bottom: 16px;
    font-size: 13px;
}

.params label {
    color: #aaa;
}

.params input[type="range"] {
    width: 100%;
}

.params span {
    color: #4f9eff;
    font-weight: bold;
}

button {
    width: 100%;
    padding: 10px;
    margin-top: 8px;
    background: #4f9eff;
    color: #fff;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    font-size: 14px;
}

button:hover {
    background: #3a8ae0;
}

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

#newChat {
    background: #2a2f3a;
}

#newChat:hover {
    background: #353a45;
}

.status {
    margin-top: 10px;
    font-size: 12px;
    color: #888;
}

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

.chat-header {
    padding: 14px 20px;
    background: #171a21;
    border-bottom: 1px solid #2a2f3a;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

#currentModel {
    color: #4f9eff;
}

#modelInfo {
    font-size: 12px;
    color: #888;
}

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

.message {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 10px;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
}

.message.user {
    align-self: flex-end;
    background: #4f9eff;
    color: #fff;
}

.message.assistant {
    align-self: flex-start;
    background: #262a32;
    color: #e6e6e6;
}

.message.system {
    align-self: center;
    background: transparent;
    color: #888;
    font-size: 13px;
    font-style: italic;
}

.message.error {
    align-self: center;
    background: #5a1f1f;
    color: #ffb0b0;
}

.message.reasoning {
    align-self: flex-start;
    max-width: 75%;
    background: #1d2230;
    border-left: 3px solid #8a6fff;
    padding: 0;
    overflow: hidden;
}

.reasoning-header {
    background: #2a2f4a;
    color: #b3a8ff;
    font-size: 11px;
    font-weight: bold;
    text-transform: uppercase;
    letter-spacing: 1px;
    padding: 6px 14px;
}

.reasoning-body {
    padding: 10px 14px;
    color: #cfc8ff;
    font-style: italic;
    line-height: 1.5;
    white-space: pre-wrap;
    word-wrap: break-word;
    font-size: 13px;
}

.chat-input {
    display: flex;
    padding: 14px;
    background: #171a21;
    border-top: 1px solid #2a2f3a;
    gap: 10px;
}

#userInput {
    flex: 1;
    padding: 10px;
    background: #0f1115;
    color: #e6e6e6;
    border: 1px solid #2a2f3a;
    border-radius: 6px;
    resize: vertical;
    font-family: inherit;
    font-size: 14px;
}

#sendBtn {
    width: 100px;
    margin-top: 0;
}
