/* ========================================
   疾驰云 - 在线客服
   ======================================== */

#jc-customer-service-root {
    font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei", sans-serif;
}

/* 右下角按钮 */
.jc-cs-launcher {
    position: fixed;
    right: 22px;
    bottom: 24px;
    z-index: 99990;
    display: flex;
    align-items: center;
    gap: 9px;
    height: 48px;
    padding: 0 17px;
    border: 0;
    border-radius: 24px;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    cursor: pointer;
    box-shadow: 0 8px 28px rgba(37, 99, 235, .32);
    transition: transform .2s ease, box-shadow .2s ease;
}

.jc-cs-launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 12px 32px rgba(37, 99, 235, .4);
}

.jc-cs-launcher-icon {
    width: 22px;
    height: 22px;
    display: flex;
    align-items: center;
    justify-content: center;
}

.jc-cs-launcher-text {
    font-size: 14px;
    font-weight: 600;
    white-space: nowrap;
}

.jc-cs-online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #34d399;
    box-shadow: 0 0 0 3px rgba(52, 211, 153, .2);
}

/* 未读提示 */
.jc-cs-badge {
    position: absolute;
    top: -5px;
    right: -3px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    display: none;
    align-items: center;
    justify-content: center;
    border-radius: 9px;
    background: #ef4444;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    border: 2px solid #fff;
}

/* 主窗口 */
.jc-cs-panel {
    position: fixed;
    right: 22px;
    bottom: 84px;
    z-index: 99991;
    width: 380px;
    height: 560px;
    max-height: calc(100vh - 120px);
    display: none;
    flex-direction: column;
    overflow: hidden;
    border: 1px solid rgba(148, 163, 184, .2);
    border-radius: 18px;
    background: #fff;
    box-shadow: 0 20px 60px rgba(15, 23, 42, .22);
    animation: jcCsOpen .18s ease;
}

.jc-cs-panel.jc-cs-show {
    display: flex;
}

@keyframes jcCsOpen {
    from {
        opacity: 0;
        transform: translateY(12px) scale(.98);
    }
    to {
        opacity: 1;
        transform: translateY(0) scale(1);
    }
}

/* 顶部 */
.jc-cs-header {
    position: relative;
    padding: 17px 18px;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
}

.jc-cs-header-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
}

.jc-cs-title-wrap {
    display: flex;
    align-items: center;
    gap: 11px;
}

.jc-cs-avatar {
    width: 38px;
    height: 38px;
    border-radius: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    background: rgba(255,255,255,.18);
}

.jc-cs-title {
    font-size: 16px;
    font-weight: 700;
    line-height: 1.3;
}

.jc-cs-status {
    margin-top: 3px;
    font-size: 12px;
    color: rgba(255,255,255,.85);
}

.jc-cs-close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 10px;
    background: rgba(255,255,255,.12);
    color: #fff;
    cursor: pointer;
    font-size: 20px;
    line-height: 30px;
}

.jc-cs-close:hover {
    background: rgba(255,255,255,.2);
}

/* 提示 */
.jc-cs-notice {
    padding: 9px 14px;
    font-size: 12px;
    line-height: 1.55;
    color: #64748b;
    background: #f8fafc;
    border-bottom: 1px solid #eef2f7;
}

/* 聊天区 */
.jc-cs-messages {
    flex: 1;
    overflow-y: auto;
    padding: 15px;
    background: #f8fafc;
    overscroll-behavior: contain;
}

.jc-cs-loading,
.jc-cs-empty {
    padding: 40px 15px;
    text-align: center;
    color: #94a3b8;
    font-size: 13px;
}

.jc-cs-row {
    display: flex;
    margin-bottom: 13px;
}

.jc-cs-row.is-me {
    justify-content: flex-end;
}

.jc-cs-row.is-staff {
    justify-content: flex-start;
}

.jc-cs-message-wrap {
    max-width: 78%;
}

.jc-cs-name {
    margin: 0 4px 4px;
    font-size: 11px;
    color: #94a3b8;
}

