/* ============================================================
   每日打卡 · 设计系统 v2
   设计语言：低饱和自然色 + 层次光影 + 大圆角 + 精致动效
   ============================================================ */

:root {
  /* 色彩体系：主色不用纯绿，带一点墨色的高级绿 */
  --primary: #157f4b;
  --primary-strong: #0e6b3e;
  --primary-soft: rgba(21, 127, 75, 0.10);
  --primary-softer: rgba(21, 127, 75, 0.05);
  --primary-grad: linear-gradient(135deg, #1a9a5c 0%, #0d6e40 100%);

  /* 背景：暖灰纸感，不用纯白 */
  --bg: #f4f5f2;
  --bg-deep: #ecede8;
  --card: #ffffff;
  --text: #1a1d1c;
  --text-2: #4b5552;
  --muted: #8a938f;
  --border: rgba(26, 29, 28, 0.07);
  --border-strong: rgba(26, 29, 28, 0.12);
  --danger: #d64545;

  /* 阴影：多层复合，模拟真实光照 */
  --shadow-sm: 0 1px 2px rgba(26, 29, 28, 0.04), 0 2px 8px rgba(26, 29, 28, 0.03);
  --shadow-md: 0 1px 3px rgba(26, 29, 28, 0.05), 0 6px 20px rgba(26, 29, 28, 0.06);
  --shadow-lg: 0 2px 6px rgba(26, 29, 28, 0.06), 0 16px 40px rgba(26, 29, 28, 0.10);
  --shadow-press: inset 0 1px 2px rgba(26, 29, 28, 0.08);

  --radius: 20px;
  --radius-sm: 14px;
  --ease-spring: cubic-bezier(0.34, 1.56, 0.64, 1);
  --ease-out: cubic-bezier(0.22, 1, 0.36, 1);
}

@media (prefers-color-scheme: dark) {
  :root {
    --primary: #34c47c;
    --primary-strong: #2aad6b;
    --primary-soft: rgba(52, 196, 124, 0.14);
    --primary-softer: rgba(52, 196, 124, 0.07);
    --primary-grad: linear-gradient(135deg, #2db370 0%, #1e8a55 100%);

    --bg: #101312;
    --bg-deep: #0b0e0d;
    --card: #191d1b;
    --text: #e8eae8;
    --text-2: #b0b8b4;
    --muted: #6e7874;
    --border: rgba(232, 234, 232, 0.08);
    --border-strong: rgba(232, 234, 232, 0.14);
    --danger: #e06060;

    --shadow-sm: 0 1px 2px rgba(0, 0, 0, 0.20), 0 2px 8px rgba(0, 0, 0, 0.15);
    --shadow-md: 0 1px 3px rgba(0, 0, 0, 0.25), 0 6px 20px rgba(0, 0, 0, 0.20);
    --shadow-lg: 0 2px 6px rgba(0, 0, 0, 0.30), 0 16px 40px rgba(0, 0, 0, 0.35);
  }
}

* {
  box-sizing: border-box;
  margin: 0;
  padding: 0;
  -webkit-tap-highlight-color: transparent;
}

html, body {
  height: 100%;
  font-family: -apple-system, BlinkMacSystemFont, "SF Pro Text", "PingFang SC", "Segoe UI", system-ui, sans-serif;
  background: var(--bg);
  color: var(--text);
  -webkit-font-smoothing: antialiased;
  text-rendering: optimizeLegibility;
  font-feature-settings: "tnum" on;
}

/* 环境噪点质感（极淡，不影响性能） */
body::before {
  content: '';
  position: fixed;
  inset: 0;
  pointer-events: none;
  z-index: 0;
  opacity: 0.025;
  background-image: url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='120' height='120'%3E%3Cfilter id='n'%3E%3CfeTurbulence type='fractalNoise' baseFrequency='0.9' numOctaves='2'/%3E%3C/filter%3E%3Crect width='120' height='120' filter='url(%23n)' opacity='0.6'/%3E%3C/svg%3E");
}

#app {
  max-width: 560px;
  margin: 0 auto;
  min-height: 100dvh;
  display: flex;
  flex-direction: column;
  position: relative;
  z-index: 1;
}

#pages { flex: 1; padding: 20px 18px 110px; }

.page { display: none; }
.page.active { display: block; }
.page.active > * { animation: riseIn 0.45s var(--ease-out) both; }
.page.active > *:nth-child(2) { animation-delay: 0.04s; }
.page.active > *:nth-child(3) { animation-delay: 0.08s; }
.page.active > *:nth-child(4) { animation-delay: 0.12s; }
.page.active > *:nth-child(n+5) { animation-delay: 0.16s; }

@keyframes riseIn {
  from { opacity: 0; transform: translateY(10px); }
  to { opacity: 1; transform: none; }
}

/* ---------- 通用卡片 ---------- */
.card {
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  margin-bottom: 14px;
  box-shadow: var(--shadow-md);
  border: 1px solid var(--border);
}

.section-title {
  font-size: 12px;
  color: var(--muted);
  font-weight: 700;
  letter-spacing: 1.5px;
  text-transform: uppercase;
  margin: 10px 6px 12px;
}

/* ---------- 今日页 ---------- */
.today-header { padding: 14px 6px 22px; }
.today-date {
  font-size: 13px;
  color: var(--muted);
  margin-bottom: 8px;
  font-weight: 500;
  letter-spacing: 0.3px;
}
.today-phase-name {
  font-size: 27px;
  font-weight: 800;
  line-height: 1.25;
  letter-spacing: -0.5px;
}
.phase-badge {
  display: inline-block;
  font-size: 11px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-soft);
  border-radius: 999px;
  padding: 3px 11px;
  margin-left: 10px;
  vertical-align: 6px;
  letter-spacing: 0.5px;
}
.today-sub { font-size: 14px; color: var(--text-2); margin-top: 8px; font-weight: 400; }

