/* wecom-app/public/style.css */
:root {
  --primary: #1677FF;
  --danger: #FF4D4F;
  --success: #52C41A;
  --warning: #FAAD14;
  --bg: #F5F5F5;
  --card: #FFF;
  --text: #333;
  --text2: #888;
  --radius: 12px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, 'Segoe UI', sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 15px;
  line-height: 1.5;
  -webkit-tap-highlight-color: transparent;
}
#app { max-width: 500px; margin: 0 auto; min-height: 100vh; }

/* Tab */
.tab-bar {
  display: flex;
  background: var(--card);
  border-bottom: 1px solid #eee;
  position: sticky;
  top: 0;
  z-index: 10;
}
.tab-btn {
  flex: 1;
  padding: 14px;
  border: none;
  background: none;
  font-size: 15px;
  font-weight: 500;
  color: var(--text2);
  cursor: pointer;
  position: relative;
}
.tab-btn.active {
  color: var(--primary);
}
.tab-btn.active::after {
  content: '';
  position: absolute;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 40px;
  height: 3px;
  background: var(--primary);
  border-radius: 2px;
}

/* Tab content */
.tab-content { display: none; padding: 12px 16px 100px; }
.tab-content.active { display: block; }

/* Quick actions */
.quick-actions {
  display: flex;
  gap: 10px;
  margin-bottom: 12px;
}
.action-btn {
  flex: 1;
  padding: 10px;
  border: 1px solid #ddd;
  border-radius: var(--radius);
  background: var(--card);
  font-size: 14px;
  cursor: pointer;
  color: var(--text);
}

/* Card */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 12px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}

