/* 千域洗衣液 · 用户端 H5
   移动优先，浅色商城主题；无第三方依赖 */
:root {
  --brand: #0f766e;
  --brand-2: #14b8a6;
  --brand-soft: #e6f7f4;
  --red: #ef4444;
  --orange: #f97316;
  --bg: #f4f5f7;
  --card: #ffffff;
  --text: #1a1f26;
  --sub: #6b7684;
  --muted: #9aa4b0;
  --line: #eef1f4;
  --radius: 12px;
  --shadow: 0 1px 6px rgba(17, 34, 51, .05);
}

* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #e8ebee;
  color: var(--text);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
}
#app {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  background: var(--bg);
  position: relative;
  padding-bottom: 62px;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }
img { display: block; max-width: 100%; }
input, textarea, button, select { font-family: inherit; font-size: 14px; }

/* ---------- 通用 ---------- */
.muted { color: var(--sub); }
.tiny { font-size: 12px; }
.mini { font-size: 11px; }
.bold { font-weight: 700; }
.center { text-align: center; }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.gap8 { display: flex; gap: 8px; }
.mt6 { margin-top: 6px; } .mt10 { margin-top: 10px; } .mt14 { margin-top: 14px; }
.price { color: var(--red); font-weight: 700; }
.price .cur { font-size: 12px; margin-right: 1px; }
.price b { font-size: 18px; }
.price-old { color: var(--muted); text-decoration: line-through; font-size: 12px; margin-left: 4px; }
.divider { height: 8px; background: var(--bg); }

