/* 在线客服弹层（fyui-kefu-v1.css）
 * 改内容要换文件名（→ fyui-kefu-v3.css），多吉云 CDN 按 URL 缓存、忽略 ?ver=
 * 变量前缀 kf- 独立定义，不依赖全站 CSS 是否加载
 */

.fy-kf {
    --kf-c1: #ff5f33;
    --kf-c2: #ff8a52;
    --kf-ink: #211b17;
    --kf-ink2: #514840;
    --kf-ink3: #8e837a;
    --kf-line: #eae4de;
    --kf-soft: #faf8f6;
    --kf-ok: #199a5b;
    position: fixed;
    inset: 0;
    z-index: 999999;
    display: none;
    align-items: center;
    justify-content: center;
    padding: 24px;
    box-sizing: border-box;
}

.fy-kf.is-open {
    display: flex;
}

.fy-kf *,
.fy-kf *::before,
.fy-kf *::after {
    box-sizing: border-box;
}

.fy-kf-mask {
    position: absolute;
    inset: 0;
    background: rgba(33, 27, 23, .44);
    -webkit-backdrop-filter: blur(3px);
    backdrop-filter: blur(3px);
    animation: fy-kf-fade .18s ease both;
}

.fy-kf-panel {
    position: relative;
    z-index: 1;
    width: 100%;
    max-width: 404px;
    background: #fff;
    border-radius: 22px;
    overflow: hidden;
    box-shadow: 0 26px 70px rgba(33, 27, 23, .26), 0 2px 8px rgba(33, 27, 23, .06);
    animation: fy-kf-in .24s cubic-bezier(.2, .8, .3, 1) both;
    color: var(--kf-ink);
    font-size: 14px;
    line-height: 1.6;
    text-align: left;
}

/* 关闭 */
.fy-kf-x {
    position: absolute;
    top: 14px;
    right: 14px;
    z-index: 2;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .82);
    color: var(--kf-ink3);
    display: flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    line-height: 1;
    transition: background .16s, color .16s, transform .16s;
}

.fy-kf-x:hover {
    background: #fff;
    color: var(--kf-ink);
    transform: rotate(90deg);
}

