/* 所有者：Agent C。“买一点”、小店端、家人收件箱。只用 shop- / merchant- / family- 前缀。
   手机优先：320px 宽不横向滚动；主按钮 ≥52px，其他按钮 ≥44px。 */
.shop-page,
.merchant-page,
.family-inbox {
  --shop-card: #fff;
  --shop-line: var(--line, #e4e1dc);
  --shop-muted: var(--muted, #69645e);
  --shop-accent: var(--orange, #bf4410);
  --shop-accent-dark: var(--orange-dark, #9c3309);
  --shop-pale: var(--orange-pale, #fff0e8);
  --shop-green: var(--green, #38633f);
  --shop-green-pale: var(--green-pale, #edf4e9);
  min-width: 0;
  overflow-wrap: anywhere;
}
.shop-page *,
.merchant-page *,
.family-inbox * {
  min-width: 0;
}
/* 可点区域至少 44px 宽（上面的 min-width: 0 不能把按钮也压窄） */
.shop-page button,
.merchant-page button,
.family-inbox button {
  min-width: 44px;
}
.shop-page button,
.merchant-page button,
.family-inbox button {
  min-height: 44px;
  max-width: 100%;
  white-space: normal;
}
.shop-page button.primary,
.merchant-page button.primary,
.family-inbox button.primary,
.shop-primary,
.merchant-primary,
.family-big {
  min-height: 52px;
}
.shop-page input:not([type="checkbox"]):not([type="radio"]),
.shop-page select,
.merchant-page input,
.merchant-page select {
  min-height: 48px;
  width: 100%;
}

/* ---------- 买一点 ---------- */
.shop-heading {
  margin-bottom: 18px;
}
.shop-heading p {
  margin-top: 10px;
  color: var(--shop-muted);
}
.shop-banner {
  background: var(--shop-green-pale);
  border-radius: 16px;
  padding: 12px 16px;
  margin: 0 0 16px;
  font-size: 1.0625rem;
}
.shop-banner.is-demo {
  background: #fff5e4;
}
/* 手机：一列，顺序为 缺口 → 套餐 → 清单 → 比一比 → 账本；电脑：左右两列。 */
.shop-grid {
  display: flex;
  flex-direction: column;
  gap: 18px;
}
.shop-col {
  display: contents;
}
.shop-area-gaps {
  order: 1;
}
.shop-area-bundles {
  order: 2;
}
.shop-area-list {
  order: 3;
}
.shop-area-compare {
  order: 4;
}
.shop-area-ledger {
  order: 5;
}
.shop-area-gaps,
.shop-area-bundles,
.shop-area-list,
.shop-area-compare,
.shop-area-ledger {
  display: grid;
  gap: 18px;
  min-width: 0;
}
.shop-area-compare:empty {
  display: none;
}
@media (min-width: 900px) {
  .shop-grid {
    display: grid;
    grid-template-columns: minmax(0, 1.25fr) minmax(0, 1fr);
    gap: 28px;
    align-items: start;
  }
  .shop-col {
    display: grid;
    gap: 18px;
    min-width: 0;
  }
}
.shop-card {
  background: var(--shop-card);
  border-radius: 22px;
  padding: 18px;
  box-shadow: var(--shadow, 0 10px 36px #2b241309);
}
@media (min-width: 600px) {
  .shop-card {
    padding: 24px;
  }
}
.shop-card h2 {
  font-size: 1.5rem;
  margin-bottom: 8px;
}
.shop-card h3 {
  font-size: 1.3125rem;
}
.shop-sub {
  color: var(--shop-muted);
  font-size: 1.0625rem;
  margin-bottom: 12px;
}
.shop-fine {
  color: var(--shop-muted);
  font-size: 1rem;
  margin-top: 12px;
}
.shop-note-line {
  margin: 10px 0;
  padding: 10px 14px;
  border-radius: 14px;
  background: #faf7f2;
  font-size: 1.0625rem;
}
.shop-link {
  min-height: 44px;
  padding: 6px 12px;
  margin-left: 6px;
  border-radius: 12px;
  color: var(--shop-accent-dark);
  background: transparent;
  text-decoration: underline;
  text-underline-offset: 4px;
}
.shop-tag {
  display: inline-block;
  border-radius: 999px;
  padding: 2px 10px;
  font-size: 1rem;
  background: #f1eee9;
  color: #4a4540;
  white-space: nowrap;
}
.shop-tag.is-demo {
  background: #ffe8c2;
  color: #6b4300;
}
.shop-tag.is-sell {
  background: var(--shop-green-pale);
  color: var(--shop-green);
}
.shop-gap-list,
.shop-plain-list,
.shop-lines,
.shop-options,
.shop-items,
.shop-ledger-list {
  list-style: none;
  margin: 0;
  padding: 0;
}
.shop-gap {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  padding: 10px 0;
  border-bottom: 1px solid var(--shop-line);
}
.shop-gap:last-child {
  border-bottom: 0;
}
.shop-gap > span:first-child {
  flex: 1 1 200px;
}
.shop-gap.is-decided > span:first-child {
  color: var(--shop-muted);
}
.shop-more summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--shop-accent-dark);
  font-size: 1.0625rem;
}
.shop-plain-list li {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  justify-content: space-between;
  padding: 10px 0;
  border-bottom: 1px solid var(--shop-line);
}
.shop-plain-list li:last-child {
  border-bottom: 0;
}
.shop-secondary {
  min-height: 48px;
  background: #fff;
}
.shop-quiet {
  background: transparent;
  border-color: transparent;
}
.shop-danger {
  color: #a02620;
}
button.primary.shop-danger {
  background: #a02620;
  border-color: #a02620;
  color: #fff;
}
.shop-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 14px;
}
.shop-actions > button {
  flex: 1 1 auto;
}
.shop-bundle {
  border: 2px solid var(--shop-line);
  border-radius: 18px;
  padding: 16px;
  margin-top: 12px;
}
.shop-bundle:first-of-type {
  border-color: var(--shop-accent);
}
.shop-bundle-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.shop-bundle-head h3 {
  margin-right: auto;
}
.shop-line {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 8px 0;
}
.shop-line-text small {
  display: block;
  color: var(--shop-muted);
  font-size: 1rem;
}
.shop-tile {
  flex: none;
  width: 54px;
  height: 54px;
  border-radius: 14px;
  display: inline-grid;
  place-items: center;
  background: var(--shop-pale);
  color: var(--shop-accent-dark);
  font-weight: 700;
  font-size: 1.125rem;
}
.shop-line .photo,
.shop-option .photo,
.shop-item .photo {
  flex: none;
  width: 54px;
  height: 54px;
}
.shop-pickup {
  margin-top: 8px;
  font-size: 1.0625rem;
}
.shop-price {
  font-size: 1rem;
  color: var(--shop-muted);
  margin-top: 4px;
}
.shop-check-line {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 44px;
  margin-top: 8px;
}
.shop-reasons {
  margin-top: 10px;
}
.shop-reasons summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
  color: var(--shop-accent-dark);
  font-size: 1.0625rem;
}
.shop-reason-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  padding-top: 6px;
}
.shop-reason-row button {
  min-height: 44px;
  padding: 6px 14px;
  font-size: 1.0625rem;
}
.shop-group {
  border-top: 1px solid var(--shop-line);
  padding: 4px 0;
}
.shop-group > summary {
  min-height: 52px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  cursor: pointer;
  font-weight: 700;
  font-size: 1.25rem;
}
.shop-group > summary small {
  color: var(--shop-muted);
  font-weight: 400;
}
.shop-option {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px dashed var(--shop-line);
}
.shop-option.is-less-fit {
  opacity: 0.85;
}
.shop-option-main {
  display: flex;
  gap: 12px;
  align-items: flex-start;
}
.shop-pack {
  color: var(--shop-muted);
  font-size: 1rem;
}
.shop-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-top: 6px;
}
.shop-option-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  gap: 10px;
}
.shop-option-actions .shop-reasons {
  margin-top: 0;
  flex: 1 1 160px;
}
.shop-section-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 8px;
}
.shop-section-head h2 {
  margin-bottom: 0;
}
.shop-item {
  display: grid;
  grid-template-columns: auto auto minmax(0, 1fr) auto;
  gap: 10px;
  align-items: start;
  padding: 14px 0;
  border-bottom: 1px solid var(--shop-line);
}
.shop-item.is-checked .shop-item-name {
  text-decoration: line-through;
  color: var(--shop-muted);
}
.shop-item-check {
  min-height: 52px;
  min-width: 44px;
  display: grid;
  place-items: center;
}
.shop-item-check input {
  width: 28px;
  height: 28px;
}
.shop-item-body .shop-pack {
  margin-left: 6px;
}
.shop-item-fields {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 8px;
  margin-top: 8px;
}
/* 窄屏（F）：删除按钮放到勾选框下面，给数量和备注留出宽度 */
@media (max-width: 480px) {
  .shop-item {
    grid-template-columns: auto auto minmax(0, 1fr);
  }
  .shop-item > .shop-item-check {
    grid-column: 1;
    grid-row: 1;
  }
  .shop-item > .shop-remove {
    grid-column: 1;
    grid-row: 2;
    justify-self: center;
  }
  .shop-item > :nth-child(2) {
    grid-column: 2;
    grid-row: 1 / span 2;
  }
  .shop-item > .shop-item-body {
    grid-column: 3;
    grid-row: 1 / span 2;
  }
}
.shop-amount input {
  flex: 1 1 auto;
  min-width: 4.5em;
  width: 100%;
}
@media (min-width: 520px) {
  .shop-item-fields {
    grid-template-columns: minmax(0, 150px) minmax(0, 1fr);
  }
}
.shop-amount {
  display: flex;
  align-items: center;
  gap: 6px;
}
.shop-amount span {
  flex: none;
}
.shop-remove {
  min-width: 48px;
  font-size: 1.375rem;
  padding: 6px 10px;
}
.shop-warn {
  color: #a02620;
  font-size: 1rem;
}
.shop-empty {
  color: var(--shop-muted);
  padding: 10px 0;
}
.shop-confirm {
  margin-top: 12px;
  padding: 14px;
  border-radius: 16px;
  background: #fdecea;
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
}
.shop-confirm p {
  flex: 1 1 100%;
}
.shop-copy {
  display: block;
  margin-top: 12px;
}
.shop-picker {
  border: 1px solid var(--shop-line);
  border-radius: 16px;
  padding: 12px;
  margin-bottom: 12px;
}
.shop-filter {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  margin-bottom: 10px;
}
.shop-filter button {
  min-height: 44px;
  padding: 6px 12px;
  font-size: 1.0625rem;
}
.shop-picker-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(96px, 1fr));
  gap: 8px;
  max-height: 340px;
  overflow-y: auto;
}
.shop-pick {
  display: grid;
  justify-items: center;
  gap: 4px;
  padding: 8px 4px;
  font-size: 1rem;
}
.shop-pick .photo,
.shop-pick .shop-tile {
  width: 54px;
  height: 54px;
}
.shop-ledger-sum {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 8px 0 12px;
}
.shop-ledger-sum div {
  background: #faf7f2;
  border-radius: 14px;
  padding: 10px;
  text-align: center;
}
.shop-ledger-sum dt {
  font-size: 1rem;
  color: var(--shop-muted);
}
.shop-ledger-sum dd {
  margin: 0;
  font-size: 1.375rem;
  font-weight: 700;
}
.shop-exchange {
  background: var(--shop-green-pale);
  color: var(--shop-green);
  border-radius: 14px;
  padding: 10px 14px;
  font-weight: 600;
}
.shop-ledger-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 8px 0;
  border-bottom: 1px solid var(--shop-line);
  font-size: 1.0625rem;
}
.shop-ledger-row > span {
  flex: 1 1 200px;
}
.shop-ledger-form {
  display: grid;
  gap: 10px;
  margin: 12px 0;
  padding: 14px;
  border-radius: 16px;
  background: #faf7f2;
}
.shop-ledger-form label {
  display: grid;
  gap: 4px;
}
.shop-ledger-form fieldset {
  border: 0;
  padding: 0;
  margin: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
}
.shop-ledger-form fieldset label {
  display: flex;
  align-items: center;
  gap: 8px;
  min-height: 44px;
}
.shop-ledger-form input[type="radio"] {
  width: 28px;
  height: 28px;
  accent-color: var(--shop-accent);
}
.shop-form-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 10px;
}

