/* ================= 足迹网页版 · 组件与布局 =================
   颜色/圆角/字号/动画一律取 tokens.css 变量（与 App AppTheme 同源），
   禁止在本文件新增裸色值（阴影透明度黑/白两级亦由 tokens 提供）。 */

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  font-family: -apple-system, "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--text);
  font-size: var(--fs-body); line-height: 1.45;
  overflow: hidden; overscroll-behavior: none;
}
::selection { background: var(--primary); color: var(--on-primary); }
button { font: inherit; color: inherit; background: none; border: none; cursor: pointer; }
input, textarea, select { font: inherit; color: var(--text); }
img { display: block; }
a { color: var(--primary); text-decoration: none; }
.num { font-variant-numeric: tabular-nums; }
::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-thumb { background: var(--border); border-radius: 3px; }

/* ================= 壳与导航 ================= */
#app { height: 100%; }
.tabbar {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 60;
  display: flex; justify-content: space-around; align-items: stretch;
  height: calc(56px + env(safe-area-inset-bottom));
  padding-bottom: env(safe-area-inset-bottom);
  background: var(--surface); border-top: 1px solid var(--border);
}
.tab-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; justify-content: center;
  gap: 2px; color: var(--text-2); font-size: var(--fs-micro);
  transition: color var(--t-fast) var(--ease); position: relative;
}
.tab-item svg { width: 22px; height: 22px; }
.tab-item.on { color: var(--primary); font-weight: 600; }
.tab-item .dot {
  position: absolute; top: 8px; right: calc(50% - 16px);
  min-width: 15px; height: 15px; padding: 0 4px; border-radius: 8px;
  background: var(--error); color: #fff; font-size: 10px;
  display: flex; align-items: center; justify-content: center;
}
.content { position: absolute; inset: 0; }
@media (min-width: 900px) {
  .tabbar {
    top: 0; bottom: 0; left: 0; right: auto; width: 200px;
    flex-direction: column; justify-content: flex-start; gap: 4px;
    height: auto; padding: 20px 10px; border-top: none; border-right: 1px solid var(--border);
  }
  .tab-item { flex: none; flex-direction: row; justify-content: flex-start; gap: 12px;
    padding: 12px 16px; border-radius: var(--r-md); font-size: var(--fs-label); }
  .tab-item.on { background: var(--chip-idle); }
  .tab-item .dot { position: static; margin-left: auto; }
  .content { left: 200px; }
}
.brand-mini { display: none; padding: 0 16px 16px; font-size: var(--fs-title); font-weight: 700; letter-spacing: -0.2px; }
.brand-mini small { display: block; color: var(--text-3); font-size: var(--fs-micro); font-weight: 400; letter-spacing: 2px; }
@media (min-width: 900px) { .brand-mini { display: block; } }

/* ================= 页面容器 ================= */
.page {
  position: absolute; inset: 0; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: var(--sp-lg) var(--sp-lg) calc(72px + env(safe-area-inset-bottom));
}
@media (min-width: 900px) { .page { padding-bottom: var(--sp-xl); } }
.page-narrow { max-width: 560px; margin: 0 auto; }
.ph { display: flex; align-items: center; gap: var(--sp-sm); margin-bottom: var(--sp-lg); }
.ph .back {
  width: 34px; height: 34px; border-radius: var(--r-sm); display: flex;
  align-items: center; justify-content: center; background: var(--chip-idle); color: var(--text);
}
.ph h1 { font-size: var(--fs-title); font-weight: 700; letter-spacing: -0.2px; flex: 1; }
.ph .act { color: var(--primary); font-size: var(--fs-label); font-weight: 600; display: flex; align-items: center; gap: 4px; flex: none; white-space: nowrap; }

/* 子页推入动画（页面入场统一 320ms） */
.subpage { position: absolute; inset: 0; z-index: 40; background: var(--bg);
  animation: slideIn var(--t-slow) var(--ease); display: flex; flex-direction: column; }
@keyframes slideIn { from { transform: translateX(24%); opacity: 0; } to { transform: none; opacity: 1; } }
@keyframes fadeUp { from { transform: translateY(10px); opacity: 0; } to { transform: none; opacity: 1; } }
.fade-up { animation: fadeUp var(--t-normal) var(--ease); }

