:root {
  --bg: #f4f4f7;
  --card: #fff;
  --line: #e6e6ec;
  --ink: #1a1a22;
  --ink-2: #5a5a6b;
  --ink-3: #9191a3;
  --brand: #2f6df6;
  --urgent: #e2564a;
  --important: #e59a3a;
  --radius: 16px;
}

* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  background: var(--bg); color: var(--ink);
  font: 15px/1.6 -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  -webkit-font-smoothing: antialiased; padding-bottom: 40px;
}
.wrap { max-width: 560px; margin: 0 auto; padding: 20px 16px 0; }

.top { display: flex; align-items: center; justify-content: space-between; padding: 4px 2px 18px; }
.brand { display: flex; align-items: center; gap: 9px; }
.dot { width: 11px; height: 11px; border-radius: 50%; background: var(--brand); box-shadow: 0 0 0 4px #e7effd; }
.brand h1 { font-size: 17px; font-weight: 600; margin: 0; }
.weak { font-size: 12px; color: var(--ink-3); }

.card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); padding: 18px; margin-bottom: 14px; }

#f-text {
  width: 100%; border: 0; outline: none; background: transparent;
  font-size: 17px; color: var(--ink); font-family: inherit; padding: 2px 0 10px;
  border-bottom: 1.5px solid var(--line);
}
#f-text:focus { border-color: #c9d8fb; }
#f-text::placeholder { color: #b9b9c6; }

.opts { display: flex; align-items: center; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.pri-pick { display: flex; gap: 3px; padding: 3px; background: #f0f0f4; border-radius: 9px; }
.pri-pick button {
  border: 0; background: transparent; padding: 5px 11px; border-radius: 7px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer; font-family: inherit;
}
.pri-pick button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.07); }

#f-date {
  border: 1px solid var(--line); background: #fbfbfd; border-radius: 9px;
  padding: 6px 9px; font-size: 13px; color: var(--ink); font-family: inherit; outline: none;
}
.btn-main-sm {
  margin-left: auto; border: 0; background: var(--brand); color: #fff;
  padding: 8px 18px; border-radius: 9px; font-size: 13.5px; font-weight: 600;
  cursor: pointer; font-family: inherit;
}
.btn-main-sm:hover { background: #2559d6; }

.toolbar { display: flex; align-items: center; justify-content: space-between; gap: 10px; margin-bottom: 6px; }
.tabs { display: flex; gap: 3px; padding: 3px; background: #f0f0f4; border-radius: 9px; }
.tabs button {
  border: 0; background: transparent; padding: 5px 12px; border-radius: 7px;
  font-size: 12.5px; color: var(--ink-2); cursor: pointer; font-family: inherit;
}
.tabs button.on { background: #fff; color: var(--ink); font-weight: 600; box-shadow: 0 1px 3px rgba(0,0,0,.07); }
#sort {
  border: 1px solid var(--line); background: #fff; border-radius: 9px;
  padding: 6px 8px; font-size: 12.5px; color: var(--ink-2); font-family: inherit; outline: none; cursor: pointer;
}

.tasks { list-style: none; margin: 0; padding: 0; }
.task { display: flex; align-items: flex-start; gap: 11px; padding: 11px 0; border-top: 1px solid #f2f2f6; }
.task:first-child { border-top: 0; }

.chk {
  width: 20px; height: 20px; border-radius: 6px; border: 1.6px solid #cfcfe0;
  background: #fff; cursor: pointer; flex: 0 0 auto; margin-top: 2px;
  display: flex; align-items: center; justify-content: center; padding: 0;
  transition: .15s;
}
.chk:hover { border-color: var(--brand); }
.chk.on { background: var(--brand); border-color: var(--brand); }
.chk svg { width: 12px; height: 12px; opacity: 0; }
.chk.on svg { opacity: 1; }

.body { flex: 1; min-width: 0; }
.txt { font-size: 15px; line-height: 1.5; word-break: break-word; outline: none; }
.task.done .txt { color: var(--ink-3); text-decoration: line-through; }
.meta { display: flex; align-items: center; gap: 8px; margin-top: 3px; flex-wrap: wrap; }
.pill {
  font-size: 11px; padding: 1.5px 7px; border-radius: 20px; background: #f2f2f6; color: var(--ink-3);
}
.pill.p0 { background: #fdeceb; color: var(--urgent); }
.pill.p1 { background: #fdf3e4; color: #b97a1d; }
.due { font-size: 11.5px; color: var(--ink-3); }
.due.over { color: var(--urgent); }
.due.today { color: var(--important); }
.del {
  border: 0; background: none; color: #c9c9d4; cursor: pointer; font-size: 18px;
  padding: 0 2px; line-height: 1; font-family: inherit; flex: 0 0 auto;
}
.del:hover { color: var(--urgent); }

.empty { font-size: 13px; color: var(--ink-3); margin: 10px 0 0; }
.foot-row { display: flex; align-items: center; justify-content: space-between; margin-top: 12px; padding-top: 12px; border-top: 1px solid #f2f2f6; }
.linkbtn { border: 0; background: none; color: var(--ink-3); font-size: 12px; cursor: pointer; font-family: inherit; padding: 0; }
.linkbtn:hover { color: var(--urgent); }
.foot { text-align: center; font-size: 12px; color: #b3b3c1; padding: 8px 0 20px; }

@media (max-width: 420px) {
  .toolbar { flex-direction: column; align-items: stretch; }
  #sort { width: 100%; }
}
