/* ── 全域 reset ─────────────────────────────────────────── */
html, body {
  margin: 0; padding: 0;
  height: 100%; overflow: hidden;
  font-family: 'Microsoft JhengHei', 'Noto Sans TC', Arial, sans-serif;
  background: #111;
}

/* ── 工具列 ─────────────────────────────────────────────── */
#toolbar {
  position: fixed; top: 0; left: 0; right: 0;
  height: 46px;
  background: rgba(18, 18, 18, 0.96);
  display: flex; align-items: center;
  justify-content: space-between;
  padding: 0 12px; gap: 8px;
  z-index: 9999;
  border-bottom: 1px solid #333;
  box-shadow: 0 2px 8px rgba(0,0,0,0.5);
}
#toolbar-left, #toolbar-right {
  display: flex; align-items: center; gap: 6px;
}

#sel-category {
  height: 32px; padding: 0 10px;
  background: #2a2a2a; color: #eee;
  border: 1px solid #555; border-radius: 5px;
  font-size: 13px; cursor: pointer;
  min-width: 100px;
}
#sel-category:focus { outline: none; border-color: #3498db; }

.tool-btn {
  height: 32px; padding: 0 11px;
  background: #2a2a2a; color: #ddd;
  border: 1px solid #444; border-radius: 5px;
  cursor: pointer; font-size: 12px;
  transition: background 0.12s, border-color 0.12s;
  white-space: nowrap;
  display: inline-flex; align-items: center; gap: 4px;
}
.tool-btn:hover  { background: #3a3a3a; border-color: #666; }
.tool-btn.active { background: #1a6fa8; border-color: #3498db; color: #fff; }
.tool-btn.success{ background: #1e7e44; border-color: #2ecc71; color: #fff; }
.tool-btn.success:hover { background: #27ae60; }
.tool-btn.warn   { background: #7d5c00; border-color: #f39c12; color: #ffd; }
.tool-btn.warn:hover { background: #a07800; }
.tool-btn:disabled { opacity: 0.35; cursor: not-allowed; pointer-events: none; }
.tool-btn kbd {
  background: rgba(255,255,255,0.12);
  padding: 1px 5px; border-radius: 3px;
  font-size: 10px; font-family: monospace;
  border: 1px solid rgba(255,255,255,0.2);
}

.sep-line { width: 1px; height: 22px; background: #444; margin: 0 2px; }

#readonly-badge {
  padding: 4px 10px;
  background: #5d3a00;
  color: #f39c12;
  border: 1px solid #8c5a00;
  border-radius: 5px;
  font-size: 12px;
  font-weight: bold;
  letter-spacing: 0.5px;
}

/* ── 地圖容器 ────────────────────────────────────────────── */
#map {
  position: fixed;
  top: 46px;
  left: 0;
  /* width/height 由 JS resizeMap() 動態設定 */
}

/* ── 狀態列 ─────────────────────────────────────────────── */
#statusbar {
  position: fixed; bottom: 0; left: 0; right: 0;
  height: 30px;
  background: rgba(10, 10, 10, 0.92);
  color: #aaa; display: flex; align-items: center;
  padding: 0 14px; font-size: 12px;
  z-index: 9999; gap: 0;
  border-top: 1px solid #333;
}
.sb-sep { margin: 0 10px; color: #444; }
#status-mode { color: #3498db; font-weight: bold; }
#status-label { color: #2ecc71; }
#status-coords { color: #888; margin-left: auto; font-family: monospace; font-size: 11px; }

/* ── 列表面板 ────────────────────────────────────────────── */
#list-panel {
  position: fixed;
  top: 46px; right: 0;
  width: 380px; height: calc(100vh - 76px);
  background: rgba(15, 15, 15, 0.97);
  color: #ddd; z-index: 9998;
  display: flex; flex-direction: column;
  border-left: 1px solid #333;
  box-shadow: -4px 0 16px rgba(0,0,0,0.4);
  transition: transform 0.2s ease;
}
#list-panel.hidden { transform: translateX(400px); pointer-events: none; }

#list-header {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px;
  border-bottom: 1px solid #333;
  font-size: 14px; font-weight: bold;
  flex-shrink: 0;
}
#list-header span { color: #aaa; font-weight: normal; font-size: 12px; }
#btn-close-list {
  background: none; border: none;
  color: #777; font-size: 18px; cursor: pointer; line-height: 1;
}
#btn-close-list:hover { color: #fff; }

#list-body { flex: 1; overflow-y: auto; }

#ann-table { width: 100%; border-collapse: collapse; font-size: 12px; }
#ann-table thead th {
  background: #1e1e1e; padding: 7px 10px;
  text-align: left; color: #888;
  position: sticky; top: 0; z-index: 1;
  border-bottom: 1px solid #333;
}
#ann-table tbody td {
  padding: 6px 10px; border-bottom: 1px solid #222;
  vertical-align: middle;
}
#ann-table tbody tr:hover td { background: #1a1a1a; }

.ann-dot {
  display: inline-block; width: 10px; height: 10px;
  border-radius: 50%; margin-right: 5px; vertical-align: middle;
}
.geom-badge {
  display: inline-block; padding: 1px 6px;
  background: #2a2a2a; border-radius: 3px;
  font-size: 10px; color: #888;
  border: 1px solid #444;
}
.btn-xs {
  padding: 2px 8px; font-size: 11px;
  background: #2a2a2a; border: 1px solid #444;
  color: #ccc; border-radius: 3px; cursor: pointer;
}
.btn-xs:hover { background: #3a3a3a; }
.btn-xs.del { color: #e74c3c; border-color: #7b241c; }
.btn-xs.del:hover { background: #7b241c; color: #fff; }

/* ── Popup 樣式 override ─────────────────────────────────── */
.ann-popup {
  font-family: 'Microsoft JhengHei', Arial, sans-serif;
  font-size: 13px; color: #222;
  min-width: 220px;
}
.ann-popup label { font-size: 11px; color: #555; margin-bottom: 2px; display: block; }
.ann-popup select, .ann-popup input[type=text] {
  width: 100%; padding: 4px 6px; margin-bottom: 8px;
  border: 1px solid #ccc; border-radius: 4px;
  font-size: 12px; box-sizing: border-box;
}
.ann-popup .btn-row { display: flex; gap: 6px; margin-top: 6px; }
.ann-popup .btn-row button {
  flex: 1; padding: 5px; border: none; border-radius: 4px;
  cursor: pointer; font-size: 12px; font-weight: bold;
}
.ann-popup .btn-confirm { background: #27ae60; color: #fff; }
.ann-popup .btn-confirm:hover { background: #2ecc71; }
.ann-popup .btn-cancel  { background: #c0392b; color: #fff; }
.ann-popup .btn-cancel:hover  { background: #e74c3c; }
.ann-popup .btn-update  { background: #2980b9; color: #fff; }
.ann-popup .btn-update:hover  { background: #3498db; }
.ann-popup .btn-del     { background: #922b21; color: #fff; }
.ann-popup .btn-del:hover     { background: #c0392b; }
.ann-popup .ann-meta {
  font-size: 10px; color: #999; margin-bottom: 8px;
  padding-bottom: 6px; border-bottom: 1px solid #eee;
}
