:root {
  --app-width: 500px;
}

@media screen and (min-width: 500px) and (max-width: 600px) {
  :root {
    --app-width: 600px;
  }
}

@media screen and (min-width: 600px) {
  html {
    font-size: calc(var(--app-width) / (750 / 30)) !important;
    max-width: var(--app-width) !important;
    margin: 0 auto !important;
  }
}

html,
body {
  min-height: 100%;
  width: 100%;
  padding: 0;
  margin: 0;
  display: flex;
  justify-content: center;
}

#app {
  position: relative;
  width: 100%;
  max-width: var(--app-width);
  margin: 0 auto;
  background: transparent !important;
}
#app > :first-child {
  min-height: 100% !important;
}

.kg-loading {
  position: fixed;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: var(--app-width);
  /* min-height: calc(100 * var(--vh)); */
  height: 100%;
  /* #kg-loading åƒ…ä½œç´”è‰²é®ç½©ï¼ˆbackground-color ç”± #theme-init-styles è¨­ç½®ï¼‰ï¼Œä¸è¨­ background-imageã€‚
     èƒŒæ™¯åœ–ç”± body æ‰¿è¼‰ï¼ŒhideFirstScreenLoading æ·¡å‡ºæ™‚å·²ç”± waitForBgImageDecoded ç¢ºä¿ decode å®Œæˆã€‚
     é—œé–‰æ™‚ç”± createApp.js hideFirstScreenLoading() é€šéŽ opacity éŽæ¸¡å¹³æ»‘æ¶ˆå¤± */
  bottom: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  /* ç¡®ä¿ loading å±‚åœ¨ #app ä¹‹ä¸Šï¼Œå› ä¸º #kg-loading å·²ç§»åˆ° #app å¤–é¢ */
  z-index: 9999;
  /* éŽæ¸¡å‹•ç•«ï¼šéš±è—æ™‚å¹³æ»‘æ·¡å‡ºï¼Œé¿å… loading â†’ é¦–é çš„çž¬é–“è·³è®Š */
  transition: opacity 0.3s ease-out;
  /* æå‰è²æ˜Ž will-changeï¼Œé¿å… createApp.js å‹•æ…‹æ·»åŠ æ™‚è§¸ç™¼ Android WebView é‡å»ºåˆæˆå±¤å°Žè‡´èƒŒæ™¯åœ– re-decode é–ƒçˆ */
  will-change: opacity;
}

@media screen and (max-width: 600px) {
  #app {
    width: 100%;
  }

  #app::-webkit-scrollbar {
    width: 0;
    background: transparent;
  }

  .kg-loading {
    width: 100%;
    /* min-height: calc(100 * var(--vh)); */
  }
}

.kg-error {
  display: none;
  position: absolute;
  z-index: 10;
  top: 0;
  left: 0;
  height: 100%;
  width: 100%;
  align-items: center;
  justify-content: center;
  flex-direction: column;
  user-select: none;
  font-size: 24px;
}

