           /* 消息内容行（头像+气泡+时间） */
           .message-content-row {
               display: flex;
               gap: 8px;
               align-items: flex-end;
               width: 100%;
           }

           .message-wrapper.ai .message-content-row {
               flex-direction: row;
           }

           .message-wrapper.user .message-content-row {
               flex-direction: row-reverse;
           }

           .message-bubble {
               display: flex;
               align-items: flex-start;
               gap: 12px;
               max-width: 100%;
               min-width: 0;
           }

           .timestamp {
               font-size: 11px;
               color: #999;
               text-shadow: 0 0 3px rgba(255, 255, 255, 0.6);
               white-space: nowrap;
               margin-bottom: 5px;
               flex-shrink: 0;
           }

           .message-bubble.selected::after {
               content: '✔';
               position: absolute;
               left: -10px;
               top: 50%;
               transform: translateY(-50%);
               background-color: var(--accent-color);
               color: white;
               width: 20px;
               height: 20px;
               border-radius: 50%;
               display: flex;
               align-items: center;
               justify-content: center;
               font-size: 12px;
           }

           .message-bubble.user.selected::after {
               left: auto;
               right: -10px;
           }

           .message-bubble.user {
               flex-direction: row-reverse;
           }

           #typing-indicator {
               align-self: flex-start;
               display: none;
               margin: 0 10px 10px;
               color: var(--text-secondary);
           }

           #chat-list-bottom-nav {
               position: absolute;
               bottom: 0;
               left: 0;
               width: 100%;
               z-index: 15;
               display: flex;
               border-top: 1px solid var(--border-color);
               background-color: rgba(247, 247, 247, 0.9);
               backdrop-filter: blur(10px);
               -webkit-backdrop-filter: blur(10px);
               padding-bottom: env(safe-area-inset-bottom);
           }

           #chat-input-main-row {
               display: flex;
               align-items: flex-end;
               gap: 8px;
               width: 100%;
           }

           #chat-input {
               flex-grow: 1;
               border: none;
               padding: 10px 15px;
               border-radius: 20px;
               background-color: var(--secondary-bg);
               font-size: 16px;
               height: 40px;
               resize: none;
               overflow-y: auto;
               box-sizing: border-box;
           }

           .action-button {
               border: none;
               color: white;
               border-radius: 20px;
               cursor: pointer;
               font-weight: 600;
               font-size: 14px;
               flex-shrink: 0;
           }

           #send-btn {
               background-color: var(--accent-color);
               height: 40px;
               padding: 0 15px;
           }

           .modal {
               position: absolute;
               top: 0;
               left: 0;
               width: 100%;
               height: 100%;
               background-color: rgba(0, 0, 0, 0.4);
               display: none;
               justify-content: center;
               align-items: center;
               z-index: 100;
           }

           .modal.visible {
               display: flex;
           }

           /* 导入弹窗需要高于 custom-modal-overlay(z-index:10200) */
           #import-options-modal,
           #selective-import-modal {
               z-index: 10300;
           }

           .modal-content {
               width: 90%;
               max-height: 90%;
               background-color: white;
               border-radius: 15px;
               display: flex;
               flex-direction: column;
           }

           .modal-header {
               padding: 15px;
               font-weight: 600;
               border-bottom: 1px solid var(--border-color);
               text-align: center;
               display: flex;
               justify-content: space-between;
               align-items: center;
           }

           .modal-body {
               padding: 15px;
               overflow-y: auto;
           }

           .modal-footer {
               padding: 15px;
               border-top: 1px solid var(--border-color);
               display: flex;
               justify-content: space-around;
           }

           .modal-footer button {
               width: 45%;
               padding: 12px;
               border-radius: 8px;
               border: 1px solid var(--accent-color);
               cursor: pointer;
               font-size: 16px;
           }

           .modal-footer .save {
               background-color: var(--accent-color);
               color: white;
           }

           .modal-footer .cancel {
               background-color: white;
               color: var(--accent-color);
           }

           .avatar-upload {
               display: flex;
               align-items: center;
               gap: 15px;
           }

           .avatar-upload img {
               width: 60px;
               height: 60px;
               border-radius: 50%;
               object-fit: cover;
               background-color: #eee;
           }

           .avatar-upload button {
               padding: 8px 12px;
               border: 1px solid #ccc;
               background-color: #f0f0f0;
               border-radius: 5px;
               cursor: pointer;
           }

           #open-persona-library-btn {
               font-size: 14px;
               padding: 6px 10px;
               margin-left: 0;
           }

           .avatar-upload input[type="file"] {
               display: none;
           }

           .theme-selector label {
               display: inline-flex;
               align-items: center;
               margin-right: 15px;
               margin-bottom: 5px;
               cursor: pointer;
           }

           #reset-theme-btn {
               background: none;
               border: 1px solid #ccc;
               color: #555;
               font-size: 12px;
               padding: 2px 8px;
               border-radius: 5px;
               cursor: pointer;
               margin-left: 10px;
           }

           #group-members-settings {
               display: flex;
               overflow-x: auto;
               padding-bottom: 10px;
               gap: 15px;
           }

           .member-editor {
               text-align: center;
               cursor: pointer;
           }

           .member-editor img {
               width: 50px;
               height: 50px;
               border-radius: 50%;
               object-fit: cover;
               background-color: #eee;
               margin-bottom: 5px;
           }

           .member-editor .member-name {
               font-size: 12px;
           }

           #notification-bar {
               position: absolute;
               top: 40px;
               left: 50%;
               width: 90%;
               z-index: 500;
               background-color: rgba(250, 250, 250, 0.9);
               backdrop-filter: blur(10px);
               -webkit-backdrop-filter: blur(10px);
               border-radius: 16px;
               padding: 10px;
               box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
               display: flex;
               align-items: center;
               gap: 12px;
               cursor: pointer;
               transform: translateX(-50%) translateY(-150%);
               transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1);
               visibility: hidden;
           }

           #notification-bar.visible {
               transform: translateX(-50%) translateY(0);
               visibility: visible;
           }

           #notification-avatar {
               width: 30px;
               height: 30px;
               border-radius: 50%;
               object-fit: cover;
           }

           #notification-content .name {
               font-weight: 600;
               font-size: 15px;
               color: #000;
           }

           #notification-content .message {
               font-size: 14px;
               color: #555;
               white-space: nowrap;
               overflow: hidden;
               text-overflow: ellipsis;
               max-width: 200px;
           }

           .sticker-image {
               max-width: 100px;
               max-height: 100px;
               display: block;
               object-fit: contain;
           }

           #chat-input-actions-top {
               display: flex;
               gap: 8px;
               padding: 0 5px;
           }

           .chat-action-icon-btn {
               font-size: 24px;
               padding: 0;
               width: 38px;
               height: 38px;
               line-height: 38px;
               text-align: center;
               border-radius: 50%;
               background-color: rgba(255, 255, 255, 0.5);
               color: var(--text-primary);
               backdrop-filter: blur(5px);
               -webkit-backdrop-filter: blur(5px);
               border: 1px solid rgba(0, 0, 0, 0.05);
               cursor: pointer;
               display: flex;
               justify-content: center;
               align-items: center;
           }

           /* 暂停调用按钮样式 */
           #stop-api-call-btn {
               background-color: rgba(255, 59, 48, 0.1);
               border: 1px solid rgba(255, 59, 48, 0.3);
               color: #ff3b30;
               transition: all 0.3s ease;
           }

           #stop-api-call-btn:hover {
               background-color: rgba(255, 59, 48, 0.2);
               border-color: rgba(255, 59, 48, 0.5);
           }

           #stop-api-call-btn:active {
               transform: scale(0.95);
           }

           #stop-api-call-btn.active {
               background-color: rgba(255, 59, 48, 0.3);
               animation: pulse-stop 1.5s ease-in-out infinite;
           }

           @keyframes pulse-stop {

               0%,
               100% {
                   opacity: 1;
               }

               50% {
                   opacity: 0.7;
               }
           }

           #sticker-panel {
               position: absolute;
               bottom: 0;
               left: 0;
               width: 100%;
               height: 50%;
               background-color: rgba(242, 242, 247, 0.85);
               backdrop-filter: blur(15px);
               -webkit-backdrop-filter: blur(15px);
               border-top: 1px solid var(--border-color);
               border-radius: 20px 20px 0 0;
               z-index: 200;
               display: flex;
               flex-direction: column;
               transform: translateY(100%);
               transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1);
               visibility: hidden;
           }

           #sticker-panel.visible {
               transform: translateY(0);
               visibility: visible;
           }

           #sticker-panel-header {
               padding: 10px 20px;
               display: flex;
               justify-content: space-between;
               align-items: center;
               flex-shrink: 0;
               border-bottom: 1px solid var(--border-color);
           }

           #sticker-panel-header .title {
               font-weight: 600;
           }

           #sticker-panel-header .panel-btn {
               font-size: 16px;
               padding: 5px 10px;
               cursor: pointer;
               color: var(--accent-color);
           }

           #sticker-grid {
               flex-grow: 1;
               overflow-y: auto;
               padding: 15px;
               display: grid;
               grid-template-columns: repeat(auto-fill, minmax(80px, 1fr));
               gap: 15px;
           }

           .sticker-item {
               position: relative;
               display: flex;
               flex-direction: column;
               align-items: center;
               gap: 6px;
               cursor: pointer;
           }

           .sticker-image-container {
               width: 100%;
               aspect-ratio: 1 / 1;
               background-color: white;
               border-radius: 10px;
               background-size: contain;
               background-repeat: no-repeat;
               background-position: center;
               box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
           }

           .sticker-name {
               font-size: 12px;
               color: var(--text-secondary);
               width: 100%;
               text-align: center;
               white-space: nowrap;
               overflow: hidden;
               text-overflow: ellipsis;
           }

           .sticker-item .delete-btn {
               display: none;
               position: absolute;
               top: -5px;
               right: -5px;
               width: 20px;
               height: 20px;
               background-color: #ff3b30;
               color: white;
               border-radius: 50%;
               text-align: center;
               line-height: 20px;
               font-size: 14px;
               cursor: pointer;
               border: 2px solid white;
           }

           /* 智能匹配表情包面板 */
           #smart-sticker-match-panel {
               background-color: rgba(242, 242, 247, 0.95);
               backdrop-filter: blur(10px);
               -webkit-backdrop-filter: blur(10px);
               border-top: 1px solid var(--border-color);
               border-bottom: 1px solid var(--border-color);
               padding: 10px;
               max-height: 150px;
               overflow-x: auto;
               overflow-y: hidden;
           }

           #smart-sticker-match-grid {
               display: flex;
               gap: 10px;
               align-items: center;
           }

           #smart-sticker-match-grid .sticker-item {
               flex-shrink: 0;
               width: 70px;
               display: flex;
               flex-direction: column;
               align-items: center;
               gap: 4px;
               cursor: pointer;
               transition: transform 0.2s;
           }

           #smart-sticker-match-grid .sticker-item:hover {
               transform: scale(1.1);
           }

           #smart-sticker-match-grid .sticker-image-container {
               width: 60px;
               height: 60px;
               background-color: white;
               border-radius: 8px;
               background-size: contain;
               background-repeat: no-repeat;
               background-position: center;
               box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
           }

           #smart-sticker-match-grid .sticker-name {
               font-size: 11px;
               color: var(--text-secondary);
               width: 100%;
               text-align: center;
               white-space: nowrap;
               overflow: hidden;
               text-overflow: ellipsis;
           }

           #input-actions-wrapper {
               position: static;
               display: flex;
               align-items: flex-end;
               gap: 8px;
               flex-shrink: 0;
           }

           #wait-reply-btn {
               position: static;
               bottom: auto;
               right: auto;
               width: auto;
               height: 40px;
               padding: 0 10px;
               border-radius: 20px;
               display: flex;
               align-items: center;
               justify-content: center;
               background-color: rgba(255, 255, 255, 0.6);
               backdrop-filter: blur(5px);
               -webkit-backdrop-filter: blur(5px);
               border: 1px solid rgba(0, 0, 0, 0.08);
               box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
               transition: opacity 0.2s, transform 0.1s;
               cursor: pointer;
           }

           #wait-reply-btn:hover {
               opacity: 0.8;
           }

           #wait-reply-btn:active {
               transform: scale(0.9);
           }

           #wait-reply-btn img {
               height: 22px;
               display: block;
               margin: auto;
           }

           .chat-image {
               max-width: 100%;
               border-radius: 10px;
               display: block;
           }

           .message-bubble.has-image .content {
               padding: 5px;
           }

           #custom-modal-overlay {
               position: fixed;
               top: 0;
               left: 0;
               width: 100%;
               height: 100%;
               background-color: rgba(0, 0, 0, 0.5);
               display: none;
               align-items: center;
               justify-content: center;
               z-index: 10200;
               opacity: 0;
               transition: opacity 0.2s ease-in-out;
           }

           #custom-modal-overlay.visible {
               display: flex;
               opacity: 1;
           }

           #custom-modal {
               background-color: var(--secondary-bg);
               width: 280px;
               border-radius: 14px;
               box-shadow: 0 4px 20px rgba(0, 0, 0, 0.2);
               display: flex;
               flex-direction: column;
               transform: scale(0.95);
               transition: transform 0.2s ease-in-out;
           }

           #custom-modal-overlay.visible #custom-modal {
               transform: scale(1);
           }

           .custom-modal-header {
               padding: 16px;
               font-size: 17px;
               font-weight: 600;
               text-align: center;
           }

           .custom-modal-body {
               padding: 0 16px 16px;
               text-align: center;
               font-size: 14px;
               color: #333;
               line-height: 1.5;
               max-height: 60vh;
               overflow-y: auto;
           }

           .custom-modal-body p {
               margin: 0;
               margin-bottom: 12px;
           }

           .custom-modal-body input {
               width: 100%;
               padding: 8px 12px;
               border-radius: 6px;
               border: 1px solid #ccc;
               font-size: 16px;
               box-sizing: border-box;
           }

           .custom-modal-footer {
               border-top: 1px solid #dbdbdb;
               display: flex;
           }

           .custom-modal-footer button {
               flex: 1;
               background: none;
               border: none;
               padding: 12px;
               font-size: 17px;
               cursor: pointer;
               color: var(--accent-color);
           }

           .custom-modal-footer button:first-child {
               border-right: 1px solid #dbdbdb;
               border-bottom-left-radius: 14px;
           }

           .custom-modal-footer button:last-child {
               border-bottom-right-radius: 14px;
           }

           .custom-modal-footer .confirm-btn {
               font-weight: 600;
           }

           .custom-modal-footer .confirm-btn.btn-danger {
               color: #ff3b30;
           }

           #preset-actions-modal .custom-modal-footer {
               flex-direction: column;
           }

           #preset-actions-modal .custom-modal-footer button {
               width: 100%;
               border: none;
               border-bottom: 1px solid #dbdbdb;
               padding: 14px;
               font-size: 18px;
           }

           #preset-actions-modal .custom-modal-footer button:last-child {
               border-bottom: none;
           }

           .custom-multiselect {
               position: relative;
               -webkit-user-select: none;
               user-select: none;
           }

           .select-box {
               display: flex;
               align-items: center;
               width: 100%;
               padding: 12px;
               border: 1px solid var(--border-color);
               border-radius: 8px;
               font-size: 16px;
               box-sizing: border-box;
               background-color: var(--secondary-bg);
               cursor: pointer;
           }

           .select-box .selected-options-text {
               flex-grow: 1;
               white-space: nowrap;
               overflow: hidden;
               text-overflow: ellipsis;
               color: var(--text-primary);
           }

           .select-box .arrow-down {
               margin-left: auto;
               font-size: 10px;
               color: var(--text-secondary);
               transition: transform 0.2s;
           }

           .select-box.expanded .arrow-down {
               transform: rotate(180deg);
           }

           .checkboxes-container {
               display: none;
               position: absolute;
               top: 100%;
               margin-top: 5px;
               left: 0;
               right: 0;
               max-height: 150px;
               overflow-y: auto;
               background-color: var(--secondary-bg);
               /* <-- 修改后 */
               border: 1px solid var(--border-color);
               border-radius: 8px;
               z-index: 101;
               box-shadow: 0 4px 8px rgba(0, 0, 0, 0.1);
           }

           .checkboxes-container.visible {
               display: block;
           }

           .checkboxes-container label {
               display: block;
               padding: 10px 12px;
               cursor: pointer;
               font-weight: normal;
               color: var(--text-primary);
           }

           .checkboxes-container label {
               display: block;
               padding: 12px 15px;
               cursor: pointer;
               font-weight: normal;
               color: var(--text-primary);
               font-size: 15px;
           }

           .checkboxes-container input {
               margin-right: 10px;
               vertical-align: middle;
           }

           .bg-upload-container {
               display: flex;
               align-items: center;
               gap: 10px;
               margin-top: 8px;
               flex-wrap: wrap;
           }

           .bg-preview-img {
               max-width: 120px;
               max-height: 80px;
               border-radius: 8px;
               border: 1px solid var(--border-color);
               object-fit: cover;
               display: none;
           }

           #remove-bg-btn {
               padding: 8px 12px;
               border: 1px solid #ff3b30;
               color: #ff3b30;
               background-color: var(--secondary-bg);
               border-radius: 5px;
               cursor: pointer;
               font-size: 14px;
               display: none;
           }

           .ai-generated-image {
               max-width: 180px;
               border-radius: 12px;
               display: block;
               cursor: pointer;
               transition: transform 0.2s, box-shadow 0.2s;
           }

           .ai-generated-image:hover {
               transform: scale(1.05);
               box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
           }

           /* 思维链块样式（作为系统消息类型） */
           .message-wrapper.thought-chain-wrapper {
               display: flex;
               justify-content: center;
               width: 100%;
               margin: 10px 0;
           }

           .message-bubble.is-thought-chain-block {
               background: transparent;
               border: none;
               box-shadow: none;
               padding: 0;
               max-width: 90%;
           }

           .thought-chain-details {
               cursor: pointer;
               background: rgba(0, 0, 0, 0.04);
               border-radius: 8px;
               padding: 8px 12px;
               transition: background-color 0.2s;
           }
           
           .dark-mode .thought-chain-details {
               background: rgba(255, 255, 255, 0.05);
           }
           
           .thought-chain-details:hover {
               background: rgba(0, 0, 0, 0.06);
           }
           
           .dark-mode .thought-chain-details:hover {
               background: rgba(255, 255, 255, 0.1);
           }

           .thought-chain-summary {
               font-size: 12px;
               color: var(--text-secondary);
               user-select: none;
               outline: none;
               display: flex;
               align-items: center;
               justify-content: center;
               transition: opacity 0.2s;
           }
           
           .thought-chain-summary::-webkit-details-marker {
               display: none;
           }

           .thought-chain-content {
               margin-top: 6px;
               font-size: 12px;
               color: var(--text-secondary);
               line-height: 1.4;
               padding-top: 6px;
               font-style: italic;
               opacity: 0.8;
               text-align: left;
           }
