/* ==========================================================================
   随笔区补充样式 · posts.css
   只服务 posts.html / post-bidding.html / post-wargame.html
   所有选择器带 posts- 前缀；颜色、圆角、阴影一律用 base.css 的变量
   ========================================================================== */

/* --------------------------------------------------------------------------
   1. 随笔列表页
   -------------------------------------------------------------------------- */
.posts-grid {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--gap);
  align-items: stretch;
}

/* 筛选是给 .post-card 加 [hidden]：卡片本身 display:flex，会盖掉 UA 的
   [hidden]{display:none}，这里补一条，保证 app.js 的筛选真的能藏起卡片 */
.posts-grid > [hidden] { display: none !important; }

.posts-grid .post-card { height: 100%; }
.posts-grid .post-card__excerpt { -webkit-line-clamp: 3; }
/* 卡片脚的「图标 + 时长」要排一行：svg 默认 display:block，会把文字挤到下一行 */
.posts-grid .post-card__foot span { display: inline-flex; align-items: center; gap: 4px; }
/* 夜航主题下封面的白色小徽标配浅色文字会看不清，换成深色文字 */
html[data-decor="night"] .posts-grid .post-card__badge { color: var(--text-invert); }

.posts-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
  margin-bottom: var(--gap);
  padding: 12px 16px;
  border-radius: var(--radius-full);
  background: var(--surface-glass);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-card);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
}
.posts-filter__label {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 800;
  color: var(--text-3);
}
.posts-filter__label .icon { width: 14px; height: 14px; color: var(--brand); }
.posts-filter__spacer { margin-left: auto; }
.posts-filter__count { font-size: 12px; color: var(--text-3); }
.posts-filter__count strong {
  font-family: var(--font-display);
  color: var(--brand);
  font-size: 13px;
}

/* 列表页结尾引导 */
.posts-end {
  display: grid;
  grid-template-columns: minmax(0, 1.35fr) minmax(0, 1fr);
  gap: 26px;
  align-items: center;
  margin-top: var(--gap);
  overflow: hidden;
}
.posts-end__body { min-width: 0; }
.posts-end__title {
  font-size: 21px;
  line-height: 1.45;
  margin-bottom: 8px;
}
.posts-end__text {
  font-size: 13.5px;
  color: var(--text-3);
  line-height: 1.85;
}
.posts-end__panel {
  display: grid;
  gap: 9px;
  padding: 16px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.posts-end__note {
  font-size: 11.5px;
  color: var(--text-3);
  line-height: 1.7;
  margin-top: 2px;
}

/* --------------------------------------------------------------------------
   2. 文章页（post-bidding / post-wargame）
   -------------------------------------------------------------------------- */
/* 正文里的数字小标签：给 key number 一个等宽字体，别抢标题风头 */
.posts-num {
  font-family: var(--font-mono);
  font-size: 0.94em;
  font-weight: 700;
  color: var(--brand-deep);
  padding: 0 2px;
}

/* 旁栏「这篇的数字」清单 */
.posts-facts { display: grid; gap: 7px; }
.posts-facts__row {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  padding-bottom: 7px;
  border-bottom: 1px dashed var(--line);
  font-size: 12px;
  color: var(--text-3);
}
.posts-facts__row:last-child { border-bottom: 0; padding-bottom: 0; }
.posts-facts__row b {
  font-family: var(--font-display);
  font-size: 14px;
  color: var(--text-1);
  white-space: nowrap;
}

/* 正文中的「步骤条」：用纯 CSS 排一列编号，不依赖有序列表的默认样式 */
.posts-steps { display: grid; gap: 10px; margin: 20px 0; }
.posts-step {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr);
  gap: 10px;
  align-items: start;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--surface-soft);
  border: 1px solid var(--line);
}
.posts-step__idx {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  border-radius: 7px;
  font-family: var(--font-mono);
  font-size: 11px;
  font-weight: 700;
  color: var(--surface);
  background: linear-gradient(135deg, var(--brand), var(--brand-deep));
}
.posts-step__body { min-width: 0; font-size: 13.5px; line-height: 1.75; }
.posts-step__title { font-weight: 800; color: var(--text-1); margin-bottom: 2px; }
.posts-step__body p { margin: 0; color: var(--text-2); }

/* 正文里的小结论：要比 callout 更轻，只做一条左侧色条 */
.posts-takeaway {
  margin: 22px 0;
  padding: 4px 0 4px 16px;
  border-left: 3px solid var(--red);
  font-size: 13.5px;
  line-height: 1.8;
  color: var(--text-2);
}
.posts-takeaway strong { color: var(--text-1); }

/* --------------------------------------------------------------------------
   3. 响应式
   -------------------------------------------------------------------------- */
@media (max-width: 960px) {
  .posts-grid { grid-template-columns: minmax(0, 1fr); }
  .posts-end { grid-template-columns: minmax(0, 1fr); gap: 18px; }
}

@media (max-width: 760px) {
  .posts-filter { border-radius: var(--radius-lg); padding: 12px 14px; }
  .posts-filter__spacer { display: none; }
  .posts-filter__count { margin-left: auto; }
  .posts-grid .post-card__excerpt { -webkit-line-clamp: 2; }
  .posts-end { padding: 20px; }
  .posts-step { grid-template-columns: 22px minmax(0, 1fr); padding: 11px 12px; }
}

@media (max-width: 420px) {
  .posts-filter { gap: 8px; }
  .posts-filter__count { display: none; }
  .posts-filter .chip { padding: 5px 11px; font-size: 12px; }
}