/* ---------- 家人收件箱 ---------- */
.family-inbox {
  background: #fff;
  border-radius: 22px;
  padding: 18px;
}
.family-head {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 10px;
}
.family-head h2 {
  font-size: 1.5rem;
}
.family-count {
  background: var(--shop-accent);
  color: #fff;
  border-radius: 999px;
  padding: 2px 12px;
  font-size: 1rem;
}
.family-role {
  margin: 8px 0 12px;
}
.family-list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: grid;
  gap: 12px;
}
.family-item {
  border: 2px solid var(--shop-line);
  border-radius: 18px;
  padding: 14px;
}
.family-item.is-done {
  border-width: 1px;
}
.family-summary {
  font-size: 1.25rem;
  font-weight: 600;
}
.family-by {
  display: inline-block;
  margin-right: 8px;
  font-size: 1rem;
  font-weight: 400;
  color: var(--shop-muted);
}
.family-when {
  color: var(--shop-muted);
  font-size: 1rem;
  margin-top: 4px;
}
.family-actions {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
  gap: 10px;
  margin-top: 12px;
}
.family-big {
  min-height: 60px;
  font-size: 1.375rem;
}
.family-small {
  min-height: 44px;
}
.family-status {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 10px;
  background: #f1eee9;
  color: #4a4540;
}
.family-status.is-approved {
  background: var(--shop-green-pale);
  color: var(--shop-green);
}
.family-status.is-declined {
  background: #fdecea;
  color: #a02620;
}
.family-status.is-pending {
  background: #fff5e4;
  color: #6b4300;
}
.family-empty {
  color: var(--shop-muted);
}
.family-history {
  margin-top: 12px;
}
.family-history summary {
  min-height: 44px;
  display: flex;
  align-items: center;
  cursor: pointer;
}
.family-switch {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  padding-top: 12px;
  border-top: 1px dashed var(--shop-line);
  font-size: 1rem;
}
.family-switch > span {
  flex: 1 1 100%;
  color: var(--shop-muted);
}
.family-switch button {
  min-height: 44px;
  font-size: 1.0625rem;
  padding: 6px 12px;
}
.family-note {
  margin-top: 10px;
  color: var(--shop-muted);
  font-size: 1rem;
}

