:root {
    --primary-color: #10a37f;
    --primary-color-dark: #10a37f;
    /* Light (day) theme palette */
    --bg-dark: #f7f7fa;      /* app background */
    --bg-darker: #ffffff;    /* cards/surfaces */
    --bg-light: #f4f5f7;     /* light surfaces, bubbles */
    --text-primary: #1f2937; /* near-black text */
    --text-secondary: #6b7280; /* secondary text */
    --border-color: #e5e7eb; /* subtle borders */
    /* stronger accents for inputs and switches */
    --border-strong: #cbd5e1;
    --input-bg: #eef2f7;
    /* assistant bubble bg for better contrast */
    --assistant-bubble-bg: #e9eef5;
}

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



body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
    background-color: var(--bg-dark);
    color: var(--text-primary);
    height: 100vh;
    overflow: hidden;
}

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

/* 主内容区域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    position: relative;
    /* important for flex children: allow shrinking to viewport width */
    min-width: 0;
}

/* 顶部工具栏 */
.top-bar {
    height: 60px;
    border-bottom: 1px solid var(--border-color);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
}


/* 聊天消息区域 */
.chat-messages {
    flex: 1;
    overflow-y: auto;
    /* reserve space for vertical scrollbar so content isn't covered */
    scrollbar-gutter: stable both-edges;
    /* allow this flex item (column layout) to shrink on the cross-axis */
    min-width: 0;
    padding: 20px;
}

.message {
    display: flex;
    gap: 16px;
    margin-bottom: 24px;
    max-width: 1800px;
    margin-left: auto;
    margin-right: auto;
    /* make each row respect the container width */
    width: 100%;
    /* prevent flex container from forcing a larger min content size */
    min-width: 0;
}

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

.user-message .message-avatar {
    background-color: #ffffff;
}

.assistant-message .message-avatar {
    background-color: var(--bg-light);
}

@media (max-width: 768px) {
    .message-avatar {
        width: 14px;
        height: 14px;
        font-size: 10px;
    }
}

/* 全局加载遮罩 */
.global-loading-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    opacity: 0.7;
    background-color: rgba(0, 0, 0, 0.5);
    display: none;
    justify-content: center;
    align-items: center;
    flex-direction: column;
    z-index: 1000;
}

.global-loading-overlay.visible {
    opacity: 1;
    pointer-events: auto;
}

.global-loading-content {
    padding: 32px 40px;
    border-radius: 16px;
    background: rgba(255, 255, 255, 0.35);
    box-shadow: 0 15px 30px rgba(15, 23, 42, 0.15);
    text-align: center;
    display: flex;
    flex-direction: column;
    gap: 12px;
    min-width: 260px;
}

.global-loading-spinner {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    border: 4px solid rgba(16, 163, 127, 0.2);
    border-top-color: var(--primary-color);
    animation: global-loading-spin 0.8s linear infinite;
    margin: 0 auto;
}

.global-loading-text {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
}

.global-loading-subtext {
    font-size: 14px;
    color: var(--text-secondary);
}

@keyframes global-loading-spin {
    to {
        transform: rotate(360deg);
    }
}

.message-content {
    flex: 1;
    line-height: 1.6;
    position: relative;
    /* allow flex child to shrink so long content doesn't overflow */
    min-width: 0;
}

.message-time {
    font-size: 12px;
    color: var(--text-secondary);
    margin-bottom: 8px;
}

.message-text {
    color: var(--text-primary);
    background-color: var(--bg-light);
    padding: 12px 16px;
    border-radius: 12px;
    display: inline-block;
    font-size: 0.95rem;
    /* keep a small right-side gutter so text doesn't touch/clip on edge */
    max-width: calc(100% - 16px);
    /* default wrapping for general bubbles */
    word-break: break-word;
    overflow-wrap: anywhere;
}

.user-message .message-text {
    background-color: #7dd3c0;
    color: #1a1a1a;
    /* Preserve user-entered newlines */
    white-space: pre-wrap;
}

.assistant-message .message-text {
    background-color: var(--assistant-bubble-bg);
    color: var(--text-primary);
    /* Let markdown layout normally while still wrapping long strings */
    white-space: normal;
}

.user-message .message-text h3 {
    font-size: 16px;
    font-weight: 600;
    margin: 16px 0 8px 0;
}

.user-message .message-text ul {
    margin: 8px 0;
    padding-left: 20px;
}