.progress-track {
  height: 6px;
  border-radius: 99px;
  background: var(--border-strong);
  overflow: hidden;
  margin-top: 18px;
}
.progress-fill {
  height: 100%;
  border-radius: 99px;
  background: var(--primary-grad);
  transition: width 0.6s var(--ease-out);
}
.progress-caption {
  display: flex;
  justify-content: space-between;
  font-size: 12px;
  color: var(--muted);
  margin-top: 8px;
  font-weight: 500;
}

/* 完成度卡片 */
.done-summary {
  display: flex;
  align-items: center;
  gap: 18px;
  background: var(--card);
  position: relative;
  overflow: hidden;
}
.done-summary::after {
  content: '';
  position: absolute;
  top: -60%;
  right: -20%;
  width: 200px;
  height: 200px;
  border-radius: 50%;
  background: var(--primary-softer);
  pointer-events: none;
}
.done-num {
  font-size: 38px;
  font-weight: 800;
  background: var(--primary-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1;
  letter-spacing: -1px;
}
.done-num small {
  font-size: 17px;
  color: var(--muted);
  font-weight: 600;
  -webkit-text-fill-color: var(--muted);
}
.done-label { font-size: 13px; color: var(--text-2); margin-top: 6px; font-weight: 500; }
.done-ring { width: 64px; height: 64px; flex-shrink: 0; position: relative; z-index: 1; }
.done-ring circle { fill: none; stroke-width: 5; }
.done-ring .bg { stroke: var(--border-strong); }
.done-ring .fg {
  stroke: var(--primary);
  stroke-linecap: round;
  transform: rotate(-90deg);
  transform-origin: center;
  transition: stroke-dashoffset 0.7s var(--ease-spring);
  filter: drop-shadow(0 1px 3px rgba(21, 127, 75, 0.3));
}

/* 任务卡片 */
.task-item {
  display: flex;
  align-items: center;
  gap: 15px;
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 17px 18px;
  margin-bottom: 12px;
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  transition: transform 0.18s var(--ease-out), box-shadow 0.18s, background 0.25s, border-color 0.25s;
  user-select: none;
  position: relative;
  overflow: hidden;
}
.task-item:active {
  transform: scale(0.97);
  box-shadow: var(--shadow-press), var(--shadow-sm);
}
.task-item.done {
  background: linear-gradient(135deg, var(--primary-softer), var(--card) 60%);
  border-color: var(--primary-soft);
}
.task-check {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: 2px solid var(--border-strong);
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: center;
  transition: all 0.28s var(--ease-spring);
  font-size: 15px;
  font-weight: 800;
  color: transparent;
  position: relative;
}
.task-item.done .task-check {
  background: var(--primary-grad);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 3px 10px rgba(21, 127, 75, 0.35);
  animation: checkPop 0.35s var(--ease-spring);
}
@keyframes checkPop {
  0% { transform: scale(0.7); }
  60% { transform: scale(1.12); }
  100% { transform: scale(1); }
}
.task-info { flex: 1; min-width: 0; position: relative; z-index: 1; }
.task-name {
  font-size: 16.5px;
  font-weight: 650;
  letter-spacing: -0.2px;
  transition: color 0.25s;
}
.task-item.done .task-name { color: var(--primary-strong); }
.task-meta { font-size: 13px; color: var(--muted); margin-top: 4px; font-weight: 400; }

/* 打卡成功时任务名的涟漪装饰 */
.task-item.done::before {
  content: '';
  position: absolute;
  left: -60px;
  top: 50%;
  width: 120px;
  height: 120px;
  border-radius: 50%;
  background: radial-gradient(circle, var(--primary-soft) 0%, transparent 70%);
  transform: translateY(-50%);
  animation: ripple 0.6s var(--ease-out);
  pointer-events: none;
}
@keyframes ripple {
  from { opacity: 0; transform: translateY(-50%) scale(0.4); }
  to { opacity: 1; transform: translateY(-50%) scale(1); }
}

.empty-state {
  text-align: center;
  padding: 56px 24px;
  color: var(--muted);
  font-size: 14px;
  line-height: 2;
  font-weight: 400;
}
.empty-state .big {
  font-size: 44px;
  margin-bottom: 10px;
  display: block;
  filter: saturate(0.8);
}

/* ---------- 计划页 ---------- */
.plan-header { padding: 14px 6px 18px; }
.plan-title { font-size: 27px; font-weight: 800; letter-spacing: -0.5px; }
.plan-sub { font-size: 13px; color: var(--muted); margin-top: 6px; font-weight: 400; }

.phase-card {
  position: relative;
  transition: transform 0.2s var(--ease-out), box-shadow 0.2s;
}
.phase-card:active { transform: scale(0.985); }
.phase-card-head {
  display: flex;
  align-items: flex-start;
  justify-content: space-between;
  margin-bottom: 12px;
  gap: 8px;
}
.phase-name { font-size: 17.5px; font-weight: 750; letter-spacing: -0.2px; }
.phase-weeks {
  font-size: 12.5px;
  color: var(--muted);
  margin-top: 4px;
  font-weight: 500;
  font-feature-settings: "tnum" on;
  letter-spacing: 0.2px;
}
.phase-tag {
  font-size: 10.5px;
  padding: 3px 9px;
  border-radius: 99px;
  font-weight: 700;
  margin-left: 9px;
  vertical-align: 3px;
  letter-spacing: 0.5px;
}
.phase-tag.active { background: var(--primary-soft); color: var(--primary); }
.phase-tag.upcoming { background: var(--border-strong); color: var(--muted); }
.phase-tag.finished { background: var(--border); color: var(--muted); }

/* 当前阶段卡片的高亮描边 */
.phase-card.is-now {
  border-color: var(--primary-soft);
  box-shadow: var(--shadow-md), 0 0 0 1px var(--primary-soft);
}

.btn-edit-phase {
  border: none;
  background: var(--bg);
  color: var(--text-2);
  font-size: 13px;
  font-weight: 600;
  padding: 7px 14px;
  border-radius: 99px;
  cursor: pointer;
  transition: all 0.2s;
  flex-shrink: 0;
}
.btn-edit-phase:active { transform: scale(0.94); background: var(--bg-deep); }

.task-line {
  display: flex;
  align-items: baseline;
  gap: 10px;
  padding: 10px 0;
  border-bottom: 1px solid var(--border);
  font-size: 14.5px;
}
.task-line:last-child { border-bottom: none; }
.task-line .dot {
  width: 5px;
  height: 5px;
  border-radius: 50%;
  background: var(--primary);
  flex-shrink: 0;
  align-self: center;
  box-shadow: 0 0 0 3px var(--primary-soft);
}
.task-line .t-name { flex: 1; font-weight: 550; }
.task-line .t-target {
  color: var(--muted);
  font-size: 13px;
  font-feature-settings: "tnum" on;
  font-weight: 500;
}

.phase-progress-line { margin-top: 12px; padding-top: 12px; border-top: 1px solid var(--border); }

/* ---------- 按钮 ---------- */
.btn {
  display: block;
  width: 100%;
  border: none;
  border-radius: 16px;
  padding: 15px;
  font-size: 15.5px;
  font-weight: 700;
  cursor: pointer;
  transition: transform 0.15s var(--ease-out), box-shadow 0.15s, opacity 0.15s;
  font-family: inherit;
  letter-spacing: 0.3px;
}
.btn:active { transform: scale(0.97); }
.btn-primary {
  background: var(--primary-grad);
  color: #fff;
  box-shadow: 0 4px 14px rgba(21, 127, 75, 0.30);
}
.btn-primary:active { box-shadow: 0 2px 8px rgba(21, 127, 75, 0.25); }
.btn-outline {
  background: var(--card);
  color: var(--text);
  border: 1.5px solid var(--border-strong);
  box-shadow: var(--shadow-sm);
}
.btn-danger-outline {
  background: transparent;
  color: var(--danger);
  border: 1.5px solid rgba(214, 69, 69, 0.35);
}
.btn + .btn { margin-top: 10px; }

/* ---------- 统计页 ---------- */
.stats-header { padding: 14px 6px 18px; }
.stats-title { font-size: 27px; font-weight: 800; letter-spacing: -0.5px; }

.stat-grid {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 11px;
  margin-bottom: 14px;
}
.stat-box {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  padding: 16px 8px;
  text-align: center;
  box-shadow: var(--shadow-sm);
}
.stat-num {
  font-size: 26px;
  font-weight: 800;
  background: var(--primary-grad);
  -webkit-background-clip: text;
  background-clip: text;
  -webkit-text-fill-color: transparent;
  line-height: 1.2;
  letter-spacing: -0.5px;
  font-feature-settings: "tnum" on;
}
.stat-label { font-size: 11.5px; color: var(--muted); margin-top: 5px; font-weight: 550; letter-spacing: 0.3px; }

/* 热力图 */
.heatmap {
  display: grid;
  grid-template-columns: repeat(7, 1fr);
  gap: 5px;
  max-width: 272px;
  margin: 6px auto 10px;
}
.hm-cell {
  aspect-ratio: 1;
  border-radius: 5px;
  background: var(--border-strong);
  opacity: 0.55;
  transition: transform 0.15s;
}
.hm-cell:active { transform: scale(1.3); }
.hm-cell.l1 { background: #8ed4ac; opacity: 1; }
.hm-cell.l2 {
  background: var(--primary-grad);
  opacity: 1;
  box-shadow: 0 1px 4px rgba(21, 127, 75, 0.25);
}
.hm-cell.today { outline: 2px solid var(--text); outline-offset: 1.5px; }
.heatmap-legend {
  display: flex;
  justify-content: center;
  align-items: center;
  gap: 5px;
  font-size: 11px;
  color: var(--muted);
  font-weight: 500;
}
.heatmap-legend .hm-cell { width: 12px; height: 12px; aspect-ratio: auto; }

/* 历史记录 */
.history-row {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius-sm);
  margin-bottom: 10px;
  overflow: hidden;
  box-shadow: var(--shadow-sm);
  transition: box-shadow 0.2s;
}
.history-row.open { box-shadow: var(--shadow-md); }
.history-head {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 14px 17px;
  cursor: pointer;
  transition: background 0.15s;
}
.history-head:active { background: var(--primary-softer); }
.history-date { font-size: 14px; font-weight: 650; width: 88px; font-feature-settings: "tnum" on; }
.history-date small {
  display: block;
  color: var(--muted);
  font-weight: 450;
  font-size: 11px;
  margin-top: 2px;
}
.history-bar { flex: 1; height: 5px; border-radius: 99px; background: var(--border-strong); overflow: hidden; }
.history-bar .progress-fill { height: 100%; }
.history-count {
  font-size: 13px;
  color: var(--muted);
  width: 40px;
  text-align: right;
  font-feature-settings: "tnum" on;
  font-weight: 550;
}
.history-arrow {
  color: var(--muted);
  font-size: 10px;
  transition: transform 0.25s var(--ease-spring);
}
.history-row.open .history-arrow { transform: rotate(90deg); }
.history-tasks {
  display: none;
  padding: 0 17px;
  max-height: 0;
  transition: max-height 0.3s var(--ease-out);
}
.history-row.open .history-tasks { display: block; max-height: 400px; padding-bottom: 6px; }
.history-task {
  display: flex;
  align-items: center;
  gap: 12px;
  padding: 11px 0;
  border-top: 1px solid var(--border);
  font-size: 14px;
  cursor: pointer;
  transition: background 0.15s;
}
.history-task:active { background: var(--primary-softer); }
.history-task .task-check { width: 24px; height: 24px; font-size: 12px; border-width: 1.5px; }
.history-task.done .task-name { color: var(--primary-strong); font-weight: 650; }
.history-hint {
  font-size: 11px;
  color: var(--muted);
  padding: 2px 17px 12px;
  font-weight: 450;
}

.data-actions { display: flex; gap: 11px; }
.data-actions .btn { width: auto; flex: 1; padding: 13px; font-size: 14px; }

/* ---------- Tabbar：玻璃拟态 ---------- */
.tabbar {
  position: fixed;
  bottom: 0;
  left: 50%;
  transform: translateX(-50%);
  width: 100%;
  max-width: 560px;
  display: flex;
  background: color-mix(in srgb, var(--card) 78%, transparent);
  -webkit-backdrop-filter: blur(24px) saturate(1.6);
  backdrop-filter: blur(24px) saturate(1.6);
  border-top: 1px solid var(--border);
  padding-bottom: env(safe-area-inset-bottom);
  z-index: 50;
  box-shadow: 0 -4px 24px rgba(26, 29, 28, 0.05);
}
@supports not (background: color-mix(in srgb, red 50%, blue)) {
  .tabbar { background: var(--card); }
}
.tab {
  flex: 1;
  border: none;
  background: none;
  padding: 9px 0 11px;
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 3px;
  color: var(--muted);
  cursor: pointer;
  font-size: 10.5px;
  font-family: inherit;
  transition: color 0.2s;
}
.tab-icon {
  font-size: 23px;
  line-height: 1;
  filter: grayscale(1);
  opacity: 0.55;
  transition: all 0.28s var(--ease-spring);
}
.tab.active { color: var(--primary); }
.tab.active .tab-icon {
  filter: none;
  opacity: 1;
  transform: scale(1.12) translateY(-1px);
}
.tab-label { font-weight: 650; letter-spacing: 0.5px; }

/* ---------- Sheet：底部弹层 ---------- */
#sheet-overlay {
  position: fixed;
  inset: 0;
  background: rgba(10, 12, 11, 0.45);
  -webkit-backdrop-filter: blur(3px);
  backdrop-filter: blur(3px);
  z-index: 100;
  display: flex;
  align-items: flex-end;
  justify-content: center;
  animation: overlayIn 0.25s var(--ease-out);
}
@keyframes overlayIn { from { opacity: 0; } to { opacity: 1; } }
#sheet-overlay.hidden { display: none; }
.sheet {
  width: 100%;
  max-width: 560px;
  max-height: 88dvh;
  overflow: hidden;
  background: var(--card);
  border-radius: 28px 28px 0 0;
  padding: 12px 0 0;
  display: flex;
  flex-direction: column;
  animation: slideUp 0.38s var(--ease-spring);
  box-shadow: var(--shadow-lg);
}
/* 固定头部：标题 + 关闭按钮，不随内容滚动 */
.sheet-header {
  flex-shrink: 0;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 2px 22px 14px;
  border-bottom: 1px solid var(--border);
}
.sheet-header .sheet-title { margin-bottom: 0; }
.sheet-close {
  width: 32px;
  height: 32px;
  border-radius: 50%;
  border: none;
  background: var(--bg);
  color: var(--muted);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  -webkit-appearance: none;
  appearance: none;
}
.sheet-close:active { transform: scale(0.88); background: var(--bg-deep); }
/* 可滚动内容区：头部底部固定，仅此区域滚动 */
.sheet-scroll {
  flex: 1;
  min-height: 0;
  overflow-y: auto;
  padding: 18px 22px 10px;
  -webkit-overflow-scrolling: touch;
}
/* 顶部拖动指示条 */
.sheet::before {
  content: '';
  display: block;
  flex-shrink: 0;
  width: 40px;
  height: 5px;
  border-radius: 99px;
  background: var(--border-strong);
  margin: 0 auto 14px;
}
@keyframes slideUp {
  from { transform: translateY(80px); opacity: 0.6; }
  to { transform: none; opacity: 1; }
}

