/* ==========================
   在线客服样式
========================== */

/* 浮动客服按钮 */
.chatbot-float-btn {
    position: fixed;
    bottom: 200px;
    right: 30px;
    width: 65px;
    height: 65px;
    background: linear-gradient(356deg, #6910cb 0%, #fffcfb 50%, #13638b 100%);
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 4px 20px rgba(139, 69, 19, 0.4);
    z-index: 1000;
    transition: all 0.3s ease;
    border: 2px solid rgba(255, 255, 255, 0.3);
}


.chatbot-float-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 30px rgba(139, 69, 19, 0.5);
}

.chatbot-float-btn .avatar {
    font-size: 32px;
}

.chatbot-float-btn .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    width: 20px;
    height: 20px;
    background: #ff4d4f;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 12px;
    color: white;
    font-weight: bold;
    animation: pulse 2s infinite;
}

@keyframes pulse {
    0%, 100% { transform: scale(1); }
    50% { transform: scale(1.1); }
}

/* 聊天窗口 */
.chatbot-container {
    position: fixed;
    bottom: 100px;
    right: 30px;
    width: 360px;
    background: linear-gradient(180deg, #fdfbf7 0%, #f5f0e6 100%);
    border-radius: 12px;
    box-shadow: 0 10px 40px rgba(0, 0, 0, 0.15);
    border: 1px solid #d4c8b8;
    z-index: 1001;
    display: none;
    overflow: hidden;
}

.chatbot-container.show {
    display: block;
}

/* 聊天头部 */
.chatbot-header {
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    padding: 15px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    color: white;
}

.chatbot-header .title {
    display: flex;
    align-items: center;
    gap: 10px;
}

.chatbot-header .avatar {
    font-size: 24px;
}

.chatbot-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 500;
}

.chatbot-header .status {
    font-size: 12px;
    opacity: 0.8;
}

.chatbot-header .close-btn {
    width: 28px;
    height: 28px;
    border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    border: none;
    color: white;
    cursor: pointer;
    font-size: 16px;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: background 0.2s;
}

.chatbot-header .close-btn:hover {
    background: rgba(255, 255, 255, 0.3);
}

/* 消息列表 */
.chatbot-messages {
    height: 350px;
    overflow-y: auto;
    padding: 15px;
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.chatbot-messages::-webkit-scrollbar {
    width: 5px;
}

.chatbot-messages::-webkit-scrollbar-track {
    background: #f0ebe3;
    border-radius: 3px;
}

.chatbot-messages::-webkit-scrollbar-thumb {
    background: #c9a96e;
    border-radius: 3px;
}

/* 消息气泡 */
.chatbot-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 16px;
    line-height: 1.5;
    font-size: 14px;
}

.chatbot-message.bot {
    align-self: flex-start;
    background: white;
    border: 1px solid #e8e0d5;
    border-radius: 16px 16px 16px 4px;
}

.chatbot-message.user {
    align-self: flex-end;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    color: white;
    border-radius: 16px 16px 4px 16px;
}

.chatbot-message .time {
    font-size: 10px;
    opacity: 0.6;
    margin-top: 4px;
    text-align: right;
}

/* 输入区域 */
.chatbot-input-area {
    padding: 12px 15px;
    border-top: 1px solid #e8e0d5;
    background: white;
}

.chatbot-input-area .input-row {
    display: flex;
    gap: 10px;
    align-items: center;
}

.chatbot-input-area input {
    flex: 1;
    padding: 10px 14px;
    border: 1px solid #d4c8b8;
    border-radius: 20px;
    font-size: 14px;
    background: #faf8f5;
    transition: border-color 0.2s;
}

.chatbot-input-area input:focus {
    outline: none;
    border-color: #c9a96e;
}

.chatbot-input-area button {
    width: 38px;
    height: 38px;
    border-radius: 50%;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
}

.chatbot-input-area button:hover {
    transform: scale(1.05);
    box-shadow: 0 2px 10px rgba(139, 69, 19, 0.3);
}

