/* style.css v1.0 — 兴农釆 H5 移动端公共样式
   基于微信小程序 WXSS 转换（rpx÷2 = px）
   绿色主题：#15803D */

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }

html, body {
  font-family: -apple-system, "PingFang SC", "Microsoft YaHei", sans-serif;
  background: #f4f6f9;
  min-height: 100vh;
  color: #111827;
  font-size: 15px;
  -webkit-font-smoothing: antialiased;
}

/* ─── 手机宽度限制 ─────────────────────────────────────── */
.app-wrap {
  max-width: 480px;
  margin: 0 auto;
  min-height: 100vh;
  position: relative;
  background: #f4f6f9;
}

/* ─── 导航栏 ──────────────────────────────────────────── */
.nav-bar {
  background: #15803D;
  height: 44px;
  display: flex;
  align-items: center;
  padding: 0 12px;
  position: sticky;
  top: 0;
  z-index: 100;
}
.nav-back {
  width: 32px; height: 32px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(255,255,255,.15);
  border-radius: 50%;
  cursor: pointer;
  flex-shrink: 0;
  font-size: 20px; color: #fff; font-weight: 300;
  border: none;
  user-select: none;
}
.nav-title {
  flex: 1;
  text-align: center;
  font-size: 17px;
  font-weight: 700;
  color: #fff;
  margin-right: 32px;
}
.nav-action {
  font-size: 14px;
  color: rgba(255,255,255,.9);
  cursor: pointer;
  white-space: nowrap;
}

/* ─── 底部 TabBar ──────────────────────────────────────── */
.tab-bar {
  position: fixed;
  bottom: 0; left: 50%;
  transform: translateX(-50%);
  width: 100%; max-width: 480px;
  height: 56px;
  background: #fff;
  border-top: 1px solid #e5e7eb;
  display: flex;
  z-index: 200;
}
.tab-item {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 2px;
  cursor: pointer;
  text-decoration: none;
  color: #6b7280;
  font-size: 11px;
  padding: 4px 0;
}
.tab-item.active { color: #15803D; }
.tab-icon { font-size: 22px; line-height: 1; }
.tab-label { font-size: 10px; }

/* ─── 页面内容区（有 TabBar 时留底部空间）───────────────── */
.page-content { padding-bottom: 64px; }
.page-content.no-tab { padding-bottom: 16px; }

/* ─── 卡片 ────────────────────────────────────────────── */
.card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
  margin: 12px 16px;
  overflow: hidden;
}
.card-header {
  padding: 14px 16px 10px;
  border-bottom: 1px solid #f3f4f6;
  font-weight: 600;
  font-size: 15px;
  color: #111827;
}
.card-body { padding: 14px 16px; }

