/* App-like navigation for the shiwai-s1 client area. */
[v-cloak] {
  display: none !important;
}

/* Vue 2 compiles these custom tags into regular elements. Hide only their raw,
   pre-compiled form so template expressions can never be painted. */
body el-main,
body el-dialog,
body el-drawer,
body el-popover {
  visibility: hidden !important;
}

@view-transition {
  navigation: auto;
}

body > div:not(#mainLoading) > .el-container > .el-aside {
  view-transition-name: shiwai-sidebar;
}

body .el-header {
  view-transition-name: shiwai-topbar;
  backface-visibility: hidden;
  transform: translateZ(0);
  contain: layout paint style;
  background: #fff !important;
  backdrop-filter: none !important;
  -webkit-backdrop-filter: none !important;
  filter: none !important;
  box-shadow: none !important;
  border-bottom: 1px solid rgba(21, 34, 50, 0.06);
}

.header-right,
.header-right *,
.header-right .el-dropdown,
.header-right .el-dropdown-selfdefine,
.header-right [tabindex]:focus,
.header-right [tabindex]:focus-visible {
  outline: none !important;
  box-shadow: none !important;
  text-shadow: none !important;
  filter: none !important;
}

/* Exact visual copy of the previous page header. It covers the short MPA gap
   before Vue creates the real top menu, then is removed in the same paint turn. */
#shiwaiHeaderSnapshot {
  view-transition-name: shiwai-topbar;
  position: fixed;
  z-index: 1002;
  top: 0;
  left: 190px;
  width: calc(100% - 190px);
  height: 60px;
  box-sizing: border-box;
  padding: 0 20px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: inherit;
  font-size: 14px;
  background: #fff;
  backdrop-filter: none;
  -webkit-backdrop-filter: none;
  filter: none;
  box-shadow: none;
  border-bottom: 1px solid rgba(21, 34, 50, 0.06);
  border-radius: 0;
  pointer-events: none;
  user-select: none;
  backface-visibility: hidden;
  transform: translateZ(0);
  contain: layout paint style;
  isolation: isolate;
}

body > div:not(#mainLoading) > .el-container > .el-container > .el-main {
  view-transition-name: shiwai-content;
}

