html {
  scrollbar-gutter: stable;
}

#miccosmo-social-links {
  display: grid;
  grid-template-columns: repeat(3, 70px);
  align-items: center;
  justify-content: center;
  gap: 34px;
  box-sizing: border-box;
  width: min(100%, 398px);
  margin: 0;
  padding: 22px 16px;
  border: 0;
  background: #078b70;
  color: #fff;
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
}

.miccosmo-social-entry {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  gap: 5px;
  width: 70px;
  min-width: 70px;
  max-width: 70px;
  padding: 4px;
  border: 0;
  border-radius: 8px;
  background: transparent;
  color: #fff;
  font: inherit;
  font-size: 12px;
  line-height: 1.4;
  text-align: center;
  text-decoration: none;
  cursor: pointer;
  appearance: none;
}

.miccosmo-social-entry svg,
.miccosmo-social-entry img {
  display: block;
  width: 38px;
  height: 38px;
}

.miccosmo-social-entry:hover,
.miccosmo-social-entry:focus-visible {
  background: rgb(255 255 255 / 12%);
  color: #fff;
  outline: 2px solid transparent;
}

.miccosmo-social-entry[aria-disabled='true'] {
  opacity: .72;
  cursor: default;
}

.miccosmo-wechat-dialog[hidden] {
  display: none !important;
}

.miccosmo-wechat-dialog {
  position: fixed;
  z-index: 2147483000;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  padding: 20px;
  background: rgba(0, 0, 0, .58);
  font-family: Arial, "Microsoft YaHei", "PingFang SC", sans-serif;
}

.miccosmo-wechat-panel {
  position: relative;
  box-sizing: border-box;
  width: min(420px, 100%);
  max-height: calc(100vh - 40px);
  overflow: auto;
  padding: 28px 30px 24px;
  border-radius: 14px;
  background: #fff;
  box-shadow: 0 18px 55px rgba(0, 0, 0, .28);
  color: #333;
  text-align: center;
}

.miccosmo-wechat-panel h2 {
  margin: 0 36px 16px;
  font-size: 22px;
  line-height: 1.4;
}

.miccosmo-wechat-panel img {
  display: block;
  box-sizing: border-box;
  width: min(300px, 100%);
  height: auto;
  aspect-ratio: 1;
  margin: 0 auto 12px;
  border: 1px solid #eee;
  image-rendering: auto;
}

.miccosmo-wechat-panel p {
  margin: 0 0 6px;
  font-size: 16px;
}

.miccosmo-wechat-panel small {
  display: block;
  color: #777;
  line-height: 1.6;
}

.miccosmo-wechat-close {
  position: absolute;
  top: 12px;
  right: 12px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 38px;
  height: 38px;
  padding: 0;
  border: 0;
  border-radius: 50%;
  background: #f2f2f2;
  color: #444;
  font-size: 26px;
  line-height: 1;
  cursor: pointer;
}

.miccosmo-wechat-close:hover,
.miccosmo-wechat-close:focus-visible {
  background: #e4e4e4;
  outline: 2px solid #55b94e;
  outline-offset: 2px;
}

body.miccosmo-social-modal-open {
  overflow: hidden !important;
}

body.miccosmo-social-modal-open #miccosmo-social-links {
  border-top-color: transparent;
  border-bottom-color: transparent;
  background: transparent;
}

body.miccosmo-social-modal-open #miccosmo-social-links .miccosmo-social-entry:hover,
body.miccosmo-social-modal-open #miccosmo-social-links .miccosmo-social-entry:focus-visible {
  background: transparent;
  color: #555;
}

@media (max-width: 640px) {
  #miccosmo-social-links {
    grid-template-columns: repeat(3, minmax(58px, 70px));
    gap: 14px;
    width: 100%;
    margin: 0;
    padding: 18px 10px;
  }

  .miccosmo-social-entry {
    min-width: 58px;
    min-height: 58px;
  }

  .miccosmo-social-entry svg,
  .miccosmo-social-entry img {
    width: 36px;
    height: 36px;
  }

  .miccosmo-wechat-dialog {
    padding: 12px;
  }

  .miccosmo-wechat-panel {
    padding: 26px 20px 22px;
  }

  .miccosmo-wechat-panel img {
    width: min(280px, 100%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .miccosmo-social-entry,
  .miccosmo-wechat-close {
    scroll-behavior: auto;
  }
}
