/* PrimaLux 主题层 —— 最后加载，统一前面各层的视觉与信息层级。
 *
 * 颜色只来自 primalux-tokens.css（与 PrimaLux Design System 同源），这里不写字面色值。
 * 设计取向：精密实验记录本。扁平、数据密集、亮色单主题；品牌蓝主导，金橙只做点睛
 * （顶部渐变线、当前页签），状态色一律「浅底 + 深字 + 圆点」，不用整块饱和色填充。
 * 选择器前缀 html body 只为压过早期层的特异性，不改变语义。
 */

:root {
  --font-ui: var(--font-sans);
  --ui-text: var(--t-md);
  --ui-control: var(--t-sm);
  --ui-meta: var(--t-xs);
  --ui-heading: var(--t-2xl);
  --grid-row-height: 44px;
  --grid-head-height: 36px;
  --grid-control-height: 28px;
  --pl-ring: 0 0 0 3px color-mix(in srgb, var(--acc) 16%, transparent);
  --pl-rise: 260ms;
}

/* ---------- 基础 ---------- */
html body {
  font-family: var(--font-sans);
  color: var(--fg);
  background:
    radial-gradient(1100px 360px at 100% -120px, color-mix(in srgb, var(--b-100) 70%, transparent), transparent 72%),
    radial-gradient(700px 240px at 0 -80px, color-mix(in srgb, var(--g-100) 60%, transparent), transparent 70%),
    var(--bg);
  background-attachment: fixed;
}
html body :is(button, input, select, textarea) { font-family: var(--font-sans); }
::selection { background: var(--acc-sel); color: var(--fg); }
:is(.date-label, .date-input, .task-number, .tree-number, .link-count, .project-count, .table-total,
    .smart-list-count, .smart-task-due, .task-actual-deadline, .calendar-day-number, time, .gantt-range) {
  font-variant-numeric: tabular-nums;
}
html body :is(button, a, input, select, textarea, [tabindex]):focus-visible {
  outline: 2px solid var(--focus); outline-offset: 2px;
}

/* 字重：微软雅黑等中文系统字体只有常规 / 粗两档，600 会被吸附成 Bold。
 * 早期各层把大量控件写成 600–800，满屏粗体失去层级。这里把界面「外框」统一回常规字重，
 * 粗体只留给：页面标题、指标数字、项目 / 父任务名称、当前页签与主按钮。 */
html body :is(
  .workspace-nav-link, .workspace-nav-link span, .workspace-nav-icon, .new-project-btn, .new-project-btn span,
  .section-label, .eyebrow, .account-label, .smart-list-count, .smart-list-columns, .smart-task-project, .smart-task-label,
  .overview-filters label, .overview-filters :is(input, select), .overview-progress strong,
  .project-leadership strong, .project-leadership-label, .project-info-heading strong, .project-description-toggle,
  .board-action, .board-tab, .secondary-btn, .drawer-tab, .mark-read, .profile-role, .profile-form :is(label, strong),
  .gantt-toolbar-actions label, .gantt-legend, .gantt-range, .gantt-beijing-today, .gantt-task-label small,
  .status-option, .status-pill, .project-member-role
) { font-weight: var(--w-md); }
html body .profile-form :is(input, select, textarea) { font-weight: var(--w-nm); }
html body .board-card .task-table :is(th, .tree-number, .date-label, .date-icon, .priority-select, .inline-template-picker, .inline-template-picker span, .task-actual-deadline, .assignee-picker-label) { font-weight: var(--w-md); }
html body .board-card .task-table .status-select.status-select-button { font-weight: var(--w-md); }
html body .board-tab.active, html body .app-shell .project-item.active .project-name { font-weight: var(--w-bd); }

/* 品牌签名：整个应用顶端一条 3px 蓝→金渐变线 */
.app-shell::before {
  content: ""; position: fixed; inset: 0 0 auto 0; height: 3px; z-index: calc(var(--z-sticky) + 1);
  background: var(--brand-grad); pointer-events: none;
}

