:root {
  --bg: #f4f6fb;
  --card: #ffffff;
  --ink: #1f2430;
  --muted: #8a90a2;
  --brand: #6366f1;
  --brand-d: #4f46e5;
  --ok: #10b981;
  --line: #eceef5;
  --shadow: 0 6px 20px rgba(31, 36, 48, .07);
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Segoe UI", Roboto, sans-serif;
  background: var(--bg); color: var(--ink);
  min-height: 100vh; min-height: 100dvh;
}
#app { max-width: 480px; margin: 0 auto; padding: 0 16px 32px; }
.screen { padding-top: 28px; }
.hidden { display: none !important; }

/* 登录 */
.login-head { text-align: center; margin-bottom: 24px; }
.logo { font-size: 52px; line-height: 1; }
.login-head h1 { font-size: 24px; margin: 8px 0 4px; }
.sub { color: var(--muted); margin: 0; font-size: 14px; }
.avatar-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: 12px; }
.avatar-card {
  background: var(--card); border: 2px solid transparent; border-radius: 18px;
  padding: 16px 8px; text-align: center; box-shadow: var(--shadow); cursor: pointer;
  transition: transform .12s, border-color .12s;
}
.avatar-card:active { transform: scale(.96); }
.avatar-card.sel { border-color: var(--brand); }
.avatar-card .ava { font-size: 40px; }
.avatar-card .nm { font-size: 13px; margin-top: 6px; color: var(--ink); }

.ava { display: inline-flex; align-items: center; justify-content: center;
  width: 36px; height: 36px; border-radius: 50%; font-size: 22px; background: #eef0f8; }
.topbar .ava { width: 30px; height: 30px; font-size: 18px; }

.pin-wrap { margin-top: 22px; }
.pin-user { text-align: center; font-weight: 600; display: flex; gap: 8px; align-items: center; justify-content: center; }
.pin-dots { display: flex; gap: 12px; justify-content: center; margin: 14px 0 6px; }
.pin-dots i { width: 14px; height: 14px; border-radius: 50%; background: #d6d9e6; }
.pin-dots i.on { background: var(--brand); }
.pin-msg { text-align: center; color: #ef4444; font-size: 13px; min-height: 18px; }
.keypad { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; max-width: 280px; margin: 10px auto 0; }
.key {
  border: none; background: var(--card); border-radius: 14px; height: 56px;
  font-size: 22px; font-weight: 600; color: var(--ink); box-shadow: var(--shadow); cursor: pointer;
}
.key:active { background: #eef0f8; }
.key-del, .key-back { color: var(--muted); font-size: 20px; }

/* 顶栏 */
.topbar { display: flex; align-items: center; justify-content: space-between; margin-bottom: 18px; }
.me { display: flex; align-items: center; gap: 8px; font-weight: 600; }
.ghost-btn { border: 1px solid var(--line); background: var(--card); color: var(--muted);
  border-radius: 10px; padding: 7px 12px; font-size: 13px; cursor: pointer; }
.ghost-btn:active { background: #eef0f8; }

/* 孩子统计 */
.stat-row { display: grid; grid-template-columns: repeat(3, 1fr); gap: 10px; margin-bottom: 14px; }
.stat { background: var(--card); border-radius: 16px; padding: 14px 6px; text-align: center; box-shadow: var(--shadow); }
.stat-num { font-size: 26px; font-weight: 700; color: var(--brand); }
.stat-lbl { font-size: 12px; color: var(--muted); margin-top: 2px; }

.date-bar { display: flex; align-items: center; gap: 10px; justify-content: center; margin-bottom: 14px; }
.date-bar input[type=date] { border: 1px solid var(--line); border-radius: 10px; padding: 7px 10px; font-size: 14px; background: var(--card); }

/* 任务列表 */
.task-list { display: flex; flex-direction: column; gap: 10px; }
.task {
  display: flex; align-items: center; gap: 12px; background: var(--card); border-radius: 16px;
  padding: 14px; box-shadow: var(--shadow);
}
.task .t-ico { font-size: 28px; width: 40px; text-align: center; }
.task .t-main { flex: 1; }
.task .t-title { font-weight: 600; font-size: 16px; }
.task .t-pts { font-size: 12px; color: var(--muted); margin-top: 2px; }
.task .t-check {
  width: 44px; height: 44px; border-radius: 50%; border: 2px solid var(--line);
  background: var(--card); font-size: 22px; color: transparent; cursor: pointer; flex: none;
  display: flex; align-items: center; justify-content: center; transition: all .15s;
}
.task.done { background: #ecfdf5; }
.task.done .t-check { background: var(--ok); border-color: var(--ok); color: #fff; }
.task.done .t-title { color: var(--ok); }

/* 家长 */
.tabs { display: flex; gap: 8px; background: var(--card); padding: 6px; border-radius: 14px; box-shadow: var(--shadow); margin-bottom: 16px; }
.tab { flex: 1; border: none; background: transparent; padding: 10px; border-radius: 10px; font-size: 14px; font-weight: 600; color: var(--muted); cursor: pointer; }
.tab.active { background: var(--brand); color: #fff; }
.kid-card { background: var(--card); border-radius: 16px; padding: 16px; box-shadow: var(--shadow); margin-bottom: 10px; display: flex; align-items: center; gap: 12px; }
.kid-card .info { flex: 1; }
.kid-card .nm { font-weight: 700; font-size: 16px; }
.kid-card .meta { font-size: 13px; color: var(--muted); margin-top: 4px; }
.kid-card .big { text-align: center; }
.kid-card .big .n { font-size: 22px; font-weight: 700; color: var(--brand); }
.kid-card .big .l { font-size: 11px; color: var(--muted); }

.row { display: flex; gap: 8px; margin-bottom: 12px; }
.row input, .row select { flex: 1; border: 1px solid var(--line); border-radius: 10px; padding: 10px; font-size: 14px; background: var(--card); }
.btn { border: none; border-radius: 10px; padding: 10px 14px; font-size: 14px; font-weight: 600; cursor: pointer; }
.btn-primary { background: var(--brand); color: #fff; }
.btn-primary:active { background: var(--brand-d); }
.btn-danger { background: #fee2e2; color: #dc2626; }
.list-item { background: var(--card); border-radius: 14px; padding: 12px 14px; box-shadow: var(--shadow); margin-bottom: 8px; display: flex; align-items: center; gap: 10px; }
.list-item .li-main { flex: 1; }
.list-item .li-title { font-weight: 600; }
.list-item .li-sub { font-size: 12px; color: var(--muted); margin-top: 2px; }
.section-title { font-size: 14px; color: var(--muted); margin: 14px 0 8px; font-weight: 600; }

/* toast */
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%);
  background: rgba(31,36,48,.92); color: #fff; padding: 10px 18px; border-radius: 12px; font-size: 14px; z-index: 99; }
