:root {
  --paper: #f3e9d5;
  --paper-light: #faf4e6;
  --paper-deep: #ecdfc4;
  --ink: #33291f;
  --ink-soft: #6f6354;
  --red: #b8452f;
  --red-deep: #8c2f1d;
  --red-ink: #7e2b24;
  --green: #6f8757;
  --river: #628e8b;
  --gold: #bd8b43;
  --line: rgba(88, 68, 45, .18);
  --shadow: 0 18px 50px rgba(70, 48, 30, .14);
}

* { box-sizing: border-box; }
[hidden] { display: none !important; }

html {
  color: var(--ink);
  background: var(--paper);
  font-family: "Noto Sans SC", "Hiragino Sans", sans-serif;
}

body {
  min-width: 320px;
  min-height: 100dvh;
  margin: 0;
  overflow: hidden;
  background: var(--paper);
}

button, input { font: inherit; }
button, a { touch-action: manipulation; -webkit-tap-highlight-color: transparent; }
button { color: inherit; }
button:focus-visible, input:focus-visible, a:focus-visible { outline: 3px solid #1a7791; outline-offset: 3px; }

.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;
}

.skip-link {
  position: fixed;
  z-index: 100;
  left: 14px;
  top: -80px;
  padding: 12px 18px;
  color: white;
  background: var(--ink);
  border-radius: 8px;
}
.skip-link:focus { top: 14px; }

.guide-app {
  display: grid;
  grid-template-columns: minmax(352px, 396px) minmax(0, 1fr);
  width: 100vw;
  height: 100dvh;
  overflow: hidden;
}

/* ===================== 侧栏 ===================== */
.sidebar {
  position: relative;
  z-index: 5;
  display: flex;
  flex-direction: column;
  min-height: 0;
  padding: 24px 24px 14px;
  overflow: hidden;
  background:
    repeating-linear-gradient(113deg, rgba(79,60,40,.025) 0 1px, transparent 1px 6px),
    var(--paper-light);
  border-right: 1px solid rgba(255,255,255,.85);
  box-shadow: 14px 0 44px rgba(75,52,34,.12);
}
.sidebar::before {
  content: "";
  flex: 0 0 auto;
  height: 7px;
  margin: -24px -24px 18px;
  background:
    radial-gradient(circle at 6px -3px, transparent 6px, var(--red) 6.5px, var(--red) 9px, transparent 9.5px) left top / 18px 10px repeat-x;
  opacity: .85;
}

.brand-block {
  display: flex;
  align-items: center;
  gap: 15px;
  flex: 0 0 auto;
}

.brand-seal {
  display: grid;
  place-items: center;
  width: 52px;
  height: 52px;
  flex: 0 0 auto;
  color: #fdf1e2;
  background: var(--red);
  border: 2.5px solid var(--red-ink);
  border-radius: 6px;
  box-shadow: inset 0 0 0 3px rgba(253,241,226,.35), 2px 3px 0 rgba(126,43,36,.25);
  font-family: "Ma Shan Zheng", cursive;
  font-size: 25px;
  line-height: 1;
  letter-spacing: .04em;
  transform: rotate(-3deg);
}

.overline {
  margin: 0 0 4px;
  color: var(--red);
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .16em;
}

.brand-block h1 {
  margin: 0;
  font-family: "Ma Shan Zheng", "Noto Serif SC", serif;
  font-weight: 400;
  font-size: 33px;
  letter-spacing: .06em;
}

