/* 留言图标 */
.site-message-icon {
    position: fixed;
    bottom: 30px;
    right: 30px;
    width: 60px;
    height: 60px;
    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;
}

.site-message-modal .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;
}

/* ========== 论坛风皮肤（仅 .site-message-forum） ========== */
.site-message-modal .modal-content.site-message-forum {
    border-radius: 4px;
    border: 1px solid #9eacbc;
    background: #e6ecf3;
    box-shadow: 0 10px 36px rgba(15, 23, 42, 0.2);
    overflow: hidden;
}

.site-message-forum .modal-header {
    background: linear-gradient(180deg, #3d4d61 0%, #2d3a4a 100%);
    border-bottom: 1px solid #1a222c;
    padding: 12px 16px;
}

.site-message-forum .modal-header h3 {
    color: #f1f5f9;
    font-size: 16px;
    font-weight: 600;
    letter-spacing: 0.03em;
}

.site-message-forum .site-message-panel-toggle {
    background: rgba(255, 255, 255, 0.12);
    border-color: rgba(255, 255, 255, 0.28);
    color: #e2e8f0;
}

.site-message-forum .site-message-panel-toggle:hover {
    background: rgba(255, 255, 255, 0.2);
    border-color: rgba(255, 255, 255, 0.45);
    color: #fff;
}

.site-message-forum .close-btn {
    color: #94a3b8;
}

.site-message-forum .close-btn:hover {
    background: rgba(255, 255, 255, 0.1);
    color: #f8fafc;
}

.site-message-forum .modal-body {
    background: #e6ecf3;
    padding: 12px 14px 16px;
}

.site-message-forum .forum-compose {
    background: #fff;
    border: 1px solid #b4bec9;
    border-radius: 2px;
    padding: 16px 18px;
    box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.9);
}

.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);
    }
}

.site-message-modal .modal-header {
    padding: 18px 20px;
    border-bottom: 1px solid #e9ecef;
    display: flex;
    justify-content: space-between;
    align-items: center;
}

.site-message-modal .modal-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;
}

/* 右侧全屏侧栏：宽 650px、高 100vh */
.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: 670px) {
    .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;
}

.site-message-modal .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;
}

.site-message-modal .close-btn:hover {
    background: #f0f0f0;
    color: #333;
}

.site-message-modal .modal-body {
    padding: 20px;
}

.site-message-modal .form-group {
    margin-bottom: 18px;
}

.site-message-modal .form-group label {
    display: block;
    margin-bottom: 6px;
    font-weight: 500;
    color: #333;
}

.site-message-modal .form-group input,
.site-message-modal .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;
}

.site-message-modal .form-group input::placeholder,
.site-message-modal .form-group textarea::placeholder {
    color: #6c757d;
    opacity: 1;
}

.site-message-modal .form-group input:focus,
.site-message-modal .form-group textarea:focus {
    outline: none;
    border-color: #2271b1;
    box-shadow: 0 0 0 2px rgba(34,113,177,0.1);
}

.site-message-modal .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;
}

.site-message-modal .submit-btn:hover {
    background: #135e96;
}

.site-message-modal .submit-btn:disabled {
    background: #ccc;
    cursor: not-allowed;
}

.site-message-modal .message-status {
    margin-top: 12px;
    padding: 10px;
    border-radius: 6px;
    text-align: center;
    font-size: 14px;
    display: none;
}

.site-message-modal .message-status.success {
    background: #d4edda;
    color: #155724;
    display: block;
}

.site-message-modal .message-status.error {
    background: #f8d7da;
    color: #721c24;
    display: block;
}

/* 弹窗：Tab（论坛分区条） */
.site-message-tabs {
    display: flex;
    gap: 0;
    border-bottom: 1px solid #e9ecef;
    padding: 0 20px;
    background: #f8f9fa;
}

.site-message-forum .site-message-tabs {
    padding: 0;
    background: #c5d0dc;
    border-bottom: 1px solid #8a9aa8;
}

.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;
    color: #475569;
    border: 1px solid transparent;
    border-bottom: none;
    margin-bottom: 0;
    padding: 11px 14px;
    background: transparent;
}

.site-message-forum .site-message-tab:hover {
    color: #1e293b;
    background: rgba(255, 255, 255, 0.35);
}

.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: #1e293b;
    font-weight: 700;
    background: #edf1f5;
    border: 1px solid #8a9aa8;
    border-bottom: 1px solid #edf1f5;
    margin-bottom: -1px;
    position: relative;
    z-index: 1;
}

.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: #fff;
    border: 1px solid #b4bec9;
    padding: 10px 12px;
    border-radius: 2px;
    color: #475569;
    margin-bottom: 12px;
}

.my-messages-list {
    max-height: 320px;
    overflow-y: auto;
    margin-top: 8px;
}

.site-message-forum .my-messages-list {
    margin-top: 0;
}

/* 论坛：主题帖容器 */
.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;
}

.site-message-modal .forum-quick-reply-input,
.site-message-modal .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;
}

.site-message-modal .forum-quick-reply-input:focus,
.site-message-modal .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;
}

.site-message-modal .forum-quick-reply .submit-btn,
.site-message-modal .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;
}

.site-message-modal .my-message-block strong,
.site-message-modal .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;
}

.site-message-modal .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-modal .modal-content.site-message-forum,
.site-message-login-prompt.modal-content {
    border-radius: 18px;
    border: 1px solid rgba(255, 255, 255, 0.75);
    background: #ffffff;
    box-shadow: 0 20px 50px rgba(2, 8, 23, 0.26);
}

.site-message-forum .modal-header {
    background: #ffffff;
    border-bottom: 1px solid #edf1f7;
    padding: 16px 18px;
}

.site-message-forum .modal-header h3 {
    color: #0f172a;
    font-size: 24px;
    font-weight: 700;
    letter-spacing: 0;
}

.site-message-forum .site-message-panel-toggle {
    background: #f8fafc;
    border: 1px solid #dbe4f0;
    color: #334155;
    border-radius: 10px;
}

.site-message-forum .site-message-panel-toggle:hover {
    background: #eef4ff;
    border-color: #bfdbfe;
    color: #1d4ed8;
}

.site-message-forum .close-btn {
    color: #94a3b8;
}

.site-message-forum .close-btn:hover {
    background: #f1f5f9;
    color: #334155;
}

.site-message-forum .site-message-tabs {
    background: #f8fafc;
    border-bottom: 1px solid #edf1f7;
    padding: 8px 10px;
    gap: 8px;
}

.site-message-forum .site-message-tab {
    border: none;
    border-radius: 10px;
    color: #64748b;
    background: transparent;
    font-weight: 500;
    margin: 0;
}

.site-message-forum .site-message-tab:hover {
    background: #eef4ff;
    color: #1d4ed8;
}

.site-message-forum .site-message-tab.active {
    background: linear-gradient(135deg, #2563eb 0%, #3b82f6 100%);
    color: #fff;
    font-weight: 600;
    border: none;
}

.site-message-forum .modal-body {
    background: #f4f7fb;
    padding: 14px;
}

.site-message-forum .forum-compose,
.site-message-forum .site-message-hint,
.my-message-card.forum-topic-card {
    border-radius: 14px;
    border: 1px solid #e6edf7;
    box-shadow: 0 8px 22px rgba(15, 23, 42, 0.06);
}

.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;
}

.site-message-modal .forum-quick-reply-input,
.site-message-modal .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;
}

.site-message-modal .forum-quick-reply-input:focus,
.site-message-modal .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%);
}