/* 全局样式 */
:root {
    /* 暗色主题变量 */
    --dark-background-color: #1a1a1a;
    --dark-text-color: #ffffff;
    --dark-secondary-text: #aaaaaa;
    --dark-border-color: #333333;
    --dark-input-bg: #222222;
    --dark-button-hover: #333333;
    --dark-menu-bg: #232323;
    
    /* 浅色主题变量 */
    --light-background-color: #f5f5f5;
    --light-text-color: #333333;
    --light-secondary-text: #666666;
    --light-border-color: #e0e0e0;
    --light-input-bg: #ffffff;
    --light-button-hover: #e9e9e9;
    --light-menu-bg: #ffffff;
    
    /* 共享变量 */
    --header-height: 60px;
    --accent-blue: #3a8dff;
    
    /* 默认使用暗色主题 */
    --background-color: var(--dark-background-color);
    --text-color: var(--dark-text-color);
    --secondary-text: var(--dark-secondary-text);
    --border-color: var(--dark-border-color);
    --input-bg: var(--dark-input-bg);
    --button-hover: var(--dark-button-hover);
    --menu-bg: var(--dark-menu-bg);
}

/* 浅色主题类 */
.light-theme {
    --background-color: var(--light-background-color);
    --text-color: var(--light-text-color);
    --secondary-text: var(--light-secondary-text);
    --border-color: var(--light-border-color);
    --input-bg: var(--light-input-bg);
    --button-hover: var(--light-button-hover);
    --menu-bg: var(--light-menu-bg);
}

@media (prefers-color-scheme: light) {
    :root:not(.dark-theme-enforced) {
        --background-color: var(--light-background-color);
        --text-color: var(--light-text-color);
        --secondary-text: var(--light-secondary-text);
        --border-color: var(--light-border-color);
        --input-bg: var(--light-input-bg);
        --button-hover: var(--light-button-hover);
        --menu-bg: var(--light-menu-bg);
    }
}

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

body {
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, Helvetica, Arial, sans-serif;
    background-color: var(--background-color);
    color: var(--text-color);
    line-height: 1.5;
    height: 100vh;
    overflow: hidden;
    transition: background-color 0.3s ease, color 0.3s ease;
}

button {
    background: none;
    border: none;
    color: var(--text-color);
    cursor: pointer;
    font-family: inherit;
    transition: background-color 0.2s ease, color 0.2s ease;
}

button:focus {
    outline: none;
}

.app-container {
    display: flex;
    flex-direction: column;
    height: 100vh;
    width: 100%;
}

/* 屏幕阅读器专用类 */
.sr-only {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border-width: 0;
}

/* 主题切换按钮 */
.theme-toggle {
    position: relative;
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--text-color);
    margin-left: 8px;
    background-color: transparent;
    transition: background-color 0.2s ease;
}

.theme-toggle:hover {
    background-color: var(--button-hover);
}

/* 顶部导航栏 */
.header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 0 16px;
    height: var(--header-height);
    border-bottom: none;
}

.logo-container {
    display: flex;
    align-items: center;
}

.logo {
    width: 28px;
    height: 28px;
    color: var(--text-color);
    margin-right: 10px;
}

.logo-text {
    font-size: 20px;
    font-weight: 500;
}

.header-actions {
    display: flex;
    align-items: center;
}

.header-btn {
    width: 40px;
    height: 40px;
    border-radius: 8px;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-left: 8px;
    color: var(--text-color);
    background-color: transparent;
    transition: background-color 0.2s ease;
}

.header-btn:hover {
    background-color: var(--button-hover);
}

.user-btn {
    background-color: transparent;
    font-weight: 500;
    transition: transform 0.2s ease, background-color 0.2s ease;
}

.user-btn:hover {
    background-color: var(--button-hover);
    transform: translateY(-1px);
}

.light-theme .user-btn {
    background-color: transparent;
    color: var(--text-color);
}

.light-theme .user-btn:hover {
    background-color: var(--button-hover);
}

/* 用户菜单 */
.user-menu-container {
    position: relative;
}

.user-menu {
    position: absolute;
    top: 100%;
    right: 0;
    width: 180px;
    background-color: var(--menu-bg);
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    margin-top: 8px;
    z-index: 100;
    overflow: hidden;
    display: none;
    border: 1px solid rgba(128, 128, 128, 0.1);
    transition: background-color 0.3s ease;
}

.user-menu.active {
    display: block !important;
    animation: fadeIn 0.2s ease;
}

