.modal-dialog.ax-pm-dialog {
    max-width: 760px;
    width: 92%;
}

#chat {
    height: 640px;
}

#chat {
    overflow: hidden;
    border-radius: 3px;
}

#chat .main {
    height: 100%;
    display: flex;
    flex-direction: column;
}

#chat .main {
    position: relative;
    overflow: hidden;
}

.m-message ul {
    margin: 0;
    padding: 0;
    list-style: none;
}

.m-message {
    padding: 10px 15px;
    overflow-y: scroll;
}

 ::-webkit-scrollbar{ display: none;}

#chat .m-message {
    flex: 1;
    min-height: 0;
    height: auto;
}

#private_message_form {
    flex-shrink: 0;
}

.m-message li {
    margin-bottom: 16px;
    display: flex;
    flex-direction: column;
}

.m-message .time {
    margin: 6px 0;
    text-align: center;
}

.m-message .time>span {
    display: inline-block;
    padding: 2px 12px;
    font-size: 12px;
    color: #666;
    border-radius: 999px;
    background-color: #e9ecef;
}

/* ========= 核心修改：取消float，改用flex横向并排 ========= */
.m-message .msg-row {
    display: flex;
    gap:10px;
    align-items:flex-start;
    max-width: 85%;
}
/* 对方消息靠左 */
.m-message .msg-row-left {
    align-self:flex-start;
}
/* 自己消息靠右 */
.m-message .msg-row-right {
    align-self:flex-end;
    flex-direction: row-reverse;
}

.m-message .avatar {
    width:40px;
    height:40px;
    border-radius: 50%;
    flex-shrink:0;
    float:none !important;
    margin:0 !important;
}

.m-message .text {
    display: inline-block;
    position: relative;
    padding:10px 14px;
    max-width: calc(100% - 50px);
    line-height:1.6;
    font-size:14px;
    text-align: left;
    word-break: break-all;
    background-color: #ffffff;
    border-radius:14px;
    box-shadow: 0 1px 4px rgba(0,0,0,0.07);
}
/* 自己气泡蓝色 */
.m-message .msg-row-right .text {
    background-color: #4080ff;
    color:#fff;
}

/* 气泡尖角 */
.m-message .msg-row-left .text:before {
    content: " ";
    position: absolute;
    top:12px;
    right: 100%;
    border: 6px solid transparent;
    border-right-color: #ffffff;
}
.m-message .msg-row-right .text:before {
    right: inherit;
    left: 100%;
    border-right-color: transparent;
    border-left-color: #4080ff;
}

.m-message .text .pm-img {
    display: block;
    max-width: 220px;
    max-height: 320px;
    margin: 4px 0;
    border-radius:10px;
    cursor: pointer;
}

.pm-img-btn {
    display: flex;
    align-items: center;
    justify-content: center;
    width: 38px;
    height: 38px;
    padding: 0;
    cursor: pointer;
    flex-shrink: 0;
}

.pm-img-btn svg {
    width: 18px;
    height: 18px;
    fill: #666;
}

.pm-preview {
    position: relative;
    display: inline-flex;
    align-items: center;
    margin: 0 6px 0 0;
    flex-shrink: 0;
}

.pm-preview.d-none {
    display: none;
}

.pm-preview img {
    max-width: 60px;
    max-height: 60px;
    border-radius: 8px;
}

.pm-preview-del {
    position: absolute;
    top: -6px;
    right: -6px;
    width: 20px;
    height: 20px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(0,0,0,0.75);
    color: #fff;
    line-height: 18px;
    font-size: 14px;
    cursor: pointer;
}

.pm-lightbox {
    display: none;
    position: fixed;
    z-index: 99999;
    top: 0;
    left: 0;
    right: 0;
    bottom: 0;
    align-items: center;
    justify-content: center;
    overflow: hidden;
    background: rgba(0, 0, 0, 0.75);
    cursor: zoom-out;
}

.pm-lightbox.is-open {
    display: flex;
}

.pm-lightbox img {
    max-width: 90%;
    max-height: 90%;
    border-radius: 4px;
    box-shadow: 0 4px 24px rgba(0, 0, 0, 0.4);
    cursor: zoom-in;
    transition: transform 0.15s ease;
    user-select: none;
    -webkit-user-drag: none;
}

.pm-lightbox img.is-zoomed {
    cursor: zoom-out;
}

.ax-pm-reply {
    display: inline-block;
    color: #007bff;
    cursor: pointer;
    white-space: nowrap;
}
