/* ============================================================
   LifeEcho · 排版收敛层（typeset）
   只做一件事：把全站的字号、行高、字距、纵向节奏收进同一套角色。
   不改颜色、不改圆角、不改布局骨架；加载在所有皮肤之后。

   角色：page 24(手机)/22(桌面) · sec 17/16 · body 15/14 · 2nd 13 · label 12 · tick 11
   每个角色全站只有一个取值，例外只有两处并有注释：
   ① 数据展示（计时器、月份大数字、进度大数字）按 --t-num / display 走；
   ② 日历与心情条的轴刻度按 --t-tick 走（不是标签，是刻度）。
   ============================================================ */

/* ---------- 全局：等宽数字与正文行高 ---------- */
body {
  font-variant-numeric: tabular-nums;
  font-feature-settings: "tnum" 1;
  line-height: var(--lh-body);
}
/* ---------- 语义强调色：浅底上一律压深到 4.5 以上 ---------- */
/* 涨跌芯片、时间戳、逾期标签、领域标签原本直接用亮色，在浅底/浅染芯片上只有 2.7–4.3。 */
/* desktop-v2 的 .delta.up 是无媒体查询的 !important，375 下也会压过皮肤色，故两种属性都接住 */
html[data-visual] body .delta.up,
html[data-skin] body .delta.up,
.delta.up { color: color-mix(in srgb, var(--done) 55%, var(--ink)) !important; }
.tl-time { color: color-mix(in srgb, var(--area, var(--ink-2)) 30%, var(--ink)); }
.tone-urgent,
.tg-title.tone-urgent { color: color-mix(in srgb, var(--urgent) 76%, var(--ink)); }
.mem-cat { font-size: 12px; color: var(--ink-2); }
.ht-v.is-hot { color: color-mix(in srgb, var(--orange) 58%, var(--ink)); }
.set-state { color: var(--ink); }
.set-state[data-tone="ok"] { color: color-mix(in srgb, var(--done) 62%, var(--ink)); }
.set-state[data-tone="err"] { color: color-mix(in srgb, var(--urgent) 76%, var(--ink)); }
.set-state[data-tone="warn"] { color: color-mix(in srgb, var(--orange) 70%, var(--ink)); }
.pf-load { font-size: 12px; color: var(--ink); }
.pf-load[data-tone="ok"] { color: color-mix(in srgb, var(--done) 62%, var(--ink)); }
.pf-load[data-tone="busy"] { color: color-mix(in srgb, var(--primary-ink) 70%, var(--ink)); }
.pf-load[data-tone="err"] { color: color-mix(in srgb, var(--urgent) 76%, var(--ink)); }
/* 便签：正文行高与元信息 —— 卡片高度由内容决定，不再把三行正文压成 1.55 */
.nt-card-meta { font-size: 12px; }
.nt-card-body { line-height: 1.6; }
/* 回忆/记录：卡片不再为等高而被拉长，短语录直接跟在正文后 */
.mem-grid { align-items: start; }
/* 文字链不折行：箭头不再掉到下一行 */
.le-link { white-space: nowrap; }
/* CJK 断行：避免「10月27日」的「日」单独掉到下一行 */
.chain-next { text-wrap: pretty; }
/* 满数据周视图：9.5/8.5px 的块内文字在 375 下不可读，抬到 10.5/9.5；8px 区域标签没有可读空间 */
.mwt-blk em { font-size: 10.5px; }
.mwt-blk .mwt-t { font-size: 9.5px; }
.mwt-blk .mwt-tag { display: none; }
/* 足迹：月度格的数字在染色格上统一用正文墨色，最深一档保留反白 */
.fp-cal-day { color: var(--ink); }
.fp-cal-day.is-l4 { color: var(--accent-fg); background: var(--accent-strong); }
.fp-heat-month { font-size: 11px; color: var(--ink-3); }
.fp-stat-sub { font-size: 12px; }

/* ---------- 数字规范：一处定义，全站生效 ----------
   数值 / 时间 / 金额 / 百分比 / 单位 统一走 Geist Mono（真等宽，自托管已随包，离线可用）。
   字重 500（小值）/ 600（统计主值），字距 0.01em，行高 1.25；负字距一律归零。
   页面不得再各写一套 font-family / letter-spacing / font-weight。 */
