/* ===========================================================================
 * 老板自律打卡（#sub-checkin）· 独立样式表
 * ---------------------------------------------------------------------------
 * 为什么单开文件：全站铁律 —— 不往 style.css 里加（多会话并发在改）。
 * 本文件在 index.html 里排在 style.css 与其它板块 css 之后加载。
 *
 * 🔴 三条硬约束（都是踩过的坑）
 *   ① 所有选择器必须带 `#sub-checkin` 作用域 —— 本项目对"裸类名"零容忍。
 *   ② 带 absolute 装饰的容器必须 position:relative，否则会按 right 撑宽 document，
 *      手机端整页缩成 77%（桌面看不出来）。
 *   ③ 底部要给固定 TabBar 留白（实测高 74px），不留会被挡住最后一条。
 *
 * 视觉基调：暖白"打卡板" + 品牌橙。
 *   打卡类产品的视觉不该花 —— 用户每天要看一眼、点一下就走的界面，
 *   信息层级只有三档：**今天做到没有 / 还差哪条 / 点哪里**。
 *   所以这里刻意不用深色大块和多余装饰，靠"进度环 + 大圆按钮"两处做记忆点。
 *   主色 #f95901 是品牌色，不许换（要辨识度靠质感，不靠换主色）。
 * =========================================================================== */

#sub-checkin {
  --ck-bg: #fdf9f3;
  --ck-card: #ffffff;
  --ck-ink: #241a12;
  --ck-ink2: #8a7666;
  --ck-ink3: #b8a79a;
  --ck-line: rgba(150, 100, 50, .13);
  --ck-brand: #f95901;
  --ck-brand2: #ff8f47;
  --ck-brand-soft: rgba(249, 89, 1, .08);
  --ck-gold: #b45309;
  --ck-shadow: 0 2px 10px rgba(122, 58, 18, .07);
  --ck-shadow2: 0 10px 28px rgba(122, 58, 18, .14);
  background: var(--ck-bg);
  padding-bottom: 96px;
}

/* `hidden` 会被 display:flex/grid 盖掉，必须显式压掉（全站通病） */
#sub-checkin [hidden] { display: none !important; }

/* ===================== 顶部分段切换 ===================== */
#sub-checkin .ck-seg {
  display: flex;
  gap: 4px;
  margin: 10px 14px 0;
  padding: 4px;
  border-radius: 14px;
  background: rgba(180, 130, 80, .10);
}
#sub-checkin .ck-seg-i {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  border-radius: 11px;
  font-size: 13.5px;
  font-weight: 700;
  color: var(--ck-ink2);
  cursor: pointer;
  transition: background .16s, color .16s, box-shadow .16s;
  -webkit-tap-highlight-color: transparent;
}
#sub-checkin .ck-seg-i.on {
  background: #fff;
  color: var(--ck-brand);
  box-shadow: 0 1px 5px rgba(122, 58, 18, .13);
}

/* ===================== 今日头部：进度环 ===================== */
#sub-checkin .ck-hero {
  margin: 12px 14px 0;
  padding: 18px 16px 14px;
  border-radius: 20px;
  background: linear-gradient(160deg, #fff8f1 0%, #fffdfa 60%);
  border: 1px solid var(--ck-line);
  box-shadow: var(--ck-shadow);
  display: flex;
  align-items: center;
  gap: 16px;
}

/* 进度环：conic-gradient + 内层白圆挖洞（零 SVG、零图片，颜色一个变量控制） */
#sub-checkin .ck-ring {
  position: relative;
  flex: 0 0 auto;
  width: 92px;
  height: 92px;
  border-radius: 50%;
  background: conic-gradient(var(--ck-brand) calc(var(--p, 0) * 1%), rgba(180, 130, 80, .14) 0);
  transition: background .5s ease;
}
#sub-checkin .ck-ring::after {
  content: '';
  position: absolute;
  inset: 9px;
  border-radius: 50%;
  background: #fffdfa;
  box-shadow: inset 0 1px 4px rgba(122, 58, 18, .06);
}
#sub-checkin .ck-ring-in {
  position: absolute;
  inset: 0;
  z-index: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  line-height: 1.1;
  pointer-events: none;
}
#sub-checkin .ck-ring-in b {
  font-size: 23px;
  font-weight: 900;
  color: var(--ck-ink);
  letter-spacing: -.5px;
}
#sub-checkin .ck-ring-in b em {
  font-style: normal;
  font-size: 14px;
  font-weight: 700;
  color: var(--ck-ink3);
}
#sub-checkin .ck-ring-in span {
  margin-top: 3px;
  font-size: 10.5px;
  color: var(--ck-ink3);
}

