/* ============================================================
   LAVMAY · journey.css
   ============================================================ */

.jr-body { background: var(--lm-cream); }

/* ---------- 登录区 ---------- */
.auth-wrap {
  padding: clamp(30px, 5vw, 64px) 0 clamp(40px, 6vw, 80px);
}
.auth-grid {
  display: grid;
  grid-template-columns: 1.05fr .95fr;
  gap: clamp(26px, 5vw, 64px);
  align-items: start;
}
.auth-h {
  font-family: var(--font-display);
  font-size: clamp(36px, 5.2vw, 70px);
  font-weight: 700;
  line-height: .98;
  letter-spacing: -.045em;
  margin: 14px 0 20px;
}
.auth-lead { max-width: 520px; }
.auth-points { margin-top: clamp(22px, 3vw, 34px); }
.auth-points li {
  padding-block: 14px;
  border-top: 1px solid var(--lm-line);
  display: grid;
  grid-template-columns: 132px 1fr;
  gap: 16px;
  font-size: 13px;
  line-height: 1.7;
  color: var(--lm-muted);
}
.auth-points li:last-child { border-bottom: 1px solid var(--lm-line); }
.auth-points b { font-size: 13.5px; color: var(--lm-ink); }

/* 卡片 */
.auth-card {
  background: var(--lm-paper);
  border: 1.6px solid var(--lm-ink);
  border-radius: var(--r-lg);
  padding: clamp(20px, 2.6vw, 30px);
  box-shadow: var(--sh-hard-lg);
  /* ★ 这里原来有 `position: sticky; top: calc(var(--nav-h) + 16px);`，已删除。
     原因（实测，不是推测）：sticky 的生效前提是**父容器比自身高**，
     而 .auth-grid 实测高 501px、卡片高 473px，几乎没有余量，
     所以 top 永远触发不到 —— 这条 sticky 从未生效过。
     （另外 --nav-h 当时根本没定义，calc() 整条也是失效的。）
     留一条永不生效的 sticky 会让人以为「滚动时登录卡会吸顶」，比没有更糟。
     若将来左侧文案变长、需要真吸顶，再加回来，并先确认
     「.auth-grid 高度 > .auth-card 高度」这个前提成立。
     响应式里 604 行还有一条 `.auth-card { position: static }`，同样是无效声明，
     保留它无害（不会覆盖任何生效规则），此处不删以免影响移动端盒模型。 */
}
.auth-tabs {
  display: flex;
  gap: 4px;
  background: var(--lm-cream);
  border-radius: var(--r-sm);
  padding: 4px;
  margin-bottom: 20px;
}
.auth-tab {
  flex: 1;
  padding: 10px 14px;
  border-radius: 9px;
  font-size: 13.5px;
  font-weight: 600;
  color: var(--lm-muted);
  transition: background .2s, color .2s, box-shadow .2s;
}
.auth-tab.is-active {
  background: var(--lm-paper);
  color: var(--lm-ink);
  box-shadow: 0 1px 3px rgba(8, 24, 20, .12);
}
.auth-form { display: block; }
.auth-form[hidden] { display: none; }
.auth-foot {
  font-size: 12.5px;
  color: var(--lm-muted);
  margin-top: 14px;
  text-align: center;
}
.link-btn {
  color: var(--lm-teal);
  font-size: inherit;
  font-weight: 600;
  text-decoration: underline;
  text-underline-offset: 3px;
  text-decoration-thickness: 1px;
  /* 看着像文字链接，实际是可点按钮 ⇒ 热区必须够大。
     原先 padding:2px 让高度只有 21px，手机上手很难点中。
     用「加大 padding + 等量负 margin」把热区撑到 44px 而不改变版式。 */
  display: inline-block;
  padding: 11px 6px;
  margin: -9px -4px;
  min-height: 44px;
  line-height: 1.5;
}
.link-btn:hover { color: var(--lm-ink); }
.auth-demo {
  margin-top: 20px;
  padding-top: 16px;
  border-top: 1.2px dashed var(--lm-line);
  font-size: 12px;
  color: var(--lm-muted);
  display: flex;
  flex-wrap: wrap;
  gap: 4px 8px;
  align-items: baseline;
}

