:root {
  --soil: #243d32;
  --soil-deep: #14241c;
  --crop: #d4b36a;
  --crop-hot: #e8c57a;
  --field: #f4f7f2;
  --ink: #152018;
  --muted: #5b6b61;
  --line: rgba(20, 36, 28, 0.12);
  --glass: rgba(248, 251, 247, 0.88);
  --glass-strong: rgba(255, 255, 255, 0.94);
  --shadow: 0 10px 32px rgba(12, 24, 18, 0.18);
  --shadow-soft: 0 4px 16px rgba(12, 24, 18, 0.12);
  --radius: 14px;
  --radius-sm: 10px;
  --safe-b: env(safe-area-inset-bottom, 0px);
  --safe-t: env(safe-area-inset-top, 0px);
  --bar-h: 3.35rem;
  --font: "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body {
  margin: 0;
  height: 100%;
  height: 100dvh;
  max-height: 100dvh;
  overflow: hidden;
  font-family: var(--font);
  color: var(--ink);
  background: var(--soil-deep);
  overscroll-behavior: none;
  touch-action: manipulation;
  -webkit-tap-highlight-color: transparent;
}
.bar {
  position: absolute;
  z-index: 6;
  top: 0; left: 0; right: 0;
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.65rem;
  align-items: center;
  padding: calc(0.55rem + var(--safe-t)) 0.85rem 0.55rem;
  background: linear-gradient(180deg, rgba(20,36,28,0.96), rgba(20,36,28,0.78));
  color: var(--field);
  border-bottom: 1px solid rgba(255,255,255,0.06);
  backdrop-filter: blur(12px);
  -webkit-backdrop-filter: blur(12px);
}
.brand {
  font-weight: 700;
  letter-spacing: 0.06em;
  margin-right: 0.35rem;
  font-size: 0.95rem;
}
.brand-link {
  margin-left: 0.4rem;
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--crop);
  text-decoration: none;
  border: 1px solid rgba(212, 179, 106, 0.5);
  border-radius: 999px;
  padding: 0.14rem 0.55rem;
  vertical-align: middle;
}
.brand-patrol-dd {
  display: inline-block;
  position: relative;
  margin-left: 0.25rem;
  vertical-align: middle;
}
.brand-patrol-dd > summary {
  list-style: none;
  cursor: pointer;
  user-select: none;
}
.brand-patrol-dd > summary::-webkit-details-marker { display: none; }
.brand-patrol-menu {
  position: absolute;
  top: calc(100% + 0.25rem);
  left: 0;
  z-index: 80;
  min-width: 8.5rem;
  padding: 0.35rem;
  border-radius: 10px;
  border: 1px solid var(--line, #d6dde6);
  background: #fff;
  box-shadow: 0 10px 28px rgba(8, 14, 12, 0.18);
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
}
.brand-patrol-menu a {
  display: block;
  padding: 0.4rem 0.55rem;
  border-radius: 8px;
  color: #0f172a;
  text-decoration: none;
  font-size: 0.8rem;
  font-weight: 600;
}
.brand-patrol-menu a:hover { background: rgba(14, 116, 144, 0.1); }
.field {
  display: inline-flex;
  gap: 0.35rem;
  align-items: center;
  font-size: 0.8rem;
}
.field input {
  width: 5.5rem;
  padding: 0.32rem 0.5rem;
  border: 1px solid rgba(232,239,230,0.22);
  border-radius: 8px;
  background: rgba(0,0,0,0.28);
  color: var(--field);
}
.btn {
  border: 0;
  border-radius: 999px;
  padding: 0.38rem 0.85rem;
  background: var(--crop);
  color: var(--soil-deep);
  font-weight: 650;
  cursor: pointer;
  font: inherit;
  font-size: 0.82rem;
  box-shadow: 0 1px 0 rgba(255,255,255,0.25) inset;
}
.btn.ghost {
  background: rgba(255,255,255,0.06);
  color: var(--field);
  border: 1px solid rgba(232, 239, 230, 0.28);
  box-shadow: none;
}
.btn.ghost.active,
#btnBase.active {
  background: rgba(212, 179, 106, 0.28);
  border-color: var(--crop);
  color: #f5e6c0;
  font-weight: 700;
}
.btn:active { transform: scale(0.98); }

/* 切底图：右上角带尾巴气泡（不挡按钮字） */
#btnBase.has-base-bubble {
  position: relative;
  overflow: visible;
  z-index: 2;
}
#btnBase .base-map-lab { pointer-events: none; }
#btnBase .base-map-bubble {
  position: absolute;
  right: -0.05rem;
  top: -0.38rem;
  z-index: 3;
  max-width: 2.6rem;
  padding: 0.04rem 0.28rem;
  border-radius: 6px 6px 3px 6px;
  font-size: 0.52rem;
  font-weight: 700;
  letter-spacing: 0.01em;
  line-height: 1.2;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: #2a2118;
  background: #e6b07a;
  border: 1px solid rgba(255, 248, 235, 0.65);
  box-shadow: 0 1px 5px rgba(40, 24, 12, 0.22);
  pointer-events: none;
}
/* 小尾巴朝按钮右上角 */
#btnBase .base-map-bubble::after {
  content: '';
  position: absolute;
  right: 0.28rem;
  bottom: -0.22rem;
  width: 0;
  height: 0;
  border-left: 0.22rem solid transparent;
  border-right: 0.14rem solid transparent;
  border-top: 0.24rem solid #e6b07a;
  filter: drop-shadow(0 1px 1px rgba(40, 24, 12, 0.1));
}
#btnBase.active .base-map-bubble {
  background: #efc08e;
  color: #2a2118;
}
#btnBase.active .base-map-bubble::after {
  border-top-color: #efc08e;
}
#btnBase .base-map-bubble.is-pop {
  animation: baseBubblePop 0.85s ease-out;
}
@keyframes baseBubblePop {
  0% { transform: translate(0.08rem, 0.12rem) scale(0.86); opacity: 0.35; }
  40% { transform: translate(0, -0.04rem) scale(1.06); opacity: 1; }
  100% { transform: none; opacity: 1; }
}
/* 矢量沙盘：顶栏略提亮，提示已离卫星 */
body.map-sandbox .bar {
  box-shadow: 0 1px 0 rgba(212, 179, 106, 0.35);
}
body.map-sandbox #status {
  color: #d4b36a;
}
/* 描红台：本地传图 → 描边 → 导出 → 沙盘
   全屏层必须 pointer-events:none，否则挡住地图画笔与贴图对齐观感 */