/* 欢迎消息 */
.chatbot-welcome {
    text-align: center;
    padding: 20px;
    color: #6b5344;
}

.chatbot-welcome .greeting {
    font-size: 14px;
    margin-bottom: 10px;
}

.chatbot-welcome .quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    justify-content: center;
}

.chatbot-welcome .quick-btn {
    padding: 6px 14px;
    background: rgba(139, 69, 19, 0.1);
    border: 1px solid rgba(139, 69, 19, 0.2);
    border-radius: 20px;
    font-size: 12px;
    color: #5d4037;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-welcome .quick-btn:hover {
    background: rgba(139, 69, 19, 0.2);
    border-color: #8B4513;
}

/* 打字指示器 */
.chatbot-typing {
    align-self: flex-start;
    display: flex;
    gap: 4px;
    padding: 8px 12px;
    background: white;
    border: 1px solid #e8e0d5;
    border-radius: 16px;
}

.chatbot-typing .dot {
    width: 6px;
    height: 6px;
    background: #c9a96e;
    border-radius: 50%;
    animation: typing 1.4s infinite ease-in-out;
}

.chatbot-typing .dot:nth-child(1) { animation-delay: 0s; }
.chatbot-typing .dot:nth-child(2) { animation-delay: 0.2s; }
.chatbot-typing .dot:nth-child(3) { animation-delay: 0.4s; }

@keyframes typing {
    0%, 80%, 100% { transform: scale(0.6); opacity: 0.5; }
    40% { transform: scale(1); opacity: 1; }
}

/* 离线留言区域 */
.chatbot-offline {
    padding: 15px;
    text-align: center;
    color: #6b5344;
}

.chatbot-offline p {
    margin-bottom: 15px;
}

.chatbot-offline .offline-actions {
    display: flex;
    gap: 15px;
    justify-content: center;
}

.chatbot-offline .action-btn {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    padding: 15px 20px;
    background: rgba(139, 69, 19, 0.05);
    border: 1px solid rgba(139, 69, 19, 0.1);
    border-radius: 12px;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-offline .action-btn:hover {
    background: rgba(139, 69, 19, 0.1);
}

.chatbot-offline .action-btn .icon {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 20px;
}

.chatbot-offline .action-btn.continue .icon {
    background: #4080ff;
    color: white;
}

.chatbot-offline .action-btn.message .icon {
    background: #32c5ff;
    color: white;
}

.chatbot-offline .action-btn span {
    font-size: 12px;
    color: #5d4037;
}

/* 留言表单 */
.chatbot-message-form {
    padding: 15px;
}

.chatbot-message-form .form-group {
    margin-bottom: 12px;
}

.chatbot-message-form label {
    display: block;
    font-size: 12px;
    color: #6b5344;
    margin-bottom: 5px;
}

.chatbot-message-form input,
.chatbot-message-form textarea {
    width: 100%;
    padding: 10px;
    border: 1px solid #d4c8b8;
    border-radius: 8px;
    font-size: 14px;
    background: #faf8f5;
    box-sizing: border-box;
}

.chatbot-message-form textarea {
    resize: vertical;
    min-height: 80px;
}

.chatbot-message-form .submit-btn {
    width: 100%;
    padding: 10px;
    background: linear-gradient(135deg, #8B4513 0%, #A0522D 100%);
    border: none;
    border-radius: 8px;
    color: white;
    font-size: 14px;
    cursor: pointer;
    transition: all 0.2s;
}

.chatbot-message-form .submit-btn:hover {
    opacity: 0.9;
}

.chatbot-message-form .back-btn {
    width: 100%;
    padding: 8px;
    background: transparent;
    border: 1px solid #d4c8b8;
    border-radius: 8px;
    color: #5d4037;
    font-size: 12px;
    cursor: pointer;
    margin-top: 8px;
}

#preset-select {
    padding: 8px 12px;
    border: 1px solid #e0e0e0;
    border-radius: 4px;
    font-size: 13px;
    cursor: pointer;
}