/**
 * Better 结构壳层：腾讯云控制台取向 — 浅灰外底、白侧栏+线框、主区白卡片化、顶栏在画布内 sticky
 */

:root {
  --better-stage-radius: var(--better-radius-lg);
}

.template > .el-container:not(.is-vertical),
.better-template > .el-container:not(.is-vertical),
.product > .el-container:not(.is-vertical),
.product_detail.template > .el-container:not(.is-vertical) {
  min-height: 100vh;
  padding: var(--better-shell-pad);
  gap: var(--better-shell-pad);
  box-sizing: border-box;
  align-items: stretch;
  background: transparent !important;
}

.template > .el-container:not(.is-vertical) > .el-container,
.better-template > .el-container:not(.is-vertical) > .el-container,
.product > .el-container:not(.is-vertical) > .el-container,
.product_detail.template > .el-container:not(.is-vertical) > .el-container {
  flex: 1;
  min-width: 0;
  display: flex !important;
  flex-direction: column !important;
  min-height: calc(100vh - 2 * var(--better-shell-pad));
  border-radius: var(--better-stage-radius);
  background: var(--better-surface);
  box-shadow: none;
  border: 1px solid var(--better-border-subtle);
  overflow: hidden;
}

.template > .el-container:not(.is-vertical) > .el-container .better-topbar-host .el-header,
.better-template > .el-container:not(.is-vertical) > .el-container .better-topbar-host .el-header,
.product > .el-container:not(.is-vertical) > .el-container .better-topbar-host .el-header,
.product_detail.template > .el-container:not(.is-vertical) > .el-container .better-topbar-host .el-header {
  position: sticky !important;
  top: 0;
  left: auto !important;
  right: auto !important;
  width: 100% !important;
  z-index: 50;
  flex: 0 0 auto;
}

.better-topbar-host {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  min-width: 0;
  width: 100%;
}

.template > .el-container:not(.is-vertical) .el-main,
.better-template > .el-container:not(.is-vertical) .el-main,
.product > .el-container:not(.is-vertical) .el-main,
.product_detail.template > .el-container:not(.is-vertical) .el-main {
  flex: 1 1 auto !important;
  min-height: 0;
  overflow: auto;
  padding-top: 0.24rem !important;
  background: var(--better-bg);
}

.template .el-aside.better-rail,
.better-template .el-aside.better-rail,
.product .el-aside.better-rail,
.product_detail.template .el-aside.better-rail {
  width: var(--better-rail-width) !important;
  flex: 0 0 var(--better-rail-width) !important;
  max-width: var(--better-rail-width);
  height: auto !important;
  min-height: calc(100vh - 2 * var(--better-shell-pad));
  max-height: calc(100vh - 2 * var(--better-shell-pad));
  position: sticky;
  top: var(--better-shell-pad);
  align-self: flex-start;
  padding: 0 !important;
  border-radius: var(--better-stage-radius);
  overflow: hidden;
  background: #ffffff !important;
  box-shadow: none;
  border: 1px solid var(--better-border-subtle) !important;
}

.better-rail__inner {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  max-height: calc(100vh - 2 * var(--better-shell-pad));
  padding: 12px 10px 16px;
  box-sizing: border-box;
}

.better-rail__brand {
  flex: 0 0 auto;
  margin-bottom: 8px;
  padding-bottom: 12px;
  border-bottom: 1px solid var(--better-border-subtle);
}

.better-rail__brand .ali-logo {
  margin-top: 4px;
}

.better-rail__menus {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
}

.template .better-rail::-webkit-scrollbar,
.better-template .better-rail::-webkit-scrollbar {
  width: 6px;
}

.template .better-rail::-webkit-scrollbar-thumb,
.better-template .better-rail::-webkit-scrollbar-thumb {
  background: rgba(0, 0, 0, 0.12);
  border-radius: 3px;
}

.better-rail .line {
  margin: 16px auto !important;
  width: calc(100% - 24px);
}

@media screen and (max-width: 750px) {
  .template > .el-container:not(.is-vertical),
  .better-template > .el-container:not(.is-vertical),
  .product > .el-container:not(.is-vertical),
  .product_detail.template > .el-container:not(.is-vertical) {
    padding: 0;
    gap: 0;
    min-height: 100vh;
  }

  .template > .el-container:not(.is-vertical) > .el-container,
  .better-template > .el-container:not(.is-vertical) > .el-container,
  .product > .el-container:not(.is-vertical) > .el-container,
  .product_detail.template > .el-container:not(.is-vertical) > .el-container {
    border-radius: 0;
    min-height: 100vh;
    border: none;
    box-shadow: none;
  }

  .template .el-aside.better-rail,
  .better-template .el-aside.better-rail,
  .product .el-aside.better-rail,
  .product_detail.template .el-aside.better-rail {
    top: 0;
    min-height: 0;
    max-height: none;
  }
}
