/* ============================================================
   社区 / 博客 / 社交 功能样式（服饰易推广站）
   复用 style.css 的 :root 变量（--accent/--ink/--muted/--line/--surface 等），
   深色模式由 [data-theme=dark] 自动驱动，无需额外适配。
   ============================================================ */

/* 两栏布局：主内容 + 侧栏（话题/排行） */
.feed-layout {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: 32px;
  align-items: start;
}
.blog-list-wrap { min-width: 0; }
@media (max-width: 980px) {
  .feed-layout { grid-template-columns: 1fr; }
}

/* 帖子 / 文章卡片 */
.post-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 22px 24px;
  margin-bottom: 18px;
  transition: transform .15s ease, box-shadow .15s ease, border-color .15s ease;
}
.post-card:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow);
  border-color: var(--accent);
}
.post-card .pc-head {
  display: flex;
  align-items: center;
  gap: 12px;
  margin-bottom: 12px;
}
.pc-avatar {
  width: 42px; height: 42px;
  border-radius: 50%;
  background: var(--surface-2);
  object-fit: cover;
  flex: none;
  display: inline-flex; align-items: center; justify-content: center;
  color: var(--accent); font-weight: 700; overflow: hidden;
}
.pc-avatar img { width: 100%; height: 100%; object-fit: cover; }
.pc-author { font-weight: 600; color: var(--ink); font-size: 15px; }
.pc-sub { font-size: 13px; color: var(--muted); }
.pc-title {
  font-size: 19px; font-weight: 700; color: var(--ink);
  margin: 0 0 8px; line-height: 1.4;
}
.pc-title a { color: inherit; text-decoration: none; }
.pc-title a:hover { color: var(--accent); }
.pc-summary { color: var(--muted); font-size: 14px; line-height: 1.7; margin: 0 0 12px; }
.pc-body-preview {
  color: var(--ink); font-size: 14px; line-height: 1.75;
  max-height: 168px; overflow: hidden; position: relative;
  white-space: pre-wrap; word-break: break-word;
}
.pc-body-preview::after {
  content: ""; position: absolute; left: 0; right: 0; bottom: 0; height: 42px;
  background: linear-gradient(transparent, var(--surface));
}
.pc-cover {
  width: 100%; max-height: 280px; object-fit: cover; border-radius: 14px;
  margin-bottom: 14px; background: var(--surface-2);
}

/* 标签 / 话题 */
.tag-pill {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12px; padding: 3px 11px; border-radius: 999px;
  background: var(--surface-2); color: var(--accent);
  border: 1px solid var(--line); text-decoration: none;
}
.tag-pill:hover { border-color: var(--accent); }
.tag-pill .i { width: 13px; height: 13px; }

/* 互动条（赞/藏/评论/阅读） */
.pc-foot {
  display: flex; align-items: center; gap: 18px;
  margin-top: 14px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 13px; color: var(--muted); flex-wrap: wrap;
}
.act-btn {
  display: inline-flex; align-items: center; gap: 6px;
  background: none; border: none; cursor: pointer; color: var(--muted);
  font-size: 13px; padding: 4px 6px; border-radius: 8px; transition: color .15s, background .15s;
}
.act-btn .i { width: 16px; height: 16px; }
.act-btn:hover { color: var(--accent); background: var(--surface-2); }
.act-btn.active { color: var(--accent); }
.act-btn.liked.active { color: #ef4444; }
.act-btn.faved.active { color: #f59e0b; }

/* 侧栏卡片 */
.side-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 20px;
  margin-bottom: 20px;
}
.side-card h3 {
  font-size: 16px; margin: 0 0 14px; color: var(--ink);
  display: flex; align-items: center; gap: 8px;
}
.side-card h3 .i { width: 18px; height: 18px; color: var(--accent); }
.topic-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px dashed var(--line);
  text-decoration: none; color: var(--ink);
}
.topic-item:last-child { border-bottom: none; }
.topic-item:hover .ti-name { color: var(--accent); }
.ti-name { font-weight: 600; font-size: 14px; }
.ti-count { font-size: 12px; color: var(--muted); }
.side-hint { font-size: 13px; color: var(--muted); line-height: 1.7; }

/* 发帖 / 写文章 入口按钮 */
.composer-trigger {
  display: flex; align-items: center; gap: 12px;
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 16px; padding: 16px 20px; margin-bottom: 20px; cursor: pointer;
  color: var(--muted);
}
.composer-trigger:hover { border-color: var(--accent); color: var(--accent); }
.composer-trigger .pc-avatar { width: 38px; height: 38px; }

