/* 斗破案协作台 · 颜色与字体沿用项目 DESIGN.md
   字号：12.5 徽标 / 13 辅助 / 14 次要 / 15 正文 / 17 小标题 / 22 页标题 / 24 节点标题 */
:root {
  --canvas: #e9eef1;
  --surface: #ffffff;
  --surface-2: #f5f8fa;
  --surface-3: #e3e9ed;
  --ink: #172634;
  --slate: #405564;
  --muted: #566874;
  --faint: #8a99a3;
  --line: #c9d4dc;
  --line-soft: #e0e6ea;
  --navy: #1b3c59;
  --navy-2: #2a5578;
  --navy-soft: #e3ebf2;
  --red: #a74640;
  --red-soft: #f6e5e3;
  --green: #2c6a57;
  --green-soft: #e1efe9;
  --blue: #2f6497;
  --blue-soft: #e4eef8;
  --amber: #8d5c0e;
  --amber-soft: #f7ecd8;
  --radius: 7px;
  --radius-lg: 12px;
  --shadow-sm: 0 1px 2px rgba(23, 38, 52, .06);
  --shadow: 0 1px 3px rgba(23, 38, 52, .06), 0 12px 32px rgba(23, 38, 52, .09);
  --ease: cubic-bezier(.22, 1, .36, 1);
  --font: "Microsoft YaHei", "PingFang SC", "Noto Sans SC", system-ui, sans-serif;
  --mono: Consolas, "SFMono-Regular", Menlo, monospace;
  --z-sticky: 10;
  --z-menu: 30;
  --z-modal: 60;
  --z-lightbox: 70;
  --z-toast: 80;
  color-scheme: light;
}

* { box-sizing: border-box; }
html, body { height: 100%; }
body {
  margin: 0;
  background: var(--canvas);
  color: var(--ink);
  font: 15px/1.7 var(--font);
  -webkit-font-smoothing: antialiased;
}
button, input, select, textarea { font: inherit; color: inherit; }
a { color: var(--navy-2); }
h1, h2, h3, h4 { text-wrap: balance; }
::placeholder { color: #6b7c86; opacity: 1; }
.boot { padding: 40vh 0 0; text-align: center; color: var(--muted); }
.num { font-variant-numeric: tabular-nums; }
.muted, .faint { color: var(--muted); }
.hidden { display: none !important; }
.late { color: var(--red); }
:focus-visible { outline: 2px solid var(--navy-2); outline-offset: 2px; }

/* ---------- 登录 ---------- */
.login { min-height: 100vh; display: grid; place-items: center; padding: 24px 16px; }
.login-card {
  width: min(400px, 100%);
  background: var(--surface);
  border: 1px solid var(--line);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow);
  padding: 36px 32px 30px;
}
.login-card h1 { margin: 0 0 6px; font-size: 22px; letter-spacing: .04em; color: var(--navy); }
.login-card p { margin: 0 0 24px; color: var(--muted); font-size: 14px; }
.login-card label { display: block; font-size: 14px; font-weight: 600; color: var(--slate); margin: 16px 0 7px; }
.login-card .input { height: 42px; }
.login-card .btn { width: 100%; margin-top: 22px; height: 42px; font-size: 15px; }
.login-error { color: var(--red); font-size: 14px; min-height: 22px; margin-top: 10px; }

