/* message plugin front styles */

.msg-tabs {
    display: flex;
    gap: 10px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line)
}

.msg-tab {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    padding: 8px 14px;
    border-radius: 999px;
    background: var(--chip);
    color: var(--text-soft);
    font-size: 14px;
    font-weight: 600;
    transition: background .15s,color .15s
}

.msg-tab.on {
    background: var(--accent);
    color: var(--accent-ink)
}

.msg-badge {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e11d48;
    color: #fff;
    font-size: 11px;
    font-weight: 700;
    margin-left: 2px
}

.msg-tabs-head {
    display: none;
    gap: 4px;
    padding: 4px;
    border: 0;
    border-radius: 999px;
    background: var(--chip)
}

.msg-tabs-head .msg-tab {
    padding: 0 22px;
    height: 38px;
    border-radius: 999px;
    background: transparent;
    font-size: 14px;
    font-weight: 600;
    gap: 6px
}

.msg-tabs-head .msg-tab.on {
    background: var(--accent);
    color: var(--accent-ink);
    font-weight: 700
}

.msg-tabs-head .msg-badge {
    min-width: 20px;
    height: 20px;
    font-size: 12px
}

.msg-tabs-mobile {
    display: flex
}

@media (max-width: 767px) {
    .uc-panel-head:has(+ .msg-tabs-mobile) {
        flex-direction:column;
        align-items: flex-start;
        gap: 8px
    }

    .msg-tabs-mobile {
        display: flex;
        flex-wrap: nowrap;
        align-items: stretch;
        gap: 6px;
        margin: 0;
        padding: 0 14px 14px;
        border-bottom: 1px solid var(--line);
        box-sizing: border-box;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none
    }

    .msg-tabs-mobile::-webkit-scrollbar {
        display: none
    }

    .msg-tabs-mobile .msg-tab {
        flex: 1 1 0;
        min-width: 0;
        justify-content: center;
        height: 34px;
        padding: 0 6px;
        font-size: 12px;
        font-weight: 650;
        gap: 3px;
        white-space: nowrap;
        overflow: hidden;
        box-sizing: border-box;
        line-height: 1
    }

    .msg-tabs-mobile .msg-tab i {
        font-size: 14px;
        flex: 0 0 auto
    }

    .msg-tabs-mobile .msg-badge {
        min-width: 16px;
        height: 16px;
        padding: 0 4px;
        font-size: 10px;
        margin-left: 0
    }
}

.msg-list {
    display: flex;
    flex-direction: column;
    gap: 12px;
    padding: 18px 22px
}

.msg-conv-list {
    display: flex;
    flex-direction: column;
    padding: 8px 10px 16px
}

.msg-conv {
    display: flex;
    align-items: center;
    gap: 12px;
    padding: 12px 12px;
    border-radius: 16px;
    text-decoration: none;
    color: inherit;
    transition: background .15s
}

.msg-conv:hover {
    background: var(--chip)
}

.msg-conv.has-new {
    background: rgba(59,130,246,.06)
}

.msg-conv.has-new:hover {
    background: rgba(59,130,246,.1)
}

.msg-conv-avatar-wrap {
    position: relative;
    flex: 0 0 auto;
    line-height: 0
}

.msg-conv-avatar .uc-avatar-img,.msg-conv .uc-avatar.msg-conv-avatar .uc-avatar-img {
    width: 48px;
    height: 48px;
    border-width: 2px
}

.msg-conv-avatar .uc-avatar-badge,.msg-conv .uc-avatar.msg-conv-avatar .uc-avatar-badge {
    width: 18px;
    height: 18px;
    font-size: 13px;
    right: -3px;
    bottom: -3px
}

.msg-conv-badge {
    position: absolute;
    top: -4px;
    right: -6px;
    z-index: 2;
    min-width: 18px;
    height: 18px;
    padding: 0 5px;
    border-radius: 999px;
    background: #e11d48;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    font-style: normal;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    box-shadow: 0 0 0 2px var(--card,#fff)
}

.msg-conv-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 6px
}

.msg-conv-row {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 10px
}

