:root {
  --bg:           #fafafa;
  --bg-elevated:  #ffffff;
  --bg-hover:     #f5f6f8;
  --bg-active:    #eef1f6;
  --sidebar-bg:   #ffffff;
  --sidebar-w:    64px;
  --topbar-h:     56px;
  --content-pad:  24px;

  --border:       #e5e7eb;
  --border-strong:#d1d5db;
  --divider:      #f0f1f3;

  --text:         #111827;
  --text-sec:     #4b5563;
  --text-tert:    #9ca3af;
  --text-disabled:#c0c4cc;

  --primary:      #2563eb;
  --primary-hover:#1d4ed8;
  --primary-light:#eff6ff;
  --primary-100:  #dbeafe;

  --success:      #16a34a;
  --success-light:#f0fdf4;
  --warning:      #d97706;
  --warning-light:#fffbeb;
  --danger:       #dc2626;
  --danger-light: #fef2f2;

  --radius-sm:    4px;
  --radius:       6px;
  --radius-md:    8px;
  --radius-lg:    12px;

  --shadow-sm:    0 1px 2px rgba(0,0,0,0.04);
  --shadow:       0 1px 3px rgba(0,0,0,0.06), 0 1px 2px rgba(0,0,0,0.04);
  --shadow-md:    0 4px 12px rgba(0,0,0,0.08);
  --shadow-lg:    0 10px 24px rgba(0,0,0,0.12);

  --font-sans:    -apple-system, BlinkMacSystemFont, 'Segoe UI', 'PingFang SC', 'Hiragino Sans GB', 'Microsoft YaHei', 'Helvetica Neue', Helvetica, Arial, sans-serif;
  --font-mono:    'SF Mono', 'Cascadia Code', 'JetBrains Mono', 'Fira Code', Consolas, 'Courier New', monospace;

  --transition:   all 0.15s cubic-bezier(0.4,0,0.2,1);
}

*,*::before,*::after { box-sizing: border-box; margin: 0; padding: 0; }
html { -webkit-text-size-adjust: 100%; -webkit-font-smoothing: antialiased; text-rendering: optimizeLegibility; }
body {
  font-family: var(--font-sans);
  font-size: 15px;
  line-height: 1.6;
  background: var(--bg);
  color: var(--text);
  overflow: hidden;
  height: 100vh;
}
::selection { background: var(--primary-100); color: var(--primary); }
a { color: inherit; text-decoration: none; }
button, input, select, textarea { font: inherit; color: inherit; border: none; background: none; outline: none; }
svg { display: block; }
.mono { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }
.num { font-family: var(--font-mono); font-variant-numeric: tabular-nums; }

