@font-face {
  font-family: 'Ethnocentric';
  src: url('./fonts/Ethnocentric-Regular.woff') format('woff');
  font-weight: normal;
  font-style: normal;
}

.hidden {
  display: none !important;
}

* {
  margin: 0;
  padding: 0;
  box-sizing: border-box;
}

body, html {
  height: 100%;
  font-family: 'Inter', sans-serif;
  overflow: hidden;
}

#map {
  position: absolute;
  top: 0;
  left: 60px;
  right: 0;
  bottom: 0;
  z-index: 0;
}

/* 左侧图标栏 */
#sidebar {
  position: absolute;
  top: 0;
  bottom: 0;
  left: 0;
  width: 60px;
  background: white;
  border-right: 1px solid #ddd;
  display: flex;
  flex-direction: column;
  justify-content: space-between;
  align-items: center;
  padding: 12px 0;
  z-index: 1001;
  max-height: 100vh;
  overflow-y: auto;
}

.sidebar-section {
  display: flex;
  justify-content: center;
}

.icon-group {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 14px;
  flex-shrink: 0;
}

.icon {
  width: 40px;
  height: 40px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
  color: #333;
  border-radius: 8px;
  cursor: pointer;
  transition: background-color 0.2s;
}

.icon:hover {
  background-color: #f0f0f0;
}

.separator {
  width: 40px;
  height: 1px;
  background: #ccc;
  margin: 10px auto;
}

/* 顶部信息面板 */
.top-panel {
  position: absolute;
  top: 20px;
  left: 80px;
  background: white;
  border-radius: 12px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  padding: 12px;
  z-index: 1000;
  display: flex;
  flex-direction: column;
  gap: 8px;
  max-height: 25vh;
  overflow: auto;
}

.logo-bar {
  display: flex;
  align-items: center;
  gap: 8px;
}

.logo {
  width: 40px;
  height: 40px;
  object-fit: contain;
}

.brand-name {
  font-family: 'Ethnocentric', sans-serif;
  font-size: 18px;
  font-weight: normal;
  color: #2c2c3c;
  line-height: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  height: 40px;
}

.divider {
  height: 1px;
  background: #ddd;
  margin: 4px 0;
}

/* 日期控制面板 */
.control-panel {
  background: white;
  border-radius: 10px;
  padding: 6px 8px;
  display: flex;
  align-items: center;
  gap: 6px;
}

.control-panel button {
  border: none;
  background: #f2f2f2;
  padding: 4px 8px;
  font-size: 13px;
  border-radius: 6px;
  cursor: pointer;
}

.control-panel #current-date {
  font-weight: bold;
  font-size: 15px;
  padding: 2px 6px;
}

/* 日历弹窗 */
#calendar-popup {
  position: absolute;
  top: 160px;
  left: 80px;
  background: white;
  border: 1px solid #ccc;
  border-radius: 14px;
  padding: 16px;
  width: 220px;
  z-index: 1001;
  box-shadow: 0 4px 12px rgba(0,0,0,0.15);
}

#calendar-popup.hidden {
  display: none;
}

#calendar-popup input[type="date"] {
  width: 100%;
  padding: 6px;
  border-radius: 6px;
  border: 1px solid #ccc;
  margin-top: 10px;
}

#calendar-popup button {
  margin-top: 10px;
  padding: 6px 10px;
  border: none;
  background: #eee;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
}

.calendar-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 16px;
  margin-bottom: 4px;
}

#close-calendar {
  background: none;
  border: none;
  font-size: 18px;
  cursor: pointer;
  padding: 0;
  margin: 0;
  line-height: 1;
  color: #333;
}

#close-calendar:hover {
  color: black;
}

#today-button {
  margin-top: 10px;
  padding: 6px 10px;
  border: none;
  background: #eee;
  border-radius: 6px;
  cursor: pointer;
  width: 100%;
  font-size: 14px;
}

/* 更新信息 */
#update-panel {
  width: 306px;
  max-height: 650px;
  overflow-y: auto;
  position: absolute;
  top: 160px;
  left: 80px;
  background: white;
  border-radius: 10px;
  padding: 6px 8px;
  z-index: 1001;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

