/* 私人老师 · 手机端
   纯白、细线、单一强调色；触控目标 ≥ 44px。 */
:root {
  --bg: #ffffff;
  --fg: #1a1a1a;
  --muted: #6b7076;
  --line: #e4e7ea;
  --card: #ffffff;
  --soft: #f6f7f9;
  --accent: #2f6fb3;
  --accent-weak: rgba(47, 111, 179, 0.1);
  --danger: #c0533f;
  --ok: #2e7d55;
  --nav-h: 58px;
}
@media (prefers-color-scheme: dark) {
  :root {
    --bg: #121417;
    --fg: #e8eaed;
    --muted: #9aa1a8;
    --line: #2a2f36;
    --card: #191c21;
    --soft: #20242a;
    --accent: #6fa8e6;
    --accent-weak: rgba(111, 168, 230, 0.14);
    --danger: #e07a63;
    --ok: #5fbf8c;
  }
}
* { box-sizing: border-box; -webkit-tap-highlight-color: transparent; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--bg);
  color: var(--fg);
  font-family: -apple-system, BlinkMacSystemFont, "PingFang SC", "Microsoft YaHei", "Segoe UI", sans-serif;
  font-size: 15px;
  line-height: 1.5;
  overscroll-behavior-y: none;
}
#app { min-height: 100%; display: flex; flex-direction: column; }

