/* 基础重置 */
:root {
    --custom-font: '';
    --font-size-base: 14px;
    --line-height-base: 1.8;
    
    /* 亮色主题变量 */
    --color-bg-primary: #ffffff;
    --color-bg-secondary: #f0f0f0;
    --color-bg-tertiary: #e8f0f8;
    --color-text-primary: #2d3748;
    --color-text-secondary: #4a5568;
    --color-border: #d0d8e0;
    --color-accent: #3182ce;
    --color-accent-hover: #2c5282;
    --color-danger: #e53e3e;
    --color-danger-hover: #c53030;
    --color-user-bubble-bg: #e6f2ff;
    --color-user-bubble-border: #b0d5ff;
    --color-assistant-bubble-bg: #f0f7ff;
    --color-assistant-bubble-border: #c3dafe;
    --color-shadow: rgba(0, 0, 0, 0.08);
    --color-overlay: rgba(0, 0, 0, 0.5);
    --color-code-bg: #f0f5fa;
    --bg-color: #edf2f7;
    --chat-bg: #ffffff;
    --user-msg-bg: #d4e9ff;
    --assistant-msg-bg: #f0f0f0;
    --text-color: #212121;
    --button-bg: #2196f3;
    --button-hover: #1976d2;
    --button-text: #ffffff;
    --input-bg: #ffffff;
    --scrollbar-thumb: #c0c0c0;
    --scrollbar-thumb-hover: #a0a0a0;
    --history-item-bg: #ffffff;
    --history-item-hover: #f0f0f0;
}

/* 暗色主题 */
.dark-theme {
    --color-bg-primary: #121820;
    --color-bg-secondary: #1a2230;
    --color-bg-tertiary: #1e2635;
    --color-text-primary: #f7fafc;
    --color-text-secondary: #e2e8f0;
    --color-border: #3a4556;
    --color-accent: #4299e1;
    --color-accent-hover: #63b3ed;
    --color-danger: #f56565;
    --color-danger-hover: #fc8181;
    --color-user-bubble-bg: #2b4a80;
    --color-user-bubble-border: #3b5f9e;
    --color-assistant-bubble-bg: #243242;
    --color-assistant-bubble-border: #3a4b5e;
    --color-shadow: rgba(0, 0, 0, 0.4);
    --color-overlay: rgba(0, 0, 0, 0.75);
    --color-code-bg: #1e2b3c;
    --bg-color: #0a101a;
    --chat-bg: #151e29;
    --user-msg-bg: #0d47a1;
    --assistant-msg-bg: #1e2635;
    --text-color: #e0e0e0;
    --border-color: #3d3d3d;
    --button-bg: #1565c0;
    --button-hover: #0d47a1;
    --button-text: #ffffff;
    --input-bg: #1e2635;
    --scrollbar-thumb: #4d4d4d;
    --scrollbar-thumb-hover: #6d6d6d;
    --history-item-bg: #1e2635;
    --history-item-hover: #2a3547;
}

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

/* 基础布局 */
body {
    background: var(--color-bg-tertiary);
    margin: 0;
    padding: 16px;
    font-family: var(--custom-font), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    line-height: 1.5;
    color: var(--color-text-primary);
    display: flex;
    justify-content: center;
    font-size: var(--font-size-base);
    transition: background-color 0.3s, color 0.3s;
}

/* 容器设置 */
.container {
    display: flex;
    width: 100%;
    max-width: 1200px;
    height: calc(100vh - 32px);
    box-shadow: 0 1.6px 3.6px 0 rgba(0, 0, 0, 0.132), 0 0.3px 0.9px 0 rgba(0, 0, 0, 0.108);
    border-radius: 8px;
    overflow: hidden;
    background-color: var(--color-bg-primary);
    transition: background-color 0.3s;
}

/* 左侧历史记录 */
.history-panel {
    width: 200px;
    background: var(--color-bg-secondary);
    border-right: 1px solid var(--color-border);
    padding: 16px;
    overflow-y: auto;
}

.history-panel h2 {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 12px;
    text-align: center;
    color: var(--color-text-primary);
}

.history-buttons {
    display: flex;
    gap: 8px;
    margin-bottom: 12px;
}

