/**
 * 智狐AI客服前端样式
 */
.ai-foxtech-service-container {
    position: fixed;
    z-index: 999999;
}

.ai-foxtech-service-container.right .ai-foxtech-service-button {
    right: 20px;
}

.ai-foxtech-service-container.left .ai-foxtech-service-button {
    left: 20px;
}

.ai-foxtech-service-button {
    position: fixed;
    /* 默认值，可被内联样式覆盖 */
    bottom: 20px;
    padding: 10px 15px;
    border-radius: 50px;
    background-color: #3c5efd;
    color: #ffffff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
    transition: all 0.3s ease;
    z-index: 999999;
}

/* 仅图标模式 */
.ai-foxtech-service-button.icon-only {
    width: 60px;
    height: 60px;
    padding: 0 !important;
    border-radius: 50% !important;
}

/* 仅文字模式 */
.ai-foxtech-service-button.text-only {
    padding: 10px 20px;
}

/* 文字+图标模式 */
.ai-foxtech-service-button.text-icon .ai-foxtech-service-icon {
    margin-right: 8px;
}

.ai-foxtech-service-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 4px 15px rgba(0, 0, 0, 0.3);
}

/* 呼吸灯动画效果 - 更明显 */
.ai-foxtech-service-button.breathing {
    animation: breathing 3s infinite ease-in-out;
    z-index: 2;
}

/* 呼吸灯外圈动画 */
.ai-foxtech-service-button.breathing::before {
    content: '';
    position: absolute;
    top: -4px;
    left: -4px;
    right: -4px;
    bottom: -4px;
    border-radius: inherit;
    background-color: transparent;
    border: 2px solid currentColor;
    opacity: 0;
    z-index: -1;
    animation: pulse-ring 3s infinite ease-in-out;
}

@keyframes pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0;
    }
    20% {
        opacity: 0.1;
    }
    50% {
        transform: scale(1.08);
        opacity: 0.3;
    }
    80% {
        opacity: 0.1;
    }
    100% {
        transform: scale(1);
        opacity: 0;
    }
}

@keyframes breathing {
    0% {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        transform: scale(1);
    }
    50% {
        box-shadow: 0 5px 25px rgba(60, 94, 253, 0.8);
        transform: scale(1.03);
    }
    100% {
        box-shadow: 0 2px 10px rgba(0, 0, 0, 0.2);
        transform: scale(1);
    }
}

/* 渐变背景的呼吸灯效果 */
.ai-foxtech-service-container[data-theme^="gradient_"] .ai-foxtech-service-button.breathing {
    animation: gradient-breathing 3s infinite ease-in-out;
}

