/* BNO AI 客服聊天组件样式 */

/* 聊天按钮容器 */
.bno-chat-btn-wrapper {
    position: fixed;
    bottom: 24px;
    right: 24px;
    z-index: 99999;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 6px;
}

/* AI客服 标签 */
.bno-chat-label {
    background: transparent;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    padding: 2px 8px;
    border-radius: 4px;
    white-space: nowrap;
    letter-spacing: 0.5px;
    animation: bno-float 2.5s ease-in-out infinite;
    user-select: none;
}

@keyframes bno-float {
    0%, 100% { transform: translateY(0); }
    50% { transform: translateY(-4px); }
}

/* 聊天按钮 - 右下角悬浮 */
.bno-chat-btn {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    background: transparent;
    border: none;
    cursor: pointer;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: transform 0.3s, box-shadow 0.3s;
}
.bno-chat-btn:hover {
    transform: scale(1.08);
}

.bno-chat-icon {
    width: 60px;
    height: 60px;
    border-radius: 50%;
    object-fit: cover;
    box-shadow: 0 4px 16px rgba(10, 186, 181, 0.35);
    animation: bno-float 2.5s ease-in-out infinite;
}

/* 未读提示小红点 */
.bno-chat-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 20px;
    height: 20px;
    background: #ff4757;
    border-radius: 50%;
    color: #fff;
    font-size: 11px;
    font-weight: 600;
    display: flex;
    align-items: center;
    justify-content: center;
    display: none;
}

/* 聊天窗口 */
.bno-chat-window {
    position: fixed;
    bottom: 92px;
    right: 24px;
    width: 370px;
    height: 540px;
    background: #fff;
    border-radius: 18px;
    box-shadow: 0 8px 40px rgba(0,0,0,0.15);
    z-index: 99998;
    display: none;
    flex-direction: column;
    overflow: hidden;
    font-family: -apple-system, BlinkMacSystemFont, 'Inter', sans-serif;
    animation: bno-slide-up 0.3s ease;
}
.bno-chat-window.open {
    display: flex;
}

@keyframes bno-slide-up {
    from { opacity: 0; transform: translateY(20px) scale(0.96); }
    to { opacity: 1; transform: translateY(0) scale(1); }
}

/* 聊天头部 */
.bno-chat-header {
    background: linear-gradient(135deg, #0ABAB5 0%, #089490 100%);
    color: #fff;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    gap: 12px;
    flex-shrink: 0;
}
.bno-chat-avatar {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: rgba(255,255,255,0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 18px;
}
.bno-chat-header-info {
    flex: 1;
}
.bno-chat-header-info h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
}
.bno-chat-header-info p {
    margin: 2px 0 0;
    font-size: 12px;
    opacity: 0.85;
}
.bno-chat-close {
    background: none;
    border: none;
    color: #fff;
    cursor: pointer;
    padding: 4px;
    border-radius: 50%;
    display: flex;
    opacity: 0.8;
    transition: opacity 0.2s;
}
.bno-chat-close:hover { opacity: 1; }
.bno-chat-close svg { width: 20px; height: 20px; }

/* 消息区域 */
.bno-chat-messages {
    flex: 1;
    overflow-y: auto;
    padding: 16px;
    background: #f8f9fc;
    display: flex;
    flex-direction: column;
    gap: 10px;
}
.bno-chat-messages::-webkit-scrollbar {
    width: 4px;
}
.bno-chat-messages::-webkit-scrollbar-thumb {
    background: #ddd;
    border-radius: 4px;
}

/* 消息气泡 */
.bno-msg {
    max-width: 85%;
    padding: 10px 14px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.5;
    word-break: break-word;
    animation: bno-msg-in 0.25s ease;
}
@keyframes bno-msg-in {
    from { opacity: 0; transform: translateY(6px); }
    to { opacity: 1; transform: translateY(0); }
}

.bno-msg.user {
    align-self: flex-end;
    background: #667eea;
    color: #fff;
    border-bottom-right-radius: 4px;
}
.bno-msg.bot {
    align-self: flex-start;
    background: #fff;
    color: #333;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}

/* 输入区 */
.bno-chat-input {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 12px 16px;
    border-top: 1px solid #eee;
    background: #fff;
    flex-shrink: 0;
}
.bno-chat-input input {
    flex: 1;
    border: 1px solid #e0e0e0;
    border-radius: 24px;
    padding: 10px 16px;
    font-size: 14px;
    outline: none;
    transition: border-color 0.2s;
    font-family: inherit;
}
.bno-chat-input input:focus {
    border-color: #667eea;
}
.bno-chat-input input::placeholder {
    color: #aaa;
}
.bno-chat-send {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    border: none;
    background: #0ABAB5;
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
    flex-shrink: 0;
}
.bno-chat-send:hover { background: #089490; }
.bno-chat-send:disabled { background: #ccc; cursor: not-allowed; }
.bno-chat-send svg { width: 18px; height: 18px; }

/* 正在输入... */
.bno-typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: #fff;
    border-radius: 16px;
    border-bottom-left-radius: 4px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.06);
}
.bno-typing span {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: #bbb;
    animation: bno-bounce 1.4s infinite;
}
.bno-typing span:nth-child(2) { animation-delay: 0.2s; }
.bno-typing span:nth-child(3) { animation-delay: 0.4s; }
@keyframes bno-bounce {
    0%, 80%, 100% { transform: translateY(0); }
    40% { transform: translateY(-6px); }
}

/* 快速问题按钮 */
.bno-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 16px;
    background: #f8f9fc;
    border-top: 1px solid #eee;
    flex-shrink: 0;
}
.bno-quick-btn {
    padding: 6px 14px;
    border-radius: 20px;
    border: 1px solid #d0d5f5;
    background: #fff;
    color: #667eea;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    font-family: inherit;
    white-space: nowrap;
}
.bno-quick-btn:hover {
    background: #667eea;
    color: #fff;
    border-color: #667eea;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .bno-chat-window {
        width: calc(100vw - 24px);
        height: 65vh;
        right: 12px;
        bottom: 84px;
    }
    .bno-chat-btn-wrapper {
        bottom: 16px;
        right: 16px;
    }
}
