/* 问道 PRO — 浅色地图 App（品牌紫 #5B21B6 系） */

:root {
  --brand: #5b21b6;
  --brand-dark: #4c1d95;
  --brand-soft: rgba(91, 33, 182, 0.16);
  --page-bg: #f2f3f5;
  --surface: #ffffff;
  --text: #1a1a1a;
  --text-2: #4b5563;
  --text-3: #9ca3af;
  --line: rgba(0, 0, 0, 0.06);
  --line-strong: rgba(0, 0, 0, 0.1);
  --shadow-float: 0 4px 24px rgba(0, 0, 0, 0.08), 0 1px 4px rgba(0, 0, 0, 0.04);
  /* 搜索条：单层大模糊，避免紧贴阴影在圆角外仍呈「方框」感 */
  --shadow-search-field: 0 6px 22px rgba(15, 23, 42, 0.07), 0 2px 12px rgba(15, 23, 42, 0.045);
  --shadow-dock: 0 8px 32px rgba(0, 0, 0, 0.12), 0 2px 8px rgba(0, 0, 0, 0.06);
  /* 随缘主 CTA：零垂直偏移，避免紫色光晕整体偏下 */
  --shadow-fab: 0 0 22px rgba(91, 33, 182, 0.45);
  /* 轻贴桌面：列表行、芯片、嵌套块默认阴影（与按压态 --shadow-float 区分） */
  --shadow-rest: 0 1px 4px rgba(0, 0, 0, 0.055);
  /* 地图顶栏胶囊：略强浮起，与其它白底浮层同一语汇 */
  --shadow-toolbar-capsule: 0 10px 40px rgba(15, 23, 42, 0.14), 0 2px 8px rgba(15, 23, 42, 0.06);

  --safe-top: env(safe-area-inset-top, 0px);
  --safe-bottom: env(safe-area-inset-bottom, 0px);
  /* 地图顶栏与底栏胶囊：统一内高与竖向留白（总高约 60px） */
  --map-capsule-pad-y: 5px;
  --map-capsule-inner-h: 50px;
  --map-capsule-total-h: calc(var(--map-capsule-pad-y) * 2 + var(--map-capsule-inner-h));
  /* 太极标直径与顶栏图标轨同高 */
  --dock-fab-size: var(--map-capsule-inner-h);
  /* wrap 下内边距 12 + 胶囊总高 + 与内容/浮层留白，与 toast、内页底 padding 一致 */
  --dock-clearance: calc(12px + var(--map-capsule-total-h) + 12px + var(--safe-bottom));

  /*
   * 浮层「胶囊 + 圆形控件」统一美学（顶栏工具条、底栏 dock、地图右侧钮、选点提示外壳）
   * — 表面 / 描边 / 阴影 / 轨道高 / 内距 / 图标格 — 一律走下列变量；小屏在下方 @media 覆盖 :root。
   */
  --chrome-surface: rgba(255, 255, 255, 0.94);
  --chrome-border: 1px solid rgba(15, 23, 42, 0.1);
  --chrome-border-ctrl: 1px solid var(--line);
  --chrome-shadow-capsule: var(--shadow-toolbar-capsule);
  --chrome-shadow-ctrl: var(--shadow-float);
  --chrome-radius-capsule: var(--radius-pill);
  --chrome-radius-ctrl: 50%;
  --chrome-track-h: var(--map-capsule-inner-h);
  --chrome-track-pad-y: var(--map-capsule-pad-y);
  --chrome-pad-inline-start: 8px;
  --chrome-pad-inline-end: 10px;
  --chrome-capsule-gap: 4px;
  --chrome-dock-gap: 6px;
  --chrome-dock-pad-x: 10px;
  --chrome-icon-in-track: 34px;
  --chrome-radius-panel: var(--radius-md);
  --chrome-floating-stack-gap: 8px;
  --chrome-press-scale: 0.96;
  --chrome-transition:
    transform 0.12s ease, background 0.2s ease, border-color 0.2s ease, color 0.2s ease,
    box-shadow 0.2s ease;

  /* 全站固定门头（含安全区下的内容区高度） */
  /* 与「问道」行盒同高的一行 + 底内边距 */
  --app-masthead-below-safe: 74px;
  /* 門頭純色底，與全站品牌紫一致 */
  --masthead-bg: var(--brand);
  /* 與 .map-city-pill 金系呼應，略提亮以利深色底對比 */
  --masthead-title-color: #ffffff;
  /* 品牌紫底上的主文案金：比 #d4af37 更亮，减少发褐、发灰 */
  --gold-on-brand: #ffe566;
  --gold-on-brand-text-shadow: 0 1px 2px rgba(28, 12, 58, 0.52);

  --radius-pill: 999px;
  --radius-card: 16px;
  /* 方框圆角层级：卡片 16 → 嵌套块 12 → 小标签 8 → 角标/轨道 4 → Sheet 把手 3 */
  --radius-xl: 20px;
  --radius-sheet-top: var(--radius-xl);
  --radius-md: 12px;
  --radius-sm: 8px;
  --radius-xs: 4px;
  --radius-handle: 3px;
  /* 列表 / 我的 等内页：白卡片之间的纵向间距（与 .terms-card 等的 margin-top 一致） */
  --panel-stack-gap: 18px;

  /*
   * 思源宋體系（網頁端為 Noto Serif CJK）：簡體優先，缺字時按順序回落繁體與本機字體。
   * 與 Source Han Serif 為同一套字庫，僅 PostScript 名稱不同。
   */
  --font: "Noto Serif SC", "Noto Serif TC", "Source Han Serif SC", "Source Han Serif TC",
    "Source Han Serif", "Songti SC", "STSong", "SimSun", "NSimSun", serif;
  /* 门头：令东齐伋体 Web（ZeoSeven 切片字族名 QIJIC），缺字回落宋体系 */
  --font-masthead: "QIJIC", "令东齐伋体", "齐伋体", var(--font);
  --text-xs: 11px;
  --text-sm: 13px;
  --text-base: 15px;
  --text-lg: 17px;
  --text-xl: 20px;

  /* 行高：与字阶搭配（长文 / 表单 / 底部抽屉） */
  --leading-tight: 1.22;
  --leading-snug: 1.35;
  --leading-ui: 1.48;
  --leading-body: 1.55;
  --leading-prose: 1.62;
  /* 道观详情抽屉内区块纵向节奏 */
  --sheet-module-pad-y: 14px;

  --ease: cubic-bezier(0.22, 1, 0.36, 1);
  --dur: 0.32s;

  /* 与 page-bg 同步，供吸顶渐变等使用 */
  --page-bg-rgb: 242, 243, 245;
  --map-wrap-bg: #e8e9ec;
  --chrome-ctrl-active-bg: #f9fafb;
  --map-marker-label-bg: rgba(255, 255, 255, 0.94);
  --surface-2: #f8fafc;
  --sheet-handle-bg: #e5e7eb;
  --switch-track-off: #cbd5e1;
  --switch-track-on: var(--brand);
  --switch-thumb: #ffffff;

  /* 底栏：hover / 选中与中央太极同一语汇（紫底、白线、柔光） */
  --dock-taiji-active-bg: var(--brand);
  --dock-taiji-active-icon: #ffffff;
  --dock-taiji-active-shadow: 0 4px 14px rgba(91, 33, 182, 0.35);
  --dock-taiji-hover-fill: var(--brand-soft);
  --dock-taiji-hover-icon: var(--brand);
  --dock-capsule-hover-extra: 0 8px 28px rgba(91, 33, 182, 0.16);
}

html[data-theme="dark"] {
  color-scheme: dark;
  --brand-soft: rgba(167, 139, 250, 0.22);
  --page-bg: #0f1117;
  --page-bg-rgb: 15, 17, 23;
  --surface: #1a1d26;
  --surface-2: #242833;
  --text: #e8eaed;
  --text-2: #9aa3b2;
  --text-3: #6b7280;
  --line: rgba(255, 255, 255, 0.08);
  --line-strong: rgba(255, 255, 255, 0.14);
  --shadow-float: 0 4px 24px rgba(0, 0, 0, 0.45), 0 1px 4px rgba(0, 0, 0, 0.35);
  --shadow-search-field: 0 6px 22px rgba(0, 0, 0, 0.35), 0 2px 12px rgba(0, 0, 0, 0.28);
  --shadow-dock: 0 8px 32px rgba(0, 0, 0, 0.5), 0 2px 8px rgba(0, 0, 0, 0.35);
  --shadow-fab: 0 0 24px rgba(124, 58, 237, 0.55);
  --shadow-rest: 0 1px 4px rgba(0, 0, 0, 0.25);
  --shadow-toolbar-capsule: 0 10px 40px rgba(0, 0, 0, 0.45), 0 2px 8px rgba(0, 0, 0, 0.3);
  --chrome-surface: rgba(34, 38, 48, 0.94);
  --chrome-border: 1px solid rgba(255, 255, 255, 0.1);
  --chrome-border-ctrl: 1px solid var(--line-strong);
  --map-wrap-bg: #12151c;
  --chrome-ctrl-active-bg: #252a36;
  --map-marker-label-bg: rgba(34, 38, 48, 0.95);
  --sheet-handle-bg: #3d4451;
  --switch-track-off: #3d4451;
  --switch-track-on: #7c3aed;
  --switch-thumb: #f1f5f9;
  --gold-on-brand-text-shadow: 0 1px 2px rgba(0, 0, 0, 0.45);
  --dock-taiji-active-shadow: 0 4px 20px rgba(139, 92, 246, 0.42);
  --dock-taiji-hover-icon: #d8b4fe;
  --dock-capsule-hover-extra: 0 8px 32px rgba(139, 92, 246, 0.22);
  /* 深色底上的品牌紫字：勿用浅色主题的 --brand-dark（#4c1d95），在 #1a1d26 等底上几乎不可读 */
  --brand-text-on-dark: #e9d5ff;
  --brand-text-on-dark-muted: #c4b5fd;
  /* 原 --brand（#5b21b6）作正文/链接/图标色时在暗底上过深 */
  --brand-accent-text: #d8b4fe;
}

/*
 * 深色：在 --surface / --page-bg / 浅紫底上用作文字、链接、图标色的 --brand / --brand-dark 统一提亮
 *（不改 --brand 变量本身，避免主按钮等填充色变化）
 */
html[data-theme="dark"] #btn-map-search[aria-expanded="true"] {
  color: var(--brand-accent-text);
  border-color: rgba(196, 181, 253, 0.55);
}

html[data-theme="dark"] .map-user-place-pick-hint__cancel:hover {
  color: var(--brand-accent-text);
}

html[data-theme="dark"] .temple-row__dist {
  color: var(--brand-accent-text);
}

html[data-theme="dark"] .terms-card__links a {
  color: var(--brand-accent-text);
}

html[data-theme="dark"] .profile-card .avatar {
  color: var(--brand-text-on-dark-muted);
}

html[data-theme="dark"] .profile-avatar-clear:hover {
  color: var(--brand-text-on-dark-muted);
}

html[data-theme="dark"] .btn-secondary.btn-sheet-fav.is-on {
  color: var(--brand-text-on-dark-muted);
}

html[data-theme="dark"] .temple-tag--crowd {
  color: var(--brand-text-on-dark-muted);
}

html[data-theme="dark"] .temple-tag-pick.is-on {
  color: var(--brand-text-on-dark-muted);
}

html[data-theme="dark"] .checkin-stat__ring-fill {
  stroke: #a78bfa;
}
html[data-theme="dark"] .checkin-stat__num {
  color: var(--text);
}
html[data-theme="dark"] .ach-rank__pct {
  color: #e8eaed;
}
html[data-theme="dark"] .ach-rank__title {
  color: #fbbf24;
}

html[data-theme="dark"] .checkin-ach-row__ico {
  color: var(--brand);
}
html[data-theme="dark"] .ach-ms.is-done {
  background: color-mix(in srgb, var(--brand) 14%, transparent);
  border-color: color-mix(in srgb, var(--brand) 38%, var(--line));
}
html[data-theme="dark"] .ach-ms.is-done .ach-ms__check {
  color: var(--brand);
}
html[data-theme="dark"] .ach-ms.is-next {
  border-color: color-mix(in srgb, #d4af37 45%, var(--line));
  background: color-mix(in srgb, #fbbf24 10%, transparent);
}
html[data-theme="dark"] .checkin-ach-row__bar-fill {
  background: linear-gradient(90deg, #7c3aed, #a78bfa);
}
html[data-theme="dark"] .checkin-ach-row__bar-track {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .me-temple-item__unfav:active {
  color: var(--brand-accent-text);
}

html[data-theme="dark"] .boot-error__icon {
  color: var(--brand-accent-text);
}

html[data-theme="dark"] .suiyuan-entry__label {
  color: var(--brand-accent-text);
}

html[data-theme="dark"] .suiyuan-dialog__kicker {
  color: var(--brand-accent-text);
}

html[data-theme="dark"] .ach-share-dialog__title {
  color: var(--text);
}

html[data-theme="dark"] .sheet {
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.55);
}

html[data-theme="dark"] .map-city-pill {
  background: linear-gradient(145deg, #3d3420 0%, #2a2416 48%, #1c1810 100%);
  border-color: rgba(212, 175, 55, 0.42);
  box-shadow:
    0 4px 18px rgba(0, 0, 0, 0.35),
    0 1px 0 rgba(255, 255, 255, 0.06) inset,
    var(--shadow-float);
}

html[data-theme="dark"] .map-city-pill__city {
  color: #e8d48b;
}

html[data-theme="dark"] .map-toolbar-capsule .btn-pill-ghost:hover {
  background: rgba(255, 255, 255, 0.08);
}

html[data-theme="dark"] .map-toolbar-capsule .btn-pill-ghost:active {
  background: rgba(255, 255, 255, 0.12);
}

html[data-theme="dark"] .map-toolbar-capsule .btn-pill-ghost.btn-pill-ghost--toggle.is-off {
  border-color: rgba(148, 163, 184, 0.38);
  color: rgba(203, 213, 225, 0.82);
}

html[data-theme="dark"] .map-toolbar-capsule .btn-pill-ghost.btn-pill-ghost--toggle:not(.is-off) {
  background: rgba(255, 255, 255, 0.1);
  color: var(--text);
}

html[data-theme="dark"] .map-user-place-pick-hint {
  --map-pick-hint-title: rgba(232, 234, 237, 0.92);
  --map-pick-hint-body: rgba(232, 234, 237, 0.58);
}

html[data-theme="dark"] .map-user-place-pick-hint__cancel {
  color: rgba(180, 188, 202, 0.88);
}

/*
 * 自定义标点名称条：圣地 tip 曾写死白底，夜间 --text 为浅色会「看不见字」；
 * 道观 .map-marker-label 虽用变量，高德容器仍可能对子节点施加浅色字，此处一并强制与主题一致。
 */
html[data-theme="dark"] #map .map-marker-label,
html[data-theme="dark"] #map .sd-map-marker__tip {
  background: var(--map-marker-label-bg);
  color: var(--text);
  border-color: var(--line-strong);
}

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

  .user-loc-marker__ring {
    animation: none !important;
    opacity: 0.35;
    transform: scale(1);
  }

  .user-loc-marker__pin {
    animation: none !important;
  }
}

*,
*::before,
*::after {
  box-sizing: border-box;
}

html {
  -webkit-text-size-adjust: 100%;
  min-height: 100%;
  min-height: 100dvh;
}

html,
body {
  margin: 0;
  height: 100%;
  min-height: 100%;
  min-height: 100dvh;
  font-family: var(--font);
  font-size: var(--text-base);
  line-height: 1.47059; /* ~17px line for 15px body，貼近 iOS 正文比例 */
  background: var(--page-bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
  -webkit-tap-highlight-color: transparent;
  overflow: hidden;
}

/*
 * UA 对 button / input / select 等常单独指定系统无衬线，不随 body 继承；
 * 占位符在部分 WebKit 上也不跟 input 走同一套 font-family，故全站显式统一为思源宋体栈。
 */
button,
input,
select,
textarea,
optgroup,
option {
  font-family: var(--font);
}

input::placeholder,
textarea::placeholder {
  font-family: var(--font);
}

::file-selector-button {
  font-family: var(--font);
}

#app {
  height: 100%;
  min-height: 100%;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  padding-top: calc(var(--safe-top) + var(--app-masthead-below-safe));
  position: relative;
  font-family: var(--font);
}

/* —— 全站固定门头（列表 / 地图 / 我的共用） —— */
.app-masthead {
  /* 安全区之下上下留白一致（原先底 6px、顶无对称留白，易显「头轻脚重」） */
  --masthead-pad-y: 10px;
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  width: 100%;
  z-index: 25;
  box-sizing: border-box;
  margin: 0;
  padding: calc(var(--safe-top) + var(--masthead-pad-y)) 14px var(--masthead-pad-y);
  min-height: calc(var(--safe-top) + var(--app-masthead-below-safe));
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--masthead-bg);
  border-radius: 0;
  box-shadow:
    0 8px 28px rgba(15, 23, 42, 0.18),
    0 1px 6px rgba(0, 0, 0, 0.14),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  user-select: none;
}

.app-masthead:active {
  opacity: 0.94;
}

.app-masthead__brand-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-width: 0;
  -webkit-font-smoothing: antialiased;
  -moz-osx-font-smoothing: grayscale;
}

.app-masthead__title-row {
  --masthead-brand-size: 40px;
  /* 与右侧双行留白略放大，竖线与副栏同高 */
  --masthead-brand-lh: 1.22;
  --masthead-vrule-h: calc(var(--masthead-brand-size) * var(--masthead-brand-lh));
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.44em;
  max-width: 100%;
  min-width: 0;
}

/* 主标 + 竖线 */
.app-masthead__title-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-shrink: 0;
  gap: 0.36em;
}

/* 「问道」：齐伋体；行盒高与副栏、竖线一致 */
.app-masthead__title-brand {
  flex-shrink: 0;
  font-family: var(--font-masthead);
  font-weight: 400;
  font-size: var(--masthead-brand-size);
  letter-spacing: 0.1em;
  line-height: var(--masthead-brand-lh);
  color: var(--masthead-title-color);
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.55),
    0 2px 12px rgba(0, 0, 0, 0.38),
    0 0 18px rgba(255, 255, 255, 0.08);
}

/* 问道与副栏之间的竖线：上下渐隐，略提亮 */
.app-masthead__title-vrule {
  flex-shrink: 0;
  width: 1px;
  height: var(--masthead-vrule-h);
  border-radius: 1px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.42) 14%,
    rgba(255, 255, 255, 0.72) 50%,
    rgba(255, 255, 255, 0.42) 86%,
    rgba(255, 255, 255, 0) 100%
  );
  box-shadow: 0 0 10px rgba(255, 255, 255, 0.14);
}

/* 副栏：高度与竖线、主标行盒相同；双行收紧间距并垂直居中 */
.app-masthead__title-subcol {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: calc(var(--masthead-brand-size) * 0.05);
  height: var(--masthead-vrule-h);
  box-sizing: border-box;
}

/* 「道观导航地图」：决定副栏宽度；网址行同栏宽，左右与上行齐平（见 .app-masthead__url-inner） */
.app-masthead__title-sub {
  display: block;
  width: 100%;
  max-width: 100%;
  font-family: var(--font);
  font-weight: 500;
  font-size: calc(var(--masthead-brand-size) * 0.42);
  letter-spacing: 0.045em;
  line-height: 1.18;
  color: rgba(255, 255, 255, 0.9);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);
}

.app-masthead__url {
  display: block;
  flex-shrink: 0;
  width: 100%;
  margin: 0;
  font-family: var(--font);
  font-weight: 500;
  font-size: calc(var(--masthead-brand-size) * 0.285);
  line-height: 1.15;
  color: rgba(255, 255, 255, 0.68);
  text-align: left;
  text-decoration: none;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

/*
 * 与上行同栏宽、左右齐平：在整行宽度内做字间均分（现代浏览器）。
 * 不支持 text-justify: inter-character 时回退为略松字距，并由 js 拉 letter-spacing 对齐。
 */
.app-masthead__url-inner {
  display: block;
  width: 100%;
  letter-spacing: 0;
  white-space: nowrap;
  text-align: justify;
  text-align-last: justify;
  text-justify: inter-character;
  hyphens: manual;
}

@supports not (text-justify: inter-character) {
  .app-masthead__url-inner {
    display: inline-block;
    width: auto;
    max-width: 100%;
    white-space: normal;
    text-align: left;
    text-align-last: auto;
    text-justify: auto;
    letter-spacing: 0.1em;
  }
}

.app-masthead__url:hover,
.app-masthead__url:active {
  color: rgba(255, 255, 255, 0.68);
  text-decoration: none;
}

/* 窄屏：略收轨道高度与图标，保持胶囊与圆形钮比例一致 */
@media (max-width: 480px) {
  :root {
    --map-capsule-inner-h: 45px;
    --map-capsule-pad-y: 4px;
    --chrome-icon-in-track: 30px;
    --chrome-pad-inline-start: 6px;
    --chrome-pad-inline-end: 8px;
    --chrome-dock-gap: 5px;
    --chrome-dock-pad-x: 8px;
  }
}

@media (max-width: 380px) {
  :root {
    --map-capsule-inner-h: 43px;
    --chrome-icon-in-track: 28px;
  }
}

@media (max-width: 400px) {
  :root {
    --app-masthead-below-safe: 66px;
  }

  .app-masthead {
    --masthead-pad-y: 8px;
  }

  .app-masthead__title-row {
    --masthead-brand-size: 33px;
    gap: 0.34em;
  }

  .app-masthead__title-left {
    gap: 0.28em;
  }

  .app-masthead__title-brand {
    letter-spacing: 0.07em;
  }

  .app-masthead__title-sub {
    letter-spacing: 0.03em;
  }

  @supports not (text-justify: inter-character) {
    .app-masthead__url-inner {
      letter-spacing: 0.09em;
    }
  }
}

/* —— 地图全屏 —— */
.panel-page {
  display: none;
  flex: 1;
  min-height: 0;
  flex-direction: column;
  overflow: hidden;
}

.panel-page.active {
  display: flex;
  /* 高于未激活页（含地图 WebGL），避免个别机型上底图层异常叠在列表之上 */
  position: relative;
  z-index: 1;
}

.map-wrap {
  flex: 1;
  min-height: 0;
  position: relative;
  background: var(--map-wrap-bg);
}

/* WebGL / 底图崩溃后的恢复入口（地图区水平+垂直居中；低于 .map-ui z-index:10，顶栏区域仍在上层） */
.map-recover-hint {
  position: absolute;
  left: 50%;
  top: 50%;
  bottom: auto;
  transform: translate(-50%, -50%);
  z-index: 8;
  pointer-events: auto;
  max-width: min(92vw, 360px);
}

.map-recover-hint[hidden] {
  display: none !important;
}

.map-recover-hint__btn {
  display: block;
  width: 100%;
  margin: 0;
  padding: 10px 16px;
  border-radius: var(--radius-lg, 12px);
  border: 1px solid rgba(255, 255, 255, 0.2);
  background: rgba(30, 32, 40, 0.88);
  color: var(--text-1, #e8eaef);
  font-size: 14px;
  font-family: var(--font);
  line-height: 1.35;
  cursor: pointer;
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.35);
  -webkit-tap-highlight-color: transparent;
}

.map-recover-hint__btn:active {
  filter: brightness(1.08);
}

html[data-theme="light"] .map-recover-hint__btn {
  background: rgba(255, 255, 255, 0.94);
  color: var(--text-1, #1a1d24);
  border-color: rgba(15, 23, 42, 0.12);
  box-shadow: 0 8px 24px rgba(15, 23, 42, 0.12);
}

.map-guide-dim {
  position: absolute;
  inset: 0;
  z-index: 5;
  background: rgba(15, 23, 42, 0.22);
  pointer-events: auto;
  transition: opacity 0.28s var(--ease);
}

html[data-theme="dark"] .map-guide-dim {
  background: rgba(0, 0, 0, 0.38);
}

.map-guide-dim[hidden] {
  display: none !important;
}

.map-ui-guide {
  position: fixed;
  inset: 0;
  z-index: 45;
  pointer-events: none;
}

.map-ui-guide.map-ui-guide--open {
  pointer-events: none;
}

.map-ui-guide__svg {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  pointer-events: none;
  z-index: 0;
}

.map-ui-guide__line {
  stroke: var(--brand);
}

.map-ui-guide__float {
  position: fixed;
  z-index: 1;
  left: 0;
  top: 0;
  width: min(90vw, 320px);
  box-sizing: border-box;
  pointer-events: none;
}

.map-ui-guide__card {
  padding: 14px 14px 12px;
  border-radius: var(--radius-xl);
  background: rgba(255, 255, 255, 0.78);
  border: 1px solid rgba(255, 255, 255, 0.55);
  box-shadow:
    0 8px 32px rgba(15, 23, 42, 0.12),
    0 1px 0 rgba(255, 255, 255, 0.65) inset;
  backdrop-filter: blur(18px);
  -webkit-backdrop-filter: blur(18px);
  pointer-events: auto;
  box-sizing: border-box;
}

html[data-theme="dark"] .map-ui-guide__card {
  background: rgba(30, 32, 40, 0.82);
  border-color: rgba(255, 255, 255, 0.12);
  box-shadow:
    0 12px 40px rgba(0, 0, 0, 0.45),
    inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

#map-ui-guide-arrowhead-poly {
  fill: var(--brand);
}

html[data-theme="dark"] .map-ui-guide__line {
  stroke: #a78bfa;
}

html[data-theme="dark"] #map-ui-guide-arrowhead-poly {
  fill: #a78bfa;
}

.map-ui-guide__head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
  margin-bottom: 10px;
}

.map-ui-guide__title {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.map-ui-guide__step {
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-3);
}

.map-ui-guide__body {
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-2);
}

.map-ui-guide__body p {
  margin: 0 0 8px;
}

.map-ui-guide__body p:last-child {
  margin-bottom: 0;
}

.map-ui-guide__body ul {
  margin: 0;
  padding-left: 1.15em;
}

.map-ui-guide__body li {
  margin-bottom: 6px;
}

.map-ui-guide__body li:last-child {
  margin-bottom: 0;
}

.map-ui-guide__body strong {
  color: var(--text);
  font-weight: 700;
}

.map-ui-guide__actions {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  margin-top: 14px;
}

