/* 古树复壮台账 · 视觉系统
   结构：令牌 → 基础排版 → 头部 → 概览数据带 → 工具栏/标签 → 地图与浮层 → 抽屉 → 弹窗 → 反馈 → 响应式 */

:root {
  /* 品牌：冷杉绿，用于主行动与已选中状态 */
  --brand-900: #103524;
  --brand-800: #174a33;
  --brand-700: #1f6244;
  --brand-600: #2b7a56;
  --brand-500: #4a9470;
  --brand-300: #a5cfb6;
  --brand-200: #cfe6d8;
  --brand-100: #e6f2ea;
  --brand-50: #f2f8f4;

  /* 需要注意（未上图、待补照片） */
  --accent-700: #9a5a15;
  --accent-600: #b8722a;
  --accent-300: #e6c9a4;
  --accent-100: #fbf1e3;

  /* 破坏性操作 */
  --danger-700: #a03a2b;
  --danger-600: #b74a37;
  --danger-200: #eec9c1;
  --danger-50: #fdf2ef;

  /* 中性：带一点绿灰，避免与品牌色打架 */
  --ink-900: #12211a;
  --ink-700: #2c4035;
  --ink-600: #42574b;
  --ink-500: #5c7065;
  --ink-400: #7f9186;
  --line-100: #eff3f0;
  --line-200: #e1e9e3;
  --line-300: #cdd9d1;
  --surface: #ffffff;
  --surface-2: #f7faf8;
  --canvas: #edf3ee;

  /* 尺度 */
  --r-sm: 8px;
  --r-md: 11px;
  --r-lg: 15px;
  --r-pill: 999px;
  --pad-page: 20px 26px 22px;
  --shadow-sm: 0 1px 2px rgba(15, 45, 30, .06), 0 1px 3px rgba(15, 45, 30, .05);
  --shadow-md: 0 4px 14px rgba(15, 45, 30, .09);
  --shadow-float: 0 6px 24px rgba(15, 45, 30, .14), 0 1px 2px rgba(15, 45, 30, .10);
  --shadow-panel: 0 24px 60px rgba(12, 35, 24, .22);
  --float-bg: rgba(255, 255, 255, .93);
  --ease: cubic-bezier(.22, .61, .36, 1);

  --font: -apple-system, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans CJK SC", system-ui, sans-serif;
}

/* —— 基础 —— */
* { box-sizing: border-box; }
.svg-defs { position: absolute; }
html { height: 100%; }
body {
  min-height: 100%;
  margin: 0;
  background: var(--canvas);
  color: var(--ink-700);
  font-family: var(--font);
  font-size: 14px;
  line-height: 1.55;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}
button, input, select { font: inherit; color: inherit; }
button { cursor: pointer; }
button:disabled { cursor: not-allowed; opacity: .5; }
button, input, select { outline: none; }
:focus-visible { outline: 2px solid var(--brand-600); outline-offset: 2px; border-radius: 4px; }
h1, h2, h3, p { overflow-wrap: anywhere; }
.icon { width: 18px; height: 18px; fill: none; stroke: currentColor; stroke-width: 1.75; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.hidden { display: none !important; }
.num, .stat-value { font-variant-numeric: tabular-nums; }

/* —— 头部 —— */
.app-header {
  height: 62px;
  flex: none;
  padding: 0 26px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 20px;
  background: var(--surface);
  border-bottom: 1px solid var(--line-200);
}
.brand { display: flex; align-items: center; gap: 12px; min-width: 0; }
.brand-mark {
  width: 36px;
  height: 36px;
  display: grid;
  place-items: center;
  border-radius: 10px;
  background: linear-gradient(160deg, var(--brand-700), var(--brand-900));
  color: #fff;
  flex: none;
  box-shadow: var(--shadow-sm);
}
.brand-mark .icon { width: 21px; height: 21px; }
.brand-text { min-width: 0; }
.brand h1 { margin: 0; font-size: 16.5px; font-weight: 650; letter-spacing: .06em; color: var(--ink-900); white-space: nowrap; }
.brand p { margin: 2px 0 0; color: var(--ink-400); font-size: 11.5px; letter-spacing: .02em; }
.header-actions { display: flex; align-items: center; gap: 10px; }
.source-state {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 5px 12px 5px 10px;
  border: 1px solid var(--line-200);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink-500);
  font-size: 11.5px;
  white-space: nowrap;
}
.source-state::before {
  content: "";
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: var(--brand-500);
  box-shadow: 0 0 0 3px rgba(74, 148, 112, .16);
  flex: none;
}

