/* ==========================================================================
   首页样式 index.css
   说明：首页 Hero 区、置顶文章、文章列表、侧边栏等专属样式
   ========================================================================== */

/* ---------- Hero 区 ---------- */
.hero {
  text-align: center;
  padding: 60px 20px 40px;
  background: linear-gradient(180deg, var(--color-primary-light) 0%, var(--color-bg) 100%);
}
.hero h1 {
  font-size: 36px;
  font-weight: 700;
  color: var(--color-text);
  margin-bottom: 12px;
  letter-spacing: 2px;
}
.hero .subtitle {
  font-size: 16px;
  color: var(--color-text-secondary);
}

/* ---------- 区块标题 ---------- */
.section-title {
  font-size: 20px;
  font-weight: 600;
  color: var(--color-text);
  margin-bottom: 20px;
  padding-left: 12px;
  border-left: 4px solid var(--color-primary);
}

/* ---------- 置顶文章（大卡片） ---------- */
.featured-list {
  display: grid;
  grid-template-columns: repeat(3, 1fr);  /* 三列 */
  gap: 20px;
  margin-bottom: 40px;
}
.featured-card {
  overflow: hidden;
  background: var(--color-bg-card);
  border-radius: var(--radius);
  box-shadow: var(--shadow-card);
  cursor: pointer;
  transition: box-shadow 0.2s, transform 0.2s;
}
.featured-card:hover {
  box-shadow: var(--shadow-hover);
  transform: translateY(-3px);
}
.featured-card .cover {
  width: 100%;
  height: 160px;
  object-fit: cover;
}
.featured-card .body {
  padding: 16px;
}
.featured-card .badge {
  display: inline-block;
  padding: 2px 8px;
  font-size: 11px;
  color: #fff;
  background: var(--color-accent);
  border-radius: var(--radius-sm);
  margin-bottom: 8px;
}
.featured-card .title {
  font-size: 16px;
  font-weight: 600;
  color: var(--color-text);
  line-height: 1.5;                 /* 显式行高，便于计算最小高度 */
  margin-bottom: 8px;
  min-height: 3em;                  /* 锁定两行高度：1.5 * 2 = 3em，短标题也占两行，保证卡片等高 */
  /* 两行省略 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.featured-card .excerpt {
  font-size: 13px;
  color: var(--color-text-secondary);
  line-height: 1.6;
  min-height: 3.2em;                /* 锁定两行高度：1.6 * 2 = 3.2em，摘要短也占两行 */
  /* 两行省略 */
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* ---------- 最新文章列表标题区 ---------- */
.list-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 20px;
}
.list-header .section-title {
  margin-bottom: 0;
}

/* ---------- 专栏推荐小卡片 ---------- */
.column-mini {
  display: flex;
  gap: 12px;
  padding: 10px 0;
  border-bottom: 1px dashed var(--color-border-light);
  cursor: pointer;
}
.column-mini:last-child { border-bottom: none; }
.column-mini .cover {
  width: 56px;
  height: 56px;
  border-radius: var(--radius-sm);
  object-fit: cover;
  flex-shrink: 0;
}
.column-mini .info {
  flex: 1;
  min-width: 0;
}
.column-mini .name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.column-mini:hover .name { color: var(--color-primary); }
.column-mini .meta {
  font-size: 12px;
  color: var(--color-text-light);
}

/* ---------- 合集小卡片 ---------- */
.collection-mini {
  padding: 10px 0;
  border-bottom: 1px dashed var(--color-border-light);
  cursor: pointer;
}
.collection-mini:last-child { border-bottom: none; }
.collection-mini .name {
  font-size: 14px;
  font-weight: 500;
  color: var(--color-text);
  margin-bottom: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.collection-mini:hover .name { color: var(--color-primary); }
.collection-mini .desc {
  font-size: 12px;
  color: var(--color-text-light);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- 响应式 ---------- */
@media (max-width: 1024px) {
  .featured-list {
    grid-template-columns: repeat(2, 1fr);  /* 平板两列 */
  }
}

@media (max-width: 768px) {
  .hero h1 { font-size: 28px; }
  .featured-list {
    grid-template-columns: 1fr;  /* 移动端单列 */
  }
  .featured-card .cover { height: 180px; }
}