/* ======================
   ARTICLES.CSS — 文章列表页
   ====================== */

.articles-hero {
  /* 继承全局 page-hero 渐变，仅调整内边距以容纳搜索工具 */
  background:
    radial-gradient(ellipse 70% 80% at 80% 0%, rgba(212, 175, 55, 0.14), transparent 50%),
    linear-gradient(165deg, #1a2332 0%, #0f1825 100%);
  padding: 56px 0 0;
  text-align: center;
  color: #fff;
}
.articles-hero .page-hero-badge {
  margin-bottom: 18px;
}
.articles-hero h1 {
  font-size: 34px;
  font-weight: 700;
  color: #fff;
  margin: 0 0 12px;
  letter-spacing: -0.02em;
}
.articles-hero-desc {
  font-size: 14px;
  color: rgba(255, 255, 255, 0.72);
  max-width: 560px;
  margin: 0 auto 28px;
  line-height: 1.7;
}

.articles-hero .breadcrumb {
  justify-content: center;
  margin-bottom: 14px;
}
.articles-hero .breadcrumb a { color: rgba(255, 255, 255, 0.72); }
.articles-hero .breadcrumb a:hover { color: var(--color-accent); }
.articles-hero .breadcrumb-sep { color: rgba(255, 255, 255, 0.35); }
.articles-hero .breadcrumb-current {
  color: #fff !important;
  font-weight: 650;
}

/* ========== TAG 聚合 / 索引 ========== */
.tag-hero .articles-hero-desc strong {
  color: var(--color-accent);
  font-weight: 700;
}
.tag-hero-back {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 28px;
  padding: 10px 18px;
  border-radius: 999px;
  border: 1px solid rgba(212, 175, 55, 0.45);
  background: rgba(212, 175, 55, 0.12);
  color: var(--color-accent);
  font-size: 13px;
  font-weight: 650;
  text-decoration: none;
  transition: background 0.2s, transform 0.2s;
}
.tag-hero-back:hover {
  background: rgba(212, 175, 55, 0.22);
  color: #f5d76e;
  transform: translateY(-1px);
}

.tag-list-section,
.tag-index-section {
  padding-top: 36px;
}

.tag-cloud-wrap {
  background: #fff;
  border: 1px solid var(--border-color);
  border-radius: 16px;
  padding: 28px 24px 22px;
  box-shadow: 0 1px 3px rgba(26, 35, 50, 0.04);
}
.tag-cloud-header {
  text-align: center;
  margin-bottom: 22px;
}
.tag-cloud-header h2 {
  margin: 0 0 8px;
  font-size: 22px;
  color: var(--text-title);
  font-weight: 700;
}
.tag-cloud-header h2 small {
  font-size: 13px;
  font-weight: 500;
  color: var(--text-muted);
  margin-left: 8px;
}
.tag-cloud-header p {
  margin: 0;
  font-size: 13.5px;
  color: var(--text-muted);
}
.tag-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
}
.tag-cloud-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 14px;
  border-radius: 999px;
  background: #f8fafc;
  border: 1px solid #e8edf3;
  color: var(--text-body);
  text-decoration: none;
  font-size: 13px;
  transition: border-color 0.15s, background 0.15s, color 0.15s, transform 0.15s;
}
.tag-cloud-item:hover {
  border-color: rgba(212, 175, 55, 0.55);
  background: #fffbeb;
  color: var(--text-title);
  transform: translateY(-1px);
}
.tag-cloud-item .tag-count {
  font-size: 11px;
  color: var(--text-muted);
}
.tag-cloud-item.size-4,
.tag-cloud-item.size-5,
.tag-cloud-item.size-6 {
  font-weight: 650;
}
.tag-pagination-wrap {
  margin-top: 28px;
  display: flex;
  justify-content: center;
}

