/* V34.6 — WeChat official widget: full-content responsive layout
   Fixes V34.5 over-cropping after scan/authorization while keeping the
   login/register/bind widget centered and visually compact. */

.wechat-qr-dialog{
  max-height:94vh!important;
  overflow-y:auto!important;
  overflow-x:hidden!important;
}

.wechat-qr-stage{
  width:100%!important;
  display:flex!important;
  align-items:flex-start!important;
  justify-content:center!important;
  padding:4px 0 0!important;
  box-sizing:border-box!important;
}

/* The official WxLogin iframe changes its inner screen after scanning.
   Do not crop it: reserve enough height for QR, avatar, confirmation text
   and the green quick-login button. */
.wechat-qr-code{
  position:relative!important;
  width:330px!important;
  height:420px!important;
  min-width:0!important;
  min-height:420px!important;
  margin:0 auto!important;
  padding:0!important;
  overflow:hidden!important;
  border:1px solid #d9e6f5!important;
  border-radius:20px!important;
  background:#fff!important;
  box-shadow:0 12px 30px rgba(42,97,159,.09)!important;
  display:flex!important;
  align-items:flex-start!important;
  justify-content:center!important;
  box-sizing:border-box!important;
}

.wechat-qr-code>div{
  width:100%!important;
  height:420px!important;
  min-height:420px!important;
  margin:0!important;
  padding:0!important;
  overflow:hidden!important;
  display:flex!important;
  align-items:flex-start!important;
  justify-content:center!important;
  box-sizing:border-box!important;
}

.wechat-qr-code iframe{
  display:block!important;
  flex:0 0 300px!important;
  width:300px!important;
  height:400px!important;
  min-width:300px!important;
  min-height:400px!important;
  margin:0 auto!important;
  padding:0!important;
  border:0!important;
  transform:scale(1.05)!important;
  transform-origin:50% 0!important;
}

/* Fallback renderers. */
.wechat-qr-code img,
.wechat-qr-code canvas{
  display:block!important;
  width:300px!important;
  height:300px!important;
  max-width:300px!important;
  max-height:300px!important;
  margin:12px auto 0!important;
  object-fit:contain!important;
}

.wechat-qr-loading{
  width:100%!important;
  min-height:360px!important;
  display:grid!important;
  place-items:center!important;
  padding:20px!important;
  text-align:center!important;
  box-sizing:border-box!important;
}

@media(max-width:620px){
  .wechat-qr-dialog{
    width:min(96vw,520px)!important;
    max-height:96vh!important;
  }
  .wechat-qr-code{
    width:310px!important;
    height:404px!important;
    min-height:404px!important;
    max-width:100%!important;
  }
  .wechat-qr-code>div{
    height:404px!important;
    min-height:404px!important;
  }
  .wechat-qr-code iframe{
    width:300px!important;
    height:400px!important;
    min-width:300px!important;
    min-height:400px!important;
    flex-basis:300px!important;
    transform:scale(1.0)!important;
  }
  .wechat-qr-code img,
  .wechat-qr-code canvas{
    width:280px!important;
    height:280px!important;
    max-width:280px!important;
    max-height:280px!important;
  }
}
