/* ===== AI ASSISTANT SYSTEM v2.0 - 液态玻璃版 ===== */
/* 明馬積分兌換系統 AI助手樣式 */

/* --- 浮動按鈕 - 70%液态玻璃 --- */
.ai-assistant-float-btn {
    position: fixed;
    bottom: 25px;
    right: 25px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(106, 17, 203, 0.4) 0%, rgba(37, 117, 252, 0.4) 100%);
    color: white;
    border: 1px solid rgba(255, 255, 255, 0.2);
    cursor: pointer;
    box-shadow: 0 8px 32px rgba(37, 117, 252, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15);
    z-index: 9998;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    animation: aiFloatPulse 2.5s ease-in-out infinite;
    backdrop-filter: blur(12px) saturate(1.8);
    -webkit-backdrop-filter: blur(12px) saturate(1.8);
    -webkit-tap-highlight-color: transparent;
}

.ai-assistant-float-btn::before {
    content: '';
    position: absolute;
    inset: 0;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(255,255,255,0.15) 0%, rgba(255,255,255,0.03) 50%, rgba(255,255,255,0) 100%);
    pointer-events: none;
}

.ai-assistant-float-btn:hover {
    transform: scale(1.12) translateY(-2px);
    box-shadow: 0 12px 40px rgba(37, 117, 252, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2);
    background: linear-gradient(135deg, rgba(106, 17, 203, 0.4) 0%, rgba(37, 117, 252, 0.4) 100%);
}

.ai-assistant-float-btn:active {
    transform: scale(0.95);
}

.ai-assistant-float-btn.dragging {
    animation: none;
    cursor: grabbing;
    transition: none;
}

@keyframes aiFloatPulse {
    0%, 100% { box-shadow: 0 8px 32px rgba(37, 117, 252, 0.15), inset 0 1px 0 rgba(255, 255, 255, 0.15); transform: translateY(0); }
    50% { box-shadow: 0 12px 40px rgba(37, 117, 252, 0.25), inset 0 1px 0 rgba(255, 255, 255, 0.2); transform: translateY(-3px); }
}

.ai-assistant-float-btn .ai-notification-badge {
    position: absolute;
    top: -2px;
    right: -2px;
    width: 18px;
    height: 18px;
    background: linear-gradient(135deg, #ff6b6b, #e74c3c);
    border-radius: 50%;
    border: 2px solid rgba(255, 255, 255, 0.4);
    font-size: 10px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
    animation: aiBadgePulse 1.5s infinite;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
    z-index: 1;
}

@keyframes aiBadgePulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.25); }
    100% { transform: scale(1); }
}

/* --- 聊天窗口 - 70%透明液态玻璃 --- */
.ai-chat-window {
    position: fixed;
    bottom: 95px;
    right: 25px;
    width: 420px;
    max-width: calc(100vw - 50px);
    height: 600px;
    max-height: calc(100vh - 130px);
    background: rgba(255, 255, 255, 0.4);
    backdrop-filter: blur(20px) saturate(1.5);
    -webkit-backdrop-filter: blur(20px) saturate(1.5);
    border-radius: 24px;
    border: 1px solid rgba(255, 255, 255, 0.25);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.05), 0 0 0 1px rgba(255,255,255,0.08) inset;
    z-index: 9997;
    display: none;
    flex-direction: column;
    overflow: hidden;
    transition: all 0.35s cubic-bezier(0.34, 1.56, 0.64, 1);
}

.theme-dark .ai-chat-window {
    background: rgba(25, 25, 35, 0.4);
    border-color: rgba(255, 255, 255, 0.08);
    box-shadow: 0 25px 50px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(255,255,255,0.05) inset;
}

.ai-chat-window.active {
    display: flex;
    animation: aiSlideUp 0.35s cubic-bezier(0.34, 1.56, 0.64, 1) forwards;
}

