/* 微光AI — 弹窗层级（高于 QQ 窗口） */
.page-weiguang #authModalBackdrop,
.page-weiguang #accountModalBackdrop,
.page-weiguang #captchaBackdrop,
.page-weiguang #rechargeModalBackdrop,
.page-weiguang #inboxModalBackdrop {
  z-index: 8000 !important;
}

.page-weiguang #authModal.modal,
.page-weiguang #accountModal.modal,
.page-weiguang #captchaModal.modal,
.page-weiguang #rechargeModal.modal,
.page-weiguang #inboxModal.modal {
  z-index: 8010 !important;
}

/* 成功/错误提示须压在充值等弹窗之上 */
.page-weiguang #siteUiBackdrop,
.page-weiguang #siteUiDialog {
  z-index: 8100 !important;
}

.page-weiguang .recharge-page {
  padding: 0.5rem 0 1rem;
}

.page-weiguang .modal--recharge .recharge-page__title {
  display: none;
}

/* —— 侧栏账户区 —— */
.wg-account-bar {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
}

.wg-account-user-btn {
  position: relative;
  max-width: 100%;
  overflow: visible;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wg-account-user-btn__dot {
  position: absolute;
  top: 2px;
  right: 4px;
  width: 8px;
  height: 8px;
  border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 0 0 2px rgba(16, 24, 36, 0.9);
  pointer-events: none;
}

.wg-account-user-btn__dot[hidden] {
  display: none !important;
}

.wg-account-user-btn__name {
  display: inline-block;
  max-width: 88px;
  overflow: hidden;
  text-overflow: ellipsis;
  vertical-align: bottom;
}

.wg-account-user-btn[hidden],
.wg-account-card[hidden]:not(.is-open) {
  display: none !important;
}

/* 用户信息卡片（点击用户名弹出） */
.wg-account-card {
  position: absolute;
  left: 8px;
  right: 8px;
  bottom: calc(100% + 8px);
  z-index: 120;
  overflow: visible;
  padding: 12px 12px 10px;
  border-radius: 10px;
  border: 1px solid rgba(0, 229, 255, 0.28);
  background: linear-gradient(165deg, #1a2438 0%, #101820 100%);
  box-shadow:
    0 12px 32px rgba(0, 0, 0, 0.45),
    0 0 0 1px rgba(0, 0, 0, 0.2);
  font-size: 12px;
  color: #dce8ff;
  opacity: 0;
  transform: translateY(6px) scale(0.98);
  pointer-events: none;
  transition:
    opacity 0.2s ease,
    transform 0.22s cubic-bezier(0.22, 1, 0.36, 1);
}

.wg-account-card.is-open {
  opacity: 1;
  transform: translateY(0) scale(1);
  pointer-events: auto;
}

.wg-recharge-tip {
  position: absolute;
  top: 8px;
  right: 8px;
  z-index: 2;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  max-width: calc(100% - 16px);
  margin: 0;
  padding: 4px 8px 4px 6px;
  border: 1px solid rgba(255, 80, 70, 0.45);
  border-radius: 20px;
  background: rgba(60, 18, 18, 0.92);
  color: #ffd4d0;
  font-family: inherit;
  font-size: 10px;
  font-weight: 600;
  line-height: 1.2;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(255, 59, 48, 0.25);
  transition: background 0.15s, transform 0.15s;
}

.wg-recharge-tip:hover {
  background: rgba(90, 24, 24, 0.95);
  transform: translateY(-1px);
}

.wg-recharge-tip[hidden] {
  display: none !important;
}

.wg-recharge-tip__dot {
  flex-shrink: 0;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: #ff3b30;
  box-shadow: 0 0 6px rgba(255, 59, 48, 0.85);
  animation: wg-recharge-pulse 1.6s ease-in-out infinite;
}

@keyframes wg-recharge-pulse {
  0%,
  100% {
    opacity: 1;
    transform: scale(1);
  }
  50% {
    opacity: 0.75;
    transform: scale(1.15);
  }
}

.wg-recharge-tip__text {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wg-account-card__head {
  margin-bottom: 10px;
  padding-bottom: 8px;
  padding-right: 72px;
  border-bottom: 1px solid rgba(255, 255, 255, 0.08);
}

.wg-account-card__title {
  margin: 0;
  font-size: 14px;
  font-weight: 700;
  color: #f0f6ff;
  word-break: break-all;
}

.wg-account-card__meta {
  margin: 4px 0 0;
  font-size: 11px;
  color: #8b9cb8;
}

.wg-account-quotas {
  margin: 0 0 10px;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wg-account-quota {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.wg-account-quota dt {
  margin: 0;
  font-weight: 500;
  color: #9eb0c8;
}

.wg-account-daily-hint {
  margin: 8px 0 0;
  padding: 8px 10px;
  font-size: 11px;
  line-height: 1.45;
  color: #8ec8ff;
  background: rgba(0, 80, 120, 0.22);
  border-radius: 6px;
}

.wg-account-token-feed {
  margin: -2px 0 6px;
  padding: 0;
  font-size: 10px;
  line-height: 1.35;
  color: #7a9ab8;
  text-align: right;
}

.wg-account-token-feed.is-flash {
  color: #ffb4a8;
  transition: color 0.35s ease;
}

.wg-account-quota dd.is-updated {
  animation: wg-quota-flash 0.6s ease;
}

@keyframes wg-quota-flash {
  0% {
    color: #fff;
  }
  100% {
    color: #7ee8ff;
  }
}

.wg-account-quota dd {
  margin: 0;
  font-weight: 600;
  color: #7ee8ff;
  text-align: right;
}

.wg-account-card__actions {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.wg-account-card__btn {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid rgba(255, 255, 255, 0.14);
  border-radius: 7px;
  background: rgba(0, 0, 0, 0.25);
  color: #e8f0ff;
  font-family: inherit;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, border-color 0.15s;
}

.wg-account-card__btn:hover {
  background: rgba(56, 189, 248, 0.18);
  border-color: rgba(56, 189, 248, 0.4);
}

.wg-account-card__btn--primary {
  border-color: rgba(0, 229, 255, 0.45);
  background: linear-gradient(180deg, rgba(0, 229, 255, 0.35), rgba(0, 180, 220, 0.25));
  color: #041018;
}

.wg-account-card__btn--primary:hover {
  filter: brightness(1.06);
}

.wg-account-card__btn--ghost {
  color: #9eb0c8;
  background: transparent;
}

.wg-inbox-badge {
  display: inline-block;
  min-width: 16px;
  margin-left: 6px;
  padding: 0 5px;
  border-radius: 999px;
  background: #ef4444;
  color: #fff;
  font-size: 10px;
  font-weight: 700;
  line-height: 16px;
  vertical-align: middle;
}

.inbox-modal-inner {
  max-height: min(70vh, 520px);
  display: flex;
  flex-direction: column;
}

.inbox-modal-list {
  flex: 1;
  overflow-y: auto;
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 0.75rem;
  padding-right: 4px;
}

.inbox-item {
  padding: 10px 12px;
  border-radius: 8px;
  border: 1px solid rgba(255, 255, 255, 0.1);
  background: rgba(0, 0, 0, 0.2);
}

.inbox-item--unread {
  border-color: rgba(56, 189, 248, 0.45);
  background: rgba(56, 189, 248, 0.08);
}

.inbox-item__head {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  align-items: baseline;
  margin-bottom: 6px;
}

.inbox-item__title {
  margin: 0;
  font-size: 13px;
  font-weight: 700;
  color: #e8f4ff;
}

.inbox-item__time {
  font-size: 11px;
  color: #8fa3bc;
  white-space: nowrap;
}

.inbox-item__body {
  margin: 0;
  font-family: inherit;
  font-size: 12px;
  line-height: 1.5;
  color: #c5d4e8;
  white-space: pre-wrap;
  word-break: break-word;
}

.inbox-modal-empty,
.inbox-modal-err {
  font-size: 13px;
  color: #9eb0c8;
  margin-top: 0.75rem;
}

.inbox-modal-err {
  color: #fca5a5;
}

.wg-auth-stub {
  position: absolute;
  width: 0;
  height: 0;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
}

/* 已登录：用户名 + 退出 */
.wg-account-logged {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 0.5rem;
  width: 100%;
  flex-wrap: wrap;
}

.wg-account-logged[hidden] {
  display: none !important;
}

.wg-account-logged__name {
  font-size: 0.8125rem;
  color: rgba(255, 255, 255, 0.92);
  max-width: 96px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.wg-account-logged__logout {
  appearance: none;
  border: 1px solid rgba(255, 255, 255, 0.22);
  background: rgba(255, 255, 255, 0.06);
  color: rgba(255, 255, 255, 0.85);
  font-size: 0.75rem;
  line-height: 1.2;
  padding: 0.28rem 0.55rem;
  border-radius: 999px;
  cursor: pointer;
  transition: background 0.15s ease, border-color 0.15s ease;
}

.wg-account-logged__logout:hover {
  background: rgba(255, 255, 255, 0.12);
  border-color: rgba(255, 255, 255, 0.35);
}

/* 小程序扫码登录弹窗 */
body.mp-qr-login-open {
  overflow: hidden;
}

.mp-qr-login-modal[hidden] {
  display: none !important;
}

.mp-qr-login-modal {
  position: fixed;
  inset: 0;
  z-index: 8200;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 1rem;
}

.mp-qr-login-mask {
  position: absolute;
  inset: 0;
  background: rgba(8, 12, 20, 0.72);
  backdrop-filter: blur(4px);
}

.mp-qr-login-dialog {
  position: relative;
  z-index: 1;
  width: min(100%, 360px);
  padding: 1.5rem 1.25rem 1.25rem;
  border-radius: 16px;
  background: linear-gradient(165deg, #1a2433 0%, #101824 100%);
  border: 1px solid rgba(255, 255, 255, 0.08);
  box-shadow: 0 24px 64px rgba(0, 0, 0, 0.45);
  text-align: center;
}

.mp-qr-login-close {
  position: absolute;
  top: 0.5rem;
  right: 0.65rem;
  width: 2rem;
  height: 2rem;
  border: none;
  background: transparent;
  color: rgba(255, 255, 255, 0.55);
  font-size: 1.5rem;
  line-height: 1;
  cursor: pointer;
}

.mp-qr-login-close:hover {
  color: rgba(255, 255, 255, 0.9);
}

.mp-qr-login-title {
  margin: 0 0 0.5rem;
  font-size: 1.125rem;
  font-weight: 600;
  color: #fff;
}

.mp-qr-login-hint {
  margin: 0 0 1rem;
  font-size: 0.8125rem;
  line-height: 1.5;
  color: rgba(255, 255, 255, 0.65);
}

.mp-qr-login-stage {
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto 0.75rem;
  padding: 0.75rem;
  border-radius: 12px;
  background: #fff;
  width: fit-content;
  position: relative;
}

.mp-qr-login-stage.is-expired canvas {
  opacity: 0.18;
  filter: grayscale(1);
}

.mp-qr-login-expired {
  position: absolute;
  inset: 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.65rem;
  padding: 0.75rem;
  box-sizing: border-box;
}

.mp-qr-login-expired[hidden] {
  display: none !important;
}

.mp-qr-login-expired-text {
  margin: 0;
  font-size: 0.875rem;
  color: #555;
}

.mp-qr-login-refresh {
  appearance: none;
  border: none;
  border-radius: 999px;
  padding: 0.45rem 1rem;
  font-size: 0.875rem;
  line-height: 1.2;
  color: #fff;
  background: #1677ff;
  cursor: pointer;
}

.mp-qr-login-refresh:hover:not(:disabled) {
  background: #0958d9;
}

.mp-qr-login-refresh:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.mp-qr-login-stage canvas {
  display: block;
}

.mp-qr-login-status {
  margin: 0;
  min-height: 1.25rem;
  font-size: 0.8125rem;
  color: rgba(120, 200, 255, 0.95);
}
