/* ========== 个人中心 ========== */
.profile-section {
  padding: 32px 0 56px;
}

.profile-layout {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 400px;
  gap: 20px;
  align-items: start;
}

.profile-card {
  background-color: #fff;
  border: 1px solid #eef1f6;
  border-radius: 10px;
  box-shadow: var(--shadow-sm);
  padding: 24px;
  margin-bottom: 16px;
}

.profile-user-card {
  padding: 24px 24px 20px;
  background-color: #fff;
  background-image: url("/pc/assets/profile/profile_bj.png");
  background-repeat: no-repeat;
  background-position: top center;
  background-size: 100% auto;
  border: 1px solid #eef1f6;
}

.profile-card:last-child {
  margin-bottom: 0;
}

.profile-card__title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0 0 20px;
  font-size: 16px;
  font-weight: 600;
  color: #101d33;
  line-height: 24px;
}

.profile-card__title-bar {
  flex-shrink: 0;
  width: 4px;
  height: 16px;
  border-radius: 2px;
  background: #1769ff;
}

/* ----- 用户信息 + 等级 ----- */
.profile-user-head {
  display: flex;
  align-items: flex-start;
  gap: 16px;
  padding-bottom: 20px;
  margin-bottom: 0;
}

.profile-user-avatar-wrap {
  position: relative;
  flex-shrink: 0;
}

.profile-user-avatar {
  display: block;
  width: 80px;
  height: 80px;
  border-radius: 50%;
  object-fit: cover;
  background: #e8f2ff;
  border: 2px solid #fff;
  box-shadow: 0 2px 10px rgba(15, 23, 42, 0.08);
}

.profile-user-avatar-upload {
  position: absolute;
  right: 0;
  bottom: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  padding: 0;
  border: 2px solid #fff;
  border-radius: 50%;
  background: #1769ff;
  cursor: pointer;
  box-shadow: 0 2px 6px rgba(23, 105, 255, 0.35);
}

.profile-user-avatar-upload img {
  display: block;
  width: 14px;
  height: 14px;
  object-fit: contain;
}

.profile-user-meta {
  flex: 1;
  min-width: 0;
}

.profile-user-name-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.profile-user-name {
  margin: 0;
  font-size: 20px;
  font-weight: 600;
  color: #101d33;
  line-height: 28px;
}

.profile-user-edit {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: transparent;
  color: #1769ff;
  cursor: pointer;
}

.profile-user-edit svg {
  display: block;
}

.profile-user-info {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0;
  font-size: 13px;
  color: #9aa8bc;
  line-height: 20px;
}

.profile-user-info > span + span::before {
  content: "|";
  margin: 0 12px;
  color: #d9dfe8;
}

.profile-level-panel {
  padding: 20px 24px 18px;
  border-radius: 10px;
  background: linear-gradient(0deg, #e3f0ff 0%, #ffffff 59%);
  border: 1px solid rgba(23, 105, 255, 0.08);
  box-shadow: 0 2px 8px rgba(23, 105, 255, 0.06);
}

.profile-levels__label {
  margin: 0 0 18px;
  font-size: 15px;
  font-weight: 600;
  color: #101d33;
  line-height: 22px;
}

.profile-levels__track {
  display: flex;
  justify-content: space-between;
  gap: 6px;
  margin-bottom: 22px;
}

.profile-level-badge {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
}

.profile-level-badge__icon {
  position: relative;
  width: 52px;
  height: 52px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  transition: background 0.2s, transform 0.2s, box-shadow 0.2s;
}

.profile-level-badge__icon img {
  display: block;
  width: 44px;
  height: 44px;
  object-fit: contain;
}

.profile-level-badge__name {
  font-size: 12px;
  color: #9aa8bc;
  line-height: 18px;
  white-space: nowrap;
}

.profile-level-badge.is-reached .profile-level-badge__name {
  color: #5f738d;
}

.profile-level-badge.is-current .profile-level-badge__icon {
  background: #1769ff;
  box-shadow: 0 4px 14px rgba(23, 105, 255, 0.35);
  transform: translateY(-1px);
}

.profile-level-badge.is-current .profile-level-badge__icon img {
  width: 40px;
  height: 40px;
}

.profile-level-badge.is-current .profile-level-badge__name {
  color: #1769ff;
  font-weight: 600;
}

.profile-level-badge.is-locked .profile-level-badge__icon img {
  filter: grayscale(1);
  opacity: 0.5;
}

.profile-level-badge.is-locked .profile-level-badge__name {
  color: #c5cdd8;
}

.profile-spend-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 10px;
  font-size: 13px;
  color: #5f738d;
  line-height: 20px;
}

.profile-spend-need {
  font-style: normal;
  font-weight: 600;
  color: #fa8c16;
}

.profile-spend-current {
  font-style: normal;
  font-weight: 600;
  color: #1769ff;
}

.profile-level-panel .profile-progress {
  height: 10px;
  margin-bottom: 14px;
}

