/* ==== css/base.css ==== */
/* 我们的小世界 · 基础样式
 * 基础：变量 / reset / 布局 / 导航 / 按钮 / 通用展示区块
 * 由 index.html 内联样式拆分而来，规则顺序与原文件完全一致（样式优先级不变）。
 */
:root {
  --bg: #F6EFE7; --card: #FFFDF9; --primary: #C97B63; --primary-deep: #A85E48;
  --sage: #8BA888; --lavender: #B8A5C9; --text: #3E3430; --muted: #8A7E77;
  --line: #E5D8C8; --warm: #E8B4A0; --danger: #B06060;

  /* 语义扩展层：把原先散落的硬编码色收敛成变量，深色模式只需覆盖这一层 */
  --on-primary: #FFFDF9;   /* 主色按钮上的文字 */
  /* ★ "某色块上的字色"。
     这类柔和中间调色块（浅粉/浅绿/浅紫）用白字只有 2.3~2.6 对比度，
     属于看不清的范围；配深色字才读得清（5.3~6.7）。
     深色主题下这些色块会被提亮，同样要配深色字 —— 所以按"色块"而不是
     按"明暗"来定义，两个主题才不会各错一次。 */
  --on-warm: #4A2E22;
  --on-sage: #22301F;
  --on-lavender: #30243A;
  --surface-2: #FFF;       /* 卡片内的次级白底（输入框、列表项） */
  --soft-warm: #FDF4EE;    /* 浅暖底 */
  --soft-warm-2: #F9E8DC;
  --soft-lavender: #F4EFF8;
  --soft-lavender-2: #EDE4F5;
  --soft-green: #EEF3EE;
  --soft-red: #FBEDED;
  /* 提示条（toast）专用配色。
     不能用 background: var(--text) 配白字：深色主题下 --text 会反转成浅色，
     于是变成"浅底白字"，对比度只有 1.23:1，几乎看不见。
     必须给 toast 一组不随主题反转的专用变量。 */
  --toast-bg: #2A2320;
  --toast-fg: #FFFDF9;
  --soft-gold-a: #F5D5A5;
  --soft-gold-b: #D4A050;
  --ink-purple: #6B5A80;   /* 紫底上的深字 */
  --ink-green: #4F6B4C;
  --ink-red: #8B4040;
  --soft-red-2: #F9D5D5;
  --lavender-soft-a: #C8B8D8;
  --soft-lavender-3: #E4DCEF;
  --warm-soft-a: #F0D4B8;
  --overlay-solid: #000;
  /* 他 / 她的身份色。
     原先全产品用了两套完全不同的配色：首页趋势图是蓝粉(#5B8FD6/#E88AA8)，
     日记温度曲线和 TA 的温度点却是珊瑚薰衣草(#C97B63/#B8A5C9)。
     同一个"他/她"三套颜色，视觉上是断裂的。这里统一成一套并变量化。 */
  --who-he: #C97B63;
  --who-she: #B8A5C9;
  --faint: #B8A5A5;          /* 未解锁/锁定态的灰 */
  /* 年度热力图格子尺寸。现在是月份分块，格子的上限由【月份块宽度】决定：
     手机 3 列布局下每块约 107px，月内 7 格必须放得下 ——
     7×12 + 6×2 = 96px，留有余量；若沿用 13px/3px 则是 109px，会溢出。
     12px 仍能分辨色阶，再小就分不清了。 */
  --heat-cell: 12px;
  --heat-gap: 2px;
  --heat-0: #F0E8DC;         /* 年度热力图梯度：无记录 */
  --heat-1: #F5D5C5;
  --heat-2: #E0A98F;
  --heat-3: #D48A70;
  --heat-4: #B85E48;
  --shadow: rgba(62,52,48,0.08);
  --overlay: rgba(62,52,48,0.45);
  /* 页面背景的两层柔光，深色下需要换成更暗的色调 */
  --glow-a: rgba(201,123,99,0.10);
  --glow-b: rgba(184,165,201,0.12);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; background: var(--bg); color: var(--text); font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", "Noto Sans SC", sans-serif; font-weight: 400; line-height: 1.7; -webkit-font-smoothing: antialiased; touch-action: manipulation; overscroll-behavior: none; -webkit-tap-highlight-color: transparent; }
body { min-height: 100vh; min-height: 100dvh; background: radial-gradient(ellipse at 20% 0%, var(--glow-a), transparent 50%), radial-gradient(ellipse at 100% 100%, var(--glow-b), transparent 50%), var(--bg); }
.app { max-width: 480px; margin: 0 auto; padding: 24px 22px calc(80px + env(safe-area-inset-bottom)); min-height: 100vh; min-height: 100dvh; position: relative; }
/* ★ 底部留白必须算上 safe-area。
 *   原来是固定 100px，而底部导航自身高度是
 *   8(上内边距) + 49(图标+文字) + 8(下内边距) + env(safe-area-inset-bottom) ≈ 65 + safe。
 *   没有 home indicator 的机器 100px 富余；iPhone 上 safe = 34px，
 *   导航总高约 99px —— 只剩 1px，页面最后一个元素（首页的「现在情绪很糟」）
 *   正好被压掉一条边。所以把 safe-area 加进留白，并统一留 15px 呼吸。 */
.serif { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; }
.screen { display: none; animation: fadeIn 0.25s ease; }
/* ── 翻页过渡 ──
 *
 * 原来只有一个 8px 的淡入，而且前进/后退/切 tab 全都一样，
 * 所以层级感丢失：你分不清"进了一层"还是"退回了一层"。
 *
 * 现在按方向给不同的入场：
 *   前进（进子页）：从右侧推入 —— 像翻开下一页
 *   后退（返回）：从左侧推入  —— 明确是"往回走"
 *   切 tab：只淡入，不位移 —— tab 之间是平级切换，不该有方向
 *
 * ★ 只做新页入场，不做旧页退场。
 *   做退场需要同时渲染两屏，而这里是 display:none 的单屏结构，
 *   双层容器改动面太大；入场方向已经足够传达层级了。
 */
.screen.enter-fwd { animation: slideInFwd 0.26s cubic-bezier(0.22, 0.61, 0.36, 1); }
.screen.enter-back { animation: slideInBack 0.26s cubic-bezier(0.22, 0.61, 0.36, 1); }
.screen.enter-fade { animation: fadeIn 0.2s ease; }
@keyframes slideInFwd { from { opacity: 0; transform: translateX(26px); } to { opacity: 1; transform: translateX(0); } }
@keyframes slideInBack { from { opacity: 0; transform: translateX(-26px); } to { opacity: 1; transform: translateX(0); } }
.screen.active { display: block; }
/* fadeIn 此前定义过两遍：后一条（6px）覆盖前一条（8px），
   导致前一条永远不生效。保留 6px 这一版，删除死定义。 */
@keyframes fadeIn { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: translateY(0); } }

.topbar { display: flex; justify-content: space-between; align-items: center; margin-bottom: 16px; }
.brand { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 18px; font-weight: 600; color: var(--primary-deep); letter-spacing: 1px; }
.quit { font-size: 14px; color: var(--muted); background: none; border: none; cursor: pointer; padding: 12px 14px; min-height: 44px; }

/* Bottom nav */
.bottom-nav {
  position: fixed; bottom: 0; left: 50%; transform: translateX(-50%);
  width: 100%; max-width: 480px;
  background: var(--card);
  border-top: 1.5px solid var(--line);
  display: flex; justify-content: space-around;
  padding: 8px 0 calc(8px + env(safe-area-inset-bottom));
  z-index: 50;
  transition: transform 0.3s ease;
}
.bottom-nav.hidden { transform: translateX(-50%) translateY(100%); }
.nav-item {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 11px; color: var(--muted);
  padding: 6px 0;
}
.nav-item.active { color: var(--primary-deep); }
.nav-item .icon { font-size: 22px; line-height: 1; }
/* 五个 tab 时每项约 75px（iPhone SE 这类窄屏），字号略收，避免文字折行 */
@media (max-width: 380px){
  .nav-item { font-size: 10px; letter-spacing: -0.2px; }
  .nav-item .icon { font-size: 19px; }
}

.back-btn {
  position: fixed; top: calc(16px + env(safe-area-inset-top)); left: 16px;
  z-index: 60;
  background: var(--card); border: 1.5px solid var(--line);
  border-radius: 100px; padding: 8px 16px;
  font-family: inherit; font-size: 14px; color: var(--muted);
  cursor: pointer;
  box-shadow: 0 2px 10px rgba(62,52,48,0.08);
  opacity: 0; transform: translateY(-8px); pointer-events: none;
  transition: opacity 0.25s, transform 0.25s;
}
.back-btn.show { opacity: 1; transform: translateY(0); pointer-events: auto; }

/* 从左边缘右滑返回时跟手的圆点提示。
   不显示在首屏内容里，只在手势激活时出现，平时不影响版面。 */
.swipe-hint {
  position: fixed; left: 0; top: 50%; z-index: 70;
  width: 34px; height: 34px; border-radius: 50%;
  background: var(--card); border: 1.5px solid var(--line);
  box-shadow: 0 2px 12px rgba(62,52,48,0.14);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; color: var(--muted);
  opacity: 0; pointer-events: none;
  transition: opacity 0.15s;
}
.swipe-hint.show { opacity: 1; }

.btn { display: block; width: 100%; padding: 16px 20px; border-radius: 20px; border: none; font-family: inherit; font-size: 16px; cursor: pointer; transition: transform 0.1s, opacity 0.15s; text-align: center; }
.btn:active { transform: scale(0.97); opacity: 0.85; }
.btn:active { transform: scale(0.98); }
.btn-primary { background: linear-gradient(135deg, var(--primary), var(--primary-deep)); color: var(--on-primary); box-shadow: 0 8px 24px rgba(201,123,99,0.3); font-weight: 500; }
.btn-ghost { background: var(--card); color: var(--text); border: 1.5px solid var(--line); }
.btn-ghost.warn { border-color: rgba(184,165,201,0.5); color: var(--ink-purple); }
.btn-ghost.stubborn { border-color: rgba(139,168,136,0.5); color: var(--ink-green); }
.btn-ghost.calm { border-color: rgba(201,123,99,0.4); color: var(--primary-deep); }
.btn-label { font-size: 16px; font-weight: 500; display: block; }
.btn-sub { font-size: 13px; opacity: 0.75; margin-top: 4px; font-weight: 300; display: block; }

.section-block { background: var(--card); border-radius: 18px; padding: 18px; margin: 14px 0; }
.section-block h4 { margin: 0 0 12px; font-size: 15px; color: var(--primary-deep); font-weight: 600; }
.section-block h4 .sub { font-weight: 300; color: var(--muted); font-size: 13px; }
/* 组标题当总标题用：没有 h4 的区块里，组标题就是这一块的第一行。
   沿用 .section-block h4 的字号与颜色，否则 12px 灰色撑不起层级，
   看上去像标签的说明小字而不是标题。 */
.mg-label-title { font-size: 15px; color: var(--primary-deep); font-weight: 600; margin-bottom: 10px; letter-spacing: 0; }

.hero-stats { text-align: center; margin-bottom: 16px; }
.hero-stats .big { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 26px; color: var(--primary-deep); }
.hero-stats .small { font-size: 13px; color: var(--muted); }
.streak-badge { display: inline-block; margin-top: 6px; padding: 4px 14px; border-radius: 100px; background: linear-gradient(135deg, var(--warm), var(--primary)); color: var(--surface-2); font-size: 13px; font-weight: 500; }

.daily-quote { background: linear-gradient(135deg, var(--soft-warm), var(--soft-warm-2)); border-radius: 18px; padding: 20px; margin: 14px 0; text-align: center; }
.daily-quote .q { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 17px; line-height: 1.9; color: var(--primary-deep); }
/* 标签在句子上方：间距改为"标签下 → 句子上"，
   原来是 margin-top（在下方时的上方留白），移到上面后会把标签顶得很开。 */
