/* =====================================================================
 * checkin.css — 打卡 APP 样式 (独立模块)
 * 设计语言：日记与打卡.html 原型 —— 单色 zinc + 白色卡片 + Lucide 风格图标
 * ===================================================================== */

#checkin-screen {
  --ck-bg: #fafafa;
  --ck-card: #ffffff;
  --ck-border: #f4f4f5;        /* zinc-100 */
  --ck-border-strong: #e4e4e7; /* zinc-200 */
  --ck-text: #18181b;          /* zinc-900 */
  --ck-sub: #a1a1aa;           /* zinc-400 */
  --ck-sub-2: #71717a;         /* zinc-500 */
  --ck-accent: #18181b;        /* 主色 = 近黑 */
  --ck-accent-soft: #f4f4f5;
  --ck-amber: #f59e0b;
}

/* ---------- 屏幕显示/隐藏 (对齐 main.little.js 的 show-* 机制) ---------- */
#checkin-screen {
  display: flex;
  flex-direction: column;
  height: 100%;
  overflow: hidden;
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transform: scale(0.92);
  background: #ffffff;
}

.phone-frame.show-checkin #checkin-screen {
  opacity: 1;
  pointer-events: auto;
  z-index: 2;
  transform: scale(1);
}

/* 打开打卡时主屏退后 */
.phone-frame.show-checkin #home-screen {
  opacity: 0;
  pointer-events: none;
  z-index: 1;
  transform: scale(0.92);
  filter: brightness(0.8);
}