#sub-checkin .ck-hero-right { flex: 1; min-width: 0; }
#sub-checkin .ck-motto {
  font-size: 15px;
  font-weight: 800;
  color: var(--ck-ink);
  line-height: 1.45;
  letter-spacing: .2px;
}
#sub-checkin .ck-sub {
  margin-top: 5px;
  font-size: 12px;
  color: var(--ck-ink2);
  line-height: 1.5;
}

/* 7 天小格 */
#sub-checkin .ck-week {
  display: flex;
  gap: 5px;
  margin-top: 10px;
}
#sub-checkin .ck-week-i {
  flex: 1;
  text-align: center;
}
#sub-checkin .ck-week-dot {
  height: 20px;
  border-radius: 6px;
  background: rgba(180, 130, 80, .13);
  transition: background .2s;
}
#sub-checkin .ck-week-i.full .ck-week-dot { background: linear-gradient(180deg, var(--ck-brand2), var(--ck-brand)); }
#sub-checkin .ck-week-i.part .ck-week-dot { background: rgba(249, 89, 1, .38); }
#sub-checkin .ck-week-i.today .ck-week-dot { box-shadow: 0 0 0 2px rgba(249, 89, 1, .25); }
#sub-checkin .ck-week-w {
  margin-top: 3px;
  font-size: 9.5px;
  color: var(--ck-ink3);
}

/* ===================== 补签提示条（对抗"断一次就放弃"） ===================== */
#sub-checkin .ck-late {
  margin: 12px 14px 0;
  padding: 12px 14px;
  border-radius: 14px;
  background: linear-gradient(135deg, #fff4e8, #ffe9d6);
  border: 1px solid rgba(249, 89, 1, .22);
  display: flex;
  align-items: center;
  gap: 10px;
}
#sub-checkin .ck-late-ico { font-size: 19px; flex: 0 0 auto; }
#sub-checkin .ck-late-t { flex: 1; font-size: 12.5px; color: #8a4a12; line-height: 1.5; }
#sub-checkin .ck-late-t b { color: #6d3708; }
#sub-checkin .ck-late-btn {
  flex: 0 0 auto;
  padding: 7px 13px;
  border: 0;
  border-radius: 10px;
  background: var(--ck-brand);
  color: #fff;
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
#sub-checkin .ck-late-btn:active { transform: scale(.96); }

/* ===================== 今日清单 ===================== */
#sub-checkin .ck-sec-t {
  display: flex;
  align-items: center;
  gap: 7px;
  margin: 16px 14px 8px;
  font-size: 13px;
  font-weight: 800;
  color: var(--ck-ink);
}
#sub-checkin .ck-sec-t i {
  width: 3px;
  height: 13px;
  border-radius: 2px;
  background: var(--ck-brand);
}
#sub-checkin .ck-sec-t span { font-weight: 500; font-size: 11.5px; color: var(--ck-ink3); }

#sub-checkin .ck-list { margin: 0 14px; display: flex; flex-direction: column; gap: 9px; }

#sub-checkin .ck-card {
  position: relative;          /* 🔴 有 absolute 装饰物，必须 relative */
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 13px 13px 13px 15px;
  border-radius: 16px;
  background: var(--ck-card);
  border: 1px solid var(--ck-line);
  box-shadow: var(--ck-shadow);
  transition: background .2s, border-color .2s, transform .12s;
  overflow: hidden;
}
#sub-checkin .ck-card::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--ck-bar, var(--ck-brand));
  opacity: .85;
}
#sub-checkin .ck-card.done {
  background: linear-gradient(135deg, #fff6ef, #fffdfa);
  border-color: rgba(249, 89, 1, .28);
}
#sub-checkin .ck-card.done .ck-name { color: var(--ck-ink2); }
#sub-checkin .ck-card.tap { transform: scale(.985); }

#sub-checkin .ck-ico {
  flex: 0 0 auto;
  width: 42px; height: 42px;
  border-radius: 13px;
  display: flex; align-items: center; justify-content: center;
  font-size: 21px;
  background: var(--ck-brand-soft);
}
#sub-checkin .ck-card.done .ck-ico { background: rgba(249, 89, 1, .14); }

