:root {
  --site-header-height: 80px;
}

:root:has(.site-header) {
  scroll-padding-top: var(--site-header-height);
}

.site-page {
  padding-top: var(--site-header-height);
}

.site-header {
  --nav-accent: var(--color-accent);
  --nav-hover-background: var(--color-panel);
  position: fixed;
  z-index: 5;
  inset: 0 0 auto;
  color: rgb(0 0 0 / 90%);
}

.site-header--scrolled,
.site-header:has(.site-nav__group > .site-nav__link[aria-expanded='true']),
.site-header:has(.site-mobile-menu[aria-expanded='true']) {
  background: #fff;
}

.site-header--scrolled {
  box-shadow: 0 4px 16px rgb(0 0 0 / 6%);
}

.site-back-to-top {
  position: fixed;
  z-index: 4;
  right: calc(var(--site-gutter) + env(safe-area-inset-right));
  bottom: calc(var(--site-gutter) + env(safe-area-inset-bottom));
  width: 48px;
  height: 48px;
  border: 0;
  border-radius: 50%;
  padding: 0;
  background: #fff;
  color: var(--color-ink);
  box-shadow: 0 4px 24px rgb(0 0 0 / 12%);
  cursor: pointer;
}

.site-back-to-top:not([hidden]) {
  display: grid;
  place-items: center;
}

.site-back-to-top span {
  position: relative;
  width: 20px;
  height: 22px;
  border-top: 2px solid currentColor;
  background: linear-gradient(currentColor, currentColor) center bottom / 2px 16px no-repeat;
}

.site-back-to-top span::before {
  position: absolute;
  top: 5px;
  left: 4px;
  width: 12px;
  height: 12px;
  border-top: 2px solid currentColor;
  border-left: 2px solid currentColor;
  content: '';
  transform: rotate(45deg);
}

.site-header [hidden],
.site-footer [hidden] {
  display: none;
}

.site-header__inner,
.site-header__navigation,
.site-header__actions,
.site-nav {
  display: flex;
  align-items: center;
}

.site-header__inner {
  min-height: var(--site-header-height);
}

.site-header__logo {
  flex: none;
}

.site-header__logo img,
.site-footer__logo {
  display: block;
  width: 148px;
  height: 48px;
  object-fit: contain;
}

.site-header__navigation {
  flex: 1;
  justify-content: space-between;
  margin-left: clamp(24px, calc(50vw - 482px), 182px);
  gap: 18px;
}

.site-nav {
  gap: clamp(18px, calc(10vw - 85px), 48px);
}

.site-header__actions {
  flex: none;
  gap: clamp(18px, calc(8vw - 66px), 40px);
}

.site-nav__link,
.site-header__login,
.site-mobile-menu {
  display: inline-flex;
  flex-shrink: 0;
  align-items: center;
  color: inherit;
  font: inherit;
  font-size: 16px;
  line-height: 24px;
  white-space: nowrap;
  text-decoration: none;
}

.site-nav__link,
.site-mobile-menu {
  border: 0;
  padding: 0;
  background: transparent;
  cursor: pointer;
}

.site-nav__link {
  min-height: var(--site-header-height);
  gap: 4px;
}

.site-nav .site-nav__link:is(:hover, :focus-visible, [aria-current], [aria-expanded='true']),
.site-nav__group:has(.site-nav__feature[aria-current='page']) > .site-nav__link {
  color: var(--nav-accent);
  font-weight: 700;
}

.site-nav__chevron {
  display: grid;
  width: 16px;
  height: 16px;
  place-content: center;
}

.site-nav__chevron::after {
  width: 6px;
  height: 6px;
  border-right: 1.5px solid currentColor;
  border-bottom: 1.5px solid currentColor;
  content: '';
  transform: translateY(-2px) rotate(45deg);
}

.site-header__miniprogram,
.site-nav__group--support {
  position: relative;
}

.site-header__miniprogram .site-nav__link {
  gap: 8px;
  color: #07c160;
}

.site-header__login {
  width: 112px;
  height: 40px;
  justify-content: center;
  border: 1px solid currentColor;
  border-radius: 8px;
  color: var(--nav-accent);
}

.site-header__login:hover {
  background: #fff6e8;
}

.site-mobile-menu {
  display: none;
}

.site-nav__panel {
  position: absolute;
  top: 100%;
  background: #fff;
  box-shadow: 0 4px 16px rgb(0 0 0 / 8%);
}

.site-nav__panel--wide {
  right: 0;
  left: 0;
  padding: 24px 24px 32px;
  box-shadow: 0 4px 16px rgb(0 0 0 / 5%);
}

@media (min-width: 941px) {
  .site-nav__panel--wide {
    z-index: -1;
    max-height: calc(100dvh - var(--site-header-height));
    overflow: auto;
    clip-path: inset(0 0 -24px);
  }
}

