/* 活力宝贝 — 悬浮入口与聊天窗口（白/金温和风格） */

.vb-root {
    --vb-gold: #b8860b;
    --vb-gold-light: #d4a843;
    --vb-cream: #fdfaf5;
    --vb-cream-deep: #f5ede0;
    --vb-bg: #ffffff;
    --vb-text: #1C2833;
    --vb-muted: #666;
    --vb-border: #eee5d5;
    --vb-bot-bg: #fdfaf5;
    --vb-user-bg: #f5ede0;
    --vb-shadow: 0 6px 24px rgba(0, 0, 0, 0.1);
    font-family: "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

/* 关闭状态：白底圆角卡片，固定右下角，不可拖动 */
.vb-fab {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 9998;
    display: block;
    padding: 0;
    margin: 0;
    background: transparent;
    border: none;
    cursor: pointer;
    line-height: 1.2;
    transition: opacity 0.2s ease;
}

.vb-fab:not(.vb-hidden):hover .vb-fab-card {
    box-shadow: 0 12px 36px rgba(184, 134, 11, 0.18);
    transform: translateY(-2px);
}

.vb-fab-card {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    background: #ffffff;
    border-radius: 24px;
    padding: 16px 20px 12px;
    box-shadow: var(--vb-shadow);
    border: 1px solid #f0f0f0;
    min-width: 148px;
    transition: box-shadow 0.2s ease, transform 0.2s ease;
}

.vb-fab-img {
    display: block;
    width: 112px;
    height: 112px;
    object-fit: contain;
    border-radius: 0;
    box-shadow: none;
    pointer-events: none;
}

.vb-fab-label {
    display: block;
    margin-top: 8px;
    font-size: 15px;
    font-weight: 600;
    color: var(--vb-gold);
    letter-spacing: 1px;
    white-space: nowrap;
    pointer-events: none;
}

.vb-fab.vb-hidden {
    opacity: 0;
    pointer-events: none;
}

/* 聊天面板 */
.vb-panel {
    position: fixed;
    right: 20px;
    bottom: 24px;
    z-index: 9999;
    width: 380px;
    max-width: calc(100vw - 32px);
    height: 520px;
    max-height: calc(100vh - 48px);
    background: var(--vb-bg);
    border-radius: 18px;
    box-shadow: var(--vb-shadow);
    border: 1px solid var(--vb-border);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    visibility: hidden;
    transform: translateY(16px) scale(0.96);
    transition: opacity 0.25s ease, transform 0.25s ease, visibility 0.25s;
}

.vb-panel.vb-open {
    opacity: 1;
    visibility: visible;
    transform: translateY(0) scale(1);
}

.vb-panel.vb-panel-dragging {
    transition: none;
    transform: none;
}

/* 展开状态头部：拖动区域 + 三小豆图 + 标题 + 关闭 */
.vb-header {
    position: relative;
    flex-shrink: 0;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    padding: 12px 44px 10px 44px;
    background: linear-gradient(180deg, var(--vb-cream) 0%, #ffffff 100%);
    border-bottom: 1px solid var(--vb-border);
    text-align: center;
    cursor: grab;
    touch-action: none;
    user-select: none;
    -webkit-user-select: none;
}

.vb-header.vb-dragging {
    cursor: grabbing;
}

.vb-header-logo {
    display: block;
    width: 88px;
    height: auto;
    max-height: none;
    object-fit: contain;
    margin: 0 auto;
}

.vb-header-title {
    font-size: 18px;
    font-weight: 600;
    line-height: 1.2;
    margin: 0;
    color: var(--vb-text);
    white-space: nowrap;
    overflow: visible;
    text-overflow: clip;
    text-align: center;
    width: 100%;
}

.vb-close {
    position: absolute;
    top: 10px;
    right: 10px;
    background: #f5f5f5;
    border: 1px solid #eee;
    color: #666;
    width: 32px;
    height: 32px;
    border-radius: 50%;
    font-size: 20px;
    line-height: 1;
    cursor: pointer;
    flex-shrink: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s, color 0.2s;
    z-index: 2;
}

.vb-close:hover {
    background: var(--vb-cream-deep);
    color: var(--vb-gold);
}

/* 消息区 */
.vb-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px;
    background: #ffffff;
    -webkit-overflow-scrolling: touch;
}

.vb-msg {
    max-width: 88%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.65;
    word-break: break-word;
}

.vb-msg-bot {
    align-self: flex-start;
    background: var(--vb-bot-bg);
    color: var(--vb-text);
    border: 1px solid var(--vb-border);
    border-bottom-left-radius: 4px;
    white-space: pre-line;
}

.vb-msg-user {
    align-self: flex-end;
    background: var(--vb-user-bg);
    color: var(--vb-text);
    border: 1px solid var(--vb-border);
    border-bottom-right-radius: 4px;
}

/* 快捷问题：白底金边金字 */
.vb-quick {
    padding: 0 16px 10px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    flex-shrink: 0;
    background: #ffffff;
}

.vb-quick-btn {
    padding: 6px 12px;
    font-size: 12px;
    color: var(--vb-gold);
    background: #ffffff;
    border: 1px solid var(--vb-gold);
    border-radius: 20px;
    cursor: pointer;
    transition: background 0.2s, color 0.2s;
    line-height: 1.4;
    text-align: left;
}

.vb-quick-btn:hover {
    background: var(--vb-cream);
    color: var(--vb-gold-light);
}

/* 输入区 */
.vb-input-area {
    display: flex;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid var(--vb-border);
    flex-shrink: 0;
    background: var(--vb-cream);
}

.vb-input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid var(--vb-border);
    border-radius: 24px;
    font-size: 14px;
    outline: none;
    font-family: inherit;
    background: #fff;
    transition: border-color 0.2s;
}

.vb-input:focus {
    border-color: var(--vb-gold);
}

.vb-send {
    padding: 10px 18px;
    background: var(--vb-gold);
    color: #fff;
    border: none;
    border-radius: 24px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    flex-shrink: 0;
    transition: background 0.2s;
}

.vb-send:hover {
    background: var(--vb-gold-light);
}

/* 移动端适配 */
@media (max-width: 992px) {
    .vb-fab {
        right: 14px;
        bottom: 88px;
    }

    .vb-fab-img {
        width: 96px;
        height: 96px;
    }

    .vb-fab-card {
        padding: 14px 18px 10px;
        min-width: 128px;
        border-radius: 22px;
    }

    .vb-fab-label {
        font-size: 14px;
    }

    .vb-panel {
        right: 14px;
        bottom: 16px;
        width: calc(100vw - 28px);
        height: min(520px, calc(100vh - 32px));
    }

    .vb-header {
        padding: 10px 40px 8px 40px;
    }

    .vb-header-logo {
        width: 76px;
        height: auto;
        max-height: none;
    }

    .vb-header-title {
        font-size: 16px;
    }

    .vb-quick-btn {
        font-size: 11px;
        padding: 5px 10px;
    }
}

@media (max-width: 480px) {
    .vb-panel.vb-open {
        right: 0;
        bottom: 0;
        width: 100vw;
        max-width: 100vw;
        height: 100vh;
        max-height: 100vh;
        border-radius: 0;
    }

    .vb-fab.vb-hidden {
        display: none;
    }
}