#sub-checkin .ck-main { flex: 1; min-width: 0; }
#sub-checkin .ck-name {
  font-size: 15px;
  font-weight: 800;
  color: var(--ck-ink);
  letter-spacing: .2px;
  display: flex;
  align-items: center;
  gap: 6px;
}
#sub-checkin .ck-name .ck-fire {
  font-size: 10.5px;
  font-weight: 700;
  color: var(--ck-gold);
  background: rgba(180, 83, 9, .10);
  padding: 1px 6px;
  border-radius: 7px;
}
#sub-checkin .ck-rule {
  margin-top: 3px;
  font-size: 11.5px;
  color: var(--ck-ink2);
  line-height: 1.45;
  overflow: hidden;
  text-overflow: ellipsis;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
/* 「没状态？只记最小版本…」
   🔴 绝不能用 inline-flex：flex 会把「没状态？」「只记最小版本」「（10 个深蹲）」
   拆成三个独立 item，窄屏折行时各自断行、看起来像一堆碎片
   （2026-09-19 截图实测踩到）。它就是一句普通小字，走正常文本流。 */
#sub-checkin .ck-mini-line {
  margin-top: 6px;
  font-size: 11px;
  color: var(--ck-ink3);
  line-height: 1.5;
  cursor: pointer;
}
#sub-checkin .ck-mini-a { display: inline; }
#sub-checkin .ck-mini-b { display: block; margin-top: 1px; }
#sub-checkin .ck-mini-line b { color: var(--ck-brand); font-weight: 700; }

/* 打卡按钮：整个交互的主角，必须一眼看到、一点就中 */
#sub-checkin .ck-btn {
  flex: 0 0 auto;
  width: 46px; height: 46px;
  border-radius: 50%;
  border: 2px solid rgba(249, 89, 1, .30);
  background: #fff;
  color: var(--ck-brand);
  font-size: 19px;
  line-height: 1;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
  transition: transform .12s, background .2s, border-color .2s, box-shadow .2s;
  -webkit-tap-highlight-color: transparent;
}
#sub-checkin .ck-btn:active { transform: scale(.9); }
#sub-checkin .ck-card.done .ck-btn {
  background: linear-gradient(140deg, var(--ck-brand2), var(--ck-brand));
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(249, 89, 1, .30);
}
#sub-checkin .ck-card.mini .ck-btn {
  background: rgba(249, 89, 1, .12);
  border-style: dashed;
  color: var(--ck-brand);   /* 🔴 不能留成白色：淡橙底 + 白勾对比度太低，看不出"已打" */
  box-shadow: none;
}
#sub-checkin .ck-card.busy { opacity: .6; pointer-events: none; }

/* 刚打完卡的一次"弹一下" */
@keyframes ckPop {
  0% { transform: scale(1); }
  40% { transform: scale(1.16); }
  100% { transform: scale(1); }
}
#sub-checkin .ck-btn.pop { animation: ckPop .34s ease; }

/* ===================== 空状态 / 模板 ===================== */
#sub-checkin .ck-empty {
  margin: 14px;
  padding: 20px 16px 18px;
  border-radius: 18px;
  background: #fff;
  border: 1px solid var(--ck-line);
  box-shadow: var(--ck-shadow);
  text-align: center;
}
#sub-checkin .ck-empty-ico { font-size: 34px; }
#sub-checkin .ck-empty-t { margin-top: 8px; font-size: 16px; font-weight: 800; color: var(--ck-ink); }
#sub-checkin .ck-empty-d { margin-top: 6px; font-size: 12.5px; color: var(--ck-ink2); line-height: 1.6; }

#sub-checkin .ck-tpl-t {
  margin: 18px 0 9px;
  font-size: 12.5px;
  font-weight: 800;
  color: var(--ck-ink);
  text-align: left;
}
#sub-checkin .ck-tpls { display: flex; flex-direction: column; gap: 7px; }
#sub-checkin .ck-tpl {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 12px;
  border-radius: 13px;
  background: #fffaf5;
  border: 1px solid var(--ck-line);
  text-align: left;
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
#sub-checkin .ck-tpl:active { background: #fff2e6; }
#sub-checkin .ck-tpl.on { background: rgba(249, 89, 1, .09); border-color: rgba(249, 89, 1, .35); }
#sub-checkin .ck-tpl-i { font-size: 19px; flex: 0 0 auto; }
#sub-checkin .ck-tpl-m { flex: 1; min-width: 0; }
/* 🔴 这两个是 span，必须给块级 display 才会上下堆叠 ——
   漏了的话名称和描述会挤成一行「早起7:00 前离开床…」（2026-09-19 截图实测） */