/* 底部操作区：删除（左） + 保存（右），常驻固定 */
.sheet-footer {
  flex-shrink: 0;
  display: flex;
  align-items: stretch;
  gap: 11px;
  padding: 14px 22px calc(16px + env(safe-area-inset-bottom));
  background: var(--card);
  border-top: 1px solid var(--border);
  box-shadow: 0 -6px 20px rgba(26, 29, 28, 0.05);
}
.sheet-footer .btn { margin: 0; flex: 1; }
/* 主按钮的内高光：模拟实体按键的受光面 */
.sheet-footer .btn-primary {
  box-shadow: 0 4px 14px rgba(21, 127, 75, 0.30), inset 0 1px 0 rgba(255, 255, 255, 0.18);
}
/* 删除图标按钮 */
.btn-icon-danger {
  width: 54px;
  border: 1.5px solid rgba(214, 69, 69, 0.32);
  border-radius: 16px;
  background: transparent;
  color: var(--danger);
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  -webkit-appearance: none;
  appearance: none;
  font: inherit;
}
.btn-icon-danger:active { background: rgba(214, 69, 69, 0.08); transform: scale(0.94); }
/* 二次确认状态：红色填充 + 脉冲提醒 */
.btn-icon-danger.armed {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
  animation: armedPulse 0.9s ease-in-out infinite;
}
@keyframes armedPulse {
  0%, 100% { transform: scale(1); }
  50% { transform: scale(1.05); }
}

