/* 
 * DeepSeek-inspired Minimalist UI Style
 * Replaces the comic style with clean, modern minimalist design
 */

/* 1. 引入现代字体 */
@import url('https://fonts.googleapis.com/css2?family=Inter:wght@300;400;500;600;700&display=swap');

/* =========================================
   核心变量定义 (简约设计)
   ========================================= */
:root {
    /* 简约配色 - 深蓝主题 */
    --color-primary: #1a73e8;
    --color-primary-light: #e8f0fe;
    --color-primary-dark: #0d47a1;
    --color-sidebar: #f8fafc;
    --color-bg: #ffffff;
    --color-surface: #ffffff;
    --color-text: #202124;
    --color-text-secondary: #5f6368;
    --color-border: #dadce0;
    --color-border-light: #e8eaed;
    --color-hover: #f6f8fa;
    --color-active: #e8f0fe;
    --color-shadow: rgba(60, 64, 67, 0.1);
    --color-shadow-light: rgba(60, 64, 67, 0.05);
    
    /* 布局变量 */
    --border-radius: 8px;
    --border-radius-sm: 6px;
    --border-radius-lg: 12px;
    --shadow-sm: 0 1px 2px var(--color-shadow);
    --shadow-md: 0 2px 6px var(--color-shadow);
    --shadow-lg: 0 8px 24px var(--color-shadow-light);
    
    /* 字体 */
    --font-family: 'Inter', -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
    --font-mono: 'SF Mono', Monaco, 'Cascadia Mono', 'Roboto Mono', monospace;
    
    /* 动效 */
    --transition-fast: 150ms cubic-bezier(0.4, 0, 0.2, 1);
    --transition-normal: 250ms cubic-bezier(0.4, 0, 0.2, 1);
    
    /* 项目特定变量 */
    --sidebar-width: 260px;
    --header-height: 60px;
    --message-max-width: 85%;
}

/* =========================================
   2. 全局基础样式
   ========================================= */
* { 
    box-sizing: border-box; 
    margin: 0; 
    padding: 0; 
    outline: none;
}

body {
    margin: 0;
    background-color: var(--color-bg);
    font-family: var(--font-family);
    font-weight: 400;
    color: var(--color-text);
    line-height: 1.5;
    height: 100vh;
    width: 100vw;
    display: flex;
    overflow: hidden;
    -webkit-font-smoothing: antialiased;
    -moz-osx-font-smoothing: grayscale;
}

h1, h2, h3, h4, h5, h6 {
    font-family: var(--font-family);
    font-weight: 600;
    color: var(--color-text);
    margin-top: 0;
    line-height: 1.3;
}

a { 
    text-decoration: none; 
    color: var(--color-primary);
    transition: color var(--transition-fast);
}
a:hover { color: var(--color-primary-dark); }
ul { list-style: none; }

/* =========================================
   3. 核心组件 (按钮, 容器)
   ========================================= */
.minimal-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-sm);
    position: relative;
    transition: box-shadow var(--transition-normal), border-color var(--transition-normal);
}
.minimal-card:hover {
    box-shadow: var(--shadow-md);
    border-color: var(--color-primary-light);
}

.btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 500;
    padding: 8px 16px;
    border: none;
    border-radius: var(--border-radius-sm);
    cursor: pointer;
    text-decoration: none;
    transition: all var(--transition-fast);
    background: transparent;
    color: var(--color-text);
    position: relative;
    gap: 6px;
}
.btn:hover {
    background: var(--color-hover);
}
.btn:active {
    transform: translateY(1px);
}
.btn-primary {
    background: var(--color-primary);
    color: white;
}
.btn-primary:hover {
    background: var(--color-primary-dark);
    color: white;
}

/* =========================================
   4. 布局样式 (侧边栏 & 主内容区)
   ========================================= */
.sidebar {
    width: var(--sidebar-width);
    background: var(--color-sidebar);
    border-right: 1px solid var(--color-border);
    display: flex;
    flex-direction: column;
    transition: all var(--transition-normal);
    flex-shrink: 0;
    position: relative;
    z-index: 50;
    height: 100%;
    padding: 16px;
    overflow-y: auto;
}
body.sidebar-closed .sidebar {
    margin-left: calc(var(--sidebar-width) * -1);
}

