/* =========================================================
   components/kf-panel.css —— 客服浮窗样式（微信/电话/AI + 拖拽）
   ========================================================= */
/* ===== 客服浮窗 ===== */
.kf-float {
    position: fixed;
    right: 20px;
    top: 50%;
    transform: translateY(-50%);
    z-index: 9999;
    display: flex;
    align-items: center;
    gap: 12px;
    font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
}
/* 拖拽后（PC 与移动端通用）：切换为由 JS 设置的 left/top 定位，清除默认的右侧/居中定位 */
.kf-float.kf-dragging,
.kf-float.kf-moved {
    right: auto;
    bottom: auto;
    top: auto;
    transform: none;
}
.kf-float.kf-dragging {
    transition: none;
    user-select: none;
    cursor: grabbing;
}
/* PC 端浮窗支持拖拽：面板显示可抓取光标 */
.kf-panel {
    cursor: grab;
}
.kf-float.kf-dragging .kf-panel {
    cursor: grabbing;
}
.kf-pop {
    width: 420px;
    min-height: 480px;
    background: #fff;
    border-radius: 24px;
    box-shadow: 0 20px 60px rgba(0, 0, 0, 0.18);
    border: 1px solid rgba(226, 232, 240, 0.5);
    overflow: hidden;
    display: none;
    flex-direction: column;
    position: relative;
}
.kf-pop.show {
    display: flex;
    animation: popIn 0.25s ease;
}
.kf-pop::after {
    content: "";
    position: absolute;
    right: -7px;
    top: 80px;
    width: 14px;
    height: 14px;
    background: #fff;
    transform: rotate(45deg);
    border-right: 1px solid rgba(226, 232, 240, 0.5);
    border-top: 1px solid rgba(226, 232, 240, 0.5);
}
@keyframes popIn {
    from {
        opacity: 0;
        transform: translateX(12px) scale(0.96);
    }
    to {
        opacity: 1;
        transform: translateX(0) scale(1);
    }
}
.kf-header {
    height: 56px;
    background: linear-gradient(135deg, #3A70EE, #6366F1);
    color: #fff;
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 0 20px;
    flex-shrink: 0;
}
.kf-header-left {
    display: flex;
    align-items: center;
    gap: 10px;
    font-size: 15px;
    font-weight: 600;
}
.kf-header-avatar {
    width: 32px;
    height: 32px;
    border-radius: 50%;
    overflow: hidden;
    background: #fff;
    flex-shrink: 0;
    border: 2px solid rgba(255, 255, 255, 0.3);
}
.kf-header-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.kf-close {
    border: none;
    background: transparent;
    color: #fff;
    font-size: 28px;
    cursor: pointer;
    line-height: 1;
    opacity: 0.7;
    transition: opacity 0.2s;
}
.kf-close:hover {
    opacity: 1;
}
.kf-body {
    flex: 1;
    padding: 20px 24px;
    overflow: auto;
    background: #fafbff;
}
.kf-tip {
    background: #ffffff;
    border: 1px solid #e8edf7;
    border-radius: 12px;
    padding: 14px 16px;
    color: #334155;
    font-size: 14px;
    line-height: 1.7;
    margin-bottom: 14px;
    text-align: center;
}
.kf-chat {
    display: flex;
    flex-direction: column;
    gap: 14px;
}
.kf-system-msg {
    align-self: center;
    background: #eef2f7;
    color: rgba(0, 0, 0, 0.65);
    border-radius: 10px;
    padding: 6px 14px;
    font-size: 12px;
}
.kf-msg-row {
    display: flex;
    align-items: flex-start;
    gap: 10px;
}
.kf-avatar {
    width: 36px;
    height: 36px;
    border-radius: 50%;
    overflow: hidden;
    flex-shrink: 0;
}
.kf-avatar img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block;
}
.kf-msg-wrap {
    display: flex;
    flex-direction: column;
    gap: 2px;
}
.kf-name-row {
    font-size: 12px;
    color: #94a3b8;
}
.kf-bubble {
    max-width: 280px;
    background: #ffffff;
    color: #334155;
    border-radius: 14px;
    padding: 10px 14px;
    font-size: 14px;
    line-height: 1.6;
    border: 1px solid #e8edf7;
    box-shadow: 0 2px 8px rgba(0, 0, 0, 0.04);
}
.kf-footer {
    flex-shrink: 0;
    border-top: 1px solid #EAF1FE;
    background: #fff;
    padding: 12px 16px 16px;
}
.kf-input-row {
    display: flex;
    align-items: center;
    gap: 10px;
    border: 1px solid #dce3f0;
    border-radius: 999px;
    padding: 8px 12px 8px 16px;
    background: #fff;
    transition: border-color 0.2s;
}
.kf-input-row:focus-within {
    border-color: #3A70EE;
    box-shadow: 0 0 0 3px rgba(58, 112, 238, 0.1);
}
.kf-input-icon {
    width: 20px;
    height: 20px;
    border-radius: 50%;
    border: 1px solid #dce3f0;
    display: flex;
    align-items: center;
    justify-content: center;
    color: #94a3b8;
    flex-shrink: 0;
    font-size: 12px;
}
.kf-input {
    flex: 1;
    border: none;
    outline: none;
    font-size: 14px;
    color: rgba(0, 0, 0, 0.88);
    background: transparent;
    min-width: 0;
}
.kf-input::placeholder {
    color: #a0aec0;
}
.kf-send {
    width: 34px;
    height: 34px;
    border-radius: 50%;
    border: none;
    background: linear-gradient(135deg, #3A70EE, #6366F1);
    color: #fff;
    cursor: pointer;
    display: flex;
    align-items: center;
    justify-content: center;
    flex-shrink: 0;
    transition: transform 0.2s;
}
.kf-send:hover {
    transform: scale(1.05);
}
.kf-powered {
    text-align: center;
    font-size: 11px;
    color: #94a3b8;
    margin-top: 8px;
}
.kf-powered a {
    color: #3A70EE;
    text-decoration: none;
}
.info-card {
    background: #fff;
    border: 1px solid #e8edf7;
    border-radius: 16px;
    padding: 20px 24px;
    box-shadow: 0 4px 16px rgba(0, 0, 0, 0.04);
}
.info-title {
    font-size: 18px;
    font-weight: 700;
    color: #1f2937;
    text-align: center;
    margin-bottom: 6px;
}
.info-subtitle {
    font-size: 14px;
    color: rgba(0, 0, 0, 0.65);
    text-align: center;
    line-height: 1.6;
}
.qr-wrap {
    max-width: 200px;
    margin: 16px auto 0;
    padding: 12px;
    border-radius: 12px;
    background: #fff;
    border: 1px solid #e8edf7;
}
.qr-wrap img {
    width: 100%;
    height: auto;
    display: block;
    border-radius: 8px;
}
.phone-block {
    margin-top: 16px;
    text-align: center;
    padding: 16px 14px;
    border-radius: 14px;
    background: #fef7f0;
    border: 1px solid #fde4c9;
}
.phone-block .phone-number {
    font-size: 28px;
    font-weight: 800;
    color: #ef4444;
    letter-spacing: 1px;
    margin-top: 4px;
}
.phone-block .phone-time {
    font-size: 13px;
    color: #94a3b8;
    margin-top: 6px;
}
.kf-pop-phone {
    min-height: 0;
    height: 340px;
}
.kf-phone-body {
    padding: 16px 20px 20px;
    display: flex;
    align-items: center;
}
.kf-phone-body .info-card {
    width: 100%;
}
.kf-panel {
    width: 72px;
    background: #fff;
    border-radius: 28px;
    box-shadow: 0 12px 40px rgba(58, 112, 238, 0.14);
    padding: 12px 0;
    overflow: hidden;
    border: 1px solid rgba(226, 232, 240, 0.5);
    display: flex;
    flex-direction: column;
    align-items: center;
    align-self: flex-start;
}
.kf-badge {
    position: absolute;
    right: -2px;
    top: -2px;
    width: 15px;
    height: 15px;
    border-radius: 50%;
    background: #ef4444;
    color: #fff;
    font-size: 9px;
    line-height: 15px;
    text-align: center;
    font-weight: 700;
    border: 2px solid #fff;
    z-index: 2;
    box-shadow: 0 2px 6px rgba(239, 68, 68, 0.4);
}
.kf-menu {
    display: flex;
    flex-direction: column;
    align-items: center;
    width: 100%;
    padding: 0 6px;
}
.kf-item {
    width: 100%;
    border: none;
    background: transparent;
    padding: 4px 0;
    text-align: center;
    cursor: pointer;
    color: #94a3b8;
    font-size: 11px;
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 2px;
    transition: all 0.2s ease;
    border-radius: 10px;
}
.kf-item:hover {
    color: #3A70EE;
				background: rgba(58, 112, 238, 0.08);
}
.kf-item.active {
    color: #3A70EE;
    font-weight: 600;
				background: rgba(58, 112, 238, 0.08);
}
.kf-item .kf-icon {
    position: relative;
    font-size: 20px;
    width: 34px;
    height: 34px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 10px;
    transition: background 0.2s;
}
.kf-item span:last-child {
    font-size: 10px;
}
.kf-divider {
    width: 44px;
    height: 1px;
    background: linear-gradient(90deg, transparent, rgba(203, 213, 225, 0.5), transparent);
    margin: 4px auto;
}

/* ===== 客服浮窗响应式 ===== */
@media (max-width: 1024px) {
    .kf-float {
        right: 12px;
    }
    .kf-pop {
        width: 360px;
        min-height: 420px;
    }
}
@media (max-width: 1024px) {
    /* 客服浮窗：底部居中，弹窗近全屏，避免遮挡与溢出（与导航栏移动端断点保持一致） */
    .kf-float {
        right: 8px;
        bottom: 12px;
        top: auto;
        transform: none;
        gap: 8px;
        align-items: flex-end;
    }
    /* 拖拽后：切换为绝对定位，由 JS 设置 left/top */
    .kf-float.kf-dragging,
    .kf-float.kf-moved {
        right: auto;
        bottom: auto;
        transform: none;
    }
    .kf-float.kf-dragging {
        transition: none;
        user-select: none;
    }
    .kf-pop {
        position: fixed;
        left: 12px;
        right: 12px;
        bottom: 12px;
        top: auto;
        width: auto;
        min-height: 0;
        max-height: 78vh;
        border-radius: 18px;
    }
    .kf-pop.kf-pop-phone {
        height: auto;
    }
    /* 移动端：面板收窄，只保留图标，隐藏文字 */
    .kf-panel {
        width: 60px;
        padding: 8px 0;
        cursor: grab;
        touch-action: none;
    }
    .kf-float.kf-dragging .kf-panel {
        cursor: grabbing;
    }
    .kf-item {
        padding: 7px 0;
    }
    /* 隐藏客服项文字（在线/微信/电话/AI），仅保留图标 */
    .kf-item span:last-child {
        display: none;
    }
    .kf-divider {
        width: 32px;
        margin: 2px auto;
    }
    .kf-pop::after {
        display: none;
    }
    .kf-bubble {
        max-width: 100%;
    }
}


/* ===== 客服浮窗窄屏适配 ===== */
@media (max-width: 640px) {
    .kf-item { padding: 2px 0; }
}