﻿/* Day in · M1 样式（延续原型视觉：白→浅绿底、毛玻璃卡片、绿色深影、苹果字体栈） */
:root {
  --accent: #2f7d5b;
  --accent2: #67b495;
  --ink: #1c2b25;
  --muted: #8aa39a;
  --fill: #f1f5f2;
  --rule: #e3ece7;
  --bg: #f6faf7;
  --shadow: 10px 12px 26px rgba(32, 67, 57, .16);
}

* { box-sizing: border-box; margin: 0; padding: 0; -webkit-tap-highlight-color: transparent; }
/* body 不能钉死 height:100%——内容溢出会越过 padding-bottom，滚到底最后一张卡仍被导航栏盖住；靠下方 min-height:100dvh 兜底短页面 */
html { height: 100%; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Microsoft YaHei", sans-serif;
  color: var(--ink);
  background: #f6faf7;
  min-height: 100dvh;
  padding: calc(14px + env(safe-area-inset-top)) 16px calc(150px + env(safe-area-inset-bottom));
  font-size: 14px;
  line-height: 1.6;
}
/* 背景渐变固定铺满视口：所有页面/任意滚动位置同一深浅，不随内容高度变化 */
body::before {
  content: ''; position: fixed; inset: 0; z-index: -1;
  background: linear-gradient(180deg, #fff 0%, var(--bg) 55%, #edf6f0 100%);
}
/* 底部渐隐留白：内容滚过导航栏时柔和过渡（半透明，透出内容让毛玻璃生效） */
body::after {
  content: ''; position: fixed; left: 0; right: 0; bottom: 0;
  height: 96px; pointer-events: none; z-index: 45;
  background: linear-gradient(180deg, rgba(246, 250, 247, 0) 0%, rgba(246, 250, 247, .45) 55%, rgba(246, 250, 247, .72) 100%);
}

.page { display: none; max-width: 480px; margin: 0 auto; flex-direction: column; gap: 12px; }
.page.on { display: flex; animation: pagein .18s ease; }
@keyframes pagein { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 通用图标（手绘线条风） ---------- */
.ic { width: 20px; height: 20px; fill: none; stroke: currentColor; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; flex: none; }
.eye { fill: currentColor; stroke: none; }

/* ---------- 今日页头部 ---------- */
.today-head { display: flex; align-items: center; gap: 8px; padding: 2px 2px 0; }
.hspace { flex: 1; }
.ptitle { font-size: 21px; font-weight: 800; letter-spacing: .2px; }
.datecap {
  display: flex; align-items: center; gap: 5px; font-family: inherit;
  background: rgba(255, 255, 255, .8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--rule); border-radius: 14px; padding: 8px 12px;
  box-shadow: 6px 8px 18px -8px rgba(32, 67, 57, .28);
  transition: transform .18s ease;
  white-space: nowrap;
}
.datecap:active { transform: scale(.96); }
.chip {
  display: inline-flex; align-items: center; justify-content: center; gap: 4px; font-family: inherit;
  font-size: 12px; font-weight: 700; color: var(--accent);
  background: rgba(255, 255, 255, .8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--rule); border-radius: 99px; padding: 8px 12px;
  box-shadow: 4px 6px 14px -8px rgba(32, 67, 57, .28);
  transition: transform .18s ease, background .18s ease, color .18s ease;
  white-space: nowrap;
}
/* 连续天数：纯展示，无框无阴影不可点 */
.streakplain {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: 11px; font-weight: 700; color: var(--muted);
  white-space: nowrap;
}
.streakplain svg { width: 14px; height: 14px; }
.chip:active { transform: scale(.93); }
.chip.on { background: var(--accent); color: #fff; border-color: var(--accent); }
.chip.gold { color: #a4762e; }
.chip .ic { width: 14px; height: 14px; }
.icobtn {
  width: 38px; height: 38px; border-radius: 12px; flex: none;
  display: flex; align-items: center; justify-content: center; font-family: inherit;
  background: rgba(255, 255, 255, .8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--rule); color: var(--ink);
  box-shadow: 4px 6px 14px -8px rgba(32, 67, 57, .28);
  transition: transform .18s ease;
}
.icobtn:active { transform: scale(.92); }

/* ---------- 卡片 ---------- */
.card {
  background: rgba(255, 255, 255, .8);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--rule); border-radius: 18px;
  box-shadow: var(--shadow); padding: 15px 16px;
}
.card h2 { font-size: 14.5px; font-weight: 700; display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.card h2 .mini { margin-left: auto; }
.card h2 .chip { margin-left: auto; padding: 4px 10px; font-size: 11.5px; }
.tip { font-size: 11.5px; color: var(--muted); margin-bottom: 10px; }

.badge {
  font-size: 10.5px; font-weight: 600; color: var(--muted);
  background: var(--fill); border-radius: 99px; padding: 1px 8px;
}
.badge.on { color: #fff; background: var(--accent); }

/* 状态行 */
.rows { display: flex; flex-direction: column; }
.row { display: flex; justify-content: space-between; gap: 10px; padding: 6.5px 0; font-size: 12.5px; border-bottom: 1px dashed var(--rule); }
.row:last-child { border-bottom: none; }
.row span { color: var(--muted); }
.row b { font-weight: 600; text-align: right; }

/* ---------- 心情卡 ---------- */
.moodcard { padding: 12px 14px 14px; }
.mood5 { display: flex; justify-content: space-between; gap: 4px; }
.mood-btn {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  background: none; color: var(--muted); font-size: 10.5px; font-weight: 600;
  padding: 7px 0 5px; border-radius: 12px;
  transition: color .18s ease, background .18s ease, transform .18s ease;
}
.mood-btn .ic { width: 30px; height: 30px; stroke-width: 1.6; }
.mood-btn.on { color: var(--accent); background: var(--fill); transform: scale(1.05); }
.mood-btn:active { transform: scale(.94); }
.moodrow { display: flex; align-items: flex-end; gap: 8px; margin-top: 9px; }
.moodrow .chip { flex: none; padding: 7px 14px; }
.mood-input {
  flex: 1; min-width: 0; display: block;
  border: none; outline: none; resize: none; overflow: hidden;
  background: rgba(241, 245, 242, .75); border-radius: 10px; padding: 8px 12px;
  font-size: 12.5px; font-family: inherit; color: var(--ink); line-height: 1.6;
  min-height: 37px;
}

/* ---------- 分类待办 ---------- */
.cgroup { margin-bottom: 2px; }
.cat-h { display: flex; align-items: center; margin: 8px 0 2px; }
.cgroup:first-child .cat-h { margin-top: 2px; }
.cat-h b { font-size: 13px; font-weight: 700; }
.plus {
  margin-left: auto; width: 30px; height: 30px; border-radius: 10px; flex: none;
  color: var(--accent); background: var(--fill);
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s ease;
}
.plus:active { transform: scale(.9); }
.plus .ic { width: 16px; height: 16px; }
.todo {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  padding: 8px 2px; border-bottom: 1px dashed var(--rule); font-size: 13px;
}
.cgroup .todo:last-child { border-bottom: none; }
.tcheck {
  width: 21px; height: 21px; flex: none; border-radius: 50%;
  border: 2px solid #b9cfc5; background: transparent; position: relative;
  transition: background .18s ease, border-color .18s ease;
}
.todo.done .tcheck { background: var(--accent); border-color: var(--accent); }
.todo.done .tcheck::after {
  content: ''; position: absolute; left: 5.5px; top: 2px;
  width: 5px; height: 9px; border: solid #fff; border-width: 0 2px 2px 0;
  transform: rotate(42deg);
}
.tname { font-weight: 600; }
.todo.done .tname { color: var(--muted); text-decoration: line-through; }
.amount { font-size: 11px; font-weight: 700; color: #a4762e; background: #f7efdd; padding: 1px 7px; border-radius: 99px; }
.twhen { font-size: 10.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; background: var(--fill); padding: 1.5px 7px; border-radius: 99px; }
.tagchip { font-size: 10px; font-weight: 600; color: var(--accent); background: var(--fill); padding: 1.5px 8px; border-radius: 99px; }
.tagchip.rep { color: var(--muted); background: #edf3ef; }
.tnote { flex-basis: 100%; padding-left: 31px; font-size: 11px; color: var(--muted); }

/* ---------- 日记卡 ---------- */
.dhead { display: flex; align-items: center; gap: 8px; margin-bottom: 6px; }
.dot { width: 9px; height: 9px; border-radius: 50%; background: var(--accent); box-shadow: 0 0 0 3px rgba(103, 180, 149, .25); }
.dtime { font-size: 11px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.pen {
  margin-left: auto; width: 32px; height: 32px; border-radius: 10px; flex: none;
  color: var(--accent); background: var(--fill);
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s ease;
}
.pen:active { transform: scale(.9); }
.pen .ic { width: 16px; height: 16px; }

/* ---------- M5 今日时间轴 ---------- */
.tl { position: relative; }
.tl::before { content: ''; position: absolute; left: 54px; top: 16px; bottom: 16px; width: 2px; border-radius: 2px; background: var(--rule); }
.tl-node { position: relative; display: grid; grid-template-columns: 38px 14px 1fr; column-gap: 10px; padding: 8px 0; align-items: start; cursor: pointer; }
.tl-time { font-size: 10.5px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; text-align: right; padding-top: 3px; white-space: nowrap; }
.tl-dot {
  width: 13px; height: 13px; border-radius: 50%; background: var(--accent);
  box-shadow: 0 0 0 3px #fff; margin-top: 3px; justify-self: center;
  display: flex; align-items: center; justify-content: center; position: relative; z-index: 1;
}
.tl-dot svg { display: none; }
.tl-dot.done svg { display: block; width: 9px; height: 9px; fill: none; stroke: #fff; stroke-width: 3; stroke-linecap: round; stroke-linejoin: round; }
.tl-dot.hollow { background: #fff; border: 2px solid var(--accent2); }
.tl-main { min-width: 0; font-size: 13px; line-height: 1.65; position: relative; }
.tl-txt { white-space: pre-wrap; word-break: break-word; }
.tl-txt.b { font-weight: 700; font-size: 13.5px; }
.tl-txt.done { color: var(--muted); text-decoration: line-through; }
.tl-sub { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.tl-img { width: 60px; height: 60px; border-radius: 12px; object-fit: cover; display: block; margin-top: 6px; border: 1px solid var(--rule); }
.tl-chips { display: flex; flex-wrap: wrap; gap: 5px; margin-top: 5px; }
.tl-chips:empty { display: none; }
.tl-rate { display: inline-flex; align-items: center; gap: 2px; font-size: 10.5px; font-weight: 700; color: #a4762e; background: #f7efdd; padding: 1.5px 7px; border-radius: 99px; }
.tl-rate svg { width: 11px; height: 11px; fill: #d9a441; stroke: none; }
.tl-mood { display: inline-flex; vertical-align: -3px; margin-right: 5px; }
.tl-mood .ic { width: 17px; height: 17px; }
.tl-sticker { position: absolute; top: -8px; right: 2px; width: 46px; height: 46px; transform: rotate(9deg); filter: drop-shadow(0 2px 3px rgba(32, 67, 57, .18)); pointer-events: none; }
.tl-sticker svg { width: 100%; height: 100%; }
.tl-nowline { display: flex; align-items: center; gap: 8px; padding: 7px 0 7px 40px; }
.tl-now {
  font-size: 10.5px; font-weight: 700; color: #fff; background: var(--ink);
  border-radius: 99px; padding: 3.5px 10px; letter-spacing: .3px; white-space: nowrap;
  box-shadow: 0 2px 6px rgba(28, 43, 37, .3); position: relative; z-index: 1;
}
.tl-nowline::after { content: ''; flex: 1; height: 2px; border-radius: 2px; background: var(--ink); opacity: .16; }
.tl-empty { font-size: 12px; color: var(--muted); padding: 4px 0 2px; }

/* ---------- M5 贴纸选择 ---------- */
.stkrow { display: flex; flex-wrap: wrap; gap: 8px; margin-bottom: 12px; }
.stk {
  width: 46px; height: 46px; border-radius: 13px; border: 1.5px solid var(--rule); background: #fff;
  display: flex; align-items: center; justify-content: center; font-family: inherit;
  font-size: 11px; font-weight: 600; color: var(--muted);
  transition: transform .18s ease, border-color .18s ease, background .18s ease;
}
.stk svg { width: 30px; height: 30px; }
.stk:active { transform: scale(.9); }
.stk.on { border-color: var(--accent); background: var(--fill); }

/* ---------- 表单 ---------- */
textarea, .addrow input {
  width: 100%; border: 1.5px solid var(--rule); border-radius: 12px;
  background: rgba(255, 255, 255, .75); color: var(--ink);
  padding: 10px 12px; font-size: 13.5px; font-family: inherit;
  outline: none; transition: border-color .18s ease, box-shadow .18s ease;
}
textarea:focus, .addrow input:focus, .ename:focus, .fcol input:focus {
  border-color: var(--accent2); box-shadow: 0 0 0 3px rgba(103, 180, 149, .18);
}
textarea { resize: vertical; min-height: 84px; line-height: 1.7; }
.addrow { display: flex; gap: 8px; margin-bottom: 8px; }
.addrow input { flex: 1; min-width: 0; }
.ename {
  width: 100%; border: 1.5px solid var(--rule); border-radius: 12px;
  background: rgba(255, 255, 255, .75); color: var(--ink);
  padding: 10px 12px; font-size: 13.5px; font-family: inherit;
  outline: none; margin-bottom: 8px;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.frow { display: flex; gap: 10px; margin-bottom: 8px; }
.fcol { flex: 1; display: flex; flex-direction: column; gap: 4px; font-size: 11px; color: var(--muted); font-weight: 600; }
.fcol input {
  border: 1.5px solid var(--rule); border-radius: 10px; background: rgba(255, 255, 255, .75);
  padding: 8px 10px; font-size: 12.5px; font-family: inherit; color: var(--ink); outline: none;
  transition: border-color .18s ease, box-shadow .18s ease;
}
.flabel { font-size: 11px; color: var(--muted); font-weight: 600; margin: 2px 0 6px; }
.seg { display: flex; background: var(--fill); border-radius: 12px; padding: 3px; gap: 2px; margin-bottom: 8px; }
.seg button {
  flex: 1; border-radius: 9px; padding: 7px 2px; font-family: inherit;
  font-size: 12px; font-weight: 700; color: var(--muted); background: none;
  transition: color .18s ease, background .18s ease, box-shadow .18s ease;
}
.seg button.on { background: #fff; color: var(--accent); box-shadow: 0 2px 6px rgba(32, 67, 57, .12); }
.fchips { display: flex; flex-wrap: wrap; gap: 6px; margin-bottom: 8px; }
.fchips:empty { display: none; }
.fchip {
  font-size: 11.5px; font-weight: 600; font-family: inherit; color: var(--muted);
  background: var(--fill); border: 1px solid transparent; border-radius: 99px; padding: 5px 12px;
  transition: color .18s ease, background .18s ease, border-color .18s ease, transform .18s ease;
}
.fchip:active { transform: scale(.93); }
.fchip.on { color: var(--accent); background: #fff; border-color: var(--accent2); }

/* ---------- 按钮 ---------- */
button { font-family: inherit; cursor: pointer; border: none; }
.primary {
  background: linear-gradient(160deg, var(--accent2), var(--accent)); color: #fff;
  border-radius: 12px; padding: 10px 16px; font-size: 13px; font-weight: 700; flex: none;
  box-shadow: 4px 6px 14px -4px rgba(32, 67, 57, .45);
  transition: transform .18s ease, opacity .18s ease;
}
.primary:active { transform: scale(.95); }
.primary.wide { width: 100%; margin-top: 6px; padding: 12px; font-size: 14px; }
.mini {
  background: var(--fill); color: var(--accent); border-radius: 99px;
  padding: 4px 12px; font-size: 11.5px; font-weight: 700; flex: none;
  transition: transform .18s ease, opacity .18s ease;
}
.mini:active { transform: scale(.92); }
.btns { display: grid; grid-template-columns: 1fr 1fr; gap: 8px; margin-top: 12px; }
.btns button {
  border: 1.5px solid var(--rule); background: rgba(255, 255, 255, .7); color: var(--ink);
  border-radius: 12px; padding: 10px 8px; font-size: 12.5px; font-weight: 600;
  transition: transform .18s ease, border-color .18s ease;
}
.btns button:active { transform: scale(.96); }
.btns button:hover { border-color: var(--accent2); }
.btns .danger { color: #b44d3e; border-color: #ecd5cf; }
.btns .primary { grid-column: 1 / -1; }
.btns .danger:not([hidden]) + .primary { grid-column: auto; }
#wipeBtn { grid-column: 1 / -1; }

/* 列表 */
.list { list-style: none; display: flex; flex-direction: column; }
.list li {
  display: flex; align-items: center; gap: 8px;
  padding: 8px 0; font-size: 12.5px; border-bottom: 1px dashed var(--rule);
}
.list li:last-child { border-bottom: none; }
.list .t { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-weight: 600; }
.list em { font-style: normal; font-size: 10.5px; color: var(--muted); flex: none; }
.list li.empty { color: var(--muted); font-weight: 400; justify-content: center; }

/* ---------- 底部导航：毛玻璃浮动胶囊 + 中央＋ ---------- */
.tabbar {
  position: fixed; left: 50%; transform: translateX(-50%);
  bottom: calc(14px + env(safe-area-inset-bottom)); z-index: 50;
  display: flex; align-items: center;
  background: rgba(255, 255, 255, .55); backdrop-filter: blur(18px) saturate(1.5); -webkit-backdrop-filter: blur(18px) saturate(1.5);
  border: 1px solid var(--rule); border-radius: 99px; padding: 6px 10px;
  box-shadow: 10px 12px 26px rgba(32, 67, 57, .32);
}
.tab {
  display: flex; flex-direction: column; align-items: center; gap: 2px;
  width: 54px; padding: 6px 0; border-radius: 16px;
  background: none; color: var(--muted); font-size: 10.5px; font-weight: 700;
  transition: color .18s ease, transform .18s ease;
}
.tab .ic { width: 21px; height: 21px; }
.tab.on { color: var(--accent); }
.tab:active { transform: scale(.93); }
.tab-gap { width: 62px; flex: none; }
.fab {
  position: absolute; left: 50%; top: 50%; transform: translate(-50%, -50%);
  width: 60px; height: 60px; border-radius: 50%;
  /* 白色毛玻璃底 + 绿色加号：全局只留页面内绿实心按钮一个重点，FAB 不再抢视觉 */
  background: rgba(255, 255, 255, .92);
  backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--rule); color: var(--accent);
  display: flex; align-items: center; justify-content: center;
  box-shadow: 0 6px 16px -6px rgba(32, 67, 57, .3);
  transition: transform .18s ease;
}
.fab:active { transform: translate(-50%, -50%) scale(.92); }
.fab .ic { width: 26px; height: 26px; stroke-width: 2.2; }

/* ---------- 弹层 ---------- */
#mask {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(20, 32, 27, .35);
  opacity: 0; transition: opacity .2s ease;
}
#mask.on { opacity: 1; }
.sheet {
  position: fixed; left: 50%; bottom: 0; transform: translate(-50%, 105%);
  width: 100%; max-width: 480px; z-index: 70;
  background: rgba(255, 255, 255, .92); backdrop-filter: blur(18px); -webkit-backdrop-filter: blur(18px);
  border: 1px solid var(--rule); border-bottom: none;
  border-radius: 22px 22px 0 0;
  box-shadow: 0 -10px 30px rgba(32, 67, 57, .18);
  padding: 8px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 84dvh; overflow-y: auto;
  transition: transform .22s ease;
}
.sheet.on { transform: translate(-50%, 0); }
.grab { display: flex; justify-content: center; padding: 5px 0 8px; }
.grab i { width: 38px; height: 4px; border-radius: 99px; background: #d4e2da; }
.sh-head { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.sh-head b { font-size: 16px; font-weight: 800; flex: 1; }
.shclose { width: 32px; height: 32px; border-radius: 10px; box-shadow: none; }
.shclose .ic { width: 16px; height: 16px; }

/* ---------- 日历面板 ---------- */
.cal-week { display: grid; grid-template-columns: repeat(7, 1fr); text-align: center; font-size: 11px; color: var(--muted); font-weight: 600; margin-bottom: 4px; }
.cal-grid { display: grid; grid-template-columns: repeat(7, 1fr); gap: 4px; }
.cal-cell {
  aspect-ratio: 1; border-radius: 11px; font-family: inherit;
  font-size: 12.5px; font-weight: 600; color: var(--ink); background: var(--fill);
  font-variant-numeric: tabular-nums;
  transition: transform .18s ease;
}
.cal-cell:active { transform: scale(.9); }
.cal-cell.h1 { background: #e3f1e9; }
.cal-cell.h2 { background: #c6e4d4; }
.cal-cell.h3 { background: #9fd0ba; }
.cal-cell.h4 { background: var(--accent); color: #fff; }
.cal-cell.today { box-shadow: inset 0 0 0 2px var(--accent); }
.cal-cell.sel { box-shadow: inset 0 0 0 2px var(--ink); }
.cal-legend { display: flex; align-items: center; gap: 6px; justify-content: center; font-size: 10.5px; color: var(--muted); margin-top: 12px; }
.lg { width: 12px; height: 12px; border-radius: 4px; display: inline-block; }
.lg-today { box-shadow: inset 0 0 0 2px var(--accent); background: #fff; }
.lg-h { background: linear-gradient(90deg, #e3f1e9, #9fd0ba); }

/* ---------- 搜索 ---------- */
.slist { margin-top: 4px; max-height: 40dvh; overflow-y: auto; }
.srow { display: flex; flex-direction: column; gap: 1px; padding: 9px 4px; border-bottom: 1px dashed var(--rule); border-radius: 8px; }
.srow:active { background: var(--fill); }
.srow .st { font-size: 13px; font-weight: 600; }
.srow em { font-style: normal; font-size: 10.5px; color: var(--muted); }
.sempty { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 0; }

/* ---------- 自检结果 ---------- */
#selftest .st { font-size: 12px; padding: 5px 0; border-bottom: 1px dashed var(--rule); font-variant-numeric: tabular-nums; }
#selftest .st.pass { color: var(--accent); }
#selftest .st.fail { color: #b44d3e; font-weight: 700; }
#selftest .stsum { margin-top: 10px; font-weight: 800; font-size: 13px; color: var(--accent); }

.foot { text-align: center; font-size: 10.5px; color: var(--muted); letter-spacing: .4px; }

/* toast */
#toast {
  position: fixed; left: 50%; bottom: calc(96px + env(safe-area-inset-bottom));
  transform: translate(-50%, 16px);
  background: rgba(28, 43, 37, .92); color: #fff;
  font-size: 12.5px; padding: 9px 18px; border-radius: 99px;
  opacity: 0; pointer-events: none;
  transition: opacity .2s ease, transform .2s ease;
  max-width: 82vw; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
  z-index: 99;
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }

/* ---------- M2 习惯打卡 ---------- */
#habitList { display: flex; flex-direction: column; gap: 12px; }
.hcard { display: flex; gap: 12px; align-items: flex-start; }
.hcard.done { border-color: rgba(103, 180, 149, .6); }
.hcard.pop { animation: hpop .22s ease; }
@keyframes hpop { from { transform: scale(.97); } to { transform: none; } }
.hicon {
  width: 44px; height: 44px; border: none; border-radius: 14px; flex: none;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: var(--hc, var(--accent));
  box-shadow: 4px 6px 14px -8px rgba(32, 67, 57, .4);
  transition: transform .18s ease;
}
.hicon:active { transform: scale(.92); }
.hicon .ic { width: 22px; height: 22px; }
.hmain { flex: 1; min-width: 0; }
.htop { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.htop b { font-size: 14.5px; font-weight: 700; }
.hstreak { font-size: 10px; font-weight: 700; color: #a4762e; background: #f7efdd; padding: 1px 8px; border-radius: 99px; }
.hnum { font-size: 11.5px; color: var(--muted); margin-top: 1px; }
.hnum button {
  font: inherit; color: var(--accent); font-weight: 700;
  border: none; background: none; padding: 0;
  font-variant-numeric: tabular-nums;
}
.hviz { display: flex; align-items: center; gap: 10px; margin-top: 8px; }
.hacts { display: flex; flex-direction: column; align-items: center; gap: 6px; flex: none; }
.hplus {
  width: 40px; height: 40px; border-radius: 50%; border: none; flex: none;
  background: var(--hc, var(--accent)); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 4px 6px 14px -8px rgba(32, 67, 57, .4);
  transition: transform .18s ease;
}
.hplus:active { transform: scale(.88); }
.hplus .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.hlink {
  width: 28px; height: 28px; border-radius: 9px; border: 1px solid var(--rule); flex: none;
  background: rgba(255, 255, 255, .6); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  transition: transform .18s ease;
}
.hlink:active { transform: scale(.9); }
.hlink .ic { width: 14px; height: 14px; }

/* 水杯：3 段波浪波面（默认静止，打卡时加 .waving 慢速漂移；三层错峰模拟浪涌） */
/* 注册 --lv 为可动画数值：打卡后水位平滑上涌（不支持的浏览器降级为瞬跳，无害） */
@property --lv { syntax: '<number>'; inherits: true; initial-value: 0; }
.water {
  position: relative; width: 46px; height: 60px; flex: none; overflow: hidden;
  border: 2px solid rgba(103, 180, 149, .55); border-radius: 8px 8px 14px 14px;
  background: rgba(255, 255, 255, .55);
  transition: --lv .65s cubic-bezier(.3, 1.15, .55, 1);
}
.water .wv {
  position: absolute; top: calc(100% - var(--lv, 0) * 100%); bottom: -2px;
  left: 0; width: 100%;
  background: rgba(103, 180, 149, .34);
  background: color-mix(in srgb, var(--hc, #67b495) 34%, transparent);
}
/* 真波浪线：SVG 波形 mask 叠在水体顶边（旧版半圆凸起在窄杯里像一排圆点，已弃用），平移一个波长无缝循环 */
.water .wv::after {
  content: ''; position: absolute; left: -23px; right: -23px; top: -12px; height: 14px;
  background: inherit;
  -webkit-mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 23 14'%3E%3Cpath d='M0 7 Q5.75 3 11.5 7 Q17.25 11 23 7 V14 H0 Z' fill='%23000'/%3E%3C/svg%3E") repeat-x center / 23px 14px;
  mask: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' viewBox='0 0 23 14'%3E%3Cpath d='M0 7 Q5.75 3 11.5 7 Q17.25 11 23 7 V14 H0 Z' fill='%23000'/%3E%3C/svg%3E") repeat-x center / 23px 14px;
}
.water .wv.v2 { top: calc(101% - var(--lv, 0) * 100%); }
.water .wv.v2::after { top: -9px; animation-delay: -1.6s; }
.water .wv.v3 { top: calc(102% - var(--lv, 0) * 100%); }
.water .wv.v3::after { top: -6px; animation-delay: -3.1s; }
@keyframes wvMove { from { transform: translateX(0); } to { transform: translateX(-23px); } }
.water.waving .wv::after { animation: wvMove 5.2s linear infinite; }
.water.waving .wv.v2::after { animation-duration: 3.8s; animation-direction: reverse; }
.water.waving .wv.v3::after { animation-duration: 6.4s; }
.wcup .wval { z-index: 2; transition: top .65s cubic-bezier(.3, 1.15, .55, 1); }
/* 杯口沿线（手绘小图标同款线条感）+ 打卡时杯身随之涌动（下压→上弹） */
.water::after {
  content: ''; position: absolute; left: 4px; right: 4px; top: 2px; height: 2px;
  border-radius: 2px; z-index: 2;
  background: rgba(103, 180, 149, .3);
  background: color-mix(in srgb, var(--hc, #67b495) 32%, transparent);
}
.wcup { border-color: rgba(103, 180, 149, .62); border-color: color-mix(in srgb, var(--hc, #67b495) 58%, #fff); }
.water.surge { animation: surge .85s cubic-bezier(.34, 1.2, .6, 1); }
@keyframes surge {
  0% { transform: translateY(0) scale(1, 1); }
  30% { transform: translateY(2.5px) scale(1.04, .94); }
  60% { transform: translateY(-5px) scale(.97, 1.05); }
  100% { transform: translateY(0) scale(1, 1); }
}
.ripple {
  position: absolute; left: 50%; width: 10px; height: 10px;
  top: clamp(10px, calc(100% - var(--lv, 0) * 100% - 2px), calc(100% - 10px));
  border: 2px solid rgba(255, 255, 255, .95); border-radius: 50%;
  transform: translate(-50%, -50%); pointer-events: none;
  animation: rippleA .7s ease-out forwards;
}
@keyframes rippleA {
  from { opacity: .95; transform: translate(-50%, -50%) scale(1); }
  to { opacity: 0; transform: translate(-50%, -50%) scale(6); }
}
.wcells { display: flex; flex-wrap: wrap; gap: 5px; max-width: 170px; align-content: center; }
.wcells i { width: 11px; height: 11px; border-radius: 50%; border: 1.6px solid rgba(103, 180, 149, .6); }
.wcells i.f { background: var(--accent2); border-color: var(--accent2); }

/* 环形 */
.hring { position: relative; width: 48px; height: 48px; flex: none; }
.hring svg { width: 100%; height: 100%; transform: rotate(-90deg); }
.hring circle { fill: none; stroke-width: 4; }
.hring .rbg { stroke: var(--fill); }
.hring .rfg { stroke: var(--hc, var(--accent)); stroke-linecap: round; }
.hring b {
  position: absolute; inset: 0; display: flex; align-items: center; justify-content: center;
  font-size: 10px; font-weight: 800; color: var(--ink);
}

/* 进度条 */
.pbar { height: 10px; flex: 1; background: var(--fill); border-radius: 99px; overflow: hidden; }
.pbar i { display: block; height: 100%; border-radius: 99px; background: var(--hc, var(--accent)); transition: width .2s ease; }

/* 编辑弹层：图标 seg / 颜色 seg */
.iconseg button { display: flex; align-items: center; justify-content: center; }
.iconseg button .ic { width: 20px; height: 20px; }
.colorseg { justify-content: space-around; }
.colorseg button {
  flex: none; width: 30px; height: 30px; border-radius: 50%;
  padding: 0; display: flex; align-items: center; justify-content: center;
}
.colorseg button .sw { width: 20px; height: 20px; border-radius: 50%; display: block; }
.colorseg button.on { background: #fff; box-shadow: 0 2px 6px rgba(32, 67, 57, .12); }
.colorseg button.on .sw { outline: 2px solid var(--ink); outline-offset: 2px; }

/* 标签池「＋ 新建」与行内输入 */
.fchip.add { border: 1px dashed var(--rule); color: var(--accent); }
.fnew {
  width: 82px; border: 1px dashed var(--accent2); background: rgba(255, 255, 255, .75);
  border-radius: 99px; padding: 5px 12px; font-size: 11.5px; font-family: inherit;
  color: var(--ink); outline: none;
}
.fnew::placeholder { color: var(--muted); }

/* ---------- M2.2 UI 对齐：周条 / 大日期头 / 页头统计 / 大水杯 / 组合环形 ---------- */
.datecap .ic { width: 15px; height: 15px; color: var(--accent); }
.datecap .dcchev { width: 12px; height: 12px; color: var(--muted); }

/* 周条（周一起始） */
.weekrow { display: flex; gap: 3px; margin-top: 2px; }
.wd {
  flex: 1; display: flex; flex-direction: column; align-items: center; gap: 3px;
  padding: 8px 0 9px; border-radius: 14px; position: relative; background: none;
  transition: background .18s ease, transform .18s ease;
}
.wd:active { transform: scale(.93); }
.wd span { font-size: 10px; font-weight: 600; color: var(--muted); }
.wd b {
  width: 27px; height: 27px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center;
  font-size: 12.5px; font-weight: 700; font-variant-numeric: tabular-nums;
}
.wd.today b { box-shadow: inset 0 0 0 1.6px var(--accent2); }
.wd.sel {
  background: rgba(255, 255, 255, .8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--rule); box-shadow: 4px 6px 14px -8px rgba(32, 67, 57, .28);
}
.wd.sel b { background: var(--accent); color: #fff; box-shadow: none; }
.wd.sel span { color: var(--accent); }
.wd i { position: absolute; bottom: 3px; left: 50%; transform: translateX(-50%); width: 4px; height: 4px; border-radius: 50%; background: var(--accent2); }
.wd.sel i { background: var(--accent); }

/* 大日期头 */
.dayhead { padding: 2px 2px 0; }
.daybig { font-size: 23px; font-weight: 800; letter-spacing: .3px; line-height: 1.3; }
.daysub-row { display: flex; align-items: center; gap: 8px; }
.daysub-row > span { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.daysub-row .chip { padding: 4px 10px; font-size: 11px; }
.daysub-row .chip .ic { width: 12px; height: 12px; }

/* 打卡页页头统计 */
.hstats { display: flex; align-items: center; gap: 10px; }
.hstatchip {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 11.5px; font-weight: 700; color: var(--accent);
  background: rgba(255, 255, 255, .8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--accent2); border-radius: 99px; padding: 5px 12px;
}
.hstatchip b { font-size: 12.5px; font-variant-numeric: tabular-nums; }
.hstatchip .ic { width: 14px; height: 14px; }
.hweek { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.hweek b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* 卡头右上胶囊 / 提醒 / 今日已打 */
.hcap {
  margin-left: auto; font-size: 10.5px; font-weight: 700; color: var(--muted);
  background: var(--fill); border: none; border-radius: 99px; padding: 4px 10px;
  font-family: inherit; font-variant-numeric: tabular-nums; white-space: nowrap;
  transition: transform .18s ease;
}
.hcap:active { transform: scale(.93); }
.hremind {
  font-size: 10px; font-weight: 600; color: var(--muted); background: var(--fill);
  padding: 2.5px 8px; border-radius: 99px; display: inline-flex; align-items: center; gap: 3px;
}
.hremind .ic { width: 11px; height: 11px; }
.hdonechip {
  margin-left: auto; display: inline-flex; align-items: center; gap: 4px; white-space: nowrap;
  font-size: 11px; font-weight: 700; color: var(--accent);
  background: rgba(255, 255, 255, .85); border: 1.5px solid var(--accent2);
  border-radius: 99px; padding: 4px 11px;
}
.hdonechip .ic { width: 13px; height: 13px; stroke-width: 2.4; }
.hacts { align-self: center; }

/* 大水杯：左侧刻度 + 杯体（复用 .water 波面）+ 右侧一日 N 杯 */
.wcap { display: flex; align-items: stretch; gap: 7px; }
.wticks { position: relative; width: 30px; flex: none; }
.wticks i {
  position: absolute; right: 0; transform: translateY(50%);
  display: flex; align-items: center; gap: 3px;
  font-size: 8.5px; font-style: normal; color: var(--muted); font-variant-numeric: tabular-nums;
}
.wticks i::after { content: ''; width: 7px; height: 1.5px; border-radius: 2px; background: var(--rule); }
.wcup { width: 82px; height: 118px; border-radius: 10px 10px 20px 20px; }
.wval {
  position: absolute; left: 50%; transform: translateX(-50%);
  top: clamp(3px, calc((1 - var(--lv, 0)) * 100% - 9px), calc(100% - 22px));
  background: rgba(28, 43, 37, .78); color: #fff;
  font-size: 9.5px; font-weight: 700; padding: 1.5px 8px; border-radius: 99px;
  font-variant-numeric: tabular-nums; white-space: nowrap; pointer-events: none;
}
.wval em { font-style: normal; font-size: 8.5px; opacity: .85; margin-left: 1px; }
.wside { flex: none; display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 7px; color: var(--muted); padding: 0 3px; }
.wside .ic { width: 20px; height: 20px; }
.wside span { writing-mode: vertical-rl; text-orientation: upright; font-size: 9.5px; font-weight: 600; letter-spacing: 2px; }
.hbtns { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 10px; }
.hbtns button {
  font-family: inherit; font-size: 11.5px; font-weight: 700; color: var(--ink);
  background: var(--fill); border-radius: 12px; padding: 8px 14px;
  transition: transform .18s ease, background .18s ease;
}
.hbtns button:active { transform: scale(.93); background: #e2ede7; }
.hbtns button.redo { color: var(--muted); }

/* 环形（加大）+ 进度条组合 */
.hring.big { width: 58px; height: 58px; }
.hring.big b { flex-direction: column; gap: 0; font-size: 12.5px; line-height: 1.15; }
.hring.big b em { font-style: normal; font-size: 8.5px; color: var(--muted); font-weight: 600; }
.hcombo { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 8px; justify-content: center; }
.hmeta { font-size: 11.5px; color: var(--muted); font-weight: 600; }
.hmeta b { color: var(--ink); font-variant-numeric: tabular-nums; }

/* 今日待办卡头 + 分类小图标 */
#todoCard h2 .ic { width: 16px; height: 16px; color: var(--accent); }
.cat-ic { width: 16px; height: 16px; color: var(--accent); }

/* ---------- M3 记录页 ---------- */
.fabbtn {
  width: 38px; height: 38px; border-radius: 50%; flex: none;
  background: linear-gradient(160deg, var(--accent2), var(--accent)); color: #fff;
  display: flex; align-items: center; justify-content: center;
  box-shadow: 4px 6px 14px -4px rgba(32, 67, 57, .5);
  transition: transform .18s ease;
}
.fabbtn:active { transform: scale(.92); }
.fabbtn .ic { width: 18px; height: 18px; stroke-width: 2.2; }
.recseg { margin-bottom: 0; }

/* 月历卡 */
.rcal-head { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.rcal-head b { flex: 1; text-align: center; font-size: 15px; font-weight: 800; letter-spacing: .5px; font-variant-numeric: tabular-nums; }
.rcal-head .icobtn { width: 32px; height: 32px; border-radius: 50%; }
.rcal-head .icobtn .ic { width: 15px; height: 15px; }
.recgrid { gap: 5px; }
.rec-cell {
  position: relative; aspect-ratio: 1 / 1.06; border-radius: 12px; overflow: hidden;
  background: var(--fill); padding: 0; font-family: inherit;
  transition: transform .18s ease;
}
.rec-cell:active { transform: scale(.93); }
.rec-cell span {
  position: absolute; left: 6px; top: 4px; z-index: 2;
  font-size: 10px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums;
}
.rec-cell .bg { position: absolute; inset: 0; background-size: cover; background-position: center; }
.rec-cell.has span { color: #fff; text-shadow: 0 1px 5px rgba(0, 0, 0, .5); }
.rec-cell.soft { background: #e3f1e9; }
.rec-cell.soft span { color: var(--accent); }
.rec-cell.future { opacity: .45; }
.rec-cell.today { box-shadow: inset 0 0 0 2px var(--accent); }

/* 本月列表 */
.reccount { font-variant-numeric: tabular-nums; margin-left: 2px; }
.card h2 em { font-style: normal; font-size: 11px; color: var(--muted); font-weight: 600; }
.rt {
  width: 100%; display: flex; align-items: center; gap: 12px;
  padding: 10px 2px; background: none; text-align: left;
  border-bottom: 1px dashed var(--rule);
  transition: opacity .18s ease;
}
.rt:last-child { border-bottom: none; }
.rt:active { opacity: .7; }
.thumb {
  width: 46px; height: 46px; border-radius: 12px; flex: none; overflow: hidden;
  background: var(--fill); color: var(--muted);
  display: flex; align-items: center; justify-content: center;
  background-size: cover; background-position: center;
}
.thumb .ic { width: 20px; height: 20px; }
.rmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
.rname { font-size: 14px; font-weight: 700; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.rmeta { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rstars { display: flex; gap: 1.5px; flex: none; }
.rstars .ic { width: 13px; height: 13px; color: #d9a441; }
.rstars .ic.off { color: #e2e9e5; }
.rempty { text-align: center; color: var(--muted); font-size: 12px; padding: 18px 0; }

/* 弹层：星级 + 选图 */
.stars { display: flex; gap: 8px; margin-bottom: 10px; }
.stars button { background: none; padding: 2px; color: #e2e9e5; transition: color .18s ease, transform .18s ease; }
.stars button .ic { width: 26px; height: 26px; }
.stars button.on { color: #d9a441; }
.stars button:active { transform: scale(.85); }
.imgrow { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; }
.imgpick {
  width: 64px; height: 64px; border-radius: 12px; border: 1.5px dashed var(--rule);
  background-color: var(--fill); background-size: cover; background-position: center;
  color: var(--muted); display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 2px;
  font-size: 10px; font-weight: 600; font-family: inherit;
  transition: transform .18s ease;
}
.imgpick:active { transform: scale(.94); }
.imgpick .ic { width: 18px; height: 18px; }
.imgpick.filled { border-style: solid; border-color: var(--accent2); }
.imgpick.filled svg, .imgpick.filled span { display: none; }

/* 星级 SVG 填充（列表与输入共用） */
.rstars .ic path, .stars .ic path { fill: currentColor; stroke: none; }

/* ---------- M4 统计页 ---------- */
/* 统计 tab 已移出底部导航（入口在今日页头部），左右各 2 tab 对称，fab 靠 .fab 基础样式 left:50% 自动居中 */
.statgrid { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.stat {
  display: flex; flex-direction: column; gap: 1px;
  background: rgba(255, 255, 255, .8); backdrop-filter: blur(14px); -webkit-backdrop-filter: blur(14px);
  border: 1px solid var(--rule); border-radius: 16px; padding: 13px 16px 11px;
  box-shadow: 6px 8px 18px -8px rgba(32, 67, 57, .28);
}
.stat b { font-size: 23px; font-weight: 800; line-height: 1.3; font-variant-numeric: tabular-nums; }
.stat span { font-size: 11px; color: var(--muted); font-weight: 600; }

/* 卡头：标题 + 周期 chip / 绿色 icon 按钮（点击循环切周期） */
.scap { display: flex; align-items: center; gap: 8px; margin-bottom: 10px; }
.scap > b { font-size: 14.5px; font-weight: 700; }
.scap .chip { margin-left: auto; padding: 6px 12px; }
.scap .chip .ic { width: 13px; height: 13px; }
.scrange { margin-left: auto; font-size: 11px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; }
.segcap {
  width: 32px; height: 32px; border-radius: 50%; flex: none; padding: 0;
  display: flex; align-items: center; justify-content: center;
  color: #fff; background: linear-gradient(160deg, var(--accent2), var(--accent));
  box-shadow: 4px 6px 14px -6px rgba(32, 67, 57, .5);
  transition: transform .18s ease;
}
.segcap:hover { transform: scale(1.12); }
.segcap:active { transform: scale(.92); }
.segcap .ic { width: 16px; height: 16px; }

/* 图表 */
#chartBox svg.chart { width: 100%; height: auto; display: block; }
#chartBox, #moodPairs, .hmgrid, .donutrow { animation: pagein .18s ease; }
.chart text, .donut text { font-family: inherit; }
.bbar { fill: #cfe4d8; }
.bmax { fill: var(--accent); }
text.cv { font-size: 10px; font-weight: 600; fill: var(--muted); text-anchor: middle; }
text.cv.on { fill: var(--accent); font-weight: 800; }
text.cl { font-size: 9.5px; fill: var(--muted); text-anchor: middle; }
.lline { fill: none; stroke: var(--accent); stroke-width: 2.4; stroke-linecap: round; stroke-linejoin: round; }
.lmood { fill: none; stroke: #d9a441; stroke-width: 2; stroke-linecap: round; stroke-dasharray: 4 3; }
.lpt { fill: #fff; stroke: var(--accent); stroke-width: 1.8; }
.lpt.m { stroke: #d9a441; }
.clegend { display: flex; justify-content: center; gap: 16px; margin-top: 4px; font-size: 11px; color: var(--muted); font-weight: 600; }
.clegend i { width: 8px; height: 8px; border-radius: 50%; display: inline-block; margin-right: 4px; }

/* 环形占比 */
.donutrow { display: flex; align-items: center; gap: 18px; }
.donut { width: 126px; height: 126px; flex: none; }
text.dnum { font-size: 25px; font-weight: 800; fill: var(--ink); text-anchor: middle; }
text.dsub { font-size: 9.5px; fill: var(--muted); font-weight: 600; text-anchor: middle; }
.dring { fill: none; stroke: var(--fill); stroke-width: 24; }
.dseg { fill: none; stroke-width: 24; transition: stroke-dasharray .2s ease; }
.dlegend { flex: 1; display: flex; flex-direction: column; gap: 9px; font-size: 12.5px; font-weight: 600; }
.dl { display: flex; align-items: center; gap: 7px; }
.dl i { width: 9px; height: 9px; border-radius: 3px; flex: none; }
.dl.none { color: var(--muted); font-weight: 400; font-size: 12px; }

/* 心情记录行：分类icon/名称 · 心情icon/心情名 · 百分比 · 次数 */
.pair { display: flex; align-items: center; gap: 8px; padding: 9.5px 2px; border-bottom: 1px dashed var(--rule); font-size: 13px; }
.pair:last-child { border-bottom: none; }
.pair b { font-weight: 700; }
.pair .pm { margin-left: auto; display: flex; align-items: center; gap: 5px; color: var(--muted); font-size: 11.5px; font-weight: 600; }
.pair .pm .ic { width: 17px; height: 17px; color: var(--accent); stroke-width: 1.7; }
.pair .ppct { font-size: 11px; font-weight: 700; color: var(--accent); background: var(--fill); padding: 2px 8px; border-radius: 99px; font-variant-numeric: tabular-nums; }
.pair .pcnt { font-size: 10.5px; color: var(--muted); font-variant-numeric: tabular-nums; flex: none; width: 32px; text-align: right; }

/* 记录热力宫格 */
.hmgrid { display: grid; gap: 4px; }
.hmgrid i { aspect-ratio: 1; border-radius: 3.5px; background: var(--fill); }
.hmgrid i.h1 { background: #e3f1e9; }
.hmgrid i.h2 { background: #c6e4d4; }
.hmgrid i.h3 { background: #9fd0ba; }
.hmgrid i.h4 { background: var(--accent); }
.hmgrid i.today { box-shadow: inset 0 0 0 1.6px var(--accent); }
#hmSum { margin: 10px 0 0; }

/* ===================== M6 手账 + 翻页日记本 ===================== */
#calSheet { transition: transform .22s ease, max-height .26s ease; }
#calSheet.expand { max-height: 96dvh; }
.icobtn.on { background: var(--accent); border-color: var(--accent); color: #fff; }

/* ---------- 手账页（白底浅绿格线纸质感） ---------- */
.hand-page {
  position: relative; min-height: 320px; border-radius: 14px;
  border: 1px solid var(--rule); background: #fff;
  background-image: linear-gradient(rgba(103, 180, 149, .13) 1px, transparent 1px),
    linear-gradient(90deg, rgba(103, 180, 149, .13) 1px, transparent 1px);
  background-size: 22px 22px;
  box-shadow: 8px 10px 22px -8px rgba(32, 67, 57, .3);
  padding: 14px 16px 16px;
}
.hand-head { display: flex; align-items: center; gap: 7px; padding: 0 44px 8px 0; border-bottom: 1.5px solid rgba(103, 180, 149, .35); }
.hand-head b { font-size: 15px; font-weight: 800; }
.hand-head > span { font-size: 11px; color: var(--muted); font-weight: 600; }
.hand-head .hand-mood { display: flex; align-items: center; gap: 4px; font-size: 10.5px; font-weight: 700; color: var(--accent); background: rgba(103, 180, 149, .15); padding: 3px 9px; border-radius: 99px; }
.hand-mood .ic { width: 16px; height: 16px; }
.hand-sticker { position: absolute; top: 10px; right: 12px; width: 46px; height: 46px; transform: rotate(9deg); filter: drop-shadow(0 3px 6px rgba(32, 67, 57, .18)); }
.hand-sticker svg { width: 100%; height: 100%; }
.hand-diary { margin: 12px 0 4px; padding: 8px 10px; border-radius: 10px; cursor: pointer; transition: background .18s ease; }
.hand-diary:active { background: rgba(103, 180, 149, .1); }
.hand-txt { font-size: 12.5px; line-height: 1.85; white-space: pre-wrap; word-break: break-word; }
.hand-blank { font-size: 12px; color: var(--muted); padding: 14px 0; }
.hand-tags { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 4px; }
.hand-sec { margin-top: 10px; }
.hand-sec > i { display: block; font-style: normal; font-size: 10.5px; font-weight: 700; color: var(--muted); letter-spacing: .5px; margin-bottom: 5px; }
.hand-todo {
  display: flex; align-items: center; gap: 8px; width: 100%; text-align: left;
  padding: 7px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; color: var(--ink);
  transition: background .18s ease;
}
.hand-todo:active { background: rgba(255, 255, 255, .75); }
.htc {
  width: 17px; height: 17px; border-radius: 50%; border: 1.7px solid var(--accent2);
  flex: none; display: flex; align-items: center; justify-content: center; background: #fff;
}
.htc svg { width: 10px; height: 10px; stroke: #fff; stroke-width: 2.8; fill: none; }
.hand-todo.done .htc { background: var(--accent); border-color: var(--accent); }
.hand-todo.done span { color: var(--muted); text-decoration: line-through; }
.hand-todo em { margin-left: auto; font-style: normal; font-size: 10.5px; color: var(--muted); font-weight: 700; font-variant-numeric: tabular-nums; }
.hand-rec { display: flex; align-items: center; gap: 9px; width: 100%; text-align: left; padding: 6px 9px; border-radius: 10px; }
.hand-rec:active { background: rgba(255, 255, 255, .75); }
.hand-rec img { width: 42px; height: 42px; border-radius: 11px; object-fit: cover; border: 1px solid var(--rule); flex: none; }
.hand-rec .htc.rec { border-style: none; background: var(--fill); }
.hand-rec span { font-size: 12px; font-weight: 600; }
.hstar { margin-left: auto; font-style: normal; display: flex; align-items: center; gap: 2px; font-size: 11px; font-weight: 700; color: #a4762e; }
.hstar .ic { width: 11px; height: 11px; fill: #d9a441; stroke: none; }

/* ---------- 翻页日记本 ---------- */
.bk3-head { display: flex; align-items: center; justify-content: space-between; gap: 8px; margin-bottom: 8px; }
.bk3-head b { font-size: 11px; font-weight: 700; color: var(--muted); font-variant-numeric: tabular-nums; }
.bkseg { margin: 0; flex: none; }
.bkseg button { padding: 3.5px 12px; font-size: 10.5px; }
.bk3-stage { perspective: 1100px; display: flex; justify-content: center; padding: 4px 2px 14px; }
.bk3 {
  position: relative; width: 100%; height: 240px; flex: none;
  transform: rotateX(9deg); transform-style: preserve-3d;
}
#calSheet.expand .bk3 { height: 330px; }
.bk-cover {
  position: absolute; inset: 0; border-radius: 16px;
  background: linear-gradient(160deg, #37795b, #1f523c 70%, #173f2f);
  box-shadow: 0 20px 32px -14px rgba(23, 63, 47, .6);
}
.bk-stack { position: absolute; top: 11px; bottom: 11px; width: calc(50% - 10px); background: #fdfefc; border-radius: 7px; }
.bk-stack.l { left: 11px; box-shadow: -2px 1px 0 #e8f0eb, -4px 2px 0 #dce9e2; }
.bk-stack.r { right: 11px; box-shadow: 2px 1px 0 #e8f0eb, 4px 2px 0 #dce9e2; }
.pg {
  position: absolute; top: 8px; bottom: 8px; width: calc(50% - 8px); z-index: 2;
  background: linear-gradient(105deg, #ffffff, #fbfdfb 55%, #f3f7f4);
}
.pg.l { left: 8px; border-radius: 8px 2px 2px 8px; box-shadow: inset -7px 0 10px -8px rgba(28, 43, 37, .2); }
.pg.r { right: 8px; border-radius: 2px 8px 8px 2px; box-shadow: inset 7px 0 10px -8px rgba(28, 43, 37, .2); }
.spine {
  position: absolute; top: 8px; bottom: 8px; left: 50%; width: 20px; transform: translateX(-50%); z-index: 3;
  background: linear-gradient(90deg, rgba(28, 43, 37, 0), rgba(28, 43, 37, .12) 38%, rgba(28, 43, 37, .2) 50%, rgba(28, 43, 37, .12) 62%, rgba(28, 43, 37, 0));
  pointer-events: none;
}
#leaf {
  position: absolute; top: 8px; bottom: 8px; left: 50%; width: calc(50% - 8px);
  transform-origin: left center; transform-style: preserve-3d;
  display: none; will-change: transform;
}
#leaf .face {
  position: absolute; inset: 0;
  backface-visibility: hidden; -webkit-backface-visibility: hidden;
  background: linear-gradient(105deg, #ffffff, #fbfdfb 55%, #f3f7f4);
  box-shadow: 0 6px 18px -6px rgba(28, 43, 37, .25);
}
#leaf .face.fr { border-radius: 2px 8px 8px 2px; }
#leaf .face.bk { transform: rotateY(180deg); border-radius: 8px 2px 2px 8px; }
.bk3.single .pg.l, .bk3.single .spine { display: none; }
.bk3.single .pg.r { left: 8px; right: 8px; width: auto; border-radius: 8px; }
.bk3.single #leaf { left: 8px; width: calc(100% - 16px); }
.pin { position: absolute; inset: 0; padding: 13px 16px 14px; overflow: hidden; }
.book-date { display: flex; align-items: baseline; gap: 6px; font-size: 13px; font-weight: 800; color: var(--ink); }
.book-date span { font-size: 10px; font-weight: 600; color: var(--muted); }
.book-moodrow { display: flex; align-items: center; gap: 4px; margin-top: 5px; font-size: 10px; font-weight: 600; color: var(--muted); }
.book-moodrow .ic { width: 15px; height: 15px; }
.book-txt {
  margin-top: 6px; font-size: 10.5px; line-height: 1.72; color: var(--ink);
  white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 8; -webkit-box-orient: vertical; overflow: hidden;
}
.book-stk { position: absolute; top: 9px; right: 9px; width: 30px; height: 30px; transform: rotate(9deg); }
.book-stk svg { width: 100%; height: 100%; }
.bk-done { margin: 8px 0 0; }
.bk-done li { list-style: none; display: flex; align-items: center; gap: 6px; padding: 2.5px 0; font-size: 10px; font-weight: 600; color: var(--muted); }
.bk-done li i { width: 12px; height: 12px; border-radius: 50%; background: var(--accent); flex: none; display: flex; align-items: center; justify-content: center; }
.bk-done li i svg { width: 8px; height: 8px; stroke: #fff; stroke-width: 3; fill: none; }
.book-recs { margin-top: 8px; display: flex; flex-direction: column; gap: 5px; overflow: hidden; }
.book-rec { display: flex; align-items: center; gap: 7px; min-width: 0; }
.book-rec img { width: 32px; height: 32px; border-radius: 9px; object-fit: cover; border: 1px solid var(--rule); flex: none; }
.book-rec > i { width: 32px; height: 32px; border-radius: 9px; background: var(--fill); flex: none; }
.book-rec b { font-size: 10px; font-weight: 600; color: var(--ink); white-space: nowrap; overflow: hidden; text-overflow: ellipsis; }
.bstar { margin-left: auto; display: flex; align-items: center; gap: 2px; font-style: normal; font-size: 9.5px; font-weight: 700; color: #a4762e; }
.bstar .ic { width: 10px; height: 10px; fill: #d9a441; stroke: none; }
.bk-nav {
  position: absolute; top: 50%; margin-top: -16px; width: 32px; height: 32px; border-radius: 50%;
  display: flex; align-items: center; justify-content: center; z-index: 4;
  background: rgba(255, 255, 255, .94); border: 1px solid var(--rule); color: var(--ink);
  box-shadow: 0 5px 12px rgba(32, 67, 57, .28);
  transition: transform .18s ease;
}
.bk-nav:active { transform: scale(.88); }
.bk-nav .ic { width: 15px; height: 15px; }
.bk-nav.prev { left: -8px; }
.bk-nav.next { right: -8px; }

/* ===================== M7 本轮增强：待办缩略图 / 简评 / 关联打卡 / 数据页设置 ===================== */
/* 今日待办条目缩略图 */
.timg {
  width: 28px; height: 28px; border-radius: 9px; object-fit: cover; flex: none;
  border: 1px solid var(--rule);
}
/* 记录列表简评小字 */
.rnote {
  font-size: 11.5px; color: var(--muted); line-height: 1.5;
  overflow: hidden; display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical;
}
/* 习惯卡：今日关联的书/影小字 */
.hlinked {
  display: flex; align-items: center; gap: 5px; margin-top: 5px;
  font-size: 11px; color: var(--muted); font-weight: 600;
  min-width: 0; white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.hlinked .ic { width: 13px; height: 13px; flex: none; color: var(--accent); }
.hlinked b { font-weight: 700; color: var(--ink); overflow: hidden; text-overflow: ellipsis; }
/* 打卡流水里的关联记录（可点开编辑） */
.lk { cursor: pointer; }
.lk:active { opacity: .7; }

/* ---------- 数据页：账号设置 ---------- */
.acc { display: flex; align-items: center; gap: 12px; margin-bottom: 4px; }
.accava {
  width: 48px; height: 48px; border-radius: 50%; flex: none; padding: 0;
  border: 1.5px solid var(--rule); background-color: var(--fill); background-size: cover; background-position: center;
  color: var(--muted); display: flex; align-items: center; justify-content: center;
  transition: transform .18s ease;
}
.accava:active { transform: scale(.93); }
.accava .ic { width: 22px; height: 22px; }
.accname {
  flex: 1; min-width: 0; border: 1px solid var(--rule); outline: none;
  background: rgba(241, 245, 242, .75); border-radius: 12px; padding: 9px 13px;
  font-size: 13px; font-family: inherit; color: var(--ink); font-weight: 600;
}
.accname:focus { border-color: var(--accent2); }
.accbind .row b { display: flex; }
.accbind .mini { min-width: 52px; }

/* ---------- 数据页：分类文件夹预览 ---------- */
.folw { border: 1px solid var(--rule); border-radius: 14px; margin-bottom: 8px; overflow: hidden; background: rgba(255, 255, 255, .55); }
.folw:last-child { margin-bottom: 0; }
.fol-h { display: flex; align-items: center; gap: 8px; padding: 10px 12px; cursor: pointer; }
.fol-h b { font-size: 13px; font-weight: 700; }
.fol-h .badge { margin-left: 2px; }
.fol-h .chev { margin-left: auto; width: 14px; height: 14px; color: var(--muted); transition: transform .18s ease; }
.folw.open .fol-h .chev { transform: rotate(180deg); }
.fol-b { display: none; padding: 2px 12px 10px; border-top: 1px dashed var(--rule); }
.folw.open .fol-b { display: block; }
.fol-t { display: flex; align-items: center; gap: 8px; width: 100%; text-align: left; padding: 7px 2px; font-size: 12.5px; font-weight: 600; color: var(--ink); border-bottom: 1px dashed var(--rule); transition: opacity .18s ease; }
.fol-t:last-child { border-bottom: none; }
.fol-t:active { opacity: .7; }
.fol-t em { margin-left: auto; font-style: normal; font-size: 10.5px; color: var(--muted); font-weight: 600; font-variant-numeric: tabular-nums; flex: none; }
.fol-t i { width: 14px; height: 14px; border-radius: 50%; flex: none; border: 1.6px solid #b9cfc5; }
.fol-t.done span { color: var(--muted); text-decoration: line-through; }
.fol-t.done i { background: var(--accent); border-color: var(--accent); position: relative; }
.fol-t.done i::after { content: ''; position: absolute; left: 3.5px; top: 1px; width: 3.5px; height: 6px; border: solid #fff; border-width: 0 1.6px 1.6px 0; transform: rotate(42deg); }
.fol-empty { font-size: 11.5px; color: var(--muted); padding: 6px 2px; }
