:root {
  --bg: #f7f3ec;
  --card: #fffdf8;
  --ink: #1f3a32;
  --ink2: #5a6b63;
  --ink3: #8b8a7e;
  --line: #ded5c6;
  --accent: #cf5b36;
}

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

/*
 * hidden 属性必须压过组件自身的 display。
 * 否则 .teambar / .resume 这类写了 display:flex 的元素，即使加了 hidden 也照样显示。
 * 这是作者样式优先级高于浏览器默认 [hidden]{display:none} 导致的。
 */
[hidden] { display: none !important; }

html, body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB",
    "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

body {
  min-height: 100dvh;
  display: flex;
  justify-content: center;
}

#app {
  width: 100%;
  max-width: 480px;
  min-height: 100dvh;
  padding: 30px 24px calc(24px + env(safe-area-inset-bottom));
  display: flex;
  flex-direction: column;
}

/* ---------------- 屏幕切换 ---------------- */
.screen { display: none; flex-direction: column; flex: 1; }
.screen.active { display: flex; animation: rise 0.34s cubic-bezier(0.2, 0.7, 0.2, 1) both; }
@keyframes rise {
  from { opacity: 0; transform: translateY(10px); }
  to   { opacity: 1; transform: none; }
}

/* ---------------- 首页 ---------------- */
.brand {
  font-size: 11px;
  letter-spacing: 0.34em;
  color: var(--ink3);
  margin-bottom: 26px;
}

h1 {
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: 52px;
  line-height: 0.98;
  font-weight: 600;
  letter-spacing: 0.02em;
  margin: 0 0 22px;
}

.lead {
  font-size: 14.5px;
  line-height: 1.95;
  color: var(--ink2);
  margin: 0 0 34px;
}

.field { margin-bottom: 22px; }

.label {
  font-size: 11.5px;
  letter-spacing: 0.16em;
  color: var(--ink3);
  margin-bottom: 11px;
}

.dists { display: flex; flex-direction: column; gap: 9px; }

.dist {
  display: flex;
  align-items: baseline;
  justify-content: space-between;
  gap: 12px;
  padding: 15px 17px;
  border: 1px solid var(--line);
  border-radius: 13px;
  background: var(--card);
  text-align: left;
  cursor: pointer;
  font: inherit;
  color: inherit;
  transition: 0.18s;
}
.dist:active { transform: scale(0.99); }
.dist .t { font-size: 16px; font-weight: 600; }
.dist .d { font-size: 11.5px; color: var(--ink3); white-space: nowrap; }
.dist.sel {
  border-color: var(--ink);
  background: #f1ece1;
  box-shadow: inset 0 0 0 1px var(--ink);
}
.dist.sel .d { color: var(--accent); }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px;
  border: 1px solid var(--line);
  border-radius: 99px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--ink2);
  cursor: pointer;
  transition: 0.16s;
}
.chip.sel { background: var(--ink); border-color: var(--ink); color: var(--bg); }

.cta {
  width: 100%;
  margin-top: auto;
  padding: 18px;
  border: none;
  border-radius: 14px;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-size: 16px;
  font-weight: 600;
  letter-spacing: 0.1em;
  cursor: pointer;
  transition: 0.18s;
}
.cta:active { transform: scale(0.985); }
.cta[disabled] { opacity: 0.5; }

.tip {
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--ink3);
  text-align: center;
  margin: 13px 0 0;
}

.manual { margin-top: 22px; }
.manual .chip { font-size: 12.5px; }

.foot {
  margin-top: 28px;
  padding-top: 16px;
  border-top: 1px solid var(--line);
  font-size: 10.5px;
  line-height: 1.8;
  color: var(--ink3);
}

/* ---------------- 行走 ---------------- */
.bar {
  display: flex;
  justify-content: space-between;
  align-items: center;
  font-size: 11.5px;
  letter-spacing: 0.1em;
  color: var(--ink3);
  padding: 2px 0 10px;
}
.bar.bottom { padding: 14px 0 0; gap: 10px; }

.stage {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 30px;
}

