:root {
  color-scheme: light;
  --bg: #f4f6f7;
  --panel: #ffffff;
  --ink: #15202b;
  --muted: #657282;
  --line: #e3e8ee;
  --teal: #0f766e;
  --teal-dark: #115e59;
  --mint: #e7f8f1;
  --blue: #2563eb;
  --amber: #f59e0b;
  --shadow: 0 16px 45px rgba(16, 24, 40, 0.11);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--ink);
  font-family:
    Inter, -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
    sans-serif;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

.app-shell {
  min-height: 100vh;
  display: grid;
  grid-template-columns: minmax(420px, 0.95fr) minmax(440px, 1.05fr);
}

.map-pane {
  position: sticky;
  top: 0;
  height: 100vh;
  padding: 28px;
  overflow: hidden;
  background: #e8f3eb;
}

.map-topbar {
  position: relative;
  z-index: 3;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 18px;
  color: #17372a;
}

.eyebrow {
  margin: 0 0 6px;
  color: #5f7f6e;
  font-size: 13px;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
p {
  margin: 0;
}

h1 {
  font-size: 36px;
  line-height: 1.08;
}

.locate-btn,
.search-card button,
.submit-btn {
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 750;
}

.locate-btn {
  height: 42px;
  min-width: 82px;
  background: #fff;
  border: 1px solid #bfd8c6;
  color: #176b47;
}

.map-board {
  position: relative;
  height: calc(100vh - 116px);
  margin-top: 24px;
  border-radius: 8px;
  overflow: hidden;
  background: #dbe8dd;
  box-shadow: var(--shadow);
}

.amap-marker {
  display: grid;
  width: 36px;
  height: 36px;
  place-items: center;
  border: 3px solid #fff;
  border-radius: 50% 50% 50% 8px;
  color: #fff;
  font-size: 12px;
  font-weight: 800;
  transform: rotate(-45deg);
  box-shadow: 0 7px 18px rgba(23, 41, 34, 0.25);
}

.amap-marker--green { background: #18845a; }
.amap-marker--amber { background: #d39b2a; }
.amap-marker--orange { background: #d87556; }
.amap-marker--gray { background: #71877a; }

.amap-marker span {
  transform: rotate(45deg);
}

.amap-marker.is-selected {
  box-shadow: 0 0 0 5px rgba(245, 158, 11, 0.25), 0 7px 18px rgba(23, 41, 34, 0.25);
}

.amap-user-marker {
  display: block;
  width: 20px;
  height: 20px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 10px rgba(37, 99, 235, 0.18);
}

.map-status {
  position: absolute;
  z-index: 4;
  right: 40px;
  bottom: 42px;
  max-width: 280px;
  padding: 9px 12px;
  border: 1px solid rgba(23, 107, 71, 0.16);
  border-radius: 8px;
  background: rgba(255, 255, 255, 0.94);
  color: #355d49;
  font-size: 12px;
  line-height: 1.45;
  box-shadow: 0 8px 20px rgba(37, 69, 51, 0.12);
}

.street {
  position: absolute;
  background: rgba(255, 255, 255, 0.18);
  border-radius: 999px;
}

.street-a {
  width: 120%;
  height: 18px;
  left: -12%;
  top: 28%;
  transform: rotate(-18deg);
}

.street-b {
  width: 18px;
  height: 92%;
  left: 62%;
  top: 4%;
  transform: rotate(16deg);
}

.street-c {
  width: 95%;
  height: 14px;
  left: 8%;
  top: 68%;
  transform: rotate(12deg);
}

.park,
.station,
.mall {
  position: absolute;
  display: grid;
  place-items: center;
  border-radius: 8px;
  color: rgba(255, 255, 255, 0.88);
  font-size: 14px;
  font-weight: 700;
}

.park {
  width: 150px;
  height: 112px;
  left: 8%;
  bottom: 12%;
  background: rgba(34, 197, 94, 0.28);
}

.station {
  width: 108px;
  height: 78px;
  right: 12%;
  bottom: 25%;
  background: rgba(37, 99, 235, 0.32);
}

.mall {
  width: 126px;
  height: 96px;
  right: 15%;
  top: 14%;
  background: rgba(245, 158, 11, 0.3);
}

.user-dot {
  position: absolute;
  left: 48%;
  top: 50%;
  width: 18px;
  height: 18px;
  border: 4px solid #fff;
  border-radius: 50%;
  background: var(--blue);
  box-shadow: 0 0 0 14px rgba(37, 99, 235, 0.18);
}

.marker {
  position: absolute;
  width: 36px;
  height: 36px;
  border: 0;
  border-radius: 50% 50% 50% 8px;
  background: #fff;
  color: var(--teal-dark);
  transform: rotate(-45deg);
  box-shadow: 0 8px 22px rgba(0, 0, 0, 0.22);
}

.marker span {
  display: grid;
  place-items: center;
  width: 100%;
  height: 100%;
  transform: rotate(45deg);
  font-size: 12px;
  font-weight: 900;
}

.marker.is-selected {
  background: #fbbf24;
}

.list-pane {
  padding: 28px 28px 36px;
  overflow: auto;
}

.search-card {
  display: grid;
  grid-template-columns: 1fr 132px;
  gap: 12px;
  position: sticky;
  top: 0;
  z-index: 5;
  padding-bottom: 18px;
  background: linear-gradient(var(--bg) 76%, rgba(244, 246, 247, 0));
}

.search-card input,
select,
.report-card input:not([type="checkbox"]):not([type="range"]),
.report-card textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: var(--ink);
  outline: none;
}

.search-card input {
  height: 48px;
  padding: 0 16px;
}

.search-card button {
  height: 48px;
}

.filters {
  display: flex;
  gap: 10px;
  overflow-x: auto;
  padding-bottom: 16px;
}

.filter {
  flex: 0 0 auto;
  min-height: 38px;
  padding: 0 14px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: #fff;
  color: #334155;
}

.filter.is-active {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.summary-row {
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 18px;
  margin: 6px 0 18px;
}

.summary-row h2 {
  font-size: 24px;
}

.summary-row p {
  margin-top: 5px;
  color: var(--muted);
  font-size: 14px;
}

select {
  width: 116px;
  height: 38px;
  padding: 0 10px;
}

.toilet-list {
  display: grid;
  gap: 14px;
}

.card {
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
  padding: 18px;
  box-shadow: 0 10px 26px rgba(16, 24, 40, 0.06);
}

.card-top {
  display: flex;
  justify-content: space-between;
  gap: 16px;
}

.name {
  font-size: 18px;
  font-weight: 850;
}

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

.score-pill {
  width: 70px;
  height: 58px;
  border-radius: 8px;
  background: var(--mint);
  color: var(--teal-dark);
  display: grid;
  place-items: center;
  flex-shrink: 0;
  font-weight: 900;
}

.tags {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 13px;
}

.tag {
  padding: 5px 9px;
  border-radius: 6px;
  background: #eef2ff;
  color: #3730a3;
  font-size: 12px;
  font-weight: 650;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 14px;
  margin-top: 12px;
  color: var(--muted);
  font-size: 13px;
}

.card-actions {
  display: flex;
  gap: 10px;
  margin-top: 14px;
}

.card-actions button {
  height: 36px;
  padding: 0 13px;
  border-radius: 8px;
  border: 1px solid var(--line);
  background: #fff;
  color: #334155;
}

.card-actions button:first-child {
  border-color: var(--teal);
  background: var(--teal);
  color: #fff;
}

.detail-drawer,
.report-drawer {
  position: fixed;
  inset: 0;
  z-index: 30;
  display: none;
  align-items: center;
  justify-content: center;
  padding: 20px;
  background: rgba(15, 23, 42, 0.52);
}

.detail-drawer.is-open,
.report-drawer.is-open {
  display: flex;
}

.drawer-card {
  position: relative;
  width: min(560px, 100%);
  max-height: min(760px, 92vh);
  overflow: auto;
  border-radius: 8px;
  background: #fff;
  padding: 26px;
  box-shadow: var(--shadow);
}

.close-btn {
  position: absolute;
  top: 12px;
  right: 12px;
  width: 34px;
  height: 34px;
  border: 0;
  border-radius: 50%;
  background: #f1f5f9;
  color: #334155;
  font-size: 24px;
  line-height: 1;
}

.drawer-title {
  padding-right: 34px;
  font-size: 26px;
  line-height: 1.2;
}

.drawer-address {
  margin-top: 9px;
  color: var(--muted);
}

.metric-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  margin: 22px 0;
}

.metric {
  min-height: 86px;
  border-radius: 8px;
  background: #f8fafc;
  display: grid;
  place-items: center;
  text-align: center;
}

.metric strong {
  display: block;
  color: var(--teal-dark);
  font-size: 24px;
}

.metric span {
  color: var(--muted);
  font-size: 12px;
}

.drawer-note {
  padding: 16px;
  border-radius: 8px;
  background: #fffbeb;
  color: #713f12;
  line-height: 1.6;
}

.drawer-actions {
  display: flex;
  gap: 12px;
  margin-top: 18px;
}

.drawer-actions button {
  flex: 1;
  min-height: 44px;
  border: 0;
  border-radius: 8px;
  background: var(--teal);
  color: #fff;
  font-weight: 800;
}

.drawer-actions button:last-child {
  background: #eef2f7;
  color: #334155;
}

.report-card h2 {
  margin: 0;
  font-size: 24px;
}

.form-hint {
  margin: 8px 0 18px;
  color: var(--muted);
  line-height: 1.5;
}

.report-card label,
fieldset {
  display: grid;
  gap: 8px;
  margin: 0 0 16px;
  color: #263241;
  font-weight: 760;
}

.report-card input:not([type="checkbox"]):not([type="range"]) {
  height: 42px;
  padding: 0 12px;
}

.report-card textarea {
  min-height: 86px;
  resize: vertical;
  padding: 12px;
}

fieldset {
  grid-template-columns: repeat(2, minmax(0, 1fr));
  border: 1px solid var(--line);
  border-radius: 8px;
  padding: 14px;
}

legend {
  padding: 0 6px;
}

fieldset label {
  display: flex;
  align-items: center;
  gap: 8px;
  margin: 0;
  font-weight: 500;
}

.submit-btn {
  width: 100%;
  height: 46px;
}

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

@media (max-width: 860px) {
  .app-shell {
    display: block;
  }

  .map-pane {
    position: relative;
    height: 44vh;
    padding: 18px;
  }

  .map-board {
    height: calc(44vh - 90px);
  }

  .map-status {
    right: 28px;
    bottom: 28px;
    max-width: 230px;
  }

  h1 {
    font-size: 28px;
  }

  .list-pane {
    padding: 18px 16px 28px;
  }

  .search-card {
    grid-template-columns: 1fr;
  }

  .summary-row {
    align-items: flex-start;
    flex-direction: column;
  }

  select {
    width: 100%;
  }
}

@media (max-width: 480px) {
  .map-topbar {
    align-items: flex-start;
  }

  .locate-btn {
    min-width: 70px;
  }

  .metric-grid {
    grid-template-columns: 1fr;
  }

  fieldset {
    grid-template-columns: 1fr;
  }
}