/* ================= 卡片 / 分组 ================= */
.card {
  background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-card);
  padding: var(--sp-lg); margin-bottom: var(--sp-md);
}
.card-title { font-size: var(--fs-label); font-weight: 600; margin-bottom: var(--sp-sm); }
.divider { height: 1px; background: var(--divider); margin: var(--sp-sm) 0; border: none; }

/* 设置分组（对齐 App SettingBlock） */
.setting-block {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-md);
  margin-bottom: var(--sp-md); overflow: hidden;
}
.setting-block > .sb-head {
  display: flex; align-items: center; gap: var(--sp-sm);
  padding: var(--sp-md) var(--sp-lg); color: var(--text); font-size: var(--fs-label); font-weight: 600;
}
.sb-head .ic-tile { width: 30px; height: 30px; border-radius: var(--r-sm); display: flex;
  align-items: center; justify-content: center; background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); }
.sb-head .ic-tile svg { width: 17px; height: 17px; }
.sb-row {
  display: flex; align-items: center; gap: var(--sp-sm);
  padding: 12px var(--sp-lg); border-top: 1px solid var(--divider);
  min-height: 46px; font-size: var(--fs-label);
}
.sb-row .grow { flex: 1; min-width: 0; }
.sb-row .sub { display: block; color: var(--text-2); font-size: var(--fs-body); margin-top: 1px; }
.sb-row .trail { color: var(--text-2); font-size: var(--fs-body); display: flex; align-items: center; gap: 6px; }

/* ================= 按钮 / 输入 ================= */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  border-radius: var(--r-sm); padding: 10px 18px;
  font-size: var(--fs-label); font-weight: 600;
  transition: transform var(--t-fast) var(--ease), opacity var(--t-fast) var(--ease);
}
/* core.js 的 svg 只带 viewBox 无宽高，不约束会被 flex 拉成 100% 宽等比巨形 */
.btn svg { width: 17px; height: 17px; flex: none; }
.ph .act svg { width: 15px; height: 15px; }
.btn:active { transform: scale(0.97); }
.btn[disabled] { opacity: 0.5; pointer-events: none; }
.btn-primary { background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); color: var(--on-primary); }
.btn-ghost { background: var(--chip-idle); color: var(--text); }
.btn-danger { background: color-mix(in srgb, var(--error) 14%, transparent); color: var(--error); }
.btn-block { width: 100%; }
.btn-sm { padding: 6px 12px; font-size: var(--fs-body); }
.icon-btn {
  width: 38px; height: 38px; border-radius: var(--r-sm); display: inline-flex;
  align-items: center; justify-content: center; background: var(--chip-idle); color: var(--text-2);
  transition: color var(--t-fast) var(--ease), background var(--t-fast) var(--ease);
}
.icon-btn.on { color: var(--primary); background: color-mix(in srgb, var(--primary) 14%, transparent); }
.icon-btn svg { width: 19px; height: 19px; }
.field { width: 100%; background: var(--surface-high); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 11px var(--sp-md); font-size: var(--fs-label); outline: none;
  transition: border-color var(--t-fast) var(--ease); }
.field:focus { border-color: var(--primary); }
textarea.field { resize: vertical; min-height: 72px; }
.field-label { display: block; color: var(--text-2); font-size: var(--fs-body); margin: var(--sp-md) 0 6px; }

/* switch（对齐 App 外观） */
.switch { position: relative; width: 44px; height: 26px; border-radius: 13px;
  background: var(--chip-idle); border: 1px solid var(--border); transition: background var(--t-normal) var(--ease); flex: none; }
.switch::after { content: ""; position: absolute; top: 2px; left: 2px; width: 20px; height: 20px;
  border-radius: 50%; background: var(--text-3); transition: transform var(--t-normal) var(--ease), background var(--t-normal) var(--ease); }
.switch.on { background: color-mix(in srgb, var(--primary) 35%, transparent); border-color: transparent; }
.switch.on::after { transform: translateX(18px); background: var(--primary); }