#sub-checkin .ck-tpl-n { display: block; font-size: 13.5px; font-weight: 700; color: var(--ck-ink); }
#sub-checkin .ck-tpl-d {
  display: -webkit-box;          /* 本身即块级 → 与名称上下堆叠；同时用来做 2 行截断 */
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
  overflow: hidden;
  margin-top: 2px;
  font-size: 11px;
  color: var(--ck-ink2);
  line-height: 1.4;
}
#sub-checkin .ck-tpl-c { flex: 0 0 auto; font-size: 16px; color: var(--ck-ink3); }
#sub-checkin .ck-tpl.on .ck-tpl-c { color: var(--ck-brand); }

#sub-checkin .ck-add-btn {
  margin-top: 14px;
  width: 100%;
  padding: 13px 0;
  border: 0;
  border-radius: 14px;
  background: linear-gradient(135deg, var(--ck-brand2), var(--ck-brand));
  color: #fff;
  font-size: 15px;
  font-weight: 800;
  letter-spacing: .5px;
  cursor: pointer;
  box-shadow: 0 6px 16px rgba(249, 89, 1, .26);
}
#sub-checkin .ck-add-btn:active { transform: scale(.985); }
#sub-checkin .ck-add-btn:disabled { opacity: .5; box-shadow: none; }

#sub-checkin .ck-link {
  display: inline-block;
  margin-top: 12px;
  font-size: 12.5px;
  color: var(--ck-brand);
  font-weight: 700;
  cursor: pointer;
}

/* ===================== 数据视图 ===================== */
#sub-checkin .ck-sum {
  margin: 12px 14px 0;
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 9px;
}
#sub-checkin .ck-sum-i {
  padding: 13px 8px;
  border-radius: 14px;
  background: #fff;
  border: 1px solid var(--ck-line);
  box-shadow: var(--ck-shadow);
  text-align: center;
}
#sub-checkin .ck-sum-v { font-size: 22px; font-weight: 900; color: var(--ck-brand); letter-spacing: -.5px; }
#sub-checkin .ck-sum-v small { font-size: 12px; font-weight: 700; }
#sub-checkin .ck-sum-k { margin-top: 3px; font-size: 10.5px; color: var(--ck-ink3); }

#sub-checkin .ck-heat-wrap {
  margin: 0 14px;
  padding: 14px 13px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--ck-line);
  box-shadow: var(--ck-shadow);
}
#sub-checkin .ck-heat-row {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px dashed var(--ck-line);
}
#sub-checkin .ck-heat-row:last-child { border-bottom: 0; }
#sub-checkin .ck-heat-n {
  flex: 0 0 74px;
  font-size: 11.5px;
  color: var(--ck-ink);
  font-weight: 700;
  display: flex;
  align-items: center;
  gap: 4px;
  overflow: hidden;
  white-space: nowrap;
  text-overflow: ellipsis;
}
#sub-checkin .ck-heat-g { flex: 1; display: flex; gap: 2px; }
#sub-checkin .ck-heat-c {
  flex: 1;
  height: 15px;
  border-radius: 3px;
  background: rgba(180, 130, 80, .11);
}
#sub-checkin .ck-heat-c.l1 { background: rgba(249, 89, 1, .32); }
#sub-checkin .ck-heat-c.l2 { background: var(--ck-brand); }
#sub-checkin .ck-heat-r {
  flex: 0 0 34px;
  text-align: right;
  font-size: 11px;
  font-weight: 800;
  color: var(--ck-ink2);
}
#sub-checkin .ck-heat-axis {
  margin: 6px 0 0 84px;
  display: flex;
  justify-content: space-between;
  font-size: 9.5px;
  color: var(--ck-ink3);
}

/* ===================== AI 视图 ===================== */
#sub-checkin .ck-panel {
  margin: 12px 14px 0;
  padding: 15px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--ck-line);
  box-shadow: var(--ck-shadow);
}
#sub-checkin .ck-panel-t {
  font-size: 14px;
  font-weight: 800;
  color: var(--ck-ink);
  display: flex;
  align-items: center;
  gap: 6px;
}
#sub-checkin .ck-panel-d {
  margin-top: 5px;
  font-size: 12px;
  color: var(--ck-ink2);
  line-height: 1.55;
}
#sub-checkin .ck-want {
  margin-top: 11px;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border-radius: 12px;
  border: 1px solid var(--ck-line);
  background: #fffdfa;
  font-size: 13.5px;
  color: var(--ck-ink);
  line-height: 1.55;
  resize: vertical;
  font-family: inherit;
}
#sub-checkin .ck-want:focus { outline: none; border-color: rgba(249, 89, 1, .45); background: #fff; }
#sub-checkin .ck-go {
  margin-top: 10px;
  width: 100%;
  padding: 12px 0;
  border: 0;
  border-radius: 13px;
  background: linear-gradient(135deg, var(--ck-brand2), var(--ck-brand));
  color: #fff;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
  box-shadow: 0 5px 14px rgba(249, 89, 1, .24);
}
#sub-checkin .ck-go:active { transform: scale(.985); }
#sub-checkin .ck-go:disabled { opacity: .5; box-shadow: none; cursor: default; }
#sub-checkin .ck-go.ghost {
  background: #fff;
  color: var(--ck-brand);
  border: 1.5px solid rgba(249, 89, 1, .40);
  box-shadow: none;
}

