/* ============================================================
 * 聚仁恒新 · 农户定位地图  —— 样式（移动端优先）
 * ============================================================ */
* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; font-family: -apple-system, "PingFang SC", "Microsoft YaHei", Helvetica, Arial, sans-serif; }
body { position: relative; overflow: hidden; background: #f4f4f4; }

#map { position: absolute; inset: 0; }

/* 顶部栏 */
.topbar {
  position: absolute; top: 0; left: 0; right: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 14px; background: rgba(12, 24, 40, 0.82); color: #fff; backdrop-filter: blur(6px);
}
.topbar-title { font-size: 16px; font-weight: 700; letter-spacing: 1px; }
.topbar-count {
  font-size: 12px; background: rgba(255,255,255,0.18); padding: 3px 10px; border-radius: 12px;
}

/* 图例 */
.legend {
  position: absolute; top: 60px; left: 12px; z-index: 20;
  background: rgba(255,255,255,0.94); border-radius: 10px; padding: 8px 10px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.15); font-size: 12px; color: #333; min-width: 92px;
}
.legend-title { font-weight: 700; margin-bottom: 6px; font-size: 12px; }
.legend-row { display: flex; align-items: center; gap: 6px; margin: 3px 0; }
.legend-row .dot { width: 12px; height: 12px; border-radius: 50%; display: inline-block; }

/* 悬浮按钮 */
.fab-cluster { position: absolute; right: 14px; bottom: 90px; z-index: 20; display: flex; flex-direction: column; gap: 10px; }
.fab {
  border: none; cursor: pointer; font-size: 14px; font-weight: 700; padding: 12px 16px; border-radius: 26px;
  box-shadow: 0 3px 12px rgba(0,0,0,0.25); transition: transform .1s;
}
.fab:active { transform: scale(0.95); }
.fab-primary { background: #1e88e5; color: #fff; }
.fab-ghost { background: rgba(255,255,255,0.95); color: #1e88e5; }

/* 我的位置提示 */
.myloc-tip {
  position: absolute; bottom: 26px; left: 12px; right: 70px; z-index: 20;
  background: rgba(30,136,229,0.92); color: #fff; font-size: 12px; padding: 8px 12px; border-radius: 8px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.2);
}

/* 地图 pin 样式 */
.pin {
  width: 22px; height: 22px; border-radius: 50%; border: 2px solid #fff;
  box-shadow: 0 2px 6px rgba(0,0,0,0.35); position: relative;
}
.pin::after {
  content: ''; position: absolute; left: 50%; top: 100%; transform: translateX(-50%);
  border: 5px solid transparent; border-top: 6px solid #fff;
}
.pin-me::after { border-top-color: #00b96b; }

/* 弹层 */
.overlay {
  position: absolute; inset: 0; z-index: 40; background: rgba(0,0,0,0.35);
  display: flex; align-items: flex-end; justify-content: center;
}
@media (min-width: 640px) { .overlay { align-items: center; } }
.sheet { width: 100%; max-width: 520px; background: #fff; border-radius: 16px 16px 0 0;
  padding: 16px 18px 20px; max-height: 88vh; overflow-y: auto; }
.sheet-list { padding: 16px 10px 20px; }
.farmer-list { max-height: 60vh; overflow-y: auto; }
.fl-item { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid #f2f2f2; cursor: pointer; }
.fl-item:active { background: #f5f9ff; }
.fl-item .dot { width: 12px; height: 12px; border-radius: 50%; flex-shrink: 0; }
.fl-name { font-size: 15px; font-weight: 600; color: #333; flex: 1; }
.fl-meta { font-size: 12px; color: #999; }
@media (min-width: 640px) { .sheet { border-radius: 16px; } }
.sheet-head { display: flex; align-items: center; justify-content: space-between; font-size: 17px; font-weight: 700; margin-bottom: 12px; }
.sheet-head .x { border: none; background: #f0f0f0; width: 30px; height: 30px; border-radius: 50%; font-size: 18px; cursor: pointer; color: #666; }

.field { margin-bottom: 12px; }
.field label { display: block; font-size: 13px; color: #555; margin-bottom: 5px; }
.field label em { color: #e53935; font-style: normal; }
.field input, .field textarea {
  width: 100%; border: 1px solid #dcdcdc; border-radius: 8px; padding: 10px 12px; font-size: 15px; background: #fafafa;
}
.field input:focus, .field textarea:focus { outline: none; border-color: #1e88e5; background: #fff; }

.layer-picker { display: flex; gap: 8px; flex-wrap: wrap; }
.lp { flex: 1; min-width: 60px; padding: 10px 0; border-radius: 8px; border: 1px solid #dcdcdc; background: #fafafa; font-size: 14px; cursor: pointer; color: #444; }
.lp.on { color: #fff; font-weight: 700; }
.btn-layer-big.on { background: #E64340; border-color: #E64340; }
.btn-layer-mid.on { background: #F06200; border-color: #F06200; }
.btn-layer-small.on { background: #2D8CF0; border-color: #2D8CF0; }
.btn-layer-none.on { background: #8A8A8A; border-color: #8A8A8A; }

.loc-row { display: flex; gap: 8px; }
.btn-ghost { flex: 1; padding: 10px 0; border-radius: 8px; border: 1px solid #1e88e5; color: #1e88e5; background: #fff; font-size: 14px; cursor: pointer; }
.loc-preview { margin-top: 8px; font-size: 12px; color: #999; min-height: 16px; }
.loc-preview.ok { color: #1e88e5; font-weight: 600; }

.sheet-actions { display: flex; gap: 10px; margin-top: 16px; }
.btn { flex: 1; padding: 13px 0; border-radius: 10px; border: none; font-size: 16px; font-weight: 700; cursor: pointer; text-align: center; }
.btn-ok { background: #1e88e5; color: #fff; }
.btn-cancel { background: #f0f0f0; color: #555; }
.btn-nav { background: #00b96b; color: #fff; text-decoration: none; }
.btn-fix { background: #ff9800; color: #fff; }

.detail-rows .drow { display: flex; justify-content: space-between; font-size: 14px; padding: 8px 0; border-bottom: 1px solid #f0f0f0; }
.detail-rows .drow span { color: #888; }
.detail-rows .drow b { font-weight: 600; color: #333; }

/* 选点提示 */
.pick-tip {
  position: absolute; top: 60px; left: 50%; transform: translateX(-50%); z-index: 20;
  background: rgba(30,136,229,0.95); color: #fff; font-size: 14px; padding: 10px 18px; border-radius: 24px;
  box-shadow: 0 2px 10px rgba(0,0,0,0.25);
}

/* 启动错误 */
.boot-error { position: absolute; inset: 0; z-index: 60; display: flex; align-items: center; justify-content: center; background: #fff; }
.boot-error-box { text-align: center; color: #333; font-size: 16px; }
.boot-error-box .boot-error-msg { margin-top: 10px; font-size: 13px; color: #e53935; max-width: 320px; padding: 0 20px; }