/* —— 概览数据带 —— */
.workspace { width: 100%; max-width: 1840px; margin: 0 auto; padding: var(--pad-page); }
.overview {
  display: grid;
  grid-template-columns: 1.25fr repeat(4, 1fr);
  margin-bottom: 14px;
  padding: 0 6px;
  background: var(--surface);
  border: 1px solid var(--line-200);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.stat {
  display: flex;
  flex-direction: column;
  justify-content: center;
  gap: 1px;
  min-width: 0;
  padding: 15px 20px;
}
.stat + .stat { border-left: 1px solid var(--line-100); }
.stat-value {
  font-size: 27px;
  font-weight: 650;
  line-height: 1.15;
  letter-spacing: -.01em;
  color: var(--ink-900);
}
.stat-primary .stat-value { color: var(--brand-800); }
.stat-label { color: var(--ink-400); font-size: 11.5px; letter-spacing: .04em; }
#statPhotosCard { cursor: default; }
#statPhotosCard:hover { background: var(--surface-2); }
#statPhotosCard.is-error { cursor: pointer; background: var(--danger-50); }
#statPhotosCard.is-error .stat-value { color: var(--danger-700); }
#statPhotosCard.is-error .stat-label { color: var(--danger-600); }

/* —— 主面板 —— */
.panel {
  background: var(--surface);
  border: 1px solid var(--line-200);
  border-radius: var(--r-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.toolbar {
  min-height: 62px;
  padding: 12px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-bottom: 1px solid var(--line-200);
}
.toolbar-divider { width: 1px; height: 22px; background: var(--line-200); flex: none; }
.primary-tabs {
  display: inline-flex;
  align-items: center;
  gap: 2px;
  padding: 3px;
  border-radius: var(--r-md);
  background: var(--surface-2);
  border: 1px solid var(--line-200);
  flex: none;
}
.primary-tab {
  padding: 6px 16px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-500);
  font-size: 13.5px;
  font-weight: 550;
  letter-spacing: .04em;
  white-space: nowrap;
  transition: background .16s var(--ease), color .16s var(--ease), box-shadow .16s var(--ease);
}
.primary-tab:hover { color: var(--brand-800); }
.primary-tab.active {
  background: var(--surface);
  color: var(--brand-800);
  font-weight: 650;
  box-shadow: var(--shadow-sm);
}
.search-box {
  height: 38px;
  flex: 1 1 320px;
  min-width: 200px;
  max-width: 460px;
  display: flex;
  align-items: center;
  gap: 9px;
  padding: 0 12px;
  border: 1px solid var(--line-200);
  border-radius: var(--r-md);
  background: var(--surface-2);
  transition: background .16s var(--ease), border-color .16s var(--ease), box-shadow .16s var(--ease);
}
.search-box:hover { border-color: var(--line-300); }
.search-box:focus-within { background: var(--surface); border-color: var(--brand-500); box-shadow: 0 0 0 3px rgba(43, 122, 86, .13); }
.search-box .icon { width: 16px; height: 16px; color: var(--ink-400); }
.search-box input { width: 100%; min-width: 0; border: 0; background: transparent; color: var(--ink-900); }
.search-box input::placeholder { color: var(--ink-400); }
.search-clear { width: 24px; height: 24px; padding: 0; border: 0; background: transparent; color: var(--ink-400); display: grid; place-items: center; border-radius: 6px; }
.search-clear .icon { width: 15px; height: 15px; }
.search-clear:hover { background: var(--brand-100); color: var(--brand-800); }
.toolbar-note { margin-left: auto; color: var(--ink-400); font-size: 11.5px; white-space: nowrap; }
.view-modes { display: inline-flex; align-items: center; gap: 2px; margin-left: auto; padding: 3px; border: 1px solid var(--line-200); border-radius: var(--r-md); background: var(--surface-2); flex: none; }
.toolbar-note + .view-modes { margin-left: auto; }
.view-modes .map-tool { min-height: 28px; padding: 0 12px; border: 0; border-radius: var(--r-sm); background: transparent; box-shadow: none; color: var(--ink-500); font-size: 12.5px; font-weight: 550; }
.view-modes .map-tool:hover { background: rgba(255, 255, 255, .7); color: var(--brand-800); }
.view-modes .map-tool.active { background: var(--surface); color: var(--brand-800); font-weight: 650; box-shadow: var(--shadow-sm); }
.toolbar:has(.toolbar-note) .view-modes { margin-left: 0; }

.category-tabs {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 10px 16px;
  overflow-x: auto;
  background: var(--surface);
  border-bottom: 1px solid var(--line-200);
  scrollbar-width: thin;
}
.category-tab {
  min-height: 31px;
  padding: 0 12px;
  border: 1px solid transparent;
  border-radius: var(--r-pill);
  background: transparent;
  color: var(--ink-500);
  display: inline-flex;
  align-items: center;
  gap: 7px;
  white-space: nowrap;
  font-size: 12.5px;
  transition: background .14s var(--ease), color .14s var(--ease), border-color .14s var(--ease);
}
.category-tab:hover { background: var(--brand-50); color: var(--brand-800); }
.category-tab.active { background: var(--brand-100); border-color: var(--brand-200); color: var(--brand-900); font-weight: 650; }
.category-tab .count { color: var(--ink-400); font-size: 11px; font-weight: 400; font-variant-numeric: tabular-nums; }
.category-tab.active .count { color: var(--brand-700); }
.category-dot { width: 7px; height: 7px; border-radius: 50%; background: var(--brand-500); flex: none; }

/* —— 地图舞台 —— */
.view-content { position: relative; }
.map-stage {
  position: relative;
  height: calc(100vh - 320px);
  min-height: 520px;
  overflow: hidden;
  background: #e4ece5;
}
#map { position: absolute; inset: 0; }

/* 浮层通用 */
.map-info, .map-legend, .selection-tray, .tool-group, .map-tools > .map-tool {
  background: var(--float-bg);
  -webkit-backdrop-filter: blur(10px) saturate(1.06);
  backdrop-filter: blur(10px) saturate(1.06);
  border: 1px solid rgba(255, 255, 255, .72);
  box-shadow: var(--shadow-float);
  border-radius: var(--r-md);
}
.map-info {
  position: absolute;
  z-index: 430;
  top: 14px;
  left: 14px;
  width: 274px;
  padding: 13px 15px 14px;
  pointer-events: none;
}
.map-info h2 { margin: 0 0 8px; font-size: 14.5px; font-weight: 650; letter-spacing: .02em; color: var(--ink-900); }
.map-info-head { display: flex; align-items: flex-start; justify-content: space-between; gap: 8px; }
.map-info-toggle { pointer-events: auto; flex: none; width: 26px; height: 26px; margin: -2px -2px 0 0; padding: 0; border: 1px solid var(--line-300); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-500); display: grid; place-items: center; cursor: pointer; transition: background .15s var(--ease), color .15s var(--ease); }
.map-info-toggle:hover { background: var(--brand-50); color: var(--brand-800); }
.map-info-toggle .icon { width: 15px; height: 15px; transition: transform .2s var(--ease); }
.map-info.collapsed .map-info-toggle .icon { transform: rotate(180deg); }
.map-info.collapsed h2 { margin-bottom: 0; }
.map-info.collapsed #mapSummary { display: none; }
.map-info.collapsed { padding-bottom: 12px; }
.map-info p { margin: 0; color: var(--ink-500); font-size: 11.5px; line-height: 1.7; }
.map-info .summary-line { display: block; }
.map-info strong { color: var(--brand-800); font-weight: 650; font-size: 12.5px; font-variant-numeric: tabular-nums; }
.summary-note {
  display: block;
  margin-top: 9px;
  padding-top: 8px;
  border-top: 1px dashed var(--line-200);
  color: var(--ink-400);
  font-size: 10.5px;
  line-height: 1.65;
}
.summary-warn { display: block; margin-top: 4px; color: var(--accent-700); font-size: 11px; }
.link-btn { margin-left: 2px; padding: 3px 6px; margin-right: -6px; border: 0; background: none; color: var(--brand-700); font: inherit; font-weight: 650; text-decoration: underline; text-underline-offset: 2px; cursor: pointer; pointer-events: auto; }
/* 负 margin 抵消 padding，避免撑乱版式的同时把点击区抬到 ≥24px 高（触屏可用性） */
.link-btn:hover { color: var(--brand-900); }

.map-tools {
  position: absolute;
  z-index: 440;
  top: 14px;
  right: 14px;
  display: flex;
  align-items: center;
  flex-wrap: wrap;
  justify-content: flex-end;
  gap: 8px;
  max-width: min(600px, calc(100% - 314px));
}
.tool-group { display: inline-flex; align-items: center; gap: 2px; padding: 3px; }
.map-tool {
  min-height: 30px;
  padding: 0 11px;
  border: 0;
  border-radius: var(--r-sm);
  background: transparent;
  color: var(--ink-600);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  font-size: 12.5px;
  font-weight: 550;
  transition: background .14s var(--ease), color .14s var(--ease);
}
.map-tool .icon { width: 15px; height: 15px; }
.tool-group .map-tool:hover:not(:disabled) { background: rgba(255, 255, 255, .8); color: var(--brand-800); }
.tool-group .map-tool.active { background: var(--brand-100); color: var(--brand-800); font-weight: 650; }
.map-tool:disabled { opacity: .42; }
.map-tools > .map-tool { padding: 0 13px; min-height: 36px; }
.map-tools > .map-tool.danger { color: var(--danger-700); font-weight: 650; }
.map-tools > .map-tool.danger:hover { background: var(--danger-50); }
.map-tools > .map-tool.danger.active {
  background: var(--danger-600);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 6px 18px rgba(160, 58, 43, .32);
}

/* 底部停靠：图例 + 操作提示 */
.map-dock {
  position: absolute;
  z-index: 430;
  left: 14px;
  right: 150px;
  bottom: 14px;
  max-width: calc(100% - 164px);
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 8px;
  pointer-events: none;
}
.map-legend {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 5px 12px;
  padding: 8px 13px;
  max-width: 100%;
  color: var(--ink-600);
  font-size: 11.5px;
}
.legend-title { font-weight: 650; color: var(--brand-800); letter-spacing: .02em; }
.legend-item { display: inline-flex; align-items: center; gap: 5px; }
.legend-item i { width: 8px; height: 8px; border-radius: 50%; box-shadow: 0 0 0 1px rgba(255, 255, 255, .8); }
.legend-item em { font-style: normal; color: var(--ink-400); font-variant-numeric: tabular-nums; }
.legend-scope { padding-left: 12px; border-left: 1px solid var(--line-200); color: var(--ink-700); font-variant-numeric: tabular-nums; }
.legend-foot { margin-left: auto; padding-left: 12px; color: var(--ink-400); }
.map-hint {
  padding: 7px 12px;
  border-radius: var(--r-sm);
  background: rgba(17, 38, 27, .78);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #e7f1ea;
  font-size: 11.5px;
  line-height: 1.65;
  max-width: min(940px, 100%);
}
.map-stage:has(.selection-tray:not(.hidden)) .map-hint,
.map-stage:has(.selection-tray:not(.hidden)) .map-legend { display: none; }

/* 框选 */
.map-stage.selecting, .map-stage.selecting #map, .map-stage.selecting .leaflet-container { cursor: crosshair !important; }
/* 框选模式下禁止浏览器把手势当页面滚动，保证触屏拖框连续 */
.map-stage.selecting { touch-action: none; }
.selection-layer { position: absolute; inset: 0; z-index: 420; pointer-events: none; }
.selection-box {
  position: absolute;
  display: none;
  border: 1.5px solid var(--brand-600);
  background: rgba(43, 122, 86, .14);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .85) inset;
  border-radius: 2px;
}
.selection-tray {
  position: absolute;
  z-index: 460;
  left: 50%;
  bottom: 16px;
  transform: translateX(-50%);
  width: min(860px, calc(100% - 28px));
  padding: 11px 14px;
  display: flex;
  align-items: center;
  gap: 12px;
  border-color: var(--brand-200);
}
.selection-count { min-width: 150px; color: var(--ink-600); font-weight: 600; font-size: 12px; }
.selection-count b { color: var(--brand-800); font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.selection-summary { flex: 1; min-width: 0; display: flex; align-items: center; gap: 6px; overflow-x: auto; white-space: nowrap; color: var(--ink-500); font-size: 11.5px; scrollbar-width: thin; }
.tray-chip { flex: none; display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border: 1px solid var(--line-200); border-radius: var(--r-pill); background: var(--surface-2); color: var(--ink-600); font-size: 11px; }
.tray-chip i { width: 7px; height: 7px; border-radius: 50%; }
.tray-chip em { font-style: normal; color: var(--brand-800); font-weight: 650; font-variant-numeric: tabular-nums; }
.tray-note { flex: none; color: var(--ink-400); font-size: 11px; }

/* 地图状态遮罩 */
.map-status {
  position: absolute;
  z-index: 450;
  inset: 0;
  display: grid;
  place-items: center;
  padding: 30px;
  background: rgba(237, 243, 238, .92);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  text-align: center;
}
.map-status-card { max-width: 440px; }
.map-status-card .empty-icon { margin: 0 auto 18px; }
.map-status-card h3 { margin: 0 0 9px; color: var(--ink-900); font-size: 17px; font-weight: 650; letter-spacing: .02em; }
.map-status-card p { margin: 0 0 20px; color: var(--ink-500); font-size: 12.5px; line-height: 1.85; }
.empty-icon { width: 62px; height: 62px; display: grid; place-items: center; border-radius: var(--r-lg); background: var(--brand-100); color: var(--brand-600); }
.empty-icon .icon { width: 30px; height: 30px; }
.spinner { width: 28px; height: 28px; margin: 0 auto 14px; border: 2.5px solid var(--brand-200); border-top-color: var(--brand-600); border-radius: 50%; animation: spin .8s linear infinite; }
@keyframes spin { to { transform: rotate(360deg); } }

/* —— Leaflet 细节 —— */
.tree-label {
  color: #0f2d1f;
  font-size: 10.5px;
  font-weight: 650;
  letter-spacing: .01em;
  white-space: nowrap;
  pointer-events: none;
  display: flex;
  align-items: center;
  gap: 3px;
}
/* 浅色胶囊底衬：深色卫星/影像底图上仍清晰可读；标注 pane 高于全部业务图层 */
.tree-label span {
  padding: 1px 7px;
  border-radius: 9px;
  background: rgba(255, 255, 255, .85);
  box-shadow: 0 0 0 1px rgba(255, 255, 255, .7), 0 1px 3px rgba(12, 40, 26, .28);
}
.tree-badge { display: inline-grid; place-items: center; min-width: 14px; height: 14px; padding: 0 3.5px; border-radius: var(--r-pill); background: var(--brand-800); color: #fff; font-size: 9.5px; font-style: normal; font-weight: 650; text-shadow: none; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .9); }
.ops-node { background: none; }
.ops-ring { display: block; filter: drop-shadow(0 1px 1.5px rgba(12, 40, 26, .5)); cursor: pointer; }
.cluster-node { background: none; }
.cluster-bubble {
  display: grid;
  place-items: center;
  min-width: 46px;
  padding: 5px 10px;
  border: 1.5px solid rgba(23, 74, 51, .55);
  border-radius: var(--r-pill);
  background: rgba(255, 255, 255, .92);
  color: var(--brand-900);
  box-shadow: 0 3px 12px rgba(15, 45, 30, .2);
  cursor: pointer;
  line-height: 1.2;
}
.cluster-bubble strong { font-size: 15px; font-weight: 650; font-variant-numeric: tabular-nums; }
.cluster-bubble span { color: var(--ink-500); font-size: 10px; white-space: nowrap; }
.cluster-bubble em { font-style: normal; color: var(--accent-700); font-size: 10px; }
.cluster-bubble.md { min-width: 58px; }
.cluster-bubble.lg { min-width: 68px; border-color: rgba(16, 53, 36, .8); background: rgba(255, 255, 255, .96); }
.cluster-bubble.xl { min-width: 78px; border-width: 2px; background: var(--brand-50); }
.cluster-bubble.single { border-style: dashed; }
.leaflet-control-attribution { font-size: 9.5px !important; background: rgba(255, 255, 255, .78) !important; border-radius: 5px 0 0; padding: 1px 6px !important; }
.leaflet-control-zoom { border: 0 !important; box-shadow: var(--shadow-float) !important; border-radius: 10px !important; overflow: hidden; margin: 0 14px 14px !important; }
.leaflet-control-zoom a { width: 30px !important; height: 30px !important; line-height: 29px !important; color: var(--brand-800) !important; background: var(--float-bg) !important; font-size: 17px !important; }
.leaflet-control-zoom a:hover { background: var(--brand-100) !important; }
.leaflet-control-scale { margin: 0 14px 4px !important; }
.leaflet-control-scale-line { background: rgba(255, 255, 255, .82) !important; border-color: rgba(23, 74, 51, .55) !important; color: var(--ink-600); font-size: 10px; border-radius: 3px; padding: 1px 5px; }
.leaflet-container { font-family: var(--font); }

/* —— 右侧详情抽屉 —— */
.drawer-backdrop {
  position: fixed;
  z-index: 1100;
  inset: 0;
  background: rgba(14, 34, 24, .26);
  -webkit-backdrop-filter: blur(1.5px);
  backdrop-filter: blur(1.5px);
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease);
}
.drawer-backdrop.open { opacity: 1; pointer-events: auto; }
.drawer {
  position: fixed;
  z-index: 1101;
  top: 0;
  right: 0;
  bottom: 0;
  width: min(492px, 100%);
  background: var(--surface);
  border-left: 1px solid var(--line-200);
  box-shadow: -22px 0 60px rgba(14, 40, 26, .18);
  transform: translateX(102%);
  transition: transform .24s var(--ease);
  display: flex;
  flex-direction: column;
}
.drawer.open { transform: translateX(0); }
.drawer-header { padding: 22px 24px 18px; border-bottom: 1px solid var(--line-200); display: flex; align-items: flex-start; gap: 14px; background: linear-gradient(180deg, var(--brand-50), var(--surface)); }
.drawer-header-text { flex: 1; min-width: 0; }
.drawer-eyebrow { margin-bottom: 6px; color: var(--brand-700); font-size: 11px; font-weight: 600; letter-spacing: .1em; }
.drawer-header h2 { margin: 0; color: var(--ink-900); font-size: 25px; font-weight: 650; line-height: 1.2; letter-spacing: -.01em; font-variant-numeric: tabular-nums; }
.drawer-header p { margin: 7px 0 0; color: var(--ink-500); font-size: 12px; line-height: 1.6; }
.icon-btn { width: 32px; height: 32px; padding: 0; border: 1px solid transparent; border-radius: var(--r-sm); background: transparent; color: var(--ink-500); display: grid; place-items: center; flex: none; transition: background .14s var(--ease), color .14s var(--ease); }
.icon-btn:hover { background: var(--brand-100); color: var(--brand-800); }
.icon-btn .icon { width: 17px; height: 17px; }
.drawer-body { flex: 1; overflow: auto; padding: 20px 24px 32px; }

.tree-chips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 14px; }
.tree-chip {
  min-height: 30px;
  padding: 0 12px;
  border: 1px solid var(--line-200);
  border-radius: var(--r-pill);
  background: var(--surface-2);
  color: var(--ink-600);
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  transition: background .14s var(--ease), border-color .14s var(--ease), color .14s var(--ease);
}
.tree-chip:hover { background: var(--brand-50); border-color: var(--brand-300); color: var(--brand-800); }
.tree-chip.active { background: var(--brand-100); border-color: var(--brand-200); color: var(--brand-900); font-weight: 650; }
.tree-chip em { font-style: normal; font-size: 10.5px; color: var(--ink-400); font-variant-numeric: tabular-nums; }
.tree-chip.active em { color: var(--brand-700); }
.chips-note { margin: -6px 0 16px; color: var(--ink-400); font-size: 11.5px; line-height: 1.75; }