/* 表单 */
.form-card {
  background: var(--surface); border: 1px solid var(--line);
  border-radius: 20px; padding: 28px; margin-bottom: 20px;
}
.field { margin-bottom: 18px; }
.field label { display: block; font-weight: 600; font-size: 14px; margin-bottom: 8px; color: var(--ink); }
.field input[type=text], .field textarea, .field select {
  width: 100%; padding: 11px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg); color: var(--ink);
  font-size: 15px; font-family: inherit;
}
.field textarea { min-height: 200px; resize: vertical; line-height: 1.7; }
.field .hint { font-size: 12px; color: var(--muted); margin-top: 6px; }
.form-actions { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.alert {
  padding: 12px 16px; border-radius: 12px; margin-bottom: 16px; font-size: 14px;
}
.alert-ok { background: rgba(45,212,191,.12); color: var(--accent-600); border: 1px solid var(--accent); }
.alert-err { background: rgba(239,68,68,.1); color: #ef4444; border: 1px solid rgba(239,68,68,.3); }
.alert-info { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* 详情页 */
.detail-wrap { max-width: 1280px; margin: 0 auto; }
.detail-title { font-size: 30px; font-weight: 800; line-height: 1.35; margin: 8px 0 16px; color: var(--ink); }
.detail-meta {
  display: flex; align-items: center; gap: 14px; flex-wrap: wrap;
  font-size: 13px; color: var(--muted); margin-bottom: 24px;
  padding-bottom: 18px; border-bottom: 1px solid var(--line);
}
.detail-cover { width: 100%; border-radius: 16px; margin-bottom: 24px; }
.markdown { font-size: 16px; line-height: 1.9; color: var(--ink); }
.markdown h1,.markdown h2,.markdown h3 { line-height: 1.4; margin: 1.4em 0 .6em; }
.markdown h2 { font-size: 22px; }
.markdown h3 { font-size: 19px; }
.markdown p { margin: 0 0 1em; }
.markdown img { max-width: 100%; border-radius: 12px; }
.markdown pre {
  background: var(--surface-2); padding: 14px 16px; border-radius: 12px;
  overflow: auto; font-size: 13px; border: 1px solid var(--line);
}
.markdown code { background: var(--surface-2); padding: 2px 6px; border-radius: 6px; font-size: 13px; }
.markdown pre code { background: none; padding: 0; }
.markdown blockquote {
  border-left: 3px solid var(--accent); padding: 4px 16px; color: var(--muted);
  margin: 0 0 1em; background: var(--surface-2); border-radius: 0 10px 10px 0;
}
.markdown table { border-collapse: collapse; width: 100%; margin: 0 0 1em; }
.markdown th,.markdown td { border: 1px solid var(--line); padding: 8px 12px; text-align: left; }
.markdown a { color: var(--accent); }
.detail-interactions {
  display: flex; gap: 16px; align-items: center; margin: 28px 0;
  padding: 18px 0; border-top: 1px solid var(--line); border-bottom: 1px solid var(--line);
}
.detail-interactions .act-btn { font-size: 15px; }

/* 评论区 */
.comments { margin-top: 30px; }
.comments h3 { font-size: 20px; margin: 0 0 18px; }
.comment-form { margin-bottom: 24px; }
.comment-form textarea {
  width: 100%; min-height: 90px; padding: 12px 14px; border: 1px solid var(--line);
  border-radius: 12px; background: var(--bg); color: var(--ink); font-family: inherit; resize: vertical;
}
.comment-item {
  display: flex; gap: 12px; padding: 14px 0; border-bottom: 1px solid var(--line);
}
.comment-item .pc-avatar { width: 36px; height: 36px; }
.comment-nick { font-weight: 600; font-size: 14px; color: var(--ink); }
.comment-time { font-size: 12px; color: var(--muted); margin-left: 8px; }
.comment-text { font-size: 14px; color: var(--ink); line-height: 1.7; margin-top: 4px; white-space: pre-wrap; }
.comment-pending { font-size: 12px; color: #f59e0b; margin-top: 4px; }

/* 公开个人主页 */
.profile-head {
  display: flex; gap: 28px; align-items: center; flex-wrap: wrap;
  background: var(--surface); border: 1px solid var(--line); border-radius: 22px;
  padding: 30px; margin-bottom: 24px;
}
.profile-head .ph-avatar {
  width: 96px; height: 96px; border-radius: 50%; flex: none;
  background: var(--surface-2); display: flex; align-items: center; justify-content: center;
  color: var(--accent); font-size: 38px; font-weight: 700; overflow: hidden;
}
.profile-head .ph-avatar img { width: 100%; height: 100%; object-fit: cover; }
.profile-head .ph-meta { flex: 1; min-width: 220px; }
.profile-head .ph-name { font-size: 26px; font-weight: 800; color: var(--ink); }
.profile-head .ph-bio { color: var(--muted); margin-top: 8px; line-height: 1.7; }
.profile-head .ph-actions { display: flex; gap: 12px; align-items: center; }
.ph-stats { display: flex; gap: 28px; margin-top: 14px; }
.ph-stats .st { text-align: center; }
.ph-stats .st-n { font-size: 22px; font-weight: 800; color: var(--ink); }
.ph-stats .st-l { font-size: 13px; color: var(--muted); }

.btn-follow {
  background: var(--accent); color: var(--accent-ink); border: none;
  padding: 10px 26px; border-radius: 999px; font-weight: 700; cursor: pointer;
  font-size: 15px; transition: background .15s;
}
.btn-follow:hover { background: var(--accent-600); }
.btn-follow.following { background: var(--surface-2); color: var(--muted); border: 1px solid var(--line); }

/* 选项卡 */
.tabs { display: flex; gap: 8px; margin-bottom: 22px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.tab {
  padding: 10px 18px; cursor: pointer; color: var(--muted); font-weight: 600;
  border-bottom: 2px solid transparent; margin-bottom: -1px; font-size: 15px;
}
.tab.active { color: var(--accent); border-bottom-color: var(--accent); }
.tab-panel { display: none; }
.tab-panel.active { display: block; }
.empty-state {
  text-align: center; color: var(--muted); padding: 56px 20px;
  border: 1px dashed var(--line); border-radius: 18px; background: var(--surface);
}

/* 通知中心 */
.notif-item {
  display: flex; gap: 14px; align-items: flex-start;
  background: var(--surface); border: 1px solid var(--line); border-radius: 16px;
  padding: 16px 20px; margin-bottom: 12px;
}
.notif-item.unread { border-color: var(--accent); background: rgba(45,212,191,.06); }
.notif-item .pc-avatar { width: 40px; height: 40px; }
.notif-text { flex: 1; font-size: 14px; line-height: 1.7; color: var(--ink); }
.notif-text a { color: var(--accent); text-decoration: none; }
.notif-time { font-size: 12px; color: var(--muted); margin-top: 4px; }
.unread-dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); flex: none; margin-top: 7px; }

/* 私信 */
.msg-layout { display: grid; grid-template-columns: 320px 1fr; gap: 0; min-height: 560px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 20px; overflow: hidden; }
@media (max-width: 820px) { .msg-layout { grid-template-columns: 1fr; } }
.msg-list { border-right: 1px solid var(--line); max-height: 640px; overflow: auto; }
.msg-list-head { padding: 16px 18px; border-bottom: 1px solid var(--line); font-weight: 700; color: var(--ink); }
.conv-item {
  display: flex; gap: 12px; align-items: center; padding: 14px 18px;
  cursor: pointer; border-bottom: 1px solid var(--line); transition: background .15s;
}
.conv-item:hover, .conv-item.active { background: var(--surface-2); }
.conv-item .pc-avatar { width: 44px; height: 44px; }
.conv-name { font-weight: 600; font-size: 15px; color: var(--ink); }
.conv-last { font-size: 13px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 160px; }
.conv-unread { background: var(--accent); color: var(--accent-ink); font-size: 11px;
  min-width: 18px; height: 18px; border-radius: 999px; display: inline-flex;
  align-items: center; justify-content: center; padding: 0 5px; margin-left: auto; }
.msg-thread { display: flex; flex-direction: column; max-height: 640px; }
.msg-thread-head { padding: 16px 20px; border-bottom: 1px solid var(--line); font-weight: 700; color: var(--ink); }
.msg-scroll { flex: 1; overflow: auto; padding: 20px; display: flex; flex-direction: column; gap: 12px; }
.msg-bubble {
  max-width: 72%; padding: 11px 15px; border-radius: 16px; font-size: 14px;
  line-height: 1.6; white-space: pre-wrap; word-break: break-word;
}
.msg-bubble.in { background: var(--surface-2); color: var(--ink); align-self: flex-start; border-bottom-left-radius: 4px; }
.msg-bubble.out { background: var(--accent); color: var(--accent-ink); align-self: flex-end; border-bottom-right-radius: 4px; }
.msg-compose { display: flex; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--line); }
.msg-compose textarea {
  flex: 1; min-height: 44px; max-height: 120px; padding: 11px 14px; resize: none;
  border: 1px solid var(--line); border-radius: 12px; background: var(--bg); color: var(--ink); font-family: inherit;
}
.msg-empty { display: flex; align-items: center; justify-content: center; color: var(--muted); height: 100%; padding: 40px; text-align: center; }

/* 顶部消息红点 */
.nav-badge {
  position: relative;
}
.nav-badge .dot {
  position: absolute; top: -4px; right: -6px; min-width: 16px; height: 16px;
  background: #ef4444; color: #fff; font-size: 10px; border-radius: 999px;
  display: none; align-items: center; justify-content: center; padding: 0 4px;
}
.nav-badge.has .dot { display: inline-flex; }

/* 下拉菜单里的通知/消息红点：内联显示 */
.user-dropdown .nav-badge{position:relative;display:flex;align-items:center;justify-content:space-between}
.user-dropdown .nav-badge .dot{position:static;min-width:14px;height:14px;font-size:10px;background:#ef4444;color:#fff;border-radius:999px;display:none;align-items:center;justify-content:center;padding:0 4px;margin-left:auto}
.user-dropdown .nav-badge.has .dot{display:inline-flex}

/* 杂项 */
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 24px; flex-wrap: wrap; gap: 12px; }
.section-head h2 { font-size: 2em; margin: 0; }
.section-head .lead { color: var(--muted); margin: 6px 0 0; font-size: 15px; }
.back-link { color: var(--muted); text-decoration: none; font-size: 14px; }
.back-link:hover { color: var(--accent); }
.pager { display: flex; gap: 8px; justify-content: center; margin: 28px 0; flex-wrap: wrap; }
.pager a, .pager span {
  padding: 8px 14px; border-radius: 10px; border: 1px solid var(--line);
  color: var(--muted); text-decoration: none; font-size: 14px;
}
.pager a:hover { border-color: var(--accent); color: var(--accent); }
.pager .cur { background: var(--accent); color: var(--accent-ink); border-color: var(--accent); }

/* ============================================================
   博客列表：工具栏（分类筛选 + 视图切换）+ 三种视图
   作用域限定 .post-list[data-view]，不影响社区/社交共用卡片
   ============================================================ */

/* 工具栏：左筛选、右视图切换 */
.list-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 16px; flex-wrap: wrap; margin-bottom: 22px;
}
.list-bar .filter-tabs { margin-bottom: 0; }
.view-switch {
  display: inline-flex; gap: 4px; padding: 4px;
  background: var(--surface); border: 1px solid var(--line); border-radius: 12px;
  flex: none;
}
.vs-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 34px; border: none; background: none; cursor: pointer;
  border-radius: 9px; color: var(--muted); transition: color .15s, background .15s;
}
.vs-btn .i { width: 19px; height: 19px; }
.vs-btn:hover { color: var(--accent); background: var(--surface-2); }
.vs-btn.active { background: var(--accent); color: var(--accent-ink); }