.history-panel button {
    flex: 1;
    height: 40px;
    padding: 0 10px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    background: var(--color-accent);
    color: white;
}

.history-panel button.secondary-button {
    background: var(--color-danger);
}

.history-panel button:hover {
    opacity: 0.9;
}

.history-panel button.secondary-button:hover {
    background: var(--color-danger-hover);
}

.history-panel {
    width: 280px;
    background: var(--color-bg-secondary);
    border-right: 1px solid var(--color-border);
    padding: 16px;
    display: flex;
    flex-direction: column;
    height: 100%;
}

.header-container {
    /* 固定头部区域 */
    flex-shrink: 0; /* 防止被压缩 */
}

.scrollable-list {
    flex: 1;
    overflow-y: auto;
    margin-top: 12px;
    scroll-behavior: smooth; /* 平滑滚动 */
}

.scrollable-list::-webkit-scrollbar {
    width: 0 !important;
}

.history-list {
    list-style: none;
}

.history-list-item {
    position: relative;
    padding: 10px;
    margin-bottom: 8px;
    background: var(--color-bg-primary);
    border: 1px solid var(--color-border);
    border-radius: 6px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

/* 选中的历史记录项样式 */
.history-list-item.active {
    background-color: var(--color-user-bubble-bg);
    border-color: var(--color-accent);
    border-left: 4px solid var(--color-accent);
    box-shadow: 0 1px 3px var(--color-shadow);
}

.history-list-item.active .title {
    font-weight: 600;
}

.dark-theme .history-list-item.active {
    background-color: var(--color-user-bubble-bg);
    border-color: var(--color-accent);
}

.history-list-item .delete-icon {
    visibility: hidden;
    background: var(--color-danger);
    color: white;
    border: none;
    width: 20px;
    height: 20px;
    min-width: 20px;
    max-width: 20px;
    border-radius: 10px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    margin-left: 8px;
    padding: 0;
}

.history-list-item:hover {
    background: var(--color-bg-tertiary);
}

.history-list-item.active:hover {
    background-color: var(--color-user-bubble-bg);
}

.history-list-item:hover .delete-icon {
    visibility: visible;
}

.history-list-item .title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    color: var(--color-text-primary);
}

/* 右侧聊天区域 */
.chat-container {
    flex: 1;
    display: flex;
    flex-direction: column;
    min-height: 0; /* 很关键，防止子元素被压缩 */
}

.chat-header {
    padding: 16px;
    border-bottom: 1px solid var(--color-border);
    text-align: center;
    position: relative;
}

.chat-header h1 {
    height: 32px;
    line-height: 32px;
    font-size: 20px;
    font-weight: 600;
    color: var(--color-text-primary);
}

/* 聊天框 */
#chat-box {
    flex: 1;
    overflow-y: auto;
    border-bottom: 1px solid var(--color-border);
    padding: 16px;
    background: var(--color-bg-secondary);
}

/* 消息样式 */
.message {
    margin-bottom: 16px;
    padding-bottom: 16px;
    position: relative;
}

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

.user {
    text-align: right;
    color: var(--color-accent);
    padding-left: 20%;
}

.assistant {
    text-align: left;
    color: var(--color-text-primary);
    padding-right: 20%;
}

/* 消息内容样式 */
.message .markdown-content {
    padding: 12px 16px;
    border-radius: 8px;
    border: 1px solid var(--color-border);
    display: inline-block;
    max-width: 100%;
    text-align: left;
    font-size: var(--font-size-base);
    line-height: var(--line-height-base);
    word-break: break-word;
    font-family: var(--custom-font), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
}

.user .markdown-content {
    background-color: var(--color-user-bubble-bg);
    border-color: var(--color-user-bubble-border);
}

.assistant .markdown-content {
    background-color: var(--color-assistant-bubble-bg);
    border-color: var(--color-assistant-bubble-border);
    box-shadow: 0 1px 2px var(--color-shadow);
}

.message p {
    margin: 0 0 12px 0;
}

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

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

.assistant .message-actions {
    justify-content: flex-start;
}

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

