/* 温哥华厕所地图：浅灰蓝底、深青色强调（结构沿用樱花地图的 styles.css） */
:root {
  --bg: #F4F8F9;
  --surface: #FFFFFF;
  --accent: #1D6A86;
  --accent-strong: #134A5E;
  --accent-soft: #DCEEF4;
  --text: #1C2B33;
  --muted: #4E5D66;
  --line: #DCE5E9;
  --ok: #2F7A4F;
  --bad: #A2311F;
  --warn: #8A5A00;
  --tabbar-h: 60px;
  --radius: 14px;
  --content-w: 640px;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Noto Sans SC", "Hiragino Kaku Gothic ProN", "Microsoft YaHei", sans-serif;
}

* { box-sizing: border-box; }
html, body { margin: 0; height: 100%; background: var(--bg); color: var(--text); }
body { display: flex; flex-direction: column; -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
[hidden] { display: none !important; }
a { color: var(--accent-strong); }
.muted { color: var(--muted); }
.small { font-size: 13px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; }

.pages { flex: 1; min-height: 0; display: flex; }
.page { flex: 1; min-height: 0; min-width: 0; }

/* ---------- 演示横幅 ---------- */
.demo-bar { display: flex; flex-wrap: wrap; align-items: center; justify-content: space-between; gap: 6px 12px; padding: calc(6px + env(safe-area-inset-top)) 12px 6px; background: #FFF4D6; color: #5C4300; font-size: 12px; border-bottom: 1px solid #F0DFA8; }
.demo-bar a { color: #5C4300; font-weight: 600; }

/* ---------- 地图页 ---------- */
.map-page { display: flex; flex-direction: column; }
.map-wrap { position: relative; flex: 1; min-height: 0; }
#map { position: absolute; inset: 0; background: #EEF2F3; }

.map-top { position: absolute; left: 12px; right: 12px; top: calc(10px + env(safe-area-inset-top)); display: flex; gap: 8px; z-index: 3; }
.search-pill { flex: 1; min-width: 0; height: 46px; display: flex; align-items: center; gap: 8px; padding: 0 14px; background: var(--surface); border-radius: 999px; box-shadow: 0 2px 10px rgba(28,43,51,.14); color: var(--muted); }
.search-pill input { flex: 1; min-width: 0; border: 0; outline: none; background: transparent; font-size: 15px; color: var(--text); }
.mbtn { position: relative; width: 46px; height: 46px; flex: none; border: 0; border-radius: 999px; background: var(--surface); color: var(--text); display: grid; place-items: center; box-shadow: 0 2px 10px rgba(28,43,51,.14); cursor: pointer; }
.mbtn-code { position: absolute; bottom: 4px; right: 5px; font-size: 9px; font-weight: 700; color: var(--accent-strong); }
.mbtn.locate { position: absolute; right: 12px; top: calc(118px + env(safe-area-inset-top)); z-index: 3; }

.map-chips { position: absolute; left: 0; right: 0; top: calc(64px + env(safe-area-inset-top)); z-index: 3; display: flex; gap: 8px; overflow-x: auto; padding: 0 12px 4px; scrollbar-width: none; }
.map-chips::-webkit-scrollbar { display: none; }
.map-chips .chip { box-shadow: 0 1px 4px rgba(28,43,51,.12); }
.kind-chip { display: inline-flex; align-items: center; gap: 6px; }
.chip-n { font-size: 12px; color: var(--muted); font-weight: 400; }
.kind-chip[aria-pressed="true"] { border-color: var(--c); background: color-mix(in srgb, var(--c) 12%, #fff); color: var(--text); }
.area-chip { background: var(--text); color: #fff; border-color: var(--text); }

.map-legend { position: absolute; left: 12px; bottom: 76px; z-index: 2; margin: 0; display: flex; flex-wrap: wrap; gap: 4px 10px; max-width: calc(100% - 24px); padding: 6px 10px; background: rgba(255,255,255,.92); border-radius: 10px; font-size: 12px; color: var(--muted); }
.map-legend > span { display: inline-flex; align-items: center; gap: 4px; }
.nearest-btn { position: absolute; left: 50%; bottom: 18px; transform: translateX(-50%); z-index: 3; min-height: 48px; padding: 0 22px; border: 0; border-radius: 999px; background: var(--accent-strong); color: #fff; font-size: 16px; font-weight: 700; box-shadow: 0 4px 16px rgba(19,74,94,.35); cursor: pointer; white-space: nowrap; }

.loading { position: absolute; left: 50%; top: 45%; transform: translate(-50%, -50%); z-index: 4; background: #fff; padding: 10px 16px; border-radius: 999px; box-shadow: 0 2px 10px rgba(0,0,0,.12); font-size: 14px; }
.map-error { position: absolute; left: 12px; right: 12px; top: calc(110px + env(safe-area-inset-top)); z-index: 4; background: var(--surface); padding: 12px 14px; border-radius: var(--radius); box-shadow: 0 2px 10px rgba(0,0,0,.12); font-size: 14px; }
.map-error p { margin: 0 0 10px; }
.user-dot { width: 18px; height: 18px; border-radius: 50%; background: #2B6CE0; border: 3px solid #fff; box-shadow: 0 0 0 3px rgba(43,108,224,.3); }
.maplibregl-ctrl-attrib { font-size: 10px; }

/* 圆点：实心 = 公共开放，空心 = 有条件 */
.dot { display: inline-block; width: 12px; height: 12px; border-radius: 50%; border: 2.5px solid var(--c, #777); flex: none; }
.dot.solid { background: var(--c, #777); }
.dot.hollow { background: #fff; }

/* 底部卡片 */
.card { position: absolute; left: 10px; right: 10px; bottom: 10px; z-index: 5; max-width: 520px; margin: 0 auto; background: var(--surface); border-radius: var(--radius); padding: 14px 16px; box-shadow: 0 6px 24px rgba(28,43,51,.2); }
.card-close { position: absolute; right: 6px; top: 4px; border: 0; background: none; font-size: 26px; color: var(--muted); cursor: pointer; padding: 4px 10px; }
.card-type { display: flex; align-items: center; gap: 6px; margin: 0 30px 4px 0; font-size: 13px; color: var(--muted); }
.card-title { margin: 0 28px 2px 0; font-size: 18px; line-height: 1.35; }
.card-addr { margin: 0 0 6px; font-size: 13px; line-height: 1.5; }
.card-dist { margin: 0 0 6px; font-size: 14px; }
.card-actions { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }

.report-line { margin: 6px 0 0; padding: 7px 10px; border-radius: 10px; font-size: 13px; font-weight: 600; background: #EEF2F3; color: var(--muted); }
.report-line.r-open { background: #E3F2E8; color: #1F5A37; }
.report-line.r-closed, .report-line.r-out_of_order { background: #FBE6E2; color: var(--bad); }
.li-report { font-size: 12px; font-weight: 600; color: var(--muted); }
.li-report.r-open { color: #1F5A37; }
.li-report.r-closed, .li-report.r-out_of_order { color: var(--bad); }

.btn { display: inline-flex; align-items: center; justify-content: center; gap: 6px; min-height: 44px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0 16px; font-size: 14px; text-decoration: none; cursor: pointer; color: var(--text); }
.btn.primary { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; font-weight: 600; }
.btn.wide { width: 100%; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn { width: 44px; padding: 0; color: var(--accent-strong); }
.icon-btn[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); }
.icon-btn[aria-pressed="true"] svg { fill: currentColor; }

/* 筛选按钮 */
.chips { display: flex; gap: 8px; overflow-x: auto; padding: 4px 0 8px; scrollbar-width: none; }
.chips.wrap { flex-wrap: wrap; overflow: visible; }
.chip { flex: none; display: inline-flex; align-items: center; gap: 4px; min-height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0 12px; font-size: 14px; cursor: pointer; }
.chip[aria-pressed="true"] { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 600; }
.chip svg { width: 16px; height: 16px; }

/* 列表 */
.list { list-style: none; margin: 0 0 12px; padding: 0; }
.list-item { width: 100%; display: flex; align-items: center; gap: 12px; text-align: left; border: 0; border-bottom: 1px solid var(--line); background: none; padding: 12px 2px; cursor: pointer; text-decoration: none; color: var(--text); }
.list-item.static { cursor: default; }
.list-item[aria-disabled="true"] { opacity: .5; pointer-events: none; }
.li-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.li-title { font-weight: 600; line-height: 1.35; }
.li-sub { font-size: 13px; color: var(--muted); }
.li-dist { font-size: 13px; color: var(--muted); white-space: nowrap; }
.empty { padding: 20px 0; text-align: center; color: var(--muted); }
.bar { display: block; height: 6px; border-radius: 3px; background: #E6EDF0; overflow: hidden; margin-top: 4px; max-width: 240px; }
.bar > span { display: block; height: 100%; background: var(--accent); border-radius: 3px; }
.pill { display: inline-block; font-size: 11px; padding: 1px 6px; border-radius: 999px; background: #FFF4D6; color: #5C4300; }

/* 底部导航 */
.tabbar { display: flex; height: calc(var(--tabbar-h) + env(safe-area-inset-bottom)); padding-bottom: env(safe-area-inset-bottom); background: var(--surface); border-top: 1px solid var(--line); }
.tabbar button { flex: 1; border: 0; background: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px; font-size: 12px; color: var(--muted); cursor: pointer; }
.tabbar button[aria-current="true"] { color: var(--accent-strong); font-weight: 700; }

.toast { position: fixed; left: 50%; bottom: calc(var(--tabbar-h) + 24px); transform: translateX(-50%); background: var(--text); color: #fff; padding: 10px 16px; border-radius: 999px; font-size: 14px; z-index: 20; max-width: 90vw; text-align: center; }

/* ---------- 通用页面 ---------- */
.page-view { overflow-y: auto; -webkit-overflow-scrolling: touch; background: var(--bg); }
.page-head { position: sticky; top: 0; z-index: 2; display: flex; align-items: center; gap: 6px; padding: calc(10px + env(safe-area-inset-top)) 14px 10px; background: var(--bg); border-bottom: 1px solid var(--line); }
.page-head h1 { margin: 0; font-size: 18px; }
.back { border: 0; background: none; font-size: 30px; line-height: 1; padding: 0 10px 4px 0; cursor: pointer; color: var(--accent-strong); min-width: 44px; min-height: 44px; }
.page-body { padding: 12px 16px 40px; max-width: var(--content-w); margin: 0 auto; }
.page-body h3 { margin: 22px 0 8px; font-size: 16px; }
.label { margin: 8px 0 4px; font-size: 13px; font-weight: 600; color: var(--muted); }
.panel { display: block; background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 12px 14px; margin: 10px 0; }
.panel p { margin: 0 0 10px; }
.link-panel { text-decoration: none; color: var(--text); display: flex; flex-direction: column; gap: 2px; }
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.tile { display: flex; align-items: center; min-height: 56px; padding: 10px 12px; background: var(--surface); border: 1px solid var(--line); border-radius: 12px; text-decoration: none; color: var(--text); font-weight: 600; }
.tip { background: var(--accent-soft); border-radius: 12px; padding: 10px 12px; margin: 12px 0; font-size: 14px; color: var(--accent-strong); }
.tip p { margin: 0; }
.tip .label { color: var(--accent-strong); margin: 0 0 4px; }
.bullets { margin: 0 0 12px; padding-left: 20px; line-height: 1.6; }

/* 详情 */
.hero { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius); padding: 14px 16px; }
.hero p { margin: 4px 0; }
.place-name { margin: 4px 0; font-size: 21px; line-height: 1.3; }
.facts { display: grid; grid-template-columns: max-content 1fr; gap: 8px 14px; margin: 14px 2px; font-size: 14px; }
.facts dt { color: var(--muted); }
.facts dd { margin: 0; }
.block { margin-top: 8px; }
.report-list { list-style: none; padding: 0; margin: 0 0 12px; }
.report-list li { padding: 8px 0; border-bottom: 1px solid var(--line); font-size: 14px; }
.tag { display: inline-block; padding: 1px 8px; border-radius: 999px; font-size: 12px; font-weight: 600; background: #EEF2F3; margin-right: 4px; }
.tag.r-open { background: #E3F2E8; color: #1F5A37; }
.tag.r-closed, .tag.r-out_of_order { background: #FBE6E2; color: var(--bad); }

/* 表单 */
.form fieldset { border: 0; padding: 0; margin: 16px 0; }
.form legend { font-weight: 700; margin-bottom: 8px; }
.opts { display: flex; flex-wrap: wrap; gap: 8px; }
.opt { position: relative; }
.opt input { position: absolute; opacity: 0; inset: 0; }
.opt span { display: inline-flex; align-items: center; min-height: 44px; padding: 0 14px; border: 1px solid var(--line); border-radius: 999px; background: var(--surface); cursor: pointer; }
.opt input:checked + span { background: var(--accent-soft); border-color: var(--accent); color: var(--accent-strong); font-weight: 600; }
.opt input:focus-visible + span { outline: 2px solid var(--accent); outline-offset: 2px; }
.field { display: flex; flex-direction: column; gap: 6px; margin: 16px 0; font-weight: 600; }
.field textarea { border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font-weight: 400; resize: vertical; background: var(--surface); }
.form-error { color: var(--bad); font-weight: 600; }

.lang-switch { display: inline-flex; flex-wrap: wrap; gap: 6px; }
.lang-switch button { min-height: 36px; border: 1px solid var(--line); background: var(--surface); border-radius: 999px; padding: 0 12px; cursor: pointer; font-size: 13px; }
.lang-switch button[aria-pressed="true"] { background: var(--accent-strong); border-color: var(--accent-strong); color: #fff; }
.demo-bar .lang-switch button { min-height: 28px; font-size: 12px; }

@media (min-width: 900px) {
  .card { left: auto; right: 16px; bottom: 16px; width: 380px; }
}