.related-tags-section {
  background: var(--bg-gray-light, #f5f7fa);
}
.related-tags-cloud {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  justify-content: center;
  margin-top: 8px;
}
.related-tags-cloud .tag-cloud-item {
  background: #fff;
}

@media (max-width: 768px) {
  .tag-hero {
    padding: 22px 0 0;
    text-align: center;
  }
  .tag-hero .breadcrumb {
    margin-bottom: 10px;
    font-size: 12px;
  }
  .tag-hero .page-hero-badge {
    margin-bottom: 12px;
  }
  .tag-hero h1 {
    font-size: 24px;
    margin-bottom: 8px;
    letter-spacing: -0.03em;
  }
  .tag-hero .articles-hero-desc {
    font-size: 13px;
    margin-bottom: 16px;
    padding: 0 8px;
  }
  .tag-hero-back {
    width: calc(100% - 32px);
    max-width: 260px;
    margin-bottom: 22px;
    padding: 11px 16px;
  }
  .tag-list-section,
  .tag-index-section {
    padding-top: 18px;
    padding-bottom: 24px;
  }
  .tag-list-section .articles-grid {
    gap: 12px;
  }
  .tag-list-section .article-card {
    border-radius: 12px;
  }
  .tag-list-section .article-card-media {
    aspect-ratio: 16 / 9;
  }
  .tag-list-section .article-card-excerpt {
    display: -webkit-box;
    -webkit-line-clamp: 2;
    -webkit-box-orient: vertical;
    overflow: hidden;
  }
  .tag-cloud-wrap {
    padding: 18px 12px 14px;
    border-radius: 14px;
  }
  .tag-cloud-header {
    margin-bottom: 16px;
    text-align: left;
  }
  .tag-cloud-header h2 { font-size: 17px; }
  .tag-cloud {
    gap: 8px;
    justify-content: flex-start;
  }
  .tag-cloud-item {
    padding: 7px 12px;
    font-size: 12.5px;
  }
  .related-tags-section {
    padding-top: 28px;
    padding-bottom: 28px;
  }
  .related-tags-section .section-title { font-size: 18px; margin-bottom: 6px; }
  .related-tags-section .section-desc {
    font-size: 13px;
    margin-bottom: 16px;
  }
  .related-tags-cloud {
    justify-content: flex-start;
  }
}

.articles-hero-tools {
  max-width: 760px;
  margin: 0 auto;
  padding: 0 16px 36px;
}
.articles-search {
  position: relative;
  width: 100%;
  margin-bottom: 18px;
}
.search-icon {
  position: absolute;
  left: 16px;
  top: 50%;
  transform: translateY(-50%);
  color: #94a3b8;
  pointer-events: none;
}
.search-input {
  width: 100%;
  padding: 14px 18px 14px 46px;
  border: none;
  border-radius: var(--radius-pill);
  font-size: 14px;
  color: var(--text-title);
  background: #fff;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.18);
  font-family: inherit;
}
.search-input:focus {
  outline: none;
  box-shadow: 0 0 0 3px rgba(212, 175, 55, 0.35), 0 8px 28px rgba(0, 0, 0, 0.18);
}
.search-input::placeholder { color: #94a3b8; }

.articles-filter {
  display: flex;
  justify-content: center;
  flex-wrap: wrap;
  gap: 8px;
}
.articles-filter .filter-tag {
  padding: 8px 18px;
  border-radius: var(--radius-pill);
  font-size: 13px;
  font-weight: 500;
  color: rgba(255, 255, 255, 0.78);
  background: transparent;
  border: 1px solid rgba(255, 255, 255, 0.22);
  text-decoration: none;
  transition: all 0.2s ease;
}
.articles-filter .filter-tag:hover {
  border-color: var(--color-accent);
  color: #fff;
}
.articles-filter .filter-tag.active {
  background: var(--color-accent);
  border-color: var(--color-accent);
  color: #1a2332;
  font-weight: 700;
}

.articles-section {
  padding-top: 40px;
  background: #f5f6f8;
}

.articles-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 24px;
  margin-bottom: 48px;
}
.articles-grid:not(:has(.article-card)) {
  display: none;
  margin: 0;
  gap: 0;
}

a.article-card,
.article-card {
  display: flex;
  flex-direction: column;
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: 0 1px 3px rgba(26, 35, 50, 0.04);
  transition: transform 0.3s ease, box-shadow 0.3s ease, border-color 0.3s ease;
  text-decoration: none;
  color: inherit;
  cursor: pointer;
  min-width: 0;
  position: relative;
}
a.article-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: linear-gradient(180deg, var(--color-accent), transparent 80%);
  opacity: 0;
  transition: opacity 0.25s;
  z-index: 1;
}
.article-card:hover {
  transform: translateY(-4px);
  box-shadow: 0 16px 40px rgba(26, 35, 50, 0.1);
  border-color: rgba(212, 175, 55, 0.35);
}
a.article-card:hover::before {
  opacity: 1;
}

