/* ============================================================
   /topics 话题目录 v2：hero 运营统计 + Most active 运营位 + 排序条
   + 富话题卡（New 徽章 / 分享度条）。依赖 shell.css 与 tag-page.css
   的 .card/.tag-hero/.pager 基础样式，本文件只负责新组件。
   注意：shell v2 的 18px 缩进只下发给 .main-col 的直接 .card 子级，
   非 card 区块（运营位/排序条/网格）必须自带 margin-inline。
   ============================================================ */

/* ---------- 运营位：Most active（动态数 Top3 自动位） ---------- */
.topics-featured {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(215px, 1fr));
  gap: 12px;
  margin: 14px 18px 0;
}
.tfcard {
  position: relative;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  background: linear-gradient(135deg, var(--brand-tint), #ffffff 70%);
  border-color: transparent;
  transition: border-color .15s ease, transform .15s ease, box-shadow .15s ease;
}
.tfcard:hover {
  border-color: var(--brand-600);
  transform: translateY(-1px);
  box-shadow: 0 6px 18px rgba(17, 19, 24, .07);
}
.tfcard-rank {
  flex: 0 0 auto;
  width: 18px;
  text-align: center;
  font-family: var(--font-display);
  font-size: 25px;
  font-weight: 700;
  color: var(--brand-600);
  opacity: .35;
}
.tfcard-hash {
  flex: 0 0 auto;
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: var(--brand);
  color: #fff;
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 21px;
}
.tfcard-body {
  min-width: 0;
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.tfcard-name {
  font-family: var(--font-display);
  font-size: 15.5px;
  font-weight: 700;
  color: var(--ink);
}
.tfcard-meta { font-size: 12px; color: var(--ink-2); }
.tfcard-meta b { color: var(--ink); }
.tfcard-go {
  flex: 0 0 auto;
  color: var(--brand-600);
  font-weight: 700;
  transition: transform .12s ease;
}
.tfcard:hover .tfcard-go { transform: translateX(3px); }

/* ---------- 排序条（真链接） ---------- */
.topics-sort {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin: 14px 18px 12px;
}
.topics-sort-label {
  font-size: 12px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .07em;
  color: var(--ink-3);
  margin-right: 2px;
}
.top-chip {
  display: inline-flex;
  align-items: center;
  padding: 6px 14px;
  border: 1px solid var(--border);
  border-radius: var(--r-pill);
  background: var(--surface);
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-2);
  text-decoration: none;
  transition: border-color .12s ease, background .12s ease;
}
.top-chip:hover { border-color: var(--brand-600); color: var(--brand-600); text-decoration: none; }
.top-chip.on { background: var(--brand-tint); border-color: transparent; color: var(--brand-800); }

/* ---------- 富话题卡网格 ---------- */
.topics-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(255px, 1fr));
  gap: 12px;
  margin: 0 18px;
}
.tcard {
  position: relative;
  padding: 16px 18px 14px;
  transition: border-color .15s ease, box-shadow .15s ease, transform .15s ease;
}
.tcard:hover {
  border-color: var(--brand-600);
  box-shadow: 0 6px 18px rgba(17, 19, 24, .07);
  transform: translateY(-1px);
}
.tcard-link { position: absolute; inset: 0; border-radius: inherit; z-index: 1; }
.tcard-head { display: flex; align-items: center; gap: 10px; }
.tcard-hash {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: var(--surface-2);
  color: var(--brand-600);
  display: grid;
  place-items: center;
  font-family: var(--font-display);
  font-weight: 700;
  font-size: 19px;
}
.tcard-name {
  flex: 1 1 auto;
  min-width: 0;
  margin: 0;
  font-family: var(--font-display);
  font-size: 16px;
  font-weight: 700;
  letter-spacing: -.01em;
  color: var(--ink);
}
.tcard-badge {
  flex: 0 0 auto;
  background: var(--accent-tint);
  color: var(--accent-ink);
  font-size: 11px;
  font-weight: 700;
  text-transform: uppercase;
  letter-spacing: .05em;
  padding: 3px 8px;
  border-radius: var(--r-pill);
}
.tcard-desc {
  margin: 9px 0 0;
  font-size: 13px;
  line-height: 1.55;
  color: var(--ink-2);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.tcard-foot {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-top: 12px;
}
.tcard-posts {
  flex: 0 0 auto;
  font-size: 12.5px;
  color: var(--ink-2);
  white-space: nowrap;
}
.tcard-posts b {
  font-family: var(--font-display);
  font-size: 15px;
  font-weight: 700;
  color: var(--ink);
  margin-right: 3px;
}
/* 分享度条：相对全局热度峰值（后端归一 2-100），跨页可比 */
.tcard-share {
  flex: 1 1 auto;
  height: 5px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  overflow: hidden;
}
.tcard-share i {
  display: block;
  height: 100%;
  border-radius: inherit;
  background: linear-gradient(90deg, var(--brand-600), var(--brand));
}

/* ---------- 响应式 ---------- */
@media (max-width: 640px) {
  .topics-featured { grid-template-columns: 1fr; margin: 12px 16px 0; }
  .topics-sort { margin: 12px 16px 10px; }
  .topics-grid { grid-template-columns: 1fr; margin: 0 16px; }
}