.brand-block p:not(.overline) {
  max-width: 250px;
  margin: 4px 0 0;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.brand-site {
  display: inline-flex;
  align-items: center;
  gap: 5px;
  margin-top: 7px;
  padding: 4px 10px;
  color: var(--red);
  background: rgba(184,69,47,.08);
  border: 1px solid rgba(184,69,47,.28);
  border-radius: 999px;
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .02em;
  transition: background .18s ease, color .18s ease, border-color .18s ease;
}
.brand-site svg { width: 12px; height: 12px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; }
.brand-site:hover { color: #fdf1e2; background: var(--red); border-color: var(--red-ink); }

/* ---------- 搜索 ---------- */
.search-box {
  display: grid;
  grid-template-columns: 24px minmax(0, 1fr) auto auto;
  align-items: center;
  min-height: 54px;
  margin-top: 20px;
  padding: 5px 5px 5px 14px;
  background: #fffdf6;
  border: 1.5px solid rgba(88,68,45,.28);
  border-radius: 12px;
  box-shadow: inset 0 1px 4px rgba(88,68,45,.06);
}

.search-box svg, .category-button svg, .place-card-close svg, .navigation-link svg {
  fill: none;
  stroke: currentColor;
  stroke-width: 1.8;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-box > svg { width: 21px; height: 21px; color: var(--red); }
.search-box input {
  min-width: 0;
  height: 44px;
  padding: 0 10px;
  color: var(--ink);
  background: transparent;
  border: 0;
  outline: 0;
  font-size: 16px;
}
.search-box input::placeholder { color: #9c9080; }
.search-box > button:last-child {
  min-height: 42px;
  padding: 0 15px;
  color: #fdf1e2;
  background: var(--red);
  border: 0;
  border-radius: 9px;
  box-shadow: inset 0 -2px 0 rgba(126,43,36,.5);
  cursor: pointer;
  font-size: 12px;
  font-weight: 700;
  letter-spacing: .08em;
  transition: background .18s ease;
}
.search-box > button:last-child:hover { background: var(--red-deep); }

.clear-button {
  display: grid;
  place-items: center;
  width: 40px;
  height: 40px;
  padding: 0;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.clear-button svg { width: 18px; height: 18px; }

/* ---------- 类别 ---------- */
.categories {
  display: grid;
  grid-template-columns: repeat(7, minmax(0, 1fr));
  gap: 6px;
  margin-top: 13px;
  flex: 0 0 auto;
}

.category-button {
  display: grid;
  place-items: center;
  gap: 5px;
  min-width: 0;
  min-height: 64px;
  padding: 8px 3px;
  color: var(--ink-soft);
  background: rgba(255,253,246,.6);
  border: 1.5px solid rgba(88,68,45,.2);
  border-radius: 11px;
  cursor: pointer;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}
.category-button svg { width: 19px; height: 19px; }
.category-button span { font-size: 9px; font-weight: 700; white-space: nowrap; }
.category-button:hover { color: var(--red); border-color: rgba(184,69,47,.5); transform: translateY(-1px); }
.category-button.is-active {
  color: #fdf1e2;
  background: var(--red);
  border-color: var(--red-ink);
  box-shadow: inset 0 0 0 2px rgba(253,241,226,.28), 0 4px 12px rgba(140,47,29,.28);
}

/* ---------- 结果列表 ---------- */
.results-section {
  display: flex;
  flex-direction: column;
  min-height: 0;
  margin-top: 22px;
  flex: 1 1 auto;
}

.results-header {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 16px;
  flex: 0 0 auto;
}

.results-header h2 {
  margin: 0;
  font-family: "Noto Serif SC", serif;
  font-size: 20px;
  font-weight: 900;
  line-height: 1.35;
}

#result-count {
  display: grid;
  place-items: center;
  width: 32px;
  height: 32px;
  flex: 0 0 auto;
  color: #fdf1e2;
  background: var(--red);
  border-radius: 6px;
  transform: rotate(3deg);
  font-family: "Noto Serif SC", serif;
  font-size: 12px;
  font-weight: 700;
  box-shadow: 1px 2px 0 rgba(126,43,36,.3);
}

.results-summary {
  margin: 8px 0 8px;
  color: var(--ink-soft);
  font-size: 11px;
  line-height: 1.55;
}

.map-hint {
  display: flex;
  align-items: center;
  gap: 6px;
  margin: 0 0 12px;
  padding: 6px 10px;
  color: #8a6f4a;
  background: rgba(189,139,67,.1);
  border: 1px dashed rgba(189,139,67,.4);
  border-radius: 8px;
  font-size: 10px;
  line-height: 1.4;
  flex: 0 0 auto;
}
.map-hint::before { content: "☞"; font-size: 12px; }

.result-list {
  min-height: 0;
  overflow-y: auto;
  overscroll-behavior: contain;
  scrollbar-width: thin;
  scrollbar-color: rgba(89,73,57,.3) transparent;
}

.result-card {
  display: grid;
  grid-template-columns: 34px minmax(0, 1fr) 18px;
  align-items: center;
  gap: 11px;
  width: 100%;
  min-height: 72px;
  padding: 10px 7px;
  text-align: left;
  background: transparent;
  border: 0;
  border-bottom: 1px dashed rgba(88,68,45,.25);
  cursor: pointer;
  transition: background .18s ease;
}
.result-card:hover, .result-card.is-active { background: rgba(255,253,246,.9); }
.result-number {
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: #fdf4e6;
  background: var(--item-color, var(--red));
  border-radius: 7px;
  box-shadow: 1px 2px 0 rgba(51,41,31,.22);
  font-family: "Noto Serif SC", serif;
  font-size: 13px;
  font-weight: 700;
  transform: rotate(-4deg);
}
.result-copy { min-width: 0; }
.result-name { display: block; color: var(--ink); font-size: 13.5px; font-weight: 700; }
.result-original { display: block; margin-top: 1px; overflow: hidden; color: #99917f; font-size: 9px; letter-spacing: .04em; text-overflow: ellipsis; white-space: nowrap; }
.result-reason { display: block; margin-top: 4px; overflow: hidden; color: #6b5e4f; font-size: 10.5px; text-overflow: ellipsis; white-space: nowrap; }
.result-arrow { color: #a69a8c; font-size: 17px; }

.no-results {
  display: grid;
  gap: 7px;
  padding: 18px;
  color: var(--ink-soft);
  background: rgba(255,253,246,.7);
  border: 1.5px dashed rgba(90,70,51,.35);
  border-radius: 12px;
  font-size: 11px;
  line-height: 1.65;
}
.no-results strong { color: var(--ink); font-size: 13px; }

.static-guide {
  margin-top: 10px;
  padding: 8px 10px;
  color: #8a7f70;
  background: rgba(255,253,246,.5);
  border: 1px dashed rgba(90,70,51,.25);
  border-radius: 10px;
  font-size: 9.5px;
  line-height: 1.7;
  flex: 0 0 auto;
  max-height: 200px;
  overflow-y: auto;
}
.static-guide summary { cursor: pointer; font-weight: 700; color: #7c6c56; }
.static-guide p { margin: 7px 0 0; }
.static-guide a { color: var(--red); }

.sidebar-note {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  padding-top: 10px;
  color: #998e7e;
  font-size: 8.5px;
  flex: 0 0 auto;
}

/* ===================== 地图区 ===================== */
.map-stage {
  position: relative;
  min-width: 0;
  min-height: 0;
  padding: 18px;
  overflow: hidden;
  background:
    radial-gradient(circle at 78% 12%, rgba(255,252,240,.7), transparent 36%),
    var(--paper-deep);
}

.map-heading {
  position: absolute;
  z-index: 10;
  top: 32px;
  left: 32px;
  right: 96px; /* 右侧留出「浅草绘图」印章的位置，语言按钮不压到它 */
  display: flex;
  align-items: center;
  justify-content: flex-end;
  gap: 10px;
  pointer-events: none;
}
.map-heading > p { order: 1; margin-right: auto; }
.lang-switch { order: 2; }

/* ---------- 语言切换 ---------- */
.lang-switch { position: relative; pointer-events: auto; }
#lang-button {
  min-width: 46px;
  min-height: 37px;
  padding: 0 12px;
  color: var(--ink);
  background: rgba(250,244,230,.95);
  border: 1px solid rgba(163,134,96,.4);
  border-radius: 999px;
  box-shadow: 0 5px 20px rgba(68,49,31,.1);
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 700;
}
#lang-button::after { content: " ▾"; font-size: 9px; color: var(--ink-soft); }
#lang-button:hover { background: #fff; }
.lang-menu {
  position: absolute;
  right: 0;
  top: calc(100% + 6px);
  z-index: 30;
  display: grid;
  min-width: 116px;
  padding: 5px;
  background: rgba(252,247,236,.98);
  border: 1px solid rgba(138,115,85,.45);
  border-radius: 10px;
  box-shadow: 0 12px 32px rgba(60,39,24,.22);
}
.lang-menu button {
  min-height: 36px;
  padding: 0 11px;
  text-align: left;
  background: transparent;
  border: 0;
  border-radius: 7px;
  cursor: pointer;
  font-size: 11.5px;
  font-weight: 600;
}
.lang-menu button:hover { color: var(--red); background: rgba(184,69,47,.1); }

b[data-i18n] { font-weight: inherit; }

/* 英文/越南语模式下类别按钮允许换行 */
html[lang="en"] .category-button span,
html[lang="vi"] .category-button span {
  white-space: normal;
  font-size: 8.5px;
  line-height: 1.15;
  text-align: center;
}

/* 英文模式下地图字号/字距适配 */
html[lang="en"] .street-labels text,
html[lang="vi"] .street-labels text { letter-spacing: .06em; font-size: 13.5px; }
html[lang="en"] .street-labels text.small,
html[lang="vi"] .street-labels text.small { letter-spacing: .03em; font-size: 11.5px; }
html[lang="en"] .street-labels text.park-label,
html[lang="vi"] .street-labels text.park-label { letter-spacing: .08em; font-size: 12.5px; }
html[lang="en"] .landmark-title,
html[lang="vi"] .landmark-title { font-size: 27px; letter-spacing: .02em; }
html[lang="en"] .landmark-title.mid,
html[lang="vi"] .landmark-title.mid { font-size: 22px; }
html[lang="en"] .small-landmark,
html[lang="vi"] .small-landmark { font-size: 15.5px; letter-spacing: .02em; }
html[lang="en"] .vertical-note,
html[lang="vi"] .vertical-note { font-size: 17px; letter-spacing: .06em; }
html[lang="en"] .river-label,
html[lang="vi"] .river-label { font-size: 28px; letter-spacing: .14em; }

/* ========== 繁体中文字体修正 ========== */
/* 毛笔字体 Ma Shan Zheng 只覆盖简体字集，遇「淺/門/見/東」等繁体字会回退成杂字体导致标题崩坏。
   繁体模式统一改用 Noto Serif TC(有完整繁体字形)，正文用 Noto Sans TC。 */
html[lang="zh-TW"] { font-family: "Noto Sans TC", "Noto Sans SC", "Hiragino Sans", sans-serif; }
html[lang="zh-TW"] .street-labels text,
html[lang="zh-TW"] .tiny-landmark { font-family: "Noto Sans TC", "Noto Sans SC", sans-serif; }
html[lang="zh-TW"] .brand-seal,
html[lang="zh-TW"] .brand-block h1,
html[lang="zh-TW"] .river-label,
html[lang="zh-TW"] .landmark-title,
html[lang="zh-TW"] .small-landmark,
html[lang="zh-TW"] .vertical-note,
html[lang="zh-TW"] .compass text,
html[lang="zh-TW"] .cartouche-title {
  font-family: "Noto Serif TC", "Noto Serif SC", serif;
  font-weight: 900;
}
html[lang="zh-TW"] .brand-block h1 { font-size: 30px; letter-spacing: .1em; }
html[lang="zh-TW"] .brand-seal { font-size: 23px; letter-spacing: 0; }
html[lang="zh-TW"] .results-header h2,
html[lang="zh-TW"] #result-count,
html[lang="zh-TW"] .result-number,
html[lang="zh-TW"] .place-card h2,
html[lang="zh-TW"] .place-reason { font-family: "Noto Serif TC", "Noto Serif SC", serif; }

/* ========== 日语/韩语/越南语 字体 ========== */
/* 毛笔体 Ma Shan Zheng 无假名/谚文/越南语变音字形,三语标题一律换用对应 Noto Serif。 */
html[lang="ja"] { font-family: "Noto Sans JP", "Noto Sans SC", sans-serif; }
html[lang="ko"] { font-family: "Noto Sans KR", "Noto Sans SC", sans-serif; }
html[lang="vi"] { font-family: "Noto Sans", "Noto Sans SC", sans-serif; }

html[lang="ja"] .brand-seal, html[lang="ja"] .brand-block h1, html[lang="ja"] .river-label,
html[lang="ja"] .landmark-title, html[lang="ja"] .small-landmark, html[lang="ja"] .vertical-note,
html[lang="ja"] .compass text, html[lang="ja"] .cartouche-title {
  font-family: "Noto Serif JP", "Noto Serif SC", serif;
  font-weight: 900;
}
html[lang="ko"] .brand-seal, html[lang="ko"] .brand-block h1, html[lang="ko"] .river-label,
html[lang="ko"] .landmark-title, html[lang="ko"] .small-landmark, html[lang="ko"] .vertical-note,
html[lang="ko"] .compass text, html[lang="ko"] .cartouche-title {
  font-family: "Noto Serif KR", "Noto Serif TC", serif;
  font-weight: 900;
}
html[lang="vi"] .brand-seal, html[lang="vi"] .brand-block h1, html[lang="vi"] .river-label,
html[lang="vi"] .landmark-title, html[lang="vi"] .small-landmark, html[lang="vi"] .vertical-note,
html[lang="vi"] .compass text, html[lang="vi"] .cartouche-title {
  font-family: "Noto Serif", "Noto Serif TC", serif;
  font-weight: 900;
}
html[lang="ja"] .results-header h2, html[lang="ja"] #result-count, html[lang="ja"] .result-number,
html[lang="ja"] .place-card h2, html[lang="ja"] .place-reason { font-family: "Noto Serif JP", serif; }
html[lang="ko"] .results-header h2, html[lang="ko"] #result-count, html[lang="ko"] .result-number,
html[lang="ko"] .place-card h2, html[lang="ko"] .place-reason { font-family: "Noto Serif KR", serif; }
html[lang="vi"] .results-header h2, html[lang="vi"] #result-count, html[lang="vi"] .result-number,
html[lang="vi"] .place-card h2, html[lang="vi"] .place-reason { font-family: "Noto Serif", serif; }

/* 标题字号: 日文假名混排/韩文谚文/越南语拉丁都比毛笔体宽,收一档防换行破版 */
html[lang="ja"] .brand-block h1 { font-size: 27px; letter-spacing: .04em; }
html[lang="ko"] .brand-block h1 { font-size: 26px; letter-spacing: .02em; }
html[lang="vi"] .brand-block h1 { font-size: 24px; letter-spacing: 0; }
html[lang="ja"] .brand-seal, html[lang="ko"] .brand-seal { font-size: 22px; }

/* 地图文字: 日文街名(雷門通り等)紧凑排布; 韩文街名字距收窄 */
html[lang="ja"] .street-labels text { letter-spacing: .14em; font-size: 15px; }
html[lang="ja"] .street-labels text.small { letter-spacing: .08em; font-size: 12px; }
html[lang="ja"] .landmark-title { font-size: 30px; }
html[lang="ja"] .landmark-title.mid { font-size: 25px; }
html[lang="ko"] .street-labels text { letter-spacing: .05em; font-size: 13.5px; }
html[lang="ko"] .street-labels text.small { letter-spacing: .02em; font-size: 11.5px; }
html[lang="ko"] .street-labels text.park-label { letter-spacing: .06em; font-size: 12.5px; }
html[lang="ko"] .landmark-title { font-size: 25px; letter-spacing: .02em; }
html[lang="ko"] .landmark-title.mid { font-size: 21px; }
html[lang="ko"] .small-landmark { font-size: 15px; letter-spacing: .02em; }
html[lang="ko"] .vertical-note { font-size: 16px; letter-spacing: .04em; }
html[lang="ko"] .river-label { font-size: 26px; letter-spacing: .1em; }

.map-heading > p {
  margin: 0;
  padding: 8px 13px;
  color: var(--ink-soft);
  background: rgba(250,244,230,.92);
  border: 1px solid rgba(163,134,96,.35);
  border-radius: 999px;
  font-size: 9.5px;
}

/* “现在只显示：…”指示框已按需求移除；#map-mode-text 仍在 DOM 内静默更新，供无障碍读取 */
.map-mode { display: none; }

.map-board {
  position: relative;
  width: 100%;
  height: 100%;
  margin: 0;
  overflow: hidden;
  background: #f6eedd;
  border: 1px solid rgba(138,115,85,.4);
  border-radius: 14px;
  box-shadow: var(--shadow), inset 0 0 0 1px rgba(255,252,240,.6);
}

.map-content {
  position: absolute;
  inset: 0;
}

.map-illustration {
  display: block;
  width: 100%;
  height: 100%;
  object-fit: cover;
}

/* ---------- SVG 文字 ---------- */
.river-label text {
  fill: #47737a;
  font-family: "Ma Shan Zheng", cursive;
  font-size: 40px;
  letter-spacing: .55em;
  opacity: .95;
}
.street-labels text {
  fill: #93815f;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: .28em;
  paint-order: stroke;
  stroke: #f6eedd;
  stroke-width: 4px;
}
.street-labels text.small { font-size: 13px; letter-spacing: .16em; }
.street-labels text.vertical { writing-mode: vertical-rl; letter-spacing: .3em; }
.street-labels text.park-label { fill: #64794c; font-size: 15px; letter-spacing: .3em; }
.landmark-title {
  fill: var(--ink);
  font-family: "Ma Shan Zheng", cursive;
  font-size: 34px;
  letter-spacing: .12em;
  paint-order: stroke;
  stroke: #f6eedd;
  stroke-width: 5px;
}
.landmark-title.mid { font-size: 28px; }
.landmark-en {
  fill: #a08c6d;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 9px;
  font-weight: 700;
  letter-spacing: .22em;
  paint-order: stroke;
  stroke: #f6eedd;
  stroke-width: 3px;
}
.small-landmark {
  fill: #554a3c;
  font-family: "Ma Shan Zheng", cursive;
  font-size: 21px;
  letter-spacing: .1em;
  paint-order: stroke;
  stroke: #f6eedd;
  stroke-width: 4px;
}
.tiny-landmark {
  fill: #7c6c56;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .06em;
  paint-order: stroke;
  stroke: #f6eedd;
  stroke-width: 3px;
}
.vertical-note {
  fill: #a34a35;
  font-family: "Ma Shan Zheng", cursive;
  font-size: 25px;
  writing-mode: vertical-rl;
  letter-spacing: .22em;
  paint-order: stroke;
  stroke: #f6eedd;
  stroke-width: 4px;
}
.compass text { fill: #6f5e49; font-family: "Ma Shan Zheng", cursive; font-size: 19px; }
.map-watermark {
  fill: #8a7355;
  opacity: .5;
  font-family: "Noto Sans SC", sans-serif;
  font-size: 11px;
  font-weight: 600;
  letter-spacing: .04em;
}
.cartouche-title {
  fill: #fdf1e2;
  font-family: "Ma Shan Zheng", cursive;
  font-size: 33px;
  writing-mode: vertical-rl;
  letter-spacing: .22em;
  text-anchor: start;
}

/* ---------- 覆盖层 ---------- */
.marker-layer {
  position: absolute;
  z-index: 5;
  inset: 0;
  pointer-events: none;
}

.transit-layer,
.store-layer {
  position: absolute;
  z-index: 7;
  inset: 0;
  pointer-events: none;
}

.store-layer { z-index: 8; }

.guide-marker {
  position: absolute;
  z-index: 3;
  display: block;
  width: 34px;
  height: 34px;
  padding: 0;
  color: var(--ink);
  background: transparent;
  border: 0;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-17px, -17px);
  animation: marker-in .3s cubic-bezier(.2,.8,.2,1) both;
}
.guide-marker:hover, .guide-marker.is-active { z-index: 9; }

.guide-marker-number {
  display: grid;
  place-items: center;
  width: 34px;
  height: 34px;
  color: #fdf4e6;
  background: var(--item-color, var(--red));
  border: 2px solid #fbf3e0;
  border-radius: 9px;
  box-shadow: 1px 3px 0 rgba(51,41,31,.28), 0 4px 12px rgba(65,45,29,.18);
  font-family: "Noto Serif SC", serif;
  font-size: 13px;
  font-weight: 700;
  transform: rotate(-5deg);
  transition: transform .2s ease;
}

/* 默认只留图标；店名悬停/选中才浮现 */
.guide-marker-label {
  position: absolute;
  top: 50%;
  left: 40px;
  z-index: 4;
  max-width: 150px;
  padding: 6px 11px;
  color: var(--ink);
  background: rgba(253,248,238,.97);
  border: 1px solid rgba(92,69,47,.28);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(65,45,29,.2);
  font-size: 11px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-50%) translateX(-6px) scale(.94);
  transform-origin: left center;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.guide-marker.label-left .guide-marker-label {
  left: auto;
  right: 40px;
  transform-origin: right center;
  transform: translateY(-50%) translateX(6px) scale(.94);
}

.guide-marker:hover .guide-marker-label,
.guide-marker:focus-visible .guide-marker-label,
.guide-marker.is-active .guide-marker-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0) scale(1);
}
.guide-marker:hover .guide-marker-number,
.guide-marker:focus-visible .guide-marker-number { animation: marker-breathe 1.5s ease-in-out infinite; }
.guide-marker.is-active .guide-marker-number { transform: rotate(-5deg) scale(1.16); box-shadow: 1px 3px 0 rgba(51,41,31,.32), 0 6px 18px rgba(65,45,29,.28); }
.guide-marker.is-active .guide-marker-label { color: #fdf4e6; background: var(--ink); border-color: var(--ink); }

.station-marker {
  position: absolute;
  display: inline-flex;
  align-items: center;
  gap: 5px;
  min-height: 30px;
  padding: 3px 7px 3px 3px;
  color: var(--ink);
  background: rgba(253,248,238,.93);
  border: 1px solid rgba(91,69,48,.28);
  border-radius: 999px;
  box-shadow: 0 2px 8px rgba(65,45,29,.12);
  text-decoration: none;
  pointer-events: auto;
  transform: translate(-14px, -15px);
  transition: background .18s ease;
}
.station-marker:hover { background: white; }
.station-codes { display: inline-flex; align-items: center; }
.station-code {
  display: grid;
  place-items: center;
  min-width: 23px;
  height: 23px;
  padding: 0 3px;
  color: white;
  background: var(--station-color);
  border-radius: 50%;
  font-size: 7.5px;
  font-weight: 700;
  letter-spacing: -.02em;
}
.station-name { display: none; font-size: 8.5px; font-weight: 700; white-space: nowrap; }
.station-marker:hover .station-name,
.station-marker:focus-visible .station-name,
.station-marker.is-active .station-name { display: inline; }
.station-marker.is-active {
  z-index: 13;
  background: #fff;
  border-color: #3a6ea5;
  box-shadow: 0 0 0 3px rgba(58,110,165,.25), 0 4px 14px rgba(65,45,29,.2);
  transform: translate(-14px, -15px) scale(1.06);
}

.nearby-marker {
  position: absolute;
  z-index: 7;
  display: block;
  width: 22px;
  height: 22px;
  pointer-events: auto;
  text-decoration: none;
  transform: translate(-11px, -11px);
}
.nearby-marker:hover { z-index: 11; }
.nearby-marker-dot {
  display: grid;
  place-items: center;
  width: 22px;
  height: 22px;
  color: white;
  background: var(--nearby-color);
  border: 2px solid #fff8f4;
  border-radius: 50%;
  box-shadow: 0 3px 9px rgba(150,52,85,.28);
  font-size: 10px;
  font-weight: 700;
}
.nearby-marker-label {
  position: absolute;
  top: 50%;
  right: 28px;
  padding: 5px 9px;
  color: #963455;
  background: rgba(255,248,244,.98);
  border: 1px solid rgba(232,91,145,.4);
  border-radius: 8px;
  box-shadow: 0 4px 12px rgba(65,45,29,.18);
  font-size: 9px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-50%) translateX(6px) scale(.94);
  transform-origin: right center;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.nearby-marker:hover .nearby-marker-label,
.nearby-marker:focus-visible .nearby-marker-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0) scale(1);
}

.ennichi-marker {
  position: absolute;
  display: flex;
  align-items: center;
  min-width: 44px;
  min-height: 44px;
  padding: 0;
  background: transparent;
  border: 0;
  cursor: pointer;
  pointer-events: auto;
  transform: translate(-19px, -21px);
}
.ennichi-marker img {
  position: relative;
  z-index: 2;
  width: 38px;
  height: 38px;
  flex: 0 0 auto;
  border: 2.5px solid #fbf3e0;
  border-radius: 50%;
  box-shadow: 0 0 0 1.5px rgba(83,10,18,.35), 0 5px 12px rgba(83,10,18,.3);
  transition: transform .18s ease;
}
.ennichi-marker { z-index: 8; }
.ennichi-marker:hover, .ennichi-marker.is-active { z-index: 12; }
.ennichi-marker-label {
  position: absolute;
  top: 50%;
  left: 42px;
  padding: 6px 11px;
  color: #4f0a10;
  background: rgba(255,248,238,.98);
  border: 1px solid rgba(83,10,18,.32);
  border-radius: 8px;
  box-shadow: 0 4px 14px rgba(65,45,29,.2);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
  opacity: 0;
  transform: translateY(-50%) translateX(-6px) scale(.94);
  transform-origin: left center;
  pointer-events: none;
  transition: opacity .18s ease, transform .18s ease;
}
.ennichi-marker.label-left .ennichi-marker-label {
  left: auto;
  right: 42px;
  transform-origin: right center;
  transform: translateY(-50%) translateX(6px) scale(.94);
}
.ennichi-marker:hover .ennichi-marker-label,
.ennichi-marker:focus-visible .ennichi-marker-label,
.ennichi-marker.is-active .ennichi-marker-label {
  opacity: 1;
  transform: translateY(-50%) translateX(0) scale(1);
}
.ennichi-marker:hover img, .ennichi-marker.is-active img { transform: scale(1.12); }
.ennichi-marker.is-active .ennichi-marker-label { color: white; background: #530a12; border-color: #530a12; }

/* ---------- 地点卡片 ---------- */
.place-card {
  position: absolute;
  z-index: 20;
  right: 20px;
  bottom: 20px;
  width: min(352px, calc(100% - 40px));
  padding: 22px;
  background:
    repeating-linear-gradient(110deg, rgba(77,59,41,.025) 0 1px, transparent 1px 6px),
    rgba(252,247,236,.98);
  border: 1.5px solid rgba(138,115,85,.45);
  border-radius: 16px 4px 16px 16px;
  box-shadow: 0 20px 55px rgba(60,39,24,.25);
  animation: card-in .25s ease both;
}
.place-card::after {
  content: "浅草";
  position: absolute;
  right: 16px;
  bottom: 14px;
  display: grid;
  place-items: center;
  width: 30px;
  height: 30px;
  color: rgba(184,69,47,.5);
  border: 1.5px solid rgba(184,69,47,.4);
  border-radius: 4px;
  font-family: "Ma Shan Zheng", cursive;
  font-size: 12px;
  line-height: 1;
  transform: rotate(-6deg);
  pointer-events: none;
}

.place-card-close {
  position: absolute;
  top: 9px;
  right: 9px;
  display: grid;
  place-items: center;
  width: 44px;
  height: 44px;
  padding: 0;
  color: var(--ink-soft);
  background: transparent;
  border: 0;
  border-radius: 50%;
  cursor: pointer;
}
.place-card-close svg { width: 19px; height: 19px; }
.place-category { margin: 0; color: var(--red); font-size: 9.5px; font-weight: 700; letter-spacing: .15em; }
.place-card h2 { margin: 8px 40px 0 0; font-family: "Noto Serif SC", serif; font-size: 26px; font-weight: 900; letter-spacing: .04em; }
.place-original { margin: 3px 0 13px; color: #99917f; font-size: 10px; letter-spacing: .04em; }
.place-reason { margin: 0; color: #51483f; font-family: "Noto Serif SC", serif; font-size: 14px; line-height: 1.75; }
.place-tags { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 14px; }
.place-tags span { padding: 5px 9px; color: #63594e; background: #efe2cc; border: 1px solid rgba(138,115,85,.25); border-radius: 999px; font-size: 9px; font-weight: 600; }
.place-facts { display: grid; gap: 8px; margin-top: 16px; padding-top: 13px; border-top: 1px dashed rgba(88,68,45,.3); }
.place-facts div { display: flex; justify-content: space-between; gap: 14px; font-size: 9.5px; }
.place-facts span { color: var(--ink-soft); }
.place-facts strong { text-align: right; font-weight: 600; }
.navigation-link {
  display: flex;
  align-items: center;
  justify-content: space-between;
  min-height: 46px;
  margin-top: 16px;
  padding: 0 14px;
  color: #fdf1e2;
  background: var(--red);
  border-radius: 9px;
  box-shadow: inset 0 -2px 0 rgba(126,43,36,.5);
  text-decoration: none;
  font-size: 10.5px;
  font-weight: 700;
  letter-spacing: .05em;
  transition: background .18s ease;
}
.navigation-link:hover { background: var(--red-deep); }
.navigation-link svg { width: 20px; height: 20px; }

/* ---------- 图例 ---------- */
.map-legend {
  position: absolute;
  z-index: 10;
  left: 34px;
  bottom: 29px;
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 8px 13px;
  color: var(--ink-soft);
  background: rgba(250,244,230,.93);
  border: 1px solid rgba(163,134,96,.35);
  border-radius: 999px;
  font-size: 8.5px;
  font-weight: 600;
  pointer-events: none;
}
.map-legend span { display: inline-flex; align-items: center; gap: 5px; }
.legend-dot { width: 9px; height: 9px; border-radius: 3px; }
.legend-dot.selected { background: var(--red); transform: rotate(-5deg); }
.legend-dot.ennichi { border-radius: 50%; background: #530a12; box-shadow: inset 0 0 0 2px rgba(255,255,255,.55); }
.legend-line { width: 17px; height: 4px; background: #fffcf1; border: 1px solid #c9a86c; border-radius: 99px; }
.legend-river { width: 17px; height: 6px; background: #a3c6c3; border: 1px solid #628e8b; border-radius: 99px; }
.legend-station { display: inline-grid; place-items: center; width: 14px; height: 14px; color: white; background: #1D2088; border-radius: 50%; font-size: 7px; font-style: normal; font-weight: 700; }

@keyframes marker-in { from { opacity: 0; } to { opacity: 1; } }
@keyframes card-in { from { opacity: 0; transform: translateY(12px); } to { opacity: 1; transform: translateY(0); } }
@keyframes marker-breathe {
  0%, 100% { transform: rotate(-5deg) scale(1); }
  50% { transform: rotate(-5deg) scale(1.14); box-shadow: 1px 3px 0 rgba(51,41,31,.3), 0 7px 20px rgba(65,45,29,.3); }
}

@media (max-width: 1080px) {
  .guide-app { grid-template-columns: 350px minmax(0, 1fr); }
  .sidebar { padding-left: 18px; padding-right: 18px; }
  .sidebar::before { margin: -24px -18px 16px; }
  .category-button span { font-size: 9px; }
  .guide-marker-label { max-width: 108px; }
}

/* ===================== 手机 ===================== */
@media (max-width: 760px) {
  body { overflow: auto; overscroll-behavior-y: contain; }
  .guide-app {
    display: flex;
    flex-direction: column;
    width: 100%;
    height: auto;
    min-height: 100dvh;
    overflow: visible;
  }
  .sidebar { display: contents; }
  .sidebar::before { display: none; }
  .brand-block {
    order: 1;
    padding: max(15px, env(safe-area-inset-top)) 15px 0;
  }
  .brand-seal { width: 46px; height: 46px; font-size: 22px; }
  .brand-block h1 { font-size: 26px; }
  .brand-block p:last-child { font-size: 10px; }
  .search-box {
    order: 2;
    margin: 14px 12px 0;
    box-shadow: 0 6px 18px rgba(65,45,29,.08);
  }
  .categories {
    order: 3;
    display: flex;
    gap: 7px;
    margin: 10px 0 0;
    padding: 0 12px 3px;
    overflow-x: auto;
    scrollbar-width: none;
  }
  .categories::-webkit-scrollbar { display: none; }
  .category-button {
    display: flex;
    gap: 6px;
    min-width: auto;
    min-height: 43px;
    padding: 0 13px;
    white-space: nowrap;
  }
  .category-button span { font-size: 10.5px; }
  .map-stage {
    order: 4;
    height: 540px;
    min-height: 0;
    margin-top: 8px;
    padding: 10px;
    overflow: hidden;
    background: transparent;
  }
  .map-board { overflow-x: auto; overflow-y: hidden; border-radius: 14px; scrollbar-width: none; }
  .map-board::-webkit-scrollbar { display: none; }
  .map-content { position: relative; width: 693px; height: 520px; }
  .map-heading { top: 20px; left: 20px; right: 20px; }
  .map-heading > p { display: none; }
  .map-mode { min-height: 32px; font-size: 9.5px; }
  .map-legend { left: 20px; bottom: 19px; max-width: calc(100% - 40px); gap: 8px; font-size: 7px; padding: 7px 11px; }
  .guide-marker-label { max-width: 96px; padding-top: 5px; padding-bottom: 5px; font-size: 8.5px; }
  .guide-marker-number { width: 29px; height: 29px; font-size: 11px; }
  .station-marker { gap: 3px; padding-right: 3px; transform: translate(-12px, -14px); }
  .station-marker .station-name { display: none; }
  .station-code { min-width: 21px; height: 21px; font-size: 7px; }
  .nearby-marker-label { font-size: 7px; }
  .ennichi-marker img { width: 33px; height: 33px; }
  .ennichi-marker-label { font-size: 7.5px; }
  .place-card {
    position: fixed;
    z-index: 50;
    left: 8px;
    right: 8px;
    bottom: max(8px, env(safe-area-inset-bottom));
    width: auto;
    max-height: 68dvh;
    overflow-y: auto;
    border-radius: 16px;
  }
  .results-section {
    order: 5;
    display: block;
    margin: 2px 12px 0;
    padding: 20px 16px 8px;
    background: var(--paper-light);
    border: 1px solid rgba(255,255,255,.9);
    border-radius: 16px 16px 0 0;
    box-shadow: 0 -8px 30px rgba(65,45,29,.08);
  }
  .result-list { overflow: visible; }
  .result-card { min-height: 74px; }
  .static-guide {
    order: 6;
    margin: 2px 12px 0;
    background: var(--paper-light);
  }
  .sidebar-note {
    order: 7;
    justify-content: center;
    padding: 12px 12px max(18px, env(safe-area-inset-bottom));
    background: var(--paper-light);
  }
}

@media (max-width: 420px) {
  .brand-block .overline { font-size: 8px; }
  .search-box { grid-template-columns: 22px minmax(0, 1fr) auto auto; padding-left: 10px; }
  .search-box > button:last-child { padding: 0 11px; }
  .map-stage { height: 520px; }
  .map-content { width: 667px; height: 500px; }
}

@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; animation-iteration-count: 1 !important; scroll-behavior: auto !important; transition-duration: .01ms !important; }
}
