:root {
  color-scheme: light;
  --page: #f8f5ed;
  --paper: #fffcf5;
  --ink: #222d25;
  --muted: #5b6357;
  --green: #294435;
  --green-dark: #21372b;
  --red: #a33d2b;
  --line: #e5ddce;
  --serif: "Noto Serif TC", "Songti TC", "PMingLiU", Georgia, serif;
  --sans: system-ui, -apple-system, "PingFang TC", "Microsoft JhengHei", sans-serif;
  font-family: var(--sans);
  background: var(--page);
  color: var(--ink);
}
*, *::before, *::after { box-sizing: border-box; }
body { margin: 0; }
button, select { font: inherit; }
button { color: inherit; cursor: pointer; }
button:disabled { cursor: wait; }
button:focus-visible, a:focus-visible, select:focus-visible { outline: 3px solid #ac6338; outline-offset: 4px; }
a { color: inherit; }
svg { display: block; flex: none; }
[hidden] { display: none !important; }
p { margin: 0; }
h1, h2, h3 { margin: 0; }
.button { display: inline-flex; align-items: center; justify-content: center; gap: 8px; min-height: 44px; padding: 8px 16px; border: 1px solid transparent; border-radius: 9px; line-height: 1.4; font-weight: 650; font-size: .92rem; }
.primary { background: var(--green); color: white; }
.primary:hover { background: var(--green-dark); }
.pale { background: #efeee4; border-color: #deded0; color: var(--green); }
.ghost { background: transparent; border-color: currentColor; }
.kicker { display: flex; align-items: center; gap: 6px; color: var(--red); font-size: .875rem; font-weight: 700; letter-spacing: .1em; }
.kicker svg { width: 16px; height: 16px; }

.sr-only { position: absolute; width: 1px; height: 1px; padding: 0; margin: -1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.map-panel { position: relative; height: 100vh; height: 100dvh; overflow: hidden; background: #dbe9e3; }
.google-map, .map-preview, .map-preview canvas, .map-pins { position: absolute; inset: 0; width: 100%; height: 100%; }
.google-map { visibility: hidden; }
.google-map.map-visible { visibility: visible; }
.map-pins { pointer-events: none; z-index: 1; }
.map-notices { position: absolute; top: max(12px, env(safe-area-inset-top)); left: max(12px, env(safe-area-inset-left)); right: calc(70px + env(safe-area-inset-right)); z-index: 2; display: grid; justify-items: start; gap: 7px; pointer-events: none; }
.map-mode, .map-chip { padding: 7px 11px; border: 1px solid #d7ddce; border-radius: 9px; background: var(--paper); color: var(--green-dark); box-shadow: 0 2px 8px #2030261a; font-size: .875rem; font-weight: 650; line-height: 1.45; }
.map-chip { display: inline-flex; align-items: center; gap: 7px; min-height: 44px; pointer-events: auto; }
.map-chip svg { width: 18px; height: 18px; }
.map-chip:hover { background: #eeefe5; }
.map-attribution { position: absolute; bottom: 0; right: 0; z-index: 2; padding: 4px 7px; background: #fffcf2f5; color: #405b4f; font-size: .7rem; text-underline-offset: 2px; border-top-left-radius: 5px; }
.map-tools { position: absolute; top: max(12px, env(safe-area-inset-top)); right: max(12px, env(safe-area-inset-right)); z-index: 3; display: grid; gap: 8px; }
.map-tools .map-tool { width: 46px; height: 46px; color: var(--green-dark); border-color: #d7ddce; box-shadow: 0 2px 9px #20302621; }
.map-tools .map-tool[aria-pressed="true"] { color: #215b9e; background: #edf4ff; border-color: #bed2ed; }
.map-camera { position: absolute; bottom: calc(34px + env(safe-area-inset-bottom)); left: 50%; transform: translateX(-50%); z-index: 3; display: inline-flex; align-items: center; gap: 8px; padding: 0 16px; height: 48px; border: 1px solid #335245; border-radius: 24px; color: #fff; background: var(--green); box-shadow: 0 3px 12px #20302642; font-size: .9rem; font-weight: 700; white-space: nowrap; }
.map-camera svg { width: 22px; height: 22px; }
.map-camera:hover { background: var(--green-dark); }
.map-region, .map-pin { pointer-events: auto; position: absolute; border: 1px solid #b9c4b1; background: var(--paper); color: var(--green-dark); transform: translate(-50%, -50%); box-shadow: 0 3px 9px #36504228; }
.map-region { display: flex; align-items: center; gap: 6px; min-height: 39px; border-radius: 24px; font-size: .86rem; font-weight: 720; padding: 4px 9px 4px 4px; white-space: nowrap; }
.map-region strong { display: grid; place-items: center; flex: none; width: 27px; height: 27px; border-radius: 50%; background: var(--green); color: white; }
.map-region:hover, .map-pin:hover { z-index: 2; border-color: var(--green); }
.map-pin { display: grid; place-items: center; border: 2px solid white; border-radius: 50%; width: 32px; height: 32px; background: var(--red); color: white; }
.geo-dot { display: block; width: 17px; height: 17px; border: 3px solid #fff; border-radius: 50%; background: #2767c1; box-shadow: 0 0 0 6px #2767c131; }
.map-location-dot { position: absolute; transform: translate(-50%, -50%); z-index: 2; pointer-events: none; }

.list-panel { width: min(990px, calc(100% - 32px)); margin: 0 auto; min-height: 100dvh; padding: max(18px, env(safe-area-inset-top)) 0 calc(20px + env(safe-area-inset-bottom)); }
.list-panel > button { margin-bottom: 12px; }
.list-panel > button svg { width: 19px; height: 19px; }
.discover { min-width: 0; border: 1px solid var(--line); background: var(--paper); border-radius: 15px; overflow: hidden; }
.section-head { display: flex; align-items: start; justify-content: space-between; gap: 12px; padding: 15px 15px 13px; border-bottom: 1px solid var(--line); }
.section-head h1 { font-family: var(--serif); font-size: 1.56rem; letter-spacing: -.035em; }
.section-head p { color: var(--muted); font-size: .875rem; margin-top: 5px; line-height: 1.5; }
.city-select { flex: none; align-self: start; }
.places { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; padding: 12px; }
.place-group + .place-group { border-top: 1px solid var(--line); }
.place-group-title { margin: 0; padding: 14px 12px 0; color: var(--green); font-family: var(--serif); font-size: 1.25rem; }
.place { display: flex; align-items: center; gap: 11px; min-height: 78px; padding: 11px 15px; background: var(--paper); border: 1px solid var(--line); border-radius: 9px; text-align: left; }
.place:hover { background: #f5f1e6; }
.place:focus-visible { outline-offset: -4px; }
.place img, .place-symbol { width: 54px; height: 54px; flex: none; border-radius: 8px; }
.place img { object-fit: cover; background: #e6ddcb; }
.place-symbol { display: grid; place-items: center; color: var(--green); background: #e9eddf; }
.place-copy { display: block; min-width: 0; }
.place-meta, .place-distance { display: block; color: var(--muted); line-height: 1.4; font-size: .83rem; }
.place-title { display: block; font-family: var(--serif); font-size: 1.17rem; font-weight: 800; margin: 3px 0; line-height: 1.35; }
.place-distance { color: var(--green); }
.arrival { color: #27613d; font-weight: 750; }
.empty { grid-column: 1/-1; padding: 20px 15px; color: var(--muted); line-height: 1.6; }
.empty .button { margin-top: 13px; }
.dialog { max-height: calc(100dvh - 32px); width: min(660px, calc(100% - 32px)); padding: 0; border: 1px solid var(--line); border-radius: 17px; color: var(--ink); background: var(--paper); box-shadow: 0 22px 85px #1e281965; }
.dialog::backdrop { background: #172119a1; }
body:has(.dialog[open]) { overflow: hidden; }
.icon-button { display: grid; place-items: center; width: 44px; height: 44px; padding: 0; border: 1px solid transparent; border-radius: 10px; background: var(--paper); color: var(--ink); }
.icon-button:hover { background: #ece8dc; }
.dialog-close { position: absolute; right: 13px; top: 13px; z-index: 1; }
.detail-image { height: clamp(175px, 42vw, 250px); width: 100%; object-fit: cover; display: block; background: var(--green); }
.detail-copy { padding: 24px clamp(18px, 4vw, 31px) 27px; }
.detail-copy:first-child { padding-top: 30px; }
.detail-copy > .kicker { padding-right: 46px; flex-wrap: wrap; }
.detail-arrival { padding: 3px 7px; border-radius: 6px; background: #e7eedf; color: #2d5e3f; font-size: .8rem; letter-spacing: normal; }
.detail-copy h2 { margin-top: 3px; font-family: var(--serif); font-size: clamp(1.86rem, 5vw, 2.64rem); letter-spacing: -.04em; }
.detail-address { color: var(--muted); margin-top: 5px; font-size: .92rem; }
.listen { margin-top: 18px; display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.listen-note { font-size: .87rem; color: var(--muted); }
.article { margin-top: 20px; border-top: 1px solid var(--line); padding-top: 18px; }
.article h3 { font-family: var(--serif); font-size: 1.22rem; }
.article p { margin-top: 8px; line-height: 1.82; }
.sources { margin-top: 21px; border-top: 1px solid var(--line); padding-top: 14px; font-size: .85rem; color: var(--muted); line-height: 1.7; }
.sources a { text-underline-offset: 3px; }

.camera { width: min(660px, calc(100% - 28px)); padding: 21px; }
.camera-header { display: flex; justify-content: space-between; align-items: start; }
.camera-header h2 { font-family: var(--serif); margin: 4px 0 0; font-size: 1.95rem; letter-spacing: -.035em; }
.camera-close { background: #f2efe4; }
.camera-toolbar { display: flex; align-items: center; margin: 14px 0 11px; gap: 9px; }
.camera-toolbar label { display: inline-flex; align-items: center; gap: 6px; color: var(--muted); font-size: .92rem; }
.camera-toolbar label svg { width: 19px; height: 19px; }
select { min-height: 38px; padding: 5px 32px 5px 10px; appearance: none; background: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='24' height='24' viewBox='0 0 24 24' fill='none' stroke='%235b6357' stroke-width='1.7' stroke-linecap='round' stroke-linejoin='round'%3E%3Cpath d='m7 10 5 5 5-5'/%3E%3C/svg%3E") right 5px center no-repeat var(--page); border: 1px solid var(--line); border-radius: 7px; color: var(--ink); }
.stage { position: relative; height: clamp(290px, 62vw, 355px); border-radius: 12px; isolation: isolate; overflow: hidden; background: radial-gradient(ellipse at 50% 10%, #3b5946, #192b22 80%); color: white; display: grid; place-items: center; }
.frame { position: absolute; }
.stage video, .sample-image, .overlays { position: absolute; inset: 0; width: 100%; height: 100%; }
.stage video { object-fit: contain; }
.finder { position: absolute; inset: 16px; pointer-events: none; }
.finder i { position: absolute; width: 25px; height: 25px; border: solid #faf8e9b8; border-width: 0; }
.finder i:nth-child(1) { inset: 0 auto auto 0; border-width: 2px 0 0 2px; border-top-left-radius: 5px; }
.finder i:nth-child(2) { inset: 0 0 auto auto; border-width: 2px 2px 0 0; border-top-right-radius: 5px; }
.finder i:nth-child(3) { inset: auto auto 0 0; border-width: 0 0 2px 2px; border-bottom-left-radius: 5px; }
.finder i:nth-child(4) { inset: auto 0 0 auto; border-width: 0 2px 2px 0; border-bottom-right-radius: 5px; }
.camera-start { position: relative; z-index: 1; display: flex; align-items: center; justify-content: center; flex-wrap: wrap; max-width: 100%; gap: 7px; padding: 22px; text-align: center; }
.scan-symbol { display: grid; place-items: center; border: 1px solid #eff2dd54; border-radius: 15px; width: 52px; height: 52px; color: #ffedcb; }
.camera-start p { flex-basis: 100%; margin: 7px 0; line-height: 1.45; }
.camera-start small { flex-basis: 100%; color: #e0e5d9; margin-top: 4px; }
.camera-start .primary { background: #f0e8d7; color: var(--green-dark); }
.camera-start .ghost { color: #fffdf3; background: #172c2180; }
.camera-status { display: flex; align-items: center; justify-content: space-between; gap: 10px; min-height: 42px; margin-top: 5px; color: var(--muted); font-size: .88rem; }
.camera-status button { min-height: 38px; flex-shrink: 0; }
.sample-image { background: center 34% / cover url('/images/chihkan.jpg') #80795d; display: grid; place-items: center; }
.sample-sign { background: #f7ecd7; position: absolute; left: 10%; right: 10%; top: 27%; padding: 15px; box-shadow: 0 8px 26px #1c221c85; color: var(--ink); border-left: 5px solid var(--red); min-height: 46%; font-family: var(--serif); }
.sample-sign strong { display: block; font-size: 1.5rem; }
.sample-sign p { margin-top: 8px; }
.overlays { pointer-events: none; }
.overlay-label { position: absolute; min-width: min(105px, 38%); background: #213f32f2; border: 1px solid #f7f1d78a; border-radius: 4px; padding: 4px 6px; color: #fff; line-height: 1.25; font-weight: 650; font-size: .85rem; overflow-wrap: anywhere; display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.translations { display: grid; gap: 7px; }
.translation { border-left: 2px solid #a89772; padding: 5px 8px; background: var(--page); font-size: .93rem; }
.translation-original { color: var(--muted); margin-bottom: 2px; }

@media (min-width: 641px) and (max-width: 880px) {
  .places { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}
@media (max-width: 640px) {
  .section-head h1 { font-size: 1.36rem; }
  .places { grid-template-columns: 1fr; }
  .place-title { font-size: 1.12rem; }
  .camera { padding: 15px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { transition: none !important; }
}
