        /* --- 基础样式 --- */
        :root { --primary-color: #764ba2; --secondary-color: #667eea; }
        * { margin: 0; padding: 0; box-sizing: border-box; font-family: 'Segoe UI', "Microsoft YaHei", sans-serif; }
        body { background: linear-gradient(135deg, #f5f7fa 0%, #c3cfe2 100%); color: #333; height: 100vh; display: flex; flex-direction: column; align-items: center; padding: 20px; }
        .container { max-width: 900px; width: 100%; height: 100%; margin: 0 auto; display: flex; flex-direction: column; gap: 15px; position: relative; }
        
        /* --- 聊天窗口 --- */
        .chat-container {
            background: rgba(255, 255, 255, 0.95); 
            border-radius: 20px; 
            overflow: hidden;
            box-shadow: 0 10px 30px rgba(0, 0, 0, 0.1);
            display: flex; flex-direction: column; flex: 1;
            backdrop-filter: blur(10px);
            position: relative;
        }
        
        /* 顶部栏 */
        .chat-header {
            background: linear-gradient(135deg, var(--secondary-color) 0%, var(--primary-color) 100%);
            color: white; padding: 15px 20px; 
            display: flex; justify-content: space-between; align-items: center;
            box-shadow: 0 2px 10px rgba(0,0,0,0.1);
        }
        .header-info h2 { font-size: 1.1rem; font-weight: 600; }
        .header-info p { font-size: 0.8rem; opacity: 0.9; margin-top: 4px; }
        .settings-btn {
            background: rgba(255,255,255,0.2); border: none; color: white;
            width: 36px; height: 36px; border-radius: 50%; cursor: pointer;
            font-size: 18px; display: flex; align-items: center; justify-content: center;
            transition: background 0.2s;
        }
        .settings-btn:hover { background: rgba(255,255,255,0.3); }

        /* 设置面板 */
        .settings-panel {
            position: absolute; top: 60px; right: 20px;
            background: white; padding: 15px; border-radius: 12px;
            box-shadow: 0 5px 20px rgba(0,0,0,0.15);
            width: 280px; z-index: 100;
            display: none; animation: fadeIn 0.2s ease;
            border: 1px solid #eee;
        }
        .settings-panel.active { display: block; }
        .setting-item { margin-bottom: 12px; }
        .setting-item label { display: block; font-size: 13px; color: #666; margin-bottom: 5px; }
        .setting-item input[type="text"] {
            width: 100%; padding: 8px; border: 1px solid #ddd; border-radius: 6px; font-size: 14px;
        }
        .setting-checkbox { display: flex; align-items: center; justify-content: space-between; font-size: 14px; color: #333; }
        .toggle-switch {
            position: relative; width: 40px; height: 20px; -webkit-appearance: none;
            background: #ccc; outline: none; border-radius: 20px; transition: .3s; cursor: pointer;
        }
        .toggle-switch:checked { background: var(--secondary-color); }
        .toggle-switch:before {
            content: ''; position: absolute; width: 16px; height: 16px; border-radius: 50%;
            top: 2px; left: 2px; background: white; transition: .3s;
        }
        .toggle-switch:checked:before { left: 22px; }

        /* 消息区域 */
        .chat-messages {
            flex: 1; padding: 20px; overflow-y: auto;
            display: flex; flex-direction: column; gap: 15px;
            background: #fdfdfd; scroll-behavior: smooth;
        }
        
        /* 消息气泡 & Markdown 样式 */
        .message {
            max-width: 85%; padding: 12px 18px; border-radius: 18px;
            line-height: 1.6; position: relative; word-wrap: break-word;
            font-size: 15px; box-shadow: 0 2px 5px rgba(0,0,0,0.05);
            animation: slideIn 0.3s ease;
        }
        .user-message {
            align-self: flex-end; background: var(--secondary-color); color: white; border-bottom-right-radius: 4px;
        }
        .ai-message {
            align-self: flex-start; background: white; color: #333; border: 1px solid #eee; border-bottom-left-radius: 4px;
        }
        
        /* 简易Markdown样式 */
        .md-bold { font-weight: 700; }
        .md-code-block {
            display: block; background: #2d2d2d; color: #ccc; 
            padding: 10px; border-radius: 8px; margin: 8px 0; 
            font-family: Consolas, monospace; font-size: 13px; overflow-x: auto;
        }
        .md-inline-code {
            background: rgba(0,0,0,0.1); padding: 2px 4px; border-radius: 4px; 
            font-family: Consolas, monospace; font-size: 0.9em;
        }
        .ai-message .md-inline-code { color: #d63384; }
        .user-message .md-inline-code { background: rgba(255,255,255,0.2); color: white; }

        @keyframes slideIn {
            from { opacity: 0; transform: translateY(10px); }
            to { opacity: 1; transform: translateY(0); }
        }
        @keyframes fadeIn { from { opacity: 0; transform: translateY(-5px); } to { opacity: 1; transform: translateY(0); } }

        /* 正在输入动画 */
        .typing-wrapper { display: none; padding: 0 20px 10px 20px; }
        .typing-indicator span {
            display: inline-block; width: 6px; height: 6px; border-radius: 50%;
            background: #aaa; margin: 0 2px; animation: typing 1.4s infinite ease-in-out;
        }
        .typing-indicator span:nth-child(2) { animation-delay: 0.2s; }
        .typing-indicator span:nth-child(3) { animation-delay: 0.4s; }
        @keyframes typing { 0%, 100% { transform: translateY(0); } 50% { transform: translateY(-5px); } }

                /* 输入框区域 - 美化版 + 移动端适配 */
.chat-input {
    display: flex; 
    padding: 10px; 
    background: #f8f9fa; 
    border-top: 1px solid #e9ecef;
    gap: 10px; 
}
.chat-input input {
    flex: 1; 
    padding: 12px 20px; 
    border: 1px solid #dee2e6;
    border-radius: 25px; 
    outline: none; 
    font-size: 0.95rem; 
    transition: all 0.3s ease; 
    background: linear-gradient(135deg, #ffffff 0%, #fafafa 100%);
    min-width: 0; /* 防止输入框溢出 */
    box-shadow: inset 0 1px 3px rgba(0,0,0,0.05);
}
/* 输入框聚焦效果 */
.chat-input input:focus { 
    border-color: #8062d6; 
    background: #ffffff;
    box-shadow: 0 0 0 3px rgba(128, 98, 214, 0.1), inset 0 1px 3px rgba(0,0,0,0.05);
}
/* 发送按钮 - 美化版 */
.chat-input button {
    background: linear-gradient(135deg, #8062d6 0%, #667eea 100%); 
    color: white; 
    border: none; 
    border-radius: 50%;
    width: 44px; 
    height: 44px; 
    cursor: pointer;
    transition: all 0.3s ease; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    font-size: 18px; 
    box-shadow: 0 4px 12px rgba(128, 98, 214, 0.25);
    flex-shrink: 0; /* 防止按钮被压缩 */
}
/* 按钮hover/点击效果 */
.chat-input button:hover { 
    transform: scale(1.08); 
    box-shadow: 0 6px 16px rgba(128, 98, 214, 0.35);
}
.chat-input button:active {
    transform: scale(0.98);
    box-shadow: 0 2px 8px rgba(128, 98, 214, 0.2);
}

/* 小屏手机适配 */
@media (max-width: 480px) {
    .chat-input {
        padding: 8px;
    }
    .chat-input input {
        padding: 10px 16px;
        font-size: 0.9rem;
    }
    .chat-input button {
        width: 40px; 
        height: 40px;
        font-size: 16px;
    }
}
        /* 底部链接 */
        footer { text-align: center; margin-top: 10px; }
        footer a { color: #999; text-decoration: none; font-size: 12px; margin: 0 8px; }