/* 全站外壳：统一账号登录区 + 登录遮罩 + 轻提示
   只作用于 ps- 前缀，不碰原有 app.css；sso-ui 自带的 Shadow DOM 样式也不受这里影响。 */

.ps-auth { display: inline-flex; align-items: center; margin-left: auto; }
.ps-auth.floating { position: fixed; top: 10px; right: 14px; z-index: 900; }
.ps-auth-inner { display: inline-flex; align-items: center; gap: 8px; }

.ps-auth-btn {
  border: 1px solid #dfe5ff; background: #eef1ff; color: #3b56c4;
  border-radius: 999px; padding: 7px 14px; font-size: 12.5px; font-weight: 600;
  white-space: nowrap; line-height: 1.2; transition: background .15s, transform .15s;
}
.ps-auth-btn:hover { background: #e2e8ff; transform: translateY(-1px); }
.ps-auth-btn.ghost { background: #fff; color: #6b7688; border-color: #e3e8f0; }
.ps-auth-btn.ghost:hover { background: #f6f8fc; }

.ps-auth-user {
  display: inline-flex; align-items: center; gap: 7px;
  max-width: 190px; color: #1c2434; font-size: 12.5px; font-weight: 600;
}
.ps-auth-user img, .ps-auth-avatar {
  width: 24px; height: 24px; border-radius: 50%; flex: 0 0 auto; object-fit: cover;
}
.ps-auth-avatar {
  display: grid; place-items: center; color: #fff; font-size: 12px;
  background: linear-gradient(135deg, #4f6bed, #7b5cf0);
}
.ps-auth-name { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* 登录面板遮罩：z-index 高于 aichat 挂件，避免气泡压在登录框上 */
.ps-auth-overlay {
  position: fixed; inset: 0; z-index: 2147483000;
  display: flex; align-items: flex-start; justify-content: center;
  padding: 8vh 16px 24px; overflow: auto;
  background: rgba(16, 22, 38, .46); backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: ps-fade .18s ease-out;
}
@keyframes ps-fade { from { opacity: 0 } to { opacity: 1 } }
.ps-auth-panel { width: 100%; max-width: 420px; }
.ps-sso-host { width: 100%; }

.ps-toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px);
  z-index: 2147483001; max-width: min(88vw, 420px);
  padding: 10px 16px; border-radius: 10px; font-size: 13px; line-height: 1.5;
  background: rgba(23, 30, 48, .94); color: #fff; box-shadow: 0 10px 30px rgba(0,0,0,.22);
  opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.ps-toast.show { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 640px) {
  .ps-auth-user { max-width: 96px; }
  .ps-auth-btn { padding: 6px 10px; font-size: 12px; }
  .viewer-bar .actions { gap: 5px; }
}

/* 微信内授权失败后的公众号二维码兜底层（只在 MicroMessenger 内出现） */
.ps-mp-overlay {
  position: fixed; inset: 0; z-index: 2147483002;
  display: flex; align-items: center; justify-content: center;
  padding: 24px 16px; overflow: auto;
  background: rgba(16, 22, 38, .52); backdrop-filter: blur(3px);
  -webkit-backdrop-filter: blur(3px);
  animation: ps-fade .18s ease-out;
}
.ps-mp-card {
  width: 100%; max-width: 320px; box-sizing: border-box;
  padding: 22px 20px 20px; border-radius: 16px; text-align: center;
  background: #fff; box-shadow: 0 18px 50px rgba(0,0,0,.24);
}
.ps-mp-title { margin: 0 0 14px; font-size: 16px; font-weight: 700; color: #1c2434; }
.ps-mp-qr {
  display: block; width: 180px; height: 180px; margin: 0 auto 14px;
  object-fit: contain; border: 1px solid #eceff5; border-radius: 10px;
  background: #fff; -webkit-touch-callout: default;
}
.ps-mp-desc { margin: 0 0 18px; font-size: 13px; line-height: 1.65; color: #5c6678; text-align: left; }
.ps-mp-actions { display: flex; gap: 10px; justify-content: center; }
.ps-mp-actions .ps-auth-btn { flex: 1; padding: 9px 12px; font-size: 13px; }
