/*
 * Mome H5 提交校验与生成加载页 v1
 * 设计基准：853×1844 @2x，逻辑画布 430×930。
 * 只覆盖手机视口、Toast 与 loading；生成状态仍由原 API 轮询收口。
 */

:root {
  --loading-accent: #b52a2b;
  --loading-inactive: #f0c4ba;
  --loading-title: #2e3030;
  --loading-copy: #62625f;
}

html {
  width: 100%;
  height: 100%;
  min-height: 100%;
  -webkit-text-size-adjust: 100%;
  text-size-adjust: 100%;
}

body {
  width: 100%;
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
}

.phone-page {
  width: 100%;
  max-width: var(--h5-page-max, 430px);
  min-height: 100vh;
  min-height: 100svh;
  min-height: 100dvh;
}

/* 移动端 Toast：与业务节点 #toast/.active 保持一致。 */
.toast {
  bottom: calc(var(--h5-footer-height, 74px) + max(18px, env(safe-area-inset-bottom)));
  min-width: 212px;
  max-width: calc(100vw - 32px);
  padding: 13px 20px;
  border-radius: 11px;
  background: rgba(55, 55, 55, .94);
  color: #fff;
  font-size: 16px;
  line-height: 24px;
  font-weight: 500;
  box-shadow: 0 8px 24px rgba(0, 0, 0, .18);
  backdrop-filter: blur(8px);
}

/* 外层只负责桌面验收底色；430px 内的 loading-card 才是手机画布。 */
.loading-mask {
  align-items: stretch;
  justify-content: center;
  width: 100%;
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-height: 100%;
  overflow: hidden;
  padding: 0;
  background: #f4f0ec;
}

.loading-mask.active {
  display: flex;
}

.loading-card {
  position: relative;
  width: 100%;
  max-width: var(--h5-page-max, 430px);
  height: 100vh;
  height: 100svh;
  height: 100dvh;
  min-height: 100%;
  overflow: hidden;
  padding: 0;
  color: var(--loading-title);
  text-align: center;
  transform: none;
  background:
    radial-gradient(ellipse at 18% 13%, rgba(255, 246, 235, .82), transparent 38%),
    radial-gradient(ellipse at 86% 42%, rgba(255, 243, 229, .7), transparent 34%),
    radial-gradient(ellipse at 23% 82%, rgba(248, 226, 209, .55), transparent 36%),
    linear-gradient(180deg, #fbeddd 0%, #fcefe0 48%, #f7e2d1 100%);
}

.loading-content {
  display: flex;
  position: absolute;
  z-index: 1;
  top: 48.2%;
  left: 50%;
  width: 100%;
  flex-direction: column;
  align-items: center;
  padding: 0 16px;
  transform: translate(-50%, -50%);
}

.progress-ring {
  position: relative;
  display: block;
  width: min(62.8vw, 270px);
  height: 132px;
  margin: 0 auto 10px;
  background-image: url("/static/assets/loading-cats.gif?v=f735ea05");
  background-repeat: no-repeat;
  background-position: top center;
  background-size: 100% auto;
}

.progress-text {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  color: var(--loading-accent);
  font-size: 26px;
  line-height: 36px;
  font-weight: 700;
  letter-spacing: 0;
  font-variant-numeric: tabular-nums;
}

.loading-title {
  margin: 0;
  color: var(--loading-title);
  font-size: 28px;
  line-height: 40px;
  font-weight: 700;
  letter-spacing: .01em;
}

.loading-desc {
  margin: 9px 0 0;
  color: var(--loading-copy);
  font-size: 14px;
  line-height: 24px;
  font-weight: 400;
}

.loading-desc span {
  display: block;
  white-space: nowrap;
}

@media (max-width: 380px) {
  .toast {
    min-width: 0;
    font-size: 15px;
  }

  .progress-ring {
    width: min(62.8vw, 250px);
    height: 120px;
    margin-bottom: 8px;
  }

  .progress-text {
    font-size: 24px;
    line-height: 34px;
  }

  .loading-title {
    font-size: clamp(24px, 6.5vw, 28px);
    line-height: 36px;
  }

  .loading-desc {
    margin-top: 7px;
    font-size: 13px;
    line-height: 22px;
  }
}

@media (max-height: 699px) and (orientation: portrait) {
  .loading-content {
    top: 50%;
  }

  .progress-ring {
    width: min(62.8vw, 220px);
    height: 108px;
    margin-bottom: 6px;
  }

  .loading-title {
    font-size: clamp(23px, 6vw, 27px);
    line-height: 34px;
  }

  .loading-desc {
    margin-top: 6px;
    line-height: 21px;
  }
}

@media (max-height: 519px), (orientation: landscape) and (max-height: 600px) {
  .loading-card {
    min-height: 100%;
    overflow-y: auto;
  }

  .loading-content {
    position: relative;
    top: auto;
    left: auto;
    min-height: 100%;
    justify-content: center;
    padding:
      max(24px, env(safe-area-inset-top))
      max(16px, env(safe-area-inset-right))
      max(24px, env(safe-area-inset-bottom))
      max(16px, env(safe-area-inset-left));
    transform: none;
  }

  .progress-ring {
    width: min(48vw, 210px);
    height: 102px;
  }
}

@media (min-width: 431px) {
  .loading-card {
    box-shadow: 0 0 34px rgba(74, 43, 24, .08);
  }
}

/* Toast VisualViewport positioning v2 */
.toast{top:var(--toast-top,50%);bottom:auto;z-index:90;opacity:0;transform:translate(-50%,-50%) scale(.96);transition:opacity .18s ease,transform .18s ease,top .12s ease}
.toast.active{opacity:1;transform:translate(-50%,-50%) scale(1)}
.toast[data-keyboard-open="true"]{box-shadow:0 7px 22px rgba(0,0,0,.22)}