/* 封面区：有图显示缩略图，无图用 img_class 占位渐变 */
.article-card-media {
  position: relative;
  display: block;
  aspect-ratio: 16 / 10;
  overflow: hidden;
  background: #1a2233;
  flex-shrink: 0;
}
.article-card-media img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  transition: transform 0.35s ease;
}
a.article-card:hover .article-card-media img,
.article-card:hover .article-card-media img {
  transform: scale(1.04);
}
.article-card-img-variant1 {
  background:
    linear-gradient(145deg, rgba(212, 175, 55, 0.28), transparent 55%),
    linear-gradient(180deg, #1a2233 0%, #2c3a4f 100%);
}
.article-card-img-variant2 {
  background:
    linear-gradient(145deg, rgba(148, 163, 184, 0.35), transparent 50%),
    linear-gradient(180deg, #334155 0%, #475569 100%);
}
.article-card-img-variant3 {
  background:
    linear-gradient(145deg, rgba(212, 175, 55, 0.18), transparent 50%),
    linear-gradient(180deg, #e8edf3 0%, #c5ced9 100%);
}

.article-card-body {
  padding: 22px 22px 20px;
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.article-card-meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 14px;
}
.article-card-meta .article-tag {
  flex-shrink: 0;
}
.article-date {
  font-size: 12px;
  color: var(--text-muted);
  white-space: nowrap;
}

.article-card-title {
  font-size: 17px;
  color: var(--text-title);
  font-weight: 700;
  line-height: 1.45;
  margin: 0 0 10px;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}
a.article-card:hover .article-card-title {
  color: var(--color-primary);
}

.article-card-excerpt {
  font-size: 13.5px;
  color: var(--text-muted);
  line-height: 1.75;
  margin: 0 0 18px;
  flex: 1;
  display: -webkit-box;
  -webkit-line-clamp: 3;
  -webkit-box-orient: vertical;
  overflow: hidden;
  word-break: break-word;
}

.article-card-footer {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px 14px;
  padding-top: 14px;
  border-top: 1px solid var(--border-color);
  font-size: 12px;
  color: var(--text-muted);
}
.article-author {
  font-weight: 600;
  color: var(--text-body);
}
.article-views {
  margin-right: auto;
}
.article-more {
  font-size: 13px;
  font-weight: 600;
  color: var(--color-accent);
  transition: transform 0.2s ease;
}
a.article-card:hover .article-more {
  transform: translateX(3px);
}

.pagination-wrap {
  display: flex;
  justify-content: center;
  padding: 28px 0 20px;
  margin-top: 8px;
}
.pagination {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.pagination a,
.pagination span,
.pagination button {
  min-width: 38px;
  height: 38px;
  padding: 0 10px;
  border-radius: var(--radius-sm);
  font-size: 14px;
  color: var(--text-body);
  background: var(--bg-card);
  border: 1px solid var(--border-color);
  cursor: pointer;
  transition: all 0.2s;
  font-family: inherit;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  text-decoration: none;
}
.pagination a:hover,
.pagination button:hover:not(:disabled) {
  border-color: var(--color-accent);
  color: var(--text-title);
}
.pagination .active,
.pagination span.active,
.pagination button.active {
  background: var(--color-primary);
  border-color: var(--color-primary);
  color: #fff;
  font-weight: 600;
  cursor: default;
}
.pagination .ellipsis,
.pagination .page-ellipsis {
  border: none;
  background: transparent;
  color: var(--text-muted);
  cursor: default;
}
.pagination .disabled {
  opacity: 0.45;
  cursor: default;
  pointer-events: none;
}

.empty-state {
  grid-column: 1 / -1;
  text-align: center;
  padding: 60px 20px;
  background: #fff;
  border-radius: var(--radius-lg);
  border: 1px dashed var(--border-color);
}
.empty-state p {
  font-size: 14px;
  color: var(--text-muted);
  margin: 0;
}

/* 频道封面页 index_article */
.category-cover-hero {
  padding: 36px 0 28px;
  background: linear-gradient(180deg, #f4f6f9 0%, #fff 100%);
  border-bottom: 1px solid var(--border-color);
}
.category-cover-head {
  display: grid;
  grid-template-columns: minmax(0, 280px) minmax(0, 1fr);
  gap: 28px;
  align-items: center;
}
.category-cover-img {
  border-radius: var(--radius-lg);
  overflow: hidden;
  aspect-ratio: 4 / 3;
  background: #1a2233;
}
.category-cover-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.category-cover-copy h1 {
  margin: 10px 0 12px;
  font-size: clamp(26px, 3vw, 34px);
  line-height: 1.3;
  color: var(--text-title);
}
@media (max-width: 768px) {
  .category-cover-head { grid-template-columns: 1fr; }
}

@media (max-width: 1024px) {
  .articles-grid { grid-template-columns: repeat(2, 1fr); }
  .articles-hero h1 { font-size: 28px; }
}
@media (max-width: 768px) {
  .articles-grid { grid-template-columns: 1fr; }
  .articles-filter {
    justify-content: flex-start;
    flex-wrap: nowrap;
    overflow-x: auto;
    padding-bottom: 4px;
    -webkit-overflow-scrolling: touch;
  }
  .articles-filter .filter-tag { flex-shrink: 0; }
}