#site-feature-menu {
  padding-bottom: 24px;
}

.site-nav__features,
.site-nav__scenes,
.site-nav__support,
.site-footer ul {
  margin: 0;
  padding: 0;
  list-style: none;
}

.site-nav__features,
.site-nav__scenes {
  display: grid;
  width: min(100%, 1000px);
  margin-inline: auto;
}

.site-nav__features {
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 16px 40px;
}

.site-nav__scenes {
  grid-template-columns: repeat(5, minmax(0, 155px));
  justify-content: space-between;
  gap: 16px;
}

.site-nav__feature {
  display: flex;
  min-height: 64px;
  align-items: center;
  gap: 16px;
  margin-inline: -6px;
  padding-inline: 6px;
  border-radius: 8px;
  color: inherit;
  font-size: 16px;
  line-height: 24px;
  text-decoration: none;
}

.site-nav__feature img {
  flex: none;
  object-fit: contain;
}

.site-nav__feature small {
  display: block;
  margin-top: 2px;
  color: rgb(0 0 0 / 40%);
  font-size: 14px;
  line-height: 22px;
}

@media (min-width: 1100px) {
  .site-nav__features small {
    white-space: nowrap;
  }
}

.site-nav__scenes .site-nav__feature {
  min-height: 48px;
}

.site-nav__support {
  top: calc(100% - 10px);
  left: -18px;
  min-width: max-content;
  border-radius: 8px;
  padding: 8px;
  font-size: 14px;
  line-height: 22px;
  box-shadow: 0 4px 12px rgb(0 0 0 / 16%);
}

.site-nav__support a,
.site-nav__support button {
  display: block;
  width: 100%;
  border: 0;
  border-radius: 4px;
  padding: 6px 8px;
  background: none;
  color: inherit;
  font: inherit;
  text-align: left;
  text-decoration: none;
  cursor: pointer;
}

.site-nav__feature:is(:hover, :focus-visible) {
  background: var(--nav-hover-background);
}

.site-nav__support :is(a, button):is(:hover, :focus-visible) {
  background: var(--nav-hover-background);
  color: var(--nav-accent);
}

.site-nav__support-item {
  position: relative;
}

.site-nav__support-qr {
  position: absolute;
  top: 0;
  left: calc(100% + 24px);
  display: none;
  width: 152px;
  justify-items: center;
  gap: 8px;
  border-radius: 8px;
  padding: 8px 16px 16px;
  background: #fff;
  text-align: center;
  box-shadow: 0 4px 12px rgb(0 0 0 / 16%);
}

.site-nav__support-qr small {
  color: rgb(0 0 0 / 55%);
  font-size: 12px;
  line-height: 20px;
}

@media (min-width: 941px) and (hover: hover) and (pointer: fine) {
  .site-nav__support-item:hover .site-nav__support-qr {
    display: grid;
  }
}

.site-qr-card {
  display: grid;
  justify-items: center;
  gap: 6px;
  border-radius: 8px;
  padding: 10px;
  background: #fff;
  color: rgb(0 0 0 / 55%);
  font-size: 14px;
  line-height: 22px;
  text-align: center;
  white-space: nowrap;
  box-shadow: 0 4px 16px rgb(0 0 0 / 12%);
}

.site-qr-card img {
  display: block;
  object-fit: contain;
}

.site-header__miniprogram .site-qr-card {
  right: 0;
}

.site-footer {
  padding: 140px 0 32px;
  background: #111;
  color: rgb(255 255 255 / 60%);
}

.site-footer__main {
  display: grid;
  grid-template-columns: minmax(0, 292px) minmax(0, 854px);
  justify-content: space-between;
  gap: 32px;
}

.site-footer__brand {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
}

.site-footer__brand p {
  margin: 24px 0 32px;
  font-size: 14px;
  line-height: 1.8;
}

.site-footer__social {
  display: flex;
  gap: 32px;
  margin-top: auto;
}

.site-footer__social > div {
  position: relative;
}

.site-footer__social button {
  display: block;
  border: 0;
  padding: 0;
  background: none;
  cursor: pointer;
}

.site-footer__social button img {
  display: block;
}

.site-footer__social button[aria-controls='site-footer-wechat'] img {
  opacity: 0.6;
}

