:root {
  --pink: #ff6b9d;
  --pink-dark: #e8457f;
  --bg: #fff5f8;
  --card: #ffffff;
  --text: #3a2c33;
  --muted: #9a8b91;
  --essential: #e63946;
  --suggest: #2a9d8f;
  --shadow: 0 4px 16px rgba(255, 107, 157, 0.12);
  --radius: 16px;
}

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

html, body {
  margin: 0; padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}

#app {
  max-width: 640px;
  margin: 0 auto;
  min-height: 100vh;
  padding-bottom: 32px;
}

.hidden { display: none !important; }

/* 顶部 */
.topbar {
  position: sticky; top: 0; z-index: 10;
  background: linear-gradient(135deg, var(--pink), #ff9ec4);
  color: #fff;
  box-shadow: var(--shadow);
}
.topbar-inner {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px;
  padding-top: calc(14px + env(safe-area-inset-top));
}
.topbar h1 { font-size: 19px; margin: 0; font-weight: 700; }
.icon-btn {
  background: rgba(255,255,255,0.2); border: none; color: #fff;
  font-size: 18px; width: 38px; height: 38px; border-radius: 50%;
  cursor: pointer;
}

/* 概览卡片 */
.overview {
  margin: 16px;
  background: var(--card);
  border-radius: var(--radius);
  padding: 18px;
  box-shadow: var(--shadow);
}
.overview-row { display: flex; align-items: center; gap: 16px; }
.age-big {
  font-size: 40px; font-weight: 800; color: var(--pink-dark);
  line-height: 1; white-space: nowrap;
}
.age-big small { font-size: 15px; color: var(--muted); font-weight: 600; }
.overview-right { flex: 1; }
.date-today { font-size: 13px; color: var(--muted); margin-bottom: 8px; }
.progress-wrap { }
.progress-bar {
  height: 10px; background: #ffe3ee; border-radius: 6px; overflow: hidden;
}
#progressFill {
  height: 100%; width: 0%; background: linear-gradient(90deg, var(--pink), #ffb3d1);
  transition: width .4s ease;
}
.progress-text { font-size: 12px; color: var(--muted); margin-top: 5px; }
.overview-tip {
  margin-top: 12px; padding: 10px 12px;
  background: #fff7e6; border-radius: 10px;
  font-size: 13px; color: #b6791f; line-height: 1.5;
}

/* 必须提醒横幅 */
.alert-banner {
  margin: 0 16px 16px;
  background: #ffe9eb; border: 1px solid #ffc2c8;
  border-radius: 12px; padding: 12px 14px;
  font-size: 13px; color: var(--essential); line-height: 1.5;
}
.alert-banner b { color: var(--essential); }

/* 任务分类 */
.task-list { padding: 0 16px; }
.cat-block {
  background: var(--card); border-radius: var(--radius);
  margin-bottom: 14px; box-shadow: var(--shadow); overflow: hidden;
}
.cat-head {
  display: flex; align-items: center; gap: 8px;
  padding: 12px 14px; font-weight: 700; font-size: 15px;
  color: #fff;
}
.cat-head .cat-count { margin-left: auto; font-size: 12px; opacity: .9; }
.task-item {
  display: flex; align-items: flex-start; gap: 10px;
  padding: 11px 14px; border-top: 1px solid #f3eef0; cursor: pointer;
}
.task-item:active { background: #fff0f5; }
.task-check {
  width: 22px; height: 22px; border-radius: 6px; flex-shrink: 0;
  border: 2px solid #d9c9d1; margin-top: 1px; position: relative;
  background: #fff;
}
.task-item.done .task-check { background: var(--suggest); border-color: var(--suggest); }
.task-item.done .task-check::after {
  content: "✓"; color: #fff; font-size: 14px; font-weight: 700;
  position: absolute; top: -2px; left: 4px;
}
.task-text { flex: 1; font-size: 14px; line-height: 1.45; }
.task-item.done .task-text { color: var(--muted); text-decoration: line-through; }
.task-tag {
  font-size: 10px; padding: 1px 7px; border-radius: 8px; margin-left: 6px;
  vertical-align: middle; white-space: nowrap;
}
.tag-essential { background: #ffe9eb; color: var(--essential); }
.tag-suggest { background: #e6f6f3; color: var(--suggest); }

/* 引导页 */
.setup-guide {
  text-align: center; padding: 48px 28px;
}
.guide-emoji { font-size: 64px; margin-bottom: 12px; }
.setup-guide h2 { margin: 8px 0; font-size: 21px; }
.setup-guide p { color: var(--muted); font-size: 14px; line-height: 1.6; }

/* 按钮 */
.primary-btn {
  background: linear-gradient(135deg, var(--pink), #ff8fb5);
  color: #fff; border: none; padding: 13px 28px; border-radius: 24px;
  font-size: 15px; font-weight: 700; cursor: pointer; box-shadow: var(--shadow);
  margin-top: 18px;
}
.ghost-btn {
  background: #fff; color: var(--text); border: 1px solid #e7dde1;
  padding: 11px 20px; border-radius: 22px; font-size: 14px; cursor: pointer;
}
.link-btn {
  background: none; border: none; color: var(--essential); font-size: 12px;
  margin-top: 14px; cursor: pointer; text-decoration: underline;
}

/* 页脚 */
.footnote {
  text-align: center; font-size: 11px; color: var(--muted);
  padding: 20px 24px 0; line-height: 1.6;
}

/* 弹层 */
.modal {
  position: fixed; inset: 0; z-index: 50;
  background: rgba(58,44,51,0.45);
  display: flex; align-items: center; justify-content: center; padding: 20px;
}
.modal-card {
  background: #fff; border-radius: 20px; padding: 24px;
  width: 100%; max-width: 380px; box-shadow: 0 12px 40px rgba(0,0,0,0.2);
}
.modal-card h3 { margin: 0 0 18px; font-size: 18px; }
.field { display: block; margin-bottom: 16px; font-size: 14px; }
.field span { display: block; margin-bottom: 6px; color: var(--muted); font-size: 13px; }
.field input[type=date] {
  width: 100%; padding: 10px 12px; border: 1px solid #e7dde1;
  border-radius: 10px; font-size: 15px;
}
.field.check { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--text); }
.field.check input { width: 18px; height: 18px; }
.modal-actions { display: flex; gap: 12px; margin-top: 8px; }
.modal-actions .primary-btn, .modal-actions .ghost-btn { flex: 1; margin-top: 0; }