.redline-desk {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: calc(var(--bar-h) + 0.6rem) 0.6rem 0.6rem;
  background: transparent;
  pointer-events: none;
}
.redline-desk.hidden { display: none; }
.redline-desk-card {
  pointer-events: auto;
  width: min(22rem, 94vw);
  max-height: calc(100vh - var(--bar-h) - 1.4rem);
  overflow: auto;
  padding: 0.85rem 0.95rem 1rem;
  background: var(--glass-strong);
  border: 1px solid rgba(248, 113, 113, 0.45);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  color: #f8fafc;
}
.redline-desk.is-drawing .redline-desk-card {
  width: min(18.5rem, 92vw);
  max-height: min(42vh, calc(100vh - var(--bar-h) - 1.4rem));
  box-shadow: 0 10px 28px rgba(185, 28, 28, 0.45);
}
.redline-desk.is-drawing .redline-steps {
  display: none;
}
.redline-desk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.45rem;
}
.redline-desk-card h3 {
  margin: 0;
  font-size: 1rem;
  font-weight: 700;
  color: #fecaca;
}
.redline-x {
  width: 2rem;
  height: 2rem;
  border: 0;
  border-radius: 999px;
  background: rgba(255, 255, 255, 0.08);
  color: #fff;
  font-size: 1.25rem;
  line-height: 1;
  cursor: pointer;
}
.redline-steps {
  margin: 0 0 0.65rem;
  padding-left: 1.15rem;
  font-size: 0.78rem;
  line-height: 1.45;
  color: #cbd5e1;
}
.redline-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.4rem 0;
}
.redline-actions .btn { flex: 1 1 auto; }
#btnRedline.active {
  background: rgba(248, 113, 113, 0.35);
  border-color: #f87171;
  color: #fee2e2;
  font-weight: 700;
}
body.map-redline-drawing #drawHud {
  border-color: rgba(248, 113, 113, 0.55);
  color: #fecaca;
}
.redline-align {
  margin: 0.35rem 0 0.5rem;
  padding: 0.45rem 0.5rem;
  border: 1px solid rgba(248, 113, 113, 0.28);
  border-radius: 10px;
  background: rgba(127, 29, 29, 0.18);
}
.redline-align-lab {
  display: block;
  font-size: 0.75rem;
  font-weight: 600;
  color: #fecaca;
  margin-bottom: 0.3rem;
}
.redline-align-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
}
.redline-align-grid .btn {
  min-width: 2.2rem;
  flex: 0 0 auto;
  padding: 0.28rem 0.45rem;
}
/* 周边范围面板 */
.nearby-desk {
  position: fixed;
  inset: 0;
  z-index: 40;
  display: flex;
  align-items: flex-start;
  justify-content: flex-end;
  padding: calc(var(--bar-h) + 0.6rem) 0.6rem 0.6rem;
  background: rgba(8, 14, 12, 0.28);
  pointer-events: auto;
}
.nearby-desk.hidden { display: none !important; }
.detect-pick-desk {
  align-items: center;
  justify-content: center;
  padding-top: calc(var(--bar-h) + 1.2rem);
  z-index: 90;
}
.detect-pick-card {
  width: min(22.5rem, 94vw);
  border-color: rgba(202, 138, 4, 0.55);
}
.detect-pick-card h3 {
  color: #fde68a;
}
.detect-pick-actions {
  display: flex;
  flex-direction: column;
  gap: 0.55rem;
  margin: 0.55rem 0 0.65rem;
}
.detect-pick-btn {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 0.22rem;
  width: 100%;
  margin: 0;
  padding: 0.7rem 0.85rem;
  text-align: left;
  border-radius: 12px;
  white-space: normal;
  line-height: 1.35;
}
.detect-pick-btn strong {
  font-size: 0.98rem;
  font-weight: 780;
}
.detect-pick-btn span {
  font-size: 0.78rem;
  font-weight: 500;
  opacity: 0.9;
}
.detect-pick-btn.is-hidden,
.detect-pick-btn[hidden] {
  display: none !important;
}
.detect-pick-quad {
  background: rgba(21, 128, 61, 0.22);
  border-color: rgba(74, 222, 128, 0.55);
  color: #ecfdf5;
}
#quadMuDesk .mark-field input {
  width: 100%;
  margin-top: 0.25rem;
  padding: 0.45rem 0.55rem;
  border-radius: 8px;
  border: 1px solid rgba(250, 204, 21, 0.45);
  background: rgba(15, 23, 42, 0.55);
  color: #fffbeb;
  font: inherit;
  font-size: 1.05rem;
  font-weight: 700;
}
.detect-pick-lasso {
  background: rgba(14, 116, 144, 0.22);
  border-color: rgba(34, 211, 238, 0.5);
  color: #ecfeff;
}
.detect-pick-whole {
  background: rgba(202, 138, 4, 0.2);
  border-color: rgba(250, 204, 21, 0.5);
  color: #fffbeb;
}
.nearby-desk-card {
  width: min(22rem, 94vw);
  max-height: calc(100vh - var(--bar-h) - 1.4rem);
  overflow: auto;
  padding: 0.85rem 0.95rem 1rem;
  background: var(--glass-strong);
  border: 1px solid rgba(37, 99, 235, 0.4);
  border-radius: 14px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, 0.35);
  backdrop-filter: blur(14px);
  color: #f8fafc;
  pointer-events: auto;
}
.nearby-desk-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.nearby-desk-card h3 {
  margin: 0;
  font-size: 1rem;
  color: #bfdbfe;
}
.nearby-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.65rem;
}
.nearby-chips label {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.28rem 0.5rem;
  border-radius: 999px;
  border: 1px solid rgba(148, 163, 184, 0.35);
  background: rgba(15, 23, 42, 0.35);
  font-size: 0.78rem;
  cursor: pointer;
  user-select: none;
}
.nearby-chips label.is-on {
  border-color: rgba(96, 165, 250, 0.75);
  background: rgba(37, 99, 235, 0.28);
  color: #dbeafe;
}
.nearby-chips label.is-geo::after {
  content: '界';
  font-size: 0.65rem;
  opacity: 0.7;
  margin-left: 0.1rem;
}
#btnTowns.active {
  background: rgba(37, 99, 235, 0.32);
  border-color: #60a5fa;
  color: #dbeafe;
  font-weight: 700;
}
.ops-more-btn { display: none; }
.ops-tools {
  display: contents;
}
.gps-hud {
  position: absolute;
  z-index: 4;
  left: 0.75rem;
  top: calc(var(--bar-h) + 3.4rem);
  max-width: min(92vw, 22rem);
  padding: 0.5rem 0.75rem;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: var(--radius-sm);
  font-size: 0.78rem;
  line-height: 1.35;
  box-shadow: var(--shadow-soft);
  backdrop-filter: blur(10px);
}
.gps-hud.hidden { display: none; }
.gps-dot {
  width: 14px;
  height: 14px;
  border-radius: 50%;
  background: #2563eb;
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.35);
}
.bar-right {
  margin-left: auto;
  display: inline-flex;
  align-items: center;
  gap: 0.4rem;
  flex: 0 0 auto;
}
.status {
  font-size: 0.78rem;
  opacity: 0.88;
  max-width: 22rem;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.patrol-hint {
  margin: 0 0 0.65rem;
  font-size: 0.82rem;
  color: var(--muted);
  line-height: 1.45;
}
.patrol-qr {
  display: grid;
  place-items: center;
  margin: 0.35rem 0 0.75rem;
  min-height: 180px;
}
.patrol-qr img {
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-soft);
}
.patrol-url {
  width: 100%;
  margin-bottom: 0.75rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font-size: 0.78rem;
  background: #f6f8f4;
}
.parcel-card {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  box-sizing: border-box;
  font-size: 0.84rem;
  color: var(--ink);
}
.parcel-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 0.55rem;
  margin-bottom: 0.55rem;
}
.parcel-card-title {
  font-weight: 750;
  font-size: 1.02rem;
  line-height: 1.3;
  letter-spacing: 0.01em;
}
.parcel-card-pill {
  flex: 0 0 auto;
  padding: 0.16rem 0.55rem;
  border-radius: 999px;
  font-size: 0.72rem;
  font-weight: 700;
  background: #eef2ea;
  color: var(--muted);
  white-space: nowrap;
}
.parcel-card-pill.ok {
  background: rgba(21, 128, 61, 0.14);
  color: #15803d;
}
.parcel-card-pill.warn {
  background: rgba(180, 83, 9, 0.14);
  color: #b45309;
}
.parcel-card-pill.none {
  background: repeating-linear-gradient(
    -45deg,
    rgba(100, 116, 139, 0.22),
    rgba(100, 116, 139, 0.22) 4px,
    rgba(100, 116, 139, 0.08) 4px,
    rgba(100, 116, 139, 0.08) 8px
  );
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.35);
}
.parcel-card-party {
  padding: 0.45rem 0.55rem;
  margin-bottom: 0.45rem;
  border-radius: 12px;
  background: rgba(248, 250, 246, 0.92);
  border: 1px solid rgba(28, 46, 36, 0.06);
}
.parcel-card-line {
  display: flex;
  justify-content: space-between;
  gap: 0.65rem;
  margin-top: 0.22rem;
  line-height: 1.35;
}
.parcel-card-k {
  color: var(--muted);
  font-size: 0.76rem;
  flex: 0 0 auto;
}
.parcel-card-v {
  text-align: right;
  font-weight: 600;
  color: var(--ink);
}
.parcel-card-mu {
  display: flex;
  flex-direction: column;
  gap: 0.12rem;
  margin: 0.35rem 0 0.5rem;
  padding: 0.5rem 0.6rem;
  border-radius: 12px;
  background: linear-gradient(135deg, rgba(212, 179, 106, 0.18), rgba(255, 255, 255, 0.65));
  border: 1px solid rgba(180, 83, 9, 0.16);
}
.parcel-card-mu-main {
  font-size: 1.05rem;
  font-weight: 750;
  color: #b45309;
}
.parcel-card-mu-sub {
  font-size: 0.75rem;
  color: var(--muted);
}
.parcel-card-biz { margin-top: 0.15rem; }
.parcel-card-rent {
  margin: 0.35rem 0 0.2rem;
  font-size: 0.9rem;
  color: #b91c1c;
}
.parcel-card-rent b { font-size: 1.05rem; }
.parcel-card-miss {
  margin-top: 0.45rem;
  padding: 0.4rem 0.55rem;
  border-radius: 10px;
  background: rgba(180, 83, 9, 0.1);
  color: #9a3412;
  font-size: 0.78rem;
  line-height: 1.35;
}
.parcel-card-mu b { color: #b45309; }
.btn.soft,
a.btn.soft {
  background: rgba(21, 128, 61, 0.12);
  color: #15803d;
  border: 1px solid rgba(21, 128, 61, 0.25);
  box-shadow: none;
  text-decoration: none;
}
.well-row {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 0.35rem;
  cursor: default;
}
.well-row-main {
  display: block;
  width: 100%;
  text-align: left;
  border: 0;
  background: transparent;
  padding: 0;
  cursor: pointer;
  font: inherit;
  color: inherit;
}
.maplibregl-popup-content {
  padding: 0.85rem 0.95rem 0.95rem !important;
  border-radius: 16px !important;
  box-shadow: 0 16px 40px rgba(12, 24, 18, 0.2) !important;
  border: 1px solid rgba(255, 255, 255, 0.75);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 247, 0.94)) !important;
  backdrop-filter: blur(12px);
}
/* 地图点地块详情：PC 限高可滚；手机改底栏小片，避免挡满屏 */
.maplibregl-popup.parcel-detail-popup {
  z-index: 12;
}
.maplibregl-popup.parcel-detail-popup .maplibregl-popup-content {
  max-height: min(72vh, 36rem);
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0.75rem 0.85rem 0.8rem !important;
}
.maplibregl-popup.parcel-detail-popup .popup-actions {
  position: sticky;
  bottom: -0.15rem;
  margin-top: 0.55rem;
  padding-top: 0.45rem;
  background: linear-gradient(180deg, rgba(255,255,255,0), #fff 28%);
}
/* 名单定位：仅弹出出租方人名 */
.maplibregl-popup.owner-name-callout .maplibregl-popup-content {
  padding: 0 !important;
  border: 0 !important;
  background: transparent !important;
  box-shadow: none !important;
  backdrop-filter: none;
}
.maplibregl-popup.owner-name-callout .maplibregl-popup-tip {
  border-top-color: #ea580c;
}
.owner-name-bubble {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 0.12rem;
  min-width: 5.5rem;
  padding: 0.55rem 0.9rem 0.6rem;
  border-radius: 999px;
  background: linear-gradient(180deg, #fb923c, #ea580c);
  color: #fff7ed;
  box-shadow: 0 10px 28px rgba(234, 88, 12, 0.45), 0 0 0 3px rgba(255, 237, 213, 0.85);
  animation: owner-name-pop 0.55s cubic-bezier(0.22, 1.35, 0.36, 1);
  text-align: center;
  line-height: 1.2;
}
.owner-name-lab {
  font-size: 0.68rem;
  font-weight: 650;
  letter-spacing: 0.08em;
  opacity: 0.92;
}
.owner-name-who {
  font-size: 1.15rem;
  font-weight: 800;
  letter-spacing: 0.04em;
}
.owner-name-parcel {
  font-size: 0.72rem;
  opacity: 0.9;
  max-width: 10rem;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@keyframes owner-name-pop {
  0% { transform: scale(0.35) translateY(12px); opacity: 0; }
  60% { transform: scale(1.08) translateY(-2px); opacity: 1; }
  100% { transform: scale(1) translateY(0); opacity: 1; }
}
.maplibregl-popup-content .popup-actions button.lease-link {
  flex: 1 1 auto;
  background: linear-gradient(180deg, #3a8f58, #15803d);
  color: #fff;
  border: 0;
  border-radius: 999px;
  padding: 0.4rem 0.75rem;
  font-weight: 650;
  cursor: pointer;
  box-shadow: 0 4px 12px rgba(21, 128, 61, 0.28);
}
.maplibregl-popup-content .popup-actions button.lease-link.soft {
  background: rgba(21, 128, 61, 0.12);
  color: #15803d;
  box-shadow: none;
  border: 1px solid rgba(21, 128, 61, 0.25);
}
.maplibregl-popup-content .popup-actions button.lease-link.danger {
  background: #fff;
  color: #b91c1c;
  border: 1px solid rgba(185, 28, 28, 0.35);
  box-shadow: none;
}
#map {
  position: absolute;
  inset: 0;
  z-index: 0;
  width: 100%;
  height: 100%;
  background: #c5c9c2;
}
#map .maplibregl-canvas { outline: none; }
#map .maplibregl-canvas.drawing,
#map .maplibregl-canvas-container.drawing,
#map .maplibregl-canvas-container.drawing .maplibregl-canvas {
  cursor: crosshair !important;
  touch-action: none;
}
#map .maplibregl-marker .draft-pin { pointer-events: none; }

.legend {
  position: absolute;
  z-index: 3;
  left: 0.75rem;
  bottom: 1.5rem;
  font-size: 0.8rem;
  max-width: 11.5rem;
}
.legend.collapsed { max-width: none; }
/* PC：默认只留圆钮；悬停/展开才出抽屉，少挡地貌 */
@media (min-width: 721px) and (hover: hover) {
  .legend.collapsed .legend-dot.acrylic-fab {
    width: 2.55rem;
    height: 2.55rem;
    font-size: 0.82rem;
  }
  .mark-bar:not(.is-open) .mark-fab.acrylic-fab {
    width: 2.55rem;
    height: 2.55rem;
    font-size: 0.82rem;
  }
}
/* 缩放/指南针在 #map 内，只能放在「浮层没盖住」的空隙里 */
#map .maplibregl-ctrl-top-right {
  top: calc(var(--bar-h) + 0.4rem);
  right: 0.65rem;
}
#map .maplibregl-ctrl-bottom-right {
  bottom: 1.35rem;
  right: 0.55rem;
}
/* PC 右侧坞顶边 = 顶栏 + 缩放组高度，避免挡住 +/- 与指南针 */
@media (min-width: 721px) {
  .parcel-dock,
  .parcel-dock.is-collapsed {
    top: calc(var(--bar-h) + 7.35rem);
  }
}
/* PC：展开图例在左下，高度受限可滚，不顶穿画笔条 */
@media (min-width: 721px) {
  .legend:not(.collapsed) {
    z-index: 5;
    top: auto;
    bottom: 1.25rem;
    left: 0.75rem;
    max-width: 13.5rem;
    max-height: min(48vh, 22rem);
    display: block;
  }
  .legend:not(.collapsed) .legend-body {
    max-height: min(48vh, 22rem);
    overflow: auto;
    overscroll-behavior: contain;
  }
  .legend:not(.collapsed) .legend-head {
    position: sticky;
    top: 0;
    z-index: 2;
    margin: -0.15rem -0.25rem 0.45rem;
    padding: 0.35rem 0.4rem 0.45rem;
    background: rgba(248, 250, 246, 0.96);
    backdrop-filter: blur(8px);
    border-bottom: 1px solid var(--line);
  }
}
.legend-dot.acrylic-fab {
  width: 3.1rem;
  height: 3.1rem;
  font-size: 0.92rem;
}
.legend-dot:hover { filter: brightness(1.05); }
.legend-icons {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 0.45rem 0.5rem;
  margin: 0.45rem 0 0.55rem;
  font-size: 0.72rem;
  color: var(--ink);
}
.legend-icons span {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  min-height: 1.55rem;
  padding: 0.2rem 0.28rem;
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.55);
  border: 1px solid rgba(28, 46, 36, 0.08);
  white-space: nowrap;
}
.legend-icons img {
  flex: 0 0 auto;
  width: 18px;
  height: 18px;
  border-radius: 999px;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.08);
}
.legend:not(.collapsed) .legend-dot { display: none; }
.legend-body {
  padding: 0.7rem 0.85rem;
  border-radius: var(--radius);
  border: 1px solid rgba(255, 255, 255, 0.7);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.88), rgba(248, 251, 247, 0.78));
  backdrop-filter: blur(16px) saturate(1.35);
  -webkit-backdrop-filter: blur(16px) saturate(1.35);
  box-shadow: var(--shadow), 0 1px 0 rgba(255, 255, 255, 0.85) inset;
}
.legend.collapsed .legend-body { display: none; }
.legend-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 0.5rem;
  margin-bottom: 0.35rem;
}
.legend-title { font-weight: 700; }
.legend-toggles,
.legend-detail {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin: 0.35rem 0 0.55rem;
}
.legend-detail-title {
  font-size: 0.72rem;
  font-weight: 650;
  color: var(--muted);
  margin-top: 0.15rem;
}
.legend-check {
  display: flex;
  align-items: center;
  gap: 0.35rem;
  cursor: pointer;
  font-size: 0.8rem;
  line-height: 1.3;
  user-select: none;
}
.legend-check input {
  margin: 0;
  flex-shrink: 0;
}
.legend-rich-fields {
  display: flex;
  flex-direction: column;
  gap: 0.22rem;
  margin: 0 0 0.55rem;
  padding: 0.4rem 0.45rem;
  border-radius: 8px;
  background: rgba(20, 56, 34, 0.05);
  border: 1px solid rgba(20, 56, 34, 0.08);
}
.legend-rich-fields.is-hidden,
.legend-rich-fields[hidden] { display: none !important; }
.legend:not(.collapsed) {
  max-width: 16.5rem;
}
.parcel-card-rich-toggles {
  display: flex;
  flex-wrap: wrap;
  gap: 0.25rem 0.55rem;
  margin: 0.45rem 0 0.35rem;
  padding-top: 0.35rem;
  border-top: 1px solid rgba(20, 56, 34, 0.1);
  font-size: 0.72rem;
}
.parcel-card-rich-toggles label {
  display: inline-flex;
  align-items: center;
  gap: 0.2rem;
  margin: 0.1rem 0.35rem 0.1rem 0;
  font-size: 0.72rem;
  cursor: pointer;
  color: var(--muted);
}
.legend-close {
  border: 0;
  background: transparent;
  color: var(--ink);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  opacity: 0.5;
  padding: 0 0.15rem;
}
.legend-close:hover { opacity: 1; }
.legend-crops {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 0.28rem 0.4rem;
  margin: 0.2rem 0 0.35rem;
  font-size: 0.7rem;
  max-height: none;
  overflow: hidden;
}
.legend-crops.is-collapsed {
  max-height: 5.5rem; /* 约两行 */
}
@media (min-width: 900px) {
  .legend-crops { grid-template-columns: repeat(3, minmax(0, 1fr)); }
}
.legend-crop-row {
  display: flex;
  align-items: center;
  gap: 0.28rem;
  min-width: 0;
  line-height: 1.15;
}
.legend-crop-row .swatch { margin-right: 0; flex-shrink: 0; width: 0.72rem; height: 0.72rem; }
.legend-crop-row img {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
  object-fit: contain;
  vertical-align: middle;
}
.legend-crop-row span {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.legend-crops-more {
  display: block;
  width: 100%;
  margin: 0 0 0.55rem;
  padding: 0.28rem 0.4rem;
  border: 1px dashed var(--line);
  border-radius: 8px;
  background: rgba(255,255,255,0.65);
  color: var(--muted);
  font: inherit;
  font-size: 0.72rem;
  cursor: pointer;
}
.legend-crops-more.is-hidden,
.legend-crops-more[hidden] { display: none !important; }
.mark-crop-preview {
  margin: 0.15rem 0 0;
  font-size: 0.78rem;
  display: flex;
  align-items: center;
  gap: 0.4rem;
}
.mark-crop-preview .swatch {
  width: 1rem;
  height: 1rem;
  border-radius: 4px;
  border: 1px solid var(--line);
}
.merge-bar {
  position: absolute;
  z-index: 7;
  top: calc(var(--bar-h) + 0.35rem);
  left: 50%;
  transform: translateX(-50%);
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 0.4rem;
  max-width: min(94vw, 28rem);
  padding: 0.4rem 0.65rem;
  background: var(--glass-strong);
  border: 1px solid var(--line);
  border-radius: 999px;
  box-shadow: var(--shadow);
  font-size: 0.8rem;
  color: var(--soil-deep);
}
.merge-bar.is-hidden,
.merge-bar[hidden] { display: none !important; }
.merge-bar .btn { padding: 0.28rem 0.7rem; font-size: 0.78rem; }
.swatch {
  display: inline-block;
  width: 0.85rem;
  height: 0.85rem;
  margin-right: 0.35rem;
  vertical-align: -0.1rem;
  border-radius: 3px;
}
.swatch.parcel { background: rgba(47, 122, 74, 0.45); border: 1.5px solid #2f7a4a; }
.swatch.cand { background: rgba(234, 179, 8, 0.4); border: 1.5px dashed #ca8a04; }
.swatch.town-jl { background: rgba(37, 99, 235, 0.25); border: 1.5px solid #2563eb; }
.swatch.town-xl { background: rgba(124, 58, 237, 0.22); border: 1.5px dashed #7c3aed; }
.swatch.town-xh { background: rgba(5, 150, 105, 0.25); border: 1.5px solid #059669; }
.swatch.anno { background: rgba(196, 92, 38, 0.45); border: 1.5px solid #a33c12; }
.swatch.boundary { background: transparent; border: 2px solid #b45309; border-radius: 2px; }
.swatch.plot { background: rgba(13, 148, 136, 0.35); border: 1.5px solid #0f766e; }
.swatch.well {
  background: #0284c7;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px #0369a1;
  border-radius: 999px;
}
.swatch.gps {
  background: #2563eb;
  border: 1.5px solid #fff;
  box-shadow: 0 0 0 1px #2563eb;
}
.btn.hidden { display: none; }

/* —— 亚克力悬浮钮（画 / 图 / 地块） —— */
.acrylic-fab {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 3.25rem;
  height: 3.25rem;
  padding: 0;
  border: 1px solid rgba(255, 255, 255, 0.72);
  border-radius: 999px;
  background:
    linear-gradient(155deg, rgba(255, 255, 255, 0.78) 0%, rgba(236, 247, 232, 0.55) 48%, rgba(212, 179, 106, 0.28) 100%);
  color: var(--soil-deep);
  font-weight: 800;
  font-size: 0.95rem;
  font: inherit;
  font-weight: 800;
  cursor: pointer;
  overflow: hidden;
  backdrop-filter: blur(18px) saturate(1.45);
  -webkit-backdrop-filter: blur(18px) saturate(1.45);
  box-shadow:
    0 10px 28px rgba(12, 24, 18, 0.2),
    0 1px 0 rgba(255, 255, 255, 0.85) inset,
    0 -1px 0 rgba(20, 36, 28, 0.06) inset;
  animation: acrylicBreath 2.8s ease-in-out infinite;
  z-index: 2;
}
.acrylic-fab .fab-glow {
  position: absolute;
  inset: -40%;
  background: radial-gradient(circle at 30% 25%, rgba(255, 255, 255, 0.7), transparent 55%);
  pointer-events: none;
  animation: acrylicShine 4.2s ease-in-out infinite;
}
.acrylic-fab .mark-fab-lab,
.acrylic-fab .legend-fab-lab,
.acrylic-fab .parcel-fab-lab {
  position: relative;
  z-index: 1;
  letter-spacing: 0.04em;
}
.acrylic-fab:hover {
  transform: translateY(-1px) scale(1.04);
}
.acrylic-fab.is-on,
.mark-fab.is-on {
  background:
    linear-gradient(155deg, rgba(20, 36, 28, 0.92) 0%, rgba(36, 61, 50, 0.88) 100%);
  color: var(--crop);
  border-color: rgba(212, 179, 106, 0.55);
  animation: acrylicBreathOn 1.8s ease-in-out infinite;
}
@keyframes acrylicBreath {
  0%, 100% {
    box-shadow:
      0 10px 28px rgba(12, 24, 18, 0.2),
      0 1px 0 rgba(255, 255, 255, 0.85) inset,
      0 0 0 0 rgba(212, 179, 106, 0);
  }
  50% {
    box-shadow:
      0 12px 32px rgba(12, 24, 18, 0.24),
      0 1px 0 rgba(255, 255, 255, 0.9) inset,
      0 0 0 6px rgba(212, 179, 106, 0.18);
  }
}
@keyframes acrylicBreathOn {
  0%, 100% { box-shadow: 0 10px 28px rgba(12, 24, 18, 0.28), 0 0 0 0 rgba(212, 179, 106, 0.15); }
  50% { box-shadow: 0 12px 34px rgba(12, 24, 18, 0.32), 0 0 0 7px rgba(212, 179, 106, 0.28); }
}
@keyframes acrylicShine {
  0%, 100% { transform: translate(-8%, -6%) rotate(0deg); opacity: 0.85; }
  50% { transform: translate(10%, 8%) rotate(12deg); opacity: 1; }
}
@media (prefers-reduced-motion: reduce) {
  .acrylic-fab,
  .acrylic-fab .fab-glow { animation: none; }
}

.mark-bar {
  position: absolute;
  z-index: 5;
  top: calc(var(--bar-h) + 0.45rem);
  left: 0.75rem;
  right: auto;
  display: flex;
  flex-direction: column;
  flex-wrap: nowrap;
  gap: 0.45rem;
  align-items: flex-start;
  max-width: min(calc(100vw - 5.5rem), 26rem);
  overflow: visible;
}
.mark-fab {
  /* 全端默认显示亚克力圆钮 */
  flex: 0 0 auto;
}
.mark-sheet {
  display: none;
  flex-wrap: wrap;
  gap: 0.3rem;
  align-items: center;
  max-width: min(72vw, 18rem);
  padding: 0.45rem 0.5rem 0.55rem;
  border-radius: 14px;
  border: 1px solid rgba(255, 255, 255, 0.65);
  background: linear-gradient(160deg, rgba(255, 255, 255, 0.82), rgba(248, 251, 247, 0.72));
  backdrop-filter: blur(16px) saturate(1.35);
  -webkit-backdrop-filter: blur(16px) saturate(1.35);
  box-shadow: var(--shadow), 0 1px 0 rgba(255, 255, 255, 0.8) inset;
}
.mark-bar.is-open .mark-sheet,
.mark-bar.is-peek .mark-sheet {
  display: flex;
  animation: sheetPop 0.22s ease-out;
}
.legend.is-peek.collapsed .legend-body {
  display: block !important;
}
.legend.is-peek.collapsed .legend-dot { display: none; }
.legend.is-peek.collapsed {
  max-width: 13.5rem;
  z-index: 6;
}
@keyframes sheetPop {
  from { opacity: 0; transform: translateY(-6px) scale(0.96); }
  to { opacity: 1; transform: none; }
}
.stroke-mode-bar {
  display: flex;
  flex-wrap: wrap;
  gap: 0.28rem;
  width: 100%;
  margin: 0.15rem 0 0.25rem;
}
.stroke-mode-btn {
  flex: 1 1 auto;
  min-width: 4.2rem;
  margin: 0;
  padding: 0.32rem 0.45rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.72);
  color: var(--ink);
  font: inherit;
  font-size: 0.78rem;
  font-weight: 650;
  cursor: pointer;
}
.stroke-mode-btn.is-on {
  background: rgba(21, 128, 61, 0.16);
  border-color: rgba(21, 128, 61, 0.45);
  color: #166534;
  font-weight: 750;
}
.stroke-mode-btn[data-stroke="detect"].is-on,
.stroke-mode-btn[data-stroke="detect"]:active {
  background: rgba(14, 116, 144, 0.14);
  border-color: rgba(14, 116, 144, 0.4);
  color: #0e7490;
}
.stroke-mode-hint,
#mapRoleTip.stroke-mode-hint {
  flex: 0 0 100%;
  width: 100%;
  max-width: 100%;
  margin: 0 0 0.35rem;
  font-size: 0.72rem;
  line-height: 1.35;
  color: var(--muted);
  white-space: normal;
}
.redline-desk .stroke-mode-bar {
  margin-top: 0.35rem;
}
.mark-sheet-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  flex: 0 0 100%;
  width: 100%;
  gap: 0.35rem;
  margin-bottom: 0.1rem;
  font-size: 0.75rem;
  font-weight: 700;
  color: var(--muted);
  position: relative;
  z-index: 2;
}
.mark-sheet-head > span {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.mark-sheet-close {
  flex: 0 0 auto;
  border: 0;
  background: rgba(20, 36, 28, 0.06);
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  font-size: 1.05rem;
  line-height: 1;
  cursor: pointer;
  color: var(--ink);
  opacity: 0.85;
  position: relative;
  z-index: 3;
}
.mark-sheet-close:hover { opacity: 1; background: rgba(20, 36, 28, 0.12); }
.mark-draw-tip {
  flex: 0 0 100%;
  width: 100%;
  margin: 0 0 0.3rem;
  padding: 0.35rem 0.45rem;
  border-radius: 8px;
  background: rgba(15, 23, 42, 0.88);
  color: #f8fafc;
  font-size: 0.72rem;
  line-height: 1.35;
  white-space: normal;
  word-break: break-word;
}
.mark-draw-tip.hidden { display: none; }
.btn.mark {
  flex: 0 0 auto;
  white-space: nowrap;
  background: rgba(255, 255, 255, 0.88);
  color: var(--soil-deep);
  border: 1px solid var(--line);
  font-size: 0.8rem;
  padding: 0.34rem 0.7rem;
  box-shadow: var(--shadow-soft);
  border-radius: 999px;
  line-height: 1.25;
  min-height: 2rem;
  width: auto;
  height: auto;
}
.btn.mark.active {
  background: var(--crop);
  border-color: transparent;
  color: var(--soil-deep);
}
.mark-bar .color-dock,
.mark-bar .pen-width,
.mark-bar .btn.ghost {
  flex: 0 0 auto;
  white-space: nowrap;
}
/* 画中：完成/撤点/取消 实心不透明，避免看不清 */
.mark-bar .btn.mark-draw-act {
  flex: 0 0 auto;
  min-width: 3.2rem;
  font-weight: 800;
  opacity: 1 !important;
  box-shadow: 0 2px 10px rgba(8, 16, 12, 0.22);
}
.mark-bar .btn.mark-draw-ok {
  background: #15803d !important;
  border: 1px solid #166534 !important;
  color: #fff !important;
}
.mark-bar .btn.mark-draw-undo {
  background: #fff7ed !important;
  border: 1px solid #ea580c !important;
  color: #9a3412 !important;
}
.mark-bar .btn.mark-draw-cancel {
  background: #fef2f2 !important;
  border: 1px solid #dc2626 !important;
  color: #991b1b !important;
}
.color-dock {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
}
.color-dock.is-hidden { display: none; }
.color-dock.is-dot .color-palette { display: none; }
.pen-width {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.12rem 0.45rem;
  background: var(--glass-strong);
  border-radius: 999px;
  border: 1px solid var(--line);
  font-size: 0.72rem;
  font-weight: 700;
  color: var(--soil-deep);
  box-shadow: var(--shadow-soft);
}
.pen-width.is-hidden { display: none; }
.pen-width input[type="range"] {
  width: 4.6rem;
  margin: 0;
  accent-color: #b45309;
}
.color-dot {
  width: 1.25rem;
  height: 1.25rem;
  padding: 0;
  border-radius: 50%;
  border: 2px solid #fff;
  background: #FF2222;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.35), 0 1px 4px rgba(0,0,0,0.2);
  cursor: pointer;
}
.color-palette {
  display: inline-flex;
  align-items: center;
  gap: 0.28rem;
  padding: 0.18rem 0.3rem;
  background: var(--glass-strong);
  border-radius: 999px;
  border: 1px solid var(--line);
}
.draw-catcher {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 3;
  cursor: crosshair;
  touch-action: none;
  background: transparent;
}
.draw-catcher.on { display: block; }
.draw-hud {
  position: absolute;
  z-index: 4;
  left: 50%;
  bottom: calc(1.1rem + var(--safe-b));
  transform: translateX(-50%);
  max-width: min(92vw, 28rem);
  padding: 0.45rem 0.95rem;
  border-radius: 999px;
  background: rgba(17, 17, 17, 0.9);
  color: #fff;
  font-size: 0.84rem;
  pointer-events: none;
  white-space: nowrap;
  box-shadow: var(--shadow-soft);
}
.draw-hud.hidden { display: none; }
.swatch-btn {
  width: 1.35rem;
  height: 1.35rem;
  border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.14);
  padding: 0;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.35);
}
.swatch-btn.active {
  outline: 2px solid #0f172a;
  outline-offset: 1px;
  transform: scale(1.12);
}
.pen-preview {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 2.4rem;
  height: 1.55rem;
  padding: 0 0.45rem;
  border-radius: 6px;
  font-size: 0.72rem;
  font-weight: 700;
  color: #fff;
  background: #FF2222;
  border: 1px solid rgba(0,0,0,0.25);
  text-shadow: 0 1px 1px rgba(0,0,0,0.45);
}
.draft-pin { box-sizing: border-box; }
.mark-modal {
  position: fixed;
  z-index: 120;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  background: rgba(12, 20, 16, 0.48);
  padding: calc(0.7rem + var(--safe-t, 0px)) 0.75rem calc(0.75rem + var(--safe-b));
  box-sizing: border-box;
  pointer-events: auto;
}
.mark-modal.hidden { display: none !important; }
.mark-modal-card {
  display: flex;
  flex-direction: column;
  width: min(92vw, 28rem);
  max-height: min(84dvh, 84vh, 40rem);
  overflow: hidden;
  padding: 0.85rem 1rem 0.7rem;
  border-radius: 16px;
  background: #fff;
  color: var(--ink);
  box-shadow: 0 22px 56px rgba(8, 16, 12, 0.32);
  border: 1px solid rgba(28, 46, 36, 0.12);
  backdrop-filter: blur(16px);
  pointer-events: auto;
  box-sizing: border-box;
}
/* 无 mark-modal-body 的弹窗（补全土地/派单等）：整卡可滚，避免保存按钮被裁掉 */
.mark-modal-card:not(:has(> .mark-modal-body)) {
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}
.mark-modal-card h3 {
  flex: 0 0 auto;
  margin: 0 0 0.55rem;
  font-size: 1.05rem;
  font-weight: 750;
}
.mark-modal-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  overflow-x: hidden;
  -webkit-overflow-scrolling: touch;
  padding-right: 0.2rem;
  padding-bottom: 0.25rem;
}
.mark-field {
  display: flex;
  flex-direction: column;
  gap: 0.28rem;
  margin-bottom: 0.65rem;
  font-size: 0.85rem;
  position: relative;
}
.mark-field-aside {
  position: absolute;
  top: 0;
  right: 0;
  font-size: 0.78rem;
  font-weight: 650;
}
.mark-inline-link {
  color: #15803d;
  text-decoration: none;
  border-bottom: 1px solid rgba(21, 128, 61, 0.35);
}
.mark-inline-link:hover { color: #166534; }
.mark-field input,
.mark-field textarea,
.mark-field select {
  width: 100%;
  padding: 0.5rem 0.6rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  background: #fff;
  box-sizing: border-box;
}
.mark-field input[type="checkbox"],
.mark-field input[type="radio"],
.mark-check input[type="checkbox"],
.mark-check input[type="radio"] {
  width: auto !important;
  min-width: 1rem;
  max-width: 1.1rem;
  height: 1rem;
  margin: 0.2rem 0 0;
  padding: 0;
  flex: 0 0 auto;
  accent-color: #15803d;
}
.mark-field textarea { resize: vertical; }
.mark-field select { resize: none; }
.mark-parcel-wrap.is-hidden,
.mark-parcel-wrap[hidden] { display: none !important; }
.mark-parcel-wrap {
  display: flex;
  flex-direction: column;
  gap: 0.35rem;
}
.mark-parcel-wrap > span { font-size: 0.82rem; color: var(--muted); }
.mark-check {
  display: flex;
  flex-direction: row;
  align-items: flex-start;
  gap: 0.45rem;
  font-size: 0.84rem;
  line-height: 1.4;
  cursor: pointer;
}
.mark-check > span {
  flex: 1 1 auto;
  min-width: 0;
  white-space: normal;
  word-break: break-word;
}
.mark-tenure {
  display: flex;
  flex-wrap: wrap;
  gap: 0.45rem 0.85rem;
  margin-top: 0.45rem;
}
.mark-tenure-opt {
  display: inline-flex;
  align-items: center;
  gap: 0.35rem;
  font-size: 0.84rem;
  cursor: pointer;
  color: var(--ink);
}
.mark-tenure-opt input {
  width: auto !important;
  margin: 0;
  flex: 0 0 auto;
}
.mark-tenure-opt em {
  font-style: normal;
  font-weight: 700;
  color: #475569;
  text-decoration: underline;
  text-underline-offset: 2px;
}
.mark-tenure-opt.is-on {
  font-weight: 700;
}
#markParcelFilter {
  width: 100%;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  box-sizing: border-box;
}
.mark-owner-pick {
  max-height: min(12rem, 28vh);
  overflow: auto;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: #fff;
}
.mark-owner-pick button {
  display: flex;
  align-items: flex-start;
  gap: 0.4rem;
  width: 100%;
  margin: 0;
  padding: 0.42rem 0.6rem;
  border: 0;
  border-bottom: 1px solid rgba(28, 46, 36, 0.08);
  background: transparent;
  color: var(--ink);
  font: inherit;
  font-size: 0.84rem;
  line-height: 1.35;
  text-align: left;
  cursor: pointer;
}
.mark-owner-pick button:last-child { border-bottom: 0; }
.mark-owner-pick button.is-on {
  background: rgba(245, 158, 11, 0.22);
  font-weight: 750;
}
.mark-owner-pick button.has-active {
  background: rgba(21, 128, 61, 0.06);
}
.mark-owner-pick button.has-active.is-on {
  background: rgba(21, 128, 61, 0.18);
}
.mark-owner-pick button.has-pending {
  background: rgba(14, 116, 144, 0.05);
}
.mark-owner-check {
  flex: 0 0 auto;
  width: 1.15rem;
  height: 1.15rem;
  margin-top: 0.1rem;
  border-radius: 50%;
  background: #16a34a;
  color: #fff;
  font-size: 0.72rem;
  font-weight: 800;
  line-height: 1.15rem;
  text-align: center;
}
.mark-owner-check.is-pending {
  background: #0e7490;
  font-size: 0.65rem;
}
.mark-owner-txt { flex: 1; min-width: 0; }
.mark-owner-pick button small {
  display: block;
  color: var(--muted);
  font-size: 0.75rem;
  font-weight: 500;
}
.mark-pick-hint {
  margin: 0;
  font-size: 0.75rem;
  line-height: 1.4;
  color: var(--muted);
}
.mark-parcel-select {
  display: none !important;
}
.mark-modal-card-wide { max-width: 26rem; }
.mark-field-row {
  display: flex;
  gap: 0.55rem;
}
.mark-field-row .mark-field { flex: 1; min-width: 0; }
.mark-modal-actions {
  flex: 0 0 auto;
  display: flex;
  flex-wrap: wrap;
  gap: 0.5rem;
  justify-content: flex-end;
  margin-top: 0.45rem;
  padding-top: 0.6rem;
  border-top: 1px solid rgba(28, 46, 36, 0.1);
  background: #fff;
  z-index: 2;
  position: sticky;
  bottom: 0;
}
.mark-modal-actions .btn {
  min-height: 2.35rem;
  min-width: 4.5rem;
  font-weight: 750;
  opacity: 1 !important;
}
.mark-modal-actions .btn.ghost {
  color: var(--soil-deep);
  border-color: rgba(28, 46, 36, 0.28);
  background: #fff;
}
.maplibregl-popup-content .popup-actions {
  margin-top: 0.45rem;
  display: flex;
  flex-wrap: wrap;
  gap: 0.4rem;
}
.maplibregl-popup-content .popup-actions button {
  font: inherit;
  font-size: 0.78rem;
  padding: 0.25rem 0.5rem;
  border-radius: 8px;
  border: 1px solid rgba(28,46,36,0.2);
  background: #fff;
  cursor: pointer;
}
.maplibregl-popup-content .popup-actions button.danger {
  color: #b91c1c;
  border-color: rgba(185,28,28,0.35);
}
.hint {
  margin-top: 0.4rem;
  font-size: 0.72rem;
  opacity: 0.75;
  line-height: 1.35;
}
.loading {
  position: absolute;
  z-index: 8;
  top: 50%;
  left: 50%;
  transform: translate(-50%, -50%);
  padding: 0.65rem 1.1rem;
  background: rgba(20,36,28,0.9);
  color: var(--field);
  border-radius: 999px;
  font-size: 0.9rem;
  box-shadow: var(--shadow);
}
.loading.hidden { display: none; }
.maplibregl-popup-content {
  font-size: 0.85rem;
}

.parcel-dock {
  position: absolute;
  z-index: 6;
  top: calc(var(--bar-h) + 7.35rem);
  left: auto;
  right: 0.7rem;
  bottom: 2.6rem;
  width: 17.5rem;
  display: flex;
  flex-direction: column;
  background: var(--glass);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  overflow: hidden;
  box-shadow: var(--shadow);
  backdrop-filter: blur(14px);
  -webkit-backdrop-filter: blur(14px);
  pointer-events: auto;
  touch-action: manipulation;
}
.parcel-dock.is-collapsed {
  width: auto;
  top: calc(var(--bar-h) + 7.35rem);
  right: 0.7rem;
  left: auto;
  bottom: auto;
  background: transparent;
  border: 0;
  box-shadow: none;
  backdrop-filter: none;
  padding: 0;
}
.parcel-dock.is-collapsed .parcel-dock-body { display: none; }
.parcel-dock-body {
  flex: 1 1 auto;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
.parcel-dock-toggle.acrylic-fab {
  align-self: flex-end;
  flex: 0 0 auto;
  margin: 0;
  width: auto;
  min-width: 3.25rem;
  height: 3.25rem;
  padding: 0 0.85rem;
  font-size: 0.88rem;
}
.parcel-dock:not(.is-collapsed) .parcel-dock-toggle.acrylic-fab {
  align-self: stretch;
  width: auto;
  height: auto;
  min-height: 2.4rem;
  margin: 0.45rem 0.55rem 0.2rem;
  border-radius: 999px;
  animation: none;
}
.parcel-dock:not(.is-collapsed) {
  background: linear-gradient(165deg, rgba(255, 255, 255, 0.9), rgba(248, 251, 247, 0.82));
  border: 1px solid rgba(255, 255, 255, 0.7);
  backdrop-filter: blur(16px) saturate(1.3);
  -webkit-backdrop-filter: blur(16px) saturate(1.3);
}
.dock-filter {
  display: block;
  width: calc(100% - 1.1rem);
  margin: 0 0.55rem 0.45rem;
  padding: 0.45rem 0.55rem;
  border: 1px solid var(--line);
  border-radius: 10px;
  font: inherit;
  font-size: 0.82rem;
  background: #fff;
  color: var(--ink);
  box-sizing: border-box;
  flex: 0 0 auto;
}
.parcel-dock-tabs {
  display: flex;
  flex-wrap: wrap;
  gap: 0.3rem;
  padding: 0 0.55rem 0.4rem;
}
.parcel-dock-tabs button {
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 999px;
  padding: 0.22rem 0.6rem;
  cursor: pointer;
  font-size: 0.78rem;
}
.parcel-dock-tabs button.is-on {
  background: var(--soil-deep);
  color: #f8faf6;
  border-color: transparent;
}
.parcel-list.is-hidden { display: none; }
.well-field { display: block; margin: 0.4rem 0; font-size: 0.8rem; color: var(--muted); }
.well-field input,
.well-field select {
  width: 100%;
  margin-top: 0.2rem;
  padding: 0.42rem 0.5rem;
  border: 1px solid var(--line);
  border-radius: 8px;
  font: inherit;
  background: #fff;
  color: var(--ink);
}
.well-actions { display: flex; flex-wrap: wrap; gap: 0.3rem; margin: 0.4rem 0; }
.well-actions button {
  cursor: pointer;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.28rem 0.55rem;
}
.well-log { margin: 0.2rem 0 0; padding-left: 1rem; font-size: 0.78rem; }
.well-note { margin: 0.35rem 0 0; font-size: 0.75rem; color: var(--muted); }
.parcel-roster-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 0.35rem;
  padding: 0 0.65rem 0.25rem;
  font-size: 0.75rem;
  color: var(--muted);
  flex: 0 0 auto;
}
.parcel-roster-head #parcelRosterCount {
  font-weight: 700;
  color: var(--soil-deep);
}
.parcel-roster-hint {
  font-size: 0.68rem;
  opacity: 0.85;
  white-space: nowrap;
}
.parcel-list {
  overflow-x: hidden;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
  padding: 0 0.45rem 0.55rem;
  flex: 1 1 auto;
  min-height: 0;
}
.parcel-row {
  display: flex;
  align-items: stretch;
  gap: 0.25rem;
  width: 100%;
  text-align: left;
  border: 0;
  border-bottom: 1px solid var(--line);
  background: transparent;
  padding: 0.35rem 0.2rem;
  border-radius: 8px;
  cursor: default;
}
.parcel-row.is-on { background: rgba(180, 83, 9, 0.12); }
.parcel-row.is-dragging { opacity: 0.55; }
.parcel-row.is-drag-over { box-shadow: inset 0 2px 0 #b45309; }
.parcel-row.is-bad { color: #b91c1c; }
.parcel-row-seq {
  flex: 0 0 1.6rem;
  align-self: center;
  text-align: center;
  font-weight: 800;
  font-size: 0.78rem;
  color: #b45309;
  font-variant-numeric: tabular-nums;
}
.parcel-row-main {
  flex: 1 1 auto;
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0.15rem 0.15rem;
  cursor: pointer;
  text-align: left;
  font: inherit;
  color: inherit;
}
.parcel-row-ops {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0.05rem;
  flex: 0 0 auto;
  padding-left: 0.1rem;
}
.parcel-ord {
  border: 0;
  background: transparent;
  color: var(--muted);
  font-size: 0.72rem;
  line-height: 1;
  padding: 0.1rem 0.25rem;
  cursor: pointer;
  border-radius: 4px;
}
.parcel-ord:hover { background: rgba(0,0,0,0.06); color: var(--ink); }
.parcel-drag {
  cursor: grab;
  color: var(--muted);
  font-size: 0.7rem;
  letter-spacing: -0.08em;
  user-select: none;
  padding: 0.1rem 0.2rem;
}
.parcel-drag:active { cursor: grabbing; }
#waterPane button { cursor: pointer; }
#waterPane .well-actions { margin-top: 0.35rem; }
#waterPane > button {
  border-radius: 999px;
  border: 1px solid var(--line);
  background: #fff;
  padding: 0.4rem 0.75rem;
  margin: 0.25rem 0 0.55rem;
  font-weight: 650;
}
.parcel-row-name { display: block; font-weight: 700; }
.parcel-row-meta { display: block; color: var(--muted); font-size: 0.78rem; margin-top: 0.12rem; }
.parcel-owner-group { background: rgba(14, 116, 144, 0.08); border-left: 3px solid #0e7490; }
.parcel-owner-group.is-open { background: rgba(14, 116, 144, 0.12); }
.parcel-owner-count {
  font-style: normal;
  font-weight: 600;
  font-size: 0.78rem;
  color: #0e7490;
  margin-left: 0.2rem;
}
.parcel-row.is-owner-child {
  padding-left: 0.35rem;
  opacity: 0.96;
  background: rgba(248, 250, 252, 0.9);
}
.parcel-empty { padding: 0.6rem; color: var(--muted); font-size: 0.8rem; line-height: 1.4; }
.parcel-row.is-bad .parcel-row-meta { color: #b91c1c; font-weight: 700; }
.parcel-row.is-owner-hit {
  background: rgba(245, 158, 11, 0.22);
  box-shadow: inset 3px 0 0 #f59e0b, 0 0 0 1px rgba(245, 158, 11, 0.45);
  animation: owner-hit-flash 0.85s ease-in-out 3;
}
.parcel-row.is-owner-cycle {
  background: rgba(22, 163, 74, 0.2);
  box-shadow: inset 3px 0 0 #16a34a, 0 0 0 1px rgba(22, 163, 74, 0.45);
  animation: owner-cycle-flash 0.7s ease-in-out infinite;
}
@keyframes owner-cycle-flash {
  0%, 100% { filter: brightness(1); }
  50% { filter: brightness(1.08); }
}
.parcel-no-geom {
  margin-left: 0.25rem;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  background: rgba(185, 28, 28, 0.12);
  color: #b91c1c;
  font-style: normal;
  font-size: 0.72em;
  font-weight: 700;
  vertical-align: middle;
  white-space: nowrap;
}
.parcel-no-lease {
  margin-left: 0.25rem;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  background: repeating-linear-gradient(
    -45deg,
    rgba(100, 116, 139, 0.18),
    rgba(100, 116, 139, 0.18) 3px,
    rgba(100, 116, 139, 0.05) 3px,
    rgba(100, 116, 139, 0.05) 6px
  );
  color: #475569;
  border: 1px solid rgba(100, 116, 139, 0.35);
  font-style: normal;
  font-size: 0.72em;
  font-weight: 700;
  vertical-align: middle;
  white-space: nowrap;
}
.parcel-lease-active {
  margin-left: 0.25rem;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  background: rgba(21, 128, 61, 0.14);
  color: #15803d;
  border: 1px solid rgba(21, 128, 61, 0.35);
  font-style: normal;
  font-size: 0.72em;
  font-weight: 700;
  vertical-align: middle;
  white-space: nowrap;
}
.parcel-lease-pending {
  margin-left: 0.25rem;
  padding: 0.05rem 0.35rem;
  border-radius: 4px;
  background: rgba(14, 116, 144, 0.14);
  color: #0e7490;
  border: 1px solid rgba(14, 116, 144, 0.35);
  font-style: normal;
  font-size: 0.72em;
  font-weight: 700;
  vertical-align: middle;
  white-space: nowrap;
}
.parcel-row.is-unleased {
  background: repeating-linear-gradient(
    -45deg,
    rgba(148, 163, 184, 0.12),
    rgba(148, 163, 184, 0.12) 4px,
    rgba(255, 255, 255, 0.35) 4px,
    rgba(255, 255, 255, 0.35) 8px
  );
}
.parcel-owner-link {
  display: inline;
  margin: 0 0.05rem;
  padding: 0;
  border: 0;
  background: none;
  color: #b45309;
  font: inherit;
  font-weight: 800;
  text-decoration: underline;
  text-underline-offset: 2px;
  cursor: pointer;
}
.parcel-owner-link:hover,
.parcel-owner-link:focus-visible {
  color: #ea580c;
  outline: none;
}
@keyframes owner-hit-flash {
  0%, 100% { background: rgba(245, 158, 11, 0.16); }
  50% { background: rgba(251, 191, 36, 0.42); }
}
.lease-owner-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin: 0.35rem 0 0.55rem;
  max-height: 7.2rem;
  overflow: auto;
}
.lease-owner-chip {
  border: 1px solid rgba(180, 83, 9, 0.35);
  border-radius: 999px;
  background: rgba(255, 247, 237, 0.95);
  color: #9a3412;
  font-size: 0.78rem;
  font-weight: 650;
  padding: 0.28rem 0.7rem;
  cursor: pointer;
  line-height: 1.2;
}
.lease-owner-chip:hover {
  border-color: #ea580c;
  background: #ffedd5;
}
.lease-owner-chip.is-on {
  background: #ea580c;
  border-color: #c2410c;
  color: #fff7ed;
  font-weight: 750;
}

.scrim {
  display: none;
  position: absolute;
  inset: 0;
  z-index: 4;
  background: rgba(10, 18, 14, 0.28);
}
.scrim.on { display: block; }

/* —— 平板 —— */
@media (max-width: 1024px) and (min-width: 721px) {
  .parcel-dock,
  .parcel-dock.is-collapsed {
    width: 15.5rem;
    top: calc(var(--bar-h) + 7.35rem);
  }
  .mark-bar { max-width: min(62vw, 30rem); }
}

/* —— 手机：地图优先，IM 浮层 —— */
@media (max-width: 720px) {
  :root { --bar-h: 3.05rem; }
  .bar {
    flex-wrap: nowrap;
    gap: 0.35rem;
    padding: calc(0.4rem + var(--safe-t)) 0.55rem 0.4rem;
    align-items: center;
  }
  .brand { font-size: 0.88rem; margin-right: 0; flex: 0 0 auto; }
  .brand-link:not(.brand-patrol-dd > summary) { display: none; }
  .brand-patrol-dd { display: inline-block; }
  .field { display: none; }
  .status {
    flex: 1;
    min-width: 0;
    margin-left: 0.25rem;
    font-size: 0.72rem;
  }
  .ops-more-btn {
    display: inline-flex;
    flex: 0 0 auto;
  }
  .ops-tools {
    display: none;
    position: absolute;
    top: calc(100% + 0.35rem);
    left: 0.45rem;
    right: 0.45rem;
    flex-wrap: wrap;
    gap: 0.4rem;
    padding: 0.65rem;
    background: var(--glass-strong);
    border: 1px solid var(--line);
    border-radius: var(--radius);
    box-shadow: var(--shadow);
    color: var(--ink);
  }
  .bar.is-ops-open .ops-tools {
    display: flex;
  }
  .ops-tools .btn,
  .ops-tools .btn.ghost {
    color: var(--soil-deep);
    border-color: var(--line);
    background: #fff;
  }
  .ops-tools .btn:not(.ghost) {
    background: var(--crop);
  }
  .ops-tools .field {
    display: inline-flex;
    width: 100%;
  }
  .ops-tools .field input {
    flex: 1;
    width: auto;
    color: var(--ink);
    background: #fff;
    border-color: var(--line);
  }

  /* 手机浮钮：图→左上；画/地块底栏缩小，少挡图 */
  .acrylic-fab {
    width: 2.45rem;
    height: 2.45rem;
    font-size: 0.78rem;
    box-shadow:
      0 6px 18px rgba(12, 24, 18, 0.18),
      0 1px 0 rgba(255, 255, 255, 0.85) inset;
  }
  .acrylic-fab .mark-fab-lab,
  .acrylic-fab .legend-fab-lab,
  .acrylic-fab .parcel-fab-lab {
    font-size: 0.78rem;
    letter-spacing: 0.02em;
  }
  .mark-bar {
    top: auto;
    left: 0.45rem;
    right: auto;
    bottom: calc(0.85rem + var(--safe-b));
    max-width: none;
    flex-direction: column-reverse;
    flex-wrap: nowrap;
    align-items: flex-start;
    gap: 0.35rem;
    z-index: 6;
    overflow: visible;
  }
  .mark-sheet {
    max-width: min(96vw, 22rem);
    max-height: min(48dvh, 22rem);
    overflow-x: hidden;
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    align-content: flex-start;
  }
  .mark-sheet-head {
    position: sticky;
    top: 0;
    z-index: 4;
    margin: -0.15rem -0.15rem 0.2rem;
    padding: 0.2rem 0.15rem 0.35rem;
    background: linear-gradient(180deg, rgba(255, 255, 255, 0.96), rgba(248, 251, 247, 0.92));
  }
  .mark-sheet-close {
    width: 2.05rem;
    height: 2.05rem;
    font-size: 1.15rem;
    opacity: 1;
    background: rgba(20, 36, 28, 0.1);
  }
  /* 画中：说明不与完成/撤点/取消并排抢位 */
  .mark-sheet:has(.mark-draw-act:not(.hidden)) .stroke-mode-hint,
  .mark-sheet:has(.mark-draw-act:not(.hidden)) #mapRoleTip {
    display: none;
  }
  .mark-draw-tip {
    order: 1;
  }
  .mark-bar .btn.mark-draw-act:not(.hidden) {
    flex: 1 1 calc(33.33% - 0.3rem);
    min-width: 4.2rem;
    order: 2;
  }
  .mark-sheet .stroke-mode-bar,
  .mark-sheet .stroke-mode-hint,
  .mark-sheet #mapRoleTip,
  .mark-sheet .btn.mark,
  .mark-sheet .color-dock,
  .mark-sheet .pen-width {
    order: 3;
  }
  .btn.mark { box-shadow: none; }
  /* 小屏画图说明改走 #markDrawTip；浮动黑条默认隐藏以免挡操作 */
  .draw-hud {
    display: none !important;
  }
  .redline-desk {
    padding: calc(var(--bar-h) + 0.45rem) 0.4rem 0.4rem;
    align-items: stretch;
    justify-content: flex-end;
  }
  .redline-desk-card {
    width: min(100%, 22rem);
    max-height: min(58dvh, calc(100dvh - var(--bar-h) - 1rem));
  }
  .redline-desk.is-drawing .redline-desk-card {
    width: min(100%, 22rem);
    max-height: min(46dvh, calc(100dvh - var(--bar-h) - 1rem));
  }
  .redline-desk-head {
    position: sticky;
    top: 0;
    z-index: 3;
    background: rgba(15, 23, 42, 0.96);
    margin: -0.2rem -0.15rem 0.35rem;
    padding: 0.2rem 0.15rem 0.35rem;
  }
  .redline-desk.is-drawing .patrol-hint {
    display: none;
  }
  .redline-x {
    width: 2.15rem;
    height: 2.15rem;
    flex: 0 0 auto;
  }

  .parcel-dock,
  .parcel-dock.is-collapsed {
    top: auto;
    left: auto;
    right: 0.45rem;
    bottom: calc(0.85rem + var(--safe-b));
    width: auto;
    max-height: none;
  }
  .parcel-dock:not(.is-collapsed) {
    left: 0.45rem;
    right: 0.45rem;
    width: auto;
    max-height: min(58vh, 28rem);
    border-radius: 18px 18px 14px 14px;
  }
  .parcel-dock.is-collapsed .parcel-dock-toggle.acrylic-fab {
    width: auto;
    min-width: 2.45rem;
    height: 2.45rem;
    padding: 0 0.65rem;
    margin: 0;
    font-size: 0.72rem;
  }
  .parcel-dock:not(.is-collapsed) .parcel-dock-toggle.acrylic-fab {
    align-self: stretch;
    margin: 0.45rem 0.55rem 0.15rem;
    min-height: 2.1rem;
    width: auto;
    height: auto;
    padding: 0.35rem 0.75rem;
    border-radius: 999px;
  }
  .parcel-dock:not(.is-collapsed) .parcel-dock-body {
    flex: 1 1 auto;
    min-height: 0;
  }
  /* 「图」钉左上（顶栏下），避开底栏画/地块 */
  .legend {
    left: 0.45rem;
    top: calc(var(--bar-h) + 0.4rem);
    bottom: auto;
    z-index: 5;
    max-width: min(72vw, 14rem);
  }
  .legend:not(.collapsed) {
    top: calc(var(--bar-h) + 0.4rem);
    bottom: auto;
    max-width: min(88vw, 16.5rem);
    max-height: min(52vh, 24rem);
    overflow: auto;
    z-index: 8;
  }
  .legend:not(.collapsed) .legend-head {
    position: sticky;
    top: 0;
    z-index: 2;
    background: rgba(248, 250, 246, 0.96);
  }
  /* draw-hud 已钉顶栏下，勿再压回底栏盖住画笔 */
  #map .maplibregl-ctrl-bottom-right {
    bottom: calc(4.4rem + var(--safe-b)) !important;
  }
  .maplibregl-popup.parcel-detail-popup,
  #map .maplibregl-popup.parcel-detail-popup {
    bottom: calc(4.55rem + var(--safe-b)) !important;
  }
  .merge-bar {
    top: calc(var(--bar-h) + 0.4rem);
    left: 0.55rem;
    right: 0.55rem;
    transform: none;
    max-width: none;
    border-radius: 14px;
    z-index: 9;
  }
  .gps-hud {
    top: calc(var(--bar-h) + 0.45rem);
    left: 0.55rem;
    right: 0.55rem;
    max-width: none;
  }
  /* 缩放/指南针右上；左上留给「图」 */
  #map .maplibregl-ctrl-top-right {
    top: calc(var(--bar-h) + 0.4rem) !important;
    right: 0.4rem !important;
  }
  #map .maplibregl-ctrl-bottom-right {
    right: 0.4rem !important;
  }
}

