/* Private Message actions block */
#block-privatemessageactions .content {
  display: flex;
  flex-direction: column;
  gap: 0.35em;
}

#block-privatemessageactions .content a {
  display: block;
  padding: 0.25em 0;
}

.private_message_thread_clear_history_link_wrapper {
  display: none !important;
}

/* Private Message inbox: hide confusing participant list such as "You, admin" */
.private-message-recipients {
  display: none !important;
}

/* Private Message inbox: make each preview item clearer */
.private-message.private-message-inbox {
  padding: 0.75em 0;
  border-bottom: 1px solid #ddd;
}

/* Sent messages: authored by current user */
.private-message.private-message-inbox.private-message-author-self::before {
  content: "已发送";
  display: inline-block;
  font-weight: 600;
  margin-bottom: 0.25em;
}

/* Received messages: authored by another user */
.private-message.private-message-inbox:not(.private-message-author-self)::before {
  content: "已收到";
  display: inline-block;
  font-weight: 600;
  margin-bottom: 0.25em;
}

/* Add a clearer prefix before the author name */
.private-message.private-message-inbox.private-message-author-self .field--name-owner .field__item::before {
  content: "发信人：";
  font-weight: 600;
}

.private-message.private-message-inbox:not(.private-message-author-self) .field--name-owner .field__item::before {
  content: "发信人：";
  font-weight: 600;
}

/* 论坛主帖正文 */
.block-field-blocknodeforum-postbody .field--name-body,
.block-field-blocknodeforum-postbody .field--name-body *,
.node--type-forum-post .field--name-body,
.node--type-forum-post .field--name-body * {
  font-family: Consolas, Monaco, "Courier New", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif !important;
}

/* 论坛回帖/评论正文 */
.comment .field--name-comment-body,
.comment .field--name-comment-body *,
.comment .text-formatted,
.comment .text-formatted * {
  font-family: Consolas, Monaco, "Courier New", "Noto Sans CJK SC", "Microsoft YaHei", sans-serif !important;
}

/* Enable scrolling for wide table on mobile platform */
@media (max-width: 768px) {
  .view table {
    display: block;
    width: 100%;
    overflow-x: auto;
  }

  .view table th,
  .view table td {
    white-space: nowrap;
  }
}

/* 手机和平板窄屏：论坛帖子正文隐藏左栏，右栏横向滚动 */
@media (max-width: 1024px) {

  .node--type-forum-post .layout--twocol-section {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    overflow: visible !important;
  }

  /* 移动端/横屏都隐藏左栏 */
  .node--type-forum-post .layout--twocol-section > .layout__region--first {
    display: none !important;
  }

  /* 右栏占满屏幕，并作为横向滚动容器 */
  .node--type-forum-post .layout--twocol-section > .layout__region--second {
    display: block !important;
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    flex: none !important;

    overflow-x: auto !important;
    overflow-y: visible !important;
    -webkit-overflow-scrolling: touch;
  }

  /* 右栏内部内容保持较宽，避免竖屏强制换行 */
  .node--type-forum-post .layout--twocol-section > .layout__region--second > * {
    width: 660px !important;
    min-width: 660px !important;
    max-width: none !important;
  }
}