.sheet-title { font-size: 19px; font-weight: 800; margin-bottom: 20px; letter-spacing: -0.3px; }
.sheet-group { margin-bottom: 18px; }
.sheet-group label {
  display: block;
  font-size: 12px;
  font-weight: 700;
  color: var(--muted);
  margin-bottom: 8px;
  letter-spacing: 0.5px;
}
.sheet-group input {
  width: 100%;
  font-size: 15.5px;
  padding: 13px 15px;
  min-height: 48px;          /* 统一高度：iOS date/number 控件内建高度不一 */
  margin: 0;
  border: 1.5px solid var(--border-strong);
  border-radius: 13px;
  background: var(--bg);
  color: var(--text);
  font-family: inherit;
  font-weight: 500;
  transition: border-color 0.2s, background 0.2s, box-shadow 0.2s;
  -webkit-appearance: none;
  appearance: none;
}
.sheet-group input:focus {
  outline: none;
  border-color: var(--primary);
  background: var(--card);
  box-shadow: 0 0 0 3.5px var(--primary-soft);
}
.sheet-group input::placeholder { color: var(--muted); font-weight: 400; }
.sheet-row { display: flex; gap: 11px; }
.sheet-row .sheet-group { flex: 1; }
.field-hint {
  font-size: 12px;
  color: var(--muted);
  margin-top: 7px;
  font-weight: 500;
  padding-left: 2px;
}