.message-action-button {
    padding: 4px 8px;
    font-size: 12px;
    border: none;
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
    border-radius: 4px;
    cursor: pointer;
    transition: all 0.2s;
}


.message-action-button:hover {
    background-color: var(--color-border);
}

/* Markdown 渲染样式 */
/* 消息代码块样式 */
.message pre {
    background: var(--color-code-bg);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    margin: 12px 0;
    line-height: 1.5;
    color: var(--color-text-primary);
}

/* 消息代码样式 */
.message code {
    background: var(--color-code-bg);
    padding: 2px 4px;
    border-radius: 4px;
    font-family: Consolas, Monaco, 'Courier New', monospace;
    font-size: 0.9em;
    color: var(--color-text-primary);
}

/* 消息链接样式 */
.message a {
    color: var(--color-accent);
    text-decoration: none;
}

/* 消息链接悬停样式 */
.message a:hover {
    text-decoration: underline;
}

/* 消息表格样式 */
.message table {
    border-collapse: collapse;
    width: 100%;
    margin: 16px 0;
    font-size: 14px;
    line-height: 1.6;
}

/* 消息表格单元格样式 */
.message th,
.message td {
    border: 1px solid var(--color-border);
    padding: 8px 12px;
    text-align: left;
}

/* 消息表格表头样式 */
.message th {
    background-color: var(--color-bg-tertiary);
    font-weight: 600;
}

/* 消息表格偶数行样式 */
.message tr:nth-child(even) {
    background-color: var(--color-bg-secondary);
}

/* 消息引用样式 */
.message blockquote {
    border-left: 4px solid var(--color-border);
    padding-left: 16px;
    margin: 12px 0;
    color: var(--color-text-secondary);
}

/* 消息列表样式 */
.message ul,
.message ol {
    padding-left: 24px;
    margin: 12px 0;
}

/* 消息图片样式 */
.message img {
    max-width: 100%;
    height: auto;
    border-radius: 4px;
    margin: 12px 0;
}

/* 用户输入框区域样式 */
#input-area {
    display: flex;
    align-items: flex-end;
    gap: 12px;
    padding: 12px;
    background: var(--color-bg-primary);
}

/* 用户输入框样式 */
#user-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--color-border);
    border-radius: 8px;
    font-size: 14px;
    background: var(--color-bg-primary);
    color: var(--color-text-primary);
    transition: all 0.2s ease;
    resize: none;
    min-height: 40px;
    max-height: 150px;
    overflow-y: auto;
    line-height: var(--line-height-base);
    font-family: var(--custom-font), -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Oxygen, Ubuntu, Cantarell, sans-serif;
    scrollbar-width: none; /* Firefox */
    -ms-overflow-style: none; /* IE/Edge */
}

/* 隐藏Chrome, Safari和Opera的滚动条 */
#user-input::-webkit-scrollbar {
    display: none;
}


/* 禁用自动填充样式 */
#user-input:-webkit-autofill,
#user-input:-webkit-autofill:hover,
#user-input:-webkit-autofill:focus,
#user-input:-webkit-autofill:active {
    -webkit-box-shadow: 0 0 0 30px var(--color-bg-primary) inset !important;
    -webkit-text-fill-color: var(--color-text-primary) !important;
    transition: background-color 5000s ease-in-out 0s;
}

#user-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.2);
}

#user-input::placeholder {
    color: var(--color-text-secondary);
    opacity: 0.7;
}

/* 发送按钮 */
#send-button {
    height: 40px;
    padding: 0 20px;
    border: none;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    background: var(--color-accent);
    color: white;
}

#send-button:hover {
    background: var(--color-accent-hover);
}

/* 主题切换按钮和设置按钮的通用样式 */
.theme-toggle-button, .settings-button {
    width: 32px;
    height: 32px;
    /* border-radius: 16px; */
    font-size: 20px;
    position: absolute;
    top: 50%;
    transform: translateY(-50%);
    background: none;
    border: none;
    color: var(--color-text-secondary);
    cursor: pointer;
    transition: all 0.2s;
    display: flex; /* 使用 flexbox 布局 */
    justify-content: center; /* 水平居中 */
    align-items: center; /* 垂直居中 */
}

