/* ===== 子比美化插件Pro - AI助手前端样式（子比主题风格） ===== */

/* ========== 聊天窗口 ========== */
.zibll-bp-ai-chat-window {
    position: fixed;
    top: 60px;
    right: 80px;
    width: 400px;
    max-height: calc(100vh - 100px);
    height: auto;
    box-sizing: border-box;
    background: linear-gradient(180deg, #f0f4ff 0%, #fdf6ff 50%, #fff0f5 100%);
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    z-index: 99998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(255, 255, 255, 0.6);
    left: auto;
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    transition: opacity 0.35s cubic-bezier(0.4, 0, 0.2, 1), transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
}

.zibll-bp-ai-chat-window.show {
    display: flex;
    opacity: 1;
    transform: translateY(0) scale(1);
    animation: zibllBpAiChatOpen 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

.zibll-bp-ai-chat-window.hiding {
    opacity: 0;
    transform: translateY(30px) scale(0.95);
    animation: zibllBpAiChatClose 0.3s cubic-bezier(0.4, 0, 0.2, 1);
    pointer-events: none;
}

@keyframes zibllBpAiChatOpen {
    0% {
        opacity: 0;
        transform: translateY(30px) scale(0.9);
    }
    60% {
        opacity: 1;
        transform: translateY(-4px) scale(1.02);
    }
    100% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

@keyframes zibllBpAiChatClose {
    0% {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
    100% {
        opacity: 0;
        transform: translateY(20px) scale(0.95);
    }
}

/* ========== AI 助手悬浮按钮动画 ========== */
/* 按钮激活态：聊天窗口打开时 */
.zibll-bp-ai-chat-trigger.chat-open {
    transform: scale(1.08);
    box-shadow: 0 4px 16px rgba(var(--this-bg-r, 102, 126, 234), 0.4);
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

/* 按钮点击波纹脉冲动画 */
.zibll-bp-ai-chat-trigger.chat-open::after {
    content: '';
    position: absolute;
    inset: -6px;
    border-radius: 50%;
    border: 2px solid currentColor;
    opacity: 0;
    animation: zibllBpAiPulse 1.5s ease-out infinite;
    pointer-events: none;
}

@keyframes zibllBpAiPulse {
    0% {
        transform: scale(1);
        opacity: 0.5;
    }
    100% {
        transform: scale(1.4);
        opacity: 0;
    }
}

/* 按钮点击弹性缩放动画 */
@keyframes zibllBpAiBounce {
    0% { transform: scale(1); }
    30% { transform: scale(0.85); }
    60% { transform: scale(1.12); }
    100% { transform: scale(1); }
}

.zibll-bp-ai-chat-trigger.bouncing {
    animation: zibllBpAiBounce 0.5s cubic-bezier(0.4, 0, 0.2, 1);
}

/* 按钮图标过渡旋转与切换 */
.zibll-bp-ai-chat-trigger .fa {
    transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1), opacity 0.25s ease;
    display: inline-block;
}

/* 默认状态：显示对话图标，隐藏关闭图标 */
.zibll-bp-ai-chat-trigger .chat-icon-close {
    display: none !important;
}

/* 聊天窗口打开时：显示关闭图标 */
.zibll-bp-ai-chat-trigger.chat-open .chat-icon-default {
    display: none !important;
}

.zibll-bp-ai-chat-trigger.chat-open .chat-icon-close {
    display: inline-block !important;
    animation: zibllBpAiIconSpin 0.4s cubic-bezier(0.4, 0, 0.2, 1);
}

@keyframes zibllBpAiIconSpin {
    0% {
        transform: rotate(0deg) scale(0.5);
        opacity: 0;
    }
    100% {
        transform: rotate(180deg) scale(1);
        opacity: 1;
    }
}

/* 按钮基础过渡 */
.zibll-bp-ai-chat-trigger {
    position: relative;
    transition: transform 0.3s cubic-bezier(0.4, 0, 0.2, 1), box-shadow 0.3s ease;
}

.zibll-bp-ai-chat-trigger:hover {
    transform: scale(1.08);
}

/* 聊天窗口头部 - 子比主题风格 */
.zibll-bp-ai-chat-header {
    padding: 14px 18px;
    background: transparent;
    color: var(--main-color);
    display: flex;
    align-items: center;
    gap: 10px;
    flex-shrink: 0;
}

.zibll-bp-ai-chat-avatar {
    width: 24px;
    height: 24px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.zibll-bp-ai-chat-title-wrap {
    flex: 1;
    min-width: 0;
}

.zibll-bp-ai-chat-title {
    font-size: 15px;
    font-weight: 600;
    margin: 0;
    color: #333;
    line-height: 1.3;
}

.zibll-bp-ai-chat-subtitle {
    font-size: 11px;
    color: #999;
    line-height: 1.2;
}

.zibll-bp-ai-chat-header-actions {
    display: flex;
    align-items: center;
    gap: 8px;
}

.zibll-bp-ai-chat-header-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    color: #666;
}

.zibll-bp-ai-chat-header-btn:hover {
    background: rgba(0, 0, 0, 0.06);
}

.zibll-bp-ai-chat-header-dot {
    width: 12px;
    height: 12px;
    border-radius: 50%;
    background: #888;
}

.zibll-bp-ai-chat-close {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: background 0.2s;
    font-size: 14px;
    color: #666;
    line-height: 1;
    flex-shrink: 0;
}

.zibll-bp-ai-chat-close:hover {
    background: rgba(0, 0, 0, 0.06);
}

/* 聊天消息区域 */
.zibll-bp-ai-chat-messages {
    flex: 1;
    min-height: 0;
    max-height: 380px;
    overflow-y: auto;
    padding: 0 18px 15px;
    background: transparent;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.zibll-bp-ai-chat-messages::-webkit-scrollbar {
    width: 6px;
}

.zibll-bp-ai-chat-messages::-webkit-scrollbar-track {
    background: transparent;
}

.zibll-bp-ai-chat-messages::-webkit-scrollbar-thumb {
    background: var(--main-border-color);
    border-radius: 3px;
}

/* 消息气泡 - 子比风格 */
.zibll-bp-ai-msg {
    display: flex;
    gap: 8px;
    max-width: 85%;
    animation: zibllBpAiMsgFadeIn 0.3s ease;
}

@keyframes zibllBpAiMsgFadeIn {
    from {
        opacity: 0;
        transform: translateY(10px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.zibll-bp-ai-msg.bot,
.zibll-bp-ai-msg.assistant {
    align-self: flex-start;
}

.zibll-bp-ai-msg.user {
    align-self: flex-end;
    flex-direction: row-reverse;
}

.zibll-bp-ai-msg-avatar {
    width: 30px;
    height: 30px;
    border-radius: 50%;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 14px;
    overflow: hidden;
}

.zibll-bp-ai-msg-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
    border-radius: 50%;
}

.zibll-bp-ai-msg-avatar svg {
    width: 18px;
    height: 18px;
    display: block;
}

.zibll-bp-ai-msg.bot .zibll-bp-ai-msg-avatar,
.zibll-bp-ai-msg.assistant .zibll-bp-ai-msg-avatar {
    background: transparent;
    color: #333;
}

.zibll-bp-ai-msg.user .zibll-bp-ai-msg-avatar {
    background: var(--muted-bg-color);
    color: var(--muted-2-color);
}

.zibll-bp-ai-msg-content {
    padding: 8px 12px;
    border-radius: var(--main-radius);
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}

.zibll-bp-ai-msg.bot .zibll-bp-ai-msg-content,
.zibll-bp-ai-msg.assistant .zibll-bp-ai-msg-content {
    background: rgba(255, 255, 255, 0.8);
    color: var(--main-color);
    border: 1px solid rgba(0, 0, 0, 0.04);
    border-top-left-radius: 2px;
    box-shadow: 0 1px 4px rgba(0, 0, 0, 0.04);
}

.zibll-bp-ai-msg.user .zibll-bp-ai-msg-content {
    background: var(--theme-color);
    color: #fff;
    border-top-right-radius: 2px;
}

/* 正在输入动画 */
.zibll-bp-ai-typing {
    display: flex;
    gap: 4px;
    padding: 8px 0;
}

.zibll-bp-ai-typing span {
    width: 6px;
    height: 6px;
    background: var(--muted-2-color);
    border-radius: 50%;
    animation: zibllBpAiTyping 1.4s infinite ease-in-out;
}

.zibll-bp-ai-typing span:nth-child(1) {
    animation-delay: -0.32s;
}

.zibll-bp-ai-typing span:nth-child(2) {
    animation-delay: -0.16s;
}

@keyframes zibllBpAiTyping {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1);
        opacity: 1;
    }
}

/* 聊天输入区域 - 子比风格 */
.zibll-bp-ai-chat-input-wrap {
    padding: 10px 18px 12px;
    background: transparent;
    display: flex;
    gap: 10px;
    align-items: flex-end;
    flex-shrink: 0;
}

.zibll-bp-ai-chat-input {
    flex: 1;
    min-height: 38px;
    max-height: 120px;
    padding: 10px 16px;
    border: none;
    border-radius: 20px;
    font-size: 13px;
    resize: none;
    outline: none;
    transition: all 0.2s;
    font-family: inherit;
    background: rgba(255, 255, 255, 0.8);
    color: var(--main-color);
    line-height: 1.5;
    box-shadow: 0 1px 6px rgba(0, 0, 0, 0.06);
}

.zibll-bp-ai-chat-input:focus {
    background: rgba(255, 255, 255, 0.95);
    box-shadow: 0 1px 8px rgba(102, 126, 234, 0.1);
}

.zibll-bp-ai-chat-input::placeholder {
    color: #bbb;
}

.zibll-bp-ai-chat-send {
    width: 38px;
    height: 38px;
    padding: 0;
    border-radius: 12px;
    background: #a0b8e0;
    color: #fff;
    border: none;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: all 0.2s;
    font-size: 14px;
}

.zibll-bp-ai-chat-send:hover:not(:disabled) {
    background: #8aa4d0;
}

.zibll-bp-ai-chat-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

/* ========== 文章 AI 摘要 - 子比主题风格 ========== */
.zibll-bp-ai-summary-box {
    margin: 20px 0;
    background: var(--main-bg-color);
    border-radius: var(--main-radius);
    border: 1px solid var(--main-border-color);
    overflow: hidden;
}

.zibll-bp-ai-summary-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--main-border-color);
    background: var(--muted-bg-color);
}

.zibll-bp-ai-summary-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--theme-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
}

.zibll-bp-ai-summary-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--main-color);
    margin: 0;
    flex: 1;
}

