/* ==========================================================
   工作台原型 · 基础层：设计令牌 / 重置 / 通用原子
   方向：墨色侧轨 + 暖纸画布 + 朱砂强调，编辑部式排版
   ========================================================== */
:root {
  color-scheme: light;
  --ink: #17161a;
  --ink-2: #2a2830;
  --ink-3: #46434d;
  --paper: #f7f8f9;
  --paper-2: #ebedef;
  --card: #ffffff;
  --line: #e4e6e8;
  --line-strong: #d1d4d7;
  --text: #1c1b1f;
  --text-2: #5b5750;
  --text-3: #8f897d;
  --accent: #d9481e;
  --accent-ink: #b8380f;
  --accent-soft: #fbe6dc;
  --todo: #8f897d;      --todo-soft: #eeeae1;
  --doing: #2f5fd0;     --doing-soft: #e3eafb;
  --done: #2c8a5a;      --done-soft: #e1f1e7;
  --high: #d9481e;      --high-soft: #fbe6dc;
  --mid: #c08415;       --mid-soft: #f8edd3;
  --low: #5f8a6e;       --low-soft: #e5efe7;
  --r-sm: 6px; --r: 10px; --r-lg: 16px;
  --sh-1: 0 1px 0 rgba(23,22,26,.04), 0 1px 3px rgba(23,22,26,.06);
  --sh-2: 0 10px 30px -12px rgba(23,22,26,.22), 0 2px 6px rgba(23,22,26,.05);
  --sh-3: 0 30px 80px -20px rgba(23,22,26,.4);
  --rail: 76px;
  --top: 60px;
  --font: "PingFang SC", "HarmonyOS Sans SC", "Microsoft YaHei", "Segoe UI", system-ui, sans-serif;
  --serif: "Songti SC", "Noto Serif SC", "Source Han Serif SC", "STSong", "SimSun", serif;
  --mono: "JetBrains Mono", "Cascadia Code", "SF Mono", Consolas, monospace;
}

