.wuai-pm-page {
    max-width: 960px;
    margin: 0 auto;
    padding: 16px 12px 86px;
    color: #242333;
}

.wuai-pm-topbar,
.wuai-pm-chat-topbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    background: rgba(255,255,255,.96);
    border: 1px solid rgba(139, 92, 246, .12);
    border-radius: 18px;
    padding: 12px 14px;
    box-shadow: 0 12px 28px rgba(139, 92, 246, .08);
    margin-bottom: 14px;
}

.wuai-pm-topbar-icon {
    flex: 0 0 auto;
    width: 38px;
    height: 38px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 999px;
    color: var(--xh-primary);
    background: rgba(139, 92, 246, .10);
    text-decoration: none;
}

.wuai-pm-topbar-title {
    flex: 1;
    min-width: 0;
    text-align: center;
}

.wuai-pm-topbar-title h1,
.wuai-pm-chat-user h1 {
    margin: 0;
    font-size: 20px;
    font-weight: 800;
}

.wuai-pm-topbar-title p,
.wuai-pm-chat-user p {
    margin: 3px 0 0;
    font-size: 12px;
    color: #8a8492;
}

.wuai-pm-list-card {
    background: #fff;
    border: 1px solid rgba(139, 92, 246, .12);
    border-radius: 20px;
    box-shadow: 0 12px 30px rgba(27,31,44,.06);
    overflow: hidden;
}

.wuai-pm-conversation {
    position: relative;
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 12px;
    border-bottom: 1px solid #f4eef3;
    background: #fff;
}

.wuai-pm-conversation:last-child {
    border-bottom: 0;
}

.wuai-pm-conversation-main {
    flex: 1;
    min-width: 0;
    display: flex;
    align-items: center;
    gap: 12px;
    color: inherit;
    text-decoration: none;
}

.wuai-pm-avatar-wrap {
    position: relative;
    flex: 0 0 auto;
}

.wuai-pm-avatar-wrap img,
.wuai-pm-chat-user img,
.wuai-pm-message img {
    width: 48px;
    height: 48px;
    border-radius: 50%;
    object-fit: cover;
    background: #f5f5f5;
}

.wuai-pm-avatar-wrap em {
    position: absolute;
    right: -7px;
    top: -6px;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #ff235f;
    color: #fff;
    font-size: 11px;
    line-height: 18px;
    font-style: normal;
    text-align: center;
    box-shadow: 0 0 0 2px #fff;
}

.wuai-pm-conversation-text {
    flex: 1;
    min-width: 0;
}

.wuai-pm-conversation-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px;
    margin-bottom: 4px;
}

