/* ================= 微信扫码登录（首页 + 工作台共用） =================
 * 首页用 auth.css 的 --a-* 变量，工作台用 style.css 的另一套变量，
 * 这里统一写 var(--a-xxx, 硬编码兜底)，两个页面都能正常显示。
 * 卡片骨架直接复用 .auth-mask / .auth-card / .auth-form / .btn / .af-* 。
 */
.wx-hide { display: none !important; }

/* ---- 登录浮层里的「微信扫码登录」入口 ---- */
.wx-login-box { margin-top: 16px; }
.wx-sep {
  display: flex; align-items: center; gap: 10px; margin-bottom: 12px;
  color: var(--a-muted, #8a919f); font-size: 12px; white-space: nowrap;
}
.wx-sep::before, .wx-sep::after {
  content: ''; flex: 1; height: 1px; background: var(--a-line, #e5e7eb);
}
.wx-entry {
  width: 100%; height: 38px; display: flex; align-items: center; justify-content: center; gap: 8px;
  border: 1px solid var(--a-line, #e5e7eb); border-radius: 8px;
  background: #fff; color: var(--a-text, #1f2329);
  font-size: 13px; cursor: pointer; transition: border-color .15s, color .15s;
}
.wx-entry:hover { border-color: #07c160; color: #07c160; }
.wx-ico {
  display: inline-flex; align-items: center; justify-content: center;
  width: 20px; height: 20px; border-radius: 50%;
  background: #07c160; color: #fff; font-size: 11px; font-weight: 700;
  font-family: -apple-system, "Microsoft YaHei", sans-serif;
}
.wx-qr-panel {
  margin-top: 12px; padding: 12px 10px 10px;
  border: 1px solid var(--a-line, #e5e7eb); border-radius: 10px;
  background: var(--a-bg, #f7f9fc); text-align: center;
}
/* WxLogin.js 会往这个容器里 innerHTML 一个 300x300 的 iframe */
.wx-qr-box { min-height: 296px; text-align: center; }
.wx-qr-box iframe { max-width: 100%; border: 0; }
.wx-qr-loading, .wx-qr-err {
  padding: 120px 8px; color: var(--a-muted, #8a919f); font-size: 12.5px; line-height: 1.8;
}
.wx-qr-err { padding: 104px 8px; color: #dc2626; }
.wx-qr-tip { font-size: 12px; color: var(--a-muted, #8a919f); margin-top: 2px; }
.wx-qr-actions { margin-top: 8px; }
.wx-refresh {
  border: 0; background: transparent; color: var(--a-primary, #2563eb);
  font-size: 12px; cursor: pointer; padding: 4px 10px;
}
.wx-refresh:hover { text-decoration: underline; }
.wx-qr-mobile { display: none; font-size: 12px; color: #a45b00; padding: 18px 6px; }

/* ---- 未绑定微信时的「绑定手机号」浮层 ---- */
#wx-bind-mask { z-index: 260; }
#wx-bind-mask .auth-card { width: 420px; }
.wx-bind-user {
  display: flex; align-items: center; gap: 10px; margin-bottom: 14px;
  padding: 10px 12px; border-radius: 8px; background: #f0fdf4;
  border: 1px solid #bbf7d0; color: #166534; font-size: 12.5px;
}
.wx-bind-user img { width: 32px; height: 32px; border-radius: 50%; object-fit: cover; flex: 0 0 32px; }
.wx-bind-user .wx-bind-def {
  width: 32px; height: 32px; border-radius: 50%; flex: 0 0 32px;
  display: inline-flex; align-items: center; justify-content: center;
  background: #07c160; color: #fff; font-size: 13px; font-weight: 700;
}
.wx-bind-tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--a-line, #e5e7eb); margin-bottom: 16px; }
.wx-bind-tab {
  flex: 1; border: 0; background: transparent; padding: 8px 4px 10px;
  font-size: 13px; color: var(--a-muted, #8a919f); cursor: pointer;
  border-bottom: 2px solid transparent; margin-bottom: -1px;
}
.wx-bind-tab.active { color: var(--a-primary, #2563eb); border-bottom-color: var(--a-primary, #2563eb); font-weight: 600; }
.wx-bind-note { font-size: 12px; color: var(--a-muted, #8a919f); margin: 10px 0 0; line-height: 1.6; }

/* ---- 独立「微信扫码注册」浮层：只有二维码，无登录/注册表单 ---- */
#wx-reg-mask { z-index: 255; }
#wx-reg-mask .wx-reg-card { width: 380px; text-align: center; padding: 26px 24px 22px; }
.wx-reg-title { font-size: 17px; font-weight: 700; color: var(--a-text, #1f2329); margin: 16px 0 6px; }
.wx-reg-sub { font-size: 12.5px; color: var(--a-muted, #8a919f); margin: 0 0 16px; line-height: 1.6; }
.wx-reg-qrpanel { margin-top: 0; }
#wx-reg-mask .wx-test-box { margin-top: 14px; }
.wx-reg-foot { margin-top: 16px; font-size: 12.5px; color: var(--a-muted, #8a919f); }
.wx-reg-foot a { color: var(--a-primary, #2563eb); cursor: pointer; }

/* 本地联调区：仅 WX_LOGIN_TEST=1 时渲染，虚线框提示这是测试专用 */
.wx-test-box { margin-top: 12px; padding: 10px 12px; border: 1px dashed #f59e0b; border-radius: 8px; background: #fffbeb; text-align: left; }
.wx-test-hd { font-size: 12px; color: #b45309; font-weight: 600; margin-bottom: 8px; }
.wx-test-btn, .wx-test-reset {
  border: 0; border-radius: 6px; padding: 7px 12px; font-size: 13px; cursor: pointer; margin-right: 8px;
}
.wx-test-btn { background: #f59e0b; color: #fff; }
.wx-test-reset { background: #fff; color: #b45309; border: 1px solid #f59e0b; }
.wx-test-note { font-size: 11px; color: #92400e; margin-top: 8px; line-height: 1.5; }

@media (max-width: 640px) {
  .wx-qr-box, .wx-qr-tip, .wx-qr-actions { display: none; }
  .wx-qr-mobile { display: block; }
  .wx-qr-panel { padding: 4px 10px 10px; }
  #wx-bind-mask .auth-card { width: 100%; max-width: 100%; padding: 22px 18px 18px; }
  #wx-bind-mask .af-input { font-size: 16px; }  /* 防 iOS 聚焦自动放大 */
  #wx-reg-mask .wx-reg-card { width: 100%; max-width: 100%; padding: 22px 18px 18px; }
}