.update-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 0.6em;
  font-weight: bold;
}

.update-list {
  display: flex;
  flex-direction: column;
  gap: 0.8em;
}

.update-item {
  background: #f0f0f0;
  padding: 0.8em;
  border-radius: 8px;
  cursor: pointer;
  border-left: 4px solid #444;
}

.update-item:hover {
  background: #e0e0e0;
}

/* 📱 小屏幕适配 */
@media (max-height: 600px) {
  .icon {
    width: 32px;
    height: 32px;
    font-size: 16px;
  }

  .top-panel {
    transform: scale(0.85);
    transform-origin: top left;
  }

  .control-panel button {
    font-size: 12px;
    padding: 3px 6px;
  }

  .control-panel #current-date {
    font-size: 13px;
  }
}

/* ====== A. 限制容器高度：在底部留出空隙 ====== */
:root{
  /* 想留多少空隙就改这个值（默认 24px） */
  --update-bottom-gap: 24px;
}

#update-panel{
  /* 顶部你原来就是 160px，不动 */
  /* 高度 = 视口高度 - 顶部160px - 底部预留 */
  max-height: calc(100vh - 250px - var(--update-bottom-gap));
  overflow: hidden;                /* 外层不滚，避免圆角被滚动条“切掉” */
  display: flex;
  flex-direction: column;
}

/* 头部不伸缩，列表填满剩余空间 */
.update-header{ flex: 0 0 auto; }
#update-list,
.update-list{                       /* 兼容你用 id 或 class 的两种写法 */
  flex: 1 1 auto;
  overflow-y: auto;                 /* 只在内部列表滚动 */
  padding-right: 6px;               /* 给滚动条留一点“内凹”空间 */
  scrollbar-gutter: stable;         /* 避免出现/隐藏滚动条引起抖动（支持的浏览器） */

  /* Firefox 细滚动条（颜色选中性灰，不改你整体配色） */
  scrollbar-width: thin;
  scrollbar-color: #bdbdbd transparent;
}

/* WebKit 系列（Chrome/Edge/Safari）美化滚动条 */
#update-list::-webkit-scrollbar,
.update-list::-webkit-scrollbar{
  width: 6px;                       /* 更细 */
}
#update-list::-webkit-scrollbar-track,
.update-list::-webkit-scrollbar-track{
  background: transparent;          /* 轨道透明，保持你的白色面板 */
  margin: 8px 0;                    /* 上下留白，让两端呈现圆角效果 */
  border-radius: 999px;
}
#update-list::-webkit-scrollbar-thumb,
.update-list::-webkit-scrollbar-thumb{
  background: #bdbdbd;              /* 中性灰，和现有灰阶一致 */
  border-radius: 999px;             /* 圆角滚动条 */
}
#update-list::-webkit-scrollbar-thumb:hover,
.update-list::-webkit-scrollbar-thumb:hover{
  background: #a8a8a8;
}

/* 永久高亮：当前选中日期 */
.update-item.selected{
  background: #e6e6e6;         /* 比 #f0f0f0 略深，仍保持灰色系 */
  border-left-color: #222;     /* 比 #444 略深一点，强调选中 */
  box-shadow: 0 0 0 2px rgba(0,0,0,0.06) inset;
}

//按压反馈
/* 可按压元素的通用样式（不改原配色，只加过渡与按压态） */
.button-pressable{
  transition: transform .08s ease, box-shadow .08s ease;
  user-select: none;              /* 避免快速连点选中文本 */
  -webkit-tap-highlight-color: transparent;
}

/* 鼠标按下或脚本添加的按压态 */
.button-pressable:active,
.button-pressable.is-pressed{
  transform: scale(0.97);         /* 轻微缩小 */
  box-shadow: 0 0 0 2px #000;     /* 黑色外框（不影响布局） */
  /* 如果想更明显：box-shadow: 0 0 0 2px #000, 0 2px 8px rgba(0,0,0,.15); */
}

