/* ═══════════════════════════════════════════════════════
   Home to 洗礼 — 友情链接
   ═══════════════════════════════════════════════════════ */

.links-view { flex-direction: column; }

.links-layout {
  flex: 1;
  width: 100%;
  max-width: 920px;
  margin: 0 auto;
  padding: clamp(20px, 4vh, 44px) clamp(16px, 4vw, 48px) 32px;
  display: flex;
  flex-direction: column;
  overflow-y: auto;
}

.links-header {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 22px;
}
.links-header h2 {
  margin: 0;
  font-family: 'Playfair Display', 'Noto Sans SC', serif;
  font-size: clamp(22px, 2.6vw, 30px);
  color: var(--text-primary, #33302b);
}
.links-header p {
  margin: 8px 0 0;
  font-size: 13.5px;
  font-weight: 300;
  letter-spacing: .05em;
  color: var(--text-secondary, #8a857c);
}
.btn-add-link {
  border: none;
  border-radius: 12px;
  padding: 10px 18px;
  font-size: 13.5px;
  font-weight: 700;
  letter-spacing: .08em;
  color: #fff;
  background: linear-gradient(135deg, #6b7fc4, #8e6b8a);
  cursor: pointer;
  box-shadow: 0 6px 16px -6px rgba(107, 127, 196, .6);
  transition: transform .2s, filter .2s;
  font-family: inherit;
  display: none;
}
.btn-add-link.visible { display: inline-block; }
.btn-add-link:hover { transform: translateY(-2px); filter: brightness(1.06); }

/* ── 友链卡片网格 ── */
.links-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(260px, 1fr));
  gap: 16px;
}
.friend-card {
  --link-hue: #6b7fc4;
  position: relative;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 18px 18px 18px 16px;
  border-radius: 16px;
  border: 1px solid var(--line-color, #e8e1d2);
  background: var(--bg-primary, #fffdf8);
  text-decoration: none;
  overflow: hidden;
  transition: transform .25s, box-shadow .25s, border-color .25s;
}
.friend-card::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 4px;
  background: var(--link-hue);
  opacity: .8;
}
.friend-card:hover {
  transform: translateY(-3px);
  border-color: color-mix(in srgb, var(--link-hue) 45%, transparent);
  box-shadow: 0 12px 26px -12px color-mix(in srgb, var(--link-hue) 40%, transparent);
}
.friend-avatar {
  width: 52px;
  height: 52px;
  flex-shrink: 0;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 25px;
  background:
    radial-gradient(85% 100% at 25% 12%, color-mix(in srgb, var(--link-hue) 22%, transparent), transparent 72%),
    var(--bg-secondary, #f2ede2);
}
.friend-info { flex: 1; min-width: 0; }
.friend-name {
  font-size: 15px;
  font-weight: 700;
  color: var(--text-primary, #33302b);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.friend-desc {
  margin-top: 4px;
  font-size: 12.5px;
  font-weight: 300;
  line-height: 1.55;
  color: var(--text-secondary, #8a857c);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.friend-open {
  flex-shrink: 0;
  font-size: 13px;
  color: var(--text-muted, #b0a898);
  transition: color .2s, transform .2s;
}
.friend-card:hover .friend-open { color: var(--link-hue); transform: translate(2px, -2px); }

.fl-tools {
  position: absolute;
  top: 10px;
  right: 10px;
  display: none;
  gap: 6px;
  z-index: 2;
}
.friend-card:hover .fl-tools { display: flex; }
.fl-tools button {
  width: 24px;
  height: 24px;
  border: none;
  border-radius: 50%;
  font-size: 11px;
  cursor: pointer;
  color: #fff;
  background: rgba(40, 30, 24, .45);
  transition: background .2s;
}
.fl-tools button:hover { background: #6b7fc4; }
.fl-tools button.del:hover { background: #c0504a; }

.links-empty {
  text-align: center;
  padding: 60px 0;
  color: var(--text-muted, #b0a898);
  font-size: 14px;
  letter-spacing: .08em;
}
.links-note {
  margin-top: 22px;
  text-align: center;
  font-size: 12.5px;
  letter-spacing: .1em;
  color: var(--text-muted, #b0a898);
}

/* ═══════════ 编辑弹窗 ═══════════ */
.links-modal {
  position: fixed;
  inset: 0;
  z-index: 310;
  display: none;
}
.links-modal.open { display: block; }
.links-modal-backdrop {
  position: absolute;
  inset: 0;
  background: rgba(20, 16, 12, .45);
  backdrop-filter: blur(4px);
}
.links-modal-card {
  position: relative;
  width: min(440px, calc(100vw - 32px));
  margin: 10vh auto 0;
  background: var(--bg-primary, #faf8f5);
  border-radius: 18px;
  padding: 26px 26px 22px;
  box-shadow: 0 24px 60px -18px rgba(20, 14, 8, .5);
}
.links-modal-close {
  position: absolute;
  top: 12px;
  right: 14px;
  border: none;
  background: none;
  font-size: 16px;
  cursor: pointer;
  color: var(--text-muted, #b0a898);
}
.links-modal-title {
  margin: 0 0 12px;
  font-size: 18px;
  font-weight: 700;
  color: var(--text-primary, #33302b);
}
.links-form label {
  display: block;
  margin: 12px 0 6px;
  font-size: 12.5px;
  letter-spacing: .08em;
  color: var(--text-secondary, #8a857c);
}
.links-form .row2 { display: grid; grid-template-columns: 88px 1fr; gap: 10px; }
.links-form input {
  width: 100%;
  box-sizing: border-box;
  border: 1.5px solid color-mix(in srgb, #6b7fc4 30%, #d8d0c2);
  border-radius: 10px;
  background: color-mix(in srgb, #6b7fc4 4%, #fff);
  padding: 10px 12px;
  font-size: 14px;
  font-family: inherit;
  color: var(--text-primary, #33302b);
  outline: none;
  transition: border-color .2s;
}
.links-form input:focus { border-color: #6b7fc4; }
.links-form .lf-hint {
  margin: 8px 0 0;
  font-size: 11.5px;
  color: var(--text-muted, #b0a898);
}
.btn-save-link {
  margin-top: 18px;
  width: 100%;
  border: none;
  border-radius: 12px;
  padding: 12px;
  font-size: 14.5px;
  font-weight: 700;
  letter-spacing: .1em;
  color: #fff;
  background: linear-gradient(135deg, #6b7fc4, #8e6b8a);
  cursor: pointer;
  transition: filter .2s, transform .15s;
}
.btn-save-link:hover { filter: brightness(1.08); }
.btn-save-link:active { transform: scale(.98); }
.btn-del-link {
  margin-top: 10px;
  width: 100%;
  border: 1.5px solid #e3c4c0;
  background: none;
  border-radius: 12px;
  padding: 10px;
  font-size: 13px;
  color: #c0504a;
  cursor: pointer;
  font-family: inherit;
  display: none;
}
.btn-del-link:hover { background: #fdf0ee; }
