:root {
  --green: #2e8b57;
  --green-dark: #1f6b43;
  --orange: #f5a623;
  --orange-deep: #e88c00;
  --red: #e6402d;
  --bg: #f7f9f6;
  --card: #ffffff;
  --text: #2b2b2b;
  --text-sub: #7a7a7a;
  --line: #ececec;
  --radius: 14px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", "Helvetica Neue", sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  overflow-x: hidden;
}

.page { max-width: 640px; margin: 0 auto; padding-bottom: 120px; }

/* 顶部横幅 */
.hero {
  background: linear-gradient(135deg, #2e8b57 0%, #3aa86f 55%, #7cc47f 100%);
  color: #fff;
  padding: 26px 20px 30px;
  border-radius: 0 0 22px 22px;
}
.hero-sub { font-size: 13px; opacity: 0.92; letter-spacing: 1px; }
.hero-title {
  font-size: 30px; font-weight: 700; margin: 8px 0 6px;
  letter-spacing: 1px;
}
.hero-title .dot { color: #ffe08a; }
.hero-tag { font-size: 13px; opacity: 0.95; }

/* 区块 */
.section { padding: 20px 16px 0; }
.section-title {
  font-size: 16px; font-weight: 700; margin-bottom: 12px;
  padding-left: 10px; position: relative;
}
.section-title::before {
  content: ""; position: absolute; left: 0; top: 3px;
  width: 4px; height: 16px; background: var(--green); border-radius: 2px;
}
.section-hint { font-size: 12px; color: #b0b0b0; font-weight: 400; margin-left: 2px; }

/* 商品卡片 */
.products { display: flex; flex-direction: column; gap: 12px; }
.product {
  background: var(--card); border-radius: var(--radius);
  padding: 14px; display: flex; gap: 14px; align-items: center;
  border: 2px solid transparent; cursor: pointer;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: border-color .15s, box-shadow .15s;
}
.product.selected { border-color: var(--green); box-shadow: 0 4px 14px rgba(46,139,87,0.18); }
.product-img {
  width: 78px; height: 78px; border-radius: 10px; object-fit: cover;
  background: #f0f0f0; flex-shrink: 0;
}
.product-info { flex: 1; min-width: 0; }
.product-name { font-size: 17px; font-weight: 700; }
.product-spec { font-size: 12px; color: var(--text-sub); margin-top: 4px; }
.product-price { margin-top: 8px; }
.product-price .price-num {
  color: var(--red); font-size: 20px; font-weight: 700;
}
.product-price .price-unit { font-size: 12px; color: var(--text-sub); }
.product-check {
  width: 24px; height: 24px; border-radius: 50%; border: 2px solid #ccc;
  flex-shrink: 0; display: flex; align-items: center; justify-content: center;
  color: #fff; font-size: 14px; transition: all .15s;
  align-self: flex-start; margin-top: 4px;
}
.product.selected .product-check { background: var(--green); border-color: var(--green); }

/* 商品卡片内的数量选择器 */
.product-qty {
  display: flex; align-items: center; margin-top: 10px;
}
.product-qty .qty-btn {
  width: 30px; height: 30px; border-radius: 6px;
  font-size: 18px;
}
.product-qty .qty-input {
  width: 44px; text-align: center; font-size: 16px; font-weight: 700;
  margin: 0 6px; border: 1px solid var(--line); border-radius: 6px;
  padding: 3px 0; background: #fff;
  -moz-appearance: textfield;
}
.product-qty .qty-input::-webkit-outer-spin-button,
.product-qty .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* 表单 */
.form { background: var(--card); border-radius: var(--radius); padding: 6px 16px; box-shadow: 0 2px 8px rgba(0,0,0,0.04); }
.field { padding: 12px 0; border-bottom: 1px solid var(--line); }
.field:last-child { border-bottom: none; }
.field label {
  display: block; font-size: 13px; color: var(--text-sub); margin-bottom: 8px;
}
.field input, .field textarea {
  width: 100%; border: none; outline: none; font-size: 16px;
  font-family: inherit; background: transparent; color: var(--text);
}
.field input::placeholder, .field textarea::placeholder { color: #c0c0c0; }
.field textarea { resize: none; line-height: 1.5; }

/* 数量 */
.qty-box { display: flex; align-items: center; }
.qty-btn {
  width: 34px; height: 34px; border-radius: 8px; border: 1px solid var(--line);
  background: #f5f5f5; font-size: 20px; line-height: 1; cursor: pointer;
  color: var(--text); display: flex; align-items: center; justify-content: center;
}
.qty-btn:active { background: #e8e8e8; }
.qty-input {
  width: 60px; text-align: center; font-size: 20px; font-weight: 700;
  margin: 0 10px; border: none; outline: none; -moz-appearance: textfield;
}
.qty-input::-webkit-outer-spin-button, .qty-input::-webkit-inner-spin-button { -webkit-appearance: none; }

/* 底部提交栏 */
.submit-bar {
  position: fixed; left: 0; right: 0; bottom: 0;
  max-width: 640px; width: 100%; margin: 0 auto;
  background: #fff; padding: 12px 16px;
  display: flex; align-items: center; justify-content: space-between;
  box-shadow: 0 -2px 12px rgba(0,0,0,0.08);
  z-index: 10;
  box-sizing: border-box;
}
.total-box { display: flex; align-items: baseline; gap: 6px; }
.total-label { font-size: 13px; color: var(--text-sub); }
.total-amount { font-size: 24px; font-weight: 700; color: var(--red); }
.btn-primary {
  background: linear-gradient(135deg, #ff7a00, #e88c00);
  color: #fff; border: none; border-radius: 24px;
  padding: 12px 34px; font-size: 17px; font-weight: 700; cursor: pointer;
  box-shadow: 0 4px 12px rgba(232,140,0,0.35);
  white-space: nowrap; flex-shrink: 0;
}
.btn-primary:active { opacity: .9; }

.credit { text-align: center; font-size: 12px; color: #b0b0b0; padding: 14px 0 20px; }

/* 弹窗 */
.mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.55);
  display: flex; align-items: center; justify-content: center;
  z-index: 100; padding: 20px;
}
.dialog {
  background: #fff; border-radius: 18px; width: 100%; max-width: 360px;
  padding: 26px 22px; text-align: center;
  animation: pop .2s ease;
}
@keyframes pop { from { transform: scale(.9); opacity: 0; } to { transform: scale(1); opacity: 1; } }
.dialog-title { font-size: 18px; font-weight: 700; margin-bottom: 8px; }
.pay-amount { font-size: 14px; color: var(--text-sub); margin-bottom: 4px; }
.pay-amount-num { color: var(--red); font-size: 28px; font-weight: 700; }
.pay-order { font-size: 12px; color: #b0b0b0; margin-bottom: 14px; }
.paycode-wrap {
  width: 200px; height: 200px; margin: 0 auto 14px;
  border: 1px solid var(--line); border-radius: 12px; padding: 8px;
}
.paycode-wrap img { width: 100%; height: 100%; object-fit: contain; }
.pay-tip { font-size: 13px; color: var(--text-sub); line-height: 1.6; margin-bottom: 6px; }
.pay-tip2 { font-size: 12px; color: #b0b0b0; line-height: 1.5; margin-bottom: 16px; }
/* 付款步骤指引 */
.pay-steps {
  background: #f7f9f7; border-radius: 10px; padding: 12px 14px;
  margin-bottom: 14px; text-align: left;
}
.pay-steps-title { font-size: 13px; font-weight: 700; color: var(--text); margin: 0 0 6px; }
.pay-step-list {
  margin: 0; padding-left: 20px; font-size: 13px; color: var(--text-sub); line-height: 1.9;
}
.pay-step-list .hl { color: #07c160; font-weight: 700; }
.pay-steps-tip { font-size: 12px; color: #b0b0b0; margin: 6px 0 0; }
/* 一键付款按钮 */
.btn-pay-link {
  width: 100%; background: #07c160; color: #fff; border: none;
  border-radius: 24px; padding: 14px; font-size: 17px; font-weight: 700;
  cursor: pointer; margin-bottom: 14px; box-shadow: 0 4px 12px rgba(7,193,96,0.3);
}
.btn-pay-link:active { background: #06ad56; }
.btn-success {
  width: 100%; background: var(--green); color: #fff; border: none;
  border-radius: 24px; padding: 13px; font-size: 16px; font-weight: 700;
  cursor: pointer; margin-bottom: 10px;
}
.btn-success:active { background: var(--green-dark); }
.btn-plain {
  width: 100%; background: none; color: var(--text-sub); border: none;
  padding: 8px; font-size: 14px; cursor: pointer;
}

/* 加载/空态 */
.loading { text-align: center; color: #aaa; padding: 30px 0; font-size: 14px; }

@media (max-width: 480px) {
  .hero-title { font-size: 26px; }
}
