* { box-sizing: border-box; }
html, body { height: 100%; margin: 0; font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", Roboto, sans-serif; color: #1b1b1b; }
body { display: flex; }

#sidebar {
  width: 360px;
  max-width: 40vw;
  padding: 18px 20px;
  overflow-y: auto;
  border-right: 1px solid #e4e4e4;
  background: #fafaf7;
}
h1 { margin: 0 0 4px; font-size: 18px; letter-spacing: 0.02em; }
.sub { margin: 0 0 16px; font-size: 12px; color: #666; }

.form label { display: block; font-size: 12px; color: #555; margin-bottom: 12px; position: relative; }
.form input {
  display: block;
  width: 100%;
  margin-top: 4px;
  padding: 8px 10px;
  font-size: 14px;
  border: 1px solid #cfcfcf;
  border-radius: 4px;
  background: #fff;
}
.form input:focus { outline: none; border-color: #8a6a2a; box-shadow: 0 0 0 2px rgba(138,106,42,0.15); }
.form .hint { margin: 4px 0 0; font-size: 11px; color: #999; line-height: 1.4; }

.input-wrap { position: relative; }
.input-wrap input { padding-right: 28px; }
.clear-btn {
  position: absolute;
  right: 6px;
  top: 50%;
  transform: translateY(-50%);
  width: 20px;
  height: 20px;
  padding: 0;
  border: none;
  background: #d7cdb5;
  color: #fff;
  border-radius: 50%;
  font-size: 14px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.clear-btn:hover { background: #8a6a2a; }

.swap-row { margin: 0 0 12px; text-align: center; }
#swap-btn {
  padding: 3px 10px;
  font-size: 11px;
  background: #fff;
  border: 1px solid #cfcfcf;
  border-radius: 12px;
  color: #555;
  cursor: pointer;
}
#swap-btn:hover { border-color: #8a6a2a; color: #8a6a2a; }

.suggest {
  position: absolute;
  top: 100%; left: 0; right: 0;
  margin: 0; padding: 0;
  list-style: none;
  background: #fff;
  border: 1px solid #ddd;
  border-top: none;
  max-height: 240px;
  overflow-y: auto;
  z-index: 5;
}
.suggest li { padding: 6px 10px; font-size: 13px; cursor: pointer; border-bottom: 1px solid #eee; }
.suggest li:last-child { border-bottom: none; }
.suggest li:hover, .suggest li.active { background: #f1ebdd; }
.suggest .zh { color: #8a6a2a; margin-left: 6px; }
.suggest .meta { color: #999; font-size: 11px; margin-left: 6px; }

.summary {
  margin-top: 18px;
  padding: 12px 14px;
  background: #f1ebdd;
  border-radius: 4px;
  font-size: 13px;
}
.summary .big { font-size: 18px; font-weight: 600; color: #8a6a2a; }

.chain { margin: 12px 0 0; font-size: 13px; line-height: 1.4; }
.chain .station {
  display: flex;
  align-items: baseline;
  gap: 8px;
  padding: 3px 0;
}
.chain .station .num {
  flex: 0 0 22px;
  color: #999;
  font-size: 11px;
  text-align: right;
}
.chain .station.endpoint { font-weight: 600; }
.chain .station.endpoint .num { color: #8a6a2a; font-weight: 600; }
.chain .station .zh { color: #8a6a2a; font-size: 12px; }
.chain .seg {
  margin-left: 30px;
  padding: 2px 0;
  color: #999;
  font-size: 11px;
}

.stats { margin-top: 22px; padding-top: 10px; border-top: 1px solid #e4e4e4; font-size: 11px; color: #888; }

#map { flex: 1; height: 100%; background: #f0ece3; }

.leaflet-tooltip.station-label { font-size: 11px; background: transparent; border: none; box-shadow: none; color: #333; padding: 0; }
.endpoint-icon .pin {
  width: 22px; height: 22px;
  border-radius: 50%;
  color: #fff;
  font-weight: 600;
  display: flex; align-items: center; justify-content: center;
  font-size: 12px;
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px rgba(0,0,0,0.25);
}