body > div:not(#mainLoading) > .el-container > .el-aside .menu-top .el-menu-item,
body > div:not(#mainLoading) > .el-container > .el-aside .menu-top .el-submenu__title,
body > div:not(#mainLoading) > .el-container > .el-aside .menu-top .el-menu-item i,
body > div:not(#mainLoading) > .el-container > .el-aside .menu-top .el-submenu__title i {
  transition: color 160ms ease, background-color 160ms ease, transform 120ms ease !important;
}

body > div:not(#mainLoading) > .el-container > .el-aside .menu-alink:active .el-menu-item {
  transform: scale(0.985);
}

/* Cached tab content should feel alive without showing another loading mask.
   Do not keep a transform/isolation layer here: Element dialogs live inside
   tab panes and a persistent stacking context places them below body masks. */
.el-main .el-tabs__content > .el-tab-pane {
  transform-origin: 50% 0;
  animation: shiwai-tab-content-in 230ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

/* Product details are injected and then hydrated by a second Vue instance.
   Keep that multi-stage boot invisible and reveal the stable console once;
   otherwise the generic tab animation stacks with every hydration reflow. */
#product_detail_cloud .el-tabs__content > .el-tab-pane {
  animation: none !important;
}

#product_detail_cloud .aliyun-console.detail-stage-pending {
  min-height: calc(100vh - 116px);
  opacity: 0;
  visibility: hidden;
}

#product_detail_cloud .aliyun-console.detail-stage-ready {
  visibility: visible;
  animation: shiwai-detail-stage-in 240ms cubic-bezier(0.22, 1, 0.36, 1) both;
}

@keyframes shiwai-detail-stage-in {
  from { opacity: 0; }
  to { opacity: 1; }
}

html.shiwai-tab-crossfade .el-main .el-tabs__content {
  will-change: opacity, filter, transform;
  animation: shiwai-tab-shell-crossfade 270ms cubic-bezier(0.16, 1, 0.3, 1) both;
}

html.shiwai-tab-crossfade .el-main .el-tabs__content > .el-tab-pane {
  animation: none !important;
}

.el-main .el-tabs__active-bar {
  box-shadow: 0 2px 7px color-mix(in srgb, var(--color-primary, #409eff) 26%, transparent);
  transition: transform 180ms cubic-bezier(0.22, 1, 0.36, 1),
    width 180ms cubic-bezier(0.22, 1, 0.36, 1) !important;
}

@keyframes shiwai-tab-content-in {
  from {
    opacity: 0.48;
    filter: blur(1.2px);
    transform: scale(0.997);
  }
  to {
    opacity: 1;
    filter: none;
    transform: none;
  }
}

@keyframes shiwai-tab-shell-crossfade {
  0% {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
  38% {
    opacity: 0.46;
    filter: blur(0.9px);
    transform: scale(0.998);
  }
  100% {
    opacity: 1;
    filter: none;
    transform: none;
  }
}

::view-transition-old(root),
::view-transition-new(root) {
  animation: none;
  mix-blend-mode: normal;
}

::view-transition-old(shiwai-sidebar),
::view-transition-new(shiwai-sidebar),
::view-transition-old(shiwai-topbar),
::view-transition-new(shiwai-topbar) {
  animation: none;
  mix-blend-mode: normal;
}

/* Do not composite the old translucent topbar over the new header snapshot.
   Two simultaneous layers create a short glow around the right-side controls. */
::view-transition-old(shiwai-topbar) {
  opacity: 0 !important;
}

::view-transition-new(shiwai-topbar) {
  opacity: 1 !important;
}

::view-transition-group(shiwai-topbar) {
  z-index: 100001;
  animation: none;
}

::view-transition-image-pair(shiwai-topbar) {
  isolation: isolate;
}

::view-transition-old(shiwai-content) {
  animation: shiwai-content-out 180ms cubic-bezier(0.4, 0, 0.2, 1) both;
  mix-blend-mode: normal;
}

::view-transition-new(shiwai-content) {
  animation: shiwai-content-in 280ms cubic-bezier(0.16, 1, 0.3, 1) both;
  mix-blend-mode: normal;
}

::view-transition-group(shiwai-content) {
  animation-duration: 280ms;
  animation-timing-function: cubic-bezier(0.16, 1, 0.3, 1);
}

::view-transition-image-pair(shiwai-content) {
  isolation: isolate;
}

@keyframes shiwai-content-out {
  from {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
  to {
    opacity: 0.34;
    filter: blur(1px);
    transform: scale(0.998);
  }
}

@keyframes shiwai-content-in {
  from {
    opacity: 0.3;
    filter: blur(1.4px);
    transform: scale(0.997);
  }
  to {
    opacity: 1;
    filter: blur(0);
    transform: scale(1);
  }
}

#shiwaiNavigationProgress {
  position: fixed;
  z-index: 100000;
  top: 0;
  left: 0;
  width: 0;
  height: 2px;
  pointer-events: none;
  opacity: 0;
  background: linear-gradient(90deg, var(--color-primary, #409eff), #55e6d5);
  box-shadow: 0 0 10px color-mix(in srgb, var(--color-primary, #409eff) 55%, transparent);
  transition: width 380ms cubic-bezier(0.2, 0.8, 0.2, 1), opacity 160ms ease;
}

#shiwaiNavigationProgress.is-running {
  width: 76%;
  opacity: 1;
}

#shiwaiNavigationProgress.is-finished {
  width: 100%;
  opacity: 0;
}

#shiwaiNavigationLoader {
  position: fixed;
  z-index: 9998;
  top: 72px;
  left: calc(50% + 95px);
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 116px;
  height: 38px;
  padding: 0 16px;
  color: #334155;
  font-size: 12px;
  letter-spacing: 0.04em;
  background: rgba(255, 255, 255, 0.9);
  border: 1px solid rgba(148, 163, 184, 0.18);
  border-radius: 999px;
  box-shadow: 0 12px 32px rgba(15, 23, 42, 0.12), 0 2px 8px rgba(64, 158, 255, 0.08);
  backdrop-filter: blur(14px) saturate(1.2);
  -webkit-backdrop-filter: blur(14px) saturate(1.2);
  pointer-events: none;
  opacity: 0;
  transform: translate(-50%, -8px) scale(0.98);
  contain: layout paint style;
  will-change: opacity, transform;
  transition: opacity 0ms linear, transform 90ms cubic-bezier(0.22, 1, 0.36, 1);
}

#shiwaiNavigationLoader.is-running {
  opacity: 1;
  transform: translate(-50%, 0) scale(1);
}

#shiwaiNavigationLoader.is-finished {
  opacity: 0;
  transform: translate(-50%, -4px) scale(0.99);
}

.shiwai-loader-orbit {
  position: relative;
  width: 20px;
  height: 20px;
  animation: shiwai-loader-rotate 900ms linear infinite;
}

.shiwai-loader-orbit i {
  position: absolute;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--color-primary, #409eff);
  box-shadow: 0 2px 8px rgba(64, 158, 255, 0.28);
}

.shiwai-loader-orbit i:nth-child(1) { top: 0; left: 7px; }
.shiwai-loader-orbit i:nth-child(2) { right: 1px; bottom: 2px; background: #38c9b7; }
.shiwai-loader-orbit i:nth-child(3) { left: 1px; bottom: 2px; opacity: 0.45; }

@keyframes shiwai-loader-rotate {
  to { transform: rotate(360deg); }
}

.shiwai-smooth-leaving body .el-header,
.shiwai-smooth-arrival body .el-header {
  opacity: 1 !important;
  visibility: visible !important;
  animation: none !important;
  transition: none !important;
}

.shiwai-smooth-leaving body > div:not(#mainLoading) > .el-container > .el-container > .el-main {
  pointer-events: none;
}

@supports not (view-transition-name: shiwai-content) {
  .shiwai-smooth-arrival body > div:not(#mainLoading) > .el-container > .el-container > .el-main {
    animation: shiwai-content-in 280ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
  }
}

.shiwai-navigation-fallback.shiwai-smooth-arrival body > div:not(#mainLoading) > .el-container > .el-container > .el-main {
  animation: shiwai-content-in 280ms cubic-bezier(0.16, 1, 0.3, 1) backwards;
}

@media (prefers-reduced-motion: reduce) {
  ::view-transition-old(root),
  ::view-transition-new(root),
  ::view-transition-old(shiwai-sidebar),
  ::view-transition-new(shiwai-sidebar),
  ::view-transition-old(shiwai-topbar),
  ::view-transition-new(shiwai-topbar),
  ::view-transition-old(shiwai-content),
  ::view-transition-new(shiwai-content),
  .shiwai-smooth-arrival body > div:not(#mainLoading) > .el-container > .el-container > .el-main {
    animation: none !important;
  }

  .el-main .el-tabs__content > .el-tab-pane {
    animation: none !important;
  }

  .el-main .el-tabs__active-bar {
    transition: none !important;
  }

  .shiwai-loader-orbit {
    animation-duration: 1.8s;
  }
}

@media (max-width: 750px) {
  #shiwaiNavigationLoader {
    left: 50%;
  }

  #shiwaiHeaderSnapshot {
    left: 0;
    width: 100%;
    height: 1rem !important;
  }
}
