/* ===== 小财迷装备交易平台 H5 样式 ===== */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f2f3f7; color: #333; font-size: 15px;
  max-width: 750px; margin: 0 auto; padding-bottom: 66px;
}
a { color: inherit; text-decoration: none; }
img { max-width: 100%; display: block; }

.topbar {
  position: sticky; top: 0; z-index: 20;
  background: linear-gradient(135deg, #ff7d26, #ff9f43);
  color: #fff; padding: 14px 16px; font-size: 17px; font-weight: 600;
  box-shadow: 0 2px 6px rgba(0,0,0,.08);
}
.topbar .back { float: left; margin-right: 10px; font-weight: 400; }
.topbar .back-home { float: right; font-size: 13px; font-weight: 400; color: #fff; background: rgba(255,255,255,.22); border-radius: 12px; padding: 3px 10px; }
.wrap { padding: 12px; }

/* 提示 */
.flash { background: #e8f7ee; color: #1e8e4e; border: 1px solid #bce6cd; border-radius: 8px; padding: 10px 12px; margin-bottom: 12px; font-size: 14px; }
.flash.err { background: #fdeeee; color: #c0392b; border-color: #f2c4c4; }

/* 底部导航 */
.tabbar {
  position: fixed; bottom: 0; z-index: 30;
  left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 750px;
  display: flex; background: #fff;
  border-top: 1px solid #e8e8e8;
  padding: 5px 0 env(safe-area-inset-bottom);
}
.tabbar a { flex: 1; text-align: center; color: #999; font-size: 12px; padding: 4px 0; }
.tabbar a.active { color: #ff7d26; font-weight: 600; }
.tabbar .ico { display: block; font-size: 22px; line-height: 1.2; }

/* 卡片 & 列表 */
.card { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 12px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.card h3 { font-size: 15px; margin-bottom: 10px; color: #333; }
.list-item { background: #fff; border-radius: 12px; padding: 13px 14px; margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }

.menu { background: #fff; border-radius: 12px; overflow: hidden; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.menu a, .menu .menu-row { display: flex; justify-content: space-between; align-items: center; padding: 14px 16px; border-bottom: 1px solid #f2f2f2; }
.menu a:last-child, .menu .menu-row:last-child { border-bottom: none; }
.menu a:active { background: #fafafa; }
.menu .arrow { color: #ccc; }

/* 表单 */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 14px; color: #666; margin-bottom: 6px; }
.field input[type=text], .field input[type=tel], .field input[type=password],
.field input[type=number], .field input[type=file], .field select, .field textarea {
  width: 100%; border: 1px solid #e0e0e0; border-radius: 8px;
  padding: 10px 12px; font-size: 15px; background: #fafafa; outline: none;
}
.field input:focus, .field select:focus { border-color: #ff9f43; background: #fff; }
.field input[readonly] { color: #999; }
.field .hint { font-size: 12px; color: #aaa; margin-top: 4px; }

.btn {
  display: block; width: 100%; text-align: center; border: none; cursor: pointer;
  background: linear-gradient(135deg, #ff7d26, #ff9f43); color: #fff;
  border-radius: 10px; padding: 12px; font-size: 16px; font-weight: 600;
}
.btn:active { opacity: .85; }
.btn.ghost { background: #fff; color: #ff7d26; border: 1px solid #ff9f43; }
.btn.gray { background: #e5e5e5; color: #666; }
.btn.sm { display: inline-block; width: auto; padding: 6px 14px; font-size: 13px; border-radius: 6px; font-weight: 400; }
.btn.danger { background: #e74c3c; }
.btn-row { display: flex; gap: 8px; margin-top: 12px; }
.link-row { text-align: center; margin-top: 14px; font-size: 14px; }
.link-row a { color: #ff7d26; }

/* 首页横幅 */
.banner { border-radius: 12px; overflow: hidden; margin-bottom: 12px; }
.banner img { width: 100%; height: 150px; object-fit: cover; }

/* 分类标签 */
.tabs { display: flex; background: #fff; border-radius: 10px; margin-bottom: 12px; padding: 4px; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.tabs a { flex: 1; text-align: center; padding: 8px 0; border-radius: 8px; color: #666; font-size: 14px; }
.tabs a.active { background: linear-gradient(135deg, #ff7d26, #ff9f43); color: #fff; font-weight: 600; }

/* 商品列表 */
.goods-item { display: block; background: #fff; border-radius: 12px; padding: 12px 14px; margin-bottom: 10px; box-shadow: 0 1px 4px rgba(0,0,0,.04); overflow: hidden; }
.goods-item:active { background: #fafafa; }
.goods-item .gi-title { display: block; font-size: 15px; font-weight: 600; margin-bottom: 6px; line-height: 1.4; word-break: break-all; }
.goods-item .gi-meta { display: flex; justify-content: space-between; align-items: center; flex-wrap: wrap; gap: 4px 10px; font-size: 12px; color: #999; }
.goods-item .gi-meta > span { display: inline-block; max-width: 100%; }
.goods-item .gi-meta .nowrap { white-space: nowrap; }
.goods-item .gi-price { color: #e74c3c; font-weight: 600; font-size: 14px; }
.thumb-row { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
.thumb-row img { width: 52px; height: 52px; object-fit: cover; border-radius: 6px; }

/* 状态徽标 */
.badge { display: inline-block; font-size: 12px; border-radius: 4px; padding: 2px 8px; }
.badge.warn { background: #fff5e6; color: #e67e22; }
.badge.ok { background: #e8f7ee; color: #1e8e4e; }
.badge.bad { background: #fdeeee; color: #c0392b; }

/* 详情页 */
.detail-imgs { display: grid; grid-template-columns: repeat(3, 1fr); gap: 6px; }
.detail-imgs img { width: 100%; height: 110px; object-fit: cover; border-radius: 8px; }

/* 详情页图片相册：大图 + 缩略图 */
.gallery-main img { width: 100%; max-height: 360px; object-fit: contain; background: #000; border-radius: 10px; cursor: zoom-in; }
.gallery-thumbs { display: flex; gap: 8px; margin-top: 10px; overflow-x: auto; padding-bottom: 4px; }
.gallery-thumbs img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; border: 2px solid transparent; flex-shrink: 0; opacity: .7; }
.gallery-thumbs img.on { border-color: #ff7d26; opacity: 1; }
.kv { display: flex; padding: 8px 0; border-bottom: 1px dashed #f0f0f0; font-size: 14px; }
.kv:last-child { border-bottom: none; }
.kv .k { width: 90px; color: #999; flex-shrink: 0; }

/* 用户信息卡 */
.user-card { display: flex; align-items: center; gap: 12px; }
.avatar { width: 56px; height: 56px; border-radius: 50%; background: linear-gradient(135deg,#ff9f43,#ff7d26); color:#fff; display:flex; align-items:center; justify-content:center; font-size:24px; }
.user-card .u-phone { font-size: 16px; font-weight: 600; }
.user-card .u-name { font-size: 13px; color: #999; margin-top: 2px; }

/* 发布表单分类切换 */
.cat-radios { display: flex; gap: 8px; margin-bottom: 16px; }
.cat-radios label { flex: 1; text-align: center; border: 2px solid #eee; border-radius: 10px; padding: 12px 0; font-size: 15px; background: #fff; }
.cat-radios label.on { border-color: #ff7d26; color: #ff7d26; background: #fff7f0; font-weight: 600; }
.cat-radios input { display: none; }
.sub-form { display: none; }
.sub-form.on { display: block; }
.img-preview { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.img-preview img { width: 64px; height: 64px; object-fit: cover; border-radius: 8px; }

/* 管理后台 */
.admin-body { padding-bottom: 20px; }
.admin-nav { display: flex; flex-wrap: wrap; gap: 8px; background: #fff; padding: 10px 12px; border-bottom: 1px solid #eee; position: sticky; top: 0; z-index: 20; }
.admin-nav a { font-size: 13px; color: #555; background: #f2f3f7; border-radius: 14px; padding: 5px 12px; }
.admin-nav a.on { background: #ff7d26; color: #fff; }
table.grid { width: 100%; border-collapse: collapse; background: #fff; border-radius: 10px; overflow: hidden; font-size: 13px; }
table.grid th, table.grid td { padding: 9px 8px; border-bottom: 1px solid #f2f2f2; text-align: left; vertical-align: top; word-break: break-all; }
table.grid th { background: #fafafa; color: #666; font-weight: 600; white-space: nowrap; }
.filter-bar { display: flex; gap: 8px; margin-bottom: 12px; flex-wrap: wrap; }
.filter-bar a { font-size: 13px; padding: 5px 12px; border-radius: 14px; background: #fff; color: #666; }
.filter-bar a.on { background: #ff7d26; color: #fff; }
.stats { display: grid; grid-template-columns: repeat(2, 1fr); gap: 10px; }
.stat { background: #fff; border-radius: 12px; padding: 16px; text-align: center; box-shadow: 0 1px 4px rgba(0,0,0,.04); }
.stat .num { font-size: 26px; font-weight: 700; color: #ff7d26; }
.stat .lbl { font-size: 13px; color: #999; margin-top: 4px; }
.empty { text-align: center; color: #bbb; padding: 40px 0; font-size: 14px; }
.mt { margin-top: 12px; }
.list-end { text-align: center; color: #444; font-size: 13px; margin-bottom: 20px; padding: 8px 0; font-weight: 500; }

/* 管理员可见的卖家信息高亮卡片 */
.admin-highlight {
  background: #fffbe8; border: 2px solid #ffb347; box-shadow: 0 2px 8px rgba(255,179,71,.35);
}
.admin-highlight h3 { color: #b96a00; }
.admin-highlight .kv .k { color: #b96a00; }