/* ---------- 小店端 ---------- */
.merchant-heading {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-start;
  justify-content: space-between;
  gap: 12px;
  margin-bottom: 14px;
}
.merchant-heading p {
  margin-top: 8px;
  color: var(--shop-muted);
}
.merchant-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  padding: 6px;
  background: #eae9e6;
  border-radius: 18px;
  margin-bottom: 16px;
}
.merchant-tabs button {
  flex: 1 1 auto;
  min-height: 48px;
  border: 0;
  background: transparent;
  font-size: 1.0625rem;
  padding: 6px 12px;
}
.merchant-tabs button.active {
  background: #fff;
  color: var(--shop-accent-dark);
}
.merchant-body {
  display: grid;
  gap: 18px;
}
@media (min-width: 900px) {
  .merchant-body {
    grid-template-columns: repeat(2, minmax(0, 1fr));
    align-items: start;
  }
}
.merchant-card {
  background: #fff;
  border-radius: 22px;
  padding: 18px;
}
.merchant-card h2 {
  font-size: 1.5rem;
  margin-bottom: 6px;
}
.merchant-card h3 {
  font-size: 1.1875rem;
  margin-top: 12px;
}
.merchant-sub {
  color: var(--shop-muted);
  font-size: 1rem;
}
.merchant-note {
  margin-top: 12px;
  color: var(--shop-muted);
  font-size: 1rem;
}
.merchant-form {
  display: grid;
  gap: 12px;
  margin-top: 12px;
}
.merchant-form label {
  display: grid;
  gap: 4px;
}
.merchant-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr);
  gap: 10px;
  align-items: end;
}
@media (min-width: 420px) {
  .merchant-row {
    grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  }
}
.merchant-keep-box {
  background: #fff5e4;
  border-left: 6px solid var(--shop-accent);
  padding: 10px 14px;
  border-radius: 12px;
}
.merchant-keep:empty {
  display: none;
}
.merchant-week {
  border-top: 1px solid var(--shop-line);
  padding-top: 6px;
  margin-top: 8px;
}
.merchant-week ul,
.merchant-plain,
.merchant-lessons,
.merchant-demand {
  list-style: none;
  margin: 0;
  padding: 0;
}
.merchant-week li,
.merchant-plain > li {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  padding: 6px 0;
}
.merchant-week li.is-pile {
  font-weight: 700;
}
.merchant-tag {
  display: inline-block;
  border-radius: 999px;
  padding: 1px 10px;
  font-size: 1rem;
  background: #f1eee9;
}
.merchant-tag.is-warn {
  background: #fdecea;
  color: #a02620;
}
.merchant-hint {
  font-size: 1rem;
  color: var(--shop-accent-dark);
}
.merchant-demand li {
  padding: 12px 0;
  border-bottom: 1px solid var(--shop-line);
}
.merchant-demand-head {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  justify-content: space-between;
  font-size: 1.1875rem;
}
.merchant-lessons li {
  display: grid;
  gap: 8px;
  padding: 12px 0;
  border-bottom: 1px solid var(--shop-line);
}
.merchant-lessons li.is-done p {
  color: var(--shop-muted);
}
.merchant-lessons p {
  font-size: 1.1875rem;
}
.merchant-bundle,
.merchant-price {
  border-bottom: 1px solid var(--shop-line);
}
.merchant-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.merchant-small {
  min-height: 44px;
  padding: 6px 14px;
  font-size: 1.0625rem;
}
.merchant-danger {
  color: #a02620;
}
.merchant-price {
  display: grid;
  gap: 8px;
  padding: 10px 0;
}
@media (min-width: 560px) {
  .merchant-price {
    grid-template-columns: minmax(0, 1fr) auto;
    align-items: center;
  }
}
.merchant-price-form {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
}
.merchant-inline {
  display: flex;
  align-items: center;
  gap: 6px;
  flex: 1 1 170px;
}
.merchant-inline span {
  flex: none;
  font-size: 1rem;
}
.merchant-page .merchant-inline input {
  width: 100%;
  max-width: 140px;
}
