/* ===========================================================
   错题星球 · 样式表
   浅色主题 / 卡片化 / 移动端底部导航
   =========================================================== */

:root {
  --bg: #f3f5fb;
  --bg-soft: #eef1f9;
  --card: #ffffff;
  --ink: #1b2335;
  --ink-2: #475069;
  --muted: #8b93a7;
  --line: #e7eaf3;
  --line-2: #f0f2f8;
  --brand: #4f6ef7;
  --brand-deep: #3b56d6;
  --brand-soft: #eef2ff;
  --ok: #12a05c;
  --ok-soft: #e9f8f0;
  --warn: #e39a2b;
  --warn-soft: #fdf4e3;
  --bad: #e05a5a;
  --bad-soft: #fdeeee;
  --radius: 18px;
  --radius-sm: 12px;
  --shadow: 0 8px 26px rgba(27, 35, 53, .06);
  --shadow-lg: 0 20px 60px rgba(27, 35, 53, .16);
}

* { box-sizing: border-box; }

html, body { margin: 0; padding: 0; }

body {
  background: var(--bg);
  color: var(--ink);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  font-size: 15px;
  line-height: 1.62;
  -webkit-font-smoothing: antialiased;
}

h1, h2, h3, h4, p, ul, ol { margin: 0; }
ul, ol { padding: 0; list-style: none; }

button { font-family: inherit; font-size: inherit; cursor: pointer; border: 0; background: none; color: inherit; }
input, select, textarea { font-family: inherit; font-size: inherit; color: inherit; }
a { color: var(--brand); text-decoration: none; }

/* ---------- 布局 ---------- */
.app { display: flex; min-height: 100vh; }

.sidebar {
  width: 236px;
  flex: 0 0 236px;
  position: sticky;
  top: 0;
  height: 100vh;
  background: #fff;
  border-right: 1px solid var(--line);
  padding: 22px 14px 18px;
  display: flex;
  flex-direction: column;
  gap: 20px;
}

.brand { display: flex; align-items: center; gap: 10px; padding: 0 8px; }
.brand-logo {
  width: 42px; height: 42px; flex: 0 0 42px;
  border-radius: 14px;
  display: grid; place-items: center;
  font-size: 22px;
  background: linear-gradient(135deg, #4f6ef7, #8b5cf6);
  box-shadow: 0 6px 16px rgba(79, 110, 247, .34);
}
.brand-txt { display: flex; flex-direction: column; line-height: 1.25; }
.brand-txt b { font-size: 16px; letter-spacing: .4px; }
.brand-txt span { font-size: 11.5px; color: var(--muted); }

.nav { display: flex; flex-direction: column; gap: 4px; }
.nav-item {
  display: flex; align-items: center; gap: 10px;
  padding: 10px 12px;
  border-radius: var(--radius-sm);
  color: var(--ink-2);
  font-size: 14.5px;
  position: relative;
  transition: background .16s, color .16s;
  text-align: left;
}
.nav-item i { font-style: normal; font-size: 17px; width: 20px; text-align: center; }
.nav-item em { font-style: normal; }
.nav-item:hover { background: var(--bg-soft); color: var(--ink); }
.nav-item.active { background: var(--brand-soft); color: var(--brand-deep); font-weight: 600; }
.nav-item.active::before {
  content: ""; position: absolute; left: 0; top: 50%; transform: translateY(-50%);
  width: 3px; height: 18px; border-radius: 3px; background: var(--brand);
}

.side-foot {
  margin-top: auto;
  font-size: 11.5px;
  color: var(--muted);
  display: flex; align-items: center; gap: 6px;
  padding: 0 8px;
}
.dot { width: 6px; height: 6px; border-radius: 50%; background: var(--ok); box-shadow: 0 0 0 3px var(--ok-soft); }

.main { flex: 1; min-width: 0; padding: 26px clamp(16px, 3vw, 38px) 70px; }
.view { max-width: 1080px; margin: 0 auto; }
.page { display: flex; flex-direction: column; gap: 16px; animation: rise .26s ease both; }
@keyframes rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }

