* { margin: 0; padding: 0; box-sizing: border-box; }
/* hidden 必须是硬隐藏：作者样式里的 display:flex/inline-flex 优先级高于 UA 的 [hidden]{display:none}，
 * 不加这条，「遮罩 / 方向角控件」等设了 hidden 仍在页面上（v3.31 修：生成通过后遮罩不消失） */
[hidden] { display: none !important; }
/* v3.31：顶栏与步骤条整体压扁（标题字号调小、内边距收紧），把高度让给图纸 */
:root { --topbar-h: 46px; --wizard-h: 48px; }

body {
  font-family: "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  background: #F5F4EF;
  color: #2C2C2A;
  font-size: 14px;
  line-height: 1.6;
}

.topbar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 6px 20px;
  background: #fff;
  border-bottom: 1px solid #E4E2D8;
  position: sticky;
  top: 0;
  z-index: 10;
}
.logo { display: flex; align-items: center; gap: 9px; }
.logo h1 { font-size: 13.5px; font-weight: 600; line-height: 1.35; letter-spacing: .2px; }
/* v5.61：当前设计名（顶栏副标题）。灰色小字，与产品名区分；
 * 太长时省略，不撑破顶栏。 */
.logo-txt { min-width: 0; }
.logo-design {
  font-size: 11px;
  color: #8A8779;
  line-height: 1.3;
  margin-top: 1px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 42vw;
}
.logo-design b { color: #1D9E75; font-weight: 600; }
.logo p { font-size: 10.5px; color: #888780; line-height: 1.35; }
/* 顶栏按钮同步收小，避免把顶栏撑回去 */
.topbar .actions { display: flex; gap: 8px; }
.topbar .btn { padding: 4px 11px; font-size: 12px; border-radius: 7px; }

.btn {
  border: 1px solid #1D9E75;
  border-radius: 8px;
  padding: 8px 16px;
  font-size: 13px;
  cursor: pointer;
  transition: all .15s;
}
.btn.primary { background: #1D9E75; color: #fff; }
.btn.primary:hover { background: #0F6E56; }
.btn.ghost { background: #fff; color: #1D9E75; }
.btn.ghost:hover { background: #E1F5EE; }

.layout {
  display: grid;
  grid-template-columns: 300px 1fr;
  gap: 20px;
  padding: 14px 20px 18px;
  max-width: 1440px;
  margin: 0 auto;
}
/* 第 2/3 步字段最多（滴灌带 + 管径 + 水源），左栏加宽并压缩行高 */
body[data-step="2"] .layout,
body[data-step="3"] .layout { grid-template-columns: 348px 1fr; gap: 16px; }

.panel {
  background: #fff;
  border: 1px solid #E4E2D8;
  border-radius: 12px;
  padding: 18px;
  height: fit-content;
  position: sticky;
  top: calc(var(--topbar-h) + var(--wizard-h) + 12px);
}
.panel h2 {
  font-size: 13px;
  font-weight: 600;
  color: #0F6E56;
  margin: 14px 0 10px;
  padding-bottom: 6px;
  border-bottom: 1px dashed #E4E2D8;
}
.panel h2:first-child { margin-top: 0; }

/* ===== v5.51（甲方 2026-11-27「在精简一下，绿色文字不要了，
        水源和干管直径放在一排，支管直径和布设方式放一排」）=====
 * 把原来三个 `<h2>`（水源 / 干管 / 支管，绿色 + 虚线底边）压成两个 `.inline-sec`。
 *   · 分组名用**灰色小字**（不是绿色）—— 甲方明确说"绿色文字不要了"；
 *   · 细实线分隔（不用虚线），让 4 个输入框成为页面主体；
 *   · 字号 13 → 11.5、间距收紧，三组变两组，约省 90px 高度。 */
.inline-sec { margin-bottom: 4px; }
.inline-sec .is-head {
  font-size: 11.5px;
  font-weight: 600;
  color: #8A8779;
  letter-spacing: .3px;
  margin: 12px 0 8px;
  padding-bottom: 5px;
  border-bottom: 1px solid #EDEBE2;
}

.field { margin-bottom: 12px; }
.field label {
  display: block;
  font-size: 12.5px;
  color: #5F5E5A;
  margin-bottom: 4px;
}
.field .hint {
  display: block;
  font-size: 11px;
  color: #B4B2A9;
}
.field input, .field select {
  width: 100%;
  padding: 7px 10px;
  border: 1px solid #D3D1C7;
  border-radius: 8px;
  font-size: 14px;
  background: #FDFDFB;
}
.field input:focus, .field select:focus {
  outline: 2px solid #5DCAA5;
  border-color: #1D9E75;
}

.stage { min-width: 0; }

.map-wrap {
  background: #fff;
  border: 1px solid #E4E2D8;
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 16px;
}

/* ===== v5.34 第 1 步：地图铺满 + 悬浮控件 =====
 * 甲方 2026-11-27：「搜索用灰色，浮在地图上面即可，大面积放地图，
 *   底下的辅助文字也可以隐藏了」。
 *
 * 结构（DOM 顺序就是层叠顺序）：
 *   .map-stage   relative 容器，地图铺满它
 *     #map       地图本体（z-index 1）
 *     .map-float-top  搜索框（z-index 5，浮在顶部，半透明灰底）
 *     .map-fab        定位图标（z-index 5，浮在右上圆钮）
 * 底部 .map-actions 是**地图外**的操作条（不挡地图），两行两列大按钮。
 * 辅助信息收进 .map-more（<details>），默认收起。 */
.map-wrap { position: relative; }   /* v5.41：方向微调条 / 悬浮提示条的定位基准 */

.map-stage {
  position: relative;
  border-radius: 10px;
  overflow: hidden;          /* 让悬浮控件不会溢出圆角 */
  background: #E8EDE6;
}
.map-stage #map { border-radius: 0; }

/* 顶部悬浮：搜索框 */
.map-float-top {
  position: absolute; top: 10px; left: 10px; right: 10px;
  z-index: 5;
  pointer-events: none;      /* 只让输入框本身接收点击，空白处能拖地图 */
}
.map-float-top .map-search {
  margin: 0;
  pointer-events: auto;
}
/* 半透明灰底 + 毛玻璃：浮在地图上但不抢戏 */
.map-float-top .map-search input {
  width: 100%;
  padding: 10px 14px 10px 36px;
  border: 1px solid rgba(255,255,255,.55);
  border-radius: 10px;
  font-size: 14px;
  color: #2C2C2A;
  background: rgba(246,246,243,.88);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  box-shadow: 0 2px 8px rgba(0,0,0,.10);
}
.map-float-top .map-search input::placeholder { color: #8A8779; }
.map-float-top .map-search input:focus {
  background: #fff;
  border-color: #1D9E75;
  outline: 2px solid rgba(29,158,117,.25);
}
.ms-ico {
  position: absolute; left: 12px; top: 50%; transform: translateY(-50%);
  color: #8A8779; pointer-events: none;
}

/* 定位：圆形悬浮按钮（右下，避开搜索框与腾讯地图自带的指南针） */
.map-fab {
  position: absolute; right: 12px; bottom: 12px;
  z-index: 6;
  width: 42px; height: 42px;
  border: 1px solid rgba(255,255,255,.7);
  border-radius: 50%;
  background: rgba(255,255,255,.94);
  color: #1D9E75;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(0,0,0,.16);
  -webkit-tap-highlight-color: transparent;
  transition: transform .12s, box-shadow .12s;
}
.map-fab:active { transform: scale(.94); box-shadow: 0 1px 5px rgba(0,0,0,.2); }
.map-fab.busy { color: #C9A227; }

/* ===== v5.34：清理腾讯地图自带控件 =====
 * `controlOptions: { zoomControl:false, rotationControl:false }` 在当前 TMap GL 版本
 * **不生效**（实测仍渲染）。改用 CSS —— 这两个控件的类名是稳定的：
 *   `.rotate-panel`        指北针 + 旋转钮（右上）
 *   `.tmap-zoom-control`   缩放 +/−（右侧中部）
 *
 * 为什么**两个断点都隐藏指北针**：
 *   旋转地图后，`screenPointToLatLng` 的坐标轴跟着转，圈地时"上北下南"的直觉失效，
 *   画出来的地块会歪。圈地场景根本不需要旋转，留着只会被误触。
 * 缩放：桌面保留（鼠标没手势），手机隐藏（双指缩放是系统标准手势，比点小钮快）。 */
/* ⚠ 指北针不是一个元素，是**一层套一层**的几个：
 *   .rotate-panel（总容器）→ .compass-circle-background / .compass-circle / .compass-img
 *   + .rotate-left / .rotate-right / .rotate-top 四个旋转热区
 * 只隐藏 `.rotate-panel` 实测**仍会露出一个白色圆点**（就是甲方图上右上角那个），
 * 因为子元素有自己的定位与背景。必须把子元素一起关掉。 */
.rotate-panel,
.compass-circle-background,
.compass-circle,
.compass-img,
.rotate-left, .rotate-right, .rotate-top, .rotate-bottom,
.rotate-top-img, .rotate-left-img, .rotate-right-img, .rotate-bottom-img {
  display: none !important;
}
@media (max-width: 767px) {
  .tmap-zoom-control { display: none !important; }

  /* 比例尺（200 公里 / 200 英里）在手机上会被腾讯版权条压住、且双行数字叠在一起。
   * 圈地时判断尺度主要看卫星影像里的参照物（道路/地块），比例尺并非必需；
   * 而且腾讯版权条不能动（合规），挪比例尺又会撞。所以手机上**收起来**。
   * ⚠ 桌面端保留 —— 大屏上有地方摆，且做设计核对时要看尺度。 */
  .tmap-scale-control { display: none !important; }
}

/* ===== v5.39 模式提示条（浮在地图上）=====
 * 甲方：「点在绘制或者水源时候，需要像绘制图标一样，有提示。可以使用对应功能」。
 *
 * 位置在地图顶部、搜索框**下方**（搜索框 42 + 8 间距 ≈ top: 58），
 * 半透明深底 + 白字，与卫星影像对比强，一眼能看清。
 * 三种模式用左侧圆点颜色区分：绘制=绿、水源=蓝、方向=金。 */
.map-mode {
  position: absolute;
  left: 10px; right: 10px;
  top: 58px;
  z-index: 6;
  display: flex; align-items: center; gap: 8px;
  padding: 7px 8px 7px 11px;
  border-radius: 10px;
  /* v5.40（甲方 2026-11-27「不能全黑，要灰色，半透明」）：
   * 从深绿黑 rgba(24,42,36,.82) 改成**中性灰** rgba(70,70,66,.78)。
   * 灰比黑柔和，压在卫星影像上不抢画面；.78 的透明度能让底下的地块/黄线透出来，
   * 一眼看出"这是浮层"而不是"页面的一块黑条"。
   * ⚠ 不要再调深 —— 甲方明确说全黑观感差；也不要低于 .70，否则白字在浅色地块上发虚。 */
  background: rgba(70,70,66,.78);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  color: #fff;
  font-size: 12.5px;
  line-height: 1.4;
  box-shadow: 0 2px 12px rgba(0,0,0,.28);
  animation: mmIn .18s ease-out;
}
@keyframes mmIn {
  from { opacity: 0; transform: translateY(-6px); }
  to   { opacity: 1; transform: none; }
}
.map-mode[hidden] { display: none !important; }
.map-mode .mm-dot {
  width: 7px; height: 7px; border-radius: 50%;
  background: #4ADE80; flex: 0 0 7px;
  box-shadow: 0 0 0 3px rgba(74,222,128,.22);
  animation: mmPulse 1.5s ease-in-out infinite;
}
@keyframes mmPulse {
  0%, 100% { opacity: 1; }
  50% { opacity: .35; }
}
.map-mode.src .mm-dot { background: #60A5FA; box-shadow: 0 0 0 3px rgba(96,165,250,.22); }
/* v5.40「已闭合，可继续」态：灰白点、**不闪** —— 这一步不需要催促，只是告知 */
.map-mode.done .mm-dot {
  background: #C8C6BE;
  box-shadow: 0 0 0 3px rgba(200,198,190,.20);
  animation: none;
}
.map-mode.dir .mm-dot { background: #FBBF24; box-shadow: 0 0 0 3px rgba(251,191,36,.22); }
.map-mode .mm-txt {
  flex: 1 1 auto; min-width: 0;
  overflow: hidden;
}
.map-mode .mm-x {
  flex: 0 0 auto;
  width: 24px; height: 24px;
  border: none; border-radius: 50%;
  background: rgba(255,255,255,.16);
  color: #fff; font-size: 11px; line-height: 1;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  -webkit-tap-highlight-color: transparent;
}
.map-mode .mm-x:active { background: rgba(255,255,255,.30); }

/* ===== v5.41 方向微调条（甲方「不便于操作，可以怎么设置呢」）=====
 * 浮在地图底部、操作条**上方**：−15° / −5° / [当前角度] / +5° / +15°。
 * 设计取舍：
 *   · 用按钮步进而不是拖拽 —— 手机上"按住拖动"会与地图平移打架（甲方原话"不便于操作"）；
 *   · 步长 5° 与 15° 两档：5° 用来精调，15° 用来快速转；
 *   · 中间显示当前角度，用户不用去别处找；
 *   · 半透明深灰，与模式提示条同族，浮在地图上不突兀。 */
.dir-tune {
  /* ⚠ 定位基准必须是**地图本体** `.map-stage`（它自身 position:relative），
   * 不能是 `.map-wrap` —— wrap 在桌面还包着下方那排操作条，
   * 用 wrap 当基准时 `bottom:14px` 会落在操作条下面（实测桌面截图跑出地图）。
   * 手机端 wrap 里只有 stage（操作条是 absolute 浮层），两者等价；
   * 但为统一口径，**两端都以 .map-stage 为基准**。 */
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  bottom: 14px;
  z-index: 8;
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px;
  border-radius: 999px;
  background: rgba(70,70,66,.82);
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  box-shadow: 0 2px 12px rgba(0,0,0,.26);
  white-space: nowrap;
  max-width: calc(100% - 24px);
}
.dir-tune[hidden] { display: none !important; }
.dir-tune .dt-btn {
  flex: 0 0 auto;
  min-width: 44px; height: 30px;
  padding: 0 8px;
  border: 1px solid rgba(255,255,255,.26);
  border-radius: 999px;
  background: rgba(255,255,255,.12);
  color: #fff;
  font-size: 12px;
  font-family: inherit;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.dir-tune .dt-btn:active { background: rgba(255,255,255,.30); }
.dir-tune .dt-val {
  flex: 0 0 auto;
  min-width: 46px;
  text-align: center;
  color: #FBBF24;
  font-size: 13px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
}

/* 底部操作条：第 1 步专用。
 * 桌面：**一行四个**（1150px 宽下两行会把每个按钮拉到 550px，空得很）；
 * 手机：两行两列（见断点内，拇指易达且每个足够大）。 */
body[data-step="1"] .map-actions {
  display: grid;
  grid-template-columns: repeat(4, minmax(0, 1fr));
  gap: 10px;
  margin-top: 10px;
  max-width: 620px;         /* 不跟着地图铺满，四个按钮聚在一起更好点 */
}
body[data-step="1"] .map-actions .btn {
  min-height: 46px;
  font-size: 15px;
  font-weight: 500;
  border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
}

/* ===== v5.39 模式选中态：点了「绘制/水源/方向」后按钮要变样 =====
 * 甲方要的「像绘制图标一样有提示」不只是文字 —— 按钮本身也必须显示"我正在生效"，
 * 否则用户点完看不出区别，会连点好几次。
 * 主色描边 + 内阴影光晕，比单纯变色更容易在卫星底图上分辨。 */
body[data-step="1"] .map-actions .btn.mode-on {
  background: #1D9E75;
  color: #fff;
  border-color: #1D9E75;
  box-shadow: 0 0 0 3px rgba(29,158,117,.26), inset 0 0 0 1px rgba(255,255,255,.22);
}
/* 水源/方向本来在未激活时也可能被点亮（如水源已放），
 * 这里给它们一个"非主色"的选中态，避免和「绘制」抢视觉 */
body[data-step="1"] .map-actions #btnSource.mode-on,
body[data-step="1"] .map-actions #btnDir.mode-on {
  background: #1F6FEB;
  border-color: #1F6FEB;
  box-shadow: 0 0 0 3px rgba(31,111,235,.26), inset 0 0 0 1px rgba(255,255,255,.22);
}
body[data-step="1"] .map-actions #btnDir.mode-on {
  background: #C9A227;
  border-color: #C9A227;
  box-shadow: 0 0 0 3px rgba(201,162,39,.26), inset 0 0 0 1px rgba(255,255,255,.22);
}
body[data-step="1"] .map-actions .btn[hidden] { display: none !important; }
body[data-step="1"] .map-actions #btnDraw { font-weight: 600; }

/* 辅助信息折叠区 */
.map-more {
  margin-top: 10px;
  font-size: 12.5px;
  color: #7A776B;
}
.map-more > summary {
  cursor: pointer;
  list-style: none;
  display: inline-flex; align-items: center; gap: 5px;
  padding: 4px 0;
  color: #8A8779;
  user-select: none;
}
.map-more > summary::-webkit-details-marker { display: none; }
.map-more > summary::before {
  content: "▸";
  font-size: 10px; line-height: 1;
  transition: transform .15s;
  display: inline-block;
}
.map-more[open] > summary::before { transform: rotate(90deg); }
.map-more-body { padding-top: 6px; }
.map-more .map-tip { margin-top: 0; }
.map-more .map-stats { margin-top: 8px; }
.map-more .preset-bar { margin-top: 8px; }
.map-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 10px;
}
.map-head h2 { font-size: 14px; font-weight: 600; }
.map-actions { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.btn.sm { padding: 6px 12px; font-size: 12.5px; }

/* ---------- 四步向导：顶部可点击导航 ---------- */
.wizard {
  display: flex;
  gap: 8px;
  padding: 5px 20px;
  background: #fff;
  border-bottom: 1px solid #E4E2D8;
  position: sticky;
  top: var(--topbar-h, 46px);
  z-index: 9;
  overflow-x: auto;
}
.wz {
  flex: 1 1 0;
  min-width: 150px;
  display: flex;
  gap: 8px;
  align-items: flex-start;
  text-align: left;
  background: #FAF9F5;
  border: 1px solid #E4E2D8;
  border-radius: 9px;
  padding: 4px 9px;
  cursor: pointer;
  font-family: inherit;
  transition: background .15s, border-color .15s;
}
.wz:hover:not(.locked):not(.active) { background: #F1EFE8; }
.wz-idx {
  width: 18px; height: 18px;
  border-radius: 50%;
  background: #E4E1D6;
  color: #7A776B;
  font-size: 10.5px;
  display: flex; align-items: center; justify-content: center;
  flex: 0 0 auto; margin-top: 1px;
}
.wz-body { display: flex; flex-direction: column; min-width: 0; }
.wz-t { font-size: 12px; font-weight: 600; color: #3A3934; white-space: nowrap; line-height: 1.45; }
.wz-d { font-size: 10.5px; color: #98968C; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; line-height: 1.4; }
.wz.done { background: #F2F9F5; border-color: #C6E3D7; }
.wz.done .wz-idx { background: #9CC9B4; color: #fff; font-size: 0; }
.wz.done .wz-idx::before { content: "✓"; font-size: 11px; }
.wz.active { background: #E1F5EE; border-color: #1D9E75; box-shadow: 0 0 0 2px rgba(29,158,117,.12); }
.wz.active .wz-idx { background: #1D9E75; color: #fff; font-size: 11.5px; }
.wz.active .wz-idx::before { content: ""; }
.wz.active .wz-t { color: #0F6E56; }
.wz.locked { opacity: .5; cursor: not-allowed; }

/* ---------- 按步骤切换页面 ---------- */
/* v3.31：步骤标题/说明条（.stage-head）已整体删除，省出一行高度 */
.page { display: none; }
body[data-step="1"] #pageMap { display: block; }
body[data-step="4"] #pageResult { display: block; }

.pane { display: none; }
body[data-step="2"] #paneTape { display: block; }
body[data-step="3"] #paneRg { display: block; }
.pane-legacy { display: none; }

/* 面板底部说明 / 面板内跳转链接按钮 */
.pane-foot {
  margin-top: 14px;
  padding: 8px 10px;
  border-radius: 8px;
  background: #F7F6F0;
  font-size: 11.5px;
  line-height: 1.6;
  color: #7A7869;
  /* v3.57：第三步底部压成一行（链接 + 一句警示） */
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
}
.pane-foot .pf-warn { color: #B3261E; font-size: 11px; }
.linkbtn {
  border: none;
  background: none;
  padding: 0;
  font: inherit;
  color: #0F6E56;
  font-weight: 600;
  text-decoration: underline;
  cursor: pointer;
}
.linkbtn:hover { color: #1D9E75; }

/* ---------- 第 2 步：纯参数页（v3.58 甲方「把预览图拿掉，只进行参数输入」） ----------
 * 改成**单栏**：参数面板占满整页宽，内部滚动；
 * 原来「左栏 : 画布 ≈ 1.15 : 1」的两栏口径随预览图一起去掉。
 * 画布只在第 3 步（编辑）和第 4 步（成果）出现。 */
body[data-step="2"] .layout {
  grid-template-columns: minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 0;
  height: calc(100vh - var(--chrome-h, 146px) - 2px);
  padding: 10px 18px 12px;
  align-items: stretch;
}
/* 第 2 步整页不滚动，超出的只在参数面板内部滚动 */
body[data-step="2"] { overflow: hidden; }
body[data-step="2"] .stage { display: none; }   /* 无画布，舞台整体不占位 */
body[data-step="2"] .step-nav { margin: 8px 0 0; }

/* 第 2 步面板内容较长（滴灌带 + 管径 + 水源 + 计算结果 + 面积表），超高时面板内部滚动 */
body[data-step="2"] #sidePanel {
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 10px 14px;
}
body[data-step="2"] #sidePanel::-webkit-scrollbar { width: 8px; }
body[data-step="2"] #sidePanel::-webkit-scrollbar-thumb { background: #DEDBD0; border-radius: 4px; }

/* 第 2 步面板：两列并排，字段间距按无说明文字重新排 */
body[data-step="2"] .panel h2 { margin: 10px 0 5px; padding-bottom: 4px; font-size: 12px; }
body[data-step="2"] .panel h2:first-child { margin-top: 0; }
body[data-step="2"] .field { margin-bottom: 7px; }
body[data-step="2"] .field label { font-size: 11.5px; margin-bottom: 2px; }
body[data-step="2"] .field input,
body[data-step="2"] .field select { padding: 5px 8px; font-size: 13px; }
body[data-step="2"] .pipe-hint { margin-top: 3px; font-size: 10px; line-height: 1.4; }
body[data-step="2"] .tape-hint { margin-top: 3px; font-size: 10px; line-height: 1.4; }
body[data-step="2"] .tape-warn { margin-top: 4px; font-size: 10.5px; padding: 5px 7px; line-height: 1.4; }
body[data-step="2"] .pane-foot { margin-top: 8px; padding: 5px 8px; font-size: 10.5px; }
/* 第 2 步的计算结果：紧凑行 */
body[data-step="2"] .rg-summary { gap: 0; }
body[data-step="2"] .rg-summary .rg-row { padding: 2.5px 0; font-size: 11.5px; }

/* 两列字段网格（第 2 步） */
.field-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0 10px;
}
/* 第 2 步左栏加宽后（v3.32）：输入字段改三列，给灌溉小区面积表腾纵向空间 */
/* v3.58：第 2 步去掉画布后整页变宽，字段会被拉到 400+px 一行（读起来发散）。
 * 给参数面板加**最大宽度并居中**，超宽屏留白而不拉长输入框。 */
body[data-step="2"] #sidePanel {
  width: 100%;
  max-width: 1080px;
  margin: 0 auto;
}
body[data-step="2"] .field-grid { grid-template-columns: repeat(3, 1fr); gap: 0 18px; }
body[data-step="2"] .field-grid .field input,
body[data-step="2"] .field-grid .field select { max-width: 260px; }
.field-grid .field { min-width: 0; margin-bottom: 9px; }
.field-grid .field label { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.pipe-check { display: grid; gap: 2px; }
.pipe-check .pipe-hint { margin-top: 0; }

/* 第 1、4 步不需要左栏，主区占满 */
body[data-step="1"] .layout,
body[data-step="4"] .layout { grid-template-columns: 1fr; }
body[data-step="1"] #sidePanel,
body[data-step="4"] #sidePanel { display: none; }
body[data-step="1"] .stage { max-width: 1180px; margin: 0 auto; width: 100%; }

/* ===== v5.21（甲方 2026-11-26「第四步成果与导出页面整体视觉混乱了，你整体重新布局」）=====
 * 旧版的问题（逐条对应，改的时候别改回去）：
 *   ① 4 张表外观完全一样、纵堆 2100 px → 分不清"指标/清单/安排/明细"；
 *   ② 卡片 7 张排 4 列 → 第二行空 1 格 + 右侧大块白；
 *   ③ 「轮灌计算」2 列占满 1034 px，右边全空；
 *   ④ 「逐小区明细」108 行独占整宽，把页面撑到 3 屏多；
 *   ⑤ 右栏图例+缩放条吃掉画布近 1/3 高度。
 *
 * 新布局：右栏预览（约 1/4 宽、sticky）+ 左栏四个语义区块，
 * 其中第②块内部再分两栏（方案参数 | 材料清单），让短表并排而不是各占一整行。
 */
body[data-step="4"] .stage {
  display: grid;
  grid-template-columns: minmax(0, 1fr) clamp(280px, 26%, 420px);
  gap: 18px;
  align-items: start;
  max-width: 1620px;
  margin: 0 auto;
  width: 100%;
  padding-bottom: 28px;
}
body[data-step="4"] #designWrap {
  grid-column: 2;
  grid-row: 1;
  position: sticky;
  top: calc(var(--topbar-h, 46px) + var(--wizard-h, 48px) + 12px);
  margin: 0;
  padding: 10px;
}
body[data-step="4"] #pageResult {
  grid-column: 1;
  grid-row: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 14px;
}

/* 抽屉式：窄屏（<1180px）预览图回到顶部一行、不再 sticky */
@media (max-width: 1180px) {
  body[data-step="4"] .stage { grid-template-columns: minmax(0, 1fr); }
  body[data-step="4"] #designWrap {
    grid-column: 1; grid-row: 1; position: static; margin-bottom: 4px;
  }
  body[data-step="4"] #pageResult { grid-column: 1; grid-row: 2; }
  body[data-step="4"] #cv { height: clamp(280px, 40vh, 420px); }
}

/* 右栏画布：窄栏要更高才有面积；图例/缩放条压成条目式，不占大块高度 */
body[data-step="4"] #cv { height: clamp(320px, 48vh, 540px); }
body[data-step="4"] .legend {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap: 3px 8px;
  padding: 8px 2px 0;
  font-size: 10.5px;
  line-height: 1.45;
}
body[data-step="4"] .legend .sw { margin-right: 4px; }
body[data-step="4"] .zoom-ctl {
  margin: 6px 0 0;
  width: 100%;
  justify-content: space-between;
  padding: 3px 6px;
}
body[data-step="4"] .zoom-ctl .edit-ctl,
body[data-step="4"] #btnMeasure { display: none; }

/* ---------- 顶部工具条：兼作页面标题（方案规模摘要） ---------- */
body[data-step="4"] .res-tools {
  margin: 0;
  padding: 9px 14px;
  background: #fff;
  border: 1px solid #E4E2D8;
  border-radius: 10px;
  font-size: 12.5px;
  color: #5A5852;
}
body[data-step="4"] .res-tools-tip {
  font-weight: 600;
  color: #0F6E56;
  font-variant-numeric: tabular-nums;
  letter-spacing: .1px;
}

/* ---------- ① 关键指标卡片：自适应列宽，绝不留空格 ---------- */
/* 卡片：**固定 3 列 × 2 行**，正好排满 6 张，不留空格。
 *
 * 试过的列数（记录一下，别再往回改）：
 *   · auto-fit + minmax(148px,1fr) → 1018 px 排出 **6+1**；
 *   · repeat(4, 1fr) → 6 张排出 **4+2**，第二行右边空 2 格；
 *   · repeat(3, 1fr) → 6 张排出 **3+3**，满格且每张 330 px，
 *     副标题（「方向 343° · 单边 100 m」这类）一行就能放下，不再折行。
 * 卡片总数控制在 6 张（种植方向已并入「支管行」），这是 3 列的整数倍。 */
body[data-step="4"] #cards {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 10px;
  margin: 0;
}
@media (max-width: 900px) {
  body[data-step="4"] #cards { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
body[data-step="4"] .cards { margin: 0; }
body[data-step="4"] .card {
  padding: 11px 13px;
  border-radius: 10px;
  border-color: #E6E4DA;
}
body[data-step="4"] .card .k { font-size: 11.5px; }
body[data-step="4"] .card .v { font-size: 19px; margin-top: 1px; }
body[data-step="4"] .card .d { font-size: 11px; color: #A9A79C; }

/* ---------- ② 方案参数 | 材料清单 两栏并排 ---------- */
body[data-step="4"] .res-duo {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr);
  gap: 14px;
  align-items: start;
}
@media (max-width: 900px) {
  body[data-step="4"] .res-duo { grid-template-columns: minmax(0, 1fr); }
}

/* ---------- 统一的表格卡片外观：标题条 + 内容区 ---------- */
body[data-step="4"] .table-wrap {
  padding: 0;
  overflow: hidden;
  border-radius: 10px;
}
body[data-step="4"] .table-wrap > h2 {
  margin: 0;
  padding: 10px 14px;
  font-size: 13px;
  font-weight: 600;
  color: #2C2C2A;
  background: #FAF9F4;
  border-bottom: 1px solid #EDEBE2;
  letter-spacing: .2px;
}
/* 表头右侧的 CSV 小按钮 */
body[data-step="4"] .table-wrap > h2 .tbl-csv,
body[data-step="4"] .table-wrap > h2 .linkbtn {
  float: right;
  font-size: 11.5px;
  font-weight: 400;
  line-height: 1.7;
  color: #1D9E75;
}
body[data-step="4"] .table-wrap > h2 .linkbtn:hover { text-decoration: underline; }
body[data-step="4"] .table-wrap > h2 .mat-sub {
  margin-left: 8px;
  font-size: 11px;
  font-weight: 400;
  color: #A9A79C;
}

/* 方案参数表：两列，行高紧凑 */
body[data-step="4"] .calc-table { font-size: 12.5px; }
body[data-step="4"] .calc-table th { display: none; }   /* 两列表不需要表头 */
body[data-step="4"] .calc-table td { padding: 7px 14px; }
body[data-step="4"] .calc-table .ct-k {
  color: #7A7869;
  white-space: nowrap;
  width: 42%;
}
body[data-step="4"] .calc-table .ct-v {
  color: #2C2C2A;
  font-variant-numeric: tabular-nums;
}
body[data-step="4"] .calc-table tr:nth-child(odd) td { background: #FCFCFA; }

/* 材料清单：材料 / 数量 / 说明 三列 */
body[data-step="4"] #mat { font-size: 12.5px; }
body[data-step="4"] #mat th { padding: 7px 12px; font-size: 11.5px; }
body[data-step="4"] #mat td {
  padding: 9px 12px; vertical-align: top;
  text-align: center;                       /* v5.27 甲方：表格数据居中 */
}
/* ⚠ 材料表的「说明」列是长句（规格/用途），居中会让每行首尾错位、很难读 ——
 * 这一列单独保留左对齐。其余（品名/数量/单位）居中。
 * v5.27：**不受 data-step 限制** —— 材料表只在第 4 步出现，多写一层
 * `body[data-step="4"]` 只会在"第 4 步但 data-step 还没同步"时失效（探针实测踩过）。 */
#mat td.mat-note { text-align: left; }
#mat td.mat-name { text-align: center; }
#mat td.num { text-align: center; }
body[data-step="4"] #mat .mat-name {
  font-weight: 600;
  color: #2C2C2A;
  white-space: nowrap;
}
body[data-step="4"] #mat td.num {
  font-size: 14px;
  color: #0F6E56;
  white-space: nowrap;
  text-align: center;                       /* v5.27 甲方：表格数据居中 */
}
body[data-step="4"] #mat th { text-align: center; }
body[data-step="4"] #mat th:nth-child(2) { text-align: center; }
body[data-step="4"] #mat .mat-note {
  font-size: 11px;
  color: #A9A79C;
  line-height: 1.55;
}
/* 规格单独一行（淡色小字），构成说明在下一行 —— 靠**行内分隔符**断开，
 * 不用 block 各占一行：block 会让每张材料卡的说明列都变成 2~3 行，
 * 4 张卡就把卡片区撑高 60 px。用"·"软换行 + 单行省略更紧凑。
 * ⚠ 规格文本必须留在 DOM（CSV 导出读 DOM），所以只做视觉压缩、不隐藏。 */
body[data-step="4"] #mat .mat-spec {
  display: block;
  color: #8A8880;
  margin-bottom: 2px;
  font-size: 10.5px;
  line-height: 1.5;
}
/* 说明列限宽，避免长句把「数量」列挤窄 */
body[data-step="4"] #mat td.mat-note { max-width: 0; width: 58%; }

/* ---------- ③ 轮灌安排 ---------- */
body[data-step="4"] #rgTableWrap .bt-sum {
  margin: 12px 14px 8px;
  padding: 8px 12px;
  border-radius: 8px;
  background: #F6F9F7;
  border-color: #E3EBE5;
}
body[data-step="4"] #rgTableWrap .bt-table { font-size: 12.5px; }
body[data-step="4"] #rgTableWrap .bt-table th {
  padding: 8px 14px;
  background: #FCFCFA;
}
body[data-step="4"] #rgTableWrap .bt-table td { padding: 9px 14px; }
body[data-step="4"] #rgTableWrap .bt-foot {
  margin: 0;
  padding: 8px 14px 12px;
  font-size: 11px;
}

/* ---------- ④ 逐小区明细：限高 + 内部滚动 + 粘性表头 ---------- */
body[data-step="4"] .tbl-scroll {
  max-height: 420px;
  overflow-y: auto;
  scrollbar-width: thin;
}
body[data-step="4"] .tbl-scroll::-webkit-scrollbar { width: 8px; }
body[data-step="4"] .tbl-scroll::-webkit-scrollbar-thumb {
  background: #DEDBD0; border-radius: 4px;
}
body[data-step="4"] .valve-table { font-size: 12px; }
body[data-step="4"] .valve-table thead th {
  position: sticky;
  top: 0;
  z-index: 2;
  background: #FAF9F4;
  box-shadow: inset 0 -1px 0 #EDEBE2;
}
/* 逐小区明细：109 行，压缩到每行 26 px（原 34 px）——
 * 一屏能多看 1/3 行，配合 420 px 限高正好一屏 16 行。
 * 行高用 padding + line-height 一起压，单压 padding 会被行高撑回来。 */
body[data-step="4"] .valve-table td {
  padding: 3px 14px;
  line-height: 1.55;
  font-size: 11.5px;
}
body[data-step="4"] .valve-table th { padding: 6px 14px; font-size: 11px; }
/* 合计行强调 */
body[data-step="4"] .valve-table tr.sum td {
  font-weight: 600;
  color: #0F6E56;
  background: #F7FAF8;
  border-top: 1px solid #E3EBE5;
}
/* 阀门色块沿用全局 .vchip（8px 小方块），第 4 步不再额外放大 */
body[data-step="4"] .valve-table .vchip { border-radius: 50%; }
/* 第 3 步：与第 2 步同一套"一屏"布局，右侧出整体设计图 */
body[data-step="3"] { overflow: hidden; }
body[data-step="3"] .stage {
  display: flex;
  flex-direction: column;
  min-height: 0;
  height: 100%;
  max-width: none;
}
body[data-step="3"] .layout {
  /* v3.69（甲方 2026-11-23「第三步左侧的图层和重新生成设计那栏需要窄一些」）：
     本步左栏只有「生成闸门 + 图层 + 检查摘要」，没有输入框，不需要 348px 的字段宽度。
     收窄到 264px（省 84px 全给画布），同时压缩图层行的横向间距与描述字号，避免挤压换行。 */
  grid-template-columns: 264px minmax(0, 1fr);
  grid-template-rows: minmax(0, 1fr);
  gap: 14px;
  height: calc(100vh - var(--chrome-h, 146px) - 2px);
  padding: 10px 18px 12px;
  align-items: stretch;
  max-width: none;
}
body[data-step="3"] #designWrap {
  display: flex;
  flex-direction: column;
  flex: 1 1 auto;
  min-height: 0;
  padding: 8px;
}
body[data-step="3"] .canvas-box { flex: 1 1 auto; min-height: 0; }
body[data-step="3"] .canvas-box #cv { position: absolute; inset: 0; width: 100%; height: 100%; }
body[data-step="3"] .legend { flex: 0 0 auto; padding: 6px 4px 0; gap: 13px; font-size: 12px; }
body[data-step="3"] .step-nav { flex: 0 0 auto; margin: 8px 0 0; }
body[data-step="3"] #sidePanel {
  max-height: 100%;
  overflow-y: auto;
  scrollbar-width: thin;
  padding: 10px 12px;
}
body[data-step="3"] #sidePanel::-webkit-scrollbar { width: 8px; }
body[data-step="3"] #sidePanel::-webkit-scrollbar-thumb { background: #DEDBD0; border-radius: 4px; }
body[data-step="3"] .rg-summary .rg-row { padding: 3px 0; font-size: 11.5px; }
body[data-step="3"] .panel h2 { margin: 10px 0 6px; font-size: 12px; }
body[data-step="3"] .rg-table-wrap { max-height: none; }

/* 步骤操作条 */
.step-nav {
  display: flex;
  align-items: center;
  gap: 12px;
  margin: 14px 0 4px;
}
.step-nav-tip { flex: 1 1 auto; font-size: 12.5px; color: #888780; }

/* 轮灌组摘要（第 3 步左栏） */
.rg-summary { font-size: 12.5px; color: #5A5852; line-height: 1.6; }
.rg-summary .rg-row {
  display: flex; justify-content: space-between; gap: 8px;
  padding: 5px 0; border-bottom: 1px dashed #EDEBE2;
}
.rg-summary .rg-row:last-child { border-bottom: none; }
.rg-summary .rg-row b { color: #0F6E56; font-weight: 600; text-align: right; }
.rg-summary .rg-row b .rg-sub {
  display: block; font-style: normal; font-weight: 400;
  font-size: 10.5px; color: #9A978A; letter-spacing: 0;
}
.rg-summary .rg-note {
  margin-top: 8px; padding: 7px 9px; border-radius: 8px;
  background: #F7F6F0; color: #7A7869; font-size: 11.5px; line-height: 1.5;
}
/* v3.71（甲方 2026-11-23「第4步上轮灌组整体拿掉」）：
 * 原 .rg-derive（推导过程折叠条）随 renderRgSummary 一起删除，样式不再保留。
 * 其余折叠样式（.mc-derive / .lp-help）仍在使用，见下文。 */
/* ⚠ 告警常显区：不能藏（干管穿出地块这类必须立刻改方案的） */
.rg-summary .rg-note.rg-warn { background: #FDF4E3; color: #7A4A00; border: 1px solid #F0DDB4; }
/* 手动调整状态：一行足够（详细推导在下面的折叠区） */
.rg-summary .rg-note.rg-man { background: #EFF6F1; color: #2F6B4F; border: 1px solid #D5E5DA; }
/* 手动调整检查的操作说明同样折叠（与图层面板 lp-foot 内容重复） */
.mc-hint { line-height: 1.5; }
.mc-hint .mc-none { display: inline-block; color: #7A7869; font-size: 11.5px; }
.mc-hint .mc-derive { display: inline; margin-left: 6px; }
.mc-hint .mc-derive > summary {
  display: inline; cursor: pointer; list-style: none; color: #6F6D62; font-size: 11px;
  padding: 2px 5px; border-radius: 5px; background: #F2F1EA; user-select: none;
}
.mc-hint .mc-derive > summary::-webkit-details-marker { display: none; }
.mc-hint .mc-derive > summary::before { content: "▸ "; color: #A9A79C; }
.mc-hint .mc-derive[open] > summary::before { content: "▾ "; }
.mc-hint .mc-derive[open] > summary { background: #ECEBE2; }
.mc-hint .mc-hint-body {
  margin-top: 5px; padding: 7px 9px; border-radius: 7px;
  background: #F7F6F0; color: #7A7869; font-size: 11px; line-height: 1.55;
}

.btn.success { background: #1D9E75; color: #fff; border: none; }
.btn.success:hover { background: #0F6E56; }
.btn:disabled, .btn[disabled] { opacity: 0.45; cursor: not-allowed; pointer-events: none; }

/* 进入第三步时，布置方案区高亮一下 */
@keyframes stageFlash {
  0% { box-shadow: 0 0 0 0 rgba(29,158,117,0.0); }
  30% { box-shadow: 0 0 0 6px rgba(29,158,117,0.35); }
  100% { box-shadow: 0 0 0 0 rgba(29,158,117,0.0); }
}
.stage-flash { animation: stageFlash 1.6s ease-out 2; border-radius: 10px; }

/* ===== v3.64（甲方 2026-11-22「轮灌计算处以表格形式显示」「灰色字体不再显示」）=====
 * 轮灌计算改成两列表格：左列项目、右列数值，去掉所有灰色小字副行。
 * 行高收紧（第 2 步要一屏放下 9 项 + 3 节参数）。 */
.calc-table { width: 100%; border-collapse: collapse; }
.calc-table th {
  text-align: left; font-size: 11.5px; font-weight: 600; color: #6B6A63;
  padding: 5px 8px; border-bottom: 1px solid #E3E1D8; background: #FAF9F4;
}
.calc-table td { padding: 6px 8px; font-size: 12.5px; border-bottom: 1px solid #F0EEE6; }
.calc-table tr:last-child td { border-bottom: none; }
.calc-table .ct-k { color: #4A4943; width: 38%; white-space: nowrap; }
.calc-table .ct-v { color: #1F1E1A; font-weight: 600; font-variant-numeric: tabular-nums; }
/* v3.65：轮灌小区超水源 >10% 余量时（真拦截）的强调色 */
.calc-table .ct-bad { color: #C0392B; font-weight: 700; }

/* v3.64：第 2 步不再显示灰色提示（甲方「灰色字体不再显示」）。
 * 只隐藏「无问题的灰字」，**告警仍要显示**（红色 / over 态）——
 * 否则管径超限、超铺长这类必须改的问题会看不见。
 * tape-warn / pipe-hint.over 都不在隐藏范围内。 */
/* v3.64：第 2 步的**灰色说明**不再显示（甲方「灰色字体不再显示」）。
 * 但**超限告警必须能看见** —— .pipe-hint 由 renderPipeCheck 控制 style.display，
 * 这里不再用 display:none 一刀切（否则超限也不显示，等于把红线藏起来）。
 * 注释类灰字（.tape-hint）直接隐藏，红色告警（.tape-warn）保留。 */
body[data-step="2"] .tape-hint { display: none; }
body[data-step="2"] .pipe-hint { color: #C0392B; font-weight: 600; }
body[data-step="2"] .tape-warn[hidden] { display: none !important; }
body[data-step="2"] .tape-warn:not([hidden]) { display: block; }

/* 管网管径校核提示 */
.pipe-hint {
  margin-top: 6px;
  font-size: 12px;
  color: #98968C;
  line-height: 1.5;
}
.pipe-hint.over { color: #C0392B; font-weight: 600; }
input.over { border-color: #C0392B !important; background: #FDEDEC; }

.hint-inline { font-size: 11px; font-weight: 400; color: #98968C; }
.tape-hint {
  margin-top: 6px;
  font-size: 12px;
  color: #98968C;
  line-height: 1.5;
}
.tape-warn {
  margin-top: 6px;
  font-size: 12.5px;
  color: #C0392B;
  background: #FDEDEC;
  border: 1px solid #F5B7B1;
  border-radius: 8px;
  padding: 7px 10px;
  line-height: 1.5;
}
#planLen.over { border-color: #C0392B; outline: 2px solid rgba(192,57,43,0.25); }
.dir-ctrl {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  padding: 4px 10px;
  border: 1px solid #E7C14D;
  background: #FFF8E1;
  border-radius: 8px;
  font-size: 12.5px;
  color: #8A6D1A;
}
.dir-ctrl input {
  width: 64px;
  padding: 4px 6px;
  border: 1px solid #E0CE7A;
  border-radius: 6px;
  font-size: 12.5px;
  text-align: center;
  background: #fff;
}
.dir-ctrl input:focus { outline: 2px solid #E7C14D; border-color: #C9A227; }
.dir-ctrl.disabled { opacity: 0.45; }
#map {
  width: 100%;
  /* v5.34：甲方「大面积放地图」—— 从 58vh 提到 68vh（桌面），手机上由断点接管。
   * 上限 860 是为了在超宽屏上不至于把底部操作条推到屏幕外。 */
  height: clamp(460px, 68vh, 860px);
  border-radius: 10px;
  position: relative;
  z-index: 1;
}

.map-search { position: relative; z-index: 50; margin-bottom: 10px; }
.map-search input {
  width: 100%;
  padding: 9px 14px;
  border: 1px solid #D3D1C7;
  border-radius: 8px;
  font-size: 14px;
  background: #FDFDFB;
}
.map-search input:focus { outline: 2px solid #5DCAA5; border-color: #1D9E75; }
.search-results {
  position: absolute;
  top: calc(100% + 4px);
  left: 0; right: 0;
  background: #fff;
  border: 1px solid #E4E2D8;
  border-radius: 8px;
  max-height: 280px;
  overflow-y: auto;
  z-index: 1000;
  display: none;
}
.search-results.show { display: block; }
.search-item {
  padding: 8px 14px;
  cursor: pointer;
  border-bottom: 1px solid #F1EFE8;
  user-select: none;
}
.search-item:last-child { border-bottom: none; }
.search-item:hover,
.search-item.hover { background: #D3D1C7; }
.search-item .t { font-size: 13.5px; color: #2C2C2A; }
.search-item .a { font-size: 12px; color: #888780; }
.search-empty { padding: 10px 14px; font-size: 12.5px; color: #888780; }
.map-tip { font-size: 12px; color: #888780; margin-top: 8px; }
.map-stats { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 10px; }
.chip {
  background: #F1EFE8;
  border-radius: 8px;
  padding: 6px 12px;
  font-size: 12.5px;
  color: #444441;
}
.chip b { color: #0F6E56; font-weight: 600; }

/* ---------- 预设状态条（地块记忆） ---------- */
.preset-bar {
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 10px;
  padding: 8px 12px;
  border-radius: 9px;
  font-size: 12.5px;
  line-height: 1.5;
  border: 1px solid #E4E2D8;
  background: #FAF9F5;
  color: #5A5852;
}
.preset-bar.ok { border-color: #C6E3D7; background: #F2F9F5; color: #3B4A44; }
.preset-bar.ok b { color: #0F6E56; }
.preset-bar .pb-dot {
  width: 8px; height: 8px; border-radius: 50%;
  background: #C7C5BB; flex: 0 0 auto;
}
.preset-bar.ok .pb-dot { background: #1D9E75; }
.preset-bar.empty .pb-dot { background: #D9A12B; }
.preset-bar.bad { border-color: #E7C7C7; background: #FBF3F3; color: #7A4A4A; }
.preset-bar.bad b { color: #B23B3B; }
.preset-bar.bad .pb-dot { background: #C25B5B; }
.preset-bar .pb-txt { flex: 1 1 320px; min-width: 0; }
.preset-bar .pb-src { color: #8A877E; margin-left: 4px; }
.preset-bar .pb-btn {
  flex: 0 0 auto;
  border: 1px solid #D8D6CB;
  background: #fff;
  color: #444441;
  border-radius: 7px;
  padding: 4px 10px;
  font-size: 12px;
  cursor: pointer;
  font-family: inherit;
}
.preset-bar .pb-btn:hover { background: #F1EFE8; }
.preset-bar .pb-btn.primary { border-color: #1D9E75; color: #0F6E56; font-weight: 600; }
.preset-bar .pb-btn.primary:hover { background: #EAF6F1; }
.preset-bar .pb-btn.danger { color: #B23B3B; border-color: #E7C7C7; }
.preset-bar .pb-btn.danger:hover { background: #FBF0F0; }
.preset-bar .pb-btn:disabled { opacity: .45; cursor: not-allowed; }
/* ---------- 布置图画布：第 3、4、5 步显示 ---------- */
.canvas-wrap {
  background: #fff;
  border: 1px solid #E4E2D8;
  border-radius: 12px;
  padding: 12px;
  display: none;
}
body[data-step="3"] #designWrap,
body[data-step="4"] #designWrap { display: block; }
/* v3.58（甲方 2026-11-21「把预览图拿掉，只进行参数输入」）：
 * 第 2 步不再显示布置图 —— 画布只在第 3 步（编辑）和第 4 步（成果）出现。 */
.canvas-box { position: relative; background: #fff; }
#cv { width: 100%; height: 480px; display: block; cursor: grab; touch-action: none; }
#cv.grabbing { cursor: grabbing; }
/* v5.19：右栏变窄（约 1/4 宽），高度要按视口给足才有面积 ——
 * clamp(300, 46vh, 520)：900 高屏 → 414 px，配合 320 宽 ≈ 13 万 px²，
 * 相对 1500×900 视口约 9.6%（"占面积四分之一"指的是**版面四分之一宽度**，
 * 不是画布像素占比；甲方原话是"预览图占面积做到四分之一"，即分栏比例）。 */
body[data-step="4"] #cv { height: clamp(300px, 46vh, 520px); }
/* v3.70（甲方 2026-11-23「第四步的图占比缩小到屏幕的二分之一以下，测距以及图上灰色文字拿掉」）：
 *  ① 画布原为固定 420px —— 在 900px 高的屏幕上，图纸区（画布 + 图例 + 内边距）实测 545px = 60%，
 *     超过半个屏幕。改为按视口算：30vh（上限 330），900 高 → 270 + 图例 ≈ 383px = 43%。
 *  ② 第 4 步是成果页（只读看结果），不需要测距工具；按钮藏起来，M 快捷键也在 app.js 里同步禁用。  */
body[data-step="4"] #btnMeasure { display: none; }
/* 第 4 步成果图不要操作提示（「滚轮缩放 · 拖动平移 · 双击复位」的灰字） */
body[data-step="4"] .zoom-tip { display: none; }

/* 画布缩放控件（放在图例行右侧，不遮挡图面） */
.zoom-ctl {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 1px;
  padding: 1px 3px;
  background: #F7F6F0;
  border: 1px solid #E6E3D8;
  border-radius: 8px;
}
.zoom-ctl .zc {
  min-width: 24px; height: 22px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; border-radius: 5px;
  font-family: inherit; font-size: 15px; line-height: 1; color: #444441;
  cursor: pointer;
}
.zoom-ctl .zc:hover { background: #EAF6F1; color: #0F6E56; }
.zoom-ctl .zc:active { background: #D7EFE5; }
.zoom-ctl .zc-text { padding: 0 6px; font-size: 11px; }
.zoom-ctl .zc-text.on { background: #FBE7DD; color: #B5235A; }
.zoom-ctl .zc-val {
  min-width: 38px;
  text-align: center;
  font-size: 11px;
  color: #5F5E5A;
  font-variant-numeric: tabular-nums;
}
.zoom-tip {
  position: absolute;
  right: 10px; bottom: 6px;
  z-index: 2;
  padding: 1px 7px;
  border-radius: 6px;
  background: rgba(255,255,255,.72);
  font-size: 10.5px;
  color: #B4B2A9;
  pointer-events: none;
  opacity: 1;
  transition: opacity .3s;
}
.zoom-tip.hide { opacity: 0; }

/* 测距提示条（画布左上角） */
.measure-tip {
  position: absolute;
  left: 10px; top: 8px;
  z-index: 3;
  padding: 4px 9px;
  border-radius: 7px;
  background: rgba(255,255,255,.93);
  border: 1px solid #F0C9BA;
  box-shadow: 0 1px 4px rgba(120,60,40,.10);
  font-size: 11.5px;
  color: #8E3352;
  font-variant-numeric: tabular-nums;
  pointer-events: none;
}
.measure-tip b { color: #B5235A; font-weight: 600; }

.legend {
  display: flex;
  flex-wrap: wrap;
  gap: 18px;
  padding: 12px 6px;
  font-size: 12.5px;
  color: #5F5E5A;
}
.legend .sw {
  display: inline-block;
  width: 18px;
  height: 4px;
  border-radius: 2px;
  margin-right: 6px;
  vertical-align: middle;
}
.sw.tape { background: #2C7A5B; height: 2px; }
.sw.sub { background: #1FA8E0; height: 3px; }
.sw.main { background: #0A3D6E; height: 4px; }
.sw.src { background: #C0392B; width: 9px; height: 9px; border-radius: 50%; }
.sw.valve { background: none; border: none; width: 13px; height: 18px; border-radius: 0; }
.sw.valve svg { display: block; width: 13px; height: 18px; }
.sw.dirline { background: #C8940A; height: 2px; }
.sw.fit { background: #0E4C7E; width: 8px; height: 8px; border-radius: 50%; }
/* v3.63：偏离小区橙色高亮（P1-2 警示档）—— 与 app.js 的 P12_FILL/P12_EDGE 同色 */
.sw.p12 { background: hsl(28,92%,46%); width: 11px; height: 11px; border-radius: 2px;
  outline: 1px solid hsla(32,95%,58%,.55); outline-offset: 1px; }

.cards {
  display: none;
  grid-template-columns: repeat(auto-fill, minmax(180px, 1fr));
  gap: 12px;
  margin: 8px 0 20px;
}
body[data-step="4"] #cards { display: grid; }
/* v3.57 极简：固定 4 列 —— 8 张卡正好两行，不再出现"第 8 张独占一行" */
body[data-step="4"] .cards { grid-template-columns: repeat(4, 1fr); }
@media (max-width: 760px) {
  body[data-step="4"] .cards { grid-template-columns: repeat(2, 1fr); }
}
.card {
  background: #fff;
  border: 1px solid #E4E2D8;
  border-radius: 12px;
  padding: 14px 16px;
}
/* v3.57 极简：卡片更紧凑（为 APP / 手机屏做准备） */
@media (max-width: 900px) {
  #cards { grid-template-columns: repeat(auto-fill, minmax(140px, 1fr)); gap: 8px; }
  .card { padding: 10px 12px; border-radius: 10px; }
  .card .v { font-size: 17px; }
  .card .d { font-size: 11px; }
}
.card .k { font-size: 12px; color: #888780; }
.card .v { font-size: 20px; font-weight: 600; color: #0F6E56; margin-top: 2px; }
.card .u { font-size: 12px; color: #888780; font-weight: 400; margin-left: 3px; }
.card .d { font-size: 11.5px; color: #B4B2A9; margin-top: 2px; }

.table-wrap {
  background: #fff;
  border: 1px solid #E4E2D8;
  border-radius: 12px;
  padding: 18px;
}
.table-wrap h2 { font-size: 14px; font-weight: 600; margin-bottom: 10px; }
/* v3.74（甲方「以上所有表格支持一键导出」）：表标题右侧的 CSV 小按钮 + 顶部一键导出行。
   h2 里放 button 会让基线错位，用 float 靠右最省事（不引入 flex 影响其它 h2 的 .mat-sub）。 */
.table-wrap h2 .tbl-csv {
  float: right; font-size: 11.5px; font-weight: 400; line-height: 1.5;
  text-decoration: none; color: #1D9E75; padding: 0 2px;
}
.table-wrap h2 .tbl-csv::after { content: " ↓"; color: #7FC3A7; }
.table-wrap h2 .tbl-csv:hover { color: #0F6E56; text-decoration: underline; }
.res-tools {
  display: flex; align-items: center; gap: 10px;
  margin: 0 0 10px; padding: 6px 10px;
  background: #F7F6F0; border: 1px solid #E6E3D8; border-radius: 8px;
  font-size: 11.5px; color: #7A7869;
}
.res-tools-tip { flex: 1; }
.res-tools .all-csv { font-size: 12.5px; white-space: nowrap; text-decoration: none; }
.res-tools .all-csv:hover { text-decoration: underline; }
table { width: 100%; border-collapse: collapse; font-size: 13px; }
th, td { text-align: left; padding: 8px 10px; border-bottom: 1px solid #F1EFE8; }
th { color: #888780; font-weight: 500; font-size: 12px; }
td.num { font-variant-numeric: tabular-nums; }

/* v3.56 材料表（四项主材）：数量列加粗放大，说明列淡一点 */
.table-wrap h2 .mat-sub {
  margin-left: 8px; font-size: 11.5px; font-weight: 400; color: #A9A79C;
}
#mat { margin-bottom: 4px; }
#mat td.num { font-size: 14px; color: #0F6E56; white-space: nowrap; }
#mat td.num b { font-weight: 600; }
#mat td.mat-note { color: #8A887C; font-size: 12px; }
#matWrap { margin-bottom: 14px; }

@media (max-width: 900px) {
  .layout { grid-template-columns: 1fr; }
  .panel { position: static; }
}

/* v3.57：灌溉演示已移除，相关样式一并删除 */

/* 下拉选择（第 2 步 铺设方式） */
.field select {
  width: 100%;
  padding: 8px 9px;
  border: 1px solid #DEDBD0;
  border-radius: 8px;
  background: #fff;
  font-family: inherit;
  color: #2C2C2A;
  appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, #8A8880 50%), linear-gradient(135deg, #8A8880 50%, transparent 50%);
  background-position: calc(100% - 14px) 52%, calc(100% - 9px) 52%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
}

/* 第 3 步：轮灌批次表 */
.rg-table-wrap {
  max-height: calc(100vh - 380px);
  overflow-y: auto;
  border: 1px solid #E9E7DE;
  border-radius: 8px;
  background: #fff;
  margin-top: 2px;
}
.rg-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
}
.rg-table th {
  position: sticky; top: 0;
  background: #FBFAF6;
  font-weight: 600;
  font-size: 10.5px;
  color: #5F5E5A;
  text-align: center;                       /* v5.27 甲方：表格数据居中 */
  padding: 5px 7px;
  border-bottom: 1px solid #E9E7DE;
  white-space: nowrap;
}
.rg-table td {
  padding: 4px 7px;
  border-bottom: 1px solid #F1EFE7;
  color: #3C3C39;
  text-align: center;                       /* v5.27 甲方：表格数据居中 */
}
/* ⚠ `.num` 以前是右对齐（数字列靠右）。甲方要求整体居中后，
 * 数字列也居中 —— 但 tabular-nums 要保留（等宽数字，竖着看位数对齐）。 */
.rg-table td.num { text-align: center; font-variant-numeric: tabular-nums; white-space: nowrap; }
.rg-table tr:last-child td { border-bottom: none; }

/* v3.22 阀门 · 小区面积表 */
.valve-tbl-bar {
  display: flex; align-items: center; justify-content: space-between;
  gap: 8px; margin: 4px 0 2px;
  font-size: 11px; color: #5F5E5A;
}
.valve-table th, .valve-table td { padding: 3px 4px; font-size: 11px; }
.valve-table td, .valve-table th { white-space: nowrap; }
.valve-table td:nth-child(3) { color: #5F5E5A; }
.valve-table .vchip { display: inline-block; width: 8px; height: 8px; border-radius: 2px; margin-right: 4px; vertical-align: 0; }
/* v3.32 参数已改未生成：面积表置灰提示「这是上一版」 */
.valve-table.stale tbody { opacity: 0.42; filter: grayscale(0.5); }
.valve-table.stale { outline: 1px dashed #E7C86A; outline-offset: 2px; }
.valve-table tr.sum td {
  font-weight: 600; color: #1D9E75;
  border-top: 1px solid #D8D5C8; background: #FBFAF6;
}

/* 第 3 步布置图区：覆盖前面的 display:block（同优先级需放在文件末尾生效） */
body[data-step="3"] #designWrap {
  display: flex;
  flex-direction: column;
  min-height: 0;
  flex: 1 1 auto;
}
body[data-step="3"] #designWrap .canvas-box { flex: 1 1 auto; min-height: 0; }

/* ---------- 图层面板（第 3 步左栏） ---------- */
.layer-panel { border: 1px solid #E4E1D4; border-radius: 10px; background: #FCFBF6;
  font-size: 12px; user-select: none; margin-bottom: 12px; overflow: hidden; }
.lp-head { display: flex; align-items: center; gap: 6px; padding: 6px 9px;
  border-bottom: 1px solid #ECEAE0; background: #F7F6EF; }
.lp-title { font-weight: 600; color: #3A3A36; }
.lp-hint { flex: 1; font-size: 10.5px; color: #0F6E56; line-height: 1.35; white-space: normal; }
/* v3.69：第三步左栏收窄到 264px 后，原提示语（30+ 字）会被断成「…点 / 选小区」怪行且多占 20px
   → 提示语改成一行短句（详细操作在 lp-foot「图层面板怎么用」里已有）。 */
body[data-step="3"] .lp-hint { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.lp-fold { border: 0; background: none; cursor: pointer; color: #8A887C; font-size: 14px; line-height: 1; padding: 2px 4px; }
.lp-body { padding: 4px; }
.layer-panel.folded .lp-body, .layer-panel.folded .lp-foot { display: none; }
.lp-row { display: flex; align-items: center; gap: 7px; padding: 4px 6px; border-radius: 6px; cursor: pointer; }
.lp-row:hover { background: #F1F0E7; }
.lp-row.active { background: #E4F2EC; outline: 1px solid #0F6E56; }
.lp-row.off .lp-name { color: #B5B3A6; text-decoration: line-through; }
.lp-eye { width: 14px; height: 14px; accent-color: #0F6E56; cursor: pointer; flex: 0 0 auto; margin: 0; }
.lp-name { flex: 1; color: #33322C; }
.lp-desc { font-size: 11px; color: #A3A194; }
.lp-dot { width: 7px; height: 7px; border-radius: 50%; background: #D8D5C9; flex: 0 0 auto; }
.lp-row.active .lp-dot { background: #0F6E56; }
.lp-foot { padding: 4px 9px 7px; color: #9A988C; font-size: 11px; line-height: 1.5; border-top: 1px solid #ECEAE0; }
.lp-foot b { color: #6F6D62; font-weight: 600; }
/* v3.51：图层面板的操作说明折叠（原 166 px / 10 行） */
.lp-foot .lp-help > summary {
  cursor: pointer; list-style: none; color: #7A7869; font-size: 10.5px;
  padding: 2px 0; user-select: none;
}
.lp-foot .lp-help > summary::-webkit-details-marker { display: none; }
.lp-foot .lp-help > summary::before { content: "▸ "; color: #B4B2A5; }
.lp-foot .lp-help[open] > summary::before { content: "▾ "; }
.lp-foot .lp-help-body {
  margin: 4px 0 2px; padding: 6px 8px; border-radius: 6px;
  background: #F7F6F0; color: #7A7869; line-height: 1.55;
}
.lp-foot .lp-adj { margin-top: 4px; display: flex; align-items: center; gap: 8px; }
.lp-adj { display: flex; align-items: center; gap: 8px; margin-top: 5px; }
.lp-adj span { color: #0F6E56; }
.lp-reset { border: 1px solid #CBD9D2; background: #F6FBF8; color: #0F6E56; border-radius: 5px;
  font-size: 11px; padding: 2px 8px; cursor: pointer; }
.lp-reset:hover { background: #E4F2EC; }

/* ---------- 生成闸门（v3.30 在第 2 步；v3.58 移到第 3 步） ---------- */
.gen-gate { position: sticky; bottom: 0; z-index: 5; margin: 10px -12px -12px;
  padding: 10px 12px 12px; background: linear-gradient(#FCFBF600, #FCFBF6 22%);
  border-top: 1px solid #ECEAE0; }
/* ===== v5.50 关键修正：闸门搬到第 2 步后**必须取消 sticky =====
 * `.gen-gate` 原本是 `position: sticky; bottom: 0`（第 3 步要贴底常驻）。
 * 搬到第 2 步后，sticky-bottom 会把它**吸到面板底部**——
 * 于是它虽然在 DOM 里排在"支管 → 闸门 → 轮灌计算"，视觉上却浮到
 * 支管输入框上面（实测 btnGen 的 y=498 < subDia 的 y=528），
 * 还盖住了输入框。第 2 步要的是普通文档流顺序，所以这里显式还原。 */
body[data-step="2"] .gen-gate {
  position: static;
  margin: 14px 0 4px;
  padding: 0;
  background: none;
  border-top: none;
}

/* 第 3 步的闸门放在图层面板上方，常驻可见（不随面板滚动跑掉） */
body[data-step="3"] #paneRg .gen-gate { position: sticky; top: 0; margin: 0 -12px 10px; }
.gen-btn { width: 100%; padding: 10px 0; font-size: 15px; font-weight: 600; }
.gen-btn.dirty { animation: genPulse 1.6s ease-in-out infinite; box-shadow: 0 0 0 3px #F5C04E66; }
@keyframes genPulse { 0%,100% { box-shadow: 0 0 0 3px #F5C04E66; } 50% { box-shadow: 0 0 0 6px #F5C04E22; } }
.gen-status { margin-top: 8px; font-size: 11.5px; line-height: 1.55; color: #8A887C; }
/* v5.53：`hidden` 属性必须显式压掉 display ——
 * `.gen-status` 自身没设 display，浏览器默认 block 会盖过 `[hidden]`
 * 的 display:none（实测：HTML 写了 hidden，页面上照样显示）。
 * 这是 [hidden] 最常见失效原因，别再靠属性本身。 */
.gen-status[hidden] { display: none !important; }
/* v3.69：窄栏（264px）下「✓ 09:31:15 设计完成，通过全部 10 项规则校验」恰好断成孤字
   → 第 3 步把状态文字缩到 11px，保持整句一行。 */
body[data-step="3"] .gen-status { font-size: 11px; line-height: 1.5; }
.gen-status.dirty { color: #9A6A00; }
.gen-status.ok { color: #0F6E56; }
.gen-status.ok.has-warn { color: #6F6D62; }
.gen-status.err { color: #B3261E; }
.gen-status b { font-weight: 600; }
/* P3-10（v3.50）：点「重新生成」= 设计程序从零重跑，手动调整会被清除 ——
 * 有手动调整时常显这条提示，避免用户以为"我拖的线条被程序弄丢了" */
.gen-manual-hint { margin-top: 7px; padding: 6px 8px; border-radius: 6px;
  font-size: 11.5px; line-height: 1.5; color: #7A4A00; background: #FDF4E3;
  border: 1px solid #F0DDB4; }
.gen-manual-hint b { font-weight: 600; }

/* 画布「待生成」遮罩：保留上一版图纸可见，但明确标示已过期 */
.dirty-mask { position: absolute; inset: 0; z-index: 6; display: flex;
  align-items: flex-start; justify-content: center; pointer-events: none;
  background: repeating-linear-gradient(-45deg, #FFFFFF00 0 26px, #F5C04E14 26px 52px); }
.dirty-mask .dm-box { margin-top: 14px; max-width: 420px; text-align: center;
  background: #FFFDF4F2; border: 1px solid #E7C86A; border-radius: 10px;
  padding: 8px 14px; box-shadow: 0 2px 10px #7A5B0014; }
.dirty-mask .dm-box b { display: block; color: #8A5B00; font-size: 13px; }
.dirty-mask .dm-box span { color: #9A8A5A; font-size: 11.5px; line-height: 1.5; }

/* ---------- v3.34 第三步：卫星图叠加视图（btnSat 与 #satBox 互换 #cv） ---------- */
.sat-box { position: absolute; inset: 0; z-index: 3; background: #D9E2E8; overflow: hidden; }
.sat-box #satMap { position: absolute; inset: 0; }
.sat-box .sat-tip {
  position: absolute; left: 10px; bottom: 8px; z-index: 5; margin: 0;
  max-width: calc(100% - 24px);
  padding: 2px 10px; border-radius: 999px;
  background: rgba(10,32,24,0.58); color: #F2FBF6;
  font-size: 11px; line-height: 1.6; pointer-events: none;
}
/* 切换钮在**第 3、4 步**出现。
 * v5.55（甲方「导出界面的图，支持转成卫星图切换」）：原来只限第 3 步，
 * 桌面导出页想核实地块是否压在地物上时没入口。第 4 步的卫星图同样值得看
 * （灌溉演示只在 canvas 上跑，第 4 步本来就没有演示，不存在遮挡问题）。 */
#btnSat { display: none; }
body[data-step="3"] #btnSat,
body[data-step="4"] #btnSat { display: flex; }
#btnSat:disabled { opacity: .45; cursor: not-allowed; }
/* 卫星模式下隐藏画布与画布专属控件（缩放/测距对卫星图无意义），保留「返回设计图」 */
body.sat-on .canvas-box #cv { visibility: hidden; }
body.sat-on .zoom-ctl .zc:not(#btnSat),
body.sat-on .zoom-ctl .zc-val,
body.sat-on .zoom-tip { display: none; }

/* ---------- v3.36 第三步：手动调整设计（CAD 式编辑） ---------- */
/* 工具条只在第三步出现；卫星模式下收起（编辑跑在设计画布上） */
.edit-ctl { display: none; align-items: center; gap: 4px; padding-right: 8px; }
body[data-step="3"] .edit-ctl { display: inline-flex; }
body.sat-on .edit-ctl { display: none; }
.edit-btn.on { background: #0E4C7E; color: #fff; border-color: #0E4C7E; }
.edit-btn.on:hover { background: #0E4C7E; }
/* v3.66 图层门：当前图层不支持的工具 —— 置灰 + 禁用（鼠标不给手型，也不高亮）
 * 目的：让用户在**点之前**就知道"这层不能打断"，而不是点完发现改错了对象。 */
.edit-btn.tool-off,
.edit-btn:disabled {
  opacity: .38; background: #F4F2EA; color: #98968C; border-color: #E2DFD3;
  cursor: not-allowed; filter: grayscale(1);
}
.edit-btn.tool-off:hover,
.edit-btn:disabled:hover { background: #F4F2EA; color: #98968C; }
.edit-hint { max-width: 220px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 11px; color: #8A887C; opacity: 0; transition: opacity .3s; }
.edit-hint.flash { animation: hintFlash 4s ease forwards; }
@keyframes hintFlash { 0% { opacity: 0; } 6% { opacity: 1; } 80% { opacity: 1; } 100% { opacity: 0; } }
/* 分组工具条：组胶囊 + 新组 */
.grp-bar { display: flex; flex-wrap: wrap; gap: 5px; margin: 0 0 8px; }
.grp-bar:empty { display: none; }
/* v3.71：分组条回到第 3 步左栏（264px 窄栏）。14 个组 chip 若换行会占 3~4 行、
   把面板撑长 —— 改为单行横向滚动（chip 不缩、条内滑动）。 */
body[data-step="3"] .grp-bar { flex-wrap: nowrap; overflow-x: auto; margin: 0; padding-bottom: 2px; scrollbar-width: thin; }
body[data-step="3"] .grp-bar::-webkit-scrollbar { height: 5px; }
body[data-step="3"] .grp-bar::-webkit-scrollbar-thumb { background: #DEDBD0; border-radius: 3px; }
body[data-step="3"] .grp-chip { flex: 0 0 auto; }
.grp-block { border: 1px solid #E4E1D4; border-radius: 10px; background: #FCFBF6; padding: 5px 8px 7px; margin-bottom: 10px; }
.grp-head { display: flex; align-items: baseline; gap: 6px; margin-bottom: 5px; }
.grp-title { font-weight: 600; font-size: 12px; color: #3A3A36; }
.grp-hint { flex: 1; min-width: 0; font-size: 10.5px; color: #0F6E56; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.grp-chip { display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 10px; border-radius: 999px; border: 1px solid #C9C4B4;
  background: #F7F5EC; color: #5A5748; font-size: 11.5px; cursor: pointer; }
.grp-chip i { font-style: normal; font-size: 10px; color: #8A887C; }
.grp-chip.on { background: #0E4C7E; color: #fff; border-color: #0E4C7E; }
.grp-chip.on i { color: #CFE1F2; }
.grp-chip.add { border-style: dashed; }
/* 批次表：组流量超水源 → 整行提示 */
.rg-table tr.rg-over td { color: #B3261E; }
/* ===== v5.19 轮灌批次表重新设计（108 小区 / 54 批太长）=====
 * 三层：摘要带 → 按地块分组（默认收起）→ 展开逐批明细。
 * 首屏只 4 行，需要看细节才点开，不用滚两屏找"第几批在哪块地"。 */
.bt-sum {
  display: flex; flex-wrap: wrap; gap: 6px 18px;
  margin: 0 0 10px; padding: 8px 10px;
  background: #F7F9F7; border: 1px solid #E2EBE4; border-radius: 8px;
  font-size: 12px; color: #5A5852;
}
.bt-sum b { color: #0F6E56; font-weight: 600; font-variant-numeric: tabular-nums; }
.bt-sum .bt-warn { color: #B3261E; font-weight: 600; }
.bt-table th { text-align: center; }   /* v5.27 甲方：表格数据居中 */
/* ===== v5.27：轮灌表改为**平铺阀门组**（不再分地块折叠）=====
 * 一行 = 一批：批号 / 阀门组 / 流量（含利用率）/ 控制面积 / 涉及地块。
 * 甲方要求「就罗列阀门组就行了」+ 各表数据居中。 */
.bt-table tr.bt-row td {
  border-bottom: 1px solid #EDEBE2; font-size: 12.5px;
  text-align: center;                       /* v5.27 甲方：表格数据居中 */
  padding: 8px 10px;
}
.bt-table tr.bt-row:hover td { background: #F7FAF8; }
.bt-table tr.bt-row .bt-b { font-weight: 600; color: #2C2C2A; white-space: nowrap; }
.bt-table tr.bt-row .bt-v {
  font-variant-numeric: tabular-nums; color: #0F6E56; font-weight: 500;
  letter-spacing: .2px;
}
.bt-table tr.bt-row .bt-f { color: #A9A79C; font-size: 11.5px; white-space: nowrap; }
.bt-table tr.bt-row .bt-q { white-space: nowrap; }
.bt-table tr.bt-row .bt-util {
  display: inline-block; margin-left: 6px; padding: 1px 5px;
  border-radius: 999px; font-size: 10.5px; font-variant-numeric: tabular-nums;
  background: #EDF6F1; color: #1D9E75;
}
.bt-table tr.bt-row .bt-util.low { background: #F4F3EE; color: #A9A79C; }
.bt-table tr.bt-row .bt-util.ov { background: #FDECEA; color: #B3261E; font-weight: 600; }
.bt-table tr.bt-over td { background: #FFF7F6; }
.bt-foot { margin: 8px 0 0; font-size: 11.5px; color: #A9A79C; line-height: 1.6; }

.rg-table .ov { color: #B3261E; font-size: 10px; }
/* 手动调整检查面板 */
.manual-check { border: 1px solid #ECEAE0; border-radius: 8px; padding: 7px 10px; }
.manual-check .mc-hint { font-size: 11.5px; line-height: 1.6; color: #8A887C; }
.manual-check .mc-sum { font-size: 11.5px; line-height: 1.6; color: #5A5748;
  padding-bottom: 4px; border-bottom: 1px dashed #ECEAE0; margin-bottom: 4px; }
.manual-check .mc-warn { font-size: 11.5px; line-height: 1.55; color: #9A5B00; }
/* v3.63：P1-2 偏离提示用**橙色左边框**，与图上橙色高亮同一色系，一眼能对上 */
.manual-check .mc-p12 { border-left: 3px solid hsl(28,92%,46%); padding-left: 7px;
  background: hsla(32,95%,58%,.10); border-radius: 3px; }
.manual-check .mc-ok { font-size: 11.5px; color: #0F6E56; }

/* v3.58：第 2 步无画布，改参数后用一个面板底部提示条指向第 3 步的生成按钮。
 * 必须 **sticky 吸底** —— 参数页很长（含 28 行面积表），固定在文档流里的话
 * 用户要滚到底才能看见这条提示（实测提示条 y=1530px，早就出屏了）。 */
.dirty-tip {
  position: sticky;
  bottom: 0;
  z-index: 6;
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  margin-top: 12px; padding: 9px 12px; border-radius: 9px;
  background: #FDF4E3; border: 1px solid #F0DDB4; color: #7A4A00;
  font-size: 12px; line-height: 1.5;
}
.dirty-tip b { font-weight: 600; }
.dirty-tip .linkbtn { margin-left: auto; white-space: nowrap; }


/* ================================================================
 * v5.60 抽屉菜单（桌面 + 手机共用）
 *
 * 甲方「菜单里应该有新建，导入，导出」—— 三个动作 + 各自说明文字，
 * 顶栏放不下，压成一个「菜单」按钮点开抽屉。
 *
 * 两端差异只用 left/right 区分，DOM 与交互完全一致：
 *   · 手机：从**左**滑出（汉堡在左上，拇指够得到）
 *   · 桌面：从**右**滑出（菜单按钮在右上）
 * ================================================================ */
.drawer-mask {
  display: block;
  position: fixed; inset: 0;
  background: rgba(0,0,0,.32);
  z-index: 60;
  opacity: 0; pointer-events: none;
  transition: opacity .22s;
}
.drawer-mask.open { opacity: 1; pointer-events: auto; }

.drawer {
  display: flex; flex-direction: column;
  position: fixed; top: 0; bottom: 0;
  width: 300px; max-width: 82vw;
  background: #fff;
  z-index: 61;
  box-shadow: 0 0 24px rgba(0,0,0,.14);
  transition: transform .24s cubic-bezier(.32,.72,0,1);
  right: 0; left: auto; transform: translateX(100%);
}
.drawer.open { transform: translateX(0); }

.drawer-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid #EDEBE2;
  font-size: 15px; font-weight: 600; color: #2C2C2A;
  flex: 0 0 auto;
}
.drawer-close {
  width: 40px; height: 40px; margin-right: -8px;
  border: none; background: none; border-radius: 8px;
  font-size: 17px; color: #7A776B; cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  font-family: inherit;
}
.drawer-close:hover { background: #F1EFE8; }
.drawer-body { padding: 10px 12px 24px; overflow-y: auto; -webkit-overflow-scrolling: touch; }

.drawer-sec {
  font-size: 11.5px; color: #A9A79C; font-weight: 600;
  margin: 14px 6px 8px; letter-spacing: .4px;
}
.drawer-sec:first-child { margin-top: 4px; }

.drawer-item {
  display: block; width: 100%; text-align: left;
  padding: 11px 13px; margin-bottom: 6px;
  background: #F8FAF8;
  border: 1px solid #E4EDE6;
  border-radius: 10px;
  font-family: inherit; cursor: pointer;
  transition: background .12s, border-color .12s;
}
.drawer-item:hover { background: #EDF7F1; border-color: #C6E3D7; }
.drawer-item:active { background: #E1F5EE; }
.drawer-item:disabled { opacity: .42; cursor: not-allowed; }
.drawer-item:disabled:hover { background: #F8FAF8; border-color: #E4EDE6; }
.drawer-item .di-t {
  display: block;
  font-size: 14.5px; font-weight: 600; color: #1D9E75;
  line-height: 1.4;
}
.drawer-item .di-d {
  display: block;
  font-size: 11.5px; color: #8A8779;
  line-height: 1.5; margin-top: 1px;
}
.drawer-item:disabled .di-t { color: #A9A79C; }

.drawer-note {
  font-size: 12px; line-height: 1.7; color: #7A776B;
  background: #FBFAF6; border-radius: 8px; padding: 10px 12px;
  margin: 6px 0 0;
}
.drawer-note b { color: #B3261E; font-weight: 600; }

/* 手机：从左滑出 + 尺寸微调 */
@media (max-width: 767px) {
  .drawer {
    left: 0; right: auto;
    transform: translateX(-100%);
    border-radius: 0;
  }
  .drawer.open { transform: translateX(0); }
  .drawer-item { padding: 12px 13px; min-height: 52px; }
  .drawer-close { width: 44px; height: 44px; }
  /* 手机上说明文字必须 ≥12px（验收硬指标：<12px 读不清）。
   * 桌面 11.5px 够看，手机小屏 + 手指遮挡就不行了。 */
  .drawer-item .di-d { font-size: 12.5px; }
  .drawer-sec { font-size: 12px; }
  .drawer-note { font-size: 12.5px; }
}

/* ================================================================
 * v5.32 手机端适配（甲方 2026-11-27「需要设计符合手机版本的界面吧」）
 *
 * 改造前实测问题（iPhone 12，390×664）：
 *   · 顶栏：标题被压成 2 行、3 个导出按钮各占 2 行，视觉极挤
 *   · 步骤条：4 个按钮各 min-width:150px，总宽 600+，被裁切须横滑
 *   · 第 1 步：7 个操作按钮堆 5 行，地图只剩 440px 高
 *   · 步骤按钮高 29px（< 44px 手指点不中）
 *   · 108 处文字 < 12px
 *
 * 改造策略（不是"把桌面版挤窄"，是按手机重排）：
 *   ① 顶栏：汉堡菜单 + 单行标题 + 当前步骤名；导出按钮进抽屉
 *   ② 步骤条 → **底部标签栏**（拇指可达区），第 3 步在手机上隐藏
 *   ③ 第 1 步操作按钮 → 收起式工具条，地图占满剩余高度
 *   ④ 所有可点元素 ≥ 44px
 *   ⑤ 正文最小 13px，表单字体 16px（防 iOS 自动放大）
 * ================================================================ */

/* ---------- 只在手机显示/隐藏的元素 ---------- */
.topbar-menu-btn,
.topbar-step,
.wz-account,
.t-short,
.sheet,
.sheet-mask { display: none; }
/* v5.60：抽屉改为**两端都用**（桌面顶栏也压成一个「菜单」按钮），
 * 不再在这里 display:none。位置差异由 .drawer 的 left/right 控制。 */

/* v5.33：底部导航文案双套 —— 桌面用长文案，手机用短词（见下方断点） */
.t-full { display: inline; }
.t-short { display: none; }

@media (max-width: 767px) {

  /* ===== ① 顶栏 ===== */
  .topbar {
    padding: 0 12px;
    height: 52px;
    gap: 10px;
    justify-content: flex-start;
  }
  .topbar-menu-btn {
    display: flex; align-items: center; justify-content: center;
    width: 40px; height: 40px; flex: 0 0 40px;
    margin-left: -6px;
    background: none; border: none; border-radius: 8px;
    color: #3A3934; cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .topbar-menu-btn:active { background: #F1EFE8; }
  .topbar .logo { flex: 1 1 auto; min-width: 0; gap: 7px; }
  .topbar .logo svg { width: 20px; height: 20px; flex: 0 0 20px; }
  .topbar .logo h1 {
    font-size: 15px; line-height: 1.2;
    white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  }
  /* 手机顶栏窄，设计名再收一档；有名字时标题行高略压，避免顶栏变高 */
  .logo-design { font-size: 11.5px; max-width: 40vw; }
  /* 手机端隐藏导出按钮组（进抽屉） */
  .topbar .actions { display: none; }
  /* ===== v5.62（甲方「右上角的各个页面标识变成下一步…我的页面上变成返回」）=====
   * 原来是只读的步骤名 `<span>`，现在改成**可点的动作按钮**：
   * 第 1~3 步「下一步 ›」/ 第 4 步「完成」/「我的」页「‹ 返回」。
   *
   * 做成"药丸"而不是纯文字：纯文字看不出可点（原来它就是只读的，
   * 用户已经建立了"这地方不能点"的印象，必须靠形状告诉他要改）。
   * 高度 32px：比 44px 的触控底线小一点，但它不是主要操作入口
   * （主要入口是底部标签栏），32px 够用且不撑高顶栏。 */
  .topbar-step {
    display: inline-flex; align-items: center; justify-content: center;
    flex: 0 0 auto;
    /* 44px 触控底线（Apple HIG）—— 但顶栏只有 52 高，
     * 直接用 44 会把顶栏撑到 60。
     * 解法：给按钮 44 的**可点高度**，再用负 margin 让它视觉上仍收在顶栏里。
     * 这是"触控区"与"视觉尺寸"分离的标准做法（padding 撑开、margin 收回）。 */
    min-height: 44px;
    margin: -4px 0;
    padding: 0 13px;
    border: 1px solid #C6E3D7;
    border-radius: 999px;
    background: #EAF6F1;
    font-family: inherit;
    font-size: 13px; font-weight: 600; color: #0F6E56;
    white-space: nowrap;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .topbar-step:active { background: #D7EFE5; }
  /* 「完成」态：已到最后一页，视觉上收一档（不是主操作了） */
  .topbar-step[data-act="done"] {
    background: #F4F2EC; border-color: #E0DDD2; color: #8A8779;
  }

  /* ===== 抽屉 ===== */


  /* ===== ② 步骤条 → 底部标签栏 =====
   * 手机屏幕小，顶部放步骤条会挤掉地图。
   * 移到屏幕底部：拇指可达，且不占内容高度。
   * 第 3 步在手机上隐藏（只留 1/2/4）。 */
  /* ⚠ 踩坑：`.wizard` 桌面版有 `overflow-x: auto` + `top: var(--topbar-h)`。
   * 手机上改成 `position:fixed; bottom:0` 时，如果不同时覆盖 `top` 和 `height`，
   * 浏览器会把 top 到 bottom 之间**全部撑满**（实测 top:46、height:618 ——
   * 标签栏从屏幕顶部铺到底部，把地图整块盖住，看起来像"地图空白"）。
   * 正解：显式 `top: auto; bottom: 0; height: auto;` + 去掉 overflow。 */
  .wizard {
    position: fixed; left: 0; right: 0;
    top: auto; bottom: 0;
    height: auto; max-height: none;
    z-index: 40;
    display: flex; gap: 0;
    padding: 0 0 env(safe-area-inset-bottom, 0);
    /* ===== v5.62（甲方 2026-11-28「把底部抽屉框的颜色变成深色，选中变白色」）=====
     * 底栏从白底深灰字 → **深底白字**，选中项再反过来（深底上的纯白 + 顶部高亮线）。
     *
     * 为什么选 #1F2622 这个偏橄榄的深色：纯黑(#000)在户外强光下反差过硬、
     * 与站内其他绿色系（#1D9E75）脱节；这个色是主题绿的极暗版本，
     * 放在一起像"同一套系统"而不是"贴了个黑条"。 */
    background: #1F2622;
    border-top: 1px solid #2C352F;
    border-bottom: none;
    overflow: visible;
    box-shadow: 0 -2px 14px rgba(0,0,0,.18);
  }
  .wz {
    flex: 1 1 0; min-width: 0;
    display: flex; flex-direction: column;
    align-items: center; justify-content: center;
    gap: 3px;
    padding: 9px 4px calc(9px + env(safe-area-inset-bottom, 0) / 2);
    min-height: 56px;                    /* ≥44px 触控区 */
    /* ⚠ 必须 !important：桌面 `.wz` 有 `background:#FAF9F5`，
     * 手机这条 `.wz` 与它**同优先级**（都是 0,1,0），而桌面规则在前面，
     * 理论上后者覆盖 —— 但「我的」页会额外命中 `body[data-view]` 相关规则，
     * 实测出现"底栏左半截白、右半截深"（选中项那块露出浅底）。
     * 深色底栏上任何浅色块都极其刺眼，所以直接压死。 */
    background: transparent !important;
    border: none !important; border-radius: 0 !important;
    box-shadow: none !important;
  }
  .wz-desktop { display: none !important; }   /* 手机上不要第 3 步 */

  /* ===== v5.33：手机端标签 = **只有文字、没有序号徽章** =====
   * 甲方：「去掉 1/2/4，直接写圈地、参数、导出，我的」。
   * 小屏上 4 个标签都是 2 字短词，去掉圆圈序号后字可以放大到 14px，
   * 比"小圆圈 11px + 12.5px 长文案"好认得多。
   * 序号徽章仍保留 DOM（桌面用），这里只 display:none —— 不要删 DOM，
   * 因为 updateStepUI 会按 `.wz.done` 给徽章上色。 */
  .wz-idx { display: none !important; }
  .wz { gap: 0; padding: 0 2px; }
  .wz-body { align-items: center; justify-content: center; }
  .t-full { display: none; }
  .t-short { display: inline; }
  .wz-t {
    font-size: 14px; font-weight: 500;
    white-space: nowrap; line-height: 1.2;
    /* 深底上的未选中项：中灰（#9AA39C），够低调但不至于看不清 */
    color: #9AA39C;
    letter-spacing: .5px;
    transition: color .15s;
  }
  /* 选中：**纯白 + 加粗**，在深底上是最强对比，一眼能看出在哪 */
  .wz.active .wz-t { color: #FFFFFF; font-weight: 700; }
  .wz.active {
    background: none;
    border: none;
  }
  .wz.done .wz-t { color: #C6CEC8; }

  /* 「我的」标签：与步骤标签同一套排版，只是不带 data-goto */
  .wz-account { display: flex; }

  /* 选中态加一条短顶线，去掉序号后用这条线承担"我在哪"的指示 */
  .wz { position: relative; }
  .wz.active::before {
    content: "";
    position: absolute; top: 0; left: 50%; transform: translateX(-50%);
    width: 22px; height: 2.5px; border-radius: 0 0 3px 3px;
    /* 深底上用白线（用绿线在 #1F2622 上对比不足，看着像脏点） */
    background: #FFFFFF;
  }

  /* 主内容区：底部留出标签栏高度 */
  .layout {
    display: block;
    padding: 10px 12px;
    padding-bottom: calc(68px + env(safe-area-inset-bottom, 0));
    max-width: none;
  }

  /* ===== v5.38（甲方「地图左右侧不需要留边框」）=====
   * 第 1 步的地图要**贴到屏幕左右边缘**，不留白边也不留圆角。
   * 这里三层都要清：.layout 的左右 padding、.stage 的宽度、.map-wrap 的圆角。
   * 只清一层的话地图仍会缩进去 12px（实测：清 .layout 不清 .stage 时还差 12px）。 */
  body[data-step="1"] .layout {
    padding-left: 0;
    padding-right: 0;
  }
  body[data-step="1"] .stage {
    max-width: none;
    padding: 0;
  }
  body[data-step="1"] .map-wrap {
    border: none;
    border-radius: 0;
  }
  body[data-step="1"] .map-stage,
  body[data-step="1"] .map-stage #map {
    border-radius: 0;
  }
  /* 悬浮搜索框同步贴近边缘（原来 10px，去掉边框后留 8px 更贴合） */
  body[data-step="1"] .map-float-top { top: 8px; left: 8px; right: 8px; }
  body[data-step="1"] .map-fab { right: 10px; }
  body[data-step="2"] .layout,
  body[data-step="3"] .layout { grid-template-columns: none; }

  /* ===== ③ 第 1 步（v5.34 重排）：地图吃掉几乎整屏 =====
   * 甲方：「大面积放地图，底下的辅助文字也可以隐藏了」。
   *
   * 布局 = 顶栏(52) + 地图(自适应) + 底部操作条(两行 46×2 + gap) + 标签栏(57)
   * 这次**不再用 flex 硬塞**（v5.32 用 flex 时踩过：`.map-wrap` 的 padding 没算进去，
   * #map 高 0，看起来像"地图空白"）。改成「容器定高 + 地图 absolute 铺满 + 悬浮控件」：
   *   .map-wrap  高度 = 100dvh - 顶栏 - 操作条 - 标签栏 - 间距
   *   .map-stage 撑满 wrap 剩余（min-height:0 必须写，否则按内容撑高溢出）
   *   地图 absolute inset:0
   * 用 dvh 而不是 vh：手机浏览器地址栏收起/展开时 vh 不变，会露出白条。 */
  /* 操作条是 `.map-stage` 的**兄弟**节点，要相对 `.map-wrap` 定位 ——
   * 所以 wrap 必须 position: relative，否则 absolute 会往上找到别的祖先。 */
  #pageMap { display: block; }
  .map-wrap { display: block; position: relative; }
  .map-wrap {
    padding: 0;
    margin: 0;
    border: none;
    border-radius: 0;
    background: transparent;
    /* v5.36：操作条改成浮在地图上（absolute），不再占布局高度 ——
     * 所以 wrap 只需让出顶栏(52)与底部标签栏(57)，其余全部给地图。
     * （v5.34 曾经在 wrap 里减过操作条的 110，地图只剩 335 高、下面空一行。） */
    height: calc(100dvh - 52px - 57px - env(safe-area-inset-bottom, 0px) - 4px);
    min-height: 380px;
  }
  /* wrap 改成 block 后，stage 用 height:100% 撑满（含地图底部被操作条盖住的那部分 ——
   * 那是有意的：地图铺到底，按钮浮在上面）。 */
  .map-stage {
    height: 100%;
    min-height: 0;
    border-radius: 0;
  }
  .map-stage #map {
    position: absolute; inset: 0;
    width: 100% !important;
    height: 100% !important;
    min-height: 0;
    border-radius: 0;
    background: #E8EDE6;     /* 瓦片到之前的底色，避免纯白被当成"坏了" */
    transform: translateZ(0);
    will-change: transform;
    overflow: hidden;
  }

  /* --- 悬浮搜索：半透明灰底，浮在地图顶部（甲方「搜索用灰色，浮在地图上面」） --- */
  .map-float-top { top: 10px; left: 10px; right: 10px; }
  .map-float-top .map-search input {
    min-height: 42px;
    font-size: 16px;                    /* 防 iOS 聚焦自动放大 */
    padding: 10px 14px 10px 34px;
    border-radius: 10px;
  }
  .ms-ico { left: 11px; width: 14px; height: 14px; }

  /* --- 定位：右下圆钮，44px 触控（甲方「用一个简单图标表示即可」） --- */
  .map-fab {
    right: 12px; bottom: 12px;
    width: 44px; height: 44px;
  }

  /* --- v5.36（甲方 2026-11-27「做成半透明的」）---
   * 底部操作条从"占一条白底"改成**半透明浮在地图上**，地图因此可以铺满整屏。
   *
   * 布局：
   *   · `.map-wrap` 高度不再减去操作条（下面那 100px 还给地图）；
   *   · `.map-actions` 绝对定位在地图底部，横向铺满，内部四个按钮等分；
   *   · 半透明白 + backdrop-filter 毛玻璃，既不挡视线又能看清按钮；
   *   · 容器本身不留背景（`.map-actions` 透明），只有按钮是半透明的 ——
   *     这样按钮之间的缝隙能透出地图，视觉上更"浮"而不是"压"。
   *
   * 尺寸沿用 v5.35（甲方「缩小，放一排」）：一排四个、40px 高、13.5px 字。
   * `safe-area-inset-bottom` 让 iPhone 底部横条处不压住按钮。 */
  /* v5.37（甲方「做成悬浮按钮，再缩小一下框」）：
   * 从"铺满一行的横条"改成**居中的悬浮胶囊组** —— 不占满宽度，只包住四个按钮，
   * 两侧留白透出地图，视觉上才真的"浮"起来。
   *
   * 尺寸再收一档：40 → 34px 高、字号 13px、圆角 999（胶囊）。
   * 34px 仍高于 Android 的最小触控 32px，加上 6px 间距，误触概率可接受；
   * 真要更保险可以把 min-height 调回 36，但甲方明确要求缩小，以观感优先。 */
  body[data-step="1"] .map-actions {
    display: flex !important;
    flex-wrap: nowrap;
    justify-content: center;
    align-items: center;
    gap: 6px;
    margin: 0;
    /* 上移到版权条之上：腾讯版权标识在左下角且**不能遮挡**（合规），
     * 按钮组压上去会看不清。留 26px 高度给它。 */
    padding: 6px 10px 26px;
    position: absolute;
    left: 50%; bottom: 0;
    transform: translateX(-50%);
    width: -moz-max-content;
    width: max-content;
    max-width: calc(100% - 20px);
    z-index: 7;
    background: none;
    border: none;
    box-shadow: none;
  }
  body[data-step="1"] .map-actions .btn {
    flex: 0 0 auto;
    min-height: 34px;
    font-size: 13px;
    font-weight: 600;
    padding: 0 15px;
    border-radius: 999px;
    white-space: nowrap;
    letter-spacing: .3px;
    /* 半透明毛玻璃：透出卫星影像，又不至于看不清文字 */
    -webkit-backdrop-filter: blur(12px) saturate(1.5);
    backdrop-filter: blur(12px) saturate(1.5);
    box-shadow: 0 2px 9px rgba(0,0,0,.26);
  }
  /* ⚠ v5.39：「绘制」带 `.primary` 类（桌面是主按钮）。手机端若照搬绿底，
   * 切到「水源」模式时它**仍然是绿的** —— 看起来两个都在生效（实测踩到）。
   * 所以手机端 `.primary` 也做成半透明白底，与 `.ghost` 完全一致；
   * 只有 `.mode-on` 才真正点亮颜色。四个按钮的静息态必须看不出差别。 */
  body[data-step="1"] .map-actions .btn.primary,
  body[data-step="1"] .map-actions .btn.ghost {
    background: rgba(255,255,255,.80);
    color: #0F6E56;
    border: 1px solid rgba(255,255,255,.62);
  }
  /* 「绘制」仍是首要操作：静息态用**字重**区分，不用颜色 */
  body[data-step="1"] .map-actions #btnDraw:not(.mode-on) {
    font-weight: 700;
    color: #0B5C48;
  }
  body[data-step="1"] .map-actions .btn[hidden] { display: none !important; }

  /* 操作条浮起来后，地图就铺到底了 —— 定位圆钮要往上让，别被按钮压住 */
  .map-fab { bottom: calc(66px + env(safe-area-inset-bottom, 0px)); }

  /* v5.41 方向微调条：手机上抬高到操作条（含版权条留白）之上 */
  .dir-tune {
    bottom: calc(64px + env(safe-area-inset-bottom, 0px));
    padding: 7px 9px;
    gap: 5px;
  }
  .dir-tune .dt-btn {
    min-width: 48px; height: 34px;
    font-size: 12.5px;
    padding: 0 6px;
  }
  .dir-tune .dt-val { min-width: 44px; font-size: 13.5px; }

  /* v5.39 手机端提示条：搜索框 42 高 + 8 顶距 + 6 间距 = top 56 */
  .map-mode {
    left: 8px; right: 8px; top: 56px;
    font-size: 13px;
    padding: 9px 10px 9px 12px;
    border-radius: 10px;
  }
  .map-mode .mm-x { width: 26px; height: 26px; }

  /* v5.39 手机端选中态：**保留半透明质感**，只加强调环 + 提饱和。
   * 第一版做成不透明实心，结果四个胶囊里三个半透明、一个实心，像不同组件。
   * 现在：底色仍是半透明（只是更浓一档），靠外圈光晕 + 白字来区分"生效中"。 */
  body[data-step="1"] .map-actions .btn.mode-on {
    background: rgba(29,158,117,.94) !important;
    color: #fff !important;
    border-color: rgba(255,255,255,.62) !important;
    box-shadow: 0 0 0 3px rgba(29,158,117,.34), 0 2px 10px rgba(0,0,0,.30) !important;
    -webkit-backdrop-filter: blur(12px) saturate(1.6);
    backdrop-filter: blur(12px) saturate(1.6);
  }
  body[data-step="1"] .map-actions #btnSource.mode-on {
    background: rgba(31,111,235,.92) !important;
    border-color: rgba(255,255,255,.62) !important;
    box-shadow: 0 0 0 3px rgba(31,111,235,.34), 0 2px 10px rgba(0,0,0,.30) !important;
  }
  body[data-step="1"] .map-actions #btnDir.mode-on {
    background: rgba(201,162,39,.94) !important;
    border-color: rgba(255,255,255,.62) !important;
    box-shadow: 0 0 0 3px rgba(201,162,39,.34), 0 2px 10px rgba(0,0,0,.30) !important;
  }

  /* --- 辅助信息默认收起（甲方「底下的辅助文字也可以隐藏了」） --- */
  .map-more { display: none !important; }

  /* 底部「上一步 / 提示文字 / 下一步」这一条在手机上**整条隐藏**：
   *   · 导航已由底部标签栏承担（点「参数」= 下一步，效果相同）；
   *   · 那行提示「点「绘制」在地图上圈出地块…」正是甲方说要隐藏的辅助文字，
   *     而且它占掉 100px，正好可以还给地图。 */
  .step-nav { display: none !important; }

  /* 方向角输入框在手机上**绝不显示**（甲方要求整栏去掉） */
  .dir-ctrl, .dir-ctrl[hidden] { display: none !important; }

  /* ===== ④ 面板（第 2 步表单）===== */
  .panel {
    border-radius: 10px;
    padding: 12px !important;
  }
  .panel h2 { font-size: 15px; margin-bottom: 10px; }
  .field-grid { grid-template-columns: 1fr 1fr !important; gap: 10px; }
  /* 表单标签：桌面 11.5px，手机上偏小，提到 13px */
  .field label, .field-grid label, #sidePanel label {
    font-size: 13px !important;
    line-height: 1.45;
    margin-bottom: 4px;
  }
  /* 面板内的 h2/h3 也放大一点 */
  /* v5.52：生成状态「✓ 已生成 · 请前往导出界面查看」桌面 11.5px，手机上太小 */
  .gen-status { font-size: 13px !important; line-height: 1.5; }
  /* v5.51：手机端分组名 11.5px 读不清 → 13px，仍保持灰色 */
  .inline-sec .is-head { font-size: 13px; margin: 14px 0 9px; }
  #sidePanel h2 { font-size: 15px; }
  #sidePanel h3 { font-size: 14px; }
  /* ⚠ 必须用更高优先级压过桌面规则：桌面是 `.field input{font-size:13px}`，
   * 只写 `.field input` 在手机上优先级相同、靠顺序也不稳（实测仍是 13px）。
   * 手机 <16px 会触发 iOS 聚焦自动放大，输入框一放大整页就乱了。 */
  .field input, .field select, .field textarea,
  .field-grid input, .field-grid select,
  #sidePanel input, #sidePanel select {
    min-height: 44px !important;
    font-size: 16px !important;
    padding: 10px 10px !important;
    line-height: 1.4 !important;
  }

  /* ===== ⑤ 表格：横向可滑，字号加大 ===== */
  .table-wrap, .tbl-scroll { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .rg-table th { font-size: 12px; padding: 9px 10px; }
  .rg-table td { font-size: 13px; padding: 9px 10px; }
  .valve-table td, .valve-table th { font-size: 12.5px !important; }
  .bt-table tr.bt-row td { font-size: 13px; padding: 10px 8px; }
  /* 手机端隐藏「涉及地块」列（信息密度低，且窄屏放不下） */
  .bt-table th:last-child, .bt-table td:last-child { display: none; }

  /* ===== ⑥ 第 4 步画布 ===== */
  #cv {
    height: auto !important;
    max-height: 46vh;
  }

  /* ===== ⑦ 全局：正文最小 13px ===== */
  .hint, .foot, .note, .tip, p, .bt-foot, .mc-hint, .mc-sum, .mc-warn {
    font-size: 13px;
    line-height: 1.65;
  }
  .mat-note, .mat-spec { font-size: 12.5px !important; }

  /* 触控优化：去除点击高亮、统一 active 反馈 */
  .btn, .wz, .drawer-item, .linkbtn, button {
    -webkit-tap-highlight-color: transparent;
  }
  /* 深色底栏的按下态：用浅白蒙层，不能用原来的浅绿（在深底上几乎看不见） */
  .wz:active { background: rgba(255,255,255,.10) !important; }
  .btn { min-height: 44px; }

  /* 手机上隐藏"去第3步"这类入口 */
  [data-goto="3"] { display: none !important; }
}

/* ---------- 大屏（≥768）保持原样，只隐藏手机专属元素 ---------- */
@media (min-width: 768px) {
  /* v5.60：抽屉在桌面也要用，只隐藏手机专属元素 */
  .topbar-menu-btn, .topbar-step { display: none !important; }
}

/* ================================================================
 * 手机端「我的」页（账号 / 会员占位）
 *
 * v5.33：甲方「我的这项我们留给账号登录、会员操作」—— 先搭外壳与信息位。
 * v5.56：甲方「我的那页，我们直接切换页面」—— **不再用底部上滑面板**，
 *   改成与圈地/参数/导出并列的**整页**。
 *
 * 为什么改（原来 sheet 的问题）：
 *   · 82vh 上滑面板 + 半透明遮罩，看上去仍是"弹窗"，不是"一页"；
 *   · 遮罩把可用宽度压窄、下层地图还透出来，注意力被抢；
 *   · 后面要放方案列表 / 会员套餐 / 订单等长内容时，弹窗（尤其带圆角+把手）
 *     会越来越别扭，而整页天生能滚。
 *
 * 开关是 `body[data-view="account"]`：
 *   · 有它 → .layout（步骤页容器）整体 display:none，#acctPage 显示；
 *   · 没它 → 一切照旧，step 页正常工作。
 * 这样不必把「我的」塞进 step 编号（那要连改 canEnter / stepNeed / 标签高亮一串）。
 * ================================================================ */
.account-page { display: none; }

/* ⚠ 必须带 !important：`body[data-step="N"] .layout` 是一个属性选择器 + 一个类，
 * 与 `body[data-view="account"] .layout` **优先级完全相同**（都是 0,1,1,1）。
 * 同优先级下按源码顺序取后者 —— 但那些 data-step 规则散落在文件各处，
 * 一旦有人往后追加就又会盖回来（实测第 4 步的 .layout 就赢了，
 * 页面出现"我的页与图纸"两套内容叠在一起）。用 !important 一劳永逸。 */
body[data-view="account"] .layout { display: none !important; }
body[data-view="account"] #acctPage { display: block !important; }
/* 「我的」页不需要步骤操作条（上一步/下一步对账号页没意义） */
body[data-view="account"] .step-nav { display: none !important; }

.acct-head {
  display: flex;
  align-items: center;
  gap: 4px;
  padding: 6px 0 10px;
}
.acct-back {
  width: 40px; height: 40px;
  display: flex; align-items: center; justify-content: center;
  border: none; background: none; border-radius: 8px;
  color: #3A3934; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.acct-back:active { background: #EFEDE4; }
.acct-title { font-size: 16px; font-weight: 600; color: #2C2C2A; }

@media (max-width: 767px) {
  /* 「我的」页在手机上占满主区：顶栏(52) 与底部标签栏(57) 之间，内部滚动 */
  body[data-view="account"] .layout {
    display: block;
    padding: 0;
  }
  body[data-view="account"] #acctPage {
    display: block;
    /* v5.62：底栏改深色后它的高度仍按 57 算；`#acctPage` 高度已经扣过，
     * 这里补 `padding-bottom` 是因为 .wz 的 padding 里含
     * `env(safe-area-inset-bottom)/2`，实际比 57 略高，会盖住最后一行。 */
    height: calc(100dvh - 52px - 57px - env(safe-area-inset-bottom, 0px));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    background: #F5F4EF;
    padding: 0 16px calc(24px + env(safe-area-inset-bottom, 0px));
  }
  /* 头部粘住，滚长内容时"返回"不会滑走 */
  body[data-view="account"] .acct-head {
    position: sticky;
    top: 0;
    z-index: 3;
    background: #F5F4EF;
    margin: 0 -16px;
    padding: 6px 8px 10px 16px;
  }

  /* 内容区：整页没有圆角/把手，靠留白分隔；按钮要撑满宽度 */
  .acct-body { padding: 4px 0 0; }

  /* ---- 未登录卡片 ---- */
  .acct-guest {
    display: flex; align-items: center; gap: 12px;
    padding: 14px; margin-bottom: 12px;
    background: #F7F9F7; border: 1px solid #E6EDE7; border-radius: 12px;
  }
  .acct-avatar {
    width: 46px; height: 46px; flex: 0 0 46px;
    border-radius: 50%;
    background: #E4F1EA; color: #1D9E75;
    display: flex; align-items: center; justify-content: center;
  }
  .acct-guest-txt { min-width: 0; }
  .acct-guest-t {
    font-size: 14.5px; font-weight: 600; color: #2C2C2A;
    margin: 0 0 3px;
  }
  .acct-guest-s {
    font-size: 12.5px; color: #7A776B; line-height: 1.5; margin: 0;
  }
  .acct-btn {
    width: 100%;
    min-height: 46px;
    font-size: 15px;
    border-radius: 10px;
    margin-bottom: 16px;
  }

  /* ---- 会员信息位 ---- */
  .acct-card {
    border: 1px solid #EDEBE2; border-radius: 12px;
    overflow: hidden; margin-bottom: 14px;
  }
  .acct-row {
    display: flex; align-items: center; justify-content: space-between;
    gap: 12px;
    padding: 13px 14px;
    border-bottom: 1px solid #F4F2EB;
    font-size: 14px;
  }
  .acct-row:last-child { border-bottom: none; }
  .acct-k { color: #5A5852; flex: 0 0 auto; }
  .acct-v {
    color: #2C2C2A; font-weight: 500; text-align: right;
    /* 允许换行：像「本机保存（未同步）」这种 8 字以上在 320px 窄屏会被
     * ellipsis 切成「本机保存（未…」，宁可折两行也要读全。 */
    line-height: 1.45;
    word-break: break-word;
    min-width: 0;
  }
  .acct-v.on { color: #1D9E75; font-weight: 600; }

  .acct-note {
    font-size: 12.5px; line-height: 1.8; color: #8A8779;
    background: #FBFAF6; border-radius: 10px; padding: 12px 14px;
    margin: 0;
  }

  /* ---- 兑换码 ---- */
  .acct-redeem {
    border: 1px solid #EDEBE2; border-radius: 12px;
    padding: 13px 14px 8px;
    margin-bottom: 14px;
    background: #fff;
  }
  .acct-redeem.is-locked { opacity: .55; }
  .acct-redeem-k {
    display: block;
    font-size: 13px; font-weight: 600; color: #3A3934;
    margin-bottom: 9px;
  }
  .acct-redeem-row { display: flex; gap: 8px; }
  .acct-redeem-row input {
    flex: 1 1 auto; min-width: 0;
    min-height: 44px;
    padding: 10px 11px;
    border: 1px solid #D3D1C7; border-radius: 9px;
    font-size: 16px;                       /* ≥16px 防 iOS 聚焦放大 */
    letter-spacing: .8px;
    font-family: ui-monospace, "SF Mono", Menlo, monospace;
    background: #FDFDFB;
    color: #2C2C2A;
  }
  .acct-redeem-row input:focus {
    outline: 2px solid #5DCAA5; border-color: #1D9E75;
  }
  .acct-redeem-row .btn {
    flex: 0 0 auto;
    min-height: 44px;
    padding: 0 18px;
    border-radius: 9px;
    font-size: 14px;
  }
  .acct-redeem-tip {
    margin: 8px 0 4px;
    font-size: 12.5px; line-height: 1.5;
    min-height: 0;
  }
  .acct-redeem-tip.ok { color: #0F6E56; font-weight: 600; }
  .acct-redeem-tip.err { color: #B3261E; }

  /* ---- 订单记录 ---- */
  .acct-orders {
    border: 1px solid #EDEBE2; border-radius: 12px;
    overflow: hidden; margin-bottom: 14px; background: #fff;
  }
  .acct-orders-head {
    padding: 11px 14px;
    font-size: 13px; font-weight: 600; color: #3A3934;
    border-bottom: 1px solid #F4F2EB;
  }
  .acct-order {
    display: flex; align-items: center; gap: 10px;
    padding: 10px 14px;
    border-bottom: 1px solid #F7F5EE;
    font-size: 12.5px; color: #5A5852;
  }
  .acct-order:last-child { border-bottom: none; }
  .acct-order .ao-d { flex: 0 0 auto; color: #A9A79C; font-variant-numeric: tabular-nums; }
  .acct-order .ao-n { flex: 1 1 auto; min-width: 0; color: #2C2C2A; }
  .acct-order .ao-s {
    flex: 0 0 auto;
    font-size: 11.5px;
    padding: 1px 7px;
    border-radius: 999px;
    background: #EEF6F1; color: #0F6E56;
  }
}

/* ================================================================
 * v5.55 导出页（第 4 步）手机端：图纸铺满整屏 + 表格收进底部抽屉
 *
 * 甲方 2026-11-27：「导出界面的图，支持转成卫星图切换。放到整个手机界面。
 *   支持 ip 定位显示。显示当前手机所在位置。」/「页面占到这个位置」
 *   （截图里图纸只占上半屏，下面全被表格吃掉，看图要来回滚）。
 *
 * 结构与桌面完全不同（桌面是「左表格 + 右预览」两栏，手机放不下）：
 *   .layout          高度 = 100dvh − 顶栏 52 − 底部标签 57，超出不滚动
 *     .stage         铺满，position:relative
 *       #designWrap  绝对定位铺满（去掉圆角/边框，图贴边）
 *         #cv         绝对定位铺满（覆盖上面的 max-height:46vh）
 *         #satBox     卫星图同样铺满
 *         .legend     顶部一行半透明横向滚动条（不占版面）
 *         .exp-fabs   右侧悬浮圆钮：卫星/定位/±
 *   #pageResult      position:fixed 底部抽屉，收起 46dvh、展开 88dvh
 *
 * ⚠ 为什么图例改成"顶部一行横向滚动"而不是删掉：
 *   图例是看图的前提（颜色代表什么），但竖排 6 项要吃掉 100+ px。
 *   横向一行 + 半透明底，既不占版面又能随时对照。
 * ⚠ 为什么抽屉不铺满整屏：导出页的正事是**边看图边核表**，
 *   分成两个页签来回切更慢；抽屉收起时仍能看到方案摘要第一行。
 * ================================================================ */
.res-grab { display: none; }
/* 悬浮圆钮只在手机第 4 步出现；桌面用图例里的「卫星图」+ 缩放条，不重复 */
.exp-fabs { display: none; }

@media (max-width: 767px) {

  body[data-step="4"] { overflow: hidden; }
  body[data-step="4"] .layout {
    display: block;
    height: calc(100dvh - 52px - 57px - env(safe-area-inset-bottom, 0px));
    padding: 0;
    max-width: none;
  }
  body[data-step="4"] .stage {
    display: block;
    position: relative;
    height: 100%;
    max-width: none;
    padding: 0;
    margin: 0;
  }
  body[data-step="4"] #designWrap {
    position: absolute;
    inset: 0;
    margin: 0;
    padding: 0;
    border: none;
    border-radius: 0;
    background: #E8EDE6;
    z-index: 1;
  }
  body[data-step="4"] .canvas-box { position: absolute; inset: 0; }
  /* 覆盖上面那条 `#cv { height:auto !important; max-height:46vh }` ——
   * 必须也带 !important，否则高度只有 46vh，图纸缩在上半屏（正是甲方截图那一版）。 */
  body[data-step="4"] #cv {
    position: absolute; inset: 0;
    width: 100% !important;
    height: 100% !important;
    max-height: none !important;
  }
  body[data-step="4"] .sat-box { position: absolute; inset: 0; }

  /* --- 图例：顶部浮层，半透明 ---
   * 让它**换行**而不是横向滚动：横向滚动条在手机上没有任何可见提示，
   * 用户不会知道右边还藏着「种植方向」（实测截图里正好被切掉）。
   * 6 项在 390px 宽下换两行、每行 3 项，全部一眼可见。 */
  body[data-step="4"] .legend {
    display: flex;
    flex-wrap: wrap;
    align-items: center;
    gap: 4px 13px;
    position: absolute;
    left: 0; right: 0; top: 0;
    z-index: 6;
    margin: 0;
    padding: 7px 12px 8px;
    font-size: 11.5px;
    line-height: 1.5;
    color: #2C2C2A;
    white-space: nowrap;
    background: linear-gradient(to bottom, rgba(255,255,255,.95), rgba(255,255,255,.70));
    -webkit-backdrop-filter: blur(10px) saturate(1.4);
    backdrop-filter: blur(10px) saturate(1.4);
    pointer-events: auto;
  }
  body[data-step="4"] .legend > span { flex: 0 0 auto; }
  body[data-step="4"] .legend .sw { margin-right: 5px; }
  /* 缩放条在手机上换成右侧悬浮圆钮，这里整条收起（含桌面版的「卫星图」按钮） */
  body[data-step="4"] .zoom-ctl { display: none !important; }

  /* --- 右侧悬浮圆钮：卫星 / 定位 / ± ---
   * ⚠ 只在第 4 步显示。不要写成裸的 `.exp-fabs { display:flex }` ——
   * 那会让第 1/3 步也冒出一列圆钮（第 3 步虽然手机端隐藏，但 DOM 仍参与布局计算）。 */
  body[data-step="4"] .exp-fabs {
    position: absolute;
    right: 10px;
    top: 44px;
    z-index: 8;
    display: flex;
    flex-direction: column;
    gap: 8px;
  }
  .ef-btn {
    width: 40px; height: 40px;
    display: flex; align-items: center; justify-content: center;
    border: 1px solid rgba(255,255,255,.7);
    border-radius: 999px;
    background: rgba(255,255,255,.86);
    color: #0F6E56;
    font-family: inherit;
    font-size: 16px;
    font-weight: 600;
    line-height: 1;
    cursor: pointer;
    box-shadow: 0 2px 8px rgba(0,0,0,.16);
    -webkit-backdrop-filter: blur(10px);
    backdrop-filter: blur(10px);
    -webkit-tap-highlight-color: transparent;
  }
  .ef-btn:active { background: rgba(224,244,236,.95); }
  .ef-btn.ef-text { font-size: 12.5px; letter-spacing: .5px; }
  /* 卫星态：按钮变实心绿，文案改成「设计」——一眼看出当前是哪张图 */
  .ef-btn.on { background: #1D9E75; color: #fff; border-color: #1D9E75; }
  /* 定位中：转圈提示 */
  .ef-btn.busy { opacity: .6; pointer-events: none; }

  /* ===== v5.63（甲方 2026-11-28「保存不用在单独有一栏，把完成做成保存按钮即可」）=====
   * v5.62 那条浮在图纸底部的 `.save-bar`（命名输入框 + 保存按钮）**整体删除**，
   * 连同它的三条子样式。保存入口合并到顶栏右上角那颗按钮（第 4 步文案「保存」）。
   *
   * 为什么不留"隐藏的备用入口"：
   *   · 浮在图上会挡内容（本条样式的存在理由本来就是"不挡图"，说明它天生多余）；
   *   · 名字早就有来源（菜单新建 / 打开存档 / 导入 KML 文件名），摆输入框等于
   *     让用户输第二遍；
   *   · 两个入口 = 两套可用性判据，迟早分叉（这个项目在"菜单导出全灰"上踩过）。
   * ⚠ 因此 `#designName` / `#btnSaveDesign` 已从 DOM 删除，别再往 CSS 里补它们的样式。 */

  /* --- 定位结果提示 ---
   * 放**顶部**而不是底部：底部被收起态的表格抽屉盖住（抽屉 z-index 30 > 图内 8），
   * 提示写在那儿等于没写。顶部挤在图例与悬浮钮之间那条空白带上，6 秒后自动消失。 */
  .myloc-tip {
    position: absolute;
    left: 10px; right: 60px;
    top: 44px;
    z-index: 9;
    padding: 7px 11px;
    border-radius: 8px;
    background: rgba(10,32,24,.84);
    color: #F2FBF6;
    font-size: 12px;
    line-height: 1.5;
    pointer-events: none;
  }

  /* --- 表格抽屉 --- */
  body[data-step="4"] #pageResult {
    position: fixed;
    left: 0; right: 0;
    bottom: calc(57px + env(safe-area-inset-bottom, 0px));
    z-index: 30;
    display: block;
    /* 收起态 = **只有一条把手**（52px）：图纸因此铺满整个可用高度。
     * 甲方截图要的是"图大到那个红框"，任何常驻的表格高度都会把图压小，
     * 所以收起态不露表头、不露摘要，只留"上滑看表格"。 */
    height: 52px;
    margin: 0;
    padding: 0 12px 0;
    background: #F5F4EF;
    border-radius: 14px 14px 0 0;
    box-shadow: 0 -4px 18px rgba(0,0,0,.14);
    overflow: hidden;                 /* 收起时内容不许溢出来盖住图 */
    transition: height .28s cubic-bezier(.32,.72,0,1);
  }
  /* 展开高度**不能用 dvh 直接给**：抽屉 bottom 已经让出 57px 标签栏，
   * 再加 86dvh 从底部往上量，顶部会超过顶栏 52px 把它盖住
   * （实测 390×664 下 57+571=628 > 664-52=612，顶栏被吃掉 16px）。
   * 用 min() 夹住可用高度：铺满但绝不越顶。 */
  body[data-step="4"] #pageResult.expanded {
    height: min(86dvh, calc(100dvh - 52px - 57px - env(safe-area-inset-bottom, 0px)));
    overflow-y: auto;
    -webkit-overflow-scrolling: touch;
    padding-bottom: calc(18px + env(safe-area-inset-bottom, 0px));
    box-shadow: 0 -8px 30px rgba(0,0,0,.24);
  }
  /* 抽屉内部纵向间距（原来是 flex gap，改成 block 后用相邻兄弟 margin 补） */
  body[data-step="4"] #pageResult > * + * { margin-top: 12px; }

  .res-grab {
    display: flex;
    flex-direction: column;
    align-items: center;
    gap: 5px;
    position: sticky;
    top: 0;
    z-index: 3;
    width: calc(100% + 24px);
    margin: 0 -12px 10px;
    padding: 7px 0 8px;
    background: #F5F4EF;
    border: none;
    font-family: inherit;
    cursor: pointer;
    -webkit-tap-highlight-color: transparent;
  }
  .res-grab .rg-bar {
    width: 40px; height: 4px;
    border-radius: 999px;
    background: #CBC8BC;
  }
  .res-grab .rg-hint { font-size: 11.5px; color: #8A8779; line-height: 1.4; }
  /* 收起态：把手贴着屏幕底（表格内容被 overflow:hidden 裁掉），
   * 视觉上与「上滑看表格」的抽屉把手指南一致。 */
}

/* ================================================================
 * v5.58 设计存档（甲方「记忆功能」）
 *
 * 两个区块（第三块 `.save-block` 已在 v5.63 随保存栏一起删除）：
 *   .hist-block    「我的」页顶部的历史列表
 *   .param-shortcut 第 2 步的「填入常用值」
 * ================================================================ */

/* ---- 历史设计列表 ---- */
.hist-block {
  border: 1px solid #EDEBE2;
  border-radius: 12px;
  background: #fff;
  overflow: hidden;
  margin-bottom: 14px;
}
.hist-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 11px 14px;
  border-bottom: 1px solid #F4F2EB;
}
.hist-title { font-size: 13.5px; font-weight: 600; color: #3A3934; }
.hist-list { max-height: 320px; overflow-y: auto; -webkit-overflow-scrolling: touch; }
.hist-empty {
  padding: 20px 14px;
  font-size: 12.5px; line-height: 1.7; color: #A9A79C;
  text-align: center;
}
.hist-item {
  display: flex; align-items: center; gap: 10px;
  padding: 11px 14px;
  border-bottom: 1px solid #F7F5EE;
}
.hist-item:last-child { border-bottom: none; }
.hist-item .hi-main { flex: 1 1 auto; min-width: 0; }
.hist-item .hi-name {
  display: block;
  font-size: 13.5px; color: #2C2C2A; font-weight: 500;
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  line-height: 1.4;
}
.hist-item .hi-meta {
  display: block;
  font-size: 11.5px; color: #A9A79C; line-height: 1.5;
  margin-top: 1px;
}
.hist-item .hi-acts {
  flex: 0 0 auto;
  display: flex; gap: 12px;
  font-size: 12.5px;
}
.hist-item .hi-del { color: #B3261E; }
.hist-item .hi-del:hover { color: #8E1E17; }

/* 列表页脚：条数 + 加载更多（v5.59 分页） */
.hist-foot {
  display: flex; align-items: center; justify-content: space-between;
  gap: 10px;
  padding: 10px 14px;
  border-top: 1px solid #F4F2EB;
  font-size: 11.5px; color: #A9A79C;
}
.hist-foot .linkbtn { font-size: 12.5px; }

/* ===== v5.63：保存栏相关样式全部删除 =====
 *
 * 这一段原来是 `.save-bar` / `.save-block` / `.save-name`（输入框）的样式。
 * 甲方「保存不用在单独有一栏，把完成做成保存按钮即可」→ 整块删掉，
 * 保存入口只在顶栏（文案「保存」）。名字改由 `prompt()` 现问，
 * 不需要输入框样式。
 *
 * `.save-tip` **保留** —— 它还在用（保存成功/失败、「没能保存：请先圈地」
 * 这类反馈），而且它在第 4 步的表格抽屉顶部，不依赖保存栏。 */
.save-tip {
  margin: 0 0 10px;
  padding: 7px 11px;
  border-radius: 8px;
  font-size: 12.5px; line-height: 1.5;
}
.save-tip.ok  { background: #EDF7F1; color: #0F6E56; }
.save-tip.err { background: #FBF0F0; color: #B3261E; }

/* ---- 第 2 步：填入常用值 ---- */
.param-shortcut {
  display: flex; align-items: center; gap: 10px;
  flex-wrap: wrap;
  margin: 10px 0 2px;
}
.param-shortcut .btn.sm {
  padding: 5px 13px;
  font-size: 12.5px;
  border-radius: 7px;
}
.ps-tip { font-size: 11.5px; color: #A9A79C; line-height: 1.5; }
.ps-tip.done { color: #0F6E56; }

@media (max-width: 767px) {
  /* 手机：历史列表限高，避免一屏全是记录看不到参数（v5.63 起保存栏已删） */
  .hist-list { max-height: 46vh; }
  .param-shortcut .btn.sm { min-height: 40px; font-size: 13px; }
  .ps-tip { font-size: 12.5px; }
}

/* ================================================================
 * v5.60 导出方案 PDF 的页面排版
 *
 * 尺寸按 A4 @96dpi 的像素（竖 794×1123 / 横 1123×794），
 * html2canvas 再按 scale 2.2 放大 → 打印约 200 DPI。
 *
 * ⚠ 这些页面是**挂在屏幕外但必须可见**的（left:-10000px）。
 *   不能 display:none —— html2canvas 对隐藏元素会渲出空白图，
 *   而且不报错，非常难查（这是它最经典的坑）。
 * ================================================================ */
.pdf-page {
  /* ⚠ 必须 absolute + 移出视口：这些页是给 html2canvas 截图的，
   * 留在正常流里会盖在页面内容上（实测截图里混进了顶栏和步骤条）。 */
  position: absolute;
  left: -20000px;
  top: 0;
  box-sizing: border-box;
  width: 794px;
  height: 1123px;
  padding: 48px 56px;
  background: #fff;
  color: #1a1a1a;
  font-family: "PingFang SC", "Microsoft YaHei", "Noto Sans SC", sans-serif;
  font-size: 13px;
  line-height: 1.6;
  overflow: hidden;
}
.pdf-page.landscape {
  width: 1123px;
  height: 794px;
  padding: 30px 34px;
}

.pdf-page .p-head {
  border-bottom: 2.5px solid #1D9E75;
  padding-bottom: 9px;
  margin-bottom: 18px;
}
.pdf-page .p-title {
  font-size: 22px;
  font-weight: 700;
  color: #0F5C46;
  letter-spacing: 1px;
  line-height: 1.3;
}
.pdf-page .p-sub {
  font-size: 11.5px;
  color: #6b6b66;
  margin-top: 5px;
}
.pdf-page .p-head-design {
  border-bottom-width: 2px;
  margin-bottom: 10px;
  padding-bottom: 7px;
}
.pdf-page .p-head-design .p-title { font-size: 17px; }

/* 关键指标条 */
.pdf-page .p-kv {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 1px;
  background: #E4E2D8;
  border: 1px solid #E4E2D8;
  margin-bottom: 20px;
}
.pdf-page .p-kv > div {
  background: #F8FAF8;
  padding: 9px 11px;
}
.pdf-page .p-kv span {
  display: block;
  font-size: 10.5px;
  color: #8a8880;
  margin-bottom: 2px;
}
.pdf-page .p-kv b {
  font-size: 14px;
  color: #1a1a1a;
  font-weight: 600;
}

.pdf-page h3 {
  font-size: 14px;
  font-weight: 700;
  color: #0F5C46;
  margin: 20px 0 9px;
  padding-left: 9px;
  border-left: 3.5px solid #1D9E75;
  line-height: 1.4;
}
.pdf-page h3:first-of-type { margin-top: 4px; }

.pdf-page .p-note {
  font-size: 10.5px;
  color: #7a776b;
  line-height: 1.6;
  margin: -4px 0 8px;
  background: #FBFAF6;
  padding: 7px 10px;
  border-radius: 4px;
}
.pdf-page .p-note.warn { background: #FDF4E3; color: #7A4A00; }

/* 表格 */
.pdf-page table.pt {
  width: 100%;
  border-collapse: collapse;
  font-size: 11.5px;
  table-layout: fixed;
}
.pdf-page table.pt th {
  background: #EDF5F0;
  color: #0F5C46;
  font-weight: 600;
  text-align: left;
  padding: 7px 9px;
  border: 1px solid #D8E4DC;
  font-size: 11px;
  white-space: nowrap;
}
.pdf-page table.pt td {
  padding: 6px 9px;
  border: 1px solid #E9E7DE;
  vertical-align: top;
  word-break: break-word;
}
.pdf-page table.pt tbody tr:nth-child(even) td { background: #FCFCFA; }
.pdf-page table.pt td.num { text-align: right; font-variant-numeric: tabular-nums; }

/* 设计图 */
.pdf-page .p-figure {
  width: 100%;
  height: 600px;
  border: 1px solid #D8D6CC;
  background: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  overflow: hidden;
}
.pdf-page .p-figure img {
  max-width: 100%;
  max-height: 100%;
  width: auto;
  height: auto;
  display: block;
}
.pdf-page .p-fignote {
  font-size: 10px;
  color: #6b6b66;
  line-height: 1.7;
  margin-top: 8px;
  border-top: 1px dashed #DDDBD0;
  padding-top: 7px;
}

/* 打印时隐藏所有页面元素（这是给 html2canvas 用的，不是打印机） */
@media print {
  .pdf-page { display: none !important; }
}

/* 导出进度浮条 */
.pdf-toast {
  position: fixed;
  left: 50%; bottom: 90px;
  transform: translate(-50%, 12px);
  z-index: 200;
  max-width: calc(100vw - 40px);
  padding: 11px 18px;
  border-radius: 999px;
  background: rgba(20,32,26,.92);
  color: #F2FBF6;
  font-size: 13px;
  line-height: 1.5;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s, transform .2s;
  box-shadow: 0 4px 18px rgba(0,0,0,.22);
}
.pdf-toast.show { opacity: 1; transform: translate(-50%, 0); }
.pdf-toast.err { background: rgba(150,32,26,.94); }
.pdf-toast.ok  { background: rgba(15,92,70,.94); }
