/* 留言图标 */
.site-message-icon {
    position: fixed;
    bottom: 48px;
    right: 5px;
    width: 50px;
    height: 50px;
    background: #2271b1;
    border-radius: 50%;
    cursor: pointer;
    box-shadow: 0 4px 12px rgba(0,0,0,0.2);
    transition: transform 0.3s, background 0.3s;
    z-index: 99999;
    display: flex;
    align-items: center;
    justify-content: center;
}

.site-message-icon:hover {
    transform: scale(1.05);
    background: #135e96;
}

.site-message-icon .icon {
    width: 30px;
    height: 30px;
    background: url('data:image/svg+xml;utf8,<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 24 24" fill="white"><path d="M20 2H4c-1.1 0-2 .9-2 2v12c0 1.1.9 2 2 2h4l4 4 4-4h4c1.1 0 2-.9 2-2V4c0-1.1-.9-2-2-2z"/></svg>') no-repeat center;
    background-size: contain;
}

.site-message-icon .badge {
    position: absolute;
    top: -5px;
    right: -5px;
    background: #dc3545;
    color: white;
    border-radius: 50%;
    width: 22px;
    height: 22px;
    font-size: 12px;
    display: flex;
    align-items: center;
    justify-content: center;
    font-weight: bold;
}

/* 留言弹窗 */
.site-message-modal {
    position: fixed;
    top: 0;
    left: 0;
    width: 100%;
    height: 100%;
    background: rgba(0,0,0,0.5);
    z-index: 100000;
    display: none;
    align-items: center;
    justify-content: center;
}

.site-message-modal.active {
    display: flex;
}

:is(.site-message-modal, .site-message-layer-host) .modal-content {
    background: white;
    border-radius: 12px;
    width: 450px;
    max-width: 90%;
    max-height: 80vh;
    overflow-y: auto;
    box-shadow: 0 10px 40px rgba(0,0,0,0.2);
    animation: slideUp 0.3s ease;
}

/* ========== 留言板外壳（白底大圆角、居中标题、Tab 外框、内容区浅灰底） ========== */
:is(.site-message-modal, .site-message-layer-host) .modal-content.site-message-forum {
    width: 100%;
    max-width: 100%;
    box-sizing: border-box;
    border-radius: 14px;
    border: 1px solid #ebeef2;
    background: #ffffff;
    box-shadow: 0 10px 40px rgba(15, 23, 42, 0.1), 0 2px 8px rgba(15, 23, 42, 0.04);
    overflow: hidden;
}

.site-message-forum .modal-header.site-message-shell-header {
    position: relative;
    display: block;
    text-align: center;
    padding: 20px 52px 16px;
    background: #ffffff;
    border-bottom: 1px solid #f0f2f5;
}

.site-message-forum .modal-header .site-message-shell-title {
    margin: 0 auto;
    font-size: 18px;
    font-weight: 700;
    color: #111827;
    letter-spacing: 0.04em;
}

.site-message-forum .site-message-header-actions {
    position: absolute;
    right: 14px;
    top: 50%;
    transform: translateY(-50%);
    display: flex;
    align-items: center;
    gap: 8px;
}

.site-message-forum .site-message-panel-toggle {
    padding: 6px 12px;
    font-size: 12px;
    line-height: 1.4;
    background: #ffffff;
    border: 1px solid #e5e7eb;
    border-radius: 8px;
    color: #6b7280;
}

.site-message-forum .site-message-panel-toggle:hover {
    background: #f9fafb;
    border-color: #d1d5db;
    color: #374151;
}

.site-message-forum .close-btn {
    width: 32px;
    height: 32px;
    font-size: 20px;
    color: #9ca3af;
    border-radius: 8px;
}

.site-message-forum .close-btn:hover {
    background: #f3f4f6;
    color: #4b5563;
}

.site-message-forum .modal-body {
    background: #ffffff;
    padding: 16px 18px 22px;
}

.site-message-forum .forum-compose {
    background: transparent;
    border: none;
    border-radius: 0;
    padding: 0;
    box-shadow: none;
}

.site-message-forum .form-group label {
    color: #334155;
    font-size: 13px;
}

.site-message-forum .submit-btn {
    background: #2563eb;
    border-radius: 2px;
    font-size: 15px;
    box-shadow: 0 1px 0 rgba(0, 0, 0, 0.08);
}

.site-message-forum .submit-btn:hover {
    background: #1d4ed8;
}

@keyframes slideUp {
    from {
        opacity: 0;
        transform: translateY(30px);
    }
    to {
        opacity: 1;
        transform: translateY(0);
    }
}