/* 键盘可达性：仅在键盘聚焦时给外框（不用改变背景色） */
.button-pressable:focus-visible{
  outline: none;
  box-shadow: 0 0 0 2px #000;
}

/* 避免用户设置“减少动画”时过渡过强（可选） */
@media (prefers-reduced-motion: reduce){
  .button-pressable{ transition: none; }
}

/* 选中行的黑色外框容器 */
.selected-frame{
  width: 100%;
  box-sizing: border-box;           /* 确保总宽度与普通条目一致 */
  border: 2px solid #000;           /* 黑框 */
  border-radius: 12px;              /* 与面板风格一致的圆角 */
  padding: 2px;                     /* 黑框与文本框之间的距离*/
  /* 为了视觉对齐，保持与普通 .update-item 相同的外边距由列表控制 */
}

/* 被包裹在黑框里的原 .update-item 自身不需要特殊处理，保留你原来的灰底、左侧条等 */
.selected-frame > .update-item{
  margin: 0;                        /* 内层不再产生额外外边距，避免影响黑框尺寸 */
}

/* ✅ 特殊：选中条目的左侧竖线改为绿色 */
.selected-frame > .update-item {
  border-left-color: #4CAF50; /* 明亮绿色，可换成 #4CAF50、#00C853 等更柔和的绿 */
}





/* ───────── 信息面板容器 ───────── */
#info-panel{
  width: 306px;
  max-width: 306px;
  max-height: calc(100vh - 160px - var(--update-bottom-gap, 24px));
  position: absolute;
  top: 160px;
  left: 80px;
  background: #fff;
  border-radius: 10px;
  padding: 6px 8px;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  z-index: 1001;
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
  overflow-y: auto;
  overflow-x: hidden; /* 绝不横向滚动 */
  box-sizing: border-box;
}

/* 列表更贴右（可选） */
#info-content{ padding-right: 2px; }

/* ───────── 每条信息卡片（3 行 Grid） ─────────
   Row1: dot | label | (空)
   Row2: (空) | 进度条 | (空)       ← 注意：从第2列开始
   Row3: (空) | 面积+Δ | 百分比
*/
.info-row{
  display: grid;
  grid-template-columns: 14px 1fr auto;  /* dot | 自适应 | 右侧 */
  grid-template-rows: auto 8px auto;
  align-items: center;
  gap: 6px 8px;
  width: 100%;
  box-sizing: border-box;

  background: #f0f0f0;
  border-radius: 8px;
  padding: 10px 8px;
  margin: 0 0 8px 0;
}

/* 左侧色块：方形，带轻微圆角 */
.info-dot {
  width: 10px;
  height: 10px;
  border-radius: 2px;
  grid-column: 1;
  grid-row: 1;
}

/* 标题（自动换行、不撑爆） */
.info-label{
  grid-column: 2; grid-row: 1;
  min-width: 0;
  line-height: 1.25;
  word-break: break-word;
}

/* 进度条：从第2列开始，这样与“面积数据”左对齐 */
.info-bar-wrap{
  grid-column: 2 / 4;  /* 关键：2 到 3 列 */
  grid-row: 2;
  background: #e6e6e6;
  height: 6px;
  border-radius: 99px;
  overflow: hidden;
  box-sizing: border-box;
}
.info-bar{
  height: 100%;
  width: 0%;
  border-radius: 99px;
}

/* 第3行 左：面积 + Δ */
.info-val-left{
  grid-column: 2; grid-row: 3;
  min-width: 0;
  white-space: nowrap;                 /* 同行显示 */
  font-variant-numeric: tabular-nums;  /* 等宽数字 */
}
.info-val-left .val{  margin-right: 10px; }
.info-val-left .delta{ opacity: .7; }

/* 第3行 右：百分比 */
.info-pct{
  grid-column: 3; grid-row: 3;
  white-space: nowrap;
  text-align: right;
  font-variant-numeric: tabular-nums;
}

/* 关闭按钮（保持原样） */
#close-info-panel{
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
}