.profile-progress {
  height: 8px;
  border-radius: 999px;
  background: #eef1f6;
  overflow: hidden;
  margin-bottom: 16px;
}

.profile-progress__bar {
  height: 100%;
  border-radius: 999px;
  background: linear-gradient(90deg, #1769ff 0%, #3d8bff 100%);
  transition: width 0.3s ease;
}

/* ----- 收藏列表 ----- */
.profile-fav-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-fav-item {
  display: grid;
  grid-template-columns: 56px minmax(0, 1fr) auto;
  align-items: center;
  gap: 14px;
  padding: 12px 14px;
  background: #f7f9fc;
  border: 1px solid #eef1f6;
  border-radius: 8px;
}

.profile-fav-cover {
  display: block;
  width: 56px;
  height: 72px;
  border-radius: 4px;
  object-fit: cover;
  background: #fff;
  border: 1px solid #e5e7eb;
  flex-shrink: 0;
}

.profile-fav-body {
  min-width: 0;
}

.profile-fav-title {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #101d33;
  line-height: 22px;
}

.profile-fav-meta {
  margin: 0;
  font-size: 13px;
  color: #9aa8bc;
  line-height: 20px;
}

.profile-fav-remove {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  width: 32px;
  height: 32px;
  padding: 0;
  border: 1px dashed #ff4d4f;
  border-radius: 4px;
  background: #fff;
  cursor: pointer;
  transition: background 0.2s, border-color 0.2s;
}

.profile-fav-remove img {
  display: block;
  width: 16px;
  height: 16px;
  object-fit: contain;
}

.profile-fav-remove:hover {
  background: #fff1f0;
  border-color: #ff7875;
}

.profile-empty {
  padding: 24px 0;
  text-align: center;
  font-size: 14px;
  color: #9aa8bc;
}

/* ----- 下级 / 上级用户条 ----- */
.profile-user-list {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-user-strip {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border-radius: 8px;
  background: #f8f9fb;
  border: 1px solid #eef1f6;
}

.profile-user-strip__avatar {
  flex-shrink: 0;
  width: 48px;
  height: 48px;
  border-radius: 50%;
  object-fit: cover;
  background: #e8f2ff;
  border: 1px solid #fff;
  box-shadow: 0 1px 4px rgba(15, 23, 42, 0.06);
}

.profile-user-strip__body {
  flex: 1;
  min-width: 0;
}

.profile-user-strip__name {
  margin: 0 0 6px;
  font-size: 15px;
  font-weight: 600;
  color: #101d33;
  line-height: 22px;
}

.profile-user-strip__meta {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  margin: 0;
  font-size: 13px;
  color: #9aa8bc;
  line-height: 20px;
}

.profile-user-strip__sep {
  margin: 0 12px;
  color: #d9dfe8;
}

/* ----- 我的上级 ----- */
.profile-parent-card {
  padding: 20px 20px 22px;
}

.profile-parent-body .profile-user-strip {
  margin: 0;
}

.profile-parent-body .profile-user-strip__meta {
  font-size: 13px;
  color: #9aa8bc;
}

/* ----- 在线时长 ----- */
.profile-online-card {
  padding: 20px 20px 18px;
}

.profile-online-stats {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-bottom: 16px;
}

.profile-online-stat-box {
  padding: 14px 14px 12px;
  border-radius: 8px;
  background: #f7f9fc;
  border: 1px solid #eef1f6;
}

.profile-online-stat__label {
  margin: 0 0 10px;
  font-size: 12px;
  color: #101d33;
  line-height: 18px;
  font-weight: 500;
}

.profile-online-tag {
  font-style: normal;
  font-weight: 400;
}

.profile-online-tag--blue {
  color: #1769ff;
}

.profile-online-tag--orange {
  color: #fa8c16;
}

.profile-online-stat__main {
  margin: 0 0 8px;
  line-height: 1;
  color: #101d33;
}

.profile-online-stat__num {
  font-size: 28px;
  font-weight: 600;
  line-height: 1.1;
}

.profile-online-stat__unit {
  margin-left: 4px;
  font-size: 14px;
  font-weight: 500;
  vertical-align: 0.05em;
}

.profile-online-stat__sub {
  display: flex;
  align-items: center;
  gap: 4px;
  margin: 0;
  font-size: 12px;
  color: #9aa8bc;
  line-height: 18px;
}

.profile-online-stat__sub--plain {
  gap: 0;
}

.profile-online-stat__trend {
  display: block;
  flex-shrink: 0;
}

.profile-online-goal {
  margin-bottom: 16px;
}

.profile-online-goal__head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
  font-size: 13px;
  color: #5f738d;
  line-height: 20px;
}

.profile-online-goal__pct {
  color: #1769ff;
  font-weight: 600;
}

.profile-progress--goal {
  height: 10px;
  margin-bottom: 0;
}

.profile-rank-panel {
  padding: 16px 14px 14px;
  border-radius: 10px;
  background: linear-gradient(0deg, #e3f0ff 0%, #ffffff 59%);
  border: 1px solid rgba(23, 105, 255, 0.08);
}

.profile-rank-panel__head {
  margin-bottom: 12px;
  text-align: center;
}

.profile-rank-panel__title-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  margin-bottom: 6px;
}

.profile-rank-panel__deco {
  display: block;
  flex-shrink: 0;
  object-fit: contain;
}

.profile-rank-panel__title {
  margin: 0;
  font-size: 15px;
  font-weight: 600;
  color: #101d33;
  line-height: 22px;
}

.profile-rank-panel__subtitle {
  margin: 0;
  font-size: 11px;
  color: #9aa8bc;
  line-height: 16px;
}

.profile-rank-toolbar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin-bottom: 10px;
}