.sidebar-header {
    height: var(--header-height);
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 8px;
    margin-bottom: 24px;
}
.logo-text {
    font-family: var(--font-family);
    font-size: 24px;
    font-weight: 700;
    color: var(--color-primary);
    letter-spacing: -0.5px;
}
#closeSidebarBtn {
    background: transparent; 
    border: none; 
    cursor: pointer;
    color: var(--color-text-secondary);
    padding: 4px;
    border-radius: 4px;
}
#closeSidebarBtn:hover {
    background: var(--color-hover);
}

.nav-menu { 
    flex: 1; 
    overflow-y: auto; 
    margin-bottom: 24px;
}
.nav-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    font-family: var(--font-family);
    font-size: 14px;
    color: var(--color-text-secondary);
    margin-bottom: 4px;
    border-radius: var(--border-radius-sm);
    transition: all var(--transition-fast);
}
.nav-item:hover {
    background: var(--color-hover);
    color: var(--color-text);
}
.nav-item.active {
    background: var(--color-active);
    color: var(--color-primary);
    font-weight: 500;
}
.nav-item span { 
    font-size: 20px;
    width: 24px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.user-section {
    padding-top: 16px;
    border-top: 1px solid var(--color-border-light);
}
.user-profile {
    display: flex; 
    align-items: center; 
    gap: 12px;
    cursor: pointer; 
    padding: 12px; 
    border-radius: var(--border-radius-sm);
    border: 1px solid var(--color-border-light); 
    background: var(--color-surface);
    transition: all var(--transition-fast);
}
.user-profile:hover { 
    background: var(--color-hover); 
    border-color: var(--color-border);
}
.user-profile:active { 
    transform: translateY(1px); 
}
.avatar {
    width: 36px; 
    height: 36px; 
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    border-radius: 50%; 
    display: flex; 
    align-items: center; 
    justify-content: center;
    color: white; 
    font-size: 16px;
    font-weight: 600;
    font-family: var(--font-family);
}
.popover-menu {
    display: none; 
    position: absolute; 
    bottom: 85px; 
    left: 16px; 
    right: 16px;
    z-index: 1000; 
    padding: 8px;
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius);
    box-shadow: var(--shadow-lg);
    animation: fadeIn 0.15s ease-out forwards;
}
.popover-menu.show { display: block; }
.popover-item { 
    display: flex; 
    align-items: center; 
    gap: 10px;
    padding: 10px 12px; 
    font-size: 14px;
    color: var(--color-text);
    border-radius: var(--border-radius-sm); 
    transition: background var(--transition-fast);
}
.popover-item:hover { 
    background: var(--color-hover); 
    color: var(--color-primary);
}
@keyframes fadeIn { 
    from { opacity: 0; transform: translateY(8px); } 
    to { opacity: 1; transform: translateY(0); } 
}

.main-content {
    flex: 1; 
    position: relative; 
    height: 100%;
    display: flex; 
    flex-direction: column;
    overflow-y: hidden; /* 管理员页面由内部容器负责滚动，此处禁用以防冲突 */
    width: 100%;
    background: var(--color-bg);
}
.global-sidebar-trigger {
    position: absolute; 
    top: 16px; 
    left: 16px; 
    z-index: 40;
    opacity: 0; 
    pointer-events: none;
    transition: opacity var(--transition-normal);
}
body.sidebar-closed .global-sidebar-trigger {
    opacity: 1; 
    pointer-events: auto;
}

.btn-open-sidebar {
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 8px;
    color: var(--color-text-secondary);
    border-radius: var(--border-radius-sm);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all var(--transition-fast);
}
.btn-open-sidebar:hover {
    background: var(--color-hover);
    color: var(--color-primary);
}

.mobile-overlay {
    display: none; 
    position: fixed; 
    top: 0; 
    left: 0; 
    right: 0; 
    bottom: 0;
    background: rgba(0,0,0,0.4); 
    backdrop-filter: blur(4px);
    z-index: 45; 
    opacity: 0; 
    transition: opacity var(--transition-normal);
}

/* =========================================
   5. 聊天页面样式
   ========================================= */
