/* 右下角在线客服：按目标站 300.cn 客服窗口结构复刻 */
.lj-service {
    position: fixed;
    right: 20px;
    bottom: 0;
    z-index: 999999;
    pointer-events: none;
    font-family: "Noto Sans SC", "PingFang SC", "Microsoft YaHei", "Hiragino Sans GB", Arial, sans-serif;
}

/* 白色圆形按钮 + 红色未读角标 */
.lj-service__launcher {
    position: absolute;
    right: 5px;
    bottom: 25px;
    display: flex;
    align-items: center;
    justify-content: center;
    width: 70px;
    height: 70px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: #fff;
    color: #111;
    cursor: pointer;
    pointer-events: auto;
    box-shadow: 0 6px 24px rgba(0, 0, 0, 0.18);
    transition: transform 0.25s ease, box-shadow 0.25s ease, opacity 0.2s ease, visibility 0.2s ease;
}

.lj-service__launcher:hover {
    transform: translateY(-2px);
    box-shadow: 0 10px 30px rgba(0, 0, 0, 0.24);
}

.lj-service__launcher svg {
    width: 32px;
    height: 32px;
}

.lj-service__badge {
    position: absolute;
    top: 0;
    right: 0;
    min-width: 22px;
    height: 22px;
    padding: 0 5px;
    border: 2px solid #fff;
    border-radius: 11px;
    background: #d01129;
    color: #fff;
    font-size: 12px;
    font-weight: 600;
    line-height: 18px;
    text-align: center;
}

.lj-service.is-read .lj-service__badge {
    display: none;
}

/* 360px 贴底窗口 */
.lj-service__window {
    position: relative;
    width: 360px;
    height: 522px;
    max-height: calc(100vh - 16px);
    overflow: hidden;
    border-radius: 10px 10px 0 0;
    background: #000;
    box-shadow: 0 0 8px 4px rgba(0, 0, 0, 0.1);
    opacity: 0;
    visibility: hidden;
    transform: translateY(24px);
    pointer-events: none;
    transition: opacity 0.22s ease, visibility 0.22s ease, transform 0.22s ease;
}

.lj-service.is-open .lj-service__window {
    opacity: 1;
    visibility: visible;
    transform: translateY(0);
    pointer-events: auto;
}

.lj-service.is-open .lj-service__launcher {
    opacity: 0;
    visibility: hidden;
    pointer-events: none;
}

.lj-service__title {
    display: flex;
    align-items: center;
    height: 60px;
    padding: 0 14px;
    background: #000;
    color: #fff;
}

.lj-service__mark {
    display: flex;
    flex: 0 0 auto;
    align-items: center;
    justify-content: center;
    width: 30px;
    height: 30px;
    margin-right: 10px;
    color: #fff;
}

.lj-service__mark svg {
    width: 27px;
    height: 27px;
}

.lj-service__admin {
    flex: 1;
    min-width: 0;
}

.lj-service__admin p {
    margin: 0;
    overflow: hidden;
    color: #fff;
    font-size: 15px;
    font-weight: 600;
    line-height: 1.35;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.lj-service__admin span {
    display: block;
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.58);
    font-size: 11px;
    line-height: 1.3;
}

.lj-service__close {
    flex: 0 0 auto;
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    background: transparent;
    color: #fff;
    cursor: pointer;
    opacity: 0.9;
}

.lj-service__close:hover {
    opacity: 1;
}

.lj-service__close svg {
    width: 24px;
    height: 24px;
}

.lj-service__dialog {
    display: flex;
    flex-direction: column;
    height: calc(100% - 60px);
    background: #fff;
}

.lj-service__output {
    flex: 1;
    padding: 18px 18px 10px;
    overflow-y: auto;
    background: #fff;
}

.lj-service__bubble {
    padding: 12px 14px;
    border-radius: 10px 10px 10px 2px;
    background: #f5f5f5;
    color: #333;
}

.lj-service__bubble p {
    margin: 0;
    font-size: 14px;
    line-height: 1.7;
}

.lj-service__msg {
    max-width: 86%;
    margin-bottom: 10px;
    padding: 10px 13px;
    border-radius: 10px;
    font-size: 14px;
    line-height: 1.65;
    word-break: break-word;
}

.lj-service__msg--user {
    margin-left: auto;
    border-bottom-right-radius: 2px;
    background: #07112a;
    color: #fff;
}

.lj-service__msg--reply {
    border-bottom-left-radius: 2px;
    background: #f5f5f5;
    color: #333;
}

.lj-service__msg--error {
    border: 1px solid #f0c9c6;
    background: #fff2f1;
    color: #b3261e;
}

.lj-service__quick {
    margin-top: 14px;
}

.lj-service__quick-item {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 8px;
    padding: 10px 12px;
    border: 1px solid #e8e3dc;
    border-radius: 6px;
    background: #fff;
    color: #1d1d1f;
    font-size: 13px;
    line-height: 1.4;
    text-decoration: none;
    transition: border-color 0.2s ease, background-color 0.2s ease;
}

.lj-service__quick-item:hover {
    border-color: #1d1d1f;
    background: #faf9f7;
    color: #1d1d1f;
}

.lj-service__quick-item small {
    display: block;
    margin-top: 2px;
    color: #8a8a8a;
    font-size: 11px;
}

.lj-service__quick-item--primary {
    border-color: #000;
    background: #000;
    color: #fff;
}

.lj-service__quick-item--primary:hover {
    border-color: #1d1d1f;
    background: #1d1d1f;
    color: #fff;
}

.lj-service__input {
    display: flex;
    flex: 0 0 auto;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    border-top: 1px solid #eee;
    background: #fff;
}

.lj-service__input textarea {
    flex: 1;
    min-height: 44px;
    max-height: 90px;
    padding: 6px 2px;
    border: 0;
    outline: none;
    background: transparent;
    color: #333;
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: none;
}

.lj-service__input textarea::placeholder {
    color: #a3a3a3;
}

.lj-service__input button {
    flex: 0 0 auto;
    height: 34px;
    padding: 0 14px;
    border: 0;
    border-radius: 4px;
    background: #bfbfbf;
    color: #fff;
    font-size: 13px;
    cursor: not-allowed;
    transition: background-color 0.2s ease;
}

.lj-service__input.has-content button:not(:disabled) {
    background: #07112a;
    cursor: pointer;
}

.lj-service__input.has-content button:not(:disabled):hover {
    background: #1d1d1f;
}

.lj-service__input button:disabled {
    background: #bfbfbf;
    cursor: not-allowed;
}

@media screen and (max-width: 768px) {
    .lj-service {
        right: 0;
        left: 0;
        bottom: var(--lj-service-kb, 0);
    }

    .lj-service__launcher {
        right: 20px;
        bottom: 20px;
        width: 60px;
        height: 60px;
    }

    .lj-service__launcher svg {
        width: 28px;
        height: 28px;
    }

    .lj-service__badge {
        min-width: 20px;
        height: 20px;
        border-radius: 10px;
        font-size: 11px;
        line-height: 16px;
    }

    .lj-service__window {
        width: 100%;
        height: min(78vh, 560px);
        height: min(78dvh, 560px);
        border-radius: 12px 12px 0 0;
    }

    .lj-service__title {
        height: 56px;
    }

    .lj-service__dialog {
        height: calc(100% - 56px);
    }

    .lj-service__output {
        padding: 16px 16px 8px;
    }

    .lj-service__quick-item {
        padding: 11px 12px;
    }
}