:root {
  --num-font: "Geist Mono", "PingFang SC", "Microsoft YaHei UI", ui-monospace, "SF Mono", Consolas, monospace;
  --num-weight: 500;
  --num-weight-strong: 600;
  --num-ls: 0.01em;
  --num-lh: 1.25;
  --num-12: 12px;
  --num-13: 13px;
  --num-14: 14px;
  --num-16: 16px;
  --num-22: 22px;
  /* 旧令牌归零：-0.03/-0.04/-0.05em 会把 0/1/8 的笔画挤在一起 */
  --ls-num: var(--num-ls);
  --ls-num-lg: var(--num-ls);
  --ls-clock: var(--num-ls);
}
body { font-variant-numeric: tabular-nums lining-nums; font-feature-settings: "tnum" 1, "lnum" 1; }

/* 数值槽位：等宽字形 + tabular + 归零字距（!important 压过各皮肤的 Georgia/负字距） */
html body :is(
  .mono, .pc-num, .stat-num, .stage-n, .le-num, .cdh-n, .cdh-c, .fs-clock,
  .ht-v, .pc-tile-val, .dly-status-pct, .fr-ring-num, .pc-count b,
  .pc-hl-dur b, .pc-hl-ndur, .pc-hl-ndate b, .pc-hl-ndate span, .pc-hl-legend b, .pc-hl-legend b span,
  .pc-hl-tlab, .pc-hl-tlab b, .pc-hl-row .val, .pc-hl-nscore, .pc-row-meta,
  .fp-stat-value, .fp-event-time, .fp-bar-value, .fp-bar-day, .fp-dist-value,
  .fp-travel-dist, .fp-travel-date, .fp-travel-main small, .fp-cal-day b, .fp-heat-month, .fp-route-line,
  .fp-event-main small, .fp-related-main small, .fp-edit-row small,
  .fp-place-main small, .fp-place-mini-row small, .le-task-meta,
  .set-stat strong, .cf-val, .agset-urow-num, .mwt-t,
  .tl-time, .plan-time, .m-task-time, .fc-num, .in-stat .stat-num
) {
  font-family: var(--num-font) !important;
  font-variant-numeric: tabular-nums lining-nums;
  font-feature-settings: "tnum" 1, "lnum" 1;
  letter-spacing: var(--num-ls) !important;
  line-height: var(--num-lh);
}

/* 统计主值与倒计时：重一档，避免小字在低 DPI 屏上糊成灰雾 */
html body :is(.stat-num, .stage-n, .cdh-n, .fp-stat-value, .fp-cal-day b, .set-stat strong, .pc-count b, .pc-hl-ndur) {
  font-weight: var(--num-weight-strong);
}
html body .pc-num,
html body .ht-v,
html body .le-num,
html body .mono,
html body .pc-row-meta,
html body .tl-time,
html body .mwt-t {
  font-weight: var(--num-weight);
}
/* 40px 大数字不用 800：等宽字形本身笔画均匀，800 会糊成一团 */
html body .pc-hl-dur b { font-weight: 600; }

/* 手机端：数值不小于 12px；单位/说明仍是正文，只抬数字槽位 */
@media (max-width: 760px) {
  html[data-skin] body :is(
    .le-task-meta, .pc-row-meta, .pc-row-time.is-date i, .t-time,
    .fp-event-time small, .fp-bar-day, .fp-bar-value, .fp-dist-label, .fp-dist-value,
    .fp-travel-date, .fp-travel-main small, .fp-place-main small, .fp-place-mini-row small,
    .fp-heat-month, .fp-cal-day b,
    .pc-hl-meta, .pc-hl-foot, .pc-hl-legend b, .pc-hl-legend b span, .pc-hl-tlab,
    .pc-hl-row, .pc-hl-row .val, .pc-hl-ndate span, .pc-hl-nmeta, .pc-hl-nscore,
    .pc-hl-dur b small, .pc-hl-quiet, .pc-hl-kicker, .pc-hl-seg button, .pc-seg-btn .pc-num,
    .ht-v, .ac-plan-rows .mono, .fp-event-main small, .fp-related-main small, .fp-edit-row small,
    .fp-travel-main small, .fp-route-line, .le-task-meta, .mwt-gut span, .rhythm-hours
  ) {
    font-size: 12px !important;
    line-height: var(--num-lh);
  }
}

