/* ==========================================================================
   深投协同 · PC 管理后台与工作台样式系统 (TDesign Pro × Modern Linear V2.0)
   ========================================================================== */

:root {
  --brand: #0052d9;
  --brand-hover: #1d4ed8;
  --brand-soft: #eff6ff;
  --brand-border: #bfdbfe;

  --emerald: #059669;
  --emerald-soft: #ecfdf5;
  --emerald-border: #a7f3d0;

  --amber: #d97706;
  --amber-soft: #fffbeb;
  --amber-border: #fde68a;

  --rose: #e11d48;
  --rose-soft: #fff1f2;
  --rose-border: #fecdd3;

  --bg-canvas: #f4f6f9;
  --bg-card: #ffffff;
  --bg-subtle: #f8fafc;

  --ink-1: #0f172a;
  --ink-2: #334155;
  --ink-3: #64748b;
  --ink-4: #94a3b8;

  --border: #e8edf3;
  --border-strong: #cbd5e1;

  --shadow-card: 0 1px 3px rgba(15, 23, 42, 0.03), 0 4px 12px rgba(15, 23, 42, 0.02);
  --shadow-hover: 0 8px 24px rgba(0, 82, 217, 0.08), 0 2px 6px rgba(15, 23, 42, 0.04);
  --shadow-drawer: -12px 0 40px rgba(15, 23, 42, 0.16);

  font-family: -apple-system, BlinkMacSystemFont, "Segoe UI", "PingFang SC", "Hiragino Sans GB", "Microsoft YaHei", sans-serif;
  color: var(--ink-1);
  background: var(--bg-canvas);
  font-size: 14px;
  line-height: 1.5;
}

* {
  box-sizing: border-box;
}

body {
  margin: 0;
  background: var(--bg-canvas);
  color: var(--ink-1);
  -webkit-font-smoothing: antialiased;
}

button,
input,
select,
textarea {
  font: inherit;
}

button {
  cursor: pointer;
}

button:disabled {
  opacity: 0.52;
  cursor: not-allowed;
}

button:focus-visible,
a:focus-visible,
select:focus-visible,
input:focus-visible,
textarea:focus-visible,
.table-wrapper:focus-visible {
  outline: 2px solid #3b82f6;
  outline-offset: 2px;
}

[hidden] {
  display: none !important;
}

/* ==================== 整体框架布局 ==================== */
.shell {
  display: flex;
  min-height: 100vh;
}

.sidebar {
  width: 248px;
  position: fixed;
  inset: 0 auto 0 0;
  background: #ffffff;
  color: var(--ink-1);
  border-right: 1px solid var(--border);
  padding: 24px 16px;
  display: flex;
  flex-direction: column;
  z-index: 20;
}

.brand {
  display: flex;
  gap: 12px;
  align-items: center;
  padding: 0 8px 24px;
  border-bottom: 1px solid var(--border);
  margin-bottom: 20px;
}

.brand-mark {
  background: linear-gradient(135deg, #0052d9 0%, #2563eb 100%);
  color: #ffffff;
  border-radius: 12px;
  width: 40px;
  height: 40px;
  display: grid;
  place-items: center;
  font-size: 18px;
  font-weight: 700;
  flex-shrink: 0;
  box-shadow: 0 4px 10px rgba(0, 82, 217, 0.22);
}

.brand strong {
  font-size: 17px;
  font-weight: 700;
  color: var(--ink-1);
  letter-spacing: 0.5px;
}

.brand small {
  display: block;
  color: var(--ink-4);
  font-size: 10px;
  font-weight: 600;
  letter-spacing: 1.2px;
  margin-top: 2px;
}

.side-caption {
  font-size: 11px;
  font-weight: 600;
  letter-spacing: 1px;
  color: var(--ink-4);
  padding: 0 12px 10px;
  text-transform: uppercase;
}

nav {
  display: flex;
  flex-direction: column;
  gap: 4px;
}

nav button {
  display: flex;
  justify-content: space-between;
  align-items: center;
  text-align: left;
  border: 0;
  background: transparent;
  color: var(--ink-2);
  border-radius: 10px;
  padding: 11px 14px;
  font-size: 13.5px;
  font-weight: 500;
  transition: background-color 0.15s, color 0.15s;
}

.nav-left {
  display: flex;
  align-items: center;
  gap: 10px;
}

.nav-symbol {
  font-size: 15px;
  width: 20px;
  text-align: center;
  color: var(--ink-3);
}

.nav-badge {
  font-size: 11px;
  font-weight: 600;
  padding: 2px 8px;
  border-radius: 999px;
  background: #f1f5f9;
  color: var(--ink-3);
}

nav button[aria-current="page"] {
  background: var(--brand-soft);
  color: var(--brand);
  font-weight: 600;
}

nav button[aria-current="page"] .nav-symbol {
  color: var(--brand);
}

nav button[aria-current="page"] .nav-badge {
  background: #dbeafe;
  color: var(--brand);
}

nav button:hover:not([aria-current="page"]) {
  background: var(--bg-subtle);
  color: var(--ink-1);
}

.side-bottom {
  margin-top: auto;
  padding-top: 16px;
}

.side-role-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 14px;
  margin-bottom: 10px;
}