.menu-item {
    padding: 12px 16px;
    cursor: pointer;
    font-size: 14px;
    transition: background-color 0.2s ease;
}

.menu-item:hover {
    background-color: rgba(128, 128, 128, 0.1);
}

/* 聊天区域 */
.chat-area {
    flex: 1;
    overflow-y: auto;
    padding: 0 16px;
    scroll-behavior: smooth;
}

.messages {
    max-width: 768px;
    margin: 0 auto;
    padding-bottom: 120px;
}

.message {
    margin-bottom: 24px;
    animation: fadeIn 0.3s ease;
    display: flex;
    align-items: flex-start;
}

.user-message {
    flex-direction: row-reverse;
}

.message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    margin: 0 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: var(--accent-blue);
    color: white;
    flex-shrink: 0;
}

.user-message .message-avatar {
    background-color: rgba(128, 128, 128, 0.2);
    color: var(--text-color);
}

.avatar-icon {
    width: 20px;
    height: 20px;
    color: white;
}

.avatar-text {
    font-size: 12px;
    font-weight: bold;
}

.message-content-wrapper {
    max-width: 80%;
}

.message-header {
    display: flex;
    align-items: center;
    margin-bottom: 4px;
    font-size: 12px;
}

.message-sender {
    font-weight: 500;
    color: var(--text-color);
}

.message-time {
    color: var(--secondary-text);
    margin-left: 8px;
}

.message-content {
    position: relative;
    white-space: pre-wrap;
    line-height: 1.6;
    color: var(--text-color);
    background-color: var(--input-bg);
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 15px;
}

.user-message .message-content {
    background-color: rgba(58, 141, 255, 0.1);
}

.light-theme .user-message .message-content {
    background-color: rgba(58, 141, 255, 0.08);
}

.ai-message .message-content {
    background-color: rgba(128, 128, 128, 0.1);
}

/* 思考动画 */
.thinking {
    opacity: 0.8;
}

.thinking-dots {
    display: flex;
    align-items: center;
    padding: 8px 12px;
    height: 20px;
    background-color: rgba(128, 128, 128, 0.1);
    border-radius: 12px;
}

.dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background-color: var(--text-color);
    margin: 0 3px;
    opacity: 0.6;
    animation: dot-pulse 1.5s infinite ease-in-out;
}

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

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

@keyframes dot-pulse {
    0%, 100% {
        transform: scale(0.8);
        opacity: 0.6;
    }
    50% {
        transform: scale(1.2);
        opacity: 1;
    }
}

/* 代码块样式 */
.message-content pre {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 12px;
    border-radius: 6px;
    overflow-x: auto;
    margin: 8px 0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 14px;
}

.light-theme .message-content pre {
    background-color: rgba(0, 0, 0, 0.05);
}

.message-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    background-color: rgba(0, 0, 0, 0.15);
    padding: 2px 4px;
    border-radius: 4px;
    font-size: 14px;
}

.light-theme .message-content code {
    background-color: rgba(0, 0, 0, 0.05);
}

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

.message-content a:hover {
    text-decoration: underline;
}

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

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

/* 加载动画 */
.loading .message-content::after {
    content: "";
    display: inline-block;
    width: 12px;
    height: 12px;
    border: 2px solid var(--text-color);
    border-radius: 50%;
    border-top-color: transparent;
    animation: spin 1s linear infinite;
    margin-left: 8px;
    vertical-align: middle;
}

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

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

/* 底部输入区域 */
.input-footer {
    position: fixed;
    bottom: 0;
    left: 0;
    right: 0;
    padding: 16px;
    background-color: var(--background-color);
    transition: background-color 0.3s ease;
    border-top: none;
    --scrollbar-width: 17px; /* 预估的滚动条宽度 */
    width: calc(100% - var(--scrollbar-width));
    box-sizing: border-box;
}

.input-container {
    max-width: 768px;
    margin: 0 auto;
    background-color: var(--input-bg);
    border-radius: 12px;
    padding: 12px 16px;
    display: flex;
    align-items: center;
    position: relative;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
    transition: background-color 0.3s ease, box-shadow 0.3s ease;
}