.zibll-bp-ai-summary-content {
    padding: 16px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--main-color);
    white-space: pre-wrap;
}

.zibll-bp-ai-summary-actions {
    padding: 10px 16px;
    border-top: 1px solid var(--main-border-color);
    display: flex;
    gap: 10px;
    align-items: center;
    background: var(--muted-bg-color);
}

.zibll-bp-ai-summary-btn {
    padding: 6px 16px;
    font-size: 13px;
    border-radius: var(--main-radius);
    background: var(--theme-color);
    color: #fff;
    border: none;
    cursor: pointer;
    transition: opacity 0.2s;
    font-weight: 500;
}

.zibll-bp-ai-summary-btn:hover {
    opacity: 0.9;
}

.zibll-bp-ai-summary-meta {
    font-size: 12px;
    color: var(--muted-2-color);
}

/* 摘要打字机光标 */
.zibll-bp-ai-typing-cursor {
    display: inline-block;
    width: 2px;
    height: 1em;
    margin-left: 3px;
    background: var(--theme-color);
    vertical-align: text-bottom;
    animation: zibll-bp-ai-blink 0.8s steps(2, start) infinite;
}

@keyframes zibll-bp-ai-blink {
    0%, 50% { opacity: 1; }
    50.01%, 100% { opacity: 0; }
}

