/* Koi 圈子运营（Change F）注入样式。B2 浅色主题，自包含。圆角统一用 .b2-radius（站点值）。 */

/* 圈子 @ 提及链接变蓝（评论容器 .topic-comment-text + 话题正文容器 .topic-content-text；
   评论经 kses 会删 a.koi-mention 的 class 但留 href，故用 [href*="user_id="] 兜底匹配。） */
.topic-comment-text a.koi-mention,
.topic-comment-text a[href*="user_id="],
.topic-content-text a.koi-mention,
.topic-content-text a[href*="user_id="] {
  color: #2b76ff !important;
  -webkit-text-fill-color: #2b76ff !important;
  font-weight: 600;
  text-decoration: none !important;
}

/* #koi-circle-ops 仅作 circle_id 数据载体（旧载体，在 Vue 区内），隐藏 */
#koi-circle-ops { display: none; }

/* ===== 侧边栏小工具内渲染（koi-circle-ops-widget 输出 #koi-circle-ops-host 于 .b2-widget-box 内）=====
   走 WP 原生小工具体系：外层 section 已是 B2 .box 卡片（白底/圆角/阴影），标题 h2 padding:20px 16px 8px。
   .b2-widget-box 内容本身零内距 → 这里给容器 16px 横向内距与标题对齐；各分区去内层卡外观、用细线分隔，
   形成「一张卡 + 分隔线分区」的标准侧栏小工具外观。手机端隐藏走小工具原生 .mobile-hidden（show_mobile=0）。 */
