/**
 * Shiguang 拾光集 - 文章列表页样式
 */

/* ========== 页面头部 ========== */
.posts-header {
  padding: 120px 0 48px;
  text-align: center;
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg,
    rgba(108, 159, 255, 0.06) 0%,
    rgba(255, 184, 122, 0.03) 50%,
    transparent 100%);
}

.posts-header h1 {
  font-size: 2rem;
  font-weight: 700;
  margin-bottom: 12px;
  position: relative;
}

.posts-header p {
  font-size: 15px;
  color: var(--text-secondary);
  max-width: 500px;
  margin: 0 auto;
  position: relative;
}

/* ========== 分类筛选标签 ========== */
.posts-filter-section {
  position: sticky;
  top: var(--nav-height);
  z-index: 100;
  background: rgba(245, 247, 251, 0.92);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  padding: 16px 0;
  border-bottom: 1px solid var(--border);
}

.category-tabs {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding-bottom: 4px;
  scrollbar-width: none;
  -ms-overflow-style: none;
}

.category-tabs::-webkit-scrollbar {
  display: none;
}

.cat-tab {
  flex-shrink: 0;
  padding: 7px 20px;
  border-radius: var(--radius-full);
  font-size: 13px;
  font-weight: 500;
  color: var(--text-secondary);
  background: var(--card-solid);
  border: 1px solid var(--border);
  cursor: pointer;
  transition: all var(--transition);
  white-space: nowrap;
}

.cat-tab:hover {
  border-color: rgba(108, 159, 255, 0.3);
  color: var(--primary);
  background: rgba(108, 159, 255, 0.04);
}

.cat-tab.active {
  color: #fff;
  background: linear-gradient(135deg, var(--primary), var(--primary-dark));
  border-color: transparent;
  box-shadow: 0 2px 12px rgba(108, 159, 255, 0.25);
}

/* ========== 文章网格 ========== */
.posts-list-section {
  padding: 40px 0 60px;
  min-height: 400px;
}

.posts-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
}

/* ========== 文章卡片增强 ========== */
.posts-grid .post-card {
  opacity: 0;
  transform: translateY(20px);
  animation: cardFadeIn 0.5s ease forwards;
}

.posts-grid .post-card:nth-child(1) { animation-delay: 0.05s; }
.posts-grid .post-card:nth-child(2) { animation-delay: 0.1s; }
.posts-grid .post-card:nth-child(3) { animation-delay: 0.15s; }
.posts-grid .post-card:nth-child(4) { animation-delay: 0.2s; }
.posts-grid .post-card:nth-child(5) { animation-delay: 0.25s; }
.posts-grid .post-card:nth-child(6) { animation-delay: 0.3s; }
.posts-grid .post-card:nth-child(7) { animation-delay: 0.35s; }
.posts-grid .post-card:nth-child(8) { animation-delay: 0.4s; }
.posts-grid .post-card:nth-child(9) { animation-delay: 0.45s; }

@keyframes cardFadeIn {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

/* 置顶标记 */
.post-sticky-badge {
  position: absolute;
  top: 12px;
  left: 12px;
  padding: 3px 10px;
  border-radius: var(--radius-full);
  font-size: 11px;
  font-weight: 600;
  color: #fff;
  background: linear-gradient(135deg, var(--accent), #FF9A5C);
  box-shadow: 0 2px 8px rgba(255, 184, 122, 0.4);
  z-index: 2;
}

/* ========== 加载更多 ========== */
.load-more {
  text-align: center;
  padding: 40px 0 20px;
}

.load-more .btn {
  min-width: 140px;
}

.load-more .btn:disabled {
  opacity: 0.5;
  cursor: not-allowed;
}

/* 加载进度文字 */
.load-status {
  text-align: center;
  padding: 16px 0;
  font-size: 13px;
  color: var(--text-light);
}

/* ========== 搜索结果提示 ========== */
.search-result-info {
  padding: 16px 0 0;
  font-size: 14px;
  color: var(--text-secondary);
}

.search-result-info strong {
  color: var(--primary);
  font-weight: 600;
}

.search-result-info .clear-search {
  color: var(--text-light);
  text-decoration: underline;
  cursor: pointer;
  margin-left: 12px;
  font-size: 13px;
}

.search-result-info .clear-search:hover {
  color: var(--primary);
}

/* ========== 响应式 ========== */
@media (max-width: 1024px) {
  .posts-grid {
    grid-template-columns: repeat(2, 1fr);
    gap: 20px;
  }
}

@media (max-width: 768px) {
  .posts-header {
    padding: 100px 0 36px;
  }

  .posts-header h1 {
    font-size: 1.5rem;
  }

  .posts-grid {
    grid-template-columns: 1fr;
    gap: 16px;
  }

  .posts-filter-section {
    padding: 12px 0;
  }

  .cat-tab {
    padding: 6px 16px;
    font-size: 12px;
  }

  .posts-list-section {
    padding: 24px 0 40px;
  }
}

@media (max-width: 480px) {
  .posts-header {
    padding: 90px 0 28px;
  }

  .posts-header h1 {
    font-size: 1.3rem;
  }

  .search-box {
    flex-direction: row;
  }

  .search-box input {
    font-size: 13px;
  }

  .search-box button {
    padding: 8px 14px;
    font-size: 12px;
  }
}