/* ---------- 通用控件 ---------- */
.input, .select, .textarea {
  width: 100%;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  padding: 8px 12px;
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease);
}
.input, .select { height: 38px; }
.input:hover, .select:hover, .textarea:hover { border-color: #b1bfc9; }
.input:focus, .select:focus, .textarea:focus { border-color: var(--navy-2); box-shadow: 0 0 0 3px var(--navy-soft); outline: none; }
.select { padding: 0 10px; }
.textarea { min-height: 80px; resize: vertical; line-height: 1.75; overflow: hidden; }
.inline { display: flex; gap: 8px; }
.btn {
  display: inline-flex; align-items: center; justify-content: center; gap: 6px;
  height: 38px; padding: 0 16px;
  border: 1px solid var(--line);
  border-radius: var(--radius);
  background: var(--surface);
  font-size: 14.5px;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s var(--ease), border-color .15s var(--ease), color .15s var(--ease);
}
.btn:hover { border-color: #a9b8c3; background: var(--surface-2); }
.btn:active { background: var(--surface-3); }
.btn.primary { background: var(--navy); border-color: var(--navy); color: #fff; font-weight: 600; }
.btn.primary:hover { background: var(--navy-2); border-color: var(--navy-2); }
.btn.primary:active { background: #14304a; }
.btn.ghost { border-color: transparent; background: transparent; color: var(--slate); }
.btn.ghost:hover { background: var(--navy-soft); color: var(--navy); }
.btn.danger { color: var(--red); }
.btn.danger:hover { background: var(--red-soft); border-color: var(--red); }
.btn.sm { height: 32px; padding: 0 12px; font-size: 13.5px; }
.btn:disabled { opacity: .5; cursor: not-allowed; }
.icon-btn {
  width: 30px; height: 30px;
  display: inline-grid; place-items: center; flex: none;
  border: 0; border-radius: 6px;
  background: transparent; color: var(--muted);
  cursor: pointer;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.icon-btn:hover { background: var(--navy-soft); color: var(--navy); }

/* 状态：工作线 */
.pill {
  display: inline-flex; align-items: center; gap: 6px;
  height: 24px; padding: 0 9px; border-radius: 12px;
  font-size: 13px; white-space: nowrap;
  background: var(--surface-2); color: var(--slate);
}
.pill::before { content: ""; width: 6px; height: 6px; border-radius: 50%; background: currentColor; }
.pill.s-todo { color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-soft); }
.pill.s-todo::before { background: transparent; box-shadow: inset 0 0 0 1.5px currentColor; }
.pill.s-doing { color: var(--blue); background: var(--blue-soft); }
.pill.s-done { color: var(--green); background: var(--green-soft); }

.sq { width: 10px; height: 10px; border-radius: 2.5px; display: inline-block; flex: none; }
.sq.s-todo { box-shadow: inset 0 0 0 1.5px #a5b3bd; }
.sq.s-doing { background: var(--blue); }
.sq.s-done { background: var(--green); }

/* 状态：任务 */
.tpill {
  display: inline-flex; align-items: center; height: 24px; padding: 0 9px; border-radius: 12px;
  font-size: 13px; white-space: nowrap; background: var(--surface-2); color: var(--slate);
  box-shadow: inset 0 0 0 1px var(--line-soft);
}
.tpill.t-doing { background: var(--blue-soft); color: var(--blue); box-shadow: none; }
.tpill.t-submitted { background: var(--amber-soft); color: var(--amber); box-shadow: none; }
.tpill.t-done { background: var(--green-soft); color: var(--green); box-shadow: none; }
.tpill.overdue { box-shadow: inset 0 0 0 1px var(--red); color: var(--red); background: var(--red-soft); }

.prio {
  flex: none; display: inline-grid; place-items: center;
  height: 22px; min-width: 30px; padding: 0 6px; border-radius: 5px;
  font-size: 12px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
  background: var(--surface-2); color: var(--muted); box-shadow: inset 0 0 0 1px var(--line-soft);
}
.prio.p-P0 { background: var(--red); color: #fff; box-shadow: none; }
.prio.p-P1 { background: var(--red-soft); color: var(--red); box-shadow: none; }

.kind { font-size: 12.5px; padding: 2px 8px; border-radius: 5px; background: var(--navy-soft); color: var(--navy); white-space: nowrap; }
.kind.k-compare { background: #ebe7f3; color: #4f3f7a; }
.kind.k-defense { background: #f4e9e2; color: #7d4325; }
.kind.k-evidence { background: var(--green-soft); color: var(--green); }

.grade {
  display: inline-grid; place-items: center; flex: none;
  min-width: 24px; height: 24px; padding: 0 6px; border-radius: 5px;
  font-size: 13px; font-weight: 700; line-height: 1;
  background: var(--surface-2); color: var(--slate);
}
.grade:empty { display: none; }
.grade.g-A { background: var(--green-soft); color: var(--green); }
.grade.g-B { background: var(--blue-soft); color: var(--blue); }
.grade.g-C { background: var(--amber-soft); color: var(--amber); }
.grade.g-D { background: var(--red-soft); color: var(--red); }

#toast {
  position: fixed; left: 50%; bottom: 28px; transform: translate(-50%, 12px);
  background: var(--ink); color: #fff;
  padding: 10px 18px; border-radius: 9px;
  font-size: 14px; box-shadow: var(--shadow);
  opacity: 0; pointer-events: none;
  transition: opacity .2s var(--ease), transform .2s var(--ease);
  z-index: var(--z-toast);
  max-width: calc(100vw - 32px);
}
#toast.show { opacity: 1; transform: translate(-50%, 0); }
#toast.error { background: var(--red); }

/* ---------- 顶栏 ---------- */
.shell { display: flex; flex-direction: column; height: 100vh; }
.topbar {
  flex: none;
  display: flex; align-items: center; gap: 28px;
  height: 58px; padding: 0 22px;
  background: var(--navy);
  color: #fff;
}
.brand { display: flex; align-items: center; gap: 11px; font-weight: 700; letter-spacing: .05em; white-space: nowrap; font-size: 16px; }
.brand-mark {
  width: 30px; height: 30px; display: grid; place-items: center; flex: none;
  border: 1px solid rgba(255, 255, 255, .55); border-radius: 4px;
  font: 400 17px/1 SimSun, "Songti SC", serif; letter-spacing: 0;
}
.nav { display: flex; gap: 4px; overflow-x: auto; scrollbar-width: none; align-self: stretch; }
.nav::-webkit-scrollbar { display: none; }
.nav a {
  display: inline-flex; align-items: center;
  padding: 0 14px; font-size: 15px;
  color: #c9d6e0; text-decoration: none; white-space: nowrap;
  box-shadow: inset 0 -3px 0 transparent;
  transition: color .15s var(--ease), box-shadow .15s var(--ease), background .15s var(--ease);
}
.nav a:hover { color: #fff; background: rgba(255, 255, 255, .06); }
.nav a.active { color: #fff; font-weight: 600; box-shadow: inset 0 -3px 0 #e2b04a; }
.navcount:not(:empty) {
  display: inline-grid; place-items: center; min-width: 20px; height: 20px; padding: 0 6px; margin-left: 7px;
  border-radius: 10px; background: #e2b04a; color: #2a1f05; font-size: 12px; font-weight: 700; line-height: 1; font-variant-numeric: tabular-nums;
}
.topbar .spacer { flex: 1; }
.userbox { display: flex; align-items: center; gap: 12px; white-space: nowrap; }
.userbox .who { font-size: 14.5px; display: inline-flex; align-items: center; gap: 8px; }
.avatar {
  width: 28px; height: 28px; border-radius: 50%; display: grid; place-items: center;
  background: #e2b04a; color: #2a1f05; font-size: 13px; font-weight: 700;
}
.topbar .btn { background: transparent; color: #fff; border-color: rgba(255, 255, 255, .3); height: 32px; font-size: 14px; }
.topbar .btn:hover { background: rgba(255, 255, 255, .1); border-color: rgba(255, 255, 255, .6); }
.menu { position: relative; }
.menu-list {
  position: absolute; right: 0; top: calc(100% + 6px);
  min-width: 200px;
  background: var(--surface); color: var(--ink);
  border: 1px solid var(--line); border-radius: 9px; box-shadow: var(--shadow);
  padding: 5px; z-index: var(--z-menu);
  animation: pop .14s var(--ease);
}
.menu-list button {
  display: block; width: 100%; text-align: left; font-size: 14.5px;
  border: 0; background: transparent; padding: 8px 12px; border-radius: 6px; cursor: pointer;
}
.menu-list button:hover { background: var(--navy-soft); }
.main { flex: 1; min-height: 0; overflow: auto; }

/* ---------- 页面通用 ---------- */
.page { padding: 28px 32px 72px; max-width: 1200px; }
.page-wide { max-width: none; }
.page h2 { margin: 0 0 6px; font-size: 22px; color: var(--ink); letter-spacing: .02em; }
.page .lead { margin: 0 0 22px; color: var(--muted); font-size: 14.5px; max-width: 48em; }
.filters { display: flex; flex-wrap: wrap; gap: 10px; align-items: center; margin-bottom: 16px; }
.filters .select, .filters .input { width: auto; }
.filters .input { min-width: 240px; }
.filters .count-note { font-size: 14px; color: var(--muted); }
.block { margin-bottom: 20px; }
.block > label, .field > label { display: block; font-size: 14px; color: var(--slate); margin-bottom: 7px; font-weight: 600; }
.block-head, .section-head { display: flex; align-items: baseline; justify-content: space-between; gap: 16px; margin-bottom: 10px; }
.block-head h3, .section-head h3 { margin: 0; font-size: 16px; font-weight: 700; color: var(--ink); }
.hint { font-size: 13px; color: var(--muted); text-align: right; }
.section { margin-top: 32px; }
.fields { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 20px; }
.field.wide { grid-column: span 2; }
.seg { display: flex; border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; background: var(--surface); height: 38px; }
.seg button {
  flex: 1; border: 0; background: transparent; padding: 0 6px; cursor: pointer;
  font-size: 14px; color: var(--slate); white-space: nowrap;
  transition: background .15s var(--ease), color .15s var(--ease);
}
.seg button + button { border-left: 1px solid var(--line-soft); }
.seg button:hover:not(.on) { background: var(--surface-2); color: var(--ink); }
.seg button.on { color: #fff; font-weight: 600; }
.seg button.on.s-todo { background: #64757f; }
.seg button.on.s-doing { background: var(--blue); }
.seg button.on.s-done { background: var(--green); }
/* 属性栏里的竖排状态 */
.seg-v { flex-direction: column; height: auto; border: 0; background: transparent; gap: 2px; overflow: visible; }
.seg-v button {
  display: flex; align-items: center; gap: 10px; height: 36px; padding: 0 10px; border-radius: 7px;
  text-align: left; font-size: 14.5px; color: var(--slate);
}
.seg-v button + button { border-left: 0; }
.seg-v button::before { content: ""; width: 10px; height: 10px; border-radius: 2.5px; flex: none; box-shadow: inset 0 0 0 1.5px #a5b3bd; }
.seg-v button.s-doing::before { background: var(--blue); box-shadow: none; }
.seg-v button.s-done::before { background: var(--green); box-shadow: none; }
.seg-v button.on { color: var(--ink); font-weight: 700; background: var(--navy-soft) !important; box-shadow: inset 0 0 0 1px #c5d4e2; }

.list { border: 1px solid var(--line); border-radius: var(--radius-lg); background: var(--surface); overflow: hidden; }
.list:empty { display: none; }
.li { display: flex; align-items: center; gap: 12px; padding: 12px 14px; border-top: 1px solid var(--line-soft); }
.li:first-child { border-top: 0; }
.li .grow { flex: 1; min-width: 0; }
.li .title { overflow: hidden; text-overflow: ellipsis; font-weight: 500; }
.li .sub { font-size: 13.5px; color: var(--muted); margin-top: 2px; }
.li .sub.late { color: var(--red); }
.li .meta { font-size: 14px; color: var(--slate); white-space: nowrap; }
.li.done .title { color: var(--muted); text-decoration: line-through; text-decoration-color: #a7b5bf; font-weight: 400; }
.addrow { display: flex; gap: 8px; margin-top: 10px; flex-wrap: wrap; }
.addrow .input { flex: 1 1 280px; }
.addrow .select, .addrow input[type=date] { width: auto; flex: none; }

.empty { padding: 20px 22px; color: var(--muted); background: var(--surface); border: 1px dashed var(--line); border-radius: var(--radius-lg); font-size: 14.5px; }
.empty b { color: var(--slate); }
.empty-state { padding: 60px 28px; color: var(--muted); }

/* ---------- 导图工作台 ---------- */
.workbench { display: grid; grid-template-columns: minmax(320px, 380px) 1fr; height: 100%; }
.tree-pane { display: flex; flex-direction: column; min-height: 0; border-right: 1px solid var(--line); background: var(--surface-2); }
.tree-tools { padding: 14px 14px 10px; display: flex; flex-direction: column; gap: 10px; border-bottom: 1px solid var(--line-soft); }
.tree-tools .row { display: flex; gap: 4px; align-items: center; }
.tree-legend { display: inline-flex; gap: 4px; align-items: center; font-size: 12.5px; color: var(--muted); white-space: nowrap; }
.tree-legend .sq { margin-left: 6px; }
.tree { flex: 1; overflow: auto; padding: 8px 8px 48px; }
.trow {
  display: flex; align-items: center; gap: 5px;
  min-height: 36px; padding: 4px 8px 4px 2px;
  border-radius: 7px; cursor: pointer; user-select: none; font-size: 14.5px;
  transition: background .12s var(--ease);
}
.trow:hover { background: var(--surface-3); }
.trow.selected { background: var(--navy-soft); box-shadow: inset 0 0 0 1px #c5d4e2; }
.trow.selected .tlabel { color: var(--navy); font-weight: 700; }
.trow.drop-before { box-shadow: inset 0 2px 0 var(--navy-2); }
.trow.drop-after { box-shadow: inset 0 -2px 0 var(--navy-2); }
.trow.drop-inside { background: #d6e2ec; box-shadow: inset 0 0 0 1.5px var(--navy-2); }
.trow.dragging { opacity: .4; }
.caret {
  flex: none; width: 22px; height: 22px;
  display: grid; place-items: center;
  border: 0; background: transparent; color: var(--muted); cursor: pointer; border-radius: 5px;
  transition: transform .18s var(--ease), background .12s var(--ease);
}
.caret:hover { background: var(--line-soft); }
.caret.open { transform: rotate(90deg); }
.caret.leaf { visibility: hidden; }
.tlabel { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tlabel .alt { color: var(--muted); }
.tlabel .alt::before { content: "／"; color: var(--faint); margin: 0 2px; }
.tlabel mark { background: #f3dc9a; color: inherit; border-radius: 2px; }
.tmeta { flex: none; display: flex; align-items: center; gap: 3px; }
.tmeta .ev { font-size: 12px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--navy); background: var(--navy-soft); border-radius: 9px; padding: 3px 6px; margin-left: 5px; }
.tmeta .ev:empty { display: none; }
.tact { flex: none; display: none; }
.trow:hover .tact, .trow.selected .tact { display: flex; }
.tact .icon-btn { width: 26px; height: 26px; }
.tchildren { margin-left: 16px; padding-left: 6px; border-left: 1px solid var(--line-soft); }

.detail-pane { min-width: 0; overflow: auto; background: var(--surface); }
.detail { max-width: 1280px; padding: 22px 36px 72px; }
.crumbs { font-size: 13.5px; color: var(--muted); display: flex; flex-wrap: wrap; gap: 5px; align-items: center; }
.crumbs a { color: var(--muted); text-decoration: none; }
.crumbs a:hover { color: var(--navy-2); text-decoration: underline; }
.crumbs .sep { color: var(--faint); }
.titlebar { display: grid; grid-template-columns: 1fr 1fr; gap: 16px; margin: 14px 0 18px; max-width: 900px; }
.tfield label { display: block; font-size: 13px; color: var(--muted); margin: 0 0 3px 10px; }
.title-in {
  width: 100%; height: 46px; padding: 0 10px;
  border: 1px solid transparent; border-radius: 8px; background: transparent;
  font-size: 24px; font-weight: 700; color: var(--ink); letter-spacing: .01em;
  transition: background .15s var(--ease), border-color .15s var(--ease);
}
.title-in:hover { background: var(--surface-2); }
.title-in:focus { outline: none; background: var(--surface); border-color: var(--navy-2); box-shadow: 0 0 0 3px var(--navy-soft); }
.title-in::placeholder { color: #9aa8b1; font-weight: 400; }

.tabs { display: flex; gap: 4px; border-bottom: 1px solid var(--line); margin-bottom: 26px; overflow-x: auto; overflow-y: hidden; scrollbar-width: none; }
.tabs::-webkit-scrollbar { display: none; }
.tab {
  display: inline-flex; align-items: center; gap: 8px;
  min-height: 46px; padding: 0 16px; border: 0; background: transparent; cursor: pointer;
  font-size: 15px; color: var(--muted); box-shadow: inset 0 -2px 0 transparent; white-space: nowrap;
  transition: color .15s var(--ease), box-shadow .15s var(--ease);
}
.tab:hover { color: var(--ink); box-shadow: inset 0 -2px 0 var(--line); }
.tab.active { color: var(--navy); box-shadow: inset 0 -3px 0 var(--navy); font-weight: 700; }
.tab .count { font-size: 12px; line-height: 1; font-variant-numeric: tabular-nums; color: var(--navy); background: var(--navy-soft); border-radius: 9px; padding: 3px 6px; font-weight: 400; }
.tab .count:empty { display: none; }
.savestate { margin-left: auto; align-self: center; font-size: 13px; color: var(--muted); padding-right: 4px; white-space: nowrap; }
.savestate.saving { color: var(--amber); }
.savestate.error { color: var(--red); }

.detail-grid { display: grid; grid-template-columns: minmax(0, 1fr) 300px; gap: 40px; align-items: start; }
.detail-main { min-width: 0; }
.props { position: sticky; top: 0; border-left: 1px solid var(--line-soft); padding-left: 28px; }
.prop { padding: 0 0 20px; margin-bottom: 20px; border-bottom: 1px solid var(--line-soft); }
.prop:last-child { border-bottom: 0; }
.prop h4 { margin: 0 0 10px; font-size: 13.5px; font-weight: 600; color: var(--muted); }
.prop .select { font-size: 14.5px; }
.prop-text { font-size: 14px; color: var(--slate); }
.prop-empty { font-size: 14px; color: var(--muted); }
.prop-btn { margin: 6px 0 0 -10px; }
.modrow { display: flex; gap: 10px; align-items: flex-start; padding: 6px 0; }
.modname { font-size: 14.5px; font-weight: 600; line-height: 1.5; }
.modpg { font-size: 13px; color: var(--muted); }
.modgap { font-size: 13px; color: var(--slate); margin-top: 4px; line-height: 1.6; }
.stats { display: flex; gap: 18px; }
.stats span { display: flex; flex-direction: column; font-size: 13px; color: var(--muted); }
.stats b { font-size: 20px; color: var(--ink); line-height: 1.3; }

.atts { display: flex; flex-wrap: wrap; gap: 10px; }
.att { position: relative; width: 148px; border: 1px solid var(--line); border-radius: 8px; background: var(--surface); overflow: hidden; font-size: 13px; }
.att .thumb { height: 96px; display: grid; place-items: center; background: var(--surface-2); color: var(--muted); cursor: zoom-in; }
.att .thumb img { width: 100%; height: 100%; object-fit: cover; }
.att .name { padding: 6px 8px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.att .del { position: absolute; top: 4px; right: 4px; background: rgba(255, 255, 255, .92); }
.dropzone {
  width: 148px; min-height: 126px;
  border: 1.5px dashed var(--line); border-radius: 8px;
  display: grid; place-items: center; text-align: center;
  color: var(--muted); font-size: 13px; line-height: 1.6; padding: 10px; cursor: pointer; background: var(--surface-2);
  transition: border-color .15s var(--ease), background .15s var(--ease), color .15s var(--ease);
}
.dropzone:hover, .dropzone.over { border-color: var(--navy-2); color: var(--navy); background: var(--navy-soft); }

.comments .cm { padding: 14px 16px; border-top: 1px solid var(--line-soft); }
.comments .cm:first-child { border-top: 0; }
.cm-head { display: flex; gap: 10px; font-size: 13.5px; color: var(--muted); margin-bottom: 4px; align-items: center; }
.cm-head b { color: var(--ink); font-weight: 700; }
.cm-body { white-space: pre-wrap; word-break: break-word; }

/* ---------- 任务看板 ---------- */
.board { display: grid; grid-template-columns: repeat(4, minmax(270px, 1fr)); gap: 16px; align-items: start; overflow-x: auto; padding-bottom: 8px; }
.col { background: var(--surface-3); border-radius: var(--radius-lg); padding: 12px; min-height: 160px; }
.col h3 { margin: 2px 4px 12px; font-size: 15px; display: flex; justify-content: space-between; align-items: center; color: var(--slate); }
.col h3 .num { font-weight: 400; color: var(--muted); font-size: 14px; }
.col-submitted { background: #f0e5cf; }
.col-submitted h3 { color: var(--amber); }
.cards { display: flex; flex-direction: column; gap: 10px; }
.col-empty { font-size: 14px; color: var(--muted); padding: 12px 6px; }
.tcard {
  background: var(--surface); border: 1px solid var(--line-soft); border-radius: 10px;
  padding: 12px 14px; cursor: pointer; box-shadow: var(--shadow-sm);
  transition: border-color .15s var(--ease), box-shadow .15s var(--ease), transform .15s var(--ease);
}
.tcard:hover { border-color: var(--line); box-shadow: var(--shadow); transform: translateY(-1px); }
.tcard-top { display: flex; align-items: center; gap: 7px; margin: -2px 0 8px; }
.tcard-top .icon-btn { width: 26px; height: 26px; margin-left: auto; }
.tcard-title { font-weight: 600; font-size: 15px; line-height: 1.55; }
.tcard-sub { font-size: 13.5px; color: var(--muted); margin-top: 4px; }
.tcard-sub.late { color: var(--red); }
.tcard-foot { display: flex; justify-content: space-between; align-items: center; font-size: 13.5px; color: var(--slate); margin-top: 10px; padding-top: 10px; border-top: 1px solid var(--line-soft); }
.tcard-act { display: flex; gap: 8px; margin-top: 10px; }
.tcard-act .btn { flex: 1; }
.col-done .tcard { box-shadow: none; }
.col-done .tcard-title { color: var(--muted); font-weight: 400; }

/* ---------- 进度总览 ---------- */
.summary { display: grid; grid-template-columns: repeat(4, minmax(0, 1fr)); gap: 16px; margin-bottom: 22px; }
.scard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); padding: 16px 18px; }
.scard h3 { margin: 0; font-size: 15px; color: var(--slate); font-weight: 700; }
.scard .big { font-size: 28px; font-weight: 700; line-height: 1.2; font-variant-numeric: tabular-nums; margin: 8px 0 12px; color: var(--ink); }
.scard .big small { font: 400 13.5px/1.4 var(--font); color: var(--muted); margin-left: 8px; }
.bar { display: flex; height: 8px; border-radius: 4px; overflow: hidden; background: var(--surface-3); }
.bar span { display: block; height: 100%; }
.bar .s-todo { background: #c3ced6; }
.bar .s-doing { background: var(--blue); }
.bar .s-done { background: var(--green); }
.bar-legend { display: flex; flex-wrap: wrap; gap: 4px 14px; margin-top: 10px; font-size: 13px; color: var(--muted); }
.bar-legend span { display: inline-flex; align-items: center; gap: 6px; }

.table-wrap { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); overflow: auto; }
table.grid { width: 100%; border-collapse: collapse; font-size: 14.5px; }
.grid th, .grid td { padding: 10px 14px; border-bottom: 1px solid var(--line-soft); text-align: left; vertical-align: middle; }
.grid th { position: sticky; top: 0; background: var(--navy); color: #fff; font-weight: 600; font-size: 14px; z-index: var(--z-sticky); white-space: nowrap; }
.grid tr:last-child td { border-bottom: 0; }
.grid tbody tr:hover td { background: #f6f9fb; }
.grid td.cell { cursor: pointer; min-width: 150px; }
.grid td.cell:hover { background: var(--navy-soft) !important; }
.grid td.cell.idle .cellbox { opacity: .5; }
.grid .pages { font-size: 13px; color: var(--muted); white-space: nowrap; }
.cellbox { display: flex; flex-direction: column; align-items: flex-start; gap: 4px; }
.cellbox .who { font-size: 13.5px; color: var(--slate); }
.tname { color: inherit; text-decoration: none; display: inline-block; white-space: nowrap; }
.tname:hover { color: var(--navy-2); text-decoration: underline; }
.tname .alt { color: var(--muted); }
.tname .alt::before { content: "／"; color: var(--faint); }
.tname.depth-1 { font-weight: 700; color: var(--navy); }
.tr-group td { background: var(--surface-2); }

/* ---------- 我的任务 ---------- */
.mine-section { margin-bottom: 32px; }
.mine-section h3 { font-size: 16px; margin: 0 0 12px; display: flex; gap: 10px; align-items: baseline; color: var(--ink); }
.mine-section h3 small { font-size: 14px; font-weight: 400; line-height: 1; font-variant-numeric: tabular-nums; color: var(--muted); }
.mcard { background: var(--surface); border: 1px solid var(--line); border-radius: var(--radius-lg); margin-bottom: 12px; overflow: hidden; transition: box-shadow .2s var(--ease), border-color .2s var(--ease); }
.mcard.open { box-shadow: var(--shadow); border-color: #b3c1cb; }
.mcard.st-done .mcard-title { color: var(--muted); font-weight: 400; }
.mcard-head {
  width: 100%; display: flex; align-items: center; gap: 14px;
  padding: 16px 20px; border: 0; background: transparent; text-align: left; cursor: pointer;
  transition: background .12s var(--ease);
}
.mcard-head:hover { background: var(--surface-2); }
.mcard-head .grow { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.mcard-title { font-weight: 700; font-size: 16px; line-height: 1.5; }
.mcard-sub { font-size: 13.5px; color: var(--muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.mcard-due { font-size: 14px; white-space: nowrap; color: var(--slate); }
.mcard-head .caret { color: var(--muted); }
.mcard-body { padding: 4px 22px 22px; border-top: 1px solid var(--line-soft); animation: reveal .22s var(--ease); }
@keyframes reveal { from { opacity: 0; transform: translateY(-4px); } }
.notice { margin: 16px 0 4px; padding: 12px 14px; border-radius: 8px; background: var(--red-soft); color: #8a3530; font-size: 14.5px; }
.notice b { font-weight: 700; }
.ctx { display: flex; flex-wrap: wrap; gap: 6px 18px; font-size: 13.5px; color: var(--muted); margin: 16px 0 20px; }
.mcard-actions { display: flex; justify-content: flex-end; align-items: center; gap: 10px; padding-top: 6px; }
.mcard-actions .savestate { margin-right: auto; margin-left: 0; }

/* ---------- 对话框与灯箱 ---------- */
.modal-mask { position: fixed; inset: 0; background: rgba(23, 38, 52, .38); z-index: var(--z-modal); display: grid; place-items: center; padding: 16px; animation: fade .15s var(--ease); }
.modal { width: min(580px, 100%); max-height: calc(100vh - 32px); display: flex; flex-direction: column; background: var(--surface); border-radius: var(--radius-lg); box-shadow: var(--shadow); animation: pop .2s var(--ease); }
.modal-head { padding: 18px 22px; border-bottom: 1px solid var(--line-soft); font-weight: 700; font-size: 17px; }
.modal-body { padding: 18px 22px; overflow: auto; }
.modal-body p { font-size: 15px; }
.modal-foot { padding: 14px 22px; border-top: 1px solid var(--line-soft); display: flex; justify-content: flex-end; gap: 10px; }
@keyframes fade { from { opacity: 0; } }
@keyframes pop { from { opacity: 0; transform: translateY(6px) scale(.985); } }
.lightbox { position: fixed; inset: 0; background: rgba(10, 18, 26, .88); z-index: var(--z-lightbox); display: grid; place-items: center; padding: 24px; cursor: zoom-out; animation: fade .15s var(--ease); }
.lightbox img { max-width: 100%; max-height: 100%; box-shadow: 0 10px 40px rgba(0, 0, 0, .4); }

/* ---------- 动态 ---------- */
.feed .day { font-size: 14px; color: var(--slate); margin: 18px 0 6px; font-weight: 700; padding: 0 18px; }
.feed .ev { display: flex; gap: 14px; padding: 10px 18px; border-top: 1px solid var(--line-soft); font-size: 14.5px; }
.feed .day + .ev { border-top: 0; }
.feed .ev time { flex: none; width: 50px; color: var(--muted); }
.feed .ev b { flex: none; width: 60px; font-weight: 700; color: var(--ink); }
.feed .ev a { color: inherit; text-decoration: none; }
.feed .ev a:hover { color: var(--navy-2); text-decoration: underline; }

@media (max-width: 1280px) {
  .detail-grid { grid-template-columns: minmax(0, 1fr) 260px; gap: 28px; }
  .props { padding-left: 22px; }
}
@media (max-width: 1100px) {
  .summary { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .detail-grid { grid-template-columns: 1fr; }
  .props { position: static; border-left: 0; padding-left: 0; order: -1; display: grid; grid-template-columns: repeat(auto-fit, minmax(220px, 1fr)); gap: 0 24px; padding-bottom: 8px; border-bottom: 1px solid var(--line-soft); margin-bottom: 24px; }
  .prop { border-bottom: 0; margin-bottom: 0; }
}
@media (max-width: 960px) {
  .workbench { grid-template-columns: 1fr; height: auto; }
  .tree-pane { max-height: 46vh; border-right: 0; border-bottom: 1px solid var(--line); }
  .detail { padding: 18px 18px 56px; }
  .fields { grid-template-columns: repeat(2, minmax(0, 1fr)); }
  .titlebar { grid-template-columns: 1fr; gap: 6px; }
}
@media (max-width: 720px) {
  .shell { height: auto; min-height: 100vh; }
  .main { overflow: visible; }
  .topbar { height: auto; flex-wrap: wrap; gap: 0 12px; padding: 12px 16px 0; }
  .brand { order: 1; }
  .topbar .spacer { order: 2; }
  .userbox { order: 3; }
  .userbox .who span:last-child { display: none; }
  .nav { order: 4; flex-basis: 100%; height: 46px; margin: 8px -16px 0; padding: 0 6px; }
  .page { padding: 20px 16px 56px; }
  .board { grid-auto-flow: column; grid-template-columns: none; grid-auto-columns: 86%; scroll-snap-type: x mandatory; }
  .col { scroll-snap-align: start; }
  .filters .input { min-width: 0; flex: 1 1 100%; }
  .filters .select { flex: 1 1 calc(50% - 5px); }
  .mcard-head { flex-wrap: wrap; gap: 8px 12px; padding: 14px 16px; }
  .mcard-head .grow { flex-basis: calc(100% - 80px); }
  .mcard-due { margin-left: 44px; }
  .mcard-body { padding: 4px 16px 18px; }
}
@media (max-width: 560px) {
  .fields { grid-template-columns: 1fr; }
  .field.wide { grid-column: auto; }
  .summary { grid-template-columns: 1fr; }
  .addrow .select, .addrow input[type=date] { flex: 1 1 calc(50% - 4px); }
  .addrow .btn { flex: 1 1 100%; }
  .hint { text-align: left; }
  .section-head, .block-head { flex-direction: column; gap: 2px; }
}
@media (prefers-reduced-motion: reduce) {
  *, *::before, *::after { animation-duration: .01ms !important; transition-duration: .01ms !important; }
}

/* ---------- 任务关联多项 ---------- */
.pick-top { display: grid; grid-template-columns: 200px 1fr; gap: 10px; }
.pick-count { font-size: 14px; color: var(--slate); margin: 12px 0 8px; }
.pick-list { max-height: 52vh; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius); padding: 4px 0; }
.pick-row { display: flex; align-items: center; gap: 10px; padding: 6px 10px; cursor: pointer; font-size: 14.5px; }
.pick-row:hover { background: var(--surface-2); }
.pick-row input { width: 16px; height: 16px; accent-color: var(--navy); flex: none; }
.pick-row .alt { color: var(--muted); }
.pick-group { font-weight: 700; color: var(--navy); }
.linked-text { flex: 1; min-width: 0; align-self: center; font-size: 14.5px; color: var(--slate); }
.linked + .linked { border-top: 1px solid var(--line-soft); margin-top: 8px; padding-top: 18px; }
.linked-title { display: flex; align-items: baseline; gap: 10px; margin: 6px 0 14px; font-size: 16px; color: var(--ink); }
.linked-title span { font-size: 13px; font-weight: 400; color: var(--navy); background: var(--navy-soft); border-radius: 5px; padding: 1px 8px; }
@media (max-width: 560px) { .pick-top { grid-template-columns: 1fr; } }

/* 导图筛选 */
.tree-filter { gap: 8px !important; }
.tree-filter .select { flex: 1; min-width: 0; height: 36px; font-size: 14px; }
.tf-note { font-size: 13px; color: var(--navy); background: var(--navy-soft); border-radius: 6px; padding: 4px 10px; }
.tf-note[hidden] { display: none; }