/* 头部 */
.fy-kf-head {
    display: flex;
    align-items: center;
    gap: 13px;
    padding: 22px 54px 18px 22px;
    background: linear-gradient(135deg, #fff3ed 0%, #fffaf6 100%);
    border-bottom: 1px solid var(--kf-line);
}

.fy-kf-badge {
    flex: 0 0 44px;
    width: 44px;
    height: 44px;
    border-radius: 14px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: linear-gradient(135deg, var(--kf-c1), var(--kf-c2));
    color: #fff;
    box-shadow: 0 8px 20px rgba(255, 95, 51, .28);
}

.fy-kf-badge svg {
    display: block;
}

.fy-kf-headtxt {
    min-width: 0;
}

.fy-kf-headtxt h3 {
    margin: 0 0 3px;
    padding: 0;
    font-size: 16.5px;
    font-weight: 700;
    line-height: 1.3;
    color: var(--kf-ink);
    letter-spacing: .01em;
}

.fy-kf-headtxt p {
    margin: 0;
    padding: 0;
    font-size: 12.5px;
    line-height: 1.5;
    color: var(--kf-ink3);
}

.fy-kf-note {
    margin: 14px 22px 0;
    padding: 10px 13px;
    border-radius: 11px;
    background: #fff4ee;
    border: 1px solid #ffe0d2;
    font-size: 12.5px;
    line-height: 1.6;
    color: #b8471f;
}

/* 内容 */
.fy-kf-body {
    padding: 16px 22px 22px;
}

.fy-kf-row {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 11px 12px;
    margin-bottom: 9px;
    border: 1px solid var(--kf-line);
    border-radius: 14px;
    background: #fff;
    transition: border-color .16s, box-shadow .16s;
}

.fy-kf-row:hover {
    border-color: #f3cbb9;
    box-shadow: 0 4px 14px rgba(255, 95, 51, .07);
}

.fy-kf-ico {
    flex: 0 0 26px;
    width: 26px;
    height: 26px;
    border-radius: 9px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: #fff1ea;
    color: var(--kf-c1);
}

.fy-kf-ico svg {
    display: block;
}

.fy-kf-label {
    flex: 0 0 auto;
    font-size: 12.5px;
    color: var(--kf-ink3);
    letter-spacing: .02em;
}

.fy-kf-val {
    flex: 1 1 auto;
    min-width: 0;
    font-size: 15.5px;
    font-weight: 700;
    color: var(--kf-ink);
    font-variant-numeric: tabular-nums;
    letter-spacing: .03em;
    word-break: break-all;
    /* 复制失败时脚本会把这段选中，让用户直接 Ctrl+C */
    -webkit-user-select: text;
    user-select: text;
    cursor: text;
}

.fy-kf-copy {
    flex: 0 0 auto;
    display: inline-flex;
    align-items: center;
    gap: 5px;
    height: 28px;
    padding: 0 11px;
    border: 1px solid #ffd9c9;
    border-radius: 999px;
    background: #fff6f1;
    color: #d4501f;
    font-size: 12px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    transition: background .16s, color .16s, border-color .16s;
    -webkit-tap-highlight-color: transparent;
}

.fy-kf-copy:hover {
    background: #ffeade;
    border-color: #ffc3ab;
}

.fy-kf-copy svg {
    display: block;
    flex: 0 0 auto;
}

.fy-kf-copy.is-done {
    background: #effaf3;
    border-color: #bfe6cd;
    color: var(--kf-ok);
}

/* 二维码 */
.fy-kf-qr {
    margin-top: 13px;
    padding: 14px 14px 12px;
    border: 1px dashed #f2d6c8;
    border-radius: 16px;
    background: #fffaf7;
    text-align: center;
}

.fy-kf-qr img {
    display: block;
    width: 152px;
    height: 152px;
    max-width: 100%;
    margin: 0 auto 9px;
    object-fit: contain;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 2px 10px rgba(33, 27, 23, .06);
}

.fy-kf-qr span {
    display: block;
    font-size: 12.5px;
    color: var(--kf-ink3);
    letter-spacing: .02em;
}

/* 提示 */
.fy-kf-tips {
    margin: 16px 0 0;
    padding: 0;
    list-style: none;
    font-size: 12.5px;
    line-height: 1.72;
    color: var(--kf-ink3);
}

.fy-kf-tips li {
    position: relative;
    margin: 0 0 4px;
    padding-left: 15px;
    list-style: none;
}

.fy-kf-tips li::before {
    content: '';
    position: absolute;
    left: 2px;
    top: 8px;
    width: 5px;
    height: 5px;
    border-radius: 50%;
    background: #e8bda9;
}

.fy-kf-tips li:last-child {
    margin-bottom: 0;
}

.fy-kf-tips b {
    color: var(--kf-ink2);
    font-weight: 600;
}

/* 弹层打开时压掉主题微信图标 hover 的大图，避免两个二维码打架 */
body.fy-kf-open .rollbar .wx-li img {
    display: none !important;
}

body.fy-kf-open {
    overflow: hidden;
}

@keyframes fy-kf-fade {
    from { opacity: 0; }
    to { opacity: 1; }
}

@keyframes fy-kf-in {
    from { opacity: 0; transform: translateY(12px) scale(.97); }
    to { opacity: 1; transform: none; }
}

@keyframes fy-kf-up {
    from { transform: translateY(100%); }
    to { transform: none; }
}

/* 移动端：底部抽屉 */
@media (max-width: 620px) {
    .fy-kf {
        padding: 0;
        align-items: flex-end;
    }

    .fy-kf-panel {
        max-width: none;
        max-height: 92vh;
        overflow-y: auto;
        -webkit-overflow-scrolling: touch;
        border-radius: 22px 22px 0 0;
        animation: fy-kf-up .26s cubic-bezier(.2, .8, .3, 1) both;
        padding-bottom: env(safe-area-inset-bottom, 0px);
    }

    .fy-kf-head {
        padding: 18px 52px 15px 18px;
    }

    .fy-kf-badge {
        flex-basis: 40px;
        width: 40px;
        height: 40px;
        border-radius: 13px;
    }

    .fy-kf-body {
        padding: 14px 18px 20px;
    }

    .fy-kf-note {
        margin: 12px 18px 0;
    }

    .fy-kf-qr img {
        width: 138px;
        height: 138px;
    }
}

@media (prefers-reduced-motion: reduce) {
    .fy-kf-mask,
    .fy-kf-panel {
        animation: none !important;
    }
}
