/* ============================================
   用户资料卡片样式 — ✨ 二次元卡哇伊风格 ✨
   ============================================ */

/* 遮罩层 */
.user-card-overlay {
  position: fixed;
  top: 0; left: 0;
  width: 100%; height: 100%;
  background: rgba(0, 0, 0, 0.4);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 10000;
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.35s ease, visibility 0.35s ease;
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.user-card-overlay.show {
  opacity: 1;
  visibility: visible;
}

/* 主卡片 */
.user-card {
  background: #FFFCFA;
  border-radius: 28px;
  width: 88%;
  max-width: 360px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 15px 50px rgba(255, 107, 157, 0.2), 0 0 0 1px rgba(255, 107, 157, 0.08);
  transform: scale(0.88) translateY(20px);
  transition: transform 0.4s cubic-bezier(0.34, 1.56, 0.64, 1), box-shadow 0.3s;
  position: relative;
}
.user-card-overlay.show .user-card {
  transform: scale(1) translateY(0);
}
/* 滚动条美化 */
.user-card::-webkit-scrollbar { width: 4px; }
.user-card::-webkit-scrollbar-track { background: transparent; }
.user-card::-webkit-scrollbar-thumb { background: rgba(255, 107, 157, 0.3); border-radius: 4px; }

/* ========== 顶部头像区 ========== */
.user-card-header {
  background: linear-gradient(160deg, #FFB5D8 0%, #D4A5FF 35%, #A5D8FF 70%, #B5FFD8 100%);
  padding: 35px 20px 75px;
  text-align: center;
  position: relative;
  border-radius: 28px 28px 0 0;
  overflow: hidden;
}
/* 装饰小星星 ✨ */
.user-card-header::before {
  content: '✦ ✧ ★ ✦ ✧ ✦ ✧ ★ ✦ ✧ ✦ ✧ ★ ✦';
  position: absolute;
  top: 10px;
  left: 0; right: 0;
  font-size: 10px;
  letter-spacing: 12px;
  color: rgba(255,255,255,0.3);
  text-align: center;
  pointer-events: none;
  animation: kirakira 4s ease-in-out infinite;
}
/* 底部装饰涟漪 */
.user-card-header::after {
  content: '';
  position: absolute;
  bottom: -30px;
  left: -20%; right: -20%;
  height: 60px;
  background: radial-gradient(ellipse at center, rgba(255,255,255,0.5) 0%, transparent 70%);
  pointer-events: none;
}
@keyframes kirakira {
  0%, 100% { opacity: 0.3; transform: scale(1); }
  50% { opacity: 0.6; transform: scale(1.05); }
}
/* 浮动小装饰 */
.user-card-header .deco-dot {
  position: absolute;
  width: 8px; height: 8px;
  border-radius: 50%;
  background: rgba(255,255,255,0.4);
  pointer-events: none;
}
.user-card-header .deco-dot:nth-child(1) { top: 30%; left: 10%; animation: float 3s ease-in-out infinite; }
.user-card-header .deco-dot:nth-child(2) { top: 20%; right: 15%; width: 6px; height: 6px; animation: float 4s ease-in-out 0.5s infinite; }
.user-card-header .deco-dot:nth-child(3) { top: 55%; left: 5%; width: 5px; height: 5px; animation: float 3.5s ease-in-out 1s infinite; }
@keyframes float {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-8px); }
}

/* 头像 */
.user-card-avatar {
  width: 105px;
  height: 105px;
  border-radius: 50%;
  border: 4px solid rgba(255,255,255,0.85);
  object-fit: cover;
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.25);
  margin-bottom: 10px;
  position: relative;
  z-index: 1;
  transition: transform 0.3s;
}
.user-card-avatar:hover {
  transform: scale(1.05) rotate(-3deg);
}

/* 昵称 */
.user-card-nickname {
  color: white;
  font-size: 1.35rem;
  font-weight: 800;
  margin: 6px 0 3px;
  position: relative;
  z-index: 1;
  text-shadow: 0 2px 8px rgba(0,0,0,0.1);
}

