/* =========================================================
   会员中心 · 卡通加载动画（弹跳方块 + 文案「小佛为你快速加载中」）
   配套：mfy2026 主题
   引入：header.php 中放在 common.css 之后
   特点：纯 CSS 实现，不改动任何 PHP 页面里的 DOM 结构。
        - 复用 #mainLoading 内已有的 5 个 .ddr 元素，重绘为圆角方块
        - 文案用 #mainLoading::after 的 content 插入
        - 落地阴影线用 #mainLoading::before 绘制
   ========================================================= */

/* ---------- 1. 外层容器 ---------- */
#mainLoading {
  /* 原来已是 fixed + flex 居中，这里只调整排列方式 */
  flex-wrap: wrap;
  align-content: center;
  gap: 0;
}

/* ---------- 2. 色条 → 卡通方块 ---------- */
#mainLoading .ddr {
  width: 20px;
  height: 20px;
  float: none;
  margin: 0 4.5px;
  border-radius: 6px;
  background-color: #C8102E;
  /* 覆盖原有的 scaleY 动画 */
  animation: mfyCubeBounce 1.15s infinite ease-in-out;
  transform-origin: center bottom;
  will-change: transform, opacity;
}

/* 深浅红交替，形成节奏 */
#mainLoading .ddr2 {
  background-color: #E8435C;
  animation-delay: -1s;
}
#mainLoading .ddr3 {
  background-color: #C8102E;
  animation-delay: -0.85s;
}
#mainLoading .ddr4 {
  background-color: #E8435C;
  animation-delay: -0.7s;
}
#mainLoading .ddr5 {
  background-color: #C8102E;
  animation-delay: -0.55s;
}

@keyframes mfyCubeBounce {
  0%, 62%, 100% {
    transform: translateY(0) scale(1);
    opacity: 0.45;
  }
  28% {
    transform: translateY(-26px) scale(1.08);
    opacity: 1;
  }
}

/* ---------- 3. 文案（插入到方块下方一行） ---------- */
#mainLoading::after {
  content: "小佛为你快速加载中";
  flex-basis: 100%;
  margin-top: 22px;
  color: #3D4048;
  font-size: 15px;
  font-family: inherit;
  font-weight: 400;
  letter-spacing: 1px;
  line-height: 1.6;
  text-align: center;
  white-space: nowrap;
}

/* ---------- 4. 落地阴影线 ---------- */
/* 方块合计宽 20*5 + 间距 4.5*2*5 = 145px，中心在容器正中 */
#mainLoading::before {
  content: "";
  position: absolute;
  top: 50%;
  left: 50%;
  width: 120px;
  height: 2px;
  margin-left: -60px;
  /* 方块底边在中心下方 10px，再下移 24px 留出落地间距 */
  margin-top: 34px;
  border-radius: 2px;
  background: linear-gradient(90deg, transparent, #F3D2D8, transparent);
  pointer-events: none;
}

/* ---------- 5. 产品详情内嵌加载（pro-des）不显示文案与阴影 ---------- */
#mainLoading.pro-des {
  flex-wrap: nowrap;
}
#mainLoading.pro-des::after,
#mainLoading.pro-des::before {
  content: none;
}

/* ---------- 6. 无障碍：系统开启「减弱动态效果」时放慢 ---------- */
@media (prefers-reduced-motion: reduce) {
  #mainLoading .ddr {
    animation-duration: 2.4s;
  }
}

/* ---------- 7. 移动端 ---------- */
@media screen and (max-width: 750px) {
  #mainLoading .ddr {
    width: 16px;
    height: 16px;
    border-radius: 5px;
    margin: 0 3.5px;
  }
  #mainLoading::after {
    margin-top: 18px;
    font-size: 14px;
    letter-spacing: 0.5px;
  }
  #mainLoading::before {
    width: 96px;
    margin-left: -48px;
    margin-top: 30px;
  }
}
