/* =========================================================
   星环设计 - 个人主页样式（profile.css）
   颜色取自 common.css 主题变量，明暗主题自动适配。
   ========================================================= */

.profile-main { max-width: 720px; }

/* ---------- 用户资料卡 ---------- */
.profile-top { display: flex; align-items: center; gap: 16px; }

.profile-avatar,
.profile-avatar-fallback {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  flex-shrink: 0;
  object-fit: cover;
}
.profile-avatar-fallback {
  background: var(--primary);
  color: var(--primary-text);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 30px;
  font-weight: 700;
}

.profile-name {
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
}
.role-badge {
  font-size: 11px;
  font-weight: 600;
  color: var(--primary-text);
  background: var(--primary);
  border-radius: 999px;
  padding: 2px 10px;
}
.profile-username { font-size: 13px; color: var(--text-2); margin-top: 2px; }
.profile-joined { font-size: 12px; color: var(--text-2); margin-top: 6px; }

/* 统计六格（3 列 × 2 行） */
.profile-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.profile-stats .stat-item {
  background: var(--bg-hover);
  border-radius: 10px;
  padding: 10px 4px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.profile-stats .stat-num { font-size: 18px; font-weight: 700; color: var(--primary); }
.profile-stats .stat-label { font-size: 12px; color: var(--text-2); }
/* 粉丝 / 关注格可点击展开 */
.stat-click { cursor: pointer; transition: background 0.2s; }
.stat-click:hover { background: var(--primary-light); }

/* ---------- 关注按钮 ---------- */
.follow-btn {
  border: 1px solid var(--primary);
  background: var(--primary);
  color: var(--primary-text);
  font-size: 12px;
  font-weight: 600;
  padding: 3px 12px;
  border-radius: 999px;
  transition: all 0.2s;
}
.follow-btn:hover { opacity: 0.85; }
.follow-btn:disabled { opacity: 0.5; cursor: wait; }
.follow-btn.following {
  background: transparent;
  color: var(--text-2);
  border-color: var(--border);
}
.follow-btn.following:hover { color: var(--danger); border-color: var(--danger); }

/* ---------- 粉丝 / 关注展开列表 ---------- */
.follow-list {
  margin-top: 10px;
  background: var(--bg-hover);
  border-radius: 10px;
  padding: 10px 12px;
}
.follow-list .fl-title { font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.follow-list .fl-item {
  display: inline-block;
  font-size: 13px;
  color: var(--primary);
  margin: 0 10px 6px 0;
}
.follow-list .fl-item:hover { text-decoration: underline; }
.follow-list .fl-empty { font-size: 12px; color: var(--text-2); }

/* ---------- 分区标题 ---------- */
.section-title {
  font-size: 16px;
  margin: 6px 2px 12px;
}
.section-title span { font-size: 13px; color: var(--text-2); font-weight: 400; }

/* ---------- 主页里的简化帖子卡 ---------- */
.mini-post { margin-bottom: 12px; }
.mini-post .post-content { margin-bottom: 8px; }
.mini-post .post-images { margin-bottom: 8px; }
.mini-post .mini-meta {
  display: flex;
  gap: 14px;
  font-size: 12px;
  color: var(--text-2);
  border-top: 1px solid var(--border);
  padding-top: 8px;
}

/* ---------- 窄屏适配 ---------- */
@media (max-width: 520px) {
  .profile-top { flex-direction: column; text-align: center; }
  .profile-name { justify-content: center; }
  .profile-stats { grid-template-columns: repeat(3, 1fr); }
}

/* ---------- 收藏帖子列表（展开面板内嵌简化帖卡） ---------- */
#favoritesList .fav-post { margin: 10px 0; }
#favoritesList .fl-empty { display: block; padding: 6px 0; }

/* ---------- 私信按钮 ---------- */
.msg-btn { background: rgba(59, 130, 246, 0.1); color: var(--primary); }
.msg-btn:hover { background: rgba(59, 130, 246, 0.2); }

/* ---------- 蓝V与网站 ---------- */
.v-btn { background: rgba(29, 155, 240, 0.1); color: #1d9bf0; }
.v-btn:hover { background: rgba(29, 155, 240, 0.2); }
.v-btn.following { background: rgba(148, 163, 184, 0.12); color: var(--text-2); }
.site-btn { background: rgba(34, 197, 94, 0.1); color: #16a34a; }
.site-btn:hover { background: rgba(34, 197, 94, 0.2); }
.profile-website {
  display: inline-block;
  font-size: 13px;
  color: var(--primary);
  text-decoration: none;
  margin-top: 2px;
  word-break: break-all;
}
.profile-website:hover { text-decoration: underline; }

/* ---------- 收藏帖卡改为可点链接 ---------- */
a.mini-post {
  display: block;
  text-decoration: none;
  color: inherit;
  transition: box-shadow 0.2s;
}
a.mini-post:hover { box-shadow: 0 6px 18px rgba(15, 23, 42, 0.1); }

/* ---------- 封禁提示条（个人主页） ---------- */
.profile-banned-note {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin-top: 8px;
  padding: 6px 12px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--danger);
  background: rgba(229, 72, 77, 0.1);
  border: 1px solid rgba(229, 72, 77, 0.28);
}
[data-theme="dark"] .profile-banned-note {
  color: #ff8a8d;
  background: rgba(255, 99, 105, 0.14);
  border-color: rgba(255, 99, 105, 0.32);
}

/* ---------- 成就墙 ---------- */
.ach-wall {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(150px, 1fr));
  gap: 12px;
}
.ach-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 6px;
  padding: 16px 10px 13px;
  border-radius: 12px;
  border: 1px solid var(--border);
  background: var(--bg-card);
  transition: transform 0.18s ease, box-shadow 0.18s ease;
}
.ach-item.earned:hover {
  transform: translateY(-2px);
  box-shadow: 0 6px 18px rgba(15, 23, 42, 0.08);
}
[data-theme="dark"] .ach-item.earned:hover { box-shadow: 0 6px 18px rgba(0, 0, 0, 0.42); }

.ach-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  font-size: 17px;
}
.ach-item.earned.tier-gold   .ach-icon { background: rgba(245, 158, 11, 0.16); color: #d97706; }
.ach-item.earned.tier-silver .ach-icon { background: rgba(100, 116, 139, 0.16); color: #64748b; }
.ach-item.earned.tier-bronze .ach-icon { background: rgba(180, 120, 70, 0.16); color: #b0693b; }
[data-theme="dark"] .ach-item.earned.tier-gold   .ach-icon { background: rgba(245, 158, 11, 0.22); color: #fbbf24; }
[data-theme="dark"] .ach-item.earned.tier-silver .ach-icon { background: rgba(148, 163, 184, 0.20); color: #cbd5e1; }
[data-theme="dark"] .ach-item.earned.tier-bronze .ach-icon { background: rgba(200, 140, 90, 0.22); color: #e0a878; }

/* 未点亮：整体压暗，图标走灰 */
.ach-item.locked { opacity: 0.7; }
.ach-item.locked .ach-icon { background: var(--bg-hover); color: var(--text-2); }

.ach-name { font-size: 13px; font-weight: 700; color: var(--text); }
.ach-item.locked .ach-name { color: var(--text-2); }
.ach-desc { font-size: 11px; color: var(--text-2); line-height: 1.45; }

.ach-date { font-size: 10.5px; color: var(--text-2); }
.ach-date i { font-size: 9.5px; color: #22a06b; margin-right: 2px; }

.ach-progress {
  display: block;
  width: 100%;
  height: 4px;
  margin-top: 2px;
  border-radius: 999px;
  background: var(--bg-hover);
  overflow: hidden;
}
.ach-progress i {
  display: block;
  height: 100%;
  border-radius: 999px;
  background: var(--primary);
}
.ach-num { font-size: 10.5px; color: var(--text-2); }

@media (max-width: 560px) {
  .ach-wall { grid-template-columns: repeat(auto-fill, minmax(128px, 1fr)); gap: 10px; }
  .ach-item { padding: 13px 8px 11px; }
  .ach-desc { font-size: 10.5px; }
}

/* ---------- PTD 参赛作品（2026-10-04 起改为链接形式）：作品名即可点链接 ---------- */
.file-link { color: var(--primary); text-decoration: none; }
.file-link:hover { text-decoration: underline; }
