/* ========== Social (Feed + Post Detail) ========== */
/* 基础变量（保持与现有色板一致） */
:root{
  --bg:#f6f8fa;
  --card:#fff;
  --muted:#667085;
  --border:#e5e7eb;
  --brand:#0b5fff;
  --content-w:100%;   /* 统一内容宽度 */
  --gutter:16px;        /* 左右内边距 */
}

/* 页面背景（若全局样式已有，可去掉） */
body{ background:var(--bg); }

/* 统一：新帖表单 / 登录提示 / 列表 / 加载更多 / 详情区域 的对齐与留白 */
#new-post-form,
#signin-tip,
#feed,
#load-more,
#post,
#detail-actions{
  max-width:var(--content-w);
  margin-left:auto;
  margin-right:auto;
  padding-left:var(--gutter);
  padding-right:var(--gutter);
}

/* —— 卡片：Feed 列表 & 详情主卡 —— */
.feed{               /* 列表容器 */
  display:flex;
  flex-direction:column;
  align-items:stretch;
  padding:0;
  margin:0;
}
.feed li,            /* 列表项卡片 */
.post-card{          /* 详情页主卡片 */
  list-style:none;
  width:100%;
  margin:14px 0;
  padding:16px 20px;
  border:1px solid var(--border);
  border-radius:16px;
  background:var(--card);
  box-shadow:0 2px 8px rgba(0,0,0,.05);
  transition:box-shadow .2s, transform .06s;
}
.feed li:hover,
.post-card:hover{
  box-shadow:0 6px 20px rgba(0,0,0,.06);
  transform:translateY(-1px);
}

/* —— 帖子头部（头像、用户名、时间） —— */
.post-head{
  display:flex;
  gap:12px;
  align-items:center;
}
.avatar{
  width:40px; height:40px;
  border-radius:50%;
  object-fit:cover;
  border:1px solid var(--border);
  background:#fff;
}
.meta{ display:flex; flex-direction:column; }
.uname a{
  color:#111; text-decoration:none; font-weight:600;
}
.uname a:hover{ text-decoration:underline; }
.muted{ color:var(--muted); font-size:12px; }

/* —— 正文文本 —— */
.content{
  margin:8px 0 6px;
  white-space:pre-wrap;
  line-height:1.5;
}

/* —— 新帖表单（位于列表顶部时用到） —— */
#new-post-form{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:14px;
  padding:12px;
}
#new-post-form textarea{
  border-radius:10px;
  border:1px solid #d0d7de;
  padding:10px;
  width:100%;
}

/* —— 交互按钮（点赞/转发/回复等） —— */
.btn{
  padding:8px 14px;
  border:1px solid var(--border);
  border-radius:10px;
  background:#fff;
  cursor:pointer;
}
.btn.primary{ background:var(--brand); color:#fff; border-color:var(--brand); }
.btn.ghost{ background:#fff; }
.btn:disabled{ opacity:.5; cursor:not-allowed; }

.actions{
  display:flex;
  gap:8px;
  flex-wrap:wrap;
}
.actions .btn.action{ display:inline-flex; align-items:center; gap:6px; line-height:1; }
.actions .btn .ico{ width:16px; text-align:center; }
.actions .counts{ margin-left:4px; font-size:12px; color:var(--muted); }

/* —— 转发内联编辑框 —— */
.repost-box{
  display:none;
  margin-top:8px;
  border-top:1px dashed var(--border);
  padding-top:8px;
}
.repost-box textarea{ min-height:64px; width:100%; border:1px solid #d0d7de; border-radius:10px; padding:8px; }

/* —— 回复（评论） —— */
.reply-toggle{ margin-top:6px; }

.reply-box{
  display:none;
  margin-top:8px;
  border-top:1px dashed var(--border);
  padding-top:8px;
}
.reply-box .row{
  display:flex;
  gap:8px;
  align-items:flex-start;
}
.reply-box textarea{
  min-height:64px;
  width:100%;
  border:1px solid #d0d7de;
  border-radius:10px;
  padding:8px;
}
.reply-list{
  margin-top:10px;            /* 详情页一致 */
  padding-left:52px;          /* 列表页缩进 */
}
.reply-item{
  position:relative;
  padding:14px 0 14px 10px;
  margin:8px 0;
  border-left:2px solid var(--border);
  border-top:1px solid #eef2f5;  /* 视觉分割 */
  min-height:68px;               /* 默认高度 */
}
.reply-item:first-child{ border-top:0; }
.reply-item .row{ display:flex; gap:12px; align-items:flex-start; }
.reply-item .avatar{ width:28px; height:28px; border-radius:50%; border:1px solid var(--border); object-fit:cover; background:#fff; }
.reply-body{ flex:1; min-height:40px; display:flex; flex-direction:column; justify-content:center; }
.reply-content{ margin-top:4px; white-space:pre-wrap; line-height:1.55; }
.reply-item:hover{ background:#fafbfc; }

/* —— 顶部登录提示卡（仅用于与帖子对齐，不含视觉定制） —— */
.signin-tip{ margin:12px 0; }
.signin-tip .tip-card{
  background:var(--card);
  border:1px solid var(--border);
  border-radius:16px;
  padding:18px 20px;
  box-shadow:0 2px 8px rgba(0,0,0,.05);
}

/* —— 响应式：小屏全宽，大屏受 max-width 限制 —— */
@media (max-width:840px){
  :root{ --content-w:calc(100vw - 32px); } /* 两侧各 16px 视觉留白 */
}

/* 底部 Toast */
#toast {
    position: fixed;
    bottom: 24px;        /* 底部浮动 */
    left: 50%;
    transform: translateX(-50%) translateY(20px);
    z-index: 9999;

    min-width: 240px;
    max-width: 360px;

    padding: 12px 18px;
    border-radius: 10px;

    font-size: 14px;
    font-weight: 500;
    color: #2f3542;

    background: rgba(240, 240, 240, 0.9); /* 低饱和度灰白 */
    border: 1px solid rgba(0,0,0,0.08);

    opacity: 0;
    pointer-events: none;

    transition: opacity .25s ease, transform .25s ease;
}

/* 显示动画 */
#toast.show {
    opacity: 1;
    transform: translateX(-50%) translateY(0);
}

/* 类型颜色（柔和） */
#toast.success { border-color: #a3d9a5; }
#toast.error   { border-color: #e5a3a3; }
#toast.info    { border-color: #a3c7e5; }
#toast.warn    { border-color: #e5d7a3; }