:root {
  color-scheme: light;
  --ink: #16332f;
  --ink-soft: #5d7873;
  --line: #dcebe6;
  --brand: #147b6f;
  --brand-soft: #e6f4f0;
  --bg: #f4faf8;
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; overflow: hidden; }
body { margin: 0; background: var(--bg); overscroll-behavior: none; position: fixed; inset: 0; width: 100%; }
/* 双击放大也一并关掉，只保留纵向滚动手势。 */
* { touch-action: pan-y; }
button { font: inherit; cursor: pointer; border-radius: 12px; }
h1, h2 { margin: 0; }

/* ---------- 启动场景 ---------- */
.boot {
  position: fixed; inset: 0; z-index: 20; display: flex; flex-direction: column;
  align-items: center; justify-content: center; gap: 14px; padding: 32px 28px;
  background: radial-gradient(circle at 50% 30%, #dff3ec 0, var(--bg) 60%);
  text-align: center;
}
.boot-mark { position: relative; width: 92px; height: 92px; margin-bottom: 6px; }
.boot-mark .ring, .boot-mark .core { position: absolute; border-radius: 50%; }
.boot-mark .ring { inset: 0; border: 2px solid rgba(20, 123, 111, .35); animation: ripple 2.2s ease-out infinite; }
.boot-mark .ring.d1 { animation-delay: 1.1s; }
.boot-mark .core { inset: 32px; background: var(--brand); box-shadow: 0 6px 18px rgba(20, 123, 111, .35); }
@keyframes ripple { from { transform: scale(.55); opacity: .9; } to { transform: scale(1); opacity: 0; } }
.boot-title { font-size: 24px; letter-spacing: -.02em; }
.boot-detail { margin: 0; color: var(--ink-soft); font-size: 14px; line-height: 1.7; max-width: 30em; }
.boot-steps { list-style: none; margin: 10px 0 0; padding: 0; display: grid; gap: 10px; font-size: 14px; color: var(--ink-soft); }
.boot-steps li { display: flex; align-items: center; gap: 10px; opacity: .45; transition: opacity .3s ease; }
.boot-steps li i { width: 16px; height: 16px; border-radius: 50%; border: 2px solid var(--line); flex: 0 0 auto; }
.boot-steps li.done { opacity: 1; color: var(--ink); }
.boot-steps li.done i { border-color: var(--brand); background: var(--brand); }
.boot-fail { margin-top: 18px; display: grid; gap: 12px; width: min(100%, 360px); }
.boot-fail p { margin: 0; font-size: 14px; line-height: 1.7; }
.boot-code { color: #90a5a1; font-size: 12px; }
.boot.failed .boot-mark { animation: none; opacity: .4; }
@media (prefers-reduced-motion: reduce) { .boot-mark .ring { animation: none; opacity: .5; } }

/* ---------- 应用外壳 ---------- */
.app { display: flex; flex-direction: column; height: 100vh; height: 100dvh; width: min(100%, 720px); margin: 0 auto; background: var(--bg); box-shadow: 0 0 0 1px var(--line); }
/* 输入法弹出时隐藏 tab 栏。可视区被键盘压缩后，tab 栏会浮到键盘正上方，
   既挡内容又容易误触；正在打字时需要留在屏幕上的只有输入框和发送。 */
.app:has(textarea:focus) .tabbar,
.app:has(input:not([type="checkbox"]):not([type="radio"]):focus) .tabbar,
.app.keyboard-open .tabbar { display: none !important; }
.app:has(textarea:focus) .composer,
.app:has(input:not([type="checkbox"]):not([type="radio"]):focus) .composer,
.app.keyboard-open .composer { padding-bottom: 10px; }
.topbar {
  display: flex; align-items: center; justify-content: space-between; gap: 12px;
  padding: max(8px, env(safe-area-inset-top)) 14px 8px; background: #fff; border-bottom: 1px solid var(--line);
}
.who { display: flex; align-items: center; gap: 10px; min-width: 0; }
.avatar { width: 28px; height: 28px; border-radius: 50%; flex: 0 0 auto; background: linear-gradient(140deg, #7fd3c1, var(--brand)); }
.who-name { margin: 0; font-weight: 700; font-size: 14px; }
.who-sub { margin: 1px 0 0; font-size: 10px; color: var(--ink-soft); }
.ghost { border: 1px solid var(--line); background: #fff; color: var(--brand); padding: 6px 10px; font-size: 12px; }
.ghost.wide { width: 100%; margin-top: 8px; }
main { flex: 1; min-height: 0; }
.view { height: 100%; display: flex; flex-direction: column; overflow: hidden; }
#view-wall, #view-me { overflow-y: auto; padding: 14px 14px 20px; gap: 12px; }

.tabbar { display: flex; border-top: 1px solid var(--line); background: #fff; padding-bottom: env(safe-area-inset-bottom); }
.tab {
  flex: 1; border: 0; background: none; padding: 10px 4px 12px; border-radius: 0;
  display: grid; gap: 3px; justify-items: center; font-size: 12px; color: var(--ink-soft);
}
.tab span { font-size: 19px; }
.tab.on { color: var(--brand); font-weight: 700; }

/* ---------- 树洞 ---------- */
.privacy-note { padding: 10px 14px; background: var(--brand-soft); color: #2a6b62; font-size: 12px; line-height: 1.6; }
.stream { flex: 1; overflow-y: auto; padding: 14px; display: flex; flex-direction: column; gap: 10px; }
.bubble { max-width: 82%; padding: 11px 14px; border-radius: 16px; font-size: 15px; line-height: 1.7; }
.bubble-text { margin: 0; white-space: pre-wrap; }
.bubble.bot { align-self: flex-start; background: #fff; border: 1px solid var(--line); border-bottom-left-radius: 5px; }
.bubble.mine { align-self: flex-end; background: var(--brand); color: #fff; border-bottom-right-radius: 5px; }
.bubble.typing { color: var(--ink-soft); font-size: 13px; display: flex; align-items: center; gap: 7px; }
.bubble.typing i { width: 5px; height: 5px; border-radius: 50%; background: currentColor; opacity: .3; animation: typing-dot 1.25s ease-in-out infinite; }
.bubble.typing i:nth-of-type(2) { animation-delay: .18s; }
.bubble.typing i:nth-of-type(3) { animation-delay: .36s; }
@keyframes typing-dot { 0%, 65%, 100% { opacity: .25; transform: translateY(0); } 30% { opacity: .95; transform: translateY(-3px); } }
@media (prefers-reduced-motion: reduce) { .bubble.typing i { animation: none; opacity: .5; } }
.card { align-self: flex-start; max-width: 88%; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 13px; display: flex; gap: 11px; }
.card.consent { display: block; border-color: #e7c39a; background: #fffaf3; }
.card-icon { font-size: 22px; }
.card-title { margin: 0 0 4px; font-weight: 700; font-size: 14px; }
.card-desc { margin: 0; color: var(--ink-soft); font-size: 13px; line-height: 1.65; }
.card-tag { margin: 6px 0 0; font-size: 11px; color: var(--brand); }
.card-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.support-summary { margin: 12px 0; padding-left: 12px; border-left: 3px solid var(--brand); }
.support-summary-label { margin: 0; color: var(--brand); font-size: 15px; font-weight: 600; }
.support-summary-code { margin: 5px 0 0; color: var(--ink-soft); font-size: 12px; overflow-wrap: anywhere; }
.presets { display: flex; gap: 8px; padding: 0 14px 8px; overflow-x: auto; }
.preset { flex: 0 0 auto; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); padding: 7px 12px; font-size: 13px; border-radius: 999px; }
.composer { display: flex; gap: 8px; padding: 10px 14px calc(10px + env(safe-area-inset-bottom)); background: #fff; border-top: 1px solid var(--line); }
.composer textarea { flex: 1; resize: none; border: 1px solid var(--line); border-radius: 12px; padding: 10px 12px; font: inherit; font-size: 15px; max-height: 96px; }
.composer.wall { flex-direction: column; border: 1px solid var(--line); border-radius: 16px; padding: 12px; }
.composer-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.composer-safe { font-size: 11px; color: var(--ink-soft); }
.primary { border: 0; background: var(--brand); color: #fff; padding: 11px 18px; font-weight: 700; }
.primary:disabled { opacity: .55; }
.secondary { border: 1px solid var(--line); background: #fff; color: #315e56; padding: 11px 16px; font-weight: 600; }
.small { padding: 8px 13px; font-size: 13px; }
.send { padding: 0 18px; }

/* ---------- 广场 ---------- */
.feed { display: grid; gap: 12px; }
.post { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 13px; }
.post.mine { border-color: #bfe0d7; }
.post-head { display: flex; align-items: center; gap: 8px; font-size: 12px; color: var(--ink-soft); }
.post-author { font-weight: 700; color: var(--ink); }
.post-time { margin-left: auto; }
.post-body { margin: 8px 0 10px; font-size: 15px; line-height: 1.75; white-space: pre-wrap; }
.post-actions { display: flex; align-items: center; gap: 12px; }
.hug { border: 1px solid var(--line); background: #fff; padding: 6px 11px; font-size: 13px; color: var(--ink-soft); }
.hug.on { border-color: var(--brand); color: var(--brand); background: var(--brand-soft); }
.link { border: 0; background: none; color: var(--brand); font-size: 13px; padding: 4px; }
.link.danger { color: #c05656; margin-left: auto; }
.replies { margin-top: 10px; display: grid; gap: 6px; border-top: 1px dashed var(--line); padding-top: 9px; }
.reply { font-size: 13px; line-height: 1.6; }
.reply-author { font-weight: 700; margin-right: 6px; }
.reply-box { display: flex; gap: 8px; margin-top: 10px; }
.reply-box input { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 8px 10px; font: inherit; font-size: 14px; }
.chip { border: 1px solid var(--line); background: #fff; color: var(--ink-soft); font-size: 12px; padding: 6px 11px; border-radius: 999px; }
.chip.on { border-color: var(--brand); background: var(--brand-soft); color: var(--brand); font-weight: 700; }
.chip.sim { border-color: #e0c48f; background: #fdf6e8; color: #8a6a2a; padding: 2px 7px; }
.chip-row { display: flex; flex-wrap: wrap; gap: 8px; }
.empty { color: var(--ink-soft); font-size: 14px; text-align: center; padding: 24px 0; margin: 0; }

/* ---------- 我的 ---------- */
.panel { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 14px; display: grid; gap: 10px; }
.panel h2 { font-size: 15px; }
.panel-sub { margin: -4px 0 0; font-size: 12px; color: var(--ink-soft); line-height: 1.6; }
.stat-row { display: flex; gap: 10px; }
.stat { flex: 1; background: var(--brand-soft); border-radius: 12px; padding: 12px; display: grid; gap: 3px; text-align: center; }
.stat b { font-size: 22px; color: var(--brand); }
.stat span { font-size: 11px; color: var(--ink-soft); }
.res-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 9px; }
.res-list li { display: flex; justify-content: space-between; gap: 10px; font-size: 14px; }
.res-meta { color: var(--ink-soft); font-size: 12px; flex: 0 0 auto; }

/* ---------- 浮层 ---------- */
.sheet { position: fixed; inset: 0; z-index: 30; background: rgba(16, 45, 41, .42); display: flex; align-items: flex-end; }
.sheet-box { width: 100%; background: #fff; border-radius: 20px 20px 0 0; padding: 20px 18px calc(20px + env(safe-area-inset-bottom)); display: grid; gap: 12px; max-height: 82vh; overflow-y: auto; }
.sheet-box h2 { font-size: 17px; }
.sheet-box p { margin: 0; font-size: 14px; line-height: 1.75; color: var(--ink-soft); }
.toast {
  position: fixed; left: 50%; bottom: 88px; transform: translate(-50%, 12px); z-index: 40;
  background: rgba(22, 51, 47, .93); color: #fff; padding: 10px 16px; border-radius: 12px;
  font-size: 13px; max-width: 86vw; text-align: center; opacity: 0; pointer-events: none; transition: opacity .2s, transform .2s;
}
.toast.on { opacity: 1; transform: translate(-50%, 0); }
[hidden] { display: none !important; }

/* ---------- Stage 2D：危机资源、预约、授权 ---------- */
.card.crisis { display: block; border-color: #d9a5a5; background: #fff6f5; }
.crisis-list { list-style: none; margin: 10px 0; padding: 0; display: grid; gap: 8px; }
.crisis-list li { display: grid; gap: 2px; }
.crisis-tel { font-size: 20px; font-weight: 700; color: #b04141; text-decoration: none; letter-spacing: .04em; }
.crisis-name { font-size: 13px; font-weight: 600; }
.crisis-note { font-size: 12px; color: var(--ink-soft); line-height: 1.55; }
.apt-list { list-style: none; margin: 0; padding: 0; display: grid; gap: 10px; }
.apt-list li { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.apt-code { font-weight: 700; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; margin-right: 8px; }
.apt-status { font-size: 12px; color: var(--brand); background: var(--brand-soft); padding: 3px 8px; border-radius: 999px; }
.consent-list { display: grid; gap: 10px; }
.consent-row { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: 14px; line-height: 1.6; }
.consent-row input { width: 20px; height: 20px; flex: 0 0 auto; accent-color: var(--brand); }
.consent-row input:disabled { opacity: .45; }
/* 「处理中」必须占位显示：这是唯一能说明「服务端还没确认」的信号。 */
.consent-status { margin-left: auto; font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
.build-id { font-size: 11px; color: #9db2ae; font-family: ui-monospace, SFMono-Regular, Menlo, monospace; }
.panel.urgent { border-color: #e0b96b; background: #fffbf2; }
.auth-request { border-top: 1px dashed var(--line); padding-top: 10px; }
.auth-request:first-of-type { border-top: 0; padding-top: 0; }
.auth-reason { margin: 0 0 4px; font-size: 14px; line-height: 1.65; }

/* 资源反馈 */
.res-item { display: grid; gap: 6px; padding-bottom: 10px; border-bottom: 1px dashed var(--line); }
.res-item:last-child { border-bottom: 0; padding-bottom: 0; }
.res-row { display: flex; justify-content: space-between; gap: 10px; }
.res-actions { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.res-state { font-size: 12px; color: var(--brand); background: var(--brand-soft); padding: 2px 8px; border-radius: 999px; }
.link.mut { color: var(--ink-soft); }
.res-stars { display: flex; gap: 2px; }
.star { border: 0; background: none; font-size: 18px; color: #d6e2df; padding: 0 2px; line-height: 1; }
.star.on { color: #e8a72c; }

/* ---------- 活动参与浮层 ---------- */
.act-overlay { position: fixed; inset: 0; z-index: 50; background: rgba(16, 45, 41, .45); display: flex; align-items: flex-end; }
.act-overlay.opening { animation: sheet-fade .22s ease both; }
.act-overlay.closing { animation: sheet-fade .2s ease reverse both; }
/* 高度固定，不随内容长短忽高忽低：太矮会让人以为是提示条而不是一张卡片。
   顶部始终留一条缝，说明底下的页面还在。 */
.act-sheet { width: min(100%, 720px); margin: 0 auto; background: var(--bg); border-radius: 20px 20px 0 0;
  height: 88vh; height: 88dvh; display: flex; flex-direction: column; }
/* 只在打开那一次播放。卡片每走一步都会被重建，动画若挂在元素本身，
   每点一次「下一步」都会重新滑一遍。 */
.act-overlay.opening .act-sheet { animation: sheet-up .28s cubic-bezier(.22, .8, .28, 1) both; }
.act-overlay.closing .act-sheet { animation: sheet-up .2s ease reverse both; }
@keyframes sheet-up { from { transform: translateY(100%); } to { transform: translateY(0); } }
@keyframes sheet-fade { from { opacity: 0; } to { opacity: 1; } }
@media (prefers-reduced-motion: reduce) {
  .act-overlay.opening, .act-overlay.opening .act-sheet,
  .act-overlay.closing, .act-overlay.closing .act-sheet { animation: none; }
}
.act-head { display: flex; align-items: center; gap: 10px; padding: 14px 16px; border-bottom: 1px solid var(--line); background: #fff; border-radius: 20px 20px 0 0; }
.act-back { border: 0; background: none; font-size: 26px; line-height: 1; color: var(--ink-soft); padding: 0 6px; }
.act-title { margin: 0; font-weight: 700; font-size: 16px; }
.act-meta { margin: 2px 0 0; font-size: 12px; color: var(--ink-soft); }
.act-body { padding: 18px 16px calc(20px + env(safe-area-inset-bottom)); overflow-y: auto; flex: 1; display: grid; gap: 14px; align-content: start; }
.act-head { flex-shrink: 0; }
.act-body { min-height: 0; }
.act-sheet--experience .act-head { padding: 10px 14px; }
.act-sheet--experience .act-body { padding: 12px 14px calc(16px + env(safe-area-inset-bottom)); gap: 10px; }
.act-experience-heading { display: flex; align-items: center; gap: 12px; justify-content: space-between; }
.act-experience-heading .act-step-title { margin: 0; font-size: 17px; line-height: 1.4; }
.act-step-count { flex-shrink: 0; font-size: 12px; color: var(--ink-soft); }
.act-cue { margin: 0; font-size: 13px; color: var(--ink-soft); }
.act-engine { display: grid; gap: 10px; min-width: 0; }
.act-instructions { border-top: 1px solid var(--line); padding-top: 10px; color: var(--ink-soft); font-size: 13px; }
.act-instructions summary { cursor: pointer; padding: 6px 0; }
.act-instructions p { margin: 8px 0 0; line-height: 1.65; }
.act-conclusion { display: grid; gap: 14px; padding-bottom: 8px; }
.act-closing-copy { margin: 4px 0 0; line-height: 1.7; color: var(--ink-soft); }
.act-feedback { margin-top: 18px; padding: 20px 16px 16px; border: 1px solid var(--line); border-top: 3px solid #cbdad7; border-radius: 14px; background: #fff; }
.act-feedback-heading { display: flex; align-items: center; gap: 10px; margin-bottom: 16px; }
.act-feedback-heading h2 { margin: 0; font-size: 16px; }
.act-feedback-heading span { padding: 3px 8px; border-radius: 5px; background: #edf3f1; font-size: 12px; color: var(--ink-soft); }
.act-feedback .act-help { margin-bottom: 12px; }
@media (max-width: 600px) {
  .act-sheet--experience { height: 100vh; height: 100dvh; border-radius: 0; }
  .act-sheet--experience .act-head { border-radius: 0; }
}
.act-desc { margin: 0; font-size: 15px; line-height: 1.75; color: var(--ink-soft); }
.act-info { background: #fff; border: 1px solid var(--line); border-radius: 12px; padding: 12px; display: grid; gap: 4px; }
.act-info p { margin: 0; font-size: 14px; }
.act-q { margin: 0 0 10px; font-size: 14px; font-weight: 600; }
/* 帮助度选填：三个等宽选项，一次点击；与「提交并完成」留出间距，
   让人一眼看出不选也能提交。 */
.act-help { display: flex; gap: 8px; margin-bottom: 22px; }
.act-help-opt { flex: 1; border: 1px solid var(--line); background: #fff; color: var(--ink-soft); border-radius: 10px; padding: 12px 4px; font-size: 13px; }
.act-help-opt.on { border-color: var(--brand); background: var(--brand); color: #fff; font-weight: 700; }
.act-progress { display: flex; gap: 5px; }
.act-progress i { flex: 1; height: 3px; border-radius: 3px; background: var(--line); }
.act-progress i.on { background: var(--brand); }
.act-step-title { margin: 6px 0 0; font-size: 19px; font-weight: 700; line-height: 1.5; }
.act-step-hint { margin: 0; font-size: 15px; line-height: 1.8; color: var(--ink-soft); }
.act-choices { display: grid; gap: 9px; }
.act-choice { display: flex; align-items: flex-start; gap: 11px; text-align: left; border: 1px solid var(--line); background: #fff; border-radius: 13px; padding: 13px; }
.act-choice.on { border-color: var(--brand); background: var(--brand-soft); }
.act-choice-ico { font-size: 20px; flex: 0 0 auto; }
.act-choice-body { display: grid; gap: 3px; }
.act-choice-desc { font-size: 12px; color: var(--ink-soft); }
.act-reflection { margin: 0; font-size: 13px; line-height: 1.7; color: var(--brand); min-height: 1em; }
.act-input { width: 100%; border: 1px solid var(--line); border-radius: 12px; padding: 12px; font: inherit; font-size: 15px; line-height: 1.7; resize: none; }
.act-note { margin: 0; font-size: 11px; color: var(--ink-soft); }
.act-cta { width: 100%; margin-top: 4px; }
.act-skip { align-self: center; }
.card-main { display: grid; gap: 4px; }
.card-cta { margin-top: 8px; justify-self: start; }
.act-booked{background:var(--brand-soft);border-radius:14px;padding:14px;display:grid;gap:6px;margin-bottom:4px}
.card.followup{display:block;border-color:#cfe3dd;background:#f4faf8}
.ctx-overlay{position:fixed;inset:0;z-index:25;background:rgba(16,45,41,.5);display:flex;align-items:flex-end}
.ctx-sheet{width:100%;max-height:88vh;overflow-y:auto;background:#fff;border-radius:20px 20px 0 0;padding:22px 18px calc(20px + env(safe-area-inset-bottom));display:grid;gap:12px}
.ctx-sheet h2{font-size:19px}
.ctx-sub{margin:0;font-size:12.5px;line-height:1.7;color:var(--ink-soft)}
.ctx-options{display:grid;gap:8px;margin-top:4px}
.ctx-option{display:flex;align-items:center;gap:12px;text-align:left;border:1px solid var(--line);background:#fff;padding:13px;border-radius:14px}
.ctx-ico{font-size:20px;flex:0 0 auto}
.ctx-text{flex:1;display:grid;gap:3px}
.ctx-text b{font-size:14px}
.ctx-text span{font-size:11.5px;color:var(--ink-soft);line-height:1.55}
.ctx-chev{color:#b9cdc7}
.ctx-skip{border:0;background:none;color:var(--ink-soft);font-size:13px;padding:8px}
#view-activities { overflow-y: auto; padding: 14px 14px 20px; gap: 12px; }
.lib-intro { margin: 0; font-size: 12px; line-height: 1.7; color: var(--ink-soft); background: var(--brand-soft); padding: 10px 12px; border-radius: 12px; }
.lib-list { display: grid; gap: 10px; margin-top: 4px; }
.lib-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 13px; display: grid; gap: 6px; }
.lib-head { display: flex; align-items: baseline; gap: 8px; }
.lib-title { font-weight: 700; font-size: 15px; flex: 1; }
.lib-done { font-size: 11px; color: var(--brand); background: var(--brand-soft); padding: 2px 8px; border-radius: 999px; }
.lib-suited { margin: 0; font-size: 13px; color: var(--ink-soft); line-height: 1.6; }
.lib-core { margin: 0; font-size: 12px; color: var(--brand); }
.lib-meta { display: flex; flex-wrap: wrap; gap: 8px; font-size: 11px; color: #92a8a3; }
.lib-card button { justify-self: start; margin-top: 4px; }

/* ---- 我的活动 ---- */
.act-section { display: grid; gap: 8px; margin-bottom: 20px; }
.act-section-title { margin: 0; font-size: 15px; font-weight: 700; }
.act-section-sub { margin: 0; font-size: 12px; color: var(--ink-soft); line-height: 1.5; }
.act-card-list { display: grid; gap: 10px; }
.act-card { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 13px; display: grid; gap: 6px; }
.act-card-head { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.act-card-title { font-size: 15px; font-weight: 600; }
.act-card-state { font-size: 12px; color: var(--ink-soft); white-space: nowrap; }
/* 推荐理由要读起来像一句解释，不像一个标签。 */
.act-card-reason { margin: 0; font-size: 13px; color: var(--brand); line-height: 1.5; }
.act-card-meta { margin: 0; font-size: 12px; color: var(--ink-soft); }
.act-card-actions { display: flex; align-items: center; gap: 12px; margin-top: 4px; }
.act-library-entry { width: 100%; background: #fff; border: 1px solid var(--line); border-radius: 16px;
  padding: 15px 14px; display: flex; align-items: center; justify-content: space-between;
  font-size: 15px; color: var(--ink); }
.act-library-arrow { color: var(--ink-soft); font-size: 20px; line-height: 1; }

/* ---- 活动库（二级页）---- */
.lib-overlay { position: fixed; inset: 0; background: var(--bg); z-index: 40; overflow-y: auto; }
.lib-sheet { max-width: 640px; margin: 0 auto; min-height: 100%; display: flex; flex-direction: column; }
.lib-body { padding: 12px 14px 28px; display: grid; gap: 12px; }

/* ---- 处境标签 ---- */
.context-row { display: flex; align-items: center; justify-content: space-between; gap: 10px; }
.context-pill { background: var(--bg); border: 1px solid var(--line); border-radius: 999px;
  padding: 6px 12px; font-size: 13px; }

/* ---------- 活动步骤：可体验的交互 ---------- */
/* 呼吸圆。缩放时长由 JS 按当前相的秒数设置，动画和文字必须对得上。 */
.breath-wrap { display: grid; place-items: center; gap: 10px; padding: 10px 0 4px; }
.breath-status { display: flex; align-items: center; justify-content: center; gap: 16px; min-height: 38px; }
.breath-wrap .secondary { min-height: 44px; min-width: 88px; }
.breath-orb {
  width: 140px; height: 140px; border-radius: 50%; display: grid; place-items: center;
  background: radial-gradient(circle at 38% 32%, #9fe0d0, var(--brand));
  color: #fff; transform: scale(.62); transition: transform linear;
  box-shadow: 0 10px 30px rgba(20, 123, 111, .28);
}
.act-sheet--experience .breath-orb { width: clamp(112px, 28dvh, 176px); height: clamp(112px, 28dvh, 176px); }
@media (max-height: 650px) {
  .act-sheet--experience .demo-screen { min-height: 170px; padding: 12px; gap: 8px; }
  .act-sheet--experience .demo-figure { height: 100px; transform: scale(.8); transform-origin: center top; margin-bottom: -16px; }
  .act-sheet--experience .demo-wave { height: 60px; }
  .act-sheet--experience .demo-player { gap: 8px; }
  .act-sheet--experience .demo-player-caption { font-size: 13px; min-height: 0; }
}
.breath-orb.inhale { transform: scale(1); }
.breath-orb.hold { transform: scale(1); }
.breath-orb.exhale { transform: scale(.62); }
.breath-label { font-size: 17px; font-weight: 700; letter-spacing: .04em; }
.breath-count { font-size: 26px; font-weight: 700; color: var(--brand); min-height: 32px; }
.breath-rounds { display: flex; gap: 6px; justify-content: center; }
.breath-rounds i { width: 22px; height: 4px; border-radius: 2px; background: var(--line); }
.breath-rounds i.on { background: var(--brand); }

/* 部位觉察：身体扫描与肌肉放松共用。 */
.scan-stage { display: grid; place-items: center; gap: 8px; background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 22px 16px; }
.scan-icon { font-size: 42px; line-height: 1; }
.scan-count { font-size: 22px; font-weight: 700; color: var(--brand); }
.scan-name { margin: 0; font-size: 16px; font-weight: 700; }
.scan-hint { margin: 0; font-size: 14px; line-height: 1.7; color: var(--ink-soft); text-align: center; }
.scan-dots { display: flex; gap: 6px; margin-top: 4px; }
.scan-dots i { width: 7px; height: 7px; border-radius: 50%; background: var(--line); }
.scan-dots i.on { background: var(--brand); }

/* 计时跟练。 */
.timer-stage { background: #fff; border: 1px solid var(--line); border-radius: 16px; padding: 20px 16px; display: grid; gap: 8px; justify-items: center; }
.timer-title { margin: 0; font-size: 17px; font-weight: 700; text-align: center; }
.timer-hint { margin: 0; font-size: 14px; line-height: 1.7; color: var(--ink-soft); text-align: center; }
.timer-clock { margin: 4px 0 0; font-size: 30px; font-weight: 700; color: var(--brand); font-variant-numeric: tabular-nums; }
.timer-track { width: 100%; height: 5px; border-radius: 3px; background: var(--line); overflow: hidden; }
.timer-track i { display: block; height: 100%; width: 0; background: var(--brand); transition: width 1s linear; }
.media-label { margin: 0 0 4px; color: var(--brand); font-size: 12px; font-weight: 700; letter-spacing: .08em; }
.media-controls { display: flex; align-items: center; gap: 10px; color: var(--ink-soft); font-size: 12px; }
.demo-player { display: grid; gap: 12px; }
.activity-media { display: block; width: 100%; max-height: 55vh; border-radius: 16px; background: #edf3f1; }
.act-save-status { margin: 0; color: var(--ink-soft); font-size: 13px; }
.act-outcome { padding: 14px; border-radius: 12px; background: #edf3f1; line-height: 1.7; }
.act-outcome p { margin: 6px 0; }
.demo-screen { border-radius: 18px; min-height: 240px; padding: 22px 20px; background: #e7f1ee; display: grid; justify-items: center; align-content: center; gap: 12px; overflow: hidden; }
.demo-screen.audio { background: #efedf6; }
.demo-player-title { margin: 0; font-size: 18px; font-weight: 700; }
.demo-player-caption { margin: 0; text-align: center; line-height: 1.7; min-height: 48px; }
.demo-player input[type=range] { width: 100%; accent-color: var(--brand); }
.demo-player-clock { margin-left: auto; font-variant-numeric: tabular-nums; white-space: nowrap; }
.demo-wave { height: 86px; display: flex; align-items: center; gap: 5px; }
.demo-wave i { width: 5px; height: calc(20px + var(--bar) * 8px); border-radius: 5px; background: #807499; animation: demo-wave 1.3s ease-in-out infinite; animation-delay: var(--delay); animation-play-state: paused; }
.demo-figure { width: 140px; height: 125px; position: relative; }
.demo-figure i { position: absolute; display: block; background: #538d82; border-radius: 10px; }
.figure-head { width: 24px; height: 24px; top: 0; left: 58px; }
.figure-body { width: 12px; height: 48px; top: 30px; left: 64px; }
.figure-arm { width: 50px; height: 8px; top: 35px; animation: demo-arm 3s ease-in-out infinite alternate; animation-play-state: paused; }
.figure-arm.left { left: 18px; transform-origin: right; }
.figure-arm.right { left: 72px; transform-origin: left; animation-direction: alternate-reverse; }
.figure-leg { width: 9px; height: 46px; top: 76px; }
.figure-leg.left { left: 51px; transform: rotate(22deg); }
.figure-leg.right { left: 80px; transform: rotate(-22deg); }
.demo-player.playing .demo-wave i, .demo-player.playing .figure-arm { animation-play-state: running; }
@keyframes demo-wave { 50% { transform: scaleY(.35); } }
@keyframes demo-arm { from { transform: rotate(-28deg); } to { transform: rotate(28deg); } }

@media (prefers-reduced-motion: reduce) {
  .demo-wave i, .figure-arm { animation: none; }
  .breath-orb { transition: none; }
  .timer-track i { transition: none; }
}

/* 未确认的消息：服务端还没确认收到，视觉上要和已保存的区分开。 */
.bubble.pending { opacity: .55; }