.daily-quote .tag { font-size: 12px; color: var(--muted); margin-bottom: 10px; letter-spacing: 0.04em; }

.warning-banner { background: linear-gradient(135deg, var(--soft-red), var(--soft-red-2)); border-radius: 16px; padding: 14px 18px; margin: 14px 0; border-left: 3px solid var(--danger); }
.warning-banner .w-title { font-size: 14px; font-weight: 500; color: var(--danger); margin-bottom: 4px; }
.warning-banner .w-text { font-size: 13px; color: var(--ink-red); line-height: 1.7; }
.warning-banner .w-action { margin-top: 8px; font-size: 13px; color: var(--primary-deep); cursor: pointer; }
.warning-banner.soft { background: linear-gradient(135deg, var(--soft-lavender), var(--soft-lavender-2)); border-left-color: var(--lavender); }
.warning-banner.soft .w-title { color: var(--ink-purple); }
.warning-banner.soft .w-text { color: var(--ink-purple); }

.coin-orb { width: 90px; height: 90px; margin: 0 auto 12px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--soft-gold-a), var(--soft-gold-b) 75%); box-shadow: 0 8px 24px rgba(212,160,80,0.35); display: flex; flex-direction: column; align-items: center; justify-content: center; color: var(--surface-2); }
.coin-orb .num { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 32px; line-height: 1; }
.coin-orb .lbl { font-size: 11px; margin-top: 2px; }
.coin-priv { font-size: 13px; color: var(--muted); line-height: 1.9; margin-top: 10px; }
.coin-priv .locked { color: var(--faint); }
.coin-priv .unlocked { color: var(--sage); font-weight: 500; }

.compare-row { display: flex; align-items: center; justify-content: space-between; padding: 10px 0; border-bottom: 1px solid var(--line); }
.compare-row:last-child { border-bottom: none; }
.compare-row .lbl { font-size: 13px; color: var(--muted); }
.compare-row .vals { display: flex; gap: 12px; align-items: center; font-size: 14px; }
.compare-row .old { color: var(--muted); text-decoration: line-through; }
.compare-row .arrow { color: var(--muted); }
.compare-row .new { font-weight: 600; color: var(--sage); }
.compare-row .new.bad { color: var(--danger); }
/* 前后没变化：中性色。原来会落到 bad（红），"没变"被渲染成"变差"。 */
.compare-row .new.same { color: var(--muted); }


/* ==== css/components.css ==== */
/* 我们的小世界 · 组件样式
 * 组件：输入控件 / 图表 / 列表 / 流程页元素
 * 由 index.html 内联样式拆分而来，规则顺序与原文件完全一致（样式优先级不变）。
 */
.temp-row { display: flex; align-items: center; gap: 10px; margin: 8px 0; }
.temp-row .who { width: 32px; font-size: 14px; color: var(--muted); flex-shrink: 0; }
.temp-dots { display: flex; gap: 6px; flex: 1; }
.temp-dot { width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line); background: var(--bg); cursor: pointer; font-family: inherit; font-size: 15px; color: var(--muted); transition: all 0.2s; display: flex; align-items: center; justify-content: center; }
.temp-dot.selected { background: var(--primary); border-color: var(--primary); color: var(--surface-2); transform: scale(1.1); }
.temp-row.her .temp-dot.selected { background: var(--lavender); border-color: var(--lavender); }

/* 心情/心动分两组时的容器与组标题。
   只有一组时组标题是隐藏的（applySoloText），所以间距要跟在组内而不是容器上，
   否则单人模式下会多出一段空白。 */
.mood-group + .mood-group { margin-top: 14px; }
.quick-group + .quick-group { margin-top: 14px; }
.mg-label { font-size: 12px; color: var(--muted); margin-bottom: 8px; letter-spacing: 0.02em; }
.mood-row { display: flex; flex-wrap: wrap; gap: 8px; justify-content: center; }
.mood-chip { position: relative; padding: 9px 16px; border-radius: 100px; background: var(--bg); border: 1.5px solid var(--line); font-size: 14px; cursor: pointer; font-family: inherit; color: var(--text); transition: all 0.15s; }
.mood-chip.selected { background: var(--sage); border-color: var(--sage); color: var(--on-sage); }
/* danger 变体必须单独设字色：它继承上面 --on-sage 的话，
   深绿字压在红底上会糊成一团。红色块按主色按钮的字色处理。 */
.mood-chip[data-mood="大吵"].selected, .mood-chip[data-mood="冷战"].selected { background: var(--danger); border-color: var(--danger); color: var(--on-primary); }

.quick-row { display: flex; flex-wrap: wrap; gap: 8px; }
.quick-chip { position: relative; padding: 9px 14px; border-radius: 100px; background: var(--bg); border: 1.5px solid var(--line); font-size: 13px; cursor: pointer; font-family: inherit; color: var(--text); transition: all 0.15s; }
.quick-chip.selected { background: var(--warm); border-color: var(--warm); color: var(--on-warm); }

.moment-input { width: 100%; padding: 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg); font-family: inherit; font-size: 15px; line-height: 1.6; resize: vertical; margin-top: 10px; }
.moment-input:focus { outline: none; border-color: var(--primary); }

.question-box { background: var(--soft-lavender); border-radius: 18px; padding: 18px; margin: 14px 0; border-left: 3px solid var(--lavender); }
.question-box .q { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 16px; color: var(--ink-purple); line-height: 1.8; }
.question-box input { width: 100%; margin-top: 10px; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--surface-2); font-family: inherit; font-size: 14px; }

.summary-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.summary-cell { background: var(--bg); border-radius: 12px; padding: 12px; text-align: center; }
.summary-cell .num { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 24px; color: var(--primary-deep); }
.summary-cell .lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }

/* ===== 关系状态分布（本周小结） =====
 * 「我们」页原来只有冲突指标，这里补上"我们之间"的全貌：
 * 亲密/平淡/小吵/大吵/冷战各占多少天。
 * 色相用语义变量而不是硬编码值 —— 深色模式下整套色板会换一批，
 * 写死十六进制会出现"条是浅色梯度、页面是深色底"的糊成一片。 */
.rel-dist { margin-top: 12px; }
.rd-title { font-size: 12px; color: var(--muted); margin-bottom: 8px; }
.rd-row { display: flex; align-items: center; gap: 8px; margin-bottom: 7px; }
.rd-lbl { font-size: 12px; color: var(--text); width: 34px; flex: none; }
.rd-bar { flex: 1; height: 8px; background: var(--line); border-radius: 4px; overflow: hidden; }
.rd-bar i { display: block; height: 100%; border-radius: 4px; }
.rd-good { background: var(--sage); }    /* 亲密：正向 */
.rd-flat { background: var(--faint); }   /* 平淡：中性，不该看起来像问题 */
.rd-warn { background: var(--danger); }  /* 冲突类 */
.rd-n { font-size: 12px; color: var(--muted); width: 40px; text-align: right; flex: none; }

/* 本周小结的一句话结论。
   「我们」页的职责是"说清楚你们最近怎么样"，不是列一堆数字让用户自己解读，
   所以数字之外必须有一句人话。 */
.week-word { margin-top: 12px; font-size: 13px; line-height: 1.75; color: var(--text); }
.week-word.good { color: var(--ink-green); }

.chart-wrap { background: var(--card); border-radius: 18px; padding: 18px; margin: 14px 0; }
.chart-wrap h4 { margin: 0 0 12px; font-size: 14px; color: var(--muted); font-weight: 500; }
/* 图表副说明：解释分数/颜色代表什么。
   没有它，新用户看到"最近 14 天的心情"仍然不知道高低意味着什么。
   放在标题下方、图表上方，用最小号字，不抢视觉。 */
.chart-sub { font-size: 11px; color: var(--muted); opacity: .85; margin: -8px 0 12px; }
.legend { display: flex; gap: 16px; justify-content: center; margin-bottom: 8px; font-size: 13px; color: var(--muted); }
.legend .dot { display: inline-block; width: 10px; height: 10px; border-radius: 50%; margin-right: 4px; vertical-align: middle; }

/* 年度热力图：按月份分块（12 个月，每月一个小网格）。
 *
 * 演变过三种形态，最终选月份，原因记录在 05b-diary.js 的 renderYearHeatmap 上：
 *   1) 7 列 × 53 行、格子撑满宽度 —— 手机上总高 2700px，要翻好几屏。
 *   2) 横向一条带子（列=周）—— 高度降到 100px，但要横向滚动；更关键的是
 *      一整年被拉成一条，看不出「哪个月记得多、哪个月断掉了」，
 *      而这正是用户想从年度图里得到的信息，所以那样排「没意义」。
 *   3) 现在：12 个月各成一个小网格。全年分布一眼可见，
 *      月内仍按周对齐（周一开头），周内规律也还在。
 *
 * 月内 7 列 × 最多 6 行，格子 12px：4 行月份总高约 420px，
 * 手机上一屏能看完，不需要任何滚动。
 *
 * 响应式：窄屏 3 列（4 行），宽一点 4 列（3 行），桌面 6 列（2 行）。 */
.heatmap {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 10px;
  margin-top: 10px;
  overflow: visible;                 /* 不再横向滚动：12 个月排得下 */
}
@media (min-width: 520px) { .heatmap { grid-template-columns: repeat(4, 1fr); } }
/* ★ 删掉了 780px 的 6 列断点 —— 它是"乱糟糟"的直接原因。
 *
 * 断点看的是【视口宽度】，但这里的内容容器是固定 480px 的（.app max-width）。
 * 于是 PC 上视口很宽、容器却很窄：12 个月被塞进 6 列，
 * 每个月块只有约 58px，7 个格子连间距才分到 6.6px，
 * 而月份块之间的 gap 却有 10px —— 格子比间隔还小，
 * 看上去就是一堆散落的碎点，不像日历。
 *
 * 容器宽度不随视口变化，所以列数不该按视口给。
 * 统一最多 4 列：PC 上格子约 10.5px，比原来的 6.6px 大六成，且 3 行更接近方形。 */

/* min-width:0 —— grid 子项默认 min-width:auto，内容会把它撑开，
   导致 7 列格子溢出月份块。必须显式允许收缩。 */
.heat-month { min-width: 0; }
.hm-title {
  font-size: 11px; color: var(--muted);
  margin-bottom: 5px;
  display: flex; align-items: baseline; gap: 4px;
  justify-content: center;
}
.hm-title .hm-n { font-size: 10px; opacity: .75; }
.hm-grid {
  display: grid;
  /* 用 1fr 而不是固定列宽：月份块的宽度由外层列数决定，
     窄屏（320px）下 3 列每块仅约 89px，固定 7×12px 会溢出到相邻月份。
     1fr 让格子随块宽收缩，max-width 再把它限制在正常尺寸的 96px 以内。 */
  grid-template-columns: repeat(7, 1fr);
  gap: var(--heat-gap);
  max-width: calc(7 * var(--heat-cell) + 6 * var(--heat-gap));
  margin: 0 auto;                    /* 块较宽时整体居中，不偏左 */
}
/* aspect-ratio 让格子保持正方：宽度由 1fr 给出，高度自动等于宽度。
   min-height 是兜底 —— 万一老浏览器不支持 aspect-ratio，
   空 div 的高度会塌成 0 而完全看不见，至少留个可见的小方块。 */
