/* 萌宝母婴商城 · 粉蓝童趣风 */
* { margin: 0; padding: 0; box-sizing: border-box; }
body { font-family: "PingFang SC","Microsoft YaHei",sans-serif; background: #faf7f2; color: #3d3d3d; }
[x-cloak] { display: none !important; }
a { text-decoration: none; color: inherit; }
button { cursor: pointer; font-family: inherit; border: none; }

/* 顶栏 */
.top { background: linear-gradient(90deg, #f6dde2, #d6f0ff); position: sticky; top: 0; z-index: 50; box-shadow: 0 2px 12px rgba(255, 150, 200, .25); }
.top-in { max-width: 1180px; margin: 0 auto; display: flex; align-items: center; gap: 28px; padding: 12px 16px; }
.logo { font-size: 22px; font-weight: 800; color: #e8838f; text-shadow: 0 0 10px rgba(255,120,180,.3); }
.nav { display: flex; gap: 8px; flex: 1; }
.nav a { padding: 7px 18px; border-radius: 20px; font-size: 15px; color: #6a6a8a; font-weight: 600; }
.nav a.on { background: #fff; color: #e8838f; box-shadow: 0 2px 8px rgba(255,140,190,.3); }
.cart { position: relative; font-size: 15px; font-weight: 700; color: #4a7df0; background: #fff; padding: 8px 18px; border-radius: 20px; }
.badge { position: absolute; top: -6px; right: -6px; background: #d96f7e; color: #fff; font-size: 12px; min-width: 18px; height: 18px; line-height: 18px; text-align: center; border-radius: 9px; padding: 0 5px; }

/* 通用 */
main { max-width: 1180px; margin: 0 auto; padding: 16px; }
.sec { margin-bottom: 28px; }
.sec-t { font-size: 21px; margin-bottom: 14px; color: #e8838f; }
.empty { text-align: center; color: #aaa; padding: 40px 0; font-size: 16px; }

/* 首页 banner */
.banner { border-radius: 22px; overflow: hidden; margin-bottom: 22px; }
.banner-slide { display: flex; align-items: center; justify-content: space-between; padding: 0; min-height: 170px; height: 300px; background-size: cover; background-position: center; background-repeat: no-repeat; }
.bs-text h1 { font-size: 40px; color: #e8838f; margin-bottom: 6px; }
.bs-text p { font-size: 17px; color: #5a7fd0; }
.bs-emoji { font-size: 64px; }

/* 分类 */
.cats { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; }
.cat { display: flex; align-items: center; gap: 10px; background: #fff; border: 2px solid #f0e9e1; border-radius: 18px; padding: 14px 16px; font-size: 15px; font-weight: 600; color: #575757; transition: .2s; }
.cat:hover { border-color: #f2aeb8; transform: translateY(-2px); box-shadow: 0 6px 16px rgba(232,131,143,.2); }
.cat-e { font-size: 22px; }

/* 商品卡片 */
.grid { display: grid; grid-template-columns: repeat(4, 1fr); gap: 16px; }
.card { background: #fff; border-radius: 18px; overflow: hidden; border: 2px solid #f1eae2; transition: .2s; cursor: pointer; }
.card:hover { transform: translateY(-4px); box-shadow: 0 10px 24px rgba(232,131,143,.22); border-color: #f6dde2; }
.card img { width: 100%; height: 190px; object-fit: cover; display: block; background: #f8f3ec; }
.c-body { padding: 12px; }
.c-name { font-size: 14px; color: #3d3d3d; height: 40px; line-height: 20px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.c-tag { display: inline-block; margin-top: 6px; background: #faf3ee; color: #e8838f; font-size: 12px; padding: 2px 8px; border-radius: 10px; }
.c-foot { display: flex; align-items: baseline; justify-content: space-between; margin: 8px 0; }
.c-price { color: #d96f7e; font-size: 13px; }
.c-price b { font-size: 18px; }
.c-sales { color: #bbb; font-size: 12px; }
.c-add { width: 100%; background: linear-gradient(90deg, #eea3ae, #e8838f); color: #fff; border-radius: 12px; padding: 8px; font-size: 14px; font-weight: 700; }
.c-add:hover { filter: brightness(1.05); }

/* 列表工具栏 */
.list-toolbar { margin-bottom: 16px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.chips button { background: #fff; border: 2px solid #f0e0ec; color: #575757; border-radius: 18px; padding: 6px 14px; font-size: 13px; }
.chips button.on { background: #e8838f; border-color: #e8838f; color: #fff; }
.tool-row { display: flex; gap: 8px; align-items: center; }
.kw { flex: 1; border: 2px solid #f0e0ec; border-radius: 18px; padding: 8px 14px; font-size: 14px; outline: none; }
.kw:focus { border-color: #f2aeb8; }
.sort { background: #fff; border: 2px solid #f0e0ec; border-radius: 16px; padding: 7px 14px; font-size: 13px; color: #575757; }
.sort.on { background: #f2aeb8; border-color: #f2aeb8; color: #fff; }
.result-count { margin-top: 10px; font-size: 13px; color: #999; }
.result-count b { color: #e8838f; }

/* 详情页 */
.detail { background: #fff; border-radius: 22px; padding: 20px; border: 2px solid #f1eae2; }
.back { background: #f3edf8; color: #575757; border-radius: 16px; padding: 7px 16px; margin-bottom: 16px; }
.d-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 28px; }
.d-img img { width: 100%; border-radius: 16px; background: #faf2f8; }
.d-title { font-size: 22px; color: #3d3d3d; margin-bottom: 10px; line-height: 1.5; }
.d-tag { display: inline-block; background: #faf3ee; color: #e8838f; font-size: 13px; padding: 3px 10px; border-radius: 10px; }
.d-price { margin: 16px 0; display: flex; align-items: baseline; gap: 12px; }
.d-p { color: #d96f7e; font-size: 16px; }
.d-p b { font-size: 30px; }
.d-orig { color: #ccc; text-decoration: line-through; font-size: 14px; }
.d-sales { color: #aaa; font-size: 13px; }
.d-spec, .d-qty { margin: 12px 0; }
.d-spec p, .d-qty p { font-size: 14px; color: #888; margin-bottom: 8px; }
.specs { display: flex; gap: 8px; flex-wrap: wrap; }
.specs button { border: 2px solid #e8d8f0; border-radius: 14px; padding: 6px 14px; background: #fff; font-size: 13px; }
.specs button.on { border-color: #e8838f; color: #e8838f; }
.qty { display: inline-flex; align-items: center; gap: 12px; border: 2px solid #f0e0ec; border-radius: 16px; padding: 4px 10px; }
.qty button { width: 26px; height: 26px; border-radius: 50%; background: #f5eaf3; color: #e8838f; font-size: 16px; }
.qty span { min-width: 20px; text-align: center; font-weight: 700; }
.d-actions { display: flex; gap: 12px; margin-top: 18px; }
.btn-add { flex: 1; background: #fff; border: 2px solid #eea3ae; color: #e8838f; font-weight: 700; border-radius: 14px; padding: 12px; font-size: 15px; }
.btn-buy { flex: 1; background: linear-gradient(90deg, #eea3ae, #e8838f); color: #fff; font-weight: 700; border-radius: 14px; padding: 12px; font-size: 15px; }
.btn-buy:hover { filter: brightness(1.05); }

/* 购物车 */
.cart-item { display: flex; align-items: center; gap: 14px; background: #fff; border-radius: 16px; padding: 12px; margin-bottom: 10px; border: 2px solid #f1eae2; }
.cart-item img { width: 72px; height: 72px; object-fit: cover; border-radius: 12px; background: #f8f3ec; }
.ci-body { flex: 1; }
.ci-name { font-size: 14px; color: #3d3d3d; margin-bottom: 4px; }
.ci-spec { font-size: 12px; color: #bbb; margin-bottom: 4px; }
.ci-price { color: #d96f7e; font-size: 13px; }
.ci-price b { font-size: 16px; }
.ci-del { background: #fdeef2; color: #d96f7e; border-radius: 12px; padding: 6px 12px; font-size: 12px; }
.cart-sum { display: flex; align-items: center; justify-content: flex-end; gap: 18px; background: #fff; border-radius: 16px; padding: 16px; border: 2px solid #f1eae2; }
.sum-price { color: #d96f7e; font-size: 15px; }
.sum-price b { font-size: 24px; }
.cart-sum .btn-buy { flex: none; padding: 10px 34px; }

/* 结算页 */
.co-grid { display: grid; grid-template-columns: 1.2fr 1fr; gap: 18px; }
.co-form { background: #fff; border-radius: 16px; padding: 20px; border: 2px solid #f1eae2; }
.co-form label { display: block; font-size: 14px; color: #777; margin-bottom: 14px; }
.co-form input, .co-form textarea { width: 100%; border: 2px solid #f0e0ec; border-radius: 12px; padding: 10px; font-size: 14px; margin-top: 6px; outline: none; font-family: inherit; }
.co-form input:focus, .co-form textarea:focus { border-color: #f2aeb8; }
.err { color: #d96f7e; font-size: 12px; }
.pay-badge { display: flex; align-items: center; gap: 10px; border: 2px solid #f0e0ec; border-radius: 14px; padding: 12px 14px; cursor: pointer; }
.pay-logo { width: 34px; height: 34px; border-radius: 8px; background: linear-gradient(135deg, #e8838f, #0aa9ff); color: #fff; font-size: 22px; font-weight: 800; display: flex; align-items: center; justify-content: center; }
.pay-name { flex: 1; font-size: 15px; color: #3d3d3d; font-weight: 600; }
.pay-check { width: 22px; height: 22px; border-radius: 50%; border: 2px solid #ddd; color: #fff; font-size: 13px; display: flex; align-items: center; justify-content: center; }
.pay-check.on { background: #e8838f; border-color: #e8838f; }
.co-side { background: #fff; border-radius: 16px; padding: 20px; border: 2px solid #f1eae2; height: fit-content; }
.co-side h3 { font-size: 16px; margin-bottom: 12px; color: #e8838f; }
.co-item { display: flex; align-items: center; gap: 8px; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed #f0e0ec; }
.co-n { flex: 1; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; color: #3d3d3d; }
.co-s { color: #bbb; font-size: 12px; }
.co-q, .co-p { color: #888; }
.co-p b { color: #d96f7e; }
.co-total { text-align: right; margin: 14px 0; font-size: 14px; color: #777; }
.co-total b { color: #d96f7e; font-size: 22px; }

/* 成功页 */
.ok-card { text-align: center; background: #fff; border-radius: 22px; padding: 50px 20px; border: 2px solid #f1eae2; }
.ok { font-size: 60px; margin-bottom: 10px; }
.ok-card h2 { color: #e8838f; margin-bottom: 10px; }
.ok-info, .ok-price { color: #777; font-size: 15px; margin-bottom: 8px; }
.ok-info b, .ok-price b { color: #3d3d3d; }
.ok-card .btn-buy { flex: none; display: inline-block; padding: 12px 44px; margin-top: 14px; }

/* 页脚 / toast */
.foot { text-align: center; color: #bbb; font-size: 13px; padding: 24px; }
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: rgba(50,40,60,.92); color: #fff; padding: 12px 24px; border-radius: 22px; font-size: 14px; z-index: 100; box-shadow: 0 6px 20px rgba(0,0,0,.2); }

@media (max-width: 860px) {
  .grid { grid-template-columns: repeat(2, 1fr); }
  .cats { grid-template-columns: repeat(2, 1fr); }
  .d-grid, .co-grid { grid-template-columns: 1fr; }
  .top-in { gap: 12px; }
  .logo { font-size: 18px; }
}

/* ============ 会员登录/注册 ============ */
.auth-chip { display: inline-flex; align-items: center; margin-left: 12px; font-size: 13px; }
.auth-chip .userchip { color: #d4658e; font-weight: 600; margin-right: 6px; }
.auth-chip .quit { color: #999; text-decoration: underline; cursor: pointer; }
.loginbtn { margin-left: 12px; padding: 7px 16px; border: 1px solid #d4658e; border-radius: 20px; background: none; color: #d4658e; font-size: 13px; cursor: pointer; white-space: nowrap; }
.loginbtn:hover { background: #d4658e; color: #fff; }
.auth-modal { position: fixed; inset: 0; z-index: 1000; display: flex; align-items: center; justify-content: center; }
.auth-mask { position: absolute; inset: 0; background: rgba(0,0,0,.5); }
.auth-box { position: relative; width: 360px; max-width: 92vw; background: #fff; border-radius: 14px; padding: 26px 24px 20px; box-shadow: 0 16px 50px rgba(0,0,0,.3); }
.auth-close { position: absolute; top: 10px; right: 14px; border: none; background: none; font-size: 22px; color: #999; cursor: pointer; line-height: 1; }
.auth-box h4 { margin: 0 0 4px; font-size: 20px; color: #333; }
.auth-sub { margin: 0 0 12px; font-size: 12px; color: #999; }
.auth-label { display: block; margin: 12px 0 4px; font-size: 13px; color: #555; }
.auth-input { width: 100%; box-sizing: border-box; padding: 10px 12px; border: 1px solid #ddd; border-radius: 8px; font-size: 14px; outline: none; }
.auth-input:focus { border-color: #d4658e; }
.auth-err { min-height: 18px; margin-top: 8px; font-size: 12px; color: #e5484d; }
.auth-submit { width: 100%; padding: 11px 0; border: none; border-radius: 8px; background: #d4658e; color: #fff; font-size: 15px; cursor: pointer; }
.auth-submit:hover { opacity: .9; }
.auth-switch { text-align: center; margin-top: 14px; font-size: 13px; }
.auth-switch a { color: #d4658e; text-decoration: none; }
[x-cloak] { display: none !important; }
