/* ============================================================
   爬山趣 · 山水宣纸设计系统
   宣纸暖白 × 松墨绿 × 朱砂印 × 楷体题字
   ============================================================ */
:root {
  /* 墨色系 */
  --ink: #22322b;
  --ink-2: #5d6e66;
  --ink-3: #8fa098;
  --pine: #1e4d3b;
  --pine-deep: #123527;
  --pine-soft: #3d7a5f;
  --pine-tint: #e9f1ec;
  --cinnabar: #b8442c;
  --cinnabar-deep: #96351d;
  --gold: #b08b3e;
  /* 纸色系 */
  --paper: #f4f2ea;
  --paper-warm: #faf8f2;
  --card: #fffefa;
  --line: rgba(34, 50, 43, .10);
  --line-soft: rgba(34, 50, 43, .06);
  --danger: #b8442c;
  --radius: 16px;
  --radius-lg: 22px;
  --shadow-sm: 0 1px 2px rgba(28, 44, 36, .05), 0 4px 14px -6px rgba(28, 44, 36, .08);
  --shadow-md: 0 2px 4px rgba(28, 44, 36, .05), 0 12px 32px -10px rgba(28, 44, 36, .14);
  --shadow-lg: 0 4px 8px rgba(28, 44, 36, .06), 0 24px 48px -16px rgba(28, 44, 36, .22);
  --serif: "Kaiti SC", STKaiti, KaiTi, "Noto Serif SC", "Source Han Serif SC", "Songti SC", SimSun, serif;
}

* { margin: 0; padding: 0; box-sizing: border-box; -webkit-tap-highlight-color: transparent; }

html { font-size: 16px; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Source Han Sans SC", "Noto Sans SC", "Microsoft YaHei", sans-serif;
  background: #e9e6dc;
  color: var(--ink);
  line-height: 1.65;
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
}

::selection { background: rgba(30, 77, 59, .18); }

#app {
  max-width: 520px;
  margin: 0 auto;
  min-height: 100vh;
  background:
    radial-gradient(1200px 500px at 50% -200px, rgba(30, 77, 59, .05), transparent 60%),
    var(--paper);
  position: relative;
  box-shadow: 0 0 60px rgba(28, 44, 36, .16);
}

.page {
  position: relative;
  z-index: 1;
  padding: 20px 18px calc(100px + env(safe-area-inset-bottom));
  animation: pageIn .32s cubic-bezier(.2, .8, .3, 1) both;
}
.page-watermark {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  height: 108px;
  z-index: 0;
  pointer-events: none;
}
@keyframes pageIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

button { font-family: inherit; border: none; background: none; cursor: pointer; color: inherit; }
a { color: inherit; text-decoration: none; }
ul { list-style: none; }

:focus-visible { outline: 2px solid var(--pine-soft); outline-offset: 2px; border-radius: 4px; }

/* 滚动条 */
::-webkit-scrollbar { width: 4px; height: 4px; }
::-webkit-scrollbar-thumb { background: rgba(34, 50, 43, .18); border-radius: 999px; }
::-webkit-scrollbar-track { background: transparent; }

/* ============ 通用组件 ============ */
.section-title {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  margin: 30px 0 14px;
  font-size: 16.5px;
  font-weight: 700;
  letter-spacing: .04em;
  position: relative;
  padding-left: 13px;
}
.section-title::before {
  content: "";
  position: absolute;
  left: 0;
  top: 4px;
  bottom: 4px;
  width: 3.5px;
  border-radius: 2px;
  background: linear-gradient(180deg, var(--cinnabar), var(--cinnabar-deep));
}
.section-title small { font-size: 11.5px; color: var(--ink-3); font-weight: 400; letter-spacing: .02em; }

.card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 10px 20px;
  border-radius: 12px;
  font-size: 14px;
  font-weight: 600;
  letter-spacing: .03em;
  transition: transform .12s ease, box-shadow .15s ease, background .15s ease;
}
.btn:active { transform: scale(.96); }
.btn-primary {
  background: var(--pine);
  color: #f5f2e8;
  box-shadow: 0 4px 14px -4px rgba(18, 53, 39, .45);
}
.btn-primary:active { background: var(--pine-deep); }
.btn-ghost {
  background: transparent;
  color: var(--pine);
  border: 1px solid rgba(30, 77, 59, .35);
}
.btn-ghost:active { background: var(--pine-tint); }
.btn-block { width: 100%; padding: 13px; font-size: 15px; }
.btn-danger-ghost { background: transparent; color: var(--danger); border: 1px solid rgba(184, 68, 44, .35); }
.btn-danger-ghost:active { background: rgba(184, 68, 44, .07); }

.chip {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 6px 14px;
  border-radius: 999px;
  background: var(--card);
  color: var(--ink-2);
  font-size: 12.5px;
  font-weight: 500;
  letter-spacing: .02em;
  white-space: nowrap;
  transition: all .15s ease;
  cursor: pointer;
  border: 1px solid var(--line);
  box-shadow: 0 1px 2px rgba(28, 44, 36, .04);
}
.chip.on {
  background: var(--pine);
  color: #f5f2e8;
  border-color: var(--pine);
  box-shadow: 0 4px 10px -4px rgba(18, 53, 39, .5);
}

.chips-row {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: none;
}
.chips-row::-webkit-scrollbar { display: none; }

.badge {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  padding: 2.5px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--pine-tint);
  color: var(--pine);
  letter-spacing: .03em;
}

.stars { color: var(--gold); letter-spacing: 1.5px; font-size: 12.5px; }

.linklike {
  font: inherit;
  font-weight: 700;
  color: var(--pine);
  padding: 0;
  border-bottom: 1px dashed rgba(30, 77, 59, .4);
}

.empty {
  text-align: center;
  padding: 48px 22px;
  color: var(--ink-3);
  font-size: 13.5px;
  letter-spacing: .04em;
}
.empty .ink-mini {
  width: 170px;
  height: auto;
  display: block;
  margin: 0 auto 12px;
  opacity: .92;
}
.empty .btn { margin-top: 16px; }

/* ============ 底部导航 ============ */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  display: grid;
  grid-template-columns: 1fr 1fr auto 1fr 1fr;
  align-items: end;
  background: rgba(250, 248, 242, .88);
  backdrop-filter: blur(18px) saturate(1.4);
  -webkit-backdrop-filter: blur(18px) saturate(1.4);
  border-top: 1px solid var(--line-soft);
  padding: 7px 10px calc(9px + env(safe-area-inset-bottom));
  z-index: 50;
  transition: transform .25s ease;
}
.tabbar.hidden { transform: translateX(-50%) translateY(110%); }

.tab {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2.5px;
  font-size: 10.5px;
  color: var(--ink-3);
  font-weight: 500;
  letter-spacing: .06em;
  padding: 3px 0;
  position: relative;
  transition: color .15s ease;
}
.tab svg {
  width: 22px;
  height: 22px;
  fill: none;
  stroke: currentColor;
  stroke-width: 1.7;
  stroke-linecap: round;
  stroke-linejoin: round;
  transition: transform .18s cubic-bezier(.2, .8, .3, 1.4);
}
.tab.on { color: var(--pine); font-weight: 700; }
.tab.on svg { transform: translateY(-1.5px); stroke-width: 2; }
.tab.on::after {
  content: "";
  position: absolute;
  top: -8px;
  width: 14px;
  height: 2.5px;
  border-radius: 999px;
  background: var(--cinnabar);
}

