/* 全站右侧悬浮快捷按钮 + 在线客服（2026-11-29） */
.kf-rail {
    position: fixed;
    right: 18px;
    top: 50%;
    z-index: 99998;
    display: flex;
    flex-direction: column;
    gap: 10px;
    -webkit-transform: translateY(-50%);
    transform: translateY(-50%);
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
}
.kf-item {
    position: relative;
    display: -webkit-box;
    display: -ms-flexbox;
    display: flex;
    -webkit-box-align: center;
    -ms-flex-align: center;
    align-items: center;
    -webkit-box-pack: center;
    -ms-flex-pack: center;
    justify-content: center;
    width: 46px;
    height: 46px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    color: #fff !important;
    text-decoration: none !important;
    cursor: pointer;
    box-shadow: 0 8px 22px rgba(74, 35, 14, .22);
    transition: transform .18s ease, box-shadow .18s ease, filter .18s ease;
    -webkit-tap-highlight-color: transparent;
}
.kf-item svg {
    width: 22px;
    height: 22px;
    display: block;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}
.kf-item:hover, .kf-item:focus {
    transform: translateX(-3px) scale(1.04);
    box-shadow: 0 12px 26px rgba(74, 35, 14, .28);
    filter: brightness(1.04);
    outline: none;
}
.kf-tip {
    position: absolute;
    right: 58px;
    top: 50%;
    -webkit-transform: translateY(-50%) translateX(4px);
    transform: translateY(-50%) translateX(4px);
    padding: 6px 10px;
    border-radius: 7px;
    background: rgba(43, 31, 23, .94);
    color: #fff;
    font-size: 12px;
    line-height: 1.3;
    white-space: nowrap;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    transition: opacity .16s ease, transform .16s ease, visibility .16s;
}
.kf-item:hover .kf-tip, .kf-item:focus .kf-tip {
    opacity: 1;
    visibility: visible;
    -webkit-transform: translateY(-50%) translateX(0);
    transform: translateY(-50%) translateX(0);
}
.kf-wechat { background: linear-gradient(135deg, #34d269, #16a34a); }
.kf-home { background: linear-gradient(135deg, #ff9a3c, #e0541c); }
.kf-top { background: linear-gradient(135deg, #8a9bb0, #5c6f87); }
.kf-member { background: linear-gradient(135deg, #f05a7a, #c92d50); }
.kf-service { background: linear-gradient(135deg, #3b82f6, #1d4ed8); }
/* 抵消站点全局 button 样式，保证圆钮颜色和图标不被覆盖 */
.kf-rail .kf-item {
    border: 0 !important;
    padding: 0 !important;
    border-radius: 50% !important;
    color: #fff !important;
    -webkit-appearance: none;
    appearance: none;
}
.kf-rail .kf-item.kf-top {
    background: linear-gradient(135deg, #8a9bb0, #5c6f87) !important;
    box-shadow: 0 8px 22px rgba(74, 35, 14, .22) !important;
}
.kf-rail .kf-item.kf-service {
    background: linear-gradient(135deg, #3b82f6, #1d4ed8) !important;
    box-shadow: 0 8px 22px rgba(29, 78, 216, .22) !important;
}
.kf-rail .kf-item svg {
    stroke: #fff !important;
    fill: none !important;
}
.kf-service .kf-dot {
    position: absolute;
    right: 1px;
    top: 1px;
    width: 9px;
    height: 9px;
    border: 2px solid #fff;
    border-radius: 50%;
    background: #25d366;
}

/* 微信二维码 */
.kf-qr-mask {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100000;
    background: rgba(36, 22, 14, .5);
}
.kf-qr {
    position: fixed;
    right: 82px;
    top: 50%;
    z-index: 100001;
    width: 238px;
    padding: 14px 14px 16px;
    border: 1px solid #f0dfd2;
    border-radius: 15px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(55, 26, 12, .28);
    text-align: center;
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    -webkit-transform: translateY(-50%) scale(.96);
    transform: translateY(-50%) scale(.96);
    transition: opacity .18s ease, transform .18s ease, visibility .18s;
}
.kf-qr.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    -webkit-transform: translateY(-50%) scale(1);
    transform: translateY(-50%) scale(1);
}
.kf-qr-x {
    position: absolute;
    right: 8px;
    top: 8px;
    width: 26px;
    height: 26px;
    border: 0 !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: #f7f1ec !important;
    color: #8d7566 !important;
    font-size: 17px;
    line-height: 26px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    appearance: none;
}
.kf-qr-x:hover { background: #f0e1d6; color: #b5451d; }
.kf-x-icon {
    width: 15px;
    height: 15px;
    display: block;
    fill: none;
    stroke: currentColor;
    stroke-width: 2.2;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}
.kf-qr img {
    display: block;
    width: 100%;
    height: auto;
    border-radius: 10px;
    background: #fff;
}
.kf-qr b {
    display: block;
    margin-top: 10px;
    color: #3a2b22;
    font-size: 14px;
    line-height: 1.4;
}
.kf-qr p {
    margin: 4px 0 0;
    color: #9a8474;
    font-size: 12px;
    line-height: 1.5;
}

/* 在线客服窗口 */
.kf-chat-mask {
    display: none;
    position: fixed;
    left: 0;
    top: 0;
    right: 0;
    bottom: 0;
    z-index: 100002;
    background: rgba(20, 14, 10, .42);
}
.kf-chat {
    position: fixed;
    right: 78px;
    bottom: 18px;
    z-index: 100003;
    display: flex;
    flex-direction: column;
    width: 380px;
    height: 590px;
    max-height: calc(100vh - 36px);
    overflow: hidden;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 24px 70px rgba(53, 27, 13, .30);
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
    -webkit-transform: translateY(16px) scale(.97);
    transform: translateY(16px) scale(.97);
    transition: opacity .2s ease, transform .2s ease, visibility .2s;
}
.kf-chat.is-open {
    opacity: 1;
    visibility: visible;
    pointer-events: auto;
    -webkit-transform: translateY(0) scale(1);
    transform: translateY(0) scale(1);
}
.kf-chat-head {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 13px 14px;
    background: linear-gradient(135deg, #ff8b3d 0%, #e2471c 62%, #c43310 100%);
    color: #fff;
}
.kf-chat-head .kf-avatar {
    width: 35px;
    height: 35px;
    flex: 0 0 35px;
    border-radius: 50%;
    background: rgba(255, 255, 255, .2);
    color: #fff;
    font-size: 14px;
    font-weight: 700;
    line-height: 35px;
    text-align: center;
}
.kf-chat-title { min-width: 0; flex: 1; }
.kf-chat-title b { display: block; font-size: 15px; line-height: 1.35; }
.kf-chat-title span { display: block; margin-top: 2px; color: rgba(255, 255, 255, .8); font-size: 11.5px; }
.kf-chat-title span i {
    display: inline-block;
    width: 6px;
    height: 6px;
    margin-right: 4px;
    border-radius: 50%;
    background: #9ff3b5;
    vertical-align: 1px;
}
.kf-chat-x {
    width: 28px;
    height: 28px;
    flex: 0 0 28px;
    border: 0 !important;
    padding: 0 !important;
    border-radius: 50% !important;
    background: rgba(255, 255, 255, .16) !important;
    color: #fff !important;
    font-size: 18px;
    line-height: 28px;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    appearance: none;
}
.kf-chat-x:hover { background: rgba(255, 255, 255, .3); }
.kf-sound-btn { font-size: 16px !important; line-height: 1 !important; }
.kf-sound-btn.is-off { opacity: .55; }
.kf-chat-body {
    flex: 1;
    overflow-y: auto;
    padding: 13px 13px 9px;
    background: #f8f3ee;
    -webkit-overflow-scrolling: touch;
}
.kf-msg {
    display: flex;
    flex-direction: column;
    align-items: flex-start;
    margin-bottom: 12px;
}
.kf-msg-user { align-items: flex-end; }
.kf-msg-system {
    display: block;
    margin: 7px auto 13px;
    max-width: 88%;
    color: #a08a7b;
    font-size: 11.5px;
    line-height: 1.6;
    text-align: center;
}
.kf-bubble {
    max-width: 82%;
    padding: 9px 11px;
    border-radius: 12px;
    background: #fff;
    color: #3c2d24;
    font-size: 13px;
    line-height: 1.65;
    word-break: break-word;
    white-space: pre-wrap;
    box-shadow: 0 2px 8px rgba(105, 62, 30, .07);
}
.kf-msg-user .kf-bubble {
    background: linear-gradient(135deg, #ff8d43, #e3471b);
    color: #fff;
    box-shadow: 0 4px 12px rgba(212, 72, 25, .18);
}
.kf-msg-meta {
    margin-top: 4px;
    color: #b39d8e;
    font-size: 10.5px;
    line-height: 1.4;
}
.kf-chat-empty {
    padding: 24px 10px 8px;
    color: #a08a7b;
    font-size: 12px;
    line-height: 1.8;
    text-align: center;
}
.kf-chat-foot {
    padding: 9px 10px calc(9px + env(safe-area-inset-bottom));
    border-top: 1px solid #f1e4da;
    background: #fff;
}
.kf-chat-form {
    display: flex;
    align-items: flex-end;
    gap: 8px;
}
.kf-chat-input {
    flex: 1;
    min-width: 0;
    height: 38px;
    max-height: 92px;
    padding: 8px 10px;
    border: 1px solid #ecd8ca;
    border-radius: 8px;
    background: #fffdfb;
    color: #3a2b22;
    font: 13px/1.5 "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    resize: none;
    outline: none;
    box-sizing: border-box;
}
.kf-chat-input:focus { border-color: #ee7b3b; box-shadow: 0 0 0 3px rgba(226, 71, 28, .08); }
.kf-chat-send {
    height: 38px;
    padding: 0 15px !important;
    border: 0 !important;
    border-radius: 8px !important;
    background: linear-gradient(135deg, #ff8c41, #dd4318) !important;
    color: #fff !important;
    font-size: 13px;
    font-weight: 700;
    cursor: pointer;
    white-space: nowrap;
    -webkit-appearance: none;
    appearance: none;
}
.kf-chat-send:disabled { opacity: .55; cursor: default; }
.kf-chat-tip {
    margin-top: 5px;
    color: #b09a8b;
    font-size: 10.5px;
    line-height: 1.4;
}
.kf-tools {
    position: relative;
    display: flex;
    align-items: center;
    flex-wrap: wrap;
    gap: 5px;
    margin-top: 7px;
}
.kf-tool {
    width: 27px;
    height: 27px;
    min-width: 27px;
    padding: 0 !important;
    border: 1px solid #ecd8ca !important;
    border-radius: 6px !important;
    background: #fff !important;
    color: #7a5a45 !important;
    font: 13px/25px "Microsoft YaHei", Arial, sans-serif;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    -webkit-appearance: none;
    appearance: none;
}
.kf-tool:hover { border-color: #ee8a54 !important; color: #c34518 !important; }
.kf-tool.active { border-color: #e54b1d !important; background: #fff0e5 !important; color: #c34518 !important; }
.kf-tool.kf-bold { font-weight: 800; }
.kf-tool em { font-style: italic; font-family: Georgia, serif; font-size: 14px; }
.kf-tool svg { width: 20px; height: 20px; fill: none; stroke: #7a5a45; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.kf-select {
    height: 27px !important;
    max-width: 82px;
    padding: 0 2px !important;
    border: 1px solid #ecd8ca !important;
    border-radius: 6px !important;
    background: #fff !important;
    color: #6f5140 !important;
    font-size: 10.5px !important;
    outline: none;
}
.kf-select.kf-size { max-width: 48px; }
.kf-color {
    width: 27px;
    height: 27px;
    padding: 1px;
    border: 1px solid #ecd8ca;
    border-radius: 6px;
    background: #fff;
    cursor: pointer;
}
.kf-emoji-panel {
    display: none;
    position: absolute;
    left: 0;
    bottom: 34px;
    z-index: 10;
    width: 252px;
    padding: 7px;
    grid-template-columns: repeat(8, 1fr);
    gap: 3px;
    border: 1px solid #ecd8ca;
    border-radius: 10px;
    background: #fff;
    box-shadow: 0 12px 30px rgba(98, 51, 24, .18);
}
.kf-emoji-panel.is-open { display: grid; }
.kf-emoji-panel button {
    width: 27px;
    height: 27px;
    min-width: 0;
    padding: 0 !important;
    border: 0 !important;
    border-radius: 5px !important;
    background: transparent !important;
    font-size: 17px;
    line-height: 27px;
    cursor: pointer;
}
.kf-emoji-panel button:hover { background: #fff3e9 !important; }
.kf-bubble-img { padding: 3px !important; background: #fff !important; }
.kf-bubble-img img {
    display: block;
    max-width: 100%;
    max-height: 220px;
    border-radius: 9px;
}
.kf-msg-user .kf-bubble.kf-bubble-img { background: linear-gradient(135deg, #ff8d43, #e3471b) !important; }
.kf-chat-error {
    margin: 0 0 8px;
    padding: 7px 9px;
    border-radius: 7px;
    background: #fff1ea;
    color: #b5451d;
    font-size: 11.5px;
    line-height: 1.5;
}

@media (max-width: 820px) {
    .kf-rail { right: 7px; gap: 8px; }
    .kf-item { width: 38px; height: 38px; box-shadow: 0 5px 15px rgba(74, 35, 14, .2); }
    .kf-item svg { width: 18px; height: 18px; }
    .kf-item:hover, .kf-item:focus { transform: none; }
    .kf-tip { display: none; }
    .kf-qr-mask.is-open { display: block; }
    .kf-qr {
        right: auto;
        left: 50%;
        top: 50%;
        width: 86vw;
        max-width: 310px;
        max-height: 86vh;
        overflow-y: auto;
        -webkit-transform: translate(-50%, -50%) scale(.94);
        transform: translate(-50%, -50%) scale(.94);
    }
    .kf-qr.is-open {
        -webkit-transform: translate(-50%, -50%) scale(1);
        transform: translate(-50%, -50%) scale(1);
    }
    .kf-qr img { width: 100%; height: auto; max-height: none; }
    .kf-chat-mask.is-open { display: block; }
    .kf-chat {
        left: 0;
        top: 0;
        right: 0;
        bottom: 0;
        width: 100%;
        height: 100%;
        max-height: none;
        border-radius: 0;
        -webkit-transform: none;
        transform: none;
    }
    .kf-chat.is-open { -webkit-transform: none; transform: none; }
    .kf-chat-body { padding: 12px 11px 8px; }
    .kf-bubble { max-width: 86%; font-size: 13.5px; }
    .kf-chat-head { padding: 12px 13px; }
}

