/* ============ 隐藏状态标记 ============ */
.bp-comments-state {
    display: none !important;
}

/* ============================================================
   ★ 垂直居中修复：让按钮以 flex 布局包裹 SVG
   —— 只加 display/align-items/vertical-align，不覆盖主题的
      padding / margin / border / background / box-shadow
   ============================================================ */
.activity-meta .bp-comments-toggle,
.activity-meta .generic-button .bp-comments-toggle,
#buddypress .activity-meta .bp-comments-toggle {
    display: inline-flex;
    align-items: center;
    justify-content: center;
    vertical-align: middle;
    line-height: 1;
    position: relative;
    text-decoration: none;
}

/* ============ SVG 主图标（block 布局，配合 flex 自动居中） ============ */
.bp-comments-toggle .bp-ct-icon {
    display: block;
    width: 20px;
    height: 20px;
    margin: 0;
    fill: none;
    stroke: currentColor;
    stroke-width: 2;
    stroke-linecap: round;
    stroke-linejoin: round;
}

/* ============ 小锁角标（仅强制状态出现） ============ */
.bp-comments-toggle .bp-ct-lock {
    position: absolute;
    right: -4px;
    bottom: -4px;
    width: 11px;
    height: 11px;
    padding: 1px;
    box-sizing: border-box;
    background: #fff;
    border-radius: 50%;
    fill: none;
    stroke: #dba617;
    stroke-width: 3;
    stroke-linecap: round;
    stroke-linejoin: round;
    pointer-events: none;
}

/* ---------- 开启：绿色 ---------- */
.bp-comments-toggle.opened {
    color: #00a32a !important;
}
.bp-comments-toggle.opened .bp-ct-icon {
    stroke: #00a32a;
}
.bp-comments-toggle.opened:hover,
.bp-comments-toggle.opened:focus {
    color: #007017 !important;
}
.bp-comments-toggle.opened:hover .bp-ct-icon,
.bp-comments-toggle.opened:focus .bp-ct-icon {
    stroke: #007017;
}

/* ---------- 关闭：红色 ---------- */
.bp-comments-toggle.closed {
    color: #d63638 !important;
}
.bp-comments-toggle.closed .bp-ct-icon {
    stroke: #d63638;
}
.bp-comments-toggle.closed:hover,
.bp-comments-toggle.closed:focus {
    color: #a02224 !important;
}
.bp-comments-toggle.closed:hover .bp-ct-icon,
.bp-comments-toggle.closed:focus .bp-ct-icon {
    stroke: #a02224;
}

/* ---------- 强制锁定：金色描边（用 outline 不撑开尺寸） ---------- */
.bp-comments-toggle.forced {
    outline: 2px solid #dba617 !important;
    outline-offset: 1px;
    border-radius: 5px;
}

/* ============ 加载中 ============ */
.bp-comments-toggle.loading {
    opacity: .5 !important;
    pointer-events: none !important;
}

/* ============================================================
   ★ 关闭评论：隐藏评论按钮 + 评论表单（对所有用户实时生效）
   ============================================================ */
.activity.bp-comments-closed .acomment-reply,
.activity.bp-comments-closed .ac-form,
.activity.bp-comments-closed [id^="ac-form-"],
.activity.bp-comments-closed .acomment-form,
.activity.bp-comments-closed form.ac-form {
    display: none !important;
}