/* ─── 列表行 ───────────────────────────────────────────── */
.list-item {
  display: flex;
  align-items: center;
  padding: 14px 16px;
  border-bottom: 1px solid #f3f4f6;
  cursor: pointer;
  text-decoration: none;
  color: inherit;
}
.list-item:last-child { border-bottom: none; }
.list-item:active { background: #f9fafb; }
.list-icon { font-size: 20px; margin-right: 12px; flex-shrink: 0; }
.list-label { flex: 1; font-size: 15px; color: #111827; }
.list-value { font-size: 14px; color: #6b7280; }
.list-arrow { font-size: 14px; color: #d1d5db; margin-left: 6px; }

/* ─── 表单 ────────────────────────────────────────────── */
.field { padding: 14px 16px; border-bottom: 1px solid #f3f4f6; }
.field:last-child { border-bottom: none; }
.field-label { font-size: 13px; color: #6b7280; margin-bottom: 6px; display: block; }
.field-input {
  width: 100%;
  height: 44px;
  background: #f9fafb;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  padding: 0 14px;
  font-size: 15px;
  color: #111827;
  outline: none;
  -webkit-appearance: none;
}
.field-input:focus { border-color: #15803D; background: #fff; }
.field-textarea {
  width: 100%;
  min-height: 80px;
  background: #f9fafb;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  padding: 10px 14px;
  font-size: 15px;
  color: #111827;
  resize: none;
  outline: none;
}
.field-textarea:focus { border-color: #15803D; background: #fff; }
.field-value { font-size: 15px; color: #111827; }
.field-hint { font-size: 12px; color: #9ca3af; margin-top: 4px; }

/* ─── 按钮 ────────────────────────────────────────────── */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: 44px;
  padding: 0 20px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  border: 2px solid transparent;
  white-space: nowrap;
  user-select: none;
  transition: opacity .15s;
  text-decoration: none;
}
.btn:active { opacity: .8; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.btn-primary { background: #15803D; color: #fff; border-color: #15803D; }
.btn-secondary { background: #fff; color: #374151; border-color: #d1d5db; }
.btn-danger { background: #fff; color: #dc2626; border-color: #dc2626; }
.btn-full { width: 100%; display: flex; }
.btn-area { padding: 16px; display: flex; gap: 10px; }
.btn-sm { height: 32px; padding: 0 14px; font-size: 13px; border-radius: 999px; border: 1.5px solid; }
.btn-sm-primary { background: #15803D; color: #fff; border-color: #15803D; }
.btn-sm-secondary { background: #fff; color: #374151; border-color: #d1d5db; }

/* ─── 标签 / 状态 ──────────────────────────────────────── */
.badge {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
}
.badge-green  { background: #dcfce7; color: #15803D; }
.badge-blue   { background: #dbeafe; color: #1d4ed8; }
.badge-yellow { background: #fef9c3; color: #a16207; }
.badge-orange { background: #ffedd5; color: #c2410c; }
.badge-red    { background: #fee2e2; color: #dc2626; }
.badge-gray   { background: #f3f4f6; color: #6b7280; }

/* ─── 统计卡片 ─────────────────────────────────────────── */
.stats-row {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  padding: 12px 16px;
}
.stat-card {
  background: #fff;
  border-radius: 12px;
  padding: 16px;
  text-align: center;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
}
.stat-num { font-size: 24px; font-weight: 700; color: #15803D; }
.stat-label { font-size: 12px; color: #6b7280; margin-top: 4px; }

/* ─── 欢迎横幅 ─────────────────────────────────────────── */
.banner {
  background: linear-gradient(135deg, #15803D 0%, #22c55e 100%);
  padding: 20px 16px 16px;
  color: #fff;
}
.banner-name { font-size: 18px; font-weight: 700; }
.banner-desc { font-size: 13px; color: rgba(255,255,255,.8); margin-top: 2px; }
.banner-sub  { font-size: 12px; color: rgba(255,255,255,.7); margin-top: 6px; }

/* ─── 空状态 ───────────────────────────────────────────── */
.empty-state {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 60px 24px;
  color: #9ca3af;
}
.empty-icon { font-size: 48px; margin-bottom: 12px; }
.empty-text { font-size: 14px; }

/* ─── Loading ──────────────────────────────────────────── */
.loading-state {
  display: flex;
  align-items: center;
  justify-content: center;
  padding: 40px;
  color: #6b7280;
  font-size: 14px;
  gap: 8px;
}

/* ─── 分隔线 ───────────────────────────────────────────── */
.divider { height: 1px; background: #f3f4f6; margin: 0 16px; }
.section-title { padding: 14px 16px 6px; font-size: 13px; color: #6b7280; font-weight: 600; }

/* ─── 订单卡片 ─────────────────────────────────────────── */
.order-card {
  background: #fff;
  border-radius: 12px;
  box-shadow: 0 1px 6px rgba(0,0,0,.07);
  margin: 8px 16px;
  padding: 14px 16px;
  cursor: pointer;
}
.order-card:active { background: #f9fafb; }
.order-row1 { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.order-mode { font-size: 11px; font-weight: 600; padding: 2px 6px; border-radius: 4px; background: #f0fdf4; color: #15803D; }
.order-product { flex: 1; font-size: 15px; font-weight: 600; color: #111827; }
.order-amount { font-size: 15px; font-weight: 700; color: #15803D; }
.order-row2 { display: flex; align-items: center; justify-content: space-between; }
.order-no { font-size: 12px; color: #9ca3af; }
.order-status { font-size: 12px; font-weight: 500; }

/* ─── 详情行 ───────────────────────────────────────────── */
.detail-row {
  display: flex;
  justify-content: space-between;
  align-items: flex-start;
  padding: 10px 16px;
  border-bottom: 1px solid #f3f4f6;
  gap: 12px;
}
.detail-row:last-child { border-bottom: none; }
.detail-key { font-size: 13px; color: #6b7280; flex-shrink: 0; }
.detail-val { font-size: 13px; color: #111827; text-align: right; word-break: break-all; }

/* ─── 登录页 ───────────────────────────────────────────── */
.login-page {
  min-height: 100vh;
  background: #15803D;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px 32px;
}
.login-logo-area {
  display: flex;
  flex-direction: column;
  align-items: center;
  margin-bottom: 36px;
}
.login-app-name { font-size: 28px; font-weight: 700; color: #fff; margin-bottom: 4px; }
.login-app-desc { font-size: 13px; color: rgba(255,255,255,.7); }
.login-quick-title { font-size: 13px; color: rgba(255,255,255,.8); margin-bottom: 10px; align-self: flex-start; }
.role-chips {
  display: flex;
  gap: 8px;
  width: 100%;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.role-chip {
  flex: 1;
  min-width: 60px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 10px 4px;
  border-radius: 10px;
  background: rgba(255,255,255,.15);
  border: 2px solid transparent;
  cursor: pointer;
  user-select: none;
  transition: all .15s;
}
.role-chip.active {
  background: rgba(255,255,255,.95);
  border-color: rgba(255,255,255,.9);
}
.role-chip-icon { font-size: 18px; line-height: 1; }
.role-chip-label { font-size: 11px; color: rgba(255,255,255,.85); font-weight: 500; }
.role-chip.active .role-chip-label { color: #15803D; font-weight: 700; }
.login-form-card {
  width: 100%;
  background: #fff;
  border-radius: 20px;
  padding: 28px 20px;
  box-shadow: 0 8px 32px rgba(0,0,0,.15);
}
.login-field { margin-bottom: 16px; position: relative; }
.login-field-label { font-size: 13px; color: #6b7280; margin-bottom: 6px; display: block; }
.login-field-input {
  width: 100%;
  height: 48px;
  background: #f9fafb;
  border: 1.5px solid #d1d5db;
  border-radius: 8px;
  padding: 0 16px;
  font-size: 16px;
  color: #111827;
  outline: none;
}
.login-field-input:focus { border-color: #15803D; background: #fff; }
.pw-toggle { position: absolute; right: 12px; top: 30px; font-size: 13px; color: #6b7280; cursor: pointer; }
.login-error { font-size: 13px; color: #dc2626; text-align: center; margin: 8px 0; min-height: 16px; }
.login-btn {
  width: 100%;
  height: 48px;
  background: #15803D;
  border: 2px solid #15803D;
  border-radius: 999px;
  color: #fff;
  font-size: 16px;
  font-weight: 700;
  cursor: pointer;
  margin-top: 4px;
  transition: opacity .15s;
}
.login-btn:disabled { opacity: .6; cursor: not-allowed; }
.login-links { display: flex; justify-content: space-between; margin-top: 14px; }
.login-link { font-size: 13px; color: #15803D; cursor: pointer; }
.login-footer { margin-top: 24px; font-size: 12px; color: rgba(255,255,255,.45); text-align: center; }

/* ─── 个人中心 / 我的 ──────────────────────────────────── */
.profile-header {
  background: linear-gradient(135deg, #15803D 0%, #22c55e 100%);
  padding: 32px 20px 24px;
  display: flex;
  align-items: center;
  gap: 16px;
}
.avatar {
  width: 60px; height: 60px;
  border-radius: 50%;
  background: rgba(255,255,255,.25);
  display: flex; align-items: center; justify-content: center;
  font-size: 28px;
  flex-shrink: 0;
}
.profile-info { flex: 1; }
.profile-name { font-size: 18px; font-weight: 700; color: #fff; }
.profile-role { font-size: 13px; color: rgba(255,255,255,.75); margin-top: 4px; }

/* ─── 快捷登录入口页 ───────────────────────────────────── */
.entry-page {
  min-height: 100vh;
  background: #15803D;
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 60px 24px 40px;
}
.entry-title { font-size: 32px; font-weight: 800; color: #fff; margin-bottom: 4px; }
.entry-sub { font-size: 14px; color: rgba(255,255,255,.7); margin-bottom: 40px; }
.entry-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  width: 100%;
  max-width: 360px;
}
.entry-card {
  background: #fff;
  border-radius: 16px;
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(0,0,0,.15);
  transition: transform .15s;
  text-decoration: none;
}
.entry-card:active { transform: scale(.97); }
.entry-card-icon { font-size: 36px; }
.entry-card-name { font-size: 15px; font-weight: 700; color: #111827; }
.entry-card-phone { font-size: 11px; color: #9ca3af; }
.entry-admin-btn {
  margin-top: 24px;
  padding: 12px 32px;
  background: rgba(255,255,255,.15);
  border: 1.5px solid rgba(255,255,255,.5);
  border-radius: 999px;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  text-decoration: none;
  display: inline-block;
}