.side-role-head {
  display: flex;
  align-items: center;
  gap: 8px;
  font-size: 12.5px;
  color: var(--ink-1);
}

.status-dot {
  display: inline-block;
  width: 8px;
  height: 8px;
  background: var(--emerald);
  border-radius: 50%;
}

.side-bottom p {
  font-size: 11.5px;
  color: var(--ink-3);
  line-height: 1.55;
  margin: 8px 0 0;
}

.side-bottom small {
  display: block;
  font-size: 11px;
  color: var(--ink-4);
  text-align: center;
}

/* ==================== 右侧主工作区与顶栏 ==================== */
.workspace {
  margin-left: 248px;
  flex: 1;
  min-width: 0;
  display: flex;
  flex-direction: column;
  min-height: 100vh;
}

.topbar {
  height: 64px;
  position: sticky;
  top: 0;
  z-index: 15;
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 0 32px;
  background: rgba(255, 255, 255, 0.92);
  backdrop-filter: blur(8px);
  border-bottom: 1px solid var(--border);
  gap: 20px;
}

.topbar-left {
  display: flex;
  align-items: center;
  font-size: 13.5px;
}

.workspace-name {
  color: var(--ink-3);
  font-weight: 500;
}

.top-divider {
  color: var(--ink-4);
  margin: 0 10px;
}

.breadcrumb-current {
  font-weight: 700;
  color: var(--ink-1);
}

.topbar-right {
  display: flex;
  align-items: center;
  gap: 16px;
}

.quick-topbar-actions {
  display: flex;
  align-items: center;
  gap: 8px;
}

.identity-area {
  display: flex;
  align-items: center;
  gap: 8px;
  padding-left: 16px;
  border-left: 1px solid var(--border);
}

.identity-area label {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
}

.identity-area select {
  border: 1px solid var(--border-strong);
  border-radius: 8px;
  background: var(--bg-subtle);
  padding: 6px 10px;
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-1);
  max-width: 200px;
}

main {
  padding: 28px 32px 40px;
  max-width: 1600px;
  width: 100%;
  margin: 0 auto;
  flex: 1;
}

footer {
  padding: 16px 32px 24px;
  display: flex;
  justify-content: space-between;
  color: var(--ink-4);
  font-size: 12px;
  border-top: 1px solid var(--border);
  background: #ffffff;
}

/* ==================== 页面头部与按钮体系 ==================== */
.page-header {
  display: flex;
  justify-content: space-between;
  align-items: flex-end;
  margin-bottom: 22px;
  gap: 16px;
  flex-wrap: wrap;
}

.eyebrow {
  font-size: 11px;
  color: var(--brand);
  letter-spacing: 1.5px;
  font-weight: 700;
  text-transform: uppercase;
  margin-bottom: 4px;
}

h1 {
  font-size: 24px;
  font-weight: 700;
  letter-spacing: -0.4px;
  margin: 0 0 4px;
  color: var(--ink-1);
}

h2 {
  font-size: 16px;
  font-weight: 700;
  margin: 0;
  color: var(--ink-1);
}

h3 {
  font-size: 15px;
  font-weight: 700;
  margin: 0 0 12px;
  color: var(--ink-1);
}

.page-header p {
  color: var(--ink-3);
  margin: 0;
  font-size: 13px;
}

.header-actions,
.actions {
  display: flex;
  gap: 8px;
  flex-wrap: wrap;
  align-items: center;
}

.button {
  border: 1px solid var(--border-strong);
  background: #ffffff;
  color: var(--ink-2);
  border-radius: 9px;
  padding: 8px 14px;
  font-size: 13px;
  font-weight: 600;
  display: inline-flex;
  justify-content: center;
  gap: 6px;
  align-items: center;
  transition: all 0.15s;
}

.button:hover:not(:disabled) {
  border-color: #93c5fd;
  background: var(--brand-soft);
  color: var(--brand);
}

.button.sm {
  padding: 5px 10px;
  font-size: 12px;
  border-radius: 7px;
}

.button.primary {
  background: var(--brand);
  border-color: var(--brand);
  color: #ffffff;
  box-shadow: 0 2px 6px rgba(0, 82, 217, 0.18);
}

