:root {
  --primary: #16a34a;
  --primary-dark: #15803d;
  --danger: #dc2626;
  --pending: #d97706;
  --bg: #f5f5f5;
  --text: #222;
  --muted: #888;
  --border: #e5e7eb;
}

* {
  box-sizing: border-box;
}

html,
body {
  margin: 0;
  padding: 0;
}

body {
  font-family: -apple-system, BlinkMacSystemFont, 'PingFang SC', 'Microsoft YaHei', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-font-smoothing: antialiased;
}

.card {
  max-width: 420px;
  margin: 24px auto;
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 2px 12px rgba(0, 0, 0, 0.06);
  padding: 20px 18px 24px;
}

/* 品牌区 */
.brand {
  text-align: center;
}
.logo {
  width: 56px;
  height: 56px;
  margin: 0 auto 8px;
  border-radius: 50%;
  background: #ecfdf5;
  font-size: 30px;
  line-height: 56px;
  text-align: center;
}
.title {
  font-size: 19px;
  font-weight: 700;
  margin: 0 0 10px;
}
.desc {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  margin: 0 0 18px;
}

/* 表单 */
.field {
  display: block;
  margin-bottom: 14px;
}
.label {
  display: block;
  font-size: 13px;
  color: #555;
  margin-bottom: 6px;
}
.input {
  width: 100%;
  height: 44px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  font-size: 15px;
  outline: none;
  transition: border-color 0.15s;
}
.input:focus {
  border-color: var(--primary);
}
.input:disabled {
  background: #f3f4f6;
  color: #9ca3af;
}

.hint {
  display: block;
  min-height: 18px;
  margin-top: 6px;
  font-size: 12px;
  color: var(--muted);
}
.hint.ok {
  color: var(--primary);
}
.hint.err {
  color: var(--danger);
}

/* 按钮 */
.btn-primary {
  width: 100%;
  height: 46px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
  transition: background 0.15s, opacity 0.15s;
}
.btn-primary:active {
  background: var(--primary-dark);
}
.btn-primary:disabled {
  background: #cbd5e1;
  cursor: not-allowed;
}
.btn-cancel {
  flex: 1;
  height: 44px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #fff;
  color: #555;
  font-size: 15px;
  cursor: pointer;
}

/* 二维码入口 */
.qr-entry {
  margin-top: 14px;
  text-align: center;
}
.btn-qr {
  display: inline-block;
  padding: 8px 16px;
  border: 1px dashed var(--primary);
  border-radius: 8px;
  color: var(--primary);
  font-size: 13px;
  cursor: pointer;
}
.btn-qr span {
  cursor: pointer;
}

/* 订单记录 */
.orders {
  margin-top: 24px;
  border-top: 1px solid var(--border);
  padding-top: 16px;
}
.orders-title {
  font-size: 15px;
  font-weight: 600;
  margin: 0 0 12px;
}
.order-list .empty {
  font-size: 13px;
  color: var(--muted);
  text-align: center;
  padding: 16px 0;
}
.order-item {
  border: 1px solid var(--border);
  border-radius: 10px;
  padding: 12px;
  margin-bottom: 12px;
  background: #fafafa;
}
.order-row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 3px 0;
}
.order-row span {
  color: var(--muted);
}
.order-row b {
  color: var(--text);
  font-weight: 600;
  word-break: break-all;
  text-align: right;
  max-width: 65%;
}
.status {
  padding: 1px 8px;
  border-radius: 10px;
  font-size: 12px;
}
.status.ok {
  background: #dcfce7;
  color: var(--primary-dark);
}
.status.err {
  background: #fee2e2;
  color: var(--danger);
}
.status.pending {
  background: #fef3c7;
  color: var(--pending);
}
.btn-voucher {
  width: 100%;
  margin-top: 10px;
  height: 40px;
  border: none;
  border-radius: 8px;
  background: var(--primary);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}

/* 弹窗 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0, 0, 0, 0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 20px;
  z-index: 50;
}
.modal-mask[hidden] {
  display: none;
}
.modal {
  width: 100%;
  max-width: 360px;
  background: #fff;
  border-radius: 14px;
  padding: 20px;
}
.modal-title {
  font-size: 17px;
  font-weight: 700;
  margin: 0 0 16px;
  text-align: center;
}
.account {
  display: flex;
  align-items: center;
  gap: 14px;
  margin-bottom: 18px;
}
.avatar {
  width: 56px;
  height: 56px;
  border-radius: 50%;
  border: 1px solid var(--border);
  flex-shrink: 0;
}
.account-rows {
  flex: 1;
  min-width: 0;
}
.account-rows .row {
  display: flex;
  justify-content: space-between;
  font-size: 13px;
  padding: 4px 0;
}
.account-rows .row span {
  color: var(--muted);
}
.account-rows .row b {
  font-weight: 600;
  word-break: break-all;
  text-align: right;
  max-width: 60%;
}
.account-rows .coins {
  color: var(--primary);
}
.modal-actions {
  display: flex;
  gap: 12px;
}
.modal-actions .btn-primary {
  flex: 1;
}

/* 凭证弹层 */
.voucher-modal {
  max-width: 380px;
}
.voucher-img {
  width: 100%;
  border-radius: 10px;
  border: 1px solid var(--border);
  display: block;
  margin-bottom: 14px;
}

/* Toast */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translateX(-50%);
  background: rgba(0, 0, 0, 0.82);
  color: #fff;
  font-size: 13px;
  padding: 10px 18px;
  border-radius: 20px;
  z-index: 100;
  max-width: 80%;
  text-align: center;
}
.toast[hidden] {
  display: none;
}
