/* 家庭成长积分 · 网页版样式（对齐小程序视觉：浅色卡片 + 紫色主色 #5b5fe6） */
* { box-sizing: border-box; }
html, body { margin: 0; padding: 0; }
body {
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", Roboto, Helvetica, Arial, sans-serif;
  background: #f2f3f7; color: #1f2329; font-size: 14px; line-height: 1.5;
}
h1, h2, h3 { margin: 0; }
.hidden { display: none !important; }

/* ---------- 登录 ---------- */
.login-wrap { min-height: 100vh; display: flex; align-items: center; justify-content: center; padding: 20px; }
.login-card { background: #fff; width: 100%; max-width: 380px; padding: 28px 26px; border-radius: 16px; box-shadow: 0 8px 30px rgba(0,0,0,.08); }
.login-card h1 { font-size: 22px; text-align: center; }
.login-card .sub { text-align: center; color: #9aa0a6; margin: 6px 0 18px; font-size: 13px; }
.tabs { display: flex; gap: 8px; margin-bottom: 16px; }
.tab { flex: 1; padding: 9px 0; border: 1px solid #e3e6ec; background: #fff; border-radius: 10px; cursor: pointer; color: #555; font-size: 14px; }
.tab.active { background: #5b5fe6; border-color: #5b5fe6; color: #fff; }
.form { display: flex; flex-direction: column; gap: 12px; }
.form label { display: flex; flex-direction: column; gap: 6px; font-size: 13px; color: #555; }
.form input, .input, input, select, textarea {
  padding: 9px 11px; border: 1px solid #dcdfe6; border-radius: 9px; font-size: 14px; background: #fff; color: #1f2329;
  font-family: inherit;
}
.form input:focus, .input:focus, input:focus, select:focus, textarea:focus { outline: none; border-color: #5b5fe6; }
.primary { background: #5b5fe6; color: #fff; border: none; padding: 11px 16px; border-radius: 10px; cursor: pointer; font-size: 14px; font-weight: 600; }
.primary:hover { background: #4d50d6; }
.ghost { background: #fff; color: #555; border: 1px solid #e3e6ec; padding: 7px 12px; border-radius: 9px; cursor: pointer; font-size: 13px; }
.hint { font-size: 12px; color: #9aa0a6; margin: 4px 0 0; }
.msg { font-size: 13px; margin-top: 10px; min-height: 18px; }
.msg.ok { color: #1a9c54; }
.msg.err { color: #e5484d; }

/* ---------- 应用框架 ---------- */
.app { min-height: 100vh; display: flex; flex-direction: column; }
.topbar { display: flex; align-items: center; justify-content: space-between; padding: 12px 18px; background: #fff; box-shadow: 0 1px 0 #eceef2; position: sticky; top: 0; z-index: 10; }
.brand { font-weight: 700; font-size: 16px; }
.user { display: flex; align-items: center; gap: 8px; font-size: 13px; color: #555; }
.nav { display: flex; flex-wrap: wrap; gap: 8px; padding: 10px 14px; background: #fff; border-bottom: 1px solid #eceef2; }
.navbtn { border: 1px solid #e3e6ec; background: #f4f5f8; color: #444; padding: 7px 13px; border-radius: 20px; cursor: pointer; font-size: 13px; }
.navbtn.active { background: #5b5fe6; border-color: #5b5fe6; color: #fff; }
.view { flex: 1; padding: 18px; max-width: 920px; width: 100%; margin: 0 auto; }
.view h2 { font-size: 19px; font-weight: 700; margin-bottom: 4px; }
.view > p.muted { margin: 0 0 8px; }

/* ---------- 通用块 ---------- */
.card { background: #fff; border-radius: 14px; padding: 16px; margin-bottom: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.row { display: flex; align-items: center; justify-content: space-between; gap: 10px; flex-wrap: wrap; }
.row > span, .row > b { font-size: 14px; }
.muted { color: #9aa0a6; font-size: 13px; }
.grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: 12px; }
.member { background: #fff; border-radius: 14px; padding: 14px; box-shadow: 0 2px 10px rgba(0,0,0,.04); }
.member .name { font-weight: 600; font-size: 15px; }
.points-badge { background: #eef0ff; color: #5b5fe6; padding: 3px 10px; border-radius: 12px; font-size: 13px; font-weight: 600; }
.badge { background: #eef1f6; color: #555; padding: 2px 9px; border-radius: 10px; font-size: 12px; font-weight: 600; }
.badge.ok { background: #e6f7ed; color: #1a9c54; }
.badge.gray { background: #f0f1f5; color: #888; }

/* 章节标题（对齐小程序 section-title） */
.section-title { font-weight: 700; font-size: 15px; color: #333; margin: 16px 0 8px; display: flex; align-items: center; gap: 8px; }
.section-title .more { font-weight: 400; font-size: 12px; color: #9aa0a6; }
.section-title .more.warn { color: #e5484d; }

/* ---------- 胶囊 / 选项 ---------- */
.chips { display: flex; flex-wrap: wrap; gap: 8px; }
.chip { border: 1px solid #e3e6ec; background: #fff; color: #444; padding: 7px 13px; border-radius: 18px; cursor: pointer; font-size: 13px; }
.chip:hover { border-color: #b9bdf0; }
.chip.active { background: #5b5fe6; border-color: #5b5fe6; color: #fff; }
.chip.fixed { background: #eef1f6; color: #888; cursor: default; border-color: #e3e6ec; }
.ck { display: inline-flex; align-items: center; gap: 6px; font-size: 13px; color: #444; }
.ck input[type=checkbox], .ck input[type=radio] { width: 16px; height: 16px; accent-color: #5b5fe6; }

/* ---------- 表单项 ---------- */
.form-item { margin: 14px 0; }
.form-label { display: block; font-size: 13px; color: #555; margin-bottom: 6px; }
.form-tip { font-size: 12px; color: #9aa0a6; margin-top: 6px; }

/* 题型分组 / 配置标题 */
.mg-head { font-weight: 600; font-size: 14px; color: #333; margin: 12px 0 4px; display: flex; align-items: center; gap: 6px; }
.mg-themes { font-size: 12px; color: #9aa0a6; font-weight: 400; }
.cfg-title { font-weight: 600; font-size: 14px; color: #333; margin: 12px 0 4px; }

/* ---------- 按钮 ---------- */
.btn-sm { padding: 6px 12px; border-radius: 10px; border: 1px solid #e3e6ec; background: #fff; color: #444; cursor: pointer; font-size: 13px; }
.btn-sm:hover { border-color: #b9bdf0; }
.btn-sm.primary { background: #5b5fe6; border-color: #5b5fe6; color: #fff; }
.btn-sm.primary:hover { background: #4d50d6; }

/* ---------- 任务 / 奖励 / 题库 / 错题 / 积分 ---------- */
.task, .reward, .lib, .witem, .log { background: #fff; border-radius: 12px; padding: 14px; margin-bottom: 10px; box-shadow: 0 2px 8px rgba(0,0,0,.04); }
.task .badge, .reward .cost { font-weight: 600; }
.reward .cost { color: #e5892b; margin-left: 6px; }
.st { font-size: 12px; font-weight: 600; padding: 1px 8px; border-radius: 9px; }
.st.ok { background: #e6f7ed; color: #1a9c54; }
.st.pend { background: #eef1f6; color: #888; }
.st.exp { background: #fdeaea; color: #e5484d; }
.q { font-weight: 500; }
.qcard { border: 1px solid #eef1f6; border-radius: 10px; padding: 10px; margin-bottom: 8px; background: #fafbff; }
.ans { font-size: 13px; margin-top: 4px; color: #1a9c54; }
.ans.wrong { color: #e5484d; }
.witem.resolved { opacity: .55; }
.log .detail { font-weight: 500; }
.log .plus { color: #1a9c54; font-weight: 700; }
.log .minus { color: #e5484d; font-weight: 700; }
.qcard input, .log input, .task input { margin: 0 6px; }

/* ---------- 弹窗 / Toast ---------- */
.modal { position: fixed; inset: 0; background: rgba(0,0,0,.4); display: flex; align-items: center; justify-content: center; z-index: 50; padding: 20px; }
.modal-card, .modal > div { background: #fff; border-radius: 16px; padding: 22px; width: 100%; max-width: 420px; box-shadow: 0 12px 40px rgba(0,0,0,.2); }
.modal-card h3 { margin-bottom: 14px; }
.picker-item { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 10px 0; border-bottom: 1px solid #f0f1f5; }
.toast { position: fixed; left: 50%; bottom: 40px; transform: translateX(-50%); background: rgba(0,0,0,.82); color: #fff; padding: 10px 18px; border-radius: 22px; font-size: 13px; z-index: 100; max-width: 90vw; }

/* ---------- 视角切换（家长管理 / 孩子视角）---------- */
.view-switch { display: inline-flex; align-items: center; gap: 6px; background: #f1f2f8; border-radius: 22px; padding: 3px 6px; }
.vs-label { font-size: 12px; color: #8a8fa3; margin-right: 2px; padding-left: 6px; }
.vs-btn { border: none; background: transparent; color: #5b5fe6; font-size: 13px; padding: 6px 12px; border-radius: 18px; cursor: pointer; transition: all .15s; }
.vs-btn:hover { background: #e8e9fb; }
.vs-btn.on { background: #5b5fe6; color: #fff; font-weight: 600; }
/* 顶栏在窄屏换行 */
@media (max-width: 720px) {
  .topbar { flex-wrap: wrap; gap: 8px; }
  .view-switch { order: 3; }
}
