/* 商务风格浮动AI聊天窗口 */
.wp-ai-floating-chat {
    position: fixed;
    bottom: 30px;
    right: 30px;
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
}

/* 商务风格聊天按钮 */
.wp-ai-chat-button {
    width: 56px;
    height: 56px;
    border-radius: 50%;
    background: #2c3e50;
    border: none;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.15);
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.3s ease;
    position: relative;
}

.wp-ai-chat-button:hover {
    background: #34495e;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.2);
    transform: translateY(-2px);
}

.wp-ai-chat-button:active {
    transform: translateY(0);
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.15);
}

.wp-ai-chat-icon {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    object-fit: cover;
    transition: all 0.3s ease;
}

.wp-ai-chat-button:hover .wp-ai-chat-icon {
    transform: scale(1.05);
}

/* 消息通知徽章 */
.wp-ai-notification-badge {
    position: absolute;
    top: -4px;
    right: -4px;
    width: 18px;
    height: 18px;
    background: #e74c3c;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    color: white;
    font-size: 11px;
    font-weight: 600;
    box-shadow: 0 2px 4px rgba(0, 0, 0, 0.2);
}

/* 商务风格聊天窗口 */
.wp-ai-chat-window {
    position: absolute;
    bottom: 76px;
    right: 0;
    width: 360px;
    height: 580px;
    background: #ffffff;
    border-radius: 8px;
    box-shadow: 0 8px 32px rgba(0, 0, 0, 0.12);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    transform: scale(0) translateY(10px);
    transform-origin: bottom right;
    transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
    opacity: 0;
    border: 1px solid #e1e8ed;
}

.wp-ai-chat-window.open {
    transform: scale(1) translateY(0);
    opacity: 1;
}

/* 商务风格聊天头部 */
.wp-ai-chat-header {
    background: #ffffff;
    color: #2c3e50;
    padding: 16px 20px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border-bottom: 1px solid #e1e8ed;
}

.wp-ai-chat-title {
    display: flex;
    align-items: center;
    gap: 12px;
}

.wp-ai-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wp-ai-info h3 {
    margin: 0;
    font-size: 15px;
    font-weight: 600;
    color: #2c3e50;
}

.wp-ai-status {
    font-size: 12px;
    color: #27ae60;
    display: flex;
    align-items: center;
    gap: 4px;
}

.wp-ai-status::before {
    content: '';
    width: 6px;
    height: 6px;
    background: #27ae60;
    border-radius: 50%;
    flex-shrink: 0;
}

.wp-ai-close-btn {
    background: none;
    border: none;
    color: #7f8c8d;
    cursor: pointer;
    padding: 8px;
    border-radius: 50%;
    transition: all 0.2s;
    display: flex;
    align-items: center;
    justify-content: center;
}

.wp-ai-close-btn:hover {
    background: #f8f9fa;
    color: #2c3e50;
}

.wp-ai-close-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* 消息区域 */
.wp-ai-messages {
    flex: 1;
    overflow-y: auto;
    padding: 20px;
    background: #fafbfc;
}

.wp-ai-messages::-webkit-scrollbar {
    width: 6px;
}

.wp-ai-messages::-webkit-scrollbar-track {
    background: #f1f2f3;
}

.wp-ai-messages::-webkit-scrollbar-thumb {
    background: #c1c8cd;
    border-radius: 3px;
}

.wp-ai-message {
    margin-bottom: 16px;
    display: flex;
    gap: 12px;
    align-items: flex-start;
}

.wp-ai-message.user {
    flex-direction: row-reverse;
}

.wp-ai-message-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    flex-shrink: 0;
    object-fit: cover;
    border: 2px solid #ffffff;
    box-shadow: 0 1px 3px rgba(0, 0, 0, 0.1);
}

.wp-ai-message-content {
    max-width: 75%;
    padding: 12px 16px;
    border-radius: 12px;
    font-size: 14px;
    line-height: 1.5;
    word-wrap: break-word;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.05);
}

.wp-ai-message.ai .wp-ai-message-content {
    background: #ffffff;
    border: 1px solid #e1e8ed;
    color: #2c3e50;
    margin-right: auto;
}

