/* 主题色与日历样式 */

/* 日历 */
.calendar-nav {
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 10px;
}
.calendar-nav .nav-title {
  font-size: 16px;
  font-weight: 700;
}
.calendar-nav .nav-btns { display: flex; gap: 6px; }
.nav-btn {
  width: 32px; height: 32px;
  border-radius: 8px;
  background: var(--bg-card);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 16px;
}
.nav-btn:active { background: var(--bg-hover); }

.calendar-grid {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 4px;
}
.cal-weekday {
  text-align: center;
  font-size: 11px;
  color: var(--text-mute);
  font-weight: 600;
  padding: 4px 0;
}
.cal-cell {
  min-height: 130px;
  height: auto;
  background: var(--bg-card);
  border-radius: 8px;
  padding: 5px 2px 3px;
  display: flex;
  flex-direction: column;
  overflow: hidden;
  position: relative;
  font-size: 10px;
  transition: transform 0.1s;
}
.cal-cell:active { transform: scale(0.95); }
.cal-cell.other-month { opacity: 0.3; }
.cal-cell.today {
  outline: 2px solid var(--accent);
  outline-offset: -2px;
}
.cal-date {
  font-size: 13px;
  font-weight: 600;
  text-align: center;
  line-height: 1.2;
  flex-shrink: 0;
  margin-bottom: 2px;
}
.cal-date .warn { color: var(--warn); font-size: 10px; }
.cal-dots {
  flex: 1;
  display: flex;
  flex-wrap: wrap;
  align-content: flex-start;
  justify-content: flex-start;
  gap: 2px;
  padding: 3px 2px 2px;
  min-height: 0;
  overflow: hidden;
}
.cal-tag {
  font-size: 9px;
  font-weight: 600;
  padding: 1px 4px;
  border-radius: 4px;
  line-height: 1.4;
  flex-shrink: 0;
  white-space: nowrap;
  max-width: 100%;
  overflow: hidden;
  text-overflow: ellipsis;
}
.cal-more-dots {
  font-size: 9px;
  color: var(--text-mute);
  padding: 1px 2px;
  line-height: 1.4;
  flex-shrink: 0;
}
.cal-sleep {
  font-size: 8px;
  text-align: center;
  font-weight: 600;
  flex-shrink: 0;
  font-family: var(--mono);
  line-height: 1.1;
  margin-top: auto;
  letter-spacing: -0.3px;
}
.cal-sleep.early { color: var(--success); }
.cal-sleep.late { color: var(--danger); }
.cal-sleep.oversleep { color: #a855f7; font-weight: 700; }
.cal-cell.empty .cal-dots { display: none; }

/* 计时器 */
.timer-display {
  text-align: center;
  padding: 20px 0;
}
.timer-cat-icon { font-size: 48px; margin-bottom: 8px; }
.timer-cat-name { font-size: 16px; color: var(--text-dim); margin-bottom: 4px; }
.timer-item-name { font-size: 14px; color: var(--text); margin-bottom: 12px; }
.timer-time {
  font-size: 56px;
  font-weight: 200;
  letter-spacing: 2px;
  font-family: var(--mono);
  line-height: 1;
}
.timer-actions {
  display: flex;
  gap: 10px;
  justify-content: center;
  margin-top: 20px;
}
.timer-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  background: var(--bg-hover);
  padding: 6px 12px;
  border-radius: 20px;
  font-size: 12px;
  color: var(--text-dim);
}

/* 统计图表 */
.stat-row {
  display: flex;
  align-items: center;
  gap: 8px;
  margin-bottom: 8px;
}
.stat-row .stat-label {
  width: 64px;
  font-size: 12px;
  color: var(--text-dim);
  flex-shrink: 0;
}
.stat-row .stat-bar-bg {
  flex: 1;
  height: 18px;
  background: var(--bg-hover);
  border-radius: 9px;
  overflow: hidden;
  position: relative;
}
.stat-row .stat-bar-fill {
  height: 100%;
  border-radius: 9px;
  display: flex;
  align-items: center;
  padding-left: 6px;
  font-size: 10px;
  color: #fff;
  font-weight: 600;
  transition: width 0.6s ease;
  min-width: 2px;
}
.stat-row .stat-val {
  width: 48px;
  font-size: 11px;
  text-align: right;
  color: var(--text-dim);
  flex-shrink: 0;
}

