/**
 * R4 视觉主题（可回滚）
 * 回滚方法：删除本文件，并去掉 index.html 中的 <link rel="stylesheet" href="theme-r4.css">
 * 或在控制台执行：document.getElementById('themeR4')?.remove()
 */
:root {
  --r4-bg: #f1f5f9;
  --r4-surface: #ffffff;
  --r4-ink: #0f172a;
  --r4-muted: #64748b;
  --r4-accent: #2563eb;
  --r4-accent-soft: #dbeafe;
  --r4-glow: 0 10px 40px rgba(37, 99, 235, 0.08);
  --r4-radius: 14px;
}

body {
  background:
    radial-gradient(1200px 420px at 8% -10%, rgba(37, 99, 235, 0.12), transparent 60%),
    radial-gradient(900px 380px at 92% 0%, rgba(14, 165, 233, 0.10), transparent 55%),
    var(--r4-bg);
  color: var(--r4-ink);
}

/* 顶栏保持 R4 前纯色，不覆盖 index.html 的 var(--primary) */

.tabs {
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  box-shadow: 0 1px 0 rgba(15, 23, 42, 0.04);
}

.tab.active {
  color: #1d4ed8;
  border-bottom-color: #1d4ed8;
  font-weight: 700;
}

.card,
.stat-card,
.chart-container {
  border-radius: var(--r4-radius);
  border: 1px solid rgba(148, 163, 184, 0.22);
  box-shadow: var(--r4-glow);
  transition: transform 0.2s ease, box-shadow 0.2s ease;
}

.stat-card {
  position: relative;
  overflow: hidden;
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
}

/* 已去掉右上角浅蓝光晕（用户反馈易显脏） */

.stat-card.clickable:hover,
.chart-container:hover {
  transform: translateY(-2px);
  box-shadow: 0 14px 36px rgba(15, 23, 42, 0.10);
}

.stat-value {
  letter-spacing: -0.02em;
  background: linear-gradient(90deg, #0f172a, #1e3a8a);
  -webkit-background-clip: text;
  background-clip: text;
  color: transparent;
}

.stat-card.red .stat-value {
  background: linear-gradient(90deg, #991b1b, #dc2626);
  -webkit-background-clip: text;
  background-clip: text;
}

.stat-card.green .stat-value {
  background: linear-gradient(90deg, #166534, #16a34a);
  -webkit-background-clip: text;
  background-clip: text;
}

.stat-card.orange .stat-value {
  background: linear-gradient(90deg, #9a3412, #f59e0b);
  -webkit-background-clip: text;
  background-clip: text;
}

.chart-container {
  background: linear-gradient(180deg, #ffffff 0%, #f8fafc 100%);
  padding: 16px 16px 8px;
}

.chart-container h3 {
  font-size: 14px;
  font-weight: 700;
  color: #334155;
  margin-bottom: 8px;
  letter-spacing: 0.01em;
}

.chart-canvas-wrap {
  position: relative;
  height: 260px;
}

.todo-chip {
  border-radius: 999px;
  border: 1px solid #e2e8f0;
  transition: all 0.15s ease;
}

.todo-chip:hover {
  border-color: #93c5fd;
  background: #eff6ff;
}

.todo-chip.active {
  background: #eff6ff;
  color: #1d4ed8;
  border-color: #2563eb;
  box-shadow: 0 0 0 2px rgba(37, 99, 235, 0.18);
  font-weight: 600;
}

/* 选中态仍保留红色数字，保证可读 */
.todo-chip.active .n {
  color: #dc2626 !important;
  background: #fee2e2;
  padding: 1px 8px;
  border-radius: 999px;
  margin-left: 4px;
}

.btn-primary {
  background: linear-gradient(135deg, #2563eb, #1d4ed8);
  border: none;
  box-shadow: 0 6px 14px rgba(37, 99, 235, 0.28);
}

.btn-primary:hover {
  filter: brightness(1.05);
}

.table-wrap {
  border-radius: 12px;
  border-color: rgba(148, 163, 184, 0.28);
}

thead th {
  font-size: 12px;
  text-transform: none;
  letter-spacing: 0.02em;
}

.pending-summary {
  display: flex;
  flex-wrap: wrap;
  gap: 12px 18px;
  padding: 12px 14px;
  margin-bottom: 10px;
  border-radius: 12px;
  background: linear-gradient(90deg, #eff6ff, #f8fafc);
  border: 1px solid #dbeafe;
  font-size: 13px;
}

.modal {
  border-radius: 16px;
  box-shadow: 0 24px 64px rgba(15, 23, 42, 0.22);
  border: 1px solid rgba(148, 163, 184, 0.25);
}

.progress-bar {
  height: 8px;
  border-radius: 999px;
  background: #e2e8f0;
  overflow: hidden;
}

.progress-bar-fill {
  border-radius: 999px;
}

@media (max-width: 768px) {
  .chart-canvas-wrap { height: 220px; }
  .stat-value { font-size: 20px; }
}