.button.primary:hover:not(:disabled) {
  background: var(--brand-hover);
  border-color: var(--brand-hover);
  color: #ffffff;
}

.button.success {
  background: var(--emerald);
  border-color: var(--emerald);
  color: #ffffff;
}

.button.success:hover:not(:disabled) {
  background: #047857;
  color: #ffffff;
}

.button.warning {
  background: var(--amber-soft);
  border-color: var(--amber-border);
  color: #b45309;
}

.button.danger {
  background: var(--rose-soft);
  border-color: var(--rose-border);
  color: #be123c;
}

.text-button {
  border: 0;
  background: none;
  color: var(--brand);
  padding: 4px 8px;
  font-size: 12.5px;
  font-weight: 600;
  border-radius: 6px;
}

.text-button:hover {
  background: var(--brand-soft);
}

.icon-button {
  border: 1px solid var(--border);
  background: var(--bg-subtle);
  border-radius: 8px;
  width: 34px;
  height: 34px;
  color: var(--ink-2);
  font-size: 20px;
  display: grid;
  place-items: center;
}

.icon-button:hover {
  background: #e2e8f0;
}

/* ==================== 语义胶囊与状态标签 ==================== */
.pill {
  display: inline-flex;
  gap: 5px;
  align-items: center;
  padding: 3px 10px;
  border-radius: 999px;
  font-size: 12px;
  font-weight: 600;
  white-space: nowrap;
  border: 1px solid transparent;
}

.status-icon {
  width: 14px;
  height: 14px;
  flex-shrink: 0;
}

.pill.pale {
  background: var(--brand-soft);
  color: var(--brand);
  border-color: var(--brand-border);
}

.pill.green {
  background: var(--emerald-soft);
  color: var(--emerald);
  border-color: var(--emerald-border);
}

.pill.orange {
  background: var(--amber-soft);
  color: #b45309;
  border-color: var(--amber-border);
}

.pill.error {
  background: var(--rose-soft);
  color: #be123c;
  border-color: var(--rose-border);
}

.pill.grey {
  background: #f1f5f9;
  color: var(--ink-3);
  border-color: #e2e8f0;
}

.mono {
  font-family: "SFMono-Regular", Consolas, "Liberation Mono", Menlo, monospace;
  font-size: 12px;
  color: var(--ink-3);
}

/* ==================== 5维 Bento 指标卡 ==================== */
.metrics {
  display: grid;
  grid-template-columns: repeat(5, minmax(0, 1fr));
  gap: 16px;
  margin-bottom: 22px;
}

.metric {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 20px;
  position: relative;
  text-align: left;
  box-shadow: var(--shadow-card);
  transition: transform 0.15s, box-shadow 0.15s, border-color 0.15s;
}

.metric:hover {
  transform: translateY(-2px);
  box-shadow: var(--shadow-hover);
  border-color: #bfdbfe;
}

.metric-label {
  color: var(--ink-3);
  font-size: 12.5px;
  font-weight: 600;
}

.metric-number {
  display: block;
  font-size: 32px;
  font-weight: 700;
  letter-spacing: -1px;
  margin: 10px 0 6px;
  font-variant-numeric: tabular-nums;
}

.metric-foot {
  font-size: 11.5px;
  color: var(--ink-4);
}

.metric-symbol {
  position: absolute;
  right: 18px;
  top: 18px;
  background: var(--brand-soft);
  color: var(--brand);
  width: 32px;
  height: 32px;
  border-radius: 10px;
  display: grid;
  place-items: center;
  font-weight: 700;
}

.metric.featured {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 65%, #0052d9 100%);
  color: #ffffff;
  border-color: transparent;
}

.metric.featured .metric-label,
.metric.featured .metric-foot {
  color: rgba(255, 255, 255, 0.78);
}

.metric.featured .metric-symbol {
  background: rgba(255, 255, 255, 0.16);
  color: #ffffff;
}