/* ================= chips / pills / badge ================= */
.chips { display: flex; flex-wrap: wrap; gap: var(--sp-sm); }
.chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; border-radius: 18px; font-size: var(--fs-body);
  background: var(--chip-idle); color: var(--text-2); border: 1px solid transparent;
  transition: all var(--t-fast) var(--ease);
}
.chip.on { background: color-mix(in srgb, var(--primary) 12%, transparent); color: var(--primary); border-color: color-mix(in srgb, var(--primary) 40%, transparent); font-weight: 600; }
.chip svg { width: 14px; height: 14px; }
.pills { display: inline-flex; background: var(--chip-idle); border-radius: var(--r-sm); padding: 3px; gap: 2px; }
.pill { padding: 6px 16px; border-radius: 8px; font-size: var(--fs-label); color: var(--text-2); transition: all var(--t-fast) var(--ease); }
.pill.on { background: var(--primary); color: var(--on-primary); font-weight: 600; }
.badge {
  display: inline-flex; align-items: center; padding: 2px 7px; border-radius: 6px;
  font-size: var(--fs-micro); font-weight: 600;
  background: color-mix(in srgb, var(--accent) 16%, transparent); color: var(--accent);
}
.badge.green { background: color-mix(in srgb, var(--primary) 14%, transparent); color: var(--primary); }
.badge.cyan { background: color-mix(in srgb, var(--cyan) 14%, transparent); color: var(--cyan); }
.badge.red { background: color-mix(in srgb, var(--error) 14%, transparent); color: var(--error); }
.tag { display: inline-flex; color: var(--primary); font-size: var(--fs-body); margin-right: 8px; }

