/* Fangxian source-linked base UI rules. */
/*
 * The captured site locks the root document and scrolls an inner legacy
 * container. Long legal documents and narrow article pages must instead use
 * the browser's natural page scroll so touch, wheel and keyboard scrolling all
 * reach the real footer.
 */
html.fx-legal-root,
html.fx-legal-root body.fx-legal-page {
  height: auto !important;
  min-height: 100% !important;
  overflow-x: hidden !important;
  overflow-y: auto !important;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior-y: auto;
}

html.fx-legal-root body.fx-legal-page #scroll_container,
html.fx-legal-root body.fx-legal-page #fx-scaled-scroll-stage,
html.fx-legal-root body.fx-legal-page #overflow_canvas_container {
  height: auto !important;
  min-height: 0 !important;
  overflow: visible !important;
}


/* Keep only the current mobile footer and the compact service launcher. */
@media (max-width: 719px) {
  #mphone_btmnav,
  #mphone_morepop,
  #layer71CD19F73F90B9B4776E8B33D2D0407E,
  .fx-mobile-footer-actions a[href="/shouye.html"] {
    display: none !important;
  }

  .fx-mobile-footer-actions {
    grid-template-columns: repeat(2, minmax(0, 1fr)) !important;
  }

  .fx-mobile-footer-actions > a:first-child {
    grid-column: 1 / -1;
  }

  .mgototop_backToTop {
    right: 14px !important;
    bottom: 132px !important;
  }

  body.fx-source-mobile .wp-mnew_message_form_content {
    overflow: visible !important;
  }

  body.fx-source-mobile form.mesform {
    display: flex !important;
    flex-direction: column !important;
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.fx-source-mobile form.mesform .mfields {
    order: 1;
    width: 100% !important;
  }

  body.fx-source-mobile form.mesform > div {
    order: 2;
  }

  body.fx-source-mobile form.mesform .fx-privacy-consent {
    position: static !important;
    order: 3;
    right: auto !important;
    bottom: auto !important;
    left: auto !important;
    width: calc(100% - 24px) !important;
    min-height: 29px !important;
    margin: 14px 12px 0 !important;
    justify-content: center !important;
    box-sizing: border-box !important;
  }

  body.fx-source-mobile form.mesform .btnsubmit {
    order: 4;
    margin-top: 14px !important;
    transform: none !important;
  }

  body.fx-source-mobile form.mesform .btnsubmit:hover,
  body.fx-source-mobile form.mesform .btnsubmit:focus-visible {
    transform: translateY(-1px) !important;
  }

  body.fx-source-mobile form.mesform .fx-form-alert {
    order: 5;
  }
}

/* Add a restrained gap below the navigation on both legal pages. */
body.fx-legal-page #canvas {
  box-sizing: border-box !important;
  padding-top: 32px !important;
  background: linear-gradient(to bottom, #fff 0, #fff 32px, #f7f7fb 32px, #f7f7fb 100%) !important;
}

@media (max-width: 719px) {
  body.fx-legal-page #scroll_container,
  body.fx-legal-page #fx-scaled-scroll-stage {
    height: auto !important;
    min-height: 0 !important;
    overflow: visible !important;
  }

  body.fx-legal-page #canvas {
    padding-top: 22px !important;
    background: linear-gradient(to bottom, #fff 0, #fff 22px, #f7f7fb 22px, #f7f7fb 100%) !important;
  }

  .fx-mobile-legal-site-header {
    position: relative;
    z-index: 6500;
    display: flex;
    align-items: center;
    width: 100%;
    height: 73px;
    box-sizing: border-box;
    background: #fff;
    border-bottom: 1px solid #eceaf6;
  }

  .fx-mobile-legal-site-header__brand {
    display: block;
    flex: 0 0 165px;
    width: 165px;
    height: 73px;
    overflow: hidden;
    text-decoration: none;
  }

  .fx-mobile-legal-site-header__brand img {
    display: block;
    width: 165px;
    height: 73px;
    object-fit: cover;
  }

  .fx-mobile-legal-site-header__tools,
  .fx-mobile-legal-site-header__languages {
    display: flex;
    align-items: center;
  }

  .fx-mobile-legal-site-header__tools {
    gap: 13px;
    margin-left: auto;
    padding-right: 11px;
  }

  .fx-mobile-legal-site-header__languages {
    gap: 11px;
  }

  .fx-mobile-legal-site-header__languages a,
  .fx-mobile-legal-site-header__languages img {
    display: block;
    width: 27px;
    height: 27px;
  }

  .fx-mobile-legal-site-header__toggle {
    display: flex;
    flex-direction: column;
    align-items: center;
    justify-content: center;
    gap: 6px;
    width: 50px;
    height: 50px;
    padding: 0;
    border: 0;
    border-radius: 0;
    background: transparent;
    color: #4d4398;
    cursor: pointer;
  }

  .fx-mobile-legal-site-header__toggle span {
    display: block;
    width: 30px;
    height: 3px;
    border-radius: 2px;
    background: currentColor;
    transition: transform .18s ease, opacity .18s ease;
  }

  .fx-mobile-legal-site-header.is-open .fx-mobile-legal-site-header__toggle span:first-child {
    transform: translateY(9px) rotate(45deg);
  }

  .fx-mobile-legal-site-header.is-open .fx-mobile-legal-site-header__toggle span:nth-child(2) {
    opacity: 0;
  }

  .fx-mobile-legal-site-header.is-open .fx-mobile-legal-site-header__toggle span:last-child {
    transform: translateY(-9px) rotate(-45deg);
  }

  .fx-mobile-legal-site-header__menu {
    position: absolute;
    top: 73px;
    right: 0;
    left: 0;
    z-index: 1;
    display: grid;
    grid-template-columns: repeat(2, minmax(0, 1fr));
    gap: 1px;
    padding: 12px;
    background: #f1eff9;
    box-shadow: 0 12px 26px rgba(35, 29, 78, .16);
  }

  .fx-mobile-legal-site-header__menu[hidden] {
    display: none !important;
  }

  .fx-mobile-legal-site-header__menu a {
    display: flex;
    align-items: center;
    min-height: 44px;
    padding: 0 15px;
    box-sizing: border-box;
    background: #fff;
    color: #4d4398;
    font-size: 15px;
    text-decoration: none;
  }
}