/* 主题切换按钮 */
.theme-toggle-button {
    right: 60px;
    /* 修改：主题按钮 */
    /* 现在的方案是：使用js直接修改 */
    /* background-image: url('images/theme.png'); */
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}

/* 设置按钮 */
.settings-button {
    right: 20px;
    background-image: url('images/settings.png');
    background-size: contain;
    background-position: center;
    background-repeat: no-repeat;
}



/* 设置表单弹窗 */
.confirm-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-overlay);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

/* 设置表单样式 */
.confirm-dialog {
    background-color: var(--color-bg-primary);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 350px;
    padding: 24px;
    text-align: center;
}

/* 设置表单标题样式 */
.confirm-dialog-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 16px;
    color: var(--color-text-primary);
}

/* 设置表单消息样式 */
.confirm-dialog-message {
    font-size: 14px;
    margin-bottom: 24px;
    color: var(--color-text-secondary);
}

/* 设置表单按钮组样式 */
.confirm-dialog-buttons {
    display: flex;
    justify-content: center;
    gap: 12px;
}

/* 设置表单按钮样式 */
.confirm-dialog-button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

/* 设置表单取消按钮样式 */
.confirm-dialog-button.cancel {
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
}

/* 设置表单确认按钮样式 */
.confirm-dialog-button.confirm {
    background-color: var(--color-danger);
    color: white;
}

/* 设置表单取消按钮悬停样式 */
.confirm-dialog-button.cancel:hover {
    background-color: var(--color-border);
}

/* 设置表单确认按钮悬停样式 */
.confirm-dialog-button.confirm:hover {
    background-color: var(--color-danger-hover);
}

/* 设置弹窗 */
.settings-dialog-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: var(--color-overlay);
    display: flex;
    justify-content: center;
    align-items: center;
    z-index: 1000;
}

.settings-dialog {
    background-color: var(--color-bg-primary);
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    width: 400px;
    padding: 24px;
    max-width: 90vw;
}

/* 设置表单标题样式 */
.settings-dialog-title {
    font-size: 18px;
    font-weight: 600;
    margin-bottom: 20px;
    color: var(--color-text-primary);
    text-align: center;
}

/* 设置表单组样式 */
.settings-form-group {
    margin-bottom: 20px;
}

/* 设置表单标签样式 */
.settings-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 8px;
    color: var(--color-text-secondary);
}

/* 设置表单输入框样式 */
.settings-form-group input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 14px;
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
    transition: all 0.2s;
}

/* 设置表单输入框聚焦样式 */
.settings-form-group input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.2);
}

/* 设置表单按钮组样式 */
.settings-dialog-buttons {
    display: flex;
    justify-content: flex-end;
    gap: 12px;
}

/* 设置表单按钮样式 */
.settings-dialog-button {
    padding: 8px 16px;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: all 0.2s;
}

/* 设置表单取消按钮样式 */
.settings-dialog-button.cancel {
    background-color: var(--color-bg-tertiary);
    color: var(--color-text-secondary);
}

/* 设置表单确认按钮样式 */
.settings-dialog-button.confirm {
    background-color: var(--color-accent);
    color: white;
}

.settings-dialog-button.cancel:hover {
    background-color: var(--color-border);
}

/* 设置表单确认按钮悬停样式 */
.settings-dialog-button.confirm:hover {
    background-color: var(--color-accent-hover);
}

/* 设置表单提示样式 */
.form-note {
    font-size: 12px;
    color: var(--color-text-secondary);
    margin-top: 4px;
    font-style: italic;
}

/* 字体大小设置容器样式 */
.font-size-container {
    display: flex;
    align-items: center;
    gap: 8px;
}

/* 字体大小设置输入框样式 */
.font-size-input {
    width: 60px;
    padding: 10px 12px;
    border: 1px solid var(--color-border);
    border-radius: 6px;
    font-size: 14px;
    transition: all 0.2s;
    -moz-appearance: none; /* Firefox */
    -webkit-appearance: none; /* Safari/Chrome 等 */
    appearance: none; /* 标准属性 */
    background-color: var(--color-bg-primary);
    color: var(--color-text-primary);
}