.task-edit-row {
  display: flex;
  align-items: stretch;      /* 拉伸对齐：所有输入框和删除按钮同高 */
  gap: 8px;
  margin-bottom: 10px;
}
.task-edit-row input {
  padding: 11px 13px;
  font-size: 14px;
  min-height: 44px;          /* 行内输入框统一高度 */
}
.task-edit-row .te-name { flex: 2; }
.task-edit-row .te-target { flex: 1.1; min-width: 0; }
.task-edit-row .te-unit { flex: 1; min-width: 0; }
.task-edit-row .te-del {
  width: 44px;
  min-height: 44px;
  height: auto;
  border: none;
  border-radius: 12px;
  background: transparent;
  color: var(--danger);
  font-size: 17px;
  cursor: pointer;
  flex-shrink: 0;
  transition: all 0.15s;
  font-family: inherit;
  -webkit-appearance: none;
  appearance: none;
}
.task-edit-row .te-del:active { background: rgba(214, 69, 69, 0.08); transform: scale(0.9); }

.btn-add-task {
  border: 1.5px dashed var(--border-strong);
  background: none;
  color: var(--muted);
  border-radius: 13px;
  padding: 12px;
  font-size: 14px;
  font-weight: 600;
  width: 100%;
  cursor: pointer;
  font-family: inherit;
  transition: all 0.2s;
}
.btn-add-task:active { border-color: var(--primary); color: var(--primary); background: var(--primary-softer); }

