/* ===== 联系人视图 ===== */
.cv-root { display: flex; flex-direction: column; height: 100%; }

.cv-topbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 0 0 20px;
  gap: 16px;
}

.cv-search-wrap {
  flex: 1;
  max-width: 480px;
  display: flex;
  align-items: center;
  gap: 8px;
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  padding: 9px 14px;
}

.cv-search-input {
  border: none;
  outline: none;
  font-size: 13px;
  color: #374151;
  width: 100%;
  background: none;
}
.cv-search-input::placeholder { color: #9ca3af; }

.cv-add-btn {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 9px 18px;
  background: #4f46e5;
  color: white;
  border: none;
  border-radius: 8px;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s;
  white-space: nowrap;
}
.cv-add-btn:hover { background: #4338ca; }

.cv-body { flex: 1; overflow-y: auto; }

.cv-page-title {
  font-size: 22px;
  font-weight: 700;
  color: #111827;
  margin: 0 0 10px;
}

.cv-stats { display: flex; gap: 8px; margin-bottom: 24px; }

.cv-stat-tag {
  padding: 3px 10px;
  border-radius: 20px;
  font-size: 12px;
  font-weight: 500;
  background: #f3f4f6;
  color: #6b7280;
  border: 1px solid #e5e7eb;
}
.cv-online { background: #ecfdf5; color: #059669; border-color: #a7f3d0; }

/* 分区 */
.cv-section { margin-bottom: 28px; }

.cv-section-header {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 14px;
}

.cv-collapse-btn {
  background: none;
  border: none;
  cursor: pointer;
  padding: 2px;
  color: #6b7280;
  display: flex;
  align-items: center;
}

.cv-section-title {
  font-size: 14px;
  font-weight: 600;
  color: #374151;
}

/* 最近联系卡片网格 */
.cv-recent-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.cv-recent-card {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  padding: 16px;
  transition: box-shadow 0.15s;
}
.cv-recent-card:hover { box-shadow: 0 4px 12px rgba(0,0,0,0.08); }

.cv-ai-card {
  background: linear-gradient(135deg, #4f46e5, #7c3aed);
  border-color: transparent;
}

.cv-recent-card-inner {
  display: flex;
  align-items: center;
  gap: 10px;
}

.cv-recent-avatar {
  width: 42px;
  height: 42px;
  border-radius: 10px;
  background: linear-gradient(135deg, #06b6d4, #3b82f6);
  color: white;
  font-size: 16px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  position: relative;
}

.cv-ai-avatar {
  background: rgba(255,255,255,0.2);
}

.cv-online-dot {
  position: absolute;
  bottom: 1px;
  right: 1px;
  width: 10px;
  height: 10px;
  border-radius: 50%;
  background: #22c55e;
  border: 2px solid white;
}

.cv-recent-info { flex: 1; min-width: 0; }

.cv-recent-name {
  font-size: 13px;
  font-weight: 600;
  color: #111827;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cv-ai-card .cv-recent-name { color: white; }

.cv-recent-bio {
  font-size: 11px;
  color: #9ca3af;
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cv-ai-card .cv-recent-bio { color: rgba(255,255,255,0.65); }

.cv-msg-btn {
  width: 30px;
  height: 30px;
  border-radius: 8px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: background 0.15s;
}
.cv-msg-btn:hover { background: #f3f4f6; }

.cv-msg-btn-white {
  border-color: rgba(255,255,255,0.3);
  background: rgba(255,255,255,0.15);
  color: white;
}
.cv-msg-btn-white:hover { background: rgba(255,255,255,0.25); }

.cv-ai-footer {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,255,255,0.15);
}

.cv-ai-tag {
  font-size: 10px;
  font-weight: 700;
  color: rgba(255,255,255,0.6);
  letter-spacing: 0.5px;
}

.cv-ai-online {
  font-size: 11px;
  color: rgba(255,255,255,0.8);
  font-weight: 500;
}

/* 好友表格 */
.cv-friend-table {
  background: white;
  border: 1px solid #e5e7eb;
  border-radius: 12px;
  overflow: hidden;
}

.cv-table-header {
  display: grid;
  grid-template-columns: 2fr 1.2fr 2fr 1fr;
  padding: 10px 20px;
  background: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  font-size: 12px;
  font-weight: 600;
  color: #6b7280;
}

.cv-table-row {
  display: grid;
  grid-template-columns: 2fr 1.2fr 2fr 1fr;
  padding: 14px 20px;
  align-items: center;
  border-bottom: 1px solid #f3f4f6;
  transition: background 0.15s;
}
.cv-table-row:last-child { border-bottom: none; }
.cv-table-row:hover { background: #f9fafb; }

.cv-table-user { display: flex; align-items: center; gap: 10px; }

.cv-table-avatar {
  width: 36px;
  height: 36px;
  border-radius: 8px;
  background: linear-gradient(135deg, #f59e0b, #ef4444);
  color: white;
  font-size: 14px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
}

.cv-table-name { font-size: 13px; font-weight: 600; color: #111827; }
.cv-table-alias { font-size: 11px; color: #9ca3af; margin-top: 1px; }

.cv-table-status { display: flex; align-items: center; gap: 6px; }

.cv-status-dot {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.cv-status-online { background: #22c55e; }
.cv-status-offline { background: #d1d5db; }

.cv-status-text { font-size: 12px; color: #6b7280; }

.cv-table-bio {
  font-size: 12px;
  color: #6b7280;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.cv-table-actions { display: flex; gap: 6px; }

.cv-action-btn {
  width: 28px;
  height: 28px;
  border-radius: 6px;
  border: 1px solid #e5e7eb;
  background: white;
  color: #6b7280;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: background 0.15s;
}
.cv-action-btn:hover { background: #f3f4f6; color: #4f46e5; }

.cv-load-more {
  padding: 12px 20px;
  text-align: center;
  border-top: 1px solid #f3f4f6;
}

.cv-load-more-btn {
  background: none;
  border: none;
  color: #4f46e5;
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.cv-load-more-btn:hover { color: #4338ca; }

.cv-empty {
  padding: 32px 20px;
  text-align: center;
  color: #9ca3af;
  font-size: 13px;
}
