/* 首页 topbar 下方的「最近要办」只读预览 */
.up-box {
  margin-top: 14px; background: var(--card); border-radius: 14px; padding: 9px 14px 10px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .045);
}
.up-hd { font-size: 11px; color: var(--text-3); letter-spacing: 1px; }
.up-item { display: flex; align-items: baseline; gap: 10px; padding: 6px 0; }
.up-item + .up-item { border-top: 1px dashed var(--line); }
.up-title {
  flex: 1; min-width: 0; font-size: 14px; font-weight: 600; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.up-due { flex: 0 0 auto; font-size: 12px; color: var(--text-2); }
.up-due.soon { color: #e8871a; font-weight: 600; }
.up-due.overdue { color: var(--red); font-weight: 700; }

/* 任务清单面板样式（只在首页 index.html 加载；颜色变量沿用 index.html 的 :root） */

/* 顶部：大按钮 + 右上翻转小按钮 */
.tk-top { display: flex; gap: 10px; margin-top: 18px; }
.tk-add {
  flex: 1; height: 60px; border: none; border-radius: 16px;
  background: linear-gradient(135deg, #00c98e, #00985f); color: #fff;
  font-size: 17px; font-weight: 700; letter-spacing: 2px; cursor: pointer;
  font-family: inherit; box-shadow: 0 6px 18px rgba(0, 181, 120, .28);
  transition: transform .1s, opacity .15s;
}
.tk-add:active { transform: scale(.98); }
.tk-add:disabled { opacity: .6; }
.tk-switch {
  flex: 0 0 auto; min-width: 82px; padding: 0 12px; border-radius: 16px;
  border: 1.5px solid var(--line); background: var(--card); color: var(--text-2);
  font-family: inherit; font-size: 12px; cursor: pointer; line-height: 1.2;
}
.tk-switch .tk-switch-to { display: block; font-size: 14px; font-weight: 700; color: var(--green); margin-top: 2px; }
.tk-switch:active { background: #f7f8fa; }

/* 逾期提示条 */
.tk-overdue {
  display: none; margin-top: 12px; padding: 9px 12px; border-radius: 12px;
  background: #fff1f0; border: 1px solid #ffd8d6; color: #d33a2c; font-size: 13px;
}
.tk-overdue.show { display: block; }

.tk-label { font-size: 12px; color: var(--text-3); margin: 16px 2px 8px; }

/* 列表项：标题一行 + 详情（截断）与截止日期同一行 */
.tk-item {
  background: var(--card); border-radius: 14px; padding: 13px 14px; margin-bottom: 10px;
  box-shadow: 0 3px 14px rgba(0, 0, 0, .045); cursor: pointer; border: 1.5px solid transparent;
  transition: transform .1s;
}
.tk-item:active { transform: scale(.99); }
.tk-item .t-title {
  font-size: 15px; font-weight: 700; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tk-item .t-row2 { display: flex; align-items: baseline; gap: 10px; margin-top: 5px; }
.tk-item .t-detail {
  flex: 1; min-width: 0; font-size: 13px; color: var(--text-3);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.tk-item .t-due { flex: 0 0 auto; font-size: 12px; color: var(--text-2); }
.tk-item .t-due.soon { color: #e8871a; font-weight: 600; }
.tk-item .t-due.overdue { color: var(--red); font-weight: 700; }
.tk-item.is-done .t-title { text-decoration: line-through; color: var(--text-3); }
.tk-item.is-done .t-due { color: var(--text-3); font-weight: 400; }
.tk-empty { color: var(--text-3); font-size: 14px; text-align: center; padding: 36px 0; }

/* tab 上的未完成数量角标 */
.tab-badge {
  display: inline-block; min-width: 18px; padding: 1px 5px; margin-left: 4px;
  border-radius: 999px; background: rgba(0, 181, 120, .12); color: var(--green);
  font-size: 11px; font-weight: 700; vertical-align: 1px;
}

/* 弹窗卡片（新建 / 查看编辑） */
.tk-mask {
  position: fixed; inset: 0; background: rgba(0, 0, 0, .42); z-index: 60;
  display: flex; align-items: center; justify-content: center; padding: 18px;
}
.tk-modal {
  width: 100%; max-width: 420px; max-height: 86vh; overflow-y: auto;
  background: #fff; border-radius: 18px; padding: 18px 18px 16px;
  box-shadow: 0 12px 40px rgba(0, 0, 0, .22);
}
.tk-modal h3 { font-size: 16px; font-weight: 700; }
.tk-meta { font-size: 12px; color: var(--text-3); margin-top: 6px; line-height: 1.6; }
.tk-field { margin-top: 14px; }
.tk-field label { display: block; font-size: 12px; color: var(--text-2); margin-bottom: 6px; }
.tk-field input, .tk-field textarea {
  width: 100%; border: 1.5px solid var(--line); border-radius: 12px; padding: 10px 12px;
  font-size: 15px; background: #fafbfc; color: var(--text); outline: none; font-family: inherit;
}
.tk-field input { height: 44px; padding: 0 12px; }
.tk-field textarea { min-height: 88px; resize: vertical; line-height: 1.6; }
.tk-field input:focus, .tk-field textarea:focus {
  border-color: var(--green); background: #fff; box-shadow: 0 0 0 3px rgba(0, 181, 120, .12);
}
.tk-field .tk-tip { font-size: 11px; color: var(--text-3); margin-top: 5px; }

/* 历法 / 重复 的点选条（配置项用 chips，不当操作按钮） */
.tk-sublabel { font-size: 12px; color: var(--text-2); margin: 12px 0 0; }
.tk-chips { display: flex; flex-wrap: wrap; gap: 8px; margin-top: 8px; }
.tk-chip {
  height: 34px; padding: 0 14px; border-radius: 10px; border: 1.5px solid var(--line);
  background: #fff; color: var(--text-2); font-size: 13px; font-family: inherit; cursor: pointer;
  transition: border-color .12s, background .12s;
}
.tk-chip.on { border-color: var(--green); background: #e8f7f0; color: var(--green-dark); font-weight: 700; }
.tk-chip:active { border-color: var(--green); }

/* 农历的年/月/日 */
.tk-lunar-row { display: flex; gap: 8px; margin-top: 8px; flex-wrap: wrap; }
.tk-lunar-row select {
  flex: 1; min-width: 84px; height: 44px; padding: 0 10px; border-radius: 12px;
  border: 1.5px solid var(--line); font-size: 15px; background: #fafbfc; color: var(--text);
  font-family: inherit; outline: none; appearance: none; -webkit-appearance: none;
}
.tk-lunar-row select:focus { border-color: var(--green); background: #fff; }
.tk-lunar-row .tk-tip { flex: 1 0 100%; }

/* 规则换算出来的日期回显（后端算的，前端不重复推一遍） */
.tk-preview { font-size: 12px; color: var(--green-dark); margin-top: 8px; min-height: 16px; line-height: 1.5; }
.tk-preview.bad { color: var(--red); }

/* 重复标记：列表与「最近要办」上的小标签 */
.t-recur, .up-recur {
  display: inline-block; margin-left: 6px; padding: 1px 6px; border-radius: 6px;
  background: #eef4ff; color: #3568d8; font-size: 10px; font-weight: 600; vertical-align: middle;
}

/* 已完成列表的分页提示 */
.tk-more { text-align: center; font-size: 12px; color: var(--text-3); padding: 10px 0 16px; }
.tk-state {
  margin-top: 16px; width: 100%; height: 46px; border: none; border-radius: 12px;
  background: #e8f7f0; color: var(--green-dark); font-size: 15px; font-weight: 700;
  cursor: pointer; font-family: inherit;
}
.tk-actions { display: flex; gap: 10px; margin-top: 14px; }
.tk-btn {
  flex: 1; height: 46px; border: none; border-radius: 12px;
  font-size: 15px; font-weight: 700; cursor: pointer; font-family: inherit;
}
.tk-btn:disabled { opacity: .6; }
.tk-btn.ghost { background: #f2f3f5; color: var(--text-2); flex: 0 0 92px; }
.tk-btn.primary { background: linear-gradient(135deg, #00c98e, #00985f); color: #fff; }
.tk-btn.danger { background: none; color: var(--red); flex: 0 0 60px; font-weight: 600; }

/* 轻提示 */
.tk-toast {
  position: fixed; left: 50%; top: 16%; transform: translateX(-50%); z-index: 90;
  background: rgba(31, 35, 41, .92); color: #fff; font-size: 14px; padding: 10px 22px;
  border-radius: 22px; opacity: 0; pointer-events: none; transition: opacity .25s; max-width: 80vw;
}
.tk-toast.show { opacity: 1; }
