/* 护肤分销商城 · C端样式（移动优先） */
:root {
  --primary: #e86f8f;
  --primary-light: #fdf0f4;
  --bg: #f6f7f9;
  --card: #ffffff;
  --text: #2b2f36;
  --text-2: #8a9099;
  --line: #eceef1;
  --red: #e64340;
  --green: #0fa66b;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  background: var(--bg); color: var(--text); font-size: 14px; line-height: 1.6;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
button { font-family: inherit; cursor: pointer; border: none; background: none; }
input, textarea, select { font-family: inherit; font-size: 14px; outline: none; }

.page { max-width: 480px; margin: 0 auto; min-height: 100vh; background: var(--bg); padding-bottom: 64px; }

/* 顶部 */
.topbar {
  position: sticky; top: 0; z-index: 50; background: #fff; border-bottom: 1px solid var(--line);
  display: flex; align-items: center; gap: 10px; padding: 10px 14px;
}
.topbar .logo { font-size: 17px; font-weight: 700; color: var(--primary); white-space: nowrap; }
.topbar .search {
  flex: 1; display: flex; align-items: center; background: var(--bg); border-radius: 999px; padding: 7px 12px; gap: 6px;
}
.topbar .search input { flex: 1; border: none; background: none; font-size: 13px; }
.topbar .search .icon { color: var(--text-2); }
.topbar .cart-entry { position: relative; font-size: 20px; padding: 0 4px; }
.topbar .badge {
  position: absolute; top: -4px; right: -6px; background: var(--red); color: #fff; font-size: 10px;
  min-width: 16px; height: 16px; border-radius: 8px; display: flex; align-items: center; justify-content: center; padding: 0 4px;
}

/* 轮播 */
.banner { position: relative; overflow: hidden; margin: 12px; border-radius: 12px; }
.banner-track { display: flex; transition: transform .4s ease; }
.banner-slide {
  min-width: 100%; height: 150px; border-radius: 12px; position: relative; overflow: hidden;
  display: flex; flex-direction: column; justify-content: center; padding: 0 22px;
}
.banner-slide h3 { font-size: 20px; color: #333; }
.banner-slide p { font-size: 13px; color: #666; margin-top: 4px; }
.banner-slide .go { margin-top: 10px; font-size: 14px; font-weight: 600; }
.banner-slide img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.banner-dots { position: absolute; bottom: 8px; left: 50%; transform: translateX(-50%); display: flex; gap: 5px; }
.banner-dots i { width: 6px; height: 6px; border-radius: 50%; background: rgba(0,0,0,.18); }
.banner-dots i.on { background: var(--primary); width: 14px; border-radius: 3px; }

/* 分类与商品 */
.section { margin: 12px; }
.section-title { display: flex; align-items: center; justify-content: space-between; margin-bottom: 10px; }
.section-title h2 { font-size: 16px; }
.section-title .more { font-size: 12px; color: var(--text-2); }
.cat-row { display: flex; gap: 8px; overflow-x: auto; padding-bottom: 4px; scrollbar-width: none; }
.cat-row::-webkit-scrollbar { display: none; }
.cat-chip {
  flex-shrink: 0; padding: 6px 14px; border-radius: 999px; background: #fff; border: 1px solid var(--line);
  font-size: 13px; color: var(--text-2);
}
.cat-chip.on { background: var(--primary); border-color: var(--primary); color: #fff; }
.goods-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.goods-card { background: var(--card); border-radius: 12px; overflow: hidden; }
.goods-card .thumb { width: 100%; aspect-ratio: 1/1; object-fit: cover; background: #f2f3f5; }
.goods-card .info { padding: 8px 10px 12px; }
.goods-card .name { font-size: 13px; font-weight: 500; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; min-height: 40px; }
.goods-card .price { color: var(--red); font-weight: 700; font-size: 16px; margin-top: 6px; }
.goods-card .price small { font-size: 11px; font-weight: 400; }
.goods-card .sales { font-size: 11px; color: var(--text-2); margin-top: 2px; }
.empty { text-align: center; color: var(--text-2); padding: 40px 0; font-size: 13px; }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  background: #fff; border-top: 1px solid var(--line); display: flex; z-index: 60; padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a { flex: 1; text-align: center; padding: 8px 0 6px; font-size: 11px; color: var(--text-2); }
.tabbar a .ico { font-size: 21px; display: block; margin-bottom: 1px; }
.tabbar a.on { color: var(--primary); }

/* 商品详情 */
.detail-gallery { position: relative; background: #fff; }
.detail-gallery .main-img { width: 100%; aspect-ratio: 1/1; object-fit: cover; }
.detail-gallery .thumbs { display: flex; gap: 8px; padding: 10px 12px; overflow-x: auto; }
.detail-gallery .thumbs img { width: 56px; height: 56px; border-radius: 8px; object-fit: cover; border: 2px solid transparent; flex-shrink: 0; }
.detail-gallery .thumbs img.on { border-color: var(--primary); }
.detail-block { background: #fff; border-radius: 12px; margin: 12px; padding: 14px; }
.detail-block h1 { font-size: 17px; line-height: 1.4; }
.detail-price { color: var(--red); font-size: 24px; font-weight: 700; margin-top: 8px; }
.detail-price small { font-size: 13px; font-weight: 400; }
.detail-meta { display: flex; gap: 14px; color: var(--text-2); font-size: 12px; margin-top: 8px; }
.detail-rich { font-size: 14px; }
.detail-rich img { max-width: 100%; border-radius: 8px; margin: 8px 0; }
.detail-rich p { margin: 6px 0; }
.qual-tag {
  display: inline-block; background: var(--primary-light); color: var(--primary); font-size: 12px;
  padding: 4px 10px; border-radius: 6px; margin-top: 8px;
}
.action-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  background: #fff; border-top: 1px solid var(--line); display: flex; gap: 10px; padding: 10px 12px calc(10px + env(safe-area-inset-bottom)); z-index: 60;
}
.btn { flex: 1; height: 44px; border-radius: 22px; font-size: 15px; font-weight: 600; display: flex; align-items: center; justify-content: center; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-ghost { background: var(--primary-light); color: var(--primary); }
.btn[disabled] { opacity: .5; pointer-events: none; }

/* 表单与通用块 */
.form-block { background: #fff; border-radius: 12px; margin: 12px; padding: 14px; }
.form-block h2 { font-size: 16px; margin-bottom: 12px; }
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 5px; }
.field input, .field textarea, .field select {
  width: 100%; border: 1px solid var(--line); border-radius: 8px; padding: 10px 12px; font-size: 14px; background: #fff;
}
.field input:focus, .field textarea:focus { border-color: var(--primary); }
.field textarea { min-height: 90px; resize: vertical; }
.field .err { color: var(--red); font-size: 12px; margin-top: 4px; min-height: 16px; }
.btn-full { width: 100%; height: 46px; border-radius: 10px; background: var(--primary); color: #fff; font-size: 15px; font-weight: 600; }
.btn-block { width: 100%; height: 46px; border-radius: 10px; background: #fff; border: 1px solid var(--primary); color: var(--primary); font-size: 15px; font-weight: 600; }

/* 订单 */
.order-card { background: #fff; border-radius: 12px; margin: 12px; padding: 14px; }
.order-card .head { display: flex; justify-content: space-between; font-size: 12px; color: var(--text-2); }
.order-card .head .status { color: var(--primary); font-weight: 600; }
.order-item { display: flex; gap: 10px; padding: 10px 0; border-bottom: 1px solid var(--line); }
.order-item img { width: 60px; height: 60px; border-radius: 8px; object-fit: cover; }
.order-item .grow { flex: 1; }
.order-item .grow .name { font-size: 13px; font-weight: 500; }
.order-item .grow .spec { font-size: 12px; color: var(--text-2); margin-top: 2px; }
.order-item .grow .price { font-size: 13px; color: var(--red); margin-top: 4px; }
.order-foot { display: flex; justify-content: space-between; align-items: center; padding-top: 10px; font-size: 13px; }
.order-foot .amount { font-weight: 700; }
.order-foot .amount b { color: var(--red); }
.mini-btn { height: 30px; padding: 0 14px; border-radius: 15px; font-size: 12px; border: 1px solid var(--line); color: var(--text-2); margin-left: 8px; }
.mini-btn.primary { background: var(--primary); border-color: var(--primary); color: #fff; }

/* 分销工作台 */
.dis-hero { background: linear-gradient(135deg, var(--primary), #f0a8bf); color: #fff; padding: 22px 16px 26px; }
.dis-hero .uid { font-size: 13px; opacity: .92; }
.dis-hero .role { display: inline-block; background: rgba(255,255,255,.22); border-radius: 999px; padding: 3px 12px; font-size: 12px; margin-top: 8px; }
.stat-row { display: flex; background: #fff; border-radius: 12px; margin: -14px 12px 12px; padding: 14px 0; box-shadow: 0 4px 14px rgba(0,0,0,.05); }
.stat-row .cell { flex: 1; text-align: center; }
.stat-row .cell b { font-size: 18px; display: block; }
.stat-row .cell span { font-size: 11px; color: var(--text-2); }
.share-box { background: #fff; border-radius: 12px; margin: 12px; padding: 14px; }
.share-box .link {
  background: var(--bg); border-radius: 8px; padding: 10px 12px; font-size: 12px; color: var(--text-2);
  word-break: break-all; margin: 8px 0 12px;
}
.member-row { display: flex; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); font-size: 13px; }
.member-row:last-child { border-bottom: none; }
.member-row .sub { font-size: 11px; color: var(--text-2); }
.tag { display: inline-block; font-size: 11px; padding: 1px 8px; border-radius: 4px; background: var(--primary-light); color: var(--primary); }
.tag.gray { background: var(--bg); color: var(--text-2); }

/* 个人中心 */
.me-header { background: #fff; padding: 22px 16px; display: flex; align-items: center; gap: 14px; }
.avatar {
  width: 56px; height: 56px; border-radius: 50%; background: var(--primary-light); color: var(--primary);
  display: flex; align-items: center; justify-content: center; font-size: 20px; font-weight: 700;
}
.me-header .name { font-size: 17px; font-weight: 600; }
.me-header .sub { font-size: 12px; color: var(--text-2); margin-top: 3px; }
.me-list { background: #fff; border-radius: 12px; margin: 12px; }
.me-list a { display: flex; align-items: center; justify-content: space-between; padding: 14px; border-bottom: 1px solid var(--line); font-size: 14px; }
.me-list a:last-child { border-bottom: none; }
.me-list a .arrow { color: #c8ccd2; }
.disclaimer { text-align: center; font-size: 11px; color: var(--text-2); padding: 18px 20px 24px; line-height: 1.7; }

/* 购物车结算 */
.cart-item { display: flex; gap: 10px; background: #fff; border-radius: 12px; margin: 12px; padding: 12px; align-items: center; }
.cart-item img { width: 72px; height: 72px; border-radius: 8px; object-fit: cover; }
.cart-item .grow { flex: 1; }
.cart-item .name { font-size: 13px; font-weight: 500; }
.cart-item .spec { font-size: 12px; color: var(--text-2); margin: 2px 0; }
.cart-item .price { color: var(--red); font-weight: 700; }
.qty { display: inline-flex; align-items: center; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.qty button { width: 28px; height: 26px; font-size: 15px; color: var(--text-2); background: #fafbfc; }
.qty span { min-width: 30px; text-align: center; font-size: 13px; }
.total-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%); width: 100%; max-width: 480px;
  background: #fff; border-top: 1px solid var(--line); display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); z-index: 60; font-size: 14px;
}
.total-bar .sum b { color: var(--red); font-size: 18px; }
.total-bar .btn { flex: none; width: 130px; height: 42px; }
