/* =========================================================================
 * 工作台 · M2 样式：任务 / 日程 / 多维表格 / 站内提醒
 * 依赖 style.css 的设计变量与基础组件（.btn/.input/.panel/.state 等）
 * ========================================================================= */

/* ---------- 页面头部 ---------- */
.m2-head { align-items: flex-start; }
.m2-tico {
  width: 36px; height: 36px; border-radius: 10px; flex: none;
  background: var(--brand-l); color: var(--brand-d);
  display: flex; align-items: center; justify-content: center; font-size: 18px;
}
.m2-htxt { min-width: 0; }

/* ---------- 视图页签 ---------- */
.m2-vtabs { display: flex; align-items: center; gap: 6px; margin: 2px 0 12px; flex-wrap: wrap; }
.m2-vt {
  display: inline-flex; align-items: center; gap: 6px; height: 30px; padding: 0 11px;
  border-radius: 999px; border: 1px solid var(--line); background: #fff;
  color: var(--text-2); font-size: 12.5px; cursor: pointer;
}
.m2-vt svg { width: 14px; height: 14px; color: var(--faint); flex: none; }
.m2-vt:hover { border-color: var(--brand-l2); background: var(--brand-l); }
.m2-vt.on { background: var(--brand); border-color: var(--brand); color: #fff; font-weight: 500; }
.m2-vt.on svg { color: #fff; }
.m2-vt.add { border-style: dashed; color: var(--muted); }
.m2-vtools { margin-left: auto; display: flex; gap: 4px; }
.m2-tool {
  width: 30px; height: 30px; display: inline-flex; align-items: center; justify-content: center;
  border: 1px solid transparent; background: transparent; border-radius: 8px; color: var(--muted); cursor: pointer;
}
.m2-tool:hover { background: #eef2f7; color: var(--text-2); }
.m2-tool svg { width: 16px; height: 16px; }
.m2-tool.wide { width: auto; padding: 0 10px; height: 28px; font-size: 12.5px; border-color: var(--line); background: #fff; gap: 5px; }
.btn.on-tint { background: var(--brand-l); border-color: var(--brand-l2); color: var(--brand-d); }

/* ---------- 筛选条 ---------- */
.m2-fbar { display: flex; align-items: center; gap: 7px; flex-wrap: wrap; margin: -4px 0 10px; font-size: 12.5px; color: var(--muted); }
.m2-fchip { display: inline-flex; align-items: center; gap: 6px; padding: 3px 10px; border-radius: 999px; background: #fff; border: 1px solid var(--line); color: var(--text-2); }
.m2-fchip b { font-weight: 600; color: var(--brand-d); }

/* ---------- 表格（grid） ---------- */
.m2-gridwrap { overflow: auto; max-height: calc(100vh - 300px); }
.m2-grid { width: 100%; border-collapse: separate; border-spacing: 0; font-size: 13px; table-layout: auto; }
.m2-grid th {
  position: sticky; top: 0; z-index: 2; background: #fbfcfe;
  border-bottom: 1px solid var(--line); text-align: left; padding: 8px 10px;
  font-size: 12px; color: var(--muted); font-weight: 600; white-space: nowrap;
}
.m2-grid td { border-bottom: 1px solid var(--line-2); padding: 0; vertical-align: top; }
.m2-grid tbody tr:hover { background: #fafcff; }
.m2-num { width: 42px; text-align: center; color: var(--faint); font-size: 11.5px; padding: 10px 4px !important; }
.m2-td { min-width: 108px; max-width: 380px; }
.m2-cell { min-height: 38px; padding: 9px 10px; cursor: pointer; word-break: break-word; white-space: pre-wrap; }
.m2-cell.ed:hover { background: var(--brand-l); box-shadow: inset 0 0 0 1px var(--brand-l2); }
.m2-cell.empty .m2-ph { color: #cbd5e1; }
.m2-cell.editing { padding: 5px 6px; background: #fff; box-shadow: inset 0 0 0 2px var(--brand-l2); }
.m2-in {
  width: 100%; height: 30px; padding: 0 8px; border: 1px solid var(--brand);
  border-radius: 6px; font-size: 13px; font-family: inherit; outline: 0; background: #fff; color: var(--text);
}
select.m2-in { padding: 0 4px; }
.m2-rowops { width: 40px; text-align: center; padding: 8px 4px !important; }
.m2-op {
  border: 0; background: transparent; color: var(--faint); cursor: pointer;
  width: 26px; height: 26px; border-radius: 6px; display: inline-flex; align-items: center; justify-content: center;
}
.m2-op:hover { background: #eef2f7; color: var(--text-2); }
.m2-op svg { width: 15px; height: 15px; }
.m2-cbwrap { display: inline-flex; align-items: center; justify-content: center; padding: 10px; }
.m2-cbwrap input { width: 15px; height: 15px; accent-color: var(--brand); cursor: pointer; }
.m2-emptyrow { text-align: center; color: var(--faint); padding: 26px 10px !important; font-size: 13px; }

/* ---------- 选项芯片 ---------- */
.m2-chip {
  display: inline-flex; align-items: center; gap: 4px; padding: 1px 8px; margin: 1px 0;
  border-radius: 999px; font-size: 11.5px; line-height: 1.75; border: 1px solid transparent;
  white-space: nowrap; max-width: 100%; overflow: hidden; text-overflow: ellipsis;
}
.m2-chip svg { width: 12px; height: 12px; flex: none; }
.c-gray { background: #f1f5f9; color: #475569; border-color: #e2e8f0; }
.c-blue { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.c-green { background: #ecfdf5; color: #15803d; border-color: #d1fae5; }
.c-orange { background: #fff7ed; color: #c2410c; border-color: #ffedd5; }
.c-red { background: #fef2f2; color: #b91c1c; border-color: #fee2e2; }
.c-purple { background: #f5f3ff; color: #6d28d9; border-color: #ede9fe; }
.m2-user { font-size: 12.5px; color: var(--text-2); }
.m2-link { word-break: break-all; }

/* ---------- 看板 ---------- */
.m2-kb { display: flex; gap: 12px; padding: 12px; overflow-x: auto; align-items: flex-start; }
.m2-kbcol {
  width: 232px; flex: none; background: #f8fafc; border: 1px solid var(--line);
  border-radius: var(--radius-s); padding: 8px; display: flex; flex-direction: column; gap: 8px; min-height: 120px;
}
.m2-kbcol.over { border-color: var(--brand); background: var(--brand-l); }
.m2-kbh { display: flex; align-items: center; justify-content: space-between; padding: 1px 2px 3px; }
.m2-kbn { color: var(--faint); font-size: 11.5px; }
.m2-kbbody { display: flex; flex-direction: column; gap: 7px; min-height: 8px; }
.m2-kbcard { background: #fff; border: 1px solid var(--line); border-radius: var(--radius-xs); padding: 9px 10px; cursor: pointer; box-shadow: var(--shadow-s); }
.m2-kbcard:hover { border-color: var(--brand-l2); }
.m2-kbcard.dragging { opacity: .45; }
.m2-kbt { font-size: 13px; font-weight: 600; margin-bottom: 5px; word-break: break-word; }
.m2-kbm { display: flex; align-items: center; gap: 5px; flex-wrap: wrap; }
.m2-kbadd {
  border: 1px dashed var(--line); background: transparent; border-radius: var(--radius-xs);
  color: var(--muted); font-size: 12px; padding: 5px; cursor: pointer;
  display: flex; align-items: center; justify-content: center; gap: 5px;
}
.m2-kbadd:hover { border-color: var(--brand); color: var(--brand-d); background: #fff; }
.m2-kbadd svg { width: 13px; height: 13px; }

/* ---------- 日历 ---------- */
.m2-calbar { display: flex; align-items: center; gap: 8px; padding: 10px 12px; border-bottom: 1px solid var(--line); flex-wrap: wrap; }
.m2-caltitle { font-weight: 600; font-size: 14px; min-width: 108px; text-align: center; }
.m2-calsub { font-size: 12px; color: var(--faint); }
.m2-cal { display: grid; grid-template-columns: repeat(7, 1fr); }
.m2-calw { text-align: center; font-size: 12px; color: var(--muted); padding: 7px 0; background: #fbfcfe; border-bottom: 1px solid var(--line); }
.m2-cald { min-height: 96px; border-right: 1px solid var(--line-2); border-bottom: 1px solid var(--line-2); padding: 5px 6px; cursor: pointer; }
.m2-cald:nth-child(7n) { border-right: 0; }
.m2-cald.out { background: #fafbfd; cursor: default; }
.m2-cald:not(.out):hover { background: var(--brand-l); }
.m2-cald.today { background: #f0f7ff; }
.m2-caln { font-size: 11.5px; color: var(--muted); margin-bottom: 3px; }
.m2-cald.today .m2-caln { color: var(--brand-d); font-weight: 700; }
.m2-calitems { display: flex; flex-direction: column; gap: 3px; }
.m2-cali { font-size: 11.5px; background: var(--brand-l); color: var(--brand-d); border-radius: 5px; padding: 1px 6px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m2-cali:hover { background: var(--brand-l2); }
.m2-calmore { font-size: 11px; color: var(--faint); cursor: pointer; }
.m2-calmore:hover { color: var(--brand-d); text-decoration: underline; }
.m2-caln-pt { cursor: pointer; }

/* M3x：日历「当天清单」浮层 */
.m2-calpop { min-width: 250px; max-width: 340px; max-height: 360px; padding: 4px 6px 6px; }
.m2-calpop-h { display: flex; align-items: center; gap: 8px; font-size: 12.5px; font-weight: 600; padding: 6px 6px 5px; border-bottom: 1px solid var(--line-2); }
.m2-calpop-n { margin-left: auto; font-weight: 400; color: var(--faint); font-size: 11.5px; }
.m2-calpop-sec { font-size: 11.5px; color: var(--muted); padding: 6px 6px 2px; }
.m2-calpop-i { display: flex; align-items: center; gap: 7px; padding: 5px 7px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.m2-calpop-i:hover { background: #f4f7fb; }
.m2-calpop-i.done .m2-calpop-t { text-decoration: line-through; color: var(--faint); }
.m2-calpop-i.over .m2-calpop-t { color: var(--danger); }
.m2-calpop-dot { width: 8px; height: 8px; border-radius: 3px; background: var(--brand-l2); flex: 0 0 auto; }
.m2-calpop-dot.pt { border-radius: 50%; background: transparent; border: 2px solid var(--brand-l2); }
.m2-calpop-t { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m2-calpop-who { margin-left: auto; color: var(--muted); font-size: 11.5px; flex: 0 0 auto; }
.m2-calpop-f { margin-top: 5px; padding: 6px 8px; border-top: 1px solid var(--line-2); color: var(--brand-d); font-size: 12.5px; cursor: pointer; }
.m2-calpop-f:hover { background: var(--brand-l); border-radius: 6px; }

/* ---------- 清单 ---------- */
.m2-list { display: flex; flex-direction: column; }
.m2-li { display: flex; align-items: center; gap: 10px; padding: 2px 14px 2px 4px; border-bottom: 1px solid var(--line-2); min-height: 44px; }
.m2-li:last-child { border-bottom: 0; }
.m2-li:hover { background: var(--brand-l); }
.m2-lit { flex: 1; min-width: 0; font-size: 13.5px; cursor: pointer; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; padding: 9px 0; }
.m2-li.done .m2-lit { text-decoration: line-through; color: var(--faint); }
.m2-lid { font-size: 12px; color: var(--muted); white-space: nowrap; }
.m2-lid.over { color: var(--danger); }
.m2-linone { padding: 30px; text-align: center; color: var(--faint); font-size: 13px; }

/* ---------- 悬浮多选面板 ---------- */
.m2-pop {
  position: fixed; z-index: 95; background: #fff; border: 1px solid var(--line);
  border-radius: var(--radius-s); box-shadow: var(--shadow-l); padding: 7px;
  min-width: 180px; max-height: 280px; overflow: auto; display: flex; flex-direction: column; gap: 2px;
}
.m2-popitem { display: flex; align-items: center; gap: 8px; padding: 5px 7px; border-radius: 6px; cursor: pointer; font-size: 12.5px; }
.m2-popitem:hover { background: #f4f7fb; }
.m2-popitem input { accent-color: var(--brand); }
.m2-popnone { color: var(--faint); font-size: 12.5px; padding: 6px; }

/* ---------- 表格列表页 ---------- */
.m2-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(215px, 1fr)); gap: 12px; padding: 14px; }
.m2-tcard {
  position: relative; background: #fff; border: 1px solid var(--line); border-radius: var(--radius);
  padding: 14px; box-shadow: var(--shadow-s); display: block; color: inherit; min-height: 98px;
}
.m2-tcard:hover { border-color: var(--brand-l2); box-shadow: var(--shadow); text-decoration: none; }
.m2-tcard .tico { font-size: 20px; }
.m2-tname { font-size: 14px; font-weight: 600; margin: 7px 0 2px; }
.m2-tsub { font-size: 12px; color: var(--muted); }
.m2-tdel { position: absolute; top: 9px; right: 9px; opacity: 0; }
.m2-tcard:hover .m2-tdel { opacity: 1; }
.m2-sec { padding: 12px 14px 0; font-size: 12.5px; color: var(--muted); font-weight: 600; }
.m2-newcard {
  display: flex; align-items: center; justify-content: center; gap: 8px; min-height: 98px;
  border: 1px dashed var(--line); border-radius: var(--radius); color: var(--muted);
  background: transparent; cursor: pointer; font-size: 13px;
}
.m2-newcard:hover { border-color: var(--brand); color: var(--brand-d); background: var(--brand-l); }
.m2-newcard svg { width: 16px; height: 16px; }

/* ---------- 行详情弹窗 ---------- */
.m2-rmeta { font-size: 12px; color: var(--muted); padding: 0 0 10px; border-bottom: 1px solid var(--line-2); margin-bottom: 12px; display: flex; gap: 14px; flex-wrap: wrap; }
.m2-rfield { display: grid; grid-template-columns: 98px 1fr; gap: 7px 12px; align-items: start; margin-bottom: 8px; }
.m2-rlabel { font-size: 12.5px; color: var(--muted); padding-top: 7px; }
.m2-rctl { min-width: 0; }
.m2-rctl .input { height: 33px; }
.m2-rctl textarea.input { height: auto; }
.m2-cmt { border-top: 1px solid var(--line-2); margin-top: 15px; padding-top: 12px; }
.m2-cmt-title { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 9px; }
.m2-cmt-item { display: flex; gap: 9px; margin-bottom: 10px; }
.m2-ava {
  width: 28px; height: 28px; border-radius: 50%; flex: none; background: var(--brand-l2); color: var(--brand-d);
  display: flex; align-items: center; justify-content: center; font-size: 12.5px; font-weight: 600;
}
.m2-cmt-body { flex: 1; min-width: 0; }
.m2-cmt-meta { font-size: 11.5px; color: var(--muted); margin-bottom: 2px; }
.m2-cmt-text { font-size: 13px; white-space: pre-wrap; word-break: break-word; }
.m2-cmt-none { font-size: 12.5px; color: var(--faint); padding: 4px 0 8px; }
.m2-cmt-new { display: flex; gap: 8px; align-items: flex-start; margin-top: 8px; }
.m2-cmt-new textarea { flex: 1; min-height: 54px; }
.m2-att { display: flex; flex-direction: column; gap: 5px; }
.m2-attitem { display: flex; align-items: center; gap: 8px; font-size: 12.5px; background: #f8fafc; border: 1px solid var(--line); border-radius: var(--radius-xs); padding: 5px 9px; }
.m2-attitem .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m2-attitem svg { width: 14px; height: 14px; color: var(--faint); flex: none; }
.m2-attadd { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--brand-d); cursor: pointer; }
.m2-rel { max-height: 180px; overflow: auto; border: 1px solid var(--line); border-radius: var(--radius-xs); padding: 7px; display: flex; flex-direction: column; gap: 2px; }
.m2-rel label { display: flex; align-items: center; gap: 8px; font-size: 12.5px; padding: 3px 5px; border-radius: 6px; cursor: pointer; }
.m2-rel label:hover { background: #f4f7fb; }
.m2-rel input { accent-color: var(--brand); }

/* ---------- 字段 / 视图管理 ---------- */
.m2-frow { display: flex; gap: 9px; align-items: flex-start; padding: 10px 0; border-bottom: 1px solid var(--line-2); }
.m2-frow:last-child { border-bottom: 0; }
.m2-fmain { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 7px; }
.m2-fsub { display: flex; gap: 8px; flex-wrap: wrap; align-items: center; }
.m2-fsub .input { height: 32px; }
.m2-selw { width: 108px; flex: none; }
.m2-namew { flex: 1 1 140px; }
.m2-optrow { display: flex; gap: 7px; align-items: center; margin-top: 5px; }
.m2-optrow .input { height: 30px; }
.m2-optrow .o-label { flex: 1; }
.m2-optrow .o-color { width: 84px; flex: none; }
.m2-optrow .o-done { display: flex; align-items: center; gap: 5px; font-size: 12px; color: var(--muted); white-space: nowrap; }
.m2-fops { display: flex; gap: 4px; flex: none; padding-top: 2px; }
.m2-kchip { font-size: 11px; color: var(--faint); }

/* ---------- 站内提醒 ---------- */
.bell { position: relative; }
.bell-badge {
  position: absolute; top: -3px; right: -3px; min-width: 16px; height: 16px; border-radius: 999px;
  background: var(--danger); color: #fff; font-size: 10.5px; line-height: 16px; text-align: center; padding: 0 4px; font-weight: 600;
}
.m2-notif { display: flex; flex-direction: column; }
.m2-nitem { display: flex; gap: 10px; padding: 10px 12px; border-bottom: 1px solid var(--line-2); cursor: pointer; align-items: flex-start; }
.m2-nitem:hover { background: var(--brand-l); }
.m2-nitem:last-child { border-bottom: 0; }
.m2-nitem.read { opacity: .6; }
.m2-ndot { width: 8px; height: 8px; border-radius: 50%; background: var(--brand); margin-top: 7px; flex: none; }
.m2-nitem.read .m2-ndot { background: transparent; }
.m2-nbody { flex: 1; min-width: 0; }
.m2-ntext { font-size: 13px; color: var(--text-2); word-break: break-word; }
.m2-nmeta { font-size: 11.5px; color: var(--muted); margin-top: 3px; display: flex; gap: 8px; flex-wrap: wrap; }
.m2-nnone { padding: 32px; text-align: center; color: var(--faint); font-size: 13px; }
.m2-nkind { flex: none; }

/* ---------- 筛选/排序弹窗 ---------- */
.m2-cond { display: flex; gap: 7px; align-items: center; margin-bottom: 8px; }
.m2-cond .input { height: 32px; }
.m2-cond .c-field { flex: 1.1; }
.m2-cond .c-op { width: 96px; flex: none; }
.m2-cond .c-val { flex: 1; }
.m2-cond .c-del { flex: none; }
.m2-fhead { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin: 6px 0 8px; }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .m2-gridwrap { max-height: none; }
  .m2-kb { padding: 8px; }
  .m2-kbcol { width: 205px; }
  .m2-cald { min-height: 72px; }
  .m2-rfield { grid-template-columns: 78px 1fr; }
  .m2-fsub { flex-direction: column; align-items: stretch; }
  .m2-selw { width: auto; }
}

/* ---------- 补遗 ---------- */
.m2-th { display: inline-flex; align-items: center; gap: 4px; }
.m2-rn { font-variant-numeric: tabular-nums; }
.m2-cell .m2-edsel { width: 100%; }
.m2-panel { padding: 0; overflow: hidden; }
.m2-attadd { display: inline-flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--brand-d); cursor: pointer; padding: 6px 4px; border-radius: 8px; }
.m2-attadd:hover { background: var(--brand-l); }
.m2-attadd svg { width: 14px; height: 14px; }

/* ---------- M2e-1 总览（看板首页） ---------- */
.m2h-body { display: flex; flex-direction: column; gap: 14px; }
.m2h-loading { display: flex; align-items: center; gap: 10px; color: var(--muted); padding: 34px 6px; }
.m2h-empty { color: var(--muted); font-size: 13px; line-height: 1.9; padding: 10px 2px; }
.m2h-mut { color: var(--muted); font-size: 12.5px; }
.m2h-pad { padding: 8px 2px 0; }
.m2h-sub2 { margin: 12px 2px 2px; }

.m2h-tiles { display: grid; grid-template-columns: repeat(auto-fit, minmax(168px, 1fr)); gap: 12px; }
.m2h-tile { display: flex; align-items: center; gap: 12px; padding: 14px 16px; border: 1px solid var(--line); border-radius: var(--radius); background: var(--card); cursor: pointer; text-align: left; font: inherit; color: inherit; transition: border-color .15s, box-shadow .15s; }
.m2h-tile:hover { border-color: var(--brand-l2); box-shadow: var(--shadow-s); }
.m2h-tile .ic { flex: none; width: 40px; height: 40px; border-radius: 11px; display: inline-flex; align-items: center; justify-content: center; }
.m2h-tile .ic svg { width: 20px; height: 20px; }
.m2h-tile .tx b { display: block; font-size: 22px; font-weight: 700; line-height: 1.15; }
.m2h-tile .tx i { font-style: normal; font-size: 12.5px; color: var(--muted); }
.m2h-tile.t-blue .ic { background: var(--brand-l); color: var(--brand); }
.m2h-tile.t-orange .ic { background: #fff7ed; color: #c2410c; }
.m2h-tile.t-red .ic { background: var(--danger-l); color: var(--danger); }
.m2h-tile.t-purple .ic { background: #f5f3ff; color: #6d28d9; }
.m2h-tile.t-green .ic { background: #ecfdf5; color: #047857; }

.m2h-cols { display: grid; grid-template-columns: 1fr 1fr; gap: 12px; align-items: start; }
.m2h-card { background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); overflow: hidden; }
.m2h-wide { grid-column: 1 / -1; }
.m2h-ch { display: flex; align-items: center; justify-content: space-between; gap: 8px; padding: 12px 14px; border-bottom: 1px solid var(--line-2); font-weight: 600; font-size: 13.5px; }
.m2h-more { border: 0; background: none; color: var(--brand); font: inherit; font-size: 12.5px; cursor: pointer; padding: 2px 6px; border-radius: 6px; }
.m2h-more:hover { background: var(--brand-l); }
.m2h-cb { padding: 8px 10px 12px; }

.m2h-list { display: flex; flex-direction: column; }
.m2h-row { display: flex; align-items: center; gap: 10px; padding: 9px 8px; border-radius: 9px; cursor: pointer; }
.m2h-row:hover { background: var(--bg); }
.m2h-row + .m2h-row { border-top: 1px dashed var(--line-2); }
.m2h-rt { flex: 1; min-width: 0; }
.m2h-rname { font-size: 13.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m2h-rmeta { display: flex; gap: 6px; margin-top: 3px; flex-wrap: wrap; }
.m2h-date { flex: none; width: 46px; text-align: center; font-size: 12px; font-weight: 600; color: var(--brand-d); background: var(--brand-l); border-radius: 8px; padding: 4px 0; }
.m2h-dot { flex: none; width: 7px; height: 7px; border-radius: 50%; background: var(--brand-l2); }
.m2h-fic { flex: none; width: 26px; height: 26px; border-radius: 7px; background: var(--bg); color: var(--muted); display: inline-flex; align-items: center; justify-content: center; }
.m2h-fic svg { width: 15px; height: 15px; }
.m2h-fsize { flex: none; color: var(--faint); font-size: 12px; }

.m2h-bars { display: flex; flex-direction: column; gap: 9px; padding: 4px 2px; }
.m2h-bar { display: flex; align-items: center; gap: 8px; font-size: 12.5px; }
.m2h-barl { flex: none; width: 72px; color: var(--text-2); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m2h-barw { flex: 1; height: 10px; border-radius: 6px; background: var(--bg); overflow: hidden; }
.m2h-barw i { display: block; height: 100%; border-radius: 6px; }
.m2h-barn { flex: none; width: 26px; text-align: right; color: var(--muted); font-variant-numeric: tabular-nums; }

.m2h-tips { display: grid; grid-template-columns: repeat(auto-fit, minmax(250px, 1fr)); gap: 12px; }
.m2h-tip { background: var(--card); border: 1px dashed var(--line); border-radius: var(--radius); padding: 12px 14px; font-size: 12.5px; color: var(--text-2); display: flex; flex-direction: column; gap: 8px; align-items: flex-start; line-height: 1.75; }
.m2h-tip b { color: var(--text); font-size: 13px; }
.m2h-tip code { background: var(--brand-l); color: var(--brand-d); padding: 1px 6px; border-radius: 5px; font-size: 12px; }
.m2h-tip .row { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; }

/* ---------- M2e-2 看板触屏拖拽 ---------- */
.m2-kbcard { touch-action: pan-y; }
.m2-kbghost { position: fixed; z-index: 999; pointer-events: none; opacity: .93; box-shadow: var(--shadow-l); transform: rotate(1.4deg) scale(1.02); }
.m2-kbcard.touch-src { opacity: .32; }
body.m2-dragging, body.m2-dragging * { cursor: grabbing !important; user-select: none; }

@media (max-width: 1100px) {
  .m2h-tiles { grid-template-columns: repeat(2, 1fr); }
  .m2h-cols { grid-template-columns: 1fr; }
}

/* =========================================================================
 * M2f 关联文件（reflinks）：chip / 选择器弹窗
 * ========================================================================= */
.m2-reffield { display: flex; flex-direction: column; gap: 7px; }
.m2-reflist { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; }
.m2-refchip {
  display: inline-flex; align-items: center; gap: 6px; max-width: 100%;
  padding: 4px 8px; border-radius: 999px; border: 1px solid var(--line);
  background: #fff; color: var(--text-2); font-size: 12.5px; cursor: pointer;
}
.m2-refchip:hover { border-color: var(--brand-l2); background: var(--brand-l); color: var(--brand-d); }
.m2-refchip svg { width: 13px; height: 13px; flex: none; color: var(--brand); }
.m2-refchip b { font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 240px; }
.m2-refchip.lock { cursor: not-allowed; background: #f8fafc; border-style: dashed; color: var(--muted); }
.m2-refchip.lock svg { color: var(--faint); }
.m2-refx {
  border: none; background: transparent; color: var(--faint); cursor: pointer;
  font-size: 14px; line-height: 1; padding: 0 2px; border-radius: 6px;
}
.m2-refx:hover { background: var(--danger-l); color: var(--danger); }
.m2-refadd {
  align-self: flex-start; display: inline-flex; align-items: center; gap: 6px;
  border: 1px dashed var(--line); background: transparent; border-radius: 999px;
  padding: 4px 11px; font-size: 12.5px; color: var(--brand-d); cursor: pointer;
}
.m2-refadd:hover { background: var(--brand-l); border-color: var(--brand-l2); }
.m2-refadd svg { width: 14px; height: 14px; }

/* 只读提示（任务权限收紧后，非负责人看到） */
.m2-lockhint {
  margin-bottom: 12px; padding: 9px 12px; border-radius: var(--radius-s);
  background: #fffbeb; border: 1px solid #fde68a; color: #92400e; font-size: 12.5px;
}

/* 从项目档案三级联动 */
.m2-projpick { border: 1px solid var(--line); border-radius: var(--radius-s); padding: 10px 12px; background: #fbfcfe; margin-bottom: 12px; }
.m2-projrow { display: flex; gap: 8px; align-items: center; flex-wrap: wrap; }
.m2-projrow select, .m2-projrow .input { min-width: 130px; }
.m2-projrow .btn { white-space: nowrap; }

/* 文件选择器 */
.m2-pickbar { display: flex; align-items: center; gap: 10px; margin-bottom: 8px; flex-wrap: wrap; }
.m2-pickbar .m2-pickroot { min-width: 140px; }
.m2-crumbs { display: flex; align-items: center; gap: 2px; flex-wrap: wrap; font-size: 12.5px; min-height: 24px; }
.m2-crumb { border: none; background: transparent; color: var(--brand-d); cursor: pointer; padding: 2px 5px; border-radius: 6px; font: inherit; }
.m2-crumb:hover { background: var(--brand-l); }
.m2-picklist {
  max-height: 320px; overflow: auto; border: 1px solid var(--line);
  border-radius: var(--radius-s); background: #fff;
}
.m2-pickrow {
  display: flex; align-items: center; gap: 9px; padding: 8px 11px; cursor: pointer;
  border-bottom: 1px solid var(--line-2); font-size: 13px; color: var(--text-2);
}
.m2-pickrow:last-child { border-bottom: none; }
.m2-pickrow:hover { background: #f8fafc; }
.m2-pickrow.on { background: var(--brand-l); color: var(--brand-d); }
.m2-pickrow .ck { width: 15px; flex: none; color: var(--brand); font-size: 13px; }
.m2-pickrow .ic { flex: none; display: inline-flex; }
.m2-pickrow .ic svg { width: 15px; height: 15px; color: var(--faint); }
.m2-pickrow b { flex: 1; font-weight: 500; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m2-pickrow .m2-pickgo { flex: none; }

/* =========================================================================
 * M2g 团队页
 * ========================================================================= */
.m2t-body { display: flex; flex-direction: column; gap: 14px; }
.m2t-filter { display: flex; align-items: center; gap: 9px; flex-wrap: wrap; }
.m2t-filter .m2t-sel { min-width: 126px; }
.m2t-filter .m2t-q { min-width: 210px; }
.m2t-cards { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 12px; }
.m2t-card {
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  padding: 13px 14px; display: flex; flex-direction: column; gap: 9px; cursor: pointer;
  transition: border-color .15s, box-shadow .15s;
}
.m2t-card:hover { border-color: var(--brand-l2); box-shadow: var(--shadow-s); }
.m2t-card.on { border-color: var(--brand); box-shadow: 0 0 0 3px var(--brand-l); }
.m2t-ch { display: flex; align-items: center; gap: 10px; }
.m2t-ava {
  width: 36px; height: 36px; border-radius: 11px; flex: none; background: var(--brand-l);
  color: var(--brand-d); display: inline-flex; align-items: center; justify-content: center;
  font-weight: 600; font-size: 15px;
}
.m2t-cn { min-width: 0; flex: 1; display: flex; flex-direction: column; gap: 1px; }
.m2t-cn b { font-size: 14px; }
.m2t-rate { text-align: right; flex: none; }
.m2t-rate b { display: block; font-size: 16px; color: var(--brand-d); }
.m2t-rate i { font-style: normal; font-size: 11.5px; color: var(--muted); }
.m2t-bar { height: 6px; border-radius: 999px; background: var(--line-2); overflow: hidden; }
.m2t-bar i { display: block; height: 100%; background: linear-gradient(90deg, #60a5fa, #2563eb); border-radius: 999px; }
.m2t-metas { display: flex; flex-wrap: wrap; gap: 5px; }
.m2t-recent { display: flex; flex-direction: column; gap: 4px; }
.m2t-mini {
  display: flex; align-items: center; gap: 6px; font-size: 12.5px; color: var(--text-2);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.m2t-mini:hover { color: var(--brand-d); }
.m2t-mini .dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-l2); flex: none; }
.m2t-mini .dot.red { background: var(--danger); }
.m2t-more {
  border: none; background: transparent; color: var(--brand-d); cursor: pointer;
  font: inherit; font-size: 12.5px; text-align: left; padding: 0;
}
.m2t-more:hover { text-decoration: underline; }
.m2t-wide { grid-column: 1 / -1; }
.m2t-tablewrap { overflow-x: auto; }
.m2t-table { width: 100%; border-collapse: collapse; font-size: 13px; }
.m2t-table th {
  text-align: left; font-weight: 500; color: var(--muted); font-size: 12.5px;
  padding: 9px 10px; border-bottom: 1px solid var(--line); white-space: nowrap;
}
.m2t-table td { padding: 9px 10px; border-bottom: 1px solid var(--line-2); vertical-align: top; }
.m2t-table tbody tr { cursor: pointer; }
.m2t-table tbody tr:hover { background: #f8fafc; }
.m2t-title { font-weight: 500; color: var(--text); max-width: 300px; }
.m2t-refs { max-width: 260px; }
.m2t-refs .m2-refchip { pointer-events: auto; }
.m2t-foot { font-size: 12.5px; }

@media (max-width: 1100px) {
  .m2t-cards { grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); }
  .m2t-title { max-width: 180px; }
}
.m2-picknew { display: inline-flex; align-items: center; gap: 6px; margin-left: auto; }
.m2-picknew .input { width: 210px; height: 30px; }

/* 总览「我的任务」行内的关联文件夹 chip（M2f 后续：首页也能看到并点开） */
.m2h-refs { display: inline-flex; flex-wrap: wrap; gap: 4px; align-items: center; max-width: 100%; margin-left: 2px; }
.m2h-refs .m2-refchip { height: 22px; padding: 0 8px; font-size: 12px; line-height: 22px; }
.m2h-refs .m2-refchip b { max-width: 170px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m2h-refs .m2-refchip svg { width: 13px; height: 13px; }
.m2h-rmeta { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }

/* ========== M3b：标签 chips（三态通用） + 备忘墙 ========== */
.m2-tag {
  display: inline-flex; align-items: center; padding: 1px 7px; margin: 1px 1px 1px 0;
  border-radius: 6px; font-size: 11.5px; line-height: 1.75; white-space: nowrap;
  background: #eef2ff; color: #4338ca; border: 1px solid #e0e7ff; max-width: 100%;
  overflow: hidden; text-overflow: ellipsis;
}
.m2-cell .m2-tag { pointer-events: none; }
.m3-ico { display: inline-flex; align-items: center; justify-content: center; width: 34px; height: 34px; border-radius: 10px; background: var(--brand-l); color: var(--brand); flex: none; }
.m3-ico svg { width: 18px; height: 18px; }

.m3-quick { display: flex; align-items: center; gap: 10px; flex-wrap: wrap; padding: 12px 14px; margin: 12px 0 0; background: var(--card); border: 1px solid var(--line); border-radius: var(--radius); }
.m3-quick .input { flex: 1 1 320px; min-width: 220px; }
.m3-qhint { color: var(--muted); font-size: 12.5px; }

.m3-tagbar { display: flex; flex-wrap: wrap; gap: 6px; align-items: center; margin: 12px 0 0; }
.m3-chipall, .m3-chip {
  display: inline-flex; align-items: center; gap: 5px; padding: 3px 10px; border-radius: 999px;
  border: 1px solid var(--line); background: var(--card); color: var(--text-2);
  font: inherit; font-size: 12.5px; cursor: pointer;
}
.m3-chipall:hover, .m3-chip:hover { border-color: var(--brand-l2); color: var(--brand); }
.m3-chipall.on, .m3-chip.on { background: var(--brand); border-color: var(--brand); color: #fff; }
.m3-chip i { font-style: normal; font-size: 11px; opacity: .7; }

.m3-wall { display: grid; grid-template-columns: repeat(auto-fill, minmax(268px, 1fr)); gap: 12px; margin-top: 12px; }
.m3-card {
  display: flex; flex-direction: column; gap: 8px; padding: 13px 14px;
  background: var(--card); border: 1px solid var(--line); border-radius: var(--radius);
  cursor: pointer; transition: border-color .15s, box-shadow .15s;
}
.m3-card:hover { border-color: var(--brand-l2); box-shadow: var(--shadow-s, 0 2px 10px rgba(15,23,42,.06)); }
.m3-card.arch { opacity: .72; background: #fafbfd; }
.m3-ctop { display: flex; align-items: flex-start; gap: 8px; }
.m3-ct { flex: 1; font-size: 14.5px; font-weight: 600; line-height: 1.5; word-break: break-word; }
.m3-cn { color: var(--text-2); font-size: 12.5px; line-height: 1.7; white-space: pre-wrap; word-break: break-word; max-height: 66px; overflow: hidden; }
.m3-ctags { display: flex; flex-wrap: wrap; gap: 2px; }
.m3-tag { display: inline-flex; align-items: center; padding: 1px 7px; border-radius: 6px; font-size: 11.5px; line-height: 1.7; background: #eef2ff; color: #4338ca; border: 1px solid #e0e7ff; cursor: pointer; }
.m3-tag:hover { background: #e0e7ff; }
.m3-cf { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; margin-top: auto; padding-top: 8px; border-top: 1px dashed var(--line-2); }
.m3-tk { display: inline-flex; align-items: center; gap: 3px; font-size: 11.5px; padding: 1px 7px; border-radius: 999px; background: #f1f5f9; color: #475569; }
.m3-tk svg { width: 12px; height: 12px; }
.m3-tk.red { background: var(--danger-l); color: var(--danger); }
.m3-tk.orange { background: #fff7ed; color: #c2410c; }
.m3-tk.none { background: transparent; color: var(--faint); padding-left: 0; }
.m3-none { padding: 22px 12px; text-align: center; color: var(--muted); font-size: 13px; }

/* ---------- M2j：任务 ↔ 日程 引用式关联（记录详情弹窗内） ---------- */
.m2-link-box { border-top: 1px solid var(--line-2); margin-top: 15px; padding-top: 12px; }
.m2-link-head { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 9px; }
.m2-link-err {
  font-size: 12.5px; color: #b42318; background: #fef3f2; border: 1px solid #fecdca;
  border-radius: var(--radius-xs); padding: 6px 9px; margin-bottom: 8px; word-break: break-word;
}
.m2-link-hint {
  font-size: 12.5px; color: var(--text-2); background: #f8fafc; border: 1px solid var(--line);
  border-radius: var(--radius-xs); padding: 6px 9px; margin-bottom: 8px; word-break: break-word;
}
.m2-link-err[hidden], .m2-link-hint[hidden] { display: none; }
.m2-link-none { font-size: 12.5px; color: var(--faint); padding: 4px 0 8px; }
.m2-link-row { display: flex; align-items: flex-start; gap: 9px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.m2-link-row:last-child { border-bottom: 0; }
.m2-link-ck { margin-top: 3px; flex: none; accent-color: var(--brand); cursor: pointer; }
.m2-link-main { flex: 1; min-width: 0; }
.m2-link-name { font-size: 13px; color: var(--text); word-break: break-word; }
.m2-link-row .m2-link-name { line-height: 1.6; }
/* M2n：对端标题可点（点开对面那条详情） */
button.m2-link-open {
  display: block; width: 100%; text-align: left; padding: 0; margin: 0; border: 0; background: none;
  font: inherit; font-size: 13px; color: var(--link, #1d4ed8); cursor: pointer; text-decoration: underline;
  text-decoration-color: rgba(29, 78, 216, .35); text-underline-offset: 2px;
}
button.m2-link-open:hover { text-decoration-color: currentColor; }
.m2-ownerchip {
  display: inline-flex; align-items: center; gap: 4px; padding: 0 6px; border-radius: 999px;
  background: #eff6ff; color: #1d4ed8; border: 1px solid #dbeafe;
}
.m2-ownerx {
  border: 0; background: none; cursor: pointer; color: inherit; font: inherit; line-height: 1; padding: 0 2px;
}
.m2-ownerx:hover { color: #b91c1c; }
.m2-link-meta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin-top: 3px; font-size: 11.5px; color: var(--muted); }
.m2-link-role {
  display: inline-flex; align-items: center; padding: 1px 8px; border-radius: 999px;
  font-size: 11.5px; line-height: 1.75; background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
}
.m2-link-role.r-pre { background: #eff6ff; color: #1d4ed8; border-color: #dbeafe; }
.m2-link-role.r-during { background: #ecfdf5; color: #15803d; border-color: #d1fae5; }
.m2-link-role.r-after { background: #fff7ed; color: #c2410c; border-color: #fed7aa; }
.m2-link-off { color: var(--text-2); }
.m2-link-sub { color: var(--muted); }
.m2-link-del { flex: none; }
.m2-link-add {
  display: flex; flex-wrap: wrap; align-items: center; gap: 7px;
  margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2);
}
.m2-link-add .input { height: 32px; }
.m2-link-sel { flex: 1 1 170px; min-width: 140px; }
.m2-link-role-sel { width: 92px; flex: none; }
.m2-link-off-in { width: 134px; flex: none; }
.m2-link-tip { font-size: 11.5px; color: var(--faint); margin-top: 6px; line-height: 1.7; }
@media (max-width: 720px) {
  .m2-link-sel, .m2-link-role-sel, .m2-link-off-in { flex: 1 1 100%; width: auto; }
}

/* ---------- M2k：日程模板派生待办（记录弹窗内，位于「关联任务」区块上方） ---------- */
.m2-tpl-box { border-top: 1px solid var(--line-2); margin-top: 15px; padding-top: 12px; }
.m2-tpl-head { display: flex; align-items: center; gap: 8px; margin-bottom: 9px; }
.m2-tpl-h { flex: 1; min-width: 0; font-size: 12.5px; font-weight: 600; color: var(--text-2); }
.m2-tpl-err {
  font-size: 12.5px; color: #b42318; background: #fef3f2; border: 1px solid #fecdca;
  border-radius: var(--radius-xs); padding: 6px 9px; margin-bottom: 8px; word-break: break-word;
}
.m2-tpl-hint {
  font-size: 12.5px; color: var(--text-2); background: #f8fafc; border: 1px solid var(--line);
  border-radius: var(--radius-xs); padding: 6px 9px; margin-bottom: 8px; word-break: break-word;
}
.m2-tpl-err[hidden], .m2-tpl-hint[hidden] { display: none; }
.m2-tpl-done {
  font-size: 12.5px; color: #15803d; background: #ecfdf5; border: 1px solid #d1fae5;
  border-radius: var(--radius-xs); padding: 6px 9px; margin-bottom: 8px; word-break: break-word;
}
.m2-tpl-note { font-size: 12.5px; color: var(--faint); line-height: 1.7; margin-bottom: 9px; }
.m2-tpl-none { font-size: 12.5px; color: var(--faint); padding: 4px 0 8px; }
.m2-tpl-actions { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.m2-tpl-actions + .m2-tpl-none { margin-top: 4px; }
.m2-tpl-pick { display: flex; flex-wrap: wrap; align-items: center; gap: 7px; }
.m2-tpl-pick .input { height: 32px; }
.m2-tpl-sel { flex: 1 1 170px; min-width: 140px; }
.m2-tpl-tip { font-size: 11.5px; color: var(--faint); margin-top: 6px; line-height: 1.7; }
.m2-tpl-pv { margin-top: 10px; padding-top: 10px; border-top: 1px dashed var(--line-2); }
.m2-tpl-pv-head { font-size: 12.5px; font-weight: 600; color: var(--text-2); margin-bottom: 6px; }
.m2-tpl-pv-row {
  display: flex; align-items: flex-start; justify-content: space-between; gap: 9px;
  padding: 8px 0; border-bottom: 1px solid var(--line-2);
}
.m2-tpl-pv-t { flex: 1; min-width: 0; font-size: 13px; line-height: 1.6; color: var(--text); word-break: break-word; }
.m2-tpl-pvmeta { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; flex: none; font-size: 11.5px; color: var(--muted); }
.m2-tpl-due { color: var(--text-2); }
.m2-tpl-pri { color: var(--muted); }
.m2-tpl-pv-act { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
.m2-tpl-list { margin-top: 2px; }
.m2-tpl-row { display: flex; align-items: flex-start; gap: 8px; padding: 8px 0; border-bottom: 1px solid var(--line-2); }
.m2-tpl-row .mini { flex: none; }
.m2-tpl-main { flex: 1; min-width: 0; }
.m2-tpl-name { font-size: 13px; line-height: 1.6; color: var(--text); word-break: break-word; }
.m2-tpl-seed {
  display: inline-flex; align-items: center; margin-left: 6px; padding: 0 6px; border-radius: 999px;
  font-size: 11px; line-height: 1.7; background: #f1f5f9; color: #475569; border: 1px solid #e2e8f0;
}
.m2-tpl-meta { font-size: 11.5px; color: var(--muted); margin-top: 3px; word-break: break-word; }
.m2-tpl-form { margin-top: 2px; }
.m2-tpl-f { display: block; margin-bottom: 9px; }
.m2-tpl-f > span { display: block; font-size: 12.5px; color: var(--muted); margin-bottom: 5px; }
.m2-tpl-f .input { width: 100%; }
.m2-tpl-f textarea.input {
  height: auto; min-height: 92px; line-height: 1.75;
  font-family: ui-monospace, SFMono-Regular, Menlo, Consolas, monospace;
}
.m2-tpl-fact { display: flex; flex-wrap: wrap; gap: 7px; margin-top: 10px; }
@media (max-width: 720px) {
  .m2-tpl-sel { flex: 1 1 100%; width: auto; }
  .m2-tpl-pv-row { flex-wrap: wrap; }
  .m2-tpl-pvmeta { flex: 1 1 100%; }
}

/* ---------------- M2o 收件箱（待我处理聚合） ---------------- */
.m2i-acts { display: flex; gap: 8px; align-items: center; }
.m2i-body { display: flex; flex-direction: column; gap: 14px; max-width: 900px; }
.m2i-loading { display: flex; align-items: center; gap: 8px; color: var(--muted, #64748b); padding: 18px 2px; }
.m2i-card { border: 1px solid var(--line, #e2e8f0); border-radius: 12px; background: var(--card, #fff); overflow: hidden; }
.m2i-card.m2i-l0 { border-left: 4px solid #f87171; }
.m2i-card.m2i-l1 { border-left: 4px solid #fb923c; }
.m2i-card.m2i-l2 { border-left: 4px solid #60a5fa; }
.m2i-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; border-bottom: 1px solid var(--line, #eef2f7); }
.m2i-gt { font-weight: 600; font-size: 14px; }
.m2i-badge { font-size: 12px; line-height: 18px; padding: 0 8px; border-radius: 9px; color: #fff; }
.m2i-badge.red { background: #f87171; } .m2i-badge.orange { background: #fb923c; } .m2i-badge.blue { background: #60a5fa; }
.m2i-hint { color: var(--muted, #94a3b8); font-size: 12px; }
.m2i-list { display: flex; flex-direction: column; }
.m2i-row { display: flex; align-items: center; gap: 10px; padding: 10px 14px; border-top: 1px solid var(--line, #f1f5f9); }
.m2i-row:first-child { border-top: 0; }
.m2i-row.m2i-open { cursor: pointer; }
.m2i-row.m2i-open:hover { background: var(--hover, #f8fafc); }
.m2i-dot { width: 8px; height: 8px; border-radius: 50%; flex: none; }
.m2i-dot.red { background: #f87171; } .m2i-dot.orange { background: #fb923c; } .m2i-dot.blue { background: #60a5fa; }
.m2i-body { flex: 1; min-width: 0; }
.m2i-title { font-size: 14px; color: var(--text, #0f172a); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m2i-meta { display: flex; gap: 10px; font-size: 12px; color: var(--muted, #94a3b8); margin-top: 2px; }
.m2i-why { color: #64748b; }
.m2i-date { color: #ef4444; }
.m2i-go { color: var(--muted, #cbd5e1); flex: none; }
/* ===== M2t 每日摘要条（收件箱顶部） ===== */
.m2d-strip { display: flex; align-items: center; gap: 8px; flex-wrap: wrap; border: 1px solid var(--line, #e2e8f0);
  border-radius: 12px; padding: 8px 12px; background: var(--card, #fff); }
.m2d-loading { display: flex; align-items: center; gap: 8px; color: var(--muted, #64748b); }
.m2d-date { font-size: 14px; display: flex; align-items: center; gap: 6px; }
.m2d-tag { font-size: 11px; line-height: 17px; padding: 0 7px; border-radius: 9px; background: #dcfce7; color: #166534; }
.m2d-tag.old { background: #e2e8f0; color: #475569; }
.m2d-sp { flex: 1; }
.m2d-stats { display: flex; gap: 6px; flex-wrap: wrap; }
.m2d-chip { font-size: 12px; padding: 2px 8px; border-radius: 10px; background: #f1f5f9; color: #475569; }
.m2d-chip b { font-weight: 600; }
.m2d-chip.red { background: #fee2e2; color: #b91c1c; }
.m2d-chip.orange { background: #ffedd5; color: #c2410c; }
.m2d-chip.blue { background: #e0f2fe; color: #0369a1; }
.m2d-chip.ok { background: #dcfce7; color: #166534; }
.m2d-note { font-size: 12px; color: var(--muted, #94a3b8); line-height: 1.7; }
.m2d-copybox { width: 100%; box-sizing: border-box; font-family: ui-monospace, Consolas, monospace; font-size: 13px;
  line-height: 1.7; padding: 10px 12px; border: 1px solid var(--line, #e2e8f0); border-radius: 10px; resize: vertical; }
@media (max-width: 600px) { .m2d-strip { gap: 6px; padding: 8px; } .m2d-stats { width: 100%; } .m2d-sp { display: none; } }

.m2i-empty { text-align: center; padding: 38px 16px; color: var(--muted, #94a3b8); }
.m2i-empty-t { font-size: 15px; color: var(--text, #334155); margin: 8px 0 6px; }
.m2i-empty-s { font-size: 13px; line-height: 1.8; }
.m2i-empty-a { display: flex; gap: 8px; justify-content: center; margin-top: 14px; }
@media (max-width: 600px) {
  .m2i-body { gap: 10px; }
  .m2i-title { white-space: normal; }
  .m2i-meta { flex-wrap: wrap; gap: 6px; }
}

/* ---------------- M2p 反向链接（来源与引用 / 文件被谁引用） ---------------- */
.m2-back-box:empty { display: none; }
.m2-back-box { margin-top: 12px; }
.m2-back-h { font-size: 13px; font-weight: 600; color: var(--text, #334155); margin-bottom: 6px; }
.m2-back-g { border: 1px solid var(--line, #e8eef5); border-radius: 10px; padding: 8px 10px; margin-bottom: 8px; background: var(--soft, #fbfdff); }
.m2-back-t { font-size: 12px; color: var(--muted, #7c8b9c); margin-bottom: 4px; }
.m2-back-i { display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; padding: 5px 4px; border-radius: 7px; cursor: pointer; font: inherit; }
.m2-back-i:hover { background: var(--hover, #eef4fb); }
.m2-back-i[disabled] { cursor: default; }
.m2-back-n { font-size: 13px; color: var(--text, #1f2937); flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m2-back-w { font-size: 12px; color: #8b7bd8; flex: none; }
.pv-back:empty { display: none; }
.pv-back { margin-top: 14px; padding-top: 10px; border-top: 1px solid var(--line, #eef2f7); }
.pv-back-t { font-size: 13px; font-weight: 600; color: var(--text, #334155); margin-bottom: 6px; }
.pv-back-empty { font-size: 12px; color: var(--muted, #94a3b8); line-height: 1.7; }
.pv-back-i { display: flex; flex-direction: column; gap: 2px; width: 100%; text-align: left; border: 1px solid var(--line, #e8eef5); background: var(--soft, #fbfdff); border-radius: 9px; padding: 7px 9px; margin-bottom: 6px; cursor: pointer; font: inherit; }
.pv-back-i:hover { background: var(--hover, #eef4fb); }
.pv-back-n { font-size: 13px; color: var(--text, #1f2937); }
.pv-back-w { font-size: 12px; color: var(--muted, #7c8b9c); }
/* M2p：文件夹「被谁引用」提示条（列表上方） */
.fs-back { border: 1px solid #dbe6f5; background: #f6faff; border-radius: 11px; padding: 9px 11px; margin: 0 0 10px; }
.fs-back-h { display: flex; align-items: center; gap: 6px; font-size: 13px; font-weight: 600; color: #334155; margin-bottom: 6px; }
.fs-back-h svg { width: 15px; height: 15px; }
.fs-back-i { display: flex; align-items: baseline; gap: 8px; width: 100%; text-align: left; border: 0; background: transparent; padding: 4px 3px; border-radius: 7px; cursor: pointer; font: inherit; }
.fs-back-i:hover { background: #e9f2ff; }
.fs-back-n { font-size: 13px; color: #1f2937; flex: 1; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.fs-back-w { font-size: 12px; color: #8b7bd8; flex: none; }
.fs-back-more { font-size: 12px; color: #94a3b8; padding: 3px; }
/* M2q：导出面板 + 导入向导 */
.m2-io-h { font-size: 15px; font-weight: 700; color: #1f2937; margin: 0 0 6px; display: flex; align-items: baseline; gap: 8px; }
.m2-io-sub { font-size: 12px; font-weight: 400; color: #7c8b9c; }
.m2-io-tip { font-size: 13px; color: #64748b; margin-bottom: 10px; }
.m2-io-list { display: flex; flex-direction: column; gap: 8px; }
.m2-io-i { display: flex; align-items: flex-start; gap: 9px; width: 100%; text-align: left; border: 1px solid #e2e8f0; background: #fff; border-radius: 11px; padding: 10px 12px; cursor: pointer; font: inherit; }
.m2-io-i:hover { border-color: #b9d4f7; background: #f7fbff; }
.m2-io-i svg { width: 17px; height: 17px; margin-top: 1px; color: #4b6b93; flex: none; }
.m2-io-i b { display: block; font-size: 13.5px; color: #1f2937; font-weight: 600; }
.m2-io-i i { display: block; font-size: 12px; color: #8b98a8; font-style: normal; margin-top: 2px; }
.m2-io-seg { display: flex; align-items: center; gap: 12px; flex-wrap: wrap; font-size: 13px; color: #334155; margin: 10px 0; padding: 8px 10px; background: #f6f8fb; border-radius: 9px; }
.m2-io-seg select.m2-io-mode, .m2-io-seg .m2-io-name { font-size: 13px; padding: 4px 8px; border-radius: 7px; border: 1px solid #d5dde7; background: #fff; }
.m2-io-seg .m2-io-name { width: 220px; }
.m2-io-rad { display: inline-flex; align-items: center; gap: 5px; }
.m2-io-note { font-size: 12.5px; color: #7a6335; background: #fffaf0; border: 1px solid #f2e3c0; border-radius: 9px; padding: 7px 10px; margin: 8px 0; line-height: 1.6; }
.m2-io-note.bad { color: #9b3d3d; background: #fff6f6; border-color: #f3d3d3; }
.m2-io-err { font-size: 13px; color: #b3261e; margin-top: 8px; }
.m2-io-map { width: 100%; border-collapse: collapse; font-size: 13px; margin-top: 4px; }
.m2-io-map th { text-align: left; font-weight: 600; color: #64748b; font-size: 12px; padding: 6px 8px; border-bottom: 1px solid #e8edf3; }
.m2-io-map td { padding: 5px 8px; border-bottom: 1px solid #f1f5f9; vertical-align: middle; }
.m2-io-c { font-weight: 600; color: #334155; }
.m2-io-ex { color: #94a3b8; font-size: 12px; }
.m2-io-sel { font-size: 13px; padding: 3px 6px; border-radius: 7px; border: 1px solid #d5dde7; background: #fff; max-width: 190px; }
.m2-io-mn { display: block; font-size: 11.5px; color: #8b7bd8; font-style: normal; margin-top: 2px; }
.m2-io-newcol { font-size: 12.5px; color: #7a6bb0; }
.m2-io-pv { margin-top: 10px; font-size: 13px; }
.m2-io-pv summary { cursor: pointer; color: #4b6b93; }
.m2-io-pvbox { overflow: auto; max-height: 190px; margin-top: 6px; border: 1px solid #e8edf3; border-radius: 9px; }
.m2-io-pvbox table { border-collapse: collapse; font-size: 12.5px; width: 100%; }
.m2-io-pvbox th, .m2-io-pvbox td { padding: 4px 8px; border-bottom: 1px solid #f1f5f9; text-align: left; white-space: nowrap; }
.m2-io-sum { font-size: 14px; color: #334155; margin-bottom: 8px; }
.m2-io-sum .ok { color: #15803d; }
.m2-io-sum .bad { color: #b3261e; }
/* M2r：一个日历——日历上的「点」（任务截止）。块＝日程，点＝任务，视觉上分得开 */
.m2-callegend { display: flex; align-items: center; gap: 6px; font-size: 12px; color: #7c8b9c; }
.m2-callegend-blk, .m2-callegend-pt { display: inline-block; width: 12px; height: 12px; border-radius: 4px; }
.m2-callegend-blk { background: #cfe0f7; border: 1px solid #a8c6ea; }
.m2-callegend-pt { background: transparent; border: 1px dashed #d0913a; border-radius: 50%; margin-left: 10px; }
.m2-calpt { font-size: 11.5px; line-height: 1.5; color: #9a6a1e; background: #fff8ec; border-left: 2px solid #e0a94a; border-radius: 4px; padding: 0 4px; margin-top: 2px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; cursor: pointer; }
.m2-calpt:hover { background: #fdeed3; }
.m2-calpt.done { color: #94a3b8; background: #f4f6f9; border-left-color: #cbd5e1; text-decoration: line-through; }
.m2-calpt.over { color: #b3261e; background: #fff2f1; border-left-color: #e06a63; }
.m2-caln-pt { font-size: 10px; color: #c8871f; margin-left: 4px; vertical-align: top; }
.m2-cald.haspt { background: #fffdf8; }
/* 管理视图里的「隐藏」标记与按钮 */
.m2-frow.hid .m2-namew { color: #94a3b8; }
.m2-hidchip { font-size: 11px; color: #8a6d3b; background: #fdf3e0; border: 1px solid #f0dcb8; border-radius: 10px; padding: 0 7px; white-space: nowrap; }
.m2-op.wide { width: auto; padding: 0 8px; font-size: 12px; }
/* M2s：私人备忘的可见性角标 */
.m3-vis { font-size: 11px; border-radius: 10px; padding: 1px 8px; white-space: nowrap; }
.m3-vis.priv { color: #6b7280; background: #f1f3f6; border: 1px solid #e2e6ec; }
.m3-vis.team { color: #1d4ed8; background: #eaf0fe; border: 1px solid #c7d7fb; }
.m3-vis.other { color: #8a6d3b; background: #fdf3e0; border: 1px solid #f0dcb8; }
.m3-note { margin-top: 10px; font-size: 13px; color: #94a3b8; }
.m2-io-body { max-height: 62vh; overflow: auto; }
/* M2x：关联文件「已失效」提示 + 一键修复 */
.m2-refchip.m2-refstale { border-color: #ef9a9a; background: #fdecea; color: #b3261e; }
.m2-refchip.m2-refstale b { color: #b3261e; }
.m2-reffix { margin-left: 6px; border: 1px solid #ef9a9a; background: #fff; color: #b3261e; border-radius: 9px; font-size: 11px; line-height: 18px; padding: 0 7px; cursor: pointer; }
.m2-reffix:hover { background: #fdecea; }
/* 窄屏把「导出/导入」的文字收起来只留图标，免得工具栏挤到看不见「刷新」 */
@media (max-width: 1300px) { .m2-hide-narrow { display: none; } }

/* ===================== M2z：收件箱多列 / 折叠 / 优先级（按行为学排布） =====================
   容器从「单列 flex」换成 grid：列数由工具条控制（自动=按窗口宽度 1→4 列）。
   多列时列表内部滚动，卡片行首对齐、高度可比 → 一屏能横向比较多个类别。 */
.m2i-wrap { display: grid; grid-template-columns: minmax(0, 1fr); gap: 14px; align-items: start; max-width: none; }
.m2i-wrap > .m2d-strip, .m2i-wrap > .m2i-tools, .m2i-wrap > .m2i-empty, .m2i-wrap > .m2i-note { grid-column: 1 / -1; }
.m2i-wrap.cols-2 { grid-template-columns: repeat(2, minmax(0, 1fr)); }
.m2i-wrap.cols-3 { grid-template-columns: repeat(3, minmax(0, 1fr)); }
.m2i-wrap.cols-4 { grid-template-columns: repeat(4, minmax(0, 1fr)); }
@media (min-width: 1120px) { .m2i-wrap.cols-auto { grid-template-columns: repeat(2, minmax(0, 1fr)); } }
@media (min-width: 1560px) { .m2i-wrap.cols-auto { grid-template-columns: repeat(3, minmax(0, 1fr)); } }
@media (min-width: 2000px) { .m2i-wrap.cols-auto { grid-template-columns: repeat(4, minmax(0, 1fr)); } }
.m2i-wrap.cols-2 .m2i-list, .m2i-wrap.cols-3 .m2i-list, .m2i-wrap.cols-4 .m2i-list { max-height: 46vh; overflow: auto; overscroll-behavior: contain; }

/* 折叠：卡片降级成「计数器」——没做完的事继续占着注意力，点一下才展开 */
.m2i-head { cursor: pointer; }
.m2i-head:hover { background: var(--hover, #f8fafc); }
.m2i-caret { display: inline-flex; align-items: center; color: var(--muted, #94a3b8); transition: transform .16s ease; flex: none; }
.m2i-card.folded .m2i-caret { transform: rotate(-90deg); }
.m2i-card.folded .m2i-list { display: none; }
.m2i-card.folded { background: var(--hover, #fbfcfe); }
.m2i-sp { flex: 1 1 auto; }
.m2i-more { font-size: 12px; color: var(--muted, #94a3b8); }

/* 工具条：列数 / 排序 / 全部折叠展开（即时生效、都记住） */
.m2i-tools { display: flex; align-items: center; gap: 6px; flex-wrap: wrap; font-size: 12px; color: var(--muted, #64748b); }
.m2i-tl { margin-left: 2px; }
.m2i-tl.sep { margin-left: 12px; }
.m2i-seg { border: 1px solid var(--line, #e2e8f0); background: transparent; color: inherit; border-radius: 7px; padding: 2px 9px; cursor: pointer; font-size: 12px; line-height: 18px; }
.m2i-seg:hover { background: var(--hover, #f8fafc); }
.m2i-seg.on { background: #2563eb; border-color: #2563eb; color: #fff; }
@media (max-width: 600px) { .m2i-wrap { gap: 10px; } }

/* ===================== M3b：日程参与者（谁，用颜色说话） =====================
   同一个人在任何地方都是同一个颜色（uid 稳定哈希 → 调色板）。
   颜色只用在名字标签上（10px 小圆点 + 姓名），不铺满整块，避免和「任务截止」橙、「逾期」红抢注意力。 */
.m2-cali { display: flex; flex-wrap: wrap; align-items: center; gap: 3px; }
.m2-cali-t { flex: 0 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m2-calpt { display: flex; align-items: center; gap: 4px; }
.m2-calpt-t { flex: 1 1 auto; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m2-calip { display: inline-flex; align-items: center; gap: 3px; flex: 0 0 auto; font-size: 10px; line-height: 15px; padding: 0 5px; border-radius: 6px; white-space: nowrap; font-weight: 600; }
.m2-calip-d { width: 6px; height: 6px; border-radius: 50%; flex: none; display: inline-block; }
.m2-calip.more { background: transparent; color: var(--faint, #94a3b8); font-weight: 500; }
.m2-callegend { flex-wrap: wrap; }
.m2-callegend-ppl { display: inline-flex; align-items: center; gap: 6px; margin-right: 12px; flex-wrap: wrap; }
.m2-callegend-pplt { color: #7c8b9c; }


/* ===================== M3e：右侧嵌入式详情侧栏 =====================
   详情不再居中盖住看板：贴窗口右侧、主区让出宽度，左边看板同时可见。
   默认「展示模式」（字段是纯文本），点「调整」才解锁编辑器，改完「确认调整」一次性提交。 */
.drawer-root {
  /* 贴在「顶栏以下、页面右侧」：顶栏（工作台信息/搜索/新建/账号）永远露着 */
  position: fixed; top: var(--drawer-top, 58px); right: 0; bottom: 0; width: var(--drawer-w, 560px);
  background: var(--card); border-left: 1px solid var(--line);
  box-shadow: -14px 0 34px rgba(16, 24, 40, .10); z-index: 70; display: flex;
}
.drawer-root[hidden] { display: none; }
.drawer { display: flex; flex-direction: column; width: 100%; min-width: 0; position: relative; }
/* M3f：左缘拖宽手柄 */
.drawer-grip { position: absolute; left: -4px; top: 0; bottom: 0; width: 8px; cursor: col-resize; z-index: 3; }
.drawer-grip:hover { background: linear-gradient(to right, transparent, var(--brand-l2)); }
body.drawer-resizing { cursor: col-resize; user-select: none; }
body.drawer-resizing .drawer iframe { pointer-events: none; }
.m2-link-rohint, .m2-tpl-box .m2-tpl-note + .m2-tpl-note { color: var(--faint); }
.drawer .modal-head { flex: none; }
.drawer .modal-body { flex: 1 1 auto; overflow: auto; padding: 14px 18px 20px; }
.drawer .modal-foot { flex: none; border-top: 1px solid var(--line); padding: 11px 14px; display: flex; align-items: center; gap: 8px; }
.drawer .modal-foot .grow { flex: 1; }
@media (min-width: 981px) { body.drawer-open .main { padding-right: calc(var(--drawer-w, 560px) + 22px); } }
@media (max-width: 980px) { .drawer-root { width: 100vw; } }

/* —— 展示模式（只读）：字段是文字，不是输入框 —— */
.m2-roomode {
  font-size: 12px; color: var(--muted); background: var(--brand-l);
  border: 1px solid var(--line); border-radius: var(--radius-xs);
  padding: 6px 10px; margin: 2px 0 12px;
}
.m2-rfield.m2-ro { padding: 7px 0; border-bottom: 1px dashed var(--line-2); margin-bottom: 0; }
.m2-rfield.m2-ro:last-of-type { border-bottom: 0; }
.m2-ro-val { font-size: 13.5px; color: var(--text); line-height: 1.75; word-break: break-word; }
.m2-ro-empty { color: var(--faint); }
.m2-ro-link { color: var(--brand-d); text-decoration: none; border-bottom: 1px solid var(--brand-l2); }
.m2-ro-tag { display: inline-block; font-size: 11.5px; color: var(--text-2); background: #f1f5f9; border-radius: 5px; padding: 0 6px; margin: 0 4px 2px 0; }
.m2-ro-date { font-variant-numeric: tabular-nums; }
.m2-rorol { display: flex; flex-wrap: wrap; gap: 4px; }
.m2-ro-relchip {
  font-size: 12px; color: var(--brand-d); background: var(--brand-l);
  border: 1px solid var(--brand-l2); border-radius: 6px; padding: 1px 8px;
  cursor: pointer; font-family: var(--font);
}
.m2-ro-relchip:hover { background: var(--brand-l2); }
.m2-refbox.ro { display: block; }
.m2-refchip.ro { cursor: pointer; }
.m2-attitem { display: flex; align-items: center; gap: 8px; padding: 3px 0; font-size: 13px; }
.m2-attitem .nm { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.m2-drafttag { font-size: 12px; color: var(--warn); background: #fff7ed; border: 1px solid #fed7aa; border-radius: 999px; padding: 2px 9px; }

/* =========================================================================
 * 前端打磨（2026-09-24 追加 · m2.css）— 任务/日程/团队等 m2-* 组件的深色 + 手机端
 * 同样只追加、不改动上方原有规则；浅色一行不受影响。
 * ========================================================================= */

/* ---------- 深色细节覆盖（两处同源：手动属性 / 跟随系统） ---------- */
html[data-theme="dark"] .c-gray { background: #232e3d; color: #c3cedd; border-color: #2f3b4c; }
html[data-theme="dark"] .c-blue { background: #1a2740; color: #9ec2ff; border-color: #27406b; }
html[data-theme="dark"] .c-green { background: #12301f; color: #6ee7a8; border-color: #1d4a33; }
html[data-theme="dark"] .c-orange { background: #33220f; color: #fdba74; border-color: #513418; }
html[data-theme="dark"] .c-red { background: #3a1c1e; color: #fca5a5; border-color: #55272a; }
html[data-theme="dark"] .c-purple { background: #241f3d; color: #c4b5fd; border-color: #3a3163; }
html[data-theme="dark"] .m2-tool.wide, html[data-theme="dark"] .m2-fchip, html[data-theme="dark"] .m2-vt, html[data-theme="dark"] .m2-picklist, html[data-theme="dark"] .m2-refchip, html[data-theme="dark"] .m2-kbadd:hover, html[data-theme="dark"] .m2-cell.editing, html[data-theme="dark"] .m2-in, html[data-theme="dark"] .m2-reffix { background: #1b2330; }
html[data-theme="dark"] .m2-vt.on, html[data-theme="dark"] .m3-chip.on, html[data-theme="dark"] .m3-chipall.on { background: #2563eb; border-color: #2563eb; }
html[data-theme="dark"] .m2-tool:hover, html[data-theme="dark"] .m2-op:hover, html[data-theme="dark"] .m2-popitem:hover, html[data-theme="dark"] .m2-rel label:hover, html[data-theme="dark"] .m2-io-i:hover, html[data-theme="dark"] .pv-back-i:hover, html[data-theme="dark"] .fs-back-i:hover { background: #232e3d; }
html[data-theme="dark"] .m2-grid th, html[data-theme="dark"] .m2-calw, html[data-theme="dark"] .m2-projpick { background: #1a222e; }
html[data-theme="dark"] .m2-grid tbody tr:hover { background: #19212c; }
html[data-theme="dark"] .m2-grid tbody tr:hover td:first-child { background: #19212c; }
html[data-theme="dark"] .m2-kbcol, html[data-theme="dark"] .m2-attitem, html[data-theme="dark"] .m2-refchip.lock, html[data-theme="dark"] .m2-pickrow:hover, html[data-theme="dark"] .m2t-table tbody tr:hover { background: #1e2836; }
html[data-theme="dark"] .m2-cald.out { background: #141b24; }
html[data-theme="dark"] .m2-cald.today { background: #1c2b45; }
html[data-theme="dark"] .m2-cald.haspt { background: #221f18; }
html[data-theme="dark"] .m2-ro-tag { background: #232e3d; }
html[data-theme="dark"] .m2-calpt { color: #e5c98a; background: #2b2415; border-left-color: #7a5a1e; }
html[data-theme="dark"] .m2-calpt:hover { background: #3a2f18; }
html[data-theme="dark"] .m2-calpt.done { color: #8b98ab; background: #232e3d; border-left-color: #3a4a63; }
html[data-theme="dark"] .m2-calpt.over { color: #f87171; background: #33191a; border-left-color: #7a3a37; }
html[data-theme="dark"] .m2-caln-pt { color: #e0b455; }
html[data-theme="dark"] .m2-hidchip { color: #e0c68a; background: #2b2415; border-color: #4d3f22; }
html[data-theme="dark"] .m2-lockhint { background: #2b2415; border-color: #5a4520; color: #f5c76b; }
html[data-theme="dark"] .m2-drafttag { background: #2b2415; border-color: #5a4520; }
html[data-theme="dark"] .m2-refchip.m2-refstale { border-color: #7a3a37; background: #33191a; color: #f87171; }
html[data-theme="dark"] .m2-refchip.m2-refstale b { color: #f87171; }
html[data-theme="dark"] .m2-reffix { border-color: #7a3a37; color: #f87171; }
html[data-theme="dark"] .m2h-tile.t-orange .ic { background: #33220f; color: #fdba74; }
html[data-theme="dark"] .m2h-tile.t-purple .ic { background: #241f3d; color: #c4b5fd; }
html[data-theme="dark"] .m2h-tile.t-green .ic { background: #12301f; color: #6ee7a8; }
html[data-theme="dark"] .m3-tag { background: #232a4d; color: #b6bcff; border-color: #33396b; }
html[data-theme="dark"] .m3-tag:hover { background: #33396b; }
html[data-theme="dark"] .m3-tk, html[data-theme="dark"] .m3-vis.priv { background: #232e3d; color: #c3cedd; }
html[data-theme="dark"] .m3-tk.orange, html[data-theme="dark"] .m3-vis.other { background: #2b2415; color: #e0c68a; }
html[data-theme="dark"] .m3-vis.team { background: #232a4d; color: #9ec2ff; border-color: #33396b; }
html[data-theme="dark"] .m3-card.arch { background: #141b24; }
html[data-theme="dark"] .m3-note { color: #8b98ab; }
html[data-theme="dark"] .m2d-tag, html[data-theme="dark"] .m2d-chip.ok { background: #12301f; color: #6ee7a8; }
html[data-theme="dark"] .m2d-tag.old, html[data-theme="dark"] .m2d-chip { background: #232e3d; color: #c3cedd; }
html[data-theme="dark"] .m2d-chip.red { background: #55272a; color: #fca5a5; }
html[data-theme="dark"] .m2d-chip.orange { background: #513418; color: #fdba74; }
html[data-theme="dark"] .m2d-chip.blue { background: #10293a; color: #7dd3fc; }
html[data-theme="dark"] .m2-io-i { background: var(--card); border-color: var(--line); }
html[data-theme="dark"] .m2-io-i svg, html[data-theme="dark"] .m2-io-pv summary { color: #9ec2ff; }
html[data-theme="dark"] .m2-io-seg { background: #1d2634; }
html[data-theme="dark"] .m2-io-seg select.m2-io-mode, html[data-theme="dark"] .m2-io-seg .m2-io-name, html[data-theme="dark"] .m2-io-sel { background: #1b2330; border-color: #2a3442; }
html[data-theme="dark"] .m2-io-pvbox, html[data-theme="dark"] .m2-io-map td, html[data-theme="dark"] .m2-io-pvbox th, html[data-theme="dark"] .m2-io-pvbox td { border-color: #212a36; }
html[data-theme="dark"] .fs-back { background: #161d27; border-color: #2a3442; }
html[data-theme="dark"] .fs-back-i { background: #161d27; border-color: #2a3442; }
html[data-theme="dark"] .m2-io-note { color: #e0c68a; background: #2b2415; border-color: #4a3c1d; }
html[data-theme="dark"] .m2-io-note.bad { color: #f0a9a9; background: #33191a; border-color: #5a3436; }
html[data-theme="dark"] .m2-io-sum .ok { color: #6ee7a8; }
html[data-theme="dark"] .m2-io-sum .bad { color: #f87171; }
html[data-theme="dark"] .m2-io-h, html[data-theme="dark"] .m2-io-i b, html[data-theme="dark"] .m2-io-c, html[data-theme="dark"] .m2-io-seg, html[data-theme="dark"] .m2-io-sum, html[data-theme="dark"] .m2-back-n, html[data-theme="dark"] .m2-back-h, html[data-theme="dark"] .pv-back-n, html[data-theme="dark"] .pv-back-t, html[data-theme="dark"] .fs-back-n, html[data-theme="dark"] .fs-back-h { color: var(--text); }
html[data-theme="dark"] .m2-back-w, html[data-theme="dark"] .fs-back-w { color: #b9a9ff; }
html[data-theme="dark"] .m2-io-sub, html[data-theme="dark"] .m2-io-tip, html[data-theme="dark"] .m2-io-map th, html[data-theme="dark"] .m2-io-i i, html[data-theme="dark"] .m2-io-mn, html[data-theme="dark"] .m2-io-newcol, html[data-theme="dark"] .m2-io-ex, html[data-theme="dark"] .m2-back-t, html[data-theme="dark"] .pv-back-w, html[data-theme="dark"] .fs-back-more, html[data-theme="dark"] .m2-callegend, html[data-theme="dark"] .m2-callegend-pplt, html[data-theme="dark"] .m2i-why { color: #8b98ab; }

@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .c-gray { background: #232e3d; color: #c3cedd; border-color: #2f3b4c; }
  :root:not([data-theme="light"]) .c-blue { background: #1a2740; color: #9ec2ff; border-color: #27406b; }
  :root:not([data-theme="light"]) .c-green { background: #12301f; color: #6ee7a8; border-color: #1d4a33; }
  :root:not([data-theme="light"]) .c-orange { background: #33220f; color: #fdba74; border-color: #513418; }
  :root:not([data-theme="light"]) .c-red { background: #3a1c1e; color: #fca5a5; border-color: #55272a; }
  :root:not([data-theme="light"]) .c-purple { background: #241f3d; color: #c4b5fd; border-color: #3a3163; }
  :root:not([data-theme="light"]) .m2-tool.wide,
  :root:not([data-theme="light"]) .m2-fchip,
  :root:not([data-theme="light"]) .m2-vt,
  :root:not([data-theme="light"]) .m2-picklist,
  :root:not([data-theme="light"]) .m2-refchip,
  :root:not([data-theme="light"]) .m2-kbadd:hover,
  :root:not([data-theme="light"]) .m2-cell.editing,
  :root:not([data-theme="light"]) .m2-in,
  :root:not([data-theme="light"]) .m2-reffix { background: #1b2330; }
  :root:not([data-theme="light"]) .m2-vt.on,
  :root:not([data-theme="light"]) .m3-chip.on,
  :root:not([data-theme="light"]) .m3-chipall.on { background: #2563eb; border-color: #2563eb; }
  :root:not([data-theme="light"]) .m2-tool:hover,
  :root:not([data-theme="light"]) .m2-op:hover,
  :root:not([data-theme="light"]) .m2-popitem:hover,
  :root:not([data-theme="light"]) .m2-rel label:hover,
  :root:not([data-theme="light"]) .m2-io-i:hover,
  :root:not([data-theme="light"]) .pv-back-i:hover,
  :root:not([data-theme="light"]) .fs-back-i:hover { background: #232e3d; }
  :root:not([data-theme="light"]) .m2-grid th,
  :root:not([data-theme="light"]) .m2-calw,
  :root:not([data-theme="light"]) .m2-projpick { background: #1a222e; }
  :root:not([data-theme="light"]) .m2-grid tbody tr:hover { background: #19212c; }
  :root:not([data-theme="light"]) .m2-grid tbody tr:hover td:first-child { background: #19212c; }
  :root:not([data-theme="light"]) .m2-kbcol,
  :root:not([data-theme="light"]) .m2-attitem,
  :root:not([data-theme="light"]) .m2-refchip.lock,
  :root:not([data-theme="light"]) .m2-pickrow:hover,
  :root:not([data-theme="light"]) .m2t-table tbody tr:hover { background: #1e2836; }
  :root:not([data-theme="light"]) .m2-cald.out { background: #141b24; }
  :root:not([data-theme="light"]) .m2-cald.today { background: #1c2b45; }
  :root:not([data-theme="light"]) .m2-cald.haspt { background: #221f18; }
  :root:not([data-theme="light"]) .m2-ro-tag { background: #232e3d; }
  :root:not([data-theme="light"]) .m2-calpt { color: #e5c98a; background: #2b2415; border-left-color: #7a5a1e; }
  :root:not([data-theme="light"]) .m2-calpt:hover { background: #3a2f18; }
  :root:not([data-theme="light"]) .m2-calpt.done { color: #8b98ab; background: #232e3d; border-left-color: #3a4a63; }
  :root:not([data-theme="light"]) .m2-calpt.over { color: #f87171; background: #33191a; border-left-color: #7a3a37; }
  :root:not([data-theme="light"]) .m2-caln-pt { color: #e0b455; }
  :root:not([data-theme="light"]) .m2-hidchip { color: #e0c68a; background: #2b2415; border-color: #4d3f22; }
  :root:not([data-theme="light"]) .m2-lockhint { background: #2b2415; border-color: #5a4520; color: #f5c76b; }
  :root:not([data-theme="light"]) .m2-drafttag { background: #2b2415; border-color: #5a4520; }
  :root:not([data-theme="light"]) .m2-refchip.m2-refstale { border-color: #7a3a37; background: #33191a; color: #f87171; }
  :root:not([data-theme="light"]) .m2-refchip.m2-refstale b { color: #f87171; }
  :root:not([data-theme="light"]) .m2-reffix { border-color: #7a3a37; color: #f87171; }
  :root:not([data-theme="light"]) .m2h-tile.t-orange .ic { background: #33220f; color: #fdba74; }
  :root:not([data-theme="light"]) .m2h-tile.t-purple .ic { background: #241f3d; color: #c4b5fd; }
  :root:not([data-theme="light"]) .m2h-tile.t-green .ic { background: #12301f; color: #6ee7a8; }
  :root:not([data-theme="light"]) .m3-tag { background: #232a4d; color: #b6bcff; border-color: #33396b; }
  :root:not([data-theme="light"]) .m3-tag:hover { background: #33396b; }
  :root:not([data-theme="light"]) .m3-tk,
  :root:not([data-theme="light"]) .m3-vis.priv { background: #232e3d; color: #c3cedd; }
  :root:not([data-theme="light"]) .m3-tk.orange,
  :root:not([data-theme="light"]) .m3-vis.other { background: #2b2415; color: #e0c68a; }
  :root:not([data-theme="light"]) .m3-vis.team { background: #232a4d; color: #9ec2ff; border-color: #33396b; }
  :root:not([data-theme="light"]) .m3-card.arch { background: #141b24; }
  :root:not([data-theme="light"]) .m3-note { color: #8b98ab; }
  :root:not([data-theme="light"]) .m2d-tag,
  :root:not([data-theme="light"]) .m2d-chip.ok { background: #12301f; color: #6ee7a8; }
  :root:not([data-theme="light"]) .m2d-tag.old,
  :root:not([data-theme="light"]) .m2d-chip { background: #232e3d; color: #c3cedd; }
  :root:not([data-theme="light"]) .m2d-chip.red { background: #55272a; color: #fca5a5; }
  :root:not([data-theme="light"]) .m2d-chip.orange { background: #513418; color: #fdba74; }
  :root:not([data-theme="light"]) .m2d-chip.blue { background: #10293a; color: #7dd3fc; }
  :root:not([data-theme="light"]) .m2-io-i { background: var(--card); border-color: var(--line); }
  :root:not([data-theme="light"]) .m2-io-i svg,
  :root:not([data-theme="light"]) .m2-io-pv summary { color: #9ec2ff; }
  :root:not([data-theme="light"]) .m2-io-seg { background: #1d2634; }
  :root:not([data-theme="light"]) .m2-io-seg select.m2-io-mode,
  :root:not([data-theme="light"]) .m2-io-seg .m2-io-name,
  :root:not([data-theme="light"]) .m2-io-sel { background: #1b2330; border-color: #2a3442; }
  :root:not([data-theme="light"]) .m2-io-pvbox,
  :root:not([data-theme="light"]) .m2-io-map td,
  :root:not([data-theme="light"]) .m2-io-pvbox th,
  :root:not([data-theme="light"]) .m2-io-pvbox td { border-color: #212a36; }
  :root:not([data-theme="light"]) .fs-back { background: #161d27; border-color: #2a3442; }
  :root:not([data-theme="light"]) .fs-back-i { background: #161d27; border-color: #2a3442; }
  :root:not([data-theme="light"]) .m2-io-note { color: #e0c68a; background: #2b2415; border-color: #4a3c1d; }
  :root:not([data-theme="light"]) .m2-io-note.bad { color: #f0a9a9; background: #33191a; border-color: #5a3436; }
  :root:not([data-theme="light"]) .m2-io-sum .ok { color: #6ee7a8; }
  :root:not([data-theme="light"]) .m2-io-sum .bad { color: #f87171; }
  :root:not([data-theme="light"]) .m2-io-h,
  :root:not([data-theme="light"]) .m2-io-i b,
  :root:not([data-theme="light"]) .m2-io-c,
  :root:not([data-theme="light"]) .m2-io-seg,
  :root:not([data-theme="light"]) .m2-io-sum,
  :root:not([data-theme="light"]) .m2-back-n,
  :root:not([data-theme="light"]) .m2-back-h,
  :root:not([data-theme="light"]) .pv-back-n,
  :root:not([data-theme="light"]) .pv-back-t,
  :root:not([data-theme="light"]) .fs-back-n,
  :root:not([data-theme="light"]) .fs-back-h { color: var(--text); }
  :root:not([data-theme="light"]) .m2-back-w,
  :root:not([data-theme="light"]) .fs-back-w { color: #b9a9ff; }
  :root:not([data-theme="light"]) .m2-io-sub,
  :root:not([data-theme="light"]) .m2-io-tip,
  :root:not([data-theme="light"]) .m2-io-map th,
  :root:not([data-theme="light"]) .m2-io-i i,
  :root:not([data-theme="light"]) .m2-io-mn,
  :root:not([data-theme="light"]) .m2-io-newcol,
  :root:not([data-theme="light"]) .m2-io-ex,
  :root:not([data-theme="light"]) .m2-back-t,
  :root:not([data-theme="light"]) .pv-back-w,
  :root:not([data-theme="light"]) .fs-back-more,
  :root:not([data-theme="light"]) .m2-callegend,
  :root:not([data-theme="light"]) .m2-callegend-pplt,
  :root:not([data-theme="light"]) .m2i-why { color: #8b98ab; }
}

/* ---------- 手机端手感（<700px）：表格横滚 + 首列冻结 / 点按 ≥44px / 字号 ≥16px ---------- */
@media (max-width: 700px) {
  /* 字号 ≥16px：避免 iPhone 聚焦放大 */
  .m2-in, .m2-op, .m2-tool.wide, select.m2-in, .m2-fchip, .m2-cell .m2-edsel { font-size: 16px; }
  /* 表单里的小输入框（记录详情/筛选/导入）也放大到好点的高度 */
  .m2-rctl .input, .m2-fsub .input, .m2-cond .input, .m2-optrow .input, .m2-io-seg select, .m2-io-sel { height: 40px; font-size: 16px; }
  /* 点按区域 ≥44px */
  .m2-in { height: 44px; }
  .m2-tool { width: 44px; height: 44px; }
  .m2-op { width: 40px; height: 40px; }
  .m2-cbwrap input { width: 20px; height: 20px; }
  .m2-cell { min-height: 44px; padding: 11px 10px; }
  .m2-li { min-height: 48px; }
  .m2i-row, .m2h-row, .m2-pickrow, .m2-nitem, .m2-cmt-item { min-height: 44px; }
  .m2-kbcard { padding: 11px 12px; }
  /* 表格：容器横滚 + 首列（行号/勾选列）冻结 */
  .m2-gridwrap, .m2t-tablewrap, .m2-picklist, .m2-io-pvbox, .m2-io-map { overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .m2-grid, .m2t-table { min-width: 560px; }
  .m2-grid th:first-child, .m2-grid td:first-child,
  .m2t-table th:first-child, .m2t-table td:first-child {
    position: sticky; left: 0; z-index: 3; background: var(--card);
    box-shadow: 1px 0 0 var(--line-2);
  }
  .m2-grid thead th:first-child, .m2t-table thead th:first-child { background: #fbfcfe; z-index: 4; }
  .m2-grid tbody tr:hover td:first-child { background: #fafcff; }
  /* 页内工具条：横向滚动不换行 */
  .m2-vtabs, .m2-fbar, .m2-calbar, .m2t-filter, .m2-pickbar, .m2-io-seg, .m2-fsub { flex-wrap: nowrap; overflow-x: auto; -webkit-overflow-scrolling: touch; }
  .m2-vt, .m2-fchip, .m2-vtabs > *, .m2-calbar > * { flex: 0 0 auto; }
  .m2-io-seg { flex-wrap: wrap; overflow-x: visible; }   /* 导入面板是表单，别横滚 */
  /* 抽屉：窄屏全屏铺满（m2.css 原来已有 ≤980 的 100vw） */
  .drawer-root { width: 100vw; }
}
html[data-theme="dark"] .m2-grid thead th:first-child,
html[data-theme="dark"] .m2t-table thead th:first-child { background: #1a222e; }
html[data-theme="dark"] .m2-grid tbody tr:hover td:first-child { background: #19212c; }
@media (prefers-color-scheme: dark) {
  :root:not([data-theme="light"]) .m2-grid thead th:first-child,
  :root:not([data-theme="light"]) .m2t-table thead th:first-child { background: #1a222e; }
  :root:not([data-theme="light"]) .m2-grid tbody tr:hover td:first-child { background: #19212c; }
}

/* ---------- 跨模块衔接：m2myweek.css（「本周聚焦」卡片） ----------
   m2myweek.css 自带一套深色，但只认「系统偏好」，用户手动切换切不动它。
   这里补上「手动选择优先」，让整站深色/浅色保持一致（选择器带 html[data-theme]，
   优先级高于 m2myweek.css 里那条 @media，故不受文件加载顺序影响）。 */
/* 手动选深色（系统可能是浅色） */
html[data-theme="dark"] .m2w { background: var(--card); border-color: var(--line); border-left-color: #60a5fa; box-shadow: none; }
html[data-theme="dark"] .m2w-t { color: var(--text); }
html[data-theme="dark"] .m2w-empty, html[data-theme="dark"] .m2w-sec, html[data-theme="dark"] .m2w-when { color: var(--muted); }
html[data-theme="dark"] .m2w-row:hover { background: var(--soft); }
html[data-theme="dark"] .m2w-lnk { color: #9ec2ff; }
html[data-theme="dark"] .m2w-badge { color: #9ec2ff; background: #1a2740; }
html[data-theme="dark"] .m2w-badge.inbox { color: #fbbf24; background: #2a2418; }
html[data-theme="dark"] .m2w-ft { border-top-color: var(--line); }
/* 手动选浅色（系统可能是深色）→ 把它的系统深色规则压回去 */
html[data-theme="light"] .m2w { background: #fff; border-color: #e5e7eb; border-left-color: var(--brand); box-shadow: 0 1px 2px rgba(16, 24, 40, .04); }
html[data-theme="light"] .m2w-t { color: var(--text); }
html[data-theme="light"] .m2w-empty, html[data-theme="light"] .m2w-sec, html[data-theme="light"] .m2w-when { color: var(--muted); }
html[data-theme="light"] .m2w-row:hover { background: #f8fafc; }
html[data-theme="light"] .m2w-lnk { color: var(--brand); }
html[data-theme="light"] .m2w-badge { color: #1d4ed8; background: #eff6ff; }
html[data-theme="light"] .m2w-badge.inbox { color: #b45309; background: #fffbeb; }
html[data-theme="light"] .m2w-ft { border-top-color: #eef2f7; }
.acts-more[hidden] { display: none; }
/* M6a：快捷筛选条 + 值面板（只用主题变量，浅色下浅色） */
.m2-qkbar { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; margin: 0 0 8px; }
.m2-qkb-t { font-size: 12px; color: var(--muted); margin-right: 2px; }
.m2-qkb { height: 27px; padding: 0 9px; border: 1px solid var(--line); border-radius: 6px; background: #fff; color: var(--text-2); font-size: 12.5px; cursor: pointer; transition: background .13s, border-color .13s, color .13s; }
.m2-qkb i { font-style: normal; opacity: .5; margin-left: 4px; font-size: 11px; }
.m2-qkb:hover { background: var(--brand-l); border-color: var(--brand-l2); color: var(--brand-d); }
.m2-qkb.on { background: var(--brand-l); border-color: var(--brand-l2); color: var(--brand-d); font-weight: 600; }
.m2-qkb.clear { color: var(--danger); }
.m2-qkb.clear:hover { background: var(--danger-l); border-color: #f0cdcd; }
.m2-qkhint { font-size: 11.5px; color: var(--muted); margin-left: 4px; }
.m2-qkpop { position: fixed; z-index: 90; min-width: 200px; max-width: 330px; background: var(--card); border: 1px solid var(--line); border-radius: 10px; box-shadow: 0 10px 28px rgba(15, 23, 42, .16); padding: 8px; }
.m2-qkp-h { display: flex; justify-content: space-between; align-items: baseline; gap: 10px; padding: 2px 4px 7px; border-bottom: 1px solid var(--line); margin-bottom: 6px; }
.m2-qkp-h b { font-size: 13px; }
.m2-qkp-h span { font-size: 11.5px; color: var(--muted); }
.m2-qkp-list { max-height: 264px; overflow: auto; display: flex; flex-direction: column; gap: 2px; }
.m2-qkp-i { display: flex; justify-content: space-between; gap: 10px; align-items: center; height: 29px; padding: 0 8px; border: 0; background: transparent; border-radius: 6px; cursor: pointer; font-size: 12.5px; color: var(--text-2); text-align: left; width: 100%; }
.m2-qkp-i:hover { background: var(--brand-l); color: var(--brand-d); }
.m2-qkp-i.on { background: var(--brand-l); color: var(--brand-d); font-weight: 600; }
.m2-qkp-i i { font-style: normal; color: var(--muted); font-size: 11.5px; }
.m2-qkp-none { font-size: 12px; color: var(--muted); padding: 6px 4px; }
.m2-qkp-f { display: flex; justify-content: space-between; gap: 8px; margin-top: 7px; padding-top: 7px; border-top: 1px solid var(--line); }
.m2-qkp-clr, .m2-qkp-done { height: 27px; padding: 0 10px; border-radius: 6px; border: 1px solid var(--line); background: #fff; cursor: pointer; font-size: 12.5px; color: var(--text-2); }
.m2-qkp-clr { color: var(--danger); }
.m2-qkp-done { background: var(--brand); border-color: var(--brand); color: #fff; }

.m2-qknote { margin: 0 0 10px; padding: 7px 10px; background: var(--brand-l); border: 1px solid var(--brand-l2); border-radius: 8px; font-size: 12px; color: var(--brand-d); line-height: 1.6; }
/* M7a：列宽拖拽（表格列 / 看板列）——宽度存本机，同事不受影响 */
.m2-grid.m2-fixed { table-layout: fixed; }
.m2-grid.m2-fixed th { overflow: hidden; text-overflow: ellipsis; }
.m2-colgrip { position: absolute; top: 0; right: 0; width: 8px; height: 100%; cursor: col-resize; touch-action: none; }
.m2-colgrip:hover, .m2-colgrip.on { background: var(--brand-l2); }
.m2-kbcol { position: relative; }
.m2-kbgrip { position: absolute; top: 2px; right: -5px; width: 9px; height: calc(100% - 4px); cursor: col-resize; touch-action: none; z-index: 3; border-radius: 4px; }
.m2-kbgrip:hover, .m2-kbgrip.on { background: var(--brand-l2); }
body.m2-dragging, body.m2-dragging * { user-select: none !important; -webkit-user-select: none !important; cursor: col-resize !important; }
/* M7b：拖列换位置（表头） */
.m2-grid thead th[data-f] { cursor: grab; user-select: none; -webkit-user-select: none; }
.m2-cogh { position: fixed; z-index: 99; padding: 5px 10px; background: var(--brand); color: #fff; border-radius: 6px; font-size: 12px; box-shadow: 0 6px 18px rgba(15, 23, 42, .2); pointer-events: none; }
.m2-grid thead th.drop-l { box-shadow: inset 3px 0 0 0 var(--brand); }
.m2-grid thead th.drop-r { box-shadow: inset -3px 0 0 0 var(--brand); }
body.m2-coldrag, body.m2-coldrag * { user-select: none !important; -webkit-user-select: none !important; cursor: grabbing !important; }
/* 行高自适应兜底：单元格允许随内容长高（列窄了文字换行、行跟着变高），不吃固定高 */
.m2-grid.m2-fixed td.m2-td { height: auto; }
.m2-grid.m2-fixed .m2-cell { min-height: 38px; height: auto; }