/* 桌面端：把 10–11px 的数值槽位抬到 12，图表刻度除外（见报告里的例外清单） */
@media (min-width: 761px) {
  html[data-visual] body :is(
    .cdh-c, .fp-event-time small, .fp-bar-value, .fp-bar-day, .fp-dist-label, .fp-dist-value,
    .fp-travel-date, .fp-travel-main small, .fp-event-main small, .fp-edit-row small, .fp-related-main small,
    .fp-place-main small, .fp-place-mini-row small, .fp-heat-month,
    .pc-hl-legend b, .pc-hl-legend b span, .pc-hl-tlab, .pc-hl-row .val,
    .pc-hl-ndate span, .pc-hl-nmeta, .pc-hl-nscore, .side-nav-count,
    .le-task-meta, .mono.muted, .mwt-gut span, .rhythm-hours
  ) {
    font-size: 12px !important;
  }
}
/* 日历/洞察刻度的 12px 覆盖放到文件末尾（见文末“数值槽位收口”），避免被后面的刻度令牌压回 11px */

/* ---------- 手机：角色阶梯 ---------- */
@media (max-width: 760px) {
  :root {
    --t-page: 24px;
    --t-sec: 17px;
    --t-body: 15px;
    --t-2nd: 13px;
    --t-label: 12px;
    --t-num: 22px;
  }

  /* 页标题：项目/习惯/目标/瞬间/回忆/洞察/设置/日历/足迹/便签/概览 全部同一档 */
  html[data-skin] body .page-title,
  html[data-skin] body .pc-me-title,
  html[data-skin] body .pc-rec-title,
  html[data-skin] body .pc-t-title,
  html[data-skin] body .m-cal-name,
  html[data-skin] body .fp-head-main h1,
  html[data-skin] body .nt-head-main h1,
  html[data-skin] body .le-pg-head h2 {
    font-size: var(--t-page) !important;
    line-height: var(--lh-title) !important;
    letter-spacing: -.02em !important;
    font-weight: 600 !important;
  }

  /* 区块标题：一号到底，次级不得与正文同号 */
  html[data-skin] body .pch-sec,
  html[data-skin] body .pc-sec-head h2,
  html[data-skin] body .dly-block-head h2,
  html[data-skin] body .le-card h3,
  html[data-skin] body .le-card-head h3,
  html[data-skin] body .set-title.eyebrow,
  html[data-skin] body .empty-title {
    font-size: var(--t-sec) !important;
    line-height: 1.35 !important;
    letter-spacing: -.01em;
  }

  /* 正文：说明、引言、空态正文一律 15，行高 ≥1.6 */
  html[data-skin] body .le-empty,
  html[data-skin] body .pc-echo q,
  html[data-skin] body .pc-echo p,
  html[data-skin] body .dly-echo p,
  html[data-skin] body .empty > div:not(.empty-title):not(.empty-actions),
  html[data-skin] body .set-note,
  html[data-skin] body .m-me-sub,
  html[data-skin] body .pc-hero-sub {
    font-size: var(--t-body) !important;
    line-height: var(--lh-body) !important;
  }

  /* 次级：页头说明、行内说明、图表注解 */
  html[data-skin] body .page-sub,
  html[data-skin] body .le-lead,
  html[data-skin] body .pc-rec-sub,
  html[data-skin] body .pc-t-sub,
  html[data-skin] body .pc-tile-lab,
  html[data-skin] body .goal-note,
  html[data-skin] body .in-basis,
  html[data-skin] body .le-hint {
    font-size: var(--t-2nd) !important;
    line-height: var(--lh-2nd) !important;
  }

  /* 标签：状态芯片、计数、行尾元信息，不低于 12 */
  html[data-skin] body .muted.small,
  html[data-skin] body .pc-tile-foot,
  html[data-skin] body .pc-me-meta,
  html[data-skin] body .pc-me-streak,
  html[data-skin] body .pc-me-foot,
  html[data-skin] body .pc-rec-cap,
  html[data-skin] body .pc-rec-kicker,
  html[data-skin] body .pc-t-cap,
  html[data-skin] body .set-state,
  html[data-skin] body .set-nav-label,
  html[data-skin] body .delta,
  html[data-skin] body .le-count,
  html[data-skin] body .fp-tab,
  html[data-skin] body .chip,
  html[data-skin] body .chip-btn,
  html[data-skin] body .m-chip-btn,
  html[data-skin] body .pc-echo-lab,
  html[data-skin] body .dly-echo-label {
    font-size: var(--t-label) !important;
    line-height: var(--lh-label) !important;
  }

  /* 数值：数据瓦的读数与统计数字 */
  html[data-skin] body .pc-tile-val,
  html[data-skin] body .stat-num,
  html[data-skin] body .pc-me-stat b,
  html[data-skin] body .le-kpi strong {
    font-size: var(--t-num) !important;
  }

  /* 轴刻度：日历星期/小时、心情条的星期字母——是刻度，不是标签 */
  html[data-skin] body .cdh-wd,
  html[data-skin] body .time-gutter span,
  html[data-skin] body .ms-day span,
  html[data-skin] body .le-chart-col small,
  html[data-skin] body .mb span,
  html[data-skin] body .rhythm-days,
  html[data-skin] body .rhythm-hours,
  html[data-skin] body .hm-days {
    font-size: var(--t-tick) !important;
  }
  /* 日期带的星期是标签，不是刻度；日历列头也按标签走 */
  html[data-skin] body .dly-date span,
  html[data-skin] body .pc-date span { font-size: var(--t-label) !important; }
  html[data-skin] body .cdh-wd { font-size: var(--t-label) !important; }
  html[data-skin] body .pc-link { font-size: var(--t-label) !important; }
  /* 日历左上角的视图角标：9px 提到标签号，颜色收回到正文次级，保证 4.5 以上 */
  html[data-skin] body .m-cal-cycle span {
    font-size: var(--t-label) !important;
    line-height: var(--lh-label) !important;
    color: var(--ink) !important;
  }
  /* 日历周条的星期是标签，不是轴刻度 */
  html[data-skin] body .mwd-w,
  html[data-skin] body .mwt-day span {
    font-size: var(--t-label) !important;
    line-height: var(--lh-label) !important;
  }
  html[data-skin] body .pc-echo a,
  html[data-skin] body .dly-echo a,
  html[data-skin] body .fr-echo a { font-size: var(--t-label) !important; }

  /* 触控：独立控件不小于 44；日历格与页内文字链保持原密度 */
  html[data-skin] body .btn,
  html[data-skin] body .chip,
  html[data-skin] body .chip-btn,
  html[data-skin] body .m-chip-btn,
  html[data-skin] body .pc-seg-btn,
  html[data-skin] body .fp-tab,
  html[data-skin] body .dly-round,
  html[data-skin] body .pc-orb,
  html[data-skin] body .seg button,
  html[data-skin] body .m-icon-btn {
    min-height: 44px;
  }
  html[data-skin] body .m-icon-btn { min-width: 44px; }
  /* 助理顶栏与输入区的图标键、睡眠/足迹返回键：补齐到 44 的点击区 */
  html[data-skin] body .ac-picker,
  html[data-skin] body .ac-input,
  html[data-skin] body .ac-icobtn,
  html[data-skin] body .ac-add,
  html[data-skin] body .ac-mic,
  html[data-skin] body .ac-send,
  html[data-skin] body .pc-hl-back,
  html[data-skin] body .pc-hl-btn,
  html[data-skin] body .fp-back,
  html[data-skin] body .fp-settings-link,
  html[data-skin] body .m-me-edit,
  html[data-skin] body .nt-search-input {
    min-height: 44px;
  }
  html[data-skin] body .ac-icobtn,
  html[data-skin] body .ac-add,
  html[data-skin] body .ac-mic,
  html[data-skin] body .ac-send,
  html[data-skin] body .fp-tab,
  html[data-skin] body .pc-hl-back,
  html[data-skin] body .fp-settings-link,
  html[data-skin] body .m-me-edit {
    min-width: 44px;
  }

  /* 生活板的砖标签与计数、我的芯片：统一到 12 */
  html[data-skin] body .pc-me-sq span,
  html[data-skin] body .pc-me-sq b.pc-num,
  html[data-skin] body .pc-me-id b i,
  html[data-skin] body .pc-me-bstat small,
  html[data-skin] body .pc-me-foot,
  html[data-skin] body .le-legend * { font-size: 12px !important; }

  /* 睡眠面板的一句解释按次级正文走 */
  html[data-skin] body .pc-hl-panel p {
    font-size: var(--t-2nd) !important;
    line-height: var(--lh-body) !important;
  }

  /* 任务筛选芯片 */
  html[data-skin] body .pc-chip { min-height: 44px; }
  html[data-skin] body .pc-filter-lab { font-size: var(--t-label) !important; }
  html[data-skin] body .pc-orb { min-width: 44px; }

  /* Dock 标签：底部五键的文字与其它标签同号 */
  html[data-skin] body .m-tab { font-size: 12px !important; }

  /* 页头与卡片左缘对齐：去掉页头那 2px 光学内缩 */
  .page-head { padding-left: 0; padding-right: 0; }

  /* 概览页（le-*）在手机上沿用同一套角色 */
  html[data-skin] body .le-kpi span,
  html[data-skin] body .le-kpi small { font-size: var(--t-label) !important; }
  html[data-skin] body .le-link { font-size: var(--t-2nd) !important; }
  html[data-skin] body .le-chart-col small { color: var(--ink-3); }

  /* 收件箱的「理清的方法」：把标签与动作并回一行，四步各占一行 */
  html[data-skin] body .le-steps-list li b { display: inline; margin-right: 2px; }
  /* 睡眠空态去掉 kicker/meta 后，标题与面板之间只留一段呼吸 */
  html[data-skin] body .pc-hl-head { gap: 6px; }

  /* 满数据：收件箱行内两侧并排——标题在左，动作靠右，不再整块换行堆高 */
  html[data-skin] body .le-line-item { flex-wrap: nowrap; align-items: center; }
  html[data-skin] body .le-line-actions { width: auto; }
  html[data-skin] body .le-icon-btn { width: 44px; height: 44px; }
  html[data-skin] body .le-link {
    display: inline-flex;
    align-items: center;
    gap: 4px;
    min-height: 44px;
  }
  /* 习惯副标题一行截断，避免「天完成率」被折到第三行 */
  html[data-skin] body .ht-name .muted.small { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
  /* 今日页的领域标签：提到 12 并压深 */
  html[data-skin] body .pc-area {
    font-size: var(--t-label) !important;
    color: color-mix(in srgb, var(--pc-area, var(--ink-2)) 30%, var(--ink)) !important;
  }
  /* 睡眠芯片与分段键：同样提到 12 并压深，点击区补到 44 */
  html[data-skin] body .pc-hl-chip { font-size: var(--t-label) !important; }
  html[data-skin] body .pc-hl-chip.is-warm {
    color: color-mix(in srgb, var(--pc-warm) 55%, var(--ink)) !important;
  }
  html[data-skin] body .pc-hl-seg button { min-height: 44px; min-width: 44px; }
  /* 「退出登录」不再是浅红 */
  html[data-skin] body .m-me-logout {
    color: color-mix(in srgb, var(--urgent) 68%, var(--ink)) !important;
  }
  /* 足迹页的日期/翻页/编辑控件补到 44；日历格与热力格是数据网格，尺寸保持 */
  html[data-skin] body .fp-arrow { width: 44px; height: 44px; }
  html[data-skin] body .fp-today,
  html[data-skin] body .fp-date-input { min-height: 44px; }
  html[data-skin] body .fp-event-edit { width: 44px; height: 44px; }
  html[data-skin] body .fp-field input,
  html[data-skin] body .fp-field select,
  html[data-skin] body .fp-seg-btn { min-height: 44px; }
  html[data-skin] body .fp-cal-day b { font-size: 12px !important; }
  html[data-skin] body .fp-event-main small,
  html[data-skin] body .fp-set-row small { font-size: 12px !important; }
}

/* ---------- 桌面：角色阶梯 ---------- */
@media (min-width: 761px) {
  /* 顶栏标题保持 18；页内标题统一 22 */
  html[data-visual] body .page-title,
  html[data-visual] body .fp-head-main h1 {
    font-size: var(--t-page) !important;
    line-height: var(--lh-title) !important;
    letter-spacing: -.02em !important;
  }
  html[data-visual] body .eyebrow,
  html[data-visual] body .le-card h3,
  html[data-visual] body .le-card-head h3 {
    font-size: var(--t-sec) !important;
    line-height: 1.35 !important;
  }
  html[data-visual] body .stat-label,
  html[data-visual] body .stage-l,
  html[data-visual] body .delta,
  html[data-visual] body .set-state,
  html[data-visual] body .set-nav-label,
  html[data-visual] body .cdh-wd,
  html[data-visual] body .le-kpi span,
  html[data-visual] body .le-kpi small,
  html[data-visual] body .le-hint,
  html[data-visual] body .fp-head-main p {
    font-size: var(--t-label) !important;
    line-height: var(--lh-label) !important;
  }
  html[data-visual] body .le-kpi strong,
  html[data-visual] body .pc-tile-val { font-size: var(--t-num) !important; }
  html[data-visual] body .le-lead,
  html[data-visual] body .page-sub { font-size: var(--t-2nd) !important; }
  html[data-visual] body .le-legend * { font-size: var(--t-label) !important; }
  html[data-visual] body .ms-day span,
  html[data-visual] body .time-gutter span,
  html[data-visual] body .mb span,
  html[data-visual] body .rhythm-days,
  html[data-visual] body .rhythm-hours,
  html[data-visual] body .hm-days { font-size: var(--t-tick) !important; }
  html[data-visual] body .cal-corner { font-size: var(--t-label) !important; }
  html[data-visual] body .side-group-label { font-size: var(--t-label) !important; }
  /* 桌面信息密集区里残存的 10.5/11.5 标签，一并提到 12 */
  html[data-visual] body .today-hero .th-kicker,
  html[data-visual] body .today-hero .th-num-label,
  html[data-visual] body .focus-card .fc-num,
  html[data-visual] body .focus-card .ftime,
  html[data-visual] body .task-row .t-dur,
  html[data-visual] body .task-row .t-time,
  html[data-visual] body .task-row .mono,
  html[data-visual] body .today-echo .eyebrow,
  html[data-visual] body .cal-chip,
  html[data-visual] body .upcoming .eyebrow,
  html[data-visual] body .tl-block .tl-time,
  html[data-visual] body .tl-block .tl-meta { font-size: var(--t-label) !important; }
  /* 设置/个人页的状态词：botanical-pages 以更高优先级写死了亮色 */
  html[data-visual] body :is(.page-settings, .page-profile) .set-state[data-tone="ok"] { color: color-mix(in srgb, var(--done) 62%, var(--ink)) !important; }
  html[data-visual] body :is(.page-settings, .page-profile) .set-state[data-tone="err"] { color: color-mix(in srgb, var(--urgent) 76%, var(--ink)) !important; }
  html[data-visual] body :is(.page-settings, .page-profile) .set-state[data-tone="warn"] { color: color-mix(in srgb, var(--orange) 70%, var(--ink)) !important; }
  html[data-visual] body :is(.page-settings, .page-profile) .set-state[data-tone="busy"] { color: color-mix(in srgb, var(--bt-accent, var(--ink-2)) 55%, var(--ink)) !important; }
  /* 足迹月度格的数字：桌面同样回到正文墨色，最深一档反白 */
  html[data-visual] body .fp-cal-day { color: var(--ink) !important; }
  html[data-visual] body .fp-cal-day.is-l4 { color: var(--accent-fg) !important; }
}

/* ---------- 数值槽位收口：时间轴/小时刻度也按数值走，不留在 10–11px ---------- */
@media (max-width: 760px) {
  html[data-skin] body .m-cal .mwt-grid .time-gutter span,
  html[data-skin] body .m-cal .m-tl-card .time-gutter span,
  html[data-skin] body .rhythm-hours,
  html[data-skin] body .rhythm-hours span,
  html[data-skin] body .rhythm-axis span,
  html[data-skin] body .hour-bars .hb span { font-size: 12px !important; }
}
@media (min-width: 761px) {
  html[data-visual] body .time-gutter span,
  html[data-visual] body .rhythm-hours,
  html[data-visual] body .rhythm-hours span,
  html[data-visual] body .rhythm-axis span,
  html[data-visual] body .hour-bars .hb span { font-size: 12px !important; }
  html[data-visual] body .tl-block small,
  html[data-visual] body .ht-name small,
  html[data-visual] body .dly-hero-date { font-size: 12px !important; }
}
