* { box-sizing: border-box; }

body {
  margin: 0;
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  font-size: 16px;
  line-height: 1.5;
  color: #222;
  background: #f6f6f6;
}

.page {
  max-width: 480px;
  margin: 0 auto;
  padding: 16px;
}

h1 { font-size: 22px; margin: 24px 0 16px; }

.card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
}

label { display: block; margin-bottom: 8px; color: #555; }

input, textarea, select {
  width: 100%;
  font-family: inherit;
  padding: 12px;
  font-size: 16px; /* 小于 16px 时 iOS 会自动放大页面 */
  border: 1px solid #ddd;
  border-radius: 8px;
}

button {
  width: 100%;
  margin-top: 16px;
  padding: 12px;
  font-size: 16px;
  color: #fff;
  background: #e4572e;
  border: none;
  border-radius: 8px;
}

button:disabled { opacity: 0.6; }

button.secondary { color: #e4572e; background: #fff; border: 1px solid #e4572e; }

.msg { min-height: 24px; margin-top: 12px; color: #d33; }
.msg.ok { color: #2a8a4a; }

/* 我的尺码 */
h2 { font-size: 18px; margin: 0 0 8px; }
h3 { font-size: 17px; margin: 0 0 8px; }
.section-title { margin-top: 24px; }
#garments .card { margin-bottom: 16px; }
.hint { margin: 0 0 12px; font-size: 14px; color: #888; }
.back { display: inline-block; margin-top: 8px; color: #e4572e; text-decoration: none; }
.grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
input + label, input + .hint { margin-top: 12px; }
input[type=checkbox] { width: 20px; height: 20px; margin: 0; }
label.check { display: flex; align-items: center; gap: 8px; margin-top: 8px; font-size: 14px; }
.garment { padding: 12px 0; border-top: 1px solid #eee; }
.garment-head { display: flex; align-items: center; gap: 8px; }
.garment-data { margin: 4px 0; font-size: 14px; color: #555; }
.badge { padding: 0 8px; font-size: 12px; color: #fff; background: #e4572e; border-radius: 10px; }
.actions { display: flex; gap: 8px; }
.actions button { flex: 1; margin-top: 8px; padding: 8px; font-size: 14px; }

/* 添加商品 */
#product-form > .card { margin-bottom: 16px; }
select { background: #fff; }
.grid + label, .chips + .grid, .tag-input + label, .grid + .grid { margin-top: 12px; }
.chips { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
label.chip { position: relative; display: inline-block; margin: 0; }
.chip input { position: absolute; width: 1px; height: 1px; opacity: 0; }
.chip span { display: inline-block; padding: 6px 14px; color: #555; background: #fff; border: 1px solid #ddd; border-radius: 16px; }
.chip input:checked + span { color: #fff; background: #e4572e; border-color: #e4572e; }
.chip input:focus-visible + span { outline: 2px solid #e4572e; outline-offset: 2px; }
.tags { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 8px; }
.tag { display: inline-flex; align-items: center; padding: 4px 4px 4px 12px; background: #fdeee9; border-radius: 16px; }
.tag button { width: auto; margin: 0; padding: 0 8px; font-size: 18px; line-height: 1; color: #e4572e; background: none; }
.tag-input { display: flex; gap: 8px; }
.tag-input button { flex-shrink: 0; width: auto; margin: 0; padding: 0 16px; }
.chart-grid { display: grid; gap: 6px; align-items: center; }
.chart-head { font-size: 13px; color: #888; text-align: center; }
.chart-size { font-weight: bold; text-align: center; overflow-wrap: anywhere; }
.chart-grid input { min-width: 0; padding: 8px 4px; text-align: center; }
.result { margin-top: 12px; padding: 12px; border: 1px solid #eee; border-radius: 8px; }
.result.recommended { border-color: #e4572e; background: #fff8f5; }
.result-score { margin-left: auto; font-size: 14px; color: #888; }
.result-line { margin: 4px 0 0; font-size: 14px; color: #555; }
.result-note { margin: 12px 0 0; color: #e4572e; }

/* 心愿单、详情 */
a.button { display: block; margin-top: 16px; padding: 12px; font-size: 16px; text-align: center; text-decoration: none; color: #fff; background: #e4572e; border: 1px solid #e4572e; border-radius: 8px; }
a.button.secondary { color: #e4572e; background: #fff; }
button.danger { color: #d33; border-color: #d33; }
.top-bar { display: flex; align-items: baseline; justify-content: space-between; }
.has-fab { padding-bottom: 96px; }
.fab { position: fixed; right: 16px; bottom: calc(20px + env(safe-area-inset-bottom)); padding: 12px 20px; font-size: 16px; color: #fff; text-decoration: none; background: #e4572e; border-radius: 24px; box-shadow: 0 4px 12px rgba(228, 87, 46, 0.35); }
.card.product { margin-bottom: 12px; }
.product-link { display: block; color: inherit; text-decoration: none; }
.product-title { display: -webkit-box; margin: 0; overflow: hidden; font-weight: bold; -webkit-line-clamp: 2; -webkit-box-orient: vertical; }
.product-price { display: flex; flex-wrap: wrap; align-items: center; gap: 8px; margin: 6px 0 0; }
.product-price strong { font-size: 18px; color: #e4572e; }
.product-price s { font-size: 14px; color: #999; }
.product-meta { margin: 4px 0 0; font-size: 14px; color: #666; }
.badge.muted { background: #999; }
.actions a.button { flex: 1; margin-top: 8px; padding: 8px; font-size: 14px; }
.card-msg { min-height: 0; margin: 8px 0 0; font-size: 14px; }
.card-msg:empty { display: none; }
.empty { margin-top: 24px; text-align: center; }
.detail-title { font-size: 19px; line-height: 1.4; }
#detail > .card { margin-top: 16px; }
.info-row { display: flex; gap: 12px; padding: 8px 0; font-size: 15px; border-top: 1px solid #f0f0f0; }
.info-row:first-child { border-top: none; }
.info-label { flex-shrink: 0; width: 72px; color: #888; }
.info-value { overflow-wrap: anywhere; }
.detail-actions { margin-top: 16px; }
.detail-actions a.button, .detail-actions button { padding: 12px; font-size: 16px; }
textarea + label, .chips + label { margin-top: 12px; }