/* 统一关闭按钮样式 */
/* 统一关闭按钮样式（id 和 class 都照顾到） */
.close-btn,
#close-update-panel,
#close-info-panel,
#close-calendar {
  background: none;
  border: none;
  font-family: "Inter", "Segoe UI", Arial, sans-serif; /* 统一字体 */
  font-weight: 600;          /* 统一粗细 */
  font-size: 18px;           /* 更清晰 */
  line-height: 1;            /* 避免不同字体导致的上下不齐 */
  cursor: pointer;
  color: #222;
  display: inline-flex;      /* 居中对齐 */
  align-items: center;
  justify-content: center;
  width: 24px;               /* 一致的点击面积 */
  height: 24px;
  border-radius: 6px;
  transition: transform 0.08s ease, box-shadow 0.08s ease, color 0.1s ease;
  user-select: none;
}

/* 悬停更深一点 */
.close-btn:hover,
#close-update-panel:hover,
#close-info-panel:hover,
#close-calendar:hover {
  color: #000;
}

/* 按下缩小并加外框 */
.close-btn:active,
#close-update-panel:active,
#close-info-panel:active,
#close-calendar:active {
  transform: scale(0.9);
  box-shadow: 0 0 0 2px #000;
}






/* 经纬度面板：与其它面板统一 */
#geo-panel{
  width: 306px;
  max-height: calc(100vh - 160px - var(--update-bottom-gap, 24px));
  overflow-y: auto;
  position: absolute;
  top: 160px;
  left: 80px;
  background: white;
  border-radius: 10px;
  padding: 6px 8px;
  z-index: 1001;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  box-sizing: border-box;
}

/* 表单行：输入+按钮 */
.geo-form{
  display: grid;
  grid-template-columns: 1fr auto;
  gap: 8px;
  align-items: center;
}

#geo-input{
  height: 34px;
  border-radius: 8px;
  border: 1px solid #ccc;
  padding: 0 10px;
  font-size: 14px;
  outline: none;
}
#geo-input:focus{
  border-color: #999;
  box-shadow: 0 0 0 2px rgba(0,0,0,.05);
}

