/* 充電新手村 — 對齊新手村 1140px 容器與 theme-dark 權杖 */

.sr-only {
  position: absolute;
  width: 1px; height: 1px;
  padding: 0; margin: -1px;
  overflow: hidden; clip: rect(0, 0, 0, 0);
  border: 0;
}

.charge-body {
  background: var(--bg-base);
}

.navbar.novice-nav .navbar-brand i {
  opacity: 0.92;
}

.charge-hero-row {
  gap: 1.25rem 2rem;
}

.charge-kicker {
  margin: 0;
  color: var(--ink-faint);
  font-size: 0.8125rem;
  font-weight: 600;
  letter-spacing: 0.04em;
}

.charge-hero__copy {
  max-width: 40rem;
  flex: 1 1 18rem;
}

.charge-hero__copy .lead {
  font-size: 1.02rem;
  max-width: 34em;
  line-height: 1.7;
  margin-bottom: 0;
}

.charge-actions {
  display: flex;
  flex-wrap: wrap;
  gap: 0.55rem;
}

.charge-stat {
  min-width: 8.5rem;
  padding: 0.85rem 1rem;
  border: 1px solid var(--ink-border);
  border-radius: var(--radius);
  background: var(--ink-soft);
  text-align: right;
}

.charge-stat__num {
  display: block;
  font-size: 1.75rem;
  font-weight: 800;
  letter-spacing: -0.03em;
  line-height: 1.1;
  color: var(--ink-text);
}

.charge-stat__label {
  display: block;
  margin-top: 0.25rem;
  font-size: 0.78rem;
  color: var(--ink-muted);
}

.charge-workspace {
  overflow: hidden;
}

.charge-workspace > .card-header {
  padding: 0.75rem 1rem;
}

/* 關鍵：固定工作區高度，避免列表把地圖撐到數萬 px */
.charge-layout {
  display: grid;
  grid-template-columns: 1fr;
  height: min(62dvh, 560px);
  min-height: 420px;
  position: relative;
  overflow: hidden;
}

.charge-panel {
  display: flex;
  flex-direction: column;
  background: var(--bg-surface);
  min-height: 0;
  height: 100%;
  overflow: hidden;
  position: relative;
  z-index: 2;
}

.charge-panel__toolbar {
  padding: 0.85rem;
  border-bottom: 1px solid var(--border);
  background: var(--bg-raised);
  position: relative;
  flex: 0 0 auto;
}

.charge-field {
  display: block;
}

.charge-area-filters {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 0.45rem;
}

.charge-area-filters .form-control:disabled {
  opacity: 0.55;
  cursor: not-allowed;
}

.charge-field .form-control {
  border-radius: var(--radius-sm);
  border-color: var(--border-strong);
  font-size: 0.92rem;
}

.charge-field .form-control:focus {
  border-color: var(--ink);
  box-shadow: 0 0 0 3px var(--focus-ring);
}

.charge-list {
  list-style: none;
  margin: 0;
  padding: 0.55rem;
  overflow: auto;
  flex: 1 1 auto;
  min-height: 0;
  display: grid;
  align-content: start;
  gap: 0.35rem;
  background: var(--bg-surface);
}

.charge-list-tip {
  padding: 0.75rem 0.85rem;
  font-size: 0.86rem;
  line-height: 1.45;
  color: var(--ink-muted);
}

.charge-list li button {
  width: 100%;
  text-align: left;
  border: 1px solid transparent;
  background: var(--bg-raised);
  color: inherit;
  border-radius: var(--radius-sm);
  padding: 0.65rem 0.75rem;
  cursor: pointer;
  font: inherit;
  transition: border-color .15s ease, background .15s ease;
}

.charge-list li button:hover,
.charge-list li button.active {
  border-color: var(--border-strong);
  background: #fff;
}

.charge-list .name {
  font-weight: 700;
  font-size: 0.92rem;
  color: var(--text-primary);
}

.charge-list .meta {
  margin-top: 0.15rem;
  color: var(--text-secondary);
  font-size: 0.8rem;
}

