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

body {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", "Fira Sans", "Droid Sans", "Helvetica Neue", sans-serif;
    background: #f5f3ee;
    color: #2d2d2d;
    height: 100vh;
    overflow: hidden;
    overflow-x: hidden;
}

.container {
    display: flex;
    height: 100vh;
    max-width: 100vw;
    overflow-x: hidden;
}

/* 左侧边栏 */
.sidebar {
    width: 260px;
    background: #fcfbf8;
    border-right: 1px solid #e8e5dd;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    position: relative;
    transition: width 0.3s ease;
}

.sidebar.collapsed {
    width: 60px;
}

.sidebar.collapsed .sidebar-header,
.sidebar.collapsed .chat-history,
.sidebar.collapsed .sidebar-footer,
.sidebar.collapsed .sidebar-section-title {
    opacity: 0;
    visibility: hidden;
    transition: opacity 0.15s ease, visibility 0s linear 0.15s;
}

.sidebar-header,
.chat-history,
.sidebar-footer,
.sidebar-section-title {
    transition: opacity 0.15s ease 0.15s, visibility 0s linear 0s;
}

.sidebar-header {
    padding: 16px 12px;
    display: flex;
    flex-direction: column;
    gap: 16px;
}

.sidebar-top-row {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding-left: 4px;
}

.logo {
    font-size: 18px;
    font-weight: 700;
    color: #2d2d2d;
}

.collapse-btn-header {
    background: transparent;
    border: none;
    color: #5a5a5a;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.collapse-btn-header:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #2d2d2d;
}

.new-chat-btn {
    width: 100%;
    padding: 8px 16px;
    background: white;
    color: #2d2d2d;
    border: 1px solid #e8e5dd;
    border-radius: 8px;
    font-size: 14px;
    cursor: pointer;
    font-weight: 500;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.new-chat-btn:hover {
    background: #fcfbf8;
    border-color: #d4d1c7;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.08);
}

.sidebar-section-title {
    padding: 0 16px;
    margin-top: 4px;
    font-size: 12px;
    color: #8b7355;
    font-weight: 600;
    opacity: 0.8;
}

.chat-history {
    flex: 1;
    overflow-y: auto;
    padding: 8px 12px;
}

.chat-history-item {
    padding: 8px 12px;
    margin-bottom: 2px;
    border-radius: 6px;
    cursor: pointer;
    font-size: 13px;
    color: #5a5a5a;
    transition: background 0.2s;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
}

.chat-history-item:hover {
    background: #f5f3ee;
}

.chat-history-item.active {
    background: #ebe8df;
    color: #2d2d2d;
    font-weight: 500;
}

.chat-history-item-title {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.chat-history-item-delete {
    opacity: 0;
    padding: 4px;
    color: #8b7355;
    transition: all 0.2s;
    font-size: 12px;
    flex-shrink: 0;
}

.chat-history-item:hover .chat-history-item-delete {
    opacity: 1;
}

.chat-history-item-delete:hover {
    color: #c41e3a;
}

/* 侧边栏底部区域 */
.sidebar-footer {
    padding: 16px 12px;
    display: flex;
    align-items: center;
    gap: 12px;
    position: relative;
}

.user-profile {
    display: flex;
    align-items: center;
    gap: 10px;
    width: 100%;
    padding: 8px;
    border-radius: 8px;
    transition: background 0.2s;
}

.user-profile:hover {
    background: #f5f3ee;
}

.user-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #60a5fa;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    flex-shrink: 0;
}

.user-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 2px;
}

.user-name {
    font-size: 13px;
    font-weight: 600;
    color: #2d2d2d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-email {
    font-size: 11px;
    color: #8b7355;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 用户菜单按钮 */
.user-menu-btn {
    background: transparent;
    border: none;
    color: #8b7355;
    cursor: pointer;
    padding: 6px;
    border-radius: 6px;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    flex-shrink: 0;
}

.user-menu-btn:hover {
    background: rgba(139, 115, 85, 0.1);
    color: #5a5a5a;
}

/* 用户菜单弹出框 */
.user-menu-popover {
    position: absolute;
    bottom: calc(100% + 8px);
    right: 12px;
    background: white;
    border: 1px solid #e0e0e0;
    border-radius: 12px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.12), 0 2px 6px rgba(0, 0, 0, 0.08);
    padding: 6px;
    display: none;
    z-index: 1000;
    min-width: 180px;
    max-width: 220px;
    animation: slideUpFade 0.2s ease-out;
}

