/* ============================================================
   rhex-post-polish.css — 帖子页（/d/*）版式精修
   卡片化楼层 + 正文排版 + 回复按钮 + 信息条 + 暗色 + 移动端
   ============================================================ */

/* ---------- 1. 楼层卡片化 ---------- */
.PostStream-item {
  margin-bottom: 12px !important;
}

.PostStream-item:last-child {
  margin-bottom: 0 !important;
}

.DiscussionPage .PostStream .PostStream-item .Post:not(.ReplyPlaceholder),
.DiscussionPage .PostStream .PostStream-item article.CommentPost,
.PostStream-item > .Post {
  background: #fff !important;
  border: 1px solid #e6e9ee !important;
  border-top: 1px solid #e6e9ee !important;
  border-radius: 14px !important;
  padding: 18px 22px 14px !important;
  margin: 0 !important;
  box-shadow: 0 3px 14px -6px rgba(16, 24, 40, .16) !important;
  transition: box-shadow .18s ease, border-color .18s ease;
}

.DiscussionPage .PostStream .PostStream-item .Post:hover,
.PostStream-item > .Post:hover {
  border-color: #d9dde4 !important;
  box-shadow: 0 12px 28px -14px rgba(16, 24, 40, .28) !important;
}

/* ---------- 2. 楼层头部 ---------- */
.Post-header {
  margin-bottom: 14px !important;
}

.Post-avatar {
  width: 42px !important;
  height: 42px !important;
  border-radius: 50% !important;
  box-shadow: 0 0 0 3px #fff, 0 1px 3px rgba(16, 24, 40, .14);
}

.Post-header .PostUser-name a,
.Post-header .PostUser-name {
  font-size: 15px !important;
  font-weight: 600 !important;
  color: #1a1d21;
}

.Post-header time,
.Post-header .PostMeta,
.Post-header .Post-date {
  font-size: 13px !important;
  color: #8f959e !important;
}

/* ---------- 3. 正文排版 ---------- */
.Post-body {
  font-size: 16px !important;
  line-height: 1.85 !important;
  color: #2a2f36;
  word-break: break-word;
}

.Post-body p {
  margin: 0 0 16px !important;
}

.Post-body > *:last-child {
  margin-bottom: 0 !important;
}

.Post-body a {
  color: #e2582a;
  text-decoration: underline;
  text-underline-offset: 2px;
  text-decoration-thickness: 1px;
  text-decoration-color: rgba(226, 88, 42, .45);
}

.Post-body a:hover {
  text-decoration-color: #e2582a;
}

.Post-body blockquote {
  margin: 0 0 16px !important;
  padding: 12px 16px !important;
  background: #f7f8fa !important;
  border-left: 3px solid #f2a07e !important;
  border-radius: 0 10px 10px 0 !important;
  color: #4b5259 !important;
}

.Post-body blockquote p:last-child {
  margin-bottom: 0 !important;
}

.Post-body pre {
  margin: 0 0 16px !important;
  padding: 14px 16px !important;
  background: #f6f7f9 !important;
  border: 1px solid #e7eaef !important;
  border-radius: 10px !important;
  font-size: 13.5px !important;
  line-height: 1.7 !important;
  overflow-x: auto;
}

.Post-body code {
  padding: 2px 5px !important;
  background: #f1f3f6 !important;
  border-radius: 5px !important;
  font-size: 13.5px !important;
}

.Post-body pre code {
  padding: 0 !important;
  background: none !important;
  font-size: inherit !important;
}

.Post-body img {
  max-width: 100%;
  border-radius: 10px;
}

.Post-body hr {
  margin: 22px 0 !important;
  border: 0;
  border-top: 1px solid #eceef2;
}