@keyframes aiSlideUp {
    from { opacity: 0; transform: translateY(30px) scale(0.92); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* --- 聊天頭部 - 液态玻璃 --- */
.ai-chat-header {
    padding: 16px 20px;
    background: linear-gradient(135deg, rgba(106, 17, 203, 0.4) 0%, rgba(37, 117, 252, 0.4) 100%);
    color: white;
    display: flex;
    align-items: center;
    justify-content: space-between;
    cursor: grab;
    user-select: none;
    backdrop-filter: blur(16px) saturate(1.5);
    -webkit-backdrop-filter: blur(16px) saturate(1.5);
    border-bottom: 1px solid rgba(255, 255, 255, 0.08);
    position: relative;
    overflow: hidden;
}

.ai-chat-header::before {
    content: '';
    position: absolute;
    top: 0; left: 0; right: 0;
    height: 50%;
    background: linear-gradient(180deg, rgba(255,255,255,0.08) 0%, rgba(255,255,255,0) 100%);
    pointer-events: none;
    border-radius: 24px 24px 0 0;
}

.ai-chat-header:active {
    cursor: grabbing;
}

.ai-chat-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
    position: relative;
    z-index: 1;
}

.ai-chat-header-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.05);
}

.ai-chat-header-title {
    font-weight: 600;
    font-size: 15px;
    text-shadow: 0 1px 2px rgba(0,0,0,0.05);
}

.ai-chat-header-status {
    font-size: 11px;
    opacity: 0.85;
    display: flex;
    align-items: center;
    gap: 5px;
}

.ai-status-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #2ecc71;
    box-shadow: 0 0 6px #2ecc71;
    animation: aiStatusBlink 2s infinite;
}