/* ---------- 顶部搜索 ---------- */
.hd {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  padding: 10px 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.hd .logo { font-size: 15px; font-weight: 800; color: var(--brand); letter-spacing: .5px; white-space: nowrap; }
.search {
  flex: 1; display: flex; align-items: center; gap: 6px;
  background: #f2f4f6; border-radius: 20px; padding: 8px 12px;
  color: var(--muted); font-size: 13px;
}
.search input {
  flex: 1; border: 0; background: transparent; outline: none; font-size: 13px; color: var(--text);
}
.search input::placeholder { color: var(--muted); }
.hd .cart-ico { position: relative; font-size: 20px; cursor: pointer; padding: 0 2px; }
.badge {
  position: absolute; top: -4px; right: -6px;
  min-width: 16px; height: 16px; padding: 0 4px;
  background: var(--red); color: #fff; border-radius: 8px;
  font-size: 10px; line-height: 16px; text-align: center; font-weight: 600;
}

/* 返回栏 */
.nav {
  position: sticky; top: 0; z-index: 30;
  display: flex; align-items: center; gap: 8px;
  height: 46px; padding: 0 12px; background: #fff;
  border-bottom: 1px solid var(--line);
}
.nav .back { width: 30px; font-size: 22px; line-height: 1; color: #333; cursor: pointer; }
.nav .t { flex: 1; font-size: 15px; font-weight: 600; }
.nav .r { font-size: 12px; color: var(--sub); }

/* ---------- 轮播 ---------- */
.banner-wrap { padding: 10px 12px 0; }
.banners { display: flex; gap: 10px; overflow-x: auto; scroll-snap-type: x mandatory; -webkit-overflow-scrolling: touch; scrollbar-width: none; }
.banners::-webkit-scrollbar { display: none; }
.banner {
  flex: 0 0 100%; scroll-snap-align: center;
  border-radius: 16px; position: relative; overflow: hidden; cursor: pointer;
  background: #eef2f6; box-shadow: 0 8px 22px rgba(16, 32, 54, .12);
}
/* 图片轮播：整幅大图，宽度撑满、等比 1:1 */
.banner.has-img { aspect-ratio: 1 / 1; }
.banner.has-img img { width: 100%; height: 100%; object-fit: cover; display: block; }
/* 纯文字轮播（无图时的兜底） */
.banner:not(.has-img) { height: 132px; padding: 18px; color: #fff; }
.banner h3 { margin: 0; font-size: 20px; font-weight: 800; letter-spacing: .5px; }
.banner p { margin: 6px 0 0; font-size: 12px; opacity: .9; }
.banner .deco { position: absolute; right: -20px; bottom: -30px; width: 130px; height: 130px; border-radius: 50%; background: rgba(255,255,255,.14); }
.banner .deco2 { position: absolute; right: 40px; top: -40px; width: 80px; height: 80px; border-radius: 50%; background: rgba(255,255,255,.10); }
.dots { display: flex; gap: 5px; justify-content: center; margin-top: 8px; }
.dots i { width: 6px; height: 6px; border-radius: 3px; background: #cdd4db; transition: .2s; }
.dots i.on { width: 14px; background: var(--brand); }

/* ---------- 公告条 ---------- */
.notice-strip {
  margin: 10px 12px 0; padding: 9px 12px;
  background: #fff8ec; color: #a15c07; font-size: 12px;
  border-radius: 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}

/* ---------- 分类金刚区（单品类时隐藏） ---------- */
.cats { display: flex; justify-content: space-between; background: #fff; margin: 10px 12px; padding: 14px 8px; border-radius: var(--radius); box-shadow: var(--shadow); }
.cat { flex: 1; text-align: center; cursor: pointer; }
.cat .ico { font-size: 24px; line-height: 1.2; }
.cat span { display: block; font-size: 11px; color: #3d4650; margin-top: 4px; }

/* ---------- 区块标题 ---------- */
.sec { display: flex; align-items: center; justify-content: space-between; padding: 14px 14px 8px; }
.sec h3 { margin: 0; font-size: 15px; font-weight: 700; }
.sec h3 em { font-style: normal; color: var(--brand); }
.sec .more { font-size: 12px; color: var(--muted); cursor: pointer; }

/* ---------- 商品卡 ---------- */
.hscroll { display: flex; gap: 10px; overflow-x: auto; padding: 2px 12px 6px; scrollbar-width: none; }
.hscroll::-webkit-scrollbar { display: none; }
.hcard { flex: 0 0 108px; cursor: pointer; }
.hcard .ph { width: 108px; height: 108px; border-radius: 10px; overflow: hidden; background: #fff; }
.hcard .ph img { width: 100%; height: 100%; object-fit: cover; }
.hcard .nm { font-size: 12px; margin-top: 6px; color: #333; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

.grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 9px; padding: 0 12px 14px; }
.pcard { background: #fff; border-radius: var(--radius); overflow: hidden; box-shadow: var(--shadow); cursor: pointer; }
.pcard .ph { position: relative; width: 100%; aspect-ratio: 1/1; background: #f7f8f9; }
.pcard .ph img { width: 100%; height: 100%; object-fit: cover; }
.pcard .body { padding: 8px 9px 10px; }
.pcard .nm { font-size: 13px; font-weight: 600; line-height: 1.35; height: 36px; overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.pcard .sb { font-size: 11px; color: var(--muted); margin-top: 3px; height: 16px; overflow: hidden; white-space: nowrap; text-overflow: ellipsis; }
.pcard .bt { display: flex; align-items: flex-end; justify-content: space-between; margin-top: 6px; }
.pcard .sales { font-size: 11px; color: var(--muted); }
.tag { display: inline-block; font-size: 10px; line-height: 15px; padding: 0 4px; border-radius: 3px; margin-right: 4px; vertical-align: 1px; }
.tag-hot { background: #fee2e2; color: #dc2626; }
.tag-new { background: var(--brand-soft); color: var(--brand); }
.tag-line { background: #fef3c7; color: #b45309; }
.corner-tag { position: absolute; left: 0; top: 0; background: var(--red); color: #fff; font-size: 10px; padding: 2px 6px; border-bottom-right-radius: 8px; }

/* ---------- 分类页 ---------- */
.cat-page { display: flex; min-height: calc(100vh - 62px); }
.cat-side { width: 92px; background: #f7f8f9; flex: 0 0 92px; }
.cat-side div { padding: 15px 8px; text-align: center; font-size: 13px; color: #4a5460; cursor: pointer; position: relative; }
.cat-side div.on { background: #fff; color: var(--brand); font-weight: 700; }
.cat-side div.on::before { content: ''; position: absolute; left: 0; top: 14px; bottom: 14px; width: 3px; background: var(--brand); border-radius: 2px; }
.cat-main { flex: 1; padding: 10px; background: #fff; }
.cat-page.single .cat-main { padding: 12px; }
.filter-bar { display: flex; gap: 16px; padding: 0 12px 8px; font-size: 13px; color: var(--sub); background: #fff; position: sticky; top: 46px; z-index: 10; }
.filter-bar span { cursor: pointer; padding: 4px 0; }
.filter-bar span.on { color: var(--brand); font-weight: 700; }
.list-row { display: flex; gap: 10px; background: #fff; border-radius: var(--radius); padding: 10px; margin-bottom: 8px; box-shadow: var(--shadow); cursor: pointer; }
.list-row .ph { width: 92px; height: 92px; flex: 0 0 92px; border-radius: 8px; overflow: hidden; background: #f7f8f9; }
.list-row .ph img { width: 100%; height: 100%; object-fit: cover; }
.list-row .info { flex: 1; display: flex; flex-direction: column; justify-content: space-between; min-width: 0; }
.list-row .nm { font-size: 13.5px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }

/* ---------- 商品详情 ---------- */
.pd-hero { width: 100%; aspect-ratio: 1/1; background: #fff; }
.pd-hero img { width: 100%; height: 100%; object-fit: cover; }
.pd-main { background: #fff; padding: 12px 14px 14px; }
.pd-main .p { display: flex; align-items: baseline; gap: 6px; }
.pd-main .p b { font-size: 26px; color: var(--red); font-weight: 800; }
.pd-main .p b i { font-size: 14px; font-style: normal; }
.pd-main h1 { font-size: 16px; margin: 8px 0 4px; font-weight: 600; line-height: 1.4; }
.pd-main .spec { font-size: 12px; color: var(--muted); }
.pd-line { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px; background: #fff; border-top: 1px solid var(--line); font-size: 13px; }
.pd-detail { background: #fff; padding: 14px; }
.pd-imgs { background: #fff; padding-bottom: 6px; }
.pd-imgs img { width: 100%; display: block; }
.pd-detail pre { white-space: pre-wrap; font-family: inherit; font-size: 13px; color: #3d4650; margin: 8px 0 0; line-height: 1.75; }

/* ---------- 数量步进 ---------- */
.stepper { display: flex; align-items: center; gap: 0; border: 1px solid var(--line); border-radius: 6px; overflow: hidden; }
.stepper button { width: 30px; height: 28px; border: 0; background: #f7f8f9; color: #444; font-size: 15px; cursor: pointer; }
.stepper button:active { background: #eceff2; }
.stepper span { min-width: 38px; text-align: center; font-size: 13px; }

/* ---------- 购物车 ---------- */
.cart-item { display: flex; gap: 10px; background: #fff; border-radius: var(--radius); padding: 10px; margin: 8px 12px; box-shadow: var(--shadow); align-items: center; }
.check { width: 20px; height: 20px; flex: 0 0 20px; border-radius: 50%; border: 1.5px solid #cfd6dd; display: flex; align-items: center; justify-content: center; font-size: 12px; color: #fff; }
.check.on { background: var(--brand); border-color: var(--brand); }
.cart-item .ph { width: 78px; height: 78px; flex: 0 0 78px; border-radius: 8px; overflow: hidden; background: #f7f8f9; }
.cart-item .ph img { width: 100%; height: 100%; object-fit: cover; }
.cart-item .info { flex: 1; min-width: 0; }
.cart-item .nm { font-size: 13px; font-weight: 600; line-height: 1.35; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.cart-bar {
  position: fixed; bottom: 62px; left: 0; right: 0; z-index: 25;
  max-width: 480px; margin: 0 auto;
  display: flex; align-items: center; gap: 10px;
  background: #fff; border-top: 1px solid var(--line);
  padding: 10px 14px; padding-bottom: calc(10px + env(safe-area-inset-bottom));
}
.cart-bar .total { flex: 1; font-size: 12px; color: var(--sub); }
.cart-bar .total b { display: block; font-size: 18px; color: var(--red); }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center;
  height: 42px; padding: 0 20px; border: 0; border-radius: 21px;
  background: linear-gradient(135deg, var(--brand), #12a08f);
  color: #fff; font-size: 14px; font-weight: 600; cursor: pointer;
}
.btn:disabled { opacity: .5; }
.btn.ghost { background: #fff; color: var(--brand); border: 1px solid var(--brand); }
.btn.gray { background: #eceff2; color: #5b6572; }
.btn.block { width: 100%; }
.btn.sm { height: 30px; padding: 0 12px; font-size: 12px; border-radius: 15px; }
.btn.orange { background: linear-gradient(135deg, #f97316, #fb923c); }

.action-bar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 30;
  max-width: 480px; margin: 0 auto;
  display: flex; align-items: center; gap: 8px;
  background: #fff; border-top: 1px solid var(--line);
  padding: 8px 12px; padding-bottom: calc(8px + env(safe-area-inset-bottom));
}
.action-bar .btn { flex: 1; }
.action-bar .ico-btn { text-align: center; font-size: 10px; color: var(--sub); width: 46px; cursor: pointer; }
.action-bar .ico-btn span { display: block; font-size: 19px; }

/* ---------- 我的 ---------- */
.me-hd { background: linear-gradient(140deg, #0f766e, #14b8a6 70%, #2dd4bf); color: #fff; padding: 20px 16px 44px; position: relative; }
.me-hd .nm { font-size: 18px; font-weight: 700; }
.me-hd .no { font-size: 11px; opacity: .82; margin-top: 3px; }
.me-hd .lvl { position: absolute; right: 16px; top: 22px; background: rgba(255,255,255,.2); border-radius: 14px; padding: 4px 12px; font-size: 12px; }
.me-assets { margin: -32px 12px 0; background: #fff; border-radius: var(--radius); box-shadow: var(--shadow); display: flex; padding: 16px 0; position: relative; z-index: 2; }
.me-assets > div { flex: 1; text-align: center; cursor: pointer; }
.me-assets b { font-size: 18px; display: block; color: #16202b; }
.me-assets span { font-size: 11px; color: var(--sub); }
.me-card { background: #fff; border-radius: var(--radius); margin: 10px 12px; box-shadow: var(--shadow); overflow: hidden; }
.me-card .hd-row { display: flex; align-items: center; justify-content: space-between; padding: 13px 14px 10px; }
.me-card .hd-row b { font-size: 14px; }
.order-4 { display: flex; padding: 0 0 14px; }
.order-4 div { flex: 1; text-align: center; cursor: pointer; position: relative; }
.order-4 .ico { font-size: 21px; }
.order-4 span { display: block; font-size: 11px; color: #4a5460; margin-top: 4px; }
.order-4 .num { position: absolute; top: -3px; right: 50%; margin-right: -22px; background: var(--red); color: #fff; font-size: 10px; line-height: 15px; height: 15px; min-width: 15px; padding: 0 4px; border-radius: 8px; }
.cell { display: flex; align-items: center; gap: 10px; padding: 13px 14px; border-top: 1px solid var(--line); cursor: pointer; font-size: 14px; }
.cell:first-child { border-top: 0; }
.cell .i { width: 20px; text-align: center; font-size: 16px; }
.cell .t { flex: 1; }
.cell .v { font-size: 12px; color: var(--muted); }

/* ---------- 订单 ---------- */
.otabs { display: flex; background: #fff; border-bottom: 1px solid var(--line); position: sticky; top: 46px; z-index: 10; }
.otabs span { flex: 1; text-align: center; padding: 11px 0; font-size: 13px; color: var(--sub); cursor: pointer; position: relative; }
.otabs span.on { color: var(--brand); font-weight: 700; }
.otabs span.on::after { content: ''; position: absolute; bottom: 0; left: 50%; transform: translateX(-50%); width: 22px; height: 2.5px; border-radius: 2px; background: var(--brand); }
.order-card { background: #fff; border-radius: var(--radius); margin: 8px 12px; padding: 12px 14px; box-shadow: var(--shadow); cursor: pointer; }
.order-card .top { display: flex; justify-content: space-between; font-size: 12px; color: var(--muted); }
.status { font-size: 12px; font-weight: 600; }
.st-pending { color: var(--orange); } .st-paid { color: #2563eb; } .st-shipped { color: var(--brand); }
.st-finished { color: var(--muted); } .st-cancelled, .st-refunded { color: var(--muted); }
.order-item { display: flex; gap: 10px; margin-top: 10px; }
.order-item .ph { width: 62px; height: 62px; flex: 0 0 62px; border-radius: 8px; overflow: hidden; background: #f7f8f9; }
.order-item .ph img { width: 100%; height: 100%; object-fit: cover; }
.order-item .nm { font-size: 13px; font-weight: 600; }
.order-card .sum { display: flex; justify-content: flex-end; gap: 4px; font-size: 12px; color: var(--sub); margin-top: 8px; }
.order-card .acts { display: flex; justify-content: flex-end; gap: 8px; margin-top: 10px; }

/* ---------- 结算 ---------- */
.ck-card { background: #fff; margin: 10px 12px; border-radius: var(--radius); padding: 14px; box-shadow: var(--shadow); }
.addr { display: flex; gap: 10px; align-items: flex-start; cursor: pointer; }
.addr .i { font-size: 18px; }
.addr .info { flex: 1; min-width: 0; }
.addr .p1 { font-size: 14px; font-weight: 600; }
.addr .p2 { font-size: 12px; color: var(--sub); margin-top: 4px; line-height: 1.5; }
.kv { display: flex; justify-content: space-between; align-items: center; padding: 9px 0; font-size: 13px; }
.kv .k { color: #3d4650; }
.kv .v { color: #16202b; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 12px; }
.field label { display: block; font-size: 12px; color: var(--sub); margin-bottom: 6px; }
.field input, .field textarea {
  width: 100%; border: 1px solid #e3e8ee; border-radius: 8px;
  padding: 10px 12px; outline: none; background: #fbfcfd;
}
.field input:focus, .field textarea:focus { border-color: var(--brand); background: #fff; }

/* ---------- 弹层 / 提示 ---------- */
.mask { position: fixed; inset: 0; background: rgba(12, 20, 28, .45); z-index: 60; display: flex; align-items: flex-end; justify-content: center; }
.sheet { width: 100%; max-width: 480px; background: #fff; border-radius: 16px 16px 0 0; padding: 16px; max-height: 78vh; overflow-y: auto; }
.sheet h3 { margin: 0 0 12px; font-size: 15px; }
.toast {
  position: fixed; left: 50%; top: 46%; transform: translateX(-50%);
  background: rgba(20, 28, 36, .88); color: #fff; font-size: 13px;
  padding: 10px 16px; border-radius: 8px; z-index: 90; max-width: 78%; text-align: center;
}
.empty { text-align: center; padding: 60px 20px; color: var(--muted); font-size: 13px; }
.empty .ico { display: block; font-size: 40px; margin-bottom: 10px; opacity: .7; }
.skel { height: 90px; border-radius: var(--radius); background: linear-gradient(90deg, #eef1f4 25%, #f6f8fa 37%, #eef1f4 63%); background-size: 400% 100%; animation: sk 1.3s infinite; margin: 10px 12px; }
@keyframes sk { 0% { background-position: 100% 50% } 100% { background-position: 0 50% } }

/* ---------- 底部 Tab ---------- */
.tabbar {
  position: fixed; bottom: 0; left: 0; right: 0; z-index: 40;
  max-width: 480px; margin: 0 auto;
  display: flex; background: #fff; border-top: 1px solid var(--line);
  padding-bottom: env(safe-area-inset-bottom);
}
.tabbar a {
  flex: 1; text-align: center; padding: 6px 0 5px; font-size: 10px; color: #8b95a1;
  position: relative;
}
.tabbar a .ico { display: block; font-size: 20px; line-height: 1.25; filter: grayscale(1); opacity: .62; }
.tabbar a.on { color: var(--brand); font-weight: 600; }
.tabbar a.on .ico { filter: none; opacity: 1; }
.tabbar .dot { position: absolute; top: 2px; right: 50%; margin-right: -20px; background: var(--red); color: #fff; font-size: 9px; height: 14px; line-height: 14px; padding: 0 4px; border-radius: 7px; }