.light-theme .input-container {
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.attachment-btn {
    color: var(--secondary-text);
    width: 28px;
    height: 28px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 4px;
    margin-right: 8px;
    background-color: transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.attachment-btn:hover {
    background-color: rgba(128, 128, 128, 0.2);
    color: var(--text-color);
}

.attachment-btn.active {
    color: var(--text-color);
    background-color: rgba(128, 128, 128, 0.2);
}

.input-middle {
    flex: 1;
    display: flex;
    flex-direction: column;
}

.input-wrapper {
    display: flex;
    align-items: flex-start;
    width: 100%;
    margin-bottom: 12px;
    position: relative;
}

#chat-input {
    flex: 1;
    background: transparent;
    border: none;
    color: var(--text-color);
    font-size: 16px;
    resize: none;
    padding: 8px 0;
    font-family: inherit;
    min-height: 44px;
    max-height: 200px;
    overflow-y: auto;
    line-height: 1.5;
    transition: color 0.3s ease;
}

#chat-input:focus {
    outline: none;
}

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

.submit-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background-color: rgba(128, 128, 128, 0.2);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    margin-left: 10px;
    transition: transform 0.2s ease, box-shadow 0.2s ease, background-color 0.2s ease;
}

.submit-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.2);
    background-color: rgba(128, 128, 128, 0.3);
}

.light-theme .submit-btn {
    background-color: rgba(128, 128, 128, 0.15);
}

.light-theme .submit-btn:hover {
    background-color: rgba(128, 128, 128, 0.25);
}

.action-buttons {
    display: flex;
    align-items: center;
    padding-bottom: 2px;
}

.search-group {
    display: flex;
    align-items: center;
    border-radius: 4px;
    margin-right: 10px;
    padding: 0;
    height: 28px;
    transition: background-color 0.2s ease;
}

.search-group:hover {
    background-color: transparent;
}

