/* 设置页 — 个人资料「Account Studio」 */

.settings-page {
  display: flex;
  justify-content: center;
  padding-bottom: 32px;
}

.settings-page .settings-card {
  max-width: 820px;
  width: 100%;
}

.settings-card--profile {
  border: none;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.settings-card--profile > .card-body:first-of-type {
  padding: 0 !important;
}

#settingsEditProfile {
  scroll-margin-top: calc(var(--header-height, 60px) + 16px);
}

.settings-profile-panel--studio {
  padding: 0 0 4px !important;
}

/* ── Profile Studio（借鉴 Linear / Apple ID：留白 + 环形指标 + 指标带） ── */
.profile-studio {
  padding: 28px 32px 20px;
  opacity: 0;
  transform: translateY(16px) scale(0.985);
  transition:
    opacity 0.65s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.65s cubic-bezier(0.22, 1, 0.36, 1);
}

.profile-studio--ready {
  opacity: 1;
  transform: translateY(0) scale(1);
}

.profile-studio__mesh {
  pointer-events: none;
  position: absolute;
  inset: 0;
  background:
    radial-gradient(ellipse 90% 70% at 0% -10%, color-mix(in srgb, var(--primary) 14%, transparent), transparent 55%),
    radial-gradient(ellipse 60% 50% at 100% 0%, color-mix(in srgb, var(--accent) 10%, transparent), transparent 50%),
    radial-gradient(ellipse 50% 40% at 50% 110%, color-mix(in srgb, var(--primary-light) 40%, transparent), transparent 60%);
  opacity: 0.9;
}

.profile-studio__layout {
  position: relative;
  z-index: 1;
  display: grid;
  grid-template-columns: auto 1fr;
  gap: 28px 36px;
  align-items: center;
}

