/* 在线客服：白底、细边框、深藏青标题，前台入口在站点右上角 */
.kefu-panel, .kefu-head, .kefu-body, .kefu-compose, .kefu-input, .kefu-bar, .kefu-welcome-card, .kefu-faq, .kefu-login-box {
    box-sizing: border-box;
}

.account-kefu { position: relative; }
.top-kefu { position: relative; }
.kefu-nav-badge {
    position: absolute;
    top: -7px;
    right: -8px;
    min-width: 16px;
    height: 16px;
    padding: 0 4px;
    border: 1px solid #ffffff;
    border-radius: 8px;
    background: #b23a2e;
    color: #ffffff;
    font-size: 10px;
    line-height: 14px;
    text-align: center;
    font-weight: 500;
    pointer-events: none;
}
.kefu-nav-badge[hidden] { display: none; }

.kefu-backdrop {
    position: fixed;
    inset: 0;
    z-index: 900;
    background: rgba(12, 14, 22, .5);
    opacity: 0;
    visibility: hidden;
    transition: opacity .18s ease, visibility .18s ease;
}
.kefu-backdrop.open { opacity: 1; visibility: visible; }
.kefu-backdrop[hidden] { display: none; }
body.kefu-open { overflow: hidden; }

.kefu-panel {
    position: fixed;
    top: 50%;
    left: 50%;
    right: auto;
    z-index: 901;
    width: min(920px, calc(100vw - 48px));
    height: min(680px, calc(100vh - 48px));
    max-height: none;
    display: flex;
    flex-direction: column;
    background: #ffffff;
    border: 1px solid #111111;
    box-shadow: 0 10px 28px rgba(0, 0, 0, .18);
    opacity: 0;
    visibility: hidden;
    transform: translate(-50%, -48%) scale(.985);
    transition: opacity .18s ease, transform .18s ease, visibility .18s ease;
}
.kefu-panel.open { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }

