/* 留言板 v2：两级结构 + 折叠，适配手机/平板/桌面 */
#messageBoardModal .mb-panel {
    width: min(560px, 94vw) !important;
    max-width: 94vw !important;
    height: min(86vh, 860px);
    max-height: 86vh !important;
    background: linear-gradient(180deg, rgba(28, 30, 38, 0.92), rgba(14, 15, 20, 0.95)) !important;
    border-radius: 24px !important;
}
#messageBoardModal .mb-header { padding: 16px 18px 12px !important; }
#messageBoardModal .mb-title { font-size: 20px; font-weight: 800; letter-spacing: .02em; }
#messageBoardModal .mb-body { padding: 0 12px 12px !important; gap: 10px !important; }
#messageBoardModal .mb-list { gap: 0 !important; padding: 4px 4px 4px 0 !important; overscroll-behavior: contain; }

.mb2-thread {
    padding: 16px 10px 14px;
    border-bottom: 1px solid rgba(255, 255, 255, 0.07);
    min-width: 0;
    animation: mb2In .28s ease both;
}
.mb2-thread:last-of-type { border-bottom: 0; }
@keyframes mb2In { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

.mb2-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.mb2-avatar {
    width: 36px; height: 36px; border-radius: 50%; object-fit: cover; flex: 0 0 auto;
    background: rgba(255,255,255,.08); border: 1px solid rgba(255,255,255,.14);
}
.mb2-avatar.sm { width: 26px; height: 26px; margin-top: 1px; }
.mb2-who { display: flex; flex-direction: column; min-width: 0; gap: 2px; }
.mb2-name {
    font-size: 13px; font-weight: 700; color: rgba(255,255,255,.92);
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 16em;
}
.mb2-time { font-size: 11px; color: rgba(255,255,255,.42); white-space: nowrap; }

.mb2-text {
    font-size: 14.5px; line-height: 1.7; color: rgba(255,255,255,.88);
    white-space: pre-wrap; word-break: break-word; overflow-wrap: anywhere;
    padding-left: 46px;
}
.mb2-text a { color: #6fc8ff !important; word-break: break-all; }
.mb2-text.is-clamped {
    display: -webkit-box; -webkit-box-orient: vertical; -webkit-line-clamp: 6; overflow: hidden;
}
.mb2-expand {
    margin: 2px 0 0 46px; padding: 0; border: 0; background: none;
    color: #6fc8ff; font-size: 12px; font-weight: 700; cursor: pointer;
}

.mb2-actions { display: flex; align-items: center; gap: 4px; margin: 8px 0 0 40px; flex-wrap: wrap; }
.mb2-act {
    display: inline-flex; align-items: center; gap: 5px;
    height: 28px; padding: 0 10px; border-radius: 999px; border: 0;
    background: transparent; color: rgba(255,255,255,.5); font-size: 12px; cursor: pointer;
    transition: background .15s, color .15s;
}
.mb2-act svg { width: 14px; height: 14px; }
.mb2-act:hover { background: rgba(255,255,255,.07); color: #fff; }
.mb2-tag {
    font-size: 11px; color: #9eeaff; padding: 2px 8px; border-radius: 999px;
    background: rgba(111,227,255,.1); border: 1px solid rgba(111,227,255,.2); margin-left: 4px;
}

/* 二级回复：只缩进一次，整块浅底，平铺按时间排列 */
.mb2-replies {
    margin: 10px 0 0 46px;
    padding: 6px 12px;
    border-radius: 14px;
    background: rgba(255,255,255,.035);
    border: 1px solid rgba(255,255,255,.06);
    min-width: 0;
}
.mb2-reply { display: flex; gap: 9px; padding: 10px 0; min-width: 0; }
.mb2-reply + .mb2-reply { border-top: 1px dashed rgba(255,255,255,.07); }
.mb2-reply[hidden] { display: none; }
.mb2-reply-main { flex: 1; min-width: 0; }
.mb2-reply-head { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-bottom: 4px; }
.mb2-reply-head .mb2-name { font-size: 12.5px; max-width: 12em; }
.mb2-reply .mb2-text { padding-left: 0; font-size: 14px; line-height: 1.65; }
.mb2-reply .mb2-expand { margin-left: 0; }
.mb2-reply .mb2-actions { margin: 4px 0 0 -10px; }
.mb2-badge {
    font-size: 10px; font-weight: 800; line-height: 16px; padding: 0 6px; border-radius: 6px;
    color: #0b1220; background: linear-gradient(90deg, #6fe3ff, #a98bff);
}
.mb2-reply.is-ai .mb2-name { color: #9eeaff; }
.mb2-reply.is-ai .mb2-text {
    background: rgba(111,227,255,.06); border: 1px solid rgba(111,227,255,.14);
    border-radius: 10px; padding: 8px 10px;
}
.mb2-quote {
    font-size: 12px; line-height: 1.5; color: rgba(255,255,255,.5);
    margin: 0 0 5px; padding: 4px 8px; border-left: 2px solid rgba(111,200,255,.45);
    background: rgba(255,255,255,.03); border-radius: 0 6px 6px 0;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mb2-quote b { color: #6fc8ff; font-weight: 700; margin-right: 6px; }

.mb2-more {
    display: block; width: 100%; margin: 4px 0 2px; padding: 8px 0;
    border: 0; border-top: 1px solid rgba(255,255,255,.06); background: none;
    color: #6fc8ff; font-size: 12.5px; font-weight: 700; text-align: left; cursor: pointer;
}
.mb2-more i { font-style: normal; display: inline-block; margin-left: 2px; }
.mb2-more i.up { transform: rotate(180deg); }

/* 回复输入框 */
.mb2-reply-box { margin: 10px 0 0 46px; }
.mb2-reply-box .mb-reply-context {
    font-size: 12px; color: rgba(255,255,255,.55); margin-bottom: 6px;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.mb2-reply-box .mb-reply-compose { display: flex; flex-direction: column; gap: 8px; }
.mb2-reply-box .mb-reply-input {
    width: 100%; min-height: 64px; resize: vertical; box-sizing: border-box;
    padding: 10px 12px; border-radius: 12px; font-size: 14px; color: #fff;
    background: rgba(255,255,255,.06); border: 1px solid rgba(255,255,255,.14);
}
.mb2-reply-btns { display: flex; justify-content: flex-end; gap: 8px; }
.mb2-reply-btns button {
    height: 32px; padding: 0 16px; border-radius: 999px; font-size: 13px; font-weight: 700; cursor: pointer;
    border: 1px solid rgba(255,255,255,.16); background: transparent; color: rgba(255,255,255,.75);
}
.mb2-reply-btns .mb-reply-send { background: #fff; color: #111; border-color: #fff; }

/* 手机：缩进更小，留更多正文宽度 */
@media (max-width: 520px) {
    #messageBoardModal .mb-panel { width: 96vw !important; max-width: 96vw !important; height: 88vh; border-radius: 20px !important; }
    .mb2-thread { padding: 14px 4px 12px; }
    .mb2-text { padding-left: 0; }
    .mb2-expand { margin-left: 0; }
    .mb2-actions { margin-left: -10px; }
    .mb2-replies { margin-left: 0; padding: 4px 10px; }
    .mb2-reply-box { margin-left: 0; }
}

/* 覆盖旧留言板样式中对同名按钮/布局的固定尺寸 */
#messageBoardModal .mb2-thread, #messageBoardModal .mb2-thread * { text-align: left; }
#messageBoardModal .mb2-head { flex-direction: row !important; justify-content: flex-start !important; }
#messageBoardModal .mb2-act {
    position: static !important; width: auto !important; min-width: 0 !important; height: 28px !important;
    padding: 0 10px !important; margin: 0 !important; opacity: 1 !important; transform: none !important;
    border: 0 !important; background: transparent; box-shadow: none !important; flex: 0 0 auto;
    color: rgba(255,255,255,.5) !important;
}
#messageBoardModal .mb2-act:hover { background: rgba(255,255,255,.07) !important; color: #fff !important; }
#messageBoardModal .mb2-act span { display: inline !important; writing-mode: horizontal-tb !important; white-space: nowrap; font-size: 12px; }
#messageBoardModal .mb2-act svg { width: 14px !important; height: 14px !important; flex: 0 0 auto; }
#messageBoardModal .mb2-text { text-align: left; }
#messageBoardModal .mb2-reply.is-ai .mb2-text.is-clamped { -webkit-line-clamp: 8; }
#messageBoardModal .mb2-actions, #messageBoardModal .mb2-reply .mb2-actions { margin-left: 0 !important; }
#messageBoardModal .mb2-thread > .mb2-actions { margin-left: 36px !important; }
#messageBoardModal .mb2-act { overflow: visible !important; padding: 0 8px !important; }
#messageBoardModal .mb2-reply .mb2-act:first-child { padding-left: 0 !important; }
/* 折叠改用最大高度 + 渐隐，避免带内边距的气泡露出半行字 */
#messageBoardModal .mb2-text.is-clamped {
    display: block !important; -webkit-line-clamp: unset !important;
    max-height: calc(1.7em * 6); overflow: hidden;
    -webkit-mask-image: linear-gradient(180deg, #000 70%, transparent);
            mask-image: linear-gradient(180deg, #000 70%, transparent);
}
#messageBoardModal .mb2-reply.is-ai .mb2-text.is-clamped { max-height: calc(1.65em * 8 + 16px); }
@media (max-width: 520px) { #messageBoardModal .mb2-thread > .mb2-actions { margin-left: 0 !important; } }
#messageBoardModal .mb2-actions .mb2-act:first-child { padding-left: 0 !important; }
#messageBoardModal .mb2-actions { gap: 10px !important; }
#messageBoardModal .mb2-act svg { position: static !important; transform: none !important; margin: 0 !important; left: auto !important; }
#messageBoardModal .mb2-act { max-width: none !important; max-height: none !important; flex: 0 0 auto !important; justify-content: flex-start !important; border-radius: 999px !important; }
