/* static/style.css */
:root {
    --primary-color: #10a37f;
    --primary-hover: #0d8a6d;
    --bg-color: #ffffff;
    --sidebar-bg: #f7f7f8;
    --message-bg-user: #f0f7f4;
    --message-bg-bot: #ffffff;
    --border-color: #e5e5e5;
    --text-primary: #2d333a;
    --text-secondary: #6e7781;
}

* {
    margin: 0;
    padding: 0;
    box-sizing: border-box;
    font-family: "Segoe UI", system-ui, sans-serif;
}

body {
    background: var(--bg-color);
    height: 100vh;
}

.app-container {
    display: flex;
    height: 100vh;
}

/*        ʽ */
.sidebar {
    width: 260px;
    background: var(--sidebar-bg);
    border-right: 1px solid var(--border-color);
    padding: 16px;
    display: flex;
    flex-direction: column;
}

.new-chat {
    margin-bottom: 16px;
}

.btn-new-chat {
    width: 100%;
    padding: 12px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.btn-new-chat:hover {
    background: var(--primary-hover);
}

/* ģ  ѡ     */
.model-select {
    width: 100%;
    padding: 12px;
    border: 1px solid var(--border-color);
    border-radius: 8px;
    background: white;
    color: var(--text-primary);
    font-size: 14px;
}

/*            */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.chat-container {
    flex: 1;
    overflow-y: auto;
    padding: 24px;
    padding-bottom: 120px;
}

/*   Ϣ  ʽ */
.message {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    margin: 10px 0;
    max-width: 80%;
    margin-left: 20px;
}

.message.user {
    justify-content: flex-start;
}



.message-content {
    flex: 1;
    max-width: 85%;
    margin: 0 15px;
}

.message-content {
    flex: 1;
    min-width: 0;
}

.message-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.role {
    font-weight: 600;
    color: var(--text-primary);
}

.time {
    color: var(--text-secondary);
    font-size: 0.875em;
}

.message-text {
    padding: 16px;
    background: var(--message-bg-bot);
    border-radius: 8px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
    line-height: 1.6;
    color: var(--text-primary);
    white-space: pre-wrap;
}



/* ˼        ʽ */
.reasoning-box {
    margin-top: 12px;
    padding: 16px;
    background: rgba(16, 163, 127, 0.08);
    border-radius: 8px;
    border-left: 4px solid var(--primary-color);
}

.reasoning-header {
    display: flex;
    align-items: center;
    gap: 8px;
    color: var(--primary-color);
    margin-bottom: 8px;
    font-weight: 500;
}

.reasoning-content {
    color: var(--text-primary);
    font-size: 0.9em;
    line-height: 1.6;
}

/*          */
.input-container {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    background: var(--bg-color);
    padding: 24px;
    box-shadow: 0 -4px 16px rgba(0, 0, 0, 0.04);
    display: flex;
    flex-direction: column;
    align-items: flex-start;
}

.input-wrapper {
    max-width: 100%;
    width: 100%;
    position: relative;
    align-items: flex-start;
}

textarea#user-input {
    width: 100%;
    padding: 16px 48px 16px 16px;
    border: 1px solid var(--border-color);
    border-radius: 12px;
    resize: none;
    font-size: 16px;
    line-height: 1.5;
    min-height: 56px;
    max-height: 200px;
}

.btn-send {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 36px;
    height: 36px;
    border: none;
    background: var(--primary-color);
    color: white;
    border-radius: 8px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-send:hover {
    background: var(--primary-hover);
}

.watermark {
    text-align: center;
    color: var(--text-secondary);
    font-size: 0.875em;
    margin-top: 12px;
    opacity: 0.6;
}

/* 文件上传样式 */
.file-upload-section {
    margin-top: 20px;
    padding: 15px;
    background: rgba(16, 163, 127, 0.05);
    border-radius: 8px;
    border: 1px dashed var(--primary-color);
}

.file-upload-section h3 {
    color: var(--primary-color);
    margin-bottom: 15px;
    font-size: 16px;
}

.form-group {
    margin-bottom: 12px;
}

.form-group label {
    display: block;
    margin-bottom: 5px;
    color: var(--text-primary);
}

.file-input {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
}

.type-select {
    width: 100%;
    padding: 8px;
    border: 1px solid var(--border-color);
    border-radius: 6px;
    background: white;
}

.btn-upload {
    width: 100%;
    padding: 10px;
    background: var(--primary-color);
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    transition: background 0.2s;
}

.btn-upload:hover {
    background: var(--primary-hover);
}

.upload-status {
    margin-top: 10px;
    padding: 10px;
    border-radius: 6px;
}

.upload-success {
    color: #155724;
    background-color: #d4edda;
    border: 1px solid #c3e6cb;
}

.upload-error {
    color: #721c24;
    background-color: #f8d7da;
    border: 1px solid #f5c6cb;
}

/* 管理员工具样式 */
.btn-admin-download {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border-radius: 6px;
    margin: 10px 0;
    border: none;
    cursor: pointer;
}

.btn-admin-download:hover {
    background: var(--primary-hover);
}

.modal-content input[type="text"] {
    width: 100%;
    padding: 8px;
    margin: 8px 0;
    border: 1px solid var(--border-color);
    border-radius: 4px;
}

.modal-content button {
    background: var(--primary-color);
    color: white;
    padding: 8px 16px;
    border: none;
    border-radius: 4px;
    cursor: pointer;
}

.modal-content button:hover {
    background: var(--primary-hover);
}

/*   Ӧʽ    */
@media (max-width: 768px) {
    .sidebar {
        display: none;
    }

    .input-container {
        left: 0;
    }

    .message {
        max-width: 90%;
    }
}