.page-container {
    flex: 1; 
    overflow-y: auto; 
    padding: 20px;
    max-width: 900px; 
    margin: 0 auto; 
    width: 100%;
}
.chat-layout {
    display: flex; 
    flex-direction: column;
    height: 100%; 
    width: 100%; 
    position: relative;
}
.model-header { 
    position: absolute; 
    top: 16px; 
    right: 20px; 
    z-index: 20;
    display: flex;
    align-items: center;
    gap: 8px;
}
.merchant-banner {
    width: 100%;
    padding: 8px 0;
    background: #eff6ff;
    color: #1e40af;
    text-align: center;
    font-size: 13px;
    font-weight: 600;
    border-bottom: 1px solid #dbeafe;
    position: sticky;
    top: 0;
    z-index: 10;
    display: flex;
    align-items: center;
    justify-content: center;
    box-sizing: border-box;
    overflow: hidden;
    max-height: 60px;
    transform: translateY(0);
    opacity: 1;
    transition: opacity 220ms ease, transform 220ms ease, max-height 260ms ease, padding 260ms ease, border-bottom-width 260ms ease;
    will-change: opacity, transform, max-height, padding;
}
.merchant-banner.is-hiding {
    opacity: 0;
    transform: translateY(-8px);
    max-height: 0;
    padding-top: 0;
    padding-bottom: 0;
    border-bottom-width: 0;
}
.messages-container {
    flex: 1; 
    overflow-y: auto;
    padding: 80px 0 20px 0;
    display: flex; 
    flex-direction: column; 
    width: 100%;
    scroll-behavior: smooth;
}
.empty-state {
    margin: auto; 
    text-align: center; 
    max-width: 600px;
    padding: 4rem 2rem; 
    animation: fadeIn 0.8s cubic-bezier(0.4, 0, 0.2, 1);
}
.empty-state-icon { 
    width: 80px;
    height: 80px;
    margin-bottom: 2rem; 
    display: inline-block; 
    opacity: 1;
    filter: drop-shadow(0 10px 15px rgba(0,0,0,0.05));
}
.empty-state h2 { 
    font-size: 28px; 
    font-weight: 800;
    margin-bottom: 12px; 
    color: #1e293b;
    letter-spacing: -0.02em;
}
.empty-state p { 
    font-size: 16px; 
    line-height: 1.6;
    color: #64748b;
}

/* 聊天气泡 - DeepSeek风格 */
.message {
    padding: 0; /* 移除容器内边距，由内部 wrapper 或 content 控制 */
    border-radius: var(--border-radius-lg);
    margin-bottom: 20px; 
    position: relative;
    max-width: var(--message-max-width); 
    line-height: 1.6; 
    font-size: 15px;
    animation: messageIn 0.3s ease-out;
    background: transparent !important; /* 确保容器本身透明 */
    border: none !important; /* 确保容器本身无边框 */
}
.message.ai {
    align-self: flex-start;
}
.message.user {
    align-self: flex-end;
}

.message.system {
    background: transparent;
    border: none;
    align-self: center;
    max-width: 90%;
    padding: 8px 0;
    font-size: 14px;
    color: var(--color-text-secondary);
    text-align: center;
    box-shadow: none !important;
}

.game-select-status {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    background: #f1f5f9;
    padding: 6px 16px;
    border-radius: 20px;
    border: 1px solid #e2e8f0;
    color: #475569;
    font-size: 13px;
    transition: all 0.3s ease;
    animation: fadeIn 0.5s ease-out;
}

.game-select-status:hover {
    background: #e2e8f0;
    transform: scale(1.02);
}

.game-select-status .status-icon {
    width: 14px;
    height: 14px;
    opacity: 0.7;
}

.game-select-status strong {
    color: var(--color-primary);
    margin-left: 2px;
}

.system-text {
    font-weight: 400;
}

.message-content, .ai-text-content {
    max-width: 100%;
    padding: 12px 16px;
    border-radius: 18px;
    font-size: 15px;
    line-height: 1.6;
    word-wrap: break-word;
    overflow-wrap: break-word;
    overflow-x: auto;
    position: relative;
    box-shadow: 0 1px 2px rgba(0,0,0,0.05);
    display: inline-block;
}

.message.ai .ai-text-content {
    background-color: #f1f5f9;
    color: #0f172a;
    border-bottom-left-radius: 4px;
    border: none;
}