:is(.site-message-modal, .site-message-layer-host) .modal-header:not(.site-message-shell-header) {
    padding: 18px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

:is(.site-message-modal, .site-message-layer-host) .modal-header:not(.site-message-shell-header) h3 {
    margin: 0;
    font-size: 18px;
    color: #1e1e2f;
}

.site-message-header-actions {
    display: flex;
    align-items: center;
    gap: 10px;
}

.site-message-panel-toggle {
    padding: 6px 12px;
    font-size: 13px;
    cursor: pointer;
    border: 1px solid #c3c4c7;
    border-radius: 6px;
    background: #f6f7f7;
    color: #1d2327;
    line-height: 1.4;
}

.site-message-panel-toggle:hover {
    background: #f0f0f1;
    border-color: #2271b1;
    color: #2271b1;
}

/* 右侧全屏侧栏：宽度与 JS 中 SM_LAYER_WIDTH（650px）一致 */
.site-message-modal.site-message-panel-mode {
    justify-content: flex-end;
    align-items: stretch;
    padding: 0;
}

.site-message-modal.site-message-panel-mode .modal-content.site-message-sheet {
    width: 650px;
    max-width: 650px;
    height: 100vh;
    max-height: 100vh;
    margin: 0;
    border-radius: 12px 0 0 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
    animation: none;
}

@media (max-width: 420px) {
    .site-message-modal.site-message-panel-mode .modal-content.site-message-sheet {
        width: 100%;
        max-width: 100%;
        border-radius: 0;
    }
}

.site-message-modal.site-message-panel-mode .site-message-tabs {
    flex-shrink: 0;
}

.site-message-modal.site-message-panel-mode .site-message-modal-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.site-message-modal.site-message-panel-mode #panel-write:not(.hide),
.site-message-modal.site-message-panel-mode #panel-mine:not(.hide) {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.site-message-modal.site-message-panel-mode #panel-mine:not(.hide) .site-message-hint {
    flex-shrink: 0;
}

.site-message-modal.site-message-panel-mode #panel-mine:not(.hide) .my-messages-list {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}

:is(.site-message-modal, .site-message-layer-host) .close-btn {
    background: none;
    border: none;
    font-size: 24px;
    cursor: pointer;
    color: #999;
    padding: 0;
    width: 30px;
    height: 30px;
    display: flex;
    align-items: center;
    justify-content: center;
    border-radius: 50%;
    transition: background 0.2s;
}

:is(.site-message-modal, .site-message-layer-host) .close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

:is(.site-message-modal, .site-message-layer-host) .modal-body {
    padding: 20px;
}

:is(.site-message-modal, .site-message-layer-host) .form-group {
    margin-bottom: 18px;
}

:is(.site-message-modal, .site-message-layer-host) .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

:is(.site-message-modal, .site-message-layer-host) .form-group input,
:is(.site-message-modal, .site-message-layer-host) .form-group textarea {
    width: 100%;
    padding: 10px 12px;
    border: 1px solid #ddd;
    border-radius: 6px;
    font-size: 14px;
    transition: border-color 0.2s;
    color: #1a1a1a;
    background-color: #fff;
    caret-color: #1a1a1a;
    box-sizing: border-box;
}

:is(.site-message-modal, .site-message-layer-host) .form-group input::placeholder,
:is(.site-message-modal, .site-message-layer-host) .form-group textarea::placeholder {
    color: #6c757d;
    opacity: 1;
}

:is(.site-message-modal, .site-message-layer-host) .form-group input:focus,
:is(.site-message-modal, .site-message-layer-host) .form-group textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34,113,177,0.1);
}

:is(.site-message-modal, .site-message-layer-host) .submit-btn {
    width: 100%;
    padding: 12px;
    background: #2271b1;
    color: white;
    border: none;
    border-radius: 6px;
    font-size: 16px;
    font-weight: 500;
    cursor: pointer;
    transition: background 0.2s;
}

:is(.site-message-modal, .site-message-layer-host) .submit-btn:hover {
    background: #135e96;
}

:is(.site-message-modal, .site-message-layer-host) .submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

:is(.site-message-modal, .site-message-layer-host) .message-status {
    margin-top: 12px;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    display: none;
}

:is(.site-message-modal, .site-message-layer-host) .message-status.success {
    background: #d4edda;
    color: #155724;
    display: block;
}

:is(.site-message-modal, .site-message-layer-host) .message-status.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
}

/* 弹窗：Tab 外层容器（仅外壳结构；无 forum 时保持简单下划线 Tab） */
.site-message-tabs-shell {
    flex-shrink: 0;
    background: #ffffff;
}

.site-message-forum .site-message-tabs-shell {
    padding: 0 18px 10px;
    background: #ffffff;
    border-bottom: none;
}

.site-message-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e9ecef;
    padding: 0 20px;
    background: #f8f9fa;
}

/* 论坛：整条浅灰圆角 Tab 条；未选中透明底蓝字，选中实色蓝底白字（对齐参考图） */
.site-message-forum .site-message-tabs {
    margin: 0;
    padding: 6px;
    gap: 8px;
    border: none;
    border-radius: 12px;
    background: #f5f7fa;
    border-bottom: none;
    box-shadow: inset 0 0 0 1px #eef0f3;
}

