/* ================================================================
   论坛高级界面：版块 / 帖子列表 / 详情 / 富文本正文 / 回复
   ================================================================ */

/* ---------- 版块卡片 ---------- */
.board-grid { grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 16px; }
.board-card {
  position: relative; overflow: hidden;
  background: linear-gradient(160deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border); border-radius: var(--radius);
  padding: 18px; cursor: pointer; box-shadow: var(--shadow);
  transition: transform .2s var(--ease-ios), box-shadow .2s var(--ease-ios), border-color .2s;
}
.board-card::before {
  content: ''; position: absolute; inset: 0 auto 0 0; width: 3px;
  background: linear-gradient(180deg, var(--primary), var(--primary-2));
  opacity: .75;
}
.board-card:hover {
  transform: translateY(-3px); border-color: var(--primary);
  box-shadow: 0 6px 14px rgba(0,0,0,.08), 0 18px 44px rgba(0,0,0,.1);
}
.board-name { font-size: 17px; font-weight: 700; margin-bottom: 7px; letter-spacing: .2px; }
.board-desc { font-size: 12.5px; color: var(--text-muted); line-height: 1.6; }
.board-card-foot {
  display: flex; justify-content: space-between; gap: 8px; margin-top: 14px;
  padding-top: 11px; border-top: 1px solid var(--border);
  font-size: 12px; color: var(--text-muted);
}
.board-stat { display: flex; gap: 12px; }
.board-stat b { color: var(--text-sub); font-weight: 600; }

