/* ============================================================
   小榆校园 · 二手模块版式辅助
   来源：2026-11-18/ui-lines/secondhand/secondhand.css
   只做版式排布；颜色 / 字号 / 圆角 / 阴影全部引用 yu-base.css 的 --yu-* 变量。
   不重写 .yu-btn / .yu-card / .yu-input 等公共组件。
   ============================================================ */

/* ---------- 站点运行时兼容 ----------
   base.css 的弹层用 .is-open 控制显隐，站点 js/app.js 的
   YU.confirm / YU.actionSheet 使用 .show，这里做等价映射，不改脚本。 */
.yu-mask.show { opacity: 1; visibility: visible; }
.yu-dialog.show { opacity: 1; visibility: visible; transform: translate(-50%, -50%) scale(1); }
.yu-sheet.show { transform: translate(-50%, 0); }

/* ---------- 通用 ---------- */
.sh-top { padding-top: 12px; }
.sh-block { margin-top: 16px; }
.sh-block-lg { margin-top: 24px; }
.sh-muted { color: var(--yu-text-3); }
.sh-center { text-align: center; }
.sh-price-xl {
  font-size: 32px; line-height: 38px; font-weight: 800;
  color: var(--yu-danger); font-variant-numeric: tabular-nums;
}
.sh-price-xl small { font-size: 18px; margin-right: 1px; }
.sh-strike { text-decoration: line-through; color: var(--yu-text-3); font-size: var(--yu-fs-caption); }
.sh-dot { color: var(--yu-line-strong); margin: 0 6px; }
.sh-count { font-size: var(--yu-fs-micro); color: var(--yu-text-3); }