.heatmap .cell { width: 100%; aspect-ratio: 1; min-height: 9px; border-radius: 2px; background: var(--heat-0); }
.heatmap .cell.l1 { background: var(--heat-1); }
.heatmap .cell.l2 { background: var(--warm); }
.heatmap .cell.l3 { background: var(--heat-3); }
.heatmap .cell.l4 { background: var(--heat-4); }
/* 未来的日子：不再完全透明。
   完全透明会让网格"破洞"——前导空格和月末空格消失后，
   剩下的方块看着像随机撒的点，这也是"乱糟糟"的一部分。
   给一个极淡的底色，日历的框架才完整，也才能一眼看出
   "空白=没记"和"更淡=还没到"的区别。 */
.heatmap .cell.future { background: var(--heat-0); opacity: .35; }

.timeline-item { background: var(--card); border-radius: 16px; padding: 16px; margin-bottom: 10px; }
.timeline-item .date { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.timeline-item .temps { display: flex; gap: 16px; font-size: 14px; margin-bottom: 6px; }
.timeline-item .temps .his { color: var(--primary-deep); }
.timeline-item .temps .her { color: var(--ink-purple); }
.timeline-item .moment { font-size: 14px; margin-top: 6px; }
.timeline-item .mood-tag { display: inline-block; font-size: 12px; padding: 2px 10px; border-radius: 100px; background: var(--bg); color: var(--muted); margin-left: 6px; }
.timeline-item .q-a { font-size: 13px; color: var(--muted); margin-top: 6px; font-style: italic; }
.quick-tags { margin-top: 6px; }
.quick-tags span { display: inline-block; font-size: 12px; padding: 2px 8px; border-radius: 100px; background: var(--soft-warm); color: var(--primary-deep); margin: 2px 4px 2px 0; }

.add-row { display: flex; flex-direction: column; gap: 8px; margin-top: 10px; }
.add-row input { padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); font-family: inherit; font-size: 14px; }
.add-row button { padding: 10px; border-radius: 12px; border: none; background: var(--primary); color: var(--surface-2); font-family: inherit; font-size: 14px; cursor: pointer; }

.milestone-big { text-align: center; padding: 20px 0; }
.milestone-big .num { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 48px; color: var(--primary-deep); }
.milestone-big .lbl { font-size: 14px; color: var(--muted); }
/* 在一起日期：默认只显示日期 + 一个轻量的「更改」。
   刻意不用实心大按钮——它不是一个待办动作，别抢天数的视觉重心。 */
.ms-view { display: flex; align-items: center; justify-content: center; gap: 10px; padding-top: 4px; }
.ms-view .ms-date { font-size: 14px; color: var(--muted); }
.ms-change, .ms-cancel {
  font-size: 13px; color: var(--primary-deep); background: none; border: none;
  font-family: inherit; cursor: pointer; padding: 2px 2px;
  text-decoration: underline; text-underline-offset: 3px; opacity: 0.85;
}
.ms-change:hover, .ms-cancel:hover { opacity: 1; }
.ms-edit { margin-top: 14px; border-top: 1px solid var(--line); padding-top: 14px; }
.ms-edit .ms-label { display: block; font-size: 14px; color: var(--muted); margin-bottom: 6px; }
.ms-edit .ms-input {
  width: 100%; padding: 12px; border-radius: 12px;
  border: 1.5px solid var(--line); background: var(--bg);
  font-family: inherit; font-size: 15px; color: var(--text);
}
/* 保存与取消并列等宽。
   .btn 自带 width:100%，在 flex 行里会撑满整行、把「取消」挤到边上
   （flex-shrink:0 时甚至直接挤出容器），所以必须先把它改回 auto。 */
.ms-actions { display: flex; align-items: stretch; gap: 10px; margin-top: 12px; }
.ms-actions .ms-save { flex: 1 1 0; width: auto; min-width: 0; margin: 0; padding: 13px 20px; font-size: 15px; border-radius: 14px; }
.ms-actions .ms-cancel {
  flex: 1 1 0; min-width: 0;
  padding: 13px 20px; font-size: 15px; border-radius: 14px;
  border: 1.5px solid var(--line); background: var(--card);
  color: var(--text); text-align: center;
  text-decoration: none; opacity: 1;
}
.ms-actions .ms-cancel:hover { background: var(--surface-2); }

.whisper-box { background: linear-gradient(135deg, var(--soft-lavender), var(--soft-lavender-2)); border-radius: 18px; padding: 18px; margin: 14px 0; }
.whisper-item { background: var(--surface-2); border-radius: 14px; padding: 14px; margin-bottom: 10px; }
.whisper-item .text { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 15px; line-height: 1.8; }
.whisper-item .meta { font-size: 12px; color: var(--muted); margin-top: 6px; }
.whisper-item .say-it { margin-top: 8px; padding: 6px 14px; border-radius: 100px; border: 1.5px solid var(--lavender); background: none; color: var(--ink-purple); font-family: inherit; font-size: 13px; cursor: pointer; }

.random-old { background: var(--card); border-radius: 20px; padding: 24px; margin: 16px 0; text-align: center; }
.random-old .date { font-size: 13px; color: var(--muted); margin-bottom: 12px; }
.random-old .content { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 17px; line-height: 2; color: var(--text); }
/* 空态说明：说清到底要记什么。
   只写"记一笔"没有信息量 —— 用户不知道是记温度还是写日记。 */
.random-old .ro-hint {
  margin-top: 14px; padding-top: 14px;
  border-top: 1px solid var(--line);
  font-size: 13px; line-height: 1.9; color: var(--muted);
  text-align: left;
}
/* 禁用态：只有一天可翻时按钮会禁用，得让人看出是"不可用"而不是"没渲染出来" */
.btn:disabled { opacity: .5; cursor: default; }
.btn:disabled:hover { transform: none; }

.breathe-screen { text-align: center; padding: 20px 0; }
.breath-stage { width: 240px; height: 240px; margin: 30px auto; position: relative; display: flex; align-items: center; justify-content: center; }
.breath-circle { width: 170px; height: 170px; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--warm), var(--primary) 75%); box-shadow: 0 16px 50px rgba(201,123,99,0.35); transition: transform 4s cubic-bezier(0.4,0,0.2,1); display: flex; align-items: center; justify-content: center; color: var(--on-primary); font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; }
.breath-circle.crisis { background: radial-gradient(circle at 35% 35%, var(--lavender-soft-a), var(--lavender) 75%); box-shadow: 0 16px 50px rgba(184,165,201,0.4); }
.breath-text { font-size: 22px; letter-spacing: 4px; }
.phase-label { position: absolute; bottom: -40px; left: 0; right: 0; font-size: 14px; color: var(--muted); }
.round-label { font-size: 14px; color: var(--muted); margin-top: 60px; letter-spacing: 2px; }
.sound-toggle { margin-top: 24px; background: none; border: none; color: var(--muted); font-size: 14px; cursor: pointer; font-family: inherit; }

.section-title { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 24px; font-weight: 600; margin: 10px 0 8px; text-align: center; }
.section-sub { text-align: center; font-size: 14px; color: var(--muted); margin-bottom: 24px; font-weight: 300; }
.choice-list { display: flex; flex-direction: column; gap: 12px; }
.choice-card { background: var(--card); border: 1.5px solid var(--line); border-radius: 20px; padding: 18px; cursor: pointer; text-align: left; transition: all 0.2s; font-family: inherit; width: 100%; }
.choice-card:active, .choice-card.selected { border-color: var(--primary); background: var(--soft-warm); }
.choice-title { font-size: 16px; font-weight: 500; display: block; margin-bottom: 4px; }
.choice-desc { font-size: 14px; color: var(--muted); font-weight: 300; display: block; }
.timer-display { text-align: center; font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 64px; font-weight: 300; color: var(--primary-deep); margin: 20px 0 8px; letter-spacing: 4px; }
.do-list { background: var(--card); border-radius: 20px; padding: 22px; margin: 24px 0; }
.do-list h4 { margin: 0 0 12px; font-size: 15px; color: var(--primary-deep); font-weight: 600; }
.do-list ul { margin: 0; padding-left: 20px; font-size: 14px; line-height: 2; }
.do-list .dont { color: var(--danger); }
.wizard-progress { display: flex; gap: 6px; margin: 10px 0 24px; }
.wizard-progress .dot { flex: 1; height: 4px; background: var(--line); border-radius: 2px; }
.wizard-progress .dot.done { background: var(--sage); }
.wizard-progress .dot.now { background: var(--primary); }
.step-label { font-size: 14px; color: var(--muted); letter-spacing: 2px; text-align: center; margin-bottom: 8px; }
.step-title { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 22px; text-align: center; margin: 0 0 6px; }
.step-desc { text-align: center; font-size: 14px; color: var(--muted); margin-bottom: 24px; font-weight: 300; }
.chips { display: flex; flex-wrap: wrap; gap: 10px; justify-content: center; margin-bottom: 24px; }
.chip { padding: 10px 18px; border-radius: 100px; background: var(--card); border: 1.5px solid var(--line); font-size: 14px; cursor: pointer; font-family: inherit; color: var(--text); transition: all 0.15s; }
.chip.selected { background: var(--primary); border-color: var(--primary); color: var(--surface-2); }
.chip.sage.selected { background: var(--sage); border-color: var(--sage); }
.chip.lavender.selected { background: var(--lavender); border-color: var(--lavender); }
.person-banner { background: linear-gradient(135deg, var(--soft-warm), var(--soft-warm-2)); border-radius: 16px; padding: 12px 18px; text-align: center; font-size: 14px; color: var(--primary-deep); margin-bottom: 18px; }
.person-banner.b { background: linear-gradient(135deg, var(--soft-lavender-2), var(--soft-lavender-3)); color: var(--ink-purple); }

.crisis-intro { background: var(--soft-lavender); border-radius: 20px; padding: 22px; margin: 16px 0 20px; border-left: 3px solid var(--lavender); }
.crisis-intro p { margin: 0 0 10px; font-size: 14px; line-height: 1.8; }
.crisis-intro p:last-child { margin-bottom: 0; }
.dont-say { background: var(--soft-red); border-radius: 16px; padding: 18px 20px; margin: 16px 0; }
.dont-say h4 { margin: 0 0 10px; color: var(--danger); font-size: 14px; }
.dont-say .phrase { display: inline-block; background: var(--surface-2); padding: 6px 12px; border-radius: 8px; margin: 4px 6px 4px 0; font-size: 14px; color: var(--ink-red); text-decoration: line-through; }
.do-step { display: flex; gap: 14px; align-items: flex-start; background: var(--card); border-radius: 16px; padding: 16px 18px; margin-bottom: 10px; }
.do-step .num { flex-shrink: 0; width: 30px; height: 30px; border-radius: 50%; background: var(--sage); color: var(--on-sage); display: flex; align-items: center; justify-content: center; font-size: 14px; font-weight: 500; }
.do-step .txt { font-size: 14px; line-height: 1.6; }
.script-box { background: linear-gradient(135deg, var(--soft-warm), var(--soft-warm-2)); border-radius: 18px; padding: 22px; margin: 20px 0; text-align: center; }
.script-box .say { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 18px; line-height: 1.9; color: var(--primary-deep); }
.hotline { margin-top: 28px; padding: 16px; background: var(--card); border-radius: 14px; text-align: center; font-size: 13px; color: var(--muted); line-height: 1.8; }
.hotline strong { color: var(--text); font-weight: 500; }

.reframe { background: var(--soft-green); border-radius: 20px; padding: 22px; margin: 16px 0 20px; border-left: 3px solid var(--sage); }
.reframe p { margin: 0 0 10px; font-size: 14px; line-height: 1.8; }
.reframe p:last-child { margin-bottom: 0; }
.reframe .big { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 17px; color: var(--ink-green); line-height: 1.9; }
.soften-script { background: var(--card); border: 1.5px solid var(--line); border-radius: 18px; padding: 20px; margin-bottom: 12px; }
.soften-script .line { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 16px; line-height: 1.9; color: var(--text); margin-bottom: 14px; }
.soften-script .actions { display: flex; gap: 8px; }
.mini-btn { flex: 1; padding: 10px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); font-family: inherit; font-size: 14px; cursor: pointer; color: var(--text); }
.mini-btn.primary { background: var(--sage); color: var(--on-sage); border-color: var(--sage); }