/* ================= 指标 / 列表行 ================= */
.kv-row { display: flex; gap: var(--sp-md); }
.kv { flex: 1; background: var(--surface-high); border-radius: var(--r-md); padding: var(--sp-md); }
.kv .k { color: var(--text-2); font-size: var(--fs-micro); margin-bottom: 2px; }
.kv .v { font-size: var(--fs-stat); font-weight: 700; letter-spacing: -0.4px; line-height: 1.15; }
.kv .v small { font-size: var(--fs-body); font-weight: 500; color: var(--text-2); margin-left: 2px; }
.list-row { display: flex; align-items: center; gap: var(--sp-md); padding: 12px 2px; border-bottom: 1px solid var(--divider); }
.list-row:last-child { border-bottom: none; }
.list-row .grow { flex: 1; min-width: 0; }
.list-row .t { font-size: var(--fs-label); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.list-row .s { color: var(--text-2); font-size: var(--fs-body); margin-top: 1px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.avatar { width: 42px; height: 42px; border-radius: 50%; object-fit: cover; background: var(--chip-idle); flex: none; }
.avatar.lg { width: 64px; height: 64px; }

/* ================= 空态 / 骨架 / snack ================= */
.empty { text-align: center; padding: 60px 20px; color: var(--text-2); }
.empty svg { width: 44px; height: 44px; opacity: 0.5; margin-bottom: 10px; }
.empty .hint { font-size: var(--fs-body); color: var(--text-3); margin-top: 4px; }
.skeleton { background: linear-gradient(90deg, var(--chip-idle) 25%, var(--surface-high) 50%, var(--chip-idle) 75%);
  background-size: 200% 100%; animation: shimmer 1.2s infinite; border-radius: var(--r-sm); }
@keyframes shimmer { to { background-position: -200% 0; } }
.snack-wrap { position: fixed; left: 0; right: 0; bottom: calc(76px + env(safe-area-inset-bottom));
  display: flex; justify-content: center; z-index: 200; pointer-events: none; }
.snack { background: var(--surface-high); color: var(--text); border: 1px solid var(--border);
  border-radius: var(--r-sm); padding: 10px 18px; font-size: var(--fs-body); box-shadow: var(--shadow-float);
  animation: fadeUp var(--t-normal) var(--ease); max-width: 86vw; }
.snack.ok { border-color: color-mix(in srgb, var(--success) 45%, transparent); }
.snack.err { border-color: color-mix(in srgb, var(--error) 45%, transparent); }

/* ================= 管理员「用户视角」横幅 =================
   常驻顶部细条；body.viewas 时把整块内容区/子页下移，避免遮挡页面顶栏 */
.viewas-bar {
  position: fixed; top: 0; left: 0; right: 0; height: 36px; z-index: 120;
  display: flex; align-items: center; gap: 10px; padding: 0 12px;
  background: color-mix(in srgb, var(--warning, #FACC15) 14%, var(--surface));
  border-bottom: 1px solid color-mix(in srgb, var(--warning, #FACC15) 45%, transparent);
  font-size: var(--fs-body); color: var(--text); overflow: hidden; white-space: nowrap;
}
.viewas-bar svg { width: 15px; height: 15px; color: var(--warning, #FACC15); flex: none; }
.viewas-bar .vb-text { display: flex; align-items: center; gap: 5px; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.viewas-bar .vb-text b { font-weight: 700; }
.viewas-bar .vb-text i { font-style: normal; font-size: var(--fs-micro); padding: 1px 6px;
  border-radius: 999px; border: 1px solid color-mix(in srgb, var(--warning, #FACC15) 55%, transparent);
  color: var(--warning, #FACC15); flex: none; }
.viewas-bar .vb-link, .viewas-bar .vb-exit {
  background: none; border: 1px solid var(--border); color: var(--text);
  border-radius: 999px; padding: 3px 10px; font-size: var(--fs-micro); cursor: pointer; flex: none;
}
.viewas-bar .vb-link { color: var(--text-2); }
.viewas-bar .vb-exit { border-color: color-mix(in srgb, var(--warning, #FACC15) 55%, transparent); color: var(--warning, #FACC15); font-weight: 600; }
body.viewas .content, body.viewas .subpage { top: 36px; }

/* ================= 统计 · 趋势卡（App ZoomTrendChart 对齐） ================= */
.trend-bars { min-height: 118px; }
.trend-cols {
  display: flex; align-items: flex-end; gap: 2px; height: 116px;
  cursor: grab; touch-action: pan-y; user-select: none;
}
.trend-cols.dragging { cursor: grabbing; }
.trend-col { flex: 1; display: flex; align-items: flex-end; justify-content: center; min-width: 2px; }
.trend-col i { display: block; width: 100%; border-radius: 2px 2px 0 0; pointer-events: none; }
.trend-overview {
  position: relative; margin-top: 10px; height: 38px; display: flex; align-items: flex-end;
  border: 1px solid var(--border); border-radius: var(--r-sm); background: var(--chip-idle);
  cursor: grab; touch-action: none; overflow: hidden; user-select: none;
}
.trend-overview.dragging { cursor: grabbing; }
.trend-ov-bars { display: flex; align-items: flex-end; gap: 1px; width: 100%; height: 100%; padding: 1px; }
.trend-ov-bars i { flex: 1; background: var(--text-3); opacity: 0.5; min-width: 1px; }
.trend-win {
  position: absolute; top: 0; bottom: 0; pointer-events: none;
  background: color-mix(in srgb, var(--primary) 18%, transparent);
  border: 1px solid color-mix(in srgb, var(--primary) 65%, transparent);
  border-radius: 4px;
  box-shadow: 0 0 0 1px color-mix(in srgb, var(--bg) 60%, transparent);
}
/* 窗口左右拖柄：拖=调整窗口起点/长短（对齐手机端双指缩放）。
   柄收在窗口框内 8px——过宽/外扩会被误抓（用户点击概览条平移时误改范围） */
.trend-handle {
  position: absolute; top: -2px; bottom: -2px; width: 8px;
  pointer-events: auto; cursor: ew-resize; touch-action: none;
  display: flex; align-items: center; justify-content: center;
}
.trend-handle::before {
  content: ''; width: 3px; height: 55%; border-radius: 2px;
  background: var(--primary); opacity: 0.8;
}
.trend-handle:hover::before { opacity: 1; width: 4px; }
.trend-handle.left { left: 0; border-radius: 4px 0 0 4px; }
.trend-handle.right { right: 0; border-radius: 0 4px 4px 0; }
/* 桌面端侧栏是固定左列：视角横幅出现时侧栏整体下移；子页浮层避开侧栏，
   否则侧栏(z 60)盖住子页(z 40)左侧 200px——返回按钮看不见也点不到 */
@media (min-width: 900px) {
  body.viewas .tabbar { top: 36px; }
  body.viewas .content { left: 200px; }
  .subpage { left: 200px; }
}

/* ================= 弹层：底部 sheet / 居中 modal ================= */
.mask { position: fixed; inset: 0; background: rgba(0,0,0,0.55); z-index: 100;
  display: flex; align-items: flex-end; justify-content: center; animation: fadeIn var(--t-fast) var(--ease); }
@keyframes fadeIn { from { opacity: 0; } }
.mask.center { align-items: center; padding: var(--sp-lg); }
.sheet { width: 100%; max-height: 86vh; overflow-y: auto; background: var(--surface);
  border-radius: 20px 20px 0 0; padding: var(--sp-lg) var(--sp-lg) calc(var(--sp-xl) + env(safe-area-inset-bottom));
  animation: sheetUp var(--t-slow) var(--ease); }
@keyframes sheetUp { from { transform: translateY(40%); opacity: 0.5; } }
@media (min-width: 900px) {
  .mask { align-items: center; }
  .sheet { max-width: 520px; border-radius: var(--r-xl); animation: fadeUp var(--t-slow) var(--ease); }
}
.modal { width: 100%; max-width: 420px; background: var(--surface); border: 1px solid var(--border);
  border-radius: var(--r-lg); padding: var(--sp-xl); animation: fadeUp var(--t-slow) var(--ease); }
.sheet-grab { width: 36px; height: 4px; border-radius: 2px; background: var(--border); margin: 0 auto var(--sp-md); }

/* ================= 动态瀑布流 / 帖子卡 ================= */
.waterfall { column-count: 2; column-gap: var(--sp-md); }
@media (min-width: 900px) { .waterfall { column-count: 3; } }
.post-card { break-inside: avoid; margin-bottom: var(--sp-md); background: var(--surface);
  border: 1px solid var(--border); border-radius: var(--r-md); overflow: hidden; cursor: pointer;
  transition: transform var(--t-fast) var(--ease), box-shadow var(--t-fast) var(--ease); }
.post-card:active { transform: scale(0.98); }
@media (min-width: 900px) { .post-card:hover { box-shadow: var(--shadow-float); } }
.post-cover { width: 100%; background: var(--chip-idle); position: relative; }
.post-cover img { width: 100%; height: 100%; object-fit: cover; }
.post-cover .cover-text { padding: var(--sp-lg); font-size: var(--fs-label); font-weight: 600;
  background: linear-gradient(135deg, color-mix(in srgb, var(--grad-a) 22%, var(--surface)), var(--surface)); min-height: 90px; }
.post-cover .pcnt { position: absolute; top: 8px; right: 8px; background: rgba(0,0,0,0.55); color: #fff;
  border-radius: 10px; padding: 1px 8px; font-size: var(--fs-micro); display: flex; align-items: center; gap: 3px; }
.post-cover .pcnt svg { width: 11px; height: 11px; }
.post-body { padding: 10px var(--sp-md) var(--sp-md); }
.post-title { font-size: var(--fs-label); font-weight: 600; line-height: 1.35;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-desc { color: var(--text-2); font-size: var(--fs-body); margin-top: 3px;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.post-meta { display: flex; align-items: center; gap: 6px; margin-top: 8px; color: var(--text-3); font-size: var(--fs-micro); }
.post-meta .ava { width: 18px; height: 18px; border-radius: 50%; background: var(--chip-idle); }
.post-foot { display: flex; align-items: center; gap: 14px; margin-top: 8px; color: var(--text-2); font-size: var(--fs-body); }
.post-foot .fi { display: inline-flex; align-items: center; gap: 4px; }
.post-foot .fi svg { width: 15px; height: 15px; }
.post-foot .fi.on { color: var(--error); }
.post-foot .fi.fav.on { color: var(--accent); }
.photos-pager { display: flex; overflow-x: auto; gap: 2px; scroll-snap-type: x mandatory; border-radius: var(--r-md); }
.photos-pager img { height: min(320px, 44vh); width: auto; max-width: 86vw; object-fit: cover; scroll-snap-align: center; border-radius: var(--r-sm); }

/* ================= 地图页浮层 ================= */
.page-map { position: absolute; inset: 0; overflow: hidden; padding: 0; }
#map { position: absolute; inset: 0; background: var(--bg); }
.map-float { position: absolute; top: calc(env(safe-area-inset-top) + 12px); left: 12px; z-index: 30;
  background: var(--surface-high); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-float); padding: 10px var(--sp-md); display: flex; align-items: center; gap: 12px;
  animation: fadeUp var(--t-normal) var(--ease); flex-wrap: wrap; max-width: calc(100vw - 24px); }
.map-float .st-dot { width: 8px; height: 8px; border-radius: 50%; background: var(--success); flex: none; }
.map-float .st-dot.off { background: var(--text-3); }
.map-float .mf-t { font-size: var(--fs-body); color: var(--text-2); }
.map-float .mf-v { font-size: var(--fs-label); font-weight: 600; }
.map-float button { color: var(--primary); font-size: var(--fs-body); font-weight: 600; display: flex; gap: 4px; align-items: center; }
.mode-switch { position: absolute; top: calc(env(safe-area-inset-top) + 12px); right: 12px; z-index: 30;
  display: flex; flex-direction: column; gap: var(--sp-sm); }
.time-panel { position: absolute; left: 12px; right: 12px; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 30;
  background: var(--surface-high); border: 1px solid var(--border); border-radius: var(--r-md);
  box-shadow: var(--shadow-float); padding: var(--sp-md); animation: fadeUp var(--t-normal) var(--ease); }
@media (min-width: 900px) { .time-panel { left: auto; width: 420px; right: 20px; bottom: 20px; } }
.fab-plus { position: absolute; right: 16px; bottom: calc(84px + env(safe-area-inset-bottom)); z-index: 31;
  width: 52px; height: 52px; border-radius: 50%; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); color: var(--on-primary);
  box-shadow: var(--shadow-float), 0 0 18px color-mix(in srgb, var(--primary) 35%, transparent);
  transition: transform var(--t-fast) var(--ease); }
.fab-plus:active { transform: scale(0.92); }
.fab-plus svg { width: 24px; height: 24px; }
@media (min-width: 900px) { .fab-plus { bottom: 20px; right: 24px; } }

/* 附近景点面板（左下锚定，对齐 App） */
.poi-panel { position: absolute; left: 12px; bottom: calc(64px + env(safe-area-inset-bottom)); z-index: 29;
  width: min(78vw, 340px); display: flex; flex-direction: column; align-items: flex-start; pointer-events: none; }
@media (min-width: 900px) { .poi-panel { bottom: 20px; } }
.poi-panel > * { pointer-events: auto; }
.poi-toggle { display: inline-flex; align-items: center; gap: 6px; background: var(--surface-high);
  border: 1px solid var(--border); border-radius: 18px; padding: 8px 14px; color: var(--text);
  font-size: var(--fs-label); font-weight: 600; box-shadow: var(--shadow-float); }
.poi-toggle svg { width: 15px; height: 15px; color: var(--accent); }
.poi-list { width: 100%; background: var(--surface-high); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-float); overflow: hidden;
  animation: fadeUp var(--t-normal) var(--ease); max-height: 46vh; display: flex; flex-direction: column; }
.poi-list .pl-head { display: flex; align-items: center; padding: 10px var(--sp-md);
  border-bottom: 1px solid var(--divider); font-size: var(--fs-label); font-weight: 600; gap: 8px; }
.poi-list .pl-head .grow { flex: 1; color: var(--text-2); font-weight: 400; font-size: var(--fs-body); }
.poi-items { overflow-y: auto; }
.poi-item { display: flex; align-items: center; gap: 10px; padding: 10px var(--sp-md);
  border-bottom: 1px solid var(--divider); cursor: pointer; transition: background var(--t-fast) var(--ease); }
.poi-item:last-child { border-bottom: none; }
.poi-item.on, .poi-item:hover { background: color-mix(in srgb, var(--primary) 8%, transparent); }
.poi-item .pn { font-size: var(--fs-label); font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.poi-item .pd { color: var(--text-3); font-size: var(--fs-micro); margin-top: 1px; }
.poi-item .dist { margin-left: auto; color: var(--text-2); font-size: var(--fs-body); flex: none; }
.poi-detail { width: 100%; background: var(--surface-high); border: 1px solid var(--border);
  border-radius: var(--r-md); box-shadow: var(--shadow-float); padding: var(--sp-md);
  animation: fadeUp var(--t-normal) var(--ease); }
.poi-detail .pd-name { font-size: var(--fs-title); font-weight: 700; display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.poi-detail .pd-sub { color: var(--text-2); font-size: var(--fs-body); margin-top: 4px; }
.poi-detail .pd-links { display: flex; gap: var(--sp-sm); margin-top: 10px; flex-wrap: wrap; }

/* 景点 marker 药丸（真名） */
.poi-pill { background: var(--surface-high); border: 1px solid color-mix(in srgb, var(--accent) 60%, transparent);
  color: var(--text); border-radius: 14px; padding: 3px 10px; font-size: var(--fs-micro); font-weight: 600;
  white-space: nowrap; box-shadow: var(--shadow-float); }

/* ================= 图表 ================= */
/* 月历（对齐 App HorizontalMonthCalendar）：周一打头、格内数字=当天里程、6px 比例条 */
:root { --panel: var(--surface-high); --pill-border: color-mix(in srgb, var(--text) 15%, transparent); }
[data-style="light"], [data-style="blue_light"], [data-style="pink_light"] {
  --panel: var(--surface);
  --pill-border: var(--border);
}
.mcal-week { display: flex; height: 20px; }
.mcal-week span { flex: 1; text-align: center; font-size: var(--fs-micro); color: var(--text-3); }
.mcal-row { display: flex; height: 52px; }
.mcal-cell {
  flex: 1; margin: 2px 1px; border-radius: var(--r-sm);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 1px;
  cursor: pointer; border: 1px solid transparent;
}
.mcal-cell.today { border-color: color-mix(in srgb, var(--primary) 60%, transparent); }
.mcal-cell.future { cursor: default; }
.mcal-cell.future .d { color: color-mix(in srgb, var(--text-3) 40%, transparent); }
.mcal-cell .d { font-size: var(--fs-body); font-weight: 500; color: var(--text); }
.mcal-cell .v { font-size: var(--fs-micro); line-height: 1.1; color: var(--text-3); min-height: 12px; }
.mcal-cell .bar { height: 6px; width: 100%; padding: 0 3px; }
.mcal-cell .bar i { display: block; height: 100%; background: var(--primary); border-radius: 3px; }

/* 状态胶囊（对齐 App _StatusPill：顶栏之下居中、状态词+点数+步数，点按=同步） */
.status-pill {
  position: absolute; top: calc(env(safe-area-inset-top) + 12px); left: 50%; transform: translateX(-50%);
  z-index: 30; background: var(--panel); border: 1px solid var(--pill-border);
  border-radius: var(--r-md); box-shadow: var(--shadow-float);
  padding: 8px var(--sp-md); user-select: none;
  animation: fadeUp var(--t-normal) var(--ease); max-width: calc(100vw - 24px);
}
.status-pill .row { display: flex; align-items: center; gap: 8px; white-space: nowrap; }
.status-pill .st { font-size: var(--fs-label); font-weight: 600; }
.status-pill .num { font-size: var(--fs-body); color: var(--text-2); }
.status-pill .num b { font-weight: 600; color: var(--text); font-variant-numeric: tabular-nums; }
.status-pill .dot9 { width: 9px; height: 9px; border-radius: 50%; background: var(--success); flex: none; }
.status-pill .dot9.busy { background: var(--text-3); animation: rot 0.9s linear infinite; border-radius: 2px; }

.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell { aspect-ratio: 1; border-radius: 6px; background: var(--chip-idle); display: flex;
  flex-direction: column; align-items: center; justify-content: center; font-size: 10px; color: var(--text-3); position: relative; cursor: pointer; }
.cal-cell.has { color: var(--on-primary); font-weight: 600; }
.cal-cell.today { outline: 1.5px solid var(--primary); }
.cal-head { display: flex; align-items: center; margin-bottom: var(--sp-sm); gap: var(--sp-sm); }
.cal-head .grow { flex: 1; text-align: center; font-size: var(--fs-label); font-weight: 600; }
.legend { display: flex; align-items: center; gap: 6px; font-size: var(--fs-micro); color: var(--text-3); }
.legend i { width: 10px; height: 10px; border-radius: 3px; display: inline-block; }

/* ================= 聊天 ================= */
.chat-wrap { position: absolute; inset: 0; display: flex; flex-direction: column; background: var(--bg); }
.chat-list { flex: 1; overflow-y: auto; padding: var(--sp-lg); display: flex; flex-direction: column; gap: var(--sp-md); }
.msg { display: flex; gap: var(--sp-sm); max-width: 78%; }
.msg.me { align-self: flex-end; flex-direction: row-reverse; }
.msg .bubble { background: var(--surface-high); border: 1px solid var(--border);
  border-radius: var(--r-md); padding: 9px var(--sp-md); font-size: var(--fs-label); word-break: break-word; white-space: pre-wrap; }
.msg.me .bubble { background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); color: var(--on-primary); border: none; }
.msg .bubble.share-card { cursor: pointer; min-width: 180px; }
.msg .bubble img { max-width: 200px; border-radius: var(--r-sm); }
.msg .sc-title { font-weight: 600; margin-bottom: 2px; }
.msg .sc-sub { font-size: var(--fs-body); opacity: 0.85; }
.chat-bar { display: flex; gap: var(--sp-sm); padding: var(--sp-sm) var(--sp-md) calc(var(--sp-sm) + env(safe-area-inset-bottom));
  border-top: 1px solid var(--border); background: var(--surface); align-items: center; }
.chat-bar input { flex: 1; }

/* ================= 登录门禁 ================= */
.gate { position: absolute; inset: 0; z-index: 80; display: flex; flex-direction: column;
  align-items: center; justify-content: center; padding: var(--sp-xl); overflow-y: auto;
  background: radial-gradient(120% 90% at 50% 0%, color-mix(in srgb, var(--grad-a) 12%, var(--bg)), var(--bg)); }
.gate .g-logo { width: 64px; height: 64px; border-radius: 20px; display: flex; align-items: center; justify-content: center;
  background: linear-gradient(135deg, var(--grad-a), var(--grad-b)); color: var(--on-primary);
  box-shadow: 0 0 24px color-mix(in srgb, var(--primary) 40%, transparent); margin-bottom: var(--sp-lg); }
.gate .g-logo svg { width: 34px; height: 34px; }
.gate h2 { font-size: var(--fs-title); font-weight: 700; }
.gate .g-sub { color: var(--text-2); font-size: var(--fs-body); margin: 6px 0 var(--sp-xl); }
.gate-card { width: 100%; max-width: 360px; }
.gate-card .field { margin-bottom: var(--sp-md); }
.gate-err { color: var(--error); font-size: var(--fs-body); min-height: 18px; margin-bottom: 6px; }
.gate-switch { text-align: center; margin-top: var(--sp-md); color: var(--text-2); font-size: var(--fs-body); }
.gate-switch b { color: var(--primary); cursor: pointer; }

/* ================= 发布页 ================= */
.pub-photos { display: flex; gap: var(--sp-sm); overflow-x: auto; padding-bottom: 4px; }
.pub-thumb { position: relative; width: 96px; height: 96px; border-radius: var(--r-sm); overflow: hidden; flex: none; }
.pub-thumb img { width: 100%; height: 100%; object-fit: cover; }
.pub-thumb .rm { position: absolute; top: 4px; right: 4px; width: 20px; height: 20px; border-radius: 50%;
  background: rgba(0,0,0,0.6); color: #fff; display: flex; align-items: center; justify-content: center; font-size: 12px; }
.pub-add { width: 96px; height: 96px; border-radius: var(--r-sm); border: 1.5px dashed var(--ctrl-border);
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 4px;
  color: var(--text-2); font-size: var(--fs-micro); flex: none; }
.pub-add svg { width: 22px; height: 22px; }

/* 大图预览 */
.viewer { position: fixed; inset: 0; z-index: 300; background: rgba(0,0,0,0.92);
  display: flex; align-items: center; justify-content: center; animation: fadeIn var(--t-fast) var(--ease); }
.viewer img { max-width: 100vw; max-height: 100vh; object-fit: contain; }
.viewer .close { position: absolute; top: calc(env(safe-area-inset-top) + 12px); right: 14px;
  width: 38px; height: 38px; border-radius: 50%; background: rgba(255,255,255,0.12); color: #fff;
  display: flex; align-items: center; justify-content: center; }

/* 海报输出 */
.poster-wrap { display: flex; flex-direction: column; align-items: center; gap: var(--sp-md); }
.poster-wrap canvas { max-width: min(78vw, 360px); border-radius: var(--r-md); box-shadow: var(--shadow-float); }

/* 徒步详情剖面/统计 */
.seg-tabs { display: flex; gap: 2px; background: var(--chip-idle); border-radius: var(--r-sm); padding: 3px; margin-bottom: var(--sp-md); }
.seg-tabs .pill { flex: 1; text-align: center; }
.muted { color: var(--text-2); }
.mini { font-size: var(--fs-micro); color: var(--text-3); }
.hr-grow { display: flex; align-items: center; gap: var(--sp-sm); }
.spin { animation: rot 0.9s linear infinite; }
@keyframes rot { to { transform: rotate(360deg); } }
.hidden { display: none !important; }

/* 手机端：输入字号 ≥16px 防 iOS 聚焦自动放大；触控目标补足 */
@media (max-width: 899px) {
  .field, input.field, textarea.field { font-size: 16px; }
  .chat-bar input { font-size: 16px; }
}
