/* =============================================================
   DETAIL — 帖子详情抽屉
   包含：遮罩、抽屉面板、帖子展示区、评论区（两级）
   ============================================================= */

/* ─── 1. 遮罩 ───────────────────────────────────────────────── */

/*
  全屏半透明遮罩，点击关闭抽屉。
  默认 opacity:0 + pointer-events:none，打开时过渡至 opacity:1。
*/
.detail-overlay {
  position: fixed;
  inset: 0;
  background: rgba(15, 20, 25, 0.4);
  z-index: 100;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.3s ease;
}

.detail-overlay.is-open {
  opacity: 1;
  pointer-events: auto;
}

/* ─── 2. 抽屉面板 ───────────────────────────────────────────── */

/*
  从右侧滑入，默认宽度 760px，最大撑满 100vw（小屏适配）。
  width 由 JS 拖拽时通过 inline style 动态覆盖，CSS 值为初始值。
  transition 仅作用于 transform（滑入/滑出），不干扰拖拽时的 width 变化。
*/
.detail-drawer {
  position: fixed;
  top: 0;
  right: 0;
  bottom: 0;
  width: 760px;
  max-width: 100vw;
  background: rgba(245, 247, 250, 1);
  z-index: 101;
  display: flex;
  flex-direction: column;
  transform: translateX(100%);
  transition: transform 0.35s cubic-bezier(0.4, 0, 0.2, 1);
  box-shadow: -8px 0 32px 0 rgba(15, 20, 25, 0.1);
}

.detail-drawer.is-open {
  transform: translateX(0);
}

/*
  拖拽手柄：贴在抽屉左边缘，8px 宽可点击区域，中间 2px 视觉线。
  鼠标悬停时显示左右拖拽光标，提示用户可调节宽度。
*/
.detail-drawer-resizer {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  width: 8px;
  cursor: ew-resize;
  z-index: 1;
  /* 用伪元素承载 2px 视觉线，避免撑宽实际布局 */
}

.detail-drawer-resizer::after {
  content: '';
  position: absolute;
  top: 0;
  left: 3px; /* 居中于 8px 手柄内 */
  bottom: 0;
  width: 2px;
  background: rgba(15, 20, 25, 0.08);
  transition: background 0.15s ease;
}

.detail-drawer-resizer:hover::after,
.detail-drawer-resizer.is-dragging::after {
  background: rgba(22, 185, 152, 0.6); /* 悬停/拖拽中变绿色 */
}

/* ─── 3. 抽屉头部 ───────────────────────────────────────────── */

.detail-drawer-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 24px;
  height: 56px;
  background: rgba(255, 255, 255, 0.88);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  border-bottom: 1px solid rgba(15, 20, 25, 0.06);
  flex-shrink: 0;
}

.detail-drawer-title {
  font-size: 16px;
  font-family: PingFangSC-Semibold, "PingFang SC", sans-serif;
  font-weight: 600;
  color: rgba(15, 20, 25, 1);
}

.detail-drawer-close {
  border: 0;
  background: transparent;
  padding: 4px;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 6px;
  transition: background 0.15s ease;
}

.detail-drawer-close:hover {
  background: rgba(15, 20, 25, 0.06);
}

/* ─── 4. 抽屉滚动内容区 ─────────────────────────────────────── */

.detail-drawer-body {
  flex: 1;
  overflow-y: auto;
  overscroll-behavior: contain;
  padding: 16px 16px 40px;
  display: flex;
  flex-direction: column;
  gap: 16px;
}

/* ─── 5. 帖子主体展示 ───────────────────────────────────────── */

/*
  从 feed-card 克隆过来的帖子，套一层 detail-post 包裹，
  重置部分与抽屉上下文冲突的样式（如 hover 状态不需要在详情内触发）。
*/
.detail-post .feed-card {
  border-radius: 20px;
  margin: 0;
}

