/* 新加坡观光地图 */
:root {
	--serif: 'Noto Serif SC', 'Songti SC', 'STSong', 'Source Han Serif SC', serif;
	--ink: #5b4636;
	--ink2: #846c58;
	--paper: #fcf7ec;
	--sea: #d3ecef;
	--line: rgba(91, 70, 54, .22);
	--tech: #4f86c6;
	--culture: #d9694f;
	--nature: #4f9a5f;
	--bot: 64px;
	--topgap: 12px;
	color-scheme: light;
}
html.standalone { --topgap: 62px; }
* { box-sizing: border-box; }
html, body { height: 100%; }
body {
	margin: 0;
	overflow: hidden;
	background: var(--sea);
	color: var(--ink);
	font: 15px/1.7 var(--serif);
	-webkit-font-smoothing: antialiased;
	-webkit-tap-highlight-color: transparent;
}
button { font: inherit; color: inherit; }
[hidden] { display: none !important; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip: rect(0 0 0 0); white-space: nowrap; }

/* 地图 */
.stage { position: fixed; inset: 0; overflow: hidden; touch-action: none; cursor: grab; outline: none; }
.stage.is-drag { cursor: grabbing; }
.stage:focus-visible::after { content: ''; position: absolute; inset: 4px; border: 2px dashed rgba(91, 70, 54, .45); border-radius: 14px; pointer-events: none; }
.map { position: absolute; left: 0; top: 0; width: 100%; height: 100%; display: block; transform-origin: 0 0; will-change: transform; }
.paper {
	position: absolute; inset: 0; pointer-events: none; z-index: 1;
	mix-blend-mode: multiply; opacity: .55;
	background-size: 360px 360px;
}
.paper::after {
	content: ''; position: absolute; inset: 0;
	background: radial-gradient(ellipse at 50% 46%, rgba(255, 255, 255, 0) 55%, rgba(170, 140, 100, .16) 100%);
}

