        /* 移动端基础样式 */
        body {
            font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, "Helvetica Neue", Arial, sans-serif;
            margin: 0;
            padding: 0;
            background-color: #f7f7f7;
            display: flex;
            flex-direction: column;
            height: 100vh;
            overflow: hidden; /* 防止底部输入框滚动 */
        }
        
        /* App容器 */
        #app-container {
            height: 100%;
            width: 100%;
            display: flex;
            flex-direction: column;
        }
        
        /* 顶部导航栏 (Header) 
        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 15px;
            background-color: #EDEDED; // 仿微信深色顶部 
            color: #333;
            font-size: 18px;
            font-weight: 500;
            border-bottom: 1px solid #dcdcdc;
            flex-shrink: 0;
        }*/
        .header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 10px 15px;
            background-color: #EDEDED;
            color: #333;
            font-size: 18px;
            font-weight: 500;
            border-bottom: 1px solid #dcdcdc;
            
            /* --- 关键修改 --- */
            position: sticky;  /* 粘性定位 */
            top: 0;            /* 粘在顶部 */
            z-index: 1000;     /* 保证在最上层 */
            width: 100%;       /* 占满容器宽度 */
            box-sizing: border-box;
            flex-shrink: 0;    /* 防止在 flex 布局中被压缩 */
        }
        .header-title {
            flex-grow: 1;
            text-align: center;
        }

        .header button {
            background: none;
            border: none;
            color: #333;
            font-size: 22px;
            cursor: pointer;
            padding: 0;
            line-height: 1;
            min-width: 40px; /* 增加点击区域 */
            text-align: center;
        }
        
        /* 返回按钮特殊样式 */
        .header button svg {
            vertical-align: middle;
        }

        /* 底部导航栏 (Footer for tab switching)
        .footer-nav {
            display: flex;
            justify-content: space-around;
            padding: 5px 0;
            border-top: 1px solid #ccc;
            background-color: #f7f7f7;
            flex-shrink: 0;
        }

        .nav-item {
            text-align: center;
            cursor: pointer;
            padding: 5px;
            color: #999;
        }

        .nav-item.active {
            color: #1AAD19; ///微信绿色 
            font-weight: 500;
        } /*
        
        /* 主内容区域 (Content Area) */
        .content {
            flex-grow: 1;
            overflow-y: auto;
            position: relative;
            min-height: 0;  /* 重要！让 flex-grow 在 overflow 容器中正常工作 */
            box-sizing: border-box;
        }

        /* 聊天界面 */
        #chat-container {
            padding: 10px;
            display: flex;
            flex-direction: column;
            gap: 10px;
            padding-bottom: 150px; /* 增加底部padding以防被输入区域遮挡(考虑引用预览的高度) */
        }

        .message {
            display: flex;
            flex-direction: row; /* 横向布局:头像和内容左右排列 */
            margin-bottom: 5px;
            gap: 8px;
        }

        .message.user {
            justify-content: flex-end; /* 用户消息右对齐 */
        }

        .message.assistant {
            justify-content: flex-start; /* AI消息左对齐 */
        }
        
        /* 用户消息:头像在右侧 */
        .message.user {
            flex-direction: row-reverse;
        }

        .bubble {
            max-width: 100%; /* 改为100%，由contentWrapper控制最大宽度 */
            width: fit-content; /* 自适应内容宽度 */
            padding: 8px 12px; /* 调整为微信的padding */
            padding-bottom: 20px; /* 为时间戳留出空间 */
            border-radius: 6px; /* 微信的圆角 */
            line-height: 1.4;
            word-wrap: break-word;
            position: relative;
        }

        .message.user .bubble {
            background-color: #95EC69; /* 微信用户气泡颜色 */
            color: #000;
            border-top-right-radius: 0; /* 右上角尖角 */
        }

        .message.assistant .bubble {
            background-color: #fff; /* AI气泡颜色 */
            color: #000;
            border-top-left-radius: 0; /* 左上角尖角 */
            border: 1px solid #e5e5e5; /* 微信的边框颜色 */
        }
        
        /* 消息内容包装器（包含引用和气泡） */
        .message-content-wrapper {
            display: flex;
            flex-direction: column;
            max-width: 75%;
            width: fit-content; /* 自适应内容宽度 */
        }
        
        /* AI消息：内容左对齐（紧贴左侧头像） */
        .message.assistant .message-content-wrapper {
            align-items: flex-start;
        }
        
        /* 用户消息：内容右对齐（紧贴右侧头像） */
        .message.user .message-content-wrapper {
            align-items: flex-end;
        }
        
        /* WhatsApp风格的时间戳和状态 */
        .message-meta {
            position: absolute;
            bottom: 3px;
            right: 8px;
            font-size: 11px;
            color: #667781;
            display: flex;
            align-items: center;
            gap: 3px;
        }
        
        .message.user .message-meta {
            color: #667781;
        }
        
        /* 对勾样式 */
        .checkmark {
            display: inline-block;
            font-size: 14px;
            color: #667781;
        }
        
        .checkmark.double {
            color: #53bdeb; /* 蓝色表示已读/已送达 */
        }
        
        /* 正在输入指示器 (仿微信，黑色) */
        .typing-indicator {
            color: #333;
            font-size: 18px;
        }
        .page {
            display: none;
            height: 100vh;
            flex-direction: column;
        }

        .page.active {
            display: flex;
            height: 100vh;
        }

        /* 聊天输入区 */
        .chat-input-area {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            background-color: #f7f7f7;
            padding: 5px 6px; /* 进一步减小padding */
            display: flex;
            flex-wrap: wrap;
            align-items: center;
            gap: 3px; /* 最小间距 */
            border-top: 1px solid #dcdcdc;
            box-shadow: 0 -1px 3px rgba(0,0,0,0.05);
            flex-shrink: 0;
        }
        
        /* 引用预览占满一行 */
        .chat-input-area .quote-reference {
            width: 100%;
            order: 999; /* 确保在最后面（输入框下方） */
            margin: 6px 0 0 0; /* 在输入框下方留间距 */
        }
        
        .input-tool-btn {
            background: none;
            border: none;
            padding: 4px; /* 最小padding */
            cursor: pointer;
            color: #666;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
            transition: background-color 0.2s;
            flex-shrink: 0;
            width: 32px;
            height: 32px;
        }
        
        .input-tool-btn svg {
            width: 20px;
            height: 20px;
        }
        
        .input-tool-btn:hover {
            background-color: #e0e0e0;
        }
        
        .input-tool-btn:active {
            background-color: #d0d0d0;
        }

        #user-input {
            flex: 1 1 auto;
            min-width: 80px; /* 进一步减小最小宽度 */
            padding: 6px 8px; /* 减小padding */
            border: 1px solid #ccc;
            border-radius: 5px;
            font-size: 15px;
            resize: none;
            max-height: 80px;
            overflow-y: auto;
            background-color: white;
            line-height: 1.4;
        }
        
        /* 设置界面 */
        #settings-page {
            padding: 20px;
        }
        
        .form-group {
            margin-bottom: 15px;
        }
        
        .form-group label {
            display: block;
            margin-bottom: 5px;
            font-weight: 500;
            color: #555;
        }
        
        .form-group input, .form-group textarea {
            width: 100%;
            padding: 10px;
            border: 1px solid #ccc;
            border-radius: 5px;
            box-sizing: border-box;
            font-size: 14px;
        }

        #save-settings-btn {
            width: 100%;
            background-color: #1AAD19;
            color: white;
            border: none;
            padding: 12px;
            border-radius: 5px;
            cursor: pointer;
            font-size: 16px;
            margin-top: 20px;
        }

        /* 桌面与图标样式 */
        .home-page .wallpaper {
            background: linear-gradient(180deg,#cce8d7 0%, #67c77f 100%);
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            padding-top: 40px;
            box-sizing: border-box;
        }

        .desktop {
            width: 100%;
            max-width: 420px;
            display: grid;
            grid-template-columns: repeat(3, 1fr); /* 3 columns per row, 4 rows total */
            grid-auto-rows: 120px; /* fixed row height to ensure 4 visible rows */
            gap: 18px;
            padding: 20px;
            box-sizing: border-box;
            justify-items: center;
            align-content: start;
        }

        .desktop-slot {
            width: 100%;
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
        }

        .app-icon {
            width: 64px;
            height: 64px;
            background: rgba(255,255,255,0.12);
            border-radius: 14px;
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 28px;
            cursor: pointer;
            box-shadow: 0 4px 10px rgba(0,0,0,0.15);
            user-select: none;
        }

        .app-label {
            margin-top: 6px;
            font-size: 12px;
            color: rgba(255,255,255,0.95);
            text-align: center;
            width: 84px;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }

        /* 固定 Dock 栏 (底部) */
        .dock {
            position: fixed;
            left: 0;
            right: 0;
            bottom: 50px; /* 在页面底部上方，和现有 footer-nav 留出空间 */
            display: flex;
            justify-content: center;
            pointer-events: none; /* 让内部项目控制点击 */
        }

        .dock-inner {
            background: rgba(255,255,255,0.12);
            padding: 8px 18px;
            border-radius: 16px;
            display: flex;
            gap: 18px;
            box-shadow: 0 6px 18px rgba(0,0,0,0.15);
            pointer-events: auto;
        }

        .dock-item {
            width: 56px;
            height: 56px;
            border-radius: 12px;
            background: rgba(255,255,255,0.14);
            display: flex;
            align-items: center;
            justify-content: center;
            color: #fff;
            font-size: 24px;
            cursor: pointer;
        }

        /* Dock item press / dragging styles - animations removed for clarity */
        .dock-item {
            will-change: auto;
        }

        .dock-item.dragging {
            opacity: 0.5;
        }

        .app-icon.dragging {
            opacity: 0.5;
        }

        /* 隐藏和显示页面 */
        .page {
            display: none;
            height: 100%;
            width: 100%;
        }

        .page.active {
            display: flex;
            flex-direction: column;
        }
        
        /* ========== 头像样式 ========== */
        .message-avatar {
            width: 40px;
            height: 40px;
            border-radius: 6px;
            object-fit: cover;
            flex-shrink: 0;
        }
        
        .message.user {
            flex-direction: row;
        }
        
        .message.assistant {
            flex-direction: row;
        }
        
        .message.user .message-avatar {
            order: 2;
            margin-left: 8px;
        }
        
        .message.assistant .message-avatar {
            order: 0;
            margin-right: 8px;
        }
        
        .message.user .bubble {
            order: 1;
        }
        
        .message.assistant .bubble {
            order: 1;
        }
        
        .default-avatar {
            width: 100%;
            height: 100%;
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 18px;
            font-weight: 600;
            color: white;
            border-radius: 6px;
        }
        
        .default-avatar.ai {
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
        }
        
        .default-avatar.user {
            background: linear-gradient(135deg, #07c160 0%, #06ae56 100%);
        }
        
        .avatar-preview-container {
            display: flex;
            align-items: center;
            gap: 12px;
            margin-top: 8px;
        }
        
        .avatar-preview {
            width: 80px;
            height: 80px;
            border-radius: 8px;
            object-fit: cover;
            border: 1px solid #e7e7e7;
            flex-shrink: 0;
        }
        
        .avatar-preview.small {
            width: 60px;
            height: 60px;
        }
        
        .avatar-upload-btn {
            padding: 8px 16px;
            background: #07c160;
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
        }
        
        .avatar-upload-btn:active {
            opacity: 0.8;
        }
        
        .avatar-remove-btn {
            padding: 8px 16px;
            background: #f44336;
            color: white;
            border: none;
            border-radius: 6px;
            cursor: pointer;
            font-size: 14px;
        }
        
        .avatar-remove-btn:active {
            opacity: 0.8;
        }
        
        /* ========== 底部导航栏 ========== */
        .bottom-nav {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 50px;
            background-color: #f7f7f7;
            border-top: 1px solid #d9d9d9;
            display: flex;
            justify-content: space-around;
            align-items: center;
            z-index: 1000;
        }
        
        .nav-item {
            flex: 1;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            cursor: pointer;
            color: #999;
            font-size: 11px;
            gap: 2px;
            padding: 4px 0;
            transition: color 0.2s;
            user-select: none;
        }
        
        .nav-item svg {
            width: 24px;
            height: 24px;
            stroke: currentColor;
        }
        
        .nav-item.active {
            color: #07c160; /* 微信绿 */
        }
        
        .nav-item.active svg {
            stroke: #07c160;
        }
        
        /* 为底部导航留出空间 */
        .page-with-nav .content {
            padding-bottom: 50px;
        }
        
        /* ========== 全局消息通知横幅 ========== */
        .message-notification {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            background: rgba(0, 0, 0, 0.85);
            padding: 12px 16px;
            display: none;
            align-items: center;
            gap: 12px;
            z-index: 10000;
            animation: slideDown 0.3s ease-out;
            cursor: pointer;
            user-select: none;
        }
        
        @keyframes slideDown {
            from {
                transform: translateY(-100%);
                opacity: 0;
            }
            to {
                transform: translateY(0);
                opacity: 1;
            }
        }
        
        @keyframes slideUp {
            from {
                transform: translateY(0);
                opacity: 1;
            }
            to {
                transform: translateY(-100%);
                opacity: 0;
            }
        }
        
        .message-notification.show {
            display: flex;
        }
        
        .message-notification.hiding {
            animation: slideUp 0.3s ease-out;
        }
        
        .message-notification-avatar {
            width: 40px;
            height: 40px;
            border-radius: 6px;
            flex-shrink: 0;
            object-fit: cover;
        }
        
        .message-notification-content {
            flex: 1;
            min-width: 0;
        }
        
        .message-notification-name {
            font-size: 14px;
            font-weight: 500;
            color: white;
            margin-bottom: 2px;
        }
        
        .message-notification-text {
            font-size: 13px;
            color: rgba(255, 255, 255, 0.8);
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        
        .message-notification-close {
            width: 20px;
            height: 20px;
            color: rgba(255, 255, 255, 0.6);
            flex-shrink: 0;
            font-size: 20px;
            line-height: 1;
        }
        
        /* ========== 配置提醒对话框 ========== */
        .config-reminder-dialog {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.6);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 10001;
        }
        
        .config-reminder-dialog.show {
            display: flex;
        }
        
        .config-reminder-content {
            background: white;
            border-radius: 12px;
            width: 85%;
            max-width: 360px;
            padding: 24px;
            text-align: center;
        }
        
        .config-reminder-icon {
            font-size: 48px;
            margin-bottom: 16px;
        }
        
        .config-reminder-title {
            font-size: 18px;
            font-weight: 600;
            color: #333;
            margin-bottom: 12px;
        }
        
        .config-reminder-message {
            font-size: 14px;
            color: #666;
            line-height: 1.6;
            margin-bottom: 20px;
        }
        
        .config-reminder-buttons {
            display: flex;
            gap: 12px;
        }
        
        .config-reminder-btn {
            flex: 1;
            padding: 12px;
            border: none;
            border-radius: 6px;
            font-size: 15px;
            cursor: pointer;
            transition: opacity 0.2s;
        }
        
        .config-reminder-btn:active {
            opacity: 0.7;
        }
        
        .config-reminder-btn.secondary {
            background: #f0f0f0;
            color: #333;
        }
        
        .config-reminder-btn.primary {
            background: #07c160;
            color: white;
        }
        
        /* ========== 聊天列表样式 ========== */
        .character-list-item {
            display: flex;
            align-items: center;
            padding: 12px 16px;
            border-bottom: 1px solid #e7e7e7;
            cursor: pointer;
            background: #fff;
        }
        .character-list-item:active {
            background-color: #ececec;
        }
        .character-list-avatar {
            width: 48px;
            height: 48px;
            border-radius: 6px;
            background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
            display: flex;
            align-items: center;
            justify-content: center;
            font-size: 20px;
            color: white;
            margin-right: 12px;
            flex-shrink: 0;
        }
        .character-list-info {
            flex: 1;
            min-width: 0;
        }
        .character-list-name {
            font-size: 16px;
            font-weight: 500;
            color: #000;
            margin-bottom: 4px;
        }
        .character-list-preview {
            font-size: 14px;
            color: #999;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        .character-add-menu {
            position: fixed;
            top: 50px;
            right: 10px;
            background: white;
            border-radius: 6px;
            box-shadow: 0 2px 10px rgba(0,0,0,0.2);
            z-index: 9999;
            min-width: 140px;
            display: none;
        }
        .character-add-menu.active {
            display: block;
        }
        .character-add-menu-item {
            padding: 14px 20px;
            border-bottom: 1px solid #e7e7e7;
            cursor: pointer;
            font-size: 15px;
            color: #000;
            display: flex;
            align-items: center;
            gap: 12px;
        }
        .character-add-menu-item:last-child {
            border-bottom: none;
        }
        .character-add-menu-item:active {
            background-color: #ececec;
        }
        .character-new-modal {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0,0,0,0.6);
            z-index: 10000;
            align-items: center;
            justify-content: center;
        }
        .character-new-modal.active {
            display: flex;
        }
        .character-new-modal-content {
            background: white;
            border-radius: 12px;
            width: 85%;
            max-width: 400px;
            max-height: 88vh;
            display: flex;
            flex-direction: column;
            overflow: hidden;
        }
        .character-new-modal-header {
            padding: 16px 20px;
            border-bottom: 1px solid #e7e7e7;
            font-size: 17px;
            font-weight: 500;
            text-align: center;
            flex-shrink: 0;
        }
        .character-new-modal-body {
            padding: 20px;
            overflow-y: auto;
            flex: 1;
            min-height: 0;
        }
        .character-new-modal-footer {
            padding: 12px 20px;
            border-top: 1px solid #e7e7e7;
            display: flex;
            gap: 12px;
            flex-shrink: 0;
        }
        .character-new-modal-btn {
            flex: 1;
            padding: 12px;
            border: none;
            border-radius: 6px;
            font-size: 16px;
            cursor: pointer;
        }
        .character-new-modal-btn.cancel {
            background: #f0f0f0;
            color: #333;
        }
        .character-new-modal-btn.confirm {
            background: #07c160;
            color: white;
        }
        .character-empty-list {
            text-align: center;
            padding: 80px 20px;
            color: #999;
        }
        
        /* ========== 长按菜单样式 ========== */
        .bubble-menu {
            position: fixed;
            background: white;
            border-radius: 12px;
            box-shadow: 0 4px 20px rgba(0,0,0,0.15);
            padding: 10px;
            z-index: 10000;
            display: none;
            grid-template-columns: repeat(3, 1fr);
            gap: 8px;
            min-width: 270px;
            max-width: 90vw; /* 限制最大宽度为屏幕宽度的90% */
        }
        
        .bubble-menu.active {
            display: grid;
        }
        
        .bubble-menu-item {
            padding: 12px 8px;
            cursor: pointer;
            user-select: none;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 4px;
            font-size: 13px;
            color: #333;
            transition: background 0.2s;
            border-radius: 8px;
            background: #f7f7f7;
            text-align: center;
            min-width: 0; /* 允许内容收缩 */
        }
        
        .bubble-menu-item:hover {
            background: #e8e8e8;
        }
        
        .bubble-menu-item:active {
            background: #d8d8d8;
        }
        
        .bubble-menu-item.danger {
            color: #ff3b30;
        }
        
        /* 短消息气泡：内容宽度<5时增加右侧padding为时间戳留空间 */
        .bubble.short-message {
            padding-right: 52px;
        }
        
        /* 遮罩层 */
        .menu-overlay {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0,0,0,0.3);
            z-index: 9999;
            display: none;
        }
        
        .menu-overlay.active {
            display: block;
        }
        
        /* 气泡选中状态 */
        .bubble.menu-active {
            background: rgba(0,0,0,0.05);
        }
        
        /* ========== 多选模式样式（完全仿微信）========== */
        
        /* 多选模式激活时的聊天容器调整 */
        .multi-select-mode-active #chat-container {
            padding-left: 0; /* 移除padding */
            padding-bottom: 80px; /* 为底部工具栏留出空间 */
        }
        
        /* 多选模式下的消息整体右移 */
        .multi-select-mode-active .message {
            margin-left: 55px; /* 整体右移，为复选框留空间 */
        }
        
        /* 多选模式下隐藏输入框 */
        .multi-select-mode-active .chat-input-area {
            display: none !important;
        }
        
        /* 消息容器需要相对定位 */
        .message {
            position: relative;
        }
        
        /* 多选模式下消息整体右移，避免与复选框重叠 */
        .multi-select-mode-active .message {
            margin-left: 40px; /* 向右移动，为复选框留出空间 */
        }
        
        /* 复选框容器 - 默认隐藏 */
        .multi-select-checkbox {
            position: absolute;
            left: -32px; /* 负值，使复选框显示在消息左侧 */
            top: 50%;
            transform: translateY(-50%);
            width: 22px;
            height: 22px;
            border: 1.5px solid #c8c8c8;
            border-radius: 50%;
            background: white;
            cursor: pointer;
            display: none; /* 默认隐藏 */
            align-items: center;
            justify-content: center;
            z-index: 10;
            transition: all 0.15s;
        }
        
        /* 多选模式激活时显示复选框 */
        .multi-select-mode-active .multi-select-checkbox {
            display: flex !important; /* 强制显示 */
        }
        
        /* 选中状态的复选框 */
        .multi-select-checkbox.checked {
            background: #07c160;
            border-color: #07c160;
        }
        
        /* 选中状态的勾号 - 使用CSS绘制 */
        .multi-select-checkbox.checked::after {
            content: '';
            width: 4px;
            height: 8px;
            border: solid white;
            border-width: 0 1.5px 1.5px 0;
            transform: rotate(45deg);
            margin-bottom: 2px;
        }
        
        /* 多选模式顶部工具栏 */
        .multi-select-header {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            height: 44px;
            background: #EDEDED;
            border-bottom: 0.5px solid #d9d9d9;
            display: none;
            align-items: center;
            justify-content: space-between;
            padding: 0 16px;
            z-index: 2001;
        }
        
        .multi-select-header.active {
            display: flex;
        }
        
        .multi-select-header-left {
            display: flex;
            align-items: center;
            gap: 20px;
        }
        
        .multi-select-cancel-btn {
            font-size: 17px;
            color: #576b95;
            background: none;
            border: none;
            cursor: pointer;
            padding: 0;
        }
        
        .multi-select-cancel-btn:active {
            opacity: 0.6;
        }
        
        .multi-select-count {
            font-size: 17px;
            color: #000;
        }
        
        .multi-select-select-all-btn {
            font-size: 17px;
            color: #576b95;
            background: none;
            border: none;
            cursor: pointer;
            padding: 0;
        }
        
        .multi-select-select-all-btn:active {
            opacity: 0.6;
        }
        
        /* 搜索框 */
        .multi-select-search {
            position: fixed;
            top: 44px;
            left: 0;
            right: 0;
            background: #EDEDED;
            padding: 8px 12px;
            z-index: 2000;
            display: none;
        }
        
        .multi-select-search.active {
            display: block;
        }
        
        .multi-select-search-input {
            width: 100%;
            padding: 8px 12px;
            border: none;
            border-radius: 8px;
            background: #fff;
            font-size: 15px;
            box-sizing: border-box;
            outline: none;
        }
        
        /* Select按钮 */
        .multi-select-btn-container {
            position: fixed;
            top: 104px;
            left: 16px;
            z-index: 2000;
            display: none;
        }
        
        .multi-select-btn-container.active {
            display: block;
        }
        
        .multi-select-select-btn {
            background: white;
            border: 1px solid #d9d9d9;
            border-radius: 6px;
            padding: 6px 12px;
            font-size: 14px;
            color: #576b95;
            cursor: pointer;
            display: flex;
            align-items: center;
            gap: 4px;
            box-shadow: 0 2px 8px rgba(0,0,0,0.1);
        }
        
        .multi-select-select-btn:active {
            background: #f0f0f0;
        }
        
        /* 多选模式下聊天容器需要留出顶部空间 */
        .multi-select-mode-active #chat-page .content {
            padding-top: 104px; /* 为顶部工具栏和搜索框留空间 */
        }
        
        /* 底部操作栏（完全仿微信 - 图标版）*/
        .multi-select-toolbar {
            position: fixed;
            bottom: 0;
            left: 0;
            right: 0;
            height: 60px;
            background: #F7F7F7;
            border-top: 0.5px solid #d9d9d9;
            display: none;
            flex-direction: row;
            justify-content: space-around;
            align-items: center;
            z-index: 2000;
            padding: 0 20px;
        }
        
        .multi-select-toolbar.active {
            display: flex;
        }
        
        .multi-select-toolbar-btn {
            flex: 1;
            height: 100%;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            background: none;
            border: none;
            cursor: pointer;
            font-size: 26px;
            color: #000;
            transition: opacity 0.2s;
            gap: 2px;
        }
        
        .multi-select-toolbar-btn:active {
            opacity: 0.5;
        }
        
        .multi-select-toolbar-btn.disabled {
            opacity: 0.3;
            pointer-events: none;
        }
        
        .multi-select-toolbar-icon {
            display: flex;
            align-items: center;
            justify-content: center;
            margin-bottom: 2px;
        }
        
        .multi-select-toolbar-text {
            font-size: 10px;
            color: #000;
            line-height: 1;
        }
        
        /* ========== 收藏页面样式 ========== */
        .favorite-item {
            background: white;
            margin-bottom: 10px;
            padding: 12px 16px;
            border-radius: 6px;
            box-shadow: 0 1px 3px rgba(0,0,0,0.1);
        }
        
        .favorite-header {
            display: flex;
            align-items: center;
            justify-content: space-between;
            margin-bottom: 8px;
        }
        
        .favorite-sender {
            font-size: 14px;
            font-weight: 500;
            color: #333;
        }
        
        .favorite-time {
            font-size: 12px;
            color: #999;
        }
        
        .favorite-content {
            font-size: 15px;
            color: #333;
            line-height: 1.5;
            word-wrap: break-word;
        }
        
        .favorite-actions {
            display: flex;
            justify-content: flex-end;
            gap: 12px;
            margin-top: 12px;
            padding-top: 12px;
            border-top: 1px solid #f0f0f0;
        }
        
        .favorite-action-btn {
            font-size: 13px;
            color: #576b95;
            background: none;
            border: none;
            cursor: pointer;
            padding: 4px 8px;
        }
        
        .favorite-action-btn:hover {
            opacity: 0.7;
        }
        
        .favorite-action-btn.delete {
            color: #ff3b30;
        }
        
        /* ========== 转发选择列表样式 ========== */
        .forward-character-item {
            background: white;
            display: flex;
            align-items: center;
            padding: 12px 16px;
            border-bottom: 1px solid #EDEDED;
            cursor: pointer;
            transition: background 0.2s;
        }
        
        .forward-character-item:hover {
            background: #f5f5f5;
        }
        
        .forward-character-item:active {
            background: #e8e8e8;
        }
        
        .forward-character-avatar {
            width: 48px;
            height: 48px;
            border-radius: 6px;
            margin-right: 12px;
            flex-shrink: 0;
        }
        
        .forward-character-info {
            flex: 1;
            min-width: 0;
        }
        
        .forward-character-name {
            font-size: 16px;
            font-weight: 500;
            color: #333;
            margin-bottom: 4px;
        }
        
        .forward-character-desc {
            font-size: 13px;
            color: #999;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap;
        }
        
        /* 批量生成对话框 */
        .batch-generate-dialog {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10004;
        }
        
        .batch-generate-content {
            background: white;
            border-radius: 12px;
            width: 90%;
            max-width: 600px;
            max-height: 85vh;
            display: flex;
            flex-direction: column;
            box-shadow: 0 8px 32px rgba(0,0,0,0.3);
        }
        
        .batch-generate-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 20px;
            border-bottom: 1px solid #e0e0e0;
        }
        
        .batch-generate-header h3 {
            margin: 0;
            font-size: 18px;
            color: #333;
        }
        
        .batch-generate-close {
            background: none;
            border: none;
            font-size: 28px;
            color: #999;
            cursor: pointer;
            padding: 0;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
        }
        
        .batch-generate-close:hover {
            background: #f0f0f0;
            color: #333;
        }
        
        .batch-generate-body {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
        }
        
        .batch-generate-footer {
            display: flex;
            gap: 12px;
            padding: 16px 20px;
            border-top: 1px solid #e0e0e0;
            justify-content: flex-end;
        }
        
        /* 单选按钮样式增强 */
        input[type="radio"]:checked + div {
            color: #4CAF50;
        }
        
        label:has(input[type="radio"]:checked) {
            border-color: #4CAF50 !important;
            background-color: #f1f8f4;
        }
        
        /* 导入和批量生成模式选择对话框的按钮悬停效果 */
        #import-mode-dialog button:not(.batch-generate-close):hover,
        #batch-mode-dialog button:not(.batch-generate-close):hover {
            transform: translateY(-2px);
            box-shadow: 0 4px 12px rgba(0,0,0,0.15);
        }
        
        #import-mode-dialog button:not(.batch-generate-close):active,
        #batch-mode-dialog button:not(.batch-generate-close):active {
            transform: translateY(0);
        }
        
        /* 导入记忆对话框 */
        .import-memory-dialog {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10005;
        }
        
        .import-memory-content {
            background: white;
            border-radius: 12px;
            width: 90%;
            max-width: 550px;
            max-height: 80vh;
            display: flex;
            flex-direction: column;
            box-shadow: 0 8px 32px rgba(0,0,0,0.3);
        }
        
        .import-memory-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 20px;
            border-bottom: 1px solid #e0e0e0;
        }
        
        .import-memory-header h3 {
            margin: 0;
            font-size: 18px;
            color: #333;
        }
        
        .import-memory-close {
            background: none;
            border: none;
            font-size: 28px;
            color: #999;
            cursor: pointer;
            padding: 0;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
        }
        
        .import-memory-close:hover {
            background: #f0f0f0;
            color: #333;
        }
        
        .import-memory-body {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
        }
        
        .import-memory-footer {
            display: flex;
            gap: 12px;
            padding: 16px 20px;
            border-top: 1px solid #e0e0e0;
            justify-content: flex-end;
        }
        
        /* 记忆编辑模态窗口 */
        .memory-edit-modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.5);
            display: flex;
            align-items: center;
            justify-content: center;
            z-index: 10003;
        }
        
        .memory-edit-content {
            background: white;
            border-radius: 12px;
            width: 90%;
            max-width: 600px;
            max-height: 80vh;
            display: flex;
            flex-direction: column;
            box-shadow: 0 8px 32px rgba(0,0,0,0.3);
        }
        
        .memory-edit-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 16px 20px;
            border-bottom: 1px solid #e0e0e0;
        }
        
        .memory-edit-header h3 {
            margin: 0;
            font-size: 18px;
            color: #333;
        }
        
        .memory-edit-close {
            background: none;
            border: none;
            font-size: 28px;
            color: #999;
            cursor: pointer;
            padding: 0;
            width: 32px;
            height: 32px;
            display: flex;
            align-items: center;
            justify-content: center;
            border-radius: 4px;
        }
        
        .memory-edit-close:hover {
            background: #f0f0f0;
            color: #333;
        }
        
        .memory-edit-body {
            flex: 1;
            overflow-y: auto;
            padding: 20px;
        }
        
        .memory-section {
            margin-bottom: 24px;
        }
        
        .memory-section h4 {
            margin: 0 0 12px 0;
            font-size: 16px;
            color: #555;
            border-bottom: 2px solid #e0e0e0;
            padding-bottom: 6px;
        }
        
        .memory-section textarea {
            width: 100%;
            padding: 10px;
            border: 1px solid #ddd;
            border-radius: 6px;
            font-size: 14px;
            resize: vertical;
            box-sizing: border-box;
            font-family: inherit;
        }
        
        .basic-info-item {
            display: flex;
            align-items: center;
            margin-bottom: 8px;
            gap: 8px;
        }
        
        .basic-info-item label {
            min-width: 80px;
            font-size: 14px;
            color: #666;
        }
        
        .basic-info-item input {
            flex: 1;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
        }
        
        .event-item {
            background: #f9f9f9;
            border: 1px solid #e0e0e0;
            border-radius: 8px;
            padding: 12px;
            margin-bottom: 12px;
        }
        
        .event-item-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            margin-bottom: 8px;
        }
        
        .event-item-date {
            font-size: 12px;
            color: #999;
        }
        
        .event-item-importance {
            display: flex;
            align-items: center;
            gap: 5px;
        }
        
        .event-item-importance label {
            font-size: 12px;
            color: #666;
        }
        
        .event-item-importance input {
            width: 60px;
            padding: 4px;
            border: 1px solid #ddd;
            border-radius: 4px;
        }
        
        .event-item-delete {
            background: #ff4444;
            color: white;
            border: none;
            padding: 4px 8px;
            border-radius: 4px;
            cursor: pointer;
            font-size: 12px;
        }
        
        .event-item textarea {
            width: 100%;
            padding: 8px;
            border: 1px solid #ddd;
            border-radius: 4px;
            font-size: 14px;
            resize: vertical;
            box-sizing: border-box;
            font-family: inherit;
        }
        
        .memory-edit-footer {
            display: flex;
            gap: 12px;
            padding: 16px 20px;
            border-top: 1px solid #e0e0e0;
            justify-content: flex-end;
        }
        
        /* 确认对话框 */
        .confirm-dialog {
            position: fixed;
            top: 50%;
            left: 50%;
            transform: translate(-50%, -50%);
            background: white;
            border-radius: 12px;
            padding: 0;
            max-width: 280px;
            width: 85%;
            box-shadow: 0 4px 20px rgba(0,0,0,0.15);
            z-index: 10002;
            display: none;
            overflow: hidden;
        }
        
        .confirm-dialog.active {
            display: block;
        }
        
        .confirm-dialog-title {
            font-size: 17px;
            font-weight: 500;
            padding: 20px 20px 0 20px;
            color: #000;
            text-align: center;
        }
        
        .confirm-dialog-message {
            font-size: 14px;
            color: #666;
            padding: 12px 20px 20px 20px;
            line-height: 1.6;
            text-align: center;
        }
        
        .confirm-dialog-buttons {
            display: flex;
            flex-direction: column;
            border-top: 0.5px solid #e0e0e0;
        }
        
        .confirm-dialog-button {
            width: 100%;
            padding: 14px 16px;
            border: none;
            border-bottom: 0.5px solid #e0e0e0;
            background: white;
            font-size: 16px;
            cursor: pointer;
            transition: background 0.2s;
            text-align: center;
        }
        
        .confirm-dialog-button:last-child {
            border-bottom: none;
        }
        
        .confirm-dialog-button:active {
            background: #f5f5f5;
        }
        
        .confirm-dialog-button.primary {
            color: #576b95;
            font-weight: 500;
        }
        
        .confirm-dialog-button.secondary {
            color: #576b95;
        }
        
        .confirm-dialog-button.cancel {
            color: #000;
        }
        
        /* ========== 编辑模式样式 ========== */
        .bubble.editing {
            background: #fff3cd !important;
            border: 2px solid #ffc107 !important;
            position: relative;
        }
        
        .edit-textarea {
            width: 100%;
            min-height: 60px;
            padding: 8px;
            border: 1px solid #ccc;
            border-radius: 4px;
            font-size: 15px;
            font-family: inherit;
            line-height: 1.4;
            resize: vertical;
            box-sizing: border-box;
            margin-bottom: 8px;
        }
        
        .edit-buttons {
            display: flex;
            gap: 8px;
            justify-content: flex-end;
        }
        
        .edit-btn {
            padding: 8px 16px;
            border: none;
            border-radius: 6px;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.2s;
        }
        
        .edit-btn.save {
            background: #1AAD19;
            color: white;
        }
        
        .edit-btn.save:hover {
            background: #178f15;
        }
        
        .edit-btn.cancel {
            background: #f0f0f0;
            color: #333;
        }
        
        .edit-btn.cancel:hover {
            background: #e0e0e0;
        }
        
        /* ========== 引用样式 ========== */
        /* 输入框下方的引用预览 (微信风格) */
        .quote-reference {
            background: #e0e0e0; /* 更深的灰色背景 */
            padding: 8px 12px;
            border-radius: 4px;
            font-size: 12px; /* 小字 */
            color: #666; /* 深一点的文字颜色 */
            display: flex;
            align-items: center;
            gap: 8px;
            margin-top: 8px; /* 在输入框下方留间距 */
        }
        
        .quote-reference .quote-content {
            flex-grow: 1;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap; /* 单行显示 */
            line-height: 1.4;
        }
        
        .quote-reference .quote-close {
            flex-shrink: 0;
            cursor: pointer;
            font-size: 20px;
            color: #666;
            line-height: 1;
            padding: 0 4px;
            font-weight: bold;
        }
        
        .quote-reference .quote-close:hover {
            color: #333;
        }
        
        /* 消息气泡内的引用样式 (微信风格) */
        .quoted-message {
            background: rgba(0, 0, 0, 0.05); /* 略深的半透明背景 */
            padding: 6px 8px;
            margin-top: 8px; /* 在正文下方留间距 */
            margin-bottom: 0;
            border-radius: 4px;
            font-size: 11px;
            color: #999; /* 灰色 */
            line-height: 1.3;
            width: fit-content;
            max-width: 100%;
            box-sizing: border-box;
            overflow: hidden;
            text-overflow: ellipsis;
            white-space: nowrap; /* 单行显示 */
            order: 10; /* 确保在气泡后面 */
        }
        
        .quoted-message .quote-sender {
            font-weight: normal;
            color: #999;
            margin-right: 0;
        }
        
        /* 用户和AI的引用样式统一 */
        .message.user .quoted-message,
        .message.assistant .quoted-message {
            background: rgba(0, 0, 0, 0.05);
        }

        /* ==================== 登录弹窗样式 ==================== */
        /* ── 登录/注册弹窗 ── */
        .login-modal {
            display: none;
            position: fixed;
            inset: 0;
            background: rgba(0,0,0,0.55);
            backdrop-filter: blur(6px);
            z-index: 10000;
            justify-content: center;
            align-items: center;
        }
        .login-modal.active { display: flex; }

        .login-box {
            background: #fff;
            border-radius: 20px;
            width: 90%;
            max-width: 360px;
            padding: 32px 28px 28px;
            box-shadow: 0 20px 60px rgba(0,0,0,0.2);
            animation: loginBoxIn .25s cubic-bezier(.34,1.56,.64,1);
        }
        @keyframes loginBoxIn {
            from { opacity:0; transform:scale(.92) translateY(12px); }
            to   { opacity:1; transform:scale(1)  translateY(0); }
        }

        .login-logo {
            display: flex;
            align-items: center;
            justify-content: center;
            gap: 10px;
            margin-bottom: 24px;
        }
        .login-logo-icon { font-size: 28px; }
        .login-logo-name { font-size: 20px; font-weight: 700; color: #111; letter-spacing: -0.3px; }

        .login-tabs {
            display: flex;
            position: relative;
            background: #f2f2f2;
            border-radius: 10px;
            padding: 3px;
            margin-bottom: 20px;
        }
        .login-tab {
            flex: 1;
            padding: 8px;
            border: none;
            background: none;
            border-radius: 8px;
            font-size: 14px;
            font-weight: 600;
            color: #888;
            cursor: pointer;
            position: relative;
            z-index: 1;
            transition: color .2s;
        }
        .login-tab.active { color: #111; }
        .login-tab-indicator {
            position: absolute;
            top: 3px; bottom: 3px; left: 3px;
            width: calc(50% - 3px);
            background: #fff;
            border-radius: 7px;
            box-shadow: 0 1px 4px rgba(0,0,0,.12);
            transition: transform .22s cubic-bezier(.4,0,.2,1);
        }
        .login-tab-indicator.right { transform: translateX(100%); }

        .login-box input {
            width: 100%;
            padding: 11px 14px;
            margin-bottom: 12px;
            border: 1.5px solid #e8e8e8;
            border-radius: 10px;
            font-size: 15px;
            box-sizing: border-box;
            outline: none;
            transition: border-color .15s;
            color: #111;
        }
        .login-box input:focus { border-color: #07c160; }

        .login-btn {
            width: 100%;
            padding: 13px;
            background: #07c160;
            color: #fff;
            border: none;
            border-radius: 10px;
            font-size: 16px;
            font-weight: 600;
            cursor: pointer;
            margin-top: 4px;
            transition: background .15s, transform .1s;
        }
        .login-btn:hover  { background: #06ad56; }
        .login-btn:active { transform: scale(.98); }

        .login-field-hint {
            font-size: 12px;
            margin: -8px 0 10px 2px;
            min-height: 16px;
            transition: color .2s;
        }
        .login-field-hint.ok  { color: #07c160; }
        .login-field-hint.err { color: #ff4d4f; }

        .login-strength-wrap {
            display: flex;
            align-items: center;
            gap: 8px;
            margin: -6px 0 12px;
        }
        .login-strength-bar {
            flex: 1;
            height: 4px;
            background: #eee;
            border-radius: 4px;
            overflow: hidden;
        }
        .login-strength-fill {
            height: 100%;
            border-radius: 4px;
            width: 0;
            transition: width .3s, background .3s;
        }
        .login-strength-label { font-size: 11px; color: #aaa; width: 32px; flex-shrink:0; }

        .login-error {
            color: #ff4d4f;
            font-size: 13px;
            margin-bottom: 10px;
            min-height: 18px;
            font-weight: 500;
            margin-bottom: 10px;
            text-align: center;
            display: none;
        }

        .login-error.show {
            display: block;
        }

        /* 加载中遮罩 */
        .loading-overlay {
            display: none;
            position: fixed;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: rgba(0, 0, 0, 0.5);
            z-index: 9999;
            justify-content: center;
            align-items: center;
        }

        .loading-overlay.active {
            display: flex;
        }

        .loading-spinner {
            color: white;
            font-size: 20px;
        }

/* ─── Toggle Switch ─────────────────────────────────────────── */
.toggle-switch {
    position: relative;
    display: inline-block;
    width: 48px;
    height: 26px;
    flex-shrink: 0;
}
.toggle-switch input {
    opacity: 0;
    width: 0;
    height: 0;
}
.toggle-slider {
    position: absolute;
    cursor: pointer;
    inset: 0;
    background-color: #ccc;
    border-radius: 26px;
    transition: background-color 0.3s;
}
.toggle-slider:before {
    content: '';
    position: absolute;
    height: 20px;
    width: 20px;
    left: 3px;
    bottom: 3px;
    background-color: white;
    border-radius: 50%;
    transition: transform 0.3s;
}
.toggle-switch input:checked + .toggle-slider {
    background-color: #4CAF50;
}
.toggle-switch input:checked + .toggle-slider:before {
    transform: translateX(22px);
}

/* ─── Paywall Modal ─────────────────────────────────────────── */
.modal-overlay {
    display: none;
    position: fixed;
    inset: 0;
    background: rgba(0, 0, 0, 0.5);
    z-index: 9999;
    align-items: center;
    justify-content: center;
}
.modal-overlay.active {
    display: flex;
}
.modal-box {
    background: white;
    border-radius: 16px;
    padding: 28px 24px;
    max-width: 320px;
    width: 90%;
    text-align: center;
}
.modal-box h3 {
    margin: 0 0 12px;
    font-size: 18px;
    color: #333;
}
.modal-box p {
    margin: 0 0 20px;
    font-size: 14px;
    color: #666;
    line-height: 1.6;
}
.btn-primary {
    width: 100%;
    padding: 12px;
    background: #4CAF50;
    color: white;
    border: none;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
}
.btn-secondary {
    padding: 12px;
    background: #f5f5f5;
    color: #555;
    border: 1px solid #e0e0e0;
    border-radius: 8px;
    font-size: 15px;
    cursor: pointer;
}
.sys-logout-btn {
    display: block;
    width: 100%;
    padding: 14px;
    background: white;
    color: #ff4d4f;
    border: none;
    border-radius: 14px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.sys-logout-btn:active { opacity: 0.8; }

/* ─── System Settings Layout ────────────────────────────────── */
.sys-settings-content {
    padding: 14px 14px 32px;
    background: #f0f0f0;
    overflow-y: auto;
}
.sys-card {
    background: white;
    border-radius: 14px;
    padding: 18px;
    margin-bottom: 12px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* Account card */
.sys-account-row {
    display: flex;
    align-items: center;
    gap: 14px;
}
.sys-avatar {
    width: 52px;
    height: 52px;
    border-radius: 50%;
    background: linear-gradient(135deg, #07c160, #06ae56);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
    color: white;
    font-weight: 700;
    overflow: hidden;
    flex-shrink: 0;
}
.sys-account-info {
    flex: 1;
    min-width: 0;
}
.sys-account-name {
    font-size: 16px;
    font-weight: 600;
    color: #111;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}
.sys-account-badge {
    display: inline-block;
    margin-top: 5px;
    padding: 2px 10px;
    border-radius: 12px;
    font-size: 12px;
    font-weight: 500;
}
.sys-account-badge.free    { background: #e8f5e9; color: #2e7d32; }
.sys-account-badge.paid    { background: #fff8e1; color: #e65100; }
.sys-account-badge.privacy { background: #e3f2fd; color: #1565c0; }
.sys-btn-recharge {
    background: linear-gradient(135deg, #07c160, #06ae56);
    color: white;
    border: none;
    border-radius: 20px;
    padding: 8px 18px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    white-space: nowrap;
    flex-shrink: 0;
}

/* Check-in card */
.sys-checkin-card {
    background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
    cursor: pointer;
    overflow: hidden;
    position: relative;
    user-select: none;
}
.sys-checkin-card:active { opacity: 0.92; }
.sys-checkin-inner {
    display: flex;
    align-items: center;
    gap: 14px;
}
.sys-checkin-text {
    flex: 1;
    color: white;
}
.sys-checkin-title {
    font-size: 16px;
    font-weight: 700;
}
.sys-checkin-sub {
    font-size: 12px;
    opacity: 0.8;
    margin-top: 3px;
}
.sys-checkin-badge {
    background: rgba(255,255,255,0.22);
    color: white;
    border: 1.5px solid rgba(255,255,255,0.5);
    border-radius: 20px;
    padding: 6px 18px;
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
    flex-shrink: 0;
}
.sys-checkin-badge.done {
    background: rgba(255,255,255,0.1);
    border-color: rgba(255,255,255,0.3);
    color: rgba(255,255,255,0.65);
}

/* 签到弹窗内容 */
.ck-reward-badge {
    text-align: center;
    font-size: 36px;
    font-weight: 800;
    color: #7c3aed;
    letter-spacing: -1px;
    margin-bottom: 8px;
}
.ck-done-icon {
    text-align: center;
    font-size: 36px;
    font-weight: 800;
    color: #aaa;
    margin-bottom: 8px;
}
.ck-title {
    font-size: 18px;
    font-weight: 700;
    text-align: center;
    color: #222;
    margin-bottom: 8px;
}
.ck-desc {
    font-size: 14px;
    color: #888;
    text-align: center;
    line-height: 1.6;
}

/* Toggle row */
.sys-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 16px;
}
.sys-row-title {
    font-size: 15px;
    font-weight: 500;
    color: #222;
}
.sys-row-desc {
    font-size: 13px;
    color: #999;
    margin-top: 3px;
}

/* Toast */
.sys-toast {
    position: fixed;
    bottom: 80px;
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    background: rgba(30,30,30,0.88);
    color: white;
    padding: 11px 20px;
    border-radius: 24px;
    font-size: 13px;
    white-space: nowrap;
    z-index: 9998;
    opacity: 0;
    transition: opacity 0.3s, transform 0.3s;
    pointer-events: none;
    max-width: 88vw;
    white-space: normal;
    text-align: center;
}
.sys-toast.visible {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* ─── Onboarding Modal ──────────────────────────────────────── */
.onboarding-box {
    background: white;
    border-radius: 22px;
    padding: 32px 22px 24px;
    max-width: 340px;
    width: 92%;
    text-align: center;
}
.onboarding-icon {
    font-size: 44px;
    margin-bottom: 10px;
}
.onboarding-box h2 {
    margin: 0 0 6px;
    font-size: 22px;
    color: #111;
}
.onboarding-sub {
    margin: 0 0 22px;
    font-size: 14px;
    color: #888;
}
.onboarding-option {
    display: flex;
    align-items: center;
    gap: 14px;
    width: 100%;
    padding: 15px 16px;
    border-radius: 14px;
    border: 2px solid #e8e8e8;
    background: white;
    cursor: pointer;
    margin-bottom: 10px;
    text-align: left;
    transition: border-color 0.2s, background 0.2s, transform 0.15s;
    box-sizing: border-box;
}
.onboarding-option:active { transform: scale(0.98); }
.onboarding-option:hover  { border-color: #07c160; background: #f0fff4; }
.onboarding-option.secondary:hover { border-color: #7c3aed; background: #faf5ff; }
.onboarding-option .opt-emoji {
    font-size: 26px;
    flex-shrink: 0;
}
.onboarding-option .opt-title {
    font-size: 15px;
    font-weight: 600;
    color: #222;
}
.onboarding-option .opt-desc {
    font-size: 12px;
    color: #888;
    margin-top: 3px;
}

/* ─── Character settings: hide advanced sections for outofbox ── */
body.mode-outofbox #settings-adv-params,
body.mode-outofbox #settings-adv-ltm,
body.mode-outofbox #settings-adv-proactive {
    display: none !important;
}

/* 开袋即食模式：模型管理页仅展示平台模型，隐藏自定义供应商区域 */
body.mode-outofbox #model-mgmt-custom {
    display: none !important;
}

/* ─── 光点余额条（系统设置账户卡内）───────────────────────── */
.sys-credits-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    margin-top: 14px;
    margin-bottom: 6px;
}
.sys-credits-label {
    font-size: 12px;
    color: #999;
}
.sys-credits-amount {
    font-size: 13px;
    font-weight: 600;
    color: #444;
}
.sys-credits-bar-wrap {
    width: 100%;
    height: 8px;
    background: #f0f0f0;
    border-radius: 99px;
    overflow: hidden;
}
.sys-credits-bar-fill {
    height: 100%;
    border-radius: 99px;
    transition: width 0.6s ease;
}
.sys-credits-bar-fill.free {
    background: linear-gradient(90deg, #7c3aed, #a855f7);
}
.sys-credits-bar-fill.paid {
    background: linear-gradient(90deg, #d97706, #f59e0b);
}

/* ─── 充值页 ────────────────────────────────────────────────── */
.recharge-content {
    background: #f5f5f7;
    overflow-y: auto;
    padding: 16px;
}
.recharge-balance-card {
    background: linear-gradient(135deg, #7c3aed 0%, #6d28d9 100%);
    border-radius: 18px;
    padding: 24px 20px 20px;
    color: #fff;
    margin-bottom: 20px;
}
body.mode-outofbox .recharge-balance-card,
.recharge-balance-card.paid {
    background: linear-gradient(135deg, #d97706 0%, #b45309 100%);
}
.rbc-label {
    font-size: 13px;
    opacity: 0.85;
    margin-bottom: 6px;
}
.rbc-amount {
    font-size: 36px;
    font-weight: 700;
    letter-spacing: -1px;
    margin-bottom: 12px;
}
.rbc-unit {
    font-size: 16px;
    font-weight: 400;
    opacity: 0.8;
}
.recharge-bar-wrap {
    width: 100%;
    height: 6px;
    background: rgba(255,255,255,0.25);
    border-radius: 99px;
    overflow: hidden;
    margin-bottom: 8px;
}
.recharge-bar-fill {
    height: 100%;
    border-radius: 99px;
    background: rgba(255,255,255,0.9);
    transition: width 0.6s ease;
}
.rbc-hint {
    font-size: 11px;
    opacity: 0.75;
    margin-top: 4px;
}
.recharge-section-title {
    font-size: 13px;
    font-weight: 600;
    color: #888;
    letter-spacing: 0.5px;
    margin-bottom: 10px;
    text-transform: uppercase;
}
.recharge-grid {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 10px;
    margin-bottom: 20px;
}
.recharge-pkg {
    background: #fff;
    border: 2px solid #e8e8e8;
    border-radius: 14px;
    padding: 16px 12px;
    text-align: center;
    cursor: pointer;
    position: relative;
    transition: border-color 0.2s, box-shadow 0.2s, transform 0.15s;
}
.recharge-pkg:active { transform: scale(0.97); }
.recharge-pkg:hover  { border-color: #7c3aed; }
.recharge-pkg.selected {
    border-color: #7c3aed;
    background: #faf5ff;
    box-shadow: 0 0 0 3px rgba(124,58,237,0.15);
}
.pkg-badge {
    position: absolute;
    top: -1px;
    right: 10px;
    background: #ef4444;
    color: #fff;
    font-size: 10px;
    font-weight: 700;
    padding: 2px 7px;
    border-radius: 0 0 8px 8px;
}
.pkg-badge.best { background: #7c3aed; }
.pkg-credits {
    font-size: 28px;
    font-weight: 700;
    color: #222;
    letter-spacing: -1px;
    line-height: 1;
    margin-top: 6px;
}
.pkg-unit {
    font-size: 12px;
    color: #888;
    margin: 2px 0 4px;
}
.pkg-bonus {
    font-size: 11px;
    color: #7c3aed;
    font-weight: 600;
    margin-bottom: 8px;
}
.pkg-price {
    font-size: 17px;
    font-weight: 700;
    color: #111;
}
.recharge-pay-btn {
    width: 100%;
    padding: 15px;
    background: linear-gradient(135deg, #7c3aed, #6d28d9);
    color: #fff;
    border: none;
    border-radius: 12px;
    font-size: 16px;
    font-weight: 600;
    cursor: pointer;
    margin-bottom: 14px;
    transition: opacity 0.2s, transform 0.15s;
}
.recharge-pay-btn:active { transform: scale(0.98); opacity: 0.9; }
.recharge-note {
    font-size: 12px;
    color: #aaa;
    text-align: center;
    line-height: 1.6;
}
