:root{
  --bg:#f7f9fc;
  --card:#ffffff;
  --line:#e9edf3;
  --text:#1f2d3d;
  --muted:#6b7785;
  --brand:#2563eb;
  --accent:#0ea5e9;
  --danger:#ef4444;
  --shadow:0 8px 24px rgba(0,0,0,.06);
  --radius:16px;
}

*{box-sizing:border-box}
html,body{margin:0;height:100%;background:var(--bg);color:var(--text);font:14px/1.5 -apple-system,BlinkMacSystemFont,"Segoe UI",Roboto,Helvetica,Arial,"PingFang SC","Hiragino Sans GB","Microsoft YaHei","Noto Sans CJK SC",sans-serif}

.hide{display:none!important}
.muted{color:var(--muted)}

.topbar{
  position:sticky;top:0;z-index:10;
  background:linear-gradient(180deg,#ffffff 0%, #fbfdff 100%);
  border-bottom:1px solid var(--line);
  padding:14px 14px 10px;
  box-shadow:0 2px 12px rgba(31,45,61,.04);
}
.topbar .brand{display:flex;align-items:flex-end;gap:8px;padding:0 2px 8px}
.topbar .title{font-size:18px;font-weight:700}
.topbar .subtitle{font-size:12px;color:var(--muted)}
.topbar .tools{display:flex;gap:10px;align-items:center;flex-wrap:nowrap}

/* 胶囊 */
.chip{
  display:inline-flex;align-items:center;gap:6px;
  height:34px;padding:0 12px;border-radius:999px;
  background:#f2f6fb;border:1px solid var(--line);white-space:nowrap
}

/* 搜索框（带按钮） */
.search{
  display:flex;align-items:center;gap:6px;
  flex:1;min-width:0;background:var(--card);height:40px;
  border:1px solid var(--line);border-radius:999px;padding:0 10px;
  box-shadow:var(--shadow)
}
.search input{
  flex:1;border:0;outline:0;background:transparent;font-size:14px;min-width:0;
}
.icon-btn{
  border:0;background:#eef3fb;border-radius:999px;height:28px;padding:0 12px;cursor:pointer
}
.icon-btn.ghost{background:transparent;color:var(--muted)}
.icon-btn:hover{filter:brightness(.98)}

/* 分类胶囊 */
.chips{
  display:flex;gap:10px;overflow:auto;padding:10px 14px 8px;border-bottom:1px solid var(--line);
  background:linear-gradient(180deg,#fbfdff 0%, #f7f9fc 100%);
}
.chips button{
  height:34px;padding:0 14px;border-radius:999px;border:1px solid var(--line);
  background:var(--card);cursor:pointer;white-space:nowrap
}
.chips button.on{background:#e9f2ff;border-color:#cfe3ff;color:#1d4ed8;font-weight:600}

/* 商品卡片 */
.grid{
  padding:14px;display:grid;grid-template-columns:repeat(2,minmax(0,1fr));gap:12px;
}
.card{
  background:var(--card);border:1px solid var(--line);border-radius:12px;overflow:hidden;box-shadow:var(--shadow)
}
.card .pic{aspect-ratio:1/1;background:#f3f6fa;display:flex;align-items:center;justify-content:center}
.card .pic img{width:100%;height:100%;object-fit:cover}
.card .info{padding:10px}
.card .title{margin:0 0 6px;font-size:15px;line-height:1.35}
.priceRow{display:flex;align-items:center;justify-content:space-between;gap:8px}
.price{color:#e11d48;font-weight:700}
.btn-add{border:0;background:#eaf2ff;color:#1d4ed8;border-radius:999px;height:34px;padding:0 12px;cursor:pointer}

/* 购物车 */
#cartList{padding:14px;display:flex;flex-direction:column;gap:10px}
.cart-item{display:flex;gap:10px;background:var(--card);border:1px solid var(--line);border-radius:12px;padding:8px}
.cart-item .thumb{width:84px;height:84px;border-radius:8px;overflow:hidden;background:#f3f6fa;flex:none}
.cart-item .thumb img{width:100%;height:100%;object-fit:cover}
.cart-item .meta{flex:1}
.qty{display:flex;align-items:center;gap:8px}
.qty button{width:28px;height:28px;border-radius:6px;border:1px solid var(--line);background:#f8fbff;cursor:pointer}

.checkout{position:sticky;bottom:64px;background:linear-gradient(180deg,rgba(247,249,252,.9),rgba(247,249,252,1));border-top:1px solid var(--line);padding:10px 14px;display:flex;align-items:center;justify-content:space-between;gap:10px}
.primary{border:0;background:var(--brand);color:#fff;height:40px;border-radius:10px;padding:0 16px;box-shadow:0 8px 24px rgba(37,99,235,.25)}

/* Tabbar */
.tabbar{
  position:fixed;left:0;right:0;bottom:0;background:#fff;border-top:1px solid var(--line);
  display:flex;gap:10px;padding:10px;backdrop-filter:saturate(180%) blur(6px)
}
.tabbar button{
  flex:1;height:48px;border:1px solid var(--line);border-radius:14px;background:#fff;cursor:pointer;position:relative
}
.tabbar button.on{box-shadow:var(--shadow)}
.badge{position:absolute;right:14px;top:8px;background:#ff6b6b;color:#fff;border-radius:999px;padding:0 6px;font-size:12px;line-height:18px}

/* Toast */
.toast{
  position:fixed;left:50%;bottom:94px;transform:translateX(-50%);background:#222;color:#fff;
  padding:10px 14px;border-radius:10px;opacity:.98;max-width:min(92vw,480px);box-shadow:var(--shadow)
}

/* Footer */
.foot{padding:12px 0 72px;text-align:center;color:var(--muted)}