@media (min-width: 721px) {
  .mark-modal {
    align-items: center;
    padding: 1.25rem 1.5rem;
  }
  .mark-modal-card {
    width: min(30rem, calc(100vw - 3rem));
    max-height: min(78dvh, 78vh, 38rem);
    border-radius: 16px;
  }
  .mark-modal-card-wide {
    width: min(32rem, calc(100vw - 3rem));
    max-width: 32rem;
  }
  .parcel-card {
    min-width: 17.5rem;
  }
  .maplibregl-popup.parcel-detail-popup .maplibregl-popup-content {
    max-height: min(calc(100vh - var(--bar-h) - 3.5rem), 34rem);
  }
}
@media (max-width: 720px) {
  .mark-modal {
    align-items: flex-end;
    padding: 0.35rem 0.4rem calc(0.4rem + var(--safe-b));
  }
  .mark-modal-card {
    width: 100%;
    max-width: none;
    max-height: min(68dvh, 68vh);
    padding: 0.7rem 0.8rem 0.55rem;
    border-radius: 14px 14px 10px 10px;
  }
  .mark-modal-card h3 {
    font-size: 0.98rem;
    margin-bottom: 0.4rem;
  }
  .mark-field {
    margin-bottom: 0.48rem;
    font-size: 0.8rem;
  }
  .mark-owner-pick {
    max-height: min(8.5rem, 22vh);
  }
  .mark-modal-actions .btn {
    min-height: 2.2rem;
    flex: 1 1 auto;
  }
  /* 手机：详情卡钉底（避开画笔/地块坞），约 2/5 屏高可滚 */
  .maplibregl-popup.parcel-detail-popup,
  #map .maplibregl-popup.parcel-detail-popup {
    position: fixed !important;
    left: 0.4rem !important;
    right: 0.4rem !important;
    bottom: calc(5.65rem + var(--safe-b)) !important;
    top: auto !important;
    transform: none !important;
    max-width: none !important;
    width: auto !important;
    z-index: 16 !important;
  }
  .maplibregl-popup.parcel-detail-popup .maplibregl-popup-tip,
  #map .maplibregl-popup.parcel-detail-popup .maplibregl-popup-tip {
    display: none !important;
  }
  .maplibregl-popup.parcel-detail-popup .maplibregl-popup-content,
  #map .maplibregl-popup.parcel-detail-popup .maplibregl-popup-content {
    max-height: min(38dvh, 17.5rem);
    padding: 0.45rem 0.55rem 0.5rem !important;
    border-radius: 12px !important;
  }
  .parcel-card {
    font-size: 0.74rem;
  }
  .parcel-card-head {
    margin-bottom: 0.35rem;
  }
  .parcel-card-title {
    font-size: 0.88rem;
  }
  .parcel-card-party,
  .parcel-card-mu {
    padding: 0.28rem 0.4rem;
    margin-bottom: 0.28rem;
    border-radius: 10px;
  }
  .parcel-card-line {
    margin-top: 0.12rem;
  }
  .parcel-card-mu {
    margin: 0.22rem 0 0.28rem;
  }
  .parcel-card-mu-main {
    font-size: 0.9rem;
  }
  .parcel-card-rent {
    margin: 0.2rem 0 0.12rem;
    font-size: 0.82rem;
  }
  .parcel-card-rent b {
    font-size: 0.9rem;
  }
  .parcel-card-miss {
    margin-top: 0.28rem;
    padding: 0.28rem 0.4rem;
    font-size: 0.7rem;
  }
  .maplibregl-popup.parcel-detail-popup .popup-actions {
    gap: 0.28rem;
    margin-top: 0.35rem;
    padding-top: 0.35rem;
    background: #fff;
  }
  .maplibregl-popup.parcel-detail-popup .popup-actions button.lease-link {
    padding: 0.28rem 0.45rem;
    font-size: 0.7rem;
    flex: 1 1 calc(50% - 0.28rem);
  }
}