/* ---------- 通用组件 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--line);
  border-radius: var(--radius);
  padding: 20px;
  box-shadow: var(--shadow);
}
.card.tight { padding: 16px; }
.card-head { display: flex; align-items: center; justify-content: space-between; gap: 12px; margin-bottom: 14px; }
.card-head h2 { font-size: 16px; letter-spacing: .2px; }
.card-head h2 small { font-weight: 400; color: var(--muted); font-size: 12.5px; margin-left: 6px; }

.page-head { display: flex; align-items: flex-end; justify-content: space-between; gap: 14px; flex-wrap: wrap; }
.page-head h1 { font-size: 24px; letter-spacing: .5px; }
.page-head .sub { color: var(--muted); font-size: 13.5px; margin-top: 2px; }

.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  padding: 9px 16px;
  border-radius: 11px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 14px;
  font-weight: 500;
  transition: transform .12s, box-shadow .16s, background .16s, border-color .16s;
  white-space: nowrap;
}
.btn:hover { border-color: #ccd4ea; background: #fbfcff; }
.btn:active { transform: translateY(1px); }
.btn.primary {
  background: linear-gradient(135deg, #5573ff, #4a63e6);
  border-color: transparent;
  color: #fff;
  box-shadow: 0 8px 18px rgba(79, 110, 247, .28);
}
.btn.primary:hover { box-shadow: 0 10px 22px rgba(79, 110, 247, .36); }
.btn.ghost { background: transparent; border-color: transparent; color: var(--brand); padding: 6px 8px; }
.btn.ghost:hover { background: var(--brand-soft); }
.btn.danger { color: var(--bad); border-color: #f6dada; background: #fff; }
.btn.danger:hover { background: var(--bad-soft); }
.btn.sm { padding: 6px 12px; font-size: 13px; border-radius: 9px; }
.btn.lg { padding: 12px 22px; font-size: 15px; border-radius: 13px; }
.btn.block { width: 100%; }
.btn[disabled] { opacity: .5; cursor: not-allowed; box-shadow: none; }

.input, .select, .textarea {
  width: 100%;
  padding: 9px 12px;
  border: 1px solid var(--line);
  border-radius: 11px;
  background: #fff;
  outline: none;
  transition: border-color .16s, box-shadow .16s;
}
.input:focus, .select:focus, .textarea:focus {
  border-color: #b9c6f8;
  box-shadow: 0 0 0 3px rgba(79, 110, 247, .12);
}
.textarea { resize: vertical; min-height: 84px; line-height: 1.7; }
.label { font-size: 12.5px; color: var(--muted); margin-bottom: 6px; display: block; font-weight: 500; }
.field { margin-bottom: 14px; }
.row { display: flex; gap: 10px; align-items: center; flex-wrap: wrap; }
.grow { flex: 1; min-width: 0; }

.chip {
  display: inline-flex; align-items: center; gap: 5px;
  padding: 6px 13px;
  border-radius: 999px;
  background: #fff;
  border: 1px solid var(--line);
  color: var(--ink-2);
  font-size: 13px;
  transition: .16s;
}
.chip:hover { border-color: #c9d3ee; }
.chip.active { background: var(--brand); border-color: var(--brand); color: #fff; box-shadow: 0 6px 14px rgba(79, 110, 247, .24); }
.chip-row { display: flex; gap: 8px; flex-wrap: wrap; }

.tag {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 2px 9px;
  border-radius: 999px;
  font-size: 11.5px;
  font-weight: 500;
  background: var(--bg-soft);
  color: var(--ink-2);
  white-space: nowrap;
}
.tag.subject { color: #fff; }
.tag.ok { background: var(--ok-soft); color: var(--ok); }
.tag.warn { background: var(--warn-soft); color: #b87a15; }
.tag.bad { background: var(--bad-soft); color: var(--bad); }
.tag.plain { background: transparent; border: 1px solid var(--line); color: var(--muted); }

.muted { color: var(--muted); }
.small { font-size: 12.5px; }
.mono { font-variant-numeric: tabular-nums; }
.center { text-align: center; }
.spacer { flex: 1; }

.empty {
  text-align: center;
  padding: 44px 20px;
  color: var(--muted);
}
.empty .ico { font-size: 34px; display: block; margin-bottom: 8px; opacity: .9; }
.empty b { display: block; color: var(--ink-2); margin-bottom: 4px; font-size: 14.5px; }

.divider { height: 1px; background: var(--line-2); margin: 14px 0; }

/* ---------- 首页 ---------- */
.hero {
  position: relative;
  overflow: hidden;
  border-radius: 22px;
  padding: 24px 26px;
  color: #fff;
  background: linear-gradient(120deg, #4f6ef7 0%, #6366f1 46%, #8b5cf6 100%);
  box-shadow: 0 18px 40px rgba(79, 110, 247, .28);
  display: flex;
  align-items: center;
  gap: 20px;
  flex-wrap: wrap;
}
.hero::after {
  content: ""; position: absolute; right: -60px; top: -80px;
  width: 240px; height: 240px; border-radius: 50%;
  background: rgba(255, 255, 255, .12);
}
.hero-main { position: relative; z-index: 1; flex: 1; min-width: 220px; }
.hero-hi { font-size: 22px; font-weight: 700; letter-spacing: .5px; }
.hero-sub { font-size: 13.5px; opacity: .86; margin-top: 3px; }
.hero-pills { display: flex; gap: 8px; margin-top: 14px; flex-wrap: wrap; }
.hero-pill {
  background: rgba(255, 255, 255, .18);
  border: 1px solid rgba(255, 255, 255, .22);
  padding: 4px 11px; border-radius: 999px;
  font-size: 12px; backdrop-filter: blur(4px);
}
.hero-rings { display: flex; gap: 18px; position: relative; z-index: 1; }

.ring { text-align: center; }
.ring svg { display: block; }
.ring-label { font-size: 11.5px; opacity: .88; margin-top: 2px; }
.ring-val { font-size: 13px; font-weight: 700; fill: #fff; }
.ring-track { fill: none; stroke: rgba(255, 255, 255, .26); }
.ring-bar { fill: none; stroke: #fff; stroke-linecap: round; transition: stroke-dashoffset .6s ease; }

.grid-2 { display: grid; grid-template-columns: minmax(0, 1.25fr) minmax(0, .75fr); gap: 16px; align-items: start; }
.grid-2 > .card { display: flex; flex-direction: column; }
.grid-2 > .card > .card-head { flex: 0 0 auto; }
.grid-3 { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 14px; }
.grid-4 { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 14px; }

.stat {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
}
.stat .k { font-size: 12.5px; color: var(--muted); }
.stat .v { font-size: 26px; font-weight: 700; letter-spacing: .5px; line-height: 1.3; }
.stat .v small { font-size: 12px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.stat .foot { font-size: 11.5px; color: var(--muted); }

.due-card { display: flex; flex-direction: column; gap: 10px; flex: 1; }
.due-card > .btn.primary { margin-top: auto; }
.due-num { font-size: 34px; font-weight: 800; line-height: 1; color: var(--brand); }
.due-num small { font-size: 13px; font-weight: 500; color: var(--muted); margin-left: 4px; }

.quick { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.quick-item {
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 14px 10px;
  background: #fff;
  display: flex; flex-direction: column; gap: 6px; align-items: flex-start;
  transition: .16s;
  text-align: left;
}
.quick-item:hover { border-color: #c6d1f2; background: #fbfcff; transform: translateY(-1px); }
.quick-item .qi { font-size: 20px; }
.quick-item b { font-size: 13.5px; }
.quick-item span { font-size: 11.5px; color: var(--muted); }

.prog { height: 7px; border-radius: 99px; background: #e7ebf6; overflow: hidden; }
.prog > i { display: block; height: 100%; border-radius: 99px; background: linear-gradient(90deg, #6b83ff, #4f6ef7); transition: width .4s; }
.prog.ok > i { background: linear-gradient(90deg, #34c98a, #12a05c); }
.prog.warn > i { background: linear-gradient(90deg, #f7c15e, #e39a2b); }

.goal-row { display: flex; align-items: center; gap: 12px; margin-bottom: 12px; }
.goal-row .g-name { width: 74px; font-size: 13px; color: var(--ink-2); flex: 0 0 74px; }
.goal-row .prog { flex: 1; }
.goal-row .g-val { width: 62px; text-align: right; font-size: 12px; color: var(--muted); }

.tip {
  background: linear-gradient(120deg, #fff8ea, #fffdf7);
  border: 1px solid #f7e8c8;
  color: #7a5a1e;
}
.tip b { color: #6a4a10; }

/* ---------- 错题列表 ---------- */
.mistake-list { display: flex; flex-direction: column; gap: 12px; }
.m-card {
  background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 16px 18px; box-shadow: var(--shadow);
  display: flex; gap: 14px; align-items: flex-start;
  transition: border-color .16s, transform .16s;
}
.m-card:hover { border-color: #cdd7f3; transform: translateY(-1px); }
.m-bar { width: 4px; align-self: stretch; border-radius: 99px; flex: 0 0 4px; }
.m-body { flex: 1; min-width: 0; }
.m-title {
  font-size: 14.5px; font-weight: 500; line-height: 1.55;
  display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden;
  cursor: pointer;
}
.m-meta { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; margin-top: 8px; font-size: 12px; color: var(--muted); }
.m-actions { display: flex; flex-direction: column; gap: 6px; align-items: flex-end; }

/* ---------- 错题详情 ---------- */
.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 16px; align-items: start; }
.stem {
  font-size: 16.5px; line-height: 1.8;
  white-space: pre-wrap;
  padding: 4px 2px 14px;
}
.ans-pair { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 12px; margin: 6px 0 4px; }
.ans-box { border-radius: 14px; padding: 12px 14px; font-size: 14px; white-space: pre-wrap; word-break: break-word; }
.ans-box .ab-k { font-size: 11.5px; display: block; margin-bottom: 2px; opacity: .8; }
.ans-box.wrong { background: var(--bad-soft); color: #b73c3c; border: 1px solid #f7d9d9; }
.ans-box.right { background: var(--ok-soft); color: #0d7a46; border: 1px solid #cfeddd; }

.steps { display: flex; flex-direction: column; gap: 12px; margin-top: 4px; }
.step { display: flex; gap: 12px; }
.step-no {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--brand-soft); color: var(--brand-deep);
  font-size: 12px; font-weight: 700; display: grid; place-items: center;
  margin-top: 2px;
}
.step-txt { flex: 1; font-size: 14.5px; line-height: 1.75; color: var(--ink-2); white-space: pre-wrap; }

.side-list { display: flex; flex-direction: column; gap: 10px; }
.kv { display: flex; justify-content: space-between; gap: 10px; font-size: 13px; padding: 6px 0; border-bottom: 1px dashed var(--line-2); }
.kv:last-child { border-bottom: 0; }
.kv .k { color: var(--muted); }
.kv .v { color: var(--ink-2); text-align: right; }

.timeline { display: flex; flex-direction: column; gap: 8px; margin-top: 6px; }
.tl-item { display: flex; gap: 8px; font-size: 12px; color: var(--muted); align-items: center; }
.tl-dot { width: 7px; height: 7px; border-radius: 50%; background: #ccd5ee; flex: 0 0 7px; }
.tl-dot.ok { background: var(--ok); }
.tl-dot.bad { background: var(--bad); }

.imgs { display: flex; gap: 8px; flex-wrap: wrap; margin-top: 10px; }
.imgs img {
  width: 132px; height: 108px; object-fit: contain;
  background: #fff; border-radius: 10px; border: 1px solid var(--line);
  cursor: zoom-in;
}

/* ---------- 训练 ---------- */
.train-wrap { width: 100%; max-width: 780px; margin: 0 auto; display: flex; flex-direction: column; gap: 16px; }
.train-top { display: flex; align-items: center; gap: 12px; }
.train-top .prog { flex: 1; }
.q-stem { font-size: 17px; line-height: 1.85; white-space: pre-wrap; margin: 6px 0 16px; }
.opts { display: flex; flex-direction: column; gap: 10px; }
.opt {
  display: flex; align-items: flex-start; gap: 12px;
  padding: 13px 16px;
  border: 1.5px solid var(--line);
  border-radius: 14px;
  background: #fff;
  text-align: left;
  font-size: 15px;
  transition: .14s;
  line-height: 1.6;
}
.opt:hover { border-color: #c3cff4; background: #fbfcff; }
.opt .oi {
  flex: 0 0 24px; width: 24px; height: 24px; border-radius: 50%;
  background: var(--bg-soft); color: var(--ink-2);
  display: grid; place-items: center; font-size: 12px; font-weight: 700;
}
.opt.sel { border-color: var(--brand); background: var(--brand-soft); }
.opt.sel .oi { background: var(--brand); color: #fff; }
.opt.right { border-color: #8fd9b5; background: var(--ok-soft); }
.opt.right .oi { background: var(--ok); color: #fff; }
.opt.wrong { border-color: #f0b3b3; background: var(--bad-soft); }
.opt.wrong .oi { background: var(--bad); color: #fff; }
.opt.dim { opacity: .62; }

.verdict { border-radius: 14px; padding: 14px 16px; margin-top: 14px; font-size: 14px; }
.verdict.good { background: var(--ok-soft); border: 1px solid #cfeddd; color: #0d7a46; }
.verdict.bad { background: var(--bad-soft); border: 1px solid #f7d9d9; color: #b73c3c; }
.verdict h4 { font-size: 14px; margin-bottom: 4px; }
.verdict .exp { white-space: pre-wrap; color: var(--ink-2); font-size: 13.5px; line-height: 1.8; margin-top: 6px; padding-top: 8px; border-top: 1px dashed rgba(0, 0, 0, .08); }

.result-hero { text-align: center; padding: 10px 0 4px; }
.result-score { font-size: 46px; font-weight: 800; line-height: 1; letter-spacing: 1px; }
.result-score small { font-size: 15px; color: var(--muted); font-weight: 500; }
.review-q { padding: 12px 0; border-bottom: 1px dashed var(--line-2); }
.review-q:last-child { border-bottom: 0; }
.review-q .rq-stem { font-size: 14px; white-space: pre-wrap; }
.review-q .rq-ans { font-size: 12.5px; color: var(--muted); margin-top: 4px; }

/* ---------- 习惯 ---------- */
.heat { display: grid; grid-template-columns: repeat(7, 34px); gap: 7px; justify-content: center; }
.heat .hd { font-size: 10.5px; color: var(--muted); text-align: center; padding-bottom: 2px; }
.heat .cell {
  width: 34px; height: 34px; border-radius: 7px; background: #eef1f9; box-shadow: inset 0 0 0 1px #e6eaf4;
  display: grid; place-items: center; font-size: 9.5px; color: transparent;
  border: 1px solid transparent;
}
.heat .cell.l1 { background: #d8e0ff; }
.heat .cell.l2 { background: #a9baff; }
.heat .cell.l3 { background: #6d84f7; }
.heat .cell.l4 { background: #4358d8; }
.heat .cell.today { border-color: var(--brand); }
.mini-stats { display: grid; grid-template-columns: repeat(3, minmax(0, 1fr)); gap: 8px; text-align: center; margin-top: 16px; }
.mini-stats .k { font-size: 11.5px; color: var(--muted); }
.mini-stats b { display: block; font-size: 17px; letter-spacing: .3px; margin-top: 2px; }
.heat .cell.out { background: transparent; }

.habit-item {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border-radius: 12px;
  border: 1px solid var(--line);
  margin-bottom: 8px;
  transition: .16s;
  background: #fff;
}
.habit-item.done { background: var(--ok-soft); border-color: #cfeddd; }
.habit-item .h-ico { font-size: 18px; }
.habit-item .h-txt { flex: 1; font-size: 14px; }
.habit-item.done .h-txt { color: #0d7a46; }
.check {
  width: 24px; height: 24px; flex: 0 0 24px; border-radius: 50%;
  border: 1.5px solid #d5dcee; display: grid; place-items: center;
  color: transparent; font-size: 13px; background: #fff;
  transition: .16s;
}
.habit-item.done .check { background: var(--ok); border-color: var(--ok); color: #fff; }

.pomo { text-align: center; justify-content: center; }
.pomo-time { font-size: 44px; font-weight: 700; letter-spacing: 2px; font-variant-numeric: tabular-nums; }
.pomo-mode { font-size: 12px; color: var(--muted); letter-spacing: 1px; }
.pomo-ring { position: relative; width: 168px; height: 168px; margin: 4px auto 10px; display: grid; place-items: center; }
.pomo-ring .pomo-time { font-size: 32px; }
.pomo-ring svg { position: absolute; inset: 0; transform: rotate(-90deg); }

.badges { display: grid; grid-template-columns: repeat(auto-fill, minmax(112px, 1fr)); gap: 10px; }
.badge {
  text-align: center; padding: 14px 8px; border-radius: 14px;
  border: 1px solid var(--line); background: #fff;
  opacity: .48; filter: grayscale(1);
  transition: .18s;
}
.badge.got { opacity: 1; filter: none; border-color: #cddcff; background: linear-gradient(180deg, #f7f9ff, #fff); }
.badge .bi { font-size: 24px; display: block; }
.badge b { display: block; font-size: 12.5px; margin-top: 4px; }
.badge span { font-size: 10.5px; color: var(--muted); }

/* ---------- 图表 ---------- */
.bar-row { display: flex; align-items: center; gap: 10px; margin-bottom: 10px; }
.bar-row .bn { width: 92px; flex: 0 0 92px; font-size: 12.5px; color: var(--ink-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bar-row .bt { flex: 1; height: 10px; border-radius: 99px; background: var(--bg-soft); overflow: hidden; }
.bar-row .bt > i { display: block; height: 100%; border-radius: 99px; }
.bar-row .bv { width: 42px; text-align: right; font-size: 12px; color: var(--muted); font-variant-numeric: tabular-nums; }

.chart-box svg { width: 100%; height: auto; display: block; }
.chart-legend { display: flex; gap: 14px; font-size: 11.5px; color: var(--muted); margin-top: 6px; }
.chart-legend i { width: 8px; height: 8px; border-radius: 3px; display: inline-block; margin-right: 4px; }

/* ---------- 设置 / 科目 ---------- */
.subject-row {
  display: flex; align-items: center; gap: 12px;
  padding: 11px 12px; border: 1px solid var(--line); border-radius: 13px; margin-bottom: 8px;
  background: #fff;
}
.subject-dot { width: 34px; height: 34px; border-radius: 11px; display: grid; place-items: center; color: #fff; font-size: 16px; flex: 0 0 34px; }
.subject-row .s-name { font-weight: 600; font-size: 14px; }
.subject-row .s-meta { font-size: 11.5px; color: var(--muted); }

.color-pick { display: flex; gap: 8px; flex-wrap: wrap; }
.color-pick button { width: 26px; height: 26px; border-radius: 8px; border: 2px solid transparent; }
.color-pick button.on { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }

/* ---------- 弹窗 ---------- */
.overlay {
  position: fixed; inset: 0; z-index: 60;
  background: rgba(20, 26, 40, .42);
  backdrop-filter: blur(3px);
  display: flex; align-items: flex-start; justify-content: center;
  padding: 40px 16px;
  overflow-y: auto;
  animation: fade .16s ease both;
}
@keyframes fade { from { opacity: 0 } to { opacity: 1 } }
.modal {
  background: #fff; border-radius: 20px; width: 100%; max-width: 560px;
  box-shadow: var(--shadow-lg);
  animation: pop .2s ease both;
  margin: auto;
}
.modal.wide { max-width: 720px; }
@keyframes pop { from { opacity: 0; transform: translateY(10px) scale(.99); } to { opacity: 1; transform: none; } }
.modal-head { display: flex; align-items: center; justify-content: space-between; padding: 18px 22px 10px; }
.modal-head h3 { font-size: 16.5px; }
.modal-body { padding: 6px 22px 8px; max-height: 66vh; overflow-y: auto; }
.modal-foot { display: flex; gap: 10px; justify-content: flex-end; padding: 14px 22px 20px; }
.x-btn { width: 30px; height: 30px; border-radius: 9px; display: grid; place-items: center; color: var(--muted); font-size: 18px; }
.x-btn:hover { background: var(--bg-soft); color: var(--ink); }

.toast {
  position: fixed; left: 50%; bottom: 32px; transform: translate(-50%, 20px);
  background: #1b2335; color: #fff; padding: 10px 18px; border-radius: 12px;
  font-size: 13.5px; z-index: 90; opacity: 0; pointer-events: none;
  transition: opacity .2s, transform .2s; box-shadow: 0 12px 30px rgba(0, 0, 0, .22);
  max-width: 86vw; text-align: center;
}
.toast.show { opacity: 1; transform: translate(-50%, 0); }
.toast.good { background: #0f8a50; }
.toast.bad { background: #c04747; }

/* ---------- 响应式 ---------- */
@media (max-width: 980px) {
  .grid-2 { grid-template-columns: minmax(0, 1fr); }
  .detail-grid { grid-template-columns: 1fr; }
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .grid-3 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
}

@media (max-width: 860px) {
  .app { flex-direction: column; }
  .sidebar {
    position: fixed; left: 0; right: 0; bottom: 0; top: auto;
    width: auto; height: auto; flex: none;
    flex-direction: row; align-items: center;
    padding: 6px 8px calc(6px + env(safe-area-inset-bottom));
    border-right: 0; border-top: 1px solid var(--line);
    z-index: 40;
    background: rgba(255, 255, 255, .96);
    backdrop-filter: blur(8px);
  }
  .brand, .side-foot { display: none; }
  .nav { flex-direction: row; gap: 2px; width: 100%; }
  .nav-item { flex: 1; flex-direction: column; align-items: center; gap: 2px; padding: 6px 4px; font-size: 10.5px; border-radius: 10px; }
  .nav-item i { font-size: 18px; }
  .nav-item.active::before { display: none; }
  .nav-item.active { background: transparent; color: var(--brand); }
  .main { padding: 16px 14px 96px; }
  .page-head h1 { font-size: 20px; }
  .hero { padding: 20px; flex-direction: column; align-items: flex-start; gap: 16px; }
  .hero-rings { align-self: stretch; justify-content: space-around; }
  .grid-3 { grid-template-columns: minmax(0, 1fr); }
  .ans-pair { grid-template-columns: minmax(0, 1fr); }
  .stat .v { font-size: 22px; }
  .quick { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .card { padding: 16px; border-radius: 16px; }
  .m-card { padding: 14px 14px 12px 18px; position: relative; flex-wrap: wrap; gap: 8px; }
  .m-bar { position: absolute; left: 0; top: 14px; bottom: 14px; width: 4px; }
  .m-body { flex: 1 1 100%; }
  .m-title { -webkit-line-clamp: 3; }
  .m-actions {
    flex-direction: row; width: 100%; justify-content: flex-end; gap: 8px;
    border-top: 1px dashed var(--line-2); padding-top: 8px;
  }
  .m-meta { gap: 6px; }
  .overlay { padding: 16px 10px; align-items: flex-end; }
  .modal { max-width: none; }
  .modal-body { max-height: 68vh; }
}

@media (max-width: 520px) {
  .grid-4 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .ring svg { width: 60px; height: 60px; }
  .pomo-time { font-size: 36px; }
  .heat { gap: 4px; }
}

/* ===========================================================
   新能力：拍照识题 / AI 同类题 / 语音朗读 / 家长周报
   =========================================================== */

/* ---------- 通用小件 ---------- */
.chip.mini { padding: 3px 9px; font-size: 11.5px; border-radius: 8px; }
.check-line { display: flex; align-items: center; gap: 8px; font-size: 13px; color: var(--ink-2); cursor: pointer; }
.check-line input { width: 15px; height: 15px; accent-color: var(--brand); }

.spinner {
  width: 18px; height: 18px; flex: 0 0 18px; border-radius: 50%;
  border: 2px solid #dbe2f7; border-top-color: var(--brand);
  animation: spin .7s linear infinite;
}
@keyframes spin { to { transform: rotate(360deg); } }

/* ---------- 语音朗读条 ---------- */
.tts-bar {
  display: flex; align-items: center; gap: 10px; flex-wrap: wrap;
  background: linear-gradient(180deg, #f8faff, #fff);
  border: 1px solid var(--line);
  border-radius: 14px;
  padding: 10px 14px;
  box-shadow: var(--shadow);
}
.tts-bar.unsupported { color: var(--muted); }
.tts-ico { font-size: 18px; }
.tts-title { display: flex; flex-direction: column; line-height: 1.35; }
.tts-title b { font-size: 13.5px; }
.tts-title span { font-size: 11.5px; }
.tts-bar .chip-row { gap: 4px; }
.tts-rate-group { display: flex; align-items: center; gap: 6px; }
.review-actions > .btn { flex: 1 1 180px; }

[data-tts] { transition: background .22s ease, box-shadow .22s ease; }
[data-tts].tts-on {
  background: #fff6dd;
  box-shadow: 0 0 0 5px #fff6dd;
  border-radius: 8px;
}
.step.tts-on .step-no { background: #f5c451; color: #6a4a10; }
.ans-box.right.tts-on { box-shadow: 0 0 0 3px #f5c451 inset, 0 0 0 5px #fff6dd; }

/* ---------- AI 同类题 ---------- */
.ai-note {
  display: flex; align-items: center; gap: 8px; flex-wrap: wrap;
  font-size: 12.5px; color: var(--ink-2);
  background: linear-gradient(120deg, #f2f5ff, #faf8ff);
  border: 1px solid #e3e9ff; border-radius: 12px;
  padding: 9px 12px; margin-bottom: 12px;
}
.ai-badge {
  font-size: 10.5px; font-weight: 700; letter-spacing: .5px;
  color: #fff; background: linear-gradient(135deg, #6b83ff, #8b5cf6);
  padding: 2px 7px; border-radius: 6px;
}
.ai-loading {
  display: flex; align-items: center; gap: 12px;
  padding: 18px 14px; border: 1px dashed #d6dffb; border-radius: 14px;
  background: #fafbff;
}
.ai-empty {
  display: flex; align-items: center; gap: 12px; flex-wrap: wrap;
  padding: 14px; border: 1px dashed var(--line); border-radius: 14px;
  background: #fbfcff;
}
.ai-empty b { font-size: 13.5px; }

.variants { display: flex; flex-direction: column; gap: 12px; }
.ai-actions { margin-top: 14px; padding-top: 12px; border-top: 1px dashed var(--line-2); }
.variant {
  border: 1px solid var(--line); border-radius: 14px;
  padding: 14px 16px; background: #fff;
  transition: border-color .16s;
}
.variant:hover { border-color: #d3ddfa; }
.v-head { display: flex; gap: 8px; align-items: center; margin-bottom: 8px; }
.v-stem { font-size: 14.5px; line-height: 1.8; white-space: pre-wrap; }
.v-opts { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 6px 14px; margin-top: 8px; }
.v-opt { display: flex; gap: 7px; font-size: 13.5px; color: var(--ink-2); line-height: 1.6; }
.v-opt b {
  flex: 0 0 18px; width: 18px; height: 18px; border-radius: 6px;
  background: var(--bg-soft); color: var(--ink-2);
  display: grid; place-items: center; font-size: 11px; margin-top: 2px;
}
.variant .rq-ans { margin-top: 8px; padding: 10px 12px; background: var(--bg-soft); border-radius: 10px; line-height: 1.75; }

/* ---------- 拍照识题 ---------- */
.ocr-box {
  border: 1px solid #dfe6ff;
  background: linear-gradient(135deg, #f5f8ff, #fdfbff);
  border-radius: 16px;
  padding: 14px 16px;
  margin-bottom: 16px;
}
.ocr-head { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; }
.ocr-title { display: flex; align-items: center; gap: 10px; flex: 1; min-width: 180px; }
.ocr-ico {
  width: 38px; height: 38px; flex: 0 0 38px; border-radius: 12px;
  display: grid; place-items: center; font-size: 19px;
  background: #fff; border: 1px solid #e3e9ff;
}
.ocr-title b { font-size: 14px; }
.ocr-title .small { line-height: 1.5; }

.ocr-thumb {
  width: 76px; height: 72px; flex: 0 0 76px;
  object-fit: contain; background: #fff;
  border-radius: 10px; border: 1px solid var(--line);
}
.ocr-ph {
  width: 72px; height: 72px; flex: 0 0 72px; border-radius: 10px;
  background: #fff; border: 1px dashed #cdd7f3;
  display: grid; place-items: center; font-size: 24px;
}
.ocr-running, .ocr-done, .ocr-error {
  display: flex; align-items: center; gap: 12px;
  margin-top: 12px; padding: 12px;
  background: #fff; border-radius: 12px; border: 1px solid var(--line);
}
.ocr-error { border-color: #f7d9d9; background: #fffafa; align-items: flex-start; }
.ocr-error b { color: var(--bad); font-size: 13.5px; }
.ocr-msg { color: #b73c3c; margin-top: 3px; line-height: 1.7; }
.ocr-detail { margin-top: 6px; }
.ocr-detail summary { cursor: pointer; color: var(--muted); font-size: 12px; }
.ocr-detail code {
  display: block; margin-top: 6px; padding: 8px; max-height: 120px; overflow: auto;
  background: var(--bg-soft); border-radius: 8px; font-size: 11.5px; white-space: pre-wrap;
}
.ocr-config { margin-top: 12px; padding: 12px; background: #fff; border-radius: 12px; border: 1px solid var(--line); }
.ocr-config select { text-overflow: ellipsis; }

@media screen and (max-width: 560px) {
  .ocr-fields { flex-direction: column; align-items: stretch !important; gap: 10px; }
  .ocr-fields .field { width: 100%; }
}

/* ---------- 家长周报 ---------- */
.week-pill {
  font-size: 12.5px; color: var(--ink-2);
  background: #fff; border: 1px solid var(--line);
  border-radius: 999px; padding: 5px 14px; white-space: nowrap;
}
.report-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 20px;
  padding: 32px 36px 24px;
  box-shadow: var(--shadow);
  max-width: 860px;
  width: 100%;
  margin: 0 auto;
}
.rs-head {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 16px;
  padding-bottom: 16px; border-bottom: 2px solid var(--ink);
  flex-wrap: wrap;
}
.rs-brand { display: flex; align-items: center; gap: 10px; }
.rs-logo {
  width: 38px; height: 38px; border-radius: 12px;
  display: grid; place-items: center; font-size: 19px;
  background: linear-gradient(135deg, #4f6ef7, #8b5cf6); color: #fff;
}
.rs-brand b { font-size: 15.5px; letter-spacing: .3px; }
.rs-meta { text-align: right; display: flex; flex-direction: column; line-height: 1.45; }
.rs-meta b { font-size: 16px; }
.rs-meta span { font-size: 12px; color: var(--muted); }

.rs-kpis { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 12px; margin: 18px 0; }
.rs-kpi { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; }
.rs-kpi span { font-size: 11.5px; color: var(--muted); }
.rs-kpi b { display: block; font-size: 21px; letter-spacing: .3px; line-height: 1.4; }
.rs-kpi b small { font-size: 11px; font-weight: 500; color: var(--muted); margin-left: 2px; }
.rs-kpi em { font-style: normal; font-size: 11px; color: var(--muted); }

.rs-block { margin-top: 18px; }
.rs-title { font-size: 13px; font-weight: 700; letter-spacing: .3px; margin-bottom: 10px; }
.rs-title span { font-weight: 400; color: var(--muted); font-size: 11.5px; }

.rs-cols { display: grid; grid-template-columns: repeat(7, minmax(0, 1fr)); gap: 8px; align-items: end; }
.rs-col { display: flex; flex-direction: column; align-items: center; gap: 4px; }
.rs-col b { font-size: 11px; color: var(--muted); font-variant-numeric: tabular-nums; }
.rs-col.on b { color: var(--brand-deep); }
.rc-bar {
  width: 100%; max-width: 34px; height: 84px;
  background: #f2f5fc; border-radius: 7px;
  display: flex; align-items: flex-end; overflow: hidden;
}
.rc-bar > i {
  display: block; width: 100%; border-radius: 7px;
  background: linear-gradient(180deg, #7c93ff, #4f6ef7);
}
.rs-col.future .rc-bar { background: repeating-linear-gradient(45deg, #f7f9fd, #f7f9fd 4px, #eef2fa 4px, #eef2fa 8px); }
.rs-col span { font-size: 11px; color: var(--muted); }

.rs-2col { display: grid; grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); gap: 22px; }
.rs-rows > div {
  display: flex; align-items: center; gap: 8px;
  padding: 6px 0; border-bottom: 1px dashed var(--line-2); font-size: 12.5px;
}
.rs-rows > div > span:first-child { color: var(--muted); width: 84px; flex: 0 0 84px; }
.rs-rows b { font-weight: 600; font-size: 13px; }
.dl { margin-left: auto; font-size: 11.5px; color: var(--muted); }
.dl.up { color: var(--ok); }       /* 变好：绿色 */
.dl.down { color: var(--bad); }     /* 变差：红色 */
.dl.flat { color: var(--muted); }

.rs-weak { display: flex; gap: 6px; flex-wrap: wrap; }

.rs-mistakes { display: flex; flex-direction: column; gap: 7px; }
.rs-mistake {
  display: flex; align-items: center; gap: 8px;
  font-size: 12.5px; padding: 6px 0; border-bottom: 1px dashed var(--line-2);
}
.rs-dot { width: 7px; height: 7px; border-radius: 50%; flex: 0 0 7px; }
.rs-m-sub { color: var(--muted); flex: 0 0 auto; font-size: 11.5px; }
.rs-m-stem {
  flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  color: var(--ink-2);
}

.rs-comment {
  margin-top: 20px; border-radius: 14px; padding: 16px 18px;
  background: linear-gradient(135deg, #f7f9ff, #fdfbff);
  border: 1px solid #e4eaff;
}
.rs-comment p { font-size: 13.5px; line-height: 1.9; color: var(--ink-2); margin-top: 4px; }
.rs-plan { list-style: none; counter-reset: p; margin-top: 4px; }
.rs-plan li {
  counter-increment: p; position: relative;
  padding-left: 24px; font-size: 13px; line-height: 1.9; color: var(--ink-2);
}
.rs-plan li::before {
  content: counter(p); position: absolute; left: 0; top: 4px;
  width: 17px; height: 17px; border-radius: 50%;
  background: var(--brand); color: #fff; font-size: 10.5px;
  display: grid; place-items: center;
}
.rs-foot {
  display: flex; justify-content: space-between; gap: 12px; flex-wrap: wrap;
  margin-top: 20px; padding-top: 12px; border-top: 1px solid var(--line);
  font-size: 11px; color: var(--muted);
}

/* ---------- 打印 ---------- */
@media print {
  @page { margin: 12mm; size: A4; }
  html, body { background: #fff !important; }
  .sidebar, .toast, .overlay, .no-print { display: none !important; }
  .app { display: block; }
  .main { padding: 0 !important; }
  .view { max-width: none; }
  .page { gap: 0; animation: none; }
  .report-sheet {
    border: 0; border-radius: 0; box-shadow: none;
    padding: 0; max-width: none;
  }
  [data-tts].tts-on { background: transparent !important; box-shadow: none !important; }
  .rs-comment { background: #fff; }
  .rs-kpi, .variant, .card { break-inside: avoid; }
}

/* ---------- 新能力：移动端（只作用于屏幕，避免泄漏到打印） ---------- */
@media screen and (max-width: 860px) {
  .report-sheet { padding: 20px 16px 16px; border-radius: 16px; }
  .rs-kpis { grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
  .rs-kpi b { font-size: 18px; }
  .rs-2col { grid-template-columns: minmax(0, 1fr); gap: 0; }
  .rs-head { flex-direction: column; }
  .rs-meta { text-align: left; }
  .tts-bar { gap: 8px; padding: 10px 12px; }
  .tts-title span { display: none; }
  .v-opts { grid-template-columns: minmax(0, 1fr); }
  .ocr-thumb, .ocr-ph { width: 58px; height: 58px; flex: 0 0 58px; }
  .rs-cols { gap: 5px; }
  .rc-bar { height: 68px; }
  .rs-mistake { flex-wrap: wrap; }
  .rs-m-stem { flex: 1 1 100%; white-space: normal; }
}

@media print {
  .rs-kpis { grid-template-columns: repeat(4, minmax(0, 1fr)); }
  .rs-2col { grid-template-columns: minmax(0, 1.15fr) minmax(0, 1fr); }
}

/* ===========================================================
   错题练习卷（生成 + A4 打印）
   =========================================================== */

/* ---------- 设置页 ---------- */
.src-grid { display: grid; grid-template-columns: repeat(2, minmax(0, 1fr)); gap: 10px; }
.src-card {
  text-align: left;
  border: 1px solid var(--line);
  background: #fff;
  border-radius: 12px;
  padding: 11px 13px;
  cursor: pointer;
  display: flex;
  flex-direction: column;
  gap: 3px;
  transition: border-color .16s, background .16s, box-shadow .16s;
  font-family: inherit;
}
.src-card:hover { border-color: #c9d6fb; }
.src-card.active {
  border-color: var(--brand);
  background: linear-gradient(180deg, #f5f8ff, #fff);
  box-shadow: 0 0 0 3px rgba(79, 110, 247, .1);
}
.src-card b { font-size: 13.5px; color: var(--ink); }
.src-card span { font-size: 11.5px; color: var(--muted); line-height: 1.5; }
.paper-opts { display: flex; flex-wrap: wrap; gap: 10px 22px; }

/* 右侧“卷子长什么样”小样 */
.paper-mini {
  border: 1px solid var(--line);
  border-radius: 10px;
  padding: 16px 18px;
  background: #fff;
  font-size: 12px;
  color: var(--ink-2);
  box-shadow: inset 0 0 0 1px #f4f6fb;
}
.pm-head { display: flex; align-items: center; gap: 8px; font-weight: 700; font-size: 13px; color: var(--ink); }
.pm-line { flex: 1; height: 1px; background: var(--line); }
.pm-row { margin-top: 8px; color: var(--muted); }
.pm-sec { margin-top: 12px; font-weight: 700; color: var(--ink); }
.pm-q { margin-top: 6px; line-height: 1.75; }
.pm-blank { height: 26px; margin-top: 4px; border-bottom: 1px dashed #dbe2f0; }

/* ---------- 工具栏 ---------- */
.paper-toolbar {
  display: flex; align-items: center; gap: 10px;
  margin-bottom: 14px;
}
.paper-toolbar .spacer { flex: 1; }

/* ---------- 卷面 ---------- */
.paper-sheet {
  background: #fff;
  border: 1px solid var(--line);
  border-radius: 14px;
  box-shadow: var(--shadow);
  padding: 34px 40px 30px;
  max-width: 820px;
  margin: 0 auto;
  color: #1b2030;
  font-size: 13.5px;
  line-height: 1.85;
}

.ps-head { text-align: center; }
.ps-title { font-size: 21px; font-weight: 800; letter-spacing: 2px; }
.ps-sub { font-size: 12px; color: #6b7385; margin-top: 4px; letter-spacing: .3px; }

.ps-meta {
  display: flex; flex-wrap: wrap; gap: 10px 26px;
  justify-content: space-between;
  margin-top: 16px; padding: 10px 0;
  border-top: 1.5px solid #1b2030;
  border-bottom: 1px solid #d9dfea;
  font-size: 12.5px;
}
.ps-underline {
  display: inline-block; width: 92px; height: 1em;
  border-bottom: 1px solid #9aa3b5;
  vertical-align: -2px;
}
.ps-underline.short { width: 52px; }
.ps-tip {
  font-size: 11.5px; color: #6b7385;
  margin: 12px 0 4px; line-height: 1.8;
}

.ps-sec {
  font-size: 14px; font-weight: 800;
  margin: 20px 0 6px;
  padding-bottom: 4px;
  border-bottom: 1px solid #e6eaf3;
}
.ps-hint { font-weight: 400; font-size: 11.5px; color: #7b8396; margin-left: 6px; }

.ps-q { margin: 10px 0 14px; page-break-inside: avoid; }
.ps-stem { display: flex; gap: 6px; line-height: 1.95; }
.ps-no { flex: 0 0 auto; font-weight: 700; }
.ps-opts {
  display: flex; flex-wrap: wrap; gap: 2px 0;
  margin: 4px 0 0 22px;
}
.ps-opt {
  flex: 0 0 50%;
  line-height: 1.9;
  color: #333a4a;
}
.ps-judge { margin-left: 22px; color: #4a5265; letter-spacing: 2px; }

.ps-space {
  margin: 6px 0 0 22px;
  height: 42px;
  border-bottom: 1px dashed #dbe2f0;
  border-radius: 2px;
  background: repeating-linear-gradient(180deg, transparent, transparent 27px, #eef2f9 27px, #eef2f9 28px);
}
.ps-space.tall { height: 104px; }

/* ---------- 答案页 ---------- */
.ps-answers {
  margin-top: 30px;
  padding-top: 18px;
  border-top: 2px solid #1b2030;
  page-break-before: always;
}
.ps-ans-title { font-size: 16px; font-weight: 800; letter-spacing: 1px; }
.ps-ans-note { font-size: 11.5px; color: #6b7385; margin: 6px 0 12px; line-height: 1.8; }
.ps-ans { margin-bottom: 10px; page-break-inside: avoid; }
.ps-ans-head { font-size: 13px; }
.ps-ans-val { font-weight: 700; color: #17407c; }
.ps-ans-exp {
  font-size: 12px; color: #4a5265;
  white-space: pre-wrap; line-height: 1.8;
  margin-left: 18px; padding-left: 10px;
  border-left: 2px solid #e6eaf3;
}
.ps-ans-foot {
  margin-top: 22px; padding-top: 10px;
  border-top: 1px solid #e6eaf3;
  font-size: 10.5px; color: #9aa3b5;
  text-align: center; letter-spacing: .5px;
}

/* ---------- 打印 ---------- */
@media print {
  .paper-toolbar { display: none !important; }
  .paper-sheet {
    border: 0; border-radius: 0; box-shadow: none;
    padding: 0; max-width: none;
    font-size: 12.5pt;
  }
  .ps-title { font-size: 19pt; }
  .ps-q { page-break-inside: avoid; }
  .ps-answers { page-break-before: always; }
  .ps-space.tall { height: 120px; }
}

@media screen and (max-width: 860px) {
  .src-grid { grid-template-columns: minmax(0, 1fr); }
  .paper-sheet { padding: 20px 16px; border-radius: 12px; }
  .ps-opt { flex: 0 0 100%; }
  .ps-meta { gap: 8px 14px; }
  .ps-underline { width: 70px; }
}

/* ===========================================================
   多孩子档案
   =========================================================== */
.profile-chip {
  width: 100%;
  display: flex; align-items: center; gap: 9px;
  margin: 2px 0 10px;
  padding: 8px 10px;
  border-radius: 12px;
  border: 1px solid var(--line);
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  text-align: left;
  transition: border-color .16s, box-shadow .16s;
}
.profile-chip:hover { border-color: #cdd9fb; box-shadow: 0 2px 10px rgba(79, 110, 247, .08); }
.pc-avatar {
  width: 32px; height: 32px; flex: 0 0 32px;
  border-radius: 10px;
  display: grid; place-items: center;
  font-size: 17px; line-height: 1;
}
.pc-info { flex: 1; min-width: 0; display: flex; flex-direction: column; line-height: 1.3; }
.pc-info b { font-size: 13px; color: var(--ink); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.pc-info em { font-style: normal; font-size: 11px; color: var(--muted); }
.pc-caret { color: var(--muted); font-size: 12px; }

.pm-list { display: flex; flex-direction: column; gap: 8px; }
.pm-item {
  display: flex; align-items: center; gap: 11px;
  width: 100%; text-align: left;
  padding: 11px 13px;
  border: 1px solid var(--line);
  border-radius: 12px;
  background: #fff;
  cursor: pointer;
  font-family: inherit;
  transition: border-color .16s, background .16s;
}
.pm-item:hover { border-color: #cdd9fb; background: #fafbff; }
.pm-item.active { border-color: var(--brand); background: linear-gradient(180deg, #f5f8ff, #fff); }
.pm-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.pm-main b { font-size: 14px; }
.pm-main em { font-style: normal; font-size: 11.5px; color: var(--muted); }
.pm-acts { display: flex; align-items: center; gap: 6px; flex: 0 0 auto; }
.pm-acts .tag { flex: 0 0 auto; }

/* 手机上一行放不下三个按钮，按钮换到第二行，别把统计文字挤成一列 */
@media screen and (max-width: 560px) {
  .pm-item.static { flex-wrap: wrap; row-gap: 8px; }
  .pm-item.static .pm-acts { flex: 1 1 100%; justify-content: flex-end; }
  .pm-item.static .pm-main em { line-height: 1.6; }
}

.color-dot {
  width: 26px; height: 26px; border-radius: 8px;
  border: 2px solid transparent;
  cursor: pointer;
  padding: 0;
}
.color-dot.active { border-color: var(--ink); box-shadow: 0 0 0 2px #fff inset; }

/* 手机上用标题右侧的入口，桌面用侧边栏 */
.only-mobile { display: none; }
@media screen and (max-width: 860px) {
  .only-mobile { display: inline-flex; }
  /* 侧边栏在手机端变成底部导航条，档案卡挤在里面会把 6 个导航项压扁；
     手机端的档案入口在首页问候语右侧和设置页的「孩子档案」卡片里 */
  #profile-chip { display: none; }
}

.hero-hi { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; }
.hero-switch {
  font-size: 11.5px;
  padding: 5px 11px;
  border-radius: 999px;
  border: 1px solid rgba(255, 255, 255, .38);
  background: rgba(255, 255, 255, .16);
  color: #fff;
  cursor: pointer;
  font-family: inherit;
  backdrop-filter: blur(4px);
}
.hero-switch:hover { background: rgba(255, 255, 255, .26); }

/* ===========================================================
   云同步
   =========================================================== */
.sync-list { display: flex; flex-direction: column; gap: 6px; }
.sync-row {
  display: flex; align-items: center; gap: 9px;
  padding: 7px 10px;
  border: 1px solid var(--line-2);
  border-radius: 10px;
  background: #fbfcff;
  font-size: 13px;
}
.sync-name { flex: 1; min-width: 0; font-weight: 600; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

@media screen and (max-width: 860px) {
  .sync-row { flex-wrap: wrap; }
  .sync-name { flex: 1 1 60%; }
}
