/* 小红书橱窗风格（消费者端） */
:root {
  --red: #ff2442;
  --ink: #1d1d1f;
  --ink-2: #6b6b70;
  --ink-3: #9a9aa0;
  --line: #ececef;
  --surface: #f7f7f8;
  --radius: 10px;
}

html, body {
  margin: 0;
  padding: 0;
  background: #fff;
  color: var(--ink);
  font: 15px/1.5 -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

* { box-sizing: border-box; }
button, input, select { font: inherit; }
.hidden { display: none !important; }

/* 认领 */
.claim-card {
  max-width: 520px;
  margin: 20px auto;
  padding: 20px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
}
.claim-card h2 { margin: 0 0 8px; font-size: 20px; }
.hint { color: var(--ink-2); font-size: 13px; line-height: 1.6; margin: 0 0 16px; }
.hint.small { font-size: 12px; margin-top: 12px; }

.field { display: block; margin-bottom: 12px; }
.field span { display: block; font-size: 12px; color: var(--ink-2); margin-bottom: 5px; }
.field input, .field select {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 11px 12px;
  font-size: 15px;
  background: #fff;
}
.field input:focus, .field select:focus {
  outline: none;
  border-color: var(--red);
}

.row { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.row.three { grid-template-columns: 1fr 1fr 1fr; }

.btn {
  width: 100%;
  border: 0;
  border-radius: 980px;
  padding: 13px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
}
.btn.primary { background: var(--red); color: #fff; }
.btn.ghost { background: #fff; border: 1px solid var(--line); color: var(--ink-2); }

/* 店铺头 */
.shop-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 16px 14px 10px;
}
.shop-avatar {
  width: 46px; height: 46px;
  border-radius: 50%;
  background: linear-gradient(145deg, #ff6b81, #ff2442);
  color: #fff;
  font-size: 20px;
  font-weight: 700;
  display: flex;
  align-items: center;
  justify-content: center;
  flex: none;
}
.shop-info { flex: 1; min-width: 0; }
.shop-info h1 {
  margin: 0;
  font-size: 16px;
  font-weight: 600;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-info p {
  margin: 3px 0 0;
  font-size: 12px;
  color: var(--ink-3);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.shop-points {
  flex: none;
  text-align: right;
  color: var(--red);
}
.shop-points b { display: block; font-size: 18px; font-variant-numeric: tabular-nums; }
.shop-points span { font-size: 10px; color: var(--ink-3); }

/* 搜索 */
.searchbar {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 4px 14px 10px;
  background: var(--surface);
  border-radius: 980px;
  padding: 8px 14px;
}
.search-icon { color: var(--ink-3); font-size: 18px; }
.searchbar input {
  flex: 1;
  border: 0;
  background: transparent;
  outline: none;
  font-size: 14px;
}

/* 分类 */
.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 4px 14px 8px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }
.chip {
  flex: none;
  border: 0;
  border-radius: 6px;
  padding: 7px 12px;
  font-size: 13px;
  background: var(--surface);
  color: var(--ink-2);
  cursor: pointer;
}
.chip.active { background: #ffe8ec; color: var(--red); font-weight: 600; }

/* 排序 */
.sort-tabs {
  display: flex;
  gap: 22px;
  padding: 2px 16px 8px;
  border-bottom: 1px solid var(--line);
}
.sort {
  border: 0;
  background: none;
  padding: 6px 0;
  font-size: 14px;
  color: var(--ink-2);
  cursor: pointer;
  position: relative;
}
.sort.active { color: var(--ink); font-weight: 600; }
.sort.active:after {
  content: "";
  position: absolute;
  left: 50%;
  bottom: -9px;
  transform: translateX(-50%);
  width: 18px;
  height: 3px;
  border-radius: 3px;
  background: var(--red);
}

/* 商品瀑布流 */
.feed {
  column-count: 2;
  column-gap: 8px;
  padding: 10px 8px 20px;
}

.note-card {
  break-inside: avoid;
  margin: 0 0 10px;
  background: #fff;
  border-radius: 8px;
  overflow: hidden;
  cursor: pointer;
}

.note-img {
  position: relative;
  width: 100%;
  background: var(--surface);
  overflow: hidden;
}
.note-img img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.note-img .ph {
  width: 100%;
  height: 100%;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c9c9cf;
  font-size: 40px;
  font-weight: 700;
}

.note-body { padding: 8px 9px 10px; }
.note-title {
  font-size: 13px;
  line-height: 1.4;
  color: var(--ink);
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  min-height: 36px;
}
.note-meta {
  display: flex;
  align-items: baseline;
  gap: 6px;
  margin-top: 6px;
}
.note-points {
  color: var(--red);
  font-size: 15px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}
.note-points small { font-size: 10px; font-weight: 500; margin-left: 1px; }
.note-ref {
  font-size: 11px;
  color: var(--ink-3);
  margin-left: auto;
}
.note-foot {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-3);
}
.add-cart {
  border: 0;
  background: var(--red);
  color: #fff;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  flex: none;
}

/* 购物车 */
.page { padding-bottom: 88px; }
.page-title { padding: 16px 14px 8px; margin: 0; font-size: 18px; }

.cart-list { padding: 0 14px; }
.cart-item {
  display: flex;
  gap: 10px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.cart-item img, .cart-item .ph {
  width: 64px; height: 64px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
  background: var(--surface);
  display: flex;
  align-items: center;
  justify-content: center;
  color: #c9c9cf;
  font-weight: 700;
}
.cart-item .info { flex: 1; min-width: 0; }
.cart-item .name {
  font-size: 13px;
  line-height: 1.4;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
}
.cart-item .price { color: var(--red); font-weight: 700; font-size: 14px; margin-top: 4px; }
.cart-item .remove {
  border: 0; background: none; color: var(--ink-3);
  font-size: 12px; cursor: pointer; align-self: flex-start;
}

.cart-summary {
  display: flex;
  align-items: baseline;
  justify-content: flex-end;
  gap: 6px;
  padding: 14px;
  font-size: 13px;
  color: var(--ink-2);
}
.cart-summary b { color: var(--red); font-size: 22px; }
#checkoutBtn { margin: 0 14px 14px; width: calc(100% - 28px); }

.card {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin: 12px 14px;
}
.card h3 { margin: 0 0 10px; font-size: 15px; }

/* 我的 */
.balance-card {
  margin: 14px;
  padding: 20px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff1f3, #ffe3e8);
}
.balance-card .label { font-size: 12px; color: #b35b66; }
.balance { font-size: 46px; font-weight: 700; color: var(--red); margin: 4px 0 10px; font-variant-numeric: tabular-nums; }
.balance-foot { display: flex; gap: 20px; font-size: 12px; color: #b35b66; }
.balance-foot b { color: var(--ink); }
.handle { margin-top: 8px; font-size: 12px; color: #b35b66; }

.ledger { list-style: none; margin: 0; padding: 0; }
.ledger li {
  display: flex;
  justify-content: space-between;
  gap: 12px;
  padding: 12px 0;
  border-bottom: 1px solid var(--line);
}
.ledger li:last-child { border-bottom: 0; }
.ledger-reason { font-size: 14px; }
.ledger-time { font-size: 11px; color: var(--ink-3); margin-top: 2px; }
.ledger-points { font-weight: 700; font-variant-numeric: tabular-nums; white-space: nowrap; }
.ledger-points.plus { color: var(--red); }
.ledger-points.minus { color: var(--ink-2); }
.ledger .empty, .empty { justify-content: center; color: var(--ink-3); font-size: 13px; padding: 16px 0; text-align: center; }

.badge {
  font-size: 11px;
  padding: 3px 8px;
  border-radius: 980px;
  background: #ffe8ec;
  color: var(--red);
  white-space: nowrap;
}

#logoutBtn { width: calc(100% - 28px); margin: 4px 14px 20px; }

/* 底部标签 */
.tabbar {
  position: fixed;
  left: 0; right: 0; bottom: 0;
  display: flex;
  background: rgba(255, 255, 255, 0.96);
  backdrop-filter: blur(12px);
  border-top: 1px solid var(--line);
  padding: 6px 0 calc(6px + env(safe-area-inset-bottom));
  z-index: 20;
}
.tab {
  position: relative;
  flex: 1;
  border: 0;
  background: none;
  padding: 4px 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  font-size: 10px;
  color: var(--ink-3);
  cursor: pointer;
}
.tab svg { width: 23px; height: 23px; }
.tab.active { color: var(--red); }

.cart-badge {
  position: absolute;
  top: 0;
  left: calc(50% + 8px);
  min-width: 16px;
  height: 16px;
  padding: 0 4px;
  border-radius: 980px;
  background: var(--red);
  color: #fff;
  font-size: 10px;
  line-height: 16px;
  text-align: center;
}

/* 提示 */
.toast {
  position: fixed;
  left: 50%;
  bottom: 96px;
  transform: translate(-50%, 16px);
  background: rgba(29, 29, 31, 0.9);
  color: #fff;
  padding: 10px 18px;
  border-radius: 980px;
  font-size: 13px;
  opacity: 0;
  pointer-events: none;
  transition: all 0.2s ease;
  max-width: 88vw;
  z-index: 40;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: rgba(200, 30, 50, 0.95); }

.pending { color: #b45309; font-weight: 600; margin: 10px 0 4px; }
.warn { color: var(--red); font-size: 13px; }

@media (min-width: 720px) {
  .feed { column-count: 3; }
}

/* 覆盖旧主题残留 */
.chips { background: #fff; }
.sort-tabs { background: #fff; }
.page { background: #fff; }

/* ===== 购物车 / 结算 / 地址 ===== */

body.subpage .cart-bar { bottom: 0; }
body.subpage .tabbar { display: none; }

.subbar {
  position: sticky;
  top: 0;
  z-index: 10;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 48px;
  padding: 0 12px;
  background: #fff;
  border-bottom: 1px solid var(--line);
}
.subbar h2 { margin: 0; font-size: 16px; font-weight: 600; }
.subbar .hint { margin: 0 0 0 auto; font-size: 12px; }
.back {
  border: 0;
  background: none;
  font-size: 26px;
  line-height: 1;
  color: var(--ink);
  padding: 0 4px;
  cursor: pointer;
}

.store-group {
  padding: 14px 14px 6px;
  font-size: 13px;
  font-weight: 600;
  color: var(--ink);
}

.cart-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 12px 14px;
  border-bottom: 1px solid var(--line);
}
.cart-item.readonly { padding-left: 14px; }
.item-check {
  width: 18px;
  height: 18px;
  accent-color: var(--red);
  flex: none;
}
.cart-item img, .cart-item .ph {
  width: 72px; height: 72px;
  border-radius: 8px;
  object-fit: cover;
  flex: none;
  background: var(--surface);
  display: flex; align-items: center; justify-content: center;
  color: #c9c9cf; font-weight: 700;
}
.cart-item .info { flex: 1; min-width: 0; }
.cart-item .name {
  font-size: 13px; line-height: 1.4;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
}
.cart-item .tags { font-size: 11px; color: var(--ink-3); margin-top: 4px; }
.cart-item .price { color: var(--red); font-weight: 700; font-size: 15px; margin-top: 4px; }
.cart-item .qty { color: var(--ink-3); font-weight: 400; font-size: 12px; margin-left: 6px; }
.cart-item .remove { border: 0; background: none; color: var(--ink-3); font-size: 12px; align-self: flex-start; cursor: pointer; }

.cart-bar {
  position: fixed;
  left: 0; right: 0;
  bottom: calc(62px + env(safe-area-inset-bottom));
  z-index: 25;
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 10px 14px calc(10px + env(safe-area-inset-bottom));
  background: #fff;
  border-top: 1px solid var(--line);
}
.check-all { display: flex; align-items: center; gap: 6px; font-size: 13px; color: var(--ink-2); }
.check-all input { width: 18px; height: 18px; accent-color: var(--red); }
.cart-total { margin-left: auto; font-size: 13px; color: var(--ink-2); }
.cart-total b { color: var(--red); font-size: 20px; margin: 0 2px; }
.cart-bar .btn { width: auto; padding: 10px 22px; flex: none; }
.cart-bar .btn:disabled { opacity: 0.5; }

#page-cart { padding-bottom: 150px; }
#page-checkout, #page-address, #page-address-edit { padding-bottom: 120px; }

/* 地址 */
.addr-card {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 12px 14px;
  padding: 16px;
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 10px;
  cursor: pointer;
}
.addr-main { flex: 1; min-width: 0; }
.addr-name { font-size: 14px; font-weight: 600; }
.addr-name span { font-weight: 400; color: var(--ink-2); margin-left: 8px; }
.addr-detail { font-size: 12px; color: var(--ink-2); margin-top: 4px; }
.addr-arrow { color: var(--ink-3); font-size: 22px; }
.addr-empty { display: flex; justify-content: space-between; width: 100%; font-size: 14px; color: var(--ink-2); }

.addr-list { padding: 0 14px; }
.addr-item {
  display: flex;
  gap: 10px;
  padding: 14px 0;
  border-bottom: 1px solid var(--line);
  cursor: pointer;
}
.addr-left { flex: 1; min-width: 0; }
.addr-actions { display: flex; gap: 14px; margin-top: 8px; }
.addr-actions button {
  border: 0; background: none; padding: 0;
  font-size: 12px; color: var(--ink-3); cursor: pointer;
}
.addr-check { color: var(--red); font-size: 18px; align-self: center; }

.privacy {
  margin: 14px;
  padding: 14px;
  border-radius: 10px;
  background: #fafafa;
  position: relative;
}
.privacy b { font-size: 13px; }
.privacy p { margin: 4px 0 0; font-size: 12px; color: var(--ink-3); }
.privacy-on { position: absolute; right: 14px; top: 14px; color: var(--red); font-size: 12px; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); }
.check-line input { width: 18px; height: 18px; accent-color: var(--red); }

.order-summary { padding: 8px 14px 16px; }
.row-line {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 13px;
  color: var(--ink-2);
}
.row-line.total { border-top: 1px solid var(--line); margin-top: 4px; padding-top: 12px; color: var(--ink); }
.row-line.total b { color: var(--red); font-size: 20px; }

/* 明细文字统一黑色（覆盖旧主题的米色） */
.card { color: var(--ink); }
.card h2, .card h3 { color: var(--ink); }
.ledger-reason { color: var(--ink); }
.ledger-time { color: var(--ink-3); }
.balance-card .label, .balance-foot, .handle { color: #b35b66; }

.shop-avatar img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  border-radius: 50%;
  display: block;
}
