/* 口袋旅行（PocketTrip）：App 版面
   手機：上方 App 列 → 一次一個頁面（清單／地圖／動態／我）→ 底部分頁列；店家詳情、篩選、新增從下面滑上來。
   電腦（> 860px）：左邊是清單（或動態、我），右邊一直是地圖；分頁列放在左欄底部。 */
:root {
  --bg: #f6f5f1; --card: #ffffff; --text: #1f2226; --muted: #7d8189; --line: #e7e4dd; --soft: #f0eee8; --raise: #ffffff;
  --accent: #1f6f78; --accent-ink: #ffffff; --accent-soft: #e3f0f0;
  --heart: #e0516a; --star: #f0a92b; --star-off: #e4dfd3; --nav: #2f6fd6; --nav-ink: #ffffff; --rate-bg: #fbf5e7;
  --food: #e0703f; --cafe: #9a6b47; --spot: #2f8f5b; --shop: #6a62d1; --stay: #c4932f; --other: #8a8f98;
  --tank: #2f6fd6; --tank-2: #5aa7f0; --eva: #d9546d; --eva-2: #f08a9b;
  --sea: #dbe7ea; --land: #f4f2ec; --land-line: #c3c7c4;
  --shadow: 0 1px 2px rgba(20, 24, 28, .06), 0 0 0 1px var(--line);
  --shadow-up: 0 10px 30px rgba(20, 24, 28, .16);
  --font: -apple-system, BlinkMacSystemFont, "PingFang TC", "Noto Sans TC", "Microsoft JhengHei", sans-serif;
  --bar-h: 64px; --appbar-h: 52px;
  color-scheme: light;
}
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) {
    --bg: #14171a; --card: #1d2125; --text: #e9eaec; --muted: #9a9fa7; --line: #2e3339; --soft: #262b30; --raise: #23282d;
    --accent: #5cc2c9; --accent-ink: #0b2326; --accent-soft: #1b3236;
    --heart: #ff7a8c; --star: #f5c04e; --star-off: #3a3f45; --nav: #6ea2ff; --nav-ink: #0b1a33; --rate-bg: #2a2619;
    --sea: #121c22; --land: #23272c; --land-line: #3d434a;
    --shadow: 0 0 0 1px var(--line); --shadow-up: 0 10px 30px rgba(0, 0, 0, .5);
    color-scheme: dark;
  }
}
:root[data-theme="dark"] {
  --bg: #14171a; --card: #1d2125; --text: #e9eaec; --muted: #9a9fa7; --line: #2e3339; --soft: #262b30; --raise: #23282d;
  --accent: #5cc2c9; --accent-ink: #0b2326; --accent-soft: #1b3236;
  --heart: #ff7a8c; --star: #f5c04e; --star-off: #3a3f45; --nav: #6ea2ff; --nav-ink: #0b1a33; --rate-bg: #2a2619;
  --sea: #121c22; --land: #23272c; --land-line: #3d434a;
  --shadow: 0 0 0 1px var(--line); --shadow-up: 0 10px 30px rgba(0, 0, 0, .5);
  color-scheme: dark;
}

/* ---------- 基礎 ---------- */
* { box-sizing: border-box; }
html, body { min-height: 100%; }
body { margin: 0; background: var(--bg); color: var(--text); font-family: var(--font); font-size: 15px; -webkit-font-smoothing: antialiased;
  -webkit-tap-highlight-color: transparent; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
button:disabled { cursor: default; opacity: .45; }
[hidden] { display: none !important; }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 6px; }
svg.i { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 2; stroke-linecap: round; stroke-linejoin: round; flex: none; }
svg.i.s { width: 16px; height: 16px; }
svg.i.l { width: 24px; height: 24px; }
.pad { padding-left: max(16px, env(safe-area-inset-left, 0px)); padding-right: max(16px, env(safe-area-inset-right, 0px)); }