.msg-conv-name {
    font-size: 15px;
    font-weight: 550;
    color: var(--text);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.msg-conv.has-new .msg-conv-name {
    font-weight: 650
}

.msg-conv-time {
    flex: 0 0 auto;
    font-size: 12px;
    color: var(--muted)
}

.msg-conv-sub {
    align-items: center
}

.msg-conv-preview {
    min-width: 0;
    flex: 1;
    font-size: 13px;
    color: var(--muted);
    line-height: 1.4;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.msg-conv.has-new .msg-conv-preview {
    color: var(--text-soft);
    font-weight: 600
}

.msg-conv-preview em {
    font-style: normal;
    color: var(--muted);
    font-weight: 600;
    margin-right: 2px
}

.msg-conv-new {
    flex: 0 0 auto;
    height: 20px;
    padding: 0 8px;
    border-radius: 999px;
    background: #e11d48;
    color: #fff;
    font-size: 11px;
    font-weight: 800;
    line-height: 20px
}

.msg-conv .msg-read-state {
    flex: 0 0 auto;
    margin: 0
}

@media (min-width: 768px) {
    .msg-tabs-head {
        display:flex
    }

    .msg-tabs-mobile {
        display: none
    }
}

.msg-item {
    display: flex;
    align-items: flex-start;
    gap: 12px;
    padding: 16px 18px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    transition: background .15s,border-color .15s,box-shadow .15s
}

.msg-item:hover {
    border-color: var(--stroke-strong);
    box-shadow: var(--card-shadow)
}

.msg-item.unread {
    background: rgba(59,130,246,.06);
    border-color: rgba(59,130,246,.2)
}

.msg-item-body {
    flex: 1;
    min-width: 0
}

.msg-check,.msg-check-all {
    display: inline-flex;
    align-items: center;
    gap: 8px;
    flex: 0 0 auto;
    margin: 2px 0 0;
    cursor: pointer;
    user-select: none;
    color: var(--muted);
    font-size: 13px;
    font-weight: 550;
    line-height: 1
}

.msg-check input,.msg-check-all input {
    appearance: none;
    -webkit-appearance: none;
    width: 18px;
    height: 18px;
    margin: 0;
    flex: 0 0 auto;
    border: 1.5px solid rgba(0,0,0,.18);
    border-radius: 6px;
    background: #fff;
    box-shadow: inset 0 1px 2px rgba(0,0,0,.04);
    cursor: pointer;
    position: relative;
    transition: border-color .15s,background .15s,box-shadow .15s,transform .12s
}

.msg-check input:hover,.msg-check-all input:hover {
    border-color: rgba(0,0,0,.35)
}

.msg-check input:focus-visible,.msg-check-all input:focus-visible {
    outline: none;
    border-color: var(--accent);
    box-shadow: 0 0 0 3px var(--accent-soft)
}

.msg-check input:checked,.msg-check-all input:checked {
    background: var(--accent);
    border-color: var(--accent);
    box-shadow: none
}

.msg-check input:checked::after,.msg-check-all input:checked::after {
    content: "";
    position: absolute;
    left: 5px;
    top: 2px;
    width: 5px;
    height: 9px;
    border: solid #fff;
    border-width: 0 2px 2px 0;
    transform: rotate(45deg)
}

.msg-check input:active,.msg-check-all input:active {
    transform: scale(.94)
}

.msg-conv-item {
    display: flex;
    align-items: center;
    gap: 10px;
    padding: 0 8px
}

.msg-conv-item .msg-check {
    margin: 0
}

.msg-conv-item .msg-conv {
    flex: 1;
    min-width: 0
}

/* —— 官方群聊（与普通会话同行样式） —— */
.msg-conv--official .msg-conv-name,
.msg-chat-peer-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    max-width: 100%
}

.msg-official-mark {
    flex: 0 0 auto;
    height: 18px;
    padding: 0 6px;
    border-radius: 5px;
    background: rgba(59,130,246,.14);
    color: var(--accent, #3b82f6);
    font-size: 11px;
    font-weight: 700;
    font-style: normal;
    line-height: 18px
}

.msg-sender-name {
    margin: 0 0 2px 2px;
    font-size: 12px;
    font-weight: 600;
    color: var(--muted, #94a3b8);
    line-height: 1.3
}

.msg-sender-name a {
    color: inherit;
    text-decoration: none
}

.msg-sender-name a:hover {
    color: var(--accent, #3b82f6)
}

.msg-conv--official .msg-conv-avatar .uc-avatar-img,
.msg-conv--official .uc-avatar.msg-conv-avatar .uc-avatar-img {
    border-radius: 50%;
    object-fit: cover
}

html[data-uc-scheme="dark"] .msg-official-mark {
    background: rgba(96,165,250,.18);
    color: #93c5fd
}

.msg-toolbar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    flex-wrap: wrap;
    padding: 16px 22px 22px;
    margin-top: 4px;
    border-top: 1px solid var(--line)
}

.msg-toolbar-actions {
    display: flex;
    align-items: center;
    gap: 8px;
    flex-wrap: wrap
}

.msg-pager.uc-pager {
    padding: 0;
    margin: 0;
    width: auto;
    flex: 0 0 auto
}

.msg-pager-alone {
    margin-top: 16px;
    justify-content: flex-end
}

/* ThinkPHP Bootstrap 分页：与站点 .pager 视觉一致 */
ul.pagination {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    justify-content: flex-end;
    gap: 8px;
    list-style: none;
    margin: 0;
    padding: 0
}

ul.pagination > li {
    display: inline-flex;
    margin: 0;
    padding: 0
}

ul.pagination > li > a,
ul.pagination > li > span {
    min-width: 36px;
    height: 36px;
    padding: 0 12px;
    border-radius: 12px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: var(--surface);
    border: 1px solid var(--line);
    color: var(--muted);
    font-weight: 650;
    font-size: 13px;
    text-decoration: none;
    box-sizing: border-box;
    line-height: 1
}

ul.pagination > li > a:hover {
    border-color: var(--stroke-strong);
    color: var(--text)
}

ul.pagination > li.active > span,
ul.pagination > li.active > a {
    background: var(--accent);
    color: var(--accent-ink);
    border-color: transparent
}

ul.pagination > li.disabled > span,
ul.pagination > li.disabled > a {
    opacity: .45;
    cursor: default;
    pointer-events: none
}

ul.pagination.msg-page-rail {
    flex-wrap: nowrap;
    overflow: hidden
}

ul.pagination.msg-page-rail.is-shift-right {
    animation: msgPagerFromRight .28s ease
}

ul.pagination.msg-page-rail.is-shift-left {
    animation: msgPagerFromLeft .28s ease
}

@keyframes msgPagerFromRight {
    from { transform: translateX(36px) }
    to { transform: none }
}

@keyframes msgPagerFromLeft {
    from { transform: translateX(-36px) }
    to { transform: none }
}

.msg-meta {
    display: flex;
    align-items: center;
    justify-content: space-between;
    font-size: 13px;
    color: var(--muted);
    margin-bottom: 8px
}

.msg-from {
    font-weight: 600;
    color: var(--text-soft)
}

.msg-title {
    font-size: 15px;
    font-weight: 500;
    margin: 0 0 8px;
    line-height: 1.4
}

.msg-content {
    font-size: 14px;
    color: var(--text-soft);
    line-height: 1.6;
    word-break: break-word
}

.msg-actions {
    display: flex;
    gap: 10px;
    margin-top: 12px
}

.msg-btn {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    padding: 6px 14px;
    border-radius: 8px;
    border: 0;
    background: var(--accent-soft);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    text-decoration: none;
    transition: background .15s,color .15s,transform .1s
}

.msg-btn:hover {
    background: var(--accent);
    color: var(--accent-ink)
}

.msg-btn:active {
    transform: scale(.97)
}

.msg-btn.reply {
    background: var(--accent);
    color: var(--accent-ink)
}

.msg-btn.reply:hover {
    background: var(--accent-deep)
}

.msg-btn.mark-read:hover {
    background: var(--accent);
    color: var(--accent-ink)
}

.msg-btn.delete {
    background: #fee2e2;
    color: #dc2626
}

.msg-btn.delete:hover {
    background: #fecaca;
    color: #b91c1c
}

.msg-empty {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    padding: 60px 20px;
    color: var(--muted)
}

.msg-empty i {
    font-size: 48px;
    margin-bottom: 12px;
    opacity: .6
}

/* —— 私信对话卡片（对齐现代 IM 布局） —— */
.uc-panel.msg-chat-card,
.uc-panel:has(.msg-dialog) {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: hidden;
    border-radius: 16px;
    padding: 0;
    background: var(--card, #fff);
    border: 1px solid var(--line, #e8ecf2)
}

.msg-chat-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 12px;
    padding: 14px 18px;
    border-bottom: 1px solid var(--line, #eef1f6);
    background: var(--card, #fff);
    flex: 0 0 auto
}

.msg-chat-peer {
    display: flex;
    align-items: center;
    gap: 12px;
    min-width: 0
}

.msg-chat-peer-avatar .uc-avatar-img,
.msg-chat-peer .uc-avatar-img {
    width: 44px;
    height: 44px
}

.msg-chat-peer-meta {
    display: flex;
    flex-direction: column;
    gap: 2px;
    min-width: 0
}

.msg-chat-peer-name {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    margin: 0;
    font-size: 15px;
    font-weight: 700;
    color: var(--text, #1e293b);
    line-height: 1.3
}

.msg-chat-peer-name a {
    color: inherit;
    text-decoration: none
}

.msg-chat-peer-name a:hover {
    color: var(--accent)
}

.msg-chat-online-dot {
    width: 8px;
    height: 8px;
    border-radius: 50%;
    background: #22c55e;
    box-shadow: 0 0 0 3px rgba(34,197,94,.18);
    flex: 0 0 auto
}

.msg-chat-peer-status {
    font-size: 12px;
    color: var(--muted, #94a3b8);
    line-height: 1.3
}

.msg-chat-actions {
    display: flex;
    align-items: center;
    gap: 4px;
    flex: 0 0 auto
}

.msg-chat-action {
    width: 36px;
    height: 36px;
    border-radius: 10px;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    color: var(--muted, #94a3b8);
    font-size: 18px;
    text-decoration: none;
    transition: background .15s,color .15s
}

.msg-chat-action:hover {
    background: var(--chip, #f1f5f9);
    color: var(--text, #334155)
}

.msg-dialog {
    display: flex;
    flex-direction: column;
    gap: 10px;
    padding: 18px 20px;
    min-height: 320px;
    max-height: min(62vh, 640px);
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    min-width: 0;
    background: color-mix(in srgb, var(--bg, #f5f5f5) 72%, var(--chip, #ececec));
    scrollbar-width: none;
    -ms-overflow-style: none
}

.msg-dialog::-webkit-scrollbar {
    width: 0 !important;
    height: 0 !important;
    display: none !important
}

.msg-dialog[data-ui="v3"] {
    gap: 8px
}

.msg-row {
    display: flex;
    gap: 10px;
    align-items: flex-start;
    width: 100%;
    overflow: visible;
    min-width: 0
}

.msg-row.me {
    flex-direction: row-reverse
}

.msg-avatar-slot {
    flex: 0 0 auto;
    width: 38px;
    display: flex;
    align-items: flex-start;
    justify-content: center;
    padding-top: 2px;
    line-height: 0
}

.msg-row > .uc-avatar-link,
.msg-row > .uc-avatar,
.msg-avatar {
    flex: 0 0 auto
}

.msg-row .msg-avatar .uc-avatar-img,
.msg-row .uc-avatar.msg-avatar .uc-avatar-img,
.msg-avatar-slot .uc-avatar-img {
    width: 38px;
    height: 38px;
    border-width: 2px
}

.msg-row .msg-avatar .uc-avatar-badge,
.msg-row .uc-avatar.msg-avatar .uc-avatar-badge,
.msg-avatar-slot .uc-avatar-badge {
    width: 16px;
    height: 16px;
    font-size: 12px;
    right: -3px;
    bottom: -3px
}

.msg-col {
    display: flex;
    flex-direction: column;
    max-width: min(520px, calc(100% - 52px));
    min-width: 0;
    flex: 0 1 auto
}

.msg-row.me .msg-col {
    align-items: flex-end
}

.msg-row:not(.me) .msg-col {
    align-items: flex-start
}

.msg-bubble-wrap {
    display: flex;
    align-items: flex-end;
    gap: 6px;
    max-width: 100%;
    min-width: 0
}

.msg-row:not(.me) .msg-bubble-wrap {
    flex-direction: row-reverse
}

.msg-bubble {
    flex: 0 1 auto;
    width: fit-content;
    max-width: 100%;
    min-width: 0;
    padding: 11px 15px;
    border-radius: 18px;
    font-size: 14px;
    line-height: 1.55;
    word-break: break-word;
    overflow-wrap: anywhere;
    box-sizing: border-box;
    box-shadow: 0 1px 2px rgba(15, 23, 42, .04)
}

.msg-row:not(.me) .msg-bubble {
    background: var(--card, #fff);
    color: var(--text, #1e293b);
    border: 1px solid var(--line, #eef1f6)
}

.msg-row:not(.me) .msg-bubble .msg-bubble-content {
    color: inherit
}

.msg-row.me .msg-bubble {
    background: var(--accent);
    color: var(--accent-ink, #fff);
    border: 0;
    box-shadow: 0 4px 14px color-mix(in srgb, var(--accent) 28%, transparent)
}

.msg-row.me .msg-bubble .msg-bubble-content {
    color: inherit
}

.msg-bubble-meta {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-top: 4px;
    padding: 0 4px;
    font-size: 11px;
    color: var(--muted, #94a3b8);
    line-height: 1.2;
    max-width: 100%
}

.msg-row.me .msg-bubble-meta {
    justify-content: flex-end
}

.msg-row:not(.me) .msg-bubble-meta {
    justify-content: flex-start
}

.msg-bubble-time {
    font-size: 11px;
    color: var(--muted, #94a3b8);
    white-space: nowrap
}

.msg-read-state {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    font-weight: 500;
    font-size: 11px;
    padding: 0;
    border-radius: 0;
    background: transparent;
    line-height: 1.4;
    color: var(--muted, #94a3b8)
}

.msg-read-state.read {
    color: var(--text-soft, #64748b);
    background: transparent
}

.msg-read-state:not(.read) {
    color: var(--muted, #94a3b8);
    background: transparent
}

.msg-quote-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    flex: 0 0 auto;
    width: auto;
    height: auto;
    min-height: 0;
    margin: 0 0 2px;
    padding: 1px 6px;
    border: 0;
    border-radius: 999px;
    background: var(--chip, #ececec);
    color: var(--muted, #94a3b8);
    font: inherit;
    font-size: 11px;
    font-weight: 600;
    line-height: 1.4;
    white-space: nowrap;
    cursor: pointer;
    opacity: 0;
    pointer-events: none;
    transition: opacity .15s, background .15s, color .15s
}

.msg-row:hover .msg-quote-btn,
.msg-quote-btn:focus {
    opacity: 1;
    pointer-events: auto
}

.msg-quote-btn:hover,
.msg-quote-btn:focus {
    background: var(--accent);
    color: var(--accent-ink, #fff)
}

.msg-quote {
    display: flex;
    flex-direction: column;
    width: fit-content;
    max-width: min(280px,100%);
    margin-top: 4px;
    padding: 6px 8px;
    border: 0;
    border-radius: 4px;
    background: var(--chip, #ededed);
    color: var(--muted, #888);
    text-decoration: none;
    box-sizing: border-box
}

.msg-quote:hover {
    background: color-mix(in srgb, var(--chip) 80%, var(--text));
    color: var(--text-soft, #666)
}

.msg-quote-name {
    display: block;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.35;
    margin: 0 0 1px;
    color: var(--muted, #888);
    opacity: 1
}

.msg-quote-text {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 12px;
    font-weight: 400;
    line-height: 1.4;
    color: var(--muted, #999);
    opacity: 1;
    word-break: break-word
}

/* 深色模式：对话区明确跟主题变量，避免硬编码浅色底 + 浅色字 */
html[data-uc-scheme="dark"] .msg-chat-card,
html[data-uc-scheme="dark"] .uc-panel:has(.msg-dialog) {
    background: var(--card);
    border-color: var(--line)
}

html[data-uc-scheme="dark"] .msg-chat-head,
html[data-uc-scheme="dark"] .msg-composer,
html[data-uc-scheme="dark"] .msg-reply-form,
html[data-uc-scheme="dark"] .msg-chat-card .msg-pager-alone {
    background: var(--card);
    border-color: var(--line)
}

html[data-uc-scheme="dark"] .msg-dialog {
    background: var(--bg-mid, #16181d)
}

html[data-uc-scheme="dark"] .msg-row:not(.me) .msg-bubble {
    background: var(--surface, #1a1d24);
    color: var(--text);
    border-color: var(--line);
    box-shadow: none
}

html[data-uc-scheme="dark"] .msg-row.me .msg-bubble {
    color: var(--accent-ink)
}

html[data-uc-scheme="dark"] .msg-composer-box {
    background: var(--chip);
    border-color: var(--line)
}

html[data-uc-scheme="dark"] .msg-composer-box:focus-within {
    background: var(--surface);
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    box-shadow: 0 0 0 3px var(--accent-soft)
}

html[data-uc-scheme="dark"] .msg-composer-input,
html[data-uc-scheme="dark"] .msg-composer .msg-reply-text {
    color: var(--text);
    -webkit-text-fill-color: var(--text)
}

html[data-uc-scheme="dark"] .msg-empty {
    color: var(--muted)
}

.msg-row:target .msg-bubble {
    animation: msg-quote-flash 1.1s ease
}

@keyframes msg-quote-flash {
    0%,35% { box-shadow: 0 0 0 2px color-mix(in srgb,currentColor 35%,transparent) }
    100% { box-shadow: 0 0 0 2px transparent }
}

.msg-composer-shell {
    display: flex;
    flex-direction: column;
    gap: 8px;
    min-width: 0;
    overflow: visible;
    background: transparent
}

.msg-quote-bar {
    display: flex;
    align-items: flex-start;
    gap: 10px;
    margin: 0;
    padding: 10px 12px;
    border: 1px solid color-mix(in srgb, var(--accent) 22%, var(--line));
    border-radius: var(--radius-sm, 12px);
    background: color-mix(in srgb, var(--accent) 12%, transparent)
}

.msg-quote-bar[hidden] {
    display: none!important
}

.msg-quote-bar-body {
    flex: 1;
    min-width: 0
}

.msg-quote-bar-body strong {
    display: block;
    font-size: 13px;
    font-weight: 600;
    color: var(--text-soft, #475569);
    line-height: 1.35;
    margin-bottom: 2px
}

.msg-quote-bar-body span {
    display: -webkit-box;
    -webkit-box-orient: vertical;
    -webkit-line-clamp: 2;
    overflow: hidden;
    font-size: 13px;
    line-height: 1.4;
    color: var(--text, #334155);
    opacity: 1;
    word-break: break-word;
    white-space: normal
}

.msg-quote-clear {
    flex: 0 0 auto;
    width: 24px;
    height: 24px;
    margin-top: 0;
    border: 0;
    border-radius: 4px;
    background: transparent;
    color: var(--muted, #94a3b8);
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center
}

.msg-quote-clear:hover {
    background: color-mix(in srgb, var(--text) 6%, transparent);
    color: var(--text)
}

.msg-reply-form,
.msg-composer {
    position: relative;
    z-index: 2;
    padding: 12px 16px 14px;
    border-top: 1px solid var(--line, #eef1f6);
    background: var(--card, #fff);
    overflow: visible;
    flex: 0 0 auto
}

html[data-uc-scheme="dark"] .msg-quote-bar {
    background: color-mix(in srgb, var(--accent) 18%, transparent)
}

html[data-uc-scheme="dark"] .msg-quote-bar-body strong {
    color: var(--text-soft)
}

html[data-uc-scheme="dark"] .msg-quote-bar-body span {
    color: var(--text)
}

.msg-composer-box {
    position: relative;
    display: flex;
    flex-direction: column;
    min-width: 0;
    border: 1px solid var(--line);
    border-radius: var(--radius-sm, 12px);
    background: var(--chip);
    transition: border-color .15s, box-shadow .15s, background .15s
}

.msg-composer-box:focus-within {
    border-color: color-mix(in srgb, var(--accent) 45%, var(--line));
    background: var(--surface);
    box-shadow: 0 0 0 3px var(--accent-soft)
}

.msg-composer-input,
.msg-composer .msg-reply-text {
    display: block;
    width: 100%;
    min-width: 0;
    min-height: 88px;
    max-height: 180px;
    margin: 0;
    padding: 12px 14px 8px;
    border: 0;
    border-radius: var(--radius-sm, 12px) var(--radius-sm, 12px) 0 0;
    background: transparent;
    color: var(--text, #1e293b);
    caret-color: var(--text, #1e293b);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.55;
    resize: none;
    outline: none;
    box-shadow: none;
    box-sizing: border-box
}

.msg-composer-input::placeholder,
.msg-composer .msg-reply-text::placeholder {
    color: var(--muted, #94a3b8);
    opacity: 1
}

.msg-composer-input:focus,
.msg-composer .msg-reply-text:focus {
    border: 0;
    box-shadow: none;
    color: var(--text, #1e293b)
}

.msg-images {
    display: flex;
    flex-wrap: wrap;
    gap: 8px;
    padding: 0 12px 8px
}

.msg-images[hidden] {
    display: none !important
}

.msg-image-item {
    position: relative;
    width: 64px;
    height: 64px;
    border-radius: 10px;
    overflow: hidden;
    border: 1px solid var(--line);
    background: var(--surface)
}

.msg-image-item img {
    width: 100%;
    height: 100%;
    object-fit: cover;
    display: block
}

.msg-image-del {
    position: absolute;
    top: 2px;
    right: 2px;
    width: 18px;
    height: 18px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(15, 23, 42, .65);
    color: #fff;
    font-size: 14px;
    line-height: 18px;
    cursor: pointer
}

.msg-composer-foot {
    display: flex;
    align-items: center;
    justify-content: space-between;
    gap: 8px;
    padding: 4px 8px 8px 8px
}

.msg-composer-tools {
    display: flex;
    align-items: center;
    gap: 2px;
    flex: 1 1 auto;
    min-width: 0
}

.msg-composer-tools .msg-emoji-wrap,
.msg-composer-tools .uc-emoji-wrap {
    margin: 0;
    position: relative
}

.msg-tool-btn,
.msg-composer .msg-emoji-toggle {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    color: var(--muted);
    font-size: 18px;
    line-height: 1;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none;
    transition: color .15s, background .15s, transform .12s
}

.msg-tool-btn:hover,
.msg-composer .msg-emoji-toggle:hover {
    background: var(--accent-soft);
    color: var(--accent)
}

.msg-tool-btn.on,
.msg-composer .msg-emoji-toggle.on {
    background: var(--accent);
    color: var(--accent-ink)
}

.msg-tool-btn:active,
.msg-composer .msg-emoji-toggle:active {
    transform: scale(.94)
}

.msg-tool-btn i {
    font-size: 18px;
    line-height: 1
}

.msg-composer-send,
.msg-composer .msg-send-btn {
    width: auto;
    min-width: 72px;
    height: 34px;
    margin: 0;
    padding: 0 16px;
    border: 0;
    border-radius: 999px;
    background: var(--accent);
    color: var(--accent-ink, #fff);
    font-size: 13px;
    font-weight: 700;
    line-height: 1;
    white-space: nowrap;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    cursor: pointer;
    box-shadow: none;
    transition: opacity .15s, transform .12s
}

.msg-composer-send:hover,
.msg-composer .msg-send-btn:hover {
    opacity: .92;
    color: var(--accent-ink, #fff);
    background: var(--accent);
    filter: none;
    transform: none
}

.msg-composer-send:active,
.msg-composer .msg-send-btn:active {
    transform: scale(.96)
}

.msg-composer-send:disabled,
.msg-composer .msg-send-btn:disabled {
    opacity: .45;
    cursor: not-allowed
}

/* 兼容旧版回复区（非对话卡片） */
.msg-reply-form:not(.msg-composer) .msg-reply-text {
    width: 100%;
    min-height: 90px;
    padding: 14px 16px;
    border: 1px solid var(--line);
    border-radius: 12px;
    background: var(--surface);
    color: var(--text);
    font-family: inherit;
    font-size: 14px;
    line-height: 1.6;
    resize: vertical;
    outline: none
}

.msg-reply-toolbar {
    display: flex;
    align-items: center;
    justify-content: flex-end;
    margin-top: 12px;
    gap: 10px
}

.msg-reply-toolbar .msg-emoji-toggle {
    height: 38px;
    padding: 0 16px;
    font-size: 13px;
    font-weight: 700;
    border-radius: var(--radius-sm)
}

.msg-reply-toolbar .msg-send-btn {
    height: 38px;
    padding: 0 18px;
    font-size: 13px;
    font-weight: 700;
    border-radius: var(--radius-sm)
}

.msg-chat-card .msg-pager-alone {
    margin: 0;
    padding: 10px 16px 14px;
    border-top: 1px solid var(--line, #eef1f6);
    background: var(--card, #fff)
}

@media (max-width: 768px) {
    .msg-dialog {
        min-height: 280px;
        max-height: min(58vh, 520px);
        padding: 14px 12px
    }

    .msg-chat-head {
        padding: 12px 12px
    }

    .msg-composer {
        padding: 10px 12px 12px
    }

    .msg-col {
        max-width: calc(100% - 48px)
    }
}

.msg-emoji-wrap,.uc-emoji-wrap {
    position: relative;
    flex: 0 0 auto
}

.msg-emoji-toggle {
    width: auto;
    min-width: 0;
    height: 32px;
    padding: 0 12px;
    border: 1px solid var(--line);
    background: var(--chip);
    color: var(--text);
    font-size: 13px;
    font-weight: 600;
    cursor: pointer;
    border-radius: var(--radius-sm);
    display: inline-flex;
    align-items: center;
    justify-content: center;
    white-space: nowrap;
    transition: color .15s,background .15s,border-color .15s
}

.msg-emoji-toggle:hover,.msg-emoji-toggle.on {
    background: var(--surface);
    border-color: var(--accent);
    color: var(--accent)
}

.msg-composer .msg-emoji-toggle,
.msg-composer .msg-tool-btn.msg-emoji-toggle {
    width: 32px;
    min-width: 32px;
    height: 32px;
    padding: 0;
    border: 0;
    border-radius: 10px;
    background: transparent;
    box-shadow: none;
    font-size: 18px;
    font-weight: 400;
    color: var(--muted)
}

.msg-composer .msg-emoji-toggle:hover,
.msg-composer .msg-tool-btn.msg-emoji-toggle:hover {
    background: var(--accent-soft);
    border: 0;
    color: var(--accent)
}

.msg-composer .msg-emoji-toggle.on,
.msg-composer .msg-tool-btn.msg-emoji-toggle.on {
    background: var(--accent);
    border: 0;
    color: var(--accent-ink)
}

.uc-emoji-picker,.msg-emoji-panel,.uc-pm-emoji-panel {
    position: absolute;
    left: 0;
    bottom: calc(100% + 6px);
    display: none;
    grid-template-columns: repeat(8,minmax(0,1fr));
    gap: 0;
    padding: 6px;
    background: var(--card);
    border: 1px solid var(--line);
    border-radius: 10px;
    box-shadow: 0 6px 20px rgba(0,0,0,.1);
    width: 248px;
    max-height: 140px;
    overflow-x: hidden;
    overflow-y: auto;
    overscroll-behavior: contain;
    scrollbar-width: none;
    -ms-overflow-style: none;
    z-index: 30;
    box-sizing: border-box
}

.uc-emoji-picker::-webkit-scrollbar,.msg-emoji-panel::-webkit-scrollbar,.uc-pm-emoji-panel::-webkit-scrollbar {
    width: 0!important;
    height: 0!important;
    display: none!important
}

.uc-emoji-picker.is-floating {
    position: fixed;
    bottom: auto;
    z-index: 100001
}

.uc-emoji-picker.is-inline {
    position: absolute;
    left: 0;
    bottom: calc(100% + 8px);
    top: auto;
    z-index: 12
}

.uc-emoji-wrap.is-align-end .uc-emoji-picker.is-inline {
    left: auto;
    right: 0
}

.uc-emoji-picker.show,.msg-emoji-panel.show,.uc-pm-emoji-panel.show {
    display: grid
}

.uc-emoji-item,.msg-emoji,.uc-pm-emoji {
    width: 28px;
    height: 28px;
    padding: 0;
    margin: 0 auto;
    border: 0!important;
    outline: 0;
    border-radius: 6px;
    background: transparent!important;
    box-shadow: none!important;
    font-size: 16px;
    line-height: 1;
    cursor: pointer;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    transition: background .15s;
    appearance: none;
    -webkit-appearance: none
}

.uc-emoji-item:hover,.msg-emoji:hover,.uc-pm-emoji:hover {
    background: var(--chip)!important
}

.uc-emoji-item-img img,.msg-emoji-img img,.uc-pm-emoji-img img {
    width: 22px;
    height: 22px;
    object-fit: contain;
    display: block;
    pointer-events: none
}

.msg-bubble-content .msg-sticker,.msg-bubble .msg-sticker {
    width: 28px!important;
    height: 28px!important;
    max-width: 28px!important;
    max-height: 28px!important;
    object-fit: contain;
    vertical-align: -4px;
    display: inline-block
}

.msg-bubble-content img:not(.msg-avatar):not(.msg-photo) {
    width: 28px!important;
    height: 28px!important;
    max-width: 28px!important;
    max-height: 28px!important;
    object-fit: contain;
    vertical-align: -4px
}

.msg-gallery {
    display: grid;
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: 6px;
    margin: 6px 0 0;
    max-width: 240px
}

.msg-gallery[data-cols="1"] {
    grid-template-columns: minmax(0, 168px);
    max-width: 168px
}

.msg-gallery[data-cols="2"] {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    max-width: 220px
}

.msg-gallery-item {
    display: block;
    width: 100%;
    padding: 0;
    border: 0;
    aspect-ratio: 1 / 1;
    border-radius: 10px;
    overflow: hidden;
    background: color-mix(in srgb, var(--text) 6%, transparent);
    cursor: zoom-in
}

.msg-gallery-item .msg-photo,
.msg-bubble-content img.msg-photo {
    width: 100% !important;
    height: 100% !important;
    max-width: none !important;
    max-height: none !important;
    object-fit: cover !important;
    vertical-align: top;
    display: block
}

.msg-lightbox {
    position: fixed;
    inset: 0;
    z-index: 10050;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 40px 16px;
    background: rgba(0, 0, 0, .72)
}

.msg-lightbox[hidden] {
    display: none !important
}

.msg-lightbox-img {
    max-width: min(92vw, 1100px);
    max-height: 88vh;
    object-fit: contain;
    border-radius: 8px
}

.msg-lightbox-close {
    position: absolute;
    top: 16px;
    right: 16px;
    width: 36px;
    height: 36px;
    padding: 0;
    border: 0;
    border-radius: 50%;
    background: rgba(255, 255, 255, .16);
    color: #fff;
    font-size: 20px;
    cursor: pointer
}

.msg-send-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    width: auto;
    min-width: 0;
    height: 32px;
    padding: 0 14px;
    border: 0;
    border-radius: var(--radius-sm);
    background: var(--accent);
    color: var(--accent-ink);
    font-size: 13px;
    font-weight: 700;
    white-space: nowrap;
    cursor: pointer;
    transition: background .15s,transform .1s;
    box-shadow: 0 2px 6px rgba(59,130,246,.2)
}

.msg-send-btn:hover {
    background: var(--accent-deep)
}

.msg-send-btn:active {
    transform: scale(.95)
}

.msg-send-btn:disabled {
    opacity: .6;
    cursor: not-allowed
}

.msg-cs-wrap {
    display: none;
    margin: 0 0 12px;
    padding: 0;
    box-sizing: border-box
}

.msg-cs-banner {
    display: flex;
    align-items: center;
    gap: 12px;
    margin: 0;
    padding: 14px 14px 14px 12px;
    border-radius: 14px;
    background: linear-gradient(135deg, var(--accent) 0%, var(--accent-deep, var(--accent)) 100%);
    color: var(--accent-ink, #fff);
    text-decoration: none;
    box-shadow: 0 8px 20px color-mix(in srgb, var(--accent) 28%, transparent);
    transition: transform .12s ease, box-shadow .12s ease, filter .12s ease
}

.msg-cs-banner:hover {
    color: var(--accent-ink, #fff);
    filter: brightness(1.04);
    box-shadow: 0 10px 24px color-mix(in srgb, var(--accent) 34%, transparent)
}

.msg-cs-banner:active {
    transform: scale(.99)
}

.msg-cs-ico {
    flex: 0 0 auto;
    width: 44px;
    height: 44px;
    border-radius: 50%;
    display: inline-flex;
    align-items: center;
    justify-content: center;
    background: color-mix(in srgb, var(--accent-ink, #fff) 18%, transparent);
    color: inherit;
    font-size: 22px;
    line-height: 1
}

.msg-cs-main {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
    gap: 4px
}

.msg-cs-title {
    font-size: 16px;
    font-weight: 750;
    line-height: 1.2;
    letter-spacing: .02em;
    color: inherit
}

.msg-cs-status {
    display: inline-flex;
    align-items: center;
    gap: 6px;
    font-size: 12px;
    line-height: 1.2;
    color: color-mix(in srgb, var(--accent-ink, #fff) 82%, transparent);
    font-weight: 500
}

.msg-cs-dot {
    width: 7px;
    height: 7px;
    border-radius: 50%;
    background: color-mix(in srgb, var(--accent-ink, #fff) 45%, #9ca3af);
    box-shadow: 0 0 0 2px color-mix(in srgb, var(--accent-ink, #fff) 25%, transparent);
    flex: 0 0 auto
}

.msg-cs-banner.is-online .msg-cs-dot {
    background: #22c55e;
    box-shadow: 0 0 0 2px color-mix(in srgb, #22c55e 28%, transparent)
}

.msg-cs-arrow {
    flex: 0 0 auto;
    font-size: 22px;
    opacity: .9;
    color: inherit
}

@media (max-width: 960px) {
    .plaza-main.shell-message {
        grid-template-columns: minmax(0,1fr)
    }
    .plaza-main.shell-message > .plaza-aside.uc-aside {
        display: none !important
    }
    .msg-cs-wrap {
        display: block;
        margin: 0 0 10px;
        padding: 0;
        box-sizing: border-box
    }
    .msg-toolbar {
        flex-direction: column;
        align-items: stretch;
        gap: 10px;
        padding: 12px 22px 16px
    }
    .msg-toolbar-actions {
        flex-wrap: nowrap
    }
    .msg-pager.uc-pager,
    .msg-pager-alone {
        display: block;
        width: 100%;
        min-width: 0;
        margin-top: 0;
        box-sizing: border-box
    }
    .shell-message .msg-pager.msg-pager-alone {
        padding: 0 22px 16px
    }
    .shell-message ul.pagination {
        width: 100%;
        flex-wrap: nowrap;
        justify-content: space-between;
        gap: 6px;
        max-width: 100%;
        overflow-x: auto;
        -webkit-overflow-scrolling: touch;
        scrollbar-width: none
    }
    .shell-message ul.pagination::-webkit-scrollbar {
        display: none;
        height: 0
    }
    .shell-message ul.pagination > li > a,
    .shell-message ul.pagination > li > span {
        padding: 0 8px;
        border-radius: 8px;
        font-size: 12px
    }
}

.msg-bubble.has-rp {
    padding: 10px 12px;
    min-width: min(100%, 280px)
}

.msg-bubble.has-rp .msg-bubble-content {
    margin-bottom: 8px
}

.msg-rp-card.rp-card {
    margin: 0;
    padding: 10px 12px;
    gap: 10px;
    min-width: 240px
}

.msg-rp-card .rp-card-visual {
    width: 44px;
    height: 44px;
    font-size: 22px;
    border-radius: 12px
}

.msg-rp-modal {
    position: fixed;
    inset: 0;
    z-index: 80;
    display: flex;
    align-items: center;
    justify-content: center;
    padding: 20px;
    background: rgba(15, 23, 42, .45)
}

.msg-rp-modal[hidden] {
    display: none !important
}

.msg-rp-dialog {
    width: min(420px, 100%);
    border-radius: 16px;
    background: var(--card, #fff);
    box-shadow: 0 20px 50px rgba(15, 23, 42, .18);
    overflow: hidden
}

.msg-rp-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    padding: 14px 16px;
    border-bottom: 1px solid var(--line, #eef1f6)
}

.msg-rp-head strong {
    font-size: 16px
}

.msg-rp-close {
    width: 32px;
    height: 32px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer
}

.msg-rp-body {
    padding: 16px;
    display: flex;
    flex-direction: column;
    gap: 12px
}

.msg-rp-modes {
    display: grid;
    grid-template-columns: 1fr 1fr;
    gap: 8px
}

.msg-rp-mode {
    height: 38px;
    border: 0;
    border-radius: 10px;
    background: var(--chip, #f1f5f9);
    color: var(--text-soft);
    font-weight: 650;
    cursor: pointer
}

.msg-rp-mode.on {
    background: color-mix(in srgb, #e11d48 12%, var(--card, #fff));
    color: #be123c
}

.msg-rp-field span {
    display: block;
    margin-bottom: 6px;
    font-size: 12px;
    font-weight: 650;
    color: var(--muted)
}

.msg-rp-field input {
    width: 100%;
    height: 42px;
    padding: 0 12px;
    border-radius: 12px;
    border: 1px solid var(--line);
    background: var(--chip);
    font: inherit
}

.msg-rp-field.is-hidden {
    display: none !important
}

.msg-rp-hint {
    margin: 0;
    font-size: 12px;
    color: var(--muted);
    line-height: 1.5
}

.msg-rp-foot {
    display: flex;
    justify-content: flex-end;
    gap: 8px;
    padding: 12px 16px 16px
}

.msg-rp-cancel,
.msg-rp-send {
    height: 38px;
    padding: 0 16px;
    border: 0;
    border-radius: 10px;
    font-weight: 700;
    cursor: pointer
}

.msg-rp-cancel {
    background: var(--chip);
    color: var(--text-soft)
}

.msg-rp-send {
    background: linear-gradient(135deg, #e11d48, #be123c);
    color: #fff
}

html[data-uc-scheme="dark"] .msg-rp-dialog {
    background: var(--card)
}
