:root {
  --bg: #08131f;
  --panel: rgba(12, 24, 36, 0.88);
  --text: #f4f7fb;
  --muted: #98a8b9;
  --danger: #ff3b30;
  --warning: #ff9800;
  --safe: #ffcc33;
  --good: #2fbf71;
  --line: rgba(255, 255, 255, 0.12);
}

* {
  box-sizing: border-box;
}

html, body {
  height: 100%;
  margin: 0;
}

body {
  background:
    radial-gradient(circle at top left, rgba(47, 191, 113, 0.18), transparent 28%),
    radial-gradient(circle at 80% 20%, rgba(255, 152, 0, 0.15), transparent 24%),
    linear-gradient(160deg, #06111b 0%, #0b1724 54%, #09131d 100%);
  color: var(--text);
  font-family: "Noto Sans TC", "Hiragino Sans", "Yu Gothic", sans-serif;
}

#app-shell {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  height: 100vh;
}

.panel {
  padding: 28px 24px;
  background: var(--panel);
  backdrop-filter: blur(16px);
  border-right: 1px solid var(--line);
  overflow: auto;
}

.eyebrow {
  font-size: 12px;
  letter-spacing: 0.22em;
  text-transform: uppercase;
  color: var(--muted);
  margin-bottom: 14px;
}

h1 {
  margin: 0 0 12px;
  font-size: 34px;
  line-height: 1.1;
}

.lead {
  margin: 0 0 20px;
  color: var(--muted);
  line-height: 1.7;
}

.legend {
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 16px;
  background: rgba(255, 255, 255, 0.04);
}

.legend-title {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 12px;
}

.legend-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 8px 0;
  border-top: 1px solid rgba(255, 255, 255, 0.06);
}

.legend-item:first-of-type {
  border-top: 0;
}

.swatch {
  width: 14px;
  height: 14px;
  border-radius: 999px;
  flex: 0 0 auto;
}

.swatch.danger { background: var(--danger); }
.swatch.warning { background: var(--warning); }
.swatch.safe { background: var(--safe); }
.swatch.good { background: var(--good); }

.source {
  margin-top: 18px;
  font-size: 13px;
  color: var(--muted);
}

#map {
  min-height: 100vh;
}

.base-tiles {
  filter: saturate(0.55) contrast(0.9) brightness(1.05);
  opacity: 0.72;
}

.label-tiles {
  filter: saturate(0.7) contrast(1.02);
  opacity: 0.88;
}

.contour-label {
  background: rgba(8, 19, 31, 0.8);
  color: #fff;
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 999px;
  padding: 1px 8px;
  box-shadow: none;
}

.risk-zone {
  pointer-events: none;
}

.coverage-boundary {
  pointer-events: none;
}

@media (max-width: 900px) {
  #app-shell {
    grid-template-columns: 1fr;
    grid-template-rows: auto minmax(0, 1fr);
  }

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

  #map {
    min-height: 60vh;
  }
}
