* {
            margin: 0;
            padding: 0;
            box-sizing: border-box;
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
            -webkit-tap-highlight-color: transparent;
        }
        
        body {
            background: linear-gradient(135deg, #1a5d1a 0%, #0c3b0c 100%);
            color: #333;
            min-height: 100vh;
            padding: 10px;
            display: flex;
            justify-content: center;
            align-items: center;
            overflow: hidden;
        }
        
        .container {
            width: 100%;
            max-width: 1200px;
            background: white;
            border-radius: 20px;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.3);
            overflow: hidden;
            display: flex;
            flex-direction: column;
            height: 95vh;
        }
        
        header {
            background: linear-gradient(to right, #2e7d32, #1b5e20);
            color: white;
            padding: 15px 10px;
            text-align: center;
            position: relative;
        }
        
        .logo {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            margin-bottom: 5px;
            flex-wrap: wrap;
        }
        
        .logo i {
            font-size: 1.8rem;
            color: #ffd54f;
        }
        
        h1 {
            font-size: 1.5rem;
            margin: 0;
            letter-spacing: 0.5px;
            flex: 1;
            min-width: 200px;
        }
        
        .subtitle {
            font-size: 0.9rem;
            opacity: 0.9;
            margin-top: 3px;
        }
        
        .mobile-menu-btn {
            position: absolute;
            left: 10px;
            top: 50%;
            transform: translateY(-50%);
            background: none;
            border: none;
            color: white;
            font-size: 1.4rem;
            cursor: pointer;
            display: none;
        }
        
        .content {
            display: flex;
            flex: 1;
            overflow: hidden;
            position: relative;
        }
        
        .sidebar {
            width: 280px;
            background: #f8f9fa;
            border-right: 1px solid #e0e0e0;
            padding: 15px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            transition: transform 0.3s ease;
            z-index: 100;
        }
        
        .chat-container {
            flex: 1;
            display: flex;
            flex-direction: column;
            background: #fff;
            position: relative;
            overflow: hidden;
        }
        
        .chat-history {
            flex: 1;
            padding: 15px;
            overflow-y: auto;
            display: flex;
            flex-direction: column;
            gap: 15px;
            -webkit-overflow-scrolling: touch;
        }
        
        .message {
            max-width: 99%;
            padding: 15px;
            border-radius: 15px;
            line-height: 1.5;
            position: relative;
            box-shadow: 0 3px 8px rgba(0, 0, 0, 0.08);
            transition: all 0.3s ease;
            font-size: 0.95rem;
        }
        
        .user-message {
            background: #e8f5e9;
            align-self: flex-end;
            border-bottom-right-radius: 5px;
            max-width: 90%;
        }
        
        .ai-message {
            background: #f1f8e9;
            align-self: flex-start;
            border-bottom-left-radius: 5px;
            width: 99%;
        }
        
        .message-header {
            display: flex;
            align-items: center;
            margin-bottom: 6px;
            font-weight: 600;
            font-size: 0.95rem;
        }
        
        .user-message .message-header {
            color: #2e7d32;
        }
        
        .ai-message .message-header {
            color: #1b5e20;
        }
        
        .message-header i {
            margin-right: 6px;
            font-size: 1rem;
        }
        
        /* 修改：待拷贝内容背景色为浅黄色 */
        .formatted-content .category {
            background: #fff9c4; /* 浅黄色背景 */
            padding: 12px;
            border-radius: 10px;
            margin-bottom: 12px;
            border-left: 4px solid #4caf50;
            width: 99%; /* 确保分类内容宽度为99% */
        }
        
        .formatted-content {
            margin-top: 12px;
            font-size: 0.9rem;
            width: 99%; /* 确保格式化内容宽度为99% */
        }
        
        .thinking-process {
            background: #f8f9fa;
            border-radius: 10px;
            padding: 12px;
            margin-top: 12px;
            border-left: 4px solid #ffc107;
            position: relative;
            overflow: hidden;
            font-size: 0.9rem;
            width: 99%; /* 确保思考过程宽度为99% */
        }
        
        .thinking-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 8px;
            font-weight: 600;
            color: #ff9800;
            font-size: 0.95rem;
        }
        
        .thinking-content {
            padding: 8px;
            background: rgba(255, 255, 255, 0.8);
            border-radius: 6px;
            max-height: 150px;
            overflow-y: auto;
            font-family: 'Courier New', monospace;
            font-size: 0.85rem;
            line-height: 1.5;
        }
        
        .thinking-animation {
            position: absolute;
            top: 0;
            right: 0;
            width: 50px;
            height: 100%;
            background: linear-gradient(90deg, transparent, rgba(255, 193, 7, 0.1), transparent);
            animation: thinkingLight 2s infinite;
        }
        
        @keyframes thinkingLight {
            0% { transform: translateX(-100%); }
            100% { transform: translateX(200%); }
        }
        
        .category-title {
            display: flex;
            align-items: center;
            font-weight: 600;
            color: #1b5e20;
            margin-bottom: 6px;
            font-size: 0.95rem;
        }
        
        .category-title i {
            margin-right: 6px;
            color: #4caf50;
            font-size: 0.9rem;
        }
        
        .copy-btn {
            position: absolute;
            top: 0;
            right: 0;
            background: #e8f5e9;
            border: none;
            border-radius: 4px;
            padding: 3px 6px;
            cursor: pointer;
            font-size: 0.75rem;
            color: #2e7d32;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 3px;
        }
        
        .copy-btn:hover {
            background: #c8e6c9;
        }
        
        .copy-btn i {
            font-size: 0.75rem;
        }
        
        .input-area {
            padding: 15px;
            border-top: 1px solid #e0e0e0;
            background: #f5f5f5;
            display: flex;
            gap: 10px;
        }
        
        .input-area textarea {
            flex: 1;
            padding: 12px;
            border: 2px solid #c8e6c9;
            border-radius: 12px;
            resize: none;
            font-size: 0.95rem;
            outline: none;
            transition: border-color 0.3s;
            height: 50px;
            max-height: 100px;
        }
        
        .input-area textarea:focus {
            border-color: #4caf50;
        }
        
        .input-area button {
            background: linear-gradient(to right, #2e7d32, #1b5e20);
            color: white;
            border: none;
            border-radius: 12px;
            padding: 0 20px;
            font-size: 0.95rem;
            font-weight: 600;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 6px;
            min-width: 60px;
        }
        
        .input-area button:hover {
            transform: translateY(-2px);
            box-shadow: 0 3px 10px rgba(0, 0, 0, 0.2);
        }
        
        .input-area button:disabled {
            background: #bdbdbd;
            cursor: not-allowed;
            transform: none;
            box-shadow: none;
        }
        
        .settings {
            margin-bottom: 12px;
        }
        
        .settings h3 {
            margin-bottom: 12px;
            color: #1b5e20;
            display: flex;
            align-items: center;
            gap: 8px;
            font-size: 1.1rem;
        }
        
        .settings h3 i {
            color: #4caf50;
            font-size: 1rem;
        }
        
        .form-group {
            margin-bottom: 12px;
        }
        
        .form-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: 500;
            color: #424242;
            font-size: 0.9rem;
        }
        
        .form-group select, .form-group input {
            width: 100%;
            padding: 8px 12px;
            border: 1px solid #c8e6c9;
            border-radius: 6px;
            font-size: 0.9rem;
        }
        
        .history-item {
            padding: 10px 12px;
            background: white;
            border-radius: 8px;
            margin-bottom: 8px;
            cursor: pointer;
            transition: all 0.2s;
            border: 1px solid #e0e0e0;
            display: flex;
            justify-content: space-between;
            align-items: center;
            font-size: 0.9rem;
        }
        
        .history-item:hover {
            background: #e8f5e9;
            transform: translateX(5px);
        }
        
        .history-item i {
            color: #757575;
        }
        
        .history-item.active {
            background: #c8e6c9;
            border-color: #81c784;
        }
        
        .history-title {
            font-weight: 500;
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            flex: 1;
        }
        
        .history-date {
            font-size: 0.75rem;
            color: #757575;
            margin-left: 8px;
            white-space: nowrap;
        }
        
        .history-actions {
            display: flex;
            gap: 6px;
            margin-left: 8px;
        }
        
        .history-actions i {
            transition: all 0.2s;
            font-size: 0.85rem;
        }
        
        .history-actions i:hover {
            color: #d32f2f;
        }
        
        .loading {
            display: flex;
            justify-content: center;
            padding: 15px;
        }
        
        .spinner {
            width: 35px;
            height: 35px;
            border: 3px solid rgba(76, 175, 80, 0.2);
            border-top: 3px solid #2e7d32;
            border-radius: 50%;
            animation: spin 1s linear infinite;
        }
        
        @keyframes spin {
            0% { transform: rotate(0deg); }
            100% { transform: rotate(360deg); }
        }
        
        .error-message {
            background: #ffebee;
            color: #c62828;
            padding: 12px;
            border-radius: 8px;
            margin-top: 8px;
            font-size: 0.9rem;
        }
        
        .copy-notification {
            position: fixed;
            top: 20px;
            right: 20px;
            background: #2e7d32;
            color: white;
            padding: 10px 15px;
            border-radius: 5px;
            box-shadow: 0 4px 10px rgba(0, 0, 0, 0.15);
            opacity: 0;
            transform: translateY(-20px);
            transition: all 0.3s ease;
            z-index: 1000;
            font-size: 0.9rem;
        }
        
        .copy-notification.show {
            opacity: 1;
            transform: translateY(0);
        }
        
        .history-controls {
            display: flex;
            justify-content: space-between;
            margin-top: 8px;
        }
        
        .history-controls button {
            background: #2e7d32;
            color: white;
            border: none;
            border-radius: 5px;
            padding: 6px 10px;
            font-size: 0.85rem;
            cursor: pointer;
            transition: all 0.3s;
            display: flex;
            align-items: center;
            gap: 4px;
        }
        
        .history-controls button:hover {
            background: #1b5e20;
        }
        
        /* Markdown 样式 */
        .markdown-content {
            font-family: 'Segoe UI', 'Microsoft YaHei', sans-serif;
            line-height: 1.6;
            font-size: 0.95rem;
            width: 99%; /* 确保Markdown内容宽度为99% */
        }
        
        .markdown-content h1, 
        .markdown-content h2, 
        .markdown-content h3, 
        .markdown-content h4, 
        .markdown-content h5, 
        .markdown-content h6 {
            margin: 1em 0 0.7em 0;
            color: #1b5e20;
            font-weight: 600;
        }
        
        .markdown-content h1 {
            font-size: 1.4rem;
            border-bottom: 2px solid #c8e6c9;
            padding-bottom: 0.4rem;
        }
        
        .markdown-content h2 {
            font-size: 1.3rem;
            border-bottom: 1px solid #e0f0e0;
            padding-bottom: 0.3rem;
        }
        
        .markdown-content h3 {
            font-size: 1.1rem;
        }
        
        .markdown-content p {
            margin-bottom: 0.8rem;
        }
        
        .markdown-content ul, 
        .markdown-content ol {
            margin: 0.8rem 0;
            padding-left: 1.3rem;
        }
        
        .markdown-content li {
            margin-bottom: 0.4rem;
        }
        
        .markdown-content ul {
            list-style-type: disc;
        }
        
        .markdown-content ol {
            list-style-type: decimal;
        }
        
        .markdown-content blockquote {
            border-left: 3px solid #4caf50;
            background: #f8f9fa;
            padding: 0.8rem 1.2rem;
            margin: 1.2rem 0;
            font-style: italic;
            color: #555;
        }
        
        .markdown-content pre {
            background: #f8f9fa;
            color: #333;
            padding: 0.8rem;
            border-radius: 6px;
            overflow-x: auto;
            margin: 1.2rem 0;
            font-size: 0.85rem;
            width: 99%; /* 确保代码块宽度为99% */
        }
        
        .markdown-content code {
            font-family: 'Courier New', monospace;
            background: rgba(76, 175, 80, 0.1);
            padding: 0.15rem 0.3rem;
            border-radius: 3px;
            color: #d32f2f;
            font-size: 0.85rem;
        }
        
        .markdown-content table {
            width: 99%; /* 确保表格宽度为99% */
            border-collapse: collapse;
            margin: 1.2rem 0;
            font-size: 0.85rem;
        }
        
        .markdown-content th, 
        .markdown-content td {
            border: 1px solid #c8e6c9;
            padding: 0.6rem;
            text-align: left;
        }
        
        .markdown-content th {
            background-color: #e8f5e9;
            font-weight: 600;
        }
        
        .markdown-content tr:nth-child(even) {
            background-color: #f8f9fa;
        }
        
        .markdown-content a {
            color: #2e7d32;
            text-decoration: none;
            border-bottom: 1px dotted #2e7d32;
        }
        
        .markdown-content a:hover {
            color: #1b5e20;
            border-bottom: 1px solid #1b5e20;
        }
        
        .hidden {
            display: none;
        }
        
        /* 优化：AI消息内容宽度 */
        .ai-message .formatted-content {
            padding: 10px;
            width: 99%; /* 确保格式化内容宽度为99% */
        }
        
        .ai-message .category {
            margin-bottom: 10px;
            padding-bottom: 6px;
            width: 99%; /* 确保分类内容宽度为99% */
        }
        
        /* 移动端优化 */
        @media (max-width: 768px) {
            .container {
                height: 100vh;
                border-radius: 0;
            }
            
            header {
                padding: 12px 10px;
            }
            
            .logo i {
                font-size: 1.5rem;
            }
            
            h1 {
                font-size: 1.3rem;
                min-width: auto;
            }
            
            .subtitle {
                font-size: 0.8rem;
            }
            
            .mobile-menu-btn {
                display: block;
            }
            
            .content {
                flex-direction: column;
            }
            
            .sidebar {
                position: absolute;
                top: 0;
                left: 0;
                height: 100%;
                width: 280px;
                transform: translateX(-100%);
                z-index: 100;
                box-shadow: 3px 0 15px rgba(0,0,0,0.1);
            }
            
            .sidebar.active {
                transform: translateX(0);
            }
            
            .overlay {
                position: absolute;
                top: 0;
                left: 0;
                width: 100%;
                height: 100%;
                background: rgba(0,0,0,0.5);
                z-index: 99;
                display: none;
            }
            
            .overlay.active {
                display: block;
            }
            
            .chat-container {
                width: 100%;
            }
            
            .message {
                max-width: 99%; /* 移动端消息宽度调整为99% */
                padding: 12px;
                font-size: 0.9rem;
            }
            
            .ai-message {
                width: 99%; /* 移动端AI消息宽度调整为99% */
            }
            
            .formatted-content .category {
                padding: 10px;
                width: 99%; /* 移动端分类内容宽度调整为99% */
            }
            
            .input-area {
                padding: 12px;
            }
            
            .input-area textarea {
                padding: 10px;
                font-size: 0.9rem;
            }
            
            .input-area button {
                padding: 0 15px;
                font-size: 0.9rem;
            }
            
            .markdown-content h1 {
                font-size: 1.3rem;
            }
            
            .markdown-content h2 {
                font-size: 1.2rem;
            }
            
            .markdown-content h3 {
                font-size: 1.05rem;
            }
            
            .thinking-content {
                max-height: 120px;
                font-size: 0.8rem;
            }
            
            /* 修复：侧边栏显示时禁止背景滚动 */
            body.sidebar-open {
                overflow: hidden;
            }
            
            .sidebar.active {
                overflow-y: auto;
            }
        }
        
        @media (max-width: 480px) {
            .container {
                padding: 0;
            }
            
            header {
                padding: 10px;
            }
            
            h1 {
                font-size: 1.2rem;
            }
            
            .message {
                max-width: 99%; /* 小屏幕消息宽度调整为99% */
                font-size: 0.88rem;
            }
            
            .ai-message {
                width: 99%; /* 小屏幕AI消息宽度调整为99% */
            }
            
            .message-header {
                font-size: 0.9rem;
            }
            
            .input-area {
                gap: 8px;
            }
            
            .input-area button {
                min-width: 50px;
                padding: 0 12px;
            }
            
            .formatted-content .category {
                padding: 8px;
                width: 99%; /* 小屏幕分类内容宽度调整为99% */
            }
            
            .markdown-content {
                width: 99%; /* 小屏幕Markdown内容宽度调整为99% */
            }
            
            .formatted-content {
                width: 99%; /* 小屏幕格式化内容宽度调整为99% */
            }
        }
        
        /* 移动端滚动条优化 */
        ::-webkit-scrollbar {
            width: 5px;
            height: 5px;
        }
        
        ::-webkit-scrollbar-track {
            background: #f1f1f1;
        }
        
        ::-webkit-scrollbar-thumb {
            background: #c8e6c9;
            border-radius: 10px;
        }
        
        ::-webkit-scrollbar-thumb:hover {
            background: #81c784;
        }
        
        /* 新增：聊天历史为空时的提示 */
        .empty-history {
            text-align: center;
            padding: 20px;
            color: #757575;
        }
        
        .empty-history i {
            font-size: 3rem;
            margin-bottom: 15px;
            color: #c8e6c9;
        }
        
        /* 新增：AI消息中的图片样式 */
        .ai-message img {
            max-width: 100%;
            border-radius: 8px;
            margin: 10px 0;
            box-shadow: 0 2px 5px rgba(0,0,0,0.1);
        }
        
        /* 优化：AI消息内容宽度 */
        .ai-message {
            width: 99%;
        }
        
        /* 流式响应样式 */
        .streaming-content {
            background: #e8f5e9;
            padding: 10px;
            border-radius: 8px;
            border-left: 3px solid #4caf50;
            font-family: 'Segoe UI', sans-serif;
            line-height: 1.6;
            width: 99%; /* 确保流式内容宽度为99% */
        }
        
        .streaming-cursor {
            display: inline-block;
            width: 8px;
            height: 1em;
            background: #2e7d32;
            vertical-align: middle;
            margin-left: 3px;
            animation: blink 1s infinite;
        }
        
        @keyframes blink {
            0%, 100% { opacity: 1; }
            50% { opacity: 0; }
        }