.search-btn {
    display: flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    color: var(--text-color);
    font-size: 14px;
    height: 100%;
    background-color: transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.search-btn.active {
    background-color: transparent;
}

.search-btn:hover:not(.active) {
    background-color: rgba(128, 128, 128, 0.2);
}

.search-btn i {
    margin-right: 6px;
    font-size: 12px;
    color: var(--secondary-text);
    transition: color 0.2s ease;
}

/* TRIZ按钮活跃状态 */
.search-btn.active i,
.search-btn.active span {
    color: #4a7bff;
}

.dropdown-btn {
    padding: 4px 6px;
    color: var(--secondary-text);
    font-size: 12px;
    height: 100%;
    display: flex;
    align-items: center;
    background-color: transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.dropdown-btn:hover {
    background-color: rgba(128, 128, 128, 0.1);
    color: var(--text-color);
}

.think-btn {
    display: flex;
    align-items: center;
    padding: 4px 10px;
    border-radius: 4px;
    color: var(--text-color);
    font-size: 14px;
    margin-right: 10px;
    height: 28px;
    background-color: transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.think-btn:hover {
    background-color: rgba(128, 128, 128, 0.2);
}

.think-btn i {
    margin-right: 6px;
    font-size: 12px;
    color: var(--secondary-text);
    transition: color 0.2s ease;
}

/* Think按钮活跃状态 */
.think-btn.active {
  background-color: transparent;
}

.think-btn.active i,
.think-btn.active span {
  color: #4a7bff;
}

.model-selector {
    display: flex;
    align-items: center;
    margin-left: auto;
    color: var(--secondary-text);
    font-size: 14px;
    padding: 4px 8px;
    border-radius: 4px;
    cursor: pointer;
    margin-right: 10px;
    background-color: transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
    position: relative;
}

.model-selector:hover {
    background-color: rgba(128, 128, 128, 0.1);
    color: var(--text-color);
}

.model-selector span {
    margin-right: 4px;
}

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

/* 模型选择下拉菜单 */
.model-dropdown {
    position: absolute;
    bottom: 100%;
    left: 0;
    background-color: var(--bg-color);
    border-radius: 8px;
    box-shadow: 0 0 10px rgba(0, 0, 0, 0.1);
    width: 170px;
    z-index: 100;
    overflow: hidden;
    display: none;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
}

.model-selector.active .model-dropdown {
    display: block;
}

.model-dropdown-item {
    padding: 10px 12px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
}

.model-dropdown-item:hover {
    background-color: rgba(128, 128, 128, 0.1);
}

.model-dropdown-item.selected {
    background-color: rgba(0, 120, 212, 0.1);
    color: var(--accent-blue);
}

.model-dropdown-item .model-name {
    font-weight: 500;
}

/* 不再需要的样式，进行注释
.model-dropdown-item .model-description {
    font-size: 12px;
    color: var(--secondary-text);
    margin-top: 2px;
}
*/

/* 响应式设计 */
@media (max-width: 768px) {
    .header {
        padding: 0 12px;
    }
    
    .chat-area {
        padding: 0 12px;
    }
    
    .input-footer {
        padding: 12px;
    }
    
    .input-container {
        padding: 8px 12px;
    }
    
    .logo-text {
        font-size: 18px;
    }
    
    .action-buttons {
        flex-wrap: wrap;
    }
    
    .search-btn span, 
    .think-btn span {
        display: none;
    }
    
    .search-btn i,
    .think-btn i {
        margin-right: 0;
    }
    
    .model-selector span {
        max-width: 80px;
        overflow: hidden;
        text-overflow: ellipsis;
        white-space: nowrap;
    }
    
    .message-content-wrapper {
        max-width: 88%;
        position: relative;
    }
    
    .copy-btn {
        opacity: 0.8;
        bottom: 8px;
        right: 8px;
        width: 28px;
        height: 28px;
        -webkit-backdrop-filter: blur(1px);
        backdrop-filter: blur(1px);
        background-color: rgba(128, 128, 128, 0.2);
        padding: 0;
        transform: scale(1);
        z-index: 20;
    }
    
    .copy-btn:hover .copy-text {
        display: none;
    }
    
    .message:active .copy-btn {
        opacity: 1;
    }
    
    .file-attachment {
        flex-wrap: wrap;
    }
    
    .file-actions {
        margin-top: 8px;
        width: 100%;
        justify-content: flex-end;
    }
    
    .copy-tooltip {
        font-size: 12px;
        padding: 4px 8px;
    }
}

/* 平板和小屏幕设备 */
@media (min-width: 769px) and (max-width: 1024px) {
    .input-container {
        max-width: 90%;
    }
    
    .messages {
        max-width: 90%;
    }
}

/* 附件区域样式 */
.attachment-container {
    position: relative;
    display: inline-block;
}

/* 文件附件样式 */
.file-attachment {
    display: flex;
    align-items: center;
    background-color: rgba(128, 128, 128, 0.1);
    border-radius: 8px;
    padding: 8px 12px;
    margin: 8px 0;
    border: 1px solid rgba(128, 128, 128, 0.2);
}

.file-icon {
    font-size: 24px;
    margin-right: 12px;
    color: var(--accent-blue);
}

.file-info {
    flex: 1;
}

.file-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.file-meta {
    font-size: 12px;
    color: var(--secondary-text);
}

.file-actions {
    display: flex;
    align-items: center;
}

.file-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-text);
    margin-left: 4px;
    background-color: transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.file-action-btn:hover {
    background-color: rgba(128, 128, 128, 0.2);
    color: var(--text-color);
}

/* 复制按钮 */
.copy-btn {
    position: absolute;
    bottom: 8px;
    right: 8px;
    min-width: 32px;
    height: 32px;
    border-radius: 6px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: rgba(128, 128, 128, 0.15);
    color: var(--text-color);
    opacity: 0;
    transition: all 0.2s ease;
    z-index: 20;
    -webkit-backdrop-filter: blur(2px);
    backdrop-filter: blur(2px);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transform: scale(0.9);
    padding: 0 10px;
}

.message-content {
    position: relative;
}

.message-content:hover .copy-btn {
    opacity: 1;
    transform: scale(1);
}

.copy-btn:hover {
    background-color: rgba(128, 128, 128, 0.25);
    transform: translateY(-2px);
    box-shadow: 0 3px 6px rgba(0, 0, 0, 0.15);
}

.copy-btn:active {
    transform: translateY(0);
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.1);
}

.copy-btn.copied {
    background-color: var(--accent-blue);
    color: white;
    transform: scale(1.05);
}

/* 处理文件内容样式 */
.file-content {
    margin-top: 16px;
    padding: 16px;
    background-color: rgba(128, 128, 128, 0.05);
    border-radius: 12px;
    position: relative;
}

.file-content-header {
    display: flex;
    align-items: center;
    margin-bottom: 12px;
}

.file-content-title {
    font-weight: 500;
    flex: 1;
}

/* 历史会话菜单 */
.history-menu-container {
    position: relative;
}

.history-menu {
    position: absolute;
    top: calc(100% + 8px);
    right: 0;
    width: 300px;
    max-height: 500px;
    background-color: var(--menu-bg);
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.2);
    z-index: 100;
    overflow: hidden;
    display: none;
    border: 1px solid rgba(128, 128, 128, 0.1);
    transition: background-color 0.3s ease;
    flex-direction: column;
}

.history-menu.active {
    display: flex;
    animation: fadeIn 0.2s ease;
}

.history-menu-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px 16px;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}

.history-title {
    font-weight: 500;
    font-size: 16px;
}