/* ---------- App 列 ---------- */
.appbar { position: sticky; top: 0; z-index: 600; display: flex; align-items: center; gap: 10px; background: var(--bg);
  height: calc(var(--appbar-h) + env(safe-area-inset-top, 0px));
  padding: env(safe-area-inset-top, 0px) max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.logo { width: 32px; height: 32px; border-radius: 9px; flex: none; box-shadow: 0 0 0 1px var(--line); }
.brand { font-size: 19px; letter-spacing: .02em; }
.sync { font-size: 12px; color: var(--muted); display: inline-flex; align-items: center; gap: 5px; }
.sync::before { content: ""; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); }
.sync[data-kind="api"]::before, .sync[data-kind="shared"]::before { background: #39b37a; }
.sync[data-kind="error"]::before { background: var(--heart); }
.avatar-btn { margin-left: auto; border-radius: 50%; }
.add-top { display: none; margin-left: auto; align-items: center; gap: 5px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; padding: 8px 13px; border-radius: 12px; }
.add-top + .avatar-btn { margin-left: 0; }

/* 頭像：Tank 藍、Eva 粉紅 */
.av { width: 34px; height: 34px; border-radius: 50%; display: inline-grid; place-items: center; color: #fff; font-weight: 800; font-size: 14px; flex: none;
  background: linear-gradient(140deg, var(--muted), var(--text)); }
.av.av-Tank { background: linear-gradient(140deg, var(--tank-2), var(--tank)); }
.av.av-Eva { background: linear-gradient(140deg, var(--eva-2), var(--eva)); }
.av.sm { width: 24px; height: 24px; font-size: 11px; }
.av.lg { width: 64px; height: 64px; font-size: 26px; }

/* ---------- 頁面 ---------- */
.views { display: block; }
.view { display: none; }
body[data-view="list"] #view-list, body[data-view="map"] #view-map,
body[data-view="activity"] #view-activity, body[data-view="me"] #view-me { display: block; }
.page { padding: 4px max(16px, env(safe-area-inset-right, 0px)) calc(var(--bar-h) + 30px + env(safe-area-inset-bottom, 0px)) max(16px, env(safe-area-inset-left, 0px)); }
.page-title { margin: 6px 0 2px; font-size: 24px; }
.page-sub { margin: 0 0 14px; color: var(--muted); font-size: 13.5px; }

/* ---------- 清單 ---------- */
.list-top { position: sticky; top: calc(var(--appbar-h) + env(safe-area-inset-top, 0px)); z-index: 500; background: var(--bg); display: grid; grid-template-columns: minmax(0, 1fr); gap: 10px;
  padding: 2px max(16px, env(safe-area-inset-right, 0px)) 0 max(16px, env(safe-area-inset-left, 0px)); }
.searchbar { display: flex; align-items: center; gap: 10px; background: var(--card); border-radius: 14px; padding: 4px 6px 4px 14px; box-shadow: var(--shadow); color: var(--muted); }
.searchbar input { flex: 1; min-width: 0; border: 0; background: none; padding: 9px 0; font-size: 16px; color: var(--text); outline: none; }
.searchbar input::placeholder { color: var(--muted); }
.filter-btn { display: inline-flex; align-items: center; gap: 5px; padding: 8px 10px; border-radius: 10px; color: var(--text); font-size: 14px; font-weight: 600; white-space: nowrap; }
.filter-btn.on { background: var(--accent-soft); color: var(--accent); }
.badge { background: var(--accent); color: var(--accent-ink); border-radius: 99px; min-width: 18px; height: 18px; padding: 0 5px; font-size: 11px;
  display: inline-grid; place-items: center; font-variant-numeric: tabular-nums; }
.active-filters { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.af { display: inline-flex; align-items: center; gap: 6px; border-radius: 999px; padding: 5px 6px 5px 11px; font-size: 13px; font-weight: 600;
  background: var(--c, var(--accent)); color: #fff; }
.af i { font-style: normal; width: 18px; height: 18px; border-radius: 50%; background: rgba(0, 0, 0, .18); display: inline-grid; place-items: center; font-size: 10px; }
.af-area { background: var(--accent); color: var(--accent-ink); }
.af-clear { color: var(--accent); text-decoration: underline; text-underline-offset: 3px; font-size: 13px; padding: 4px; }
.utabs { display: flex; gap: 20px; border-bottom: 1px solid var(--line); overflow-x: auto; scrollbar-width: none; }
.utabs button { padding: 4px 0 10px; font-size: 15px; color: var(--muted); white-space: nowrap; box-shadow: inset 0 -3px 0 transparent; transition: color .15s, box-shadow .15s; }
.utabs button.on { color: var(--text); font-weight: 700; box-shadow: inset 0 -3px 0 var(--accent); }
.utabs .n { font-style: normal; font-size: 12px; margin-left: 4px; color: var(--muted); font-weight: 400; font-variant-numeric: tabular-nums; }
.lhead { display: flex; align-items: center; gap: 6px; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 4px max(16px, env(safe-area-inset-left, 0px)); font-size: 13px; color: var(--muted); }
.sort-wrap { display: inline-flex; align-items: center; gap: 2px; }
#sort { border: 0; background: none; font-size: 13px; font-weight: 700; color: var(--text); padding: 4px 2px; }
.dice-btn { margin-left: auto; display: inline-flex; align-items: center; gap: 5px; color: var(--accent); font-weight: 700; font-size: 13.5px;
  background: var(--accent-soft); padding: 6px 11px; border-radius: 99px; }

.plist { list-style: none; margin: 0; padding: 0 0 calc(var(--bar-h) + 30px + env(safe-area-inset-bottom, 0px)); }
.item { display: flex; gap: 12px; align-items: center; padding: 12px max(16px, env(safe-area-inset-right, 0px)) 12px max(16px, env(safe-area-inset-left, 0px));
  cursor: pointer; transition: background .15s; position: relative; }
.item + .item::before { content: ""; position: absolute; top: 0; left: calc(max(16px, env(safe-area-inset-left, 0px)) + 84px); right: 0; border-top: 1px solid var(--soft); }
.item:active, .item.active { background: color-mix(in srgb, var(--accent) 7%, transparent); }
.thumb { width: 72px; height: 72px; border-radius: 14px; flex: none; display: grid; place-items: center; font-size: 30px; overflow: hidden; position: relative;
  background: color-mix(in srgb, var(--c, var(--other)) 18%, var(--card)); }
.thumb img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.info { flex: 1; min-width: 0; display: grid; gap: 3px; }
.info .n { font-size: 16px; font-weight: 700; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.info .m { font-size: 13px; color: var(--muted); display: flex; align-items: center; gap: 6px; min-width: 0; white-space: nowrap; overflow: hidden; }
.dotc { width: 7px; height: 7px; border-radius: 50%; flex: none; background: var(--c, var(--other)); }
.info .r { font-size: 13px; display: flex; align-items: center; gap: 7px; min-width: 0; color: var(--text); overflow: hidden; }
.st { color: var(--star); letter-spacing: 1px; font-size: 13px; white-space: nowrap; }
.st i { font-style: normal; color: var(--star-off); }
.seen { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; font-weight: 700; color: var(--accent); background: var(--accent-soft); padding: 2px 7px 2px 5px; border-radius: 99px; white-space: nowrap; }
.seen svg.i { width: 12px; height: 12px; stroke-width: 3; }
.gst { font-size: 11.5px; font-weight: 700; padding: 2px 7px; border-radius: 99px; white-space: nowrap; flex: none; }
.gst.closed { color: #fff; background: var(--heart); }
.gst.paused { color: color-mix(in srgb, var(--star) 70%, var(--text)); background: color-mix(in srgb, var(--star) 22%, var(--card)); }
.item.is-closed .thumb, .item.is-closed .info .n { opacity: .5; }
.item.is-closed .info .n { text-decoration: line-through; text-decoration-thickness: 1.5px; }
.mpin.closed { filter: grayscale(1); opacity: .7; }
.sub { color: var(--muted); font-size: 12.5px; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.heart-btn { align-self: flex-start; color: #b9bcc2; padding: 4px; margin: -2px -4px 0 0; border-radius: 50%; }
.heart-btn.on { color: var(--heart); }
.heart-btn.on svg { fill: currentColor; }
.heart-btn.on { animation: pop .3s ease; }
.empty { padding: 50px 24px; text-align: center; color: var(--muted); display: grid; gap: 12px; justify-items: center; list-style: none; }
.empty svg.i { width: 40px; height: 40px; stroke-width: 1.5; }
.empty button { color: var(--accent); font-weight: 700; }
/* 載入中的骨架 */
.skel { display: flex; gap: 12px; padding: 12px 16px; align-items: center; list-style: none; }
.skel i, .skel b { display: block; border-radius: 10px; background: linear-gradient(90deg, var(--soft), var(--line), var(--soft)); background-size: 200% 100%; animation: shimmer 1.2s infinite linear; }
.skel i { width: 72px; height: 72px; border-radius: 14px; flex: none; }
.skel span { flex: 1; display: grid; gap: 8px; }
.skel b:nth-child(1) { width: 60%; height: 15px; } .skel b:nth-child(2) { width: 40%; height: 12px; } .skel b:nth-child(3) { width: 30%; height: 12px; }

/* ---------- 地圖 ---------- */
#view-map { position: fixed; inset: 0; z-index: 1; }
#map { position: absolute; inset: 0; background: var(--sea); }
#map.vector { background: var(--sea); }
.map-top { position: absolute; z-index: 500; left: 0; right: 0; top: calc(56px + env(safe-area-inset-top, 0px));
  padding: 0 max(12px, env(safe-area-inset-right, 0px)) 0 max(12px, env(safe-area-inset-left, 0px)); pointer-events: none; }
.mapcats { display: flex; gap: 6px; overflow-x: auto; scrollbar-width: none; pointer-events: auto; padding: 4px 2px 8px; }
.mapcats button { flex: none; background: var(--raise); border-radius: 99px; padding: 7px 12px; font-size: 13px; font-weight: 600; box-shadow: 0 2px 8px rgba(0, 0, 0, .14); white-space: nowrap; }
.mapcats button.on { background: var(--c, var(--accent)); color: #fff; }
.area-search { position: absolute; top: calc(108px + env(safe-area-inset-top, 0px)); left: 50%; transform: translateX(-50%); z-index: 1000;
  background: var(--raise); color: var(--accent); font-weight: 700; font-size: 13px; padding: 8px 14px; border-radius: 999px;
  box-shadow: 0 3px 12px rgba(0, 0, 0, .2); display: inline-flex; gap: 6px; align-items: center; white-space: nowrap; }
.locate-btn { position: absolute; z-index: 500; right: max(14px, env(safe-area-inset-right, 0px)); bottom: calc(var(--bar-h) + 136px + env(safe-area-inset-bottom, 0px));
  width: 44px; height: 44px; border-radius: 14px; background: var(--raise); color: var(--nav); display: grid; place-items: center; box-shadow: 0 3px 12px rgba(0, 0, 0, .18); }
.carousel { position: absolute; z-index: 500; left: 0; right: 0; bottom: calc(var(--bar-h) + 14px + env(safe-area-inset-bottom, 0px)); display: flex; gap: 10px;
  overflow-x: auto; scroll-snap-type: x mandatory; scrollbar-width: none; padding: 4px max(16px, env(safe-area-inset-left, 0px)); }
.ccard { flex: none; width: min(300px, 82vw); scroll-snap-align: center; background: var(--raise); border-radius: 18px; box-shadow: 0 6px 22px rgba(0, 0, 0, .18);
  display: flex; gap: 12px; padding: 10px; align-items: center; cursor: pointer; border: 2px solid transparent; }
.ccard.active { border-color: var(--accent); }
.ccard .thumb { width: 76px; height: 76px; }
.go-btn { margin-left: auto; width: 42px; height: 42px; border-radius: 12px; background: var(--nav); color: var(--nav-ink); display: grid; place-items: center; flex: none; }
/* 標記：水滴形，裡面是分類圖示；收藏的是愛心 */
.mpin { width: 32px; height: 32px; border-radius: 50% 50% 50% 4px; transform: rotate(-45deg); display: grid; place-items: center;
  background: var(--c); border: 2.5px solid #fff; box-shadow: 0 3px 8px rgba(0, 0, 0, .3); transition: transform .15s; }
.mpin span { transform: rotate(45deg); font-size: 15px; line-height: 1; }
.mpin.fav { background: var(--heart); }
.mpin.visited { filter: saturate(.55); }
.mpin.active { transform: rotate(-45deg) scale(1.35); z-index: 1000; }
.cluster { width: 38px; height: 38px; border-radius: 50%; display: grid; place-items: center; font-size: 13px; font-weight: 800;
  background: var(--accent); color: var(--accent-ink); border: 4px solid color-mix(in srgb, var(--accent) 30%, transparent); background-clip: padding-box; }
.leaflet-container { font-family: var(--font); }
/* 底圖（OpenStreetMap）調淡一點，讓標記比較突出；深色模式反轉成暗色 */
.leaflet-tile-pane { filter: saturate(.55) contrast(.92) brightness(1.04); }
@media (prefers-color-scheme: dark) { :root:not([data-theme="light"]) .leaflet-tile-pane { filter: invert(.92) hue-rotate(180deg) saturate(.45) brightness(.9) contrast(.9); } }
:root[data-theme="dark"] .leaflet-tile-pane { filter: invert(.92) hue-rotate(180deg) saturate(.45) brightness(.9) contrast(.9); }
.leaflet-control-attribution { font-size: 10px; }
.here-dot { width: 18px; height: 18px; border-radius: 50%; background: var(--nav); border: 3px solid #fff; box-shadow: 0 0 0 8px color-mix(in srgb, var(--nav) 22%, transparent); }

/* ---------- 底部分頁列 ---------- */
.tabbar { position: fixed; z-index: 800; left: 0; right: 0; bottom: 0; height: calc(var(--bar-h) + env(safe-area-inset-bottom, 0px));
  padding: 8px max(8px, env(safe-area-inset-right, 0px)) env(safe-area-inset-bottom, 0px) max(8px, env(safe-area-inset-left, 0px));
  display: grid; grid-auto-flow: column; grid-auto-columns: minmax(0, 1fr); align-items: start;
  background: color-mix(in srgb, var(--card) 92%, transparent); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px); border-top: 1px solid var(--line); }
.tabbar > button { display: grid; justify-items: center; gap: 3px; font-size: 11px; color: var(--muted); padding-top: 2px; }
.tabbar > button.on { color: var(--accent); font-weight: 700; }
.tab-add span { width: 54px; height: 54px; margin-top: -24px; border-radius: 18px; background: var(--accent); color: var(--accent-ink); display: grid; place-items: center;
  box-shadow: 0 8px 18px color-mix(in srgb, var(--accent) 45%, transparent); transition: transform .15s; }
.tab-add:active span { transform: scale(.94); }

/* ---------- 浮層、面板 ---------- */
.overlay { position: fixed; inset: 0; z-index: 2000; background: rgba(12, 16, 20, .45); display: grid; place-items: center; padding: 16px; animation: fade .2s ease; }
.sheet-overlay { place-items: end center; padding: 0; }
.sheet { width: min(560px, 100%); background: var(--card); border-radius: 24px 24px 0 0; box-shadow: var(--shadow-up); max-height: 92dvh; overflow-y: auto;
  padding: 10px max(18px, env(safe-area-inset-right, 0px)) calc(18px + env(safe-area-inset-bottom, 0px)) max(18px, env(safe-area-inset-left, 0px));
  display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; animation: up .28s cubic-bezier(.2, .8, .2, 1); overscroll-behavior: contain; }
.grab { width: 40px; height: 5px; border-radius: 9px; background: var(--line); margin: 0 auto 2px; }
.sheet-head { display: flex; align-items: center; gap: 8px; }
.sheet-title { margin: 0; font-size: 19px; }
.sheet-sub { margin: -6px 0 0; color: var(--muted); font-size: 14px; }
.icon-btn { margin-left: auto; width: 34px; height: 34px; border-radius: 50%; display: grid; place-items: center; background: var(--soft); color: var(--text); }
.text-btn { margin-left: auto; color: var(--accent); font-weight: 600; font-size: 14px; }
.btn-primary { background: var(--accent); color: var(--accent-ink); font-weight: 700; border-radius: 14px; padding: 13px 16px; font-size: 16px; }
.btn-ghost { background: var(--soft); color: var(--text); font-weight: 600; border-radius: 14px; padding: 13px 16px; font-size: 16px; }
.btn-row { display: flex; gap: 10px; }
.btn-row > * { flex: 1; }
.btn-row .btn-primary { flex: 2; }
.form-msg { margin: 0; min-height: 1.2em; color: var(--heart); font-size: 13.5px; }
.form-msg:empty { min-height: 0; }
.dialog { position: relative; width: min(420px, 100%); background: var(--card); border-radius: 22px; box-shadow: var(--shadow-up); padding: 26px 20px 20px;
  display: grid; gap: 12px; text-align: center; animation: zoom .22s ease; }

/* 店家詳情 */
.detail-sheet { padding: 0 0 calc(18px + env(safe-area-inset-bottom, 0px)); gap: 0; }
.d-photo { height: 200px; position: relative; display: grid; place-items: center; font-size: 68px; overflow: hidden;
  background: radial-gradient(120% 90% at 30% 20%, color-mix(in srgb, var(--c) 25%, #fff), color-mix(in srgb, var(--c) 70%, #fff) 60%, var(--c)); }
.d-photo > span { filter: drop-shadow(0 4px 10px rgba(0, 0, 0, .15)); }
.d-photo img { position: absolute; inset: 0; width: 100%; height: 100%; object-fit: cover; }
.d-photo .grab { position: absolute; top: 8px; left: 50%; transform: translateX(-50%); background: rgba(255, 255, 255, .85); z-index: 1; }
.d-close { position: absolute; z-index: 1; top: 12px; right: 12px; width: 34px; height: 34px; border-radius: 50%; background: rgba(0, 0, 0, .35); color: #fff; display: grid; place-items: center; }
.d-credit { position: absolute; z-index: 1; right: 10px; bottom: 8px; font-size: 10.5px; color: rgba(255, 255, 255, .92); background: rgba(0, 0, 0, .35); padding: 2px 8px; border-radius: 99px; }
.d-body { padding: 16px max(18px, env(safe-area-inset-right, 0px)) 0 max(18px, env(safe-area-inset-left, 0px)); display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; }
.d-name { margin: 0; font-size: 23px; line-height: 1.25; }
.d-meta b { color: var(--text); }
.d-meta { display: flex; flex-wrap: wrap; gap: 6px 10px; align-items: center; font-size: 13.5px; color: var(--muted); margin-top: -6px; }
.pill { border: 0; font-family: inherit; cursor: default; }
button.pill { cursor: pointer; display: inline-flex; align-items: center; gap: 3px; }
button.pill svg.i { width: 13px; height: 13px; stroke-width: 2.5; }
.d-cats { display: flex; flex-wrap: wrap; gap: 6px; margin-top: -6px; align-items: center; }
.d-cats small { width: 100%; color: var(--muted); font-size: 12.5px; }
.d-cats button { padding: 6px 11px; border-radius: 99px; font-size: 13.5px; font-weight: 600; border: 1.5px solid color-mix(in srgb, var(--c) 40%, var(--card)); color: color-mix(in srgb, var(--c) 80%, var(--text)); background: var(--card); }
.d-cats button.on { background: var(--c); border-color: var(--c); color: #fff; }
.pill { padding: 3px 10px; border-radius: 99px; font-weight: 700; font-size: 12.5px; background: color-mix(in srgb, var(--c) 16%, var(--card)); color: color-mix(in srgb, var(--c) 80%, var(--text)); }
.d-flags { display: flex; flex-wrap: wrap; gap: 4px 14px; font-size: 12.5px; font-weight: 600; margin-top: -6px; }
.d-flags .f-fav { color: var(--heart); } .d-flags .f-visit { color: var(--accent); }
.d-flags time { font-weight: 400; opacity: .85; }
.d-acts { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 8px; }
.d-acts > * { display: grid; justify-items: center; gap: 5px; font-size: 12px; font-weight: 600; padding: 11px 2px; border-radius: 14px; background: var(--soft); color: var(--text); text-decoration: none; text-align: center; line-height: 1.2; }
.d-acts .pri { background: var(--nav); color: var(--nav-ink); }
.d-acts .fav.on { color: var(--heart); } .d-acts .fav.on svg { fill: currentColor; }
.d-more { display: flex; gap: 8px; justify-content: flex-end; align-items: center; font-size: 13.5px; }
.d-more .del { color: var(--heart); font-weight: 700; display: inline-flex; gap: 6px; align-items: center; padding: 8px 12px; border-radius: 12px; background: color-mix(in srgb, var(--heart) 10%, var(--card)); }
.d-more .del.armed { background: var(--heart); color: #fff; }
.rate-box { border-radius: 18px; background: var(--rate-bg); padding: 14px; display: grid; grid-template-columns: minmax(0, 1fr); gap: 12px; }
@media (max-width: 360px) { .rate-me .av { display: none; } .bigstars button { font-size: 27px; padding: 0 1px; } }
.rate-me { display: flex; align-items: center; gap: 10px; }
.bigstars { display: inline-flex; }
.bigstars button { font-size: 30px; line-height: 1; padding: 0 2px; color: var(--star-off); transition: transform .1s; }
.bigstars button.on { color: var(--star); }
.bigstars button:active { transform: scale(1.2); }
.visit-btn { margin-left: auto; display: inline-flex; gap: 4px; align-items: center; font-size: 13px; font-weight: 700; padding: 7px 12px; border-radius: 99px;
  background: var(--card); color: var(--text); box-shadow: 0 0 0 1px var(--line); white-space: nowrap; }
.visit-btn.on { background: var(--accent); color: var(--accent-ink); box-shadow: none; }
.rate-hint { margin: -4px 0 0; font-size: 12px; color: var(--muted); }
.tags { display: flex; flex-wrap: wrap; gap: 6px; }
.tags button { font-size: 13.5px; padding: 6px 12px; border-radius: 99px; background: var(--card); box-shadow: 0 0 0 1px color-mix(in srgb, var(--star) 35%, var(--line)); }
.tags button.on { background: var(--accent); color: var(--accent-ink); box-shadow: none; font-weight: 700; }
.cbox { display: flex; gap: 8px; }
.cbox input { flex: 1; min-width: 0; padding: 10px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--card); font-size: 16px; }
.cbox button { flex: none; padding: 0 14px; border-radius: 12px; background: var(--accent); color: var(--accent-ink); font-weight: 700; font-size: 14px; }
.cbox button:disabled { background: var(--soft); color: var(--muted); opacity: 1; }
.review { display: flex; gap: 10px; align-items: flex-start; }
.review p { margin: 0; font-size: 14.5px; display: flex; flex-wrap: wrap; gap: 2px 8px; align-items: baseline; }
.review small { display: block; color: var(--muted); font-size: 12px; margin-top: 2px; }
.d-rows { display: grid; gap: 11px; font-size: 14px; padding-bottom: 6px; }
.d-rows div { display: flex; gap: 10px; align-items: flex-start; color: color-mix(in srgb, var(--text) 85%, var(--muted)); }
.d-rows svg.i { color: var(--muted); margin-top: 2px; width: 17px; height: 17px; }

/* 登入 */
.overlay.login { background: radial-gradient(130% 70% at 50% 0%, var(--accent-soft) 0, var(--bg) 62%); place-items: center; }
.login-card { width: min(380px, 100%); display: grid; gap: 14px; justify-items: center; text-align: center; animation: zoom .25s ease; }
.biglogo { width: 84px; height: 84px; border-radius: 22px; box-shadow: 0 14px 30px color-mix(in srgb, var(--accent) 30%, transparent), 0 0 0 1px var(--line); }
.login-card h2 { margin: 8px 0 0; font-size: 28px; }
.login-en { margin: -12px 0 0; font-size: 13px; font-weight: 700; letter-spacing: .18em; color: var(--accent); }
.login-sub { margin: -6px 0 14px; color: var(--muted); font-size: 15px; }
.who-cards { display: flex; gap: 14px; justify-content: center; width: 100%; }
.who-cards button { flex: 1; max-width: 150px; padding: 16px 0 14px; border-radius: 20px; background: var(--card); display: grid; justify-items: center; gap: 8px;
  font-weight: 700; font-size: 16px; box-shadow: var(--shadow); transition: box-shadow .15s, transform .15s; }
.who-cards button.on { box-shadow: 0 0 0 2.5px var(--accent), 0 10px 24px color-mix(in srgb, var(--accent) 18%, transparent); }
.who-cards button:active { transform: scale(.97); }
.who-cards small { color: var(--muted); font-weight: 400; font-size: 12px; }
#login-pw { width: 100%; margin-top: 8px; padding: 15px 16px; border-radius: 14px; border: 0; background: var(--card); box-shadow: var(--shadow); font-size: 16px; }
.login-card .btn-primary { width: 100%; }
.login-foot { color: var(--muted); font-size: 12.5px; }
.small-sheet { padding-bottom: calc(26px + env(safe-area-inset-bottom, 0px)); }

/* 新增 */
.add-sheet form { display: grid; gap: 8px; }
.add-sheet label { font-size: 13px; font-weight: 600; color: var(--muted); }
.add-sheet textarea, .add-sheet input, .add-sheet select { width: 100%; padding: 11px 12px; border-radius: 12px; border: 1px solid var(--line); background: var(--soft); font-size: 16px; }
.add-sheet textarea { resize: vertical; min-height: 84px; }
.add-row { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; }
.add-row > div { display: grid; gap: 4px; min-width: 0; }
.add-addr { margin: 0; font-size: 13px; color: var(--muted); }
.add-addr a { color: var(--accent); white-space: nowrap; }
.add-dup { padding: 10px 12px; border-radius: 12px; background: color-mix(in srgb, var(--star) 18%, var(--card)); font-size: 14px; }
.add-dup button { margin-left: 6px; color: var(--accent); font-weight: 700; text-decoration: underline; }

/* 篩選 */
.f-sec { margin: 4px 0 -4px; font-size: 13px; font-weight: 700; color: var(--muted); }
.f-cats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; }
.f-cats button { border: 1.5px solid color-mix(in srgb, var(--c) 40%, var(--card)); background: var(--card); color: color-mix(in srgb, var(--c) 80%, var(--text));
  border-radius: 14px; padding: 10px 4px; font-size: 14px; font-weight: 600; display: grid; gap: 2px; justify-items: center; }
.f-cats button em { font-style: normal; font-size: 11px; font-weight: 400; opacity: .8; }
.f-cats button.on { background: var(--c); border-color: var(--c); color: #fff; }
.f-areas { display: flex; flex-wrap: wrap; gap: 6px; }
.f-areas button { border: 1px solid var(--line); background: var(--card); border-radius: 999px; padding: 6px 12px; font-size: 13.5px; }
.f-sub button { background: var(--soft); }
.f-areas button.on { background: var(--accent); border-color: var(--accent); color: var(--accent-ink); font-weight: 700; }
.f-areas em { font-style: normal; font-size: 11px; opacity: .7; margin-left: 4px; }
.seg { display: flex; background: var(--soft); border-radius: 12px; padding: 3px; }
.seg button { flex: 1; padding: 8px; border-radius: 9px; font-size: 14px; color: var(--muted); }
.seg button.on { background: var(--card); color: var(--text); font-weight: 700; box-shadow: 0 1px 3px rgba(0, 0, 0, .12); }
.f-btns { position: sticky; bottom: calc(-18px - env(safe-area-inset-bottom, 0px)); display: flex; gap: 10px; background: var(--card);
  padding: 10px 0 calc(18px + env(safe-area-inset-bottom, 0px)); margin-bottom: calc(-18px - env(safe-area-inset-bottom, 0px)); border-top: 1px solid var(--soft); }
.f-btns .btn-ghost { flex: 1; } .f-btns .btn-primary { flex: 2; }

/* 今天吃什麼 */
.r-eyebrow { margin: 0; font-size: 12px; letter-spacing: .15em; color: var(--muted); }
.r-pool { margin: -6px 0 0; font-size: 13px; color: var(--muted); }
.r-window { min-height: 80px; display: grid; place-items: center; border-radius: 16px; background: var(--soft); padding: 8px 12px; overflow: hidden; }
.r-name { font-size: 24px; font-weight: 800; text-wrap: balance; }
.r-name.bump { animation: slide .12s ease-out; }
.r-name.final { color: var(--accent); animation: pop .35s ease; }
.r-meta { margin: 0; min-height: 1.4em; font-size: 14px; color: var(--muted); }
.r-close { position: absolute; top: 12px; right: 12px; }

/* 動態 */
.feed { list-style: none; margin: 0; padding: 0; display: grid; }
.feed .day { font-size: 12.5px; font-weight: 700; color: var(--muted); padding: 14px 0 6px; position: sticky; top: calc(var(--appbar-h) + env(safe-area-inset-top, 0px)); background: var(--bg); z-index: 1; }
.feed .ev { display: flex; gap: 12px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--soft); }
.feed .ev p { margin: 0; font-size: 14.5px; line-height: 1.45; flex: 1; min-width: 0; }
.feed .ev time { color: var(--muted); font-size: 12px; font-variant-numeric: tabular-nums; flex: none; margin-top: 2px; }
.feed .ev button { color: var(--accent); font-weight: 700; text-align: left; }
.feed .gone { color: var(--muted); text-decoration: line-through; }
.feed .empty { padding: 40px 0; }
.more-btn { width: 100%; margin-top: 12px; padding: 12px; border-radius: 12px; background: var(--card); box-shadow: var(--shadow); font-weight: 600; }

/* 我 */
.me { display: grid; gap: 18px; padding-top: 10px; }
.me-head { display: flex; align-items: center; gap: 14px; }
.me-head b { font-size: 22px; display: block; }
.me-head small { color: var(--muted); font-size: 13px; }
.stats { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.stat { background: var(--card); border-radius: 16px; padding: 14px; box-shadow: var(--shadow); display: grid; gap: 2px; }
.stat b { font-size: 26px; font-variant-numeric: tabular-nums; }
.stat b small { font-size: 14px; color: var(--muted); font-weight: 600; }
.stat span { font-size: 13px; color: var(--muted); }
.stat .bar { height: 6px; border-radius: 9px; background: var(--soft); overflow: hidden; margin-top: 6px; }
.stat .bar i { display: block; height: 100%; background: var(--accent); border-radius: inherit; }
.duo { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); padding: 14px; display: grid; gap: 10px; }
.duo h3 { margin: 0; font-size: 14px; color: var(--muted); }
.duo .row { display: flex; align-items: center; gap: 10px; font-size: 14px; }
.duo .row span:last-child { margin-left: auto; color: var(--muted); font-variant-numeric: tabular-nums; }
.menu { background: var(--card); border-radius: 16px; box-shadow: var(--shadow); overflow: hidden; }
.menu button { width: 100%; display: flex; align-items: center; gap: 12px; padding: 14px; font-size: 15px; text-align: left; }
.menu button + button { border-top: 1px solid var(--soft); }
.menu .danger { color: var(--heart); }
.me-foot { text-align: center; color: var(--muted); font-size: 12px; }

/* 提示 */
.toast { position: fixed; z-index: 3000; left: 50%; bottom: calc(var(--bar-h) + 16px + env(safe-area-inset-bottom, 0px)); transform: translateX(-50%);
  background: var(--text); color: var(--bg); padding: 11px 16px; border-radius: 14px; font-size: 14px; max-width: calc(100% - 32px);
  display: flex; align-items: center; gap: 14px; box-shadow: var(--shadow-up); animation: up .22s ease; }
.toast span { min-width: 0; }
body[data-view="map"] .toast { bottom: calc(var(--bar-h) + 130px + env(safe-area-inset-bottom, 0px)); }
.toast button { flex: none; color: inherit; font-weight: 800; text-decoration: underline; text-underline-offset: 3px; white-space: nowrap; }

@keyframes pop { 0% { transform: scale(1); } 50% { transform: scale(1.25); } 100% { transform: scale(1); } }
@keyframes slide { from { transform: translateY(-40%); opacity: .2; } to { transform: none; opacity: 1; } }
@keyframes up { from { transform: translateY(24px); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes zoom { from { transform: scale(.96); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes shimmer { from { background-position: 200% 0; } to { background-position: -200% 0; } }
@media (prefers-reduced-motion: reduce) { *, *::before, *::after { animation: none !important; transition: none !important; } }

/* ---------- 電腦：左邊清單（或動態、我）、右邊地圖 ---------- */
@media (min-width: 861px) {
  :root { --side: 440px; }
  .appbar { width: var(--side); }
  .views { display: block; }
  .view { display: none; }
  body[data-view="list"] #view-list, body[data-view="map"] #view-list { display: block; }
  #view-list, #view-activity, #view-me { width: var(--side); }
  #view-map { display: block !important; left: var(--side); }
  .map-top { top: 12px; }
  .area-search { top: 64px; }
  .tabbar { width: var(--side); right: auto; }
  .tabbar > button[data-view="map"] { display: none; }
  .carousel, .locate-btn { bottom: 18px; }
  .locate-btn { bottom: 130px; }
  .toast { left: calc(var(--side) / 2); }
  .sheet-overlay { place-items: center; padding: 20px; }
  .sheet { border-radius: 24px; max-height: 88dvh; }
  /* 新增按鈕移到上面；分頁列只剩清單、動態、我 */
  body.api .add-top { display: inline-flex; }
  .tabbar > .tab-add { display: none; }
  /* 清單緊一點 */
  .item { padding-top: 9px; padding-bottom: 9px; gap: 11px; }
  .item .thumb { width: 58px; height: 58px; border-radius: 12px; font-size: 24px; }
  .item + .item::before { left: calc(max(16px, env(safe-area-inset-left, 0px)) + 69px); }
  /* 店家詳情：清單和地圖中間的一欄，地圖往右讓出位置 */
  :root { --detail-w: 400px; }
  #detail.sheet-overlay { inset: 0 auto 0 var(--side); width: var(--detail-w); padding: 0; background: none; place-items: stretch; animation: none; z-index: 900; }
  #detail .sheet { width: 100%; height: 100dvh; max-height: none; border-radius: 0; box-shadow: 1px 0 0 var(--line), 8px 0 24px rgba(0, 0, 0, .08); animation: slidein .2s ease; }
  #detail .grab { display: none; }
  #detail .d-photo { height: 220px; }
  body.detail-open #view-map { left: calc(var(--side) + var(--detail-w)); }
  @keyframes slidein { from { transform: translateX(-16px); opacity: 0; } to { transform: none; opacity: 1; } }
}