/* ============================================================
   开屏页
   ============================================================ */
#splash {
  position: fixed;
  inset: 0;
  z-index: 999;
  display: flex;
  align-items: center;
  justify-content: center;
  background: var(--primary-grad);
  animation: splashBg 1.6s var(--ease-out) both;
}
#splash.hide {
  opacity: 0;
  pointer-events: none;
  transition: opacity 0.45s var(--ease-out);
}
@keyframes splashBg {
  0% { filter: brightness(0.9); }
  100% { filter: brightness(1); }
}
.splash-inner {
  text-align: center;
  color: #fff;
  padding: 0 40px;
  max-width: 420px;
}
.splash-logo {
  width: 88px;
  height: 88px;
  margin: 0 auto 26px;
  border-radius: 26px;
  background: rgba(255, 255, 255, 0.16);
  -webkit-backdrop-filter: blur(8px);
  backdrop-filter: blur(8px);
  border: 1px solid rgba(255, 255, 255, 0.28);
  display: flex;
  align-items: center;
  justify-content: center;
  font-size: 44px;
  font-weight: 800;
  box-shadow: 0 12px 36px rgba(0, 0, 0, 0.18);
  animation: logoIn 0.7s var(--ease-spring) 0.15s both;
}
@keyframes logoIn {
  from { opacity: 0; transform: scale(0.6) translateY(14px); }
  to { opacity: 1; transform: scale(1) translateY(0); }
}
.splash-title {
  font-size: 30px;
  font-weight: 800;
  letter-spacing: 2px;
  animation: riseText 0.6s var(--ease-out) 0.35s both;
}
.splash-slogan {
  font-size: 16.5px;
  font-weight: 550;
  margin-top: 14px;
  letter-spacing: 1.5px;
  opacity: 0.92;
  animation: riseText 0.6s var(--ease-out) 0.55s both;
}
.splash-sub {
  font-size: 13px;
  font-weight: 400;
  margin-top: 10px;
  opacity: 0.75;
  letter-spacing: 0.8px;
  animation: riseText 0.6s var(--ease-out) 0.75s both;
}
@keyframes riseText {
  from { opacity: 0; transform: translateY(12px); }
  to { opacity: 1; transform: translateY(0); }
}
/* 愿景句结束后的呼吸留白，随后整体淡出 */
.splash-inner::after {
  content: '';
  display: block;
  width: 36px;
  height: 3px;
  border-radius: 99px;
  background: rgba(255, 255, 255, 0.5);
  margin: 34px auto 0;
  animation: breathe 1.2s var(--ease-out) 1.1s infinite;
}
@keyframes breathe {
  0%, 100% { transform: scaleX(0.5); opacity: 0.4; }
  50% { transform: scaleX(1); opacity: 0.9; }
}

/* ---------- Toast ---------- */
.toast {
  position: fixed;
  bottom: 118px;
  left: 50%;
  transform: translateX(-50%);
  background: var(--text);
  color: var(--bg);
  font-size: 13.5px;
  font-weight: 650;
  padding: 11px 24px;
  border-radius: 99px;
  z-index: 200;
  animation: toastIn 0.35s var(--ease-spring);
  box-shadow: var(--shadow-lg);
  white-space: nowrap;
  letter-spacing: 0.3px;
}
@keyframes toastIn {
  from { opacity: 0; transform: translateX(-50%) translateY(14px) scale(0.92); }
  to { opacity: 1; transform: translateX(-50%) translateY(0) scale(1); }
}
.toast.hidden { display: none; }