.dial {
  position: relative;
  width: 236px;
  height: 236px;
  border-radius: 50%;
  border: 1px solid var(--line);
  background: radial-gradient(circle at 50% 40%, #fffdf8 0%, #f7f3ec 72%);
  display: grid;
  place-items: center;
}

.ring { position: absolute; inset: 0; transition: transform 0.25s ease-out; }

.tick {
  position: absolute;
  left: 50%;
  top: 8px;
  width: 1px;
  height: 7px;
  background: var(--line);
  transform-origin: 50% 110px;
}
.tick.major { height: 11px; background: #c3b9a6; }

.dir {
  position: absolute;
  left: 50%;
  top: 20px;
  transform-origin: 50% 98px;
  font-size: 10px;
  letter-spacing: 0.1em;
  color: var(--ink3);
  margin-left: -6px;
}
.dir.n { color: var(--accent); font-weight: 600; }

.needle {
  position: relative;
  width: 0;
  height: 0;
  border-left: 9px solid transparent;
  border-right: 9px solid transparent;
  border-bottom: 92px solid var(--accent);
  transform-origin: 50% 100%;
  margin-top: -92px;
  transition: transform 0.25s ease-out;
  filter: drop-shadow(0 4px 8px rgba(31, 58, 50, 0.14));
}

.me {
  position: absolute;
  bottom: 50%;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--ink);
  transform: translateY(50%);
}

.readout {
  font-family: Georgia, "Songti SC", serif;
  font-size: 62px;
  line-height: 1;
  letter-spacing: -0.02em;
}
.readout small {
  font-family: -apple-system, "PingFang SC", sans-serif;
  font-size: 17px;
  color: var(--ink2);
  margin-left: 7px;
}

.hint {
  font-size: 13px;
  line-height: 1.85;
  color: var(--ink2);
  text-align: center;
  max-width: 270px;
  margin: 0;
}

.ghost {
  flex: 1;
  padding: 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: transparent;
  font: inherit;
  font-size: 13px;
  color: var(--ink2);
  cursor: pointer;
}

/* ---------------- 揭晓 ---------------- */
.tag {
  font-size: 11px;
  letter-spacing: 0.3em;
  color: var(--accent);
  margin: 22px 0 16px;
}

.place {
  font-family: Georgia, "Songti SC", "Noto Serif SC", serif;
  font-size: 34px;
  line-height: 1.28;
  font-weight: 600;
  margin: 0 0 10px;
}

.meta { font-size: 12px; color: var(--ink3); margin-bottom: 22px; }

.desc {
  font-size: 14.5px;
  line-height: 1.95;
  color: #3a4a43;
  margin: 0 0 28px;
}

.stats {
  display: flex;
  gap: 9px;
  margin-bottom: 30px;
}
.stats > div {
  flex: 1;
  padding: 13px 6px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  text-align: center;
}
.stats b {
  display: block;
  font-family: Georgia, serif;
  font-size: 20px;
  font-weight: 500;
  margin-bottom: 3px;
}
.stats span { font-size: 10.5px; color: var(--ink3); }

/* ---------------- 提示条 ---------------- */
.toast {
  position: fixed;
  left: 50%;
  bottom: 40px;
  transform: translate(-50%, 16px);
  max-width: 82vw;
  padding: 11px 18px;
  border-radius: 99px;
  background: rgba(31, 58, 50, 0.94);
  color: var(--bg);
  font-size: 13px;
  text-align: center;
  opacity: 0;
  pointer-events: none;
  transition: 0.26s;
  z-index: 99;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }

/* ---------------- 足迹 ---------------- */
.h1-sm { font-size: 38px; margin-bottom: 24px; }

.mini { display: flex; gap: 9px; margin-bottom: 28px; }
.mini > div {
  flex: 1;
  padding: 16px 8px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
  text-align: center;
}
.mini b {
  display: block;
  font-family: Georgia, serif;
  font-size: 26px;
  font-weight: 500;
  margin-bottom: 4px;
}
.mini span { font-size: 10.5px; color: var(--ink3); }

.badges { display: flex; flex-wrap: wrap; gap: 8px; }
.badge {
  padding: 10px 12px;
  border: 1px solid var(--line);
  border-radius: 10px;
  background: var(--card);
  min-width: 92px;
}
.badge.off { opacity: 0.32; }
.badge b { display: block; font-size: 12.5px; font-weight: 600; margin-bottom: 3px; }
.badge span { font-size: 10px; color: var(--ink3); line-height: 1.5; }

.walk-list { list-style: none; margin: 0; padding: 0; }
.walk-list li {
  display: flex;
  justify-content: space-between;
  align-items: baseline;
  gap: 10px;
  padding: 13px 0;
  border-bottom: 1px solid var(--line);
}
.walk-list a { color: inherit; text-decoration: none; }
.walk-list .n { font-size: 14px; }
.walk-list .m { font-size: 11px; color: var(--ink3); white-space: nowrap; }

.cardwrap { margin-bottom: 16px; text-align: center; }
.cardwrap img {
  width: 100%;
  max-width: 320px;
  border-radius: 14px;
  box-shadow: 0 10px 30px rgba(31, 58, 50, 0.16);
}

.ghost.wide { width: 100%; margin-top: 9px; flex: none; }

.footlink { color: var(--ink2); text-decoration: none; border-bottom: 1px solid var(--line); }
.sep { margin: 0 7px; color: var(--ink3); }

/* ---------------- 队伍常驻条 ---------------- */
.teambar {
  display: flex;
  align-items: center;
  gap: 9px;
  margin-bottom: 18px;
  padding: 10px 14px;
  border-radius: 99px;
  background: var(--ink);
  color: var(--bg);
  font-size: 12.5px;
}
.tb-dot { width: 7px; height: 7px; border-radius: 50%; background: #7ED0A5; flex: none; }
.tb-text { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tb-more { opacity: 0.72; font-size: 11.5px; }

/* ---------------- 通用按钮 / 辅助文字（C 端） ---------------- */
.btn {
  display: inline-block;
  padding: 12px 18px;
  border: none;
  border-radius: 10px;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.btn:disabled { opacity: 0.55; }
.muted { color: var(--ink3); font-size: 11.5px; line-height: 1.7; }

/* ---------------- 我的路线 ---------------- */
.routes { margin-top: 22px; }
.route-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 16px;
  margin-bottom: 9px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.route-main { flex: 1; min-width: 0; }
.route-name { font-size: 14.5px; font-weight: 600; margin-bottom: 5px; }
.route-meta { font-size: 11.5px; color: var(--ink3); }
.route-go {
  flex: none;
  padding: 8px 15px;
  border: none;
  border-radius: 99px;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.route-go[disabled] { opacity: 0.45; }

/* ---------------- 商家券 ---------------- */
.offer {  border: 1px solid #E3D3B8;
  background: #FDF7EA;
  border-radius: 14px;
  padding: 16px 18px;
  margin-bottom: 18px;
}
.offer-t { font-size: 11px; letter-spacing: 0.22em; color: #B26A00; margin-bottom: 6px; }
.offer-n { font-size: 17px; font-weight: 600; margin-bottom: 12px; }
.btn.small { padding: 10px 18px; font-size: 13.5px; width: auto; display: inline-block; }
.code-box {
  margin-top: 14px;
  padding-top: 14px;
  border-top: 1px dashed #E3D3B8;
  text-align: center;
}
.big-code {
  font-family: ui-monospace, "SF Mono", Menlo, monospace;
  font-size: 26px;
  letter-spacing: 4px;
  color: var(--ink);
  margin-top: 6px;
}

/* ---------------- 恢复条 ---------------- */
.resume {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 15px;
  margin-bottom: 22px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: var(--card);
}
.resume-t { flex: 1; min-width: 0; }
.resume-t b { display: block; font-size: 13.5px; font-weight: 600; margin-bottom: 3px; }
.resume-t span { font-size: 11px; color: var(--ink3); }
.resume-b {
  flex: none;
  padding: 8px 16px;
  border: none;
  border-radius: 99px;
  background: var(--ink);
  color: var(--bg);
  font: inherit;
  font-size: 12.5px;
  cursor: pointer;
}
.resume-x {
  flex: none;
  width: 26px;
  height: 26px;
  border: none;
  background: none;
  color: var(--ink3);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
}