@keyframes gradient-breathing {
    0% {
        opacity: 1;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
    50% {
        opacity: 0.85;
        box-shadow: 0 4px 25px rgba(0, 0, 0, 0.4);
    }
    100% {
        opacity: 1;
        box-shadow: 0 4px 15px rgba(0, 0, 0, 0.2);
    }
}

.ai-foxtech-service-overlay {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background-color: rgba(0, 0, 0, 0.4);
    z-index: 999998;
}

.ai-foxtech-service-iframe-container {
    position: fixed;
    bottom: 90px;
    right: 20px;
    max-width: 90%;
    z-index: 999999;
    background-color: #fff;
    border-radius: 10px;
    box-shadow: 0 5px 25px rgba(0, 0, 0, 0.2);
    display: none;
    overflow: hidden;
}

.ai-foxtech-service-container.left .ai-foxtech-service-iframe-container {
    right: auto;
    left: 20px;
}

.ai-foxtech-service-close {
    position: absolute;
    top: 10px;
    right: 10px;
    width: 24px;
    height: 24px;
    background-color: #f1f1f1;
    border-radius: 50%;
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    z-index: 10;
}

.ai-foxtech-service-close:before,
.ai-foxtech-service-close:after {
    content: "";
    position: absolute;
    width: 12px;
    height: 2px;
    background-color: #555;
}

.ai-foxtech-service-close:before {
    transform: rotate(45deg);
}

.ai-foxtech-service-close:after {
    transform: rotate(-45deg);
}

/* 新增动画效果 */
.ai-foxtech-service-container.active .ai-foxtech-service-iframe-container {
    display: block;
    animation: fadeIn 0.3s ease-in-out;
}

.ai-foxtech-service-container.slide-in .ai-foxtech-service-iframe-container {
    animation: slideIn 0.3s ease-in-out;
}

.ai-foxtech-service-button.pulse {
    animation: pulse 1s infinite;
}

.ai-foxtech-service-button.attention {
    animation: attention 1s ease-in-out;
}

@keyframes fadeIn {
    from { opacity: 0; }
    to { opacity: 1; }
}

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

@keyframes pulse {
    0% { transform: scale(1); }
    50% { transform: scale(1.05); }
    100% { transform: scale(1); }
}

@keyframes attention {
    0% { transform: scale(1); }
    20% { transform: scale(1.1); }
    40% { transform: scale(1); }
    60% { transform: scale(1.1); }
    80% { transform: scale(1); }
    100% { transform: scale(1); }
}

/* 移动端适配 - 保持与电脑端相同的位置 */
.ai-foxtech-service-container.mobile .ai-foxtech-service-button {
    /* 保持原有位置属性，不要固定在中间 */
    /* 不同位置设置不同的样式 */
    position: fixed;
    bottom: 10px;
    /* 位置属性保留使用JS设置的 right 或 left 值 */
}

.ai-foxtech-service-container.mobile .ai-foxtech-service-iframe-container {
    width: 90% !important;
    max-width: 350px !important;
    bottom: 70px;
    /* iframe容器位置响应按钮位置，不固定在中间 */
}

.ai-foxtech-service-container.mobile.active .ai-foxtech-service-button {
    /* 位置显示时移动按钮，保持原来的位置属性，仅上移 */
    transform: translateY(-60px);
}

/* 移动端自定义样式 */
@media (max-width: 768px) {
    /* 移动端针对不同显示方式的样式 */
    .ai-foxtech-service-container[data-mobile-type="text_only"] .ai-foxtech-service-button .ai-foxtech-service-icon,
    .ai-foxtech-service-button.text-only .ai-foxtech-service-icon {
        display: none !important;
    }
    
    .ai-foxtech-service-container[data-mobile-type="icon_only"] .ai-foxtech-service-button span,
    .ai-foxtech-service-button.icon-only span {
        display: none !important;
    }
    
    .ai-foxtech-service-container[data-mobile-type="icon_only"] .ai-foxtech-service-button,
    .ai-foxtech-service-button.icon-only {
        border-radius: 50% !important;
        width: 50px;
        height: 50px;
        padding: 0 !important;
    }
    
    .ai-foxtech-service-container[data-mobile-type="text_icon"] .ai-foxtech-service-button .ai-foxtech-service-icon,
    .ai-foxtech-service-button.text-icon .ai-foxtech-service-icon {
        margin-right: 5px;
    }
    
    /* 调整iframe容器的样式，保持与按钮的相对位置 */
    .ai-foxtech-service-iframe-container {
        max-width: 90% !important;
        width: calc(100% - 40px) !important;
        height: calc(80vh) !important;
        bottom: 80px;
    }
    
    .ai-foxtech-service-iframe-container iframe {
        width: 100% !important;
        height: calc(100% - 30px) !important;
    }
    
    /* 不同位置按钮的iframe容器位置响应 */
    .ai-foxtech-service-container.left .ai-foxtech-service-iframe-container {
        left: 20px;
        right: auto;
    }
    
    .ai-foxtech-service-container.right .ai-foxtech-service-iframe-container {
        right: 20px;
        left: auto;
    }
    
    /* 按钮样式调整，适配不同屏幕大小 */
    .ai-foxtech-service-button {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .ai-foxtech-service-button.icon-only {
        width: 50px;
        height: 50px;
    }
}

/* 按钮图标样式 */
.ai-foxtech-service-icon {
    display: inline-block;
    vertical-align: middle;
    /* 移除固定尺寸，使用内联样式控制 */
    max-width: 100%;
    height: auto;
}

/* 确保仅图标模式下的图标居中显示 */
.ai-foxtech-service-button.icon-only .ai-foxtech-service-icon {
    margin: 0 auto;
}

/* 确保文字+图标模式下的间距 */
.ai-foxtech-service-button.text-icon .ai-foxtech-service-icon {
    margin-right: 8px;
}

/* 不同图标显示方式的样式调整 */
.ai-foxtech-service-button.icon-only {
    border-radius: 50% !important;
    width: 60px;
    height: 60px;
    padding: 0 !important;
}

/* 主题预设样式 */
.ai-foxtech-service-container[data-theme="flat"] .ai-foxtech-service-iframe-container {
    border-radius: 4px;
}

.ai-foxtech-service-container[data-theme="flat"] .ai-foxtech-service-iframe-header {
    background-color: #2980b9;
    color: white;
}

.ai-foxtech-service-container[data-theme="flat"] .ai-foxtech-service-close {
    color: white;
}

.ai-foxtech-service-container[data-theme="rounded"] .ai-foxtech-service-iframe-container {
    border-radius: 15px;
}

.ai-foxtech-service-container[data-theme="dark"] .ai-foxtech-service-iframe-header {
    background-color: #212121;
    color: white;
}

.ai-foxtech-service-container[data-theme="dark"] .ai-foxtech-service-close {
    color: white;
}

.ai-foxtech-service-container[data-theme="light"] .ai-foxtech-service-iframe-header {
    background-color: #f5f5f5;
    border-bottom: 1px solid #eee;
}

/* 渐变主题特殊样式 - 修复渐变颜色问题 */
.ai-foxtech-service-container[data-theme="gradient_blue"] .ai-foxtech-service-button {
    background: linear-gradient(135deg, #2196F3, #0D47A1);
    color: #ffffff;
}

.ai-foxtech-service-container[data-theme="gradient_blue"] .ai-foxtech-service-button.breathing::before {
    border-color: #2196F3;
}

.ai-foxtech-service-container[data-theme="gradient_green"] .ai-foxtech-service-button {
    background: linear-gradient(135deg, #4CAF50, #1B5E20);
    color: #ffffff;
}

.ai-foxtech-service-container[data-theme="gradient_green"] .ai-foxtech-service-button.breathing::before {
    border-color: #4CAF50;
}

.ai-foxtech-service-container[data-theme="gradient_purple"] .ai-foxtech-service-button {
    background: linear-gradient(135deg, #9C27B0, #4A148C);
    color: #ffffff;
}

.ai-foxtech-service-container[data-theme="gradient_purple"] .ai-foxtech-service-button.breathing::before {
    border-color: #9C27B0;
}

.ai-foxtech-service-container[data-theme^="gradient_"] .ai-foxtech-service-button:hover {
    opacity: 0.9;
    transform: translateY(-3px);
}

/* 现代风格主题 */
.ai-foxtech-service-container[data-theme^="modern_"] .ai-foxtech-service-button {
    border-radius: 8px;
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.25);
    transition: all 0.3s cubic-bezier(0.175, 0.885, 0.32, 1.275);
}

.ai-foxtech-service-container[data-theme="modern_blue"] .ai-foxtech-service-button.breathing::before {
    border-color: #0277BD;
}

.ai-foxtech-service-container[data-theme="modern_green"] .ai-foxtech-service-button.breathing::before {
    border-color: #00695C;
}

.ai-foxtech-service-container[data-theme="modern_orange"] .ai-foxtech-service-button.breathing::before {
    border-color: #E65100;
}

.ai-foxtech-service-container[data-theme="modern_pink"] .ai-foxtech-service-button.breathing::before {
    border-color: #C2185B;
}

.ai-foxtech-service-container[data-theme="modern_dark"] .ai-foxtech-service-button.breathing::before {
    border-color: #263238;
}

.ai-foxtech-service-container[data-theme^="modern_"] .ai-foxtech-service-button:hover {
    transform: translateY(-5px) scale(1.02);
}

.ai-foxtech-service-container[data-theme^="modern_"] .ai-foxtech-service-iframe-container {
    border-radius: 8px;
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.25);
}

/* 柔和风格主题 */
.ai-foxtech-service-container[data-theme^="soft_"] .ai-foxtech-service-button {
    border-radius: 16px;
    box-shadow: 0 4px 12px rgba(0, 0, 0, 0.1);
    transition: all 0.3s ease;
}

.ai-foxtech-service-container[data-theme^="soft_"] .ai-foxtech-service-button:hover {
    transform: translateY(-3px);
    box-shadow: 0 6px 16px rgba(0, 0, 0, 0.15);
}

.ai-foxtech-service-container[data-theme^="soft_"] .ai-foxtech-service-iframe-container {
    border-radius: 16px;
    box-shadow: 0 8px 24px rgba(0, 0, 0, 0.1);
}

/* 行业特色主题 */
.ai-foxtech-service-container[data-theme="education"] .ai-foxtech-service-button,
.ai-foxtech-service-container[data-theme="healthcare"] .ai-foxtech-service-button,
.ai-foxtech-service-container[data-theme="finance"] .ai-foxtech-service-button,
.ai-foxtech-service-container[data-theme="ecommerce"] .ai-foxtech-service-button,
.ai-foxtech-service-container[data-theme="fashion"] .ai-foxtech-service-button,
.ai-foxtech-service-container[data-theme="tech"] .ai-foxtech-service-button {
    border-radius: 12px;
    box-shadow: 0 5px 15px rgba(0, 0, 0, 0.2);
}

/* 流行色彩主题 */
.ai-foxtech-service-container[data-theme^="trendy_"] .ai-foxtech-service-button {
    border-radius: 20px;
    box-shadow: 0 6px 18px rgba(0, 0, 0, 0.15);
    transition: all 0.3s cubic-bezier(0.25, 0.46, 0.45, 0.94);
}

.ai-foxtech-service-container[data-theme^="trendy_"] .ai-foxtech-service-button:hover {
    transform: translateY(-4px) scale(1.03);
    box-shadow: 0 8px 25px rgba(0, 0, 0, 0.2);
}

.ai-foxtech-service-container[data-theme^="trendy_"] .ai-foxtech-service-iframe-container {
    border-radius: 20px;
    box-shadow: 0 15px 35px rgba(0, 0, 0, 0.15);
}

/* 适配手机端 */
@media (max-width: 767px) {
    .ai-foxtech-service-iframe-container {
        width: calc(100% - 40px) !important;
        height: calc(80vh) !important;
        left: 50% !important;
        right: auto !important;
        transform: translateX(-50%);
        bottom: 80px;
    }
    
    .ai-foxtech-service-iframe-container iframe {
        width: 100% !important;
        height: calc(100% - 30px) !important;
    }
    
    .ai-foxtech-service-button {
        padding: 10px 16px;
        font-size: 14px;
    }
    
    .ai-foxtech-service-button.icon-only {
        width: 50px;
        height: 50px;
    }
}

/* 基础颜色系列外圈动画效果 */
.ai-foxtech-service-container[data-theme="blue"] .ai-foxtech-service-button.breathing::before {
    border-color: #1E88E5;
}

.ai-foxtech-service-container[data-theme="green"] .ai-foxtech-service-button.breathing::before {
    border-color: #43A047;
}

.ai-foxtech-service-container[data-theme="red"] .ai-foxtech-service-button.breathing::before {
    border-color: #E53935;
}

.ai-foxtech-service-container[data-theme="purple"] .ai-foxtech-service-button.breathing::before {
    border-color: #8E24AA;
}

.ai-foxtech-service-container[data-theme="orange"] .ai-foxtech-service-button.breathing::before {
    border-color: #FB8C00;
}

/* 暗黑与浅色主题外圈 */
.ai-foxtech-service-container[data-theme="dark"] .ai-foxtech-service-button.breathing::before {
    border-color: #555555;
}

.ai-foxtech-service-container[data-theme="light"] .ai-foxtech-service-button.breathing::before {
    border-color: #999999;
}

/* 风格样式外圈 */
.ai-foxtech-service-container[data-theme="flat"] .ai-foxtech-service-button.breathing::before {
    border-color: #3498db;
}

.ai-foxtech-service-container[data-theme="rounded"] .ai-foxtech-service-button.breathing::before {
    border-color: #3C5EFD;
}

/* 柔和风格主题外圈 */
.ai-foxtech-service-container[data-theme^="soft_"] .ai-foxtech-service-button.breathing::before {
    opacity: 0.4;
    animation: soft-pulse-ring 3s infinite ease-in-out;
}

.ai-foxtech-service-container[data-theme="soft_blue"] .ai-foxtech-service-button.breathing::before {
    border-color: #0d47a1;
}

.ai-foxtech-service-container[data-theme="soft_green"] .ai-foxtech-service-button.breathing::before {
    border-color: #1b5e20;
}

.ai-foxtech-service-container[data-theme="soft_peach"] .ai-foxtech-service-button.breathing::before {
    border-color: #bf360c;
}

@keyframes soft-pulse-ring {
    0% {
        transform: scale(1);
        opacity: 0.1;
    }
    50% {
        transform: scale(1.05);
        opacity: 0.4;
    }
    100% {
        transform: scale(1);
        opacity: 0.1;
    }
}

/* 仅图标模式的外圈动画优化 */
.ai-foxtech-service-button.icon-only.breathing::before {
    top: -6px;
    left: -6px;
    right: -6px;
    bottom: -6px;
    border-radius: 50%;
    border-width: 3px;
}

/* 仅文字模式的外圈动画优化 */
.ai-foxtech-service-button.text-only.breathing::before {
    border-width: 2px;
}

/* 确保外圈效果在移动设备上也能正常显示 */
@media (max-width: 768px) {
    .ai-foxtech-service-button.breathing::before {
        top: -3px;
        left: -3px;
        right: -3px;
        bottom: -3px;
        border-width: 2px;
    }
    
    .ai-foxtech-service-button.icon-only.breathing::before {
        top: -4px;
        left: -4px;
        right: -4px;
        bottom: -4px;
    }
} 