/* ============================================================================
   瞬间页 /moments —— 卡片版式（主题自有页模板 templates/moments.html 专用）

   版式借鉴参考站 /moments：单列卡片流 + 卡片内多列媒体网格 + 圆形头像行 +
   右上角「打开详情」圆钮 + 底部「查看详情 / 点赞 / 查看评论」操作条。
   视觉一律使用主题自己的变量（--accent / --accent-07 / --accent-12 / --line-soft /
   --radius-sm / --shadow-up / --text / --text-3），因此 7 套配色自动跟随；
   图标全部是内联 SVG，零外链、零新增静态资源。

   类名前缀 mc- / moments- 在本主题内唯一（main.css 里不存在同名前缀）。
   ============================================================================ */

/* ---------- 页头：MOMENTS 小标 + 标题 + 统计 ---------- */
.moments-head {
  display: grid;
  gap: 6px;
}

.moments-kicker {
  margin: 0;
  color: var(--accent);
  font-size: 12px;
  font-weight: 700;
  letter-spacing: 0.18em;
  line-height: 1.2;
}

.moments-head .article-meta {
  display: flex;
  flex-wrap: wrap;
  gap: 6px 16px;
}

/* ---------- 标签筛选行 ---------- */
.mc-filter {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin: 18px 0 4px;
}

.mc-filter__label {
  color: var(--text-3);
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.18em;
}

/* ---------- 卡片流：单列（与参考站一致） ---------- */
.mc-list {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 18px;
  margin-top: 18px;
}

.mc-card {
  display: grid;
  gap: 14px;
  min-width: 0;
  padding: 14px;
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-sm);
  background: var(--accent-07);
  box-shadow: 0 1px 2px 0 rgb(7 17 27 / 4%);
  transition: background 0.3s ease, box-shadow 0.3s ease;
}

.mc-card:hover {
  background: var(--accent-12);
  box-shadow: var(--shadow-up);
}

/* ---------- 卡头：头像 / 作者 / 时间 / 详情圆钮 ---------- */
.mc-head {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
}

.mc-avatar {
  flex: 0 0 44px;
  width: 44px;
  height: 44px;
  display: grid;
  place-items: center;
  overflow: hidden;
  border-radius: 50%;
  background: var(--accent-12);
}

.mc-avatar img {
  width: 100%;
  height: 100%;
  display: block;
  object-fit: cover;
}

.mc-who {
  display: grid;
  gap: 2px;
  min-width: 0;
}

