/* 智能客服前端样式 */
.scs-chat-widget {
    position: fixed;
    bottom: 100px;
    right: 20px;
    width: 350px;
    height: 450px;
    background: white;
    border-radius: 12px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.2);
    display: flex;
    flex-direction: column;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif;
    transition: all 0.3s ease;
    transform: translateY(20px);
    opacity: 0;
    visibility: hidden;
}

.scs-chat-widget.active {
    transform: translateY(0);
    opacity: 1;
    visibility: visible;
}

.scs-chat-header {
    background: #2563eb;
    color: white;
    padding: 15px;
    border-radius: 12px 12px 0 0;
    display: flex;
    justify-content: space-between;
    align-items: center;
    font-weight: 600;
}

.scs-chat-header button {
    background: none;
    border: none;
    color: white;
    font-size: 16px;
    cursor: pointer;
    padding: 5px;
    border-radius: 3px;
    transition: background-color 0.2s;
}

.scs-chat-header button:hover {
    background: rgba(255, 255, 255, 0.2);
}

.scs-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8fafc;
}

.scs-messages {
    display: flex;
    flex-direction: column;
    gap: 12px;
}

.scs-welcome-message {
    background: #e0f2fe;
    padding: 12px 16px;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    font-size: 14px;
    line-height: 1.5;
    color: #0c4a6e;
}

.scs-message {
    max-width: 80%;
    padding: 10px 14px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.4;
    word-wrap: break-word;
}

.scs-user-message {
    background: #2563eb;
    color: white;
    align-self: flex-end;
    border-bottom-right-radius: 4px;
}

.scs-ai-message {
    background: white;
    color: #374151;
    border: 1px solid #e5e7eb;
    align-self: flex-start;
    border-bottom-left-radius: 4px;
}

.scs-chat-footer {
    padding: 15px;
    border-top: 1px solid #e5e7eb;
    background: white;
    border-radius: 0 0 12px 12px;
    display: flex;
    gap: 10px;
    align-items: end;
}

.scs-message-input {
    flex: 1;
    border: 1px solid #d1d5db;
    border-radius: 8px;
    padding: 10px 12px;
    font-size: 14px;
    resize: none;
    min-height: 40px;
    max-height: 120px;
    outline: none;
    transition: border-color 0.2s;
}

.scs-message-input:focus {
    border-color: #2563eb;
    box-shadow: 0 0 0 3px rgba(37, 99, 235, 0.1);
}

.scs-send-button {
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 8px;
    padding: 10px 16px;
    font-size: 14px;
    font-weight: 500;
    cursor: pointer;
    transition: background-color 0.2s;
}

.scs-send-button:hover {
    background: #1d4ed8;
}

.scs-send-button:disabled {
    background: #9ca3af;
    cursor: not-allowed;
}

.scs-chat-toggle {
    position: fixed;
    bottom: 20px;
    right: 20px;
    width: 60px;
    height: 60px;
    background: #2563eb;
    color: white;
    border: none;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    z-index: 9998;
    transition: all 0.3s ease;
}

.scs-chat-toggle:hover {
    background: #1d4ed8;
    transform: scale(1.05);
}

.scs-chat-toggle .dashicons {
    font-size: 24px;
    width: 24px;
    height: 24px;
}

.scs-typing-indicator {
    display: flex;
    gap: 4px;
    padding: 12px 16px;
    background: white;
    border: 1px solid #e5e7eb;
    border-radius: 12px;
    border-bottom-left-radius: 4px;
    align-self: flex-start;
}

.scs-typing-dot {
    width: 8px;
    height: 8px;
    background: #9ca3af;
    border-radius: 50%;
    animation: scs-typing 1.4s infinite;
}

.scs-typing-dot:nth-child(2) {
    animation-delay: 0.2s;
}

.scs-typing-dot:nth-child(3) {
    animation-delay: 0.4s;
}

@keyframes scs-typing {
    0%, 60%, 100% {
        transform: translateY(0);
        opacity: 0.4;
    }
    30% {
        transform: translateY(-10px);
        opacity: 1;
    }
}

.scs-minimized .scs-chat-body,
.scs-minimized .scs-chat-footer {
    display: none;
}

.scs-minimized {
    height: auto;
    width: 200px;
}

/* 响应式设计 */
@media (max-width: 480px) {
    .scs-chat-widget {
        width: 100vw;
        height: 100vh;
        bottom: 0;
        right: 0;
        border-radius: 0;
    }
    
    .scs-chat-toggle {
        bottom: 80px;
        right: 20px;
    }
}