/* ---------- 说明区 ---------- */
.jr-explain { border-top: 1.5px solid var(--lm-line); }
.jr-explain-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 1px;
  background: var(--lm-line);
  border: 1.5px solid var(--lm-line);
  border-radius: var(--r-md);
  overflow: hidden;
  margin-top: clamp(20px, 3vw, 32px);
}
.jr-explain-grid article {
  background: var(--lm-paper);
  padding: clamp(18px, 2.2vw, 26px);
}
.jr-explain-grid .mono {
  font-size: 10.5px;
  color: var(--lm-teal);
  letter-spacing: .1em;
  font-weight: 700;
}
.jr-explain-grid h3 { font-size: 15.5px; font-weight: 700; margin: 10px 0 6px; }
.jr-explain-grid p { font-size: 12.5px; line-height: 1.72; color: var(--lm-muted); }

/* ---------- 控制台 ---------- */
.dash { padding-top: clamp(20px, 3vw, 36px); }
.dash[hidden] { display: none; }
.dash-top {
  display: flex;
  flex-wrap: wrap;
  gap: 16px 24px;
  align-items: flex-end;
  justify-content: space-between;
  padding-bottom: clamp(18px, 2.4vw, 26px);
  border-bottom: 1.5px solid var(--lm-line);
  margin-bottom: clamp(20px, 3vw, 30px);
}
.dash-h {
  font-family: var(--font-display);
  font-size: clamp(28px, 3.6vw, 42px);
  font-weight: 700;
  letter-spacing: -.035em;
  line-height: 1.05;
  margin: 8px 0 6px;
}
.dash-sub { font-size: 13px; color: var(--lm-muted); }
.dash-quick { display: flex; gap: 8px; flex-wrap: wrap; }

/* 基线设置 */
.setup-card {
  background: var(--lm-paper);
  border: 1.6px solid var(--lm-ink);
  border-radius: var(--r-lg);
  padding: clamp(20px, 3vw, 34px);
  box-shadow: var(--sh-hard);
}
.setup-head { margin-bottom: 22px; }
.setup-head h2 { margin: 12px 0 8px; }
.setup-head p { font-size: 13px; line-height: 1.7; color: var(--lm-muted); }
.setup-form {
  display: grid;
  grid-template-columns: repeat(2, 1fr);
  gap: 0 18px;
}
.setup-form .btn { grid-column: 1 / -1; justify-self: start; margin-top: 6px; }
.setup-form .auth-msg { grid-column: 1 / -1; }

.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip {
  padding: 8px 14px;
  border-radius: var(--r-pill);
  border: 1.4px solid var(--lm-line);
  background: var(--lm-white);
  font-size: 12.5px;
  color: var(--lm-muted);
  transition: all .18s;
  min-height: 36px;
}
.chip:hover { border-color: var(--lm-teal-soft); color: var(--lm-ink); }
.chip[aria-pressed="true"] {
  background: var(--lm-ink);
  color: var(--lm-lime);
  border-color: var(--lm-ink);
  font-weight: 600;
}