::-webkit-scrollbar { width: 6px; height: 6px; }
::-webkit-scrollbar-track { background: transparent; }
::-webkit-scrollbar-thumb { background: #d1d5db; border-radius: 3px; }
::-webkit-scrollbar-thumb:hover { background: #9ca3af; }

.app { display: flex; height: 100vh; }

.sidebar {
  width: var(--sidebar-w);
  background: var(--sidebar-bg);
  border-right: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  z-index: 100;
  flex-shrink: 0;
}
.sidebar-brand {
  height: var(--topbar-h);
  display: flex;
  align-items: center;
  justify-content: center;
  border-bottom: 1px solid var(--border);
  flex-shrink: 0;
}
.sidebar-brand .logo-mark {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: var(--radius);
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 700;
  font-size: 16px;
}
.sidebar-nav {
  flex: 1;
  padding: 12px 8px;
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-nav .nav-item {
  display: flex;
  flex-direction: column;
  align-items: center;
  justify-content: center;
  gap: 4px;
  height: 56px;
  border-radius: var(--radius);
  color: var(--text-tert);
  cursor: pointer;
  transition: var(--transition);
  font-size: 11px;
  font-weight: 500;
  position: relative;
  text-decoration: none;
  letter-spacing: 0.02em;
}
.sidebar-nav .nav-item:hover {
  background: var(--bg-hover);
  color: var(--text-sec);
}
.sidebar-nav .nav-item.on {
  background: var(--primary-light);
  color: var(--primary);
}
.sidebar-nav .nav-item .nav-icon {
  font-size: 20px;
  line-height: 1;
}
.sidebar-footer {
  padding: 8px;
  border-top: 1px solid var(--border);
  display: flex;
  flex-direction: column;
  gap: 4px;
}
.sidebar-footer .user-avatar {
  width: 36px;
  height: 36px;
  background: var(--primary);
  border-radius: 50%;
  color: #fff;
  display: flex;
  align-items: center;
  justify-content: center;
  font-weight: 600;
  font-size: 14px;
  margin: 4px auto;
  cursor: pointer;
  transition: var(--transition);
}
.sidebar-footer .user-avatar:hover { background: var(--primary-hover); }
.mob-nav { display: none; }

.main {
  flex: 1;
  display: flex;
  flex-direction: column;
  min-width: 0;
  overflow: hidden;
}
.topbar {
  height: var(--topbar-h);
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--border);
  display: flex;
  align-items: center;
  padding: 0 var(--content-pad);
  gap: 16px;
  flex-shrink: 0;
}
.topbar-title {
  font-size: 22px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: 0.01em;
}
.topbar-title .breadcrumb {
  color: var(--text-tert);
  font-weight: 400;
}
.topbar-title .topbar-breadcrumb {
  color: var(--text-tert);
  font-weight: 400;
  margin: 0 2px;
}
.topbar-title .topbar-project-name {
  font-weight: 500;
  color: var(--text);
  font-size: 14px;
}
.admin-visit-badge {
  display: inline-flex;
  align-items: center;
  font-size: 10px;
  font-weight: 600;
  color: #fff;
  background: #dc2626;
  padding: 1px 6px;
  border-radius: 3px;
  margin-left: 6px;
  letter-spacing: 0.02em;
  vertical-align: middle;
}
.topbar-actions {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 8px;
}

/* topbar 账号按钮 */
.topbar-account {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  padding: 4px 10px 4px 4px !important;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: var(--transition);
}
.topbar-account:hover {
  border-color: var(--primary);
  background: var(--primary-light);
}
.ta-avatar {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.ta-info {
  display: flex;
  flex-direction: column;
  line-height: 1.2;
  text-align: left;
}
.ta-name {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  max-width: 120px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ta-role {
  font-size: 10px;
  color: var(--text-tert);
}
.page {
  flex: 1;
  overflow: auto;
  padding: var(--content-pad);
}

.btn {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  gap: 6px;
  padding: 8px 18px;
  font-size: 14px;
  font-weight: 500;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  color: var(--text);
  border-radius: var(--radius);
  cursor: pointer;
  white-space: nowrap;
  transition: var(--transition);
  line-height: 1.4;
  letter-spacing: 0.01em;
}
.btn:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.btn:active { background: var(--bg-active); }
.btn-primary {
  background: var(--primary);
  border-color: var(--primary);
  color: #fff;
}
.btn-primary:hover { background: var(--primary-hover); border-color: var(--primary-hover); }
.btn-danger {
  background: var(--danger);
  border-color: var(--danger);
  color: #fff;
}
.btn-danger:hover { opacity: 0.9; }
.btn-ghost { border-color: transparent; background: transparent; color: var(--text-sec); }
.btn-ghost:hover { background: var(--bg-hover); border-color: transparent; color: var(--text); }
.btn-sm { padding: 5px 12px; font-size: 13px; letter-spacing: 0.01em; }
.btn-icon { width: 34px; height: 34px; padding: 0; border-radius: var(--radius); }

.input {
  width: 100%;
  padding: 9px 14px;
  font-size: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elevated);
  border-radius: var(--radius);
  transition: var(--transition);
  color: var(--text);
}
.input:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.input::placeholder { color: var(--text-tert); }
.fld { margin-bottom: 18px; }
.fld label {
  display: block;
  font-size: 13px;
  font-weight: 500;
  color: var(--text-sec);
  margin-bottom: 6px;
}
.fld-row { display: flex; gap: 14px; }
.fld-row .fld { flex: 1; }

.select {
  padding: 8px 30px 8px 14px;
  font-size: 14px;
  border: 1px solid var(--border);
  background: var(--bg-elevated) url("data:image/svg+xml,%3Csvg xmlns='http://www.w3.org/2000/svg' width='12' height='12' viewBox='0 0 12 12'%3E%3Cpath d='M2 4l4 4 4-4' stroke='%236b7280' stroke-width='1.5' fill='none' stroke-linecap='round'/%3E%3C/svg%3E") no-repeat right 10px center;
  border-radius: var(--radius);
  cursor: pointer;
  appearance: none;
  color: var(--text);
  transition: var(--transition);
}
.select:focus { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }

.search-box {
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  transition: var(--transition);
  min-width: 240px;
}
.search-box:focus-within { border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.search-box input { flex: 1; font-size: 14px; }
.search-box input::placeholder { color: var(--text-tert); }
.search-icon { color: var(--text-tert); font-size: 15px; line-height: 1; }

.toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 20px;
  flex-wrap: wrap;
}
.toolbar .search-box { flex: 0 1 280px; min-width: 200px; }
.filter-sel {
  height: 36px; padding: 0 28px 0 12px; border: 1px solid var(--border);
  border-radius: var(--radius); background: var(--bg-elevated);
  font-size: 14px; color: var(--text); cursor: pointer;
  min-width: 90px;
}
.filter-sel:focus { outline: none; border-color: var(--primary); box-shadow: 0 0 0 3px rgba(37,99,235,0.1); }
.filter-group-wrap {
  display: flex;
  align-items: center;
}
.filter-group-wrap .filter-sel {
  border-top-right-radius: 0;
  border-bottom-right-radius: 0;
  border-right: none;
}
.filter-group-wrap .btn-icon {
  width: 36px;
  height: 36px;
  border: 1px solid var(--border);
  border-radius: 0 var(--radius) var(--radius) 0;
  background: var(--bg-elevated);
  font-size: 16px;
  font-weight: 500;
  display: inline-flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  color: var(--text-sec);
}
.filter-group-wrap .btn-icon:first-of-type {
  border-radius: 0;
  border-right: none;
}
.filter-group-wrap .btn-icon:hover {
  background: var(--bg-hover);
  border-color: var(--border-strong);
  color: var(--text);
  z-index: 1;
}

.toolbar-spacer { flex: 1; }

/* ── 清单页工作台标题 ── */
.checklist-page {
  display: flex;
  flex-direction: column;
  height: 100%;
  min-height: 0;
  overflow: hidden;
}
.cl-worktop {
  display: flex;
  flex-wrap: wrap;
  align-items: flex-end;
  gap: 12px 24px;
  margin-bottom: 16px;
}
.cl-worktop .cl-title-bar { flex: 1 1 200px; min-width: 0; }
.cl-worktop .stats-row { flex: 0 0 auto; }
.cl-worktop .cl-progress-row { flex: 1 1 100%; }
.cl-title-bar { min-width: 0; }
.cl-title-wrap {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  max-width: 100%;
}
.cl-title {
  display: block;
  max-width: 100%;
  font-size: 24px;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  color: var(--text);
  cursor: pointer;
  padding: 4px 8px;
  margin-left: -8px;
  border-radius: var(--radius);
  transition: background 0.15s;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.cl-title:hover { background: var(--bg-hover); }
.cl-title-input {
  max-width: min(760px, calc(100vw - var(--sidebar-w) - var(--content-pad) * 2 - 32px));
  min-width: 260px;
  width: auto;
  font-size: 24px !important;
  font-weight: 700;
  line-height: 1.25;
  letter-spacing: 0;
  text-align: left;
  border: 1.5px solid var(--primary);
  background: #fff;
  padding: 5px 10px;
  border-radius: var(--radius);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
  outline: none;
  color: var(--text);
  font-family: inherit;
}
.cl-title-hint { font-size: 12px; color: var(--text-tert); margin-top: 2px; }

.tabs {
  display: inline-flex;
  background: var(--bg-hover);
  border-radius: var(--radius);
  padding: 3px;
  gap: 2px;
}
.tabs button {
  padding: 7px 16px;
  font-size: 13px;
  font-weight: 500;
  border-radius: 4px;
  color: var(--text-sec);
  cursor: pointer;
  transition: var(--transition);
}
.tabs button:hover { color: var(--text); }
.tabs button.on { background: var(--bg-elevated); color: var(--text); box-shadow: var(--shadow-sm); }

.table-wrap {
  flex: 1 1 auto;
  min-height: 0;
  background: var(--bg-elevated);
  border: 1px solid #d8e0ea;
  border-radius: var(--radius);
  overflow-x: auto;
  overflow-y: auto;
  max-height: none;
  box-shadow: 0 1px 2px rgba(15, 23, 42, 0.04);
}
.sheet-tabs {
  flex: 0 0 auto;
  display: flex;
  align-items: center;
  gap: 6px;
  min-height: 36px;
  padding: 5px 8px 0;
  overflow: hidden;
}
.sheet-tab-scroll {
  display: flex;
  align-items: center;
  gap: 4px;
  min-width: 0;
  max-width: min(620px, 100%);
  overflow-x: auto;
  scrollbar-width: thin;
}
.sheet-tab {
  height: 30px;
  max-width: 160px;
  padding: 0 14px;
  border: 1px solid #cbd5e1;
  border-bottom-color: #94a3b8;
  border-radius: 7px 7px 2px 2px;
  background: #f8fafc;
  color: #475569;
  font-size: 13px;
  cursor: pointer;
  white-space: nowrap;
}
.sheet-tab span {
  display: block;
  overflow: hidden;
  text-overflow: ellipsis;
}
.sheet-tab:hover { border-color: var(--primary); color: var(--primary); background: #eff6ff; }
.sheet-tab.on {
  background: #ffffff;
  color: #0f172a;
  border-color: var(--primary);
  border-bottom-color: #ffffff;
  font-weight: 600;
}
.sheet-tab-add,
.sheet-tab-tool {
  height: 28px;
  padding: 0 10px;
  border: 1px solid #cbd5e1;
  border-radius: 6px;
  background: #fff;
  color: #475569;
  font-size: 12px;
  cursor: pointer;
}
.sheet-tab-add { width: 30px; padding: 0; font-size: 18px; line-height: 1; }
.sheet-tab-add:hover,
.sheet-tab-tool:hover { border-color: var(--primary); color: var(--primary); background: #eff6ff; }
.sheet-tab-tool.danger { color: #dc2626; }
.sheet-tab-tool:disabled { opacity: .45; cursor: not-allowed; background: #f8fafc; color: #94a3b8; border-color: #e2e8f0; }
.ledger {
  width: 100%;
  min-width: 100%;
  border-collapse: separate;
  border-spacing: 0;
  background: #fff;
  color: #172033;
  font-size: 14px;
}
.ledger thead th {
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: #475569;
  padding: 0;
  border-bottom: 1px solid #cbd5e1;
  background: linear-gradient(180deg,#f8fafc 0%,#eef3f8 100%);
  white-space: nowrap;
  position: sticky;
  top: 0;
  z-index: 6;
  letter-spacing: 0;
  user-select: none;
}
.ledger thead th .th-inner {
  display: flex;
  align-items: center;
  gap: 6px;
  position: relative;
  padding: 10px 10px 8px 14px;
  overflow: hidden;
  min-height: 36px;
}
.ledger thead th .th-title {
  flex: 1 1 auto;
  min-width: 0;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.ledger thead th.th-sorted .th-inner {
  color: var(--primary);
  background: var(--primary-100);
}
.th-sort-mark {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 14px;
  min-width: 14px;
  color: var(--primary);
  font-size: 10px;
  line-height: 1;
}
.ledger thead th.r, .ledger td.r { text-align: right; }
.ledger .col-resizer {
  position: absolute;
  right: 0;
  top: 0;
  bottom: 0;
  width: 6px;
  cursor: col-resize;
  z-index: 2;
}
.ledger .col-resizer:hover,
.ledger .col-resizer.active {
  background: var(--primary);
  opacity: 0.4;
}
.col-resize-guide {
  position: fixed;
  width: 2px;
  background: var(--primary);
  box-shadow: 0 0 0 1px rgba(37,99,235,0.18);
  z-index: 390;
  pointer-events: none;
  display: none;
}
.ledger tbody td {
  padding: 10px 14px;
  border-bottom: 1px solid #e1e7ef;
  vertical-align: middle;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
  line-height: 1.45;
}
.ledger thead th + th,
.ledger tbody td + td,
.ledger tfoot td + td {
  border-left: 1px solid #edf1f6;
}
.ledger tbody tr:nth-child(even):not(.qa-row) td {
  background: #fbfdff;
}
.ledger.row-compact tbody td { padding: 7px 16px; }
.ledger.row-compact thead th .th-inner { padding: 8px 9px 6px 14px; min-height: 32px; }
.ledger.row-loose tbody td { padding: 16px; }
.ledger.row-loose thead th .th-inner { padding: 13px 10px 10px 14px; min-height: 42px; }
.ledger tbody tr { transition: background 0.1s; }
.ledger tbody tr:hover td { background: #eef6ff; }
.ledger .c-idx { color: var(--text-tert); font-size: 13px; font-family: var(--font-mono); }
.ledger .c-name { font-weight: 500; }
.ledger .cell-text {
  white-space: pre-wrap;
  overflow-wrap: anywhere;
  word-break: break-word;
}
.ledger .c-name .spec { font-weight: 400; color: var(--text-tert); font-size: 13px; margin-top: 2px; }
.ledger .amt { font-family: var(--font-mono); font-weight: 600; }
.ledger .row-act { opacity: 0; transition: opacity 0.1s; text-align: right; white-space: nowrap; }
.ledger tr:hover .row-act { opacity: 1; }
.ledger .row-act button {
  color: var(--text-tert);
  cursor: pointer;
  font-size: 13px;
  padding: 4px 10px;
  border-radius: 4px;
  transition: var(--transition);
  font-weight: 500;
}
.ledger .row-act button:hover { background: var(--bg-active); color: var(--text); }
.ledger .row-act .btn-del:hover { color: var(--danger); background: var(--danger-light); }
.ledger tfoot td {
  padding: 12px 16px;
  border-top: 1px solid var(--border);
  font-weight: 600;
  background: var(--bg-elevated);
}
.ledger tfoot .lbl { font-size: 13px; color: var(--text-tert); font-weight: 500; }
.ledger input.cell, .ledger select.cell, .ledger textarea.cell {
  width: 100%;
  border: 1px solid transparent;
  background: transparent;
  padding: 6px 8px;
  font-size: 14px;
  border-radius: 4px;
  margin: -2px;
  transition: var(--transition);
}
.ledger input.cell.num { font-family: var(--font-mono); text-align: right; }
.ledger input.cell:focus, .ledger select.cell:focus, .ledger textarea.cell:focus {
  border-color: var(--primary);
  background: var(--bg-elevated);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.1);
}
.ledger textarea.cell {
  display: block;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  line-height: 1.45;
}

.qa-row { background: var(--danger-light) !important; }
.qa-row td { padding: 11px 16px; border-bottom: 1px solid #fecaca; }
tr.empty-hint td { text-align: center; color: var(--text-tert); padding: 60px 20px; font-size: 14px; }

/* ── 行状态高亮 ── */
tr.row-doing { background: #fffbeb !important; }
tr.row-doing td { background: #fffbeb !important; border-bottom-color: #fde68a; }
tr.row-done { background: #f9fafb !important; }
tr.row-done td { color: #9ca3af; border-bottom-color: #f3f4f6; }
tr.row-done .c-name { color: #6b7280; }
tr.row-done .c-name .spec { color: #9ca3af; }

/* ── 行颜色高亮（红 / 黄 / 绿 三正色，右键标记） ── */
tr.hl-red    td { background: #ffcccc !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
tr.hl-yellow td { background: #ffff99 !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }
tr.hl-green  td { background: #ccffcc !important; -webkit-print-color-adjust: exact; print-color-adjust: exact; }

/* ── 右键上下文菜单 ── */
.ctx-menu {
  position: fixed; z-index: 400; min-width: 168px;
  background: #fff; border: 1px solid var(--border);
  border-radius: 8px; box-shadow: 0 6px 24px rgba(0,0,0,0.14);
  padding: 5px; font-size: 14px; user-select: none;
}
.ctx-menu .ctx-item {
  display: flex; align-items: center; gap: 9px;
  padding: 8px 12px; border-radius: 5px; cursor: pointer;
  color: var(--text); white-space: nowrap;
}
.ctx-menu .ctx-item:hover { background: var(--bg-hover); }
.ctx-menu .ctx-item.on { background: var(--primary-light); color: var(--primary); font-weight: 600; }
.ctx-menu .ctx-item.danger { color: var(--danger); }
.ctx-menu .ctx-sep { height: 1px; background: var(--divider); margin: 5px 0; }
.ctx-menu .ctx-label { font-size: 12px; color: var(--text-tert); padding: 4px 12px 2px; }
.ctx-menu .ctx-colors { display: flex; gap: 8px; padding: 6px 12px 8px; }
.ctx-menu .ctx-swatch {
  width: 22px; height: 22px; border-radius: 50%;
  border: 2px solid rgba(0,0,0,0.08); cursor: pointer; transition: transform 0.1s;
}
.ctx-menu .ctx-swatch:hover { transform: scale(1.2); }
.ctx-menu .ctx-swatch.on { border-color: var(--text); box-shadow: 0 0 0 2px #fff,0 0 0 4px var(--text); }
.ctx-menu .ctx-swatch.clear {
  background: #fff; display: flex; align-items: center; justify-content: center;
  font-size: 13px; color: var(--text-tert);
}

/* ── 单元格点击编辑 ── */
.ledger td.editable { cursor: text; }
.ledger td.editable:hover { box-shadow: inset 0 0 0 1px #bfdbfe; }
.ledger td.cell-editing,
.ledger td.cell-editing:hover {
  padding: 0 !important;
  background: #fff !important;
  box-shadow: inset 0 0 0 2px var(--primary) !important;
}
.ledger td .cell-input {
  width: 100%;
  box-sizing: border-box;
  margin: 0;
  border: 0;
  background: transparent;
  padding: 9px 12px;
  font: inherit;
  border-radius: 0;
  box-shadow: none;
  outline: none;
  line-height: 1.45;
}
.ledger td .cell-textarea {
  display: block;
  min-height: 40px;
  resize: none;
  overflow: hidden;
  white-space: pre-wrap;
  word-break: break-word;
}

/* ── 状态徽章（可点击推进） ── */
.status-chip {
  display: inline-flex; align-items: center; gap: 4px;
  padding: 3px 12px; border-radius: 10px;
  font-size: 12px; font-weight: 500; cursor: pointer;
  transition: all 0.15s; user-select: none;
  border: 1px solid transparent;
}
.status-chip.pending { background: #f3f4f6; color: #6b7280; border-color: #e5e7eb; }
.status-chip.doing { background: #fef3c7; color: #b45309; border-color: #f59e0b; }
.status-chip.done { background: #d1fae5; color: #059669; border-color: #34d399; }
.status-chip:hover { filter: brightness(0.95); }
.status-chip:active { transform: scale(0.95); }

/* ── 自定义状态列（可配置状态选项） ── */
.status-chip.custom-status {
  background: var(--bg-hover);
  color: var(--text-sec);
  border-color: var(--border);
}
.status-chip.custom-status:hover { filter: brightness(0.95); }
.status-chip.custom-status:active { transform: scale(0.95); }

/* ── 复选框列 ── */
.checkbox-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 22px;
  height: 22px;
  border: 2px solid var(--border-strong);
  border-radius: 4px;
  cursor: pointer;
  font-size: 14px;
  font-weight: 700;
  color: var(--text-tert);
  transition: var(--transition);
  background: var(--bg-elevated);
}
.checkbox-icon.checked {
  border-color: var(--success);
  background: var(--success);
  color: #fff;
}
.checkbox-icon:hover { border-color: var(--primary); }
.checkbox-icon.checked:hover { filter: brightness(0.9); }

/* ── 下拉选择列 ── */
.select-badge {
  display: inline-flex;
  align-items: center;
  padding: 3px 10px;
  border-radius: 6px;
  font-size: 12px;
  font-weight: 500;
  background: var(--bg-hover);
  color: var(--text-sec);
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid var(--border);
}
.select-badge:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.cell-select {
  width: 100%;
  padding: 4px 8px;
  border: 1px solid var(--primary);
  border-radius: 4px;
  font-size: 13px;
  background: var(--bg-elevated);
  color: var(--text);
  cursor: pointer;
}

/* ── 分组色点 ── */
.grp-dot {
  display: inline-block; width: 8px; height: 8px; border-radius: 50%;
  margin-right: 4px; vertical-align: middle; flex-shrink: 0;
}

.dot { display: inline-block; width: 8px; height: 8px; border-radius: 50%; margin-right: 6px; vertical-align: middle; }
.dot.pending { background: var(--border-strong); }
.dot.doing { background: var(--warning); }
.dot.done { background: var(--success); }

.status-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  font-size: 11px;
  font-weight: 500;
  border-radius: 10px;
  line-height: 1.6;
}
.status-pending { background: var(--bg-hover); color: var(--text-sec); }
.status-doing { background: var(--warning-light); color: var(--warning); }
.status-done { background: var(--success-light); color: var(--success); }

.modal-mask {
  position: fixed; inset: 0;
  background: rgba(0,0,0,0.4);
  display: none;
  align-items: center;
  justify-content: center;
  z-index: 200;
  padding: 24px;
  backdrop-filter: blur(2px);
}
.modal-mask.show { display: flex; }
.modal {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  width: 100%;
  max-width: 480px;
  max-height: 90vh;
  overflow: auto;
  box-shadow: var(--shadow-lg);
  animation: modalIn 0.15s ease;
}
@keyframes modalIn { from { opacity: 0; transform: scale(0.97) translateY(8px); } to { opacity: 1; transform: scale(1) translateY(0); } }
.modal-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px;
  border-bottom: 1px solid var(--border);
}
.modal-head h3 { font-size: 16px; font-weight: 600; }
.modal-head .x {
  width: 32px; height: 32px;
  border-radius: var(--radius);
  font-size: 20px;
  cursor: pointer;
  display: flex; align-items: center; justify-content: center;
  color: var(--text-tert);
  transition: var(--transition);
}
.modal-head .x:hover { background: var(--bg-hover); color: var(--text); }
.modal-body { padding: 24px; }
.modal-foot {
  display: flex; gap: 10px; justify-content: flex-end;
  padding: 14px 24px;
  border-top: 1px solid var(--border);
}
#taskModal .modal {
  width: min(680px, calc(100vw - 24px)) !important;
  max-height: calc(100vh - 32px);
  display: flex;
  flex-direction: column;
  overflow: hidden;
}
#taskModal .modal-body {
  overflow-y: auto;
  min-height: 0;
  padding: 18px 22px;
}
#taskModal .modal-foot {
  flex-shrink: 0;
  flex-wrap: wrap;
}
#taskModal .fld { margin-bottom: 12px; }
#taskModal .fld-row { gap: 12px; }
#taskModal textarea.input { min-height: 72px; }
.task-modal-section {
  padding: 14px 16px 2px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: var(--bg-elevated);
  margin-bottom: 12px;
}
.task-modal-section-title {
  font-size: 12px;
  font-weight: 700;
  color: var(--text);
  margin-bottom: 12px;
}
.task-modal-section-tools { padding-bottom: 12px; }
.topo-template-modal { max-width: 840px; }
.topo-template-modal .modal-body { padding: 18px 20px 20px; }
.tpl-grid {
  display: grid;
  grid-template-columns: repeat(auto-fit, minmax(200px, 1fr));
  gap: 12px;
}
.tpl-card {
  display: flex;
  flex-direction: column;
  align-items: flex-start;
  gap: 6px;
  min-width: 0;
  padding: 14px 14px 13px;
  border: 1px solid var(--border);
  border-radius: 10px;
  background: var(--bg-elevated);
  cursor: pointer;
  transition: var(--transition);
  text-align: left;
}
.tpl-card:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  transform: translateY(-1px);
  box-shadow: var(--shadow-sm);
}
.tpl-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
}
.tpl-desc {
  font-size: 12px;
  color: var(--text-sec);
  line-height: 1.45;
}
.tpl-meta {
  font-size: 11px;
  color: var(--text-tert);
}
.color-dots { display: flex; gap: 8px; flex-wrap: wrap; }
.color-dot {
  width: 28px; height: 28px;
  border-radius: 50%;
  cursor: pointer;
  border: 2px solid transparent;
  transition: var(--transition);
}
.color-dot:hover { transform: scale(1.1); }
.color-dot.selected { border-color: var(--text); box-shadow: 0 0 0 2px #fff, 0 0 0 4px var(--text); }

#toast {
  position: fixed; top: 20px; left: 50%; transform: translateX(-50%);
  z-index: 300; display: flex; flex-direction: column; gap: 8px; align-items: center;
  pointer-events: none;
}
.toast-item {
  background: var(--text); color: #fff;
  padding: 11px 20px; border-radius: var(--radius);
  font-size: 14px; font-weight: 500;
  box-shadow: var(--shadow-md);
  pointer-events: auto;
  animation: toastIn 0.2s ease;
}
.toast-item.err { background: var(--danger); }
@keyframes toastIn { from { opacity: 0; transform: translateY(-12px); } to { opacity: 1; transform: translateY(0); } }

.stage-wrap {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
}
.stage-tools {
  display: flex; align-items: center; gap: 4px;
  padding: 8px 12px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-elevated);
  flex-wrap: wrap;
}
.stage-tools .tool-group { display: flex; gap: 2px; margin-right: 12px; }
.stage-tools button {
  padding: 6px 12px;
  font-size: 12px; font-weight: 500;
  border-radius: var(--radius-sm);
  color: var(--text-sec); cursor: pointer; transition: var(--transition);
}
.stage-tools button:hover { background: var(--bg-hover); color: var(--text); }
.stage-tools button.on { background: var(--primary-light); color: var(--primary); }
.stage-tools .sp { flex: 1; }
canvas { display: block; }
.hint-foot {
  font-size: 13px; color: var(--text-tert);
  margin-top: 14px; line-height: 1.7;
  padding: 12px 16px;
  background: var(--bg-hover);
  border-radius: var(--radius);
  border-left: 3px solid var(--primary);
}

.canvas-stage {
  position: relative;
  height: calc(100vh - var(--topbar-h) - var(--content-pad) * 2 - 60px);
  min-height: 400px;
  overflow: hidden;
  background: var(--bg-elevated);
}
.float-tools {
  position: absolute; z-index: 20;
  display: flex; background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  box-shadow: var(--shadow-md);
  overflow: hidden;
}
.float-tools.tl { top: 12px; left: 12px; flex-direction: column; }
.float-tools.bc { bottom: 12px; left: 50%; transform: translateX(-50%); }
.float-tools .ft-cap {
  font-size: 11px; font-weight: 600;
  color: var(--text-tert); text-transform: uppercase;
  letter-spacing: 0.05em; padding: 8px 14px 4px;
}
.ftool {
  display: flex; align-items: center; gap: 8px;
  padding: 9px 16px; font-size: 13px;
  color: var(--text-sec); cursor: pointer; transition: var(--transition);
  border: none; background: none; white-space: nowrap;
}
.float-tools.tl .ftool { justify-content: flex-start; }
.float-tools.tl .ftool + .ftool { border-top: 1px solid var(--divider); }
.float-tools.bc .ftool { border-right: 1px solid var(--divider); }
.float-tools.bc .ftool:last-child { border-right: none; }
.ftool:hover { background: var(--bg-hover); color: var(--text); }
.ftool.on { background: var(--primary-light); color: var(--primary); }
.ftool-dot { width: 12px; height: 12px; border: 2px solid currentColor; flex-shrink: 0; border-radius: 2px; }
.topo-action-btn {
  display: flex; align-items: center; justify-content: center; gap: 4px;
  width: 100%; padding: 7px 12px; font-size: 12px; font-weight: 500;
  border: 1px solid var(--border); border-radius: var(--radius);
  background: var(--bg-elevated); color: var(--text-sec);
  cursor: pointer; transition: var(--transition);
  line-height: 1.3;
}
.topo-action-btn:hover { border-color: var(--border-strong); background: var(--bg-hover); }
.topo-action-btn.danger { color: #dc2626; border-color: #fecaca; background: #fef2f2; }
.topo-action-btn.danger:hover { background: #fee2e2; border-color: #fca5a5; }
.topo-search {
  position: absolute;
  top: 12px;
  right: 12px;
  z-index: 12;
  display: flex;
  gap: 6px;
  padding: 6px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,.94);
  box-shadow: var(--shadow-sm);
}
.topo-search input {
  width: 150px;
  padding: 6px 8px;
  border: 1px solid var(--border);
  border-radius: 6px;
  background: #fff;
  font-size: 12px;
}
.topo-search button {
  padding: 6px 9px;
  border-radius: 6px;
  background: var(--primary);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}
.topo-align-menu {
  position: fixed;
  z-index: 500;
}
.topo-context-menu {
  z-index: 520;
}
.ctx-menu .ctx-item.disabled {
  color: var(--text-tert);
  cursor: not-allowed;
  opacity: .55;
}
.ctx-menu .ctx-item.disabled:hover {
  background: transparent;
}
.topo-minimap {
  position: absolute;
  right: 12px;
  bottom: 40px;
  z-index: 11;
  width: 150px;
  height: 100px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: rgba(255,255,255,.96);
  box-shadow: var(--shadow-sm);
  cursor: pointer;
  opacity: .82;
  transition: opacity .15s;
}
.topo-minimap:hover {
  opacity: 1;
}
.topo-import-modal {
  max-width: 720px;
}
.topo-import-modal .modal-body {
  padding: 18px 22px 20px;
}
.import-help {
  display: grid;
  gap: 5px;
  margin-bottom: 12px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
}
.import-help strong {
  font-size: 13px;
  color: var(--text);
}
.import-help span {
  font-size: 12px;
  line-height: 1.45;
  color: var(--text-sec);
}
.topo-import-text {
  width: 100%;
  min-height: 260px;
  resize: vertical;
  padding: 11px 12px;
  border: 1px solid var(--border);
  border-radius: 8px;
  outline: none;
  font: 13px/1.55 var(--font-mono);
  color: var(--text);
  background: #fff;
}
.topo-import-text:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px rgba(37,99,235,0.12);
}
.topo-import-file {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 10px;
  padding: 8px 10px;
  border: 1px dashed var(--border);
  border-radius: 8px;
  background: #fff;
  font-size: 12px;
  color: var(--text-sec);
}
.topo-import-file input {
  flex: 1;
  min-width: 0;
  font-size: 12px;
}
.topo-import-option {
  display: inline-flex;
  align-items: center;
  gap: 7px;
  margin-top: 10px;
  font-size: 13px;
  color: var(--text-sec);
  user-select: none;
}

.float-props {
  position: absolute; top: 12px; right: 12px; z-index: 20;
  width: 220px; background: var(--bg-elevated);
  border: 1px solid var(--border); border-radius: var(--radius);
  box-shadow: var(--shadow-md); overflow: hidden;
}
.fp-head {
  font-size: 12px; font-weight: 600;
  color: var(--text-tert); text-transform: uppercase;
  letter-spacing: 0.04em; padding: 12px 16px;
  border-bottom: 1px solid var(--border);
  background: var(--bg);
}
.fp-body { padding: 14px 16px; }
.fp-empty { font-size: 13px; color: var(--text-tert); padding: 20px 0; text-align: center; }
.frow { margin-bottom: 14px; }
.frow:last-child { margin-bottom: 0; }
.frow label { display: block; font-size: 12px; font-weight: 500; color: var(--text-tert); margin-bottom: 4px; }
.frow .input { padding: 6px 8px; font-size: 12px; }
.fp-value {
  padding: 7px 9px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  color: var(--text-sec);
  font-size: 12px;
  line-height: 1.35;
  word-break: break-word;
}
.fp-summary {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.fp-summary div {
  border: 1px solid var(--border);
  border-radius: 8px;
  background: #f8fafc;
  padding: 9px 8px;
}
.fp-summary strong {
  display: block;
  font-size: 18px;
  line-height: 1;
  color: var(--text);
}
.fp-summary span {
  display: block;
  margin-top: 4px;
  font-size: 11px;
  color: var(--text-tert);
}
.fp-tags {
  display: flex;
  flex-wrap: wrap;
  gap: 5px;
  margin-top: 8px;
}
.fp-tags span {
  max-width: 100%;
  padding: 4px 7px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 11px;
  line-height: 1.2;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fp-chip-wrap {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.fp-chip {
  min-width: 0;
  max-width: 100%;
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-sec);
  font-size: 12px;
  line-height: 1.2;
  cursor: pointer;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.fp-chip:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.fp-muted {
  font-size: 12px;
  color: var(--text-tert);
}
.fp-actions {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 8px;
}
.fp-btn {
  min-width: 0;
  padding: 7px 8px;
  border: 1px solid var(--border);
  border-radius: 7px;
  background: var(--bg-elevated);
  color: var(--text-sec);
  font-size: 12px;
  cursor: pointer;
  transition: var(--transition);
}
.fp-btn:hover {
  border-color: var(--primary);
  background: var(--primary-light);
  color: var(--primary);
}
.topo-type-picker {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 6px;
}
.topo-type-picker button {
  min-width: 0;
  white-space: nowrap;
}
.relation-picker {
  display: flex;
  flex-wrap: wrap;
  gap: 6px;
}
.relation-picker button {
  padding: 5px 8px;
  border: 1px solid var(--border);
  border-radius: 999px;
  background: var(--bg-elevated);
  color: var(--text-sec);
  font-size: 12px;
  cursor: pointer;
  line-height: 1.2;
}
.relation-picker button:hover {
  border-color: var(--primary);
  color: var(--primary);
  background: var(--primary-light);
}
.relation-picker button.active {
  border-color: var(--primary);
  background: var(--primary);
  color: #fff;
}

.login-wrap {
  min-height: 100vh; display: flex;
  align-items: center; justify-content: center;
  background: linear-gradient(135deg, #f8fafc 0%, #eef2f7 100%);
  padding: 24px;
}
.login-card {
  background: var(--bg-elevated);
  border-radius: var(--radius-lg);
  width: 100%; max-width: 400px;
  padding: 44px 40px;
  box-shadow: var(--shadow-lg);
}
.login-card .lc-brand {
  display: flex; align-items: center; gap: 12px;
  margin-bottom: 32px;
}
.login-card .lc-brand .logo-mark {
  width: 44px; height: 44px;
  background: var(--primary); border-radius: var(--radius);
  color: #fff; display: flex; align-items: center; justify-content: center;
  font-weight: 700; font-size: 20px;
}
.login-card .lc-brand .lc-name { font-size: 20px; font-weight: 700; }
.login-card h2 { font-size: 24px; font-weight: 700; margin-bottom: 6px; }
.login-card .lead { font-size: 14px; color: var(--text-tert); margin-bottom: 32px; }
.login-card .btn { width: 100%; margin-top: 10px; height: 44px; font-size: 15px; }
.login-err { color: var(--danger); font-size: 13px; margin-bottom: 12px; min-height: 18px; font-weight: 500; }
.login-hint {
  margin-top: 28px; padding-top: 22px;
  border-top: 1px solid var(--border);
  font-size: 13px; color: var(--text-tert); text-align: center;
}

/* ── Dashboard Hero ── */
.dash-hero {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 20px;
}
.dash-hero__title {
  font-size: 20px;
  font-weight: 700;
  letter-spacing: -0.02em;
  margin: 0 0 2px 0;
  color: var(--text);
}
.dash-hero__sub {
  font-size: 13px;
  color: var(--text-tert);
  margin: 0;
}
.dash-hero__stats {
  display: flex;
  gap: 10px;
}
.dash-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 2px;
  padding: 10px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  min-width: 80px;
}
.dash-stat--accent {
  border-color: var(--primary-100);
  background: linear-gradient(135deg, #f8fbff 0%, var(--primary-light) 100%);
}
.dash-stat__val {
  font-size: 22px;
  font-weight: 800;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
  line-height: 1.1;
}
.dash-stat--accent .dash-stat__val {
  color: var(--primary);
}
.dash-stat__label {
  font-size: 11px;
  color: var(--text-tert);
  letter-spacing: 0.02em;
}

/* ── 首页 Tool Hero（深色工具区）── */
.tool-hero {
  background: linear-gradient(165deg, #0f172a 0%, #1e293b 50%, #1a1f36 100%);
  border-radius: var(--radius-lg);
  padding: 28px 24px;
  margin-bottom: 20px;
  position: relative;
  overflow: hidden;
}
.tool-hero::before {
  content: '';
  position: absolute; inset: 0;
  background:
    radial-gradient(ellipse at 20% 50%, rgba(99,102,241,0.08) 0%, transparent 60%),
    radial-gradient(ellipse at 80% 50%, rgba(20,184,166,0.06) 0%, transparent 50%);
  pointer-events: none;
}
.tool-hero-header {
  position: relative; z-index: 1;
  display: flex;
  align-items: center;
  justify-content: space-between;
  margin-bottom: 18px;
}
.tool-hero-header h2 {
  font-size: 18px; font-weight: 700; color: #f1f5f9; letter-spacing: -0.02em;
}
.tool-hero-header span {
  font-size: 13px; color: rgba(255,255,255,0.35);
}
.tool-hero-cards {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 12px;
  position: relative; z-index: 1;
}
.tool-hero-card {
  display: flex;
  align-items: flex-start;
  gap: 14px;
  padding: 20px 18px;
  background: rgba(255,255,255,0.04);
  border: 1px solid rgba(255,255,255,0.06);
  border-radius: var(--radius-md);
  cursor: pointer;
  text-decoration: none;
  color: #f1f5f9;
  transition: all 0.25s cubic-bezier(0.4, 0, 0.2, 1);
  backdrop-filter: blur(4px);
  -webkit-backdrop-filter: blur(4px);
}
.tool-hero-card:hover {
  background: rgba(255,255,255,0.08);
  border-color: rgba(255,255,255,0.14);
  transform: translateY(-3px);
  box-shadow: 0 8px 28px rgba(0,0,0,0.35);
}
.tool-hero-card-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px; height: 42px;
  border-radius: 10px;
  flex-shrink: 0;
  color: #a5b4fc;
  background: rgba(99,102,241,0.12);
  transition: all 0.25s;
}
.tool-hero-card:hover .tool-hero-card-icon {
  background: rgba(99,102,241,0.2);
  color: #c7d2fe;
}
.tool-hero-card-body { flex: 1; min-width: 0; }
.tool-hero-card-name {
  font-size: 15px; font-weight: 650; letter-spacing: -0.01em; margin-bottom: 3px; color: #f1f5f9;
}
.tool-hero-card-desc {
  font-size: 12.5px; color: rgba(255,255,255,0.4); line-height: 1.45;
}
.tool-hero-card-arrow {
  font-size: 18px; color: rgba(255,255,255,0.15);
  flex-shrink: 0; align-self: center;
  transition: all 0.25s;
}
.tool-hero-card:hover .tool-hero-card-arrow {
  color: rgba(255,255,255,0.6);
  transform: translateX(5px);
}

/* ── 首页 Content Split（双列布局）── */
.content-split {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
  margin-bottom: 20px;
}
.content-split-col {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
}
.content-split-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 16px;
  border-bottom: 1px solid var(--divider);
}
.content-split-head h3 {
  font-size: 14px; font-weight: 700; display: flex; align-items: center; gap: 6px;
}
.content-split-body {
  padding: 8px 0;
}
.content-split-body .project-list,
.content-split-body .activity-list-v2 {
  border: 0; box-shadow: none;
}

/* ── Tool Grid V2 ── */
.tool-grid-v2 {
  display: flex;
  flex-direction: column;
  gap: 8px;
  flex: 1;
}
.tool-card-v2 {
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 16px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  cursor: pointer;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  text-decoration: none;
  color: var(--text);
  position: relative;
  overflow: hidden;
}
.tool-card-v2::before {
  content: '';
  position: absolute;
  left: 0;
  top: 0;
  bottom: 0;
  width: 3px;
  background: transparent;
  transition: background 0.18s;
}
.tool-card-v2:hover {
  border-color: var(--primary-100);
  background: linear-gradient(135deg, #fafbff 0%, #f8fbff 100%);
  box-shadow: 0 2px 8px rgba(37, 99, 235, 0.08);
  transform: translateX(2px);
}
.tool-card-v2:hover::before {
  background: var(--primary);
}
.tool-card-v2--checklist:hover::before { background: var(--primary); }
.tool-card-v2--gantt:hover::before { background: var(--success); }
.tool-card-v2--topology:hover::before { background: var(--warning); }

.tcv2-icon {
  display: flex;
  align-items: center;
  justify-content: center;
  width: 42px;
  height: 42px;
  border-radius: var(--radius-md);
  flex-shrink: 0;
  transition: transform 0.18s;
}
.tool-card-v2:hover .tcv2-icon {
  transform: scale(1.05);
}
.tool-card-v2--checklist .tcv2-icon {
  background: var(--primary-light);
  color: var(--primary);
}
.tool-card-v2--gantt .tcv2-icon {
  background: var(--success-light);
  color: var(--success);
}
.tool-card-v2--topology .tcv2-icon {
  background: var(--warning-light);
  color: var(--warning);
}
.tcv2-body {
  flex: 1;
  min-width: 0;
}
.tcv2-name {
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
  margin-bottom: 2px;
  letter-spacing: -0.01em;
}
.tcv2-desc {
  font-size: 12px;
  color: var(--text-tert);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.tcv2-arrow {
  font-size: 16px;
  color: var(--text-disabled);
  transition: all 0.18s;
  flex-shrink: 0;
}
.tool-card-v2:hover .tcv2-arrow {
  color: var(--primary);
  transform: translateX(3px);
}

/* ── Activity List V2 (Timeline) ── */
.activity-list-v2 {
  display: flex;
  flex-direction: column;
  gap: 0;
  position: relative;
  padding-left: 16px;
}
.activity-list-v2::before {
  content: '';
  position: absolute;
  left: 5px;
  top: 8px;
  bottom: 8px;
  width: 1px;
  background: var(--border);
}
.activity-list-v2 .activity-row {
  display: flex;
  align-items: flex-start;
  gap: 10px;
  padding: 10px 0;
  border-bottom: none;
  position: relative;
  text-align: left;
}
.activity-list-v2 .activity-row::before {
  content: '';
  position: absolute;
  left: -14px;
  top: 16px;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  background: var(--border-strong);
  border: 2px solid var(--bg-elevated);
  box-shadow: 0 0 0 1px var(--border);
}
.activity-list-v2 .activity-row:first-child::before {
  background: var(--primary);
  box-shadow: 0 0 0 1px var(--primary-100);
}
.activity-list-v2 .activity-main {
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  gap: 2px;
}
.activity-list-v2 .activity-action {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: normal;
  line-height: 1.4;
}
.activity-list-v2 .activity-detail {
  font-size: 12px;
  color: var(--text-tert);
  line-height: 1.4;
  white-space: normal;
  overflow: hidden;
  display: -webkit-box;
  -webkit-line-clamp: 2;
  -webkit-box-orient: vertical;
}
.activity-list-v2 .activity-meta {
  font-size: 11px;
  color: var(--text-disabled);
  white-space: nowrap;
  flex-shrink: 0;
  margin-top: 2px;
}
.activity-panel .activity-list-v2 {
  max-height: 320px;
  overflow-y: auto;
}
/* 我的动态：用户标识 + 操作描述 */
.activity-list-v2 .activity-main {
  flex-direction: row;
  align-items: baseline;
  flex-wrap: wrap;
  gap: 6px;
}
.activity-list-v2 .activity-user {
  font-size: 12px;
  font-weight: 600;
  color: var(--text-sec);
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  padding: 1px 7px;
  border-radius: 10px;
  white-space: nowrap;
  flex-shrink: 0;
}
.activity-list-v2 .activity-user.is-me {
  background: var(--primary-light);
  color: var(--primary);
  border-color: var(--primary-100);
}
.activity-list-v2 .activity-text {
  font-size: 13px;
  color: var(--text);
  line-height: 1.4;
  flex: 1;
  min-width: 0;
}
/* 审计筛选栏：多筛选器横排 */
.ac-toolbar--audit {
  flex-wrap: wrap;
  gap: 8px;
  align-items: center;
}
.ac-toolbar--audit .ac-filter {
  min-width: 110px;
}
.ac-toolbar--audit .ac-search {
  flex: 1;
  min-width: 160px;
}
/* 危险操作行高亮 */
.admin-table tr.ac-log-danger {
  background: var(--danger-light);
}
.admin-table tr.ac-log-danger:hover {
  background: var(--danger-light);
  filter: brightness(0.97);
}

/* ── Dashboard Layout ── */
.home-dashboard {
  display: grid;
  grid-template-columns: repeat(3, 1fr);
  gap: 0;
  align-items: stretch;
}
.dash-layout {
  display: contents;
}
.dash-col {
  display: flex;
  flex-direction: column;
  gap: 16px;
  min-width: 0;
}
.home-panel {
  padding: 16px 18px 18px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: 0;
  min-width: 0;
  display: flex;
  flex-direction: column;
}
.home-panel:first-child {
  border-radius: var(--radius-md) 0 0 var(--radius-md);
}
.home-panel:last-child {
  border-radius: 0 var(--radius-md) var(--radius-md) 0;
  border-right-width: 1px;
}
.home-panel + .home-panel {
  border-left: 0;
}
/* Panel icon badges */
.panel-head__label {
  display: inline-flex;
  align-items: center;
  gap: 8px;
}
.panel-icon {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: var(--radius);
  flex-shrink: 0;
}
.panel-icon--blue { background: var(--primary-light); color: var(--primary); }
.panel-icon--amber { background: var(--warning-light); color: var(--warning); }
.panel-icon--green { background: var(--success-light); color: var(--success); }
/* Legacy panel-dot compat */
.panel-dot {
  display: inline-block;
  width: 7px;
  height: 7px;
  border-radius: 50%;
  flex-shrink: 0;
}
.panel-dot--blue { background: var(--primary); }
.panel-dot--amber { background: var(--warning); }
.panel-dot--green { background: var(--success); }
.panel-sub {
  font-size: 12px;
  color: var(--text-tert);
  margin: 0 0 10px;
  line-height: 1.4;
}
/* Project search */
.project-search-wrap {
  margin-bottom: 10px;
}
.project-search {
  width: 100%;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg);
  font-size: 13px;
  transition: var(--transition);
}
.project-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
  outline: none;
  background: var(--bg-elevated);
}
/* Project list height */
.project-panel .project-list {
  max-height: calc(100vh - 280px);
  overflow-y: auto;
}
.panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  margin-bottom: 12px;
}
.panel-head h2 {
  font-size: 14px;
  font-weight: 700;
  margin: 0;
  letter-spacing: -0.01em;
  color: var(--text);
}
.panel-head p {
  font-size: 13px;
  color: var(--text-tert);
  margin: 0;
}
.project-list {
  display: grid;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
}
/* 项目列表 - 新设计 */
.project-row {
  display: flex;
  align-items: stretch;
  min-height: 64px;
  background: var(--bg-elevated);
  border-bottom: 1px solid var(--divider);
  transition: background 0.15s ease;
  overflow: hidden;
}
.project-row:hover {
  background: var(--bg-hover);
}
.project-row:last-child { border-bottom: 0; }
.project-row.active {
  background: #f8fbff;
}

.apo-bar {
  width: 4px;
  flex-shrink: 0;
}
.apo-bar-mine {
  background: var(--primary);
}
.apo-bar-other {
  background: var(--border-strong);
}

.apo-content {
  flex: 1;
  display: flex;
  align-items: center;
  padding: 12px 16px;
  min-width: 0;
}

.apo-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
  width: 100%;
}

.apo-info {
  display: flex;
  flex-direction: column;
  gap: 4px;
  min-width: 0;
  flex: 1;
}

.apo-name {
  font-size: 15px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.apo-meta {
  font-size: 12px;
  color: var(--text-tert);
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
}

.apo-right {
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}

.apo-badge {
  display: inline-flex;
  align-items: center;
  padding: 4px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
}
.apo-badge-me {
  background: var(--primary);
  color: #fff;
}
.apo-badge-other {
  background: var(--bg-active);
  color: var(--text-sec);
}

.apo-actions {
  display: flex;
  align-items: center;
  gap: 6px;
}

.apo-btn {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.15s ease;
  white-space: nowrap;
}
.apo-btn-ghost {
  background: transparent;
  color: var(--text-sec);
  border: 1px solid var(--border);
}
.apo-btn-ghost:hover {
  background: var(--bg-active);
  color: var(--text);
  border-color: var(--border-strong);
}
.apo-btn-danger {
  color: var(--danger);
}
.apo-btn-danger:hover {
  background: var(--danger-light);
  border-color: var(--danger);
  color: var(--danger);
}

.apo-current {
  display: inline-flex;
  align-items: center;
  height: 30px;
  padding: 0 12px;
  border-radius: var(--radius);
  font-size: 13px;
  font-weight: 600;
  background: var(--primary-light);
  color: var(--primary);
}
.project-main {
  min-width: 0;
  border: 0;
  background: transparent;
  padding: 0;
  text-align: left;
  cursor: pointer;
}
.project-name {
  display: block;
  font-size: 15px;
  font-weight: 650;
  color: var(--text);
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.project-meta {
  display: block;
  margin-top: 5px;
  font-size: 12px;
  color: var(--text-tert);
}
.project-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}
.current-badge {
  display: inline-flex;
  align-items: center;
  height: 28px;
  padding: 0 10px;
  border-radius: 999px;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 600;
}
.danger-text { color: var(--danger) !important; }
.account-grid {
  display: grid;
  grid-template-columns: minmax(260px, 460px) minmax(220px, 1fr);
  gap: 14px;
  align-items: stretch;
}
.password-form {
  display: grid;
  grid-template-columns: minmax(0, 1fr) minmax(0, 1fr) auto;
  gap: 10px;
}
.password-form .btn {
  white-space: nowrap;
}
.backup-card {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  padding: 12px 14px;
  text-align: left;
  cursor: pointer;
  transition: var(--transition);
}
.backup-card:hover {
  border-color: var(--primary);
  background: #f8fbff;
}
.backup-card span {
  display: block;
  font-size: 14px;
  font-weight: 650;
  color: var(--text);
}
.backup-card em {
  display: block;
  margin-top: 5px;
  font-style: normal;
  font-size: 12px;
  color: var(--text-tert);
}

/* ── Admin 控制台 ────────────────────────────────────── */
.admin-console {
  margin-top: 24px;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  overflow: hidden;
  background: var(--bg-elevated);
  box-shadow: var(--shadow-sm);
}
.ac-head {
  background: var(--bg);
  border-bottom: 1px solid var(--border);
  position: relative;
}
.ac-head::before {
  content: '';
  position: absolute;
  inset: 0;
  background-image: linear-gradient(90deg, transparent 0%, rgba(37,99,235,0.03) 50%, transparent 100%);
  pointer-events: none;
}
.ac-toggle {
  position: relative;
  width: 100%;
  display: flex;
  align-items: center;
  gap: 14px;
  padding: 14px 18px;
  background: transparent;
  cursor: pointer;
  text-align: left;
  color: var(--text);
  transition: background 0.15s ease;
}
.ac-toggle:hover { background: var(--bg-hover); }
.ac-toggle-mark {
  font-size: 11px;
  color: var(--primary);
  transition: transform 0.2s ease;
  display: inline-block;
}
.admin-console.is-collapsed .ac-toggle-mark { transform: rotate(-90deg); }
.ac-title {
  display: inline-flex;
  align-items: center;
  gap: 10px;
  font-size: 15px;
  font-weight: 700;
  letter-spacing: 0.01em;
  color: var(--text);
}
.ac-glyph {
  color: var(--primary);
  font-size: 13px;
  transform: translateY(-1px);
}
.ac-tag {
  padding: 2px 8px;
  border: 1px solid var(--border);
  border-radius: 3px;
  background: var(--bg-elevated);
  color: var(--text-sec);
  font-size: 10px;
  font-weight: 700;
  letter-spacing: 0.12em;
  font-family: var(--font-mono);
}
.ac-sub {
  margin-left: auto;
  font-size: 12px;
  color: var(--text-tert);
  font-weight: 400;
}
.ac-body {
  padding: 18px;
  display: grid;
  gap: 16px;
}
.admin-console.is-collapsed .ac-body { display: none; }

/* 统计卡片 */
.ac-stats {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
}
.ac-stat {
  position: relative;
  padding: 12px 14px;
  border: 1px solid var(--border);
  border-radius: var(--radius-md);
  background: var(--bg-elevated);
  overflow: hidden;
}
.ac-stat::before {
  content: '';
  position: absolute;
  left: 0; top: 0; bottom: 0;
  width: 3px;
  background: var(--primary);
}
.ac-stat[data-stat="admins"]::before { background: var(--warning); }
.ac-stat[data-stat="projects"]::before { background: var(--success); }
.ac-stat[data-stat="today"]::before { background: #8b5cf6; }
.ac-stat-label {
  display: block;
  font-size: 11px;
  color: var(--text-tert);
  letter-spacing: 0.04em;
  text-transform: uppercase;
  margin-bottom: 4px;
}
.ac-stat-value {
  display: block;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 24px;
  font-weight: 700;
  color: var(--text);
  line-height: 1.1;
}

/* 标签页 */
.ac-tabs {
  display: flex;
  align-items: center;
  gap: 2px;
  border-bottom: 1px solid var(--border);
  margin: 0 -18px;
  padding: 0 18px;
}
.ac-tab {
  position: relative;
  display: inline-flex;
  align-items: center;
  gap: 7px;
  padding: 10px 14px 12px;
  font-size: 13px;
  font-weight: 600;
  color: var(--text-tert);
  cursor: pointer;
  transition: color 0.15s ease;
}
.ac-tab:hover { color: var(--text-sec); }
.ac-tab.is-active { color: var(--primary); }
.ac-tab.is-active::after {
  content: '';
  position: absolute;
  left: 14px; right: 14px; bottom: -1px;
  height: 2px;
  background: var(--primary);
  border-radius: 2px 2px 0 0;
}
.ac-tab-glyph {
  font-size: 12px;
  opacity: 0.8;
}
.ac-tab-spacer { flex: 1; }

/* 面板 */
.ac-pane { display: none; }
.ac-pane.is-active { display: block; }

/* 工具栏 */
.ac-toolbar {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 12px;
}
.ac-search {
  flex: 1;
  min-width: 0;
  height: 34px;
  padding: 0 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  font-size: 13px;
  transition: var(--transition);
}
.ac-search:focus {
  border-color: var(--primary);
  box-shadow: 0 0 0 3px var(--primary-light);
}
.ac-filter {
  height: 34px;
  padding: 0 10px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  font-size: 13px;
  cursor: pointer;
}
.ac-count {
  font-size: 12px;
  color: var(--text-tert);
  font-family: var(--font-mono);
  white-space: nowrap;
}

/* 表格容器（保留旧类名兼容 + 新类名） */
.ac-table-wrap,
.admin-table-wrap {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  overflow: hidden;
  background: var(--bg-elevated);
}
.ac-table-wrap .admin-table thead th {
  padding: 9px 14px;
  font-size: 11px;
  text-transform: uppercase;
  letter-spacing: 0.04em;
  color: var(--text-tert);
  background: #f8fafc;
}
.ac-user-row .c-idx {
  font-family: var(--font-mono);
  color: var(--text-tert);
  font-size: 12px;
}
.ac-user-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  margin-right: 10px;
  vertical-align: middle;
}
.ac-user-name {
  font-weight: 600;
  color: var(--text);
}
.ac-user-self .ac-user-name::after {
  content: '你';
  display: inline-block;
  margin-left: 8px;
  padding: 1px 6px;
  border-radius: 3px;
  background: var(--success-light);
  color: var(--success);
  font-size: 10px;
  font-weight: 700;
  vertical-align: middle;
}
.ac-role-pill {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  cursor: pointer;
  transition: var(--transition);
  border: 1px solid transparent;
}
.ac-role-pill:hover { background: var(--bg-hover); }
.ac-role-pill::after {
  content: '▾';
  font-size: 9px;
  opacity: 0.6;
}
.ac-role-pill-static { cursor: default; }
.ac-role-pill-static::after { content: none; }
.ac-role-pill-static:hover { background: inherit; }
.ac-role-pill[data-role="super_admin"] { background: #f5f3ff; color: #7c3aed; border-color: #ddd6fe; }
.ac-role-pill[data-role="admin"] { background: var(--primary-light); color: var(--primary); border-color: var(--primary-100); }
.ac-role-pill[data-role="user"] { background: var(--bg-hover); color: var(--text-sec); }

/* 角色下拉菜单 */
.ac-role-menu {
  position: absolute;
  z-index: 200;
  min-width: 140px;
  padding: 4px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  box-shadow: var(--shadow-lg);
}
.ac-role-menu button {
  display: flex;
  align-items: center;
  justify-content: space-between;
  width: 100%;
  padding: 7px 10px;
  border-radius: var(--radius-sm);
  font-size: 13px;
  color: var(--text-sec);
  cursor: pointer;
  text-align: left;
}
.ac-role-menu button:hover { background: var(--bg-hover); color: var(--text); }
.ac-role-menu button.is-current { color: var(--primary); font-weight: 600; }
.ac-role-menu button.is-disabled { opacity: 0.4; cursor: not-allowed; }

/* 项目总览手风琴 */
.ac-accordion {
  display: flex;
  flex-direction: column;
  gap: 8px;
}
.ac-po-item {
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: var(--bg-elevated);
  overflow: hidden;
  transition: var(--transition);
}
.ac-po-item.is-me {
  border-color: var(--primary);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-elevated) 100%);
  box-shadow: 0 2px 8px rgba(59, 130, 246, 0.15);
}
.ac-po-item.is-me .ac-po-initial {
  background: var(--primary);
  color: #fff;
}
.ac-po-item.is-open {
  border-color: var(--primary-100);
  box-shadow: 0 1px 0 var(--primary-100) inset;
}
.ac-po-me-badge {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
  flex-shrink: 0;
}
.ac-po-head {
  display: flex;
  align-items: center;
  gap: 10px;
  width: 100%;
  padding: 10px 14px;
  background: transparent;
  border: 0;
  cursor: pointer;
  text-align: left;
  font-size: 13px;
  color: var(--text);
  transition: var(--transition);
}
.ac-po-head:hover { background: var(--bg-hover); }
.ac-po-caret {
  display: inline-flex;
  width: 14px;
  justify-content: center;
  color: var(--text-tert);
  font-size: 11px;
  transition: transform 0.15s ease;
}
.ac-po-item.is-open .ac-po-caret { transform: rotate(0deg); }
.ac-po-initial {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  width: 28px;
  height: 28px;
  border-radius: 50%;
  background: var(--primary-light);
  color: var(--primary);
  font-size: 12px;
  font-weight: 700;
  flex-shrink: 0;
}
.ac-po-name {
  font-weight: 600;
  color: var(--text);
  flex-shrink: 0;
}
.ac-po-role {
  display: inline-flex;
  align-items: center;
  padding: 2px 8px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  border: 1px solid transparent;
  flex-shrink: 0;
}
.ac-po-role[data-role="super_admin"] { background: #f5f3ff; color: #7c3aed; border-color: #ddd6fe; }
.ac-po-role[data-role="user"] { background: var(--bg-hover); color: var(--text-sec); }
.ac-po-meta {
  margin-left: auto;
  display: flex;
  align-items: center;
  gap: 12px;
  flex-shrink: 0;
}
.ac-po-cnt {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 9px;
  border-radius: 999px;
}
.ac-po-sub {
  font-size: 11px;
  color: var(--text-tert);
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
}
.ac-po-body {
  padding: 0 14px 12px 14px;
  border-top: 1px solid var(--border);
  margin-top: 0;
  animation: acPoSlide 0.18s ease;
}
@keyframes acPoSlide {
  from { opacity: 0; transform: translateY(-4px); }
  to   { opacity: 1; transform: translateY(0); }
}
.ac-po-table { margin-top: 8px; }
.ac-po-table .is-my-project {
  background: var(--primary-light);
}
.ac-po-table .is-my-project td {
  border-bottom-color: var(--primary-100);
}
.ac-po-table .is-my-project .ac-po-link {
  font-weight: 600;
  color: var(--primary);
}
.ac-po-creator {
  font-size: 12px;
  color: var(--text-sec);
}
.ac-po-creator-me {
  font-size: 12px;
  font-weight: 700;
  color: var(--primary);
  background: var(--primary-light);
  padding: 2px 6px;
  border-radius: 4px;
}
.ac-po-table .c-num {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  text-align: right;
  color: var(--text-sec);
  font-size: 12px;
}
.ac-po-link {
  color: var(--primary);
  font-weight: 600;
  text-decoration: none;
  transition: var(--transition);
}
.ac-po-link:hover { text-decoration: underline; }
@media (max-width: 720px) {
  .ac-po-head { flex-wrap: wrap; gap: 8px; padding: 10px 12px; }
  .ac-po-meta { margin-left: 0; width: 100%; justify-content: space-between; }
  .ac-po-sub { display: none; }
}

/* 项目总览卡片式设计 */
.apo-section {
  margin-bottom: 28px;
}
.apo-section-header {
  display: flex;
  align-items: center;
  gap: 10px;
  margin-bottom: 14px;
  padding-bottom: 10px;
  border-bottom: 2px solid var(--border);
}
.apo-section-title {
  font-size: 14px;
  font-weight: 700;
  color: var(--text);
  letter-spacing: -0.01em;
}
.apo-section-count {
  display: inline-flex;
  align-items: center;
  justify-content: center;
  min-width: 22px;
  height: 22px;
  padding: 0 7px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 700;
  font-family: var(--font-mono);
  background: var(--bg-active);
  color: var(--text-sec);
}
.apo-section:first-child .apo-section-title {
  color: var(--primary);
}
.apo-section:first-child .apo-section-count {
  background: var(--primary-light);
  color: var(--primary);
}

.apo-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 14px;
}

.apo-card {
  display: flex;
  flex-direction: column;
  gap: 10px;
  padding: 16px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  text-decoration: none;
  transition: all 0.18s cubic-bezier(0.4, 0, 0.2, 1);
  position: relative;
  overflow: hidden;
}
.apo-card::before {
  content: '';
  position: absolute;
  top: 0;
  left: 0;
  right: 0;
  height: 3px;
  background: var(--border);
  transition: background 0.18s ease;
}
.apo-card:hover {
  border-color: var(--primary);
  box-shadow: 0 4px 16px rgba(37, 99, 235, 0.12);
  transform: translateY(-2px);
}
.apo-card:hover::before {
  background: var(--primary);
}
.apo-card-mine {
  border-color: var(--primary-100);
  background: linear-gradient(135deg, var(--primary-light) 0%, var(--bg-elevated) 60%);
}
.apo-card-mine::before {
  background: var(--primary);
}

.apo-card-top {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 8px;
}
.apo-card-id {
  font-size: 11px;
  font-family: var(--font-mono);
  font-weight: 600;
  color: var(--text-tert);
}
.apo-badge-mine {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 700;
  background: var(--primary);
  color: #fff;
}
.apo-badge-creator {
  display: inline-flex;
  align-items: center;
  padding: 3px 9px;
  border-radius: 999px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-active);
  color: var(--text-sec);
  max-width: 100px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}

.apo-card-name {
  font-size: 14px;
  font-weight: 600;
  color: var(--text);
  line-height: 1.4;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
.apo-card-mine .apo-card-name {
  color: var(--primary);
}

.apo-card-stats {
  display: flex;
  gap: 12px;
}
.apo-stat {
  display: flex;
  flex-direction: column;
  align-items: center;
  gap: 1px;
}
.apo-stat-num {
  font-size: 15px;
  font-weight: 700;
  font-family: var(--font-mono);
  color: var(--text);
  line-height: 1;
}
.apo-stat-label {
  font-size: 10px;
  color: var(--text-tert);
  text-transform: uppercase;
  letter-spacing: 0.03em;
}

.apo-card-time {
  font-size: 11px;
  font-family: var(--font-mono);
  color: var(--text-tert);
  margin-top: auto;
}

/* 响应式 */
@media (max-width: 640px) {
  .apo-grid {
    grid-template-columns: 1fr;
    gap: 10px;
  }
}

/* 审计日志样式 */
.ac-log-time {
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  font-size: 12px;
  color: var(--text-tert);
  white-space: nowrap;
}
.ac-log-action {
  display: inline-block;
  padding: 2px 8px;
  border-radius: 3px;
  font-size: 11px;
  font-weight: 600;
  background: var(--bg-hover);
  color: var(--text-sec);
}
.ac-log-action[data-kind="create"] { background: var(--success-light); color: var(--success); }
.ac-log-action[data-kind="update"] { background: var(--primary-light); color: var(--primary); }
.ac-log-action[data-kind="delete"] { background: var(--danger-light); color: var(--danger); }
.ac-log-action[data-kind="admin"]  { background: #f5f3ff; color: #7c3aed; }

.admin-role-sel {
  min-width: 110px;
  height: 32px;
  font-size: 13px;
}
.admin-table {
  width: 100%;
  border-collapse: collapse;
  font-size: 14px;
}
.admin-table thead th {
  text-align: left;
  font-weight: 600;
  font-size: 13px;
  color: var(--text-sec);
  padding: 10px 14px;
  border-bottom: 1px solid var(--border);
  background: var(--bg-hover);
  white-space: nowrap;
}
.admin-table tbody td {
  padding: 9px 14px;
  border-bottom: 1px solid var(--divider);
  vertical-align: middle;
}
.admin-table tbody tr:last-child td { border-bottom: 0; }
.admin-table tbody tr:hover { background: var(--bg-hover); }

.member-modal {
  max-width: 720px;
}
.member-note {
  display: grid;
  gap: 4px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fbff;
  margin-bottom: 12px;
}
.member-note b {
  font-size: 14px;
  color: var(--text);
}
.member-note span,
.role-help {
  font-size: 12px;
  color: var(--text-tert);
}
.role-help {
  display: flex;
  flex-wrap: wrap;
  gap: 8px 14px;
  margin-bottom: 12px;
}
.member-rows {
  display: grid;
  gap: 8px;
  margin-bottom: 12px;
}
.member-row {
  display: grid;
  grid-template-columns: minmax(0, 1fr) 128px auto;
  align-items: center;
  gap: 8px;
}
.member-row .select {
  height: 38px;
}
.account-modal {
  max-width: 460px;
}
.account-info {
  display: grid;
  grid-template-columns: 82px minmax(0, 1fr);
  gap: 10px 14px;
  margin: 0;
}
.account-info dt {
  color: var(--text-tert);
  font-size: 13px;
}
.account-info dd {
  margin: 0;
  min-width: 0;
  font-weight: 650;
  overflow-wrap: anywhere;
}
.account-tip {
  margin-top: 18px;
  padding: 10px 12px;
  border: 1px solid var(--border);
  border-radius: var(--radius);
  background: #f8fafc;
  color: var(--text-tert);
  font-size: 12px;
  line-height: 1.6;
}
.empty-state.compact {
  padding: 20px;
  font-size: 13px;
}
.empty-state {
  text-align: center;
  padding: 60px 20px;
  color: var(--text-tert);
}
.empty-state .empty-icon {
  width: 64px; height: 64px;
  background: var(--bg-hover);
  border-radius: var(--radius-lg);
  margin: 0 auto 16px;
  display: flex; align-items: center; justify-content: center;
  font-size: 28px; color: var(--text-tert);
}
.empty-state p { font-size: 15px; margin-bottom: 16px; }

.page-header {
  margin-bottom: 24px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 16px;
}
/* 工作台页面头部 */
.page-header--dash {
  padding: 20px 24px;
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  margin-bottom: 0;
}
.page-header__content {
  flex: 1;
}
.page-title {
  font-size: 22px;
  font-weight: 700;
  letter-spacing: -0.01em;
  margin: 0 0 4px 0;
}
.page-subtitle {
  font-size: 13px;
  color: var(--text-tert);
  margin: 0;
}
/* 快速统计 */
.page-header__stats {
  display: flex;
  align-items: center;
  gap: 16px;
  padding: 8px 16px;
  background: var(--bg);
  border-radius: 999px;
  border: 1px solid var(--border);
}
.qs-item {
  display: inline-flex;
  align-items: baseline;
  gap: 6px;
}
.qs-val {
  font-size: 18px;
  font-weight: 700;
  font-family: var(--font-mono);
  font-variant-numeric: tabular-nums;
  color: var(--text);
}
.qs-label {
  font-size: 12px;
  color: var(--text-tert);
}
.qs-divider {
  width: 1px;
  height: 20px;
  background: var(--border);
}
.stats-row {
  display: flex;
  gap: 8px;
  margin-bottom: 0;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.stat-card {
  background: var(--bg-elevated);
  border: 1px solid var(--border);
  border-radius: var(--radius);
  padding: 9px 13px;
  min-width: 86px;
  box-shadow: var(--shadow-sm);
}
.stat-card .stat-val {
  font-size: 20px;
  font-weight: 700;
  font-family: var(--font-mono);
  line-height: 1.1;
}
.stat-card .stat-label {
  font-size: 12px;
  color: var(--text-tert);
  margin-top: 3px;
}

.print-head { display: none; }
@media print {
  @page { margin: 12mm 10mm; size: A4 landscape; }

  /* 强制打印背景色（颜色高亮必须） */
  * { -webkit-print-color-adjust: exact !important; print-color-adjust: exact !important; }

  /* 隐藏所有非内容元素 */
  .sidebar, .topbar, .toolbar, .row-act, .qa-row, .btn,
  .hint-foot, .tabs, #toast, #ctxMenu, .ctx-menu,
  .mob-nav, .grp-dot, .status-chip { display: none !important; }

  /* 完全展平布局：消除 flex/grid 嵌套 */
  html, body { width: 100%; height: auto; overflow: visible; background: #fff; }
  .app        { display: block; height: auto; overflow: visible; }
  .main       { display: block; height: auto; overflow: visible; margin: 0; padding: 0; }
  .page       { padding: 0; overflow: visible; height: auto; }
  .page-header, .stats-row, #groupTabs { display: none !important; }

  /* 表格铺满 */
  .table-wrap {
    border: 1px solid #999; border-radius: 0;
    overflow: visible; width: 100%;
    box-shadow: none;
  }
  .ledger {
    width: 100%; font-size: 10.5pt;
    border-collapse: collapse;
    table-layout: fixed;
  }
  .ledger thead { display: table-header-group; }   /* 每页重复表头 */
  .ledger tfoot { display: table-footer-group; }
  .ledger th, .ledger td {
    border: 0.5px solid #bbb !important;
    padding: 5px 7px;
    word-break: break-word;
    white-space: normal;
    /* sticky 定位打印时取消 */
    position: static;
  }
  .ledger th { background: #f0f0f0 !important; font-size: 9.5pt; }
  .ledger tbody tr { page-break-inside: avoid; }

  /* 打印时显示销项状态文字（替代chip） */
  .status-chip { display: inline !important; background: none !important;
    border: none !important; padding: 0 !important; font-size: inherit !important;
    color: inherit !important; }

  /* 打印标题区 */
  .print-head { display: block; margin-bottom: 14px; padding-bottom: 10px; border-bottom: 2px solid #333; }
  .print-head .ph-title { font-size: 16pt; font-weight: 700; }
  .print-head .ph-sub   { font-size: 10pt; color: #555; margin-top: 4px; }
  .print-head .ph-date  { font-size: 9pt;  color: #888; margin-top: 5px; }
}

@media (max-width: 768px) {
  :root { --sidebar-w: 0px; --topbar-h: 52px; --content-pad: 16px; }
  .sidebar { display: none; }
  .mob-nav {
    position: fixed; bottom: 0; left: 0; right: 0; z-index: 100;
    background: var(--bg-elevated); border-top: 1px solid var(--border);
    display: flex !important; height: 56px;
  }
  .mob-nav-item {
    flex: 1; display: flex; flex-direction: column;
    align-items: center; justify-content: center; gap: 3px;
    font-size: 10px; color: var(--text-tert); font-weight: 500;
  }
  .mob-nav-item.on { color: var(--primary); }
  .mob-nav-item .mi { font-size: 20px; line-height: 1; }
  .page { padding-bottom: 72px; }
  .canvas-stage { height: calc(100vh - var(--topbar-h) - var(--content-pad) * 2 - 60px - 56px); min-height: 300px; }
  .float-props { width: 180px; top: 8px; right: 8px; }
  .float-tools.tl { top: 8px; left: 8px; }
  .ftool { padding: 8px 12px; font-size: 12px; gap: 6px; }
  .login-card { padding: 28px 24px; }
  .panel-head { align-items: flex-start; flex-direction: column; }
  .project-row { grid-template-columns: 1fr; align-items: stretch; }
  .project-actions { justify-content: flex-start; flex-wrap: wrap; }
  .member-row { grid-template-columns: 1fr; }
  .activity-row { grid-template-columns: 1fr; gap: 4px; }
  .activity-main { display: grid; gap: 2px; }
  .account-grid { grid-template-columns: 1fr; }
  .password-form { grid-template-columns: 1fr; }
  .home-grid { grid-template-columns: 1fr; gap: 12px; }
  .home-dashboard { grid-template-columns: 1fr !important; }
  .home-panel { border-right: 0; border-bottom: 1px solid var(--divider); padding-bottom: 20px; }
  .home-panel:last-of-type { border-bottom: 0; padding-bottom: 0; }
  .project-panel .project-list { max-height: none; }
  .page-header--dash { flex-direction: column; align-items: flex-start; gap: 12px; }
  .page-header__stats { align-self: stretch; justify-content: center; }
  .dash-col { gap: 16px; }
  .topbar-account .ta-info { display: none; }
  .topbar-account { padding: 4px !important; }
  .ac-stats { grid-template-columns: repeat(2, 1fr); }
  .ac-sub { display: none; }
  .ac-toolbar { flex-wrap: wrap; }
  .ac-search { width: 100%; flex: 1 1 100%; }
  .page-header { flex-direction: column; align-items: flex-start; }
  .tool-hero { padding: 20px 16px; }
  .tool-hero-header span { display: none; }
  .tool-hero-cards { grid-template-columns: 1fr; }
  .tool-hero-card { padding: 14px 14px; }
  .content-split { grid-template-columns: 1fr; gap: 12px; }
  .content-split-body .project-list { max-height: none; }
  .cl-worktop { display: flex; flex-direction: column; align-items: stretch; gap: 12px; }
  .cl-title { max-width: 100%; font-size: 20px; white-space: normal; }
  .cl-title-input { max-width: 100%; min-width: 0; font-size: 20px !important; }
  .stats-row { gap: 8px; justify-content: stretch; }
  .stat-card { min-width: 0; flex: 1 1 calc(33.333% - 8px); padding: 9px 10px; }
  .stat-card .stat-val { font-size: 20px; }
}

/* ── 完成度进度条 ── */
.completion-bar-wrap {
  height: 5px; background: var(--bg-hover); border-radius: 3px;
  margin-bottom: 6px; overflow: hidden;
}
.completion-bar {
  height: 100%; background: var(--success);
  border-radius: 3px; transition: width 0.4s ease;
  min-width: 0;
}
.cl-progress-row {
  grid-column: 1 / -1;
  display: grid;
  grid-template-columns: minmax(120px, 1fr) auto;
  align-items: center;
  gap: 12px;
  margin-top: -8px;
}
.cl-progress-row .completion-bar-wrap {
  margin-bottom: 0;
}
.cl-progress-label {
  font-size: 12px;
  color: var(--text-tert);
  white-space: nowrap;
}
.cl-toolbar {
  margin-bottom: 12px;
}
.cl-toolbar .search-box {
  flex: 1 1 420px;
  min-width: 260px;
}
@media (max-width: 900px) {
  .cl-worktop {
    display: flex;
    flex-direction: column;
    align-items: stretch;
    gap: 12px;
  }
  .stats-row {
    justify-content: stretch;
  }
  .stat-card {
    flex: 1 1 calc(33.333% - 8px);
    min-width: 86px;
  }
  .cl-toolbar .search-box {
    flex-basis: 100%;
    min-width: 0;
  }
  .cl-progress-row {
    margin-top: 0;
  }
}

@media (max-width: 520px) {
  .stat-card {
    flex-basis: calc(50% - 8px);
  }
  .cl-title {
    font-size: 20px;
    white-space: normal;
  }
  .cl-title-input {
    min-width: 0;
    max-width: 100%;
    font-size: 20px !important;
  }
  .cl-progress-row {
    grid-template-columns: 1fr;
    gap: 6px;
  }
}

/* ── 列设置面板 ── */
.col-settings-mask {
  position: fixed; inset: 0; background: rgba(0,0,0,0.4);
  display: none; align-items: center; justify-content: center;
  z-index: 500; padding: 24px; backdrop-filter: blur(2px);
}
.col-settings-mask.show { display: flex; }
.col-settings-panel {
  background: var(--bg-elevated); border-radius: var(--radius-lg);
  width: 100%; max-width: 520px; max-height: 85vh; overflow: hidden;
  box-shadow: var(--shadow-lg); display: flex; flex-direction: column;
  animation: modalIn 0.15s ease;
}
.cs-head {
  display: flex; align-items: center; justify-content: space-between;
  padding: 18px 24px; border-bottom: 1px solid var(--border);
}
.cs-head h3 { font-size: 16px; font-weight: 600; }
.cs-head .x {
  width: 32px; height: 32px; border-radius: var(--radius);
  font-size: 20px; cursor: pointer; display: flex;
  align-items: center; justify-content: center; color: var(--text-tert);
}
.cs-head .x:hover { background: var(--bg-hover); color: var(--text); }
.cs-body { padding: 20px 24px; overflow-y: auto; flex: 1; }
.cs-section { margin-bottom: 24px; }
.cs-section:last-child { margin-bottom: 0; }
.cs-section-title {
  font-size: 12px; font-weight: 600; color: var(--text-tert);
  text-transform: uppercase; letter-spacing: 0.05em;
  margin-bottom: 12px;
}
.cs-col-list { display: flex; flex-direction: column; gap: 4px; }
.cs-col-item {
  display: flex; align-items: center; gap: 10px;
  padding: 8px 10px; border-radius: var(--radius);
  cursor: grab; transition: background 0.1s;
}
.cs-col-item:hover { background: var(--bg-hover); }
.cs-col-item.dragging { opacity: 0.5; }
.cs-col-item .drag-handle {
  color: var(--text-tert); cursor: grab; font-size: 14px;
  width: 16px; text-align: center;
}
.cs-col-item .col-check { width: 16px; height: 16px; cursor: pointer; }
.cs-col-item .col-name { flex: 1; font-size: 14px; }
.cs-col-item .col-name input {
  width: 100%; border: 1px solid transparent; background: transparent;
  padding: 4px 6px; border-radius: 4px; font-size: 14px; outline: none;
}
.cs-col-item .col-name input:focus { border-color: var(--primary); background: #fff; }
.cs-col-item .col-del {
  width: 28px; height: 28px; border-radius: 4px; border: none;
  background: transparent; cursor: pointer; color: var(--text-tert);
  display: flex; align-items: center; justify-content: center; font-size: 16px;
}
.cs-col-item .col-del:hover { background: var(--danger-light); color: var(--danger); }
.cs-col-item.system .col-del { display: none; }
.cs-col-item .col-insert {
  width: 28px; height: 28px; border-radius: 4px; border: none;
  background: transparent; cursor: pointer; color: var(--text-tert);
  display: flex; align-items: center; justify-content: center; font-size: 16px; font-weight: 700;
}
.cs-col-item .col-insert:hover { background: var(--primary-light); color: var(--primary); }
.cs-col-item .col-tag {
  font-size: 11px; padding: 2px 6px; border-radius: 4px;
  background: var(--bg-hover); color: var(--text-tert);
}
.cs-add-row { display: flex; gap: 8px; align-items: center; }
.cs-rowheight { display: flex; align-items: center; gap: 12px; }
.cs-rowheight input[type=range] { flex: 1; accent-color: var(--primary); }
.cs-rowheight span { font-size: 14px; color: var(--text-sec); min-width: 48px; }
.cs-foot {
  display: flex; gap: 10px; justify-content: space-between;
  padding: 14px 24px; border-top: 1px solid var(--border);
}
.cs-foot .btn { min-width: 80px; }

/* ── 行拖拽手柄 ── */
.ledger .c-drag {
  width: 28px; text-align: center; color: var(--text-disabled);
  cursor: grab; user-select: none; font-size: 13px;
}
.ledger tbody tr:hover .c-drag { color: var(--text-tert); }
.ledger tbody tr.row-drag-source td { background: rgba(37, 99, 235, 0.08) !important; opacity: 0.72; }
.row-drop-line {
  position: fixed;
  height: 0;
  border-top: 3px solid var(--primary);
  z-index: 385;
  pointer-events: none;
  display: none;
}
.row-drop-line::before {
  content: '';
  position: absolute;
  left: 0;
  top: -6px;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--primary);
}
.row-drag-ghost {
  position: fixed;
  z-index: 386;
  display: none;
  min-width: 54px;
  padding: 5px 9px;
  border-radius: 4px;
  background: #111827;
  color: #fff;
  font-size: 12px;
  font-weight: 600;
  box-shadow: 0 6px 18px rgba(15,23,42,0.22);
  pointer-events: none;
}

/* ── 批量选择 ── */
.ledger .c-check { width: 36px; text-align: center; }
.ledger .c-check input { width: 15px; height: 15px; cursor: pointer; accent-color: var(--primary); vertical-align: middle; }
.ledger thead th.c-check input { cursor: pointer; }
.ledger tbody tr.row-selected td { background: var(--primary-light) !important; }
.ledger tbody tr.row-selected {
  box-shadow: inset 3px 0 0 var(--primary);
}

/* ── 逾期提醒 ── */
.ledger td.cell-overdue { color: var(--danger) !important; font-weight: 600; }
.ledger td.cell-overdue::after {
  content: '逾期';
  display: inline-flex;
  margin-left: 6px;
  padding: 1px 5px;
  border-radius: 4px;
  background: var(--danger-light);
  color: var(--danger);
  font-size: 11px;
  font-weight: 500;
  vertical-align: 1px;
}
.ledger td.cell-soon { color: var(--warning) !important; font-weight: 600; }

/* ── 批量操作工具条 ── */
.batch-bar {
  position: fixed; bottom: 24px; left: 50%; transform: translateX(-50%) translateY(120%);
  z-index: 350; display: flex; align-items: center; gap: 10px;
  background: var(--text); color: #fff;
  padding: 10px 16px; border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg); opacity: 0;
  transition: transform 0.22s cubic-bezier(0.4,0,0.2,1), opacity 0.22s;
  max-width: calc(100vw - 32px);
  overflow-x: auto;
}
.batch-bar.show { transform: translateX(-50%) translateY(0); opacity: 1; }
.batch-bar .bb-count { font-size: 14px; font-weight: 600; padding-right: 6px; }
.batch-bar .bb-count { white-space: nowrap; }
.batch-bar .bb-count b { color: #fbbf24; }
.batch-bar .bb-sep { width: 1px; height: 22px; background: rgba(255,255,255,0.2); flex: 0 0 1px; }
.batch-bar button {
  color: #fff; cursor: pointer; font-size: 13px; font-weight: 500;
  padding: 6px 12px; border-radius: var(--radius); transition: background 0.12s;
  display: inline-flex; align-items: center; gap: 5px;
  white-space: nowrap;
  flex: 0 0 auto;
}
.batch-bar button:hover { background: rgba(255,255,255,0.15); }
.batch-bar button.bb-danger:hover { background: var(--danger); }
.batch-bar .bb-swatch {
  width: 16px; height: 16px; border-radius: 50%; cursor: pointer;
  border: 2px solid rgba(255,255,255,0.3); transition: transform 0.1s;
}
.batch-bar .bb-swatch:hover { transform: scale(1.2); }
.batch-bar .bb-close { font-size: 18px; opacity: 0.6; padding: 4px 8px; }
.batch-bar .bb-close:hover { opacity: 1; background: transparent; }

/* ── 快捷键提示 ── */
.kbd-hint {
  font-size: 12px; color: var(--text-tert);
  display: inline-flex; align-items: center; gap: 4px;
}
.kbd-hint kbd {
  background: var(--bg-hover); border: 1px solid var(--border);
  border-radius: 4px; padding: 1px 6px; font-family: var(--font-mono);
  font-size: 11px; color: var(--text-sec);
}

/* ── 新增行高亮（置顶时一闪） ── */
@keyframes rowFlash { from { background: var(--primary-100); } to { background: transparent; } }
.ledger tbody tr.row-flash td { animation: rowFlash 1s ease; }

/* ── 焦点行（键盘导航） ── */
.ledger tbody tr.row-focus td { box-shadow: inset 0 0 0 2px var(--primary); }

/* ── 分组标签页 ── */
.group-tabs { display:flex; align-items:center; gap:6px; flex-wrap:wrap; padding:12px 0 4px; }
.group-tab {
  display:inline-flex; align-items:center; gap:5px; padding:4px 14px;
  border-radius:999px; font-size:13px; font-weight:500; cursor:pointer;
  border:1.5px solid var(--border); background:var(--bg); color:var(--text-sec);
  transition:all 0.13s; white-space:nowrap; user-select:none;
}
.group-tab:hover { border-color:var(--primary); color:var(--primary); background:var(--primary-100); }
.group-tab.on { background:var(--primary); border-color:var(--primary); color:#fff; }
.group-tab .gt-dot { width:8px; height:8px; border-radius:50%; flex-shrink:0; }
.group-tab .gt-count { font-size:11px; opacity:0.75; }

/* ── 筛选激活态 ── */
.btn.filter-active { color:var(--primary); border-color:var(--primary); }

/* ══════════════════════════════════════════════════
   进度计划 · 左表 + 右轴 分离架构
   ══════════════════════════════════════════════════ */
.gantt-sub-bar {
  display:flex; align-items:center; gap:8px;
  padding:8px 16px 8px 24px; background:var(--bg);
  border-bottom:1px solid var(--border); flex-shrink:0;
}
.gantt-sub-bar .view-seg {
  display:inline-flex; background:#f5f7fb;
  border:1px solid #d7e0eb; border-radius:8px; padding:2px; gap:2px;
}
.gantt-sub-bar .view-seg .btn { border:none; background:transparent; border-radius:6px; color:#64748b; }
.gantt-sub-bar .view-seg .btn:hover { background:#fff; color:#334155; }
.gantt-sub-bar .view-seg .btn.active { background:#0f172a; color:#fff; }
.gantt-sub-bar .btn.active { color:var(--primary); border-color:var(--primary); background:var(--primary-100); }
/* 顶栏视图切换段（甘特/看板） */
.topbar-actions .view-seg {
  display:inline-flex; background:#e9eef7;
  border:1px solid #ccd7e6; border-radius:8px; padding:2px; gap:2px;
}
.topbar-actions .view-seg .btn { border:none; background:transparent; border-radius:6px; color:#64748b; }
.topbar-actions .view-seg .btn:hover { background:rgba(255,255,255,0.7); color:#334155; }
.topbar-actions .view-seg .btn.active { background:#2563eb; color:#fff; box-shadow:0 1px 2px rgba(37,99,235,0.22); }

.gantt-main { flex:1; display:flex; flex-direction:column; overflow:hidden; min-height:0; }
.gantt-split { flex:1; display:flex; overflow:hidden; min-height:0; border-bottom:1px solid var(--border); }

#ganttLeft {
  width:680px; flex-shrink:0; overflow-y:auto; overflow-x:hidden;
  background:var(--bg); border-right:1px solid var(--border);
}
#ganttLeft::-webkit-scrollbar { width:8px; height:8px; }
#ganttLeft::-webkit-scrollbar-thumb { background:#cbd5e1; border-radius:8px; }
.gantt-table { --gt-name-w:202px; width:100%; border-collapse:collapse; table-layout:fixed; font-size:13px; }
.gantt-table col.cg-wbs { width:36px; }
.gantt-table col.cg-name { width:var(--gt-name-w); }
.gantt-table col.cg-dur { width:48px; }
.gantt-table col.cg-date { width:58px; }
.gantt-table col.cg-pct { width:54px; }
.gantt-table col.cg-status { width:58px; }
.gantt-table col.cg-assignee { width:76px; }
.gantt-table col.cg-priority { width:48px; }
.gantt-table col.cg-actions { width:176px; }
.gantt-table thead th {
  position:sticky; top:0; z-index:2; height:58px; box-sizing:border-box;
  background:var(--bg-subtle,#f9fafb); border-bottom:2px solid var(--border);
  font-size:11px; font-weight:600; color:var(--text-sec); text-align:left;
  padding:0 8px; letter-spacing:.03em; white-space:nowrap;
}
.gantt-table .gh-wbs { width:36px; text-align:center; }
.gantt-table .gh-name { width:var(--gt-name-w); min-width:118px; }
.gantt-table .gh-dur { width:48px; text-align:center; }
.gantt-table .gh-date { width:58px; }
.gantt-table .gh-pct { width:54px; text-align:center; padding-right:0; }
.gantt-table tbody tr { height:96px; cursor:pointer; transition:background .1s; }
.gantt-table tbody tr:hover { background:var(--bg-hover); }
.gantt-table tbody tr.on { background:var(--primary-100); }
.gantt-table tbody tr.crit .gt-ntxt { color:var(--danger); }
.gantt-table tbody tr.overdue .gt-date:last-of-type { color:var(--danger); font-weight:600; }
.gantt-table tbody td {
  padding:0 7px; border-bottom:1px solid var(--border);
  white-space:nowrap; overflow:hidden; text-overflow:ellipsis; box-sizing:border-box;
  vertical-align:middle;
}
.gantt-table td.gt-wbs { text-align:center; font-size:11px; color:var(--text-tert); font-family:var(--font-mono); }
.gantt-table td.gt-name {
  width:var(--gt-name-w);
  color:var(--text);
  white-space:nowrap;
  overflow:hidden;
  text-overflow:ellipsis;
}
.gantt-table td.gt-name .gt-arr { display:inline-block; width:14px; color:var(--text-tert); cursor:pointer; user-select:none; font-size:10px; }
.gantt-table td.gt-name .gt-bullet { display:inline-block; width:14px; }
.gantt-table tbody tr.parent td.gt-name .gt-ntxt { font-weight:600; }
.gantt-table td.gt-name .gt-ntxt { cursor:text; }
.gantt-table td:nth-child(3) { text-align:center; color:var(--text-sec); font-size:12px; }
.gantt-table td.gt-date { font-size:11px; color:var(--text-sec); font-family:var(--font-mono); }
.gantt-table td.gt-date.editable:hover { background:var(--primary-100); color:var(--primary); border-radius:4px; }
.gantt-table td.gt-pct { text-align:center; padding-right:0; font-size:12px; color:var(--text-sec); font-variant-numeric:tabular-nums; }
.gantt-table td.gt-pct.editable:hover { background:var(--primary-100); color:var(--primary); border-radius:4px; }
.gantt-table th.gh-actions, .gantt-table td.gt-actions { width:176px; text-align:center; }
.gantt-table td.gt-actions {
  padding:0 4px;
  overflow:visible;
}
.gantt-table td.gt-actions button {
  width:22px; height:24px; margin:0 1px;
  border:1px solid transparent; border-radius:5px;
  background:transparent; color:#64748b;
  font-size:12px; line-height:1; cursor:pointer;
}
.gantt-table td.gt-actions button:hover:not(:disabled) {
  background:#eff6ff; border-color:#bfdbfe; color:#1d4ed8;
}
.gantt-table td.gt-actions button.danger:hover:not(:disabled) {
  background:#fef2f2; border-color:#fecaca; color:#dc2626;
}
.gantt-table td.gt-actions button:disabled {
  opacity:.28; cursor:not-allowed;
}
.gantt-table tbody tr:not(:hover):not(.on) td.gt-actions button:not(:disabled) { opacity:.45; }
.gantt-table .lt-inline {
  border:1.5px solid var(--primary); border-radius:4px; padding:2px 6px;
  font-size:13px; outline:none; font-family:inherit; box-sizing:border-box;
}
.gantt-table .qa-parent-tip {
  display:inline-flex; align-items:center; max-width:180px; height:22px; margin-right:6px; padding:0 7px;
  border-radius:999px; background:#e0f2fe; color:#0369a1; font-size:11px; white-space:nowrap; overflow:hidden; text-overflow:ellipsis; vertical-align:middle;
}
.gantt-table #qaRow td.qa-cell {
  text-align:left; color:var(--primary); font-size:13px; font-weight:500;
  cursor:pointer; user-select:none; padding-left:10px;
}
.gantt-table #qaRow td.qa-cell:hover { background:var(--primary-100); }
.gantt-table #qaRow.qa-active td {
  background:#eff6ff;
  border-top:1px solid #bfdbfe;
  border-bottom:1px solid #bfdbfe;
}

/* 状态/优先级/校验 */
.gantt-table th.gh-status, .gantt-table td.gt-status { width:52px; text-align:center; }
.gantt-table .st-badge { display:inline-block; padding:1px 7px; border-radius:10px; font-size:11px; font-weight:500; white-space:nowrap; }
.gantt-table td.gt-col { font-size:12px; color:var(--text-sec); text-align:center; }
.gantt-table.hide-assignee col.col-assignee,
.gantt-table.hide-priority col.col-priority { visibility:collapse; width:0; }
.gantt-table.hide-assignee .col-assignee { display:none; }
.gantt-table.hide-priority .col-priority { display:none; }
.gantt-table tr.invalid td { background:#fef2f2 !important; }
.gantt-table tr.invalid td.gt-date { color:#dc2626; font-weight:600; }
/* 拖拽重排序：手柄与插入指示线 */
.gantt-table td.gt-drag-handle { cursor:grab; }
.gantt-table tr[draggable="true"]:active td.gt-drag-handle { cursor:grabbing; }
.gantt-table tbody tr.drag-before td { box-shadow: inset 0 2px 0 #2563eb; }
.gantt-table tbody tr.drag-after td { box-shadow: inset 0 -2px 0 #2563eb; }
.gantt-table tbody tr.dragging { opacity:.5; }
/* 批量操作下拉菜单 */
.batch-menu { position:relative; display:inline-block; }
.batch-dropdown {
  display:none; position:absolute; bottom:calc(100% + 4px); right:0;
  background:#fff; border:1px solid #e5e7eb; border-radius:8px;
  box-shadow:0 8px 24px rgba(0,0,0,.12); min-width:148px; padding:4px; z-index:50;
}
.batch-dropdown.show { display:block; }
.batch-item {
  display:block; width:100%; text-align:left; padding:8px 12px;
  background:transparent; border:0; cursor:pointer; font-size:13px; color:#374151;
  border-radius:4px; transition:background .12s;
}
.batch-item:hover { background:#f3f4f6; }
.batch-item.danger { color:#dc2626; }
.batch-item.danger:hover { background:#fef2f2; }
.batch-sep { height:1px; background:#e5e7eb; margin:4px 0; }

/* 子工具栏搜索区 */
.gantt-sub-bar .input-sm { height:30px; padding:0 8px; font-size:13px; border:1px solid var(--border); border-radius:7px; background:var(--bg-elevated); }
.gantt-search:focus { border-color:var(--primary); outline:none; }
.gantt-quick-filters { display:flex; align-items:center; gap:4px; }
.gantt-quick-filters .btn {
  height:30px;
  border-color:#dbe4ef;
  background:#fff;
}
.gantt-quick-filters .btn.active {
  background:#e0f2fe;
  border-color:#38bdf8;
  color:#0369a1;
}
.gantt-quick-filters .btn:disabled {
  opacity:.45;
  cursor:not-allowed;
}
.timeline-zoom {
  width: 112px;
  height: 30px;
  accent-color: var(--primary);
  cursor: ew-resize;
}

/* 下拉菜单（导出/设置） */
.drop-menu { position:absolute; top:calc(100% + 6px); right:0; z-index:300;
  background:var(--bg-elevated); border:1px solid var(--border); border-radius:10px;
  box-shadow:0 8px 28px rgba(0,0,0,0.14); padding:6px; min-width:180px; }
.drop-item { padding:8px 12px; border-radius:7px; cursor:pointer; font-size:13px; color:var(--text); white-space:nowrap; }
.drop-item:hover { background:var(--bg-hover); }
.settings-panel { padding:10px 12px; }
.settings-panel .drop-head { font-size:11px; font-weight:600; color:var(--text-tert); margin:2px 0 6px; letter-spacing:.04em; }
.drop-check { display:flex; align-items:center; gap:8px; padding:5px 4px; font-size:13px; color:var(--text); cursor:pointer; }
.drop-check input { accent-color:var(--primary); }

/* 依赖 chip */
.dep-chip { display:flex; align-items:center; justify-content:space-between; gap:8px;
  background:var(--bg-subtle,#f3f4f6); border-radius:7px; padding:5px 8px 5px 10px; font-size:13px; }
.dep-chip .input-sm { height:28px; padding:0 6px; border:1px solid var(--border); border-radius:6px; background:#fff; font-size:12px; }
.dep-chip button { border:none; background:transparent; color:#dc2626; font-size:15px; cursor:pointer; line-height:1; padding:0 4px; }
.dep-chip button:hover { color:#b91c1c; }

/* ── 甘特图标标记 ── */
.marker-panel { display:flex; flex-direction:column; gap:12px; }
.marker-toolbar { display:flex; align-items:flex-end; gap:8px; flex-wrap:wrap; }
.marker-date-field { display:flex; flex-direction:column; gap:5px; width:170px; font-size:12px; color:var(--text-sec); }
.marker-date-field .input { height:34px; padding:6px 10px; font-size:13px; }
.marker-icon-grid {
  display:grid;
  grid-template-columns: repeat(auto-fit, minmax(150px, 1fr));
  gap:10px;
}
.marker-cat {
  border:1px solid var(--border);
  border-radius:8px;
  padding:8px;
  background:#f8fafc;
}
.marker-cat-title {
  font-size:12px;
  font-weight:600;
  color:var(--text-sec);
  margin-bottom:7px;
}
.marker-cat-grid {
  display:grid;
  grid-template-columns: repeat(2, minmax(0, 1fr));
  gap:8px;
}
.marker-icon-btn {
  min-width:0;
  height:58px;
  display:flex;
  align-items:center;
  gap:8px;
  padding:8px 9px;
  border:1px solid #dbe4ef;
  border-radius:7px;
  background:#fff;
  color:var(--text);
  font-size:13px;
  cursor:pointer;
  text-align:left;
}
.marker-icon-btn:hover {
  border-color:#93c5fd;
  background:#eff6ff;
  color:#1d4ed8;
}
.marker-icon-btn--equipment,
.marker-icon-btn--flag {
  height:96px;
}
.marker-icon-preview,
.marker-chip-icon {
  width:34px;
  height:34px;
  flex:0 0 34px;
  display:inline-flex;
  align-items:center;
  justify-content:center;
  border:1px solid #e2e8f0;
  border-radius:8px;
  background:#fff;
  box-shadow:0 1px 3px rgba(15,23,42,0.08);
}
.marker-icon-preview svg,
.marker-chip-icon svg {
  width:26px;
  height:26px;
  display:block;
}
.marker-icon-preview img,
.marker-chip-icon img {
  width:26px;
  height:26px;
  display:block;
  object-fit:contain;
}
.marker-icon-btn--equipment .marker-icon-preview,
.marker-icon-btn--flag .marker-icon-preview {
  width:76px;
  height:76px;
  flex-basis:76px;
  border:none;
  box-shadow:none;
  background:transparent;
}
.marker-icon-btn--equipment .marker-icon-preview svg,
.marker-icon-btn--equipment .marker-icon-preview img,
.marker-icon-btn--flag .marker-icon-preview svg,
.marker-icon-btn--flag .marker-icon-preview img {
  width:72px;
  height:72px;
}
.marker-current-title {
  font-size:12px;
  font-weight:600;
  color:var(--text-sec);
}
.marker-current-list { display:flex; flex-wrap:wrap; gap:6px; min-height:26px; }
.marker-empty { color:#9ca3af; font-size:12px; line-height:26px; }
.marker-chip { display:inline-flex; align-items:center; gap:8px; background:#eff6ff; border:1px solid #dbeafe;
  border-radius:8px; padding:5px 9px 5px 6px; font-size:13px; color:#1e40af; }
.marker-chip button { border:none; background:transparent; color:#dc2626; font-size:16px; cursor:pointer; line-height:1; padding:0 2px; }
.marker-add-row { display:flex; gap:6px; align-items:center; margin-top:8px; flex-wrap:wrap; }

/* 底部统计栏（斑马风格）*/
.gantt-summary-bar {
  display:flex; align-items:center; gap:16px;
  padding:6px 16px; background:#f8fafc; border-top:1px solid #e2e8f0;
  font-size:12px; flex-shrink:0;
}
.gs-left { display:flex; gap:12px; align-items:center; flex-wrap:wrap; }
.gs-stat {
  display:inline-flex; align-items:center; gap:4px;
  padding:2px 8px; border-radius:4px; white-space:nowrap;
}
.gs-stat .num { font-weight:700; font-size:14px; }
.gs-stat .lbl { color:#64748b; }
.gs-stat.total { background:#f1f5f9; }
.gs-stat.done { background:#ecfdf5; }
.gs-stat.active { background:#eff6ff; }
.gs-stat.none { background:#f8fafc; }
.gs-stat.overdue { background:#fef2f2; }
.gs-stat.paused { background:#fffbeb; }
.gs-right { display:flex; align-items:center; gap:6px; margin-left:auto; flex-shrink:0; }
.gs-label { color:#64748b; white-space:nowrap; font-size:12px; }
.gs-notes {
  border:1px solid #e2e8f0; border-radius:4px; padding:3px 8px;
  font-size:12px; background:#fff; width:260px; outline:none; transition:border-color 0.15s;
}
.gs-notes:focus { border-color:#2563eb; box-shadow:0 0 0 2px rgba(37,99,235,0.1); }

/* ── 拓扑模式切换 ── */
.graph-mode-switch { display:inline-flex; border:1px solid var(--border); border-radius:6px; overflow:hidden; }
.graph-mode-btn { border:none; background:transparent; padding:5px 12px; font-size:12px; cursor:pointer; color:var(--text-sec); border-right:1px solid var(--border); transition:all .15s; }
.graph-mode-btn:last-child { border-right:none; }
.graph-mode-btn:hover { background:var(--primary-light); color:var(--primary); }
.graph-mode-btn.active { background:var(--primary); color:#fff; }

/* ── 汇总看板 ── */
.dash-cards { display:flex; gap:14px; flex-wrap:wrap; margin-bottom:18px; }
.dash-card { flex:1; min-width:120px; background:var(--bg-elevated); border:1px solid var(--border);
  border-radius:12px; padding:18px 16px; text-align:center; }
.dash-card .dc-val { font-size:30px; font-weight:700; line-height:1.1; }
.dash-card .dc-label { font-size:13px; color:var(--text-sec); margin-top:6px; }
.dash-row { display:flex; gap:16px; flex-wrap:wrap; }
.dash-panel { flex:1; min-width:280px; background:var(--bg-elevated); border:1px solid var(--border); border-radius:12px; padding:16px 18px; }
.dash-panel h4 { font-size:14px; font-weight:600; color:var(--text); margin-bottom:8px; }
.dash-legend { display:flex; flex-wrap:wrap; gap:8px 16px; justify-content:center; margin-top:6px; }
.dash-legend .lg-item { display:inline-flex; align-items:center; gap:6px; font-size:12px; color:var(--text-sec); }
.dash-legend .lg-item i { width:11px; height:11px; border-radius:3px; display:inline-block; }
.dash-overdue { max-height:280px; overflow-y:auto; }
.od-item { display:flex; justify-content:space-between; align-items:center; gap:10px; padding:9px 4px; border-bottom:1px solid var(--border); }
.od-item:last-child { border-bottom:none; }
.od-name { font-size:13px; color:var(--text); overflow:hidden; text-overflow:ellipsis; white-space:nowrap; }
.od-meta { font-size:12px; color:#dc2626; white-space:nowrap; flex-shrink:0; }
.view-tab.active { background:var(--primary); color:#fff; }
.gantt-resizer { width:5px; flex-shrink:0; cursor:col-resize; background:transparent; transition:background .1s; }
.gantt-resizer:hover, .gantt-resizer.drag { background:var(--primary); }
#ganttRight { flex:1; overflow:auto; min-width:0; position:relative; }
#ganttRight canvas { display:block; }

/* ══════════════════════════════════════════════════
   拓扑图 · 简洁版
   ══════════════════════════════════════════════════ */
.topo-main { flex:1; display:flex; overflow:hidden; min-height:0; padding:0; }

/* 顶部工具栏 */
.topo-toolbar {
  position:absolute; top:12px; left:50%; transform:translateX(-50%);
  display:flex; align-items:center; gap:6px;
  background:#fff; border:1px solid #e5e7eb; border-radius:8px;
  padding:6px 10px; z-index:5;
  box-shadow:0 2px 8px rgba(0,0,0,0.08);
}
.tool-btn {
  padding:6px 14px; border-radius:6px; border:none;
  background:transparent; color:#6b7280; font-size:12px;
  cursor:pointer; transition:all .12s; font-family:inherit;
}
.tool-btn:hover{background:#f5f5f5;color:#1f2937}
.tool-btn.active{background:#2563eb;color:#fff}
.tool-sep{width:1px;height:20px;background:#e5e7eb}

/* 布局按钮 */
.layout-btn {
  padding:6px 12px; border-radius:6px; border:1px solid #e5e7eb;
  background:#fff; color:#6b7280; font-size:11px;
  cursor:pointer; transition:all .12s; font-family:inherit;
}
.layout-btn:hover{border-color:#2563eb;color:#2563eb}
.layout-btn.active{background:#2563eb;color:#fff;border-color:#2563eb}

/* 画布 */
.topo-stage {
  flex:1; position:relative; min-width:0; overflow:hidden;
  background:#fff;
}
.topo-stage canvas { display:block; width:100%; height:100%; }

/* 节点样式按钮 */
.type-btns {
  position:absolute; top:12px; left:12px;
  display:flex; flex-direction:column; gap:6px; z-index:5;
}
.type-btn {
  width:36px; height:36px; border-radius:8px; border:2px solid;
  cursor:pointer; transition:all .12s; font-size:16px;
  display:flex; align-items:center; justify-content:center;
}
.type-btn:hover{transform:scale(1.1)}

/* 属性面板 */
.topo-props {
  width:200px; flex-shrink:0; background:#fafafa;
  border-left:1px solid #e5e7eb; display:flex; flex-direction:column;
}
.topo-props .tp-head {
  padding:12px 16px; font-size:13px; font-weight:600; 
  color:#1f2937; border-bottom:1px solid #e5e7eb;
}
.topo-props .tp-body { flex:1; overflow-y:auto; padding:12px; }
.topo-props .tip { color:#9ca3af; font-size:12px; text-align:center; padding:20px; }

.prop-group { margin-bottom:12px; }
.prop-group label { display:block; font-size:11px; font-weight:500; color:#6b7280; margin-bottom:6px; }
.prop-group input[type="text"] {
  width:100%; padding:6px 10px; border:1px solid #e5e7eb; border-radius:6px;
  font-size:13px; background:#fff;
}
.prop-group input[type="text"]:focus{border-color:#2563eb;outline:none}

.color-picker { display:flex; gap:6px; flex-wrap:wrap; }
.color-dot {
  width:24px; height:24px; border-radius:50%; cursor:pointer;
  border:2px solid transparent; transition:all .1s;
}
.color-dot:hover{transform:scale(1.15)}
.color-dot.active{border-color:#1f2937}

.shape-picker { display:flex; gap:4px; }
.shape-picker button {
  flex:1; padding:6px; border:1px solid #e5e7eb; border-radius:6px;
  background:#fff; font-size:11px; cursor:pointer; transition:all .12s;
}
.shape-picker button:hover{border-color:#2563eb}
.shape-picker button.active{background:#2563eb;color:#fff;border-color:#2563eb}
.shape-picker.topo-type-picker {
  display: grid;
  grid-template-columns: repeat(3, minmax(0, 1fr));
  gap: 6px;
}
.shape-picker.topo-type-picker button {
  min-width: 0;
  height: 30px;
  padding: 0 6px;
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: nowrap;
}
@media (max-width: 900px) {
  .shape-picker.topo-type-picker {
    grid-template-columns: repeat(2, minmax(0, 1fr));
  }
}

.del-btn {
  width:100%; padding:8px; border:1px solid #fecaca; border-radius:6px;
  background:#fef2f2; color:#dc2626; font-size:12px; cursor:pointer;
}
.del-btn:hover{background:#fee2e2}

/* 节点编辑弹窗 */
.modal-overlay{display:none;position:fixed;inset:0;background:rgba(0,0,0,0.35);z-index:999;justify-content:center;align-items:center}
.modal-overlay.show{display:flex}
.modal{background:var(--bg-elevated);border-radius:14px;box-shadow:0 12px 40px rgba(0,0,0,0.18);width:460px;max-width:90vw;max-height:85vh;overflow-y:auto;animation:modalIn .2s ease}
@keyframes modalIn{from{opacity:0;transform:translateY(12px)}to{opacity:1;transform:translateY(0)}}
.modal-hd{display:flex;justify-content:space-between;align-items:center;padding:16px 20px;border-bottom:1px solid var(--border)}
.modal-hd h3{font-size:16px;font-weight:600;color:var(--text)}
.modal-close{width:30px;height:30px;border:none;border-radius:7px;background:transparent;cursor:pointer;font-size:18px;color:var(--text-tert);display:flex;align-items:center;justify-content:center}
.modal-close:hover{background:var(--bg-hover);color:var(--text)}
.modal-bd{padding:20px}
.modal-ft{display:flex;justify-content:flex-end;gap:10px;padding:14px 20px;border-top:1px solid var(--border)}
.modal-bd .fg{margin-bottom:14px}
.modal-bd .fg:last-child{margin-bottom:0}
.modal-bd .fg label{display:block;font-size:12px;font-weight:500;color:var(--text-sec);margin-bottom:6px}
.modal-bd .fg input[type="text"],.modal-bd .fg textarea,.modal-bd .fg select{
  width:100%;padding:8px 12px;border:1px solid var(--border);border-radius:8px;
  font-size:14px;font-family:inherit;background:var(--bg);color:var(--text);outline:none;
  transition:all .12s;
}
.modal-bd .fg input:focus,.modal-bd .fg textarea:focus,.modal-bd .fg select:focus{border-color:var(--primary);background:var(--bg-elevated);box-shadow:0 0 0 3px rgba(37,99,235,0.1)}
.modal-bd .fg textarea{resize:vertical;min-height:60px}
.modal-bd .fr{display:flex;gap:12px}
.modal-bd .fr .fg{flex:1}
.modal-bd .fg input[type="color"]{width:100%;height:38px;padding:3px;border:1px solid var(--border);border-radius:8px;background:var(--bg);cursor:pointer}
.modal-bd .fg input[type="range"]{width:100%;accent-color:var(--primary)}

/* Toast 提示 */
.toast{
  position:fixed;top:64px;left:50%;transform:translateX(-50%);
  padding:10px 22px;border-radius:10px;font-size:13px;z-index:9999;
  box-shadow:0 6px 20px rgba(0,0,0,0.14);pointer-events:none;
  opacity:0;transition:opacity .25s;
}
.toast.show{opacity:1}
.toast-s{background:#dcfce7;color:#16a34a;border:1px solid #bbf7d0}
.toast-e{background:#fef2f2;color:#dc2626;border:1px solid #fecaca}

/* ── 进度计划 · 企业级视觉打磨 ── */
.main:has(.gantt-main) {
  background: #f3f6fa;
}
.main:has(.gantt-main) .topbar {
  background: linear-gradient(180deg,#ffffff 0%,#f7fafc 100%);
  border-bottom: 1px solid #d8e0ea;
  box-shadow: 0 1px 0 rgba(15,23,42,.04);
}
.main:has(.gantt-main) .topbar-title {
  font-weight: 700;
  letter-spacing: 0;
}
.gantt-sub-bar {
  background: #f4f7fb;
  border-bottom: 1px solid #d6dee9;
  box-shadow: inset 0 -1px 0 rgba(255,255,255,.8);
}
.gantt-sub-bar .view-seg,
.topbar-actions .view-seg {
  background: #e8eef6;
  border-color: #cfd9e6;
}
.gantt-sub-bar .input-sm {
  background: #fff;
  border-color: #ccd6e3;
  box-shadow: 0 1px 2px rgba(15,23,42,.04);
}
.gantt-legend {
  display: flex;
  align-items: center;
  gap: 10px;
  min-width: 0;
  flex-wrap: wrap;
  margin-left: 8px;
  color: #64748b;
  font-size: 11px;
  line-height: 1;
  max-height: 30px;
  overflow: hidden;
}
.gantt-legend .gl-item {
  display: inline-flex;
  align-items: center;
  gap: 4px;
  white-space: nowrap;
}
.gantt-legend .gl-dot {
  width: 8px;
  height: 8px;
  border-radius: 50%;
  box-shadow: inset 0 0 0 1px rgba(15,23,42,.08);
}
.gantt-legend .gl-line {
  width: 18px;
  height: 0;
  border-top: 2px solid #dc2626;
}
.gantt-legend .gl-invalid {
  border-top-style: dashed;
}
.gantt-split {
  background: #f5f7fa;
  border-top: 1px solid rgba(255,255,255,.75);
  border-bottom-color: #d4deea;
}
#ganttLeft {
  background: #fbfcfe;
  border-right: 1px solid #b9c6d6;
  box-shadow: 6px 0 18px rgba(15,23,42,.04);
}
.gantt-table thead th {
  background: linear-gradient(180deg,#f8fafc 0%,#eef3f8 100%);
  border-bottom-color: #cbd5e1;
  color: #475569;
}
.gantt-table tbody tr:nth-child(even):not(#qaRow) td {
  background: rgba(248,250,252,.72);
}
.gantt-table tbody tr:hover td {
  background: #eef6ff;
}
.gantt-table tbody tr.on td {
  background: #dbeafe;
  box-shadow: inset 4px 0 0 #2563eb;
}
.gantt-table tbody tr.parent td {
  background: #f1f5f9;
}
.gantt-table tbody tr.parent td.gt-name .gt-ntxt {
  color: #0f172a;
}
.gantt-table tbody tr.crit td.gt-name .gt-ntxt {
  color: #dc2626;
  font-weight: 700;
}
.gantt-table tbody td {
  border-bottom-color: #d5deea;
}
.gantt-table #qaRow td.qa-cell {
  background: #f8fbff;
  border-top: 1px dashed #bfdbfe;
}
.gantt-table #qaRow td.qa-cell:hover {
  background: #e0f2fe;
}
.gantt-resizer {
  width: 6px;
  background: linear-gradient(90deg,#dbe3ee 0,#f8fafc 50%,#dbe3ee 100%);
}
.gantt-resizer:hover,
.gantt-resizer.drag {
  background: #2563eb;
}
#ganttRight {
  background: #fbfcfe;
}
#ganttRight canvas {
  background: transparent;
}
.gantt-table {
  color: #111827;
}
.gantt-table thead th {
  background: #eef3f8;
  color: #263648;
  font-weight: 700;
  border-right: 1px solid #d8e0ea;
}
.gantt-table tbody td {
  color: #1f2937;
  border-right: 1px solid #e2e8f0;
  border-bottom-color: #d6dee8;
}
.gantt-table tbody td:last-child,
.gantt-table thead th:last-child {
  border-right: 0;
}
.gantt-table td.gt-wbs,
.gantt-table td.gt-date,
.gantt-table td.gt-pct,
.gantt-table td.gt-col,
.gantt-table td:nth-child(3) {
  color: #374151;
}
.gantt-table td.gt-name .gt-ntxt {
  color: #111827;
}
.gantt-table tbody tr.parent td {
  background: #eef2f6;
  color: #0f172a;
  font-weight: 700;
}
.gantt-table tbody tr.parent td.gt-name .gt-ntxt {
  color: #0b1220;
  font-weight: 800;
}
.gantt-table tbody tr.crit td.gt-name .gt-ntxt,
.gantt-table tbody tr.crit td.gt-date,
.gantt-table tbody tr.crit td.gt-pct,
.gantt-table tbody tr.overdue td.gt-name .gt-ntxt,
.gantt-table tbody tr.overdue td.gt-date,
.gantt-table tbody tr.overdue td.gt-pct {
  color: #c42b39;
  font-weight: 700;
}
.gantt-table .st-badge {
  border-radius: 3px;
  font-weight: 700;
}
.hint-foot {
  background: #f6f9fd !important;
  border-top: 1px solid #d8e1ed;
  color: #64748b !important;
  box-shadow: inset 0 1px 0 rgba(255,255,255,.8);
}
.gantt-action-foot {
  min-height: 46px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 7px 16px 7px 18px;
  font-size: 13px;
  flex-wrap: wrap;
}
#selTaskHint {
  overflow: hidden;
  text-overflow: ellipsis;
  white-space: normal;
  min-width: 0;
  flex: 1 1 260px;
  line-height: 1.35;
}
.gantt-foot-actions {
  display: inline-flex;
  align-items: center;
  gap: 6px;
  flex: 0 1 auto;
  flex-wrap: wrap;
  justify-content: flex-end;
}
.gantt-foot-actions .btn {
  min-width: 56px;
  height: 30px;
  padding: 0 10px;
  white-space: nowrap;
}
.gantt-foot-actions .btn:disabled {
  opacity: .62;
  cursor: default;
  background: #f1f5f9;
  color: #94a3b8;
  border-color: #e2e8f0;
}
.gantt-foot-actions .btn.danger:not(:disabled) {
  color: #dc2626;
}
.gantt-foot-actions .btn.danger:not(:disabled):hover {
  background: #fee2e2;
}
.gantt-action-foot:has(.gantt-foot-actions .btn:not(:disabled)) {
  background:#eef6ff !important;
}
.gantt-action-foot:has(.gantt-foot-actions .btn:not(:disabled)) #selTaskHint {
  color:#1e40af;
  font-weight:600;
}
/* 甘特图浮动批量操作栏 */
.gantt-floating-batch {
  position: fixed;
  bottom: 20px;
  left: 50%;
  transform: translateX(-50%);
  z-index: 500;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 16px;
  background: #1e293b;
  color: #fff;
  border-radius: 10px;
  box-shadow: 0 4px 20px rgba(0,0,0,0.25);
  font-size: 13px;
}
.gantt-floating-batch .gantt-batch-count {
  font-weight: 600;
  margin-right: 4px;
  white-space: nowrap;
}
.gantt-floating-batch .btn {
  color: #cbd5e1 !important;
  border-color: #475569 !important;
  background: transparent !important;
}
.gantt-floating-batch .btn:hover {
  color: #fff !important;
  border-color: #94a3b8 !important;
  background: rgba(255,255,255,0.1) !important;
}
.gantt-floating-batch .batch-dropdown {
  bottom: calc(100% + 8px);
  top: auto;
  background: #1e293b;
  border-color: #475569;
}
.gantt-floating-batch .batch-dropdown .batch-item {
  color: #cbd5e1;
}
.gantt-floating-batch .batch-dropdown .batch-item:hover {
  background: #334155;
  color: #fff;
}
.gantt-floating-batch .batch-dropdown .batch-item.danger {
  color: #fca5a5;
}
.gantt-floating-batch .batch-dropdown .batch-item.danger:hover {
  background: #7f1d1d;
  color: #fecaca;
}
.gantt-floating-batch .batch-dropdown .batch-sep {
  border-color: #475569;
}
.main:has(.gantt-main) .topbar-actions .view-seg {
  background:#e9eef7;
  border-color:#ccd7e6;
}
.main:has(.gantt-main) .topbar-actions .view-seg .btn.active {
  background:#2563eb;
  color:#fff;
}
.main:has(.gantt-main) .gantt-sub-bar .view-seg {
  background:#f5f7fb;
  border-color:#d7e0eb;
}
.main:has(.gantt-main) .gantt-sub-bar .view-seg .btn.active {
  background:#0f172a;
  color:#fff;
}
.drop-menu {
  border-color: #cfd8e6;
  box-shadow: 0 12px 36px rgba(15,23,42,.16);
}
.dash-card,
.dash-panel {
  border-color: #d5deea;
  box-shadow: 0 8px 24px rgba(15,23,42,.05);
}
.cell-images {
  cursor: pointer;
  min-width: 220px;
  padding: 8px 12px !important;
  white-space: normal;
}
.cell-images.img-over {
  outline: 2px solid var(--primary);
  outline-offset: -2px;
  background: #eff6ff !important;
}
.img-add {
  height: 64px;
  min-width: 148px;
  padding: 0 16px;
  border: 1px dashed #b8c2d0;
  border-radius: 6px;
  color: #64748b;
  background: #f8fafc;
  font-size: 12px;
  cursor: pointer;
}
.img-cell-wrap {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  max-width: 100%;
}
.img-thumb {
  width: 96px;
  height: 68px;
  object-fit: cover;
  border-radius: 5px;
  border: 1px solid #d6dee9;
  background: #f8fafc;
}
.img-count {
  min-width: 42px;
  height: 24px;
  padding: 0 8px;
  border-radius: 5px;
  background: #0f172a;
  color: #fff;
  font-size: 11px;
  line-height: 24px;
  text-align: center;
}
.img-panel-mask {
  display: none;
  position: fixed;
  inset: 0;
  z-index: 3000;
  background: rgba(15,23,42,.34);
  align-items: center;
  justify-content: center;
  padding: 24px;
}
.img-panel-mask.show { display: flex; }
.img-panel {
  width: min(980px, 96vw);
  max-height: min(720px, 92vh);
  overflow: auto;
  background: #fff;
  border-radius: 8px;
  box-shadow: 0 24px 80px rgba(15,23,42,.24);
}
.img-panel-head {
  display: flex;
  align-items: center;
  justify-content: space-between;
  padding: 14px 18px;
  border-bottom: 1px solid #e5eaf1;
}
.img-panel-head h3 { font-size: 16px; font-weight: 600; }
.img-panel-head .x { font-size: 22px; color: #64748b; cursor: pointer; }
.img-drop {
  margin: 16px 18px;
  padding: 18px;
  border: 1px dashed #aebbd0;
  border-radius: 8px;
  text-align: center;
  background: #f8fafc;
  cursor: pointer;
}
.img-drop.drag {
  border-color: var(--primary);
  background: #eff6ff;
}
.img-drop-title { font-size: 14px; font-weight: 600; color: #0f172a; }
.img-drop-sub { margin-top: 6px; font-size: 12px; color: #64748b; }
.img-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(220px, 1fr));
  gap: 12px;
  padding: 0 18px 18px;
}
.img-card {
  position: relative;
  border: 1px solid #e0e6ef;
  border-radius: 8px;
  overflow: hidden;
  background: #f8fafc;
}
.img-card img {
  width: 100%;
  aspect-ratio: 16 / 10;
  object-fit: cover;
  display: block;
}
.img-card > button {
  position: absolute;
  right: 8px;
  top: 8px;
  padding: 4px 10px;
  border-radius: 5px;
  background: rgba(15,23,42,.78);
  color: #fff;
  font-size: 12px;
  cursor: pointer;
}
.img-card-name {
  padding: 6px 8px;
  font-size: 12px;
  color: #64748b;
  white-space: nowrap;
  overflow: hidden;
  text-overflow: ellipsis;
  background: #fff;
  border-top: 1px solid #e7edf5;
}
.img-empty {
  grid-column: 1 / -1;
  padding: 28px;
  text-align: center;
  color: #94a3b8;
}

/* ── 游客模式（本地存储）── */
.guest-banner {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  padding: 8px 18px;
  background: var(--warning-light);
  border-bottom: 1px solid #fde68a;
  color: var(--warning);
  font-size: 13px;
  line-height: 1.5;
}
.guest-banner .gb-login {
  flex-shrink: 0;
  padding: 4px 12px;
  background: var(--warning);
  color: #fff;
  border-radius: 6px;
  font-weight: 600;
  font-size: 12px;
  white-space: nowrap;
}
.guest-banner .gb-login:hover { opacity: .9; }

/* 游客头像（侧边栏）— 与 .user-avatar 一致但用警示色提示 */
.sidebar-footer .guest-avatar {
  background: var(--warning);
  color: #fff;
  cursor: pointer;
  text-decoration: none;
  display: inline-flex;
  align-items: center;
  justify-content: center;
}
.sidebar-footer .guest-avatar:hover { background: #b45309; }

/* ── 选区式合并单元格 v2 ── */
.excel-selection-overlay {
  position: fixed;
  z-index: 55;
  pointer-events: none;
  background: rgba(37, 99, 235, 0.12);
  border: 2px solid rgba(37, 99, 235, 0.92);
  box-shadow: inset 0 0 0 1px rgba(255,255,255,0.7);
  box-sizing: border-box;
}
.ledger td.cell-fill-preview {
  background: rgba(22, 163, 74, 0.12) !important;
  box-shadow: inset 0 0 0 1px rgba(22, 163, 74, 0.55), inset 0 0 0 9999px rgba(22, 163, 74, 0.02);
}
.ledger thead th.th-selected .th-inner {
  background: var(--primary-100);
  color: var(--primary);
}

/* 浮动选区操作栏 */
.sel-float-bar {
  position: fixed;
  z-index: 360;
  display: flex;
  align-items: center;
  gap: 8px;
  padding: 8px 14px;
  background: #fff;
  border: 1px solid var(--border);
  border-radius: var(--radius-lg);
  box-shadow: var(--shadow-lg);
  opacity: 0;
  transform: translateY(-6px);
  transition: opacity 0.18s, transform 0.18s;
  pointer-events: none;
  max-width: calc(100vw - 16px);
  overflow-x: auto;
  white-space: nowrap;
}
.sel-float-bar.show {
  opacity: 1;
  transform: translateY(0);
  pointer-events: auto;
}
.sel-float-count {
  font-size: 13px;
  font-weight: 600;
  color: var(--text);
  white-space: nowrap;
  padding-right: 6px;
  border-right: 1px solid var(--border);
  margin-right: 2px;
}
.sel-float-sep {
  width: 1px;
  align-self: stretch;
  background: var(--border);
  margin: 0 2px;
}
.sel-tool-label {
  font-size: 12px;
  color: var(--text-tert);
  font-weight: 600;
  margin-left: 2px;
}
.sel-color-btn {
  width: 22px;
  height: 22px;
  border-radius: 999px;
  background: var(--sw);
  border: 2px solid #fff;
  box-shadow: 0 0 0 1px var(--border);
  cursor: pointer;
}
.sel-color-btn:hover {
  box-shadow: 0 0 0 2px var(--primary);
}
.sel-text-color-btn {
  color: var(--sw);
  background: #fff;
  font-size: 13px;
  font-weight: 800;
  line-height: 18px;
}
.sel-bold-btn {
  font-weight: 800;
  font-family: Georgia, serif;
  min-width: 30px;
}

/* 列头拖动重排 */
.ledger thead th[data-col-idx] { cursor: pointer; user-select: none; }
.ledger thead th[data-col-idx]:active { cursor: pointer; }
.th-drag-hint { opacity: 0.5; }
.th-drop-target { box-shadow: inset 3px 0 0 var(--primary); }
.th-drop-target-right { box-shadow: inset -3px 0 0 var(--primary); }
/* 填充柄 */
.sel-fill-handle { position:fixed; z-index:55; width:8px; height:8px; background:var(--primary); border:1px solid #fff; cursor:crosshair; border-radius:1px; pointer-events:auto; }
.sel-fill-preview { pointer-events:none; z-index:49; }

/* 合并检测页 */
.login-card select.input {
  width: 100%;
  margin: 6px 0;
}