/* ---------- 4. 回复按钮（原来是一条黑色通栏） ---------- */
.DiscussionPage-nav .App-primaryControl .Button--primary,
.DiscussionPage-nav button.Button--primary,
.DiscussionHero .App-primaryControl .Button--primary {
  height: 44px;
  border-radius: 12px !important;
  background: linear-gradient(135deg, #ff8a3d 0%, #f26322 100%) !important;
  border: 0 !important;
  color: #fff !important;
  font-size: 15px !important;
  font-weight: 600 !important;
  box-shadow: 0 10px 20px -10px rgba(242, 99, 34, .6);
  transition: transform .16s ease, box-shadow .16s ease, filter .16s ease;
}

.DiscussionPage-nav .App-primaryControl .Button--primary:hover,
.DiscussionPage-nav button.Button--primary:hover,
.DiscussionHero .App-primaryControl .Button--primary:hover {
  filter: brightness(1.04);
  box-shadow: 0 12px 24px -10px rgba(242, 99, 34, .7);
}

.DiscussionPage-nav .App-primaryControl .Button--primary:active,
.DiscussionPage-nav button.Button--primary:active {
  transform: translateY(1px);
}

/* ---------- 5. 本帖信息条 ---------- */
.seohub-topicmeta {
  background: #fff !important;
  border: 1px solid #eceef2 !important;
  border-radius: 12px !important;
  padding: 12px 16px !important;
  margin: 16px 0 18px !important;
  font-size: 13px !important;
  line-height: 1.7 !important;
  color: #6b7280 !important;
}

.seohub-topicmeta a {
  color: #e2582a !important;
  text-decoration: none !important;
}

.seohub-topicmeta a:hover {
  text-decoration: underline !important;
}

/* ---------- 6. 标题与标签胶囊 ---------- */
.DiscussionHero h1,
.DiscussionHero .Hero-title,
.DiscussionHero .Hero-titleControl {
  font-size: 26px !important;
  line-height: 1.35 !important;
  font-weight: 700 !important;
  letter-spacing: -.01em;
}

.TagLabel {
  height: 24px !important;
  padding: 0 10px !important;
  border-radius: 8px !important;
  font-size: 12px !important;
  font-weight: 500 !important;
  border: 1px solid rgba(31, 111, 235, .16);
}

/* ---------- 7. 底部“说点什么吧”回复条 ---------- */
/* 站点用 rhex-editor.js 注入的窄条替代 Flarum 那个 140px 原占位，
   原占位必须藏住，否则会并排出现两个一模一样的输入框 */
button.Post.ReplyPlaceholder,
.PostStream .ReplyPlaceholder {
  display: none !important;
}

.rhex-reply-bar {
  margin: 16px 0 18px !important;
  height: 52px !important;
  display: flex !important;
  align-items: center !important;
  padding: 0 18px !important;
  background: #fff !important;
  border: 1px solid #e6e9ee !important;
  border-radius: 12px !important;
  box-shadow: 0 1px 2px rgba(16, 24, 40, .04) !important;
  font-size: 14px !important;
  color: #9aa0a8 !important;
  cursor: text;
}

.rhex-reply-bar:hover {
  border-color: #d9dde4 !important;
}

[data-theme="dark"] .rhex-reply-bar {
  background: #171a1f !important;
  border-color: #24282f !important;
  box-shadow: none !important;
  color: #7f8791 !important;
}

[data-theme="dark"] .rhex-reply-bar:hover {
  border-color: #31363e !important;
}

/* ---------- 8. 暗色 ---------- */
[data-theme="dark"] .DiscussionPage .PostStream .PostStream-item .Post,
[data-theme="dark"] .DiscussionPage .PostStream .PostStream-item article.CommentPost {
  background: #171a1f !important;
  border-color: #24282f !important;
  box-shadow: none !important;
}

[data-theme="dark"] .DiscussionPage .PostStream .PostStream-item .Post:hover {
  border-color: #31363e !important;
  box-shadow: 0 10px 24px -12px rgba(0, 0, 0, .65) !important;
}

[data-theme="dark"] .Post-avatar {
  box-shadow: 0 0 0 3px #171a1f, 0 1px 3px rgba(0, 0, 0, .5);
}

[data-theme="dark"] .Post-header .PostUser-name a,
[data-theme="dark"] .Post-header .PostUser-name {
  color: #e6e8ec;
}

[data-theme="dark"] .Post-header time,
[data-theme="dark"] .Post-header .PostMeta,
[data-theme="dark"] .Post-header .Post-date {
  color: #7f8791 !important;
}

[data-theme="dark"] .Post-body {
  color: #c3c8d1;
}

[data-theme="dark"] .Post-body blockquote {
  background: #1d2127 !important;
  border-left-color: #a85632 !important;
  color: #9aa2ad !important;
}

[data-theme="dark"] .Post-body pre {
  background: #1b1f25 !important;
  border-color: #2a2f37 !important;
  color: #d7dce4;
}

[data-theme="dark"] .Post-body code {
  background: #242931 !important;
  color: #dfe3ea !important;
}

[data-theme="dark"] .Post-body hr {
  border-top-color: #262b33;
}

[data-theme="dark"] .seohub-topicmeta {
  background: #1b1f25 !important;
  border-color: #262b33 !important;
  color: #9aa2ad !important;
}

[data-theme="dark"] .DiscussionPage .TagsLabel .TagLabel,
[data-theme="dark"] .DiscussionHero .TagsLabel .TagLabel {
  background: color-mix(in srgb, var(--tag-bg, #1f6feb) 22%, #171a1f) !important;
  color: #e4e8ee !important;
  border-color: color-mix(in srgb, var(--tag-bg, #1f6feb) 50%, transparent) !important;
}

/* ---------- 8. 移动端 ---------- */
@media (max-width: 767.98px) {
  .PostStream-item {
    margin-bottom: 10px !important;
  }

  .Post {
    padding: 14px 16px 12px !important;
    border-radius: 12px !important;
  }

  .Post-avatar {
    width: 36px !important;
    height: 36px !important;
  }

  .DiscussionHero h1,
  .DiscussionHero .Hero-title,
  .DiscussionHero .Hero-titleControl {
    font-size: 22px !important;
    line-height: 1.4 !important;
  }

  .Post-body {
    font-size: 15.5px !important;
    line-height: 1.8 !important;
  }

  .Post-body p {
    margin-bottom: 14px !important;
  }

  .seohub-topicmeta {
    padding: 10px 12px !important;
    margin: 12px 0 14px !important;
    font-size: 12px !important;
  }
}