.history-search {
    padding: 12px 16px;
    position: relative;
    border-bottom: 1px solid rgba(128, 128, 128, 0.1);
}

.search-icon {
    position: absolute;
    left: 26px;
    top: 21px;
    color: var(--secondary-text);
    font-size: 12px;
}

.history-search-input {
    width: 100%;
    background-color: rgba(128, 128, 128, 0.1);
    border: none;
    border-radius: 6px;
    padding: 8px 12px 8px 30px;
    font-size: 14px;
    color: var(--text-color);
    transition: background-color 0.2s ease;
}

.history-search-input:focus {
    outline: none;
    background-color: rgba(128, 128, 128, 0.15);
}

.history-search-input::placeholder {
    color: var(--secondary-text);
}

.history-list {
    overflow-y: auto;
    flex: 1;
    padding: 8px 0;
}

.history-item {
    padding: 12px 16px;
    cursor: pointer;
    transition: background-color 0.2s ease;
    display: flex;
    align-items: center;
    position: relative;
}

.history-item:hover {
    background-color: rgba(128, 128, 128, 0.1);
}

.history-item.active {
    background-color: rgba(58, 141, 255, 0.1);
}

.history-item-icon {
    margin-right: 12px;
    color: var(--secondary-text);
    font-size: 14px;
}

.history-item-content {
    flex: 1;
    overflow: hidden;
}

.history-item-title {
    font-weight: 500;
    font-size: 14px;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 2px;
}

.history-item-time {
    font-size: 12px;
    color: var(--secondary-text);
}

.history-item-actions {
    display: none;
    position: absolute;
    right: 16px;
    top: 50%;
    transform: translateY(-50%);
}

.history-item:hover .history-item-actions {
    display: flex;
}

.history-action-btn {
    width: 28px;
    height: 28px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    color: var(--secondary-text);
    margin-left: 4px;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.history-action-btn:hover {
    background-color: rgba(128, 128, 128, 0.2);
    color: var(--text-color);
}

.history-action-btn.delete:hover {
    color: #ff4d4f;
}

/* 会话重命名输入框 */
.rename-input {
    width: 100%;
    background-color: rgba(128, 128, 128, 0.1);
    border: none;
    border-radius: 4px;
    padding: 6px 8px;
    font-size: 14px;
    color: var(--text-color);
}

.rename-input:focus {
    outline: none;
    background-color: rgba(128, 128, 128, 0.15);
}

.empty-history {
    text-align: center;
    padding: 20px;
    color: var(--secondary-text);
    font-size: 14px;
}

/* 复制提示气泡 */
.copy-tooltip {
    position: fixed;
    background-color: rgba(0, 0, 0, 0.75);
    color: white;
    padding: 6px 12px;
    border-radius: 4px;
    font-size: 13px;
    pointer-events: none;
    opacity: 0;
    transform: translateY(8px);
    transition: opacity 0.2s ease, transform 0.2s ease;
    z-index: 1000;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
    white-space: nowrap;
    text-align: center;
}

.copy-tooltip::after {
    content: '';
    position: absolute;
    bottom: -5px;
    left: 50%;
    transform: translateX(-50%);
    width: 0;
    height: 0;
    border-left: 6px solid transparent;
    border-right: 6px solid transparent;
    border-top: 6px solid rgba(0, 0, 0, 0.75);
}

.copy-tooltip.visible {
    opacity: 1;
    transform: translateY(0);
}

.copy-text {
    font-size: 12px;
    margin-left: 5px;
    display: none;
}

.copy-btn:hover .copy-text {
    display: inline-block;
}

/* 登录和注册模态框样式 */
.login-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 1000;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.login-modal.visible {
    opacity: 1;
}

.login-container {
    width: 400px;
    max-width: 90%;
    background-color: var(--background-color);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    animation: scaleIn 0.3s ease;
    border: 1px solid var(--border-color);
    transition: background-color 0.3s ease, border-color 0.3s ease;
}

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

.login-header h2 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
}

.close-btn {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: var(--secondary-text);
    background-color: transparent;
    transition: background-color 0.2s ease, color 0.2s ease;
}

.close-btn:hover {
    background-color: rgba(128, 128, 128, 0.1);
    color: var(--text-color);
}

.login-body {
    padding: 20px;
}

.input-group {
    margin-bottom: 16px;
}

.input-group label {
    display: block;
    margin-bottom: 6px;
    font-size: 14px;
    color: var(--text-color);
}

.input-group input {
    width: 100%;
    background-color: var(--input-bg);
    border: 1px solid var(--border-color);
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    color: var(--text-color);
    transition: border-color 0.2s ease, background-color 0.3s ease, color 0.3s ease;
}

