/* =============================================================
   Views · 各视图专属样式
   ============================================================= */

/* ---------------- 项目列表：状态 tab + 筛选 ---------------- */
.status-tabs {
  display: flex; align-items: center; gap: 36px;
  border-bottom: 1px solid var(--border); margin-bottom: var(--sp-5);
}
.status-tab {
  height: 52px; border-bottom: 2px solid transparent;
  font-size: var(--fs-base); font-weight: var(--fw-semibold); color: var(--text-muted);
  transition: color var(--t-fast), border-color var(--t-fast); white-space: nowrap;
}
.status-tab:hover { color: var(--text); }
.status-tab.active { color: var(--brand-700); border-bottom-color: var(--brand-600); }
.status-tabs-spacer { flex: 1; }
.project-inline-search {
  display: flex; align-items: center; gap: 8px;
  width: 240px; height: 40px; padding: 0 12px;
  border: 1px solid var(--border); border-radius: var(--r-md);
  background: var(--surface); color: var(--text-faint);
  transition: border-color var(--t-fast), box-shadow var(--t-fast);
}
.project-inline-search:focus-within { border-color: var(--brand-500); box-shadow: var(--ring-brand); }
.project-inline-search .msym { font-size: 18px; }
.project-inline-search input { flex: 1; border: none; outline: none; background: none; font-size: var(--fs-sm); color: var(--text-strong); }
.pill-btn {
  height: 40px; padding: 0 14px; display: inline-flex; align-items: center; gap: 6px;
  border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface);
  color: var(--text); font-size: var(--fs-sm); font-weight: var(--fw-medium);
  transition: background var(--t-fast), border-color var(--t-fast);
}
.pill-btn:hover { background: var(--gray-50); border-color: var(--border-strong); }
.pill-btn .msym { font-size: 18px; color: var(--text-muted); }

/* ---------------- 项目表格 ---------------- */
.table-card { padding: 0; overflow: hidden; }
.project-table-scroll { overflow-x: auto; }
.project-grid {
  display: grid;
  grid-template-columns: minmax(180px, 0.64fr) minmax(442px, 1.58fr) minmax(182px, 0.58fr) minmax(300px, 1.06fr) 120px;
  align-items: center;
  min-width: 1228px;
}
.table-head {
  min-height: 54px; padding: 0 var(--sp-6);
  background: var(--gray-25); color: var(--text-muted);
  font-size: var(--fs-sm); font-weight: var(--fw-semibold);
  border-bottom: 1px solid var(--border);
}
.table-head .cell-center { text-align: center; padding-right: 0; }
.table-head .cell-actions { text-align: right; }
.table-row { min-height: 150px; padding: var(--sp-5) var(--sp-6); border-bottom: 1px solid var(--border-faint); transition: background var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out); }
.table-row:last-child { border-bottom: none; }
.table-row:hover { background: linear-gradient(90deg, rgba(51,112,255,0.035), transparent 40%); box-shadow: inset 3px 0 0 var(--brand-500); }
.project-grid .cell { min-width: 0; padding-right: var(--sp-5); }
.project-grid .cell:last-child { padding-right: 0; }
/* 列间留白：避免「交付里程碑 / 交付进度 / 核心团队」三列拥挤 */
.table-row .cell:nth-child(3),
.table-row .cell:nth-child(4) { padding-left: 22px; }

/* 项目 / 状态 / 创建人 合并列 */
.project-name-cell { display: grid; gap: 6px; justify-items: start; }
.project-name-cell .status { margin-bottom: 1px; }
.project-name-cell .project-title { font-size: var(--fs-base); font-weight: var(--fw-bold); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 100%; line-height: 1.3; }
.project-name-cell .project-id { font-size: var(--fs-2xs); color: var(--text-faint); font-variant-numeric: tabular-nums; letter-spacing: 0.01em; }

