/* ============================================================
 * mall-theme.css — 统一商城设计语言 (v82 Taobao-inspired)
 * 六端共享：rental-app-multi / hardware-mall / ad-supply-mall
 * / ad-order / task-hall / technician
 * 用法：<link rel="stylesheet" href="mall-theme.css"> + 加皮肤 class
 * ============================================================ */

/* ====== 全局 CSS 变量 ====== */
:root {
  --mall-price: #FF4400;            /* 统一价格红（淘宝红） */
  --mall-price-bg: #FFF4F0;
  --mall-bg: #f5f5f5;
  --mall-card-bg: #ffffff;
  --mall-text: #333333;
  --mall-text-sub: #999999;
  --mall-text-hint: #cccccc;
  --mall-border: #eeeeee;
  --mall-radius: 12px;
  --mall-radius-sm: 8px;
  --mall-shadow: 0 1px 8px rgba(0,0,0,0.06);
  --mall-shadow-hover: 0 4px 16px rgba(0,0,0,0.12);
  /* [NAV-UNIFY-20261117] 底部导航统一高 56px（预留 4px 余量给 body 留白） */
  --mall-tabbar-h: 60px;

  /* 皮肤色变量（各商城可覆盖） */
  --skin-primary: #7C5CFC;
  --skin-gradient: linear-gradient(135deg, #7C5CFC 0%, #9B7BFF 100%);
  --skin-bg-light: #F3EFFF;
  --skin-text: #7C5CFC;
}

/* ====== 六端皮肤 ====== */
.mall-skin-rental   { --skin-primary: #FF6B35; --skin-gradient: linear-gradient(135deg,#FF6B35 0%,#FF8F5E 100%); --skin-bg-light: #FFF3ED; --skin-text: #FF6B35; }
.mall-skin-ad       { --skin-primary: #EF9F27; --skin-gradient: linear-gradient(135deg,#EF9F27 0%,#FFB85C 100%); --skin-bg-light: #FFF8EB; --skin-text: #EF9F27; }
.mall-skin-hardware { --skin-primary: #2D8CFF; --skin-gradient: linear-gradient(135deg,#2D8CFF 0%,#5BAAFF 100%); --skin-bg-light: #EBF5FF; --skin-text: #2D8CFF; }
.mall-skin-adsupply { --skin-primary: #EF9F27; --skin-gradient: linear-gradient(135deg,#EF9F27 0%,#FFB85C 100%); --skin-bg-light: #FFF8EB; --skin-text: #EF9F27; }
.mall-skin-task     { --skin-primary: #667eea; --skin-gradient: linear-gradient(135deg,#667eea 0%,#764ba2 100%); --skin-bg-light: #F0F0FF; --skin-text: #667eea; }
.mall-skin-tech     { --skin-primary: #2BB673; --skin-gradient: linear-gradient(135deg,#2BB673 0%,#4ECF8A 100%); --skin-bg-light: #E8FFF5; --skin-text: #2BB673; }

/* ====== 组件类：商品卡片 mall-card ====== */
.mall-card {
  background: var(--mall-card-bg);
  border-radius: var(--mall-radius);
  overflow: hidden;
  box-shadow: var(--mall-shadow);
  transition: transform 0.15s, box-shadow 0.15s;
  cursor: pointer;
}
.mall-card:active { transform: scale(0.97); }
.mall-card-img {
  width: 100%;
  aspect-ratio: 1;
  object-fit: cover;
  display: block;
  background: var(--mall-bg);
}
.mall-card-body { padding: 8px 10px 10px; }
.mall-card-title {
  font-size: 13px;
  color: var(--mall-text);
  line-height: 1.35;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-bottom: 6px;
}
.mall-card-price {
  font-size: 17px;
  font-weight: 700;
  color: var(--mall-price);
  line-height: 1;
  display: flex;
  align-items: baseline;
  gap: 2px;
}
.mall-card-price .cur { font-size: 12px; }
.mall-card-price .unit { font-size: 11px; color: var(--mall-text-sub); font-weight: 400; margin-left: 2px; }
.mall-card-price .original {
  font-size: 11px; color: var(--mall-text-sub);
  text-decoration: line-through; margin-left: 4px; font-weight: 400;
}
.mall-card-tag {
  display: inline-block;
  padding: 1px 6px;
  border-radius: 3px;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: var(--skin-gradient);
  margin-bottom: 4px;
}

/* ====== 组件类：分类标签条 mall-chips ====== */
.mall-chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  -webkit-overflow-scrolling: touch;
  padding: 10px 12px;
  scrollbar-width: none;
}
.mall-chips::-webkit-scrollbar { display: none; }
.mall-chip {
  flex-shrink: 0;
  padding: 5px 14px;
  border-radius: 16px;
  font-size: 13px;
  background: var(--mall-card-bg);
  color: var(--mall-text);
  border: 1px solid var(--mall-border);
  white-space: nowrap;
  cursor: pointer;
  transition: all 0.15s;
}
.mall-chip.active {
  background: var(--skin-gradient);
  color: #fff;
  border-color: transparent;
  font-weight: 600;
}

/* ====== 组件类：搜索栏 mall-search ====== */
.mall-search {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 12px;
  background: var(--mall-bg);
}
.mall-search-wrap {
  position: relative;
  flex: 1;
}
.mall-search-wrap::before {
  content: '🔍';
  position: absolute;
  left: 12px;
  top: 50%;
  transform: translateY(-50%);
  font-size: 14px;
  pointer-events: none;
}
.mall-search-input {
  width: 100%;
  height: 34px;
  border-radius: 17px;
  border: 1px solid var(--mall-border);
  background: var(--mall-card-bg);
  padding: 0 16px 0 36px;
  font-size: 13px;
  outline: none;
  transition: border-color 0.2s;
}
.mall-search-input:focus { border-color: var(--skin-primary); }

/* ====== 组件类：空状态 mall-empty ====== */
.mall-empty {
  text-align: center;
  padding: 48px 24px;
}
.mall-empty-icon { font-size: 48px; margin-bottom: 12px; opacity: 0.5; }
.mall-empty-title { font-size: 15px; color: var(--mall-text); font-weight: 600; margin-bottom: 6px; }
.mall-empty-desc { font-size: 13px; color: var(--mall-text-sub); margin-bottom: 16px; }
.mall-empty-btn {
  display: inline-block;
  padding: 8px 24px;
  border-radius: 20px;
  background: var(--skin-gradient);
  color: #fff;
  font-size: 13px;
  border: none;
  cursor: pointer;
  font-weight: 600;
}

/* ====== 组件类：任务卡片 mall-task-card ====== */
.mall-task-card {
  background: var(--mall-card-bg);
  border-radius: var(--mall-radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--mall-shadow);
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.mall-task-card:active { box-shadow: var(--mall-shadow-hover); }
.mall-task-card-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 8px;
}
.mall-task-card-title { font-size: 15px; font-weight: 600; color: var(--mall-text); }
.mall-task-card-price { font-size: 16px; font-weight: 700; color: var(--mall-price); }
.mall-task-card-meta { display: flex; gap: 12px; font-size: 12px; color: var(--mall-text-sub); margin-top: 6px; }
.mall-task-card-status {
  display: inline-block;
  padding: 2px 10px;
  border-radius: 4px;
  font-size: 11px;
  font-weight: 600;
}

/* ====== 组件类：师傅卡片 mall-tech-card ====== */
.mall-tech-card {
  background: var(--mall-card-bg);
  border-radius: var(--mall-radius);
  padding: 14px;
  margin-bottom: 10px;
  box-shadow: var(--mall-shadow);
  display: flex;
  gap: 12px;
  align-items: center;
  cursor: pointer;
  transition: box-shadow 0.15s;
}
.mall-tech-card:active { box-shadow: var(--mall-shadow-hover); }
.mall-tech-avatar {
  width: 48px;
  height: 48px;
  border-radius: 50%;
  background: var(--skin-bg-light);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  flex-shrink: 0;
}
.mall-tech-info { flex: 1; min-width: 0; }
.mall-tech-name { font-size: 15px; font-weight: 600; color: var(--mall-text); }
.mall-tech-meta { font-size: 12px; color: var(--mall-text-sub); margin-top: 2px; }
.mall-tech-stats { display: flex; gap: 10px; margin-top: 4px; }
.mall-tech-stat { font-size: 11px; color: var(--mall-text-sub); }
.mall-tech-stat b { color: var(--skin-text); font-size: 13px; }

/* ====== 统一 Tabbar (mall-core.js 渲染) ====== */
/* [NAV-UNIFY-20261117] 与主壳 / 云打印 / 找师傅同一套规格：白底、#EEF0F4 上边框、无投影。 */
#mallTabbar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  max-width: 430px;
  margin: 0 auto;
  background: #fff;
  display: flex;
  border-top: 1px solid #EEF0F4;
  z-index: 9998;
  padding-bottom: env(safe-area-inset-bottom);
  height: calc(60px + env(safe-area-inset-bottom, 0px));
  box-sizing: border-box;
}
.mall-tab-item {
  flex: 1;
  text-align: center;
  padding: 6px 0 8px;
  cursor: pointer;
  position: relative;
  transition: color 0.15s;
}
.mall-tab-icon { font-size: 20px; line-height: 1; height: 24px; display: flex; align-items: center; justify-content: center; }
/* [UX-20261117] 与主壳 .tabbar-item .ico svg 同一套规格（22px / stroke-width 2 / 线性），
   这样从首页切到任务大厅，底部导航不会突然从线框变成彩色 emoji。 */
.mall-tab-icon svg { width: 22px; height: 22px; fill: none; stroke: #8A8F9C; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.mall-tab-item.active .mall-tab-icon svg { stroke: var(--skin-primary, #4C6FFF); }
.mall-tab-label { font-size: 10px; margin-top: 2px; color: var(--mall-text-sub); }
.mall-tab-item.active .mall-tab-label { color: var(--skin-primary); font-weight: 600; }
.mall-tab-item.active .mall-tab-icon { transform: scale(1.1); }
.mall-tab-badge {
  position: absolute;
  top: 2px;
  right: calc(50% - 18px);
  min-width: 16px;
  height: 16px;
  line-height: 16px;
  border-radius: 8px;
  background: var(--mall-price);
  color: #fff;
  font-size: 10px;
  font-weight: 600;
  text-align: center;
  padding: 0 4px;
  display: none;
}

/* ====== 商城切换浮层 ====== */
#mallSwitcher {
  position: fixed;
  top: 0; left: 0; right: 0; bottom: 0;
  background: rgba(0,0,0,0.4);
  z-index: 9999;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: mallFadeIn 0.2s ease;
}
#mallSwitcher-sheet {
  background: #fff;
  width: 100%;
  max-width: 430px;
  border-radius: 16px 16px 0 0;
  padding: 20px 16px calc(20px + env(safe-area-inset-bottom));
  animation: mallSlideUp 0.25s ease;
}
.mall-switcher-title {
  text-align: center;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 16px;
  color: var(--mall-text);
}
.mall-switcher-grid {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.mall-switcher-item {
  text-align: center;
  cursor: pointer;
}
.mall-switcher-icon {
  width: 48px;
  height: 48px;
  border-radius: 12px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 22px;
  margin: 0 auto 6px;
}
.mall-switcher-name {
  font-size: 11px;
  color: var(--mall-text-sub);
}

/* ====== 师傅端面包屑 ====== */
#techBreadcrumb {
  position: sticky;
  top: 0;
  background: #fff;
  border-bottom: 1px solid var(--mall-border);
  padding: 8px 12px;
  display: flex;
  align-items: center;
  gap: 8px;
  z-index: 100;
  box-shadow: 0 1px 4px rgba(0,0,0,0.04);
}
.tech-crumb-back {
  cursor: pointer;
  font-size: 14px;
  color: var(--mall-text-sub);
}
.tech-crumb-title {
  font-size: 14px;
  font-weight: 600;
  color: var(--skin-text);
}
.tech-crumb-profile {
  cursor: pointer;
  font-size: 13px;
  color: var(--mall-text-sub);
}

/* ====== 动画 ====== */
@keyframes mallFadeIn { from { opacity: 0; } to { opacity: 1; } }
@keyframes mallSlideUp { from { transform: translateY(100%); } to { transform: translateY(0); } }

/* ====== 兼容：v83+ 替换旧 tabbar 时用此规则 ====== */
body.mall-replace-tabbar .tabbar:not(#mallTabbar),
body.mall-replace-tabbar .bottom-nav:not(#mallTabbar),
body.mall-replace-tabbar .tb-bar:not(#mallTabbar) {
  display: none !important;
}