/* AI 输出区（Markdown 渲染） */
#sub-checkin .ck-out {
  margin: 12px 14px 0;
  padding: 15px 14px;
  border-radius: 16px;
  background: #fff;
  border: 1px solid var(--ck-line);
  box-shadow: var(--ck-shadow);
  font-size: 13.5px;
  color: #33281e;
  line-height: 1.75;
  word-break: break-word;
}
#sub-checkin .ck-out h4 {
  margin: 14px 0 6px;
  font-size: 13.5px;
  font-weight: 800;
  color: var(--ck-brand);
  padding-left: 9px;
  border-left: 3px solid var(--ck-brand);
  line-height: 1.35;
}
#sub-checkin .ck-out h4:first-child { margin-top: 0; }
#sub-checkin .ck-out ul { margin: 5px 0 5px 18px; padding: 0; }
#sub-checkin .ck-out li { margin: 3px 0; }
#sub-checkin .ck-out p { margin: 6px 0; }
#sub-checkin .ck-out hr { border: 0; border-top: 1px dashed var(--ck-line); margin: 11px 0; }
#sub-checkin .ck-out code {
  background: rgba(180, 130, 80, .12);
  padding: 1px 5px;
  border-radius: 5px;
  font-size: 12.5px;
}
#sub-checkin .ck-out .ck-strong-line { font-weight: 800; color: var(--ck-ink); }
#sub-checkin .ck-out .ck-warn { color: var(--ck-gold); font-weight: 700; }

#sub-checkin .ck-out-foot {
  margin-top: 12px;
  padding-top: 11px;
  border-top: 1px solid var(--ck-line);
  display: flex;
  gap: 9px;
}
#sub-checkin .ck-out-foot button {
  flex: 1;
  padding: 10px 0;
  border-radius: 11px;
  border: 1.5px solid rgba(249, 89, 1, .35);
  background: #fff;
  color: var(--ck-brand);
  font-size: 13px;
  font-weight: 700;
  cursor: pointer;
}
#sub-checkin .ck-out-foot button.solid {
  background: linear-gradient(135deg, var(--ck-brand2), var(--ck-brand));
  color: #fff;
  border-color: transparent;
}

#sub-checkin .ck-stream-hint {
  margin-top: 9px;
  font-size: 11.5px;
  color: var(--ck-ink3);
  display: flex;
  align-items: center;
  gap: 6px;
}
#sub-checkin .ck-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  background: var(--ck-brand);
  animation: ckBlink 1.1s infinite;
}
@keyframes ckBlink { 0%, 100% { opacity: .25; } 50% { opacity: 1; } }

#sub-checkin .ck-ai-old {
  margin-top: 9px;
  font-size: 11.5px;
  color: var(--ck-ink3);
}

/* ===================== 习惯编辑弹层 ===================== */
/* 🔴 z-index 必须**高于底部 TabBar**（实测 TabBar = 60，且它在 DOM 里排在所有
   subpanel 之后，同层级时后出现者胜 → 弹层会被压在下面，底部的「保存」按钮
   点不到，点下去会落到 TabBar 上切走板块）。2026-09-19 E2E 实测踩到。 */