/* 里程碑块 */
.milestone-block { display: grid; gap: 8px; }
.milestone-overview { display: flex; align-items: baseline; justify-content: space-between; font-size: var(--fs-2xs); font-weight: var(--fw-bold); color: var(--text-muted); }
.milestone-overview strong { font-size: var(--fs-base); font-weight: var(--fw-bold); color: var(--brand-700); }
.milestone-overview strong em { font-size: var(--fs-2xs); font-weight: var(--fw-semibold); font-style: normal; color: var(--text-muted); margin-left: 2px; }
.milestone-overview strong.is-zero { color: var(--text-faint); }
.milestone-goal-list { display: grid; grid-template-columns: repeat(5, minmax(78px, 1fr)); gap: 6px; }
.milestone-goal-card {
  min-width: 0; min-height: 64px; padding: 9px 8px; border-radius: var(--r-md);
  display: grid; align-content: space-between; gap: 6px;
  border: 1px solid var(--gc-bd, var(--border)); background: var(--gc-bg, var(--gray-25));
  transition: transform var(--t-base) var(--ease-out), box-shadow var(--t-base) var(--ease-out);
}
.table-row:hover .milestone-goal-card:not(.is-empty) { box-shadow: 0 4px 12px color-mix(in srgb, var(--gc) 16%, transparent); }
.milestone-goal-card.tone-blue   { --gc: var(--goal-exec);    --gc-bg: var(--brand-50);   --gc-bd: color-mix(in srgb, var(--goal-exec) 22%, white); }
.milestone-goal-card.tone-orange { --gc: var(--goal-adopt);   --gc-bg: var(--warning-50);  --gc-bd: color-mix(in srgb, var(--goal-adopt) 22%, white); }
.milestone-goal-card.tone-green  { --gc: var(--goal-it);      --gc-bg: var(--success-50);  --gc-bd: color-mix(in srgb, var(--goal-it) 22%, white); }
.milestone-goal-card.tone-violet { --gc: var(--goal-fixed);   --gc-bg: #f3edff;            --gc-bd: color-mix(in srgb, var(--goal-fixed) 22%, white); }
.milestone-goal-card.tone-teal   { --gc: var(--goal-special); --gc-bg: #e3f6f2;            --gc-bd: color-mix(in srgb, var(--goal-special) 22%, white); }
.milestone-goal-card.is-empty { --gc-bg: var(--gray-25); --gc-bd: var(--border); opacity: 0.82; }
.mgc-main { display: grid; grid-template-columns: 20px minmax(0,1fr); align-items: center; gap: 5px; }
.mgc-icon { width: 20px; height: 20px; border-radius: 6px; display: flex; align-items: center; justify-content: center; color: var(--gc); background: color-mix(in srgb, var(--gc) 14%, white); }
.mgc-icon .msym { font-size: 13px; }
.mgc-text { min-width: 0; }
.mgc-text strong { display: block; font-size: 10px; line-height: 14px; font-weight: var(--fw-bold); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; letter-spacing: -0.2px; }
.mgc-text span { font-size: 10px; color: var(--text-muted); }
.milestone-goal-card em { justify-self: end; font-size: var(--fs-2xs); font-weight: var(--fw-bold); font-style: normal; color: var(--gc); }
.progress-meta { display: flex; align-items: center; justify-content: space-between; gap: 12px; font-size: var(--fs-2xs); color: var(--text-faint); }
.progress-achieved { font-weight: var(--fw-semibold); }

/* 交付进度：时间进度 vs 任务完成率，双条对比（紧凑） */
.core-progress { display: grid; gap: 9px; }
.pace-badge { justify-self: start; display: inline-flex; align-items: center; gap: 4px; height: 21px; padding: 0 10px; border-radius: var(--r-full); font-size: var(--fs-2xs); font-weight: var(--fw-bold); letter-spacing: 0.01em; }
.pace-badge::before { content: ""; width: 5px; height: 5px; border-radius: 50%; background: currentColor; }
.pace-ok     { background: var(--success-50); color: var(--success-600); }
.pace-warn   { background: var(--warning-50); color: var(--warning-600); }
.pace-danger { background: var(--danger-50);  color: var(--danger-600); }
.cp-metric { display: grid; gap: 5px; }
.cp-row { display: flex; align-items: baseline; justify-content: space-between; gap: 8px; }
.cp-label { font-size: var(--fs-2xs); font-weight: var(--fw-bold); color: var(--text-muted); white-space: nowrap; }
.cp-value { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-strong); white-space: nowrap; font-variant-numeric: tabular-nums; }
.progress.thin.is-danger > span { background: linear-gradient(90deg, var(--danger-500), var(--danger-600)); }

/* 团队双列 */
.project-team-dual { display: grid; grid-template-columns: 1fr 1fr; gap: 10px; }
.team-column { min-width: 0; overflow: hidden; padding: 10px 11px; border-radius: var(--r-md); display: grid; grid-template-columns: minmax(0, 1fr); align-content: start; gap: 8px; }
.team-column.customer { background: rgba(255,247,237,0.6); box-shadow: inset 0 0 0 1px rgba(245,146,16,0.12); }
.team-column.feishu { background: rgba(240,245,255,0.7); box-shadow: inset 0 0 0 1px rgba(51,112,255,0.12); }
.team-column header { display: flex; align-items: center; justify-content: space-between; gap: 6px; min-width: 0; }
.team-column header span { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; font-size: var(--fs-2xs); font-weight: var(--fw-bold); letter-spacing: 0.02em; }
.team-column.customer header span { color: var(--warning-600); }
.team-column.feishu header span { color: var(--brand-700); }
.team-column header em { flex-shrink: 0; font-size: 10px; font-style: normal; color: var(--text-muted); }
.team-member-list { min-width: 0; display: flex; flex-wrap: wrap; gap: 5px; }
.team-person { display: inline-flex; align-items: center; gap: 5px; min-width: 0; max-width: 100%; height: 26px; padding: 0 9px 0 3px; border-radius: var(--r-full); background: rgba(255,255,255,0.86); font-size: var(--fs-2xs); font-weight: var(--fw-semibold); color: var(--text); }
.team-person b { min-width: 0; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 84px; }
.empty-team { font-size: var(--fs-2xs); color: var(--text-faint); }

/* 创建人（项目列内小字行） */
.project-creator { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-2xs); color: var(--text-muted); margin-top: 2px; padding-top: 9px; border-top: 1px dashed var(--border); width: 100%; }
.project-creator span { overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.project-creator b { font-weight: var(--fw-semibold); color: var(--text); }

/* 操作：查看 + 删除 */
.cell-actions { display: flex; justify-content: flex-end; }
.project-row-actions { display: inline-flex; align-items: center; gap: 6px; white-space: nowrap; }
.arrow-link { display: inline-flex; align-items: center; gap: 4px; height: 34px; padding: 0 14px; border-radius: var(--r-md); color: var(--brand-700); font-size: var(--fs-sm); font-weight: var(--fw-semibold); background: var(--brand-50); border: 1px solid color-mix(in srgb, var(--brand-600) 14%, white); white-space: nowrap; transition: background var(--t-fast), border-color var(--t-fast), transform var(--t-fast) var(--ease-spring); }
.arrow-link:hover { background: var(--brand-100); border-color: color-mix(in srgb, var(--brand-600) 26%, white); }
.arrow-link:active { transform: scale(0.97); }
.arrow-link .msym { font-size: 16px; transition: transform var(--t-fast) var(--ease-out); }
.arrow-link:hover .msym { transform: translateX(2px); }
.danger-icon-btn { color: var(--text-faint); }
.danger-icon-btn:hover { color: var(--danger-600); background: var(--danger-50); }

.table-foot { padding: 14px 4px 0; font-size: var(--fs-xs); color: var(--text-faint); }

@media (max-width: 720px) {
  .status-tabs { gap: 20px; overflow-x: auto; }
  .pill-btn { display: none; }
  .project-inline-search { width: 180px; }
}

.member-chip { display: inline-flex; align-items: center; gap: 6px; font-size: var(--fs-sm); max-width: 160px; }

/* ---------------- 对话框图标 ---------------- */
.dialog-icon {
  width: 46px; height: 46px; border-radius: var(--r-md);
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-50); color: var(--brand-600);
}
.dialog-icon .msym { font-size: 26px; }
.dialog-icon.danger { background: var(--danger-50); color: var(--danger-500); }
.btn-danger-solid { --btn-bg: var(--danger-500); --btn-fg: #fff; --btn-bd: transparent; box-shadow: none; }
.btn-danger-solid:hover { --btn-bg: var(--danger-600); border-color: transparent; box-shadow: 0 4px 12px rgba(229,72,77,0.3); }

/* ================= 任务库 ================= */
.goal-grid {
  display: grid; grid-template-columns: repeat(5, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-5);
}
@media (max-width: 1180px) { .goal-grid { grid-template-columns: repeat(3, 1fr); } }
@media (max-width: 720px) { .goal-grid { grid-template-columns: repeat(2, 1fr); } }
.goal-card {
  background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-lg);
  padding: var(--sp-4); box-shadow: var(--shadow-xs); position: relative; overflow: hidden;
  transition: box-shadow var(--t-base), transform var(--t-base);
}
.goal-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.goal-card::before { content: ""; position: absolute; left: 0; top: 0; bottom: 0; width: 3px; background: var(--goal-c, var(--brand-500)); }
.goal-card.tone-blue { --goal-c: var(--goal-exec); }
.goal-card.tone-orange { --goal-c: var(--goal-adopt); }
.goal-card.tone-green { --goal-c: var(--goal-it); }
.goal-card.tone-violet { --goal-c: var(--goal-fixed); }
.goal-card.tone-teal { --goal-c: var(--goal-special); }
.goal-card-head { display: flex; align-items: center; justify-content: space-between; margin-bottom: var(--sp-3); }
.goal-card-icon {
  width: 38px; height: 38px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center;
  background: color-mix(in srgb, var(--goal-c) 12%, white); color: var(--goal-c);
}
.goal-count { background: color-mix(in srgb, var(--goal-c) 12%, white); color: var(--goal-c); }
.goal-card-title { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.goal-card-desc { font-size: var(--fs-xs); color: var(--text-muted); margin-top: 4px; line-height: 1.5; min-height: 36px; }
.goal-card-meter { display: flex; align-items: center; gap: var(--sp-2); margin-top: var(--sp-3); }
.goal-card-meter .progress { flex: 1; }
.goal-card-meter .progress > span { background: var(--goal-c); }
.goal-card-meter em { font-size: var(--fs-2xs); font-weight: var(--fw-bold); font-style: normal; color: var(--text-muted); min-width: 30px; text-align: right; }

.task-table { padding: var(--sp-2) 0; }
.task-thead, .task-row {
  display: grid;
  grid-template-columns: minmax(280px, 2.2fr) minmax(120px, 1.1fr) minmax(120px, 1.1fr) minmax(120px, 1.1fr) 84px;
  align-items: center; gap: var(--sp-3);
  padding: 0 var(--sp-5);
}
.task-thead {
  height: 40px; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-muted);
  border-bottom: 1px solid var(--border);
}
.task-thead .ta-right { text-align: right; }
.task-row { min-height: 52px; padding-top: 10px; padding-bottom: 10px; border-bottom: 1px solid var(--border-faint); transition: background var(--t-fast); }
.task-row:hover { background: var(--gray-25); }
.task-row.dragging { opacity: 0.4; }
.task-row.drop-target { box-shadow: inset 0 2px 0 var(--brand-500); }
.task-row.sub { background: var(--gray-25); }
.tr-name { display: flex; align-items: center; gap: 6px; min-width: 0; }
.task-row.sub .tr-name { padding-left: 28px; }
.drag-handle { color: var(--gray-300); cursor: grab; display: flex; }
.drag-handle:active { cursor: grabbing; }
.drag-handle .msym { font-size: 18px; }
.tr-toggle { display: flex; align-items: center; justify-content: center; width: 22px; height: 22px; border-radius: var(--r-xs); color: var(--text-muted); }
.tr-toggle:hover { background: var(--gray-100); }
.tr-toggle-spacer { width: 22px; }
.tr-title { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tr-title.sub { font-weight: var(--fw-regular); color: var(--text); }
.sub-branch { color: var(--text-faint); display: flex; }
.sub-branch .msym { font-size: 16px; }
.wrap-tags { display: flex; flex-wrap: wrap; gap: 4px; align-items: center; }
.tr-actions { display: flex; align-items: center; justify-content: flex-end; gap: 2px; }

@media (max-width: 980px) {
  .task-thead { display: none; }
  .task-row { grid-template-columns: 1fr auto; row-gap: 8px; }
  .task-row .tr-cell { display: none; }
}

/* ================= 项目知识库 ================= */
.kb-list { padding: var(--sp-2) 0; }
.kb-group { border-bottom: 1px solid var(--border-faint); padding: var(--sp-3) 0; }
.kb-group:last-child { border-bottom: none; }
.kb-group-head {
  display: flex; align-items: center; gap: var(--sp-3);
  padding: 4px var(--sp-5) 10px;
}
.kb-group-icon {
  display: flex; align-items: center; justify-content: center;
  width: 30px; height: 30px; border-radius: var(--r-sm);
  background: var(--brand-50); color: var(--brand-600); flex: none;
}
.kb-group-icon .msym { font-size: 19px; }
.kb-group-title { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 2px; }
.kb-task-name { font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }

.kb-doc {
  display: flex; align-items: flex-start; gap: var(--sp-3);
  padding: 10px var(--sp-5) 10px 60px;
  border-top: 1px solid var(--border-faint);
  transition: background var(--t-fast);
}
.kb-doc:hover { background: var(--gray-25); }
.kb-doc-icon {
  display: flex; align-items: center; justify-content: center;
  width: 26px; height: 26px; border-radius: var(--r-sm); flex: none;
  color: var(--brand-600); background: var(--brand-50);
}
.kb-doc-icon .msym { font-size: 16px; }
.kb-doc-icon.tone-teal   { color: #0c8074; background: #e3f6f2; }
.kb-doc-icon.tone-violet { color: #6d28d9; background: #f3edff; }
.kb-doc-icon.tone-orange { color: var(--warning-600); background: var(--warning-50); }
.kb-doc-icon.tone-blue   { color: var(--brand-600); background: var(--brand-50); }
.kb-doc-icon.tone-green  { color: var(--success-600); background: var(--success-50); }
.kb-doc-main { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 3px; }
.kb-doc-title {
  display: inline-flex; align-items: center; gap: 4px;
  font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--brand-700);
  text-decoration: none; width: fit-content; max-width: 100%;
}
.kb-doc-title:hover { text-decoration: underline; }
.kb-doc-ext { font-size: 14px; opacity: 0.7; }
.kb-doc-meta { display: flex; align-items: center; gap: 8px; min-width: 0; }
.kb-doc-url { font-size: var(--fs-xs); color: var(--text-muted); min-width: 0; }
.kb-doc-note { font-size: var(--fs-xs); color: var(--text-faint); }

@media (max-width: 980px) {
  .kb-doc { padding-left: var(--sp-5); }
}

/* 时间轴卡片属性面板里的「关联知识 / SOP」 */
.ins-kb {
  background: var(--gray-25); border: 1px solid var(--border-faint);
  border-radius: var(--r-md); padding: var(--sp-3) var(--sp-4);
}
.ins-kb-head { display: flex; align-items: center; gap: 6px; margin-bottom: 2px; }
.ins-kb-head .msym { font-size: 17px; color: var(--brand-600); }
.ins-kb-head .field-label { flex: 1; }
.ins-kb-group { margin-top: var(--sp-3); }
.ins-kb-cat {
  display: flex; align-items: center; gap: 6px;
  font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-muted); margin-bottom: 4px;
}
.ins-kb-cat .kb-doc-icon { width: 20px; height: 20px; }
.ins-kb-cat .kb-doc-icon .msym { font-size: 13px; }
.ins-kb-cat b { font-weight: var(--fw-semibold); color: var(--text-faint); }
.ins-kb-doc {
  display: flex; align-items: center; gap: 6px;
  padding: 6px 8px; margin-left: 4px; border-radius: var(--r-sm);
  font-size: var(--fs-sm); color: var(--brand-700); text-decoration: none;
  transition: background var(--t-fast);
}
.ins-kb-doc:hover { background: var(--brand-50); }
.ins-kb-doc .msym { font-size: 15px; opacity: 0.7; flex: none; }
.ins-kb-doc .t-truncate { flex: 1; }
.ins-kb-vis { display: flex; flex: none; }
.ins-kb-vis .msym { font-size: 14px; opacity: 1; }
.ins-kb-vis.customer { color: var(--success-600); }
.ins-kb-vis.internal { color: var(--text-faint); }

/* 知识库列表 / 弹窗：客户可见标记 */
.kb-vis-tag { display: inline-flex; align-items: center; gap: 3px; }
.kb-vis-tag .msym { font-size: 12px; }
.kb-visibility {
  flex-direction: row; align-items: center; gap: var(--sp-3);
  padding: 12px 14px; border: 1px solid var(--border); border-radius: var(--r-md); margin-top: var(--sp-4);
}
.kb-visibility:has(input:checked) { border-color: var(--success-300, #86d6a0); background: var(--success-50); }
.kb-vis-text { flex: 1; display: flex; flex-direction: column; gap: 2px; }
.kb-vis-text .field-label { display: inline-flex; align-items: center; gap: 5px; }
.kb-vis-text .field-label .msym { font-size: 16px; color: var(--text-muted); }
.kb-visibility:has(input:checked) .field-label .msym { color: var(--success-600); }

/* ================= 弹窗表单 ================= */
.modal-head-icon {
  width: 40px; height: 40px; border-radius: var(--r-md); flex-shrink: 0;
  display: flex; align-items: center; justify-content: center;
  background: var(--brand-50); color: var(--brand-600);
}
.form-grid { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-4); }
.form-grid .field-full { grid-column: 1 / -1; }
.field-full { grid-column: 1 / -1; }
.form-section { margin-top: var(--sp-5); display: flex; flex-direction: column; gap: var(--sp-3); }
.form-section > .field-label { margin-bottom: 2px; }
.form-row-2 { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-5); }
@media (max-width: 640px) { .form-grid, .form-row-2 { grid-template-columns: 1fr; } }

.check-group { display: flex; flex-wrap: wrap; gap: var(--sp-2); }
.chip-check {
  display: inline-flex; align-items: center; gap: 6px;
  padding: 7px 12px; border-radius: var(--r-full);
  border: 1px solid var(--border-strong); background: var(--surface);
  font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-muted);
  cursor: pointer; user-select: none; transition: all var(--t-fast) var(--ease-out);
}
.chip-check input { position: absolute; opacity: 0; width: 0; height: 0; }
.chip-check .msym { font-size: 17px; }
.chip-check .chip-letter {
  width: 18px; height: 18px; border-radius: var(--r-full); background: var(--gray-100); color: var(--text-muted);
  display: inline-flex; align-items: center; justify-content: center; font-size: 10px; font-weight: var(--fw-bold);
}
.chip-check:hover { border-color: var(--gray-300); color: var(--text); }
.chip-check.on,
.chip-check:has(input:checked) { background: var(--brand-50); border-color: var(--brand-300); color: var(--brand-700); }
.chip-check.on .chip-letter,
.chip-check:has(input:checked) .chip-letter { background: var(--brand-600); color: #fff; }
.chip-check:focus-within { box-shadow: var(--ring-brand); }

/* ================= 团队管理 ================= */
@keyframes spin { to { transform: rotate(360deg); } }
.spin { animation: spin 0.9s linear infinite; display: inline-block; }
.team-progress-chip { display: flex; align-items: center; gap: var(--sp-3); padding: 8px 14px; background: var(--surface); border: 1px solid var(--border); border-radius: var(--r-full); box-shadow: var(--shadow-xs); }
.team-progress-chip .progress { height: 6px; }

.team-layout { display: grid; grid-template-columns: 320px 1fr; gap: var(--sp-4); align-items: start; }
@media (max-width: 1080px) { .team-layout { grid-template-columns: 1fr; } }

.role-rail { padding: var(--sp-3); display: flex; flex-direction: column; gap: 3px; position: sticky; top: 80px; }
.rail-group-label { font-size: var(--fs-2xs); font-weight: var(--fw-bold); color: var(--text-faint); text-transform: uppercase; letter-spacing: 0.05em; padding: var(--sp-2) var(--sp-2) var(--sp-1); }
.rail-role { display: flex; align-items: center; gap: var(--sp-3); padding: 10px var(--sp-3); border-radius: var(--r-md); text-align: left; width: 100%; transition: background var(--t-fast); position: relative; }
.rail-role:hover { background: var(--gray-50); }
.rail-role.active { background: var(--brand-50); }
.rail-role.active::before { content: ""; position: absolute; left: 0; top: 8px; bottom: 8px; width: 3px; border-radius: var(--r-full); background: var(--brand-600); }
.rail-role.readonly { cursor: default; }
.rail-role.readonly:hover { background: transparent; }
.rail-letter { width: 34px; height: 34px; border-radius: var(--r-md); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 13px; font-weight: var(--fw-bold); background: var(--brand-100); color: var(--brand-700); }
.rail-letter.customer { background: var(--warning-50); color: var(--warning-600); }
.rail-meta { flex: 1; min-width: 0; }
.rail-meta strong { display: flex; align-items: center; gap: 5px; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.rail-meta em { display: block; font-style: normal; font-size: var(--fs-2xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.lead-dot { width: 6px; height: 6px; border-radius: 50%; background: var(--brand-500); }
.rail-lock { color: var(--gray-300); font-size: 16px; }
.rail-status { width: 8px; height: 8px; border-radius: 50%; background: var(--gray-200); flex-shrink: 0; }
.rail-status.ready { background: var(--success-500); box-shadow: 0 0 0 3px var(--success-50); }

.role-console { display: flex; flex-direction: column; gap: var(--sp-4); }
.resolver-head { display: flex; align-items: flex-start; gap: var(--sp-3); margin-bottom: var(--sp-4); }
.letter-tile { width: 48px; height: 48px; border-radius: var(--r-md); flex-shrink: 0; display: flex; align-items: center; justify-content: center; font-size: 18px; font-weight: var(--fw-bold); background: linear-gradient(135deg, var(--brand-500), var(--brand-700)); color: #fff; box-shadow: 0 4px 12px rgba(var(--brand-rgb),0.28); }
.role-state { font-size: var(--fs-2xs); font-weight: var(--fw-semibold); padding: 3px 9px; border-radius: var(--r-full); background: var(--gray-100); color: var(--text-muted); }
.role-state.ready { background: var(--success-50); color: var(--success-600); }
.resolver-search { display: flex; gap: var(--sp-2); }
.resolver-hint { display: flex; align-items: flex-start; gap: 8px; margin-top: var(--sp-3); padding: 12px 14px; border-radius: var(--r-md); background: var(--gray-50); color: var(--text-muted); font-size: var(--fs-xs); line-height: 1.6; }
.resolver-hint .msym { font-size: 17px; flex-shrink: 0; margin-top: 1px; }
.resolver-hint.error { background: var(--danger-50); color: var(--danger-600); }
.resolver-hint.loading { background: var(--brand-50); color: var(--brand-700); }

.candidate-list { display: flex; flex-direction: column; gap: var(--sp-2); margin-top: var(--sp-3); }
.candidate { display: flex; align-items: center; gap: var(--sp-3); padding: 10px 12px; border: 1px solid var(--border); border-radius: var(--r-md); transition: border-color var(--t-fast), box-shadow var(--t-fast); }
.candidate:hover { border-color: var(--border-strong); box-shadow: var(--shadow-xs); }
.candidate-meta, .ledger-meta { flex: 1; min-width: 0; }
.candidate-meta strong, .ledger-meta strong { display: block; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); }
.candidate-meta em, .ledger-meta em { display: block; font-style: normal; font-size: var(--fs-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.candidate-meta small, .ledger-meta small { font-size: var(--fs-2xs); color: var(--text-faint); }

.member-ledger { display: grid; grid-template-columns: repeat(auto-fill, minmax(280px, 1fr)); gap: var(--sp-2); }
.ledger-member { display: flex; align-items: center; gap: var(--sp-3); padding: 10px 12px; background: var(--gray-25); border: 1px solid var(--border-faint); border-radius: var(--r-md); }
.account-chip { font-size: var(--fs-2xs); font-weight: var(--fw-semibold); padding: 3px 8px; border-radius: var(--r-xs); background: var(--gray-100); color: var(--text-faint); white-space: nowrap; }
.account-chip.ok { background: var(--success-50); color: var(--success-600); }
.ledger-empty { display: flex; flex-direction: column; align-items: center; gap: 10px; padding: var(--sp-7) var(--sp-4); text-align: center; color: var(--text-faint); }
.ledger-empty .msym { font-size: 30px; }
.ledger-empty p { font-size: var(--fs-sm); color: var(--text-muted); max-width: 280px; }

/* ================= 新建项目向导 ================= */
.np-modal { width: min(100%, 920px); }
.np-body { padding: var(--sp-5) var(--sp-6); }
.np-steps { display: flex; align-items: center; gap: 8px; padding: var(--sp-4) var(--sp-6); border-bottom: 1px solid var(--border-faint); background: var(--gray-25); }
.np-step { display: flex; align-items: center; gap: 8px; }
.np-step-dot { width: 24px; height: 24px; border-radius: var(--r-full); display: flex; align-items: center; justify-content: center; font-size: var(--fs-xs); font-weight: var(--fw-bold); background: var(--gray-150); color: var(--text-muted); transition: all var(--t-base); }
.np-step-dot .msym { font-size: 15px; }
.np-step-label { font-size: var(--fs-sm); font-weight: var(--fw-medium); color: var(--text-muted); }
.np-step.active .np-step-dot { background: var(--brand-600); color: #fff; box-shadow: var(--ring-brand); }
.np-step.active .np-step-label { color: var(--text-strong); font-weight: var(--fw-semibold); }
.np-step.done .np-step-dot { background: var(--success-500); color: #fff; }
.np-step.done .np-step-label { color: var(--text); }
.np-step-line { flex: 1; height: 1px; background: var(--border); min-width: 12px; }
@media (max-width: 760px) { .np-step-label { display: none; } }

.np-section { margin-bottom: var(--sp-6); }
.np-section-title { display: flex; align-items: center; gap: 8px; font-size: var(--fs-h3); font-weight: var(--fw-semibold); margin-bottom: 6px; }
.np-section-title .msym { color: var(--brand-600); font-size: 19px; }
.np-section-hint { font-size: var(--fs-xs); color: var(--text-muted); margin-bottom: var(--sp-3); }

.np-feishu-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(220px, 1fr)); gap: var(--sp-3); }
.np-role-block { border: 1px solid var(--border); border-radius: var(--r-md); padding: 12px; background: var(--gray-25); }
.np-role-head { display: flex; align-items: center; gap: 8px; margin-bottom: 8px; }
.np-role-head .rail-letter { width: 26px; height: 26px; font-size: 11px; }
.np-role-head strong { font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.np-member { display: flex; align-items: center; gap: 8px; padding: 5px 6px; border-radius: var(--r-sm); font-size: var(--fs-sm); cursor: pointer; }
.np-member:hover { background: var(--surface); }
.np-member.locked { color: var(--brand-700); }
.np-member.locked .box { background: var(--brand-600); border-color: var(--brand-600); }
.np-member.locked .box .msym { opacity: 1; transform: scale(1); }
.np-role-empty { font-size: var(--fs-2xs); color: var(--text-faint); padding: 4px 6px; }
.np-customer-grid { display: grid; grid-template-columns: repeat(auto-fill, minmax(260px, 1fr)); gap: var(--sp-3); }
.np-customer-grid .field-label { display: flex; align-items: center; gap: 6px; }

.np-tasks-toolbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-3); margin-bottom: var(--sp-3); flex-wrap: wrap; }
.selection-count { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--brand-700); background: var(--brand-50); padding: 5px 10px; border-radius: var(--r-full); }
.np-task-list { display: flex; flex-direction: column; gap: 4px; max-height: 48vh; overflow-y: auto; padding-right: 4px; }
.np-task-group { border: 1px solid var(--border-faint); border-radius: var(--r-md); overflow: hidden; flex-shrink: 0; }
.np-task-row { display: flex; align-items: center; gap: 10px; padding: 10px 12px; cursor: pointer; transition: background var(--t-fast); }
.np-task-row:hover { background: var(--gray-25); }
.np-task-row.parent { font-weight: var(--fw-medium); }
.np-task-row.sub { padding-left: 28px; background: var(--gray-25); border-top: 1px solid var(--border-faint); }
.np-task-row.on { background: var(--brand-50); }
.np-task-row.sub.on { background: var(--brand-50); }
.np-task-name { flex: 1; min-width: 0; font-size: var(--fs-sm); color: var(--text-strong); }
.np-task-name.sub { color: var(--text); font-weight: var(--fw-regular); }
/* 自绘复选框（无 input）：选中/半选时显示对勾或减号 */
.np-task-row.on .box .msym, .np-task-row.partial .box .msym { opacity: 1; transform: scale(1); }
.np-task-row.partial .box { background: var(--brand-600); border-color: var(--brand-600); }
.np-task-row.partial { background: var(--brand-50); }
/* 展开/收起子任务按钮 */
.np-expand-btn { display: inline-flex; align-items: center; gap: 6px; flex-shrink: 0; background: none; border: none; cursor: pointer; padding: 4px 4px 4px 6px; margin: -4px -4px -4px 0; border-radius: var(--r-sm); color: var(--text-muted); }
.np-expand-btn:hover { background: var(--gray-100); }
.np-expand-btn .chev { font-size: 18px; transition: transform var(--t-fast) var(--ease-out); }
.np-task-group.expanded .np-expand-btn .chev { transform: rotate(180deg); }
.goal-dot { width: 8px; height: 8px; border-radius: 50%; flex-shrink: 0; }
.goal-dot.tone-blue { background: var(--goal-exec); } .goal-dot.tone-orange { background: var(--goal-adopt); }
.goal-dot.tone-green { background: var(--goal-it); } .goal-dot.tone-violet { background: var(--goal-fixed); } .goal-dot.tone-teal { background: var(--goal-special); }

.np-special-list { display: flex; flex-direction: column; gap: var(--sp-3); }
.np-special { border: 1px solid var(--border); border-radius: var(--r-md); padding: var(--sp-4); background: var(--gray-25); }
.np-special-head { display: flex; align-items: center; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.np-special-idx { width: 24px; height: 24px; border-radius: var(--r-full); background: var(--goal-special); color: #fff; display: flex; align-items: center; justify-content: center; font-size: var(--fs-xs); font-weight: var(--fw-bold); flex-shrink: 0; }
.np-special-head .input { flex: 1; }
.np-special-roles { display: grid; grid-template-columns: 1fr 1fr; gap: var(--sp-2); margin-bottom: var(--sp-3); }
.np-special-tasks { display: flex; flex-direction: column; gap: 8px; }
.np-special-task { display: flex; align-items: center; gap: 8px; }
.np-special-task .input { flex: 1; }
.np-add-task-btn { align-self: flex-start; }

.np-confirm-grid { display: grid; grid-template-columns: repeat(3, 1fr); gap: var(--sp-3); margin-bottom: var(--sp-5); }
@media (max-width: 640px) { .np-confirm-grid { grid-template-columns: repeat(2, 1fr); } }
.np-confirm-tile { display: flex; align-items: center; gap: var(--sp-3); padding: var(--sp-4); border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); }
.np-confirm-icon { width: 38px; height: 38px; border-radius: var(--r-md); background: var(--brand-50); color: var(--brand-600); display: flex; align-items: center; justify-content: center; flex-shrink: 0; }
.np-confirm-value { font-size: var(--fs-base); font-weight: var(--fw-bold); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; max-width: 180px; }
.np-confirm-label { font-size: var(--fs-2xs); color: var(--text-muted); }
.np-confirm-section { margin-top: var(--sp-4); }
.np-confirm-section h4 { display: flex; align-items: center; gap: 6px; font-size: var(--fs-sm); margin-bottom: var(--sp-2); }
.np-confirm-section h4 .msym { font-size: 17px; color: var(--brand-600); }
.np-chip-wrap { display: flex; flex-wrap: wrap; gap: 6px; }

/* 自定义复选框 .check/.box */
.check { position: relative; display: inline-flex; flex-shrink: 0; }
.check input { position: absolute; opacity: 0; width: 0; height: 0; }
.check .box {
  width: 18px; height: 18px; border-radius: var(--r-xs); border: 1.5px solid var(--gray-300);
  background: var(--surface); display: inline-flex; align-items: center; justify-content: center;
  transition: all var(--t-fast) var(--ease-out);
}
.check .box .msym { font-size: 14px; color: #fff; opacity: 0; transform: scale(0.5); transition: all var(--t-fast) var(--ease-spring); }
.check input:checked + .box, .np-task-row.on .box, label.on .box { background: var(--brand-600); border-color: var(--brand-600); }
.check input:checked + .box .msym { opacity: 1; transform: scale(1); }
.check input:focus-visible + .box { box-shadow: var(--ring-brand); }

/* ================= 项目详情 · 时间轴画布（三段式 + 跑道对齐） ================= */
.avatar.xs { width: 20px; height: 20px; font-size: 9px; }
.pd-topbar { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); margin-bottom: var(--sp-3); flex-wrap: wrap; }
.pd-crumb { font-size: var(--fs-sm); }
.pd-crumb b { color: var(--text-strong); font-weight: var(--fw-semibold); }
.pd-top-actions { display: flex; align-items: center; gap: 8px; }
.pd-view-seg { height: 38px; }

/* 分享视图 popover（飞书风格） */
.share-wrap { position: relative; }
.share-wrap .btn.on { background: var(--brand-50); border-color: var(--brand-300); color: var(--brand-700); }
.share-pop { position: absolute; top: calc(100% + 8px); right: 0; z-index: var(--z-overlay, 1000); width: 360px; padding: 16px 18px; border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: 0 18px 48px rgba(28,46,92,0.18); animation: share-pop-in 0.16s var(--ease-out); }
@keyframes share-pop-in { from { opacity: 0; transform: translateY(-6px); } to { opacity: 1; transform: none; } }
.share-pop-head { display: flex; align-items: center; gap: 10px; }
.share-pop-head strong { font-size: var(--fs-base); font-weight: var(--fw-bold); color: var(--text-strong); }
.share-on-label { margin-left: auto; font-size: var(--fs-2xs); color: var(--brand-600); font-weight: var(--fw-semibold); }
.share-pop-head .switch { margin-left: auto; }
.share-on-label + .switch { margin-left: 0; }
.share-pop-desc { margin: 9px 0 0; font-size: var(--fs-xs); color: var(--text-muted); line-height: 1.5; }
.share-link-row { display: flex; align-items: center; gap: 8px; margin-top: 13px; }
.share-link { flex: 1; min-width: 0; height: 34px; line-height: 34px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--gray-25); font-size: var(--fs-xs); color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.share-link-row .icon-btn { flex-shrink: 0; width: 34px; height: 34px; border: 1px solid var(--border); border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; color: var(--text-muted); }
.share-link-row .icon-btn:hover { background: var(--gray-50); color: var(--text); }
.share-link-row .btn { flex-shrink: 0; }
/* 开关 switch */
.switch { width: 40px; height: 22px; border-radius: var(--r-full); background: var(--gray-300); position: relative; transition: background var(--t-fast); flex-shrink: 0; }
.switch i { position: absolute; top: 2px; left: 2px; width: 18px; height: 18px; border-radius: 50%; background: #fff; box-shadow: 0 1px 3px rgba(0,0,0,0.2); transition: transform var(--t-base) var(--ease-spring); }
.switch.on { background: var(--brand-500); }
.switch.on i { transform: translateX(18px); }
.pd-titleline { display: flex; align-items: center; gap: var(--sp-3); }
.dh-title { font-size: var(--fs-display); line-height: var(--lh-display); font-weight: var(--fw-bold); letter-spacing: -0.02em; }
.pd-subline { font-size: var(--fs-sm); color: var(--text-muted); margin: 6px 0 16px; }
.pd-subline b { color: var(--text); font-weight: var(--fw-semibold); }

/* 角色牌库 band */
.role-band { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-xs); overflow: hidden; }
.role-band.customer { margin-bottom: 14px; }
.role-band.feishu { margin-top: 14px; }
.role-band-head { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: 11px 16px; border-bottom: 1px solid var(--border-faint); flex-wrap: wrap; }
.role-band.customer .role-band-head { background: linear-gradient(90deg, rgba(245,146,16,0.06), transparent 60%); }
.role-band.feishu .role-band-head { background: linear-gradient(90deg, rgba(51,112,255,0.06), transparent 60%); }
.role-band-title { display: flex; align-items: center; gap: 9px; flex-shrink: 0; }
.role-band-title > .msym { font-size: 20px; }
.role-band.customer .role-band-title > .msym { color: var(--warning-600); }
.role-band.feishu .role-band-title > .msym { color: var(--brand-600); }
.role-band-title strong { display: block; font-size: var(--fs-sm); font-weight: var(--fw-semibold); }
.role-band-title em { display: block; font-style: normal; font-size: var(--fs-2xs); color: var(--text-muted); }
.band-filter { display: flex; flex-wrap: wrap; gap: 6px; justify-content: flex-end; }
.role-chip { display: inline-flex; align-items: center; gap: 5px; height: 30px; padding: 0 10px; border: 1px solid var(--border); border-radius: var(--r-full); background: var(--surface); color: var(--text-muted); font-size: var(--fs-2xs); font-weight: var(--fw-medium); }
.role-chip:hover { border-color: var(--border-strong); color: var(--text); }
.role-chip.active { background: var(--brand-50); border-color: var(--brand-300); color: var(--brand-700); }
.role-chip.customer.active { background: var(--warning-50); border-color: color-mix(in srgb, var(--warning-500) 40%, white); color: var(--warning-600); }
.role-chip .rail-letter { width: 18px; height: 18px; font-size: 9px; }
.role-chip em { font-style: normal; font-weight: var(--fw-bold); font-size: 10px; padding: 0 5px; border-radius: var(--r-full); background: var(--gray-100); }
.role-chip.active em { background: rgba(255,255,255,0.6); }
.band-strip { display: flex; gap: 8px; padding: 10px 16px; overflow-x: auto; min-height: 52px; }
.band-empty { display: flex; align-items: center; gap: 8px; padding: 14px; color: var(--text-faint); font-size: var(--fs-sm); }
.deck-card { flex-shrink: 0; min-width: 168px; max-width: 220px; padding: 10px 12px; border: 1px solid var(--border); border-left: 3px solid var(--dc, var(--brand-500)); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-xs); cursor: grab; user-select: none; transition: box-shadow var(--t-fast), transform var(--t-fast) var(--ease-spring); }
.deck-card:hover { box-shadow: var(--shadow-md); transform: translateY(-2px); }
.deck-card:active { cursor: grabbing; transform: scale(0.98); }
.deck-card.tone-blue { --dc: var(--goal-exec); } .deck-card.tone-orange { --dc: var(--goal-adopt); }
.deck-card.tone-green { --dc: var(--goal-it); } .deck-card.tone-violet { --dc: var(--goal-fixed); } .deck-card.tone-teal { --dc: var(--goal-special); }
.deck-name { display: block; font-size: var(--fs-sm); font-weight: var(--fw-semibold); color: var(--text-strong); line-height: 1.35; }
.deck-parent { display: flex; align-items: center; gap: 3px; font-style: normal; font-size: var(--fs-2xs); color: var(--text-faint); margin-top: 3px; }
.deck-parent .msym { font-size: 13px; }

/* 精简任务牌（图2 尺寸）：图标 + 标题 + 极简副标题 */
.deck-card.mini { display: flex; align-items: center; gap: 8px; min-width: 148px; max-width: 196px; padding: 6px 10px 6px 8px; }
.deck-card.mini .dc-ico { width: 26px; height: 26px; border-radius: var(--r-sm); flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: color-mix(in srgb, var(--dc) 13%, white); color: var(--dc); }
.deck-card.mini .dc-ico .msym { font-size: 15px; }
.deck-card.mini.is-sub .dc-ico { background: var(--gray-100); color: var(--text-muted); }
.deck-card.mini .dc-text { flex: 1; min-width: 0; display: flex; flex-direction: column; gap: 1px; }
/* 主任务卡右侧「展开子任务」小标 */
.deck-card.mini .dc-expand { flex-shrink: 0; align-self: stretch; display: flex; align-items: center; gap: 1px; margin: -6px -10px -6px 2px; padding: 0 8px; border-left: 1px solid var(--border-faint); border-radius: 0 var(--r-md) var(--r-md) 0; color: var(--text-faint); font-size: 10px; transition: background var(--t-fast), color var(--t-fast); }
.deck-card.mini .dc-expand .msym { font-size: 16px; }
.deck-card.mini .dc-expand b { font-weight: var(--fw-bold); }
.deck-card.mini .dc-expand:hover { background: color-mix(in srgb, var(--dc) 10%, white); color: var(--dc); }
.deck-card.mini.expanded { border-color: color-mix(in srgb, var(--dc) 40%, var(--border)); }
.deck-card.mini.expanded .dc-expand { color: var(--dc); background: color-mix(in srgb, var(--dc) 10%, white); }
.deck-card.mini.is-sub { animation: deck-sub-in 0.22s var(--ease-out); }
@keyframes deck-sub-in { from { opacity: 0; transform: translateX(-8px); } to { opacity: 1; transform: none; } }
.deck-card.mini .dc-text strong { font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-strong); line-height: 1.3; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-card.mini .dc-text em { display: flex; align-items: center; gap: 2px; font-style: normal; font-size: 10px; color: var(--text-faint); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.deck-card.mini .dc-text em .msym { font-size: 12px; color: var(--success-500); }

/* 角色筛选 chip：头像 + 姓名 */
.role-chip.person { height: auto; padding: 4px 9px 4px 5px; gap: 7px; }
.role-chip.person .rc-faces { display: inline-flex; flex-shrink: 0; }
.role-chip.person .rc-faces .avatar { margin-left: -7px; box-shadow: 0 0 0 2px var(--surface); }
.role-chip.person .rc-faces .avatar:first-child { margin-left: 0; }
.role-chip.person .rc-text { display: flex; flex-direction: column; align-items: flex-start; line-height: 1.25; min-width: 0; }
.role-chip.person .rc-text strong { font-size: var(--fs-2xs); font-weight: var(--fw-semibold); color: var(--text); max-width: 96px; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.role-chip.person .rc-text em { font-style: normal; font-size: 9px; color: var(--text-faint); }
.role-chip.person.active .rc-text strong { color: inherit; }
.role-chip.person.active .rc-text em { color: inherit; opacity: 0.75; }
.role-chip.person .rc-count { font-style: normal; font-weight: var(--fw-bold); font-size: 10px; padding: 0 5px; border-radius: var(--r-full); background: var(--gray-100); color: var(--text-muted); flex-shrink: 0; }
.role-chip.person.active .rc-count { background: rgba(255,255,255,0.6); color: inherit; }

/* 画布 */
.canvas-stage { border: 1px solid var(--border); border-radius: var(--r-lg); background: var(--surface); box-shadow: var(--shadow-sm); overflow: hidden; }
.canvas-toolbar { display: flex; align-items: center; gap: var(--sp-3); padding: 12px 16px; border-bottom: 1px solid var(--border-faint); background: var(--gray-25); flex-wrap: wrap; }
.canvas-toolbar h3 { display: flex; align-items: center; gap: 8px; font-size: var(--fs-base); font-weight: var(--fw-semibold); }
.canvas-toolbar h3 .msym { color: var(--brand-600); }
.canvas-tip { flex: 1; min-width: 200px; font-size: var(--fs-2xs); color: var(--text-muted); }
.tl-legend { display: flex; flex-wrap: wrap; gap: 6px 12px; }
.tl-legend .leg { display: inline-flex; align-items: center; gap: 5px; font-size: var(--fs-2xs); color: var(--text-muted); }
.tl-legend .leg i { width: 8px; height: 8px; border-radius: 50%; }
.tl-legend .leg.planned i { background: var(--gray-300); } .tl-legend .leg.doing i { background: var(--brand-500); } .tl-legend .leg.done i { background: var(--success-500); }
.flag-mini { font-size: 11px; }
.canvas-viewport { position: relative; }
.canvas-scroll { overflow: auto; max-height: 64vh; background: #f4f6fa; }
.board-canvas { position: relative; }

/* 跑道 */
.lane-row { position: absolute; left: 0; right: 0; border-bottom: 1px solid rgba(31,37,51,0.05); }
.lane-row:nth-child(even) { background: rgba(31,37,51,0.012); }
.lane-row.lane-hot { background: color-mix(in srgb, var(--lc) 8%, transparent); box-shadow: inset 0 0 0 2px color-mix(in srgb, var(--lc) 35%, transparent); }
.lane-label { position: sticky; left: 12px; z-index: 4; display: inline-flex; align-items: center; gap: 6px; margin: 8px 0 0 12px; padding: 3px 10px 3px 8px; border-radius: var(--r-full); background: rgba(255,255,255,0.92); box-shadow: var(--shadow-xs); font-size: var(--fs-2xs); font-weight: var(--fw-bold); color: var(--text); backdrop-filter: blur(4px); }
.lane-label i { width: 8px; height: 8px; border-radius: 50%; background: var(--lc); }

/* 日期行 */
.canvas-date-row { position: sticky; top: 0; z-index: 6; background: var(--surface); border-bottom: 1px solid var(--border); }
.canvas-date-row .cd { position: absolute; top: 0; height: 100%; display: flex; flex-direction: column; align-items: center; justify-content: center; border-right: 1px solid var(--border-faint); }
.canvas-date-row .cd em { font-style: normal; font-size: var(--fs-2xs); font-weight: var(--fw-semibold); color: var(--text); }
.canvas-date-row .cd small { font-size: 10px; color: var(--text-faint); }
.canvas-date-row .cd.is-weekend { background: rgba(31,37,51,0.02); }
.canvas-date-row .cd.is-start { background: var(--brand-50); }
.canvas-date-row .cd.is-start em, .canvas-date-row .cd.is-start small { color: var(--brand-700); font-weight: var(--fw-bold); }

/* overflow: visible 让末端连线可越过画布右缘，延伸到常驻右侧的 TARGET 卡（周视图画布被压窄时尤其关键） */
.connector-layer { position: absolute; left: 0; top: 0; overflow: visible; pointer-events: none; z-index: 2; }
/* 连线向目标「流动」：虚线行进 + 终点圆点轻脉冲，传达任务朝里程碑推进/归属的动感 */
.connector-layer path { animation: conn-flow 0.85s linear infinite; }
@keyframes conn-flow { to { stroke-dashoffset: -26; } }
.connector-layer circle[data-conn-dot] { transform-box: fill-box; transform-origin: center; animation: conn-dot 1.8s ease-in-out infinite; }
@keyframes conn-dot { 0%, 100% { transform: scale(1); } 50% { transform: scale(1.55); } }
@media (prefers-reduced-motion: reduce) {
  .connector-layer path, .connector-layer circle[data-conn-dot] { animation: none; }
}

/* 目标通道：并排在画布右侧的独立固定栏，横向滚动不动、竖向滚动同步，且永不遮挡任务 */
/* 半透明浮层覆盖右侧：时间轴网格铺满全宽（视觉更大），目标卡浮于其上、随竖向滚动同步 */
.target-rail { position: absolute; right: 0; bottom: 0; width: 268px; z-index: 5; overflow: hidden; pointer-events: none; background: linear-gradient(90deg, rgba(244,246,250,0) 0%, rgba(244,246,250,0.28) 40px, rgba(244,246,250,0.45) 100%); }
.target-rail-inner { position: absolute; inset: 0; will-change: transform; }
.trail-slot { position: absolute; right: 0; width: 100%; display: flex; align-items: center; justify-content: flex-end; padding-right: 14px; }

/* TARGET 目标卡 */
.target-card { position: relative; z-index: 1; flex-shrink: 0; padding: 12px 14px; border-radius: var(--r-lg); border: 1px solid color-mix(in srgb, var(--lc) 30%, white); border-left: 5px solid var(--lc); background: linear-gradient(135deg, color-mix(in srgb, var(--lc) 14%, white), #fff 72%); box-shadow: -10px 14px 34px color-mix(in srgb, var(--lc) 18%, transparent); }
.target-card.active { outline: 2px solid var(--lc); outline-offset: 1px; }
.tc-eyebrow { font-size: 9px; font-weight: var(--fw-bold); letter-spacing: 0.12em; color: var(--lc); margin-bottom: 5px; }
.tc-main { display: grid; grid-template-columns: 36px minmax(0,1fr) 24px; align-items: center; gap: 10px; }
.tc-icon { width: 36px; height: 36px; border-radius: var(--r-md); display: flex; align-items: center; justify-content: center; color: #fff; background: var(--lc); box-shadow: 0 5px 12px color-mix(in srgb, var(--lc) 40%, transparent); }
.tc-icon .msym { font-size: 20px; }
.tc-main strong { display: block; font-size: var(--fs-sm); font-weight: var(--fw-bold); color: var(--text-strong); }
.tc-main em { display: block; font-style: normal; font-size: var(--fs-2xs); color: var(--text-muted); line-height: 1.4; overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.tc-count { width: 24px; height: 24px; border-radius: 50%; display: flex; align-items: center; justify-content: center; font-size: var(--fs-xs); font-weight: var(--fw-bold); color: var(--lc); background: color-mix(in srgb, var(--lc) 14%, white); }

/* 画布任务卡 */
.bc { position: absolute; z-index: 3; padding: 7px 9px 7px 12px; display: grid; grid-template-columns: 22px 22px minmax(0,1fr); gap: 1px 7px; align-items: center; border: 1px solid var(--border); border-radius: var(--r-md); background: var(--surface); box-shadow: var(--shadow-md); cursor: grab; user-select: none; transition: box-shadow var(--t-fast), opacity var(--t-fast); }
/* 左侧目标色条：单色实心；关联多目标时分段多色 */
.bc-goalbar { position: absolute; left: 0; top: 0; bottom: 0; width: 4px; border-radius: var(--r-md) 0 0 var(--r-md); pointer-events: none; }
.bc:active { cursor: grabbing; }
.bc.tone-blue { --bcc: var(--goal-exec); } .bc.tone-orange { --bcc: var(--goal-adopt); }
.bc.tone-green { --bcc: var(--goal-it); } .bc.tone-violet { --bcc: var(--goal-fixed); } .bc.tone-teal { --bcc: var(--goal-special); }
.bc:hover { box-shadow: 0 14px 30px rgba(28,46,92,0.18); z-index: 7; }
.bc.sel { outline: 2px solid var(--bcc); outline-offset: 1px; z-index: 8; }
.bc.dim { opacity: 0.4; }
.bc.dragging-src { opacity: 0.3; }
.bc.dropped { animation: bc-drop 0.42s var(--ease-spring); }
@keyframes bc-drop { 0% { transform: scale(1.12); box-shadow: 0 20px 44px rgba(28,46,92,0.26); } 60% { transform: scale(0.97); } 100% { transform: scale(1); } }
/* 里程碑标识：用目标色「水滴针脚」徽章 + 卡身光晕，替代原来的 emoji 旗帜 */
.bc.is-flag { box-shadow: var(--shadow-md), 0 0 0 1.5px color-mix(in srgb, var(--bcc) 50%, transparent), 0 10px 26px color-mix(in srgb, var(--bcc) 26%, transparent); }
.bc-flag { position: absolute; right: -9px; top: -11px; z-index: 9; width: 22px; height: 22px; border-radius: 50% 50% 50% 3px; display: flex; align-items: center; justify-content: center; color: #fff; background: linear-gradient(140deg, #ff6b66, #f5352f); box-shadow: 0 4px 11px rgba(245,53,47,0.5), inset 0 0 0 1.5px rgba(255,255,255,0.45); pointer-events: none; }
.bc-flag .msym { font-size: 13px; line-height: 1; }
.bc-flag::after { content: ""; position: absolute; inset: -4px; border-radius: inherit; border: 1.5px solid rgba(245,53,47,0.5); opacity: 0; animation: flag-pulse 2.4s ease-out infinite; }
@keyframes flag-pulse { 0% { transform: scale(0.7); opacity: 0.7; } 70%, 100% { transform: scale(1.35); opacity: 0; } }
@media (prefers-reduced-motion: reduce) { .bc-flag::after { animation: none; } }
.bc-status { grid-row: span 2; width: 22px; height: 22px; border-radius: 50%; display: flex; align-items: center; justify-content: center; align-self: center; }
.bc-status .msym { font-size: 14px; }
.bc-status.planned { background: var(--gray-100); color: var(--text-faint); }
.bc-status.doing { background: var(--brand-50); color: var(--brand-600); }
.bc-status.done { background: var(--success-50); color: var(--success-600); }
.bc-type { grid-row: span 2; display: flex; align-items: center; justify-content: center; color: var(--bcc); }
.bc-type .msym { font-size: 16px; }
.bc-body { min-width: 0; }
.bc-body strong { display: block; font-size: var(--fs-xs); font-weight: var(--fw-semibold); color: var(--text-strong); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }
.bc.status-done .bc-body strong { color: var(--text-muted); text-decoration: line-through; text-decoration-color: var(--gray-300); }
.bc-body small { display: block; font-size: 10px; color: var(--text-muted); overflow: hidden; text-overflow: ellipsis; white-space: nowrap; }

/* ---- 主任务 / 子任务 层级区分 ---- */
/* 主任务：实心「节点」——目标色填充图标块 + 加粗标题 + 实心 4px 色条 */
.bc.is-main .bc-type { width: 22px; height: 22px; border-radius: 6px; background: color-mix(in srgb, var(--bcc) 14%, white); color: var(--bcc); }
.bc.is-main .bc-type .msym { font-size: 15px; }
.bc.is-main .bc-body strong { font-weight: var(--fw-bold); }
/* 子任务：退后的「子级」——浅底 + 细色条 + 分支箭头(留白不填块) + 中等字重略淡 */
.bc.is-sub { background: var(--gray-25); }
.bc.is-sub .bc-goalbar { width: 3px; opacity: 0.55; }
.bc.is-sub .bc-type { color: var(--text-faint); }
.bc.is-sub .bc-type .msym { font-size: 18px; }
.bc.is-sub .bc-body strong { font-weight: var(--fw-medium); color: var(--text); }
.bc.is-sub .bc-body small { color: var(--text-faint); }
.drag-ghost { box-shadow: 0 22px 48px rgba(28,46,92,0.3) !important; opacity: 0.95; transition: none; }

.canvas-hint { position: absolute; left: 24px; top: 50%; transform: translateY(-50%); display: flex; align-items: center; gap: 10px; max-width: 520px; padding: 14px 18px; border: 1px dashed var(--border-strong); border-radius: var(--r-lg); background: rgba(255,255,255,0.75); color: var(--text-muted); font-size: var(--fs-sm); }
.canvas-hint .msym { font-size: 22px; color: var(--brand-500); }

/* 属性面板 */
.inspector-mask { position: fixed; inset: 0; z-index: var(--z-overlay, 1000); background: rgba(22,27,39,0.12); }
.inspector { position: fixed; right: 0; top: 0; z-index: calc(var(--z-overlay, 1000) + 1); width: 384px; max-width: 92vw; height: 100vh; display: flex; flex-direction: column; background: var(--surface); border-left: 1px solid var(--border); box-shadow: -16px 0 44px rgba(28,46,92,0.16); animation: slide-in-right var(--t-base) var(--ease-out); }
@keyframes slide-in-right { from { transform: translateX(24px); opacity: 0.5; } to { transform: none; opacity: 1; } }
.inspector-head { display: flex; align-items: flex-start; gap: 12px; padding: 18px; border-bottom: 1px solid var(--border-faint); }
.ins-icon { width: 38px; height: 38px; border-radius: var(--r-md); flex-shrink: 0; display: flex; align-items: center; justify-content: center; background: var(--brand-50); color: var(--brand-600); }
.inspector-head > div { flex: 1; min-width: 0; }
.inspector-head i { font-style: normal; font-size: 10px; color: var(--brand-600); font-weight: var(--fw-semibold); }
.inspector-head strong { display: block; font-size: var(--fs-base); font-weight: var(--fw-bold); color: var(--text-strong); margin-top: 2px; }
.inspector-head em { font-style: normal; font-size: var(--fs-2xs); color: var(--text-muted); }
.inspector-body { flex: 1; overflow-y: auto; padding: 16px 18px; display: flex; flex-direction: column; gap: 16px; }
.ins-status { display: flex; flex-direction: column; gap: 6px; }
.seg { display: inline-flex; padding: 3px; gap: 2px; background: var(--gray-100); border-radius: var(--r-md); }
.seg-btn { flex: 1; height: 30px; padding: 0 12px; border-radius: var(--r-sm); font-size: var(--fs-xs); font-weight: var(--fw-medium); color: var(--text-muted); white-space: nowrap; }
.seg-btn.on { background: var(--surface); color: var(--brand-700); box-shadow: var(--shadow-xs); }
.chip-check.sm { padding: 5px 9px; font-size: var(--fs-2xs); }
.chip-check.sm .chip-letter { width: 16px; height: 16px; font-size: 9px; }
.milestone-toggle { display: flex; align-items: center; gap: 10px; padding: 12px; border: 1px solid var(--border); border-radius: var(--r-md); cursor: pointer; font-size: var(--fs-sm); color: var(--text); }
.milestone-toggle input { position: absolute; opacity: 0; }
.milestone-toggle .mt-box { width: 26px; height: 26px; border-radius: var(--r-sm); display: flex; align-items: center; justify-content: center; background: var(--gray-100); color: var(--text-faint); flex-shrink: 0; }
.milestone-toggle .mt-box .msym { font-size: 16px; }
.milestone-toggle.on { border-color: #f7b5b2; background: var(--danger-50); color: var(--danger-600); }
.milestone-toggle.on .mt-box { background: var(--danger-500); color: #fff; }
.inspector-foot { display: flex; align-items: center; justify-content: space-between; gap: 10px; padding: 14px 18px; border-top: 1px solid var(--border-faint); }
.btn-danger-soft { color: var(--danger-600); background: var(--danger-50); border-color: transparent; }
.btn-danger-soft:hover { background: #fbe0df; border-color: transparent; }

/* 公开客户视图 */
.public-wrap { max-width: 1320px; margin: 0 auto; padding: var(--sp-6) var(--sp-5) var(--sp-8); }
.public-hero { display: flex; align-items: center; justify-content: space-between; gap: var(--sp-4); padding: var(--sp-6); margin-bottom: var(--sp-4); border-radius: var(--r-lg); background: linear-gradient(135deg, #fff, var(--brand-50)); border: 1px solid var(--border); box-shadow: var(--shadow-sm); }
.public-hero h1 { font-size: var(--fs-h1); font-weight: var(--fw-bold); margin: 6px 0; }
.public-hero p { font-size: var(--fs-sm); color: var(--text-muted); }
.public-hero-right { display: flex; align-items: center; gap: var(--sp-4); flex-shrink: 0; }
.public-hero-right .seg { background: rgba(255,255,255,0.72); box-shadow: inset 0 0 0 1px var(--border-faint); }
.ov-ring { --pct: 0; width: 76px; height: 76px; border-radius: 50%; flex-shrink: 0; background: conic-gradient(var(--brand-500) calc(var(--pct) * 1%), var(--gray-150) 0); display: flex; align-items: center; justify-content: center; }
.ov-ring-inner { width: 78%; height: 78%; border-radius: 50%; background: var(--surface); display: flex; align-items: center; justify-content: center; }
.ov-ring-inner strong { font-size: 17px; font-weight: var(--fw-bold); color: var(--text-strong); }
.public-empty { text-align: center; padding: var(--sp-8); display: flex; flex-direction: column; align-items: center; gap: 10px; margin-top: 12vh; }
.public-empty .empty-icon { font-size: 36px; color: var(--text-faint); }
.public-foot { text-align: center; font-size: var(--fs-2xs); color: var(--text-faint); margin-top: var(--sp-5); }