.user-message .message-text li {
    margin: 8px 0;
    list-style-type: disc;
}

.user-message .message-text strong {
    font-weight: 600;
}

.user-message .message-text code {
    background-color: var(--bg-light);
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Courier New', monospace;
    font-size: 0.9em;
}

.user-message .message-text pre {
    background-color: var(--bg-darker);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
}

.user-message .message-text pre code {
    background-color: transparent;
    padding: 0;
}

/* Assistant markdown bubble code blocks */
.assistant-message .message-text pre {
    background-color: var(--bg-darker);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 12px 0;
}
.assistant-message .message-text pre code {
    background: transparent !important;
}

/* Ensure markdown on the same AI bubble element doesn't override bubble background */
.assistant-message .message-text.markdown-body {
    background-color: var(--assistant-bubble-bg) !important;
    color: var(--text-primary);
    font-size: 0.95rem !important;
    line-height: 1.6 !important;
    word-break: break-word;
    overflow-wrap: anywhere;
    /* if some content still refuses to wrap (e.g., very long unbreakable strings),
       allow horizontal scroll within the bubble instead of overflowing the page */
    overflow-x: auto;
}
/* Wrap inline code if too long */
.assistant-message .message-text.markdown-body code {
    white-space: pre-wrap;
    word-break: break-word;
}

/* 消息操作按钮 */
.message-actions {
    display: flex;
    gap: 4px;
    margin-top: 8px;
    opacity: 1;
    transition: opacity 0.2s;
}

.message:hover .message-actions {
    opacity: 1;
}

.message-action-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    padding: 4px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.message-action-btn:hover {
    background-color: var(--bg-light);
    color: var(--text-primary);
}

.message-action-btn svg {
    width: 16px;
    height: 16px;
}

.user-message .message-action-btn:hover {
    background-color: rgba(0, 0, 0, 0.1);
}

/* Toast 提示 */
.toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(100px);
    background-color: #1653d6;
    color: #f7f7fa;
    padding: 12px 24px;
    border-radius: 8px;
    border: 1px solid var(--border-color);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.3);
    z-index: 3000;
    opacity: 0;
    transition: all 0.3s ease;
    font-size: 14px;
    white-space: nowrap;
}

.toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 输入区域 */
.input-area {    
    padding: 20px;
    border-top: 1px solid var(--border-color);
}

.input-container {
    max-width: 1800px;
    margin: 0 auto;
    position: relative;
    display: flex;
    gap: 12px;
    align-items: stretch;
}

.input-wrapper {
    display: flex;
    align-items: center;
    background-color: var(--input-bg);
    border: 1px solid var(--border-strong);
    border-radius: 12px;
    padding: 8px 10px;
    gap: 6px;
    transition: all 0.3s;
    flex: 1;
    position: relative;
}

.input-wrapper:focus-within {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 3px rgba(16, 163, 127, 0.10);
    background-color: #ffffff;
}

.input-wrapper.expanded {
    min-height: 200px;
    align-items: flex-start;
}

.input-wrapper.expanded #messageInput {
    min-height: 150px;
}

.input-actions {
    display: flex;
    gap: 6px;
    align-items: center;
    flex-wrap: wrap;
    margin-left: 8px;
}


.reply-limit-selector {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    color: var(--text-secondary);
    font-size: 12px;
    position: relative;
}

.reply-limit-selector select {
    width: 63px;
    padding: 4px 24px 4px 10px;
    border-radius: 999px;
    border: 1px solid var(--border-color);
    background: var(--input-bg);
    color: var(--text-primary);
    font-size: 12px;
    cursor: pointer;
    appearance: none;
    line-height: 1.4;
    transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.reply-limit-selector::after {
    content: '';
    position: absolute;
    right: 10px;
    width: 0;
    height: 0;
    border-left: 4px solid transparent;
    border-right: 4px solid transparent;
    border-top: 5px solid var(--text-secondary);
    pointer-events: none;
}

.reply-limit-selector select:focus {
    outline: none;
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(16, 163, 127, 0.15);
}

.reply-limit-selector label {
    white-space: nowrap;
}

.action-btn {
    width: 32px;
    height: 32px;
    background-color: transparent;
    border: none;
    color: var(--text-secondary);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s;
    flex-shrink: 0;
}

.action-btn:hover {
    background-color: var(--bg-dark);
}

.expand-btn {
    font-size: 16px;
}

#messageInput {
    flex: 1;
    background-color: transparent;
    border: none;
    color: var(--text-primary);
    font-size: 14px;
    resize: none;
    outline: none;
    max-height: 400px;
    min-height: 22px;
    line-height: 22px;
    font-family: inherit;
    /* Firefox scrollbar colors */
    scrollbar-color: var(--border-strong) transparent;
}
#messageInput::-webkit-scrollbar {
    width: 10px;
    height: 10px;
}
#messageInput::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 6px;
}
#messageInput::-webkit-scrollbar-thumb:hover {
    background: #9aa4b2;
}

