/* ============================================================
   KRONOS ZHOU · 文章和帖子列表页样式（Cosmic 版）
   路径：articles/article-list.css
   ------------------------------------------------------------
   公共部分（页面标题区 / 搜索条 / 卡片底 / 空状态）在
   shared/index-page.css，这里只写这一页独有的东西：

     · 年份筛选按钮 .filter-btn（本页自己的芯片样式）
     · 文章条目 .article-item（网格：日期 | 正文 | 箭头）
     · 加载失败时那段兜底文案里的 <span>

   引用顺序：../main-page.css → ../shared/index-page.css → 本文件
   （以前这套样式是直接写在 article-list.html 的 <style> 里的，
     挪出来是为了和其它五个列表页放一起，好对照着改。）
   ============================================================ */

/* ============================================================
   1. 年份筛选栏
   ============================================================ */
.article-filters {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 1rem;
  flex-wrap: wrap;
  margin-bottom: 1.5rem;
}

.filter-group {
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}

.filter-btn {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.05rem;
  border-radius: 999px;
  border: 1px solid var(--border-soft);
  background: var(--bg-elevated);
  color: var(--text-secondary);
  font: inherit;
  font-size: 0.8125rem;
  font-weight: 500;
  letter-spacing: 0.02em;
  cursor: pointer;
  white-space: nowrap;
  transition: color 200ms ease, border-color 200ms ease,
              background 200ms ease, transform 200ms ease;
}

.filter-btn:hover {
  color: var(--text-primary);
  border-color: rgba(137, 170, 204, 0.5);
  transform: translateY(-1px);
}

/* 选中：走强调色渐变 + 近黑字（和列表页的 chip 保持一致） */
.filter-btn.active {
  color: #0a0a0a;
  background: linear-gradient(90deg, var(--grad-from, #89aacc), var(--grad-to, #4e85bf));
  border-color: transparent;
}

.filter-btn:active {
  transform: translateY(0) scale(0.97);
}

.filter-btn:focus-visible {
  outline: 2px solid var(--accent-solid-soft, #89aacc);
  outline-offset: 2px;
}

.article-count {
  font-size: 0.8125rem;
  color: var(--text-muted);
  letter-spacing: 0.06em;
  font-variant-numeric: tabular-nums;
  white-space: nowrap;
}

/* ============================================================
   2. 列表主体
   ============================================================ */
.article-list-section {
  margin-bottom: 2rem;
  flex: 1 0 auto;
}

.article-list {
  display: flex;
  flex-direction: column;
  gap: 0.75rem;
}

/* 一条文章：横向胶囊，日期 | 标题+摘要 | 箭头 */
.article-item {
  display: grid;
  grid-template-columns: 110px 1fr auto;
  align-items: center;
  gap: 1.4rem;
  padding: 1.15rem 1.5rem;
  background: var(--bg-block);
  border: 1px solid var(--border-soft);
  border-radius: 40px;
  color: inherit;
  text-decoration: none;
  transition: background 260ms ease, border-color 260ms ease,
              transform 260ms cubic-bezier(0.2, 0.9, 0.4, 1);
}

.article-item:hover {
  background: var(--bg-block-hover);
  border-color: rgba(137, 170, 204, 0.45);
  transform: translateX(4px);
}

.article-item:focus-visible {
  outline: 2px solid var(--accent-solid-soft, #89aacc);
  outline-offset: 3px;
}

.article-item-date {
  font-size: 0.75rem;
  color: var(--text-muted);
  font-variant-numeric: tabular-nums;
  letter-spacing: 0.14em;
  white-space: nowrap;
}

.article-item-body {
  display: flex;
  flex-direction: column;
  gap: 0.3rem;
  min-width: 0;
}

.article-item-title {
  font-size: 1rem;
  font-weight: 500;
  color: var(--text-primary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-item-summary {
  font-size: 0.8125rem;
  color: var(--text-secondary);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.article-item-arrow {
  font-size: 1.05rem;
  color: var(--text-muted);
  transition: transform 260ms ease, color 260ms ease;
}

.article-item:hover .article-item-arrow {
  transform: translateX(6px);
  color: var(--accent-solid-soft, #89aacc);
}

/* 加载失败 / 没有文章时的兜底文案 */
.article-list-empty {
  padding: 3rem 1.25rem;
  text-align: center;
  font-size: 0.9375rem;
  color: var(--text-muted);
  line-height: 1.8;
  background: var(--bg-block);
  border: 1px dashed var(--border-soft);
  border-radius: 1.5rem;
}

/* 兜底文案里那行小字（JS 内联写的 <span>） */
.article-list-empty span {
  font-size: 0.8125rem;
  color: var(--text-muted);
  opacity: 0.85;
}

/* ============================================================
   3. 窄屏
   ============================================================ */
@media (max-width: 900px) {
  .article-item {
    grid-template-columns: 1fr auto;
    gap: 0.8rem;
    border-radius: 28px;
    padding: 1rem 1.15rem;
  }

  .article-item-date {
    grid-column: 1 / -1;
  }

  .article-item-title,
  .article-item-summary {
    white-space: normal;
  }

  .article-count {
    margin-left: 0;
  }
}

@media (max-width: 520px) {
  .article-item {
    border-radius: 1.5rem;
  }
}