.message.user .message-content {
    background-color: #4d6bfe;
    color: #ffffff;
    border-bottom-right-radius: 4px;
    border: none;
}

/* Inner element styles matching recommend.php */
.message-content p, .ai-text-content p {
    margin: 0 0 8px 0;
}
.message-content p:last-child, .ai-text-content p:last-child {
    margin: 0;
}
.message-content ul, .ai-text-content ul, 
.message-content ol, .ai-text-content ol {
    margin: 0 0 8px 0;
    padding-left: 20px;
}
.message-content li, .ai-text-content li {
    margin-bottom: 4px;
}

.table-card {
    margin: 12px 0;
    border: 1px solid #e2e8f0;
    border-radius: 12px;
    background: #ffffff;
    box-shadow: var(--shadow-sm);
    overflow: hidden;
    width: 100%;
}
.table-wrapper {
    width: 100%;
    overflow-x: auto;
}
.ai-text-content table {
    width: 100%;
    border-collapse: collapse;
}
.ai-text-content th,
.ai-text-content td {
    padding: 10px 12px;
    border-bottom: 1px solid #e2e8f0;
    border-right: 1px solid #e2e8f0;
    text-align: left;
    vertical-align: top;
    word-break: break-word;
}
.ai-text-content th:last-child,
.ai-text-content td:last-child {
    border-right: none;
}
.ai-text-content th {
    background: #f8fafc;
    color: #1e40af;
    font-weight: 700;
}
.ai-text-content tr:nth-child(even) td {
    background: #fbfdff;
}

.message strong { 
    font-weight: 600; 
    color: var(--color-primary-dark);
}
.message.user .message-content strong {
    color: rgba(255, 255, 255, 0.9);
}

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

/* 优化滚动条样式 */
.messages-container::-webkit-scrollbar {
    width: 6px;
}
.messages-container::-webkit-scrollbar-track {
    background: transparent;
}
.messages-container::-webkit-scrollbar-thumb {
    background: #e2e8f0;
    border-radius: 10px;
}
.messages-container::-webkit-scrollbar-thumb:hover {
    background: #cbd5e1;
}

.input-area {
    width: 100%; 
    padding: 24px 20px 32px; /* 增加底部留白，更具呼吸感 */
    background: linear-gradient(to bottom, rgba(255,255,255,0.8), #ffffff); /* 渐变效果 */
    backdrop-filter: blur(10px); /* 模糊背景 */
    display: flex; 
    flex-direction: column;
    align-items: center; 
    position: relative; 
    z-index: 30;
    box-shadow: 0 -10px 25px -5px rgba(0, 0, 0, 0.04); /* 使用阴影代替线条 */
    border-radius: 32px 32px 0 0; /* 顶部圆角 */
}
/* 输入区域工具栏 */
.input-toolbar {
    width: 100%; 
    max-width: 768px; 
    display: flex; 
    align-items: center; 
    justify-content: flex-start; /* 靠左对齐 */
    gap: 10px;
    margin-bottom: 14px;
    padding: 0 4px;
    /* 增加水平滚动支持 */
    overflow-x: auto;
    white-space: nowrap;
    -webkit-overflow-scrolling: touch; /* 优化触摸滚动体验 */
    scrollbar-width: none; /* Firefox 隐藏滚动条 */
    -ms-overflow-style: none; /* IE/Edge 隐藏滚动条 */
}
/* 隐藏 Chrome/Safari 滚动条 */
.input-toolbar::-webkit-scrollbar {
    display: none;
}

/* 智能插图按钮 */
.illustration-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    gap: 8px;
    background: #ffffff;
    border: 1px solid #eef0f2;
    border-radius: 10px;
    padding: 8px 16px;
    font-family: var(--font-family);
    font-size: 14px;
    font-weight: 600;
    color: #4b5563;
    cursor: pointer;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 2px 5px rgba(0,0,0,0.02);
    /* 确保按钮不被压缩 */
    flex-shrink: 0;
}
.illustration-btn:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    transform: translateY(-1px);
    box-shadow: 0 4px 8px rgba(0,0,0,0.04);
}
.illustration-btn.active {
    background: #eff6ff;
    border-color: #3b82f6;
    color: #2563eb;
}
.illustration-icon {
    width: 16px;
    height: 16px;
    object-fit: contain;
}