/* 用户名 */
.user-card-username {
  color: rgba(255,255,255,0.85);
  font-size: 0.85rem;
  position: relative;
  z-index: 1;
}

/* 角色标签 */
.user-card-role {
  display: inline-block;
  margin-top: 8px;
  padding: 4px 14px;
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(4px);
  border-radius: 14px;
  color: white;
  font-size: 0.8rem;
  font-weight: 600;
  position: relative;
  z-index: 1;
  border: 1px solid rgba(255,255,255,0.3);
}

/* 关闭按钮 */
.user-card-close {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(255,255,255,0.25);
  backdrop-filter: blur(4px);
  border: 1px solid rgba(255,255,255,0.3);
  color: white;
  font-size: 1.1rem;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.25s;
  z-index: 2;
}
.user-card-close:hover {
  background: rgba(255,255,255,0.45);
  transform: rotate(90deg) scale(1.1);
}

/* ========== 主体区域 ========== */
.user-card-body {
  padding: 0 18px 20px;
  margin-top: -50px;
  position: relative;
  z-index: 2;
}

/* 统计数据卡片 - 整洁网格 */
.user-card-stats {
  display: flex;
  flex-wrap: wrap;
  background: rgba(255,255,255,0.9);
  backdrop-filter: blur(10px);
  border-radius: 20px;
  padding: 14px 6px;
  margin-bottom: 16px;
  box-shadow: 0 4px 16px rgba(255, 107, 157, 0.1), 0 0 0 1px rgba(255, 107, 157, 0.06);
}

.user-card-stat {
  text-align: center;
  padding: 6px 2px;
  flex: 0 0 33.33%;
  box-sizing: border-box;
}
.user-card-stat:nth-child(4),
.user-card-stat:nth-child(5) {
  flex: 0 0 50%;
  margin-top: 6px;
  padding-top: 10px;
  border-top: 1px solid rgba(255,107,157,0.08);
}

.user-card-stat-label {
  font-size: 0.8rem;
  font-weight: 600;
  color: #9CA3AF;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
/* 每个标签的小图标 */
.user-card-stat-label .stat-icon {
  font-size: 1.2rem;
  margin-bottom: 1px;
}

.user-card-stat-number {
  font-size: 1.3rem;
  font-weight: 800;
  background: linear-gradient(135deg, #FF6B9D, #C084FC);
  -webkit-background-clip: text;
  -webkit-text-fill-color: transparent;
  background-clip: text;
}

/* 竖线分隔前三项 */
.user-card-stat:nth-child(2)::before,
.user-card-stat:nth-child(3)::before {
  content: '';
  position: absolute;
  left: 0;
  top: 15%;
  height: 70%;
  width: 1px;
  background: linear-gradient(to bottom, transparent, rgba(255,107,157,0.15), transparent);
}

/* ========== 头衔区域 ========== */
.user-card-titles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 16px;
  justify-content: center;
}
.user-card-title {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 5px 12px;
  border-radius: 20px;
  font-size: 0.8rem;
  font-weight: 600;
}

/* ========== 按钮 ========== */
.user-card-actions {
  display: flex;
  gap: 10px;
}
.user-card-btn {
  flex: 1;
  padding: 11px;
  border-radius: 16px;
  border: none;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 0.5px;
}
.user-card-btn-primary {
  background: linear-gradient(135deg, #FF9ABF, #C084FC);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 107, 157, 0.25);
}
.user-card-btn-primary:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 107, 157, 0.35);
}
.user-card-btn-primary:active {
  transform: translateY(0);
}
.user-card-btn-secondary {
  background: rgba(243, 244, 246, 0.8);
  backdrop-filter: blur(4px);
  color: #6B7280;
  border: 1px solid rgba(255,255,255,0.3);
}
.user-card-btn-secondary:hover {
  background: rgba(229, 231, 235, 0.9);
  transform: translateY(-2px);
}
/* 关注/取消关注按钮 */
.user-card-btn-follow {
  flex: 0.7;
  padding: 11px;
  border-radius: 16px;
  border: none;
  font-size: 0.9rem;
  font-weight: 700;
  cursor: pointer;
  transition: all 0.25s;
  letter-spacing: 0.5px;
  background: linear-gradient(135deg, #FFD700, #FFA500);
  color: white;
  box-shadow: 0 4px 12px rgba(255, 165, 0, 0.25);
}
.user-card-btn-follow:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 20px rgba(255, 165, 0, 0.35);
}
.user-card-btn-follow.following {
  background: rgba(243, 244, 246, 0.8);
  color: #9CA3AF;
  box-shadow: none;
  border: 1px solid rgba(255,255,255,0.3);
}
.user-card-btn-follow.following:hover {
  background: #FEE2E2;
  color: #EF4444;
  border-color: rgba(239,68,68,0.2);
}

