:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", "Helvetica Neue", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

html,
body {
  width: 100%;
  min-height: 100%;
  margin: 0;
}

body {
  color: #000;
  background: #fff;
  font-size: 16px;
}

a {
  text-decoration: none;
}

img {
  display: block;
  max-width: 100%;
  border: 0;
  pointer-events: none;
}

.page-box {
  width: 100%;
  max-width: 550px;
  margin: 0 auto;
}

.page-img,
.page-img img,
.bottom-box,
.bottom-box img {
  width: 100%;
}

.page-img {
  /* 图片尚未解密/加载时先保留一个合理高度，加载后由脚本替换成真实值。 */
  padding-bottom: max(var(--bottom-height, 0px), var(--bottom-fallback, clamp(88px, 30vw, 165px)));
}

.bottom-box {
  position: fixed;
  z-index: 99;
  right: 0;
  bottom: 0;
  left: 0;
  max-width: 550px;
  margin: 0 auto;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: #fff;
  cursor: pointer;
}

.kefu {
  position: fixed;
  z-index: 100;
  top: 40%;
  right: 0;
  width: 100px;
}

.kefu img {
  width: 100%;
  animation: pulse 2.5s ease-in-out infinite;
}

.qr-open {
  overflow: hidden;
}

.desktop-qr {
  position: fixed;
  z-index: 1000;
  inset: 0;
  display: flex;
  min-height: 100vh;
  padding: 24px;
  color: #fff;
  background: rgba(8, 10, 18, .68);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  align-items: center;
  justify-content: center;
  text-align: center;
}

.desktop-qr__card {
  width: min(92vw, 360px);
  padding: 28px 28px 24px;
  border: 1px solid rgba(255, 255, 255, .72);
  border-radius: 24px;
  background: rgba(255, 255, 255, .94);
  box-shadow: 0 24px 80px rgba(0, 0, 0, .4);
}

.desktop-qr__title {
  margin: 0;
  color: #151821;
  font-size: 24px;
  font-weight: 700;
  letter-spacing: .04em;
}

.desktop-qr__code {
  position: relative;
  display: grid;
  width: 260px;
  height: 260px;
  margin: 22px auto 0;
  padding: 20px;
  border: 1px solid #eceef3;
  border-radius: 18px;
  background: #fff;
  box-shadow: 0 10px 30px rgba(25, 32, 56, .12);
  place-items: center;
}

.desktop-qr__code::before {
  position: absolute;
  inset: 8px;
  border: 2px solid #ff4f7b;
  border-radius: 13px;
  content: "";
  pointer-events: none;
  clip-path: polygon(0 0, 22px 0, 22px 2px, 2px 2px, 2px 22px, 0 22px, 0 0, 100% 0, 100% 22px, calc(100% - 2px) 22px, calc(100% - 2px) 2px, calc(100% - 22px) 2px, calc(100% - 22px) 0, 100% 0, 100% 100%, calc(100% - 22px) 100%, calc(100% - 22px) calc(100% - 2px), calc(100% - 2px) calc(100% - 2px), calc(100% - 2px) calc(100% - 22px), 100% calc(100% - 22px), 100% 100%, 0 100%, 0 calc(100% - 22px), 2px calc(100% - 22px), 2px calc(100% - 2px), 22px calc(100% - 2px), 22px 100%, 0 100%);
}

.desktop-qr__loading {
  color: #8a8f9c;
  font-size: 14px;
}

.desktop-qr__text {
  margin: 20px 0 0;
  color: #303440;
  font-size: 16px;
  line-height: 1.6;
}

.desktop-qr__hint {
  display: block;
  margin-top: 4px;
  color: #9297a3;
  font-size: 13px;
}

.desktop-qr__fallback {
  display: inline-block;
  max-width: 210px;
  color: #111;
  font-size: 12px;
  overflow-wrap: anywhere;
}

@keyframes pulse {
  0%, 25%, 75%, 100% { transform: scale(1); }
  50% { transform: scale(.8); }
}

@media (max-width: 768px) {
  .kefu {
    width: 70px;
  }
}

@media (prefers-reduced-motion: reduce) {
  .kefu img {
    animation: none;
  }
}
