.heyu-qr-float {
  --qr-green: #106a51;
  --qr-deep: #0b513d;
  --qr-ink: #17352a;
  --qr-quiet: #496257;
  --qr-line: #d8e6de;
  --qr-right: max(24px, calc(14px + env(safe-area-inset-right, 0px)));
  --qr-bottom: max(22px, calc(12px + env(safe-area-inset-bottom, 0px)));
  position: fixed;
  z-index: 45;
  right: var(--qr-right);
  bottom: var(--qr-bottom);
  color: var(--qr-ink);
  font-family: inherit;
  line-height: 1.5;
}

.heyu-qr-float__trigger {
  display: flex;
  align-items: center;
  gap: 8px;
  width: max-content;
  min-height: 46px;
  margin-left: auto;
  padding: 9px 15px;
  border: 1px solid rgba(255, 255, 255, .24);
  border-radius: 999px;
  color: #fff;
  background: var(--qr-green);
  box-shadow: 0 5px 17px #0c462849;
  font-size: 14px;
  font-weight: 650;
  white-space: nowrap;
  cursor: pointer;
  list-style: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}

.heyu-qr-float__trigger::-webkit-details-marker { display: none; }
.heyu-qr-float__trigger::marker { content: ""; }
.heyu-qr-float__trigger:hover,
.heyu-qr-float[open] > .heyu-qr-float__trigger { background: var(--qr-deep); }
.heyu-qr-float__trigger:focus-visible,
.heyu-qr-float__close:focus-visible { outline: 2px solid #128461; outline-offset: 3px; }
.heyu-qr-float__trigger svg { display: block; width: 19px; height: 19px; }

.heyu-qr-float__panel {
  position: absolute;
  right: 0;
  bottom: 100%;
  width: 336px;
  max-width: calc(100vw - var(--qr-right) - max(12px, env(safe-area-inset-left, 0px)));
  padding-bottom: 10px;
}

.heyu-qr-float:not([open]) > .heyu-qr-float__panel { display: none; }

.heyu-qr-float__card {
  max-height: calc(100vh - var(--qr-bottom) - 70px);
  max-height: calc(100dvh - var(--qr-bottom) - 70px - env(safe-area-inset-top, 0px));
  overflow: auto;
  overscroll-behavior: contain;
  padding: 13px 15px 15px;
  border: 1px solid var(--qr-line);
  border-radius: 15px;
  background: #fff;
  box-shadow: 0 14px 34px #123b3030;
}

.heyu-qr-float__heading {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 7px;
}

.heyu-qr-float__heading h2 {
  margin: 0;
  color: var(--qr-ink);
  font-size: 17px;
  line-height: 1.3;
  font-weight: 700;
  letter-spacing: normal;
}

.heyu-qr-float__close {
  display: none;
  flex: none;
  align-items: center;
  justify-content: center;
  width: 44px;
  height: 44px;
  margin: -7px -7px -7px 0;
  padding: 0;
  border: 0;
  border-radius: 50%;
  color: var(--qr-deep);
  background: transparent;
  cursor: pointer;
  touch-action: manipulation;
}

.heyu-qr-float[data-heyu-qr-ready] .heyu-qr-float__close { display: inline-flex; }
.heyu-qr-float__close:hover { background: #eff7f2; }
.heyu-qr-float__close svg { display: block; width: 19px; height: 19px; }

.heyu-qr-float__hint {
  margin: 5px 0 12px;
  color: var(--qr-quiet);
  font-size: 12px;
  line-height: 1.5;
}

.heyu-qr-float__options {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 10px;
}

.heyu-qr-float__option { min-width: 0; margin: 0; text-align: center; }

.heyu-qr-float__square {
  display: grid;
  place-items: center;
  width: min(100%, 132px);
  aspect-ratio: 1;
  margin: 0 auto 7px;
}

.heyu-qr-float__square img {
  display: block;
  width: 100%;
  height: 100%;
  padding: 3px;
  border: 1px solid var(--qr-line);
  border-radius: 7px;
  background: #fff;
  object-fit: contain;
}

.heyu-qr-float [hidden] { display: none !important; }

.heyu-qr-float__placeholder {
  display: flex;
  width: 100%;
  height: 100%;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 5px;
  padding: 4px;
  border: 1px dashed #b6d0c2;
  border-radius: 9px;
  color: var(--qr-quiet);
  background: #f2f8f5;
  font-size: 11px;
  line-height: 1.3;
}

.heyu-qr-float__placeholder svg { display: block; width: 23px; height: 23px; color: var(--qr-green); }
.heyu-qr-float__option figcaption strong { display: block; color: var(--qr-ink); font-size: 14px; }
.heyu-qr-float__option figcaption span { display: block; color: var(--qr-quiet); font-size: 12px; }

@media (max-width: 640px) {
  .heyu-qr-float {
    --qr-right: max(12px, calc(8px + env(safe-area-inset-right, 0px)));
    --qr-bottom: max(12px, calc(8px + env(safe-area-inset-bottom, 0px)));
  }

  .heyu-qr-float__trigger { gap: 6px; padding: 8px 12px; font-size: 13px; }
  [data-page="teacher"] .heyu-qr-float__trigger { position:relative;width:46px;padding:0;justify-content:center; }
  [data-page="teacher"] .heyu-qr-float__trigger > span { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap; }
}

@media (max-width: 420px) {
  .heyu-qr-float__trigger { position:relative;width:46px;padding:0;justify-content:center; }
  .heyu-qr-float__trigger > span { position:absolute;width:1px;height:1px;overflow:hidden;clip-path:inset(50%);white-space:nowrap; }
  .site-foot .foot-meta { padding-right:48px; }
}
