/* ===== 基础重置 ===== */
* { margin: 0; padding: 0; box-sizing: border-box; }
html, body { height: 100%; }

body {
  display: flex;
  flex-direction: column;
  height: 100vh;
  font-family: "Microsoft YaHei", "Segoe UI", Arial, sans-serif;
  font-size: 14px;
  color: #222;
  background: #f5f5f5;
}

/* ===== 三栏布局 ===== */
.layout {
  display: flex;
  flex: 1;
  min-height: 0;
}

.panel {
  background: #fff;
  padding: 14px;
  overflow-y: auto;
}
.panel-left {
  width: 280px;
  flex-shrink: 0;
  border-right: 1px solid #e0e0e0;
}
.panel-right {
  width: 360px;
  flex-shrink: 0;
  border-left: 1px solid #e0e0e0;
}
.map-wrap {
  flex: 1;
  min-width: 0;
  position: relative;
}
#map {
  width: 100%;
  height: 100%;
  background: #e8eaed;
}

/* ===== 标题 ===== */
h2 {
  font-size: 16px;
  margin-bottom: 12px;
  padding-bottom: 8px;
  border-bottom: 2px solid #2e7d32;
  color: #2e7d32;
}

/* ===== 表单 ===== */
label {
  display: block;
  margin-bottom: 4px;
  font-weight: bold;
  color: #444;
}
input[type="text"] {
  width: 100%;
  padding: 7px 9px;
  border: 1px solid #bbb;
  border-radius: 4px;
  margin-bottom: 8px;
  font-size: 13px;
}
input[type="text"]:focus {
  outline: none;
  border-color: #2e7d32;
  box-shadow: 0 0 0 2px rgba(46,125,50,0.15);
}

/* ===== 密码提示信息 ===== */
.pwd-message {
  font-size: 12px;
  color: #666;
  min-height: 18px;
  margin-bottom: 6px;
  line-height: 1.5;
}
.pwd-message b {
  font-weight: 700;
}

/* ===== 管理面板 ===== */
.admin-panel {
  font-size: 12px;
  line-height: 1.7;
  padding: 6px 0;
}
.admin-panel code {
  display: block;
  padding: 3px 6px;
  background: #f5f5f5;
  border-radius: 3px;
  margin-top: 2px;
  font-size: 11px;
  word-break: break-all;
}

/* ===== 城市搜索 ===== */
.city-search {
  display: flex;
  gap: 6px;
  margin-bottom: 4px;
}
.city-search input {
  flex: 1;
  margin-bottom: 0;
}
.city-search button {
  width: auto;
  padding: 7px 12px;
  margin-bottom: 0;
  flex-shrink: 0;
  font-size: 13px;
  background: #00838f;
}
.search-message {
  font-size: 12px;
  color: #c62828;
  min-height: 18px;
  margin-bottom: 4px;
}

/* ===== 省市搜索候选列表 ===== */
.place-candidates {
  margin-bottom: 6px;
}
.place-candidate-title {
  font-size: 12px;
  color: #37474f;
  margin-bottom: 6px;
  line-height: 1.5;
}
.place-candidate {
  width: 100%;
  text-align: left;
  padding: 6px 9px;
  margin-bottom: 4px;
  font-size: 13px;
  background: #eceff1;
  color: #263238;
  border-left: 3px solid #00838f;
}
.place-candidate small {
  color: #607d8b;
  font-size: 11px;
}

/* ===== 坐标定位区子标题 ===== */
.locate-panel,
.reverse-coord-panel {
  margin-bottom: 12px;
}
.locate-panel h4,
.reverse-coord-panel h4 {
  font-size: 13px;
  color: #37474f;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #ddd;
}