@keyframes aiStatusBlink {
    0%, 100% { opacity: 1; box-shadow: 0 0 6px #2ecc71; }
    50% { opacity: 0.5; box-shadow: 0 0 2px #2ecc71; }
}

.ai-chat-header-actions {
    display: flex;
    gap: 8px;
    position: relative;
    z-index: 1;
}

.ai-chat-header-btn {
    background: rgba(255, 255, 255, 0.08);
    border: 1px solid rgba(255, 255, 255, 0.08);
    color: white;
    width: 32px;
    height: 32px;
    border-radius: 10px;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ai-chat-header-btn:hover {
    background: rgba(255, 255, 255, 0.15);
    transform: translateY(-1px);
}

/* --- 消息區域 --- */
.ai-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: rgba(255, 255, 255, 0.03);
}

.theme-dark .ai-chat-messages {
    background: rgba(0, 0, 0, 0.03);
}

.ai-message {
    max-width: 88%;
    padding: 11px 15px;
    border-radius: 18px;
    font-size: 13.5px;
    line-height: 1.6;
    word-wrap: break-word;
    animation: aiMessageIn 0.35s ease;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
    border: 1px solid rgba(255,255,255,0.05);
}

@keyframes aiMessageIn {
    from { opacity: 0; transform: translateY(12px) scale(0.95); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

.ai-message-user {
    align-self: flex-end;
    background: linear-gradient(135deg, rgba(37, 117, 252, 0.4) 0%, rgba(106, 17, 203, 0.4) 100%);
    color: white;
    border-bottom-right-radius: 4px;
    border: 1px solid rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ai-message-ai {
    align-self: flex-start;
    background: rgba(240, 242, 245, 0.4);
    color: var(--text-primary, #333);
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255,255,255,0.2);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.theme-dark .ai-message-ai {
    background: rgba(45, 45, 55, 0.4);
    color: #f0f0f0;
    border: 1px solid rgba(255,255,255,0.05);
}

.ai-message-time {
    font-size: 10px;
    opacity: 0.55;
    margin-top: 5px;
    text-align: right;
}

.ai-message-actions {
    display: flex;
    gap: 6px;
    margin-top: 6px;
    justify-content: flex-end;
}

.ai-message-action-btn {
    background: rgba(255,255,255,0.08);
    border: none;
    cursor: pointer;
    font-size: 12px;
    opacity: 0.5;
    transition: all 0.2s;
    padding: 3px 7px;
    border-radius: 6px;
    backdrop-filter: blur(4px);
}

.ai-message-action-btn:hover {
    opacity: 1;
    background: rgba(255,255,255,0.15);
    transform: scale(1.1);
}

/* --- 輸入區域 - 液态玻璃 --- */
.ai-chat-input-area {
    padding: 12px 16px;
    border-top: 1px solid rgba(255,255,255,0.08);
    display: flex;
    gap: 10px;
    align-items: flex-end;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
}

.theme-dark .ai-chat-input-area {
    background: rgba(30, 30, 40, 0.15);
    border-top: 1px solid rgba(255,255,255,0.05);
}

.ai-chat-input {
    flex: 1;
    border: 1px solid rgba(255,255,255,0.15);
    border-radius: 22px;
    padding: 11px 16px;
    font-size: 13.5px;
    background: rgba(255, 255, 255, 0.2);
    color: var(--text-primary, #333);
    resize: none;
    outline: none;
    max-height: 100px;
    min-height: 44px;
    font-family: inherit;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s;
    box-shadow: 0 2px 8px rgba(0,0,0,0.03) inset;
}

.ai-chat-input:focus {
    border-color: rgba(37, 117, 252, 0.3);
    background: rgba(255, 255, 255, 0.3);
    box-shadow: 0 0 0 3px rgba(37, 117, 252, 0.08), 0 2px 8px rgba(0,0,0,0.03) inset;
}

.theme-dark .ai-chat-input {
    background: rgba(40, 40, 50, 0.2);
    color: #f0f0f0;
    border-color: rgba(255,255,255,0.05);
}

.theme-dark .ai-chat-input:focus {
    background: rgba(40, 40, 50, 0.3);
    border-color: rgba(37, 117, 252, 0.25);
}

.ai-chat-send-btn {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    background: linear-gradient(135deg, rgba(37, 117, 252, 0.4) 0%, rgba(106, 17, 203, 0.4) 100%);
    color: white;
    border: 1px solid rgba(255,255,255,0.15);
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s cubic-bezier(0.34, 1.56, 0.64, 1);
    flex-shrink: 0;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 4px 12px rgba(37, 117, 252, 0.15);
}

.ai-chat-send-btn:hover {
    transform: scale(1.1) translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 117, 252, 0.2);
}

.ai-chat-send-btn:active {
    transform: scale(0.95);
}

.ai-chat-send-btn:disabled {
    opacity: 0.4;
    cursor: not-allowed;
    transform: none;
}

/* --- 快速操作 - 液态玻璃胶囊 --- */
.ai-quick-actions {
    display: flex;
    gap: 8px;
    padding: 0 16px 12px;
    flex-wrap: wrap;
    background: rgba(255,255,255,0.08);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ai-quick-btn {
    padding: 7px 14px;
    border-radius: 20px;
    border: 1px solid rgba(37, 117, 252, 0.15);
    background: rgba(37, 117, 252, 0.05);
    color: var(--primary, #2575fc);
    font-size: 12px;
    cursor: pointer;
    transition: all 0.25s;
    white-space: nowrap;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    font-weight: 500;
}

.ai-quick-btn:hover {
    background: rgba(37, 117, 252, 0.08);
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(37, 117, 252, 0.08);
    border-color: rgba(37, 117, 252, 0.2);
}

/* --- 打字指示器 - 液态玻璃 --- */
.ai-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    align-self: flex-start;
    background: rgba(240, 242, 245, 0.4);
    border-radius: 18px;
    border-bottom-left-radius: 4px;
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.theme-dark .ai-typing-indicator {
    background: rgba(45, 45, 55, 0.4);
    border: 1px solid rgba(255,255,255,0.05);
}

.ai-typing-indicator span {
    width: 8px;
    height: 8px;
    background: linear-gradient(135deg, #2575fc, #6a11cb);
    border-radius: 50%;
    animation: aiTypingBounce 1.4s infinite ease-in-out both;
    box-shadow: 0 0 4px rgba(37, 117, 252, 0.2);
}

.ai-typing-indicator span:nth-child(1) { animation-delay: -0.32s; }
.ai-typing-indicator span:nth-child(2) { animation-delay: -0.16s; }

@keyframes aiTypingBounce {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* --- 保護模式遮罩 - 增强液态玻璃 --- */
.ai-protect-overlay {
    position: absolute;
    top: 0; left: 0; right: 0; bottom: 0;
    background: rgba(0, 0, 0, 0.3);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 10;
    border-radius: 24px;
    flex-direction: column;
    padding: 24px;
    text-align: center;
    backdrop-filter: blur(16px);
    -webkit-backdrop-filter: blur(16px);
}

.ai-protect-overlay i {
    font-size: 52px;
    color: #f39c12;
    margin-bottom: 15px;
    text-shadow: 0 0 20px rgba(243, 156, 18, 0.2);
}

.ai-protect-overlay h4 {
    color: white;
    margin-bottom: 10px;
    font-size: 18px;
    text-shadow: 0 2px 4px rgba(0,0,0,0.15);
}

.ai-protect-overlay p {
    color: rgba(255,255,255,0.4);
    font-size: 13px;
    margin-bottom: 18px;
}

.ai-protect-overlay input {
    width: 100%;
    max-width: 220px;
    padding: 12px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: rgba(255,255,255,0.05);
    color: white;
    text-align: center;
    margin-bottom: 12px;
    outline: none;
    font-size: 14px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s;
}

.ai-protect-overlay input:focus {
    border-color: rgba(255,255,255,0.2);
    background: rgba(255,255,255,0.08);
    box-shadow: 0 0 0 3px rgba(37, 117, 252, 0.08);
}

.ai-protect-overlay input::placeholder {
    color: rgba(255,255,255,0.25);
}

.ai-protect-overlay button {
    padding: 10px 24px;
    border-radius: 12px;
    border: 1px solid rgba(255,255,255,0.08);
    background: linear-gradient(135deg, rgba(37, 117, 252, 0.4) 0%, rgba(106, 17, 203, 0.4) 100%);
    color: white;
    cursor: pointer;
    font-weight: 600;
    font-size: 14px;
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s;
    box-shadow: 0 4px 12px rgba(37, 117, 252, 0.15);
}

.ai-protect-overlay button:hover {
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(37, 117, 252, 0.2);
}

/* --- AI設置模態框 --- */
.ai-settings-modal .modal-content {
    max-width: 500px;
}

.ai-settings-tabs {
    display: flex;
    gap: 5px;
    margin-bottom: 15px;
    border-bottom: 1px solid var(--glass-border, rgba(0,0,0,0.05));
    padding-bottom: 10px;
}

.ai-settings-tab {
    padding: 8px 14px;
    border-radius: 8px;
    border: none;
    background: none;
    cursor: pointer;
    font-size: 13px;
    color: var(--text-secondary, #666);
    transition: all 0.2s;
}

.ai-settings-tab.active {
    background: rgba(37, 117, 252, 0.05);
    color: var(--primary, #2575fc);
    font-weight: 600;
}

.ai-settings-panel {
    display: none;
}

.ai-settings-panel.active {
    display: block;
}

/* --- 知識庫列表 --- */
.ai-knowledge-list {
    max-height: 250px;
    overflow-y: auto;
    border: 1px solid var(--glass-border, rgba(0,0,0,0.05));
    border-radius: 12px;
    padding: 12px;
    margin-top: 10px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ai-knowledge-item {
    padding: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.25);
    margin-bottom: 8px;
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
    gap: 10px;
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s;
}

.ai-knowledge-item:hover {
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(0,0,0,0.03);
}

.ai-knowledge-item-content {
    flex: 1;
}

.ai-knowledge-item-title {
    font-weight: 600;
    font-size: 13px;
    margin-bottom: 4px;
}

.ai-knowledge-item-desc {
    font-size: 12px;
    color: var(--text-secondary, #666);
}

.ai-knowledge-item-actions {
    display: flex;
    gap: 5px;
}

/* --- 歷史記錄列表 --- */
.ai-history-list {
    max-height: 300px;
    overflow-y: auto;
    border: 1px solid var(--glass-border, rgba(0,0,0,0.05));
    border-radius: 12px;
    padding: 12px;
    margin-top: 10px;
    background: rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ai-history-item {
    padding: 12px;
    border-radius: 10px;
    background: rgba(255,255,255,0.25);
    margin-bottom: 8px;
    cursor: pointer;
    transition: all 0.2s;
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
}

.ai-history-item:hover {
    background: rgba(37, 117, 252, 0.05);
    transform: translateX(3px);
    box-shadow: 0 2px 8px rgba(37, 117, 252, 0.05);
}

.ai-history-item-header {
    display: flex;
    justify-content: space-between;
    align-items: center;
    margin-bottom: 5px;
}

.ai-history-item-user {
    font-weight: 600;
    font-size: 13px;
}

.ai-history-item-time {
    font-size: 11px;
    color: var(--text-secondary, #666);
}

.ai-history-item-preview {
    font-size: 12px;
    color: var(--text-secondary, #666);
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
}

/* --- 響應式 - 屏幕适配优化 --- */
@media (max-width: 480px) {
    .ai-chat-window {
        width: calc(100vw - 20px) !important;
        height: calc(100vh - 100px) !important;
        max-width: calc(100vw - 20px) !important;
        max-height: calc(100vh - 100px) !important;
        right: 10px !important;
        bottom: 80px !important;
        left: 10px !important;
        top: auto !important;
        border-radius: 20px;
    }
    .ai-assistant-float-btn {
        bottom: 15px;
        right: 15px;
        width: 56px;
        height: 56px;
        font-size: 22px;
    }
    .ai-chat-header {
        border-radius: 20px 20px 0 0;
    }
    .ai-protect-overlay {
        border-radius: 20px;
    }
    .ai-message {
        max-width: 92%;
        font-size: 13px;
    }
    .ai-chat-input {
        font-size: 16px; /* 防止iOS缩放 */
    }
}

@media (max-height: 700px) {
    .ai-chat-window {
        height: calc(100vh - 100px) !important;
        max-height: calc(100vh - 100px) !important;
    }
}

/* --- 管理後台AI區域 --- */
.ai-admin-section {
    padding: 20px;
}

.ai-admin-section h4 {
    color: var(--primary, #2575fc);
    margin-bottom: 15px;
    display: flex;
    align-items: center;
    gap: 8px;
}

.ai-admin-card {
    background: rgba(255,255,255,0.25);
    border-radius: 14px;
    padding: 20px;
    margin-bottom: 20px;
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(12px);
    -webkit-backdrop-filter: blur(12px);
    box-shadow: 0 4px 16px rgba(0,0,0,0.03);
    transition: all 0.2s;
}

.ai-admin-card:hover {
    box-shadow: 0 6px 24px rgba(0,0,0,0.05);
}

.ai-admin-card h5 {
    margin-bottom: 12px;
    font-size: 14px;
    color: var(--text-primary, #333);
    display: flex;
    align-items: center;
    gap: 6px;
}

.ai-stat-row {
    display: grid;
    grid-template-columns: repeat(auto-fit, minmax(130px, 1fr));
    gap: 12px;
    margin-bottom: 15px;
}

.ai-stat-item {
    background: rgba(255,255,255,0.2);
    padding: 15px;
    border-radius: 12px;
    text-align: center;
    border: 1px solid rgba(255,255,255,0.15);
    backdrop-filter: blur(8px);
    -webkit-backdrop-filter: blur(8px);
    transition: all 0.2s;
}

.ai-stat-item:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0,0,0,0.03);
}

.ai-stat-value {
    font-size: 24px;
    font-weight: bold;
    color: var(--primary, #2575fc);
}

.ai-stat-label {
    font-size: 12px;
    color: var(--text-secondary, #666);
    margin-top: 5px;
}

/* --- 學習優化標籤 --- */
.ai-learning-tag {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 3px 8px;
    border-radius: 10px;
    font-size: 11px;
    font-weight: 600;
    backdrop-filter: blur(4px);
    -webkit-backdrop-filter: blur(4px);
}

.ai-learning-tag.positive {
    background: rgba(46, 204, 113, 0.08);
    color: #2ecc71;
}

.ai-learning-tag.negative {
    background: rgba(231, 76, 60, 0.08);
    color: #e74c3c;
}

.ai-learning-tag.neutral {
    background: rgba(149, 165, 166, 0.08);
    color: #7f8c8d;
}

/* --- 滾動條美化 --- */
.ai-chat-messages::-webkit-scrollbar,
.ai-knowledge-list::-webkit-scrollbar,
.ai-history-list::-webkit-scrollbar {
    width: 5px;
}

.ai-chat-messages::-webkit-scrollbar-track,
.ai-knowledge-list::-webkit-scrollbar-track,
.ai-history-list::-webkit-scrollbar-track {
    background: transparent;
}

.ai-chat-messages::-webkit-scrollbar-thumb,
.ai-knowledge-list::-webkit-scrollbar-thumb,
.ai-history-list::-webkit-scrollbar-thumb {
    background: rgba(0,0,0,0.05);
    border-radius: 10px;
}

.ai-chat-messages::-webkit-scrollbar-thumb:hover,
.ai-knowledge-list::-webkit-scrollbar-thumb:hover,
.ai-history-list::-webkit-scrollbar-thumb:hover {
    background: rgba(0,0,0,0.08);
}

/* --- 深色模式额外优化 --- */
.theme-dark .ai-chat-messages::-webkit-scrollbar-thumb {
    background: rgba(255,255,255,0.08);
}

.theme-dark .ai-chat-messages::-webkit-scrollbar-thumb:hover {
    background: rgba(255,255,255,0.15);
}
/* 管理员模式 - 全黑主题 */
.ai-chat-window.ai-admin-mode {
    background: rgba(0, 0, 0, 0.92) !important;
    border: 2px solid #ff9800 !important;
    box-shadow: 0 0 30px rgba(255, 152, 0, 0.3) !important;
}
.ai-chat-window.ai-admin-mode .ai-chat-header {
    background: rgba(0, 0, 0, 0.95) !important;
    border-bottom: 1px solid #ff9800 !important;
}
.ai-chat-window.ai-admin-mode .ai-chat-header span {
    color: #ff9800 !important;
}
.ai-chat-window.ai-admin-mode .ai-chat-messages {
    background: rgba(0, 0, 0, 0.88) !important;
}
.ai-chat-window.ai-admin-mode .ai-message-ai {
    background: rgba(30, 30, 30, 0.95) !important;
    color: #ffffff !important;
    border-left: 3px solid #ff9800 !important;
}
.ai-chat-window.ai-admin-mode .ai-message-user {
    background: rgba(255, 152, 0, 0.2) !important;
    color: #ffffff !important;
}
.ai-chat-window.ai-admin-mode .ai-input-area {
    background: rgba(0, 0, 0, 0.95) !important;
    border-top: 1px solid #ff9800 !important;
}
.ai-chat-window.ai-admin-mode .ai-input-area input {
    background: rgba(30, 30, 30, 0.95) !important;
    color: #ffffff !important;
    border: 1px solid #ff9800 !important;
}
.ai-chat-window.ai-admin-mode .ai-send-btn {
    background: linear-gradient(135deg, #ff9800, #f57c00) !important;
}
#aiAdminModeBtn {
    color: #ff9800 !important;
}
#aiAdminModeBtn.active {
    color: #ff9800 !important;
    text-shadow: 0 0 8px rgba(255, 152, 0, 0.6);
}