.site-message-tab {
    flex: 1;
    padding: 12px 16px;
    border: none;
    background: transparent;
    cursor: pointer;
    font-size: 15px;
    color: #666;
    border-bottom: 2px solid transparent;
    margin-bottom: -1px;
    transition: color 0.2s, border-color 0.2s;
}

.site-message-forum .site-message-tab {
    font-size: 14px;
    font-weight: 500;
    margin-bottom: 0;
    padding: 12px 14px;
    color: #4a88e9;
    background: transparent;
    border: none;
    border-radius: 10px;
    transition: background 0.2s, color 0.2s, box-shadow 0.2s;
}

.site-message-forum .site-message-tab:hover {
    background: rgba(74, 136, 233, 0.08);
    color: #3d7fd8;
}

.site-message-tab:hover {
    color: #2271b1;
}

.site-message-tab.active {
    color: #2271b1;
    font-weight: 600;
    border-bottom-color: #2271b1;
    background: #fff;
}

.site-message-forum .site-message-tab.active {
    color: #ffffff;
    font-weight: 600;
    background: #4a88e9;
    box-shadow: 0 4px 14px rgba(74, 136, 233, 0.38);
}

.site-message-panel.hide {
    display: none !important;
}

.site-message-hint {
    font-size: 13px;
    color: #666;
    margin: 0 0 14px;
    line-height: 1.5;
}

.site-message-forum .site-message-hint {
    background: #eef3fb;
    border: 1px solid #dce6f5;
    padding: 10px 14px;
    border-radius: 6px;
    color: #5c6b7c;
    margin-bottom: 12px;
}

.my-messages-list {
    max-height: 320px;
    overflow-y: auto;
    margin-top: 8px;
}

.site-message-forum .my-messages-list {
    margin-top: 0;
}

/* ========== 发表新帖：现代表单（标题 / 日期 / 时间 / 内容 / 附件占位 / 确定·取消） ========== */
.site-message-forum #panel-write.sm-compose-modern {
    margin: 0;
    padding: 0;
    background: transparent;
}

.sm-compose-inner {
    background: #f5f7fa;
    border-radius: 12px;
    padding: 10px 11px 15px;
    border: 1px solid #eceef2;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.sm-compose-heading {
    margin: 0 0 18px;
    font-size: 16px;
    font-weight: 600;
    color: #1e293b;
    letter-spacing: 0.02em;
}

.sm-compose-required {
    color: #e53935;
    font-weight: 600;
}

.sm-compose-grid {
    display: grid;
    grid-template-columns: 1fr 1fr 1fr;
    gap: 14px 16px;
    margin-bottom: 4px;
}

@media (max-width: 560px) {
    .sm-compose-grid {
        grid-template-columns: 1fr;
    }
}

.sm-compose-modern .form-group {
    margin-bottom: 0;
}

.sm-compose-modern .form-group label {
    display: block;
    margin-bottom: 8px;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
}

.sm-compose-modern .form-group input[type="text"],
.sm-compose-modern .form-group input[type="date"],
.sm-compose-modern .form-group input[type="time"] {
    width: 100%;
    box-sizing: border-box;
    padding: 10px 12px;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    font-size: 14px;
    color: #1e293b;
    background: #fff;
    transition: border-color 0.2s, box-shadow 0.2s;
}

.sm-compose-modern .form-group textarea {
    width: 100%;
    box-sizing: border-box;
    min-height: 160px;
    padding: 12px 14px;
    border: 1px solid #e4e7ec;
    border-radius: 8px;
    font-size: 14px;
    line-height: 1.6;
    color: #1e293b;
    resize: vertical;
}

.sm-compose-modern .form-group input:focus,
.sm-compose-modern .form-group textarea:focus {
    outline: none;
    border-color: #4a88e9;
    box-shadow: 0 0 0 3px rgba(74, 136, 233, 0.14);
}

.sm-compose-field-content {
    margin-top: 16px;
}

.sm-compose-inner--content-only .sm-compose-field-content {
    margin-top: 0;
}

.sm-compose-inner--content-only .sm-compose-field-content textarea {
    min-height: 200px;
}