.map-ui-guide__actions .btn-primary,
.map-ui-guide__actions .btn-secondary {
  min-height: 44px;
  padding-left: 18px;
  padding-right: 18px;
}

.map-ui-guide-target {
  position: relative;
  z-index: 24;
  outline: 2px solid rgba(91, 33, 182, 0.55);
  outline-offset: 3px;
  border-radius: var(--chrome-radius-capsule);
}

#map-controls.map-ui-guide-target {
  border-radius: 18px;
  outline-offset: 4px;
}

html[data-theme="dark"] .map-ui-guide-target {
  outline-color: rgba(167, 139, 250, 0.65);
}

@media (max-width: 380px) {
  .map-ui-guide__float {
    width: min(92vw, 300px);
  }

  .map-ui-guide__card {
    padding: 12px 12px 10px;
  }
}

/* 地图标点：正一红、全真蓝，其余（民间信仰、未明宗派等）蒂芙尼蓝；名称标签随缩放 --mz（用尺寸而非 transform scale，避免高 DPI 上发糊） */
.map-marker-wrap {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
  position: relative;
}

/* 平铺 + MassMarks：仅名称条，样式同 .map-marker-label 白底框 */
.map-temple-name-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: auto;
  cursor: pointer;
}

/* 经网格抽稀后数量少，略加对比与描边，全国视域下仍醒目 */
.map-temple-name-marker .map-marker-label {
  font-weight: 800;
  letter-spacing: 0.02em;
  border-width: 1.5px;
  text-shadow: 0 1px 0 rgba(255, 255, 255, 0.85);
}

html[data-theme="dark"] .map-temple-name-marker .map-marker-label {
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.55);
}

.map-marker-stack {
  position: relative;
  display: flex;
  flex-direction: column;
  align-items: center;
}

.map-marker-stack .map-marker-dot {
  position: relative;
  z-index: 1;
}

.map-marker-wrap .map-marker-dot {
  pointer-events: auto;
  cursor: pointer;
}
.map-marker-label {
  pointer-events: none;
  margin-top: calc(2px * var(--mz, 1) * var(--mp, 1));
  max-width: calc(140px * var(--mz, 1) * var(--mp, 1));
  padding: calc(2px * var(--mz, 1) * var(--mp, 1)) calc(8px * var(--mz, 1) * var(--mp, 1));
  border-radius: var(--radius-sm);
  background: var(--map-marker-label-bg);
  border: 1px solid var(--line-strong);
  font-size: calc(10px * var(--mz, 1) * var(--mp, 1));
  font-weight: 700;
  color: var(--text);
  line-height: 1.35;
  text-align: center;
  box-shadow: var(--shadow-float);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.map-marker-dot {
  width: calc(14px * var(--mz, 1) * var(--mp, 1));
  height: calc(14px * var(--mz, 1) * var(--mp, 1));
  border-radius: 50%;
  border: calc(2px * var(--mz, 1) * var(--mp, 1)) solid rgba(255, 255, 255, 0.92);
  box-shadow: 0 calc(1px * var(--mz, 1) * var(--mp, 1)) calc(4px * var(--mz, 1) * var(--mp, 1)) rgba(0, 0, 0, 0.35);
  box-sizing: border-box;
  flex-shrink: 0;
}
.map-marker-dot--zhengyi {
  background: #dc2626;
}
.map-marker-dot--quanzhen {
  background: #2563eb;
}
.map-marker-dot--other {
  background: #0abab5;
}

/* 用户自定义地点：圆圈内「自」，与宗派色点区分 */
.map-marker-dot--user-zi {
  width: calc(22px * var(--mz, 1) * var(--mp, 1));
  height: calc(22px * var(--mz, 1) * var(--mp, 1));
  min-width: calc(22px * var(--mz, 1) * var(--mp, 1));
  min-height: calc(22px * var(--mz, 1) * var(--mp, 1));
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(145deg, #7c3aed, #5b21b6);
  border: calc(2px * var(--mz, 1) * var(--mp, 1)) solid rgba(255, 255, 255, 0.95);
  padding: 0;
}
.map-marker-dot__zi {
  font-size: calc(11px * var(--mz, 1) * var(--mp, 1));
  font-weight: 800;
  color: #fff;
  line-height: 1;
  letter-spacing: 0;
  user-select: none;
  pointer-events: none;
}

.temple-row--user-place .temple-row__h4-main {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex-wrap: wrap;
}
.temple-row__zi {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 5px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 800;
  color: #fff;
  background: linear-gradient(145deg, #7c3aed, #5b21b6);
  flex-shrink: 0;
}

.btn-secondary--danger {
  border-color: rgba(220, 38, 38, 0.45);
  color: #b91c1c;
}

.user-place-edit__label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  margin-bottom: 8px;
  color: var(--text);
}
.user-place-edit__input {
  width: 100%;
  box-sizing: border-box;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  border: 1px solid var(--line-strong);
  font-size: var(--text-base);
  background: var(--surface-2, #f8fafc);
  margin-bottom: 10px;
}
.user-place-edit__row {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  align-items: center;
  margin-bottom: 12px;
}
.user-place-edit__row .user-place-edit__input {
  flex: 1 1 140px;
  margin-bottom: 0;
}
.user-place-edit__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-bottom: 8px;
}
.user-place-edit__hint {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--text-3);
  line-height: 1.55;
}

/* —— 设置页：参考 iOS「设置」— inset 分组、区段标题、圆角卡片、行间分割线、区段脚注 —— */
.me-settings-ios {
  display: flex;
  flex-direction: column;
  gap: 22px;
  /* 水平留白由 .panel-scroll 承担，与 iOS 设置页边距接近 */
  padding: 4px 0 28px;
  box-sizing: border-box;
}

/* —— 设置 · 消息（勘误 / 工单 / 公告）—— */
.me-inbox-section {
  margin: 0;
}

.me-inbox__head-btn {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  min-width: 0;
  margin: 0 0 6px;
  padding: 6px 4px;
  border: none;
  border-radius: 8px;
  box-sizing: border-box;
  gap: 10px;
  background: transparent;
  cursor: pointer;
  font: inherit;
  text-align: left;
}

.me-inbox__head-btn:focus {
  outline: none;
}

.me-inbox__head-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.me-inbox__head-btn:hover {
  background: rgba(91, 33, 182, 0.06);
}

html[data-theme="dark"] .me-inbox__head-btn:hover {
  background: rgba(167, 139, 250, 0.08);
}

.me-inbox__head-left {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
}

.me-inbox__head-left .me-inbox__hint {
  flex-shrink: 0;
}

.me-inbox__heading {
  margin: 0;
  padding: 0;
}

.me-inbox__badge {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 20px;
  height: 20px;
  padding: 0 6px;
  font-size: 11px;
  font-weight: 700;
  color: #fff;
  background: var(--brand, #5b21b6);
  border-radius: 10px;
}

.me-inbox__badge--in-toolbar {
  flex-shrink: 0;
}

.me-inbox__chev {
  flex-shrink: 0;
  width: 10px;
  height: 10px;
  border-right: 2px solid var(--text-3);
  border-bottom: 2px solid var(--text-3);
  transform: rotate(45deg);
  margin-top: -4px;
  transition: transform 0.2s ease;
}

.me-inbox-section--collapsed .me-inbox__chev {
  transform: rotate(-135deg);
  margin-top: 2px;
}

.me-inbox__module {
  display: flex;
  flex-direction: column;
  min-width: 0;
}

.me-inbox__module .me-inbox__toolbar {
  margin-bottom: 0;
  padding: 10px 12px;
  border-bottom: 1px solid var(--line);
  box-sizing: border-box;
}

.me-inbox__identity-scope {
  margin: 0 0 10px;
  padding: 8px 10px;
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-2);
  background: var(--brand-soft);
  border: 1px solid rgba(91, 33, 182, 0.18);
  border-radius: 8px;
  box-sizing: border-box;
}

html[data-theme="dark"] .me-inbox__identity-scope {
  border-color: rgba(196, 181, 253, 0.22);
}

.me-inbox__identity-scope code {
  font-size: 0.95em;
  font-weight: 600;
}

.me-inbox__toolbar {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
  padding: 0 2px;
}

.me-inbox__filters {
  display: inline-flex;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  overflow: hidden;
  background: var(--surface);
}

.me-inbox__filter {
  border: none;
  background: transparent;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
}

.me-inbox__filter.is-active {
  background: var(--brand-soft);
  color: var(--text);
  font-weight: 650;
}

html[data-theme="dark"] .me-inbox__filter.is-active {
  background: rgba(139, 92, 246, 0.28);
  color: #f5f3ff;
}

.me-inbox__mark-all {
  margin-left: 0;
  padding: 8px 12px;
  font-size: 13px;
  white-space: nowrap;
}

.me-inbox__module .me-inbox__list-wrap {
  flex: 1 1 auto;
  min-width: 0;
}

.me-inbox__list-wrap {
  padding: 0;
}

.me-inbox__list {
  display: flex;
  flex-direction: column;
}

.me-inbox__item {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 4px;
  width: 100%;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid var(--line);
  background: transparent;
  text-align: left;
  cursor: pointer;
  font: inherit;
  box-sizing: border-box;
}

.me-inbox__item:last-child {
  border-bottom: none;
}

.me-inbox__item:hover {
  background: rgba(91, 33, 182, 0.04);
}

html[data-theme="dark"] .me-inbox__item:hover {
  background: rgba(167, 139, 250, 0.06);
}

.me-inbox__item--read .me-inbox__item-title {
  color: var(--text-2);
  font-weight: 500;
}

.me-inbox__item-title {
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  line-height: 1.35;
}

.me-inbox__item-sub {
  font-size: 13px;
  color: var(--text-3);
  line-height: 1.4;
}

.me-inbox__item-body {
  font-size: 13px;
  color: var(--text-2);
  line-height: 1.5;
  white-space: pre-wrap;
  margin-top: 4px;
}

.me-inbox__empty {
  margin: 0;
  padding: 20px 16px;
  font-size: 14px;
  color: var(--text-3);
  text-align: center;
}

.me-inbox__error {
  margin: 0;
  padding: 10px 16px 14px;
  font-size: 13px;
  line-height: 1.45;
  color: #b91c1c;
  border-top: 1px solid rgba(185, 28, 28, 0.22);
  background: rgba(185, 28, 28, 0.06);
  box-sizing: border-box;
}

.me-inbox__error::selection {
  background: rgba(185, 28, 28, 0.35);
  color: inherit;
}

html[data-theme="dark"] .me-inbox__error {
  color: #fecaca;
  border-top-color: rgba(248, 113, 113, 0.35);
  background: rgba(248, 113, 113, 0.08);
}

html[data-theme="dark"] .me-inbox__error::selection {
  background: rgba(248, 113, 113, 0.35);
  color: inherit;
}

.me-settings-ios > .ios-settings-group {
  margin: 0;
}

.ios-settings-group {
  display: flex;
  flex-direction: column;
  gap: 0;
}

/* 区段标题：小号次要色，顶对齐、与系统设置区段标签一致 */
.ios-settings-group__header {
  margin: 0 0 6px;
  padding: 0 4px;
  font-size: 13px;
  font-weight: 600;
  line-height: 1.3;
  letter-spacing: -0.01em;
  color: var(--text-3);
  text-transform: none;
}

html[data-theme="dark"] .ios-settings-group__header {
  color: var(--text-3);
}

/* 区段标题 + 角标（如「备份」旁的「手动备份」） */
.ios-settings-group__header-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
  margin: 0 0 6px;
  padding: 0 4px;
}

.ios-settings-group__header--inline {
  margin: 0;
  padding: 0;
}

.ios-settings-group__header-pill {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  font-size: 11px;
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: 1.2;
  color: var(--brand);
  background: var(--brand-soft);
  border: 1px solid rgba(91, 33, 182, 0.22);
  border-radius: var(--radius-pill);
  box-sizing: border-box;
}

html[data-theme="dark"] .ios-settings-group__header-pill {
  color: var(--brand-accent-text);
  background: rgba(167, 139, 250, 0.14);
  border-color: rgba(196, 181, 253, 0.28);
}

#page-me .me-settings-ios .ios-settings-group__header-row .ios-settings-group__header--inline {
  flex: 0 1 auto;
}


/* 分组圆角容器（单列表）：与列表 .temple-row / .me-saved-card 同语汇 */
.ios-settings-group__card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  overflow: hidden;
  box-shadow: var(--shadow-rest);
}

/* 区段脚注（卡片下方说明） */
.ios-settings-group__footer {
  margin: 6px 0 0;
  padding: 0 4px;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-3);
}

.ios-settings-group__footer--before-card {
  margin: 0 0 8px;
}

/* 设置：说明紧跟具体功能，不放在一级标题下 */
.me-settings-card-note {
  margin: 0;
  font-size: 13px;
  line-height: 1.45;
  color: var(--text-3);
}

.me-settings-card-note--in-card-top {
  padding: 12px 16px;
  border-bottom: 1px solid var(--line);
}

.me-settings-card-note--in-card-footer {
  padding: 10px 16px 12px;
  border-top: 1px solid var(--line);
}

html[data-theme="dark"] .ios-settings-group__footer {
  color: rgba(235, 235, 245, 0.55);
}

/* 子屏大标题（设置内独立屏时用） */
.ios-settings-screen-title {
  margin: 2px 0 6px;
  padding: 0 2px;
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.25;
  color: var(--text);
}

.ios-settings-screen-lead {
  margin: 0 0 4px;
  padding: 0 4px 8px;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-2);
}

/* 列表行：最小高度与分割线 */
.me-settings-ios .ios-settings-group__card > .ios-settings-row {
  padding: 11px 16px;
  min-height: 44px;
  box-sizing: border-box;
  border-bottom: 1px solid var(--line);
  align-items: center;
}

.me-settings-ios .ios-settings-group__card > .ios-settings-row:last-child {
  border-bottom: none;
}

.me-settings-ios .ios-settings-group__card .me-setting-row + .me-setting-row {
  margin-top: 0;
}

.me-settings-ios .ios-settings-group__card.me-pref-card--settings-ios {
  margin-top: 0;
}

.me-settings-ios .me-setting-row.ios-settings-row .me-setting-row__text {
  align-self: center;
}

.me-settings-ios .ios-settings-row--cta {
  padding: 12px 16px;
  border-top: 1px solid var(--line);
  border-bottom: none;
}

/* 个人资料 / 外观卡片在设置页内与分组容器、列表卡片统一 */
.me-settings-ios .profile-card--settings-ios,
.me-settings-ios .me-pref-card--settings-ios {
  margin: 0;
  padding: 18px 16px 16px;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-rest);
  border: 1px solid var(--line);
  text-align: center;
}

.me-settings-ios .profile-card--settings-ios .profile-name-label {
  text-align: left;
  max-width: none;
}

.me-settings-ios .profile-card--settings-ios .profile-name-input {
  max-width: none;
}

.me-settings-ios .profile-card--settings-ios .profile-name-save {
  max-width: none;
  min-height: 48px;
}

.me-settings-ios .profile-card--settings-ios .profile-identity {
  max-width: none;
  width: 100%;
  margin: 14px 0 0;
}

.me-settings-ios .profile-card--settings-ios .profile-identity__value {
  width: 100%;
}

.me-settings-ios .me-pref-card--settings-ios {
  text-align: left;
}

.me-settings-ios .me-pref-card--settings-ios .me-setting-row {
  margin: 0;
  padding: 0;
  min-height: 0;
  border: none;
}

.me-settings-ios .me-pref-card--settings-ios .me-setting-row__text {
  padding-right: 8px;
}

.me-settings-ios .me-data-transfer-card--settings-ios {
  margin: 0;
  padding: 16px;
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-rest);
  border: 1px solid var(--line);
}

.me-settings-ios .me-data-transfer-card--settings-ios .me-data-transfer__danger-zone {
  border-top: 1px solid var(--line);
  margin-top: 14px;
  padding-top: 14px;
}


/* —— 我的 · 设置（深色）：与列表 / 收藏卡片同款 — surface、line、shadow-rest；顶栏分区胶囊同 .cat-chip-capsule（shadow-float） —— */
html[data-theme="dark"] #page-me.panel-page--sheet,
html[data-theme="dark"] #page-me .me-panel-inner,
html[data-theme="dark"] #page-me .panel-scroll {
  background: var(--surface);
}

html[data-theme="dark"] #page-me .me-section-tabs-wrap {
  /* 与底栏 dock 一致：全宽条不设底色，仅 .me-section-tabs 胶囊有表面；sticky 时列表从胶囊下缘接上 */
  background: transparent;
}

html[data-theme="dark"] #page-me .me-section-tabs {
  box-sizing: border-box;
  min-height: var(--chrome-track-h);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-float);
  border-radius: var(--radius-pill);
  gap: 0;
  padding: 3px 5px;
}

html[data-theme="dark"] #page-me .me-section-tab {
  color: var(--text-2);
  font-weight: 600;
}

html[data-theme="dark"] #page-me .me-section-tab.is-active {
  background: var(--brand);
  color: #fff;
  font-weight: 800;
  /* 无外扩阴影：与 overflow:hidden 轨道叠层时易在圆角处形成深色方框边 */
  box-shadow: none;
}

html[data-theme="dark"] #page-me .me-section-tab:active:not(.is-active) {
  background: var(--page-bg);
}

html[data-theme="dark"] #page-me .me-settings-ios {
  gap: 28px;
  padding-bottom: 32px;
}

html[data-theme="dark"] #page-me .me-settings-ios .ios-settings-group__header {
  margin: 0 0 8px;
  padding: 0 2px;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-3);
  letter-spacing: 0.02em;
}

html[data-theme="dark"] #page-me .me-settings-ios .ios-settings-group__card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-rest);
}

html[data-theme="dark"] #page-me .me-settings-ios .ios-settings-group__footer {
  color: var(--text-3);
}

html[data-theme="dark"] #page-me .me-settings-ios .me-settings-card-note {
  color: var(--text-3);
}

html[data-theme="dark"] #page-me .me-settings-ios .me-settings-card-note--in-card-top,
html[data-theme="dark"] #page-me .me-settings-ios .me-settings-card-note--in-card-footer {
  border-color: var(--line);
}

html[data-theme="dark"] #page-me .me-settings-ios .ios-settings-group__card > .ios-settings-row {
  border-bottom-color: var(--line);
}

html[data-theme="dark"] #page-me .me-settings-ios .ios-settings-row--cta {
  border-top-color: var(--line);
}

html[data-theme="dark"] #page-me .me-settings-ios .me-setting-row__label {
  font-weight: 500;
  color: var(--text);
}

html[data-theme="dark"] #page-me .me-settings-ios .me-setting-row__hint {
  color: var(--text-3);
}


html[data-theme="dark"] #page-me .me-settings-ios .profile-card--settings-ios,
html[data-theme="dark"] #page-me .me-settings-ios .me-pref-card--settings-ios,
html[data-theme="dark"] #page-me .me-settings-ios .me-data-transfer-card--settings-ios {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  box-shadow: var(--shadow-rest);
  padding: 20px 16px 18px;
}

html[data-theme="dark"] #page-me .me-settings-ios .profile-name-label {
  color: var(--text-3);
  font-weight: 500;
}

html[data-theme="dark"] #page-me .me-settings-ios .profile-name-input {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text);
  border-radius: var(--radius-md);
}

html[data-theme="dark"] #page-me .me-settings-ios .profile-name-input::placeholder {
  color: var(--text-3);
}

html[data-theme="dark"] #page-me .me-settings-ios .profile-meta {
  color: var(--text-3);
}

html[data-theme="dark"] #page-me .me-settings-ios .profile-identity__label {
  color: var(--text-3);
  font-weight: 500;
}

html[data-theme="dark"] #page-me .me-settings-ios .profile-identity__value {
  background: var(--surface-2);
  border: 1px solid var(--line);
  color: var(--text-2);
}

html[data-theme="dark"] #page-me .me-settings-ios .profile-avatar-img,
html[data-theme="dark"] #page-me .me-settings-ios .profile-avatar-hit .avatar {
  border-color: rgba(255, 255, 255, 0.14);
  box-shadow: none;
}

html[data-theme="dark"] #page-me .me-settings-ios .profile-avatar-clear {
  color: var(--brand-accent-text);
}

html[data-theme="dark"] #page-me .me-settings-ios .profile-avatar-clear:hover {
  color: var(--brand-text-on-dark);
}

html[data-theme="dark"] #page-me .me-settings-ios .me-pref-card--settings-ios .me-setting-row.ios-settings-row {
  margin: 0 -16px;
  padding: 14px 16px;
  min-height: 48px;
  border-bottom: 1px solid var(--line);
  width: calc(100% + 32px);
  box-sizing: border-box;
}

html[data-theme="dark"] #page-me .me-settings-ios .me-pref-card--settings-ios .me-setting-row.ios-settings-row:last-child {
  border-bottom: none;
}

html[data-theme="dark"] #page-me .me-settings-ios .profile-name-save.btn-primary {
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.38);
}

html[data-theme="dark"] #page-me .me-settings-ios .me-data-transfer__label {
  color: var(--text-3);
}

html[data-theme="dark"] #page-me .me-settings-ios .me-data-transfer__textarea {
  background: var(--surface-2);
  border: 1px solid var(--line-strong);
  color: var(--text);
  border-radius: var(--radius-md);
}

html[data-theme="dark"] #page-me .me-settings-ios .me-data-transfer__actions .btn-primary {
  background: var(--brand);
  border: none;
  color: #ffffff;
  box-shadow: 0 4px 18px rgba(139, 92, 246, 0.38);
  border-radius: 12px;
}

html[data-theme="dark"] #page-me .me-settings-ios .me-data-transfer__actions .btn-secondary {
  background: var(--surface-2);
  color: var(--brand-accent-text);
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
}

html[data-theme="dark"] #page-me .me-settings-ios .me-data-transfer__danger-zone {
  border-top-color: var(--line);
}

html[data-theme="dark"] #page-me .me-settings-ios .me-data-transfer__danger-warn {
  color: #ff453a;
}

html[data-theme="dark"] #page-me .me-settings-ios .me-data-transfer-card--settings-ios .btn-danger {
  border-radius: 12px;
  box-shadow: none;
}


/* 自定义地点 CTA：与数据导入卡片主按钮尺度一致 */
.me-user-place-card__intro {
  margin: 0 0 14px;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-2);
}

.me-user-place-card__cta {
  width: 100%;
  min-height: 44px;
  font-weight: 700;
  padding: 12px 18px;
  border: none;
  cursor: pointer;
  font-family: inherit;
  font-size: var(--text-base);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.me-user-place-card__cta:active {
  transform: scale(0.98);
}

/* 道观详情 Sheet：自定义地点编辑区，与「我的」分块同一分隔语汇 */
.sheet-body .user-place-edit {
  margin-top: var(--sheet-module-pad-y);
  padding-top: var(--sheet-module-pad-y);
  border-top: 1px solid var(--line);
}

.sheet-body .user-place-edit__label {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: var(--leading-snug);
  color: var(--text);
}

.user-place-draft__meta,
.user-place-draft__addr {
  margin: 0 0 12px;
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--text-2);
}

.user-place-draft__addr {
  color: var(--text-3);
}

/* 道观合并标点：与品牌紫 + 门头金系呼应，区别于正一/全真单色小点 */
.map-marker-cluster-wrap {
  display: flex;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  position: relative;
  filter: drop-shadow(
    0 calc(4px * var(--mz, 1) * var(--mp, 1)) calc(14px * var(--mz, 1) * var(--mp, 1)) rgba(91, 33, 182, 0.3)
  );
}

.map-marker-cluster {
  position: relative;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: calc(42px * var(--mz, 1) * var(--mp, 1));
  min-height: calc(42px * var(--mz, 1) * var(--mp, 1));
  padding: 0 calc(12px * var(--mz, 1) * var(--mp, 1));
  border-radius: var(--radius-pill);
  border: calc(2px * var(--mz, 1) * var(--mp, 1)) solid rgba(255, 253, 250, 0.94);
  background: linear-gradient(
    155deg,
    #7c3aed 0%,
    var(--brand) 42%,
    var(--brand-dark) 100%
  );
  /* 外圈淡金描边 */
  box-shadow:
    0 0 0 1px rgba(201, 162, 39, 0.42),
    0 calc(1px * var(--mz, 1) * var(--mp, 1)) 0 rgba(255, 255, 255, 0.28) inset,
    0 calc(-1px * var(--mz, 1) * var(--mp, 1)) 0 rgba(0, 0, 0, 0.12) inset,
    0 calc(8px * var(--mz, 1) * var(--mp, 1)) calc(18px * var(--mz, 1) * var(--mp, 1)) rgba(76, 29, 149, 0.38),
    0 calc(2px * var(--mz, 1) * var(--mp, 1)) calc(4px * var(--mz, 1) * var(--mp, 1)) rgba(0, 0, 0, 0.22);
  font-family: var(--font);
  font-size: calc(14px * var(--mz, 1) * var(--mp, 1));
  font-weight: 700;
  font-variant-numeric: tabular-nums;
  letter-spacing: -0.02em;
  color: #fffef8;
  line-height: 1;
  text-align: center;
  box-sizing: border-box;
  pointer-events: auto;
  cursor: pointer;
  text-shadow: 0 calc(1px * var(--mz, 1) * var(--mp, 1)) calc(2px * var(--mz, 1) * var(--mp, 1)) rgba(0, 0, 0, 0.35);
}

.map-marker-cluster:active {
  filter: brightness(1.06);
}

#map {
  position: relative;
  z-index: 0;
  width: 100%;
  height: 100%;
  font-family: var(--font);
  /* 用户可调标点相对默认大小的倍率（1=与原先一致），由 JS 写入 */
  --mp: 1;
}

/* 隐藏高德地图 Logo / 版权信息 */
#map .amap-logo,
#map .amap-copyright {
  display: none !important;
}

.map-ui {
  position: absolute;
  inset: 0;
  pointer-events: none;
  z-index: 10;
}

