:root {
  color-scheme: light;
  --bg: #f6f3ee;
  --panel: #ffffff;
  --text: #202124;
  --muted: #6f6a60;
  --line: #ded8ce;
  --accent: #0f766e;
  --accent-dark: #114f49;
  --gold: #b7791f;
  --shadow: 0 18px 45px rgba(54, 45, 35, 0.1);
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  min-height: 100vh;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Noto Sans TC", sans-serif;
}

.topbar {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 24px;
  padding: 32px clamp(18px, 4vw, 56px) 24px;
  border-bottom: 1px solid var(--line);
  background: #fbfaf7;
}

.eyebrow {
  margin: 0 0 6px;
  color: var(--gold);
  font-size: 12px;
  font-weight: 800;
  letter-spacing: 0;
  text-transform: uppercase;
}

h1,
h2,
h3,
p {
  margin-top: 0;
}

h1 {
  margin-bottom: 0;
  font-size: clamp(28px, 4vw, 46px);
  line-height: 1.08;
}

.metrics {
  display: grid;
  grid-template-columns: repeat(3, minmax(82px, 1fr));
  gap: 10px;
  min-width: min(100%, 330px);
}

.metrics div {
  border: 1px solid var(--line);
  background: var(--panel);
  padding: 12px 14px;
}

.metrics strong {
  display: block;
  font-size: 24px;
  line-height: 1;
}

.metrics span {
  color: var(--muted);
  font-size: 13px;
}

.layout {
  display: grid;
  grid-template-columns: 310px minmax(0, 1fr);
  align-items: start;
  gap: 24px;
  padding: 24px clamp(18px, 4vw, 56px) 48px;
}

.filters {
  position: sticky;
  top: 16px;
  display: grid;
  gap: 22px;
  padding: 18px;
  border: 1px solid var(--line);
  background: var(--panel);
  box-shadow: var(--shadow);
}

.filters h2 {
  margin-bottom: 10px;
  font-size: 15px;
}

.search {
  display: grid;
  gap: 8px;
  color: var(--muted);
  font-size: 13px;
  font-weight: 700;
}

input,
select {
  width: 100%;
  min-height: 42px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  font: inherit;
}

input[type="checkbox"] {
  width: 16px;
  min-height: 16px;
  margin: 0;
}

input {
  padding: 0 12px;
}

select {
  max-width: 160px;
  padding: 0 10px;
}

.filterGroup {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}

.filterGroup.compact {
  max-height: 310px;
  overflow: auto;
  padding-right: 3px;
}

.chip {
  border: 1px solid var(--line);
  border-radius: 999px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  min-height: 34px;
  padding: 0 11px;
}

.chip.active {
  border-color: var(--accent);
  background: var(--accent);
  color: #fff;
}

.deleteTools {
  display: grid;
  gap: 10px;
}

.toggleRow {
  display: flex;
  align-items: center;
  gap: 9px;
  color: var(--text);
  font-size: 14px;
}

.secondaryButton {
  min-height: 36px;
  border: 1px solid var(--line);
  border-radius: 6px;
  background: #fff;
  color: var(--text);
  cursor: pointer;
  font: inherit;
  font-size: 13px;
  font-weight: 800;
}

.secondaryButton:disabled {
  cursor: not-allowed;
  opacity: 0.48;
}

.helperText {
  margin: 0;
  color: var(--muted);
  font-size: 12px;
}

.content {
  min-width: 0;
}

.contentHeader {
  display: flex;
  align-items: end;
  justify-content: space-between;
  gap: 18px;
  margin-bottom: 18px;
}

.contentHeader h2 {
  margin-bottom: 0;
  font-size: 24px;
}

.placeGroups {
  display: grid;
  gap: 22px;
}

.group {
  display: grid;
  gap: 10px;
}

.groupHeader {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding-bottom: 6px;
  border-bottom: 1px solid var(--line);
}

.groupHeader h3 {
  margin-bottom: 0;
  font-size: 18px;
}

.groupHeader span {
  color: var(--muted);
  font-size: 13px;
}

.placeList {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(280px, 1fr));
  gap: 12px;
}

.placeCard {
  display: grid;
  gap: 12px;
  min-height: 196px;
  padding: 16px;
  border: 1px solid var(--line);
  border-radius: 8px;
  background: var(--panel);
}

.placeCard.deleted {
  opacity: 0.58;
}

.placeCard.deleted h4,
.placeCard.deleted .address {
  text-decoration: line-through;
}

.placeCard h4 {
  margin: 0;
  font-size: 17px;
  line-height: 1.35;
}

.meta {
  display: flex;
  flex-wrap: wrap;
  gap: 7px;
}

.pill {
  display: inline-flex;
  align-items: center;
  min-height: 25px;
  padding: 0 8px;
  border-radius: 999px;
  background: #f0ebe2;
  color: #51483e;
  font-size: 12px;
}

.address,
.note {
  margin: 0;
  color: var(--muted);
  font-size: 13px;
  line-height: 1.5;
}

.note {
  color: var(--accent-dark);
  white-space: pre-line;
}

.actions {
  display: flex;
  gap: 8px;
  align-self: end;
}

.actions a,
.actions button {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-height: 36px;
  border-radius: 6px;
  padding: 0 12px;
  color: #fff;
  background: var(--accent);
  text-decoration: none;
  font-size: 13px;
  font-weight: 800;
}

.actions button {
  border: 1px solid var(--line);
  cursor: pointer;
  font: inherit;
}

.deleteButton {
  background: #fff;
  color: #9f1239;
}

.restoreButton {
  background: #fff7ed;
  color: #9a3412;
}

.empty {
  padding: 48px 18px;
  border: 1px dashed var(--line);
  background: rgba(255, 255, 255, 0.65);
  color: var(--muted);
  text-align: center;
}

@media (max-width: 880px) {
  .topbar,
  .contentHeader {
    align-items: stretch;
    flex-direction: column;
  }

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

  .filters {
    position: static;
  }

  .metrics {
    width: 100%;
  }
}

@media (max-width: 520px) {
  .topbar,
  .layout {
    padding-left: 14px;
    padding-right: 14px;
  }

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

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