#messageInput::placeholder {
    color: var(--text-secondary);
}

.mobile-placeholder {
    position: absolute;
    left: 16px;
    right: calc(var(--input-actions-width, 0px) + 16px);
    top: 50%;
    transform: translateY(-50%);
    pointer-events: none;
    font-size: 14px;
    color: var(--text-secondary);
    opacity: 0;
    visibility: hidden;
    overflow: hidden;
    white-space: nowrap;
    background: linear-gradient(90deg, var(--input-bg), rgba(255,255,255,0));
    mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
    -webkit-mask-image: linear-gradient(90deg, transparent, #000 20%, #000 80%, transparent);
    transition: opacity 0.2s ease;
}

.mobile-placeholder span {
    display: inline-block;
    padding-right: 40px;
    animation: placeholder-marquee 9s linear infinite;
}

.mobile-placeholder.visible {
    opacity: 1;
    visibility: visible;
}

@keyframes placeholder-marquee {
    0% {
        transform: translateX(0);
    }
    100% {
        transform: translateX(-100%);
    }
}

.send-button {
    box-sizing: border-box;
    padding: 0 18px;
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    color: #fff;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s ease;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    min-height: 40px;
}

.send-button span {
    pointer-events: none;
}

.send-button:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    background-color: var(--bg-light);
    color: var(--text-secondary);
}

.send-button:not(:disabled):hover {
    opacity: 0.9;
    transform: translateY(-1px);
    box-shadow: 0 4px 10px rgba(16, 163, 127, 0.35);
}

.send-button:not(:disabled):active {
    transform: translateY(0);
    box-shadow: none;
}


/* 滚动条样式 */
::-webkit-scrollbar {
    width: 14px;
    height: 14px;
}

::-webkit-scrollbar-track {
    background: rgba(31, 41, 55, 0.08);
    border-radius: 8px;
}

::-webkit-scrollbar-thumb {
    background: var(--border-strong);
    border-radius: 999px;
    border: 3px solid transparent;
    min-height: 60px;
}

::-webkit-scrollbar-thumb:hover {
    background: #9aa4b2;
}

/* 加载动画 */
.loading-dots {
    display: inline-flex;
    gap: 4px;
}

.loading-dots span {
    width: 8px;
    height: 8px;
    background-color: var(--text-secondary);
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0);
    }
    40% {
        transform: scale(1);
    }
}

/* 认证模态框 */
.auth-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--bg-dark);
    display: none;
    align-items: center;
    justify-content: center;
    z-index: 1000;
}

