/* Friend Links (友链) – refined, clean, site-consistent */

.rw-friends{ padding: 0 0 10px; }
.rw-friends-module{ margin: 0 0 14px; }

.rw-friends-head{ display:flex; flex-direction: column; gap: 4px; }
.rw-friends-sub{ font-size: 12px; color: var(--muted); }

.rw-friends-grid{
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
}
@media (max-width: 980px){
  .rw-friends-grid{ grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 520px){
  .rw-friends-grid{ grid-template-columns: 1fr; }
}

.rw-friend-card{
  display: block;
  text-decoration: none;
  color: inherit;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: rgba(249,250,251,.72);
  padding: 12px;
  transition: transform .18s var(--ease-out), background-color .18s var(--ease-out), border-color .18s var(--ease-out), box-shadow .18s var(--ease-out);
}
html[data-theme="dark"] .rw-friend-card{ background: rgba(255,255,255,.03); }

.rw-friend-card-top{ display:flex; align-items: center; gap: 10px; }

.rw-friend-icon{
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--border);
  background: var(--card);
  color: var(--muted);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-shadow: 0 1px 0 rgba(17,24,39,.04);
}
.rw-friend-icon i{ font-size: 16px; }
.rw-friend-icon--empty{ opacity: .55; }

.rw-friend-main{ min-width: 0; flex: 1 1 auto; }

.rw-friend-name{
  font-weight: 800;
  font-size: 14px;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rw-friend-badge{
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin-left: 8px;
  height: 18px;
  padding: 0 8px;
  border-radius: 999px;
  border: 1px solid rgba(59,130,246,.25);
  background: rgba(59,130,246,.10);
  color: var(--primary-2);
  font-size: 11px;
  font-weight: 800;
}
html[data-theme="dark"] .rw-friend-badge{
  border-color: rgba(96,165,250,.22);
  background: rgba(96,165,250,.10);
  color: var(--primary);
}

.rw-friend-desc{
  margin-top: 4px;
  font-size: 12px;
  color: var(--muted);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.rw-friend-go{
  flex: 0 0 auto;
  color: var(--muted2);
  transition: transform .18s var(--ease-out), color .18s var(--ease-out);
}

@media (hover:hover){
  .rw-friend-card:hover{
    border-color: rgba(59,130,246,.28);
    background: rgba(59,130,246,.06);
    transform: translateY(-1px);
    box-shadow: 0 10px 24px rgba(17,24,39,.08);
  }
  html[data-theme="dark"] .rw-friend-card:hover{
    border-color: rgba(96,165,250,.22);
    background: rgba(96,165,250,.08);
    box-shadow: 0 18px 36px rgba(0,0,0,.45);
  }
  .rw-friend-card:hover .rw-friend-go{ color: var(--primary); transform: translateY(-1px); }
  .rw-friend-card:hover .rw-friend-icon{ border-color: rgba(59,130,246,.22); color: var(--primary); }
}

@media (hover:none){
  .rw-friend-card:active{ transform: translateY(-1px); }
}

@media (prefers-reduced-motion: reduce){
  .rw-friend-card{ transition: background-color .18s ease, border-color .18s ease; }
  .rw-friend-go{ transition: none; }
}
