/* ============================================================
 * Omnia 评论区 · 样式3（朋友圈 / QQ 空间风格）
 * 作用域：仅作用于根节点 .wx_comment3，不影响样式1/2
 * 依赖：omnia.comment.css（基础卡片/表单/分页），本文件在其后加载
 * 变量：--theme / --background / --main / --routine / --minor
 *      --classA / --classC / --Omnia-mment / --radius-wrap
 *      --radius-inner / --box-shadow（明暗自动切换）
 * 布局：左圆形头像（干净描边，无光晕） + 右列
 *       昵称行（昵称主题色 + 博主/认证徽标 + UA/归属地次要小字）
 *       + 浅灰气泡（短内容贴合宽度，长内容满宽折行）
 *       + 气泡下方 时间/回复（桌面悬停显现，移动常显）
 * ============================================================ */

/* ---------- 隐藏的 JS 还原锚点（.wx_comment_title）：不占任何视觉 ---------- */
.wx_comment3 > .wx_comment_title {
  display: none !important;
  width: 0;
  height: 0;
  margin: 0;
  padding: 0;
  overflow: hidden;
}

/* ---------- 根容器与评论列表 ---------- */
.wx_comment3 {
  padding-top: 4px;
}
.wx_comment3 > .comment-list,
.wx_comment3 ol.comment-list {
  margin: 0;
  padding: 0;
  list-style: none;
}

/* 顶层条目：去掉卡片化，仅用细分隔线 */
.wx_comment3 .comment_list_item.c3-item {
  margin: 0;
  padding: 16px 0 14px;
  background: transparent !important;
  box-shadow: none !important;
  border-radius: 0;
  border-bottom: 1px solid var(--classC);
}
.wx_comment3 > .comment-list > li.c3-item:last-child {
  border-bottom: 0;
}

/* ---------- 单行条目：头像 + 主体 横向结构 ---------- */
.wx_comment3 .c3-term {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 12px;
  margin: 0 !important;
}

/* 头像：圆形、干净 1px 描边 + 极轻阴影，强制清除全局光晕/内边距/右边距 */
.wx_comment3 .c3-avatar {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  line-height: 0;
}
.wx_comment3 .c3-avatar-img {
  width: 40px !important;
  height: 40px !important;
  margin-right: 0 !important;      /* 覆盖全局 .term .avatar 的 margin-right，避免压字 */
  padding: 0 !important;           /* 覆盖全局 padding:2px */
  border-radius: 50% !important;
  border: 1px solid var(--classA) !important;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.08) !important;
  filter: none !important;
  background: var(--Omnia-mment);
  object-fit: cover;
  transition: transform 0.2s ease;
}
.wx_comment3 .c3-avatar:hover .c3-avatar-img {
  transform: scale(1.05);
}

/* 主体列 */
.wx_comment3 .comment_list_item-contain .c3-body {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0 !important;            /* 覆盖全局 .content 的负边距/左外边距 */
  padding: 0 !important;
  border-bottom: 0 !important;
  display: flex;
  flex-direction: column;
}

/* ---------- 昵称行：昵称 + 徽标 + UA/归属地 ---------- */
.wx_comment3 .c3-user {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  column-gap: 8px;
  row-gap: 3px;
  margin: 0 0 7px !important;
  font-size: 13px;
  line-height: 1.4;
}
.wx_comment3 .c3-author {
  font-weight: 600;
  color: var(--theme);
}
.wx_comment3 .c3-author a {
  color: inherit;
  text-decoration: none;
}
.wx_comment3 .c3-author a:hover {
  text-decoration: underline;
}

/* 徽标：博主 / 认证（圆角小胶囊） */
.wx_comment3 .c3-user .autlv {
  display: inline-flex;
  align-items: center;
  height: 18px;
  padding: 0 7px;
  font-size: 11px;
  font-style: normal;
  font-weight: 400;
  line-height: 18px;
  border-radius: 9px;
}
.wx_comment3 .c3-user .autlv-admin {
  color: #fff;
  background: var(--theme);
}
.wx_comment3 .c3-user .autlv-cert {
  color: var(--theme);
  background: color-mix(in srgb, var(--theme) 14%, transparent);
}

/* UA / IP 归属地：次要色小字，弱化 */
.wx_comment3 .c3-agent,
.wx_comment3 .c3-loc {
  font-size: 12px;
  font-weight: 400;
  color: var(--minor);
}
.wx_comment3 .c3-loc::before {
  content: "·";
  margin-right: 6px;
}
.wx_comment3 .waiting {
  font-size: 12px;
  color: #e6a23c;
  font-style: normal;
}