/* Form */
.form-group { margin-bottom: 14px; }
.form-group:last-child { margin-bottom: 0; }
.form-group label { display: block; font-size: 14px; color: var(--text2); margin-bottom: 4px; }
.form-group .req { color: var(--danger); }
.form-group input,
.form-group textarea,
.form-group select {
  width: 100%;
  padding: 10px 12px;
  border: 1px solid #e8e8e8;
  border-radius: 8px;
  font-size: 15px;
  background: #fafafa;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.form-group input:focus,
.form-group textarea:focus {
  border-color: var(--primary);
  background: #fff;
}
.form-group textarea { resize: none; }
.field-hint { font-size: 12px; margin-top: 4px; color: var(--danger); }

/* Province bar */
.province-bar {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: wrap;
  margin-top: 6px;
}
.province-tag {
  display: inline-block;
  padding: 4px 10px;
  border-radius: 6px;
  font-size: 13px;
  font-weight: 500;
}
.province-tag.ok { background: #f6ffed; color: var(--success); border: 1px solid #b7eb8f; }
.province-tag.warn { background: #fffbe6; color: #d48806; border: 1px solid #ffe58f; }
.province-select {
  padding: 6px 10px;
  border: 1px solid #d9d9d9;
  border-radius: 6px;
  font-size: 13px;
}

/* Suggestions */
.suggestions {
  margin-top: 6px;
  display: flex;
  gap: 6px;
  flex-wrap: wrap;
}
.sug-item {
  padding: 5px 10px;
  background: #e6f7ff;
  border: 1px solid #91d5ff;
  border-radius: 6px;
  font-size: 13px;
  cursor: pointer;
  color: var(--primary);
}
.sug-reason { font-size: 11px; color: var(--text2); margin-left: 4px; }

/* Fee card */
.fee-card { border-left: 4px solid var(--primary); }
.fee-header { font-size: 15px; font-weight: 600; color: var(--primary); margin-bottom: 10px; }
.fee-row { display: flex; justify-content: space-between; padding: 4px 0; font-size: 14px; }
.fee-divider { height: 1px; background: #f0f0f0; margin: 8px 0; }
.total-row { padding-top: 8px; }
.fee-label { color: var(--text2); }
.fee-val { font-weight: 500; }
.fee-price { font-size: 20px; font-weight: 700; color: var(--danger); }
.fee-rule { font-size: 12px; color: var(--text2); margin-bottom: 4px; }

/* Submit bar */
.submit-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 20px;
  background: var(--card);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  z-index: 10;
  max-width: 500px;
  margin: 0 auto;
}
.submit-label { font-size: 13px; color: var(--text2); }
.submit-price { font-size: 22px; font-weight: 700; color: var(--danger); margin-left: 8px; }
.submit-btn {
  padding: 12px 28px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}
.submit-btn:disabled {
  background: #d9d9d9;
  color: #999;
  cursor: not-allowed;
}

/* Confirm */
.confirm-title { font-size: 16px; font-weight: 600; margin-bottom: 14px; }
.cinfo-row {
  display: flex;
  justify-content: space-between;
  padding: 8px 0;
  font-size: 14px;
  border-bottom: 1px solid #f5f5f5;
}
.cinfo-row span:first-child { color: var(--text2); flex-shrink: 0; margin-right: 12px; }
.cinfo-row span:last-child { text-align: right; word-break: break-all; }
.cinfo-row .addr { font-size: 13px; }
.cfee-row { display: flex; justify-content: space-between; padding: 8px 0; font-size: 14px;color: var(--text2); }
.cfee-total { text-align: right; padding: 10px 0; font-size: 16px; color: var(--text); }
.cfee-total strong { color: var(--danger); font-size: 22px; }
.confirm-remark { margin-top: 12px; }
.confirm-remark label { font-size: 13px; color: var(--text2); display: block; margin-bottom: 4px; }
.confirm-remark input { width: 100%; padding: 8px 10px; border: 1px solid #e8e8e8; border-radius: 8px; font-size: 14px; }
.confirm-warn { margin-top: 12px; font-size: 13px; color: #d48806; background: #fffbe6; padding: 8px 12px; border-radius: 8px; }
.confirm-bar {
  position: fixed;
  bottom: 0;
  left: 0;
  right: 0;
  display: flex;
  gap: 10px;
  padding: 12px 20px;
  background: var(--card);
  box-shadow: 0 -2px 12px rgba(0,0,0,0.06);
  max-width: 500px;
  margin: 0 auto;
  z-index: 10;
}
.btn-back {
  padding: 12px 20px;
  border: 1px solid #ddd;
  background: #fff;
  border-radius: 10px;
  font-size: 15px;
  cursor: pointer;
  color: var(--text);
}
.btn-pay {
  flex: 1;
  padding: 12px;
  background: var(--primary);
  color: #fff;
  border: none;
  border-radius: 10px;
  font-size: 16px;
  font-weight: 600;
  cursor: pointer;
}

/* Orders */
.order-card { border-left: 4px solid #ddd; }
.order-card:has(.paid) { border-left-color: var(--success); }
.order-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 10px;
}
.order-zone { font-size: 14px; font-weight: 600; }
.order-status {
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 10px;
  font-weight: 500;
}
.order-status.paid { background: #f6ffed; color: var(--success); }
.order-status.pending { background: #fffbe6; color: #d48806; }
.order-status.pending_verify { background: #fff7e6; color: var(--warning); }
.order-body { margin-bottom: 8px; }
.oi-row { display: flex; justify-content: space-between; padding: 3px 0; font-size: 13px; }
.oi-row span:first-child { color: var(--text2); flex-shrink: 0; margin-right: 10px; }
.oi-row .addr { max-width: 200px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.oi-row .price { color: var(--danger); font-weight: 600; }
.order-footer { display: flex; justify-content: space-between; font-size: 11px; color: #bbb; }
.order-no { font-family: monospace; }

/* Empty */
.empty-state { text-align: center; padding: 60px 20px; color: var(--text2); }
.empty-icon { font-size: 48px; margin-bottom: 12px; }

.icp-footer {
  padding: 16px 16px 96px;
  text-align: center;
  font-size: 12px;
  color: var(--text2);
}
.icp-footer a {
  color: inherit;
  text-decoration: none;
}

/* Toast */
.toast {
  position: fixed;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  background: rgba(0,0,0,0.75);
  color: #fff;
  padding: 10px 24px;
  border-radius: 8px;
  font-size: 14px;
  z-index: 999;
  pointer-events: none;
  opacity: 0;
  transition: opacity 0.25s;
}
.toast.show { opacity: 1; }

/* Modal */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 998;
}
.modal-box {
  background: #fff;
  border-radius: 14px;
  width: 85%;
  max-width: 320px;
  overflow: hidden;
}
.modal-title { padding: 18px 20px 8px; font-size: 16px; font-weight: 600; text-align: center; }
.modal-body { padding: 8px 20px 18px; font-size: 14px; color: var(--text2); text-align: center; }
.modal-actions { display: flex; border-top: 1px solid #eee; }
.modal-btn {
  flex: 1;
  padding: 12px;
  border: none;
  background: none;
  font-size: 15px;
  cursor: pointer;
  font-weight: 500;
}
.modal-btn.cancel { color: var(--text2); border-right: 1px solid #eee; }
.modal-btn.confirm { color: var(--primary); }

@media (max-width: 360px) {
  .tab-content { padding: 10px 10px 100px; }
}
