/* ============================================================
 * OPC 生态服务机构（opc_community）模块样式
 * 加载于 archive-opc_community / single-opc_community（在 components.css 之后）
 * 视觉基准：prototype-emergeia/community.html（列表 comm-grid）
 *            prototype-emergeia/detail.html（详情 范式B：大图+主栏+右推荐栏）
 * Token 对齐：--accent:#4d6bfe / --text:#1d1d1f / --muted:#81858c
 *            --line:#ececed / --radius-card:16px / Space Grotesk
 * ============================================================ */

/* ------------------------------------------------------------
 * 一、列表页（归档）
 * ------------------------------------------------------------ */

.page-frame .view-toggle { margin-bottom: 20px; }
.page-frame .result-summary { font-size: 13.5px; letter-spacing: .01em; }

/* 关键修复：components.css 第406行把 .comm-card 强制为 flex-direction:row（为
 * 不存在的头像结构 .comm-avatar/.comm-body 设计），导致真实卡片纵向内容被挤成横排、
 * 文字竖排崩坏。此处纠正回原型 community.html 的纵向卡片布局。
 * 视觉：纯色淡蓝底（去 components.css 渐变 + 去线框），与名录卡片完全同款。 */
.opc-community-card {
  flex-direction: column !important;
  gap: 14px !important;
  align-items: stretch !important;
  padding: 20px !important;
  border-radius: var(--radius-card);
  background: var(--entity-card);
  background-image: none;
  border: none;
  box-shadow: 0 1px 2px rgba(29, 29, 31, 0.04);
}

.opc-community-card:hover {
  transform: translateY(-2px);
  background: var(--entity-card-hover);
  box-shadow: 0 10px 28px rgba(29, 29, 31, 0.09);
}

/* 三列自适应网格：桌面3列 → 中屏2列 → 窄屏1列。间距与名录页统一为 20px。 */
.opc-community-archive .comm-grid {
  grid-template-columns: repeat(3, minmax(0, 1fr)) !important;
  gap: 20px !important;
}

/* 卡片内部精修 */
.opc-community-card .comm-body { display: flex; flex-direction: column; gap: 12px; flex: 1; }
.opc-community-card .comm-top {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 14px;
}
.opc-community-card .comm-ident { min-width: 0; flex: 1; }
.opc-community-card .comm-name {
  font-size: 16px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: -0.01em;
  color: var(--text);
}
.opc-community-card .comm-meta {
  margin-top: 6px;
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 8px;
}
/* 城市：次级信息，前置定位点强化地域语义（与名录卡片同款） */
.opc-community-card .comm-city {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--muted-2);
}
.opc-community-card .comm-city::before {
  content: "";
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--muted-2);
  opacity: .55;
  flex-shrink: 0;
}
/* 机构类型徽章：淡蓝 pill（机构类型已升级为7大类，旧三色语义映射已失效，统一走品牌淡蓝） */
.opc-community-card .comm-type-badge {
  display: inline-flex;
  align-items: center;
  font-size: 11.5px;
  font-weight: 600;
  color: var(--accent);
  background: var(--accent-soft);
  border-radius: var(--radius-pill);
  padding: 2px 10px;
  line-height: 1.6;
}

/* logo：右上圆角矩形；无图时中性浅灰底"机构"文字占位（不使用品牌蓝） */
.opc-community-card .comm-logo-wrap { flex-shrink: 0; order: 2; }
.opc-community-card .comm-logo {
  display: block;
  width: 52px;
  height: 52px;
  border-radius: 13px;
  object-fit: cover;
  border: 1px solid rgba(29, 29, 31, 0.06);
}
.opc-community-card .comm-logo--ph {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 52px;
  height: 52px;
  border-radius: 13px;
  background: var(--entity-ph);
  color: var(--entity-ph-fg);
  font-family: var(--font-display);
  font-size: 13px;
  font-weight: 700;
  letter-spacing: .04em;
  line-height: 1;
  user-select: none;
}

/* 简介：两行截断 + 最小高度兜底，保证网格内卡片等高 */
.opc-community-card .comm-desc { min-height: 40px; }

