/* Chinese social channels use the footer's shared icon sizing. */
.social-links :is(.social-qr-trigger, .social-cn-link) { display: none; }
html[lang="zh-CN"] .social-links :is(.social-qr-trigger, .social-cn-link) { display: flex; }
html[lang="zh-CN"] .social-links .social-en-link { display: none; }
:is(.social-qr-trigger, .social-cn-link) img { width: 26px; height: 26px; object-fit: contain; opacity: .82; transition: opacity .18s ease; }
:is(.social-qr-trigger, .social-cn-link):hover img,
.social-qr-trigger[aria-expanded="true"] img { opacity: 1; }
.social-qr-trigger.social-qr-xiaohongshu img { width: 34px; }
.social-bilibili-link img { width: 44px; }

/* The registration link shares the copyright's size and only appears in Chinese. */
.footer-icp { display: none; font-size: inherit; line-height: inherit; }
html[lang="zh-CN"] .footer-copyright {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 16px;
  width: max-content;
  white-space: nowrap;
}
html[lang="zh-CN"] .footer-icp { display: inline; }
.footer-icp:hover { text-decoration: underline; text-underline-offset: 3px; }

/* Body-level cards remain screen-sized, outside the scaled/clipped footer. */
.social-qr-card {
  position: fixed;
  z-index: 80;
  width: min(240px, calc(100vw - 32px));
  max-height: calc(100dvh - 32px);
  padding: 12px;
  overflow: auto;
  border: 1px solid rgb(36 37 37 / .15);
  border-radius: 4px;
  background: #fff;
  color: #242525;
  box-shadow: 0 8px 32px rgb(36 37 37 / .09);
  font-family: Inter, -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  text-align: center;
  opacity: 0;
  transform: translateY(8px) scale(.975);
  transform-origin: bottom center;
  pointer-events: none;
  transition: opacity .2s ease, transform .24s cubic-bezier(.2, .7, .2, 1);
}
.social-qr-card[hidden],
html:not([lang="zh-CN"]) .social-qr-card { display: none; }
.social-qr-card.is-open { opacity: 1; transform: none; pointer-events: auto; }
.social-qr-card h2 { margin: 0 0 8px; font: 500 13px/1.5 Inter, "PingFang SC", "Microsoft YaHei", sans-serif; letter-spacing: .04em; }
.social-qr-card img { width: 100%; height: auto; background: #fff; }
.social-qr-card p { margin: 8px 0 0; font-size: 12px; line-height: 1.6; color: #777; }

@media (max-width: 1023px) {
  html[lang="zh-CN"] .footer-copyright { max-width: calc(100% - 40px); }
  .social-links :is(.social-qr-trigger, .social-cn-link) img { max-width: 26px; max-height: 26px; }
  .social-links .social-qr-xiaohongshu img { max-width: 34px; width: 34px; }
  .social-links .social-bilibili-link img { max-width: 44px; width: 44px; }
}
@media (max-width: 599px) {
  html[lang="zh-CN"] .site-footer { --footer-meta-height: 150px; }
  html[lang="zh-CN"] .footer-motto { bottom: 100px; }
  html[lang="zh-CN"] .social-links { bottom: 42px; }
  html[lang="zh-CN"] .footer-copyright {
    left: 50%;
    right: auto;
    bottom: 16px;
    transform: translateX(-50%);
    flex-wrap: wrap;
    gap: 4px 14px;
  }
}
@media (max-width: 359px) {
  html[lang="zh-CN"] .site-footer { --footer-meta-height: 166px; }
  html[lang="zh-CN"] .footer-motto { bottom: 116px; }
  html[lang="zh-CN"] .social-links { bottom: 58px; }
}
@media (prefers-reduced-motion: reduce) {
  .social-qr-card, :is(.social-qr-trigger, .social-cn-link) img { transition: none; transform: none; }
}
