/* =========================================
   Shared Content Card styles
   - Used by:
     - .zhi-featured-card (知 · 精选)
     - .xing-card        (行 · 行动库)
   - 结构：
     时间 → 标题 → 封面图片 → 标签 → 简介
   ========================================= */

/* 小屏幕：卡片整体与文字缩放 */
@media (max-width: 520px) { 
  .zhi-featured-card,
  .xing-card {
    min-height: 320px;
  }
  
  .zhi-featured-card__title,
  .xing-card__title {
    font-size: 16px;
    margin-bottom: 24px;
  }
  
  .zhi-featured-card__summary,
  .xing-card__summary {
    font-size: 12px;
    -webkit-line-clamp: 2;
  }
  
  .zhi-featured-card__date,
  .xing-card__date {
    font-size: 11px;
    margin-bottom: 16px;
  }
  
  .zhi-featured-card__category,
  .xing-card__category {
    font-size: 12px;
  }
  
  .zhi-featured-card__tag,
  .xing-card__tag {
    font-size: 12px;
  }
}

/* 卡片视觉样式（桌面与通用） */
.zhi-featured-card,
.xing-card {
  border: none;
  background: #fff;
  border-radius: 12px;
  overflow: hidden;
  transition: transform .18s ease;
  display: flex;
  flex-direction: column;
  height: auto;
  min-height: 400px;
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
}

.zhi-featured-card:hover,
.xing-card:hover {
  transform: translateY(-2px);
}

.zhi-featured-card__link,
.xing-card__link {
  display: flex;
  flex-direction: column;
  color: inherit;
  text-decoration: none;
  width: 100%;
  min-width: 0;
  overflow: hidden;
}

/* —— 顶部：日期 + 标题（不参与压缩）—— */
.zhi-featured-card__header,
.xing-card__header {
  padding: 16px 0 8px 0;
  flex-shrink: 0;
}

.zhi-featured-card__date,
.xing-card__date {
  font-size: 12px;
  color: #999;
  margin-bottom: 24px;
  display: flex;
  justify-content: space-between;
  align-items: center;
  position: relative;
}

.zhi-featured-card__date-year,
.xing-card__date-year {
  color: #999;
  font-weight: 500;
}

.zhi-featured-card__date-separator,
.xing-card__date-separator {
  flex: 1;
  height: 1px;
  background-color: #ccc;
  margin: 0 8px;
  align-self: center;
  display: block;
  min-width: 0;
}

.zhi-featured-card__date-month,
.xing-card__date-month {
  color: #999;
}

.zhi-featured-card__date-day-separator,
.xing-card__date-day-separator {
  width: 12px;
  height: 1px;
  background-color: #ccc;
  margin: 0 4px;
  align-self: center;
  display: block;
  flex-shrink: 0;
}

.zhi-featured-card__date-day,
.xing-card__date-day {
  color: #999;
}

.zhi-featured-card__title,
.xing-card__title {
  margin: 0 0 36px 0;
  font-size: 20px;
  font-weight: 600;
  line-height: 1.3;
  color: #000;
  
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
  overflow: hidden;
}

/* —— 分类标签（不参与压缩）—— */
.zhi-featured-card__categories,
.xing-card__categories {
  padding: 4px 0;
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex-shrink: 0;
}

.zhi-featured-card__category,
.xing-card__category {
  display: inline-block;
  background: transparent;
  color: #666;
  padding: 2px 0;
  font-size: 13px;
  line-height: 1.2;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* —— 封面图片（固定高度，避免与下方文字重叠）—— */
.zhi-featured-card__media,
.xing-card__media {
  position: relative;
  width: 100%;
  height: 180px;
  min-height: 180px;
  max-height: 200px;
  overflow: hidden;
  margin: 0;
  flex-shrink: 0;
}

.zhi-featured-card__media > img.zhi-featured-card__cover,
.xing-card__media > img.xing-card__cover {
  position: absolute;
  inset: 0;
  width: 100%; 
  height: 100%;
  object-fit: cover;
  display: block;
}

/* —— 底部：标签 + 简介（子元素从上到下依次排列，禁止被压扁）—— */
.zhi-featured-card__footer,
.xing-card__footer {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex-shrink: 0;
  padding-top: 12px;
  min-width: 0;
}

/* 标签样式 */
.zhi-featured-card__tags,
.xing-card__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 4px;
}

.zhi-featured-card__tag,
.xing-card__tag {
  display: inline-block;
  background: transparent;
  color: #666;
  padding: 2px 0;
  font-size: 13px;
  line-height: 1.2;
  word-break: break-word;
  overflow-wrap: break-word;
}

/* 简介样式：预留 3 行高度，避免被 flex 压扁导致文字重叠 */
.zhi-featured-card__summary,
.xing-card__summary {
  font-size: 13px;
  line-height: 1.5;
  color: #666;
  margin: 0;
  min-width: 0;
  /* 3 行高度 ≈ 1.5 * 3 = 4.5em，防止容器被压扁后字体重叠 */
  min-height: 4.5em;
  
  display: -webkit-box;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 3;
  overflow: hidden;
  text-overflow: ellipsis;
  word-break: break-word;
}

