/* 页签切换：只做短淡入，不用位移/out-in，避免主区域高度闪动（抖动） */

:root {
  --admin-ease-reveal: cubic-bezier(0.16, 1, 0.3, 1);
  --admin-dur-page-in: 0.2s;
  --admin-dur-press: 0.14s;
}

@media (prefers-reduced-motion: reduce) {
  .admin-page-enter-active,
  .admin-tab,
  .admin-main .el-button,
  .admin-aside .el-menu-item {
    animation: none !important;
    transition: none !important;
    opacity: 1 !important;
    transform: none !important;
  }
}

/* 切换页：仅进场淡入，旧页立即移除（不播离场动画，避免 out-in 空白与高度塌陷） */
.admin-page-enter-active {
  transition: opacity var(--admin-dur-page-in) ease-out;
}

.admin-page-enter {
  opacity: 0;
}

.admin-page-enter-to {
  opacity: 1;
}

.admin-page-leave-active {
  transition: none;
  display: none;
}

/* 顶栏页签 */
.admin-tab {
  transition: background 0.22s ease, box-shadow 0.22s ease, color 0.2s ease;
}

.admin-tab.is-active {
  transition: background 0.28s var(--admin-ease-reveal), box-shadow 0.28s ease;
}

/* 侧栏 / 按钮按压 */
@media (hover: hover) and (prefers-reduced-motion: no-preference) {
  .admin-aside .el-menu-item,
  .admin-main .el-button:not(.is-disabled) {
    transition: transform var(--admin-dur-press) ease, box-shadow 0.2s ease;
  }

  .admin-aside .el-menu-item:active,
  .admin-main .el-button:not(.is-disabled):active {
    transform: scale(0.97);
  }
}

/* 登录页可保留稍长一点的淡入 */
.admin-login-card.admin-login-enter {
  animation: admin-login-in 0.45s var(--admin-ease-reveal) both;
}

@keyframes admin-login-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

.admin-page-enter {
  animation: admin-main-in 0.32s var(--admin-ease-reveal) both;
}

@keyframes admin-main-in {
  from {
    opacity: 0;
    transform: translateY(6px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.admin-main .stores-panel-box,
.admin-main .admin-page-card,
.admin-main .el-table {
  animation: admin-block-in 0.38s var(--admin-ease-reveal) both;
}

.admin-main .stores-panel-box:nth-child(2),
.admin-main .admin-page-card:nth-child(2) {
  animation-delay: 0.04s;
}

.admin-main .stores-panel-box:nth-child(3),
.admin-main .admin-page-card:nth-child(3) {
  animation-delay: 0.08s;
}

@keyframes admin-block-in {
  from {
    opacity: 0;
    transform: translateY(8px);
  }
  to {
    opacity: 1;
    transform: none;
  }
}

.el-main.admin-main > * {
  transition: opacity 0.22s ease;
}