.warm-orb { width: 130px; height: 130px; margin: 24px auto; border-radius: 50%; background: radial-gradient(circle at 35% 35%, var(--warm-soft-a), var(--warm) 75%); box-shadow: 0 12px 40px rgba(232,180,160,0.4); display: flex; align-items: center; justify-content: center; color: var(--on-primary); font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 16px; letter-spacing: 2px; }
.closing-quote { text-align: center; font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 17px; color: var(--primary-deep); margin: 28px 20px; line-height: 2; }

.rewrite-input { width: 100%; min-height: 100px; padding: 16px; border-radius: 16px; border: 1.5px solid var(--line); background: var(--card); font-family: inherit; font-size: 15px; color: var(--text); line-height: 1.7; resize: vertical; }
.rewrite-input:focus { outline: none; border-color: var(--primary); }
.rewrite-result { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 18px; margin-bottom: 10px; }
.rewrite-result .tag { display: inline-block; font-size: 12px; padding: 3px 10px; border-radius: 100px; margin-bottom: 10px; }
.rewrite-result .tag.gentle { background: var(--soft-warm); color: var(--primary-deep); }
.rewrite-result .tag.short { background: var(--soft-green); color: var(--ink-green); }
.rewrite-result .tag.to-self { background: var(--soft-lavender); color: var(--ink-purple); }
.rewrite-result .text { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 16px; line-height: 1.9; margin-bottom: 12px; }

/* ===== 主题切换 ===== */
.theme-picker { display: flex; gap: 8px; margin-top: 10px; }
.theme-opt {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 4px;
  padding: 12px 6px; border-radius: 14px;
  border: 1.5px solid var(--line);
  background: var(--surface-2); color: var(--muted);
  font-family: inherit; font-size: 12px; cursor: pointer;
  transition: border-color 0.2s, color 0.2s, background 0.2s;
}
.theme-opt .t-ic { font-size: 18px; line-height: 1; }
.theme-opt.active {
  border-color: var(--primary); color: var(--primary-deep);
  background: var(--soft-warm);
}
.theme-opt:active { transform: scale(0.97); }

/* ===== 情绪回应 ===== */
.react-bar { display: flex; flex-wrap: wrap; gap: 8px; align-items: center; margin-top: 12px; }
.react-bar:empty { display: none; }
.react-btn {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 7px 14px; border-radius: 100px;
  border: 1.5px solid var(--line); background: var(--surface-2);
  color: var(--text); font-family: inherit; font-size: 13px; cursor: pointer;
  transition: transform 0.15s, border-color 0.2s, background 0.2s;
}
.react-btn:active { transform: scale(0.94); }
.react-btn.sent { border-color: var(--primary); background: var(--soft-warm); color: var(--primary-deep); }
.react-btn .r-ic { font-size: 15px; line-height: 1; }
.react-hint { font-size: 12px; color: var(--muted); margin-right: 2px; }

/* 收到回应时的小徽标：显示"TA 抱了你" */
.react-received {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 6px 14px; border-radius: 100px;
  background: var(--soft-lavender); color: var(--ink-purple);
  font-size: 13px; animation: reactPop 0.4s ease;
}
@keyframes reactPop {
  0% { transform: scale(0.6); opacity: 0; }
  60% { transform: scale(1.08); opacity: 1; }
  100% { transform: scale(1); opacity: 1; }
}

/* 情绪预警：连续低溫时的轻提醒。语气要克制，不能做成监控感 */
.mood-alert {
  background: var(--soft-lavender); border-left: 3px solid var(--lavender);
  border-radius: 14px; padding: 14px 16px; margin-top: 12px;
}
.mood-alert .a-title { font-size: 14px; color: var(--ink-purple); font-weight: 500; margin-bottom: 4px; }
.mood-alert .a-text { font-size: 13px; color: var(--muted); line-height: 1.7; }

/* 触控热区补偿：文字标签本身较小（视觉需要），
   用伪元素把可点区域撑到 44px，手指不容易点空。 */
.mood-chip::after, .quick-chip::after {
  content: ''; position: absolute;
  left: 0; right: 0;
  top: 50%; transform: translateY(-50%);
  height: 44px; min-height: 100%;
}

/* ===== 正向时刻的反馈动效 =====
 * 和好币增加、收到回应这类"好事"值得被看见。
 * 没有反馈的话，用户点完不确定到底记上没有。 */
@keyframes coinPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.18); }
  70% { transform: scale(0.96); }
  100% { transform: scale(1); }
}
.coin-orb.pop { animation: coinPop 0.5s ease; }

/* 静止时也要有呼吸感，让这枚"币"像个活的东西 */
@keyframes coinBreath {
  0%, 100% { box-shadow: 0 8px 24px rgba(212,160,80,0.35); }
  50% { box-shadow: 0 8px 32px rgba(212,160,80,0.5); }
}
.coin-orb { animation: coinBreath 4s ease-in-out infinite; }

/* 数字变化时的强调 */
@keyframes numFlash {
  0% { opacity: 0.3; transform: translateY(-4px); }
  100% { opacity: 1; transform: translateY(0); }
}
.coin-orb .num.pop { animation: numFlash 0.35s ease; }

/* 尊重系统的"减少动态效果"设置：前庭敏感的人会因为动画不适 */
@media (prefers-reduced-motion: reduce) {
  .coin-orb, .coin-orb.pop, .coin-orb .num.pop, .react-received { animation: none !important; }
  .screen { animation: none !important; }
  * { transition-duration: 0.01ms !important; }
}

/* ===== 首页焦点：温度 =====
 * 原先四个区块平铺、视觉权重相同，用户不知道"今天该先做哪件事"。
 * 现在温度卡加重（更大留白 + 主色细边），其余收进折叠区。 */
.focus-card {
  border: 1.5px solid var(--soft-warm-2);
  box-shadow: 0 2px 14px var(--shadow);
  padding: 20px 18px;
}
.section-block h4 { position: relative; }
.focus-card h4 { font-size: 17px; }

/* TA 的温度：只读，弱化为一排小字，不与"我"等权重 */
.temp-row.readonly { margin-top: 12px; padding-top: 12px; border-top: 1px dashed var(--line); }
.temp-row.readonly .who { color: var(--muted); font-size: 13px; }
.temp-row.readonly .temp-dot {
  width: 30px; height: 30px; font-size: 12px;
  border-width: 1.5px; cursor: default; pointer-events: none;
}
.ta-temp-note { font-size: 12px; color: var(--muted); margin-left: 4px; white-space: nowrap; }

/* ===== 折叠区 ===== */
.more-toggle {
  display: flex; align-items: center; gap: 8px; width: 100%;
  /* ★ margin-bottom 给 16px。
     「绑定伴侣」折叠头收起时紧贴下面的设置列表，
     看起来像列表的一项、而不是一个独立入口。
     展开时内容区紧跟其后，多出的 16px 正好充当上下两块的分隔。 */
  padding: 14px 16px; margin: 14px 0 16px;
  border-radius: 16px; border: 1.5px dashed var(--line);
  background: transparent; color: var(--muted);
  font-family: inherit; font-size: 14px; cursor: pointer;
  transition: border-color 0.2s, color 0.2s;
}
.more-toggle:active { transform: scale(0.99); }
.more-toggle .mt-label { font-weight: 500; }
.more-toggle .mt-sub { flex: 1; text-align: left; font-size: 12px; opacity: 0.8; }
.more-toggle .mt-arrow {
  font-size: 18px; line-height: 1; transition: transform 0.25s ease;
  transform: rotate(0deg);
}
.more-toggle[aria-expanded="true"] { border-style: solid; border-color: var(--line); color: var(--primary-deep); }
.more-toggle[aria-expanded="true"] .mt-arrow { transform: rotate(90deg); }

.more-section[hidden] { display: none; }
.more-section { animation: moreIn 0.25s ease; }
@keyframes moreIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: translateY(0); } }

/* ===== 温度曲线：两人的差距 ===== */
.temp-gap-note { font-size: 12px; color: var(--muted); line-height: 1.7; margin-top: 8px; text-align: center; }
.temp-gap-note:empty { display: none; }
.temp-gap-note.warn { color: var(--ink-purple); }
/* 图例里的"差距"用小色块表示 */
.legend-gap .dot.gap {
  width: 14px; height: 8px; border-radius: 2px;
  background: var(--primary); opacity: 0.25;
}

/* ===== 安全区：拉黑 / 注销 ===== */
.block-row {
  display: flex; align-items: center; justify-content: space-between;
  padding: 10px 0; border-bottom: 1px solid var(--line);
}
.block-row .b-id { font-size: 14px; }
.block-row .mini-btn { flex: 0 0 auto; padding: 6px 14px; font-size: 12px; width: auto; }

/* 危险操作区：用红色左边框明确标出这是破坏性操作 */
.danger-zone { border-left: 3px solid var(--danger); }

/* 邀请卡片里的文字按钮 */
.link-btn {
  background: none; border: none; padding: 4px 0;
  color: var(--muted); font-family: inherit; font-size: 12px;
  cursor: pointer; text-decoration: underline; text-underline-offset: 2px;
}
.link-btn:active { color: var(--danger); }

/* ===== 注销确认弹窗 ===== */
.modal-mask {
  position: fixed; inset: 0; z-index: 500;
  background: var(--overlay);
  display: flex; align-items: center; justify-content: center;
  padding: 24px;
}
.modal-box {
  background: var(--card); border-radius: 20px; padding: 24px 22px;
  max-width: 340px; width: 100%;
  box-shadow: 0 12px 40px var(--shadow);
}
.modal-title { font-size: 17px; font-weight: 600; color: var(--text); margin-bottom: 12px; }
.modal-text { font-size: 14px; line-height: 1.8; color: var(--muted); margin-bottom: 20px; }
.modal-actions { display: flex; gap: 10px; }
.modal-actions .btn { flex: 1; padding: 13px; font-size: 15px; }

/* ===== 注册页的协议勾选 ===== */
.agree-row {
  display: flex; align-items: flex-start; gap: 8px;
  margin: 0 0 16px; cursor: pointer; user-select: none;
}
.agree-row input[type="checkbox"] {
  margin: 3px 0 0; width: 16px; height: 16px; flex-shrink: 0;
  accent-color: var(--primary); cursor: pointer;
}
.agree-text { font-size: 13px; color: var(--muted); line-height: 1.7; }
.agree-text a { color: var(--primary-deep); text-decoration: underline; text-underline-offset: 2px; }

/* ===== 安全问题下拉 ===== */
.auth-select {
  appearance: none; -webkit-appearance: none;
  background-image: linear-gradient(45deg, transparent 50%, var(--muted) 50%),
                    linear-gradient(135deg, var(--muted) 50%, transparent 50%);
  background-position: calc(100% - 18px) 50%, calc(100% - 13px) 50%;
  background-size: 5px 5px, 5px 5px;
  background-repeat: no-repeat;
  padding-right: 36px;
  cursor: pointer;
}
.auth-select:invalid, .auth-select option[value=""] { color: var(--muted); }

