.official-support,
.official-support * {
    box-sizing: border-box;
}

.official-support {
    position: fixed;
    right: 24px;
    bottom: 24px;
    z-index: 9999;
    color: #1f2d3d;
    font-family: "Microsoft YaHei", "PingFang SC", Arial, sans-serif;
    font-size: 14px;
    line-height: 1.5;
}

.official-support__trigger {
    width: 52px;
    min-width: 52px;
    height: 48px;
    padding: 0;
    overflow: hidden;
    border: 0;
    border-radius: 24px;
    color: #fff;
    background: linear-gradient(135deg, #1180ff, #0768f5);
    box-shadow: 0 8px 24px rgba(11, 114, 240, .28);
    display: flex;
    align-items: center;
    justify-content: center;
    gap: 0;
    cursor: pointer;
    font: inherit;
    font-weight: 600;
    transition: width .2s ease, gap .2s ease, box-shadow .2s ease;
}

.official-support__trigger:hover,
.official-support__trigger:focus-visible {
    width: 112px;
    gap: 8px;
    color: #fff;
    box-shadow: 0 10px 28px rgba(11, 114, 240, .36);
}

.official-support__trigger:focus-visible {
    outline: 3px solid rgba(11, 114, 240, .24);
    outline-offset: 3px;
}

.official-support__trigger img {
    width: 24px;
    height: 24px;
    flex: 0 0 auto;
}

.official-support__trigger-text {
    max-width: 0;
    overflow: hidden;
    opacity: 0;
    white-space: nowrap;
    transition: max-width .2s ease, opacity .15s ease;
}

.official-support__trigger:hover .official-support__trigger-text,
.official-support__trigger:focus-visible .official-support__trigger-text {
    max-width: 64px;
    opacity: 1;
}

.official-support__badge {
    position: absolute;
    top: -5px;
    right: -5px;
    min-width: 19px;
    height: 19px;
    padding: 0 5px;
    border: 2px solid #fff;
    border-radius: 10px;
    color: #fff;
    background: #f04438;
    font-size: 11px;
    font-weight: 700;
    line-height: 15px;
    text-align: center;
}

.official-support__badge[hidden] {
    display: none;
}

.official-support__window {
    position: absolute;
    right: 0;
    bottom: 60px;
    width: 380px;
    height: 560px;
    max-height: calc(100vh - 110px);
    overflow: hidden;
    border: 1px solid #dce6f5;
    border-radius: 16px;
    background: #fff;
    box-shadow: 0 18px 50px rgba(15, 64, 128, .18);
    display: flex;
    flex-direction: column;
    opacity: 1;
    transform: translateY(0) scale(1);
    transform-origin: right bottom;
    transition: visibility .18s ease, opacity .18s ease, transform .18s ease;
}

.official-support__window[hidden] {
    display: flex;
    visibility: hidden;
    pointer-events: none;
    opacity: 0;
    transform: translateY(12px) scale(.98);
}

.official-support__header {
    min-height: 76px;
    padding: 16px 18px;
    color: #fff;
    background: linear-gradient(105deg, #1180ff, #0768f5 55%, #006cf7);
    display: flex;
    justify-content: space-between;
    align-items: flex-start;
}

.official-support__title {
    margin: 0;
    color: #fff;
    display: flex;
    align-items: center;
    gap: 7px;
    font-size: 17px;
    font-weight: 700;
}

.official-support__title img {
    width: 21px;
    height: 21px;
}

.official-support__subtitle {
    display: block;
    margin-top: 5px;
    font-size: 12px;
    opacity: .85;
}

.official-support__header-actions {
    display: flex;
    gap: 4px;
}

.official-support__header-button {
    width: 30px;
    height: 30px;
    padding: 0;
    border: 0;
    border-radius: 8px;
    color: #fff;
    background: rgba(255, 255, 255, .12);
    cursor: pointer;
    font: 20px/30px Arial, sans-serif;
    text-align: center;
}

.official-support__header-button:hover {
    color: #fff;
    background: rgba(255, 255, 255, .22);
}

.official-support__header-button:focus-visible {
    outline: 2px solid rgba(255, 255, 255, .72);
    outline-offset: 1px;
}

.official-support__messages {
    position: relative;
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    padding: 16px;
    background: #f5f8fc;
    scrollbar-width: thin;
    scrollbar-color: #cbd5e1 transparent;
}

.official-support__empty {
    min-height: 100%;
    padding: 30px 12px;
    color: #64748b;
    text-align: center;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
}

.official-support__empty-icon {
    width: 54px;
    height: 54px;
    margin-bottom: 12px;
    border-radius: 50%;
    background: #0b72f0;
    display: flex;
    align-items: center;
    justify-content: center;
}

.official-support__empty-icon img {
    width: 28px;
    height: 28px;
}

.official-support__empty strong {
    margin-bottom: 6px;
    color: #1f2d3d;
    font-size: 15px;
}

.official-support__empty span {
    font-size: 13px;
}

.official-support__message {
    margin-bottom: 14px;
    display: flex;
    flex-direction: column;
    align-items: flex-end;
}

.official-support__message--agent {
    align-items: flex-start;
}

.official-support__sender {
    margin: 0 7px 4px;
    color: #7c889b;
    font-size: 12px;
}

.official-support__bubble {
    max-width: 78%;
    margin: 0;
    padding: 10px 13px;
    border-radius: 13px 13px 3px 13px;
    color: #fff;
    background: #0b72f0;
    line-height: 1.55;
    white-space: pre-wrap;
    word-break: break-word;
}

.official-support__message--agent .official-support__bubble {
    border: 1px solid #e6ebf2;
    border-radius: 13px 13px 13px 3px;
    color: #1f2d3d;
    background: #fff;
}

.official-support__time {
    margin: 4px 7px 0;
    color: #9aa6b2;
    font-size: 11px;
}

.official-support__closed-tip {
    margin: 14px 0;
    padding: 8px 12px;
    border-radius: 12px;
    color: #697586;
    background: #e9f0fa;
    font-size: 12px;
    text-align: center;
}

.official-support__status {
    margin: 0;
    padding: 8px 14px;
    color: #b42318;
    background: #fef3f2;
    border-top: 1px solid #fee4e2;
    font-size: 12px;
}

.official-support__status[hidden] {
    display: none;
}

.official-support__composer {
    padding: 12px 14px;
    border-top: 1px solid #e6ebf2;
    background: #fff;
}

.official-support__input {
    width: 100%;
    min-height: 72px;
    max-height: 110px;
    padding: 9px 11px;
    resize: none;
    border: 1px solid #dcdfe6;
    border-radius: 5px;
    outline: none;
    color: #303133;
    background: #fff;
    font: inherit;
    line-height: 1.5;
    transition: border-color .15s ease, box-shadow .15s ease;
}

.official-support__input::placeholder {
    color: #a8abb2;
}

.official-support__input:focus {
    border-color: #0b72f0;
    box-shadow: 0 0 0 2px rgba(11, 114, 240, .1);
}

.official-support__composer-actions {
    margin-top: 8px;
    display: flex;
    justify-content: space-between;
    align-items: center;
    gap: 10px;
}

.official-support__hint {
    color: #8a8f99;
    font-size: 11px;
}

.official-support__send {
    min-width: 74px;
    height: 32px;
    padding: 0 14px;
    border: 1px solid #0b72f0;
    border-radius: 4px;
    color: #fff;
    background: #0b72f0;
    cursor: pointer;
    font: inherit;
    font-size: 13px;
}

.official-support__send:hover:not(:disabled) {
    border-color: #0f8df5;
    color: #fff;
    background: #0f8df5;
}

.official-support__send:focus-visible {
    outline: 3px solid rgba(11, 114, 240, .2);
    outline-offset: 2px;
}

.official-support__send:disabled,
.official-support__input:disabled {
    cursor: not-allowed;
    opacity: .6;
}

.official-support__loading::after {
    content: "正在加载…";
    position: absolute;
    inset: 0;
    z-index: 2;
    color: #64748b;
    background: rgba(245, 248, 252, .84);
    display: flex;
    align-items: center;
    justify-content: center;
    font-size: 13px;
}

@media (max-width: 600px) {
    .official-support {
        right: 14px;
        bottom: 14px;
    }

    .official-support__window {
        position: fixed;
        inset: 0;
        width: 100%;
        height: 100%;
        max-height: none;
        border: 0;
        border-radius: 0;
    }

    .official-support__trigger,
    .official-support__trigger:hover,
    .official-support__trigger:focus-visible {
        width: 52px;
        min-width: 52px;
        gap: 0;
    }

    .official-support__trigger-text {
        display: none;
    }

    .official-support__subtitle {
        max-width: 220px;
    }

    .official-support__hint {
        display: none;
    }

    .official-support__composer-actions {
        justify-content: flex-end;
    }
}

@media (prefers-reduced-motion: reduce) {
    .official-support__trigger,
    .official-support__trigger-text,
    .official-support__window {
        transition: none;
    }
}
