/* ============================================================
   链接页（links.html + js/links.js）
   ----------------------------------------------------
   两块：友情链接（卡片网格 + 空态）、收藏夹（分组筛选 + 本地搜索）。
   颜色与材质沿用站点令牌：星光蓝 #8FB8FF / 暗底 #030712 / 次要字 #86868B / --hairline 发丝线。
   筛选胶囊 .chips/.arc-chip 复用 css/style.css 里的共用定义。
   ============================================================ */

.links-section {
  margin-top: 2.2rem;
}
.links-section > h2 {
  margin-bottom: 0.8rem;
  color: #f5f5f7;
  font-size: 15px;
  font-weight: 600;
}
.links-section > h2 .links-sub {
  margin-left: 0.5rem;
  color: #86868b;
  font-size: 11.5px;
  font-weight: 400;
}

/* ---------- 友链申请说明 ---------- */
.links-note {
  margin-bottom: 1rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: rgba(18, 20, 27, 0.5);
  color: #86868b;
  font-size: 12px;
  line-height: 1.8;
}
.links-note a {
  color: #8fb8ff;
  text-decoration: none;
}
.links-note a:hover {
  text-decoration: underline;
  text-underline-offset: 3px;
}
/* 空态样式（.empty-state）在 css/style.css 里，与连载页书架共用 */

/* ---------- 友链卡片 ---------- */
.link-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(240px, 1fr));
  gap: 12px;
}
.link-card {
  display: flex;
  align-items: center;
  gap: 0.7rem;
  padding: 0.8rem 0.9rem;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: rgba(18, 20, 27, 0.5);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.25s var(--ease-swift);
}
.link-card:hover {
  border-color: rgba(143, 184, 255, 0.38);
  transform: translateY(-2px);
}
.link-avatar {
  display: grid;
  flex: 0 0 auto;
  place-items: center;
  width: 36px;
  height: 36px;
  overflow: hidden;
  border-radius: 10px;
  background: linear-gradient(140deg, #23294d, #0e1428);
  color: #b9c8ff;
  font-weight: 700;
}
.link-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.link-body {
  min-width: 0;
}
.link-body b {
  display: block;
  color: #f5f5f7;
  font-size: 13px;
}
.link-desc {
  display: -webkit-box;
  overflow: hidden;
  margin-top: 2px;
  color: #86868b;
  font-size: 11.5px;
  line-height: 1.6;
  -webkit-box-orient: vertical;
  -webkit-line-clamp: 2;
}

/* ---------- 收藏夹 ---------- */
.bm-toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.5rem 0.8rem;
  margin: 1.4rem 0 0.2rem;
}
.bm-toolbar .chips {
  margin: 0;
}
.bm-search {
  position: relative;
  display: flex;
  align-items: center;
  gap: 0.45rem;
  margin-left: auto;
  padding: 0.3rem 0.7rem;
  border: 1px solid rgba(255, 255, 255, 0.12);
  border-radius: 9999px;
  background: rgba(255, 255, 255, 0.04);
}
.bm-search svg {
  width: 13px;
  height: 13px;
  color: #86868b;
  flex: 0 0 auto;
}
.bm-search input {
  width: 10rem;
  border: 0;
  background: transparent;
  color: #f5f5f7;
  font-size: 12px;
  outline: none;
}
.bm-search input::placeholder {
  color: #86868b;
}
.bm-list {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 12px;
  margin-top: 0.9rem;
}
.bm-card {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
  padding: 0.85rem 0.95rem;
  border: 1px solid var(--hairline);
  border-radius: 12px;
  background: rgba(18, 20, 27, 0.5);
  color: inherit;
  text-decoration: none;
  transition: border-color 0.2s ease, transform 0.25s var(--ease-swift);
}
.bm-card:hover {
  border-color: rgba(143, 184, 255, 0.38);
  transform: translateY(-2px);
}
.bm-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.5rem;
}
.bm-head b {
  color: #f5f5f7;
  font-size: 13px;
}
.bm-group {
  flex: 0 0 auto;
  color: rgba(158, 176, 202, 0.6);
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 10.5px;
}
.bm-desc {
  color: #86868b;
  font-size: 11.5px;
  line-height: 1.65;
}
.bm-tags {
  margin-top: 0.1rem;
  color: rgba(143, 184, 255, 0.75);
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  font-size: 10.5px;
}

@media (max-width: 640px) {
  .bm-search {
    margin-left: 0;
    width: 100%;
  }
  .bm-search input {
    width: 100%;
  }
}
@media (prefers-reduced-motion: reduce) {
  .link-card,
  .bm-card {
    transition: none;
  }
  .link-card:hover,
  .bm-card:hover {
    transform: none;
  }
}