.profile-rank-tabs {
  display: flex;
  align-items: center;
  gap: 18px;
}

.profile-rank-tab {
  position: relative;
  height: 28px;
  padding: 0 2px 6px;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: 13px;
  color: #9aa8bc;
  cursor: pointer;
  transition: color 0.2s;
}

.profile-rank-tab.is-active {
  color: #1769ff;
  font-weight: 600;
  background: transparent;
  box-shadow: none;
}

.profile-rank-tab.is-active::after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: 0;
  transform: translateX(-50%);
  width: 24px;
  height: 3px;
  border-radius: 2px;
  background: #1769ff;
}

.profile-rank-refresh {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  flex-shrink: 0;
  padding: 0;
  border: none;
  background: transparent;
  font-size: 12px;
  color: #1769ff;
  line-height: 18px;
  cursor: pointer;
  white-space: nowrap;
}

.profile-rank-refresh img {
  display: block;
}

.profile-rank-list {
  display: flex;
  flex-direction: column;
  gap: 2px;
  max-height: 300px;
  overflow-y: auto;
  padding-right: 2px;
}

.profile-rank-list::-webkit-scrollbar {
  width: 4px;
}

.profile-rank-list::-webkit-scrollbar-thumb {
  border-radius: 4px;
  background: #d9dfe8;
}

.profile-rank-list::-webkit-scrollbar-track {
  background: transparent;
}

.profile-rank-item {
  display: grid;
  grid-template-columns: 32px 36px minmax(0, 1fr) auto;
  align-items: center;
  gap: 8px;
  padding: 7px 8px;
  border-radius: 6px;
  font-size: 13px;
}

.profile-rank-item.is-me {
  background: #fff7e6;
}

.profile-rank-no-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  min-height: 28px;
}

.profile-rank-medal {
  display: block;
  width: 28px;
  height: 28px;
  object-fit: contain;
}

.profile-rank-no {
  display: block;
  text-align: center;
  font-weight: 600;
  font-size: 14px;
  color: #c5cdd8;
  line-height: 28px;
}

.profile-rank-avatar-wrap {
  position: relative;
  width: 32px;
  height: 32px;
}

.profile-rank-avatar {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  object-fit: cover;
  background: #e8f2ff;
}

.profile-rank-name {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  color: #101d33;
}

.profile-rank-time {
  font-size: 12px;
  color: #9aa8bc;
  white-space: nowrap;
}

/* ----- 邀请注册 ----- */
.profile-invite-rows {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.profile-invite-row {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 14px 16px;
  border-radius: 10px;
  background: #f8f9fb;
  border: 1px solid #eef1f6;
}

.profile-invite-label {
  flex-shrink: 0;
  min-width: 56px;
  font-size: 14px;
  font-weight: 500;
  color: #101d33;
  line-height: 22px;
  white-space: nowrap;
}

.profile-invite-value {
  flex: 1;
  min-width: 0;
  font-size: 14px;
  font-weight: 500;
  color: #1769ff;
  line-height: 22px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.profile-invite-value--link {
  font-weight: 400;
}

.profile-invite-copy {
  flex-shrink: 0;
  min-width: 64px;
  height: 32px;
  padding: 0 18px;
  border: none;
  border-radius: 999px;
  background: #1769ff;
  font-size: 13px;
  font-weight: 500;
  color: #fff;
  line-height: 22px;
  cursor: pointer;
  transition: background 0.2s;
}

.profile-invite-copy:hover {
  background: #1258d9;
}

@media (max-width: 1200px) {
  .profile-layout {
    grid-template-columns: 1fr;
  }

  .profile-levels__track {
    flex-wrap: wrap;
    justify-content: center;
  }

  .profile-level-badge {
    flex: 0 0 calc(25% - 8px);
  }
}

@media (max-width: 768px) {
  .profile-card {
    padding: 20px 16px;
  }

  .profile-online-stats {
    grid-template-columns: 1fr;
  }

  .profile-invite-row {
    flex-wrap: wrap;
    gap: 10px 12px;
  }

  .profile-invite-value {
    flex: 1 1 100%;
    order: 3;
    padding-left: 0;
  }

  .profile-invite-copy {
    margin-left: auto;
  }

  .profile-level-badge {
    flex: 0 0 calc(33.333% - 8px);
  }
}
