/* ===================================
   小打卡 (Check-in / Habit Tracker)
=================================== */

/* 页面顶部主题色 */
.page-header.theme-checkin { }
.page-header.theme-checkin .page-header-icon { box-shadow: 0 4px 16px rgba(6,214,160,0.3); }

/* 账号切换 tabs */
.ci-user-tabs {
  display: flex;
  gap: 8px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.ci-user-tab {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  cursor: pointer;
  font-size: 0.88rem;
  color: var(--text-mid);
  transition: all 0.25s cubic-bezier(0.16, 1, 0.3, 1);
}
.ci-user-tab:hover { border-color: #06d6a0; color: #06d6a0; }
.ci-user-tab.active {
  background: linear-gradient(135deg, #06d6a0, #118ab2);
  color: #fff;
  border-color: transparent;
  box-shadow: 0 4px 12px rgba(6,214,160,0.25);
}
.ci-user-tab-avatar {
  width: 24px; height: 24px;
  border-radius: 50%;
  object-fit: cover;
}
.ci-user-tab-emoji {
  font-size: 1.1rem;
}

/* 月份导航 */
.ci-month-nav {
  display: flex;
  align-items: center;
  justify-content: center;
  gap: 16px;
  margin-bottom: 16px;
}
.ci-month-btn {
  width: 36px; height: 36px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: var(--card-bg);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-mid);
  transition: all 0.2s;
}
.ci-month-btn:hover {
  border-color: #06d6a0;
  color: #06d6a0;
  background: rgba(6,214,160,0.06);
}
.ci-month-title {
  font-size: 1.15rem;
  font-weight: 700;
  color: var(--text);
  min-width: 140px;
  text-align: center;
}

/* 统计条 */
.ci-stats-bar {
  display: flex;
  gap: 12px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.ci-stat-chip {
  display: flex;
  align-items: center;
  gap: 6px;
  padding: 6px 14px;
  border-radius: 20px;
  background: var(--card-bg);
  border: 1px solid var(--border);
  font-size: 0.8rem;
  color: var(--text-mid);
}
.ci-stat-dot {
  width: 8px; height: 8px;
  border-radius: 50%;
  flex-shrink: 0;
}
.ci-stat-num {
  font-weight: 700;
  color: var(--text);
}

/* 月历视图 */
.ci-calendar {
  background: var(--card-bg);
  border-radius: 20px;
  border: 1px solid rgba(0,0,0,0.06);
  padding: 20px;
  margin-bottom: 28px;
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
}
.ci-weekdays {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  text-align: center;
  font-size: 0.75rem;
  color: var(--text-light);
  font-weight: 600;
  letter-spacing: 0.08em;
  margin-bottom: 8px;
}
.ci-days {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.ci-day {
  position: relative;
  aspect-ratio: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  border-radius: 12px;
  font-size: 0.88rem;
  color: var(--text);
  cursor: pointer;
  transition: all 0.2s;
  gap: 2px;
}
.ci-day:hover { background: rgba(6,214,160,0.06); }
.ci-day.empty { cursor: default; }
.ci-day.empty:hover { background: transparent; }
.ci-day.today {
  font-weight: 700;
  background: rgba(6,214,160,0.08);
  box-shadow: inset 0 0 0 2px rgba(6,214,160,0.3);
}
.ci-day.future { color: var(--text-light); cursor: default; }
.ci-day.future:hover { background: transparent; }

/* 打卡点 — 一天内多个项目 */
.ci-day-dots {
  display: flex;
  gap: 3px;
  height: 6px;
  align-items: center;
}
.ci-day-dot {
  width: 6px; height: 6px;
  border-radius: 50%;
  flex-shrink: 0;
}
/* 全勤标记 */
.ci-day.all-done {
  background: linear-gradient(135deg, rgba(6,214,160,0.15), rgba(17,138,178,0.1));
}
.ci-day.all-done::after {
  content: '✓';
  position: absolute;
  top: 2px; right: 4px;
  font-size: 0.55rem;
  color: #06d6a0;
  font-weight: 700;
}

/* 打卡项目区域 */
.ci-section-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 14px;
}
.ci-section-title {
  font-size: 1rem;
  font-weight: 700;
  color: var(--text);
}
.ci-add-btn {
  display: flex;
  align-items: center;
  gap: 5px;
  padding: 7px 14px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #06d6a0, #118ab2);
  color: #fff;
  font-size: 0.82rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 2px 8px rgba(6,214,160,0.25);
}
.ci-add-btn:hover {
  box-shadow: 0 6px 20px rgba(6,214,160,0.35);
  transform: translateY(-1px);
}

/* 打卡项目列表 */
.ci-habits-list {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ci-habit-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: all 0.3s cubic-bezier(0.16, 1, 0.3, 1);
}
.ci-habit-card:hover {
  transform: translateY(-2px);
  box-shadow: 0 8px 24px rgba(0,0,0,0.08);
}
.ci-habit-emoji {
  font-size: 1.6rem;
  flex-shrink: 0;
}
.ci-habit-info {
  flex: 1;
  min-width: 0;
}
.ci-habit-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 2px;
}
.ci-habit-streak {
  font-size: 0.75rem;
  color: var(--text-mid);
}
.ci-habit-streak strong {
  color: #06d6a0;
  font-weight: 700;
}
.ci-habit-progress {
  width: 48px; height: 48px;
  position: relative;
  flex-shrink: 0;
}
.ci-habit-progress svg {
  width: 100%; height: 100%;
  transform: rotate(-90deg);
}
.ci-habit-progress-text {
  position: absolute;
  inset: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 0.68rem;
  font-weight: 700;
  color: var(--text);
}
.ci-habit-actions {
  display: flex;
  gap: 6px;
}
.ci-habit-edit, .ci-habit-del {
  width: 30px; height: 30px;
  border-radius: 8px;
  border: 1px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-light);
  transition: all 0.2s;
}
.ci-habit-edit:hover { color: #7c83fd; border-color: #7c83fd; background: rgba(124,131,253,0.06); }
.ci-habit-del:hover { color: #ef476f; border-color: #ef476f; background: rgba(239,71,111,0.06); }

/* 今日打卡卡片 */
.ci-today-cards {
  display: flex;
  flex-direction: column;
  gap: 10px;
}
.ci-today-card {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 16px 20px;
  background: var(--card-bg);
  border-radius: 16px;
  border: 1px solid rgba(0,0,0,0.06);
  box-shadow: 0 2px 8px rgba(0,0,0,0.04);
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
}
.ci-today-card.done {
  background: linear-gradient(135deg, rgba(6,214,160,0.06), rgba(17,138,178,0.04));
  border-color: rgba(6,214,160,0.15);
}
.ci-today-emoji {
  font-size: 1.5rem;
  flex-shrink: 0;
}
.ci-today-info {
  flex: 1;
  min-width: 0;
}
.ci-today-name {
  font-size: 0.95rem;
  font-weight: 700;
  color: var(--text);
}
.ci-today-card.done .ci-today-name {
  text-decoration: line-through;
  color: var(--text-light);
}
.ci-today-time {
  font-size: 0.75rem;
  color: var(--text-mid);
}
.ci-check-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: 2.5px solid var(--border);
  background: transparent;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.35s cubic-bezier(0.16, 1, 0.3, 1);
  color: transparent;
  flex-shrink: 0;
}
.ci-check-btn:hover {
  border-color: #06d6a0;
  background: rgba(6,214,160,0.08);
  color: rgba(6,214,160,0.4);
}
.ci-check-btn.checked {
  background: linear-gradient(135deg, #06d6a0, #118ab2);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 4px 12px rgba(6,214,160,0.3);
  animation: ciCheckPop 0.4s cubic-bezier(0.16, 1, 0.3, 1);
}
@keyframes ciCheckPop {
  0% { transform: scale(0.6); }
  50% { transform: scale(1.15); }
  100% { transform: scale(1); }
}
.ci-uncheck-btn {
  width: 44px; height: 44px;
  border-radius: 50%;
  border: none;
  background: rgba(239,71,111,0.08);
  color: #ef476f;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  transition: all 0.25s;
  flex-shrink: 0;
  font-size: 0.75rem;
}
.ci-uncheck-btn:hover {
  background: rgba(239,71,111,0.15);
}

/* 空状态 */
.ci-empty {
  text-align: center;
  padding: 40px 20px;
  color: var(--text-light);
}
.ci-empty-icon {
  font-size: 2.5rem;
  margin-bottom: 12px;
}
.ci-empty-text {
  font-size: 0.92rem;
  margin-bottom: 16px;
}

/* 弹窗 */
.ci-modal-overlay {
  position: fixed;
  inset: 0;
  z-index: 1200;
  background: rgba(0,0,0,0.45);
  display: flex;
  align-items: center;
  justify-content: center;
  backdrop-filter: blur(4px);
}
.ci-modal {
  background: var(--card-bg);
  border-radius: 24px;
  width: min(420px, 92vw);
  box-shadow: 0 24px 64px rgba(0,0,0,0.2);
  overflow: hidden;
}
.ci-modal-header {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 20px 24px 12px;
}
.ci-modal-header h3 {
  font-size: 1.05rem;
  font-weight: 700;
  color: var(--text);
}
.ci-modal-close {
  width: 32px; height: 32px;
  border-radius: 8px;
  border: none;
  background: transparent;
  cursor: pointer;
  display: flex;
  align-items: center;
  justify-content: center;
  color: var(--text-light);
  transition: all 0.2s;
}
.ci-modal-close:hover { background: rgba(0,0,0,0.06); color: var(--text); }
.ci-modal-body {
  padding: 8px 24px 20px;
}
.ci-form-label {
  display: block;
  font-size: 0.78rem;
  font-weight: 600;
  color: var(--text-mid);
  margin-bottom: 6px;
  margin-top: 14px;
}
.ci-form-label:first-child { margin-top: 0; }
.ci-form-input {
  width: 100%;
  padding: 10px 14px;
  border-radius: 12px;
  border: 1.5px solid var(--border);
  background: var(--bg);
  font-size: 0.92rem;
  color: var(--text);
  outline: none;
  transition: border-color 0.2s;
  font-family: inherit;
}
.ci-form-input:focus {
  border-color: #06d6a0;
  box-shadow: 0 0 0 3px rgba(6,214,160,0.1);
}

/* Emoji 和颜色选择器 */
.ci-emoji-grid, .ci-color-grid {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
}
.ci-emoji-opt {
  width: 40px; height: 40px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 1.2rem;
  cursor: pointer;
  transition: all 0.2s;
}
.ci-emoji-opt:hover { border-color: #06d6a0; background: rgba(6,214,160,0.06); }
.ci-emoji-opt.active {
  border-color: #06d6a0;
  background: rgba(6,214,160,0.1);
  box-shadow: 0 0 0 2px rgba(6,214,160,0.2);
}
.ci-color-opt {
  width: 32px; height: 32px;
  border-radius: 50%;
  cursor: pointer;
  transition: all 0.2s;
  border: 2px solid transparent;
}
.ci-color-opt:hover { transform: scale(1.15); }
.ci-color-opt.active {
  box-shadow: 0 0 0 3px var(--card-bg), 0 0 0 5px currentColor;
}

.ci-modal-footer {
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  padding: 12px 24px 20px;
}
.ci-modal-cancel {
  padding: 8px 20px;
  border-radius: 10px;
  border: 1.5px solid var(--border);
  background: transparent;
  color: var(--text-mid);
  font-size: 0.88rem;
  cursor: pointer;
  transition: all 0.2s;
}
.ci-modal-cancel:hover { border-color: var(--text-light); color: var(--text); }
.ci-modal-save {
  padding: 8px 24px;
  border-radius: 10px;
  border: none;
  background: linear-gradient(135deg, #06d6a0, #118ab2);
  color: #fff;
  font-size: 0.88rem;
  font-weight: 600;
  cursor: pointer;
  transition: all 0.25s;
  box-shadow: 0 2px 8px rgba(6,214,160,0.25);
}
.ci-modal-save:hover {
  box-shadow: 0 6px 20px rgba(6,214,160,0.35);
  transform: translateY(-1px);
}

/* 响应式 */
@media (max-width: 680px) {
  .ci-calendar { padding: 14px; border-radius: 16px; }
  .ci-day { font-size: 0.8rem; border-radius: 10px; }
  .ci-habit-card { padding: 12px 14px; gap: 10px; border-radius: 14px; }
  .ci-today-card { padding: 14px 16px; gap: 10px; border-radius: 14px; }
  .ci-stats-bar { gap: 8px; }
  .ci-stat-chip { padding: 5px 10px; font-size: 0.75rem; }
  .ci-habit-progress { width: 40px; height: 40px; }
  .ci-check-btn, .ci-uncheck-btn { width: 38px; height: 38px; }
}