.map-ui__top {
  pointer-events: auto;
  padding: 10px 14px 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 选点模式：顶栏胶囊折叠占位，提示条叠在同一带区，多露出地图 */
.map-ui.map-ui--user-place-picking .map-ui__top,
.map-ui.map-ui--map-review-picking .map-ui__top {
  padding-top: 0;
  gap: 0;
}

.map-ui.map-ui--user-place-picking .map-toolbar-capsule-wrap,
.map-ui.map-ui--map-review-picking .map-toolbar-capsule-wrap {
  height: 0;
  min-height: 0;
  overflow: hidden;
  visibility: hidden;
  pointer-events: none;
  margin: 0;
}

.map-toolbar-capsule-wrap {
  display: flex;
  justify-content: center;
  width: 100%;
  min-width: 0;
}

.map-toolbar-capsule {
  pointer-events: auto;
  display: inline-flex;
  align-items: center;
  max-width: calc(100% - 8px);
  min-width: 0;
  /* 右端与轨道同径的圆钮与胶囊半圆端同心：外框高≈total-h+上下边框，圆心距右缘=外高/2 */
  padding: var(--chrome-track-pad-y) calc((var(--map-capsule-total-h) + 2px) / 2 - var(--chrome-track-h) / 2 - 1px)
    var(--chrome-track-pad-y) var(--chrome-pad-inline-start);
  border-radius: var(--chrome-radius-capsule);
  background: var(--chrome-surface);
  border: var(--chrome-border);
  box-shadow: var(--chrome-shadow-capsule);
}

.map-toolbar-capsule .map-ui__toolbar-row {
  gap: var(--chrome-capsule-gap);
  flex: 1;
  min-width: 0;
}

.map-toolbar-capsule .map-city-pill {
  box-shadow: none;
  height: var(--chrome-track-h);
  max-width: min(38vw, 148px);
}

.map-toolbar-capsule .btn-pill-ghost {
  box-shadow: none;
  border: none;
  background: transparent;
  height: var(--chrome-track-h);
}

.map-toolbar-capsule .btn-pill-ghost:hover {
  background: rgba(15, 23, 42, 0.06);
}

.map-toolbar-capsule .btn-pill-ghost:active {
  background: rgba(15, 23, 42, 0.1);
}

.map-toolbar-capsule .btn-pill-ghost--icon {
  width: var(--chrome-track-h);
  border-radius: var(--chrome-radius-ctrl);
}

/* 与「定位」「显名」等粗体中文视觉对齐：近满轨高度，描边略加粗 */
.map-toolbar-capsule .btn-pill-ghost--icon svg.lucide {
  width: calc(var(--chrome-track-h) - 1px);
  height: calc(var(--chrome-track-h) - 1px);
  stroke-width: 2.65;
}

.map-toolbar-capsule .btn-pill-ghost--toggle {
  width: var(--chrome-track-h);
  min-width: var(--chrome-track-h);
  max-width: var(--chrome-track-h);
  padding: 0;
  border-radius: 50%;
  aspect-ratio: 1;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  line-height: 1;
}

/* 「显名」关闭态：实线弱描边，避免虚线像异常焦点或未渲染 */
.map-toolbar-capsule .btn-pill-ghost.btn-pill-ghost--toggle.is-off {
  border: 1px solid rgba(148, 163, 184, 0.5);
  color: rgba(100, 116, 139, 0.98);
}

.map-toolbar-capsule .btn-pill-ghost.btn-pill-ghost--toggle:not(.is-off) {
  border: none;
  color: var(--text);
  background: rgba(15, 23, 42, 0.07);
}

.map-toolbar-capsule #btn-map-search[aria-expanded="true"] {
  background: var(--brand-soft);
}

.map-city-pill {
  flex: 0 1 auto;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  height: var(--chrome-track-h);
  padding: 0 10px;
  border-radius: var(--chrome-radius-capsule);
  background: linear-gradient(145deg, #fffef8 0%, #fff4d6 45%, #fde9a8 100%);
  border: 1px solid #c9a227;
  box-shadow: 0 4px 18px rgba(201, 162, 39, 0.28), 0 1px 0 rgba(255, 255, 255, 0.65) inset,
    var(--shadow-float);
  font-size: var(--text-sm);
  font-weight: 700;
  max-width: min(42vw, 160px);
  min-width: 0;
}

.map-ui__toolbar-row .map-city-pill {
  flex: 0 1 auto;
  max-width: min(42vw, 160px);
}

.map-toolbar-capsule .map-ui__toolbar-row .map-city-pill {
  max-width: min(38vw, 148px);
}

.map-city-pill__city {
  min-width: 0;
  color: #6b4a0f;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-align: left;
}

.map-ui__chips-scroll {
  overflow-x: auto;
  overflow-y: hidden;
  -webkit-overflow-scrolling: touch;
  margin: 0 -14px;
  padding: 0 14px 2px;
  scrollbar-width: none;
}

.map-ui__chips-scroll::-webkit-scrollbar {
  display: none;
}

.map-ui__chips {
  display: flex;
  gap: 8px;
  width: max-content;
  padding-bottom: 2px;
}

.filter-pill {
  flex-shrink: 0;
  padding: 8px 18px;
  border: none;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  font-weight: 600;
  cursor: pointer;
  background: var(--surface);
  color: var(--text-2);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-float);
  transition: background 0.2s ease, color 0.2s ease, border-color 0.2s ease, transform 0.12s ease;
}

.filter-pill:active {
  transform: scale(0.98);
}

.filter-pill.active {
  background: var(--brand);
  color: #fff;
  border-color: var(--brand);
  box-shadow: var(--shadow-float), 0 0 0 1px rgba(255, 255, 255, 0.2) inset;
}

.list-search-row {
  margin: 0 0 14px;
}

.list-search-inner {
  position: relative;
}

.map-ui__toolbar-row {
  display: flex;
  align-items: center;
  gap: 8px;
  flex-wrap: nowrap;
  min-width: 0;
}

#btn-map-search[aria-expanded="true"] {
  border-color: rgba(91, 33, 182, 0.5);
  color: var(--brand);
  box-shadow: var(--shadow-float), 0 0 0 3px var(--brand-soft);
}

.map-search-panel {
  width: 100%;
  min-width: 0;
}

.map-search-wrap {
  position: relative;
  width: 100%;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

/* 分段控件：置于搜索框上方，与顶栏胶囊同一语汇 */
.map-search-scope {
  display: flex;
  gap: 0;
  padding: 4px;
  flex-wrap: nowrap;
  align-items: stretch;
  border-radius: var(--radius-md);
  background: var(--surface-2);
  border: 1px solid var(--line);
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.06);
}

html[data-theme="dark"] .map-search-scope {
  box-shadow: inset 0 1px 0 rgba(255, 255, 255, 0.05);
}

.map-search-scope__btn {
  flex: 1 1 0;
  min-width: 0;
  padding: 8px 10px;
  border-radius: 0;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: var(--text-xs);
  font-weight: 600;
  cursor: pointer;
  line-height: 1.25;
  text-align: center;
  transition:
    background 0.18s var(--ease),
    color 0.18s var(--ease),
    box-shadow 0.18s var(--ease);
}

.map-search-scope__btn:hover:not(.is-active) {
  color: var(--text);
  background: rgba(0, 0, 0, 0.045);
}

html[data-theme="dark"] .map-search-scope__btn:hover:not(.is-active) {
  background: rgba(255, 255, 255, 0.07);
}

.map-search-scope__btn.is-active {
  color: var(--brand);
  background: var(--surface);
  box-shadow: var(--shadow-rest);
}

.map-search-scope__btn:active:not(.is-active) {
  background: rgba(0, 0, 0, 0.06);
}

html[data-theme="dark"] .map-search-scope__btn:active:not(.is-active) {
  background: rgba(255, 255, 255, 0.09);
}

.map-search-scope__btn:first-child {
  border-top-left-radius: var(--radius-sm);
  border-bottom-left-radius: var(--radius-sm);
}

.map-search-scope__btn:last-child {
  border-top-right-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

.map-search-scope__btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
  z-index: 1;
}

@media (max-width: 520px) {
  .map-search-scope {
    flex-wrap: wrap;
  }

  .map-search-scope__btn {
    flex: 1 1 calc(50% - 2px);
    min-width: min(100%, 140px);
  }
}

.map-search-clear {
  flex-shrink: 0;
  width: 28px;
  height: 28px;
  margin-right: 4px;
  border: none;
  border-radius: 50%;
  background: var(--page-bg);
  color: var(--text-2);
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}

.map-search-clear svg.lucide {
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.search-suggest {
  position: absolute;
  left: 0;
  right: 0;
  top: calc(100% + 6px);
  z-index: 20;
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-dock);
  max-height: min(52vh, 320px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.search-suggest__item {
  width: 100%;
  text-align: left;
  padding: 12px 16px;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: transparent;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 4px;
}

.search-suggest__item:first-child {
  border-top-left-radius: var(--radius-sm);
  border-top-right-radius: var(--radius-sm);
}

.search-suggest__item:last-child {
  border-bottom: none;
  border-bottom-left-radius: var(--radius-sm);
  border-bottom-right-radius: var(--radius-sm);
}

.search-suggest__item:only-child {
  border-radius: var(--radius-sm);
}

.search-suggest__item:active {
  background: var(--page-bg);
}

.map-review-poi-pick-list {
  max-height: min(48vh, 280px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  margin-top: 8px;
  background: var(--surface);
}

.search-suggest__name {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  font-weight: 700;
  font-size: var(--text-sm);
  color: var(--text);
}

.search-suggest__source-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 8px;
  border-radius: var(--radius-pill);
  font-size: 11px;
  line-height: 1.25;
  font-weight: 700;
  letter-spacing: 0.03em;
  white-space: nowrap;
}

.search-suggest__source-tag--wendao {
  color: #ffffff;
  background: linear-gradient(135deg, #7c3aed 0%, #5b21b6 100%);
  border: 1px solid rgba(255, 255, 255, 0.26);
  box-shadow: 0 1px 6px rgba(91, 33, 182, 0.4);
  text-shadow: 0 1px 1px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .search-suggest__source-tag--wendao {
  background: linear-gradient(135deg, #8b5cf6 0%, #6d28d9 100%);
  border-color: rgba(255, 255, 255, 0.32);
  box-shadow: 0 1px 7px rgba(109, 40, 217, 0.48);
}

.search-suggest__sub {
  font-size: var(--text-xs);
  color: var(--text-3);
  line-height: 1.4;
}

.search-suggest__empty {
  color: var(--text-3);
  cursor: default;
  font-size: var(--text-sm);
}

.map-filter-wrap,
.map-layer-wrap,
.map-point-size-wrap {
  position: relative;
  flex-shrink: 0;
}

.map-filter-popover,
.map-layer-popover {
  position: absolute;
  top: calc(100% + 8px);
  right: 0;
  z-index: 30;
  min-width: 200px;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-dock);
}

/* 标点大小：勿用 92vw + 相对窄按钮 right:0，否则窄屏会向左溢出视口；位置由 JS 按视口夹紧 */
.map-point-size-popover {
  position: fixed;
  left: 0;
  top: auto;
  width: min(300px, calc(100vw - 24px));
  max-width: calc(100vw - 24px);
  min-width: 0;
  z-index: 30;
  padding: 14px 16px;
  background: var(--surface);
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-dock);
  box-sizing: border-box;
}

.map-point-size-popover > .map-filter-popover__hint {
  overflow-wrap: break-word;
}

.map-point-size-slider-block {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.map-point-size-slider-head {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.map-point-size-slider-label {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
  margin: 0;
}

.map-point-size-value {
  font-size: var(--text-sm);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
  color: var(--brand);
}

html[data-theme="dark"] .map-point-size-value {
  color: var(--brand-accent-text);
}

.map-point-size-slider-row {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
}

.map-point-size-tick {
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-3);
  width: 1em;
  text-align: center;
}

.map-point-size-slider-row input[type="range"] {
  flex: 1;
  min-width: 0;
  height: 28px;
  margin: 0;
  accent-color: var(--brand);
  cursor: pointer;
}

.map-point-size-reset {
  align-self: flex-start;
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line-strong);
  background: var(--surface-2);
  color: var(--text-2);
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: var(--font);
  cursor: pointer;
  transition:
    background 0.15s ease,
    border-color 0.15s ease,
    color 0.15s ease;
}

.map-point-size-reset:hover {
  border-color: rgba(91, 33, 182, 0.35);
  color: var(--text);
}

.map-point-size-reset:active {
  transform: scale(0.98);
}

.map-filter-popover__group-label {
  margin: 0 0 8px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-3);
  line-height: 1.35;
}

.map-filter-popover__group-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
  margin: 0 0 8px;
}

.map-filter-popover__group-head .map-filter-popover__group-label {
  margin: 0;
  flex: 1;
  min-width: 0;
}

.map-filter-popover__group-head .map-filter-popover__inline-info {
  flex-shrink: 0;
}

.map-filter-popover__group-hint {
  margin: -4px 0 10px;
  font-size: var(--text-xs);
  color: var(--text-3);
  line-height: 1.45;
}

.map-filter-popover__group-hint p {
  margin: 0;
}

#map-filter-group-deity {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

#map-filter-group-personal {
  margin-top: 12px;
  padding-top: 10px;
  border-top: 1px solid var(--line);
}

.map-filter-deity-checks {
  display: flex;
  flex-direction: column;
  gap: 0;
}

.map-filter-popover__hint,
.map-layer-popover__hint {
  margin: 0 0 12px;
  font-size: var(--text-xs);
  color: var(--text-3);
  line-height: 1.45;
}

.map-filter-check {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  cursor: pointer;
}

.map-filter-popover .map-filter-check:last-of-type,
.map-layer-popover .map-filter-check:last-of-type {
  margin-bottom: 0;
}

.map-filter-check input {
  width: 18px;
  height: 18px;
  accent-color: var(--brand);
}

.btn-pill-ghost--icon {
  width: var(--chrome-track-h);
  padding: 0;
  display: flex;
  align-items: center;
  justify-content: center;
}

.btn-pill-ghost--icon svg.lucide {
  stroke: var(--text-2);
  fill: none;
}

.btn-pill-ghost--toggle {
  min-width: 52px;
  padding: 0 12px;
}

.btn-pill-ghost--toggle.is-off {
  color: var(--text-3);
  border-style: solid;
  border-color: rgba(148, 163, 184, 0.45);
}

.map-search-field {
  width: 100%;
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 8px;
  height: var(--chrome-track-h);
  padding: 0 16px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-search-field);
  pointer-events: auto;
  transition: box-shadow 0.2s ease, border-color 0.2s ease;
}

.map-search-field:focus-within {
  border-color: rgba(91, 33, 182, 0.55);
  box-shadow: var(--shadow-search-field), 0 0 0 3px var(--brand-soft);
}

.map-search-field svg.lucide {
  flex-shrink: 0;
  opacity: 0.45;
  stroke: var(--text);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-search-field input {
  flex: 1;
  min-width: 0;
  border: none;
  background: transparent;
  font-size: var(--text-sm);
  color: var(--text);
  outline: none;
}

.map-search-field input::placeholder {
  color: var(--text-3);
}

.map-search-field input::-webkit-search-cancel-button {
  -webkit-appearance: none;
}

.btn-pill-ghost {
  flex-shrink: 0;
  height: var(--chrome-track-h);
  padding: 0 16px;
  border-radius: var(--chrome-radius-capsule);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--chrome-shadow-ctrl);
  transition: var(--chrome-transition);
}

.btn-pill-ghost:active {
  transform: scale(var(--chrome-press-scale));
}

/* 选点模式：浮动信息块（与地图顶栏胶囊同一 chrome 语汇） */
/* [hidden] 默认 display:none 会被下方 display:flex 覆盖，需显式强制隐藏 */
.map-user-place-pick-hint[hidden] {
  display: none !important;
}

.map-user-place-pick-hint {
  --map-pick-hint-title: rgba(60, 60, 67, 0.88);
  --map-pick-hint-body: rgba(60, 60, 67, 0.55);
  position: absolute;
  left: 50%;
  transform: translateX(-50%);
  top: 10px;
  z-index: 25;
  display: flex;
  flex-direction: row;
  flex-wrap: nowrap;
  align-items: center;
  gap: 2px;
  box-sizing: border-box;
  width: max-content;
  max-width: calc(100vw - 24px);
  min-height: 0;
  min-width: 0;
  padding: calc(var(--chrome-track-pad-y) + 3px) 4px calc(var(--chrome-track-pad-y) + 3px) 14px;
  border-radius: var(--chrome-radius-panel);
  overflow: visible;
  font-family: var(--font);
  background: var(--chrome-surface);
  border: var(--chrome-border);
  box-shadow: var(--chrome-shadow-capsule);
  color: var(--map-pick-hint-title);
  line-height: 1.35;
  -webkit-font-smoothing: antialiased;
  pointer-events: none;
}

.map-user-place-pick-hint__stack {
  flex: 1 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 5px;
}

.map-user-place-pick-hint__title {
  display: inline-block;
  max-width: 100%;
  font-size: var(--text-base);
  font-weight: 600;
  letter-spacing: -0.01em;
  line-height: 1.25;
  color: var(--map-pick-hint-title);
}

.map-user-place-pick-hint__desc {
  margin: 0;
  font-size: var(--text-sm);
  font-weight: 500;
  line-height: 1.35;
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  color: var(--map-pick-hint-body);
}

/* 关闭：右侧一列，与左侧标题+引导整体垂直居中 */
.map-user-place-pick-hint__cancel {
  flex: 0 0 auto;
  align-self: center;
  margin: 0;
  padding: 0;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  border-radius: 50%;
  background: transparent;
  color: rgb(142, 142, 147);
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  pointer-events: auto;
  overflow: hidden;
  position: relative;
  isolation: isolate;
  transition:
    background 0.12s ease,
    color 0.12s ease,
    transform 0.12s ease;
}

.map-user-place-pick-hint__cancel svg.lucide {
  display: block;
  flex-shrink: 0;
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.map-user-place-pick-hint__cancel:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

.map-user-place-pick-hint__cancel:active {
  transform: scale(var(--chrome-press-scale));
  background: rgba(91, 33, 182, 0.12);
}

@media (max-width: 480px) {
  .map-user-place-pick-hint {
    top: 8px;
    max-width: calc(100vw - 20px);
    padding: calc(var(--chrome-track-pad-y) + 2px) 2px calc(var(--chrome-track-pad-y) + 2px) 12px;
    gap: 0;
    border-radius: var(--chrome-radius-panel);
  }

  .map-user-place-pick-hint__stack {
    gap: 4px;
  }

  .map-user-place-pick-hint__title {
    font-size: 14px;
    line-height: 1.22;
    letter-spacing: -0.012em;
  }

  .map-user-place-pick-hint__desc {
    font-size: 12px;
    line-height: 1.32;
  }

  .map-user-place-pick-hint__cancel {
    width: 34px;
    height: 34px;
  }

  .map-user-place-pick-hint__cancel svg.lucide {
    width: 17px;
    height: 17px;
  }
}

/* 右下角控件 */
.map-controls {
  position: absolute;
  right: max(14px, env(safe-area-inset-right, 0px));
  bottom: var(--dock-clearance);
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: var(--chrome-floating-stack-gap);
  pointer-events: auto;
}

/* 「随缘」与演示说明红钮：成组堆叠，间距与右侧控件列一致 */
.map-suiyuan-stack {
  display: flex;
  flex-direction: column;
  gap: var(--chrome-floating-stack-gap);
  align-self: stretch;
  width: 100%;
}

.map-ctrl-btn.map-ctrl-btn--demo-notice {
  font-size: 0;
  background: linear-gradient(180deg, #fee2e2 0%, #fecaca 100%);
  color: #b91c1c;
  border: 1px solid #dc2626;
  box-shadow:
    0 0 0 1px rgba(220, 38, 38, 0.2),
    0 0 12px rgba(220, 38, 38, 0.28),
    0 4px 12px rgba(0, 0, 0, 0.08);
}

.map-ctrl-btn__demo-notice-label {
  font-size: 13px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.04em;
  color: #b91c1c;
}

.map-ctrl-btn.map-ctrl-btn--demo-notice:active {
  background: #fecaca;
  filter: brightness(0.96);
}

html[data-theme="dark"] .map-ctrl-btn.map-ctrl-btn--demo-notice {
  background: linear-gradient(180deg, rgba(127, 29, 29, 0.92) 0%, rgba(99, 23, 23, 0.9) 100%);
  border-color: #f87171;
  color: #fca5a5;
  box-shadow:
    0 0 0 1px rgba(248, 113, 113, 0.25),
    0 0 16px rgba(248, 113, 113, 0.32),
    0 4px 18px rgba(0, 0, 0, 0.35);
}

html[data-theme="dark"] .map-ctrl-btn__demo-notice-label {
  color: #fca5a5;
}

html[data-theme="dark"] .map-ctrl-btn.map-ctrl-btn--demo-notice:active {
  background: rgba(153, 27, 27, 0.55);
}

.map-ctrl-btn {
  width: var(--chrome-track-h);
  height: var(--chrome-track-h);
  border-radius: var(--chrome-radius-ctrl);
  background: var(--chrome-surface);
  color: var(--text);
  font-size: 22px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  box-shadow: var(--chrome-shadow-ctrl);
  border: var(--chrome-border-ctrl);
  display: flex;
  align-items: center;
  justify-content: center;
  transition: var(--chrome-transition);
}

.map-ctrl-btn:active {
  transform: scale(var(--chrome-press-scale));
  background: var(--chrome-ctrl-active-bg);
}

.map-ctrl-btn--icon {
  font-size: 0;
}

.map-ctrl-btn--icon svg {
  stroke: var(--text);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
}

/* 地图右侧：随缘 / 自定 / 提交（两字标，与下方圆形控件同尺寸） */
.map-ctrl-btn--suiyuan {
  font-family: inherit;
  font-size: 0;
}

.map-ctrl-btn__suiyuan-char {
  /* 与 .map-ctrl-btn__demo-notice-label（公告）同字号与字距 */
  font-size: 13px;
  font-weight: 800;
  line-height: 1.05;
  letter-spacing: 0.04em;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
}

/* 地图自选点模式：选点按钮高亮（与定位标点紫系一致） */
.map-ctrl-btn.map-ctrl-btn--pick-active {
  background: linear-gradient(160deg, #c084fc 0%, #9333ea 42%, #6d28d9 100%);
  color: #fff;
  border-color: rgba(196, 181, 253, 0.55);
  box-shadow:
    0 0 14px rgba(192, 132, 252, 0.78),
    0 0 26px rgba(147, 51, 234, 0.42),
    0 4px 12px rgba(0, 0, 0, 0.2);
  animation: map-pick-btn-glow 2.2s ease-in-out infinite;
}

.map-ctrl-btn.map-ctrl-btn--pick-active svg {
  stroke: #fff;
}

.map-ctrl-btn.map-ctrl-btn--pick-active .map-ctrl-btn__suiyuan-char {
  color: #fff;
}

.map-ctrl-btn.map-ctrl-btn--pick-active:active {
  transform: scale(var(--chrome-press-scale));
  filter: brightness(0.96);
}

@keyframes map-pick-btn-glow {
  0%,
  100% {
    box-shadow:
      0 0 14px rgba(192, 132, 252, 0.78),
      0 0 26px rgba(147, 51, 234, 0.42),
      0 4px 12px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow:
      0 0 20px rgba(216, 180, 254, 0.88),
      0 0 36px rgba(147, 51, 234, 0.52),
      0 4px 14px rgba(0, 0, 0, 0.22);
  }
}

@media (prefers-reduced-motion: reduce) {
  .map-ctrl-btn.map-ctrl-btn--pick-active {
    animation: none;
  }
}

/* —— 悬浮式底栏 —— */
.dock-wrap {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  z-index: 40;
  display: flex;
  justify-content: center;
  padding: 0 20px calc(12px + var(--safe-bottom));
  pointer-events: none;
  /* 仅中间 .app-dock 有底，勿让全宽固定层自带底色（否则像底下一整条深色板） */
  background: transparent;
  box-shadow: none;
}

.app-dock {
  pointer-events: auto;
  display: flex;
  align-items: center;
  justify-content: center;
  gap: var(--chrome-dock-gap);
  width: max-content;
  max-width: calc(100vw - 40px);
  padding: var(--chrome-track-pad-y) var(--chrome-dock-pad-x);
  border-radius: var(--chrome-radius-capsule);
  background: var(--chrome-surface);
  border: var(--chrome-border);
  box-shadow: var(--chrome-shadow-capsule);
  transition: box-shadow 0.22s var(--ease), border-color 0.22s ease;
}

.app-dock:hover {
  box-shadow: var(--chrome-shadow-capsule), var(--dock-capsule-hover-extra);
}

/* 深色：去掉 --chrome-shadow-capsule 的大面积黑投影（易呈「底栏外一圈方框」），只保留描边 + 悬停紫晕 */
html[data-theme="dark"] .app-dock {
  box-shadow: none;
}

html[data-theme="dark"] .app-dock:hover {
  box-shadow: var(--dock-capsule-hover-extra);
}

.dock-item {
  flex: 0 0 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0;
  width: var(--chrome-track-h);
  height: var(--chrome-track-h);
  min-width: var(--chrome-track-h);
  border: none;
  border-radius: var(--chrome-radius-ctrl);
  background: transparent;
  cursor: pointer;
  color: var(--text-3);
  transition: var(--chrome-transition);
}

/* 未选中：悬停与太极同一紫系浅底 + 紫标（非灰底） */
.dock-item:hover:not(.active) {
  color: var(--dock-taiji-hover-icon);
  background: var(--dock-taiji-hover-fill);
}

.dock-item:hover:not(.active) .dock-fab {
  color: var(--dock-taiji-hover-icon);
}

.dock-item:active {
  transform: scale(var(--chrome-press-scale));
}

.dock-item__icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: var(--chrome-icon-in-track);
  height: var(--chrome-icon-in-track);
}

.dock-item__icon svg.lucide {
  width: var(--chrome-icon-in-track);
  height: var(--chrome-icon-in-track);
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 选中（列表 / 我的）：与太极选中同形 — 紫圆 + 白线图标 + 品牌投影 */
.dock-item.active:not(.dock-item--center) {
  color: var(--dock-taiji-active-icon);
  background: var(--dock-taiji-active-bg);
  box-shadow: var(--dock-taiji-active-shadow);
  width: var(--chrome-track-h);
  height: var(--chrome-track-h);
  min-width: var(--chrome-track-h);
  padding: 0;
  border-radius: var(--chrome-radius-ctrl);
}

.dock-item.active:not(.dock-item--center):hover {
  filter: brightness(1.06);
}

.dock-item--center {
  position: relative;
  padding: 0;
  margin-top: 0;
  color: var(--text-3);
}

.dock-item--center.active {
  color: var(--dock-taiji-active-icon);
}

.dock-fab {
  position: relative;
  width: var(--dock-fab-size);
  height: var(--dock-fab-size);
  border-radius: 50%;
  background: transparent;
  border: none;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-bottom: 0;
  box-shadow: none;
  overflow: hidden;
  color: var(--text-2);
  transition:
    background 0.25s var(--ease),
    box-shadow 0.25s ease,
    transform 0.2s var(--ease),
    color 0.2s ease,
    filter 0.2s ease;
}

.dock-fab svg.lucide {
  width: 28px;
  height: 28px;
  stroke: currentColor;
  fill: none;
  stroke-width: 1.85;
  stroke-linecap: round;
  stroke-linejoin: round;
}

/* 太极标与两侧 dock 图标同尺寸 */
.dock-fab svg.dock-fab__yin-yang {
  width: 32px;
  height: 32px;
  transform: scaleY(-1);
  transform-origin: center;
}

.dock-item--center.active .dock-fab {
  background: var(--dock-taiji-active-bg);
  color: var(--dock-taiji-active-icon);
  box-shadow: var(--dock-taiji-active-shadow);
  transform: none;
}

.dock-item--center.active:hover .dock-fab {
  filter: brightness(1.06);
}

/* —— 内页（分类 / 我的） —— */
.panel-page--sheet {
  background: var(--page-bg);
}

.panel-scroll {
  flex: 1;
  overflow: auto;
  padding: 20px 18px calc(var(--dock-clearance) + 24px);
  -webkit-overflow-scrolling: touch;
}

/* 「我的」：顶部分区胶囊固定在大滚动区外，仅下方正文滚动，正文顶缘不会卷到胶囊上方 */
#page-me .me-main-stack {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  padding: 12px 18px 0;
  box-sizing: border-box;
}

#page-me #me-main-scroll.panel-scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  padding: 0 0 calc(var(--dock-clearance) + 24px);
}

.page-head {
  margin-bottom: 18px;
}

.page-title {
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  margin: 0 0 6px;
  color: var(--text);
}

.page-sub {
  margin: 0;
  font-size: var(--text-sm);
  color: var(--text-2);
  line-height: 1.55;
  max-width: 36em;
}

.page-sub + .page-sub {
  margin-top: 8px;
}

/* 列表页：随缘主 CTA 置顶 + 类型胶囊与搜索同行；吸顶后列表单独下滚 */
.list-sticky-head {
  position: sticky;
  top: 0;
  z-index: 5;
  margin: 0 0 10px;
  padding-bottom: 2px;
  background: linear-gradient(to bottom, var(--page-bg) 78%, rgba(var(--page-bg-rgb), 0));
}

/* #page-cat：外层不滚动，仅 #cat-main-view 滚动，圣地模块始终在胶囊/搜索下方、内层再滚 */
#page-cat .panel-scroll {
  display: flex;
  flex-direction: column;
  min-height: 0;
  overflow: hidden;
  /* WebKit/Android 上避免滚动层未上色时底部透黑 */
  background: var(--page-bg);
  /* 列表可视区域延伸至屏底；底栏悬浮叠放，底部留白由内层滚动区 padding承担 */
  padding: 20px 18px 0;
}

