:root {
  --bg: #f6f7f9;
  --card: #ffffff;
  --border: #e5e7eb;
  --border-strong: #d1d5db;
  --text: #111827;
  --muted: #6b7280;
  --primary: #2563eb;
  --primary-dark: #1d4ed8;
  --primary-weak: #eff6ff;
  --ok: #16a34a;
  --warn: #d97706;
  --danger: #dc2626;
  --radius: 8px;
  --radius-sm: 6px;
}

* { box-sizing: border-box; margin: 0; padding: 0; }

/* 关闭触控板横向滑动触发浏览器「前进/后退」手势，避免误触切页 */
html, body { overscroll-behavior-x: none; }

body {
  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC",
    "Microsoft YaHei", "Hiragino Sans GB", sans-serif;
  background: var(--bg);
  color: var(--text);
  font-size: 13px;
  line-height: 1.6;
  -webkit-font-smoothing: antialiased;
}

a { color: var(--primary); text-decoration: none; }
a:hover { color: var(--primary-dark); }

/* ---------- 左右布局：左菜单 + 右内容 ---------- */
.app { display: flex; align-items: stretch; min-height: 100vh; }

.sidebar {
  width: 208px; flex: none;
  position: sticky; top: 0; height: 100vh;
  display: flex; flex-direction: column;
  background: var(--card); border-right: 1px solid var(--border);
  overflow: hidden;
  transition: width .16s ease;
}
.sb-head {
  height: 54px; flex: none;
  display: flex; align-items: center; padding: 0 16px;
  border-bottom: 1px solid var(--border); background: #fff;
}
.sb-brand {
  font-size: 14px; font-weight: 600; letter-spacing: .2px; color: var(--text);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis;
}
.sb-brand-short { display: none; }
.sb-nav { flex: 1; padding: 10px 8px; overflow-y: auto; }