.metric.danger-metric {
  border-color: var(--rose-border);
  background: linear-gradient(180deg, #fff1f2 0%, #ffffff 65%);
}

.metric.danger-metric .metric-number {
  color: var(--rose);
}

.metric.danger-metric .metric-symbol {
  background: var(--rose-soft);
  color: var(--rose);
}

/* ==================== 面板与双栏工作台布局 ==================== */
.bento {
  display: grid;
  grid-template-columns: minmax(0, 1.55fr) minmax(340px, 1fr);
  gap: 20px;
  align-items: start;
}

.panel {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  overflow: hidden;
  margin-bottom: 20px;
  box-shadow: var(--shadow-card);
}

.panel-head {
  padding: 18px 22px;
  display: flex;
  align-items: center;
  justify-content: space-between;
  border-bottom: 1px solid var(--border);
  gap: 12px;
  flex-wrap: wrap;
}

.panel-body {
  padding: 22px;
}

.count {
  font-size: 12px;
  color: var(--ink-3);
  font-weight: 500;
  margin-left: 6px;
}

.mask-banner {
  background: var(--amber-soft);
  color: #92400e;
  border: 1px solid var(--amber-border);
  border-radius: 12px;
  padding: 12px 18px;
  font-size: 13px;
  font-weight: 500;
  margin-bottom: 18px;
}

/* ==================== 分段胶囊与多维筛选栏 ==================== */
.filter-bar {
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 16px;
  padding: 16px 20px;
  margin-bottom: 18px;
  display: flex;
  flex-direction: column;
  gap: 12px;
  box-shadow: var(--shadow-card);
}

.filter-row {
  display: flex;
  align-items: center;
  justify-content: space-between;
  gap: 12px;
  flex-wrap: wrap;
}

.seg-group {
  display: inline-flex;
  background: #f1f5f9;
  padding: 3px;
  border-radius: 10px;
  gap: 2px;
}

.seg-btn {
  border: 0;
  background: transparent;
  color: var(--ink-2);
  padding: 6px 14px;
  border-radius: 8px;
  font-size: 12.5px;
  font-weight: 600;
}

.seg-btn.active {
  background: #ffffff;
  color: var(--brand);
  box-shadow: 0 1px 3px rgba(15, 23, 42, 0.08);
}

.filters {
  display: flex;
  gap: 10px;
  align-items: center;
  flex-wrap: wrap;
}

.filters input {
  min-width: 240px;
}

.filters select,
.filters input {
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  border-radius: 8px;
  padding: 8px 12px;
  color: var(--ink-1);
  font-size: 13px;
}

/* ==================== 响应式数据表格 (responsive-table 规范) ==================== */
.table-wrapper {
  overflow: auto;
  max-inline-size: 100%;
  max-block-size: min(640px, 78vh);
  container-type: inline-size;
}

table {
  border-collapse: separate;
  border-spacing: 0;
  width: 100%;
  text-align: left;
  font-size: 13px;
  --label-1: "事项";
  --label-2: "分轨与项目";
  --label-3: "责任与验收";
  --label-4: "双期限";
  --label-5: "状态";
  --label-6: "操作";
}

thead {
  position: sticky;
  inset-block-start: 0;
  z-index: 2;
}

th {
  color: var(--ink-3);
  font-weight: 600;
  font-size: 12px;
  background: #f8fafc;
  padding: 14px 18px;
  border-bottom: 1px solid var(--border);
}

td,
tbody th {
  padding: 15px 18px;
  border-bottom: 1px solid var(--border);
  vertical-align: middle;
}

tbody th {
  position: sticky;
  inset-inline-start: 0;
  background: #ffffff;
  z-index: 1;
  font-weight: 600;
  color: var(--ink-1);
  max-width: 340px;
}

tbody tr:hover td,
tbody tr:hover th {
  background: #f8faff;
}

@container (width < 600px) {
  table,
  thead,
  tbody,
  tr,
  th,
  td {
    display: block;
  }

  thead {
    display: none;
  }

  tr {
    margin-block-end: 12px;
    border: 1px solid var(--border);
    border-radius: 12px;
    overflow: hidden;
  }

  tbody th {
    position: sticky;
    inset-block-start: 0;
    z-index: 2;
    background: #f8fafc;
    max-width: none;
  }

  td:nth-child(2)::before { content: var(--label-2) "："; font-weight: 600; color: var(--ink-3); }
  td:nth-child(3)::before { content: var(--label-3) "："; font-weight: 600; color: var(--ink-3); }
  td:nth-child(4)::before { content: var(--label-4) "："; font-weight: 600; color: var(--ink-3); }
  td:nth-child(5)::before { content: var(--label-5) "："; font-weight: 600; color: var(--ink-3); }
  td:nth-child(6)::before { content: var(--label-6) "："; font-weight: 600; color: var(--ink-3); }
}

/* ==================== 列表行与项目矩阵卡片 ==================== */
.task-row {
  width: 100%;
  display: flex;
  text-align: left;
  align-items: center;
  gap: 14px;
  border: 0;
  border-bottom: 1px solid var(--border);
  background: #ffffff;
  padding: 16px 22px;
  color: inherit;
  transition: background-color 0.12s;
}

.task-row:last-child {
  border-bottom: 0;
}

.task-row:hover {
  background: #f8faff;
}

.task-row.action-highlight {
  border-left: 4px solid var(--brand);
}

.task-row.overdue-highlight {
  border-left: 4px solid var(--rose);
}

.task-main {
  flex: 1;
  min-width: 0;
}

.task-main strong {
  font-size: 14px;
  font-weight: 600;
  color: var(--ink-1);
  display: block;
  margin: 4px 0;
}

.task-meta {
  display: block;
  color: var(--ink-3);
  font-size: 12px;
  line-height: 1.5;
}

/* 项目总档案 Master-Detail 工作台 */
.project-workspace {
  display: grid;
  grid-template-columns: 340px minmax(0, 1fr);
  gap: 20px;
  align-items: start;
}

.project-list-rail {
  display: flex;
  flex-direction: column;
  gap: 12px;
}

.project-rail-card {
  width: 100%;
  text-align: left;
  background: #ffffff;
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 18px;
  box-shadow: var(--shadow-card);
  transition: all 0.15s;
}

.project-rail-card:hover {
  border-color: #93c5fd;
}

.project-rail-card.active {
  border-color: var(--brand);
  box-shadow: 0 0 0 3px var(--brand-soft);
  background: #fcfdff;
}

.project-onepager-head {
  background: linear-gradient(135deg, #0f172a 0%, #1e3a8a 65%, #0052d9 100%);
  color: #ffffff;
  padding: 24px;
  border-radius: 16px;
  margin-bottom: 18px;
}

.project-onepager-head h2 {
  color: #ffffff;
  font-size: 20px;
  margin: 10px 0 6px;
}

.project-kpi-strip {
  display: grid;
  grid-template-columns: repeat(4, 1fr);
  gap: 12px;
  margin-top: 16px;
}

.project-kpi-cell {
  background: rgba(255, 255, 255, 0.1);
  border: 1px solid rgba(255, 255, 255, 0.16);
  border-radius: 12px;
  padding: 12px 14px;
}

.project-kpi-cell strong {
  display: block;
  font-size: 22px;
  color: #ffffff;
}

.project-kpi-cell span {
  font-size: 11.5px;
  color: rgba(255, 255, 255, 0.8);
}

/* ==================== 右侧滑出式抽屉 (<dialog> 规范) ==================== */
dialog:modal {
  overscroll-behavior: contain;
}

dialog::backdrop {
  background: rgba(15, 23, 42, 0.42);
  backdrop-filter: blur(2px);
  overflow: hidden;
  overscroll-behavior: contain;
}

dialog {
  border: 0;
  border-left: 1px solid var(--border);
  border-radius: 20px 0 0 20px;
  width: min(580px, 94vw);
  height: 100dvh;
  max-height: 100dvh;
  margin: 0 0 0 auto;
  padding: 0;
  box-shadow: var(--shadow-drawer);
  color: var(--ink-1);
  background: #ffffff;
}

dialog.drawer-wide {
  width: min(680px, 96vw);
}

dialog[open] {
  display: flex;
  flex-direction: column;
}

.dialog-top {
  padding: 20px 24px;
  border-bottom: 1px solid var(--border);
  display: flex;
  justify-content: space-between;
  align-items: center;
  background: #ffffff;
  position: sticky;
  top: 0;
  z-index: 5;
}

.dialog-alert {
  background: var(--rose-soft);
  color: #be123c;
  border-bottom: 1px solid var(--rose-border);
  padding: 12px 24px;
  font-size: 13px;
  font-weight: 500;
}

.dialog-body {
  padding: 24px;
  overflow-y: auto;
  flex: 1;
}

/* ==================== 抽屉内 5 步闭环条与双期限槽 ==================== */
.steps-bar {
  display: flex;
  justify-content: space-between;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 14px;
  padding: 16px 12px;
  margin-bottom: 20px;
}

.step-item {
  flex: 1;
  text-align: center;
  font-size: 12px;
  color: var(--ink-3);
}

.step-circle {
  width: 26px;
  height: 26px;
  border-radius: 50%;
  background: #e2e8f0;
  color: var(--ink-3);
  font-weight: 700;
  font-size: 12px;
  display: grid;
  place-items: center;
  margin: 0 auto 6px;
}

.step-item.done .step-circle {
  background: var(--emerald-soft);
  color: var(--emerald);
  border: 1px solid var(--emerald);
}

.step-item.current .step-circle {
  background: var(--brand);
  color: #ffffff;
  box-shadow: 0 0 0 4px var(--brand-soft);
}

.step-item.current {
  color: var(--brand);
  font-weight: 700;
}

.deadline-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin: 16px 0;
}

.deadline-box {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 16px;
}

.deadline-box.internal {
  background: var(--amber-soft);
  border-color: var(--amber-border);
}

.deadline-box.overdue {
  background: var(--rose-soft);
  border-color: var(--rose-border);
}

.deadline-box small {
  display: block;
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 600;
}

.deadline-box.internal small { color: #b45309; }
.deadline-box.overdue small { color: #be123c; }

.deadline-box strong {
  display: block;
  font-size: 14px;
  margin-top: 4px;
  font-variant-numeric: tabular-nums;
}

.detail-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 14px;
  margin: 14px 0 20px;
}

.detail-card {
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 12px;
  padding: 12px 14px;
}

.detail-label {
  font-size: 11.5px;
  color: var(--ink-3);
  font-weight: 600;
  margin-bottom: 4px;
}

.detail-value {
  font-size: 13.5px;
  color: var(--ink-1);
  line-height: 1.6;
  overflow-wrap: anywhere;
}

.detail-full {
  grid-column: 1 / -1;
}

/* ==================== 表单与交互后校验 (validate-input-after-interaction) ==================== */
.form-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 16px;
}

.form-grid label,
.field {
  font-size: 12.5px;
  font-weight: 600;
  color: var(--ink-2);
  display: flex;
  flex-direction: column;
  gap: 6px;
}

.field-hint {
  font-size: 11.5px;
  font-weight: 400;
  color: var(--ink-3);
}

.form-grid input,
.form-grid select,
.form-grid textarea,
.field textarea,
.field select,
.field input {
  width: 100%;
  border: 1px solid var(--border-strong);
  border-radius: 9px;
  padding: 10px 12px;
  background: #ffffff;
  color: var(--ink-1);
  min-width: 0;
  transition: border-color 0.15s, background-color 0.15s;
}

.form-grid textarea,
.field textarea {
  min-height: 88px;
  resize: vertical;
  line-height: 1.55;
}

input:user-invalid,
textarea:user-invalid,
select:user-invalid,
.user-invalid-fallback {
  border-color: var(--rose) !important;
  background-color: var(--rose-soft) !important;
}

input:user-valid,
textarea:user-valid {
  border-color: var(--emerald);
}

.full {
  grid-column: 1 / -1;
}

.form-actions {
  margin-top: 20px;
  display: flex;
  justify-content: flex-end;
  gap: 10px;
  flex-wrap: wrap;
}

.preset-chips {
  display: flex;
  flex-wrap: wrap;
  gap: 8px;
  margin-bottom: 10px;
}

.preset-chip {
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  color: var(--ink-2);
  border-radius: 999px;
  padding: 4px 12px;
  font-size: 12px;
  font-weight: 500;
}

.preset-chip:hover {
  border-color: var(--brand);
  color: var(--brand);
  background: var(--brand-soft);
}

.hint {
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.65;
  margin: 8px 0 14px;
}

.separator {
  border: 0;
  border-top: 1px solid var(--border);
  margin: 22px 0;
}

.check-option {
  display: inline-flex;
  align-items: center;
  gap: 8px;
  margin: 0 16px 10px 0;
  font-size: 13px;
  font-weight: 500;
}

.check-option input {
  width: auto;
}

.member-row {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 10px 14px;
  background: var(--bg-subtle);
  border: 1px solid var(--border);
  border-radius: 10px;
  margin-bottom: 8px;
  font-size: 13px;
}

/* ==================== 时间线与空态 ==================== */
.timeline {
  border-left: 2px solid #cbd5e1;
  padding-left: 18px;
  margin: 16px 0 8px 6px;
}

.timeline-entry {
  position: relative;
  padding: 0 0 18px;
}

.timeline-entry::before {
  content: "";
  position: absolute;
  width: 9px;
  height: 9px;
  border-radius: 50%;
  background: var(--brand);
  left: -23.5px;
  top: 5px;
  border: 2px solid #ffffff;
  box-shadow: 0 0 0 2px var(--brand-border);
}

.timeline-entry strong {
  font-size: 13px;
  font-weight: 600;
  color: var(--ink-1);
}

.timeline-entry p {
  font-size: 12.5px;
  color: var(--ink-2);
  margin: 5px 0;
  white-space: pre-wrap;
  overflow-wrap: anywhere;
}

.timeline-entry small {
  font-size: 11.5px;
  color: var(--ink-4);
}

.empty {
  text-align: center;
  color: var(--ink-3);
  font-size: 13px;
  padding: 48px 20px;
  line-height: 1.8;
}

.empty strong {
  display: block;
  color: var(--ink-1);
  font-weight: 600;
  font-size: 15px;
  margin-bottom: 4px;
}

.file-name {
  font-weight: 600;
  color: var(--ink-1);
}

.file-meta {
  font-size: 11.5px;
  color: var(--ink-3);
  margin-top: 3px;
}

/* ==================== 语义辅助类（严格遵守 CSP style-src 'self'） ==================== */
.matrix-card {
  margin-bottom: 12px;
}

.matrix-title {
  margin: 8px 0 4px;
}

.matrix-goal {
  margin: 4px 0 10px;
}

.onepager-id {
  color: rgba(255, 255, 255, 0.8);
}

.form-actions-left {
  justify-content: flex-start;
  margin-top: 12px;
}

.inline-select {
  padding: 8px 12px;
  border-radius: 8px;
  border: 1px solid var(--border-strong);
  background: #ffffff;
}

.seg-full {
  width: 100%;
  display: flex;
}

.seg-full .seg-btn {
  flex: 1;
}

.rail-card-title {
  margin: 10px 0 6px;
}

.row-gap-bottom {
  margin-bottom: 14px;
}

.sample-block {
  margin: 14px 0 8px;
}

.sample-block .preset-chips {
  margin-top: 6px;
}

.section-subhead {
  margin: 18px 0 10px;
}

.no-margin {
  margin: 0;
}

.text-warning {
  color: var(--amber);
}

.text-danger {
  color: var(--rose);
}

.text-success {
  color: var(--emerald);
  font-weight: 600;
}

/* ==================== 登录欢迎层与全局 Toast ==================== */
.login-layer {
  position: fixed;
  inset: 0;
  background: linear-gradient(135deg, #0f172a 0%, #1e293b 50%, #0f172a 100%);
  z-index: 30;
  display: grid;
  place-items: center;
  padding: 24px;
}

.login-card {
  max-width: 620px;
  width: 100%;
  background: #ffffff;
  padding: 40px;
  border-radius: 24px;
  box-shadow: 0 24px 80px rgba(0, 0, 0, 0.35);
}

.login-brand-row {
  display: flex;
  align-items: center;
  gap: 16px;
  margin-bottom: 16px;
}

.login-card h1 {
  font-size: 24px;
  margin: 2px 0 0;
}

.login-card p {
  color: var(--ink-2);
  font-size: 13.5px;
  line-height: 1.65;
}

.login-grid {
  display: grid;
  grid-template-columns: 1fr 1fr;
  gap: 12px;
  margin-top: 24px;
}

.login-role-btn {
  text-align: left;
  padding: 16px;
  border-radius: 14px;
  border: 1px solid var(--border-strong);
  background: var(--bg-subtle);
  display: flex;
  flex-direction: column;
  gap: 4px;
  transition: all 0.15s;
}

.login-role-btn:hover {
  border-color: var(--brand);
  background: var(--brand-soft);
  transform: translateY(-1px);
}

.login-role-btn strong {
  font-size: 14px;
  color: var(--ink-1);
}

.login-role-btn span {
  font-size: 12px;
  color: var(--ink-3);
}

.login-card small {
  display: block;
  font-size: 12px;
  color: var(--ink-3);
  line-height: 1.6;
  margin-top: 22px;
  padding-top: 16px;
  border-top: 1px solid var(--border);
}

#toast {
  position: fixed;
  bottom: 28px;
  left: 50%;
  transform: translateX(-50%);
  background: #0f172a;
  color: #ffffff;
  border-radius: 10px;
  padding: 12px 22px;
  z-index: 50;
  box-shadow: 0 10px 30px rgba(15, 23, 42, 0.28);
  max-width: 90vw;
  font-size: 13px;
  font-weight: 500;
}

/* ==================== 响应式断点适配 ==================== */
@media (max-width: 1180px) {
  .metrics {
    grid-template-columns: repeat(3, minmax(0, 1fr));
  }
  .bento,
  .project-workspace {
    grid-template-columns: 1fr;
  }
}

@media (max-width: 760px) {
  .shell {
    display: block;
  }
  .sidebar {
    position: relative;
    width: 100%;
    border-right: 0;
    border-bottom: 1px solid var(--border);
    padding: 16px;
  }
  .side-caption,
  .side-bottom {
    display: none;
  }
  nav {
    flex-direction: row;
    overflow-x: auto;
    gap: 6px;
  }
  nav button {
    white-space: nowrap;
    padding: 8px 12px;
  }
  .workspace {
    margin-left: 0;
  }
  .topbar {
    padding: 0 16px;
  }
  .workspace-name,
  .top-divider {
    display: none;
  }
  main {
    padding: 20px 16px;
  }
  .metrics {
    grid-template-columns: repeat(2, 1fr);
  }
  .form-grid,
  .detail-grid,
  .deadline-grid,
  .login-grid,
  .project-kpi-strip {
    grid-template-columns: 1fr;
  }
}

/* Role-aware workbench and compact, expandable operations evidence. */
.nav-group{border:0;margin:0 0 8px}.nav-group summary{list-style:none;cursor:pointer;display:flex;align-items:center;justify-content:space-between;padding:10px 13px 6px;font-size:11px;font-weight:700;letter-spacing:.08em;color:#536883}.nav-group summary::-webkit-details-marker{display:none}.nav-group summary:after{content:'›';transform:rotate(0deg);margin-left:8px}.nav-group[open] summary:after{transform:rotate(90deg)}.nav-group summary span{font-size:10px;font-weight:500;margin-left:auto;color:#536883}.nav-group>div{display:grid;gap:3px}.nav-group.contains-current summary{color:#174e8e}.nav-group summary:focus-visible{outline:2px solid var(--brand);outline-offset:2px;border-radius:8px}.role-scope-line{display:flex;align-items:center;justify-content:space-between;gap:12px;margin:-6px 0 14px}.role-scope-line>span{font-size:11px;font-weight:700;color:#356285;letter-spacing:.06em}.role-scope-line small{font-size:11px;color:#536883}.receipt-compact{display:flex;gap:12px;align-items:flex-start;font-size:12px}.receipt-compact details{flex:1;min-width:0}.receipt-compact summary{cursor:pointer;line-height:22px;font-weight:600}.receipt-compact summary span{margin-left:16px;font-size:11px;font-weight:400;color:#536883}.receipt-compact p{margin:8px 0;overflow-wrap:anywhere;font-weight:400}.receipt-dismiss{background:transparent;border:0;color:#536883;cursor:pointer;font-size:18px;min-width:28px;min-height:28px;border-radius:6px}.receipt-dismiss:hover{background:#e8eef6}.mask-banner:has(.receipt-compact){padding:8px 14px;margin-bottom:12px;background:#f0f8f5;border-color:#d5e9e0;color:#1b6048}.external-collaboration{display:flex;gap:28px;align-items:center;justify-content:space-between;padding:24px 28px;margin-bottom:24px;background:linear-gradient(112deg,#f5faff,#f3fbf8)}.external-collaboration h2{font-size:18px;margin:10px 0 8px}.external-collaboration p{color:#536883;font-size:12px;line-height:1.85;max-width:620px;margin:0}.external-shortcuts{display:grid;grid-template-columns:repeat(2,minmax(150px,1fr));gap:8px;flex-shrink:0}@media(max-width:1000px){.external-collaboration{align-items:stretch;flex-direction:column;gap:16px}.external-shortcuts{grid-template-columns:repeat(2,minmax(0,1fr))}.role-scope-line{align-items:flex-start;flex-direction:column;gap:6px}}@media(prefers-reduced-motion:reduce){*{scroll-behavior:auto!important}}
.task-pagination{display:flex;align-items:center;justify-content:space-between;gap:20px;padding:18px 22px;border-top:1px solid #e1e9f2}.task-pagination>div:first-child{display:flex;flex-wrap:wrap;gap:12px;font-size:12px;color:#536883}.task-pagination strong{color:#263f5e}.task-pagination small{width:100%;font-size:11px}.task-page-asof{margin:0;padding:0 22px 18px;font-size:11px;color:#536883;line-height:1.8}.task-page-size{display:flex;align-items:center;gap:8px;font-size:12px;color:#536883}.task-page-size select{min-height:32px;width:88px}.task-page-loading{padding:50px 24px;text-align:center;color:#536883;font-size:13px}.task-page-loading p{font-size:12px}.loading-ring{display:block;width:22px;height:22px;border:2px solid #d6e5fa;border-top-color:#0052d9;border-radius:50%;margin:0 auto 18px;animation:spin 1s linear infinite}@keyframes spin{to{transform:rotate(360deg)}}@media(max-width:900px){.task-pagination{align-items:flex-start;flex-direction:column}.task-pagination .actions{width:100%;justify-content:flex-end}}
.workspace>.mask-banner[role=note]{font-size:12px;line-height:1.7;padding:7px 16px;margin-bottom:10px;border-radius:8px}.mask-banner.receipt-rejected:has(.receipt-compact){background:#fff9ef;border-color:#eddfbf;color:#80571f}#write-recovery-status>.text-button,#write-recovery-dialog-status>.text-button{margin-left:12px}@media(max-width:760px){nav{display:grid;grid-template-columns:repeat(2,minmax(0,1fr));align-items:start;overflow:visible;gap:6px}.nav-group{margin:0;min-width:0}.nav-group summary{padding:9px 12px}.nav-group button{white-space:normal;font-size:12px;min-width:0}.sidebar{padding:14px}.nav-left{gap:8px}.nav-symbol{flex-shrink:0}}@media(prefers-reduced-motion:reduce){.loading-ring{animation:none}}

/* Compact, non-interactive test-data label. Live alerts retain their styles. */
.demo-notice { padding: 6px 20px; color: var(--ink-3); background: var(--brand-soft); font-size: 12px; line-height: 1.5; }