/* 深色下列表主体与卡片同为 surface，底栏两侧/下方不再露出更暗的 page-bg 宽条 */
html[data-theme="dark"] #page-cat .panel-scroll,
html[data-theme="dark"] #page-cat #cat-main-view {
  background: var(--surface);
}

#page-cat .list-sticky-head {
  position: relative;
  flex-shrink: 0;
  background: transparent;
  box-shadow: none;
}

html[data-theme="dark"] #page-cat .list-sticky-head {
  box-shadow: none;
}

#page-cat #cat-main-view {
  flex: 1;
  min-height: 0;
  overflow: hidden;
  display: flex;
  flex-direction: column;
  background: var(--page-bg);
  /* 底部留白由道观列表 #cat-list（或圣地内层 .drawer-scroll）承担，避免整页滚动把「问道收录」胶囊卷走 */
  padding-bottom: 0;
}

/* 道观列表：大胶囊不参与滚动，仅下方列表区域滚动（滚动条从胶囊下缘起算） */
#page-cat #list-block-temples:not([hidden]) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  overflow: hidden;
}

#page-cat #list-block-temples:not([hidden]) .cat-chip-capsule {
  flex-shrink: 0;
  border: 1px solid var(--line);
  box-shadow: none;
}

#page-cat #list-block-temples:not([hidden]) #cat-list {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  padding-bottom: calc(var(--dock-clearance) + 24px);
}

/* [hidden] 默认 display:none 会被上方 #cat-main-view 的 display:flex 覆盖，随缘/礼仪文化子视图时列表须真正隐藏 */
#page-cat #cat-main-view[hidden],
#page-cat #cat-suiyuan-view[hidden],
#page-cat #cat-liyi-view[hidden],
#page-cat #list-sticky-head[hidden] {
  display: none !important;
}

#page-cat #cat-suiyuan-view,
#page-cat #cat-liyi-view {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--page-bg);
  padding-bottom: calc(var(--dock-clearance) + 24px);
}

#page-cat #list-block-shengdi:not([hidden]) {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
}

#page-cat #list-block-shengdi .list-shengdi-split {
  flex: 1;
  min-height: 0;
  max-height: none;
}

/* 圣地右栏单独滚动时，底部留白与道观列表一致（底栏悬浮） */
#page-cat .list-shengdi-panel.drawer-scroll {
  padding-bottom: calc(var(--dock-clearance) + 24px);
}

.list-sticky-head__controls {
  position: relative;
  display: flex;
  flex-direction: column;
  gap: 10px;
  background: transparent;
}

/* 列表顶：随缘 + 礼仪文化 并排；其下为「道观 / 圣地」与搜索同一行 */
.list-sticky-head__hero-row {
  display: flex;
  flex-wrap: nowrap;
  align-items: stretch;
  gap: 8px;
  margin: 0;
  min-width: 0;
}

.list-sticky-head__hero-row > .suiyuan-entry--hero {
  flex: 1;
  min-width: 0;
  margin: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

/* 固定同高、同圆角与同盒模型（2px 边框占位），阴影一致避免一侧更「厚」 */
.list-sticky-head .suiyuan-entry--hero .suiyuan-entry__btn {
  box-sizing: border-box;
  width: 100%;
  height: var(--chrome-track-h);
  min-height: var(--chrome-track-h);
  max-height: var(--chrome-track-h);
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 12px;
  border: 2px solid transparent;
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-float);
}

.list-sticky-head .suiyuan-entry--hero .suiyuan-entry__btn:hover {
  filter: brightness(1.06);
}

.list-sticky-head .suiyuan-entry--hero .suiyuan-entry__btn:active {
  transform: scale(0.992);
  filter: brightness(0.98);
}

.list-sticky-head .suiyuan-entry--hero .suiyuan-entry__label {
  width: auto;
  flex: 0 1 auto;
  text-align: center;
  font-size: clamp(15px, 4.1vw, 18px);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.2;
  color: var(--gold-on-brand);
  text-shadow: var(--gold-on-brand-text-shadow);
}

.list-sticky-head .suiyuan-entry--hero .suiyuan-entry__btn--submit-location {
  box-sizing: border-box;
  width: 100%;
  height: var(--chrome-track-h);
  min-height: var(--chrome-track-h);
  max-height: var(--chrome-track-h);
  flex: 0 0 auto;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 0;
  padding: 0 12px;
  border: 2px solid transparent;
  border-radius: var(--radius-card);
  background: linear-gradient(135deg, var(--brand) 0%, var(--brand-dark) 100%);
  color: #fff;
  box-shadow: var(--shadow-float);
  text-decoration: none;
  cursor: pointer;
}

.list-sticky-head .suiyuan-entry--hero .suiyuan-entry__btn--submit-location:hover {
  filter: brightness(1.04);
}

.list-sticky-head .suiyuan-entry--hero .suiyuan-entry__btn--submit-location:active {
  transform: scale(0.992);
  filter: brightness(0.98);
}

.list-sticky-head .suiyuan-entry--hero .suiyuan-entry__btn--submit-location .suiyuan-entry__label {
  color: var(--gold-on-brand);
  text-shadow: var(--gold-on-brand-text-shadow);
}

.list-sticky-head__tabs-search-row {
  display: grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  justify-items: stretch;
  align-items: stretch;
  gap: 8px;
  margin: 0;
  min-width: 0;
}

/* 单一大胶囊：与右侧搜索框等宽（各占 1fr），与下方宗派胶囊内边距语汇对齐 */
.list-sticky-head__tabs-search-row .list-mode-tabs {
  display: flex;
  align-items: stretch;
  gap: 0;
  width: 100%;
  min-width: 0;
  height: var(--chrome-track-h);
  box-sizing: border-box;
  margin-bottom: 0;
  padding: 3px 5px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-float);
}

.list-sticky-head__tabs-search-row .list-mode-tab {
  display: flex;
  flex: 1 1 0;
  align-items: center;
  justify-content: center;
  min-width: 0;
  min-height: 0;
  margin: 0;
  padding: 0 8px;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  font-size: clamp(11px, 3vw, 13px);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, color 0.2s ease, box-shadow 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.list-sticky-head__tabs-search-row .list-mode-tab.is-active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 6px rgba(91, 33, 182, 0.35);
}

.list-sticky-head__tabs-search-row .list-mode-tab:active:not(.is-active) {
  background: var(--page-bg);
}

.list-sticky-head__tabs-search-row .list-mode-tab:first-child {
  border-top-left-radius: var(--radius-pill);
  border-bottom-left-radius: var(--radius-pill);
}

.list-sticky-head__tabs-search-row .list-mode-tab:last-child {
  border-top-right-radius: var(--radius-pill);
  border-bottom-right-radius: var(--radius-pill);
}

.list-sticky-head__tabs-search-row .list-mode-tab:not(:first-child):not(:last-child).is-active {
  border-radius: var(--radius-md);
}

.list-sticky-head__tabs-search-row .list-search-row {
  min-width: 0;
  width: 100%;
  max-width: 100%;
  margin: 0;
  /* 勿 hidden：会按矩形裁切子级 box-shadow，圆角搜索条易出现「方框阴影」 */
  overflow: visible;
}

.list-sticky-head__tabs-search-row .list-search-inner {
  width: 100%;
  min-width: 0;
  max-width: 100%;
}

.list-sticky-head__tabs-search-row .map-search-field {
  width: 100%;
  height: var(--chrome-track-h);
  min-width: 0;
  max-width: 100%;
  box-sizing: border-box;
  padding: 0 10px 0 11px;
  gap: 6px;
}

.list-sticky-head__tabs-search-row .map-search-field svg.lucide {
  width: 16px;
  height: 16px;
}

.list-sticky-head__tabs-search-row .map-search-field input {
  font-size: clamp(11px, 3.1vw, 13px);
}

.list-sticky-head__tabs-search-row .map-search-clear {
  width: 26px;
  height: 26px;
  margin-right: 2px;
}

.list-sticky-head__tabs-search-row .map-search-clear svg.lucide {
  width: 16px;
  height: 16px;
}

/* 我的：第二段副文案略弱，作定位与权限补充说明 */
.page-head--sub-muted .page-sub + .page-sub {
  color: var(--text-3);
  font-size: var(--text-xs);
  line-height: 1.5;
}

/* —— 我的：顶部分区导航胶囊 —— */
.me-section-tabs-wrap {
  position: relative;
  flex-shrink: 0;
  z-index: 3;
  /* 勿设全宽渐变/实底，否则像整块深色矩形；正文紧跟胶囊下缘 */
  /* 与 .list-sticky-head 下缘节奏一致（10px） */
  margin: 0 0 10px;
  padding-bottom: 0;
  background: transparent;
}

/* 与列表页 .cat-chip-capsule 同高、同内距与盒模型，视觉与「问道收录」分段一致 */
.me-section-tabs {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  box-sizing: border-box;
  min-height: var(--chrome-track-h);
  /* 与深色一致：避免格缝露出轨底形成竖条 */
  gap: 0;
  padding: 3px 5px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-float);
  /* 裁剪子项圆角与选中态阴影，避免 WebKit/Android 在胶囊两端叠层发灰 */
  overflow: hidden;
}

.me-section-tab {
  min-height: 0;
  align-self: stretch;
  min-width: 0;
  margin: 0;
  padding: 8px 6px;
  border: none;
  border-radius: 0;
  background: transparent;
  font-size: clamp(10px, 2.9vw, 12px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  color: var(--text-2);
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
}

.me-section-tab.is-active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 6px rgba(91, 33, 182, 0.35);
}

.me-section-tab:active:not(.is-active) {
  background: var(--page-bg);
}

.me-section-tab:first-child {
  border-top-left-radius: var(--radius-pill);
  border-bottom-left-radius: var(--radius-pill);
}

.me-section-tab:last-child {
  border-top-right-radius: var(--radius-pill);
  border-bottom-right-radius: var(--radius-pill);
}

/* 中间格选中：四角微圆，避免无 gap 时呈刀切矩形 */
.me-section-tab:not(:first-child):not(:last-child).is-active {
  border-radius: var(--radius-md);
}

.me-section-panels {
  min-height: 0;
}

.me-section-panel[hidden] {
  display: none !important;
}

.me-saved-inline__intro {
  margin: 0 0 12px;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-2);
}

.list-mode-tabs {
  display: flex;
  gap: 10px;
  margin-bottom: 16px;
}

.list-mode-tab {
  flex: 1;
  min-height: var(--chrome-track-h);
  padding: 0 14px;
  border-radius: var(--radius-pill);
  border: 1px solid var(--line-strong);
  background: var(--surface);
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-2);
  cursor: pointer;
  box-shadow: var(--shadow-rest);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.list-mode-tab.is-active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

.list-block {
  min-height: 0;
}

.list-shengdi-split {
  display: flex;
  min-height: min(52vh, 440px);
  max-height: min(62vh, 520px);
  border-radius: var(--radius-card);
  overflow: hidden;
  /* 左右栏共用内边距；竖线两侧与面板/导航内容间距一致 */
  --sd-pad-block: 12px;
  --sd-pad-inline: 12px;
}

.drawer-nav.list-shengdi-nav {
  width: clamp(104px, 27vw, 118px);
  min-width: clamp(104px, 27vw, 118px);
  flex-shrink: 0;
  padding: var(--sd-pad-block) var(--sd-pad-inline) var(--sd-pad-block);
  /* 兜底：个别 WebView 下长标签仍可能画出栏宽 */
  overflow-x: hidden;
  box-sizing: border-box;
  /* 覆盖 .drawer-nav 的 page-bg：深色模式下 page-bg 接近纯黑，与右侧面板反差过大 */
  background: var(--surface);
}

.list-shengdi-nav .drawer-nav-item.is-active {
  background: var(--brand-soft);
  /* 与右侧 .sd-item 顶对齐：去掉全局 .drawer-nav-item.is-active 的浮起阴影 */
  box-shadow: none;
  outline: none;
}

.list-shengdi-nav .drawer-nav-item {
  /* 默认 center 会让文案 span 按 max-content 宽度排版，窄栏里长标签会横向溢出 */
  align-items: stretch;
  gap: 5px;
  padding: 9px 5px;
  min-height: 0;
  min-width: 0;
  width: 100%;
  box-sizing: border-box;
}

.list-shengdi-nav .drawer-nav-item .sd-logo {
  align-self: center;
  width: 26px;
  height: 26px;
}

.list-shengdi-nav .drawer-nav-item .sd-logo--10::after,
.list-shengdi-nav .drawer-nav-item .sd-logo--36::after,
.list-shengdi-nav .drawer-nav-item .sd-logo--72::after,
.list-shengdi-nav .drawer-nav-item .sd-logo--hall::after {
  font-size: 12px;
}

.list-shengdi-nav .drawer-nav-item .sd-logo--star svg.lucide {
  width: 15px;
  height: 15px;
}

.list-shengdi-nav .drawer-nav-item__text {
  align-self: stretch;
  white-space: normal;
  word-break: break-word;
  overflow-wrap: anywhere;
  line-height: 1.28;
  max-width: 100%;
  width: 100%;
  min-width: 0;
  font-size: clamp(9px, 2.7vw, 11px);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
}

.list-shengdi-panel.drawer-scroll {
  flex: 1;
  min-width: 0;
  min-height: 0;
  max-height: none;
  padding: var(--sd-pad-block) var(--sd-pad-inline) 16px;
  background: var(--surface);
}

.chip-row {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 18px;
}

.chip-row--wrap {
  flex-wrap: wrap;
}

/* 道观列表：宗派筛选 — 外壳与「我的」.me-section-tabs 一致；格内样式对齐 .me-section-tab */
.cat-chip-capsule {
  display: flex;
  flex-direction: row;
  align-items: stretch;
  gap: 0;
  box-sizing: border-box;
  min-height: var(--chrome-track-h);
  padding: 3px 5px;
  margin-bottom: 14px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-float);
  overflow: hidden;
}

.cat-chip-capsule__btn {
  flex: 1 1 0;
  min-height: 0;
  align-self: stretch;
  min-width: 0;
  margin: 0;
  padding: 8px 6px;
  border: none;
  border-radius: 0;
  background: transparent;
  color: var(--text-2);
  font-size: clamp(10px, 2.9vw, 12px);
  font-weight: 800;
  line-height: 1.2;
  letter-spacing: -0.02em;
  cursor: pointer;
  font-family: inherit;
  transition: background 0.2s ease, color 0.2s ease;
  -webkit-tap-highlight-color: transparent;
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  gap: 6px;
}

.cat-chip-capsule__label {
  display: block;
  text-align: center;
}

.cat-chip-capsule__count {
  display: block;
  font-size: clamp(9px, 2.4vw, 11px);
  font-weight: 800;
  letter-spacing: -0.02em;
  opacity: 0.78;
  font-variant-numeric: tabular-nums;
}

.cat-chip-capsule__btn.active {
  background: var(--brand);
  color: #fff;
  box-shadow: 0 1px 6px rgba(91, 33, 182, 0.35);
}

.cat-chip-capsule__btn:active:not(.active) {
  background: var(--page-bg);
}

.cat-chip-capsule__btn:first-child {
  border-top-left-radius: var(--radius-pill);
  border-bottom-left-radius: var(--radius-pill);
}

.cat-chip-capsule__btn:last-child {
  border-top-right-radius: var(--radius-pill);
  border-bottom-right-radius: var(--radius-pill);
}

.cat-chip-capsule__btn:not(:first-child):not(:last-child).active {
  border-radius: var(--radius-md);
}

.cat-chip-capsule__btn.active .cat-chip-capsule__count {
  color: rgba(255, 255, 255, 0.92);
  opacity: 1;
}

.chip {
  padding: 8px 16px;
  min-height: 38px;
  border-radius: var(--radius-pill);
  background: var(--surface);
  color: var(--text-2);
  font-size: var(--text-sm);
  font-weight: 600;
  border: 1px solid var(--line-strong);
  cursor: pointer;
  box-shadow: var(--shadow-rest);
  transition: background 0.2s ease, border-color 0.2s ease, color 0.2s ease;
}

.chip.active {
  background: var(--brand);
  border-color: var(--brand);
  color: #fff;
}

#cat-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.list-locate-hint {
  margin: 0 0 4px;
  padding: 10px 12px;
  border-radius: var(--radius-md);
  background: var(--brand-soft);
  border: 1px solid rgba(91, 33, 182, 0.2);
  font-size: var(--text-xs);
  font-weight: 600;
  line-height: 1.45;
  color: var(--text-2);
}

.temple-row {
  padding: 16px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--line);
  cursor: pointer;
  box-shadow: var(--shadow-rest);
  transition: box-shadow 0.2s ease, transform 0.12s ease;
}

.temple-row:active {
  transform: scale(0.99);
  box-shadow: var(--shadow-float);
}

.temple-row h4 {
  margin: 0 0 6px;
  font-size: var(--text-base);
  font-weight: 700;
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 10px;
}

.temple-row__h4-main {
  display: flex;
  align-items: center;
  gap: 8px;
  min-width: 0;
  flex: 1;
}

.temple-row__checkin {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 2px 6px;
  min-height: 22px;
  border-radius: var(--radius-xs);
  font-size: 10px;
  font-weight: 800;
  white-space: nowrap;
  line-height: 1.2;
  color: #92400e;
  background: linear-gradient(145deg, #fde68a, #f59e0b);
  border: 1px solid rgba(180, 83, 9, 0.35);
  box-shadow: var(--shadow-rest);
}

.temple-row__dist {
  flex-shrink: 0;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--brand);
}

.temple-row__dist--muted {
  color: var(--text-3);
  font-weight: 600;
}

.temple-row p {
  margin: 0;
  font-size: var(--text-xs);
  color: var(--text-3);
  line-height: 1.45;
}

.profile-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 28px 22px;
  text-align: center;
  border: 1px solid var(--line);
  box-shadow: var(--shadow-rest);
}

.profile-card__title {
  margin: 0 0 16px;
}

.profile-card .avatar {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  margin: 0 auto 14px;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 28px;
  font-weight: 800;
  color: var(--brand-dark);
  background: var(--brand-soft);
  border: 3px solid #fff;
  box-shadow: var(--shadow-float);
}

.profile-name {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 700;
}

.profile-meta {
  margin: 10px 0 0;
  font-size: var(--text-sm);
  color: var(--text-3);
  line-height: 1.5;
}

.profile-identity {
  width: 100%;
  max-width: 280px;
  margin: 14px auto 0;
}

.profile-identity__label {
  display: block;
  text-align: left;
  margin-bottom: 6px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-2);
}

.profile-identity__value {
  margin: 0;
  padding: 10px 12px;
  font-family: ui-monospace, SFMono-Regular, "SF Mono", Menlo, Consolas, monospace;
  font-size: 0.82rem;
  line-height: 1.45;
  word-break: break-all;
  color: var(--text-2);
  text-align: left;
  background: var(--surface-2, #f8fafc);
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  box-sizing: border-box;
  cursor: default;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: none;
}

.profile-identity__value:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.profile-identity__value::selection {
  background: transparent;
}

html[data-theme="dark"] .profile-identity__value {
  background: rgba(255, 255, 255, 0.06);
  border-color: var(--line-strong);
}

.profile-avatar-block {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  margin-bottom: 16px;
}

.profile-avatar-hit {
  display: block;
  padding: 0;
  border: none;
  background: none;
  cursor: pointer;
  border-radius: 50%;
  -webkit-tap-highlight-color: transparent;
}

.profile-avatar-hit:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 3px;
}

.profile-avatar-img {
  width: 72px;
  height: 72px;
  border-radius: 50%;
  object-fit: cover;
  display: block;
  border: 3px solid #fff;
  box-shadow: var(--shadow-float);
}

/* .profile-card .avatar 的 display:flex 会盖过 [hidden] 的 display:none，导致图片与字叠显 */
.profile-avatar-hit .profile-avatar-img[hidden],
.profile-avatar-hit .profile-avatar-fallback[hidden] {
  display: none !important;
}

.profile-avatar-fallback {
  margin: 0;
}

.profile-avatar-clear {
  padding: 4px 10px;
  font-size: var(--text-xs);
  color: var(--text-3);
  background: transparent;
  border: none;
  border-radius: var(--radius-pill);
  cursor: pointer;
  text-decoration: underline;
  font-family: inherit;
}

.profile-avatar-clear:hover {
  color: var(--brand-dark);
}

.profile-name-label {
  display: block;
  text-align: left;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 6px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-2);
}

.profile-name-input {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto 10px;
  padding: 10px 12px;
  font-size: var(--text-base);
  text-align: center;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface-2, #f8fafc);
  font-family: inherit;
  box-sizing: border-box;
}

.profile-name-save {
  width: 100%;
  max-width: 280px;
  margin: 0 auto 0;
  min-height: 42px;
}

.me-data-transfer-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 20px 18px;
  margin-top: var(--panel-stack-gap);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-rest);
}

/* 同步账号：与 iOS 设置卡片同语汇的标签 + 主行（无渐变，与卡片底一致） */
.me-auth-status-block {
  margin: 0;
  padding: 14px 16px 12px;
  border-bottom: 1px solid var(--line);
  background: transparent;
}

.me-auth-status-block__inner {
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.me-auth-status-block__label {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 0.08em;
  text-transform: uppercase;
  color: var(--text-3);
  line-height: 1.2;
}

.me-auth-status-block__row {
  display: flex;
  align-items: center;
  gap: 10px;
  min-height: 28px;
}

.me-auth-status-block__pulse {
  display: none;
  flex-shrink: 0;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  box-shadow: 0 0 0 3px rgba(91, 33, 182, 0.22);
}

html[data-theme="dark"] .me-auth-status-block__pulse {
  background: #a78bfa;
  box-shadow: 0 0 0 3px rgba(167, 139, 250, 0.25);
}

.me-auth-status-block--logged-in .me-auth-status-block__pulse {
  display: block;
}

.me-auth-status-block__value {
  margin: 0;
  flex: 1;
  min-width: 0;
  font-size: var(--text-base);
  font-weight: 500;
  line-height: 1.45;
  color: var(--text-2);
  letter-spacing: -0.01em;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.me-auth-status-block--logged-in .me-auth-status-block__value {
  font-size: var(--text-lg);
  font-weight: 700;
  color: var(--brand);
  letter-spacing: -0.02em;
}

html[data-theme="dark"] .me-auth-status-block--logged-in .me-auth-status-block__value {
  color: var(--brand-accent-text);
  text-shadow: 0 1px 0 rgba(0, 0, 0, 0.2);
}

html[data-theme="dark"] #page-me .me-settings-ios .me-auth-status-block__label {
  color: var(--text-3);
}

.me-data-transfer__intro {
  margin: 0 0 14px;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-2);
}

.me-data-transfer__label {
  display: block;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
  margin-bottom: 8px;
}

.me-data-transfer__textarea {
  width: 100%;
  box-sizing: border-box;
  min-height: 96px;
  padding: 12px 14px;
  font-size: 12px;
  line-height: 1.45;
  font-family: ui-monospace, "Cascadia Code", "Segoe UI Mono", monospace;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-md);
  background: var(--surface-2, #f8fafc);
  color: var(--text);
  resize: vertical;
}

.me-data-transfer__actions {
  display: flex;
  flex-wrap: wrap;
  gap: 10px;
  margin-top: 12px;
}

.me-data-transfer__actions .btn-primary,
.me-data-transfer__actions .btn-secondary {
  flex: 1;
  min-width: 120px;
  min-height: 44px;
}