#sub-checkin .ck-mask {
  position: fixed;
  inset: 0;
  z-index: 100;
  background: rgba(40, 22, 8, .42);
  display: flex;
  align-items: flex-end;
  justify-content: center;
}
#sub-checkin .ck-sheet {
  width: 100%;
  max-width: 520px;
  max-height: 86vh;
  overflow-y: auto;
  /* 底部多留一截：即便弹层拉到最底，操作按钮也不会贴到 TabBar 后面 */
  padding: 18px 16px calc(34px + env(safe-area-inset-bottom, 0px));
  border-radius: 20px 20px 0 0;
  background: #fffdfa;
  box-shadow: 0 -8px 30px rgba(60, 30, 10, .2);
  animation: ckUp .24s ease;
}
@keyframes ckUp { from { transform: translateY(18px); opacity: .6; } to { transform: translateY(0); opacity: 1; } }
#sub-checkin .ck-sheet-t {
  font-size: 16px;
  font-weight: 800;
  color: var(--ck-ink);
  display: flex;
  align-items: center;
  justify-content: space-between;
}
#sub-checkin .ck-sheet-x {
  font-size: 22px;
  color: var(--ck-ink3);
  cursor: pointer;
  line-height: 1;
  padding: 0 4px;
}
#sub-checkin .ck-field { margin-top: 13px; }
#sub-checkin .ck-label { font-size: 12px; font-weight: 700; color: var(--ck-ink2); }
#sub-checkin .ck-label span { font-weight: 400; color: var(--ck-ink3); }
#sub-checkin .ck-field input {
  margin-top: 6px;
  width: 100%;
  box-sizing: border-box;
  padding: 11px 12px;
  border-radius: 11px;
  border: 1px solid var(--ck-line);
  background: #fff;
  font-size: 14px;
  color: var(--ck-ink);
  font-family: inherit;
}
#sub-checkin .ck-field input:focus { outline: none; border-color: rgba(249, 89, 1, .45); }
#sub-checkin .ck-icos { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }
#sub-checkin .ck-ico-pick {
  width: 38px; height: 38px;
  border-radius: 11px;
  border: 1px solid var(--ck-line);
  background: #fff;
  font-size: 19px;
  display: flex; align-items: center; justify-content: center;
  cursor: pointer;
}
#sub-checkin .ck-ico-pick.on { border-color: var(--ck-brand); background: var(--ck-brand-soft); }
#sub-checkin .ck-cats { display: flex; gap: 6px; margin-top: 6px; }
#sub-checkin .ck-cat {
  flex: 1;
  text-align: center;
  padding: 9px 0;
  border-radius: 11px;
  border: 1px solid var(--ck-line);
  background: #fff;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ck-ink2);
  cursor: pointer;
}
#sub-checkin .ck-cat.on { border-color: var(--ck-brand); color: var(--ck-brand); background: var(--ck-brand-soft); }
#sub-checkin .ck-sheet-foot {
  margin-top: 18px;
  display: flex;
  gap: 10px;
}
#sub-checkin .ck-sheet-foot button {
  flex: 1;
  padding: 13px 0;
  border-radius: 13px;
  border: 0;
  font-size: 14.5px;
  font-weight: 800;
  cursor: pointer;
}
#sub-checkin .ck-sheet-foot .danger { flex: 0 0 88px; background: rgba(200, 60, 30, .10); color: #b5341a; }
#sub-checkin .ck-sheet-foot .save { background: linear-gradient(135deg, var(--ck-brand2), var(--ck-brand)); color: #fff; }

/* 平板 / 桌面：加宽一点，别让卡片拉成一条 */
@media (min-width: 768px) {
  #sub-checkin .ck-list,
  #sub-checkin .ck-heat-wrap,
  #sub-checkin .ck-panel,
  #sub-checkin .ck-out,
  #sub-checkin .ck-sum { max-width: 720px; margin-left: auto; margin-right: auto; }
  #sub-checkin .ck-seg { max-width: 460px; margin-left: auto; margin-right: auto; }
  #sub-checkin .ck-sec-t { max-width: 720px; margin-left: auto; margin-right: auto; }
}

/* ===========================================================================
 * 数值型习惯（2026-09-19 用户反馈后补）
 * ---------------------------------------------------------------------------
 * 用户原话：「我戒烟打卡记录，我减肥打卡，记录体重变化，我运动打卡记录，
 *           这不应该是我自定义的吗」
 * 两点都是硬伤，一起补：
 *   ① 打勾记不了"几根烟 / 多少公斤"——必须有**数值**和**趋势**；
 *   ② 「自己定义习惯」的入口原来藏在「数据」页底部一行小字里，用户根本找不到。
 * =========================================================================== */