.detail-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0; background: var(--surface); border: 1px solid var(--line-200); border-radius: var(--r-md); overflow: hidden; }
.detail-item { min-height: 62px; padding: 11px 14px 12px; background: var(--surface); border-bottom: 1px solid var(--line-100); }
.detail-item:nth-child(odd) { border-right: 1px solid var(--line-100); }
.detail-item.wide { grid-column: 1 / -1; border-right: 0; }
.detail-item:last-child, .detail-item:nth-last-child(2):has(+ .detail-item.wide) { border-bottom: 0; }
.detail-item span { display: block; margin-bottom: 4px; color: var(--ink-400); font-size: 10.5px; letter-spacing: .06em; }
.detail-item strong { color: var(--ink-900); font-size: 13px; font-weight: 600; font-variant-numeric: tabular-nums; }

.drawer-actions { display: flex; flex-wrap: wrap; gap: 10px; margin: 18px 0 26px; }
.section-heading { display: flex; align-items: baseline; gap: 10px; margin: 0 0 12px; }
.section-heading h3 { margin: 0; display: flex; align-items: center; gap: 8px; color: var(--ink-900); font-size: 13.5px; font-weight: 650; letter-spacing: .02em; }
.section-heading h3::before { content: ""; width: 3px; height: 13px; border-radius: 2px; background: var(--brand-600); flex: none; }
.section-heading span { margin-left: auto; color: var(--ink-400); font-size: 11.5px; }
.notice { margin-bottom: 14px; padding: 11px 13px; border: 1px solid var(--brand-200); border-radius: var(--r-md); background: var(--brand-50); color: var(--ink-600); font-size: 12px; line-height: 1.75; }
.notice.warning { border-color: var(--accent-300); background: var(--accent-100); color: var(--accent-700); }