/* 字体大小设置输入框样式 */
.font-size-input::-webkit-outer-spin-button,
.font-size-input::-webkit-inner-spin-button {
    -webkit-appearance: none;
    margin: 0;
}

/* 字体大小设置输入框聚焦样式 */
.font-size-input:focus {
    outline: none;
    border-color: var(--color-accent);
    box-shadow: 0 0 0 2px rgba(49, 130, 206, 0.2);
}

/* 字体大小设置单位样式 */
.font-size-unit {
    font-size: 14px;
    color: var(--color-text-secondary);
}

/* 暗黑模式过渡效果 */
body {
    transition: background-color 0.3s, color 0.3s;
}

/* 暗黑模式过渡效果 */
.message, .input-area, .settings-dialog, .history-panel {
    transition: background-color 0.3s, border-color 0.3s, color 0.3s;
}


/* 移动端自适应样式 */
/* [侧边栏控件]历史记录面板关闭按钮样式 */
.overlay-mask {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: var(--color-overlay);
    z-index: 999;
    transition: opacity 0.3s ease;
}

/* [侧边栏控件]历史记录面板关闭按钮悬停样式 */
.overlay-mask.active {
    display: block;
    opacity: 1;
}

/* [侧边栏控件]历史记录面板关闭按钮样式 */
.close-history-panel {
    position: absolute;
    top: 16px;
    right: 16px;
    background: none;
    border: none;
    font-size: 24px;
    color: var(--color-text-secondary);
    cursor: pointer;
    z-index: 1001;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

/* [侧边栏控件]历史记录面板关闭按钮悬停样式 */
.close-history-panel:hover {
    color: var(--color-accent);
    background-color: var(--color-bg-tertiary);
}

/* [侧边栏控件]历史记录面板切换按钮样式 */
.history-toggle {
    display: none;
    position: absolute;
    top: 12px;
    left: 15px;
    background: none;
    border: none;
    color: var(--color-text-secondary);
    font-size: 24px;
    cursor: pointer;
    z-index: 10;
    width: 32px;
    height: 32px;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background-color 0.2s;
}

/* [侧边栏控件]历史记录面板切换按钮悬停样式 */
.history-toggle:hover {
    background-color: var(--color-bg-tertiary);
}


/* 移动端适配样式 */
@media (max-width: 768px) {
    /* [聊天区域]聊天区域样式 */
    body {
        padding: 8px;
        overflow-x: hidden;
    }
    
    /* [聊天区域]聊天区域样式 */
    .container {
        flex-direction: column;
        height: calc(100vh - 16px);
        position: relative;
    }
    
    /* [侧边栏控件]历史记录面板样式 */
    .history-panel {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100%;
        z-index: 1000;
        transition: transform 0.3s ease;
        border-right: 1px solid var(--color-border);
        max-height: none;
        padding: 12px 16px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        overflow: hidden;
    }

    /* [侧边栏控件]历史记录面板展开样式 */
    .history-panel.active {
        transform: translateX(280px);
    }
    
    /* [侧边栏控件]历史记录面板标题样式 */
    .history-panel h2 {
        font-size: 16px;
        margin-bottom: 12px;
        margin-left: 3em;
        padding-right: 30px;
    }

    /* [侧边栏控件]历史记录面板列表样式 */
    .history-list {
        list-style: none;
    }

    /* [侧边栏控件]历史记录面板列表项样式 */
    .history-list-item {
        padding: 10px;
        font-size: 14px;
    }

    /* [聊天区域]聊天区域样式 */
    .chat-container {
        flex: 1;
        display: flex;
        flex-direction: column;
        height: 100%;
    }
    
    /* [聊天区域]聊天框样式 */
    #chat-box {
        flex: 1;
        overflow-y: auto;
        padding: 16px;
        scroll-behavior: smooth; /* 平滑滚动 */
    }
    
    /* [聊天区域]聊天框滚动条样式 */
    #chat-box::-webkit-scrollbar {
        width: 0 !important;
    }
    
    /* [聊天区域]聊天头部调整 */
    .chat-header {
        padding: 12px 40px;
        position: relative;
    }
    
    /* [聊天区域]聊天头部标题样式 */
    .chat-header h1 {
        height: 32px;
        font-size: 16px;
        line-height: 32px;
        padding: 0;
        white-space: nowrap;
        overflow: hidden;
        text-overflow: ellipsis;
    }
    
    /* [主题切换]主题切换按钮样式 */
    .theme-toggle-button, .settings-button {
        top: 12px; /* 保持原有的顶部位置 */
        transform: none; /* 移除原有的垂直居中转换 */
        display: flex; /* 使用 flexbox 布局 */
        justify-content: center; /* 水平居中 */
        align-items: center; /* 垂直居中 */
    }

    /* [主题切换]主题切换按钮样式 */
    .theme-toggle-button {
        right: 50px;
        background-image: url('images/theme.png');
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
    }

    /* [设置]设置按钮样式 */
    .settings-button {
        right: 15px;
        background-image: url('images/settings.png');
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
    }
    
    /* [侧边栏控件]历史记录面板切换按钮样式 */
    .history-toggle {
        display: flex;
    }
    
    /* [聊天区域]消息区域调整 */
    /* [聊天区域]用户消息样式 */
    .user {
        padding-left: 0;
        padding-right: 0;
    }
    
    /* [聊天区域]输入框区域样式 */
    #input-area {
        flex-shrink: 0; /* 禁止被压缩 */
        padding: 8px;
    }
    
    /* [聊天区域]用户输入框样式 */
    #user-input {
        min-height: 36px;
        padding: 8px 12px;
    }
    
    /* [聊天区域]发送按钮样式 */
    #send-button {
        min-height: 36px;
        padding: 0 15px;
    }
}

