/* 首次进聊天室：设置昵称与头像 */
.im-profile-mask {
    position: fixed;
    inset: 0;
    z-index: 10050;
    background: rgba(0, 0, 0, 0.55);
    display: none;
    align-items: center;
    justify-content: center;
    padding: 20px 16px;
    box-sizing: border-box;
}
.im-profile-mask.is-open {
    display: flex;
}
.im-profile-dialog {
    width: 100%;
    max-width: 360px;
    background: #fff;
    border-radius: 12px;
    overflow: hidden;
    box-shadow: 0 12px 40px rgba(0, 0, 0, 0.25);
}
.im-profile-dialog h3 {
    margin: 0;
    padding: 16px 18px 8px;
    font-size: 18px;
    font-weight: 600;
    color: #222;
    text-align: center;
}
.im-profile-dialog .im-profile-tip {
    margin: 0 18px 14px;
    font-size: 13px;
    color: #888;
    text-align: center;
    line-height: 1.5;
}
.im-profile-body {
    padding: 0 18px 8px;
}
.im-profile-avatar-wrap {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 10px;
    margin-bottom: 16px;
}
.im-profile-avatar-preview {
    width: 88px;
    height: 88px;
    border-radius: 50%;
    object-fit: cover;
    background: #f2f2f2;
    border: 2px solid #eee;
}
.im-profile-avatar-btn {
    display: inline-block;
    padding: 6px 14px;
    font-size: 13px;
    color: #c8161d;
    border: 1px solid #c8161d;
    border-radius: 16px;
    background: #fff;
    cursor: pointer;
}
.im-profile-field {
    margin-bottom: 14px;
}
.im-profile-field label {
    display: block;
    font-size: 13px;
    color: #666;
    margin-bottom: 6px;
}
.im-profile-field input[type="text"] {
    width: 100%;
    box-sizing: border-box;
    height: 40px;
    padding: 0 12px;
    border: 1px solid #ddd;
    border-radius: 8px;
    font-size: 15px;
    outline: none;
}
.im-profile-field input[type="text"]:focus {
    border-color: #c8161d;
}
.im-profile-error {
    min-height: 18px;
    margin: 0 18px 8px;
    font-size: 12px;
    color: #c8161d;
    text-align: center;
}
.im-profile-actions {
    padding: 8px 18px 18px;
}
.im-profile-submit {
    width: 100%;
    height: 42px;
    border: none;
    border-radius: 8px;
    background: #c8161d;
    color: #fff;
    font-size: 16px;
    cursor: pointer;
}
.im-profile-submit:disabled {
    opacity: 0.6;
    cursor: not-allowed;
}


/* chat-preset-avatar 20261025h */
.im-profile-dialog {
    position: relative;
    max-height: min(92vh, 640px);
    overflow: auto;
}
.im-profile-head {
    display: flex;
    align-items: center;
    gap: 8px;
    padding: 8px 8px 0 12px;
}
.im-profile-head h3 {
    flex: 1;
    padding: 8px 0;
    text-align: left;
}
.im-profile-close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 16px;
    background: #f3f3f3;
    color: #666;
    font-size: 22px;
    line-height: 32px;
    cursor: pointer;
    flex-shrink: 0;
}
.im-profile-presets {
    display: grid;
    grid-template-columns: repeat(4, 1fr);
    gap: 8px;
    width: 100%;
}
.im-profile-preset {
    width: 100%;
    aspect-ratio: 1;
    padding: 0;
    border: 2px solid transparent;
    border-radius: 50%;
    background: #f6f6f6;
    overflow: hidden;
    cursor: pointer;
}
.im-profile-preset.is-on {
    border-color: #c8161d;
}
.im-profile-preset img {
    width: 100%;
    height: 100%;
    display: block;
    object-fit: cover;
}
.im-profile-edit {
    flex-shrink: 0;
    height: 26px;
    padding: 0 10px;
    border-radius: 13px;
    border: 1px solid rgba(255, 255, 255, .9);
    background: transparent;
    color: #fff;
    font-size: 12px;
    line-height: 24px;
    cursor: pointer;
}
.im-chat-header .im-profile-edit {
    border-color: #c8161d;
    color: #c8161d;
    background: #fff;
    margin-right: 8px;
}