.me-data-transfer__danger-zone {
  margin-top: 16px;
  padding-top: 14px;
  border-top: 1px solid var(--line);
}

.me-data-transfer__danger-warn {
  margin: 0 0 10px;
  font-size: var(--text-xs);
  line-height: 1.55;
  color: #b91c1c;
}

.me-data-transfer__danger-zone .btn-danger {
  width: 100%;
  min-height: 44px;
}

.me-data-transfer__note {
  margin: 12px 0 0;
  font-size: var(--text-xs);
  color: var(--text-3);
  line-height: 1.5;
}

/* —— 抽屉（宽屏占比大） —— */
.drawer-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 25, 0.35);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
  opacity: 0;
  visibility: hidden;
  transition: opacity var(--dur) ease, visibility var(--dur) ease;
  z-index: 100;
}

.drawer-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.drawer {
  position: fixed;
  top: 0;
  right: 0;
  width: min(92vw, 400px);
  height: 100%;
  background: rgba(255, 255, 255, 0.98);
  backdrop-filter: blur(16px);
  -webkit-backdrop-filter: blur(16px);
  border-left: 1px solid var(--line);
  box-shadow: -12px 0 40px rgba(0, 0, 0, 0.1);
  transform: translateX(100%);
  transition: transform var(--dur) var(--ease);
  z-index: 101;
  display: flex;
  flex-direction: column;
  padding-top: calc(var(--safe-top) + 8px);
}

.drawer.open {
  transform: translateX(0);
}

.drawer-header {
  padding: 8px 18px 14px;
  border-bottom: 1px solid var(--line);
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
}

.drawer-header h2 {
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 800;
}

.drawer-close {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--page-bg);
  color: var(--text-2);
  font-size: 22px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
}

.drawer--split {
  width: min(96vw, 520px);
}

.drawer-split {
  flex: 1;
  display: flex;
  min-height: 0;
  border-top: 1px solid var(--line);
}

.drawer-nav {
  flex-shrink: 0;
  width: 88px;
  padding: 10px 8px;
  border-right: 1px solid var(--line);
  background: var(--page-bg);
  display: flex;
  flex-direction: column;
  gap: 8px;
  overflow-y: auto;
  -webkit-overflow-scrolling: touch;
}

.drawer-nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 6px;
  padding: 10px 6px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  cursor: pointer;
  color: var(--text-2);
  transition:
    background 0.2s ease,
    color 0.2s ease,
    box-shadow 0.2s ease;
}

.drawer-nav-item:hover {
  background: rgba(255, 255, 255, 0.85);
}

.drawer-nav-item.is-active {
  background: var(--surface);
  color: var(--brand-dark);
  box-shadow: var(--shadow-float);
  outline: 1px solid rgba(91, 33, 182, 0.2);
}

html[data-theme="dark"] .drawer-nav-item.is-active {
  color: var(--brand-text-on-dark);
  outline: 1px solid rgba(196, 181, 253, 0.35);
}

.drawer-nav-item__text {
  font-size: 10px;
  font-weight: 800;
  letter-spacing: 0.02em;
  line-height: 1.2;
  text-align: center;
}

.drawer-panel-wrap {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
}

.drawer-panel.drawer-scroll {
  padding: 12px 14px;
}

.drawer-subhead {
  font-size: var(--text-xs);
  font-weight: 800;
  color: var(--text-3);
  margin: 16px 0 8px;
  padding-left: 4px;
  border-left: 3px solid var(--brand);
}

.drawer-subhead:first-child {
  margin-top: 0;
}

.drawer-empty {
  margin: 24px 0;
  text-align: center;
  color: var(--text-3);
  font-size: var(--text-sm);
}

/* 圣地类目 Logo（抽屉 + 地图标点） */
.sd-logo {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius-sm);
  flex-shrink: 0;
  box-shadow: var(--shadow-rest);
  border: 2px solid rgba(255, 255, 255, 0.9);
}

.sd-logo--10 {
  background: linear-gradient(145deg, #fde68a, #f59e0b 45%, #b45309);
}
.sd-logo--36 {
  background: linear-gradient(145deg, #f8fafc, #cbd5e1 40%, #64748b);
}
.sd-logo--72 {
  background: linear-gradient(145deg, #22c55e, #15803d);
}
.sd-logo--star {
  background: linear-gradient(145deg, #a855f7, #7c3aed);
}
.sd-logo--hall {
  background: linear-gradient(145deg, #7fe8e0, #0abab5 52%, #06908c);
}

.sd-logo--10::after {
  content: "洞";
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  font-family: var(--font);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.35);
}
.sd-logo--36::after {
  content: "洞";
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  font-family: var(--font);
  text-shadow: 0 1px 2px rgba(15, 23, 42, 0.45);
}
.sd-logo--72::after {
  content: "福";
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  font-family: var(--font);
  text-shadow: 0 1px 2px rgba(0, 0, 0, 0.25);
}
.sd-logo--hall::after {
  content: "祖";
  font-size: 13px;
  font-weight: 800;
  color: #fff;
  line-height: 1;
  font-family: var(--font);
  text-shadow: 0 1px 2px rgba(15, 60, 58, 0.45);
}

.sd-logo--star svg.lucide {
  width: 16px;
  height: 16px;
  stroke: #fff;
  fill: none;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  flex-shrink: 0;
  filter: drop-shadow(0 1px 1px rgba(0, 0, 0, 0.2));
}

.sd-map-marker {
  display: flex;
  flex-direction: column;
  align-items: center;
  pointer-events: none;
}
.sd-map-marker__icon {
  pointer-events: auto;
  cursor: pointer;
  width: calc(26px * var(--mz, 1) * var(--mp, 1));
  height: calc(26px * var(--mz, 1) * var(--mp, 1));
  border-radius: var(--radius-sm);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  border-width: calc(2px * var(--mz, 1) * var(--mp, 1));
}

.sd-map-marker .sd-logo--10::after,
.sd-map-marker .sd-logo--36::after,
.sd-map-marker .sd-logo--72::after,
.sd-map-marker .sd-logo--hall::after {
  font-size: calc(13px * var(--mz, 1) * var(--mp, 1));
}

.sd-map-marker__icon.sd-logo--star svg.lucide {
  width: calc(15px * var(--mz, 1) * var(--mp, 1));
  height: calc(15px * var(--mz, 1) * var(--mp, 1));
  stroke-width: 2.25;
}
.sd-map-marker__tip {
  pointer-events: none;
  margin-top: calc(2px * var(--mz, 1) * var(--mp, 1));
  max-width: calc(120px * var(--mz, 1) * var(--mp, 1));
  padding: calc(2px * var(--mz, 1) * var(--mp, 1)) calc(6px * var(--mz, 1) * var(--mp, 1));
  border-radius: var(--radius-xs);
  background: var(--map-marker-label-bg);
  font-size: calc(9px * var(--mz, 1) * var(--mp, 1));
  font-weight: 700;
  color: var(--text);
  text-align: center;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-float);
}

.user-loc-marker {
  position: relative;
  width: 48px;
  height: 52px;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
}

.user-loc-marker__pin {
  position: relative;
  z-index: 2;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  background: linear-gradient(160deg, #c084fc 0%, #9333ea 42%, #6d28d9 100%);
  border: 2.5px solid rgba(255, 255, 255, 0.95);
  color: #fff;
  font-size: 0;
  line-height: 0;
  box-shadow:
    0 0 12px rgba(192, 132, 252, 0.9),
    0 0 28px rgba(147, 51, 234, 0.55),
    0 2px 10px rgba(0, 0, 0, 0.2);
  animation: user-loc-glow 2.4s ease-in-out infinite;
}

.user-loc-marker__pin svg.lucide {
  stroke: #fff;
  fill: none;
  stroke-width: 2.25;
  stroke-linecap: round;
  stroke-linejoin: round;
  filter: drop-shadow(0 1px 1px rgba(88, 28, 135, 0.45));
}

.user-loc-marker__ring {
  position: absolute;
  left: 50%;
  bottom: -5px;
  width: 44px;
  height: 44px;
  margin-left: -22px;
  border-radius: 50%;
  border: 2.5px solid rgba(192, 132, 252, 0.55);
  box-shadow: 0 0 16px rgba(168, 85, 247, 0.45), 0 0 28px rgba(147, 51, 234, 0.25);
  animation: user-loc-pulse 2s ease-out infinite;
  transform-origin: center center;
  z-index: 1;
}

@keyframes user-loc-pulse {
  0% {
    transform: scale(0.55);
    opacity: 0.95;
  }
  100% {
    transform: scale(1.38);
    opacity: 0;
  }
}

@keyframes user-loc-glow {
  0%,
  100% {
    box-shadow:
      0 0 12px rgba(192, 132, 252, 0.9),
      0 0 28px rgba(147, 51, 234, 0.55),
      0 2px 10px rgba(0, 0, 0, 0.2);
  }
  50% {
    box-shadow:
      0 0 20px rgba(216, 180, 254, 0.95),
      0 0 40px rgba(168, 85, 247, 0.65),
      0 2px 10px rgba(0, 0, 0, 0.2);
  }
}

.terms-card {
  margin-top: var(--panel-stack-gap);
  padding: 20px 18px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-rest);
}

.terms-card__title {
  margin: 0 0 12px;
  font-size: var(--text-base);
  font-weight: 800;
  color: var(--text);
}

.terms-card__body {
  font-size: var(--text-sm);
  color: var(--text-2);
  line-height: 1.55;
}

.terms-card__body p {
  margin: 0 0 12px;
}

.terms-card__body p:last-of-type {
  margin-bottom: 0;
}

.terms-card__subhead {
  margin: 18px 0 10px;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--text);
}

.terms-card__subhead:first-child {
  margin-top: 0;
}

.terms-card__links {
  margin: 14px 0 0;
  padding-left: 1.25em;
  color: var(--text-2);
}

.terms-card__links li {
  margin: 0 0 8px;
}

.terms-card__links li:last-child {
  margin-bottom: 0;
}

.terms-card__links a {
  color: var(--brand);
  font-weight: 600;
  text-decoration: none;
}

.terms-card__links a:hover {
  text-decoration: underline;
}

.terms-card--about-site .terms-card__body {
  container-type: inline-size;
}

.terms-card__body p.about-site-mission-emphasis {
  margin: 0 0 0;
  padding: 12px 0 16px;
  border: none;
  background: transparent;
  border-radius: 0;
  /* 两行固定：每行各自不换行，字号随容器变窄缩小（以较长行为准） */
  font-size: min(1.42rem, max(0.55rem, 4.5vw));
  font-weight: 800;
  line-height: 1.45;
  color: #a67c00;
  letter-spacing: 0.02em;
  text-align: center;
  max-width: 100%;
}

.terms-card__body p.about-site-mission-emphasis .about-site-mission-emphasis__line {
  display: block;
  white-space: nowrap;
}

@supports (font-size: 1cqi) {
  .terms-card__body p.about-site-mission-emphasis {
    font-size: min(1.42rem, max(0.55rem, 4.8cqi));
  }
}

html[data-theme="dark"] .terms-card__body p.about-site-mission-emphasis {
  color: #e8c547;
}

.about-site-mission-emphasis + .about-site-founded {
  margin-top: 4px;
}

.about-site-founded {
  margin: 0;
  padding: 0 0 2px;
  text-align: center;
  font-size: var(--text-sm);
  color: var(--text-2);
  line-height: 1.55;
}

.about-site-founded__line {
  display: block;
}

.about-site-founded__days-num {
  display: inline;
  margin: 0 0.06em;
  font-size: inherit;
  font-weight: inherit;
  line-height: inherit;
  vertical-align: baseline;
  color: #a67c00;
  letter-spacing: inherit;
}

html[data-theme="dark"] .about-site-founded__days-num {
  color: #e8c547;
  text-shadow: 0 0 20px rgba(232, 197, 71, 0.22);
}

.about-site-founded + .terms-card__subhead {
  margin-top: 14px;
}

.about-features-list {
  margin: 0;
  padding-left: 1.25em;
}

.about-features-list li {
  margin: 0 0 10px;
}

.about-features-list li:last-child {
  margin-bottom: 0;
}

.about-wechat-id {
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.02em;
}

.about-build-meta {
  margin-top: 20px;
  padding: 14px 16px;
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--line);
  background: color-mix(in srgb, var(--surface) 92%, var(--text) 8%);
  font-size: 0.8125rem;
  line-height: 1.5;
  color: var(--text-muted, color-mix(in srgb, var(--text) 72%, transparent));
}

.about-build-meta__line {
  margin: 0;
}

.about-build-meta__line.about-build-meta__deploy-time {
  margin-top: 8px;
  font-size: 0.94em;
}

.about-build-meta strong {
  color: var(--text);
  font-weight: 700;
}

.about-build-meta__sha {
  font-family: ui-monospace, monospace;
  font-size: 0.92em;
  font-weight: 600;
  color: var(--text);
}

.drawer-scroll {
  flex: 1;
  overflow: auto;
  padding: 14px 16px;
  -webkit-overflow-scrolling: touch;
  min-height: 0;
}

.drawer-footer {
  flex-shrink: 0;
  padding: 12px 16px calc(14px + var(--safe-bottom));
  border-top: 1px solid var(--line);
  background: var(--surface);
}

.btn-drawer-primary {
  width: 100%;
  height: 52px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  font-size: var(--text-base);
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 4px 16px rgba(91, 33, 182, 0.35);
  transition: filter 0.15s ease, transform 0.12s ease;
}

.btn-drawer-primary:active {
  filter: brightness(0.95);
  transform: scale(0.99);
}

.drawer-section-title {
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-3);
  letter-spacing: 0.14em;
  text-transform: uppercase;
  margin: 18px 0 10px;
  padding-left: 4px;
  border-left: 3px solid var(--brand);
}

.drawer-section-title:first-child {
  margin-top: 0;
}

.sd-item {
  width: 100%;
  text-align: left;
  padding: 14px;
  margin-bottom: 10px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--surface);
  color: var(--text);
  cursor: pointer;
  box-shadow: var(--shadow-rest);
  transition: border-color 0.2s ease, transform 0.12s ease;
}

.sd-item:last-child {
  margin-bottom: 0;
}

.sd-item:active {
  transform: scale(0.99);
  border-color: var(--brand);
  box-shadow: var(--shadow-float);
}

.sd-item .name {
  font-weight: 700;
  font-size: var(--text-sm);
  margin-bottom: 4px;
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  gap: 8px;
  line-height: 1.35;
}

.sd-item .name > span:first-child {
  flex: 1 1 auto;
  min-width: 0;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sd-item .alias {
  font-size: var(--text-xs);
  color: var(--brand-dark);
  font-weight: 600;
  overflow-wrap: anywhere;
  word-break: break-word;
}

html[data-theme="dark"] .sd-item .alias {
  color: var(--brand-text-on-dark-muted);
}

.sd-item .addr {
  font-size: var(--text-xs);
  color: var(--text-3);
  margin-top: 6px;
  line-height: 1.45;
  overflow-wrap: anywhere;
  word-break: break-word;
}

.sd-prov-badge,
.badge-fj {
  flex-shrink: 0;
  font-size: 10px;
  font-weight: 800;
  padding: 3px 8px;
  border-radius: var(--radius-sm);
  background: var(--brand);
  color: #fff;
  letter-spacing: 0.06em;
}

@media (max-width: 400px) {
  .list-shengdi-split {
    --sd-pad-block: 10px;
    --sd-pad-inline: 10px;
  }

  .drawer-nav.list-shengdi-nav {
    width: 102px;
    min-width: 102px;
  }

  .list-shengdi-nav .drawer-nav-item {
    gap: 4px;
    padding: 8px 4px;
  }

  .list-shengdi-nav .drawer-nav-item__text {
    font-size: 10px;
    line-height: 1.22;
  }

  .list-shengdi-panel.drawer-scroll {
    padding-bottom: 14px;
  }
}

/* —— 底部 Sheet —— */
.sheet-backdrop {
  position: fixed;
  inset: 0;
  background: rgba(15, 18, 25, 0.4);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, visibility 0.28s ease;
  z-index: 110;
}

.sheet-backdrop.open {
  opacity: 1;
  visibility: visible;
}

.sheet {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  max-height: 80vh;
  background: var(--surface);
  border-radius: var(--radius-sheet-top) var(--radius-sheet-top) 0 0;
  transform: translateY(105%);
  transition: transform var(--dur) var(--ease);
  z-index: 111;
  display: flex;
  flex-direction: column;
  padding-bottom: calc(var(--safe-bottom) + 12px);
  border: 1px solid var(--line);
  border-bottom: none;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.12);
}

.sheet.open {
  transform: translateY(0);
}

/* 道观详情：默认约半屏，可拖动手柄拉高至近全屏 */
#sheet[data-temple-detail-id] {
  max-height: 100vh;
  height: 50vh;
}

#sheet[data-temple-detail-id].sheet--dragging {
  transition: none;
}

#sheet[data-temple-detail-id] .sheet-handle {
  cursor: ns-resize;
  touch-action: none;
}

.sheet-wrap {
  position: relative;
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
}

/* 视觉为中间横条，整块为可拖区域（约 44px 高），避免手机端难以命中 5px 细条 */
.sheet-handle {
  position: relative;
  width: 100%;
  height: 44px;
  min-height: 44px;
  margin: 2px auto 0;
  flex-shrink: 0;
  box-sizing: border-box;
  background: transparent;
  border-radius: 0;
  -webkit-user-select: none;
  user-select: none;
  -webkit-touch-callout: none;
}

.sheet-handle::before {
  content: "";
  position: absolute;
  left: 50%;
  top: 50%;
  transform: translate(-50%, -50%);
  width: 40px;
  height: 5px;
  border-radius: var(--radius-handle);
  background: var(--sheet-handle-bg);
  pointer-events: none;
}

.sheet-close {
  position: absolute;
  top: 8px;
  right: 14px;
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--page-bg);
  color: var(--text-2);
  font-size: 0;
  line-height: 0;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  border: 1px solid var(--line);
  z-index: 2;
}

.sheet-close svg.lucide {
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.sheet-body {
  overflow: auto;
  padding: 0 20px 16px;
  -webkit-overflow-scrolling: touch;
  flex: 1;
  min-height: 0;
}

/* 道观详情：正文默认字阶与行距（子模块可覆盖） */
#sheet[data-temple-detail-id] .sheet-body {
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--text);
}

/* 底部抽屉内：主/次/危险按钮统一触控高度与字阶（道观详情、自定义点草稿等共用） */
.sheet-body .btn-primary,
.sheet-body .btn-secondary,
.sheet-body .btn-danger {
  min-height: 48px;
  padding: 12px 18px;
  font-size: var(--text-base);
  font-weight: 700;
  font-family: inherit;
  letter-spacing: 0.01em;
  line-height: 1.25;
  box-sizing: border-box;
}

.sheet-body .btn-primary:not(:disabled),
.sheet-body .btn-secondary,
.sheet-body .btn-danger {
  cursor: pointer;
}

.sheet-body .btn-primary:disabled {
  opacity: 0.45;
  cursor: not-allowed;
  box-shadow: none;
  filter: grayscale(0.1);
}

.sheet-body .btn-primary:focus-visible,
.sheet-body .btn-secondary:focus-visible,
.sheet-body .btn-danger:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.sheet-title {
  margin: 0 0 12px;
  padding-right: 48px;
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: var(--leading-tight);
}

.sheet-title-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  margin: 0 0 12px;
  padding-right: 48px;
}

.sheet-title-row .sheet-title {
  flex: 1;
  min-width: 0;
  margin-bottom: 0;
  padding-right: 0;
}

.sheet-title-row--dist {
  align-items: center;
}

.sheet-title__dist-pill {
  flex-shrink: 0;
  max-width: 42%;
  padding: 5px 12px;
  border-radius: var(--radius-pill);
  font-size: var(--text-xs);
  font-weight: 800;
  letter-spacing: 0.03em;
  line-height: var(--leading-snug);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 2px 10px rgba(91, 33, 182, 0.25);
}

.sheet-title__dist-pill--muted {
  background: color-mix(in srgb, var(--brand) 16%, var(--surface));
  color: var(--brand-dark);
  border: 1px solid color-mix(in srgb, var(--brand) 28%, transparent);
  box-shadow: none;
  font-weight: 700;
}

html[data-theme="dark"] .sheet-title__dist-pill--muted {
  background: color-mix(in srgb, var(--brand) 22%, transparent);
  color: #e9d5ff;
  border-color: color-mix(in srgb, var(--brand) 45%, transparent);
}

/* 合并标点：多选列表（底部抽屉） */
.cluster-pick-intro {
  margin: 0 0 14px;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-2);
}

.cluster-pick-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--page-bg);
  overflow: hidden;
}

.cluster-pick-item {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  width: 100%;
  margin: 0;
  padding: 14px 16px;
  border: none;
  border-bottom: 1px solid var(--line);
  border-radius: 0;
  background: var(--surface);
  text-align: left;
  font: inherit;
  cursor: pointer;
  color: var(--text);
  transition: background 0.15s ease;
  -webkit-tap-highlight-color: transparent;
}

.cluster-pick-item:first-child {
  border-top-left-radius: var(--radius-md);
  border-top-right-radius: var(--radius-md);
}

.cluster-pick-item:last-child {
  border-bottom: none;
  border-bottom-left-radius: var(--radius-md);
  border-bottom-right-radius: var(--radius-md);
}

.cluster-pick-item:only-child {
  border-radius: var(--radius-md);
}

.cluster-pick-item:active {
  background: var(--brand-soft);
}

.cluster-pick-item__name {
  font-size: var(--text-base);
  font-weight: 700;
  line-height: 1.35;
}

.cluster-pick-item__sub {
  font-size: var(--text-sm);
  color: var(--text-3);
  line-height: 1.45;
}

/* 与 btn-secondary 组合：收藏态高亮 */
.btn-secondary.btn-sheet-fav.is-on {
  background: var(--brand-soft);
  border-color: rgba(91, 33, 182, 0.45);
  color: var(--brand-dark);
}

/* 道观详情：打卡 / 收藏 / 导航（图标 + 小字，横排） */
.sheet-toolbar {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  align-items: stretch;
  margin-top: 0;
  padding-top: 12px;
  border-top: none;
}

.sheet-toolbtn {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  min-height: 56px;
  padding: 8px 6px 10px;
  margin: 0;
  border-radius: var(--radius-md);
  font: inherit;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: var(--leading-ui);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
  transition: background 0.15s ease, transform 0.12s ease, border-color 0.15s ease;
}

.sheet-toolbtn:active:not(:disabled) {
  transform: scale(0.98);
}

.sheet-toolbtn__ico {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
  color: inherit;
}

.sheet-toolbtn__ico svg.lucide {
  stroke: currentColor;
}

.sheet-toolbtn__label {
  display: block;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  text-align: center;
}

.sheet-toolbtn--accent {
  border: none;
  background: var(--brand);
  color: #fff;
  box-shadow: 0 3px 12px rgba(91, 33, 182, 0.28);
}

.sheet-toolbtn--accent:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.9);
  outline-offset: 2px;
}

.sheet-toolbtn--ghost {
  border: 1px solid var(--line-strong);
  background: var(--page-bg);
  color: var(--text);
}

.sheet-toolbtn:disabled,
.sheet-toolbtn.sheet-toolbtn--disabled {
  opacity: 0.42;
  cursor: not-allowed;
  box-shadow: none;
  transform: none;
}

.sheet-body .sheet-toolbtn {
  min-height: 56px;
}

/* 与 btn-secondary 组合：收藏态高亮（紧凑按钮） */
.sheet-toolbtn.btn-sheet-fav.is-on {
  background: var(--brand-soft);
  border-color: rgba(91, 33, 182, 0.45);
  color: var(--brand-dark);
}

/* 深色：勿用 --brand-dark 作字色；略加深紫底 + 亮字，与主 CTA 区分但可读 */
html[data-theme="dark"] .sheet-toolbtn.btn-sheet-fav.is-on {
  background: color-mix(in srgb, var(--brand) 42%, var(--surface-2));
  border-color: rgba(196, 181, 253, 0.38);
  color: var(--brand-text-on-dark);
  box-shadow: 0 2px 14px rgba(124, 58, 237, 0.28);
}

.kv__dd--sheet-address {
  display: flex;
  flex-direction: column;
  align-items: stretch;
  gap: 10px;
  min-width: 0;
}

.sheet-address-text {
  min-width: 0;
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--text);
}

.sheet-address-actions {
  flex: 0 0 auto;
  display: flex;
  flex-direction: row;
  flex-wrap: wrap;
  align-items: stretch;
  gap: 8px;
  width: 100%;
}

.sheet-addr-action-btn {
  flex: 1 1 0;
  min-width: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  min-height: 36px;
  padding: 0 10px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--page-bg);
  color: var(--text-2);
  font: inherit;
  font-size: var(--text-sm);
  line-height: var(--leading-snug);
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}

.sheet-addr-action-btn__label {
  font-weight: 600;
  white-space: nowrap;
}

.sheet-addr-action-btn__ico {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.sheet-addr-action-btn__ico svg.lucide {
  stroke: currentColor;
}

.sheet-addr-action-btn:active {
  transform: scale(0.98);
  background: var(--brand-soft);
}

.sheet-addr-action-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

/* 道观详情：功能标题后的说明（感叹号），全文在 title / aria-label */
.sheet-feature-hint-btn {
  flex-shrink: 0;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  margin: 0;
  padding: 4px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-3);
  cursor: pointer;
  vertical-align: middle;
  -webkit-tap-highlight-color: transparent;
  transition: color 0.15s ease, background 0.15s ease;
}

.sheet-feature-hint-btn:hover {
  color: var(--brand);
  background: var(--brand-soft);
}

html[data-theme="dark"] .sheet-feature-hint-btn:hover {
  color: var(--brand-accent-text);
}

.sheet-feature-hint-btn:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.sheet-feature-hint-btn__ico {
  display: flex;
  line-height: 0;
}

.sheet-feature-hint-btn__ico svg.lucide {
  stroke: currentColor;
}

.temple-tags__title-inline {
  display: inline-flex;
  align-items: center;
  gap: 2px;
}

.temple-checkin__title-row {
  display: flex;
  align-items: center;
  gap: 4px;
  margin-bottom: 6px;
}

.place-note__title-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.temple-brother-note__title-row {
  display: inline-flex;
  align-items: center;
  gap: 6px;
}

.user-place-edit__bar {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 10px;
}

