/* SocialX × Typecho — 原生评论/表单/适配层 */

/* ---------- 评论区（Heo 风） ---------- */
.sx-comments-head { margin-bottom: 2px; }
.sx-comments-count { margin-left: 6px; font-size: 12px; color: var(--sx-sub); }
.sx-cm-empty { padding: 28px 0; }

.sx-cm-list { list-style: none; margin: 0; padding: 0; }
.sx-cm-item { list-style: none; }
.sx-cm-body {
  display: flex; gap: 12px;
  padding: 14px 10px; margin: 0 -10px;
  border-top: 1px dashed var(--sx-line);
  border-radius: 12px;
  transition: background .15s;
}
.sx-cm-list > .sx-cm-item:first-child > .sx-cm-body { border-top: none; }
.sx-cm-body:hover { background: color-mix(in srgb, var(--sx-primary) 3%, transparent); }

.sx-cm-avatar {
  flex: 0 0 40px; width: 40px; height: 40px; border-radius: 10px;
  overflow: hidden; background: var(--sx-bg2, #f2eeec);
  display: inline-flex; align-items: center; justify-content: center;
  font-style: normal; font-weight: 700; color: var(--sx-primary);
}
.sx-cm-avatar img { width: 100%; height: 100%; object-fit: cover; display: block; }
.sx-cm-avatar i { font-style: normal; }

.sx-cm-main { flex: 1; min-width: 0; }
.sx-cm-meta { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; }
.sx-cm-name { font-size: 14px; font-weight: 600; color: var(--sx-text); }
.sx-cm-name a { color: inherit; }
.sx-cm-name a:hover { color: var(--sx-primary); }
.sx-cm-badge {
  font-size: 10px; padding: 1px 6px; border-radius: 99px;
  background: var(--sx-primary); color: #fff; font-weight: 500;
}
.sx-cm-badge.sx-cm-wait { background: var(--sx-bg2, #f2eeec); color: var(--sx-sub); }

/* UA 小标签 */
.sx-cm-ua {
  font-size: 10px; line-height: 1; padding: 3px 6px; border-radius: 6px;
  border: 1px solid var(--sx-line); color: var(--sx-sub);
  white-space: nowrap;
}

.sx-cm-time { font-size: 11.5px; color: var(--sx-sub); }
.sx-cm-acts { margin-left: auto; display: inline-flex; gap: 4px; opacity: 0; transition: opacity .15s; }
.sx-cm-body:hover .sx-cm-acts,
.sx-cm-body:focus-within .sx-cm-acts { opacity: 1; }
@media (hover: none) { .sx-cm-acts { opacity: 1; } }
.sx-cm-link, .sx-cm-reply {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; color: var(--sx-sub); text-decoration: none;
  padding: 2px 6px; border-radius: 6px;
}
.sx-cm-link svg, .sx-cm-reply svg { width: 13px; height: 13px; }
.sx-cm-link:hover, .sx-cm-reply:hover { color: var(--sx-primary); background: var(--sx-bg2, #f2eeec); }

/* 引用条 */
.sx-cm-quote {
  display: flex; align-items: center; gap: 6px;
  margin: 8px 0 6px; padding: 7px 12px;
  border-radius: 10px;
  background: var(--sx-bg2, #f7f4f2);
  border-left: 3px solid var(--sx-primary);
  font-size: 12px; color: var(--sx-sub);
  text-decoration: none; overflow: hidden;
  white-space: nowrap; text-overflow: ellipsis;
}
.sx-cm-quote b { color: var(--sx-primary); font-weight: 600; flex-shrink: 0; }
.sx-cm-quote:hover { background: color-mix(in srgb, var(--sx-primary) 10%, transparent); }

.sx-cm-content { font-size: 14px; line-height: 1.8; color: var(--sx-text); word-break: break-word; margin-top: 6px; }
.sx-cm-content p { margin: 0 0 6px; }
.sx-cm-content p:last-child { margin-bottom: 0; }
.sx-cm-content img { max-width: 100%; }
.sx-cm-content a { color: var(--sx-primary); }

/* 子评论：桌面缩进，移动端保持引用条即可 */
.sx-cm-children { padding-left: 52px; }
.sx-cm-children .sx-cm-avatar { flex-basis: 32px; width: 32px; height: 32px; font-size: 12px; border-radius: 8px; }

/* 评论分页 */
.sx-cm-nav { padding: 10px 0; display: flex; gap: 6px; flex-wrap: wrap; }
.sx-cm-nav li { list-style: none; }

/* ---------- 评论表单（整体卡片式） ---------- */
.sx-cmbox {
  margin-top: 16px;
  border: 1px solid var(--sx-line); border-radius: 14px;
  background: var(--sx-card); overflow: hidden;
  transition: border-color .15s, box-shadow .15s;
}
.sx-cmbox:focus-within {
  border-color: var(--sx-primary);
  box-shadow: 0 0 0 3px color-mix(in srgb, var(--sx-primary) 12%, transparent);
}
.sx-cm-fhead { display: flex; align-items: center; gap: 10px; padding: 8px 14px 0; min-height: 0; }
#sx-cm-replyto {
  font-size: 12px; color: var(--sx-primary); font-weight: 600;
  background: color-mix(in srgb, var(--sx-primary) 8%, transparent);
  padding: 2px 8px; border-radius: 6px;
}
.sx-cm-cancelwrap a { font-size: 12px; color: var(--sx-sub); }
.sx-cm-cancelwrap a:hover { color: var(--sx-primary); }

.sx-cm-fields { display: flex; border-bottom: 1px solid var(--sx-line); }
.sx-cm-fields input {
  flex: 1; min-width: 0;
  padding: 10px 14px; font-size: 13px;
  border: none; border-radius: 0;
  background: transparent; color: var(--sx-text);
  outline: none; transition: background .15s;
}
.sx-cm-fields input + input { border-left: 1px solid var(--sx-line); }
.sx-cm-fields input:focus { background: color-mix(in srgb, var(--sx-primary) 5%, transparent); }

.sx-cm-in {
  width: 100%; box-sizing: border-box;
  padding: 12px 14px; font-size: 14px; line-height: 1.7;
  border: none; border-radius: 0;
  background: transparent; color: var(--sx-text);
  resize: vertical; min-height: 90px; outline: none;
}

.sx-cm-foot { display: flex; align-items: center; justify-content: flex-end; gap: 12px; padding: 8px 10px; }
.sx-cm-loginhint { margin-right: auto; font-size: 12px; color: var(--sx-sub); padding-left: 4px; }
.sx-cm-loginhint a { color: var(--sx-primary); }
.sx-cm-submit { display: inline-flex; align-items: center; gap: 6px; border-radius: 10px; padding: 7px 18px; flex: 0 0 auto; width: auto; }
.sx-cm-submit svg { width: 15px; height: 15px; }

/* ---------- 搜索表单 ---------- */
.sx-search { position: relative; display: flex; align-items: center; }
.sx-search input {
  width: 170px; padding: 8px 12px 8px 32px;
  font-size: 13px; border: 1px solid var(--sx-line); border-radius: 99px;
  background: var(--sx-bg2, #f7f4f2); color: var(--sx-text); outline: none;
  transition: width .2s, border-color .15s;
}
.sx-search input:focus { width: 220px; border-color: var(--sx-primary); }
.sx-search .sx-search-icon { position: absolute; left: 10px; width: 15px; height: 15px; color: var(--sx-sub); pointer-events: none; }

.sx-drawer-search { display: flex; align-items: center; position: relative; margin: 4px 14px 10px; }
.sx-drawer-search input {
  width: 100%; padding: 9px 12px 9px 34px; font-size: 14px;
  border: 1px solid var(--sx-line); border-radius: 10px;
  background: var(--sx-bg2, #f7f4f2); color: var(--sx-text); outline: none;
}
.sx-drawer-search .sx-search-icon { position: absolute; left: 11px; width: 15px; height: 15px; color: var(--sx-sub); }

/* ---------- 头像文字兜底（抽屉） ---------- */
.sx-drawer-avatar-txt { display: inline-flex; align-items: center; justify-content: center; font-weight: 700; color: #fff; background: var(--sx-primary); }
.sx-profile-handle { font-size: 12px; color: var(--sx-sub); }

/* ---------- 最新评论 ---------- */
.sx-rc-row { display: flex; gap: 10px; padding: 8px 0; text-decoration: none; border-top: 1px solid var(--sx-line); }
.sx-rc-row:first-child { border-top: none; }
.sx-rc-ava { flex: 0 0 28px; width: 28px; height: 28px; border-radius: 50%; overflow: hidden; background: var(--sx-bg2, #f2eeec); display: inline-flex; align-items: center; justify-content: center; font-size: 11px; font-weight: 700; color: var(--sx-primary); }
.sx-rc-ava img { width: 100%; height: 100%; object-fit: cover; }
.sx-rc-ava i { font-style: normal; }
.sx-rc-body { flex: 1; min-width: 0; display: flex; flex-direction: column; }
.sx-rc-body b { font-size: 12.5px; color: var(--sx-text); font-weight: 600; }
.sx-rc-body i { font-style: normal; font-size: 12px; color: var(--sx-sub); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.sx-rc-row:hover .sx-rc-body i { color: var(--sx-primary); }

/* 色板样式沿用 style.css 里的 .sx-hue-panel/.sx-hue-grid/.sx-hue-dot */

/* ---------- 灯箱 ---------- */
.sx-lb {
  position: fixed; inset: 0; z-index: 1000;
  background: rgba(0,0,0,.86); display: flex;
  align-items: center; justify-content: center; cursor: zoom-out;
}
.sx-lb img { max-width: 92vw; max-height: 92vh; border-radius: 8px; }

/* ---------- 归档行评论数 ---------- */
.sx-arch-cm { margin-left: auto; font-size: 11px; color: var(--sx-sub); }

/* sxRise 入场动画（both 填充）会给 .sx-shell 子树留下 transform → 形成堆叠上下文，
   头像的 z-index 逃不出去，被 banner 的绝对定位图层盖住。给 shell 整体抬层级。 */
.sx-shell { position: relative; z-index: 5; }

/* ---------- 移动端 ---------- */
@media (max-width: 860px) {
  .sx-cm-children { padding-left: 0; }
  .sx-cm-children .sx-cm-body { padding-left: 0; }
  .sx-cm-children .sx-cm-avatar { flex-basis: 30px; width: 30px; height: 30px; }
  .sx-cm-fields { flex-direction: column; }
  .sx-cm-fields input + input { border-left: none; border-top: 1px solid var(--sx-line); }
  .sx-search input { width: 130px; }
  .sx-search input:focus { width: 160px; }
}