/* ===== 按钮 ===== */
button {
  display: block;
  width: 100%;
  padding: 9px;
  margin-bottom: 8px;
  border: none;
  border-radius: 4px;
  background: #455a64;
  color: #fff;
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
button:hover { filter: brightness(1.12); }
button:active { filter: brightness(0.92); }

#btn-load  { background: #1565c0; }
#btn-zone6 { background: #c62828; }
#btn-zone3 { background: #6a1b9a; }
#btn-both  { background: #ef6c00; }
#btn-clear { background: #455a64; }

hr {
  border: none;
  border-top: 1px dashed #ccc;
  margin: 10px 0;
}

/* ===== 示例点按钮网格（3 列） ===== */
.ex-grid {
  display: grid;
  grid-template-columns: 1fr 1fr 1fr;
  gap: 5px;
  margin-bottom: 8px;
}
.ex-grid button {
  width: 100%;
  margin-bottom: 0;
  padding: 6px 2px;
  font-size: 12px;
  background: #00838f;
}
.ex-grid button:hover { filter: brightness(1.15); }

/* ===== 提示文字 ===== */
.tip {
  font-size: 12px;
  color: #777;
  line-height: 1.7;
  margin-top: 10px;
  padding: 8px;
  background: #f9f9f9;
  border-radius: 4px;
}

/* ===== 底部说明 ===== */
.footer {
  padding: 6px 14px;
  font-size: 12px;
  color: #666;
  background: #eee;
  border-top: 1px solid #ddd;
  line-height: 1.5;
  flex-shrink: 0;
}

.footer-icp {
  margin-top: 2px;
}

.footer-icp a {
  color: #666;
  text-decoration: none;
}

.footer-icp a:hover {
  text-decoration: underline;
}

/* ===== 结果面板 ===== */
.placeholder {
  color: #999;
  font-style: italic;
}
#result .block {
  background: #f9f9f9;
  border: 1px solid #e8e8e8;
  border-left: 3px solid #2e7d32;
  border-radius: 4px;
  padding: 10px 12px;
  margin-bottom: 10px;
}
#result .block h3 {
  font-size: 14px;
  color: #2e7d32;
  margin-bottom: 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #ececec;
}
#result .block.zone3 { border-left-color: #6a1b9a; }
#result .block.zone3 h3 { color: #6a1b9a; }
#result .block.zone6 { border-left-color: #c62828; }
#result .block.zone6 h3 { color: #c62828; }
#result p { margin-bottom: 4px; line-height: 1.7; }
#result b { color: #1565c0; }

/* ===== 偏移量颜色 ===== */
#result .off-pos { color: #c62828; }      /* E > 500000  红色（东侧） */
#result .off-neg { color: #1565c0; }      /* E < 500000  蓝色（西侧） */

/* ===== Leaflet tooltip 美化 ===== */
.leaflet-tooltip.zone-tip {
  font-size: 12px;
  padding: 3px 7px;
  border-radius: 3px;
}

/* ===== 投影带图上标签 ===== */
.zone-label {
  font-size: 12px;
  font-weight: 700;
  padding: 2px 5px;
  border-radius: 4px;
  background: rgba(255, 255, 255, 0.82);
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(0, 0, 0, 0.25);
  text-align: center;
  line-height: 1.4;
  pointer-events: none;
}
.zone-label-6 {
  color: #c62828;
  border: 1px solid rgba(198, 40, 40, 0.5);
}
.zone-label-3 {
  color: #6a1b9a;
  border: 1px solid rgba(106, 27, 154, 0.5);
}

/* ===== 计算过程折叠区 ===== */
.calc-detail {
  margin-top: 10px;
  border: 1px solid #e0e0e0;
  border-radius: 4px;
  overflow: hidden;
}
.calc-detail summary {
  padding: 7px 10px;
  font-size: 12px;
  font-weight: 600;
  color: #2e7d32;
  background: #e8f5e9;
  cursor: pointer;
  user-select: none;
  outline: none;
}
.calc-detail summary:hover {
  background: #c8e6c9;
}

/* 3° 带折叠区颜色 */
.block.zone3 .calc-detail summary {
  color: #6a1b9a;
  background: #f3e5f5;
}
.block.zone3 .calc-detail summary:hover {
  background: #e1bee7;
}