.jc-cs-row.is-me .jc-cs-name {
    text-align: right;
}

.jc-cs-bubble {
    padding: 10px 13px;
    border-radius: 14px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    white-space: pre-wrap;
}

.jc-cs-row.is-me .jc-cs-bubble {
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    color: #fff;
    border-bottom-right-radius: 5px;
}

.jc-cs-row.is-staff .jc-cs-bubble {
    background: #fff;
    color: #1e293b;
    border: 1px solid #e5e7eb;
    border-bottom-left-radius: 5px;
    box-shadow: 0 2px 8px rgba(15, 23, 42, .04);
}

.jc-cs-time {
    margin: 4px 4px 0;
    font-size: 10px;
    color: #a1a1aa;
}

.jc-cs-row.is-me .jc-cs-time {
    text-align: right;
}

/* 输入区 */
.jc-cs-footer {
    padding: 12px;
    border-top: 1px solid #e5e7eb;
    background: #fff;
}

.jc-cs-input-wrap {
    display: flex;
    align-items: flex-end;
    gap: 9px;
}

.jc-cs-input {
    flex: 1;
    min-height: 42px;
    max-height: 100px;
    resize: none;
    border: 1px solid #dbe2ea;
    border-radius: 12px;
    padding: 10px 12px;
    outline: none;
    color: #1e293b;
    background: #f8fafc;
    font: inherit;
    font-size: 13px;
    line-height: 1.5;
}

.jc-cs-input:focus {
    border-color: #60a5fa;
    background: #fff;
    box-shadow: 0 0 0 3px rgba(59,130,246,.1);
}