/* 列表视图：左图右文横排（默认竖向堆叠之外的强化） */
.post-list[data-view="list"] .post-card {
  display: flex; gap: 22px; align-items: flex-start;
}
.post-list[data-view="list"] .post-card .pc-cover {
  width: 240px; max-width: 240px; flex: none; margin-bottom: 0; max-height: 160px;
}
.post-list[data-view="list"] .post-card .pc-body { flex: 1; min-width: 0; }

/* 网格视图：默认 2 列，避免侧边栏被挤到底部 */
.post-list[data-view="grid"] {
  display: grid; grid-template-columns: repeat(2, 1fr); gap: 18px;
}
.post-list[data-view="grid"] .post-card { margin-bottom: 0; }

/* 瀑布流视图：CSS columns 多列错落 */
.post-list[data-view="masonry"] {
  column-count: 3; column-gap: 18px;
}
.post-list[data-view="masonry"] .post-card {
  display: inline-block; width: 100%; margin: 0 0 18px; break-inside: avoid;
}

/* 响应式：列数随宽度递减；窄屏列表回归竖向 */
@media (max-width: 1100px) {
  .post-list[data-view="grid"] { grid-template-columns: repeat(2, 1fr); }
  .post-list[data-view="masonry"] { column-count: 2; }
}
@media (max-width: 760px) {
  .post-list[data-view="grid"] { grid-template-columns: 1fr; }
  .post-list[data-view="masonry"] { column-count: 1; }
  .post-list[data-view="list"] .post-card { flex-direction: column; }
  .post-list[data-view="list"] .post-card .pc-cover { width: 100%; max-width: 100%; max-height: 200px; }
}