.auth-container {
    background-color: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    padding: 40px;
    width: 90%;
    max-width: 450px;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.auth-container h2 {
    font-size: 24px;
    font-weight: 600;
    margin-bottom: 8px;
    color: var(--text-primary);
    text-align: center;
}

.auth-description {
    font-size: 14px;
    color: var(--text-secondary);
    text-align: center;
    margin-bottom: 32px;
}

.auth-form {
    display: flex;
    flex-direction: column;
    gap: 20px;
}

.form-group {
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.form-group label {
    font-size: 14px;
    font-weight: 500;
    color: var(--text-primary);
}

.form-group input {
    background-color: var(--bg-light);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 12px 16px;
    font-size: 14px;
    color: var(--text-primary);
    outline: none;
    transition: border-color 0.2s;
}

.form-group input:focus {
    border-color: var(--primary-color);
}

.form-group input::placeholder {
    color: var(--text-secondary);
}

.auth-error {
    min-height: 20px;
    font-size: 13px;
    color: #e74c3c;
    text-align: center;
}

.auth-submit-btn {
    background-color: var(--primary-color);
    border: none;
    border-radius: 8px;
    padding: 12px 24px;
    font-size: 15px;
    font-weight: 500;
    color: white;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
}

.auth-submit-btn:hover {
    opacity: 0.9;
}

.auth-submit-btn:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.auth-loading {
    display: inline-flex;
    gap: 4px;
}

.auth-loading span {
    width: 6px;
    height: 6px;
    background-color: white;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.auth-loading span:nth-child(1) {
    animation-delay: -0.32s;
}

.auth-loading span:nth-child(2) {
    animation-delay: -0.16s;
}

/* 追问开关样式 - 内联版本 */
.switch-inline {
    position: relative;
    display: inline-flex;
    align-items: center;
    gap: 8px;
    cursor: pointer;
    flex-shrink: 0;
}

.switch-inline input {
    opacity: 0;
    width: 0;
    height: 0;
}

.slider-inline {
    position: relative;
    width: 36px;
    height: 20px;
    background-color: var(--bg-dark);
    border: 1px solid var(--border-strong);
    transition: .4s;
    border-radius: 20px;
}

.slider-inline:before {
    position: absolute;
    content: "";
    height: 14px;
    width: 14px;
    left: 3px;
    /* center vertically regardless of borders */
    top: 50%;
    transform: translate(0, -50%);
    background-color: var(--text-secondary);
    border: 1px solid var(--border-strong);
    transition: .4s;
    border-radius: 50%;
}

input:checked + .slider-inline {
    background-color: var(--primary-color);
}

input:checked + .slider-inline:before {
    /* keep vertical centering while moving horizontally */
    transform: translate(16px, -50%);
    background-color: white;
}

.switch-inline:focus-within .slider-inline {
    border-color: var(--primary-color);
    box-shadow: 0 0 0 2px rgba(16, 163, 127, 0.20);
}



/* 历史记录选择弹窗 */
.history-select-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.7);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2000;
}

.history-select-modal {
    background-color: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 700px;
    max-height: 80vh;
    display: flex;
    flex-direction: column;
    box-shadow: 0 4px 20px rgba(0, 0, 0, 0.5);
}

.history-select-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 20px 24px;
    border-bottom: 1px solid var(--border-color);
}

.history-select-header h3 {
    font-size: 18px;
    font-weight: 600;
    color: var(--text-primary);
    margin: 0;
}

.close-btn {
    background: none;
    border: none;
    color: var(--text-secondary);
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 6px;
    transition: background-color 0.2s;
}

.close-btn:hover {
    background-color: var(--bg-light);
}

.history-select-content {
    flex: 1;
    overflow-y: auto;
    padding: 16px 24px;
}

.history-select-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.history-select-item {
    display: flex;
    gap: 12px;
    padding: 16px;
    background-color: var(--bg-light);
    border: 2px solid transparent;
    border-radius: 8px;
    cursor: pointer;
    transition: all 0.2s;
}

.history-select-item:hover {
    border-color: var(--border-color);
}

.history-select-item input[type="radio"] {
    margin-top: 4px;
    cursor: pointer;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.history-select-item input[type="radio"]:checked ~ label {
    color: var(--primary-color);
}

.history-select-item label {
    flex: 1;
    cursor: pointer;
    display: flex;
    flex-direction: column;
    gap: 8px;
}

.history-number {
    font-weight: 600;
    color: var(--primary-color);
    font-size: 14px;
}

.history-select-footer {
    display: flex;
    gap: 12px;
    padding: 20px 24px;
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
}

.cancel-btn,
.confirm-btn {
    padding: 10px 24px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

.cancel-btn {
    background-color: var(--bg-light);
    color: var(--text-primary);
}

.cancel-btn:hover {
    background-color: var(--border-color);
}

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

.confirm-btn:hover {
    opacity: 0.9;
}

/* 通用确认弹窗 */
.confirm-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.5);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 2500;
    opacity: 0;
    transition: opacity 0.2s ease;
    will-change: opacity;
}

.confirm-overlay.show {
    opacity: 1;
}

.confirm-modal {
    background-color: var(--bg-darker);
    border: 1px solid var(--border-color);
    border-radius: 12px;
    width: 90%;
    max-width: 440px;
    box-shadow: 0 12px 30px rgba(0,0,0,0.45);
    overflow: hidden;
    transform: translateY(8px) scale(0.98);
    opacity: 0.98;
    transition: transform 0.2s ease, opacity 0.2s ease;
    will-change: transform, opacity;
}

.confirm-overlay.show .confirm-modal {
    transform: translateY(0) scale(1);
    opacity: 1;
}

