@font-face {
  font-family: "M13 Nunito";
  font-style: normal;
  font-weight: 400 1000;
  font-display: swap;
  src: url("./Nunito-Latin-Variable.woff2") format("woff2");
}

/* 注册 stage 竖屏缩放系数 CSS 变量。
   浏览器：Houdini @property 把 --stage-scale 强类型为 <number>，
   没被 JS 注入时 (Safari < 16.4 / 极老 Android WebView) 直接取
   initial-value 0.52 作 scale() 输入，行为与 scale(0.52) magic
   number 一致；JS 注入后立刻被精确值覆盖。
   WebStorm：找到 @property 声明，把 var(--stage-scale) 推为 number
   → 同时消除 "Cannot resolve '--stage-scale' custom property" 和
   scale(var(...)) 的 "Mismatched parameters" 误报。 */
/* 注意：两个缩放变量的 inherits 必须为 true！
   JS 把值注入在 document.documentElement(:root) 上，
   若 inherits: false，自定义属性不会向后代继承，
   .m13-loading__stage 只能回退到 initial-value ——
   竖屏 390x844 时真实值恰等于 fallback 0.52 看不出问题，
   但 iPad 竖屏(768x1024 真实 1.024)与所有横屏(真实值远大于 1)
   都会显示异常(不缩放/缩放不足)，即"启动动画显示不完整"。 */
@property --stage-scale {
  syntax: "<number>";
  inherits: true;
  initial-value: 0.52;
}

/* 横屏 stage 的 contain 缩放系数：JS 按 min(innerWidth/1624, innerHeight/750)
   注入；未注入时取 initial-value 1，即按设计稿原始尺寸 1624x750 显示。 */
@property --stage-scale-landscape {
  syntax: "<number>";
  inherits: true;
  initial-value: 1;
}

.m13-loading-demo {
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #0796af;
}

.m13-loading,
.m13-loading *,
.m13-loading *::before,
.m13-loading *::after {
  box-sizing: border-box;
}

.m13-loading {
  --m13-design-width: 1624;
  --m13-design-height: 750;
  --m13-peacock: #079caf;
  --m13-teal-card-deep: #047984;
  --m13-saffron: #ff6b3d;
  --m13-saffron-deep: #e94b2e;
  --m13-violet: #7354d6;
  --m13-violet-deep: #4d35a5;
  --m13-indigo: #26339b;
  --m13-cream: #fff0c7;
  --m13-white: #fffaf0;
  --m13-exit-duration: 260ms;
  --m13-progress: 8%;

  position: fixed;
  inset: 0;
  z-index: 2147483000;
  display: grid;
  width: 100%;
  height: 100%;
  min-height: 100svh;
  place-items: center;
  overflow: hidden;
  isolation: isolate;
  color-scheme: light;
  background:
    radial-gradient(circle at 36% 46%, rgb(255 239 190 / 20%), transparent 23%),
    radial-gradient(circle at 72% 18%, rgb(106 239 226 / 32%), transparent 25%),
    linear-gradient(132deg, #15b5c6 0%, #0796af 44%, #087698 100%);
  opacity: 1;
  visibility: visible;
  transition:
    opacity var(--m13-exit-duration) ease,
    visibility 0s linear 0s;
  font-family: "M13 Nunito", "Arial Rounded MT Bold", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased;
  text-rendering: geometricPrecision;
  touch-action: none;
  user-select: none;
  -webkit-user-select: none;
}

.m13-loading::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: -1;
  pointer-events: none;
  opacity: 0.14;
  background-image:
    radial-gradient(circle at 8% 20%, rgb(255 255 255 / 72%) 0 2px, transparent 2.7px),
    radial-gradient(circle at 87% 28%, rgb(255 240 199 / 62%) 0 2px, transparent 2.7px),
    radial-gradient(circle at 91% 76%, rgb(255 255 255 / 48%) 0 1.5px, transparent 2.2px);
  background-size: 190px 190px, 240px 240px, 170px 170px;
  -webkit-mask-image: linear-gradient(
    90deg,
    rgb(0 0 0 / 45%),
    transparent 24%,
    transparent 76%,
    rgb(0 0 0 / 42%)
  );
  mask-image: linear-gradient(
    90deg,
    rgb(0 0 0 / 45%),
    transparent 24%,
    transparent 76%,
    rgb(0 0 0 / 42%)
  );
}