/* KPI */
.kpi-row {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: clamp(10px, 1.4vw, 16px);
  margin-bottom: clamp(14px, 2vw, 20px);
}
.kpi {
  background: var(--lm-paper);
  border: 1.5px solid var(--lm-line);
  border-radius: var(--r-md);
  padding: 16px 18px;
  position: relative;
  overflow: hidden;
}
.kpi-l {
  font-family: var(--font-mono);
  font-size: 10.5px;
  letter-spacing: .1em;
  color: var(--lm-muted-2);
  text-transform: uppercase;
}
.kpi-v {
  font-size: clamp(25px, 2.7vw, 33px);
  font-weight: 700;
  letter-spacing: -.03em;
  line-height: 1.1;
  margin: 7px 0 4px;
  font-variant-numeric: tabular-nums;
}
.kpi-v u { text-decoration: none; font-size: .44em; font-weight: 600; margin-left: 3px; opacity: .55; }
.kpi-d { font-size: 11.5px; line-height: 1.55; color: var(--lm-muted); }
.kpi-d b { font-weight: 700; }
.kpi--hero { background: var(--lm-ink); color: var(--lm-cream); border-color: var(--lm-ink); }
.kpi--hero .kpi-l { color: #9db2ab; }
.kpi--hero .kpi-d { color: #a8bcb5; }
.kpi--hero .kpi-d b { color: var(--lm-lime); }
.up { color: #b33518; }
.down { color: var(--lm-teal); }

/* 面板 */
.panel-grid {
  display: grid;
  grid-template-columns: 1fr 320px;
  gap: clamp(12px, 1.8vw, 18px);
  margin-bottom: clamp(14px, 2vw, 20px);
  align-items: stretch;
}
.panel {
  background: var(--lm-paper);
  border: 1.5px solid var(--lm-line);
  border-radius: var(--r-lg);
  padding: clamp(16px, 2.2vw, 26px);
  margin-bottom: clamp(14px, 2vw, 20px);
}
.panel-grid > .panel { margin-bottom: 0; }
.panel-head {
  display: flex;
  flex-wrap: wrap;
  gap: 10px 18px;
  justify-content: space-between;
  align-items: flex-start;
  margin-bottom: 16px;
}
.panel-sub { font-size: 12px; color: var(--lm-muted-2); margin-top: 4px; line-height: 1.6; }

.seg {
  display: flex;
  gap: 2px;
  background: var(--lm-cream);
  border-radius: var(--r-pill);
  padding: 3px;
  flex: none;
}
.seg-b {
  padding: 7px 13px;
  border-radius: var(--r-pill);
  font-size: 12px;
  color: var(--lm-muted);
  font-weight: 600;
  transition: background .18s, color .18s;
  min-height: 32px;
}
.seg-b.is-active { background: var(--lm-paper); color: var(--lm-ink); box-shadow: 0 1px 2px rgba(8,24,20,.14); }

/* 图表 */
.chart-host { position: relative; min-height: 240px; }
.chart-host svg { width: 100%; height: auto; display: block; overflow: visible; }
.chart-empty {
  position: absolute;
  inset: 0;
  display: grid;
  place-items: center;
  font-size: 12.5px;
  color: var(--lm-muted-2);
  background: var(--lm-mint-wash);
  border: 1.2px dashed var(--lm-line);
  border-radius: var(--r-sm);
  text-align: center;
  padding: 20px;
}
.chart-legend {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 18px;
  margin-top: 12px;
  padding-top: 12px;
  border-top: 1px solid var(--lm-line-soft);
  font-size: 11.5px;
  color: var(--lm-muted);
}
.chart-legend span { display: inline-flex; align-items: center; gap: 6px; }
.chart-legend i { width: 14px; height: 3px; border-radius: 2px; display: block; }
.lg-w { background: #0e6f66; }
.lg-wa { background: #ff6a46; }
.lg-goal { background: transparent; border-top: 2px dashed #8a9a93; height: 0 !important; }
.lg-mood { background: #bfd93f; }

/* 圆环 */
.panel--progress { display: flex; flex-direction: column; }
.ring-wrap { position: relative; width: 168px; margin: 6px auto 16px; }
.ring { width: 100%; height: auto; }
.ring-txt {
  position: absolute;
  inset: 0;
  display: grid;
  place-content: center;
  text-align: center;
  line-height: 1.15;
}
.ring-txt b { font-size: 30px; font-weight: 700; letter-spacing: -.03em; display: block; }
.ring-txt span { font-size: 10.5px; color: var(--lm-muted-2); letter-spacing: .06em; }
.prog-facts { margin-top: auto; }
.prog-facts > div {
  display: flex;
  justify-content: space-between;
  gap: 10px;
  padding-block: 9px;
  border-top: 1px solid var(--lm-line-soft);
  font-size: 12.5px;
}
.prog-facts dt { color: var(--lm-muted); }
.prog-facts dd { font-weight: 700; font-variant-numeric: tabular-nums; }
.panel-note {
  margin-top: 12px;
  padding: 10px 12px;
  background: var(--lm-mint-wash);
  border-radius: var(--r-xs);
  font-size: 11.5px;
  line-height: 1.7;
  color: var(--lm-ink-3);
}

/* 记录表单 */
.rec-form { display: block; }
.rec-grid {
  display: grid;
  grid-template-columns: repeat(5, 1fr);
  gap: 0 14px;
}
.rec-fieldset {
  border: none;
  margin: 4px 0 16px;
  padding: 0;
}
.rec-fieldset legend {
  font-size: 11.5px;
  font-weight: 600;
  letter-spacing: .04em;
  color: var(--lm-muted);
  margin-bottom: 10px;
}
.lg-hint { font-weight: 400; color: var(--lm-muted-2); margin-left: 6px; }
.scale-row {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 14px;
}
.scale-l { display: block; font-size: 12px; color: var(--lm-muted); margin-bottom: 7px; }
.scale-btns { display: flex; gap: 4px; }
.scale-btns button {
  flex: 1;
  min-width: 0;
  height: 40px;
  border-radius: var(--r-xs);
  border: 1.4px solid var(--lm-line);
  background: var(--lm-white);
  font-size: 13px;
  font-weight: 600;
  color: var(--lm-muted);
  transition: all .15s;
  font-variant-numeric: tabular-nums;
}
.scale-btns button:hover { border-color: var(--lm-teal-soft); }
.scale-btns button[aria-checked="true"] {
  background: var(--lm-teal);
  color: #fff;
  border-color: var(--lm-teal);
}

/* 照片 */
.rec-photo { margin: 4px 0 16px; }
.photo-drop {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px;
  border: 1.4px dashed var(--lm-line);
  border-radius: var(--r-sm);
  cursor: pointer;
  transition: border-color .2s, background .2s;
  background: var(--lm-mint-wash);
}
.photo-drop:hover { border-color: var(--lm-teal-soft); background: var(--lm-mint-soft); }
.photo-ico {
  width: 38px; height: 38px;
  border-radius: var(--r-xs);
  background: var(--lm-ink);
  color: var(--lm-lime);
  display: grid;
  place-items: center;
  font-size: 19px;
  flex: none;
}
.photo-txt b { display: block; font-size: 13.5px; }
.photo-txt small { font-size: 11.5px; color: var(--lm-muted-2); }
.photo-preview {
  display: flex;
  gap: 16px;
  align-items: center;
  padding: 12px;
  border: 1.4px solid var(--lm-line);
  border-radius: var(--r-sm);
  background: var(--lm-cream);
}
.photo-preview img {
  width: 96px; height: 120px;
  object-fit: cover;
  border-radius: var(--r-xs);
  background: var(--lm-line-soft);
  flex: none;
}
.photo-preview > div { display: flex; flex-direction: column; gap: 8px; }

.rec-actions {
  display: flex;
  flex-wrap: wrap;
  align-items: center;
  gap: 14px;
}
.rec-hint { font-size: 11.5px; color: var(--lm-muted-2); }

/* 时间轴 */
.tl { position: relative; padding-left: 26px; }
.tl::before {
  content: '';
  position: absolute;
  left: 5px; top: 6px; bottom: 6px;
  width: 1.5px;
  background: var(--lm-line);
}
.tl-item { position: relative; padding-bottom: 22px; }
.tl-item::before {
  content: '';
  position: absolute;
  left: -24px; top: 6px;
  width: 9px; height: 9px;
  border-radius: 50%;
  background: var(--lm-paper);
  border: 2.5px solid var(--lm-teal-soft);
}
.tl-item.is-first::before { background: var(--lm-teal); border-color: var(--lm-teal); }
.tl-item.is-last::before { background: var(--lm-lime); border-color: var(--lm-ink); }
.tl-date {
  font-family: var(--font-mono);
  font-size: 11px;
  color: var(--lm-muted-2);
  letter-spacing: .04em;
}
.tl-head {
  display: flex;
  flex-wrap: wrap;
  align-items: baseline;
  gap: 8px 14px;
  margin: 4px 0 6px;
}
.tl-w { font-size: 19px; font-weight: 700; letter-spacing: -.02em; font-variant-numeric: tabular-nums; }
.tl-w u { text-decoration: none; font-size: .55em; font-weight: 600; opacity: .5; margin-left: 2px; }
.tl-delta { font-size: 11.5px; font-weight: 700; font-family: var(--font-mono); }
.tl-meta { font-size: 11.5px; color: var(--lm-muted); display: flex; flex-wrap: wrap; gap: 4px 12px; }
.tl-note {
  font-size: 12.5px;
  line-height: 1.7;
  color: var(--lm-ink-2);
  margin-top: 7px;
  padding: 9px 12px;
  background: var(--lm-cream);
  border-radius: var(--r-xs);
  border-left: 2.5px solid var(--lm-teal-soft);
}
.tl-photos { display: flex; gap: 8px; margin-top: 9px; flex-wrap: wrap; }
.tl-photos img {
  width: 62px; height: 78px;
  object-fit: cover;
  border-radius: 6px;
  border: 1.2px solid var(--lm-line);
}
.tl-tools { margin-top: 8px; display: flex; gap: 12px; }
.tl-empty {
  font-size: 12.5px;
  color: var(--lm-muted-2);
  padding: 24px 0;
  text-align: center;
}

/* 相册 */
.gallery { display: grid; grid-template-columns: 1fr auto 1fr; gap: 14px; align-items: center; }
.gal-cell { text-align: center; }
.gal-cell img {
  width: 100%;
  aspect-ratio: 3 / 4;
  object-fit: cover;
  border-radius: var(--r-sm);
  border: 1.4px solid var(--lm-line);
  background: var(--lm-cream);
}
.gal-cell .gal-ph {
  width: 100%;
  aspect-ratio: 3 / 4;
  border-radius: var(--r-sm);
  border: 1.4px dashed var(--lm-line);
  display: grid;
  place-items: center;
  background: var(--lm-mint-wash);
  font-size: 12px;
  color: var(--lm-muted-2);
  text-align: center;
  padding: 16px;
}
.gal-cap { font-size: 11.5px; color: var(--lm-muted); margin-top: 8px; line-height: 1.6; }
.gal-arrow { font-size: 20px; color: var(--lm-muted-2); }

/* 里程碑 */
.miles { display: grid; grid-template-columns: repeat(auto-fill, minmax(210px, 1fr)); gap: 12px; }
.mile {
  border: 1.5px solid var(--lm-line);
  border-radius: var(--r-md);
  padding: 16px;
  background: var(--lm-paper);
  opacity: .52;
  transition: opacity .2s, transform .2s, border-color .2s;
}
.mile.is-on {
  opacity: 1;
  border-color: var(--lm-teal-soft);
  background: var(--lm-mint-wash);
}
.mile-badge {
  width: 32px; height: 32px;
  border-radius: 9px;
  background: var(--lm-cream);
  display: grid;
  place-items: center;
  font-size: 15px;
  margin-bottom: 10px;
}
.mile.is-on .mile-badge { background: var(--lm-teal); color: #fff; }
.mile-t { font-size: 13.5px; font-weight: 700; }
.mile-d { font-size: 11.5px; color: var(--lm-muted); margin-top: 5px; line-height: 1.6; }
.mile-at {
  font-family: var(--font-mono);
  font-size: 10.5px;
  color: var(--lm-teal);
  margin-top: 8px;
  letter-spacing: .04em;
}

/* 纪念卡 */
.panel--memorial { background: var(--lm-mint-wash); }
.memorial-stage {
  display: grid;
  place-items: center;
  padding: clamp(10px, 2vw, 20px);
}
.memorial-stage canvas {
  width: 100%;
  max-width: 420px;
  height: auto;
  border-radius: var(--r-md);
  box-shadow: var(--sh-float);
  border: 1.4px solid var(--lm-line);
  background: var(--lm-paper);
}

/* 危险区 */
.panel--danger { border-color: #edc9bd; background: #fffaf7; }
.danger-actions { display: flex; flex-wrap: wrap; gap: 10px; margin-top: 14px; }

/* 响应式 */
@media (max-width: 1100px) {
  .panel-grid { grid-template-columns: 1fr; }
  .panel--progress { flex-direction: row; flex-wrap: wrap; align-items: center; gap: 20px; }
  .panel--progress .h3 { width: 100%; }
  .ring-wrap { margin: 0; }
  .prog-facts { flex: 1; min-width: 200px; margin-top: 0; }
  .panel-note { width: 100%; }
}
@media (max-width: 980px) {
  .auth-grid { grid-template-columns: 1fr; }
  .auth-card { position: static; max-width: 480px; box-shadow: var(--sh-hard); }
  .jr-explain-grid { grid-template-columns: repeat(2, 1fr); }
  .kpi-row { grid-template-columns: repeat(2, 1fr); }
  .rec-grid { grid-template-columns: repeat(2, 1fr); }
  .scale-row { grid-template-columns: 1fr; }
  .photo-preview { flex-direction: column; align-items: flex-start; }
}
@media (max-width: 620px) {
  .auth-points li, .setup-form { grid-template-columns: 1fr; gap: 4px; }
  .jr-explain-grid { grid-template-columns: 1fr; }
  .kpi-row { grid-template-columns: 1fr 1fr; }
  .rec-grid { grid-template-columns: 1fr 1fr; }
  .gallery { grid-template-columns: 1fr; }
  .gal-arrow { transform: rotate(90deg); }
  .tl { padding-left: 20px; }
  .tl-item::before { left: -18px; }
  .danger-actions .btn { width: 100%; justify-content: center; }
}

/* ---------- 导航用户信息 ---------- */
.nav-user {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 4px 10px 4px 4px;
  border-radius: var(--r-pill);
  background: var(--lm-mint);
  border: 1px solid rgba(14, 111, 102, .18);
}
.nav-av {
  width: 26px; height: 26px;
  border-radius: 50%;
  background: var(--lm-ink);
  color: var(--lm-lime);
  display: grid;
  place-items: center;
  font-size: 12px;
  font-weight: 700;
  flex: none;
}
.nav-nm {
  font-size: 12.5px;
  font-weight: 600;
  max-width: 90px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

/* ---------- Toast ---------- */
.lm-toast {
  position: fixed;
  left: 50%;
  bottom: 28px;
  transform: translate(-50%, 18px);
  z-index: 900;
  max-width: min(90vw, 460px);
  padding: 13px 20px;
  border-radius: var(--r-pill);
  background: var(--lm-ink);
  color: var(--lm-cream);
  font-size: 13px;
  line-height: 1.6;
  box-shadow: var(--sh-float);
  opacity: 0;
  pointer-events: none;
  transition: opacity .3s, transform .3s var(--ease-out);
  text-align: center;
}
.lm-toast.is-on { opacity: 1; transform: translate(-50%, 0); }

@media (max-width: 560px) {
  .nav-nm { display: none; }
  .nav-user { padding: 4px; }
}