/* ---------- App 骨架 ---------- */
.ck-app {
  height: 100%;
  display: flex;
  flex-direction: column;
  background: var(--ck-bg);
  color: var(--ck-text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Helvetica Neue", sans-serif;
  -webkit-font-smoothing: antialiased;
}

/* ---------- 顶部导航 (距状态栏留白，参考讯息 App) ---------- */
.ck-nav {
  flex: 0 0 auto;
  position: relative;
  display: flex;
  align-items: center;
  padding: 48px 10px 10px;
  background: rgba(255, 255, 255, 0.82);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-bottom: 0.5px solid var(--ck-border);
  box-sizing: border-box;
}
.ck-nav-back,
.ck-nav-add {
  flex: 0 0 auto;
  width: 38px;
  height: 38px;
  display: flex;
  align-items: center;
  justify-content: center;
  border: none;
  background: transparent;
  color: var(--ck-text);
  cursor: pointer;
  border-radius: 10px;
  -webkit-tap-highlight-color: transparent;
}
.ck-nav-back svg,
.ck-nav-add svg {
  width: 22px;
  height: 22px;
}
.ck-nav-back:active,
.ck-nav-add:active { background: rgba(0, 0, 0, 0.06); }
.ck-nav-title {
  flex: 1 1 auto;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ck-nav-add { display: flex; visibility: hidden; }

/* ---------- 主体 ---------- */
.ck-body {
  flex: 1 1 auto;
  min-height: 0;
  position: relative;
  overflow: hidden;
}

.ck-view {
  position: absolute;
  inset: 0;
  display: none;
  overflow-y: auto;
  overflow-x: hidden;
  padding: 16px 16px 28px;
  box-sizing: border-box;
}
.ck-view.active { display: block; }

.ck-scroll {
  -webkit-overflow-scrolling: touch;
  overscroll-behavior: contain;
}
.ck-scroll::-webkit-scrollbar { display: none; }

/* ---------- 底部页签 ---------- */
.ck-tabbar {
  flex: 0 0 auto;
  display: flex;
  align-items: stretch;
  padding-bottom: env(safe-area-inset-bottom, 0px);
  background: rgba(255, 255, 255, 0.92);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  border-top: 0.5px solid var(--ck-border);
}
.ck-tab {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 3px;
  height: 56px;
  border: none;
  background: transparent;
  color: var(--ck-sub);
  font-size: 10px;
  font-weight: 500;
  cursor: pointer;
  -webkit-tap-highlight-color: transparent;
}
.ck-tab-icon {
  display: flex;
  align-items: center;
  justify-content: center;
}
.ck-tab-icon svg { width: 22px; height: 22px; }
.ck-tab.active { color: var(--ck-text); }
.ck-tab:active { opacity: 0.55; }

/* ---------- 空状态 ---------- */
.ck-empty {
  padding: 64px 24px;
  text-align: center;
  color: var(--ck-sub);
}
.ck-empty p { font-size: 14px; margin: 0 0 18px; }
.ck-empty-btn {
  padding: 10px 22px;
  border: none;
  border-radius: 12px;
  background: var(--ck-accent);
  color: #fff;
  font-size: 14px;
  font-weight: 600;
  cursor: pointer;
}
.ck-empty-btn:active { opacity: 0.85; }

/* ---------- 通用彩色圆点 (习惯色标识，替代 emoji) ---------- */
.ck-dot {
  flex: 0 0 auto;
  width: 8px;
  height: 8px;
  border-radius: 50%;
}

/* =====================================================================
 * 今日视图
 * ===================================================================== */
.ck-today-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ck-today-date { font-size: 15px; font-weight: 600; }
.ck-today-count {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ck-sub-2);
  background: var(--ck-border);
  padding: 4px 10px;
  border-radius: 999px;
  font-weight: 500;
}
.ck-today-count b { color: var(--ck-text); font-weight: 600; }
.ck-progress {
  height: 6px;
  border-radius: 3px;
  background: var(--ck-border);
  overflow: hidden;
  margin-bottom: 20px;
}
.ck-progress-fill {
  height: 100%;
  border-radius: 3px;
  background: var(--ck-accent);
  transition: width 0.3s ease;
}

.ck-today-list { display: flex; flex-direction: column; gap: 10px; }

.ck-habit-row {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 14px;
  background: var(--ck-card);
  border: 1px solid var(--ck-border);
  border-radius: 16px;
  cursor: pointer;
  transition: background 0.15s ease, transform 0.1s ease;
}
.ck-habit-row:active { transform: scale(0.99); }
.ck-habit-row.done { background: #fafafa; border-color: transparent; }
.ck-habit-row.done .ck-habit-name { text-decoration: line-through; color: var(--ck-sub); }

.ck-check {
  flex: 0 0 auto;
  width: 36px;
  height: 36px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  border: 2px solid var(--ck-border-strong);
  background: #fff;
  color: transparent;
  cursor: pointer;
  transition: all 0.18s ease;
}
.ck-check svg { width: 20px; height: 20px; }
.ck-check.checked {
  background: var(--ck-accent);
  border-color: var(--ck-accent);
  color: #fff;
}

.ck-habit-info { flex: 1 1 auto; min-width: 0; }
.ck-habit-name {
  display: flex;
  align-items: center;
  gap: 7px;
  min-width: 0;
  font-size: 15px;
  font-weight: 500;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}
.ck-habit-name span:last-child {
  overflow: hidden;
  text-overflow: ellipsis;
  min-width: 0;
}
.ck-habit-meta { font-size: 12px; color: var(--ck-sub); margin-top: 3px; }
.ck-habit-streak {
  display: flex;
  align-items: center;
  gap: 4px;
  font-size: 12px;
  color: var(--ck-amber);
  margin-top: 3px;
  font-weight: 500;
}
.ck-habit-streak svg { width: 13px; height: 13px; }

/* =====================================================================
 * 统计视图
 * ===================================================================== */
.ck-seg {
  display: flex;
  background: var(--ck-border);
  border-radius: 11px;
  padding: 3px;
  margin-bottom: 16px;
}
.ck-seg-btn {
  flex: 1;
  padding: 7px 0;
  border: none;
  border-radius: 8px;
  background: transparent;
  color: var(--ck-sub);
  font-size: 13px;
  font-weight: 600;
  cursor: pointer;
}
.ck-seg-btn.active { background: #fff; color: var(--ck-text); box-shadow: 0 1px 3px rgba(0, 0, 0, 0.10); }

.ck-stat-overview { margin-bottom: 20px; }

.ck-week-nav,
.ck-month-nav,
.ck-year-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 12px;
}
.ck-nav-btn {
  width: 32px;
  height: 32px;
  border: none;
  border-radius: 8px;
  background: var(--ck-border);
  color: var(--ck-text);
  font-size: 18px;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
}
.ck-nav-btn:active { background: var(--ck-border-strong); }
.ck-week-title, .ck-month-title, .ck-year-title { font-size: 14px; font-weight: 600; }

/* --- 周视图 --- */
.ck-week-table {
  background: var(--ck-card);
  border: 1px solid var(--ck-border);
  border-radius: 16px;
  padding: 12px 8px;
}
.ck-week-head {
  display: flex;
  align-items: center;
  border-bottom: 0.5px solid var(--ck-border);
  padding-bottom: 10px;
  margin-bottom: 4px;
}
.ck-week-name-col { flex: 0 0 36%; }
.ck-week-day {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
}
.ck-wd-dow { font-size: 10px; color: var(--ck-sub); }
.ck-wd-num {
  font-size: 14px;
  font-weight: 600;
  width: 26px;
  height: 26px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 50%;
}
.ck-week-day.today .ck-wd-num { background: var(--ck-accent); color: #fff; }

.ck-week-row { display: flex; align-items: center; padding: 7px 0; }
.ck-week-name {
  flex: 0 0 36%;
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  white-space: nowrap;
  overflow: hidden;
}
.ck-week-name span:last-child { overflow: hidden; text-overflow: ellipsis; }
.ck-week-cell { flex: 1 1 0; display: flex; align-items: center; justify-content: center; }
.ck-week-fill {
  width: 22px;
  height: 22px;
  border-radius: 7px;
}

/* --- 月视图 --- */
.ck-month-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 3px;
}
.ck-month-dow {
  text-align: center;
  font-size: 11px;
  color: var(--ck-sub);
  padding: 4px 0;
}
.ck-month-day {
  min-height: 58px;
  background: var(--ck-card);
  border: 1px solid var(--ck-border);
  border-radius: 8px;
  padding: 4px 3px;
  display: flex;
  flex-direction: column;
  gap: 2px;
  overflow: hidden;
}
.ck-month-day.empty { background: transparent; border-color: transparent; }
.ck-month-day.today { border-color: var(--ck-text); }
.ck-md-num { font-size: 11px; color: var(--ck-sub); }
.ck-md-bars { display: flex; flex-direction: column; gap: 2px; }
.ck-md-bar {
  display: flex;
  align-items: center;
  gap: 3px;
  font-size: 9px;
  padding: 1px 5px;
  border-radius: 5px;
  white-space: nowrap;
  overflow: hidden;
  color: rgba(0, 0, 0, 0.72);
}
.ck-md-bar span { overflow: hidden; text-overflow: ellipsis; }

/* --- 年视图 --- */
.ck-year-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.ck-year-cell {
  background: var(--ck-card);
  border: 1px solid var(--ck-border);
  border-radius: 12px;
  padding: 12px 10px;
  text-align: center;
}
.ck-year-cell.level-0 { background: #fafafa; }
.ck-year-cell.level-1 { background: #f0f0f1; }
.ck-year-cell.level-2 { background: #e4e4e7; }
.ck-year-cell.level-3 { background: #d4d4d8; }
.ck-year-mon { display: block; font-size: 11px; color: var(--ck-sub); }
.ck-year-count { display: block; font-size: 20px; font-weight: 600; margin-top: 2px; }

/* --- 各习惯图表 --- */
.ck-charts-title {
  font-size: 13px;
  font-weight: 600;
  color: var(--ck-sub);
  text-transform: uppercase;
  letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.ck-chart-card {
  background: var(--ck-card);
  border: 1px solid var(--ck-border);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
}
.ck-chart-head {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 12px;
}
.ck-chart-name { flex: 1 1 auto; font-size: 14px; font-weight: 600; }
.ck-chart-rate { font-size: 14px; font-weight: 600; color: var(--ck-text); }
.ck-chart-row { display: flex; align-items: center; gap: 16px; }
.ck-donut { flex: 0 0 auto; width: 84px; height: 84px; }
.ck-bars {
  flex: 1 1 auto;
  display: flex;
  align-items: flex-end;
  justify-content: space-between;
  gap: 6px;
  height: 70px;
}
.ck-bar-col {
  flex: 1 1 0;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: flex-end;
  gap: 4px;
  height: 100%;
}
.ck-bar {
  width: 100%;
  max-width: 18px;
  height: 6px;
  border-radius: 3px;
  background: var(--ck-border-strong);
}
.ck-bar.on { background: var(--ck-accent); }
.ck-bar-col span { font-size: 9px; color: var(--ck-sub); }

/* =====================================================================
 * 习惯列表
 * ===================================================================== */
.ck-habits-list { display: flex; flex-direction: column; gap: 10px; }
.ck-habit-item {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px;
  background: var(--ck-card);
  border: 1px solid var(--ck-border);
  border-radius: 16px;
  cursor: pointer;
}
.ck-habit-item:active { transform: scale(0.99); }
.ck-habit-color-dot { flex: 0 0 auto; width: 12px; height: 12px; border-radius: 50%; }
.ck-item-more {
  flex: 0 0 auto;
  border: none;
  background: transparent;
  color: var(--ck-sub);
  font-size: 20px;
  cursor: pointer;
  width: 28px;
  height: 28px;
  display: flex;
  align-items: center;
  justify-content: center;
}

/* =====================================================================
 * 用户视图
 * ===================================================================== */
.ck-user-card {
  background: var(--ck-card);
  border: 1px solid var(--ck-border);
  border-radius: 16px;
  overflow: hidden;
}
.ck-user-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 16px;
  cursor: pointer;
}
.ck-user-row-label { font-size: 15px; }
.ck-user-row-value { font-size: 14px; color: var(--ck-sub); display: flex; align-items: center; gap: 2px; }
.ck-user-divider { height: 0.5px; background: var(--ck-border); margin-left: 16px; }
.ck-user-hint {
  padding: 0 16px 16px;
  font-size: 12px;
  color: var(--ck-sub);
  line-height: 1.5;
}

.ck-switch {
  flex: 0 0 auto;
  position: relative;
  width: 51px;
  height: 31px;
  border-radius: 16px;
  background: var(--ck-border-strong);
  border: none;
  cursor: pointer;
  transition: background 0.25s ease;
}
.ck-switch.on { background: #34c759; }
.ck-switch-knob {
  position: absolute;
  top: 2px;
  left: 2px;
  width: 27px;
  height: 27px;
  border-radius: 50%;
  background: #fff;
  box-shadow: 0 2px 4px rgba(0, 0, 0, 0.25);
  transition: left 0.25s ease;
}
.ck-switch.on .ck-switch-knob { left: 22px; }

/* =====================================================================
 * 底部 sheet (用户选择器 / 确认)
 * ===================================================================== */
.ck-sheet-mask,
.ck-confirm-mask {
  position: absolute;
  inset: 0;
  z-index: 60;
  background: rgba(0, 0, 0, 0.34);
  display: flex;
  flex-direction: column;
  justify-content: flex-end;
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.25s ease;
}
.ck-sheet-mask.show { opacity: 1; pointer-events: auto; }
.ck-confirm-mask { align-items: center; justify-content: center; opacity: 1; pointer-events: auto; }

.ck-sheet {
  background: rgba(255, 255, 255, 0.96);
  -webkit-backdrop-filter: blur(20px);
  backdrop-filter: blur(20px);
  border-radius: 20px 20px 0 0;
  padding: 8px 12px calc(env(safe-area-inset-bottom, 0px) + 12px);
  transform: translateY(100%);
  transition: transform 0.3s cubic-bezier(0.32, 0.72, 0, 1);
}
.ck-sheet-mask.show .ck-sheet { transform: translateY(0); }
.ck-sheet-handle {
  width: 38px;
  height: 4px;
  border-radius: 2px;
  background: rgba(0, 0, 0, 0.16);
  margin: 4px auto 10px;
}
.ck-sheet-title {
  text-align: center;
  font-size: 13px;
  color: var(--ck-sub);
  margin-bottom: 6px;
}
.ck-sheet-list { max-height: 300px; overflow-y: auto; }
.ck-sheet-row {
  display: flex;
  align-items: center;
  gap: 12px;
  width: 100%;
  padding: 12px 8px;
  border: none;
  background: transparent;
  border-radius: 14px;
  font-size: 15px;
  color: var(--ck-text);
  text-align: left;
  cursor: pointer;
}
.ck-sheet-row:active { background: rgba(0, 0, 0, 0.06); }
.ck-sheet-avatar {
  flex: 0 0 auto;
  width: 34px;
  height: 34px;
  border-radius: 50%;
  background: var(--ck-border-strong) center/cover no-repeat;
}
.ck-sheet-name { flex: 1 1 auto; }
.ck-sheet-check { color: var(--ck-text); font-weight: 700; }
.ck-sheet-cancel {
  width: 100%;
  margin-top: 6px;
  padding: 14px;
  border: none;
  border-radius: 14px;
  background: var(--ck-border);
  font-size: 15px;
  font-weight: 600;
  color: var(--ck-text);
  cursor: pointer;
}

/* --- 切换 user 确认框 --- */
.ck-confirm {
  width: 82%;
  background: #fff;
  border-radius: 18px;
  padding: 20px 16px 12px;
  text-align: center;
}
.ck-confirm-title { font-size: 17px; font-weight: 600; margin-bottom: 10px; }
.ck-confirm-text {
  font-size: 13px;
  color: var(--ck-sub);
  line-height: 1.6;
  margin-bottom: 16px;
  text-align: left;
}
.ck-confirm-text b { color: var(--ck-text); }
.ck-confirm-btn {
  display: block;
  width: 100%;
  padding: 12px;
  border: none;
  border-radius: 12px;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  margin-bottom: 8px;
}
.ck-confirm-btn.copy { background: var(--ck-accent); color: #fff; }
.ck-confirm-btn.blank { background: var(--ck-accent-soft); color: var(--ck-text); }
.ck-confirm-btn:active { opacity: 0.82; }
.ck-confirm-cancel {
  width: 100%;
  padding: 10px;
  border: none;
  background: transparent;
  color: var(--ck-sub);
  font-size: 14px;
  cursor: pointer;
}

/* =====================================================================
 * 习惯编辑器 (全屏覆盖)
 *
 * 设计系统 (可验证约束)：
 *   - 间距：8px 栅格 (4/8/16/24)，卡片内边距与分组间距统一为 16px
 *   - 圆角：容器 16px / 控件 8px 两档
 *   - 阴影：分层柔和阴影，无硬描边；控件用灰底填充 + 聚焦描边环
 *   - 字体：标题 17/600 > 正文 15/400 > 辅助 12-13/400 三级
 *   - 配色：1 主色 (zinc-900) + 中性灰阶；红色仅用于破坏性操作
 *   - 布局：功能区(顶栏) / 编辑区(分组卡片) / 辅助信息(灰字) 三层分明
 * ===================================================================== */
.ck-editor-overlay {
  position: absolute;
  inset: 0;
  z-index: 70;
  background: var(--ck-bg);
  display: none;

  /* 编辑器专属设计令牌 */
  --ck-r-card: 16px;   /* 容器圆角 */
  --ck-r-ctl: 8px;     /* 控件圆角 */
  --ck-sh-card: 0 1px 2px rgba(0, 0, 0, 0.03), 0 4px 16px rgba(0, 0, 0, 0.05);
  --ck-sh-ctl: 0 1px 2px rgba(0, 0, 0, 0.04);
  --ck-sh-ring: 0 0 0 2px var(--ck-accent);
}
.ck-editor-overlay.show { display: block; }
.ck-editor { height: 100%; display: flex; flex-direction: column; }

/* ---------- 功能区：顶栏 ---------- */
.ck-editor-nav {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 48px 16px 8px;
  background: rgba(255, 255, 255, 0.86);
  -webkit-backdrop-filter: blur(20px) saturate(180%);
  backdrop-filter: blur(20px) saturate(180%);
  box-shadow: 0 1px 0 rgba(0, 0, 0, 0.04);
  box-sizing: border-box;
}
.ck-editor-title {
  flex: 1 1 auto;
  text-align: center;
  font-size: 17px;
  font-weight: 600;
  letter-spacing: -0.2px;
}
.ck-editor-cancel,
.ck-editor-save {
  flex: 0 0 auto;
  border: none;
  cursor: pointer;
  font-size: 15px;
  padding: 8px 16px;
  border-radius: var(--ck-r-ctl);
  -webkit-tap-highlight-color: transparent;
  transition: opacity 0.15s ease;
}
.ck-editor-cancel { background: transparent; color: var(--ck-sub); font-weight: 500; }
.ck-editor-cancel:active { opacity: 0.6; }
.ck-editor-save {
  background: var(--ck-accent);
  color: #fff;
  font-weight: 600;
  box-shadow: var(--ck-sh-ctl);
}
.ck-editor-save:active { opacity: 0.85; }

/* ---------- 编辑区：8px 栅格分组卡片 ---------- */
.ck-editor-body {
  flex: 1 1 auto;
  min-height: 0;
  overflow-y: auto;
  padding: 16px;
  display: flex;
  flex-direction: column;
  gap: 16px;
  box-sizing: border-box;
}

/* 每个字段 = 一张白卡片，构成清晰的信息分组 */
.ck-field {
  background: var(--ck-card);
  border-radius: var(--ck-r-card);
  padding: 16px;
  box-shadow: var(--ck-sh-card);
}
.ck-field > label {
  display: block;
  font-size: 13px;
  font-weight: 600;
  color: var(--ck-text);
  margin-bottom: 8px;
}
.ck-optional { font-weight: 400; font-size: 12px; color: var(--ck-sub); }

/* 文本输入：灰底填充 + 聚焦白色描边环 (无硬边框) */
.ck-field input[type="text"] {
  width: 100%;
  min-height: 40px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--ck-r-ctl);
  background: var(--ck-border);
  font-size: 15px;
  color: var(--ck-text);
  box-sizing: border-box;
  outline: none;
  transition: background 0.15s ease, box-shadow 0.15s ease;
}
.ck-field input[type="text"]::placeholder { color: var(--ck-sub); }
.ck-field input[type="text"]:focus {
  background: #fff;
  box-shadow: var(--ck-sh-ring);
}

/* 时间类型 / 时间段 chips：填充式选择 */
.ck-tt-chips,
.ck-slot-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ck-tt-chip,
.ck-slot-chip {
  padding: 8px 16px;
  border: none;
  border-radius: var(--ck-r-ctl);
  background: var(--ck-border);
  color: var(--ck-text);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease, box-shadow 0.15s ease;
}
.ck-tt-chip.active,
.ck-slot-chip.active {
  background: var(--ck-accent);
  color: #fff;
  box-shadow: var(--ck-sh-ctl);
}
.ck-time-cfg-hint { font-size: 12px; color: var(--ck-sub); padding: 8px 0 0; }

/* 周几 / 每月几号选择 */
.ck-wd-picker,
.ck-md-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-top: 8px;
}
.ck-wd-btn,
.ck-md-btn {
  min-width: 40px;
  padding: 8px;
  border: none;
  border-radius: var(--ck-r-ctl);
  background: var(--ck-border);
  color: var(--ck-text);
  font-size: 13px;
  font-weight: 500;
  text-align: center;
  cursor: pointer;
  transition: background 0.15s ease, color 0.15s ease;
}
.ck-wd-btn.active,
.ck-md-btn.active {
  background: var(--ck-accent);
  color: #fff;
}

/* 每周范围 */
.ck-range-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 8px;
}
.ck-range-row select {
  flex: 1;
  min-height: 40px;
  padding: 8px 16px;
  border: none;
  border-radius: var(--ck-r-ctl);
  background: var(--ck-border);
  font-size: 14px;
  color: var(--ck-text);
  outline: none;
  appearance: none;
}
.ck-range-sep { color: var(--ck-sub); font-size: 13px; }

/* 步进器 */
.ck-stepper {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-top: 8px;
}
.ck-stepper button {
  width: 40px;
  height: 40px;
  border: none;
  border-radius: var(--ck-r-ctl);
  background: var(--ck-border);
  color: var(--ck-text);
  font-size: 20px;
  font-weight: 500;
  line-height: 1;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: background 0.15s ease;
}
.ck-stepper button:active { background: var(--ck-border-strong); }
.ck-stepper #ck-times-val { font-size: 24px; font-weight: 600; min-width: 24px; text-align: center; }
.ck-times-unit { color: var(--ck-sub); font-size: 13px; }

/* 颜色 */
.ck-color-row { display: flex; flex-wrap: wrap; gap: 8px; }
.ck-color-swatch {
  width: 40px;
  height: 40px;
  padding: 0;
  border: none;
  border-radius: 50%;
  cursor: pointer;
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05);
  transition: box-shadow 0.15s ease;
}
.ck-color-swatch.active {
  box-shadow: inset 0 0 0 1px rgba(0, 0, 0, 0.05), 0 0 0 2px var(--ck-card), 0 0 0 3px var(--ck-accent);
}
.ck-color-custom {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-top: 16px;
  font-size: 13px;
  color: var(--ck-sub);
}
.ck-color-custom input[type="color"] {
  width: 40px;
  height: 32px;
  border: none;
  border-radius: var(--ck-r-ctl);
  background: transparent;
  cursor: pointer;
  padding: 0;
  box-shadow: var(--ck-sh-ctl);
}

/* 删除：破坏性操作，独立卡片 */
.ck-editor-delete {
  width: 100%;
  padding: 16px;
  border: none;
  border-radius: var(--ck-r-card);
  background: var(--ck-card);
  color: #dc2626;
  font-size: 15px;
  font-weight: 600;
  cursor: pointer;
  box-shadow: var(--ck-sh-card);
}
.ck-editor-delete:active { opacity: 0.75; }

/* =====================================================================
 * 小组件内容 (渲染进 #home-widget)
 * ===================================================================== */
.ck-widget {
  height: 100%;
  display: flex;
  flex-direction: column;
  padding: 11px 13px;
  box-sizing: border-box;
}
.ck-widget-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 8px;
}
.ck-widget-title { font-size: 13px; font-weight: 600; color: var(--ck-text); }
.ck-widget-date { font-size: 12px; color: var(--ck-sub); }

.ck-widget-progress {
  display: flex;
  align-items: baseline;
  gap: 8px;
  margin-bottom: 8px;
}
.ck-widget-big { font-size: 30px; font-weight: 700; color: var(--ck-text); }
.ck-widget-big i { font-style: normal; font-size: 16px; color: var(--ck-sub); font-weight: 500; }
.ck-widget-label { font-size: 12px; color: var(--ck-sub); }

.ck-widget-list { display: flex; flex-direction: column; gap: 7px; }
.ck-widget-item {
  display: flex;
  align-items: center;
  gap: 7px;
  font-size: 12px;
  color: var(--ck-text);
}
.ck-widget-item.done { color: var(--ck-sub); }
.ck-widget-item.done .ck-widget-name { text-decoration: line-through; }
.ck-widget-name {
  flex: 1 1 auto;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ck-widget-check { color: var(--ck-text); font-weight: 700; }
.ck-widget-empty {
  flex: 1;
  display: flex;
  align-items: center;
  justify-content: center;
  text-align: center;
  font-size: 13px;
  color: var(--ck-sub);
  line-height: 1.5;
}