.user-place-edit__bar-title {
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  color: var(--text);
}

/* —— 道观详情：标签与访客标注 —— */
.temple-tags {
  margin: 0;
  padding: calc(var(--sheet-module-pad-y) + 2px) 0 var(--sheet-module-pad-y);
  border-bottom: 1px solid var(--line);
}

.temple-tags__head {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.temple-tags__title-row {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px 10px;
}

.temple-tags__title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: var(--leading-snug);
  color: var(--text-3);
}

/* 与 temple-tag--crowd 同系，强调「联网聚合」而非纯本机状态 */
.temple-tags__net-badge {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  line-height: var(--leading-snug);
  padding: 4px 10px;
  border-radius: var(--radius-pill);
  background: rgba(91, 33, 182, 0.12);
  color: var(--brand-dark);
  border: 1px solid rgba(91, 33, 182, 0.28);
}

.temple-tags__chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 10px;
  align-items: center;
  align-content: flex-start;
  min-height: 30px;
}

.temple-tags__empty {
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--text-3);
}

.temple-tag {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  padding: 6px 12px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  line-height: var(--leading-snug);
}

.temple-tag--official {
  background: rgba(22, 163, 74, 0.14);
  color: #15803d;
}

.temple-tag--crowd {
  background: var(--brand-soft);
  color: var(--brand-dark);
  border: 1px dashed rgba(91, 33, 182, 0.38);
}

.temple-tag__cnt {
  font-weight: 600;
  opacity: 0.92;
}

.temple-tags__pick {
  display: flex;
  flex-direction: column;
  gap: 12px;
  margin-top: 12px;
}

.temple-tags__pick-row {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(76px, 1fr));
  gap: 8px;
  width: 100%;
}

.temple-tags__sub {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.temple-tags__sub-title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.04em;
  line-height: var(--leading-snug);
  color: var(--text-3);
}

/* —— 道观详情：图库 summary + 问卷 brotherNote（「去过这里的师兄说」） —— */
.temple-brother-note {
  margin: 0;
  padding: var(--sheet-module-pad-y) 0;
  border-bottom: 1px solid var(--line);
}

.temple-brother-note__head {
  margin-bottom: 8px;
}

.temple-brother-note__title {
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: var(--leading-snug);
  color: var(--text-3);
}

.temple-brother-note__body {
  margin: 0;
  font-size: var(--text-base);
  line-height: var(--leading-prose);
  color: var(--text-2);
  white-space: pre-wrap;
  word-break: break-word;
}

.temple-brother-note__body--empty {
  color: var(--text-3);
}

.temple-tag-pick {
  margin: 0;
  box-sizing: border-box;
  min-width: 0;
  width: 100%;
  min-height: 36px;
  padding: 7px 8px;
  border-radius: var(--radius-pill);
  font-size: 12px;
  font-weight: 700;
  line-height: var(--leading-snug);
  font-family: inherit;
  text-align: center;
  white-space: normal;
  word-break: keep-all;
  overflow-wrap: break-word;
  cursor: pointer;
  border: 1px solid var(--line-strong);
  background: var(--surface);
  color: var(--text-2);
  transition: background 0.15s ease, border-color 0.15s ease, color 0.15s ease;
}

.temple-tag-pick.is-on {
  background: var(--brand-soft);
  border-color: rgba(91, 33, 182, 0.45);
  color: var(--brand-dark);
}

.temple-tag-pick:active {
  transform: scale(0.98);
}

/* —— 道观详情：到访打卡 —— */
.temple-checkin {
  margin: 0;
  padding: var(--sheet-module-pad-y) 0;
  border-bottom: 1px solid var(--line);
}

.temple-checkin__head {
  margin-bottom: 10px;
}

.temple-checkin__title {
  display: block;
  font-size: var(--text-xs);
  font-weight: 700;
  letter-spacing: 0.06em;
  text-transform: uppercase;
  line-height: var(--leading-snug);
  color: var(--text-3);
  margin-bottom: 0;
}

.temple-checkin__meta {
  margin: 0;
  font-size: var(--text-base);
  line-height: var(--leading-body);
  color: var(--text-2);
}

.temple-checkin__meta strong {
  color: var(--text);
  font-weight: 800;
}

.temple-checkin-times {
  margin: 0 0 10px;
  padding: 0;
  border: none;
}

.temple-checkin-times__summary {
  cursor: pointer;
  margin: 0 0 6px;
  font-size: var(--text-sm);
  font-weight: 700;
  line-height: var(--leading-ui);
  color: var(--text-3);
  letter-spacing: 0.03em;
  list-style: none;
  user-select: none;
}

.temple-checkin-times__summary::-webkit-details-marker {
  display: none;
}

.temple-checkin-times__summary::before {
  content: "";
  display: inline-block;
  width: 0.35em;
  height: 0.35em;
  margin-right: 0.35em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  vertical-align: 0.15em;
  transition: transform 0.15s ease;
}

.temple-checkin-times[open] .temple-checkin-times__summary::before {
  transform: rotate(45deg);
  vertical-align: 0.05em;
}

.temple-checkin-times__ul {
  margin: 0;
  padding: 0 0 0 1.1em;
  font-size: var(--text-sm);
  line-height: var(--leading-body);
  color: var(--text-2);
}

.temple-checkin-times__ul .checkin-time-li {
  margin: 0.2em 0;
}

.temple-checkin-times__ul .checkin-time-li--note {
  list-style: none;
  margin-left: -1.1em;
  padding-left: 0;
  color: var(--text-3);
  font-size: var(--text-xs);
  line-height: var(--leading-ui);
}

.place-note {
  margin: var(--sheet-module-pad-y) 0 0;
  padding: var(--sheet-module-pad-y) 14px 12px;
  border-radius: var(--radius-md, 12px);
  border: 1px solid var(--line);
  background: var(--surface-2, var(--surface));
}

.place-note__head {
  margin-bottom: 8px;
}

.place-note__title {
  display: inline-block;
  font-size: var(--text-base);
  font-weight: 700;
  line-height: var(--leading-snug);
  color: var(--text);
}

.place-note__textarea {
  display: block;
  width: 100%;
  box-sizing: border-box;
  min-height: 88px;
  margin: 0;
  padding: 10px 12px;
  font-size: var(--text-base);
  line-height: var(--leading-prose);
  font-family: inherit;
  color: var(--text);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: 10px;
  resize: vertical;
}

.place-note__textarea:focus {
  outline: none;
  border-color: rgba(91, 33, 182, 0.45);
  box-shadow: 0 0 0 2px rgba(91, 33, 182, 0.18);
}

.place-note__actions {
  margin-top: 10px;
}

.sheet-body .place-note .btn-secondary {
  width: 100%;
  min-width: 0;
}

@media (min-width: 420px) {
  .sheet-body .place-note .btn-secondary {
    width: auto;
    min-width: 140px;
  }
}

/* —— 我的：问道录与成就进度 —— */
/* ═══ 问道录 — 成就系统 v2 ═══ */

.checkin-ledger-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 20px 18px;
  margin-top: var(--panel-stack-gap);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-rest);
}

.checkin-ledger-card > .terms-card__title {
  margin-bottom: 14px;
}

.checkin-ledger-card__title-row {
  display: flex;
  align-items: center;
  gap: 4px;
  flex-wrap: wrap;
}

.checkin-ledger-card__title-text {
  line-height: 1.25;
}

.checkin-extents__head-text {
  line-height: 1.25;
}

/* -- Cultivation Rank Badge -- */
.ach-rank {
  display: flex;
  flex-direction: column;
  align-items: center;
  padding: 8px 0 4px;
  margin-bottom: 8px;
}

.ach-rank__inner {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  pointer-events: none;
  margin-bottom: 10px;
}

.ach-rank__pct {
  font-size: 28px;
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.ach-rank__pct-unit {
  font-size: 12px;
  font-weight: 700;
}

.ach-rank__title-row {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 6px;
  max-width: 100%;
  text-align: center;
}

.ach-rank__title {
  font-size: clamp(34px, 9vw, 46px);
  font-weight: 400;
  color: #ca8a04;
  letter-spacing: 0.14em;
  font-family: var(--font-masthead);
}

.ach-rank__sub {
  display: block;
  font-size: 12px;
  font-weight: 500;
  line-height: 1.45;
  letter-spacing: 0.04em;
  color: var(--text-muted, color-mix(in srgb, var(--text) 72%, transparent));
  max-width: 18em;
}

/* -- Stats Cards with Progress Rings -- */
.checkin-ledger__stats {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 8px;
  margin: 0;
}

.checkin-ledger__year-summary-wrap {
  margin: 12px 0;
}

.checkin-ledger__year-summary {
  margin: 0;
  text-align: center;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-2);
  font-weight: 600;
}

.checkin-ledger__year-summary strong {
  color: var(--brand);
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}

.checkin-ledger__year-summary--muted {
  color: var(--text-3);
  font-weight: 500;
  font-size: var(--text-xs);
}

.checkin-ledger__year-summary--sub {
  color: var(--text-3);
  font-weight: 600;
  font-size: var(--text-xs);
}

.checkin-ledger__extents-outer {
  margin: 0;
}

.checkin-extents {
  padding: 0;
  border-radius: 0;
  background: transparent;
  border: none;
}

.checkin-extents__head {
  margin: 0 0 8px;
}

.checkin-extents__list {
  list-style: none;
  margin: 0;
  padding: 0;
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.checkin-extents__row {
  display: flex;
  align-items: stretch;
  gap: 10px;
  min-height: 44px;
}

.checkin-extents__dir {
  flex: 0 0 1.5em;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: var(--text-sm);
  font-weight: 800;
  color: var(--brand);
}

.checkin-extents__open {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  justify-content: center;
  gap: 2px;
  padding: 12px 14px;
  margin: 0;
  text-align: left;
  border-radius: var(--radius-card);
  border: 1px solid var(--line);
  background: var(--surface);
  color: inherit;
  font: inherit;
  cursor: pointer;
  box-shadow: var(--shadow-rest);
  transition: background 0.15s ease, border-color 0.15s ease;
}

.checkin-extents__open:hover,
.checkin-extents__open:focus-visible {
  border-color: var(--brand);
  background: color-mix(in srgb, var(--brand) 8%, var(--surface));
  outline: none;
}

.checkin-extents__name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
}

.checkin-extents__addr {
  font-size: var(--text-xs);
  color: var(--text-3);
  line-height: 1.35;
}

.checkin-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  text-align: center;
  padding: 14px 4px 12px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--line);
  position: relative;
  overflow: hidden;
  box-shadow: var(--shadow-rest);
}

.checkin-stat__ring {
  position: relative;
  width: 64px;
  height: 64px;
  margin-bottom: 6px;
}

.checkin-stat__ring svg {
  display: block;
  width: 100%;
  height: 100%;
}

.checkin-stat__ring-track {
  fill: none;
  stroke: var(--line-strong);
  stroke-width: 4;
}

.checkin-stat__ring-fill {
  fill: none;
  stroke: var(--brand);
  stroke-width: 4.5;
  stroke-linecap: round;
  filter: drop-shadow(0 0 3px rgba(91, 33, 182, 0.3));
  transition: stroke-dashoffset 0.8s var(--ease);
}

.checkin-stat__num {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: clamp(16px, 4vw, 20px);
  font-weight: 800;
  color: var(--brand);
  line-height: 1;
  font-variant-numeric: tabular-nums;
}

.checkin-stat__lbl-row {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 2px;
  flex-wrap: nowrap;
  max-width: 100%;
}

.checkin-stat__lbl {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  font-size: var(--text-xs);
  font-weight: 700;
  color: var(--text-2);
  letter-spacing: 0.04em;
}

.checkin-stat__ico {
  flex-shrink: 0;
  color: var(--brand);
  line-height: 0;
}

.checkin-stat__ico svg.lucide {
  display: block;
}

/* -- Sections & share button -- */
.checkin-ledger__section {
  margin-top: 18px;
  padding-top: 18px;
  border-top: 1px solid var(--line);
}

.checkin-ledger__section .terms-card__subhead {
  margin-top: 0;
  margin-bottom: 8px;
}

.checkin-ledger__section-hint {
  margin: 0 0 12px;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-3);
}

.checkin-ledger__section--milestones {
  margin-top: 14px;
  padding-top: 14px;
}

.checkin-ledger__section--milestones .terms-card__subhead {
  margin-bottom: 10px;
}

.checkin-share-btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 8px;
  width: 100%;
  min-height: 44px;
  font-weight: 700;
}

.checkin-share-btn svg.lucide {
  flex-shrink: 0;
}

/* -- Milestone：与问道录同一张卡片内平铺，分隔线分区，避免再套深色底块 -- */
.checkin-achievements {
  display: flex;
  flex-direction: column;
  gap: 0;
  margin: 0;
}

.checkin-ach-row {
  display: grid;
  grid-template-columns: auto 1fr auto;
  align-items: center;
  column-gap: 8px;
  row-gap: 10px;
  padding: 14px 0;
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  border-bottom: 1px solid var(--line);
}

.checkin-achievements .checkin-ach-row:last-child {
  border-bottom: none;
  padding-bottom: 2px;
}

.checkin-ach-row__ico {
  flex-shrink: 0;
  grid-column: 1;
  grid-row: 1;
  color: var(--brand);
}

.checkin-ach-row__ico svg.lucide {
  display: block;
}

.checkin-ach-row__title {
  grid-column: 2;
  grid-row: 1;
  min-width: 0;
  font-size: 13px;
  font-weight: 800;
  color: var(--text);
  letter-spacing: 0.04em;
}

.checkin-ach-row__progress {
  grid-column: 3;
  grid-row: 1;
  justify-self: end;
  font-size: 11px;
  font-weight: 700;
  color: var(--brand);
  font-variant-numeric: tabular-nums;
  background: var(--brand-soft);
  padding: 2px 8px;
  border-radius: var(--radius-pill);
}

/* Progress bar */
.checkin-ach-row__bar {
  position: relative;
  grid-column: 1 / -1;
  grid-row: 2;
  margin: 0;
}

.checkin-ach-row__bar-track {
  height: 6px;
  border-radius: 3px;
  background: var(--line-strong);
  overflow: hidden;
}

.checkin-ach-row__bar-fill {
  height: 100%;
  border-radius: 3px;
  background: linear-gradient(90deg, var(--brand), #7c3aed);
  transition: width 0.8s var(--ease);
  box-shadow: 0 0 8px rgba(91, 33, 182, 0.3);
}

/* Milestone badge grid */
.ach-ms-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
  list-style: none;
  margin: 0;
  padding: 0;
  grid-column: 1 / -1;
  grid-row: 3;
}

.ach-ms {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  min-width: 42px;
  padding: 6px 4px 5px;
  border-radius: var(--radius-sm);
  border: 1px solid var(--line);
  background: transparent;
  text-align: center;
  transition: transform 0.15s ease, border-color 0.15s ease;
  flex: 0 0 auto;
}

.ach-ms__circle {
  width: 28px;
  height: 28px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 10px;
  font-weight: 800;
  line-height: 1;
  border: 2px solid var(--line);
  background: var(--surface-2);
  color: var(--text-3);
  position: relative;
  font-variant-numeric: tabular-nums;
}

.ach-ms__label {
  font-size: 9px;
  font-weight: 700;
  color: var(--text-3);
  white-space: nowrap;
  letter-spacing: 0.02em;
}

.ach-ms__n {
  font-size: 10px;
  font-weight: 800;
  color: var(--text-3);
}

/* Done state */
.ach-ms.is-done {
  border-color: rgba(91, 33, 182, 0.35);
  background: rgba(91, 33, 182, 0.06);
}

.ach-ms.is-done .ach-ms__circle {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  box-shadow: 0 2px 8px rgba(91, 33, 182, 0.35);
}

.ach-ms__check {
  display: flex;
  align-items: center;
  justify-content: center;
  line-height: 0;
}

.ach-ms__check-ico svg.lucide {
  display: block;
}

.ach-ms.is-done .ach-ms__check svg.lucide {
  stroke: currentColor;
}

.ach-ms.is-done .ach-ms__label {
  color: var(--brand);
  font-weight: 800;
}

.ach-ms.is-done .ach-ms__n {
  color: var(--brand);
}

/* Next (in-progress) state */
.ach-ms.is-next {
  border-color: rgba(212, 175, 55, 0.6);
  background: rgba(251, 191, 36, 0.08);
  animation: ach-ms-pulse 2s ease-in-out infinite;
}

.ach-ms.is-next .ach-ms__circle {
  border-color: #d4af37;
  background: rgba(251, 191, 36, 0.15);
  color: #92400e;
  box-shadow: 0 0 0 3px rgba(251, 191, 36, 0.18);
}

.ach-ms.is-next .ach-ms__label {
  color: #92400e;
  font-weight: 800;
}

.ach-ms.is-next .ach-ms__n {
  color: #92400e;
}

/* Todo (locked) state */
.ach-ms.is-todo {
  opacity: 0.42;
}

.ach-ms.is-todo .ach-ms__circle {
  border-style: dashed;
}

@keyframes ach-ms-pulse {
  0%, 100% { transform: scale(1); box-shadow: var(--shadow-rest); }
  50% { transform: scale(1.04); box-shadow: 0 2px 12px rgba(212, 175, 55, 0.25); }
}

/* —— 我的：地图偏好 —— */
.me-pref-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 20px 18px;
  margin-top: var(--panel-stack-gap);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-rest);
}

.me-pref-card__intro {
  margin: 0 0 14px;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-2);
}

.me-setting-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 14px;
}

.me-setting-row + .me-setting-row {
  margin-top: 16px;
}

.me-setting-row__text {
  min-width: 0;
  flex: 1;
}

.me-setting-row__label {
  display: block;
  font-size: var(--text-base);
  font-weight: 700;
  color: var(--text);
}

.me-setting-row__hint {
  display: block;
  margin-top: 4px;
  font-size: var(--text-sm);
  line-height: 1.45;
  color: var(--text-3);
}

.me-switch {
  flex-shrink: 0;
  position: relative;
  width: 50px;
  height: 30px;
  padding: 0;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--switch-track-off);
  cursor: pointer;
  transition: background 0.2s ease;
  -webkit-tap-highlight-color: transparent;
}

.me-switch.is-on {
  background: var(--switch-track-on);
}

.me-switch__thumb {
  position: absolute;
  top: 3px;
  left: 3px;
  width: 24px;
  height: 24px;
  border-radius: 50%;
  background: var(--switch-thumb);
  box-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
  transition: transform 0.2s ease;
  pointer-events: none;
}

.me-switch.is-on .me-switch__thumb {
  transform: translateX(20px);
}

/* —— 我的：内层栈、打卡收藏胶囊与子页 —— */
.me-panel-inner {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  position: relative;
  overflow: hidden;
}

.me-saved-capsule {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  width: 100%;
  margin-top: var(--panel-stack-gap);
  padding: 14px 18px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-pill);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  font-family: inherit;
  cursor: pointer;
  text-align: left;
  transition:
    background 0.2s ease,
    border-color 0.2s ease,
    transform 0.12s ease;
}

.me-saved-capsule:active {
  transform: scale(0.99);
}

.me-saved-capsule__text {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.me-saved-capsule__title {
  font-size: var(--text-base);
  font-weight: 800;
  color: var(--text);
  letter-spacing: -0.02em;
}

.me-saved-capsule__summary {
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-3);
  line-height: 1.35;
}

.me-saved-capsule__chev {
  flex-shrink: 0;
  font-size: 22px;
  font-weight: 300;
  color: var(--text-3);
  line-height: 1;
  margin-right: -4px;
}

.me-saved-subpage {
  position: absolute;
  inset: 0;
  z-index: 4;
  display: flex;
  flex-direction: column;
  background: var(--page-bg);
  overflow: hidden;
}

.me-saved-subpage[hidden] {
  display: none !important;
}

.me-saved-subpage__head {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 14px 12px 12px;
  padding-top: max(14px, env(safe-area-inset-top, 0px));
  border-bottom: 1px solid var(--line);
  background: var(--surface);
}

.me-saved-subpage__back {
  width: 44px;
  height: 44px;
  margin: -8px 0 -8px -4px;
  border: none;
  border-radius: var(--radius-md);
  background: transparent;
  color: var(--text-2);
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
}

.me-saved-subpage__back svg.lucide {
  stroke: currentColor;
}

.me-saved-subpage__back:active {
  background: var(--page-bg);
}

.me-saved-subpage__title {
  flex: 1;
  margin: 0;
  font-size: var(--text-lg);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
  text-align: center;
  padding-right: 38px;
}

.me-saved-subpage__scroll {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 0 18px calc(var(--dock-clearance) + 24px);
  -webkit-overflow-scrolling: touch;
}

.me-saved-subpage__intro {
  margin: 16px 0 14px;
  font-size: var(--text-sm);
  line-height: 1.55;
  color: var(--text-2);
}

.me-saved-mode-tabs {
  margin-bottom: 14px;
}

/* 我的：打卡 / 收藏可折叠区块 */
.me-saved-collapse {
  margin: 0 0 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-rest);
  overflow: hidden;
}

.me-saved-collapse__summary {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 10px;
  padding: 14px 16px;
  cursor: pointer;
  list-style: none;
  font-family: inherit;
  user-select: none;
  transition: background 0.15s ease;
}

.me-saved-collapse__summary::-webkit-details-marker {
  display: none;
}

.me-saved-collapse__chev {
  display: flex;
  flex-shrink: 0;
  align-items: center;
  justify-content: center;
  margin-right: 2px;
  color: var(--text-3);
  line-height: 0;
  transition: transform 0.15s ease;
}

.me-saved-collapse__chev svg.lucide {
  display: block;
}

.me-saved-collapse:not([open]) .me-saved-collapse__chev {
  transform: rotate(-90deg);
}

.me-saved-collapse[open] .me-saved-collapse__chev {
  transform: rotate(0deg);
}

.me-saved-collapse__summary:active {
  background: var(--page-bg);
}

.me-saved-collapse__title {
  flex: 1;
  min-width: 0;
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: var(--text-base);
  font-weight: 800;
  letter-spacing: -0.02em;
  color: var(--text);
}

.me-saved-collapse__meta {
  flex-shrink: 0;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-3);
}

.me-saved-collapse__body {
  padding: 0 14px 14px;
  border-top: 1px solid var(--line);
  background: transparent;
}

.me-saved-collapse__body .me-saved-panel__hint {
  margin-top: 10px;
}

/* 打卡记录 / 我的收藏：内容区与标题共用外层卡片底色，去掉内层「托盘」与列表二次圆角 */
#me-saved-collapse-visited .me-saved-collapse__body,
#me-saved-collapse-favorites .me-saved-collapse__body {
  padding: 0;
  background: transparent;
}

#page-me #me-visited-list.me-temple-list,
#page-me #me-favorites-list.me-temple-list {
  border: none;
  border-radius: 0;
  background: transparent;
  box-shadow: none;
  overflow: visible;
}

.me-saved-ach-section {
  margin-top: 8px;
  padding-top: 4px;
}

.me-saved-panel__hint {
  margin: 0 0 10px;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-2);
}

.me-saved-list-block {
  margin-bottom: 8px;
}

/* —— 我的：打卡列表与收藏夹（子页内卡片） —— */
.me-saved-card {
  background: var(--surface);
  border-radius: var(--radius-card);
  padding: 20px 18px;
  margin-top: var(--panel-stack-gap);
  margin-bottom: var(--panel-stack-gap);
  border: 1px solid var(--line);
  box-shadow: var(--shadow-rest);
}

.me-saved-card__hint {
  margin: 0 0 12px;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-2);
}

.me-temple-list {
  display: flex;
  flex-direction: column;
  gap: 0;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--page-bg);
  overflow: hidden;
}

.me-temple-list__empty {
  margin: 0;
  padding: 16px 14px;
  font-size: var(--text-sm);
  line-height: 1.5;
  color: var(--text-3);
}

.me-temple-item {
  display: flex;
  align-items: stretch;
  gap: 0;
  border-bottom: 1px solid var(--line);
  min-height: 48px;
}

.me-temple-item__stack {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: stretch;
}

.me-checkin-times {
  margin: 0;
  padding: 0 14px 10px;
  border: none;
  border-radius: 0;
}

.me-checkin-times__summary {
  cursor: pointer;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--brand);
  list-style: none;
  padding: 0 0 6px;
  user-select: none;
}

.me-checkin-times__summary::-webkit-details-marker {
  display: none;
}

.me-checkin-times__summary::before {
  content: "";
  display: inline-block;
  width: 0.35em;
  height: 0.35em;
  margin-right: 0.35em;
  border-right: 2px solid currentColor;
  border-bottom: 2px solid currentColor;
  transform: rotate(-45deg);
  vertical-align: 0.15em;
  transition: transform 0.15s ease;
}

.me-checkin-times[open] .me-checkin-times__summary::before {
  transform: rotate(45deg);
  vertical-align: 0.05em;
}

.me-checkin-times__ul {
  margin: 0;
  padding: 0 0 0 1.15em;
  font-size: var(--text-xs);
  line-height: 1.55;
  color: var(--text-2);
}

.me-checkin-times__ul .checkin-time-li {
  margin: 0.2em 0;
}

.me-checkin-times__ul .checkin-time-li--note {
  list-style: none;
  margin-left: -1.15em;
  padding-left: 0;
  color: var(--text-3);
  font-size: 11px;
}

.me-temple-item:last-child {
  border-bottom: none;
}

.me-temple-item--missing {
  align-items: stretch;
  padding: 12px 14px;
  gap: 10px;
}

.me-temple-item--missing .me-temple-item__stack {
  width: 100%;
}

.me-temple-item__open {
  flex: 1;
  min-width: 0;
  margin: 0;
  padding: 12px 14px;
  border: none;
  border-radius: var(--radius-sm);
  background: transparent;
  text-align: left;
  font: inherit;
  cursor: pointer;
  color: inherit;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
  transition: background 0.15s ease;
}

.me-temple-item__open:active {
  background: rgba(0, 0, 0, 0.04);
}

html[data-theme="dark"] .me-temple-item__open:active {
  background: rgba(255, 255, 255, 0.06);
}

.me-temple-item__main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 4px;
}

.me-temple-item__name {
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text);
  line-height: 1.3;
}

.me-temple-item__sub {
  font-size: var(--text-xs);
  color: var(--text-3);
  line-height: 1.4;
  word-break: break-word;
}