.input-group input:focus {
    outline: none;
    border-color: var(--accent-blue);
}

.login-options {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 20px;
    font-size: 12px;
}

.checkbox-container {
    display: flex;
    align-items: center;
    color: var(--text-color);
}

.checkbox-container input {
    margin-right: 6px;
}

.checkbox-text {
    color: var(--secondary-text);
}

.forgot-password, 
.checkbox-text a {
    color: var(--accent-blue);
    text-decoration: none;
}

.forgot-password:hover,
.checkbox-text a:hover {
    text-decoration: underline;
}

.login-btn {
    width: 100%;
    background-color: var(--accent-blue);
    color: white;
    padding: 12px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 16px;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
    transition: background-color 0.2s ease, transform 0.2s ease, box-shadow 0.2s ease;
}

.login-btn:hover {
    background-color: #2d79e0;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0, 0, 0, 0.15);
}

.login-btn:active {
    transform: translateY(0);
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.1);
}

.login-btn:disabled {
    background-color: rgba(58, 141, 255, 0.6);
    cursor: not-allowed;
    transform: none;
}

.login-divider {
    display: flex;
    align-items: center;
    margin: 20px 0;
    color: var(--secondary-text);
    font-size: 12px;
}

.login-divider::before,
.login-divider::after {
    content: '';
    flex: 1;
    height: 1px;
    background-color: var(--border-color);
}

.login-divider span {
    padding: 0 10px;
}

.social-login {
    display: flex;
    gap: 10px;
    margin-bottom: 20px;
}

.social-btn {
    flex: 1;
    padding: 10px;
    border-radius: 8px;
    font-size: 13px;
    display: flex;
    align-items: center;
    justify-content: center;
    border: 1px solid var(--border-color);
    background-color: transparent;
    color: var(--text-color);
    transition: background-color 0.2s ease, transform 0.2s ease;
}

.social-btn:hover {
    background-color: rgba(128, 128, 128, 0.1);
    transform: translateY(-1px);
}

.social-btn i {
    margin-right: 8px;
}

.google-btn i {
    color: #dd4b39;
}

.github-btn i {
    color: #6e5494;
}

.signup-link {
    text-align: center;
    font-size: 13px;
    color: var(--secondary-text);
    margin: 0;
}

.signup-link a {
    color: var(--accent-blue);
    text-decoration: none;
}

.signup-link a:hover {
    text-decoration: underline;
}

.login-error {
    background-color: rgba(255, 0, 0, 0.1);
    color: #ff4d4f;
    padding: 10px;
    border-radius: 8px;
    margin-bottom: 16px;
    font-size: 13px;
    transition: opacity 0.3s ease;
}

@keyframes scaleIn {
    from {
        transform: scale(0.9);
        opacity: 0;
    }
    to {
        transform: scale(1);
        opacity: 1;
    }
}

@media (max-width: 768px) {
    .login-container {
        width: 90%;
    }
    
    .social-login {
        flex-direction: column;
    }
    
    .login-header h2 {
        font-size: 16px;
    }
}

/* 确保移动设备上的暗黑主题应用 */
:root.dark-theme-enforced,
:root.dark-theme-enforced body,
.dark-theme-enforced .app-container {
    --background-color: var(--dark-background-color);
    --text-color: var(--dark-text-color);
    --secondary-text: var(--dark-secondary-text);
    --border-color: var(--dark-border-color);
    --input-bg: var(--dark-input-bg);
    --button-hover: var(--dark-button-hover);
    --menu-bg: var(--dark-menu-bg);
    color-scheme: dark;
}

/* 手机端暗黑主题特定样式 */
@media (max-width: 768px) {
    :root.dark-theme-enforced .input-container,
    :root.dark-theme-enforced .user-message .message-content,
    :root.dark-theme-enforced .message-content pre,
    :root.dark-theme-enforced .message-content code,
    :root.dark-theme-enforced .submit-btn {
        background-color: var(--dark-input-bg);
        color: var(--dark-text-color);
        border-color: var(--dark-border-color);
    }
    
    :root.dark-theme-enforced .header,
    :root.dark-theme-enforced .app-container,
    :root.dark-theme-enforced .chat-area,
    :root.dark-theme-enforced .input-footer {
        background-color: var(--dark-background-color);
        color: var(--dark-text-color);
    }
}

/* 管理员样式 */
.admin-user {
    /* 移除背景色设置 */
    background-color: transparent !important;
}