/* 6° 带折叠区颜色 */
.block.zone6 .calc-detail summary {
  color: #c62828;
  background: #ffebee;
}
.block.zone6 .calc-detail summary:hover {
  background: #ffcdd2;
}

/* 公式框 */
.formula-box {
  padding: 10px 12px;
  font-size: 13px;
  line-height: 1.8;
  background: #fafafa;
  border-top: 1px solid #e8e8e8;
  font-family: "Consolas", "Courier New", monospace;
}
.formula-box p {
  margin-bottom: 4px;
}
.formula-box b {
  color: #333;
}

/* ===== 带号版 Y 突出显示 ===== */
.band-y {
  font-weight: 700;
  color: #e65100;
  font-size: 15px;
}

/* ===== 带号版坐标反查面板 ===== */
.reverse-coord-panel {
  margin-bottom: 12px;
}
.reverse-example-panel {
  margin-bottom: 12px;
  padding: 8px 10px;
  background: #f5f5f5;
  border-radius: 5px;
}
.reverse-example-panel h4 {
  font-size: 13px;
  color: #37474f;
  margin-bottom: 8px;
  padding-bottom: 4px;
  border-bottom: 1px solid #ddd;
}

/* ===== 反查结果 ===== */
.reverse-coord-result {
  font-size: 12px;
  line-height: 1.7;
  margin-top: 8px;
}
.reverse-coord-result.placeholder {
  color: #999;
  font-style: italic;
}
.reverse-coord-result .result-card {
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 4px;
  padding: 10px 12px;
}
.reverse-coord-result .result-card p {
  margin-bottom: 3px;
}
.reverse-coord-result .result-card b {
  color: #1565c0;
}
.reverse-coord-result .result-card .band-y {
  color: #e65100;
}
.reverse-coord-result .result-card .risk-note {
  margin-top: 8px;
  padding: 6px 8px;
  background: #fff8e1;
  border: 1px solid #ffecb3;
  border-radius: 3px;
  color: #795548;
  font-size: 11px;
}

/* ===== 错误/警告/成功 ===== */
.input-error {
  color: #c62828;
  background: #ffebee;
  border: 1px solid #ef9a9a;
  border-radius: 4px;
  padding: 8px 10px;
  line-height: 1.6;
}
.input-warning {
  color: #e65100;
  background: #fff3e0;
  border: 1px solid #ffcc80;
  border-radius: 4px;
  padding: 8px 10px;
  line-height: 1.6;
  margin: 4px 0;
}
.input-success {
  color: #2e7d32;
  background: #e8f5e9;
  border: 1px solid #a5d6a7;
  border-radius: 4px;
  padding: 8px 10px;
  line-height: 1.6;
}

/* ===== 解析详情行 ===== */
.parse-detail {
  font-family: "Consolas", "Courier New", monospace;
  font-size: 12px;
}

/* ===== 反查 select 样式 ===== */
.reverse-coord-panel select:focus,
.reverse-example-panel select:focus {
  outline: none;
  border-color: #2e7d32;
  box-shadow: 0 0 0 2px rgba(46,125,50,0.15);
}

/* ===== 管理面板：多日授权密码 ===== */
.admin-panel input[type="number"] {
  width: 100%;
  padding: 5px 8px;
  border: 1px solid #bbb;
  border-radius: 3px;
  font-size: 12px;
  margin-bottom: 4px;
}
.admin-panel input[type="number"]:focus {
  outline: none;
  border-color: #1565c0;
  box-shadow: 0 0 0 2px rgba(21,101,192,0.15);
}
#timedPasswordOutput {
  margin-bottom: 4px;
}
#timedPasswordOutput .input-success {
  font-size: 12px;
  line-height: 1.7;
}
#timedPasswordOutput .band-y {
  font-size: 14px;
  word-break: break-all;
}