.me-temple-item__unfav {
  flex-shrink: 0;
  align-self: center;
  margin: 0 10px 0 0;
  padding: 8px 12px;
  border: none;
  border-radius: var(--radius-pill);
  background: transparent;
  color: var(--text-3);
  font-size: var(--text-xs);
  font-weight: 600;
  font-family: inherit;
  cursor: pointer;
}

.me-temple-item__unfav:active {
  color: var(--brand);
  background: var(--brand-soft);
}

.kv {
  display: grid;
  grid-template-columns: 88px 1fr;
  gap: 8px 12px;
  align-items: start;
  font-size: var(--text-base);
  line-height: var(--leading-body);
  margin-bottom: 8px;
}

.kv dt {
  margin: 0;
  padding-top: 0.15em;
  color: var(--text-3);
  font-weight: 700;
  font-size: var(--text-xs);
  line-height: var(--leading-snug);
}

.kv dd {
  margin: 0;
  word-break: break-word;
  color: var(--text-2);
  font-size: var(--text-base);
  line-height: var(--leading-body);
}

.kv.kv--sheet-address {
  /* 与其它 .kv 的 88px+1fr 两列不同：地址与按钮纵向分组，与标题左缘对齐，避免标签与多行正文错位 */
  grid-template-columns: 1fr;
  gap: 8px 0;
  margin: 0 -20px 0;
  padding: 4px 20px 16px;
  /* 与 .sheet 同为 --surface，避免单独铺 --surface-2 形成横条块感 */
  background: transparent;
  border-bottom: 1px solid var(--line);
}

.kv.kv--sheet-address dd {
  min-width: 0;
}

/* 道观详情：属性区（宗派 / 状态 / 经纬度）与上方模块分隔 */
#sheet[data-temple-detail-id] .sheet-body > dl.kv:not(.kv--sheet-address) {
  margin-top: 0;
  padding-top: var(--sheet-module-pad-y);
  border-top: 1px solid var(--line);
}

.sheet-actions {
  display: flex;
  gap: 10px;
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
}

.sheet-actions > .btn-primary,
.sheet-actions > .btn-secondary {
  flex: 1 1 0;
  min-width: 0;
}

.sheet-actions > .btn-primary {
  border: none;
}

.sheet-actions > .btn-primary:active,
.sheet-actions > .btn-secondary:active {
  transform: scale(0.98);
}

.btn-primary {
  border: none;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  box-shadow: 0 4px 14px rgba(91, 33, 182, 0.35);
}

.btn-primary:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.95);
  outline-offset: 2px;
}

.btn-secondary {
  border-radius: var(--radius-pill);
  background: var(--page-bg);
  color: var(--text);
  border: 1px solid var(--line-strong);
}

.btn-danger {
  border: none;
  border-radius: var(--radius-pill);
  background: #dc2626;
  color: #fff;
  font-family: inherit;
  font-size: var(--text-base);
  font-weight: 700;
  padding: 12px 18px;
  cursor: pointer;
  box-shadow: 0 4px 14px rgba(220, 38, 38, 0.35);
  transition: transform 0.12s ease, filter 0.12s ease, background 0.12s ease;
}

.btn-danger:hover {
  background: #b91c1c;
  filter: brightness(1.02);
}

.btn-danger:active {
  transform: scale(0.98);
}

.btn-danger:focus-visible {
  outline: 2px solid #dc2626;
  outline-offset: 2px;
}

/* —— Toast —— */
.toast {
  position: fixed;
  left: 50%;
  bottom: calc(var(--dock-clearance) + 20px);
  transform: translateX(-50%) translateY(12px);
  padding: 12px 20px;
  background: rgba(26, 26, 26, 0.92);
  color: #fff;
  border-radius: var(--radius-pill);
  font-size: var(--text-sm);
  opacity: 0;
  visibility: hidden;
  transition: opacity 0.28s ease, transform 0.28s var(--ease), visibility 0.28s ease;
  z-index: 200;
  max-width: min(340px, 88vw);
  text-align: center;
  line-height: 1.45;
  box-shadow: var(--shadow-dock);
}

.toast.show {
  opacity: 1;
  visibility: visible;
  transform: translateX(-50%) translateY(0);
}

/* 道观详情「功能说明」等长文案：略加宽、左对齐，便于多行阅读 */
.toast.toast--hint {
  max-width: min(420px, 92vw);
  padding: 14px 18px;
  border-radius: var(--radius-md);
  text-align: left;
  white-space: pre-wrap;
  word-break: break-word;
}

/* 进入主页后：开发演示说明（须高于 .toast z-index:200） */
.dev-demo-notice {
  position: fixed;
  inset: 0;
  z-index: 210;
  display: flex;
  align-items: center;
  justify-content: center;
  padding: max(16px, var(--safe-top)) 18px max(20px, var(--safe-bottom));
  pointer-events: none;
  visibility: hidden;
}

.dev-demo-notice.open {
  pointer-events: auto;
  visibility: visible;
}

.dev-demo-notice__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 25, 0.52);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.dev-demo-notice.open .dev-demo-notice__backdrop {
  opacity: 1;
}

.dev-demo-notice__panel {
  position: relative;
  width: 100%;
  max-width: 400px;
  max-height: min(82vh, 540px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  background: var(--surface);
  border-radius: var(--radius-xl);
  border: 1px solid var(--line);
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.22), var(--shadow-float);
  padding: 22px 20px calc(18px + var(--safe-bottom));
  transform: scale(0.96) translateY(10px);
  opacity: 0;
  transition: transform var(--dur) var(--ease), opacity var(--dur) var(--ease);
}

.dev-demo-notice.open .dev-demo-notice__panel {
  transform: scale(1) translateY(0);
  opacity: 1;
}

.dev-demo-notice__close {
  position: absolute;
  top: 10px;
  right: 10px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--page-bg);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.dev-demo-notice__close svg.lucide {
  stroke: currentColor;
}

.dev-demo-notice__title {
  margin: 0 44px 14px 0;
  font-size: var(--text-xl);
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -0.02em;
  line-height: 1.25;
}

.dev-demo-notice__body {
  margin-bottom: 18px;
}

.dev-demo-notice__lead,
.dev-demo-notice__p {
  margin: 0 0 12px;
  font-size: var(--text-base);
  color: var(--text-2);
  line-height: 1.55;
}

.dev-demo-notice__lead:last-child,
.dev-demo-notice__p:last-child {
  margin-bottom: 0;
}

.dev-demo-notice__wechat {
  margin-top: 4px;
}

.dev-demo-notice__mono {
  font-family: ui-monospace, "Cascadia Code", "SF Mono", Menlo, Consolas, monospace;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text);
  letter-spacing: 0.02em;
}

.dev-demo-notice__ok {
  width: 100%;
  min-height: 48px;
}

html[data-theme="dark"] .dev-demo-notice__panel {
  box-shadow: 0 24px 56px rgba(0, 0, 0, 0.45), 0 0 0 1px rgba(255, 255, 255, 0.06);
}

/* 深色：标题勿用填充色 --brand（#5b21b6），与面板底对比过低 */
html[data-theme="dark"] .dev-demo-notice__title {
  color: var(--brand-accent-text);
}

@media (prefers-reduced-motion: reduce) {
  .dev-demo-notice__backdrop,
  .dev-demo-notice__panel {
    transition: none;
  }

  .dev-demo-notice__panel {
    transform: none;
  }

  .dev-demo-notice.open .dev-demo-notice__panel {
    transform: none;
  }
}

/* —— 启动全屏缓冲（太极 + 进度条） ——
 * 参考 Apple HIG：清晰层级、系统级辅助文案字体、克制进度条、尊重 prefers-reduced-motion。
 */
.app-boot-splash {
  /* 太极视觉直径：沿用原「问道」大字号比例 */
  --splash-masthead-brand: clamp(68px, 19vw, 118px);
  /* 太极外圆视觉直径（由字号推导的基准，再乘 --splash-taiji-visual-scale 单独收小图标） */
  --splash-taiji-diameter: calc(var(--splash-masthead-brand) * 2.25);
  /*
   * Lucide yin-yang 外圆约占 viewBox 的 20/24，仅设 width=直径时笔画圆比框小一圈；
   * 放大 SVG 边长使外沿描边直径贴合 --splash-taiji-diameter。
   */
  --splash-taiji-svg-box-scale: 1.22;
  --splash-taiji-visual-scale: 0.78;
  /* 上区：太极—进度条—载入文案（垂直居中） */
  --splash-space-taiji-to-bar: clamp(18px, 3.5vh, 28px);
  --splash-space-bar-to-status: clamp(12px, 2.2vh, 20px);
  /* 与 iOS/macOS 辅助文案一致：SF 系列 + 系统回退 */
  --splash-font-ui: -apple-system, BlinkMacSystemFont, "SF Pro Text", "SF Pro Display", "Helvetica Neue",
    Helvetica, "Segoe UI", Roboto, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  --splash-ease-default: cubic-bezier(0.25, 0.1, 0.25, 1);
  position: fixed;
  inset: 0;
  z-index: 280;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-start;
  min-height: 100vh;
  min-height: 100dvh;
  padding: max(28px, var(--safe-top)) max(24px, env(safe-area-inset-right, 0px)) max(32px, var(--safe-bottom))
    max(24px, env(safe-area-inset-left, 0px));
  /* 柔和顶光 + 纵向渐变，接近系统启动/深度背景的层次 */
  background:
    radial-gradient(ellipse 130% 70% at 50% -15%, rgba(255, 255, 255, 0.14) 0%, transparent 52%),
    linear-gradient(168deg, var(--brand) 0%, #4a1a9e 48%, var(--brand-dark) 100%);
  color: #fff;
  box-sizing: border-box;
  -webkit-font-smoothing: antialiased;
  transition:
    opacity 0.4s var(--splash-ease-default),
    visibility 0.4s var(--splash-ease-default),
    transform 0.4s var(--splash-ease-default);
}

@media (max-width: 400px) {
  .app-boot-splash {
    --splash-masthead-brand: clamp(58px, 16.5vw, 96px);
    --splash-space-taiji-to-bar: clamp(14px, 3vh, 22px);
    --splash-space-bar-to-status: clamp(10px, 1.8vh, 16px);
    padding: max(22px, var(--safe-top)) max(20px, env(safe-area-inset-right, 0px)) max(28px, var(--safe-bottom))
      max(20px, env(safe-area-inset-left, 0px));
  }
}

.app-boot-splash--out {
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  /* 与常见 sheet / 全屏层退场一致：轻微下沉，避免夸张缩放 */
  transform: translateY(10px) scale(0.985);
}

.app-boot-splash__inner {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  gap: 0;
  max-width: min(420px, 94vw);
  width: 100%;
  min-height: 0;
}

/* 中上：太极 + 进度条 + 载入文案，作为一组垂直居中 */
.app-boot-splash__upper {
  flex: 1 1 auto;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  width: 100%;
  min-height: 0;
}

.app-boot-splash__taiji-spin {
  margin: 0 0 var(--splash-space-taiji-to-bar);
  animation: app-boot-taiji-spin 3.2s linear infinite;
  filter: drop-shadow(0 8px 24px rgba(0, 0, 0, 0.22));
}

/* 启动屏太极：无圆盘底，仅白线图标叠在紫底上 */
.app-boot-splash__yin-fab {
  position: relative;
  width: auto;
  height: auto;
  border-radius: 0;
  background: transparent;
  border: none;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: none;
  overflow: visible;
}

.app-boot-splash__yin-fab svg.lucide {
  stroke: currentColor;
  fill: none;
  /* 随太极放大略加厚描边，避免过大时空心感过飘 */
  stroke-width: 2.05;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.app-boot-splash__yin-fab svg.dock-fab__yin-yang {
  width: calc(
    var(--splash-taiji-diameter) * var(--splash-taiji-svg-box-scale) * var(--splash-taiji-visual-scale)
  );
  height: calc(
    var(--splash-taiji-diameter) * var(--splash-taiji-svg-box-scale) * var(--splash-taiji-visual-scale)
  );
  transform: scaleY(-1);
  transform-origin: center;
}

@keyframes app-boot-taiji-spin {
  to {
    transform: rotate(360deg);
  }
}

.app-boot-splash__status {
  flex-shrink: 0;
  display: flex;
  align-items: baseline;
  justify-content: center;
  flex-wrap: wrap;
  gap: 0.4em 10px;
  width: 100%;
  margin: var(--splash-space-bar-to-status) 0 0;
  padding: 0;
  font-family: var(--splash-font-ui);
}

.app-boot-splash__hint {
  margin: 0;
  font-size: max(13px, 0.8125rem);
  font-weight: 500;
  letter-spacing: -0.01em;
  color: rgba(255, 255, 255, 0.72);
  line-height: 1.4;
}

.app-boot-splash__bar {
  width: min(72%, 280px);
  max-width: 100%;
  height: 5px;
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.2);
  overflow: hidden;
  border: none;
  box-sizing: border-box;
}

.app-boot-splash__fill {
  height: 100%;
  width: 0%;
  border-radius: inherit;
  background: rgba(255, 255, 255, 0.92);
  transition: width 0.32s var(--splash-ease-default);
}

.app-boot-splash__pct {
  margin: 0;
  font-family: var(--splash-font-ui);
  font-size: max(12px, 0.75rem);
  font-weight: 500;
  font-variant-numeric: tabular-nums;
  color: rgba(255, 255, 255, 0.55);
  letter-spacing: -0.02em;
  font-feature-settings: "tnum" 1;
}

@media (prefers-reduced-motion: reduce) {
  .app-boot-splash__taiji-spin {
    animation: none;
    opacity: 0.92;
  }

  .app-boot-splash__fill {
    transition-duration: 0.05s;
  }

  .app-boot-splash {
    transition-duration: 0.2s;
  }

  .app-boot-splash--out {
    transform: none;
  }
}

/* —— 启动错误 —— */
.boot-error {
  position: fixed;
  inset: 0;
  background: var(--page-bg);
  color: var(--text);
  display: none;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 28px;
  text-align: center;
  z-index: 300;
}

.boot-error.show {
  display: flex;
}

.boot-error__icon {
  width: 64px;
  height: 64px;
  margin-bottom: 18px;
  border-radius: var(--radius-card);
  background: var(--brand-soft);
  border: 1px solid rgba(91, 33, 182, 0.35);
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--brand-dark);
}

.boot-error__icon svg.lucide {
  stroke: currentColor;
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  stroke-linejoin: round;
}

.boot-error__title {
  margin: 0 0 10px;
  font-size: var(--text-xl);
  font-weight: 800;
}

.boot-error p,
.boot-error__text {
  margin: 0;
  color: var(--text-2);
  font-size: var(--text-sm);
  line-height: 1.6;
  max-width: 280px;
}

.visually-hidden {
  position: absolute;
  width: 1px;
  height: 1px;
  padding: 0;
  margin: -1px;
  overflow: hidden;
  clip: rect(0, 0, 0, 0);
  white-space: nowrap;
  border: 0;
}

button:focus-visible,
input:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 2px;
}

.filter-pill:focus-visible,
.btn-pill-ghost:focus-visible,
.map-ctrl-btn:focus-visible {
  outline-offset: 3px;
}

/* —— 随缘探访 —— */
.suiyuan-entry {
  margin: 0 0 16px;
}

.suiyuan-entry__btn {
  width: 100%;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  padding: 14px 20px;
  border: 1px solid var(--line-strong);
  border-radius: var(--radius-card);
  background: var(--surface);
  box-shadow: var(--shadow-float);
  cursor: pointer;
  text-align: center;
  transition: border-color 0.2s ease, box-shadow 0.2s ease;
}

.suiyuan-entry__btn:active {
  transform: scale(0.995);
}

.suiyuan-entry__label {
  width: 100%;
  text-align: center;
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -0.02em;
}

.cat-suiyuan-view {
  padding-bottom: 8px;
  background: var(--page-bg);
}

.cat-liyi-view {
  padding-left: 16px;
  padding-right: 16px;
}

.liyi-article-list {
  list-style: none;
  margin: 0;
  padding: 0;
}

.liyi-article-item + .liyi-article-item {
  margin-top: 12px;
}

.liyi-article-link {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  padding: 18px 16px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-float);
  text-decoration: none;
  color: var(--text);
  transition: border-color 0.15s ease, box-shadow 0.15s ease;
}

.liyi-article-link:hover {
  border-color: var(--brand);
  box-shadow: 0 8px 28px rgba(0, 0, 0, 0.12);
}

.liyi-article-link__title {
  font-size: var(--text-base);
  font-weight: 800;
  letter-spacing: -0.02em;
  line-height: 1.35;
}

.liyi-article-link__meta {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 8px;
  width: 100%;
}

.liyi-article-link__account {
  display: inline-flex;
  align-items: center;
  align-self: flex-start;
  max-width: 100%;
  padding: 5px 12px;
  border-radius: 999px;
  font-size: var(--text-xs);
  font-weight: 700;
  line-height: 1.35;
  background: var(--brand);
  color: #fff;
  letter-spacing: 0.02em;
}

.liyi-article-link__date {
  margin-left: auto;
  font-size: var(--text-xs);
  font-weight: 600;
  color: var(--text-2);
  white-space: nowrap;
}

.liyi-article-link__meta > .liyi-article-link__date:only-child {
  margin-left: 0;
}

.liyi-article-item--empty {
  padding: 20px 16px;
  text-align: center;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-2);
  border-radius: var(--radius-card);
  border: 1px dashed var(--line-strong);
}

.suiyuan-subhead {
  margin-bottom: 18px;
}

.suiyuan-back {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 8px 12px 8px 4px;
  margin: 0 0 8px -4px;
  border: none;
  background: transparent;
  color: var(--text-2);
  font-size: var(--text-sm);
  font-weight: 700;
  cursor: pointer;
  border-radius: var(--radius-pill);
}

.suiyuan-back svg.lucide {
  stroke: currentColor;
}

.suiyuan-subhead__title {
  margin: 0 0 6px;
  font-size: var(--text-xl);
  font-weight: 800;
  letter-spacing: -0.02em;
  text-align: center;
}

.suiyuan-subhead__tagline {
  margin: 0 0 10px;
  max-width: 34em;
  margin-left: auto;
  margin-right: auto;
  font-size: var(--text-sm);
  font-weight: 600;
  color: var(--text-2);
  line-height: 1.55;
  text-align: center;
}

.suiyuan-card {
  padding: 20px 16px 22px;
  border-radius: var(--radius-card);
  background: var(--surface);
  border: 1px solid var(--line-strong);
  box-shadow: var(--shadow-float);
}

.suiyuan-card + .suiyuan-card {
  margin-top: 16px;
}

.suiyuan-card__title {
  margin: 0 0 12px;
  font-size: var(--text-base);
  font-weight: 800;
  text-align: center;
  color: var(--text);
  letter-spacing: -0.02em;
}

.suiyuan-card__desc {
  margin: 0 0 18px;
  font-size: var(--text-sm);
  color: var(--text-3);
  line-height: 1.5;
  text-align: center;
}

.suiyuan-range-readout {
  margin: 0 0 14px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-2);
  text-align: center;
  letter-spacing: 0.02em;
}

.suiyuan-slider-row {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 22px;
}

.suiyuan-slider-tick {
  font-size: var(--text-xs);
  color: var(--text-3);
  font-weight: 600;
  flex-shrink: 0;
}

.suiyuan-slider {
  flex: 1;
  height: 8px;
  border-radius: var(--radius-xs);
  accent-color: var(--brand);
  cursor: pointer;
}

.btn-suiyuan-cta {
  display: block;
  width: 100%;
  max-width: 280px;
  margin: 0 auto;
  padding: 14px 24px;
  text-align: center;
  border: none;
  border-radius: var(--radius-pill);
  background: var(--brand);
  color: #fff;
  font-size: var(--text-base);
  font-weight: 800;
  letter-spacing: 0.04em;
  cursor: pointer;
  box-shadow: 0 6px 20px rgba(91, 33, 182, 0.35);
  transition: transform 0.12s ease, filter 0.12s ease;
}

.btn-suiyuan-cta:active {
  transform: scale(0.98);
}

.suiyuan-dialog {
  position: fixed;
  inset: 0;
  z-index: 160;
  display: flex;
  align-items: stretch;
  justify-content: stretch;
  pointer-events: none;
  visibility: hidden;
}

.suiyuan-dialog.open {
  pointer-events: auto;
  visibility: visible;
}

.suiyuan-dialog__backdrop {
  position: absolute;
  inset: 0;
  /* 全屏紫底由 panel 承担，此处不叠灰幕，保持与随缘过场一致 */
  background: transparent;
  opacity: 0;
  transition: opacity 0.28s ease;
}

.suiyuan-dialog.open .suiyuan-dialog__backdrop {
  opacity: 1;
}

.suiyuan-dialog__panel {
  position: relative;
  z-index: 1;
  box-sizing: border-box;
  display: flex;
  flex-direction: column;
  width: 100%;
  min-height: 100%;
  min-height: 100dvh;
  max-width: none;
  margin: 0;
  padding: max(20px, var(--safe-top)) max(20px, env(safe-area-inset-right, 0px))
    calc(var(--safe-bottom) + 20px) max(20px, env(safe-area-inset-left, 0px));
  /* 与 .suiyuan-ritual__bg 同款紫底，沉浸式全屏 */
  background:
    radial-gradient(ellipse 130% 70% at 50% -15%, rgba(255, 255, 255, 0.14) 0%, transparent 52%),
    linear-gradient(168deg, var(--brand) 0%, #4a1a9e 48%, var(--brand-dark) 100%);
  color: rgba(255, 255, 255, 0.95);
  border-radius: 0;
  border: none;
  box-shadow: none;
  /* 显隐由 .suiyuan-dialog 的 visibility 控制，勿对 panel 做 opacity 过渡，否则过场结束与 .open 之间会闪出列表页 */
  overflow: auto;
  -webkit-overflow-scrolling: touch;
  isolation: isolate;
}

.suiyuan-dialog__panel::after {
  content: "";
  position: absolute;
  inset: 0;
  z-index: 0;
  background: radial-gradient(
    ellipse 85% 65% at 50% 48%,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0) 58%
  );
  pointer-events: none;
}

/* 随缘结果：文案层级近似 Apple HIG 深色模式 Label / secondaryLabel（sRGB，紫底未改） */
.suiyuan-dialog.open .suiyuan-dialog__panel .suiyuan-dialog__kicker {
  color: rgba(235, 235, 245, 0.88);
  letter-spacing: 0.08em;
  font-weight: 600;
}

.suiyuan-dialog.open .suiyuan-dialog__panel .suiyuan-dialog__name {
  /* 主结果：金色保持识别度，略提亮以接近 WCAG 大字对比 */
  color: #f7ecd4;
  text-shadow:
    0 0 28px rgba(255, 220, 160, 0.35),
    0 2px 12px rgba(25, 8, 55, 0.5);
}

.suiyuan-dialog.open .suiyuan-dialog__panel .suiyuan-dialog__meta {
  color: rgba(235, 235, 245, 0.72);
  font-weight: 500;
}

.suiyuan-dialog.open .suiyuan-dialog__panel .suiyuan-dialog__subtitle {
  color: rgba(235, 235, 245, 0.68);
}

.suiyuan-dialog.open .suiyuan-dialog__panel .suiyuan-dialog__empty-text {
  color: rgba(235, 235, 245, 0.78);
}

/* Prominent：白面 + 系统深灰字，近似 iOS 浅色面上的 label */
.suiyuan-dialog.open .suiyuan-dialog__panel .suiyuan-dialog__actions .btn-primary {
  background: #ffffff;
  color: #1c1c1e;
  border-color: rgba(0, 0, 0, 0.06);
  box-shadow:
    0 1px 0 rgba(255, 255, 255, 0.35) inset,
    0 4px 18px rgba(0, 0, 0, 0.22);
}

.suiyuan-dialog.open .suiyuan-dialog__panel .suiyuan-dialog__actions .btn-primary:active {
  filter: brightness(0.97);
}

/* Bordered / 材质：提高不透明度与描边，避免白字压在过低对比半透明上 */
.suiyuan-dialog.open .suiyuan-dialog__panel .suiyuan-dialog__actions .btn-secondary {
  background: rgba(245, 245, 247, 0.2);
  border-color: rgba(255, 255, 255, 0.48);
  color: #ffffff;
  font-weight: 600;
  -webkit-backdrop-filter: saturate(180%) blur(18px);
  backdrop-filter: saturate(180%) blur(18px);
  box-shadow: 0 1px 0 rgba(255, 255, 255, 0.12) inset;
}

.suiyuan-dialog.open .suiyuan-dialog__panel .suiyuan-dialog__actions .btn-secondary:active {
  background: rgba(245, 245, 247, 0.26);
}

@supports not ((-webkit-backdrop-filter: blur(1px)) or (backdrop-filter: blur(1px))) {
  .suiyuan-dialog.open .suiyuan-dialog__panel .suiyuan-dialog__actions .btn-secondary {
    background: rgba(255, 255, 255, 0.24);
  }
}

.suiyuan-dialog.open .suiyuan-dialog__panel .suiyuan-dialog__actions .btn-primary:focus-visible,
.suiyuan-dialog.open .suiyuan-dialog__panel .suiyuan-dialog__actions .btn-secondary:focus-visible {
  outline: 2px solid rgba(255, 255, 255, 0.95);
  outline-offset: 3px;
}

.suiyuan-dialog__close {
  position: absolute;
  top: max(10px, calc(var(--safe-top) + 6px));
  right: max(12px, env(safe-area-inset-right, 0px));
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--page-bg);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.suiyuan-dialog.open .suiyuan-dialog__close {
  background: rgba(245, 245, 247, 0.18);
  border-color: rgba(255, 255, 255, 0.45);
  color: #ffffff;
}

.suiyuan-dialog__close svg.lucide {
  stroke: currentColor;
}

.suiyuan-dialog__body {
  flex: 1;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  box-sizing: border-box;
  width: 100%;
  max-width: 22rem;
  margin-left: auto;
  margin-right: auto;
  padding: 48px 8px 8px;
  min-height: 0;
  position: relative;
  z-index: 1;
}

.suiyuan-dialog.open .suiyuan-dialog__body:not([hidden]) {
  animation: suiyuan-dialog-body-reveal 0.44s cubic-bezier(0.33, 1, 0.32, 1) 0.12s both;
}

@keyframes suiyuan-dialog-body-reveal {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .suiyuan-dialog.open .suiyuan-dialog__body:not([hidden]) {
    animation: none;
  }
}