.fab {
  width: 52px;
  height: 52px;
  margin: 0 12px -18px;
  border-radius: 15px;
  background: var(--cinnabar);
  color: #faf6ee;
  box-shadow: 0 8px 20px -6px rgba(150, 53, 29, .55), inset 0 0 0 1.5px rgba(250, 246, 238, .28), inset 0 0 0 4px var(--cinnabar);
  display: flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-3deg);
  transition: transform .15s ease;
}
.fab:active { transform: rotate(-3deg) scale(.92); }
.fab svg { width: 24px; height: 24px; stroke: #faf6ee; stroke-width: 2.4; stroke-linecap: round; }

/* ============ 首页 ============ */
.hero {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  color: #f6f3e9;
  box-shadow: var(--shadow-lg);
  background: var(--pine-deep);
}
.hero .scene-wrap {
  position: relative;
  aspect-ratio: 2 / 1;   /* 千里江山图 960x480，防止绝对定位内容导致高度塌缩 */
  min-height: 190px;
}
/* 千里江山图 LQIP 极小占位（40x20 webp 放大 + 模糊） */
.painting-lqip {
  position: absolute;
  inset: 0;
  background-size: cover;
  background-position: center;
  filter: blur(10px);
  transform: scale(1.06);
}
.painting-lqip + img { position: relative; }

.hero .painting {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  object-position: center 62%;
  filter: saturate(.96);
  opacity: 0;
  transition: opacity .6s ease;
}
.hero .painting.loaded { opacity: 1; }
@media (prefers-reduced-motion: reduce) {
  .hero .painting { opacity: 1; transition: none; }
}
.hero .hero-attribution {
  position: absolute;
  right: 12px;
  bottom: 9px;
  z-index: 3;
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: .12em;
  color: rgba(250, 248, 242, .6);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
  pointer-events: none;
}
.hero .hero-content {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 24px 22px 18px;
  display: flex;
  flex-direction: column;
  background: linear-gradient(180deg, rgba(10, 26, 19, .5) 0%, rgba(10, 26, 19, .08) 45%, rgba(10, 26, 19, .6) 100%);
}
.hero h1 {
  font-family: var(--serif);
  font-size: 34px;
  font-weight: 400;
  letter-spacing: .18em;
  margin-top: 14px;
  text-shadow: 0 2px 14px rgba(0, 0, 0, .35);
}
.hero .slogan {
  font-family: var(--serif);
  font-size: 13px;
  letter-spacing: .32em;
  opacity: .8;
  margin-top: 4px;
}
.hero .near-line {
  margin-top: auto;
  align-self: center;
  font-size: 11.5px;
  letter-spacing: .05em;
  background: rgba(250, 248, 242, .13);
  border: 1px solid rgba(250, 248, 242, .2);
  border-radius: 999px;
  padding: 4px 15px;
  backdrop-filter: blur(6px);
}

.scene { display: block; width: 100%; height: auto; }

/* 实景照片层（覆盖 SVG 山景，onerror 自动移除兜底） */
.art .photo,
.detail-hero .scene-wrap .photo {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: saturate(.94);
}
.detail-hero .scene-wrap .photo {
  animation: photoIn .5s ease both;
}
@keyframes photoIn { from { opacity: 0; } }

/* 山峰卡片 */
.m-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 14px; }

