/* 友情链接 —— 页面模板（page-links.php）与侧栏卡片 */

.link-card-body { padding: 14px; }
.link-cat-desc {
  margin: 0 0 12px;
  font-size: 12px;
  color: var(--text-muted);
}

.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 10px;
}

.link-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  background: var(--surface-2);
  color: var(--text);
  text-decoration: none;
  transition: border-color .15s, background .15s, box-shadow .15s;
}
.link-item:hover {
  border-color: var(--primary);
  background: var(--surface);
  box-shadow: var(--shadow-sm);
}

/* 图标尺寸钉死：外站图片的固有尺寸不可控，只靠 width/height 属性会被 CSS 覆盖后跑形 */
.link-item .link-logo {
  width: 40px; height: 40px;
  max-width: none;
  border-radius: var(--radius-sm);
  object-fit: cover;
  background: var(--surface);
  flex-shrink: 0;
}
/* 无图标时的兜底色块由 jixia_avatar_block() 输出，带 .thread-avatar 类（圆形），
   这里改成和图片一致的圆角方形，同一行里不会一个圆一个方 */
.link-item .link-logo-fallback { border-radius: var(--radius-sm); }

.link-item .link-main { min-width: 0; flex: 1; }
.link-item .link-name {
  font-size: 14px;
  font-weight: 600;
  line-height: 1.4;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.link-item:hover .link-name { color: var(--primary); }
.link-item .link-desc {
  margin-top: 2px;
  font-size: 12px;
  line-height: 1.5;
  color: var(--text-muted);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}

/* 侧栏卡片：纯文字链，两列排布 */
.side-links {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px 10px;
}
.side-links li { min-width: 0; }
.side-links a {
  display: block;
  font-size: 13px;
  color: var(--text-muted);
  text-decoration: none;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.side-links a:hover { color: var(--primary); }

@media (max-width: 480px) {
  .link-grid { grid-template-columns: 1fr; }
}
