/* =========================================================
   星环设计 - 帖子详情页样式（post-detail.css）
   布局：帖子全文 -> 操作条（点赞/收藏/投积分）-> 横线 ->
         评论输入（文字 + 选文件）-> 横线 -> 评论列表（评论可点赞）
   ========================================================= */

.detail-wrap {
  max-width: 760px;
  margin: 0 auto;
  padding: 18px 16px 60px;
}

.back-link {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  color: var(--text-2);
  text-decoration: none;
  margin-bottom: 12px;
}
.back-link:hover { color: var(--primary); }

.detail-card { padding: 20px; }

/* ---------- 帖子头 ---------- */
.detail-card .post-head {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin-bottom: 14px;
}
.detail-card .post-author {
  display: flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
  font-weight: 600;
}
.detail-card .post-author a { color: var(--text-1); text-decoration: none; }
.detail-card .post-author a:hover { color: var(--primary); }

/* ---------- 正文与图片 ---------- */
.detail-content {
  font-size: 15px;
  line-height: 1.75;
  color: var(--text-1);
  white-space: pre-wrap;
  word-break: break-word;
}
.detail-card .post-images { margin-top: 12px; }

/* ---------- 操作条（点赞 / 收藏 / 投积分） ---------- */
.detail-actions {
  display: flex;
  gap: 10px;
  flex-wrap: wrap;
  margin-top: 16px;
}
.detail-actions .action-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 14px;
  padding: 7px 16px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-2);
  cursor: pointer;
  transition: all 0.2s;
}
.detail-actions .action-btn:hover { background: var(--bg-hover); }
.detail-actions .like-btn.liked { color: #ef4444; border-color: rgba(239, 68, 68, 0.4); font-weight: 600; }
.detail-actions .fav-btn.faved { color: #f59e0b; border-color: rgba(245, 158, 11, 0.4); font-weight: 600; }
.detail-actions .tip-btn { color: #d97706; }
.detail-actions .tip-btn:hover { background: rgba(217, 119, 6, 0.1); }

/* ---------- 横线分隔 ---------- */
.divider {
  height: 1px;
  background: var(--border);
  margin: 18px 0;
}

/* ---------- 评论输入区 ---------- */
/* 访客（未登录）：输入区换成登录引导 */
.guest-comment-box { text-align: center; }
.guest-tip-text {
  font-size: 13px;
  color: var(--text-2);
  margin: 0 0 10px;
}
.comment-box .comment-input {
  width: 100%;
  min-height: 74px;
  resize: vertical;
  font-size: 14px;
  line-height: 1.6;
  padding: 10px 12px;
  border-radius: 10px;
  box-sizing: border-box;
}
.comment-tools {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 8px;
  flex-wrap: wrap;
}
.pick-file-btn {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 13px;
  padding: 6px 14px;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  color: var(--text-2);
  cursor: pointer;
}
.pick-file-btn:hover { color: var(--primary); border-color: var(--primary); }
.img-count { font-size: 12px; color: var(--text-2); }
.comment-tools .btn { margin-left: auto; }
.comment-preview {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
}
.comment-preview .thumb {
  position: relative;
  width: 72px;
  height: 72px;
  border-radius: 8px;
  overflow: hidden;
  border: 1px solid var(--border);
}
.comment-preview .thumb img { width: 100%; height: 100%; object-fit: cover; }
.comment-preview .thumb .remove {
  position: absolute;
  top: 2px;
  right: 2px;
  width: 18px;
  height: 18px;
  border: none;
  border-radius: 50%;
  background: rgba(0, 0, 0, 0.55);
  color: #fff;
  font-size: 12px;
  line-height: 1;
  cursor: pointer;
}

/* ---------- 评论列表 ---------- */
.comment-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
  color: var(--text-1);
}
.comment-item {
  padding: 12px 0;
  border-bottom: 1px dashed var(--border);
}
.comment-item:last-child { border-bottom: none; }
.ci-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 13px;
  margin-bottom: 5px;
}
.ci-head a { color: var(--text-1); font-weight: 600; text-decoration: none; }
.ci-head a:hover { color: var(--primary); }
.ci-time { color: var(--text-2); font-size: 12px; }
/* 楼层号 */
.ci-floor {
  color: var(--text-2);
  font-size: 12px;
  font-weight: 600;
  font-variant-numeric: tabular-nums;
  flex-shrink: 0;
}
/* 引用块：回复某条评论时展示被引用者与摘要 */
.ci-quote {
  display: block;
  margin: 2px 0 8px;
  padding: 7px 11px;
  border-left: 3px solid var(--primary);
  border-radius: 0 6px 6px 0;
  background: var(--bg-hover);
  color: var(--text-2);
  font-size: 13px;
  line-height: 1.55;
  word-break: break-word;
}
.ci-quote i { opacity: 0.5; margin-right: 4px; font-size: 11px; }
.ci-quote b { color: var(--primary); font-weight: 600; }
.ci-quote.gone { border-left-color: var(--border); font-style: italic; opacity: 0.7; }

/* 回复按钮 */
.c-reply {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  opacity: 0.75;
}
.c-reply:hover { opacity: 1; color: var(--primary); }

/* 输入框上方的「回复 @某人」提示条 */
.reply-to-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
  padding: 6px 10px;
  border-radius: 8px;
  background: var(--bg-hover);
  border-left: 3px solid var(--primary);
  font-size: 13px;
  color: var(--text-2);
}
.reply-to-bar b { color: var(--primary); }
.rt-cancel {
  border: none;
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  padding: 2px 4px;
  font-size: 13px;
  line-height: 1;
}
.rt-cancel:hover { color: var(--danger, #ef4444); }
.ci-content {
  font-size: 14px;
  line-height: 1.65;
  color: var(--text-1);
  white-space: pre-wrap;
  word-break: break-word;
}
.ci-images {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.ci-images img {
  width: 96px;
  height: 96px;
  object-fit: cover;
  border-radius: 8px;
  border: 1px solid var(--border);
  cursor: zoom-in;
}
.ci-foot {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-top: 7px;
}
.c-like {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 13px;
  cursor: pointer;
  padding: 0;
}
.c-like:hover { color: var(--primary); }
.c-like.liked { color: var(--primary); font-weight: 600; }
.c-del, .c-report {
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: 12px;
  cursor: pointer;
  padding: 0;
  opacity: 0.7;
}
.c-del:hover { opacity: 1; color: var(--danger, #ef4444); }
.c-report:hover { opacity: 1; color: var(--danger, #ef4444); }
.loading-tip { color: var(--text-2); font-size: 14px; }

@media (max-width: 640px) {
  .detail-card { padding: 14px; }
  .detail-actions .action-btn { flex: 1; justify-content: center; }
  .comment-tools .btn { margin-left: 0; width: 100%; }
}

/* 浏览量：静态展示，不可点 */
.detail-actions .view-static { color: var(--text-2); cursor: default; }
.detail-actions .view-static:hover { background: transparent; }

/* 评论分页：评论多时先渲染一屏，点这个按钮追加下一批 */
.cm-more {
  display: block;
  width: 100%;
  margin-top: 14px;
  border: 1px dashed var(--border);
  color: var(--primary);
}
.cm-more:hover { border-color: var(--primary); }
