/* 名表帝官网 · AI 智能顾问悬浮窗 */

.mbd-ai-btn {
    position: fixed;
    z-index: 99998;
    width: 58px;
    height: 58px;
    border: 1px solid rgba(176, 141, 79, .55);
    border-radius: 50%;
    background: linear-gradient(145deg, #1a1f26, #0d1014);
    color: #d3b47b;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 10px 26px rgba(0, 0, 0, .35);
    transition: transform .2s ease, box-shadow .2s ease;
}
.mbd-ai-btn:hover { transform: translateY(-2px); box-shadow: 0 14px 32px rgba(0, 0, 0, .45); }
.mbd-ai-btn svg { width: 26px; height: 26px; }
.mbd-ai-btn.is-right { right: 24px; bottom: 24px; }
.mbd-ai-btn.is-left { left: 24px; bottom: 24px; }

.mbd-ai-panel {
    position: fixed;
    z-index: 99999;
    right: 24px;
    bottom: 94px;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 560px;
    max-height: calc(100vh - 130px);
    display: none;
    flex-direction: column;
    overflow: hidden;
    background: #fff;
    border: 1px solid #e6e1d7;
    border-radius: 12px;
    box-shadow: 0 24px 60px rgba(0, 0, 0, .28);
    font-size: 14px;
    line-height: 1.6;
    color: #1b1f24;
}
.mbd-ai-panel.is-left { right: auto; left: 24px; }
.mbd-ai-panel.is-open { display: flex; }

.mbd-ai-head {
    flex: none;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 16px;
    background: linear-gradient(135deg, #14181d, #232a33);
    color: #f2efe8;
}
.mbd-ai-avatar {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    object-fit: cover;
    border: 1px solid rgba(211, 180, 123, .55);
    background: #0d1014;
    flex: none;
}
.mbd-ai-avatar--text {
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 15px;
    color: #d3b47b;
    font-weight: 600;
}
.mbd-ai-title { flex: 1; min-width: 0; }
.mbd-ai-title strong { display: block; font-size: 14px; font-weight: 600; letter-spacing: .02em; }
.mbd-ai-title span { display: block; font-size: 11px; color: #9aa1aa; margin-top: 1px; }
.mbd-ai-head-btn {
    flex: none;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 6px;
    background: rgba(255, 255, 255, .08);
    color: #cfd3d8;
    cursor: pointer;
    font-size: 16px;
    line-height: 1;
}
.mbd-ai-head-btn:hover { background: rgba(255, 255, 255, .16); }

.mbd-ai-body {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px 8px;
    background: #faf9f6;
    scroll-behavior: smooth;
}
.mbd-ai-row { display: flex; margin-bottom: 12px; }
.mbd-ai-row.is-user { justify-content: flex-end; }
.mbd-ai-bubble {
    max-width: 84%;
    padding: 9px 12px;
    border-radius: 10px;
    word-break: break-word;
    white-space: normal;
}
.mbd-ai-row.is-ai .mbd-ai-bubble {
    background: #fff;
    border: 1px solid #e9e5dc;
    color: #22272d;
    border-top-left-radius: 3px;
}
.mbd-ai-row.is-user .mbd-ai-bubble {
    background: linear-gradient(135deg, #b08d4f, #c9a96a);
    color: #fff;
    border-top-right-radius: 3px;
}
.mbd-ai-bubble a { color: #8a6a2f; text-decoration: underline; word-break: break-all; }
.mbd-ai-row.is-user .mbd-ai-bubble a { color: #fff; }

.mbd-ai-typing { display: inline-block; }
.mbd-ai-typing::after {
    content: '';
    display: inline-block;
    width: 6px;
    height: 14px;
    margin-left: 2px;
    vertical-align: -2px;
    background: #b08d4f;
    animation: mbd-ai-blink 1s steps(2) infinite;
}
@keyframes mbd-ai-blink { 50% { opacity: 0; } }

.mbd-ai-sources { margin-top: 8px; font-size: 12px; color: #6f7680; }
.mbd-ai-sources a { color: #8a6a2f; text-decoration: none; margin-right: 10px; }
.mbd-ai-sources a:hover { text-decoration: underline; }

.mbd-ai-actions { margin-top: 6px; display: flex; gap: 8px; font-size: 12px; }
.mbd-ai-actions button {
    border: 0;
    background: transparent;
    color: #9aa1aa;
    cursor: pointer;
    padding: 0;
}
.mbd-ai-actions button:hover { color: #8a6a2f; }

.mbd-ai-quick { padding: 0 14px 10px; display: flex; flex-wrap: wrap; gap: 6px; background: #faf9f6; }
.mbd-ai-quick button {
    border: 1px solid #e2d9c6;
    background: #fff;
    color: #5d6470;
    border-radius: 14px;
    padding: 4px 10px;
    font-size: 12px;
    cursor: pointer;
}
.mbd-ai-quick button:hover { border-color: #b08d4f; color: #8a6a2f; }

.mbd-ai-foot { flex: none; border-top: 1px solid #ece8df; background: #fff; padding: 10px 12px 8px; }
.mbd-ai-input-row { display: flex; gap: 8px; align-items: flex-end; }
.mbd-ai-input {
    flex: 1;
    min-height: 38px;
    max-height: 96px;
    resize: none;
    padding: 9px 10px;
    border: 1px solid #ddd6c9;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.5;
    font-family: inherit;
    outline: none;
    background: #fff;
}
.mbd-ai-input:focus { border-color: #b08d4f; }
.mbd-ai-send {
    flex: none;
    height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 8px;
    background: linear-gradient(135deg, #b08d4f, #c9a96a);
    color: #fff;
    font-size: 14px;
    cursor: pointer;
}
.mbd-ai-send:disabled { opacity: .55; cursor: not-allowed; }

.mbd-ai-note {
    margin-top: 6px;
    font-size: 11px;
    color: #a0a6ae;
    line-height: 1.5;
}
.mbd-ai-handoff {
    margin-top: 8px;
    padding: 10px 12px;
    background: #f7f3ea;
    border: 1px solid #e8dfcd;
    border-radius: 8px;
    font-size: 12px;
    color: #5d6470;
    line-height: 1.9;
    display: none;
}
.mbd-ai-handoff.is-open { display: block; }
.mbd-ai-handoff a { color: #8a6a2f; font-weight: 600; text-decoration: none; }
.mbd-ai-handoff img { display: block; width: 110px; height: 110px; margin-top: 6px; object-fit: contain; border-radius: 4px; }

@media (max-width: 640px) {
    .mbd-ai-btn.is-right { right: 16px; bottom: 16px; }
    .mbd-ai-btn.is-left { left: 16px; bottom: 16px; }
    .mbd-ai-panel,
    .mbd-ai-panel.is-left {
        left: 0;
        right: 0;
        bottom: 0;
        top: 0;
        width: 100%;
        max-width: 100%;
        height: 100%;
        max-height: 100%;
        border-radius: 0;
        border: 0;
    }
    .mbd-ai-panel.is-open { z-index: 99999; }
}