/* 详情内帖子卡片：移除原 feed-card 的 cursor 等交互样式 */
.detail-post .feed-detail-link {
  display: none; /* 详情页内不需要「查看详情」按钮自身 */
}

/* ─── 6. 评论区 ─────────────────────────────────────────────── */

.detail-comments {
  background: rgba(255, 255, 255, 1);
  border-radius: 20px;
  border: 1px solid rgba(15, 20, 25, 0.06);
  padding: 20px;
}

.detail-comments[hidden] {
  display: none;
}

/* 评论区标题：「评论 N」 */
.detail-comments-title {
  margin: 0 0 16px;
  font-size: 15px;
  font-family: PingFangSC-Semibold, "PingFang SC", sans-serif;
  font-weight: 600;
  color: rgba(15, 20, 25, 1);
  line-height: 1;
}

.detail-comments-title span {
  color: rgba(153, 153, 153, 1);
  font-weight: 400;
  font-family: PingFangSC-Regular, "PingFang SC", sans-serif;
}

/* ─── 7. 评论列表 ───────────────────────────────────────────── */

.comment-list {
  display: flex;
  flex-direction: column;
}

/* 根评论容器：含评论主体 + 子评论区 */
.comment-root {
  padding: 16px 0;
  border-bottom: 1px solid rgba(15, 20, 25, 0.05);
}

.comment-root:last-child {
  border-bottom: none;
  padding-bottom: 0;
}

/* 评论行：头像 + 内容区 */
.comment-item {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}

/* 子评论：整体左缩进（头像宽 32px + gap 12px = 44px） */
.comment-item--sub {
  gap: 8px;
}

/* 评论头像：根评论 32px，子评论 26px（由 HTML width 属性控制） */
.comment-avatar {
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}

/* 评论内容区 */
.comment-content {
  flex: 1;
  min-width: 0;
}

/* 用户名 + 时间一行 */
.comment-meta {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 4px;
}

.comment-name {
  font-size: 13px;
  font-family: PingFangSC-Medium, "PingFang SC", sans-serif;
  font-weight: 500;
  color: rgba(15, 20, 25, 1);
}

.comment-time {
  font-size: 12px;
  font-family: PingFangSC-Regular, "PingFang SC", sans-serif;
  color: rgba(153, 153, 153, 1);
}

/* 评论正文 */
.comment-text {
  margin: 0 0 8px;
  font-size: 14px;
  font-family: PingFangSC-Regular, "PingFang SC", sans-serif;
  color: rgba(51, 51, 51, 1);
  line-height: 22px;
}

/* @被回复人：绿色高亮 */
.comment-at {
  color: rgba(22, 185, 152, 1);
  margin-right: 4px;
}

/* 评论操作栏：点赞 + 回复 */
.comment-actions {
  display: flex;
  align-items: center;
  gap: 16px;
}

.comment-like-btn {
  border: 0;
  background: transparent;
  padding: 0;
  display: inline-flex;
  align-items: center;
  gap: 4px;
  cursor: pointer;
  color: rgba(153, 153, 153, 1);
  font-size: 12px;
  font-family: PingFangSC-Regular, "PingFang SC", sans-serif;
  transition: color 0.15s ease;
}

.comment-like-btn:hover {
  color: rgba(246, 147, 62, 1);
}

.comment-reply-btn {
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  color: rgba(153, 153, 153, 1);
  font-size: 12px;
  font-family: PingFangSC-Regular, "PingFang SC", sans-serif;
  transition: color 0.15s ease;
}

.comment-reply-btn:hover {
  color: rgba(22, 185, 152, 1);
}

/* ─── 8. 子评论区 ───────────────────────────────────────────── */

/*
  子评论区：左侧 border 作为视觉分组线，与根评论头像中心对齐。
  margin-left = 根评论头像宽(32px) + gap(12px) = 44px
*/
.comment-replies {
  margin-left: 44px;
  margin-top: 12px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  padding-left: 12px;
  border-left: 2px solid rgba(15, 20, 25, 0.06);
}
