/* 超吊的秘书 — mobile-first. Look follows the approved sketch (today-layout.html). */
:root {
  --accent: #5b4bff;
  --accent-soft: #eef0ff;
  --bg: #f6f7fb;
  --text: #222;
  --muted: #888;
  --line: #eee;
  --q1: #e2445c;
  --q2: #fdab3d;
  --q3: #ffcb00;
  --q4: #c4c4c4;
  --purple: #a25ddc;
  --q2-text: #d7861b;
  --q3-text: #a88a00;
}
* { box-sizing: border-box; }
[hidden] { display: none !important; }
html, body { margin: 0; padding: 0; background: var(--bg); }
body {
  font-family: -apple-system, "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--text); font-size: 15px; line-height: 1.4;
  -webkit-text-size-adjust: 100%;
}
button { font: inherit; cursor: pointer; }
#app { min-height: 100vh; display: flex; flex-direction: column; max-width: 560px; margin: 0 auto; }

.top {
  position: sticky; top: 0; z-index: 5; background: #fff;
  padding: calc(12px + env(safe-area-inset-top)) 16px 10px; border-bottom: 1px solid var(--line);
}
.top b { font-size: 19px; }
.top small { color: var(--muted); display: block; margin-top: 2px; font-size: 12.5px; }

main { flex: 1; padding: 12px 12px calc(84px + env(safe-area-inset-bottom)); }

.nav {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 6;
  display: flex; justify-content: space-around; background: #fff; border-top: 1px solid var(--line);
  padding: 6px 0 calc(8px + env(safe-area-inset-bottom));
}
.nav button {
  flex: 1; background: none; border: 0; color: var(--muted); font-size: 13px; padding: 8px 0;
}
.nav button.on { color: var(--accent); font-weight: 600; }