.geo-go{
  height: 34px;
  padding: 0 12px;
  border: none;
  border-radius: 8px;
  background: #f2f2f2;
  cursor: pointer;
  font-size: 14px;
  transition: transform .08s ease, box-shadow .08s ease, background .1s ease;
}
.geo-go:hover{ background: #e9e9e9; }
.geo-go:active{ transform: scale(.97); box-shadow: 0 0 0 2px #000; }

.geo-hint{
  color: #666;
  font-size: 12px;
  padding: 0 2px 6px;
}






/* 坐标弹窗样式 */
.coord-popup .leaflet-popup-content-wrapper {
  border-radius: 12px;
  box-shadow: 0 8px 24px rgba(0,0,0,.25);
}
.coord-card { min-width: 220px; }
.coord-title {
  font-weight: 600;
  letter-spacing: .06em;
  font-size: 12px;
  opacity: .7;
  margin-bottom: 8px;
}
.coord-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  gap: 6px 10px;
  align-items: center;
  padding: 6px 0;
  border-top: 1px solid #eee;
}
.coord-row:first-of-type { border-top: none; }
.coord-label { font-size: 12px; opacity: .7; }
.coord-value { font-variant-numeric: tabular-nums; white-space: nowrap; }
.coord-copy {
  background: none; border: none; cursor: pointer; font-size: 16px;
  padding: 2px 4px; border-radius: 6px; transition: transform .08s ease, box-shadow .08s ease;
}
.coord-copy:active { transform: scale(.92); box-shadow: 0 0 0 2px #000; }






/* Ruler 面板 */
#ruler-panel{
  width: 306px;
  max-height: calc(100vh - 160px - var(--update-bottom-gap, 24px));
  overflow-y: auto;
  position: absolute;
  top: 160px;
  left: 80px;
  background: white;
  border-radius: 10px;
  padding: 6px 8px;
  z-index: 1001;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

/* 复用统一关闭按钮态（你之前已设置了 close 样式） */
#close-ruler-panel{
  background: none;
  border: none;
  font-size: 16px;
  cursor: pointer;
  color: #222;
  transition: transform .08s ease, box-shadow .08s ease;
  border-radius: 4px;
  user-select: none;
}
#close-ruler-panel:hover{ color:#000; }
#close-ruler-panel:active{ transform:scale(.9); box-shadow:0 0 0 2px #000; }

.ruler-body{ padding: 6px; }
.ruler-body .hint{ color:#6b7280; margin-bottom:8px; }

.ruler-stats{
  display:flex;
  gap:14px;
  margin:8px 0;
}
.ruler-stats .stat{ flex:1; }
.ruler-stats .num{
  font-size:20px;
  font-weight:600;
  line-height:1.2;
}
.ruler-stats .label{
  font-size:12px;
  color:#6b7280;
}

.ruler-actions{
  display:flex;
  gap:8px;
}
.ruler-actions .mini{
  border:none;
  background:#eee;
  border-radius:8px;
  padding:6px 10px;
  cursor:pointer;
}
.ruler-actions .mini:hover{ background:#e6e6e6; }
.ruler-actions .mini:active{ transform:scale(.97); box-shadow:0 0 0 2px #000; }








/* 绘图面板基础布局 */
#draw-panel {
  width: 306px;
  max-height: calc(100vh - 160px - var(--update-bottom-gap, 24px));
  overflow-y: auto;
  position: absolute;
  top: 160px;
  left: 80px;
  background: white;
  border-radius: 10px;
  padding: 6px 8px;
  z-index: 1001;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);
  display: flex;
  flex-direction: column;
  gap: 6px;
  font-size: 13px;
}

#draw-panel .update-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 12px 14px;
  border-bottom: 1px solid rgba(0,0,0,.08);
}

#draw-panel .draw-actions button,
#draw-panel .draw-toolbar .draw-tool {
  background: none;
  border: none;
  cursor: pointer;
  font-size: 15px;
  padding: 6px 8px;
  border-radius: 6px;
}

#draw-panel .draw-actions button:hover,
#draw-panel .draw-toolbar .draw-tool:hover { background: rgba(0,0,0,.06); }

#draw-panel .draw-toolbar { padding: 10px 12px 12px; }
#draw-panel .tool-row { display: flex; align-items: center; gap: 8px; margin-top: 8px; }

.draw-color-palette { display: grid; grid-template-columns: repeat(9, 1fr); gap: 6px; width: 100%; }
.draw-color {
  width: 22px; height: 22px; border-radius: 6px; border: 2px solid transparent;
  box-sizing: border-box; cursor: pointer;
}
.draw-color.selected { border-color: #111; }

#draw-weight { flex: 1; }
#draw-weight-val { width: 26px; text-align: right; font-variant-numeric: tabular-nums; }







/* === 底图面板 === */
#basemap-panel{
  width: 306px;
  max-height: calc(100vh - 160px - var(--update-bottom-gap, 24px));
  overflow-y: auto;

  position: absolute;
  top: 160px;
  left: 80px;

  background: #fff;
  border-radius: 10px;
  padding: 6px 8px;
  z-index: 1001;
  box-shadow: 0 6px 16px rgba(0,0,0,0.15);

  display: flex;
  flex-direction: column;
  gap: 8px;
  font-size: 13px;
  box-sizing: border-box;
}

#basemap-panel.hidden { display: none; }

/* 头部 */
#basemap-panel .panel-header{
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 6px;
}
#basemap-panel .panel-title{
  font-weight: 600;
  font-size: 15px;
}

