/* ===== .goods 布局规则（与 spike-layout.css 中 .template 规则完全一致）=====
 * .goods 不能改为 .template（会与插件注入的子 Vue 实例冲突），
 * 所以在此手动复制相同的三条 layout 规则。
 */
.goods {
  min-height: 100vh;
  height: auto;
  overflow: visible;
}

/* 外层 el-container：侧边栏 fixed，主区用 padding-left 让位 */
.goods > .el-container {
  min-height: 100vh;
  height: auto;
  overflow: visible;
  display: flex !important;
  flex-direction: row !important;
  width: 100% !important;
  box-sizing: border-box !important;
  padding-left: calc(var(--sidebar-width) + 20px);
  transition: padding-left 0.25s ease;
}

/* 内层 el-container：flex 列方向，占满剩余宽度 */
.goods > .el-container > .el-container {
  min-height: 100vh;
  height: auto;
  overflow: visible;
  flex-direction: column !important;
  display: flex !important;
  flex: 1 !important;
  min-width: 0 !important;
  width: 0 !important;
}

/* 插件注入的 HTML 内层 .template / .main-card，限定在 .config-box 作用域内 */
.config-box .template {
  height: 100%;
}
.config-box .main-card {
  height: 100%;
}
.config-box {
  height: 100%;
  display: flex;
  flex-direction: column;
}
.content {
  flex: 1;
}
.goods-item-name {
  padding: 0;
  border: 0;
  color: var(--spike-text-primary, #1e2736);
  font-size: 20px;
  font-weight: 600;
  line-height: 1.4;
  overflow-wrap: anywhere;
  display: inline-block;
}
.spike-goods-title { margin-bottom: 16px; }
.spike-goods-title .el-popover__reference { cursor: pointer; }
.spike-has-goods-title > .tit { display: none; }
.goods-change-box {
  max-width: 100%;
}
.goods-change-box .goods-item-box {
  max-height: 500px;
  overflow-y: auto;
  padding: 0.2rem;
}
.goods-change-box .goods-item-box .goods-group-item {
  margin-bottom: 0.3rem;
}
.goods-change-box .goods-item-box .goods-group-item .goods-group-name {
  font-weight: 700;
  font-size: 0.18rem;
  margin-bottom: 0.15rem;
}
.goods-change-box .goods-item-box .goods-group-item .goods-group-info {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  grid-column-gap: 15px;
  row-gap: 0.1rem;
}
.goods-change-box
  .goods-item-box
  .goods-group-item
  .goods-group-info
  .option-name {
  cursor: pointer;
  font-size: 0.14rem;
}
.goods-change-box
  .goods-item-box
  .goods-group-item
  .goods-group-info
  .option-name:hover {
  color: var(--color-primary);
}

/* ===== 手机端断点（≤767px）===== */
@media (max-width: 767px) {
  /* 根容器解除高度约束 */
  .goods {
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* 清零侧边栏占位 padding，内容区恢复全宽 */
  .goods > .el-container {
    padding-left: 0 !important;
    min-height: 0 !important;
    height: auto !important;
    overflow: visible !important;
  }

  /* 内层容器也解除高度约束 */
  .goods > .el-container > .el-container {
    min-height: 0 !important;
    height: auto !important;
  }

  /* el-main：不创建滚动容器，仅用 clip 防横向溢出 */
  .goods .el-container:nth-child(2) > .el-main {
    margin: 0 !important;
    padding: 0 12px !important;
    border-radius: var(--spike-radius) !important;
    overflow-x: clip !important;
    overflow-y: visible !important;
    width: 100% !important;
    max-width: 100% !important;
    box-sizing: border-box !important;
    height: auto !important;
    min-height: 0 !important;
  }

  /* config-box：取消固定高度，内容自然流动 */
  .config-box {
    height: auto !important;
    overflow: visible !important;
  }
  .config-box .content {
    height: auto !important;
    overflow: visible !important;
  }
  .config-box .content > .template,
  .config-box .template {
    height: auto !important;
    overflow: visible !important;
  }
  .config-box,
  .config-box .content,
  .config-box .content > .template {
    width: 100% !important;
    max-width: 100% !important;
    min-width: 0 !important;
    box-sizing: border-box !important;
    padding: 0 !important;
    margin: 0 !important;
  }
}
.spike-module-load-error {
  display: flex;
  align-items: center;
  gap: 16px;
  min-height: 190px;
  padding: 30px;
  border: 1px solid #f1dede;
  border-radius: 12px;
  background: #fff;
}

.spike-module-load-error__icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 48px;
  height: 48px;
  flex: 0 0 48px;
  border-radius: 50%;
  background: #ffe3e3;
  color: #ef1515;
  font-size: 24px;
  font-weight: 700;
}

.spike-module-load-error__content {
  min-width: 0;
  flex: 1;
}

.spike-module-load-error__content strong {
  color: #101c36;
  font-size: 17px;
}

.spike-module-load-error__content p {
  margin: 5px 0 0;
  color: #768197;
}

@media (max-width: 767px) {
  .spike-module-load-error {
    align-items: flex-start;
    flex-wrap: wrap;
    padding: 22px 18px;
  }

  .spike-module-load-error .el-button {
    width: 100%;
  }
}