.kefu-head {
    height: 66px;
    flex: 0 0 66px;
    padding: 0 26px;
    display: flex;
    align-items: center;
    gap: 12px;
    background: #1a1a2e;
    color: #ffffff;
}
.kefu-head-icon {
    width: 34px;
    height: 34px;
    flex: 0 0 34px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid rgba(255, 255, 255, .38);
    color: #ffffff;
}
.kefu-head-title { display: flex; flex: 1; flex-direction: column; line-height: 1.35; min-width: 0; }
.kefu-head-title b { font-size: 17px; font-weight: 700; letter-spacing: .5px; }
.kefu-head-title span { display: flex; align-items: center; gap: 5px; font-size: 11px; color: #cfd3da; }
.kefu-online-dot { width: 6px; height: 6px; border-radius: 50%; background: #2f9e68; display: inline-block; }
.kefu-close {
    width: 30px;
    height: 30px;
    flex: 0 0 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #ffffff;
    font-size: 23px;
    line-height: 30px;
    cursor: pointer;
}
.kefu-close:hover { color: #dbe2ef; }
.kefu-help {
    height: 30px;
    padding: 0 12px;
    flex: 0 0 auto;
    border: 1px solid rgba(255, 255, 255, .32);
    background: transparent;
    color: #cfd3da;
    font-size: 12px;
    line-height: 28px;
    white-space: nowrap;
    cursor: pointer;
}
.kefu-help:hover { border-color: #ffffff; color: #ffffff; }
.kefu-help:focus-visible,
.kefu-close:focus-visible { outline: 1px solid rgba(255, 255, 255, .72); outline-offset: 1px; }
.kefu-faq-item:focus-visible { outline: 1px solid #1a1a2e; outline-offset: -1px; }
.kefu-faq-menu {
    position: absolute;
    top: 50%;
    left: 50%;
    z-index: 6;
    width: min(620px, calc(100% - 48px));
    max-height: calc(100% - 190px);
    display: flex;
    flex-direction: column;
    overflow: hidden;
    padding: 0;
    background: #ffffff;
    border: 1px solid #1a1a2e;
    box-shadow: 0 10px 30px rgba(0, 0, 0, .18);
    transform: translate(-50%, -50%);
}
.kefu-faq-menu[hidden] { display: none; }
.kefu-faq-menu-head {
    flex: 0 0 auto;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid #1a1a2e;
    background: #ffffff;
}
.kefu-faq-menu-head b { color: #1a1a2e; font-size: 15px; }
.kefu-faq-menu-head span { flex: 1; color: #888; font-size: 11px; }
.kefu-faq-menu-close {
    width: 26px;
    height: 26px;
    flex: 0 0 26px;
    padding: 0;
    border: 1px solid #d6d9dd;
    background: #ffffff;
    color: #555;
    font-size: 17px;
    line-height: 24px;
    cursor: pointer;
}
.kefu-faq-menu-close:hover { border-color: #1a1a2e; color: #1a1a2e; }
.kefu-faq-list {
    display: flex;
    flex-direction: column;
    gap: 7px;
    padding: 14px 18px 18px;
    overflow-y: auto;
}

.kefu-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 22px 38px;
    background: #f5f6f8;
}
.kefu-welcome-card {
    max-width: 620px;
    margin: 18px auto 12px;
    padding: 18px 20px;
    background: #ffffff;
    border: 1px solid #d9dde3;
    color: #333;
    font-size: 13px;
    line-height: 1.8;
}
.kefu-welcome-title {
    display: flex;
    align-items: center;
    gap: 7px;
    margin-bottom: 8px;
    color: #1a1a2e;
    font-size: 13px;
    font-weight: 700;
}
.kefu-welcome-title i {
    width: 18px;
    height: 18px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border: 1px solid #1a1a2e;
    background: #1a1a2e;
    color: #fff;
    font-style: normal;
    font-size: 11px;
}
.kefu-welcome-title i svg {
    width: 12px;
    height: 12px;
    fill: none;
    stroke: #fff;
    stroke-width: 2;
}
.kefu-welcome-text { color: #555; }
.kefu-welcome-faq {
    margin-top: 14px;
    padding-top: 12px;
    border-top: 1px solid #e4e7eb;
}
.kefu-welcome-faq-title {
    margin-bottom: 8px;
    color: #1a1a2e;
    font-size: 12px;
    font-weight: 700;
}
.kefu-welcome-faq-list { display: flex; flex-direction: column; gap: 6px; }
.kefu-welcome-faq-item {
    width: 100%;
    padding: 9px 11px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid #d9dde3;
    background: #ffffff;
    color: #333;
    font-size: 12px;
    line-height: 1.45;
    text-align: left;
    cursor: pointer;
}
.kefu-welcome-faq-item:hover { border-color: #1a1a2e; color: #1a1a2e; }
.kefu-welcome-faq-item span:last-child { color: #999; font-size: 14px; }
.kefu-welcome-faq-answer {
    margin-top: 7px;
    padding: 10px 12px;
    border-left: 2px solid #1a1a2e;
    background: #f7f8fa;
    color: #555;
    font-size: 12px;
    line-height: 1.7;
}
.kefu-welcome-faq-answer[hidden] { display: none; }
.kefu-login-box {
    margin-top: 10px;
    padding: 10px;
    border: 1px solid #d9dde3;
    background: #fafbfc;
    color: #444;
    font-size: 12px;
    line-height: 1.7;
}
.kefu-login-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    height: 32px;
    margin-top: 8px;
    padding: 0 14px;
    background: #1a1a2e;
    border: 1px solid #1a1a2e;
    color: #ffffff;
    font-size: 12px;
    text-decoration: none;
}
.kefu-login-btn:hover { background: #2a2a44; color: #ffffff; }

.kefu-faq { margin: 2px 0 12px; }
.kefu-faq-title {
    margin: 0 0 7px;
    color: #777;
    font-size: 11px;
    letter-spacing: .5px;
}
.kefu-faq-item {
    width: 100%;
    padding: 8px 10px;
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    border: 1px solid #d9dde3;
    background: #ffffff;
    color: #333;
    font-size: 12px;
    line-height: 1.4;
    text-align: left;
    cursor: pointer;
}
.kefu-faq-item:hover { border-color: #1a1a2e; color: #1a1a2e; }
.kefu-faq-item span:last-child { color: #999; font-size: 14px; }
.kefu-faq-answer {
    margin-top: 7px;
    padding: 10px;
    border-left: 2px solid #1a1a2e;
    background: #ffffff;
    color: #555;
    font-size: 12px;
    line-height: 1.7;
}
.kefu-faq-answer[hidden] { display: none; }
.kefu-service-list { margin-top: 12px; padding-top: 10px; border-top: 1px solid #e5e8ec; }
.kefu-service-text { color: #555; font-size: 12px; line-height: 1.8; }

.kefu-msg { width: 100%; max-width: 820px; margin: 0 auto 11px; display: flex; }
.kefu-msg.visitor { justify-content: flex-end; }
.kefu-msg.admin { justify-content: flex-start; }
.kefu-msg-wrap { max-width: 72%; }
.kefu-bubble {
    padding: 8px 10px;
    border: 1px solid #d6d9dd;
    background: #ffffff;
    color: #222;
    font-size: 13px;
    line-height: 1.65;
    white-space: pre-wrap;
    word-break: break-word;
}
.kefu-msg.visitor .kefu-bubble { background: #1a1a2e; color: #ffffff; border-color: #1a1a2e; }
.kefu-bubble-image { padding: 4px; background: #f5f6f8; white-space: normal; }
.kefu-msg.visitor .kefu-bubble-image { background: #ffffff; border-color: #d6d9dd; }
.kefu-bubble-image a { display: block; line-height: 0; }
.kefu-bubble-image img { display: block; width: auto; height: auto; max-width: 100%; max-height: 320px; object-fit: contain; cursor: zoom-in; }
.kefu-msg.system { justify-content: center; }
.kefu-msg.system .kefu-bubble {
    max-width: 90%;
    padding: 5px 9px;
    border: 1px solid #e1e4e8;
    background: #eef0f3;
    color: #777;
    font-size: 11px;
    text-align: center;
    border-radius: 10px;
}
.kefu-meta {
    margin-top: 3px;
    display: flex;
    align-items: center;
    gap: 5px;
    color: #999;
    font-size: 11px;
}
.kefu-msg.visitor .kefu-meta { justify-content: flex-end; }
.kefu-read { color: #888; }
.kefu-read.unread { color: #b23a2e; }

.kefu-rating-card {
    width: 100%;
    max-width: 520px;
    margin: 14px auto 16px;
    padding: 14px;
    border: 1px solid #1a1a2e;
    background: #ffffff;
    text-align: center;
}
.kefu-rating-title { color: #1a1a2e; font-size: 13px; font-weight: 700; }
.kefu-rating-desc { margin-top: 4px; color: #777; font-size: 11px; }
.kefu-stars { display: flex; justify-content: center; gap: 4px; margin-top: 8px; }
.kefu-star {
    width: 28px;
    height: 28px;
    padding: 0;
    border: 1px solid #d6d9dd;
    background: #ffffff;
    color: #9b9b9b;
    font-size: 15px;
    line-height: 26px;
    cursor: pointer;
}
.kefu-star:hover, .kefu-star.active { border-color: #1a1a2e; background: #1a1a2e; color: #ffffff; }
.kefu-star:disabled { cursor: default; }
.kefu-rating-result { margin-top: 7px; color: #1a1a2e; font-size: 12px; }

.kefu-compose {
    flex: 0 0 auto;
    padding: 14px 26px 12px;
    border-top: 1px solid #111111;
    background: #ffffff;
}
.kefu-input {
    width: 100%;
    height: 82px;
    resize: vertical;
    border: 1px solid #111111;
    padding: 10px 12px;
    font-size: 13px;
    line-height: 1.7;
    outline: none;
    background: #ffffff;
    color: #222;
}
.kefu-input:focus { border-color: #1a1a2e; box-shadow: 0 0 0 2px rgba(26, 26, 46, .08); }
.kefu-input:disabled { background: #f3f4f6; color: #999; }
.kefu-bar { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-top: 7px; }
.kefu-bar-actions { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.kefu-note { flex: 1; min-width: 0; }
.kefu-image-btn { height: 30px; padding: 0 11px; border: 1px solid #bfc5cc; background: #ffffff; color: #444; cursor: pointer; font-size: 12px; }
.kefu-image-btn:hover:not(:disabled) { border-color: #1a1a2e; color: #1a1a2e; }
.kefu-image-btn:disabled { opacity: .55; cursor: default; }
.kefu-image-preview { display: flex; align-items: center; gap: 9px; margin-bottom: 8px; padding: 6px 7px; border: 1px solid #d6d9dd; background: #fafafa; }
.kefu-image-preview[hidden] { display: none; }
.kefu-image-preview img { width: 54px; height: 54px; object-fit: cover; border: 1px solid #cfd3d8; background: #fff; }
.kefu-image-preview-text { flex: 1; min-width: 0; color: #555; font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.kefu-image-remove { flex: 0 0 auto; width: 26px; height: 26px; border: 0; background: transparent; color: #777; font-size: 19px; line-height: 26px; cursor: pointer; }
.kefu-image-remove:hover { color: #b23a2e; }
.kefu-note { color: #999; font-size: 11px; line-height: 1.4; }
.kefu-note.bad { color: #b23a2e; }
.kefu-send {
    height: 30px;
    padding: 0 16px;
    border: 1px solid #1a1a2e;
    background: #1a1a2e;
    color: #ffffff;
    cursor: pointer;
    font-size: 12px;
}
.kefu-send:disabled { opacity: .55; cursor: default; }
.kefu-send:hover:not(:disabled) { background: #2a2a44; }
.kefu-paste-tip { margin: 7px 0 0; color: #666; font-size: 11px; line-height: 1.5; }
.kefu-privacy { margin: 4px 0 0; color: #aaa; font-size: 10px; line-height: 1.4; }

@media (max-width: 960px) {
    .kefu-panel {
        width: calc(100vw - 24px);
        height: calc(100vh - 24px);
    }
    .kefu-body { padding: 18px 24px; }
    .kefu-faq-menu { width: min(620px, calc(100% - 32px)); }
}

@media (max-width: 720px) {
    .kefu-panel {
        width: calc(100vw - 16px);
        height: calc(100vh - 16px);
    }
    .kefu-head { padding: 0 16px; }
    .kefu-head-title b { font-size: 15px; }
    .kefu-body { padding: 16px 14px; }
    .kefu-welcome-card { margin-top: 0; padding: 14px; }
    .kefu-compose { padding: 12px 14px 10px; }
    .kefu-input { height: 74px; }
    .kefu-faq-menu {
        width: calc(100% - 20px);
        max-height: calc(100% - 150px);
    }
    .kefu-faq-menu-head { padding: 12px 14px; }
    .kefu-faq-list { padding: 12px 14px 14px; }
}

@media (max-width: 560px) {
    .kefu-panel {
        top: 0;
        left: 0;
        width: 100%;
        height: 100%;
        max-height: none;
        border: 0;
        transform: translate(0, 2%) scale(.995);
    }
    .kefu-panel.open { transform: translate(0, 0) scale(1); }
    .kefu-head { height: 58px; flex-basis: 58px; padding: 0 12px; gap: 8px; }
    .kefu-head-icon { width: 30px; height: 30px; flex-basis: 30px; }
    .kefu-head-title b { font-size: 15px; }
    .kefu-head-title span { font-size: 10px; }
    .kefu-help { height: 28px; padding: 0 8px; font-size: 11px; }
    .kefu-body { padding: 14px 10px; }
    .kefu-bubble, .kefu-input { font-size: 13px; }
    .kefu-msg-wrap { max-width: 86%; }
    .kefu-compose { padding: 10px 10px 8px; }
    .kefu-input { height: 70px; padding: 8px 9px; }
    .kefu-privacy { font-size: 10px; }
    .kefu-faq-menu { width: calc(100% - 16px); max-height: calc(100% - 130px); }
}


