:root {
  color-scheme: light;
  font-family: "Microsoft YaHei", "PingFang SC", system-ui, sans-serif;
  color: #142f3c;
  background: #eef2f3;
  --ink: #142f3c; --muted: #496371; --line: #dae4e6;
  --teal: #08675e; --teal-soft: #e4f4ef; --amber: #a35a05; --amber-soft: #fff1db;
}
* { box-sizing: border-box; }
body { margin: 0; min-width: 300px; }
[hidden] { display: none !important; }
button, input, select { font: inherit; }
button, select, a { -webkit-tap-highlight-color: transparent; }
button { cursor: pointer; }
button, a, select, input { outline-offset: 4px; }
button:focus-visible, a:focus-visible, select:focus-visible, input:focus-visible { outline: 2px solid #087d70; }
h1, h2, p { margin: 0; }
a { color: var(--teal); }
.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.masthead { height: 74px; display: flex; align-items: center; justify-content: space-between; gap: 16px; padding: 0 27px; background: #102a36; color: #fff; }
.brand { display: flex; align-items: center; gap: 13px; }
.brand-mark { width: 39px; height: 39px; display: grid; place-items: center; border-radius: 12px; background: #1d4b55; flex: none; }
.brand-mark span { width: 18px; height: 18px; border: 2px solid #a2ead3; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); position: relative; }
.brand-mark span::after { content: ""; width: 5px; height: 5px; border-radius: 50%; background: #a2ead3; position: absolute; left: 4.5px; top: 4.5px; }
h1 { font-size: clamp(1.14rem, 2.6vw, 1.48rem); letter-spacing: .015em; }
.total { font-size: .875rem; color: #e5f0f2; white-space: nowrap; background: #1b3a47; border: 1px solid #36535e; border-radius: 20px; padding: 7px 13px; }
.layout { display: grid; grid-template-columns: minmax(305px, 380px) minmax(0, 1fr); height: calc(100vh - 74px); height: calc(100dvh - 74px); min-height: 480px; }
.directory { background: #fff; border-right: 1px solid var(--line); display: flex; flex-direction: column; min-height: 0; min-width: 0; z-index: 2; }
.directory-controls { padding: 21px 20px 13px; }
.directory-controls h2 { font-size: 1.125rem; margin-bottom: 13px; }
.search { display: flex; position: relative; align-items: center; min-height: 47px; }
.search input { width: 100%; min-width: 0; height: 47px; background: #f3f7f7; border: 1px solid #cddddd; border-radius: 10px; padding: 10px 39px 10px 40px; color: var(--ink); }
.search input::-webkit-search-cancel-button { display: none; }
.search-symbol { position: absolute; top: 15px; left: 15px; width: 14px; height: 14px; border: 2px solid #57727b; border-radius: 50%; pointer-events: none; }
.search-symbol::after { content: ""; position: absolute; width: 6px; height: 2px; background: #57727b; transform: rotate(45deg); right: -5px; bottom: -3px; border-radius: 1px; }
.clear-button, .close-button { border: 0; border-radius: 8px; color: var(--muted); background: transparent; display: grid; place-items: center; width: 36px; height: 36px; font-size: 1.45rem; line-height: 1; }
.clear-button { position: absolute; right: 5px; }
.clear-button:hover, .close-button:hover { background: #e9f0f0; }
.filters { margin-top: 11px; display: grid; grid-template-columns: 1fr 1fr; gap: 9px; }
select { width: 100%; appearance: none; color: var(--ink); padding: 9px 32px 9px 11px; min-height: 39px; background-color: #fff; background-image: linear-gradient(45deg,transparent 50%,#557078 50%),linear-gradient(135deg,#557078 50%,transparent 50%); background-position: calc(100% - 15px) 50%,calc(100% - 10px) 50%; background-size: 5px 5px; background-repeat: no-repeat; border: 1px solid #d3e0e2; border-radius: 8px; font-size: .875rem; }
.list-heading { padding: 8px 20px 10px; display: flex; align-items: center; justify-content: space-between; gap: 8px; color: var(--muted); font-size: .875rem; border-bottom: 1px solid var(--line); }
.text-button { color: var(--teal); background: none; border: 0; padding: 4px 0; font-size: .875rem; font-weight: 650; text-decoration: none; }
.text-button:hover { text-decoration: underline; }
.results { overflow: auto; overscroll-behavior-y: contain; scrollbar-gutter: stable; padding: 6px 11px 14px; }
.result { width: 100%; display: grid; grid-template-columns: 39px minmax(0,1fr); align-items: start; gap: 10px; padding: 12px 8px; background: #fff; border: 1px solid transparent; border-bottom-color: #edf2f3; border-radius: 8px; text-align: left; color: var(--ink); }
.result:hover { background: #f2f8f7; }
.result[aria-pressed="true"] { background: #e9f6f2; border-color: #a8d6ca; }
.number { align-self: start; display: grid; place-items: center; height: 31px; font-size: .8125rem; font-weight: 700; font-variant-numeric: tabular-nums; color: #4b6773; border-radius: 7px; background: #edf3f4; }
.result-title { display: block; line-height: 1.43; font-size: .9375rem; font-weight: 680; }
.result-address { display: block; margin: 4px 0 7px; color: var(--muted); overflow: hidden; white-space: nowrap; text-overflow: ellipsis; font-size: .875rem; }
.result-meta, .detail-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px 8px; color: var(--muted); font-size: .875rem; }
.tag { display: inline-flex; align-items: center; font-weight: 650; line-height: 1.3; padding: 3px 7px; border-radius: 5px; font-size: .8125rem; white-space: nowrap; }
.tag.reference { color: #844800; background: var(--amber-soft); }
.tag.confirmed { color: #075b4f; background: var(--teal-soft); }
.tag.missing { color: #4d5d65; background: #edf1f2; }
.no-results { padding: 18px 20px; color: var(--muted); line-height: 1.5; }
.map-region { position: relative; isolation: isolate; background: #dbe9e7; min-width: 0; min-height: 0; }
.map { position: absolute; inset: 0; background: #dae8e7; z-index: 0; font-family: inherit; }
.map-tools { position: absolute; top: 14px; right: 14px; z-index: 500; display: flex; align-items: center; gap: 7px; }
.map-button, .map-legend { min-height: 36px; background: #fff; border: 1px solid #ccdcdf; border-radius: 8px; padding: 7px 9px; box-shadow: 0 3px 12px #18333f1c; font-size: .875rem; color: var(--ink); }
.map-button { font-weight: 650; }
.map-button:hover { background: #eef8f6; }
.map-legend { display: flex; align-items: center; gap: 6px; white-space: nowrap; }
.legend-dot { width: 9px; height: 9px; border-radius: 50%; display: inline-block; }
.legend-dot.confirmed { background: #097268; }
.legend-dot.reference { background: #b87721; margin-left: 4px; }
.marker-root { border: 0; background: transparent; }
.pin { display: block; width: 18px; height: 18px; border: 2px solid white; border-radius: 50%; background: #a85f0b; box-shadow: 0 1px 5px #102a3678; margin: 3px auto; }
.pin.confirmed { background: #087368; }
.pin.active { width: 26px; height: 26px; margin: -1px auto; outline: 3px solid #163d48; background: #163d48; }
.cluster-pin { display: grid; place-items: center; width: 31px; height: 31px; color: #fff; background: #355e68; border: 2px solid #fff; border-radius: 50%; font-weight: 750; font-size: .875rem; box-shadow: 0 1px 5px #102a3680; }
.leaflet-popup-content { line-height: 1.5; max-height: 188px; overflow: auto; min-width: 150px; }
.cluster-item { display: block; width: 100%; border: 0; border-bottom: 1px solid var(--line); background: transparent; text-align: left; padding: 8px 0; color: var(--teal); }
.tile-notice, .pick-banner { z-index: 550; position: absolute; top: 59px; right: 14px; left: 55px; margin-left: auto; width: fit-content; max-width: calc(100% - 69px); padding: 10px 13px; background: #fff6e6; border-radius: 8px; border: 1px solid #ebcc97; color: #593d16; font-size: .875rem; }
.pick-banner { display: flex; gap: 14px; align-items: center; color: #154638; border-color: #b5d8ce; background: #edf9f3; }
.map-region.picking .leaflet-container, .map-region.picking .leaflet-marker-icon { cursor: crosshair; }
.detail { position: absolute; z-index: 501; bottom: 24px; right: 17px; width: min(402px, calc(100% - 34px)); max-height: calc(100% - 84px); overflow: auto; background: #fff; border: 1px solid #ccdadd; border-radius: 13px; box-shadow: 0 8px 30px #12304036; padding: 13px 17px 14px; }
.detail-heading { display: flex; align-items: center; justify-content: space-between; gap: 5px; }
.detail h2 { font-size: 1.125rem; line-height: 1.45; }
.detail .close-button { margin: -3px -6px 0 0; flex: none; }
.company-address { margin-top: 6px; line-height: 1.55; font-size: .9375rem; color: #35515d; }
.point-label { margin-top: 9px; font-size: .875rem; color: var(--teal); font-weight: 650; }
.point-note { margin-top: 6px; color: var(--muted); line-height: 1.45; font-size: .875rem; }
.detail-actions, .edit-actions { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 13px; }
.button { display: inline-flex; align-items: center; justify-content: center; min-height: 42px; border: 1px solid transparent; border-radius: 8px; padding: 8px 13px; text-decoration: none; font-weight: 700; font-size: .9375rem; }
.primary { background: #08675e; color: #fff; }
.primary:hover { background: #064e47; }
.secondary { border-color: #ccdedf; color: #17564f; background: #f5f9f8; }
.secondary:hover { background: #e6f4ef; }
.detail-links { display: flex; flex-wrap: wrap; align-items: center; gap: 4px 14px; min-height: 0; margin-top: 6px; font-size: .875rem; }
.location-confirm { margin-left: auto; padding: 5px 2px; color: var(--muted); font-weight: 500; }
.nearby-companies { font-size: .875rem; margin: 8px 0 0; padding: 0; list-style: none; display: flex; flex-wrap: wrap; gap: 5px 12px; }
.nearby-companies button { text-align: left; }
dialog { width: min(460px, calc(100vw - 28px)); padding: 20px; border: 1px solid #bfd5d9; border-radius: 14px; color: var(--ink); box-shadow: 0 12px 55px #132f4750; }
dialog::backdrop { background: #122b3990; }
.dialog-heading { display: flex; justify-content: space-between; gap: 12px; margin-bottom: 15px; }
.dialog-heading h2 { font-size: 1.18rem; }
.dialog-heading p { color: var(--muted); margin-top: 5px; font-size: .9rem; }
#edit-form label { display: block; color: #365263; margin: 10px 0 5px; font-size: .875rem; font-weight: 650; }
#edit-form input { width: 100%; min-height: 42px; padding: 8px 10px; border: 1px solid #ccd9df; border-radius: 8px; color: var(--ink); }
.error { margin-top: 10px; color: #942916; font-size: .875rem; }
.edit-note { margin-top: 12px; color: var(--muted); font-size: .875rem; line-height: 1.5; }
.restore { margin-top: 10px; }
.toast { position: fixed; z-index: 9999; bottom: 18px; left: 50%; max-width: calc(100vw - 22px); transform: translateX(-50%); background: #152f3d; color: white; padding: 10px 15px; border-radius: 9px; text-align: center; font-size: .875rem; }
@media (max-width: 720px) {
  .masthead { height: 59px; padding: 0 12px; gap: 7px; }
  .brand { gap: 8px; }
  .brand-mark { width: 31px; height: 31px; border-radius: 9px; }
  .total { font-size: .75rem; padding: 5px 6px; }
  .layout { display: flex; flex-direction: column; height: auto; min-height: 0; }
  .directory { border-right: 0; border-bottom: 1px solid var(--line); }
  .directory-controls { padding: 12px 13px 6px; }
  .directory-controls h2 { font-size: 1rem; margin-bottom: 8px; }
  .list-heading { padding: 5px 13px 6px; }
  .results { max-height: 178px; padding: 3px 9px 7px; }
  .result { padding: 8px; }
  .map-region { height: 59vh; height: 59svh; min-height: 390px; }
  .map-tools { top: 11px; right: 8px; }
  .detail { right: 8px; bottom: 22px; width: calc(100% - 16px); padding: 9px 12px; max-height: calc(100% - 73px); }
  .detail-heading { min-height: 29px; }
  .detail h2 { font-size: 1rem; }
  .point-note { font-size: .875rem; }
}
@media (prefers-reduced-motion: reduce) { * { scroll-behavior: auto !important; } }


.header-actions { display: flex; align-items: center; gap: 10px; }
.city-switch { display: inline-flex; align-items: center; justify-content: center; min-height: 36px; padding: 6px 10px; color: #e7f4f3; border: 1px solid #527079; border-radius: 8px; white-space: nowrap; text-decoration: none; font-size: .875rem; }
.city-switch:hover { background: #23414b; }
.city-switch:focus-visible { outline-color: #a2ead3; }
.province-home { background: #edf3f4; min-height: 100vh; }
.city-main { max-width: 1120px; margin: 0 auto; padding: 44px 26px 48px; }
.city-heading { margin-bottom: 24px; }
.city-heading h2 { font-size: clamp(1.6rem, 3.5vw, 2.2rem); color: #153441; }
.city-heading p { margin-top: 8px; color: var(--muted); line-height: 1.55; }
.city-grid { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; list-style: none; padding: 0; margin: 0; }
.city-card { display: flex; flex-direction: column; align-items: flex-start; min-height: 114px; justify-content: center; gap: 10px; padding: 15px 18px; background: #fff; border: 1px solid #cbdcde; border-radius: 12px; color: var(--ink); text-decoration: none; }
.city-card strong { font-size: 1.14rem; }
.city-card:hover { border-color: #6a9f98; background: #f7fcfb; }
.city-ready { border-color: #64aa9e; background: #e3f4ef; }
.city-status { color: var(--muted); font-size: .875rem; }
.city-ready .city-status { color: var(--teal); font-weight: 650; }
@media (max-width: 860px) { .city-grid { grid-template-columns: repeat(3, minmax(0,1fr)); } }
@media (max-width: 540px) {
  .city-main { padding: 26px 13px 30px; }
  .city-grid { grid-template-columns: repeat(2, minmax(0,1fr)); gap: 10px; }
  .city-card { padding: 10px 12px; min-height: 81px; gap: 5px; border-radius: 9px; }
  .city-heading { margin-bottom: 16px; }
  .map-header .total { display: none; }
  .city-switch { min-height: 32px; padding: 4px 7px; }
}

