/* ============================================================
   御马买家秀 H5 — 按前端画布稿还原
   TDesign 蓝色体系：主蓝 #0052D9 / 页面灰 #F3F3F3 / 卡片圆角 12、9
   ============================================================ */
:root {
  --primary: #0052D9;
  --primary-bg: #ECF2FE;
  --text-1: #18191C;
  --text-2: #4A4A4A;
  --text-3: #8C8C8C;
  --text-4: #B0B0B0;
  --border: #DCDCDC;
  --divider: #E7E7E7;
  --bg: #F3F3F3;
  --green: #2BA471;
  --green-bg: #E3F9E9;
  --orange: #E37318;
  --orange-bg: #FFF3E8;
  --red: #D54941;
  --red-bg: #FDECEE;
  --font: "PingFang SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
}
* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: var(--font); color: var(--text-1); background: #E9E9E9;
  font-size: 14px; -webkit-font-smoothing: antialiased;
}
button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
input, textarea { font-family: inherit; outline: none; border: none; background: none; }
img { display: block; }
.hide { display: none !important; }

/* 桌面端手机外框 */
#phone {
  max-width: 420px; margin: 0 auto; min-height: 100vh; background: var(--bg);
  position: relative; display: flex; flex-direction: column; min-width: 320px;
}
@media (min-width: 700px) {
  body { background: #2B2B2B; }
  #phone { margin: 24px auto; min-height: calc(100vh - 48px); border-radius: 24px; overflow: hidden; box-shadow: 0 24px 80px rgba(0,0,0,.4); }
}

.page { flex: 1; display: flex; flex-direction: column; overflow-y: auto; padding-bottom: 64px; }

/* ---------------- 顶栏 ---------------- */
.topbar {
  background: #fff; padding: 14px 16px 10px; position: sticky; top: 0; z-index: 10;
  display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid #F0F0F0;
}
.topbar-brand { display: flex; align-items: center; gap: 8px; }
.topbar-logo { width: 26px; height: 26px; border-radius: 6px; background: var(--primary); color: #fff; display: flex; align-items: center; justify-content: center; font-weight: 700; font-size: 14px; }
.topbar-name { font-size: 17px; font-weight: 700; }
.topbar-sub { font-size: 11px; color: var(--text-3); margin-left: auto; }
.searchbar {
  display: flex; align-items: center; gap: 8px; height: 34px;
  background: #F6F7F9; border-radius: 17px; padding: 0 14px; color: var(--text-3);
}
.searchbar input { flex: 1; font-size: 13px; color: var(--text-1); }
.searchbar input::placeholder { color: var(--text-4); }

.chip-row { display: flex; gap: 8px; overflow-x: auto; padding: 10px 16px 2px; scrollbar-width: none; }
.chip-row::-webkit-scrollbar { display: none; }
.chip {
  flex-shrink: 0; height: 30px; padding: 0 14px; border-radius: 15px;
  background: #fff; color: var(--text-2); font-size: 13px;
  display: inline-flex; align-items: center; border: 1px solid transparent;
}
.chip.active { background: var(--primary-bg); color: var(--primary); border-color: var(--primary); font-weight: 500; }

/* ---------------- 瀑布流 ---------------- */
.feed { padding: 12px 16px; display: flex; gap: 10px; align-items: flex-start; }
.feed-col { flex: 1; display: flex; flex-direction: column; gap: 10px; min-width: 0; }
.feed-card { background: #fff; border-radius: 12px; overflow: hidden; }
.feed-img { width: 100%; background: #eee; }
.feed-body { padding: 8px 10px 10px; display: flex; flex-direction: column; gap: 6px; }
.feed-title { font-size: 13px; font-weight: 500; line-height: 1.4; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.feed-tags { display: flex; gap: 4px; flex-wrap: wrap; }
.ftag { font-size: 10px; padding: 2px 6px; border-radius: 3px; background: var(--primary-bg); color: var(--primary); }
.ftag.gray { background: #F5F5F5; color: var(--text-2); }
.ftag.orange { background: var(--orange-bg); color: var(--orange); }
.feed-foot { display: flex; align-items: center; justify-content: space-between; color: var(--text-3); font-size: 11px; }
.feed-meta { display: flex; gap: 8px; align-items: center; }
.like-btn { display: inline-flex; align-items: center; gap: 3px; color: var(--text-3); font-size: 11px; }
.like-btn.liked { color: var(--red); }
.empty { padding: 80px 0; text-align: center; color: var(--text-3); font-size: 13px; }

/* ---------------- 找车型：品牌网格 ---------------- */
.section-title { font-size: 15px; font-weight: 700; padding: 16px 16px 4px; }
.brand-grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 10px; padding: 12px 16px; }
.brand-tile { background: #fff; border-radius: 9px; padding: 12px 6px 10px; display: flex; flex-direction: column; align-items: center; gap: 6px; }
.brand-tile img { width: 44px; height: 44px; object-fit: contain; background: #fff; }
.brand-tile .n { font-size: 12px; color: var(--text-1); }
.brand-tile .c { font-size: 10px; color: var(--text-3); }
.model-list { padding: 4px 16px 12px; display: flex; flex-direction: column; gap: 8px; }
.model-row { background: #fff; border-radius: 9px; padding: 12px 14px; display: flex; align-items: center; justify-content: space-between; }
.model-row .name { font-size: 14px; font-weight: 500; }
.model-row .count { font-size: 12px; color: var(--text-3); }

/* ---------------- 分类页 ---------------- */
.cat-wrap { flex: 1; display: flex; min-height: 0; }
.cat-nav { width: 96px; background: #fff; display: flex; flex-direction: column; flex-shrink: 0; }
.cat-nav-item { padding: 16px 10px; font-size: 13px; color: var(--text-2); text-align: center; position: relative; }
.cat-nav-item.active { color: var(--primary); font-weight: 600; background: var(--bg); }
.cat-nav-item.active::before { content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%); width: 3px; height: 20px; border-radius: 2px; background: var(--primary); }
.cat-main { flex: 1; padding: 12px; overflow-y: auto; }

/* ---------------- 详情页 ---------------- */
.detail-page { padding-bottom: 76px; }
.swiper { position: relative; background: #000; }
.swiper-imgs { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.swiper-imgs::-webkit-scrollbar { display: none; }
.swiper-imgs img { width: 100%; flex-shrink: 0; scroll-snap-align: center; max-height: 420px; object-fit: contain; }
.swiper-count { position: absolute; right: 12px; bottom: 12px; background: rgba(0,0,0,.55); color: #fff; font-size: 11px; padding: 3px 9px; border-radius: 10px; }
.detail-body { padding: 14px 16px; display: flex; flex-direction: column; gap: 12px; }
.detail-title { font-size: 17px; font-weight: 700; line-height: 1.4; }
.detail-meta { display: flex; gap: 6px; flex-wrap: wrap; }
.badge { font-size: 11px; padding: 3px 8px; border-radius: 3px; background: var(--primary-bg); color: var(--primary); font-weight: 500; }
.badge.green { background: var(--green-bg); color: var(--green); }
.badge.orange { background: var(--orange-bg); color: var(--orange); }
.detail-card { background: #fff; border-radius: 12px; padding: 12px 14px; display: flex; flex-direction: column; gap: 8px; }
.detail-row { display: flex; justify-content: space-between; font-size: 13px; color: var(--text-2); }
.detail-row .k { color: var(--text-3); }
.goods-card { background: #fff; border-radius: 12px; padding: 12px 14px; display: flex; gap: 10px; align-items: center; }
.goods-img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: #eee; }
.goods-info { flex: 1; display: flex; flex-direction: column; gap: 4px; min-width: 0; }
.goods-name { font-size: 13px; font-weight: 500; }
.goods-price { color: var(--red); font-size: 15px; font-weight: 700; }
.goods-price small { font-size: 11px; font-weight: 400; }

/* 底部操作栏（详情页） */
.detail-bar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 420px; background: #fff; border-top: 1px solid #F0F0F0;
  display: flex; align-items: center; padding: 10px 16px; gap: 12px; z-index: 20;
}
.detail-bar .op { display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--text-2); min-width: 40px; }
.detail-bar .op.liked { color: var(--red); }
.btn-primary-w {
  flex: 1; height: 40px; border-radius: 20px; background: var(--primary); color: #fff;
  font-size: 14px; font-weight: 500; display: flex; align-items: center; justify-content: center;
}

/* ---------------- 底部导航 ---------------- */
.tabbar {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 420px; background: #fff; border-top: 1px solid #F0F0F0;
  display: flex; padding: 6px 0 max(6px, env(safe-area-inset-bottom)); z-index: 15;
}
.tabbar-item { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px; font-size: 10px; color: var(--text-3); }
.tabbar-item.active { color: var(--primary); font-weight: 500; }
.tabbar-item svg { width: 22px; height: 22px; }

/* ---------------- 表单（发布 / 登录） ---------------- */
.form-page { padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.form-card { background: #fff; border-radius: 12px; padding: 16px; display: flex; flex-direction: column; gap: 14px; }
.form-label { font-size: 13px; font-weight: 500; }
.form-input {
  height: 40px; border: 1px solid var(--border); border-radius: 6px; padding: 0 12px;
  font-size: 14px; width: 100%; background: #fff; color: var(--text-1);
}
.form-input:focus { border-color: var(--primary); }
select.form-input { appearance: auto; }
.form-btn { height: 44px; border-radius: 8px; background: var(--primary); color: #fff; font-size: 15px; font-weight: 500; }
.form-btn.sec { background: #fff; color: var(--text-2); border: 1px solid var(--border); }
.upload-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; }
.upload-cell {
  aspect-ratio: 1; border-radius: 8px; border: 1px dashed var(--border);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--text-3); font-size: 11px; background: #FAFAFA; overflow: hidden; position: relative;
}
.upload-cell img { width: 100%; height: 100%; object-fit: cover; }
.upload-cell .del { position: absolute; top: 4px; right: 4px; width: 18px; height: 18px; border-radius: 9px; background: rgba(0,0,0,.55); color: #fff; font-size: 12px; line-height: 18px; text-align: center; }
.steps { display: flex; align-items: center; gap: 6px; padding: 4px 16px 0; }
.step { display: flex; align-items: center; gap: 5px; font-size: 11px; color: var(--text-3); flex-shrink: 0; }
.step .d { width: 18px; height: 18px; border-radius: 9px; background: #fff; border: 1px solid var(--border); color: var(--text-3); font-size: 11px; display: flex; align-items: center; justify-content: center; }
.step.cur { color: var(--primary); font-weight: 500; }
.step.cur .d { background: var(--primary); border-color: var(--primary); color: #fff; }
.step-line { flex: 1; height: 1.5px; background: var(--divider); min-width: 8px; }

/* ---------------- 我的 ---------------- */
.mine-head { background: linear-gradient(135deg, #0B2B66, #1E4FA8); padding: 28px 20px 40px; color: #fff; display: flex; align-items: center; gap: 14px; }
.mine-avatar { width: 56px; height: 56px; border-radius: 28px; background: rgba(255,255,255,.2); display: flex; align-items: center; justify-content: center; font-size: 22px; font-weight: 600; }
.mine-name { font-size: 18px; font-weight: 600; }
.mine-sub { font-size: 12px; opacity: .75; margin-top: 3px; }
.mine-body { padding: 0 16px; margin-top: -22px; display: flex; flex-direction: column; gap: 12px; padding-bottom: 20px; }
.mine-stats { background: #fff; border-radius: 12px; display: flex; padding: 14px 0; }
.mine-stat { flex: 1; text-align: center; display: flex; flex-direction: column; gap: 3px; }
.mine-stat .v { font-size: 19px; font-weight: 700; }
.mine-stat .k { font-size: 11px; color: var(--text-3); }
.mine-card { background: #fff; border-radius: 12px; overflow: hidden; }
.mine-row { display: flex; align-items: center; gap: 10px; padding: 14px 16px; font-size: 14px; border-bottom: 1px solid #F5F5F5; }
.mine-row:last-child { border-bottom: none; }
.mine-row .arrow { margin-left: auto; color: var(--text-4); }
.status-pill { font-size: 11px; padding: 2px 8px; border-radius: 3px; margin-left: auto; }
.reject-reason { font-size: 12px; color: var(--red); background: var(--red-bg); border-radius: 6px; padding: 8px 10px; margin-top: 6px; }

.navbar {
  background: #fff; padding: 12px 16px; display: flex; align-items: center; gap: 10px;
  position: sticky; top: 0; z-index: 10; border-bottom: 1px solid #F0F0F0;
}
.navbar .back { width: 28px; height: 28px; display: flex; align-items: center; justify-content: center; margin-left: -6px; }
.navbar .t { font-size: 16px; font-weight: 600; }

.toast {
  position: fixed; left: 50%; bottom: 100px; transform: translateX(-50%);
  background: rgba(24,25,28,.92); color: #fff; font-size: 13px; padding: 10px 20px;
  border-radius: 8px; z-index: 100; opacity: 0; transition: opacity .2s; pointer-events: none;
  max-width: 80%; text-align: center;
}
.toast.show { opacity: 1; }

/* ---------------- 首页 Banner 轮播 ---------------- */
.banner { position: relative; margin: 12px 16px 0; border-radius: 12px; overflow: hidden; }
.banner-track { display: flex; overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; }
.banner-track::-webkit-scrollbar { display: none; }
.banner-slide {
  position: relative; flex: 0 0 100%; scroll-snap-align: center;
  aspect-ratio: 2.15/1; background-size: cover; background-position: center;
  display: flex; align-items: flex-end; cursor: pointer;
}
.banner-mask { position: absolute; inset: 0; background: linear-gradient(180deg, rgba(11,32,74,0) 20%, rgba(11,32,74,.82) 100%); }
.banner-txt { position: relative; padding: 12px 14px; color: #fff; display: flex; flex-direction: column; gap: 3px; }
.banner-tag {
  align-self: flex-start; font-size: 10px; padding: 2px 8px; border-radius: 3px;
  background: rgba(255,255,255,.18); backdrop-filter: blur(4px); letter-spacing: .5px;
}
.banner-title { font-size: 17px; font-weight: 700; letter-spacing: .3px; }
.banner-sub { font-size: 11px; opacity: .82; }
.banner-dots {
  position: absolute; right: 12px; bottom: 12px; display: flex; gap: 5px; z-index: 2;
}
.banner-dots i { width: 5px; height: 5px; border-radius: 3px; background: rgba(255,255,255,.45); transition: all .25s; }
.banner-dots i.on { width: 14px; background: #fff; }
.st-count { font-size: 11px; font-weight: 400; color: var(--text-3); margin-left: 4px; }

/* ---------------- 详情页：统计条 / 商品卡 / 横滑推荐 ---------------- */
.detail-stats {
  display: flex; background: #fff; border-radius: 12px; padding: 12px 0;
}
.detail-stats .st { flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px; }
.detail-stats .st b { font-size: 15px; font-weight: 700; color: var(--text-1); max-width: 90%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.detail-stats .st span { font-size: 11px; color: var(--text-3); }
.detail-stats .st + .st { border-left: 1px solid var(--border); }
.goods-card {
  display: flex; align-items: center; gap: 10px; background: #fff;
  border-radius: 12px; padding: 10px; cursor: pointer;
}
.goods-img { width: 64px; height: 64px; border-radius: 8px; object-fit: cover; background: #eee; flex-shrink: 0; }
.goods-info { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.goods-name { font-size: 13px; font-weight: 600; }
.goods-sub { font-size: 11px; color: var(--text-3); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.goods-price { font-size: 16px; font-weight: 700; color: #D54941; }
.goods-price span { font-size: 10px; font-weight: 400; }
.goods-btn {
  flex-shrink: 0; border: none; background: var(--primary); color: #fff;
  font-size: 12px; padding: 8px 16px; border-radius: 16px; cursor: pointer;
}
.rel-row {
  display: flex; gap: 10px; overflow-x: auto; padding: 8px 16px 4px;
  scroll-snap-type: x proximity; scrollbar-width: none;
}
.rel-row::-webkit-scrollbar { display: none; }
.rel-card {
  flex: 0 0 128px; scroll-snap-align: start; background: #fff; border-radius: 10px;
  overflow: hidden; cursor: pointer; display: flex; flex-direction: column;
}
.rel-img { width: 100%; aspect-ratio: 4/3; object-fit: cover; background: #eee; }
.rel-name {
  font-size: 12px; font-weight: 500; line-height: 1.35; padding: 7px 9px 0;
  display: -webkit-box; -webkit-line-clamp: 1; -webkit-box-orient: vertical; overflow: hidden;
}
.rel-sub { font-size: 10px; color: var(--text-3); padding: 2px 9px 9px; }

/* ---------------- 首页：新能源热门车快捷区 ---------------- */
.nev-sec { margin-top: 4px; }
.nev-row {
  display: flex; gap: 8px; overflow-x: auto; padding: 2px 16px 4px;
  scrollbar-width: none;
}
.nev-row::-webkit-scrollbar { display: none; }
.nev-pill {
  flex: 0 0 auto; display: flex; align-items: center; gap: 8px;
  background: #fff; border: 1px solid var(--border); border-radius: 20px;
  padding: 7px 14px 7px 9px; cursor: pointer; transition: border-color .15s;
}
.nev-pill:active { border-color: var(--primary); }
.nev-pill img { width: 26px; height: 26px; object-fit: contain; }
.nev-pill .n { font-size: 13px; font-weight: 600; color: var(--text-1); }
.nev-pill .c { font-size: 11px; color: var(--text-3); }

/* ---------------- 首页：编辑精选 ---------------- */
.featured { padding: 8px 16px 0; display: flex; flex-direction: column; gap: 10px; }
.feat-hero {
  position: relative; border-radius: 12px; overflow: hidden;
  aspect-ratio: 16/8.5; background: #e8eaef; cursor: pointer;
}
.feat-hero img { width: 100%; height: 100%; object-fit: cover; display: block; }
.feat-mask {
  position: absolute; inset: 0;
  background: linear-gradient(180deg, rgba(11,32,74,0) 35%, rgba(11,32,74,.85) 100%);
}
.feat-txt { position: absolute; left: 14px; right: 14px; bottom: 12px; color: #fff; }
.feat-badge {
  display: inline-block; font-size: 10px; padding: 3px 9px; border-radius: 3px;
  background: rgba(255,255,255,.18); backdrop-filter: blur(4px); margin-bottom: 6px;
}
.feat-title {
  font-size: 16px; font-weight: 700; line-height: 1.3;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.feat-sub { font-size: 11px; opacity: .82; margin-top: 3px; }
.feat-row { display: flex; gap: 10px; }
.feat-card {
  flex: 1; min-width: 0; background: #fff; border-radius: 12px; overflow: hidden; cursor: pointer;
}
.feat-card img { width: 100%; aspect-ratio: 4/2.9; object-fit: cover; display: block; background: #e8eaef; }
.feat-cbody { padding: 8px 10px 10px; }
.feat-ctitle {
  font-size: 13px; font-weight: 600; color: var(--text-1);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.feat-csub { font-size: 11px; color: var(--text-3); margin-top: 3px; }