.m-card {
  background: var(--card);
  border-radius: var(--radius);
  border: 1px solid var(--line-soft);
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: transform .16s ease, box-shadow .16s ease;
  cursor: pointer;
}
.m-card:active { transform: scale(.97); box-shadow: var(--shadow-sm); }
.m-card .art { position: relative; height: 108px; overflow: hidden; }
.m-card .art .scene { width: 100%; height: 100%; object-fit: cover; }
.m-card .art .elev-tag {
  position: absolute;
  right: 8px;
  bottom: 8px;
  background: rgba(12, 24, 18, .55);
  backdrop-filter: blur(4px);
  color: #f2efe4;
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .05em;
  padding: 2px 9px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.m-card .art .dist-tag {
  position: absolute;
  left: 8px;
  top: 8px;
  background: rgba(250, 248, 242, .9);
  backdrop-filter: blur(4px);
  color: var(--pine);
  font-size: 10.5px;
  font-weight: 700;
  padding: 2px 9px;
  border-radius: 999px;
  font-variant-numeric: tabular-nums;
}
.m-card .body { padding: 11px 13px 13px; }
.m-card .name { font-size: 15px; font-weight: 700; display: flex; align-items: center; gap: 5px; letter-spacing: .04em; }
.m-card .loc { font-size: 11px; color: var(--ink-3); margin-top: 2px; letter-spacing: .05em; }
.m-card .meta {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 8px;
  font-size: 11px;
  color: var(--ink-3);
}

.diff-dots { display: inline-flex; gap: 2.5px; align-items: center; }
.diff-dots i {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: #dde5dd;
}
.diff-dots i.lit { background: var(--pine-soft); }
.diff-dots.d3 i.lit { background: #cf8a2e; }
.diff-dots.d4 i.lit, .diff-dots.d5 i.lit { background: var(--cinnabar); }

/* 横向推荐 */
.h-scroll {
  display: flex;
  gap: 12px;
  overflow-x: auto;
  padding: 2px 2px 12px;
  scrollbar-width: none;
}
.h-scroll::-webkit-scrollbar { display: none; }
.m-mini {
  flex: 0 0 156px;
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--card);
  border: 1px solid var(--line-soft);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .15s ease;
}
.m-mini:active { transform: scale(.96); }
.m-mini .art { height: 86px; overflow: hidden; position: relative; }
.m-mini .art .scene { width: 100%; height: 100%; object-fit: cover; }
.m-mini .body { padding: 9px 12px 11px; }
.m-mini .name { font-size: 13.5px; font-weight: 700; letter-spacing: .03em; }
.mini-done { font-size: 11px; }
.m-mini .sub {
  font-size: 10.5px;
  color: var(--ink-3);
  margin-top: 2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  letter-spacing: .02em;
}

/* 打卡动态 */
.feed-item {
  display: flex;
  gap: 13px;
  padding: 14px 15px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  margin-bottom: 11px;
}
.feed-item .ava {
  width: 40px;
  height: 40px;
  flex-shrink: 0;
  border-radius: 12px;
  background: var(--pine-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.feed-item .txt { flex: 1; min-width: 0; }
.feed-item .line1 { font-size: 13.5px; letter-spacing: .02em; }
.feed-item .line1 b { font-weight: 700; }
.feed-item .notes {
  font-size: 12.5px;
  color: var(--ink-2);
  margin-top: 4px;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.feed-item .meta-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-top: 6px;
  font-size: 11px;
  color: var(--ink-3);
  font-variant-numeric: tabular-nums;
}
.feed-item .del {
  color: #bcc8c1;
  padding: 2px 7px;
  font-size: 14px;
  line-height: 1;
  border-radius: 8px;
  transition: color .12s ease;
}
.feed-item .del:hover { color: var(--danger); }

/* ============ 发现 ============ */
.search-bar {
  display: flex;
  align-items: center;
  gap: 10px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 14px;
  box-shadow: var(--shadow-sm);
  padding: 11px 14px;
  margin-bottom: 14px;
}
.search-bar svg {
  width: 17px;
  height: 17px;
  stroke: var(--ink-3);
  fill: none;
  stroke-width: 2;
  stroke-linecap: round;
  flex-shrink: 0;
}
.search-bar input {
  flex: 1;
  border: none;
  outline: none;
  font-size: 14px;
  font-family: inherit;
  background: transparent;
  color: var(--ink);
  letter-spacing: .02em;
}
.search-bar input::placeholder { color: var(--ink-3); }

.loc-btn {
  display: inline-flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
  padding: 4px 9px;
  border-radius: 11px;
  color: var(--ink-3);
  background: var(--paper-warm);
  border: 1px solid var(--line);
  flex-shrink: 0;
  transition: all .15s ease;
}
.loc-btn span { font-size: 15px; line-height: 1.1; }
.loc-btn small { font-size: 9px; font-weight: 700; letter-spacing: .05em; }
.loc-btn.on {
  color: var(--pine);
  background: var(--pine-tint);
  border-color: rgba(30, 77, 59, .4);
}

/* 定位引导横幅 */
.loc-banner {
  display: flex;
  align-items: center;
  gap: 12px;
  background: linear-gradient(135deg, #eef4ec, #e2ede4);
  border: 1px solid rgba(30, 77, 59, .22);
  border-radius: var(--radius);
  padding: 13px 15px;
  margin-bottom: 16px;
}
.loc-banner .lb-icon {
  font-size: 22px;
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--card);
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  box-shadow: var(--shadow-sm);
}
.loc-banner .lb-txt { flex: 1; min-width: 0; }
.loc-banner .lb-txt b { display: block; font-size: 13.5px; font-weight: 700; color: var(--pine-deep); letter-spacing: .03em; }
.loc-banner .lb-txt small { display: block; font-size: 11px; color: var(--ink-2); line-height: 1.5; }
.loc-banner .lb-btn { padding: 8px 14px; font-size: 12.5px; flex-shrink: 0; }
.loc-banner[data-status="denied"] {
  background: #f7efe3;
  border-color: rgba(176, 139, 62, .4);
}

/* 详情页距离横幅 */
.dist-banner {
  margin-top: 14px;
  background: linear-gradient(135deg, #eef4ec, #e2ede4);
  border: 1px solid rgba(30, 77, 59, .18);
  border-radius: 14px;
  padding: 11px 15px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 12.5px;
  color: var(--pine-deep);
  letter-spacing: .02em;
}
.dist-banner b { font-size: 14px; color: var(--pine); font-variant-numeric: tabular-nums; }
.dist-banner.dim {
  background: var(--paper-warm);
  border-color: var(--line);
  color: var(--ink-3);
}

/* ============ 山峰详情 ============ */
.detail-hero { position: relative; border-radius: var(--radius-lg); overflow: hidden; box-shadow: var(--shadow-lg); }
.detail-hero .scene-wrap { position: relative; }
.detail-hero .overlay {
  position: absolute;
  inset: 0;
  z-index: 2;
  padding: 18px 20px 16px;
  display: flex;
  flex-direction: column;
  color: #f6f3e9;
  background: linear-gradient(180deg, rgba(10, 26, 19, .45), rgba(10, 26, 19, .05) 40%, rgba(10, 26, 19, .65));
}
.detail-hero .back-btn {
  align-self: flex-start;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(250, 248, 242, .18);
  backdrop-filter: blur(8px);
  display: flex;
  align-items: center;
  justify-content: center;
}
.detail-hero .back-btn svg { width: 18px; height: 18px; stroke: #f6f3e9; fill: none; stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.detail-hero .d-title { margin-top: auto; }
.detail-hero h1 {
  font-family: var(--serif);
  font-size: 30px;
  font-weight: 400;
  letter-spacing: .14em;
  text-shadow: 0 2px 12px rgba(0, 0, 0, .35);
}
.detail-hero .d-sub { font-size: 12px; opacity: .9; letter-spacing: .06em; }
.detail-hero .d-tags { display: flex; gap: 6px; margin-top: 10px; flex-wrap: wrap; }
.detail-hero .d-tags span {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .05em;
  background: rgba(250, 248, 242, .14);
  border: 1px solid rgba(250, 248, 242, .26);
  padding: 2.5px 11px;
  border-radius: 999px;
  backdrop-filter: blur(4px);
}

.stat-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 16px;
}
.stat-strip .st {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  box-shadow: var(--shadow-sm);
  text-align: center;
  padding: 11px 4px 10px;
}
.stat-strip b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--pine);
  font-variant-numeric: tabular-nums;
  letter-spacing: .01em;
}
.stat-strip span { font-size: 10px; color: var(--ink-3); letter-spacing: .06em; }

.d-section { margin-top: 26px; }
.d-section h3 {
  font-size: 15px;
  font-weight: 700;
  letter-spacing: .05em;
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 11px;
}
.d-section h3 .ico {
  width: 27px;
  height: 27px;
  border-radius: 9px;
  background: var(--pine-tint);
  display: inline-flex;
  align-items: center;
  justify-content: center;
  font-size: 13.5px;
}
.d-section p { font-size: 14px; color: #3c4b43; line-height: 1.85; letter-spacing: .02em; text-align: justify; }
.d-section .kv { font-size: 13px; color: #3c4b43; display: flex; gap: 8px; letter-spacing: .02em; }
.d-section .kv b { color: var(--pine); flex-shrink: 0; font-weight: 600; }

.tips-list li {
  position: relative;
  padding: 10px 13px 10px 36px;
  background: var(--paper-warm);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  font-size: 13px;
  color: #4c5b53;
  letter-spacing: .02em;
  margin-bottom: 9px;
  line-height: 1.7;
}
.tips-list li::before {
  content: "💡";
  position: absolute;
  left: 11px;
  top: 10px;
  font-size: 13px;
}

.profile-card {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 15px;
  margin-top: 14px;
}
.profile-card svg { width: 100%; height: auto; display: block; }
.profile-cap { font-size: 11px; color: var(--ink-3); text-align: center; margin-top: 7px; letter-spacing: .06em; }

.my-climb-banner {
  margin-top: 20px;
  background: linear-gradient(135deg, #eef4ec, #e2ede4);
  border: 1px dashed rgba(30, 77, 59, .35);
  border-radius: var(--radius);
  padding: 13px 16px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  font-size: 13px;
  color: var(--pine-deep);
  letter-spacing: .02em;
}

.detail-actions {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  padding: 14px 18px calc(16px + env(safe-area-inset-bottom));
  background: linear-gradient(180deg, rgba(244, 242, 234, 0), var(--paper) 45%);
  display: flex;
  gap: 10px;
  z-index: 40;
}
.detail-actions .btn { flex: 1; }

/* ============ 记录 ============ */
.summary-card {
  position: relative;
  overflow: hidden;
  background:
    radial-gradient(600px 200px at 85% -60px, rgba(184, 68, 44, .18), transparent 60%),
    linear-gradient(150deg, #143326, var(--pine-deep) 45%, var(--pine));
  color: #f0ede1;
  border-radius: var(--radius-lg);
  padding: 19px;
  box-shadow: var(--shadow-lg);
}
.summary-card .sc-painting {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
  filter: brightness(.72) saturate(.96);
}
.summary-card .sc-attribution {
  position: absolute;
  right: 13px;
  top: 12px;
  font-family: var(--serif);
  font-size: 10px;
  letter-spacing: .12em;
  color: rgba(250, 248, 242, .55);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
  pointer-events: none;
}
.summary-card .row,
.summary-card .summary-grid { position: relative; z-index: 1; }
.summary-card .row { display: flex; align-items: center; justify-content: space-between; }
.summary-card h2 {
  font-size: 17px;
  font-weight: 800;
  letter-spacing: .06em;
}
.summary-card .sub { font-size: 11.5px; opacity: .75; margin-top: 3px; letter-spacing: .05em; }
.summary-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 8px; margin-top: 16px; }
.summary-grid .sg {
  text-align: center;
  background: rgba(250, 248, 242, .09);
  border: 1px solid rgba(250, 248, 242, .12);
  border-radius: 13px;
  padding: 11px 4px;
}
.summary-grid b {
  display: block;
  font-size: 20px;
  font-weight: 800;
  font-variant-numeric: tabular-nums;
}
.summary-grid span { font-size: 10.5px; opacity: .8; letter-spacing: .06em; }

/* ============ 我的 ============ */
/* 资料卡整张以千里江山图为底，头像昵称叠画上；画卷 img+LQIP 均为绝对定位，容器自身撑高（padding+内容行） */
.me-card {
  position: relative;
  overflow: hidden;
  background: #16382a; /* 画卷未加载时的深松绿兜底 */
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  padding: 26px 20px;
  cursor: pointer;
  transition: transform .15s ease;
}
.me-card::after {
  content: '';
  position: absolute;
  inset: 0;
  z-index: 1;
  background: linear-gradient(180deg, rgba(10, 26, 19, .14), rgba(10, 26, 19, .6));
}
.me-card .me-painting,
.me-card .painting-lqip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.me-card .me-painting { opacity: 0; transition: opacity .6s ease; }
.me-card .me-painting.loaded { opacity: 1; }
.me-card .painting-lqip { filter: blur(8px) brightness(.92); }
.me-card .me-row,
.me-card .me-banner-cap { z-index: 2; }
/* 资料行留在文档流撑起卡片高度（卡内其余层全是绝对定位），仅画卷层与落款绝对定位 */
.me-card .me-row { position: relative; display: flex; align-items: center; gap: 16px; }
.me-card .me-banner-cap { position: absolute; }
.me-banner-cap {
  right: 10px;
  bottom: 7px;
  font-family: var(--serif);
  font-size: 9.5px;
  letter-spacing: .12em;
  color: rgba(250, 248, 242, .6);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.me-card:active { transform: scale(.98); }
.me-card .avatar {
  width: 62px;
  height: 62px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pine-tint), #cfe3d5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 32px;
  flex-shrink: 0;
  overflow: hidden;
  box-shadow: inset 0 0 0 1px rgba(250, 248, 242, .4), 0 0 0 3px rgba(250, 248, 242, .92);
}
.me-card .avatar img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.me-card .me-info { flex: 1; min-width: 0; }
.me-card .nick { font-size: 18px; font-weight: 800; display: flex; align-items: center; gap: 9px; flex-wrap: wrap; letter-spacing: .04em; color: #f6f3e9; text-shadow: 0 1px 6px rgba(6, 18, 13, .55); }
.me-card .edit-hint {
  font-size: 10.5px;
  font-weight: 600;
  letter-spacing: .06em;
  color: #f8ecdc;
  background: rgba(184, 68, 44, .78);
  border: 1px solid rgba(250, 248, 242, .3);
  border-radius: 999px;
  padding: 2px 10px;
}
.me-card .motto { font-size: 12px; color: rgba(240, 237, 225, .85); margin-top: 3px; letter-spacing: .04em; text-shadow: 0 1px 5px rgba(6, 18, 13, .5); }

.ach-list { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.ach {
  display: flex;
  gap: 11px;
  align-items: center;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
  padding: 12px;
  transition: border-color .15s ease;
}
.ach.on { border-color: rgba(176, 139, 62, .45); background: linear-gradient(150deg, #fdfaf1, #f8f2e2); }
.ach .ach-ico {
  width: 42px;
  height: 42px;
  border-radius: 12px;
  background: var(--paper-warm);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  flex-shrink: 0;
}
.ach.on .ach-ico { background: rgba(176, 139, 62, .12); }
.ach .ach-name { font-size: 13px; font-weight: 700; letter-spacing: .03em; }
.ach .ach-desc { font-size: 10.5px; color: var(--ink-3); margin-top: 2px; }
.ach.off .ach-ico { filter: grayscale(1); opacity: .5; }
.ach.off .ach-name { color: var(--ink-3); }
.ach .ach-state {
  margin-left: auto;
  font-size: 10px;
  font-weight: 700;
  letter-spacing: .04em;
  color: var(--gold);
  flex-shrink: 0;
}
.ach.off .ach-state { color: #bcc8c1; }

/* 成就已解锁小金印 */
.ach.on .ach-state::before { content: "● "; font-size: 8px; }

.data-zone { display: flex; gap: 9px; flex-wrap: wrap; }
.data-zone .btn { flex: 1 1 40%; font-size: 12.5px; padding: 10px 6px; }

/* 头像选择 */
.ava-grid { display: grid; grid-template-columns: repeat(6, 1fr); gap: 7px; }
.ava-opt {
  font-size: 21px;
  padding: 8px 0 6px;
  border-radius: 11px;
  background: var(--paper-warm);
  border: 1.5px solid transparent;
  transition: all .12s ease;
}
.ava-opt:active { transform: scale(.9); }
.ava-opt.on { border-color: var(--pine-soft); background: var(--pine-tint); }

.pf-ava-row { display: flex; align-items: center; gap: 14px; margin-bottom: 11px; }
.pf-preview {
  width: 64px;
  height: 64px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pine-tint), #cfe3d5);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 34px;
  overflow: hidden;
  flex-shrink: 0;
  box-shadow: 0 0 0 3px var(--card), 0 0 0 4px var(--line);
}
.pf-preview img {
  width: 100%;
  height: 100%;
  border-radius: 50%;
  object-fit: cover;
  display: block;
}
.pf-ava-btns { display: flex; flex-direction: column; gap: 8px; }
.pf-ava-btns .btn { padding: 7px 14px; font-size: 12.5px; }

/* ============ 弹窗 ============ */
.modal-mask {
  position: fixed;
  inset: 0;
  background: rgba(18, 28, 23, .55);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: maskIn .2s ease;
}
@keyframes maskIn { from { opacity: 0; } }

.modal-sheet {
  width: 100%;
  max-width: 520px;
  background: var(--paper-warm);
  border-radius: 24px 24px 0 0;
  padding: 14px 20px calc(22px + env(safe-area-inset-bottom));
  animation: sheetUp .3s cubic-bezier(.2, .9, .3, 1);
  max-height: 86vh;
  overflow-y: auto;
  position: relative;
}
.modal-sheet::before {
  content: "";
  position: absolute;
  top: 7px;
  left: 50%;
  transform: translateX(-50%);
  width: 36px;
  height: 4px;
  border-radius: 999px;
  background: var(--line);
}
@keyframes sheetUp { from { transform: translateY(70px); opacity: .4; } }

.modal-sheet .m-head { display: flex; align-items: center; justify-content: space-between; margin: 6px 0 16px; }
.modal-sheet .m-head h3 { font-size: 17px; font-weight: 800; letter-spacing: .04em; }
.modal-sheet .m-close {
  width: 30px;
  height: 30px;
  border-radius: 50%;
  background: rgba(34, 50, 43, .06);
  color: var(--ink-2);
  font-size: 14px;
  display: flex;
  align-items: center;
  justify-content: center;
}

.form-row { margin-bottom: 15px; }
.form-row label { display: block; font-size: 12.5px; font-weight: 600; color: var(--ink-2); letter-spacing: .05em; margin-bottom: 7px; }
.form-row .control {
  width: 100%;
  border: 1.5px solid var(--line);
  border-radius: 12px;
  padding: 11px 14px;
  font-size: 14.5px;
  font-family: inherit;
  outline: none;
  background: var(--card);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.form-row .control:focus { border-color: var(--pine-soft); background: #fff; box-shadow: 0 0 0 3px rgba(61, 122, 95, .12); }
.form-row textarea.control { resize: vertical; min-height: 76px; line-height: 1.7; }

.form-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }

.star-picker { display: flex; gap: 6px; }
.star-picker button {
  font-size: 26px;
  color: #d8ddd4;
  transition: transform .1s ease, color .12s ease;
  padding: 2px;
}
.star-picker button.on { color: var(--gold); }
.star-picker button:active { transform: scale(1.2); }

/* ============ GPX 导入 ============ */
.gpx-file-info {
  font-size: 12px;
  color: var(--ink-2);
  background: var(--paper-warm);
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  padding: 10px 13px;
  margin-bottom: 13px;
  line-height: 1.6;
  letter-spacing: .02em;
}
.gpx-item {
  display: flex;
  gap: 10px;
  align-items: flex-start;
  padding: 12px 13px;
  border: 1.5px solid var(--line);
  border-radius: 13px;
  margin-bottom: 9px;
  cursor: pointer;
  background: var(--card);
  transition: border-color .15s ease, background .15s ease;
}
.gpx-item:has(input:checked) { border-color: var(--pine-soft); background: #f4f9f5; }
.gpx-item input { margin-top: 4px; accent-color: var(--pine); width: 16px; height: 16px; }
.gpx-item b { font-size: 14px; margin-right: 6px; letter-spacing: .03em; }
.gpx-item .badge { margin-right: 4px; }
.gpx-item small { display: block; font-size: 11.5px; color: var(--ink-3); margin-top: 3px; line-height: 1.55; }
.gpx-item.off { opacity: .55; cursor: default; border-style: dashed; background: transparent; }

/* ============ Toast ============ */
#toast-root {
  position: fixed;
  bottom: calc(104px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%);
  z-index: 300;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 8px;
  width: max-content;
  max-width: 88vw;
}
.toast {
  background: rgba(24, 36, 30, .94);
  color: #f0ede1;
  font-size: 13px;
  letter-spacing: .03em;
  padding: 10px 19px;
  border-radius: 12px;
  border: 1px solid rgba(240, 237, 225, .1);
  box-shadow: 0 10px 28px -8px rgba(0, 0, 0, .4);
  animation: toastIn .25s ease;
  text-align: center;
}
.toast.gold { background: linear-gradient(135deg, #8a6420, var(--gold)); font-weight: 700; }
.toast.out { animation: toastOut .3s ease both; }
@keyframes toastIn { from { opacity: 0; transform: translateY(12px) scale(.95); } }
@keyframes toastOut { to { opacity: 0; transform: translateY(8px); } }

/* ============ 山景动画 ============ */
.scene .clouds { animation: drift 46s ease-in-out infinite alternate; }
.scene .cl2 { animation-duration: 60s; animation-direction: alternate-reverse; }
.scene .sun, .scene .sun-halo { animation: sunPulse 5s ease-in-out infinite; transform-box: fill-box; transform-origin: center; }
.scene .birds { animation: fly 24s linear infinite; }
@keyframes drift { from { transform: translateX(-26px); } to { transform: translateX(34px); } }
@keyframes sunPulse { 0%, 100% { opacity: .85; } 50% { opacity: 1; } }
@keyframes fly {
  0% { transform: translate(-30px, 14px); opacity: 0; }
  12% { opacity: .9; }
  88% { opacity: .9; }
  100% { transform: translate(430px, -16px); opacity: 0; }
}
@media (prefers-reduced-motion: reduce) {
  .scene .clouds, .scene .sun, .scene .sun-halo, .scene .birds { animation: none; }
  .page { animation: none; }
}

/* ============ 山灵 · 贴边精灵 ============ */
/* ============ 下载为桌面应用（右上角） ============ */
.pwa-dl {
  position: fixed;
  top: 10px;
  right: max(calc(50% - 260px + 2px), 2px); /* 与山灵精灵同列，贴内容右缘 */
  z-index: 55;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: rgba(250, 248, 242, .92);
  color: var(--pine-deep);
  display: flex;
  align-items: center;
  justify-content: center;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform .15s ease;
}
.pwa-dl svg { width: 17px; height: 17px; }
.pwa-dl:active { transform: scale(.92); }
.pwa-dl.hidden { display: none; }
@media (display-mode: standalone) { .pwa-dl { display: none; } }

.chat-sprite {
  position: fixed;
  top: 42%;
  right: max(calc(50% - 260px + 2px), 2px);
  width: 42px;
  height: 54px;
  touch-action: none;
  cursor: grab;
  z-index: 60;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: right .2s ease;
  animation: spriteIn .6s cubic-bezier(.2, .9, .3, 1.4) both;
}
.chat-sprite.hide { display: none; }
.chat-sprite:active { cursor: grabbing; }
.chat-sprite .cs-body {
  width: 44px;
  height: 44px;
  border-radius: 50% 50% 46% 46%;
  background:
    radial-gradient(120% 120% at 32% 24%, rgba(240, 237, 225, .32), transparent 46%),
    linear-gradient(160deg, #2a5a45, var(--pine-deep));
  border: 1px solid rgba(240, 237, 225, .28);
  box-shadow: 0 6px 16px -6px rgba(18, 53, 39, .7);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 21px;
  animation: spriteFloat 3.4s ease-in-out infinite;
  position: relative;
}
/* 探出的眼睛：有新对话入口提示 */
.chat-sprite .cs-eye {
  position: absolute;
  right: 3px;
  top: 18px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--cinnabar);
  box-shadow: 0 0 0 2px var(--paper);
  animation: spriteBlink 2.8s ease-in-out infinite;
}
@keyframes spriteFloat {
  0%, 100% { transform: translateY(0); }
  50% { transform: translateY(-5px); }
}
@keyframes spriteBlink {
  0%, 88%, 100% { opacity: 1; }
  92% { opacity: .2; }
}
@keyframes spriteIn { from { transform: translateY(-50%) translateX(40px); opacity: 0; } }
@media (prefers-reduced-motion: reduce) {
  .chat-sprite .cs-body, .chat-sprite .cs-eye { animation: none; }
}

/* hero 内用户信息按钮 */
.hero-me {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 6px 12px 6px 6px;
  border-radius: 999px;
  background: rgba(250, 248, 242, .12);
  border: 1px solid rgba(250, 248, 242, .2);
  backdrop-filter: blur(8px);
  color: #f6f3e9;
  align-self: flex-start;
  transition: transform .14s ease;
}
.hero-me:active { transform: scale(.96); }
.hero-me .hm-ava {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: linear-gradient(135deg, var(--pine-tint), #cfe3d5);
  overflow: hidden;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.hero-me .hm-ava img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
}
.hero-me .hm-info { text-align: left; }
.hero-me .hm-info b { display: block; font-size: 13.5px; letter-spacing: .04em; line-height: 1.3; }
.hero-me .hm-info small { display: block; font-size: 10.5px; opacity: .8; letter-spacing: .05em; line-height: 1.3; }

/* 聊天内的山峰卡片 */
.chat-card {
  display: flex;
  align-items: center;
  gap: 10px;
  background: rgba(240, 237, 225, .12);
  border: 1px solid rgba(240, 237, 225, .2);
  border-radius: 13px;
  padding: 9px 11px;
  margin-top: 9px;
  cursor: pointer;
  transition: transform .12s ease;
}
.chat-card:active { transform: scale(.97); }
.chat-card .cc-emoji {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: rgba(240, 237, 225, .16);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 18px;
  flex-shrink: 0;
}
.chat-card .cc-info { flex: 1; min-width: 0; }
.chat-card .cc-info b { display: block; font-size: 13.5px; letter-spacing: .04em; }
.chat-card .cc-info small { font-size: 10.5px; opacity: .75; white-space: nowrap; overflow: hidden; text-overflow: ellipsis; display: block; }
.chat-card .cc-go { font-size: 19px; opacity: .55; }

/* ============ 聊天界面 ============ */
.chat-overlay {
  position: fixed;
  inset: 0;
  margin: 0 auto;
  max-width: 520px;
  background: var(--paper);
  z-index: 110;
  display: flex;
  flex-direction: column;
  animation: chatIn .25s ease both;
}
@keyframes chatIn { from { opacity: 0; transform: translateY(24px); } }

.chat-head {
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 14px 16px 13px;
  padding-top: calc(14px + env(safe-area-inset-top));
  background:
    radial-gradient(400px 140px at 90% -50px, rgba(184, 68, 44, .25), transparent 60%),
    linear-gradient(150deg, #10281e, var(--pine-deep));
  color: #f0ede1;
  border-bottom: 1px solid rgba(240, 237, 225, .08);
}
.chat-head .ch-ava {
  width: 40px;
  height: 40px;
  border-radius: 12px;
  background: rgba(240, 237, 225, .13);
  border: 1px solid rgba(240, 237, 225, .22);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 20px;
}
.chat-head .ch-info { flex: 1; }
.chat-head .ch-info b { display: block; font-size: 16px; font-family: var(--serif); font-weight: 400; letter-spacing: .14em; }
.chat-head .ch-info small { font-size: 10.5px; opacity: .75; letter-spacing: .06em; }
.chat-head .ch-info small::before {
  content: "";
  display: inline-block;
  width: 6px;
  height: 6px;
  border-radius: 50%;
  background: #58e6a8;
  margin-right: 5px;
  animation: blink 2s ease-in-out infinite;
}
@keyframes blink { 0%, 100% { opacity: 1; } 50% { opacity: .35; } }
.chat-head .m-close { background: rgba(240, 237, 225, .15); color: #f0ede1; }

.chat-tts {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(240, 237, 225, .15);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ch-tts {
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: rgba(240, 237, 225, .15);
  font-size: 15px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ch-tts.on { background: rgba(88, 230, 168, .28); }

.chat-body {
  flex: 1;
  overflow-y: auto;
  padding: 18px 15px 10px;
  display: flex;
  flex-direction: column;
  gap: 13px;
}

.msg { display: flex; gap: 8px; max-width: 92%; }
.msg.user { align-self: flex-end; flex-direction: row-reverse; }
.msg-ava {
  width: 30px;
  height: 30px;
  border-radius: 10px;
  background: var(--pine-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 15px;
  flex-shrink: 0;
}
.msg .bubble {
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 4px 16px 16px 16px;
  padding: 11px 14px;
  font-size: 13.5px;
  line-height: 1.7;
  letter-spacing: .02em;
  box-shadow: var(--shadow-sm);
  color: var(--ink);
  overflow-wrap: anywhere;
}
.msg.user .bubble {
  background: var(--pine);
  color: #f0ede1;
  border: none;
  border-radius: 16px 4px 16px 16px;
}
.msg.typing .bubble { display: flex; gap: 5px; align-items: center; padding: 14px 16px; }
.msg.typing i {
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink-3);
  animation: bounce 1.2s ease-in-out infinite;
}
.msg.typing i:nth-child(2) { animation-delay: .15s; }
.msg.typing i:nth-child(3) { animation-delay: .3s; }
@keyframes bounce { 0%, 60%, 100% { transform: none; } 30% { transform: translateY(-5px); } }

.caret {
  display: inline-block;
  width: 2px;
  height: 14px;
  background: var(--pine-soft);
  margin-left: 2px;
  vertical-align: -2px;
  animation: blink 1s step-end infinite;
}

.chat-quick {
  display: flex;
  gap: 8px;
  overflow-x: auto;
  padding: 9px 15px;
  scrollbar-width: none;
}
.chat-quick::-webkit-scrollbar { display: none; }
.chat-quick .chip { background: var(--card); flex-shrink: 0; }

.chat-input-bar {
  display: flex;
  gap: 9px;
  padding: 11px 15px calc(13px + env(safe-area-inset-bottom));
  background: var(--paper-warm);
  border-top: 1px solid var(--line-soft);
}
.chat-input-bar input {
  flex: 1;
  border: 1.5px solid var(--line);
  border-radius: 999px;
  padding: 10px 17px;
  font-size: 14px;
  font-family: inherit;
  outline: none;
  background: var(--card);
  color: var(--ink);
  transition: border-color .15s ease, box-shadow .15s ease;
}
.chat-input-bar input:focus { border-color: var(--pine-soft); box-shadow: 0 0 0 3px rgba(61, 122, 95, .12); }
.chat-input-bar .btn { padding: 10px 18px; flex-shrink: 0; border-radius: 999px; }

.mic-btn {
  width: 42px;
  height: 42px;
  border-radius: 50%;
  background: var(--card);
  font-size: 17px;
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all .15s ease;
  border: 1.5px solid var(--line);
}
.mic-btn.listening {
  background: rgba(184, 68, 44, .08);
  border-color: var(--cinnabar);
  animation: micPulse 1.2s ease-in-out infinite;
}
@keyframes micPulse {
  0%, 100% { box-shadow: 0 0 0 0 rgba(184, 68, 44, .35); }
  50% { box-shadow: 0 0 0 8px rgba(184, 68, 44, 0); }
}

/* ============ 山峰护照 ============ */
.passport {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
}
.seal {
  border: 2px solid rgba(184, 68, 44, .75);
  color: var(--cinnabar-deep);
  border-radius: 10px;
  padding: 11px 6px 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  background:
    radial-gradient(circle at 30% 20%, rgba(184, 68, 44, .05), transparent 60%),
    rgba(255, 253, 249, .7);
  transform: rotate(-2.2deg);
  cursor: pointer;
  position: relative;
  transition: transform .15s ease;
}
.seal:nth-child(even) { transform: rotate(1.8deg); }
.seal:active { transform: scale(.94) rotate(0deg); }
.seal::after {
  content: "";
  position: absolute;
  inset: 3px;
  border: 1px solid rgba(184, 68, 44, .3);
  border-radius: 6px;
}
.seal-emoji { font-size: 21px; line-height: 1.15; }
.seal-name { font-size: 13.5px; font-weight: 800; letter-spacing: .22em; margin-left: .22em; font-family: var(--serif); }
.seal-date { font-size: 9px; letter-spacing: .12em; opacity: .8; font-variant-numeric: tabular-nums; }
.seal-empty {
  border: 2px dashed rgba(34, 50, 43, .18);
  color: var(--ink-3);
  background: rgba(255, 253, 249, .4);
  transform: none;
}
.seal-empty::after { display: none; }
.seal-empty .seal-emoji { filter: grayscale(1); opacity: .45; }
.seal-empty .seal-name { font-family: inherit; font-weight: 600; letter-spacing: .1em; }

/* ============ 登顶彩带 ============ */
#confetti-root {
  position: fixed;
  top: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 520px;
  height: 100vh;
  pointer-events: none;
  z-index: 250;
  overflow: hidden;
}
#confetti-root i {
  position: absolute;
  top: -12px;
  width: 8px;
  height: 13px;
  border-radius: 2px;
  animation: confettiFall linear forwards;
}
@keyframes confettiFall {
  to { transform: translateY(105vh) rotate(720deg); }
}

/* ============ 江山舆图（记录页） ============ */
.map-card {
  position: relative;
  background: linear-gradient(165deg, #f3f0e2, #ebe8d7 62%, #e6e3d0);
  border: 1px solid var(--line-soft);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-sm);
  overflow: hidden;
}
.map-card .map-fallback {
  padding: 34px 16px;
  text-align: center;
  font-size: 12px;
  color: var(--muted);
  letter-spacing: .06em;
}
.map-card svg {
  display: block;
  width: 100%;
  height: auto;
  aspect-ratio: 52.2 / 39.1;
  touch-action: none;
  cursor: grab;
}
.map-card svg:active { cursor: grabbing; }
.cm-land path {
  fill: #e3e6d1;
  stroke: #87927a;
  stroke-width: 1px;
  transition: fill .3s ease;
}
.cm-inset-frame {
  fill: rgba(253, 251, 244, .75);
  stroke: #87927a;
  stroke-width: 1px;
  stroke-dasharray: 3 2;
}
.cm-inset-cap {
  font-family: var(--serif);
  fill: #5c6852;
  letter-spacing: .25em;
}
.cm-node { cursor: pointer; }
.cm-dot {
  fill: #fdfbf4;
  stroke: var(--pine);
  stroke-width: 1.5px;
  transition: fill .25s ease;
}
.cm-halo { fill: transparent; transition: fill .25s ease; }
.cm-node:hover .cm-halo { fill: rgba(184, 68, 44, .18); }
.cm-node.on .cm-dot { fill: var(--cinnabar); stroke: #fbf6ea; }
.cm-node.on .cm-halo { fill: rgba(184, 68, 44, .22); }
.cm-node:hover .cm-dot { stroke: var(--cinnabar); }
.cm-lab {
  font-family: var(--serif);
  fill: #3f4f3d;
  opacity: 0;
  transition: opacity .25s ease;
  paint-order: stroke;
  stroke: rgba(250, 248, 242, .9);
  pointer-events: none;
}
.cm-node.on .cm-lab { opacity: 1; fill: #8c3a22; }
svg.zoomed .cm-lab { opacity: 1; }
.cm-ctl {
  position: absolute;
  top: 10px;
  right: 10px;
  display: flex;
  flex-direction: column;
  gap: 6px;
}
.cm-ctl button {
  width: 30px;
  height: 30px;
  border-radius: 9px;
  border: 1px solid var(--line);
  background: rgba(250, 248, 242, .92);
  font-size: 15px;
  line-height: 1;
  color: var(--pine-deep);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
}
.cm-ctl button:active { transform: scale(.93); }
.cm-legend {
  position: absolute;
  left: 10px;
  bottom: 9px;
  display: flex;
  gap: 10px;
  align-items: center;
  font-size: 10.5px;
  letter-spacing: .05em;
  color: var(--ink-2);
  background: rgba(250, 248, 242, .88);
  border: 1px solid var(--line-soft);
  border-radius: 999px;
  padding: 3px 11px;
}
.cm-legend span { display: inline-flex; align-items: center; gap: 5px; }
.cm-legend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; }
.lg-on { background: var(--cinnabar); border: 1.5px solid #fbf6ea; box-shadow: 0 0 0 1px var(--cinnabar); }
.lg-off { background: #fdfbf4; border: 1.5px solid var(--pine); }
.cm-cap {
  position: absolute;
  right: 12px;
  bottom: 9px;
  font-family: var(--serif);
  font-size: 9px;
  letter-spacing: .14em;
  color: rgba(63, 79, 61, .55);
}

/* ============ 步步登峰 ============ */
.climb-head { padding: 4px 0 2px; }
.climb-banner {
  position: relative;
  border-radius: var(--radius-lg);
  overflow: hidden;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--line-soft);
  min-height: 132px;
  display: flex;
  align-items: flex-end;
}
.climb-banner img,
.climb-banner .painting-lqip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.climb-banner img { opacity: 0; transition: opacity .6s ease; }
.climb-banner img.loaded { opacity: 1; }
.climb-banner-title {
  position: relative;
  width: 100%;
  padding: 40px 18px 13px;
  background: linear-gradient(180deg, transparent, rgba(10, 26, 19, .55));
  color: #f6f3e9;
}
.climb-banner-title h2 {
  font-family: var(--serif);
  font-size: 23px;
  font-weight: 400;
  letter-spacing: .12em;
  text-shadow: 0 2px 10px rgba(0, 0, 0, .35);
}
.climb-banner-title p { font-size: 12px; opacity: .88; margin-top: 2px; letter-spacing: .06em; }
.climb-banner-cap {
  position: absolute;
  right: 12px;
  top: 10px;
  font-family: var(--serif);
  font-size: 9.5px;
  letter-spacing: .12em;
  color: rgba(250, 248, 242, .6);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.climb-head h2 {
  font-family: var(--serif);
  font-size: 25px;
  font-weight: 400;
  letter-spacing: .12em;
}
.climb-head p { font-size: 12px; color: var(--ink-2); margin-top: 3px; letter-spacing: .08em; }

.climb-card { padding: 17px; }
.climb-title { display: flex; align-items: flex-start; justify-content: space-between; gap: 10px; }
.climb-title b { font-size: 16.5px; letter-spacing: .04em; }
.climb-title small { display: block; font-size: 12px; color: var(--ink-2); margin-top: 3px; line-height: 1.6; }
.climb-pct {
  font-size: 17px;
  font-weight: 800;
  color: var(--pine);
  background: var(--pine-tint);
  border-radius: 11px;
  padding: 4px 12px;
  flex-shrink: 0;
  font-variant-numeric: tabular-nums;
}
.climb-svg { width: 100%; height: auto; display: block; margin-top: 9px; }
.climb-now {
  margin-top: 11px;
  font-size: 12.5px;
  color: #3c4b43;
  background: var(--paper-warm);
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  padding: 10px 13px;
  letter-spacing: .02em;
}
.climb-now b { color: var(--pine); }
.climb-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 8px;
  margin-top: 11px;
}
.climb-stats > div {
  text-align: center;
  background: var(--paper-warm);
  border: 1px solid var(--line-soft);
  border-radius: 12px;
  padding: 10px 2px 9px;
}
.climb-stats b {
  display: block;
  font-size: 14px;
  font-weight: 800;
  color: var(--pine);
  font-variant-numeric: tabular-nums;
}
.climb-stats span { font-size: 10px; color: var(--ink-3); letter-spacing: .05em; }

.climb-log-card { padding: 16px 16px 14px; margin-top: 15px; }
.climb-hint { font-size: 11px; color: var(--ink-3); margin: 6px 0 11px; letter-spacing: .03em; }
.climb-log-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 9px 13px;
  background: var(--paper-warm);
  border: 1px solid var(--line-soft);
  border-radius: 11px;
  margin-bottom: 8px;
  font-size: 12.5px;
  font-variant-numeric: tabular-nums;
}
.climb-log-item span { flex: 1; color: var(--ink-2); }
.climb-log-item b { color: var(--pine); }
.climb-log-item .del { color: #bcc8c1; font-size: 13px; }

.climb-done {
  display: flex;
  align-items: center;
  gap: 13px;
  padding: 14px 16px;
  margin-top: 15px;
  background: linear-gradient(135deg, #f8f3e2, #f4ebcf);
  border: 1px solid rgba(176, 139, 62, .3);
}
.climb-done .cd-left { font-size: 29px; }
.climb-done .cd-mid { flex: 1; }
.climb-done .cd-mid b { font-size: 14.5px; display: block; letter-spacing: .04em; }
.climb-done .cd-mid small { font-size: 11px; color: var(--ink-2); font-variant-numeric: tabular-nums; }
.climb-done .btn { padding: 8px 16px; font-size: 12.5px; background: var(--card); color: var(--gold); border-color: rgba(176, 139, 62, .4); }

/* 首页攀登卡片 */
.climb-teaser {
  position: relative;
  overflow: hidden;
  margin-top: 14px;
  background:
    radial-gradient(400px 160px at 92% -50px, rgba(88, 230, 168, .18), transparent 60%),
    linear-gradient(150deg, #0f2d20, var(--pine-deep) 55%, #1b4433);
  border-radius: var(--radius-lg);
  padding: 14px 16px;
  display: flex;
  align-items: center;
  gap: 12px;
  color: #e6f0e8;
  cursor: pointer;
  box-shadow: var(--shadow-md);
  transition: transform .15s ease;
}
.climb-teaser .ct-painting,
.climb-teaser .painting-lqip {
  position: absolute;
  inset: 0;
  width: 100%;
  height: 100%;
  object-fit: cover;
}
.climb-teaser .ct-painting { opacity: 0; transition: opacity .6s ease; }
.climb-teaser .ct-painting.loaded { opacity: 1; }
.climb-teaser .painting-lqip { filter: blur(8px); }
.climb-teaser::after {
  content: '';
  position: absolute;
  inset: 0;
  background: linear-gradient(95deg, rgba(13, 38, 27, .88), rgba(13, 38, 27, .52) 58%, rgba(13, 38, 27, .32));
}
.climb-teaser > .ct-txt,
.climb-teaser > .btn { position: relative; z-index: 1; }
.climb-teaser .ct-cap {
  position: absolute;
  right: 10px;
  bottom: 7px;
  z-index: 1;
  font-family: var(--serif);
  font-size: 9.5px;
  letter-spacing: .12em;
  color: rgba(250, 248, 242, .55);
  text-shadow: 0 1px 4px rgba(0, 0, 0, .4);
}
.climb-teaser:active { transform: scale(.97); }
.climb-teaser .ct-txt { flex: 1; min-width: 0; }
.climb-teaser b { font-size: 14.5px; letter-spacing: .05em; }
.climb-teaser small { display: block; font-size: 10.5px; opacity: .8; margin-top: 3px; letter-spacing: .03em; }
.climb-teaser .btn { padding: 8px 18px; flex-shrink: 0; font-size: 12.5px; }
.climb-teaser.on .ct-top { display: flex; align-items: center; justify-content: space-between; gap: 8px; }
.climb-teaser.on .climb-pct { padding: 2px 10px; font-size: 13.5px; background: rgba(240, 237, 225, .14); color: #f0ede1; }
.ct-bar {
  height: 7px;
  background: rgba(240, 237, 225, .15);
  border-radius: 999px;
  overflow: hidden;
  margin: 8px 0 6px;
}
.ct-bar i {
  display: block;
  height: 100%;
  background: linear-gradient(90deg, #58e6a8, #a7f3d0);
  border-radius: 999px;
  transition: width .4s ease;
}

/* 证书 */
.cert-wrap {
  border-radius: 14px;
  overflow: hidden;
  box-shadow: var(--shadow-md);
}
.cert-wrap svg { width: 100%; height: auto; display: block; }

/* 姓名章 */
.name-seal {
  width: 21px;
  height: 21px;
  border-radius: 4px;
  background: var(--cinnabar);
  color: #fbf9f2;
  font-family: var(--serif);
  font-size: 12.5px;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  transform: rotate(-2deg);
  box-shadow: inset 0 0 0 1px rgba(251, 249, 242, .35), 0 1px 3px rgba(150, 53, 29, .35);
  flex-shrink: 0;
}

/* 卷轴分隔 */
.scroll-divider {
  display: flex;
  align-items: center;
  gap: 10px;
  margin: 26px 0 0;
}
.scroll-divider::before,
.scroll-divider::after {
  content: "";
  flex: 1;
  height: 1px;
  background: linear-gradient(90deg, transparent, var(--line) 25%, var(--line) 75%, transparent);
}
.scroll-divider .sd-dot {
  width: 6px;
  height: 6px;
  transform: rotate(45deg);
  background: var(--cinnabar);
  opacity: .7;
}

/* ============ 实景相册 ============ */
.album-strip {
  display: flex;
  gap: 9px;
  overflow-x: auto;
  padding: 2px 2px 10px;
  scrollbar-width: none;
}
.album-strip::-webkit-scrollbar { display: none; }
.album-thumb {
  flex: 0 0 148px;
  height: 100px;
  border-radius: 12px;
  overflow: hidden;
  border: 1.5px solid var(--line);
  padding: 0;
  transition: border-color .15s ease, transform .12s ease;
  position: relative;
}
.album-thumb:active { transform: scale(.95); }
.album-thumb.on { border-color: var(--pine-soft); box-shadow: 0 0 0 2px rgba(61, 122, 95, .18); }
.album-thumb img {
  width: 100%;
  height: 100%;
  object-fit: cover;
  display: block;
  filter: saturate(.94);
}

/* 灯箱 */
.lightbox {
  position: fixed;
  inset: 0;
  z-index: 150;
  background: rgba(10, 16, 13, .94);
  display: flex;
  align-items: center;
  justify-content: center;
  animation: maskIn .2s ease;
}
.lb-stage {
  max-width: min(92vw, 900px);
  max-height: 82vh;
  display: flex;
  flex-direction: column;
  animation: photoIn .25s ease;
}
.lb-stage img {
  max-width: 100%;
  max-height: 74vh;
  object-fit: contain;
  border-radius: 10px;
  display: block;
}
.lb-bar {
  display: flex;
  align-items: center;
  justify-content: space-between;
  color: rgba(240, 237, 225, .85);
  font-size: 12.5px;
  letter-spacing: .06em;
  padding: 10px 4px 0;
  font-variant-numeric: tabular-nums;
}
.lb-close {
  position: absolute;
  top: calc(14px + env(safe-area-inset-top));
  right: 16px;
  width: 38px;
  height: 38px;
  border-radius: 50%;
  background: rgba(240, 237, 225, .14);
  color: #f0ede1;
  font-size: 16px;
  display: flex;
  align-items: center;
  justify-content: center;
}
.lb-nav {
  width: 44px;
  height: 44px;
  border-radius: 50%;
  background: rgba(240, 237, 225, .12);
  color: #f0ede1;
  font-size: 26px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  flex-shrink: 0;
  margin: 0 8px;
  transition: background .15s ease;
}
.lb-nav:active { background: rgba(240, 237, 225, .25); }
@keyframes photoIn { from { opacity: 0; } }

/* ============ 驴友测评外链 ============ */
.review-links { display: flex; flex-direction: column; gap: 9px; }
.review-link {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--card);
  border: 1px solid var(--line-soft);
  border-radius: 13px;
  padding: 11px 14px;
  box-shadow: var(--shadow-sm);
  transition: transform .12s ease, border-color .15s ease;
}
.review-link:active { transform: scale(.97); }
.review-link .rl-emoji {
  width: 36px;
  height: 36px;
  border-radius: 10px;
  background: var(--pine-tint);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 17px;
  flex-shrink: 0;
}
.review-link .rl-txt { flex: 1; min-width: 0; }
.review-link .rl-txt b { display: block; font-size: 13.5px; letter-spacing: .03em; color: var(--ink); }
.review-link .rl-txt small { font-size: 10.5px; color: var(--ink-3); letter-spacing: .03em; }
.review-link .rl-go { font-size: 16px; color: var(--ink-3); }

/* ============ PWA 安装引导 ============ */
.pwa-banner {
  position: fixed;
  bottom: calc(84px + env(safe-area-inset-bottom));
  left: 50%;
  transform: translateX(-50%) translateY(20px);
  width: calc(100% - 32px);
  max-width: 460px;
  background: var(--pine-deep);
  color: #f0ede1;
  border-radius: 16px;
  border: 1px solid rgba(240, 237, 225, .16);
  box-shadow: var(--shadow-lg);
  display: flex;
  align-items: center;
  gap: 11px;
  padding: 12px 13px;
  z-index: 90;
  opacity: 0;
  transition: opacity .3s ease, transform .3s ease;
}
.pwa-banner.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.pwa-banner .pb-icon {
  width: 38px;
  height: 38px;
  border-radius: 11px;
  background: rgba(240, 237, 225, .12);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 19px;
  flex-shrink: 0;
}
.pwa-banner .pb-txt { flex: 1; min-width: 0; }
.pwa-banner .pb-txt b { display: block; font-size: 13.5px; letter-spacing: .03em; }
.pwa-banner .pb-txt small { display: block; font-size: 11px; opacity: .78; line-height: 1.5; margin-top: 1px; }
.pwa-banner .pb-btn {
  padding: 8px 16px;
  border-radius: 10px;
  background: var(--cinnabar);
  color: #faf6ee;
  font-size: 12.5px;
  font-weight: 700;
  flex-shrink: 0;
}
.pwa-banner .pb-close {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  color: rgba(240, 237, 225, .6);
  font-size: 12px;
  flex-shrink: 0;
}

/* ============ 桌面端 ============ */
@media (min-width: 560px) {
  .page { padding-top: 30px; }
}
