.sidebar-account {
  position: relative;
  flex: 0 0 auto;
  width: 100%;
  margin-top: auto;
  padding-top: 12px;
  border-top: 1px solid rgba(157, 180, 230, .17);
}

.sidebar-user-button {
  position: relative;
  display: flex;
  width: 100%;
  min-width: 0;
  min-height: 48px;
  align-items: center;
  overflow: hidden;
  padding: 6px;
  border: 1px solid transparent;
  border-radius: 10px;
  color: #e7edfa;
  background: transparent;
  text-align: left;
  transition: border-color .18s ease, background-color .18s ease;
  -webkit-app-region: no-drag;
  app-region: no-drag;
}

.sidebar-user-button:hover,
.sidebar-user-button[aria-expanded="true"] {
  border-color: rgba(157, 180, 230, .16);
  background: rgba(139, 163, 213, .12);
}

.sidebar-user-avatar {
  position: absolute;
  top: 50%;
  left: 6px;
  display: grid;
  width: 36px;
  height: 36px;
  overflow: hidden;
  place-items: center;
  border: 1px solid rgba(199, 213, 241, .42);
  border-radius: 50%;
  color: #bfcee9;
  background: rgba(157, 180, 230, .14);
  transform: translateY(-50%);
}

.sidebar-user-avatar-placeholder,
.sidebar-user-avatar-image {
  display: block;
  width: 100%;
  height: 100%;
}

.sidebar-user-avatar-image { object-fit: cover; }
.sidebar-user-avatar-placeholder[hidden],
.sidebar-user-avatar-image[hidden] { display: none; }

.sidebar-user-copy {
  display: flex;
  flex: 1 1 auto;
  min-width: 0;
  margin-left: 46px;
  max-width: clamp(0px, calc(var(--sidebar-width) - 78px), 72px);
  flex-direction: column;
  gap: 3px;
  overflow: hidden;
  opacity: var(--sidebar-label-opacity);
  transition: opacity .24s ease;
}

.sidebar-user-name,
.sidebar-user-provider {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.sidebar-user-name { color: #f5f7fc; font-size: 12px; font-weight: 650; }
.sidebar-user-provider { color: #9eafcc; font-size: 10px; line-height: 1.25; }

body.sidebar-collapsed .sidebar-user-button {
  justify-content: flex-start;
  padding-right: 0;
}

body.sidebar-collapsed .sidebar-user-copy { max-width: 0; opacity: 0; }

.user-profile-popover {
  position: fixed;
  z-index: 30;
  bottom: 82px;
  left: 14px;
  width: 232px;
  padding: 16px;
  border: 1px solid rgba(206, 216, 234, .88);
  border-radius: 14px;
  color: #24314b;
  background: #fff;
  box-shadow: 0 16px 42px rgba(15, 27, 51, .22);
  -webkit-app-region: no-drag;
  app-region: no-drag;
}

.user-profile-popover[hidden] { display: none; }
body.sidebar-collapsed .user-profile-popover { bottom: 18px; left: calc(var(--sidebar-collapsed-width) + 12px); }
.user-profile-card { display: flex; min-width: 0; flex-direction: column; gap: 5px; }
.user-profile-status { display: flex; align-items: center; gap: 7px; margin-bottom: 5px; color: #78849a; font-size: 11px; }
.user-profile-status i { width: 7px; height: 7px; border-radius: 50%; background: #20a981; box-shadow: 0 0 0 3px #e8f8f3; }
.user-profile-name { overflow: hidden; color: #192235; font-size: 15px; font-weight: 700; text-overflow: ellipsis; white-space: nowrap; }
.user-profile-handle { overflow: hidden; color: #748099; font-size: 12px; text-overflow: ellipsis; white-space: nowrap; }
.user-profile-provider { margin-top: 7px; padding-top: 10px; border-top: 1px solid #edf0f5; color: #8490a5; font-size: 11px; }
.user-profile-message { margin: 8px 0 0; color: #b74355; font-size: 11px; line-height: 1.5; }
.user-profile-logout { align-self: flex-start; margin-top: 10px; padding: 6px 9px; border: 1px solid #e6eaf1; border-radius: 7px; color: #637087; background: #fff; font-size: 11px; }
.user-profile-logout:hover { border-color: #edc7cd; color: #b74355; background: #fffafb; }

.user-auth-dialog {
  width: min(420px, calc(100vw - 32px));
  max-width: none;
  max-height: calc(100vh - 32px);
  padding: 0;
  overflow: auto;
  border: 0;
  border-radius: 22px;
  color: #192235;
  background: transparent;
  box-shadow: 0 26px 80px rgba(8, 17, 36, .34);
}

.user-auth-dialog::backdrop { background: rgba(13, 22, 39, .58); backdrop-filter: blur(4px); }
.user-auth-dialog-card { position: relative; padding: 34px 36px 28px; background: #fff; text-align: center; }
.user-auth-close { position: absolute; top: 14px; right: 15px; display: grid; width: 32px; height: 32px; place-items: center; border: 0; border-radius: 50%; color: #8993a5; background: transparent; font-size: 23px; line-height: 1; }
.user-auth-close:hover { color: #34415a; background: #f1f3f8; }
.user-auth-mark { display: block; width: 48px; height: 48px; margin: 0 auto 13px; object-fit: contain; }
.user-auth-title { margin: 0; color: #202a3c; font-size: 23px; letter-spacing: -.4px; }
.user-auth-description { margin: 8px 0 22px; color: #8792a5; font-size: 13px; }
.auth-provider-list { display: grid; gap: 10px; }
.auth-provider-button { display: flex; width: 100%; min-height: 48px; align-items: center; gap: 13px; padding: 0 15px; border: 1px solid #e6eaf1; border-radius: 11px; color: #354158; background: #fff; text-align: left; font-size: 13px; font-weight: 620; transition: border-color .16s ease, background-color .16s ease, transform .16s ease; }
.auth-provider-button:hover { transform: translateY(-1px); border-color: #cdd5e4; background: #fbfcfe; }
.auth-provider-logo { display: block; flex: 0 0 22px; width: 22px; height: 22px; background-color: #20242c; mask: center / contain no-repeat; -webkit-mask: center / contain no-repeat; }
.auth-provider-github .auth-provider-logo { mask-image: url("../../assets/providers/github.svg"); -webkit-mask-image: url("../../assets/providers/github.svg"); background-color: #20242c; }
.auth-provider-qq .auth-provider-logo { mask-image: url("../../assets/providers/qq.svg"); -webkit-mask-image: url("../../assets/providers/qq.svg"); background-color: #12a9e8; }
.auth-provider-wechat .auth-provider-logo { mask-image: url("../../assets/providers/wechat.svg"); -webkit-mask-image: url("../../assets/providers/wechat.svg"); background-color: #07a95a; }
.auth-provider-arrow { margin-left: auto; color: #a7b0c0; font-size: 16px; font-weight: 400; }
.user-auth-status { min-height: 18px; margin: 14px 0 0; color: #6f7e96; font-size: 11px; line-height: 1.5; }
.user-auth-status.is-error { color: #b74355; }
.user-auth-footnote { margin: 18px 0 0; padding-top: 14px; border-top: 1px solid #edf0f5; color: #9aa4b5; font-size: 10px; }

@media (prefers-reduced-motion: reduce) {
  .sidebar-user-button,
  .sidebar-user-copy,
  .auth-provider-button { transition: none; }
}
