/* 首页路线图 */

.topbar {
  position: sticky; top: 0; z-index: 20;
  display: flex; align-items: center; justify-content: space-between; gap: 8px;
  padding: calc(10px + var(--safe-t)) 14px 10px;
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  -webkit-backdrop-filter: blur(10px); backdrop-filter: blur(10px);
  border-bottom: 2px solid var(--line);
}
.topbar-who { display: flex; align-items: center; gap: 8px; min-width: 0; }
.topbar-mascot { flex: none; width: 40px; height: 40px; }
.topbar-name { font-weight: 800; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.stats-chips { flex: none; display: flex; gap: 6px; }
.stat-chip {
  display: inline-flex; align-items: baseline; gap: 3px; padding: 5px 9px; border-radius: 999px;
  background: var(--surface); border: 2px solid var(--line); font-size: 14px; white-space: nowrap;
}
.stat-chip b { font-family: var(--font-round); font-weight: 900; font-size: 16px; }
.stat-unit { font-size: 11px; color: var(--muted); font-weight: 700; }
.stat-streak b { color: #E06A1B; } .stat-xp b { color: var(--sun-deep); } .stat-level b { color: var(--brand); }

.home-body { padding: 14px 0 8px; display: grid; gap: 18px; }

.review-entry {
  display: flex; align-items: center; gap: 12px; margin: 0 14px; padding: 12px 14px; min-height: 64px;
  border-radius: var(--r-lg); border: 2px solid var(--line); background: var(--surface);
  color: var(--ink); text-decoration: none; box-shadow: var(--shadow);
}
.review-entry.has-due { border-color: var(--sun); background: var(--sun-soft); }
.review-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: var(--soft); font-size: 22px; }
.review-entry.has-due .review-ico { background: var(--sun); }
.review-text { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.35; }
.review-text b { font-size: 16px; }
.review-text span { font-size: 13px; color: var(--muted); }
.review-go { font-size: 26px; color: var(--muted); }
.recall-entry.has-due { border-color: var(--ok); background: var(--ok-soft); }
.recall-entry.has-due .review-ico { background: var(--ok); }

/* 每个 stage 一段，一个主色 */
.stage { --c: var(--btn); }
.stage-1 { --c: #0E9C8B; } .stage-2 { --c: #2F7BEA; } .stage-3 { --c: #8457E8; }
.stage-4 { --c: #D93A48; } .stage-5 { --c: #D07F00; } .stage-6 { --c: #D8508F; }
.stage { --c-deep: color-mix(in srgb, var(--c) 70%, #000); --c-soft: color-mix(in srgb, var(--c) 16%, var(--bg)); }

.stage-head {
  display: flex; align-items: center; gap: 12px; margin: 0 14px; padding: 12px 14px;
  border-radius: var(--r-lg); background: var(--c); color: #fff; box-shadow: 0 5px 0 var(--c-deep);
}
.stage-ico { flex: none; display: grid; place-items: center; width: 44px; height: 44px; border-radius: 14px; background: rgba(255, 255, 255, .22); font-size: 24px; }
.stage-text { flex: 1; min-width: 0; }
.stage-title { font-size: 19px; font-weight: 900; line-height: 1.25; }
.stage-sub { font-size: 13px; opacity: .92; line-height: 1.35; }
.stage-count { flex: none; padding: 3px 10px; border-radius: 999px; background: rgba(0, 0, 0, .18); font-size: 13px; font-weight: 800; font-family: var(--font-round); }

.stage-track { position: relative; margin-top: 30px; }
.trail { position: absolute; left: 50%; top: 0; width: 1px; height: 100%; overflow: visible; }
.trail-seg { fill: none; stroke: var(--line); stroke-width: 12; stroke-linecap: round; stroke-dasharray: 2 20; }
.trail-seg.is-walked { stroke: var(--c); stroke-dasharray: none; opacity: .45; }

.node {
  position: absolute; z-index: 2; width: 76px; height: 70px; margin: -38px 0 0 -38px; padding: 0;
  border: 0; border-radius: 50%; background: var(--c); color: #fff;
  box-shadow: 0 7px 0 var(--c-deep);
  transition: transform .08s, box-shadow .08s;
}
.node:active { transform: translateY(5px); box-shadow: 0 2px 0 var(--c-deep); }
.node-face { font-size: 30px; font-weight: 900; font-family: var(--font-round); line-height: 1; }
.node-locked { background: var(--line); color: var(--muted); box-shadow: 0 7px 0 color-mix(in srgb, var(--line) 78%, #000); }
.node-locked .node-face { font-size: 24px; opacity: .8; }
.node-locked:active { box-shadow: 0 2px 0 color-mix(in srgb, var(--line) 78%, #000); }
.node.is-nope { animation: shake-x .4s; }
.node.is-current::before {
  content: ""; position: absolute; inset: -9px -9px -14px; border-radius: 50%;
  border: 4px solid var(--c); opacity: .5; animation: ring-pulse 1.8s ease-out infinite;
}
@keyframes ring-pulse { 0% { transform: scale(.92); opacity: .7; } 100% { transform: scale(1.14); opacity: 0; } }
.node-go {
  position: absolute; left: 50%; bottom: calc(100% + 10px); transform: translateX(-50%);
  padding: 4px 12px; border-radius: 12px; background: var(--surface); color: var(--c);
  border: 2px solid var(--line); font-size: 14px; font-weight: 900; white-space: nowrap;
  animation: bob 1.6s ease-in-out infinite;
}
.node-go::after {
  content: ""; position: absolute; left: 50%; top: 100%; margin-left: -6px;
  border: 6px solid transparent; border-top-color: var(--line);
}
.stars {
  position: absolute; left: 50%; top: calc(100% - 6px); transform: translateX(-50%);
  display: flex; gap: 1px; padding: 1px 7px; border-radius: 999px;
  background: var(--surface); border: 2px solid var(--line); font-size: 14px; line-height: 1.3;
}
.star { color: var(--line); }
.star.is-on { color: var(--sun); }

.node-label { position: absolute; z-index: 1; transform: translateY(-50%); display: flex; flex-direction: column; line-height: 1.3; }
.node-label.is-left { text-align: right; }
.node-title { font-size: 15px; font-weight: 800; }
.node-meta { font-size: 12px; color: var(--muted); }
.label-locked .node-title { color: var(--muted); font-weight: 700; }
.node-buddy { position: absolute; z-index: 1; width: 52px; height: 52px; margin: -22px 0 0 -26px; animation: bob 2.2s ease-in-out infinite; }
.node-buddy .mascot { width: 52px; height: 52px; }

.home-empty, .home-end { margin: 8px 20px; padding: 16px; text-align: center; color: var(--muted); border: 2px dashed var(--line); border-radius: var(--r-lg); }
