:root {
  --brand: #16a06a;
  --brand-dark: #0f8a5b;
  --brand-soft: #e8f7f0;
  --ink: #1f2329;
  --ink-2: #5b6470;
  --ink-3: #8f98a3;
  --line: #ebedf0;
  --bg: #f6f7f9;
  --card: #fff;
  --warn-bg: #fff7ed;
  --warn-ink: #b45309;
  --radius: 14px;
  --shadow: 0 4px 16px rgba(31, 35, 41, 0.08);
  --shadow-lg: 0 8px 28px rgba(31, 35, 41, 0.14);
}

* { box-sizing: border-box; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", "Helvetica Neue", Arial, sans-serif;
  -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent;
}

a { color: inherit; text-decoration: none; }

button, input { font: inherit; color: inherit; }

/* ---------- 通用 ---------- */
.page {
  max-width: 720px;
  margin: 0 auto;
  padding-bottom: calc(24px + env(safe-area-inset-bottom));
}

.topbar {
  position: sticky;
  top: 0;
  z-index: 20;
  background: #fff;
  border-bottom: 1px solid var(--line);
  padding: 10px 14px 0;
}

.topbar-row {
  display: flex;
  align-items: center;
  gap: 10px;
}

.back {
  flex: none;
  width: 34px;
  height: 34px;
  display: grid;
  place-items: center;
  border-radius: 50%;
  font-size: 20px;
  color: var(--ink-2);
  background: #f2f4f6;
}

.searchbox {
  flex: 1;
  display: flex;
  align-items: center;
  gap: 8px;
  height: 38px;
  padding: 0 14px;
  border-radius: 999px;
  background: #f2f4f6;
  color: var(--ink-3);
  font-size: 14px;
}

.searchbox input {
  flex: 1;
  min-width: 0;
  border: 0;
  outline: 0;
  background: transparent;
  font-size: 14px;
  color: var(--ink);
}

.searchbox input::placeholder { color: var(--ink-3); }

.chips {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 10px 0 12px;
  scrollbar-width: none;
}
.chips::-webkit-scrollbar { display: none; }

.chip {
  flex: none;
  padding: 7px 14px;
  border-radius: 999px;
  background: #f2f4f6;
  color: var(--ink-2);
  font-size: 13px;
  white-space: nowrap;
  cursor: pointer;
  border: 0;
}

.chip.on {
  background: var(--brand);
  color: #fff;
  font-weight: 600;
}

.summary {
  padding: 14px 16px 6px;
  font-size: 13px;
  color: var(--ink-3);
}
.summary b { color: var(--ink); }

.list { padding: 4px 12px 0; }

.card {
  display: flex;
  align-items: flex-start;
  gap: 12px;
  padding: 14px;
  margin-bottom: 8px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 1px 6px rgba(31, 35, 41, 0.05);
  transition: transform 0.12s ease, box-shadow 0.12s ease;
}
.card:active { transform: scale(0.995); }

.card-no {
  flex: none;
  width: 30px;
  height: 30px;
  border-radius: 9px;
  display: grid;
  place-items: center;
  background: var(--brand-soft);
  color: var(--brand);
  font-size: 12px;
  font-weight: 700;
}

.card-body { flex: 1; min-width: 0; }

.card-name {
  font-size: 16px;
  font-weight: 600;
  line-height: 1.35;
}

.card-dishes {
  margin-top: 3px;
  font-size: 13px;
  color: var(--ink-2);
  line-height: 1.5;
}

.card-foot {
  margin-top: 8px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}

.tag {
  font-size: 11px;
  color: var(--brand);
  background: var(--brand-soft);
  border-radius: 6px;
  padding: 3px 8px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  max-width: 60%;
}

.muted { color: var(--ink-3); font-size: 11px; }

.empty {
  padding: 80px 24px;
  text-align: center;
  color: var(--ink-3);
}

