/* 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-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
}

.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
}

.uc-panel:has(.msg-dialog) {
    display: flex;
    flex-direction: column;
    min-width: 0;
    overflow: visible
}

.msg-dialog {
    display: flex;
    flex-direction: column;
    gap: 14px;
    padding: 18px 22px;
    min-height: 260px;
    overflow: visible;
    min-width: 0
}

.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-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 {
    width: 38px;
    height: 38px;
    border-width: 2px
}

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

.msg-col {
    display: flex;
    flex-direction: column;
    max-width: min(560px,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: 12px 16px;
    border-radius: 16px;
    font-size: 14px;
    line-height: 1.6;
    word-break: break-word;
    overflow-wrap: anywhere;
    box-sizing: border-box
}

.msg-row:not(.me) .msg-bubble {
    background: var(--chip);
    color: var(--text);
    border-top-left-radius: 4px
}

.msg-row.me .msg-bubble {
    background: var(--accent);
    color: var(--accent-ink);
    border-top-right-radius: 4px
}

.msg-bubble-meta {
    display: flex;
    align-items: center;
    gap: 6px;
    margin-top: 4px;
    padding: 0 2px;
    font-size: 11px;
    color: var(--muted);
    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);
    white-space: nowrap
}

.msg-read-state {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    font-weight: 600;
    font-size: 11px;
    padding: 1px 6px;
    border-radius: 999px;
    background: var(--chip);
    line-height: 1.4
}

.msg-read-state.read {
    color: #16a34a;
    background: #dcfce7
}

.msg-read-state:not(.read) {
    color: #d97706;
    background: #fef3c7
}

.msg-quote-btn {
    display: inline-flex;
    align-items: center;
    flex: 0 0 auto;
    padding: 1px 6px;
    border: 0;
    border-radius: 999px;
    background: var(--chip);
    color: var(--muted);
    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)
}

.msg-quote {
    display: block;
    margin: 0 0 8px;
    padding: 8px 10px;
    border-radius: 10px;
    text-decoration: none;
    color: inherit;
    max-width: 100%;
    background: rgba(0,0,0,.08);
    border-left: 3px solid rgba(255,255,255,.5)
}

.msg-row:not(.me) .msg-quote {
    background: rgba(0,0,0,.05);
    border-left-color: var(--accent)
}

.msg-quote-name {
    display: block;
    font-size: 12px;
    font-weight: 700;
    margin-bottom: 2px;
    opacity: .9
}

.msg-quote-text {
    display: block;
    font-size: 12px;
    line-height: 1.4;
    opacity: .8;
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.msg-quote-bar {
    display: flex;
    align-items: center;
    gap: 8px;
    margin-bottom: 10px;
    padding: 8px 8px 8px 12px;
    border-radius: 12px;
    background: var(--chip);
    border-left: 3px solid var(--accent)
}

.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: 12px;
    font-weight: 700;
    color: var(--text);
    margin-bottom: 2px
}

.msg-quote-bar-body span {
    display: block;
    font-size: 12px;
    color: var(--muted);
    overflow: hidden;
    text-overflow: ellipsis;
    white-space: nowrap
}

.msg-quote-clear {
    flex: 0 0 auto;
    width: 28px;
    height: 28px;
    border: 0;
    border-radius: 8px;
    background: transparent;
    color: var(--muted);
    cursor: pointer;
    font-size: 16px;
    display: inline-flex;
    align-items: center;
    justify-content: center
}

.msg-quote-clear:hover {
    background: var(--surface);
    color: var(--text)
}

.msg-reply-form {
    position: relative;
    z-index: 2;
    padding: 16px 22px;
    border-top: 1px solid var(--line);
    overflow: visible
}

.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;
    transition: border-color .15s,box-shadow .15s
}

.msg-reply-text:focus {
    border-color: var(--accent);
    box-shadow: 0 0 0 3px rgba(59,130,246,.12)
}

.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-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)
}

.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) {
    width: 28px!important;
    height: 28px!important;
    max-width: 28px!important;
    max-height: 28px!important;
    object-fit: contain;
    vertical-align: -4px
}

.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
}