/* ---------- ① 今天页常驻的「新建习惯」（原来只有空状态和藏起来的链接） ---------- */
#sub-checkin .ck-new-btn {
  display: block;
  width: calc(100% - 28px);
  margin: 14px auto 0;
  padding: 13px 0;
  border: 1.5px dashed rgba(249, 89, 1, .42);
  border-radius: 15px;
  background: rgba(249, 89, 1, .05);
  color: var(--ck-brand);
  font-size: 14.5px;
  font-weight: 800;
  letter-spacing: .3px;
  cursor: pointer;
  transition: background .16s, border-color .16s;
}
#sub-checkin .ck-new-btn:active { background: rgba(249, 89, 1, .12); }
#sub-checkin .ck-add-btn.ghost {
  margin-top: 9px;
  background: #fff;
  color: var(--ck-brand);
  border: 1.5px solid rgba(249, 89, 1, .40);
  box-shadow: none;
}

/* ---------- ② 弹层：类型 / 单位 / 方向 ---------- */
#sub-checkin .ck-types,
#sub-checkin .ck-dirs { display: flex; gap: 6px; margin-top: 6px; }
#sub-checkin .ck-type,
#sub-checkin .ck-dir {
  flex: 1;
  text-align: center;
  padding: 10px 0;
  border-radius: 11px;
  border: 1.5px solid var(--ck-line);
  background: #fff;
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ck-ink2);
  cursor: pointer;
  transition: border-color .16s, color .16s, background .16s;
  -webkit-tap-highlight-color: transparent;
}
#sub-checkin .ck-type.on,
#sub-checkin .ck-dir.on {
  border-color: var(--ck-brand);
  color: var(--ck-brand);
  background: var(--ck-brand-soft);
}
#sub-checkin .ck-num-fields {
  margin-top: 2px;
  padding: 12px 12px 4px;
  border-radius: 14px;
  background: rgba(249, 89, 1, .05);
  border: 1px dashed rgba(249, 89, 1, .30);
}
#sub-checkin .ck-units { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 8px; }
#sub-checkin .ck-unit-chip {
  padding: 5px 11px;
  border-radius: 9px;
  background: #fff;
  border: 1px solid var(--ck-line);
  font-size: 12px;
  color: var(--ck-ink2);
  cursor: pointer;
}
#sub-checkin .ck-unit-chip:active { border-color: var(--ck-brand); color: var(--ck-brand); }

/* ---------- ③ 记录数字的弹窗 ---------- */
#sub-checkin .ck-num-box {
  width: 100%;
  max-width: 480px;
  margin: auto 12px 0;
  padding: 20px 18px calc(26px + env(safe-area-inset-bottom, 0px));
  border-radius: 22px 22px 0 0;
  background: #fffdfa;
  box-shadow: 0 -8px 30px rgba(60, 30, 10, .22);
  animation: ckUp .22s ease;
}
#sub-checkin .ck-num-t {
  font-size: 16px;
  font-weight: 800;
  color: var(--ck-ink);
  text-align: center;
}
#sub-checkin .ck-num-sub {
  margin-top: 5px;
  font-size: 11.5px;
  color: var(--ck-ink3);
  text-align: center;
  line-height: 1.5;
  min-height: 16px;
}
/* ⚠️ 类名不要叫 .ck-num-row —— 数据页的「数值型趋势行」已经占用了那个名字，
   撞名会让趋势行继承这里的 flex 居中布局（标题和折线被横排），显示直接乱掉。 */
#sub-checkin .ck-nb-row {
  display: flex;
  align-items: baseline;
  justify-content: center;
  gap: 8px;
  margin-top: 16px;
}
#sub-checkin .ck-num-in {
  width: 168px;
  padding: 10px 12px;
  border: 0;
  border-bottom: 2.5px solid var(--ck-brand);
  background: transparent;
  font-size: 36px;
  font-weight: 900;
  color: var(--ck-ink);
  text-align: center;
  letter-spacing: -.5px;
  font-family: inherit;
}
#sub-checkin .ck-num-in:focus { outline: none; }
/* 去掉数字输入框的上下箭头（手机上根本点不到，还占位） */
#sub-checkin .ck-num-in::-webkit-outer-spin-button,
#sub-checkin .ck-num-in::-webkit-inner-spin-button { -webkit-appearance: none; margin: 0; }
#sub-checkin .ck-num-unit { font-size: 16px; font-weight: 800; color: var(--ck-ink2); }
#sub-checkin .ck-num-quick { display: flex; justify-content: center; gap: 8px; margin-top: 14px; }
#sub-checkin .ck-num-chip {
  padding: 7px 13px;
  border-radius: 10px;
  background: rgba(249, 89, 1, .10);
  color: var(--ck-brand);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