/* ---------- 内容气泡：朋友圈浅灰气泡 ---------- */
.wx_comment3 .comment_list_item-contain .c3-bubble {
  align-self: flex-start;          /* 短内容贴合内容宽度 */
  display: block;
  width: auto !important;          /* 覆盖全局 width:auto 同样声明，保持收缩 */
  max-width: 100% !important;       /* 覆盖全局 max-width:70%，长内容满宽折行 */
  margin: 0;
  padding: 10px 14px;
  border-radius: 4px 14px 14px 14px;
  background: var(--Omnia-mment);
  color: var(--main);
  font-size: 14px;
  line-height: 1.7;
  letter-spacing: 0.01rem;
  word-break: break-word;
  overflow-wrap: anywhere;
}
/* 博主气泡：左侧主题色细边条强调（用 inset 阴影，不扰动内边距） */
.wx_comment3 .c3-item-admin .c3-bubble {
  box-shadow: inset 3px 0 0 var(--theme);
}
.wx_comment3 .c3-bubble p {
  margin: 0;
}
.wx_comment3 .c3-bubble img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
}
.wx_comment3 .c3-bubble code {
  padding: 1px 5px;
  border-radius: 4px;
  background: color-mix(in srgb, var(--main) 12%, transparent);
  font-size: 12.5px;
}
.wx_comment3 .c3-bubble pre {
  margin: 6px 0;
  padding: 8px 10px;
  border-radius: 8px;
  overflow: auto;
  background: color-mix(in srgb, var(--main) 8%, transparent);
}
/* 被回复的父评论引用（_getParentReply 输出的 .parent） */
.wx_comment3 .c3-bubble .parent,
.wx_comment3 .c3-bubble a.parent {
  display: block;
  margin: 0 0 5px;
  font-size: 12.5px;
  font-weight: 400;
  color: var(--minor);
  text-decoration: none;
}

/* ---------- 操作区：时间 + 回复（气泡下方） ---------- */
.wx_comment3 .c3-meta {
  display: flex;
  align-items: center;
  gap: 14px;
  margin: 7px 0 0;
  height: auto;
}
.wx_comment3 .c3-meta .date {
  font-size: 12px;
  font-style: normal;
  color: var(--minor);
}
.wx_comment3 .c3-reply {
  font-size: 12px;
  color: var(--minor);
  cursor: pointer;
  opacity: 0;
  transition: opacity 0.2s ease, color 0.2s ease;
  user-select: none;
}
.wx_comment3 .c3-reply::before {
  content: "↩";
  margin-right: 3px;
}
/* 桌面端：悬停整行时回复显现 */
.wx_comment3 .c3-term:hover .c3-reply,
.wx_comment3 .c3-reply:focus-visible {
  opacity: 1;
  color: var(--theme);
}

/* ---------- 楼中楼：子回复左缩进 + 竖向引导线 ---------- */
.wx_comment3 .c3-children {
  margin: 2px 0 0 52px;
  padding: 2px 0 2px 14px;
  border-left: 2px solid var(--classC);
  list-style: none;
}
.wx_comment3 .c3-children > ol,
.wx_comment3 .c3-children ol.comment-list {
  margin: 0;
  padding: 0;
  list-style: none;
}
.wx_comment3 .c3-children .c3-item {
  margin: 0;
  padding: 12px 0 4px;
  background: transparent !important;
  box-shadow: none !important;
  border-bottom: 0;
}
.wx_comment3 .c3-children .c3-avatar,
.wx_comment3 .c3-children .c3-avatar-img {
  width: 32px !important;
  height: 32px !important;
}
.wx_comment3 .c3-children .c3-bubble {
  padding: 7px 11px;
  font-size: 13.5px;
  border-radius: 4px 12px 12px 12px;
}
/* 二级继续缩进，引导线颜色沿用 --classC */
.wx_comment3 .c3-children .c3-children {
  margin-left: 0;
  padding-left: 12px;
  border-left: 2px solid var(--classC);
}

/* ---------- 回复时被 JS 移动进来的内联表单 ---------- */
.wx_comment3 .comment_list_item-contain .wx_comment_respond {
  margin: 10px 0 4px 52px;
  padding: 12px;
}

/* ---------- 分页：居中胶囊 ---------- */
.wx_comment3 .wx_pagination.c3-pagination {
  display: flex;
  flex-wrap: wrap;
  justify-content: center;
  gap: 6px;
  margin: 20px 0 4px;
  padding: 0;
  list-style: none;
}
.wx_comment3 .wx_pagination.c3-pagination li {
  margin: 0;
}
.wx_comment3 .wx_pagination.c3-pagination a,
.wx_comment3 .wx_pagination.c3-pagination .current,
.wx_comment3 .wx_pagination.c3-pagination li.active span,
.wx_comment3 .wx_pagination.c3-pagination li.active a {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 32px;
  height: 32px;
  padding: 0 10px;
  border-radius: 16px;
  background: var(--background);
  box-shadow: var(--box-shadow);
  color: var(--routine);
  font-size: 13px;
}
.wx_comment3 .wx_pagination.c3-pagination li.active a,
.wx_comment3 .wx_pagination.c3-pagination li.active span {
  color: #fff;
  background: var(--theme);
}

/* ---------- 移动端适配（窄屏 ~390px） ---------- */
@media (max-width: 768px) {
  .wx_comment3 .c3-term {
    gap: 10px;
  }
  .wx_comment3 .c3-avatar,
  .wx_comment3 .c3-avatar-img {
    width: 36px !important;
    height: 36px !important;
  }
  .wx_comment3 .comment_list_item-contain .c3-bubble {
    padding: 9px 12px;          /* 12~14px 内边距 */
    font-size: 14px;            /* 14px 字号 */
    line-height: 1.75;
  }
  /* 移动端回复按钮常显 */
  .wx_comment3 .c3-reply {
    opacity: 1;
  }
  .wx_comment3 .c3-children {
    margin-left: 44px;
    padding-left: 10px;
  }
  .wx_comment3 .comment_list_item-contain .wx_comment_respond {
    margin-left: 44px;
  }
  .wx_comment3 .c3-user {
    column-gap: 6px;
  }
}