.jc-cs-send {
    width: 44px;
    height: 42px;
    flex: 0 0 44px;
    border: 0;
    border-radius: 12px;
    color: #fff;
    background: linear-gradient(135deg, #3b82f6, #2563eb);
    cursor: pointer;
    font-size: 18px;
}

.jc-cs-send:disabled {
    cursor: not-allowed;
    opacity: .55;
}

.jc-cs-footer-tip {
    margin-top: 6px;
    color: #94a3b8;
    font-size: 10px;
}

/* 手机 */
@media (max-width: 640px) {
    .jc-cs-launcher {
        right: 14px;
        bottom: 18px;
        width: 48px;
        padding: 0;
        justify-content: center;
    }

    .jc-cs-launcher-text,
    .jc-cs-online-dot {
        display: none;
    }

    .jc-cs-panel {
        right: 10px;
        left: 10px;
        bottom: 76px;
        width: auto;
        height: min(620px, calc(100vh - 95px));
        max-height: none;
        border-radius: 17px;
    }

    .jc-cs-message-wrap {
        max-width: 84%;
    }
}

/* ========================================
   客服新消息提示
   ======================================== */

.jc-cs-toast-container {
    position: fixed;
    right: 22px;
    bottom: 86px;
    z-index: 100000;
    width: 310px;
    pointer-events: none;
}

.jc-cs-toast {
    position: relative;
    margin-top: 10px;
    padding: 13px 14px;
    display: flex;
    align-items: flex-start;
    gap: 11px;
    border: 1px solid #dbeafe;
    border-radius: 14px;
    background: #fff;
    box-shadow: 0 10px 35px rgba(15, 23, 42, .18);
    cursor: pointer;
    pointer-events: auto;
    animation: jcCsToastIn .25s ease;
}

.jc-cs-toast-icon {
    width: 36px;
    height: 36px;
    flex: 0 0 36px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 11px;
    background: #eff6ff;
    color: #2563eb;
    font-size: 18px;
}

.jc-cs-toast-content {
    flex: 1;
    min-width: 0;
}

.jc-cs-toast-title {
    margin-bottom: 3px;
    color: #1e293b;
    font-size: 13px;
    font-weight: 700;
}

.jc-cs-toast-message {
    overflow: hidden;
    color: #64748b;
    font-size: 12px;
    line-height: 1.5;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.jc-cs-toast-close {
    padding: 0 2px;
    border: 0;
    background: transparent;
    color: #94a3b8;
    cursor: pointer;
    font-size: 17px;
}

@keyframes jcCsToastIn {
    from {
        opacity: 0;
        transform: translateX(20px);
    }

    to {
        opacity: 1;
        transform: translateX(0);
    }
}

@media (max-width: 640px) {
    .jc-cs-toast-container {
        right: 10px;
        left: 10px;
        bottom: 80px;
        width: auto;
    }
}

/* ========================================
   疾驰云客服 - 常见问题
   ======================================== */

.jc-cs-faq {
    flex: 0 0 auto;
    padding: 12px 14px;
    border-bottom: 1px solid #e8edf3;
    background: #fff;
}

.jc-cs-faq-head {
    width: 100%;
    padding: 0;
    display: flex;
    align-items: center;
    justify-content: space-between;
    border: 0;
    background: transparent;
    color: #1e293b;
    cursor: pointer;
}

.jc-cs-faq-title-wrap {
    display: flex;
    align-items: center;
    gap: 7px;
}

.jc-cs-faq-title {
    font-size: 13px;
    font-weight: 700;
}

.jc-cs-faq-subtitle {
    margin-left: 4px;
    color: #94a3b8;
    font-size: 10px;
    font-weight: 400;
}

.jc-cs-faq-arrow {
    color: #94a3b8;
    font-size: 11px;
    transition: transform .18s ease;
}

.jc-cs-faq.is-collapsed .jc-cs-faq-arrow {
    transform: rotate(-90deg);
}

.jc-cs-faq-list {
    margin-top: 10px;
    max-height: 210px;
    overflow-y: auto;
}

.jc-cs-faq.is-collapsed .jc-cs-faq-list {
    display: none;
}

.jc-cs-faq-loading {
    padding: 12px;
    text-align: center;
    color: #94a3b8;
    font-size: 11px;
}

.jc-cs-faq-item {
    width: 100%;
    min-height: 38px;
    margin-bottom: 7px;
    padding: 8px 11px;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    background: #f3f4f6;
    color: #536174;
    cursor: pointer;
    text-align: center;
    font-size: 12px;
    line-height: 1.45;
}

.jc-cs-faq-item:last-child {
    margin-bottom: 0;
}

.jc-cs-faq-item:hover {
    border-color: #bfdbfe;
    background: #eff6ff;
    color: #2563eb;
}

.jc-cs-faq-item.manual {
    border-color: #ddd6fe;
    background: #f5f3ff;
    color: #6d28d9;
}

.jc-cs-faq-item:disabled {
    opacity: .55;
    cursor: wait;
}

.jc-cs-faq-manual-tip {
    margin-bottom: 10px;
    padding: 9px 11px;
    border-radius: 9px;
    background: #eff6ff;
    color: #64748b;
    font-size: 11px;
    line-height: 1.6;
}

@media (max-width: 640px) {
    .jc-cs-faq-list {
        max-height: 180px;
    }

    .jc-cs-faq-item {
        min-height: 40px;
    }
}


/* ========================================
   疾驰云客服 - 新版聊天气泡
   仿参考图紫蓝渐变风格
   ======================================== */

/* 消息之间稍微拉开 */
.jc-cs-row {
    margin-bottom: 17px;
}

/* 气泡最大宽度 */
.jc-cs-message-wrap {
    max-width: 82%;
}


/* ---------- 客户消息 / 我 ---------- */

.jc-cs-row.is-me .jc-cs-bubble {
    padding: 11px 16px;

    border: none;

    border-radius: 22px 22px 7px 22px;

    background:
        linear-gradient(
            135deg,
            #7c3aed 0%,
            #5368e9 43%,
            #3298cf 72%,
            #20bec3 100%
        );

    color: #ffffff;

    font-size: 14px;
    line-height: 1.65;

    box-shadow:
        0 8px 22px rgba(99, 79, 219, .18);

    word-break: break-word;
    white-space: pre-wrap;
}


/* ---------- 在线客服消息 ---------- */

.jc-cs-row.is-staff .jc-cs-bubble {
    padding: 11px 16px;

    border: 1px solid #e5d4ff;

    border-radius: 22px 22px 22px 7px;

    background:
        linear-gradient(
            135deg,
            #fffefe 0%,
            #fbf8ff 55%,
            #f7f2ff 100%
        );

    color: #202536;

    font-size: 14px;
    line-height: 1.65;

    box-shadow:
        0 4px 16px rgba(124, 58, 237, .06);

    word-break: break-word;
    white-space: pre-wrap;
}


/* ---------- 名称 ---------- */

.jc-cs-name {
    margin: 0 5px 6px;

    color: #9299a8;

    font-size: 11px;
    font-weight: 400;
}

.jc-cs-row.is-me .jc-cs-name {
    color: #8c94a5;
}


/* ---------- 时间 ---------- */

.jc-cs-time {
    margin: 5px 6px 0;

    color: #a5aab5;

    font-size: 10px;
}

.jc-cs-row.is-me .jc-cs-time {
    color: #9ca3b3;
}


/* ---------- 手机适配 ---------- */

@media (max-width: 640px) {

    .jc-cs-message-wrap {
        max-width: 86%;
    }

    .jc-cs-row.is-me .jc-cs-bubble,
    .jc-cs-row.is-staff .jc-cs-bubble {
        padding: 10px 14px;

        font-size: 13px;
        line-height: 1.6;
    }
}



/* ========================================
   疾驰客服 - 顶部客服卡片新版
   ======================================== */

.jc-cs-header {
    padding: 10px 12px;
    background: #f7f9ff;
    color: #1f2937;
    border-bottom: 1px solid #eef2f7;
}

.jc-cs-header-row {
    min-height: 64px;
    padding: 10px 12px;
    border-radius: 32px;

    background:
        linear-gradient(
            135deg,
            #ffffff 0%,
            #f6f8ff 55%,
            #eef3ff 100%
        );

    box-shadow:
        0 7px 20px rgba(45, 70, 130, .12);

    display: flex;
    align-items: center;
    justify-content: space-between;
}


/* 左侧头像 */

.jc-cs-avatar {
    width: 46px;
    height: 46px;
    flex: 0 0 46px;

    border-radius: 50%;

    background:
        linear-gradient(
            135deg,
            #dbeafe,
            #bfdbfe
        );

    color: #3b82f6;

    box-shadow:
        inset 0 0 0 1px rgba(255,255,255,.7);

    display: flex;
    align-items: center;
    justify-content: center;
}

.jc-cs-avatar svg {
    width: 25px;
    height: 25px;
}


/* 标题区域 */

.jc-cs-title-wrap {
    display: flex;
    align-items: center;
    gap: 11px;
}

.jc-cs-title {
    color: #202938;
    font-size: 14px;
    line-height: 1.4;
    font-weight: 700;
}

.jc-cs-worktime {
    margin-left: 3px;
    font-weight: 700;
    color: #202938;
}


/* 第二行 */

.jc-cs-status {
    margin-top: 3px;

    color: #64748b;

    font-size: 12px;
    line-height: 1.4;
}


/* 关闭按钮 */

.jc-cs-close {
    width: 34px;
    height: 34px;

    flex: 0 0 34px;

    border: 0;
    border-radius: 50%;

    background: #eef2f7;

    color: #64748b;

    font-size: 20px;
    line-height: 32px;

    box-shadow: none;
}

.jc-cs-close:hover {
    background: #e2e8f0;
    color: #334155;
}


/* 手机适配 */

@media (max-width: 640px) {

    .jc-cs-header {
        padding: 8px;
    }

    .jc-cs-header-row {
        min-height: 60px;
        padding: 8px 10px;
    }

    .jc-cs-avatar {
        width: 42px;
        height: 42px;
        flex-basis: 42px;
    }

    .jc-cs-title {
        font-size: 13px;
    }

    .jc-cs-status {
        font-size: 11px;
    }
}

