/* ============================================
   community.css — 社群圈（列表卡片 + 详情页）
   基于 styles/section.css 的 Google 风格扩展
   ============================================ */

/* 根目录 base.css 的 form input[type="text"]{width:80%;max-width:300px}
   特异性 (0,1,2) 会压窄搜索框，这里用 (0,2,1) 显式覆盖 */
.cg-page form .sec-search-input {
  width: 100%;
  max-width: none;
  flex: 1 1 0;
}

.cg-lead {
  margin: -4px 0 16px;
  color: #5f6368;
  font-size: 0.9rem;
  line-height: 1.65;
}
.cg-empty-sub { font-size: 0.82rem; color: #9aa0a6; }

/* ---- 列表卡片：封面在上，标题/摘要/联系人在下 ---- */
.cg-card { padding: 0; gap: 0; overflow: hidden; }
.cg-cover {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  height: 140px;
  background: #eef2f8;
}
.cg-cover img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cg-cover-placeholder { font-size: 42px; opacity: .5; }
.cg-cat {
  position: absolute;
  top: 10px;
  left: 10px;
  padding: 3px 10px;
  border-radius: 12px;
  background: rgba(255, 255, 255, .95);
  color: #1967d2;
  font-size: 0.72rem;
  font-weight: 600;
  box-shadow: 0 1px 4px rgba(0, 0, 0, .12);
}
.cg-card .sec-card-title { margin: 12px 14px 0; }
.cg-summary {
  margin: 6px 14px 0;
  min-height: 2.5em;
  color: #5f6368;
  font-size: 0.82rem;
  line-height: 1.5;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.cg-card .sec-card-foot {
  margin: 10px 14px 12px;
  padding-top: 10px;
  border-top: 1px solid #f1f3f4;
}
.cg-join-link { color: #4285f4; font-weight: 600; white-space: nowrap; }

/* ---- 详情页 ---- */
.cg-detail { max-width: 720px; margin: 0 auto; padding: 12px 14px 96px; }
.cg-back { margin-bottom: 14px; }
.cg-back a { color: #1967d2; font-size: 0.9rem; text-decoration: none; }
.cg-back a:hover { text-decoration: underline; }

.cg-gallery {
  position: relative;
  width: 100%;
  height: 340px;
  border-radius: 14px;
  overflow: hidden;
  background: #eef2f8;
}
.cg-slide { position: absolute; inset: 0; opacity: 0; transition: opacity .2s ease; }
.cg-slide.is-active { opacity: 1; }
.cg-slide img { display: block; width: 100%; height: 100%; object-fit: cover; }
.cg-slide-caption {
  position: absolute;
  left: 0; right: 0; bottom: 0;
  padding: 20px 12px 10px;
  background: linear-gradient(transparent, rgba(0, 0, 0, .55));
  color: #fff;
  font-size: 0.8rem;
}
.cg-nav {
  position: absolute; top: 50%; transform: translateY(-50%);
  width: 36px; height: 36px; border: none; border-radius: 50%;
  background: rgba(0, 0, 0, .42); color: #fff;
  font-size: 22px; line-height: 1; cursor: pointer;
}
.cg-prev { left: 10px; }
.cg-next { right: 10px; }
.cg-counter {
  position: absolute; top: 10px; right: 10px;
  padding: 3px 10px; border-radius: 12px;
  background: rgba(0, 0, 0, .5); color: #fff; font-size: 0.75rem;
}

.cg-head { padding: 18px 2px 6px; }
.cg-head .cg-cat {
  position: static;
  display: inline-block;
  background: #e8f0fe;
  box-shadow: none;
}
.cg-head h1 { margin: 10px 0 0; font-size: 1.6rem; line-height: 1.35; color: #202124; }
.cg-summary-lead { margin: 8px 0 0; color: #5f6368; line-height: 1.65; font-size: 0.95rem; }

.cg-card {
  margin-top: 14px;
  padding: 18px 20px;
  background: #fff;
  border: 1px solid #dadce0;
  border-radius: 14px;
}
/* 根 base.css 有全局 h2{text-align:center;color:#d9534f}，这里显式改回左对齐 */
.cg-card h2 { margin: 0 0 12px; font-size: 1.05rem; color: #202124; text-align: left; }
.cg-prose { color: #3c4043; font-size: 0.94rem; line-height: 1.8; word-break: break-word; text-align: left; }
.cg-prose p { margin: 0 0 10px; }
.cg-prose h1, .cg-prose h2, .cg-prose h3 {
  font-size: 1rem; margin: 14px 0 6px; color: #202124; text-align: left;
}
.cg-prose ul, .cg-prose ol { padding-left: 22px; margin: 0 0 10px; }
.cg-prose blockquote {
  margin: 10px 0; padding: 2px 0 2px 12px;
  border-left: 3px solid #c6dafc; color: #5f6368; text-align: left;
}
.cg-prose img { max-width: 100%; height: auto; border-radius: 8px; }
.cg-prose a { color: #1967d2; }

.cg-join-hint { margin: -4px 0 12px; color: #80868b; font-size: 0.85rem; }
.cg-contact-row {
  display: flex; align-items: center; gap: 12px;
  padding: 10px 0; border-bottom: 1px solid #f1f3f4; font-size: 0.92rem;
}
.cg-contact-row:last-child { border-bottom: none; }
.cg-contact-row span { flex: none; width: 64px; color: #80868b; font-size: 0.82rem; }
.cg-contact-row strong { flex: 1; min-width: 0; font-weight: 600; word-break: break-all; color: #202124; }
.cg-copy {
  flex: none; padding: 5px 12px;
  border: 1px solid #dadce0; border-radius: 14px;
  background: #fff; color: #1967d2; font: inherit; font-size: 0.8rem; cursor: pointer;
}
.cg-copy:hover { background: #f1f6fd; }

.cg-qr { margin-top: 16px; text-align: center; }
.cg-qr img { width: 180px; max-width: 70%; border: 1px solid #eee; border-radius: 10px; }
.cg-qr p { margin: 8px 0 0; color: #80868b; font-size: 0.8rem; }

.cg-meta { margin: 16px 2px; color: #9aa0a6; font-size: 0.8rem; text-align: center; }

/* ---- 底部固定「复制联系方式」 ---- */
.cg-sticky {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 50;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom, 0px));
  background: rgba(255, 255, 255, .96);
  border-top: 1px solid #e8eaed;
}
.cg-sticky-btn {
  display: block; width: 100%; max-width: 420px; margin: 0 auto;
  padding: 12px; border: none; border-radius: 24px;
  background: #0f9d58; color: #fff;
  font: inherit; font-size: 1rem; font-weight: 600; cursor: pointer;
}
.cg-sticky-btn:hover { background: #0b8043; }

@media (max-width: 560px) {
  .cg-cover { height: 120px; }
  .cg-gallery { height: 220px; }
  .cg-head h1 { font-size: 1.35rem; }
  .cg-card { padding: 16px; }
  .cg-contact-row span { width: 56px; }
}