#sub-checkin .ck-num-foot { display: flex; gap: 10px; margin-top: 18px; }
#sub-checkin .ck-num-foot button {
  flex: 1;
  padding: 13px 0;
  border-radius: 13px;
  font-size: 15px;
  font-weight: 800;
  cursor: pointer;
}
#sub-checkin .ck-num-foot .ghost {
  border: 1.5px solid var(--ck-line);
  background: #fff;
  color: var(--ck-ink2);
}
#sub-checkin .ck-num-foot .solid {
  border: 0;
  background: linear-gradient(135deg, var(--ck-brand2), var(--ck-brand));
  color: #fff;
  box-shadow: 0 5px 14px rgba(249, 89, 1, .26);
}

/* ---------- ④ 卡片上的数值与变化 ---------- */
#sub-checkin .ck-delta { font-size: 11px; font-weight: 800; }
#sub-checkin .ck-delta.good { color: #0f766e; }   /* 朝想要的方向走 */
#sub-checkin .ck-delta.bad { color: #c2410c; }    /* 朝反方向走 */
#sub-checkin .ck-card.num .ck-btn { font-size: 22px; font-weight: 400; }

/* ---------- ⑤ 数据页：数值型折线 ---------- */
#sub-checkin .ck-num-row {
  padding: 12px 0;
  border-bottom: 1px dashed var(--ck-line);
}
#sub-checkin .ck-num-row:last-of-type { border-bottom: 0; }
#sub-checkin .ck-num-row-t {
  font-size: 12.5px;
  font-weight: 700;
  color: var(--ck-ink);
  display: flex;
  align-items: baseline;
  gap: 6px;
  flex-wrap: wrap;
}
#sub-checkin .ck-num-row-t b { font-size: 15px; font-weight: 900; color: var(--ck-ink); }
#sub-checkin .ck-num-row-t b.good { color: #0f766e; }
#sub-checkin .ck-num-row-t b.bad { color: #c2410c; }
#sub-checkin .ck-num-row-f { margin-top: 5px; font-size: 10.5px; color: var(--ck-ink3); }
#sub-checkin .ck-trend { display: block; width: 100%; height: 44px; margin-top: 8px; }
#sub-checkin .ck-trend-none {
  margin-top: 8px;
  padding: 9px 0;
  text-align: center;
  font-size: 11px;
  color: var(--ck-ink3);
  background: rgba(180, 130, 80, .07);
  border-radius: 9px;
}

/* ---------- ⑥ 模板上的「记数字」标识 ---------- */
#sub-checkin .ck-tpl-num {
  margin-left: 6px;
  padding: 1px 6px;
  border-radius: 7px;
  background: rgba(249, 89, 1, .12);
  color: var(--ck-brand);
  font-size: 10px;
  font-weight: 700;
  white-space: nowrap;
}

/* ===========================================================================
 * v3 简化（2026-09-19 用户反馈：「还是有点复杂，没看懂。别搞那么复杂，要简单易上手」）
 * ---------------------------------------------------------------------------
 * 两处减法，功能一个没少：
 *   ① 新建习惯：9 个字段 → 默认只露 2 个（名字 / 怎么记），
 *      其余 5 项折叠进「更多设置」（都有合理默认值，想细调再点开）；
 *   ② 每张卡：4 行 → 2 行。「最低标准」收成一个 🪶 小圆按钮 ——
 *      这个设计本身是好东西（没状态那天不让链子断），但摊成两行字太吵。
 * =========================================================================== */

/* ---------- 卡片上的「最低标准」小按钮 🪶 ---------- */
#sub-checkin .ck-soft {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  margin-right: 8px;
  border-radius: 50%;
  border: 1px dashed rgba(249, 89, 1, .38);
  background: #fff;
  font-size: 15px;
  line-height: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  opacity: .85;
  -webkit-tap-highlight-color: transparent;
}
#sub-checkin .ck-soft:active { transform: scale(.9); opacity: 1; }

/* ---------- 「更多设置」折叠区 ---------- */
#sub-checkin .ck-more-btn {
  display: block;
  width: 100%;
  margin-top: 16px;
  padding: 11px 0;
  border: 0;
  border-radius: 12px;
  background: rgba(180, 130, 80, .09);
  color: var(--ck-ink2);
  font-size: 12.5px;
  font-weight: 700;
  cursor: pointer;
}
#sub-checkin .ck-more-btn:active { background: rgba(180, 130, 80, .16); }
#sub-checkin .ck-more { margin-top: 4px; }

/* 名字右边挂的「连续天数」也收小一点（原来是"🔥 2 天"，占宽） */
#sub-checkin .ck-fire {
  font-size: 10px;
  padding: 1px 5px;
  margin-left: 5px;
}