@media (hover: hover) and (pointer: fine) {
  .site-footer__social > div:hover button img {
    opacity: 1;
    /* The gray icons are translucent white. Layer their alpha to brighten them. */
    filter: drop-shadow(0 0 #fff) drop-shadow(0 0 #fff);
  }
}

.site-footer__qr {
  position: absolute;
  z-index: 1;
  bottom: 100%;
  left: 50%;
  margin-bottom: 14px;
  transform: translateX(-50%);
}

.site-footer__qr::before {
  position: absolute;
  inset: 100% 0 auto;
  height: 14px;
  content: '';
}

.site-footer__qr::after {
  position: absolute;
  top: calc(100% - 8px);
  left: calc(50% - 7px);
  width: 14px;
  height: 14px;
  border-radius: 2px;
  background: #fff;
  content: '';
  transform: rotate(45deg);
}

.site-footer__links {
  display: flex;
  justify-content: space-between;
  gap: 20px;
}

.site-footer__group h2 {
  margin: 0 0 32px;
  font-size: 16px;
  font-weight: 400;
  line-height: 24px;
}

.site-footer__group ul {
  display: grid;
  gap: 24px 32px;
}

.site-footer__features {
  grid-auto-flow: column;
  grid-template-rows: repeat(8, auto);
}

.site-footer__group li,
.site-footer__legal {
  font-size: 14px;
  line-height: 18px;
}

.site-footer__group a,
.site-footer__group button,
.site-footer__legal a {
  color: inherit;
  text-decoration: none;
  white-space: nowrap;
}

.site-footer__group button {
  border: 0;
  padding: 0;
  background: none;
  font: inherit;
  cursor: pointer;
}

.site-footer__group a:hover,
.site-footer__group button:hover,
.site-footer__legal a:hover {
  color: #fff;
}

.site-footer__legal {
  display: flex;
  flex-wrap: wrap;
  justify-content: space-between;
  gap: 12px 20px;
  margin-top: 56px;
  color: rgb(255 255 255 / 40%);
}

.site-contact-dialog {
  width: min(280px, calc(100% - 32px));
  border: 0;
  border-radius: 16px;
  padding: 28px;
  color: #222;
  text-align: center;
}

.site-contact-dialog::backdrop {
  background: rgb(0 0 0 / 40%);
}

.site-contact-dialog h2 {
  margin: 0 0 16px;
  font-size: 18px;
}

.site-contact-dialog p {
  margin: 12px 0 0;
  color: #595959;
  font-size: 14px;
}

.site-contact-dialog button {
  position: absolute;
  top: 8px;
  right: 8px;
  border: 0;
  border-radius: 6px;
  padding: 2px 8px;
  background: transparent;
  color: inherit;
  font: inherit;
  font-size: 20px;
  cursor: pointer;
}

@media (max-width: 940px) {
  :root {
    --site-header-height: 64px;
  }

  .site-header__inner {
    justify-content: space-between;
  }

  .site-header__logo img {
    width: 123px;
    height: 40px;
  }

  .site-mobile-menu {
    display: inline-flex;
    gap: 8px;
    border: 1px solid #e8d8bc;
    border-radius: 8px;
    padding: 6px 10px;
  }

  .site-mobile-menu__icon {
    width: 14px;
    height: 10px;
    border-top: 1px solid;
    border-bottom: 1px solid;
    background: linear-gradient(currentColor, currentColor) center / 100% 1px
      no-repeat;
  }

  .site-header__navigation {
    position: absolute;
    top: 100%;
    right: 0;
    left: 0;
    display: none;
    max-height: calc(100dvh - var(--site-header-height));
    margin: 0;
    overflow: auto;
    padding: 12px 24px 20px;
    background: #fff;
    box-shadow: 0 8px 16px rgb(0 0 0 / 12%);
  }

  .site-mobile-menu[aria-expanded='true'] + .site-header__navigation {
    display: grid;
  }

  .site-nav {
    display: grid;
    align-items: start;
    gap: 0;
  }

  .site-nav__link {
    min-height: 44px;
  }

  .site-nav__panel--wide,
  .site-nav__support {
    position: static;
    padding: 8px 0 16px;
    box-shadow: none;
  }

  .site-nav__features,
  .site-nav__scenes {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 12px 16px;
  }

  .site-nav__feature {
    gap: 8px;
    font-size: 14px;
    line-height: 20px;
  }

  .site-nav__feature img {
    width: 28px;
    height: 28px;
  }

  .site-nav__feature small {
    font-size: 12px;
    line-height: 18px;
  }

  .site-header__miniprogram .site-qr-card {
    position: static;
  }

  .site-header__actions {
    align-items: flex-start;
    justify-content: flex-start;
    gap: 24px;
  }

  .site-footer {
    padding-top: 72px;
  }

  .site-footer__main {
    grid-template-columns: minmax(0, 1fr);
    gap: 40px;
  }

  .site-footer__brand p {
    max-width: 292px;
  }

  .site-footer__qr {
    left: 0;
    transform: none;
  }

  .site-footer__qr::after {
    left: 5px;
  }
}

@media (max-width: 620px) {
  .site-footer__links {
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 28px 16px;
  }

  .site-footer__group:first-child {
    grid-column: 1 / -1;
  }

  .site-footer__group h2 {
    margin-bottom: 16px;
  }

  .site-footer__group ul {
    gap: 12px 16px;
  }

  .site-footer__legal {
    margin-top: 36px;
  }
}