.wuai-pm-conversation-head strong {
    min-width: 0;
    font-size: 16px;
    font-weight: 800;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wuai-pm-conversation-head small,
.wuai-pm-conversation-last {
    color: #8a8492;
    font-size: 12px;
}

.wuai-pm-conversation-last {
    display: block;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wuai-pm-delete {
    border: 0;
    border-radius: 999px;
    background: rgba(139, 92, 246, .10);
    color: var(--xh-primary);
    font-size: 12px;
    padding: 7px 10px;
}

.wuai-pm-empty,
.wuai-pm-chat-empty {
    text-align: center;
    padding: 42px 18px;
    color: #8a8492;
}

.wuai-pm-empty-icon {
    width: 58px;
    height: 58px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    border-radius: 20px;
    color: var(--xh-primary);
    background: linear-gradient(135deg, rgba(139, 92, 246, .10), #ffe2ef);
    font-size: 26px;
    margin-bottom: 12px;
}

.wuai-pm-empty h2 {
    font-size: 18px;
    font-weight: 800;
    color: #242333;
}

.wuai-pm-chat-page {
    max-width: 720px;
    padding-bottom: 96px;
}

.wuai-pm-chat-topbar {
    position: sticky;
    top: 0;
    z-index: 8;
    border-radius: 0 0 18px 18px;
    margin: -16px -12px 12px;
}

.wuai-pm-chat-user {
    display: flex;
    align-items: center;
    gap: 10px;
    flex: 1;
    min-width: 0;
}

.wuai-pm-chat-user h1,
.wuai-pm-chat-user p {
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap;
}

.wuai-pm-chat-messages {
    min-height: 55vh;
    padding: 8px 0 14px;
}

.wuai-pm-message {
    display: flex;
    align-items: flex-end;
    gap: 8px;
    margin: 12px 0;
}

.wuai-pm-message.is-self {
    justify-content: flex-end;
}

.wuai-pm-message img {
    width: 36px;
    height: 36px;
}

.wuai-pm-bubble-wrap {
    max-width: min(72%, 520px);
}

.wuai-pm-bubble {
    padding: 10px 12px;
    border-radius: 16px 16px 16px 4px;
    background: #fff;
    border: 1px solid #f2d7e4;
    box-shadow: 0 8px 20px rgba(27,31,44,.06);
    line-height: 1.6;
    word-break: break-word;
}

.wuai-pm-message.is-self .wuai-pm-bubble {
    color: #fff;
    background: linear-gradient(135deg, var(--xh-primary-2), var(--xh-primary));
    border-color: transparent;
    border-radius: 16px 16px 4px 16px;
}

.wuai-pm-bubble-wrap time {
    display: block;
    margin-top: 4px;
    font-size: 11px;
    color: #aaa3af;
}

.wuai-pm-message.is-self time {
    text-align: right;
}

.wuai-pm-chat-form {
    position: fixed;
    left: 50%;
    bottom: 0;
    transform: translateX(-50%);
    z-index: 20;
    width: min(720px, 100%);
    display: flex;
    align-items: flex-end;
    gap: 8px;
    padding: 10px 12px calc(10px + env(safe-area-inset-bottom));
    background: rgba(255,255,255,.96);
    border-top: 1px solid rgba(139, 92, 246, .14);
    box-shadow: 0 -8px 26px rgba(27,31,44,.08);
}

.wuai-pm-chat-form textarea {
    flex: 1;
    max-height: 120px;
    min-height: 42px;
    resize: none;
    border: 1px solid #f0ccd9;
    border-radius: 18px;
    padding: 10px 12px;
    outline: none;
    background: #fff8fb;
}

.wuai-pm-chat-form textarea:focus {
    border-color: var(--xh-primary-2);
    box-shadow: 0 0 0 3px rgba(139, 92, 246, .12);
}

.wuai-pm-chat-form button {
    flex: 0 0 auto;
    height: 42px;
    border: 0;
    border-radius: 999px;
    padding: 0 18px;
    color: #fff;
    font-weight: 800;
    background: linear-gradient(135deg, var(--xh-primary-2), var(--xh-primary));
    box-shadow: 0 8px 20px rgba(139, 92, 246, .25);
}

.wuai-pm-chat-body .bottom-nav {
    display: none !important;
}

.wuai-pm-public-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-height: 32px;
    padding: 0 13px;
    margin-left: 8px;
    border-radius: 999px;
    color: var(--xh-primary) !important;
    background: rgba(255,255,255,.86);
    border: 1px solid rgba(255,255,255,.55);
    font-weight: 700;
    text-decoration: none !important;
    box-shadow: 0 8px 18px rgba(139, 92, 246, .12);
}

.wuai-public-actions {
    display: inline-flex;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    flex: 0 0 auto;
}

.wuai-message-category-private {
    background: linear-gradient(135deg, #ffedf6, #ffd7e8) !important;
    color: var(--xh-primary) !important;
}

@media (max-width: 767px) {
    .wuai-pm-page {
        padding: 10px 10px 82px;
    }

    .wuai-pm-topbar {
        border-radius: 16px;
    }

    .wuai-pm-conversation {
        padding: 11px 10px;
    }

    .wuai-pm-avatar-wrap img {
        width: 44px;
        height: 44px;
    }

    .wuai-pm-delete {
        padding: 6px 8px;
    }

    .wuai-pm-bubble-wrap {
        max-width: 76%;
    }
}

/* V1.1 私信轻量化：会话列表收紧、聊天详情隐藏底部导航并固定输入 */
.wuai-pm-page {
    max-width: 860px;
}

.wuai-pm-list-page {
    min-height: calc(100vh - 76px);
    padding-bottom: 74px;
}

.wuai-pm-list-topbar {
    min-height: 58px;
    margin: 0 0 6px;
    padding: 8px 0 10px;
    border: 0;
    border-radius: 0;
    background: transparent;
    box-shadow: none;
}

.wuai-pm-list-topbar .wuai-pm-topbar-title h1 {
    margin: 0;
    font-size: 22px;
    line-height: 1.15;
}

.wuai-pm-list-topbar .wuai-pm-topbar-title p {
    margin-top: 3px;
    font-size: 12px;
}

.wuai-pm-list-note {
    margin: 0 0 10px;
    padding: 0 6px;
    color: #928a96;
    font-size: 12px;
}

.wuai-pm-list-card {
    min-height: auto;
    border-radius: 18px;
    overflow: hidden;
}

.wuai-pm-conversation {
    min-height: 72px;
    padding: 10px 12px;
}

.wuai-pm-conversation-main {
    gap: 10px;
}

.wuai-pm-avatar-wrap img {
    width: 46px;
    height: 46px;
}

.wuai-pm-conversation-head strong {
    font-size: 15px;
}

.wuai-pm-conversation-head small {
    flex: 0 0 auto;
    margin-left: 8px;
    color: #a59dab;
}

.wuai-pm-delete {
    align-self: center;
    min-width: 30px;
    padding: 5px 4px;
    color: #bbb2bd;
    background: transparent;
}

.wuai-pm-delete:hover,
.wuai-pm-delete:focus {
    color: var(--xh-primary);
    background: rgba(139, 92, 246, .10);
}

.wuai-pm-chat-body .bottom-nav,
.wuai-pm-chat-body #footer {
    display: none !important;
}

.wuai-pm-chat-page {
    max-width: 720px;
    min-height: 100vh;
    padding: 0 10px 78px;
}

.wuai-pm-chat-topbar {
    min-height: 78px;
    margin: 0 -10px 8px;
    padding: 10px 12px;
    border: 1px solid rgba(139, 92, 246, .12);
    border-radius: 0 0 18px 18px;
    box-shadow: 0 10px 24px rgba(139, 92, 246, .08);
}

.wuai-pm-chat-user {
    gap: 8px;
}

.wuai-pm-chat-user img {
    width: 46px;
    height: 46px;
}

.wuai-pm-chat-user h1 {
    font-size: 17px;
    line-height: 1.2;
}

.wuai-pm-chat-user p {
    margin-top: 2px;
    font-size: 12px;
}

.wuai-pm-chat-messages {
    min-height: calc(100vh - 170px);
    padding: 4px 0 10px;
}

.wuai-pm-message {
    gap: 7px;
    margin: 8px 0;
}

.wuai-pm-message img {
    width: 32px;
    height: 32px;
}

.wuai-pm-bubble-wrap {
    max-width: min(70%, 500px);
}

.wuai-pm-bubble {
    padding: 8px 11px;
    line-height: 1.5;
    border-radius: 15px 15px 15px 4px;
}

.wuai-pm-message.is-self .wuai-pm-bubble {
    border-radius: 15px 15px 4px 15px;
}

.wuai-pm-bubble-wrap time {
    margin-top: 3px;
}

.wuai-pm-chat-form {
    width: min(720px, 100%);
    padding: 9px 12px calc(9px + env(safe-area-inset-bottom));
}

.wuai-pm-chat-form textarea {
    min-height: 40px;
    padding: 9px 12px;
}

.wuai-pm-chat-form button {
    height: 40px;
    padding: 0 17px;
}

.wuai-pm-chat-form button:disabled {
    color: #fff;
    cursor: not-allowed;
    background: #d9d3dc;
    box-shadow: none;
}

@media (max-width: 767px) {
    .wuai-pm-page {
        padding-left: 10px;
        padding-right: 10px;
    }

    .wuai-pm-list-topbar {
        padding-left: 2px;
        padding-right: 2px;
    }

    .wuai-pm-conversation {
        padding: 10px;
    }

    .wuai-pm-delete {
        font-size: 11px;
    }

    .wuai-pm-chat-page {
        padding-bottom: 76px;
    }

    .wuai-pm-bubble-wrap {
        max-width: 76%;
    }
}
