:root {
  --bg: #f4f5f7;
  --surface: #ffffff;
  --line: #e6e8eb;
  --text: #1a1d21;
  --text-2: #656b73;
  --text-3: #9aa0a8;
  --brand: #07863f;
  --brand-soft: #e8f5ee;
  --danger: #d1382c;
  --danger-soft: #fdeceb;
  --warn: #9a6300;
  --warn-soft: #fdf3e0;
  --radius: 12px;
}

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

body {
  margin: 0;
  padding: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC",
               "Helvetica Neue", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

.wrap { max-width: 560px; margin: 0 auto; padding: 16px 16px 120px; }

/* ---------- 顶部 ---------- */
.topbar {
  display: flex; align-items: center; justify-content: space-between;
  padding: 14px 16px; background: var(--surface);
  border-bottom: 1px solid var(--line);
}
.topbar h1 { margin: 0; font-size: 17px; font-weight: 600; }
.topbar .who { font-size: 13px; color: var(--text-2); }

/* ---------- 卡片 ---------- */
.card {
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 16px;
  margin-bottom: 14px;
}
.card h2 {
  margin: 0 0 4px; font-size: 15px; font-weight: 600;
  display: flex; align-items: center; justify-content: space-between;
}
.card .hint { margin: 0 0 12px; font-size: 13px; color: var(--text-3); }

/* ---------- 日期网格 ---------- */
.days { display: grid; grid-template-columns: repeat(4, 1fr); gap: 8px; }
@media (max-width: 380px) { .days { grid-template-columns: repeat(3, 1fr); } }

.day {
  position: relative;
  border: 1.5px solid var(--line);
  border-radius: 10px;
  background: var(--surface);
  padding: 10px 4px;
  text-align: center;
  cursor: pointer;
  transition: border-color .15s, background .15s;
  user-select: none;
}
.day:active { transform: scale(.97); }
.day .wd { font-size: 13px; color: var(--text-2); }
.day .dt { font-size: 16px; font-weight: 600; margin-top: 2px; }
.day .tag {
  position: absolute; top: -7px; right: -4px;
  background: var(--brand); color: #fff;
  font-size: 10px; padding: 1px 5px; border-radius: 6px;
}
.day.on { border-color: var(--brand); background: var(--brand-soft); }
.day.on .wd, .day.on .dt { color: var(--brand); }
.day.done { opacity: .45; pointer-events: none; }
.tag-done { background: var(--text-3); }

/* ---------- 开关 ---------- */
.switch { position: relative; display: inline-block; width: 44px; height: 24px; }
.switch input { opacity: 0; width: 0; height: 0; }
.switch .slider {
  position: absolute; cursor: pointer; inset: 0;
  background: #cdd2d7; border-radius: 999px; transition: background .2s;
}
.switch .slider::before {
  content: ""; position: absolute; height: 18px; width: 18px;
  left: 3px; top: 3px; background: #fff; border-radius: 50%; transition: transform .2s;
}
.switch input:checked + .slider { background: var(--brand); }
.switch input:checked + .slider::before { transform: translateX(20px); }
.switch input:disabled + .slider { opacity: .6; cursor: not-allowed; }

/* ---------- 按钮 ---------- */
.btn {
  display: block; width: 100%; border: none;
  border-radius: 10px; padding: 14px;
  font-size: 16px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:disabled { background: #c3c8cd; cursor: not-allowed; }
.btn-ghost {
  background: transparent; color: var(--text-2);
  border: 1px solid var(--line); font-weight: 400; font-size: 14px; padding: 10px;
}

/* ---------- 底部操作条 ---------- */
.dock {
  position: sticky; bottom: 0; left: 0; right: 0;
  max-width: 560px; margin: 0 auto;
  padding: 12px 16px calc(12px + env(safe-area-inset-bottom));
  background: rgba(255,255,255,.96);
  border-top: 1px solid var(--line);
  backdrop-filter: blur(8px);
}
.dock .sum { font-size: 13px; color: var(--text-2); margin-bottom: 8px; text-align: center; }

/* ---------- 提示条 ---------- */
.note { border-radius: 10px; padding: 11px 13px; font-size: 13px; margin-bottom: 14px; }
.note-ok { background: var(--brand-soft); color: #05612e; }
.note-warn { background: var(--warn-soft); color: var(--warn); }
.note-err { background: var(--danger-soft); color: var(--danger); }

/* ---------- 结果列表 ---------- */
.res { list-style: none; margin: 0; padding: 0; }
.res li {
  display: flex; align-items: flex-start; gap: 9px;
  padding: 9px 0; border-bottom: 1px solid var(--line); font-size: 14px;
}
.res li:last-child { border-bottom: none; }
.dot { width: 7px; height: 7px; border-radius: 50%; margin-top: 8px; flex-shrink: 0; }
.dot-ok { background: var(--brand); }
.dot-no { background: var(--danger); }
.res .d { font-weight: 500; min-width: 62px; }
.res .m { color: var(--text-2); flex: 1; }

/* ---------- 表单 ---------- */
.field { margin-bottom: 14px; }
.field label { display: block; font-size: 13px; color: var(--text-2); margin-bottom: 6px; }
.field input {
  width: 100%; padding: 12px; font-size: 16px;
  border: 1px solid var(--line); border-radius: 10px;
  font-family: inherit; background: var(--surface); color: var(--text);
}
.field input:focus { outline: none; border-color: var(--brand); }

/* ---------- 杂项 ---------- */
.spin {
  display: inline-block; width: 14px; height: 14px;
  border: 2px solid rgba(255,255,255,.4); border-top-color: #fff;
  border-radius: 50%; animation: r .7s linear infinite; vertical-align: -2px;
}
@keyframes r { to { transform: rotate(360deg); } }
.hidden { display: none !important; }
.center { text-align: center; }
.muted { color: var(--text-3); font-size: 12px; }