/* ---------- 帖子列表 ---------- */
.thread-list { display: flex; flex-direction: column; gap: 10px; }
.thread-item {
  display: flex; gap: 13px; padding: 14px 16px; cursor: pointer;
  background: var(--panel); border: 1px solid var(--border); border-radius: 14px;
  transition: all .18s var(--ease-ios);
}
.thread-item:hover {
  border-color: var(--primary); transform: translateX(3px);
  box-shadow: 0 4px 16px rgba(0,0,0,.06);
}
.thread-info { flex: 1; min-width: 0; }
.thread-title {
  font-size: 15px; font-weight: 600; margin-bottom: 6px; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.thread-summary {
  font-size: 12.5px; color: var(--text-muted); line-height: 1.55; margin-top: 5px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.thread-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 12px;
  font-size: 12px; color: var(--text-muted);
}
.thread-meta span { display: inline-flex; align-items: center; gap: 4px; }
.thread-author { font-weight: 500; color: var(--text-sub); }

.tag-top {
  display: inline-block; margin-right: 6px; padding: 1px 6px; border-radius: 5px;
  background: linear-gradient(135deg, #ff6b35, #f7b731);
  color: #fff; font-size: 11px; font-weight: 700; vertical-align: 1px;
}

/* ---------- 帖子详情 ---------- */
.td-head {
  padding: 18px 20px; background: var(--panel); border: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0; border-bottom: none;
}
.td-title { font-size: 21px; font-weight: 700; margin: 0 0 12px; line-height: 1.35; }
.td-meta {
  display: flex; align-items: center; flex-wrap: wrap; gap: 10px;
  font-size: 12.5px; color: var(--text-muted);
}
.td-author { font-weight: 600; color: var(--text-sub); }

/* ---------- 富文本正文（详情页与回复共用） ---------- */
.rich-content {
  padding: 20px; background: var(--panel);
  border: 1px solid var(--border); border-top: none;
  font-size: 14.5px; line-height: 1.8; color: var(--text);
  word-wrap: break-word; overflow-wrap: break-word;
}
.rich-content > *:first-child { margin-top: 0; }
.rich-content > *:last-child { margin-bottom: 0; }
.rich-content h2, .rich-content h3 { margin: 18px 0 10px; font-weight: 700; line-height: 1.35; }
.rich-content h2 { font-size: 19px; padding-bottom: 7px; border-bottom: 1px solid var(--border); }
.rich-content h3 { font-size: 16px; }
.rich-content p { margin: 0 0 12px; }
.rich-content blockquote {
  margin: 12px 0; padding: 10px 16px; border-left: 3px solid var(--primary);
  background: var(--primary-soft); border-radius: 0 10px 10px 0; color: var(--text-sub);
}
.rich-content pre {
  margin: 12px 0; padding: 14px 16px; background: var(--code-bg); border-radius: 10px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: 13px;
  overflow-x: auto; white-space: pre-wrap; word-break: break-all;
}
.rich-content code {
  padding: 2px 6px; background: var(--code-bg); border-radius: 5px;
  font-family: ui-monospace, SFMono-Regular, Menlo, monospace; font-size: .9em;
}
.rich-content pre code { padding: 0; background: none; }
.rich-content ul, .rich-content ol { margin: 10px 0; padding-left: 26px; }
.rich-content li { margin: 4px 0; }
.rich-content a { color: var(--primary); text-decoration: underline; }
.rich-content img {
  max-width: 100%; height: auto; border-radius: 10px; margin: 10px 0;
  border: 1px solid var(--border); cursor: zoom-in; display: block;
}
.rich-content img:hover { box-shadow: var(--shadow); }
.rich-content hr { border: none; border-top: 1px solid var(--border); margin: 18px 0; }
.rich-content table { border-collapse: collapse; margin: 12px 0; max-width: 100%; }
.rich-content th, .rich-content td {
  border: 1px solid var(--border); padding: 7px 12px; font-size: 13.5px;
}
.rich-content th { background: var(--panel-2); font-weight: 600; }

.td-actions {
  display: flex; gap: 10px; padding: 14px 20px; background: var(--panel);
  border: 1px solid var(--border); border-top: none;
  border-radius: 0 0 var(--radius) var(--radius);
}

/* ---------- 回复区 ---------- */
.reply-form { margin-top: 18px; }
.reply-form .editor-area { min-height: 120px; }
.reply-form-foot { display: flex; justify-content: flex-end; margin-top: 10px; }

#reply-list { display: flex; flex-direction: column; gap: 12px; margin-top: 18px; }
.reply-item {
  display: flex; gap: 12px; padding: 16px 18px; background: var(--panel);
  border: 1px solid var(--border); border-radius: 14px;
}
.reply-body { flex: 1; min-width: 0; }
.reply-head {
  display: flex; align-items: center; flex-wrap: wrap; gap: 9px;
  margin-bottom: 8px; font-size: 12.5px; color: var(--text-muted);
}
.reply-author { font-weight: 600; color: var(--text-sub); font-size: 13.5px; }
.reply-floor {
  padding: 0 6px; background: var(--code-bg); border-radius: 5px;
  font-size: 11px; font-weight: 600;
}
.reply-content {
  font-size: 14px; line-height: 1.75; padding: 0; border: none; background: none;
}
.reply-like { margin-top: 9px; }
.link-btn {
  border: none; background: none; cursor: pointer; padding: 4px 8px; border-radius: 7px;
  font-size: 12.5px; color: var(--text-muted); transition: all .15s;
}
.link-btn:hover { background: var(--hover-row); color: var(--text); }
.link-btn.liked { color: var(--primary); background: var(--primary-soft); font-weight: 600; }

@media (max-width: 720px) {
  .editor-area { min-height: 140px; }
  .board-grid { grid-template-columns: 1fr; }
  .td-title { font-size: 18px; }
  .rich-content { padding: 15px; }
}

/* ---------- 回复可见 ---------- */
.rich-content .hide-open {
  margin: 12px 0; padding: 12px 16px; border-radius: 10px;
  border: 1px dashed var(--primary); background: var(--primary-soft);
}
.rich-content .hide-open > *:first-child { margin-top: 0; }
.rich-content .hide-open > *:last-child { margin-bottom: 0; }
.rich-content .hide-locked {
  margin: 12px 0; padding: 14px 16px; border-radius: 10px; text-align: center;
  border: 1px dashed var(--border-strong); background: var(--panel-2);
  color: var(--text-muted); font-size: 13px;
}
.rich-content .hide-locked a { color: var(--primary); text-decoration: none; font-weight: 600; }
.hide-flag {
  display: inline-block; margin-left: 6px; padding: 0 6px; border-radius: 5px;
  background: var(--primary-soft); color: var(--primary);
  font-size: 11px; font-weight: 600;
}

/* ================================================================
   个人中心
   ================================================================ */
.profile-hero {
  display: flex; align-items: center; gap: 20px; flex-wrap: wrap;
  padding: 22px 24px; background: linear-gradient(160deg, var(--panel) 0%, var(--panel-2) 100%);
  border: 1px solid var(--border); border-radius: var(--radius); box-shadow: var(--shadow);
}
.profile-avatar-wrap { display: flex; flex-direction: column; align-items: center; gap: 8px; }
.profile-avatar {
  width: 84px; height: 84px; border-radius: 50%; object-fit: cover;
  border: 3px solid var(--panel); box-shadow: var(--shadow);
}
.profile-avatar-ph {
  width: 84px; height: 84px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 38px; background: var(--input-bg); color: var(--text-muted);
  border: 3px solid var(--panel); box-shadow: var(--shadow);
}
.profile-avatar-btn { font-size: 11.5px; padding: 3px 10px; height: auto; }
.profile-info { flex: 1; min-width: 200px; }
.profile-name { font-size: 21px; font-weight: 700; margin-bottom: 5px; }
.profile-sub {
  display: flex; align-items: center; gap: 9px; flex-wrap: wrap;
  font-size: 13px; color: var(--text-muted); margin-bottom: 8px;
}
.profile-bio { font-size: 13px; color: var(--text-sub); line-height: 1.6; margin-bottom: 10px; }
.profile-stats { display: flex; gap: 16px; flex-wrap: wrap; font-size: 12.5px; color: var(--text-muted); }
.profile-stats b { color: var(--text); font-size: 14px; font-weight: 700; }
.pf-next { color: var(--primary); }

.profile-tabs { margin-top: 20px; }
#view-profile .tab { font-size: 14px; }

.pf-list { display: flex; flex-direction: column; gap: 10px; }
.pf-item {
  padding: 14px 16px; background: var(--panel); border: 1px solid var(--border);
  border-radius: 13px; cursor: pointer; transition: all .18s var(--ease-ios);
}
.pf-item:hover { border-color: var(--primary); transform: translateX(3px); box-shadow: 0 4px 16px rgba(0,0,0,.06); }
.pf-item-title { font-size: 14.5px; font-weight: 600; margin-bottom: 6px; }
.pf-reply-title { font-weight: 500; color: var(--text-sub); }
.pf-item-content {
  font-size: 12.5px; color: var(--text-muted); line-height: 1.6; margin-bottom: 6px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.pf-item-meta {
  display: flex; gap: 14px; flex-wrap: wrap; font-size: 12px; color: var(--text-muted);
}

@media (max-width: 720px) {
  .profile-hero { padding: 18px 16px; gap: 14px; }
  .profile-avatar, .profile-avatar-ph { width: 68px; height: 68px; font-size: 30px; }
  .profile-name { font-size: 18px; }
  #pf-edit { width: 100%; }
}
