:root {
  color-scheme: light;
  font-family: "Noto Sans TC", "Microsoft JhengHei", Arial, sans-serif;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: #0f172a;
  color: #e2e8f0;
}

#app {
  height: 100dvh;
  display: grid;
  grid-template-rows: auto 1fr auto;
}

.topbar {
  display: flex;
  justify-content: space-between;
  gap: 8px;
  padding: 12px 14px;
  background: #111827;
  border-bottom: 1px solid #1f2937;
}

.badge {
  font-size: 12px;
  padding: 2px 8px;
  border-radius: 999px;
  background: #1d4ed8;
}

#map {
  width: 100%;
  height: 100%;
  min-height: 300px;
  position: relative;
}

.year-overlay {
  position: absolute;
  top: 8px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 1000;
  background: rgba(15, 23, 42, 0.78);
  color: #93c5fd;
  font-size: 12px;
  padding: 3px 10px;
  border-radius: 999px;
  pointer-events: none;
  white-space: nowrap;
  display: none;
}

.year-overlay.visible {
  display: block;
}

.floating-fs-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 1100;
  width: 42px;
  height: 42px;
  border-radius: 999px;
  border: 1px solid #334155;
  background: rgba(15, 23, 42, 0.85);
  color: #e2e8f0;
  font-size: 20px;
  line-height: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 0;
}

.floating-fs-btn.active {
  border-color: #2563eb;
  background: rgba(30, 64, 175, 0.85);
}

.panel {
  padding: 8px 12px 8px;
  background: rgba(2, 6, 23, 0.97);
  border-top: 1px solid #1f2937;
  max-height: 22dvh;
  overflow: auto;
}

body.fullscreen-mode #app {
  grid-template-rows: 1fr;
}

body.fullscreen-mode .topbar,
body.fullscreen-mode .panel {
  display: none;
}

body.fullscreen-mode #map {
  min-height: 100dvh;
}

.row {
  display: grid;
  gap: 6px;
  margin-bottom: 6px;
}

.compact-row {
  margin-bottom: 6px;
}

label {
  font-size: 14px;
}

input[type="text"] {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #111827;
  color: #e2e8f0;
  padding: 8px 10px;
  font-size: 14px;
}

select {
  width: 100%;
  border-radius: 8px;
  border: 1px solid #334155;
  background: #111827;
  color: #e2e8f0;
  padding: 8px 10px;
  font-size: 14px;
}

input[type="range"] {
  width: 100%;
}

.actions {
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}

.actions.three {
  grid-template-columns: 1fr 1fr 1fr;
}

button {
  border: 1px solid #2563eb;
  background: #2563eb;
  color: #fff;
  border-radius: 8px;
  padding: 8px 10px;
  font-size: 14px;
  white-space: nowrap;
}

button.secondary {
  border-color: #475569;
  background: #334155;
}

.inline-actions {
  display: grid;
  grid-template-columns: 1fr auto auto;
  gap: 8px;
}

.query-info {
  border: 1px solid #334155;
  border-radius: 8px;
  background: #111827;
  color: #cbd5e1;
  padding: 10px;
  font-size: 13px;
  line-height: 1.4;
}

.two-col {
  grid-template-columns: 1fr 1fr;
  gap: 10px;
}

.list-box {
  min-height: 88px;
  max-height: 140px;
  overflow: auto;
  border: 1px solid #334155;
  border-radius: 8px;
  background: #111827;
  padding: 8px;
}

.list-item {
  display: grid;
  grid-template-columns: 1fr auto auto;
  align-items: center;
  gap: 6px;
  margin-bottom: 6px;
  font-size: 12px;
}

.list-item:last-child {
  margin-bottom: 0;
}

.list-item button {
  padding: 4px 8px;
  font-size: 12px;
}

.status {
  margin-top: 2px;
  font-size: 12px;
  color: #93c5fd;
  min-height: 18px;
}

.network {
  font-size: 12px;
  color: #cbd5e1;
}

.advanced-panel {
  border: 1px solid #334155;
  border-radius: 8px;
  padding: 8px;
  margin-bottom: 10px;
  background: #0b1220;
}

.advanced-panel > summary {
  cursor: pointer;
  font-size: 13px;
  color: #93c5fd;
  margin-bottom: 8px;
}

.advanced-panel[open] > summary {
  margin-bottom: 10px;
}

@media (max-width: 900px) {
  .two-col {
    grid-template-columns: 1fr;
  }
}