/* 圆角矩形输入框 */
.input-box-wrapper {
    width: 100%; 
    max-width: 768px; 
    position: relative;
    background: #fff; 
    border: 1.5px solid #eef0f2; /* 更淡的边框 */
    border-radius: 9999px; /* 全圆角 (Pill shape) */
    padding: 10px 18px;
    display: flex; 
    align-items: center;
    transition: all 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.03);
}
.input-box-wrapper:focus-within {
    box-shadow: 0 8px 20px rgba(26, 115, 232, 0.08);
    border-color: var(--color-primary);
    transform: translateY(-1px);
}
.chat-input {
    width: 100%; 
    border: none; 
    background: transparent;
    max-height: 200px; 
    min-height: 24px;
    resize: none; 
    font-size: 16px; /* 稍微调大字体，提升阅读感 */
    padding: 8px 4px; 
    line-height: 1.6; 
    font-family: var(--font-family);
    color: var(--color-text);
}
.chat-input::placeholder {
    color: var(--color-text-secondary);
}

/* 发送按钮 */
.send-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 40px;
    height: 40px;
    border-radius: 50%; /* 圆形按钮 */
    background: var(--color-primary);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    flex-shrink: 0;
    margin-left: 8px;
    box-shadow: 0 2px 6px rgba(26, 115, 232, 0.2);
}
.send-btn:hover {
    background: var(--color-primary-dark);
    transform: scale(1.05);
    box-shadow: 0 4px 10px rgba(26, 115, 232, 0.3);
}
.send-btn:active {
    transform: scale(0.95);
}

.disclaimer {
    font-size: 12px; 
    text-align: center; 
    color: var(--color-text-secondary);
    margin-top: 12px; 
    font-weight: 400;
}

/* 开关切换 (已移除，改为按钮) */
/* .illustration-toggle-container { 
    display: flex; 
    align-items: center; 
    justify-content: center; 
    gap: 10px; 
    margin-bottom: 12px; 
} */

/* 插图样式 */
.illustration-container {
    margin-top: 16px; 
    border-top: 1px solid var(--color-border-light); 
    padding-top: 16px;
}
.illustration-container img {
    max-width: 300px; 
    width: 100%; 
    height: auto;
    border-radius: var(--border-radius); 
    display: block;
    border: 1px solid var(--color-border); 
    margin: 0 auto;
}
.illustration-caption {
    font-family: var(--font-family); 
    font-size: 13px; 
    text-align: center; 
    margin-top: 8px;
    color: var(--color-text-secondary);
    padding: 4px 8px;
}
.typing-dots { 
    color: var(--color-text-secondary);
    font-style: normal;
}
.typing-dots::after {
    content: '...';
    animation: typing 1.5s infinite;
}

@keyframes typing {
    0%, 20% { content: '.'; }
    40% { content: '..'; }
    60%, 100% { content: '...'; }
}

/* =========================================
   6. 个人设置页面样式 (Settings Page)
   ========================================= */
.settings-container {
    max-width: 680px;
    margin: 40px auto;
    animation: fadeIn 0.4s ease-out;
}

.settings-card {
    background: var(--color-surface);
    border: 1px solid var(--color-border);
    border-radius: var(--border-radius-lg);
    box-shadow: var(--shadow-lg);
    overflow: hidden;
}

/* 头像与基本资料 */
.settings-profile-header {
    padding: 32px;
    background: linear-gradient(to right, #f8fafc, #ffffff);
    border-bottom: 1px solid var(--color-border-light);
    display: flex;
    align-items: center;
    gap: 24px;
}

.settings-avatar-wrapper {
    position: relative;
    width: 84px;
    height: 84px;
}

.settings-avatar {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    background: linear-gradient(135deg, var(--color-primary), var(--color-primary-dark));
    color: white;
    font-size: 32px;
    font-weight: 700;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.2);
    border: 3px solid #fff;
}

.avatar-edit-btn {
    position: absolute;
    bottom: -4px;
    right: -4px;
    width: 28px;
    height: 28px;
    background: #fff;
    border: 1px solid var(--color-border);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: var(--shadow-sm);
    transition: all 0.2s;
    color: var(--color-text-secondary);
}

