.junkun-ai {
    position: fixed;
    right: 22px;
    bottom: 22px;
    z-index: 99998;
    font-family: Inter, Arial, sans-serif;
}

.junkun-ai *,
.junkun-ai *::before,
.junkun-ai *::after {
    box-sizing: border-box;
}

.junkun-ai__launcher {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    min-height: 48px;
    padding: 4px 15px 4px 5px;
    color: #fff;
    font-size: 12px;
    font-weight: 700;
    background: linear-gradient(135deg, #078ed1, #066a9d);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 999px;
    box-shadow: 0 12px 30px rgba(6, 55, 86, 0.28);
    cursor: pointer;
}

.junkun-ai__launcher .junkun-ai__spark {
    font-size: 19px;
}

.junkun-ai__logo-badge {
    display: grid;
    flex: 0 0 auto;
    width: 40px;
    height: 40px;
    place-items: center;
}

.junkun-ai__logo-badge img {
    display: block;
    width: 38px;
    height: 38px;
    object-fit: contain;
}

.junkun-ai__panel {
    position: absolute;
    right: 0;
    bottom: 64px;
    width: min(380px, calc(100vw - 28px));
    overflow: hidden;
    background: #fff;
    border: 1px solid #cfe0e9;
    border-radius: 16px;
    box-shadow: 0 22px 58px rgba(5, 42, 67, 0.24);
}

.junkun-ai__panel[hidden] {
    display: none !important;
}

.junkun-ai__header {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 16px 17px;
    color: #fff;
    background: linear-gradient(125deg, #061b2e, #075f87);
}

.junkun-ai__brand-logo {
    display: grid;
    flex: 0 0 auto;
    width: 42px;
    height: 42px;
    place-items: center;
}

.junkun-ai__brand-logo img {
    display: block;
    width: 40px;
    height: 40px;
    object-fit: contain;
}

.junkun-ai__heading {
    flex: 1 1 auto;
    min-width: 0;
    margin-left: 9px;
}

.junkun-ai__header strong,
.junkun-ai__header small {
    display: block;
}

.junkun-ai__header strong {
    font-size: 15px;
}

.junkun-ai__header small {
    margin-top: 2px;
    color: rgba(255, 255, 255, 0.72);
    font-size: 11px;
}

.junkun-ai__close,
.junkun-ai__clear {
    width: 32px;
    height: 32px;
    padding: 0;
    color: #fff;
    font-size: 24px;
    line-height: 1;
    background: rgba(255, 255, 255, 0.10);
    border: 1px solid rgba(255, 255, 255, 0.18);
    border-radius: 50%;
    cursor: pointer;
}

.junkun-ai__clear {
    margin-right: 6px;
    font-size: 18px;
}

.junkun-ai__messages {
    display: flex;
    flex-direction: column;
    gap: 10px;
    height: 330px;
    padding: 15px;
    overflow-y: auto;
    background: #f2f7fa;
}

.junkun-ai__message {
    max-width: 88%;
    padding: 10px 12px;
    color: #17364b;
    font-size: 13px;
    line-height: 1.5;
    white-space: pre-wrap;
    background: #fff;
    border: 1px solid #d5e3ea;
    border-radius: 12px 12px 12px 3px;
}

.junkun-ai__message--user {
    align-self: flex-end;
    color: #fff;
    background: #087eb6;
    border-color: #087eb6;
    border-radius: 12px 12px 3px 12px;
}

.junkun-ai__message a {
    display: inline-block;
    margin: 7px 4px 0 0;
    padding: 6px 9px;
    color: #067aaa;
    font-weight: 700;
    text-decoration: none;
    background: #e6f4fa;
    border-radius: 7px;
}

.junkun-ai__form {
    display: grid;
    grid-template-columns: minmax(0, 1fr) auto;
    gap: 8px;
    padding: 12px 12px 7px;
    background: #fff;
}

.junkun-ai__form textarea {
    width: 100%;
    min-height: 46px;
    max-height: 110px;
    margin: 0;
    padding: 10px 11px;
    resize: vertical;
    color: #17364b;
    font: inherit;
    font-size: 13px;
    background: #f8fbfc;
    border: 1px solid #cbdde6;
    border-radius: 9px;
    outline: none;
}

.junkun-ai__form textarea:focus {
    border-color: #078ed1;
    box-shadow: 0 0 0 2px rgba(7, 142, 209, 0.12);
}

.junkun-ai__form button {
    align-self: stretch;
    padding: 0 15px;
    color: #fff;
    font-size: 13px;
    font-weight: 700;
    background: #078ed1;
    border: 0;
    border-radius: 9px;
    cursor: pointer;
}

.junkun-ai__form button:disabled {
    opacity: 0.6;
    cursor: wait;
}

.junkun-ai__privacy {
    margin: 0;
    padding: 0 13px 10px;
    color: #718694;
    font-size: 10px;
    background: #fff;
}

@media (max-width: 544px) {
    .junkun-ai {
        right: 12px;
        bottom: 12px;
    }

    .junkun-ai__launcher {
        min-height: 46px;
        padding: 3px 13px 3px 4px;
    }

    .junkun-ai__panel {
        bottom: 58px;
        width: calc(100vw - 24px);
    }

    .junkun-ai__messages {
        height: min(360px, 48vh);
    }
}