/* ========== 加载 / 错误状态 ========== */
.user-card-loading {
  text-align: center;
  padding: 60px 20px;
  color: #9CA3AF;
  font-size: 0.9rem;
}
.user-card-loading:empty {
  display: none;
}
/* 加载动画 */
.user-card-loading .loading-spinner {
  width: 40px; height: 40px;
  margin: 0 auto 12px;
  border: 3px solid rgba(255, 107, 157, 0.15);
  border-top: 3px solid #FF6B9D;
  border-radius: 50%;
  animation: spin 0.8s linear infinite;
}
@keyframes spin {
  to { transform: rotate(360deg); }
}

.user-card-error {
  text-align: center;
  padding: 60px 20px;
  color: #EF4444;
}

/* ========== 移动端适配 ========== */
@media (max-width: 768px) {
  .user-card {
    width: 92%;
    max-height: 85vh;
  }
  .user-card-header {
    padding: 28px 15px 65px;
  }
  .user-card-avatar {
    width: 85px;
    height: 85px;
  }
  .user-card-nickname {
    font-size: 1.15rem;
  }
  .user-card-stat-number {
    font-size: 1.15rem;
  }
  .user-card-body {
    padding: 0 14px 16px;
    margin-top: -45px;
  }
}

/* ========== 通知侧边栏 (P0-4: 从 inline 抽出) ========== */
.notification-sidebar {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  z-index: 10000;
  display: none;
}
.notification-sidebar.show { display: block; }
.notification-sidebar-overlay {
  position: absolute;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
}
.notification-sidebar-content {
  position: absolute;
  top: 0; right: 0;
  width: 380px;
  max-width: 90vw;
  height: 100%;
  background: var(--bg-card, white);
  box-shadow: -4px 0 20px rgba(0, 0, 0, 0.15);
  display: flex;
  flex-direction: column;
  animation: slideInRight 0.3s ease;
}
@keyframes slideInRight {
  from { transform: translateX(100%); }
  to { transform: translateX(0); }
}
.notification-sidebar-header {
  padding: 20px;
  border-bottom: 1px solid var(--border-light, #eee);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.notification-sidebar-header h3 {
  margin: 0;
  font-size: 1.1rem;
  color: var(--text-primary, #1E293B);
}
.notification-sidebar-close {
  background: none;
  border: none;
  font-size: 1.5rem;
  cursor: pointer;
  color: var(--text-light, #94A3B8);
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
  transition: all 0.2s;
}
.notification-sidebar-close:hover {
  background: var(--bg-secondary, #f5f5f5);
  color: var(--text-primary, #1E293B);
}
.notification-sidebar-body { flex: 1; overflow-y: auto; padding: 16px; }
.notification-empty {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-light, #94A3B8);
}
.notification-empty-icon { font-size: 3rem; margin-bottom: 12px; }
.notification-empty-text { font-size: 0.9rem; }
.notification-item {
  padding: 12px;
  border-radius: 8px;
  margin-bottom: 8px;
  background: #f8f9fa;
  cursor: pointer;
  transition: all 0.2s;
}
.notification-item:hover { background: #e9ecef; }
.notification-item.unread {
  background: #fff3cd;
  border-left: 3px solid #ffc107;
}
.notification-item-title {
  font-weight: 600;
  font-size: 0.9rem;
  color: var(--text-primary, #1E293B);
  margin-bottom: 4px;
}
.notification-item-text {
  font-size: 0.85rem;
  color: var(--text-secondary, #64748B);
  margin-bottom: 4px;
}
.notification-item-time {
  font-size: 0.75rem;
  color: var(--text-light, #94A3B8);
}
@media (max-width: 768px) {
  .notification-sidebar-content { width: 100%; max-width: 100%; }
}

/* ========== 用户资料弹窗 (P0-4: 从 inline 抽出) ========== */
.user-profile-modal {
  display: none;
  position: fixed;
  top: 0; left: 0;
  width: 100%;
  height: 100%;
  background: rgba(0, 0, 0, 0.5);
  backdrop-filter: blur(4px);
  z-index: 9999;
  align-items: center;
  justify-content: center;
}
.user-profile-modal.show { display: flex; }
.user-profile-modal-content {
  background: var(--bg-card, #fff);
  border-radius: 16px;
  width: 90%;
  max-width: 400px;
  max-height: 80vh;
  overflow-y: auto;
  box-shadow: 0 8px 32px rgba(0, 0, 0, 0.15);
}
.user-profile-modal-header {
  padding: 16px 20px;
  border-bottom: 1px solid var(--border-light, #eee);
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-weight: 600;
  font-size: 1rem;
}
.user-profile-modal-close {
  background: none;
  border: none;
  font-size: 1.2rem;
  color: var(--text-light, #94A3B8);
  cursor: pointer;
  padding: 4px;
  border-radius: 50%;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.user-profile-modal-close:hover {
  background: var(--bg-secondary, #f5f5f5);
  color: var(--text-primary, #1E293B);
}
.user-profile-modal-body { padding: 20px; }
.user-profile-loading {
  text-align: center;
  padding: 40px;
  color: var(--text-light, #94A3B8);
}
.user-profile-error {
  text-align: center;
  padding: 40px;
  color: #f56c6c;
}
.user-profile-avatar {
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  margin: 0 auto 16px;
  display: block;
  border: 3px solid #f0f0f0;
}
.user-profile-name {
  text-align: center;
  font-size: 1.2rem;
  font-weight: 600;
  margin-bottom: 8px;
}
.user-profile-username {
  text-align: center;
  color: var(--text-light, #94A3B8);
  font-size: 0.9rem;
  margin-bottom: 16px;
}
.user-profile-titles {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  justify-content: center;
  margin-bottom: 16px;
}
.user-profile-titles .title-badge {
  padding: 4px 10px;
  border-radius: 20px;
  font-size: 0.75rem;
  font-weight: 500;
}
.user-profile-stats {
  display: flex;
  justify-content: center;
  gap: 24px;
  padding: 16px 0;
  border-top: 1px solid var(--bg-secondary, #f5f5f5);
  border-bottom: 1px solid var(--bg-secondary, #f5f5f5);
}
.user-profile-stat { text-align: center; }
.user-profile-stat-value {
  font-size: 1.3rem;
  font-weight: 700;
  color: var(--text-primary, #1E293B);
}
.user-profile-stat-label {
  font-size: 0.8rem;
  color: var(--text-light, #94A3B8);
  margin-top: 4px;
}
.user-profile-joined {
  text-align: center;
  font-size: 0.85rem;
  color: var(--text-light, #94A3B8);
  margin-top: 16px;
}
@media (max-width: 768px) {
  .user-profile-modal-content { width: 95%; max-width: 95%; }
}