.m13-loading[hidden] {
  display: none !important;
}

.m13-loading.m13-loading--exiting {
  pointer-events: none;
  opacity: 0;
  visibility: hidden;
  transition:
    opacity var(--m13-exit-duration) ease,
    visibility 0s linear var(--m13-exit-duration);
}

.m13-loading__stage {
  position: relative;
  z-index: 1;
  display: grid;
  width: min(100vw, calc(100vh * 1624 / 750));
  height: min(100vh, calc(100vw * 750 / 1624));
  place-items: center;
  container-type: size;
}

.m13-loading__stage::before {
  content: "";
  position: absolute;
  width: min(74vw, 1420px);
  width: min(74cqw, 1420px);
  aspect-ratio: 1;
  z-index: -1;
  border: 2px solid rgb(255 240 199 / 13%);
  border-radius: 50%;
  box-shadow:
    0 0 0 72px rgb(255 240 199 / 3.5%),
    0 0 0 150px rgb(255 240 199 / 2.2%);
  opacity: 0;
  transform: scale(0.76);
  animation: m13-table-halo 1.1s 80ms cubic-bezier(0.16, 0.86, 0.24, 1) forwards;
}

.m13-loading__scene {
  display: flex;
  width: min(90vw, 1400px);
  width: min(90cqw, 1400px);
  flex-direction: column;
  align-items: center;
  justify-content: center;
  transform: translateY(-1vh);
  transform: translateY(-1cqh);
}

.m13-loading__brand-lockup {
  display: flex;
  width: 100%;
  align-items: center;
  justify-content: center;
}

.m13-loading__mark {
  position: relative;
  flex: 0 0 auto;
  width: clamp(280px, 22vw, 360px);
  width: clamp(280px, 22cqw, 360px);
  aspect-ratio: 1.04;
  filter: drop-shadow(0 26px 28px rgb(4 70 88 / 22%));
}

.m13-loading__mark-halo {
  position: absolute;
  inset: 4% -4% -4%;
  border-radius: 50%;
  background: radial-gradient(
    circle,
    rgb(255 240 199 / 28%),
    rgb(255 240 199 / 4.5%) 56%,
    transparent 72%
  );
  opacity: 0;
  transform: scale(0.76);
  animation: m13-mark-halo 900ms 260ms cubic-bezier(0.16, 0.86, 0.24, 1) forwards;
}

.m13-loading__card {
  position: absolute;
  top: 12%;
  left: 50%;
  width: 54%;
  height: 73%;
  border: clamp(4px, 0.36vw, 7px) solid var(--m13-cream);
  border: clamp(4px, 0.36cqw, 7px) solid var(--m13-cream);
  border-radius: 17%;
  box-shadow:
    inset 0 3px 0 rgb(255 255 255 / 20%),
    0 14px 24px rgb(4 65 86 / 19%);
  opacity: 0;
  transform-origin: 50% 88%;
  will-change: transform, opacity;
}

.m13-loading__card::after {
  content: "";
  position: absolute;
  inset: 5%;
  border: 2px solid rgb(255 240 199 / 40%);
  border-radius: 14%;
}