.wp-ai-message.user .wp-ai-message-content {
    background: #3498db;
    color: #ffffff;
    margin-left: auto;
}

.wp-ai-message-time {
    font-size: 11px;
    color: #95a5a6;
    margin-top: 4px;
    text-align: center;
}

/* 输入区域 */
.wp-ai-input-area {
    padding: 16px 20px;
    background: #ffffff;
    border-top: 1px solid #e1e8ed;
}

.wp-ai-input-wrapper {
    display: flex;
    gap: 12px;
    align-items: flex-end;
}

.wp-ai-input {
    flex: 1;
    border: 1px solid #d5dbde;
    border-radius: 20px;
    padding: 10px 16px;
    font-size: 14px;
    font-family: inherit;
    resize: none;
    outline: none;
    transition: all 0.2s;
    max-height: 100px;
    line-height: 1.4;
    background: #f8f9fa;
}

.wp-ai-input:focus {
    border-color: #3498db;
    background: #ffffff;
    box-shadow: 0 0 0 2px rgba(52, 152, 219, 0.1);
}

.wp-ai-input::placeholder {
    color: #7f8c8d;
}

.wp-ai-send-btn {
    width: 40px;
    height: 40px;
    border-radius: 50%;
    background: #3498db;
    border: none;
    color: white;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    transition: all 0.2s;
    flex-shrink: 0;
}

.wp-ai-send-btn:hover:not(:disabled) {
    background: #2980b9;
    transform: translateY(-1px);
    box-shadow: 0 2px 8px rgba(52, 152, 219, 0.3);
}

.wp-ai-send-btn:disabled {
    background: #bdc3c7;
    cursor: not-allowed;
    transform: none;
    box-shadow: none;
}

.wp-ai-send-btn svg {
    width: 18px;
    height: 18px;
    fill: currentColor;
}

/* 加载动画 */
.wp-ai-loading {
    display: inline-block;
    width: 14px;
    height: 14px;
    border: 2px solid #e1e8ed;
    border-top: 2px solid #3498db;
    border-radius: 50%;
    animation: spin 1s linear infinite;
    margin-right: 8px;
}

/* AI思考动画 */
.wp-ai-loading-dots {
    display: flex;
    gap: 4px;
    align-items: center;
}

.wp-ai-loading-dots span {
    width: 8px;
    height: 8px;
    background: #3498db;
    border-radius: 50%;
    animation: bounce 1.4s infinite ease-in-out both;
}

.wp-ai-loading-dots span:nth-child(1) {
    animation-delay: -0.32s;
}

.wp-ai-loading-dots span:nth-child(2) {
    animation-delay: -0.16s;
}

.wp-ai-loading-dots span:nth-child(3) {
    animation-delay: 0s;
}

@keyframes bounce {
    0%, 80%, 100% {
        transform: scale(0.8);
        opacity: 0.5;
    }
    40% {
        transform: scale(1.2);
        opacity: 1;
    }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

@keyframes spin {
    0% { transform: rotate(0deg); }
    100% { transform: rotate(360deg); }
}

/* 商务风格快速回复 */
.wp-ai-quick-replies {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    margin-bottom: 12px;
}

.wp-ai-quick-reply {
    background: #f8f9fa;
    border: 1px solid #d5dbde;
    border-radius: 16px;
    padding: 6px 12px;
    font-size: 12px;
    cursor: pointer;
    transition: all 0.2s;
    color: #2c3e50;
}

.wp-ai-quick-reply:hover {
    background: #e3f2fd;
    border-color: #3498db;
    color: #2c3e50;
}

/* 商务风格响应式设计 */
@media (max-width: 480px) {
    .wp-ai-floating-chat {
        bottom: 15px;
        right: 15px;
    }
    
    .wp-ai-chat-window {
        width: calc(100vw - 30px);
        height: calc(100vh - 90px);
        bottom: 70px;
        right: 0;
        border-radius: 8px;
    }
    
    .wp-ai-chat-button {
        width: 52px;
        height: 52px;
    }
    
    .wp-ai-chat-icon {
        width: 24px;
        height: 24px;
    }
}