/**
 * 论坛文章页 v2 — 比腾讯云社区更好用的阅读体验
 */
body.page-forum-article {
  background: #f5f6f8 !important;
}

/* 滚动吸顶条 */
.fa-sticky {
  position: fixed;
  top: 56px; /* 避开站点导航，始终能回首页/搜索 */
  left: 0;
  right: 0;
  z-index: 90;
  height: 52px;
  background: rgba(255, 255, 255, 0.96);
  border-bottom: 1px solid #e7e7e7;
  backdrop-filter: blur(8px);
  display: none;
  align-items: center;
  gap: 12px;
  padding: 0 20px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.04);
}
.fa-sticky.show { display: flex; }
.fa-sticky img {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
}
.fa-sticky .meta { min-width: 0; flex: 1; }
.fa-sticky .name { font-size: 13px; font-weight: 650; color: #1f2329; }
.fa-sticky .ttl {
  font-size: 12px;
  color: #8a919f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: min(52vw, 560px);
}
.fa-sticky .fa-follow {
  flex: 0 0 auto;
  width: auto;
  margin-top: 0;
}

.fa-wrap {
  max-width: 1240px;
  margin: 0 auto;
  padding: 16px 16px 80px;
  position: relative;
}

.fa-layout {
  display: grid;
  grid-template-columns: 52px minmax(0, 1fr) 300px;
  gap: 18px 22px;
  align-items: start;
}

.fa-main { min-width: 0; }

.fa-card {
  position: relative;
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 28px 36px 36px;
  overflow: hidden;
}

.fa-crumb {
  font-size: 13px;
  color: #8a919f;
  margin-bottom: 14px;
  line-height: 1.5;
}
.fa-crumb a { color: #8a919f; text-decoration: none; }
.fa-crumb a:hover { color: #0052d9; }
.fa-crumb span { margin: 0 6px; color: #c0c4cc; }
.fa-crumb-now {
  color: #646a73 !important;
  margin: 0 !important;
  display: inline;
  max-width: 48vw;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  vertical-align: bottom;
}

.fa-ribbon {
  position: absolute;
  top: 14px;
  right: -28px;
  width: 110px;
  background: #0052d9;
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  text-align: center;
  padding: 4px 0;
  transform: rotate(45deg);
  box-shadow: 0 2px 6px rgba(0, 82, 217, 0.25);
  letter-spacing: 0.04em;
}
.fa-ribbon.third-party {
  background: #f59e0b;
  box-shadow: 0 2px 6px rgba(245, 158, 11, 0.25);
}

.fa-title-flags { margin-bottom: 8px; }
.fa-title {
  margin: 0 0 12px;
  font-size: 28px;
  font-weight: 800;
  line-height: 1.4;
  color: #1f2329;
  letter-spacing: -0.02em;
  padding-right: 48px;
}

.fa-meta-line {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 4px;
  font-size: 13px;
  color: #8a919f;
  padding-bottom: 16px;
  border-bottom: 1px solid #f0f2f5;
  margin-bottom: 16px;
}
.fa-meta-line .dot { color: #d0d3d9; margin: 0 4px; }
.fa-meta-actions {
  margin-left: auto;
  display: flex;
  gap: 12px;
  align-items: center;
}
.fa-meta-actions a,
.fa-report {
  border: 0;
  background: transparent;
  color: #8a919f;
  font-size: 13px;
  cursor: pointer;
  text-decoration: none;
  padding: 0;
}
.fa-meta-actions a:hover,
.fa-report:hover { color: #0052d9; }

.fa-overview {
  background: #f5f9ff;
  border: 1px solid #e3efff;
  border-radius: 6px;
  padding: 14px 16px 12px;
  margin-bottom: 14px;
}
.fa-overview-hd {
  font-size: 14px;
  font-weight: 750;
  color: #0052d9;
  margin-bottom: 6px;
}
.fa-overview p {
  margin: 0;
  font-size: 14px;
  line-height: 1.7;
  color: #3b4453;
}

.fa-series {
  display: inline-flex;
  align-items: center;
  margin-bottom: 8px;
  padding: 4px 10px;
  border-radius: 3px;
  background: #eef5ff;
  color: #0052d9;
  font-size: 12px;
  font-weight: 650;
  text-decoration: none;
}
.fa-series:hover { background: #e0edff; }

.fa-badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 3px;
  font-size: 12px;
  font-weight: 650;
  margin-right: 6px;
  vertical-align: middle;
}
.fa-badge.top { background: #fff1e9; color: #d35a21; }
.fa-badge.hot {
  background: linear-gradient(90deg, #ff4d4f, #ff7a45);
  color: #fff;
  letter-spacing: .04em;
}
.fa-badge.essence { background: #e8f8f0; color: #00a870; }
.fa-badge.locked { background: #f2f3f5; color: #8a919f; }
.fa-badge.orig { background: #fff7e8; color: #e37318; }

.fa-follow {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 14px;
  border-radius: 4px;
  border: 0;
  background: #0052d9;
  color: #fff !important;
  font-size: 13px;
  font-weight: 650;
  cursor: pointer;
  text-decoration: none !important;
  white-space: nowrap;
  width: 100%;
  margin-top: 12px;
  box-sizing: border-box;
}
.fa-follow:hover { background: #0046c0; }
.fa-follow.on {
  background: #f2f3f5;
  color: #646a73 !important;
}

.fa-content {
  padding: 10px 0 8px;
  font-size: 16px;
  line-height: 1.9;
  color: #1f2329;
  word-break: break-word;
}
.fa-content h1, .fa-content h2, .fa-content h3 {
  margin: 1.5em 0 0.55em;
  font-weight: 750;
  line-height: 1.4;
  scroll-margin-top: 72px;
}
.fa-content h2 { font-size: 22px; }
.fa-content h3 { font-size: 18px; }
.fa-content p { margin: 0.9em 0; }
.fa-content pre {
  background: #f6f8fa;
  border-radius: 8px;
  padding: 14px 16px;
  overflow-x: auto;
  font-size: 13px;
  line-height: 1.65;
  border: 1px solid #eef0f3;
}
.fa-content code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  background: #f2f3f5;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 0.92em;
}
.fa-content pre code { background: transparent; padding: 0; }
.fa-content img { max-width: 100%; border-radius: 8px; }
.fa-content a { color: #0052d9; }
.fa-content ul, .fa-content ol { padding-left: 1.4em; }

.fa-section {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 22px 24px 24px;
  margin-top: 16px;
}
.fa-section h2 {
  margin: 0 0 14px;
  font-size: 16px;
  font-weight: 750;
}

.fa-related {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 10px 18px;
}
.fa-related a {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  text-decoration: none;
  color: #1f2329;
  font-size: 13px;
  line-height: 1.45;
  padding: 8px;
  border-radius: 6px;
}
.fa-related a:hover { background: #f7f8fa; color: #0052d9; }
.fa-related .eye { color: #8a919f; white-space: nowrap; font-size: 12px; margin-left: auto; }

.fa-reply {
  display: flex;
  gap: 14px;
  padding: 16px 0;
  border-bottom: 1px solid #f0f2f5;
}
.fa-reply:last-child { border-bottom: 0; }
.fa-reply img.avatar {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}
.fa-reply-hd {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 12px;
  align-items: center;
  margin-bottom: 8px;
  font-size: 12px;
  color: #8a919f;
}
.fa-reply-hd a {
  font-size: 14px;
  font-weight: 650;
  color: #1f2329;
  text-decoration: none;
}
.fa-reply-hd a:hover { color: #0052d9; }
.fa-reply-meta {
  color: #a8adb8;
  font-size: 11px;
}
.fa-reply-delete {
  margin-left: auto;
  border: none;
  background: none;
  color: #c9cdd4;
  font-size: 11px;
  cursor: pointer;
  padding: 0;
}
.fa-reply-delete:hover:not(:disabled) { color: #ef4444; }
.fa-reply-delete:disabled { opacity: 0.6; cursor: wait; }
.fa-reply-body { font-size: 14px; line-height: 1.75; color: #3b4453; }

/* 右侧 */
.fa-side { position: sticky; top: 72px; }
.fa-side-card {
  background: #fff;
  border-radius: 4px;
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.04);
  padding: 16px 18px;
  margin-bottom: 12px;
}
.fa-side h3 { margin: 0; font-size: 15px; font-weight: 750; color: #1f2329; }
.fa-side-hd {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.fa-side-refresh {
  border: 0;
  background: transparent;
  color: #8a919f;
  font-size: 12px;
  cursor: pointer;
  padding: 0;
}
.fa-side-refresh:hover { color: #0052d9; }

.fa-author-card { text-align: left; }
.fa-author-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
}
.fa-author-info { min-width: 0; flex: 1; }
.fa-author-name {
  display: inline-flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
  font-size: 16px;
  font-weight: 750;
  color: #1f2329;
  text-decoration: none;
  line-height: 1.35;
}
.fa-author-name:hover { color: #0052d9; }
.fa-author-name .lv {
  display: inline-block;
  padding: 0 6px;
  height: 18px;
  line-height: 18px;
  border-radius: 3px;
  background: #fff7e8;
  color: #e37318;
  font-size: 11px;
  font-weight: 750;
}
.fa-author-role {
  margin-top: 6px;
  font-size: 12px;
  color: #8a919f;
  line-height: 1.4;
}
.fa-author-card img {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  object-fit: cover;
  flex: 0 0 auto;
}
.fa-author-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 4px;
  margin-top: 14px;
  padding-top: 12px;
  border-top: 1px solid #f0f2f5;
  text-align: center;
}
.fa-author-stats b {
  display: block;
  font-size: 16px;
  font-weight: 750;
  color: #1f2329;
  line-height: 1.2;
}
.fa-author-stats span {
  display: block;
  margin-top: 2px;
  font-size: 12px;
  color: #8a919f;
}

.fa-author-list a {
  display: flex;
  gap: 8px;
  align-items: flex-start;
  padding: 8px 0;
  text-decoration: none;
  color: #1f2329;
  font-size: 13px;
  line-height: 1.45;
  border-bottom: 1px solid #f5f6f8;
}
.fa-author-list a:last-child { border-bottom: 0; }
.fa-author-list a:hover { color: #0052d9; }
.fa-author-list .ico { flex: 0 0 auto; opacity: 0.7; }
.fa-author-list .t {
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

.fa-toc-card { max-height: calc(100vh - 120px); overflow: auto; }
.fa-toc-empty { color: #8a919f; font-size: 12px; }
.fa-toc a {
  display: block;
  padding: 6px 8px;
  border-radius: 4px;
  color: #646a73;
  text-decoration: none;
  font-size: 13px;
  line-height: 1.4;
  border-left: 2px solid transparent;
}
.fa-toc a:hover, .fa-toc a.active {
  color: #0052d9;
  background: #f3f8ff;
  border-left-color: #0052d9;
  font-weight: 650;
}
.fa-toc a.lv2 { padding-left: 18px; font-size: 12px; }

.fa-rail-rec {
  margin-top: 4px;
  min-width: 36px;
  height: 22px;
  padding: 0 8px;
  border-radius: 999px;
  background: linear-gradient(135deg, #ff9a3c, #ff6a00);
  color: #fff;
  font-size: 11px;
  font-weight: 750;
  line-height: 22px;
  text-align: center;
  box-shadow: 0 4px 10px rgba(255, 106, 0, 0.28);
}

body.fa-reader-on .fa-side,
body.fa-reader-on .fa-sticky,
body.fa-reader-on .fa-related,
body.fa-reader-on .fa-section:not(#fa-comments):not(#reply-end) {
  display: none !important;
}
body.fa-reader-on .fa-layout {
  grid-template-columns: 52px minmax(0, 760px);
  justify-content: center;
}
body.fa-reader-on .fa-rail {
  background: transparent;
  box-shadow: none;
}

/* ===== 左侧操作栏（贴内容区，带浮层） ===== */
.fa-rail {
  position: sticky;
  top: 128px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  z-index: 30;
  padding: 10px 6px;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.72);
  backdrop-filter: blur(10px);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.06);
}
.fa-rail-item { position: relative; }
.fa-rail-btn {
  position: relative;
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: #4b5563;
  text-decoration: none;
  transition: transform .15s ease, box-shadow .15s ease, color .15s ease;
}
.fa-rail-btn:hover {
  transform: translateY(-1px);
  box-shadow: 0 6px 16px rgba(15, 23, 42, 0.12);
  color: #0052d9;
}
.fa-rail-btn.active { color: #0052d9; box-shadow: 0 0 0 2px rgba(0, 82, 217, 0.16); }
.fa-rail-btn svg { width: 20px; height: 20px; }
.fa-rail-btn .emoji { font-size: 20px; line-height: 1; }
.fa-rail-count {
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  min-width: 20px;
  height: 16px;
  padding: 0 5px;
  border-radius: 999px;
  background: #eef2f7;
  color: #3b4453;
  font-size: 11px;
  font-weight: 700;
  line-height: 16px;
  text-align: center;
}
.fa-rail-count.hot {
  background: #fff;
  color: #e37318;
  border: 1px solid #f0a060;
}
.fa-rail-sep {
  width: 22px;
  height: 1px;
  background: #e5e7eb;
  margin: 2px 0;
}

.fa-pop {
  position: absolute;
  left: calc(100% + 12px);
  top: 50%;
  transform: translateY(-50%);
  background: #fff;
  border-radius: 10px;
  box-shadow: 0 8px 28px rgba(15, 23, 42, 0.14);
  border: 1px solid #eef0f3;
  padding: 12px;
  display: none;
  z-index: 40;
  white-space: nowrap;
}
.fa-pop::before {
  content: '';
  position: absolute;
  left: -6px;
  top: 50%;
  width: 10px;
  height: 10px;
  background: #fff;
  border-left: 1px solid #eef0f3;
  border-bottom: 1px solid #eef0f3;
  transform: translateY(-50%) rotate(45deg);
}
.fa-rail-item.open .fa-pop,
.fa-rail-item:hover .fa-pop.hoverable { display: block; }
@media (hover: none) {
  .fa-rail-item:hover .fa-pop.hoverable { display: none; }
  .fa-rail-item.open .fa-pop.hoverable { display: block; }
}

.fa-emo {
  display: flex;
  gap: 4px;
}
.fa-emo button {
  border: 0;
  background: transparent;
  border-radius: 8px;
  padding: 6px 8px;
  cursor: pointer;
  min-width: 56px;
}
.fa-emo button:hover { background: #f5f7fa; }
.fa-emo .e { font-size: 22px; line-height: 1; display: block; }
.fa-emo .l { display: block; font-size: 11px; color: #646a73; margin-top: 4px; }
.fa-emo .c { display: block; font-size: 11px; color: #8a919f; }
.fa-emo button.on { background: #e8f3ff; }

.fa-share-list {
  min-width: 160px;
  padding: 4px 0;
}
.fa-share-list .hd {
  padding: 4px 10px 8px;
  font-size: 13px;
  font-weight: 650;
  color: #1f2329;
}
.fa-share-list button,
.fa-share-list a {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  border: 0;
  background: transparent;
  padding: 9px 12px;
  font-size: 13px;
  color: #1f2329;
  text-decoration: none;
  cursor: pointer;
  text-align: left;
}
.fa-share-list button:hover,
.fa-share-list a:hover { background: #f5f7fa; }

.fa-tip {
  min-width: 220px;
  max-width: 260px;
  white-space: normal;
  padding: 12px 14px;
  font-size: 13px;
  line-height: 1.55;
  color: #3b4453;
}
.fa-tip a { color: #0052d9; text-decoration: none; font-weight: 650; }

.fa-fav-item {
  display: block;
  padding: 14px 0;
  border-bottom: 1px solid #f0f2f5;
  text-decoration: none;
  color: inherit;
}
.fa-fav-item:hover .t { color: #0052d9; }
.fa-fav-item .t { font-size: 15px; font-weight: 650; color: #1f2329; }
.fa-fav-item .m { margin-top: 6px; font-size: 12px; color: #8a919f; }

.fa-fab {
  position: fixed;
  right: 24px;
  bottom: 28px;
  z-index: 50;
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.fa-fab button {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  border: 0;
  background: #fff;
  box-shadow: 0 4px 14px rgba(0, 0, 0, 0.12);
  cursor: pointer;
  color: #4b5563;
}
.fa-fab button:hover { color: #0052d9; }

.fa-toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  background: rgba(31, 35, 41, 0.92);
  color: #fff;
  padding: 10px 16px;
  border-radius: 6px;
  font-size: 13px;
  z-index: 120;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s ease;
}
.fa-toast.show { opacity: 1; }

@media (max-width: 1100px) {
  .fa-layout { grid-template-columns: 56px minmax(0, 1fr); }
  .fa-side { display: none; }
}
@media (max-width: 800px) {
  .fa-layout { grid-template-columns: 1fr; }
  /* Keep global .ac-mobile-bar; demote article rail so they don't stack */
  .fa-rail {
    position: static !important;
    left: auto; right: auto; top: auto; bottom: auto;
    flex-direction: row !important;
    flex-wrap: wrap;
    justify-content: flex-start;
    background: transparent !important;
    box-shadow: none !important;
    padding: 8px 0 !important;
    z-index: auto;
    gap: 8px !important;
  }
  .fa-pop {
    left: 50%;
    top: auto;
    bottom: calc(100% + 10px);
    transform: translateX(-50%);
  }
  .fa-pop::before {
    left: 50%;
    top: auto;
    bottom: -5px;
    transform: translateX(-50%) rotate(-45deg);
  }
  .fa-card { padding: 20px 16px; }
  .fa-title { font-size: 22px; }
  .fa-wrap { padding-bottom: calc(72px + env(safe-area-inset-bottom)) !important; }
  .fa-fab { bottom: calc(72px + env(safe-area-inset-bottom)) !important; }
  .fa-related { grid-template-columns: 1fr; }
  .fa-sticky .ttl { max-width: 36vw; }
}