.m13-loading__card--left {
  z-index: 1;
  background: linear-gradient(150deg, #ff8350, var(--m13-saffron-deep));
  animation: m13-card-left 820ms 140ms cubic-bezier(0.16, 0.86, 0.22, 1) forwards;
}

.m13-loading__card--right {
  z-index: 2;
  background: linear-gradient(150deg, #8060df, var(--m13-violet-deep));
  animation: m13-card-right 820ms 260ms cubic-bezier(0.16, 0.86, 0.22, 1) forwards;
}

.m13-loading__card--center {
  z-index: 3;
  background: linear-gradient(160deg, #12b1aa, var(--m13-teal-card-deep));
  animation: m13-card-center 780ms 390ms cubic-bezier(0.16, 0.86, 0.22, 1) forwards;
}

.m13-loading__number {
  position: absolute;
  top: 12%;
  left: 23%;
  z-index: 4;
  display: flex;
  width: 54%;
  height: 73%;
  align-items: center;
  justify-content: center;
  color: var(--m13-cream);
  font-size: clamp(100px, 8.8vw, 150px);
  font-size: clamp(100px, 8.8cqw, 150px);
  font-weight: 950;
  line-height: 0.8;
  text-shadow:
    0 7px 0 rgb(203 144 55 / 55%),
    0 12px 18px rgb(4 55 71 / 20%);
}

.m13-loading__number-glyph + .m13-loading__number-glyph {
  margin-left: -0.12em;
}

.m13-loading__number-glyph:nth-child(1) {
  --m13-index: 0;
}

.m13-loading__number-glyph:nth-child(2) {
  --m13-index: 1;
}

.m13-loading__number-glyph,
.m13-loading__glyph {
  display: inline-block;
  opacity: 0;
  filter: blur(7px);
  transform: translate3d(var(--m13-entry-x, 0), 30px, 0)
    rotate(var(--m13-entry-rotation, 0deg))
    scale(0.88);
  will-change: transform, opacity, filter;
  animation: m13-glyph-in 780ms calc(520ms + var(--m13-index) * 95ms)
    cubic-bezier(0.15, 0.86, 0.22, 1) forwards;
}

.m13-loading__number-glyph:first-child {
  --m13-entry-x: -16px;
  --m13-entry-rotation: -5deg;
}

.m13-loading__number-glyph:last-child {
  --m13-entry-x: 14px;
  --m13-entry-rotation: 4deg;
}

.m13-loading__mark-tab {
  position: absolute;
  z-index: 5;
  right: 25%;
  bottom: 8.5%;
  left: 25%;
  display: flex;
  height: 16%;
  align-items: center;
  justify-content: center;
  border: 3px solid rgb(255 240 199 / 84%);
  border-radius: 999px;
  color: var(--m13-cream);
  background: linear-gradient(180deg, #2d43b2, var(--m13-indigo));
  box-shadow: 0 9px 14px rgb(4 58 76 / 18%);
  font-size: clamp(12px, 1.18vw, 19px);
  font-size: clamp(12px, 1.18cqw, 19px);
  font-weight: 900;
  letter-spacing: 0.18em;
  opacity: 0;
  transform: translateY(12px) scale(0.94);
  animation: m13-tab-in 520ms 1.14s cubic-bezier(0.17, 0.82, 0.24, 1) forwards;
}

.m13-loading__mark-tab-dot {
  width: clamp(8px, 0.72vw, 12px);
  width: clamp(8px, 0.72cqw, 12px);
  aspect-ratio: 1;
  border: 2px solid rgb(255 240 199 / 62%);
  border-radius: 50%;
  background: var(--m13-cream);
  box-shadow: 0 3px 0 rgb(8 39 111 / 22%);
}

.m13-loading__mark-tab-dot + .m13-loading__mark-tab-dot {
  margin-left: clamp(8px, 0.72vw, 12px);
  margin-left: clamp(8px, 0.72cqw, 12px);
}

.m13-loading__mark-tab-dot:nth-child(1) {
  background: #ff8350;
}

.m13-loading__mark-tab-dot:nth-child(2) {
  background: var(--m13-cream);
  transform: translateY(-3px);
}

.m13-loading__mark-tab-dot:nth-child(3) {
  background: #8e73e8;
}

.m13-loading__star {
  position: absolute;
  z-index: 6;
  top: 1%;
  right: 9%;
  width: 34px;
  aspect-ratio: 1;
  opacity: 0;
  background: var(--m13-cream);
  clip-path: polygon(
    50% 0,
    60% 40%,
    100% 50%,
    60% 60%,
    50% 100%,
    40% 60%,
    0 50%,
    40% 40%
  );
  filter: drop-shadow(0 0 12px rgb(255 235 171 / 34%));
  transform: rotate(20deg) scale(0.2);
  animation: m13-star-pop 620ms 1.05s cubic-bezier(0.16, 1.2, 0.2, 1) forwards;
}

.m13-loading__wordmark {
  display: flex;
  min-height: 1em;
  align-items: baseline;
  margin-left: clamp(20px, 1.4vw, 28px);
  margin-left: clamp(20px, 1.4cqw, 28px);
  color: var(--m13-cream);
  font-size: clamp(108px, 10vw, 174px);
  font-size: clamp(108px, 10cqw, 174px);
  font-weight: 950;
  line-height: 0.86;
  letter-spacing: -0.066em;
  white-space: nowrap;
  text-shadow: 0 10px 22px rgb(3 65 84 / 20%);
}

.m13-loading__glyph:nth-child(odd) {
  --m13-entry-x: -12px;
  --m13-entry-rotation: -4deg;
}

.m13-loading__glyph:nth-child(1) {
  --m13-index: 2;
}

.m13-loading__glyph:nth-child(2) {
  --m13-index: 3;
}

.m13-loading__glyph:nth-child(3) {
  --m13-index: 4;
}

.m13-loading__glyph:nth-child(4) {
  --m13-index: 5;
}

.m13-loading__glyph:nth-child(5) {
  --m13-index: 6;
}

.m13-loading__glyph:nth-child(even) {
  --m13-entry-x: 12px;
  --m13-entry-rotation: 3deg;
}

.m13-loading__tagline {
  margin: clamp(18px, 2.2vh, 28px) 0 0;
  margin: clamp(18px, 2.2cqh, 28px) 0 0;
  color: var(--m13-white);
  font-size: clamp(24px, 2.25vw, 38px);
  font-size: clamp(24px, 2.25cqw, 38px);
  font-weight: 650;
  letter-spacing: -0.025em;
  text-align: center;
  opacity: 0;
  transform: translateY(12px);
  animation: m13-copy-in 600ms 1.38s cubic-bezier(0.16, 0.82, 0.24, 1) forwards;
}

.m13-loading__tagline-strong {
  color: var(--m13-cream);
  font-weight: 850;
}

.m13-loading__mode-row {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-top: clamp(24px, 3.2vh, 40px);
  margin-top: clamp(24px, 3.2cqh, 40px);
  opacity: 0;
  transform: translateY(10px);
  animation: m13-copy-in 560ms 1.72s cubic-bezier(0.16, 0.82, 0.24, 1) forwards;
}

.m13-loading__mode-pill {
  display: inline-flex;
  min-height: 42px;
  align-items: center;
  gap: 15px;
  padding: 0 11px 0 18px;
  border: 1px solid rgb(255 240 199 / 48%);
  border-radius: 999px;
  color: var(--m13-cream);
  background: rgb(5 94 119 / 25%);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  font-size: clamp(11px, 0.95vw, 14px);
  font-size: clamp(11px, 0.95cqw, 14px);
  font-weight: 850;
  letter-spacing: 0.22em;
  text-transform: uppercase;
}

.m13-loading__mode-divider {
  width: 1px;
  height: 18px;
  background: rgb(255 240 199 / 34%);
}

.m13-loading__loader {
  position: relative;
  display: flex;
  width: 48px;
  height: 28px;
  align-items: center;
  justify-content: center;
  overflow: hidden;
  border-radius: 999px;
  background: rgb(4 86 111 / 24%);
}

.m13-loading__loader-card {
  position: absolute;
  left: 50%;
  width: 11px;
  height: 15px;
  border: 1px solid rgb(255 240 199 / 86%);
  border-radius: 3px;
  box-shadow: 0 3px 6px rgb(4 52 72 / 18%);
  transform-origin: 50% 90%;
  animation: m13-loader-card 1.9s calc(1.9s + var(--m13-index) * 170ms)
    cubic-bezier(0.4, 0, 0.2, 1) infinite;
}

.m13-loading__loader-card:nth-child(1) {
  --m13-index: 0;
}

.m13-loading__loader-card:nth-child(2) {
  --m13-index: 1;
}

.m13-loading__loader-card:nth-child(3) {
  --m13-index: 2;
}

.m13-loading__loader-card:nth-child(1) {
  background: var(--m13-saffron);
}

.m13-loading__loader-card:nth-child(2) {
  background: var(--m13-cream);
}

.m13-loading__loader-card:nth-child(3) {
  background: var(--m13-violet);
}

.m13-loading__progress {
  position: absolute;
  right: 0;
  bottom: 0;
  left: 0;
  z-index: 3;
  height: 4px;
  overflow: hidden;
  background: rgb(255 255 255 / 10%);
}

.m13-loading__progress-bar {
  position: absolute;
  inset: 0 auto 0 0;
  width: 42%;
  transform: translateX(-105%);
  background: linear-gradient(
    90deg,
    var(--m13-saffron) 0 28%,
    var(--m13-cream) 48%,
    var(--m13-violet) 72%,
    #78efe1 100%
  );
  animation: m13-progress 2.8s 160ms cubic-bezier(0.45, 0.02, 0.18, 1) infinite;
}

.m13-loading[data-progress-mode="determinate"] .m13-loading__progress-bar {
  width: var(--m13-progress);
  transform: translateX(0);
  animation: none;
  transition: width 420ms cubic-bezier(0.22, 0.72, 0.18, 1);
}

.m13-loading[data-state="error"] .m13-loading__progress-bar {
  background: linear-gradient(90deg, #d83f2c, var(--m13-saffron));
}

.m13-loading[data-state="error"] .m13-loading__loader-card {
  animation-play-state: paused;
}

.m13-loading[data-paused="true"] *,
.m13-loading[data-paused="true"] *::before,
.m13-loading[data-paused="true"] *::after {
  animation-play-state: paused !important;
}

@keyframes m13-table-halo {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes m13-mark-halo {
  to {
    opacity: 1;
    transform: scale(1);
  }
}

@keyframes m13-card-left {
  0% {
    opacity: 0;
    transform: translate(-88%, 24%) rotate(-4deg) scale(0.72);
  }
  72% {
    opacity: 1;
    transform: translate(-64%, 4%) rotate(-17deg) scale(1.025);
  }
  100% {
    opacity: 1;
    transform: translate(-64%, 4%) rotate(-14deg) scale(1);
  }
}

@keyframes m13-card-right {
  0% {
    opacity: 0;
    transform: translate(-12%, 24%) rotate(4deg) scale(0.72);
  }
  72% {
    opacity: 1;
    transform: translate(-36%, 4%) rotate(17deg) scale(1.025);
  }
  100% {
    opacity: 1;
    transform: translate(-36%, 4%) rotate(14deg) scale(1);
  }
}

@keyframes m13-card-center {
  0% {
    opacity: 0;
    transform: translate(-50%, 20%) scale(0.78);
  }
  72% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1.035);
  }
  100% {
    opacity: 1;
    transform: translate(-50%, 0) scale(1);
  }
}

@keyframes m13-glyph-in {
  0% {
    opacity: 0;
    filter: blur(7px);
    transform: translate3d(var(--m13-entry-x, 0), 30px, 0)
      rotate(var(--m13-entry-rotation, 0deg))
      scale(0.88);
  }
  58% {
    opacity: 1;
    filter: blur(0);
  }
  78% {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, -5px, 0) rotate(0) scale(1.025);
  }
  100% {
    opacity: 1;
    filter: blur(0);
    transform: translate3d(0, 0, 0) rotate(0) scale(1);
  }
}

@keyframes m13-tab-in {
  to {
    opacity: 1;
    transform: translateY(0) scale(1);
  }
}

@keyframes m13-star-pop {
  70% {
    opacity: 1;
    transform: rotate(47deg) scale(1.12);
  }
  100% {
    opacity: 1;
    transform: rotate(45deg) scale(1);
  }
}

@keyframes m13-copy-in {
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@keyframes m13-loader-card {
  0%,
  100% {
    opacity: 0.78;
    transform: translate(-50%, 1px) rotate(0deg) scale(0.92);
  }
  28% {
    opacity: 1;
    transform: translate(calc(-50% - 8px), 0) rotate(-9deg) scale(1);
  }
  52% {
    opacity: 1;
    transform: translate(-50%, -3px) rotate(0deg) scale(1.04);
  }
  76% {
    opacity: 1;
    transform: translate(calc(-50% + 8px), 0) rotate(9deg) scale(1);
  }
}

@keyframes m13-progress {
  0% {
    transform: translateX(-105%);
  }
  58% {
    transform: translateX(92%);
  }
  100% {
    transform: translateX(245%);
  }
}

@media (prefers-reduced-motion: reduce) {
  .m13-loading__stage::before,
  .m13-loading__mark-halo,
  .m13-loading__card,
  .m13-loading__number-glyph,
  .m13-loading__glyph,
  .m13-loading__mark-tab,
  .m13-loading__star,
  .m13-loading__tagline,
  .m13-loading__mode-row,
  .m13-loading__loader-card,
  .m13-loading__progress-bar {
    animation: none;
    opacity: 1;
    filter: none;
  }

  .m13-loading__card--left {
    transform: translate(-64%, 4%) rotate(-14deg);
  }

  .m13-loading__card--right {
    transform: translate(-36%, 4%) rotate(14deg);
  }

  .m13-loading__card--center {
    transform: translate(-50%, 0);
  }

  .m13-loading__number-glyph,
  .m13-loading__glyph,
  .m13-loading__mark-tab,
  .m13-loading__tagline,
  .m13-loading__mode-row {
    transform: none;
  }

  .m13-loading__star {
    transform: rotate(45deg);
  }

  .m13-loading__loader-card:nth-child(1) {
    transform: translate(calc(-50% - 10px), 1px) rotate(-10deg);
  }

  .m13-loading__loader-card:nth-child(2) {
    transform: translate(-50%, -2px);
  }

  .m13-loading__loader-card:nth-child(3) {
    transform: translate(calc(-50% + 10px), 1px) rotate(10deg);
  }

  .m13-loading__progress-bar {
    width: 42%;
    transform: translateX(72%);
  }
}

/* ==================== 横竖屏适配：始终按横屏设计稿渲染 ==================== */

/* 统一思路：横竖屏都把舞台固定为设计稿尺寸(1624x750)，所有 cqw/cqh
   子元素按 1624 宽渲染，与设计稿比例恒定，再整体等比缩放铺满视口。
   若沿用基础样式 width: min(100vw, ...) 的 contain 布局，视口高度被
   压缩时(如手机横屏 844x390，stage 高仅 390px)内部子元素 clamp() 的
   像素下限(280px 等)不会跟着缩小，scene 内容会超高，被外层
   .m13-loading 的 overflow: hidden 裁剪，出现"启动动画显示不完整"。

   竖屏：整体旋转 90°，scale = max(innerWidth/750, innerHeight/1624)
        (--stage-scale)，让旋转后至少铺满视口一个方向——
        比例匹配的手机竖屏(390x844)两端都铺满；比例不同的设备
        (iPad 竖屏 768x1024)较长方向溢出被裁剪，但视觉完整居中。
   横屏：不旋转，scale = min(innerWidth/1624, innerHeight/750)
        (--stage-scale-landscape)，contain 等比缩放，完整可见不留黑边。

   两个缩放系数都由 13mates-loading.js 在 DOMContentLoaded 与 resize 时
   注入；var() fallback(0.52 / 1)兜底 JS 加载前/失败那一帧，
   让 WebStorm 完全看不到 max/calc，避免 CSS Values 4 typed arithmetic
   的解析器误报("Divisor should be a number" / "Mismatched parameters")。
   用 absolute + translate(-50%,-50%) 主动居中，绕开 grid 居中在 item
   尺寸远大于容器时的浏览器差异。 */


/* 横竖屏分支改用属性选择器 [data-m13-orientation="portrait|landscape"]，
   由 13mates-loading.js 写入 <html data-m13-orientation> 与 inline 脚本同步。
   原因：@media (orientation) 在部分 Android WebView（自家 App 壳内）
   会基于 device 方向而非 viewport 判定，与 innerWidth/innerHeight 不一致，
   会把横屏错判为 portrait 导致 stage 旋转+错误 scale 后被裁剪。
   改用属性选择器后，CSS 跟随 JS 决策；JS 用视口几何 innerHeight > innerWidth
   判定方向（视口几何是物理事实，不受 WebView 实现差异影响）。
   首帧（JS 加载前）由 index.ejs 的 inline 脚本预先标记，避免闪烁。 */
html[data-m13-orientation="portrait"] .m13-loading__stage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1624px;
  height: 750px;
  transform-origin: center center;
  transform: translate(-50%, -50%) rotate(90deg) scale(var(--stage-scale, 0.52));
}

/* 进度条：横屏在视口底部，竖屏(整体旋转 90°)后应对应屏幕左边缘。
   竖屏下把进度条重新定位到左边缘(宽 4px、高铺满)，并让进度条
   从上往下推进(translateY)，等价于把手机横过来看到的"从左往右"；
   渐变方向同步改为垂直，颜色顺序与横屏旋转视角保持一致。 */
html[data-m13-orientation="portrait"] .m13-loading__progress {
  top: 0;
  bottom: auto;
  right: auto;
  left: 0;
  width: 4px;
  height: 100vh;
}

html[data-m13-orientation="portrait"] .m13-loading__progress-bar {
  inset: 0 0 auto 0;
  width: 100%;
  height: 42%;
  transform: translateY(-105%);
  background: linear-gradient(
    180deg,
    var(--m13-saffron) 0 28%,
    var(--m13-cream) 48%,
    var(--m13-violet) 72%,
    #78efe1 100%
  );
  animation: m13-progress-v 2.8s 160ms cubic-bezier(0.45, 0.02, 0.18, 1) infinite;
}

html[data-m13-orientation="portrait"] .m13-loading[data-progress-mode="determinate"] .m13-loading__progress-bar {
  width: 100%;
  height: var(--m13-progress);
  transform: translateY(0);
}

html[data-m13-orientation="portrait"] .m13-loading[data-state="error"] .m13-loading__progress-bar {
  background: linear-gradient(180deg, #d83f2c, var(--m13-saffron));
}

/* 横屏：舞台同样固定为设计稿尺寸(1624x750)，按 contain 等比缩放
   (scale = min(innerWidth/1624, innerHeight/750))，动画完整可见，
   不留黑边、不裁剪。进度条维持基础样式(视口底部横向)。 */
html[data-m13-orientation="landscape"] .m13-loading__stage {
  position: absolute;
  top: 50%;
  left: 50%;
  width: 1624px;
  height: 750px;
  transform-origin: center center;
  transform: translate(-50%, -50%) scale(var(--stage-scale-landscape, 1));
}

/* 竖屏进度条的垂直推进动画(等价于横屏 m13-progress 的垂直版) */
@keyframes m13-progress-v {
  0% {
    transform: translateY(-105%);
  }
  58% {
    transform: translateY(92%);
  }
  100% {
    transform: translateY(245%);
  }
}

/* 竖屏 + 系统减少动效：进度条静态显示在 72% 位置，不播放动画 */
@media (prefers-reduced-motion: reduce) {
  html[data-m13-orientation="portrait"] .m13-loading__progress-bar {
    height: 42%;
    transform: translateY(72%);
    animation: none;
  }
}