/* 顶栏 */
.hdr {
  position: sticky; top: 0; z-index: 10;
  display: flex; align-items: flex-start; justify-content: space-between; gap: 12px;
  padding: calc(12px + env(safe-area-inset-top)) 18px 10px;
  background: color-mix(in srgb, var(--bg) 88%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-bottom: 1px solid var(--line);
}
.kicker { font-size: 10px; letter-spacing: .18em; color: var(--muted); }
.hdr h1 { margin: 2px 0 2px; font-size: 21px; font-weight: 650; letter-spacing: .01em; }
.sub { font-size: 12px; color: var(--muted); }
.chips { display: flex; gap: 6px; flex-wrap: wrap; margin-top: 6px; }
.chip {
  font-size: 11px; padding: 3px 8px; border-radius: 999px;
  border: 1px solid var(--line); color: var(--muted); white-space: nowrap;
}
.chip.strong { color: var(--accent); border-color: var(--accent); }
.icon-btn {
  width: 40px; height: 40px; border-radius: 50%; border: 1px solid var(--line);
  background: var(--card); color: var(--muted); font-size: 16px;
  display: flex; align-items: center; justify-content: center;
}
.dot { display: inline-block; width: 7px; height: 7px; border-radius: 50%; background: var(--muted); margin-right: 5px; vertical-align: 1px; }
.dot.ok { background: var(--ok); }
.dot.err { background: var(--danger); }
.dot.busy { background: var(--accent); }

/* 内容 */
.main {
  flex: 1; overflow-y: auto; -webkit-overflow-scrolling: touch;
  padding: 14px 16px calc(var(--nav-h) + 26px + env(safe-area-inset-bottom));
}
.card {
  border: 1px solid var(--line); border-radius: 14px; background: var(--card);
  padding: 14px 16px; margin-bottom: 12px;
}
.card-h { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; margin-bottom: 8px; }
.card-t { font-size: 14px; font-weight: 650; }
.note { font-size: 12px; color: var(--muted); }
.quote { font-size: 13.5px; line-height: 1.75; padding-left: 11px; border-left: 2px solid var(--accent); }
.quote + .quote { margin-top: 10px; }

/* 任务行 */
.task { display: flex; gap: 12px; align-items: flex-start; padding: 12px 0; border-top: 1px solid var(--line); }
.task:first-of-type { border-top: 0; padding-top: 4px; }
.check {
  flex: 0 0 auto; width: 26px; height: 26px; margin-top: 1px; padding: 0;
  border-radius: 8px; border: 1.5px solid var(--line); background: transparent;
  display: flex; align-items: center; justify-content: center;
}
.check[data-on="1"] { background: var(--accent); border-color: var(--accent); }
.check svg { display: block; }
.task-time { flex: 0 0 auto; width: 78px; font-size: 11px; color: var(--muted); padding-top: 4px; font-variant-numeric: tabular-nums; }
.task-text { flex: 1; min-width: 0; font-size: 14px; line-height: 1.55; }
.task-text[data-done="1"] { color: var(--muted); text-decoration: line-through; }
.tag {
  display: inline-block; font-size: 10.5px; padding: 2px 6px; margin-right: 6px;
  border: 1px solid var(--line); border-radius: 5px; color: var(--muted); vertical-align: 1px;
}

/* 按钮 */
.btn {
  appearance: none; font-family: inherit; font-size: 13px; min-height: 40px; padding: 0 14px;
  border-radius: 10px; border: 1px solid var(--line); background: transparent; color: var(--fg);
}
.btn[aria-pressed="true"] { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.primary { background: var(--accent); border-color: var(--accent); color: #fff; }
.btn.small { min-height: 34px; font-size: 12px; padding: 0 10px; }
.row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }
.row.between { justify-content: space-between; }
.row.top { align-items: flex-start; }

/* 统计 */
.grid2 { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; margin-bottom: 12px; }
.stat { border: 1px solid var(--line); border-radius: 12px; padding: 12px 14px; background: var(--card); }
.stat-n { font-size: 24px; font-weight: 650; line-height: 1.1; font-variant-numeric: tabular-nums; }
.stat-l { font-size: 11px; color: var(--muted); margin-top: 4px; }
.bar { height: 6px; border-radius: 999px; background: var(--soft); overflow: hidden; margin-top: 8px; }
.bar > i { display: block; height: 100%; background: var(--accent); border-radius: 999px; }

/* 热力图 */
.heat { display: grid; grid-template-columns: repeat(7, 1fr); gap: 5px; }
.cell { aspect-ratio: 1; border-radius: 4px; background: var(--soft); }
.cell[data-today="1"] { outline: 1.5px solid var(--accent); outline-offset: 1px; }

/* 阶段 */
.stage { display: flex; gap: 10px; padding: 10px 0; border-top: 1px dashed var(--line); }
.stage:first-of-type { border-top: 0; }
.stage[data-now="1"] { background: var(--soft); border-radius: 10px; padding: 10px; margin: 0 -10px; }
.idx {
  flex: 0 0 22px; height: 22px; border-radius: 50%; border: 1px solid var(--line);
  display: flex; align-items: center; justify-content: center; font-size: 11px; color: var(--muted);
}
.stage[data-now="1"] .idx { border-color: var(--accent); color: var(--accent); font-weight: 700; }
.stage-t { font-size: 13.5px; font-weight: 600; }
.stage-p { font-size: 11px; color: var(--muted); margin-left: 6px; }
.pts { margin: 5px 0 0; padding-left: 16px; }
.pts li { font-size: 13px; line-height: 1.65; }
.out { font-size: 11.5px; color: var(--muted); margin-top: 5px; }

/* 书 */
.book { display: flex; gap: 10px; padding: 12px 0; border-top: 1px solid var(--line); }
.book:first-of-type { border-top: 0; padding-top: 4px; }
.book-n { flex: 0 0 18px; font-size: 11px; color: var(--muted); padding-top: 3px; font-variant-numeric: tabular-nums; }
.book-t { font-size: 14px; font-weight: 600; line-height: 1.45; }
.book-a { font-size: 11.5px; color: var(--muted); margin-top: 2px; }
.book-w { font-size: 12.5px; line-height: 1.6; margin-top: 6px; }
.status {
  flex: 0 0 auto; min-height: 32px; padding: 0 10px; border-radius: 999px;
  border: 1px solid var(--line); background: transparent; color: var(--muted);
  font-size: 11.5px; font-family: inherit;
}
.status[data-s="reading"] { color: var(--accent); border-color: var(--accent); }
.status[data-s="read"] { color: var(--ok); border-color: var(--ok); }

/* 筛选 */
.filters { display: flex; gap: 8px; overflow-x: auto; padding: 2px 0 12px; scrollbar-width: none; }
.filters::-webkit-scrollbar { display: none; }
.filters .btn { flex: 0 0 auto; }

/* 倒计时 */
.dl { display: flex; align-items: baseline; justify-content: space-between; gap: 10px; padding: 11px 0; border-top: 1px solid var(--line); }
.dl:first-of-type { border-top: 0; }
.dl-n { font-size: 12px; color: var(--muted); white-space: nowrap; font-variant-numeric: tabular-nums; }
.dl-n[data-urgent="1"] { color: var(--danger); font-weight: 650; }

/* 底部导航 */
.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 20;
  display: grid; grid-template-columns: repeat(4, 1fr);
  padding-bottom: env(safe-area-inset-bottom);
  background: color-mix(in srgb, var(--bg) 92%, transparent);
  backdrop-filter: saturate(1.4) blur(12px);
  border-top: 1px solid var(--line);
}
.nav button {
  appearance: none; border: 0; background: none; font-family: inherit;
  min-height: var(--nav-h); color: var(--muted); font-size: 11px;
  display: flex; flex-direction: column; align-items: center; justify-content: center; gap: 3px;
}
.nav button[aria-current="true"] { color: var(--accent); }
.nav svg { display: block; }

/* 弹层 */
.sheet-wrap { position: fixed; inset: 0; z-index: 40; background: rgba(0,0,0,.35); display: flex; align-items: flex-end; }
.sheet {
  width: 100%; background: var(--bg); border-radius: 18px 18px 0 0;
  padding: 18px 18px calc(18px + env(safe-area-inset-bottom));
  max-height: 86vh; overflow-y: auto;
}
.sheet h2 { margin: 0 0 4px; font-size: 17px; }
.field { margin-top: 14px; }
.field label { display: block; font-size: 12px; color: var(--muted); margin-bottom: 6px; }
.field input {
  width: 100%; min-height: 44px; padding: 0 12px; font-family: inherit; font-size: 14px;
  border: 1px solid var(--line); border-radius: 10px; background: var(--soft); color: var(--fg);
}
.hint { font-size: 11.5px; color: var(--muted); margin-top: 6px; line-height: 1.6; }
.err { color: var(--danger); }
.empty { font-size: 13px; color: var(--muted); padding: 8px 0; }

.hdr-actions{display:flex;gap:8px;align-items:center;}

.task-link{background:none;border:0;padding:0;margin:0;font:inherit;color:inherit;text-align:left;cursor:pointer;flex:1;min-width:0;}
.task-link:hover{color:var(--accent);}