.admin-entry {
    color: var(--accent-blue);
    font-weight: 500;
}

.admin-panel {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.6);
    z-index: 1000;
    display: flex;
    align-items: center;
    justify-content: center;
    opacity: 0;
    transition: opacity 0.3s ease;
    -webkit-backdrop-filter: blur(5px);
    backdrop-filter: blur(5px);
}

.admin-panel.visible {
    opacity: 1;
}

.admin-container {
    width: 800px;
    max-width: 90%;
    height: 80%;
    max-height: 600px;
    background-color: var(--background-color);
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.3);
    overflow: hidden;
    display: flex;
    flex-direction: column;
    animation: scaleIn 0.3s ease;
}

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

.admin-header h2 {
    font-size: 18px;
    font-weight: 500;
    color: var(--text-color);
    margin: 0;
}

.admin-body {
    flex: 1;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.admin-tabs {
    display: flex;
    border-bottom: 1px solid var(--border-color);
    padding: 0 20px;
}

.tab-btn {
    padding: 12px 16px;
    background: transparent;
    border: none;
    color: var(--secondary-text);
    font-size: 14px;
    cursor: pointer;
    position: relative;
    margin-right: 10px;
}

.tab-btn.active {
    color: var(--accent-blue);
    font-weight: 500;
}

.tab-btn.active::after {
    content: '';
    position: absolute;
    bottom: -1px;
    left: 0;
    width: 100%;
    height: 2px;
    background-color: var(--accent-blue);
}

.admin-content {
    padding: 20px;
    flex: 1;
    overflow-y: auto;
}

.tab-panel {
    display: none;
}

.tab-panel.active {
    display: block;
}

.tab-panel h3 {
    margin-top: 0;
    margin-bottom: 16px;
    font-size: 16px;
    font-weight: 500;
}

.admin-action-btn {
    background-color: var(--accent-blue);
    color: white;
    padding: 8px 16px;
    border-radius: 8px;
    font-size: 14px;
    font-weight: 500;
    margin: 16px 0;
    display: inline-flex;
    align-items: center;
}

.admin-action-btn i {
    margin-right: 6px;
}

.users-list {
    margin-top: 16px;
}

.user-item {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 12px;
    border-radius: 8px;
    margin-bottom: 8px;
    border: 1px solid var(--border-color);
    transition: background-color 0.2s ease;
}

.user-item:hover {
    background-color: rgba(128, 128, 128, 0.1);
}

.user-info {
    display: flex;
    align-items: center;
}

.user-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background-color: rgba(128, 128, 128, 0.2);
    color: var(--text-color);
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: 500;
    margin-right: 12px;
}

.user-details {
    display: flex;
    flex-direction: column;
}

.user-name {
    font-weight: 500;
    margin-bottom: 2px;
}

.user-role {
    font-size: 12px;
    color: var(--secondary-text);
}

.user-role[data-role="admin"] {
    color: var(--accent-blue);
    font-weight: 500;
}

.user-actions {
    display: flex;
}

.user-action-btn {
    width: 32px;
    height: 32px;
    border-radius: 4px;
    display: flex;
    align-items: center;
    justify-content: center;
    background-color: transparent;
    margin-left: 6px;
    color: var(--secondary-text);
    transition: background-color 0.2s ease, color 0.2s ease;
}

.user-action-btn:hover {
    background-color: rgba(128, 128, 128, 0.2);
    color: var(--text-color);
}

.user-action-btn[data-action="delete"]:hover {
    color: #ff4d4f;
}

.settings-form {
    max-width: 400px;
}

.logs-list {
    margin-top: 16px;
}

.log-entry {
    padding: 10px;
    border-bottom: 1px solid var(--border-color);
    font-size: 14px;
    display: flex;
}

.log-time {
    color: var(--secondary-text);
    margin-right: 12px;
    width: 150px;
}

.log-user {
    font-weight: 500;
    width: 80px;
    margin-right: 12px;
}

.loading-users {
    text-align: center;
    padding: 20px;
    color: var(--secondary-text);
}

.error-message {
    padding: 12px;
    color: #ff4d4f;
    background-color: rgba(255, 77, 79, 0.1);
    border-radius: 8px;
    font-size: 14px;
}

@media (max-width: 768px) {
    .admin-container {
        width: 95%;
        height: 90%;
    }
    
    .admin-tabs {
        overflow-x: auto;
        padding: 0 10px;
    }
    
    .admin-content {
        padding: 15px;
    }
}

/* Markdown样式增强 */
.message-content {
    /* 现有样式 */
}