/* [hidden] 会被上行的 display:flex 覆盖，必须显式隐藏其一 */
.suiyuan-dialog__body[hidden] {
  display: none !important;
}

.suiyuan-dialog__kicker {
  margin: 0 0 10px;
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--brand);
  letter-spacing: 0.06em;
  text-align: center;
}

.suiyuan-dialog__subtitle {
  margin: 0 0 18px;
  font-size: var(--text-sm);
  color: var(--text-3);
  text-align: center;
  line-height: 1.45;
}

.suiyuan-dialog__name {
  margin: 0 0 14px;
  font-size: clamp(1.35rem, 5.2vw, 1.85rem);
  font-weight: 800;
  line-height: 1.35;
  text-align: center;
  letter-spacing: -0.02em;
}

.suiyuan-dialog__meta {
  margin: 0 0 8px;
  font-size: var(--text-base);
  color: var(--text);
  text-align: center;
  line-height: 1.5;
}

.suiyuan-dialog__meta--muted {
  font-size: var(--text-sm);
  color: var(--text-2);
}

.suiyuan-dialog__empty-text {
  margin: 0 0 20px;
  font-size: var(--text-base);
  color: var(--text-2);
  text-align: center;
  line-height: 1.55;
}

.suiyuan-dialog__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 22px;
  width: 100%;
  max-width: min(272px, 100%);
  margin-left: auto;
  margin-right: auto;
  align-self: center;
}

.suiyuan-dialog__actions .btn-primary,
.suiyuan-dialog__actions .btn-secondary {
  margin: 0;
  width: 100%;
  min-height: 48px;
  padding: 12px 20px;
  box-sizing: border-box;
  display: flex;
  align-items: center;
  justify-content: center;
  font-family: inherit;
  font-size: var(--text-sm);
  font-weight: 700;
  letter-spacing: 0.02em;
  line-height: 1.25;
  border-radius: 999px;
}

/* 与次级按钮同厚 1px 外框，避免实心主按钮看起来比描边按钮「更高」 */
.suiyuan-dialog__actions .btn-primary {
  border: 1px solid transparent;
}

/* ─────────────────────────────────────────
   随缘过场 v7 · 紫色光波（与 index 中 __bg / __waves / __core-ring 对应）
   说明：此前 HTML 已换 v7，但 CSS 仍留 v6 类名，导致全屏纯黑、光波无样式。
───────────────────────────────────────── */

.suiyuan-ritual {
  position: fixed;
  inset: 0;
  z-index: 165;
  display: flex;
  align-items: center;
  justify-content: center;
  isolation: isolate;
  /* 兜底：与启动页一致，避免 __bg 未加载时纯黑 */
  background:
    radial-gradient(ellipse 130% 70% at 50% -15%, rgba(255, 255, 255, 0.14) 0%, transparent 52%),
    linear-gradient(168deg, var(--brand) 0%, #4a1a9e 48%, var(--brand-dark) 100%);
  opacity: 0;
  visibility: hidden;
  pointer-events: none;
  transition: opacity 1s cubic-bezier(0.4, 0, 0.2, 1), visibility 1s;
}

.suiyuan-ritual.suiyuan-ritual--visible {
  opacity: 1;
  visibility: visible;
  pointer-events: auto;
}

.suiyuan-ritual.suiyuan-ritual--visible.suiyuan-ritual--exit {
  opacity: 0;
  pointer-events: none;
  /* 与 js `SUIYUAN_RITUAL_EXIT_MS` 对齐：先打开同色全屏层再淡出，约 0.5s 叠化 */
  transition: opacity 0.5s cubic-bezier(0.33, 1, 0.32, 1), visibility 0.5s;
}

/* 与 .app-boot-splash 同款紫底（独立层，便于叠光效） */
.suiyuan-ritual__bg {
  position: absolute;
  inset: 0;
  z-index: 0;
  background:
    radial-gradient(ellipse 130% 70% at 50% -15%, rgba(255, 255, 255, 0.14) 0%, transparent 52%),
    linear-gradient(168deg, var(--brand) 0%, #4a1a9e 48%, var(--brand-dark) 100%);
  pointer-events: none;
}

/* 中心柔光：让「光波」在紫色上更醒目 */
.suiyuan-ritual__bg::after {
  content: "";
  position: absolute;
  inset: 0;
  background: radial-gradient(
    ellipse 85% 65% at 50% 48%,
    rgba(255, 255, 255, 0.12) 0%,
    rgba(255, 255, 255, 0) 58%
  );
  pointer-events: none;
}

/* ── 扩散光波（加粗白环 + 强发光，保证可见） ── */
.suiyuan-ritual__waves {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 1;
  width: 0;
  height: 0;
  pointer-events: none;
}

.suiyuan-ritual__wave {
  position: absolute;
  left: -120px;
  top: -120px;
  width: 240px;
  height: 240px;
  margin: 0;
  box-sizing: border-box;
  border-radius: 50%;
  border: 2px solid rgba(255, 255, 255, 0.6);
  box-shadow:
    0 0 0 1px rgba(255, 255, 255, 0.2),
    0 0 28px rgba(255, 255, 255, 0.3),
    0 0 56px rgba(200, 180, 255, 0.25);
  opacity: 0;
  animation: sr-wave-expand 4.5s cubic-bezier(0.22, 0.82, 0.28, 1) infinite;
  will-change: transform, opacity;
}

.suiyuan-ritual__wave--1 {
  animation-delay: 0s;
}
.suiyuan-ritual__wave--2 {
  animation-delay: 1.5s;
}
.suiyuan-ritual__wave--3 {
  animation-delay: 3s;
}

@keyframes sr-wave-expand {
  0% {
    transform: scale(0.35);
    opacity: 0;
  }
  20% {
    opacity: 0.65;
  }
  100% {
    transform: scale(5.2);
    opacity: 0;
    border-width: 1px;
  }
}

.suiyuan-ritual--locating .suiyuan-ritual__wave {
  animation-duration: 3.2s;
}
.suiyuan-ritual--locating .suiyuan-ritual__wave--1 {
  animation-delay: 0s;
}
.suiyuan-ritual--locating .suiyuan-ritual__wave--2 {
  animation-delay: 1.07s;
}
.suiyuan-ritual--locating .suiyuan-ritual__wave--3 {
  animation-delay: 2.13s;
}

/* ── SVG 旋转弧（粗线 + 投影） ── */
.suiyuan-ritual__core-ring {
  position: absolute;
  left: 50%;
  top: 50%;
  z-index: 2;
  width: min(78vmin, 340px);
  height: min(78vmin, 340px);
  transform: translate(-50%, -50%);
  pointer-events: none;
}

.suiyuan-ritual__core-ring svg {
  width: 100%;
  height: 100%;
  overflow: visible;
}

.suiyuan-ritual__circle-track {
  fill: none;
  stroke: rgba(255, 255, 255, 0.22);
  stroke-width: 2;
}

/* 周长 2π×98 ≈ 615 */
.suiyuan-ritual__circle-spin {
  fill: none;
  stroke: #fff;
  stroke-width: 3.5;
  stroke-linecap: round;
  stroke-dasharray: 150 465;
  filter: drop-shadow(0 0 12px rgba(255, 255, 255, 0.95));
  transform-origin: 100px 100px;
  transform-box: fill-box;
  animation: sr-ring-spin 3.2s linear infinite;
}

.suiyuan-ritual--locating .suiyuan-ritual__circle-spin {
  animation-duration: 1.85s;
  stroke-dasharray: 220 395;
}

@keyframes sr-ring-spin {
  to {
    transform: rotate(360deg);
  }
}

/* ── 正文 ── */
.suiyuan-ritual__body {
  position: relative;
  z-index: 3;
  display: flex;
  flex-direction: column;
  align-items: center;
  text-align: center;
  pointer-events: none;
  user-select: none;
}

.suiyuan-ritual__eyebrow {
  display: none;
}

.suiyuan-ritual--visible .suiyuan-ritual__eyebrow {
  animation: none;
}

.suiyuan-ritual__char {
  /* 单字：齐伋/书法体字形框内墨色常偏右，全宽 text-align + 略向左视学补偿 */
  --sr-char-nudge-x: -0.1em;
  margin: 0 0 24px;
  align-self: stretch;
  width: 100%;
  box-sizing: border-box;
  text-align: center;
  font-family: var(--font-masthead), var(--font);
  font-size: clamp(4.7rem, 18vmin, 7.8rem);
  font-weight: 400;
  line-height: 1;
  letter-spacing: 0;
  color: rgba(255, 255, 255, 0.98);
  text-shadow:
    0 0 48px rgba(255, 255, 255, 0.45),
    0 2px 16px rgba(0, 0, 0, 0.25);
  opacity: 0;
  transform: translate(var(--sr-char-nudge-x), -6px) scale(0.92);
}

.suiyuan-ritual--visible .suiyuan-ritual__char {
  animation: sr-char-in-light 1.35s cubic-bezier(0.16, 1, 0.3, 1) 0.04s forwards;
}

.suiyuan-ritual--locating.suiyuan-ritual--visible .suiyuan-ritual__char {
  animation:
    sr-char-in-light 1.25s cubic-bezier(0.16, 1, 0.3, 1) forwards,
    sr-char-breathe-light 3.2s ease-in-out 1.25s infinite;
}

@keyframes sr-char-in-light {
  from {
    opacity: 0;
    transform: translate(var(--sr-char-nudge-x), -6px) scale(0.88);
  }
  to {
    opacity: 1;
    transform: translate(var(--sr-char-nudge-x), -6px) scale(1);
  }
}

@keyframes sr-char-breathe-light {
  0%,
  100% {
    transform: translate(var(--sr-char-nudge-x), -6px) scale(1);
    text-shadow:
      0 0 48px rgba(255, 255, 255, 0.45),
      0 2px 16px rgba(0, 0, 0, 0.25);
  }
  50% {
    transform: translate(var(--sr-char-nudge-x), -6px) scale(1.04);
    text-shadow:
      0 0 72px rgba(255, 255, 255, 0.65),
      0 2px 16px rgba(0, 0, 0, 0.25);
  }
}

.suiyuan-ritual__verse {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 10px;
}

.suiyuan-ritual__line {
  margin: 0;
  font-size: 13px;
  font-weight: 450;
  letter-spacing: 0.22em;
  line-height: 1.55;
  color: rgba(255, 255, 255, 0.88);
  opacity: 0;
  transform: translateY(10px);
}

.suiyuan-ritual__line--dim {
  font-size: 12px;
  color: rgba(255, 255, 255, 0.55);
}

.suiyuan-ritual--visible .suiyuan-ritual__verse .suiyuan-ritual__line:nth-child(1) {
  animation: sr-fade-up-light 1s cubic-bezier(0.16, 1, 0.3, 1) 0.45s forwards;
}

.suiyuan-ritual--visible .suiyuan-ritual__verse .suiyuan-ritual__line:nth-child(2) {
  animation: sr-fade-up-light 1s cubic-bezier(0.16, 1, 0.3, 1) 0.72s forwards;
}

@keyframes sr-fade-up-light {
  from {
    opacity: 0;
    transform: translateY(12px);
  }
  to {
    opacity: 1;
    transform: translateY(0);
  }
}

@media (prefers-reduced-motion: reduce) {
  .suiyuan-ritual__wave,
  .suiyuan-ritual__circle-spin,
  .suiyuan-ritual--visible .suiyuan-ritual__eyebrow,
  .suiyuan-ritual--visible .suiyuan-ritual__char,
  .suiyuan-ritual--locating.suiyuan-ritual--visible .suiyuan-ritual__char,
  .suiyuan-ritual--visible .suiyuan-ritual__verse .suiyuan-ritual__line {
    animation: none !important;
  }

  .suiyuan-ritual--visible .suiyuan-ritual__eyebrow,
  .suiyuan-ritual--visible .suiyuan-ritual__verse .suiyuan-ritual__line {
    opacity: 1;
    transform: none;
  }

  .suiyuan-ritual--visible .suiyuan-ritual__char {
    opacity: 1;
    transform: translate(var(--sr-char-nudge-x), -6px);
  }
}
/* 官方道观：地址错误上报（须高于 .sheet z-index:111） */
.address-report-dialog {
  position: fixed;
  inset: 0;
  z-index: 175;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
}

.address-report-dialog.open {
  pointer-events: auto;
  visibility: visible;
}

.address-report-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 25, 0.45);
  opacity: 0;
  transition: opacity 0.28s ease;
}

.address-report-dialog.open .address-report-dialog__backdrop {
  opacity: 1;
}

.address-report-dialog__panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 20px 20px calc(var(--safe-bottom) + 20px);
  background: var(--surface);
  border-radius: var(--radius-sheet-top) var(--radius-sheet-top) 0 0;
  border: 1px solid var(--line);
  border-bottom: none;
  box-shadow: 0 -12px 40px rgba(0, 0, 0, 0.14);
  transform: translateY(100%);
  transition: transform var(--dur) var(--ease);
  max-height: min(85vh, 560px);
  overflow: auto;
  -webkit-overflow-scrolling: touch;
}

.address-report-dialog.open .address-report-dialog__panel {
  transform: translateY(0);
}

/* 提交新地点：飞书问卷弹窗 — 门头下缘至屏幕底，问卷区尽量占满 */
.address-report-dialog.address-report-dialog--feishu {
  align-items: stretch;
  justify-content: flex-start;
}

.address-report-dialog.address-report-dialog--feishu .address-report-dialog__panel--feishu-embed {
  position: fixed;
  left: 0;
  right: 0;
  bottom: 0;
  top: calc(var(--safe-top) + var(--app-masthead-below-safe));
  box-sizing: border-box;
  width: 100%;
  min-width: 100%;
  max-width: none;
  margin: 0;
  max-height: none;
  height: auto;
  border-radius: var(--radius-md) var(--radius-md) 0 0;
  padding: 12px 0 calc(var(--safe-bottom) + 12px);
  padding-left: env(safe-area-inset-left, 0px);
  padding-right: env(safe-area-inset-right, 0px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
  transform: translateY(100%);
  transition: transform var(--dur) var(--ease);
  box-shadow: 0 -12px 44px rgba(0, 0, 0, 0.2);
  border: 1px solid var(--line);
  border-bottom: none;
}

.address-report-dialog.address-report-dialog--feishu.open .address-report-dialog__panel--feishu-embed {
  transform: translateY(0);
}

.address-report-dialog__close {
  position: absolute;
  top: 10px;
  right: 12px;
  width: 40px;
  height: 40px;
  border: 1px solid var(--line);
  border-radius: var(--radius-pill);
  background: var(--page-bg);
  color: var(--text-2);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
}

.address-report-dialog__close svg.lucide {
  stroke: currentColor;
}

.address-report-dialog__body {
  padding-top: 8px;
  padding-right: 44px;
}

.address-report-dialog__body--feishu-embed {
  display: flex;
  flex-direction: column;
  flex: 1;
  min-height: 0;
  overflow: hidden;
  padding-top: 4px;
  padding-left: 16px;
  padding-right: 44px;
}

.address-report-dialog__body--feishu-embed .address-report-dialog__subtitle {
  flex-shrink: 0;
  margin-bottom: 10px;
}

.submit-location-embed-wrap {
  flex: 1;
  min-height: 0;
  display: flex;
  flex-direction: column;
  border-radius: var(--radius-md);
  overflow: hidden;
  border: 1px solid var(--line);
  background: var(--page-bg);
}

/* 问卷 iframe 与面板同宽：抵消标题区左右内边距，避免中间「窄条」观感 */
.address-report-dialog--feishu .address-report-dialog__body--feishu-embed .submit-location-embed-wrap {
  margin-left: -16px;
  margin-right: -44px;
  width: calc(100% + 16px + 44px);
  max-width: none;
  border-radius: 0;
  border-left: none;
  border-right: none;
}

.submit-location-iframe {
  flex: 1;
  width: 100%;
  min-height: 0;
  border: 0;
  background: var(--surface);
}

.address-report-dialog--feishu .submit-location-iframe {
  /* 部分环境下 iframe 不参与 flex 伸缩，保底高度 */
  min-height: min(65dvh, 640px);
  height: 100%;
}

.address-report-dialog__kicker {
  margin: 0 0 6px;
  font-size: var(--text-lg);
  font-weight: 800;
  color: var(--brand);
  letter-spacing: -0.02em;
}

.address-report-dialog__subtitle {
  margin: 0 0 14px;
  font-size: var(--text-sm);
  color: var(--text-3);
  line-height: 1.45;
}

.address-report-dialog__readonly {
  margin: 0 0 16px;
  padding: 12px 14px;
  border-radius: var(--radius-md);
  background: var(--page-bg);
  border: 1px solid var(--line);
  font-size: var(--text-sm);
}

.address-report-dialog__readonly dt {
  margin: 0;
  color: var(--text-3);
  font-weight: 600;
}

.address-report-dialog__readonly dd {
  margin: 2px 0 10px;
  color: var(--text);
  line-height: 1.45;
}

.address-report-dialog__readonly dd:last-of-type {
  margin-bottom: 0;
}

.address-report-dialog__label {
  display: block;
  margin: 0 0 6px;
  font-size: var(--text-sm);
  font-weight: 700;
  color: var(--text-2);
}

.address-report-dialog__textarea {
  width: 100%;
  box-sizing: border-box;
  margin: 0 0 12px;
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: var(--radius-md);
  background: var(--page-bg);
  color: var(--text);
  font-size: var(--text-base);
  font-family: inherit;
  line-height: 1.45;
  resize: vertical;
  min-height: 44px;
}

.address-report-dialog__textarea:focus-visible {
  outline: 2px solid var(--brand);
  outline-offset: 1px;
}

.address-report-dialog__error {
  margin: 0 0 12px;
  font-size: var(--text-sm);
  color: #b91c1c;
}

html[data-theme="dark"] .address-report-dialog__error {
  color: #fca5a5;
}

.address-report-dialog__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
  margin-top: 4px;
}

.address-report-dialog__actions .btn-primary,
.address-report-dialog__actions .btn-secondary {
  width: 100%;
  min-height: 48px;
}

.sheet-address-contributors {
  margin-top: 10px;
  padding: 10px 12px;
  border-radius: 10px;
  border: 1px solid rgba(212, 175, 55, 0.22);
  background: rgba(212, 175, 55, 0.06);
}

.sheet-address-contributors__label {
  margin: 0 0 6px;
  font-size: var(--text-xs);
  font-weight: 600;
  letter-spacing: 0.06em;
  line-height: var(--leading-snug);
  text-transform: uppercase;
  color: var(--muted, #8b93a5);
}

.sheet-address-contributors__ids {
  margin: 0;
  font-size: var(--text-sm);
  line-height: var(--leading-ui);
  color: var(--text, #e9ecf1);
}

.sheet-address-contributors__id {
  font-family: ui-monospace, Consolas, monospace;
  font-size: var(--text-sm);
  line-height: var(--leading-ui);
  color: var(--accent, #d4af37);
}

.sheet-address-contributors__sep {
  color: var(--muted, #8b93a5);
  font-family: inherit;
}

/* 成就分享图预览（移动端需在用户点击后再调 Web Share / 下载，故用弹层承接手势） */
/* z-index 须高于 .toast(200)，否则底部 Toast 会盖住同区域的底栏式预览 */
.ach-share-dialog {
  position: fixed;
  inset: 0;
  z-index: 250;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  pointer-events: none;
  visibility: hidden;
}

.ach-share-dialog.open {
  pointer-events: auto;
  visibility: visible;
}

.ach-share-dialog__backdrop {
  position: absolute;
  inset: 0;
  background: rgba(15, 18, 25, 0.38);
  opacity: 0;
  transition: opacity 0.28s ease;
  -webkit-backdrop-filter: blur(18px) saturate(1.15);
  backdrop-filter: blur(18px) saturate(1.15);
}

.ach-share-dialog.open .ach-share-dialog__backdrop {
  opacity: 1;
}

.ach-share-dialog__panel {
  position: relative;
  width: 100%;
  max-width: 420px;
  margin: 0 auto;
  padding: 0;
  display: flex;
  flex-direction: column;
  background: var(--surface);
  border-radius: var(--radius-sheet-top) var(--radius-sheet-top) 0 0;
  border: 1px solid var(--line);
  border-bottom: none;
  box-shadow:
    0 -1px 0 rgba(255, 255, 255, 0.06) inset,
    0 -24px 48px rgba(0, 0, 0, 0.12);
  transform: translateY(100%);
  transition: transform var(--dur) var(--ease);
  max-height: min(88vh, 640px);
  overflow: hidden;
  -webkit-overflow-scrolling: touch;
}

.ach-share-dialog__hero {
  position: relative;
  flex-shrink: 0;
  padding: 8px 16px 14px;
  background: linear-gradient(165deg, #7029c0 0%, var(--masthead-bg) 42%, var(--brand-dark) 100%);
  border-radius: calc(var(--radius-sheet-top) - 1px) calc(var(--radius-sheet-top) - 1px) 0 0;
}

.ach-share-dialog__grab {
  width: 40px;
  height: 5px;
  margin: 0 auto 10px;
  border-radius: var(--radius-handle);
  background: rgba(255, 255, 255, 0.38);
  box-shadow: 0 1px 2px rgba(0, 0, 0, 0.12);
}

.ach-share-dialog__masthead {
  display: flex;
  justify-content: center;
  padding: 2px 40px 0 8px;
}

.ach-share-dialog__masthead-row {
  --ach-dialog-brand-size: 28px;
  --ach-dialog-brand-lh: 1.2;
  --ach-dialog-vrule-h: calc(var(--ach-dialog-brand-size) * var(--ach-dialog-brand-lh));
  display: flex;
  flex-direction: row;
  align-items: center;
  justify-content: center;
  flex-wrap: nowrap;
  gap: 0.38em;
  max-width: 100%;
  min-width: 0;
}

.ach-share-dialog__masthead-left {
  display: flex;
  flex-direction: row;
  align-items: center;
  flex-shrink: 0;
  gap: 0.32em;
}

.ach-share-dialog__masthead-brand {
  flex-shrink: 0;
  font-family: var(--font-masthead);
  font-weight: 400;
  font-size: var(--ach-dialog-brand-size);
  letter-spacing: 0.1em;
  line-height: var(--ach-dialog-brand-lh);
  color: var(--masthead-title-color);
  text-shadow:
    0 1px 0 rgba(0, 0, 0, 0.55),
    0 2px 10px rgba(0, 0, 0, 0.35);
}

.ach-share-dialog__masthead-vrule {
  flex-shrink: 0;
  width: 1px;
  height: var(--ach-dialog-vrule-h);
  border-radius: 1px;
  background: linear-gradient(
    180deg,
    rgba(255, 255, 255, 0) 0%,
    rgba(255, 255, 255, 0.42) 14%,
    rgba(255, 255, 255, 0.72) 50%,
    rgba(255, 255, 255, 0.42) 86%,
    rgba(255, 255, 255, 0) 100%
  );
  box-shadow: 0 0 8px rgba(255, 255, 255, 0.12);
}

.ach-share-dialog__masthead-subcol {
  flex: 0 1 auto;
  min-width: 0;
  display: flex;
  flex-direction: column;
  justify-content: center;
  align-items: stretch;
  gap: calc(var(--ach-dialog-brand-size) * 0.06);
  height: var(--ach-dialog-vrule-h);
  box-sizing: border-box;
}

.ach-share-dialog__masthead-sub {
  display: block;
  width: 100%;
  font-family: var(--font);
  font-weight: 500;
  font-size: calc(var(--ach-dialog-brand-size) * 0.42);
  letter-spacing: 0.045em;
  line-height: 1.18;
  color: rgba(255, 255, 255, 0.9);
  text-align: left;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  text-shadow: 0 1px 5px rgba(0, 0, 0, 0.28);
}

.ach-share-dialog__masthead-url {
  display: block;
  width: 100%;
  font-family: var(--font);
  font-weight: 500;
  font-size: calc(var(--ach-dialog-brand-size) * 0.3);
  line-height: 1.15;
  color: rgba(255, 255, 255, 0.68);
  text-align: left;
  text-shadow: 0 1px 4px rgba(0, 0, 0, 0.2);
}

.ach-share-dialog__body {
  flex: 1;
  min-height: 0;
  overflow: auto;
  padding: 16px 20px calc(var(--safe-bottom) + 20px);
  -webkit-overflow-scrolling: touch;
}

.ach-share-dialog.open .ach-share-dialog__panel {
  transform: translateY(0);
}

.ach-share-dialog__close {
  position: absolute;
  top: 8px;
  right: 10px;
  width: 36px;
  height: 36px;
  border: 1px solid rgba(255, 255, 255, 0.38);
  border-radius: var(--radius-pill);
  background: rgba(255, 255, 255, 0.14);
  color: rgba(255, 255, 255, 0.95);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  z-index: 2;
  -webkit-backdrop-filter: blur(10px);
  backdrop-filter: blur(10px);
  transition: background 0.2s ease, border-color 0.2s ease, transform 0.12s ease;
}

.ach-share-dialog__close:hover {
  background: rgba(255, 255, 255, 0.22);
  border-color: rgba(255, 255, 255, 0.5);
}

.ach-share-dialog__close:active {
  transform: scale(0.94);
}

.ach-share-dialog__close svg.lucide {
  stroke: currentColor;
}

.ach-share-dialog__title {
  margin: 0 0 6px;
  font-size: var(--text-lg);
  font-weight: 600;
  color: var(--text);
  letter-spacing: -0.022em;
  text-align: center;
}

.ach-share-dialog__sub {
  margin: 0 0 14px;
  font-size: var(--text-sm);
  color: var(--text-2);
  text-align: center;
  line-height: 1.47;
}

.ach-share-dialog__img-wrap {
  margin: 0 auto 16px;
  max-height: min(52vh, 420px);
  overflow: auto;
  border-radius: var(--radius-md);
  border: 1px solid var(--line);
  background: var(--page-bg);
  box-shadow: var(--shadow-rest);
  -webkit-overflow-scrolling: touch;
}

.ach-share-dialog__img {
  display: block;
  width: 100%;
  height: auto;
  vertical-align: top;
  user-select: none;
  -webkit-user-select: none;
  -webkit-touch-callout: default;
}

.ach-share-dialog__actions {
  display: flex;
  flex-direction: column;
  gap: 10px;
}

.ach-share-dialog__actions .btn-primary,
.ach-share-dialog__actions .btn-secondary {
  width: 100%;
  min-height: 48px;
}
