/* oskyear2026 · 任务待办 —— 浅色主题，无外部依赖（不引 CDN，服务器无外网也照常渲染） */

:root {
  --bg: #f5f6f8;
  --card: #ffffff;
  --line: #e4e7ec;
  --text: #1f2430;
  --muted: #7b8494;
  --accent: #2f6fed;
  --danger: #d92d20;
  --danger-bg: #fef3f2;
  --ok: #12b76a;
  --chip: #eef1f6;
  --radius: 10px;
}

* { box-sizing: border-box; }

body {
  margin: 0;
  padding: 20px 16px 48px;
  background: var(--bg);
  color: var(--text);
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "Microsoft YaHei",
               "PingFang SC", "Hiragino Sans GB", Roboto, sans-serif;
  font-size: 14px;
  line-height: 1.5;
  max-width: 960px;
  margin-inline: auto;
}

h1 { font-size: 22px; margin: 0 0 2px; }
h2 { font-size: 14px; margin: 0; }

/* ---------- 顶部 ---------- */
.topbar {
  display: flex; align-items: flex-start; justify-content: space-between;
  gap: 12px; margin-bottom: 16px;
}
.sub { margin: 0; color: var(--muted); font-size: 13px; }

/* 错误横幅：接口挂了也照样能看到真实原因，页面不白屏 */
.banner {
  margin-bottom: 14px; padding: 10px 12px;
  border: 1px solid #fda29b; border-left: 4px solid var(--danger);
  background: var(--danger-bg); color: #912018;
  border-radius: var(--radius); white-space: pre-wrap;
  font-family: ui-monospace, Consolas, monospace; font-size: 12.5px;
}

/* ---------- KPI ---------- */
.kpis {
  display: grid; gap: 10px; margin-bottom: 14px;
  grid-template-columns: repeat(auto-fit, minmax(120px, 1fr));
}
.kpi {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px 14px;
  display: flex; flex-direction: column; gap: 2px;
}
.kpi .n { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.kpi .l { color: var(--muted); font-size: 12.5px; }
.kpi.danger .n { color: var(--danger); }
.kpi.muted .n { color: var(--muted); }

/* ---------- 表单 ---------- */
.card {
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 12px; margin-bottom: 16px;
}
.row { display: flex; gap: 8px; }
.row + .row { margin-top: 8px; }
.grow { flex: 1 1 auto; min-width: 0; }

input[type="text"], input[type="date"], select, button {
  font: inherit; color: inherit;
  padding: 8px 10px; border: 1px solid var(--line);
  border-radius: 8px; background: #fff;
}
input:focus, select:focus { outline: 2px solid #c7d7fe; border-color: var(--accent); }

button {
  cursor: pointer; background: var(--accent); color: #fff;
  border-color: var(--accent); font-weight: 500; white-space: nowrap;
}
button:hover { filter: brightness(1.05); }
button.ghost { background: #fff; color: var(--muted); border-color: var(--line); }

/* ---------- 分组列表 ---------- */
.group { margin-bottom: 14px; }
.g-title {
  display: flex; align-items: center; gap: 8px;
  padding: 4px 2px 8px; color: var(--text);
}
.g-title.danger { color: var(--danger); }
.g-title.muted { color: var(--muted); }
.g-title .count {
  background: var(--chip); color: var(--muted);
  border-radius: 999px; padding: 1px 8px; font-size: 12px;
  font-variant-numeric: tabular-nums;
}
.g-title.danger .count { background: var(--danger-bg); color: var(--danger); }
.g-title .hint { font-weight: 400; color: var(--muted); font-size: 12px; }
.toggle-done { cursor: pointer; user-select: none; }

.list { list-style: none; margin: 0; padding: 0; }

.item {
  display: flex; align-items: flex-start; gap: 10px;
  background: var(--card); border: 1px solid var(--line);
  border-radius: var(--radius); padding: 10px 12px; margin-bottom: 8px;
}
.item.overdue { border-left: 4px solid var(--danger); background: var(--danger-bg); }
.item.done { opacity: .6; }
.item.done .item-title { text-decoration: line-through; }

.item input[type="checkbox"] { margin-top: 3px; width: 16px; height: 16px; cursor: pointer; }
.item-main { flex: 1 1 auto; min-width: 0; }
.item-title { word-break: break-word; }
.item-meta { display: flex; flex-wrap: wrap; gap: 6px; margin-top: 6px; }

.chip {
  background: var(--chip); color: var(--muted);
  border-radius: 999px; padding: 1px 8px; font-size: 12px; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.chip.p1 { background: #fee4e2; color: #b42318; }
.chip.p2 { background: #fef0c7; color: #b54708; }
.chip.p3 { background: #eef1f6; color: #5b6472; }
.chip.over { background: var(--danger-bg); color: var(--danger); }

.item-actions { display: flex; gap: 6px; }
.item-actions button {
  background: #fff; color: var(--muted); border-color: var(--line);
  padding: 4px 8px; font-size: 12.5px;
}
.item-actions button:hover { color: var(--text); }

.empty { color: var(--muted); font-size: 13px; padding: 6px 2px; }

.foot { color: var(--muted); font-size: 12px; text-align: center; margin-top: 20px; }
