.tbs {
  display: block;
  padding-top: var(--tbs-pt-pc);
  padding-bottom: var(--tbs-pb-pc);
  color: var(--tbs-text);
  background: var(--tbs-bg);
}

/* ---------- 标题行：左标题 + 标签 + 右上 View More（桌面） ---------- */
.tbs__head {
  display: flex;
  align-items: flex-end;
  gap: 8px 28px;
  border-bottom: 1px solid rgba(0, 0, 0, 0.1);
}

.tbs .tbs__heading {
  margin: 0 0 10px;
  font-size: var(--tbs-heading-size-pc);
  font-weight: 600;
  line-height: 1.2;
  color: var(--tbs-text);
}

.tbs__tabs {
  display: flex;
  gap: 4px;
}

.tbs__tab {
  padding: 10px 12px;
  font-family: inherit;
  margin-bottom: -1px;
  font-size: 15px;
  line-height: 1.2;
  color: var(--tbs-text);
  cursor: pointer;
  background: none;
  border: 0;
  border-bottom: 2px solid transparent;
  opacity: 0.65;
  transition: opacity 0.15s ease, border-color 0.15s ease;
}

.tbs__tab:hover {
  opacity: 1;
}

.tbs__tab.is-active {
  font-weight: 500;
  border-bottom-color: var(--tbs-text);
  opacity: 1;
}

.tbs__more-link {
  display: inline-flex;
  gap: 4px;
  align-items: center;
  margin-left: auto;
  margin-bottom: 10px;
  font-size: 16px;
  color: var(--tbs-accent);
  text-decoration: underline;
  text-underline-offset: 3px;
  white-space: nowrap;
}

.tbs__more-btn {
  display: none;
}

/* ---------- 横滑 ---------- */
.tbs__viewport {
  position: relative;
  margin-top: 12px;
}

.tbs__panel[hidden] {
  display: none;
}

.tbs__track {
  display: flex;
  gap: var(--tbs-gap-pc);
  overflow-x: auto;
  overscroll-behavior-x: contain;
  scroll-behavior: smooth;
  scroll-snap-type: x mandatory;
  scrollbar-width: none;
}

.tbs__track::-webkit-scrollbar {
  display: none;
}

.tbs__slide {
  flex: 0 0 calc((100% - var(--tbs-gap-pc) * (var(--tbs-per-view-pc) - 1)) / var(--tbs-per-view-pc));
  min-width: 0;
  scroll-snap-align: start;
}

/* ---------- 商品卡 ---------- */
.tbs-card__link {
  display: block;
  color: inherit;
  text-decoration: none;
}

.tbs-card__media {
  position: relative;
  aspect-ratio: var(--tbs-ratio);
  overflow: hidden;
  background: var(--tbs-tile-bg);
}

.tbs-card__media .tbs-card__img {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center;
}

/* 模特上身图：叠在商品图上，电脑端鼠标移到卡片上时淡入 */
.tbs-card__media .tbs-card__img--hover {
  position: absolute;
  inset: 0;
  z-index: 1;
  opacity: 0;
  transition: opacity 0.35s ease;
}

@media (hover: hover) and (min-width: 960px) {
  .tbs-card__link:hover .tbs-card__img--hover {
    opacity: 1;
  }
}

/* 触屏没有悬停，上身图永远看不到；display:none 让懒加载的图也不下载，省手机流量 */
@media (hover: none), (max-width: 959px) {
  .tbs-card__media .tbs-card__img--hover {
    display: none;
  }
}

/* 「N colors」常显，压在图片区下部居中，和对标一致；在上身图之上 */
.tbs-card__colors {
  position: absolute;
  inset-inline: 0;
  bottom: 14%;
  z-index: 2;
  font-size: 15px;
  line-height: 1.4;
  color: var(--tbs-text);
  text-align: center;
  pointer-events: none;
}

.tbs-card__info {
  padding-top: 12px;
}

.tbs .tbs-card__title {
  margin: 0;
  font-family: var(--body-font);
  overflow: hidden;
  font-size: 17px;
  font-weight: 400;
  line-height: 1.4;
  color: var(--tbs-text);
  text-overflow: ellipsis;
  white-space: nowrap;
}

.tbs-card__price {
  margin-top: 4px;
  font-size: 17px;
  font-weight: 700;
  line-height: 1.3;
  color: var(--tbs-price);
}

/* ---------- 箭头：白底圆形，在卡片区两侧外沿 ---------- */
.tbs__arrow {
  position: absolute;
  /* 对准图片区垂直中线，高度由 JS 写入 --tbs-media-h */
  top: calc(var(--tbs-media-h, 50%) / 2);
  z-index: 2;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--tbs-text);
  cursor: pointer;
  background: #fff;
  border: 1px solid rgba(0, 0, 0, 0.15);
  border-radius: 50%;
  transform: translateY(-50%);
}