.charge-list .detail {
  margin-top: 0.28rem;
  color: var(--text-tertiary);
  font-size: 0.75rem;
  line-height: 1.45;
}

.charge-list .list-links {
  margin-top: 0.35rem;
}

.charge-list .list-links a {
  color: var(--text-primary);
  font-size: 0.78rem;
  font-weight: 600;
  text-decoration: underline;
}

.popup .popup-line {
  margin-top: 0.15rem;
  font-size: 0.8rem;
  color: var(--text-secondary);
  line-height: 1.4;
}

.charge-source {
  margin: 0;
  padding: 0.65rem 0.85rem 0.8rem;
  border-top: 1px solid var(--border);
  color: var(--text-tertiary);
  font-size: 0.72rem;
  line-height: 1.45;
  background: var(--bg-raised);
  flex: 0 0 auto;
}

.charge-map-pane {
  position: relative;
  min-height: 0;
  height: 100%;
  overflow: hidden;
  background: var(--bg-raised);
}

#map {
  position: absolute;
  inset: 0;
  z-index: 1;
  width: 100%;
  height: 100%;
}

.leaflet-container {
  font: inherit;
  width: 100% !important;
  height: 100% !important;
  background: #eef1f4;
}

.leaflet-control-attribution {
  background: rgba(255, 255, 255, 0.86) !important;
  color: var(--text-tertiary) !important;
  font-size: 10px !important;
}

.leaflet-control-attribution a {
  color: var(--text-secondary) !important;
}

.leaflet-bar a {
  border-bottom-color: var(--border) !important;
  color: var(--text-primary) !important;
}

.marker-dot {
  width: 12px;
  height: 12px;
  border-radius: 50%;
  background: var(--ink);
  border: 2px solid #fff;
  box-shadow: 0 0 0 2px rgba(22, 24, 29, 0.12), 0 2px 8px rgba(0, 0, 0, 0.16);
}

.charge-icon-btn {
  position: absolute;
  top: 0.55rem;
  right: 0.55rem;
  width: 1.85rem;
  height: 1.85rem;
  border-radius: 999px;
  border: 1px solid var(--border);
  background: #fff;
  color: var(--text-primary);
  font-size: 1.15rem;
  line-height: 1;
  cursor: pointer;
  z-index: 2;
}

.charge-fab {
  position: absolute;
  z-index: 3;
  left: 50%;
  bottom: 0.9rem;
  transform: translateX(-50%);
  border-radius: 999px;
  padding: 0.55rem 1rem;
  font-size: 0.9rem;
  font-weight: 600;
  box-shadow: 0 8px 22px rgba(22, 24, 29, 0.18);
}

.popup {
  font-family: inherit;
  color: var(--text-primary);
  min-width: 150px;
}

.popup strong {
  display: block;
  margin-bottom: 0.2rem;
  font-size: 0.92rem;
}

.popup-links {
  display: flex;
  flex-wrap: wrap;
  gap: 0.65rem;
  margin-top: 0.45rem;
}

.popup a {
  color: var(--text-primary);
  font-weight: 600;
  font-size: 0.85rem;
  text-decoration: underline;
}

@media (max-width: 767.98px) {
  .charge-layout {
    height: min(68dvh, 560px);
  }

  .charge-map-pane {
    grid-area: 1 / 1;
  }

  .charge-panel {
    position: absolute;
    inset: 0;
    z-index: 4;
    transform: translateY(104%);
    opacity: 0;
    pointer-events: none;
    transition: transform .24s ease, opacity .24s ease;
  }

  .charge-panel.open {
    transform: none;
    opacity: 1;
    pointer-events: auto;
  }

  .charge-panel__toolbar {
    padding-right: 2.6rem;
  }
}

@media (min-width: 768px) {
  .charge-layout {
    grid-template-columns: minmax(0, 1fr) minmax(260px, 320px);
    height: 560px;
  }

  .charge-panel {
    border-left: 1px solid var(--border);
    border-right: 0;
  }

  .charge-fab,
  #btnClosePanel {
    display: none !important;
  }
}

@media (min-width: 1200px) {
  .charge-layout {
    height: 600px;
  }
}