/* ===== 「我的」设置入口列表 ===== */
.me-list {
  background: var(--card);
  border-radius: 18px;
  overflow: hidden;
  margin-bottom: 14px;
}
.me-row {
  display: flex; align-items: center; gap: 12px;
  width: 100%; padding: 15px 16px;
  background: none; border: none; border-bottom: 1px solid var(--line);
  font-family: inherit; font-size: 15px; color: var(--text);
  text-align: left; cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.me-row:last-child { border-bottom: none; }
.me-row:active { background: rgba(127,127,127,.06); }
.me-row.open { background: rgba(212,160,80,.08); }
.me-row.danger .me-t { color: var(--danger); }

.me-ic {
  flex: 0 0 auto; width: 30px; height: 30px; border-radius: 9px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(127,127,127,.1); font-size: 15px; color: var(--muted);
}
.me-row.danger .me-ic { background: rgba(176,96,96,.12); color: var(--danger); }

.me-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.me-t { font-size: 15px; }
.me-d { font-size: 12px; color: var(--muted); }
.me-ar { flex: 0 0 auto; color: var(--muted); font-size: 18px; line-height: 1; }
.me-row.open .me-ar { transform: rotate(90deg); }

/* 展开的面板 */
.me-panel[hidden] { display: none; }
.me-panel { animation: meFade .18s ease; }
@keyframes meFade { from { opacity: 0; transform: translateY(-4px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .me-panel { animation: none; }
  .me-row.open .me-ar { transition: none; }
}
.me-row .me-ar { transition: transform .18s ease; }

/* 底部导航：临时隐藏某一项（如未绑定时的「我们」） */
.bottom-nav .nav-item.nav-hidden { display: none; }

/* ===== 面板内联到列表里（紧跟对应行下方） ===== */
/* 面板被移进 .me-list 内部后，不能再有自己的背景和圆角，
   否则会出现"卡片套卡片"的双层边框。 */
.me-list .me-panel {
  background: transparent;
  margin: 0;
  border-radius: 0;
  padding: 4px 16px 16px;
  border-bottom: 1px solid var(--line);
  box-shadow: none;
}
/* 行里已经有标题和说明了，面板内再显示一次是重复 */
.me-list .me-panel > h4 {
  display: none;
}
/* 面板内的按钮不要顶到底边 */
.me-list .me-panel .btn { margin-bottom: 0; }

/* ===== 单人模式轻引导 ===== */
.solo-guide {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 13px 14px;
  margin-bottom: 14px;
}
.solo-guide[hidden] { display: none; }
.sg-ic {
  flex: 0 0 auto; width: 32px; height: 32px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(212,160,80,.14); color: var(--primary-deep); font-size: 16px;
}
.sg-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.sg-t { font-size: 14px; font-weight: 500; }
.sg-d { font-size: 12px; color: var(--muted); line-height: 1.6; }
.sg-x {
  flex: 0 0 auto; width: 28px; height: 28px; border-radius: 50%;
  border: none; background: rgba(127,127,127,.1);
  color: var(--muted); font-size: 17px; line-height: 1; cursor: pointer;
}

/* ===== 连续记录里程碑 ===== */
.milestone-toast {
  position: fixed; inset: 0; z-index: 900;
  display: flex; align-items: center; justify-content: center;
  background: rgba(0,0,0,.45);
  padding: 24px;
}
.milestone-toast[hidden] { display: none; }
.ms-card {
  background: var(--card);
  border-radius: 22px;
  padding: 28px 24px;
  max-width: 320px; width: 100%;
  text-align: center;
  animation: msPop .32s cubic-bezier(.2,.9,.3,1.2);
}
@keyframes msPop { from { opacity: 0; transform: scale(.9); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) {
  .ms-card { animation: none; }
}
.ms-num {
  font-size: 52px; font-weight: 600; line-height: 1;
  color: var(--primary-deep);
  font-family: Georgia, "Songti SC", serif;
}
.ms-unit { font-size: 13px; color: var(--muted); margin-top: 4px; }
.ms-word {
  font-size: 14px; line-height: 1.9; color: var(--text);
  margin: 16px 0 20px;
}
.ms-ok {
  width: 100%; padding: 13px;
  border: none; border-radius: 14px;
  background: var(--primary); color: var(--surface-2);
  font-family: inherit; font-size: 15px; cursor: pointer;
}

/* ===== 「我们」首次说明 ===== */
.more-intro {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 18px;
  padding: 18px 18px 16px;
  margin-bottom: 14px;
}
.mi-t { font-size: 15px; font-weight: 500; margin-bottom: 12px; }
.mi-list { margin: 0 0 14px; padding-left: 20px; font-size: 13px; line-height: 2; color: var(--muted); }
.mi-list b { color: var(--text); font-weight: 500; }
.mi-warn {
  font-size: 13px; line-height: 1.9;
  background: rgba(212,160,80,.12);
  border-left: 3px solid var(--primary);
  border-radius: 0 10px 10px 0;
  padding: 10px 12px;
  margin-bottom: 14px;
}
.mi-ok {
  width: 100%; padding: 12px;
  border: 1.5px solid var(--line); border-radius: 14px;
  background: transparent; color: var(--text);
  font-family: inherit; font-size: 14px; cursor: pointer;
}

/* ===== 单人周回顾 ===== */
.solo-weekly .sw-grid {
  display: flex; gap: 10px; margin: 12px 0;
}
.sw-cell {
  flex: 1; text-align: center;
  background: rgba(127,127,127,.06);
  border-radius: 12px; padding: 12px 6px;
}
.sw-n { font-size: 22px; font-weight: 500; color: var(--primary-deep); line-height: 1.2; }
.sw-l { font-size: 12px; color: var(--muted); margin-top: 3px; }
.sw-word {
  font-size: 14px; line-height: 1.9; color: var(--text);
  margin-top: 4px;
}
.sw-top {
  font-size: 13px; color: var(--muted); margin-top: 8px;
  padding-top: 10px; border-top: 1px solid var(--line);
}
.sw-top b { color: var(--text); font-weight: 500; }

/* ===== 里程碑进度条（常驻） ===== */
.ms-track {
  display: flex; align-items: center; justify-content: space-between;
  padding: 2px 6px;
}
.ms-dot {
  width: 26px; height: 26px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  border: 1.5px solid var(--line);
  background: var(--card);
  font-size: 11px; color: var(--muted);
  flex: 0 0 auto;
}
.ms-dot.done {
  background: var(--primary); border-color: var(--primary);
  color: var(--surface-2); font-weight: 500;
}
/* 未达成的档位一律不高亮——高亮会被误读成"已经到了" */
.ms-dot:not(.done) {
  border-style: dashed;
}
/* 曾经达成过，但当前连击已断。
 * 必须和"从未到过"区分开：虚线在视觉上就是"没到过"，
 * 对记过 50 天却断了一天的人，等于把他做过的全抹了。
 * 这里只给实线 + 淡底，不给高亮色——高亮留给"现在就达到了"。 */
.ms-dot.reached {
  border-style: solid;
  border-color: var(--primary);
  color: var(--primary-deep);
  background: rgba(201, 123, 99, 0.12);
}
.ms-line { flex: 1; height: 1.5px; background: var(--line); }
.ms-hint {
  text-align: center; font-size: 12px; color: var(--muted);
  margin-top: 6px;
}

/* ===== TA 温度提示 ===== */
.ta-temp-note.bind-tip { color: var(--muted); }
.ta-bind-link {
  border: none; background: none;
  color: var(--primary); font-family: inherit; font-size: 13px;
  cursor: pointer; padding: 4px 8px; margin-left: auto;
  -webkit-tap-highlight-color: transparent;
}
.ta-bind-link[hidden] { display: none; }

/* ===== 装桌面自动提示 ===== */
.install-prompt {
  display: flex; align-items: center; gap: 12px;
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 14px;
  animation: ipIn .3s ease;
}
.install-prompt[hidden] { display: none; }
@keyframes ipIn { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
@media (prefers-reduced-motion: reduce) { .install-prompt { animation: none; } }
.ip-ic {
  flex: 0 0 auto; width: 34px; height: 34px; border-radius: 10px;
  display: flex; align-items: center; justify-content: center;
  background: rgba(212,160,80,.14); color: var(--primary-deep); font-size: 17px;
}
.ip-tx { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.ip-t { font-size: 14px; font-weight: 500; }
.ip-d { font-size: 12px; color: var(--muted); line-height: 1.6; }
.ip-go {
  flex: 0 0 auto; padding: 9px 14px;
  border: none; border-radius: 12px;
  background: var(--primary); color: var(--surface-2);
  font-family: inherit; font-size: 13px; cursor: pointer; white-space: nowrap;
}
.ip-x {
  flex: 0 0 auto; width: 26px; height: 26px; border-radius: 50%;
  border: none; background: rgba(127,127,127,.1);
  color: var(--muted); font-size: 16px; line-height: 1; cursor: pointer;
}

/* ===== TA 温度：未绑定时缩小并禁用 ===== */
/* 保留 1-5 让人看出"绑定后这里会显示 TA 的分数"，
   但缩成小号且不响应点击——做成能点的却没反应更糟。 */
.temp-row.unbound .temp-dots { gap: 4px; }
.temp-row.unbound .temp-dot {
  width: 22px; height: 22px; font-size: 11px;
  opacity: .45; cursor: default;
}
.temp-row.unbound .temp-dot:disabled { opacity: .45; }
.temp-row.unbound .who { font-size: 13px; opacity: .7; }

/* ===== 里程碑进度：紧挨连续记录徽章，所以要更紧凑 ===== */
.hero-stats #milestoneTrack { width: 100%; margin-top: 8px; }
.hero-stats #milestoneTrack[hidden] { display: none; }
.hero-stats .ms-track { padding: 0 10px; }
.hero-stats .ms-dot { width: 22px; height: 22px; font-size: 10px; }
.hero-stats .ms-hint { font-size: 11px; margin-top: 4px; }

/* ===== 首页问候：Hi～ 昵称（无头像圆圈） ===== */
.hi-btn {
  display: inline-flex; align-items: center; gap: 2px;
  background: none; border: none; cursor: pointer;
  font-family: inherit; font-size: 15px; color: var(--text);
  padding: 6px 10px; border-radius: 100px;
  -webkit-tap-highlight-color: transparent;
}
.hi-btn:active { background: rgba(127,127,127,.08); }
.hi-btn.she { color: var(--who-she); }

/* ===== 陪伴指引卡片 ===== */
/* 语气要柔软：这不是警告，是有人在轻轻告诉你该怎么办 */
.care-card {
  background: var(--card);
  border: 1px solid var(--line);
  border-left: 3px solid var(--primary);
  border-radius: 18px;
  padding: 16px 18px;
  margin-bottom: 14px;
}
.care-card[hidden] { display: none; }

.cc-head { display: flex; align-items: baseline; gap: 8px; margin-bottom: 10px; }
.cc-ic { color: var(--primary-deep); font-size: 14px; }
.cc-lead { font-size: 15px; font-weight: 500; }

.cc-said { font-size: 14px; line-height: 1.9; color: var(--text); }

.cc-words {
  font-size: 14px; line-height: 1.9; color: var(--text);
  background: rgba(212,160,80,.10);
  border-radius: 12px; padding: 10px 12px; margin-top: 10px;
  font-family: Georgia, "Songti SC", serif;
}

.cc-sec { margin-top: 14px; }
.cc-t { font-size: 12px; color: var(--primary-deep); font-weight: 500; margin-bottom: 6px; }
.cc-t-soft { color: var(--muted); }
.cc-list { margin: 0; padding-left: 18px; font-size: 13px; line-height: 2; color: var(--text); }
.cc-list.soft { color: var(--muted); }

.cc-tip { font-size: 12px; color: var(--muted); margin-top: 12px; line-height: 1.8; }

/* 求助渠道：安静地出现，不惊吓 */
.cc-crisis {
  margin-top: 14px; padding-top: 12px;
  border-top: 1px dashed var(--line);
  font-size: 12px; line-height: 1.9; color: var(--muted);
}
.cc-hot { color: var(--primary-deep); font-weight: 500; }

/* ===== 我需要的陪伴（设置） ===== */
.care-intro {
  font-size: 13px; line-height: 1.9; color: var(--muted);
  background: rgba(212,160,80,.10);
  border-radius: 12px; padding: 11px 12px; margin-bottom: 14px;
}
.care-needs { display: flex; flex-direction: column; gap: 8px; }
.care-need {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 12px; border-radius: 13px;
  border: 1.5px solid var(--line); cursor: pointer;
}
.care-need.on { border-color: var(--primary); background: rgba(212,160,80,.07); }
.care-need input { margin-top: 3px; accent-color: var(--primary); }
.cn-tx { display: flex; flex-direction: column; gap: 2px; }
.cn-t { font-size: 14px; }
.cn-d { font-size: 12px; color: var(--muted); }

.care-words-label { font-size: 13px; color: var(--muted); margin: 14px 0 6px; }
.care-words {
  width: 100%; min-height: 74px; resize: vertical;
  padding: 11px 12px; border-radius: 13px;
  border: 1.5px solid var(--line); background: var(--bg);
  font-family: inherit; font-size: 14px; line-height: 1.8; color: var(--text);
}
.care-share {
  display: flex; align-items: flex-start; gap: 9px;
  font-size: 13px; margin: 14px 0; cursor: pointer;
}
.care-share input { margin-top: 2px; accent-color: var(--primary); }
.cs-sub { display: block; font-size: 12px; color: var(--muted); margin-top: 2px; }
.care-note {
  font-size: 12px; color: var(--muted); line-height: 1.8; margin-top: 10px;
}

/* 选项的本意说明：防止「给我空间」被读成"推开你" */
.cc-mean {
  font-size: 13px; line-height: 1.9; color: var(--muted);
  padding-left: 10px; border-left: 2px solid var(--line);
  margin-top: 8px;
}

/* ===== 里程碑回顾：让攒下的东西成为回报 ===== */
.msr-block {
  margin: 14px 0 4px; padding-top: 14px;
  border-top: 1px solid var(--line);
}
.msr-line { font-size: 13px; line-height: 1.9; color: var(--muted); }
.msr-line.soft { font-size: 12px; }
/* 自己写下的话：这是回顾里最有分量的部分 */
.msr-quote {
  font-size: 14px; line-height: 1.9; color: var(--text);
  font-family: Georgia, "Songti SC", serif;
  background: rgba(212,160,80,.10);
  border-radius: 12px; padding: 11px 12px;
  margin: 10px 0 6px;
}
.msr-from { font-size: 11px; color: var(--muted); text-align: left; }
.msr-total {
  font-size: 12px; color: var(--muted); line-height: 1.8;
  margin-top: 10px;
}
.ms-look {
  width: 100%; padding: 11px; margin-top: 8px;
  border: none; background: none;
  color: var(--primary); font-family: inherit; font-size: 13px;
  cursor: pointer;
}

/* ===== 断签说明：接住，不责备 ===== */
.streak-note {
  font-size: 12px; line-height: 1.8; color: var(--muted);
  text-align: center; padding: 2px 6px 0;
}

/* ===== 公告（后台发布） ===== */
.announce {
  position: relative;
  border-radius: 14px; padding: 12px 34px 12px 14px;
  margin-bottom: 12px;
  border: 1px solid var(--line);
  background: var(--card);
}
.announce.lv-info  { border-left: 3px solid var(--primary); }
.announce.lv-warn  { border-left: 3px solid var(--sage); background: rgba(139,168,136,.14); }
.announce.lv-danger{ border-left: 3px solid var(--danger); background: rgba(176,96,96,.12); }
.an-t { font-size: 14px; font-weight: 500; margin-bottom: 4px; }
.an-c { font-size: 13px; line-height: 1.8; color: var(--muted); white-space: pre-wrap; }
.an-x {
  position: absolute; top: 8px; right: 8px;
  width: 24px; height: 24px; border-radius: 50%;
  border: none; background: rgba(127,127,127,.12);
  color: var(--muted); font-size: 15px; line-height: 1; cursor: pointer;
}

/* ===== 导出数据 ===== */
.exp-intro { font-size: 13px; line-height: 1.9; color: var(--text); }
.exp-note {
  font-size: 12px; line-height: 1.8; color: var(--muted);
  background: rgba(127,127,127,.07);
  border-radius: 10px; padding: 9px 11px; margin: 12px 0;
}
.exp-note strong { color: var(--text); }
.exp-status { font-size: 12px; color: var(--muted); margin-top: 10px; min-height: 16px; }

/* ===== 系统通知（消息页顶部，独立成区） ===== */
.notice-box {
  border: 1px solid var(--line); border-radius: 16px;
  margin-bottom: 12px; overflow: hidden; background: var(--card);
}
.notice-box.unread { border-color: var(--primary); }

.notice-head {
  width: 100%; display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; border: none; background: none;
  font-family: inherit; cursor: pointer; color: var(--text);
}
.nt-ic { color: var(--primary-deep); font-size: 13px; }
.nt-t { font-size: 14px; font-weight: 500; }
.nt-badge {
  background: var(--danger); color: var(--on-primary);
  border-radius: 9px; padding: 1px 8px; font-size: 11px;
}
.nt-sub { font-size: 11px; color: var(--muted); }
.nt-ar { margin-left: auto; color: var(--muted); font-size: 12px; }

.notice-peek {
  display: flex; align-items: baseline; gap: 8px;
  padding: 0 14px 11px 14px; font-size: 12px; color: var(--muted);
}
.nt-pt { flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.nt-pd { flex-shrink: 0; }

.notice-list { border-top: 1px solid var(--line); }
.notice-list[hidden] { display: none; }
.notice-item {
  padding: 12px 14px; border-bottom: 1px solid var(--line);
  border-left: 3px solid var(--primary);
}
.notice-item:last-child { border-bottom: none; }
.notice-item.unread { background: rgba(212,160,80,.08); }
.notice-item.lv-warn   { border-left-color: var(--sage); }
.notice-item.lv-danger { border-left-color: var(--danger); }
.ni-t { font-size: 13px; font-weight: 500; margin-bottom: 4px; }
.ni-c { font-size: 12px; line-height: 1.8; color: var(--muted); white-space: pre-wrap; }
.ni-d { font-size: 11px; color: var(--muted); margin-top: 6px; opacity: .8; }

/* 底部导航红点 */
.nav-dot {
  position: absolute; top: 6px; right: 50%;
  margin-right: -14px; width: 7px; height: 7px;
  border-radius: 50%; background: var(--danger);
}
.nav-dot[hidden] { display: none; }

/* 版本号：排查"改了没生效"时用来确认设备上跑的版本 */
.app-version {
  text-align: center; font-size: 11px; color: var(--muted);
  opacity: .65; padding: 14px 0 4px;
}

/* ===== 同步诊断 ===== */
.diag-sec {
  border: 1px solid var(--line); border-radius: 12px;
  padding: 11px 13px; margin-bottom: 11px;
}
.diag-t {
  font-size: 12px; font-weight: 500; color: var(--muted);
  margin-bottom: 8px;
}
.diag-row {
  display: flex; align-items: baseline; gap: 8px;
  padding: 5px 0; border-bottom: 1px solid var(--line);
  font-size: 12px; line-height: 1.6;
}
.diag-row:last-child { border-bottom: none; }
.diag-row > span:first-child { flex: 0 0 62px; color: var(--muted); }
.diag-row > b { flex: 1; font-weight: 400; word-break: break-all; }
.dg-k { flex: 0 0 96px !important; font-weight: 500; word-break: break-all; }
.dg-ts { flex: 0 0 108px; font-size: 10px; color: var(--muted); text-align: right; opacity: .85; }
.dg-ok   { flex: 1; color: var(--sage); }
.dg-warn { flex: 1; color: var(--primary-deep); }
.dg-bad  { flex: 1; color: var(--danger); }
.dg-down { flex: 1; color: var(--muted); }
.diag-bad { color: var(--danger); }
.diag-hint {
  font-size: 12px; line-height: 1.8; color: var(--muted);
  background: rgba(176,96,96,.08); border-radius: 10px; padding: 9px 11px;
}

.diag-note {
  font-size: 11px; line-height: 1.7; color: var(--muted);
  opacity: .85; margin-bottom: 8px;
}

/* ===== 账号行 + 复制按钮 ===== */
.acct-row {
  display: inline-flex; align-items: center; gap: 6px;
  justify-content: center; margin-top: 2px;
}
.acct-txt { font-size: 13px; color: var(--muted); }
.acct-copy {
  /* 触摸目标要够大：图标小但可点区域不能小，否则手机上点不中 */
  display: inline-flex; align-items: center; justify-content: center;
  width: 28px; height: 28px; margin: -6px -4px -6px 0;
  padding: 0; border: none; background: none;
  font-family: inherit; font-size: 14px; line-height: 1;
  color: var(--muted); cursor: pointer; border-radius: 8px;
  opacity: .75; transition: opacity .15s, background .15s;
}
.acct-copy:hover { opacity: 1; background: rgba(128,128,128,.12); }
.acct-copy:active { background: rgba(128,128,128,.2); }

/* ============================================================
 * 树洞
 *
 * 视觉上刻意做得"轻"：没有头像、没有昵称、卡片间留白大。
 * 来这里的人已经够累了，界面不该再给他压力。
 * ============================================================ */
.th-box { background: var(--card); border-radius: 16px; padding: 16px; margin-top: 12px; }
.th-input {
  width: 100%; min-height: 96px; padding: 14px; box-sizing: border-box;
  border-radius: 12px; border: 1.5px solid var(--line);
  background: var(--surface-2); font-family: inherit; font-size: 15px;
  line-height: 1.8; color: var(--text); resize: vertical;
}
.th-send-row {
  display: flex; align-items: center; justify-content: space-between;
  gap: 12px; margin-top: 12px;
}
.th-hint { font-size: 12px; color: var(--muted); }
.th-send-row .btn { padding: 10px 22px; }

.th-empty {
  text-align: center; padding: 40px 20px; color: var(--muted);
  font-size: 14px; line-height: 1.9;
}
.th-card {
  background: var(--card); border-radius: 16px; padding: 16px;
  margin-top: 12px;
}
.th-head {
  display: flex; align-items: center; justify-content: space-between;
  margin-bottom: 10px;
}
.th-who { font-size: 13px; color: var(--muted); }
.th-time { font-size: 12px; color: var(--faint); }
.th-body {
  font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 16px; line-height: 2;
  color: var(--text); white-space: pre-wrap; word-break: break-word;
}
.th-foot {
  display: flex; align-items: center; gap: 12px; margin-top: 14px;
}
.th-hug {
  padding: 7px 16px; border-radius: 100px; font-size: 13px;
  font-family: inherit; cursor: pointer;
  background: var(--bg); color: var(--muted);
  border: 1.5px solid var(--line);
  transition: all 0.15s;
}
.th-hug.hugged {
  background: var(--soft-warm); color: var(--primary-deep);
  border-color: var(--primary);
}
.th-count { font-size: 12px; color: var(--faint); }

/* 求助渠道：只在说到自伤时出现，不常驻。
   常驻会让每个进来的人都先看到危机提示，把树洞变得沉重。 */
.th-crisis {
  background: var(--soft-warm); border: 1px solid var(--line);
  border-radius: 14px; padding: 14px 16px; margin-top: 12px;
  font-size: 13px; line-height: 1.9; color: var(--text);
}
.th-crisis strong { color: var(--primary-deep); }

/* 入口卡片 */
.th-entry { cursor: pointer; transition: opacity 0.15s; }
.th-entry:active { opacity: 0.7; }
.th-entry-desc { font-size: 13px; color: var(--muted); margin: 6px 0 0; line-height: 1.7; }

/* 个人卡片：横向排布，避免大块留白 */
.me-idcard {
  display: flex; align-items: center; gap: 14px; padding: 4px 0;
}
.me-idicon {
  font-size: 26px; line-height: 1; flex: 0 0 auto;
  width: 44px; height: 44px; border-radius: 50%;
  background: var(--surface-2);
  display: flex; align-items: center; justify-content: center;
}
.me-idmain { flex: 1; min-width: 0; }
.me-idname {
  font-size: 17px; font-weight: 500; color: var(--text);
  line-height: 1.4; margin-bottom: 2px;
}
.me-idcard .acct-row { margin-top: 0; justify-content: flex-start; }

/* ===== 了解情绪 =====
 * 全部使用主题变量，不硬编码色值 —— 深色模式下会自动跟随。 */
.edu-chapter { margin: 0 0 16px; }
.edu-chapter h4 {
  margin: 0 0 8px; font-size: 13px; font-weight: 600;
  color: var(--muted); letter-spacing: .5px;
}
.edu-item {
  display: flex; align-items: center; justify-content: space-between;
  padding: 12px 4px; cursor: pointer;
  border-bottom: 1px solid var(--line);
}
.edu-item:last-child { border-bottom: none; }
.edu-item:active { opacity: .6; }
.edu-title { font-size: 14px; color: var(--text); }
.edu-arrow { color: var(--faint); font-size: 18px; line-height: 1; }

.edu-sheet {
  position: fixed; inset: 0; z-index: 999;
  background: rgba(0, 0, 0, .45);
  display: flex; align-items: flex-end; justify-content: center;
}
.edu-sheet-in {
  background: var(--card); border-radius: 20px 20px 0 0;
  width: 100%; max-width: 480px; padding: 22px 20px 26px;
  max-height: 82vh; overflow-y: auto;
}
.edu-crumb { font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.edu-sheet-in h3 { margin: 0 0 14px; font-size: 18px; color: var(--text); }
.edu-p {
  margin: 0 0 12px; font-size: 14px; line-height: 1.75;
  color: var(--text-soft, var(--text));
}
.edu-cols { display: flex; gap: 10px; margin: 16px 0 4px; }
.edu-col { flex: 1; border-radius: 14px; padding: 12px 14px; }
.edu-col.do   { background: var(--sage-soft, var(--bg-soft, transparent)); border: 1px solid var(--sage); }
.edu-col.dont { background: transparent; border: 1px solid var(--line); }
.edu-col h5 { margin: 0 0 8px; font-size: 13px; font-weight: 600; }
.edu-col.do h5   { color: var(--sage); }
.edu-col.dont h5 { color: var(--danger); }
.edu-col ul { margin: 0; padding-left: 16px; }
.edu-col li { font-size: 12.5px; line-height: 1.7; margin-bottom: 4px; color: var(--text); }
.edu-hotline {
  margin: 14px 0 0; padding: 10px 12px; border-radius: 12px;
  border: 1px dashed var(--danger); color: var(--danger);
  font-size: 13px; text-align: center;
}
.edu-close { margin-top: 18px; width: 100%; }

/* 今日建议：首页的一行入口，样式要轻，不能抢每日一句的位置 */
.today-edu {
  display: flex; flex-direction: column; gap: 6px;
  margin-top: 10px; padding: 12px 14px;
  border: 1px solid var(--line); border-radius: 16px;
  cursor: pointer; font-size: 13px;
  transition: border-color .2s, background .2s;
}
.today-edu:active { opacity: .75; }
/* ★ 悬停/聚焦给出反馈：原来只有 cursor:pointer，
   静态截图里看不出这是个能点的东西。 */
.today-edu:hover { border-color: var(--primary); background: var(--soft-warm); }
.today-edu:focus-visible { outline: 2px solid var(--primary); outline-offset: 2px; }
.today-edu[tabindex] { cursor: pointer; }
.te-label { color: var(--muted); font-size: 12px; flex: none; }
.te-title { color: var(--text); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.te-go { color: var(--faint); flex: none; }

/* ★ 改版：原来整行只有一个 › 箭头，用户看不出能点。
   现在拆成两行——上行是标签，下行是"图标 + 标题 + 实心按钮"。
   关键是那个实心按钮：文字写「读一篇」而不是放一个箭头，
   箭头只表示"有下级"，按钮才表示"可以点"。 */
.te-row { display: flex; align-items: center; gap: 10px; }
.te-icon {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  background: var(--soft-warm); color: var(--primary-deep);
  display: flex; align-items: center; justify-content: center;
  font-size: 15px; line-height: 1;
}
/* 实心小按钮：明确的"可以点这里"信号 */
.te-btn {
  flex: none; display: inline-flex; align-items: center; gap: 3px;
  padding: 6px 12px; border-radius: 100px;
  background: var(--primary); color: var(--on-primary);
  font-size: 12px; font-weight: 500; white-space: nowrap;
}
.te-btn .te-arrow { font-size: 13px; line-height: 1; }

/* ===== 登录/注册方式切换 ===== */
.mode-tabs { display: flex; justify-content: center; gap: 20px; margin-bottom: 16px; }
.mode-tab { font-size: 14px; color: var(--muted); padding-bottom: 4px; border-bottom: 2px solid transparent; }
.mode-tab.active { color: var(--primary); font-weight: 500; border-bottom-color: var(--primary); }
/* 验证码行：输入框占满剩余宽度，"发送"按钮不换行。
   flex:1 让输入框自适应，按钮固定内容宽度 —— 窄屏也不会挤成两行。 */
.code-row { display: flex; gap: 8px; margin-bottom: 12px; align-items: stretch; }
.code-row .auth-input { flex: 1; min-width: 0; margin-bottom: 0; }
.code-btn { width: auto; flex: none; padding: 14px 16px; white-space: nowrap; font-size: 14px; }


/* ==== css/screens.css ==== */
/* 我们的小世界 · 页面样式
 * 页面与工具类：toast / 认证 / 配对 / 聊天 / 覆盖层 / 响应式
 * 由 index.html 内联样式拆分而来，规则顺序与原文件完全一致（样式优先级不变）。
 */
.toast { position: fixed; bottom: 100px; left: 50%; transform: translateX(-50%) translateY(10px); background: var(--toast-bg); color: var(--toast-fg); padding: 10px 20px; border-radius: 100px; font-size: 14px; z-index: 100; opacity: 0; transition: opacity 0.25s, transform 0.25s; pointer-events: none; white-space: nowrap; }
.toast.show { opacity: 1; transform: translateX(-50%) translateY(0); }
.mt-20 { margin-top: 20px; } .mt-30 { margin-top: 30px; }
.hidden { display: none !important; }
.empty-state { text-align: center; color: var(--muted); font-size: 14px; padding: 20px 0; }

.auth-screen { text-align: center; padding-top: 40px; }
.auth-screen .auth-logo { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 28px; color: var(--primary-deep); margin-bottom: 8px; }
.auth-screen .auth-sub { font-size: 14px; color: var(--muted); margin-bottom: 32px; }
/* 性别选择屏没有 auth-sub（副标题已去掉），
   所以 logo 到卡片之间要自己撑开间距，否则两个卡片会贴着标题挤在一起。
   .auth-screen .auth-logo 只有 8px 下边距。 */
.auth-screen .auth-logo + .role-pick { margin-top: 36px; }
/* 站点标语：留空时由 JS 设 hidden，这里只管有内容时的样子 */
.auth-screen .auth-slogan { font-size: 13px; color: var(--muted); margin-bottom: 4px; }
/* 登录页页脚：备案号 / 版权 / 联系邮箱。
   字号必须小且颜色弱 —— 它是合规信息，不是登录页的主角，
   做大了会跟"选性别"两个卡片抢注意力。 */
.site-foot { margin-top: 28px; padding-top: 14px; border-top: 1px solid var(--line); }
.site-foot .sf-line { font-size: 11px; color: var(--muted); line-height: 1.8; }
.site-foot .sf-line a { color: var(--muted); text-decoration: none; }
.site-foot .sf-line a:hover { text-decoration: underline; }
.role-pick { display: flex; gap: 12px; margin: 20px 0; }
.role-card { flex: 1; padding: 24px 16px; border-radius: 18px; border: 2px solid var(--line); background: var(--card); cursor: pointer; font-family: inherit; text-align: center; transition: all 0.2s; }
.role-card.selected { border-color: var(--primary); background: var(--soft-warm); }
.role-card .r-icon { font-size: 32px; margin-bottom: 8px; }
.role-card .r-label { font-size: 16px; font-weight: 500; }


.auth-input { width: 100%; padding: 14px 16px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--card); font-family: inherit; font-size: 16px; margin-bottom: 12px; text-align: center; }
.auth-input:focus { outline: none; border-color: var(--primary); }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 16px 0; }
.pin-dot { width: 48px; height: 48px; border-radius: 50%; border: 2px solid var(--line); background: var(--card); font-size: 20px; display: flex; align-items: center; justify-content: center; }
.pin-dot.filled { border-color: var(--primary); background: var(--soft-warm); }
.pin-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 260px; margin: 16px auto; }
.pin-key { padding: 14px; border-radius: 14px; border: none; background: var(--card); font-family: inherit; font-size: 20px; cursor: pointer; }
.pin-key:active { background: var(--bg); }

.me-chip { display: inline-flex; align-items: center; gap: 6px; padding: 6px 14px; border-radius: 100px; background: var(--card); border: 1.5px solid var(--line); font-size: 13px; color: var(--text); cursor: pointer; }
.me-chip .dot { width: 8px; height: 8px; border-radius: 50%; background: var(--primary); }
.me-chip.she .dot { background: var(--lavender); }


.pair-code { font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace; font-size: 18px; letter-spacing: 2px; background: var(--bg); border-radius: 14px; padding: 16px; text-align: center; word-break: break-all; line-height: 1.8; margin: 12px 0; }
.pair-status { display: flex; align-items: center; gap: 12px; background: var(--soft-green); border-radius: 14px; padding: 14px 16px; margin: 12px 0; }
.pair-status .p-icon { font-size: 24px; }
.pair-status .p-name { font-weight: 500; }
/* 解除绑定：右对齐的一行小字。
   不居中、不撑满、不上色——它的定位是"需要时才来找的选项"，
   不是一个等着被点的按钮。 */
.pair-unbind-row { display: flex; justify-content: flex-end; margin-top: 4px; }
.pair-status .p-desc { font-size: 12px; color: var(--muted); }
.export-box { width: 100%; min-height: 100px; padding: 14px; border-radius: 14px; border: 1.5px solid var(--line); background: var(--bg); font-family: monospace; font-size: 12px; word-break: break-all; margin: 10px 0; }

.qr-wrap { display: flex; justify-content: center; padding: 16px; background: var(--surface-2); border-radius: 16px; margin: 12px 0; }
.qr-wrap img, .qr-wrap canvas { border-radius: 8px; max-width: 220px; width: 100%; height: auto; }
.scanner-overlay { position: fixed; inset: 0; background: var(--overlay-solid); z-index: 200; display: none; flex-direction: column; }
.scanner-overlay.active { display: flex; }
.scanner-overlay video { width: 100%; flex: 1; object-fit: cover; }
.scanner-overlay .scan-hint { position: absolute; top: 50%; left: 50%; transform: translate(-50%, -50%); width: 240px; height: 240px; border: 3px solid var(--primary); border-radius: 16px; box-shadow: 0 0 0 9999px rgba(0,0,0,0.5); display:flex; align-items:flex-end; justify-content:center; }
.scanner-overlay .scan-hint::after { content: '对准 TA 的二维码'; position: absolute; bottom: -36px; color: var(--surface-2); font-size: 14px; white-space: nowrap; }
.scanner-overlay .scan-close { position: absolute; top: 20px; left: 20px; z-index: 5; background: rgba(255,255,255,0.9); border: none; border-radius: 100px; padding: 10px 20px; font-family: inherit; font-size: 14px; cursor: pointer; }

.sync-overlay, .guide-overlay { position: fixed; inset: 0; background: var(--bg); z-index: 200; display: none; flex-direction: column; padding: 20px; overflow-y: auto; }
.sync-overlay.active, .guide-overlay.active { display: flex; }
.guide-overlay { justify-content: center; }
.guide-step { max-width: 420px; margin: 0 auto; }
.guide-step .g-title { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 22px; margin-bottom: 6px; }
.guide-step .g-sub { font-size: 14px; color: var(--muted); line-height: 1.7; margin-bottom: 22px; }
.guide-item { background: var(--card); border: 1.5px solid var(--line); border-radius: 16px; padding: 16px 18px; margin-bottom: 12px; display: flex; gap: 14px; align-items: flex-start; }
.guide-item .g-num { flex: none; width: 28px; height: 28px; border-radius: 50%; background: var(--primary); color: var(--surface-2); font-size: 13px; display: flex; align-items: center; justify-content: center; }
.guide-item .g-t { font-size: 15px; margin-bottom: 3px; }
.guide-item .g-d { font-size: 13px; color: var(--muted); line-height: 1.6; }
.coin-add-row { display: flex; gap: 8px; margin-top: 12px; align-items: center; }
.coin-add-row input { flex: 1; min-width: 0; padding: 10px 14px; border-radius: 12px; border: 1.5px solid var(--line); background: var(--bg); font-family: inherit; font-size: 14px; }
.coin-add-row button { flex: none; width: auto; padding: 10px 18px; border-radius: 12px; font-size: 14px; }
/* 离线提示条：断网时贴顶显示，提醒"记录已存本地，联网后会自动同步" */
.offline-bar { position: fixed; top: 0; left: 0; right: 0; z-index: 300; background: var(--lavender); color: var(--on-lavender); font-size: 13px; text-align: center; padding: 8px 14px; transform: translateY(-100%); transition: transform .25s ease; }
.offline-bar.show { transform: translateY(0); }
.offline-bar .dot { display: inline-block; width: 6px; height: 6px; border-radius: 50%; background: var(--on-lavender); margin-right: 6px; vertical-align: middle; animation: pulse 1.6s infinite; }
@keyframes pulse { 0%,100%{opacity:1} 50%{opacity:.35} }
.update-bar { position: fixed; bottom: 76px; left: 16px; right: 16px; z-index: 300; background: var(--text); color: var(--on-primary); border-radius: 14px; padding: 12px 16px; display: none; align-items: center; justify-content: space-between; gap: 12px; font-size: 13px; box-shadow: 0 8px 24px rgba(0,0,0,0.18); }
.update-bar.show { display: flex; }
.update-bar button { flex: none; background: var(--primary); color: var(--surface-2); border: none; border-radius: 10px; padding: 8px 14px; font-family: inherit; font-size: 13px; cursor: pointer; }
.sync-overlay .scan-close { position: fixed; top: 20px; left: 20px; z-index: 5; background: var(--card); border: 1.5px solid var(--line); border-radius: 100px; padding: 10px 20px; font-family: inherit; font-size: 14px; cursor: pointer; }
.sync-body { max-width: 420px; margin: 60px auto 0; width: 100%; }
.sync-step { text-align: center; }
.sync-step .s-title { font-family: "Noto Serif SC", "Source Han Serif SC", "Songti SC", "STSong", "SimSun", serif; font-size: 20px; margin-bottom: 8px; }
.sync-step .s-desc { font-size: 14px; color: var(--muted); margin-bottom: 20px; line-height: 1.7; }

.chat-list { display: flex; flex-direction: column; gap: 10px; padding: 10px 0 200px; }
.chat-msg { max-width: 75%; padding: 10px 14px; border-radius: 16px; font-size: 15px; line-height: 1.6; word-break: break-word; }
.chat-msg.me { align-self: flex-end; background: var(--primary); color: var(--on-primary); border-bottom-right-radius: 4px; }
.chat-msg.them { align-self: flex-start; background: var(--card); border: 1px solid var(--line); border-bottom-left-radius: 4px; }
.chat-msg .time { font-size: 11px; opacity: 0.7; margin-top: 4px; }
.chat-msg .chat-name { font-size: 11px; opacity: 0.8; margin-bottom: 2px; font-weight: 500; }
.chat-msg.recalled { background: transparent; border: 1px dashed var(--line); color: var(--muted); font-size: 13px; text-align: center; align-self: center; max-width: 90%; }
.chat-msg.recalled .chat-name { display: none; }
.chat-msg.recalled .time { display: none; }
.chat-msg .recalled-hint { font-style: italic; opacity: 0.75; }
.chat-input-bar { position: fixed; bottom: 130px; left: 16px; right: 16px; display: flex; gap: 8px; padding: 8px; background: var(--card); border: 1.5px solid var(--line); border-radius: 28px; box-sizing: border-box; z-index: 40; }
.chat-input-bar input { flex: 1; min-width: 0; padding: 12px 16px; border-radius: 24px; border: 1.5px solid var(--line); background: var(--bg); font-family: inherit; font-size: 15px; }
.chat-input-bar input:focus { outline: none; border-color: var(--primary); }
.chat-input-bar button { padding: 12px 18px; border-radius: 24px; border: none; background: var(--primary); color: var(--on-primary); font-family: inherit; font-size: 15px; cursor: pointer; white-space: nowrap; flex-shrink: 0; }
.chat-empty { text-align: center; color: var(--muted); font-size: 14px; padding: 60px 20px; }
.chat-offline { text-align: center; padding: 10px; background: var(--soft-red); border-radius: 12px; margin: 10px 0; font-size: 13px; color: var(--danger); }
.chat-online { text-align: center; padding: 10px; background: var(--soft-green); border-radius: 12px; margin: 10px 0; font-size: 13px; color: var(--ink-green); }
.trend-day { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.trend-bars { display: flex; gap: 3px; align-items: flex-end; height: 44px; }
.trend-bar { width: 10px; border-radius: 3px 3px 0 0; min-height: 4px; }
.trend-date { font-size: 10px; color: var(--muted); }
.nav-badge { position: absolute; top: 4px; right: 18px; background: var(--danger); color: var(--surface-2); font-size: 10px; min-width: 16px; height: 16px; border-radius: 100px; display: flex; align-items: center; justify-content: center; padding: 0 4px; }
.nav-item { position: relative; }

@media (max-width: 380px) {
  .app { padding: 18px 16px calc(80px + env(safe-area-inset-bottom)); }
  .breath-stage { width: 220px; height: 220px; }
  .breath-circle { width: 150px; height: 150px; }
}


/* ==== css/theme-dark.css ==== */
/* 我们的小世界 · 深色主题
 *
 * 触发方式：<html data-theme="dark">
 * 只覆盖 CSS 变量，不重复写任何结构规则——所有组件自动适配。
 *
 * 配色原则：
 * 1. 不用纯黑做背景。纯黑在 OLED 上对比过强，夜里看情绪类内容会很累。
 *    这里用 #161311 的暖黑，保留产品一贯的暖色调性。
 * 2. 主色在深色下要提亮，否则珊瑚色会发闷、失去辨识度。
 * 3. "浅底深字"的区块（问题卡、悄悄话）反转为"深底浅字"，
 *    并降低饱和度——高饱和色块在深色背景上会显得刺眼。
 */

html[data-theme="dark"] {
  /* 基础层 */
  --bg: #161311;
  --card: #211C1A;
  --primary: #E09A80;          /* 提亮：原 #C97B63 在深底上偏暗 */
  --primary-deep: #F0B39C;     /* 深底上"更深"反而要更亮，否则看不清 */
  --sage: #A3C29F;
  --lavender: #C4B2D6;
  --text: #EDE4DE;
  --muted: #9B8C84;
  --line: #332C29;
  --warm: #D9A08A;
  --danger: #D98A8A;

  /* 语义层 */
  --on-primary: #2A1F1B;       /* 主色按钮上的文字，深色底上要反过来用深色字 */
  /* 深色下这些色块被提亮成浅粉/浅绿/浅紫，仍然要配深色字。
     原来 .quick-chip.selected 用的是 --primary-deep —— 它在深色下被
     提亮成比色块更浅的粉，于是"浅粉底 + 更浅粉字"只有 1.24 对比度，
     选中后完全看不清。按色块定义字色可以彻底避免这类错位。 */
  --on-warm: #2A1F1B;
  --on-sage: #1E2A1C;
  --on-lavender: #241C2C;
  --surface-2: #2A2421;        /* 卡片内的次级底（输入框、列表项） */
  --soft-warm: #2E2521;
  --soft-warm-2: #362B26;
  --soft-lavender: #2C2634;
  --soft-lavender-2: #332B3C;
  --soft-lavender-3: #3A3145;
  --soft-green: #253029;
  --soft-red: #332423;
  /* 深色下 toast 仍是"深底浅字"。
     底要比页面背景亮一档，才看得出是个提示条；
     字用最亮的 --text，保证可读性。 */
  --toast-bg: #3A3230;
  --toast-fg: #EDE4DE;
  --soft-red-2: #3B2A29;
  --soft-gold-a: #F0CE9A;
  --soft-gold-b: #C69246;
  /* 渐变起点色：浅色下是"浅端"，深色下要换成同色系的深端，
     否则呼吸圆、人物横幅会在深色页面里浮出一块亮斑 */
  --lavender-soft-a: #4A3B5C;
  --warm-soft-a: #5A3E31;
  --ink-purple: #C9B8DA;       /* 原深紫字 → 在深底上要变成浅紫字 */
  --ink-green: #A8C4A4;
  --ink-red: #E0A9A0;
  /* 深色下同样要提亮，否则身份色会和背景糊在一起 */
  --who-he: #E09A80;
  --who-she: #C4B2D6;
  /* 提亮：原 #6E625C 在卡片底上只有 2.86:1，属于看不清的范围。
     提到 #92837A 后卡片上 4.62、页面上 5.06，满足正文可读标准。
     --faint 用于次要说明文字，再淡就不是"弱化"而是"看不见"了。 */
  --faint: #92837A;

  /* 热力图梯度：深色下整体降饱和，避免夜览刺眼 */
  --heat-0: #2A2421;
  --heat-1: #4A3029;
  --heat-2: #6B4133;
  --heat-3: #96543E;
  --heat-4: #C97050;

  /* 柔光与阴影 */
  --glow-a: rgba(224,154,128,0.08);
  --glow-b: rgba(196,178,214,0.08);
  --shadow: rgba(0,0,0,0.35);
  --overlay: rgba(0,0,0,0.6);
  --overlay-solid: #000;
}

/* 深色下的几处细节修正（变量覆盖够不到的地方） */
html[data-theme="dark"] body {
  /* 柔光层在深色下要克制，否则背景会发灰 */
  background-image: radial-gradient(ellipse at 20% 0%, var(--glow-a), transparent 50%),
                    radial-gradient(ellipse at 100% 100%, var(--glow-b), transparent 50%);
}

/* 输入框/多行文本：placeholder 在深色下默认偏暗，提一档 */
html[data-theme="dark"] input::placeholder,
html[data-theme="dark"] textarea::placeholder { color: #6E625C; }

/* 深色下自动填充的白色背景会很难看 */
html[data-theme="dark"] input:-webkit-autofill {
  -webkit-text-fill-color: var(--text);
  -webkit-box-shadow: 0 0 0 1000px var(--surface-2) inset;
}

/* 选中文本 */
html[data-theme="dark"] ::selection { background: rgba(224,154,128,0.3); color: var(--text); }

/* 状态栏/地址栏颜色，让 PWA 与页面色调一致（配合 manifest 的 theme_color） */
html[data-theme="dark"] { color-scheme: dark; }