.kg-error .refresh {
  /* é»˜èªç´…è‰²ä¸»é¡Œæ¨£å¼ */
  background: linear-gradient(180deg, #ffffec 0%, #fdf09c 33.65%, #b68030 71.5%, #b47d2d 83.5%, #f1bf45 100%);
  width: 60%;
  height: 40px;
  margin: 0 auto;
  margin-top: 80px;
  padding: 0 10px;
  border: 1px solid #530002;
  border-radius: 7px;
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 15px;
  color: #7b1801;
  font-size: 16px;
}

/* è—è‰²ä¸»é¡ŒéŒ¯èª¤æŒ‰éˆ•æ¨£å¼ - é€šéŽ CSS é¸æ“‡å™¨ */
body[theme='theme2'] .kg-error .refresh,
html[data-theme='theme2'] .kg-error .refresh {
  background: linear-gradient(180deg, #4a39ad 0%, #251e5e 100%);
  border: 1px solid #4a39ad;
  color: #d6d0ff;
}

.kg-error .err {
  color: #fff;
  padding: 0 16px;
  text-align: center;
}

.toast {
  position: absolute;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%) translateZ(0);
  z-index: 1; /* ç¢ºä¿ spinner åœ¨ #kg-loading-bg èƒŒæ™¯åœ–ä¹‹ä¸Š */
  /* translateZ(0) å°‡ .toast æå‡ç‚ºç¨ç«‹ GPU åˆæˆå±¤ï¼Œ
     éš”é›¢çˆ¶å…ƒç´  #kg-loading å›  background-color/bg-img è®Šæ›´è§¸ç™¼çš„é‡å…‰æŸµåŒ–ï¼Œ
     é¿å… Android WebView äºŒæ¬¡å•Ÿå‹•æ™‚ favicon çŸ­æš«æ¶ˆå¤± */
  backface-visibility: hidden;
}

.loading-container {
  display: flex;
  justify-content: center;
  align-items: center;
  width: 30px;
  aspect-ratio: 1/1;
  img {
    width: 100%;
    height: 100%;
  }
}

.loading-container-favicon {
  display: flex !important;
  justify-content: center !important;
  align-items: center !important;
  max-width: 150px !important;
  width: auto !important;
}

.loading-container-favicon img {
  /* é»˜è®¤è‡ªé€‚åº”å›¾ç‰‡å¤§å° */
  width: auto !important;
  max-width: 100% !important;
  height: auto !important;
  max-height: 150px !important;
  display: block !important;
  margin: 0 auto !important;
}


.circle {
  border-radius: 50%;
  position: relative;
  margin: 0.2rem auto;
  animation: rotate 1s linear infinite;

  img {
    width: 54px;
    height: 54px;
  }
}

@keyframes rotate {
  0% {
    transform: rotate(0deg);
  }

  100% {
    transform: rotate(360deg);
  }
}

.maintain {
  padding: 0 28px;
  height: 100vh;
  display: none;
}

.maintain .content {
  display: flex;
  flex-direction: column;
  align-items: center;
}

.maintain .maintain_img {
  width: 100%;
  margin-top: 10px;
}

.maintain .maintainTitle {
  color: #d81400;
  font-size: 16px;
  line-height: 22.4px;
  margin-bottom: 30px;
}

.maintain .timeTitle {
  color: #fff;
  font-size: 16px;
  line-height: 22.4px;
}

.maintain .refresh_maintain {
  width: 93px;
  margin-bottom: 22px;
}

.maintain .maintainTime {
  color: #fff;
  font-size: 14px;
  line-height: 19.6px;
  margin-top: 7px;
}

.maintain .share_box {
  position: fixed;
  bottom: 10px;
  max-width: var(--app-width);
  width: 100%;
  left: 50%;
  transform: translateX(-50%);
  justify-content: space-between;

  @media screen and (max-width: 600px) {
    left: 0;
    transform: translate(0);
  }
}

.maintain .share_title {
  text-align: center;
  color: #fff9;
  font-size: 12px;
  line-height: 16.8px;
  margin-bottom: 15px;
}

.maintain .maintainList {
  padding: 0 12px;
  padding-bottom: 28px;
  display: grid;
  grid-template-columns: repeat(4, 1fr);
}

.maintain .maintainList > div {
  position: relative;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: center;
  height: 65px;
}

.maintain .maintainList p:nth-child(1) {
  height: 54px;
  width: 54px;
  border-radius: 50%;
  background-color: #6e050c;
  display: flex;
  align-items: center;
  justify-content: center;
}

.maintain .maintainList p:nth-child(1) img {
  height: 22px;
  width: 22px;
}

.maintain .maintainList p:nth-child(2) {
  position: absolute;
  left: 50%;
  transform: translate(-50%);
  bottom: -30%;
  font-size: 11px;
  line-height: 15.4px;
  text-align: center;
  color: #d4656e;
  margin-top: 10px;
}