/* 移动端适配样式 - 小屏 */
@media (max-width: 480px) {
    /* [侧边栏控件]历史记录面板样式 */
    .history-panel {
        position: fixed;
        top: 0;
        left: -280px;
        width: 280px;
        height: 100%;
        z-index: 1000;
        transition: transform 0.3s ease;
        border-right: 1px solid var(--color-border);
        padding: 12px 16px;
        box-shadow: 2px 0 10px rgba(0, 0, 0, 0.1);
        overflow: hidden;
    }
    /* [侧边栏控件]历史记录面板展开样式 */
    .history-panel.active {
        transform: translateX(280px);
    }

    /* [侧边栏控件]历史记录面板按钮样式 */
    .history-panel button {
        width: 100%; /* 按钮占满容器宽度 */
        padding: 12px 10px; /* 调整内边距，让内容更紧凑 */
        font-size: 14px; /* 文字适中 */
        border-radius: 6px; /* 稍微减小圆角 */
    }

    /* [侧边栏控件]历史记录面板标题样式 */
    .history-panel h2 {
        margin-left: 3em;
        margin-bottom: 8px; /* 减少标题与按钮间的距离 */
    }


    /* [侧边栏控件]历史记录面板按钮组样式 */
    .history-buttons {
        display: flex;
        flex-direction: column; /* 按钮垂直排列 */
        gap: 10px; /* 增加按钮之间的间距 */
    }
    
    /* [聊天区域]消息内容样式 */
    .message .markdown-content {
        padding: 10px 12px;
    }
    
    /* [设置]确认对话框样式 */
    .confirm-dialog {
        width: 90%;
        padding: 16px;
    }
    
    /* [设置]设置对话框样式 */
    .settings-dialog {
        width: 90%;
        padding: 16px;
    }

    /* [主题切换]主题切换按钮样式 */
    .theme-toggle-button, .settings-button {
        top: 12px; /* 保持原有的顶部位置 */
        transform: none; /* 移除原有的垂直居中转换 */
        display: flex; /* 使用 flexbox 布局 */
        justify-content: center; /* 水平居中 */
        align-items: center; /* 垂直居中 */
    }

    /* [主题切换]主题切换按钮样式 */
    .theme-toggle-button {
        right: 50px;
        background-image: url('images/theme.png');
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
    }

    /* [设置]设置按钮样式 */
    .settings-button {
        right: 15px;
        background-image: url('images/settings.png');
        background-size: contain;
        background-position: center;
        background-repeat: no-repeat;
    }
}