.sm-compose-upload {
    margin-top: 20px;
    padding-top: 18px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.sm-compose-upload-label {
    display: block;
    font-size: 13px;
    font-weight: 500;
    color: #64748b;
    margin-bottom: 10px;
}

.sm-compose-upload-row {
    display: flex;
    flex-wrap: wrap;
    gap: 10px;
    align-items: center;
}

.sm-compose-btn {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    padding: 8px 18px;
    font-size: 13px;
    border-radius: 8px;
    cursor: not-allowed;
    line-height: 1.4;
}

.sm-compose-btn-upload {
    background: #4a88e9;
    color: #fff;
    border: none;
    opacity: 0.55;
}

.sm-compose-btn-clear {
    background: #fff;
    color: #475569;
    border: 1px solid #dde1e8;
    opacity: 0.75;
}

.sm-compose-upload-hint {
    margin: 10px 0 0;
    font-size: 12px;
    color: #94a3b8;
    line-height: 1.5;
}

.sm-compose-upload-empty {
    margin: 12px 0 0;
    font-size: 13px;
    color: #cbd5e1;
}

.sm-compose-footer {
    display: flex;
    flex-direction: row;
    justify-content: center;
    align-items: center;
    gap: 16px;
    margin-top: 15px;
    padding-top: 4px;
}

.sm-compose-submit {
    min-width: 128px;
    padding: 10px 32px;
    font-size: 15px;
    font-weight: 500;
    color: #fff;
    background: #4a88e9;
    border: none;
    border-radius: 24px;
    cursor: pointer;
    box-shadow: 0 4px 16px rgba(74, 136, 233, 0.42);
    transition: background 0.2s, box-shadow 0.2s;
}

.sm-compose-submit:hover:not(:disabled) {
    background: #3d7fd8;
    box-shadow: 0 6px 20px rgba(74, 136, 233, 0.48);
}

.sm-compose-submit:disabled {
    opacity: 0.65;
    cursor: not-allowed;
    box-shadow: none;
}

.sm-compose-cancel {
    min-width: 128px;
    padding: 10px 32px;
    font-size: 15px;
    font-weight: 500;
    color: #334155;
    background: #fff;
    border: 1px solid #dde1e8;
    border-radius: 22px;
    cursor: pointer;
    transition: border-color 0.2s, background 0.2s;
}

.sm-compose-cancel:hover {
    border-color: #cbd5e1;
    background: #f8fafc;
}

.sm-compose-modern .message-status {
    margin-top: 14px;
    text-align: center;
}

/* 论坛：主题帖容器 */
.my-message-card.forum-topic-card {
    border: 1px solid #94a3b3;
    border-radius: 2px;
    margin-bottom: 12px;
    background: #fff;
    box-shadow: 0 1px 2px rgba(15, 23, 42, 0.06), 0 0 0 1px rgba(255, 255, 255, 0.5) inset;
    overflow: hidden;
    padding: 0;
}

.my-message-card.forum-topic-card:hover {
    border-color: #7f91a4;
    box-shadow: 0 2px 8px rgba(15, 23, 42, 0.12);
}

.forum-topic-bar {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    padding: 8px 12px;
    background: linear-gradient(180deg, #eef2f6 0%, #e2e8f0 100%);
    border-bottom: 1px solid #b4bec9;
    font-size: 12px;
}

.forum-topic-title {
    font-weight: 700;
    color: #1e3a5f;
    font-size: 13px;
}

.forum-topic-meta {
    color: #64748b;
}

/* 论坛：楼层列表 */
.forum-post-list.site-message-thread {
    margin: 0;
    padding: 0;
    background: #fff;
    border-bottom: 1px solid #c8d2dd;
}

.forum-post {
    --sm-depth: 0;
    display: flex;
    flex-direction: row;
    align-items: stretch;
    margin: 0;
    margin-left: 0;
    border-bottom: 1px solid #d1dae3;
    background: #fff;
}

.forum-post:nth-child(even) {
    background: #fcfdff;
}

.forum-post:last-child {
    border-bottom: none;
}

@media (max-width: 420px) {
    .forum-post {
        flex-direction: column;
    }

    .forum-post-floor {
        flex: none;
        width: auto;
        flex-direction: row;
        justify-content: center;
        gap: 10px;
        border-right: none;
        border-bottom: 1px solid #d1dae3;
        padding: 8px 10px;
    }
}

.forum-post-floor {
    flex: 0 0 68px;
    width: 68px;
    padding: 10px 8px;
    text-align: center;
    background: linear-gradient(90deg, #f1f5f9 0%, #e8eef4 100%);
    border-right: 1px solid #d1dae3;
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: flex-start;
    gap: 6px;
}

.forum-floor-num {
    display: block;
    font-size: 13px;
    font-weight: 800;
    font-family: Georgia, "Times New Roman", serif;
}

.forum-floor-role {
    font-size: 11px;
    color: #64748b;
    padding: 2px 6px;
    background: #fff;
    border: 1px solid #cbd5e1;
    border-radius: 2px;
    line-height: 1.2;
}

.forum-post--user .forum-floor-num {
    color: #b45309;
}

.forum-post--admin .forum-floor-num {
    color: #1d4ed8;
}

.forum-post--admin .forum-floor-role {
    color: #1e40af;
    border-color: #93c5fd;
    background: #eff6ff;
}

.forum-post-core {
    flex: 1;
    min-width: 0;
    display: flex;
    flex-direction: column;
}

.forum-post-head {
    display: flex;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 6px;
    padding: 8px 12px;
    background: #f6f9fc;
    border-bottom: 1px solid #e2e8f0;
    font-size: 12px;
}

.forum-post-author {
    font-weight: 700;
    color: #0f172a;
}

.forum-post--admin .forum-post-author {
    color: #1d4ed8;
}

.forum-post-time {
    color: #64748b;
    font-variant-numeric: tabular-nums;
}

.forum-post-body {
    padding: 12px 14px 13px;
    font-size: 14px;
    line-height: 1.65;
    color: #1e293b;
}

.forum-post-body p {
    margin: 0;
    white-space: pre-wrap;
    word-break: break-word;
}

/* 快速回复区（论坛跟帖框） */
.forum-post-notice {
    padding: 8px 12px;
    font-size: 12px;
    color: #92400e;
    background: #fffbeb;
    border-top: 1px dashed #fcd34d;
}

.thread-user-reply.forum-quick-reply {
    margin-top: 0;
    padding: 0;
    border-top: none;
    background: #eef3f8;
    border-top: 1px solid #c5ced8;
}

.forum-quick-reply-head {
    padding: 8px 12px;
    font-size: 12px;
    font-weight: 700;
    color: #334155;
    background: linear-gradient(180deg, #e2e8f0 0%, #d8e0e8 100%);
    border-bottom: 1px solid #b4bec9;
}

:is(.site-message-modal, .site-message-layer-host) .forum-quick-reply-input,
:is(.site-message-modal, .site-message-layer-host) .thread-user-reply-input {
    box-sizing: border-box;
    margin: 10px 12px;
    width: calc(100% - 24px);
    padding: 10px 12px;
    border: 1px solid #9aa9b9;
    border-radius: 2px;
    font-size: 14px;
    color: #1a1a1a;
    background-color: #fff;
    caret-color: #1a1a1a;
    resize: vertical;
    min-height: 64px;
}

:is(.site-message-modal, .site-message-layer-host) .forum-quick-reply-input:focus,
:is(.site-message-modal, .site-message-layer-host) .thread-user-reply-input:focus {
    outline: none;
    border-color: #3b82f6;
    box-shadow: 0 0 0 2px rgba(59, 130, 246, 0.15);
}

.forum-quick-reply-actions {
    padding: 0 12px 12px;
    text-align: right;
}

:is(.site-message-modal, .site-message-layer-host) .forum-quick-reply .submit-btn,
:is(.site-message-modal, .site-message-layer-host) .thread-user-reply .submit-btn {
    width: auto;
    min-width: 104px;
    padding: 8px 18px;
    border-radius: 2px;
}

.my-message-meta {
    font-size: 12px;
    color: #888;
    margin-bottom: 10px;
}

.my-message-block p,
.my-message-reply p {
    margin: 8px 0 0;
    white-space: pre-wrap;
    word-break: break-word;
    font-size: 14px;
    color: #333;
}

.my-message-block {
    margin-bottom: 10px;
}

:is(.site-message-modal, .site-message-layer-host) .my-message-block strong,
:is(.site-message-modal, .site-message-layer-host) .my-message-reply strong {
    display: block;
    margin-bottom: 4px;
    font-size: 13px;
    font-weight: 600;
    color: #1a1a1a !important;
    opacity: 1 !important;
    -webkit-font-smoothing: antialiased;
}

:is(.site-message-modal, .site-message-layer-host) .my-message-reply strong {
    color: #0c3550 !important;
}

.my-message-reply {
    background: #e8f4fd;
    border-radius: 6px;
    padding: 10px 12px;
    border-left: 3px solid #2271b1;
}

.my-message-reply-time {
    display: block;
    margin-top: 8px;
    color: #666;
}

.my-message-pending {
    font-size: 13px;
    color: #999;
    font-style: italic;
}

.my-messages-loading,
.my-messages-empty,
.my-messages-error {
    text-align: center;
    padding: 20px;
    color: #666;
}

.my-messages-error {
    color: #c62828;
}

/* 未登录弹窗与论坛风统一边框 */
.site-message-login-prompt.modal-content {
    border: 1px solid #a8b4c2;
    border-radius: 4px;
    box-shadow: 0 8px 32px rgba(15, 23, 42, 0.15);
}

/* 未登录引导登录覆盖层 */
.site-message-login-prompt .site-message-login-text {
    margin: 0 0 20px;
    font-size: 15px;
    line-height: 1.5;
    color: #333;
}

.site-message-login-prompt .site-message-login-btn {
    display: block;
    width: 100%;
    box-sizing: border-box;
    text-align: center;
    text-decoration: none;
}

/* ==========================================================
   现代化弹窗视觉（覆盖论坛旧风格，不改功能）
   ========================================================== */
.site-message-modal {
    background: rgba(15, 23, 42, 0.45);
    backdrop-filter: blur(4px);
}

.site-message-login-prompt.modal-content {
    border-radius: 16px;
    border: 1px solid #e8eaed;
    background: #ffffff;
    box-shadow: 0 16px 48px rgba(15, 23, 42, 0.12);
}

/* 无 shell 类时的备用顶栏（避免与 .site-message-shell-header 冲突） */
.site-message-forum .modal-header:not(.site-message-shell-header) {
    background: #ffffff;
    border-bottom: 1px solid #edf1f7;
    padding: 16px 18px;
}

.site-message-forum .modal-header:not(.site-message-shell-header) h3 {
    color: #0f172a;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0;
}

/* Tab 与顶栏按钮样式由上文「留言板外壳」统一控制，此处不再覆盖 */

/* 「我的帖子」与表单区一致：浅灰圆角内容卡（勿再包一层 forum-compose 边框） */
.site-message-forum #panel-mine.forum-mine {
    background: #f5f7fa;
    border-radius: 12px;
    padding: 18px;
    border: 1px solid #eceef2;
    box-shadow: 0 2px 12px rgba(15, 23, 42, 0.04);
}

.site-message-forum #panel-mine .site-message-hint {
    background: #ffffff;
    border-color: #e2e8f0;
    color: #64748b;
}

.site-message-forum .site-message-hint,
.my-message-card.forum-topic-card {
    border-radius: 12px;
    border: 1px solid #e6edf7;
    box-shadow: 0 4px 16px rgba(15, 23, 42, 0.05);
}

.forum-topic-bar {
    background: #f8fbff;
    border-bottom: 1px solid #e8eef8;
    padding: 10px 14px;
}

.forum-post-list.site-message-thread {
    border-bottom: 1px solid #e8eef8;
}

.forum-post-floor {
    background: #f8fbff;
    border-right: 1px solid #e8eef8;
}

.forum-post-head {
    background: #fbfdff;
    border-bottom: 1px solid #edf2f8;
}

.thread-user-reply.forum-quick-reply {
    background: #f8fbff;
    border-top: 1px solid #e8eef8;
}

.forum-quick-reply-head {
    background: #f1f6ff;
    border-bottom: 1px solid #dfe9f8;
}

:is(.site-message-modal, .site-message-layer-host) .forum-quick-reply-input,
:is(.site-message-modal, .site-message-layer-host) .thread-user-reply-input,
.site-message-forum .form-group input,
.site-message-forum .form-group textarea {
    border: 1px solid #d7e2f1;
    border-radius: 12px;
    background: #fff;
}

:is(.site-message-modal, .site-message-layer-host) .forum-quick-reply-input:focus,
:is(.site-message-modal, .site-message-layer-host) .thread-user-reply-input:focus,
.site-message-forum .form-group input:focus,
.site-message-forum .form-group textarea:focus {
    border-color: #60a5fa;
    box-shadow: 0 0 0 3px rgba(96, 165, 250, 0.2);
}

.site-message-forum .submit-btn,
.site-message-login-prompt .site-message-login-btn {
    border-radius: 12px;
    border: none;
    background: linear-gradient(135deg, #ff6a5e 0%, #ff2f45 100%);
    box-shadow: 0 10px 22px rgba(255, 47, 69, 0.25);
}

.site-message-forum .submit-btn:hover,
.site-message-login-prompt .site-message-login-btn:hover {
    background: linear-gradient(135deg, #ff5b4e 0%, #f21c3a 100%);
}

/* ========== Layui layer 弹窗容器 ========== */
/* 在 body 下占位隐藏，避免未打开时露出；移入 .layui-layer 后必须取消隐藏，否则弹窗整片空白 */
.site-message-layer-wrap {
    display: none !important;
}

/* 仅主留言板需要纵向撑满；登录引导层保持内容高度，避免被 flex 拉满一屏 */
.layui-layer #site-message-layer-wrap.site-message-layer-wrap {
    display: flex !important;
    flex-direction: column;
    flex: 1;
    min-height: 0;
    width: 100%;
    height: 100%;
}

.layui-layer #site-message-login-layer-wrap.site-message-layer-wrap {
    display: block !important;
    width: 100%;
}

body .layui-layer.site-message-layui-skin .layui-layer-content {
    padding: 0 !important;
    background: transparent !important;
}

body .layui-layer.site-message-layui-skin .layui-layer-content:has(#site-message-layer-wrap) {
    overflow: hidden !important;
    height: 100%;
    display: flex;
    flex-direction: column;
}

body .layui-layer.site-message-layui-skin .layui-layer-content:has(#site-message-login-layer-wrap) {
    overflow: visible !important;
    height: auto;
    display: block;
}

body .layui-layer.site-message-layui-skin {
    border-radius: 14px;
    overflow: hidden;
}

/* 弹层内高度链：避免居中模式下仅列表 320px 滚动、底栏与快速回复被裁到视野外 */
body .layui-layer.site-message-layui-skin #site-message-layer-wrap .site-message-layer-host {
    flex: 1;
    min-height: 0;
    display: flex;
    flex-direction: column;
}

body .layui-layer.site-message-layui-skin:not(.site-message-panel-mode) .site-message-layer-host .modal-content.site-message-sheet {
    flex: 1;
    min-height: 0;
    height: 100%;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

body .layui-layer.site-message-layui-skin:not(.site-message-panel-mode) .site-message-modal-body {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    overflow-x: hidden;
    -webkit-overflow-scrolling: touch;
}

body .layui-layer.site-message-layui-skin:not(.site-message-panel-mode) .my-messages-list {
    max-height: none !important;
    overflow-y: visible;
}

/* Layui 侧栏全屏：与旧 .site-message-modal.site-message-panel-mode 行为对齐 */
.layui-layer.site-message-panel-mode .site-message-layer-host .modal-content.site-message-sheet {
    width: 100%;
    max-width: 650px;
    height: 100%;
    min-height: 100%;
    max-height: 100vh;
    margin: 0;
    border-radius: 12px 0 0 12px;
    display: flex;
    flex-direction: column;
    overflow: hidden;
}

@media (max-width: 420px) {
    .layui-layer.site-message-panel-mode .site-message-layer-host .modal-content.site-message-sheet {
        max-width: 100%;
        border-radius: 0;
    }
}

.layui-layer.site-message-panel-mode .site-message-tabs-shell,
.layui-layer.site-message-panel-mode .site-message-tabs {
    flex-shrink: 0;
}

.layui-layer.site-message-panel-mode .site-message-modal-body {
    flex: 1;
    min-height: 0;
    overflow: hidden;
    display: flex;
    flex-direction: column;
}

.layui-layer.site-message-panel-mode #panel-write:not(.hide),
.layui-layer.site-message-panel-mode #panel-mine:not(.hide) {
    flex: 1;
    min-height: 0;
    overflow-y: auto;
    display: flex;
    flex-direction: column;
}

.layui-layer.site-message-panel-mode #panel-mine:not(.hide) .site-message-hint {
    flex-shrink: 0;
}

