        /* 搴曢儴杈撳叆鏍?*/
        .chat-input-bar {
            border-top: 1px solid var(--border-color);
            padding: 8px 14px 10px;
            background: var(--bg-secondary);
            flex-shrink: 0;
        }

        .chat-image-drop-overlay {
            position: absolute;
            inset: 8px;
            z-index: 150;
            display: none;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 8px;
            padding: 24px;
            border: 2px dashed #60a5fa;
            border-radius: 12px;
            color: #dbeafe;
            text-align: center;
            background: rgba(15, 23, 42, 0.92);
            box-shadow: inset 0 0 0 1px rgba(147, 197, 253, 0.2), 0 14px 36px rgba(0, 0, 0, 0.32);
            pointer-events: none;
        }

        .control-panel.is-image-dragging .chat-image-drop-overlay {
            display: flex;
        }

        .chat-image-drop-overlay i {
            color: #60a5fa;
            font-size: 34px;
        }

        .chat-image-drop-overlay strong {
            font-size: 17px;
        }

        .chat-image-drop-overlay span {
            color: #bfdbfe;
            font-size: 12px;
            line-height: 1.5;
        }

        /* 妯″瀷閫夋嫨琛岋紙杈撳叆妗嗕笂鏂癸級 */
        .input-model-row {
            display: flex;
            flex-direction: column;
            align-items: stretch;
            gap: 6px;
            margin-bottom: 6px;
        }

        .input-model-select {
            display: flex;
            align-items: center;
            gap: 6px;
            width: 100%;
            min-width: 0;
        }

        .question-context-switch {
            display: grid;
            grid-template-columns: repeat(2, minmax(0, 1fr));
            align-items: center;
            gap: 0;
            width: 100%;
            padding: 3px;
            border: 1px solid rgba(99, 102, 241, 0.35);
            border-radius: 9px;
            background: rgba(15, 23, 42, 0.62);
            box-shadow: inset 0 1px 2px rgba(0, 0, 0, 0.22);
        }

        .question-context-btn {
            border: 0;
            border-radius: 6px;
            min-height: 32px;
            padding: 0 10px;
            background: transparent;
            color: var(--text-secondary);
            font-size: 12px;
            font-weight: 600;
            line-height: 1.15;
            cursor: pointer;
            white-space: nowrap;
            transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
        }

        .question-context-btn:hover {
            background: rgba(99, 102, 241, 0.12);
            color: var(--text-primary);
        }

        .question-context-btn.selected {
            background: linear-gradient(135deg, #6366f1, #8b5cf6);
            color: #fff;
            box-shadow: 0 5px 12px rgba(99, 102, 241, 0.28);
        }

        .question-context-switch.needs-choice {
            border-color: #ef4444;
            box-shadow: 0 0 0 2px rgba(239, 68, 68, 0.16);
        }

        .input-rounds-info {
            position: absolute;
            left: 12px;
            bottom: 6px;
            font-size: 10px;
            color: var(--text-muted, #666);
            white-space: nowrap;
            pointer-events: none;
        }

        .input-rounds-info i {
            margin-right: 3px;
            color: var(--accent);
        }

        .chat-input-row {
            display: flex;
            align-items: stretch;
            gap: 8px;
        }

        /* 杈撳叆妗嗗鍣紙鍖呭惈瀛楁暟缁熻锛?*/
        .chat-input-wrapper {
            flex: 1;
            position: relative;
            min-width: 0;
        }

        .chat-input {
            width: 100%;
            padding: 10px 14px;
            padding-bottom: 26px;
            background: var(--bg-tertiary);
            border: 1px solid var(--border-color);
            border-radius: 12px;
            color: var(--text-primary);
            font-size: 14px;
            line-height: 1.5;
            resize: none;
            min-height: clamp(100px, 18vh, 200px);
            overflow-y: auto;
            transition: border-color 0.2s;
            box-sizing: border-box;
        }

        .chat-input:focus {
            outline: none;
            border-color: var(--accent);
            box-shadow: 0 0 0 2px var(--accent-glow);
        }

        .chat-input::placeholder {
            color: var(--text-muted);
        }

        .chat-input.is-login-required,
        .chat-input:disabled {
            cursor: not-allowed;
            border-color: var(--border-color);
            background: var(--bg-tertiary);
            color: var(--text-muted);
            opacity: 0.78;
        }

        .chat-input.is-login-required::placeholder,
        .chat-input:disabled::placeholder {
            color: var(--text-secondary);
            font-weight: 700;
        }

        /* 瀛楁暟缁熻锛堣緭鍏ユ鍐呭彸涓嬭锛?*/
        .chat-char-counter {
            position: absolute;
            bottom: 6px;
            right: 12px;
            font-size: 10px;
            color: var(--text-muted);
            pointer-events: none;
        }

        /* 鍙充晶鎸夐挳缁勶紙鍥剧墖 + 鍙戦€侊紝绾靛悜鎺掑垪锛?*/
        .chat-right-btns {
            display: flex;
            flex-direction: column;
            gap: 6px;
            flex-shrink: 0;
        }

        .chat-img-btn {
            width: 50px;
            height: 72px;
            border-radius: 10px;
            background: transparent;
            border: 1px solid var(--border-color);
            color: var(--text-secondary);
            cursor: pointer;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            gap: 3px;
            padding: 6px 4px;
            font-size: 16px;
            line-height: 1;
            box-sizing: border-box;
            flex-shrink: 0;
            transition: all 0.2s;
            position: relative;
        }

        .chat-img-btn-label {
            width: 2em;
            font-size: 11px;
            font-weight: 600;
            line-height: 1.15;
            text-align: center;
        }

        .chat-img-btn .img-tip {
            display: none;
            position: absolute;
            bottom: 110%;
            right: 0;
            background: rgba(30, 30, 40, 0.92);
            color: #e5e7eb;
            font-size: 11px;
            padding: 5px 10px;
            border-radius: 6px;
            white-space: nowrap;
            pointer-events: none;
            box-shadow: 0 2px 8px rgba(0, 0, 0, 0.2);
            z-index: 10;
        }

        .chat-img-btn:hover .img-tip {
            display: block;
        }

        .chat-img-btn:hover {
            border-color: var(--accent);
            color: var(--accent);
        }

        .chat-img-btn.has-images {
            background: rgba(99, 102, 241, 0.15);
            border-color: var(--accent);
            color: var(--accent);
        }

        /* 涓嶆敮鎸佸浘鐗囨椂鐨勭孩鑹叉枩鏉?*/
        .chat-img-btn.no-image-support {
            position: relative;
            opacity: 0.5;
            cursor: not-allowed;
        }

        .chat-img-btn.no-image-support::after {
            content: '';
            position: absolute;
            top: 4px;
            left: 10px;
            width: 28px;
            height: 28px;
            border: 2px solid #ef4444;
            border-radius: 50%;
            background: transparent;
        }

        .chat-img-btn.no-image-support::before {
            content: '';
            position: absolute;
            top: 6px;
            left: 24px;
            width: 2px;
            height: 24px;
            background: #ef4444;
            transform: rotate(45deg);
            z-index: 1;
        }

        .chat-send-btn {
            width: 50px;
            height: 100px;
            margin-top: auto;
            border-radius: 10px;
            background: linear-gradient(135deg, #6366f1, #8b5cf6, #a855f7, #7c3aed);
            background-size: 300% 300%;
            animation: btnGradientShift 4s ease infinite;
            color: white;
            border: none;
            cursor: pointer;
            display: flex;
            flex-direction: column;
            align-items: center;
            justify-content: center;
            font-size: 13px;
            font-weight: 600;
            flex-shrink: 0;
            transition: all 0.3s;
            line-height: 1.3;
            position: relative;
            overflow: hidden;
            box-shadow: 0 2px 12px rgba(99, 102, 241, 0.4);
        }

        .chat-send-btn::before {
            content: '';
            position: absolute;
            top: -50%;
            left: -50%;
            width: 200%;
            height: 200%;
            background: radial-gradient(ellipse at center, rgba(255, 255, 255, 0.15) 0%, transparent 70%);
            animation: btnWaveRotate 6s linear infinite;
        }

        .chat-send-btn::after {
            content: '';
            position: absolute;
            bottom: -4px;
            left: 10%;
            width: 80%;
            height: 6px;
            background: linear-gradient(90deg, transparent, rgba(139, 92, 246, 0.6), transparent);
            border-radius: 50%;
            filter: blur(4px);
            animation: btnGlowPulse 2s ease-in-out infinite;
        }

        .chat-send-btn span {
            position: relative;
            z-index: 1;
        }

        .chat-send-btn:hover {
            transform: scale(1.08);
            box-shadow: 0 4px 20px rgba(99, 102, 241, 0.6);
        }

        .chat-send-btn:disabled {
            opacity: 0.5;
            cursor: not-allowed;
            transform: none;
            animation: none;
            box-shadow: none;
        }

        .chat-send-btn:disabled::before,
        .chat-send-btn:disabled::after {
            animation: none;
        }

        @keyframes btnGradientShift {
            0% {
                background-position: 0% 50%;
            }

            50% {
                background-position: 100% 50%;
            }

            100% {
                background-position: 0% 50%;
            }
        }

        @keyframes btnWaveRotate {
            0% {
                transform: rotate(0deg);
            }

            100% {
                transform: rotate(360deg);
            }
        }

        @keyframes btnGlowPulse {

            0%,
            100% {
                opacity: 0.3;
                transform: scaleX(0.8);
            }

            50% {
                opacity: 1;
                transform: scaleX(1.2);
            }
        }

        /* 寮€鍚柊瀵硅瘽鎸夐挳锛堥厤缃爮涓級 */
        .clear-chat-btn {
            padding: 3px 10px;
            min-width: 48px;
            border-radius: 6px;
            background: transparent;
            border: 1px solid #3b82f6;
            color: #3b82f6;
            font-size: 13px;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.2s;
            flex-shrink: 0;
            display: inline-flex;
            align-items: center;
            justify-content: center;
            gap: 4px;
        }

        .clear-chat-btn:hover {
            background: #3b82f6;
            color: white;
        }

        /* 鍥剧墖棰勮锛堣緭鍏ユ爮涓婃柟锛?*/
        .chat-image-preview {
            display: flex;
            gap: 8px;
            padding: 8px 0;
            flex-wrap: wrap;
        }

        .chat-image-preview .preview-thumb {
            position: relative;
            width: 52px;
            height: 52px;
            border-radius: 8px;
            overflow: hidden;
            border: 1px solid var(--border-color);
        }

        .chat-image-preview .preview-thumb img {
            width: 100%;
            height: 100%;
            object-fit: cover;
        }

        .chat-image-preview .preview-thumb .remove-thumb {
            position: absolute;
            top: 2px;
            right: 2px;
            width: 16px;
            height: 16px;
            border-radius: 50%;
            background: rgba(239, 68, 68, 0.9);
            color: white;
            border: none;
            cursor: pointer;
            font-size: 8px;
            display: flex;
            align-items: center;
            justify-content: center;
        }

        /* ========== 寮€鍚柊瀵硅瘽纭寮圭獥锛堥粦鑹蹭富棰橈級 ========== */
        .new-chat-confirm-modal {
            position: fixed;
            top: 0;
            left: 0;
            right: 0;
            bottom: 0;
            background: rgba(0, 0, 0, 0.7);
            display: none;
            align-items: center;
            justify-content: center;
            z-index: 10000;
        }

        .new-chat-confirm-modal.show {
            display: flex;
        }

        .new-chat-confirm-content {
            background: #1a1a1a;
            border-radius: 16px;
            padding: 28px 24px 24px;
            text-align: center;
            max-width: 460px;
            width: 90%;
            box-shadow: 0 20px 60px rgba(0, 0, 0, 0.6), 0 0 0 1px rgba(255, 255, 255, 0.08);
            animation: modalSlideIn 0.3s ease;
        }

        .new-chat-confirm-icon {
            width: 56px;
            height: 56px;
            background: rgba(245, 158, 11, 0.15);
            border-radius: 50%;
            display: flex;
            align-items: center;
            justify-content: center;
            margin: 0 auto 16px;
        }

        .new-chat-confirm-icon i {
            font-size: 24px;
            color: #f59e0b;
        }

        .new-chat-confirm-content h3 {
            font-size: 18px;
            font-weight: 600;
            color: #f3f4f6;
            margin: 0 0 12px;
        }

        .new-chat-confirm-content p {
            font-size: 14px;
            color: #9ca3af;
            margin: 0 0 8px;
            line-height: 1.6;
        }

        .new-chat-confirm-content p strong {
            color: #f87171;
        }

        .new-chat-confirm-hint {
            font-size: 12px !important;
            color: #6b7280 !important;
            margin-bottom: 20px !important;
        }

        .new-chat-confirm-btns {
            display: flex;
            gap: 10px;
            justify-content: center;
        }

        .new-chat-btn-cancel {
            padding: 8px 20px;
            border-radius: 8px;
            background: #2a2a2a;
            border: 1px solid #3f3f3f;
            color: #d1d5db;
            font-size: 14px;
            cursor: pointer;
            transition: all 0.2s;
        }

        .new-chat-btn-cancel:hover {
            background: #333;
            border-color: #555;
        }

        .new-chat-btn-confirm {
            padding: 8px 20px;
            border-radius: 8px;
            background: #3b82f6;
            border: none;
            color: white;
            font-size: 14px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .new-chat-btn-confirm:hover {
            background: #2563eb;
            transform: scale(1.02);
        }

        /* ========== 鍘嗗彶瀵硅瘽鎸夐挳 ========== */
        .history-chat-btn {
            padding: 3px 10px;
            min-width: 48px;
            border-radius: 6px;
            background: transparent;
            border: 1px solid #8b5cf6;
            color: #8b5cf6;
            font-size: 13px;
            cursor: pointer;
            white-space: nowrap;
            transition: all 0.2s;
            flex-shrink: 0;
            display: flex;
            align-items: center;
            gap: 4px;
        }

        .history-chat-btn:hover {
            background: #8b5cf6;
            color: white;
        }

        /* ========== 鍘嗗彶瀵硅瘽渚ф爮 ========== */
        .chat-history-panel {
            position: absolute;
            top: 0;
            left: 0;
            width: 100%;
            height: 100%;
            background: var(--bg-primary, #0f0f0f);
            z-index: 100;
            display: none;
            flex-direction: column;
            animation: historySlideIn 0.25s ease;
        }

        .chat-history-panel.show {
            display: flex;
        }

        @keyframes historySlideIn {
            from {
                opacity: 0;
                transform: translateX(-20px);
            }

            to {
                opacity: 1;
                transform: translateX(0);
            }
        }

        .chat-history-header {
            display: flex;
            justify-content: space-between;
            align-items: center;
            padding: 12px 16px;
            border-bottom: 1px solid var(--border-color);
            font-size: 15px;
            font-weight: 600;
            color: var(--text-primary);
        }

        .chat-history-header i {
            margin-right: 6px;
            color: #8b5cf6;
        }

        .chat-history-close {
            background: none;
            border: none;
            color: var(--text-muted);
            font-size: 28px;
            cursor: pointer;
            padding: 4px 10px;
            border-radius: 6px;
            transition: all 0.2s;
            line-height: 1;
        }

        .chat-history-close:hover {
            background: var(--bg-hover);
            color: var(--text-primary);
        }

        .chat-history-list {
            flex: 1;
            overflow-y: auto;
            padding: 8px;
        }

        .chat-history-loading,
        .chat-history-empty {
            text-align: center;
            padding: 40px 20px;
            color: var(--text-muted);
            font-size: 14px;
        }

        .chat-history-empty i {
            font-size: 32px;
            display: block;
            margin-bottom: 12px;
            opacity: 0.4;
        }

        /* 瀵硅瘽缁熻淇℃伅鏍?*/
        .chat-history-stats {
            display: flex;
            justify-content: space-between;
            padding: 8px 12px;
            margin-bottom: 6px;
            background: rgba(99, 102, 241, 0.08);
            border-radius: 8px;
            font-size: 12px;
            color: var(--text-secondary);
        }

        .chat-history-stats i {
            margin-right: 4px;
        }

        /* 瀵硅瘽鍒楄〃椤?*/
        .chat-history-item {
            display: flex;
            align-items: center;
            border-radius: 8px;
            margin-bottom: 4px;
            transition: all 0.15s;
            border: 1px solid transparent;
        }

        .chat-history-item:hover {
            background: var(--bg-hover, rgba(255, 255, 255, 0.05));
            border-color: var(--border-color);
        }

        .chat-history-item.active {
            background: rgba(99, 102, 241, 0.1);
            border-color: rgba(99, 102, 241, 0.3);
        }

        .chat-history-item.favorited {
            border-left: 3px solid #f59e0b;
        }

        .chat-history-item-main {
            flex: 1;
            padding: 10px 12px;
            cursor: pointer;
            min-width: 0;
        }

        .chat-history-title {
            font-size: 13px;
            font-weight: 500;
            color: var(--text-primary);
            white-space: nowrap;
            overflow: hidden;
            text-overflow: ellipsis;
            margin-bottom: 4px;
        }

        .chat-history-meta {
            display: flex;
            flex-wrap: wrap;
            gap: 8px;
            font-size: 11px;
            color: var(--text-muted);
        }

        .chat-history-model {
            color: #8b5cf6;
        }

        .chat-history-model i {
            margin-right: 2px;
        }

        .chat-history-actions {
            display: flex;
            gap: 2px;
            padding-right: 8px;
            flex-shrink: 0;
        }

        .chat-history-fav-btn,
        .chat-history-del-btn {
            background: none;
            border: none;
            padding: 6px;
            border-radius: 6px;
            cursor: pointer;
            font-size: 13px;
            transition: all 0.2s;
            opacity: 0.4;
        }

        .chat-history-item:hover .chat-history-fav-btn,
        .chat-history-item:hover .chat-history-del-btn {
            opacity: 0.8;
        }

        .chat-history-fav-btn {
            color: #f59e0b;
        }

        .chat-history-fav-btn:hover {
            background: rgba(245, 158, 11, 0.15);
            opacity: 1 !important;
        }

        .chat-history-item.favorited .chat-history-fav-btn {
            opacity: 1;
        }

        .chat-history-del-btn {
            color: #ef4444;
        }

        .chat-history-del-btn:hover {
            background: rgba(239, 68, 68, 0.15);
            opacity: 1 !important;
        }

        /* ========== 504鎭㈠/閲嶈瘯鎸夐挳 ========== */
        .chat-error-actions {
            margin-top: 12px;
            display: flex;
            align-items: center;
            gap: 10px;
        }

        .chat-recover-btn {
            padding: 6px 14px;
            border-radius: 8px;
            background: linear-gradient(135deg, #3b82f6, #6366f1);
            border: none;
            color: white;
            font-size: 13px;
            font-weight: 500;
            cursor: pointer;
            transition: all 0.2s;
            display: flex;
            align-items: center;
            gap: 6px;
            animation: recoverPulse 2s ease-in-out infinite;
        }

        .chat-recover-btn:hover {
            transform: scale(1.05);
            box-shadow: 0 4px 16px rgba(99, 102, 241, 0.4);
        }

        @keyframes recoverPulse {

            0%,
            100% {
                box-shadow: 0 0 0 0 rgba(99, 102, 241, 0.3);
            }

            50% {
                box-shadow: 0 0 0 8px rgba(99, 102, 241, 0);
            }
        }

        .chat-recover-hint {
            font-size: 11px;
            color: var(--text-muted);
        }

        /* ========== 鍥剧墖鍗犱綅绗︼紙鍘嗗彶瀵硅瘽涓級 ========== */
        .user-images-placeholder {
            margin-top: 6px;
            padding: 4px 10px;
            background: rgba(99, 102, 241, 0.1);
            border-radius: 6px;
            font-size: 12px;
            color: var(--text-muted);
            display: flex;
            align-items: center;
            gap: 6px;
        }

        .user-images-placeholder i {
            color: var(--accent);
        }

        /* AI杩斿洖鍚庣殑淇濆瓨鎻愮ず */
        .chat-save-tip {
            text-align: center;
            padding: 8px 16px;
            margin: 8px 20px;
            background: linear-gradient(135deg, rgba(245, 158, 11, 0.1) 0%, rgba(234, 88, 12, 0.1) 100%);
            border: 1px solid rgba(245, 158, 11, 0.25);
            border-radius: 8px;
            font-size: 12px;
            color: #fbbf24;
            line-height: 1.5;
        }

        .chat-save-tip i {
            margin-right: 4px;
        }

        /* ========== AIGGB 鎿嶄綔姝ラ鎸囧紩 ========== */
        .ai-guide-focus {
            position: fixed;
            z-index: 10020;
            pointer-events: none;
            border: 2px solid #fbbf24;
            border-radius: 8px;
            box-shadow:
                0 0 0 9999px rgba(15, 23, 42, 0.66),
                0 0 0 6px rgba(251, 191, 36, 0.18),
                0 16px 42px rgba(15, 23, 42, 0.26);
            transition: left 0.22s ease, top 0.22s ease, width 0.22s ease, height 0.22s ease;
        }

        .ai-guide-popover {
            position: fixed;
            z-index: 10030;
            padding: 16px;
            color: #172033;
            background: #ffffff;
            border: 1px solid rgba(15, 23, 42, 0.12);
            border-radius: 8px;
            box-shadow: 0 18px 50px rgba(15, 23, 42, 0.32);
            line-height: 1.6;
        }

        .ai-guide-close {
            position: absolute;
            top: 8px;
            right: 10px;
            width: 28px;
            height: 28px;
            border: none;
            border-radius: 50%;
            background: transparent;
            color: #64748b;
            font-size: 22px;
            line-height: 1;
            cursor: pointer;
        }

        .ai-guide-close:hover {
            background: rgba(15, 23, 42, 0.06);
            color: #111827;
        }

        .ai-guide-kicker {
            padding-right: 28px;
            font-size: 12px;
            font-weight: 700;
            color: #7c3aed;
        }

        .ai-guide-progress {
            height: 5px;
            margin: 8px 0 12px;
            overflow: hidden;
            background: #e5e7eb;
            border-radius: 999px;
        }

        .ai-guide-progress span {
            display: block;
            height: 100%;
            background: linear-gradient(90deg, #7c3aed, #f59e0b);
            border-radius: inherit;
            transition: width 0.2s ease;
        }

        .ai-guide-popover h3 {
            margin: 0 0 8px;
            color: #0f172a;
            font-size: 17px;
            line-height: 1.35;
            letter-spacing: 0;
        }

        .ai-guide-popover p {
            margin: 0;
            color: #475569;
            font-size: 14px;
        }

        .ai-guide-actions {
            display: flex;
            flex-wrap: wrap;
            justify-content: flex-end;
            gap: 8px;
            margin-top: 14px;
        }

        .ai-guide-btn {
            min-height: 34px;
            padding: 7px 12px;
            border: 1px solid #cbd5e1;
            border-radius: 8px;
            background: #ffffff;
            color: #334155;
            font-size: 13px;
            font-weight: 700;
            cursor: pointer;
        }

        .ai-guide-btn:hover:not(:disabled) {
            border-color: #8b5cf6;
            color: #6d28d9;
        }

        .ai-guide-btn:disabled {
            cursor: not-allowed;
            opacity: 0.45;
        }

        .ai-guide-btn.primary {
            border-color: #7c3aed;
            background: #7c3aed;
            color: #ffffff;
        }

        .ai-guide-btn.primary:hover {
            border-color: #6d28d9;
            background: #6d28d9;
            color: #ffffff;
        }

        .ai-guide-btn.ghost {
            border-color: transparent;
            color: #64748b;
        }

        .ai-guide-btn.ghost:hover {
            background: #f8fafc;
            color: #334155;
        }

        @media (max-width: 640px) {
            .ai-guide-focus {
                border-radius: 6px;
            }

            .ai-guide-popover {
                padding: 14px;
            }

            .ai-guide-actions {
                justify-content: stretch;
            }

            .ai-guide-btn {
                flex: 1 1 auto;
            }
        }