/* 表格样式 */
.message-content table {
    border-collapse: collapse;
    margin: 10px 0;
    width: 100%;
    max-width: 100%;
    background-color: transparent;
}

.message-content table th,
.message-content table td {
    padding: 8px;
    text-align: left;
    border: 1px solid var(--border-color);
}

.message-content table th {
    background-color: rgba(128, 128, 128, 0.1);
    font-weight: 600;
}

.message-content table tr:nth-child(even) {
    background-color: rgba(128, 128, 128, 0.05);
}

/* 引用块样式 */
.message-content blockquote {
    padding: 10px 15px;
    margin: 10px 0;
    border-left: 4px solid var(--accent-blue);
    background-color: rgba(128, 128, 128, 0.1);
    color: var(--secondary-text);
}

/* 水平线样式 */
.message-content hr {
    border: none;
    height: 1px;
    background-color: var(--border-color);
    margin: 15px 0;
}

/* 任务列表样式 */
.message-content .task-list-item {
    display: flex;
    align-items: center;
    margin: 5px 0;
}

.message-content .task-list-item input[type="checkbox"] {
    margin-right: 8px;
}

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

/* 删除线样式 */
.message-content del {
    text-decoration: line-through;
    color: var(--secondary-text);
}

/* 标题样式增强 */
.message-content h1,
.message-content h2,
.message-content h3,
.message-content h4,
.message-content h5 {
    margin-top: 20px;
    margin-bottom: 10px;
    font-weight: 600;
    line-height: 1.4;
}

.message-content h1 {
    font-size: 1.8em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.message-content h2 {
    font-size: 1.5em;
    border-bottom: 1px solid var(--border-color);
    padding-bottom: 5px;
}

.message-content h3 {
    font-size: 1.3em;
}

.message-content h4 {
    font-size: 1.2em;
}

.message-content h5 {
    font-size: 1.1em;
}

/* 段落样式 */
.message-content p {
    margin: 10px 0;
    line-height: 1.6;
}

/* 列表样式增强 */
.message-content ul,
.message-content ol {
    margin: 10px 0 10px 20px;
    padding-left: 15px;
}

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

.message-content ul {
    list-style-type: disc;
}

.message-content ol {
    list-style-type: decimal;
}

/* 代码块样式增强 */
.message-content pre {
    background-color: rgba(0, 0, 0, 0.2);
    padding: 16px;
    border-radius: 8px;
    overflow-x: auto;
    margin: 15px 0;
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    font-size: 14px;
    line-height: 1.6;
}

.light-theme .message-content pre {
    background-color: rgba(0, 0, 0, 0.05);
    color: #333;
}

.message-content code {
    font-family: 'SFMono-Regular', Consolas, 'Liberation Mono', Menlo, monospace;
    background-color: rgba(0, 0, 0, 0.15);
    padding: 3px 5px;
    border-radius: 4px;
    font-size: 14px;
}

.light-theme .message-content code {
    background-color: rgba(0, 0, 0, 0.05);
}

/* 用户头像SVG图标样式 */
.logo-svg {
    color: white; /* 暗色主题下默认为白色 */
    transition: color 0.3s ease;
}

/* 浅色主题下的用户图标 */
.light-theme .logo-svg {
    color: #333; /* 浅色主题下默认为暗色 */
}

/* 管理员用户的图标颜色 */
.admin-user .logo-svg {
    color: #4a7bff !important; /* 管理员用户使用蓝色填充 */
}

/* 普通用户的图标颜色 */
.normal-user .logo-svg {
    color: #a64aff !important; /* 普通用户使用紫色填充 */
}

/* 确保在暗色和浅色主题下都正确显示 */
.light-theme .admin-user .logo-svg {
    color: #4a7bff !important; /* 浅色主题下仍然使用蓝色 */
}

.dark-theme-enforced .admin-user .logo-svg {
    color: #4a7bff !important; /* 强制暗色主题下仍然使用蓝色 */
}

.dark-theme-enforced .normal-user .logo-svg {
    color: #a64aff !important; /* 强制暗色主题下仍然使用紫色 */
}

/* 添加自动识别时的提示样式 */
.content-type-indicator {
  position: absolute;
  bottom: 65px;
  right: 20px;
  background-color: rgba(0, 0, 0, 0.7);
  color: white;
  padding: 5px 10px;
  border-radius: 4px;
  font-size: 12px;
  display: flex;
  align-items: center;
  gap: 5px;
  z-index: 100;
  animation: fadeIn 0.3s ease;
}

.content-type-indicator i {
  font-size: 14px;
}

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