.layui-layer.site-message-panel-mode #panel-mine:not(.hide) .my-messages-list {
    flex: 1;
    min-height: 0;
    max-height: none;
    overflow-y: auto;
}

/* ========== 我的帖子：微博式对话流（参考主评 + 灰框嵌套 + 底栏） ========== */
.my-message-card.sm-weibo-topic {
    border-radius: 8px;
    border: 1px solid #ececec;
    box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
    margin-bottom: 16px;
}

.my-message-card.sm-weibo-topic .sm-weibo-topic-bar {
    background: #fafafa;
    border-bottom: 1px solid #f0f0f0;
    padding: 8px 12px;
}

.my-message-card.sm-weibo-topic .forum-topic-title {
    font-weight: 500;
    font-size: 12px;
    color: #888;
}

.my-message-card.sm-weibo-topic .forum-topic-meta {
    font-size: 12px;
    color: #aaa;
}

.sm-feed-thread {
    padding: 16px 16px 14px;
    background: #fff;
}

.sm-feed-row {
    display: flex;
    flex-direction: row;
    align-items: flex-start;
    gap: 12px;
}

.sm-feed-avatar {
    flex: 0 0 46px;
    width: 46px;
    height: 46px;
    border-radius: 50%;
    background: linear-gradient(145deg, #eef1f5 0%, #e2e8f0 100%);
    border: 1px solid #d8dee6;
    display: flex;
    align-items: center;
    justify-content: center;
    overflow: hidden;
}

.sm-feed-row--admin .sm-feed-avatar {
    background: linear-gradient(145deg, #e8f2fc 0%, #d4e8f7 100%);
    border-color: #b8d4ee;
}

.sm-feed-avatar-text {
    font-size: 15px;
    font-weight: 700;
    color: #5c6b7a;
    line-height: 1;
}

.sm-feed-maincol {
    flex: 1;
    min-width: 0;
}

/* 主楼：用户名、标签、冒号后与正文同一视觉流 */
.sm-feed-inline-body {
    font-size: 15px;
    line-height: 1.65;
    color: #333333;
    word-break: break-word;
}

.sm-feed-head-inline {
    display: inline;
    font-weight: normal;
}

.sm-feed-colon {
    color: #333333;
    margin: 0 1px 0 0;
}

.sm-feed-name {
    display: inline;
    font-size: 15px;
    font-weight: 600;
    color: #e67e22;
}

.sm-feed-name--admin {
    color: #5b89ad;
}

/* 微博式标签：描边小框（楼主橙框 / 站长蓝框） */
.sm-badge {
    display: inline-block;
    font-size: 10px;
    line-height: 1.35;
    padding: 0 5px;
    border-radius: 2px;
    font-weight: 400;
    vertical-align: 1px;
    margin-left: 4px;
    background: transparent;
}

.sm-badge-lz {
    color: #e67e22;
    border: 1px solid rgba(230, 126, 34, 0.55);
}

.sm-badge-reply {
    color: #888;
    border: 1px solid #d8d8d8;
}

.sm-badge-admin {
    color: #5b89ad;
    border: 1px solid rgba(91, 137, 173, 0.55);
}

.sm-feed-text--main {
    display: inline;
    font-size: 15px;
    font-weight: 400;
    color: #333333;
    white-space: pre-wrap;
}

/* 主楼底栏：与上方回复区分隔，时间在左、细线图标在右 */
.sm-feed-meta {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: space-between;
    flex-wrap: wrap;
    gap: 8px;
    margin-top: 12px;
    padding-top: 10px;
    border-top: 1px solid #f0f0f0;
    font-size: 12px;
    color: #939393;
}

.sm-feed-meta-left {
    flex: 1;
    min-width: 0;
    font-variant-numeric: tabular-nums;
}

.sm-feed-actions {
    display: inline-flex;
    flex-direction: row;
    align-items: center;
    gap: 2px;
    flex-shrink: 0;
}

.sm-feed-svg {
    display: block;
    width: 18px;
    height: 18px;
    flex-shrink: 0;
}

.sm-feed-act {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    min-width: 30px;
    height: 30px;
    padding: 0 4px;
    margin: 0;
    border: none;
    background: transparent;
    color: #939393;
    line-height: 1;
    cursor: pointer;
    border-radius: 4px;
    transition: color 0.15s ease, background 0.15s ease;
}

.sm-feed-act:hover {
    color: #e67e22;
    background: rgba(230, 126, 34, 0.08);
}

.sm-feed-like {
    cursor: default;
    user-select: none;
    gap: 4px;
}

.sm-feed-like-num {
    font-size: 12px;
    color: #939393;
    margin-left: 2px;
    font-variant-numeric: tabular-nums;
}

/* 嵌套区：浅灰底 #F7F8FA，与主楼正文左缘对齐（已在 maincol 内，不压头像列） */
.sm-feed-nested {
    margin-top: 12px;
    padding: 12px 12px 10px;
    background: #f7f8fa;
    border-radius: 8px;
    border: 1px solid #eef0f3;
}

.sm-feed-nested-inner .sm-feed-nested-item + .sm-feed-nested-item {
    margin-top: 10px;
    padding-top: 10px;
    border-top: 1px solid rgba(0, 0, 0, 0.06);
}

.sm-feed-nested-inline {
    margin: 0;
    font-size: 14px;
    line-height: 1.55;
    color: #333333;
}

.sm-feed-nested-head {
    display: inline;
    font-weight: normal;
}

.sm-feed-nested-text {
    display: inline;
    white-space: pre-wrap;
    word-break: break-word;
}

.sm-feed-meta-nested {
    margin-top: 5px;
    font-size: 12px;
    line-height: 1.4;
    color: #939393;
    font-variant-numeric: tabular-nums;
}

.sm-feed-nested-more {
    display: flex;
    flex-direction: row;
    align-items: center;
    justify-content: center;
    gap: 4px;
    margin-top: 8px;
    padding-top: 6px;
    font-size: 12px;
    color: #e53935;
    cursor: default;
    user-select: none;
}

.sm-feed-nested-more-chev {
    font-size: 10px;
    line-height: 1;
    opacity: 0.9;
}

.my-message-card.sm-weibo-topic .sm-feed-pending {
    margin: 0;
    border-top: 1px dashed #fcd34d;
    border-radius: 0;
}

.my-message-card.sm-weibo-topic .thread-user-reply.forum-quick-reply {
    border-radius: 0 0 8px 8px;
    margin-top: 0;
    background: #f8fafc;
    border-top: 1px solid #e8ecf2;
}

.my-message-card.sm-weibo-topic .forum-quick-reply-head {
    padding: 10px 14px;
    font-size: 13px;
    font-weight: 600;
    color: #4a6fa5;
    background: linear-gradient(180deg, #e8f0fc 0%, #dce8f8 100%);
    border-bottom: 1px solid #c5d5eb;
}

:is(.site-message-modal, .site-message-layer-host) .my-message-card.sm-weibo-topic .thread-user-reply-input,
:is(.site-message-modal, .site-message-layer-host) .my-message-card.sm-weibo-topic .forum-quick-reply-input {
    border-radius: 8px;
    border-color: #c9d4e3;
}

:is(.site-message-modal, .site-message-layer-host) .my-message-card.sm-weibo-topic .thread-user-reply .submit-btn {
    background: linear-gradient(135deg, #ff5f5f 0%, #ff4b4b 100%);
    border: none;
    color: #fff;
    border-radius: 8px;
    box-shadow: 0 4px 12px rgba(255, 95, 95, 0.32);
}

:is(.site-message-modal, .site-message-layer-host) .my-message-card.sm-weibo-topic .thread-user-reply .submit-btn:hover {
    background: linear-gradient(135deg, #ff5252 0%, #ef3e3e 100%);
    box-shadow: 0 4px 14px rgba(255, 82, 82, 0.4);
}

:is(.site-message-modal, .site-message-layer-host) .my-message-card.sm-weibo-topic .thread-user-reply .submit-btn:disabled {
    background: #ccc;
    box-shadow: none;
    cursor: not-allowed;
}