/* ===================== 普利施康客服机器人 ===================== */

/* 悬浮按钮 */
.chatbot-fab {
    position: fixed;
    right: 24px;
    bottom: 24px;
    width: 60px;
    height: 60px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    font-size: 26px;
    cursor: pointer;
    z-index: 9000;
    box-shadow: 0 6px 20px rgba(249, 115, 22, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.2s, box-shadow 0.2s;
}
.chatbot-fab:hover {
    transform: scale(1.08);
    box-shadow: 0 8px 26px rgba(249, 115, 22, 0.55);
}
.chatbot-fab.hidden-fab {
    transform: scale(0);
    pointer-events: none;
}

.chatbot-fab-dot {
    position: absolute;
    top: 4px;
    right: 4px;
    width: 14px;
    height: 14px;
    border-radius: 50%;
    background: #22c55e;
    border: 2px solid #fff;
    animation: chatbot-pulse 2s infinite;
}
@keyframes chatbot-pulse {
    0%, 100% { box-shadow: 0 0 0 0 rgba(34, 197, 94, 0.6); }
    50% { box-shadow: 0 0 0 6px rgba(34, 197, 94, 0); }
}

/* 聊天面板 */
.chatbot-panel {
    position: fixed;
    right: 24px;
    bottom: 96px;
    width: 340px;
    max-width: calc(100vw - 32px);
    height: 480px;
    max-height: calc(100vh - 120px);
    background: #fff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.18);
    z-index: 9001;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    opacity: 0;
    transform: translateY(20px) scale(0.95);
    pointer-events: none;
    transition: opacity 0.25s, transform 0.25s;
}
.chatbot-panel.open {
    opacity: 1;
    transform: translateY(0) scale(1);
    pointer-events: auto;
}

/* 头部 */
.chatbot-header {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    padding: 14px 16px;
    display: flex;
    align-items: center;
    justify-content: space-between;
}
.chatbot-header-info {
    display: flex;
    align-items: center;
    gap: 10px;
}
.chatbot-avatar {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.25);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}
.chatbot-title {
    font-weight: 700;
    font-size: 15px;
}
.chatbot-status {
    font-size: 11px;
    opacity: 0.9;
}
.chatbot-close {
    background: none;
    border: none;
    color: #fff;
    font-size: 18px;
    cursor: pointer;
    opacity: 0.85;
    padding: 4px;
}
.chatbot-close:hover { opacity: 1; }

/* 消息区 */
.chatbot-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px 14px;
    background: #f8fafc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.chatbot-msg {
    max-width: 82%;
    padding: 10px 14px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-line;
}
.msg-bot {
    align-self: flex-start;
    background: #fff;
    color: #374151;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 4px;
}
.msg-user {
    align-self: flex-end;
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    border-bottom-right-radius: 4px;
}

/* 打字动画 */
.chatbot-typing span {
    display: inline-block;
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #9ca3af;
    margin-right: 3px;
    animation: chatbot-blink 1.4s infinite both;
}
.chatbot-typing span:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes chatbot-blink {
    0%, 80%, 100% { opacity: 0.3; }
    40% { opacity: 1; }
}

/* 快捷问题 */
.chatbot-quick {
    padding: 10px 14px;
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    background: #fff;
    border-top: 1px solid #f1f5f9;
}
.chatbot-quick-btn {
    background: #fff7ed;
    color: #c2410c;
    border: 1px solid #fed7aa;
    border-radius: 999px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: background 0.15s;
}
.chatbot-quick-btn:hover {
    background: #ffedd5;
}

/* 留资表单 */
.chatbot-form {
    padding: 10px 14px 14px;
    background: #fff;
    border-top: 1px solid #f1f5f9;
    display: flex;
    flex-direction: column;
    gap: 8px;
}
.chatbot-form input {
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    padding: 9px 12px;
    font-size: 13px;
    outline: none;
    transition: border-color 0.15s;
}
.chatbot-form input:focus {
    border-color: #f97316;
}
.chatbot-submit {
    background: linear-gradient(135deg, #f59e0b, #f97316);
    color: #fff;
    border: none;
    border-radius: 8px;
    padding: 10px;
    font-size: 14px;
    font-weight: 600;
    cursor: pointer;
    transition: opacity 0.15s;
}
.chatbot-submit:hover { opacity: 0.92; }
.chatbot-submit:disabled { opacity: 0.6; cursor: not-allowed; }

/* 移动端 */
@media (max-width: 480px) {
    .chatbot-fab { width: 52px; height: 52px; right: 16px; bottom: 16px; }
    .chatbot-panel { right: 16px; bottom: 80px; width: calc(100vw - 32px); }
}