/* shared/ui.css — 公共样式：弹窗居中、按钮边线、字段行，落实全系统UI三大铁律
   v1.0 — 2026-08-15 H5 网页端首版 */

* { box-sizing: border-box; }
html, body {
  margin: 0;
  padding: 0;
  background: #f4f6f9;
  color: #111827;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  overflow-x: hidden;
}
a { color: inherit; text-decoration: none; }

.page { min-height: 100vh; padding-bottom: 40px; }

.header {
  background: #15803d;
  padding: 24px 20px 20px;
  color: #fff;
}
.header-title { display: block; font-size: 22px; font-weight: 700; }
.header-sub { display: block; font-size: 14px; color: rgba(255,255,255,.75); margin-top: 4px; }

.card {
  background: #fff;
  border-radius: 12px;
  margin: 16px;
  border: 1px solid #bbf7d0;
  box-shadow: 0 1px 4px rgba(0,0,0,.06);
  overflow: hidden;
}

/* 字段行：标题融合进输入框/紧贴控件，不单独占一行标题 */
.field { padding: 12px 20px; border-bottom: 1px solid #f3f4f6; }
.field:last-child { border-bottom: none; }
.field-row {
  display: flex;
  align-items: center;
  gap: 12px;
}
.field-row .field-name {
  flex: 0 0 auto;
  min-width: 88px;
  font-size: 14px;
  color: #6b7280;
}
.field-row .field-control { flex: 1; min-width: 0; }

input[type="text"], input[type="password"], input[type="tel"], input[type="number"], textarea, select {
  width: 100%;
  height: 36px;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 12px;
  font-size: 14px;
  color: #111827;
}
textarea { min-height: 72px; padding: 10px 12px; resize: vertical; }
input:focus, textarea:focus, select:focus { outline: none; border-color: #15803d; }

/* 全局禁用数字输入框的上下调节箭头 */
input[type="number"] { -moz-appearance: textfield; }
input[type="number"]::-webkit-outer-spin-button,
input[type="number"]::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }

/* 按钮：一律带边线，同角色同文字颜色一致；边线细一些、体积秀气一些 */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 32px;
  padding: 0 16px;
  border-radius: 999px;
  font-size: 13px;
  font-weight: 500;
  border: 1px solid transparent;
  cursor: pointer;
}
.btn-primary { background: #15803d; border-color: #15803d; color: #fff; }
.btn-primary:disabled { opacity: .6; cursor: not-allowed; }
.btn-ghost { background: #fff; border-color: #d1d5db; color: #6b7280; }
.btn-row { display: flex; gap: 12px; margin: 20px 16px 0; }
.btn-row .btn { flex: 1; }

/* 弹窗：必须居中，四角圆角一致，内边距充足 */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(0,0,0,.45);
  display: flex;
  align-items: center;
  justify-content: center;
  z-index: 999;
}
.modal-card {
  width: 400px;
  max-width: 92vw;
  max-height: 84vh;
  background: #fff;
  border-radius: 16px;
  overflow: hidden;
  display: flex;
  flex-direction: column;
}
.modal-header {
  padding: 20px 20px 12px;
  border-bottom: 1px solid #f3f4f6;
  display: flex;
  align-items: center;
  justify-content: space-between;
}
.modal-title { font-size: 18px; font-weight: 700; }
.modal-header-action { flex: 0 0 auto; margin-left: 12px; }
.modal-body { padding: 16px 20px; overflow-y: auto; }
.modal-footer { display: flex; gap: 12px; padding: 12px 20px 20px; }
.modal-footer .btn { flex: 1; }

.select-box {
  display: flex;
  align-items: center;
  justify-content: space-between;
  height: 36px;
  background: #f9fafb;
  border: 1px solid #d1d5db;
  border-radius: 8px;
  padding: 0 12px;
  cursor: pointer;
  font-size: 14px;
}
.select-box.filled { border-color: #15803d; }
.select-placeholder { color: #9ca3af; }
.select-arrow { color: #9ca3af; }

.type-switch { display: flex; border: 1px solid #d1d5db; border-radius: 8px; overflow: hidden; }
.type-opt { flex: 1; text-align: center; height: 32px; line-height: 32px; font-size: 13px; color: #374151; background: #f9fafb; cursor: pointer; }
.type-opt:not(:last-child) { border-right: 1px solid #d1d5db; }
.type-opt.on { color: #fff; background: #15803d; font-weight: 500; }

.tel-link { color: #15803d; font-weight: 600; }

/* 实名认证照片上传格 */
.photo-field { padding: 12px 20px; border-bottom: 1px solid #f3f4f6; }
.photo-field:last-child { border-bottom: none; }
.photo-field-label { font-size: 14px; color: #6b7280; margin-bottom: 8px; }
.photo-box {
  width: 100%;
  height: 120px;
  border: 1px dashed #d1d5db;
  border-radius: 8px;
  background: #f9fafb;
  display: flex;
  align-items: center;
  justify-content: center;
  color: #9ca3af;
  font-size: 13px;
  cursor: pointer;
  overflow: hidden;
  position: relative;
}
.photo-box img { width: 100%; height: 100%; object-fit: cover; }
.section-divider { padding: 14px 20px 6px; font-size: 13px; color: #15803d; font-weight: 600; }

.error-text { color: #dc2626; font-size: 13px; padding: 4px 20px; }

/* 全局提示条：替代小程序 wx.showToast */
#toast-root {
  position: fixed;
  top: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 2000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  align-items: center;
}
.toast-item {
  background: rgba(17,24,39,.9);
  color: #fff;
  font-size: 14px;
  padding: 10px 18px;
  border-radius: 8px;
  max-width: 80vw;
}

/* 商户端底部导航：对齐小程序 app.json tabBar 配色（未选中 #6B7280 / 选中 #15803D） */
.bottom-nav {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  height: 58px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  display: flex;
  z-index: 500;
}
.bottom-nav-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  font-size: 11px;
  color: #6b7280;
}
.bottom-nav-item.active { color: #15803d; font-weight: 600; }
.bottom-nav-icon { width: 24px; height: 24px; }
