/* Foreign Service - 外贸客服插件样式 */
.foreign-service-wrapper {
    position: fixed;
    bottom: 80px;
    right: 20px;
    
    z-index: 9999;
    font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', Roboto, 'Helvetica Neue', Arial, sans-serif;
}

.fs-card {
    width: 280px;
    background: #ffffff;
    border-radius: 16px;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.15), 0 0 0 1px rgba(0, 0, 0, 0.05);
    overflow: hidden;
    transition: all 0.3s ease;
}

.fs-header {
    padding: 16px;
    background: linear-gradient(135deg, #2890ff 0%, #48a0ff 100%);
    color: #ffffff;
    display: flex;
    align-items: center;
    gap: 12px;
}

.fs-avatar {
    width: 44px;
    height: 44px;
    border-radius: 50%;
    overflow: hidden;
    background: rgba(255, 255, 255, 0.2);
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fs-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
}

.fs-avatar i {
    font-size: 20px;
    color: #ffffff;
}

.fs-title-group {
    flex: 1;
    min-width: 0;
}

.fs-title {
    font-size: 16px;
    font-weight: 600;
    line-height: 1.3;
}

.fs-subtitle {
    font-size: 12px;
    opacity: 0.85;
    margin-top: 2px;
}

.fs-toggle {
    cursor: pointer;
    padding: 4px;
    transition: transform 0.3s ease;
}

.fs-toggle i {
    font-size: 14px;
    transition: transform 0.3s ease;
}

.fs-card.fs-card-collapsed .fs-toggle i {
    transform: rotate(180deg);
}

.fs-body {
    max-height: 400px;
    overflow-y: auto;
    transition: max-height 0.3s ease;
}

.fs-card.fs-card-collapsed .fs-body {
    max-height: 0;
}

.fs-list {
    padding: 8px;
}

.fs-item {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px;
    border-radius: 10px;
    color: #333;
    text-decoration: none;
    transition: all 0.2s ease;
    margin-bottom: 4px;
}

.fs-item:last-child {
    margin-bottom: 0;
}

.fs-item:hover {
    background: #f8f9fa;
    transform: translateX(-2px);
}

.fs-icon-wrap {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    background: var(--fs-color, #2890ff);
    color: #ffffff;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
}

.fs-icon-wrap i {
    font-size: 16px;
}

.fs-item-label {
    font-size: 14px;
    font-weight: 500;
}

.fs-mini {
    position: fixed;
    bottom: 80px;
    right: 20px;
    
    width: 50px;
    height: 50px;
    border-radius: 50%;
    background: linear-gradient(135deg, #2890ff 0%, #48a0ff 100%);
    color: #ffffff;
    display: none;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: 0 8px 24px rgba(40, 144, 255, 0.4);
    transition: all 0.3s ease;
    z-index: 9998;
}

.fs-mini:hover {
    transform: scale(1.1);
    box-shadow: 0 12px 32px rgba(40, 144, 255, 0.5);
}

/* ===== PC端默认状态（>768px） ===== */
/* PC端：默认展开卡片，fs-mini 隐藏 */
@media (min-width: 769px) {
    .foreign-service-wrapper.fs-card-collapsed ~ .fs-mini,
    .fs-mini.fs-show {
        display: flex;
    }
}

/* ===== 移动端默认状态（<=768px） ===== */
@media (max-width: 768px) {
    /* 移动端：默认显示 fs-mini，卡片隐藏 */
    .foreign-service-wrapper {
        display: none;
    }
    
    .fs-mini {
        display: flex;
        right: 15px;
        bottom: 80px;
        width: 44px;
        height: 44px;
    }
    
    /* 移动端展开卡片时 */
    .foreign-service-wrapper.fs-mobile-open {
        display: block;
    }
    
    .foreign-service-wrapper.fs-mobile-open ~ .fs-mini {
        display: none;
    }
}

.fs-mini img {
    width: 100%;
    height: 100%;
    border-radius: 50%;
    object-fit: cover;
}

.fs-mini i {
    font-size: 20px;
}

.fs-mini-dot {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 12px;
    height: 12px;
    background: #10b981;
    border-radius: 50%;
    border: 2px solid #ffffff;
    animation: fs-pulse 2s infinite;
}

@keyframes fs-pulse {
    0% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0.7); }
    70% { box-shadow: 0 0 0 8px rgba(16, 185, 129, 0); }
    100% { box-shadow: 0 0 0 0 rgba(16, 185, 129, 0); }
}

.fs-back-top {
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 4px;
    padding: 10px;
    margin-top: 8px;
    border-top: 1px solid #f0f0f0;
    color: #666;
    text-decoration: none;
    font-size: 13px;
    transition: color 0.2s ease;
}

.fs-back-top:hover {
    color: #2890ff;
}

.fs-qr-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
}

.fs-qr-modal.active {
    display: flex;
}

.fs-qr-overlay {
    position: absolute;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0, 0, 0, 0.7);
    backdrop-filter: blur(4px);
}

.fs-qr-content {
    position: relative;
    z-index: 1;
    background: #ffffff;
    padding: 24px;
    border-radius: 16px;
    text-align: center;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.3);
}

.fs-qr-content img {
    width: 200px;
    height: 200px;
    object-fit: contain;
    border-radius: 8px;
}

.fs-qr-tip {
    margin-top: 16px;
    font-size: 14px;
    color: #666;
}

/* Embedded mode */
.fs-embed {
    position: static;
    display: inline-block;
    margin: 10px 0;
}

.fs-embed .fs-card {
    width: 100%;
    max-width: 320px;
}

.fs-embed .fs-mini {
    display: none;
}

/* Responsive */
@media (max-width: 768px) {
    .foreign-service-wrapper {
        right: 15px;
        bottom: 80px;
    }
    
    .foreign-service-wrapper.fs-left {
        left: 15px;
    }
    
    .fs-card {
        width: 260px;
    }
    
    .fs-mini {
        right: 15px;
        bottom: 80px;
        width: 44px;
        height: 44px;
    }
}