.confirm-header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 18px;
    border-bottom: 1px solid var(--border-color);
}

.confirm-title {
    display: flex;
    align-items: center;
    gap: 8px;
    margin: 0;
    font-size: 16px;
    font-weight: 600;
    color: var(--text-primary);
}

.confirm-icon {
    font-size: 18px;
    line-height: 1;
}

.confirm-content {
    padding: 18px;
    color: var(--text-secondary);
    font-size: 14px;
    line-height: 1.6;
}

.confirm-footer {
    display: flex;
    gap: 12px;
    padding: 16px 18px;
    border-top: 1px solid var(--border-color);
    justify-content: flex-end;
    background-color: var(--bg-darker);
}

/* 代码复制按钮 */
.copy-btn {
    position: absolute;
    top: 2px;
    right: 2px;
    padding: 0 1px;
    font-size: 3px;
    background-color: #4CAF50;
    color: white;
    border: none;
    border-radius: 1px;
    cursor: pointer;
    opacity: 0.7;
    transition: opacity 0.3s ease;
}

.copy-btn:hover {
    opacity: 1;
}


#chatMessages {
    height: calc(100vh - 200px);
    overflow-y: auto;
    overflow-x: hidden;
    padding: 10px;
}

/* 自定义滚动条样式 */
#chatMessages::-webkit-scrollbar {
    width: 14px; /* 滚动条宽度 */
    height: 16px;
}

#chatMessages::-webkit-scrollbar-track {
    background: rgba(15, 23, 42, 0.08); /* 滚动条轨道背景色 */
    border-radius: 8px;
}

#chatMessages::-webkit-scrollbar-thumb {
    background: rgba(37, 99, 235, 0.4); /* 滚动条滑块颜色 */
    border-radius: 999px;
    border: 3px solid rgba(255, 255, 255, 0.6); /* 滑块边框 */
    min-height: 60px;
}

#chatMessages::-webkit-scrollbar-thumb:hover {
    background: rgba(37, 99, 235, 0.65); /* 鼠标悬停时的颜色 */
}

/* Firefox 滚动条样式 */
#chatMessages {
    scrollbar-width: auto;
    scrollbar-color: rgba(37, 99, 235, 0.6) rgba(15, 23, 42, 0.08);
}

/* 主题变体 */
.confirm-modal.info .confirm-icon { color: #3498db; }
.confirm-modal.success .confirm-icon { color: #2ecc71; }
.confirm-modal.warning .confirm-icon { color: #f1c40f; }
.confirm-modal.danger .confirm-icon { color: #e74c3c; }

.confirm-modal.danger .confirm-btn { background-color: #e74c3c; }
.confirm-modal.warning .confirm-btn { background-color: #f39c12; }
.confirm-modal.info .confirm-btn { background-color: #3498db; }
.confirm-modal.success .confirm-btn { background-color: #2ecc71; }

/* 响应式设计 */
@media (max-width: 768px) {
    .auth-container {
        padding: 30px 24px;
    }
    .history-select-modal {
        width: 95%;
        max-height: 90vh;
    }
    .history-select-header,
    .history-select-footer {
        padding: 16px;
    }
    
    .history-select-content {
        padding: 12px 16px;
    }

    .message-text {
        font-size: 0.68rem;
    }

    .assistant-message .message-text.markdown-body {
        font-size: 0.68rem !important;
    }
}

@media (max-width: 600px) {
    .input-area {
        padding: 12px;
    }

    .input-container {
        gap: 8px;
    }

    .input-wrapper {
        border-radius: 10px;
        padding: 6px 8px;
        gap: 4px;
    }

    #messageInput {
        font-size: 13px;
        line-height: 18px;
        min-height: 20px;
    }

    .mobile-placeholder {
        font-size: 12px;
    }

    .reply-limit-selector {
        font-size: 11px;
        gap: 4px;
    }

    .reply-limit-selector select {
        width: 58px;
        padding: 2px 20px 2px 8px;
        font-size: 11px;
    }

    .switch-inline {
        gap: 4px;
    }

    .slider-inline {
        width: 32px;
        height: 18px;
    }

    .slider-inline:before {
        width: 12px;
        height: 12px;
    }

    input:checked + .slider-inline:before {
        transform: translate(14px, -50%);
    }

    .send-button {
        min-height: 34px;
        padding: 0 14px;
        font-size: 13px;
    }
}


