/* 客服聊天弹窗样式 */
.support-chat-widget {
    position: fixed;
    bottom: 80px;
    right: 20px;
    z-index: 9999;
    display: none; /* 默认隐藏，因为底部导航已有客服按钮 */
}

/* 如果需要显示浮动按钮，取消下面的注释 */
/* .support-chat-widget {
    display: block;
} */

.support-chat-btn {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    box-shadow: 0 4px 12px rgba(102, 126, 234, 0.4);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    transition: all 0.3s ease;
    border: none;
    color: #ffffff;
    font-size: 24px;
}

.support-chat-btn:hover {
    transform: scale(1.1);
    box-shadow: 0 6px 16px rgba(102, 126, 234, 0.5);
}

.support-chat-btn .badge {
    position: absolute;
    top: -4px;
    right: -4px;
    background: #ef4444;
    color: #ffffff;
    font-size: 11px;
    padding: 2px 6px;
    border-radius: 10px;
    min-width: 18px;
    text-align: center;
    display: none;
}

.support-chat-btn.has-unread .badge {
    display: block;
}

/* 客服聊天窗口 */
.support-chat-window {
    position: fixed;
    bottom: 80px;
    right: 20px;
    width: calc(100% - 40px);
    max-width: 400px;
    height: 500px;
    max-height: calc(100vh - 120px);
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.2);
    display: none;
    flex-direction: column;
    z-index: 10000;
    overflow: hidden;
}

.support-chat-window.active {
    display: flex;
    animation: slideUp 0.3s ease;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(20px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

.support-chat-header {
    background: linear-gradient(135deg, #667eea 0%, #764ba2 100%);
    color: #ffffff;
    padding: 16px 20px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    border-radius: 16px 16px 0 0;
}

.support-chat-header h3 {
    margin: 0;
    font-size: 16px;
    font-weight: 600;
}

.support-chat-close {
    background: none;
    border: none;
    color: #ffffff;
    font-size: 24px;
    cursor: pointer;
    padding: 0;
    width: 32px;
    height: 32px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s ease;
}

.support-chat-close:hover {
    background: rgba(255, 255, 255, 0.2);
}

.support-chat-messages {
    flex: 1;
    padding: 16px;
    overflow-y: auto;
    background: #f9fafb;
}

.support-chat-message {
    margin-bottom: 12px;
    display: flex;
    flex-direction: column;
}

.support-chat-message.user {
    align-items: flex-end;
}

.support-chat-message.admin {
    align-items: flex-start;
}

.support-chat-message-content {
    max-width: 75%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
}

.support-chat-message.user .support-chat-message-content {
    background: #3b82f6;
    color: #ffffff;
}

.support-chat-message.admin .support-chat-message-content {
    background: #ffffff;
    border: 1px solid #e5e7eb;
    color: #111827;
}

.support-chat-message-time {
    font-size: 11px;
    color: #9ca3af;
    margin-top: 4px;
    padding: 0 4px;
}

.support-chat-input-area {
    padding: 12px;
    border-top: 1px solid #e5e7eb;
    background: #ffffff;
}

.support-chat-input {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    font-size: 14px;
    resize: none;
    outline: none;
    font-family: inherit;
    margin-bottom: 8px;
    box-sizing: border-box;
    max-height: 100px;
}

.support-chat-input:focus {
    border-color: #3b82f6;
}

.support-chat-actions {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
}

.support-chat-send-btn {
    padding: 8px 20px;
    background: #3b82f6;
    color: #ffffff;
    border: none;
    border-radius: 6px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s ease;
}

.support-chat-send-btn:hover {
    background: #2563eb;
}

.support-chat-send-btn:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.support-chat-empty {
    text-align: center;
    padding: 60px 20px;
    color: #9ca3af;
}

.support-chat-loading {
    text-align: center;
    padding: 20px;
    color: #6b7280;
}

/* 移动端适配 */
@media (max-width: 480px) {
    .support-chat-window {
        width: calc(100% - 20px);
        right: 10px;
        bottom: 70px;
        height: calc(100vh - 90px);
        max-height: calc(100vh - 90px);
    }

    .support-chat-btn {
        width: 50px;
        height: 50px;
        bottom: 70px;
        right: 15px;
    }
}