@keyframes slideUpFade {
    from {
        opacity: 0;
        transform: translateY(8px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.user-menu-popover.show {
    display: block;
}

.user-menu-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px 14px;
    cursor: pointer;
    transition: all 0.2s ease;
    border: none;
    background: transparent;
    width: 100%;
    text-align: left;
    font-size: 13.5px;
    color: #333333;
    text-decoration: none;
    border-radius: 8px;
    font-weight: 500;
}

.user-menu-item:hover {
    background: #f5f5f5;
    transform: translateX(2px);
}

.user-menu-item i {
    width: 18px;
    font-size: 15px;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #666666;
}

.user-menu-item:hover i {
    color: #333333;
}

.user-menu-item span {
    flex: 1;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.user-menu-item.logout-item {
    color: #e74c3c;
}

.user-menu-item.logout-item i {
    color: #e74c3c;
}

.user-menu-item.logout-item:hover {
    background: rgba(231, 76, 60, 0.08);
}

.user-menu-divider {
    height: 1px;
    background: #e8e8e8;
    margin: 4px 8px;
}

.sidebar-collapsed-content {
    display: none;
    flex-direction: column;
    align-items: center;
    justify-content: space-between;
    height: 100%;
    padding: 16px 0 16px 0;
    width: 100%;
}

.sidebar.collapsed .sidebar-collapsed-content {
    display: flex;
    position: absolute;
    top: 16px;
    bottom: 16px;
    left: 0;
    right: 0;
}

.sidebar-collapsed-top {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 0;
    width: 100%;
}

.sidebar-collapsed-bottom {
    margin-bottom: 12px;
}

.collapse-btn-collapsed {
    width: 36px;
    height: 36px;
    background: transparent;
    border: none;
    color: #5a5a5a;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    border-radius: 6px;
    transition: all 0.2s;
    margin: 0;
}

.collapse-btn-collapsed:hover {
    background: rgba(0, 0, 0, 0.05);
    color: #2d2d2d;
}

/* 已移除 .new-chat-btn-collapsed 相关样式 */

.user-avatar-collapsed {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: #60a5fa;
    color: #1a1a1a;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    font-weight: 600;
    cursor: default;
    margin-bottom: 4px;
}

/* 主聊天区域 */
.main-content {
    flex: 1;
    display: flex;
    flex-direction: column;
    background: #f5f3ee;
    max-width: 100%;
    overflow-x: hidden;
}

.top-bar {
    padding: 12px 20px;
    background: #fcfbf8;
    border-bottom: 1px solid #e8e5dd;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 16px;
}

.top-bar-right {
    display: flex;
    align-items: center;
    gap: 12px;
}

/* 移动端菜单按钮（默认桌面隐藏） */
.mobile-menu-btn {
    display: none;
    width: 36px;
    height: 36px;
    border: 1px solid #e8e5dd;
    background: white;
    color: #5a5a5a;
    border-radius: 6px;
    cursor: pointer;
    align-items: center;
    justify-content: center;
}
.mobile-menu-btn i {
    font-size: 16px;
}

.model-selector-wrapper {
    flex: 1;
    max-width: 320px;
    position: relative;
}

.model-selector-native {
    position: absolute;
    inset: 0;
    opacity: 0;
    pointer-events: none;
}

.model-selector-trigger {
    width: 100%;
    padding: 9px 12px;
    border-radius: 8px;
    border: 1px solid #e8e5dd;
    background: #ffffff;
    font-size: 14px;
    color: #2d2d2d;
    cursor: pointer;
    font-family: inherit;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06);
    transition: border-color 0.16s ease, box-shadow 0.16s ease, background 0.16s ease, transform 0.08s ease;
}

.model-selector-trigger:hover {
    border-color: #d4d1c7;
    background: #fdfaf3;
    box-shadow: 0 4px 10px rgba(15, 23, 42, 0.08);
}

.model-selector-trigger:active {
    transform: scale(0.99);
}

.model-selector-trigger-label {
    flex: 1;
    overflow: hidden;
    white-space: nowrap;
    text-overflow: ellipsis;
    text-align: left;
}

.model-selector-trigger-chevron {
    display: flex;
    align-items: center;
    justify-content: center;
    color: #8b7355;
    flex-shrink: 0;
}

.model-selector-trigger-chevron i {
    font-size: 12px;
}

.model-selector-wrapper.model-dropdown-open .model-selector-trigger {
    border-color: #8b7355;
    box-shadow: 0 10px 24px rgba(15, 23, 42, 0.16);
}

.model-selector-dropdown {
    position: absolute;
    top: calc(100% + 8px);
    left: 0;
    right: 0;
    background: #ffffff;
    border-radius: 12px;
    border: 1px solid #e5e7eb;
    box-shadow: 0 18px 45px rgba(15, 23, 42, 0.18);
    padding: 8px 0 10px;
    display: none;
    flex-direction: column;
    gap: 6px;
    z-index: 120;
}

.model-selector-wrapper.model-dropdown-open .model-selector-dropdown {
    display: flex;
}

.model-dropdown-search {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 6px 14px 4px;
}

.model-dropdown-search-icon {
    color: #9ca3af;
    font-size: 13px;
}

.model-dropdown-search-input {
    flex: 1;
    border: none;
    outline: none;
    background: transparent;
    font-size: 13px;
    color: #111827;
}

.model-dropdown-search-input::placeholder {
    color: #9ca3af;
}

.model-list {
    max-height: 320px;
    overflow-y: auto;
    padding: 4px 4px 2px;
}

.model-list-item {
    width: 100%;
    border: none;
    background: transparent;
    display: flex;
    align-items: flex-start;
    gap: 8px;
    padding: 8px 10px;
    border-radius: 8px;
    cursor: pointer;
    text-align: left;
    transition: background 0.14s ease, transform 0.08s ease;
}

.model-list-item:hover {
    background: #f3f4f6;
}

.model-list-item.active {
    background: #eef2ff;
}

.model-list-item-main {
    flex: 1;
    min-width: 0;
}

.model-list-item-title {
    font-size: 13px;
    font-weight: 500;
    color: #111827;
    margin-bottom: 2px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.model-list-item-desc {
    font-size: 12px;
    color: #6b7280;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.model-list-empty {
    padding: 10px 14px 6px;
    font-size: 12px;
    color: #9ca3af;
}

.model-dropdown-footer {
    padding: 4px 14px 4px;
}

.model-dropdown-hint {
    display: block;
    font-size: 11px;
    color: #9ca3af;
}

.api-key-section {
    display: none; /* 隐藏 API Key 输入区域 */
    gap: 8px;
    align-items: center;
}

.api-key-input {
    padding: 8px 12px;
    border: 1px solid #d4d1c7;
    border-radius: 6px;
    font-size: 13px;
    width: 200px;
    font-family: 'Courier New', monospace;
}

.api-key-btn {
    padding: 8px 16px;
    background: #2d2d2d;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    font-weight: 500;
    transition: background 0.2s;
}

.api-key-btn:hover {
    background: #1a1a1a;
}

/* 主题切换按钮 */
.theme-toggle-btn {
    background: transparent;
    border: 1px solid #e8e5dd;
    color: #5a5a5a;
    padding: 8px 12px;
    border-radius: 8px;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    width: 40px;
    height: 40px;
}

.theme-toggle-btn:hover {
    background: #f5f3ee;
    border-color: #8b7355;
    transform: scale(1.05);
    color: #2d2d2d;
}

.theme-toggle-btn i {
    transition: transform 0.3s ease;
}

.theme-toggle-btn:hover i {
    transform: rotate(20deg);
}

/* 消息区域 */
.messages-container {
    flex: 1;
    overflow-y: auto;
    overflow-x: hidden;
    padding: 24px 20px;
    display: flex;
    flex-direction: column;
    gap: 20px;
    max-width: 100%;
}

.message {
    max-width: 800px;
    margin: 0 auto;
    width: 100%;
    position: relative;
}

.message-header {
    font-weight: 600;
    margin-bottom: 8px;
    font-size: 14px;
    color: #5a5a5a;
}

.message-content {
    background: white;
    padding: 16px 20px;
    border-radius: 8px;
    font-size: 15px;
    line-height: 1.6;
    color: #2d2d2d;
    border: 1px solid #e8e5dd;
    position: relative;
    word-wrap: break-word;
    overflow-wrap: break-word;
    word-break: break-word;
    max-width: 100%;
    overflow-x: auto;
}

.web-search-text {
    display: block;
    font-size: 13px;
    color: #5a5a5a;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* 联网搜索结果卡片列表 */
.web-search-results {
    margin-top: 8px;
    display: flex;
    flex-direction: column;
    gap: 6px;
}

.web-search-result-card {
    border-radius: 8px;
    border: 1px solid #e8e5dd;
    background: #fcfbf8;
    overflow: hidden;
    transition: border-color 0.2s ease, box-shadow 0.2s ease, background 0.2s ease;
}

.web-search-result-card:hover {
    border-color: #d4d1c7;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.06);
    background: #fdfaf3;
}

.web-search-result-header {
    width: 100%;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 8px 12px;
    background: transparent;
    border: none;
    cursor: pointer;
    font-size: 13px;
    color: #333333;
    text-align: left;
}

.web-search-result-index {
    width: 22px;
    height: 22px;
    border-radius: 999px;
    background: #ebe8df;
    color: #8b7355;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.web-search-result-main {
    flex: 1;
    min-width: 0;
}

.web-search-result-title {
    font-weight: 500;
    font-size: 13px;
    color: #2d2d2d;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.web-search-result-subline {
    margin-top: 2px;
    font-size: 12px;
    color: #8b7355;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.web-search-result-toggle {
    flex-shrink: 0;
    color: #b0a18b;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.25s cubic-bezier(0.4, 0, 0.2, 1);
}

.web-search-toggle-icon {
    font-family: 'Font Awesome 6 Free';
    font-weight: 900;
}

.web-search-result-card.expanded .web-search-result-toggle {
    transform: rotate(180deg);
}

.web-search-result-body {
    padding: 0 12px;
    max-height: 0;
    opacity: 0;
    overflow: hidden;
    font-size: 13px;
    color: #4b4b4b;
    line-height: 1.5;
    transition: max-height 0.26s ease-out, opacity 0.2s ease-out, padding-top 0.2s ease-out, padding-bottom 0.2s ease-out;
}

.web-search-result-card.expanded .web-search-result-body {
    padding-top: 4px;
    padding-bottom: 28px;
    opacity: 1;
    animation: sweep-in 0.26s ease-out;
}

.web-search-result-snippet {
    margin-bottom: 4px;
}

.web-search-result-url {
    display: block;
    font-size: 12px;
    color: #2563eb;
    text-decoration: none;
    margin-bottom: 6px;
    word-break: break-all;
}

.web-search-result-url:hover {
    text-decoration: underline;
}

.web-search-result-meta {
    margin-top: 2px;
    font-size: 12px;
    color: #888888;
}

.user-message .message-content {
    background: #fcfbf8;
}

.assistant-message .message-content {
    background: white;
    font-family: 'ui-serif', Georgia, Cambria, 'Times New Roman', Times, serif;
    font-size: 16px;
    line-height: 1.4;
}

/* 消息附件标签显示 */
.message-attachments {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.message-attachment-tag {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 10px;
    background: #fef9ed;
    border: 1px solid #f5e9c8;
    border-radius: 6px;
    font-size: 12px;
    color: #5a5a5a;
    max-width: 200px;
    transition: all 0.2s;
}

.message-attachment-tag:hover {
    background: #fef5e0;
    border-color: #f0dba8;
    box-shadow: 0 2px 4px rgba(139, 115, 85, 0.1);
}

.message-attachment-thumbnail {
    width: 24px;
    height: 24px;
    border-radius: 4px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f3ee;
}

.message-attachment-thumbnail img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.message-attachment-icon {
    font-size: 16px;
    flex-shrink: 0;
}

.message-attachment-icon.fa-file-pdf {
    color: #dc3545;
}

.message-attachment-icon.fa-file-word {
    color: #2b5797;
}

.message-attachment-icon.fa-file {
    color: #8b7355;
}

.message-attachment-name {
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-weight: 500;
    color: #2d2d2d;
}

/* 消息操作按钮 */
.message-actions {
    position: absolute;
    bottom: -32px;
    right: 0;
    display: flex;
    gap: 4px;
    opacity: 0;
    transition: opacity 0.2s;
    background: white;
    border: 1px solid #e8e5dd;
    border-radius: 6px;
    padding: 4px;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.1);
}

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

.message-action-btn {
    padding: 6px 12px;
    background: transparent;
    border: none;
    border-radius: 4px;
    color: #5a5a5a;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    gap: 6px;
}

.message-action-btn:hover {
    background: #f5f3ee;
    color: #2d2d2d;
}

.message-action-btn i {
    font-size: 12px;
}


/* 编辑模式 */
.message-content-editable {
    min-height: 60px;
    outline: none;
    border: 2px solid #8b7355;
    background: white;
}

.message-edit-actions {
    display: flex;
    gap: 8px;
    margin-top: 8px;
    justify-content: flex-end;
}

.message-edit-btn {
    padding: 6px 16px;
    border: none;
    border-radius: 6px;
    font-size: 13px;
    cursor: pointer;
    transition: all 0.2s;
    font-weight: 500;
}

.message-edit-confirm {
    background: #2d2d2d;
    color: white;
}

.message-edit-confirm:hover {
    background: #1a1a1a;
}

.message-edit-cancel {
    background: #f5f3ee;
    color: #5a5a5a;
    border: 1px solid #e8e5dd;
}

.message-edit-cancel:hover {
    background: #ebe8df;
    color: #2d2d2d;
}

/* 思维链样式 */
.thinking-block {
    background: #fef9ed;
    border: 1px solid #f5e9c8;
    border-radius: 8px;
    margin-bottom: 12px;
    overflow: hidden;
    transition: all 0.3s ease;
    box-shadow: 0 1px 3px rgba(139, 115, 85, 0.05);
}

.thinking-block:hover {
    box-shadow: 0 2px 6px rgba(139, 115, 85, 0.08);
    border-color: #f0dba8;
}

.thinking-header {
    padding: 10px 14px;
    background: #fef5e0;
    cursor: pointer;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-size: 13px;
    color: #8b7355;
    font-weight: 500;
    user-select: none;
    transition: all 0.2s ease;
    gap: 8px;
}

.thinking-header:hover {
    background: #fef0d1;
}

.thinking-header:active {
    background: #feecc2;
}

.thinking-header span:first-child {
    display: flex;
    align-items: center;
    gap: 6px;
}

.thinking-header i.fa-brain {
    font-size: 13px;
}

.thinking-icon {
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: #8b7355;
}

.thinking-icon.collapsed {
    transform: rotate(-90deg);
}

.thinking-content {
    padding: 12px 14px;
    font-size: 14px;
    line-height: 1.6;
    color: #5a5a5a;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Roboto", "Oxygen", "Ubuntu", "Cantarell", sans-serif;
    max-height: 400px;
    overflow-y: auto;
    overflow-x: auto;
    max-width: 100%;
    word-wrap: break-word;
    overflow-wrap: break-word;
    transition: max-height 0.3s ease, 
                opacity 0.3s ease, 
                padding 0.3s ease;
    background: rgba(255, 255, 255, 0.3);
}

.thinking-content.collapsed {
    max-height: 0;
    padding: 0 14px;
    opacity: 0;
    overflow: hidden;
}

/* 思维链内容的 Markdown 样式 */
.thinking-content p {
    margin: 8px 0;
}

.thinking-content p:first-child {
    margin-top: 0;
}

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

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

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

.thinking-content h1,
.thinking-content h2,
.thinking-content h3,
.thinking-content h4,
.thinking-content h5,
.thinking-content h6 {
    margin: 12px 0 8px 0;
    font-weight: 600;
    line-height: 1.3;
}

.thinking-content h1 { font-size: 20px; }
.thinking-content h2 { font-size: 18px; }
.thinking-content h3 { font-size: 16px; }
.thinking-content h4 { font-size: 15px; }

.thinking-content strong,
.thinking-content b {
    font-weight: 600;
    color: #2d2d2d;
}

.thinking-content code {
    background: rgba(0, 0, 0, 0.05);
    padding: 2px 4px;
    border-radius: 3px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    font-size: 0.9em;
}

.thinking-content pre {
    background: rgba(0, 0, 0, 0.05);
    border: 1px solid rgba(0, 0, 0, 0.1);
    border-radius: 4px;
    padding: 8px;
    overflow-x: auto;
    margin: 8px 0;
}

.thinking-content pre code {
    background: none;
    padding: 0;
    border-radius: 0;
}

.thinking-content blockquote {
    border-left: 3px solid #f0dba8;
    padding-left: 12px;
    margin: 8px 0;
    color: #8b7355;
    font-style: italic;
}

/* 思维链滚动条优化 */
.thinking-content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

.thinking-content::-webkit-scrollbar-track {
    background: rgba(232, 229, 221, 0.2);
    border-radius: 3px;
}

.thinking-content::-webkit-scrollbar-thumb {
    background: rgba(139, 115, 85, 0.25);
    border-radius: 3px;
}

.thinking-content::-webkit-scrollbar-thumb:hover {
    background: rgba(139, 115, 85, 0.4);
}

/* 输入区域 */
.input-area {
    padding: 20px;
    background: #fcfbf8;
    border-top: 1px solid #e8e5dd;
}

.input-wrapper {
    max-width: 800px;
    margin: 0 auto;
    position: relative;
}

.input-box {
    width: 100%;
    min-height: 100px;
    max-height: 300px;
    padding: 16px 90px 16px 50px;
    border: 2px solid #d4d1c7;
    border-radius: 8px;
    font-size: 15px;
    font-family: inherit;
    resize: none;
    background: white;
    color: #2d2d2d;
    line-height: 1.5;
}

.input-box:focus {
    outline: none;
    border-color: #8b7355;
}

.send-btn {
    position: absolute;
    right: 12px;
    bottom: 12px;
    width: 36px;
    height: 36px;
    background: #2d2d2d;
    color: white;
    border: none;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.send-btn:hover:not(:disabled) {
    background: #1a1a1a;
}

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

.send-btn.stop-btn {
    background: #dc3545;
}

.send-btn.stop-btn:hover {
    background: #c82333;
}

.send-btn svg {
    transition: opacity 0.2s;
}

.send-btn .stop-icon {
    display: none;
}

.send-btn.stop-btn .send-icon {
    display: none;
}

.send-btn.stop-btn .stop-icon {
    display: block;
}

/* 附件按钮 */
.attachment-btn {
    position: absolute;
    left: 12px;
    bottom: 12px;
    width: 36px;
    height: 36px;
    background: white;
    color: #5a5a5a;
    border: 2px solid #d4d1c7;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 16px;
}

.attachment-btn:hover {
    background: #f5f3ee;
    color: #2d2d2d;
    border-color: #8b7355;
}

.attachment-btn:active {
    transform: scale(0.95);
}

/* 联网搜索开关按钮 */
.web-search-toggle-btn {
    position: absolute;
    left: 12px;
    bottom: 56px;
    width: 36px;
    height: 36px;
    background: white;
    color: #5a5a5a;
    border: 2px solid #d4d1c7;
    border-radius: 6px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    font-size: 18px;
}

.web-search-toggle-btn:hover {
    background: #f5f3ee;
    color: #2d2d2d;
    border-color: #8b7355;
}

.web-search-toggle-btn.active {
    background: #fef5e0;
    border-color: #8b7355;
    color: #8b7355;
    box-shadow: 0 0 0 1px rgba(139, 115, 85, 0.18);
}

/* 附件预览容器 */
.attachments-preview {
    display: flex;
    flex-wrap: wrap;
    gap: 12px;
    padding: 12px 0;
    margin-bottom: 8px;
}

/* 附件项 */
.attachment-item {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 10px;
    background: white;
    border: 2px solid #d4d1c7;
    border-radius: 8px;
    min-width: 200px;
    max-width: 300px;
    transition: all 0.2s;
}

.attachment-item:hover {
    border-color: #8b7355;
    box-shadow: 0 2px 8px rgba(0,0,0,0.08);
}

/* 图片预览 */
.attachment-image {
    position: relative;
    width: 60px;
    height: 60px;
    border-radius: 6px;
    overflow: hidden;
    flex-shrink: 0;
    background: #f5f3ee;
    display: flex;
    align-items: center;
    justify-content: center;
}

.attachment-image img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.attachment-loader {
    position: absolute;
    inset: 0;
    background: rgba(255, 255, 255, 0.9);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: #8b7355;
}

/* 文档预览 */
.attachment-doc {
    width: 60px;
    height: 60px;
    border-radius: 6px;
    background: #f5f3ee;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 28px;
    flex-shrink: 0;
}

.attachment-doc .fa-file-pdf {
    color: #dc3545;
}

.attachment-doc .fa-file-word {
    color: #2b5797;
}

.attachment-doc .fa-file {
    color: #5a5a5a;
}

/* 附件信息 */
.attachment-info {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px;
}

.attachment-name {
    font-size: 13px;
    color: #2d2d2d;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

.attachment-status {
    font-size: 12px;
    color: #8b7355;
}

.attachment-status.processing {
    color: #8b7355;
}

.attachment-status.ready {
    color: #28a745;
}

.attachment-status.error {
    color: #dc3545;
}

/* 移除按钮 */
.attachment-remove {
    position: absolute;
    top: -8px;
    right: -8px;
    width: 24px;
    height: 24px;
    background: #dc3545;
    color: white;
    border: 2px solid white;
    border-radius: 50%;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    transition: all 0.2s;
    box-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.attachment-remove:hover {
    background: #c82333;
    transform: scale(1.1);
}

.attachment-remove:active {
    transform: scale(0.95);
}

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

/* 移动端适配：侧边栏改为抽屉，默认隐藏，由按钮打开 */
@media (max-width: 768px) {
    .container {
        overflow: hidden;
        max-width: 100vw;
        position: relative;
    }

    /* 移动端遮罩层 */
    .sidebar-overlay {
        display: none;
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        background: rgba(0, 0, 0, 0.5);
        z-index: 999;
        opacity: 0;
        transition: opacity 0.3s ease;
    }

    .sidebar-overlay.active {
        display: block;
        opacity: 1;
    }

    .sidebar {
        position: fixed;
        top: 0;
        left: 0;
        bottom: 0;
        width: 260px;
        transform: translateX(-100%);
        transition: transform 0.3s ease;
        z-index: 1000;
        box-shadow: 0 4px 14px rgba(0,0,0,0.12);
    }

    /* 抽屉打开状态 */
    .sidebar.open {
        transform: translateX(0);
    }

    /* 覆盖桌面收起样式，移动端不使用 60px 收起宽度 */
    .sidebar.collapsed {
        width: 260px;
    }

    /* 抽屉模式下隐藏折叠区内容 */
    .sidebar-collapsed-content {
        display: none !important;
    }

    .main-content {
        margin-left: 0;
        max-width: 100vw;
        overflow-x: hidden;
    }

    /* 显示移动端菜单按钮，放在模型选择器左侧 */
    .mobile-menu-btn {
        display: inline-flex;
    }

	/* 移动端：历史项删除按钮常显 */
	.chat-history-item-delete {
		opacity: 1;
	}

    .model-selector-wrapper {
        max-width: none;
    }

    /* 移动端消息容器 */
    .messages-container {
        max-width: 100vw;
        overflow-x: hidden;
        padding: 16px 12px;
    }

    /* 移动端消息样式 */
    .message {
        max-width: 100%;
    }

    .message-content {
        max-width: 100%;
        overflow-x: auto;
        font-size: 14px;
    }

    /* 移动端输入区域 */
    .input-area {
        padding: 16px 12px;
    }

    .input-wrapper {
        max-width: 100%;
    }

    .input-box {
        max-width: 100%;
        font-size: 14px;
        min-height: 80px;
        padding: 12px 80px 12px 45px;
    }

    /* 移动端附件按钮 */
    .attachment-btn {
        width: 32px;
        height: 32px;
        left: 8px;
        bottom: 8px;
        font-size: 14px;
    }

    .web-search-toggle-btn {
        width: 32px;
        height: 32px;
        left: 8px;
        bottom: 46px;
        font-size: 16px;
    }

    .send-btn {
        width: 32px;
        height: 32px;
        right: 8px;
        bottom: 8px;
    }

    /* 移动端附件预览 */
    .attachment-item {
        min-width: 100%;
        max-width: 100%;
    }

    /* 移动端消息附件标签 */
    .message-attachment-tag {
        max-width: 150px;
        font-size: 11px;
        padding: 5px 8px;
    }

    .message-attachment-thumbnail {
        width: 20px;
        height: 20px;
    }

    .message-attachment-icon {
        font-size: 14px;
    }

    /* 移动端代码块 */
    .code-block-wrapper {
        max-width: 100%;
        font-size: 13px;
    }

    .code-block-wrapper pre {
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 移动端表格 */
    .message-content table {
        display: block;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
    }

    /* 移动端图片 */
    .message-content img {
        max-width: 100%;
        height: auto;
    }

    /* 移动端用户菜单 */
    .user-menu-popover {
        right: 8px;
        min-width: 160px;
        max-width: 200px;
    }

    .user-menu-item {
        padding: 9px 12px;
        font-size: 13px;
    }

    .user-menu-item i {
        font-size: 14px;
    }
}

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

::-webkit-scrollbar-thumb {
    background: #d4d1c7;
    border-radius: 4px;
}

::-webkit-scrollbar-thumb:hover {
    background: #c4c1b7;
}

/* 加载动画 */
.typing-indicator {
    display: inline-flex;
    gap: 4px;
    padding: 16px 20px;
}

.typing-dot {
    width: 8px;
    height: 8px;
    background: #8b7355;
    border-radius: 50%;
    animation: typing 1.4s infinite;
}

.typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes typing {
    0%, 60%, 100% {
        opacity: 0.3;
    }
    30% {
        opacity: 1;
    }
}

/* 空状态 */
.empty-state {
    flex: 1;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    color: #8b7355;
    gap: 16px;
}

.empty-state-icon {
    font-size: 48px;
    opacity: 0.3;
    color: #8b7355;
}

.empty-state-icon i {
    font-size: 48px;
}

.empty-state-text {
    font-size: 16px;
    opacity: 0.6;
}

/* 错误提示 */
.error-message {
    background: #fff3f3;
    border: 1px solid #ffc9c9;
    color: #c41e3a;
    padding: 12px 16px;
    border-radius: 6px;
    font-size: 13px;
    margin-bottom: 12px;
}

/* Logo */
.logo {
    font-size: 16px;
    font-weight: 600;
    color: #2d2d2d;
}

/* Markdown 样式 */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5,
.message-content h6 {
    margin: 16px 0 8px 0;
    font-weight: 600;
    line-height: 1.3;
}

.message-content h1 { font-size: 24px; }
.message-content h2 { font-size: 20px; }
.message-content h3 { font-size: 18px; }
.message-content h4 { font-size: 16px; }

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

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

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

/* 代码块容器 */
.code-block-wrapper {
    position: relative;
    margin: 12px 0;
    border-radius: 8px;
    overflow: hidden;
    background: #f8f9fa;
    border: 1px solid #e8e5dd;
    max-width: 100%;
}

.code-block-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 8px 12px;
    background: #e8e5dd;
    border-bottom: 1px solid #d4d1c7;
}

.code-lang {
    font-size: 12px;
    font-weight: 600;
    color: #5a5a5a;
    text-transform: uppercase;
    letter-spacing: 0.5px;
}

.code-copy-btn {
    background: transparent;
    border: none;
    color: #5a5a5a;
    cursor: pointer;
    padding: 4px 8px;
    border-radius: 4px;
    font-size: 14px;
    transition: all 0.2s;
    opacity: 0.6;
}

.code-copy-btn:hover {
    background: rgba(0, 0, 0, 0.05);
    opacity: 1;
}

.code-copy-btn.copied {
    color: #10a37f;
}

.code-block-wrapper pre {
    background: #f8f9fa;
    padding: 12px;
    margin: 0;
    overflow-x: auto;
    max-width: 100%;
    white-space: pre;
}

.code-block-wrapper pre code {
    background: none;
    padding: 0;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    font-size: 0.9em;
    line-height: 1.5;
}

/* 行内代码 */
.message-content code {
    background: #f8f9fa;
    padding: 2px 6px;
    border-radius: 4px;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
    font-size: 0.9em;
    word-break: break-all;
    overflow-wrap: break-word;
}

/* 兼容旧的没有 wrapper 的代码块 */
.message-content pre:not(.code-block-wrapper pre) {
    background: #f8f9fa;
    border: 1px solid #e8e5dd;
    border-radius: 6px;
    padding: 12px;
    overflow-x: auto;
    margin: 12px 0;
}

.message-content pre:not(.code-block-wrapper pre) code {
    background: none;
    padding: 0;
    border-radius: 0;
}

.message-content blockquote {
    border-left: 3px solid #d4d1c7;
    padding-left: 16px;
    margin: 12px 0;
    color: #5a5a5a;
    font-style: italic;
}

.message-content table {
    border-collapse: collapse;
    width: 100%;
    margin: 12px 0;
    display: block;
    overflow-x: auto;
    max-width: 100%;
}

.message-content table th,
.message-content table td {
    border: 1px solid #e8e5dd;
    padding: 8px 12px;
    text-align: left;
}

.message-content table th {
    background: #f8f9fa;
    font-weight: 600;
}

.message-content a {
    color: #2d2d2d;
    text-decoration: underline;
    word-break: break-all;
    overflow-wrap: break-word;
}

.message-content a:hover {
    color: #1a1a1a;
}

.message-content img {
    max-width: 100%;
    height: auto;
    border-radius: 6px;
    margin: 12px 0;
}

.message-content hr {
    border: none;
    border-top: 1px solid #e8e5dd;
    margin: 16px 0;
}

/* 增强的 Markdown 支持 */
.message-content strong,
.message-content b {
    font-weight: 600;
    color: #1a1a1a;
}

.message-content em,
.message-content i {
    font-style: italic;
}

.message-content del,
.message-content s {
    text-decoration: line-through;
    opacity: 0.7;
}

.message-content mark {
    background: #fff3cd;
    padding: 2px 4px;
    border-radius: 2px;
}

.message-content kbd {
    display: inline-block;
    padding: 3px 6px;
    font-size: 0.85em;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', monospace;
    background: #f8f9fa;
    border: 1px solid #d4d1c7;
    border-radius: 4px;
    box-shadow: 0 1px 0 rgba(0,0,0,0.1);
}

.message-content sup {
    vertical-align: super;
    font-size: 0.75em;
}

.message-content sub {
    vertical-align: sub;
    font-size: 0.75em;
}

.message-content details {
    margin: 12px 0;
    padding: 12px;
    background: #f8f9fa;
    border: 1px solid #e8e5dd;
    border-radius: 6px;
}

.message-content summary {
    cursor: pointer;
    font-weight: 600;
    margin: -12px -12px 12px -12px;
    padding: 12px;
    background: #fcfbf8;
    border-radius: 6px 6px 0 0;
}

.message-content details[open] summary {
    border-bottom: 1px solid #e8e5dd;
    border-radius: 6px 6px 0 0;
}

/* 任务列表 */
.message-content input[type="checkbox"] {
    margin-right: 8px;
    cursor: pointer;
}

.message-content ul.task-list,
.message-content ul.contains-task-list {
    list-style: none;
    padding-left: 0;
}

.message-content .task-list-item {
    padding-left: 0;
    display: flex;
    align-items: flex-start;
    gap: 8px;
}

/* ============================================
   Dark Theme Styles (参考 umint-ai.hf.space)
   ============================================ */
body.dark-theme {
    background: #1a1a1a;
    color: #e0e0e0;
}

body.dark-theme .container {
    background: #1a1a1a;
}

/* 侧边栏 */
body.dark-theme .sidebar {
    background: #1e1e1e;
    border-right: 1px solid #2f2f2f;
}

body.dark-theme .sidebar-header {
    border-bottom: none;
}

body.dark-theme .logo {
    color: #e0e0e0;
}

body.dark-theme .collapse-btn-header {
    color: #b0b0b0;
}

body.dark-theme .collapse-btn-header:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
}

body.dark-theme .new-chat-btn {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #e0e0e0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.dark-theme .new-chat-btn:hover {
    background: #333333;
    border-color: #4a4a4a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
}

body.dark-theme .sidebar-section-title {
    color: #888888;
}

body.dark-theme .chat-history-item {
    color: #b0b0b0;
}

body.dark-theme .chat-history-item:hover {
    background: #2a2a2a;
}

body.dark-theme .chat-history-item.active {
    background: #2a2a2a;
    color: #e0e0e0;
}

body.dark-theme .chat-history-item-delete {
    color: #666666;
}

body.dark-theme .chat-history-item:hover .chat-history-item-delete {
    opacity: 1;
}

body.dark-theme .chat-history-item-delete:hover {
    color: #ff6b6b;
}

body.dark-theme .sidebar-footer {
    border-top: none;
}

body.dark-theme .user-profile:hover {
    background: #2a2a2a;
}

body.dark-theme .user-avatar {
    background: #60a5fa;
    color: #1a1a1a;
}

body.dark-theme .user-name {
    color: #e0e0e0;
}

body.dark-theme .user-email {
    color: #888888;
}

body.dark-theme .sidebar-collapsed-content {
    background: #1e1e1e;
}

body.dark-theme .collapse-btn-collapsed {
    color: #b0b0b0;
}

body.dark-theme .collapse-btn-collapsed:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #e0e0e0;
}

body.dark-theme .new-chat-btn-collapsed {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #e0e0e0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.2);
}

body.dark-theme .new-chat-btn-collapsed:hover {
    background: #333333;
    border-color: #4a4a4a;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.3);
} */

body.dark-theme .user-avatar-collapsed {
    background: #60a5fa;
    color: #1a1a1a;
}

/* 加载条样式 */
body.dark-theme .typing-dot {
    background: #60a5fa;
}

/* 顶部栏 */
body.dark-theme .top-bar {
    background: #1e1e1e;
    border-bottom: 1px solid #2a2a2a;
}

body.dark-theme .mobile-menu-btn {
    border: 1px solid #2a2a2a;
    background: #2a2a2a;
    color: #b0b0b0;
}

body.dark-theme .mobile-menu-btn:hover {
    background: #333333;
    color: #e0e0e0;
}

body.dark-theme .model-selector-trigger {
    border: 1px solid #2a2a2a;
    background: #2a2a2a;
    color: #e0e0e0;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}

body.dark-theme .model-selector-trigger:hover {
    border-color: #3a3a3a;
    background: #333333;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.45);
}

body.dark-theme .model-selector-wrapper.model-dropdown-open .model-selector-trigger {
    border-color: #4a4a4a;
    box-shadow: 0 8px 18px rgba(0, 0, 0, 0.7);
}

body.dark-theme .model-selector-trigger-chevron {
    color: #9ca3af;
}

body.dark-theme .model-selector-dropdown {
    background: #020617;
    border-color: #1f2937;
    box-shadow: 0 18px 40px rgba(0, 0, 0, 0.9);
}

body.dark-theme .model-dropdown-search-input {
    color: #e5e7eb;
}

body.dark-theme .model-dropdown-search-input::placeholder {
    color: #6b7280;
}

body.dark-theme .model-dropdown-search-icon {
    color: #6b7280;
}

body.dark-theme .model-list-item:hover {
    background: rgba(31, 41, 55, 0.85);
}

body.dark-theme .model-list-item.active {
    background: rgba(37, 99, 235, 0.18);
}

body.dark-theme .model-list-item-title {
    color: #e5e7eb;
}

body.dark-theme .model-list-item-desc {
    color: #9ca3af;
}

body.dark-theme .model-list-empty,
body.dark-theme .model-dropdown-hint {
    color: #6b7280;
}

body.dark-theme .theme-toggle-btn {
    border: 1px solid #2a2a2a;
    color: #b0b0b0;
}

body.dark-theme .theme-toggle-btn:hover {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #e0e0e0;
}

/* 主内容区 */
body.dark-theme .main-content {
    background: #1a1a1a;
}

/* 消息区域 */
body.dark-theme .messages-container {
    background: #1a1a1a;
}

body.dark-theme .message-header {
    color: #888888;
}

body.dark-theme .message-content {
    background: #2a2a2a;
    color: #e0e0e0;
    border: 1px solid #333333;
}

body.dark-theme .user-message .message-content {
    background: #2a2a2a;
}

body.dark-theme .assistant-message .message-content {
    background: #2a2a2a;
}

/* 联网搜索按钮与文字 - 深色主题 */
body.dark-theme .web-search-toggle-btn {
    background: #2a2a2a;
    border-color: #3a3a3a;
    color: #b0b0b0;
}

body.dark-theme .web-search-toggle-btn:hover {
    background: #333333;
    border-color: #4a4a4a;
    color: #e0e0e0;
}

body.dark-theme .web-search-toggle-btn.active {
    background: #25314a;
    border-color: #3b4b6a;
    color: #e0e7ff;
    box-shadow: 0 0 0 1px rgba(96, 165, 250, 0.4);
}

body.dark-theme .web-search-text {
    color: #cbd5f5;
}

body.dark-theme .web-search-result-card {
    background: #151515;
    border-color: #2a2a2a;
    position: relative;
}

body.dark-theme .web-search-result-card:hover {
    background: #18181b;
    border-color: #3b82f6;
    box-shadow: 0 4px 10px rgba(0, 0, 0, 0.16);
}

body.dark-theme .web-search-result-card::before {
    content: '';
    position: absolute;
    inset: 0;
    background: linear-gradient(120deg,
        rgba(59, 130, 246, 0) 0%,
        rgba(59, 130, 246, 0.15) 40%,
        rgba(96, 165, 250, 0.22) 60%,
        rgba(59, 130, 246, 0) 100%);
    transform: translateX(-120%);
    opacity: 0;
    pointer-events: none;
}

body.dark-theme .web-search-result-card:hover::before {
    animation: web-search-card-sweep 0.5s ease-out;
}

@keyframes web-search-card-sweep {
    0% {
        transform: translateX(-120%);
        opacity: 0;
    }
    35% {
        opacity: 1;
    }
    100% {
        transform: translateX(120%);
        opacity: 0;
    }
}

body.dark-theme .web-search-result-index {
    background: #1f2937;
    color: #e5e7eb;
}

body.dark-theme .web-search-result-title {
    color: #e5e7eb;
}

body.dark-theme .web-search-result-subline {
    color: #9ca3af;
}

body.dark-theme .web-search-result-body {
    color: #d1d5db;
}

body.dark-theme .web-search-result-url {
    color: #60a5fa;
}

body.dark-theme .web-search-result-meta {
    color: #9ca3af;
}

body.dark-theme .message-attachment {
    background: #333333;
    border: 1px solid #3a3a3a;
}

body.dark-theme .message-attachment-name {
    color: #e0e0e0;
}

body.dark-theme .message-actions {
    background: #2a2a2a;
    border: 1px solid #333333;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.5);
}

body.dark-theme .message-action-btn {
    color: #b0b0b0;
}

body.dark-theme .message-action-btn:hover {
    background: #333333;
    color: #e0e0e0;
}

body.dark-theme .message-content-editable {
    border: 2px solid #4a4a4a;
    background: #2a2a2a;
    color: #e0e0e0;
}

body.dark-theme .message-edit-cancel {
    background: #2a2a2a;
    color: #b0b0b0;
    border: 1px solid #333333;
}

body.dark-theme .message-edit-cancel:hover {
    background: #333333;
    color: #e0e0e0;
}

/* 思维链样式 */
body.dark-theme .thinking-block {
    background: #1e1e1e;
    border: 1px solid #3a3a3a;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.3);
}

body.dark-theme .thinking-block:hover {
    box-shadow: 0 2px 6px rgba(0, 0, 0, 0.4);
    border-color: #4a4a4a;
}

body.dark-theme .thinking-header {
    background: #252525;
    color: #60a5fa;
    font-weight: 500;
}

body.dark-theme .thinking-header:hover {
    background: #2a2a2a;
}

body.dark-theme .thinking-header:active {
    background: #2f2f2f;
}

body.dark-theme .thinking-icon {
    color: #60a5fa;
}

body.dark-theme .thinking-content {
    color: #c9d1d9;
    background: rgba(30, 30, 30, 0.5);
}

/* 思维链内容文本样式优化 */
body.dark-theme .thinking-content strong,
body.dark-theme .thinking-content b {
    color: #e6edf3;
    font-weight: 600;
}

body.dark-theme .thinking-content code {
    background: #2d333b;
    color: #7ee787;
    border: 1px solid #3a3a3a;
}

body.dark-theme .thinking-content pre {
    background: #161b22;
    border: 1px solid #3a3a3a;
}

body.dark-theme .thinking-content pre code {
    background: transparent;
    color: #c9d1d9;
    border: none;
}

body.dark-theme .thinking-content h1,
body.dark-theme .thinking-content h2,
body.dark-theme .thinking-content h3,
body.dark-theme .thinking-content h4,
body.dark-theme .thinking-content h5,
body.dark-theme .thinking-content h6 {
    color: #e6edf3;
}

body.dark-theme .thinking-content blockquote {
    border-left-color: #3a3a3a;
    background: #1a1a1a;
    color: #8b949e;
}

/* 思维链滚动条样式 */
body.dark-theme .thinking-content::-webkit-scrollbar {
    width: 6px;
    height: 6px;
}

body.dark-theme .thinking-content::-webkit-scrollbar-track {
    background: rgba(58, 58, 58, 0.2);
    border-radius: 3px;
}

body.dark-theme .thinking-content::-webkit-scrollbar-thumb {
    background: rgba(96, 165, 250, 0.3);
    border-radius: 3px;
}

body.dark-theme .thinking-content::-webkit-scrollbar-thumb:hover {
    background: rgba(96, 165, 250, 0.5);
}

/* 输入区域 */
body.dark-theme .input-area {
    background: #1e1e1e;
    border-top: 1px solid #2a2a2a;
}

body.dark-theme .input-box {
    border: 2px solid #2a2a2a;
    background: #2a2a2a;
    color: #e0e0e0;
}

body.dark-theme .input-box::placeholder {
    color: #666666;
}

body.dark-theme .input-box:focus {
    border-color: #4a4a4a;
}

body.dark-theme .send-btn {
    background: #3a3a3a;
    color: #e0e0e0;
}

body.dark-theme .send-btn:hover:not(:disabled) {
    background: #4a4a4a;
}

body.dark-theme .send-btn:disabled {
    background: #2a2a2a;
    color: #666666;
}

body.dark-theme .attachment-btn {
    background: #2a2a2a;
    border: 1px solid #333333;
    color: #b0b0b0;
}

body.dark-theme .attachment-btn:hover {
    background: #333333;
    color: #e0e0e0;
}

/* 附件预览 */
body.dark-theme .attachment-preview {
    background: #2a2a2a;
    border: 1px solid #333333;
}

body.dark-theme .attachment-item {
    background: #333333;
    border: 1px solid #3a3a3a;
}

body.dark-theme .attachment-item-name {
    color: #e0e0e0;
}

body.dark-theme .attachment-item-remove {
    color: #888888;
}

body.dark-theme .attachment-item-remove:hover {
    color: #ff6b6b;
}

/* 空状态 */
body.dark-theme .empty-state {
    color: #666666;
}

body.dark-theme .empty-state-icon {
    color: #666666;
    opacity: 0.5;
}

body.dark-theme .empty-state-text {
    opacity: 0.7;
}

/* 错误提示 */
body.dark-theme .error-message {
    background: #3a2525;
    border: 1px solid #4a3333;
    color: #ff6b6b;
}

/* 代码块样式 */
body.dark-theme .message-content pre {
    background: #1f2937;
    border: 1px solid #374151;
}

body.dark-theme .message-content pre:not(.code-block-wrapper pre) {
    background: #1f2937;
    border: 1px solid #374151;
}

body.dark-theme .message-content pre:not(.code-block-wrapper pre) code {
    background: transparent;
    color: #d1d5db;
}

body.dark-theme .message-content code {
    background: #374151;
    color: #d1d5db;
    padding: 2px 6px;
}

body.dark-theme .message-content pre code {
    background: transparent;
    color: #d1d5db;
}

/* 代码块包装器 */
body.dark-theme .code-block-wrapper {
    background: #1f2937;
    border: 1px solid #374151;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.2);
}

body.dark-theme .code-block-header {
    background: #1f2937;
    border-bottom: 1px solid #374151;
    padding: 10px 14px;
}

body.dark-theme .code-lang {
    color: #9ca3af;
    font-weight: 600;
    font-size: 11px;
    letter-spacing: 0.5px;
    text-transform: uppercase;
    padding: 0;
    background: transparent;
    border-radius: 0;
    display: inline-block;
}

body.dark-theme .code-block-wrapper pre {
    background: #1f2937;
    padding: 16px;
}

body.dark-theme .code-block-wrapper pre code {
    background: transparent;
    color: #d1d5db;
    font-family: 'Monaco', 'Menlo', 'Ubuntu Mono', 'Consolas', 'source-code-pro', monospace;
}

body.dark-theme .code-block-wrapper pre code.hljs {
    background: #1f2937;
    color: #d1d5db;
}

/* Highlight.js 暗色主题配色覆盖（简洁扁平现代配色） */

/* 关键字 */
body.dark-theme .code-block-wrapper pre code .hljs-keyword,
body.dark-theme .code-block-wrapper pre code .hljs-selector-tag,
body.dark-theme .code-block-wrapper pre code .hljs-built_in,
body.dark-theme .code-block-wrapper pre code .hljs-name {
    color: #c678dd; /* 紫色 - 关键字 */
}

/* 字符串 */
body.dark-theme .code-block-wrapper pre code .hljs-string,
body.dark-theme .code-block-wrapper pre code .hljs-attr {
    color: #98c379; /* 绿色 - 字符串 */
}

/* 注释 */
body.dark-theme .code-block-wrapper pre code .hljs-comment,
body.dark-theme .code-block-wrapper pre code .hljs-quote {
    color: #5c6370; /* 灰色 - 注释 */
    font-style: italic;
}

/* 数字 */
body.dark-theme .code-block-wrapper pre code .hljs-number,
body.dark-theme .code-block-wrapper pre code .hljs-literal {
    color: #d19a66; /* 橙色 - 数字 */
}

/* 函数名 */
body.dark-theme .code-block-wrapper pre code .hljs-function,
body.dark-theme .code-block-wrapper pre code .hljs-title {
    color: #61afef; /* 蓝色 - 函数名 */
}

/* 变量 */
body.dark-theme .code-block-wrapper pre code .hljs-variable,
body.dark-theme .code-block-wrapper pre code .hljs-template-variable {
    color: #e06c75; /* 红色 - 变量 */
}

/* 类型 */
body.dark-theme .code-block-wrapper pre code .hljs-type,
body.dark-theme .code-block-wrapper pre code .hljs-class {
    color: #e5c07b; /* 黄色 - 类型 */
}

/* 操作符 */
body.dark-theme .code-block-wrapper pre code .hljs-operator {
    color: #56b6c2; /* 青色 - 操作符 */
}

/* 属性 */
body.dark-theme .code-block-wrapper pre code .hljs-property {
    color: #61afef; /* 蓝色 - 属性 */
}

/* 标签 */
body.dark-theme .code-block-wrapper pre code .hljs-tag {
    color: #e06c75; /* 红色 - 标签 */
}

/* Bash/Shell 特定 */
body.dark-theme .code-block-wrapper pre code .hljs-built_in-name,
body.dark-theme .code-block-wrapper pre code .hljs-shebang {
    color: #56b6c2; /* 青色 */
}

/* Bash 命令 */
body.dark-theme .code-block-wrapper pre code.language-bash .hljs-built_in,
body.dark-theme .code-block-wrapper pre code.language-sh .hljs-built_in,
body.dark-theme .code-block-wrapper pre code.language-shell .hljs-built_in {
    color: #61afef; /* 蓝色 - Bash 命令 */
}

/* Bash 变量 */
body.dark-theme .code-block-wrapper pre code.language-bash .hljs-variable,
body.dark-theme .code-block-wrapper pre code.language-sh .hljs-variable,
body.dark-theme .code-block-wrapper pre code.language-shell .hljs-variable {
    color: #e5c07b; /* 黄色 - Bash 变量 */
}

/* 确保代码块头部更明显 */
body.dark-theme .code-block-header {
    border-bottom: 1px solid #374151;
}

/* 代码块整体增强 */
body.dark-theme .code-block-wrapper {
    border-radius: 8px;
    overflow: hidden;
}

body.dark-theme .code-copy-btn {
    color: #5c6370;
}

body.dark-theme .code-copy-btn:hover {
    background: rgba(97, 175, 239, 0.15);
    color: #61afef;
}

body.dark-theme .code-copy-btn.copied {
    color: #4ade80;
}

/* 粗体样式 */
body.dark-theme .message-content strong,
body.dark-theme .message-content b {
    color: #e0e0e0;
    font-weight: 600;
}

/* 链接样式 */
body.dark-theme .message-content a {
    color: #6ab7ff;
}

body.dark-theme .message-content a:hover {
    color: #8cc8ff;
}

/* 表格样式 */
body.dark-theme .message-content table {
    border-color: #333333;
}

body.dark-theme .message-content th {
    background: #2a2a2a;
    border-color: #333333;
}

body.dark-theme .message-content td {
    border-color: #333333;
}

body.dark-theme .message-content tr:nth-child(even) {
    background: #252525;
}

/* 引用样式 */
body.dark-theme .message-content blockquote {
    border-left-color: #4a4a4a;
    background: #252525;
    color: #b0b0b0;
}

/* 水平线 */
body.dark-theme .message-content hr {
    border-color: #333333;
}

/* 滚动条样式 */
body.dark-theme ::-webkit-scrollbar {
    width: 8px;
    height: 8px;
}

body.dark-theme ::-webkit-scrollbar-track {
    background: #1a1a1a;
}

body.dark-theme ::-webkit-scrollbar-thumb {
    background: #3a3a3a;
    border-radius: 4px;
}

body.dark-theme ::-webkit-scrollbar-thumb:hover {
    background: #4a4a4a;
}

/* 暗色主题：用户菜单 */
body.dark-theme .user-menu-btn {
    color: #888888;
}

body.dark-theme .user-menu-btn:hover {
    background: rgba(255, 255, 255, 0.05);
    color: #b0b0b0;
}

body.dark-theme .user-menu-popover {
    background: #2d2d2d;
    border: 1px solid #404040;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.4), 0 2px 6px rgba(0, 0, 0, 0.3);
}

body.dark-theme .user-menu-item {
    color: #e8e8e8;
}

body.dark-theme .user-menu-item:hover {
    background: #383838;
}

body.dark-theme .user-menu-item i {
    color: #a0a0a0;
}

body.dark-theme .user-menu-item:hover i {
    color: #e8e8e8;
}

body.dark-theme .user-menu-item.logout-item {
    color: #ff6b6b;
}

body.dark-theme .user-menu-item.logout-item i {
    color: #ff6b6b;
}

body.dark-theme .user-menu-item.logout-item:hover {
    background: rgba(255, 107, 107, 0.12);
}

body.dark-theme .user-menu-divider {
    background: #404040;
}

/* ========================================
   游客限制登录模态框
   ======================================== */
.guest-limit-modal {
    display: none;
    position: fixed;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: rgba(0, 0, 0, 0.6);
    z-index: 10000;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    backdrop-filter: blur(4px);
    animation: fadeIn 0.2s ease-out;
}

@keyframes fadeIn {
    from {
        opacity: 0;
    }
    to {
        opacity: 1;
    }
}

.guest-limit-modal-content {
    background: white;
    border-radius: 16px;
    padding: 40px 32px 32px;
    max-width: 480px;
    width: 100%;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.25);
    position: relative;
    animation: slideUp 0.3s ease-out;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.guest-limit-modal-close {
    position: absolute;
    top: 16px;
    right: 16px;
    background: transparent;
    border: none;
    color: #94a3b8;
    font-size: 20px;
    cursor: pointer;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.guest-limit-modal-close:hover {
    background: #f1f5f9;
    color: #64748b;
}

.guest-limit-modal-icon {
    width: 64px;
    height: 64px;
    background: linear-gradient(135deg, #60a5fa 0%, #3b82f6 100%);
    border-radius: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 24px;
    font-size: 28px;
    color: white;
}

.guest-limit-modal-title {
    font-size: 22px;
    font-weight: 600;
    color: #1e293b;
    text-align: center;
    margin-bottom: 16px;
}

.guest-limit-modal-description {
    font-size: 15px;
    color: #64748b;
    text-align: center;
    line-height: 1.6;
    margin-bottom: 32px;
}

.guest-limit-modal-description strong {
    color: #3b82f6;
    font-weight: 600;
}

.guest-limit-modal-actions {
    display: flex;
    justify-content: center;
}

.guest-limit-btn-login {
    background: linear-gradient(135deg, #3b82f6 0%, #2563eb 100%);
    color: white;
    border: none;
    border-radius: 12px;
    padding: 14px 32px;
    font-size: 15px;
    font-weight: 600;
    cursor: pointer;
    display: flex;
    align-items: center;
    gap: 8px;
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(59, 130, 246, 0.3);
}

.guest-limit-btn-login:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 16px rgba(59, 130, 246, 0.4);
}

.guest-limit-btn-login:active {
    transform: translateY(0);
}

/* 暗色主题 */
body.dark-theme .guest-limit-modal {
    background: rgba(0, 0, 0, 0.75);
}

body.dark-theme .guest-limit-modal-content {
    background: #1e293b;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.5);
}

body.dark-theme .guest-limit-modal-close {
    color: #64748b;
}

body.dark-theme .guest-limit-modal-close:hover {
    background: #334155;
    color: #94a3b8;
}

body.dark-theme .guest-limit-modal-title {
    color: #f1f5f9;
}

body.dark-theme .guest-limit-modal-description {
    color: #94a3b8;
}

body.dark-theme .guest-limit-modal-description strong {
    color: #60a5fa;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .guest-limit-modal-content {
        padding: 32px 24px 24px;
        max-width: calc(100% - 32px);
    }
    
    .guest-limit-modal-icon {
        width: 56px;
        height: 56px;
        font-size: 24px;
        margin-bottom: 20px;
    }
    
    .guest-limit-modal-title {
        font-size: 20px;
    }
    
    .guest-limit-modal-description {
        font-size: 14px;
        margin-bottom: 24px;
    }
    
    .guest-limit-btn-login {
        padding: 12px 28px;
        font-size: 14px;
    }
}

/* 模型加载状态样式（嵌入模型下拉面板） */
.model-loading-status {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 4px 14px 2px;
    font-size: 12px;
    color: #6b7280;
}

.model-loading-spinner {
    width: 16px;
    height: 16px;
    border: 2px solid #e8e5dd;
    border-top-color: #8b7355;
    border-radius: 50%;
    animation: spin 0.8s linear infinite;
    flex-shrink: 0;
}

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

.model-loading-text {
    flex: 1;
    color: #5a5a5a;
}

.model-retry-btn {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 12px;
    background: #f5f3ee;
    border: 1px solid #d4d1c7;
    border-radius: 6px;
    color: #5a5a5a;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    flex-shrink: 0;
}

.model-retry-btn:hover {
    background: #ebe8df;
    border-color: #8b7355;
    color: #2d2d2d;
}

.model-retry-btn:active {
    transform: scale(0.95);
}

.model-retry-btn i {
    font-size: 11px;
}

/* 深色主题适配 */
body.dark-theme .model-loading-status {
    color: #9ca3af;
}

body.dark-theme .model-loading-spinner {
    border-color: #334155;
    border-top-color: #60a5fa;
}

body.dark-theme .model-loading-text {
    color: #94a3b8;
}

body.dark-theme .model-retry-btn {
    background: #334155;
    border-color: #475569;
    color: #94a3b8;
}

body.dark-theme .model-retry-btn:hover {
    background: #475569;
    border-color: #60a5fa;
    color: #f1f5f9;
}

/* 移动端适配 */
@media (max-width: 768px) {
    .model-loading-status {
        padding: 8px 12px;
        font-size: 12px;
        gap: 8px;
    }
    
    .model-loading-spinner {
        width: 14px;
        height: 14px;
    }
    
    .model-retry-btn {
        padding: 5px 10px;
        font-size: 11px;
    }
}

