/* =========================================
   分类首页专属样式（全面磨砂化与对齐）
   ========================================= */


/* 标题行与“查看全部”按钮的布局 */
.section-header-opt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 1.5rem;
  padding-bottom: 0.5rem;
  border-bottom: 1px solid var(--border-color);
}
.section-header-opt h2 {
  font-size: 1.5rem;
  margin: 0;
  display: flex;
  align-items: center;
  gap: 8px;
}
.view-all-opt {
  color: var(--primary-color);
  text-decoration: none;
  font-size: 0.95rem;
  font-weight: 500;
  padding: 6px 16px;
  background: rgba(37, 99, 235, 0.08);
  border-radius: 20px;
  transition: all 0.2s ease;
}
.view-all-opt:hover {
  background: rgba(37, 99, 235, 0.15);
  transform: translateY(-1px);
}

/* 文章卡片列表 */
.articles-grid-opt {
  display: flex;
  flex-direction: column;
  gap: 20px;
}
.article-header-opt h3 {
  margin: 0 0 8px 0;
  font-size: 1.25rem;
  font-weight: 600;
  color: var(--text-primary);
}
.article-date {
  color: var(--text-secondary);
  font-size: 0.9rem;
}
.article-excerpt-opt {
  color: var(--text-secondary);
  font-size: 0.95rem;
  line-height: 1.6;
  margin: 12px 0;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.article-footer-opt {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-top: auto;
}
.tag-opt {
  background: rgba(37, 99, 235, 0.04);
  color: var(--primary-color);
  padding: 4px 12px;
  border-radius: 8px;
  font-size: 0.8rem;
  margin-right: 8px;
}
.read-more-opt {
  color: var(--primary-color);
  font-weight: 500;
  font-size: 0.9rem;
}

/* =========================================
   按月份浏览 & 标签云（去死白，统一质感）
   ========================================= */
.month-browse-section,
.secondary-section {
  margin: 2.5rem 0;
  padding: 1.5rem 0 0 0;
  border-top: 1px solid var(--border-color);
}

.tags-cloud-opt {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(100px, 1fr));
  gap: 1rem;
  margin-top: 1rem;
}

.tag-cloud-item {
  background: rgba(37, 99, 235, 0.04);
  color: var(--text-primary);
  padding: 12px 8px;
  border-radius: 12px;
  border: 1px solid rgba(37, 99, 235, 0.1);
  text-decoration: none;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  transition: all 0.2s ease;
  box-sizing: border-box;
}
.tag-cloud-item:hover {
  background: rgba(37, 99, 235, 0.1);
  border-color: var(--primary-color);
  color: var(--primary-color);
  transform: translateY(-2px);
}
.tag-name {
  white-space: nowrap;
  font-size: 0.95rem;
  font-weight: 500;
}
.tag-cloud-item.has-posts {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary-color);
  font-weight: 600;
}
.tag-count-opt {
  background: rgba(37, 99, 235, 0.08);
  color: var(--primary-color);
  padding: 2px 10px;
  border-radius: 10px;
  font-size: 0.75rem;
  font-weight: 600;
  font-family: monospace;
  display: inline-block;
  line-height: 1.2;
}

/* 深色模式统一适配 */
body.dark-theme .article-opt,
body.dark-theme .tag-cloud-item {
  background: rgba(255, 255, 255, 0.03); /* 对齐深色模式下的邀请卡片 */
  border-color: rgba(255, 255, 255, 0.08);
}

/* 移动端 */
@media (max-width: 768px) {
  .article-link-opt {
    flex-direction: column;
    align-items: stretch;
    padding: 16px;
  }
  .article-cover-opt {
    width: 100%;
    height: 200px;
  }
  .page-title-compact {
    gap: 8px;
  }
  .title-text {
    font-size: 1.8rem;
  }
}


/* =========================================
   分类首页：按月份浏览（年份胶囊）
   ========================================= */
.year-chip {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 80px;
  padding: 0.55rem 1.2rem;
  background: rgba(37, 99, 235, 0.04);
  color: var(--text-primary);
  border: 1px solid rgba(37, 99, 235, 0.1);
  border-radius: 25px;
  font-size: 0.95rem;
  font-weight: 500;
  text-decoration: none;
  transition: all 0.2s ease;
}

.year-chip:hover {
  background: rgba(37, 99, 235, 0.1);
  color: var(--primary-color);
  border-color: var(--primary-color);
  transform: translateY(-1px);
  box-shadow: 0 4px 12px rgba(37, 99, 235, 0.15);
}

/* 如果开启了“更多年份”按钮，也一并美化 */
.year-toggle {
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  padding: 0.5rem 1.2rem;
  background: transparent;
  color: var(--primary-color);
  border: 1px solid rgba(37, 99, 235, 0.2);
  border-radius: 25px;
  font-size: 0.9rem;
  cursor: pointer;
  transition: all 0.2s ease;
  font-family: inherit;
  margin-top: 0.3rem;
}
.year-toggle:hover {
  background: rgba(37, 99, 235, 0.05);
  border-color: var(--primary-color);
}