/* 打字进行中保留最小高度，避免内容区跳动 */
.zibll-bp-ai-summary-content[data-typing] {
    min-height: 1.8em;
}

/* ========== 摘要样式2：极简线条 ========== */
.zibll-bp-ai-summary-style-minimal {
    display: flex;
    gap: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.zibll-bp-ai-summary-minimal-left-line {
    width: 3px;
    min-height: 60px;
    border-radius: 3px;
    background: var(--theme-color);
    flex-shrink: 0;
    margin-right: 14px;
    align-self: stretch;
}

.zibll-bp-ai-summary-minimal-body {
    flex: 1;
    min-width: 0;
}

.zibll-bp-ai-summary-minimal-header {
    margin-bottom: 8px;
}

.zibll-bp-ai-summary-minimal-badge {
    display: inline-block;
    padding: 2px 10px;
    font-size: 12px;
    font-weight: 600;
    color: var(--theme-color);
    background: rgba(var(--theme-color-rgb, 0, 102, 255), 0.08);
    border-radius: 3px;
    letter-spacing: 0.5px;
}

.zibll-bp-ai-summary-style-minimal .zibll-bp-ai-summary-content {
    padding: 0;
    font-size: 14px;
    line-height: 1.8;
    color: var(--main-color);
}

.zibll-bp-ai-summary-actions.minimal-actions {
    padding: 10px 0 0;
    border-top: none;
    background: transparent;
}

/* ========== 摘要样式3：渐变背景 ========== */
.zibll-bp-ai-summary-style-gradient {
    border: none;
    border-radius: var(--main-radius);
    overflow: hidden;
    background: transparent;
    box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
}

.zibll-bp-ai-summary-gradient-body {
    position: relative;
    background: linear-gradient(135deg, #f5f0ff 0%, #e8f4ff 50%, #f0f5ff 100%);
    border: 1px solid rgba(var(--theme-color-rgb, 102, 126, 234), 0.15);
    border-radius: var(--main-radius);
    overflow: hidden;
}

.zibll-bp-ai-summary-gradient-body::before {
    content: '';
    position: absolute;
    top: -30px;
    right: -30px;
    width: 120px;
    height: 120px;
    border-radius: 50%;
    background: var(--theme-color);
    opacity: 0.06;
    pointer-events: none;
}

.zibll-bp-ai-summary-gradient-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 16px 20px 8px;
    position: relative;
}

.zibll-bp-ai-summary-gradient-icon {
    width: 32px;
    height: 32px;
    border-radius: 8px;
    background: linear-gradient(135deg, var(--theme-color), #8a7fff);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 15px;
    flex-shrink: 0;
    box-shadow: 0 3px 8px rgba(var(--theme-color-rgb, 102, 126, 234), 0.3);
}

.zibll-bp-ai-summary-gradient-title {
    font-size: 15px;
    font-weight: 600;
    color: #3d3859;
    margin: 0;
}

.zibll-bp-ai-summary-style-gradient .zibll-bp-ai-summary-content {
    padding: 8px 20px 16px;
    font-size: 14px;
    line-height: 1.8;
    color: #4a4568;
    position: relative;
}

.zibll-bp-ai-summary-style-gradient .zibll-bp-ai-summary-actions {
    padding: 8px 20px 14px;
    border-top: 1px solid rgba(0, 0, 0, 0.05);
    background: transparent;
}

/* ========== 摘要样式4：气泡对话 ========== */
.zibll-bp-ai-summary-style-bubble {
    display: flex;
    gap: 12px;
    border: none;
    background: transparent;
    overflow: visible;
    align-items: flex-start;
}

.zibll-bp-ai-summary-bubble-avatar {
    flex-shrink: 0;
    margin-top: 2px;
}

.zibll-bp-ai-summary-bubble-avatar-icon {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    background: var(--theme-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 16px;
}

.zibll-bp-ai-summary-bubble-body {
    flex: 1;
    min-width: 0;
}

.zibll-bp-ai-summary-bubble-name {
    font-size: 12px;
    color: var(--muted-2-color);
    margin-bottom: 6px;
    font-weight: 500;
}

.zibll-bp-ai-summary-bubble-content {
    background: var(--muted-bg-color);
    border-radius: 0 12px 12px 12px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--main-color);
    position: relative;
    white-space: pre-wrap;
}

/* 气泡小三角 */
.zibll-bp-ai-summary-bubble-content::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 10px;
    width: 0;
    height: 0;
    border-right: 6px solid var(--muted-bg-color);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.zibll-bp-ai-summary-style-bubble .zibll-bp-ai-summary-content {
    background: var(--muted-bg-color);
    border-radius: 0 12px 12px 12px;
    padding: 12px 16px;
    font-size: 14px;
    line-height: 1.8;
    color: var(--main-color);
    position: relative;
}

.zibll-bp-ai-summary-style-bubble .zibll-bp-ai-summary-content::before {
    content: '';
    position: absolute;
    left: -6px;
    top: 10px;
    width: 0;
    height: 0;
    border-right: 6px solid var(--muted-bg-color);
    border-top: 6px solid transparent;
    border-bottom: 6px solid transparent;
}

.zibll-bp-ai-summary-style-bubble .zibll-bp-ai-summary-actions {
    padding: 10px 0 0;
    border-top: none;
    background: transparent;
}

/* ========== 摘要样式5：深色面板 ========== */
.zibll-bp-ai-summary-style-dark {
    border: none;
    border-radius: var(--main-radius);
    background: transparent;
    overflow: hidden;
}

.zibll-bp-ai-summary-dark-body {
    background: linear-gradient(135deg, #1e1f2e 0%, #252740 50%, #1a1c2e 100%);
    border: 1px solid rgba(255, 255, 255, 0.06);
    border-radius: var(--main-radius);
    padding: 20px;
    position: relative;
    overflow: hidden;
}

.zibll-bp-ai-summary-dark-body::after {
    content: '';
    position: absolute;
    bottom: -20px;
    left: -20px;
    width: 100px;
    height: 100px;
    border-radius: 50%;
    background: var(--theme-color);
    opacity: 0.08;
    pointer-events: none;
}

.zibll-bp-ai-summary-dark-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 12px;
    position: relative;
    z-index: 1;
}

.zibll-bp-ai-summary-dark-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: var(--theme-color);
    box-shadow: 0 0 6px var(--theme-color);
    flex-shrink: 0;
}

.zibll-bp-ai-summary-dark-title {
    font-size: 14px;
    font-weight: 600;
    color: #e0dff0;
    margin: 0;
    letter-spacing: 0.5px;
}

.zibll-bp-ai-summary-style-dark .zibll-bp-ai-summary-content {
    padding: 0;
    font-size: 14px;
    line-height: 1.8;
    color: #b8b7cc;
    position: relative;
    z-index: 1;
}

.zibll-bp-ai-summary-style-dark .zibll-bp-ai-summary-actions {
    padding: 14px 0 0;
    border-top: 1px solid rgba(255, 255, 255, 0.08);
    background: transparent;
    position: relative;
    z-index: 1;
}

/* ========== 摘要样式6：引用块风格 ========== */
.zibll-bp-ai-summary-style-blockquote {
    border: none;
    border-radius: 0;
    background: transparent;
    overflow: visible;
}

.zibll-bp-ai-summary-blockquote-body {
    border-left: 4px solid var(--theme-color);
    padding: 8px 0 8px 20px;
    background: var(--muted-bg-color);
    border-radius: 0 8px 8px 0;
    position: relative;
}

.zibll-bp-ai-summary-blockquote-header {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 8px;
}

.zibll-bp-ai-summary-blockquote-quote {
    color: var(--theme-color);
    font-size: 18px;
    opacity: 0.6;
}

.zibll-bp-ai-summary-blockquote-label {
    font-size: 13px;
    font-weight: 600;
    color: var(--theme-color);
    letter-spacing: 0.5px;
}

.zibll-bp-ai-summary-style-blockquote .zibll-bp-ai-summary-content {
    padding: 0;
    font-size: 14px;
    line-height: 1.8;
    color: var(--muted-3-color);
    font-style: italic;
}

.zibll-bp-ai-summary-style-blockquote .zibll-bp-ai-summary-actions {
    padding: 10px 0 0;
    border-top: none;
    background: transparent;
}

/* 暗色模式适配 */
@media (prefers-color-scheme: dark) {
    .zibll-bp-ai-summary-gradient-body {
        background: linear-gradient(135deg, #1e1a2e 0%, #1a2035 50%, #1a1e30 100%);
        border-color: rgba(var(--theme-color-rgb, 102, 126, 234), 0.2);
    }

    .zibll-bp-ai-summary-gradient-title {
        color: #e0dff0;
    }

    .zibll-bp-ai-summary-style-gradient .zibll-bp-ai-summary-content {
        color: #c0bed8;
    }

    .zibll-bp-ai-summary-dark-body {
        background: linear-gradient(135deg, #0f1020 0%, #151730 50%, #0d0f1e 100%);
        border-color: rgba(255, 255, 255, 0.1);
    }
}

/* ========== 文章 AI 问答 - 子比主题风格 ========== */
.zibll-bp-ai-qa-box {
    margin: 20px 0;
    background: var(--main-bg-color);
    border-radius: var(--main-radius);
    border: 1px solid var(--main-border-color);
    overflow: hidden;
}

.zibll-bp-ai-qa-header {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px 16px;
    border-bottom: 1px solid var(--main-border-color);
    background: var(--muted-bg-color);
}

.zibll-bp-ai-qa-icon {
    width: 28px;
    height: 28px;
    border-radius: 6px;
    background: var(--theme-color);
    display: flex;
    align-items: center;
    justify-content: center;
    color: #fff;
    font-size: 14px;
    flex-shrink: 0;
}

.zibll-bp-ai-qa-title {
    font-size: 15px;
    font-weight: 600;
    color: var(--main-color);
    margin: 0;
    flex: 1;
}

.zibll-bp-ai-qa-input-wrap {
    display: flex;
    gap: 10px;
    padding: 16px;
}

.zibll-bp-ai-qa-input {
    flex: 1;
    padding: 8px 12px;
    border: 1px solid var(--main-border-color);
    border-radius: var(--main-radius);
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    background: var(--body-bg-color);
    color: var(--main-color);
}

.zibll-bp-ai-qa-input:focus {
    border-color: var(--theme-color);
}

.zibll-bp-ai-qa-input::placeholder {
    color: var(--muted-2-color);
}

.zibll-bp-ai-qa-send {
    padding: 8px 20px;
    background: var(--theme-color);
    color: #fff;
    border: none;
    border-radius: var(--main-radius);
    cursor: pointer;
    font-size: 14px;
    transition: opacity 0.2s;
    white-space: nowrap;
    font-weight: 500;
}

.zibll-bp-ai-qa-send:hover:not(:disabled) {
    opacity: 0.9;
}

.zibll-bp-ai-qa-send:disabled {
    opacity: 0.5;
    cursor: not-allowed;
}

.zibll-bp-ai-qa-answer {
    padding: 16px;
    margin: 0 16px 16px;
    background: var(--muted-bg-color);
    border-radius: var(--main-radius);
    font-size: 14px;
    line-height: 1.8;
    color: var(--main-color);
    white-space: pre-wrap;
    display: none;
}

.zibll-bp-ai-qa-answer.show {
    display: block;
    animation: zibllBpAiMsgFadeIn 0.3s ease;
}

/* ========== 侧边栏 AI 小工具 - 子比主题风格 ========== */
.zibll-bp-ai-widget-box {
    text-align: center;
    padding: 20px 16px;
    background: linear-gradient(135deg, var(--theme-color) 0%, var(--focus-color, #ff8a65) 100%);
    border-radius: var(--main-radius);
    color: #fff;
}

.zibll-bp-ai-widget-icon {
    width: 50px;
    height: 50px;
    margin: 0 auto 12px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 24px;
}

.zibll-bp-ai-widget-title {
    font-size: 16px;
    font-weight: 600;
    margin-bottom: 6px;
}

.zibll-bp-ai-widget-desc {
    font-size: 13px;
    opacity: 0.9;
    line-height: 1.6;
    margin-bottom: 16px;
}

.zibll-bp-ai-widget-btn {
    display: inline-block;
    padding: 8px 24px;
    background: #fff;
    color: var(--theme-color);
    border-radius: 20px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: transform 0.2s;
    border: none;
}

.zibll-bp-ai-widget-btn:hover {
    transform: translateY(-2px);
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
}

/* ========== 欢迎界面 ========== */
.zibll-bp-ai-welcome {
    display: flex;
    flex-direction: column;
    align-items: center;
    text-align: center;
    padding: 20px 10px 10px;
    animation: zibllBpAiMsgFadeIn 0.4s ease;
    flex-shrink: 0;
}

.zibll-bp-ai-welcome-icon {
    width: 56px;
    height: 56px;
    color: #333;
    display: flex;
    align-items: center;
    justify-content: center;
    margin-bottom: 16px;
}

.zibll-bp-ai-welcome-icon svg {
    width: 56px;
    height: 56px;
    fill: #333;
    display: block;
}

.zibll-bp-ai-welcome-title {
    font-size: 24px;
    font-weight: 700;
    color: #333;
    margin-bottom: 8px;
}

.zibll-bp-ai-welcome-desc {
    font-size: 13px;
    color: #888;
    line-height: 1.7;
    margin-bottom: 16px;
}

/* ========== 快捷按钮 ========== */
.zibll-bp-ai-quick-actions {
    display: flex;
    gap: 10px;
    width: 100%;
}

.zibll-bp-ai-quick-card {
    flex: 1;
    background: rgba(255, 255, 255, 0.7);
    backdrop-filter: blur(10px);
    border: 1px solid rgba(255, 255, 255, 0.8);
    border-radius: 12px;
    padding: 14px 8px;
    cursor: pointer;
    transition: all 0.25s ease;
    text-align: center;
}

.zibll-bp-ai-quick-card:hover {
    background: rgba(255, 255, 255, 0.95);
    transform: translateY(-2px);
    box-shadow: 0 6px 20px rgba(102, 126, 234, 0.12);
}

.zibll-bp-ai-quick-icon {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    background: rgba(102, 126, 234, 0.1);
    color: #667eea;
    display: flex;
    align-items: center;
    justify-content: center;
    margin: 0 auto 8px;
    font-size: 14px;
}

.zibll-bp-ai-quick-title {
    font-size: 13px;
    font-weight: 600;
    color: #333;
    margin-bottom: 4px;
}

.zibll-bp-ai-quick-desc {
    font-size: 10px;
    color: #aaa;
    line-height: 1.4;
}

/* ========== 底部状态栏 ========== */
.zibll-bp-ai-chat-footer {
    display: flex;
    justify-content: space-between;
    align-items: center;
    padding: 6px 18px 10px;
    font-size: 11px;
    color: #bbb;
    flex-shrink: 0;
}

.zibll-bp-ai-chat-footer-left,
.zibll-bp-ai-chat-footer-right {
    display: flex;
    align-items: center;
    gap: 4px;
}

.zibll-bp-ai-chat-footer-avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}

.zibll-bp-ai-chat-footer-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    border-radius: 50%;
}

.zibll-bp-ai-chat-footer-avatar .avatar {
    width: 22px;
    height: 22px;
    border-radius: 50%;
}

.zibll-bp-ai-chat-footer-nickname {
    color: #666;
    max-width: 80px;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.zibll-bp-ai-identity-sep {
    color: #ccc;
    font-size: 10px;
    margin: 0 2px;
}

.zibll-bp-ai-quota,
.zibll-bp-ai-identity {
    color: #999;
}

/* ========== 响应式 - 移动端 ========== */
@media (max-width: 768px) {
    .zibll-bp-ai-chat-window {
        position: fixed;
        top: 0;
        left: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
    }

}

/* ==================== 历史对话面板 ==================== */
.zibll-bp-ai-chat-history-btn {
    margin-left: 5px;
}

.zibll-bp-ai-chat-history-btn .fa-history {
    color: #666;
}

.zibll-bp-ai-chat-history-panel {
    position: absolute;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    background: #fff;
    z-index: 20;
    display: flex;
    flex-direction: column;
    border-radius: 12px;
    overflow: hidden;
}

.zibll-bp-ai-chat-history-header {
    display: flex;
    align-items: center;
    padding: 15px 16px 12px;
    border-bottom: 1px solid #f0f0f0;
    background: #fff;
    flex-shrink: 0;
}

.zibll-bp-ai-chat-history-back {
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    transition: background 0.2s;
    margin-right: 10px;
    flex-shrink: 0;
}

.zibll-bp-ai-chat-history-back:hover {
    background: #f5f5f5;
}

.zibll-bp-ai-chat-history-back .fa {
    font-size: 16px;
    color: #333;
}

.zibll-bp-ai-chat-history-title {
    font-size: 16px;
    font-weight: 600;
    color: #1a1a1a;
}

.zibll-bp-ai-chat-history-list {
    flex: 1;
    overflow-y: auto;
    padding: 8px 0;
}

.zibll-bp-ai-history-loading {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.zibll-bp-ai-chat-history-empty {
    text-align: center;
    padding: 40px 20px;
    color: #999;
    font-size: 14px;
}

.zibll-bp-ai-history-item {
    display: flex;
    align-items: center;
    padding: 14px 16px;
    cursor: pointer;
    transition: background 0.2s;
    border-bottom: 1px solid #f8f8f8;
    position: relative;
}

.zibll-bp-ai-history-item:hover {
    background: #f9f9f9;
}

.zibll-bp-ai-history-item:last-child {
    border-bottom: none;
}

.zibll-bp-ai-history-item-info {
    flex: 1;
    min-width: 0;
}

.zibll-bp-ai-history-item-title {
    font-size: 14px;
    color: #333;
    font-weight: 500;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    margin-bottom: 4px;
    line-height: 1.4;
}

.zibll-bp-ai-history-item-meta {
    font-size: 12px;
    color: #aaa;
}

.zibll-bp-ai-history-delete {
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    cursor: pointer;
    opacity: 0;
    transition: all 0.2s;
    flex-shrink: 0;
    margin-left: 8px;
}

.zibll-bp-ai-history-item:hover .zibll-bp-ai-history-delete {
    opacity: 1;
}

.zibll-bp-ai-history-delete:hover {
    background: #fee;
    color: #f56c6c;
}

.zibll-bp-ai-history-delete .fa {
    font-size: 14px;
    color: #ccc;
}

.zibll-bp-ai-history-delete:hover .fa {
    color: #f56c6c;
}

/* 暗色主题适配 */
[data-theme="dark"] .zibll-bp-ai-chat-history-panel {
    background: #1e1e2e;
}

[data-theme="dark"] .zibll-bp-ai-chat-history-header {
    background: #1e1e2e;
    border-bottom-color: #2a2a3a;
}

[data-theme="dark"] .zibll-bp-ai-chat-history-back:hover {
    background: #2a2a3a;
}

[data-theme="dark"] .zibll-bp-ai-chat-history-back .fa {
    color: #ddd;
}

[data-theme="dark"] .zibll-bp-ai-chat-history-title {
    color: #e0e0e0;
}

[data-theme="dark"] .zibll-bp-ai-history-item:hover {
    background: #252538;
}

[data-theme="dark"] .zibll-bp-ai-history-item {
    border-bottom-color: #2a2a3a;
}

[data-theme="dark"] .zibll-bp-ai-history-item-title {
    color: #ddd;
}

[data-theme="dark"] .zibll-bp-ai-history-item-meta {
    color: #777;
}

[data-theme="dark"] .zibll-bp-ai-history-delete:hover {
    background: #3a2020;
}

[data-theme="dark"] .zibll-bp-ai-history-delete .fa {
    color: #666;
}

[data-theme="dark"] .zibll-bp-ai-history-delete:hover .fa {
    color: #f56c6c;
}