.sb-item, .sb-parent {
  display: flex; align-items: center; gap: 8px;
  width: 100%; height: 34px; padding: 0 10px; margin-bottom: 2px;
  border: none; border-radius: 6px; background: none;
  color: #374151; font: inherit; font-size: 13px; text-align: left;
  cursor: pointer; white-space: nowrap;
}
.sb-item:hover, .sb-parent:hover { background: #f3f4f6; color: var(--text); }
.sb-item.active { background: var(--primary-weak); color: var(--primary); font-weight: 500; }
.sb-parent { color: #6b7280; }
.sb-children { padding-left: 10px; }
.sb-children .sb-item { padding-left: 18px; }
.sb-char { display: none; }
.sb-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; }
.sb-parent .sb-caret { flex: none; color: #b9c0c9; transition: transform .15s ease; }
.sb-group.collapsed .sb-children { display: none; }
.sb-group.collapsed .sb-caret { transform: rotate(-90deg); }

.sb-toggle {
  display: inline-flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; flex: none;
  border: none; border-radius: 6px; background: none;
  color: var(--muted); cursor: pointer;
}
.sb-toggle:hover { background: #f3f4f6; color: var(--text); }

/* 折叠成 56px 图标轨：只显示首字 */
.sb-collapsed .sidebar { width: 56px; }
.sb-collapsed .sb-head { padding: 0; justify-content: center; }
.sb-collapsed .sb-brand-full { display: none; }
.sb-collapsed .sb-brand-short { display: inline; font-size: 15px; }
.sb-collapsed .sb-nav { padding: 10px 6px; }
.sb-collapsed .sb-item,
.sb-collapsed .sb-parent { justify-content: center; gap: 0; padding: 0; }
.sb-collapsed .sb-txt,
.sb-collapsed .sb-caret { display: none; }
.sb-collapsed .sb-char { display: inline; }
.sb-collapsed .sb-children { padding-left: 0; }
.sb-collapsed .sb-children .sb-item { padding-left: 0; }
.sb-collapsed .sb-children .sb-char { color: #9ca3af; font-size: 12px; }
.sb-collapsed .sb-group { padding-bottom: 6px; margin-bottom: 6px; border-bottom: 1px solid #f0f2f5; }
.sb-collapsed .sb-item.active .sb-char { color: var(--primary); }

.main { flex: 1; min-width: 0; display: flex; flex-direction: column; }

/* ---------- 顶栏 ---------- */
.topbar {
  background: var(--card);
  border-bottom: 1px solid var(--border);
  padding: 0 24px;
  display: flex;
  align-items: center;
  gap: 32px;
  height: 54px;
  position: sticky;
  top: 0;
  z-index: 20;
}
.brand {
  font-weight: 600;
  font-size: 15px;
  color: var(--text);
  letter-spacing: .2px;
  white-space: nowrap;
}
.topbar nav { display: flex; gap: 2px; }
.topbar nav a {
  padding: 6px 12px;
  border-radius: var(--radius-sm);
  color: var(--muted);
  font-weight: 500;
  font-size: 13px;
  white-space: nowrap;
}
.topbar nav a:hover { background: #f3f4f6; color: var(--text); }
.topbar nav a.active { background: var(--primary-weak); color: var(--primary); }

.container { width: 100%; max-width: 100%; margin: 0; padding: 22px 24px 40px; }

h1 { font-size: 18px; font-weight: 600; letter-spacing: .2px; }
h2 { font-size: 14px; font-weight: 600; }

/* ---------- 页头 / 分节 ---------- */
.page-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
  flex-wrap: wrap;
}
.page-head h1 { margin: 0; display: flex; align-items: center; gap: 10px; }

.section-head {
  display: flex;
  justify-content: space-between;
  align-items: center;
  gap: 16px;
  margin: 26px 0 10px;
  flex-wrap: wrap;
}
.section-head h2 { display: flex; align-items: center; gap: 8px; }
.section-head .count, .page-head .count { color: var(--muted); font-weight: 400; font-size: 12px; }

/* ---------- 卡片 ---------- */
.card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 18px 20px;
  margin-bottom: 18px;
}
.card-title {
  display: flex;
  justify-content: space-between;
  align-items: center;
  margin-bottom: 12px;
}
.card-title h2 { margin: 0; }

.grid-2 { display: grid; grid-template-columns: 1fr 1fr; gap: 18px; }
@media (max-width: 860px) { .grid-2 { grid-template-columns: 1fr; } }

/* ---------- 徽章 ---------- */
.badge {
  display: inline-block;
  padding: 1px 8px;
  border-radius: 4px;
  font-size: 12px;
  font-weight: 500;
  line-height: 18px;
  white-space: nowrap;
}
.b-gray  { background: #f3f4f6; color: #4b5563; }
.b-blue  { background: #dbeafe; color: #1d4ed8; }
.b-orange{ background: #fef3c7; color: #b45309; }
.b-green { background: #dcfce7; color: #15803d; }
.b-red   { background: #fee2e2; color: #b91c1c; }
.b-purple{ background: #ede9fe; color: #6d28d9; }
.b-indigo{ background: #e0e7ff; color: #4338ca; }
.b-teal  { background: #ccfbf1; color: #0f766e; }

/* ---------- 表格 ---------- */
.table-wrap {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: auto;
}
table { width: 100%; border-collapse: collapse; }
th, td {
  padding: 9px 12px;
  border-bottom: 1px solid #f0f2f5;
  text-align: left;
  vertical-align: middle;
  font-size: 13px;
}
th {
  color: var(--muted);
  font-weight: 500;
  font-size: 12px;
  background: #fafbfc;
  border-bottom: 1px solid var(--border);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 1;
}
tbody tr:hover { background: #fafbfd; }
tbody tr:last-child td { border-bottom: none; }

/* ---------- 表单 ---------- */
.form-card { max-width: 620px; }

input[type=text], input[type=password], input[type=date], textarea, select {
  padding: 6px 10px;
  border: 1px solid var(--border-strong);
  border-radius: var(--radius-sm);
  font-size: 13px;
  font-family: inherit;
  background: #fff;
  color: var(--text);
  width: 100%;
  height: 32px;
  transition: border-color .15s, box-shadow .15s;
}
textarea { height: auto; min-height: 76px; resize: vertical; line-height: 1.6; }
input:focus, textarea:focus, select:focus {
  outline: none;
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37, 99, 235, .12);
}

.form-row { margin-bottom: 14px; }
.form-row label {
  display: block;
  font-weight: 500;
  margin-bottom: 5px;
  font-size: 12px;
  color: #374151;
}
.form-row .hint { font-size: 12px; color: var(--muted); margin-top: 4px; }
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: 0 14px; }
.form-inline {
  display: flex;
  gap: 8px;
  align-items: center;
  flex-wrap: wrap;
}
.form-inline input, .form-inline select { width: auto; flex: 0 1 auto; }
.form-inline input[type=text].grow, .form-inline textarea.grow { flex: 1 1 200px; }
.form-actions { display: flex; gap: 10px; margin-top: 18px; }

/* ---------- 按钮 ---------- */
.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 4px;
  padding: 0 14px;
  height: 32px;
  border: 1px solid transparent;
  border-radius: var(--radius-sm);
  background: var(--primary);
  color: #fff;
  font-size: 13px;
  font-family: inherit;
  line-height: 1;
  cursor: pointer;
  white-space: nowrap;
  transition: background .15s;
}
.btn:hover { background: var(--primary-dark); color: #fff; }
.btn-sm { height: 28px; padding: 0 10px; font-size: 12px; }
.btn-outline {
  background: #fff;
  color: var(--text);
  border-color: var(--border-strong);
}
.btn-outline:hover { background: #f9fafb; color: var(--text); border-color: var(--muted); }
.btn-link {
  background: none;
  border: none;
  color: var(--primary);
  cursor: pointer;
  font-size: 13px;
  font-family: inherit;
  padding: 2px 4px;
}
.btn-link:hover { text-decoration: underline; }
.btn-link.btn-sm { font-size: 12px; }

.inline-form { display: inline; }

/* ---------- 提示 ---------- */
.flash {
  padding: 10px 14px;
  border-radius: var(--radius-sm);
  margin-bottom: 16px;
  font-size: 13px;
  border: 1px solid transparent;
}
.flash.ok  { background: #f0fdf4; color: #166534; border-color: #bbf7d0; }
.flash.err { background: #fef2f2; color: #991b1b; border-color: #fecaca; }

.muted { color: var(--muted); font-size: 12px; }
.mt8 { margin-top: 8px; }
.mb0 { margin-bottom: 0; }

/* ---------- 列表行 ---------- */
.goal-item {
  display: flex;
  align-items: center;
  gap: 10px;
  padding: 7px 0;
  border-bottom: 1px solid #f0f2f5;
}
.goal-item:last-child { border-bottom: none; }
.goal-item .txt { flex: 1; min-width: 0; }
.goal-item.done .txt { text-decoration: line-through; color: var(--muted); }

.empty { text-align: center; color: var(--muted); padding: 28px 0; font-size: 13px; }

.checkbox { width: 16px; height: 16px; accent-color: var(--ok); cursor: pointer; }

/* ---------- 每日站会：顶部板块 tab + 单表（5 天轴，一次显示 3 天） ---------- */
.sec-tabs {
  display: flex; align-items: center; gap: 6px;
  flex-wrap: wrap; margin-bottom: 12px;
}
.sec-tab {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 14px; font-size: 13px; color: var(--muted);
  background: #fff; border: 1px solid var(--border); border-radius: 7px;
  text-decoration: none; transition: all .12s;
}
.sec-tab:hover { border-color: var(--border-strong); color: var(--text); }
.sec-tab .n {
  font-size: 11px; line-height: 16px; min-width: 18px; padding: 0 5px;
  border-radius: 9px; background: #f1f3f6; color: #6b7280; text-align: center;
}
.sec-tab.active {
  background: var(--primary); border-color: var(--primary);
  color: #fff; font-weight: 500;
}
.sec-tab.active .n { background: rgba(255,255,255,.22); color: #fff; }


.board-card {
  background: var(--card);
  border: 1px solid var(--border);
  border-radius: var(--radius);
}
.board-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 16px; background: #fafbfc;
  border-bottom: 1px solid var(--border);
  border-radius: var(--radius) var(--radius) 0 0;
}
.board-head h2 { display: flex; align-items: center; gap: 8px; font-size: 14px; color: var(--text); }

.day-nav { display: flex; align-items: center; gap: 8px; }
.day-nav-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; color: var(--text); font-size: 15px; line-height: 1;
  text-decoration: none; user-select: none;
}
.day-nav-btn:hover { border-color: var(--primary); color: var(--primary); }
.day-nav-btn.disabled { color: #d6dae0; background: #fafbfc; border-color: #eef0f3; }
.day-range {
  font-size: 12px; color: var(--muted); min-width: 92px; text-align: center;
  font-variant-numeric: tabular-nums;
}

.sheet-scroll { overflow-x: auto; overscroll-behavior-x: contain; scrollbar-width: thin; border-radius: var(--radius); }
.sheet-scroll::-webkit-scrollbar { height: 10px; }
.sheet-scroll::-webkit-scrollbar-thumb { background: #c9cfd8; border-radius: 5px; }
.sheet-scroll::-webkit-scrollbar-track { background: #f3f4f6; }

/* 表格铺满：左侧固定列 + 右侧日列自动均分剩余宽度，不留空白 */
.sheet-table {
  border-collapse: separate; border-spacing: 0;
  table-layout: fixed; width: 100%; min-width: 940px;
  font-size: 13px;
}
.sheet-table th, .sheet-table td {
  border-right: 1px solid #eceef2;
  border-bottom: 1px solid #eceef2;
  padding: 0 8px;
  height: 52px;
  white-space: nowrap;
  vertical-align: middle;
  font-size: 13px;
  text-align: center;
  overflow: hidden;
}
.sheet-table thead th {
  background: #fafbfc;
  color: var(--muted);
  font-weight: 500;
  line-height: 1.35;
  height: 46px;
  padding: 4px 8px;
}
.sheet-table tbody td { text-align: left; }
.sheet-table .day-date { font-size: 11px; color: #9ca3af; margin-top: 1px; }
.sheet-table thead th.is-today { background: #eff6ff; color: var(--primary); }
.sheet-table thead th.is-yesterday { color: #a0a7b2; background: #fbfbfc; }
.sheet-table thead th.is-today .day-date { color: var(--primary); }
.sheet-table td.col-proj { text-align: left; }
.sheet-table .col-proj .sub { color: var(--muted); font-size: 11px; line-height: 1.2; white-space: normal; }

/* 项目行下面的子任务：折叠箭头 + 方形勾选框 + 悬停出现「新建」 */
.sheet-table .pt-head { position: relative; display: flex; align-items: center; gap: 3px; width: 100%; }
.sheet-table .pt-name { flex: 1; min-width: 0; padding-right: 38px; overflow: hidden; text-overflow: ellipsis; }
.sheet-table .pt-fold,
.sheet-table .pt-plus {
  width: 15px; height: 15px; flex: none; padding: 0; border: none; background: none;
  color: #9ca3af; cursor: pointer; display: inline-flex; align-items: center; justify-content: center;
  border-radius: 3px;
}
.sheet-table .pt-fold svg { transition: transform .15s ease; }
.sheet-table .pt-fold:not(.is-open) svg { transform: rotate(-90deg); }
.sheet-table .pt-fold:hover { color: #4b5563; background: #f1f3f6; }
.sheet-table .pt-fold-ph { width: 15px; flex: none; }
/* 新建 / 删除：固定在项目格右侧，不挤占名称宽度 */
.sheet-table .pt-plus,
.sheet-table .pt-del-form { position: absolute; top: 50%; transform: translateY(-50%); }
.sheet-table .pt-plus { right: 18px; opacity: 0; transition: opacity .12s; }
.sheet-table tr:hover .pt-plus { opacity: 1; }
/* 还没有子任务的项目，加号常显一半透明度，否则看不到入口 */
.sheet-table tr:not(.has-tasks) .pt-plus { opacity: .45; }
.sheet-table .pt-plus:hover { color: var(--primary); background: #eef4ff; }
.sheet-table .pt-del-form { right: 0; margin: 0; }
.sheet-table .pt-del {
  width: 15px; height: 15px; padding: 0; border: none; background: none; border-radius: 3px;
  color: #c3c9d2; font-size: 13px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  opacity: 0; transition: opacity .12s, color .12s;
}
.sheet-table tr:hover .pt-del { opacity: 1; }
.sheet-table .pt-del:hover { color: var(--danger); background: #fef2f2; }

.sheet-table .pt-list { margin-top: 3px; }
.sheet-table .pt-list.is-folded { display: none; }
.sheet-table .pt-item { display: flex; align-items: center; gap: 5px; font-size: 11px; line-height: 1.7; color: #4b5563; }
.sheet-table .pt-check {
  width: 13px; height: 13px; flex: none; border: 1px solid #d5d9e0; border-radius: 3px;
  background: #fff; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
}
.sheet-table .pt-check svg { opacity: 0; }
.sheet-table .pt-check.is-doing { border-color: var(--primary); }
.sheet-table .pt-check.is-doing::after {
  content: ''; position: absolute; width: 5px; height: 5px; border-radius: 1px; background: var(--primary);
}
.sheet-table .pt-check.is-done { background: #22c55e; border-color: #22c55e; }
.sheet-table .pt-check.is-done svg { opacity: 1; }
.sheet-table .pt-check.is-done::after { display: none; }
.sheet-table .pt-item.is-done .pt-txt { text-decoration: line-through; color: #9ca3af; }
.sheet-table .pt-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
/* 子任务负责人：有名字显示名字，没名字显示淡人像图标，点一下就指派 */
.sheet-table .pt-own {
  flex: none; display: inline-flex; align-items: center; gap: 2px;
  max-width: 76px; height: 16px; padding: 0 3px;
  border: none; border-radius: 3px; background: none;
  font: inherit; font-size: 11px; line-height: 1; color: #9ca3af;
  cursor: pointer; white-space: nowrap;
}
.sheet-table .pt-own .nm { overflow: hidden; text-overflow: ellipsis; }
.sheet-table .pt-own .ico { display: block; }
.sheet-table .pt-own:hover { color: var(--primary); background: #eef4ff; }
.sheet-table .pt-own.is-empty { opacity: .32; transition: opacity .12s; }
.sheet-table .pt-item:hover .pt-own.is-empty,
.sheet-table .pt-own.is-empty:focus-visible { opacity: 1; }
.sheet-table .pt-own:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.sheet-table .pt-own.saved { color: var(--ok); }
/* 底部添加行：有子任务时才常驻，空项目靠 hover 的加号唤起 */
.sheet-table .pt-add { display: none; margin-top: 2px; }
.sheet-table tr.has-tasks .pt-add,
.sheet-table .pt-add.is-open { display: block; }
.sheet-table .pt-add input {
  width: 100%; height: 19px; border: none; background: transparent;
  padding: 0 4px 0 18px; font-size: 11px; color: #111827; box-shadow: none;
  text-align: left; border-radius: 3px;
}
.sheet-table .pt-add input::placeholder { color: #c3c9d2; }
.sheet-table .pt-add input:hover { background: #f5f7fa; }
.sheet-table .pt-add input:focus { outline: none; background: #eef4ff; }

.sheet-table tr.has-tasks td { vertical-align: top; }
.sheet-table tr.has-tasks td.fcol { padding-top: 9px; }
.sheet-table tr.has-tasks td.cell { padding-top: 0; }
.sheet-table tr.has-tasks td.cell input { height: 51px; }
.sheet-table tr.empty-row td { height: 44px; color: var(--muted); }

/* 左侧 7 列冻结（优先级/项目/阶段/负责人/启动/结束/今日目标） */
.sheet-table th.fcol, .sheet-table td.fcol { position: sticky; z-index: 3; background: #fff; }
.sheet-table th.col-prio,  .sheet-table td.col-prio  { left: 0; }
.sheet-table th.col-proj,  .sheet-table td.col-proj  { left: 50px; }
.sheet-table th.col-stage, .sheet-table td.col-stage { left: 214px; }
.sheet-table th.col-owner, .sheet-table td.col-owner { left: 298px; }
.sheet-table th.col-start, .sheet-table td.col-start { left: 390px; }
.sheet-table th.col-end,   .sheet-table td.col-end   { left: 492px; }
.sheet-table th.col-goal,  .sheet-table td.col-goal  { left: 594px; }
.sheet-table thead th.fcol { background: #fafbfc; z-index: 4; box-shadow: inset -1px 0 0 var(--border); }
.sheet-table td.fcol { box-shadow: inset -1px 0 0 #eceef2; }
.sheet-table tbody tr:hover td.fcol { background: #fafbfd; }

.sheet-table td select, .sheet-table td input[type=text] {
  width: 100%; height: 34px; border: none; background: transparent;
  padding: 0 2px; font-size: 13px; box-shadow: none; color: var(--text);
  text-align: center;
}
.sheet-table td.col-proj input, .sheet-table td input.js-cell { text-align: left; }
.sheet-table td select:focus, .sheet-table td input:focus {
  outline: 2px solid var(--primary); outline-offset: -2px; background: #fff;
}
.sheet-table td .saved { background: #f0fdf4; }
.sheet-table td .error { background: #fef2f2; }

.sheet-table td.cell {
  padding: 0;
  border-left: 3px solid transparent;
  background: #fff;
}
.sheet-table td.cell.is-today { background: #fbfdff; }
.sheet-table td.cell input {
  width: 100%;
  height: 51px;
  border: none;
  border-radius: 0;
  background: transparent;
  padding: 0 10px;
  font-size: 13px;
  box-shadow: none;
}
.sheet-table td.cell input:focus {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  background: #fff;
}
.sheet-table td.cell.saving { background: #fffbeb; }
.sheet-table td.cell.saved { background: #f0fdf4; }
.sheet-table td.cell.error { background: #fef2f2; }
.sheet-table td.cell.off { background: #f7f8fa; }
.sheet-table td.cell.off input { color: #c1c7d0; cursor: not-allowed; }
.sheet-table tbody tr:hover td.cell { background: #fafbfd; }
.sheet-table tbody tr:hover td.cell.is-today { background: #f0f6ff; }


/* ---------- 负责人：人名卡片 + 弹出选择 ---------- */
.sheet-table td.col-owner { padding: 0 6px; overflow: visible; }
.owner-btn {
  position: relative; display: block; width: 100%; height: 30px;
  padding: 0 18px; border: 1px solid var(--border); border-radius: 6px;
  background: #fff; cursor: pointer; font: inherit; color: var(--text);
  line-height: 28px; text-align: center;
  transition: border-color .1s, box-shadow .1s;
}
.owner-btn:hover { border-color: #c3cad4; box-shadow: 0 1px 3px rgba(17, 24, 39, .07); }
.owner-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.owner-btn .owner-name {
  display: block; overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
  font-size: 12.5px;
}
.owner-btn .caret {
  position: absolute; right: 6px; top: 50%; transform: translateY(-50%);
  font-size: 9px; color: #b9c0c9;
}
.owner-btn.unassigned { border-style: dashed; background: #fcfcfd; }
.owner-btn.unassigned .owner-name { color: #9aa3ae; }

.owner-hint { font-size: 11px; color: #b3bac3; }

.owner-menu {
  position: fixed; z-index: 900; width: 208px; max-height: 402px; overflow-y: auto;
  background: #fff; border: 1px solid var(--border); border-radius: 8px;
  box-shadow: 0 10px 28px rgba(17, 24, 39, .14); padding: 4px;
}
.owner-opt {
  display: flex; align-items: center; gap: 8px; width: 100%;
  padding: 6px 10px; border: none; background: none; border-radius: 6px;
  cursor: pointer; font: inherit; text-align: left; color: var(--text);
}
.owner-opt:hover { background: var(--primary-weak); }
.owner-opt.on { background: #f1f5ff; font-weight: 500; }
.owner-opt .nm { font-size: 13px; white-space: nowrap; }
.owner-opt .role {
  margin-left: auto; padding-left: 8px; font-size: 11px; color: var(--muted);
  white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 118px; flex: none;
}

/* ---------- 启动/结束：日历选择，只显示月-日 ---------- */
.date-cell { position: relative; }
.date-btn {
  display: flex; align-items: center; justify-content: center; gap: 5px;
  width: 100%; height: 30px; padding: 0 6px;
  border: 1px solid var(--border); border-radius: 6px; background: #fff;
  cursor: pointer; font: inherit; color: var(--text); font-size: 12.5px;
  font-variant-numeric: tabular-nums;
  transition: border-color .1s, box-shadow .1s;
}
.date-btn:hover { border-color: #c3cad4; box-shadow: 0 1px 3px rgba(17, 24, 39, .07); }
.date-btn:focus-visible { outline: 2px solid var(--primary); outline-offset: 1px; }
.date-btn .cal { color: #a8b0ba; flex: none; }
.date-cell.is-empty .date-btn .dt { color: #b3bac3; }
.date-cell.saved .date-btn { border-color: #86efac; background: #f0fdf4; }
.date-cell.error .date-btn { border-color: #fca5a5; background: #fef2f2; }
.date-native {
  position: absolute; inset: 0; width: 100%; height: 100%;
  padding: 0; border: 0; opacity: 0; pointer-events: none; z-index: 1;
}

.add-row td { background: #fcfcfd; }
.add-row td input[placeholder='新项目名称'] { text-align: left; }
.add-cell { text-align: right !important; padding-right: 14px !important; }

.prio { display: flex; align-items: center; justify-content: center; gap: 8px; font-weight: 600; font-size: 12px; color: #374151; }
.prio > span { display: inline-flex; flex-direction: column; gap: 3px; }
.arrow {
  border: none; background: none; cursor: pointer;
  font-size: 10px; line-height: 1; padding: 2px 4px; color: #8891a0;
  display: block; border-radius: 3px;
}
.arrow:hover:not(:disabled) { color: var(--primary); background: var(--primary-weak); }
.arrow:hover:not(:disabled) { color: var(--primary); }
.arrow:disabled { opacity: .25; cursor: default; }

.legend-chip {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px;
  vertical-align: 0; margin: 0 3px 0 8px; border: 1px solid var(--border);
}

.prio { display: flex; align-items: center; gap: 4px; font-weight: 600; }
.arrow {
  border: none; background: none; cursor: pointer;
  font-size: 9px; line-height: 1; padding: 1px 2px; color: var(--muted);
  display: block;
}
.arrow:hover:not(:disabled) { color: var(--primary); }
.arrow:disabled { opacity: .25; cursor: default; }

.legend-chip {
  display: inline-block; width: 10px; height: 10px; border-radius: 2px;
  vertical-align: 0; margin: 0 3px 0 8px; border: 1px solid var(--border);
}
.today-dot {
  display: inline-block; width: 14px; height: 14px; border-radius: 3px;
  margin-right: 3px; border: 1px solid var(--border); vertical-align: middle;
}
.todo-row { background: #fffdf5; }
.todo-row:hover { background: #fffbeb; }

.addmore { margin-top: 4px; }
.addmore summary {
  font-size: 12px; color: var(--primary); cursor: pointer;
  list-style: none; display: inline-block;
}
.addmore summary::-webkit-details-marker { display: none; }
.addmore summary::before { content: "+ "; }
.addmore[open] summary { color: var(--muted); }

/* ---------- 响应式 ---------- */
@media (max-width: 720px) {
  .topbar { padding: 0 14px; gap: 16px; overflow-x: auto; }
  .container { padding: 16px 14px 32px; }
  .form-grid { grid-template-columns: 1fr; }
  .page-head { align-items: flex-start; }
}

/* ---------- 看板：本周目标 chips ---------- */
.goal-bar {
  display: flex; flex-wrap: wrap; align-items: center; gap: 8px;
  padding: 12px 14px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
  margin-bottom: 4px;
}
.goal-chip {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 5px 8px 5px 6px;
  border: 1px solid var(--border); border-radius: 999px;
  background: #fff; font-size: 12.5px; max-width: 100%;
}
.goal-chip.done { background: #f6fbf7; border-color: #cdeccf; }
.goal-chip.done .goal-text { color: var(--muted); text-decoration: line-through; }
.goal-chip .goal-text { white-space: nowrap; overflow: hidden; text-overflow: ellipsis; max-width: 320px; }
.goal-check {
  width: 16px; height: 16px; border-radius: 50%;
  border: 1px solid var(--border-strong); background: #fff;
  color: var(--ok); font-size: 11px; line-height: 1; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  padding: 0;
}
.goal-chip.done .goal-check { background: var(--ok); border-color: var(--ok); color: #fff; }
.goal-del {
  border: none; background: none; cursor: pointer;
  color: #c2c8d0; font-size: 13px; line-height: 1; padding: 0 2px;
}
.goal-del:hover { color: var(--danger); }
.goal-add { flex: 1 1 220px; min-width: 180px; }
.goal-add input {
  width: 100%; height: 30px; padding: 0 10px; font-size: 13px;
  border: 1px dashed var(--border-strong); border-radius: 999px;
  background: #fcfcfd;
}
.goal-add input:focus { outline: none; border-style: solid; border-color: var(--primary); background: #fff; }

/* ---------- 统计条 ---------- */
.stat-row { display: flex; flex-wrap: wrap; gap: 10px; margin-bottom: 14px; }
.stat {
  display: flex; flex-direction: column; gap: 2px;
  padding: 9px 16px; min-width: 120px;
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
}
.stat .k { font-size: 11.5px; color: var(--muted); }
.stat .v { font-size: 18px; font-weight: 600; line-height: 1.2; font-variant-numeric: tabular-nums; }

/* ---------- 筛选条 ---------- */
.filter-bar {
  display: flex; align-items: center; justify-content: flex-end;
  padding: 0 0 10px;
}

/* ---------- 工作项状态下拉（行内即改） ---------- */
.status-select {
  height: 24px; padding: 0 4px; font-size: 12px; border-radius: 4px;
  border: 1px solid var(--border); background: #fff; color: var(--muted);
  cursor: pointer; width: auto; min-width: 76px;
}
.status-select:hover { border-color: var(--border-strong); }
.status-select.st-doing { color: #b45309; border-color: #fcd9a8; background: #fffbf3; }
.status-select.st-done { color: #15803d; border-color: #bbf7d0; background: #f6fbf7; }

/* ---------- 行内添加条（项目详情 / 站会） ---------- */
.checkin { display: flex; gap: 8px; align-items: center; flex-wrap: nowrap; }
.checkin select { width: auto; flex: none; min-width: 90px; }
.checkin .grow { flex: 1 1 auto; min-width: 120px; }
.checkin input[type=date] { width: auto; flex: none; }
.checkin button { flex: none; }

/* ---------- 登录页 ---------- */
.login-body {
  min-height: 100vh;
  display: flex; align-items: center; justify-content: center;
  background: var(--bg); padding: 24px;
}
.login-card {
  width: 330px; background: var(--card);
  border: 1px solid var(--border); border-radius: 10px;
  padding: 36px 28px 28px;
  box-shadow: 0 1px 2px rgba(17, 24, 39, .04);
}
.login-card h1 {
  font-size: 17px; font-weight: 600; letter-spacing: .4px;
  text-align: center; margin-bottom: 26px;
}
.login-card input { height: 38px; margin-bottom: 10px; }
.login-card input::placeholder { color: #b3bac3; }
.login-btn { width: 100%; height: 38px; margin-top: 6px; }
.login-err { color: var(--danger); font-size: 12px; margin: -12px 0 12px; text-align: center; }

/* ---------- 顶栏：当前登录人 ---------- */
.topbar-user { margin-left: auto; display: flex; align-items: center; gap: 6px; }
.topbar-user .uname { color: var(--muted); font-size: 12.5px; }
.topbar-user .btn-link { color: var(--muted); }
.topbar-user .btn-link:hover { color: var(--primary); }

/* ---------- 侧边栏层级（覆盖前面的基础样式） ---------- */
.sb-group { margin-bottom: 6px; }
.sb-parent { color: #111827; font-weight: 600; }
.sb-children {
  position: relative; margin-left: 15px; padding-left: 9px;
  border-left: 1px solid #eceef2;
}
.sb-children .sb-item {
  position: relative; height: 32px; padding-left: 8px;
  font-size: 12.5px; color: #4b5563;
}
.sb-children .sb-item.active { background: var(--primary-weak); color: var(--primary); font-weight: 500; }
.sb-children .sb-item.active::before {
  content: ''; position: absolute; left: -10px; top: 7px; bottom: 7px; width: 2px;
  background: var(--primary); border-radius: 2px;
}
.sb-collapsed .sb-children { margin-left: 0; padding-left: 0; border-left: 0; }
.sb-collapsed .sb-item.active::before { display: none; }

/* ---------- 单日切换 ---------- */
.day-switch {
  display: inline-flex; align-items: center; gap: 2px;
  height: 32px; padding: 0 4px;
  border: 1px solid var(--border); border-radius: 6px; background: #fff;
}
.day-btn {
  display: inline-flex; align-items: center; justify-content: center;
  width: 24px; height: 24px; border-radius: 4px;
  color: #6b7280; text-decoration: none; font-size: 14px; line-height: 1;
}
.day-btn:hover { background: #f3f4f6; color: var(--text); }
.day-cur { padding: 0 6px; font-size: 12.5px; color: #374151; font-variant-numeric: tabular-nums; white-space: nowrap; }
.day-cur .wd { color: #9ca3af; }
.today-tag { margin-left: 6px; padding: 1px 5px; border-radius: 3px; background: var(--primary-weak); color: var(--primary); font-size: 11px; }

/* ---------- 工作项列表（项目分组 + 工作项行） ---------- */
.task-board {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); overflow: hidden;
}
.task-table { width: 100%; border-collapse: collapse; table-layout: fixed; }
.task-table th {
  height: 34px; padding: 0 12px;
  background: #fafbfc; border-bottom: 1px solid var(--border);
  color: var(--muted); font-size: 12px; font-weight: 500; text-align: left;
}
.task-table th .th-sub { margin-left: 8px; color: #b3bac3; font-weight: 400; }
.task-table td {
  height: 40px; padding: 0 12px;
  border-bottom: 1px solid #f0f2f5; vertical-align: middle; font-size: 13px;
}
.task-table tbody tr:hover { background: #fafbfd; }

.row-flex { display: flex; align-items: center; gap: 6px; min-width: 0; }
.row-flex.indent { padding-left: 44px; }   /* 与项目名对齐，工作项缩进一级 */

.pno { flex: none; width: 16px; text-align: right; color: #9ca3af; font-size: 12px; }
.proj-name {
  min-width: 0; max-width: 46%;
  font-weight: 600; color: var(--text);
  overflow: hidden; text-overflow: ellipsis; white-space: nowrap;
}
.proj-row td { background: #fafbfc; height: 38px; }
.proj-row:hover td { background: #f6f8fa; }
.cnt { flex: none; color: #9ca3af; font-size: 11.5px; }

.mini-sel {
  width: auto; height: 24px; min-width: 62px; padding: 0 4px;
  border: 1px solid transparent; border-radius: 4px;
  background: transparent; color: #4b5563; font-size: 12px;
}
.mini-sel:hover { border-color: var(--border); background: #fff; }
.mini-sel:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: none; }

.row-fold {
  flex: none; width: 16px; height: 16px; padding: 0;
  border: none; background: none; color: #9ca3af; cursor: pointer;
  display: inline-flex; align-items: center; justify-content: center;
  border-radius: 3px; visibility: hidden;
}
.row-fold.has-kids { visibility: visible; }
.row-fold svg { transition: transform .15s ease; transform: rotate(-90deg); }
.row-fold.is-open svg { transform: rotate(0deg); }
.row-fold:hover { background: #eef0f3; color: #4b5563; }

/* 行内输入：无边框，聚焦才出浅框 */
input.task-txt, input.cell-input {
  width: 100%; height: 28px; padding: 0 6px;
  border: none; background: transparent; box-shadow: none;
  font: inherit; font-size: 13px; color: var(--text);
  border-radius: 4px; text-align: left;
}
input.task-txt:focus, input.cell-input:focus {
  outline: none; background: #fff;
  box-shadow: inset 0 0 0 2px rgba(37, 99, 235, .25);
}
.task-txt::placeholder, .cell-input::placeholder { color: #c3c9d2; }
input.task-txt.saved, input.cell-input.saved { background: #f0fdf4; }
input.task-txt.error, input.cell-input.error { background: #fef2f2; }
.task-row.is-done .task-txt { color: #9ca3af; text-decoration: line-through; }
.task-row.is-hidden, .task-new.is-hidden { display: none; }
.task-new td { padding-top: 2px; padding-bottom: 6px; }
.plus-mark { flex: none; width: 14px; text-align: center; color: #c3c9d2; font-size: 12px; }
input.new-task-input {
  flex: 1; min-width: 0; height: 26px; padding: 0 6px;
  border: none; background: none; box-shadow: none;
  font: inherit; font-size: 12.5px; color: #4b5563;
}
input.new-task-input:focus { outline: none; background: #f7f9fc; border-radius: 4px; }
.new-task-input::placeholder { color: #c3c9d2; }

.add-proj td { background: #fcfcfd; padding: 10px 12px; }
.add-proj .row-flex { gap: 8px; }
input.new-proj-name { max-width: 300px; }

.c-act { text-align: right; white-space: nowrap; }
.act-plus {
  width: 18px; height: 18px; margin-right: 4px; padding: 0;
  border: none; background: none; border-radius: 3px;
  color: #b9c0c9; font-size: 14px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity .12s;
}
.act-del {
  width: 18px; height: 18px; padding: 0;
  border: none; background: none; border-radius: 3px;
  color: #c3c9d2; font-size: 14px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity .12s;
}
.task-table tr:hover .act-plus, .task-table tr:hover .act-del { opacity: 1; }
.act-plus:hover { color: var(--primary); background: #eef4ff; }
.act-del:hover { color: var(--danger); background: #fef2f2; }

/* 三态勾选框（列表里通用） */
.pt-check {
  flex: none; width: 14px; height: 14px; border: 1px solid #d5d9e0; border-radius: 3px;
  background: #fff; display: inline-flex; align-items: center; justify-content: center;
  cursor: pointer; position: relative;
}
.pt-check svg { opacity: 0; }
.pt-check.is-doing { border-color: var(--primary); }
.pt-check.is-doing::after {
  content: ''; position: absolute; width: 6px; height: 6px; border-radius: 1px; background: var(--primary);
}
.pt-check.is-done { background: #22c55e; border-color: #22c55e; }
.pt-check.is-done svg { opacity: 1; }
.pt-check.is-done::after { display: none; }

/* 项目分组的分隔与可编辑提示 */
.proj-row td { background: #f6f8fa; border-top: 1px solid #eceef2; }
.task-table tbody tr.proj-row:first-child td { border-top: none; }
input.cell-input:hover, input.task-txt:hover { background: #f7f9fc; }
tr.proj-row .act-plus { opacity: .45; }
tr.proj-row:hover .act-plus { opacity: 1; }

/* ---------- 组织架构 ---------- */
.org-grid {
  display: grid; gap: 14px;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
}
.org-card {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  overflow: hidden;
}
.org-head {
  display: flex; justify-content: space-between; align-items: center;
  padding: 10px 14px; background: #fafbfc; border-bottom: 1px solid var(--border);
  font-weight: 600; font-size: 13px;
}
.org-head .n { color: #9ca3af; font-weight: 400; font-size: 12px; }
.org-person {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 14px; font-size: 13px; border-bottom: 1px solid #f4f6f8;
}
.org-person:last-child { border-bottom: none; }
.org-role { flex: none; width: 78px; color: #9ca3af; font-size: 12px; }
.org-name { font-weight: 500; }
.org-admin { margin-left: auto; }

/* ---------- 人员与密码 ---------- */
.add-user {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 12px 14px; margin-bottom: 14px;
}
.add-user .row-flex { gap: 8px; flex-wrap: wrap; }
.add-user input[type=text] { width: 150px; height: 32px; }
.add-user select { width: 100px; height: 32px; }
.chk {
  display: inline-flex; align-items: center; gap: 5px;
  font-size: 12.5px; color: #4b5563; white-space: nowrap;
}
.chk input { width: 14px; height: 14px; margin: 0; accent-color: var(--primary); }

.acc-table td { padding: 7px 10px; }
.acc-table input[type=text] { height: 28px; font-size: 12.5px; padding: 0 8px; }
.acc-table select { height: 28px; font-size: 12.5px; padding: 0 6px; }
.acc-table .pwd {
  font-family: ui-monospace, Consolas, "Courier New", monospace;
  letter-spacing: .6px;
}
.acc-table .c-act { text-align: right; white-space: nowrap; }
.acc-table .c-act .btn-sm { height: 26px; }
.btn-link.danger { color: #c9575c; }
.btn-link.danger:hover { color: var(--danger); }

/* 人员表：固定列宽，表头与内容对齐 */
.acc-table { table-layout: fixed; }
.org-grid { align-items: start; }

/* 账号管理单独成区，与业务板块分隔 */
.sb-group-end { margin-top: 10px; padding-top: 10px; border-top: 1px solid #f0f2f5; }
.sb-collapsed .sb-group-end { margin-top: 6px; padding-top: 8px; }

/* ---------- 板块权限勾选 ---------- */
.sec-checks { display: flex; flex-wrap: wrap; gap: 2px 10px; }
.sec-chk {
  display: inline-flex; align-items: center; gap: 3px;
  font-size: 12px; color: #4b5563; white-space: nowrap; cursor: pointer;
}
.sec-chk input { width: 13px; height: 13px; margin: 0; accent-color: var(--primary); }
.org-secs { flex: 1; min-width: 0; color: #9ca3af; font-size: 11.5px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---------- 权限说明条 / 管理员联动 ---------- */
.perm-note {
  display: flex; align-items: center; flex-wrap: wrap; gap: 6px;
  margin-bottom: 14px; padding: 9px 14px;
  background: #f7f9fc; border: 1px solid #eef1f5; border-radius: 6px;
  color: #4b5563; font-size: 12.5px; line-height: 1.5;
}
.pn-tag {
  padding: 1px 7px; border-radius: 3px;
  background: var(--primary-weak); color: var(--primary);
  font-size: 11.5px; font-weight: 500;
}
.pn-dim { color: #9ca3af; }
.add-hint { margin-top: 8px; color: #9ca3af; font-size: 12px; }

.sec-checks.is-locked .sec-chk { color: #9ca3af; cursor: default; }
.sec-checks.is-locked .sec-chk input { accent-color: #a8b0bb; cursor: not-allowed; }
.sec-lock {
  margin-left: 2px; padding: 0 5px; border-radius: 3px;
  background: #eef1f5; color: #8b93a1; font-size: 11px; line-height: 16px;
}

/* 账号表：表头吸顶，长名单滚动时列名始终可见 */
.acc-wrap { max-height: calc(100vh - 210px); min-height: 320px; overflow: auto; }
.acc-table thead th {
  position: sticky; top: 0; z-index: 2;
  background: #fafbfc; border-bottom: 1px solid var(--border);
  color: var(--muted); font-size: 12px; font-weight: 500;
}
.acc-table .sec-checks { padding-right: 10px; }

/* ---------- 截止日期 / 逾期 ---------- */
input.mini-date {
  width: 106px; height: 24px; padding: 0 4px;
  border: 1px solid transparent; border-radius: 4px; background: transparent;
  color: #4b5563; font-size: 12px;
}
input.mini-date:hover { border-color: var(--border); background: #fff; }
input.mini-date:focus { outline: none; border-color: var(--primary); background: #fff; box-shadow: none; }
input.mini-date.is-overdue { color: var(--danger); font-weight: 500; }

/* ---------- 工作项流水 ---------- */
.act-hist {
  width: 18px; height: 18px; margin-right: 4px; padding: 0;
  border: none; background: none; border-radius: 3px;
  color: #b9c0c9; font-size: 13px; line-height: 1; cursor: pointer;
  opacity: 0; transition: opacity .12s;
}
.task-table tr:hover .act-hist { opacity: 1; }
.act-hist:hover { color: var(--primary); background: #eef4ff; }
.hist-row td { background: #fbfcfe; padding: 8px 14px 10px 56px; }
.hist-title { display: flex; justify-content: space-between; gap: 12px; font-size: 12px; color: #4b5563; }
.hist-title span { color: #9ca3af; flex: none; }
.hist-list { list-style: none; margin: 6px 0 0; padding: 0; }
.hist-list li { display: flex; gap: 10px; padding: 3px 0; font-size: 12.5px; }
.hist-list .hd { flex: none; width: 80px; color: #9ca3af; font-variant-numeric: tabular-nums; }
.hist-empty { margin-top: 6px; color: #c3c9d2; font-size: 12px; }

/* ---------- 板块页底部：笔记 / 已完成 / 已归档 ---------- */
.sub-board {
  margin-top: 14px; background: var(--card);
  border: 1px solid var(--border); border-radius: var(--radius);
}
.sub-head { display: flex; align-items: center; gap: 8px; padding: 10px 14px; font-size: 13px; font-weight: 600; }
.sub-head h2 { margin: 0; font-size: 13px; }
.sub-head .count { font-weight: 400; color: #9ca3af; font-size: 12px; }
details.sub-board > summary.sub-head { cursor: pointer; list-style: none; }
details.sub-board > summary.sub-head::-webkit-details-marker { display: none; }
details.sub-board > summary.sub-head::before { content: '▸'; color: #b9c0c9; font-size: 11px; }
details.sub-board[open] > summary.sub-head::before { content: '▾'; }
.sub-empty { padding: 2px 14px 14px; color: #9ca3af; font-size: 12.5px; }

.note-add { padding: 0 14px 10px; }
input.note-input { width: 100%; height: 32px; font-size: 13px; }
.note-list { list-style: none; margin: 0; padding: 0 6px 8px; }
.note-item { display: flex; align-items: center; gap: 8px; padding: 6px 8px; border-top: 1px solid #f4f6f8; font-size: 12.5px; }
.note-txt { flex: 1; min-width: 0; }
.note-meta { flex: none; color: #9ca3af; font-size: 11.5px; }
.note-proj { max-width: 150px; }
.note-item .note-convert { height: 24px; font-size: 12px; white-space: nowrap; }
.done-table .done-txt { color: #6b7280; text-decoration: line-through; }
.done-by, .done-note { font-size: 12.5px; color: #9ca3af; }
.sb-home { margin-bottom: 10px; }

/* ---------- 看板 ---------- */
.sum-row { display: grid; grid-template-columns: repeat(4, 1fr); gap: 12px; margin-bottom: 14px; }
.sum-card {
  display: flex; align-items: baseline; gap: 10px;
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); padding: 12px 16px;
}
.sum-n { font-size: 24px; font-weight: 600; font-variant-numeric: tabular-nums; }
.sum-l { color: #9ca3af; font-size: 12.5px; }
.sum-card.is-done .sum-n { color: #16a34a; }
.sum-card.is-warn .sum-n { color: var(--danger); }

.overdue-bar {
  display: flex; flex-wrap: wrap; gap: 6px 14px;
  margin-bottom: 14px; padding: 9px 14px;
  background: #fef2f2; border: 1px solid #fee2e2; border-radius: 6px;
  color: #b91c1c; font-size: 12.5px;
}
.od-item em { font-style: normal; margin-left: 6px; color: #d18488; }

.board-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(340px, 1fr)); gap: 14px; align-items: start; }
.bd-card { background: var(--card); border: 1px solid var(--border); border-radius: var(--radius); padding: 12px 14px; }
.bd-head { display: flex; justify-content: space-between; align-items: center; }
.bd-title { font-weight: 600; font-size: 13.5px; }
.bd-link { font-size: 12px; color: var(--primary); text-decoration: none; }
.bd-sub { margin-top: 2px; color: #9ca3af; font-size: 11.5px; }
.bd-nums { display: flex; gap: 14px; margin: 8px 0 10px; font-size: 12px; color: #6b7280; }
.bd-nums b { font-size: 15px; font-variant-numeric: tabular-nums; }
.bd-nums .ok b { color: #16a34a; }
.bd-nums .dim b { color: #9ca3af; }
.bd-list { border-top: 1px solid #f0f2f5; padding-top: 6px; }
.bd-item { display: flex; align-items: center; gap: 6px; padding: 4px 0; font-size: 12.5px; }
.bd-dot { flex: none; width: 6px; height: 6px; border-radius: 50%; background: #d5d9e0; }
.bd-dot.doing { background: var(--primary); }
.bd-txt { flex: 1; min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bd-own { flex: none; color: #9ca3af; font-size: 11.5px; }
.bd-empty, .bd-more { padding: 4px 0; color: #c3c9d2; font-size: 12px; }
.bd-done { margin-top: 8px; border-top: 1px dashed #eceef2; padding-top: 6px; }
.bd-done-h { margin-bottom: 2px; color: #9ca3af; font-size: 11.5px; }
.bd-item.done .bd-txt { color: #9ca3af; text-decoration: line-through; }

/* ---------- 组织架构：树状图（总经理 → 部门 → 负责人/成员） ---------- */
.org-chart {
  background: var(--card); border: 1px solid var(--border); border-radius: var(--radius);
  padding: 26px 18px 30px; overflow-x: auto; scrollbar-width: thin;
}
.oc-canvas { display: inline-block; min-width: 100%; text-align: center; }
.oc-node {
  display: inline-flex; flex-direction: column; align-items: center; gap: 2px;
  background: #fff; border: 1px solid var(--border); border-radius: 8px; padding: 8px 16px;
}
.oc-root { position: relative; display: flex; justify-content: center; padding-bottom: 30px; }
.oc-root::after { content: ''; position: absolute; bottom: 0; left: 50%; width: 1px; height: 30px; background: #dfe4ec; }
.oc-boss { border-color: #c7d7fe; background: #f5f8ff; padding: 10px 26px; }
.oc-boss .oc-name { font-size: 15px; font-weight: 600; }
.oc-role { font-size: 11.5px; color: #9ca3af; }
.oc-badge { margin-left: 6px; font-size: 10.5px; padding: 0 5px; vertical-align: 1px; }

.oc-tree { display: flex; justify-content: center; align-items: flex-start; gap: 14px; }
.oc-dept { position: relative; flex: none; width: 178px; padding-top: 30px; }
.oc-dept::before { content: ''; position: absolute; top: 0; left: 50%; width: 1px; height: 30px; background: #dfe4ec; }
.oc-dept::after { content: ''; position: absolute; top: 0; left: 0; width: 100%; height: 1px; background: #dfe4ec; }
.oc-dept:first-child::after { left: 50%; width: 50%; }
.oc-dept:last-child::after { width: 50%; }
.oc-dept:only-child::after { display: none; }
.oc-dept-node {
  width: 100%; flex-direction: row; justify-content: center; gap: 8px;
  padding: 7px 10px; background: #fafbfc;
}
.oc-dname { font-weight: 600; font-size: 13px; }
.oc-dcount { color: #9ca3af; font-size: 11.5px; }

.oc-members { position: relative; list-style: none; margin: 0; padding: 18px 0 0; }
.oc-members::before { content: ''; position: absolute; top: 0; left: 50%; width: 1px; height: 18px; background: #dfe4ec; }
.oc-members li { position: relative; padding-top: 12px; }
.oc-members li::before { content: ''; position: absolute; top: 0; left: 50%; width: 1px; height: 12px; background: #e9edf3; }
.oc-person {
  display: flex; flex-direction: column; align-items: center; gap: 1px;
  background: #fff; border: 1px solid #edf0f5; border-radius: 6px; padding: 6px 10px;
}
.oc-person .n { font-size: 12.5px; font-weight: 500; }
.oc-person .r { font-size: 11px; color: #9ca3af; }
.oc-person.is-head { border-color: #c7d7fe; background: #f7faff; }
.oc-person.is-head .r { color: var(--primary); }

/* ================= 视觉升级：更中性的底色、更清晰的层级、更轻的边框 ================= */
:root {
  --bg: #f5f6f8;
  --border: #e7e9ef;
  --border-strong: #d8dde6;
  --radius: 10px;
  --shadow-sm: 0 1px 2px rgba(16, 24, 40, .04);
  --shadow-md: 0 6px 20px rgba(16, 24, 40, .07);
}

::selection { background: #dbe6ff; }
*::-webkit-scrollbar { width: 8px; height: 8px; }
*::-webkit-scrollbar-thumb { background: #d6dbe4; border-radius: 8px; }
*::-webkit-scrollbar-thumb:hover { background: #c2c9d6; }
*::-webkit-scrollbar-track { background: transparent; }

/* 侧边栏：品牌标识 + 更分明的分组 */
.sidebar { width: 216px; }
.sb-head { height: 58px; gap: 8px; border-bottom-color: #f0f2f6; }
.sb-brand { display: flex; align-items: center; gap: 8px; font-size: 13px; }
.sb-logo {
  flex: none; width: 22px; height: 22px; border-radius: 6px;
  background: var(--primary); color: #fff;
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 12px; font-weight: 600;
}
.sb-nav { padding: 12px 10px; }
.sb-item, .sb-parent { color: #3f4756; }
.sb-item:hover, .sb-parent:hover { background: #f4f6fa; }
.sb-item.active { background: #eef3ff; }
.sb-parent { color: #1f2937; letter-spacing: .02em; }
.sb-children { border-left-color: #eef1f6; }
.sb-collapsed .sb-brand-short { display: none; }   /* 折叠时只留 logo */
.sb-collapsed .sb-head { padding: 0; }
.sb-toggle:hover { background: #f4f6fa; }

/* 顶栏 */
.topbar { height: 58px; padding: 0 28px; box-shadow: 0 1px 2px rgba(16, 24, 40, .03); }
.topbar-user { gap: 8px; }
.topbar-user .uname { color: #374151; font-weight: 500; }
.u-avatar {
  width: 22px; height: 22px; border-radius: 50%;
  background: #eef3ff; color: var(--primary);
  display: inline-flex; align-items: center; justify-content: center;
  font-size: 11px; font-weight: 600;
}

/* 内容区 */
.container { padding: 24px 28px 48px; }
.page-head { margin-bottom: 18px; }
h1 { font-size: 19px; }
.page-head .count, .section-head .count { color: #8a93a5; }

/* 卡片统一质感 */
.card, .task-board, .sub-board, .table-wrap, .bd-card, .sum-card,
.org-chart, .add-user, .board-card {
  border-color: var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-sm);
}

/* 表格：更柔和的表头与分隔线 */
th { background: #fafbfd; color: #7a8394; letter-spacing: .02em; }
td { border-bottom-color: #f1f3f7; }
tbody tr:hover { background: #f8faff; }
.task-table th { background: #fafbfd; }
.task-table td { height: 42px; }
.proj-row td { background: #f8f9fc; border-top-color: #edf0f5; }
.proj-row:hover td { background: #f4f7fd; }
details.sub-board > summary.sub-head:hover { background: #fafbfe; }

/* 输入与按钮 */
input[type=text], input[type=password], input[type=date], textarea, select { border-color: #dfe3eb; }
input:focus, textarea:focus, select:focus { box-shadow: 0 0 0 3px rgba(37, 99, 235, .10); }
.btn { font-weight: 500; box-shadow: 0 1px 2px rgba(37, 99, 235, .18); }
.btn-outline { box-shadow: none; border-color: #dfe3eb; color: #374151; }
.btn-outline:hover { background: #f6f8fb; border-color: #c9d2e0; }
.day-switch { border-color: #e3e7ee; box-shadow: var(--shadow-sm); }

/* 看板 */
.sum-card { padding: 16px 18px; }
.sum-n { font-size: 28px; letter-spacing: -.02em; }
.bd-card { transition: box-shadow .15s ease; }
.bd-card:hover { box-shadow: var(--shadow-md); }
.bd-nums { margin: 10px 0; }

/* 登录页 */
.login-body { background: radial-gradient(1200px 600px at 50% -10%, #eaf0ff 0%, #f5f6f8 62%); }
.login-card {
  width: 340px; padding: 32px 30px 30px;
  border-radius: 12px; border-color: #e9ecf3;
  box-shadow: 0 10px 34px rgba(16, 24, 40, .08);
}
.login-logo {
  width: 40px; height: 40px; margin: 0 auto 14px;
  border-radius: 11px; background: var(--primary); color: #fff;
  display: flex; align-items: center; justify-content: center;
  font-size: 19px; font-weight: 600;
}
.login-card h1 { font-size: 16px; margin-bottom: 24px; }

/* 组织架构节点更立体一点 */
.oc-node { box-shadow: var(--shadow-sm); }
.oc-boss { box-shadow: 0 2px 10px rgba(37, 99, 235, .10); }
.oc-person .r { color: #8a93a5; }

/* 统计卡左侧色条：待办蓝 / 完成绿 / 进展灰 / 逾期红 */
.sum-card { position: relative; overflow: hidden; }
.sum-card::before { content: ''; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: #e3e9f5; }
.sum-card:first-child::before { background: #93b4fd; }
.sum-card.is-done::before { background: #86efac; }
.sum-card.is-warn::before { background: #fca5a5; }

/* ---------- 项目分组卡片化：每个项目一个独立边界 ---------- */
.head-only { margin-bottom: 12px; }
.head-only th { border-bottom: none; }
.proj-card {
  background: var(--card); border: 1px solid var(--border);
  border-radius: var(--radius); box-shadow: var(--shadow-sm);
  margin-bottom: 12px; overflow: hidden;
}
.proj-card .proj-row td {
  background: #f7f9fd; border-top: none;
  border-bottom: 1px solid #e6ebf3;   /* 项目头与工作项之间的分界 */
}
.proj-card .proj-row:hover td { background: #f2f6fd; }
.proj-card .task-table td { border-bottom-color: #eef1f6; }
.proj-card .task-table tr:last-child td { border-bottom: none; }
.proj-card .task-new td { background: #fcfdfe; }
.proj-card .task-row.is-hidden, .proj-card .task-new.is-hidden { display: none; }
.add-card { padding: 10px 12px; }
.add-card .row-flex { gap: 8px; }

/* ---------- 项目卡：左侧竖条 + 项目名居中 + 完成按钮常显 ---------- */
.proj-card { position: relative; }
.proj-card::before {
  content: ''; position: absolute; left: 0; top: 0; bottom: 0;
  width: 3px; background: #c7d7fe; pointer-events: none; z-index: 1;
}
.proj-card .proj-row .proj-name { flex: 1 1 auto; max-width: none; text-align: center; }
.proj-card .c-act { white-space: nowrap; }
.proj-card .act-plus { opacity: .55; }
.proj-card .proj-done { height: 24px; padding: 0 9px; font-size: 12px; }
.proj-card::before { width: 4px; background: #a5bdf7; }

/* ---------- Excel 风格：整张网格表，简约、单元格有线 ---------- */
.excel-board { border: 1px solid #d7dde7; border-radius: 6px; box-shadow: none; overflow: hidden; }
.excel-board .task-table { border-collapse: collapse; }
.excel-board .task-table th, .excel-board .task-table td { border: 1px solid #e2e7ef; }
.excel-board .task-table th { background: #f2f4f8; height: 32px; color: #5b6472; font-weight: 500; }
.excel-board .task-table td { height: 34px; padding: 0 8px; background: #fff; }
.excel-board .task-table tbody tr:hover td { background: #f7faff; }
.excel-board .proj-row td { background: #eef2f8; border-top: 2px solid #bfcfe6; }
.excel-board .proj-row:hover td { background: #e7eef8; }
.excel-board .proj-row td:first-child { border-left: 3px solid #a5bdf7; }
.excel-board .proj-row .proj-name { flex: 1 1 auto; max-width: none; text-align: center; }
.excel-board .task-new td { background: #fbfcfe; }
.excel-board .add-proj td { background: #f7f9fc; }
.excel-board input.cell-input, .excel-board input.task-txt { height: 32px; border-radius: 0; }
.excel-board input.cell-input:focus, .excel-board input.task-txt:focus {
  outline: 2px solid var(--primary); outline-offset: -2px;
  box-shadow: none; background: #fff;
}
.excel-board .row-flex.indent { padding-left: 34px; }
.excel-board .proj-done { height: 22px; }
.sub-board { box-shadow: none; }
.excel-board .task-table th, .excel-board .task-table td { border-color: #dde3ec; }

/* ---------- 负责人浮层：搜索 + 三列网格，不再拖长列表 ---------- */
.owner-menu { width: 400px; max-height: none; overflow: hidden; padding: 8px; }
.om-head { margin-bottom: 6px; }
input.om-search { width: 100%; height: 30px; font-size: 12.5px; }
.om-list { display: grid; grid-template-columns: repeat(3, 1fr); gap: 3px; max-height: 252px; overflow-y: auto; }
.owner-opt { flex-direction: column; align-items: flex-start; gap: 0; padding: 6px 8px; }
.owner-opt .nm { font-size: 12.5px; }
.owner-opt .role { margin-left: 0; padding-left: 0; max-width: 100%; color: #9ca3af; }
.owner-opt.om-empty { grid-column: 1 / -1; flex-direction: row; }
.om-none { display: none; grid-column: 1 / -1; padding: 10px 0; text-align: center; color: #c3c9d2; font-size: 12px; }

/* 负责人浮层里的部门分组标题（占满一行） */
.om-group {
  grid-column: 1 / -1;
  margin-top: 2px; padding: 6px 2px 2px;
  border-top: 1px solid #f0f2f6;
  color: #8a93a5; font-size: 11.5px;
}
.om-group:first-of-type { border-top: none; margin-top: 0; padding-top: 2px; }
.owner-opt.om-cur { grid-column: 1 / -1; flex-direction: row; align-items: center; gap: 8px; background: #f7f9ff; }
.owner-opt.om-cur .role { margin-left: auto; }