/* 图钉：圆形贴纸 + 名字 */
.pins { position: absolute; left: 0; top: 0; width: 0; height: 0; z-index: 2; }
.leaders { position: absolute; left: 0; top: 0; width: 1px; height: 1px; overflow: visible; pointer-events: none; }
.pin {
	position: absolute; left: 0; top: 0;
	width: calc(var(--r) * 2); height: calc(var(--r) * 2);
	padding: 0; margin: 0; border: 0; background: none; cursor: pointer;
	border-radius: 50%;
	transition: transform .28s cubic-bezier(.3, .7, .3, 1), opacity .2s;
}
.pins.no-anim .pin { transition: opacity .2s; }
.pin__b {
	position: absolute; inset: 0; border-radius: 50%;
	background: #fffdf8;
	box-shadow: 0 0 0 2.5px var(--c), 0 3px 8px -3px rgba(91, 70, 54, .5);
	transition: transform .18s, box-shadow .18s;
	overflow: hidden;
}
.pin__b svg { position: absolute; inset: 0; width: 100%; height: 100%; display: block; }
.pin:hover .pin__b, .pin:focus-visible .pin__b { transform: scale(1.12); }
.pin:focus-visible { outline: none; }
.pin:focus-visible .pin__b { box-shadow: 0 0 0 2.5px var(--c), 0 0 0 5.5px rgba(255, 253, 248, .95), 0 0 0 7.5px var(--ink); }
.pin.is-on { z-index: 3; }
.pin.is-on .pin__b { transform: scale(1.18); box-shadow: 0 0 0 3px var(--c), 0 0 0 7px rgba(255, 253, 248, .9), 0 6px 14px -4px rgba(91, 70, 54, .55); }
.pin.is-off { opacity: 0; pointer-events: none; }
.pin__l {
	position: absolute; left: 0; top: 0;
	white-space: nowrap;
	padding: 1px 7px 2px;
	border-radius: 8px;
	background: rgba(255, 252, 244, .9);
	box-shadow: 0 0 0 1px rgba(91, 70, 54, .14);
	font: 600 var(--lf, 13px)/1.35 var(--serif);
	letter-spacing: .02em;
	color: var(--ink);
	pointer-events: none;
	transition: opacity .18s;
}
.pin__l.is-hide { opacity: 0; visibility: hidden; }
.pin:hover .pin__l.is-hide, .pin:focus-visible .pin__l.is-hide, .pin.is-on .pin__l.is-hide { opacity: 1; visibility: visible; z-index: 4; }
.pin.is-on .pin__l { background: #fffdf6; box-shadow: 0 0 0 1.5px var(--c); }

/* 地名（水域、邻国） */
.nm {
	position: absolute; left: 0; top: 0;
	white-space: nowrap; pointer-events: none;
	font: 500 13px/1.3 var(--serif);
	letter-spacing: .32em;
	color: rgba(70, 120, 140, .82);
	text-shadow: 0 0 3px rgba(255, 255, 255, .9), 0 0 6px rgba(255, 255, 255, .7);
	transition: opacity .2s;
}
.nm--land { color: rgba(120, 100, 80, .78); letter-spacing: .18em; font-size: 12.5px; }
.nm--isle { color: rgba(110, 90, 70, .8); letter-spacing: .14em; font-size: 12px; }
.nm--green { color: rgba(70, 120, 70, .85); letter-spacing: .2em; font-size: 12px; }
.nm.is-hide { opacity: 0; visibility: hidden; }

/* 标题 */
.head {
	position: absolute; left: 12px; top: 10px; z-index: 6;
	max-width: calc(100% - 24px);
	padding: 10px 14px 11px;
	background: rgba(253, 249, 240, .9);
	border: 1.5px solid var(--line);
	border-radius: 18px;
	box-shadow: 0 8px 22px -14px rgba(91, 70, 54, .55);
	-webkit-backdrop-filter: blur(4px); backdrop-filter: blur(4px);
}
.head__row { display: flex; align-items: center; gap: 10px; }
.head h1 {
	margin: 0; font-size: 25px; line-height: 1.25; font-weight: 900; letter-spacing: .1em;
	background: linear-gradient(transparent 62%, rgba(243, 207, 99, .5) 62%, rgba(243, 207, 99, .5) 90%, transparent 90%);
	padding: 0 2px;
}
.head__sub { margin: 3px 0 9px; font-size: 13.5px; line-height: 1.5; color: var(--ink2); }
.about-b {
	flex: none; display: inline-flex; align-items: center; gap: 4px;
	height: 28px; padding: 0 10px 0 8px; border-radius: 999px;
	border: 1.5px solid var(--line); background: #fffdf8; cursor: pointer;
	font-size: 13px; font-weight: 600; line-height: 1;
}
.about-b svg { width: 16px; height: 16px; }
.about-b:hover { background: #fff6e2; }
.chips { display: flex; flex-wrap: wrap; gap: 6px; }
.chip {
	--c: var(--ink2); --soft: #f3ebdc;
	display: inline-flex; align-items: center; gap: 6px;
	height: 30px; padding: 0 11px 0 10px;
	border-radius: 999px; border: 1.5px solid var(--line);
	background: #fffdf8; cursor: pointer;
	font-size: 13.5px; font-weight: 600; line-height: 1; white-space: nowrap;
	transition: background .15s, border-color .15s;
}
.chip i { width: 10px; height: 10px; border-radius: 50%; background: var(--c); box-shadow: 0 0 0 2px #fff, 0 0 0 3px var(--c); margin-right: 2px; }
.chip b { font-weight: 600; font-size: 12px; opacity: .6; }
.chip:hover { background: var(--soft); }
.chip[aria-pressed="true"] { background: var(--soft); border-color: var(--c); box-shadow: inset 0 0 0 1px var(--c); }
.chip--all i { background: conic-gradient(var(--tech) 0 33%, var(--culture) 0 66%, var(--nature) 0); }
.head button:focus-visible, .ctl button:focus-visible, .card button:focus-visible, .about button:focus-visible { outline: 2px solid var(--ink); outline-offset: 2px; }

/* 缩放 */
.ctl { position: absolute; left: 12px; bottom: calc(12px + env(safe-area-inset-bottom)); z-index: 6; display: flex; flex-direction: column; gap: 6px; }
.ctl button {
	width: 40px; height: 40px; border-radius: 13px;
	display: grid; place-items: center;
	border: 1.5px solid var(--line); background: rgba(253, 249, 240, .94);
	box-shadow: 0 6px 16px -10px rgba(91, 70, 54, .6); cursor: pointer; padding: 0;
}
.ctl button:hover { background: #fff6e2; }
.ctl svg { width: 20px; height: 20px; }

/* 介绍卡片 */
.card {
	position: absolute; z-index: 7;
	right: 12px; top: var(--topgap);
	width: min(372px, calc(100% - 24px));
	max-height: calc(100% - var(--topgap) - var(--bot) - 8px);
	display: flex; flex-direction: column;
	background: rgba(254, 251, 244, .97);
	border: 1.5px solid var(--line);
	border-radius: 20px;
	box-shadow: 0 18px 40px -22px rgba(91, 70, 54, .7);
	overflow: hidden;
	animation: card-in .26s cubic-bezier(.3, .7, .3, 1);
}
@keyframes card-in { from { opacity: 0; transform: translateY(8px) scale(.98); } }
.card__top { position: relative; display: flex; align-items: center; gap: 12px; padding: 14px 44px 8px 14px; }
.card__pic { flex: none; width: 76px; height: 76px; border-radius: 50%; background: #fffdf8; box-shadow: 0 0 0 3px var(--c), 0 6px 14px -8px rgba(91, 70, 54, .6); overflow: hidden; }
.card__pic svg { display: block; width: 100%; height: 100%; }
.card__k { display: inline-flex; align-items: center; gap: 6px; margin: 0 0 2px; font-size: 12.5px; font-weight: 600; color: var(--c); letter-spacing: .08em; }
.card__k i { width: 8px; height: 8px; border-radius: 50%; background: var(--c); }
.card h2 { margin: 0; font-size: 20px; line-height: 1.35; font-weight: 800; letter-spacing: .03em; }
.card__en { margin: 2px 0 0; font-size: 12.5px; line-height: 1.4; color: var(--ink2); }
.card__x {
	position: absolute; right: 10px; top: 10px;
	width: 32px; height: 32px; border-radius: 50%;
	border: 0; background: transparent; cursor: pointer; font-size: 18px; line-height: 1; color: var(--ink2);
}
.card__x:hover { background: rgba(91, 70, 54, .08); }
.card__body { padding: 2px 16px 4px; overflow: auto; overscroll-behavior: contain; }
.card__body p { margin: 0 0 8px; font-size: 15px; line-height: 1.85; }
.card__nav { display: flex; align-items: center; gap: 8px; padding: 8px 12px 12px; border-top: 1px dashed var(--line); }
.card__nav button {
	display: inline-flex; align-items: center; gap: 4px;
	height: 32px; padding: 0 12px; border-radius: 999px;
	border: 1.5px solid var(--line); background: #fffdf8; cursor: pointer;
	font-size: 13px; font-weight: 600; line-height: 1; white-space: nowrap;
}
.card__nav button:hover { background: #fff6e2; }
.card__nav span { flex: 1; min-width: 0; text-align: center; font-size: 12.5px; color: var(--ink2); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }

/* 说明 */
.about { position: fixed; inset: 0; z-index: 9; display: grid; place-items: center; padding: 16px; background: rgba(60, 46, 34, .32); }
.about__in {
	position: relative;
	width: min(640px, 100%); max-height: min(86vh, 820px, 100%); overflow: auto; overscroll-behavior: contain;
	padding: 20px 22px 18px;
	background: var(--paper); border: 1.5px solid var(--line); border-radius: 20px;
	box-shadow: 0 24px 60px -24px rgba(60, 46, 34, .7);
}
.about h2 { margin: 0 40px 8px 0; font-size: 20px; letter-spacing: .06em; }
.about h3 { margin: 16px 0 6px; font-size: 15.5px; letter-spacing: .04em; }
.about p { margin: 0 0 8px; font-size: 14.5px; line-height: 1.85; }
.about ul { margin: 0; padding: 0; list-style: none; }
.about li { margin: 0 0 7px; padding-left: 14px; position: relative; font-size: 13px; line-height: 1.7; color: #6b5645; overflow-wrap: anywhere; }
.about li::before { content: ''; position: absolute; left: 2px; top: .7em; width: 5px; height: 5px; border-radius: 50%; background: #c9b39a; }
.about li b { color: var(--ink); font-weight: 700; }
.about__x { position: absolute; right: 12px; top: 12px; width: 34px; height: 34px; border-radius: 50%; border: 0; background: transparent; cursor: pointer; font-size: 19px; color: var(--ink2); }
.about__x:hover { background: rgba(91, 70, 54, .08); }
.legend { display: grid; gap: 6px; margin: 4px 0 6px; }
.legend div { display: flex; align-items: baseline; gap: 8px; font-size: 14px; }
.legend i { flex: none; width: 10px; height: 10px; border-radius: 50%; background: var(--c); transform: translateY(1px); }

.nojs { position: fixed; left: 16px; right: 16px; top: 40%; text-align: center; }

/* 矮屏：标题和分类排成一行 */
@media (max-height: 560px) and (min-width: 561px) {
	.head { display: flex; align-items: center; gap: 12px; padding: 7px 10px 7px 12px; }
	.head h1 { font-size: 20px; }
	.head__sub { display: none; }
	.chip { height: 28px; }
}

/* 手机 */
@media (max-width: 720px) {
	.card {
		left: 8px; right: 8px; top: auto; width: auto;
		bottom: calc(var(--bot) + 4px);
		max-height: min(50%, calc(100% - var(--bot) - 120px));
		border-radius: 18px;
	}
	.card__top { padding: 12px 42px 6px 12px; gap: 10px; }
	.card__pic { width: 58px; height: 58px; }
	.card h2 { font-size: 18px; }
	.card__body p { font-size: 14.5px; line-height: 1.8; }
	body.has-card .ctl { visibility: hidden; }
	body.touring.has-card .card { top: var(--topgap); bottom: auto; max-height: calc(100% - var(--topgap) - var(--bot) - 120px); }
	body.touring.has-card .head { visibility: hidden; }
}
body.touring .about { padding-bottom: calc(var(--bot) + 8px); }
html.standalone .about { padding-top: 64px; }
@media (max-width: 560px) {
	.head { left: 8px; top: 8px; right: 8px; max-width: none; padding: 8px 10px 9px; border-radius: 16px; }
	html.standalone .head__row { padding-right: 150px; }
	.head h1 { font-size: 19px; letter-spacing: .04em; white-space: nowrap; }
	.about-b { width: 28px; padding: 0; justify-content: center; font-size: 0; }
	.about-b svg { width: 17px; height: 17px; }
	.head__sub { display: none; }
	.chips { flex-wrap: nowrap; gap: 5px; margin-top: 7px; overflow-x: auto; scrollbar-width: none; }
	.chips::-webkit-scrollbar { display: none; }
	.chip { height: 28px; padding: 0 9px 0 8px; font-size: 13px; gap: 5px; }
	.chip b { display: none; }
	.ctl { left: 8px; }
	.ctl button { width: 38px; height: 38px; border-radius: 12px; }
	.about__in { padding: 18px 16px 14px; }
}
@media (max-width: 360px) {
	.chip { padding: 0 8px 0 7px; font-size: 12.5px; }
	.chip i { width: 8px; height: 8px; }
}
@media (max-width: 350px) {
	.chips { flex-wrap: wrap; overflow: visible; }
}
@media (prefers-reduced-motion: reduce) {
	.pin, .pin__b, .card { transition: none; animation: none; }
}
@media print { .head, .ctl, .card { display: none; } }
