/* ===== 会员中心常驻外壳（2026-10-15）=====
   配合 js/ca-nav.js：把「侧栏 + 顶栏」放进一层常驻外壳，页面模板只留内容区，
   点侧栏栏目时只换内容（侧栏/顶栏不重建，不再整页白屏）。
   注意：这里几条 display/flex 必须带 !important —— 模板自带的 asideMenu.js / 各页 js
   会在挂载时把 .template / .product 的内联 display 写成 block，那是旧"整页外壳"时代的写法。 */

body.ca-shell-on #ca-shell {
  display: flex;
  flex-direction: row;
  flex: 1 1 auto;
  box-sizing: border-box;
  min-width: 0;
}

/* 插槽只做占位/挂载点，不参与布局（display:contents 让子节点直接进父级布局） */
#ca-aside-slot,
#ca-top-slot,
#ca-content {
  display: contents;
}

body.ca-shell-on #ca-col {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  box-sizing: border-box;
  min-width: 0;
}

/* 页面根（.template / .product）现在只放内容：让它撑满内容区，里面的 .el-main 照常滚动 */
body.ca-shell-on #ca-content > .template,
body.ca-shell-on #ca-content > .product {
  display: flex !important;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
}

/* 首屏 / 换页时盖住内容区的那层 loading：沿用模板自带的 #mainLoading（被 ca-nav.js 挪进内容区） */
body.ca-shell-on #mainLoading {
  position: absolute;
  left: 0;
  right: 0;
  bottom: 0;
  width: auto;
  height: auto;
  background: #fff;
  z-index: 4000; /* 兜底：盖住页面里的浮动组件与弹窗遮罩（售前客服 99、域名插件 dm-mask 2000/3000） */
  display: none;
}
body.ca-shell-on.ca-loading #mainLoading {
  display: flex !important;
}

/* 换页/首屏编译之前：页面模板里那些弹窗遮罩（域名插件的 dm-mask 是 2000/3000）是"裸"的，
   会盖住 loading 闪一下；先把内容整块藏起来，Vue 挂载完再放出来。
   同时把高度夹住：未编译的模板（一堆弹窗）很高，会把这页撑到一两千 px，
   于是整页出现滚动条、固定顶栏跟着变窄十几 px —— 看起来就像"顶部栏也刷新了一下"。
   藏起来的这段时间夹一下高度，页面上不会出现滚动条；挂载完就放开（正常布局照旧）。 */
body.ca-shell-on.ca-raw-hidden #ca-content > .template,
body.ca-shell-on.ca-raw-hidden #ca-content > .product {
  visibility: hidden;
  max-height: 100vh;
  overflow: hidden;
}

/* 新设备第一次进来（还没缓存菜单）：侧栏要等接口，这段时间遮罩先盖整屏 */
body.ca-shell-on.ca-cold #mainLoading {
  position: fixed !important;
  left: 0 !important;
  top: 0 !important;
  right: 0 !important;
  bottom: 0 !important;
  z-index: 9999 !important;
}

/* 换页时内容区顶部的细进度条 */
#ca-progress {
  position: absolute;
  left: 0;
  right: 0;
  top: 0;
  height: 2px;
  overflow: hidden;
  z-index: 6;
  opacity: 0;
  transition: opacity 0.15s;
  pointer-events: none;
}
body.ca-busy #ca-progress {
  opacity: 1;
}
#ca-progress i {
  position: absolute;
  top: 0;
  bottom: 0;
  width: 40%;
  border-radius: 2px;
  background: var(--color-primary, #1a56db);
  animation: ca-nav-slide 1.1s ease-in-out infinite;
}
@keyframes ca-nav-slide {
  0% {
    left: -40%;
  }
  100% {
    left: 100%;
  }
}