.koi-co-in-widget { margin: 0; padding: 2px 16px 14px; text-align: left; box-sizing: border-box; }
.koi-co-in-widget:empty { display: none; }
/* 主体分区（公告/精选/规则/活动/榜）：去内层卡外观，分区间细线分隔 */
.b2-widget-box .koi-co-card {
  background: transparent; border: 0; box-shadow: none; border-radius: 0;
  padding: 14px 0; margin: 0;
}
.b2-widget-box .koi-co-card + .koi-co-card { border-top: 1px solid #ebedf0; }
.b2-widget-box .koi-co-card:first-child { padding-top: 4px; }
.b2-widget-box .koi-co-card:last-child { padding-bottom: 2px; }
/* 审核入口 / 空公告入口：作为独立 CTA 块（保留各自底色），与下方分区留间距 */
.b2-widget-box .koi-co-mod-entry { margin: 4px 0 12px; }
.b2-widget-box .koi-co-add { display: flex; margin: 4px 0 12px; }
.b2-widget-box .koi-co-mod-entry + .koi-co-card,
.b2-widget-box .koi-co-add + .koi-co-card { border-top: 1px solid #ebedf0; }
/* 彻底左对齐：scope 到本小工具外壳 .koi_circle_ops_widget，覆盖主题对 widget 标题/内容的居中 */
.koi_circle_ops_widget .widget-title,
.koi_circle_ops_widget .widget-title h2,
.koi_circle_ops_widget .b2-widget-title,
.koi_circle_ops_widget .b2-widget-box,
.koi_circle_ops_widget .koi-co-in-widget,
.koi_circle_ops_widget .koi-co-card-h,
.koi_circle_ops_widget .koi-co-text,
.koi_circle_ops_widget .koi-co-empty,
.koi_circle_ops_widget .koi-co-kv dt,
.koi_circle_ops_widget .koi-co-kv dd { text-align: left !important; }

/* ===== 统一卡片 ===== */
.koi-co-card {
  background: #fff; border: 1px solid rgba(15, 23, 42, .08);
  box-shadow: 0 1px 3px rgba(15, 23, 42, .05); padding: 12px 14px; margin-bottom: 12px;
}
.koi-co-card-h { display: flex; align-items: center; gap: 6px; margin-bottom: 8px; font-size: 13.5px; font-weight: 700; color: #1f2430; }
.koi-co-card-h > i { font-size: 15px; }
.koi-co-ic-amber { color: #f5a623; }
.koi-co-ic-blue { color: #3b82f6; }
.koi-co-ic-green { color: #10b981; }
.koi-co-edit-link { margin-left: auto; font-size: 12px; font-weight: 400; color: #9aa0a6; cursor: pointer; }
.koi-co-edit-link:hover { color: #3b82f6; }
.koi-co-text { font-size: 14px; line-height: 1.6; color: #2b2f36; white-space: pre-wrap; word-break: break-word; }
.koi-co-text-sub { margin-top: 8px; font-size: 13px; color: #6b7280; }
.koi-co-empty { font-size: 12.5px; color: #aab0b8; padding: 2px 0; }

/* 空公告新增入口（仅管理员）：低存在感 pill */
.koi-co-add {
  display: inline-flex; align-items: center; gap: 6px; cursor: pointer; margin-bottom: 12px;
  padding: 7px 14px; background: #fff; border: 1px solid #ececf0; color: #9298a3; font-size: 12.5px;
}
.koi-co-add i { font-size: 14px; }
.koi-co-add:hover { border-color: #f5a623; color: #d97706; }

/* 审核入口 */
.koi-co-mod-entry {
  display: flex; align-items: center; gap: 7px; cursor: pointer; margin-bottom: 12px; padding: 10px 14px;
  background: rgba(59, 130, 246, .07); border: 1px solid rgba(59, 130, 246, .22); color: #2563eb; font-size: 13px; font-weight: 600;
}
.koi-co-mod-entry > i { font-size: 16px; }
.koi-co-mod-entry b { background: #2563eb; color: #fff; border-radius: 999px; padding: 0 7px; font-size: 12px; line-height: 18px; }
.koi-co-mod-entry em { margin-left: auto; font-style: normal; font-weight: 400; color: #6b7280; font-size: 12px; }
.koi-co-mod-entry:hover { background: rgba(59, 130, 246, .12); }

/* 规则 KV 展示 */
.koi-co-kv-list { margin: 0; display: flex; flex-direction: column; gap: 8px; }
.koi-co-kv { display: flex; gap: 10px; align-items: baseline; }
.koi-co-kv dt { flex: 0 0 auto; min-width: 56px; max-width: 120px; font-size: 12.5px; font-weight: 600; color: #3b82f6; background: rgba(59, 130, 246, .08); border-radius: 6px; padding: 2px 8px; }
.koi-co-kv dd { margin: 0; flex: 1; min-width: 0; font-size: 13.5px; line-height: 1.5; color: #2b2f36; word-break: break-word; }

/* 精选 */
.koi-co-feat-row { display: flex; gap: 10px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: thin; }
.koi-co-feat-row::-webkit-scrollbar { height: 6px; }
.koi-co-feat-row::-webkit-scrollbar-thumb { background: #e5e7eb; border-radius: 3px; }
.koi-co-feat-card { flex: 0 0 auto; width: 128px; background: #fff; border: 1px solid rgba(0, 0, 0, .08); overflow: hidden; text-decoration: none; transition: box-shadow .15s, border-color .15s; }
@media (hover: hover) { .koi-co-feat-card:hover { box-shadow: 0 2px 10px rgba(15, 23, 42, .07); border-color: rgba(0, 0, 0, .14); } }
.koi-co-feat-cover { display: block; width: 100%; height: 80px; background: #f1f2f4 center/cover no-repeat; }
.koi-co-feat-noimg { display: flex; align-items: center; justify-content: center; }
.koi-co-feat-noimg i { color: rgba(245, 166, 35, .6); font-size: 20px; }
.koi-co-feat-title { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; padding: 7px 9px; font-size: 12px; line-height: 1.35; color: #2b2f36; }

/* 活动 */
.koi-co-acts-list { display: flex; flex-direction: column; gap: 8px; }
.koi-co-act-card { display: flex; align-items: center; gap: 10px; background: #fafbfc; border: 1px solid rgba(0, 0, 0, .06); border-radius: 8px; padding: 8px; position: relative; }
.koi-co-act-cover { flex: 0 0 auto; width: 60px; height: 42px; border-radius: 6px; background: #f1f2f4 center/cover no-repeat; }
.koi-co-act-noimg { display: flex; align-items: center; justify-content: center; }
.koi-co-act-noimg i { color: rgba(16, 185, 129, .55); font-size: 18px; }
.koi-co-act-meta { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.koi-co-act-meta strong { font-size: 13.5px; color: #1f2430; }
.koi-co-act-range { font-size: 11.5px; color: #10b981; }
.koi-co-act-desc { font-size: 12px; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.koi-co-act-del { flex: 0 0 auto; border: 0; background: none; color: #c4c9d0; font-size: 18px; line-height: 1; cursor: pointer; padding: 0 2px; }
.koi-co-act-del:hover { color: #dc2626; }

/* 成员贡献榜 */
.koi-co-lb-body { display: flex; flex-direction: column; gap: 2px; }
.koi-co-lb-loading { font-size: 12.5px; color: #aab0b8; padding: 4px 0; }
.koi-co-lb-row { display: flex; align-items: center; gap: 9px; padding: 5px 0; }
.koi-co-lb-rank { flex: 0 0 18px; text-align: center; font-size: 12px; font-weight: 800; color: #c4c9d0; }
.koi-co-lb-row:nth-child(1) .koi-co-lb-rank { color: #f5a623; }
.koi-co-lb-row:nth-child(2) .koi-co-lb-rank { color: #9aa7b8; }
.koi-co-lb-row:nth-child(3) .koi-co-lb-rank { color: #cd7f32; }
.koi-co-lb-av { flex: 0 0 26px; width: 26px; height: 26px; border-radius: 50%; background: #eef0f3 center/cover no-repeat; }
.koi-co-lb-name { flex: 1; min-width: 0; font-size: 13px; color: #2b2f36; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.koi-co-lb-role { font-style: normal; font-size: 11px; color: #d97706; background: rgba(245, 166, 35, .12); border-radius: 4px; padding: 0 5px; margin-left: 6px; }
.koi-co-lb-cnt { flex: 0 0 auto; font-size: 12px; color: #9aa0a6; }

/* ===== 弹层 ===== */
.koi-co-modal { position: fixed; inset: 0; z-index: 99999; background: rgba(0, 0, 0, .45); display: flex; align-items: center; justify-content: center; padding: 20px; }
.koi-co-modal-box { width: 100%; max-width: 460px; background: #fff; border-radius: 14px; padding: 18px; box-shadow: 0 20px 60px rgba(0, 0, 0, .25); max-height: 86vh; overflow-y: auto; }
.koi-co-modal-head { display: flex; align-items: center; margin-bottom: 12px; }
.koi-co-modal-head h3 { margin: 0; font-size: 16px; font-weight: 700; color: #111827; }
.koi-co-modal-x { margin-left: auto; border: 0; background: none; font-size: 22px; line-height: 1; color: #9ca3af; cursor: pointer; }
.koi-co-modal-cap { font-size: 12px; color: #9aa0a6; margin-bottom: 6px; }
.koi-co-modal-ta { width: 100%; min-height: 90px; resize: vertical; box-sizing: border-box; border: 1px solid #e5e7eb; border-radius: 10px; padding: 10px 12px; font-size: 14px; line-height: 1.5; color: #1f2937; background: #fafbfc; outline: none; }
.koi-co-modal-ta:focus { border-color: #ff3a55; box-shadow: 0 0 0 3px rgba(255, 58, 85, .12); }
.koi-co-modal-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 14px; }
.koi-co-modal-foot > div { display: flex; gap: 8px; }
.koi-co-btn { border: 1px solid #e5e7eb; background: #fff; color: #374151; border-radius: 8px; padding: 7px 16px; font-size: 13.5px; cursor: pointer; }
.koi-co-btn:hover { background: #f6f7f9; }
.koi-co-btn-primary { background: #f5a623; border-color: #f5a623; color: #fff; }
.koi-co-btn-primary:hover { background: #e0922f; }
.koi-co-btn-del { border-color: transparent; color: #dc2626; }
.koi-co-btn-del:hover { background: rgba(220, 38, 38, .08); }

/* 规则 KV 编辑 */
.koi-co-kv-rows { display: flex; flex-direction: column; gap: 8px; }
.koi-co-kv-edit { display: flex; gap: 6px; align-items: center; }
.koi-co-kv-edit input { box-sizing: border-box; border: 1px solid #e5e7eb; border-radius: 8px; padding: 7px 10px; font-size: 13.5px; background: #fafbfc; outline: none; }
.koi-co-kv-edit input:focus { border-color: #ff3a55; box-shadow: 0 0 0 3px rgba(255, 58, 85, .12); }
.koi-co-kv-k { flex: 0 0 92px; }
.koi-co-kv-v { flex: 1; min-width: 0; }
.koi-co-kv-del { flex: 0 0 auto; border: 0; background: none; color: #c4c9d0; font-size: 18px; line-height: 1; cursor: pointer; }
.koi-co-kv-del:hover { color: #dc2626; }
.koi-co-kv-add { margin-top: 8px; border: 1px dashed #d6dae0; background: none; color: #6b7280; border-radius: 8px; padding: 7px 0; width: 100%; font-size: 13px; cursor: pointer; }
.koi-co-kv-add:hover { border-color: #f5a623; color: #d97706; }

/* 新增活动字段 */
.koi-co-modal-fields { display: flex; flex-direction: column; gap: 8px; }
.koi-co-modal-fields input, .koi-co-modal-fields textarea { width: 100%; box-sizing: border-box; border: 1px solid #e5e7eb; border-radius: 8px; padding: 8px 10px; font-size: 13.5px; background: #fafbfc; outline: none; resize: vertical; }
.koi-co-modal-fields input:focus, .koi-co-modal-fields textarea:focus { border-color: #ff3a55; box-shadow: 0 0 0 3px rgba(255, 58, 85, .12); }
.koi-co-modal-row { display: flex; gap: 8px; }
.koi-co-modal-row input { width: 50%; }

/* 审核列表 */
.koi-co-mod-list { max-height: 50vh; overflow-y: auto; display: flex; flex-direction: column; gap: 8px; }
.koi-co-mod-item { display: flex; align-items: center; gap: 10px; border: 1px solid #eee; border-radius: 8px; padding: 8px 10px; }
.koi-co-mod-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.koi-co-mod-main strong { font-size: 13.5px; color: #1f2430; }
.koi-co-mod-sub { font-size: 11.5px; color: #9aa0a6; }
.koi-co-mod-ex { font-size: 12px; color: #6b7280; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.koi-co-mod-ops { flex: 0 0 auto; display: flex; gap: 6px; }
.koi-co-mod-ops .koi-co-btn { padding: 5px 12px; font-size: 12.5px; }