/* 柱状图 */
.bar-chart {
  display: flex;
  align-items: flex-end;
  gap: 3px;
  height: 120px;
  padding: 0 4px;
}
.bar-col {
  flex: 1;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 4px;
  height: 100%;
  justify-content: flex-end;
}
.bar {
  width: 100%;
  max-width: 18px;
  background: var(--accent);
  border-radius: 4px 4px 0 0;
  min-height: 2px;
  transition: height 0.5s ease;
}
.bar-label { font-size: 9px; color: var(--text-mute); }

/* 热力图 */
.heatmap {
  display: grid;
  grid-template-columns: repeat(15, 1fr);
  gap: 3px;
}
.heat-cell {
  aspect-ratio: 1;
  border-radius: 3px;
  background: var(--bg-hover);
}
.heat-cell.l1 { background: #6366f144; }
.heat-cell.l2 { background: #6366f188; }
.heat-cell.l3 { background: #6366f1bb; }
.heat-cell.l4 { background: #6366f1; }

/* 早睡 */
.sleep-input-row {
  display: flex;
  gap: 8px;
  align-items: center;
}
.sleep-stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 8px;
}
.sleep-stat-item {
  text-align: center;
  background: var(--bg-hover);
  border-radius: 10px;
  padding: 10px 4px;
}
.sleep-stat-item .num {
  font-size: 20px;
  font-weight: 700;
  color: var(--accent);
  font-family: var(--mono);
}
.sleep-stat-item .lbl { font-size: 10px; color: var(--text-mute); margin-top: 2px; }

/* 情绪帮手 */
.buddy-bubble {
  background: var(--bg-card);
  border-radius: 16px;
  padding: 14px;
  margin-bottom: 10px;
  position: relative;
}
.buddy-avatar {
  width: 48px; height: 48px;
  border-radius: 50%;
  background: linear-gradient(135deg, #6366f1, #8b5cf6);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 24px;
  margin: 0 auto 10px;
}
.buddy-text { font-size: 14px; line-height: 1.6; text-align: center; }
.buddy-options {
  display: flex;
  flex-direction: column;
  gap: 8px;
  margin-top: 12px;
}
.buddy-opt {
  background: var(--bg-hover);
  border-radius: 10px;
  padding: 10px 14px;
  font-size: 14px;
  text-align: center;
  transition: background 0.2s;
}
.buddy-opt:active { background: var(--accent); color: #fff; }

/* 游戏化 - 火焰 */
.streak-detail {
  text-align: center;
  padding: 8px 0;
}
.streak-big {
  font-size: 56px;
  font-weight: 800;
  background: linear-gradient(135deg, #ff8c42, #f59e0b, #ef4444);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  font-family: var(--mono);
  line-height: 1;
}
.streak-label { font-size: 13px; color: var(--text-dim); margin-top: 4px; }
.streak-best {
  font-size: 12px;
  color: var(--text-mute);
  margin-top: 8px;
}

/* 等级 */
.level-card {
  text-align: center;
  padding: 16px 0;
}
.level-num {
  font-size: 14px;
  color: var(--text-dim);
}
.level-title {
  font-size: 28px;
  font-weight: 800;
  background: linear-gradient(135deg, #6366f1, #8b5cf6, #ec4899);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  margin: 4px 0;
}
.level-exp { font-size: 12px; color: var(--text-mute); }
.level-progress {
  height: 8px;
  background: var(--bg-hover);
  border-radius: 4px;
  margin: 12px 0;
  overflow: hidden;
}
.level-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 4px;
  transition: width 0.6s ease;
}

/* 解谜九宫格 */
.puzzle-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 6px;
  background: var(--bg-hover);
  padding: 8px;
  border-radius: var(--radius);
}
.puzzle-cell {
  background: var(--bg-card);
  border-radius: 8px;
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  padding: 8px 4px 6px;
  position: relative;
  overflow: hidden;
  min-height: 92px;
}
.puzzle-cell.locked { opacity: 0.55; }
.puzzle-cell.locked .puzzle-icon { filter: grayscale(1); opacity: 0.4; }
.puzzle-cell.unlocked {
  animation: puzzleGlow 1.5s ease;
}
.puzzle-icon {
  font-size: 26px;
  line-height: 1;
}
.puzzle-name {
  font-size: 10px;
  color: var(--text-dim);
  margin-top: 4px;
  font-weight: 600;
}
.puzzle-progress {
  width: 70%;
  height: 4px;
  background: var(--bg-hover);
  border-radius: 2px;
  margin-top: 5px;
  overflow: hidden;
}
.puzzle-progress-fill {
  height: 100%;
  background: linear-gradient(90deg, #6366f1, #8b5cf6);
  border-radius: 2px;
  transition: width 0.5s ease;
}
.puzzle-cell.unlocked .puzzle-progress-fill {
  background: linear-gradient(90deg, #22c55e, #4ade80);
}
.puzzle-count {
  font-size: 9px;
  color: var(--text-mute);
  font-family: var(--mono);
  margin-top: 3px;
}
.puzzle-cell.unlocked .puzzle-count { color: var(--success); font-weight: 700; }
.puzzle-hint {
  font-size: 12px;
  color: var(--text-mute);
  text-align: center;
  margin-top: 8px;
  line-height: 1.5;
}

/* 积分日志 */
.exp-log-list {
  max-height: 320px;
  overflow-y: auto;
}
.exp-log-item {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 9px 0;
  border-bottom: 1px solid var(--border);
}
.exp-log-item:last-child { border: none; }
.exp-log-time {
  font-size: 10px;
  color: var(--text-mute);
  font-family: var(--mono);
  width: 54px;
  flex-shrink: 0;
}
.exp-log-reason {
  flex: 1;
  font-size: 12px;
  color: var(--text-dim);
  line-height: 1.4;
}
.exp-log-delta {
  font-size: 13px;
  font-weight: 700;
  font-family: var(--mono);
  flex-shrink: 0;
}
.exp-log-delta.pos { color: var(--success); }
.exp-log-delta.neg { color: var(--danger); }
.exp-log-delta.zero { color: var(--text-mute); }

/* 商店 */
.shop-item {
  display: flex;
  align-items: center;
  gap: 12px;
  background: var(--bg-hover);
  border-radius: var(--radius-sm);
  padding: 12px;
  margin-bottom: 8px;
}
.shop-item .shop-icon { font-size: 28px; }
.shop-item .shop-info { flex: 1; }
.shop-item .shop-name { font-size: 14px; font-weight: 600; }
.shop-item .shop-desc { font-size: 11px; color: var(--text-mute); }
.shop-item .shop-price {
  background: linear-gradient(135deg, #f59e0b, #eab308);
  color: #fff;
  padding: 4px 10px;
  border-radius: 12px;
  font-size: 13px;
  font-weight: 700;
}
.shop-item.owned .shop-price { background: var(--success); }

/* 任务 */
.task-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
}
.task-item:last-child { border: none; }
.task-check {
  width: 22px; height: 22px;
  border-radius: 50%;
  border: 2px solid var(--border);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 12px;
  flex-shrink: 0;
}
.task-check.done {
  background: var(--success);
  border-color: var(--success);
  color: #fff;
}
.task-text { flex: 1; font-size: 13px; }
.task-text.done { color: var(--text-mute); text-decoration: line-through; }
.task-reward { font-size: 12px; color: #eab308; font-weight: 600; }

@keyframes puzzleGlow {
  0% { box-shadow: 0 0 0 0 var(--accent-glow); }
  50% { box-shadow: 0 0 20px 4px var(--accent-glow); }
  100% { box-shadow: 0 0 0 0 var(--accent-glow); }
}

/* 当日详情 */
.day-detail-list .day-record {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 10px;
  background: var(--bg-hover);
  border-radius: 10px;
  margin-bottom: 6px;
}
.day-detail-list .day-group { margin-bottom: 10px; }
.day-detail-list .day-group:last-child { margin-bottom: 0; }
.day-group-header {
  display: flex;
  align-items: center;
  gap: 6px;
  font-size: 12px;
  font-weight: 700;
  color: var(--text-dim);
  padding: 6px 4px 4px;
}
.day-record.sub-record {
  padding: 8px 10px 8px 20px;
  margin-bottom: 4px;
  background: var(--bg-card);
  border-left: 3px solid transparent;
}
.day-record .rec-dot {
  width: 10px; height: 10px;
  border-radius: 50%;
  flex-shrink: 0;
}
.day-record .rec-name { flex: 1; font-size: 13px; }
.day-record .rec-dur { font-size: 12px; color: var(--text-dim); font-family: var(--mono); }
.day-record .rec-del { font-size: 16px; color: var(--text-mute); padding: 4px; }