/* cards (今天 / 待确认) */
.card {
  background: #fff; border-radius: 14px; padding: 12px; margin-bottom: 12px;
  box-shadow: 0 1px 3px rgba(0,0,0,.06);
}
.card .k { font-size: 13px; font-weight: 600; margin-bottom: 8px; }
.k.r { color: var(--q1); } .k.y { color: var(--q3-text); } .k.p { color: var(--purple); }
.k.cal { color: var(--q2-text); }
.card.cal { border: 2px solid var(--q2); }
.card.pend { background: #f4ecff; cursor: pointer; }
.task + .task { border-top: 1px solid #f0f0f0; margin-top: 10px; padding-top: 10px; }
.task .title { font-weight: 600; word-break: break-word; }
.task .contact { font-weight: 700; }
.task .next { color: #444; margin-top: 2px; word-break: break-word; }
.task .draft {
  color: var(--muted); font-size: 13px; margin-top: 4px; white-space: pre-wrap; word-break: break-word;
  display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden;
}
.task .meta { color: var(--muted); font-size: 12px; margin-top: 2px; }
.tag {
  display: inline-block; font-size: 10.5px; font-weight: 700; letter-spacing: .04em;
  padding: 1px 6px; border-radius: 6px; background: #e7f6ee; color: #0a7a46; margin: 3px 4px 0 0;
}
.tag.lock { background: #fde3e7; color: var(--q1); }
.btns { margin-top: 8px; display: flex; flex-wrap: wrap; gap: 6px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; text-decoration: none;
  font-size: 13.5px; padding: 8px 12px; min-height: 36px; border-radius: 10px; border: 0;
  background: var(--accent); color: #fff;
}
.btn.l { background: var(--accent-soft); color: var(--accent); }
.btn.g { background: #e7f6ee; color: #0a7a46; }
.btn.danger { background: var(--q1); }
.btn.big { width: 100%; font-size: 16px; min-height: 46px; }
.btn:disabled { opacity: .45; cursor: default; }
.empty { text-align: center; color: #aaa; font-size: 13px; padding: 10px 0; }
.big-empty { font-size: 18px; color: var(--muted); padding: 80px 0; }
.folded { text-align: center; color: #aaa; font-size: 13px; padding: 6px 0 14px; cursor: pointer; }
.cal-row { display: flex; gap: 8px; padding: 2px 0; }
.cal-row .time { color: var(--q2-text); font-weight: 600; white-space: nowrap; min-width: 3em; }
.cal-row .what { flex: 1; min-width: 0; word-break: break-word; }
.cal-row .cal-name { color: var(--muted); font-size: 11.5px; white-space: nowrap; align-self: center; }

/* board (monday style) */
.filters { display: flex; gap: 8px; margin-bottom: 10px; }
.filters select {
  flex: 1; min-width: 0; font: inherit; font-size: 14px; padding: 8px; border-radius: 10px;
  border: 1px solid #ddd; background: #fff; color: var(--text);
}
.grp { margin-bottom: 12px; background: #fff; border-radius: 12px; overflow: hidden; border-left: 6px solid #ccc; }
.grp h5 { margin: 0; padding: 9px 12px; font-size: 14px; display: flex; justify-content: space-between; }
.grp.Q1 { border-color: var(--q1); } .grp.Q1 h5 { color: var(--q1); }
.grp.Q2 { border-color: var(--q2); } .grp.Q2 h5 { color: var(--q2-text); }
.grp.Q3 { border-color: var(--q3); } .grp.Q3 h5 { color: var(--q3-text); }
.grp.Q4 { border-color: var(--q4); } .grp.Q4 h5 { color: var(--muted); }
.grp h5 { cursor: pointer; }
.row { display: flex; align-items: center; gap: 6px; padding: 8px 10px 8px 12px; border-top: 1px solid #f0f0f0; }
.row .t { flex: 1; min-width: 0; line-height: 1.3; word-break: break-word; }
.row .t i { color: var(--muted); font-style: normal; font-size: 12px; display: block; }
.star { background: none; border: 0; padding: 0 2px; font-size: 15px; color: #bbb; }
.star.on { color: #f5b301; }
.pill {
  font-size: 11.5px; padding: 5px 9px; border-radius: 12px; color: #fff; white-space: nowrap; border: 0;
}
.pill.new { background: #e2445c; }
.pill.in_progress { background: #fdab3d; }
.pill.waiting { background: #579bfc; }
.pill.pending_confirm { background: var(--purple); }
.pill.done { background: #00c875; }
.pill.tappable { box-shadow: 0 0 0 2px rgba(0,0,0,.08) inset; }
.more { background: none; border: 0; color: var(--muted); font-size: 18px; padding: 0 4px; min-width: 28px; min-height: 32px; }

/* sheet / dialog */
.backdrop { position: fixed; inset: 0; background: rgba(0,0,0,.35); z-index: 20; }
.sheet {
  position: fixed; left: 0; right: 0; bottom: 0; z-index: 21; max-width: 560px; margin: 0 auto;
  background: #fff; border-radius: 18px 18px 0 0; padding: 16px 16px calc(16px + env(safe-area-inset-bottom));
  max-height: 88vh; overflow-y: auto; box-shadow: 0 -6px 30px rgba(0,0,0,.15);
}
.sheet h3 { margin: 0 0 10px; font-size: 17px; }
.sheet .to { font-size: 14px; margin-bottom: 8px; word-break: break-all; }
.sheet .to small { color: var(--muted); display: block; }
.sheet textarea {
  width: 100%; min-height: 160px; font: inherit; font-size: 15px; padding: 10px; border-radius: 10px;
  border: 1px solid #ddd; resize: vertical;
}
.sheet .full {
  white-space: pre-wrap; word-break: break-word; background: var(--bg); border-radius: 10px;
  padding: 10px; font-family: inherit; font-size: 15px; margin: 0 0 10px; max-height: 40vh; overflow-y: auto;
}
.sheet .row-btns { display: flex; gap: 8px; margin-top: 12px; }
.sheet .row-btns .btn { flex: 1; min-height: 44px; font-size: 15px; }
.sheet .opt {
  display: block; width: 100%; text-align: left; padding: 13px 12px; border: 0; background: none;
  border-top: 1px solid #f0f0f0; font-size: 15px;
}
.sheet .opt.cur { color: var(--accent); font-weight: 600; }
.sheet .lbl { display: block; font-size: 13px; color: var(--muted); margin: 10px 0 4px; }
.sheet .dt {
  width: 100%; font: inherit; font-size: 16px; padding: 10px; border-radius: 10px; border: 1px solid #ddd;
  background: #fff; color: var(--text);
}
.segs { display: flex; gap: 6px; }
.seg {
  flex: 1; min-height: 40px; border-radius: 10px; border: 1px solid #ddd; background: #fff; color: var(--text);
  font-size: 14px;
}
.seg.on { border-color: var(--accent); background: var(--accent-soft); color: var(--accent); font-weight: 600; }
.notice { border-radius: 10px; padding: 10px; font-size: 14px; margin-top: 10px; word-break: break-word; }
.notice.warn { background: #fff4d6; color: #7a5600; font-weight: 600; }
.notice.err { background: #fde3e7; color: #a01d33; }
.notice.info { background: var(--accent-soft); color: var(--accent); }

/* login */
.login { margin-top: 40px; padding: 22px; }
.login h2 { text-align: center; margin: 6px 0 16px; }
.login-logo { text-align: center; }
.login-logo img { border-radius: 14px; }
.login label { display: block; font-size: 13px; color: var(--muted); margin-bottom: 4px; }
.login input {
  width: 100%; font: inherit; font-size: 16px; padding: 11px; border-radius: 10px; border: 1px solid #ddd;
  margin-bottom: 14px;
}
.err { color: var(--q1); font-size: 14px; }

.toast {
  position: fixed; left: 50%; bottom: calc(90px + env(safe-area-inset-bottom)); transform: translateX(-50%);
  background: rgba(30,30,35,.92); color: #fff; padding: 10px 16px; border-radius: 12px; z-index: 30;
  font-size: 14px; max-width: 86vw; text-align: center;
}
.card.stale { background: #fde3e7; color: var(--q1); font-weight: 600; text-align: center; }
