/* === 客服窗口插件 === */
.em-kefu {
    --kc: #07c160;
    position: fixed; z-index: 9996;
    font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
}
.em-kefu--bl { bottom: 20px; left: 20px; }
.em-kefu--br { bottom: 20px; right: 20px; }

/* === 悬浮按钮 === */
.em-kefu__toggle {
    width: 54px; height: 54px; border-radius: 50%;
    border: none; cursor: pointer;
    background: var(--kc); color: #fff;
    box-shadow: 0 4px 20px rgba(7, 193, 96, 0.35);
    display: flex; align-items: center; justify-content: center;
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    position: relative;
    overflow: hidden;
}
.em-kefu__toggle:hover { transform: scale(1.1); box-shadow: 0 6px 24px rgba(7, 193, 96, 0.5); }
.em-kefu__toggle.active { transform: scale(0.9); }
.em-kefu__icon-img { width: 100%; height: 100%; object-fit: cover; border-radius: 50%; pointer-events: none; }
.em-kefu__toggle::before {
    content: ''; position: absolute; inset: -4px;
    border-radius: 50%; border: 2px solid var(--kc);
    opacity: 0; animation: em-kefu-pulse 2s ease-in-out infinite;
}
@keyframes em-kefu-pulse { 0% { opacity: 0.5; transform: scale(1); } 100% { opacity: 0; transform: scale(1.5); } }

/* === 角标 === */
.em-kefu__badge {
    position: absolute; top: -4px; right: -4px;
    min-width: 18px; height: 18px; border-radius: 9px;
    background: #ff4d4f; color: #fff; font-size: 11px;
    display: flex; align-items: center; justify-content: center;
    padding: 0 4px; font-weight: 600;
    box-shadow: 0 1px 4px rgba(255, 77, 79, 0.4);
}

/* === 面板 === */
.em-kefu__panel {
    position: absolute; bottom: 64px; right: 0;
    width: 320px; max-width: calc(100vw - 40px);
    background: #fff; border-radius: 16px;
    box-shadow: 0 8px 40px rgba(0, 0, 0, 0.15);
    opacity: 0; visibility: hidden; transform: translateY(10px) scale(0.95);
    transition: all 0.3s cubic-bezier(0.34, 1.56, 0.64, 1);
    overflow: hidden;
}
.em-kefu__panel.open { opacity: 1; visibility: visible; transform: translateY(0) scale(1); }
.em-kefu--bl .em-kefu__panel { right: auto; left: 0; }

/* === 头部 === */
.em-kefu__header {
    display: flex; align-items: center; justify-content: space-between;
    padding: 16px; background: var(--kc); color: #fff;
}
.em-kefu__header-info { display: flex; align-items: center; gap: 10px; }
.em-kefu__avatar {
    width: 40px; height: 40px; border-radius: 50%;
    background: rgba(255, 255, 255, 0.2);
    display: flex; align-items: center; justify-content: center;
    position: relative; flex-shrink: 0;
}
.em-kefu__online {
    position: absolute; bottom: 0; right: 0;
    width: 10px; height: 10px; border-radius: 50%;
    background: #52c41a; border: 2px solid #fff;
}
.em-kefu__panel-title { font-size: 15px; font-weight: 600; }
.em-kefu__panel-sub { font-size: 12px; opacity: 0.8; margin-top: 2px; }
.em-kefu__close { background: none; border: none; color: #fff; font-size: 24px; cursor: pointer; padding: 0; line-height: 1; opacity: 0.7; transition: opacity 0.2s; }
.em-kefu__close:hover { opacity: 1; }

/* === 内容区 === */
.em-kefu__body { padding: 14px 16px; }

.em-kefu__welcome {
    background: #f5f5f5; border-radius: 10px; padding: 10px 12px;
    font-size: 13px; color: #666; margin-bottom: 12px;
    line-height: 1.5; position: relative;
}
.em-kefu__welcome::before {
    content: ''; position: absolute; left: -6px; top: 14px;
    width: 0; height: 0;
    border-top: 5px solid transparent; border-bottom: 5px solid transparent;
    border-right: 6px solid #f5f5f5;
}

/* === 联系方式列表 === */
.em-kefu__list { display: flex; flex-direction: column; gap: 2px; }
.em-kefu__item {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 8px; border-radius: 10px;
    text-decoration: none; color: inherit; cursor: pointer;
    transition: background 0.2s;
}
.em-kefu__item:hover { background: #f5f5f5; }
.em-kefu__item-icon {
    width: 36px; height: 36px; border-radius: 8px;
    display: flex; align-items: center; justify-content: center;
    color: #fff; flex-shrink: 0;
}
.em-kefu__item-icon--qq { background: #12b7f5; }
.em-kefu__item-icon--wechat { background: #07c160; }
.em-kefu__item-icon--phone { background: #ff6b6b; }
.em-kefu__item-icon--email { background: #4e6ef2; }
.em-kefu__item-info { flex: 1; min-width: 0; }
.em-kefu__item-label { font-size: 13px; color: #999; margin-bottom: 1px; }
.em-kefu__item-value { font-size: 14px; color: #333; font-weight: 500; }
.em-kefu__item-arrow { font-size: 18px; color: #ccc; flex-shrink: 0; }

/* === 微信二维码 === */
.em-kefu__qr {
    display: none; align-items: center; flex-direction: column;
    padding: 12px; background: #f9f9f9; border-radius: 10px; margin-top: 4px;
}
.em-kefu__qr.show { display: flex; }
.em-kefu__qr img { width: 140px; height: 140px; object-fit: contain; border-radius: 8px; background: #fff; padding: 4px; }
.em-kefu__qr-tip { font-size: 12px; color: #999; margin-top: 8px; }

/* === 工作时间 === */
.em-kefu__worktime {
    display: flex; align-items: center; gap: 6px;
    margin-top: 12px; padding-top: 12px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px; color: #999;
}

@media (max-width: 480px) {
    .em-kefu__panel { width: calc(100vw - 40px); }
    .em-kefu--bl, .em-kefu--br { bottom: 12px; }
    .em-kefu--bl { left: 12px; }
    .em-kefu--br { right: 12px; }
}