/* 派单弹窗 · 商业运营 */
.ops-dispatch-card {
  border-radius: 0.35rem !important;
  border: 1px solid rgba(15, 23, 42, 0.12);
  box-shadow: 0 18px 40px rgba(15, 23, 42, 0.18);
}
.ops-dispatch-eyebrow {
  margin: 0 0 0.15rem;
  font-size: 0.68rem;
  letter-spacing: 0.14em;
  font-weight: 700;
  color: #0f766e;
}
.ops-dispatch-card h3 {
  margin-top: 0;
  letter-spacing: -0.02em;
}
.ops-dispatch-place {
  font-family: ui-monospace, Consolas, monospace;
  font-size: 0.78rem !important;
  padding: 0.4rem 0.5rem;
  background: #f1f5f9;
  border-radius: 0.25rem;
}
.ops-check-modes {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.4rem;
  margin-top: 0.4rem;
}
.ops-check-card {
  display: flex;
  flex-direction: column;
  gap: 0.15rem;
  padding: 0.55rem 0.6rem;
  border: 1px solid rgba(15, 23, 42, 0.14);
  border-radius: 0.3rem;
  background: #fff;
  cursor: pointer;
  font-size: 0.82rem;
  line-height: 1.25;
}
.ops-check-card:has(input:checked) {
  border-color: #0f766e;
  background: #f0fdfa;
  box-shadow: inset 0 0 0 1px #0f766e;
}
.ops-check-card input {
  margin: 0 0 0.15rem;
  align-self: flex-start;
}
.ops-check-title {
  font-weight: 700;
  color: #0f172a;
}
.ops-check-desc {
  color: #64748b;
  font-size: 0.75rem;
}
.ops-tag-picks {
  display: flex;
  flex-wrap: wrap;
  gap: 0.35rem;
  margin-top: 0.35rem;
}
.ops-tag-pick {
  display: inline-flex;
  align-items: center;
  gap: 0.3rem;
  padding: 0.28rem 0.5rem;
  border: 1px solid var(--tag-c, #0f766e);
  color: var(--tag-c, #0f766e);
  border-radius: 0.2rem;
  font-size: 0.82rem;
  cursor: pointer;
  background: #fff;
  user-select: none;
}
.ops-tag-pick:has(input:checked) {
  background: color-mix(in srgb, var(--tag-c, #0f766e) 14%, #fff);
  font-weight: 650;
}
.ops-tag-pick input {
  margin: 0;
  accent-color: var(--tag-c, #0f766e);
}
.ops-dispatch-card-preview {
  margin-top: 0.55rem;
  border: 1px solid rgba(15, 118, 110, 0.18);
  border-radius: 12px;
  background: #f8fafc;
  padding: 0.45rem;
  max-height: 280px;
  overflow: auto;
  text-align: center;
}
.ops-dispatch-card-preview img {
  max-width: 100%;
  height: auto;
  border-radius: 8px;
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}
.ops-dispatch-result {
  margin-top: 0.55rem;
  padding-top: 0.55rem;
  border-top: 1px dashed rgba(15, 23, 42, 0.12);
}
.land-attr-picks {
  max-height: 11rem;
  overflow-y: auto;
  padding: 0.2rem 0.1rem 0.35rem;
}
.land-attr-group {
  width: 100%;
  flex-basis: 100%;
  font-size: 0.68rem;
  letter-spacing: 0.08em;
  font-weight: 700;
  color: #64748b;
  margin: 0.35rem 0 0.15rem;
}