/* ---------- 按钮 ---------- */
html body :is(.primary-btn, .secondary-btn) {
  min-height: 34px; padding: 7px 14px; border-radius: var(--r1);
  font-size: var(--t-sm); font-weight: var(--w-md); line-height: 1.2; letter-spacing: 0;
  transition: background var(--dur) var(--ease), border-color var(--dur) var(--ease), color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
html body .primary-btn { background: var(--acc); color: var(--acc-fg); border: 1px solid var(--acc); box-shadow: var(--sh-1); font-weight: var(--w-bd); }
html body .primary-btn:hover { background: var(--acc-hover); border-color: var(--acc-hover); }
html body .primary-btn:active { background: var(--acc-active); }
html body .primary-btn:disabled { background: var(--line-strong); border-color: var(--line-strong); color: var(--panel); box-shadow: none; cursor: not-allowed; }
html body .secondary-btn { background: var(--panel); color: var(--fg-2); border: 1px solid var(--line); box-shadow: none; }
html body .secondary-btn:hover { border-color: var(--acc-line); color: var(--acc); background: var(--sunken); }
html body :is(.danger-outline, .secondary-btn.danger-outline) { color: var(--err); border-color: var(--err-line); }
html body :is(.danger-outline, .secondary-btn.danger-outline):hover { background: var(--err-soft); border-color: var(--err); color: var(--err); }
html body .danger-btn { background: var(--err); border-color: var(--err); }
html body .icon-button { color: var(--mut); border-radius: var(--r1); }
html body .icon-button:hover { background: var(--sunken2); color: var(--fg); }

/* ---------- 表单控件 ---------- */
html body :is(.task-modal, .project-modal, .profile-form, .auth-card, .project-risk-dialog) :is(input:not([type=checkbox]):not([type=radio]), select, textarea) {
  border: 1px solid var(--line); border-radius: var(--r1); background: var(--panel); color: var(--fg);
  font-size: var(--t-md); transition: border-color var(--dur) var(--ease), box-shadow var(--dur) var(--ease);
}
html body :is(.task-modal, .project-modal, .profile-form, .auth-card, .project-risk-dialog) :is(input, select, textarea):hover { border-color: var(--line-strong); }
html body :is(.task-modal, .project-modal, .profile-form, .auth-card, .project-risk-dialog) :is(input, select, textarea):focus {
  border-color: var(--acc); box-shadow: var(--pl-ring); outline: 0;
}
html body ::placeholder { color: var(--subtle); opacity: 1; }
html body :is(.task-modal, .project-modal, .auth-card) label { color: var(--fg-2); font-weight: var(--w-md); }

/* ---------- 侧栏 ---------- */
html body .app-shell > .workspace-sidebar { background: var(--panel); border-right: 1px solid var(--line); box-shadow: none; }
html body .workspace-brand span { color: var(--fg-2); font-weight: var(--w-md); letter-spacing: .02em; }
html body .workspace-nav-link { color: var(--mut); border-radius: var(--r2); border: 1px solid transparent; transition: background var(--dur) var(--ease), color var(--dur) var(--ease); }
html body .workspace-nav-link:hover { background: var(--sunken); color: var(--fg); }
html body .workspace-nav-link.active { background: var(--acc-soft); border-color: var(--acc-sel); color: var(--acc); box-shadow: none; }
html body .workspace-nav-link .workspace-nav-icon { color: currentColor; }
html body .workspace-nav-badge { background: var(--err-fill); color: var(--acc-fg); box-shadow: 0 0 0 2px var(--panel); font-style: normal; }
html body .workspace-nav-badge[data-count="0"] { display: none; }
html body .section-label { color: var(--mut); font-size: var(--t-xs); font-weight: var(--w-md); letter-spacing: .08em; }
html body :is(.project-item, .sidebar-link) {
  min-height: 34px; padding: 7px 10px; border: 0; border-radius: var(--r1);
  color: var(--fg-2); font-size: var(--t-md); font-weight: var(--w-md);
  transition: background var(--dur) var(--ease), color var(--dur) var(--ease);
}
html body :is(.project-item, .sidebar-link):hover { background: var(--sunken); color: var(--fg); border-color: transparent; }
html body .app-shell .project-item.active {
  background: var(--acc-soft); color: var(--acc); font-weight: var(--w-sb);
  box-shadow: inset 3px 0 0 var(--acc); border-color: transparent;
}
html body .sidebar-link > span:first-child { color: var(--subtle); }
html body :is(.project-count, .link-count) { color: var(--mut); font-size: var(--t-xs); font-weight: var(--w-md); }
html body :is(.project-count, .link-count)[data-count="0"] { color: var(--subtle); }
html body .link-count.warning:not([data-count="0"]) { color: var(--warn); font-weight: var(--w-sb); }
html body .workspace-sidebar .new-project-btn {
  background: var(--acc-soft); color: var(--acc); border: 1px dashed var(--acc-line);
  border-radius: var(--r1); box-shadow: none; font-size: var(--t-sm); font-weight: var(--w-md);
}
html body .workspace-sidebar .new-project-btn:hover { background: var(--acc); color: var(--acc-fg); border-style: solid; border-color: var(--acc); transform: none; }
html body .archive-sidebar summary { color: var(--fg-2); font-weight: var(--w-md); }
html body .sidebar-footer { color: var(--subtle); border-top-color: var(--line); }

/* ---------- 顶栏 ---------- */
html body .topbar { border-bottom: 1px solid var(--line); }
html body .breadcrumbs { color: var(--mut); font-size: var(--t-sm); }
html body .breadcrumbs strong { color: var(--fg); font-weight: var(--w-sb); }
html body .status-pill { font-size: var(--t-xs); font-weight: var(--w-md); padding: 3px 10px; border-radius: var(--r-pill); }
html body .status-pill.on-track { background: var(--ok-soft); color: var(--ok); }
html body .account-menu-avatar { background: var(--acc); color: var(--acc-fg); }

/* ---------- 项目标题区 ---------- */
html body .main-content > .project-heading { padding-top: var(--s5); padding-bottom: var(--s4); gap: var(--s3); }
html body .eyebrow { color: var(--mut); font-size: var(--t-xs); font-weight: var(--w-md); letter-spacing: .08em; }
html body .main-content > .project-heading h1 {
  color: var(--fg); font-size: var(--t-2xl); font-weight: var(--w-bd); letter-spacing: -.02em; line-height: var(--lh-tight);
}
html body .project-description { color: var(--fg-2); max-width: 72ch; line-height: var(--lh-base); }
/* 负责人 / 管理员 / 项目信息合并成一条元信息行，标题区高度收紧 */
html body .main-content > .project-heading > .project-heading-copy { display: flex; flex-wrap: wrap; align-items: center; column-gap: var(--s4); row-gap: var(--s2); }
html body .project-heading-copy > :is(.eyebrow, h1) { flex: 0 0 100%; margin: 0; }
html body .project-heading-copy > .project-description-wrap { display: contents; }
html body .project-heading-copy > .project-leadership { flex: 0 1 auto; padding: 0; gap: 6px var(--s4); color: var(--fg-2); }
html body .project-heading-copy .project-leadership-label,
html body .project-heading-copy .project-info-heading > strong { color: var(--mut); }
html body .project-heading-copy .project-info-heading {
  flex: 0 1 auto; margin: 0; gap: var(--s2); padding-left: var(--s4); border-left: 1px solid var(--line); color: var(--mut);
}
html body .project-heading-copy :is(.project-leadership, .project-info-heading) .secondary-btn { min-height: 26px; padding: 3px 9px; font-size: var(--t-xs); }
html body .project-heading-copy :is(#projectInfoForm, .project-description) { flex: 0 0 100%; }
/* 必须独占一行：早期层给了 max-width 700px，会让说明挤到元信息行右侧；用右内边距控制行长 */
html body .project-heading-copy .project-description {
  max-width: none; margin-top: 2px !important; box-sizing: border-box; padding-right: max(0px, calc(100% - 760px));
}
html body .project-heading-copy .project-description-toggle { color: var(--acc); font-size: var(--t-xs); }
/* 动作条：常用操作一组、风险操作另起，主按钮最醒目 */
html body .main-content > .project-heading > .heading-actions {
  gap: var(--s2); padding-top: var(--s3); border-top: 1px solid var(--line);
}
html body .main-content > .project-heading > .heading-actions > .secondary-btn:not(.project-action-btn) {
  background: transparent; border-color: transparent; color: var(--fg-2); padding-left: 10px; padding-right: 10px;
}
html body .main-content > .project-heading > .heading-actions > .secondary-btn:not(.project-action-btn):hover {
  background: var(--sunken); border-color: var(--line); color: var(--acc);
}
html body .main-content > .project-heading > .heading-actions > #projectArchiveBtn:not([hidden]) { margin-left: auto; }
html body .main-content > .project-heading > .heading-actions > #projectArchiveBtn[hidden] + #projectDeleteBtn { margin-left: auto; }

/* ---------- 看板卡 + 页签 ---------- */
html body .board-card {
  background: var(--panel); border: 1px solid var(--line); border-radius: var(--r3); box-shadow: var(--sh-2);
}
html body .board-tabs { height: 48px; padding: 0 var(--s4); gap: var(--s5); border-bottom: 1px solid var(--line); }
html body .board-tab { height: 48px; color: var(--mut); font-size: var(--t-md); font-weight: var(--w-md); }
html body .board-tab:hover { color: var(--fg); }
html body .board-tab.active { color: var(--fg); font-weight: var(--w-sb); }
html body .board-tab.active::after { height: 3px; bottom: -1px; border-radius: 3px 3px 0 0; background: var(--brand-grad); }
html body .board-action { color: var(--mut); font-size: var(--t-sm); }
html body .board-action:hover { color: var(--acc); }

/* 大纲工具条 */
html body .outline-toolbar { min-height: 46px; padding: 6px var(--s4); background: var(--panel); border-bottom: 1px solid var(--line); }
html body .outline-toolbar button { font-size: var(--t-sm); font-weight: var(--w-md); color: var(--fg-2); padding: 5px 10px; border-radius: var(--r1); }
html body .outline-toolbar button:hover { background: var(--sunken); border-color: var(--line); color: var(--acc); }
html body .outline-toolbar .outline-add { color: var(--acc-fg); background: var(--acc); border-color: var(--acc); font-weight: var(--w-sb); }
html body .outline-toolbar .outline-add:hover { background: var(--acc-hover); color: var(--acc-fg); border-color: var(--acc-hover); }
html body .outline-toolbar button[aria-pressed="true"] { background: var(--acc-soft); color: var(--acc); border-color: var(--acc-sel); }
html body .outline-hint { color: var(--mut); font-size: var(--t-xs); }

/* ---------- 任务表 ---------- */
/* 列宽重排：固定列合计约 800px，「任务」列吃剩余宽度，1440 宽屏不再横向滚动 */
html body .board-card .task-table { min-width: calc(1100px + var(--tree-extra, 0px) + var(--row-action-width, 44px) - 44px); }
html body .board-card .task-table th.task-col { width: auto; }
html body .board-card .task-table th.check-col { width: 40px; }
html body .board-card .task-table :is(th.detail-col, th.record-col) { width: 108px; }
html body .board-card .task-table th.owner-col { width: 104px; }
html body .board-card .task-table th.status-col { width: 88px; }
html body .board-card .task-table th.start-col { width: 100px; }
html body .board-card .task-table th.date-col { width: 124px; }
html body .board-card .task-table th.priority-col { width: 60px; }
html body .board-card .task-table th.dep-col { width: 72px; }
/* 宽屏：多出的宽度优先给「说明 / 记录」，避免任务名一栏空出大片 */
@media (min-width: 1680px) {
  html body .board-card .task-table :is(th.detail-col, th.record-col) { width: clamp(108px, 11vw, 220px); }
  html body .board-card .task-table th.owner-col { width: 128px; }
}

html body .board-card .task-table th {
  height: var(--grid-head-height); background: var(--sunken); color: var(--mut);
  font-size: var(--t-xs); font-weight: var(--w-md); letter-spacing: .02em;
  border-bottom: 1px solid var(--line-strong); border-right-color: var(--line);
}
html body .board-card .task-table td { font-size: var(--t-sm); color: var(--fg-2); border-right-color: var(--outline-line); }

/* 层级色带、悬停、选中描边与右键目标色由 task-hierarchy.css 独立维护。 */
html body .board-card .task-table .task-row[data-outline-kind="summary"] .task-number { color: var(--outline-summary-control); }
html body .board-card .task-table .task-row[data-outline-kind="summary"] .task-actual-deadline { color: var(--outline-summary-deadline); }

/* 名称与编号 */
html body .board-card .task-table .task-name-input { font-size: var(--t-md); font-weight: var(--w-md); }
html body .board-card .task-table .task-number { font-family: var(--font-mono); font-size: 11px; color: var(--subtle); letter-spacing: .02em; }
html body .board-card .task-table .tree-number { font-family: var(--font-mono); font-weight: var(--w-md); }
html body .board-card .task-table .task-text-input { font-size: var(--t-sm); }

/* 状态：浅底 + 深字 + 圆点 */
html body :is(.status-select.status-select-button, .board-card .task-table td.status-cell .status-select.status-select-button) {
  position: relative; display: inline-flex; align-items: center; justify-content: flex-start; gap: 6px;
  width: 100%; min-height: 28px; padding: 4px 8px; border: 1px solid transparent; border-radius: var(--r1);
  font-size: var(--t-xs); font-weight: var(--w-md); text-align: left; letter-spacing: .02em; white-space: nowrap; box-shadow: none;
  background: var(--pill-z-bg); color: var(--mut); transition: border-color var(--dur) var(--ease), filter var(--dur) var(--ease);
}
html body .status-select.status-select-button::before {
  content: ""; position: static; flex: 0 0 7px; width: 7px; height: 7px; margin: 0; border-radius: 50%; background: currentColor;
}
html body :is(.status-select.status-select-button, .board-card .task-table td.status-cell .status-select.status-select-button):hover { border-color: currentColor; }
html body :is(.status-select.status-select-button, .board-card .task-table td.status-cell .status-select.status-select-button).working { background: var(--warn-soft); color: var(--warn); }
html body :is(.status-select.status-select-button, .board-card .task-table td.status-cell .status-select.status-select-button).done { background: var(--ok-soft); color: var(--ok); }
html body :is(.status-select.status-select-button, .board-card .task-table td.status-cell .status-select.status-select-button).stuck { background: var(--err-soft); color: var(--err); }
html body :is(.status-select.status-select-button, .board-card .task-table td.status-cell .status-select.status-select-button).not-started { background: var(--pill-z-bg); color: var(--mut); }
html body .status-select.status-select-button.working::before { background: var(--warn-fill); }
html body .status-select.status-select-button.done::before { background: var(--ok-fill); }
html body .status-select.status-select-button.stuck::before { background: var(--err-fill); }
html body .status-select.status-select-button.not-started::before { background: var(--subtle); }
html body .status-menu { border-radius: var(--r2); border-color: var(--line); box-shadow: var(--sh-3); padding: 8px; width: 180px; }
html body .status-menu::before { display: none; }
html body .status-option {
  justify-content: flex-start; gap: 8px; height: 32px; margin: 0 0 4px; padding: 0 10px; border-radius: var(--r1);
  font-size: var(--t-sm); font-weight: var(--w-md); transform: none;
}
html body .status-option::before { content: ""; width: 8px; height: 8px; border-radius: 50%; background: currentColor; }
html body .status-option:hover { filter: none; transform: none; box-shadow: inset 0 0 0 1px currentColor; }
html body .status-option.status-working { background: var(--warn-soft); color: var(--warn); }
html body .status-option.status-done { background: var(--ok-soft); color: var(--ok); }
html body .status-option.status-stuck { background: var(--err-soft); color: var(--err); }
html body .status-option.status-not-started { background: var(--pill-z-bg); color: var(--mut); }

/* 日期 / 优先级 / 成员 / 依赖 */
html body .board-card .task-table .date-cell { font-size: var(--t-sm); color: var(--fg-2); border-color: transparent; background: transparent; }
html body .board-card .task-table .date-cell:hover { border-color: var(--line); background: var(--panel); }
html body .board-card .task-table .date-cell.overdue { color: var(--err); font-weight: var(--w-sb); }
html body .board-card .task-table .date-cell.soon { color: var(--warn); font-weight: var(--w-sb); }
html body .board-card .task-table .date-icon { color: var(--subtle); }
html body .board-card .task-table .task-actual-deadline { font-size: 11px; color: var(--subtle); }
html body .priority-dot.priority-high { background: var(--err-fill); }
html body .priority-dot.priority-medium { background: var(--warn-fill); }
html body .priority-dot.priority-low { background: var(--subtle); }
html body .priority-select { font-size: var(--t-sm); font-weight: var(--w-md); }
html body .priority-select.priority-high-text { color: var(--err); }
html body .priority-select.priority-medium-text { color: var(--warn); }
html body .priority-select.priority-low-text { color: var(--mut); }
html body .assignee-picker-label { color: var(--fg-2); font-size: var(--t-sm); }
html body .assignee-picker:not(:has(.assignee-avatar-stack > *)) .assignee-picker-label { color: var(--subtle); }
html body .dep-chip { background: var(--acc-soft); color: var(--acc); font-family: var(--font-mono); font-size: 11px; }
html body .dep-chip.empty { background: transparent; color: var(--subtle); }
html body .board-card .task-table input[type=checkbox] { border-color: var(--line-strong); border-radius: 4px; }
html body .board-card .task-table input[type=checkbox]:checked { background: var(--acc); border-color: var(--acc); }
html body .drag-handle { color: var(--subtle); }
html body .table-footer { color: var(--mut); border-top: 1px solid var(--line); }
html body .add-row { color: var(--acc); font-weight: var(--w-sb); }
html body .table-hint, html body .table-total { color: var(--mut); font-size: var(--t-xs); }

/* ---------- 列表页（项目总览 / 我的待办 / 快捷视图） ---------- */
html body .smart-list-view { padding: var(--s5) var(--s5) var(--s6); }
html body .smart-list-head { border-bottom: 0; padding-bottom: var(--s3); }
html body .smart-list-head h2 { color: var(--fg); font-size: var(--t-2xl); font-weight: var(--w-bd); letter-spacing: -.02em; }
html body .smart-list-head p { color: var(--mut); font-size: var(--t-sm); }
html body .smart-list-count { background: var(--acc-soft); color: var(--acc); font-size: var(--t-xs); font-weight: var(--w-md); border-radius: var(--r-pill); padding: 5px 12px; }
html body .smart-list-columns { color: var(--mut); font-size: var(--t-xs); font-weight: var(--w-md); letter-spacing: .04em; }
html body .smart-task-list { border: 1px solid var(--line); border-radius: var(--r2); background: var(--panel); box-shadow: var(--sh-1); }
html body .smart-task-row { border-bottom-color: var(--line); transition: background var(--dur) var(--ease); }
html body .smart-task-row:hover { background: var(--b-50); }
html body .smart-task-main strong { color: var(--fg); font-size: var(--t-md); font-weight: var(--w-sb); }
html body .smart-task-main small { color: var(--mut); font-size: var(--t-xs); }
html body .smart-task-label { border-radius: var(--r-pill); padding: 3px 10px; font-size: var(--t-xs); font-weight: var(--w-md); }
html body .smart-task-label.working { background: var(--warn-soft); color: var(--warn); }
html body .smart-task-label.done { background: var(--ok-soft); color: var(--ok); }
html body .smart-task-label.stuck { background: var(--err-soft); color: var(--err); }
html body .smart-task-label.not-started { background: var(--pill-z-bg); color: var(--mut); }
html body :is(.smart-task-label, .my-tasks-view .smart-task-label).is-zero { background: transparent; color: var(--subtle); font-weight: var(--w-md); }
/* 空分组：虚线框 + 浅底，与有内容的列表明显区分 */
html body .smart-task-list:has(> :is(.my-task-group-empty, .smart-empty)) {
  border-style: dashed; border-color: var(--line-strong); background: color-mix(in srgb, var(--sunken) 55%, transparent); box-shadow: none;
}
html body .my-task-group-empty { margin: 0; padding: 12px 14px; color: var(--subtle); font-size: var(--t-sm); }
html body .smart-empty { color: var(--mut); }
html body .my-task-group-title { color: var(--fg); font-size: var(--t-sm); font-weight: var(--w-bd); }
html body .my-task-group-count { color: var(--mut); background: var(--sunken2); font-weight: var(--w-md); }

html body .overview-progress strong { color: var(--fg-2); font-size: var(--t-sm); font-weight: var(--w-md); }

/* 总览：项目行 */
html body .overview-view .smart-list-columns,
html body .overview-view .smart-task-row.overview-row { grid-template-columns: minmax(0, 1.6fr) minmax(110px, .7fr) minmax(150px, .8fr) minmax(300px, 1.5fr); }
.overview-project { flex-direction: row !important; align-items: center; gap: 10px !important; }
.overview-dot { flex: 0 0 10px; width: 10px; height: 10px; border-radius: 3px; background: var(--project-color, var(--acc)); }
.overview-progress small { font-variant-numeric: tabular-nums; }
.overview-meter { display: block; height: 4px; margin-top: 2px; border-radius: var(--r-pill); background: var(--sunken2); overflow: hidden; }
.overview-meter i { display: block; height: 100%; border-radius: inherit; background: var(--ok-fill); }
html body .overview-status-counts { display: flex; flex-wrap: wrap; align-items: center; gap: 6px; }
.overview-stack { display: flex; flex: 1 0 100%; height: 6px; gap: 2px; border-radius: var(--r-pill); overflow: hidden; margin-bottom: 2px; }
.overview-stack.is-empty { background: var(--sunken2); }
.overview-stack i { display: block; min-width: 4px; }
.overview-stack i.done { background: var(--ok-fill); }
.overview-stack i.working { background: var(--warn-fill); }
.overview-stack i.stuck { background: var(--err-fill); }
.overview-stack i.not-started { background: var(--line-strong); }
html body .overview-row:hover { box-shadow: inset 3px 0 0 var(--project-color, var(--acc)); }
html body .overview-filters label { color: var(--mut); font-weight: var(--w-md); font-size: var(--t-xs); }
html body .overview-filters :is(input, select) { border-color: var(--line); border-radius: var(--r1); background: var(--panel); color: var(--fg); }

/* ---------- 甘特图 / 日历 ---------- */
html body .gantt-view, html body .flat-calendar.calendar-view { background: var(--panel); }
html body :is(.gantt-toolbar h2, .flat-calendar .calendar-toolbar h2) { color: var(--fg); font-size: var(--t-xl); font-weight: var(--w-bd); }
html body .gantt-bar { border-radius: var(--r1); color: var(--fg); font-weight: var(--w-md); box-shadow: inset 0 0 0 1px color-mix(in srgb, var(--fg) 8%, transparent); }
html body .gantt-bar.working { background: var(--warn-line); }
html body .gantt-bar.done { background: var(--ok-line); }
html body .gantt-bar.stuck { background: var(--err-line); }
html body .gantt-bar.not-started { background: var(--sunken2); color: var(--fg-2); }
html body .gantt-bar-progress { background: color-mix(in srgb, var(--fg) 10%, transparent); }
html body .gantt-day-header.today strong { background: var(--acc); border-radius: var(--r1); }
/* 延期区间是提示而不是主角：细线 + 降低饱和，计划条保持视觉主导 */
html body .gantt-view .gantt-actual-delay { height: 3px; border-radius: var(--r-pill); background: color-mix(in srgb, var(--err-fill) 72%, var(--panel)); }
html body .gantt-view .gantt-actual-delay.is-pending { background: repeating-linear-gradient(135deg, var(--err-fill) 0 3px, var(--err-line) 3px 6px); }
html body .gantt-view .gantt-legend .gantt-legend-delay { height: 3px; background: color-mix(in srgb, var(--err-fill) 72%, var(--panel)); }
html body .flat-calendar .calendar-day { border-radius: var(--r2); }
html body .flat-calendar .calendar-day.today { border-color: var(--acc) !important; box-shadow: var(--pl-ring); }
html body .flat-calendar .calendar-day.today .calendar-day-number { background: var(--acc); }
html body .flat-calendar .calendar-task { border-radius: var(--r1); font-weight: var(--w-md); }

/* ---------- 模态 / 抽屉 / 浮层 ---------- */
html body :is(.task-modal, .project-modal, .task-template-library-modal, .project-members-modal, .project-risk-dialog, .confirm-dialog) {
  border-radius: var(--r3); box-shadow: var(--sh-3); border: 1px solid var(--line);
}
html body :is(.modal-backdrop, .confirm-dialog-backdrop, .project-risk-backdrop, .drawer-backdrop, .profile-backdrop) { background: var(--overlay); }
html body .modal-head h2, html body .drawer-head h2, html body .profile-drawer-head h2 { color: var(--fg); font-size: var(--t-xl); font-weight: var(--w-bd); letter-spacing: -.01em; }
html body :is(.notification-drawer, .profile-drawer) { box-shadow: var(--sh-3); }
html body .toast { background: var(--fg); color: var(--acc-fg); border-radius: var(--r1); box-shadow: var(--sh-3); font-size: var(--t-sm); }

/* ---------- 登录 ---------- */
html body .auth-screen {
  background:
    radial-gradient(800px 420px at 85% 0, color-mix(in srgb, var(--b-100) 80%, transparent), transparent 70%),
    radial-gradient(600px 360px at 0 100%, color-mix(in srgb, var(--g-100) 80%, transparent), transparent 70%),
    var(--bg);
}
html body .auth-card { position: relative; overflow: hidden; border: 1px solid var(--line); border-radius: var(--r3); box-shadow: var(--sh-3); }
html body .auth-card::before { content: ""; position: absolute; inset: 0 0 auto 0; height: 4px; background: var(--brand-grad); }
html body .auth-card h2 { color: var(--fg); font-size: var(--t-2xl); letter-spacing: -.02em; }

/* ---------- 动效：一次编排好的进场 + 克制的悬停 ---------- */
@keyframes pl-rise { from { opacity: 0; transform: translateY(6px); } to { opacity: 1; transform: none; } }
@keyframes pl-fade { from { opacity: 0; } to { opacity: 1; } }
@keyframes pl-pop { from { opacity: 0; transform: translateY(8px) scale(.985); } to { opacity: 1; transform: none; } }
html body .app-shell:not([inert]) .main-content > :is(.project-heading, .board-card) { animation: pl-rise var(--pl-rise) var(--ease) both; }
html body .app-shell:not([inert]) .main-content > .board-card { animation-delay: 60ms; }
html body .alternate-view:not([hidden]) > * { animation: pl-fade 200ms var(--ease) both; }
html body .overview-view .smart-task-row { animation: pl-rise var(--pl-rise) var(--ease) both; }
html body .overview-view .smart-task-row:nth-child(2) { animation-delay: 30ms; }
html body .overview-view .smart-task-row:nth-child(3) { animation-delay: 60ms; }
html body .overview-view .smart-task-row:nth-child(4) { animation-delay: 90ms; }
html body .overview-view .smart-task-row:nth-child(n+5) { animation-delay: 120ms; }
html body :is(.modal-backdrop.open, .confirm-dialog-backdrop.open, .project-risk-backdrop.open) > * { animation: pl-pop 200ms var(--ease) both; }
html body .floating-menu:not([hidden]) { animation: pl-fade 120ms var(--ease) both; }
@media (prefers-reduced-motion: reduce) {
  html body *, html body *::before, html body *::after { animation-duration: .01ms !important; animation-delay: 0ms !important; transition-duration: .01ms !important; }
}

/* ---------- 响应式 ---------- */
@media (max-width: 760px) {
  /* 手机端侧栏 = 紧凑刊头：品牌一行、项目一行、快捷入口一行、团队 / 归档并排一行，
   * 内容区在首屏可见范围内（原先刊头约 330px，现约 190px）。 */
  html body .app-shell > .workspace-sidebar {
    display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); column-gap: var(--s2); row-gap: 6px;
    padding: 8px 12px 10px; box-shadow: none;
  }
  html body .app-shell > .workspace-sidebar > :not(.archive-sidebar) { grid-column: 1 / -1; }
  html body .app-shell > .workspace-sidebar > .workspace-brand { min-height: 30px; margin: 0 2px; }
  html body .app-shell > .workspace-sidebar > .workspace-brand img { width: 104px; max-height: 30px; }
  html body .app-shell > .workspace-sidebar > .sidebar-section { margin: 0; }
  html body .workspace-sidebar .projects-section { overflow-x: auto; scrollbar-width: none; }
  html body .workspace-sidebar .projects-section::-webkit-scrollbar { display: none; }
  html body .workspace-sidebar :is(.new-project-btn, .projects-section > .sidebar-link) { flex: 0 0 auto; white-space: nowrap; min-height: 34px; }
  html body .workspace-sidebar #projectList { overflow: visible; flex: 0 0 auto; }
  html body .workspace-sidebar #projectList .project-item { min-height: 34px; }
  html body .workspace-sidebar #projectList .project-item.active { background: var(--acc-soft); border-color: var(--acc-sel); box-shadow: none; }
  html body .workspace-sidebar .sidebar-link { min-height: 32px; padding: 5px 10px; background: var(--panel); white-space: nowrap; }
  html body .workspace-sidebar :is(.new-project-btn, .projects-section > .sidebar-link) { width: auto; min-width: max-content; padding: 6px 10px; margin: 0; }
  html body .app-shell > .workspace-sidebar > .archive-sidebar { margin: 0; padding: 0; border: 1px solid var(--line); border-radius: var(--r1); background: var(--panel); }
  html body .app-shell > .workspace-sidebar > .archive-sidebar > summary { min-height: 32px; padding: 5px 10px; font-size: var(--t-sm); line-height: 20px; }
  html body .app-shell > .workspace-sidebar > .archive-sidebar[open] { grid-column: 1 / -1; }

  /* 总览筛选：搜索独占一行，两个下拉并排 */
  html body .overview-view .overview-filters { display: grid; grid-template-columns: minmax(0, 1fr) minmax(0, 1fr); gap: var(--s2); width: 100%; }
  html body .overview-view .overview-filters label { flex: none; min-width: 0; }
  html body .overview-view .overview-filters label:first-child { grid-column: 1 / -1; }

  /* 项目元信息在窄屏改为纵向堆叠，去掉分隔竖线 */
  html body .project-heading-copy .project-info-heading { padding-left: 0; border-left: 0; }
  html body .project-heading-copy .project-description { padding-right: 0; }
  html body .outline-toolbar { flex-wrap: wrap; }
  html body .outline-toolbar .outline-hint { display: block; white-space: normal; }

  html body .smart-list-view { padding: var(--s4) var(--s3) var(--s5); }
  html body .overview-view .smart-list-columns { display: none; }
  html body .overview-view .smart-task-row.overview-row { grid-template-columns: minmax(0, 1fr); row-gap: 8px; }
  html body .overview-view .smart-task-row.overview-row > :is(.smart-task-main, .smart-task-project, .overview-progress, .overview-status-counts) { grid-column: 1; }
  html body .overview-view .smart-task-row.overview-row > .smart-task-project { display: block; }
  html body .main-content > .project-heading h1 { font-size: var(--t-xl); }
  html body .main-content > .project-heading > .heading-actions { flex-wrap: nowrap; overflow-x: auto; scrollbar-width: none; padding-bottom: 2px; }
  html body .main-content > .project-heading > .heading-actions > button { flex: 0 0 auto; white-space: nowrap; }
}