.ops-block { margin: 2px 0 20px; }
.ops-list { display: flex; flex-direction: column; gap: 8px; }
.ops-item { padding: 10px 12px; border: 1px solid var(--line-200); border-left: 3px solid var(--brand-300); border-radius: var(--r-md); background: var(--surface); transition: border-color .14s var(--ease), background .14s var(--ease); }
.ops-item:hover { border-color: var(--brand-300); border-left-color: var(--brand-500); background: var(--surface-2); }
.ops-item.current { border-color: var(--brand-300); border-left-color: var(--brand-600); background: var(--brand-50); }
.ops-item-main { display: flex; align-items: center; gap: 7px; }
.ops-item-main strong { color: var(--ink-900); font-size: 13px; font-weight: 650; }
.ops-count { margin-left: auto; color: var(--ink-500); font-size: 11.5px; font-variant-numeric: tabular-nums; }
.ops-tag { font-style: normal; padding: 2px 7px; border-radius: var(--r-pill); background: var(--brand-700); color: #fff; font-size: 10px; font-weight: 600; letter-spacing: .04em; }
.ops-item-sub { display: flex; flex-wrap: wrap; gap: 3px 14px; margin-top: 6px; color: var(--ink-400); font-size: 11.5px; }
.ops-note { margin: 11px 0 0; padding: 10px 12px; border-radius: var(--r-md); background: var(--surface-2); border: 1px solid var(--line-100); color: var(--ink-500); font-size: 11.5px; line-height: 1.75; }

.photo-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.frame-photo { margin: 0; border: 1px solid var(--line-200); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.frame-photo button { display: block; width: 100%; padding: 0; border: 0; background: #e9efe9; cursor: zoom-in; }
.frame-photo img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s var(--ease); }
.frame-photo button:hover img { transform: scale(1.03); }
.frame-photo figcaption { padding: 6px 8px; font-size: 11px; color: var(--ink-500); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-card { position: relative; border: 1px solid var(--line-200); border-radius: var(--r-md); overflow: hidden; background: var(--surface); box-shadow: var(--shadow-sm); transition: box-shadow .18s var(--ease), border-color .18s var(--ease); }
.photo-card:hover { border-color: var(--brand-300); box-shadow: var(--shadow-md); }
.photo-card > button:not(.photo-remove):not(.lib-pick) { display: block; width: 100%; padding: 0; border: 0; background: #e9efe9; }
.photo-card img { display: block; width: 100%; aspect-ratio: 4 / 3; object-fit: cover; transition: transform .3s var(--ease); }
.photo-card:hover img { transform: scale(1.03); }
.photo-meta { padding: 9px 11px 11px; border-top: 1px solid var(--line-100); }
.photo-meta strong { display: block; color: var(--ink-700); font-size: 11.5px; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.photo-meta span { display: block; margin-top: 4px; color: var(--ink-400); font-size: 10.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-variant-numeric: tabular-nums; }
.photo-empty { padding: 30px 16px; border: 1px dashed var(--brand-300); border-radius: var(--r-md); background: var(--surface-2); text-align: center; color: var(--ink-500); font-size: 12px; line-height: 1.85; }
.photo-remove { position: absolute; right: 7px; top: 7px; z-index: 2; width: 25px; height: 25px; padding: 0 !important; border: 0 !important; border-radius: 50% !important; background: rgba(18, 45, 32, .74) !important; color: #fff; display: grid; place-items: center; }
.photo-remove .icon { width: 13px; height: 13px; }
.photo-remove:hover { background: var(--danger-600) !important; }
.photo-remove:disabled { opacity: .45; cursor: not-allowed; }
@media (hover: hover) {
  .photo-remove { opacity: 0; transition: opacity .15s var(--ease), background .15s var(--ease); }
  .photo-card:hover .photo-remove, .photo-remove:focus-visible { opacity: 1; }
}
.photo-count-total { color: var(--ink-400); font-size: 11px; }

/* —— 按钮 —— */
.btn {
  min-height: 38px;
  padding: 0 15px;
  border: 1px solid var(--line-300);
  border-radius: var(--r-md);
  background: var(--surface);
  color: var(--ink-700);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 7px;
  font-size: 13px;
  font-weight: 600;
  /* 按钮文字禁止换行：窄屏下空间不足时宁可缩 padding，也不能竖排一字一行 */
  white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease), box-shadow .15s var(--ease);
}
.btn:hover:not(:disabled) { background: var(--brand-50); border-color: var(--brand-300); color: var(--brand-900); }
.btn .icon { width: 16px; height: 16px; }
.btn-primary { background: var(--brand-700); border-color: var(--brand-700); color: #fff; box-shadow: 0 1px 2px rgba(16, 53, 36, .24); }
.btn-primary:hover:not(:disabled) { background: var(--brand-800); border-color: var(--brand-800); color: #fff; box-shadow: 0 3px 10px rgba(16, 53, 36, .26); }
.btn-ghost { background: transparent; border-color: transparent; }
.btn-small { min-height: 32px; padding: 0 12px; font-size: 12.5px; }
.btn-tiny { min-height: 26px; padding: 0 10px; border: 1px solid var(--line-300); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-600); font-size: 11.5px; font-weight: 600; }
.btn-tiny:hover { border-color: var(--brand-500); background: var(--brand-50); color: var(--brand-800); }
.btn-danger { border-color: var(--danger-200); background: var(--danger-600); color: #fff; }
.btn-danger:hover { background: var(--danger-700); border-color: var(--danger-700); color: #fff; }

/* —— 弹窗 —— */
dialog {
  width: min(660px, calc(100% - 32px));
  max-height: min(88vh, 860px);
  padding: 0;
  border: 1px solid rgba(255, 255, 255, .6);
  border-radius: var(--r-lg);
  background: var(--surface);
  color: var(--ink-700);
  box-shadow: var(--shadow-panel);
}
dialog::backdrop { background: rgba(14, 34, 24, .4); -webkit-backdrop-filter: blur(2px); backdrop-filter: blur(2px); }
.dialog-header { padding: 20px 24px 16px; border-bottom: 1px solid var(--line-200); display: flex; align-items: flex-start; gap: 15px; }
.dialog-header-text { flex: 1; min-width: 0; }
.dialog-header h2 { margin: 0; color: var(--ink-900); font-size: 18px; font-weight: 650; letter-spacing: .02em; }
.dialog-header p { margin: 7px 0 0; color: var(--ink-500); font-size: 12px; line-height: 1.7; }
.dialog-body { padding: 20px 24px; overflow: auto; }
.dialog-footer { padding: 14px 24px 18px; border-top: 1px solid var(--line-200); display: flex; align-items: center; justify-content: flex-end; gap: 10px; }
.dialog-footer .footer-note { margin-right: auto; color: var(--ink-400); font-size: 11px; line-height: 1.6; }

.upload-target { margin-bottom: 15px; padding: 12px 14px; border-radius: var(--r-md); background: var(--brand-50); border: 1px solid var(--brand-200); color: var(--ink-600); font-size: 12px; line-height: 1.75; overflow-wrap: anywhere; }
.upload-category { margin-bottom: 15px; padding: 12px 14px; border: 1px solid var(--accent-300); border-radius: var(--r-md); background: var(--accent-100); }
.upload-category .picker-label { display: block; margin-bottom: 9px; color: var(--accent-700); font-size: 11px; font-weight: 650; letter-spacing: .06em; }
.upload-category .category-choice { min-height: 30px; margin: 0 6px 6px 0; padding: 0 12px; border: 1px solid var(--accent-300); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-600); font-size: 12.5px; display: inline-flex; align-items: center; gap: 6px; }
.upload-category .category-choice:hover { border-color: var(--accent-600); color: var(--accent-700); }
.upload-category .category-choice.active { border-color: var(--accent-600); background: #fbe6cd; color: #6d4a1c; font-weight: 650; }
.upload-category .category-choice em { font-style: normal; font-size: 10.5px; color: var(--ink-400); font-variant-numeric: tabular-nums; }
.pager { display: flex; align-items: center; justify-content: center; gap: 12px; margin-top: 12px; font-size: 12px; color: var(--ink-500); font-variant-numeric: tabular-nums; }
.pager .btn-tiny:disabled { opacity: .45; pointer-events: none; }
.frame-range-section { margin-bottom: 18px; }
.frame-range-section .section-heading { margin-bottom: 8px; }

/* 框选范围详情：宽度 +1/4，照片一行 5 张（每页 10 张 = 2 行） */
#frameDialog { width: min(825px, calc(100% - 32px)); }
#frameDialog .photo-grid { grid-template-columns: repeat(5, 1fr); gap: 10px; }
#frameDialog .frame-photo { position: relative; }
.frame-photo .frame-sel { position: absolute; top: 6px; left: 6px; z-index: 2; width: 24px; height: 24px; border: 1px solid rgba(255, 255, 255, .85); border-radius: 7px; background: rgba(20, 40, 30, .45); color: #fff; font-size: 14px; line-height: 1; display: flex; align-items: center; justify-content: center; cursor: pointer; padding: 0; }
.frame-photo .frame-sel.on { background: var(--brand-600); border-color: var(--brand-600); }
.frame-photo.selected { border-color: var(--brand-500); box-shadow: 0 0 0 2px var(--brand-200); }

/* 从选中照片创建框选范围的操作面板 */
.frame-select-panel { margin-top: 14px; padding: 12px 14px; border: 1px solid var(--brand-200); border-radius: var(--r-md); background: var(--brand-50); }
.frame-select-panel .panel-row { display: flex; align-items: flex-start; gap: 10px; margin-bottom: 10px; }
.frame-select-panel .panel-row:last-child { margin-bottom: 0; }
.frame-select-panel .panel-label { flex: none; width: 52px; color: var(--ink-500); font-size: 11.5px; font-weight: 650; padding-top: 5px; }
.frame-id-chips { display: flex; flex-wrap: wrap; gap: 6px; max-height: 96px; overflow: auto; }
.frame-id-chips .chip { min-height: 26px; padding: 0 10px; border: 1px solid var(--line-300); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-600); font-size: 12px; cursor: pointer; }
.frame-id-chips .chip.on { border-color: var(--brand-500); background: var(--brand-600); color: #fff; font-weight: 600; }
.frame-select-panel select, .frame-select-panel input[type="text"] { flex: 1; min-height: 30px; padding: 0 10px; border: 1px solid var(--line-300); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-700); font-size: 12.5px; }
.frame-select-panel select:focus, .frame-select-panel input[type="text"]:focus { outline: none; border-color: var(--brand-500); }
.frame-select-panel .panel-actions { justify-content: flex-end; }
.frame-select-panel .chip { min-height: 28px; }
.drop-zone { min-height: 148px; padding: 26px; border: 1.5px dashed var(--brand-300); border-radius: var(--r-lg); background: var(--surface-2); display: grid; place-items: center; text-align: center; transition: background .15s var(--ease), border-color .15s var(--ease); }
.drop-zone.dragover { background: var(--brand-100); border-color: var(--brand-600); border-style: solid; }
.drop-zone .icon { width: 30px; height: 30px; color: var(--brand-500); margin-bottom: 10px; }
.drop-zone strong { display: block; margin-bottom: 6px; color: var(--brand-900); font-size: 13.5px; }
.drop-zone p { margin: 0 0 14px; color: var(--ink-400); font-size: 11.5px; line-height: 1.7; }
.drop-zone-actions { display: flex; gap: 10px; justify-content: center; flex-wrap: wrap; }

/* —— 目标及完成情况展示卡（首页地图底部） —— */
.goals-card { margin-top: 16px; padding: 14px 18px 16px; background: var(--surface); border: 1px solid var(--line-200); border-radius: var(--r-lg); box-shadow: var(--shadow-sm); }
.goals-card .section-heading { margin: 0 0 10px; }
.goals-card .section-heading span { color: var(--ink-400); font-size: 11px; }
.goals-loading { color: var(--ink-400); font-size: 12px; padding: 6px 0; }
.goals-row { display: flex; align-items: flex-start; gap: 12px; padding: 10px 0; }
.goals-row + .goals-row { border-top: 1px solid var(--line-100); }
.goals-town { flex: none; display: inline-flex; align-items: center; gap: 7px; margin-top: 2px; padding: 4px 13px; border-radius: var(--r-pill); background: var(--brand-50); border: 1px solid var(--brand-200); color: var(--brand-800); font-size: 12.5px; font-weight: 650; white-space: nowrap; }
.goal-chips { display: flex; flex-wrap: wrap; gap: 8px; min-width: 0; }
.goal-chip { appearance: none; display: inline-flex; align-items: center; gap: 6px; padding: 3px 11px; border: 1px solid var(--line-200); border-radius: var(--r-pill); background: var(--surface-2); font: inherit; font-size: 11.5px; cursor: pointer; transition: border-color .15s var(--ease), background .15s var(--ease), box-shadow .15s var(--ease); }
.goal-chip:hover { border-color: var(--brand-300); background: var(--brand-50); box-shadow: 0 1px 4px rgba(16, 53, 36, .10); }
.goal-chip:active { transform: translateY(1px); }
.goal-chip .category-dot { width: 8px; height: 8px; }
.goal-chip em { font-style: normal; color: var(--ink-600); }
.goal-chip strong { font-variant-numeric: tabular-nums; color: var(--ink-900); font-weight: 650; }
.goal-chip .goal-done { color: var(--ink-400); font-weight: 600; }
/* 完成 ≥ 目标：整枚 chip 转为品牌绿，一眼区分已完成 */
.goal-chip.done { background: var(--brand-50); border-color: var(--brand-200); }
.goal-chip.done .goal-done { color: var(--brand-700); }
/* 下钻标记：当前小类下已完成的编号，地图标签转品牌绿 */
.tree-label-done span { background: var(--brand-600); color: #fff; box-shadow: 0 0 0 1.5px rgba(255, 255, 255, .92), 0 1px 3px rgba(12, 40, 26, .35); }
.tree-label-done .tree-badge { background: #fff; color: var(--brand-800); }
/* 记录抽屉：编号旁的「已完成」徽章 */
.drawer-done-badge { display: inline-block; margin-left: 9px; padding: 2px 9px; border-radius: var(--r-pill); background: var(--brand-50); border: 1px solid var(--brand-200); color: var(--brand-700); font-size: 11px; font-style: normal; font-weight: 650; vertical-align: 2px; }
/* 弱网拍照队列：右下浮动条，队列空时隐藏 */
.queue-bar { position: fixed; right: 16px; bottom: 16px; z-index: 70; padding: 9px 16px; border-radius: var(--r-pill); background: #b45309; color: #fff; font-size: 12.5px; font-weight: 650; letter-spacing: .03em; box-shadow: 0 6px 18px rgba(120, 53, 15, .3); cursor: pointer; user-select: none; transition: transform .15s var(--ease); }
.queue-bar:hover { transform: translateY(-2px); }
.queue-bar.hidden { display: none; }
@media (max-width: 760px) { .queue-bar { right: 10px; bottom: 74px; font-size: 11.5px; } }
@media (max-width: 640px) {
  .goals-card { padding: 12px 14px 14px; }
  .goals-row { flex-direction: column; gap: 8px; }
  .goals-town { margin-top: 0; }
}
/* 进度趋势折线 */
.goals-trend { margin-top: 12px; border-top: 1px solid var(--line-100); padding-top: 10px; }
.goals-trend:empty { display: none; }
.goals-trend svg { display: block; width: 100%; height: 64px; }
.trend-head { display: flex; align-items: baseline; gap: 12px; margin-bottom: 4px; }
.trend-title { font-size: 12px; font-weight: 650; color: var(--ink-700); }
.trend-range { font-size: 11px; color: var(--ink-400); }
.trend-value { margin-left: auto; font-size: 12px; font-weight: 650; color: var(--brand-700); font-variant-numeric: tabular-nums; }
.trend-note { font-size: 11.5px; color: var(--ink-400); }
.upload-limit { margin: 12px 0 0; color: var(--ink-400); font-size: 11.5px; line-height: 1.75; }
.upload-preview { display: grid; grid-template-columns: repeat(3, 1fr); gap: 11px; margin-top: 16px; }
.preview-card { position: relative; border: 1px solid var(--line-200); border-radius: var(--r-md); overflow: hidden; background: var(--surface); }
.preview-card img { width: 100%; aspect-ratio: 4 / 3; object-fit: cover; display: block; }
.preview-fallback { aspect-ratio: 4 / 3; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 8px; background: var(--surface-2); color: var(--ink-400); text-align: center; }
.preview-fallback .icon { width: 26px; height: 26px; color: var(--brand-500); }
.preview-fallback span { margin: 0; padding: 0 10px; line-height: 1.5; font-size: 11px; }
.preview-card div { padding: 7px 9px; }
.preview-card .preview-fallback { padding: 10px; }
.preview-card strong { display: block; font-size: 10.5px; color: var(--ink-700); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.preview-card span { display: block; margin-top: 4px; color: var(--ink-400); font-size: 10px; font-variant-numeric: tabular-nums; }
.preview-remove { position: absolute; right: 6px; top: 6px; width: 24px; height: 24px; padding: 0; border: 0; border-radius: 50%; background: rgba(18, 45, 32, .74); color: #fff; display: grid; place-items: center; }
.preview-remove .icon { width: 13px; height: 13px; }
.preview-remove:hover { background: var(--danger-600); }
.preview-remove:disabled { opacity: .45; cursor: not-allowed; }

.offline-table { width: 100%; border-collapse: collapse; font-size: 11.5px; }
.offline-table th, .offline-table td { padding: 8px 10px; border-bottom: 1px solid var(--line-100); text-align: left; vertical-align: top; overflow-wrap: anywhere; }
.offline-table thead th { position: sticky; top: 0; background: var(--surface-2); color: var(--ink-500); font-weight: 650; font-size: 10.5px; letter-spacing: .06em; border-bottom: 1px solid var(--line-200); z-index: 1; }
.offline-table tbody td { color: var(--ink-700); font-variant-numeric: tabular-nums; }
.offline-table tbody tr:hover td { background: var(--brand-50); }
.offline-table .offline-issue { color: var(--accent-700); }
.offline-more { margin: 12px 0 0; color: var(--ink-400); font-size: 11.5px; line-height: 1.7; }
#offlineDialog, #selectionDialog { width: min(940px, calc(100% - 32px)); }
#offlineDialog .dialog-body { max-height: min(60vh, 540px); overflow: auto; }
.selection-table td { vertical-align: middle; }
#exportDataDialog { width: min(640px, calc(100% - 32px)); }
#exportDataDialog .dialog-body { max-height: min(56vh, 480px); overflow: auto; }
#exportDataDialog .offline-table .export-subtotal td { background: var(--surface-2); color: var(--ink-900); font-weight: 650; border-bottom: 1px solid var(--line-200); }
#exportDataDialog .offline-table tbody td .category-dot { margin-right: 6px; }
.locate-nearby { padding: 0 14px 10px; }
.locate-nearby .btn.active { background: var(--brand-600); color: #fff; }
.nearby-list { margin-top: 8px; max-height: 240px; overflow: auto; border: 1px solid var(--line-200); border-radius: var(--r-sm); background: var(--surface); }
.nearby-head { padding: 6px 10px; font-size: 10.5px; color: var(--ink-500); background: var(--surface-2); border-bottom: 1px solid var(--line-100); }
.nearby-item { display: flex; align-items: center; gap: 8px; width: 100%; padding: 7px 10px; border: 0; border-bottom: 1px solid var(--line-100); background: var(--surface); cursor: pointer; text-align: left; font-size: 12px; color: var(--ink-700); }
.nearby-item:last-child { border-bottom: 0; }
.nearby-item:hover { background: var(--brand-50); }
.nearby-id { font-weight: 650; color: var(--ink-900); min-width: 90px; }
.nearby-cat { flex: 1; display: inline-flex; align-items: center; gap: 5px; color: var(--ink-500); font-size: 11px; }
.nearby-cat i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.nearby-item em { font-style: normal; color: var(--brand-700); font-variant-numeric: tabular-nums; }
.nearby-empty { padding: 14px 10px; font-size: 11.5px; color: var(--ink-400); }
.compare-dialog { width: min(1080px, calc(100% - 24px)); max-height: 94vh; }
.compare-dialog[open] { display: flex; flex-direction: column; }
.compare-dialog .dialog-body { flex: 1; min-height: 0; }
.compare-group { margin-bottom: 18px; }
.compare-group:last-child { margin-bottom: 0; }
.compare-group-title { display: flex; align-items: center; gap: 8px; font-weight: 650; color: var(--ink-900); font-size: 13px; padding: 6px 0; border-bottom: 1px solid var(--line-200); }
.compare-group-title .category-dot { width: 10px; height: 10px; }
.compare-group-title em { font-style: normal; font-weight: 400; color: var(--ink-400); font-size: 11px; }
.compare-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(200px, 1fr)); gap: 12px; padding-top: 12px; }
.compare-card { margin: 0; cursor: pointer; border: 1px solid var(--line-200); border-radius: var(--r-sm); overflow: hidden; background: var(--surface); }
.compare-card:hover { border-color: var(--brand-600); }
.compare-card img { width: 100%; height: 150px; object-fit: cover; display: block; }
.compare-card figcaption { padding: 6px 8px; font-size: 11px; line-height: 1.5; color: var(--ink-500); overflow-wrap: anywhere; }
.compare-card figcaption strong { display: block; color: var(--ink-900); font-size: 11.5px; }
/* —— 只读访客模式：隐藏全部写入口（服务端写接口同时兜底 403） —— */
body.readonly #selectButton,
body.readonly #pickButton,
body.readonly #clearSelectionButton,
body.readonly #frameFromSelectionButton,
body.readonly #batchUploadButton,
body.readonly #recordCameraButton,
body.readonly #recordUploadButton,
body.readonly #drawerFixCoordButton,
body.readonly [data-fix-key],
body.readonly #frameCameraButton,
body.readonly #frameUploadButton,
body.readonly #frameDeleteButton,
body.readonly #annoDrawButton,
body.readonly #libraryDeleteButton,
body.readonly #librarySaveLocationButton,
body.readonly #libraryClearLocationButton { display: none !important; }
.selection-table tbody tr:not([rowspan]) { border-top: 0; }
.selection-table .sel-id strong { display: block; color: var(--ink-900); font-size: 12.5px; font-weight: 650; }
.selection-table .sel-id span { color: var(--ink-400); font-size: 10.5px; }
.sel-num { font-variant-numeric: tabular-nums; }

.confirm-body { padding: 4px 0 2px; color: var(--ink-700); font-size: 13px; line-height: 1.9; }
.confirm-body strong { color: var(--ink-900); }
.confirm-body .permanent { margin-top: 12px; padding: 11px 13px; border: 1px solid var(--accent-300); border-radius: var(--r-md); background: var(--accent-100); color: var(--accent-700); font-size: 12px; line-height: 1.8; }

/* overflow-y:auto 保证小屏手机上工具栏+表单超出视口时可滚动，保存按钮不被裁切 */
.lightbox { width: fit-content; max-width: min(1080px, calc(100% - 40px)); max-height: 92vh; overflow-y: auto; background: rgba(11, 24, 17, .95); border: 0; border-radius: var(--r-lg); color: #fff; position: relative; }
.lightbox-close { position: absolute; z-index: 1; top: 12px; right: 12px; width: 34px; height: 34px; display: grid; place-items: center; border: 0; border-radius: 50%; background: rgba(255, 255, 255, .16); color: #fff; cursor: pointer; transition: background .15s var(--ease); }
.lightbox-close:hover { background: rgba(255, 255, 255, .32); }
.lightbox-close .icon { width: 18px; height: 18px; }
.lightbox-body { min-height: 300px; display: grid; place-items: center; padding: 18px; }
.lightbox-body img { max-width: 100%; max-height: 74vh; object-fit: contain; border-radius: 6px; }
.lightbox-caption { padding: 0 22px 20px; color: #b9cbc0; text-align: center; font-size: 11.5px; letter-spacing: .02em; }
/* 照片框选记录 */
.lightbox-toolbar { display: flex; align-items: center; gap: 8px; padding: 14px 18px 0; }
.lightbox-toolbar-note { color: #b9cbc0; font-size: 11.5px; }
.lightbox-toolbar .btn-small.active { background: #6eb1ff; border-color: #6eb1ff; color: #0b1811; }
.lightbox-stage { position: relative; display: inline-block; line-height: 0; }
.anno-overlay { position: absolute; inset: 0; pointer-events: none; }
/* touch-action:none 防止触屏拖动被浏览器判为页面滚动而触发 pointercancel，中断手机端拖框 */
.anno-overlay.drawing { pointer-events: auto; cursor: crosshair; touch-action: none; }
.anno-box { position: absolute; border: 2px solid #6eb1ff; background: rgba(110, 177, 255, .14); border-radius: 3px; cursor: pointer; pointer-events: auto; padding: 0; line-height: 1.2; }
.anno-box span { position: absolute; left: 0; top: -20px; max-width: 180px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; background: rgba(110, 177, 255, .92); color: #0b1811; font-size: 10.5px; line-height: 16px; padding: 1px 6px; border-radius: 3px; }
.anno-box.active { border-color: #ffb64d; background: rgba(255, 182, 77, .22); box-shadow: 0 0 0 2px rgba(255, 182, 77, .35); }
.anno-box.active span { background: #ffb64d; }
.anno-box.pending { border-style: dashed; pointer-events: none; background: rgba(110, 177, 255, .22); }
.anno-form { display: flex; flex-wrap: wrap; gap: 8px; padding: 0 18px 16px; }
.anno-form input { flex: 1 1 160px; background: rgba(255, 255, 255, .08); border: 1px solid rgba(255, 255, 255, .22); border-radius: 6px; color: #fff; padding: 7px 10px; font-size: 12.5px; }
.anno-form input::placeholder { color: #8fa89a; }
.anno-form-actions { display: flex; gap: 8px; }
.anno-info { margin: 0 18px 16px; background: rgba(255, 255, 255, .07); border: 1px solid rgba(255, 255, 255, .16); border-radius: 8px; padding: 12px 14px; font-size: 12px; text-align: left; }
.anno-info-head strong { font-size: 13.5px; }
.anno-info-head p { margin: 4px 0 0; color: #d7e5dc; }
.anno-info ul { margin: 8px 0 0; padding: 0; list-style: none; display: grid; gap: 4px; color: #b9cbc0; }
.anno-info-actions { margin-top: 10px; display: flex; justify-content: flex-end; }
.uploader-field { display: block; margin: 10px 0 0; font-size: 12px; color: #5f7a6b; }
.uploader-field input { display: block; margin-top: 5px; width: 100%; box-sizing: border-box; }

/* —— 反馈 —— */
.toast {
  position: fixed;
  z-index: 3000;
  left: 50%;
  bottom: 152px;
  transform: translate(-50%, 10px);
  max-width: min(600px, calc(100% - 30px));
  padding: 12px 18px;
  border-radius: var(--r-md);
  background: rgba(17, 38, 27, .95);
  -webkit-backdrop-filter: blur(6px);
  backdrop-filter: blur(6px);
  color: #fff;
  box-shadow: var(--shadow-panel);
  font-size: 12.5px;
  line-height: 1.65;
  opacity: 0;
  pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.error { background: rgba(140, 48, 34, .96); }
.import-progress {
  position: fixed;
  z-index: 2000;
  left: 0;
  right: 0;
  top: 0;
  padding: 11px 24px 12px;
  background: var(--brand-900);
  color: #fff;
  box-shadow: 0 6px 22px rgba(12, 42, 25, .28);
}
.import-progress-row { display: flex; justify-content: space-between; gap: 15px; font-size: 12px; letter-spacing: .02em; }
.progress-track { height: 3px; margin-top: 9px; background: rgba(255, 255, 255, .18); border-radius: var(--r-pill); overflow: hidden; }
.progress-track span { display: block; width: 0; height: 100%; background: linear-gradient(90deg, var(--brand-300), #bfe3cd); border-radius: var(--r-pill); transition: width .25s var(--ease); }

/* —— 桌面端布局：地图固定 800px 高度，页面按内容自然排列 —— */
@media (min-width: 1051px) {
  body { display: flex; flex-direction: column; height: auto; overflow-x: hidden; }
  .workspace { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .overview { flex: none; }
  .panel { flex: 1; min-height: 0; display: flex; flex-direction: column; }
  .toolbar, .category-tabs { flex: none; }
  .view-content { flex: 1; min-height: 0; }
  .map-stage { position: relative; height: 600px; min-height: 600px; }
}

@media (max-width: 1280px) {
  .toolbar-note { display: none; }
}
@media (max-width: 1050px) {
  .workspace { padding: 14px 16px 18px; }
  .overview { grid-template-columns: repeat(auto-fit, minmax(150px, 1fr)); gap: 0; }
  .stat { padding: 13px 16px; }
  .stat:nth-child(n+2) { border-left: 1px solid var(--line-100); }
  .stat-value { font-size: 23px; }
  .map-stage { height: 62vh; height: 62dvh; min-height: 470px; }
  .map-info { width: 236px; }
  .map-tools { max-width: calc(100% - 276px); }
  .toast { bottom: 132px; }
  .toolbar { flex-wrap: wrap; }
  .search-box { order: 3; flex-basis: 100%; max-width: none; }
}
@media (max-width: 760px) {
  body { overflow-x: hidden; }
  .app-header { height: auto; min-height: 62px; padding: 12px 14px; align-items: center; gap: 12px; }
  .brand-mark { width: 32px; height: 32px; border-radius: 9px; }
  .brand-mark .icon { width: 19px; height: 19px; }
  .brand h1 { font-size: 15px; }
  .brand p { display: none; }
  .source-state { font-size: 10.5px; padding: 4px 9px 4px 8px; }
  .workspace { padding: 12px 11px 16px; }
  .overview { margin-bottom: 11px; border-radius: var(--r-md); }
  .stat { padding: 11px 13px; }
  .stat-value { font-size: 20px; }
  .stat-label { font-size: 10.5px; }
  .toolbar { padding: 10px 11px; gap: 9px; }
  .toolbar-divider { display: none; }
  .primary-tabs { flex: 1; }
  .primary-tab { flex: 1; justify-content: center; padding: 6px 10px; }
  .view-modes { order: 4; flex-basis: 100%; margin-left: 0; overflow-x: auto; }
  .view-modes .map-tool { flex: 1; justify-content: center; white-space: nowrap; }
  .search-box input { font-size: 16px; }
  .map-tools { -webkit-overflow-scrolling: touch; }
  /* 移动端小类全部显示：不再横向滑动，换行铺开 */
  .category-tabs { padding: 9px 11px; flex-wrap: wrap; overflow-x: visible; }
  /* 移动端地图高度 1.5 倍（58vh → 87vh） */
  .map-stage { height: 87vh; height: 87dvh; min-height: 645px; }
  .map-info { top: 10px; left: 10px; width: 190px; padding: 11px 12px; }
  .map-info-toggle { width: 30px; height: 30px; }
  .map-info h2 { font-size: 13px; }
  .map-info p { font-size: 10.5px; }
  .map-tools { top: 10px; right: 10px; gap: 6px; max-width: calc(100% - 224px); }
  .map-tool { min-height: 28px; padding: 0 9px; font-size: 11px; }
  .map-tools > .map-tool { min-height: 33px; padding: 0 11px; }
  .map-dock { left: 10px; right: 140px; bottom: 32px; max-width: calc(100% - 150px); }
  .toast { bottom: 120px; }
  .map-hint { font-size: 10.5px; padding: 6px 10px; }
  .map-legend { font-size: 10.5px; padding: 7px 10px; gap: 4px 9px; }
  .legend-foot { display: none; }
  .selection-tray { flex-wrap: wrap; bottom: 12px; gap: 8px; padding: 10px 12px; }
  .selection-summary { display: none; }
  .selection-count { min-width: 0; flex: 1; }
  .photo-grid, .upload-preview { grid-template-columns: 1fr 1fr; }
  .drawer-header { padding: 18px 18px 15px; }
  .drawer-header h2 { font-size: 22px; }
  .drawer-body { padding: 16px 18px 28px; }
  .detail-grid { grid-template-columns: 1fr; }
  .detail-item:nth-child(odd) { border-right: 0; }
  .dialog-header, .dialog-body { padding-left: 16px; padding-right: 16px; }
  .dialog-footer { padding-left: 16px; padding-right: 16px; flex-wrap: wrap; }
  .dialog-footer .footer-note { flex-basis: 100%; }
}
/* 横屏矮视口（手机横屏约 320-380px 高）：地图 min-height 430px 会超过整屏，压缩为约 2/3 屏 */
@media (max-width: 760px) and (max-height: 500px) {
  .map-stage { height: 70dvh; min-height: 250px; }
  .map-info { max-height: 96px; }
  .map-legend { max-height: 72px; }
}
@media (max-width: 480px) {
  .overview { grid-template-columns: repeat(3, 1fr); }
  .stat { padding: 10px 12px; }
  .stat:nth-child(3n+1) { border-left: 0; }
  .stat:nth-child(n+4) { border-top: 1px solid var(--line-100); }
  .stat-value { font-size: 19px; }
  .stat-label { font-size: 10px; }
  .map-tools { top: 10px; bottom: auto; left: 10px; right: 10px; max-width: none; justify-content: flex-start; flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; }
  .map-tools .tool-group, .map-tools > .map-tool { flex: none; }
  .map-info { top: 58px; left: 10px; right: 10px; width: auto; max-height: 140px; overflow-y: auto; padding: 10px 12px; }
  .map-legend { max-height: 88px; overflow-y: auto; }
  .map-info h2 { font-size: 12.5px; margin-bottom: 6px; }
  .map-info p { font-size: 10px; line-height: 1.6; }
  .summary-note { margin-top: 7px; padding-top: 6px; font-size: 9.5px; line-height: 1.55; }
  .map-dock { left: 10px; right: 132px; bottom: 122px; max-width: calc(100% - 142px); }
  .leaflet-bottom.leaflet-right { bottom: 124px; }
  .toast { left: 12px; right: 12px; bottom: 10px; width: auto; max-width: none; transform: none; }
  .toast.show { transform: none; }
  .map-status { padding: 18px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* —— 养护照片库 —— */
.library-dialog { width: min(1180px, calc(100% - 24px)); max-height: 94vh; }
.library-dialog[open] { display: flex; flex-direction: column; }
.library-dialog .dialog-body { flex: 1; min-height: 0; }
.library-filters { display: flex; flex-wrap: wrap; align-items: center; gap: 10px 14px; padding: 12px 24px; border-bottom: 1px solid var(--line-200); background: var(--surface-2); }
.library-filters label { display: inline-flex; align-items: center; gap: 6px; color: var(--ink-600); font-size: 12px; }
.library-filters select, .library-filters input[type="date"] { padding: 5px 8px; border: 1px solid var(--line-200); border-radius: var(--r-sm); background: var(--surface); color: var(--ink-700); font-size: 12px; }
.library-filters input[type="search"] { flex: 1; min-width: 150px; padding: 6px 10px; border: 1px solid var(--line-200); border-radius: var(--r-pill); background: var(--surface); color: var(--ink-700); font-size: 12px; }
.library-dates { gap: 4px; }
.library-select-note { margin-left: auto; color: var(--ink-500); font-size: 12px; white-space: nowrap; }
.library-body .photo-grid { grid-template-columns: repeat(auto-fill, minmax(190px, 1fr)); }
.lib-card { cursor: pointer; }
.lib-card.picked { border-color: var(--brand-600); box-shadow: 0 0 0 2px var(--brand-200); }
.lib-pick { position: absolute; z-index: 2; top: 8px; left: 8px; width: 22px; height: 22px; padding: 0; border: 1.5px solid rgba(255, 255, 255, .9); border-radius: 6px; background: rgba(18, 33, 26, .35); cursor: pointer; display: grid; place-items: center; }
.lib-card.picked .lib-pick { background: var(--brand-600); border-color: var(--brand-600); }
.lib-card.picked .lib-pick::after { content: '✓'; color: #fff; font-size: 13px; line-height: 1; }
.lib-view { display: block; width: 100%; padding: 0; border: 0; background: #e9efe9; cursor: zoom-in; }
.lib-location { display: block; margin-top: 3px; color: var(--brand-700); font-size: 11px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lib-location.empty { color: var(--ink-400); font-style: italic; }
.library-dialog .dialog-footer { flex-wrap: wrap; }
.library-location { display: inline-flex; align-items: center; gap: 8px; margin-right: auto; color: var(--ink-600); font-size: 12px; }
.library-location input { width: min(320px, 46vw); padding: 7px 10px; border: 1px solid var(--line-200); border-radius: var(--r-sm); font-size: 12.5px; color: var(--ink-700); }
@media (max-width: 720px) {
  .library-filters { padding: 10px 14px; }
  .library-select-note { margin-left: 0; width: 100%; }
  .library-body .photo-grid { grid-template-columns: repeat(2, 1fr); }
  .library-location { width: 100%; }
  .library-location input { flex: 1; width: auto; }
}

/* —— 当前位置导航 —— */
.locate-panel {
  position: absolute; z-index: 780; left: 12px; right: 12px; bottom: 86px;
  max-width: 430px; margin: 0 auto; display: flex; flex-direction: column; gap: 8px;
  padding: 10px 12px; border: 1px solid var(--line-200); border-radius: 14px;
  background: rgba(255, 255, 255, .97); box-shadow: 0 6px 24px rgba(12, 40, 26, .18);
  color: var(--ink-700); font-size: 12px;
}
.locate-head { display: flex; align-items: center; gap: 8px; }
.locate-title { display: inline-flex; align-items: center; gap: 5px; font-weight: 700; font-size: 12.5px; color: var(--brand-700); white-space: nowrap; }
.locate-title .icon { width: 15px; height: 15px; }
#locateStatus { flex: 1; min-width: 0; color: var(--ink-500); font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.locate-close { border: 0; background: none; font-size: 19px; line-height: 1; color: var(--ink-400); cursor: pointer; padding: 2px 7px; }
.locate-row { display: flex; gap: 8px; align-items: center; }
.locate-row input { flex: 1; min-width: 0; padding: 7px 10px; border: 1px solid var(--line-200); border-radius: 8px; font-size: 13px; color: var(--ink-700); background: var(--surface); }
.locate-guide { padding: 7px 9px; border-radius: 9px; background: #fff4ea; color: #8a4b16; font-size: 12px; display: flex; align-items: center; gap: 6px; line-height: 1.5; }
.guide-arrow { display: inline-block; font-size: 16px; font-weight: 700; color: #e2701f; transition: transform .35s ease; flex: none; }
.locate-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.locate-follow { display: inline-flex; align-items: center; gap: 5px; font-size: 12px; color: var(--ink-600); margin-right: auto; }
.locate-stop { color: #b3362c; border-color: #e5b6b1; }
.locate-marker { background: none; border: none; }
.locate-arrow { width: 30px; height: 30px; display: block; transform-origin: 50% 50%; transition: transform .35s ease; filter: drop-shadow(0 1px 3px rgba(10, 30, 60, .55)); }
.locate-accuracy { stroke: #3d7bfd; fill: #3d7bfd; }
.locate-target { background: none; border: none; }
.locate-target-ring { position: absolute; inset: 0; border: 3px solid #ff8a3d; border-radius: 50%; animation: locatePulse 1.6s ease-out infinite; }
.locate-target-dot { position: absolute; left: 50%; top: 50%; width: 11px; height: 11px; margin: -5.5px 0 0 -5.5px; border-radius: 50%; background: #ff6a00; border: 2px solid #fff; box-shadow: 0 0 6px rgba(0, 0, 0, .45); }
@keyframes locatePulse { 0% { transform: scale(.4); opacity: 1; } 100% { transform: scale(1.15); opacity: 0; } }
@media (max-width: 760px) and (max-height: 500px) {
  .locate-panel { bottom: 10px; }
}

/* —— 移动端模拟测试修复（2026-12-01）—— */
/* 1) 状态胶囊在手机上是噪音且挤压头部按钮，≤760 隐藏 */
@media (max-width: 760px) {
  .source-state { display: none; }
  /* iOS Safari 聚焦字号 <16px 的输入框会自动放大页面：触屏断点下统一抬到 16px
     （日期输入走原生滚轮选择器，不受此影响，排除） */
  input[type="text"], input[type="search"], input:not([type]), select { font-size: 16px; }
}
/* 2) frameDialog 的 5 列照片网格是 ID 级规则，优先级高于通用 ≤760 的 2 列规则，
   手机上每张照片仅 ~60px：按屏宽降级为 3 列 / 2 列 */
@media (max-width: 760px) {
  #frameDialog .photo-grid { grid-template-columns: repeat(3, 1fr); }
}
@media (max-width: 480px) {
  #frameDialog .photo-grid { grid-template-columns: repeat(2, 1fr); }
}
/* 3) 极小屏（≤420）头部按钮退化为图标-only，标题不再被挤到竖排 */
@media (max-width: 420px) {
  .app-header { gap: 8px; }
  .header-actions .btn-label { display: none; }
  .header-actions .btn-small { padding: 0 9px; min-height: 34px; }
}
/* 4) 手机横屏（矮视口）：统计卡 5 列单行 + 紧凑化，地图不再被挤到折叠线以下 */
@media (max-width: 760px) and (max-height: 500px) {
  .overview { grid-template-columns: repeat(5, 1fr); }
  .stat { padding: 8px 10px; }
  .stat-value { font-size: 17px; }
  .stat-label { font-size: 9.5px; }
  .app-header { min-height: 0; padding: 8px 12px; }
  .workspace { padding: 8px 10px 10px; }
}

/* —— 骨架屏加载态：body.booting 期间显示灰块 shimmer，数据到位后移除 —— */
.sk {
  position: relative;
  overflow: hidden;
  background: #e4ece7;
  border-radius: 6px;
}
.sk::after {
  content: "";
  position: absolute;
  inset: 0;
  transform: translateX(-100%);
  background: linear-gradient(90deg, transparent, rgba(255, 255, 255, .55), transparent);
  animation: sk-shimmer 1.4s infinite;
}
@keyframes sk-shimmer { to { transform: translateX(100%); } }
.stats-skeleton { display: none; gap: 10px; }
.stats-skeleton .sk-block { height: 58px; flex: 1; }
body.booting #statsSkeleton { display: flex; }
body.booting .overview .stat { visibility: hidden; }
body:not(.booting) .overview .stat { animation: sk-fadein .35s ease both; }
@keyframes sk-fadein { from { opacity: 0; } to { opacity: 1; } }
.goals-skeleton { display: grid; gap: 12px; padding: 4px 0; }
.goals-skeleton .sk-row { display: flex; gap: 10px; align-items: center; }
.goals-skeleton .sk-chip { width: 64px; height: 22px; }
.goals-skeleton .sk-line { height: 14px; }
.goals-skeleton .sk-line.grow { flex: 1; }

/* —— 目标卡迷你进度条 + 镇区完成率徽标 —— */
.goal-chip { position: relative; padding-bottom: 6px; overflow: hidden; }
.goal-bar {
  position: absolute;
  left: 11px; right: 11px; bottom: 3px;
  height: 3px;
  border-radius: 2px;
  background: var(--line-200);
  overflow: hidden;
}
.goal-bar-fill {
  display: block;
  height: 100%;
  border-radius: 2px;
  background: var(--brand-500);
  transition: width .5s var(--ease);
}
.goal-bar-fill.full { background: var(--brand-700); }
.goal-chip.done .goal-bar { background: var(--brand-100); }
.goals-rate {
  font-style: normal;
  font-size: 10.5px;
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  padding: 1px 6px;
  border-radius: var(--r-pill);
  background: var(--brand-600);
  color: #fff;
  letter-spacing: .02em;
}

/* —— 投屏展示：全屏汇总页 —— */
body.presenting { overflow: hidden; }
.present-overlay {
  position: fixed;
  inset: 0;
  /* Leaflet pane z-index 400 / control 800：必须盖过地图，否则地图透出 */
  z-index: 2000;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, #f4f9f6 0%, #e9f2ec 100%);
  color: var(--ink-900);
  animation: present-in .3s ease;
}
@keyframes present-in { from { opacity: 0; } to { opacity: 1; } }
.present-head {
  flex: none;
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 26px;
  background: rgba(255, 255, 255, .82);
  border-bottom: 1px solid var(--line-200);
  backdrop-filter: blur(6px);
}
.present-title { display: flex; align-items: center; gap: 10px; }
.present-title .icon { width: 22px; height: 22px; color: var(--brand-600); }
.present-title h2 { font-size: 17px; letter-spacing: .04em; color: var(--brand-800); }
.present-title span { color: var(--ink-400); font-size: 12px; }
.present-actions { display: flex; gap: 8px; }
.present-body { flex: 1; overflow-y: auto; padding: 22px 30px 40px; }
.present-empty { color: var(--ink-400); padding: 30px; text-align: center; }
.present-summary {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 16px;
  margin-bottom: 26px;
}
.present-big {
  background: #fff;
  border: 1px solid var(--line-200);
  border-radius: var(--r-lg);
  padding: 18px 22px;
  text-align: center;
  box-shadow: 0 2px 10px rgba(16, 53, 36, .06);
}
.present-big strong {
  display: block;
  font-size: 40px;
  font-weight: 750;
  font-variant-numeric: tabular-nums;
  color: var(--brand-700);
  line-height: 1.15;
  letter-spacing: -.01em;
}
.present-big span { color: var(--ink-400); font-size: 12.5px; letter-spacing: .06em; }
.present-town { margin-bottom: 30px; }
.present-town-head { display: flex; align-items: baseline; gap: 14px; margin-bottom: 12px; }
.present-town-head h3 { font-size: 19px; color: var(--brand-800); letter-spacing: .05em; }
.present-town-rate { color: var(--ink-500); font-size: 13px; }
.present-town-rate strong { color: var(--brand-700); font-size: 24px; font-weight: 750; margin-right: 6px; font-variant-numeric: tabular-nums; }
.present-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(210px, 1fr));
  gap: 14px;
}
.present-card {
  background: #fff;
  border: 1px solid var(--line-200);
  border-radius: var(--r-lg);
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(16, 53, 36, .05);
}
.present-card.complete { border-color: var(--brand-300); }
.present-card-head {
  display: flex;
  align-items: center;
  gap: 7px;
  padding: 10px 13px 4px;
  font-size: 13px;
}
.present-card-head .category-dot { width: 9px; height: 9px; }
.present-card-head strong { flex: 1; color: var(--ink-900); letter-spacing: .02em; }
.present-rate { font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ink-500); font-size: 12.5px; }
.present-card.complete .present-rate { color: var(--brand-700); }
.present-card-nums { padding: 0 13px; display: flex; align-items: baseline; gap: 5px; }
.present-card-nums strong { font-size: 26px; font-weight: 750; font-variant-numeric: tabular-nums; color: var(--ink-900); }
.present-card-nums span { color: var(--ink-400); font-size: 12px; }
.present-card-bar {
  margin: 8px 13px 10px;
  height: 5px;
  border-radius: 3px;
  background: var(--line-200);
  overflow: hidden;
}
.present-card-bar span {
  display: block;
  height: 100%;
  border-radius: 3px;
  background: var(--brand-500);
  transition: width .5s var(--ease);
}
.present-card.complete .present-card-bar span { background: var(--brand-700); }
.present-card-photo {
  display: block;
  width: 100%;
  height: 130px;
  object-fit: cover;
  border-top: 1px solid var(--line-200);
}
.present-photo-empty {
  display: grid;
  place-items: center;
  color: var(--ink-400);
  font-size: 11.5px;
  background: var(--surface-2);
}
.present-trend {
  background: #fff;
  border: 1px solid var(--line-200);
  border-radius: var(--r-lg);
  padding: 16px 20px;
  box-shadow: 0 2px 10px rgba(16, 53, 36, .05);
}
.present-trend h3 { font-size: 14px; color: var(--brand-800); margin-bottom: 10px; letter-spacing: .04em; }
.present-trend svg { width: 100%; height: 130px; color: var(--ink-900); }
/* 打印：只输出投屏页内容 */
@media print {
  body.presenting > *:not(#presentOverlay) { display: none !important; }
  body.presenting { overflow: visible; }
  .present-overlay { position: static; background: #fff; animation: none; }
  .present-body { overflow: visible; }
  .present-actions { display: none !important; }
  .present-card, .present-big, .present-trend { box-shadow: none; break-inside: avoid; }
}

/* —— 野外模式：强光环境字号加大、对比拉高（localStorage 记忆）—— */
body.outdoor { background: #fff; }
body.outdoor .app-header { background: #fff; border-bottom-color: #cfe0d5; }
body.outdoor .workspace { background: #fff; }
body.outdoor .btn { font-size: 14px; padding: 8px 15px; }
body.outdoor .btn .icon { width: 17px; height: 17px; }
body.outdoor .btn-small { font-size: 13.5px; }
body.outdoor .stat-value { font-size: 30px; color: #08180f; }
body.outdoor .stat-label { font-size: 12px; color: #2c3d33; font-weight: 600; }
body.outdoor .goal-chip { font-size: 13px; padding: 5px 13px 10px; }
body.outdoor .goal-chip em { color: #17251c; font-weight: 600; }
body.outdoor .goals-town { font-size: 14px; }
body.outdoor .goals-rate { font-size: 12px; padding: 2px 8px; }
body.outdoor .primary-tabs button, body.outdoor .category-tabs button {
  font-size: 14px;
  font-weight: 700;
  padding: 8px 16px;
}
body.outdoor .map-tool { font-size: 13px; font-weight: 700; padding: 7px 13px; }
body.outdoor .search-box input { font-size: 15px; }
body.outdoor .tree-label { font-size: 14px; font-weight: 750; color: #06130c; }
body.outdoor .tree-label span {
  padding: 2px 9px;
  border-radius: 11px;
  background: rgba(255, 255, 255, .96);
  box-shadow: 0 0 0 2px rgba(255, 255, 255, .95), 0 1px 4px rgba(12, 40, 26, .45);
}
body.outdoor .tree-label-done span { background: var(--brand-600); color: #fff; }
body.outdoor .map-info, body.outdoor .selection-tray { font-size: 13.5px; }
body.outdoor .map-info p { color: #17251c; }
body.outdoor .drawer-title, body.outdoor #drawerTitle { font-size: 20px; color: #08180f; }
body.outdoor .drawer-body { font-size: 14px; }
body.outdoor .detail-item span { color: #37453c; }
body.outdoor .detail-item strong { color: #08180f; font-size: 14.5px; }
body.outdoor #outdoorButton { background: var(--brand-600); color: #fff; border-color: var(--brand-600); }

/* —— 照片库分组相册视图 —— */
.library-group-title {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 18px 2px 10px;
  font-size: 14px;
  font-weight: 700;
  color: var(--brand-800);
  letter-spacing: .03em;
}
.library-group-title:first-child { margin-top: 2px; }
.library-group-title .category-dot { width: 10px; height: 10px; }
.library-group-title em {
  font-style: normal;
  font-weight: 600;
  font-size: 11px;
  color: var(--ink-400);
  padding: 1px 8px;
  border-radius: var(--r-pill);
  background: var(--surface-2);
  border: 1px solid var(--line-200);
}
.library-body #libraryGrid { display: block; }
.library-body #libraryGrid .photo-grid { margin-bottom: 6px; }

/* —— 弹窗进入动画（统一质感；dialog 原生关闭为即时退出）—— */
dialog[open] { animation: dialog-in .22s cubic-bezier(.2, .8, .3, 1); }
dialog[open]::backdrop { animation: backdrop-in .22s ease; }
@keyframes dialog-in {
  from { opacity: 0; transform: translateY(10px) scale(.985); }
  to { opacity: 1; transform: translateY(0) scale(1); }
}
@keyframes backdrop-in { from { background: rgba(14, 34, 24, 0); } to { background: rgba(14, 34, 24, .4); } }
@media (prefers-reduced-motion: reduce) {
  dialog[open], dialog[open]::backdrop { animation: none; }
}

/* —— 新手引导：三步指引浮层 —— */
.onboard-overlay {
  position: fixed;
  inset: 0;
  z-index: 1500;
  display: grid;
  place-items: center;
  background: rgba(14, 34, 24, .38);
  animation: backdrop-in .2s ease;
}
.onboard-overlay.hidden { display: none; }
.onboard-card {
  position: relative;
  width: min(420px, calc(100% - 40px));
  background: #fff;
  border-radius: var(--r-lg);
  padding: 26px 26px 20px;
  box-shadow: 0 18px 50px rgba(12, 40, 26, .25);
  animation: dialog-in .25s cubic-bezier(.2, .8, .3, 1);
}
.onboard-skip { position: absolute; top: 12px; right: 12px; }
.onboard-step { min-height: 150px; }
.onboard-icon {
  width: 46px; height: 46px;
  display: grid;
  place-items: center;
  border-radius: 14px;
  background: var(--brand-50);
  border: 1px solid var(--brand-200);
  color: var(--brand-700);
  margin-bottom: 12px;
}
.onboard-icon .icon { width: 24px; height: 24px; }
.onboard-step h3 { font-size: 16px; color: var(--brand-800); margin-bottom: 8px; letter-spacing: .03em; }
.onboard-step p { color: var(--ink-600); font-size: 13px; line-height: 1.9; }
.onboard-foot { display: flex; align-items: center; justify-content: space-between; margin-top: 16px; }
.onboard-dots { display: flex; gap: 6px; }
.onboard-dots i {
  width: 7px; height: 7px;
  border-radius: 50%;
  background: var(--line-200);
  transition: background .2s var(--ease), transform .2s var(--ease);
}
.onboard-dots i.on { background: var(--brand-600); transform: scale(1.25); }
.onboard-actions { display: flex; gap: 8px; }

/* —— 固定 500m 比例尺：线宽由 JS 按纬度/缩放实时换算 —— */
.fixed-scale-line {
  min-width: 8px;
  text-align: center;
  white-space: nowrap;
  transition: width .12s ease-out;
}

/* —— 移动端已选选卡最小化（PC 端按钮隐藏，不做修改）—— */
#trayMinButton { display: none; }
@media (max-width: 760px) {
  #trayMinButton { display: inline-flex; width: 30px; height: 30px; flex: none; }
  .selection-tray.min { padding: 7px 12px; }
  .selection-tray.min > button:not(#trayMinButton) { display: none; }
  .selection-tray.min #selectionSummary { display: none; }
  .selection-tray.min #selectionCount { flex: 1; font-size: 12.5px; }
  .selection-tray.min #trayMinButton .icon { transform: rotate(180deg); }
}