/* 网格与项 */
#basemap-panel .bm-grid{
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
}
#basemap-panel .bm-item{
  border-radius: 12px;
  padding: 8px;
  cursor: pointer;
  user-select: none;
  border: 2px solid transparent;
  transition: transform .06s ease, border-color .06s ease;
}
#basemap-panel .bm-item:active{
  transform: scale(0.98);
}
#basemap-panel .bm-item.selected{
  border-color: #000;
}
#basemap-panel .bm-thumb{
  width: 100%;
  aspect-ratio: 1/1;
  border-radius: 10px;
  background-size: cover;
  background-position: center;
  box-shadow: inset 0 0 0 1px rgba(0,0,0,.08);
}
#basemap-panel .bm-label{
  text-align: center;
  margin-top: 6px;
  font-size: 12px;
  color: #444;
}

/* 三个缩略图（用已编码的内联 SVG，注意 %23 代表 #） */
#basemap-panel .bm-thumb-standard{
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'><rect width='120' height='120' fill='%23f4f2e9'/><path d='M0 60 H120' stroke='%23cfc7b0' stroke-width='3'/><path d='M0 30 H120' stroke='%23e0dac8'/><path d='M0 90 H120' stroke='%23e0dac8'/><path d='M30 0 V120' stroke='%23e0dac8'/><path d='M60 0 V120' stroke='%23cfc7b0' stroke-width='3'/><path d='M90 0 V120' stroke='%23e0dac8'/></svg>");
}
#basemap-panel .bm-thumb-topo{
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'><rect width='120' height='120' fill='%23eef3e8'/><path d='M10 100 C30 80, 50 90, 70 70 S110 60 120 40' fill='none' stroke='%239bb27a' stroke-width='2'/><path d='M0 80 C20 60, 40 70, 60 50 S90 40 110 20' fill='none' stroke='%23c5d5ab' stroke-width='2'/></svg>");
}
#basemap-panel .bm-thumb-sat{
  background-image: url("data:image/svg+xml;utf8,<svg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 120 120'><defs><linearGradient id='g' x1='0' y1='0' x2='1' y2='1'><stop offset='0' stop-color='%23253b24'/><stop offset='1' stop-color='%234c5a2e'/></linearGradient></defs><rect width='120' height='120' fill='url(%23g)'/><circle cx='40' cy='40' r='14' fill='%236a7b37'/><rect x='70' y='65' width='28' height='18' fill='%2338461f'/></svg>");
}







/* =================== 批注（Leaflet Note）最终样式 =================== */

/* 仅作用于批注的 divIcon 外壳，避免 0 宽高 */
.leaflet-marker-icon.note-icon{
  width: auto !important;
  height: auto !important;
  display: inline-block !important;
}

/* 去掉你模板里可能带的 ::before/::after 箭头等 */
.leaflet-note::before,
.leaflet-note::after{ display: none !important; }

/* 仅在编辑时给可视外框（颜色 = currentColor，即文本色） */
.leaflet-note .note-text[contenteditable="true"]:focus{
  outline: 1.5px solid currentColor;
  outline-offset: 2px;
  border-radius: 6px;
  padding: 2px 4px;
}

/* 书写方向与旋转修正：只限制在文本节点自身（避免影响其它插件） */
.leaflet-note .note-text,
.leaflet-note .note-text *{
  writing-mode: horizontal-tb !important;
  text-orientation: mixed !important;
  transform: none !important;
}

/* —— 可调变量 —— */
:root{
  --note-font-size: 16px;         /* 默认字号（要更大就改这里，如 17px/18px） */
  --note-line-height: 1.4;        /* 行高 */
  --note-min-width: 140px;        /* 最窄宽度，避免一字一行 */
  --note-max-width: 650px;        /* 自动换行的上限宽度（稍微大一些） */
}

/* 关键：加权选择器 + !important，顶住外层 font 设置 */
.leaflet-pane .leaflet-marker-icon.note-icon .leaflet-note .note-text{
  display: inline-block !important;

  /* 可读性与换行控制 */
  min-width: var(--note-min-width) !important;
  max-width: var(--note-max-width) !important;
  white-space: pre-wrap !important;
  overflow-wrap: anywhere !important;
  word-break: normal !important;
  line-height: var(--note-line-height) !important;

  /* 视觉与重置 */
  background: transparent !important;
  outline: none !important;
  border: 0 !important;
  margin: 0 !important;
  padding: 0 !important;

  /* 字体与字号（中文优先的无衬线栈） */
  font-size: var(--note-font-size) !important;
  font-family:
    "Noto Sans SC","PingFang SC","Microsoft YaHei",
    "Source Han Sans SC","Hiragino Sans GB",
    Arial,Helvetica,sans-serif !important;
}

