/* ============================================
   批发商城+口令+注册
   从 style.css 拆分
   ============================================ */

/* ========== Wholesale Mall ========== */

/* Search */
.ws-search-bar {
  padding: var(--space-3) 0;
  position: sticky;
  top: 0;
  z-index: 10;
  background: var(--color-bg);
}
.ws-search-input-wrap {
  display: flex;
  align-items: center;
  background: #fff;
  border: 1px solid var(--color-border);
  border-radius: var(--radius-full);
  padding: var(--space-2) var(--space-4);
  gap: var(--space-2);
}
.ws-search-icon {
  color: var(--color-text-muted);
  flex-shrink: 0;
}
.ws-search-input {
  flex: 1;
  border: none;
  outline: none;
  font-size: var(--text-base);
  color: var(--color-text);
  background: transparent;
}
.ws-search-input::placeholder { color: var(--color-text-muted); }

/* Ad Slots — shared */
.ws-section {
  padding: 0 var(--space-4);
  margin-bottom: var(--space-4);
}
.ws-section-header {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin-bottom: var(--space-3);
}
.ws-section-label {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--color-text);
  line-height: 1.3;
}
.ws-section-sublabel {
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  font-weight: 400;
  margin-left: var(--space-1);
}

/* L1 — Banner */
.ws-banner {
  padding: var(--space-3) 0;
  margin-bottom: var(--space-3);
}
.ws-banner-card {
  display: flex;
  align-items: center;
  justify-content: space-between;
  background: linear-gradient(135deg, #FFF7ED, #FFEDD5);
  border-radius: var(--radius-card);
  padding: var(--space-4) var(--space-5);
  min-height: 110px;
  position: relative;
  overflow: hidden;
}
.ws-banner-dots {
  display: flex;
  justify-content: center;
  gap: 6px;
  margin-top: var(--space-2);
}
.ws-banner-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--color-border);
  transition: background .3s;
}
.ws-banner-dot.active { background: var(--color-primary); width: 16px; border-radius: 3px; }
.ws-banner-text { flex: 1; }
.ws-banner-title { font-size: var(--text-lg); font-weight: 700; color: var(--color-text); margin-bottom: 4px; }
.ws-banner-sub { font-size: var(--text-sm); color: var(--color-primary-dark); }
.ws-banner-img { width: 64px; height: 64px; border-radius: var(--radius-sm); object-fit: cover; background: #fff; }

/* L2 — Merchants */
.ws-merchant-scroll {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.ws-merchant-scroll::-webkit-scrollbar { display: none; }
.ws-merchant-card {
  flex: 0 0 140px;
  scroll-snap-align: start;
  background: #fff;
  border-radius: var(--radius-card);
  padding: var(--space-4) var(--space-3);
  text-align: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .15s;
}
.ws-merchant-card:active { transform: scale(.97); }
.ws-merchant-logo {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: var(--color-bg-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  margin: 0 auto var(--space-2);
  font-size: 20px;
  font-weight: 700;
  color: var(--color-primary);
}
.ws-merchant-name { font-size: var(--text-sm); font-weight: 600; color: var(--color-text); margin-bottom: 2px; }
.ws-merchant-cats { font-size: var(--text-xs); color: var(--color-text-muted); }

/* L3 — Featured */
.ws-featured-scroll {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.ws-featured-scroll::-webkit-scrollbar { display: none; }
.ws-featured-card {
  flex: 0 0 260px;
  scroll-snap-align: start;
  background: #fff;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .15s;
}
.ws-featured-card:active { transform: scale(.97); }
.ws-featured-img {
  width: 100%; height: 140px;
  object-fit: cover;
  background: var(--color-bg);
}
.ws-featured-body { padding: var(--space-3); }
.ws-featured-name {
  font-size: var(--text-base); font-weight: 600;
  color: var(--color-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-featured-tags {
  display: flex; gap: 4px; margin-top: 4px; flex-wrap: wrap;
}
.ws-featured-price {
  display: flex; align-items: baseline; gap: var(--space-1); margin-top: var(--space-2);
}
.ws-featured-price-val { font-size: var(--text-lg); font-weight: 700; color: var(--color-primary); }
.ws-featured-price-label { font-size: var(--text-xs); color: var(--color-text-muted); }
.ws-featured-moq { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }

/* L4 — Flash */
.ws-flash-scroll {
  display: flex;
  gap: var(--space-3);
  overflow-x: auto;
  scroll-snap-type: x mandatory;
  -webkit-overflow-scrolling: touch;
}
.ws-flash-scroll::-webkit-scrollbar { display: none; }
.ws-flash-card {
  flex: 0 0 260px;
  scroll-snap-align: start;
  background: #fff;
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  position: relative;
  transition: transform .15s;
}
.ws-flash-card:active { transform: scale(.97); }
.ws-flash-badge {
  position: absolute; top: var(--space-2); left: var(--space-2);
  background: #EF4444; color: #fff;
  font-size: var(--text-xs); font-weight: 700;
  padding: 2px 8px; border-radius: var(--radius-xs);
}
.ws-flash-img {
  width: 100%; height: 140px;
  object-fit: cover;
  background: var(--color-bg);
}
.ws-flash-body { padding: var(--space-3); }
.ws-flash-name {
  font-size: var(--text-base); font-weight: 600;
  color: var(--color-text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.ws-flash-price-row { display: flex; align-items: baseline; gap: var(--space-2); margin-top: var(--space-2); }
.ws-flash-price { font-size: var(--text-xl); font-weight: 700; color: #EF4444; }
.ws-flash-orig-price { font-size: var(--text-xs); color: var(--color-text-muted); text-decoration: line-through; }
.ws-flash-meta { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }

/* L5 — Category */
.ws-cat-scroll {
  display: flex;
  gap: var(--space-2);
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: 2px;
}
.ws-cat-scroll::-webkit-scrollbar { display: none; }
.ws-cat-chip {
  flex-shrink: 0;
  padding: var(--space-1) var(--space-3);
  border-radius: var(--radius-full);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text-muted);
  background: #fff;
  border: 1px solid var(--color-border);
  cursor: pointer;
  transition: all .15s;
  white-space: nowrap;
}
.ws-cat-chip.active {
  background: var(--color-primary);
  color: #fff;
  border-color: var(--color-primary);
  font-weight: 600;
}

/* Product list */
.ws-list-header { padding: 0 var(--space-4); margin-bottom: var(--space-3); }
.ws-sort-row {
  display: flex; align-items: center; justify-content: space-between;
  margin-top: var(--space-3);
}
.ws-product-count { font-size: var(--text-xs); color: var(--color-text-muted); }
.ws-sort-select {
  font-size: var(--text-xs); color: var(--color-text-muted);
  border: none; outline: none; background: transparent;
  padding: 2px 0;
}
.ws-product-grid {
  padding: 0 var(--space-4);
  column-count: 2; column-gap: var(--space-3);
}
.ws-product-card {
  break-inside: avoid;
  background: #fff;
  border-radius: var(--radius-card);
  margin-bottom: var(--space-3);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .12s;
  overflow: hidden;
}
.ws-product-card:active { transform: scale(.98); }
.ws-product-img {
  width: 100%;
  aspect-ratio: 1 / 1;
  object-fit: cover;
  background: var(--color-bg);
}
.ws-product-body { padding: var(--space-2) var(--space-3) var(--space-3); }
.ws-product-name {
  font-size: var(--text-sm); font-weight: 600;
  color: var(--color-text);
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: var(--space-1);
}
.ws-product-merchant { font-size: var(--text-xs); color: var(--color-text-muted); margin-bottom: var(--space-1); }
.ws-product-price-row { display: flex; align-items: baseline; gap: var(--space-1); }
.ws-product-price { font-size: var(--text-base); font-weight: 700; color: var(--color-primary); }
.ws-product-price-label { font-size: var(--text-xs); color: var(--color-text-muted); }
.ws-product-moq { font-size: var(--text-xs); color: var(--color-text-muted); margin-top: 2px; }

/* Loading / Empty */
.ws-loading {
  display: flex; justify-content: center; align-items: center;
  padding: var(--space-10) 0;
}
.ws-empty {
  text-align: center;
  padding: var(--space-10) var(--space-4);
}
.ws-empty-icon { font-size: 48px; margin-bottom: var(--space-3); }
.ws-empty-text { font-size: var(--text-base); font-weight: 600; color: var(--color-text); margin-bottom: var(--space-1); }
.ws-empty-hint { font-size: var(--text-sm); color: var(--color-text-muted); }

/* Merchant detail page */
.ws-merchant-header {
  display: flex; align-items: center; gap: var(--space-3);
  padding: var(--space-3) 0;
  position: sticky; top: 0; z-index: 10;
  background: var(--color-bg);
  border-bottom: 1px solid var(--color-border);
}
.ws-back-btn {
  width: 36px; height: 36px;
  border-radius: 50%;
  border: none; background: #fff;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer; flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.ws-merchant-info { display: flex; align-items: center; gap: var(--space-2); }
.ws-merchant-detail-logo {
  width: 40px; height: 40px;
  border-radius: 50%;
  background: var(--color-bg-warm);
  display: flex; align-items: center; justify-content: center;
  font-size: 18px; font-weight: 700; color: var(--color-primary);
  flex-shrink: 0;
}
.ws-merchant-detail-name { font-size: var(--text-base); font-weight: 700; color: var(--color-text); }
.ws-merchant-detail-cats { font-size: var(--text-xs); color: var(--color-text-muted); }
.ws-merchant-chips {
  padding: var(--space-3) 0;
  overflow-x: auto;
  display: flex; gap: var(--space-2);
}
.ws-merchant-chips::-webkit-scrollbar { display: none; }


/* ========== Wholesale Password Modal ========== */

.modal-content--narrow {
  max-width: 340px;
}

.wholesale-pw-title {
  font-size: var(--text-lg);
  font-weight: 700;
  margin-bottom: 2px;
}

.wholesale-pw-hint {
  font-size: var(--text-sm);
  color: var(--color-text-muted);
  margin-bottom: var(--space-4);
}

.form-input--lg {
  font-size: var(--text-lg);
  padding: var(--space-3) 0;
  text-align: center;
  letter-spacing: 0.2em;
}

/* ========== Registration Form ========== */

.reg-card {
  width: 100%;
  max-width: var(--content-max);
  background: var(--color-surface);
  border-radius: var(--radius-xl) var(--radius-xl) 0 0;
  padding: var(--space-8) var(--space-5) var(--space-10);
  animation: slideUp .3s var(--ease-out);
  box-shadow: var(--shadow-lg);
  min-height: 100vh;
}
.reg-card-header {
  text-align: center;
  margin-bottom: var(--space-6);
}
.reg-card-header .sub-gate-icon { margin-bottom: var(--space-3); }
.reg-card-header .sub-gate-title { margin-bottom: var(--space-2); }
.reg-card-header .sub-gate-desc { margin-bottom: 0; }

.reg-form { display: flex; flex-direction: column; gap: var(--space-4); }
.reg-field { display: flex; flex-direction: column; gap: var(--space-1); }
.reg-label {
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--color-text);
}
.reg-required { color: #EF4444; }
.reg-hint { font-weight: 400; color: var(--color-text-muted); font-size: var(--text-xs); }
.reg-input {
  width: 100%;
  padding: var(--space-3) 0;
  border: 1.5px solid var(--color-border-light);
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  color: var(--color-text);
  background: var(--color-surface);
  outline: none;
  transition: border-color var(--duration-fast);
  box-sizing: border-box;
}
.reg-input:focus { border-color: var(--color-primary); }

.reg-radio-group {
  display: flex;
  gap: var(--space-3);
}
.reg-radio {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--space-2);
  padding: var(--space-3) 0;
  border: 1.5px solid var(--color-border-light);
  border-radius: var(--radius-md);
  font-size: var(--text-sm);
  font-weight: 500;
  color: var(--color-text);
  cursor: pointer;
  transition: all var(--duration-fast);
}
.reg-radio:has(input:checked) {
  border-color: var(--color-primary);
  background: var(--color-primary-soft);
  color: var(--color-primary);
}
.reg-radio input { display: none; }

.reg-community-fields {
  padding: var(--space-4);
  background: var(--color-surface-secondary);
  border-radius: var(--radius-md);
  display: flex;
  flex-direction: column;
  gap: var(--space-3);
}

.reg-submit-btn {
  width: 100%;
  padding: var(--space-4);
  background: var(--color-primary);
  color: #fff;
  border: none;
  border-radius: var(--radius-md);
  font-size: var(--text-base);
  font-weight: 600;
  cursor: pointer;
  transition: background var(--duration-fast);
  margin-top: var(--space-2);
}
.reg-submit-btn:active { background: var(--color-primary-hover); }
.reg-submit-btn:disabled { opacity: .5; cursor: not-allowed; }
.reg-notice {
  text-align: center;
  font-size: var(--text-xs);
  color: var(--color-text-muted);
  margin-top: var(--space-2);
}

/* ── 荣誉徽章体系 ──────────────────────────────────── */

/* 贡献身份段位徽章 */
.profile-contrib-level {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2px 10px;
  border-radius: 999px;
  font-size: 0.6875rem;
  font-weight: 600;
  margin-top: 4px;
  border-left: 2px solid transparent;
}
.level-c0 { background: #F8FAFC; color: #94A3B8; border-left-color: #94A3B8; }
.level-c1 { background: #EFF6FF; color: #2563EB; border-left-color: #2563EB; }
.level-c2 { background: #F0FDF4; color: #059669; border-left-color: #059669; }
.level-c3 { background: #FAF5FF; color: #7C3AED; border-left-color: #7C3AED; }
.level-c4 { background: #FFFBEB; color: #B45309; border-left-color: #B45309; }

/* 徽章行 */
.badge-row {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 8px 0 0 0;
  flex-wrap: wrap;
}
.badge-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  font-size: 0.625rem;
  font-weight: 700;
  color: #fff;
  cursor: pointer;
  transition: transform .15s;
}
.badge-icon:active { transform: scale(.92); }
.badge-icon--common { background: #94A3B8; }
.badge-icon--rare { background: #3B82F6; }
.badge-icon--epic { background: #7C3AED; }
.badge-icon--legendary { background: linear-gradient(135deg, #F59E0B, #EA580C); }
.badge-more {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px; height: 28px;
  border-radius: 8px;
  font-size: 0.625rem;
  font-weight: 600;
  background: #F1F5F9;
  color: #64748B;
}
.badge-wall-link {
  font-size: 0.6875rem;
  color: var(--color-primary);
  text-decoration: none;
  margin-left: auto;
  white-space: nowrap;
}

/* 徽章墙弹窗 */
.badge-wall-overlay {
  position: fixed; z-index: 1000; inset: 0;
  background: rgba(0,0,0,.35);
  display: flex; align-items: flex-end; justify-content: center;
}
.badge-wall-panel {
  width: 100%; max-width: 480px; max-height: 75vh;
  background: #fff; border-radius: 16px 16px 0 0;
  overflow-y: auto; padding: 20px 16px;
}
.badge-wall-header {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 16px;
}
.badge-wall-header h3 { font-size: 1rem; font-weight: 700; }
.badge-wall-close {
  width: 32px; height: 32px; border-radius: 50%; border: none;
  background: #F1F5F9; font-size: 1rem; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
}
.badge-wall-section { margin-bottom: 16px; }
.badge-wall-section-title {
  font-size: 0.75rem; font-weight: 700; color: #64748B;
  text-transform: uppercase; letter-spacing: 0.05em; margin-bottom: 8px;
}
.badge-wall-grid {
  display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px;
}
.badge-wall-item {
  display: flex; flex-direction: column; align-items: center;
  padding: 12px 6px; border-radius: 12px; background: #F8FAFC;
}
.badge-wall-item--earned { background: #FFF; box-shadow: 0 1px 3px rgba(0,0,0,.06); }
.badge-wall-item--locked { opacity: .35; filter: grayscale(1); }
.badge-wall-item-icon {
  width: 40px; height: 40px; border-radius: 12px;
  display: flex; align-items: center; justify-content: center;
  font-size: 1.25rem; margin-bottom: 6px;
}
.badge-wall-item-name {
  font-size: 0.625rem; font-weight: 600; text-align: center;
  color: #334155; line-height: 1.2;
}
.badge-wall-item-date {
  font-size: 0.5625rem; color: #94A3B8; margin-top: 2px;
}

/* ── 宝藏掉落弹窗 ─────────────────────────────── */
.treasure-overlay {
  position: fixed; inset: 0; z-index: 9999;
  background: rgba(0,0,0,.75);
  display: flex; align-items: center; justify-content: center;
  animation: treasureFadeIn .3s ease;
}
@keyframes treasureFadeIn { from { opacity: 0; } to { opacity: 1; } }
.treasure-modal {
  position: relative; background: #fff; border-radius: 20px;
  padding: 32px 24px 24px; text-align: center; width: 280px;
  box-shadow: 0 20px 60px rgba(0,0,0,.3);
  animation: treasurePop .5s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes treasurePop {
  from { transform: scale(.5); opacity: 0; }
  to { transform: scale(1); opacity: 1; }
}
.treasure-glow {
  position: absolute; top: -40px; left: 50%; transform: translateX(-50%);
  width: 120px; height: 120px; border-radius: 50%;
  opacity: .3; pointer-events: none;
}
.treasure-modal.rarity-common .treasure-glow { background: #94A3B8; }
.treasure-modal.rarity-rare .treasure-glow { background: #3B82F6; }
.treasure-modal.rarity-epic .treasure-glow { background: #8B5CF6; }
.treasure-modal.rarity-legendary .treasure-glow { background: #F59E0B; }
.treasure-rarity {
  font-size: .75rem; font-weight: 700; text-transform: uppercase;
  letter-spacing: .1em; margin-bottom: 8px;
}
.rarity-common .treasure-rarity { color: #94A3B8; }
.rarity-rare .treasure-rarity { color: #3B82F6; }
.rarity-epic .treasure-rarity { color: #8B5CF6; }
.rarity-legendary .treasure-rarity { color: #F59E0B; }
.treasure-icon { font-size: 3rem; margin: 8px 0; }
.treasure-name {
  font-size: 1.125rem; font-weight: 700; color: #1C1917; margin-bottom: 4px;
}
.treasure-reward { font-size: .875rem; color: #78716C; margin-bottom: 20px; }
.treasure-close {
  background: linear-gradient(135deg, #F97316, #EA580C);
  color: #fff; border: none; border-radius: 12px;
  padding: 12px 32px; font-size: 1rem; font-weight: 600;
  cursor: pointer; width: 100%;
}
.treasure-close:active { opacity: .85; }
