:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --text: #1f2430;
  --muted: #6b7280;
  --line: #e6e8ec;
  --primary: #2563eb;
  --danger: #dc2626;
  --ok: #16a34a;
  --shadow: 0 2px 12px rgba(20, 30, 60, 0.06);
  --radius: 14px;
}
* { box-sizing: border-box; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Microsoft YaHei", sans-serif;
  -webkit-font-smoothing: antialiased;
}
.app { max-width: 640px; margin: 0 auto; padding: 16px 16px calc(24px + env(safe-area-inset-bottom)); }
.header { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 16px; }
.brand { display: flex; align-items: center; gap: 12px; }
.brand-icon { width: 44px; height: 44px; display: grid; place-items: center; font-size: 24px; background: var(--primary); border-radius: 12px; }
.header h1 { font-size: 20px; margin: 0; }
.subtitle { margin: 2px 0 0; font-size: 12px; color: var(--muted); }
.btn { border: 0; border-radius: 10px; padding: 10px 16px; font-size: 14px; cursor: pointer; font-weight: 600; }
.btn-primary { background: var(--primary); color: #fff; }
.btn-primary:disabled { opacity: .55; cursor: default; }
.btn-block { width: 100%; margin-top: 4px; padding: 12px; }
.btn-sm { padding: 6px 12px; font-size: 13px; }
.btn-ghost { background: #f0f2f5; color: var(--text); }
.btn-danger { background: #fee2e2; color: var(--danger); }
.banner { background: #fff7ed; border: 1px solid #fed7aa; color: #9a3412; padding: 12px 14px; border-radius: 10px; font-size: 13px; line-height: 1.6; margin-bottom: 12px; }
.card { background: var(--card); border-radius: var(--radius); padding: 18px; box-shadow: var(--shadow); }
.card-title { font-size: 15px; margin: 0 0 14px; }
.field { display: block; margin-bottom: 12px; }
.field-label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field-label em { color: var(--danger); font-style: normal; }
input[type=text], input[type=number], input[type=datetime-local] {
  width: 100%; padding: 11px 12px; border: 1px solid var(--line); border-radius: 10px;
  font-size: 15px; background: #fff; color: var(--text); outline: none;
}
input:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,.1); }
.field-row { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; }
.tasks-section { margin-top: 20px; }
.section-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: 12px; }
.section-head .card-title { margin: 0; }
.filter { display: flex; gap: 6px; }
.filter-btn { border: 0; background: transparent; color: var(--muted); padding: 6px 10px; border-radius: 8px; font-size: 13px; cursor: pointer; }
.filter-btn.active { background: #e8eefc; color: var(--primary); font-weight: 600; }
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task {
  background: var(--card); border-radius: var(--radius); padding: 14px 16px;
  box-shadow: var(--shadow); border-left: 4px solid var(--primary);
}
.task.done { border-left-color: var(--ok); opacity: .72; }
.task.highlight { animation: pulse 1.4s ease-in-out 2; }
@keyframes pulse { 0%,100% { box-shadow: var(--shadow); } 50% { box-shadow: 0 0 0 4px rgba(37,99,235,.25); } }
.task-top { display: flex; justify-content: space-between; align-items: flex-start; gap: 10px; }
.task-title { font-size: 15px; font-weight: 600; word-break: break-word; }
.task.done .task-title { text-decoration: line-through; }
.task-note { font-size: 13px; color: var(--muted); margin-top: 4px; word-break: break-word; }
.task-meta { font-size: 12px; color: var(--muted); margin-top: 8px; display: flex; flex-wrap: wrap; gap: 12px; }
.badge { display: inline-block; padding: 2px 8px; border-radius: 20px; font-size: 11px; }
.badge.active { background: #dbeafe; color: #1d4ed8; }
.badge.done { background: #dcfce7; color: #15803d; }
.task-actions { display: flex; gap: 8px; margin-top: 12px; flex-wrap: wrap; }
.empty { text-align: center; color: var(--muted); padding: 40px 16px; font-size: 14px; }
.footer { margin-top: 24px; text-align: center; }
.footer p { font-size: 11px; color: var(--muted); line-height: 1.7; }
.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translateX(-50%);
  background: #1f2430; color: #fff; padding: 10px 18px; border-radius: 10px;
  font-size: 14px; z-index: 99; box-shadow: 0 6px 24px rgba(0,0,0,.2);
}
.hidden { display: none !important; }
@media (max-width: 420px) { .field-row { grid-template-columns: 1fr; } }