/* 统计行沉底 + 白底分栏卡：机构规模 / 加入方式，抓关键信息、网格等高对齐 */
.opc-community-card .comm-stats {
  margin-top: auto;
  display: flex;
  gap: 8px;
  padding: 0;
  border: none;
}
.opc-community-card .comm-stat {
  flex: 1 1 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 3px;
  padding: 10px 12px;
  background: #fff;
  border-radius: 10px;
}
.opc-community-card .comm-stat .k {
  font-size: 10.5px;
  color: var(--muted-2);
  letter-spacing: .02em;
}
.opc-community-card .comm-stat .v {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

/* 分页数字按钮 hover（原型静态 page-btn 兜底） */
.pagination .page-btn:not(.active):not(:disabled):hover {
  border-color: var(--accent);
  color: var(--accent);
}
/* WordPress the_posts_pagination() 的 .page-numbers 观感统一由 components.css 承接。 */

/* ------------------------------------------------------------
 * 二、详情页 范式B（大图 hero + 主栏 + 右侧 sticky 推荐栏）
 *    覆盖 components.css 第129行 .detail-page 的两列基础布局，
 *    对齐 prototype-emergeia/detail.html 的 .detail-layout 观感。
 * ------------------------------------------------------------ */
.detail-page.opc-comm-detail {
  max-width: 1180px;
  margin: 34px auto 72px;
  grid-template-columns: minmax(0, 1fr) 320px;
  gap: 56px;
  padding: 0 32px;
}

.opc-comm-detail .detail-main { min-width: 0; }

/* 返回链接 */
.opc-comm-detail .back-link {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 22px;
  transition: color .15s ease, gap .15s ease;
}
.opc-comm-detail .back-link:hover { color: var(--accent); gap: 9px; }

/* 大图 hero（范式B 核心）：有缩略图用真图，无图用品牌渐变占位 */
.opc-comm-hero {
  width: 100%;
  aspect-ratio: 21 / 9;
  border-radius: var(--radius-card);
  object-fit: cover;
  margin-bottom: 26px;
  background: var(--surface);
  display: block;
}
/* 标题区 */
.opc-comm-detail .detail-title-row { margin-bottom: 12px; }
.opc-comm-detail .detail-title {
  font-size: 32px;
  line-height: 1.25;
  letter-spacing: -0.02em;
}
.opc-comm-detail .detail-subtitle {
  font-size: 15px;
  line-height: 1.75;
  max-width: none;
  margin-bottom: 18px;
}
.opc-comm-detail .comm-track-row { margin-bottom: 26px !important; }
.opc-comm-detail .comm-track-row .track-tag { font-size: 12px; }

/* 字段网格：范式B 主栏内的关键信息表 */
.opc-comm-detail .field-grid {
  grid-template-columns: repeat(3, 1fr);
  gap: 24px 32px;
  padding: 24px 0;
  margin-bottom: 0;
}
.opc-comm-detail .field-item .v { font-size: 14.5px; line-height: 1.5; }

/* 主栏内容块（加入方式） */
.opc-comm-detail .detail-main .sb-block {
  margin-top: 32px;
  margin-bottom: 0;
}
.opc-comm-detail .detail-main .sb-label {
  font-size: 12px;
  color: var(--accent);
  letter-spacing: .04em;
}
.opc-comm-join-text {
  font-size: 14px;
  color: var(--muted);
  line-height: 1.8;
  margin-bottom: 18px;
}
.opc-comm-detail .detail-main .btn-solid { padding: 10px 22px; font-size: 14px; }

/* ---- 右侧 sticky 推荐栏（范式B）：卡片化 aside-card ---- */
.opc-comm-detail aside.detail-aside {
  position: sticky;
  top: 84px;
  display: flex;
  flex-direction: column;
  gap: 18px;
  align-self: start;
}
.opc-comm-detail .aside-card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  padding: 22px 24px;
}
.opc-comm-detail .aside-card .sb-label {
  font-size: 11px;
  color: var(--accent);
  letter-spacing: .05em;
  margin-bottom: 8px;
}
.opc-comm-detail .aside-card .sb-list-item {
  padding: 13px 0;
  transition: transform .15s ease;
}
.opc-comm-detail .aside-card .sb-list-item:first-of-type { padding-top: 6px; }
.opc-comm-detail .aside-card .sb-list-item:hover { transform: translateX(3px); }
.opc-comm-detail .aside-card .sb-list-item:hover .name { color: var(--accent); }
.opc-comm-detail .aside-card .sb-list-item .name { transition: color .15s ease; }

/* ------------------------------------------------------------
 * 三、响应式：≤920 侧栏下沉、≤768 单列
 * ------------------------------------------------------------ */
@media (max-width: 920px) {
  .opc-community-archive .comm-grid { grid-template-columns: repeat(2, minmax(0, 1fr)) !important; }

  .detail-page.opc-comm-detail {
    grid-template-columns: 1fr;
    gap: 32px;
    padding: 0 24px;
  }
  .opc-comm-detail aside.detail-aside {
    position: static;
    order: 2;
  }
  .opc-comm-detail .detail-main { order: 1; }
}

@media (max-width: 768px) {
  .opc-community-archive .comm-grid { grid-template-columns: 1fr !important; }

  .detail-page.opc-comm-detail { margin-top: 20px; padding: 0 18px; }
  .opc-comm-hero { aspect-ratio: 16 / 9; margin-bottom: 20px; }
  .opc-comm-detail .detail-title { font-size: 26px; }
  .opc-comm-detail .field-grid { grid-template-columns: repeat(2, 1fr); gap: 20px 24px; }
}

@media (max-width: 480px) {
  .opc-comm-detail .field-grid { grid-template-columns: 1fr; }
}