.tbs__arrow[hidden] {
  display: none;
}

.tbs__arrow--prev {
  left: -20px;
}

.tbs__arrow--next {
  right: -20px;
}

/* ---------- 手机端：居中加粗标题、标签在下、露边横滑、底部通栏 View More ---------- */
@media (max-width: 959px) {
  .tbs {
    padding-top: var(--tbs-pt-mobile);
    padding-bottom: var(--tbs-pb-mobile);
  }

  .tbs__head {
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
    border-bottom: 0;
  }

  .tbs .tbs__heading {
    margin: 0;
    font-size: var(--tbs-heading-size-mobile);
    font-weight: 600;
    text-align: center;
  }

  .tbs__tabs {
    overflow-x: auto;
    scrollbar-width: none;
  }

  .tbs__tabs::-webkit-scrollbar {
    display: none;
  }

  .tbs__tab {
    flex-shrink: 0;
    font-size: 14px;
  }

  .tbs__more-link {
    display: none;
  }

  .tbs__viewport {
    margin-top: 16px;
  }

  .tbs__track {
    gap: var(--tbs-gap-mobile);
  }

  .tbs__slide {
    flex-basis: calc((100% - var(--tbs-gap-mobile) * (var(--tbs-per-view-mobile) - 1)) / var(--tbs-per-view-mobile));
  }

  /* 手机卡片小，文字再往下放，避免贴着镜框下沿 */
  .tbs-card__colors {
    bottom: 6%;
    font-size: 13px;
  }

  .tbs-card__info {
    padding-top: 8px;
  }

  .tbs .tbs-card__title {
    font-size: 14px;
  }

  .tbs-card__price {
    margin-top: 2px;
    font-size: 15px;
  }

  .tbs__arrow {
    display: none;
  }

  .tbs__more-btn {
    display: block;
    margin-top: 20px;
    padding: 10px 16px;
    font-size: 15px;
    line-height: 1.3;
    color: var(--tbs-text);
    text-align: center;
    text-decoration: none;
    border: 1px solid var(--tbs-text);
    border-radius: 6px;
  }
}

/* 左上角自定义标签（每个商品区块里填，如 HOT / NEW / SALE） */
.tbs-card__badge {
  position: absolute;
  top: 12px;
  left: 12px;
  z-index: 2;
  padding: 4px 10px;
  font-size: 12px;
  line-height: 1.4;
  color: var(--tbs-badge-text);
  letter-spacing: 0.04em;
  background: var(--tbs-badge-bg);
  border-radius: 4px;
}

@media (max-width: 959px) {
  .tbs-card__badge {
    top: 8px;
    left: 8px;
    padding: 2px 8px;
    font-size: 11px;
  }
}

/* 右上角快速加购：叠在图片右上角（按钮在卡片链接外面，点它不会跳详情页） */
.tbs-card {
  position: relative;
}

.tbs-card .card-quick-add {
  position: absolute;
  top: 10px;
  right: 10px;
  z-index: 3;
}

.tbs-card .card-quick-add__btn {
  position: relative;
  display: flex;
  align-items: center;
  justify-content: center;
  width: 36px;
  height: 36px;
  padding: 0;
  color: var(--tbs-qa-icon);
  cursor: pointer;
  background: var(--tbs-qa-bg);
  border: 0;
  border-radius: 50%;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.08);
  transition: transform 0.15s ease;
}

.tbs-card .card-quick-add__btn:hover {
  transform: scale(1.06);
}

/* 加载中只显示转圈，隐藏图标 */
.tbs-card .card-quick-add__btn.loading .card-quick-add__icon {
  visibility: hidden;
}

@media (max-width: 959px) {
  .tbs-card .card-quick-add {
    top: 6px;
    right: 6px;
  }

  .tbs-card .card-quick-add__btn {
    width: 30px;
    height: 30px;
  }

  .tbs-card .card-quick-add__icon {
    width: 18px;
    height: 18px;
  }
}

/* 转圈默认隐藏：首页不加载 base.css，那里的「默认隐藏」规则不生效，这里自己兜底。
   component-quick-add.js 加载时会给转圈加 display-flex */
.tbs-card .card-quick-add .loading-overlay__spinner {
  position: absolute;
  inset: 0;
  display: none;
  align-items: center;
  justify-content: center;
}

.tbs-card .card-quick-add .loading-overlay__spinner.display-flex {
  display: flex;
}

.tbs-card .card-quick-add .loading-overlay__spinner svg {
  width: 16px;
  height: 16px;
  animation: card-qa-spin 1s linear infinite;
}

@keyframes card-qa-spin {
  to {
    transform: rotate(360deg);
  }
}