*, *::before, *::after { box-sizing: border-box; }
html, body { margin: 0; height: 100%; }
body {
  background: var(--paper);
  color: var(--text);
  font: 14px/1.6 var(--font);
  -webkit-font-smoothing: antialiased;
}
body.locked { overflow: hidden; }
h1, h2, h3, h4, p { margin: 0; }
ul, ol { margin: 0; padding: 0; list-style: none; }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; }
button { cursor: pointer; background: none; border: 0; padding: 0; }
[hidden] { display: none !important; }
::selection { background: var(--accent-soft); color: var(--accent-ink); }
:focus-visible { outline: 2px solid var(--accent); outline-offset: 2px; border-radius: 4px; }
.sr-only { position: absolute; width: 1px; height: 1px; overflow: hidden; clip-path: inset(50%); white-space: nowrap; }
.ico { width: 16px; height: 16px; flex: none; stroke: currentColor; fill: none; stroke-width: 1.8; stroke-linecap: round; stroke-linejoin: round; }
.ico-lg { width: 20px; height: 20px; }
.num { font-family: var(--mono); font-variant-numeric: tabular-nums; letter-spacing: -.02em; }
.serif { font-family: var(--serif); }
.muted { color: var(--text-3); }
.clamp-2 { display: -webkit-box; -webkit-line-clamp: 2; -webkit-box-orient: vertical; overflow: hidden; }
.clamp-3 { display: -webkit-box; -webkit-line-clamp: 3; -webkit-box-orient: vertical; overflow: hidden; }
.ellipsis { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; min-width: 0; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 34px; padding: 0 14px; border-radius: var(--r-sm);
  font-size: 13px; font-weight: 600; white-space: nowrap;
  border: 1px solid transparent; transition: background .15s, border-color .15s, color .15s, transform .1s;
}
.btn:active { transform: translateY(1px); }
.btn-primary { background: var(--ink); color: var(--paper); }
.btn-primary:hover { background: var(--ink-3); }
.btn-accent { background: var(--accent); color: #fff; }
.btn-accent:hover { background: var(--accent-ink); }
.btn-line { background: var(--card); border-color: var(--line-strong); }
.btn-line:hover { border-color: var(--ink); }
.btn-ghost { color: var(--text-2); }
.btn-ghost:hover { background: var(--paper-2); color: var(--text); }
.btn-danger { color: var(--accent-ink); }
.btn-danger:hover { background: var(--accent-soft); }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.icon-btn {
  display: inline-grid; place-items: center; width: 30px; height: 30px; border-radius: var(--r-sm);
  color: var(--text-2); transition: background .15s, color .15s;
}
.icon-btn:hover { background: var(--paper-2); color: var(--text); }
.icon-btn.danger:hover { background: var(--accent-soft); color: var(--accent-ink); }

/* ---------- 标签 / 徽章 ---------- */
.tag {
  display: inline-flex; align-items: center; gap: 4px; height: 22px; padding: 0 8px;
  border-radius: 999px; font-size: 12px; font-weight: 500; background: var(--paper-2); color: var(--text-2);
  white-space: nowrap;
}
.badge { display: inline-flex; align-items: center; gap: 6px; height: 22px; padding: 0 8px; border-radius: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.badge::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.st-todo { color: var(--todo); background: var(--todo-soft); }
.st-doing { color: var(--doing); background: var(--doing-soft); }
.st-done { color: var(--done); background: var(--done-soft); }
.pr { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; font-weight: 600; white-space: nowrap; }
.pr i { display: inline-flex; gap: 2px; }
.pr i b { width: 3px; height: 10px; border-radius: 1px; background: var(--line-strong); }
.pr-high { color: var(--high); } .pr-high i b { background: var(--high); }
.pr-medium { color: var(--mid); } .pr-medium i b:nth-child(-n+2) { background: var(--mid); }
.pr-low { color: var(--low); } .pr-low i b:first-child { background: var(--low); }
.due { display: inline-flex; align-items: center; gap: 4px; font-size: 12px; color: var(--text-3); white-space: nowrap; }
.due.soon { color: var(--mid); }
.due.late { color: var(--accent-ink); font-weight: 600; }

/* ---------- 头像 ---------- */
.avatar {
  position: relative; display: inline-grid; place-items: center; width: 26px; height: 26px; border-radius: 50%;
  font-size: 11px; font-weight: 700; color: #fff; flex: none; box-shadow: 0 0 0 2px var(--card);
}
.avatar img { position: absolute; inset: 0; width: 100%; height: 100%; border-radius: inherit; object-fit: cover; }
.avatars { display: inline-flex; }
.avatars .avatar + .avatar { margin-left: -7px; }

/* ---------- 进度 ---------- */
.bar { height: 6px; border-radius: 999px; background: var(--paper-2); overflow: hidden; }
.bar > i { display: block; height: 100%; border-radius: inherit; background: var(--c, var(--ink)); }
.ring {
  --p: 0; --c: var(--ink);
  width: 38px; height: 38px; border-radius: 50%; flex: none; display: grid; place-items: center;
  background: conic-gradient(var(--c) calc(var(--p) * 1%), var(--paper-2) 0);
  font: 600 10px var(--mono);
}
.ring::before { content: ""; grid-area: 1 / 1; width: 30px; height: 30px; border-radius: 50%; background: var(--card); }
.ring > span { grid-area: 1 / 1; position: relative; }

/* ---------- 空状态 ---------- */
.empty {
  grid-column: 1 / -1; display: grid; justify-items: center; gap: 8px; padding: 56px 20px;
  border: 1px dashed var(--line-strong); border-radius: var(--r-lg); color: var(--text-3); text-align: center;
}
.empty .ico { width: 28px; height: 28px; stroke-width: 1.4; }
.empty h3 { font: 600 16px var(--serif); color: var(--text); }
