/**
 * ======= sanxio store-advanced catalog（列表/筛选）start ===========
 * 桌面：标题行（标题 + 对比）/ 筛选行（分类 + 排序）
 * 移动：同结构紧凑化，分类横向滑动，双列网格
 */

/* ---------- 区块外壳 ---------- */
body.sx-store-advanced--mall-catalog .sca-catalog.sanxio-home-section-card--unified-list {
  position: relative;
  --sx-home-rail-inset: var(--sanxio-gap-sm, 8px);
  --sx-home-head-rail-gap: var(--sanxio-gap-sm, 8px);
  --sx-home-head-rail-width: 4px;
  /* border 已占蓝条宽度，内边距只留内容间隙 */
  --sca-cat-pad-start: var(--sanxio-gap-md, 12px);
  --sca-cat-pad-end: var(--sx-home-rail-inset);
  --sca-cat-ctrl-h: 32px;
  margin-inline: 0;
  width: auto;
  max-width: 100%;
  margin-bottom: var(--sanxio-content-gap, 12px);
  background: var(--md3-color-surface-container-low, #f3f5f9);
  border: none;
  border-radius: var(--md3-shape-md, 12px) !important;
  overflow: hidden;
  box-sizing: border-box;
}

/* 顶线改挂在组头上，避免与头条叠双线 */
body.sx-store-advanced--mall-catalog .sca-catalog.sanxio-home-section-card--unified-list::before {
  content: none;
  display: none;
}

body.sx-store-advanced--mall-catalog .sx-store-mall-compare-form {
  display: contents;
}

/* ---------- 面包屑 ---------- */
body.sx-store-advanced--mall-catalog .sca-channel-top--catalog {
  margin: 0;
  padding: 0 0 var(--sanxio-gap-md, 12px);
  box-sizing: border-box;
}

body.sx-store-advanced--mall-catalog .sca-channel-top--catalog .sca-crumb {
  margin-bottom: 0;
  font-size: 12px;
  line-height: 1.45;
  color: var(--md3-color-on-surface-variant);
  gap: 4px;
}

body.sx-store-advanced--mall-catalog .sca-channel-top--catalog .sca-crumb__sep {
  opacity: 0.55;
  font-size: 11px;
  user-select: none;
}

body.sx-store-advanced--mall-catalog .sca-channel-top--catalog .sca-crumb a:link,
body.sx-store-advanced--mall-catalog .sca-channel-top--catalog .sca-crumb a:visited,
body.sx-store-advanced--mall-catalog .sca-channel-top--catalog .sca-crumb a:active {
  font-weight: 500;
  color: var(--md3-color-primary);
  text-decoration: none;
}

body.sx-store-advanced--mall-catalog .sca-channel-top--catalog .sca-crumb a:hover {
  text-decoration: none;
  opacity: 0.88;
}

body.sx-store-advanced--mall-catalog .sca-channel-top--catalog .sca-crumb__current {
  font-weight: 600;
  color: var(--md3-color-on-surface);
}

/* ---------- 标题区：白面组头；顶线与左右蓝条用 border 在圆角处闭合 ---------- */
body.sx-store-advanced--mall-catalog .sca-catalog .sanxio-home-section__head.sca-catalog-head {
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: center;
  justify-content: flex-start;
  column-gap: 8px;
  row-gap: 8px;
  min-height: 0 !important;
  margin: 0 0 var(--sanxio-gap-sm, 8px) !important;
  /* 与卡片顶圆角合并，消除左上/右上缺口 */
  border-radius: var(--md3-shape-md, 12px) var(--md3-shape-md, 12px) 0 0 !important;
  border-style: solid !important;
  border-color: var(--md3-color-primary, #005fb8) !important;
  border-width: 1px var(--sx-home-head-rail-width, 4px) 0 !important;
  background-color: var(--md3-color-surface, #fff) !important;
  background-image: none !important;
  box-shadow: none !important;
  padding: 10px var(--sca-cat-pad-end, 12px) 10px var(--sca-cat-pad-start, 16px) !important;
  box-sizing: border-box;
}

body.sx-store-advanced .sca-catalog-head__title {
  margin: 0;
  flex: 0 0 auto;
  max-width: 7.5em;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  color: var(--md3-color-on-surface);
}

body.sx-store-advanced--mall-catalog .sca-catalog-head__aside {
  display: inline-flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  flex: 0 0 auto;
  margin-left: auto;
  height: var(--sca-cat-ctrl-h, 32px);
}

/* 标题栏控件统一高度/圆角/边框盒（Chip / 排序 / 对比开关） */
body.sx-store-advanced--mall-catalog .sca-catalog-head .sca-chips--head a,
body.sx-store-advanced--mall-catalog .sca-catalog-head .sca-sort select,
body.sx-store-advanced--mall-catalog .sca-catalog-head .sca-catalog-compare-bar__toggle,
body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar--panel .md3-btn--sm,
body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar--panel .sx-store-cmp-bar-link {
  box-sizing: border-box !important;
  height: var(--sca-cat-ctrl-h, 32px) !important;
  min-height: var(--sca-cat-ctrl-h, 32px) !important;
  max-height: var(--sca-cat-ctrl-h, 32px) !important;
  border-radius: var(--md3-shape-sm, 8px) !important;
  font-size: 12px !important;
  line-height: 1 !important;
  margin: 0;
}

body.sx-store-advanced--mall-catalog .sca-catalog-head .sca-chips--head a,
body.sx-store-advanced--mall-catalog .sca-catalog-head .sca-sort select,
body.sx-store-advanced--mall-catalog .sca-catalog-head .sca-catalog-compare-bar__toggle {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
}

body.sx-store-advanced--mall-catalog .sca-catalog-head .sca-chips--head a {
  padding: 0 12px !important;
}

body.sx-store-advanced--mall-catalog .sca-catalog-head .sca-sort select {
  padding: 0 28px 0 12px !important;
  min-width: 7rem;
  -webkit-appearance: none;
  appearance: none;
  background-image:
    linear-gradient(45deg, transparent 50%, var(--md3-color-on-surface-variant) 50%),
    linear-gradient(135deg, var(--md3-color-on-surface-variant) 50%, transparent 50%);
  background-position: calc(100% - 14px) calc(50% - 2px), calc(100% - 9px) calc(50% - 2px);
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

body.sx-store-advanced--mall-catalog .sca-catalog-head .sca-catalog-compare-bar__toggle {
  --md3-btn-height: var(--sca-cat-ctrl-h, 32px);
  --md3-btn-radius: var(--md3-shape-sm, 8px);
  --md3-btn-padding-x: 12px;
  gap: 4px;
  width: auto;
  min-width: auto;
  max-width: none;
  padding: 0 12px !important;
  flex-shrink: 0;
  border: 1px solid var(--md3-color-outline-variant) !important;
  background: var(--md3-color-surface) !important;
  color: var(--md3-color-on-surface) !important;
}

/* 桌面：始终显示「对比」文案，框体与排序 select 同高同边距，勿压成图标方块 */

/* ---------- 对比开关 + 展开后整行操作条 ---------- */
body.sx-store-advanced--mall-catalog .sca-catalog .sanxio-home-section__head.sca-catalog-head {
  flex-wrap: wrap;
}

body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar__toggle {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  box-sizing: border-box;
  min-width: 0;
  height: var(--sca-cat-ctrl-h, 32px);
  min-height: var(--sca-cat-ctrl-h, 32px);
  padding: 0 12px;
  font-size: 12px;
  line-height: 1;
  white-space: nowrap;
}

body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar__toggle .material-symbols-outlined {
  font-size: 16px;
}

body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar__toggle.is-active {
  background: color-mix(in srgb, var(--md3-color-primary) 12%, var(--md3-color-surface));
  border-color: var(--md3-color-primary);
  color: var(--md3-color-primary);
}

body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar--panel {
  display: none;
  flex: 1 0 100%;
  width: 100%;
  margin: 0;
  padding: 0;
  box-sizing: border-box;
  order: 20;
}

body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar--panel.is-open,
body.sx-store-advanced--mall-catalog.is-sca-compare-open .sca-catalog-compare-bar--panel {
  display: block;
}

body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar--panel[hidden] {
  display: none !important;
}

body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar__panel {
  display: flex;
  flex-wrap: nowrap;
  align-items: center;
  gap: 8px;
  margin: 0;
  padding: 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-sizing: border-box;
  min-height: var(--sca-cat-ctrl-h, 32px);
}

body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar__panel[hidden] {
  display: none !important;
}

body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar__check {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  margin: 0;
  padding: 0 4px;
  height: var(--sca-cat-ctrl-h, 32px);
  font-size: 13px;
  line-height: 1;
  color: var(--md3-color-on-surface-variant);
  white-space: nowrap;
  cursor: pointer;
  user-select: none;
}

body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar__check input {
  width: 16px;
  height: 16px;
  margin: 0;
  accent-color: var(--md3-color-primary);
}

body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar--panel .md3-btn--sm {
  white-space: nowrap;
  box-sizing: border-box;
  min-height: var(--sca-cat-ctrl-h, 32px);
  height: var(--sca-cat-ctrl-h, 32px);
  padding-inline: 12px;
  font-size: 12px;
  line-height: 1;
}

body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar--panel .sx-store-cmp-bar-link {
  display: inline-flex !important;
  align-items: center !important;
  justify-content: center !important;
  gap: 4px;
  margin-left: auto;
  padding: 0 10px !important;
  border: 1px solid var(--md3-color-outline-variant);
  background: var(--md3-color-surface);
  text-decoration: none;
  color: var(--md3-color-on-surface);
}

body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar--panel .sca-catalog-compare-bar__link-text {
  position: static !important;
  width: auto !important;
  height: auto !important;
  margin: 0 !important;
  clip: auto !important;
  overflow: visible !important;
  white-space: nowrap;
}

body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar--panel .sx-store-cmp-bar-link .material-symbols-outlined {
  font-size: 18px;
}

/* 未开启对比：隐藏商品卡勾选 */
body.sx-store-advanced--mall-catalog:not(.is-sca-compare-open) .sanxio-home-product-card__compare-pick {
  display: none !important;
}

body.sx-store-advanced--mall-catalog .sx-store-cmp-bar-count:not([hidden]) {
  margin-left: 2px;
  font-weight: 700;
  color: var(--md3-color-primary);
}

/* ---------- 分类 + 排序 ---------- */
body.sx-store-advanced .sca-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  flex: 1;
  min-width: 0;
}

body.sx-store-advanced .sca-chips a {
  padding: 4px 10px;
  border-radius: var(--md3-shape-sm, 8px);
  font-size: 12px;
  line-height: 1.2;
  text-decoration: none;
  border: 1px solid var(--md3-color-outline-variant);
  color: var(--md3-color-on-surface-variant);
  background: var(--md3-color-surface-container-low);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

body.sx-store-advanced .sca-chips a:hover {
  border-color: color-mix(in srgb, var(--md3-color-primary) 35%, var(--md3-color-outline-variant));
  color: var(--md3-color-primary);
}

body.sx-store-advanced .sca-chips a.is-active {
  background: var(--md3-color-primary-container);
  border-color: var(--md3-color-primary);
  color: var(--md3-color-primary);
  font-weight: 600;
}

body.sx-store-advanced--mall-catalog .sca-chips--head {
  display: flex;
  flex: 1 1 auto;
  align-items: center;
  justify-content: flex-start;
  flex-wrap: nowrap;
  min-width: 0;
  height: var(--sca-cat-ctrl-h, 32px);
  overflow-x: auto;
  overflow-y: hidden;
  scrollbar-width: none;
}

body.sx-store-advanced--mall-catalog .sca-chips--head::-webkit-scrollbar {
  display: none;
}

body.sx-store-advanced--mall-catalog .sca-chips--head a {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  box-sizing: border-box;
  height: var(--sca-cat-ctrl-h, 32px);
  min-height: var(--sca-cat-ctrl-h, 32px);
  padding: 0 12px;
  font-size: 12px;
  line-height: 1;
}

body.sx-store-advanced .sca-sort {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-shrink: 0;
  height: var(--sca-cat-ctrl-h, 32px);
  font-size: 12px;
  color: var(--md3-color-on-surface-variant);
}

body.sx-store-advanced--mall-catalog .sca-sort select,
body.sx-store-advanced .sca-sort select {
  box-sizing: border-box;
  height: var(--sca-cat-ctrl-h, 32px);
  min-height: var(--sca-cat-ctrl-h, 32px);
  min-width: 7rem;
  padding: 0 8px;
  border: 1px solid var(--md3-color-outline-variant);
  border-radius: var(--md3-shape-sm, 8px);
  background: var(--md3-color-surface);
  color: var(--md3-color-on-surface);
  font: inherit;
  font-size: 12px;
  line-height: 1;
}

/* 商品网格：左右贴区块外缘（与蓝条左缘对齐 / 左对挤） */
body.sx-store-advanced--mall-catalog .sca-catalog__body {
  padding: 0 0 var(--sanxio-gap-md, 12px);
  box-sizing: border-box;
}

body.sx-store-advanced--mall-catalog .sca-grid--products {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: var(--sanxio-gap-md, 12px);
}

@media (min-width: 768px) {
  body.sx-store-advanced--mall-catalog .sca-grid--products {
    grid-template-columns: repeat(3, minmax(0, 1fr));
    gap: var(--sanxio-content-gap, 20px);
  }

  body.sx-store-advanced .sca-catalog-head__title {
    font-size: 17px;
  }
}

@media (min-width: 1024px) {
  body.sx-store-advanced--mall-catalog .sca-grid--products {
    grid-template-columns: repeat(4, minmax(0, 1fr));
  }
}

body.sx-store-advanced--mall-catalog .sca-grid--products .sca-empty {
  grid-column: 1 / -1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sanxio-gap-sm, 8px);
  margin: 0;
  padding: 28px var(--sanxio-card-px, 12px);
  color: var(--md3-color-on-surface-variant);
  text-align: center;
  background: var(--md3-color-surface);
  border: 1px dashed var(--md3-color-outline-variant);
  border-radius: var(--md3-shape-md, 12px);
  box-sizing: border-box;
}

body.sx-store-advanced--mall-catalog .sca-grid--products .sca-empty .material-symbols-outlined {
  font-size: 40px;
  opacity: 0.5;
}

body.sx-store-advanced--mall-catalog .sca-grid--products .sca-empty p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

/* 采购锁定空态（无权限时挂在 body，不在 grid 内） */
body.sx-store-advanced--mall-catalog .sca-catalog__body > .sca-empty--locked {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: var(--sanxio-gap-sm, 8px);
  margin: 0;
  padding: 36px var(--sanxio-card-px, 12px);
  color: var(--md3-color-on-surface-variant);
  text-align: center;
  background: var(--md3-color-surface);
  border: 1px dashed var(--md3-color-outline-variant);
  border-radius: var(--md3-shape-md, 12px);
  box-sizing: border-box;
}

body.sx-store-advanced--mall-catalog .sca-catalog__body > .sca-empty--locked .material-symbols-outlined {
  font-size: 40px;
  opacity: 0.5;
}

body.sx-store-advanced--mall-catalog .sca-catalog__body > .sca-empty--locked p {
  margin: 0;
  font-size: 13px;
  line-height: 1.5;
}

body.sx-store-advanced--mall-catalog .sca-catalog__body > .sca-empty--locked .md3-btn {
  margin-top: var(--sanxio-gap-sm, 8px);
}

body.sx-store-advanced--mall-catalog .sca-grid--products .sanxio-home-product-card {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-width: 0;
  transition: box-shadow 0.2s ease, border-color 0.2s ease, transform 0.2s ease;
}

@media (hover: hover) {
  body.sx-store-advanced--mall-catalog .sca-grid--products .sanxio-home-product-card:hover {
    border-color: var(--md3-color-primary);
    box-shadow: 0 4px 12px color-mix(in srgb, var(--md3-color-on-surface) 12%, transparent);
    transform: translateY(-2px);
  }
}

body.sx-store-advanced--mall-catalog .sca-grid--products .sanxio-home-product-card__link {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* ---------- 骨架屏 ---------- */
body.sx-store-advanced .sanxio-home-product-card--skeleton {
  pointer-events: none;
  border-color: var(--md3-color-outline-variant);
}

body.sx-store-advanced .sanxio-home-product-card--skeleton .sanxio-home-product-card__img-wrap {
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: sca-shimmer 1.2s infinite;
}

body.sx-store-advanced .sanxio-home-product-card--skeleton .sanxio-home-product-card__title,
body.sx-store-advanced .sanxio-home-product-card--skeleton .sanxio-home-product-card__meta {
  height: 14px;
  margin: 8px 10px;
  background: #eee;
  border-radius: 4px;
}

@keyframes sca-shimmer {
  0% { background-position: 200% 0; }
  100% { background-position: -200% 0; }
}

body.sx-store-advanced .sca-card--skeleton {
  pointer-events: none;
  border-color: var(--md3-color-outline-variant);
}

body.sx-store-advanced .sca-card--skeleton .sca-card__media {
  background: linear-gradient(90deg, #eee 25%, #f5f5f5 50%, #eee 75%);
  background-size: 200% 100%;
  animation: sca-shimmer 1.2s infinite;
}

body.sx-store-advanced .sca-card--skeleton .sca-card__title,
body.sx-store-advanced .sca-card--skeleton .sca-card__price {
  height: 14px;
  background: #eee;
  border-radius: 4px;
  margin: 8px 12px;
}

/* ---------- 移动版 ≤767 ---------- */
@media (max-width: 767px) {
  body.sx-store-advanced--mall-catalog .sca-viewport {
    padding-bottom: calc(56px + env(safe-area-inset-bottom, 0) + var(--sanxio-gap-md, 12px));
  }

  /* 卡片落在 viewport 页边内，左右与顶栏内容对齐 */
  body.sx-store-advanced--mall-catalog .sca-catalog.sanxio-home-section-card--unified-list {
    --sca-cat-pad-start: 12px;
    --sca-cat-pad-end: 12px;
    margin-inline: 0;
    border-radius: var(--md3-shape-md, 12px) !important;
  }

  body.sx-store-advanced--mall-catalog .sca-channel-top--catalog {
    margin: 0;
    padding: 0 0 6px;
  }

  body.sx-store-advanced--mall-catalog .sca-channel-top--catalog .sca-crumb {
    display: block;
    white-space: nowrap;
    overflow: hidden;
    text-overflow: ellipsis;
    font-size: 11px;
  }

  /* 压过 home-premium；与商品同左右内边距；垂直居中对齐 */
  body.sx-store-advanced--mall-catalog.sanxio-home-premium-page .sca-catalog.sanxio-home-section-card--unified-list .sanxio-home-section__head.sca-catalog-head,
  body.sx-store-advanced--mall-catalog .sca-catalog .sanxio-home-section__head.sca-catalog-head {
    display: flex !important;
    flex-direction: row !important;
    flex-wrap: wrap !important;
    align-items: center !important;
    justify-content: flex-start !important;
    column-gap: 8px !important;
    row-gap: 8px !important;
    gap: 8px !important;
    min-height: 0 !important;
    height: auto !important;
    margin: 0 0 var(--sanxio-gap-sm, 8px) !important;
    padding: 10px var(--sca-cat-pad-end, 12px) 10px var(--sca-cat-pad-start, 16px) !important;
    border-radius: var(--md3-shape-md, 12px) var(--md3-shape-md, 12px) 0 0 !important;
    border-style: solid !important;
    border-color: var(--md3-color-primary, #005fb8) !important;
    border-width: 1px var(--sx-home-head-rail-width, 4px) 0 !important;
    background-color: var(--md3-color-surface, #fff) !important;
    background-image: none !important;
    box-shadow: none !important;
  }

  body.sx-store-advanced--mall-catalog .sca-catalog-head__title,
  body.sx-store-advanced--mall-catalog.sanxio-home-premium-page .sca-catalog .sca-catalog-head__title {
    font-size: 13px !important;
    max-width: 4.2em;
    line-height: var(--sca-cat-ctrl-h, 32px) !important;
    height: var(--sca-cat-ctrl-h, 32px);
    padding: 0 !important;
    display: inline-flex;
    align-items: center;
  }

  body.sx-store-advanced--mall-catalog .sca-catalog-head__aside {
    gap: 8px;
    margin-left: auto;
    height: var(--sca-cat-ctrl-h, 32px);
    align-items: center;
  }

  body.sx-store-advanced--mall-catalog .sca-chips--head {
    flex: 1 1 auto;
    justify-content: flex-start;
    min-width: 0;
    max-width: none;
    mask-image: linear-gradient(to right, #000 calc(100% - 10px), transparent);
    -webkit-mask-image: linear-gradient(to right, #000 calc(100% - 10px), transparent);
  }

  body.sx-store-advanced--mall-catalog .sca-chips--head a {
    height: var(--sca-cat-ctrl-h, 32px) !important;
    min-height: var(--sca-cat-ctrl-h, 32px) !important;
    max-height: var(--sca-cat-ctrl-h, 32px) !important;
    padding: 0 10px !important;
    font-size: 12px !important;
    display: inline-flex !important;
    align-items: center !important;
    justify-content: center !important;
    line-height: 1 !important;
    border-radius: var(--md3-shape-sm, 8px) !important;
  }

  body.sx-store-advanced--mall-catalog .sca-sort__label {
    position: absolute;
    width: 1px;
    height: 1px;
    padding: 0;
    margin: -1px;
    overflow: hidden;
    clip: rect(0, 0, 0, 0);
    white-space: nowrap;
    border: 0;
  }

  body.sx-store-advanced--mall-catalog .sca-sort {
    position: relative;
    padding: 0;
    border: none;
    background: transparent;
    flex-shrink: 0;
    height: var(--sca-cat-ctrl-h, 32px);
    align-items: center;
  }

  /* native select 与 Chip 同高；保留自定义箭头位 */
  body.sx-store-advanced--mall-catalog .sca-catalog-head .sca-sort select {
    width: auto !important;
    min-width: 4.5rem !important;
    max-width: 5.5rem !important;
    height: var(--sca-cat-ctrl-h, 32px) !important;
    min-height: var(--sca-cat-ctrl-h, 32px) !important;
    max-height: var(--sca-cat-ctrl-h, 32px) !important;
    font-size: 12px !important;
    line-height: 1 !important;
    padding: 0 22px 0 8px !important;
    border: 1px solid var(--md3-color-outline-variant) !important;
    border-radius: var(--md3-shape-sm, 8px) !important;
    background-color: var(--md3-color-surface-container-low) !important;
    -webkit-appearance: none !important;
    appearance: none !important;
    background-image:
      linear-gradient(45deg, transparent 50%, var(--md3-color-on-surface-variant) 50%),
      linear-gradient(135deg, var(--md3-color-on-surface-variant) 50%, transparent 50%) !important;
    background-position: calc(100% - 12px) calc(50% - 2px), calc(100% - 7px) calc(50% - 2px) !important;
    background-size: 5px 5px, 5px 5px !important;
    background-repeat: no-repeat !important;
  }

  body.sx-store-advanced--mall-catalog .sca-catalog-head .sca-catalog-compare-bar__toggle {
    --md3-btn-height: var(--sca-cat-ctrl-h, 32px);
    --md3-btn-radius: var(--md3-shape-sm, 8px);
    --md3-btn-padding-x: 10px;
    gap: 4px !important;
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
    padding: 0 10px !important;
    flex-shrink: 0;
  }

  /* 窄屏仍显示「对比」文案，与排序同高，避免孤立小图标方块 */
  body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar__toggle:not(.is-active) {
    width: auto !important;
    min-width: auto !important;
    padding: 0 10px !important;
  }

  body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar__toggle:not(.is-active) .sca-catalog-compare-bar__toggle-on {
    position: static;
    width: auto;
    height: auto;
    padding: 0;
    margin: 0;
    overflow: visible;
    clip: auto;
    white-space: nowrap;
    border: 0;
  }

  body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar__toggle.is-active {
    width: auto !important;
    min-width: auto !important;
    max-width: none !important;
    padding: 0 10px !important;
    flex-shrink: 0;
  }

  body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar__toggle .material-symbols-outlined {
    font-size: 18px;
    line-height: 1;
  }

  body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar__panel {
    flex-wrap: nowrap;
    gap: 8px;
    min-height: var(--sca-cat-ctrl-h, 32px);
  }

  body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar__check {
    padding: 0 2px;
    font-size: 12px;
    height: var(--sca-cat-ctrl-h, 32px);
  }

  body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar__check span {
    display: none;
  }

  body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar--panel .md3-btn--sm,
  body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar--panel .sx-store-cmp-bar-link {
    --md3-btn-height: var(--sca-cat-ctrl-h, 32px);
    --md3-btn-radius: var(--md3-shape-sm, 8px);
    --md3-btn-padding-x: 10px;
    height: var(--sca-cat-ctrl-h, 32px) !important;
    min-height: var(--sca-cat-ctrl-h, 32px) !important;
    max-height: var(--sca-cat-ctrl-h, 32px) !important;
    font-size: 12px !important;
  }

  body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar__submit {
    padding-inline: 10px !important;
  }

  /* 移动端也显示「对比栏」文字，避免只剩孤立小图标 */
  body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar--panel .sca-catalog-compare-bar__link-text {
    position: static !important;
    width: auto !important;
    height: auto !important;
    margin: 0 !important;
    padding: 0 !important;
    clip: auto !important;
    overflow: visible !important;
    white-space: nowrap !important;
    border: 0 !important;
  }

  body.sx-store-advanced--mall-catalog .sca-catalog-compare-bar--panel .sx-store-cmp-bar-link {
    padding: 0 8px !important;
    flex-shrink: 0;
  }

  body.sx-store-advanced--mall-catalog .sca-catalog__body {
    padding: 0 0 10px !important;
  }

  body.sx-store-advanced--mall-catalog .sca-grid--products {
    gap: 8px;
  }

  body.sx-store-advanced--mall-catalog .sca-grid--products .sanxio-home-product-card {
    border-radius: var(--md3-shape-sm, 8px);
  }

  body.sx-store-advanced--mall-catalog .sca-grid--products .sanxio-home-product-card:active {
    border-color: color-mix(in srgb, var(--md3-color-primary) 40%, var(--md3-color-outline-variant));
  }

  body.sx-store-advanced--mall-catalog .sca-grid--products .sanxio-home-product-card__title {
    font-size: 12px;
    line-height: 1.3;
    padding: 6px 8px 0;
  }

  body.sx-store-advanced--mall-catalog .sca-grid--products .sanxio-home-product-card__meta {
    padding: 4px 8px 8px;
    gap: 4px;
  }

  body.sx-store-advanced--mall-catalog .sca-grid--products .sanxio-home-product-card__price {
    font-size: 13px;
    font-weight: 700;
  }

  body.sx-store-advanced--mall-catalog .sca-grid--products .sanxio-home-product-card__sold {
    font-size: 10px;
  }
}
/**
 * ======= sanxio store-advanced catalog end ===========
 */