/* =================== 右键编辑条 =================== */
#note-format-bar{
  position: fixed;
  z-index: 99999;
  background: #111;
  color: #fff;
  border-radius: 8px;
  padding: 6px 8px;
  display: none;                 /* 默认隐藏，右键文本时显示 */
  gap: 6px;
  align-items: center;
  box-shadow: 0 6px 16px rgba(0,0,0,.25);
  font-size: 13px;
  white-space: nowrap;
}
#note-format-bar select,
#note-format-bar button{
  background: #222;
  color: #fff;
  border: 1px solid #333;
  border-radius: 6px;
  padding: 4px 6px;
  cursor: pointer;
}
#note-format-bar button{ min-width: 28px; }
#note-format-bar button:hover,
#note-format-bar select:hover{ background:#2b2b2b; }
#note-format-bar .divider{
  width: 1px; height: 18px; background: #333; margin: 0 4px;
}








/* ======= 只影响我们的 note popup（通过 className: "mn-popup"）======= */

/* 1) 不要动 wrapper 的 width，让 Leaflet 用 minWidth/maxWidth 算 */
.leaflet-popup.mn-popup .leaflet-popup-content-wrapper{
  border-radius: 10px;
}

/* 2) 内容区：别用大 margin，避免“第一行/最后一行间距怪” */
.leaflet-popup.mn-popup .leaflet-popup-content{
  margin: 12px 14px;          /* 你想要的内边距感（别再 15 20 那么大） */
  width: auto;                /* 让 Leaflet 选项决定宽 */
  box-sizing: border-box;
}

/* 3) 让内容“先吃满宽度，再向下长”（核心：正常换行 + 不溢出） */
.leaflet-popup.mn-popup .note-popup,
.leaflet-popup.mn-popup .note-popup *{
  box-sizing: border-box;
}

.leaflet-popup.mn-popup .note-popup-body,
.leaflet-popup.mn-popup .note-content-body,
.note-popup-body,
.note-body{
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: normal;
  line-height: 1.55;
}

/* 链接：强制在容器内折行 */
.leaflet-popup.mn-popup a{
  display: inline;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.leaflet-popup.mn-popup .note-popup{
  display: inline-block;
  max-width: 100%;
}

.leaflet-popup.mn-popup .note-popup-body{
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.map-note-dot {
    /* 1. 核心：40px 隐形点击热区（保持不变，确保好点） */
    pointer-events: auto !important;
    cursor: pointer;
    stroke-width: 40px !important; 
    stroke-opacity: 0 !important;

    /* 2. 视觉魔法：复合战术外框 */
    /* 我们通过 4 层滤镜叠加出：深色外描边 + 亮白内框 */
    filter: 
        /* 第一层：最外层的黑色硬边，把图标从复杂背景中抠出来 */
        drop-shadow(0 0 1px #000000) 
        drop-shadow(0 0 1px #000000)
        /* 第二层：亮白色边框（这就是你想要的外框感） */
        drop-shadow(0 0 2px #ffffff) 
        drop-shadow(0 0 2px #ffffff)
        /* 第三层：底部的深色投影，增加立体感 */
        drop-shadow(0 3px 5px rgba(0,0,0,0.5));

    /* 3. 绘制顺序：确保填充色在最上层 */
    paint-order: stroke fill;
    
    /* 4. 增加一点微弱的旋转或脉冲效果（可选，增加动态感） */
    transition: transform 0.2s ease;
}

/* 4) 手机端：略窄于屏幕（比如 92vw），且不要贴边 */
@media (max-width: 600px){
  .leaflet-popup.mn-popup .leaflet-popup-content{
    max-width: 60vw;
    min-width: 135px;
    margin: 10px 12px;
  }
}