/* ---------- 列表：热门 / 捡漏 ---------- */
.sh-hot {
  display: flex; gap: 10px; overflow-x: auto;
  padding: 2px 2px 8px; margin: 0 -2px;
  scrollbar-width: none;
}
.sh-hot::-webkit-scrollbar { display: none; }
.sh-hot__card {
  position: relative; flex: 0 0 140px; display: block;
  background: var(--yu-surface); border: 1px solid var(--yu-border);
  border-radius: var(--yu-radius-lg); box-shadow: var(--yu-shadow-sm);
  overflow: hidden;
}
.sh-hot__cover { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--yu-green-50); }
.sh-hot__body { padding: 8px 10px 10px; }
.sh-hot__title {
  font-size: var(--yu-fs-caption); line-height: 18px; font-weight: 600;
  height: 36px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sh-rank {
  position: absolute; left: 8px; top: 8px; z-index: 1;
  display: grid; place-items: center;
  min-width: 22px; height: 22px; padding: 0 6px;
  border-radius: var(--yu-radius-pill);
  background: var(--yu-accent); color: #5C2E05;
  font-size: 11px; font-weight: 800; line-height: 1;
  box-shadow: var(--yu-shadow-orange);
}
.sh-rank--2 { background: var(--yu-peach); color: var(--yu-orange-700); box-shadow: none; }
.sh-rank--3 { background: var(--yu-cream-deep); color: var(--yu-text-2); box-shadow: none; }

.sh-bargain { display: grid; gap: 8px; margin-top: 10px; }
.sh-bargain__row {
  display: flex; align-items: center; gap: 10px;
  padding: 8px; border-radius: var(--yu-radius-md);
  background: var(--yu-surface); border: 1px solid var(--yu-border);
}
.sh-bargain__cover {
  width: 62px; height: 62px; flex-shrink: 0; object-fit: cover;
  border-radius: var(--yu-radius-sm); background: var(--yu-green-50);
}
.sh-bargain__title {
  font-size: var(--yu-fs-sm); font-weight: 600; line-height: 20px;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 列表：商品网格 ---------- */
.sh-grid { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.sh-item {
  display: block; overflow: hidden;
  background: var(--yu-surface); border: 1px solid var(--yu-border);
  border-radius: var(--yu-radius-lg); box-shadow: var(--yu-shadow-sm);
}
.sh-item__media { position: relative; }
.sh-item__cover { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; background: var(--yu-green-50); }
.sh-item__flag { position: absolute; left: 7px; top: 7px; }
.sh-item__body { padding: 8px 10px 10px; }
.sh-item__title {
  font-size: var(--yu-fs-sm); line-height: 20px; font-weight: 600;
  height: 40px; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.sh-item__price { margin-top: 6px; display: flex; align-items: baseline; gap: 4px; }
.sh-item__price b { font-size: 17px; line-height: 22px; color: var(--yu-danger); font-variant-numeric: tabular-nums; }
.sh-item__price b small { font-size: 12px; }
.sh-item__meta {
  margin-top: 5px; display: flex; align-items: center; justify-content: space-between;
  font-size: var(--yu-fs-micro); color: var(--yu-text-3);
}
.sh-foot { padding: 18px 0 4px; text-align: center; font-size: var(--yu-fs-micro); color: var(--yu-text-3); }

/* ---------- 详情页：相册 ---------- */
.sh-gallery { position: relative; margin: 0 calc(-1 * var(--yu-gutter)); background: var(--yu-cream-deep); }
.sh-gallery__img { width: 100%; aspect-ratio: 1 / 1; object-fit: cover; }
.sh-gallery__count {
  position: absolute; right: 12px; bottom: 12px;
  padding: 3px 10px; border-radius: var(--yu-radius-pill);
  background: rgba(35, 30, 24, .55); color: #fff;
  font-size: var(--yu-fs-micro); font-variant-numeric: tabular-nums;
}
.sh-gallery__dots { position: absolute; left: 0; right: 0; bottom: 14px; display: flex; justify-content: center; gap: 5px; }
.sh-gallery__dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(255, 255, 255, .55); }
.sh-gallery__dots i.is-on, .sh-gallery__dots i.active { width: 16px; border-radius: 3px; background: #fff; }
.sh-thumbs {
  display: flex; gap: 8px; overflow-x: auto;
  margin: 10px calc(-1 * var(--yu-gutter)) 0;
  padding: 0 var(--yu-gutter) 2px;
  scrollbar-width: none;
}
.sh-thumbs::-webkit-scrollbar { display: none; }
.sh-thumbs img {
  width: 56px; height: 56px; flex-shrink: 0; object-fit: cover;
  border-radius: var(--yu-radius-sm); border: 2px solid transparent;
  background: var(--yu-green-50);
}
.sh-thumbs img.is-on { border-color: var(--yu-primary); }

/* ---------- 详情页：卖家 / 信息 ---------- */
.sh-seller { display: flex; align-items: center; gap: 10px; }
.sh-avatar {
  display: grid; place-items: center; border-radius: 50%;
  background: var(--yu-primary-soft); color: var(--yu-primary-strong);
  font-size: var(--yu-fs-h3); font-weight: 800;
}
.sh-kv { display: flex; align-items: flex-start; justify-content: space-between; gap: 16px; padding: 11px 14px; font-size: var(--yu-fs-caption); }
.sh-kv + .sh-kv { border-top: 1px solid var(--yu-border); }
.sh-kv__k { color: var(--yu-text-3); flex-shrink: 0; }
.sh-kv__v { color: var(--yu-text); text-align: right; word-break: break-all; }

/* ---------- 发布页 ---------- */
.sh-upload { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.sh-upload__tile {
  position: relative; aspect-ratio: 1 / 1; overflow: hidden;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  border: 1px dashed var(--yu-border-strong); border-radius: var(--yu-radius-md);
  background: var(--yu-surface-alt); color: var(--yu-text-3);
  font-size: var(--yu-fs-micro);
}
.sh-upload__tile img { width: 100%; height: 100%; object-fit: cover; }
.sh-upload__del {
  position: absolute; right: 4px; top: 4px;
  width: 20px; height: 20px; border-radius: 50%;
  display: grid; place-items: center;
  background: rgba(35, 30, 24, .55); color: #fff;
}
.sh-chipwrap { display: flex; flex-wrap: wrap; gap: 8px; }
.sh-form-foot { padding: 2px 2px 8px; font-size: var(--yu-fs-micro); line-height: 1.6; color: var(--yu-text-3); }

/* ---------- 我的二手 ---------- */
.sh-stats { display: grid; grid-template-columns: repeat(3, 1fr); text-align: center; }
.sh-stats__item + .sh-stats__item { border-left: 1px solid var(--yu-border); }
.sh-stats__n { font-size: var(--yu-fs-h2); line-height: 26px; font-weight: 800; color: var(--yu-primary-strong); font-variant-numeric: tabular-nums; }
.sh-stats__l { margin-top: 2px; font-size: var(--yu-fs-micro); color: var(--yu-text-3); }
.sh-mine {
  display: flex; gap: 10px; padding: 12px;
  background: var(--yu-surface); border: 1px solid var(--yu-border);
  border-radius: var(--yu-radius-lg); box-shadow: var(--yu-shadow-sm);
}
.sh-mine__cover {
  width: 84px; height: 84px; flex-shrink: 0; object-fit: cover;
  border-radius: var(--yu-radius-md); background: var(--yu-green-50);
}
.sh-mine__acts { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.sh-mine + .sh-mine { margin-top: 10px; }

/* ---------- 交易 ---------- */
.sh-trade__head { display: flex; align-items: center; justify-content: space-between; gap: 8px; font-size: var(--yu-fs-micro); color: var(--yu-text-3); }
.sh-trade__item { display: flex; gap: 10px; margin-top: 10px; }
.sh-trade__cover { width: 64px; height: 64px; flex-shrink: 0; object-fit: cover; border-radius: var(--yu-radius-md); background: var(--yu-green-50); }
.sh-trade__acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 12px; }
.sh-trade__line { margin-top: 8px; padding-top: 8px; border-top: 1px dashed var(--yu-border-strong); font-size: var(--yu-fs-micro); color: var(--yu-text-2); }

/* 步骤条 */
.sh-steps { display: flex; margin-top: 6px; }
.sh-step {
  position: relative; flex: 1; text-align: center;
  font-size: 11px; line-height: 16px; color: var(--yu-text-3);
}
.sh-step::before {
  content: ""; position: absolute; top: 10px; left: -50%; width: 100%; height: 2px;
  background: var(--yu-border);
}
.sh-step:first-child::before { display: none; }
.sh-step__dot {
  position: relative; z-index: 1;
  width: 22px; height: 22px; margin: 0 auto 6px;
  display: grid; place-items: center;
  border: 1px solid var(--yu-border-strong); border-radius: 50%;
  background: var(--yu-surface); color: var(--yu-text-3);
  font-size: 11px; font-weight: 700;
}
.sh-step.is-done { color: var(--yu-text-2); }
.sh-step.is-done::before { background: var(--yu-primary); }
.sh-step.is-done .sh-step__dot { background: var(--yu-primary); border-color: var(--yu-primary); color: #fff; }
.sh-step.is-on { color: var(--yu-primary-strong); font-weight: 600; }
.sh-step.is-on::before { background: var(--yu-primary); }
.sh-step.is-on .sh-step__dot {
  background: var(--yu-surface); border-color: var(--yu-primary); color: var(--yu-primary-strong);
  box-shadow: 0 0 0 4px var(--yu-green-50);
}

/* 凭证码 */
.sh-voucher { text-align: center; }
.sh-voucher__code {
  margin-top: 2px;
  font-family: var(--yu-font-mono); font-size: 26px; line-height: 34px;
  letter-spacing: 6px; font-weight: 700; color: var(--yu-primary-deep);
}
.sh-code-inputs { display: flex; gap: 10px; }
.sh-code-inputs input {
  width: 52px; height: 56px;
  border: 1px solid var(--yu-border-strong); border-radius: var(--yu-radius-md);
  background: var(--yu-surface-alt); text-align: center;
  font-size: 24px; font-weight: 700; color: var(--yu-text);
  outline: none;
}
.sh-code-inputs input.is-focus {
  border-color: var(--yu-green-400); background: var(--yu-white);
  box-shadow: 0 0 0 3px var(--yu-focus-ring);
}

/* ---------- 到期提醒 ---------- */
.sh-expire-hero { text-align: center; padding: 26px 18px 22px; }
.sh-expire-hero__ic {
  width: 64px; height: 64px; margin: 0 auto 12px;
  display: grid; place-items: center;
  border-radius: 50%; background: var(--yu-orange-soft); color: var(--yu-orange-700);
}
.sh-option { display: flex; align-items: flex-start; gap: 10px; }
.sh-option + .sh-option { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--yu-border); }
.sh-option__ic {
  width: 34px; height: 34px; flex-shrink: 0;
  display: grid; place-items: center; border-radius: 50%;
  background: var(--yu-primary-soft); color: var(--yu-primary-strong);
}
.sh-option__ic--warn { background: var(--yu-danger-soft); color: var(--yu-danger); }

/* ---------- 举报面板 ---------- */
.sh-reason { display: flex; align-items: center; justify-content: space-between; gap: 12px; padding: 13px 2px; }
.sh-reason + .sh-reason { border-top: 1px solid var(--yu-border); }

@media (max-width: 400px) {
  .sh-code-inputs input { width: 46px; height: 52px; }
}