.avatar-edit-btn:hover {
    color: var(--color-primary);
    transform: scale(1.1);
    border-color: var(--color-primary-light);
}

.settings-user-info h3 {
    font-size: 20px;
    font-weight: 700;
    margin-bottom: 6px;
    color: var(--color-text);
}

/* 表单板块 */
.settings-section {
    padding: 32px;
}

.settings-section-title {
    font-size: 16px;
    font-weight: 700;
    color: var(--color-text);
    margin-bottom: 24px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.settings-section-title i {
    color: var(--color-primary);
}

.settings-form-group {
    margin-bottom: 24px;
}

.settings-form-group label {
    display: block;
    font-size: 14px;
    font-weight: 600;
    color: var(--color-text-secondary);
    margin-bottom: 10px;
}

.settings-input {
    width: 100%;
    padding: 12px 16px;
    border: 1.5px solid var(--color-border-light);
    border-radius: 10px;
    font-size: 15px;
    font-family: var(--font-family);
    transition: all 0.2s cubic-bezier(0.4, 0, 0.2, 1);
    background: #fff;
}

.settings-input:focus {
    border-color: var(--color-primary);
    box-shadow: 0 0 0 4px rgba(26, 115, 232, 0.08);
}

.settings-input:disabled {
    background: #f8fafc;
    color: #94a3b8;
    cursor: not-allowed;
}

.settings-hint {
    font-size: 12px;
    color: #94a3b8;
    margin-top: 6px;
}

/* 等级徽章 */
.role-badge {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 6px 14px;
    border-radius: 20px;
    font-size: 13px;
    font-weight: 600;
}

.role-badge.admin {
    background: #fffbeb;
    color: #b45309;
    border: 1px solid #fde68a;
}

.role-badge.user {
    background: #f0fdf4;
    color: #166534;
    border: 1px solid #bbf7d0;
}

/* 按钮优化 */
.settings-actions {
    margin-top: 12px;
    display: flex;
    justify-content: flex-end;
}

.btn-save {
    padding: 12px 32px;
    font-size: 15px;
    font-weight: 700;
    border-radius: 12px;
    box-shadow: 0 4px 12px rgba(26, 115, 232, 0.15);
}

/* 移动端适配 */
@media (max-width: 768px) {
    .settings-container { margin: 16px; }
    .settings-profile-header { padding: 24px; flex-direction: column; text-align: center; }
    .settings-section { padding: 24px; }
    .settings-avatar-wrapper { margin: 0 auto; }
}

/* =========================================
   7. 移动端适配
   ========================================= */
@media (max-width: 768px) {
    .sidebar {
        position: fixed; 
        top: 0; 
        bottom: 0; 
        left: 0;
        width: 280px; 
        transform: translateX(-100%); 
        margin-left: 0 !important;
        box-shadow: var(--shadow-lg);
        z-index: 60;
    }
    body.sidebar-mobile-open .sidebar { 
        transform: translateX(0); 
    }
    body.sidebar-mobile-open .mobile-overlay { 
        display: block; 
        opacity: 1; 
        z-index: 55;
    }
    
    .global-sidebar-trigger { 
        display: flex !important; 
        opacity: 1; 
        pointer-events: auto; 
    }
    body.sidebar-mobile-open .global-sidebar-trigger {
        opacity: 0 !important; 
        pointer-events: none !important;
    }
    
    .page-container { 
        padding: 12px; 
    }
    .input-area { 
        padding: 16px 12px 24px; 
        box-shadow: 0 -8px 20px rgba(0, 0, 0, 0.05);
    }
    .input-toolbar {
        padding: 0 2px;
        gap: 8px;
        margin-bottom: 10px;
    }
    .input-box-wrapper {
        padding: 8px 10px;
        border-radius: 12px;
    }
    .chat-input {
        font-size: 15px;
        padding: 6px 2px;
    }
    .model-header { 
        top: 16px; 
        right: 16px; 
    }
    .message { 
        max-width: 92%; 
        margin-bottom: 16px;
    }
    .message-content, .ai-text-content {
        padding: 12px 16px;
        font-size: 15px; /* Match recommend.php */
    }
    .illustration-btn {
        padding: 6px 12px;
        font-size: 13px;
        border-radius: 8px;
    }
}