/* 左侧：环形完整度 + 头像 */
.profile-studio__visual {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.profile-studio__meter {
  position: relative;
  width: 132px;
  height: 132px;
}

.profile-studio__meter-svg {
  width: 100%;
  height: 100%;
  transform: rotate(-90deg);
}

.profile-studio__meter-track {
  stroke: color-mix(in srgb, var(--border) 55%, var(--bg));
  stroke-width: 5;
}

.profile-studio__meter-core {
  position: absolute;
  /* 与 5px 描边圆环内缘对齐，避免头像四周留白 */
  inset: 11px;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  border-radius: 50%;
  overflow: hidden;
  background: transparent;
}

/* 与左下角 user-avatar 同款配色/字体，铺满圆环内区 */
.profile-studio__meter-core .user-avatar.user-avatar--profile-lg {
  width: 100%;
  height: 100%;
  min-width: 0;
  min-height: 0;
  border-radius: 50%;
  font-size: 5.025rem;
  padding-top: 8px;
  padding-left: 8px;
  box-shadow: none;
}

.profile-studio--ready .profile-studio__meter-core .user-avatar {
  animation: psAvatarPop 0.65s cubic-bezier(0.34, 1.35, 0.64, 1) 0.12s both;
}

.profile-studio__meter:hover .user-avatar--profile-lg {
  transform: scale(1.06);
}

@keyframes psAvatarPop {
  from {
    opacity: 0;
    transform: scale(0.88);
  }
  to {
    opacity: 1;
    transform: scale(1);
  }
}

/* 右侧：排版主区 */
.profile-studio__main {
  min-width: 0;
  padding: 4px 0 8px;
}

.profile-studio__eyebrow {
  margin: 0 0 10px;
  font-size: 0.6875rem;
  font-weight: 600;
  letter-spacing: 0.14em;
  text-transform: uppercase;
  color: var(--text-tertiary);
}

.profile-studio__title-row {
  display: flex;
  align-items: flex-start;
  flex-wrap: wrap;
  gap: 10px 14px;
  margin-bottom: 6px;
}

.profile-studio__name {
  margin: 0;
  font-size: clamp(1.5rem, 2.5vw + 0.5rem, 2rem);
  font-weight: 800;
  letter-spacing: -0.04em;
  line-height: 1.1;
  color: var(--text);
  font-variant-numeric: tabular-nums;
}

.profile-studio__pill {
  display: inline-flex;
  align-items: center;
  margin-top: 0.35em;
  padding: 5px 12px;
  border-radius: var(--radius-full);
  font-size: 0.6875rem;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.profile-studio__pill--member {
  color: var(--primary-active);
  background: color-mix(in srgb, var(--primary-light) 80%, #fff);
  border: 1px solid color-mix(in srgb, var(--primary) 22%, transparent);
}

.profile-studio__pill--guest {
  color: #8a6a00;
  background: var(--warning-bg);
  border: 1px solid color-mix(in srgb, var(--warning) 28%, transparent);
}

.profile-studio__pill--user {
  color: var(--text-secondary);
  background: var(--bg);
  border: 1px solid var(--border-light);
}

.profile-studio__handle {
  margin: 0 0 12px;
  font-size: 0.875rem;
  font-weight: 500;
  color: var(--text-tertiary);
  font-variant-numeric: tabular-nums;
}

.profile-studio__meta {
  margin: 0;
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
  padding: 8px 12px 8px 10px;
  border-radius: 10px;
  font-size: 0.8125rem;
  color: var(--text-secondary);
  background: color-mix(in srgb, var(--bg) 65%, transparent);
  border: 1px solid color-mix(in srgb, var(--border-light) 90%, transparent);
  word-break: break-all;
  transition: border-color 0.25s ease, background 0.25s ease;
}

.profile-studio__meta:hover {
  border-color: color-mix(in srgb, var(--primary) 18%, var(--border));
  background: color-mix(in srgb, var(--primary-light) 35%, var(--bg));
}

.profile-studio__meta-icon {
  display: flex;
  color: var(--primary);
  opacity: 0.75;
}

.profile-studio__tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 14px;
  min-height: 0;
}

.profile-studio__tags:empty {
  display: none;
}

.profile-studio__tag {
  font-size: 0.6875rem;
  font-weight: 600;
  padding: 5px 11px;
  border-radius: var(--radius-full);
  color: var(--text-secondary);
  background: var(--surface);
  border: 1px solid var(--border-light);
  transition: transform 0.2s cubic-bezier(0.34, 1.2, 0.64, 1), border-color 0.2s ease;
}

.profile-studio__tag:hover {
  transform: translateY(-1px);
  border-color: color-mix(in srgb, var(--primary) 20%, var(--border));
}

.profile-studio__hint {
  margin: 14px 0 0;
  font-size: 0.8125rem;
  line-height: 1.55;
  color: var(--text-tertiary);
  max-width: 36em;
}

/* 底部账户信息：轻量胶囊卡片 */
.profile-studio__stats {
  position: relative;
  z-index: 1;
  list-style: none;
  margin: 32px 0 0;
  padding: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
}

.profile-studio__stat {
  flex: 1 1 0;
  min-width: min(100%, 168px);
  margin: 0;
  padding: 18px 20px 20px;
  border-radius: 14px;
  background: color-mix(in srgb, var(--bg) 55%, var(--surface));
  border: 1px solid color-mix(in srgb, var(--border-light) 90%, transparent);
  opacity: 0;
  transform: translateY(6px);
  transition:
    opacity 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    transform 0.45s cubic-bezier(0.22, 1, 0.36, 1),
    border-color 0.22s ease,
    box-shadow 0.22s ease;
}

.profile-studio--ready .profile-studio__stat {
  opacity: 1;
  transform: translateY(0);
}

.profile-studio--ready .profile-studio__stat:nth-child(1) { transition-delay: 0.16s; }
.profile-studio--ready .profile-studio__stat:nth-child(2) { transition-delay: 0.22s; }
.profile-studio--ready .profile-studio__stat:nth-child(3) { transition-delay: 0.28s; }

.profile-studio__stat:hover {
  border-color: color-mix(in srgb, var(--primary) 20%, var(--border));
  box-shadow: 0 8px 20px -16px color-mix(in srgb, var(--primary) 30%, transparent);
}

.profile-studio__stat-label {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: var(--text-tertiary);
  letter-spacing: 0.03em;
  margin-bottom: 10px;
}

.profile-studio__stat-value {
  display: block;
  font-size: 0.9375rem;
  font-weight: 650;
  color: var(--text);
  line-height: 1.45;
  word-break: break-word;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.01em;
}

.profile-studio__actions {
  position: relative;
  z-index: 1;
  display: flex;
  flex-wrap: wrap;
  justify-content: flex-end;
  align-items: center;
  gap: 10px;
  margin-top: 24px;
  padding-top: 20px;
  border-top: 1px solid color-mix(in srgb, var(--border-light) 88%, transparent);
}

/* ── 完善资料 / 主题 / 微信等区块卡片 ── */
.settings-panel {
  margin-top: 20px;
}

.settings-panel .card-header {
  position: relative;
  z-index: 1;
  margin-top: 0;
  border: none;
  border-bottom: 1px solid color-mix(in srgb, var(--border-light) 90%, transparent);
  border-radius: 0;
  background: transparent;
}

.settings-panel .card-body {
  position: relative;
  z-index: 1;
  border: none;
  border-radius: 0;
  background: transparent;
}

.settings-panel .card-body:not(.settings-wechat-panel) {
  padding: 24px;
}

.settings-wechat-panel {
  padding: 20px 24px 24px !important;
}

.settings-wechat-panel .wechat-group-block {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 12px 14px;
  border-radius: 12px;
  border: 1px solid color-mix(in srgb, var(--primary) 20%, var(--border));
  background: color-mix(in srgb, var(--primary-light) 32%, var(--surface));
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.7);
}

.settings-wechat-panel .wechat-group-block__icon {
  width: 38px;
  height: 38px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 10px;
  color: var(--primary-active);
  background: color-mix(in srgb, var(--surface) 94%, var(--primary-light));
  border: 1px solid color-mix(in srgb, var(--primary) 16%, var(--border));
}

.settings-wechat-panel .wechat-group-block__icon svg {
  width: 18px;
  height: 18px;
}

.settings-wechat-panel .wechat-group-block__body {
  flex: 1;
  min-width: 0;
}

.settings-wechat-panel .wechat-group-block__title {
  font-size: 0.84rem;
  font-weight: 720;
  color: var(--text);
}

.settings-wechat-panel .wechat-group-block__id-row {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-top: 4px;
}

.settings-wechat-panel .wechat-group-block__label {
  font-size: 0.72rem;
  color: var(--text-tertiary);
}

.settings-wechat-panel .wechat-group-block__code {
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
  font-size: 0.92rem;
  font-weight: 700;
  letter-spacing: 0.06em;
  color: var(--primary-active);
  background: none;
  padding: 0;
}

.settings-wechat-panel .wechat-group-block__copy {
  flex-shrink: 0;
}

@media (max-width: 720px) {
  .profile-studio {
    padding: 22px 20px 18px;
  }

  .profile-studio__layout {
    grid-template-columns: 1fr;
    justify-items: center;
    text-align: center;
    gap: 20px;
  }

  .profile-studio__main {
    width: 100%;
  }

  .profile-studio__title-row {
    justify-content: center;
  }

  .profile-studio__meta {
    justify-content: center;
  }

  .profile-studio__tags {
    justify-content: center;
  }

  .profile-studio__hint {
    margin-left: auto;
    margin-right: auto;
  }

  .profile-studio__stats {
    flex-direction: column;
    margin-top: 26px;
    gap: 12px;
  }

  .profile-studio__stat {
    flex: 1 1 auto;
    text-align: center;
  }

  .profile-studio__actions {
    justify-content: center;
    margin-top: 22px;
    padding-top: 18px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .profile-studio,
  .profile-studio__stat,
  .profile-studio__meter-core .user-avatar {
    animation: none !important;
    transition: none !important;
  }

  .profile-studio {
    opacity: 1;
    transform: none;
  }

  .profile-studio__stat {
    opacity: 1;
    transform: none;
  }
}