.mc-name {
  color: var(--text);
  font-size: 14px;
  font-weight: 700;
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.mc-time {
  color: var(--text-3);
  font-size: 12px;
  line-height: 1.4;
}

.mc-perma {
  flex: 0 0 32px;
  width: 32px;
  height: 32px;
  margin-left: auto;
  display: grid;
  place-items: center;
  border-radius: 50%;
  color: var(--text-3);
  transition: background 0.25s ease, color 0.25s ease;
}

.mc-perma svg {
  width: 16px;
  height: 16px;
}

.mc-perma:hover {
  background: var(--accent-12);
  color: var(--accent);
}

/* ---------- 正文 ---------- */
.mc-body {
  color: var(--text);
  font-size: 15px;
  line-height: 1.85;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.mc-body > :first-child {
  margin-top: 0;
}

.mc-body > :last-child {
  margin-bottom: 0;
}

.mc-body img,
.mc-body video {
  display: block;
  max-width: 100%;
  height: auto;
  border-radius: var(--radius-sm);
}

/* ---------- 标签胶囊 ---------- */
.mc-tags {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px;
}

.mc-tag {
  display: inline-flex;
  align-items: center;
  padding: 1px 9px;
  border: 1px solid transparent;
  border-radius: 999px;
  background: var(--accent-12);
  color: var(--accent);
  font-size: 12px;
  font-weight: 600;
  line-height: 1.6;
  transition: background 0.25s ease, color 0.25s ease;
}

a.mc-tag:hover {
  background: var(--accent-60);
  color: #fff;
}

/* ---------- 媒体网格：窄屏 2 列 / 桌面 3 列 / 单张 1 列 ----------
   为什么用 :has() 而不是模板里的 data-count：媒体张数只在真的有图时才渲染，
   当前真实数据 0 张图 → 模板分支无法实测；把列数逻辑放在纯 CSS 里就不存在
  「未实测的模板表达式在将来有图时报错」的风险。 */
.mc-media {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 8px;
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

/* 恰好 1 张 → 单列整幅；恰好 2 张 → 两列（不占满三列网格） */
.mc-media:has(> .mc-media-item:only-child) {
  grid-template-columns: minmax(0, 1fr);
}

.mc-media:has(> .mc-media-item:nth-child(2):last-child) {
  grid-template-columns: repeat(2, minmax(0, 1fr));
}

.mc-media-item {
  margin: 0;
  overflow: hidden;
  border-radius: var(--radius-sm);
  background: var(--accent-07);
}

.mc-media-item > a {
  display: block;
}

.mc-media-item img {
  display: block;
  width: 100%;
  height: auto;
  max-height: 480px;
  object-fit: contain;
  transition: transform 0.45s ease, filter 0.45s ease;
}

.mc-media-item > a:hover img {
  transform: scale(1.03);
  filter: brightness(0.94);
}

.mc-media-item video,
.mc-media-item audio {
  display: block;
  width: 100%;
}

/* ---------- 操作条 ---------- */
.mc-foot {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 6px 18px;
  padding-top: 12px;
  border-top: 1px solid var(--line-soft);
  color: var(--text-3);
  font-size: 12px;
}

.mc-act {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  color: var(--text-3);
  transition: color 0.25s ease, transform 0.25s ease;
}

.mc-act svg {
  width: 15px;
  height: 15px;
}

.mc-act--primary {
  color: var(--accent);
  font-weight: 700;
}

a.mc-act:hover {
  color: var(--accent);
  transform: translateY(-1px);
}

/* ---------- 空态 / 分页 ---------- */
.mc-empty {
  margin: 18px 0 0;
  padding: 22px 16px;
  border: 1px dashed var(--line);
  border-radius: var(--radius-sm);
  color: var(--text-3);
  text-align: center;
}

.mc-pager {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 10px;
  margin-top: 26px;
}

.mc-pager__btn {
  padding: 6px 14px;
  border: 1px solid var(--pager-border);
  border-radius: var(--radius-sm);
  background: var(--pager-bg);
  color: var(--pager-fg);
  font-size: 13px;
  transition: 0.3s;
}

.mc-pager__btn:hover {
  border-color: var(--accent);
  color: var(--accent);
}

.mc-pager__cur {
  min-width: 30px;
  padding: 6px 10px;
  border-radius: var(--radius-sm);
  background: var(--accent);
  color: #fff;
  font-size: 13px;
  font-weight: 700;
  text-align: center;
}

/* ---------- 桌面：卡片更舒展、媒体 3 列 ---------- */
@media (min-width: 640px) {
  .mc-list {
    gap: 22px;
  }

  .mc-card {
    gap: 16px;
    padding: 18px;
  }

  .mc-media {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    max-width: 32rem;
  }

  .mc-media:has(> .mc-media-item:only-child) {
    grid-template-columns: minmax(0, 1fr);
  }

  .mc-media:has(> .mc-media-item:nth-child(2):last-child) {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

/* ---------- 手机：收紧内边距，媒体 2 列 ---------- */
@media (max-width: 768px) {
  .mc-list {
    gap: 15px;
  }

  .mc-card {
    padding: 12px;
    gap: 12px;
  }

  .mc-avatar {
    flex-basis: 38px;
    width: 38px;
    height: 38px;
  }

  .mc-body {
    font-size: 14px;
    line-height: 1.8;
  }

  .mc-foot {
    gap: 6px 14px;
  }
}