/* ---------- 详情页 ---------- */
.hero {
  background: linear-gradient(160deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  padding: 22px 18px 24px;
}

.hero-eyebrow { font-size: 12px; opacity: 0.85; letter-spacing: 0.04em; }
.hero-name { margin-top: 8px; font-size: 26px; font-weight: 700; line-height: 1.3; }
.hero-addr { margin-top: 10px; display: flex; align-items: center; gap: 6px; font-size: 14px; opacity: 0.95; }

.block {
  margin: 12px 12px 0;
  padding: 16px;
  border-radius: var(--radius);
  background: var(--card);
  box-shadow: 0 1px 6px rgba(31, 35, 41, 0.05);
}

.block-title {
  font-size: 12px;
  font-weight: 600;
  color: var(--ink-3);
  letter-spacing: 0.08em;
}

.block-text {
  margin-top: 8px;
  font-size: 14px;
  line-height: 1.7;
  color: var(--ink-2);
}

.dishes { margin-top: 10px; display: flex; flex-wrap: wrap; gap: 8px; }

.dish {
  padding: 7px 12px;
  border-radius: 10px;
  background: var(--brand-soft);
  color: #12855a;
  font-size: 14px;
}

.minimap { height: 220px; margin-top: 12px; border-radius: 12px; overflow: hidden; }

.poi-warn {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  background: var(--warn-bg);
  color: var(--warn-ink);
  font-size: 13px;
  line-height: 1.6;
}

.poi-tel {
  margin-top: 10px;
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 8px 14px;
  border-radius: 999px;
  background: var(--brand-soft);
  color: #12855a;
  font-size: 14px;
}

.actions { padding: 14px 12px 0; }

.btn {
  display: flex;
  align-items: center;
  justify-content: center;
  height: 48px;
  border-radius: 999px;
  font-size: 15px;
  font-weight: 600;
  margin-bottom: 10px;
  border: 0;
  width: 100%;
  cursor: pointer;
}

.btn-primary {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 6px 18px rgba(22, 160, 106, 0.28);
}

.btn-ghost {
  background: #fff;
  color: var(--ink);
  box-shadow: 0 1px 6px rgba(31, 35, 41, 0.06);
}

.hint {
  padding: 4px 6px;
  font-size: 12px;
  line-height: 1.7;
  color: var(--ink-3);
}

.footer { padding: 20px 18px calc(28px + env(safe-area-inset-bottom)); }
.footer div { font-size: 12px; line-height: 1.7; color: var(--ink-3); margin-bottom: 4px; }

/* ---------- 地图页 ---------- */
#map {
  position: fixed;
  inset: 0;
  background: #e9eef2;
  z-index: 1;
}

.map-overlay {
  position: fixed;
  inset: 0;
  z-index: 5;
  pointer-events: none;
}
.map-overlay > * { pointer-events: auto; }

.map-search {
  position: absolute;
  left: 12px;
  right: 12px;
  top: calc(10px + env(safe-area-inset-top));
  display: flex;
  align-items: center;
  gap: 8px;
  height: 44px;
  padding: 0 16px;
  border-radius: 999px;
  background: #fff;
  color: var(--ink-3);
  font-size: 14px;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}

.map-counter {
  position: absolute;
  left: 12px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  padding: 10px 14px;
  border-radius: 12px;
  background: #fff;
  box-shadow: var(--shadow-lg);
  max-width: 60vw;
}

.map-counter b { display: block; font-size: 14px; }
.map-counter span { display: block; margin-top: 2px; font-size: 11px; color: var(--ink-3); }

.map-actions {
  position: absolute;
  right: 12px;
  bottom: calc(18px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.round {
  width: 46px;
  height: 46px;
  border-radius: 50%;
  border: 0;
  display: grid;
  place-items: center;
  background: #fff;
  color: var(--ink);
  font-size: 13px;
  font-weight: 600;
  box-shadow: var(--shadow-lg);
  cursor: pointer;
}

.round-brand { background: var(--brand); color: #fff; }

.round svg { width: 20px; height: 20px; }

/* 地图标记：小圆点 + 白底标签 */
.place-pin {
  display: flex;
  padding: 6px;            /* 扩大点击热区 */
  flex-direction: column;
  align-items: center;
  transform: translate(-50%, -100%);
  cursor: pointer;
}

.place-pin i {
  width: 13px;
  height: 13px;
  border-radius: 50%;
  background: var(--brand);
  border: 2px solid #fff;
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.3);
}

body.labels-off .place-pin:not(.pin-major) span { display: none; }

.place-pin span {
  margin-top: 2px;
  padding: 2px 6px;
  border-radius: 5px;
  background: rgba(255, 255, 255, 0.96);
  border: 1px solid #e3e6ea;
  font-size: 11px;
  color: var(--ink);
  white-space: nowrap;
  box-shadow: 0 1px 3px rgba(31, 35, 41, 0.12);
}

.leaflet-popup-content { margin: 12px 14px; }
.pop-title { font-size: 13px; font-weight: 600; margin-bottom: 6px; }
.pop-item { display: block; padding: 6px 0; border-top: 1px solid var(--line); }
.pop-item:first-of-type { border-top: 0; }
.pop-name { font-size: 14px; font-weight: 600; }
.pop-dishes { font-size: 12px; color: var(--ink-2); margin-top: 2px; }

.leaflet-control-attribution { font-size: 10px; }
